auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ComplexMetricExtractor getExtractor() { return new ComplexMetricExtractor() { @Override public Class<HyperLogLogCollector> extractedClass() { return HyperLogLogCollector.class; } @Override public HyperLogLogCollector extractValue(InputRow inputRow, String metricName) { Object rawValue = inputRow.getRaw(metricName); if (rawValue instanceof HyperLogLogCollector) { return (HyperLogLogCollector) rawValue; } else { HyperLogLogCollector collector = HyperLogLogCollector.makeLatestCollector(); <START> List<String> dimValues = inputRow.getDimension(metricName); <END> if (dimValues == null) { return collector; } for (String dimensionValue : dimValues) { collector.fold(ByteBuffer.wrap(Base64.decodeBase64(dimensionValue))); } return collector; } } }; }</code><technical_language>suggest similar SketchMergeComplexMetricSerde here. - inputRow.getRaw(metricName) get actual input row, transformed a List<String> - handle some types be; SketchHolder.deserialize for example. For this suggest handling String, byte[], HyperLogLogCollector. This faster work input rows non-text sources, field a byte array a HLLC object. explicitly _not_ handle lists of HLLs I is sense, want support anyway</technical_language>

Target:
public ComplexMetricExtractor getExtractor() { return new ComplexMetricExtractor() { @Override public Class<HyperLogLogCollector> extractedClass() { return HyperLogLogCollector.class; } @Override public HyperLogLogCollector extractValue(InputRow inputRow, String metricName) { Object rawValue = inputRow.getRaw(metricName); if (rawValue == null) { return HyperLogLogCollector.makeLatestCollector(); } else if (rawValue instanceof HyperLogLogCollector) { return (HyperLogLogCollector) rawValue; } else if (rawValue instanceof byte[]) { return HyperLogLogCollector.makeLatestCollector().fold(ByteBuffer.wrap((byte[]) rawValue)); } else if (rawValue instanceof String) { return HyperLogLogCollector.makeLatestCollector().fold(ByteBuffer.wrap(Base64.decodeBase64((String) rawValue))); } throw new ISE("Object is not of a type[%s] that can be deserialized to HyperLogLog.", rawValue.getClass()); } }; }
Source:
<code>public O implementInterface(JavaInterface<?> type) { O obj = addInterface(type); <START> if (type instanceof JavaInterfaceSource) { <END> for (Import imprt : ((JavaInterfaceSource) type).getImports()) { addImport(imprt); } } for (MethodSource<?> methodSource : Methods.implementAbstractMethods(type, this)) { methodSource.setPublic().addAnnotation(Override.class); } return obj; }</code><technical_language>method parameter type changed JavaInterfaceSource? break</technical_language>

Target:
public O implementInterface(JavaInterface<?> type) { O obj = addInterface(type); if (type instanceof JavaInterfaceSource) { Set<Import> usedImports = new HashSet<Import>(); JavaInterfaceSource interfaceSource = (JavaInterfaceSource) type; for (MethodSource<JavaInterfaceSource> method : interfaceSource.getMethods()) { if (method.isDefault()) { continue; } if (!method.isReturnTypeVoid()) { usedImports.add(interfaceSource.getImport(method.getReturnType().getQualifiedName())); } for (ParameterSource<JavaInterfaceSource> parameter : method.getParameters()) { usedImports.add(interfaceSource.getImport(parameter.getType().getQualifiedName())); } } for (Import imprt : interfaceSource.getImports()) { if (usedImports.contains(imprt)) { addImport(imprt); } } } for (MethodSource<?> methodSource : Methods.implementAbstractMethods(type, this)) { methodSource.setPublic().addAnnotation(Override.class); } return obj; }
Source:
<code>public Response undo(Action action) { <START> action.setAsync(false); <END> RestoreAllSnapshotsParameters restoreParams = new RestoreAllSnapshotsParameters(parentId, guid); Response response = doAction(VdcActionType.RestoreAllSnapshots, restoreParams, action, PollingType.JOB); return response; }</code><technical_language>this action sync</technical_language>

Target:
public Response undo(Action action) { RestoreAllSnapshotsParameters restoreParams = new RestoreAllSnapshotsParameters(parentId, guid); Response response = doAction(VdcActionType.RestoreAllSnapshots, restoreParams, action); return response; }
Source:
<code>public static int[][] calculateResponseFrequencyExcludingSelf(List<FeedbackResponseAttributes> responses, FeedbackRubricQuestionDetails questionDetails) { <START> int numOfRubricSubQuestions = questionDetails.getNumOfRubricSubQuestions(); <END> int numOfRubricChoices = questionDetails.getNumOfRubricChoices(); int responseTotalIndex = numOfRubricChoices; int[][] responseFrequencyExcludingSelf = new int[numOfRubricSubQuestions][numOfRubricChoices + 1]; for (FeedbackResponseAttributes response : responses) { FeedbackRubricResponseDetails frd = (FeedbackRubricResponseDetails) response.getResponseDetails(); for (int i = 0; i < numOfRubricSubQuestions; i++) { int chosenChoice = frd.getAnswer(i); if (chosenChoice != -1 && !response.giver.equals(response.recipient)) { responseFrequencyExcludingSelf[i][chosenChoice] += 1; responseFrequencyExcludingSelf[i][responseTotalIndex] += 1; } } } return responseFrequencyExcludingSelf; }</code><technical_language>java List<FeedbackResponseAttributes> responsesExcludingSelf = responses.stream().filter(response -> !response.giver.equals(response.recipient)).collect(Collectors.toList()); return calculateResponseFrequency(responsesExcludingSelf, questionDetails) u want repeat :P</technical_language>

Target:
public static int[][] calculateResponseFrequencyExcludingSelf(List<FeedbackResponseAttributes> responses, FeedbackRubricQuestionDetails questionDetails) { List<FeedbackResponseAttributes> responsesExcludingSelf = responses.stream() .filter(response -> !response.giver.equals(response.recipient)).collect(Collectors.toList()); return calculateResponseFrequency(responsesExcludingSelf, questionDetails); }
Source:
<code>public int getViewId() { if (channel == null) throw new CacheException("The cache has been stopped and invocations are not allowed!"); <START> return (int) clusterView.getViewId(); <END> }</code><technical_language>cast needed</technical_language>

Target:
public int getViewId() { if (channel == null) throw new CacheException("The cache has been stopped and invocations are not allowed!"); return clusterView.getViewId(); }
Source:
<code>public void setTitle(SafeHtml text) { if (text != null) { <START> setText(text.asString()); <END> } }</code><technical_language>be- setTitle(text.asString()) setText</technical_language>

