auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object[] getSelectableProducts(final IProgressMonitor monitor) throws XmlRpcException { return (new BugzillaXmlRpcOperation<Object[]>(this) { @Override public Object[] execute() throws XmlRpcException { Object[] result = null; HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_PRODUCT_GET_SELECTABLE, (token == null) ? null : new Object[] { new HashMap<String, Object>() { { <START> put(XML_PARAMETER_TOKEN, token); <END> } } }); result = response2ObjectArray(response, XML_RESPONSE_IDS); return result; } }).execute(); }</code><technical_language>Consider writing this more simply, e.g. Collections.singletonMap()</technical_language>

Target:
public Object[] getSelectableProducts(final IProgressMonitor monitor) throws XmlRpcException { return (new BugzillaXmlRpcOperation<Object[]>(this) { @Override public Object[] execute() throws XmlRpcException { Object[] result = null; HashMap<?, ?> response = (HashMap<?, ?>) call(monitor, XML_PRODUCT_GET_SELECTABLE, (token == null) ? null : new Object[] { Collections.singletonMap(XML_PARAMETER_TOKEN, token) }); result = response2ObjectArray(response, XML_RESPONSE_IDS); return result; } }).execute(); }
Source:
<code>private void onGitRepositoryDeletedEventReceived(String projectPath) { try { ProjectManager projectManager = projectManagerProvider.get(); projectManager.removeType(projectPath, CONTRIBUTION_PROJECT_TYPE_ID); RegisteredProject project = projectManager.get(projectPath).get(); Map<String, List<String>> attributes = project.getAttributes(); attributes.remove(CONTRIBUTE_LOCAL_BRANCH_NAME); attributes.remove(CONTRIBUTE_TO_BRANCH_VARIABLE_NAME); NewProjectConfigImpl projectConfig = new NewProjectConfigImpl( project.getPath(), project.getType(), project.getMixins(), project.getName(), project.getDescription(), attributes, null, project.getSource()); projectManager.update(projectConfig); } catch (NotFoundException e) { LOG.error( "Project not found for removing type", projectPath, CONTRIBUTION_PROJECT_TYPE_ID, e); } catch (ServerException e) { <START> e.printStackTrace(); <END> } catch (ConflictException | BadRequestException | ForbiddenException ignore) { LOG.warn( "Usually should not occur. But exception occurred during removing project type", CONTRIBUTION_PROJECT_TYPE_ID, ignore); } }</code><technical_language>LOG.error simple explanation in message better</technical_language>

Target:
private void onGitRepositoryDeletedEventReceived(String projectPath) { try { ProjectManager projectManager = projectManagerProvider.get(); projectManager.removeType(projectPath, CONTRIBUTION_PROJECT_TYPE_ID); RegisteredProject project = projectManager.get(projectPath).get(); Map<String, List<String>> attributes = project.getAttributes(); attributes.remove(CONTRIBUTE_LOCAL_BRANCH_NAME); attributes.remove(CONTRIBUTE_TO_BRANCH_VARIABLE_NAME); NewProjectConfigImpl projectConfig = new NewProjectConfigImpl( project.getPath(), project.getType(), project.getMixins(), project.getName(), project.getDescription(), attributes, null, project.getSource()); projectManager.update(projectConfig); } catch (NotFoundException e) { LOG.error( "Project not found for removing type", projectPath, CONTRIBUTION_PROJECT_TYPE_ID, e); } catch (ServerException e) { LOG.error( "Exception occurred during removing project type for project ", CONTRIBUTION_PROJECT_TYPE_ID, projectPath, e); } catch (ConflictException | BadRequestException | ForbiddenException ignore) { LOG.warn( "Usually should not occur. But exception occurred during removing project type", CONTRIBUTION_PROJECT_TYPE_ID, ignore); } }
Source:
<code>@Override public CacheableLocator createLocator(AnnotatedElement annotatedElement) { TimeOutDuration customDuration; if (annotatedElement.isAnnotationPresent(WithTimeout.class)) { WithTimeout withTimeout = annotatedElement.getAnnotation(WithTimeout.class); customDuration = new TimeOutDuration(withTimeout.time(), withTimeout.unit()); } else { customDuration = duration; } builder.setAnnotated(annotatedElement); By byResult = builder.buildBy(); return ofNullable(byResult) .map(by -> new AppiumElementLocator(searchContext, by, builder.isLookupCached(), customDuration)) <START> .orElse(null); <END> }</code><technical_language>method marked Nullable</technical_language>

Target:
@Override public @Nullable CacheableLocator createLocator(AnnotatedElement annotatedElement) { TimeOutDuration customDuration; if (annotatedElement.isAnnotationPresent(WithTimeout.class)) { WithTimeout withTimeout = annotatedElement.getAnnotation(WithTimeout.class); customDuration = new TimeOutDuration(withTimeout.time(), withTimeout.unit()); } else { customDuration = duration; } builder.setAnnotated(annotatedElement); By byResult = builder.buildBy(); return ofNullable(byResult) .map(by -> new AppiumElementLocator(searchContext, by, builder.isLookupCached(), customDuration)) .orElse(null); }
Source:
<code>public CSVLexer(final Reader input, final char valueSeparator, final char textMarker, final boolean keepBeginningWhiteSpace) { this.input = new RewindableTextStream(input); this.separator = valueSeparator; this.textMarker = textMarker; <START> this.builder = new LinkedList<Character>(); <END> this.lastTokenType = TOKEN_ERROR; this.lastTokenValue = null; this.keepBeginningWhiteSpace = keepBeginningWhiteSpace; }</code><technical_language>LinkedList is choice for characters; a StringBuilder initial size of BUFFER_SIZE more relevant lighter</technical_language>

