auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void plugins(StringWriter w) { List<String> urls = Lists.newArrayList(); for (WebUiPlugin u : plugins) { if (u.isExternalResource()) { urls.add(u.getJavaScriptResourcePath()); } else { urls.add(String.format("plugins/%s/%s", u.getPluginName(), u.getJavaScriptResourcePath())); } } if (!urls.isEmpty()) { w.write(HPD_ID + ".plugins="); json(urls, w); w.write(";"); } }

Target:
private void plugins(StringWriter w) { List<String> urls = Lists.newArrayList(); List<String> injectedDependencies = Lists.newArrayList(); for (WebUiPlugin u : plugins) { for(Map.Entry<String,String> dep : u.getJavaScriptDependencies().entrySet()) { String depName = dep.getKey(); if(injectedDependencies.contains(depName)) { log.info("Plugin dependency '" + depName + "' already injected. Skipping loading it a second time."); continue; } else { urls.add(dep.getValue()); injectedDependencies.add(depName); } } urls.add(String.format("plugins/%s/%s", u.getPluginName(), u.getJavaScriptResourcePath())); } if (!urls.isEmpty()) { w.write(HPD_ID + ".plugins="); json(urls, w); w.write(";"); } }
Source:
public void createAndDropViewTest() throws DatabaseEngineException { test5Columns(); try { engine.dropView("VN"); } catch (final Throwable a) { } engine.executeUpdate( createView("VN").as(select(all()).from(table("TEST"))) ); engine.dropView("VN"); }

Target:
public void createAndDropViewTest() throws DatabaseEngineException { test5Columns(); engine.executeUpdate( createView("VN").as(select(all()).from(table("TEST"))) ); engine.dropView("VN"); }
Source:
public AbstractFindStoragePopupView(EventBus eventBus, boolean multiSelection) { super(eventBus); table = new EntityModelCellTable<>(multiSelection); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); table.addColumn(new AbstractEntityModelTextColumn<StorageDomain>() { @Override public String getText(StorageDomain storage) { return storage.getStorageName(); } }, constants.nameStorage()); table.addColumn(new AbstractEntityModelEnumColumn<StorageDomain, StorageDomainType>() { @Override protected StorageDomainType getEnum(StorageDomain storage) { return storage.getStorageDomainType(); } }, constants.typeStorage()); table.addColumn(new AbstractEntityModelTextColumn<StorageDomain>() { @Override public String getText(StorageDomain storage) { if (storage.getAvailableDiskSize() == null || storage.getAvailableDiskSize() < 1) { return messages.gigabytes("< 1"); } return messages.gigabytes(storage.getAvailableDiskSize().toString()); } }, constants.freeSpaceStorage()); }

Target:
public AbstractFindStoragePopupView(EventBus eventBus, boolean multiSelection) { super(eventBus); table = new EntityModelCellTable<>(multiSelection); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); table.addColumn(new AbstractEntityModelTextColumn<StorageDomain>() { @Override public String getText(StorageDomain storage) { return storage.getStorageName(); } }, constants.nameStorage()); table.addColumn(new AbstractEntityModelEnumColumn<StorageDomain, StorageDomainType>() { @Override protected StorageDomainType getEnum(StorageDomain storage) { return storage.getStorageDomainType(); } }, constants.typeStorage()); table.addColumn(new AbstractEntityModelTextColumn<StorageDomain>() { @Override public String getText(StorageDomain storage) { if (storage.getAvailableDiskSize() == null || storage.getAvailableDiskSize() < 1) { return messages.gigabytes("< 1"); } return messages.gigabytes(String.valueOf(storage.getAvailableDiskSize())); } }, constants.freeSpaceStorage()); }
Source:
private void handleVdsLiveSnapshotFailure(VdcBLLException e) { log.warn("Could not perform live snapshot due to error: {}. VM will still be configured to the new created snapshot", ExceptionUtils.getMessage(e)); addCustomValue("SnapshotName", getSnapshotName()); addCustomValue("VmName", getVmName()); updateCallStackFromThrowable(e); AuditLogDirector.log(this, AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE); }

Target:
private void handleVdsLiveSnapshotFailure(VdcBLLException e) { log.warn("Could not perform live snapshot due to error, VM will still be configured to the new created snapshot: {}", ExceptionUtils.getMessage(e)); addCustomValue("SnapshotName", getSnapshotName()); addCustomValue("VmName", getVmName()); updateCallStackFromThrowable(e); AuditLogDirector.log(this, AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE); }
Source:
public void start(final ServiceProvider serviceProvider) { this.statisticsExecutor = serviceProvider.getService(ExecutionService.class).getScheduledExecutor(EhcacheStatisticsProvider.class.getSimpleName()); this.cacheManager = serviceProvider.getService(CacheManagerProviderService.class).getCacheManager(); addManagementProvider(new EhcacheActionProvider(getConfiguration().getContext())); addManagementProvider(new EhcacheStatisticsProvider( getConfiguration().getContext(), getConfiguration().getConfigurationFor(EhcacheStatisticsProvider.class), statisticsExecutor)); addManagementProvider(new EhcacheStatisticCollectorProvider(getConfiguration().getContext())); this.cacheManager.registerListener(this); }

Target:
public void start(final ServiceProvider serviceProvider) { this.statisticsExecutor = serviceProvider.getService(ExecutionService.class).getScheduledExecutor(configuration.getStatisticsExecutorAlias()); this.cacheManager = serviceProvider.getService(CacheManagerProviderService.class).getCacheManager(); addManagementProvider(new EhcacheActionProvider(getConfiguration().getContext())); addManagementProvider(new EhcacheStatisticsProvider( getConfiguration().getContext(), getConfiguration().getConfigurationFor(EhcacheStatisticsProvider.class), statisticsExecutor)); addManagementProvider(new EhcacheStatisticCollectorProvider(getConfiguration().getContext())); this.cacheManager.registerListener(this); }
Source:
public static Function<String, Integer> bits() { return new Function<String, Integer>() { @Override public Integer apply(String operatingSystemReferenceCode) { if (operatingSystemReferenceCode != null) { return Integer.parseInt(getLast(Splitter.on("_").split(operatingSystemReferenceCode))); } return null; } }; }

