auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static boolean setDiskAlias(BaseDisk disk, VM vm, int count) { if (disk != null) { String vmName = nullSafeGetVmName(vm); disk.setDiskAlias(getSuggestedDiskAlias(disk, vmName, count)); return true; } else { log.errorFormat("Disk object is null"); return false; } }

Target:
public static boolean setDiskAlias(BaseDisk disk, VM vm, int count) { if (disk == null) { log.errorFormat("Disk object is null"); return false; } String vmName = nullSafeGetVmName(vm); disk.setDiskAlias(getSuggestedDiskAlias(disk, vmName, count)); return true; }
Source:
private void assertOperators(Collection<Operator> operators) { Operator o = list(operators).get(0); assertEquals("RUT:Operator:130c", o.getId().getId()); assertEquals("Ruter", o.getName()); assertNull( o.getUrl()); assertNull(o.getPhone()); assertEquals(1, operators.size()); }

Target:
private void assertOperators(Collection<Operator> operators) { assertEquals(1, operators.size()); Operator o = list(operators).get(0); assertEquals("RUT:Operator:130c", o.getId().getId()); assertEquals("Ruter", o.getName()); assertNull( o.getUrl()); assertNull(o.getPhone()); }
Source:
public boolean isWatching() { Boolean isWatching = null; if(!chains.isEmpty()) isWatching = getActiveKeyChain().isWatching(); for (ECKey importedKey : getImportedKeys()) { if (isWatching == null) isWatching = importedKey.isWatching(); else if (importedKey.isWatching() != isWatching) throw new IllegalStateException("isWatching() conflict for key " + importedKey); } if (isWatching == null) throw new IllegalStateException("no keys"); return isWatching; }

Target:
public boolean isWatching() { Boolean basicChainIsWatching = basic.isWatching(); Boolean deterministicChainIsWatching = !chains.isEmpty() ? getActiveKeyChain().isWatching() : null; if (basicChainIsWatching == null && deterministicChainIsWatching == null) throw new IllegalStateException("No keys"); if (basicChainIsWatching == null && deterministicChainIsWatching != null) return deterministicChainIsWatching; if (basicChainIsWatching != null && deterministicChainIsWatching == null) return basicChainIsWatching; if (basicChainIsWatching == deterministicChainIsWatching) return deterministicChainIsWatching; if (basicChainIsWatching && !deterministicChainIsWatching) throw new IllegalStateException("Basic chain is watching, deterministic chain is not"); else throw new IllegalStateException("Basic chain is not watching, deterministic chain is"); }
Source:
public void onActivityResult(int requestCode, int resultCode, final Intent data) { if (settingsActivityRequested(requestCode)) { handleSettingsActivityResult(resultCode); } else if (newArticleLanguageSelected(requestCode, resultCode) || galleryPageSelected(requestCode, resultCode)) { handleLangLinkOrPageResult(data); } else if (requestCode == Constants.ACTIVITY_REQUEST_BROWSE_TABS) { if (app.getTabCount() == 0 && resultCode != TabActivity.RESULT_NEW_TAB) { finish(); return; } if (resultCode == TabActivity.RESULT_NEW_TAB) { loadMainPage(TabPosition.NEW_TAB_FOREGROUND); animateTabsButton(); } else if (resultCode == TabActivity.RESULT_LOAD_FROM_BACKSTACK) { pageFragment.reloadFromBackstack(); } } else if (requestCode == Constants.ACTIVITY_REQUEST_IMAGE_CAPTION_EDIT && resultCode == RESULT_OK) { pageFragment.refreshPage(); FeedbackUtil.showMessage(this, getString(R.string.description_edit_success_saved_image_caption_in_lang_snackbar, app.language().getAppLanguageLocalizedName(StringUtils.defaultString(pageFragment.getLeadingImageEditLang())))); } else { super.onActivityResult(requestCode, resultCode, data); } }

Target:
public void onActivityResult(int requestCode, int resultCode, final Intent data) { if (settingsActivityRequested(requestCode)) { handleSettingsActivityResult(resultCode); } else if (newArticleLanguageSelected(requestCode, resultCode) || galleryPageSelected(requestCode, resultCode)) { handleLangLinkOrPageResult(data); } else if (requestCode == Constants.ACTIVITY_REQUEST_BROWSE_TABS) { if (app.getTabCount() == 0 && resultCode != TabActivity.RESULT_NEW_TAB) { finish(); return; } if (resultCode == TabActivity.RESULT_NEW_TAB) { loadMainPage(TabPosition.NEW_TAB_FOREGROUND); animateTabsButton(); } else if (resultCode == TabActivity.RESULT_LOAD_FROM_BACKSTACK) { pageFragment.reloadFromBackstack(); } } else if (requestCode == Constants.ACTIVITY_REQUEST_IMAGE_CAPTION_EDIT && resultCode == RESULT_OK) { pageFragment.refreshPage(); FeedbackUtil.showMessage(this, getString(R.string.description_edit_success_saved_image_caption_in_lang_snackbar, StringUtils.defaultString(app.language().getAppLanguageLocalizedName(pageFragment.getLeadingImageEditLang()), getString(R.string.description_edit_success_saved_image_caption_snackbar)))); } else { super.onActivityResult(requestCode, resultCode, data); } }
Source:
public boolean next() { while ( true ) { if ( bits != 0 ) { int delta = Long.numberOfTrailingZeros( bits ); bits &= bits - 1; if ( client.acceptNode( baseNodeId + delta, null ) ) { return true; } } try { if ( !cursor.next() ) { close(); return false; } } catch ( IOException e ) { throw new UncheckedIOException( e ); } Hit<LabelScanKey,LabelScanValue> hit = cursor.get(); baseNodeId = hit.key().idRange * LabelScanValue.RANGE_SIZE; bits = hit.value().bits; assert keysInOrder( hit.key() ); } }

