auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static EntityClassType getEntityClassType(int id) { <START> return ID.get(id); <END> }</code><technical_language>this checked map.size() return a default if large</technical_language>

Target:
public static EntityClassType getEntityClassType(int id) { return (id >= ID.size() || id < 0) ? null : ID.get(id); }
Source:
<code>public void isValidAuthority(URL authorizationEndpoint, AuthenticationCallback<Boolean> callback) { if (authorizationEndpoint != null && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getHost()) && authorizationEndpoint.getProtocol().equals("https") && StringExtensions.IsNullOrBlank(authorizationEndpoint.getQuery()) && StringExtensions.IsNullOrBlank(authorizationEndpoint.getRef()) && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getPath()) && authorizationEndpoint.getPath().indexOf("/", 1) == -1 ) { if(isADFSAuthority(authorizationEndpoint)){ callback.onError(new AuthenticationException(ADALError.DISCOVERY_NOT_SUPPORTED)); }else if (mValidHosts.contains(authorizationEndpoint.getHost().toLowerCase(Locale.US))) { callback.onSuccess(true); }else{ queryInstance(authorizationEndpoint, callback); } }else{ <START> <END> callback.onSuccess(false); } }</code><technical_language>Extra white space</technical_language>

Target:
public void isValidAuthority(URL authorizationEndpoint, AuthenticationCallback<Boolean> callback) { if (authorizationEndpoint != null && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getHost()) && authorizationEndpoint.getProtocol().equals("https") && StringExtensions.IsNullOrBlank(authorizationEndpoint.getQuery()) && StringExtensions.IsNullOrBlank(authorizationEndpoint.getRef()) && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getPath())) { if (isADFSAuthority(authorizationEndpoint)) { callback.onError(new AuthenticationException(ADALError.DISCOVERY_NOT_SUPPORTED)); } else if (mValidHosts.contains(authorizationEndpoint.getHost().toLowerCase(Locale.US))) { callback.onSuccess(true); } else { queryInstance(authorizationEndpoint, callback); } } else { callback.onSuccess(false); } }
Source:
<code>public ComputationRunnerTerminatedContext( String name, LogOffset logOffset, long timestamp, RetryPolicy retryPolicy, Collection<LogPartition> partitions) { super(); this.name = name; this.logOffset = logOffset; this.timestamp = timestamp; this.retryPolicy = retryPolicy; this.partitions = new ArrayList<>(partitions); <START> Collections.sort(this.partitions, (c1, c2) -> c1.toString().compareTo(c2.toString())); <END> }</code><technical_language>do Collections.sort(this.partitions, Comparator.comparing(LogPartition::toString))</technical_language>

Target:
public ComputationRunnerTerminatedContext( String name, LogOffset logOffset, long timestamp, RetryPolicy retryPolicy, Collection<LogPartition> partitions) { super(); this.name = name; this.logOffset = logOffset; this.timestamp = timestamp; this.retryPolicy = retryPolicy; this.partitions = new ArrayList<>(partitions); Collections.sort(this.partitions, Comparator.comparing(LogPartition::toString)); }
Source:
<code><START> public ResponseEntity<Void> removeUserPhoto(@RequestHeader(value = Constants.PASSWORD_HEADER) Optional<String> password, <END> @PathVariable UUID userId) { try (CryptoSession cryptoSession = CryptoSession.start(password, () -> userService.canAccessPrivateData(userId))) { userPhotoService.removeUserPhoto(userId); return new ResponseEntity<Void>(HttpStatus.OK); } }</code><technical_language>If annotate this method @ResponseStatus(HttpStatus.OK), change return type simply void remove line 83</technical_language>

Target:
public void removeUserPhoto(@RequestHeader(value = Constants.PASSWORD_HEADER) Optional<String> password, @PathVariable UUID userId) { try (CryptoSession cryptoSession = CryptoSession.start(password, () -> userService.canAccessPrivateData(userId))) { userPhotoService.removeUserPhoto(userId); } }
Source:
<code>public void testGetCodeType() throws Exception { <START> ICodeService remoteService = createRemoteService(); <END> CodeServiceClientProxy service = createServiceUnderTest(remoteService); CompanyRatingCodeType ct1 = service.getCodeType(CompanyRatingCodeType.class); assertNotNull(ct1); CompanyRatingCodeType ct2 = service.getCodeType(CompanyRatingCodeType.class); assertNotNull(ct2); assertTrue(ct1 == ct2); CompanyTypeCodeType ct3 = service.getCodeType(CompanyTypeCodeType.class); assertNotNull(ct3); verify(remoteService, times(1)).getCodeType(CompanyRatingCodeType.class); verify(remoteService, times(1)).getCodeType(CompanyTypeCodeType.class); verifyNoMoreInteractions(remoteService); }</code><technical_language>I members initialized in a setup method, if setup occurs in tests</technical_language>

Target:
public void testGetCodeType() throws Exception { CompanyRatingCodeType ct1 = m_service.getCodeType(CompanyRatingCodeType.class); assertNotNull(ct1); CompanyRatingCodeType ct2 = m_service.getCodeType(CompanyRatingCodeType.class); assertNotNull(ct2); assertTrue(ct1 == ct2); CompanyTypeCodeType ct3 = m_service.getCodeType(CompanyTypeCodeType.class); assertNotNull(ct3); verify(m_remoteService, times(1)).getCodeType(CompanyRatingCodeType.class); verify(m_remoteService, times(1)).getCodeType(CompanyTypeCodeType.class); verifyNoMoreInteractions(m_remoteService); }
Source:
<code>public void shutdown() { logger.info("Shutting down Http2BlockingChannelPool."); <START> eventLoopGroup.shutdownGracefully(); <END> }</code><technical_language>Wait future for shutdown complete here</technical_language>

