auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public SideTabExtendedResourceView(ResourcesModelProvider modelProvider, EventBus eventBus, ClientStorage clientStorage, SubTableResources headerResources, ApplicationResources resources, ApplicationConstants constants) { vmTable = new VmTable(modelProvider, headerResources, resources, constants); vmTable.setVisible(true); SimpleRefreshManager refreshManager = new SimpleRefreshManager(modelProvider, eventBus, clientStorage); refreshPanel = refreshManager.getRefreshPanel(); cpusProgressBar = new QuotaProgressBar(QuotaProgressBar.QuotaType.CPU); memoryProgressBar = new QuotaProgressBar(QuotaProgressBar.QuotaType.MEM); storageProgressBar = new QuotaProgressBar(QuotaProgressBar.QuotaType.STORAGE); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); Driver.driver.initialize(this); ViewIdHandler.idHandler.generateAndSetIds(this); localize(); modelProvider.getModel().getUsedQuotaPercentage().getEntityChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { initQuotaList(model); } }); Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent resizeEvent) { vcpuExpanderContent.setHeight(infoBoxCpu.getOffsetHeight() - 150 + "px"); memoryExpanderContent.setHeight(infoBoxMemory.getOffsetHeight() - 150 + "px"); vmTable.setHeight(bottomLayoutPanel.getOffsetHeight() - 350 + "px"); } }); vcpuExpander.initWithContent(vcpuExpanderContent.getElement()); memoryExpander.initWithContent(memoryExpanderContent.getElement()); storageExpander.initWithContent(storageExpanderContent.getElement()); }

Target:
public SideTabExtendedResourceView(ResourcesModelProvider modelProvider, EventBus eventBus, ClientStorage clientStorage, SubTableResources headerResources, ApplicationResources resources, ApplicationConstants constants) { vmTable = new VmTable(modelProvider, headerResources, resources, constants); SimpleRefreshManager refreshManager = new SimpleRefreshManager(modelProvider, eventBus, clientStorage); refreshPanel = refreshManager.getRefreshPanel(); cpusProgressBar = new QuotaProgressBar(QuotaProgressBar.QuotaType.CPU); memoryProgressBar = new QuotaProgressBar(QuotaProgressBar.QuotaType.MEM); storageProgressBar = new QuotaProgressBar(QuotaProgressBar.QuotaType.STORAGE); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); Driver.driver.initialize(this); ViewIdHandler.idHandler.generateAndSetIds(this); localize(); modelProvider.getModel().getUsedQuotaPercentage().getEntityChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { initQuotaList(model); } }); setResizeHandler(); vcpuExpander.initWithContent(vcpuExpanderContent.getElement()); memoryExpander.initWithContent(memoryExpanderContent.getElement()); storageExpander.initWithContent(storageExpanderContent.getElement()); }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); mDispatcher.register(this); if (savedInstanceState == null) { mSite = (SiteModel) getIntent().getSerializableExtra(WordPress.SITE); } else { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); mIsInSearchMode = savedInstanceState.getBoolean(IS_IN_SEARCH_MODE); } if (mSite == null) { ToastUtils.showToast(this, R.string.blog_not_found, ToastUtils.Duration.SHORT); finish(); return; } setContentView(R.layout.theme_browser_activity); if (savedInstanceState == null) { AnalyticsUtils.trackWithSiteDetails(Stat.THEMES_ACCESSED_THEMES_BROWSER, mSite); mThemeBrowserFragment = ThemeBrowserFragment.newInstance(mSite); mThemeSearchFragment = ThemeSearchFragment.newInstance(mSite); addBrowserFragment(); } if (!mIsInSearchMode) { fetchInstalledThemesIfJetpackSite(); fetchWpComThemesIfSyncTimedOut(false); } showToolbar(); }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); mDispatcher.register(this); if (savedInstanceState == null) { mSite = (SiteModel) getIntent().getSerializableExtra(WordPress.SITE); if (mSite != null) { AnalyticsUtils.trackWithSiteDetails(Stat.THEMES_ACCESSED_THEMES_BROWSER, mSite); mThemeBrowserFragment = ThemeBrowserFragment.newInstance(mSite); mThemeSearchFragment = ThemeSearchFragment.newInstance(mSite); addBrowserFragment(); } } else { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); setIsInSearchMode(savedInstanceState.getBoolean(IS_IN_SEARCH_MODE)); } if (mSite == null) { ToastUtils.showToast(this, R.string.blog_not_found, ToastUtils.Duration.SHORT); finish(); return; } setContentView(R.layout.theme_browser_activity); if (!mIsInSearchMode) { fetchInstalledThemesIfJetpackSite(); fetchWpComThemesIfSyncTimedOut(false); } showToolbar(); }
Source:
public void initFromPage(int valueCount, ByteBufferInputStream inputStream) throws IOException { int bitWidth = BytesUtils.readIntLittleEndianOnOneByte(inputStream); decoder = new RunLengthBitPackingHybridDecoder(bitWidth, inputStream); }

