auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected boolean validateDestStorage() { StorageDomainValidator validator = new StorageDomainValidator(getStorageDomain()); if (!validate(validator.isDomainExistAndActive()) || !validate(validator.domainIsValidDestination())) { return false; } boolean moveOrCopy = isMoveOperation() || isCopyOperation(); if (moveOrCopy && getImage().isShareable() && getStorageDomain().getStorageType() == StorageType.GLUSTERFS ) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS, String.format("$%1$s %2$s", "diskAlias", getImage().getDiskAlias())); } if ( moveOrCopy && getImage().isShareable() && getStorageDomain().getStorageType().isBlockDomain() && getImage().getVolumeType() == VolumeType.Sparse ) { return <START> failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_OR_COPY_SHAREABLE_THIN_DISK_TO_ISCSI, <END> String.format("$%1$s %2$s", "diskAlias", getImage().getDiskAlias())); } if (isMoveOperation()) { if (getImage().getStorageIds().contains(getStorageDomainId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_DESTINATION_STORAGE_DOMAIN_ALREADY_CONTAINS_THE_DISK); } } return true; }</code><technical_language>I suggest delete "OR_COPY" part this enum add previous "ACTION_TYPE_FAILED_CANT_MOVE_OR_COPY_SHAREABLE_THIN_DISK_TO_ISCSI" enum, work (check for "moveOrCopy" boolean), name difference is confusing</technical_language>

Target:
protected boolean validateDestStorage() { StorageDomainValidator validator = new StorageDomainValidator(getStorageDomain()); if (!validate(validator.isDomainExistAndActive()) || !validate(validator.domainIsValidDestination())) { return false; } if (!isSupportedByManagedBlockStorageDomain(getStorageDomain())) { return false; } boolean moveOrCopy = isMoveOperation() || isCopyOperation(); if (moveOrCopy && getImage().isShareable() && getStorageDomain().getStorageType() == StorageType.GLUSTERFS ) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS, String.format("$%1$s %2$s", "diskAlias", getImage().getDiskAlias())); } if ( moveOrCopy && getImage().isShareable() && getStorageDomain().getStorageType().isBlockDomain() && getImage().getVolumeType() == VolumeType.Sparse ) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_OR_COPY_SHAREABLE_THIN_DISK_TO_ISCSI, String.format("$%1$s %2$s", "diskAlias", getImage().getDiskAlias())); } if (isMoveOperation()) { if (getImage().getStorageIds().contains(getStorageDomainId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_DESTINATION_STORAGE_DOMAIN_ALREADY_CONTAINS_THE_DISK); } } return true; }
Source:
<code>public void handle(EntityIndexingFailureContext context) { String failingOperationDescription = context.getFailingOperation().toString(); Throwable throwable = context.getThrowable(); List<String> uncommittedOperationsDescriptions = new ArrayList<>(); for ( Object entityReference : context.getEntityReferences() ) { <START> uncommittedOperationsDescriptions.add( entityReference.toString() ); <END> } }</code><technical_language>name this variable entityReferencesDescriptions</technical_language>

Target:
public void handle(EntityIndexingFailureContext context) { String failingOperationDescription = context.getFailingOperation().toString(); Throwable throwable = context.getThrowable(); List<String> entityReferencesAsStrings = new ArrayList<>(); for ( Object entityReference : context.getEntityReferences() ) { entityReferencesAsStrings.add( entityReference.toString() ); } }
Source:
<code>protected Election createElectionAlgorithm(int electionAlgorithm){ Election le=null; switch (electionAlgorithm) { case 1: le = new AuthFastLeaderElection(this); break; case 2: le = new AuthFastLeaderElection(this, true); break; case 3: qcm = new QuorumCnxManager(this, <START> ExponentialBackoffStrategy.builder().build()); <END> QuorumCnxManager.Listener listener = qcm.listener; if(listener != null){ listener.start(); FastLeaderElection fle = new FastLeaderElection(this, qcm); fle.start(); le = fle; } else { LOG.error("Null listener when initializing cnx manager"); } break; default: assert false; } return le; }</code><technical_language>find a this pluggable? read backoff strategy a java system property</technical_language>

Target:
protected Election createElectionAlgorithm(int electionAlgorithm){ Election le=null; switch (electionAlgorithm) { case 1: le = new AuthFastLeaderElection(this); break; case 2: le = new AuthFastLeaderElection(this, true); break; case 3: qcm = new QuorumCnxManager(this, buildBackoffStrategy()); QuorumCnxManager.Listener listener = qcm.listener; if(listener != null){ listener.start(); FastLeaderElection fle = new FastLeaderElection(this, qcm); fle.start(); le = fle; } else { LOG.error("Null listener when initializing cnx manager"); } break; default: assert false; } return le; }
Source:
<code>protected boolean useDirectReplyTo() { if (this.useTemporaryReplyQueues) { if (this.replyAddress != null) { logger.warn("'useTemporaryReplyQueues' is ignored when a 'replyAddress' is provided"); } else { return false; } } if (this.replyAddress == null || Address.AMQ_RABBITMQ_REPLY_TO.equals(this.replyAddress)) { try { doExecute(channel -> { channel.queueDeclarePassive(Address.AMQ_RABBITMQ_REPLY_TO); return null; <START> }, true); <END> return true; } catch (Exception e) { if (logger.isDebugEnabled()) { logger.warn("Broker does not support fast replies via 'amq.rabbitmq.reply-to', temporary " + "queues will be used:" + e.getMessage() + "."); } this.replyAddress = null; } } return false; }</code><technical_language>is true explicit</technical_language>

Target:
protected boolean useDirectReplyTo() { if (this.useTemporaryReplyQueues) { if (this.replyAddress != null) { logger.warn("'useTemporaryReplyQueues' is ignored when a 'replyAddress' is provided"); } else { return false; } } if (this.replyAddress == null || Address.AMQ_RABBITMQ_REPLY_TO.equals(this.replyAddress)) { try { execute(channel -> { channel.queueDeclarePassive(Address.AMQ_RABBITMQ_REPLY_TO); return null; }); return true; } catch (Exception e) { if (logger.isDebugEnabled()) { logger.warn("Broker does not support fast replies via 'amq.rabbitmq.reply-to', temporary " + "queues will be used:" + e.getMessage() + "."); } this.replyAddress = null; } } return false; }
Source:
<code>private boolean isClozeType() { int noteModelType; try { noteModelType = getCurrentlySelectedModel().getInt("type"); <START> } catch (JSONException e) { <END> throw new RuntimeException(e); } return noteModelType == Consts.MODEL_CLOZE; }</code><technical_language>I thought of changed com.ichi2.anki JSON classes avoid try/catch throw RuntimException anyway? #5550</technical_language>

