auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void handleAction(Map<String, Object> parameters) throws IOException, ClassNotFoundException, ParserConfigurationException, SAXException { String templateName = (String) parameters.get(Constants.TEMPLATE_NAME_PARAM); String recipientName = (String) parameters.get(Constants.RECIPIENT_NAME_PARAM); CdaTemplate cdaTemplate = iheTemplateDataService.findByName(templateName); if (cdaTemplate == null) { LOGGER.error("Cannot find template", templateName); throw new TemplateNotFoundException(templateName); } HL7Recipient hl7Recipient = hl7RecipientsService.getRecipientbyName(recipientName); if (hl7Recipient == null) { LOGGER.error("Cannot find recipient", recipientName); throw new RecipientNotFoundException(templateName); } Byte[] templateData = (Byte[]) iheTemplateDataService.getDetachedField(cdaTemplate, TEMPLATE_DATA_FIELD_NAME); StreamingTemplateEngine streamingTemplateEngine = new StreamingTemplateEngine(); Template template = streamingTemplateEngine.createTemplate(new String(ArrayUtils.toPrimitive(templateData))); Writable writable = template.make(parameters); String result = writable.toString(); Pattern regex = Pattern.compile("(?s)<!--.*?-->", Pattern.DOTALL); Matcher regexMatcher = regex.matcher(result); result = regexMatcher.replaceAll(""); result.replaceAll("(?s)<!--.*?-->", ""); LOGGER.info("Template with name {}:\n{}", cdaTemplate.getTemplateName(), result); iheTemplateService.sendTemplateToRecipientUrl(hl7Recipient.getRecipientUrl(), result); }

Target:
public void handleAction(Map<String, Object> parameters) throws IOException, ClassNotFoundException, ParserConfigurationException, SAXException { String templateName = (String) parameters.get(Constants.TEMPLATE_NAME_PARAM); String recipientName = (String) parameters.get(Constants.RECIPIENT_NAME_PARAM); CdaTemplate cdaTemplate = iheTemplateDataService.findByName(templateName); if (cdaTemplate == null) { LOGGER.error("Cannot find template", templateName); throw new TemplateNotFoundException(templateName); } HL7Recipient hl7Recipient = hl7RecipientsService.getRecipientbyName(recipientName); if (hl7Recipient == null) { LOGGER.error("Cannot find recipient", recipientName); throw new RecipientNotFoundException(templateName); } Byte[] templateData = (Byte[]) iheTemplateDataService.getDetachedField(cdaTemplate, TEMPLATE_DATA_FIELD_NAME); StreamingTemplateEngine streamingTemplateEngine = new StreamingTemplateEngine(); Template template = streamingTemplateEngine.createTemplate(new String(ArrayUtils.toPrimitive(templateData))); Writable writable = template.make(parameters); LOGGER.info("Template with name {}:\n{}", cdaTemplate.getTemplateName(), writable.toString()); iheTemplateService.sendTemplateToRecipientUrl(hl7Recipient.getRecipientUrl(), writable.toString()); }
Source:
private void processPendingPartitions() { final List<PendingPartition> pendingCopy; final int size; synchronized (pendingPartitions) { pendingCopy = new ArrayList<>(pendingPartitions); size = pendingSize; pendingPartitions.clear(); pendingSize = 0; pendingPartitions.notifyAll(); } if (partitions != null) { synchronized (partitions) { final StringBuilder addedContent = new StringBuilder(size); IOConsolePartition lastPartition = getPartitionByIndex(partitions.size() - 1); int nextOffset = document.getLength(); for (PendingPartition pendingPartition : pendingCopy) { if (lastPartition == null || lastPartition.getOutputStream() != pendingPartition.stream) { lastPartition = new IOConsolePartition(nextOffset, pendingPartition.stream); partitions.add(lastPartition); } final int pendingLength = pendingPartition.text.length(); lastPartition.setLength(lastPartition.getLength() + pendingLength); nextOffset += pendingLength; addedContent.append(pendingPartition.text); } try { updateType = DocUpdateType.OUTPUT; document.replace(document.getLength(), 0, addedContent.toString()); } catch (BadLocationException e) { log(e); } } } checkBufferSize(); checkFinished(); }

Target:
private void processPendingPartitions() { final List<PendingPartition> pendingCopy; final int size; synchronized (pendingPartitions) { pendingCopy = new ArrayList<>(pendingPartitions); size = pendingSize; pendingPartitions.clear(); pendingSize = 0; pendingPartitions.notifyAll(); } synchronized (partitions) { final StringBuilder addedContent = new StringBuilder(size); IOConsolePartition lastPartition = getPartitionByIndex(partitions.size() - 1); int nextOffset = document.getLength(); for (PendingPartition pendingPartition : pendingCopy) { if (lastPartition == null || lastPartition.getOutputStream() != pendingPartition.stream) { lastPartition = new IOConsolePartition(nextOffset, pendingPartition.stream); partitions.add(lastPartition); } final int pendingLength = pendingPartition.text.length(); lastPartition.setLength(lastPartition.getLength() + pendingLength); nextOffset += pendingLength; addedContent.append(pendingPartition.text); } try { updateType = DocUpdateType.OUTPUT; document.replace(document.getLength(), 0, addedContent.toString()); } catch (BadLocationException e) { log(e); } } checkBufferSize(); checkFinished(); }
Source:
String[] getColumnValues(final ObservationUnitRow row, final List<MeasurementVariable> subObservationSetColumns) { final List<String> values = new LinkedList<>(); for (final MeasurementVariable column : subObservationSetColumns) { if (row.getEnvironmentVariables().containsKey(column.getName()) && ( column.getVariableType().getId() == VariableType.ENVIRONMENT_DETAIL.getId() || column.getVariableType().getId() == VariableType.STUDY_CONDITION.getId())) { values.add(row.getEnvironmentVariables().get(column.getName()).getValue()); } else { values.add(row.getVariables().get(column.getName()).getValue()); } } return values.toArray(new String[] {}); }

