auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void close() throws IOException { if (mCachedDataReader.deRef() == 0) { try (LockResource lockResource = new LockResource( <START> BLOCK_LOCKS[(int) (mBlockId % BLOCK_LOCKS.length)].writeLock())) { <END> if (mCachedDataReader.getRefCount() == 0) { BLOCK_READERS.remove(mBlockId); } } if (mCachedDataReader.getRefCount() == 0) { mCachedDataReader.close(); } } }</code><technical_language>a static util method return lock in lock array based block Id. e.g., private static ReentrantReadWriteLock getBlockLock(long blockId) { return BLOCK_LOCKS[(int) (blockId % BLOCK_LOCKS.length)] } in close create, util method hardcode logic twice. In case change logic in future, need place</technical_language>

Target:
public void close() throws IOException { if (mCachedDataReader.deRef() > 0) { return; } try (LockResource lockResource = new LockResource( getBlockLock(mBlockId).writeLock())) { if (mCachedDataReader.getRefCount() == 0) { BLOCK_READERS.remove(mBlockId); } } if (mCachedDataReader.getRefCount() == 0) { mCachedDataReader.close(); } }
Source:
<code>private void startInvocation(IConfiguration config, IInvocationContext context, ITestInvocationListener listener) { <START> if (mInvocationStarted) { <END> return; } logStartInvocation(context, config); listener.invocationStarted(context); mInvocationStarted = true; }</code><technical_language>Is this avoid method called more once? If is expected behavior, raise exception</technical_language>

Target:
private void startInvocation(IConfiguration config, IInvocationContext context, ITestInvocationListener listener) { logStartInvocation(context, config); listener.invocationStarted(context); }
Source:
<code>public BlockPos getNearestStructurePos(World worldIn, String structureName, BlockPos position, boolean findUnexplored) { for (MapGenStructure struct : structures) { <START> if (struct.getStructureName().equals(structureName)) <END> { return struct.getNearestStructurePos(worldIn, position, findUnexplored); } } return null; }</code><technical_language>I suggest a name structure map speed lookup</technical_language>

Target:
public BlockPos getNearestStructurePos(World worldIn, String structureName, BlockPos position, boolean findUnexplored) { MapGenStructure structure = structureMap.get(structureName); if (structure != null) { return structure.getNearestStructurePos(worldIn, position, findUnexplored); } return null; }
Source:
<code>public GitHubSCMSource(String repoOwner, String repository, String repositoryUrl, boolean configuredByUrl) { this(); <START> if (!configuredByUrl) { <END> this.setRepoOwner(repoOwner); this.setRepository(repository); } else { this.setRepositoryUrl(repositoryUrl); } }</code><technical_language>I suggest avoid negation is else block</technical_language>

Target:
public GitHubSCMSource(String repoOwner, String repository, String repositoryUrl, boolean configuredByUrl) { this(); if (configuredByUrl) { setRepositoryUrl(repositoryUrl); } else { setRepoOwner(repoOwner); setRepository(repository); } }
Source:
<code>public synchronized void start() { if (enabled) return; FileWriter writer = fileWriter; if (writer != null) { try { writer.shutdown().get(); } catch (IgniteCheckedException e) { throw new IgniteException("Failed to wait for previous writer stopping.", e); } } <START> assert fileWriter == null; <END> try { File file = statisticsFile(ctx); U.delete(file); FileIO fileIo = fileIoFactory.create(file); fileIo.position(0); fileWriter = new FileWriter(ctx, fileIo, DFLT_FILE_MAX_SIZE, DFLT_BUFFER_SIZE, DFLT_FLUSH_SIZE, log); new IgniteThread(fileWriter).start(); enabled = true; log.info("Performance statistics writer started [file=" + file.getAbsolutePath() + ']'); } catch (IOException | IgniteCheckedException e) { log.error("Failed to start performance statistics writer.", e); throw new IgniteException("Failed to start performance statistics writer.", e); } }</code><technical_language>essence of this assert is clear for me. you, please, clarify it</technical_language>

Target:
public synchronized void start() { assert !started; new IgniteThread(fileWriter).start(); started = true; }
Source:
<code>public void testClose() throws InterruptedException, TimeoutException, ExecutionException, NetworkException, InjectionException { <START> prepare(0); <END> ParameterWorkerTestUtil.close(parameterWorker, mockSender, workerHandler); }</code><technical_language>define 0 a constant (e.g., RETRY_TIMEOUT_MS)</technical_language>

Target:
public void testClose() throws InterruptedException, TimeoutException, ExecutionException, NetworkException, InjectionException { prepare(TIMEOUT_NO_RETRY); ParameterWorkerTestUtil.close(parameterWorker, mockSender, workerHandler); }
Source:
<code>public void escapedEmphasis() { String html = parseToHtml("\\_foo bar_"); <START> assertEquals(html,"<p>_foo bar_</p>\n"); <END> }</code><technical_language>expected parameter, actual second, e.g. assertEquals("<p>_foo bar_</p>\n",html)</technical_language>