Target:
public void initFromPage(int valueCount, ByteBufferInputStream inputStream) throws IOException { int bitWidth = readIntLittleEndianOnOneByte(inputStream); decoder = new RunLengthBitPackingHybridDecoder(bitWidth, inputStream); }
Source:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getName()) .append(" {id=") .append(getId()) .append(", vdsId=") .append(getVdsId()) .append(", name=") .append(getName()) .append(", networkName=") .append(getNetworkName()) .append(", vlanId=") .append(getVlanId()) .append(", bootProtocol=") .append(getBootProtocol()) .append(", address=") .append(getAddress()) .append(", subnet=") .append(getSubnet()) .append(", gateway=") .append(getGateway()) .append(", mtu=") .append(getMtu()) .append(", bridged=") .append(isBridged()) .append(", type=") .append(getType()) .append(", networkImplementationDetails=") .append(getNetworkImplementationDetails()) .append("]"); return builder.toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getName()) .append(" {id=") .append(getId()) .append(", vdsId=") .append(getVdsId()) .append(", name=") .append(getName()) .append(", networkName=") .append(getNetworkName()) .append(", vlanId=") .append(getVlanId()) .append(", bootProtocol=") .append(getBootProtocol()) .append(", address=") .append(getAddress()) .append(", subnet=") .append(getSubnet()) .append(", gateway=") .append(getGateway()) .append(", mtu=") .append(getMtu()) .append(", bridged=") .append(isBridged()) .append(", type=") .append(getType()) .append(", networkImplementationDetails=") .append(getNetworkImplementationDetails()) .append("}"); return builder.toString(); }
Source:
public String getLocation() { if (location == null) { return null; } StringBuilder sb = new StringBuilder(); JsonObject locationObject; if (location.isJsonPrimitive() && location.getAsJsonPrimitive().isString()) { return location.getAsString(); } else { locationObject = location.getAsJsonObject(); String filename; if (locationObject.has("file") && locationObject.get("file").getAsJsonPrimitive().isString()) { filename = locationObject.get("file").getAsString(); } else if (locationObject.has("filepath") && locationObject.get("filepath").isJsonObject()) { JsonObject filePath = locationObject.get("filepath").getAsJsonObject(); if (filePath.has("filename") && filePath.get("filename").getAsJsonPrimitive().isString()) { filename = filePath.get("filename").getAsString(); } else { return null; } } else { return null; } sb.append(filename).append(":"); LinkedList<Integer> lineList = new LinkedList<>(); if (locationObject.has("lines") && locationObject.get("lines").isJsonObject()) { JsonObject lines = locationObject.get("lines").getAsJsonObject(); if (lines.has("data") && lines.get("data").isJsonArray()) { JsonArray data = lines.get("data").getAsJsonArray(); for (JsonElement lineElement : data) { try { int line = Integer.parseInt(lineElement.getAsString()); lineList.add(line); } catch (NumberFormatException e) { return null; } } } else { return null; } } else { return null; } if (lineList.size() > 1 && areConsecutive(lineList)) { sb.append(lineList.getFirst()).append("..").append(lineList.getLast()); } else { sb.append(StringUtils.join(lineList, ',')); } return sb.toString(); } }

Target:
public String getLocation() { if (location == null) { return null; } StringBuilder sb = new StringBuilder(); JsonObject locationObject; if (location.isJsonPrimitive() && location.getAsJsonPrimitive().isString()) { return location.getAsString(); } locationObject = location.getAsJsonObject(); String filename; if (jsonHasString(locationObject,"file")) { filename = locationObject.get("file").getAsString(); } else if (jsonHasJsonObject(locationObject,"filepath")) { JsonObject filePath = locationObject.get("filepath").getAsJsonObject(); if (jsonHasString(filePath,"filename")) { filename = filePath.get("filename").getAsString(); } else { return null; } } else { return null; } sb.append(filename).append(":"); LinkedList<Integer> lineList = new LinkedList<>(); if (jsonHasJsonObject(locationObject,"lines")) { JsonObject lines = locationObject.get("lines").getAsJsonObject(); if (jsonHasArray(lines,"data")) { JsonArray data = lines.get("data").getAsJsonArray(); for (JsonElement lineElement : data) { try { int line = Integer.parseInt(lineElement.getAsString()); lineList.add(line); } catch (NumberFormatException e) { return null; } } } else { return null; } } else { return null; } if (lineList.size() > 1 && areConsecutive(lineList)) { sb.append(lineList.getFirst()).append("..").append(lineList.getLast()); } else { sb.append(StringUtils.join(lineList, ',')); } return sb.toString(); }
Source:
private void recordValidWriteIds(HiveTxnManager txnMgr) throws LockException { String txnString = conf.get(ValidTxnList.VALID_TXNS_KEY); if ((txnString == null) || (txnString.isEmpty())) { throw new IllegalStateException("calling recordValidWritsIdss() without initializing ValidTxnList " + JavaUtils.txnIdToString(txnMgr.getCurrentTxnId())); } ValidTxnWriteIdList txnWriteIds = txnMgr.getValidWriteIds(getTransactionalTableList(plan), txnString); String writeIdStr = txnWriteIds.toString(); conf.set(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY, writeIdStr); if (plan.getFetchTask() != null) { Operator<?> source = plan.getFetchTask().getWork().getSource(); if (source instanceof TableScanOperator) { TableScanOperator tsOp = (TableScanOperator)source; String fullTableName = AcidUtils.getFullTableName(tsOp.getConf().getDatabaseName(), tsOp.getConf().getTableName()); ValidWriteIdList writeIdList = txnWriteIds.getTableValidWriteIdList(fullTableName); if (HiveConf.getBoolVar(conf, ConfVars.HIVE_TRANSACTIONAL_TABLE_SCAN, false) && (writeIdList == null)) { throw new IllegalStateException("ACID table: " + fullTableName + " is missing from the ValidWriteIdList config: " + writeIdStr); } if (writeIdList != null) { plan.getFetchTask().setValidWriteIdList(writeIdList.toString()); } } } LOG.debug("Encoding valid txn write ids info " + writeIdStr + " txnid:" + txnMgr.getCurrentTxnId()); }

Target:
private void recordValidWriteIds(HiveTxnManager txnMgr) throws LockException { String txnString = conf.get(ValidTxnList.VALID_TXNS_KEY); if ((txnString == null) || (txnString.isEmpty())) { throw new IllegalStateException("calling recordValidWritsIdss() without initializing ValidTxnList " + JavaUtils.txnIdToString(txnMgr.getCurrentTxnId())); } ValidTxnWriteIdList txnWriteIds = txnMgr.getValidWriteIds(getTransactionalTableList(plan), txnString); String writeIdStr = txnWriteIds.toString(); conf.set(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY, writeIdStr); if (plan.getFetchTask() != null) { Operator<?> source = plan.getFetchTask().getWork().getSource(); if (source instanceof TableScanOperator) { TableScanOperator tsOp = (TableScanOperator)source; String fullTableName = AcidUtils.getFullTableName(tsOp.getConf().getDatabaseName(), tsOp.getConf().getTableName()); ValidWriteIdList writeIdList = txnWriteIds.getTableValidWriteIdList(fullTableName); if (tsOp.getConf().isTranscationalTable() && (writeIdList == null)) { throw new IllegalStateException("ACID table: " + fullTableName + " is missing from the ValidWriteIdList config: " + writeIdStr); } if (writeIdList != null) { plan.getFetchTask().setValidWriteIdList(writeIdList.toString()); } } } LOG.debug("Encoding valid txn write ids info " + writeIdStr + " txnid:" + txnMgr.getCurrentTxnId()); }
Source:
public int hashCode() { return Objects.hash( actionType, correlationId, endTime, id, isVisible, jobSubjectEntities, lastUpdateTime, ownerId, startTime, status, steps, external, autoCleared ); }