Target:
public void shutdown() { logger.info("Shutting down Http2BlockingChannelPool."); try { eventLoopGroup.shutdownGracefully().await(http2ClientConfig.http2BlockingChannelPoolShutdownTimeoutMs); } catch (InterruptedException e) { logger.info("EventLoopGroup shutdown timeout: ms", http2ClientConfig.http2BlockingChannelPoolShutdownTimeoutMs); } }
Source:
<code>public void createManagementNetworkIfRequired() { final String managementNetwork = NetworkUtils.getEngineNetwork(); if (host == null) { return; } Map<String, Network> vdsNetworks = Entities.entitiesByName(host.getNetworks()); <START> if (vdsNetworks.containsKey(managementNetwork)) { <END> log.info("The management network '{}' is already configured on host '{}'", managementNetwork, host.getName()); return; } if (!FeatureSupported.setupManagementNetwork(host.getVdsGroupCompatibilityVersion())) { log.warn("Cluster of host '{}' does not support normalize management network feature", host.getName()); return; } VdsNetworkInterface nic = findNicToSetupManagementNetwork(); if (nic == null) { return; } List<VdsNetworkInterface> interfaces = filterBondsWithoutSlaves(host.getInterfaces()); if (interfaces.contains(nic)) { nic.setNetworkName(managementNetwork); configureManagementNetwork(createSetupNetworkParams(interfaces)); } else { final AuditLogableBase event = createEvent(); event.addCustomValue("InterfaceName", nic.getName()); AuditLogDirector.log(event, AuditLogType.INVALID_INTERFACE_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } }</code><technical_language>This condition equivalent there... equivalent if checked configured management network IP address resolved hostname</technical_language>

Target:
public void createManagementNetworkIfRequired() { if (host == null) { return; } final String managementNetworkName = resolveManagementNetworkName(); final String hostManagementNetworkAddress = resolveHostManagementNetworkAddress(managementNetworkName); if (hostManagementNetworkAddress != null && hostManagementNetworkAddress.equals(host.getHostName())) { log.info("The management network '{}' is already configured on host '{}'", managementNetworkName, host.getName()); return; } if (!FeatureSupported.setupManagementNetwork(host.getVdsGroupCompatibilityVersion())) { log.warn("Cluster of host '{}' does not support normalize management network feature", host.getName()); return; } VdsNetworkInterface nic = findNicToSetupManagementNetwork(); if (nic == null) { return; } List<VdsNetworkInterface> interfaces = filterBondsWithoutSlaves(host.getInterfaces()); if (interfaces.contains(nic)) { nic.setNetworkName(managementNetworkName); configureManagementNetwork(createSetupNetworkParams(interfaces)); } else { final AuditLogableBase event = createEvent(); event.addCustomValue("InterfaceName", nic.getName()); auditLogDirector.log(event, AuditLogType.INVALID_INTERFACE_FOR_MANAGEMENT_NETWORK_CONFIGURATION, NETWORK_CONFIG_LOG_ERR); throw new NetworkConfiguratorException(MANAGEMENET_NETWORK_CONFIG_ERR); } }
Source:
<code>private void createTooltipShell(Shell parent, Control control, MouseEvent event, Point pt) { fModel.clear(); final Display display = parent.getDisplay(); <START> <END> if (fTipShell != null && !fTipShell.isDisposed()) { fTipShell.dispose(); } fTipShell = new Shell(parent, SWT.ON_TOP | SWT.TOOL | SWT.RESIZE | SWT.NO_SCROLL); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.MouseMove, fListener)); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.FocusOut, fFocusLostListener)); fTipShell.addListener(SWT.Deactivate, e -> { if (!fTipShell.isDisposed()) { fTipShell.dispose(); } }); fTipShell.setLayout(new FillLayout()); fTipShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); fTipComposite = new Composite(fTipShell, SWT.NO_FOCUS); fTipComposite.setLayout(new FillLayout()); fill(control, event, pt); ITooltipContent content = null; if (isBrowserAvailable(fTipComposite)) { content = new BrowserContent(fTipComposite); } else { content = new DefaultContent(fTipComposite); } content.setInput(fModel); content.create(); Point p = content.computePreferredSize(); Rectangle t = fTipShell.computeTrim(0, 0, p.x, p.y); fTipShell.setSize(Math.min(t.width, 750), Math.min(t.height, 700)); }</code><technical_language>indentation update part of patch</technical_language>

Target:
private void createTooltipShell(Shell parent, Control control, MouseEvent event, Point pt) { final Display display = parent.getDisplay(); if (fTipShell != null && !fTipShell.isDisposed()) { fTipShell.dispose(); } fModel.clear(); fTipShell = new Shell(parent, SWT.ON_TOP | SWT.TOOL | SWT.RESIZE | SWT.NO_SCROLL); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.MouseMove, fListener)); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.FocusOut, fFocusLostListener)); fTipShell.addListener(SWT.Deactivate, e -> { if (!fTipShell.isDisposed()) { fTipShell.dispose(); } }); fTipShell.setLayout(new FillLayout()); fTipShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); fTipComposite = new Composite(fTipShell, SWT.NO_FOCUS); fTipComposite.setLayout(new FillLayout()); fill(control, event, pt); ITooltipContent content = null; if (isBrowserAvailable(fTipComposite)) { content = new BrowserContent(fTipComposite); } else { content = new DefaultContent(fTipComposite); } content.setInput(fModel); content.create(); Point p = content.computePreferredSize(); Rectangle t = fTipShell.computeTrim(0, 0, p.x, p.y); fTipShell.setSize(Math.min(t.width, 750), Math.min(t.height, 700)); }
Source:
<code>public void start(StartContext context) { <START> modelControllerClient = modelControllerClientFactory.get().createSuperUserClient(managementExecutor.get()); <END> metricCollector = new MetricCollector(modelControllerClient, processStateNotifier.get()); metricCollectorConsumer.accept(metricCollector); }</code><technical_language>I do this metrics. :(</technical_language>

Target:
public void start(StartContext context) { modelControllerClient = modelControllerClientFactory.get().createClient(managementExecutor.get()); metricCollector = new MetricCollector(modelControllerClient, processStateNotifier.get()); metricCollectorConsumer.accept(metricCollector); }
Source:
<code>public Response getToolZip(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "toolId", required = true) @PathParam("toolId") Long toolId, @ApiParam(value = "tagId", required = true) @PathParam("tagId") Long tagId) { Tool tool = toolDAO.findById(toolId); if (tool.getIsPublished()) { <START> tool = toolDAO.findPublishedById(toolId); <END> checkEntry(tool); } else { checkEntry(tool); if (user.isPresent()) { checkUser(user.get(), tool); } else { throw new CustomWebApplicationException("Forbidden: you do not have the credentials required to access this entry.", HttpStatus.SC_FORBIDDEN); } } Tag tag = tool.getTags().stream().filter(innertag -> innertag.getId() == tagId).findFirst() .orElseThrow(() -> new CustomWebApplicationException("Could not find tag", HttpStatus.SC_NOT_FOUND)); Set<SourceFile> sourceFiles = tag.getSourceFiles(); if (sourceFiles == null || sourceFiles.size() == 0) { throw new CustomWebApplicationException("no files found to zip", HttpStatus.SC_NO_CONTENT); } String fileName = tool.getToolPath().replaceAll("/", "-") + ".zip"; return Response.ok().entity((StreamingOutput)output -> writeStreamAsZip(sourceFiles, output)) .header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build(); }</code><technical_language>This structure odd. If published, get a time id</technical_language>