Target:
public static Function<String, Integer> bits() { return new Function<String, Integer>() { @Override public Integer apply(String operatingSystemReferenceCode) { if (operatingSystemReferenceCode != null) { return Ints.tryParse(getLast(Splitter.on("_").split(operatingSystemReferenceCode))); } return null; } }; }
Source:
public void testPrioritizedJobsExecutionInvalidProrities() throws InterruptedException { CountDownAsyncJobListener countDownListener = configureListener(2); CommandContext ctxCMD = new CommandContext(); ctxCMD.setData("businessKey", "low priority"); ctxCMD.setData("priority", -1); ctxCMD.setData("delay", 10L); Date futureDate = new Date(System.currentTimeMillis() + EXTRA_TIME); executorService.scheduleRequest("org.jbpm.executor.commands.DelayedPrintOutCommand", futureDate, ctxCMD); CommandContext ctxCMD2 = new CommandContext(); ctxCMD2.setData("businessKey", "high priority"); ctxCMD2.setData("priority", 10); ctxCMD2.setData("delay", 100L); executorService.scheduleRequest("org.jbpm.executor.commands.DelayedPrintOutCommand", futureDate, ctxCMD2); countDownListener.waitTillCompleted(); List<RequestInfo> inErrorRequests = executorService.getInErrorRequests(new QueryContext()); assertEquals(0, inErrorRequests.size()); List<RequestInfo> queuedRequests = executorService.getQueuedRequests(new QueryContext()); assertEquals(0, queuedRequests.size()); List<RequestInfo> executedRequests = executorService.getCompletedRequests(new QueryContext()); assertEquals(2, executedRequests.size()); RequestInfo executedHigh = executedRequests.get(1); assertNotNull(executedHigh); assertEquals("high priority", executedHigh.getKey()); RequestInfo executedLow = executedRequests.get(0); assertNotNull(executedLow); assertEquals("low priority", executedLow.getKey()); assertTrue(executedLow.getTime().getTime() > executedHigh.getTime().getTime()); }

Target:
public void testPrioritizedJobsExecutionInvalidProrities() throws InterruptedException { CountDownAsyncJobListener countDownListener = configureListener(2); CommandContext ctxCMD = new CommandContext(); ctxCMD.setData("businessKey", "low priority"); ctxCMD.setData("priority", -1); Date futureDate = new Date(System.currentTimeMillis() + EXTRA_TIME); executorService.scheduleRequest("org.jbpm.executor.commands.PrintOutCommand", futureDate, ctxCMD); CommandContext ctxCMD2 = new CommandContext(); ctxCMD2.setData("businessKey", "high priority"); ctxCMD2.setData("priority", 10); executorService.scheduleRequest("org.jbpm.executor.commands.PrintOutCommand", futureDate, ctxCMD2); countDownListener.waitTillCompleted(); List<RequestInfo> inErrorRequests = executorService.getInErrorRequests(new QueryContext()); assertEquals(0, inErrorRequests.size()); List<RequestInfo> queuedRequests = executorService.getQueuedRequests(new QueryContext()); assertEquals(0, queuedRequests.size()); List<RequestInfo> executedRequests = executorService.getCompletedRequests(new QueryContext()); assertEquals(2, executedRequests.size()); RequestInfo executedHigh = executedRequests.get(1); assertNotNull(executedHigh); assertEquals("high priority", executedHigh.getKey()); RequestInfo executedLow = executedRequests.get(0); assertNotNull(executedLow); assertEquals("low priority", executedLow.getKey()); assertTrue(executedLow.getTime().getTime() >= executedHigh.getTime().getTime()); }
Source:
protected static boolean checkForScheme( String[] initialSchemes, boolean relativeFilename, String vfsFilename, VariableSpace space, FileSystemOptions fsOptions ) throws IOException { for ( int i = 0; i < initialSchemes.length && relativeFilename; i++ ) { if ( vfsFilename.startsWith( initialSchemes[ i ] + ":" ) ) { relativeFilename = false; fsOptions = buildFsOptions( space, fsOptions, vfsFilename, initialSchemes[ i ] ); } } return relativeFilename; }

Target:
protected static boolean checkForScheme( String[] initialSchemes, boolean relativeFilename, String vfsFilename, VariableSpace space, FileSystemOptions fsOptions ) throws IOException { for ( int i = 0; i < initialSchemes.length && relativeFilename; i++ ) { if ( vfsFilename.startsWith( initialSchemes[ i ] + ":" ) ) { relativeFilename = false; fsOptionsForScheme = buildFsOptions( space, fsOptions, vfsFilename, initialSchemes[ i ] ); } } return relativeFilename; }
Source:
public String getFamilyName() { return "Delete range"; }

Target:
public String getFamilyName() { return "Delete elements"; }
Source:
public void testExecuteSingleUploadBlobSizeTooLarge() { final long blobSize = ByteSizeUnit.GB.toBytes(randomIntBetween(6, 10)); final S3BlobStore blobStore = mock(S3BlobStore.class); final S3BlobContainer blobContainer = new S3BlobContainer(mock(BlobPath.class), blobStore); final IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> blobContainer.executeSingleUpload(blobStore, randomAlphaOfLengthBetween(1, 10), null, blobSize)); assertEquals("Upload request size [" + blobSize + "] can't be larger than 5gb", e.getMessage()); }

Target:
public void testExecuteSingleUploadBlobSizeTooLarge() throws IOException { final long blobSize = ByteSizeUnit.GB.toBytes(randomIntBetween(6, 10)); final S3BlobStore blobStore = mock(S3BlobStore.class); final S3BlobContainer blobContainer = new S3BlobContainer(mock(BlobPath.class), blobStore); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage(containsString("can't be larger than 5gb")); blobContainer.executeSingleUpload(blobStore, randomAlphaOfLengthBetween(1, 10), null, blobSize); }
Source:
public void run(final ThrowingRunnable<E> backgroundAction) { Preconditions.checkNotNull(backgroundAction); final AtomicReference<Throwable> exceptionRef = new AtomicReference<>(); final WaitDialog waitDialog = new WaitDialog(null, waitDialogTitle); waitDialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); final SwingWorker<Void, Void> worker = new SwingWorker<>() { @Override protected Void doInBackground() { try { backgroundAction.run(); } catch (final Throwable e) { exceptionRef.set(e); } return null; } @Override protected void done() { waitDialog.setVisible(false); waitDialog.dispose(); } }; SwingComponents.addWindowClosedListener(waitDialog, () -> worker.cancel(true)); worker.execute(); waitDialog.setVisible(true); try { @SuppressWarnings("unchecked") final @Nullable E exception = (E) exceptionRef.get(); if (exception != null) { exceptionHandler.accept(exception); } } catch (final ClassCastException e) { throw new AssertionError("unexpected checked exception", e); } }