Target:
public boolean next() { for ( ; ; ) { while ( bits != 0 ) { int delta = Long.numberOfTrailingZeros( bits ); bits &= bits - 1; if ( client.acceptNode( baseNodeId + delta, null ) ) { return true; } } try { if ( !cursor.next() ) { close(); return false; } } catch ( IOException e ) { throw new UncheckedIOException( e ); } Hit<LabelScanKey,LabelScanValue> hit = cursor.get(); baseNodeId = hit.key().idRange * LabelScanValue.RANGE_SIZE; bits = hit.value().bits; assert keysInOrder( hit.key() ); } }
Source:
private void fillDynamicColumnArray() { dynamicName = new String[dynamiColumnLabels.entrySet().size()]; Iterator<?> iterator = dynamiColumnLabels.entrySet().iterator(); int index = 0; while (iterator.hasNext()) { Entry<String, String> map = (Entry<String, String>) iterator.next(); dynamicName[index++] = map.getKey(); } }

Target:
private void fillDynamicColumnArray() { dynamicName = dynamiColumnLabels.values().toArray(new String[dynamiColumnLabels.size()]); }
Source:
public void addRole(String role) { roles.add(new UserRoleEntity(role)); }

Target:
public void addRole(String role) { addRole(new SecurityRoleEntity(role)); }
Source:
public void testAllInclusive() { initValidator(0, 100, true, true); for (int i = validator.getMin(); i <= validator.getMax(); i++) { assertTrue(String.format("%d returned invalid", i), validator.fastValidate(i)); } assertFalse(validator.fastValidate(validator.getMin() - 1)); assertFalse(validator.fastValidate(validator.getMax() + 1)); }

Target:
public void testAllInclusive() { initValidator(0, 100, true, true); assertTrue(String.format("%d returned invalid", 0), validator.fastValidate(0)); assertTrue(String.format("%d returned invalid", 12), validator.fastValidate(12)); assertTrue(String.format("%d returned invalid", 83), validator.fastValidate(83)); assertTrue(String.format("%d returned invalid", 100), validator.fastValidate(100)); assertFalse(validator.fastValidate(0 - 1)); assertFalse(validator.fastValidate(100 + 1)); }
Source:
@Test public void repeatedNamedArgument() { Map<String, Object> map = new HashMap<>(); map.put("text", "tacos"); CodeBlock block = CodeBlock.builder() .addNamed("\"I like \" + $text:S + \". Do you like \" + $text:S + \"?\"", map) .build(); assertThat(block.toString()).isEqualTo( "\"I like \" + \"tacos\" + \". Do you like \" + \"tacos\" + \"?\""); }

Target:
@Test public void repeatedNamedArgument() { Map<String, Object> map = new LinkedHashMap<>(); map.put("text", "tacos"); CodeBlock block = CodeBlock.builder() .addNamed("\"I like \" + $text:S + \". Do you like \" + $text:S + \"?\"", map) .build(); assertThat(block.toString()).isEqualTo( "\"I like \" + \"tacos\" + \". Do you like \" + \"tacos\" + \"?\""); }
Source:
public ExportResponse exportToNegotiator(@RequestBody NegotiatorRequest request) { ResourceBundle i18n = languageService.getBundle(); String redirectUrl = ""; String warning = ""; boolean success = true; NegotiatorEntityConfig entityConfig = getNegotiatorEntityConfig(request.getEntityId()); if (entityConfig != null) { NegotiatorConfig config = entityConfig.getNegotiatorConfig(); LOG.info("NegotiatorRequest\n\n%s\n\nreceived, sending request", request); List<Entity> collectionEntities = getCollectionEntities(request); List<String> disabledCollections = getDisabledCollections(collectionEntities, entityConfig); if (disabledCollections.isEmpty()) { List<Collection> collections = collectionEntities.stream() .map(entity -> getEntityCollection(entityConfig, entity)) .collect(toList()); if (!collections.isEmpty()) { HttpEntity<NegotiatorQuery> queryHttpEntity = getNegotiatorQueryHttpEntity(request, config, collections); postQueryToNegotiator(config, queryHttpEntity); redirectUrl = postQueryToNegotiator(config, queryHttpEntity); } else { success = false; warning = i18n.getString("dataexplorer_directory_no_rows"); } } else { success = false; warning = String.format(i18n.getString("dataexplorer_directory_disabled"), String.join(",", disabledCollections)); } } else { throw new MolgenisDataException(i18n.getString("dataexplorer_directory_no_config")); } return ExportResponse.create(success, warning, redirectUrl); }

Target:
public ExportResponse exportToNegotiator(@RequestBody NegotiatorRequest request) { ResourceBundle i18n = languageService.getBundle(); String redirectUrl = ""; String warning = ""; boolean success = true; NegotiatorEntityConfig entityConfig = getNegotiatorEntityConfig(request.getEntityId()); if (entityConfig != null) { NegotiatorConfig config = entityConfig.getNegotiatorConfig(); LOG.info("NegotiatorRequest\n\n{}\n\nreceived, sending request", request); List<Entity> collectionEntities = getCollectionEntities(request); List<String> disabledCollections = getDisabledCollections(collectionEntities, entityConfig); if (disabledCollections.isEmpty()) { List<Collection> collections = collectionEntities.stream() .map(entity -> getEntityCollection(entityConfig, entity)) .collect(toList()); if (!collections.isEmpty()) { HttpEntity<NegotiatorQuery> queryHttpEntity = getNegotiatorQueryHttpEntity(request, config, collections); postQueryToNegotiator(config, queryHttpEntity); redirectUrl = postQueryToNegotiator(config, queryHttpEntity); } else { success = false; warning = i18n.getString("dataexplorer_directory_no_rows"); } } else { success = false; warning = String.format(i18n.getString("dataexplorer_directory_disabled"), String.join(",", disabledCollections)); } } else { throw new MolgenisDataException(i18n.getString("dataexplorer_directory_no_config")); } return ExportResponse.create(success, warning, redirectUrl); }
Source:
public void triggerTouchUpEvent(long timestamp) { when(timeProvider.elapsedRealtime()).thenReturn(timestamp); when(motionEvent.getAction()).thenReturn(MotionEvent.ACTION_UP); listener.onTouch(imageView, motionEvent, coordinateInterface); }