Target:
public Response getToolZip(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "toolId", required = true) @PathParam("toolId") Long toolId, @ApiParam(value = "tagId", required = true) @PathParam("tagId") Long tagId) { Tool tool = toolDAO.findById(toolId); if (tool.getIsPublished()) { checkEntry(tool); } else { checkEntry(tool); if (user.isPresent()) { checkUser(user.get(), tool); } else { throw new CustomWebApplicationException("Forbidden: you do not have the credentials required to access this entry.", HttpStatus.SC_FORBIDDEN); } } Tag tag = tool.getTags().stream().filter(innertag -> innertag.getId() == tagId).findFirst() .orElseThrow(() -> new CustomWebApplicationException("Could not find tag", HttpStatus.SC_NOT_FOUND)); Set<SourceFile> sourceFiles = tag.getSourceFiles(); if (sourceFiles == null || sourceFiles.size() == 0) { throw new CustomWebApplicationException("no files found to zip", HttpStatus.SC_NO_CONTENT); } String fileName = tool.getToolPath().replaceAll("/", "-") + ".zip"; return Response.ok().entity((StreamingOutput)output -> writeStreamAsZip(sourceFiles, output)) .header("Content-Disposition", "attachment; filename=\"" + fileName + "\"").build(); }
Source:
<code>public void openDialog() { final String[] items = context.getResources().getStringArray(R.array.feed_episodes_sort_options); final String[] valueStrs = context.getResources().getStringArray(R.array.feed_episodes_sort_values); final SortOrder[] values = new SortOrder[valueStrs.length]; for (int i = 0; i < valueStrs.length; i++) { values[i] = SortOrder.valueOf(valueStrs[i]); } int idxCurrentSort = -1; for (int i = 0; i < values.length; i++) { <START> if (currentSortOrder == values[i] || currentSortOrder == null) { <END> idxCurrentSort = i; break; } } AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(R.string.sort); builder.setSingleChoiceItems(items, idxCurrentSort, (dialog, idxNewSort) -> { updateSort(values[idxNewSort]); dialog.dismiss(); }); builder.setNegativeButton(R.string.cancel_label, null); builder.create().show(); }</code><technical_language>Thanks for this. I a bit strange this check for loop. work initialize idxCurrentSort 0 instead</technical_language>

Target:
public void openDialog() { final String[] items = context.getResources().getStringArray(R.array.feed_episodes_sort_options); final String[] valueStrs = context.getResources().getStringArray(R.array.feed_episodes_sort_values); final SortOrder[] values = new SortOrder[valueStrs.length]; for (int i = 0; i < valueStrs.length; i++) { values[i] = SortOrder.valueOf(valueStrs[i]); } int idxCurrentSort = 0; for (int i = 0; i < values.length; i++) { if (currentSortOrder == values[i]) { idxCurrentSort = i; break; } } AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(R.string.sort); builder.setSingleChoiceItems(items, idxCurrentSort, (dialog, idxNewSort) -> { updateSort(values[idxNewSort]); dialog.dismiss(); }); builder.setNegativeButton(R.string.cancel_label, null); builder.create().show(); }
Source:
<code>public static void initDriver() throws Exception { synchronized (TestUtil.class) { if (initialized) { return; } Properties p = loadPropertyFiles("build.properties"); p.putAll(System.getProperties()); System.getProperties().putAll(p); if (org.postgresql.Driver.isRegistered()) { LogManager manager = LogManager.getLogManager(); java.util.logging.Logger logger = manager.getLogger("org.postgresql"); <START> switch (getLogLevel()) { <END> case 0: logger.setLevel(java.util.logging.Level.OFF); break; case 1: logger.setLevel(java.util.logging.Level.FINER); break; case 2: logger.setLevel(java.util.logging.Level.FINEST); break; } } initialized = true; } }</code><technical_language>I if this is part of TestUtil required all. nice if log-enablement approach for unit testing production purposes</technical_language>

Target:
public static void initDriver() throws Exception { synchronized (TestUtil.class) { if (initialized) { return; } Properties p = loadPropertyFiles("build.properties"); p.putAll(System.getProperties()); System.getProperties().putAll(p); initialized = true; } }
Source:
<code>public boolean isAllRecipientOptionsDisplayed(int questionNumber) { List<WebElement> recipientOptions = browser.driver.findElements(By.cssSelector("#recipienttype-" + questionNumber + " option")); for (WebElement recipientOption : recipientOptions) { String recipientOptionStyle = recipientOption.getAttribute("style"); <START> if ("display: none;".equals(recipientOptionStyle)) { <END> return false; } } return true; }</code><technical_language>!recipientOption.isDisplayed() do trick here. Besides, display: none; is fragile display:none;, display: none, display: none; style2: value2;</technical_language>