Target:
public void run(final ThrowingRunnable<E> backgroundAction) { Preconditions.checkNotNull(backgroundAction); final AtomicReference<Exception> exceptionRef = new AtomicReference<>(); final WaitDialog waitDialog = new WaitDialog(null, waitDialogTitle); waitDialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); final SwingWorker<Void, Void> worker = buildBackgroundJobRunnerWithWaitDialog(backgroundAction, exceptionRef, waitDialog); SwingComponents.addWindowClosedListener(waitDialog, () -> worker.cancel(true)); worker.execute(); waitDialog.setVisible(true); try { @SuppressWarnings("unchecked") final @Nullable E exception = (E) exceptionRef.get(); if (exception != null) { exceptionHandler.accept(exception); } } catch (final ClassCastException e) { throw new IllegalStateException("Unexpected exception thrown", e); } }
Source:
public void addAttachedArtifact( Artifact artifact ) throws DuplicateArtifactAttachmentException { int index = attachedArtifacts.indexOf( artifact ); if ( index > 0 ) { LOGGER.warn( "artifact already attached, remove previous instance and add again" ); attachedArtifacts.set( index, artifact ); } attachedArtifacts.add( artifact ); }

Target:
public void addAttachedArtifact( Artifact artifact ) throws DuplicateArtifactAttachmentException { int index = attachedArtifacts.indexOf( artifact ); if ( index >= 0 ) { LOGGER.warn( "artifact already attached, replace previous instance", artifact ); attachedArtifacts.set( index, artifact ); } else { attachedArtifacts.add( artifact ); } }
Source:
public static String getQualifiedNameLabelWithSufficientDepth(final NamedElement namedElement, final Namespace model) { Assert.isNotNull(namedElement); StringBuffer label = new StringBuffer(); List<Package> importedPackages = null; if (null != model) { importedPackages = new ArrayList<Package>(model.getImportedPackages()); } List<Namespace> visitedNamespaces = new ArrayList<Namespace>(); Namespace currentNamespace = namedElement.getNamespace(); boolean rootFound = false; boolean modelIsTheRoot = false; while (currentNamespace != null && !rootFound) { visitedNamespaces.add(currentNamespace); if (null != importedPackages || null != model) { if (importedPackages.contains(currentNamespace) || currentNamespace == model) { rootFound = true; if (currentNamespace == model) { modelIsTheRoot = true; } } } Element owner = currentNamespace.getOwner(); while (null != owner && !(owner instanceof Namespace)) { owner = owner.getOwner(); } currentNamespace = owner != null ? (Namespace) owner : null; } int qualifiedNameDepht = visitedNamespaces.size() - 1 - (modelIsTheRoot ? 1 : 0); for (int i = qualifiedNameDepht; i >= 0; i--) { label.append(visitedNamespaces.get(i).getName()); label.append("::"); } label.append(namedElement.getName()); return label.toString(); }

Target:
public static String getQualifiedNameLabelWithSufficientDepth(final NamedElement namedElement, final Namespace model) { Assert.isNotNull(namedElement); StringBuffer label = new StringBuffer(); List<Package> importedPackages = null; if (null != model) { importedPackages = new ArrayList<Package>(model.getImportedPackages()); } List<Namespace> visitedNamespaces = new ArrayList<Namespace>(); Namespace currentNamespace = namedElement.getNamespace(); boolean rootFound = false; boolean modelIsTheRoot = false; while (currentNamespace != null && !rootFound) { visitedNamespaces.add(currentNamespace); if (null != importedPackages && (importedPackages.contains(currentNamespace) || currentNamespace.equals(model))) { rootFound = true; if (currentNamespace.equals(model)) { modelIsTheRoot = true; } } Element owner = currentNamespace.getOwner(); while (null != owner && !(owner instanceof Namespace)) { owner = owner.getOwner(); } currentNamespace = owner != null ? (Namespace) owner : null; } int qualifiedNameDepht = visitedNamespaces.size() - 1 - (modelIsTheRoot ? 1 : 0); for (int i = qualifiedNameDepht; i >= 0; i--) { label.append(visitedNamespaces.get(i).getName()); label.append("::"); } label.append(namedElement.getName()); return label.toString(); }
Source:
protected List<Dimension> getAllDimensions() { return getEntityDictionary().getAllFields(getEntityClass()).stream() .filter(field -> !AbstractMetric.isMetricField(field, getEntityClass(), getEntityDictionary())) .filter(field -> getEntityDictionary().isRelation(getEntityClass(), field)) .map(getEntityDictionary()::getEntityClass) .map(this::constructDimension) .collect( Collectors.collectingAndThen( Collectors.toList(), Collections::unmodifiableList ) ); }

Target:
private Set<Dimension> getAllDimensions() { return getEntityDictionary().getAllFields(getEntityClass()).stream() .filter(field -> !isMetricField(field)) .map(field -> constructDimension(field, getEntityClass(), getEntityDictionary())) .collect( Collectors.collectingAndThen( Collectors.toSet(), Collections::unmodifiableSet ) ); }
Source:
public void execute() { Long accountId = null; Account account = _accountService.getActiveAccountByName(accountName, domainId); if (account != null) { accountId = account.getAccountId(); } if (accountId == null) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "The account does not exists or has been removed/disabled"); } if (getValue() == null) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Please send a valid non-empty quota value"); } if (getQuotaEnforce() != null) { _quotaService.setLockAccount(accountId, getQuotaEnforce()); } if (getMinBalance() != null) { _quotaService.setMinBalance(accountId, getMinBalance()); } else { _quotaService.setMinBalance(accountId, 0.2 * getValue()); } final QuotaCreditsResponse response = _responseBuilder.addQuotaCredits(accountId, getDomainId(), getValue(), CallContext.current().getCallingUserId()); response.setResponseName(getCommandName()); response.setObjectName("quotacredits"); setResponseObject(response); }