Target:
public int hashCode() { return Objects.hash( actionType, engineSessionSeqId, correlationId, endTime, id, isVisible, jobSubjectEntities, lastUpdateTime, ownerId, startTime, status, steps, external, autoCleared ); }
Source:
public ExtensionEntry(Properties props) { this.file = null; context = new EnumMap<>(ExtensionProperties.class); load(props); }

Target:
public ExtensionEntry(Properties props) { load(props); }
Source:
public void copyObject( String bucketName, String objectName, Map<String, String> headerMap, ServerSideEncryption sse, String srcBucketName, String srcObjectName, ServerSideEncryption srcSse, CopyConditions copyConditions) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException { ServerSideEncryptionCustomerKey srcSsec = null; if (srcSse instanceof ServerSideEncryptionCustomerKey) { srcSsec = (ServerSideEncryptionCustomerKey) srcSse; } checkReadRequestSse(srcSse); CopyObjectArgs.Builder builder = CopyObjectArgs.builder() .bucket(bucketName) .object(objectName) .headers(headerMap) .sse(sse) .srcBucket(srcBucketName) .srcObject(srcObjectName) .srcSsec(srcSsec); if (copyConditions != null) { Map<String, String> map = copyConditions.getConditions(); String value; builder.srcMatchETag(map.get("x-amz-copy-source-if-match")); builder.srcNotMatchETag(map.get("x-amz-copy-source-if-none-match")); value = map.get("x-amz-copy-source-if-modified-since"); if (value != null) { builder.srcModifiedSince(ZonedDateTime.parse(value, Time.HTTP_HEADER_DATE_FORMAT)); } value = map.get("x-amz-copy-source-if-unmodified-since"); if (value != null) { builder.srcUnmodifiedSince(ZonedDateTime.parse(value, Time.HTTP_HEADER_DATE_FORMAT)); } value = map.get("x-amz-metadata-directive"); if (value != null) { builder.metadataDirective(Directive.REPLACE); } } copyObject(builder.build()); }

Target:
public void copyObject( String bucketName, String objectName, Map<String, String> headerMap, ServerSideEncryption sse, String srcBucketName, String srcObjectName, ServerSideEncryption srcSse, CopyConditions copyConditions) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException { ServerSideEncryptionCustomerKey srcSsec = null; if (srcSse instanceof ServerSideEncryptionCustomerKey) { srcSsec = (ServerSideEncryptionCustomerKey) srcSse; } checkReadRequestSse(srcSse); CopyObjectArgs.Builder builder = CopyObjectArgs.builder() .bucket(bucketName) .object(objectName) .headers(headerMap) .sse(sse) .srcBucket(srcBucketName) .srcObject(srcObjectName) .srcSsec(srcSsec); if (copyConditions != null) { Map<String, String> map = copyConditions.getConditions(); String value; builder.srcMatchETag(map.get("x-amz-copy-source-if-match")); builder.srcNotMatchETag(map.get("x-amz-copy-source-if-none-match")); value = map.get("x-amz-copy-source-if-modified-since"); if (value != null) { builder.srcModifiedSince(ZonedDateTime.parse(value, Time.HTTP_HEADER_DATE_FORMAT)); } value = map.get("x-amz-copy-source-if-unmodified-since"); if (value != null) { builder.srcUnmodifiedSince(ZonedDateTime.parse(value, Time.HTTP_HEADER_DATE_FORMAT)); } value = map.get("x-amz-metadata-directive"); if (value != null) { builder.metadataDirective(Directive.valueOf(value)); } } copyObject(builder.build()); }
Source:
private void shutDownNodeSourceIfDeployed(String nodeSourceName, boolean preempt) { if (this.deployedNodeSources.containsKey(nodeSourceName)) { NodeSource nodeSourceToRemove = this.deployedNodeSources.get(nodeSourceName); this.removeAllNodes(nodeSourceName, preempt); NodeSourceStatus status = nodeSourceToRemove.getStatus(); this.nodeSourceUnregister(nodeSourceName, nodeSourceToRemove.getStatus(), new RMNodeSourceEvent(RMEventType.NODESOURCE_SHUTDOWN, this.caller.getName(), nodeSourceName, nodeSourceToRemove.getDescription(), nodeSourceToRemove.getAdministrator().getName(), status.toString())); nodeSourceToRemove.shutdown(this.caller); } }

Target:
private void shutDownNodeSourceIfDeployed(String nodeSourceName, boolean preempt) { if (this.deployedNodeSources.containsKey(nodeSourceName)) { NodeSource nodeSourceToRemove = this.deployedNodeSources.get(nodeSourceName); this.removeAllNodes(nodeSourceName, preempt); NodeSourceStatus status = nodeSourceToRemove.getStatus(); this.nodeSourceUnregister(nodeSourceName, status, new RMNodeSourceEvent(RMEventType.NODESOURCE_SHUTDOWN, this.caller.getName(), nodeSourceName, nodeSourceToRemove.getDescription(), nodeSourceToRemove.getAdministrator().getName(), status.toString())); nodeSourceToRemove.shutdown(this.caller); } }
Source:
public void should_return_true_when_connectorEvent_isOnFinish(){ Connector connector = ProcessFactory.eINSTANCE.createConnector(); connector.setEvent(ConnectorEvent.ON_FINISH.toString()); assertTrue(onFinishFilter.select(viewer, null, connector)); }