Target:
public CSVLexer(final Reader input, final char valueSeparator, final char textMarker, final boolean keepBeginningWhiteSpace) { this.input = new RewindableTextStream(input); this.separator = valueSeparator; this.textMarker = textMarker; this.builder = new StringBuilder(BUFFER_SIZE); this.lastTokenType = TOKEN_ERROR; this.lastTokenValue = null; this.keepBeginningWhiteSpace = keepBeginningWhiteSpace; }
Source:
<code>public static void main(String[] args) { Config config = new Config(); config.getAdvancedNetworkConfig().setEnabled(true); config.getAdvancedNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); config.getAdvancedNetworkConfig().getJoin() .getTcpIpConfig().setEnabled(true).addMember("192.168.1.10,192.168.1.11,192.168.1.12"); <START> <END> config.getAdvancedNetworkConfig().setMemberEndpointConfig(createMemberEndpointConfig()); config.getAdvancedNetworkConfig().setClientEndpointConfig(createClientEndpointConfig()); config.getAdvancedNetworkConfig().addWanEndpointConfig(createWanEndpointConfig()); config.addWanReplicationConfig( new WanReplicationConfig() .setName("active-wan-replication") .addWanPublisherConfig( new WanPublisherConfig() .setGroupName("cluster-b") .setClassName("com.hazelcast.enterprise.wan.replication.WanBatchReplication") .setEndpoint("active-wan"))); config.addMapConfig( new MapConfig("wan-map") .setWanReplicationRef( new WanReplicationRef("active-wan-replication", "com.hazelcast.enterprise.wan.replication.WanBatchReplication", Collections.<String>emptyList(), false))); HazelcastInstance hz = Hazelcast.newHazelcastInstance(config); }</code><technical_language>192.168.1.0-255 -> 192.168.1.10-12</technical_language>

Target:
public static void main(String[] args) { Config config = new Config(); config.getAdvancedNetworkConfig().setEnabled(true); config.getAdvancedNetworkConfig().getJoin().getMulticastConfig().setEnabled(false); config.getAdvancedNetworkConfig().getJoin() .getTcpIpConfig().setEnabled(true).addMember("192.168.1.10,192.168.1.11,192.168.1.12"); config.getAdvancedNetworkConfig().setMemberEndpointConfig(createMemberEndpointConfig()); config.getAdvancedNetworkConfig().setClientEndpointConfig(createClientEndpointConfig()); config.getAdvancedNetworkConfig().addWanEndpointConfig(createWanEndpointConfig()); WanPublisherConfig wanPublisherConfig = new WanPublisherConfig() .setGroupName("cluster-b") .setClassName("com.hazelcast.enterprise.wan.replication.WanBatchReplication") .setEndpoint("active-wan"); Map<String, Comparable> props = wanPublisherConfig.getProperties(); props.put("endpoints", "147.102.1.10:8443,147.102.1.11:8443,147.102.1.12:8443"); props.put("group.password", "clusterB-pass"); config.addWanReplicationConfig( new WanReplicationConfig() .setName("active-wan-replication") .addWanPublisherConfig(wanPublisherConfig)); config.addMapConfig( new MapConfig("wan-map") .setWanReplicationRef( new WanReplicationRef("active-wan-replication", "com.hazelcast.enterprise.wan.replication.WanBatchReplication", Collections.<String>emptyList(), false))); HazelcastInstance hz = Hazelcast.newHazelcastInstance(config); }
Source:
<code>public String toString() { return "RefundEntity{" + "externalId='" + externalId + '\'' + ", reference='" + reference + '\'' + ", amount=" + amount + ", status='" + status + '\'' + <START> ", refundedBy='" + refundedBy + '\'' + <END> ", chargeEntity=" + chargeEntity + ", createdDate=" + createdDate + '}'; }</code><technical_language>Another place name updated</technical_language>

Target:
public String toString() { return "RefundEntity{" + "externalId='" + externalId + '\'' + ", reference='" + reference + '\'' + ", amount=" + amount + ", status='" + status + '\'' + ", userExternalId='" + userExternalId + '\'' + ", chargeEntity=" + chargeEntity + ", createdDate=" + createdDate + '}'; }
Source:
<code>private <START> static String <END> prependZeroes(String twoBytes) { StringBuilder builder = new StringBuilder(); int zeroLen = 4 - twoBytes.length(); for (int i = 0; i < zeroLen; i++) { builder.append(ZERO_STRING); } builder.append(twoBytes); return builder.toString(); }</code><technical_language>static</technical_language>

Target:
private String prependZeroes(String twoBytes) { StringBuilder builder = new StringBuilder(); int zeroLen = 4 - twoBytes.length(); for (int i = 0; i < zeroLen; i++) { builder.append(ZERO_STRING); } builder.append(twoBytes); return builder.toString(); }
Source:
<code>public int runCmd(CommandLine cmdLine) throws Exception { ClientConfiguration adminConf = new ClientConfiguration(bkConf); BookKeeperAdmin admin = new BookKeeperAdmin(adminConf); try { final String remoteBookieidToDecommission = cmdLine.getOptionValue("bookieid"); final BookieSocketAddress bookieAddressToDecommission = (StringUtils .isBlank(remoteBookieidToDecommission) ? Bookie.getBookieAddress(bkConf) : new BookieSocketAddress(remoteBookieidToDecommission)); admin.decommissionBookie(bookieAddressToDecommission); <START> LOG.info("The ledgers stored in the given decommissioning bookie are properly replicated"); <END> runFunctionWithRegistrationManager(bkConf, rm -> { try { Versioned<Cookie> cookie = Cookie.readFromRegistrationManager(rm, bookieAddressToDecommission); cookie.getValue().deleteFromRegistrationManager(rm, bookieAddressToDecommission, cookie.getVersion()); } catch (CookieNotFoundException nne) { LOG.warn("No cookie to remove, it could be deleted already : ", nne); } catch (BookieException be) { throw new UncheckedExecutionException(be.getMessage(), be); } return 0; }); LOG.info("Cookie of the decommissioned bookie: is deleted successfully", bookieAddressToDecommission); return 0; } catch (Exception e) { LOG.error("Received exception in DecommissionBookieCmd ", e); return -1; } finally { if (admin != null) { admin.close(); } } }</code><technical_language>add bookieAddressToDecommission logging statement</technical_language>