Target:
public void execute() { Long accountId = null; Account account = _accountService.getActiveAccountByName(accountName, domainId); if (account != null) { accountId = account.getAccountId(); } if (accountId == null) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "The account does not exists or has been removed/disabled"); } if (getValue() == null) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Please send a valid non-empty quota value"); } if (getQuotaEnforce() != null && getQuotaEnforce()) { _quotaService.setLockAccount(accountId, getQuotaEnforce()); } if (getMinBalance() != null) { _quotaService.setMinBalance(accountId, getMinBalance()); } else { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Please set a value for min balance"); } final QuotaCreditsResponse response = _responseBuilder.addQuotaCredits(accountId, getDomainId(), getValue(), CallContext.current().getCallingUserId()); response.setResponseName(getCommandName()); response.setObjectName("quotacredits"); setResponseObject(response); }
Source:
public Path(Class<?> entityClass, EntityDictionary dictionary, String dotSeparatedPath) { pathElements = new ArrayList<>(); String[] fieldNames = dotSeparatedPath.split("\\."); Class<?> currentClass = entityClass; String currentClassName = dictionary.getJsonAliasFor(currentClass); for (String fieldName : fieldNames) { if (dictionary.isRelation(currentClass, fieldName)) { Class<?> relationClass = dictionary.getParameterizedType(currentClass, fieldName); pathElements.add(new PathElement(currentClass, currentClassName, relationClass, fieldName)); currentClass = relationClass; currentClassName = fieldName; } else if (dictionary.isAttribute(currentClass, fieldName) || fieldName.equals(dictionary.getIdFieldName(entityClass))) { Class<?> attributeClass = dictionary.getType(currentClass, fieldName); pathElements.add(new PathElement(currentClass, currentClassName, attributeClass, fieldName)); } else { throw new InvalidValueException(entityClass.getSimpleName() + " doesn't contain the field " + fieldName); } } }

Target:
public Path(Class<?> entityClass, EntityDictionary dictionary, String dotSeparatedPath) { pathElements = new ArrayList<>(); String[] fieldNames = dotSeparatedPath.split("\\."); Class<?> currentClass = entityClass; String currentClassName = dictionary.getJsonAliasFor(currentClass); for (String fieldName : fieldNames) { if (dictionary.isRelation(currentClass, fieldName)) { Class<?> relationClass = dictionary.getParameterizedType(currentClass, fieldName); pathElements.add(new PathElement(currentClass, currentClassName, relationClass, fieldName)); currentClass = relationClass; currentClassName = fieldName; } else if (dictionary.isAttribute(currentClass, fieldName) || fieldName.equals(dictionary.getIdFieldName(entityClass))) { Class<?> attributeClass = dictionary.getType(currentClass, fieldName); pathElements.add(new PathElement(currentClass, currentClassName, attributeClass, fieldName)); } else { throw new InvalidValueException(dictionary.getJsonAliasFor(currentClass) + " doesn't contain the field " + fieldName); } } }
Source:
public void delete(MessageWriteSet messageSetToDelete) throws StoreException { final Timer.Context context = metrics.deleteResponse.time(); checkStarted(); List<MessageInfo> infoList = messageSetToDelete.getMessageSetInfo(); for (MessageInfo info : infoList) { if (!index.exists(info.getStoreKey())) { throw new StoreException("Cannot delete id " + info.getStoreKey() + " since it is not present in the index.", StoreErrorCodes.ID_Not_Found); } } synchronized (lock) { try { messageSetToDelete.writeTo(log); logger.trace("Store : delete mark written to log", dataDir); for (MessageInfo info : infoList) { FileSpan fileSpan = new FileSpan(log.getLogEndOffset() - info.getSize(), log.getLogEndOffset()); index.markAsDeleted(info.getStoreKey(), fileSpan); } logger.trace("Store : delete has been marked in the index ", dataDir); } catch (IOException e) { throw new StoreException("IO error while trying to delete blobs : " + e, StoreErrorCodes.IOError); } finally { context.stop(); } } }

Target:
public void delete(MessageWriteSet messageSetToDelete) throws StoreException { final Timer.Context context = metrics.deleteResponse.time(); checkStarted(); List<MessageInfo> infoList = messageSetToDelete.getMessageSetInfo(); for (MessageInfo info : infoList) { if (!index.exists(info.getStoreKey())) { throw new StoreException("Cannot delete id " + info.getStoreKey() + " since it is not present in the index.", StoreErrorCodes.ID_Not_Found); } } synchronized (lock) { try { messageSetToDelete.writeTo(log); logger.trace("Store : delete mark written to log", dataDir); for (MessageInfo info : infoList) { FileSpan fileSpan = new FileSpan(log.getLogEndOffset() - info.getSize(), log.getLogEndOffset()); index.markAsDeleted(info.getStoreKey(), fileSpan); } logger.trace("Store : delete has been marked in the index ", dataDir); } catch (IOException e) { throw new StoreException("IO error while trying to delete blobs", e, StoreErrorCodes.IOError); } finally { context.stop(); } } }
Source:
public Path getFilePath() { if(getFile() == null) { return null; } return Paths.get(getFile().getAbsolutePath()); }

Target:
public Path getFilePath() { if(getFile() == null) { return null; } return getFile().toPath(); }
Source:
public String toString() { StringBuilder sb = new StringBuilder("ColumnarArray{"); sb.append("positionCount=").append(getPositionCount()).append(","); sb.append("offsetsOffset=").append(offsetsOffset).append(","); sb.append("nullCheckBlock=").append(nullCheckBlock.toString()).append(","); sb.append("elementsBlock=").append(elementsBlock.toString()).append(","); sb.append('}'); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(getClass().getSimpleName()).append("{"); sb.append("positionCount=").append(getPositionCount()).append(","); sb.append("offsetsOffset=").append(offsetsOffset).append(","); sb.append("nullCheckBlock=").append(nullCheckBlock.toString()).append(","); sb.append("elementsBlock=").append(elementsBlock.toString()).append(","); sb.append('}'); return sb.toString(); }
Source:
public void actionPerformed(ActionEvent e) { boolean exists = false; for (ResourceAssignment ra: myAssignments) { if (ra.getResource().equals(myHumanResource)){ delete(ra); exists = true; break; } } if (!exists) { createAssignment(); myMutator.commit(); } }

