auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static ITmfStateValue queryRangeMax(ITmfStateSystem ss, long t1, long t2, int quark) throws AttributeNotFoundException, TimeRangeException { ITmfStateValue max = TmfStateValue.nullValue(); try { List<ITmfStateInterval> intervals = queryAttributeRange(ss, t1, t2, quark, AbstractTmfMipmapStateProvider.MAX_STRING); if (intervals.size() == 0) { return TmfStateValue.nullValue(); } for (ITmfStateInterval si : intervals) { ITmfStateValue value = si.getStateValue(); switch (value.getType()) { case DOUBLE: if (max.isNull() || si.getStateValue().unboxDouble() > max.unboxDouble()) { max = si.getStateValue(); } break; case INTEGER: case LONG: if (max.isNull() || si.getStateValue().unboxLong() > max.unboxLong()) { max = si.getStateValue(); } break; <START> case NULL: <END> case STRING: default: Activator.logError(unsupOperationMsg(value, "Max")); break; } } } catch (StateValueTypeException e) { throw new IllegalStateException(); } return max; }</code><technical_language>NULL happen private methods check isNull putting interval in list</technical_language>

Target:
public static ITmfStateValue queryRangeMax(ITmfStateSystem ss, long t1, long t2, int quark) throws AttributeNotFoundException, TimeRangeException, StateValueTypeException { ITmfStateValue max = TmfStateValue.nullValue(); List<ITmfStateInterval> intervals = queryAttributeRange(ss, t1, t2, quark, AbstractTmfMipmapStateProvider.MAX_STRING); if (intervals.size() == 0) { return TmfStateValue.nullValue(); } for (ITmfStateInterval si : intervals) { ITmfStateValue value = si.getStateValue(); switch (value.getType()) { case DOUBLE: if (max.isNull() || si.getStateValue().unboxDouble() > max.unboxDouble()) { max = si.getStateValue(); } break; case INTEGER: case LONG: if (max.isNull() || si.getStateValue().unboxLong() > max.unboxLong()) { max = si.getStateValue(); } break; case NULL: case STRING: default: throw new StateValueTypeException(); } } return max; }
Source:
<code>public ApplicationModule() { final AsyncCallback<List<String>> callback = new AsyncCallback<List<String>>() { @Override public void onFailure(Throwable caught) { Layout.getInstance().setWarningMessage("Unable to load applet gatelab classes:<br />" + caught.getMessage()); } @Override public void onSuccess(List<String> result) { reservedGateClasses=result; } }; ApplicationService.Util.getInstance().getAppletGateLabClasses(callback); final AsyncCallback<List<String>> callbackTest = new AsyncCallback<List<String>>() { @Override public void onFailure(Throwable caught) { Layout.getInstance().setWarningMessage("Unable to load applet gatelab classes:<br />" + caught.getMessage()); } @Override public void onSuccess(List<String> result) { reservedTestClasses=result; } }; <START> ApplicationService.Util.getInstance().getAppletGateLabTestClasses(callbackTest); <END> }</code><technical_language>do this 1 remote call</technical_language>

Target:
public ApplicationModule() { final AsyncCallback<HashMap<String, Integer>> callback = new AsyncCallback<HashMap<String, Integer>>() { @Override public void onFailure(Throwable caught) { Layout.getInstance().setWarningMessage("Unable to load applet gatelab classes:<br />" + caught.getMessage()); } @Override public void onSuccess(HashMap<String, Integer> result) { reservedClasses=result; } }; ApplicationService.Util.getInstance().getReservedClasses(callback); }
Source:
<code>private ObjectId bumpTerm(Repository git, ObjectInserter inserter) throws IOException { long newTerm; CommitBuilder b = new CommitBuilder(); if (!ObjectId.zeroId().equals(acceptedOld)) { try (RevWalk rw = new RevWalk(git)) { RevCommit c = rw.parseCommit(acceptedOld); b.setTreeId(c.getTree()); b.setParentId(acceptedOld); newTerm = parseTerm(c.getFooterLines(TERM)) + 1; } } else { newTerm = 1; b.setTreeId(inserter.insert(new TreeFormatter())); } StringBuilder msg = new StringBuilder(); msg.append(KetchConstants.TERM.getName()) .append(": ") .append(newTerm); String tag = leader.getSystem().newLeaderTag(); if (tag != null && !tag.isEmpty()) { msg.append(' ').append(tag); } b.setAuthor(leader.getSystem().newCommitter()); b.setCommitter(b.getAuthor()); b.setMessage(msg.toString()); if (log.isDebugEnabled()) { log.debug("Trying to elect myself " + b.getMessage()); } <START> term = newTerm; <END> return inserter.insert(b); }</code><technical_language>I publishing of new term delayed. Get rid of "newTerm" local assign "term" member variable</technical_language>

Target:
private ObjectId bumpTerm(Repository git, ObjectInserter inserter) throws IOException { CommitBuilder b = new CommitBuilder(); if (!ObjectId.zeroId().equals(acceptedOldIndex)) { try (RevWalk rw = new RevWalk(git)) { RevCommit c = rw.parseCommit(acceptedOldIndex); b.setTreeId(c.getTree()); b.setParentId(acceptedOldIndex); term = parseTerm(c.getFooterLines(TERM)) + 1; } } else { term = 1; b.setTreeId(inserter.insert(new TreeFormatter())); } StringBuilder msg = new StringBuilder(); msg.append(KetchConstants.TERM.getName()) .append(": ") .append(term); String tag = leader.getSystem().newLeaderTag(); if (tag != null && !tag.isEmpty()) { msg.append(' ').append(tag); } b.setAuthor(leader.getSystem().newCommitter()); b.setCommitter(b.getAuthor()); b.setMessage(msg.toString()); if (log.isDebugEnabled()) { log.debug("Trying to elect myself " + b.getMessage()); } return inserter.insert(b); }
Source:
<code>public Sequence<T> run( final Query<T> query, final Map<String, Object> responseContext ) { <START> QueryMetrics<? super Query<T>> queryMetrics = queryToolChest.makeMetrics(query); <END> Query<T> queryWithMetrics = query.withQueryMetrics(queryMetrics); final Sequence<T> baseSequence = delegate.run(queryWithMetrics, responseContext); return Sequences.wrap( baseSequence, new SequenceWrapper() { @Override public <RetType> RetType wrap(Supplier<RetType> sequenceProcessing) { final long start = VMUtils.getCurrentThreadCpuTime(); try { return sequenceProcessing.get(); } finally { cpuTimeAccumulator.addAndGet(VMUtils.getCurrentThreadCpuTime() - start); } } @Override public void after(boolean isDone, Throwable thrown) throws Exception { if (report) { final long cpuTimeNs = cpuTimeAccumulator.get(); if (cpuTimeNs > 0) { queryMetrics.reportCpuTime(cpuTimeNs).emit(emitter); } } } } ); }</code><technical_language>this done if query.getQueryMetrics() is null</technical_language>