Target:
private boolean isClozeType() { return getCurrentlySelectedModel().getInt("type") == Consts.MODEL_CLOZE; }
Source:
<code>private Boolean noSearchesOverlap(ArrayList<RegexSearch> performedSearches, HashMap<Integer,ArrayList<Rectangle>> nonOverlappingSections, ArrayList<Rectangle> totalSubsections, Integer pageNum, BufferedWriter loggingBufferedWriter){ ArrayList<RegexSearch> verifiedSearches = new ArrayList<RegexSearch>(); for (RegexSearch performedSearch: performedSearches){ try { loggingBufferedWriter.write("START REGEX: " + performedSearch.getRegexBeforeTable() + "\t\t"); loggingBufferedWriter.write("END REGEX: " + performedSearch.getRegexAfterTable()); loggingBufferedWriter.newLine(); } catch (IOException e) { e.printStackTrace(); } List<Rectangle> potSubsections = performedSearch.getSubSectionsForPage(pageNum, loggingBufferedWriter); technology.tabula.Pair<Boolean,String> overlapDetectionStatus = subSectionOverlapDetected(potSubsections,nonOverlappingSections.get(pageNum),verifiedSearches,pageNum); if(overlapDetectionStatus.getLeft()){ <START> System.out.println("For Search: (" + performedSearch.getRegexBeforeTable() + "," + <END> performedSearch.getRegexAfterTable() + ")"); System.out.println(overlapDetectionStatus.getRight()); try { loggingBufferedWriter.write(overlapDetectionStatus.getRight()); } catch (IOException e) { e.printStackTrace(); } return false; } else{ verifiedSearches.add(performedSearch); nonOverlappingSections.get(pageNum).addAll(potSubsections); totalSubsections.addAll(potSubsections); } } return true; }</code><technical_language>writes stdout please</technical_language>

Target:
private Boolean noSearchesOverlap(ArrayList<RegexSearch> performedSearches, HashMap<Integer,ArrayList<Rectangle>> nonOverlappingSections, ArrayList<Rectangle> totalSubsections, Integer pageNum, BufferedWriter loggingBufferedWriter){ ArrayList<RegexSearch> verifiedSearches = new ArrayList<RegexSearch>(); for (RegexSearch performedSearch: performedSearches){ try { loggingBufferedWriter.write("START REGEX: " + performedSearch.getRegexBeforeTable() + "\t\t"); loggingBufferedWriter.write("END REGEX: " + performedSearch.getRegexAfterTable()); loggingBufferedWriter.newLine(); } catch (IOException e) { e.printStackTrace(); } List<Rectangle> potSubsections = performedSearch.getSubSectionsForPage(pageNum, loggingBufferedWriter); technology.tabula.Pair<Boolean,String> overlapDetectionStatus = subSectionOverlapDetected(potSubsections,nonOverlappingSections.get(pageNum),verifiedSearches,pageNum); if(overlapDetectionStatus.getLeft()){ try { loggingBufferedWriter.write(overlapDetectionStatus.getRight()); } catch (IOException e) { e.printStackTrace(); } return false; } else{ verifiedSearches.add(performedSearch); nonOverlappingSections.get(pageNum).addAll(potSubsections); totalSubsections.addAll(potSubsections); } } return true; }
Source:
<code><START> public CharSequence toXML(XmlEnvironment xmlEnvironment) { <END> XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment); xml.rightAngleBracket(); Iterator<Caps2HashElement> iterator = hashes.iterator(); while (iterator.hasNext()) { xml.append(iterator.next()); } xml.closeElement(ELEMENT); return xml; }</code><technical_language>Change method signature return XmlStringBuilder instead of CharSequence</technical_language>

Target:
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment); xml.rightAngleBracket(); Iterator<Caps2HashElement> iterator = hashes.iterator(); while (iterator.hasNext()) { xml.append(iterator.next()); } xml.closeElement(ELEMENT); return xml; }
Source:
<code>public static String getStatusText(Status status) { switch (status) { case OK: return UIText.RebaseResultDialog_StatusOK; case ABORTED: return UIText.RebaseResultDialog_StatusAborted; case STOPPED: return UIText.RebaseResultDialog_StatusStopped; case FAILED: return UIText.RebaseResultDialog_StatusFailed; <START> case UP_TO_DATE: <END> return UIText.RebaseResultDialog_StatusUpToDate; case FAST_FORWARD: return UIText.RebaseResultDialog_StatusFastForward; case NOTHING_TO_COMMIT: return UIText.RebaseResultDialog_StatusNothingToCommit; default: throw new IllegalStateException(status.name()); } }</code><technical_language>is entry for CONFLICTS</technical_language>

Target:
public static String getStatusText(Status status) { switch (status) { case OK: return UIText.RebaseResultDialog_StatusOK; case ABORTED: return UIText.RebaseResultDialog_StatusAborted; case STOPPED: return UIText.RebaseResultDialog_StatusStopped; case FAILED: return UIText.RebaseResultDialog_StatusFailed; case CONFLICTS: return UIText.RebaseResultDialog_StatusConflicts; case UP_TO_DATE: return UIText.RebaseResultDialog_StatusUpToDate; case FAST_FORWARD: return UIText.RebaseResultDialog_StatusFastForward; case NOTHING_TO_COMMIT: return UIText.RebaseResultDialog_StatusNothingToCommit; } return status.toString(); }
Source:
<code>public Set<AutoscaleStackV4Response> getAllForAutoscale() { try { return transactionService.required(() -> { Set<AutoscaleStack> aliveOnes = stackRepository.findAliveOnesWithAmbari(); Set<AutoscaleStack> aliveNotUnderDeletion = Optional.ofNullable(aliveOnes).orElse(Set.of()).stream() .filter(stack -> !DELETE_IN_PROGRESS.equals(stack.getStackStatus())) .collect(Collectors.toSet()); return converterUtil.convertAllAsSet(aliveNotUnderDeletion, AutoscaleStackV4Response.class); }); } catch (TransactionExecutionException e) { throw new TransactionRuntimeExecutionException(e); } <START> } <END></code><technical_language>removed this</technical_language>