Target:
public void actionPerformed(ActionEvent e) { myUIFacade.getUndoManager().undoableEdit(getLocalizedDescription(), new Runnable() { @Override public void run() { if (getValue(Action.SELECTED_KEY) == Boolean.TRUE) { createAssignment(); } else { delete(myHumanResource); } } }); }
Source:
private static Map<String, String> resourcesToOrderedMap(List<Resource> resources) { String cpus = null; String mem = null; String ports = null; for (Resource r : resources) { switch (r.getName()) { case "cpus": cpus = String.valueOf(r.getScalar().getValue()); break; case "mem": mem = String.valueOf(r.getScalar().getValue()); break; case "ports": ports = rangeListToString(r.getRanges().getRangeList()); break; default: new RuntimeException("Unrecognized resource " + r.getName()); break; } } Map<String, String> map = new LinkedHashMap<>(); if (cpus != null) { map.put("cpus", cpus); } if (mem != null) { map.put("mem", mem); } if (ports != null) { map.put("ports", ports); } return map; }

Target:
private static Map<String, String> resourcesToOrderedMap(List<Resource> resources) { Map<String, String> map = new TreeMap<>(); for (Resource r : resources) { String name; String value = ""; if (r.hasRole()) { name = r.getName() + "(" + r.getRole() + ")"; } else { name = r.getName(); } switch (r.getType()) { case SCALAR: value = String.valueOf(r.getScalar().getValue()); break; case RANGES: value = rangesToString(r.getRanges()); break; case SET: value = setToString(r.getSet()); break; default: value = "Unrecognized Resource Type: `" + r.getType() + "'"; break; } map.put(name, value); } return map; }
Source:
public void testGetAllOfTypeWithUnrepresentedType() { List<VDS> result = dao.getAllOfType(VDSType.forValue(-1)); assertIncorrectGetResult(result); }

Target:
public void testGetAllOfTypeWithUnrepresentedType() { List<VDS> result = dao.getAllOfType(null); assertIncorrectGetResult(result); }
Source:
void applyTxMessage(TxMessage msg) throws Exception { verifyMetadata(msg.getMetadata()); if (msg.getMetadata().getSnapshotTimestamp() < srcGlobalSnapshot) { log.warn("Received message with snapshot is smaller than current snapshot {}.Ignore it", msg.getMetadata().getSnapshotTimestamp(), srcGlobalSnapshot); return; } if (msg.getMetadata().getSnapshotTimestamp() > srcGlobalSnapshot) { srcGlobalSnapshot = msg.getMetadata().getSnapshotTimestamp(); lastMsgTs = srcGlobalSnapshot; } if (msg.getMetadata().getEntryTimeStamp() <= lastMsgTs) { return; } if (msg.getMetadata().getPreviousEntryTimestamp() == lastMsgTs) { processMsg(msg); lastMsgTs = msg.getMetadata().getEntryTimeStamp(); processQue(); } if (msgQ.size() < MAX_MSG_QUE_SIZE) { msgQ.putIfAbsent(msg.getMetadata().getPreviousEntryTimestamp(), msg); } }

Target:
void applyTxMessage(TxMessage msg) throws Exception { verifyMetadata(msg.getMetadata()); if (msg.getMetadata().getSnapshotTimestamp() < srcGlobalSnapshot) { log.warn("Received message with snapshot is smaller than current snapshot {}.Ignore it", msg.getMetadata().getSnapshotTimestamp(), srcGlobalSnapshot); return; } if (msg.getMetadata().getSnapshotTimestamp() > srcGlobalSnapshot) { srcGlobalSnapshot = msg.getMetadata().getSnapshotTimestamp(); lastMsgTs = srcGlobalSnapshot; cleanMsgQ(lastMsgTs); } if (msg.getMetadata().getEntryTimeStamp() <= lastMsgTs) { return; } if (msg.getMetadata().getPreviousEntryTimestamp() == lastMsgTs) { processMsg(msg); lastMsgTs = msg.getMetadata().getEntryTimeStamp(); processQueue(); } if (msgQ.size() < MAX_MSG_QUE_SIZE) { msgQ.putIfAbsent(msg.getMetadata().getPreviousEntryTimestamp(), msg); } else if (msgQ.get(msg.getMetadata().getPreviousEntryTimestamp()) != null) { log.warn("The message is out of order and the queue is full, will drop the message {}", msg.getMetadata()); } }
Source:
private boolean validateCanAmendDisk() { DiskImage disk = (DiskImage) getNewDisk(); DiskValidator diskValidator = new DiskValidator(disk); if (!validate(diskValidator.isDiskExists()) && !validate(diskValidator.isDiskPluggedToVmsThatAreNotDown(false, attachedVmsInfo))) { return false; } setStoragePoolId(disk.getStoragePoolId()); if (!validate(new StoragePoolValidator(getStoragePool()).isUp())) { return false; } if (!FeatureSupported.qcowCompatSupported(getStoragePool().getCompatibilityVersion())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_AMEND_NOT_SUPPORTED_BY_DC_VERSION, String.format("$dataCenterVersion %s", getStoragePool().getCompatibilityVersion().toString())); } if (disk.getVmEntityType().isTemplateType()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_AMEND_TEMPLATE_DISK); } setStorageDomainId(disk.getStorageIds().get(0)); StorageDomainValidator storageDomainValidator = new StorageDomainValidator(getStorageDomain()); if (!validate(storageDomainValidator.isDomainExistAndActive())) { return false; } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(Collections.singletonList(disk)); return validate(diskImagesValidator.diskImagesNotIllegal()); }