Target:
public Sequence<T> run(final Query<T> query, final Map<String, Object> responseContext) { final Sequence<T> baseSequence = delegate.run(query, responseContext); return Sequences.wrap( baseSequence, new SequenceWrapper() { @Override public <RetType> RetType wrap(Supplier<RetType> sequenceProcessing) { final long start = VMUtils.getCurrentThreadCpuTime(); try { return sequenceProcessing.get(); } finally { cpuTimeAccumulator.addAndGet(VMUtils.getCurrentThreadCpuTime() - start); } } @Override public void after(boolean isDone, Throwable thrown) throws Exception { if (report) { final long cpuTimeNs = cpuTimeAccumulator.get(); if (cpuTimeNs > 0) { queryToolChest.makeMetrics(query).reportCpuTime(cpuTimeNs).emit(emitter); } } } } ); }
Source:
<code>public void testProcessInstanceResume_noParams() throws Exception { try{ bundles[0].setProcessPeriodicity(5, TimeUnit.minutes); bundles[0].setOutputFeedPeriodicity(5, TimeUnit.minutes); bundles[0].setProcessConcurrency(6); bundles[0].submitAndScheduleBundle(prism); Thread.sleep(15000); ProcessInstancesResult r = prism.getProcessHelper().getProcessInstanceResume( Util.readEntityName(bundles[0].getProcessData()), ""); InstanceUtil.validateSuccessWithStatusCode(r, ResponseKeys.UNPARSEABLE_DATE); } catch (Exception e) { Assert.assertTrue(e.getMessage().contains("Expected BEGIN_OBJECT but was STRING at line 1 column")); <START> } <END> }</code><technical_language>I this is a bad idea catch exception this. is exception asserting coming</technical_language>

Target:
public void testProcessInstanceResume_noParams() throws Exception { bundles[0].setProcessPeriodicity(5, TimeUnit.minutes); bundles[0].setOutputFeedPeriodicity(5, TimeUnit.minutes); bundles[0].setProcessConcurrency(6); bundles[0].submitAndScheduleBundle(prism); Thread.sleep(15000); ProcessInstancesResult r = prism.getProcessHelper().getProcessInstanceResume( Util.readEntityName(bundles[0].getProcessData()), null); InstanceUtil.validateSuccessWithStatusCode(r, ResponseKeys.UNPARSEABLE_DATE); }
Source:
<code>public Translation getTranslation() { <START> return translation; <END> }</code><technical_language>Turn Instance fields qualified 'this' inspection. Needs accessed this.translation</technical_language>

Target:
public Translation getTranslation() { if (this.translation == null) { String args = new ItemStack((Item) getItemType()).getDisplayName(); int end = "stat.".length() + this.statId.substring("stat.".length()).indexOf('.'); this.translation = new SpongeTranslation(this.statId.substring(0, end), args); } return this.translation; }
Source:
<code>public int read(byte[] b, int off, int len) throws IOException { validateParameters(b, off, len); if (len == 0) { return 0; } if (!subscribed) { blockForData(); } if (this.buffer == null) { if (this.lastError != null) { throw lastError; } if (this.fluxComplete) { return -1; } <START> this.buffer = new ByteArrayInputStream(new byte[0]); <END> } if (this.buffer.available() == 0) { if (this.fluxComplete) { return -1; } if (!waitingForData) { blockForData(); } } if (this.buffer.available() > 0) { return this.buffer.read(b, off, len); } if (this.fluxComplete) { return -1; } return 0; }</code><technical_language>purpose of this line</technical_language>

Target:
public int read(byte[] b, int off, int len) throws IOException { validateParameters(b, off, len); if (len == 0) { return 0; } if (!subscribed) { blockForData(); } if (this.buffer == null) { if (this.lastError != null) { throw lastError; } if (this.fluxComplete) { return -1; } this.buffer = new ByteArrayInputStream(new byte[0]); } if (this.buffer.available() == 0) { if (this.fluxComplete) { return -1; } blockForData(); } if (this.buffer.available() > 0) { return this.buffer.read(b, off, len); } if (this.fluxComplete) { return -1; } else { throw new IllegalStateException("An unexpected error occurred. No data was read from the stream but the " + "stream did not indicate completion."); } }
Source:
<code>public String toString() { return "AggregateCount{" + <START> "name='" + name + '\'' + <END> ", interval=" + interval + ", counts=" + Arrays.toString(counts) + ", resolution=" + resolution + '}'; }</code><technical_language>put closing single quote part of subsequent String</technical_language>

Target:
public String toString() { return "AggregateCount{" + "name='" + name + "', interval=" + interval + ", counts=" + Arrays.toString(counts) + ", resolution=" + resolution + '}'; }
Source:
<code>public <T> T execute(SessionCallback<F, T> callback) { Session<F> session = null; try { session = this.sessionFactory.getSession(); Assert.notNull(session, "failed to acquire a Session"); return callback.doInSession(session); } <START> catch (Exception e) { <END> if (session instanceof CachedSession) { ((CachedSession) session).dirty(); } throw new MessagingException("Failed to execute on session", e); } finally { if (session != null) { try { session.close(); } catch (Exception ignored) { if (logger.isDebugEnabled()) { logger.debug("failed to close Session", ignored); } } } } }</code><technical_language>Oh! I issue failed test. reason change generic Exception? other side is need check type of e rethrow is if is MessagingException</technical_language>