Target:
String[] getColumnValues(final ObservationUnitRow row, final List<MeasurementVariable> subObservationSetColumns) { final List<String> values = new LinkedList<>(); for (final MeasurementVariable column : subObservationSetColumns) { if (row.getEnvironmentVariables().containsKey(column.getName()) && ENVIRONMENT_VARIABLES_VARIABLE_TYPES .contains(column.getVariableType())) { values.add(row.getEnvironmentVariables().get(column.getName()).getValue()); } else { values.add(row.getVariables().get(column.getName()).getValue()); } } return values.toArray(new String[] {}); }
Source:
public static String getResourceOnClasspath(ClassLoader classLoader, String path) { return CACHE.computeIfAbsent(classLoader, x -> Collections.synchronizedMap(new HashMap<>())) .computeIfAbsent(path, x -> readResource(classLoader, path)); }

Target:
public static String getResourceOnClasspath(ClassLoader classLoader, String path) { return CACHE.computeIfAbsent(classLoader, x -> new ConcurrentHashMap<>()) .computeIfAbsent(path, x -> readResource(classLoader, path)); }
Source:
public ClusterFeatures list() { ClusterFeatures features = new ClusterFeatures(); Set<AdditionalFeature> addlFeatures = BackendClusterFeatureHelper.getClusterFeatures(this, version); addlFeatures.forEach(clusterFeature -> { org.ovirt.engine.api.model.ClusterFeature feature = addLinks(ClusterFeaturesMapper.map(clusterFeature, null)); features.getClusterFeatures().add(feature); }); return features; }

Target:
public ClusterFeatures list() { ClusterFeatures features = new ClusterFeatures(); Set<AdditionalFeature> addlFeatures = BackendClusterFeatureHelper.getClusterFeatures(this, version); addlFeatures.forEach(clusterFeature -> { org.ovirt.engine.api.model.ClusterFeature feature = addLinks(map(clusterFeature, null)); features.getClusterFeatures().add(feature); }); return features; }
Source:
public ServerContext(Map<String, Object> serverConfig) { this.serverConfig = serverConfig; this.dataStore = new DataStore(serverConfig, this::dataStoreFileCleanup); if (serverConfig.get("--node-id") != null) { UUID serverId = UuidUtils.fromBase64(getServerConfig(String.class, "--node-id")); generateNodeId(serverId); } else { generateNodeId(); } this.failureHandlerPolicy = new ConservativeFailureHandlerPolicy(); final boolean providedEventLoops = getChannelImplementation().equals(ChannelImplementation.LOCAL); if (providedEventLoops) { clientGroup = getServerConfig(EventLoopGroup.class, "client"); workerGroup = getServerConfig(EventLoopGroup.class, "worker"); bossGroup = getServerConfig(EventLoopGroup.class, "boss"); } else { clientGroup = getNewClientGroup(); workerGroup = getNewWorkerGroup(); bossGroup = getNewBossGroup(); } nodeLocator = NodeLocator .parseString(serverConfig.get("--address") + ":" + serverConfig.get("<port>")); localEndpoint = nodeLocator.toEndpointUrl(); if (!isMetricsReportingSetUp(metrics)) { MetricsUtils.metricsReportingSetup(metrics); } }

Target:
public ServerContext(Map<String, Object> serverConfig) { this.serverConfig = serverConfig; this.dataStore = new DataStore(serverConfig, this::dataStoreFileCleanup); generateNodeId(); this.failureHandlerPolicy = new ConservativeFailureHandlerPolicy(); final boolean providedEventLoops = getChannelImplementation().equals(ChannelImplementation.LOCAL); if (providedEventLoops) { clientGroup = getServerConfig(EventLoopGroup.class, "client"); workerGroup = getServerConfig(EventLoopGroup.class, "worker"); bossGroup = getServerConfig(EventLoopGroup.class, "boss"); } else { clientGroup = getNewClientGroup(); workerGroup = getNewWorkerGroup(); bossGroup = getNewBossGroup(); } nodeLocator = NodeLocator .parseString(serverConfig.get("--address") + ":" + serverConfig.get("<port>")); localEndpoint = nodeLocator.toEndpointUrl(); if (!isMetricsReportingSetUp(metrics)) { MetricsUtils.metricsReportingSetup(metrics); } }
Source:
protected void run(final String[] argv) { try { if (!installConsole()) { AwtAuthenticator.install(); AwtCredentialsProvider.install(); } configureHttpProxy(); execute(argv); } catch (Die err) { System.err.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage())); if (showStackTrace) err.printStackTrace(); System.exit(128); } catch (Exception err) { if (!showStackTrace && err.getCause() != null && err instanceof TransportException) System.err.println(MessageFormat.format(CLIText.get().fatalError, err.getCause().getMessage())); if (err.getClass().getName().startsWith("org.eclipse.jgit.errors.")) { System.err.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage())); if (showStackTrace) err.printStackTrace(); System.exit(128); } err.printStackTrace(); System.exit(1); } if (System.out.checkError()) { System.err.println("An unknown I/O error occurs on stdout"); System.exit(1); } if (System.err.checkError()) { System.exit(1); } }

Target:
protected void run(final String[] argv) { try { if (!installConsole()) { AwtAuthenticator.install(); AwtCredentialsProvider.install(); } configureHttpProxy(); execute(argv); } catch (Die err) { System.err.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage())); if (showStackTrace) err.printStackTrace(); System.exit(128); } catch (Exception err) { if (!showStackTrace && err.getCause() != null && err instanceof TransportException) System.err.println(MessageFormat.format(CLIText.get().fatalError, err.getCause().getMessage())); if (err.getClass().getName().startsWith("org.eclipse.jgit.errors.")) { System.err.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage())); if (showStackTrace) err.printStackTrace(); System.exit(128); } err.printStackTrace(); System.exit(1); } if (System.out.checkError()) { System.err.println(CLIText.get().unknownIoErrorStdout); System.exit(1); } if (System.err.checkError()) { System.exit(1); } }
Source:
public ExtensionId getUIExtensionId() { XWikiContext xcontext = this.xcontextProvider.get(); if (xcontext.isMainWiki()) { return this.distributionManager.getMainUIExtensionId(); } XWikiDocument wikiDocument = xcontext.getWikiServer(); DocumentReference workspaceClassRef = new DocumentReference("xwiki", "WorkspaceManager", "WorkspaceClass"); if (wikiDocument.getXObject(workspaceClassRef) != null) { return this.distributionManager.getWikiUIExtensionId(); } CoreExtension distributionExtension = this.coreExtensionRepository.getEnvironmentExtension(); Model mavenModel = (Model) distributionExtension.getProperty(MavenCoreExtension.PKEY_MAVEN_MODEL); String wikiUIId = mavenModel.getProperties().getProperty("xwiki.extension.distribution.oldwikiui"); return new ExtensionId(wikiUIId, distributionExtension.getId().getVersion()); }