Target:
private boolean validateCanAmendDisk() { DiskImage disk = (DiskImage) getNewDisk(); setStoragePoolId(disk.getStoragePoolId()); if (!validate(new StoragePoolValidator(getStoragePool()).isUp())) { return false; } if (!FeatureSupported.qcowCompatSupported(getStoragePool().getCompatibilityVersion())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_AMEND_NOT_SUPPORTED_BY_DC_VERSION, String.format("$dataCenterVersion %s", getStoragePool().getCompatibilityVersion().toString())); } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(Collections.singletonList(disk)); return validate(diskImagesValidator.diskImagesNotIllegal()); }
Source:
@Test public void currentTraceContextIsVisibleInCallbackThread() throws Exception { Tracer tracer = httpTracing.tracing().tracer(); AtomicBoolean callbackHasTraceCtx = new AtomicBoolean(false); AtomicBoolean callbackCompleted = new AtomicBoolean(false); server.enqueue(new MockResponse()); closeClient(client); client = TracingHttpAsyncClientBuilder.create(httpTracing).build(); client.start(); ScopedSpan span = tracer.startScopedSpan("test"); TraceContext expectedTraceCtx = span.context(); try { getAsyncWithCallback(client, "/foo", new FutureCallback<HttpResponse>() { @Override public void completed(HttpResponse result) { callbackHasTraceCtx.set(expectedTraceCtx == currentTraceContext.get()); callbackCompleted.set(true); } @Override public void failed(Exception ex) { callbackCompleted.set(true); } @Override public void cancelled() { callbackCompleted.set(true); } }); } finally { span.finish(); } server.takeRequest(); waitForCallbackCompletion(callbackCompleted); takeSpan(); takeSpan(); assertTrue("Callback thread did not have expected trace ctx", callbackHasTraceCtx.get()); }

Target:
@Test public void currentTraceContextIsVisibleInCallbackThread() throws Exception { CountDownLatch callbackCompleted = new CountDownLatch(1); AtomicReference callbackTraceContext = new AtomicReference(); Tracer tracer = httpTracing.tracing().tracer(); server.enqueue(new MockResponse()); ScopedSpan span = tracer.startScopedSpan("test"); TraceContext expectedTraceContext = span.context(); try { getAsyncWithCallback(client, "/foo", new FutureCallback<HttpResponse>() { @Override public void completed(HttpResponse result) { callbackTraceContext.set(currentTraceContext.get()); callbackCompleted.countDown(); } @Override public void failed(Exception ex) { callbackCompleted.countDown(); } @Override public void cancelled() { callbackCompleted.countDown(); } }); } finally { span.finish(); } server.takeRequest(); callbackCompleted.await(1, TimeUnit.SECONDS); assertThat(callbackTraceContext.get()).isSameAs(expectedTraceContext); takeSpan(); takeSpan(); }
Source:
public void returnsEvents() throws Exception { final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, "{ \"id\": 1, \"events\": [ \"push\", \"pull_request\" ] }" ) ).start(this.resource.port()); try { MatcherAssert.assertThat( new RtHook( new ApacheRequest(container.home()), repo(), 1 ).json().getJsonArray("events") .stream() .map(JsonValue::toString) .map(event -> event.replace("\"", "")) .collect(Collectors.toList()), Matchers.containsInAnyOrder("push", "pull_request") ); } finally { container.stop(); } }

Target:
public void returnsEvents() throws Exception { final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, "{ \"id\": 1, \"events\": [ \"push\", \"pull_request\" ] }" ) ).start(this.resource.port()); try { MatcherAssert.assertThat( new RtHook( new ApacheRequest(container.home()), repo(), 1 ).json().getJsonArray("events") .stream() .map(JsonValue::toString) .map(event -> event.replace("\"", "")) .collect(Collectors.toList()), new IsIterableContainingInAnyOrder<>( Arrays.asList( new IsEqual<>("push"), new IsEqual<>("pull_request") ) ) ); } finally { container.stop(); } }
Source:
public PublisherPack get(PublisherClient client) throws IOException, ServiceNotAuthorizedException, ServiceNotEnabledException { if (closed) throw new IOException("Push already closed"); PublisherSession session = client.getSession(); Collection<SubscribeSpec> specs = session.getSubscriptions( repositoryName); if (specs.size() == 0) return null; Repository r = client.openRepository(repositoryName); try { synchronized (this) { for (PublisherPack p : packs) { if (p.match(specs)) return p; } PublisherPack newPack = generate( r, commands, specs, pushId + "-" + packs.size()); packs.add(newPack); return newPack; } } finally { r.close(); } }

Target:
public PublisherPack get(PublisherClient client) throws IOException, ServiceNotAuthorizedException, ServiceNotEnabledException { if (closed) throw new IOException("Push already closed"); PublisherSession session = client.getSession(); Set<SubscribeSpec> specs = session.getSubscriptions(repositoryName); if (specs.size() == 0) return null; Repository r = client.openRepository(repositoryName); try { Generator packGenerator = null; synchronized (this) { for (Generator p : packs) { if (p.match(specs)) packGenerator = p; } if (packGenerator == null) { Set<ReceiveCommand> matchedUpdates = new HashSet< ReceiveCommand>(); for (ReceiveCommand rc : commands) { for (SubscribeSpec f : specs) { if (f.isMatch(rc.getRefName())) { matchedUpdates.add(rc); break; } } } if (matchedUpdates.size() == 0) return null; packGenerator = new Generator(r, matchedUpdates, specs, pushId + "-" + packs.size()); packs.add(packGenerator); } } return packGenerator.get(); } finally { r.close(); } }
Source:
public String getSelinuxEnforceMode() { if (selinuxEnforceMode == null) { } else if (selinuxEnforceMode.equals(SELinuxMode.DISABLED)) { return constants.disabled(); } else if (selinuxEnforceMode.equals(SELinuxMode.PERMISSIVE)) { return constants.permissive(); } else if (selinuxEnforceMode .equals(SELinuxMode.ENFORCING)) { return constants.enforcing(); } return constants.notAvailableLabel(); }

Target:
public String getSelinuxEnforceMode() { return selinuxEnforceMode; }
Source:
public static void main(String... args) throws IOException { try { final CommandLine commandLine = parseCli(args); if (commandLine.getArgList().size() == 1) { writePropertiesFile(commandLine.getArgList().get(0), commandLine.getOptionValue(OPTION_DEST_FILE)); } else { printUsage(); } } catch (ParseException ex) { System.out.println(ex.getMessage()); printUsage(); } catch (ANTLRException ex) { ex.printStackTrace(); } }

Target:
public static void main(String... args) throws CheckstyleException, ParseException { final CommandLine commandLine = parseCli(args); if (commandLine.getArgList().size() == 1) { try { writePropertiesFile(commandLine.getArgList().get(0), commandLine.getOptionValue(OPTION_DEST_FILE)); } catch (IOException ex) { throw new CheckstyleException("Failed to write properties file", ex); } } else { printUsage(); } }
Source:
public static long getBaseSize(byte[] delta) { int p = 0; long baseLen = 0; int c, shift = 0; do { c = delta[p++] & 0xff; baseLen |= ((c & 0x7f) << shift); shift += 7; } while ((c & 0x80) != 0); return baseLen; }