Target:
public Set<AutoscaleStackV4Response> getAllForAutoscale() { try { return transactionService.required(() -> { Set<AutoscaleStack> aliveOnes = stackRepository.findAliveOnesWithClusterManager(); Set<AutoscaleStack> aliveNotUnderDeletion = Optional.ofNullable(aliveOnes).orElse(Set.of()).stream() .filter(stack -> !DELETE_IN_PROGRESS.equals(stack.getStackStatus())) .collect(Collectors.toSet()); return converterUtil.convertAllAsSet(aliveNotUnderDeletion, AutoscaleStackV4Response.class); }); } catch (TransactionExecutionException e) { throw new TransactionRuntimeExecutionException(e); } }
Source:
<code>private Router getRouter() throws Exception { AccountServiceFactory accountServiceFactory = Utils.getObj("com.github.ambry.account.HelixAccountServiceFactory", verifiableProperties, registry); accountService = accountServiceFactory.getAccountService(); <START> notifier = ((HelixAccountService) accountService).getNotifier(); <END> ClusterMapConfig clusterMapConfig = new ClusterMapConfig(verifiableProperties); ClusterAgentsFactory clusterAgentsFactory = Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig, "", ""); clusterMap = clusterAgentsFactory.getClusterMap(); SSLFactory sslFactory = getSSLFactoryIfRequired(); RouterFactory routerFactory = Utils.getObj("com.github.ambry.router.NonBlockingRouterFactory", verifiableProperties, clusterMap, new LoggingNotificationSystem(), sslFactory, accountService); router = routerFactory.getRouter(); return router; }</code><technical_language>Instead of duplicating notification logic in this tool, HelixAccountService.updateAccounts implement updateAccounts method</technical_language>

Target:
private Router getRouter() throws Exception { AccountServiceFactory accountServiceFactory = Utils.getObj("com.github.ambry.account.HelixAccountServiceFactory", verifiableProperties, registry); accountService = (HelixAccountService) accountServiceFactory.getAccountService(); ClusterMapConfig clusterMapConfig = new ClusterMapConfig(verifiableProperties); ClusterAgentsFactory clusterAgentsFactory = Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig, hardwareLayout, partitionLayout); clusterMap = clusterAgentsFactory.getClusterMap(); SSLFactory sslFactory = getSSLFactoryIfRequired(); RouterFactory routerFactory = Utils.getObj("com.github.ambry.router.NonBlockingRouterFactory", verifiableProperties, clusterMap, new LoggingNotificationSystem(), sslFactory, accountService); router = routerFactory.getRouter(); return router; }
Source:
<code>private boolean isValidPosition(Vector3i position) { if (position == null) { return false; } Block targetBlock = worldProvider.getBlock(position); <START> position.y += -1; <END> Block belowBlock = worldProvider.getBlock(position); position.y += 1; return (targetBlock == airBlock && !belowBlock.isPenetrable()); }</code><technical_language>suggestion position.y -= 1;</technical_language>

Target:
private boolean isValidPosition(Vector3i position) { if (position == null) { return false; } Block targetBlock = worldProvider.getBlock(position); position.y -= 1; Block belowBlock = worldProvider.getBlock(position); position.y += 1; return (targetBlock == airBlock && !belowBlock.isPenetrable()); }
Source:
<code>private static String rightPadWithSpaces(String s, int length) { int pad = length - s.length(); if (pad <= 0) { return s; } char[] res = new char[length]; for (int i = 0; i < s.length(); i++) { <START> res[i] = s.charAt(i); <END> } Arrays.fill(res, s.length(), length, ' '); return new String(res); }</code><technical_language>String#getChars faster this loop</technical_language>

Target:
private static String rightPadWithSpaces(String s, int length) { int pad = length - s.length(); if (pad <= 0) { return s; } char[] res = new char[length]; s.getChars(0, s.length(), res, 0); Arrays.fill(res, s.length(), length, ' '); return new String(res); }
Source:
<code>private static boolean isIkvmDotNet0() { <START> String vmName = SystemPropertyUtil.get("java.vm.name", "").toUpperCase(); <END> return vmName.equals("IKVM.NET"); }</code><technical_language>a locale toUpperCase</technical_language>

Target:
private static boolean isIkvmDotNet0() { String vmName = SystemPropertyUtil.get("java.vm.name", "").toUpperCase(Locale.US); return vmName.equals("IKVM.NET"); }
Source:
<code>private static VideoRAMSettings selectVideoRAMSettings(VmBase vmBase) { Version clusterVersion = ClusterUtils.getCompatibilityVersion(vmBase); if(clusterVersion == null) { clusterVersion = Version.getLast(); <START> } <END> if (clusterVersion.greaterOrEquals(new Version(3, 6))) { return new VgamemVideoRAMSettings(); } else { return new LegacyVideoRAMSettings(); } }</code><technical_language>clusterVersion null - if is cluster (which is happen), 3.0 is returned ClusterUtils#getCompatibilityVersion 124-126 is redundant - removed</technical_language>

Target:
private static VideoRAMSettings selectVideoRAMSettings(VmBase vmBase) { if (ClusterUtils.getCompatibilityVersion(vmBase).greaterOrEquals(new Version(3, 6))) { return new VgamemVideoRAMSettings(); } else { return new LegacyVideoRAMSettings(); } }
Source:
<code>public Builder withQuestionDescription(Text questionDescription) { <START> feedbackQuestionAttributes.setQuestionDescription(questionDescription); <END> return this; }</code><technical_language>Sanitize text instead? consider sanitizeForSaving() if sanitation process in build() method</technical_language>

Target:
public Builder withQuestionDescription(Text questionDescription) { if (questionDescription != null) { feedbackQuestionAttributes.setQuestionDescription(questionDescription); } return this; }
Source:
<code>private FreeStyleBuild configureTestBuild(String projectName) throws Exception { <START> FreeStyleProject p = projectName == null ? j.createFreeStyleProject() : j.createFreeStyleProject(projectName); <END> p.getBuildersList().add(new TestBuilder() { @Override @SuppressWarnings("null") public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { build.getWorkspace().child("junit.xml").copyFrom( getClass().getResource("/hudson/tasks/junit/junit-report-20090516.xml")); return true; } }); p.getPublishersList().add(new JUnitResultArchiver("*.xml")); return j.assertBuildStatus(Result.UNSTABLE, p.scheduleBuild2(0).get()); }</code><technical_language>NIT: Overkill IMHO. add <code>@Nonnull</code> annotation forget null params</technical_language>

