auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void handleConnectionFailed(Exception exception) { try { if (isHandling) return; isHandling = true; if (!(exception instanceof XMPPException)) { MessageDialog.openError( SWTUtils.getShell(), "Connecting Error", MessageFormat.format( <START> "Could not connect to XMPP server. Unexpected error: {0}", exception.getMessage())); <END> return; } final XMPPAccount accountUsedForConnecting = XMPPConnectionSupport.getInstance().getCurrentXMPPAccount(); if (accountUsedForConnecting == null) return; final String errorMessesage = generateHumanReadableErrorMessage((XMPPException) exception); final boolean editAccountAndConnectAgain = MessageDialog.openQuestion(SWTUtils.getShell(), "Connecting Error", errorMessesage); if (!editAccountAndConnectAgain) return; if (WizardUtils.openEditXMPPAccountWizard(accountUsedForConnecting) == null) return; XMPPConnectionSupport.getInstance().connect(accountUsedForConnecting, false); } finally { isHandling = false; } }</code><technical_language>This moved a messages.properties file is text shown user</technical_language>

Target:
private void handleConnectionFailed(Exception exception) { try { if (isHandling) return; isHandling = true; if (!(exception instanceof XMPPException)) { MessageDialog.openError( SWTUtils.getShell(), "Connecting Error", MessageFormat.format( "Could not connect to XMPP server. Unexpected error: {0}", exception.getMessage())); return; } final XMPPAccount accountUsedForConnecting = XMPPConnectionSupport.getInstance().getCurrentXMPPAccount(); if (accountUsedForConnecting == null) { log.warn( "could not found the account that was used for establishing the connection - " + "this can happen if connections are not established through class: " + XMPPConnectionSupport.class.getSimpleName()); return; } final String errorMessesage = generateHumanReadableErrorMessage((XMPPException) exception); final boolean editAccountAndConnectAgain = MessageDialog.openQuestion(SWTUtils.getShell(), "Connecting Error", errorMessesage); if (!editAccountAndConnectAgain) return; if (WizardUtils.openEditXMPPAccountWizard(accountUsedForConnecting) == null) return; XMPPConnectionSupport.getInstance().connect(accountUsedForConnecting, false); } finally { isHandling = false; } }
Source:
<code>public TimestampStoreInvalidator createTimestampStoreInvalidator(KeyValueService rawKvs, Optional<DbTimestampCreationSetting> creationParameters) { ConnectionManagerAwareDbKvs dbkvs = (ConnectionManagerAwareDbKvs) rawKvs; return creationParameters.map(params -> DbTimestampCreationSettings.caseOf(params) <START> .multipleSeries((table, series) -> defaultTimestampStoreInvalidator(dbkvs, creationParameters)) <END> .singleSeries(table -> timestampStoreInvalidator(dbkvs, table))) .orElseGet(() -> timestampStoreInvalidator(dbkvs, Optional.empty())); }</code><technical_language>I if this returns invalidator throw exception if invoked? This happen in a DB-TimeLock, if is calling invalidation is a bug</technical_language>

Target:
public TimestampStoreInvalidator createTimestampStoreInvalidator(KeyValueService rawKvs, Optional<DbTimestampCreationSetting> creationParameters) { ConnectionManagerAwareDbKvs dbkvs = (ConnectionManagerAwareDbKvs) rawKvs; return creationParameters.map(params -> DbTimestampCreationSettings.caseOf(params) .singleSeries(table -> timestampStoreInvalidator(dbkvs, table)) .otherwise(() -> { throw new SafeIllegalStateException("Invalidator must only be called by embedded DB timeLock that " + "does not support multi series timestamp store. This is unexpected, " + "please contact support."); })) .orElseGet(() -> timestampStoreInvalidator(dbkvs, Optional.empty())); }
Source:
<code>protected void onCancelled() { super.onCancelled(); <START> mainActivityWeakReference.get().getSupportLoaderManager().destroyLoader(MainActivity.REQUEST_CODE_CLOUD_LIST_KEY); <END> mainActivityWeakReference.get().getSupportLoaderManager().destroyLoader(MainActivity.REQUEST_CODE_CLOUD_LIST_KEYS); }</code><technical_language>This NPE</technical_language>

Target:
protected void onCancelled() { super.onCancelled(); final MainActivity mainActivity = this.mainActivity.get(); if (mainActivity != null) { mainActivity.getSupportLoaderManager().destroyLoader(MainActivity.REQUEST_CODE_CLOUD_LIST_KEY); mainActivity.getSupportLoaderManager().destroyLoader(MainActivity.REQUEST_CODE_CLOUD_LIST_KEYS); } }
Source:
<code>public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_provider_management, container, false); providerList = new ArrayList<>(); providersAdapter = new ProviderManagerDashboardRecyclerViewAdapter(this, mPresenter, providerList); mProviderManagementRecyclerView = root.findViewById(R.id.providerManagementRecyclerView); mProviderManagementRecyclerView.setHasFixedSize(true); mProviderManagementRecyclerView.setAdapter(providersAdapter); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(root.getContext()); mProviderManagementRecyclerView.setLayoutManager(linearLayoutManager); mEmptyList = root.findViewById(R.id.emptyProviderManagementList); mProgressBar = root.findViewById(R.id.providerManagementInitialProgressBar); addProviderFab = root.findViewById(R.id.providerManagementFragAddFAB); refreshUI(); addProviderFab.setOnClickListener(v -> { Intent intent = new Intent(getActivity(),AddProviderActivity.class); ArrayList<Provider> providerArrayList = new ArrayList<>(providerList); intent.putExtra(ApplicationConstants.BundleKeys.EXISTING_PROVIDERS_BUNDLE,providerArrayList); <START> startActivityForResult(intent, ADD_PROVIDER_REQ_CODE); <END> }); FontsUtil.setFont(Objects.requireNonNull(this.getActivity()).findViewById(android.R.id.content)); return root; }</code><technical_language>Format this file A.S. default formatter</technical_language>