Target:
public void should_return_true_when_connectorEvent_isOnFinish() { final ConnectorEventFilter onFinishFilter = createConnectorEventFilter(); assertTrue(onFinishFilter.select(viewer, null, aConnector().onEvent(ConnectorEvent.ON_FINISH.name()).build())); }
Source:
public Response remove(String id, Action action) { return performAction(VdcActionType.RemoveVds, new RemoveVdsParameters(asGuid(id), action != null && action.isSetForce() ? action.isForce() : false)); }

Target:
public Response remove(String id, Action action) { getEntity(id); return performAction(VdcActionType.RemoveVds, new RemoveVdsParameters(asGuid(id), action != null && action.isSetForce() ? action.isForce() : false)); }
Source:
public boolean apply(String networkDomainId) { checkNotNull(networkDomainId, "networkDomainId"); logger.trace("looking for state on network domain %s", networkDomainId); final NetworkDomain networkDomain = networkApi.getNetworkDomain(networkDomainId); if (networkDomain == null && state == State.DELETED) { return true; } if (networkDomain.state().isFailed()) { throw new IllegalStateException( MessageFormat.format("Network Domain {0} is in FAILED state", networkDomain.id())); } else { return networkDomain.state().equals(state); } }

Target:
public boolean apply(String networkDomainId) { checkNotNull(networkDomainId, "networkDomainId"); logger.trace("looking for state on network domain %s", networkDomainId); final NetworkDomain networkDomain = networkApi.getNetworkDomain(networkDomainId); final boolean isDeleted = networkDomain == null && state == State.DELETED; return isDeleted || (networkDomain != null && networkDomain.state() == state); }
Source:
public BindingProperties getBindingProperties(String channelName) { BindingProperties bindingProperties = new BindingProperties(); if (applicationContext != null) { RelaxedDataBinder defaultsDataBinder = new RelaxedDataBinder(bindingProperties, "spring.cloud.stream.default"); defaultsDataBinder.setDisallowedFields("destination"); defaultsDataBinder .bind(new PropertySourcesPropertyValues(applicationContext.getEnvironment().getPropertySources())); } if (this.bindings.containsKey(channelName)) { BeanUtils.copyProperties(this.bindings.get(channelName), bindingProperties); } if (bindingProperties.getDestination() == null) { bindingProperties.setDestination(channelName); } return bindingProperties; }

Target:
public BindingProperties getBindingProperties(String channelName) { BindingProperties bindingProperties = new BindingProperties(); if (this.bindings.containsKey(channelName)) { BeanUtils.copyProperties(this.bindings.get(channelName), bindingProperties); } if (bindingProperties.getDestination() == null) { bindingProperties.setDestination(channelName); } return bindingProperties; }
Source:
public void prepare(KubernetesEnvironment k8sEnv, String workspaceId, long timeoutMillis) throws InfrastructureException { TracingTags.WORKSPACE_ID.set(workspaceId); if (EphemeralWorkspaceUtility.isEphemeral(k8sEnv.getAttributes())) { return; } log.debug("Preparing PVC started for workspace '{}'", workspaceId); Map<String, PersistentVolumeClaim> claims = k8sEnv.getPersistentVolumeClaims(); if (claims.isEmpty()) { return; } if (claims.size() > 1) { throw new InfrastructureException( format( "The only one PVC MUST be present in common strategy while it contains: %s.", claims.keySet().stream().collect(joining(", ")))); } PersistentVolumeClaim commonPVC = claims.values().iterator().next(); final KubernetesNamespace namespace = factory.create(workspaceId); final KubernetesPersistentVolumeClaims pvcs = namespace.persistentVolumeClaims(); final Set<String> existing = pvcs.get().stream().map(p -> p.getMetadata().getName()).collect(toSet()); if (!existing.contains(commonPVC.getMetadata().getName())) { log.debug("Creating PVC for workspace '{}'", workspaceId); pvcs.create(commonPVC); if (waitBound) { log.debug("Waiting PVC for workspace '{}' to be bound", workspaceId); pvcs.waitBound(commonPVC.getMetadata().getName(), timeoutMillis); } } final String[] subpaths = (String[]) commonPVC.getAdditionalProperties().remove(format(SUBPATHS_PROPERTY_FMT, workspaceId)); if (preCreateDirs && subpaths != null) { pvcSubPathHelper.createDirs(workspaceId, commonPVC.getMetadata().getName(), subpaths); } log.debug("Preparing PVC done for workspace '{}'", workspaceId); }

Target:
public void prepare(KubernetesEnvironment k8sEnv, String workspaceId, long timeoutMillis) throws InfrastructureException { TracingTags.WORKSPACE_ID.set(workspaceId); if (EphemeralWorkspaceUtility.isEphemeral(k8sEnv.getAttributes())) { return; } log.debug("Preparing PVC started for workspace '{}'", workspaceId); Map<String, PersistentVolumeClaim> claims = k8sEnv.getPersistentVolumeClaims(); if (claims.isEmpty()) { return; } if (claims.size() > 1) { throw new InfrastructureException( format( "The only one PVC MUST be present in common strategy while it contains: %s.", claims.keySet().stream().collect(joining(", ")))); } PersistentVolumeClaim commonPVC = claims.values().iterator().next(); final KubernetesNamespace namespace = factory.create(workspaceId); final KubernetesPersistentVolumeClaims pvcs = namespace.persistentVolumeClaims(); final Set<String> existing = pvcs.get().stream().map(p -> p.getMetadata().getName()).collect(toSet()); if (!existing.contains(commonPVC.getMetadata().getName())) { log.debug("Creating PVC for workspace '{}'", workspaceId); pvcs.create(commonPVC); if (waitBound) { log.debug("Waiting for PVC for workspace '{}' to be bound", workspaceId); pvcs.waitBound(commonPVC.getMetadata().getName(), timeoutMillis); } } final String[] subpaths = (String[]) commonPVC.getAdditionalProperties().remove(format(SUBPATHS_PROPERTY_FMT, workspaceId)); if (preCreateDirs && subpaths != null) { pvcSubPathHelper.createDirs(workspaceId, commonPVC.getMetadata().getName(), subpaths); } log.debug("Preparing PVC done for workspace '{}'", workspaceId); }
Source:
public void commit() { try { client.flush(name()); } catch (IOException e) { throw new EsIndexException(e); } }