Target:
public void escapedEmphasis() { String html = parseToHtml("\\_foo bar_"); assertEquals("<p>_foo bar_</p>\n", html); }
Source:
<code>protected Message<?> createOutputMessage(Object output, MessageHeaders requestHeaders) { AbstractIntegrationMessageBuilder<?> builder = null; if (output instanceof Message<?>) { if (!shouldCopyRequestHeaders()) { return (Message<?>) output; } builder = this.getMessageBuilderFactory().fromMessage((Message<?>) output); } else if (output instanceof AbstractIntegrationMessageBuilder) { builder = (AbstractIntegrationMessageBuilder<?>) output; } else { builder = this.getMessageBuilderFactory().withPayload(output); } <START> if (shouldCopyRequestHeaders()) { <END> if (this.selectiveHeaderPropagation) { String[] patterns = this.notPropagatedHeaders.toArray(new String[this.notPropagatedHeaders.size()]); Map<String, Object> headersToCopy = new HashMap<>(requestHeaders); headersToCopy.entrySet() .removeIf(entry -> PatternMatchUtils.simpleMatch(patterns, entry.getKey())); builder.copyHeadersIfAbsent(headersToCopy); } else { builder.copyHeadersIfAbsent(requestHeaders); } } return builder.build(); }</code><technical_language>If (shouldCopyRequestHeaders() && !this.copyNoHeaders) {..</technical_language>

Target:
protected Message<?> createOutputMessage(Object output, MessageHeaders requestHeaders) { AbstractIntegrationMessageBuilder<?> builder = null; if (output instanceof Message<?>) { if (this.noHeadersPropagation || !shouldCopyRequestHeaders()) { return (Message<?>) output; } builder = this.getMessageBuilderFactory().fromMessage((Message<?>) output); } else if (output instanceof AbstractIntegrationMessageBuilder) { builder = (AbstractIntegrationMessageBuilder<?>) output; } else { builder = this.getMessageBuilderFactory().withPayload(output); } if (!this.noHeadersPropagation && shouldCopyRequestHeaders()) { if (this.selectiveHeaderPropagation) { Map<String, Object> headersToCopy = new HashMap<>(requestHeaders); headersToCopy.entrySet() .removeIf(entry -> PatternMatchUtils.simpleMatch(this.notPropagatedHeaders, entry.getKey())); builder.copyHeadersIfAbsent(headersToCopy); } else { builder.copyHeadersIfAbsent(requestHeaders); } } return builder.build(); }
Source:
<code>public synchronized void sendSceneComandsToDSS(InternalScene scene, boolean call_undo) { if (lastSceneCall + 1000 > System.currentTimeMillis()) { sleepTime = System.currentTimeMillis() - lastSceneCall; try { Thread.sleep(sleepTime); } catch (InterruptedException e) { logger.error("An exception occurred", e); } } if (this.connMan.checkConnection()) { lastSceneCall = System.currentTimeMillis(); boolean requestSucsessfull = false; if (scene.getZoneID() == 0) { if (call_undo) { requestSucsessfull = this.digitalSTROMClient.callApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID()), false); } else { requestSucsessfull = this.digitalSTROMClient.undoApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID())); } } else { if (call_undo) { requestSucsessfull = this.digitalSTROMClient.callZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID()), false); } else { requestSucsessfull = this.digitalSTROMClient.undoZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID())); } } <START> logger.debug("scenecall sucsess?: " + requestSucsessfull); <END> if (requestSucsessfull) { this.sceneMan.addEcho(scene.getID()); if (call_undo) { scene.activateScene(); } else { scene.deactivateScene(); } } } }</code><technical_language>typo: success</technical_language>

Target:
public synchronized void sendSceneComandsToDSS(InternalScene scene, boolean call_undo) { if (scene != null) { if (lastSceneCall + 1000 > System.currentTimeMillis()) { sleepTime = System.currentTimeMillis() - lastSceneCall; try { Thread.sleep(sleepTime); } catch (InterruptedException e) { logger.error("An exception occurred", e); } } if (this.connMan.checkConnection()) { lastSceneCall = System.currentTimeMillis(); boolean requestSuccsessfull = false; if (scene.getZoneID() == 0) { if (call_undo) { logger.debug(scene.getGroupID() + " " + scene.getSceneID() + " " + ApartmentSceneEnum.getApartmentScene(scene.getSceneID())); requestSuccsessfull = this.digitalSTROMClient.callApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID()), false); } else { requestSuccsessfull = this.digitalSTROMClient.undoApartmentScene(connMan.getSessionToken(), scene.getGroupID(), null, ApartmentSceneEnum.getApartmentScene(scene.getSceneID())); } } else { if (call_undo) { requestSuccsessfull = this.digitalSTROMClient.callZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID()), false); } else { requestSuccsessfull = this.digitalSTROMClient.undoZoneScene(connMan.getSessionToken(), scene.getZoneID(), null, scene.getGroupID(), null, SceneEnum.getScene(scene.getSceneID())); } } logger.debug("Was the scene call succsessful?: " + requestSuccsessfull); if (requestSuccsessfull) { this.sceneMan.addEcho(scene.getID()); if (call_undo) { scene.activateScene(); } else { scene.deactivateScene(); } } } } }
Source:
<code>private void submit(@Nullable String email) { if (!NetworkUtil.isConnected(getContext())) { showError(getString(R.string.network_not_connected_short)); } else if (!InputValidationUtil.isValidEmail(email)) { showError(getString(R.string.error_invalid_email)); } else { setUiForInteraction(false); <START> loadingIndicator.setVisibility(View.VISIBLE); <END> resetCall = loginService.resetPassword(email); resetCall.enqueue(new ErrorHandlingCallback<ResetPasswordResponse>( getContext(), CallTrigger.USER_ACTION) { @Override protected void onResponse(@NonNull final ResetPasswordResponse result) { setUiForInteraction(true); final OnActivityResultListener listener = OnActivityResultListener.Util.getListener(getContext()); if (listener != null) { if (result.isSuccess()) { listener.onActivityResult(0, RESULT_OK, null); dismiss(); } else { final String errorMsg = result.getPrimaryReason(); final Intent data = new Intent(); data.putExtra("error", errorMsg); listener.onActivityResult(0, RESULT_FAILURE, data); showError(errorMsg); } } } @Override protected void onFailure(@NonNull Throwable error) { setUiForInteraction(true); final OnActivityResultListener listener = OnActivityResultListener.Util.getListener(getContext()); if (listener != null) { final String errorMsg = ErrorUtils.getErrorMessage(error, getContext()); final Intent data = new Intent(); data.putExtra("error", errorMsg); listener.onActivityResult(0, RESULT_FAILURE, data); showError(errorMsg); } } }); } }</code><technical_language>This is done setUiForInteraction(false)</technical_language>

Target:
private void submit(@Nullable String email) { if (!NetworkUtil.isConnected(getContext())) { showError(getString(R.string.network_not_connected_short)); } else if (!InputValidationUtil.isValidEmail(email)) { showError(getString(R.string.error_invalid_email)); } else { setUiForInteraction(false); binding.emailInputLayout.setError(null); resetCall = loginService.resetPassword(email); resetCall.enqueue(new ErrorHandlingCallback<ResetPasswordResponse>( getContext(), CallTrigger.USER_ACTION) { @Override protected void onResponse(@NonNull final ResetPasswordResponse result) { setUiForInteraction(true); if (result.isSuccess()) { OnActivityResultListener.Util.deliverResult( ResetPasswordDialogFragment.this, REQUEST_CODE, RESULT_OK, null); dismiss(); } else { final String errorMsg = result.getPrimaryReason(); showError(errorMsg); } } @Override protected void onFailure(@NonNull Throwable error) { setUiForInteraction(true); final String errorMsg = ErrorUtils.getErrorMessage(error, getContext()); showError(errorMsg); } }); } }
Source:
<code>public static void scheduleTokenUpload(Context context) { FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context.getApplicationContext())); Job job = dispatcher.newJobBuilder() .setRecurring(false) .setReplaceCurrent(true) .setRetryStrategy(RetryStrategy.DEFAULT_EXPONENTIAL) .setConstraints( Constraint.ON_ANY_NETWORK ) .setService(ParseFirebaseJobService.class) <START> .setTag("upload-token") END> .build(); dispatcher.mustSchedule(job); }</code><technical_language>set a constant</technical_language>