Target:
public void triggerTouchUpEvent(long timestamp) { when(motionEvent.getEventTime()).thenReturn(timestamp); when(motionEvent.getAction()).thenReturn(MotionEvent.ACTION_UP); when(motionEvent.getRawX()).thenReturn(actionUpMovementPositionX); when(motionEvent.getRawY()).thenReturn(actionUpMovementPositionY); listener.onTouch(imageView, motionEvent, coordinateInterface); }
Source:
public static void compareWorkspaceWithRef(Repository repository, IFile file, String refName, IWorkbenchPage page) throws IOException { final RepositoryMapping mapping = RepositoryMapping.getMapping(file); final String gitPath = mapping.getRepoRelativePath(file); final ITypedElement base = SaveableCompareEditorInput .createFileElement(file); final ObjectId destCommitId = repository.resolve(refName); RevWalk rw = new RevWalk(repository); RevCommit commit = rw.parseCommit(destCommitId); rw.release(); final ITypedElement destCommit = getFileRevisionTypedElement(gitPath, commit, repository); final ITypedElement commonAncestor; if (base != null && commit != null) { final ObjectId headCommitId = repository.resolve(Constants.HEAD); commonAncestor = getFileRevisionTypedElementForCommonAncestor( gitPath, headCommitId, destCommitId, repository); } else { commonAncestor = null; } final GitCompareFileRevisionEditorInput in = new GitCompareFileRevisionEditorInput( base, destCommit, commonAncestor, null); in.getCompareConfiguration().setRightLabel(refName); if (page != null) { openInCompare(page, in); } else { CompareUI.openCompareEditor(in); } }

Target:
public static void compareWorkspaceWithRef(Repository repository, IFile file, String refName, IWorkbenchPage page) throws IOException { final RepositoryMapping mapping = RepositoryMapping.getMapping(file); final String gitPath = mapping.getRepoRelativePath(file); final ITypedElement base = SaveableCompareEditorInput .createFileElement(file); CompareEditorInput in = prepareCompareInput(repository, gitPath, base, refName); if (page != null) openInCompare(page, in); else CompareUI.openCompareEditor(in); }
Source:
public static Resource getResource(final URI resourceURI, final ResourceSet resourceSet) { boolean existsResource = resourceSet.getURIConverter().exists(resourceURI, null); Resource resource = null; if (existsResource) { try { resource = resourceSet.getResource(resourceURI, true); } catch (WrappedException e) { if (ExtenderPlugin.getInstance().isDebugging()) { ExtenderPlugin.getInstance().getLog().log(new Status(IStatus.WARNING, ExtenderPlugin.ID, e.getMessage(), e)); } resource = resourceSet.getResource(resourceURI, false); if (resource != null) { resource.unload(); resourceSet.getResources().remove(resource); } resource = null; } } return resource; }

Target:
public static Resource getResource(final URI resourceURI, final ResourceSet resourceSet) { Resource resource = null; try { resource = resourceSet.getResource(resourceURI, true); } catch (WrappedException e) { if (ExtenderPlugin.getInstance().isDebugging()) { ExtenderPlugin.getInstance().getLog().log(new Status(IStatus.WARNING, ExtenderPlugin.ID, e.getMessage(), e)); } } return resource; }
Source:
private boolean deregisterByType(final T instance) { T removed = instancesByType.remove(instance.getClass()); instances.remove(instance); notifyDeregistered(instance); return removed != null; }

Target:
private boolean deregisterByType(final T instance) { T removed = instancesByType.remove(instance.getClass()); boolean instanceWasRemoved = removed != null; if (instanceWasRemoved) { orderedInstances.remove(removed); notifyDeregistered(removed); } return instanceWasRemoved; }
Source:
public void simulateJobStartAndCancelIt(final List<EligibleTaskDescriptor> tasksToSchedule, final String errorMsg) { infrastructure.getInternalOperationsThreadPool().submit(new Runnable() { public void run() { TerminationData terminationData = jobs.simulateJobStart(tasksToSchedule, errorMsg); try { terminationData.handleTermination(SchedulingService.this); } catch (IOException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } } }); }

Target:
public void simulateJobStartAndCancelIt(final List<EligibleTaskDescriptor> tasksToSchedule, final String errorMsg) { infrastructure.getInternalOperationsThreadPool().submit(new Runnable() { public void run() { TerminationData terminationData = jobs.simulateJobStart(tasksToSchedule, errorMsg); try { terminationData.handleTermination(SchedulingService.this); } catch (Exception e) { logger.error("Exception occurred, fail to get variables into the cleaning script: ", e); } } }); }
Source:
public static boolean declaredBefore(Object obj, IASTNode node, boolean indexBased) { if (node == null) return true; final int pointOfRef= ((ASTNode) node).getOffset() * 2; ASTNode nd = null; if (obj instanceof ICPPSpecialization) { obj = ((ICPPSpecialization) obj).getSpecializedBinding(); } int pointOfDecl= -1; if (obj instanceof ICPPInternalBinding) { ICPPInternalBinding cpp = (ICPPInternalBinding) obj; IASTNode[] n = cpp.getDeclarations(); if (n != null && n.length > 0) { nd = (ASTNode) n[0]; } ASTNode def = (ASTNode) cpp.getDefinition(); if (def != null && (nd == null || def.getOffset() < nd.getOffset())) { nd = def; } if (nd == null) return true; } else { if (indexBased && obj instanceof IASTName) { IBinding b= ((IASTName) obj).getPreBinding(); if (b instanceof ICPPInternalBinding) { if (acceptDeclaredAfter((ICPPInternalBinding) b)) return true; } } if (obj instanceof ASTNode) { nd = (ASTNode) obj; } else if (obj instanceof ICPPUsingDirective) { pointOfDecl= ((ICPPUsingDirective) obj).getPointOfDeclaration() * 2; } } if (pointOfDecl < 0) { if (nd != null) { pointOfDecl = getPointOfDeclaration(nd); } else if (obj instanceof IIndexBinding && !isUsingPromiscuousBindingResolution()) { IIndexBinding indexBinding = ((IIndexBinding) obj); if (indexBinding instanceof ICPPMethod && ((ICPPMethod) indexBinding).isImplicit()) { return true; } IASTTranslationUnit tu = node.getTranslationUnit(); IIndexFileSet indexFileSet = tu.getIndexFileSet(); return (indexFileSet != null && indexFileSet.containsDeclaration(indexBinding)); } } return pointOfDecl < pointOfRef; }