Target:
public ExtensionId getUIExtensionId() { XWikiContext xcontext = this.xcontextProvider.get(); if (xcontext.isMainWiki()) { return this.distributionManager.getMainUIExtensionId(); } XWikiDocument wikiDocument = xcontext.getWikiServer(); DocumentReference workspaceClassRef = new DocumentReference(xcontext.getMainXWiki(), "WorkspaceManager", "WorkspaceClass"); if (wikiDocument.getXObject(workspaceClassRef) != null) { return this.distributionManager.getWikiUIExtensionId(); } CoreExtension distributionExtension = this.coreExtensionRepository.getEnvironmentExtension(); Model mavenModel = (Model) distributionExtension.getProperty(MavenCoreExtension.PKEY_MAVEN_MODEL); String wikiUIId = mavenModel.getProperties().getProperty("xwiki.extension.distribution.oldwikiui"); return new ExtensionId(wikiUIId, distributionExtension.getId().getVersion()); }
Source:
public void bindingChanged(BindingProvider provider, String itemName) { logger.debug("Denon binding changed for item {}", itemName); if (provider instanceof DenonBindingProvider) { DenonBindingConfig config = ((DenonBindingProvider) provider).getConfig(itemName); if (config != null) { connections.get(config.getInstance()).getConnector().updateStateFromCache(config.getProperty()); } } }

Target:
public void bindingChanged(BindingProvider provider, String itemName) { logger.debug("Denon binding changed for item {}", itemName); if (provider instanceof DenonBindingProvider) { DenonBindingConfig config = ((DenonBindingProvider) provider).getConfig(itemName); if (config != null) { getConnector(config).updateStateFromCache(config.getProperty()); } } }
Source:
public Connection getConnection() throws IOException { Connection connection = this.connection.get(); while (connection == null) { connection = ConnectionFactory.createConnection(this.conf); if (! this.connection.compareAndSet(null, connection)) { try { connection.close(); } catch (IOException exception) { LOG.debug("Ignored failure while closing connection on contended connection creation.", exception); } connection = this.connection.get(); } } return connection; }

Target:
public Connection getConnection() throws IOException { Connection connection = this.connectionRef.get(); while (connection == null) { connection = ConnectionFactory.createConnection(this.conf); if (! this.connectionRef.compareAndSet(null, connection)) { try { connection.close(); } catch (IOException exception) { LOG.debug("Ignored failure while closing connection on contended connection creation.", exception); } connection = this.connectionRef.get(); } } return connection; }
Source:
public static void setup() { EntityDictionary dictionary = new EntityDictionary(new HashMap<>()); dictionary.bindEntity(getType(PlayerStatsWithView.class)); dictionary.bindEntity(getType(PlayerStatsView.class)); dictionary.bindEntity(getType(PlayerStats.class)); dictionary.bindEntity(getType(Country.class)); dictionary.bindEntity(getType(SubCountry.class)); dictionary.bindEntity(getType(Player.class)); dictionary.bindEntity(getType(CountryView.class)); dictionary.bindEntity(getType(CountryViewNested.class)); dataStore.populateEntityDictionary(dictionary); }

Target:
public static void setup() { EntityDictionary dictionary = new EntityDictionary(new HashMap<>()); dictionary.bindEntity(PlayerStatsWithView.class); dictionary.bindEntity(PlayerStatsView.class); dictionary.bindEntity(PlayerStats.class); dictionary.bindEntity(Country.class); dictionary.bindEntity(SubCountry.class); dictionary.bindEntity(Player.class); dictionary.bindEntity(CountryView.class); dictionary.bindEntity(CountryViewNested.class); dataStore.populateEntityDictionary(dictionary); }
Source:
public boolean openFileByKey(KeyEvent keyEvent) { if (keyEvent.getCharacter() == null) { return false; } char key = keyEvent.getCharacter().charAt(0); if (!Character.isDigit(key)) { return false; } int num = Integer.parseInt(String.valueOf(key)); if (num > history.getHistory().size()) { return false; } this.openFile(history.getFileAt(Integer.parseInt(keyEvent.getCharacter()) - 1)); return true; }

Target:
public boolean openFileByKey(KeyEvent keyEvent) { if (keyEvent.getCharacter() == null) { return false; } char key = keyEvent.getCharacter().charAt(0); int num = Character.getNumericValue(key); if (num <= 0 || num > history.getHistory().size()) { return false; } this.openFile(history.getFileAt(Integer.parseInt(keyEvent.getCharacter()) - 1)); return true; }
Source:
public void resumeSnapshotApply() { LogReplicationEntryMetadata metadata = new LogReplicationEntryMetadata(MessageType.SNAPSHOT_END, logReplicationMetadataManager.getTopologyConfigId(), -1L, logReplicationMetadataManager.getLastTransferredSnapshotTimestamp(), new UUID(logReplicationMetadataManager.getCurrentSnapshotSyncCycleId(), Long.MAX_VALUE)); startSnapshotApplyAsync(new LogReplicationEntry(metadata)); }

Target:
public void resumeSnapshotApply() { snapshotWriter.reset(topologyConfigId, logReplicationMetadataManager.getLastStartedSnapshotTimestamp()); long snapshotTransferTs = logReplicationMetadataManager.getLastTransferredSnapshotTimestamp(); UUID snapshotSyncId = new UUID(logReplicationMetadataManager.getCurrentSnapshotSyncCycleId(), Long.MAX_VALUE); log.info("Resume Snapshot Sync Apply, snapshot_transfer_ts={}, id={}", snapshotTransferTs, snapshotSyncId); LogReplicationEntryMetadata metadata = new LogReplicationEntryMetadata(MessageType.SNAPSHOT_END, logReplicationMetadataManager.getTopologyConfigId(), -1L, snapshotTransferTs, snapshotSyncId); startSnapshotApplyAsync(new LogReplicationEntry(metadata)); }
Source:
private static <K, V> Map.Entry<K, V> entry(K k, V v) { return new AbstractMap.SimpleEntry<>(k, v); }