Target:
public static void scheduleTokenUpload(Context context) { FirebaseJobDispatcher dispatcher = new FirebaseJobDispatcher(new GooglePlayDriver(context.getApplicationContext())); Job job = dispatcher.newJobBuilder() .setRecurring(false) .setReplaceCurrent(true) .setRetryStrategy(RetryStrategy.DEFAULT_EXPONENTIAL) .setConstraints( Constraint.ON_ANY_NETWORK ) .setService(ParseFirebaseJobService.class) .setTag(JOB_TAG_UPLOAD_TOKEN) .build(); dispatcher.mustSchedule(job); }
Source:
<code>public BooleanWritable evaluate(Text uriHost, Text uriPath, Text uriQuery, Text httpStatus, Text contentType, Text userAgent) { boolean isPageview = Webrequest.isPageview(uriHost.toString(), uriPath.toString(), uriQuery.toString(), httpStatus.toString(), contentType.toString(), userAgent.toString()); <START> return new BooleanWritable(isPageview); <END> }</code><technical_language>If returning a new writable for evaluation anyways, defer wrapping Hive simple adjusting return type, return isPageview right away? ... if toString-ing ... String in paramaters Hive do work. (Not if works, for int IntWritable worked time I tried)</technical_language>

Target:
public BooleanWritable evaluate(Text uriHost, Text uriPath, Text uriQuery, Text httpStatus, Text contentType, Text userAgent) { boolean isPageview = NewPageviewsDef.isPageview(uriHost.toString(), uriPath.toString(), uriQuery.toString(), httpStatus.toString(), contentType.toString(), userAgent.toString()); return new BooleanWritable(isPageview); }
Source:
<code>public void handleFragmentResponseMessage(FragmentResponseMessage message) { DuplicateCounter counter = m_duplicateCounters.get(new DuplicateCounterKey(message.getTxnId(), message.getSpHandle())); if (counter != null) { int result = counter.offer(message); if (result == DuplicateCounter.DONE) { m_duplicateCounters.remove(new DuplicateCounterKey(message.getTxnId(), message.getSpHandle())); m_repairLogTruncationHandle = message.getSpHandle(); FragmentResponseMessage resp = (FragmentResponseMessage)counter.getLastResponse(); resp.setExecutorSiteId(m_mailbox.getHSId()); m_mailbox.send(counter.m_destinationId, resp); if (m_defaultConsistencyReadLevel == ReadLevel.SAFE) { assert(m_bufferedReadLog != null); m_bufferedReadLog.releaseBufferedRead(m_repairLogTruncationHandle); } } else if (result == DuplicateCounter.MISMATCH) { VoltDB.crashGlobalVoltDB("HASH MISMATCH running multi-part procedure.", true, null); } return; } TransactionState txn = m_outstandingTxns.get(message.getTxnId()); if (txn != null) { if (txn.isReadOnly()) { assert(m_isLeader); assert(m_bufferedReadLog != null); if (m_defaultConsistencyReadLevel == ReadLevel.SAFE) { m_bufferedReadLog.offerSp(message, m_repairLogTruncationHandle); return; } } else { if (m_isLeader && message.getSpHandle() > m_repairLogTruncationHandle) { <START> m_repairLogTruncationHandle = message.getSpHandle(); <END> } } } m_mailbox.send(message.getDestinationSiteId(), message); }</code><technical_language>truncation handle is updated above, I ignore here</technical_language>

Target:
public void handleFragmentResponseMessage(FragmentResponseMessage message) { DuplicateCounter counter = m_duplicateCounters.get(new DuplicateCounterKey(message.getTxnId(), message.getSpHandle())); final TransactionState txn = m_outstandingTxns.get(message.getTxnId()); if (counter != null) { int result = counter.offer(message); if (result == DuplicateCounter.DONE) { if (txn != null && txn.isDone()) { setRepairLogTruncationHandle(txn.m_spHandle); } m_duplicateCounters.remove(new DuplicateCounterKey(message.getTxnId(), message.getSpHandle())); FragmentResponseMessage resp = (FragmentResponseMessage)counter.getLastResponse(); resp.setExecutorSiteId(m_mailbox.getHSId()); m_mailbox.send(counter.m_destinationId, resp); } else if (result == DuplicateCounter.MISMATCH) { VoltDB.crashGlobalVoltDB("HASH MISMATCH running multi-part procedure.", true, null); } return; } else { if (txn == null) { if (m_defaultConsistencyReadLevel == ReadLevel.SAFE) { m_bufferedReadLog.offer(m_mailbox, message, m_repairLogTruncationHandle); return; } } else { if (txn.isReadOnly()) { if (m_defaultConsistencyReadLevel == ReadLevel.SAFE) { m_bufferedReadLog.offer(m_mailbox, message, m_repairLogTruncationHandle); return; } } else if (txn.isDone()) { setRepairLogTruncationHandle(txn.m_spHandle); } } } m_mailbox.send(message.getDestinationSiteId(), message); }
Source:
<code>public void widgetSelected(@Nullable SelectionEvent e) { int selectedCell = getColumnIndex(); ISegment selectedSegment = ((ISegment) NonNullUtils.checkNotNull(e).item.getData()); if (selectedSegment == null) { return; } ITmfTimestamp start = new TmfNanoTimestamp(selectedSegment.getStart()); ITmfTimestamp end = new TmfNanoTimestamp(selectedSegment.getEnd()); TmfSelectionRangeUpdatedSignal signal; switch (selectedCell) { <START> case 0: <END> signal = new TmfSelectionRangeUpdatedSignal(this, start); break; case 1: signal = new TmfSelectionRangeUpdatedSignal(this, end, end); break; case 2: signal = new TmfSelectionRangeUpdatedSignal(this, start, end); break; default: return; } TmfSignalManager.dispatchSignal(signal); }</code><technical_language>static definitions for these, "magic numbers": private static final int START_TIME_COL_POS = 0; etc</technical_language>