Target:
public static boolean declaredBefore(Object obj, IASTNode node, boolean indexBased) { if (node == null) return true; final int pointOfRef= ((ASTNode) node).getOffset() * 2; ASTNode nd = null; if (obj instanceof ICPPSpecialization) { obj = ((ICPPSpecialization) obj).getSpecializedBinding(); } int pointOfDecl= -1; if (obj instanceof ICPPInternalBinding) { ICPPInternalBinding cpp = (ICPPInternalBinding) obj; IASTNode[] n = cpp.getDeclarations(); if (n != null && n.length > 0) { nd = (ASTNode) n[0]; } ASTNode def = (ASTNode) cpp.getDefinition(); if (def != null && (nd == null || def.getOffset() < nd.getOffset())) { nd = def; } if (nd == null) return true; } else { if (indexBased && obj instanceof IASTName) { IBinding b= ((IASTName) obj).getPreBinding(); if (b instanceof ICPPInternalBinding) { if (acceptDeclaredAfter((ICPPInternalBinding) b)) return true; } } if (obj instanceof ASTNode) { nd = (ASTNode) obj; } else if (obj instanceof ICPPUsingDirective) { pointOfDecl= ((ICPPUsingDirective) obj).getPointOfDeclaration() * 2; } } if (pointOfDecl < 0) { if (nd != null) { pointOfDecl = getPointOfDeclaration(nd); } else if (obj instanceof IIndexBinding && !isUsingPromiscuousBindingResolution()) { IIndexBinding indexBinding = (IIndexBinding) obj; if (indexBinding instanceof ICPPMethod && ((ICPPMethod) indexBinding).isImplicit()) { return true; } IASTTranslationUnit tu = node.getTranslationUnit(); IIndexFileSet indexFileSet = tu.getIndexFileSet(); return (indexFileSet != null && indexFileSet.containsDeclaration(indexBinding)); } } return pointOfDecl < pointOfRef; }
Source:
protected String evalWarnings(final BuildResult result, Collection<FileAnnotation> warnings) { String messages = ""; if (modules.isEmpty()) modules.add("all"); for (String module : modules) { boolean allWarn = module.equals("all"); String heading = module + " annotations:"; String tmp = ""; for (FileAnnotation annotation : warnings) { Priority prio = annotation.getPriority(); if (prio == Priority.LOW && !showLow) continue; if (prio == Priority.NORMAL && !showNormal) continue; if (prio == Priority.HIGH && !showHigh) continue; if (allWarn || annotation.getType().equals(module)) { if (allWarn && verbose) tmp += annotation.getType() + ": "; tmp += createMessage(annotation); } } if (tmp.length() > 0) { String ind = (indent > 0) ? StringUtils.repeat(" ", indent) : ""; messages += ind; messages += heading + "\n"; messages += ind; messages += StringUtils.repeat(linechar, heading.length()) + "\n"; messages += tmp; messages += "\n"; } } return messages; }

Target:
protected String evalWarnings(final BuildResult result, Collection<FileAnnotation> warnings) { StringBuilder message = new StringBuilder(); if (modules.isEmpty()) { modules.add("all"); } for (String module : modules) { boolean allWarn = "all".equals(module); String heading = module + " annotations:"; String tmp = ""; for (FileAnnotation annotation : warnings) { Priority prio = annotation.getPriority(); if (prio == Priority.LOW && !showLow) { continue; } if (prio == Priority.NORMAL && !showNormal) { continue; } if (prio == Priority.HIGH && !showHigh) { continue; } if (allWarn || annotation.getType().equals(module)) { if (allWarn && verbose) { tmp += annotation.getType() + ": "; } tmp += createMessage(annotation); } } if (tmp.length() > 0) { String ind = (indent > 0) ? StringUtils.repeat(" ", indent) : ""; message.append(ind); message.append(heading); message.append("\n"); message.append(ind); message.append(StringUtils.repeat(linechar, heading.length())); message.append("\n"); message.append(tmp); message.append("\n"); } } return message.toString(); }
Source:
private void init() { ThreadPoolUtil.execute(() -> { List<ActionParametersBase> parameters = hostDynamicDao.getIdsOfHostsWithStatus(VDSStatus.Up) .stream() .map(hostId -> new VdsActionParameters(hostId)) .collect(Collectors.toList()); backend.runInternalMultipleActions(ActionType.RefreshHostDevices, parameters); hostDeviceDao.cleanDownVms(); }); }

Target:
private void init() { List<ActionParametersBase> parameters = hostDynamicDao.getIdsOfHostsWithStatus(VDSStatus.Up) .stream() .map(hostId -> new VdsActionParameters(hostId)) .collect(Collectors.toList()); backend.runInternalMultipleActions(ActionType.RefreshHostDevices, parameters); hostDeviceDao.cleanDownVms(); }
Source:
protected org.ovirt.engine.core.common.businessentities.Disk getEntity(int index) { DiskImage entity = new DiskImage(); entity.setId(GUIDS[index]); entity.setvolume_format(VolumeFormat.RAW); entity.setDiskInterface(DiskInterface.VirtIO); entity.setImageStatus(ImageStatus.OK); entity.setvolume_type(VolumeType.Sparse); entity.setBoot(false); entity.setShareable(false); entity.setPropagateErrors(PropagateErrors.On); return setUpStatisticalEntityExpectations(entity); }

Target:
protected org.ovirt.engine.core.common.businessentities.Disk getEntity(int index) { DiskImage entity = new DiskImage(); entity.setId(GUIDS[index]); entity.setvolumeFormat(VolumeFormat.RAW); entity.setDiskInterface(DiskInterface.VirtIO); entity.setImageStatus(ImageStatus.OK); entity.setVolumeType(VolumeType.Sparse); entity.setBoot(false); entity.setShareable(false); entity.setPropagateErrors(PropagateErrors.On); return setUpStatisticalEntityExpectations(entity); }
Source:
static String generateRandomId() { SecureRandom rand = new SecureRandom(); BigInteger intVal = new BigInteger(80, rand); return leftPad(intVal.toString(16), 20, "0"); }

Target:
public static String generateRandomId() { Random random = new Random(); return String.format("%08X", random.nextInt()) + String.format("%08X", random.nextInt()) + String.format("%04X", random.nextInt() & 0xFFFF); }
Source:
static void addMetaInfImplementations(Clazzes clazzes, Clazz clazz, Set<Clazz> compiled, Set<Clazz> compileQueue) throws IOException { String metaInfName = "META-INF/services/" + clazz.getClassName(); for (InputStream is : clazzes.loadResources(metaInfName)) { try (BufferedReader r = new BufferedReader(new InputStreamReader(is))) { for (;;) { String line = r.readLine(); if (line == null) { break; } if (line.startsWith("#")) { continue; } String implClazzName = line.replace('.', '/'); Clazz implClazz = clazzes.load(implClazzName); if (implClazz != null && !compiled.contains(implClazz)) { compileQueue.add(implClazz); } } } } }