Target:
public <T> T execute(SessionCallback<F, T> callback) { Session<F> session = null; try { session = this.sessionFactory.getSession(); Assert.notNull(session, "failed to acquire a Session"); return callback.doInSession(session); } catch (Exception e) { if (session instanceof CachingSessionFactory<?>.CachedSession) { ((CachingSessionFactory<?>.CachedSession) session).dirty(); } if (e instanceof MessagingException) { throw (MessagingException) e; } throw new MessagingException("Failed to execute on session", e); } finally { if (session != null) { try { session.close(); } catch (Exception ignored) { if (logger.isDebugEnabled()) { logger.debug("failed to close Session", ignored); } } } } }
Source:
<code>private void changeValue(boolean newState) { if (fIsSelected != newState) { fIsSelected= newState; if (fAttachedDialogFields != null) { boolean focusSet= false; for (DialogField <START> fAttachedDialogField : <END> fAttachedDialogFields) { fAttachedDialogField.setEnabled(fIsSelected); if (fIsSelected && !focusSet) { focusSet= fAttachedDialogField.setFocus(); } } } dialogFieldChanged(); } else if (fButtonStyle == SWT.PUSH) { dialogFieldChanged(); } }</code><technical_language>rename dialogField</technical_language>

Target:
private void changeValue(boolean newState) { if (fIsSelected != newState) { fIsSelected= newState; if (fAttachedDialogFields != null) { boolean focusSet= false; for (DialogField dialogField : fAttachedDialogFields) { dialogField.setEnabled(fIsSelected); if (fIsSelected && !focusSet) { focusSet= dialogField.setFocus(); } } } dialogFieldChanged(); } else if (fButtonStyle == SWT.PUSH) { dialogFieldChanged(); } }
Source:
<code>private void initializeEnvironment() throws MojoExecutionException { if (server != null) { Server serverObject = this.settings.getServer(server); if (serverObject == null) { getLog().error("Server [" + server + "] not found in settings file."); throw new MojoExecutionException("Server [" + server + "] not found in settings file."); } if (StringUtils.isNotEmpty(username) || StringUtils.isNotEmpty(password)) { <START> getLog().warn("Both server and credentials are configured. Using settings.xml server configuration."); <END> } username = serverObject.getUsername(); password = serverObject.getPassword(); } }</code><technical_language>This work other around, POM settings precedence settings.xml</technical_language>

Target:
private void initializeEnvironment() throws MojoExecutionException { if (server != null) { Server serverObject = this.settings.getServer(server); if (serverObject == null) { getLog().error("Server [" + server + "] not found in settings file."); throw new MojoExecutionException("Server [" + server + "] not found in settings file."); } serverObject = decrypter.decrypt(new DefaultSettingsDecryptionRequest(serverObject)).getServer(); if (StringUtils.isNotEmpty(username) || StringUtils.isNotEmpty(password)) { getLog().warn("Both server and credentials are configured. Using plugin configuration credentials."); } else { username = serverObject.getUsername(); password = serverObject.getPassword(); } } }
Source:
<code>public void matchShouldReturnAddressesWhenSpecifiedExceptionHasOccurred() throws MessagingException { mockedMail.setAttribute(Mail.MAILET_ERROR_ATTRIBUTE_NAME, new javax.mail.internet.AddressException()); <START> FakeMatcherConfig mci = FakeMatcherConfig.builder() <END> .matcherName("HasException") .condition("javax.mail.internet.AddressException") .build(); matcher.init(mci); assertThat(matcher.match(mockedMail)).containsAll(mockedMail.getRecipients()); }</code><technical_language>I other tests acronym mci I do find explicit. I propose replace mci matcherConfig</technical_language>

Target:
public void matchShouldReturnAddressesWhenSpecifiedExceptionHasOccurred() throws MessagingException { mockedMail.setAttribute(Mail.MAILET_ERROR_ATTRIBUTE_NAME, new javax.mail.internet.AddressException()); FakeMatcherConfig matcherConfig = FakeMatcherConfig.builder() .matcherName("HasException") .condition("javax.mail.internet.AddressException") .build(); testee.init(matcherConfig); assertThat(testee.match(mockedMail)).containsExactlyElementsOf(mockedMail.getRecipients()); }
Source:
<code>public void notify(TranscriptionResult result) { if(!result.isInterim()) { ArrayList<TranslationResult> translations = getTranslations(result); for (TranslationResultListener listener : listeners) { <START> for (TranslationResult translation : translations) <END> listener.notify(translation); } } }</code><technical_language>translations.forEach(listener::notify); more elegant. listeners.forEach(l -> translations.forEach(l::notify));</technical_language>

Target:
public void notify(TranscriptionResult result) { if(!result.isInterim()) { List<TranslationResult> translations = getTranslations(result); Iterable<TranslationResultListener> translationResultListeners; synchronized (listeners) { translationResultListeners = new ArrayList<>(listeners); } translationResultListeners.forEach( listener -> translations.forEach(listener::notify)); } }
Source:
<code>private List<StorageServerConnections> getConnections() { List<StorageServerConnections> connectionsList = new ArrayList<>(); for (int i = 0; i <START> == NUMBER_OF_EXISTING_CONNECTIONS; <END> i++) { StorageServerConnections conn = new StorageServerConnections(); conn.setId(Guid.newGuid().toString()); connectionsList.add(conn); } return connectionsList; }</code><technical_language>This create 0 connections. <</technical_language>