Target:
public void widgetSelected(@Nullable SelectionEvent e) { int selectedCell = getColumnIndex(); ISegment selectedSegment = ((ISegment) NonNullUtils.checkNotNull(e).item.getData()); if (selectedSegment == null) { return; } ITmfTimestamp start = new TmfNanoTimestamp(selectedSegment.getStart()); ITmfTimestamp end = new TmfNanoTimestamp(selectedSegment.getEnd()); TmfSelectionRangeUpdatedSignal signal; switch (selectedCell) { case START_TIME_COL_POS: signal = new TmfSelectionRangeUpdatedSignal(this, start); break; case END_TIME_COL_POS: signal = new TmfSelectionRangeUpdatedSignal(this, end, end); break; case DURATION_COL_POS: signal = new TmfSelectionRangeUpdatedSignal(this, start, end); break; default: return; } TmfSignalManager.dispatchSignal(signal); }
Source:
<code>public RealmAsyncTask makeOffer(PermissionOffer offer, final Callback<String> callback) { checkIfValidThread(); checkCallbackNotNull(callback); if (offer.isOfferCreated()) { <START> throw new IllegalStateException("Offer is already created: " + offer); <END> } return addTask(new MakeOfferAsyncTask(this, offer, callback)); }</code><technical_language>"Offer already..." "Offer been..."</technical_language>

Target:
public RealmAsyncTask makeOffer(PermissionOffer offer, final Callback<String> callback) { checkIfValidThread(); checkCallbackNotNull(callback); if (offer.isOfferCreated()) { throw new IllegalStateException("Offer has already been created: " + offer); } return addTask(new MakeOfferAsyncTask(this, offer, callback)); }
Source:
<code>private String computeDigest() { StringBuilder buf = new StringBuilder("rule [" + getRule() + "] rels ["); for (int i = 0; i < rels.length; i++) { if (i > 0) { buf.append(", "); } buf.append("rel#").append(rels[i].getId()) <START> .append(':').append(rels[i].getDigest()); <END> } buf.append("]"); return buf.toString(); }</code><technical_language>abstract this description a tool method reuse ? RelOptUtil#generatesDescription(StringBuilder builder, int relNodeID, String digest)</technical_language>

Target:
private String computeDigest() { StringBuilder buf = new StringBuilder("rule [" + getRule() + "] rels ["); for (int i = 0; i < rels.length; i++) { if (i > 0) { buf.append(", "); } RelOptUtil.appendRelDescription(buf, rels[i]); } buf.append("]"); return buf.toString(); }
Source:
<code>public void testGetStorages() throws Exception { String url = getContextBaseUrl() + BrowseController.ROOT_CONTEXT; String storages = given().contentType(MediaType.APPLICATION_JSON_VALUE) .when() .get(url) .prettyPeek() .asString(); DirectoryContent returned = new ObjectMapper() .readValue(storages, DirectoryContent.class); assertNotNull("Failed to get storage list!", returned); assertNotNull("Failed to get storage list!", returned.getDirectories()); assertFalse("Returned storage size does not match", returned.getDirectories().isEmpty()); for(int i=0; i<returned.getDirectories().size(); i++) <START> logger.debug(returned.getDirectories().get(i).getName()); <END> }</code><technical_language>Please, braces in cycles conditions</technical_language>

Target:
public void testGetStorages() throws Exception { String url = getContextBaseUrl() + BrowseController.ROOT_CONTEXT; String storages = given().accept(MediaType.APPLICATION_JSON_VALUE) .when() .get(url) .prettyPeek() .asString(); DirectoryContent returned = new ObjectMapper() .readValue(storages, DirectoryContent.class); assertNotNull("Failed to get storage list!", returned); assertNotNull("Failed to get storage list!", returned.getDirectories()); assertFalse("Returned storage size does not match", returned.getDirectories().isEmpty()); String responseBody = given().accept(MediaType.TEXT_HTML_VALUE) .when() .get(url + "/") .prettyPeek() .then() .statusCode(200) .and() .extract() .asString(); assertTrue("Returned HTML is incorrect", responseBody.contains("storage0")); }
Source:
<code>public Result link(String target) throws IOException { if (!target.startsWith(Constants.R_REFS)) throw new IllegalArgumentException(MessageFormat.format(JGitText.get().illegalArgumentNotA, Constants.R_REFS)); if (checkConflicting && getRefDatabase().isNameConflicting(getName())) return Result.LOCK_FAILURE; try { if (!tryLock(false)) return Result.LOCK_FAILURE; final Ref old = <START> getRefDatabase().findRef(getName()); <END> if (old != null && old.isSymbolic()) { final Ref dst = old.getTarget(); if (target.equals(dst.getName())) return result = Result.NO_CHANGE; } if (old != null && old.getObjectId() != null) setOldObjectId(old.getObjectId()); final Ref dst = getRefDatabase().findRef(target); if (dst != null && dst.getObjectId() != null) setNewObjectId(dst.getObjectId()); return result = doLink(target); } catch (IOException x) { result = Result.IO_FAILURE; throw x; } finally { unlock(); } }</code><technical_language>I this exactRef</technical_language>