Target:
public void setTitle(SafeHtml text) { setTitle(text == null ? (String)null : text.asString()); }
Source:
<code>private boolean issueHasNewComments(TurboIssue issue, boolean hasMetadata) { List<String> filterQualifierNames = currentFilterExpression.getQualifierNames(); <START> if ((filterQualifierNames.contains(Qualifier.UPDATED) || <END> filterQualifierNames.contains(Qualifier.UPDATED_OTHERS)) && hasMetadata) { return issueNonSelfCommentCounts.containsKey(issue.getId()) && Math.abs( issueNonSelfCommentCounts.get(issue.getId()) - issue.getMetadata().getNonSelfCommentCount() ) > 0; } else { return issueCommentCounts.containsKey(issue.getId()) && Math.abs(issueCommentCounts.get(issue.getId()) - issue.getCommentCount()) > 0; } }</code><technical_language>Do need check for update qualifier well? hasMetadata put boolean expression. presence of qualifiers checked a static Qualifier helper method</technical_language>

Target:
private boolean issueHasNewComments(TurboIssue issue, boolean hasMetadata) { if (hasMetadata && Qualifier.qualifierNamesHaveUpdatedQualifier(currentFilterExpression)) { return issueNonSelfCommentCounts.containsKey(issue.getId()) && Math.abs( issueNonSelfCommentCounts.get(issue.getId()) - issue.getMetadata().getNonSelfCommentCount() ) > 0; } else { return issueCommentCounts.containsKey(issue.getId()) && Math.abs(issueCommentCounts.get(issue.getId()) - issue.getCommentCount()) > 0; } }
Source:
<code>protected void copyFrom(ServiceState s) { mVoiceRegState = s.mVoiceRegState; mDataRegState = s.mDataRegState; mVoiceRoamingType = s.mVoiceRoamingType; mDataRoamingType = s.mDataRoamingType; mVoiceOperatorAlphaLong = s.mVoiceOperatorAlphaLong; mVoiceOperatorAlphaShort = s.mVoiceOperatorAlphaShort; mVoiceOperatorNumeric = s.mVoiceOperatorNumeric; mDataOperatorAlphaLong = s.mDataOperatorAlphaLong; mDataOperatorAlphaShort = s.mDataOperatorAlphaShort; mDataOperatorNumeric = s.mDataOperatorNumeric; mIsManualNetworkSelection = s.mIsManualNetworkSelection; mRilVoiceRadioTechnology = s.mRilVoiceRadioTechnology; mRilDataRadioTechnology = s.mRilDataRadioTechnology; mCssIndicator = s.mCssIndicator; mNetworkId = s.mNetworkId; mSystemId = s.mSystemId; mCdmaRoamingIndicator = s.mCdmaRoamingIndicator; mCdmaDefaultRoamingIndicator = s.mCdmaDefaultRoamingIndicator; mCdmaEriIconIndex = s.mCdmaEriIconIndex; mCdmaEriIconMode = s.mCdmaEriIconMode; mIsEmergencyOnly = s.mIsEmergencyOnly; mIsDataRoamingFromRegistration = s.mIsDataRoamingFromRegistration; mIsUsingCarrierAggregation = s.mIsUsingCarrierAggregation; mChannelNumber = s.mChannelNumber; mCellBandwidths = s.mCellBandwidths == null ? null : Arrays.copyOf(s.mCellBandwidths, s.mCellBandwidths.length); mLteEarfcnRsrpBoost = s.mLteEarfcnRsrpBoost; <START> mNetworkRegistrationStates = new ArrayList<>(s.mNetworkRegistrationStates); <END> }</code><technical_language>I failing this line now</technical_language>

Target:
protected void copyFrom(ServiceState s) { mVoiceRegState = s.mVoiceRegState; mDataRegState = s.mDataRegState; mVoiceRoamingType = s.mVoiceRoamingType; mDataRoamingType = s.mDataRoamingType; mVoiceOperatorAlphaLong = s.mVoiceOperatorAlphaLong; mVoiceOperatorAlphaShort = s.mVoiceOperatorAlphaShort; mVoiceOperatorNumeric = s.mVoiceOperatorNumeric; mDataOperatorAlphaLong = s.mDataOperatorAlphaLong; mDataOperatorAlphaShort = s.mDataOperatorAlphaShort; mDataOperatorNumeric = s.mDataOperatorNumeric; mIsManualNetworkSelection = s.mIsManualNetworkSelection; mRilVoiceRadioTechnology = s.mRilVoiceRadioTechnology; mRilDataRadioTechnology = s.mRilDataRadioTechnology; mCssIndicator = s.mCssIndicator; mNetworkId = s.mNetworkId; mSystemId = s.mSystemId; mCdmaRoamingIndicator = s.mCdmaRoamingIndicator; mCdmaDefaultRoamingIndicator = s.mCdmaDefaultRoamingIndicator; mCdmaEriIconIndex = s.mCdmaEriIconIndex; mCdmaEriIconMode = s.mCdmaEriIconMode; mIsEmergencyOnly = s.mIsEmergencyOnly; mIsDataRoamingFromRegistration = s.mIsDataRoamingFromRegistration; mIsUsingCarrierAggregation = s.mIsUsingCarrierAggregation; mChannelNumber = s.mChannelNumber; mCellBandwidths = s.mCellBandwidths == null ? null : Arrays.copyOf(s.mCellBandwidths, s.mCellBandwidths.length); mLteEarfcnRsrpBoost = s.mLteEarfcnRsrpBoost; mNetworkRegistrationStates = s.mNetworkRegistrationStates == null ? null : new ArrayList<>(s.mNetworkRegistrationStates); }
Source:
<code>public static void verifyCassandraIsSettled() throws IOException, InterruptedException { <START> StartupIndependenceUtils.restartAtlasWithChecks(); <END> StartupIndependenceUtils.assertSatisfiedWithin(240, StartupIndependenceUtils::canPerformTransaction); StartupIndependenceUtils.randomizeNamespace(); }</code><technical_language>longer need static references</technical_language>