Target:
public boolean isAllRecipientOptionsDisplayed(int questionNumber) { List<WebElement> recipientOptions = browser.driver.findElements(By.cssSelector("#recipienttype-" + questionNumber + " option")); for (WebElement recipientOption : recipientOptions) { if ("none".equals(recipientOption.getCssValue("display"))) { return false; } } return true; }
Source:
<code>public StreamInflatingIndexingOutputStream(final OutputStream s1, final File indexFile) { try { this.s1 = s1; this.s2 = new PipedOutputStream(); final PipedInputStream pin = new PipedInputStream(this.s2, Defaults.NON_ZERO_BUFFER_SIZE); <START> this.thread = new Thread(new Indexer(indexFile.toPath(), pin), "BamIndexingThread"); <END> this.thread.start(); } catch (final IOException ioe) { throw new RuntimeIOException(ioe); } }</code><technical_language>add a constructor for Path here, delegate Fileone one</technical_language>

Target:
public StreamInflatingIndexingOutputStream(final OutputStream s1, final File indexFile) { this(s1, indexFile.toPath()); }
Source:
<code>public void removeDocument(String entityType, int entityId, int documentId) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerDocument.removeDocument(entityType, entityId, documentId) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<DocumentRelatedResponse>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); <START> if (e instanceof HttpException) { <END> try { String errorMessage = ((HttpException) e).response().errorBody() .string(); getMvpView().showErrorMessage(MFErrorParser.parseError(errorMessage) .getErrors().get(0).getDefaultUserMessage()); } catch (Throwable throwable) { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); } } else { getMvpView().showErrorMessage(e.getLocalizedMessage()); } } @Override public void onNext(DocumentRelatedResponse documentRemoveResponse) { getMvpView().showProgressbar(false); getMvpView().showDocumentRemovedSuccessfully(); } }) ); }</code><technical_language>this <LINK_0></technical_language>

Target:
public void removeDocument(String entityType, int entityId, int documentId) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerDocument.removeDocument(entityType, entityId, documentId) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<DocumentRelatedResponse>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showErrorMessage(MFErrorParser.errorMessage(e)); } @Override public void onNext(DocumentRelatedResponse documentRemoveResponse) { getMvpView().showProgressbar(false); getMvpView().showDocumentRemovedSuccessfully(); } }) ); }
Source:
<code>private static void parseConditions(XmlPullParser reader, SystemPropertyConditionBuilder conditionBuilder) throws XmlPullParserException, IOException { <START> atLeast1_7(reader); <END> assertNoAttributes(reader); int eventType; for (;;) { eventType = reader.nextTag(); switch (eventType) { case END_TAG: { return; } case START_TAG: { validateNamespace(reader); switch (reader.getName()) { case E_PROPERTY_EQUAL: parseConditionalProperty(reader, true, conditionBuilder); break; case E_PROPERTY_NOT_EQUAL: parseConditionalProperty(reader, false, conditionBuilder); break; default: throw unexpectedContent(reader); } break; } default: { throw unexpectedContent(reader); } } } }</code><technical_language>return is unused here</technical_language>