Target:
static void addMetaInfImplementations(Clazzes clazzes, Clazz clazz, Set<Clazz> compiled, Set<Clazz> compileQueue) throws IOException { String metaInfName = "META-INF/services/" + clazz.getClassName(); IOException throwLater = null; for (InputStream is : clazzes.loadResources(metaInfName)) { try (BufferedReader r = new BufferedReader(new InputStreamReader(is))) { for (;;) { String line = r.readLine(); if (line == null) { break; } if (line.startsWith("#")) { continue; } String implClazzName = line.replace('.', '/'); Clazz implClazz = clazzes.load(implClazzName); if (implClazz != null && !compiled.contains(implClazz)) { compileQueue.add(implClazz); } } } catch (IOException ex) { throwLater = ex; } } if (throwLater != null) { throw throwLater; } }
Source:
public String startLoadingPublicNetworks() throws QStoreStorageException { publicNetworks = qStoreConnector.loadNetworkWithPopularTerms(); return RUNNING.name(); }

Target:
public ExecutionStatus startLoadingPublicNetworks() throws AsyncExecutionException { publicNetworks = qStoreConnector.loadNetworkWithPopularTerms(); return RUNNING; }
Source:
public String toString() { Object oScope = scope; Object oKey = key; if (oScope instanceof MarshalledValue) { oScope = ((MarshalledValue) oScope).get(); } if (oKey instanceof MarshalledValue) { oKey = ((MarshalledValue) oKey).get(); } return "ScopedKey{scope = " + oScope + ", key = " + oKey + "}"; }

Target:
public String toString() { return "ScopedKey{scope = " + scope + ", key = " + key + "}"; }
Source:
public static FieldCoordinates coordinates(GraphQLFieldsContainer parentType, GraphQLFieldDefinition fieldDefinition) { final String parentTypeName = parentType.getName(); return new FieldCoordinates(parentTypeName, fieldDefinition.getName(), (null == parentTypeName) || parentTypeName.isEmpty()); }

Target:
public static FieldCoordinates coordinates(GraphQLFieldsContainer parentType, GraphQLFieldDefinition fieldDefinition) { return new FieldCoordinates(parentType.getName(), fieldDefinition.getName(), false); }
Source:
protected Predicate<Trigger> matchTriggerFor(final TriggerEvent event) { DockerEvent dockerEvent = (DockerEvent) event; String registry = dockerEvent.getContent().getRegistry(); String repository = dockerEvent.getContent().getRepository(); String tag = dockerEvent.getContent().getTag(); return trigger -> trigger.getType().equals(TRIGGER_TYPE) && trigger.getRegistry().equals(registry) && trigger.getRepository().equals(repository) && trigger.getTag().equals(tag); }

Target:
protected Predicate<Trigger> matchTriggerFor(final TriggerEvent event) { DockerEvent dockerEvent = (DockerEvent) event; String registry = dockerEvent.getContent().getRegistry(); String repository = dockerEvent.getContent().getRepository(); String tag = dockerEvent.getContent().getTag(); return trigger -> trigger.getType().equals(TRIGGER_TYPE) && trigger.getRegistry().equals(registry) && trigger.getRepository().equals(repository) && (trigger.getTag() == null || trigger.getTag().equals(tag)); }
Source:
private static List<String> getUserList(LdapRealm r, String searchText, int numUsersToFetch) { List<String> userList = new ArrayList<>(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("SearchText: " + searchText); } String userAttribute = r.getUserSearchAttributeName(); String userSearchRealm = r.getUserSearchBase(); String userObjectClass = r.getUserObjectClass(); JndiLdapContextFactory cf = (JndiLdapContextFactory) r.getContextFactory(); try { LdapContext ctx = cf.getSystemLdapContext(); SearchControls constraints = new SearchControls(); constraints.setSearchScope(SearchControls.SUBTREE_SCOPE); constraints.setCountLimit(numUsersToFetch); String[] attrIDs = {userAttribute}; constraints.setReturningAttributes(attrIDs); NamingEnumeration result = ctx.search(userSearchRealm, "(&(objectclass=" + userObjectClass + ")(" + userAttribute + "=*" + searchText + "*))", constraints); while (result.hasMore()) { Attributes attrs = ((SearchResult) result.next()).getAttributes(); if (attrs.get(userAttribute) != null) { String currentUser; if (r.getUserLowerCase()) { LOGGER.debug("userLowerCase true"); currentUser = ((String) attrs.get(userAttribute).get()).toLowerCase(); } else { LOGGER.debug("userLowerCase false"); currentUser = (String) attrs.get(userAttribute).get(); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("CurrentUser: " + currentUser); } userList.add(currentUser.trim()); } } } catch (Exception e) { LOGGER.error("Error retrieving User list from Ldap Realm", e); } return userList; }

Target:
private static List<String> getUserList(LdapRealm r, String searchText, int numUsersToFetch) { List<String> userList = new ArrayList<>(); LOGGER.debug("SearchText: " + searchText); String userAttribute = r.getUserSearchAttributeName(); String userSearchRealm = r.getUserSearchBase(); String userObjectClass = r.getUserObjectClass(); JndiLdapContextFactory cf = (JndiLdapContextFactory) r.getContextFactory(); try { LdapContext ctx = cf.getSystemLdapContext(); SearchControls constraints = new SearchControls(); constraints.setSearchScope(SearchControls.SUBTREE_SCOPE); constraints.setCountLimit(numUsersToFetch); String[] attrIDs = {userAttribute}; constraints.setReturningAttributes(attrIDs); NamingEnumeration result = ctx.search(userSearchRealm, "(&(objectclass=" + userObjectClass + ")(" + userAttribute + "=*" + searchText + "*))", constraints); while (result.hasMore()) { Attributes attrs = ((SearchResult) result.next()).getAttributes(); if (attrs.get(userAttribute) != null) { String currentUser; if (r.getUserLowerCase()) { LOGGER.debug("userLowerCase true"); currentUser = ((String) attrs.get(userAttribute).get()).toLowerCase(); } else { LOGGER.debug("userLowerCase false"); currentUser = (String) attrs.get(userAttribute).get(); } LOGGER.debug("CurrentUser: " + currentUser); userList.add(currentUser.trim()); } } } catch (Exception e) { LOGGER.error("Error retrieving User list from Ldap Realm", e); } return userList; }
Source:
public void stopScanner(final ContainerSpecKey containerSpecKey) { ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId()); if (serverTemplate == null) { throw new RuntimeException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId()); } org.kie.server.controller.api.model.spec.ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId()); ContainerConfig containerConfig = containerSpec.getConfigs().get(Capability.RULE); if (containerConfig == null) { containerConfig = new RuleConfig(); containerSpec.getConfigs().put(Capability.RULE, containerConfig); } ((RuleConfig) containerConfig).setPollInterval(null); ((RuleConfig) containerConfig).setScannerStatus(KieScannerStatus.STOPPED); templateStorage.update(serverTemplate); List<Container> containers = kieServerInstanceManager.stopScanner(serverTemplate, containerSpec); notificationService.notify(serverTemplate, containerSpec, containers); }

