auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void register() throws IOException { initSystemDirectory(); InetSocketAddress socketAddress = conf.getSocketAddrVar(ConfVars.TAJO_MASTER_UMBILICAL_RPC_ADDRESS); this.masterName = socketAddress.getAddress().getHostName()+ ":" + socketAddress.getPort(); monitorInterval = conf.getIntVar(ConfVars.TAJO_MASTER_HA_MONITOR_INTERVAL); FileStatus[] files = fs.listStatus(activePath); if (files.length == 0) { createMasterFile(true); currentActiveMaster = masterName; LOG.info(String.format("This is added to active master (%s)", masterName)); } else { Path activePath = files[0].getPath(); currentActiveMaster = activePath.getName().replaceAll("_", ":"); if (!HAServiceUtil.isMasterAlive(currentActiveMaster, conf)) { fs.delete(activePath, true); createMasterFile(true); currentActiveMaster = masterName; LOG.info(String.format("This is added to active master (%s)", masterName)); } else { if (!currentActiveMaster.equals(masterName)) { createMasterFile(false); LOG.info(String.format("This is added to backup masters (%s)", masterName)); } else { LOG.info(String.format("This has already been added to active master (%s)", masterName)); } } } }

Target:
public void register() throws IOException { initSystemDirectory(); InetSocketAddress socketAddress = conf.getSocketAddrVar(ConfVars.TAJO_MASTER_UMBILICAL_RPC_ADDRESS); this.masterName = socketAddress.getAddress().getHostAddress() + ":" + socketAddress.getPort(); monitorInterval = conf.getIntVar(ConfVars.TAJO_MASTER_HA_MONITOR_INTERVAL); FileStatus[] files = fs.listStatus(activePath); if (files.length == 0) { createMasterFile(true); currentActiveMaster = masterName; LOG.info(String.format("This is added to active master (%s)", masterName)); } else { Path activePath = files[0].getPath(); currentActiveMaster = activePath.getName().replaceAll("_", ":"); if (!HAServiceUtil.isMasterAlive(currentActiveMaster, conf)) { fs.delete(activePath, true); createMasterFile(true); currentActiveMaster = masterName; LOG.info(String.format("This is added to active master (%s)", masterName)); } else { if (!currentActiveMaster.equals(masterName)) { createMasterFile(false); LOG.info(String.format("This is added to backup masters (%s)", masterName)); } else { LOG.info(String.format("This has already been added to active master (%s)", masterName)); } } } }
Source:
public long getLastModified(K src) { if (src instanceof URL) { URLConnection conn = null; try { conn = ((URL) src).openConnection(); final long v = conn.getLastModified(); return v != -1 ? v : 0; } catch (Throwable ex) { return -1; } finally { if (conn != null) { try { conn.getInputStream().close(); } catch (Exception ignored) { } } } } else if (src instanceof File) { final long v = ((File) src).lastModified(); return v == -1 ? 0 : v == 0 ? -1 : v; } else if (src == null) { throw new NullPointerException(); } else { throw new IllegalArgumentException("Unknown source: " + src + "\nOnly File and URL are supported"); } }

Target:
public long getLastModified(K src) { if (src instanceof URL) { URLConnection conn = null; try { conn = ((URL) src).openConnection(); final long v = conn.getLastModified(); return v != -1 ? v : 0; } catch (Throwable ex) { return -1; } finally { if (conn != null) { try { conn.getInputStream().close(); } catch (Throwable e) { log.warn("The connection cannot be closed", e); } } } } else if (src instanceof File) { final long v = ((File) src).lastModified(); return v == -1 ? 0 : v == 0 ? -1 : v; } else if (src == null) { throw new NullPointerException(); } else { throw new IllegalArgumentException("Unknown source: " + src + "\nOnly File and URL are supported"); } }
Source:
public RegexParseSpec( @JsonProperty("timestampSpec") TimestampSpec timestampSpec, @JsonProperty("dimensionsSpec") DimensionsSpec dimensionsSpec, @JsonProperty("listDelimiter") String listDelimiter, @JsonProperty("columns") List<String> columns, @JsonProperty("pattern") String pattern ) { super(timestampSpec, dimensionsSpec); this.listDelimiter = listDelimiter; Preconditions.checkNotNull(columns, "columns"); this.columns = columns; this.pattern = pattern; verify(dimensionsSpec.getDimensions()); }

Target:
public RegexParseSpec( @JsonProperty("timestampSpec") TimestampSpec timestampSpec, @JsonProperty("dimensionsSpec") DimensionsSpec dimensionsSpec, @JsonProperty("listDelimiter") String listDelimiter, @JsonProperty("columns") List<String> columns, @JsonProperty("pattern") String pattern ) { super(timestampSpec, dimensionsSpec); this.listDelimiter = listDelimiter; this.columns = columns; this.pattern = pattern; verify(dimensionsSpec.getDimensions()); }
Source:
public String changePagination() { int[] pageSelection = new int[allPagesSelection.length]; for (int i = 0; i < allPagesSelection.length; i++) { pageSelection[i] = Integer.parseInt(allPagesSelection[i].split(":")[0]) - 1; } try { paginator.setPageSelection(pageSelection); paginator.setPagesToPaginate(allPagesNew); paginator.setFictitious(fictitious); paginator.setPaginationSeparator(paginationSeparators.getObject().getSeparatorString()); paginator.setPaginationStartValue(paginationValue); paginator.run(); } catch (IllegalArgumentException e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung("fehlerBeimEinlesen", e.getMessage()); } allPagesSelection = null; retrieveAllImages(); if (!updateBlocked()) { return "SperrungAbgelaufen"; } return null; }