Target:
public void commit() { try { client.refresh(name()); } catch (IOException e) { throw new EsIndexException(e); } }
Source:
public DirCache call() throws NoFilepatternException { if (filepatterns.isEmpty()) throw new NoFilepatternException(JGitText.get().atLeastOnePatternIsRequired); checkCallable(); DirCache dc = null; try { dc = DirCache.lock(repo); ObjectWriter ow = new ObjectWriter(repo); DirCacheIterator c; DirCacheBuilder builder = dc.builder(); final TreeWalk tw = new TreeWalk(repo); tw.reset(); tw.addTree(new DirCacheBuildIterator(builder)); FileTreeIterator fileTreeIterator = new FileTreeIterator( repo.getWorkDir(), repo.getFS()); tw.addTree(fileTreeIterator); tw.setRecursive(true); tw.setFilter(PathFilterGroup.createFromStrings(filepatterns)); if (update) tw.addTree(new DirCacheIterator(dc)); String lastAddedFile = null; while (tw.next()) { String path = tw.getPathString(); final File file = new File(repo.getWorkDir(), path); if (!(path.equals(lastAddedFile))) { if (!(update && tw.getTree(2, DirCacheIterator.class) == null)) { FileTreeIterator f = tw.getTree(1, FileTreeIterator.class); if (f != null) { DirCacheEntry entry = new DirCacheEntry(path); entry.setLength((int)f.getEntryLength()); entry.setLastModified(f.getEntryLastModified()); entry.setFileMode(f.getEntryFileMode()); entry.setObjectId(ow.writeBlob(file)); builder.add(entry); lastAddedFile = path; } else if (!update){ c = tw.getTree(0, DirCacheIterator.class); builder.add(c.getDirCacheEntry()); } } } } builder.commit(); setCallable(false); } catch (IOException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfAddCommand, e); } finally { if (dc != null) dc.unlock(); } return dc; }

Target:
public DirCache call() throws NoFilepatternException { if (filepatterns.isEmpty()) throw new NoFilepatternException(JGitText.get().atLeastOnePatternIsRequired); checkCallable(); DirCache dc = null; try { dc = DirCache.lock(repo); ObjectWriter ow = new ObjectWriter(repo); DirCacheIterator c; DirCacheBuilder builder = dc.builder(); final TreeWalk tw = new TreeWalk(repo); tw.reset(); tw.addTree(new DirCacheBuildIterator(builder)); FileTreeIterator fileTreeIterator = new FileTreeIterator( repo.getWorkDir(), repo.getFS()); tw.addTree(fileTreeIterator); tw.setRecursive(true); tw.setFilter(PathFilterGroup.createFromStrings(filepatterns)); String lastAddedFile = null; while (tw.next()) { String path = tw.getPathString(); final File file = new File(repo.getWorkDir(), path); if (!(path.equals(lastAddedFile))) { if (!(update && tw.getTree(0, DirCacheIterator.class) == null)) { FileTreeIterator f = tw.getTree(1, FileTreeIterator.class); if (f != null) { DirCacheEntry entry = new DirCacheEntry(path); entry.setLength((int)f.getEntryLength()); entry.setLastModified(f.getEntryLastModified()); entry.setFileMode(f.getEntryFileMode()); entry.setObjectId(ow.writeBlob(file)); builder.add(entry); lastAddedFile = path; } else if (!update){ c = tw.getTree(0, DirCacheIterator.class); builder.add(c.getDirCacheEntry()); } } } } builder.commit(); setCallable(false); } catch (IOException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfAddCommand, e); } finally { if (dc != null) dc.unlock(); } return dc; }
Source:
private void recursePath(final Path path, final Path resultPath) throws IOException { Files.walkFileTree(path, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { String relativePath = StringUtils.substringAfter(file.toString(), path.toString()); if (relativePath.startsWith("/") && File.separatorChar == '\\') { relativePath = relativePath.replace('/', '\\'); } relativePath = StringUtils.removeStart(relativePath, File.separator); Path resultFile = resultPath.resolve(relativePath); FileUtils.forceMkdir(resultFile.getParent().toFile()); Files.copy(file, resultFile, StandardCopyOption.REPLACE_EXISTING); return FileVisitResult.CONTINUE; } }); }

Target:
private void recursePath(final Path path, final Path resultPath) throws IOException { Files.walkFileTree(path, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { String relativePath = StringUtils.substringAfter(file.toString(), path.toString()); relativePath = FilenameUtils.separatorsToSystem(relativePath); relativePath = StringUtils.removeStart(relativePath, File.separator); Path resultFile = resultPath.resolve(relativePath); FileUtils.forceMkdir(resultFile.getParent().toFile()); Files.copy(file, resultFile, StandardCopyOption.REPLACE_EXISTING); return FileVisitResult.CONTINUE; } }); }
Source:
private String[] alterCipherList(String[] defaultCiphers) { ArrayList<String> preferredSuits = new ArrayList<>(); for (int i = 0; i < defaultCiphers.length; i++) { if (defaultCiphers[i].contains("_GCM_")) { LOG.debug("Removed Cipher - " + defaultCiphers[i] + " from list of " + "enabled SSLSocket ciphers"); } else { preferredSuits.add(defaultCiphers[i]); } } ciphers = preferredSuits.toArray(new String[0]); return ciphers; }