Target:
private FreeStyleBuild configureTestBuild(String projectName) throws Exception { FreeStyleProject p = j.createFreeStyleProject(projectName); p.getBuildersList().add(new TestBuilder() { @Override @SuppressWarnings("null") public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { build.getWorkspace().child("junit.xml").copyFrom( getClass().getResource("/hudson/tasks/junit/junit-report-20090516.xml")); return true; } }); p.getPublishersList().add(new JUnitResultArchiver("*.xml")); return j.assertBuildStatus(Result.UNSTABLE, p.scheduleBuild2(0).get()); }
Source:
<code>public String toString() { return "DruidDataSource{" + "properties=" + properties + <START> ", partitions=" + getSegments().toString() + <END> '}'; }</code><technical_language>toString() needed</technical_language>

Target:
public String toString() { return "DruidDataSource{" + "properties=" + properties + ", partitions=" + idToSegmentMap.values() + '}'; }
Source:
<code>public boolean apply(Game game, Ability source) { Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (player != null) { <START> for (Permanent nonland: game.getBattlefield().getAllActivePermanents(new FilterNonlandPermanent(), player.getId(), game)) { <END> nonland.untap(game); } return true; } return false; }</code><technical_language>A good case a static filter StaticFilters.FILTER_PERMANENT_NON_LAND</technical_language>

Target:
public boolean apply(Game game, Ability source) { Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (player != null) { for (Permanent nonland: game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_NON_LAND, player.getId(), game)) { nonland.untap(game); } return true; } return false; }
Source:
<code>public void setCustomButtons(Menu menu) { for(int itemId : mCustomButtons.keySet()) { if (mCustomButtons.get(itemId) != MENU_DISABLED) { MenuItem item = menu.findItem(itemId); item.setShowAsAction(mCustomButtons.get(itemId)); Drawable icon = item.getIcon(); if (mReviewerUi.isControlBlocked()) { item.setEnabled(false); } else { item.setEnabled(true); } if (icon != null) { if (mReviewerUi.getControlBlocked() == ReviewerUi.ControlBlock.SLOW) { icon.setAlpha(Themes.ALPHA_ICON_DISABLED_LIGHT); } else { icon.setAlpha(Themes.ALPHA_ICON_ENABLED_LIGHT); } } } else { menu.findItem(itemId).setVisible(false); } } }</code><technical_language>suggestion a heuristic decide next card quickly slowly</technical_language>

Target:
public void setCustomButtons(Menu menu) { for(int itemId : mCustomButtons.keySet()) { if (mCustomButtons.get(itemId) != MENU_DISABLED) { MenuItem item = menu.findItem(itemId); item.setShowAsAction(mCustomButtons.get(itemId)); Drawable icon = item.getIcon(); item.setEnabled(!mReviewerUi.isControlBlocked()); if (icon != null) { if (mReviewerUi.getControlBlocked() == ReviewerUi.ControlBlock.SLOW) { icon.setAlpha(Themes.ALPHA_ICON_DISABLED_LIGHT); } else { icon.setAlpha(Themes.ALPHA_ICON_ENABLED_LIGHT); } } } else { menu.findItem(itemId).setVisible(false); } } }
Source:
<code>private void skip(String msg) { logger.info("Repair skipped: {}", parentSession, msg); <START> fireProgressEvent(new ProgressEvent(ProgressEventType.NOTIFICATION, 100, 100, "Repair " + parentSession + " skipped: " + msg)); <END> success(msg); }</code><technical_language>is valid CFs repaired, a skip event 100/100 progress is fired, another success event progressCounter/totalProgress is fired in success().. progressCounter/totalProgress for skip progress event</technical_language>

Target:
private void skip(String msg) { notification("Repair " + parentSession + " skipped: " + msg); success(msg); }
Source:
<code>protected void executeCommand() { VDS spmVds = LinqUtils.first(LinqUtils.filter(getAllRunningVdssInPool(), new Predicate<VDS>() { @Override public boolean eval(VDS vds) { return vds.getspm_status() == VdsSpmStatus.SPM; } })); final List<LUNs> luns = getHostLuns(spmVds); final Map<String, LUNs> lunsMap = new HashMap<String, LUNs>(); for (LUNs lun : luns) { lunsMap.put(lun.getLUN_id(), lun); } final List<LUNs> processedLunsList = new ArrayList<LUNs>(); for (String lunId : getParameters().getLunIds()) { LUNs lun = lunsMap.get(lunId); if (lun == null) { <START> ((ConnectAllHostsToLunCommandReturnValue)getReturnValue()).setFailedVds(spmVds); <END> ((ConnectAllHostsToLunCommandReturnValue) getReturnValue()).setFailedLun(getDbFacade().getLunDao() .get(lunId)); return; } lun.setvolume_group_id(getStorageDomain().getstorage()); processedLunsList.add(lun); } Pair<Boolean, Map<String, List<Guid>>> result = ConnectVdsToLun(processedLunsList); if (result.getFirst()) { getReturnValue().setActionReturnValue(processedLunsList); setCommandShouldBeLogged(false); setSucceeded(true); } else { Map<String, List<Guid>> processed = result.getSecond(); for (String lunId : processed.keySet()) { for (Guid vdsId : processed.get(lunId)) { LUNs lun = lunsMap.get(lunId); StorageHelperDirector.getInstance().getItem(getStoragePool().getstorage_pool_type()) .DisconnectStorageFromLunByVdsId(getStorageDomain(), vdsId, lun); } } } }</code><technical_language>a big fan of cast 4 times - override return type of getReturnValue()</technical_language>