Target:
private static void parseConditions(XmlPullParser reader, SystemPropertyConditionBuilder conditionBuilder) throws XmlPullParserException, IOException { if(!atLeast1_7(reader)) { throw unexpectedContent(reader); } assertNoAttributes(reader); int eventType; for (;;) { eventType = reader.nextTag(); switch (eventType) { case END_TAG: { return; } case START_TAG: { validateNamespace(reader); switch (reader.getName()) { case E_PROPERTY_EQUAL: parseConditionalProperty(reader, true, conditionBuilder); break; case E_PROPERTY_NOT_EQUAL: parseConditionalProperty(reader, false, conditionBuilder); break; default: throw unexpectedContent(reader); } break; } default: { throw unexpectedContent(reader); } } } }
Source:
<code>private void checkHttpConnection() { String url = devMachine.getWsAgentBaseUrl() + '/'; final String pingUrl = restContext + "/workspace-agent-health/" + devMachine.getWorkspace() + '/' + WSAGENT_REFERENCE; asyncRequestFactory.createGetRequest(url).send(new StringUnmarshaller()).then(new Operation<String>() { @Override public void apply(String result) throws OperationException { JSONObject object = null; try { object = JSONParser.parseStrict(result).isObject(); } catch (Exception exception) { Log.warn(getClass(), "Parse root resources failed."); } <START> if (object != null && object.containsKey("rootResources")) { <END> JSONArray rootResources = object.get("rootResources").isArray(); for (int i = 0; i < rootResources.size(); i++) { JSONObject rootResource = rootResources.get(i).isObject(); String regex = rootResource.get("regex").isString().stringValue(); String fqn = rootResource.get("fqn").isString().stringValue(); String path = rootResource.get("path").isString().stringValue(); availableServices.add(new RestServiceInfo(fqn, regex, path)); } } checkWsConnection(); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { asyncRequestFactory.createGetRequest(pingUrl) .header(ACCEPT, APPLICATION_JSON) .send(dtoUnmarshallerFactory.newUnmarshaller(AgentHealthStateDto.class)) .then(new Operation<AgentHealthStateDto>() { @Override public void apply(AgentHealthStateDto arg) throws OperationException { if (RUNNING.equals(arg.getWorkspaceStatus())) { checkStateOfWsAgent(arg); } } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { Log.error(getClass(), arg.getMessage()); } }); } }); }</code><technical_language>if move this if-block upper try-block checking _object != null_ unnecessary</technical_language>

Target:
private void checkHttpConnection() { String url = devMachine.getWsAgentBaseUrl() + '/'; asyncRequestFactory.createGetRequest(url).send(new StringUnmarshaller()).then(new Operation<String>() { @Override public void apply(String result) throws OperationException { try { JSONObject object = JSONParser.parseStrict(result).isObject(); if (object.containsKey("rootResources")) { JSONArray rootResources = object.get("rootResources").isArray(); for (int i = 0; i < rootResources.size(); i++) { JSONObject rootResource = rootResources.get(i).isObject(); String regex = rootResource.get("regex").isString().stringValue(); String fqn = rootResource.get("fqn").isString().stringValue(); String path = rootResource.get("path").isString().stringValue(); availableServices.add(new RestServiceInfo(fqn, regex, path)); } } } catch (Exception exception) { Log.warn(getClass(), "Parse root resources failed."); } checkWsConnection(); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { checkWsAgentHealth(); } }); }
Source:
<code>boolean testRow(final int i, final long startTime) throws IOException, InterruptedException { if (opts.randomSleep > 0) { Thread.sleep(rd.nextInt(opts.randomSleep)); } <START> HRegionLocation hRegionLocation = regionLocator.getRegionLocation(Bytes.toBytes(Integer.toString(rd.nextInt(100) + 1)), true); <END> return true; }</code><technical_language>return is used</technical_language>

Target:
boolean testRow(final int i, final long startTime) throws IOException, InterruptedException { if (opts.randomSleep > 0) { Thread.sleep(rd.nextInt(opts.randomSleep)); } HRegionLocation hRegionLocation = regionLocator.getRegionLocation( getSplitKey(rd.nextInt(opts.perClientRunRows)), true); LOG.debug("get location for region: " + hRegionLocation); return true; }
Source:
<code>public RESTWorkItemHandler(String username, String password, ClassLoader classLoader, boolean doCacheClient, <START> int totalPoolConnections, <END> int maxPoolConnectionsPerRoute, String handlingProcessId, String handlingStrategy) { printProtocol(); this.username = username; this.password = password; this.type = AuthenticationType.BASIC; this.classLoader = classLoader; this.doCacheClient = doCacheClient; if (doCacheClient) { connectionManager.setMaxTotal(totalPoolConnections); connectionManager.setDefaultMaxPerRoute(maxPoolConnectionsPerRoute); } this.handlingProcessId = handlingProcessId; this.handlingStrategy = handlingStrategy; }</code><technical_language>Unnecessary space</technical_language>

Target:
public RESTWorkItemHandler(String username, String password, ClassLoader classLoader, boolean doCacheClient, int totalPoolConnections, int maxPoolConnectionsPerRoute, String handlingProcessId, String handlingStrategy) { logProtocol(); this.username = username; this.password = password; this.type = AuthenticationType.BASIC; this.classLoader = classLoader; this.doCacheClient = doCacheClient; if (doCacheClient) { connectionManager.setMaxTotal(totalPoolConnections); connectionManager.setDefaultMaxPerRoute(maxPoolConnectionsPerRoute); } this.handlingProcessId = handlingProcessId; this.handlingStrategy = handlingStrategy; }
Source:
<code>private void addMatch(final String match, final T value, final boolean immutableMatch, boolean notifyListeners) { lock.writeLock().lock(); try { String modifiedMatch = matchModifier.modify(match); <START> if (usesWildcards(modifiedMatch)) { <END> clearCache(); } else if (modifiedMatch != null && cache.containsKey(modifiedMatch)) { cache.remove(modifiedMatch); } if (immutableMatch) { immutables.add(modifiedMatch); } Match.verify(modifiedMatch, wildcardConfiguration); Match<T> match1 = new Match<>(modifiedMatch, value, wildcardConfiguration); matches.put(modifiedMatch, match1); } finally { lock.writeLock().unlock(); } if (notifyListeners) { onChange(); } }</code><technical_language>I see.. I thought other around. cache result, wildcards. so, this is fine. I merge a test I wrote part of this</technical_language>

Target:
private void addMatch(final String match, final T value, final boolean immutableMatch, boolean notifyListeners) { lock.writeLock().lock(); try { String modifiedMatch = matchModifier.modify(match); if (usesWildcards(modifiedMatch)) { clearCache(); } else if (modifiedMatch != null && cache.containsKey(modifiedMatch)) { cache.remove(modifiedMatch); } if (immutableMatch) { immutables.add(modifiedMatch); } Match.verify(modifiedMatch, wildcardConfiguration); Match<T> match1 = new Match<>(modifiedMatch, value, wildcardConfiguration); if (usesWildcards(modifiedMatch)) { wildcardMatches.put(modifiedMatch, match1); } else { exactMatches.put(modifiedMatch, match1); } } finally { lock.writeLock().unlock(); } if (notifyListeners) { onChange(); } }
Source:
<code>public VLCPlayer() { System.setProperty("jna.nosys", "true"); mediaPlayerComponent = new EmbeddedMediaPlayerComponent(); videoSurface = mediaPlayerComponent.getVideoSurface(); mediaPlayer = mediaPlayerComponent.getMediaPlayer(); gameSurface = EngineDesktop.frame.getLwjglCanvas().getCanvas(); mediaPlayer.setEnableKeyInputHandling(false); videoSurface.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { end(); } } }); mediaPlayer.addMediaPlayerEventListener(new MediaPlayerEventAdapter() { @Override public void finished(MediaPlayer mediaPlayer) { <START> Gdx.app.error("Video", "Video finished."); <END> skip = true; end(); } @Override public void error(MediaPlayer mediaPlayer) { Gdx.app.error("Video", "An error ocurred while playing video."); skip = true; end(); } }); }</code><technical_language>Is this error</technical_language>

Target:
public VLCPlayer() { tempVideos = new HashMap<String, String>(); try { System.setProperty("jna.nosys", "true"); mediaPlayerComponent = new EmbeddedMediaPlayerComponent(); videoSurface = mediaPlayerComponent.getVideoSurface(); mediaPlayer = mediaPlayerComponent.getMediaPlayer(); gameSurface = EngineDesktop.frame.getLwjglCanvas().getCanvas(); mediaPlayer.setEnableKeyInputHandling(false); videoSurface.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { end(); } } }); mediaPlayer .addMediaPlayerEventListener(new MediaPlayerEventAdapter() { @Override public void finished(MediaPlayer mediaPlayer) { Gdx.app.debug("Video", "Video finished."); skip = true; end(); } @Override public void error(MediaPlayer mediaPlayer) { Gdx.app.error("Video", "An error ocurred while playing video."); skip = true; end(); } }); vlcNotInstalled = false; } catch (Exception e) { Gdx.app .error("VLCPlayer", "VLC is not installed. All video's in this game will be skipped."); vlcNotInstalled = true; } }
Source:
<code>public void testSnippetTabStops() throws PartInitException, InvocationTargetException, CoreException { CompletionItem completionItem = createCompletionItem("sum(${1:x}, ${2:y})", CompletionItemKind.Method, new Range(new Position(0, 0), new Position(0, 1))); completionItem.setInsertTextFormat(InsertTextFormat.Snippet); MockLanguageSever.INSTANCE .setCompletionList(new CompletionList(false, Collections.singletonList(completionItem))); ITextViewer viewer = TestUtils.openTextViewer(TestUtils.createUniqueTestFile(project, "")); int invokeOffset = 0; ICompletionProposal[] proposals = contentAssistProcessor.computeCompletionProposals(viewer, invokeOffset); assertEquals(1, proposals.length); ((LSCompletionProposal) proposals[0]).apply(viewer, '\n', 0, invokeOffset); assertEquals("sum(x, y)", viewer.getDocument().get()); Point range = proposals[0].getSelection(null); assertEquals(range.x, 4); assertEquals(range.y, 1); Event event = new Event(); event.character = SWT.TAB; viewer.getTextWidget().notifyListeners(ST.VerifyKey, event); range = viewer.getSelectedRange(); assertEquals(range.x, 7); <START> assertEquals(range.y, 1); <END> }</code><technical_language>Asserts other round: expected result 1st parameter, leads counter-sense in error message failing</technical_language>