Target:
public int runCmd(CommandLine cmdLine) throws Exception { ClientConfiguration adminConf = new ClientConfiguration(bkConf); BookKeeperAdmin admin = new BookKeeperAdmin(adminConf); try { final String remoteBookieidToDecommission = cmdLine.getOptionValue("bookieid"); final BookieSocketAddress bookieAddressToDecommission = (StringUtils .isBlank(remoteBookieidToDecommission) ? Bookie.getBookieAddress(bkConf) : new BookieSocketAddress(remoteBookieidToDecommission)); admin.decommissionBookie(bookieAddressToDecommission); LOG.info("The ledgers stored in the given decommissioning bookie: are properly replicated", bookieAddressToDecommission); runFunctionWithRegistrationManager(bkConf, rm -> { try { Versioned<Cookie> cookie = Cookie.readFromRegistrationManager(rm, bookieAddressToDecommission); cookie.getValue().deleteFromRegistrationManager(rm, bookieAddressToDecommission, cookie.getVersion()); } catch (CookieNotFoundException nne) { LOG.warn("No cookie to remove for the decommissioning bookie: {}, it could be deleted already", bookieAddressToDecommission, nne); } catch (BookieException be) { throw new UncheckedExecutionException(be.getMessage(), be); } return 0; }); LOG.info("Cookie of the decommissioned bookie: is deleted successfully", bookieAddressToDecommission); return 0; } catch (Exception e) { LOG.error("Received exception in DecommissionBookieCmd ", e); return -1; } finally { if (admin != null) { admin.close(); } } }
Source:
<code>public void onActivate(ActivateEvent event, EntityRef entity) { EntityRef attackingPlayer = event.getInstigator(); if (attackingPlayer.getComponent(CharacterHeldItemComponent.class).selectedItem.hasComponent(RaycastOnActivateComponent.class)) { if (entity.hasComponent(PlayerCharacterComponent.class) && entity.hasComponent(CharacterHeldItemComponent.class)) { CharacterHeldItemComponent characterHeldItemComponent = entity.getComponent(CharacterHeldItemComponent.class); EntityRef heldItem = characterHeldItemComponent.selectedItem; if (heldItem.getComponent(BlockItemComponent.class).blockFamily.getURI().toString().equals(BLACK_FLAG_URI) || heldItem.getComponent(BlockItemComponent.class).blockFamily.getURI().toString().equals(RED_FLAG_URI)) { Vector3f position = new Vector3f(attackingPlayer.getComponent(LocationComponent.class).getLocalPosition()); Vector3f direction = localPlayer.getViewDirection(); <START> Vector3f newPosition = new Vector3f(position.x + direction.x * 1.5f, <END> position.y + direction.y * 1.5f, position.z + direction.z * 1.5f ); Vector3f impulseVector = new Vector3f(direction); entity.send(new DropItemRequest(heldItem, entity, impulseVector, newPosition)); } } } }</code><technical_language>is 1.5f? this static final above</technical_language>

Target:
public void onActivate(ActivateEvent event, EntityRef entity) { EntityRef attackingPlayer = event.getInstigator(); if (attackingPlayer.getComponent(CharacterHeldItemComponent.class).selectedItem.hasComponent(RaycastOnActivateComponent.class)) { if (entity.hasComponent(PlayerCharacterComponent.class) && entity.hasComponent(CharacterHeldItemComponent.class)) { CharacterHeldItemComponent characterHeldItemComponent = entity.getComponent(CharacterHeldItemComponent.class); EntityRef heldItem = characterHeldItemComponent.selectedItem; if (heldItem.getComponent(BlockItemComponent.class).blockFamily.getURI().toString().equals(LASUtils.BLACK_FLAG_URI) || heldItem.getComponent(BlockItemComponent.class).blockFamily.getURI().toString().equals(LASUtils.RED_FLAG_URI)) { Vector3f position = new Vector3f(attackingPlayer.getComponent(LocationComponent.class).getLocalPosition()); Vector3f direction = localPlayer.getViewDirection(); Vector3f newPosition = new Vector3f(position.x + direction.x * NEW_DIRECTION_MODIFIER, position.y + direction.y * NEW_DIRECTION_MODIFIER, position.z + direction.z * NEW_DIRECTION_MODIFIER ); Vector3f impulseVector = new Vector3f(direction); entity.send(new DropItemRequest(heldItem, entity, impulseVector, newPosition)); } } } }
Source:
<code>private void initTunedProfiles() { this.startProgress(null); Frontend.getInstance().runQuery(VdcQueryType.GetGlusterTunedProfiles, new VdcQueryParametersBase(), new AsyncQuery(new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { ClusterModel.this.stopProgress(); List<String> glusterTunedProfiles = new ArrayList<>(); if (((VdcQueryReturnValue) returnValue).getSucceeded()) { glusterTunedProfiles.addAll((List<String>)(((VdcQueryReturnValue) returnValue).getReturnValue())); } glusterTunedProfile.setItems(glusterTunedProfiles); } })); <START> glusterTunedProfile.setIsAvailable(glusterTunedProfile.getItems().size() > 0 && ApplicationModeHelper.isModeSupported(ApplicationMode.GlusterOnly)); <END> }</code><technical_language>ApplicationM odeHelper.isModeSupported(ApplicationMode.GlusterOnly)) is a duplicate check. a situation tuned profiles empty</technical_language>

Target:
public void initTunedProfiles() { this.startProgress(null); Frontend.getInstance().runQuery(VdcQueryType.GetGlusterTunedProfiles, new VdcQueryParametersBase(), new AsyncQuery(new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { ClusterModel.this.stopProgress(); List<String> glusterTunedProfiles = new ArrayList<>(); if (((VdcQueryReturnValue) returnValue).getSucceeded()) { glusterTunedProfiles.addAll((List<String>)(((VdcQueryReturnValue) returnValue).getReturnValue())); } glusterTunedProfile.setItems(glusterTunedProfiles, glusterTunedProfile.getSelectedItem()); glusterTunedProfile.setIsAvailable(glusterTunedProfile.getItems().size() > 0); } })); }
Source:
<code>private List<AccountInfo> suggestAccountFullTextSearch( VisibilityControl visibilityControl) throws OrmException { String str = query.toLowerCase(); LinkedHashMap<Account.Id, AccountInfo> accountMap = Maps.newLinkedHashMap(); List<Account> fullNameMatches = Lists.newArrayList(); List<Account> emailMatches = Lists.newArrayList(); <START> for (Account a : dbProvider.get().accounts().all()) { <END> if (a.getFullName() != null && a.getFullName().toLowerCase().contains(str)) { fullNameMatches.add(a); } else if (a.getPreferredEmail() != null && emailMatches.size() < fullTextMaxMatches && a.getPreferredEmail().toLowerCase().contains(str)) { emailMatches.add(a); } if (fullNameMatches.size() >= fullTextMaxMatches) { break; } } for (Account a : fullNameMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } if (accountMap.size() < limit) { for (Account a : emailMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } } return Lists.newArrayList(accountMap.values()); }</code><technical_language>This is a crazy simply suggest oracle called times in rapid succession of operation. easy a simple Cache<Boolean, List<Account>> a short expiration time, 30s. (The cache a single key, True, Cache for expiration behavior.) (Also totally work for googlesource.com wait a proper secondary index for accounts.)</technical_language>