Target:
public String changePagination() { int[] pageSelection = new int[allPagesSelection.length]; for (int i = 0; i < allPagesSelection.length; i++) { pageSelection[i] = Integer.parseInt(allPagesSelection[i].split(":")[0]) - 1; } try { paginator.setPageSelection(pageSelection); paginator.setPagesToPaginate(allPagesNew); paginator.setFictitious(fictitious); paginator.setPaginationSeparator(paginationSeparators.getObject().getSeparatorString()); paginator.setPaginationStartValue(paginationValue); paginator.run(); } catch (IllegalArgumentException e) { Helper.setErrorMessage("fehlerBeimEinlesen", logger, e); } allPagesSelection = null; retrieveAllImages(); if (!updateBlocked()) { return "SperrungAbgelaufen"; } return null; }
Source:
private static List<InetSocketAddress> loadRouters(String hostsFilePath) throws IOException { List<String> hostPorts; try (Reader reader = new FileReader(hostsFilePath)) { hostPorts = new Gson().fromJson(reader, List.class); } List<InetSocketAddress> routers = new LinkedList<>(); for (String hostPort : hostPorts) { String[] hostPortPair = hostPort.split(Pattern.quote(":")); String host = hostPortPair[0]; int port = Integer.parseInt(hostPortPair[1]); InetSocketAddress router = new InetSocketAddress(host, port); routers.add(router); } return routers; }

Target:
private static List<InetSocketAddress> loadRouters(String hostsFilePath) throws IOException { List<String> hostPorts; try (Reader reader = new FileReader(hostsFilePath)) { hostPorts = new Gson().fromJson(reader, List.class); } List<InetSocketAddress> routers = new ArrayList<>(); for (String hostPort : hostPorts) { String[] hostPortPair = hostPort.split(Pattern.quote(":")); String host = hostPortPair[0]; int port = Integer.parseInt(hostPortPair[1]); InetSocketAddress router = new InetSocketAddress(host, port); routers.add(router); } return routers; }
Source:
public boolean checksEventType(GameEvent event, Game game) { if (event.getType() == EventType.TAPPED_FOR_MANA) { ManaEvent manaEvent = (ManaEvent) event; Mana mana = manaEvent.getMana(); return mana.count() > 1; } return false; }

Target:
public boolean checksEventType(GameEvent event, Game game) { return event.getType() == EventType.TAPPED_FOR_MANA; }
Source:
public void cachePeriodicUpdateTriggered() throws InterruptedException { final Cache cache = Mockito.mock(Cache.class); final ZookeeperNodeInvalidator invalidator = new ZookeeperNodeInvalidator(cache, CURATOR, "/xxx/yyy1", 100); invalidator.start(); try { ThreadUtils.sleep(600); Mockito.verify(cache, Mockito.atLeast(4)).refresh(); Mockito.verify(cache, Mockito.atMost(7)).refresh(); } finally { invalidator.stop(); } }

Target:
public void cachePeriodicUpdateTriggered() throws InterruptedException { final Cache cache = Mockito.mock(Cache.class); final long forceRefreshMs = 100; final ZookeeperNodeInvalidator invalidator = new ZookeeperNodeInvalidator(cache, CURATOR, "/xxx/yyy1", forceRefreshMs); invalidator.start(); try { final long startedAt = System.currentTimeMillis(); waitForNCachesRefreshes(6, false, Collections.singleton(cache)); final long allRefreshesFinished = System.currentTimeMillis(); Assert.assertTrue((allRefreshesFinished - startedAt) >= (4 * forceRefreshMs)); } finally { invalidator.stop(); } }
Source:
private List<UserResponse> getCloudstackUsers() { if (cloudstackUsers == null) { ListResponse<UserResponse> cloudstackUsersresponse; switch (getUserFilter()) { case ANY_DOMAIN: cloudstackUsersresponse = _queryService.searchForUsers(CallContext.current().getCallingAccount().getDomainId(), true); break; case NO_FILTER: cloudstackUsersresponse = _queryService.searchForUsers(this.domainId,true); break; case POTENTIAL_IMPORT: case LOCAL_DOMAIN: cloudstackUsersresponse = _queryService.searchForUsers(this.domainId,false); break; default: throw new CloudRuntimeException("error in program login; we are not filtering but still querying users to filter???"); } cloudstackUsers = cloudstackUsersresponse.getResponses(); if(s_logger.isTraceEnabled()) { StringBuilder users = new StringBuilder(); for (UserResponse user : cloudstackUsers) { if (users.length()> 0) { users.append(", "); } users.append(user.getUsername()); } s_logger.trace(String.format("checking against %d cloudstackusers: %s.", this.cloudstackUsers.size(), users.toString())); } } return cloudstackUsers; }

Target:
private List<UserResponse> getCloudstackUsers() { if (cloudstackUsers == null) { try { cloudstackUsers = getUserFilter().getCloudstackUserList(this).getResponses(); } catch (IllegalArgumentException e) { throw new CloudRuntimeException("error in program login; we are not filtering but still querying users to filter???", e); } traceUserList(); } return cloudstackUsers; }
Source:
public String getContent(String guid, PageOrientation orientation) { checkInitialized(); String toReturn; DataRightAnchor anchor = guidToAnchor.get(guid); DataRightId key = anchor.getDataRightId(); boolean needsPageBreak = anchor.isNeedsPageBreak(); boolean isNextDifferent = anchor.isNextDifferent(); DataRight dataRight = dataRightIdToDataRight.get(key); String partialFooter = dataRight.getContent(); if (orientation.isLandscape()) { toReturn = partialFooter; } else if (isNextDifferent || needsPageBreak) { if (!needsPageBreak) { toReturn = String.format(SAME_PAGE_TEMPLATE, partialFooter); } else { toReturn = String.format(NEW_PAGE_TEMPLATE, partialFooter); } } else { toReturn = ""; } return toReturn; }

Target:
public String getContent(String guid, PageOrientation orientation) { checkInitialized(); String toReturn; DataRightAnchor anchor = guidToAnchor.get(guid); DataRightId key = anchor.getDataRightId(); boolean needsPageBreak = anchor.isNeedsPageBreak(); boolean isNextDifferent = anchor.isNextDifferent(); DataRight dataRight = dataRightIdToDataRight.get(key); String partialFooter = dataRight.getContent(); if (orientation.isLandscape()) { toReturn = partialFooter; } else if (isNextDifferent || needsPageBreak) { if (needsPageBreak) { toReturn = String.format(NEW_PAGE_TEMPLATE, partialFooter); } else { toReturn = String.format(SAME_PAGE_TEMPLATE, partialFooter); } } else { toReturn = ""; } return toReturn; }
Source:
private void addOperatorAddToSet(IVariant variant, BasicDBObject update) { BasicDBObject addToSet = new BasicDBObject(); if (!variant.getSourceEntries().isEmpty()) { IVariantSourceEntry variantSourceEntry = getVariantSourceEntry(variant); addToSet.put(VariantMongo.FILES_FIELD, convertSourceEntry(variantSourceEntry)); if (includeStats) { BasicDBList statistics = convertStatistics(variantSourceEntry); addToSet.put(VariantMongo.STATISTICS_FIELD, new BasicDBObject("$each", statistics)); } } if (variant.getIds() != null && !variant.getIds().isEmpty()) { addToSet.put(IDS_FIELD, new BasicDBObject("$each", variant.getIds())); } if (variant.getDbsnpIds() != null && !variant.getDbsnpIds().isEmpty()) { addToSet.put(DBSNP_IDS_FIELD, new BasicDBObject("$each", variant.getDbsnpIds())); } if (!addToSet.isEmpty()) { update.put("$addToSet", addToSet); } }