Target:
public Result link(String target) throws IOException { if (!target.startsWith(Constants.R_REFS)) throw new IllegalArgumentException(MessageFormat.format(JGitText.get().illegalArgumentNotA, Constants.R_REFS)); if (checkConflicting && getRefDatabase().isNameConflicting(getName())) return Result.LOCK_FAILURE; try { if (!tryLock(false)) return Result.LOCK_FAILURE; final Ref old = getRefDatabase().exactRef(getName()); if (old != null && old.isSymbolic()) { final Ref dst = old.getTarget(); if (target.equals(dst.getName())) return result = Result.NO_CHANGE; } if (old != null && old.getObjectId() != null) setOldObjectId(old.getObjectId()); final Ref dst = getRefDatabase().exactRef(target); if (dst != null && dst.getObjectId() != null) setNewObjectId(dst.getObjectId()); return result = doLink(target); } catch (IOException x) { result = Result.IO_FAILURE; throw x; } finally { unlock(); } }
Source:
<code>private DatastreamProducerRecord translate(ConsumerRecord<byte[], byte[]> fromKafka, long readTime, String strReadTime) { DatastreamEvent event = new DatastreamEvent(); event.key = ByteBuffer.wrap(fromKafka.key()); event.payload = ByteBuffer.wrap(fromKafka.value()); event.previous_payload = null; event.metadata = new HashMap<>(); event.metadata.put("kafka-origin", _srcValue); String partitionStr = String.valueOf(fromKafka.partition()); event.metadata.put("kafka-origin-partition", partitionStr); String offsetStr = String.valueOf(fromKafka.offset()); event.metadata.put("kafka-origin-offset", offsetStr); event.metadata.put(DatastreamEventMetadata.EVENT_TIMESTAMP, strReadTime); DatastreamProducerRecordBuilder builder = new DatastreamProducerRecordBuilder(); builder.addEvent(event); builder.setEventsSourceTimestamp(readTime); if (!_task.isUserManagedDestination()) { <START> builder.setPartition(0); <END> } builder.setSourceCheckpoint(partitionStr + "-" + offsetStr); return builder.build(); }</code><technical_language>is partition 0</technical_language>

Target:
private DatastreamProducerRecord translate(ConsumerRecord<byte[], byte[]> fromKafka, long readTime, String strReadTime) { DatastreamEvent event = new DatastreamEvent(); event.key = ByteBuffer.wrap(fromKafka.key()); event.payload = ByteBuffer.wrap(fromKafka.value()); event.previous_payload = null; event.metadata = new HashMap<>(); event.metadata.put("kafka-origin", _srcValue); int partition = fromKafka.partition(); String partitionStr = String.valueOf(partition); event.metadata.put("kafka-origin-partition", partitionStr); String offsetStr = String.valueOf(fromKafka.offset()); event.metadata.put("kafka-origin-offset", offsetStr); event.metadata.put(DatastreamEventMetadata.EVENT_TIMESTAMP, strReadTime); DatastreamProducerRecordBuilder builder = new DatastreamProducerRecordBuilder(); builder.addEvent(event); builder.setEventsSourceTimestamp(readTime); builder.setPartition(partition); builder.setSourceCheckpoint(partitionStr + "-" + offsetStr); return builder.build(); }
Source:
<code>public boolean upgradeCasIfRequired(Iterable<CAS> aCasIter, Project aProject) throws UIMAException, IOException { TypeSystemDescription ts = getFullProjectTypeSystem(aProject); boolean upgradePerformed = false; for (CAS cas : aCasIter) { if (cas != null && isUpgradeRequired(cas, ts)) { <START> CasStorageSession.get().assertWritingPermitted(cas); <END> upgradeCas(cas, ts); upgradePerformed = true; } } return upgradePerformed; }</code><technical_language>I check if writing is permitted if detect update is necessary. if upgrade is necessary system is in principle allowed perform write operation. moving this assert condition necessary fix issue</technical_language>

Target:
public boolean upgradeCasIfRequired(Iterable<CAS> aCasIter, Project aProject) throws UIMAException, IOException { TypeSystemDescription ts = getFullProjectTypeSystem(aProject); boolean upgradePerformed = false; nextCas: for (CAS cas : aCasIter) { if (cas == null) { continue nextCas; } CasStorageSession.get().assertWritingPermitted(cas); if (isUpgradeRequired(cas, ts)) { upgradeCas(cas, ts); upgradePerformed = true; } } return upgradePerformed; }
Source:
<code>public void plannerSolverFactoryTest() throws IOException { InputStream stream = this.getClass().getResourceAsStream(CLOUD_BALANCE_INCREMENTAL_CONFIG_FILE); SolverFactory solverFactory = SolverFactory .createFromXmlInputStream(stream, PlannerCloudBalanceIntegrationTest.class.getClassLoader()); stream.close(); <START> CloudBalance cloudBalance = cloudBalanceGeneratorForFuse(10, 20, 0); <END> Assert.assertEquals(cloudBalance.getScore().getHardScore(), Integer.MIN_VALUE); Assert.assertEquals(cloudBalance.getScore().getSoftScore(), Integer.MIN_VALUE); Solver solver = solverFactory.getSolverConfig().buildSolver(new SolverConfigContext()); solver.solve(cloudBalance); CloudBalance solution = (CloudBalance) solver.getBestSolution(); Assert.assertNotEquals(solution.getScore().getHardScore(), Integer.MIN_VALUE); Assert.assertNotEquals(solution.getScore().getSoftScore(), Integer.MIN_VALUE); }</code><technical_language>This previous test refactored a private method a location of config file classpath a parameter</technical_language>

Target:
public void plannerSolverFactoryTest() throws IOException { solveUsingSolverFactory(CLOUD_BALANCE_INCREMENTAL_CONFIG_FILE); }
Source:
<code>private void downloadFile(URI uri, Path dst) { urlMangling.put(goGoDuckConfig.getUrlSubstitutionKey(), goGoDuckConfig.getUrlSubstitutionValue()); URLMangler.setUrlManglingMap(urlMangling); <START> URL url = URLMangler.mangle(uri); <END> logger.info(String.format("Downloading '%s' -> '%s'", url.toString(), dst)); try { ReadableByteChannel rbc = Channels.newChannel(url.openStream()); FileOutputStream fos = new FileOutputStream(dst.toFile()); fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); } catch (IOException e) { userLog.log(String.format("Failed downloading '%s'", url)); throw new GoGoDuckException(e.getMessage()); } }</code><technical_language>this instantiated urlmap setting static maps</technical_language>

Target:
private void downloadFile(URI uri, Path dst) { URL url = urlMangler.mangle(uri); logger.info(String.format("Downloading '%s' -> '%s'", url.toString(), dst)); try { ReadableByteChannel rbc = Channels.newChannel(url.openStream()); FileOutputStream fos = new FileOutputStream(dst.toFile()); fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); } catch (IOException e) { userLog.log(String.format("Failed downloading '%s'", url)); throw new GoGoDuckException(e.getMessage()); } }
Source:
<code>protected boolean canDoAction() { GlusterVolumeEntity glusterVolume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!glusterVolume.isOnline()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); return false; } if (glusterVolume.getAsyncTask() == null <START> || glusterVolume.getAsyncTask().getStatus() != JobExecutionStatus.STARTED) { <END> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED); return false; } return true; }</code><technical_language>GlusterTaskType validated well</technical_language>