Target:
private List<AccountInfo> suggestAccountFullTextSearch( VisibilityControl visibilityControl) throws OrmException { String str = query.toLowerCase(); LinkedHashMap<Account.Id, AccountInfo> accountMap = Maps.newLinkedHashMap(); List<Account> fullNameMatches = Lists.newArrayList(); List<Account> emailMatches = Lists.newArrayList(); for (Account a : reviewerSuggestionCache.get()) { if (a.getFullName() != null && a.getFullName().toLowerCase().contains(str)) { fullNameMatches.add(a); } else if (a.getPreferredEmail() != null && emailMatches.size() < fullTextMaxMatches && a.getPreferredEmail().toLowerCase().contains(str)) { emailMatches.add(a); } if (fullNameMatches.size() >= fullTextMaxMatches) { break; } } for (Account a : fullNameMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } if (accountMap.size() < limit) { for (Account a : emailMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } } return Lists.newArrayList(accountMap.values()); }
Source:
<code><START> public static PrioritizedExecutorService create(Lifecycle lifecycle, DruidProcessingConfig config) <END> { final PrioritizedExecutorService service = new PrioritizedExecutorService( new ThreadPoolExecutor( config.getNumThreads(), config.getNumThreads(), 0L, TimeUnit.MILLISECONDS, config.isFifo() ? PrioritizedTaskBlockingQueue.create(config) : new PriorityBlockingQueue<Runnable>(config.getNumThreads()), new ThreadFactoryBuilder().setDaemon(true).setNameFormat(config.getFormatString()).build() ) ); lifecycle.addHandler( new Lifecycle.Handler() { @Override public void start() throws Exception { } @Override public void stop() { service.shutdownNow(); } } ); return service; }</code><technical_language>add property ExecutorServiceConfig? PrioritizedExecutorService more generic specific druid processing</technical_language>

Target:
public static PrioritizedExecutorService create(Lifecycle lifecycle, DruidProcessingConfig config) { final PrioritizedExecutorService service = new PrioritizedExecutorService( new ThreadPoolExecutor( config.getNumThreads(), config.getNumThreads(), 0L, TimeUnit.MILLISECONDS, new PriorityBlockingQueue<Runnable>(), new ThreadFactoryBuilder().setDaemon(true).setNameFormat(config.getFormatString()).build() ), config ); lifecycle.addHandler( new Lifecycle.Handler() { @Override public void start() throws Exception { } @Override public void stop() { service.shutdownNow(); } } ); return service; }
Source:
<code>public Tournament replaceTournament(Tournament tournament) { <START> if (getTournaments() <END> .stream() .noneMatch(dbTournament -> dbTournament.getId().equals(tournament.getId()))) { throw new TournamentNotFoundException(); } return tournamentRepository.save(tournament); }</code><technical_language>iterating tournaments, checking if match ID? [this](<LINK_0></technical_language>

Target:
public Tournament replaceTournament(Tournament tournament) { if (tournamentRepository.findOne(tournament.getId()) == null) { throw new TournamentNotFoundException(); } return tournamentRepository.save(tournament); }
Source:
<code>public Iterator<IPPollAddress> getExcludingInterator(final Iterator<IPPollAddress> it) { return StreamSupport.stream( Spliterators.spliteratorUnknownSize(it, ORDERED | IMMUTABLE), false ) <START> .filter(item -> { return !isExcluded(item.getAddress());}) <END> .iterator(); }</code><technical_language>This shorter: .filter(item -> !isExcluded(item.getAddress()))</technical_language>

Target:
public Iterator<IPPollAddress> getExcludingInterator(final Iterator<IPPollAddress> it) { return StreamSupport.stream( Spliterators.spliteratorUnknownSize(it, ORDERED | IMMUTABLE), false ) .filter(item -> !isExcluded(item.getAddress())) .iterator(); }
Source:
<code>private static void openTrace() { final Exception exception[] = new Exception[1]; exception[0] = null; UIThreadRunnable.syncExec(new VoidResult() { @Override public void run() { try { IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(TRACE_PROJECT_NAME); <START> TmfTraceFolder destinationFolder = TmfProjectRegistry.getProject(project).getTracesFolder(); <END> TmfOpenTraceHelper.openTraceFromPath(destinationFolder, ctt.getPath(), PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "org.eclipse.linuxtools.lttng2.kernel.tracetype"); } catch (CoreException e) { exception[0] = e; } } }); if (exception[0] != null) { fail(exception[0].getMessage()); } SWTBotUtil.delay(1000); SWTBotUtil.waitForJobs(); }</code><technical_language>getProject(project, true) project element is in registry. is a race condition of handling resource change event (which puts in registry) this line of code</technical_language>

Target:
private static void openTrace() { final Exception exception[] = new Exception[1]; exception[0] = null; UIThreadRunnable.syncExec(new VoidResult() { @Override public void run() { try { IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(TRACE_PROJECT_NAME); TmfTraceFolder destinationFolder = TmfProjectRegistry.getProject(project, true).getTracesFolder(); TmfOpenTraceHelper.openTraceFromPath(destinationFolder, ctt.getPath(), PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "org.eclipse.linuxtools.lttng2.kernel.tracetype"); } catch (CoreException e) { exception[0] = e; } } }); if (exception[0] != null) { fail(exception[0].getMessage()); } SWTBotUtil.delay(1000); SWTBotUtil.waitForJobs(); }
Source:
<code>public List<ObserverSpecification> getObserverSpecifications() { List<ObserverSpecification> configList = new ArrayList<>(); Iterator<String> iter = getKeys(); while (iter.hasNext()) { String key = iter.next(); <START> if (!key.startsWith(FluoConfiguration.OBSERVER_PROVIDER) <END> && key.startsWith(FluoConfiguration.OBSERVER_PREFIX)) { String value = getString(key).trim(); if (value.isEmpty()) { throw new IllegalArgumentException(key + " is set to empty value"); } String[] fields = value.split(","); if (fields.length == 0) { throw new IllegalArgumentException(key + " has bad value: " + value); } String className = fields[0]; if (className.isEmpty()) { throw new IllegalArgumentException(key + " has empty class name: " + className); } Map<String, String> params = new HashMap<>(); for (int i = 1; i < fields.length; i++) { String[] kv = fields[i].split("="); if (kv.length != 2) { throw new IllegalArgumentException(key + " has invalid param. Expected 'key=value' but encountered '" + fields[i] + "'"); } if (kv[0].isEmpty() || kv[1].isEmpty()) { throw new IllegalArgumentException(key + " has empty key or value in param: " + fields[i]); } params.put(kv[0], kv[1]); } ObserverSpecification observerSpecification = new ObserverSpecification(className, params); configList.add(observerSpecification); } } return configList; }</code><technical_language>do equals OBSERVER_PROVIDER</technical_language>

Target:
public List<ObserverSpecification> getObserverSpecifications() { List<ObserverSpecification> configList = new ArrayList<>(); Iterator<String> iter = getKeys(); while (iter.hasNext()) { String key = iter.next(); if (key.startsWith(FluoConfiguration.OBSERVER_PREFIX) && !key.equals(FluoConfiguration.OBSERVER_PROVIDER)) { String value = getString(key).trim(); if (value.isEmpty()) { throw new IllegalArgumentException(key + " is set to empty value"); } String[] fields = value.split(","); if (fields.length == 0) { throw new IllegalArgumentException(key + " has bad value: " + value); } String className = fields[0]; if (className.isEmpty()) { throw new IllegalArgumentException(key + " has empty class name: " + className); } Map<String, String> params = new HashMap<>(); for (int i = 1; i < fields.length; i++) { String[] kv = fields[i].split("="); if (kv.length != 2) { throw new IllegalArgumentException(key + " has invalid param. Expected 'key=value' but encountered '" + fields[i] + "'"); } if (kv[0].isEmpty() || kv[1].isEmpty()) { throw new IllegalArgumentException(key + " has empty key or value in param: " + fields[i]); } params.put(kv[0], kv[1]); } ObserverSpecification observerSpecification = new ObserverSpecification(className, params); configList.add(observerSpecification); } } return configList; }
Source:
<code>public void sendFile(File file, HttpHeaders headers) throws IOException { HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK); addContentTypeIfMissing(response.headers().add(headers), OCTET_STREAM_TYPE); HttpUtil.setTransferEncodingChunked(response, false); HttpUtil.setContentLength(response, file.length()); RandomAccessFile raf = new RandomAccessFile(file, "r"); try { checkNotResponded(); channel.write(response); if (sslEnabled) { channel.writeAndFlush(new HttpChunkedInput(new ChunkedFile(raf, 8192))); } else { FileRegion region = new DefaultFileRegion(raf.getChannel(), 0, file.length()); channel.write(region); channel.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT); } } catch (Throwable t) { try { raf.close(); } catch (IOException ex) { } <START> throw (IOException) t; <END> } }</code><technical_language>similar above, this is a safe cast</technical_language>