Target:
public void stopScanner(final ContainerSpecKey containerSpecKey) { ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId()); if (serverTemplate == null) { throw new RuntimeException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId()); } ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId()); ContainerConfig containerConfig = containerSpec.getConfigs().get(Capability.RULE); if (containerConfig == null) { containerConfig = new RuleConfig(); containerSpec.getConfigs().put(Capability.RULE, containerConfig); } ((RuleConfig) containerConfig).setPollInterval(null); ((RuleConfig) containerConfig).setScannerStatus(KieScannerStatus.STOPPED); templateStorage.update(serverTemplate); List<Container> containers = kieServerInstanceManager.stopScanner(serverTemplate, containerSpec); notificationService.notify(serverTemplate, containerSpec, containers); }
Source:
public void strongestApprovals(final Set<Change.Id> cids, final AsyncCallback<ApprovalSummarySet> callback) { run(callback, new Action<ApprovalSummarySet>() { public ApprovalSummarySet run(ReviewDb db) throws OrmException { final Map<Change.Id, ApprovalSummary> approvals = new HashMap<Change.Id, ApprovalSummary>(); for (final Change.Id id : cids) { try { final ChangeControl cc = changeControlFactory.validateFor(id); final Change change = cc.getChange(); final PatchSet.Id ps_id = change.currentPatchSetId(); final Map<ApprovalCategory.Id, PatchSetApproval> psas = new HashMap<ApprovalCategory.Id, PatchSetApproval>(); final FunctionState fs = functionStateFactory.create(change, ps_id, psas.values()); final Set<AccountInfo> accounts = new HashSet<AccountInfo>(); for (PatchSetApproval ca : db.patchSetApprovals() .byPatchSet(ps_id)) { fs.normalize(approvalTypes.getApprovalType(ca.getCategoryId()), ca); boolean keep = true; if (psas.containsKey(ca.getCategoryId())) { final short oldValue = psas.get(ca.getCategoryId()).getValue(); final short newValue = ca.getValue(); keep = (Math.abs(oldValue) < Math.abs(newValue)) || ((Math.abs(oldValue) == Math.abs(newValue) && (newValue < oldValue))); } if (keep) { psas.put(ca.getCategoryId(), ca); } } approvals.put(id, new ApprovalSummary(accounts, psas.values())); } catch (NoSuchChangeException nsce) { } } return new ApprovalSummarySet(approvals); } }); }

Target:
public void strongestApprovals(final Set<Change.Id> cids, final AsyncCallback<ApprovalSummarySet> callback) { run(callback, new Action<ApprovalSummarySet>() { public ApprovalSummarySet run(ReviewDb db) throws OrmException { final Map<Change.Id, ApprovalSummary> approvals = new HashMap<Change.Id, ApprovalSummary>(); final AccountInfoCacheFactory aicFactory = accountInfoCacheFactory.create(); for (final Change.Id id : cids) { try { final ChangeControl cc = changeControlFactory.validateFor(id); final Change change = cc.getChange(); final PatchSet.Id ps_id = change.currentPatchSetId(); final Map<ApprovalCategory.Id, PatchSetApproval> psas = new HashMap<ApprovalCategory.Id, PatchSetApproval>(); final FunctionState fs = functionStateFactory.create(change, ps_id, psas.values()); for (PatchSetApproval ca : db.patchSetApprovals() .byPatchSet(ps_id)) { fs.normalize(approvalTypes.getApprovalType(ca.getCategoryId()), ca); boolean keep = true; if (psas.containsKey(ca.getCategoryId())) { final short oldValue = psas.get(ca.getCategoryId()).getValue(); final short newValue = ca.getValue(); keep = (Math.abs(oldValue) < Math.abs(newValue)) || ((Math.abs(oldValue) == Math.abs(newValue) && (newValue < oldValue))); } if (keep) { aicFactory.want(ca.getAccountId()); psas.put(ca.getCategoryId(), ca); } } approvals.put(id, new ApprovalSummary(psas.values())); } catch (NoSuchChangeException nsce) { } } return new ApprovalSummarySet(aicFactory.create(), approvals); } }); }
Source:
private AdhocQueryResponse respondingGatewayCrossGatewayQuery(AdhocQueryRequest request, AssertionType assertion, NhinTargetCommunitiesType targets) { AdhocQueryResponse response = null; if (targets == null) { targets = new ObjectFactory().createNhinTargetCommunitiesType(); } if (StringUtils.isBlank(targets.getUseSpecVersion())) { targets.setUseSpecVersion("2.0"); } response = outboundDocQuery.respondingGatewayCrossGatewayQuery(request, assertion, targets); return response; }

Target:
private AdhocQueryResponse respondingGatewayCrossGatewayQuery(AdhocQueryRequest request, AssertionType assertion, NhinTargetCommunitiesType targets) { if (targets == null) { targets = new ObjectFactory().createNhinTargetCommunitiesType(); } if (StringUtils.isBlank(targets.getUseSpecVersion())) { targets.setUseSpecVersion("2.0"); } return outboundDocQuery.respondingGatewayCrossGatewayQuery(request, assertion, targets); }
Source:
private void updateMetadata(final Series s, final ComputeDistributionStat.Percentile percentile, final Set<Series> newSet) { Map<String, String> tags = new HashMap<>(s.getTags()); tags.put("tdigestat", percentile.getName()); Series newSeries = Series.of(s.getKey(), tags, s.getResource()); newSet.add(newSeries); }