Target:
private List<StorageServerConnections> getConnections() { List<StorageServerConnections> connectionsList = new ArrayList<>(); for (int i = 0; i <= NUMBER_OF_EXISTING_CONNECTIONS; i++) { StorageServerConnections conn = new StorageServerConnections(); conn.setId(Guid.newGuid().toString()); connectionsList.add(conn); } return connectionsList; }
Source:
<code><START> public static SemanticVersion parseParquetVersion(String createdBy) <END> { if (Strings.isNullOrEmpty(createdBy)) { warnIfNeed("Ignoring statistics because created_by is null or empty! See PARQUET-251 and PARQUET-297"); return null; } else { try { VersionParser.ParsedVersion version = VersionParser.parse(createdBy); if (!"parquet-mr".equals(version.application)) { return null; } else if (Strings.isNullOrEmpty(version.version)) { warnIfNeed("Ignoring statistics because created_by did not contain a semver (see PARQUET-251): " + createdBy); return null; } return SemanticVersion.parse(version.version); } catch (RuntimeException | SemanticVersion.SemanticVersionParseException | VersionParser.VersionParseException ex) { warnParseErrorOnce(createdBy, ex); return null; } } }</code><technical_language>this method private - change return type Optional<SemanticVersion> - drop else return - remove calls warnXxx methods do private static Optional<SemanticVersion> parseParquetVersion(String createdBy) { if (Strings.isNullOrEmpty(createdBy)) { return Optional.empty(); } try { VersionParser.ParsedVersion version = VersionParser.parse(createdBy); if (!"parquet-mr".equals(version.application)) { return Optional.empty(); } if (Strings.isNullOrEmpty(version.version)) { return Optional.empty(); } return Optional.of(SemanticVersion.parse(version.version)); } catch (SemanticVersion.SemanticVersionParseException | VersionParser.VersionParseException ex) { return Optional.empty(); } }</technical_language>

Target:
private static Optional<SemanticVersion> parseParquetVersion(String createdBy) { if (Strings.isNullOrEmpty(createdBy)) { return Optional.empty(); } try { VersionParser.ParsedVersion version = VersionParser.parse(createdBy); if (!"parquet-mr".equals(version.application)) { return Optional.empty(); } if (Strings.isNullOrEmpty(version.version)) { return Optional.empty(); } return Optional.of(SemanticVersion.parse(version.version)); } catch (SemanticVersion.SemanticVersionParseException | VersionParser.VersionParseException ex) { return Optional.empty(); } }
Source:
<code>public static void main(String[] args) { System.out.println(">>> Starting cluster."); try (Ignite ignite = Ignition.start("examples/config/encryption/example-encrypted-store.xml")) { ignite.active(true); CacheConfiguration<Long, BankAccount> ccfg = new CacheConfiguration<>("encrypted-cache"); ccfg.setEncryptionEnabled(true); System.out.println(">>> Creating encrypted cache."); IgniteCache<Long, BankAccount> cache = ignite.createCache(ccfg); System.out.println(">>> Populating cache with data."); cache.put(1L, new BankAccount("Rich account", 1_000_000L)); cache.put(2L, new BankAccount("Middle account", 1_000L)); cache.put(3L, new BankAccount("One dollar account", 1L)); } System.out.println(">>> Starting cluster again."); try (Ignite ignite = Ignition.start("examples/config/encryption/example-encrypted-store.xml")) { ignite.active(true); IgniteCache<Long, BankAccount> cache = ignite.getOrCreateCache("encrypted-cache"); QueryCursor<Cache.Entry<Long, BankAccount>> cursor = cache.query(new ScanQuery<>()); System.out.println(">>> Saved data:"); for (Cache.Entry<Long, BankAccount> entry : cursor) { System.out.println(">>> ID = " + entry.getKey() + ", AccountName = " + entry.getValue().accountName + ", Balance = " + entry.getValue().balance); } <START> } <END> }</code><technical_language>check impossible gain data encryptionSpi. provide a couple of spring configs</technical_language>

Target:
public static void main(String[] args) { System.out.println(">>> Starting cluster."); try (Ignite ignite = Ignition.start("examples/config/encryption/example-encrypted-store.xml")) { ignite.cluster().active(true); CacheConfiguration<Long, BankAccount> ccfg = new CacheConfiguration<>("encrypted-cache"); ccfg.setEncryptionEnabled(true); System.out.println(">>> Creating encrypted cache."); IgniteCache<Long, BankAccount> cache = ignite.createCache(ccfg); System.out.println(">>> Populating cache with data."); cache.put(1L, new BankAccount("Rich account", 1_000_000L)); cache.put(2L, new BankAccount("Middle account", 1_000L)); cache.put(3L, new BankAccount("One dollar account", 1L)); } System.out.println(">>> Starting cluster again."); try (Ignite ignite = Ignition.start("examples/config/encryption/example-encrypted-store.xml")) { ignite.cluster().active(true); IgniteCache<Long, BankAccount> cache = ignite.getOrCreateCache("encrypted-cache"); QueryCursor<Cache.Entry<Long, BankAccount>> cursor = cache.query(new ScanQuery<>()); System.out.println(">>> Saved data:"); for (Cache.Entry<Long, BankAccount> entry : cursor) { System.out.println(">>> ID = " + entry.getKey() + ", AccountName = " + entry.getValue().accountName + ", Balance = " + entry.getValue().balance); } } }
Source:
<code>protected boolean validateSpaceRequirements() { int numOfVms = getParameters().getVmsCount(); List<DiskImage> disksList = new ArrayList<>(); for (int i = 0; i < numOfVms; ++i) { disksList.addAll(diskInfoDestinationMap.values()); } <START> for (DiskImage diskImage : disksList) { <END> diskImage.setVolumeType(VolumeType.Sparse); if (getDiskStorageDomain(diskImage).getStorageType().isBlockDomain()) { diskImage.setvolumeFormat(VolumeFormat.COW); } else { diskImage.setvolumeFormat(VolumeFormat.RAW); } } Guid spId = getVmTemplate().getStoragePoolId(); Set<Guid> sdIds = destStorages.keySet(); MultipleStorageDomainsValidator storageDomainsValidator = getStorageDomainsValidator(spId, sdIds); return validate(storageDomainsValidator.allDomainsWithinThresholds()) && validate(storageDomainsValidator.allDomainsHaveSpaceForNewDisks(disksList)); }</code><technical_language>This alter original diskInfoDestinationMap disk instances a clone, moreover, redundantly do loop disks multiplied number of VMs created pool, deep clone list once, change allocation add disksList multiple times necessary number of pools</technical_language>