Target:
public static void verifyCassandraIsSettled() throws IOException, InterruptedException { restartAtlasWithChecks(); assertSatisfiedWithin(240, StartupIndependenceUtils::canPerformTransaction); randomizeNamespace(); }
Source:
<code>void storeProjectName(IProject genProject, Package model, InstanceSpecification node) { final String projectGeneratedName = model.getName() + "_" + node.getName() + "_" + TransformationContext.current.deploymentPlan.getName(); if (genProject != null) { final String pName = genProject.getName(); <START> TransactionalEditingDomain domain = TransactionUtil <END> .getEditingDomain(TransformationContext.initialDeploymentPlan); if (domain != null) { domain.getCommandStack().execute(new RecordingCommand(domain) { @Override protected void doExecute() { Package deploymentPlanElement = TransformationContext.initialDeploymentPlan; DeploymentPlan deploymentPlan = UMLUtil.getStereotypeApplication(deploymentPlanElement, DeploymentPlan.class); EList<String> projectMappings = deploymentPlan.getProjectMappings(); String newMapping = ""; int oldMappingIndex = -1; for (int j = 0; j < projectMappings.size(); j++) { StringTokenizer str = new StringTokenizer(projectMappings.get(j), "="); String genName = str.nextToken(); if (genName.equals(projectGeneratedName)) { newMapping = projectGeneratedName + "=" + pName; oldMappingIndex = j; } } if (oldMappingIndex != -1) { projectMappings.remove(oldMappingIndex); projectMappings.add(newMapping); } } }); } } }</code><technical_language>is a class called CommandSupport in transformation.base.utils. Please this instead a homogenous of executing transactions: CommandSupport.exec(eObject, "<command label>", new Runnable() { @Override public void run() { ... } });</technical_language>

Target:
void storeProjectName(IProject genProject, Package model, InstanceSpecification node) { final String projectGeneratedName = model.getName() + "_" + node.getName() + "_" + TransformationContext.current.deploymentPlan.getName(); if (genProject != null) { final String pName = genProject.getName(); CommandSupport.exec(TransactionUtil.getEditingDomain(TransformationContext.initialDeploymentPlan), "Change Project Mapping", new Runnable() { @Override public void run() { Package deploymentPlanElement = TransformationContext.initialDeploymentPlan; DeploymentPlan deploymentPlan = UMLUtil.getStereotypeApplication(deploymentPlanElement, DeploymentPlan.class); EList<String> projectMappings = deploymentPlan.getProjectMappings(); String newMapping = ""; int oldMappingIndex = -1; for (int j = 0; j < projectMappings.size(); j++) { StringTokenizer str = new StringTokenizer(projectMappings.get(j), "="); String genName = str.nextToken(); if (genName.equals(projectGeneratedName)) { newMapping = projectGeneratedName + "=" + pName; oldMappingIndex = j; } } if (oldMappingIndex != -1) { projectMappings.remove(oldMappingIndex); projectMappings.add(newMapping); } } }); } }
Source:
<code>private boolean isBrowserActive(){ if (driver.getCurrentUrl().isEmpty() && driver != null){ logger.warn("Unable to read url from bview. Resetting."); return false; } else if (driver == null){ logger.warn("chromedriver process was killed !"); return false; <START> } <END> return true; }</code><technical_language>logic structured this: java if (driver == null) { // chromedriver process killed } // driver != null else if (driver.getCurrentUrl() == null /* extra null check */ || driver.getCurrentUrl().isEmpty()) { // unable read url browser } Also, is getCurrentUrl() throw WebDriverException? I looked docs mention of it, WebDriverException is unchecked, so..</technical_language>

Target:
private boolean isBrowserActive(){ if (driver == null){ logger.warn("chromedriver process was killed !"); return false; } try { String url = driver.getCurrentUrl(); if(url.isEmpty() || url == null){ return false; } } catch (WebDriverException e){ logger.warn("Unable to read url from bview. Resetting."); return false; } return true; }
Source:
<code>private void withExpandedLineWidget(LineWidget widget, final CommandWithArg<Boolean> onExpansionCompleted) { ChunkOutputWidget cow = lwToPlwMap_.get(widget); if (cow == null) <START> return; <END> cow.setExpansionState(ChunkOutputWidget.EXPANDED, onExpansionCompleted); }</code><technical_language>realize expect this happen, more fault tolerant onExpansionCompleted(false) caller wanted do done anyway</technical_language>

Target:
private void withExpandedLineWidget(LineWidget widget, final CommandWithArg<Boolean> onExpansionCompleted) { ChunkOutputWidget cow = lwToPlwMap_.get(widget); if (cow == null) { onExpansionCompleted.execute(false); return; } cow.setExpansionState(ChunkOutputWidget.EXPANDED, onExpansionCompleted); }
Source:
<code>private void readIntegers( int total, LongColumnVector c, int rowId) throws IOException { int left = total; while (left > 0) { <START> consume(); <END> readRepetitionAndDefinitionLevels(); if (definitionLevel >= maxDefLevel) { c.vector[rowId] = dataColumn.readInteger(); c.isNull[rowId] = false; c.isRepeating = c.isRepeating && (c.vector[0] == c.vector[rowId]); } else { c.isNull[rowId] = true; c.isRepeating = false; c.noNulls = false; } rowId++; left--; } }</code><technical_language>I need call consume() here. understanding, iteration in L143 reads left in current page, cross page boundary read next page. left is smaller of number of values left in current page, number of remaining values need read in current batch. Thought</technical_language>

Target:
private void readIntegers( int total, LongColumnVector c, int rowId) throws IOException { int left = total; while (left > 0) { readRepetitionAndDefinitionLevels(); if (definitionLevel >= maxDefLevel) { c.vector[rowId] = dataColumn.readInteger(); c.isNull[rowId] = false; c.isRepeating = c.isRepeating && (c.vector[0] == c.vector[rowId]); } else { c.isNull[rowId] = true; c.isRepeating = false; c.noNulls = false; } rowId++; left--; } }
Source:
<code>public void testServiceAsTagOption() { StatsDClient client = EasyMock.createMock(StatsDClient.class); StatsDEmitter emitter = new StatsDEmitter( new StatsDEmitterConfig("localhost", 8888, null, null, true, null, null, true, null, true), new ObjectMapper(), client ); client.time("druid.query.time", 10, <START> "druidService:druid/broker", "dataSource:data-source", "type:groupBy", "hostname:brokerHost1" <END> ); EasyMock.replay(client); emitter.emit(new ServiceMetricEvent.Builder() .setDimension("dataSource", "data-source") .setDimension("type", "groupBy") .build(DateTimes.nowUtc(), "query/time", 10) .build("druid/broker", "brokerHost1") ); EasyMock.verify(client); }</code><technical_language>Is test reserved tag keys used</technical_language>

Target:
public void testServiceAsTagOption() { StatsDClient client = EasyMock.createMock(StatsDClient.class); StatsDEmitter emitter = new StatsDEmitter( new StatsDEmitterConfig("localhost", 8888, null, null, true, null, null, true, null, true), new ObjectMapper(), client ); client.time("druid.query.time", 10, "druid_service:druid/broker", "dataSource:data-source", "type:groupBy", "hostname:brokerHost1" ); EasyMock.replay(client); emitter.emit(new ServiceMetricEvent.Builder() .setDimension("dataSource", "data-source") .setDimension("type", "groupBy") .build(DateTimes.nowUtc(), "query/time", 10) .build("druid/broker", "brokerHost1") ); EasyMock.verify(client); }
Source:
<code>private void handleLedgerEviction(RemovalNotification<Long, CachedFileInfo> notification) { CachedFileInfo fileInfo = notification.getValue(); Long ledgerId = notification.getKey(); if (null == fileInfo || null == notification.getKey()) { return; } if (notification.wasEvicted()) { evictedLedgersCounter.inc(); } <START> fileInfo.release(); <END> }</code><technical_language>handleEviction is synchronized getFileInfo race condition. Race Condition: 1. Thread A successfully get a FileInfo cache increment refCount line 221 "fi = readFileInfoCache.get(ledger, loader);" 2. Thread B is get another FileInfo for read cache is full, triggers eviction evict fileInfo is referenced Thread A. 3. Thread B continues evict FileInfo find out refCount=0, close FileInfo. 4. Thread A returns FileInfo is closed Thread B. 5. java.nio.channels.ClosedChannelException thrown serious issues</technical_language>

Target:
private void handleLedgerEviction(RemovalNotification<Long, CachedFileInfo> notification) { CachedFileInfo fileInfo = notification.getValue(); if (null == fileInfo || null == notification.getKey()) { return; } if (notification.wasEvicted()) { evictedLedgersCounter.inc(); } fileInfo.release(); }
Source:
<code><START> public List<Map<String, Long>> getInstanceInformation(final Integer datasetId, final Integer studyId) { <END> try { final StringBuilder sql = new StringBuilder("SELECT \n" + " g.description as environment,\n" + " COUNT(*) AS observations,\n" + " (SELECT \n" + " COUNT(*)\n" + " FROM\n" + " stock s\n" + " WHERE\n" + " s.project_id = :studyId ) AS entries,\n" + " geop.value AS repNumber\n" + "FROM\n" + " nd_experiment nd,\n" + " nd_geolocation g,\n" + " nd_geolocationprop geop\n" + "WHERE\n" + " g.nd_geolocation_id = nd.nd_geolocation_id\n" + " AND nd.project_id = :datasetId \n" + " AND nd.nd_geolocation_id = geop.nd_geolocation_id\n" + " AND geop.type_id = " + TermId.NUMBER_OF_REPLICATES.getId() +" \n" + "GROUP BY g.description"); final SQLQuery query = this.getSession().createSQLQuery(sql.toString()); query.addScalar("environment",new LongType()); query.addScalar("observations",new LongType()); query.addScalar("entries",new LongType()); query.addScalar("repNumber",new LongType()); query.setParameter("studyId", studyId); query.setParameter("datasetId", datasetId); query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE); final List<Map<String, Long>> results = query.list(); return results; } catch ( final HibernateException e) { final String message = "Error at getInstanceInformation query at ExperimentDao: " + e.getMessage(); ExperimentDao.LOG.error(message, e); throw new MiddlewareQueryException(message, e); } }</code><technical_language>a DTO (aliasToBean)</technical_language>