Target:
protected boolean canDoAction() { GlusterVolumeEntity glusterVolume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!glusterVolume.isOnline()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED); return false; } if (glusterVolume.getAsyncTask() == null || glusterVolume.getAsyncTask().getType() != GlusterTaskType.REBALANCE_VOLUME || glusterVolume.getAsyncTask().getStatus() != JobExecutionStatus.STARTED) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REBALANCE_NOT_STARTED); return false; } return true; }
Source:
<code><START> private void filterMilestones(String query) { <END> currentMilestonesList.stream() .forEach(milestone -> { boolean matchQuery = Utility.containsIgnoreCase(milestone.getTitle(), query); milestone.setFaded(!matchQuery); }); if (hasExactlyOneMatchingMilestone(currentMilestonesList, query)) highlightAnyMatchingMilestone(); }</code><technical_language>parameter is query is milestoneQuery in toggleMilestone method</technical_language>

Target:
private void filterMilestones(String query) { currentMilestonesList .forEach(milestone -> { boolean matchQuery = Utility.containsIgnoreCase(milestone.getTitle(), query); if (!milestone.isMatching()) milestone.setMatching(!matchQuery); }); }
Source:
<code>public boolean getIsUsable( final ItemStack stack, Entity holder ) { if( stack.hasTagCompound() ) { final NBTTagCompound tag = Platform.openNbtData( stack ); if( tag != null ) { boolean usable = ( this.hasPower( null, 0.5, stack ) && ToolWirelessTerminal.isLinked( stack ) ); if( usable ) { final long parsedKey = Long.parseLong( this.getEncryptionKey( stack ) ); final ILocatable securityStation = AEApi.instance().registries().locatable().getLocatableBy( parsedKey ); <START> if( securityStation == null ) <END> { usable = false; } } if( usable ) { usable = ((ToolWirelessTerminal)stack.getItem()).rangeCheck( stack, holder ); } return usable; } } return false; }</code><technical_language>![MAJOR](<LINK_1> Refactor this code nest more 3 if/for/while/switch/try statements. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public boolean getIsUsable( final ItemStack stack, Entity holder ) { if( stack.hasTagCompound() ) { final NBTTagCompound tag = Platform.openNbtData( stack ); if( tag != null ) { boolean usable = this.hasPower( null, 0.5, stack ) && ToolWirelessTerminal.isLinked( stack ); if( usable ) { final long parsedKey = Long.parseLong( this.getEncryptionKey( stack ) ); final ILocatable securityStation = AEApi.instance().registries().locatable().getLocatableBy( parsedKey ); if( securityStation == null ) { usable = false; } } if( usable ) { usable = rangeCheck( stack, holder ); } return usable; } } return false; }
Source:
<code>public Set<String> filterDistributorEntitlementIds(Iterable<String> entsIdsToFilter) { Set<String> filteredIds = new HashSet<String>(); if (entsIdsToFilter != null && entsIdsToFilter.iterator().hasNext()) { String querySql = "SELECT DISTINCT e.id " + "FROM Entitlement e JOIN e.consumer c JOIN c.type t " + "WHERE t.manifest = true AND e.id IN (:entitlement_ids)"; Query query = this.getEntityManager().createQuery(querySql); <START> int blockSize = Math.min(this.getInBlockSize(), this.getQueryParameterLimit() / 2); <END> for (List<String> block : Iterables.partition(entsIdsToFilter, blockSize)) { query.setParameter("entitlement_ids", block); filteredIds.addAll(query.getResultList()); } } return filteredIds; }</code><technical_language>need divide block size 2 for case. done in previous query in-blocks, needed block more total number of parameters for entire query</technical_language>

Target:
public Set<String> filterDistributorEntitlementIds(Iterable<String> entsIdsToFilter) { Set<String> filteredIds = new HashSet<String>(); if (entsIdsToFilter != null && entsIdsToFilter.iterator().hasNext()) { String querySql = "SELECT DISTINCT e.id " + "FROM Entitlement e JOIN e.consumer c JOIN c.type t " + "WHERE t.manifest = true AND e.id IN (:entitlement_ids)"; Query query = this.getEntityManager().createQuery(querySql); int blockSize = Math.min(this.getInBlockSize(), this.getQueryParameterLimit()); for (List<String> block : Iterables.partition(entsIdsToFilter, blockSize)) { query.setParameter("entitlement_ids", block); filteredIds.addAll(query.getResultList()); } } return filteredIds; }
Source:
<code>private CSIIndex(final IndexFileBuffer indexFileBuffer, final String source, final SAMSequenceDictionary dictionary) { super(indexFileBuffer, dictionary); <START> verifyCSIMagicNumber(source); <END> readMinShiftAndBinDepth(); readAuxDataAndNRef(); setSequenceIndexes(getNumberOfReferences()); }</code><technical_language>I this a protected method AbstractBamFileIndex implement for bai for CSI. abstract pull out a common AbstractBaiFileIndex is shared in common 2 bai implementations. clean constructor chain in AbstractBamFileIndex constructor call validate magic number</technical_language>

Target:
private CSIIndex(final IndexFileBuffer indexFileBuffer, final String source, final SAMSequenceDictionary dictionary) { super(indexFileBuffer, source, dictionary); }
Source:
<code>public void validate(T values) { for (int i = 0; i < expressions.size(); i++) { expressions.get(i).setNextRow(values); } for (int i = 0; i < inputs.size(); i++) { Object val = inputs.get(i).value(); if (val == null) { throw new IllegalArgumentException("\"" + notNullColumns.get(i) + "\" must not be null"); } } for (Map.Entry<String, Tuple<Input<?>, String>> checkEntry : checkConstraints.entrySet()) { <END> Input<?> checkInput = checkEntry.getValue().v1(); Boolean value = (Boolean) checkInput.value(); <START> if (null == value) { continue; } if (!value.booleanValue()) { String checkName = checkEntry.getKey(); String checkExpr = checkEntry.getValue().v2(); Object offendingValues = values instanceof Doc ? ((Doc) values).getSource() : values; throw new IllegalArgumentException(String.format( Locale.ENGLISH, "Failed CONSTRAINT %s CHECK (%s) and values %s", checkName, checkExpr, offendingValues)); } } }</code><technical_language>Is a valid behavior</technical_language>

Target:
public void validate(T values) { for (int i = 0; i < expressions.size(); i++) { expressions.get(i).setNextRow(values); } for (int i = 0; i < inputs.size(); i++) { Object val = inputs.get(i).value(); if (val == null) { throw new IllegalArgumentException("\"" + notNullColumns.get(i) + "\" must not be null"); } } for (int i = 0; i < checkConstraints.size(); i++) { Tuple<? extends Input<?>, CheckConstraint<Symbol>> checkEntry = checkConstraints.get(i); Input<?> checkInput = checkEntry.v1(); Boolean value = (Boolean) checkInput.value(); if (value == null) { continue; } if (!value.booleanValue()) { CheckConstraint<Symbol> chk = checkEntry.v2(); throw new IllegalArgumentException(String.format( Locale.ENGLISH, "Failed CONSTRAINT %s CHECK (%s) and values %s", chk.name(), chk.expressionStr(), values)); } } }
Source:
<code><START> private void removeUnnecessaryHooks() { <END> ResourceSetHookRegistry resourceSetHookRegistry = EMFCompareIDEPlugin.getDefault() .getResourceSetHookRegistry(); Collection<IResourceSetHook> resourceSetHooks = resourceSetHookRegistry.getResourceSetHooks(); for (IResourceSetHook resourceSetHook : resourceSetHooks) { if ((resourceSetHook.getClass().getName()).equals(SaveParameterHook.class.getName())) { continue; } else { resourceSetHookRegistry.remove(resourceSetHook.getClass().getName()); } } }</code><technical_language>This dangerous impact other test cases introduce behaviors depending order of execution of tests. save hooks a registered reinstall in @After method</technical_language>

Target:
private void removeUnnecessaryHooks() { ResourceSetHookRegistry resourceSetHookRegistry = EMFCompareIDEPlugin.getDefault() .getResourceSetHookRegistry(); Collection<IResourceSetHook> resourceSetHooks = resourceSetHookRegistry.getResourceSetHooks(); for (IResourceSetHook resourceSetHook : resourceSetHooks) { String resourceSetHookId = resourceSetHook.getClass().getName(); if (!resourceSetHookId.equals(SaveParameterHook.class.getName())) { ResourceSetHookDescriptor descriptor = resourceSetHookRegistry.remove(resourceSetHookId); if (descriptor != null) { removedResourceSetHooks.put(resourceSetHookId, descriptor); } } } }
Source:
<code>protected String[] getAttributes() { String[] attributes = RuleAttributeWidget.getAttributesList(); <START> attributes[attributes.length] = GuidedDecisionTable52.NEGATE_RULE_ATTR; <END> return attributes; }</code><technical_language>this wrong? attributes[attributes.length-1] (and overwrite entry in array, is equally wrong) extend array. code a List append additional attribute end (Decision Tables support a "negate rule" attributed, Guided Rules do not)</technical_language>

Target:
protected String[] getAttributes() { String[] attributes = RuleAttributeWidget.getAttributesList(); attributes = Arrays.copyOf( attributes, attributes.length + 1 ); attributes[attributes.length - 1] = GuidedDecisionTable52.NEGATE_RULE_ATTR; return attributes; }
Source:
<code>public List<ApplicationDeploymentDescription> getApplicationDeployements(Map<String, String> filters) throws AppCatalogException { <START> if(filters.containsKey(DBConstants.ApplicationDeployment.APPLICATION_MODULE_ID)) { <END> Map<String, Object> queryParameters = new HashMap<>(); queryParameters.put(DBConstants.ApplicationDeployment.APPLICATION_MODULE_ID, filters.get(DBConstants.ApplicationDeployment.APPLICATION_MODULE_ID)); List<ApplicationDeploymentDescription> applicationDeploymentDescriptionList = select(QueryConstants.FIND_APPLICATION_DEPLOYMENTS_FOR_APPLICATION_MODULE_ID, -1, 0, queryParameters); return applicationDeploymentDescriptionList; } else if(filters.containsKey(DBConstants.ApplicationDeployment.COMPUTE_HOST_ID)) { Map<String, Object> queryParameters = new HashMap<>(); queryParameters.put(DBConstants.ApplicationDeployment.COMPUTE_HOST_ID, filters.get(DBConstants.ApplicationDeployment.COMPUTE_HOST_ID)); List<ApplicationDeploymentDescription> applicationDeploymentDescriptionList = select(QueryConstants.FIND_APPLICATION_DEPLOYMENTS_FOR_COMPUTE_HOST_ID, -1, 0, queryParameters); return applicationDeploymentDescriptionList; } else { logger.error("Unsupported field name for app deployment.", new IllegalArgumentException()); throw new IllegalArgumentException("Unsupported field name for app deployment."); } }</code><technical_language>Add debug logs in block add a newline end of block improve readability</technical_language>

Target:
public List<ApplicationDeploymentDescription> getApplicationDeployements(Map<String, String> filters) throws AppCatalogException { if(filters.containsKey(DBConstants.ApplicationDeployment.APPLICATION_MODULE_ID)) { logger.debug("Fetching all Application Deployments for given Application Module ID"); Map<String, Object> queryParameters = new HashMap<>(); queryParameters.put(DBConstants.ApplicationDeployment.APPLICATION_MODULE_ID, filters.get(DBConstants.ApplicationDeployment.APPLICATION_MODULE_ID)); List<ApplicationDeploymentDescription> applicationDeploymentDescriptionList = select(QueryConstants.FIND_APPLICATION_DEPLOYMENTS_FOR_APPLICATION_MODULE_ID, -1, 0, queryParameters); return applicationDeploymentDescriptionList; } else if(filters.containsKey(DBConstants.ApplicationDeployment.COMPUTE_HOST_ID)) { logger.debug("Fetching Application Deployments for given Compute Host ID"); Map<String, Object> queryParameters = new HashMap<>(); queryParameters.put(DBConstants.ApplicationDeployment.COMPUTE_HOST_ID, filters.get(DBConstants.ApplicationDeployment.COMPUTE_HOST_ID)); List<ApplicationDeploymentDescription> applicationDeploymentDescriptionList = select(QueryConstants.FIND_APPLICATION_DEPLOYMENTS_FOR_COMPUTE_HOST_ID, -1, 0, queryParameters); return applicationDeploymentDescriptionList; } else { logger.error("Unsupported field name for app deployment."); throw new IllegalArgumentException("Unsupported field name for app deployment."); } }
Source:
<code>private HttpURLConnection setupConnection() throws IOException { Logger.v(TAG, "HttpWebRequest setupConnection thread:" + android.os.Process.myTid()); if (mUrl == null) { throw new IllegalArgumentException("requestURL"); } if (!mUrl.getProtocol().equalsIgnoreCase("http") && !mUrl.getProtocol().equalsIgnoreCase("https")) { throw new IllegalArgumentException("requestURL"); } HttpURLConnection.setFollowRedirects(true); <START> final HttpURLConnection connection = HttpUrlConnectionFactory.createHttpUrlConnection(mUrl); <END> connection.setConnectTimeout(CONNECT_TIME_OUT); if (Build.VERSION.SDK_INT > 13) { connection.setRequestProperty("Connection", "close"); } final Iterator<String> headerKeys = mRequestHeaders.keySet().iterator(); while (headerKeys.hasNext()) { String header = headerKeys.next(); Logger.v(TAG, "Setting header: " + header); connection.setRequestProperty(header, mRequestHeaders.get(header)); } System.setProperty("http.keepAlive", "false"); connection.setReadTimeout(READ_TIME_OUT); connection.setInstanceFollowRedirects(mInstanceRedirectsFollow); connection.setUseCaches(mUseCaches); connection.setRequestMethod(mRequestMethod); connection.setDoInput(true); setRequestBody(connection, mRequestContent, mRequestContentType); return connection; }</code><technical_language>need this factory, mockito mock Url.openConnection method</technical_language>

Target:
private HttpURLConnection setupConnection() throws IOException { Logger.v(TAG, "HttpWebRequest setupConnection thread:" + android.os.Process.myTid()); if (mUrl == null) { throw new IllegalArgumentException("requestURL"); } if (!mUrl.getProtocol().equalsIgnoreCase("http") && !mUrl.getProtocol().equalsIgnoreCase("https")) { throw new IllegalArgumentException("requestURL"); } HttpURLConnection.setFollowRedirects(true); final HttpURLConnection connection = HttpUrlConnectionFactory.createHttpUrlConnection(mUrl); connection.setConnectTimeout(CONNECT_TIME_OUT); if (Build.VERSION.SDK_INT > 13) { connection.setRequestProperty("Connection", "close"); } final Iterator<String> headerKeys = mRequestHeaders.keySet().iterator(); while (headerKeys.hasNext()) { String header = headerKeys.next(); Logger.v(TAG, "Setting header: " + header); connection.setRequestProperty(header, mRequestHeaders.get(header)); } connection.setReadTimeout(READ_TIME_OUT); connection.setInstanceFollowRedirects(mInstanceRedirectsFollow); connection.setUseCaches(mUseCaches); connection.setRequestMethod(mRequestMethod); connection.setDoInput(true); setRequestBody(connection, mRequestContent, mRequestContentType); return connection; }
Source:
<code>public AssociationRows(AssociationKey associationKey, Collection<?> wrapped, AssociationRowFactory associationRowFactory) { <START> this.rows = new LinkedHashMap<>( wrapped.size() ); <END> for ( Object object : wrapped ) { AssociationRow<?> row = associationRowFactory.createAssociationRow( associationKey, object ); rows.put( row.getKey(), row ); } }</code><technical_language>Please add a new newLinkedHashMap method CollectionHelper. work pushing changes in HV sizing. (With current code, undersize map)</technical_language>

Target:
public AssociationRows(AssociationKey associationKey, Collection<?> wrapped, AssociationRowFactory associationRowFactory) { this.rows = CollectionHelper.newHashMap( wrapped.size() ); for ( Object object : wrapped ) { AssociationRow<?> row = associationRowFactory.createAssociationRow( associationKey, object ); rows.put( row.getKey(), row ); } }
Source:
<code>private List<DiskImage> createSnapshotsForDiskImage(Guid diskId) { <START> List<DiskImage> result = new ArrayList<>(); for (int i = 0; i < NUM_OF_SNAPSHOTS_TO_CREATE; i++) { result.add(createDiskSnapshot(diskId)); } return result; <END> }</code><technical_language>a oneliner? return IntStream.range(0, NUM_OF_SNAPSHOTS_TO_CREATE).map(i -> createDiskSnapshot(diskId)).collect(Collectors.toList());</technical_language>

Target:
private List<DiskImage> createSnapshotsForDiskImage(Guid diskId) { return IntStream.range(0, NUM_OF_SNAPSHOTS_TO_CREATE).mapToObj(i -> createDiskImage(diskId)).collect( Collectors.toList()); }
Source:
<code><START> ParameterMap getQueryParams(MuleEvent event) <END> { return resolveParams(event, HttpParamType.QUERY_PARAM); }</code><technical_language>This breaks compatibility</technical_language>

Target:
public ParameterMap getQueryParams(MuleEvent event) { return resolveParams(event, HttpParamType.QUERY_PARAM); }
Source:
<code>@Override public void run() { while (hiveStatement.hasMoreLogs()) { try { if (progressBarUpdateCompleted) { updateQueryLog(); } else { TProgressUpdateResp progressResponse = hiveStatement.getProgressResponse(); <START> commands.debug("progress response sent: " + (progressResponse == null ? "null" : <END> progressResponse.toString())); if (progressResponse == null || TJobExecutionStatus.NOT_AVAILABLE .equals(progressResponse.getStatus())) { progressBarUpdateCompleted = true; } else { inPlaceUpdate.render(new ProgressMonitorWrapper(progressResponse)); if (receivedAllProgressUpdates(progressResponse.getStatus())) { progressBarUpdateCompleted = true; } } } Thread.sleep(queryProgressInterval); } catch (SQLException e) { commands.error(new SQLWarning(e)); } catch (InterruptedException e) { commands.debug("Getting log thread is interrupted, since query is done!"); commands.showRemainingProgress(hiveStatement, inPlaceUpdate); } } }</code><technical_language>message "progress response received" ? this: + (progressResponse == null ? "null" :" progressResponse.toString()) replaced by: + progressResponse equivalent, if variable is appended a valid string</technical_language>

Target:
@Override public void run() { while (hiveStatement.hasMoreLogs()) { try { updateQueryLog(); Thread.sleep(queryProgressInterval); } catch (SQLException e) { commands.error(new SQLWarning(e)); } catch (InterruptedException e) { commands.debug("Getting log thread is interrupted, since query is done!"); commands.showRemainingLogsIfAny(hiveStatement); } } }