Target:
protected boolean validateSpaceRequirements() { int numOfVms = getParameters().getVmsCount(); List<DiskImage> disksList = getDiskList(); for (int i = 0; i < numOfVms; ++i) { disksList.addAll(diskInfoDestinationMap.values()); } Guid spId = getVmTemplate().getStoragePoolId(); Set<Guid> sdIds = destStorages.keySet(); MultipleStorageDomainsValidator storageDomainsValidator = getStorageDomainsValidator(spId, sdIds); return validate(storageDomainsValidator.allDomainsWithinThresholds()) && validate(storageDomainsValidator.allDomainsHaveSpaceForNewDisks(disksList)); }
Source:
<code><START> public static void share(Context ctx, News news) { <END> ctx.startActivity(Intent.createChooser(getPumpkinShareIntent(ctx, news), ctx.getResources().getString(R.string.share))); }</code><technical_language>ctx variable is unused anymore</technical_language>

Target:
public static void share(Context ctx, News news) { ctx.startActivity(Intent.createChooser(getPumpkinShareIntent(news), ctx.getResources().getString(R.string.share))); }
Source:
<code>public long getGlobalClassLoaderId() { <START> return (long) ClassLoaderIdentifier.GLOBAL_ID; <END> }</code><technical_language>declare GLOBAL_ID a long</technical_language>

Target:
public long getGlobalClassLoaderId() { return ClassLoaderIdentifier.GLOBAL_ID; }
Source:
<code>public MobileArticlePageObject openTOCPage(String wikiURL){ getUrl(wikiURL+wikiTOC); waitForElementByElement(tocWrapper); <START> PageObjectLogging.log("openTOC", "TOC page was opened", true, driver); <END> return new MobileArticlePageObject(driver); }</code><technical_language>log method name: openTOCPage, "openTOC"</technical_language>

Target:
public MobileArticlePageObject openTOCPage(String wikiURL){ getUrl(wikiURL + wikiTOC); waitForElementByElement(tocWrapper); PageObjectLogging.log("openTOCPage", "TOC page was opened", true, driver); return new MobileArticlePageObject(driver); }
Source:
<code>void initTableOverhead() { disksViewRadioGroup = new DisksViewRadioGroup(); disksViewRadioGroup.setClickHandler(clickHandler); disksContentTypeRadioGroup = new DisksContentTypeRadioGroup(); disksContentTypeRadioGroup.setClickHandler(event -> { if (((RadioButton) event.getSource()).getValue()) { getMainModel().getDiskContentType().setEntity(disksContentTypeRadioGroup.getDiskContentType()); } }); <START> HorizontalPanel overheadPanel = new HorizontalPanel(); <END> overheadPanel.add(disksViewRadioGroup); overheadPanel.add(disksContentTypeRadioGroup); getTable().setTableOverhead(overheadPanel); }</code><technical_language>Please HorizontalPanels, turn tables in resulting HTML for layout purposes</technical_language>

Target:
void initTableOverhead() { disksViewRadioGroup = new DisksViewRadioGroup(); disksViewRadioGroup.addChangeHandler(diskViewTypeChange); disksContentTypeRadioGroup = new DisksContentTypeRadioGroup(); disksContentTypeRadioGroup.addChangeHandler(diskContentViewTypeChange); FlowPanel overheadPanel = new FlowPanel(); overheadPanel.add(disksViewRadioGroup); overheadPanel.add(disksContentTypeRadioGroup); getTable().setTableOverhead(overheadPanel); }
Source:
<code>public GuiWrongMinecraft(WrongMinecraftVersionException wrongMC) { <START> super(); <END> this.wrongMC = wrongMC; }</code><technical_language>is reason call super() arguments, is called automatically other super call is made. Please remove calls super()</technical_language>

Target:
public GuiWrongMinecraft(WrongMinecraftVersionException wrongMC) { this.wrongMC = wrongMC; }
Source:
<code>public void put(final int numAlleles, final int ploidy, final int numLikelihoods) { if(numAlleles < N_ALLELES && ploidy < PLOIDY) { staticCache[numAlleles][ploidy] = numLikelihoods; } else{ <START> final HashMap<Integer, Integer> cache = dynamicCache.containsKey(ploidy) ? dynamicCache.get(ploidy) : new HashMap<>(); <END> if(cache.isEmpty()){ dynamicCache.put(ploidy, cache); } cache.put(numAlleles, numLikelihoods); } }</code><technical_language>This is kind of nitpicky, this is important performance ( important a faster implementation), want avoid redundant hash ups get saving / checking result nicer contains a get. I skip I a bottleneck all..</technical_language>

Target:
private synchronized void put(final int numAlleles, final int ploidy, final int numLikelihoods) { dynamicCache.put(new CacheKey(numAlleles, ploidy), numLikelihoods); }
Source:
<code><START> public Guid getVdsForConnectStorage() { <END> vdsId = getParameters().getVdsId(); if (vdsId == null) { List<VDS> hosts = getDbFacade().getVdsDao().getAllForStoragePoolAndStatus(getParameters().getId(), VDSStatus.Up); if (!hosts.isEmpty()) { vdsId = hosts.get(new Random().nextInt(hosts.size())).getId(); log.info("vds id '{}' was chosen to fetch the Storage domain info", vdsId); } else { log.warn("There is no available vds in UP state to fetch the Storage domain info from VDSM"); } } return vdsId; }</code><technical_language>private. Also, move executeQueryCommand() - "public contract"</technical_language>

Target:
private Guid getVdsForConnectStorage() { vdsId = getParameters().getVdsId(); if (vdsId == null) { List<VDS> hosts = getDbFacade().getVdsDao().getAllForStoragePoolAndStatus(getParameters().getId(), VDSStatus.Up); if (!hosts.isEmpty()) { vdsId = hosts.get(new Random().nextInt(hosts.size())).getId(); log.info("vds id '{}' was chosen to fetch the Storage domain info", vdsId); } else { log.warn("There is no available vds in UP state to fetch the Storage domain info from VDSM"); } } return vdsId; }
Source:
<code>public String getBindingType() { <START> return "upb"; <END> }</code><technical_language>UPB</technical_language>

Target:
public String getBindingType() { return "UPB"; }
Source:
<code>public void applyCSSProperty(Control control, String property, CSSValue value, String pseudo, CSSEngine engine) throws Exception { if <START> (!isMruControlledByCSS()) <END> { return; } boolean isMruVisible = (Boolean)engine.convert(value, Boolean.class, null); if (control instanceof CTabFolder) { CTabFolder folder = (CTabFolder) control; folder.setMRUVisible(isMruVisible); } }</code><technical_language>mruControlledByCSS accessed directly</technical_language>