Target:
private void addOperatorAddToSet(IVariant variant, BasicDBObject update) { BasicDBObject addToSet = new BasicDBObject(); if (!variant.getSourceEntries().isEmpty()) { IVariantSourceEntry variantSourceEntry = getVariantSourceEntry(variant); addToSet.put(VariantMongo.FILES_FIELD, convertSourceEntry(variantSourceEntry)); if (includeStats) { BasicDBList statistics = convertStatistics(variantSourceEntry); addToSet.put(VariantMongo.STATISTICS_FIELD, new BasicDBObject("$each", statistics)); } } if (!variant.getIds().isEmpty()) { addToSet.put(IDS_FIELD, new BasicDBObject("$each", variant.getIds())); } if (!variant.getDbsnpIds().isEmpty()) { addToSet.put(DBSNP_IDS_FIELD, new BasicDBObject("$each", variant.getDbsnpIds())); } if (!addToSet.isEmpty()) { update.put("$addToSet", addToSet); } }
Source:
public synchronized void deleteRepository( String id ) throws NoSuchRepositoryException, IOException, ConfigurationException { Repository repository = repositoryRegistry.getRepository( id ); repository.setLocalStatus( LocalStatus.OUT_OF_SERVICE ); repository.setIndexable( false ); repository.setSearchable( false ); List<ShadowRepository> shadows = repositoryRegistry.getRepositoriesWithFacet( ShadowRepository.class ); for ( Iterator<ShadowRepository> i = shadows.iterator(); i.hasNext(); ) { ShadowRepository shadow = i.next(); if ( repository.getId().equals( shadow.getMasterRepository().getId() ) ) { throw new ConfigurationException( "The repository '" + repository.getName() + "' is not deletable cause '" + shadow.getName() + "' depends on it!" ); } } List<CPathMappingItem> pathMappings = getConfigurationModel().getRepositoryGrouping().getPathMappings(); for ( Iterator<CPathMappingItem> i = pathMappings.iterator(); i.hasNext(); ) { CPathMappingItem item = i.next(); item.removeRepository( id ); } repositoryRegistry.removeRepository( id ); List<CRepository> reposes = getConfigurationModel().getRepositories(); for ( Iterator<CRepository> i = reposes.iterator(); i.hasNext(); ) { CRepository repo = i.next(); if ( repo.getId().equals( id ) ) { i.remove(); saveConfiguration(); releaseRepository( repository, getConfigurationModel(), repo ); return; } } throw new NoSuchRepositoryException( id ); }

Target:
public synchronized void deleteRepository( String id ) throws NoSuchRepositoryException, IOException, ConfigurationException { Repository repository = repositoryRegistry.getRepository( id ); repository.setLocalStatus( LocalStatus.OUT_OF_SERVICE ); repository.setIndexable( false ); repository.setSearchable( false ); List<ShadowRepository> shadows = repositoryRegistry.getRepositoriesWithFacet( ShadowRepository.class ); for ( Iterator<ShadowRepository> i = shadows.iterator(); i.hasNext(); ) { ShadowRepository shadow = i.next(); if ( repository.getId().equals( shadow.getMasterRepository().getId() ) ) { throw new RepositoryDependentException( repository, shadow ); } } List<CPathMappingItem> pathMappings = getConfigurationModel().getRepositoryGrouping().getPathMappings(); for ( Iterator<CPathMappingItem> i = pathMappings.iterator(); i.hasNext(); ) { CPathMappingItem item = i.next(); item.removeRepository( id ); } repositoryRegistry.removeRepository( id ); List<CRepository> reposes = getConfigurationModel().getRepositories(); for ( Iterator<CRepository> i = reposes.iterator(); i.hasNext(); ) { CRepository repo = i.next(); if ( repo.getId().equals( id ) ) { i.remove(); saveConfiguration(); releaseRepository( repository, getConfigurationModel(), repo ); return; } } throw new NoSuchRepositoryException( id ); }
Source:
MongoDBTracing(Builder builder) { tracing = builder.tracing; maxAbbreviatedCommandLength = builder.maxAbbreviatedCommandLength; commandsWithCollectionName = Collections.unmodifiableSet(builder.commandsWithCollectionName); }

Target:
MongoDBTracing(Builder builder) { tracing = builder.tracing; }
Source:
public static boolean writeFile(String fileName, String content, int issueCount) { boolean validPath = !(fileName == null || fileName.isEmpty()); if (validPath) { try { PrintWriter writer = new PrintWriter(fileName, "UTF-8"); writer.println(content); writer.close(); long sizeAfterWrite = 0; if (issueCount > 0) { sizeAfterWrite = Files.size(Paths.get(fileName)); } return processFileGrowth(sizeAfterWrite, issueCount, fileName); } catch (IOException e) { logger.error(e.getLocalizedMessage(), e); return true; } } return false; }