Target:
public void testSnippetTabStops() throws PartInitException, InvocationTargetException, CoreException { CompletionItem completionItem = createCompletionItem("sum(${1:x}, ${2:y})", CompletionItemKind.Method, new Range(new Position(0, 0), new Position(0, 1))); completionItem.setInsertTextFormat(InsertTextFormat.Snippet); MockLanguageSever.INSTANCE .setCompletionList(new CompletionList(false, Collections.singletonList(completionItem))); ITextViewer viewer = TestUtils.openTextViewer(TestUtils.createUniqueTestFile(project, "")); int invokeOffset = 0; ICompletionProposal[] proposals = contentAssistProcessor.computeCompletionProposals(viewer, invokeOffset); assertEquals(1, proposals.length); ((LSCompletionProposal) proposals[0]).apply(viewer, '\n', 0, invokeOffset); assertEquals("sum(x, y)", viewer.getDocument().get()); Point range = proposals[0].getSelection(viewer.getDocument()); assertEquals(4, range.x); assertEquals(1, range.y); Event event = new Event(); event.character = SWT.TAB; viewer.getTextWidget().notifyListeners(ST.VerifyKey, event); range = viewer.getSelectedRange(); assertEquals(7, range.x); assertEquals(1, range.y); }
Source:
<code>protected int getHighestProblemSeverity(IResource resource) { int problemSeverity = super.getHighestProblemSeverity(resource); if (resource instanceof IContainer && problemSeverity < IMarker.SEVERITY_ERROR) { try { final CompletableFuture<NestedProjectsProblemsModel> problemsModelSnapshot = refreshModelJob; if (problemsModelSnapshot != null) { problemSeverity = Math.max(problemSeverity, problemsModelSnapshot.get(50, TimeUnit.MILLISECONDS) .getMaxSeverityIncludingNestedProjects(resource)); } <START> } catch (InterruptedException | ExecutionException | RuntimeException e) { <END> WorkbenchNavigatorPlugin.log(e.getMessage(), new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, e.getMessage(), e)); } catch (TimeoutException e) { } } return problemSeverity; }</code><technical_language>put this block TimeoutExceptoin</technical_language>

Target:
protected int getHighestProblemSeverity(IResource resource) { int problemSeverity = super.getHighestProblemSeverity(resource); if (resource instanceof IContainer && problemSeverity < IMarker.SEVERITY_ERROR) { try { final CompletableFuture<NestedProjectsProblemsModel> problemsModelSnapshot = refreshModelJob; if (problemsModelSnapshot != null) { problemSeverity = Math.max(problemSeverity, problemsModelSnapshot.get(50, TimeUnit.MILLISECONDS) .getMaxSeverityIncludingNestedProjects(resource)); } } catch (TimeoutException e) { } catch (InterruptedException | ExecutionException | RuntimeException e) { WorkbenchNavigatorPlugin.log(e.getMessage(), new Status(IStatus.ERROR, WorkbenchNavigatorPlugin.PLUGIN_ID, e.getMessage(), e)); } } return problemSeverity; }
Source:
<code>public static <T extends Throwable> T rewrap(final String newMessage, final T throwable) { Preconditions.checkNotNull(throwable); <START> log.info("Rewrapping throwable with newMessage {}", newMessage, throwable); <END> try { Constructor<?>[] constructors = throwable.getClass().getConstructors(); for (Constructor<?> c : constructors) { if (Arrays.equals(new Class<?>[] {String.class, Throwable.class}, c.getParameterTypes())) { @SuppressWarnings("unchecked") T rv = (T) c.newInstance(newMessage, throwable); return rv; } else if (Arrays.equals(new Class<?>[] {String.class}, c.getParameterTypes())) { @SuppressWarnings("unchecked") T rv = (T) c.newInstance(newMessage); return chain(rv, throwable); } } return throwable; } catch (Exception e) { log.error("Unexpected error encountered while rewrapping throwable of class {}", throwable.getClass(), e); throw createPalantirRuntimeException(newMessage, throwable); } }</code><technical_language>this is desired</technical_language>

Target:
public static <T extends Throwable> T rewrap(final String newMessage, final T throwable) { Preconditions.checkNotNull(throwable); log.info("Rewrapping throwable with newMessage {}", throwable, newMessage); try { Constructor<?>[] constructors = throwable.getClass().getConstructors(); for (Constructor<?> c : constructors) { if (Arrays.equals(new Class<?>[] {String.class, Throwable.class}, c.getParameterTypes())) { @SuppressWarnings("unchecked") T rv = (T) c.newInstance(newMessage, throwable); return rv; } else if (Arrays.equals(new Class<?>[] {String.class}, c.getParameterTypes())) { @SuppressWarnings("unchecked") T rv = (T) c.newInstance(newMessage); return chain(rv, throwable); } } return throwable; } catch (Exception e) { log.error("Unexpected error encountered while rewrapping throwable of class {}", throwable.getClass(), e); throw createPalantirRuntimeException(newMessage, throwable); } }
Source:
<code>public <T> T getProxy(Invoker<T> invoker, boolean generic) throws RpcException { Set<Class<?>> interfaces = new HashSet<Class<?>>(); String config = invoker.getUrl().getParameter(INTERFACES); if (config != null && config.length() > 0) { String[] types = COMMA_SPLIT_PATTERN.split(config); for (String type : types) { interfaces.add(ReflectUtils.forName(type)); } } interfaces.add(EchoService.class); if (generic) { if (!GenericService.class.isAssignableFrom(invoker.getInterface())) { <START> interfaces.add(GenericService.class); <END> } try { String realInterface = invoker.getUrl().getParameter(Constants.INTERFACE); interfaces.add(ReflectUtils.forName(realInterface)); } catch (Throwable e) { } } return getProxy(invoker, interfaces.toArray(new Class<?>[0])); }</code><technical_language>com.alibaba.dubbo.rpc.service.GenericService b supported</technical_language>