Target:
public void applyCSSProperty(Control control, String property, CSSValue value, String pseudo, CSSEngine engine) throws Exception { if (!isMRUControlledByCSS()) { return; } boolean isMruVisible = (Boolean)engine.convert(value, Boolean.class, null); if (control instanceof CTabFolder) { CTabFolder folder = (CTabFolder) control; folder.setMRUVisible(isMruVisible); } }
Source:
<code>private LongRunningOperationStatus toLongRunningOperationStatus(String operationStatus) { <START> switch (operationStatus) { <END> case "InProgress": return LongRunningOperationStatus.IN_PROGRESS; case "Success": return LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; case "Failed": return LongRunningOperationStatus.FAILED; default: return LongRunningOperationStatus.fromString("POLLING_FAILED", true); } }</code><technical_language>more sense lower-case compare case-insensitively? I trust service implementation in this regard</technical_language>

Target:
private static LongRunningOperationStatus toLongRunningOperationStatus(String operationStatus) { switch (operationStatus) { case "inprogress": return LongRunningOperationStatus.IN_PROGRESS; case "succeeded": return LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; case "failed": return LongRunningOperationStatus.FAILED; default: return LongRunningOperationStatus.fromString("POLLING_FAILED", true); } }
Source:
<code>private void processPage() { <START> chooserLogic = new ToolChooserLogic(serviceManager); <END> xLinkMock = new XLinkMock(serviceUtils, authenticationContext); requestParameters = getRequestParametersAsAMap(); HttpServletRequest req = (HttpServletRequest) getRequest().getContainerRequest(); HttpServletResponse resp = (HttpServletResponse) getResponse().getContainerResponse(); setContextFromId(); try { checkIfXLinkIsValid(req); } catch (OpenXLinkException ex) { handleErrorResponse(ex.getMessage()); } if (checkForLocalSwitchingParameters()) { ModelDescription destinationModelClass = chooserLogic.getModelClassOfView(hostId, connectorId, viewId); triggerXLinkProcessing(destinationModelClass, connectorId, viewId); handleSuccessResponse(resp); return; } buildToolChooserPage(resp); }</code><technical_language>inject</technical_language>

Target:
private void processPage() { requestParameters = getRequestParametersAsAMap(); HttpServletRequest req = (HttpServletRequest) getRequest().getContainerRequest(); HttpServletResponse resp = (HttpServletResponse) getResponse().getContainerResponse(); setContextFromId(); try { checkIfXLinkIsValid(req); } catch (OpenXLinkException ex) { handleErrorResponse(ex.getMessage()); } if (checkForLocalSwitchingParameters()) { ModelDescription destinationModelClass = toolChooserLogic.getModelClassOfView(hostId, connectorId, viewId); triggerXLinkProcessing(destinationModelClass, connectorId, viewId); handleSuccessResponse(resp); return; } buildToolChooserPage(resp); }
Source:
<code>private Operation<PromiseError> handleError(final String nameSpace) { return new Operation<PromiseError>() { @Override public void apply(PromiseError promiseError) throws OperationException { <START> loader.hide(); <END> notificationManager.showError(locale.deleteProjectFailed(nameSpace) + " " + promiseError.getMessage()); } }; }</code><technical_language>Loader hided <LINK_0> <LINK_1> happened if call hide method in loader twice</technical_language>

Target:
private Operation<PromiseError> handleError(final String nameSpace) { return new Operation<PromiseError>() { @Override public void apply(PromiseError promiseError) throws OperationException { notificationManager.showError(locale.deleteProjectFailed(nameSpace) + " " + promiseError.getMessage()); } }; }
Source:
<code>public Object doWork() { final ReadCountCollection inputCounts; try { inputCounts = ReadCountCollectionUtils.parse(inputFile); } catch (final IOException e) { throw new UserException.CouldNotReadInputFile(inputFile, "cannot reach or read the input target coverage file"); } final RealMatrix counts = inputCounts.counts(); <START> final List<Target> targets = inputCounts.targets().stream() <END> .map(t -> new Target(t.getName(), t.getInterval())).collect(Collectors.toList()); final List<String> columnNames = new ArrayList<>(inputCounts.columnNames()); final int[] targetSizes; if (weightByTargetSize) { try { targetSizes = targets.stream().mapToInt(t -> length(t)).toArray(); } catch (final IllegalStateException e) { throw new UserException.BadInput("Weighting by target size requested but input read counts lack target intervals."); } } else { targetSizes = new int[targets.size()]; Arrays.fill(targetSizes, 1); } final int totalTargetSize = Arrays.stream(targetSizes).sum(); final double[] sampleWeightedAverages = new double[counts.getColumnDimension()]; counts.walkInOptimizedOrder(new DefaultRealMatrixPreservingVisitor() { @Override public void visit(final int target, final int sample, final double coverage) { sampleWeightedAverages[sample] += targetSizes[target] * coverage / totalTargetSize; } }); counts.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor() { @Override public double visit(final int target, final int sample, final double coverage) { return coverage / sampleWeightedAverages[sample]; } }); final ReadCountCollection normalizedCounts = new ReadCountCollection(SetUniqueList.setUniqueList(targets), SetUniqueList.setUniqueList(columnNames), counts); try { ReadCountCollectionUtils.write(outputFile, normalizedCounts); } catch (final IOException e) { throw new UserException.CouldNotCreateOutputFile(outputFile, "cannot write to the given output file"); } return "SUCCESS"; }</code><technical_language>new ArrayList<>(...) a copy. This reasonable if extend Target, want enforce copy a Target</technical_language>