Target:
public void sendFile(File file, HttpHeaders headers) throws Throwable { HttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK); addContentTypeIfMissing(response.headers().add(headers), OCTET_STREAM_TYPE); HttpUtil.setTransferEncodingChunked(response, false); HttpUtil.setContentLength(response, file.length()); RandomAccessFile raf = new RandomAccessFile(file, "r"); try { checkNotResponded(); channel.write(response); if (sslEnabled) { channel.writeAndFlush(new HttpChunkedInput(new ChunkedFile(raf, 8192))); } else { FileRegion region = new DefaultFileRegion(raf.getChannel(), 0, file.length()); channel.write(region); channel.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT); } } catch (Throwable t) { try { raf.close(); } catch (IOException ex) { } throw t; } }
Source:
<code>public void cancel(Subscription subscription, StreamObserver<Response> responseObserver) { log().debug("Incoming cancel request for the subscription topic: {}", subscription); final BoundedContext boundedContext = selectBoundedContext(subscription); try { final Stand stand = boundedContext.getStand(); stand.cancel(subscription); responseObserver.onNext(Responses.ok()); } catch (@SuppressWarnings("OverlyBroadCatchBlock") Exception e) { log().error("Error processing cancel subscription request", e); responseObserver.onError(e); <START> responseObserver.onCompleted(); <END> } }</code><technical_language>onError() call</technical_language>

Target:
public void cancel(Subscription subscription, StreamObserver<Response> responseObserver) { log().debug("Incoming cancel request for the subscription topic: {}", subscription); final BoundedContext boundedContext = selectBoundedContext(subscription); try { final Stand stand = boundedContext.getStand(); stand.cancel(subscription); responseObserver.onNext(Responses.ok()); responseObserver.onCompleted(); } catch (@SuppressWarnings("OverlyBroadCatchBlock") Exception e) { log().error("Error processing cancel subscription request", e); responseObserver.onError(e); } }
Source:
<code>public FilterSimpleExpression(String field, ConditionOperator operator, @Nullable String value) { fField = field; fOperator = operator; fOriginalValue = value; <START> Pattern pattern = null; if (operator == ConditionOperator.MATCHES) { try { pattern = Pattern.compile(String.valueOf(value)); } catch (PatternSyntaxException e) { } } if (pattern != null) { fValue = new Pair<>(pattern, ConditionOperator.prepareValue(value)); } else { fValue = ConditionOperator.prepareValue(value); } <END> }</code><technical_language>logic in a class, move this in prepareValue method. need pass operator, fine. This class modified</technical_language>

Target:
public FilterSimpleExpression(String field, ConditionOperator operator, @Nullable String value) { fField = field; fOperator = operator; fOriginalValue = value; fValue = ConditionOperator.prepareValue(operator, value); }
Source:
<code>public void shouldReturnJSON() throws ServletException, IOException { MockHttpServletResponse mockResponse = new MockHttpServletResponse(); MockHttpServletRequest mockRequest = new MockHttpServletRequest(); mockRequest.addHeader("x-requested-with","XMLHttpRequest"); MotechUser user = new MotechUser(); user.setUserName("testUser"); user.setFailureLoginCounter(3); when(authentication.getName()).thenReturn("testUser"); when(motechUsersDao.findByUserName("testUser")).thenReturn(user); motechLoginSuccessHandler.onAuthenticationSuccess(mockRequest, mockResponse, authentication); <START> assertEquals("SUCCESS", mockResponse.getContentAsString()); <END> }</code><technical_language>json</technical_language>