Target:
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_provider_management, container, false); providerList = new ArrayList<>(); providersAdapter = new ProviderManagerDashboardRecyclerViewAdapter(this, mPresenter, providerList); mProviderManagementRecyclerView = root.findViewById(R.id.providerManagementRecyclerView); mProviderManagementRecyclerView.setHasFixedSize(true); mProviderManagementRecyclerView.setAdapter(providersAdapter); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(root.getContext()); mProviderManagementRecyclerView.setLayoutManager(linearLayoutManager); mEmptyList = root.findViewById(R.id.emptyProviderManagementList); mProgressBar = root.findViewById(R.id.providerManagementInitialProgressBar); addProviderFab = root.findViewById(R.id.providerManagementFragAddFAB); refreshUI(); addProviderFab.setOnClickListener(view -> { Intent intent = new Intent(getActivity(), AddProviderActivity.class); ArrayList<Provider> providerArrayList = new ArrayList<>(providerList); intent.putExtra(ApplicationConstants.BundleKeys.EXISTING_PROVIDERS_BUNDLE, providerArrayList); startActivityForResult(intent, ADD_PROVIDER_REQ_CODE); }); FontsUtil.setFont(Objects.requireNonNull(this.getActivity()).findViewById(android.R.id.content)); return root; }
Source:
<code><START> private boolean isRemoveAutoGeneratedSnapshotRequired() { <END> return getParameters().getStage() == LiveMigrateStage.LIVE_MIGRATE_DISK_EXEC_START || getParameters().getStage() == LiveMigrateStage.LIVE_MIGRATE_DISK_EXEC_COMPLETED; }</code><technical_language>boolean functions unified (those equivalent)</technical_language>

Target:
private boolean isRemoveAutoGeneratedSnapshotRequired() { return getParameters().getStage() != LiveMigrateStage.CREATE_SNAPSHOT; }
Source:
<code>private static String getStreamState(AmazonKinesisClient kinesisClient, String streamName) { DescribeStreamRequest describeStreamRequest = new DescribeStreamRequest(); describeStreamRequest.setStreamName(streamName); try { return kinesisClient.describeStream(describeStreamRequest).getStreamDescription().getStreamStatus(); } catch (AmazonServiceException e) { <START> LOG.debug("State of the stream could not be found", streamName); <END> return ""; } }</code><technical_language>include exception in debug message</technical_language>

Target:
private static StreamStatus getStreamState(AmazonKinesisClient kinesisClient, String streamName) { DescribeStreamRequest describeStreamRequest = new DescribeStreamRequest(); describeStreamRequest.setStreamName(streamName); String status = kinesisClient.describeStream(describeStreamRequest).getStreamDescription().getStreamStatus(); return StreamStatus.fromValue(status); }
Source:
<code>public Runner runnerForClass(Class<?> testClass) throws Exception { for (Class<?> currentTestClass = testClass; currentTestClass != null; currentTestClass = getEnclosingClassForNonStaticMemberClass(currentTestClass)) { RunWith annotation = currentTestClass.getAnnotation(RunWith.class); if (annotation != null) { <START> return buildRunner(annotation.value(), currentTestClass); <END> } } return null; }</code><technical_language>want pass testClass instead of currentTestClass here? Passing outermost class @RunWith solve #816</technical_language>

Target:
public Runner runnerForClass(Class<?> testClass) throws Exception { for (Class<?> currentTestClass = testClass; currentTestClass != null; currentTestClass = getEnclosingClassForNonStaticMemberClass(currentTestClass)) { RunWith annotation = currentTestClass.getAnnotation(RunWith.class); if (annotation != null) { return buildRunner(annotation.value(), testClass); } } return null; }
Source:
<code>public void processEapMessage(byte[] msgBytes) { mCallbackFired = false; <START> mProcessResponse = <END> null; mCbHandler.postDelayed(() -> { if (!mCallbackFired) { mCallbackFired = true; mCb.onError(new TimeoutException("Timeout while processing message")); } }, this, TIMEOUT_MILLIS); mWorkerPool.execute(() -> { try { mProcessResponse = mStateMachine.process(msgBytes); } catch (Exception ex) { Log.e(TAG, "Exception thrown while processing message", ex); mProcessResponse = new EapError(ex); } mCbHandler.post(() -> { if (!mCallbackFired) { if (mProcessResponse instanceof EapResponse) { mCb.onResponse(((EapResponse) mProcessResponse).packet); } else if (mProcessResponse instanceof EapError) { mCb.onError(((EapError) mProcessResponse).cause); } else if (mProcessResponse instanceof EapSuccess) { EapSuccess eapSuccess = (EapSuccess) mProcessResponse; mCb.onSuccess(eapSuccess.msk, eapSuccess.emsk); } else { mCb.onFail(); } mCallbackFired = true; mCbHandler.removeCallbacksAndMessages(this); } }); }); }</code><technical_language>If in runnable (l.110+), instantiate there</technical_language>

Target:
public void processEapMessage(byte[] msgBytes) { mCallbackFired = false; mCbHandler.postDelayed(() -> { if (!mCallbackFired) { mCallbackFired = true; mCb.onError(new TimeoutException("Timeout while processing message")); } }, EapAuthenticator.this, mTimeoutMillis); mWorkerPool.execute(() -> { EapResult processResponse; try { processResponse = mStateMachine.process(msgBytes); } catch (Exception ex) { Log.e(TAG, "Exception thrown while processing message", ex); processResponse = new EapError(ex); } final EapResult finalProcessResponse = processResponse; mCbHandler.post(() -> { if (!mCallbackFired) { if (finalProcessResponse instanceof EapResponse) { mCb.onResponse(((EapResponse) finalProcessResponse).packet); } else if (finalProcessResponse instanceof EapError) { mCb.onError(((EapError) finalProcessResponse).cause); } else if (finalProcessResponse instanceof EapSuccess) { EapSuccess eapSuccess = (EapSuccess) finalProcessResponse; mCb.onSuccess(eapSuccess.msk, eapSuccess.emsk); } else { mCb.onFail(); } mCallbackFired = true; mCbHandler.removeCallbacksAndMessages(EapAuthenticator.this); } }); }); }
Source:
<code>public Object visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) throws Throwable { <START> final Object result = super.visitPrepareCommand(ctx, command); <END> if (!ctx.isOriginLocal()) { for (WriteCommand wc : command.getModifications()) { wc.acceptVisitor(ctx, serializationContextUpdaterVisitor); } } return result; }</code><technical_language>This invoke additional interceptors, is okay</technical_language>