Target:
public List<InstanceDetailsDTO> getInstanceInformation(final Integer datasetId, final Integer studyId) { try { final StringBuilder sql = new StringBuilder( "SELECT\n" + " g.description AS environment,\n" + " COUNT(*) AS nOfObservations,\n" + " (SELECT COUNT(*)\n" + " FROM stock s\n" + " WHERE s.project_id = :studyId) AS nOfEntries,\n" + " COALESCE((SELECT geop.value\n" + " FROM nd_geolocationprop geop\n" + " WHERE nd.nd_geolocation_id = geop.nd_geolocation_id\n" + " AND geop.type_id = " + TermId.NUMBER_OF_REPLICATES.getId() +"),\n" + " 1) AS nOfReps\n" + "FROM\n" + " nd_experiment nd,\n" + " nd_geolocation g\n" + "WHERE\n" + " g.nd_geolocation_id = nd.nd_geolocation_id\n" + " AND nd.project_id = :datasetId \n" + "GROUP BY g.description;"); final SQLQuery query = this.getSession().createSQLQuery(sql.toString()); query.addScalar("environment",new LongType()); query.addScalar("nOfObservations",new LongType()); query.addScalar("nOfEntries",new LongType()); query.addScalar("nOfReps",new LongType()); query.setParameter("studyId", studyId); query.setParameter("datasetId", datasetId); query.setResultTransformer(Transformers.aliasToBean(InstanceDetailsDTO.class)); final List<InstanceDetailsDTO> results = query.list(); return results; } catch ( final HibernateException e) { final String message = "Error at getInstanceInformation query at ExperimentDao: " + e.getMessage(); ExperimentDao.LOG.error(message, e); throw new MiddlewareQueryException(message, e); } }
Source:
<code>public void init(final NotificationWidgetView.Presenter presenter, List<NotificationRow> rows) { this.rows = rows; presenter.addValueChangeHandler(event -> { dataProvider.getList().clear(); dataProvider.getList().addAll(event.getValue()); refreshTable(); }); this.presenter = presenter; this.dataProvider = new ListDataProvider<>(rows); modal.setTitle(presenter.getNameHeader()); modal.setWidth("1200px"); modal.setBody(this); table.setWidth("1220px"); closeButton.setName(StunnerFormsClientFieldsConstants.INSTANCE.Cancel()); saveButton.setName(StunnerFormsClientFieldsConstants.INSTANCE.Save()); addButton.setName(StunnerFormsClientFieldsConstants.INSTANCE.Add()); initTable(); <START> } <END></code><technical_language>Se try move this translations ClientTranslationService instead of GWT i18n system</technical_language>