Target:
private static <K, V> Map.Entry<K, V> entry(K k, V v) { return new AbstractMap.SimpleImmutableEntry<>(k, v); }
Source:
public static void removeDuplicateImages(Feed feed) { Set<String> known = new HashSet<String>(); for (FeedItem item : feed.getItems()) { String url = (item.hasItemImage()) ? item.getImage().getDownload_url() : null; if (url != null) { if (known.contains(url)) { item.setImage(null); } else { known.add(url); } } } }

Target:
public static void removeDuplicateImages(Feed feed) { Set<String> known = new HashSet<String>(); for (FeedItem item : feed.getItems()) { String url = item.hasItemImage() ? item.getImage().getDownload_url() : null; if (url != null) { if (known.contains(url)) { item.setImage(null); } else { known.add(url); } } } }
Source:
public static boolean isHost(final Contentlet contentlet){ final Structure hostStrucuture = CacheLocator.getContentTypeCache().getStructureByVelocityVarName("Host"); return contentlet.getStructureInode().equals(hostStrucuture.getInode()); }

Target:
public static boolean isHost(final Contentlet contentlet){ final Structure hostStrucuture = CacheLocator.getContentTypeCache().getStructureByVelocityVarName(Host.HOST_VELOCITY_VAR_NAME); return contentlet.getStructureInode().equals(hostStrucuture.getInode()); }
Source:
public Observable<LoginResponse> status(String siteUrl) throws ExecutionException, InterruptedException { if(!siteUrl.endsWith("/")){ siteUrl = siteUrl + "/"; } siteUrl = new URLHelper().execute(siteUrl).get(); RestService restService = restServiceFactory.createForUrl(siteUrl); return status(restService, siteUrl); }

Target:
public Observable<LoginResponse> status(String siteUrl) { String newUrl = null; try { newUrl = new URLHelper().execute(siteUrl).get(); } catch (ExecutionException e) { Log.e("UserRepository", "ExecutionException", e.getCause()); } catch (InterruptedException e) { Log.e("UserRepository", "InterruptedException", e.getCause()); } if (newUrl == null) newUrl = siteUrl; if(!siteUrl.endsWith("/")){ newUrl = newUrl + "/"; } RestService restService = restServiceFactory.createForUrl(newUrl); return status(restService, newUrl); }
Source:
private void addNode(String parentPath, String nodeName, String diffValue) throws DiffException, RepositoryException { Item item = session.getItem(parentPath); if (!item.isNode()) { throw new ItemNotFoundException(parentPath); } Node parent = (Node) item; try { importer.start(); NodeHandler hndlr = new NodeHandler(parent, nodeName); new JsonParser(hndlr).parse(diffValue); importer.end(); } catch (IOException e) { if (e instanceof DiffException) { throw (DiffException) e; } else { throw new DiffException(e.getMessage(), e); } } }

Target:
private void addNode(String parentPath, String nodeName, String diffValue) throws DiffException, RepositoryException { Item item = session.getItem(parentPath); if (!item.isNode()) { throw new ItemNotFoundException(parentPath); } Node parent = (Node) item; contentHandler = parent.getSession().getImportContentHandler(parentPath, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW); try { NodeHandler hndlr = new NodeHandler(parent, nodeName); new JsonParser(hndlr).parse(diffValue); } catch (IOException e) { if (e instanceof DiffException) { throw (DiffException) e; } else { throw new DiffException(e.getMessage(), e); } } }
Source:
public void register(String id, SocketChannel socketChannel) throws IOException { ensureNotRegistered(id); registerChannel(id, socketChannel, SelectionKey.OP_READ); this.sensors.connectionCreated.record(); this.channel(id).channelMetadataRegistry().registerClientInformation(ClientInformation.EMPTY); }

Target:
public void register(String id, SocketChannel socketChannel) throws IOException { ensureNotRegistered(id); registerChannel(id, socketChannel, SelectionKey.OP_READ); this.sensors.connectionCreated.record(); ChannelMetadataRegistry metadataRegistry = this.channel(id).channelMetadataRegistry(); if (metadataRegistry.clientInformation() == null) metadataRegistry.registerClientInformation(ClientInformation.EMPTY); }
Source:
public Account createAccount(CreateAccountRequest request) { Assert.notNull(request, "Request cannot be null."); final Account account = request.getAccount(); String href = getAccounts().getHref(); char querySeparator = '?'; if (request.isRegistrationWorkflowOptionSpecified()) { href += "?registrationWorkflowEnabled=" + request.isRegistrationWorkflowEnabled(); } if (request.isPasswordFormatSpecified()) { href += querySeparator + "passwordFormat=" + request.getPasswordFormat(); } if (request.isAccountOptionsSpecified()) { return getDataStore().create(href, account, request.getAccountOptions()); } return getDataStore().create(href, account); }

Target:
public Account createAccount(CreateAccountRequest request) { Assert.notNull(request, "Request cannot be null."); final Account account = request.getAccount(); String href = getAccounts().getHref(); char querySeparator = '?'; if (request.isRegistrationWorkflowOptionSpecified()) { href += querySeparator + "registrationWorkflowEnabled=" + request.isRegistrationWorkflowEnabled(); } if (request.isPasswordFormatSpecified()) { href += querySeparator + "passwordFormat=" + request.getPasswordFormat(); } if (request.isAccountOptionsSpecified()) { return getDataStore().create(href, account, request.getAccountOptions()); } return getDataStore().create(href, account); }
Source:
public void testOnlyPreScriptContainsAPIBinding() throws InvalidScriptException { Script s = scriptWithApiBindingUser(); Script s2 = scriptWithoutApiBinding(); FlowScript fs = flowScriptWithoutApiBinding(); Mockito.when(it.getPreScript()).thenReturn(s); Mockito.when(it.getPostScript()).thenReturn(s2); Mockito.when(sec.getScript()).thenReturn(s2); Mockito.when(fe.getEnvScript()).thenReturn(s2); Mockito.when(it.getFlowScript()).thenReturn(fs); Boolean result = new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd); assertEquals(true, result); }