Target:
public <T> T getProxy(Invoker<T> invoker, boolean generic) throws RpcException { Set<Class<?>> interfaces = new HashSet<>(); String config = invoker.getUrl().getParameter(INTERFACES); if (config != null && config.length() > 0) { String[] types = COMMA_SPLIT_PATTERN.split(config); for (String type : types) { interfaces.add(ReflectUtils.forName(type)); } } if (generic) { if (!GenericService.class.isAssignableFrom(invoker.getInterface())) { interfaces.add(com.alibaba.dubbo.rpc.service.GenericService.class); } try { String realInterface = invoker.getUrl().getParameter(Constants.INTERFACE); interfaces.add(ReflectUtils.forName(realInterface)); } catch (Throwable e) { } } interfaces.add(invoker.getInterface()); interfaces.addAll(Arrays.asList(INTERNAL_INTERFACES)); return getProxy(invoker, interfaces.toArray(new Class<?>[0])); }
Source:
<code>private void updateActionAvailability() { VDS vds = getEntity(); boolean createBrickAllowed = false; boolean syncStorageDeviceAllowed = false; if (vds != null && vds.getStatus() == VDSStatus.Up) { syncStorageDeviceAllowed = true; createBrickAllowed = !getItems().isEmpty() && canCreateBrick(); if (createBrickAllowed && !getSelectedItems().isEmpty()) { for (StorageDevice device : getSelectedItems()) { <START> if (device.getCanCreateBrick()) { <END> createBrickAllowed = false; break; } } } } getSyncStorageDevicesCommand().setIsExecutionAllowed(syncStorageDeviceAllowed); getCreateBrickCommand().setIsExecutionAllowed(createBrickAllowed); }</code><technical_language>Mutually exclusive canCreateBrick() condition</technical_language>

Target:
private void updateActionAvailability() { VDS vds = getEntity(); boolean createBrickAllowed = false; boolean syncStorageDeviceAllowed = false; if (vds != null && vds.getStatus() == VDSStatus.Up) { syncStorageDeviceAllowed = true; createBrickAllowed = !getItems().isEmpty() && canCreateBrick(); if (createBrickAllowed && !getSelectedItems().isEmpty()) { for (StorageDevice device : getSelectedItems()) { if (!device.getCanCreateBrick()) { createBrickAllowed = false; break; } } } } getSyncStorageDevicesCommand().setIsExecutionAllowed(syncStorageDeviceAllowed); getCreateBrickCommand().setIsExecutionAllowed(createBrickAllowed); }
Source:
<code>public Observable<Channels> getChannelsFor(User user) { return Observable.zip( privateChannelsFor(user), publicChannels(), new Func2<List<Channel>, List<Channel>, Channels>() { @Override <START> public Channels call(List<Channel> channels, List<Channel> channels2) { <END> List<Channel> combinedChannels = new ArrayList<>(channels); combinedChannels.addAll(channels2); return new Channels(combinedChannels); } } ); }</code><technical_language>channels2</technical_language>

Target:
public Observable<Channels> getChannelsFor(User user) { return Observable.zip( privateChannelsFor(user), publicChannels(), new Func2<List<Channel>, List<Channel>, Channels>() { @Override public Channels call(List<Channel> privateChannels, List<Channel> publicChannels) { List<Channel> combinedChannels = new ArrayList<>(privateChannels); combinedChannels.addAll(publicChannels); return new Channels(combinedChannels); } } ); }
Source:
<code>public static List<ITmfStateInterval> queryHistoryRange(ITmfStateSystem ss, int attributeQuark, long t1, long t2, long resolution, @Nullable IProgressMonitor monitor) throws AttributeNotFoundException, StateSystemDisposedException { List<ITmfStateInterval> intervals = new LinkedList<>(); <START> Iterator<ITmfStateInterval> iter = getIteratorOverQuark(ss, attributeQuark, t1, t2); while (iter.hasNext()) { if (monitor != null && monitor.isCanceled()) { return intervals; } intervals.add(iter.next()); } <END> return intervals; }</code><technical_language>This replace. respect resolution constraint, need filter intervals overlap t t = start + n*resolution</technical_language>