Target:
public Object visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) throws Throwable { final Object result = invokeNextInterceptor(ctx, command); if (!ctx.isOriginLocal()) { for (WriteCommand wc : command.getModifications()) { wc.acceptVisitor(ctx, serializationContextUpdaterVisitor); } } return result; }
Source:
<code>private SequenceSegment createSegment(final String descriptor, final String content) { if (descriptor.charAt(0) != '>') { throw new IllegalArgumentException(); } String[] desc = descriptor.split("\\|"); String[] sources = desc[SOURCES_POS].split(","); Set<Sequence> currentSequences = new HashSet<>(); for (String sequencename : sources) { sequencename = sequencename.trim(); if (!sequences.containsKey(sequencename)) { @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") <START> DefaultSequence newSequence = new DefaultSequence(sequencename); <END> sequences.put(sequencename, newSequence); } currentSequences.add(sequences.get(sequencename)); } SequenceSegment segment = new SequenceSegment(currentSequences, Integer.parseInt(desc[START_POS].trim()), Integer.parseInt(desc[END_POS].trim()), new SegmentString( content.trim())); for (Sequence s : currentSequences) { s.appendSegment(segment); } return segment; }</code><technical_language>DefaultSequence type</technical_language>

Target:
private SequenceSegment createSegment(final String descriptor, final String content) { if (descriptor.charAt(0) != '>') { throw new IllegalArgumentException(); } String[] desc = descriptor.split("\\|"); String[] sources = desc[SOURCES_POS].split(","); Set<Sequence> currentSequences = new HashSet<>(); for (String sequencename : sources) { sequencename = sequencename.trim(); if (!sequences.containsKey(sequencename)) { @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") Sequence newSequence = new DefaultSequence(sequencename); sequences.put(sequencename, newSequence); } currentSequences.add(sequences.get(sequencename)); } SequenceSegment segment = new SequenceSegment(currentSequences, Integer.parseInt(desc[START_POS].trim()), Integer.parseInt(desc[END_POS].trim()), new SegmentString( content.trim())); for (Sequence s : currentSequences) { s.appendSegment(segment); } return segment; }
Source:
<code>public void enterModule(ModuleInfo moduleInfo) { this.indexer.addModuleDeclaration(moduleInfo.moduleName); if (moduleInfo.requires != null) { for (ISourceElementRequestor.RequiresInfo req : moduleInfo.requires) { if (req == null || req.moduleName == null || req.moduleName == CharOperation.NO_CHAR) { continue; <START> } <END> this.indexer.addModuleReference(req.moduleName); } } enterPackageVisibilityInfo(moduleInfo.exports); enterPackageVisibilityInfo(moduleInfo.opens); }</code><technical_language>introduce a block (and in other ifs)</technical_language>

Target:
public void enterModule(ModuleInfo moduleInfo) { this.indexer.addModuleDeclaration(moduleInfo.moduleName); if (moduleInfo.requires != null) { for (ISourceElementRequestor.RequiresInfo req : moduleInfo.requires) { if (req == null || req.moduleName == null || req.moduleName == CharOperation.NO_CHAR) continue; this.indexer.addModuleReference(req.moduleName); } } enterPackageVisibilityInfo(moduleInfo.exports); enterPackageVisibilityInfo(moduleInfo.opens); }
Source:
<code>@Override protected Properties setupProperties() { Properties properties = super.setupProperties(); properties.put(ComputeServiceProperties.POLL_INITIAL_PERIOD, 1000); properties.put(ComputeServiceProperties.POLL_MAX_PERIOD, 10000); properties.setProperty(AzureComputeProperties.OPERATION_TIMEOUT, "46000000"); properties.setProperty(AzureComputeProperties.OPERATION_POLL_INITIAL_PERIOD, "5"); properties.setProperty(AzureComputeProperties.OPERATION_POLL_MAX_PERIOD, "15"); properties.setProperty(AzureComputeProperties.TCP_RULE_FORMAT, "tcp_%s-%s"); <START> properties.setProperty(AzureComputeProperties.TCP_RULE_REGEXP, "tcp_\\d{1,5}-\\d{1,5}"); <END> long scriptTimeout = TimeUnit.MILLISECONDS.convert(20, TimeUnit.MINUTES); properties.setProperty(TIMEOUT_SCRIPT_COMPLETE, scriptTimeout + ""); properties.setProperty(TIMEOUT_NODE_RUNNING, scriptTimeout + ""); AzureLiveTestUtils.defaultProperties(properties); checkNotNull(setIfTestSystemPropertyPresent(properties, "jclouds.oauth.resource"), "test.jclouds.oauth.resource"); checkNotNull(setIfTestSystemPropertyPresent(properties, "oauth.endpoint"), "test.oauth.endpoint"); return properties; }</code><technical_language>tcp properties used</technical_language>

Target:
@Override protected Properties setupProperties() { azureGroup = "jc" + RAND; Properties properties = super.setupProperties(); long scriptTimeout = TimeUnit.MILLISECONDS.convert(60, TimeUnit.MINUTES); properties.setProperty(TIMEOUT_SCRIPT_COMPLETE, scriptTimeout + ""); properties.setProperty(TIMEOUT_NODE_RUNNING, scriptTimeout + ""); AzureLiveTestUtils.defaultProperties(properties); checkNotNull(setIfTestSystemPropertyPresent(properties, "oauth.endpoint"), "test.oauth.endpoint"); properties.put(RESOURCE_GROUP_NAME, azureGroup); return properties; }
Source:
<code>public Guid schedule(VDSGroup cluster, VM vm, List<Guid> hostBlackList, List<Guid> hostWhiteList, Guid destHostId, List<String> messages, VdsFreeMemoryChecker memoryChecker, String correlationId) { clusterLockMap.putIfAbsent(cluster.getId(), new Semaphore(1)); try { log.debug("Scheduling started"); checkAllowOverbooking(cluster); clusterLockMap.get(cluster.getId()).acquire(); List<VDS> vdsList = getVdsDAO() .getAllForVdsGroupWithStatus(cluster.getId(), VDSStatus.Up); updateInitialHostList(vdsList, hostBlackList, true); updateInitialHostList(vdsList, hostWhiteList, false); ClusterPolicy policy = policyMap.get(cluster.getClusterPolicyId()); Map<String, String> parameters = createClusterPolicyParameters(cluster); vdsList = runFilters(policy.getFilters(), vdsList, vm, parameters, policy.getFilterPositionMap(), messages, memoryChecker, true, correlationId); if (vdsList == null || vdsList.isEmpty()) { return null; } Guid bestHost = selectBestHost(cluster, vm, destHostId, vdsList, policy, parameters); getVdsDynamicDao().updatePartialVdsDynamicCalc( bestHost, 1, vm.getNumOfCpus(), vm.getMinAllocatedMem(), 0, 0); return bestHost; } catch (InterruptedException e) { log.error("interrupted", e); return null; } finally { synchronized (clusterLockMap.get(cluster.getId())) { clusterLockMap.get(cluster.getId()).drainPermits(); clusterLockMap.get(cluster.getId()).release(); } <START> log.debug("Scheduling ended, correlation Id: {}", correlationId); <END> } }</code><technical_language>if removed remove this one? add above</technical_language>

Target:
public Guid schedule(VDSGroup cluster, VM vm, List<Guid> hostBlackList, List<Guid> hostWhiteList, Guid destHostId, List<String> messages, VdsFreeMemoryChecker memoryChecker, String correlationId) { clusterLockMap.putIfAbsent(cluster.getId(), new Semaphore(1)); try { log.debug("Scheduling started, correlation Id: {}", correlationId); checkAllowOverbooking(cluster); clusterLockMap.get(cluster.getId()).acquire(); List<VDS> vdsList = getVdsDAO() .getAllForVdsGroupWithStatus(cluster.getId(), VDSStatus.Up); updateInitialHostList(vdsList, hostBlackList, true); updateInitialHostList(vdsList, hostWhiteList, false); ClusterPolicy policy = policyMap.get(cluster.getClusterPolicyId()); Map<String, String> parameters = createClusterPolicyParameters(cluster); vdsList = runFilters(policy.getFilters(), vdsList, vm, parameters, policy.getFilterPositionMap(), messages, memoryChecker, true, correlationId); if (vdsList == null || vdsList.isEmpty()) { return null; } Guid bestHost = selectBestHost(cluster, vm, destHostId, vdsList, policy, parameters); getVdsDynamicDao().updatePartialVdsDynamicCalc( bestHost, 1, vm.getNumOfCpus(), vm.getMinAllocatedMem(), 0, 0); return bestHost; } catch (InterruptedException e) { log.error("interrupted", e); return null; } finally { synchronized (clusterLockMap.get(cluster.getId())) { clusterLockMap.get(cluster.getId()).drainPermits(); clusterLockMap.get(cluster.getId()).release(); } log.debug("Scheduling ended, correlation Id: {}", correlationId); } }
Source:
<code>CertificateAsyncClient(URL vaultUrl, HttpPipeline pipeline, CertificateServiceVersion version) { Objects.requireNonNull(vaultUrl, KeyVaultErrorCodeStrings.getErrorString(KeyVaultErrorCodeStrings.VAULT_END_POINT_REQUIRED)); this.vaultUrl = vaultUrl.toString(); this.service = RestProxy.create(CertificateService.class, pipeline); <START> API_VERSION = version.getVersion(); <END> }</code><technical_language>field is static. means passing a version instance of a client is changing for clients</technical_language>

Target:
CertificateAsyncClient(URL vaultUrl, HttpPipeline pipeline, CertificateServiceVersion version) { Objects.requireNonNull(vaultUrl, KeyVaultErrorCodeStrings.getErrorString(KeyVaultErrorCodeStrings.VAULT_END_POINT_REQUIRED)); this.vaultUrl = vaultUrl.toString(); this.service = RestProxy.create(CertificateService.class, pipeline); apiVersion = version.getVersion(); }
Source:
<code><START> private Block getNullBlock(Type type, int positionCount) <END> { Block nullValueBlock = type.createBlockBuilder(null, 1) .appendNull() .build(); return new RunLengthEncodedBlock(nullValueBlock, positionCount); }</code><technical_language>I this static</technical_language>

Target:
private static Block getNullBlock(Type type, int positionCount) { Block nullValueBlock = type.createBlockBuilder(null, 1) .appendNull() .build(); return new RunLengthEncodedBlock(nullValueBlock, positionCount); }
Source:
<code>protected MutableBoundedValue<Short> constructValue(Short actualValue) { <START> return SpongeValueFactory.boundedBuilder(Keys.SPAWNER_REMAINING_DELAY) <END> .minimum((short) 0) .maximum(Short.MAX_VALUE) .defaultValue(DataConstants.DEFAULT_SPAWNER_REMAINING_DELAY) .actualValue(actualValue) .build(); }</code><technical_language>this.key</technical_language>

Target:
protected MutableBoundedValue<Short> constructValue(Short actualValue) { return SpongeValueFactory.boundedBuilder(this.key) .minimum((short) 0) .maximum(Short.MAX_VALUE) .defaultValue(DataConstants.DEFAULT_SPAWNER_REMAINING_DELAY) .actualValue(actualValue) .build(); }
Source:
<code>public boolean hasNext() { if (finished) return false; if (iter != null && iter.hasNext()) { return true; } iter = getNextBatch().iterator(); if (!iter.hasNext()) { finished = true; <START> activeIters.remove(this); <END> return false; } return true; }</code><technical_language>Do need synchronize this remove? closed time</technical_language>

Target:
public boolean hasNext() { if (finished) return false; if (iter != null && iter.hasNext()) { return true; } iter = getNextBatch().iterator(); if (!iter.hasNext()) { finished = true; reporter.finished(this); return false; } return true; }
Source:
<code>private static void fillInputPayload(Operation swaggerOperation, org.restlet.ext.apispark.internal.model.Operation operation, Contract contract) { BodyParameter bodyParameter = SwaggerUtils.getInputPayload(swaggerOperation); if (bodyParameter != null) { PayLoad payload = new PayLoad(); Model model = bodyParameter.getSchema(); payload.setDescription(model.getDescription()); if (model instanceof ArrayModel) { ArrayModel arrayModel = (ArrayModel) model; payload.setArray(true); payload.setType(SwaggerTypes.toDefinitionType(arrayModel.getItems())); } else if (model instanceof RefModel) { RefModel refModel = (RefModel) model; payload.setType(refModel.getSimpleRef()); } else { <START> LOGGER.warning("Unsupported input payload type: " + model.getClass().getSimpleName()); <END> } Representation representation = contract.getRepresentation(payload.getType()); if (representation != null) { representation.addSections(swaggerOperation.getTags()); } operation.setInputPayLoad(payload); } }</code><technical_language>return continue</technical_language>

Target:
private static void fillInputPayload(Operation swaggerOperation, org.restlet.ext.apispark.internal.model.Operation operation, Contract contract) { BodyParameter bodyParameter = SwaggerUtils.getInputPayload(swaggerOperation); if (bodyParameter != null) { PayLoad payload = new PayLoad(); fillPayload(bodyParameter, payload); Representation representation = contract.getRepresentation(payload.getType()); if (representation != null) { representation.addSections(swaggerOperation.getTags()); } operation.setInputPayLoad(payload); } }
Source:
<code>public SystemPurposeComplianceStatusDTO(SystemPurposeComplianceStatusDTO source) { <START> this.populate(source); <END> }</code><technical_language>This super(source); instead of populate method (I this in ComplianceStatusDTO, is wrong too)</technical_language>

Target:
public SystemPurposeComplianceStatusDTO(SystemPurposeComplianceStatusDTO source) { super(source); }
Source:
<code>private T convertStreamToStringAndParse(HttpResponse response) { String from = null; try { <START> byte[] array = closeClientButKeepContentStream(response); <END> from = new String(array); validateXml(from); return doParse(new InputSource(new ByteArrayInputStream(array))); } catch (Exception e) { return addDetailsAndPropagate(response, e, from); } }</code><technical_language>[really minor] responseBytes so, array</technical_language>

Target:
private T convertStreamToStringAndParse(HttpResponse response) { String from = null; try { byte[] fromBytes = closeClientButKeepContentStream(response); from = new String(fromBytes); validateXml(from); return doParse(new InputSource(new ByteArrayInputStream(fromBytes))); } catch (Exception e) { return addDetailsAndPropagate(response, e, from); } }
Source:
<code>public IResource[] members() throws IOException { VirtualFile folder = getVirtualFile(); if (folder == null || !folder.exists()) { <START> throw new FileNotFoundException( <END> "Could not obtain child resources for " + this + " as it does not exist or is not valid"); } if (!folder.isDirectory()) { throw new IOException( "Could not obtain child resources for " + this + " as it is not a directory."); } List<IResource> result = new ArrayList<>(); VirtualFile[] children = folder.getChildren(); for (VirtualFile child : children) { IPath childPath = relativePath.append(IntelliJPathImpl.fromString(child.getName())); result.add( child.isDirectory() ? new IntellijFolderImplV2(referencePoint, childPath) : new IntellijFileImplV2(referencePoint, childPath)); } return result.toArray(new IResource[0]); }</code><technical_language>plans changing return type (of interface) List? conversions array, list, array in code path a bit ugly</technical_language>

Target:
public List<IResource> members() throws IOException { VirtualFile folder = getVirtualFile(); if (folder == null || !folder.exists()) { throw new FileNotFoundException( "Could not obtain child resources for " + this + " as it does not exist or is not valid"); } if (!folder.isDirectory()) { throw new IOException( "Could not obtain child resources for " + this + " as it is not a directory."); } List<IResource> result = new ArrayList<>(); VirtualFile[] children = folder.getChildren(); for (VirtualFile child : children) { IPath childPath = relativePath.append(IntelliJPathImpl.fromString(child.getName())); result.add( child.isDirectory() ? new IntellijFolderImplV2(referencePoint, childPath) : new IntellijFileImplV2(referencePoint, childPath)); } return result; }
Source:
<code>public static JavaQualifiedName ofString(String name) { JavaQualifiedName qname = new JavaQualifiedName(); Matcher matcher = FORMAT.matcher(name); if (!matcher.matches()) { return null; } qname.packages = ".".equals(matcher.group(PACKAGES_GROUP_INDEX)) ? null : matcher.group(PACKAGES_GROUP_INDEX).split("\\."); qname.operation = matcher.group(OPERATION_GROUP_INDEX) == null ? null : matcher.group(OPERATION_GROUP_INDEX).substring(1); qname.classes = matcher.group(CLASSES_GROUP_INDEX).split("\\$"); qname.localIndices = new int[qname.classes.length]; <START> Pattern localIndexPattern = Pattern.compile("(\\d+)(\\w+)"); <END> for (int i = 0; i < qname.classes.length; i++) { Matcher localIndexMatcher = localIndexPattern.matcher(qname.classes[i]); if (localIndexMatcher.matches()) { qname.localIndices[i] = Integer.parseInt(localIndexMatcher.group(1)); qname.classes[i] = localIndexMatcher.group(2); } else { qname.localIndices[i] = NOTLOCAL_PLACEHOLDER; } } return qname; }</code><technical_language>reason this pattern a static final avoid recompiling regexp time</technical_language>

Target:
public static JavaQualifiedName ofString(String name) { JavaQualifiedName qname = new JavaQualifiedName(); Matcher matcher = FORMAT.matcher(name); if (!matcher.matches()) { return null; } qname.packages = ".".equals(matcher.group(PACKAGES_GROUP_INDEX)) ? null : matcher.group(PACKAGES_GROUP_INDEX).split("\\."); qname.operation = matcher.group(OPERATION_GROUP_INDEX) == null ? null : matcher.group(OPERATION_GROUP_INDEX).substring(1); qname.classes = matcher.group(CLASSES_GROUP_INDEX).split("\\$"); qname.localIndices = new int[qname.classes.length]; for (int i = 0; i < qname.classes.length; i++) { Matcher localIndexMatcher = LOCAL_INDEX_PATTERN.matcher(qname.classes[i]); if (localIndexMatcher.matches()) { qname.localIndices[i] = Integer.parseInt(localIndexMatcher.group(1)); qname.classes[i] = localIndexMatcher.group(2); } else { qname.localIndices[i] = NOTLOCAL_PLACEHOLDER; } } return qname; }
Source:
<code>protected void configure() { <START> if (repoConfig.getAllBasePaths().length == 0) { <END> install(new LocalDiskRepositoryManager.Module()); } else { install(new ShardedLocalDiskRepositoryManager.Module()); } }</code><technical_language>If convert getAllBasePaths return List<String> this is spelled .isEmpty()</technical_language>

Target:
protected void configure() { if (repoConfig.getAllBasePaths().isEmpty()) { install(new LocalDiskRepositoryManager.Module()); } else { install(new MultiBaseLocalDiskRepositoryManager.Module()); } }
Source:
<code>public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof GoogleComputeEngineTemplateOptions) { GoogleComputeEngineTemplateOptions eTo = GoogleComputeEngineTemplateOptions.class.cast(to); <START> eTo.networks(to.getNetworks()); END> eTo.autoCreateKeyPair(autoCreateKeyPair()); eTo.serviceAccounts(serviceAccounts()); eTo.bootDiskType(bootDiskType()); eTo.disks(getDisks()); eTo.autoCreateDisks(getAutoCreateDisks()); eTo.canIpForward(canIpForward()); } }</code><technical_language>This is copied in parent class</technical_language>

Target:
public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof GoogleComputeEngineTemplateOptions) { GoogleComputeEngineTemplateOptions eTo = GoogleComputeEngineTemplateOptions.class.cast(to); eTo.autoCreateKeyPair(autoCreateKeyPair()); eTo.serviceAccounts(serviceAccounts()); eTo.bootDiskType(bootDiskType()); eTo.disks(getDisks()); eTo.addAutoCreateDisks(getAutoCreateDisks()); eTo.canIpForward(canIpForward()); } }
Source:
<code>public void onKeyboardClosed() { fabSearchButton.setVisibility(View.VISIBLE); listView.clearChoices(); if(getCurrentFocus() != null) { System.out.println("Current focus: " + getCurrentFocus().toString()); } else { <START> System.out.println("Current focus: null"); <END> } }</code><technical_language>Do need remove this</technical_language>

Target:
public void onKeyboardClosed() { fabSearchButton.setVisibility(View.VISIBLE); listView.clearChoices(); }
Source:
<code>public ActionResult execute() { InstructorCoursesPageData data = new InstructorCoursesPageData(account, sessionToken); List<InstructorAttributes> instructorList = logic.getInstructorsForGoogleId(data.account.googleId); for (InstructorAttributes instructor : instructorList) { List<FeedbackSessionAttributes> feedbackSessionList = logic.getRecoveryFeedbackSessionsListForInstructor(instructor); for (FeedbackSessionAttributes feedbackSession : feedbackSessionList) { gateKeeper.verifyAccessible(instructor, feedbackSession, false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); } } try { logic.restoreAllFeedbackSessionsFromRecovery(instructorList); String statusMessage = Const.StatusMessages.FEEDBACK_SESSION_ALL_RESTORED; statusToUser.add(new StatusMessage(statusMessage, StatusMessageColor.SUCCESS)); <START> statusToAdmin = "All sessions restored"; <END> } catch (Exception e) { setStatusForException(e); } return createRedirectResult(Const.ActionURIs.INSTRUCTOR_FEEDBACK_SESSIONS_PAGE); }</code><technical_language>Again, admin status message more informative (e.g. adding in some information instructor). Right now, is absolutely more admin restored some sessions</technical_language>

Target:
public ActionResult execute() { InstructorCoursesPageData data = new InstructorCoursesPageData(account, sessionToken); List<InstructorAttributes> instructorList = logic.getInstructorsForGoogleId(data.account.googleId); for (InstructorAttributes instructor : instructorList) { List<FeedbackSessionAttributes> feedbackSessionList = logic.getRecoveryFeedbackSessionsListForInstructor(instructor); for (FeedbackSessionAttributes feedbackSession : feedbackSessionList) { gateKeeper.verifyAccessible(instructor, feedbackSession, false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); } } try { logic.restoreAllFeedbackSessionsFromRecovery(instructorList); String statusMessage = Const.StatusMessages.FEEDBACK_SESSION_ALL_RESTORED; statusToUser.add(new StatusMessage(statusMessage, StatusMessageColor.SUCCESS)); statusToAdmin = "All sessions in Recycle Bin restored"; } catch (Exception e) { setStatusForException(e); } return createRedirectResult(Const.ActionURIs.INSTRUCTOR_FEEDBACK_SESSIONS_PAGE); }
Source:
<code>public void launch(Package name) throws IOException, JadbException { InputStream s = device.executeShell("monkey", "-p", name.toString(), "-c", "android.intent.category.LAUNCHER", "1"); <START> Stream.flushRead(s); <END> s.close(); }</code><technical_language>is this needed</technical_language>

Target:
public void launch(Package name) throws IOException, JadbException { try (InputStream stream = device.executeShell("monkey", "-p", name.toString(), "-c", "android.intent.category.LAUNCHER", "1")) { Stream.flushRead(stream); } }
Source:
<code>public Job getJob() throws Exception { if (isPartialBuild) { return configureJobForPartialBuild(); } else { long maxTimeRange = pIndexTable.getTimeStamp() + 1; if (pDataTable.isTransactional()) { configuration.set(PhoenixConfigurationUtil.TX_SCN_VALUE, Long.toString(TransactionUtil.convertToNanoseconds(maxTimeRange))); configuration.set(PhoenixConfigurationUtil.TX_PROVIDER, pDataTable.getTransactionProvider().name()); } configuration.set(PhoenixConfigurationUtil.CURRENT_SCN_VALUE, Long.toString(maxTimeRange)); if (useSnapshot || !useDirectApi || (!isLocalIndexBuild && pDataTable.isTransactional())) { return configureJobForAysncIndex(); } else { <START> configuration.unset(PhoenixConfigurationUtil.CURRENT_SCN_VALUE); <END> return configureJobForServerBuildIndex(); } } }</code><technical_language>IMO, this configuration change configureJobForServerBuildIndex() future calls do miss it. I noticed configureJobForServerBuildIndex() configuration.set() calls, this out of place</technical_language>

Target:
public Job getJob() throws Exception { if (isPartialBuild) { return configureJobForPartialBuild(); } else if (useSnapshot || !useDirectApi || (!isLocalIndexBuild && pDataTable.isTransactional())) { long maxTimeRange = pIndexTable.getTimeStamp() + 1; if (pDataTable.isTransactional()) { configuration.set(PhoenixConfigurationUtil.TX_SCN_VALUE, Long.toString(TransactionUtil.convertToNanoseconds(maxTimeRange))); configuration.set(PhoenixConfigurationUtil.TX_PROVIDER, pDataTable.getTransactionProvider().name()); } configuration.set(PhoenixConfigurationUtil.CURRENT_SCN_VALUE, Long.toString(maxTimeRange)); return configureJobForAysncIndex(); } else { return configureJobForServerBuildIndex(); } }
Source:
<code>protected Number calculateVerticalStringDiff(final String templateString, final ILayerCell cell, final int toColumn) { <START> ILayerCell[][] cells = this.clipboard.getCopiedCells(); <END> int columnDiff = getColumnDiff(cell, toColumn); int rowArrayIndex = cell.getRowIndex() - this.clipboard.getCopiedCells()[0][0].getRowIndex(); if (cells[rowArrayIndex].length == 1) { return columnDiff; } else { Integer diff = calculateStringDiff(cells[rowArrayIndex][1], cells[rowArrayIndex][0], templateString); if (diff == null) { return null; } Integer temp = diff; for (int i = 1; i < cells.length; i++) { temp = calculateStringDiff(cells[rowArrayIndex][i], cells[rowArrayIndex][i - 1], templateString); if (temp == null || !temp.equals(diff)) { return null; } } return diff * columnDiff; } }</code><technical_language>final</technical_language>

Target:
protected Number calculateVerticalStringDiff(final String templateString, final ILayerCell cell, final int toColumn) { final ILayerCell[][] cells = this.clipboard.getCopiedCells(); final int columnDiff = getColumnDiff(cell, toColumn); final int rowArrayIndex = cell.getRowIndex() - this.clipboard.getCopiedCells()[0][0].getRowIndex(); if (1 == cells[rowArrayIndex].length) { return columnDiff; } else { final Integer diff = calculateStringDiff(cells[rowArrayIndex][1], cells[rowArrayIndex][0], templateString); if (null == diff) { return null; } Integer temp = diff; for (int i = 1; i < cells.length; i++) { temp = calculateStringDiff(cells[rowArrayIndex][i], cells[rowArrayIndex][i - 1], templateString); if (null == temp || !temp.equals(diff)) { return null; } } return diff * columnDiff; } }
Source:
<code>public static Mode fromString(String inStr) { if (inStr == null || inStr.isEmpty()) { throw new IllegalArgumentException("String representation of MultiAuthenticator.Mode can not be null nor empty."); } inStr = inStr.toLowerCase(); <START> if (inStr.equals("any")){ <END> return ANY; } if (inStr.equals("all") || inStr.equals("every")){ return ALL; } throw new IllegalArgumentException("Unknown string representation [" + inStr + "] for MultiAuthenticator.Mode"); }</code><technical_language>equalsIgnoreCase()</technical_language>

Target:
public static Mode fromString(String inStr) { if (inStr == null || inStr.isEmpty()) { throw new IllegalArgumentException("String representation of MultiAuthenticator.Mode can not be null nor empty."); } if (inStr.equalsIgnoreCase("any")){ return ANY; } if (inStr.equalsIgnoreCase("all")){ return ALL; } throw new IllegalArgumentException("Unknown string representation [" + inStr + "] for MultiAuthenticator.Mode"); }
Source:
<code>public boolean performNextOperation(int completedChildCount) { syncChildCommandList(getParameters()); Guid currentChildId = getCurrentChildId(getParameters()); if (currentChildId != null) { getParameters().setCommandStep(getParameters().getNextCommandStep()); } <START> log.info("Command id: '{}' is executing step: '{}'", getCommandId(), getParameters().getCommandStep()); <END> Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case PREPARE_MERGE: break; case MERGE: break; case FINALIZE_MERGE: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; } persistCommandIfNeeded(); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }</code><technical_language>"Command id: '{}': executing step.. {}", getActionType()... please remove "is"</technical_language>

Target:
public boolean performNextOperation(int completedChildCount) { syncChildCommandList(getParameters()); Guid currentChildId = getCurrentChildId(getParameters()); if (currentChildId != null) { getParameters().setCommandStep(getParameters().getNextCommandStep()); } log.info("Command: '{}' id: '{}' executing step: '{}'", getActionType(), getCommandId(), getParameters().getCommandStep()); Pair<VdcActionType, ? extends VdcActionParametersBase> nextCommand = null; switch (getParameters().getCommandStep()) { case PREPARE_MERGE: break; case MERGE: break; case FINALIZE_MERGE: break; case DESTROY_IMAGE: break; case DESTROY_IMAGE_CHECK: break; } persistCommandIfNeeded(); if (nextCommand != null) { runInternalActionWithTasksContext(nextCommand.getFirst(), nextCommand.getSecond()); return true; } else { return false; } }
Source:
<code>public static void run(String realfile, String host, int port, boolean debug2) throws MalformedURLException, URISyntaxException { <START> debug = debug2; <END> String file = "reactivesocket-tck-drivers/src/main/test/resources/clienttest$.txt"; if (realfile != null) file = realfile; try { setURI(new URI("tcp://" + host + ":" + port + "/rs")); JavaClientDriver jd = new JavaClientDriver(file); jd.runTests(); } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>rename param "this.debug = debug;"</technical_language>

Target:
public static void run(String realfile, String host, int port, boolean debug2) throws MalformedURLException, URISyntaxException { debug = debug2; String file = "reactivesocket-tck-drivers/src/main/test/resources/clienttest$.txt"; if (realfile != null) file = realfile; try { setURI(new URI("tcp://" + host + ":" + port + "/rs")); JavaClientDriver jd = new JavaClientDriver(file, JavaTCPClient::createClient); jd.runTests(); } catch (Exception e) { e.printStackTrace(); } }
Source:
<code>private EntryLogEntry getFCForEntryInternal( long ledgerId, long entryId, long entryLogId, long pos) throws EntryLookupException, IOException { ByteBuf sizeBuff = sizeBuffer.get(); sizeBuff.clear(); pos -= 4; BufferedReadChannel fc; try { fc = getChannelForLogId(entryLogId); } catch (FileNotFoundException e) { throw new EntryLookupException.MissingLogFileException(ledgerId, entryId, entryLogId, pos); } try { if (readFromLogChannel(entryLogId, fc, sizeBuff, pos) != sizeBuff.capacity()) { throw new EntryLookupException.MissingEntryException(ledgerId, entryId, entryLogId, pos); } } catch (BufferedChannelBase.ChannelClosed | AsynchronousCloseException e) { <START> throw new EntryLookupException.MissingLogFileException(ledgerId, entryId, entryLogId, pos); <END> } pos += 4; int entrySize = sizeBuff.readInt(); if (entrySize > maxSaneEntrySize) { LOG.warn("Sanity check failed for entry size of " + entrySize + " at location " + pos + " in " + entryLogId); } if (entrySize < MIN_SANE_ENTRY_SIZE) { LOG.error("Read invalid entry length {}", entrySize); throw new EntryLookupException.InvalidEntryLengthException(ledgerId, entryId, entryLogId, pos); } long thisLedgerId = sizeBuff.getLong(4); long thisEntryId = sizeBuff.getLong(12); if (thisLedgerId != ledgerId || thisEntryId != entryId) { throw new EntryLookupException.WrongEntryException( thisEntryId, thisLedgerId, ledgerId, entryId, entryLogId, pos); } return new EntryLogEntry(entrySize, fc); }</code><technical_language>explain 'ChannelClosed' AsynchronousCloseException is treated MissingLogFileException</technical_language>

Target:
private EntryLogEntry getFCForEntryInternal( long ledgerId, long entryId, long entryLogId, long pos) throws EntryLookupException, IOException { ByteBuf sizeBuff = sizeBuffer.get(); sizeBuff.clear(); pos -= 4; BufferedReadChannel fc; try { fc = getChannelForLogId(entryLogId); } catch (FileNotFoundException e) { throw new EntryLookupException.MissingLogFileException(ledgerId, entryId, entryLogId, pos); } try { if (readFromLogChannel(entryLogId, fc, sizeBuff, pos) != sizeBuff.capacity()) { throw new EntryLookupException.MissingEntryException(ledgerId, entryId, entryLogId, pos); } } catch (BufferedChannelBase.BufferedChannelClosedException | AsynchronousCloseException e) { throw new EntryLookupException.MissingLogFileException(ledgerId, entryId, entryLogId, pos); } pos += 4; int entrySize = sizeBuff.readInt(); if (entrySize > maxSaneEntrySize) { LOG.warn("Sanity check failed for entry size of " + entrySize + " at location " + pos + " in " + entryLogId); } if (entrySize < MIN_SANE_ENTRY_SIZE) { LOG.error("Read invalid entry length {}", entrySize); throw new EntryLookupException.InvalidEntryLengthException(ledgerId, entryId, entryLogId, pos); } long thisLedgerId = sizeBuff.getLong(4); long thisEntryId = sizeBuff.getLong(12); if (thisLedgerId != ledgerId || thisEntryId != entryId) { throw new EntryLookupException.WrongEntryException( thisEntryId, thisLedgerId, ledgerId, entryId, entryLogId, pos); } return new EntryLogEntry(entrySize, fc); }
Source:
<code>protected InternalCompletableFuture<Boolean> callPutIfAbsentAsync(K key, Data keyData, V value, Data valueData, Data expiryPolicyData, boolean withCompletionEvent, BiConsumer<Boolean, Throwable> statsCallback) { InternalCompletableFuture<Boolean> future = doPutIfAbsentOnServer(keyData, valueData, expiryPolicyData, withCompletionEvent); if (statsCallback == null) { return future; } else { <START> future.whenCompleteAsync(statsCallback); <END> return future; } }</code><technical_language>Missing CALLER_RUNS, in doReplaceOnServer doGetAndReplaceOnServer. addCallback</technical_language>

Target:
protected CompletableFuture<Boolean> callPutIfAbsentAsync(K key, Data keyData, V value, Data valueData, Data expiryPolicyData, boolean withCompletionEvent, BiConsumer<Boolean, Throwable> statsCallback) { InternalCompletableFuture<Boolean> future = doPutIfAbsentOnServer(keyData, valueData, expiryPolicyData, withCompletionEvent); return addCallback(future, statsCallback); }
Source:
<code>public void assertStartsWithCount(int eventsCount, String startsWith) { List<LogEntry> logs = auditBackend.queryLogs(new AuditQueryBuilder().predicates( Predicates.eq(LOG_EVENT_ID, ID_FOR_AUDIT_STORAGE_TESTS), <START> new Predicate(new Reference(LOG_DOC_PATH), Operator.STARTSWITH, Literals.toLiteral(startsWith)))); <END> assertEquals(eventsCount, logs.size()); }</code><technical_language>adding this Predicates</technical_language>

Target:
public void assertStartsWithCount(int eventsCount, String startsWith) { List<LogEntry> logs = auditBackend.queryLogs(new AuditQueryBuilder().predicates( Predicates.eq(LOG_EVENT_ID, ID_FOR_AUDIT_STORAGE_TESTS), Predicates.startsWith(LOG_DOC_PATH, startsWith))); assertEquals(eventsCount, logs.size()); }
Source:
<code>private static boolean isSingleLineBlock(Details details) { final DetailAST rcurly = details.rcurly; final DetailAST lcurly = details.lcurly; final DetailAST nextToken = getNextToken(details.lcurly.getParent().getLastChild()); return rcurly.getLineNo() == lcurly.getLineNo() && (rcurly.getLineNo() != nextToken.getLineNo() <START> || rcurly.getLineNo() != details.nextToken.getLineNo()); <END> }</code><technical_language>Please increase offset</technical_language>

Target:
private static boolean isSingleLineBlock(Details details) { final DetailAST rcurly = details.rcurly; final DetailAST lcurly = details.lcurly; DetailAST nextToken = details.nextToken; while (nextToken.getType() == TokenTypes.LITERAL_ELSE) { nextToken = Details.getNextToken(nextToken); } if (nextToken.getType() == TokenTypes.DO_WHILE) { final DetailAST doWhileSemi = nextToken.getParent().getLastChild(); nextToken = Details.getNextToken(doWhileSemi); } return rcurly.getLineNo() == lcurly.getLineNo() && rcurly.getLineNo() != nextToken.getLineNo(); }
Source:
<code>public static void waitForContainerWithReleaseId(final KieServicesClient client, final ReleaseId releaseId) throws Exception { waitForCondition(new WaitingCondition() { @Override public boolean conditionPassed() { <START> ServiceResponse<KieContainerResourceList> containersList = client.listContainers(); <END> List<KieContainerResource> containers = containersList.getResult().getContainers(); if (containers != null) { for (KieContainerResource container : containers) { if (container.getReleaseId().equals(releaseId)) { return true; } } } return false; } }); }</code><technical_language>listContainers(KieContainerResourceFilter containerFilter) retrieve containers specific release id</technical_language>

Target:
public static void waitForContainerWithReleaseId(final KieServicesClient client, final ReleaseId releaseId) throws Exception { waitForCondition(new WaitingCondition() { @Override public boolean conditionPassed() { ReleaseIdFilter releaseIdFilter = new ReleaseIdFilter(releaseId); KieContainerResourceFilter resourceFilter = new KieContainerResourceFilter(releaseIdFilter); ServiceResponse<KieContainerResourceList> containersList = client.listContainers(resourceFilter); List<KieContainerResource> containers = containersList.getResult().getContainers(); return containers != null && !containers.isEmpty(); } }); }