Target:
protected void executeCommand() { VDS spmVds = LinqUtils.first(LinqUtils.filter(getAllRunningVdssInPool(), new Predicate<VDS>() { @Override public boolean eval(VDS vds) { return vds.getspm_status() == VdsSpmStatus.SPM; } })); final List<LUNs> luns = getHostLuns(spmVds); final Map<String, LUNs> lunsMap = new HashMap<String, LUNs>(); for (LUNs lun : luns) { lunsMap.put(lun.getLUN_id(), lun); } final List<LUNs> processedLunsList = new ArrayList<LUNs>(); for (String lunId : getParameters().getLunIds()) { LUNs lun = lunsMap.get(lunId); if (lun == null) { final ConnectAllHostsToLunCommandReturnValue result = getResult(); result.setFailedVds(spmVds); result.setFailedLun(getDbFacade().getLunDao() .get(lunId)); return; } lun.setvolume_group_id(getStorageDomain().getstorage()); processedLunsList.add(lun); } Pair<Boolean, Map<String, List<Guid>>> result = ConnectVdsToLun(processedLunsList); if (result.getFirst()) { getReturnValue().setActionReturnValue(processedLunsList); setCommandShouldBeLogged(false); setSucceeded(true); } else { Map<String, List<Guid>> processed = result.getSecond(); for (String lunId : processed.keySet()) { for (Guid vdsId : processed.get(lunId)) { LUNs lun = lunsMap.get(lunId); StorageHelperDirector.getInstance().getItem(getStoragePool().getstorage_pool_type()) .DisconnectStorageFromLunByVdsId(getStorageDomain(), vdsId, lun); } } } }
Source:
<code>private void resetScope() { MortarScope root = <START> Mortar.createRootScope(false, ObjectGraph.create(new ModuleAndBlueprint("root"))); <END> activityScope = Mortar.requireActivityScope(root, new ModuleAndBlueprint("activity")); }</code><technical_language>static import of createRootScope, requireActivityScope below</technical_language>

Target:
private void resetScope() { MortarScope root = createRootScope(false, ObjectGraph.create(new ModuleAndBlueprint("root"))); activityScope = requireActivityScope(root, new ModuleAndBlueprint("activity")); }
Source:
<code>public void saveOrder_shouldFailDrugOrderWithoutADrugNonCodedWhenDrugOrderIsNonCoded() throws Exception { Patient patient = Context.getPatientService().getPatient(7); CareSetting careSetting = Context.getOrderService().getCareSetting(2); OrderType orderType = Context.getOrderService().getOrderTypeByName("Drug order"); assertNull(Context.getAdministrationService().getGlobalPropertyObject( OpenmrsConstants.GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_DRUG)); DrugOrder order = new DrugOrder(); Encounter encounter = Context.getEncounterService().getEncounter(3); order.setEncounter(encounter); order.setConcept(Context.getOrderService().getNonCodedDrugConcept()); order.setPatient(patient); order.setCareSetting(careSetting); order.setOrderer(Context.getProviderService().getProvider(1)); order.setDateActivated(encounter.getEncounterDatetime()); order.setOrderType(orderType); order.setDosingType(FreeTextDosingInstructions.class); order.setInstructions("None"); order.setDosingInstructions("Test Instruction"); Errors errors = new BindException(order, "order"); new DrugOrderValidator().validate(order, errors); Assert.assertTrue(errors.hasFieldErrors()); <START> assertEquals("DrugOrder.error.cannotSetBothDrugAndNonCodedDrug", errors.getFieldError("concept").getCode()); <END> }</code><technical_language>test method fail if drug coded is set error message "DrugOrder.error.cannotSetBothDrugAndNonCodedDrug", contradictory</technical_language>

Target:
public void saveOrder_shouldFailDrugOrderWithoutADrugNonCodedWhenDrugOrderIsNonCoded() throws Exception { executeDataSet("org/openmrs/api/include/OrderServiceTest-nonCodedDrugs.xml"); Patient patient = Context.getPatientService().getPatient(7); CareSetting careSetting = Context.getOrderService().getCareSetting(2); OrderType orderType = Context.getOrderService().getOrderTypeByName("Drug order"); GlobalProperty gp = new GlobalProperty(OpenmrsConstants.GLOBAL_PROPERTY_DRUG_ORDER_REQUIRE_DRUG, "true"); Context.getAdministrationService().saveGlobalProperty(gp); DrugOrder order = new DrugOrder(); Encounter encounter = Context.getEncounterService().getEncounter(3); order.setEncounter(encounter); order.setConcept(Context.getOrderService().getNonCodedDrugConcept()); order.setPatient(patient); order.setCareSetting(careSetting); order.setOrderer(Context.getProviderService().getProvider(1)); order.setDateActivated(encounter.getEncounterDatetime()); order.setOrderType(orderType); order.setDosingType(FreeTextDosingInstructions.class); order.setInstructions("None"); order.setDosingInstructions("Test Instruction"); Errors errors = new BindException(order, "order"); new DrugOrderValidator().validate(order, errors); Assert.assertTrue(errors.hasFieldErrors()); assertEquals("DrugOrder.error.drugNonCodedIsRequired", errors.getFieldError("drugNonCoded").getCode()); }
Source:
<code>private void closeResource(@Nullable final SymbolicValue target) { ObjectConstraint openConstraint = null; if (target != null) { openConstraint = programState.getConstraintWithStatus(target, Status.OPENED); if (openConstraint != null) { programState = programState.addConstraint(target.wrappedValue(), openConstraint.withStatus(Status.CLOSED)); } } if (openConstraint == null) { <START> Optional<SymbolicValue> closeableParameter = closeableParameters.stream().filter(sv -> sv == target).findAny(); <END> if (!closeableParameter.isPresent()) { return; } Constraint constraint = programState.getConstraint(target); if (constraint == null) { programState = programState.addConstraint(target, new ObjectConstraint(false, false, null, Status.CLOSED)); } else if (constraint instanceof ObjectConstraint) { programState = programState.addConstraint(target, ((ObjectConstraint) constraint).withStatus(Status.CLOSED)); } } }</code><technical_language>![MAJOR](<LINK_1> Change this comparison equals method. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private void closeResource(@Nullable final SymbolicValue target) { ObjectConstraint openConstraint = null; if (target != null) { openConstraint = programState.getConstraintWithStatus(target, Status.OPENED); if (openConstraint != null) { programState = programState.addConstraint(target.wrappedValue(), openConstraint.withStatus(Status.CLOSED)); } } if (openConstraint == null) { Optional<SymbolicValue> closeableParameter = closeableParameters.stream().filter(sv -> sv == target).findAny(); if (!closeableParameter.isPresent()) { return; } Constraint constraint = programState.getConstraint(target); if (constraint instanceof ObjectConstraint) { programState = programState.addConstraint(target, ((ObjectConstraint) constraint).withStatus(Status.CLOSED)); } else if (constraint == null) { ProgramState nullProgramState = programState.addConstraint(target, ObjectConstraint.nullConstraint()); context.addTransition(nullProgramState); programState = programState.addConstraint(target, new ObjectConstraint(false, false, null, Status.CLOSED)); } } }
Source:
<code>public void visitLiteral(LiteralTree tree) { if (tree.is(Tree.Kind.REGULAR_STRING_LITERAL)) { String literalValue = trimQuotes(tree.value()); IP.reset(literalValue); if (IP.matches()) { String ip = IP.group("ip"); <START> if (Arrays.stream(ip.split(".")).mapToInt(Integer::parseInt).allMatch(i -> i < 255) <END> && !isLocalhost(literalValue)) { context().newIssue(this, tree, MESSAGE); } } } super.visitLiteral(tree); }</code><technical_language>This condition is true "." is a regular expression. Moreover, miss a unit test part of IP is more 255</technical_language>

Target:
public void visitLiteral(LiteralTree tree) { if (tree.is(Tree.Kind.REGULAR_STRING_LITERAL)) { String literalValue = trimQuotes(tree.value()); Matcher matcher = IP.matcher(literalValue); if (matcher.matches()) { String ip = matcher.group("ip"); if (Arrays.stream(ip.split("\\.")).mapToInt(Integer::parseInt).allMatch(i -> i < 255) && !isLocalhost(ip)) { context().newIssue(this, tree, MESSAGE); } } } super.visitLiteral(tree); }
Source:
<code>public LinkPreviewFunnel(WikipediaApp app, PageTitle title) { super(app, SCHEMA_NAME, REV_ID); previewSessionToken = UUID.randomUUID().toString(); appInstallID = app.getAppInstallID(); this.title = title; <START> version = app.getAppInstallIDInt() % linkPreviewToggleWeight > 1 ? 0 : app.getAppInstallIDInt() % linkPreviewToggleWeight + 1; <END> }</code><technical_language>Pretty minor mind adding some parentheses arithmetic? :) Is a divide zero error</technical_language>