Target:
private void updateMetadata(final Series s, final ComputeDistributionStat.Percentile percentile, final Set<Series> newSet) { Map<String, String> tags = new HashMap<>(s.getTags()); tags.put("tdigeststat", percentile.getName()); Series newSeries = Series.of(s.getKey(), tags, s.getResource()); newSet.add(newSeries); }
Source:
public boolean onNavigationItemSelected(@NonNull MenuItem item) { int id = item.getItemId(); if (id != currentCategory) { listItems(id); AnalyticsTracker.get().clickedOnNavDrawerSection(item.getTitle().toString()); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); if (drawer != null) { drawer.closeDrawer(GravityCompat.START); } return true; }

Target:
public boolean onNavigationItemSelected(@NonNull MenuItem item) { int id = item.getItemId(); if (id != currentCategory) { listItems(id); AnalyticsTracker.getInstance().clickedOnNavDrawerSection(item.getTitle().toString()); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); if (drawer != null) { drawer.closeDrawer(GravityCompat.START); } return true; }
Source:
private void loadPolicyExtensions(Properties properties, String extensionType) { int count = 1; String className = null; int size = 0; if (properties != null) { size = properties.size(); } while (size > 0) { className = properties.getProperty(extensionType + "." + count); if (className == null) { count++; continue; } try { Class clazz = Thread.currentThread().getContextClassLoader().loadClass(className); PolicyEnforcer policy = (PolicyEnforcer) clazz.newInstance(); policy.init(getParameters(properties, extensionType, count)); this.policyRegistry.addPolicy((PolicyEnforcer) policy); count++; size--; } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | SecurityException e) { log.error("Error while loading password policies " + className, e); } } }