Target:
public void testOnlyPreScriptContainsAPIBinding() throws InvalidScriptException { Script s = scriptWithApiBindingUser(); Script s2 = scriptWithoutApiBinding(); FlowScript fs = flowScriptWithoutApiBinding(); Mockito.when(it.getPreScript()).thenReturn(s); Mockito.when(it.getPostScript()).thenReturn(s2); Mockito.when(sec.getScript()).thenReturn(s2); Mockito.when(fe.getEnvScript()).thenReturn(s2); Mockito.when(it.getFlowScript()).thenReturn(fs); assertTrue(new CheckEligibleTaskDescriptorScript().isTaskContainsAPIBinding(etd)); }
Source:
public static PlayerBreakBlockEvent createPlayerBreakBlock(Game game, Cause cause, Player player, Direction direction, Location block, BlockSnapshot replacementBlock, int exp) { Map<String, Object> values = Maps.newHashMap(); values.put("game", game); values.put("cause", Optional.fromNullable(cause)); values.put("block", block); values.put("entity", player); values.put("user", player); values.put("replacementBlock", replacementBlock); values.put("blockFaceDirection", direction); values.put("exp", exp); return createEvent(PlayerBreakBlockEvent.class, values); }

Target:
public static PlayerBreakBlockEvent createPlayerBreakBlock(Game game, Cause cause, Player player, Direction direction, Location block, BlockSnapshot replacementBlock, int exp) { Map<String, Object> values = Maps.newHashMap(); values.put("game", game); values.put("cause", Optional.fromNullable(cause)); values.put("block", block); values.put("entity", player); values.put("replacementBlock", replacementBlock); values.put("user", player); values.put("blockFaceDirection", direction); values.put("exp", exp); return createEvent(PlayerBreakBlockEvent.class, values); }
Source:
private Integer unZipFromStream(ZipInputStream zis, String destinationPath) { File destination = new File(destinationPath); int count = 0; ZipEntry entry = null; try { while ((entry = zis.getNextEntry()) != null) { publishProgress(Localization.get("mult.install.progress", new String[]{String.valueOf(count)})); count++; if (entry.isDirectory()) { FileUtil.createFolder(new File(destination, entry.getName()).toString()); continue; } File outputFile = new File(destination, entry.getName()); if (!outputFile.getParentFile().exists()) { FileUtil.createFolder(outputFile.getParentFile().toString()); } if (outputFile.exists()) { if (!outputFile.delete()) { continue; } } if (!copyZipEntryToOutputFile(outputFile, zis)) { return -1; } } } catch (IOException e) { publishProgress(Localization.get("mult.install.progress.badentry", new String[]{entry.getName()})); return -1; } finally { StreamsUtil.closeStream(zis); } Logger.log(TAG, "Successfully unzipped files"); return count; }