Target:
public static boolean writeFile(String fileName, String content, int issueCount) { boolean validPath = !(fileName == null || fileName.isEmpty()); if (validPath) { try { PrintWriter writer = new PrintWriter(fileName, "UTF-8"); writer.println(content); writer.close(); long sizeAfterWrite = Files.size(Paths.get(fileName)); return processFileGrowth(sizeAfterWrite, issueCount, fileName); } catch (IOException e) { logger.error(e.getLocalizedMessage(), e); return true; } } return false; }
Source:
public void testNonExistentArgument(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { systemErr.capture(); systemOut.capture(); JavadocPropertiesGenerator.main("--nonexistent-argument"); final String expected = String.format(Locale.ROOT, "Missing required options " + "[--destfile=<outputFile>, params[0]=<inputFile>]%n") + USAGE; assertEquals(expected, systemErr.getCapturedData(), "Unexpected error log"); assertEquals("", systemOut.getCapturedData(), "Unexpected output log"); }

Target:
public void testNonExistentArgument(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { JavadocPropertiesGenerator.main("--nonexistent-argument"); final String expected = String.format(Locale.ROOT, "Missing required options " + "[--destfile=<outputFile>, params[0]=<inputFile>]%n") + USAGE; assertEquals(expected, systemErr.getCapturedData(), "Unexpected error log"); assertEquals("", systemOut.getCapturedData(), "Unexpected output log"); }
Source:
public void setAwsCredentials(AWSCredentials cred) { this.credProvider = new AWSStaticCredentialsProvider(cred); }

Target:
public void setAwsCredentials(AWSCredentials cred) { this.cred = cred; }
Source:
public V get(K key) { getObserver.begin(); try { statusTransitioner.checkAvailable(); checkNonNull(key); try { Store.ValueHolder<V> valueHolder = doGet(key); if (valueHolder == null) { getObserver.end(GetOutcome.MISS); return null; } else { getObserver.end(GetOutcome.HIT); return valueHolder.get(); } } catch (StoreAccessException e) { V value = resilienceStrategy.getFailure(key, e); getObserver.end(GetOutcome.FAILURE); return value; } } catch(Exception e) { getObserver.end(GetOutcome.FAILURE); throw e; } }

Target:
public V get(K key) { getObserver.begin(); try { statusTransitioner.checkAvailable(); checkNonNull(key); try { Store.ValueHolder<V> valueHolder = doGet(key); if (valueHolder == null) { getObserver.end(GetOutcome.MISS); return null; } else { getObserver.end(GetOutcome.HIT); return valueHolder.get(); } } catch (StoreAccessException e) { V value = resilienceStrategy.getFailure(key, e); getObserver.end(GetOutcome.FAILURE); return value; } } catch (Throwable e) { getObserver.end(GetOutcome.FAILURE); throw e; } }
Source:
public void setTabViews() { for (int i = 0; i < NavTab.size(); i++) { NavTab navTab = NavTab.of(i); if (AccountUtil.isLoggedIn()) { getMenu().add(Menu.NONE, i, i, navTab.text()).setIcon(navTab.icon()); } else { if (!(NavTab.SUGGESTED_EDITS == navTab)) { getMenu().add(Menu.NONE, i, i, navTab.text()).setIcon(navTab.icon()); } } } }

Target:
public void setTabViews() { getMenu().clear(); for (int i = 0; i < NavTab.size(); i++) { NavTab navTab = NavTab.of(i); if (!AccountUtil.isLoggedIn() && NavTab.SUGGESTED_EDITS == navTab) { continue; } getMenu().add(Menu.NONE, i, i, navTab.text()).setIcon(navTab.icon()); } }
Source:
public Map<String, Object> apply(@Nullable Image from) { if (from == null) return null; Map<String, Object> headers = Maps.newHashMap(); addIfNotNull(headers, ID, from.getName()); addIfNotNull(headers, NAME, from.getName()); addIfNotNull(headers, MIN_DISK, from.getMinDisk()); addIfNotNull(headers, MIN_RAM, from.getMinRam()); addIfNotNull(headers, OWNER, from.getOwner()); addIfNotNull(headers, IS_PUBLIC, from.isPublic()); addIfNotNull(headers, PROTECTED, from.isProtected()); addIfNotNull(headers, CHECKSUM, from.getChecksum()); addIfNotNull(headers, SIZE, from.getSize()); addIfNotNull(headers, STORE, from.getStoreType()); addIfNotNull(headers, COPY_FROM, from.getCopyFrom(), false); if (from.getContainerFormat() != ContainerFormat.UNRECOGNIZED) headers.put(CONTAINER_FORMAT.asHeader(), from.getContainerFormat().value()); if (from.getDiskFormat() != DiskFormat.UNRECOGNIZED) headers.put(DISK_FORMAT.asHeader(), from.getDiskFormat().value()); if (from.getProperties() != null) { for (String k : from.getProperties().keySet()) { headers.put(PROPERTY.asHeader()+"-"+k, from.getProperties().get(k)); } } return headers; }

Target:
public Map<String, Object> apply(@Nullable Image from) { if (from == null) return null; Map<String, Object> headers = Maps.newHashMap(); addIfNotNull(headers, ID, from.getId()); addIfNotNull(headers, NAME, from.getName()); addIfNotNull(headers, MIN_DISK, from.getMinDisk()); addIfNotNull(headers, MIN_RAM, from.getMinRam()); addIfNotNull(headers, OWNER, from.getOwner()); addIfNotNull(headers, IS_PUBLIC, from.isPublic()); addIfNotNull(headers, PROTECTED, from.isProtected()); addIfNotNull(headers, CHECKSUM, from.getChecksum()); addIfNotNull(headers, SIZE, from.getSize()); addIfNotNull(headers, STORE, from.getStoreType()); addIfNotNull(headers, COPY_FROM, from.getCopyFrom(), false); if (from.getContainerFormat() != ContainerFormat.UNRECOGNIZED) headers.put(CONTAINER_FORMAT.asHeader(), from.getContainerFormat().value()); if (from.getDiskFormat() != DiskFormat.UNRECOGNIZED) headers.put(DISK_FORMAT.asHeader(), from.getDiskFormat().value()); if (from.getProperties() != null) { for (String k : from.getProperties().keySet()) { headers.put(PROPERTY.asHeader()+"-"+k, from.getProperties().get(k)); } } return headers; }
Source:
public void testUserValues() { MetricType.userTypes().stream().filter(metricType -> metricType == MetricType.COUNTER_RATE).forEach (metricType -> fail("COUNTER_RATE is not user defined type")); assertEquals(3, MetricType.userTypes().size()); }

Target:
public void testUserValues() { assertFalse("COUNTER_RATE is not user defined type", MetricType.userTypes().contains(MetricType.COUNTER_RATE)); assertEquals(3, MetricType.userTypes().size()); }
Source:
public QueryResult<ChannelSchedule> execute(ScheduleQuery query) throws QueryExecutionException { if (!query.getEnd().isPresent()) { throw new UnsupportedOperationException( "'count' parameter not supported in non-equivalent schedule store. Please specify 'to' parameter in your request"); } Iterable<Channel> channels = resolveChannels(query); List<Channel> defaultChannels = Lists.newArrayList(channels); List<Channel> ebsChannels = new ArrayList<>(); if (query.getContext().getApplicationSources().getAccessRoles().contains( ApplicationAccessRole.PREFER_EBS_SCHEDULE)) { ebsChannels = defaultChannels.stream() .filter(channel -> channel.getAvailableFrom().contains(Publisher.BT_SPORT_EBS)) .collect(Collectors.toList()); defaultChannels.removeAll(ebsChannels); } List<ChannelSchedule> channelScheduleList = getChannelScheduleList(ebsChannels, defaultChannels, query); if (query.isMultiChannel()) { return QueryResult.listResult( channelScheduleList, query.getContext(), channelScheduleList.size() ); } return QueryResult.singleResult( Iterables.getOnlyElement(channelScheduleList), query.getContext() ); }

Target:
public QueryResult<ChannelSchedule> execute(ScheduleQuery query) throws QueryExecutionException { if (!query.getEnd().isPresent()) { throw new UnsupportedOperationException( "'count' parameter not supported in non-equivalent schedule store. Please specify 'to' parameter in your request"); } Iterable<Channel> channels = resolveChannels(query); Ordering<ChannelSchedule> ordering = Ordering.explicit( StreamSupport.stream(channels.spliterator(), false) .map(Channel::getId) .collect(MoreCollectors.toImmutableList()) ) .onResultOf(channelSchedule -> channelSchedule.getChannel().getId()); ImmutableList<ChannelSchedule> orderedChannelSchedules = ImmutableList.copyOf( ordering.sortedCopy( getChannelSchedules(channels, query) ) ); if (query.isMultiChannel()) { return QueryResult.listResult( orderedChannelSchedules, query.getContext(), orderedChannelSchedules.size() ); } return QueryResult.singleResult( Iterables.getOnlyElement(orderedChannelSchedules), query.getContext() ); }
Source:
private int findStartPositionForFunction(JoinFilterFunction searchFunction, int[] links, int startOffset, int probePosition, Page allProbeChannelsPage) { if (applySearchFunction(searchFunction, links, startOffset, probePosition, allProbeChannelsPage)) { return startOffset; } int left = startOffset; int right = links.length - 1; int offset = lowerBound(searchFunction, links, left, right, probePosition, allProbeChannelsPage); if (offset < 0) { return -1; } if (!applySearchFunction(searchFunction, links, offset, probePosition, allProbeChannelsPage)) { return -1; } return offset; }

Target:
private int findStartPositionForFunction(JoinFilterFunction searchFunction, int[] links, int startOffset, int probePosition, Page allProbeChannelsPage) { if (applySearchFunction(searchFunction, links, startOffset, probePosition, allProbeChannelsPage)) { return startOffset; } int offset = lowerBound(searchFunction, links, startOffset, links.length - 1, probePosition, allProbeChannelsPage); if (!applySearchFunction(searchFunction, links, offset, probePosition, allProbeChannelsPage)) { return -1; } return offset; }
Source:
private void initVmTemplate() { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (!ovfEntityList.isEmpty()) { try { ovfEntityData = ovfEntityList.get(0); vmTemplateFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmTemplateFromConfiguration.setClusterId(getParameters().getClusterId()); VmHandler.updateMaxMemorySize(vmTemplateFromConfiguration, getEffectiveCompatibilityVersion()); setVmTemplate(vmTemplateFromConfiguration); getParameters().setVmTemplate(vmTemplateFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskTemplateMap() != null) { ArrayList imageList = new ArrayList<>(getParameters().getDiskTemplateMap().values()); vmTemplateFromConfiguration.setDiskList(imageList); ensureDomainMap(imageList, getParameters().getDestDomainId()); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception", e); } } setClusterId(getParameters().getClusterId()); setStoragePoolId(getCluster().getStoragePoolId()); }

Target:
private void initVmTemplate() { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (!ovfEntityList.isEmpty()) { try { ovfEntityData = ovfEntityList.get(0); vmTemplateFromConfiguration = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()); vmTemplateFromConfiguration.setClusterId(getParameters().getClusterId()); setVmTemplate(vmTemplateFromConfiguration); setEffectiveCompatibilityVersion(CompatibilityVersionUtils.getEffective(getVmTemplate(), this::getCluster)); VmHandler.updateMaxMemorySize(getVmTemplate(), getEffectiveCompatibilityVersion()); getParameters().setVmTemplate(vmTemplateFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskTemplateMap() != null) { ArrayList imageList = new ArrayList<>(getParameters().getDiskTemplateMap().values()); vmTemplateFromConfiguration.setDiskList(imageList); ensureDomainMap(imageList, getParameters().getDestDomainId()); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception", e); } } setClusterId(getParameters().getClusterId()); setStoragePoolId(getCluster().getStoragePoolId()); }
Source:
public HttpConnection create(URL url) throws IOException { return new HttpClientConnection(url.toString(), null, lookupHttpClientBuilder(url).build()); }

Target:
public HttpConnection create(URL url) throws IOException { return create(url, null); }
Source:
public void testBufferRecycledOnFailure() throws IOException { FailingChannelStateSerializer serializer = new FailingChannelStateSerializer(); TestRecoveredChannelStateHandler handler = new TestRecoveredChannelStateHandler(); try (FSDataInputStream stream = geStream(serializer, 10)) { new ChannelStateChunkReader(serializer).readChunk(stream, serializer.getHeaderLength(), handler, "channelInfo"); checkState(serializer.failed); checkState(!handler.requestedBuffers.isEmpty()); } finally { assertTrue(handler.requestedBuffers.stream().allMatch(TestChannelStateByteBuffer::isRecycled)); } }

Target:
public void testBufferRecycledOnFailure() throws IOException, InterruptedException { FailingChannelStateSerializer serializer = new FailingChannelStateSerializer(); TestRecoveredChannelStateHandler handler = new TestRecoveredChannelStateHandler(); try (FSDataInputStream stream = getStream(serializer, 10)) { new ChannelStateChunkReader(serializer).readChunk(stream, serializer.getHeaderLength(), handler, "channelInfo"); } finally { checkState(serializer.failed); checkState(!handler.requestedBuffers.isEmpty()); assertTrue(handler.requestedBuffers.stream().allMatch(TestChannelStateByteBuffer::isRecycled)); } }
Source:
public void close() { try { compressorPool.close(); } catch (Exception e) { LOG.error(e); } try { decompressorPool.close(); } catch (Exception e) { LOG.error(e); } }

Target:
public void close() { try { compressorPool.close(); } catch (Exception e) { LOG.error("Exception while closing compressor pool", e); } try { decompressorPool.close(); } catch (Exception e) { LOG.error("Exception while closing decompressor pool", e); } }
Source:
TDigestBuildSketchAggregatorFactory( final String name, final String fieldName, @Nullable final Integer compression, final byte cacheTypeId ) { Objects.requireNonNull(name, "Must have a valid, non-null aggregator name"); this.name = name; Objects.requireNonNull(fieldName, "Parameter fieldName must be specified"); this.fieldName = fieldName; this.compression = compression == null ? DEFAULT_COMRESSION : compression; this.cacheTypeId = cacheTypeId; }

Target:
TDigestBuildSketchAggregatorFactory( final String name, final String fieldName, @Nullable final Integer compression, final byte cacheTypeId ) { this.name = Objects.requireNonNull(name, "Must have a valid, non-null aggregator name"); this.fieldName = Objects.requireNonNull(fieldName, "Parameter fieldName must be specified"); this.compression = compression == null ? DEFAULT_COMPRESSION : compression; this.cacheTypeId = cacheTypeId; }
Source:
public void handleEvent(Event event) { if (event.getType() == Event.Type.FLOW_FINISHED) { FlowRunner flowRunner = (FlowRunner) event.getRunner(); ExecutableFlow flow = flowRunner.getExecutableFlow(); recentlyFinishedFlows.put(flow.getExecutionId(), flow); logger.info("Flow " + flow.getExecutionId() + " is finished. Adding it to recently finished flows list."); runningFlows.remove(flow.getExecutionId()); submittedFlows.remove(flow.getExecutionId()); } }

Target:
public void handleEvent(Event event) { if (event.getType() == Event.Type.FLOW_FINISHED) { FlowRunner flowRunner = (FlowRunner) event.getRunner(); ExecutableFlow flow = flowRunner.getExecutableFlow(); recentlyFinishedFlows.put(flow.getExecutionId(), flow); logger.info("Flow " + flow.getExecutionId() + " is finished. Adding it to recently finished flows list."); runningFlows.remove(flow.getExecutionId()); } }
Source:
public RowData deserialize( byte[] recordValue, String partitionKey, String seqNum, long approxArrivalTimestamp, String stream, String shardId) throws IOException { RowData physicalRow = physicalDeserializer.deserialize(recordValue); GenericRowData metadataRow = new GenericRowData(requestedMetadataFields.size()); for (int i = 0; i < metadataRow.getArity(); i++) { Metadata metadataField = requestedMetadataFields.get(i); if (metadataField == Metadata.ApproximateArrivalTimestamp) { metadataRow.setField(i, TimestampData.fromEpochMillis(approxArrivalTimestamp)); } else if (metadataField == Metadata.SequenceNumber) { metadataRow.setField(i, StringData.fromString(seqNum)); } else if (metadataField == Metadata.ShardId) { metadataRow.setField(i, StringData.fromString(shardId)); } else { String msg = String.format("Unsupported metadata key %s", metadataField); throw new RuntimeException(msg); } } JoinedRowData joinedRowData = new JoinedRowData(physicalRow, metadataRow); joinedRowData.setRowKind(physicalRow.getRowKind()); return joinedRowData; }

Target:
public RowData deserialize( byte[] recordValue, String partitionKey, String seqNum, long approxArrivalTimestamp, String stream, String shardId) throws IOException { RowData physicalRow = physicalDeserializer.deserialize(recordValue); GenericRowData metadataRow = new GenericRowData(requestedMetadataFields.size()); for (int i = 0; i < metadataRow.getArity(); i++) { Metadata metadataField = requestedMetadataFields.get(i); if (metadataField == Metadata.Timestamp) { metadataRow.setField(i, TimestampData.fromEpochMillis(approxArrivalTimestamp)); } else if (metadataField == Metadata.SequenceNumber) { metadataRow.setField(i, StringData.fromString(seqNum)); } else if (metadataField == Metadata.ShardId) { metadataRow.setField(i, StringData.fromString(shardId)); } else { String msg = String.format("Unsupported metadata key %s", metadataField); throw new RuntimeException(msg); } } JoinedRowData joinedRowData = new JoinedRowData(physicalRow, metadataRow); joinedRowData.setRowKind(physicalRow.getRowKind()); return joinedRowData; }
Source:
public void visit(SystemStreamPartition systemStreamPartition, StartpointSpecific startpointSpecific) { TopicPartition topicPartition = toTopicPartition(systemStreamPartition); long offsetInStartpoint = Long.parseLong(startpointSpecific.getSpecificOffset()); LOG.info("Updating the consumer fetch offsets of topic partition: to {}.", topicPartition, offsetInStartpoint); synchronized (kafkaConsumer) { kafkaConsumer.seek(topicPartition, offsetInStartpoint); } proxy.addTopicPartition(systemStreamPartition, kafkaConsumer.position(topicPartition)); }

Target:
public void visit(SystemStreamPartition systemStreamPartition, StartpointSpecific startpointSpecific) { TopicPartition topicPartition = toTopicPartition(systemStreamPartition); long offsetInStartpoint = Long.parseLong(startpointSpecific.getSpecificOffset()); LOG.info("Updating the consumer fetch offsets of topic partition: to {}.", topicPartition, offsetInStartpoint); synchronized (kafkaConsumer) { kafkaConsumer.seek(topicPartition, offsetInStartpoint); proxy.addTopicPartition(systemStreamPartition, kafkaConsumer.position(topicPartition)); } }
Source:
public AtomicFileWriter(@Nonnull Path destinationPath, @Nonnull Charset charset) throws IOException { if (charset == null) { throw new IllegalArgumentException("charset is null"); } this.destPath = destinationPath; Path dir = this.destPath.getParent(); try { Files.createDirectories(dir); tmpPath = Files.createTempFile(dir, "atomic", "tmp"); } catch (IOException e) { throw new IOException("Failed to create a temporary file in "+ dir,e); } core = Files.newBufferedWriter(tmpPath, charset, StandardOpenOption.SYNC); }

Target:
public AtomicFileWriter(@Nonnull Path destinationPath, @Nonnull Charset charset) throws IOException { if (charset == null) { throw new IllegalArgumentException("charset is null"); } this.destPath = destinationPath; Path dir = this.destPath.getParent(); if (Files.exists(dir) && !Files.isDirectory(dir)) { throw new IOException(dir + " exists and is neither a directory nor a symlink to a directory"); } else { if (Files.isSymbolicLink(dir)) { LOGGER.log(Level.CONFIG, "{0} is a symlink to a directory", dir); } else { Files.createDirectories(dir); } } try { tmpPath = Files.createTempFile(dir, "atomic", "tmp"); } catch (IOException e) { throw new IOException("Failed to create a temporary file in "+ dir,e); } core = Files.newBufferedWriter(tmpPath, charset); }
Source:
private MethodHandle toMethodHandle(Method method) throws IllegalAccessException { MethodHandle target = null; if (makeAccessible || isValidPrivateStructAccess(method)) { method.setAccessible(true); } if(isMethodDecorated(method)) { target = getDecoratedMethodHandle(method, arity); }else{ if ((method.isVarArgs() && isLastArgumentAnArray(type.parameterCount(), args))) { target = lookup.unreflect(method).asFixedArity().asType(type); } else { target = lookup.unreflect(method).asType(type); } } return FunctionCallSupport.insertSAMFilter(target, lookup, method.getParameterTypes(), 1); }

Target:
private MethodHandle toMethodHandle(Method method) throws IllegalAccessException { MethodHandle target = null; if (makeAccessible || isValidPrivateStructAccess(method)) { method.setAccessible(true); } if (isMethodDecorated(method)) { target = getDecoratedMethodHandle(method, arity); } else { if ((method.isVarArgs() && isLastArgumentAnArray(type.parameterCount(), args))) { target = lookup.unreflect(method).asFixedArity().asType(type); } else { target = lookup.unreflect(method).asType(type); } } if(argumentNames.length > 1) { target = FunctionCallSupport.reorderArguments(method, target, argumentNames); } return FunctionCallSupport.insertSAMFilter(target, lookup, method.getParameterTypes(), 1); }
Source:
private Path getDataPath(File location) { File[] files = location.listFiles(); Path path = null; if (files != null) { for (File file : files) { if (file.getName().startsWith("part-")) { path = new Path(file.toString()); break; } } } return path; }

Target:
private Path getDataPath(File location) { File[] files = location.listFiles(); Path path = null; if (files != null) { for (File file : files) { if (file.getName().startsWith("part-")) { path = new Path(file.toString()); return path; } } } return path; }
Source:
protected Collection<String> getCandidates() { Set<String> candidates = new HashSet<String>(); for (String containerPath : zkDb.getDataTree().getContainers()) { DataNode node = zkDb.getDataTree().getNode(containerPath); if ((node != null) && node.getChildren().isEmpty()) { if (node.stat.getCversion() > 0) { candidates.add(containerPath); } else { if (getElapsed(node) > maxNeverUsedIntervalMs) { candidates.add(containerPath); } } } if ((node != null) && (node.stat.getCversion() > 0) && (node.getChildren().isEmpty())) { candidates.add(containerPath); } } for (String ttlPath : zkDb.getDataTree().getTtls()) { DataNode node = zkDb.getDataTree().getNode(ttlPath); if (node != null) { Set<String> children = node.getChildren(); if (children.isEmpty()) { if (EphemeralType.get(node.stat.getEphemeralOwner()) == EphemeralType.TTL) { long ttl = EphemeralType.TTL.getValue(node.stat.getEphemeralOwner()); if ((ttl != 0) && (getElapsed(node) > ttl)) { candidates.add(ttlPath); } } } } } return candidates; }

Target:
protected Collection<String> getCandidates() { Set<String> candidates = new HashSet<String>(); for (String containerPath : zkDb.getDataTree().getContainers()) { DataNode node = zkDb.getDataTree().getNode(containerPath); if ((node != null) && node.getChildren().isEmpty()) { if (node.stat.getCversion() > 0) { candidates.add(containerPath); } else { if ((maxNeverUsedIntervalMs != 0) && (getElapsed(node) > maxNeverUsedIntervalMs)) { candidates.add(containerPath); } } } if ((node != null) && (node.stat.getCversion() > 0) && (node.getChildren().isEmpty())) { candidates.add(containerPath); } } for (String ttlPath : zkDb.getDataTree().getTtls()) { DataNode node = zkDb.getDataTree().getNode(ttlPath); if (node != null) { Set<String> children = node.getChildren(); if (children.isEmpty()) { if (EphemeralType.get(node.stat.getEphemeralOwner()) == EphemeralType.TTL) { long ttl = EphemeralType.TTL.getValue(node.stat.getEphemeralOwner()); if ((ttl != 0) && (getElapsed(node) > ttl)) { candidates.add(ttlPath); } } } } } return candidates; }
Source:
public boolean hasNext() { return nextSetsIterator.hasNext() || wrappedIterator.hasNext(); }

Target:
public boolean hasNext() { if(!isOpen) { return false; } else { if(nextSetsIterator.hasNext() || wrappedIterator.hasNext()) { return true; } else { isOpen = false; return false; } } }
Source:
private void testGlusterNetworkInUseAndUnset(boolean glusterNetworkBefore, boolean glusterNetworkAfter, boolean glusterService, boolean hasBricks, Matcher<ValidationResult> expectedResult) { when(oldNetworkCluster.isGluster()).thenReturn(glusterNetworkBefore); when(networkCluster.isGluster()).thenReturn(glusterNetworkAfter); when(cluster.supportsGlusterService()).thenReturn(glusterService); doReturn(brickDao).when(validator).getGlusterBrickDao(); ArrayList<GlusterBrickEntity> list = new ArrayList<>(); if (hasBricks) { list.add(mock(GlusterBrickEntity.class)); } when(brickDao.getAllByClusterAndNetworkId(any(Guid.class), any(Guid.class))).thenReturn(list); assertThat(validator.glusterNetworkInUseAndUnset(cluster), expectedResult); }

Target:
private void testGlusterNetworkInUseAndUnset(boolean glusterNetworkBefore, boolean glusterNetworkAfter, boolean glusterService, boolean hasBricks, Matcher<ValidationResult> expectedResult) { when(oldNetworkCluster.isGluster()).thenReturn(glusterNetworkBefore); when(networkCluster.isGluster()).thenReturn(glusterNetworkAfter); when(cluster.supportsGlusterService()).thenReturn(glusterService); doReturn(brickDao).when(validator).getGlusterBrickDao(); when(brickDao.getAllByClusterAndNetworkId(any(Guid.class), any(Guid.class))).thenReturn(hasBricks ? Collections.<GlusterBrickEntity> singletonList(null) : Collections.<GlusterBrickEntity> emptyList()); assertThat(validator.glusterNetworkInUseAndUnset(cluster), expectedResult); }
Source:
private String getErrorMessage(Recognizer<?, ?> recognizer, RecognitionException e, int line, int charPositionInLine, Object offendingSymbol) { String msg = "GENERAL_PARSE_ERROR"; if (e instanceof InputMismatchException) { InputMismatchException ime = (InputMismatchException) e; String expected = ime.getExpectedTokens().toString(recognizer.getVocabulary()); msg = "MISMATCHED_TOKEN " + e.getOffendingToken().getText() + " , expected one of " + expected; } else if (e instanceof NoViableAltException) { msg = "NO_PARSE_ALTERNATIVE," + getTokenErrorDisplay(e.getOffendingToken()); } else if (e instanceof LexerNoViableAltException) { msg = "NO_PARSE_ALTERNATIVE," + getTokenErrorDisplay(e.getOffendingToken()); } else if (e instanceof FailedPredicateException) { FailedPredicateException fpe = (FailedPredicateException) e; msg = "FAILED_PARSE_PREDICATE," + recognizer.getRuleNames()[fpe.getRuleIndex()] + "," + fpe.getPredicate(); } else { msg = "GENERAL_PARSE_ERROR," + e.getMessage(); } String loc = ""; if (e.getOffendingToken() != null) { loc = " at line " + e.getOffendingToken().getLine() + ", char " + e.getOffendingToken().getCharPositionInLine() + "-" + e.getOffendingToken().getCharPositionInLine() + (e.getOffendingToken().getStopIndex() - e.getOffendingToken().getStartIndex()) ; } else { loc=" at line " + line + ", char " + charPositionInLine; } msg=msg + loc; return msg; }

Target:
private String getErrorMessage(Recognizer<?, ?> recognizer, RecognitionException e, int line, int charPositionInLine, Object offendingSymbol) { StringBuilder msgstr=new StringBuilder(); if (e instanceof InputMismatchException) { InputMismatchException ime = (InputMismatchException) e; String expected = ime.getExpectedTokens().toString(recognizer.getVocabulary()); msgstr.append("MISMATCHED_TOKEN ").append(e.getOffendingToken().getText()).append(" , expected one of ").append(expected); } else if (e instanceof NoViableAltException) { msgstr.append("NO_PARSE_ALTERNATIVE,").append(getTokenErrorDisplay(e.getOffendingToken())); } else if (e instanceof LexerNoViableAltException) { msgstr.append("NO_PARSE_ALTERNATIVE,").append(getTokenErrorDisplay(e.getOffendingToken())); } else if (e instanceof FailedPredicateException) { FailedPredicateException fpe = (FailedPredicateException) e; msgstr.append("FAILED_PARSE_PREDICATE,").append(recognizer.getRuleNames()[fpe.getRuleIndex()]).append(",").append(fpe.getPredicate()); } else { msgstr.append("GENERAL_PARSE_ERROR,").append(e.getMessage()); } StringBuilder loc = new StringBuilder(""); if (e.getOffendingToken() != null) { loc.append(" at line ").append( e.getOffendingToken().getLine()).append(", char ").append(e.getOffendingToken().getCharPositionInLine()).append("-") .append(e.getOffendingToken().getCharPositionInLine()) .append(e.getOffendingToken().getStopIndex() - e.getOffendingToken().getStartIndex()) ; } else { loc.append(" at line ").append(line).append(", char ").append(charPositionInLine); } return msgstr.toString() + loc.toString(); }
Source:
public OutputStream createFile(final Path path, final boolean overwrite, final FsPermission permission, final FsPermission umask) throws AzureBlobFileSystemException { try (AbfsPerfInfo perfInfo = startTracking("createFile", "createPath")) { boolean isNamespaceEnabled = getIsNamespaceEnabled(); LOG.debug("createFile filesystem: path: overwrite: permission: umask: isNamespaceEnabled: {}", client.getFileSystem(), path, overwrite, permission.toString(), umask.toString(), isNamespaceEnabled); boolean appendBlob = false; if (isAppendBlobKey(path.toString())) { appendBlob = true; } client.createPath(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), true, overwrite, isNamespaceEnabled ? getOctalNotation(permission) : null, isNamespaceEnabled ? getOctalNotation(umask) : null, appendBlob); return new AbfsOutputStream( client, AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), Long.valueOf(0), abfsConfiguration.getWriteBufferSize(), abfsConfiguration.isFlushEnabled(), abfsConfiguration.isOutputStreamFlushDisabled(), abfsConfiguration.isAppendWithFlushEnabled(), appendBlob); } }

Target:
public OutputStream createFile(final Path path, final boolean overwrite, final FsPermission permission, final FsPermission umask) throws AzureBlobFileSystemException { try (AbfsPerfInfo perfInfo = startTracking("createFile", "createPath")) { boolean isNamespaceEnabled = getIsNamespaceEnabled(); LOG.debug("createFile filesystem: path: overwrite: permission: umask: isNamespaceEnabled: {}", client.getFileSystem(), path, overwrite, permission.toString(), umask.toString(), isNamespaceEnabled); boolean appendBlob = false; if (isAppendBlobKey(path.toString())) { appendBlob = true; } client.createPath(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), true, overwrite, isNamespaceEnabled ? getOctalNotation(permission) : null, isNamespaceEnabled ? getOctalNotation(umask) : null, appendBlob); return new AbfsOutputStream( client, AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), 0, abfsConfiguration.getWriteBufferSize(), abfsConfiguration.isFlushEnabled(), abfsConfiguration.isOutputStreamFlushDisabled(), abfsConfiguration.isAppendWithFlushEnabled(), appendBlob); } }