Target:
private String[] alterCipherList(String[] defaultCiphers) { ArrayList<String> preferredSuits = new ArrayList<>(); for (int i = 0; i < defaultCiphers.length; i++) { if (defaultCiphers[i].contains("_GCM_")) { LOG.debug("Removed Cipher - from list of enabled SSLSocket ciphers", defaultCiphers[i]); } else { preferredSuits.add(defaultCiphers[i]); } } ciphers = preferredSuits.toArray(new String[0]); return ciphers; }
Source:
public void realmListener_realmResultShouldBeSynced() { final AtomicBoolean changedOnce = new AtomicBoolean(false); final Realm realm = looperThread.realm; realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { realm.createObject(AllTypes.class); } }); final RealmResults<AllTypes> results = realm.where(AllTypes.class).findAll(); assertEquals(1, results.size()); realm.addChangeListener(new RealmChangeListener<Realm>() { @Override public void onChange(Realm element) { if (!changedOnce.get()) { assertEquals(1, realm.where(AllTypes.class).count()); assertEquals(1, results.size()); realm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { AllTypes allTypes = realm.where(AllTypes.class).findFirst(); assertNotNull(allTypes); allTypes.deleteFromRealm(); final RealmResults<AllTypes> results = realm.where(AllTypes.class).findAll(); assertEquals(0, results.size()); } }); changedOnce.set(true); } else { assertEquals(0, realm.where(AllTypes.class).count()); assertEquals(0, results.size()); realm.close(); looperThread.testComplete(); } } }); }

Target:
public void realmListener_realmResultShouldBeSynced() { final AtomicInteger changeCounter = new AtomicInteger(0); final Realm realm = looperThread.realm; realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { realm.createObject(AllTypes.class); } }); final RealmResults<AllTypes> results = realm.where(AllTypes.class).findAll(); assertEquals(1, results.size()); realm.addChangeListener(new RealmChangeListener<Realm>() { @Override public void onChange(Realm element) { switch (changeCounter.getAndIncrement()) { case 0: assertEquals(1, realm.where(AllTypes.class).count()); assertEquals(1, results.size()); realm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { AllTypes allTypes = realm.where(AllTypes.class).findFirst(); assertNotNull(allTypes); allTypes.deleteFromRealm(); assertEquals(0, realm.where(AllTypes.class).count()); } }); break; case 1: assertEquals(0, realm.where(AllTypes.class).count()); assertEquals(0, results.size()); realm.close(); looperThread.testComplete(); break; default: break; } } }); }
Source:
protected org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeExpense buildNonEmployeeExpense() { org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeExpense expense = Mockito.spy(new org.kuali.kfs.fp.businessobject.DisbursementVoucherNonEmployeeExpense()); Mockito.doNothing().when(expense).refreshNonUpdateableReferences(); return expense; }

Target:
protected DisbursementVoucherNonEmployeeExpense buildNonEmployeeExpense() { DisbursementVoucherNonEmployeeExpense expense = Mockito.spy(new DisbursementVoucherNonEmployeeExpense()); Mockito.doNothing().when(expense).refreshNonUpdateableReferences(); return expense; }
Source:
public String getSearchPath() { StringBuilder tehPath = new StringBuilder(super.getSearchPath()); tehPath.append(File.pathSeparator); String androidJarPath = sdk.getSdkFolder().getAbsolutePath() + "/platforms/" + "android-" + AndroidBuild.sdkVersion + "/android.jar"; System.out.println("androidJarPath = " + androidJarPath); tehPath.append(androidJarPath); return tehPath.toString(); }

Target:
public String getSearchPath() { String androidJarPath = sdk.getSdkFolder().getAbsolutePath() + "/platforms/" + "android-" + AndroidBuild.sdkVersion + "/android.jar"; return super.getSearchPath() + androidJarPath; }
Source:
public static String getRegistriesSortByField(String sortBy) { String updatedSortBy = EndpointRegistryConstants.COLUMN_ID; if (RestApiConstants.SORT_BY_ENDPOINT_REG_NAME.equals(sortBy)) { updatedSortBy = EndpointRegistryConstants.COLUMN_REG_NAME; } return updatedSortBy; }

Target:
public static String getRegistriesSortByField(String sortBy) { String updatedSortBy = EndpointRegistryConstants.COLUMN_ID; if (RestApiConstants.ENDPOINT_REG_NAME.equals(sortBy)) { updatedSortBy = EndpointRegistryConstants.COLUMN_REG_NAME; } return updatedSortBy; }
Source:
public static Connection getTracingConnection() throws Exception { return getTracingConnection(new HashMap<String, String>(0)); }

Target:
public static Connection getTracingConnection() throws Exception { return getTracingConnection(Collections.<String, String>emptyMap(), null); }
Source:
public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("allergen", rep); description.addProperty("severity", rep); description.addProperty("comment", rep); description.addProperty("reactions", rep); description.addProperty("patient", rep); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("allergen", rep); description.addProperty("severity", rep); description.addProperty("comment", rep); description.addProperty("reactions", rep); description.addProperty("patient", rep); description.addProperty("voided"); description.addProperty("auditInfo"); description.addSelfLink(); return description; } return null; }

Target:
public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("allergen", Representation.REF); description.addProperty("severity", Representation.REF); description.addProperty("comment"); description.addProperty("reactions", Representation.REF); description.addProperty("patient", Representation.REF); description.addSelfLink(); description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); return description; } else if (rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("display"); description.addProperty("uuid"); description.addProperty("allergen", Representation.DEFAULT); description.addProperty("severity", Representation.DEFAULT); description.addProperty("comment"); description.addProperty("reactions", Representation.DEFAULT); description.addProperty("patient", Representation.DEFAULT); description.addProperty("voided"); description.addProperty("auditInfo"); description.addSelfLink(); return description; } return null; }
Source:
protected String getTempTableName(final String endpointId) { return getTempTableName(endpointId, ""); }

Target:
protected String getTempTableName(final String endpointId) { return getTempTableName(endpointId, StringUtils.EMPTY); }
Source:
protected void executeIrsBrokerCommand() { if (getParameters().getForce()) { try { Guid storagePoolId = getParameters().getStoragePoolId(); if (getParameters().isDetachFromOldStoragePool()) { storagePoolId = Guid.Empty; } status = getIrsProxy().forcedDetachStorageDomain(getParameters().getStorageDomainId().toString(), storagePoolId.toString()); proceedProxyReturnValue(); } catch (RuntimeException ex) { printReturnValue(); log.error("Could not force detach domain '{}' on pool '{}'. error: {}", getParameters().getStorageDomainId(), getParameters().getStoragePoolId(), ex.getMessage()); log.debug("Exception", ex); if (ex instanceof VDSExceptionBase) { getVDSReturnValue().setVdsError(((VDSExceptionBase) ex).getVdsError()); } getVDSReturnValue().setSucceeded(false); } } else { status = getIrsProxy().detachStorageDomain(getParameters().getStorageDomainId().toString(), getParameters().getStoragePoolId().toString(), getParameters().getMasterStorageDomainId().toString(), getParameters().getMasterVersion()); proceedProxyReturnValue(); } }