Target:
public LinkPreviewFunnel(WikipediaApp app, PageTitle title) { super(app, SCHEMA_NAME, REV_ID); previewSessionToken = UUID.randomUUID().toString(); appInstallID = app.getAppInstallID(); this.title = title; version = ( ( app.getAppInstallIDInt() % LINK_PREVIEW_TOGGLE_WEIGHT ) == 3 ) ? 0 : ( app.getAppInstallIDInt() % LINK_PREVIEW_TOGGLE_WEIGHT ); }
Source:
<code>public EditorTopComponent() { initComponents(); setName(Bundle.CTL_EditorTopComponent()); setDisplayName("welcome.tex"); setToolTipText(Bundle.HINT_EditorTopComponent()); putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE); putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, Boolean.TRUE); ApplicationSettings.INSTANCE.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(ApplicationSettings.AUTOCOMPLETE_DELAY) && autoCompletion != null) { autoCompletion.setAutoActivationDelay((Integer) evt.getNewValue()); <START> } else if (evt.getPropertyName().equals(ApplicationSettings.LINEWRAP_STATUS) && rSyntaxTextArea != null) { <END> rSyntaxTextArea.setLineWrap((Boolean) evt.getNewValue()); } } }); displayCloudStatus(); }</code><technical_language>honest, feel more confident merging changes, of settings migrated new system. this point easy for figure out final result like. I hold other tickets adding/editing properties for sake of finishing this (we do of anyways)</technical_language>

Target:
public EditorTopComponent() { initComponents(); setName(Bundle.CTL_EditorTopComponent()); setDisplayName("welcome.tex"); setToolTipText(Bundle.HINT_EditorTopComponent()); putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE); putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, Boolean.TRUE); displayCloudStatus(); }
Source:
<code>private PaxosTimestampCreator getPaxosTimestampCreator(MetricRegistry metrics) { Map<ClientAwarePaxosAcceptor, ExecutorService> paxosAcceptors = createClientAwarePaxosAcceptors(); Map<ClientAwarePaxosLearner, ExecutorService> paxosLearners = createClientAwarePaxosLearners(); return new PaxosTimestampCreator( metrics, paxosResource, Suppliers.compose(TimeLockRuntimeConfiguration::paxos, runtime::get), <START> client -> KeyedStream.stream(paxosAcceptors) <END> .<PaxosAcceptor>mapKeys(acceptor -> new ClientAwarePaxosAcceptorAdapter(client, acceptor)) .collectToMap(), client -> KeyedStream.stream(paxosLearners) .<PaxosLearner>mapKeys(learner -> new ClientAwarePaxosLearnerAdapter(client, learner)) .collectToMap(), sharedExecutor); }</code><technical_language>if strict, creating client aware learners/acceptors is a separate change is worth in PR</technical_language>

Target:
private PaxosTimestampCreator getPaxosTimestampCreator(MetricRegistry metrics) { List<ClientAwarePaxosAcceptor> paxosAcceptors = createProxies(ClientAwarePaxosAcceptor.class, "timestamp-bound-store.acceptor"); List<ClientAwarePaxosLearner> paxosLearners = createProxies(ClientAwarePaxosLearner.class, "timestamp-bound-store.learner"); return new PaxosTimestampCreator( metrics, paxosResource, Suppliers.compose(TimeLockRuntimeConfiguration::paxos, runtime::get), ClientAwarePaxosAcceptorAdapter.wrap(paxosAcceptors), ClientAwarePaxosLearnerAdapter.wrap(paxosLearners), sharedExecutor); }
Source:
<code>public List<String> getSeedNodes() { return newArrayList(from(clusterState.nodes()) .filter(new Predicate<CassandraNode>() { @Override public boolean apply(CassandraNode v) { <START> return v.getSeed(); <END> } }) .transform(CassandraFrameworkProtosUtils.cassandraNodeToIp())); }</code><technical_language>Give this comparison is a constant, please create a class a singleton instance create a static final field this implementation</technical_language>