Target:
public void shouldReturnJSON() throws ServletException, IOException { MockHttpServletResponse mockResponse = new MockHttpServletResponse(); MockHttpServletRequest mockRequest = new MockHttpServletRequest(); mockRequest.addHeader("x-requested-with","XMLHttpRequest"); MotechUser user = new MotechUser(); user.setUserName("testUser"); user.setFailureLoginCounter(3); when(authentication.getName()).thenReturn("testUser"); when(motechUsersDao.findByUserName("testUser")).thenReturn(user); motechLoginSuccessHandler.onAuthenticationSuccess(mockRequest, mockResponse, authentication); MotechJsonMessage message = new MotechJsonMessage("SUCCESS"); assertEquals(message.toJson(), mockResponse.getContentAsString()); }
Source:
<code>private static boolean canUpdateCube(@Nonnull Cube cube) { BlockPos cubeCenter = getCubeCenter(cube); <START> return cube.getCubicWorld().testForCubes(cubeCenter, UPDATE_RADIUS, Objects::nonNull, Requirement.GET_WATCHED); <END> }</code><technical_language>FirstLightProcessor LOADED cubes, watched ones. This is some non-watched cubes loaded specifically FirstLightProcessor them</technical_language>

Target:
private static boolean canUpdateCube(@Nonnull Cube cube) { BlockPos cubeCenter = getCubeCenter(cube); return cube.getCubicWorld().testForCubes(cubeCenter, UPDATE_RADIUS, Objects::nonNull); }
Source:
<code>public void cleanup() { final float waitStart = System.currentTimeMillis(); synchronizer.globalBarrier(); final float cleanupStart = System.currentTimeMillis(); resetTracers(); pullModels(); computeTracer.start(); final Map<Long, Pair<Vector, Integer>> workloadMap = memoryStore.getAll(); final List<Pair<Vector, Integer>> data = new ArrayList<>(workloadMap.values()); final int numInstances = data.size(); <START> final Tuple3<Double, Double, Float> lossRegLossAccuracy = computeLoss(numInstances, data); <END> computeTracer.end(numInstances); final float cleanupEnd = System.currentTimeMillis(); LOG.log(Level.INFO, "Number of instances: {0}", numInstances); LOG.log(Level.INFO, "Prediction accuracy on training dataset: {0}", lossRegLossAccuracy.getThird()); LOG.log(Level.INFO, "Cleanup Samples: {0}, Avg Comp Per Row: {1}, Sum Comp: {2}, Avg Pull: {3}, Sum Pull: {4}, " + "Elapsed Time: {5}, Wait Time: {6}, Sample Loss Avg: {7}", new Object[]{numInstances, computeTracer.avg(), computeTracer.sum(), pullTracer.avg(), pullTracer.sum(), cleanupEnd - waitStart, cleanupStart - waitStart, lossRegLossAccuracy.getFirst()}); }</code><technical_language>data.size() sounds better! rename it. Thanks</technical_language>

Target:
public void cleanup() { final float waitStart = System.currentTimeMillis(); synchronizer.globalBarrier(); final float cleanupStart = System.currentTimeMillis(); resetTracers(); pullModels(); computeTracer.start(); final Map<Long, Pair<Vector, Integer>> workloadMap = memoryStore.getAll(); final List<Pair<Vector, Integer>> data = new ArrayList<>(workloadMap.values()); final int entireDatasetSize = data.size(); final Tuple3<Double, Double, Float> lossRegLossAccuracy = computeLoss(entireDatasetSize, data); computeTracer.end(data.size()); final float cleanupEnd = System.currentTimeMillis(); LOG.log(Level.INFO, "Number of instances: {0}", entireDatasetSize); LOG.log(Level.INFO, "Prediction accuracy on training dataset: {0}", lossRegLossAccuracy.getThird()); LOG.log(Level.INFO, "Cleanup Samples: {0}, Avg Comp Per Row: {1}, Sum Comp: {2}, Avg Pull: {3}, Sum Pull: {4}, " + "Elapsed Time: {5}, Wait Time: {6}, Sample Loss Avg: {7}", new Object[]{entireDatasetSize, computeTracer.avg(), computeTracer.sum(), pullTracer.avg(), pullTracer.sum(), cleanupEnd - waitStart, cleanupStart - waitStart, lossRegLossAccuracy.getFirst()}); }
Source:
<code><START> public Payment toDerivative(ZonedDateTime dateTime, DoubleTimeSeries<ZonedDateTime> fxFixingHts) { <END> ArgumentChecker.notNull(dateTime, "date"); LocalDate conversionDate = dateTime.toLocalDate(); LocalDate fixingDate = _fxFixingDate.toLocalDate(); double paymentTime = TimeCalculator.getTimeBetween(dateTime, getPaymentDate()); if (conversionDate.isAfter(fixingDate)) { ZonedDateTime rezonedFixingDate = _fxFixingDate.toLocalDate().atStartOfDay(ZoneOffset.UTC); Double fxRate = fxFixingHts.getValue(rezonedFixingDate); if (fxRate == null) { throw new OpenGammaRuntimeException("Could not get fixing value for date " + _fxFixingDate); } double notional = getNotional() * fxRate; return new CouponFixed(getCurrency(), paymentTime, getPaymentYearFraction(), notional, _rate); } if (conversionDate.equals(fixingDate)) { ZonedDateTime rezonedFixingDate = _fxFixingDate.toLocalDate().atStartOfDay(ZoneOffset.UTC); Double fxRate = fxFixingHts.getValue(rezonedFixingDate); if (fxRate != null) { double notional = getNotional() * fxRate; return new CouponFixed(getCurrency(), paymentTime, getPaymentYearFraction(), notional, _rate); } } double fixingTime = TimeCalculator.getTimeBetween(dateTime, _fxFixingDate); double deliveryTime = TimeCalculator.getTimeBetween(dateTime, _fxDeliveryDate); return new CouponFixedFxReset(getCurrency(), paymentTime, getPaymentYearFraction(), getNotional(), _rate, _referenceCurrency, fixingTime, deliveryTime); }</code><technical_language>ArgumentChecker for fxFixingHts</technical_language>