Target:
protected void executeIrsBrokerCommand() { if (getParameters().getForce()) { Guid storagePoolId = getParameters().getStoragePoolId(); if (getParameters().isDetachFromOldStoragePool()) { storagePoolId = Guid.Empty; } status = getIrsProxy().forcedDetachStorageDomain(getParameters().getStorageDomainId().toString(), storagePoolId.toString()); proceedProxyReturnValue(); } else { status = getIrsProxy().detachStorageDomain(getParameters().getStorageDomainId().toString(), getParameters().getStoragePoolId().toString(), getParameters().getMasterStorageDomainId().toString(), getParameters().getMasterVersion()); proceedProxyReturnValue(); } }
Source:
public void validate(FailureCollector collector) { IdUtils.validateReferenceName(referenceName, collector); if (suffix != null && !containsMacro(NAME_SUFFIX)) { try { new SimpleDateFormat(suffix); } catch (IllegalArgumentException e) { collector.addFailure("Invalid suffix.", "Ensure provided suffix is valid.") .withConfigProperty(NAME_SUFFIX).withStacktrace(e.getStackTrace()); } } FileFormat format = FileFormat.CSV; try { format = getFormat(); } catch (IllegalArgumentException e) { collector.addFailure(e.getMessage(), null).withConfigProperty(NAME_FORMAT).withStacktrace(e.getStackTrace()); } try { Schema schema = getSchema(); if (format == FileFormat.CSV || format == FileFormat.DELIMITED || format == FileFormat.TSV) { boolean simpleFields = true; for (Schema.Field field : schema.getFields()) { if (!field.getSchema().isSimpleOrNullableSimple()) { simpleFields = false; break; } } collector.addFailure( String.format("Input has multi-level structure that cannot be represented appropriately in %s.", format.name()), "Consider using json, avro or parquet to write data." ).withConfigProperty(NAME_FORMAT); } } catch (IllegalArgumentException e) { collector.addFailure(e.getMessage(), null).withConfigProperty(NAME_SCHEMA).withStacktrace(e.getStackTrace()); } if (collector.getValidationFailures().isEmpty()) { try { validate(); } catch (Exception e) { collector.addFailure(e.getMessage(), null).withStacktrace(e.getStackTrace()); } } }

Target:
public void validate(FailureCollector collector) { IdUtils.validateReferenceName(referenceName, collector); if (suffix != null && !containsMacro(NAME_SUFFIX)) { try { new SimpleDateFormat(suffix); } catch (IllegalArgumentException e) { collector.addFailure("Invalid suffix.", "Ensure provided suffix is valid.") .withConfigProperty(NAME_SUFFIX).withStacktrace(e.getStackTrace()); } } FileFormat format = FileFormat.JSON; try { format = getFormat(); } catch (IllegalArgumentException e) { collector.addFailure(e.getMessage(), null).withConfigProperty(NAME_FORMAT).withStacktrace(e.getStackTrace()); } try { Schema schema = getSchema(); if (format == FileFormat.CSV || format == FileFormat.DELIMITED || format == FileFormat.TSV) { boolean allSimpleFields = schema.getFields().stream() .map(Schema.Field::getSchema) .allMatch(Schema::isSimpleOrNullableSimple); if (allSimpleFields == false) { collector.addFailure( String.format("Input has multi-level structure that cannot be represented appropriately in %s.", format.name()), "Consider using json, avro or parquet to write data." ).withConfigProperty(NAME_FORMAT); } } } catch (IllegalArgumentException e) { collector.addFailure(e.getMessage(), null).withConfigProperty(NAME_SCHEMA).withStacktrace(e.getStackTrace()); } if (collector.getValidationFailures().isEmpty()) { try { validate(); } catch (Exception e) { collector.addFailure(e.getMessage(), null).withStacktrace(e.getStackTrace()); } } }
Source:
public List<InputRow> parseBatch(ByteBuffer input) { return ImmutableList.of(parseMap(buildStringKeyMap(input))); }

Target:
public List<InputRow> parseBatch(ByteBuffer input) { return Utils.nullableListOf(parseMap(buildStringKeyMap(input))); }
Source:
private Map<String, String> convertHeadersToMap(String headersString) { Map<String, String> headersMap = new HashMap<>(); if (!Strings.isNullOrEmpty(headersString)) { List<String> headerChunks = Arrays.asList(headersString.split(DELIMITER)); for (String chunk : headerChunks) { String[] keyValue = chunk.split(KV_DELIMITER); headersMap.put(keyValue[0], keyValue[1]); } } return headersMap; }

Target:
private Map<String, String> convertHeadersToMap(String headersString) { Map<String, String> headersMap = new HashMap<>(); if (!Strings.isNullOrEmpty(headersString)) { for (String chunk : headersString.split(DELIMITER)) { String[] keyValue = chunk.split(KV_DELIMITER, 2); if (keyValue.length == 2) { headersMap.put(keyValue[0], keyValue[1]); } else { throw new IllegalArgumentException(String.format("Unable to parse key-value pair '%s'.", chunk)); } } } return headersMap; }
Source:
public void enterVolumePath(String path) { seleniumWebDriverHelper.waitVisibility(newVolumePath).clear(); seleniumWebDriverHelper.waitVisibility(newVolumePath).sendKeys(path); }

Target:
public void enterVolumePath(String path) { seleniumWebDriverHelper.setValue(newVolumePathElement, path); }
Source:
public static String getCaseFileVariableName(Property p) { String name = p.getName(); return name == null ? p.getId() : name; }