Target:
private void loadPolicyExtensions(Properties properties, String extensionType) { int count = 1; String className = null; int size = 0; Enumeration<String> keyValues = (Enumeration<String>) properties.propertyNames(); while (keyValues.hasMoreElements()) { String currentProp = keyValues.nextElement(); if (currentProp.contains(extensionType)) { size++; } } while (size > 0) { className = properties.getProperty(extensionType + "." + count); if (className == null) { count++; continue; } try { Class clazz = Thread.currentThread().getContextClassLoader().loadClass(className); PolicyEnforcer policy = (PolicyEnforcer) clazz.newInstance(); policy.init(getParameters(properties, extensionType, count)); this.policyRegistry.addPolicy((PolicyEnforcer) policy); count++; size--; } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | SecurityException e) { log.error("Error while loading password policies " + className, e); } } }
Source:
protected BeanDefinitionBuilder parseHandler(Element element, ParserContext parserContext) { final BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(MongoDbOutboundGateway.class); MongoParserUtils.processCommonAttributes(element, parserContext, builder); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout"); String replyChannel = element.getAttribute("reply-channel"); if (StringUtils.hasText(replyChannel)) { builder.addPropertyReference("outputChannel", replyChannel); } BeanDefinition queryExpressionDef = IntegrationNamespaceUtils.createExpressionDefinitionFromValueOrExpression("query", "query-expression", parserContext, element, false); if (queryExpressionDef != null) { builder.addPropertyValue("queryExpression", queryExpressionDef); } IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "expect-single-result"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "entity-class"); return builder; }

Target:
protected BeanDefinitionBuilder parseHandler(Element element, ParserContext parserContext) { final BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(MongoDbOutboundGateway.class); MongoParserUtils.processCommonAttributes(element, parserContext, builder); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout"); String replyChannel = element.getAttribute("reply-channel"); if (StringUtils.hasText(replyChannel)) { builder.addPropertyReference("outputChannel", replyChannel); } BeanDefinition queryExpressionDef = IntegrationNamespaceUtils.createExpressionDefinitionFromValueOrExpression("query", "query-expression", parserContext, element, true); if (queryExpressionDef != null) { builder.addPropertyValue("queryExpression", queryExpressionDef); } IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "expect-single-result"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "entity-class"); return builder; }
Source:
protected float getAssignmentScore(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { float maxCapacityUsage = node.getHighestCapacityUtilization(); return (1.0f - maxCapacityUsage) / 2; }

Target:
protected float getAssignmentScore(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { float maxCapacityUsage = node.getHighestCapacityUtilization(); return 1.0f - maxCapacityUsage / 2.0f; }
Source:
private void reportFlowFinishedMetrics() { final Status status = this.flow.getStatus(); switch (status) { case SUCCEEDED: this.execMetrics.markFlowSuccess(); break; case FAILED: this.commonMetrics.markFlowFail(); break; case KILLED: this.execMetrics.markFlowKilled(); final long now = System.currentTimeMillis(); this.execMetrics .addFlowTimeToKill(this.flowKillTime == -1 ? -1 : now - this.flowKillTime); break; default: break; } }

Target:
private void reportFlowFinishedMetrics() { final Status status = this.flow.getStatus(); switch (status) { case SUCCEEDED: this.execMetrics.markFlowSuccess(); break; case FAILED: this.commonMetrics.markFlowFail(); break; case KILLED: this.execMetrics.markFlowKilled(); this.execMetrics.addFlowTimeToKill( this.flowKillTime == -1 ? -1 : System.currentTimeMillis() - this.flowKillTime); break; default: break; } }
Source:
private static void displayRestartRequiredDialog(@NonNull Context context) { AlertDialog.Builder dialog = new AlertDialog.Builder(context); dialog.setTitle(android.R.string.dialog_alert_title); dialog.setMessage(R.string.pref_restart_required); dialog.setPositiveButton(android.R.string.ok, null); dialog.show(); }

Target:
private static void displayRestartRequiredDialog(@NonNull Context context) { AlertDialog.Builder dialog = new AlertDialog.Builder(context); dialog.setTitle(android.R.string.dialog_alert_title); dialog.setMessage(R.string.pref_restart_required); dialog.setPositiveButton(android.R.string.ok, null); dialog.setCancelable(false); dialog.show(); }
Source:
protected ResponseBody getTestResponseInstance() throws Exception { final Random random = new Random(); final IOMetricsInfo jobVertexMetrics = new IOMetricsInfo( random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean()); final int subtaskIndex = 1; String host = "local1"; long duration = 1024L; String taskmanagerId = "taskmanagerId1"; List<SubtaskExecutionAttemptDetailsInfo> subtaskExecutionAttemptDetailsInfoList = new ArrayList<>(); subtaskExecutionAttemptDetailsInfoList.add(new SubtaskExecutionAttemptDetailsInfo( subtaskIndex, ExecutionState.FAILED, 0, host, System.currentTimeMillis() - duration * 2, System.currentTimeMillis() - duration, duration, jobVertexMetrics, taskmanagerId)); subtaskExecutionAttemptDetailsInfoList.add(new SubtaskExecutionAttemptDetailsInfo( subtaskIndex, ExecutionState.RUNNING, 1, host, System.currentTimeMillis(), -1L, -1L, jobVertexMetrics, taskmanagerId)); return new SubtaskAllExecutionAttemptsDetailsInfo(subtaskExecutionAttemptDetailsInfoList); }

Target:
protected SubtaskAllExecutionAttemptsDetailsInfo getTestResponseInstance() throws Exception { final Random random = new Random(); final IOMetricsInfo jobVertexMetrics = new IOMetricsInfo( random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean(), random.nextLong(), random.nextBoolean()); final int subtaskIndex = 1; String host = "local1"; long duration = 1024L; String taskmanagerId = "taskmanagerId1"; List<SubtaskExecutionAttemptDetailsInfo> subtaskExecutionAttemptDetailsInfoList = new ArrayList<>(); subtaskExecutionAttemptDetailsInfoList.add(new SubtaskExecutionAttemptDetailsInfo( subtaskIndex, ExecutionState.FAILED, 0, host, System.currentTimeMillis() - duration * 2, System.currentTimeMillis() - duration, duration, jobVertexMetrics, taskmanagerId)); subtaskExecutionAttemptDetailsInfoList.add(new SubtaskExecutionAttemptDetailsInfo( subtaskIndex, ExecutionState.RUNNING, 1, host, System.currentTimeMillis(), -1L, -1L, jobVertexMetrics, taskmanagerId)); return new SubtaskAllExecutionAttemptsDetailsInfo(subtaskExecutionAttemptDetailsInfoList); }
Source:
public boolean addClientConnection(String clientId, boolean unique) { final AtomicInteger i = connectedClientIds.putIfAbsent(clientId, new AtomicInteger(1)); if (i != null) { if (unique && i.get() != 0) { return false; } else { i.incrementAndGet(); connectedClientIds.put(clientId, i); } } return true; }

Target:
public boolean addClientConnection(String clientId, boolean unique) { final AtomicInteger i = connectedClientIds.putIfAbsent(clientId, new AtomicInteger(1)); if (i != null) { if (unique && i.get() != 0) { return false; } else if (i.incrementAndGet() > 0) { connectedClientIds.put(clientId, i); } } return true; }
Source:
public List<Condition> getConditionHistory(Patient patient) { Query query = sessionFactory.getCurrentSession().createQuery( "select con from Condition as con where con.patient.patientId = :patientId and con.voided = false " + "order by con.dateCreated desc"); query.setInteger("patientId", patient.getId()); return query.list(); }

Target:
public List<Condition> getConditionHistory(Patient patient) { Query query = sessionFactory.getCurrentSession().createQuery( "from Condition con where con.patient.patientId = :patientId and con.voided = false " + "order by con.onsetDate desc"); query.setInteger("patientId", patient.getId()); return query.list(); }
Source:
public void onTransfer() { DatabaseTransferForm form = new DatabaseTransferForm(selection, dispatcher); final FormDialogImpl dialog = new FormDialogImpl(form); dialog.setWidth(400); dialog.setHeight(170); dialog.setHeadingText(I18N.CONSTANTS.transferDatabase()); form.getCancelButton().addClickHandler(cancelTransfer -> { dispatcher.execute(new CancelDatabaseTransfer(selection.getId()), new SuccessCallback<VoidResult>() { @Override public void onSuccess(VoidResult result) { eventBus.fireEvent(AppEvents.SCHEMA_CHANGED); loader.load(); dialog.hide(); } }); }); dialog.show(new FormDialogCallback() { @Override public void onValidated() { form.getUser(new AsyncCallback<UserProfileDTO>() { @Override public void onFailure(Throwable caught) { MessageBox.alert(I18N.CONSTANTS.noUser(), I18N.MESSAGES.userNotInSystem(form.getEmail()), event -> { return; }); } @Override public void onSuccess(UserProfileDTO result) { transfer(result, dialog); } }); } }); }

Target:
public void onTransfer() { DatabaseTransferForm form = new DatabaseTransferForm(selection, dispatcher); final FormDialogImpl dialog = new FormDialogImpl(form); dialog.setWidth(400); dialog.setHeight(170); dialog.setHeadingText(I18N.CONSTANTS.transferDatabase()); dialog.show(new FormDialogCallback() { @Override public void onValidated() { UserPermissionDTO user = form.getUser(); client.requestDatabaseTransfer(user.getEmail(), selection.getId()).then(result -> { clearLocalCache(); loader.load(); dialog.hide(); MessageBox.alert(I18N.CONSTANTS.transferDatabase(), I18N.MESSAGES.transferDatabase(user.getName()), null); return null; }); } }); }
Source:
public void matchIndexEntry(ExpressionOrColumn indexEntry) { List<Integer> nomatches = new ArrayList<>(); for (int idx = 0; idx < m_winFunctions.length; idx += 1) { WindowFunctionScore score = m_winFunctions[idx]; MatchResults result = score.matchIndexEntry(indexEntry); if (result == MatchResults.POSSIBLE_ORDER_SPOILER) { m_orderSpoilers.add(indexEntry.m_indexEntryNumber); } } }

Target:
public void matchIndexEntry(ExpressionOrColumn indexEntry) { for (int idx = 0; idx < m_winFunctions.length; idx += 1) { WindowFunctionScore score = m_winFunctions[idx]; MatchResults result = score.matchIndexEntry(indexEntry); if (result == MatchResults.POSSIBLE_ORDER_SPOILER) { m_orderSpoilers.add(indexEntry.m_indexKeyComponentPosition); } } }