Target:
public Coupon toDerivative(ZonedDateTime dateTime, DoubleTimeSeries<ZonedDateTime> fxFixingHts) { ArgumentChecker.notNull(dateTime, "date"); ArgumentChecker.notNull(fxFixingHts, "time series of FX resets"); LocalDate conversionDate = dateTime.toLocalDate(); LocalDate fixingDate = _fxFixingDate.toLocalDate(); double paymentTime = TimeCalculator.getTimeBetween(dateTime, getPaymentDate()); if (conversionDate.isAfter(fixingDate)) { ZonedDateTime rezonedFixingDate = _fxFixingDate.toLocalDate().atStartOfDay(ZoneOffset.UTC); Double fxRate = fxFixingHts.getValue(rezonedFixingDate); if (fxRate == null) { throw new OpenGammaRuntimeException("Could not get fixing value for date " + _fxFixingDate); } double notional = getNotional() * fxRate; return new CouponFixed(getCurrency(), paymentTime, getPaymentYearFraction(), notional, _rate); } if (conversionDate.equals(fixingDate)) { ZonedDateTime rezonedFixingDate = _fxFixingDate.toLocalDate().atStartOfDay(ZoneOffset.UTC); Double fxRate = fxFixingHts.getValue(rezonedFixingDate); if (fxRate != null) { double notional = getNotional() * fxRate; return new CouponFixed(getCurrency(), paymentTime, getPaymentYearFraction(), notional, _rate); } } double fixingTime = TimeCalculator.getTimeBetween(dateTime, _fxFixingDate); double deliveryTime = TimeCalculator.getTimeBetween(dateTime, _fxDeliveryDate); return new CouponFixedFxReset(getCurrency(), paymentTime, getPaymentYearFraction(), getNotional(), _rate, _referenceCurrency, fixingTime, deliveryTime); }
Source:
<code>public void confirmCreateWidget(View v){ AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this); <START> String backgroundColor = opacityToColorStringConvert(opacitySeekbar.getProgress(), "262C31"); <END> RemoteViews views = new RemoteViews(this.getPackageName(), R.layout.player_widget); views.setInt(R.id.widgetLayout,"setBackgroundColor", Color.parseColor(backgroundColor)); appWidgetManager.updateAppWidget(appWidgetId,views); SharedPreferences prefs = getSharedPreferences(WIDGET_PREFS, MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putString(WIDGET_COLOR + appWidgetId, backgroundColor); editor.apply(); Intent resultValue = new Intent(); resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,appWidgetId); setResult(RESULT_OK,resultValue); finish(); }</code><technical_language>If integer instead of string here, need color/integer/string conversions. Integer colors represented this: 0x00262C31+0xFF000000*alpha</technical_language>

Target:
private void confirmCreateWidget(View v) { int backgroundColor = getColorWithAlpha(PlayerWidget.DEFAULT_COLOR, opacitySeekBar.getProgress()); SharedPreferences prefs = getSharedPreferences(PlayerWidget.PREFS_NAME, MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putInt(PlayerWidget.KEY_WIDGET_COLOR + appWidgetId, backgroundColor); editor.apply(); Intent resultValue = new Intent(); resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); setResult(RESULT_OK, resultValue); finish(); PlayerWidgetJobService.updateWidget(this); }
Source:
<code>public final VirtualFile getVirtualFile(final String fileName, final String displayFileName, final String contents) throws IOException, NoSuchAlgorithmException { final String tempDir = System.getProperty(JAVA_IO_TMP_DIR); final String trimmedFileName = FileUtil.sanitizeFileName(StringUtil.trimEnd(fileName, displayFileName)); final String digest = getDigestAsString(trimmedFileName); final String filePath = tempDir + File.separatorChar + digest + File.separatorChar + displayFileName; <START> final File file = new File(filePath); <END> VirtualFile virtualFile; if (file.exists()) { virtualFile = LocalFileSystem.getInstance().findFileByPath(filePath); windowEditorOps.setWriteStatus(virtualFile, true); } else { FileUtil.createIfDoesntExist(file); FileUtil.writeToFile(file, contents); virtualFile = LocalFileSystem.getInstance().findFileByPath(filePath); windowEditorOps.setWriteStatus(virtualFile, false); } return virtualFile; }</code><technical_language>stringbuilder better? strings add</technical_language>

Target:
public final VirtualFile getVirtualFile(final String fileName, final String displayFileName, final String contents) throws IOException, NoSuchAlgorithmException { final String tempDir = System.getProperty(JAVA_IO_TMP_DIR); final String trimmedFileName = FileUtil.sanitizeFileName(StringUtil.trimEnd(fileName, displayFileName)); final String digest = Utils.getInstance().getDigestAsString(trimmedFileName); final String fullFilePath = Utils.getInstance() .createFileWithContents(displayFileName, contents, tempDir, digest); return getVirtualFile(fullFilePath, displayFileName, contents, tempDir); }
Source:
<code>public void testOpenSslSecret() throws NoSuchAlgorithmException, IOException, NoSuchProviderException { <START> final byte[] enc = new EncryptionService(new File("src/test/resources/secret").getPath()).encrypt("testje" <END> .getBytes()); Assert.assertEquals("testje", new String(new EncryptionService(new File("src/test/resources/secret").getPath()).decrypt(enc))); }</code><technical_language>"src/test/resources/secret" a constant</technical_language>

Target:
public void testOpenSslSecret() throws NoSuchAlgorithmException, IOException, NoSuchProviderException { final byte[] enc = new TestableEncService(new File(SRC_TEST_RESOURCES_SECRET).getPath()).encrypt(TESTJE .getBytes()); Assert.assertEquals(TESTJE, new String(new TestableEncService(new File(SRC_TEST_RESOURCES_SECRET).getPath()).decrypt(enc))); }
Source:
<code>public WorkflowResponse execute(WorkflowDTO workflowDTO) throws WorkflowException { if (log.isDebugEnabled()) { log.debug("Executing Application creation Workflow."); } ApplicationWorkflowDTO appWorkFlowDTO = (ApplicationWorkflowDTO) workflowDTO; Application application = appWorkFlowDTO.getApplication(); <START> String callBackURL = appWorkFlowDTO.getCallbackUrl(); <END> String message = "Approve application [" + application.getName() + "] creation request from application creator -" + appWorkFlowDTO.getUserName() + " with throttling tier - " + application.getTier(); workflowDTO.setWorkflowDescription(message); super.execute(workflowDTO); return new GeneralWorkflowResponse(); }</code><technical_language>remove unused variables</technical_language>