Target:
public void init(final NotificationWidgetView.Presenter presenter, List<NotificationRow> rows) { this.rows = rows; presenter.addValueChangeHandler(event -> { dataProvider.getList().clear(); dataProvider.getList().addAll(event.getValue()); refreshTable(); }); this.presenter = presenter; this.dataProvider.setList(rows); modal.setTitle(presenter.getNameHeader()); modal.setWidth("1200px"); modal.setBody(this); modal.setClosable(false); table.setToolBarVisible(false); table.setWidth("1220px"); initTable(); }
Source:
<code>void executeRefresh(ZWaveNode node, ZWaveThermostatModeCommandClass commandClass, int endpointId, Map<String, String> arguments) { <START> logger.debug("NODE {}: Generating poll message for for node endpoint {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId); <END> SerialMessage serialMessage = node.encapsulate(commandClass.getValueMessage(), commandClass, endpointId); if (serialMessage == null) { logger.warn("NODE {}: Generating message failed for command class = {}, endpoint = {}", node.getNodeId(), commandClass.getCommandClass().getLabel(), endpointId); return; } this.getController().sendData(serialMessage); }</code><technical_language>node/command class parameters swapped, string 'for node {}' I guess removed</technical_language>

Target:
void executeRefresh(ZWaveNode node, ZWaveThermostatModeCommandClass commandClass, int endpointId, Map<String, String> arguments) { logger.debug("NODE {}: Generating poll message for endpoint {}", node.getNodeId(), commandClass.getCommandClass().getLabel(), endpointId); SerialMessage serialMessage = node.encapsulate(commandClass.getValueMessage(), commandClass, endpointId); if (serialMessage == null) { logger.warn("NODE {}: Generating message failed for command class = {}, endpoint = {}", node.getNodeId(), commandClass.getCommandClass().getLabel(), endpointId); return; } this.getController().sendData(serialMessage); }
Source:
<code>CustomRestClientImpl(HttpClient httpClient) { _httpClient = httpClient; <START> _semaphore = new Semaphore(10); <END> }</code><technical_language>magic number, please. define a DEFAULT_PARALLEL_COUNT = 10</technical_language>

Target:
CustomRestClientImpl(HttpClient httpClient) { _httpClient = httpClient; }
Source:
<code>private static int makeVillagerAgressive(ServerPlayerEntity asPlayer) { List<VillagerEntity> l = asPlayer.getEntityWorld().getEntitiesWithinAABB(VillagerEntity.class, asPlayer.getBoundingBox().grow(3, 2, 3)); for (VillagerEntity v : l) { <START> TotemTileEntity.makeAgressive(v); <END> } return 0; }</code><technical_language>if hunter vampire villager</technical_language>

Target:
private static int makeVillagerAgressive(ServerPlayerEntity asPlayer) { List<VillagerEntity> l = asPlayer.getEntityWorld().getEntitiesWithinAABB(VillagerEntity.class, asPlayer.getBoundingBox().grow(3, 2, 3)); for (VillagerEntity v : l) { if(v instanceof IFactionEntity)continue; TotemTileEntity.makeAgressive(v); } return 0; }
Source:
<code>@Test public void shouldProperlyPersistFolderPropertiesOnMultipleReloads() throws Exception { Folder folder = r.jenkins.createProject(Folder.class, "myFolder"); r.jenkins.setAuthorizationStrategy(new ProjectMatrixAuthorizationStrategy()); <START> folder.addProperty(new FolderCredentialsProvider.FolderCredentialsProperty(new DomainCredentials[0])); <END> folder.doReload(); Map<Permission,Set<String>> grantedPermissions = new HashMap<Permission, Set<String>>(); Set<String> sids = new HashSet<String>(); sids.add("admin"); grantedPermissions.put(Jenkins.ADMINISTER, sids); folder.addProperty(new com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty(grantedPermissions)); folder.doReload(); Folder reloadedFolder = r.jenkins.getItemByFullName("myFolder", Folder.class); assertThat("Folder has not been found after the reloading", reloadedFolder, notNullValue()); assertThat("Property has not been reloaded, hence it has not been saved properly", reloadedFolder.getProperties().get(com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty.class), notNullValue()); }</code><technical_language>is this part is important test part is doing? i.e. 2 properties 2 reloads - asserting property persisted</technical_language>

Target:
@Test public void shouldProperlyPersistFolderPropertiesOnMultipleReloads() throws Exception { Folder folder = r.jenkins.createProject(Folder.class, "myFolder"); folder.addProperty(new FolderCredentialsProvider.FolderCredentialsProperty(new DomainCredentials[0])); r.jenkins.reload(); Map<Permission,Set<String>> grantedPermissions = new HashMap<Permission, Set<String>>(); Set<String> sids = new HashSet<String>(); sids.add("admin"); grantedPermissions.put(Jenkins.ADMINISTER, sids); folder = r.jenkins.getItemByFullName("myFolder", Folder.class); r.jenkins.setAuthorizationStrategy(new ProjectMatrixAuthorizationStrategy()); folder.addProperty(new com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty(grantedPermissions)); r.jenkins.reload(); Folder reloadedFolder = r.jenkins.getItemByFullName("myFolder", Folder.class); assertThat("Folder has not been found after the reloading", reloadedFolder, notNullValue()); assertThat("Property has not been reloaded, hence it has not been saved properly", reloadedFolder.getProperties().get(com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty.class), notNullValue()); assertPropertyOwner("After reload", reloadedFolder, FolderCredentialsProvider.FolderCredentialsProperty.class); assertPropertyOwner("After reload", reloadedFolder, com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty.class); }
Source:
<code>private void copyStack(ActionInvocation invocation, CompoundRoot root) { List list = prepareList(root); Map<String, Object> ctxMap = invocation.getInvocationContext().getContextMap(); for (Object object : list) { if (shouldCopy(object)) { String actionConfigClassName = invocation.getProxy().getConfig().getClassName(); Object action = invocation.getAction(); if (action.getClass().getName().equals(actionConfigClassName)) reflectionProvider.copy(object, action, ctxMap, prepareExcludes(), includes, null); else { Class <?> editable; try { editable = Class.forName(actionConfigClassName); } catch (ClassNotFoundException e) { <START> LOG.warn("An unexpected state. This may be due to a bug. Please report this: ClassNotFoundException" + actionConfigClassName); <END> return; } reflectionProvider.copy(object, action, ctxMap, prepareExcludes(), includes, editable); } } } }</code><technical_language>logging exception well</technical_language>

Target:
private void copyStack(ActionInvocation invocation, CompoundRoot root) { List list = prepareList(root); Map<String, Object> ctxMap = invocation.getInvocationContext().getContextMap(); for (Object object : list) { if (shouldCopy(object)) { Object action = invocation.getAction(); Class <?> editable = null; if (null != editableClass && !action.getClass().getName().equals(editableClass)) { try { editable = Class.forName(editableClass); } catch (ClassNotFoundException e) { LOG.warn("Restrict property setting failed: " + editableClass + " class not found", e); } } reflectionProvider.copy(object, action, ctxMap, prepareExcludes(), includes, editable); } } }
Source:
<code>private static void scheduleUpdate(FileWithDocument fileWithDoc) { ISonarLintFile file = fileWithDoc.getFile(); <START> if (!file.getProject().isAutoEnabled() || !FileExclusionsUtils.shouldAnalyze(file.getProject(), file.getResource())) { <END> return; } AnalyzeProjectRequest request = new AnalyzeProjectRequest(file.getProject(), Arrays.asList(fileWithDoc), TriggerType.EDITOR_OPEN); new AnalyzeProjectJob(request).schedule(); }</code><technical_language>comfortable of file.getProject() file.getResource(). Especially path decide exclusion. ISonarLintFile::getProjectRelativePath() this is "logical" path</technical_language>

Target:
private static void scheduleUpdate(FileWithDocument fileWithDoc) { ISonarLintFile file = fileWithDoc.getFile(); FileExclusionsChecker exclusionsChecker = new FileExclusionsChecker(file.getProject()); if (!file.getProject().isAutoEnabled() || !exclusionsChecker.shouldAnalyze(file, true)) { return; } AnalyzeProjectRequest request = new AnalyzeProjectRequest(file.getProject(), Arrays.asList(fileWithDoc), TriggerType.EDITOR_OPEN); new AnalyzeProjectJob(request).schedule(); }
Source:
<code>private Map<Resource, Set<URI>> getTypePropertyImplyingType(final Resource queryType, final Map<Resource, Map<Resource, URI>> schemaMap) { final Map<Resource, Set<URI>> implications = new HashMap<>(); if (schemaMap != null) { final HashSet<Resource> queryTypes = new HashSet<>(); queryTypes.add(queryType); if (queryType instanceof URI) { queryTypes.addAll(getSubClasses((URI) queryType)); } for (final Resource querySubType : queryTypes) { if (schemaMap.containsKey(querySubType)) { final Map<Resource, URI> otherTypeToProperty = schemaMap.get(querySubType); for (final Resource otherType : otherTypeToProperty.keySet()) { if (!implications.containsKey(otherType)) { implications.put(otherType, new HashSet<>()); } final URI property = otherTypeToProperty.get(otherType); <START> implications.get(otherType).add(property); <END> implications.get(otherType).addAll(getSubProperties(property)); } } } } return implications; }</code><technical_language>Check property null adding</technical_language>

Target:
private Map<Resource, Set<URI>> getTypePropertyImplyingType(final Resource queryType, final Map<Resource, Map<Resource, URI>> schemaMap) { final Map<Resource, Set<URI>> implications = new HashMap<>(); if (schemaMap != null && queryType != null) { final HashSet<Resource> queryTypes = new HashSet<>(); queryTypes.add(queryType); if (queryType instanceof URI) { queryTypes.addAll(getSubClasses((URI) queryType)); } for (final Resource querySubType : queryTypes) { if (schemaMap.containsKey(querySubType)) { final Map<Resource, URI> otherTypeToProperty = schemaMap.get(querySubType); for (final Resource otherType : otherTypeToProperty.keySet()) { if (!implications.containsKey(otherType)) { implications.put(otherType, new HashSet<>()); } final URI property = otherTypeToProperty.get(otherType); if (property != null) { implications.get(otherType).add(property); implications.get(otherType).addAll(getSubProperties(property)); } } } } } return implications; }
Source:
<code>public void sphere(Player player, LocalSession session, EditSession editSession, Pattern pattern, String radiusString, @Optional("false") boolean raised, @Switch('h') boolean hollow, @Switch('s') boolean hemi, @Switch('i') boolean upsideDown, @Switch('p') boolean precisionMode) throws WorldEditException { String[] radii = radiusString.split(","); final double radiusX, radiusY, radiusZ; switch (radii.length) { case 1: radiusX = radiusY = radiusZ = Math.max(1, Double.parseDouble(radii[0])); break; case 3: radiusX = Math.max(1, Double.parseDouble(radii[0])); radiusY = Math.max(1, Double.parseDouble(radii[1])); radiusZ = Math.max(1, Double.parseDouble(radii[2])); break; default: player.printError("You must either specify 1 or 3 radius values."); return; } worldEdit.checkMaxRadius(radiusX); worldEdit.checkMaxRadius(radiusY); worldEdit.checkMaxRadius(radiusZ); Vector pos = session.getPlacementPosition(player); if (raised && !hemi) { pos = pos.add(0, radiusY, 0); } Vector directionVector = null; <START> if (hemi && precisionMode) { <END> directionVector = player.getLocation().getDirection(); } int affected = editSession.makeSphere(pos, Patterns.wrap(pattern), radiusX, radiusY, radiusZ, !hollow, hemi, upsideDown, directionVector); player.findFreePosition(); player.print(affected + " block(s) have been created."); }</code><technical_language>precision flag hemisphere flag error? do @TomyLobo @wizjany</technical_language>

Target:
public void sphere(Player player, LocalSession session, EditSession editSession, Pattern pattern, String radiusString, @Optional("false") boolean raised, @Switch('h') boolean hollow, @Switch('s') boolean hemi, @Switch('i') boolean upsideDown, @Switch('p') boolean precisionMode) throws WorldEditException { boolean error = false; if (!hemi) { if (precisionMode) { player.printError("-p flag doesn't have an effect when it's not a hemisphere."); error = true; } if (upsideDown) { player.printError("-i flag doesn't have an effect when it's not a hemisphere."); error = true; } } if (error) { return; } String[] radii = radiusString.split(","); final double radiusX, radiusY, radiusZ; switch (radii.length) { case 1: radiusX = radiusY = radiusZ = Math.max(1, Double.parseDouble(radii[0])); break; case 3: radiusX = Math.max(1, Double.parseDouble(radii[0])); radiusY = Math.max(1, Double.parseDouble(radii[1])); radiusZ = Math.max(1, Double.parseDouble(radii[2])); break; default: player.printError("You must either specify 1 or 3 radius values."); return; } worldEdit.checkMaxRadius(radiusX); worldEdit.checkMaxRadius(radiusY); worldEdit.checkMaxRadius(radiusZ); Vector pos = session.getPlacementPosition(player); if (raised && !hemi) { pos = pos.add(0, radiusY, 0); } Vector directionVector = null; if (hemi && precisionMode) { directionVector = player.getLocation().getDirection(); } int affected = editSession.makeSphere(pos, Patterns.wrap(pattern), radiusX, radiusY, radiusZ, !hollow, hemi, upsideDown, directionVector); player.findFreePosition(); player.print(affected + " block(s) have been created."); }
Source:
<code>private void deleteStylesheetsCacheDirectory() { Path cacheStylesheetsDirectory = preferencesService.getCacheStylesheetsDirectory(); if (Files.exists(cacheStylesheetsDirectory)) { try { deleteRecursively(cacheStylesheetsDirectory); } catch (IOException e) { <START> logger.warn("Missing permission to delete style sheets cache directory ''{}''", cacheStylesheetsDirectory); <END> } } }</code><technical_language>Double single quotes needed</technical_language>

Target:
private void deleteStylesheetsCacheDirectory() { Path cacheStylesheetsDirectory = preferencesService.getCacheStylesheetsDirectory(); if (Files.exists(cacheStylesheetsDirectory)) { try { deleteRecursively(cacheStylesheetsDirectory); } catch (IOException e) { logger.warn("Missing permission to delete style sheets cache directory '{}'", cacheStylesheetsDirectory); } } }
Source:
<code>public String getRootLevel() { <START> return getLevel(""); <END> }</code><technical_language>Add a constant for this</technical_language>

Target:
public String getRootLevel() { return logging.getRootLevel().toString(); }
Source:
<code>private String buildJobsAllSqlQuery() { <START> StringBuilder sb = new StringBuilder("SELECT A.TRIGGER_NAME, A.TRIGGER_GROUP, B.JOB_DATA FROM "); <END> sb = sb.append(getCorrectNameRepresentation(sqlProperties.get(TABLE_PREFIX).toString() + TRIGGERS)); sb = sb.append(" AS A JOIN QRTZ_JOB_DETAILS AS B ON A.TRIGGER_NAME = B.JOB_NAME AND A.TRIGGER_GROUP = B.JOB_GROUP"); return sb.toString(); }</code><technical_language>bad stringbuilder (I similarly others). Concat method string creates new string instead of concating existing one, append string builder is appending new string existing one</technical_language>

Target:
private String buildJobsAllSqlQuery() { StringBuilder sb = new StringBuilder("SELECT A. TRIGGER_NAME, A.TRIGGER_GROUP, B.JOB_DATA FROM ") .append(getCorrectNameRepresentation(sqlProperties.get(TABLE_PREFIX).toString() + TRIGGERS)) .append(" AS A JOIN QRTZ_JOB_DETAILS AS B ON A.TRIGGER_NAME = B.JOB_NAME AND A.TRIGGER_GROUP = B.JOB_GROUP"); return sb.toString(); }
Source:
<code>protected void executeCommand() { <START> Map<String, <END> Object> raidParams = new HashMap<String, Object>(); if (!getParameters().getRaidType().equals(RaidType.None) && !getParameters().getRaidType().equals(RaidType.Raid0)) { raidParams.put("type", getParameters().getRaidType().getValue()); raidParams.put("pdCount", getParameters().getNoOfPhysicalDisksInRaidVolume()); raidParams.put("stripSize", getParameters().getStripeSize()); } VDSReturnValue returnValue = runVdsCommand( VDSCommandType.CreateBrick, new CreateBrickVDSParameters(getVdsId(), getParameters().getLvName(), getParameters().getMountPoint(), raidParams, "xfs", getParameters().getDisks())); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { StorageDevice storageDevice = (StorageDevice) returnValue.getReturnValue(); saveStoageDevice(storageDevice); resetIsFreeFlag(getParameters().getDisks()); } else { handleVdsError(returnValue); } }</code><technical_language>new HashMap<> do</technical_language>

Target:
protected void executeCommand() { Map<String, Object> raidParams = new HashMap<>(); if (!getParameters().getRaidType().equals(RaidType.None) && !getParameters().getRaidType().equals(RaidType.Raid0)) { raidParams.put("type", getParameters().getRaidType().getValue()); raidParams.put("pdCount", getParameters().getNoOfPhysicalDisksInRaidVolume()); raidParams.put("stripSize", getParameters().getStripeSize()); } VDSReturnValue returnValue = runVdsCommand( VDSCommandType.CreateBrick, new CreateBrickVDSParameters(getVdsId(), getParameters().getLvName(), getParameters().getMountPoint(), raidParams, GlusterConstants.FS_TYPE_XFS, getParameters().getDisks())); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { StorageDevice storageDevice = (StorageDevice) returnValue.getReturnValue(); saveStoageDevice(storageDevice); resetIsFreeFlag(getParameters().getDisks()); } else { handleVdsError(returnValue); } }
Source:
<code>public void formatValue(String fieldName, Pair<String, String> pair, boolean caseSensitive) { if (APPS.equals(fieldName)) { pair.setSecond( StringFormat.format(BaseConditionFieldAutoCompleter.getI18NPrefix() + "'%%%1$s%%'", StringHelper.trim(pair.getSecond(), '\'').replace("N'", ""))); if ("=".equals(pair.getFirst())) { pair.setFirst(BaseConditionFieldAutoCompleter.getLikeSyntax(caseSensitive)); } else if ("!=".equals(pair.getFirst())) { pair.setFirst("NOT " + BaseConditionFieldAutoCompleter.getLikeSyntax(caseSensitive)); } } else if (UPTIME.equals(fieldName)) { <START> int milisecond = 1000; <END> pair.setSecond(StringHelper.trim(pair.getSecond(), '\'')); TimeSpan ts = TimeSpan.parse(pair.getSecond()); pair.setSecond(StringFormat.format("'%1$s'", ts.TotalMilliseconds < milisecond ? 0 : ts.TotalMilliseconds / milisecond)); } else if (CREATIONDATE.equals(fieldName)) { Date tmp = new Date(Date.parse(StringHelper.trim(pair.getSecond(), '\''))); pair.setSecond(StringFormat.format("'%1$s'", tmp)); } else { super.formatValue(fieldName, pair, caseSensitive); } }</code><technical_language>declare this class constant</technical_language>

Target:
public void formatValue(String fieldName, Pair<String, String> pair, boolean caseSensitive) { if (APPS.equals(fieldName)) { pair.setSecond( StringFormat.format(BaseConditionFieldAutoCompleter.getI18NPrefix() + "'%%%1$s%%'", StringHelper.trim(pair.getSecond(), '\'').replace("N'", ""))); if ("=".equals(pair.getFirst())) { pair.setFirst(BaseConditionFieldAutoCompleter.getLikeSyntax(caseSensitive)); } else if ("!=".equals(pair.getFirst())) { pair.setFirst("NOT " + BaseConditionFieldAutoCompleter.getLikeSyntax(caseSensitive)); } } else if (UPTIME.equals(fieldName)) { pair.setSecond(StringHelper.trim(pair.getSecond(), '\'')); TimeSpan ts = TimeSpan.parse(pair.getSecond()); pair.setSecond(StringFormat.format("'%1$s'", ts.TotalMilliseconds < MILISECOND ? 0 : ts.TotalMilliseconds / MILISECOND)); } else if (CREATIONDATE.equals(fieldName)) { Date tmp = new Date(Date.parse(StringHelper.trim(pair.getSecond(), '\''))); pair.setSecond(StringFormat.format("'%1$s'", tmp)); } else { super.formatValue(fieldName, pair, caseSensitive); } }
Source:
<code>ElasticsearchTableDescriptionProvider(ElasticsearchConnectorConfig config, JsonCodec<ElasticsearchTableDescription> codec) { requireNonNull(config, "config is null"); requireNonNull(codec, "codec is null"); <START> checkArgument(config.getScrollTimeout().toMillis() >= 10, "scrollTimeout must be at least 10 ms"); <END> checkArgument(config.getRequestTimeout().toMillis() >= 10, "requestTimeout must be at least 10 ms"); tableDefinitions = createTableDescriptions(config, codec); }</code><technical_language>remove checkArguments critical checks & forget remove MinDuration fixed</technical_language>

Target:
ElasticsearchTableDescriptionProvider(ElasticsearchConnectorConfig config, JsonCodec<ElasticsearchTableDescription> codec) { requireNonNull(config, "config is null"); requireNonNull(codec, "codec is null"); tableDefinitions = createTableDescriptions(config, codec); }
Source:
<code>public void testAssistForUnknownButConnectedType() throws CoreException, InvocationTargetException, IOException, InterruptedException { List<CompletionItem> items = new ArrayList<>(); items.add(createCompletionItem("FirstClass", CompletionItemKind.Class)); MockLanguageServer.INSTANCE.setCompletionList(new CompletionList(false, items)); IFile testFile = TestUtils.createUniqueTestFileOfUnknownType(project, ""); ITextViewer viewer = TestUtils.openTextViewer(testFile); LanguageServerDefinition serverDefinition = LanguageServersRegistry.getInstance().getDefinition("org.eclipse.lsp4e.test.server"); assertNotNull(serverDefinition); IPath fileLocation = testFile.getLocation(); <START> LanguageServerWrapper lsWrapperForConnection = LanguageServiceAccessor <END> .getLSWrapperForConnection(testFile.getProject(), serverDefinition, fileLocation); lsWrapperForConnection.connect(testFile, null); new DisplayHelper() { @Override protected boolean condition() { return lsWrapperForConnection.isConnectedTo(fileLocation); } }.waitForCondition(Display.getCurrent(), 3000); Assert.assertTrue(lsWrapperForConnection.isConnectedTo(fileLocation)); ICompletionProposal[] proposals = contentAssistProcessor.computeCompletionProposals(viewer, 0); assertEquals(items.size(), proposals.length); LSCompletionProposal lsCompletionProposal = (LSCompletionProposal)proposals[0]; lsCompletionProposal.apply(viewer, '\n', 0, 0); assertEquals(new Point("FirstClass".length(), 0), lsCompletionProposal.getSelection(viewer.getDocument())); }</code><technical_language>This change necessary</technical_language>

Target:
public void testAssistForUnknownButConnectedType() throws CoreException, InvocationTargetException, IOException, InterruptedException { List<CompletionItem> items = new ArrayList<>(); items.add(createCompletionItem("FirstClass", CompletionItemKind.Class)); MockLanguageServer.INSTANCE.setCompletionList(new CompletionList(false, items)); IFile testFile = TestUtils.createUniqueTestFileOfUnknownType(project, ""); ITextViewer viewer = TestUtils.openTextViewer(testFile); LanguageServerDefinition serverDefinition = LanguageServersRegistry.getInstance().getDefinition("org.eclipse.lsp4e.test.server"); assertNotNull(serverDefinition); IPath fileLocation = testFile.getLocation(); LanguageServerWrapper lsWrapperForConnection = LanguageServiceAccessor .getLSWrapperForConnection(testFile.getProject(), serverDefinition); lsWrapperForConnection.connect(testFile, null); new DisplayHelper() { @Override protected boolean condition() { return lsWrapperForConnection.isConnectedTo(fileLocation); } }.waitForCondition(Display.getCurrent(), 3000); Assert.assertTrue(lsWrapperForConnection.isConnectedTo(fileLocation)); ICompletionProposal[] proposals = contentAssistProcessor.computeCompletionProposals(viewer, 0); assertEquals(items.size(), proposals.length); LSCompletionProposal lsCompletionProposal = (LSCompletionProposal)proposals[0]; lsCompletionProposal.apply(viewer, '\n', 0, 0); assertEquals(new Point("FirstClass".length(), 0), lsCompletionProposal.getSelection(viewer.getDocument())); }
Source:
<code>public void delete(Path path) throws IOException { AzurePath aPath = validatePathInstanceType(path); validateNotRoot(path, "Delete"); BlobClient blobClient = aPath.toBlobClient(); DirectoryStatus dirStatus = checkDirStatus(blobClient); if (dirStatus.equals(DirectoryStatus.DOES_NOT_EXIST)) { throw Utility.logError(logger, new NoSuchFileException(path.toString())); } if (dirStatus.equals(DirectoryStatus.NOT_EMPTY)) { throw Utility.logError(logger, new DirectoryNotEmptyException(path.toString())); } try { blobClient.delete(); } catch (BlobStorageException e) { <START> throw Utility.logError(logger, new IOException(e)); <END> } }</code><technical_language>Do want log throw exception if exception is blob exist? good either, a theoretical question delete exist means</technical_language>

Target:
public void delete(Path path) throws IOException { AzurePath aPath = validatePathInstanceType(path); validateNotRoot(path, "Delete"); BlobClient blobClient = aPath.toBlobClient(); DirectoryStatus dirStatus = checkDirStatus(blobClient); if (dirStatus.equals(DirectoryStatus.DOES_NOT_EXIST)) { throw Utility.logError(logger, new NoSuchFileException(path.toString())); } if (dirStatus.equals(DirectoryStatus.NOT_EMPTY)) { throw Utility.logError(logger, new DirectoryNotEmptyException(path.toString())); } try { blobClient.delete(); } catch (BlobStorageException e) { if (e.getErrorCode().equals(BlobErrorCode.BLOB_NOT_FOUND)) { throw Utility.logError(logger, new NoSuchFileException(path.toString())); } throw Utility.logError(logger, new IOException(e)); } }