Target:
private Integer unZipFromStream(ZipInputStream zis, String destinationPath) { File destination = new File(destinationPath); int count = 0; ZipEntry entry = null; try { while ((entry = zis.getNextEntry()) != null) { publishProgress(Localization.get("mult.install.progress", new String[]{String.valueOf(count)})); count++; Logger.log(TAG, "Unzipped entry " + entry.getName()); if (entry.isDirectory()) { FileUtil.createFolder(new File(destination, entry.getName()).toString()); continue; } File outputFile = new File(destination, entry.getName()); if (!outputFile.getParentFile().exists()) { FileUtil.createFolder(outputFile.getParentFile().toString()); } if (outputFile.exists()) { if (!outputFile.delete()) { continue; } } if (!copyZipEntryToOutputFile(outputFile, zis)) { return -1; } } } catch (IOException e) { publishProgress(Localization.get("mult.install.progress.badentry", new String[]{entry.getName()})); return -1; } finally { StreamsUtil.closeStream(zis); } Logger.log(TAG, "Successfully unzipped files"); return count; }
Source:
private static void setInitialPhaseForNodeA(NodeController nodeA, final int currentTopology) { nodeA.interceptor.addAction(new Action() { @Override public boolean isApplicable(InvocationContext context, VisitableCommand command) { return context.isOriginLocal() && command instanceof PrepareCommand; } @Override public void before(InvocationContext context, VisitableCommand command, Cache cache) { try { CompletableFuture<Void> topologyFuture = cache.getAdvancedCache().getComponentRegistry().getStateTransferLock().topologyFuture(currentTopology + 1); if (topologyFuture != null) topologyFuture.get(10, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (Exception e) { throw new CacheException(e); } } @Override public void after(InvocationContext context, VisitableCommand command, Cache cache) { } }); nodeA.topologyManager.startBlocking(BlockingLocalTopologyManager.LatchType.CONSISTENT_HASH_UPDATE); }

Target:
private static void setInitialPhaseForNodeA(NodeController nodeA, final int currentTopology) { nodeA.interceptor.addAction(new Action() { @Override public boolean isApplicable(InvocationContext context, VisitableCommand command) { return context.isOriginLocal() && command instanceof PrepareCommand; } @Override public void before(InvocationContext context, VisitableCommand command, Cache cache) { try { cache.getAdvancedCache().getComponentRegistry().getStateTransferLock().waitForTopology(currentTopology + 1, 10, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (TimeoutException e) { throw LogFactory.getLog(getClass()).failedWaitingForTopology(currentTopology + 1); } } @Override public void after(InvocationContext context, VisitableCommand command, Cache cache) { } }); nodeA.topologyManager.startBlocking(BlockingLocalTopologyManager.LatchType.CONSISTENT_HASH_UPDATE); }
Source:
public int enableSegments(final String dataSource, final Collection<String> segmentIds) { VersionedIntervalTimeline<String, DataSegment> versionedIntervalTimeline = getVersionedIntervalTimeline(dataSource, segmentIds); versionedIntervalTimeline.getAllTimelineEntries().keySet().stream().reduce( (acc, val) -> acc.withStartMillis(Math.min(acc.getStartMillis(), val.getStartMillis())).withEndMillis(Math.max(acc.getEndMillis(), val.getEndMillis())) ).ifPresent(interval -> VersionedIntervalTimeline.addSegments( versionedIntervalTimeline, dataSources.get(dataSource).getSegments().stream().filter(segment -> interval.contains(segment.getInterval())).iterator() )); return enableSegments( segmentIdsForInterval(versionedIntervalTimeline, Intervals.ETERNITY) .filter(segmentId -> segmentIds.contains(segmentId.toString())) .collect(Collectors.toSet()), versionedIntervalTimeline ); }

Target:
public int enableSegments(final String dataSource, final Collection<String> segmentIds) { Pair<List<DataSegment>, VersionedIntervalTimeline<String, DataSegment>> data = connector.inReadOnlyTransaction( (handle, status) -> { List<DataSegment> segments = getDataSegments(dataSource, segmentIds, handle) .stream() .filter(pair -> !pair.rhs) .map(pair -> pair.lhs) .collect(Collectors.toList()); VersionedIntervalTimeline<String, DataSegment> versionedIntervalTimeline = buildVersionedIntervalTimeline( dataSource, JodaUtils.condenseIntervals(segments.stream().map(segment -> segment.getInterval()).collect(Collectors.toList())), handle ); VersionedIntervalTimeline.addSegments(versionedIntervalTimeline, segments.iterator()); return new Pair<>( segments, versionedIntervalTimeline ); } ); return enableSegments( data.lhs, data.rhs ); }
Source:
public Iterable<MachineTypeInZone> listHardwareProfiles() { return FluentIterable.from(zones.get().values()) .transformAndConcat(new Function<Location, ImmutableSet<MachineType>>() { @Override public ImmutableSet<MachineType> apply(Location input) { return api.getMachineTypeApiForProject(userProject.get()).listInZone(input.getId()).concat().toSet(); } }).transform(new Function<MachineType, MachineTypeInZone>() { @Override public MachineTypeInZone apply(MachineType arg0) { return new MachineTypeInZone(arg0, arg0.getZone()); } }).toSet(); }

Target:
public Iterable<MachineTypeInZone> listHardwareProfiles() { ImmutableSet.Builder<MachineTypeInZone> builder = ImmutableSet.builder(); for (final Location zone : zones.get().values()) { builder.addAll(api.getMachineTypeApiForProject(userProject.get()) .listInZone(zone.getId()) .concat() .transform(new Function<MachineType, MachineTypeInZone>() { @Override public MachineTypeInZone apply(MachineType arg0) { return new MachineTypeInZone(arg0, arg0.getZone()); } })); } return builder.build(); }
Source:
private Map<String, Integer> fetchCapacityUsage(String partitionName, ResourceConfig resourceConfig) { Map<String, Map<String, Integer>> capacityMap; try { capacityMap = resourceConfig.getPartitionCapacityMap(); } catch (IOException ex) { throw new IllegalArgumentException("Invalid partition capacity configuration.", ex); } Map<String, Integer> partitionCapacity = capacityMap.get(partitionName); if (partitionCapacity == null) { partitionCapacity.get(ResourceConfig.DEFAULT_PARTITION_KEY); } if (partitionCapacity == null) { throw new IllegalArgumentException(String.format( "The capacity usage of the specified partition %s is not configured in the Resource Config. No default partition capacity is configured neither.", partitionName)); } return partitionCapacity; }

Target:
private Map<String, Integer> fetchCapacityUsage(String partitionName, ResourceConfig resourceConfig) { Map<String, Map<String, Integer>> capacityMap; try { capacityMap = resourceConfig.getPartitionCapacityMap(); } catch (IOException ex) { throw new IllegalArgumentException( "Invalid partition capacity configuration of resource: " + resourceConfig .getResourceName(), ex); } Map<String, Integer> partitionCapacity = capacityMap.get(partitionName); if (partitionCapacity == null) { partitionCapacity = capacityMap.get(ResourceConfig.DEFAULT_PARTITION_KEY); } if (partitionCapacity == null) { throw new IllegalArgumentException(String.format( "The capacity usage of the specified partition %s is not configured in the Resource Config %s. No default partition capacity is configured neither.", partitionName, resourceConfig.getResourceName())); } return partitionCapacity; }
Source:
public static NodeSelection from(IStructuredSelection selection) { if (selection instanceof NodeSelection) { return (NodeSelection) selection; } return selection.isEmpty() ? empty() : new NodeSelection(selection.toList()); }

Target:
public static NodeSelection from(IStructuredSelection selection) { return selection.isEmpty() ? empty() : new NodeSelection(selection.toList()); }
Source:
public void testUnion() throws DatabaseEngineException { test5Columns(); engine.persist("TEST", entry().set("COL1", 1).set("COL5", "a") .build()); engine.persist("TEST", entry().set("COL1", 2).set("COL5", "b") .build()); engine.persist("TEST", entry().set("COL1", 3).set("COL5", "c") .build()); engine.persist("TEST", entry().set("COL1", 4).set("COL5", "d") .build()); engine.persist("TEST", entry().set("COL1", 5).set("COL5", "d") .build()); final String[] letters = new String[] {"a", "b", "c", "d", "d"}; final Collection<Expression> queries = Arrays.stream(letters) .map(literal -> select(column("COL5")) .from(table("TEST")) .where(eq(column("COL5"), k(literal)))) .collect(Collectors.toList()); final Expression query = union(queries); final List<Map<String, ResultColumn>> result = engine.query(query); System.out.println(result.size()); assertEquals("Must return 4 results due to distinct property", 4, result.size()); System.out.println(result.get(0).get("COL5").toString()); System.out.println(result.get(1).get("COL5").toString()); System.out.println(result.get(2).get("COL5").toString()); System.out.println(result.get(3).get("COL5").toString()); final List<String> resultSorted = result.stream() .map(row -> row.get("COL5").toString()) .sorted() .collect(Collectors.toList()); assertEquals("COL5 must be a", "a", resultSorted.get(0)); assertEquals("COL5 must be b", "b", resultSorted.get(1)); assertEquals("COL5 must be c", "c", resultSorted.get(2)); assertEquals("COL5 must be d", "d", resultSorted.get(3)); }

Target:
public void testUnion() throws DatabaseEngineException { test5Columns(); engine.persist("TEST", entry().set("COL1", 1).set("COL5", "a") .build()); engine.persist("TEST", entry().set("COL1", 2).set("COL5", "b") .build()); engine.persist("TEST", entry().set("COL1", 3).set("COL5", "c") .build()); engine.persist("TEST", entry().set("COL1", 4).set("COL5", "d") .build()); engine.persist("TEST", entry().set("COL1", 5).set("COL5", "d") .build()); final String[] letters = new String[] {"a", "b", "c", "d", "d"}; final Collection<Expression> queries = Arrays.stream(letters) .map(literal -> select(column("COL5")) .from(table("TEST")) .where(eq(column("COL5"), k(literal)))) .collect(Collectors.toList()); final Expression query = union(queries); final List<Map<String, ResultColumn>> result = engine.query(query); assertEquals("Must return 4 results due to distinct property", 4, result.size()); final List<String> resultSorted = result.stream() .map(row -> row.get("COL5").toString()) .sorted() .collect(Collectors.toList()); assertEquals("COL5 must be a", "a", resultSorted.get(0)); assertEquals("COL5 must be b", "b", resultSorted.get(1)); assertEquals("COL5 must be c", "c", resultSorted.get(2)); assertEquals("COL5 must be d", "d", resultSorted.get(3)); }
Source:
public String getText(Object element) { if (element instanceof String) { return (String) element; } if (element instanceof FileAndName) { return ((FileAndName) element).getFile().getName(); } return null; }

Target:
public String getText(Object element) { if (element instanceof String) { return (String) element; } if (element instanceof FileAndName) { final File file = ((FileAndName) element).getFile(); if (file != null) { return file.getName(); } } return null; }
Source:
private void buildTryStatement(TryStatementTree tryStatementTree) { currentBlock = createBlock(currentBlock); BlockTree finallyBlockTree = tryStatementTree.finallyBlock(); if (finallyBlockTree != null) { currentBlock.isFinallyBlock = true; Block finallyBlock = currentBlock; build(finallyBlockTree); finallyBlock.addExitSuccessor(exitBlock()); exitBlocks.push(currentBlock); } Block finallyOrEndBlock = currentBlock; Block beforeFinally = createBlock(currentBlock); Map<Type, Block> catches = new HashMap<>(); TryStatement tryStatement = new TryStatement(); tryStatement.successorBlock = finallyOrEndBlock; enclosingTry.push(tryStatement); enclosedByCatch.push(false); for (CatchTree catchTree : tryStatementTree.catches()) { currentBlock = createBlock(finallyOrEndBlock); currentBlock.isCatchBlock = true; enclosedByCatch.push(true); build(catchTree.block()); enclosedByCatch.pop(); catches.put(catchTree.parameter().type().symbolType(), currentBlock); } catches.forEach(tryStatement::addCatch); currentBlock = beforeFinally; build(tryStatementTree.block()); build((List<? extends Tree>) tryStatementTree.resources()); enclosingTry.pop(); enclosedByCatch.pop(); currentBlock = createBlock(currentBlock); currentBlock.elements.add(tryStatementTree); if (finallyBlockTree != null) { exitBlocks.pop(); } }

Target:
private void buildTryStatement(TryStatementTree tryStatementTree) { currentBlock = createBlock(currentBlock); BlockTree finallyBlockTree = tryStatementTree.finallyBlock(); if (finallyBlockTree != null) { currentBlock.isFinallyBlock = true; Block finallyBlock = currentBlock; build(finallyBlockTree); finallyBlock.addExitSuccessor(exitBlock()); exitBlocks.push(currentBlock); } Block finallyOrEndBlock = currentBlock; Block beforeFinally = createBlock(currentBlock); TryStatement tryStatement = new TryStatement(); tryStatement.successorBlock = finallyOrEndBlock; enclosingTry.push(tryStatement); enclosedByCatch.push(false); for (CatchTree catchTree : tryStatementTree.catches()) { currentBlock = createBlock(finallyOrEndBlock); currentBlock.isCatchBlock = true; enclosedByCatch.push(true); build(catchTree.block()); enclosedByCatch.pop(); tryStatement.addCatch(catchTree.parameter().type().symbolType(), currentBlock); } currentBlock = beforeFinally; build(tryStatementTree.block()); build((List<? extends Tree>) tryStatementTree.resources()); enclosingTry.pop(); enclosedByCatch.pop(); currentBlock = createBlock(currentBlock); currentBlock.elements.add(tryStatementTree); if (finallyBlockTree != null) { exitBlocks.pop(); } }
Source:
private String readConfigurations(String groupId, String artifactId, String id, String attribute) { Plugin plugin = project.getPlugin(groupId + ":" + artifactId); if (plugin == null) { plugin = plugin(groupId(groupId), artifactId(artifactId), version("RELEASE")); } Xpp3Dom config = null; List<Plugin> buildPlugins = project.getBuildPlugins(); for (Plugin p : buildPlugins) { if (p.equals(plugin)) { config = (Xpp3Dom) p.getConfiguration(); log.info("config: " + config.toString()); PluginExecution pe; Map<String, PluginExecution> peMap = p.getExecutionsAsMap(); if ((pe = peMap.get(id)) != null ){ Xpp3Dom executionConfig = (Xpp3Dom) pe.getConfiguration(); config = Xpp3Dom.mergeXpp3Dom(executionConfig, config); log.info("install-apps config: " + config); for (Xpp3Dom elem : config.getChildren()){ log.info("elem: " + elem.getName()); if (elem.getName().equals(attribute)) { return elem.getValue(); } } String value = config.getAttribute(attribute); } break; } } return null; }

Target:
private String readConfigurations(String groupId, String artifactId, String id, String attribute) { Plugin plugin = project.getPlugin(groupId + ":" + artifactId); if (plugin == null) { plugin = plugin(groupId(groupId), artifactId(artifactId), version("RELEASE")); } Xpp3Dom config = null; List<Plugin> buildPlugins = project.getBuildPlugins(); for (Plugin p : buildPlugins) { if (p.equals(plugin)) { config = (Xpp3Dom) p.getConfiguration(); PluginExecution pe; Map<String, PluginExecution> peMap = p.getExecutionsAsMap(); if ((pe = peMap.get(id)) != null ){ Xpp3Dom executionConfig = (Xpp3Dom) pe.getConfiguration(); config = Xpp3Dom.mergeXpp3Dom(executionConfig, config); for (Xpp3Dom elem : config.getChildren()){ if (elem.getName().equals(attribute)) { return elem.getValue(); } } String value = config.getAttribute(attribute); } break; } } log.debug(attribute + " could not be found in the configuration file."); return null; }
Source:
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { if (inEventLoop()) { throw new IllegalStateException("cannot await termination of the current thread"); } threadLock.await(timeout, ObjectUtil.checkNotNull(unit, "unit")); return isTerminated(); }

Target:
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { ObjectUtil.checkNotNull(unit, "unit"); if (inEventLoop()) { throw new IllegalStateException("cannot await termination of the current thread"); } threadLock.await(timeout, unit); return isTerminated(); }
Source:
public byte[] getCacheKey() { if (pattern == null) { return ByteBuffer.allocate(1) .put(CACHE_TYPE_ID).array(); } byte[] patternBytes = StringUtils.toUtf8(pattern); return ByteBuffer.allocate(1 + patternBytes.length) .put(CACHE_TYPE_ID) .put(patternBytes) .array(); }

Target:
public byte[] getCacheKey() { byte[] patternBytes = StringUtils.toUtf8(pattern); return ByteBuffer.allocate(1 + patternBytes.length) .put(CACHE_TYPE_ID) .put(patternBytes) .array(); }
Source:
private boolean updatePostObject(boolean isAutosave) { if (!mEditPostRepository.hasPost() || mEditorFragment == null) { AppLog.e(AppLog.T.POSTS, "Attempted to save an invalid Post."); return true; } return mEditPostRepository.updateInTransaction(postModel -> { try { boolean postTitleOrContentChanged = updatePostContentNewEditor(postModel, isAutosave, (String) mEditorFragment.getTitle(), (String) mEditorFragment.getContent(postModel.getContent())); if (postTitleOrContentChanged) { mEditPostRepository.updatePublishDateIfShouldBePublishedImmediately(postModel); postModel .setDateLocallyChanged( DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); } } catch (EditorFragmentNotAddedException e) { AppLog.e(T.EDITOR, "Impossible to save the post, we weren't able to update it."); return false; } return true; }); }

Target:
private boolean updatePostObject(boolean isAutosave) { if (!mEditPostRepository.hasPost() || mEditorFragment == null) { AppLog.e(AppLog.T.POSTS, "Attempted to save an invalid Post."); return false; } return mEditPostRepository.updateInTransaction(postModel -> { try { boolean postTitleOrContentChanged = updatePostContentNewEditor(postModel, isAutosave, (String) mEditorFragment.getTitle(), (String) mEditorFragment.getContent(postModel.getContent())); if (postTitleOrContentChanged) { mEditPostRepository.updatePublishDateIfShouldBePublishedImmediately(postModel); postModel .setDateLocallyChanged( DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); } } catch (EditorFragmentNotAddedException e) { AppLog.e(T.EDITOR, "Impossible to save the post, we weren't able to update it."); return false; } return true; }); }
Source:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if (!children.get(0).evaluate(tuple, ptr)) { if (logger.isDebugEnabled()) { logger.debug("-> left value is null"); } return false; } PhoenixJson source = (PhoenixJson)PJson.INSTANCE.toObject(ptr, children.get(0).getSortOrder()); if (!children.get(1).evaluate(tuple, ptr)) { if (logger.isDebugEnabled()) { logger.debug("-> right value is null"); } return false; } String key = (String) PVarchar.INSTANCE.toObject(ptr, children.get(1).getSortOrder()); PhoenixJson jsonValue=source.getValue(key); if(jsonValue!=null) { defaultType=jsonValue.getValueAsPDataType(); ptr.set(jsonValue.valueWrapToBytes()); return true; } return false; }

Target:
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) { if (!children.get(0).evaluate(tuple, ptr)) { return false; } PhoenixJson source = (PhoenixJson)PJson.INSTANCE.toObject(ptr); if (!children.get(1).evaluate(tuple, ptr)) { return false; } String key = (String) PVarchar.INSTANCE.toObject(ptr); PhoenixJson jsonValue=source.getValue(key); if(jsonValue!=null) { ptr.set(jsonValue.valueWrapToBytes()); return true; } return false; }
Source:
public static CRSTable find( int tableId ) { for ( CRSTable table : CRSTable.values() ) { if ( tableId == table.tableId ) { return table; } } throw new IllegalArgumentException( "No known Coordinate Reference System table: " + tableId ); }

Target:
public static CRSTable find( int tableId ) { if ( tableId < TYPES.length ) { return TYPES[tableId]; } else { throw new IllegalArgumentException( "No known Coordinate Reference System table: " + tableId ); } }
Source:
private static byte[] print(final RsJSON.Source src) throws IOException { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final JsonWriter writer = Json.createWriter(baos); writer.write(src.toJSON()); writer.close(); return baos.toByteArray(); }

Target:
private static byte[] print(final RsJSON.Source src) throws IOException { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final JsonWriter writer = Json.createWriter(baos); try { writer.write(src.toJSON()); } finally { writer.close(); } return baos.toByteArray(); }
Source:
void subscribe(Observable<? extends T> source) { if (wip.getAndIncrement() == 0) { do { if (child.isUnsubscribed()) { break; } if (!active) { if (secondary) { AlternateSubscriber<T> as = new AlternateSubscriber<T>(child, arbiter); serial.set(as); active = true; alternate.unsafeSubscribe(as); } else { secondary = true; active = true; source.unsafeSubscribe(this); } } } while (wip.decrementAndGet() != 0); } }

Target:
void subscribe(Observable<? extends T> source) { if (wip.getAndIncrement() == 0) { do { if (child.isUnsubscribed()) { break; } if (!active) { if (source == null) { AlternateSubscriber<T> as = new AlternateSubscriber<T>(child, arbiter); serial.set(as); active = true; alternate.unsafeSubscribe(as); } else { active = true; source.unsafeSubscribe(this); source = null; } } } while (wip.decrementAndGet() != 0); } }
Source:
public GHCreateTeamBuilder createTeam(String name) { return new GHCreateTeamBuilder(root, "/orgs/" + login + "/teams", name); }

Target:
public GHTeamBuilder createTeam(String name) { return new GHTeamBuilder(root, login, name); }