Target:
public WorkflowResponse execute(WorkflowDTO workflowDTO) throws WorkflowException { if (log.isDebugEnabled()) { log.debug("Executing Application creation Workflow."); } ApplicationWorkflowDTO appWorkFlowDTO = (ApplicationWorkflowDTO) workflowDTO; Application application = appWorkFlowDTO.getApplication(); String message = "Approve application " + application.getName() + " creation request from application creator -" + appWorkFlowDTO.getUserName() + " with throttling tier - " + application.getTier(); workflowDTO.setWorkflowDescription(message); workflowDTO.setProperties("applicationName", application.getName()); workflowDTO.setProperties("userName", appWorkFlowDTO.getUserName()); workflowDTO.setProperties("applicationTier", application.getTier()); super.execute(workflowDTO); return new GeneralWorkflowResponse(); }
Source:
<code>public void updateTimerSubprocessLongerDelayTest() { CountDownProcessEventListener countDownListener = new CountDownProcessEventListener(TIMER_SUBPROCESS_NAME, 1); setProcessScenario(TIMER_SUBPROCESS_FILE); kieSession.addEventListener(countDownListener); final List<Long> list = new ArrayList<Long>(); kieSession.addEventListener(new DefaultProcessEventListener() { @Override public void beforeProcessStarted(ProcessStartedEvent event) { list.add(event.getProcessInstance().getId()); } @Override public void afterNodeLeft(ProcessNodeLeftEvent event) { if (TIMER_SUBPROCESS_NAME.equals(event.getNodeInstance().getNodeName())) { System.setProperty(TIMER_FIRED_TEXT, ""); <START> System.setProperty(TIMER_FIRED_TIME_PROP, System.currentTimeMillis()+""); <END> } } }); Assertions.assertThat(list).isEmpty(); long id = kieSession.startProcess(PROCESS_SUBPROCESS_NAME).getId(); long startTime = System.currentTimeMillis(); Assertions.assertThat(list).isNotEmpty(); kieSession.execute(new UpdateTimerCommand(id, TIMER_SUBPROCESS_NAME, 8)); countDownListener.waitTillCompleted(); Assertions.assertThat(timerHasFired()).isTrue(); long firedTime = timerFiredTime(); long timeDifference = Math.abs(firedTime - startTime - 8000); logger.info("Start time: " + startTime + ", fired time: " + firedTime + ", difference: " + (firedTime-startTime)); Assertions.assertThat(timeDifference).isLessThan(500); Assertions.assertThat(kieSession.getProcessInstance(id)).isNull(); }</code><technical_language>great I thinking a bit if is missing in "" string I prefer String.valueOf() Long.toString() is confusion. OK</technical_language>

Target:
public void updateTimerSubprocessLongerDelayTest() { CountDownProcessEventListener countDownListener = new CountDownProcessEventListener(TIMER_SUBPROCESS_NAME, 1); setProcessScenario(TIMER_SUBPROCESS_FILE); kieSession.addEventListener(countDownListener); final List<Long> list = new ArrayList<Long>(); kieSession.addEventListener(new DefaultProcessEventListener() { @Override public void beforeProcessStarted(ProcessStartedEvent event) { list.add(event.getProcessInstance().getId()); } @Override public void afterNodeLeft(ProcessNodeLeftEvent event) { if (TIMER_SUBPROCESS_NAME.equals(event.getNodeInstance().getNodeName())) { System.setProperty(TIMER_FIRED_TEXT, ""); System.setProperty(TIMER_FIRED_TIME_PROP, String.valueOf(System.currentTimeMillis())); } } }); Assertions.assertThat(list).isEmpty(); long id = kieSession.startProcess(PROCESS_SUBPROCESS_NAME).getId(); long startTime = System.currentTimeMillis(); Assertions.assertThat(list).isNotEmpty(); kieSession.execute(new UpdateTimerCommand(id, TIMER_SUBPROCESS_NAME, 8)); countDownListener.waitTillCompleted(); Assertions.assertThat(timerHasFired()).isTrue(); long firedTime = timerFiredTime(); long timeDifference = Math.abs(firedTime - startTime - 8000); logger.info("Start time: " + startTime + ", fired time: " + firedTime + ", difference: " + (firedTime-startTime)); Assertions.assertThat(timeDifference).isLessThan(500); Assertions.assertThat(kieSession.getProcessInstance(id)).isNull(); }
Source:
<code>public void deleteServiceComponentHosts(String hostname, DeleteHostComponentStatusMetaData deleteMetaData) throws AmbariException { readWriteLock.writeLock().lock(); try { ServiceComponentHost sch = getServiceComponentHost(hostname); LOG.info("Deleting servicecomponenthost for cluster" + ", clusterName=" + getClusterName() + ", serviceName=" + getServiceName() + ", componentName=" + getName() <START> + ", recoveryEnabled=" + isRecoveryEnabled() + ", hostname=" + sch.getHostName() + ", cuurentState=" + sch.getState()); <END> if (!sch.canBeRemoved()) { throw new AmbariException("Could not delete hostcomponent from cluster, component in undeletable state" + ", clusterName=" + getClusterName() + ", serviceName=" + getServiceName() + ", componentName=" + getName() + ", recoveryEnabled=" + isRecoveryEnabled() + ", hostname=" + sch.getHostName() + ", currentState=" + sch.getState()); } sch.delete(deleteMetaData); hostComponents.remove(hostname); } finally { readWriteLock.writeLock().unlock(); } }</code><technical_language>cuurentState => state</technical_language>

Target:
public void deleteServiceComponentHosts(String hostname, DeleteHostComponentStatusMetaData deleteMetaData) throws AmbariException { readWriteLock.writeLock().lock(); try { ServiceComponentHost sch = getServiceComponentHost(hostname); LOG.info("Deleting servicecomponenthost for cluster" + ", clusterName=" + getClusterName() + ", serviceName=" + getServiceName() + ", componentName=" + getName() + ", recoveryEnabled=" + isRecoveryEnabled() + ", hostname=" + sch.getHostName() + ", state=" + sch.getState()); if (!sch.canBeRemoved()) { throw new AmbariException("Current host component state prohibiting component removal." + ", clusterName=" + getClusterName() + ", serviceName=" + getServiceName() + ", componentName=" + getName() + ", recoveryEnabled=" + isRecoveryEnabled() + ", hostname=" + sch.getHostName() + ", state=" + sch.getState()); } sch.delete(deleteMetaData); hostComponents.remove(hostname); } finally { readWriteLock.writeLock().unlock(); } }