Target:
public static long getBaseSize(byte[] delta) { int p = 0; long baseLen = 0; int c, shift = 0; do { c = delta[p++] & 0xff; baseLen |= ((long) (c & 0x7f)) << shift; shift += 7; } while ((c & 0x80) != 0); return baseLen; }
Source:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_IMAGE && resultCode == RESULT_OK) { Objects.requireNonNull(data); Objects.requireNonNull(data.getData()); Uri uri = data.getData(); try { Bitmap image = MediaStore.Images.Media.getBitmap(getContentResolver(), uri); if (image != null) { displayMessage("Group image changed"); } else { displayMessage("Could not retrieve image"); } } catch (IOException e) { displayMessage("Could not retrieve image"); } } else if (requestCode == REQUEST_ADD_USERS && resultCode == RESULT_OK){ ArrayList<String> emailList = data.getStringArrayListExtra( AddUsersFromEntourageActivity.EMAIL_LIST_KEY); int count = 0; List<User> entourage = mUser.getEntourage(); for (int i = 0; i < emailList.size(); i++){ for (int j = 0; j < entourage.size(); j++){ if (entourage.get(j).getEmail().equals(emailList.get(i)) && !mGroup.containsUser(entourage.get(j))){ count++; } } } String text = count + " user(s) added to group"; displayMessage(text); } }

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_IMAGE && resultCode == RESULT_OK) { Objects.requireNonNull(data); Objects.requireNonNull(data.getData()); Uri uri = data.getData(); try { Bitmap image = MediaStore.Images.Media.getBitmap(getContentResolver(), uri); if (image != null) { String message = "Group image changed"; YieldsApplication.showToast(getApplicationContext(), message); } else { String message = "Could not retrieve image"; YieldsApplication.showToast(getApplicationContext(), message); } } catch (IOException e) { String message = "Could not retrieve image"; YieldsApplication.showToast(getApplicationContext(), message); Log.d(TAG, message); } } else if (requestCode == REQUEST_ADD_USERS && resultCode == RESULT_OK){ ArrayList<String> emailList = data.getStringArrayListExtra( AddUsersFromEntourageActivity.EMAIL_LIST_KEY); int count = 0; List<User> entourage = mUser.getEntourage(); for (int i = 0; i < emailList.size(); i++){ for (int j = 0; j < entourage.size(); j++){ if (entourage.get(j).getEmail().equals(emailList.get(i)) && !mGroup.containsUser(entourage.get(j))){ count++; } } } String message = count + " user(s) added to group"; YieldsApplication.showToast(getApplicationContext(), message); } }
Source:
public String tensorflowName() { return "MergeZZZ"; }

Target:
public String tensorflowName() { throw new NoOpNameFoundException("This operation has no TF counterpart"); }
Source:
public final void onMessage(M message, MessageCollector collector, TaskCoordinator coordinator) { this.numMessage.inc(); long startNs = this.highResClock.nanoTime(); Collection<RM> results = handleMessage(message, collector, coordinator); long endNs = this.highResClock.nanoTime(); this.handleMessageNs.update(endNs - startNs); results.forEach(rm -> this.registeredOperators.forEach(op -> op.onMessage(rm, collector, coordinator))); InitableFunction transformFn = getOperatorSpec().getTransformFn(); if (transformFn != null && transformFn instanceof WatermarkFunction) { long outputWm = ((WatermarkFunction) transformFn).getOutputWatermark(); if (outputWatermark < outputWm) { outputWatermark = outputWm; this.registeredOperators.forEach(op -> op.onWatermark(outputWatermark, collector, coordinator)); } } }

Target:
public final void onMessage(M message, MessageCollector collector, TaskCoordinator coordinator) { this.numMessage.inc(); long startNs = this.highResClock.nanoTime(); Collection<RM> results = handleMessage(message, collector, coordinator); long endNs = this.highResClock.nanoTime(); this.handleMessageNs.update(endNs - startNs); results.forEach(rm -> this.registeredOperators.forEach(op -> op.onMessage(rm, collector, coordinator))); WatermarkFunction watermarkFn = getOperatorSpec().getWatermarkFn(); if (watermarkFn != null) { Long outputWm = watermarkFn.getOutputWatermark(); propagateWatermark(outputWm, collector, coordinator); } }
Source:
public Optional<RefundTransactionsForPayment> getRefundsForPayment(Long gatewayAccountId, String paymentExternalId) { var uri = UriBuilder .fromPath(ledgerUrl) .path(format("/v1/transaction/%s/transaction", paymentExternalId)) .queryParam("gateway_account_id", gatewayAccountId); Response response = getResponse(uri); if (response.getStatus() == SC_OK) { return Optional.of(response.readEntity(RefundTransactionsForPayment.class)); } return Optional.empty(); }

Target:
public RefundTransactionsForPayment getRefundsForPayment(Long gatewayAccountId, String paymentExternalId) { var uri = UriBuilder .fromPath(ledgerUrl) .path(format("/v1/transaction/%s/transaction", paymentExternalId)) .queryParam("gateway_account_id", gatewayAccountId); Response response = getResponse(uri); if (response.getStatus() == SC_OK) { try { return response.readEntity(RefundTransactionsForPayment.class); } catch (ProcessingException exception) { logger.error("Error processing response from ledger for payment refunds: {}", kv(GATEWAY_ACCOUNT_ID, gatewayAccountId), kv(PAYMENT_EXTERNAL_ID, paymentExternalId)); throw new LedgerException(exception); } } else { logger.error("Received non-success status code for get refunds for payment from Ledger: {}, {}", kv(GATEWAY_ACCOUNT_ID, gatewayAccountId), kv(PAYMENT_EXTERNAL_ID, paymentExternalId)); throw new GetRefundsForPaymentException(response); } }
Source:
public static boolean isUrlEncoded(String in) { if (!URL_VALID_PATTERN.matcher(in).matches()) { return false; } int percentIdx = 0; while ((percentIdx = in.indexOf('%', percentIdx)) != -1) { if (percentIdx + 2 >= in.length()) { return false; } if (!isHexadecimal(in.charAt(percentIdx + 1)) || !isHexadecimal(in.charAt(percentIdx + 2))) { System.err.println("% is followed by non-alphanumeric " + in.substring(percentIdx, percentIdx + 2)); return false; } percentIdx += 2; } return true; }