Target:
public static List<ITmfStateInterval> queryHistoryRange(ITmfStateSystem ss, int attributeQuark, long t1, long t2, long resolution, @Nullable IProgressMonitor monitor) throws AttributeNotFoundException, StateSystemDisposedException { List<ITmfStateInterval> intervals = new LinkedList<>(); ITmfStateInterval currentInterval = null; long ts, tEnd; if (t2 < t1 || resolution <= 0) { throw new TimeRangeException(ss.getSSID() + " Start:" + t1 + ", End:" + t2 + ", Resolution:" + resolution); } if (t2 > ss.getCurrentEndTime()) { tEnd = ss.getCurrentEndTime(); } else { tEnd = t2; } IProgressMonitor mon = monitor; if (mon == null) { mon = new NullProgressMonitor(); } for (ts = t1; ts <= tEnd; ts += ((currentInterval.getEndTime() - ts) / resolution + 1) * resolution) { if (mon.isCanceled()) { return intervals; } currentInterval = ss.querySingleState(ts, attributeQuark); intervals.add(currentInterval); } if (currentInterval != null && currentInterval.getEndTime() < tEnd) { currentInterval = ss.querySingleState(tEnd, attributeQuark); intervals.add(currentInterval); } return intervals; }
Source:
<code>public boolean equals(final Object that) { <START> return this == that || ResponseOf.class.equals(that.getClass()); <END> }</code><technical_language>@fanifieiev please, [here](<LINK_0></technical_language>

Target:
public boolean equals(final Object that) { return new Unchecked<>( new Or( () -> this == that, new And( () -> that != null, () -> ResponseOf.class.equals(that.getClass()), () -> { final ResponseOf other = (ResponseOf) that; return new And( () -> { final Iterator<String> iter = other.head() .iterator(); return new And( (String hdr) -> hdr.equals(iter.next()), this.head() ).value(); }, () -> new Equality<>( new BytesOf(this.body()), new BytesOf(other.body()) ).value() == 0 ).value(); } ) ) ).value(); }
Source:
<code>protected boolean isHoliday(final HolidaySearchRequest request, final LocalDate dateToCheck) { ArgumentChecker.notNull(request, "request"); ArgumentChecker.notNull(dateToCheck, "dateToCheck"); if (isWeekend(dateToCheck)) { return true; } if (_cacheHolidayCalendars) { ImmutableSet<LocalDate> cachedDates = _cachedHolidays.get(request); if (cachedDates != null) { if (cachedDates.isEmpty()) { return false; } <START> return cachedDates.contains(dateToCheck); <END> } HolidayDocument doc = getMaster().search(request).getFirstDocument(); HolidaySearchRequest cacheKey = request.clone(); if (doc == null) { _cachedHolidays.put(cacheKey, EMPTY); } else { _cachedHolidays.put(cacheKey, ImmutableSet.copyOf(doc.getHoliday().getHolidayDates())); } return isHoliday(doc, dateToCheck); } request.setDateToCheck(dateToCheck); HolidayDocument doc = getMaster().search(request).getFirstDocument(); return isHoliday(doc, dateToCheck); }</code><technical_language>of this if, just: return !cachedDates.isEmpty() && cachedDates.contains(dateToCheck);? suggest isEmpty check adds method complication use: cachedDates.contains(dateToCheck);</technical_language>

Target:
protected boolean isHoliday(final HolidaySearchRequest request, final LocalDate dateToCheck) { ArgumentChecker.notNull(request, "request"); ArgumentChecker.notNull(dateToCheck, "dateToCheck"); if (isWeekend(dateToCheck)) { return true; } if (_cacheHolidayCalendars) { ImmutableSet<LocalDate> cachedDates = _cachedHolidays.get(request); if (cachedDates != null) { return cachedDates.contains(dateToCheck); } HolidayDocument doc = getMaster().search(request).getFirstDocument(); HolidaySearchRequest cacheKey = request.clone(); if (doc == null) { _cachedHolidays.put(cacheKey, EMPTY); } else { _cachedHolidays.put(cacheKey, ImmutableSet.copyOf(doc.getHoliday().getHolidayDates())); } return isHoliday(doc, dateToCheck); } request.setDateToCheck(dateToCheck); HolidayDocument doc = getMaster().search(request).getFirstDocument(); return isHoliday(doc, dateToCheck); }
Source:
<code>public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(ADMINISTER); BulkChange bc = new BulkChange(this); try { JSONObject json = req.getSubmittedForm(); MasterBuildConfiguration mbc = ExtensionList.lookupSingleton(MasterBuildConfiguration.class); <START> mbc.configure(req,json); <END> getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all()); } finally { bc.commit(); } updateComputerList(); rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl()); }</code><technical_language>inline var</technical_language>

Target:
public synchronized void doConfigExecutorsSubmit( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, FormException { checkPermission(ADMINISTER); BulkChange bc = new BulkChange(this); try { JSONObject json = req.getSubmittedForm(); ExtensionList.lookupSingleton(MasterBuildConfiguration.class).configure(req,json); getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all()); } finally { bc.commit(); } updateComputerList(); rsp.sendRedirect(req.getContextPath()+'/'+toComputer().getUrl()); }
Source:
<code><START> public void setValue(int value) <END> { healthValue = value; }</code><technical_language>break lines</technical_language>

Target:
public void setValue(int value) { _healthValue = value; }
Source:
<code>public Object[] transform(String sourceData) throws FormatException { try { Object list[] = m_parser.parseLine(sourceData); if (list != null) { for (int i = 0; i < list.length; i++) { if ("NULL".equals(list[i]) || Constants.CSV_NULL.equals(list[i]) || Constants.QUOTED_CSV_NULL.equals(list[i])) { list[i] = null; } } } return list; } catch (IOException e) { <START> throw new FormatException(e); <END> } }</code><technical_language>throw new FormatException("failed format " + sourceData, e);</technical_language>

Target:
public Object[] transform(String sourceData) throws FormatException { try { Object list[] = m_parser.parseLine(sourceData); if (list != null) { for (int i = 0; i < list.length; i++) { if ("NULL".equals(list[i]) || Constants.CSV_NULL.equals(list[i]) || Constants.QUOTED_CSV_NULL.equals(list[i])) { list[i] = null; } } } return list; } catch (IOException e) { throw new FormatException("failed to format " + sourceData, e); } }
Source:
<code>private boolean overlapsInterval(final VariantContext ctx, final Interval interval) { if (!ctx.getContig().equals(interval.getContig())) return false; else if (CoordMath.overlaps(ctx.getStart(), ctx.getEnd(), interval.getStart(), interval.getEnd())) return true; <START> else if (CoordMath.encloses(ctx.getStart(), ctx.getEnd(), interval.getStart(), interval.getEnd())) return true; <END> else if (CoordMath.encloses(interval.getStart(), interval.getEnd(), ctx.getStart(), ctx.getEnd())) return true; else return false; }</code><technical_language>I need lines, overlaps includes directions of "encloses"</technical_language>

Target:
private boolean overlapsInterval(final VariantContext ctx, final Interval interval) { if (!ctx.getContig().equals(interval.getContig())) return false; else if (CoordMath.overlaps(ctx.getStart(), ctx.getEnd(), interval.getStart(), interval.getEnd())) return true; else return false; }