Target:
public List<String> getSeedNodes() { return CassandraFrameworkProtosUtils.getSeedNodeIps(clusterState.nodes()); }
Source:
<code>public BooleanSupplier parse(JsonContext context, JsonObject json) { String value = JsonUtils.getString(json, "feature"); String name = configToEnum.convert(value); Features feature; try { feature = Features.valueOf(name); } catch (IllegalArgumentException e) { <START> throw new JsonSyntaxException("Unknown feature: " + value); <END> } return feature::enabled; }</code><technical_language>Oops, JsonParseException</technical_language>

Target:
public BooleanSupplier parse(JsonContext context, JsonObject json) { String value = JsonUtils.getString(json, "feature"); String name = configToEnum.convert(value); Features feature; try { feature = Features.valueOf(name); } catch (IllegalArgumentException e) { throw new JsonParseException("Unknown feature: " + value); } return feature::enabled; }
Source:
<code>public ExecutorLifecycle( ExecutorLifecycleConfig taskExecutorConfig, TaskConfig taskConfig, TaskActionClientFactory taskActionClientFactory, TaskRunner taskRunner, ObjectMapper jsonMapper ) { this.taskExecutorConfig = taskExecutorConfig; this.taskConfig = taskConfig; this.taskActionClientFactory = taskActionClientFactory; this.taskRunner = taskRunner; <START> this.jsonMapper = new DefaultObjectMapper((DefaultObjectMapper) jsonMapper).addMixIn(PasswordProvider.class, PasswordProviderRedactionMixIn.class); <END> }</code><technical_language>please explain this change is needed? KinesisIndexTask is PasswordProvider, work this change</technical_language>

Target:
public ExecutorLifecycle( ExecutorLifecycleConfig taskExecutorConfig, TaskConfig taskConfig, TaskActionClientFactory taskActionClientFactory, TaskRunner taskRunner, ObjectMapper jsonMapper ) { this.taskExecutorConfig = taskExecutorConfig; this.taskConfig = taskConfig; this.taskActionClientFactory = taskActionClientFactory; this.taskRunner = taskRunner; this.jsonMapper = jsonMapper.copy().addMixIn(PasswordProvider.class, PasswordProviderRedactionMixIn.class); }
Source:
<code>public TaskAnnouncementTest() { TestUtils testUtils = new TestUtils(); jsonMapper = testUtils.getTestObjectMapper(); final File baseDir = new File("lol"); baseDir.mkdir(); <START> baseDir.deleteOnExit(); <END> }</code><technical_language>this for? a @Rule TemporaryFolder instead? preferred for temporary directories files needed tests</technical_language>

Target:
public TaskAnnouncementTest() { TestUtils testUtils = new TestUtils(); jsonMapper = testUtils.getTestObjectMapper(); }
Source:
<code>public LibraryInfo( OrganizationalUnit defaultOrganizationUnit, OrganizationalUnit selectedOrganizationUnit, Set<Project> projects, Collection<OrganizationalUnit> organizationUnits, String ouAlias) { <START> this.defaultOrganizationUnit = defaultOrganizationUnit; <END> this.selectedOrganizationUnit = selectedOrganizationUnit; this.projects = projects; this.organizationUnits = organizationUnits; this.ouAlias = ouAlias; }</code><technical_language>Is worth null checks</technical_language>

Target:
public LibraryInfo( OrganizationalUnit defaultOrganizationUnit, OrganizationalUnit selectedOrganizationUnit, Set<Project> projects, Collection<OrganizationalUnit> organizationUnits, String ouAlias) { checkNotNull( "defaultOrganizationUnit", defaultOrganizationUnit ); checkNotNull( "selectedOrganizationUnit", selectedOrganizationUnit ); checkNotNull( "projects", projects ); checkNotNull( "organizationUnits", organizationUnits ); checkNotNull( "ouAlias", ouAlias ); this.defaultOrganizationUnit = defaultOrganizationUnit; this.selectedOrganizationUnit = selectedOrganizationUnit; this.projects = projects; this.organizationUnits = organizationUnits; this.ouAlias = ouAlias; }
Source:
<code>public boolean isUserHasAccessToStudyOrSiteForStudy(List<StudyUserRoleBean> userRoles, String studyOid){ Study study = studyDao.findPublicStudy(studyOid); Study tempPublicStudy = null; for (StudyUserRoleBean userRole : userRoles) { tempPublicStudy = study; if(Role.siteRoleMap.containsKey(userRole.getRole().getId())) tempPublicStudy = studyDao.getPublicStudy(userRole.getStudyId()); <START> if (study.getStudyId() == tempPublicStudy.getStudyId() || (tempPublicStudy.isSite() && study.getStudyId() == tempPublicStudy.getStudy().getStudyId())) { <END> return true; } } return false; }</code><technical_language>I logic for check userRole.getStudyId in case of study-level role</technical_language>

Target:
public boolean isUserHasAccessToStudyOrSiteForStudy(List<StudyUserRoleBean> userRoles, String studyOid){ Study study = studyDao.findPublicStudy(studyOid); Study tempPublicStudy = null; for (StudyUserRoleBean userRole : userRoles) { tempPublicStudy = null; if(Role.siteRoleMap.containsKey(userRole.getRole().getId())) tempPublicStudy = studyDao.getPublicStudy(userRole.getStudyId()); if (study.getStudyId() == userRole.getStudyId() || (tempPublicStudy != null && tempPublicStudy.isSite() && study.getStudyId() == tempPublicStudy.getStudy().getStudyId())) { return true; } } return false; }
Source:
<code>public String getVendorCommoditiesAsString() { StringBuilder sb = new StringBuilder("["); boolean first = true; for (VendorCommodityCode vcc : this.getVendorCommodities()) { if (!first) { sb.append(", "); } else { first = false; } <START> sb.append(vcc.getCommodityCode().getPurchasingCommodityCode()); <END> } sb.append(']'); return sb.toString(); }</code><technical_language>I this is a line customized for KFSPTS-3487 enhancement. This changed KualiCo version of line customization is longer needed</technical_language>

Target:
public String getVendorCommoditiesAsString() { StringBuilder sb = new StringBuilder("["); boolean first = true; for (VendorCommodityCode vcc : this.getVendorCommodities()) { if (!first) { sb.append(", "); } else { first = false; } sb.append(vcc.getCommodityCode().getCommodityDescription()); } sb.append(']'); return sb.toString(); }
Source:
<code>public void removeNotificationListener( ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) { <START> throw new UnsupportedOperationException("removeNotificationListener not supported for Jolokia"); <END> }</code><technical_language>suggestion throw new UnsupportedOperationException("removeNotificationListener supported Jolokia");</technical_language>