Target:
private static String getCaseFileVariableName(Property p) { String name = p.getName(); return name == null ? p.getId() : name; }
Source:
public @Nullable View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.list_view_with_spinner_2, null); mListView = (ListView) v.findViewById(R.id.list); ProgressBar progressBar = (ProgressBar) v.findViewById(R.id.progress); if (mAdapter != null) { mListView.setAdapter(mAdapter); mListView.onRestoreInstanceState(mListState); progressBar.setVisibility(View.GONE); } mBinder.mListView = mListView; mBinder.mProgressBar = progressBar; mBinder.setNoDataView((NoDataView) v.findViewById(R.id.no_data)); return v; }

Target:
public @Nullable View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.list_view_with_spinner, null); mListView = (ListView) v.findViewById(R.id.list); ProgressBar progressBar = (ProgressBar) v.findViewById(R.id.progress); if (mAdapter != null) { mListView.setAdapter(mAdapter); mListView.onRestoreInstanceState(mListState); progressBar.setVisibility(View.GONE); } mBinder.listView = mListView; mBinder.progressBar = progressBar; mBinder.setNoDataView((NoDataView) v.findViewById(R.id.no_data)); return v; }
Source:
private <C extends Content> C createContent(C content, LoveFilmDataRow row, String resourceType, String curieType) { String sku = SKU.valueFrom(row); content.setPublisher(LOVEFILM); content.setCanonicalUri(uri(sku, resourceType)); content.setCurie(curie(sku, curieType)); content.setLastUpdated(new DateTime()); return content; }

Target:
private <C extends Content> C createContent(C content, LoveFilmDataRow row, String resourceType, String curieType) { String sku = SKU.valueFrom(row); content.setPublisher(LOVEFILM); content.setCanonicalUri(uri(sku, resourceType)); content.setCurie(curie(sku, curieType)); content.setLastUpdated(new DateTime().withZone(DateTimeZone.UTC)); return content; }
Source:
protected boolean isDetachAllowed(final boolean isRemoveLast) { boolean returnValue = true; if (getStoragePoolIsoMap() == null) { returnValue = false; addCanDoActionMessage(EngineMessage.STORAGE_DOMAIN_NOT_ATTACHED_TO_STORAGE_POOL); } else if (!isRemoveLast && isMaster()) { boolean isLastActive = getStorageDomainDao().getAllForStoragePool(getStorageDomain().getStoragePoolId()). stream().anyMatch (a -> a.getId().equals(getStorageDomain().getId()) && a.getStatus() == StorageDomainStatus.Active); if (!isLastActive) { returnValue = false; addCanDoActionMessage(EngineMessage.ERROR_CANNOT_DETACH_LAST_STORAGE_DOMAIN); } } return returnValue; }

Target:
protected boolean isDetachAllowed(final boolean isRemoveLast) { boolean returnValue = true; if (getStoragePoolIsoMap() == null) { returnValue = false; addCanDoActionMessage(EngineMessage.STORAGE_DOMAIN_NOT_ATTACHED_TO_STORAGE_POOL); } else if (!isRemoveLast && isMaster()) { returnValue = false; addCanDoActionMessage(EngineMessage.ERROR_CANNOT_DETACH_LAST_STORAGE_DOMAIN); } return returnValue; }
Source:
private void configureJob() throws Exception { job = Job.getInstance(getConf(), "Update statistics for " + tableName); PhoenixMapReduceUtil.setInput(job, NullDBWritable.class, snapshotName, tableName, restoreDir); PhoenixConfigurationUtil.setMRJobType(job.getConfiguration(), MRJobType.UPDATE_STATS); PhoenixConfigurationUtil.setSplitByStats(job.getConfiguration(), false); job.setJarByClass(UpdateStatisticsTool.class); job.setMapperClass(TableSnapshotMapper.class); job.setMapOutputKeyClass(NullWritable.class); job.setMapOutputValueClass(NullWritable.class); job.setOutputFormatClass(NullOutputFormat.class); job.setNumReduceTasks(0); TableMapReduceUtil.addDependencyJars(job); TableMapReduceUtil.addDependencyJarsForClasses(job.getConfiguration(), PhoenixConnection.class, Chronology.class, CharStream.class, TransactionSystemClient.class, TransactionNotInProgressException.class, ZKClient.class, DiscoveryServiceClient.class, ZKDiscoveryService.class, Cancellable.class, TTransportException.class, SpanReceiver.class, TransactionProcessor.class, Gauge.class, MetricRegistriesImpl.class); LOG.info("UpdateStatisticsTool running for: " + tableName + " on snapshot: " + snapshotName + " with restore dir: " + restoreDir); }

Target:
private void configureJob() throws Exception { job = Job.getInstance(getConf(), "UpdateStatistics-" + tableName + "-" + snapshotName); PhoenixMapReduceUtil.setInput(job, NullDBWritable.class, snapshotName, tableName, restoreDir); PhoenixConfigurationUtil.setMRJobType(job.getConfiguration(), MRJobType.UPDATE_STATS); PhoenixConfigurationUtil.setSplitByStats(job.getConfiguration(), false); job.setJarByClass(UpdateStatisticsTool.class); job.setMapperClass(TableSnapshotMapper.class); job.setMapOutputKeyClass(NullWritable.class); job.setMapOutputValueClass(NullWritable.class); job.setOutputFormatClass(NullOutputFormat.class); job.setNumReduceTasks(0); TableMapReduceUtil.addDependencyJars(job); TableMapReduceUtil.addDependencyJarsForClasses(job.getConfiguration(), PhoenixConnection.class, Chronology.class, CharStream.class, TransactionSystemClient.class, TransactionNotInProgressException.class, ZKClient.class, DiscoveryServiceClient.class, ZKDiscoveryService.class, Cancellable.class, TTransportException.class, SpanReceiver.class, TransactionProcessor.class, Gauge.class, MetricRegistriesImpl.class); LOG.info("UpdateStatisticsTool running for: " + tableName + " on snapshot: " + snapshotName + " with restore dir: " + restoreDir); }
Source:
public synchronized void reset() { count = 0; min = 0; max = 0; samples.clear(); }

Target:
public synchronized void reset() { count = 0; min = Double.MAX_VALUE; max = 0; samples.clear(); }