Target:
public static boolean isUrlEncoded(String in) { if (!URL_VALID_PATTERN.matcher(in).matches()) { return false; } int percentIdx = 0; while ((percentIdx = in.indexOf('%', percentIdx)) != -1) { if (percentIdx + 2 >= in.length()) { return false; } if (!isHexadecimal(in.charAt(percentIdx + 1)) || !isHexadecimal(in.charAt(percentIdx + 2))) { return false; } percentIdx += 2; } return true; }
Source:
public boolean performOk() { DocCommentOwnerManager.getInstance() .setWorkspaceCommentOwner(fDocCommentOwnerComposite.getSelectedDocCommentOwner()); fDocCommentOwnerComposite.performOk(null); return super.performOk(); }

Target:
public boolean performOk() { DocCommentOwnerManager.getInstance() .setWorkspaceCommentOwner(fDocCommentOwnerComposite.getSelectedDocCommentOwner()); fDocCommentOwnerComposite.performOk(); return super.performOk(); }
Source:
public Map<IntermediateDataSetID, PersistedIntermediateResultDescriptor> getPersistedIntermediateResult() { if (!JobStatus.FINISHED.equals(state)) { return null; } final List<IntermediateDataSetID> persistedIntermediateDataSetIds = getPersistedIntermediateDataSetID(); Map<IntermediateDataSetID, PersistedIntermediateResultDescriptor> persistedIntermediateResults = new HashMap<>(persistedIntermediateDataSetIds.size()); for (IntermediateDataSetID intermediateDataSetID : persistedIntermediateDataSetIds) { PersistedIntermediateResultDescriptor intermediateResultDescriptor = getPersistedIntermediateResultDescriptor(intermediateDataSetID); persistedIntermediateResults.put(intermediateDataSetID, intermediateResultDescriptor); } return persistedIntermediateResults; }

Target:
public Map<IntermediateDataSetID, PersistedIntermediateResultDescriptor> getPersistedIntermediateResult() { if (!JobStatus.FINISHED.equals(state)) { return null; } Map<IntermediateDataSetID, PersistedIntermediateResultDescriptor> intermediateResultInfos = new HashMap<>(); intermediateResults.forEach(((intermediateDataSetID, intermediateResult) -> { if (!intermediateResult.getResultType().isPersistent()) { return; } intermediateResultInfos.put(intermediateDataSetID, getPersistedIntermediateResultDescriptor(intermediateResult)); })); return intermediateResultInfos; }
Source:
public void flushToFileWriter(ColumnDescriptor path, ParquetFileWriter writer) throws IOException { ColumnChunkPageWriter pageWriter = writers.get(path); pageWriter.writeToFileWriter(writer); }

Target:
void flushToFileWriter(ColumnDescriptor path, ParquetFileWriter writer) throws IOException { ColumnChunkPageWriter pageWriter = writers.get(path); pageWriter.writeToFileWriter(writer); }
Source:
public void setJobRegistry(JobRegistry jobRegistry) { this.jobRegistry = jobRegistry; if (stepRegistry == null && jobRegistry instanceof StepRegistry) { setStepRegistry((StepRegistry) jobRegistry); } }

Target:
public void setJobRegistry(JobRegistry jobRegistry) { this.jobRegistry = jobRegistry; }
Source:
private PasswordBasedEncryptionUtil(Cipher cipher, AlgorithmParameters algorithmParameters, Alphabet alphabet) { this.cipher = cipher; this.alphabet = alphabet; this.algorithmParameters = algorithmParameters; }

Target:
PasswordBasedEncryptionUtil(Cipher cipher, AlgorithmParameters algorithmParameters, Alphabet alphabet) { this.cipher = cipher; this.alphabet = alphabet; this.algorithmParameters = algorithmParameters; }
Source:
public boolean equals(Object obj) { if (!(obj instanceof GlusterVolumeSizeInfo)) { return false; } GlusterVolumeSizeInfo sizeInfo = (GlusterVolumeSizeInfo)obj; if (!(volumeId.equals(sizeInfo.getVolumeName()))) { return false; } if (!(volumeId.equals(sizeInfo.getVolumeId()))) { return false; } if (totalSize != sizeInfo.getTotalSize()) { return false; } if (freeSize != sizeInfo.getFreeSize()) { return false; } if (usedSize != sizeInfo.getUsedSize()) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (!(obj instanceof GlusterVolumeSizeInfo)) { return false; } GlusterVolumeSizeInfo sizeInfo = (GlusterVolumeSizeInfo) obj; if (!ObjectUtils.objectsEqual(volumeId, sizeInfo.getVolumeId())) { return false; } if (!ObjectUtils.objectsEqual(updatedAt, sizeInfo.getUpdatedAt())) { return false; } if (!ObjectUtils.objectsEqual(totalSize, sizeInfo.getTotalSize())) { return false; } if (!ObjectUtils.objectsEqual(freeSize, sizeInfo.getFreeSize())) { return false; } if (!ObjectUtils.objectsEqual(usedSize, sizeInfo.getUsedSize())) { return false; } return true; }
Source:
public void testFileAsStringSimpleFile() throws IOException { File tempFile = File.createTempFile("UtilsTestTempFlie", ".tmp"); try { String testContent = "Test Content"; Files.write(tempFile.toPath(), testContent.getBytes()); assertEquals(testContent, Utils.readFileAsString(tempFile.getPath())); } finally { Files.deleteIfExists(tempFile.toPath()); } }

Target:
public void testFileAsStringSimpleFile() throws IOException { File tempFile = TestUtils.tempFile(); try { String testContent = "Test Content"; Files.write(tempFile.toPath(), testContent.getBytes()); assertEquals(testContent, Utils.readFileAsString(tempFile.getPath())); } finally { Files.deleteIfExists(tempFile.toPath()); } }
Source:
public static UVCDialog newInstance() { final UVCDialog dialog = new UVCDialog(); final Bundle args = new Bundle(); dialog.setArguments(args); return dialog; }

Target:
public static UVCDialog newInstance() { final UVCDialog dialog = new UVCDialog(); return dialog; }