Target:
public void removeNotificationListener( ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) { throw new UnsupportedOperationException("removeNotificationListener not supported by Jolokia"); }
Source:
<code>public OutputStream getOutputStream() { try { return channel.getOutputStream(); } catch (IOException e) { <START> e.printStackTrace(); <END> return null; } }</code><technical_language>Exception logged</technical_language>

Target:
public OutputStream getOutputStream() { try { return channel.getOutputStream(); } catch (IOException e) { Activator.log(e); return null; } }
Source:
<code>private void addNewColumnsForAggregation() throws StandardException{ aggInfo=new AggregatorInfoList(); List<SubstituteExpressionVisitor> havingRefsToSubstitute=null; <START> VirtualColumnNode vcForGroupingFunction = null; <END> if(groupingList!=null){ List<SubstituteExpressionVisitor> referencesToSubstitute=new ArrayList<SubstituteExpressionVisitor>(); havingRefsToSubstitute=addUnAggColumns(referencesToSubstitute); if (groupingList.isRollup()) { addGroupingIdColumnAndUpdateGroupingFunction(); } for(SubstituteExpressionVisitor refVisistor : referencesToSubstitute) parent.getResultColumns().accept(refVisistor); } addAggregateColumns(); if(havingClause!=null){ if(havingRefsToSubstitute!=null){ for(SubstituteExpressionVisitor refVisitor : havingRefsToSubstitute){ havingClause.accept(refVisitor); } } CollectNodesVisitor collectNodesVisitor=new CollectNodesVisitor(ColumnReference.class,AggregateNode.class); havingClause.accept(collectNodesVisitor); for(Object o : collectNodesVisitor.getList()){ ColumnReference cr=(ColumnReference)o; if(!(cr.getGeneratedToReplaceAggregate() || cr.getGeneratedToReplaceWindowFunctionCall()) && cr.getSourceLevel()==level){ throw StandardException.newException( SQLState.LANG_INVALID_COL_HAVING_CLAUSE, cr.getSQLColumnName()); } } } }</code><technical_language>This variable is anywhere, removed</technical_language>

Target:
private void addNewColumnsForAggregation() throws StandardException{ aggInfo=new AggregatorInfoList(); List<SubstituteExpressionVisitor> havingRefsToSubstitute=null; if(groupingList!=null){ List<SubstituteExpressionVisitor> referencesToSubstitute=new ArrayList<SubstituteExpressionVisitor>(); havingRefsToSubstitute=addUnAggColumns(referencesToSubstitute); if (groupingList.isRollup()) { addGroupingIdColumnAndUpdateGroupingFunction(); } for(SubstituteExpressionVisitor refVisistor : referencesToSubstitute) parent.getResultColumns().accept(refVisistor); } addAggregateColumns(); if(havingClause!=null){ if(havingRefsToSubstitute!=null){ for(SubstituteExpressionVisitor refVisitor : havingRefsToSubstitute){ havingClause.accept(refVisitor); } } CollectNodesVisitor collectNodesVisitor=new CollectNodesVisitor(ColumnReference.class,AggregateNode.class); havingClause.accept(collectNodesVisitor); for(Object o : collectNodesVisitor.getList()){ ColumnReference cr=(ColumnReference)o; if(!(cr.getGeneratedToReplaceAggregate() || cr.getGeneratedToReplaceWindowFunctionCall()) && cr.getSourceLevel()==level){ throw StandardException.newException( SQLState.LANG_INVALID_COL_HAVING_CLAUSE, cr.getSQLColumnName()); } } } }
Source:
<code><START> public AbstractConnectionFactorySpec(C connectionFactory) { <END> this.target = connectionFactory; }</code><technical_language>Typically I do Spec visible for factory methods instantiate. Is purpose this created end-user level</technical_language>

Target:
AbstractConnectionFactorySpec(C connectionFactory) { this.target = connectionFactory; }
Source:
<code>public String toString() { <START> return String.format("Invalid arithmetic operation on %s and %s", type1, type2); <END> }</code><technical_language>a period end of string for consistency</technical_language>

Target:
public String toString() { return String.format("Invalid arithmetic operation on %s and %s.", type1, type2); }
Source:
<code>public boolean hasTag(String tag) { <START> return tags.stream().map(String::toLowerCase).collect(Collectors.toList()).contains(tag.toLowerCase()); <END> }</code><technical_language>I tag is marked NonNull, this is part of public API, accidentally introduce a NPE here. return tags.stream().anyMatch(t -> t.equalsIgnoreCase(tag));</technical_language>

Target:
public boolean hasTag(String tag) { return tags.stream().anyMatch(t -> t.equalsIgnoreCase(tag)); }
Source:
<code>public static <T> T instantiateClass(Class<T> clazz) throws BeanInstantiationException { Assert.notNull(clazz, "Class must not be null"); if (clazz.isInterface()) { throw new BeanInstantiationException(clazz, "Specified class is an interface"); } <START> Constructor<T> ctor = findPrimaryConstructor(clazz); <END> if (ctor == null) { throw new BeanInstantiationException(clazz, "No default constructor found"); } return instantiateClass(ctor); }</code><technical_language>I guess differentiate here: For instantiateClass(Class), deal no-arg default constructor (public non-public) in regular Java case... a non-default unique public constructor findPrimaryConstructor return us. do some straight KotlinDelegate.findPrimaryConstructor clazz.getDeclaredConstructor() right in instantiateClass(Class), public findPrimaryConstructor variant for data binding purposes</technical_language>

Target:
public static <T> T instantiateClass(Class<T> clazz) throws BeanInstantiationException { Assert.notNull(clazz, "Class must not be null"); if (clazz.isInterface()) { throw new BeanInstantiationException(clazz, "Specified class is an interface"); } try { Constructor<T> ctor = (kotlinPresent && isKotlinClass(clazz) ? KotlinDelegate.findPrimaryConstructor(clazz) : clazz.getDeclaredConstructor()); if (ctor == null) { throw new BeanInstantiationException(clazz, "No default constructor found"); } return instantiateClass(ctor); } catch (NoSuchMethodException ex) { throw new BeanInstantiationException(clazz, "No default constructor found", ex); } }