Target:
public Object doWork() { final ReadCountCollection inputCounts; try { inputCounts = ReadCountCollectionUtils.parse(inputFile); } catch (final IOException e) { throw new UserException.CouldNotReadInputFile(inputFile, "cannot reach or read the input target coverage file"); } final ReadCountCollection normalizedCounts; try { normalizedCounts = inputCounts.normalizeByColumnAverages(weightByTargetSize); } catch (final IllegalArgumentException e) { throw new UserException.BadInput("Weighting by target size requested but input read normalizedCounts lack target intervals."); } try { ReadCountCollectionUtils.write(outputFile, normalizedCounts); } catch (final IOException e) { throw new UserException.CouldNotCreateOutputFile(outputFile, "cannot write to the given output file"); } return "SUCCESS"; }
Source:
<code>public void getClustersTest() throws Exception { <START> String lzfile = System.getProperty("lztestfile"); <END> if(lzfile != null) { DFUFileDetailWrapper fileWrapper = wsdfuclient.getFileDetails(lzfile, null); assertTrue(fileWrapper.getClusters().size() >= 1); } }</code><technical_language>If filename is provided, provide a fallback, BaseRemoteTest.DEFAULTHPCCFILENAME. Also, property name confuses a bi, lztestfile (landing zone) implies a file in landing zone, a logical file sprayed cluster</technical_language>

Target:
public void getClustersTest() throws Exception { DFUFileDetailWrapper fileWrapper = wsdfuclient.getFileDetails(logicalfilename, null); Set<String> clusters = fileWrapper.getClusters(); assertTrue(clusters != null && !clusters.isEmpty()); assertTrue(clusters.stream().findFirst().isPresent()); }
Source:
<code>private List<GridCacheSqlQuery> prepareMapQueryForSinglePartition(GridCacheTwoStepQuery qry, Object[] params) { boolean hasSubQries = false; for (GridCacheSqlQuery mapQry : qry.mapQueries()) <START> hasSubQries |= mapQry.hasSubQueries(); <END> GridCacheSqlQuery originalQry = new GridCacheSqlQuery(qry.originalSql()); if (!F.isEmpty(params)) { int[] paramIdxs = new int[params.length]; for (int i = 0; i < params.length; i++) paramIdxs[i] = i; originalQry.parameterIndexes(paramIdxs); } originalQry.partitioned(true); originalQry.hasSubQueries(hasSubQries); return Collections.singletonList(originalQry); }</code><technical_language>Seems, is need check queries, find sub-query</technical_language>

Target:
private List<GridCacheSqlQuery> prepareMapQueryForSinglePartition(GridCacheTwoStepQuery qry, Object[] params) { boolean hasSubQries = false; for (GridCacheSqlQuery mapQry : qry.mapQueries()) { if (mapQry.hasSubQueries()) { hasSubQries = true; break; } } GridCacheSqlQuery originalQry = new GridCacheSqlQuery(qry.originalSql()); if (!F.isEmpty(params)) { int[] paramIdxs = new int[params.length]; for (int i = 0; i < params.length; i++) paramIdxs[i] = i; originalQry.parameterIndexes(paramIdxs); } originalQry.partitioned(true); originalQry.hasSubQueries(hasSubQries); return Collections.singletonList(originalQry); }
Source:
<code>protected boolean doSend(Message<?> message, long timeout) { Assert.notNull(message, "'message' must not be null"); try { if (this.queue instanceof BlockingQueue) { BlockingQueue<Message<?>> blockingQueue = (BlockingQueue<Message<?>>) this.queue; if (timeout > 0) { return blockingQueue.offer(message, timeout, TimeUnit.MILLISECONDS); } if (timeout == 0) { return blockingQueue.offer(message); } blockingQueue.put(message); return true; } else { <START> return this.queue.add(message); <END> } } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } }</code><technical_language>offer()? add() is a behavior change (exception full queue)</technical_language>

Target:
protected boolean doSend(Message<?> message, long timeout) { Assert.notNull(message, "'message' must not be null"); try { if (this.queue instanceof BlockingQueue) { BlockingQueue<Message<?>> blockingQueue = (BlockingQueue<Message<?>>) this.queue; if (timeout > 0) { return blockingQueue.offer(message, timeout, TimeUnit.MILLISECONDS); } if (timeout == 0) { return blockingQueue.offer(message); } blockingQueue.put(message); return true; } else { try { return this.queue.offer(message); } finally { this.queueSemaphore.release(); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } }
Source:
<code>public Response iscsiLogin(Action action) { validateParameters(action, "iscsi.address", "iscsi.target"); StorageServerConnections cnx = new StorageServerConnections(); IscsiDetails iscsiDetails = action.getIscsi(); cnx.setConnection(iscsiDetails.getAddress()); cnx.setIqn(iscsiDetails.getTarget()); cnx.setStorageType(StorageType.ISCSI); if (iscsiDetails.isSetPort()) { cnx.setPort(iscsiDetails.getPort().toString()); } else { cnx.setPort(DEFAULT_ISCSI_PORT); } if (iscsiDetails.isSetPortal()) { <START> cnx.setPortal(iscsiDetails.getPortal().toString()); <END> } if (iscsiDetails.isSetUsername()) { cnx.setUserName(iscsiDetails.getUsername()); } if (iscsiDetails.isSetPassword()) { cnx.setPassword(iscsiDetails.getPassword()); } StorageServerConnectionParametersBase connectionParms = new StorageServerConnectionParametersBase(cnx, guid, false); return doAction(ActionType.ConnectStorageToVds, connectionParms, action); }</code><technical_language>this is a string, point in calling toString() here</technical_language>

Target:
public Response iscsiLogin(Action action) { validateParameters(action, "iscsi.address", "iscsi.target"); StorageServerConnections cnx = new StorageServerConnections(); IscsiDetails iscsiDetails = action.getIscsi(); cnx.setConnection(iscsiDetails.getAddress()); cnx.setIqn(iscsiDetails.getTarget()); cnx.setStorageType(StorageType.ISCSI); if (iscsiDetails.isSetPort()) { cnx.setPort(iscsiDetails.getPort().toString()); } else { cnx.setPort(DEFAULT_ISCSI_PORT); } if (iscsiDetails.isSetPortal()) { cnx.setPortal(iscsiDetails.getPortal()); } if (iscsiDetails.isSetUsername()) { cnx.setUserName(iscsiDetails.getUsername()); } if (iscsiDetails.isSetPassword()) { cnx.setPassword(iscsiDetails.getPassword()); } StorageServerConnectionParametersBase connectionParms = new StorageServerConnectionParametersBase(cnx, guid, false); return doAction(ActionType.ConnectStorageToVds, connectionParms, action); }
Source:
<code>private void renderCustomHearts(int xBasePos, int yBasePos, int potionOffset, int count, boolean absorb) { int regenOffset = absorb ? 10 : 0; for(int iter = 0; iter < count / 20; iter++) { int renderHearts = (count - 20 * (iter + 1)) / 2; int heartIndex = iter % 11; if(renderHearts > 10) { renderHearts = 10; } for(int i = 0; i < renderHearts; i++) { int y = 0; if(i + regenOffset == regen) { y -= 2; } if(absorb) { this.drawTexturedModalRect(xBasePos + 8 * i, yBasePos + y, 0, 54, 9, 9); } this.drawTexturedModalRect(xBasePos + 8 * i, yBasePos + y, 0 + 18 * heartIndex, potionOffset, 9, 9); } if(count % 2 == 1 && renderHearts < 10) { <START> int y = renderHearts + regenOffset == regen ? -2 : 0; <END> if(absorb) { this.drawTexturedModalRect(xBasePos + 8 * renderHearts, yBasePos + y, 0, 54, 9, 9); } this.drawTexturedModalRect(xBasePos + 8 * renderHearts, yBasePos + y, 9 + 18 * heartIndex, potionOffset, 9, 9); } } }</code><technical_language>rewrite this y = getYRegenOffset(i, regenOffset) replace upper if call unified</technical_language>

Target:
private void renderCustomHearts(int xBasePos, int yBasePos, int potionOffset, int count, boolean absorb) { int regenOffset = absorb ? 10 : 0; for(int iter = 0; iter < count / 20; iter++) { int renderHearts = (count - 20 * (iter + 1)) / 2; int heartIndex = iter % 11; if(renderHearts > 10) { renderHearts = 10; } for(int i = 0; i < renderHearts; i++) { int y = getYRegenOffset(i, regenOffset); if(absorb) { this.drawTexturedModalRect(xBasePos + 8 * i, yBasePos + y, 0, 54, 9, 9); } this.drawTexturedModalRect(xBasePos + 8 * i, yBasePos + y, 0 + 18 * heartIndex, potionOffset, 9, 9); } if(count % 2 == 1 && renderHearts < 10) { int y = getYRegenOffset(renderHearts, regenOffset); if(absorb) { this.drawTexturedModalRect(xBasePos + 8 * renderHearts, yBasePos + y, 0, 54, 9, 9); } this.drawTexturedModalRect(xBasePos + 8 * renderHearts, yBasePos + y, 9 + 18 * heartIndex, potionOffset, 9, 9); } } }
Source:
<code>public PrefixedFileObjectPutter(final Path inputDirectory, final String prefix) { <START> objectPutter = new LoggingFileObjectPutter(inputDirectory); <END> this.prefix = prefix; }</code><technical_language>missing this</technical_language>

Target:
public PrefixedFileObjectPutter(final Path inputDirectory, final String prefix) { this.objectPutter = new LoggingFileObjectPutter(inputDirectory); this.prefix = prefix; }
Source:
<code>public void handleNodeDeleted(Event event) { LOG.debug("Received event: {}", event.getUei()); Long nodeId = event.getNodeid(); if (nodeId == null) { <START> LOG.error(EventConstants.INTERFACE_DELETED_EVENT_UEI + ": Event with no node ID: " + event.toString()); <END> return; } m_cache.removeInterfacesForNode(nodeId.intValue()); }</code><technical_language>Nit: placeholders instead of string concatenation</technical_language>

Target:
public void handleNodeDeleted(Event event) { Long nodeId = event.getNodeid(); LOG.debug("Received event: with nodeId = {}", event.getUei(), nodeId); if (nodeId == null) { LOG.error("{} : Event with no node ID: {}", EventConstants.INTERFACE_DELETED_EVENT_UEI, event.toString()); return; } m_cache.removeInterfacesForNode(nodeId.intValue()); }
Source:
<code><START> public PrefetchableOrPredicate( <END> Collection<? extends Predicate<ChangeData>> that) { super(that); }</code><technical_language>need public</technical_language>

Target:
PrefetchableOrPredicate( Collection<? extends Predicate<ChangeData>> that) { super(that); }
Source:
<code>private void initLaunchers() { for (JsonGroup group : definition.getGroups()) { Provider provider = UserClusterDataExtractor.getGroupProvider(definition, group.getName()); Launcher launcher = launchers.get(provider.getClass()); if (launcher == null) { if (provider instanceof Ec2) { launcher = new Ec2Launcher(clusterContext.getEc2Context(), clusterContext.getSshKeyPair()); } else if (provider instanceof Baremetal) { launcher = new BaremetalLauncher(clusterContext.getSshKeyPair()); } else if (provider instanceof Gce) { launcher = new GceLauncher(clusterContext.getGceContext(), clusterContext.getSshKeyPair()); <START> } else if (provider instanceof Occi){ <END> launcher = new OcciLauncher(clusterContext.getOcciContext(),clusterContext.getSshKeyPair()); } launchers.put(provider.getClass(), launcher); } } }</code><technical_language>whitespace</technical_language>

Target:
private void initLaunchers() throws KaramelException { for (JsonGroup group : definition.getGroups()) { Provider provider = UserClusterDataExtractor.getGroupProvider(definition, group.getName()); Launcher launcher = launchers.get(provider.getClass()); if (launcher == null) { if (provider instanceof Ec2) { launcher = new Ec2Launcher(clusterContext.getEc2Context(), clusterContext.getSshKeyPair()); } else if (provider instanceof Baremetal) { launcher = new BaremetalLauncher(clusterContext.getSshKeyPair()); } else if (provider instanceof Gce) { launcher = new GceLauncher(clusterContext.getGceContext(), clusterContext.getSshKeyPair()); } else if (provider instanceof Nova) { launcher = new NovaLauncher(clusterContext.getNovaContext(), clusterContext.getSshKeyPair()); } else if (provider instanceof Occi) { launcher = new OcciLauncher(clusterContext.getOcciContext(), clusterContext.getSshKeyPair()); } launchers.put(provider.getClass(), launcher); } } }