auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String extractString(QueryMetadata metadata) throws Exception { FluoQueryStringBuilder builder = new FluoQueryStringBuilder(); return builder.setQueryId(metadata.getNodeId()).setQueryType(metadata.getQueryType()) .setExportStrategies(metadata.getExportStrategies()).setQuery(metadata.getSparql()).build(); }

Target:
private static String extractString(QueryMetadata metadata) throws Exception { FluoQueryStringBuilder builder = new FluoQueryStringBuilder(); return builder.setQueryId(metadata.getNodeId()).setQueryType(metadata.getQueryType()) .setExportStrategies(metadata.getExportStrategies()).setQuery(metadata.getSparql()).build(); }
Source:
public ClosableIterator<Tuple> executeBackendQuery(BackendQuery<InfinispanRemoteQueryDescriptor> backendQuery, QueryParameters queryParameters) { InfinispanRemoteQueryDescriptor queryDescriptor = backendQuery.getQuery(); RemoteCache<ProtostreamId, ProtostreamPayload> cache = provider.getCache( queryDescriptor.getCache() ); QueryFactory queryFactory = Search.getQueryFactory( cache ); Query query = queryFactory.create( queryDescriptor.getText() ); applyNamedParamters( queryParameters, query ); applyRowSelection( queryParameters, query ); boolean hasProjection = !queryDescriptor.getProjections().isEmpty(); EntityKeyMetadata entityKeyMetadata = backendQuery.getSingleEntityMetadataInformationOrNull() == null ? null : backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata(); if ( hasProjection && entityKeyMetadata != null ) { throw log.addEntityNotAllowedInNativeQueriesUsingProjection( entityKeyMetadata.getTable(), backendQuery.toString() ); } return hasProjection ? new RawTypeClosableIterator( query.list(), queryDescriptor.getProjections() ) : new ProtostreamPayloadClosableIterator( query.list() ); }

Target:
public ClosableIterator<Tuple> executeBackendQuery(BackendQuery<InfinispanRemoteQueryDescriptor> backendQuery, QueryParameters queryParameters) { InfinispanRemoteQueryDescriptor queryDescriptor = backendQuery.getQuery(); RemoteCache<ProtostreamId, ProtostreamPayload> cache = provider.getCache( queryDescriptor.getCache() ); QueryFactory queryFactory = Search.getQueryFactory( cache ); Query query = queryFactory.create( queryDescriptor.getText() ); applyNamedParameters( queryParameters, query ); applyRowSelection( queryParameters, query ); boolean hasProjection = !queryDescriptor.getProjections().isEmpty(); EntityKeyMetadata entityKeyMetadata = backendQuery.getSingleEntityMetadataInformationOrNull() == null ? null : backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata(); if ( hasProjection && entityKeyMetadata != null ) { throw log.addEntityNotAllowedInNativeQueriesUsingProjection( entityKeyMetadata.getTable(), backendQuery.toString() ); } return hasProjection ? new RawTypeClosableIterator( query.list(), queryDescriptor.getProjections() ) : new ProtostreamPayloadClosableIterator( query.list() ); }
Source:
public static SWTBotShell openPreferences(SWTBot bot) { if (SWTUtils.isMac()) { try { bot.activeShell().pressShortcut(KeyStroke.getInstance(IKeyLookup.COMMAND_NAME + "+"), KeyStroke.getInstance(",")); } catch (ParseException e) { fail(); } } else { bot.menu("Window").menu("Preferences").click(); } bot.waitUntil(Conditions.shellIsActive("Preferences")); return bot.activeShell(); }

Target:
public static SWTBotShell openPreferences(SWTBot bot) { if (SWTUtils.isMac()) { try { bot.activeShell().pressShortcut(KeyStroke.getInstance(IKeyLookup.COMMAND_NAME + "+"), KeyStroke.getInstance(",")); } catch (ParseException e) { fail(); } } else { bot.menu(WINDOW_MENU).menu(PREFERENCES_MENU_ITEM).click(); } bot.waitUntil(Conditions.shellIsActive(PREFERENCES_MENU_ITEM)); return bot.activeShell(); }
Source:
public void shouldSendEventIfTheUserShouldResetPassword() throws Exception { List<MotechUser> users = prepareMotechUsersOne(); when(settingService.isPasswordResetReminderEnabled()).thenReturn(true); when(allUsers.retrieveAll()).thenReturn(users); eventHandler.handleEvent(event); MotechEvent expectedEvent = prepareExpectedEvent(users.get(1)); verify(allUsers, times(1)).retrieveAll(); verify(eventRelay, times(1)).sendEventMessage(eventCaptor.capture()); verify(settingService, times(1)).isPasswordResetReminderEnabled(); verify(settingService, times(1)).getNumberOfDaysForReminder(); verify(settingService, times(1)).getNumberOfDaysToChangePassword(); assertEquals(expectedEvent, eventCaptor.getValue()); }

Target:
public void shouldSendEventIfTheUserShouldResetPassword() throws Exception { List<MotechUser> users = prepareMotechUsersOne(); when(settingService.isPasswordResetReminderEnabled()).thenReturn(true); when(allUsers.retrieveAll()).thenReturn(users); eventHandler.handleEvent(event); List<MotechEvent> expectedEvent = prepareExpectedEvent(users); verify(allUsers, times(1)).retrieveAll(); verify(eventRelay, times(2)).sendEventMessage(eventCaptor.capture()); verify(settingService, times(1)).isPasswordResetReminderEnabled(); verify(settingService, times(1)).getNumberOfDaysForReminder(); verify(settingService, times(1)).getNumberOfDaysToChangePassword(); assertEquals(expectedEvent, eventCaptor.getAllValues()); }
Source:
public void testUUIDType() throws Exception { Schema fromAvro = Schema.createRecord("myrecord", null, null, false, Arrays.asList(new Schema.Field("uuid", LogicalTypes.uuid().addToSchema(Schema.create(STRING)), null, null))); String parquet = "message myrecord {\n" + " required binary uuid (STRING);\n" + "}\n"; Schema toAvro = Schema.createRecord("myrecord", null, null, false, Arrays.asList(new Schema.Field("uuid", Schema.create(STRING), null, null))); testAvroToParquetConversion(fromAvro, parquet); testParquetToAvroConversion(toAvro, parquet); }

Target:
public void testUUIDType() throws Exception { Schema fromAvro = Schema.createRecord("myrecord", null, null, false, Arrays.asList(new Schema.Field("uuid", LogicalTypes.uuid().addToSchema(Schema.create(STRING)), null, null))); String parquet = "message myrecord {\n" + " required binary uuid (STRING);\n" + "}\n"; Schema toAvro = Schema.createRecord("myrecord", null, null, false, Arrays.asList(new Schema.Field("uuid", Schema.create(STRING), null, null))); testAvroToParquetConversion(fromAvro, parquet); testParquetToAvroConversion(toAvro, parquet); assertEquals(COMPATIBLE, checkReaderWriterCompatibility(fromAvro, toAvro).getType()); }
Source:
public static BillTrade ofYield(TradeInfo info, Bill product, double quantity, double yield) { ArgChecker.isTrue(info.getSettlementDate().isPresent(), "Bill trades from yield need a settlement date."); LocalDate settlementDate = info.getSettlementDate().get(); double price = product.priceFromYield(yield, settlementDate); return BillTrade.builder() .info(info) .product(product) .quantity(quantity) .price(price).build(); }

Target:
public static BillTrade ofYield(TradeInfo info, Bill product, double quantity, double yield) { ArgChecker.isTrue(info.getSettlementDate().isPresent(), "Bill trades from yield need a settlement date"); LocalDate settlementDate = info.getSettlementDate().get(); double price = product.priceFromYield(yield, settlementDate); return BillTrade.builder() .info(info) .product(product) .quantity(quantity) .price(price) .build(); }
Source:
private void performSingleNodeSolrRestore() throws URISyntaxException { String restoreUrl = getReplicationUrl(coreName); try { createSolrCore(); URIBuilder uriBuilder = new URIBuilder(restoreUrl); uriBuilder.addParameter("command", "restore"); if (StringUtils.isNotBlank(backupLocation)) { uriBuilder.addParameter("location", backupLocation); } URI restoreUri = uriBuilder.build(); LOGGER.debug("Sending request to {}", restoreUri); HttpWrapper httpClient = getHttpClient(); processResponse(httpClient.execute(restoreUri)); } catch (IOException | SolrServerException e) { LOGGER.info("Unable to perform single node Solr restore", e); } }

Target:
private void performSingleNodeSolrRestore() throws URISyntaxException { String restoreUrl = getReplicationUrl(coreName); try { createSolrCore(); httpBuilder = new org.codice.solr.factory.impl.HttpClientBuilder(encryptionService); URIBuilder uriBuilder = new URIBuilder(restoreUrl); uriBuilder.addParameter("command", "restore"); if (StringUtils.isNotBlank(backupLocation)) { uriBuilder.addParameter("location", backupLocation); } URI restoreUri = uriBuilder.build(); LOGGER.debug("Sending request to {}", restoreUri); printResponse(sendGetRequest(restoreUri)); } catch (IOException | SolrServerException e) { LOGGER.info("Unable to perform single node Solr restore, core: {}", coreName, e); } }
Source:
public void validate() { assertTrue(!studentEnrollRequests.isEmpty(), ERROR_MESSAGE_EMPTY_ENROLLMENT); assertTrue(studentEnrollRequests.size() <= 100, ERROR_MESSAGE_TOO_MANY_ENROLLMENTS); for (StudentEnrollRequest request : studentEnrollRequests) { request.validate(); } Set<String> emails = new HashSet<>(); for (StudentEnrollRequest request : studentEnrollRequests) { assertTrue(!emails.contains(request.getEmail()), String.format(ERROR_MESSAGE_DUPLICATE_EMAIL, request.getEmail())); emails.add(request.getEmail()); } Map<String, String> teamInSection = new HashMap<>(); for (StudentEnrollRequest request : studentEnrollRequests) { if (teamInSection.containsKey(request.getTeam())) { assertTrue(request.getSection().equals(teamInSection.get(request.getTeam())), String.format(ERROR_MESSAGE_SAME_TEAM_IN_DIFFERENT_SECTION, request.getTeam(), request.getSection(), teamInSection.get(request.getTeam()))); } else { teamInSection.put(request.getTeam(), request.getSection()); } } }

Target:
public void validate() { assertTrue(!studentEnrollRequests.isEmpty(), ERROR_MESSAGE_EMPTY_ENROLLMENT); assertTrue(studentEnrollRequests.size() <= Const.SIZE_LIMIT_PER_ENROLLMENT, ERROR_MESSAGE_TOO_MANY_ENROLLMENTS); for (StudentEnrollRequest request : studentEnrollRequests) { request.validate(); } Set<String> emails = new HashSet<>(); for (StudentEnrollRequest request : studentEnrollRequests) { assertTrue(!emails.contains(request.getEmail()), String.format(ERROR_MESSAGE_DUPLICATE_EMAIL, request.getEmail())); emails.add(request.getEmail()); } }
Source:
public static PoolDto asDto(Pool<? extends Poolable<?, ?>> from) { PoolDto dto = new PoolDto(); dto.setId(from.getId()); dto.setName(from.getName()); dto.setAlias(from.getAlias()); dto.setConcentration(from.getConcentration()); dto.setIdentificationBarcode(from.getIdentificationBarcode()); dto.setReadyToRun(from.getReadyToRun()); dto.setQcPassed(from.getQcPassed()); dto.setCreationDate(from.getCreationDate()); if (from.getLastModified() != null) { dto.setLastModified(getDateAsString(from.getLastModified())); } Set<DilutionDto> pooledElements = new HashSet<DilutionDto>(); for (Dilution ld : from.getDilutions()) { if (ld != null) { pooledElements.add(asDto(ld)); } } dto.setPooledElements(pooledElements); if (!isStringEmptyOrNull(from.getIdentificationBarcode())) { dto.setIdentificationBarcode(from.getIdentificationBarcode()); } dto.setLocationLabel(BoxUtils.makeLocationLabel(from)); return dto; }

Target:
public static PoolDto asDto(Pool<? extends Poolable<?, ?>> from) { PoolDto dto = new PoolDto(); dto.setId(from.getId()); dto.setName(from.getName()); dto.setAlias(from.getAlias()); dto.setConcentration(from.getConcentration()); dto.setReadyToRun(from.getReadyToRun()); dto.setQcPassed(from.getQcPassed()); dto.setCreationDate(from.getCreationDate()); if (from.getLastModified() != null) { dto.setLastModified(getDateAsString(from.getLastModified())); } Set<DilutionDto> pooledElements = new HashSet<DilutionDto>(); for (Dilution ld : from.getDilutions()) { if (ld != null) { pooledElements.add(asDto(ld)); } } dto.setPooledElements(pooledElements); if (!isStringEmptyOrNull(from.getIdentificationBarcode())) { dto.setIdentificationBarcode(from.getIdentificationBarcode()); } dto.setLocationLabel(BoxUtils.makeLocationLabel(from)); return dto; }
Source:
public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context, IReorgQueries reorgQueries) throws CoreException { Assert.isNotNull(reorgQueries); ResourceChangeChecker checker= context.getChecker(ResourceChangeChecker.class); RefactoringModifications modifications= getModifications(); IResourceChangeDescriptionFactory deltaFactory= checker.getDeltaFactory(); for (IFile allModifiedFile : getAllModifiedFiles()) { deltaFactory.change(allModifiedFile); } if (modifications != null) { modifications.buildDelta(deltaFactory); modifications.buildValidateEdits(context.getChecker(ValidateEditChecker.class)); } return new RefactoringStatus(); }

Target:
public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context, IReorgQueries reorgQueries) throws CoreException { Assert.isNotNull(reorgQueries); ResourceChangeChecker checker= context.getChecker(ResourceChangeChecker.class); RefactoringModifications modifications= getModifications(); IResourceChangeDescriptionFactory deltaFactory= checker.getDeltaFactory(); for (IFile file : getAllModifiedFiles()) { deltaFactory.change(file); } if (modifications != null) { modifications.buildDelta(deltaFactory); modifications.buildValidateEdits(context.getChecker(ValidateEditChecker.class)); } return new RefactoringStatus(); }
Source:
private boolean areBricksInTheList(final List<GlusterBrickEntity> bricks, final List<GlusterBrickEntity> searchBricks) { boolean found = false; for (GlusterBrickEntity paramBrick : bricks) { for (GlusterBrickEntity brick : searchBricks) { if (paramBrick.getId().equals(brick.getId()) || (paramBrick.getBrickDirectory().equals(brick.getBrickDirectory()) && paramBrick.getServerId().equals(brick.getServerId()))) { found = true; break; } if (!found) { return found; } found = false; } } return found; }

Target:
private boolean areBricksInTheList(final List<GlusterBrickEntity> bricks, final List<GlusterBrickEntity> searchBricks) { boolean found = false; for (GlusterBrickEntity paramBrick : bricks) { found = false; for (GlusterBrickEntity brick : searchBricks) { if ((paramBrick.getId() != null && brick.getId() !=null && paramBrick.getId().equals(brick.getId())) || (paramBrick.getBrickDirectory() != null && brick.getBrickDirectory() != null && paramBrick.getServerId() != null && brick.getServerId() != null && paramBrick.getBrickDirectory().equals(brick.getBrickDirectory()) && paramBrick.getServerId().equals(brick.getServerId()))) { found = true; break; } } } return found; }
Source:
public boolean isNegotiationAuth() { return context.get(ExtensionProperties.AAA_AUTHENTICATION_CAPABILITIES) != null ? (Extension.AAAFlags.AAA_NEGOTIATION_AUTH_FLAG & (int) context.get(ExtensionProperties.AAA_AUTHENTICATION_CAPABILITIES)) == Extension.AAAFlags.AAA_NEGOTIATION_AUTH_FLAG : false; }

Target:
public boolean isNegotiationAuth() { Integer capabilities = (Integer) context.get(ExtensionProperties.AAA_AUTHENTICATION_CAPABILITIES); if (capabilities == null) { return false; } else { return (capabilities & AAA_AUTH_CAP_FLAGS_NEGOTIATING) != 0; } }
Source:
public ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor) throws ExecutionException { return new SnapshotInfo(EMPTY_STRING); }

Target:
public ISnapshotInfo getSnapshotInfo(String sessionName, IProgressMonitor monitor) throws ExecutionException { return null; }
Source:
void hideToolTip () { checkWidget (); if (itemToolTip == null) return; itemToolTip.setVisible (false); }

Target:
void hideToolTip () { if (itemToolTip == null) return; itemToolTip.setVisible (false); }
Source:
public Artifact makeNewArtifact(IOseeBranch branch, IArtifactType artifactTypeToken, String artifactName, String guid, Long uuid) { ArtifactType artifactType = ArtifactTypeManager.getType(artifactTypeToken); Conditions.checkExpressionFailOnTrue(artifactType.isAbstract(), "Cannot create an instance of abstract type [%s]", artifactType); if (guid == null) { guid = GUID.create(); } else { Conditions.checkExpressionFailOnTrue(!GUID.isValid(guid), "Invalid guid [%s] during artifact creation [name: %s]", guid, artifactName); } Artifact artifact = getArtifactInstance(guid, BranchManager.getBranch(branch), artifactType, false); Integer artId = uuid == null ? ConnectionHandler.getSequence().getNextArtifactId() : new Integer(String.valueOf(uuid)); artifact.setArtId(artId); artifact.meetMinimumAttributeCounts(true); ArtifactCache.cache(artifact); artifact.setLinksLoaded(true); if (Strings.isValid(artifactName)) { artifact.setName(artifactName); } return artifact; }

Target:
public Artifact makeNewArtifact(IOseeBranch branch, IArtifactType artifactTypeToken, String artifactName, String guid, Long uuid) { ArtifactType artifactType = ArtifactTypeManager.getType(artifactTypeToken); Conditions.checkExpressionFailOnTrue(artifactType.isAbstract(), "Cannot create an instance of abstract type [%s]", artifactType); if (guid == null) { guid = GUID.create(); } else { Conditions.checkExpressionFailOnTrue(!GUID.isValid(guid), "Invalid guid [%s] during artifact creation [name: %s]", guid, artifactName); } Artifact artifact = getArtifactInstance(guid, BranchManager.getBranch(branch), artifactType, false); Integer artId = uuid == null ? ConnectionHandler.getSequence().getNextArtifactId() : uuid.intValue(); artifact.setArtId(artId); artifact.meetMinimumAttributeCounts(true); ArtifactCache.cache(artifact); artifact.setLinksLoaded(true); if (Strings.isValid(artifactName)) { artifact.setName(artifactName); } return artifact; }
Source:
public void render(int mouseX, int mouseY, float partialTicks) { this.modList.render(mouseX, mouseY, partialTicks); if (this.modInfo != null) this.modInfo.render(mouseX, mouseY, partialTicks); String text = I18n.format("fml.menu.mods.search"); int x = getFontRenderer().getStringWidth(text); getFontRenderer().drawString(text, x, modList.getBottom() + 5, 0xFFFFFF); this.search.render(mouseX, mouseY, partialTicks); super.render(mouseX, mouseY, partialTicks); }

Target:
public void render(int mouseX, int mouseY, float partialTicks) { this.modList.render(mouseX, mouseY, partialTicks); if (this.modInfo != null) this.modInfo.render(mouseX, mouseY, partialTicks); String text = I18n.format("fml.menu.mods.search"); int x = ((modList.getRight()) / 2) - (getFontRenderer().getStringWidth(text) / 2); getFontRenderer().drawString(text, x, modList.getBottom() + 5, 0xFFFFFF); this.search.render(mouseX, mouseY, partialTicks); super.render(mouseX, mouseY, partialTicks); }
Source:
public InfinispanCodeGenerator(CompilerArgs compArgs, DomainModel domainModel) { super(compArgs, domainModel); if (compArgs.getParams().get(COLLECTION_CLASS_NAME_KEY) == "") { setCollectionToUse("pt.ist.fenixframework.core.adt.bplustree.BPlusTree"); } }

Target:
public InfinispanCodeGenerator(CompilerArgs compArgs, DomainModel domainModel) { super(compArgs, domainModel); String collectionName = compArgs.getParams().get(COLLECTION_CLASS_NAME_KEY); if (collectionName == null || collectionName.isEmpty()) { setCollectionToUse("pt.ist.fenixframework.core.adt.bplustree.BPlusTree"); } }
Source:
public synchronized void startMonitoring() { log("Monitoring"); List<PackageInfo> apps = mPackageManager.getInstalledPackages(GET_PERMISSIONS | MATCH_KNOWN_PACKAGES); if (apps == null) { loge("No apps"); return; } SparseIntArray netdPermsUids = new SparseIntArray(); for (PackageInfo app : apps) { int uid = app.applicationInfo != null ? app.applicationInfo.uid : INVALID_UID; if (uid < 0) { continue; } boolean isNetwork = hasNetworkPermission(app); boolean hasRestrictedPermission = hasRestrictedNetworkPermission(app); if (isNetwork || hasRestrictedPermission) { Boolean permission = mApps.get(uid); if (permission == null || permission == NETWORK) { mApps.put(uid, hasRestrictedPermission); } } if (app.requestedPermissions != null) { int otherNetdPerms = filterPermission(Arrays.asList(app.requestedPermissions)); if (otherNetdPerms != 0) { netdPermsUids.put(uid, netdPermsUids.get(uid) | otherNetdPerms); mPackageNameUidMap.put(app.applicationInfo.packageName, uid); } } } List<UserInfo> users = mUserManager.getUsers(true); if (users != null) { for (UserInfo user : users) { mUsers.add(user.id); } } log("Users: " + mUsers.size() + ", Apps: " + mApps.size()); update(mUsers, mApps, true); sendPackagesPermissionsToNetd(netdPermsUids); PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class); pmi.getPackageList(new PackageListObserver()); }

Target:
public synchronized void startMonitoring() { log("Monitoring"); PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class); pmi.getPackageList(new PackageListObserver()); List<PackageInfo> apps = mPackageManager.getInstalledPackages(GET_PERMISSIONS | MATCH_ANY_USER); if (apps == null) { loge("No apps"); return; } SparseIntArray netdPermsUids = new SparseIntArray(); for (PackageInfo app : apps) { int uid = app.applicationInfo != null ? app.applicationInfo.uid : INVALID_UID; if (uid < 0) { continue; } boolean isNetwork = hasNetworkPermission(app); boolean hasRestrictedPermission = hasRestrictedNetworkPermission(app); if (isNetwork || hasRestrictedPermission) { Boolean permission = mApps.get(uid); if (permission == null || permission == NETWORK) { mApps.put(uid, hasRestrictedPermission); } } if (app.requestedPermissions != null) { int otherNetdPerms = filterPermission(Arrays.asList(app.requestedPermissions)); if (otherNetdPerms != 0) { netdPermsUids.put(uid, netdPermsUids.get(uid) | otherNetdPerms); synchronized (mPackageNameUidMap) { mPackageNameUidMap.put(app.applicationInfo.packageName, uid); } } } } List<UserInfo> users = mUserManager.getUsers(true); if (users != null) { for (UserInfo user : users) { mUsers.add(user.id); } } log("Users: " + mUsers.size() + ", Apps: " + mApps.size()); update(mUsers, mApps, true); sendPackagePermissionsToNetd(netdPermsUids); }
Source:
private Mirror createMirror(ArtifactRepository repo, Mirror toMirror) { Mirror mirror = toMirror.clone(); String urlToReplace = toMirror.getMirrorOf(); mirror.setUrl(repo.getUrl().replace(urlToReplace, toMirror.getUrl())); mirror.setId(toMirror.getId() + "_" + repo.getId()); return mirror; }

Target:
private Mirror createMirror(ArtifactRepository repo, Mirror toMirror) { Mirror mirror = toMirror.clone(); String urlToReplace = toMirror.getMirrorOf(); String newUrl = StringUtils.replaceOnce(repo.getUrl(), urlToReplace, toMirror.getUrl()); mirror.setUrl(newUrl); mirror.setId(toMirror.getId()); return mirror; }
Source:
public void testDeleteMissingUseTrash() { final DistCpOptions.Builder builder = new DistCpOptions.Builder( Collections.singletonList(new Path("hdfs://localhost:8020/source")), new Path("hdfs://localhost:8020/target/")); Assert.assertFalse(builder.build().shouldDeleteUseTrash()); DistCpOptions options = builder.withSyncFolder(true) .withDeleteMissing(true) .withDeleteUseTrash(true) .build(); Assert.assertTrue(options.shouldSyncFolder()); Assert.assertTrue(options.shouldDeleteMissing()); Assert.assertTrue(options.shouldDeleteUseTrash()); options = new DistCpOptions.Builder( Collections.singletonList(new Path("hdfs://localhost:8020/source")), new Path("hdfs://localhost:8020/target/")) .withOverwrite(true) .withDeleteMissing(true) .withDeleteUseTrash(true) .build(); Assert.assertTrue(options.shouldDeleteUseTrash()); Assert.assertTrue(options.shouldOverwrite()); Assert.assertTrue(options.shouldDeleteMissing()); try { new DistCpOptions.Builder( Collections.singletonList(new Path("hdfs://localhost:8020/source")), new Path("hdfs://localhost:8020/target/")) .withDeleteUseTrash(true) .build(); fail("Delete useTrash should fail without delete option"); } catch (IllegalArgumentException e) { assertExceptionContains( "Delete useTrash is applicable only with delete option", e); } }

Target:
public void testDeleteMissingUseTrash() throws Exception { final DistCpOptions.Builder builder = new DistCpOptions.Builder( Collections.singletonList(new Path("hdfs://localhost:8020/source")), new Path("hdfs://localhost:8020/target/")); Assert.assertFalse("Delete does not use trash by default.", builder.build().shouldDeleteUseTrash()); DistCpOptions options = builder.withSyncFolder(true) .withDeleteMissing(true) .withDeleteUseTrash(true) .build(); Assert.assertTrue(options.shouldSyncFolder()); Assert.assertTrue(options.shouldDeleteMissing()); Assert.assertTrue(options.shouldDeleteUseTrash()); options = new DistCpOptions.Builder( Collections.singletonList(new Path("hdfs://localhost:8020/source")), new Path("hdfs://localhost:8020/target/")) .withOverwrite(true) .withDeleteMissing(true) .withDeleteUseTrash(true) .build(); Assert.assertTrue(options.shouldDeleteUseTrash()); Assert.assertTrue(options.shouldOverwrite()); Assert.assertTrue(options.shouldDeleteMissing()); LambdaTestUtils.intercept(IllegalArgumentException.class, () -> new DistCpOptions.Builder(Collections.singletonList( new Path("hdfs://localhost:8020/source")), new Path("hdfs://localhost:8020/target/")) .withDeleteUseTrash(true) .build()); }
Source:
public void create() { Composite parent = getParent(); Map<String, HyperLink> model = getModel(); if (parent == null || model.size() == 0) { return; } setupControl(parent); ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); scrolledComposite.setExpandVertical(true); scrolledComposite.setExpandHorizontal(true); Browser browser = new Browser(scrolledComposite, SWT.NONE); browser.setJavascriptEnabled(false); browser.addLocationListener(new LocationListener() { @Override public void changing(LocationEvent ev) { if (ev.location.startsWith(TIME_PREFIX)) { String time = ev.location.substring(TIME_PREFIX.length()); Long val = Longs.tryParse(time); if (val != null) { TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(ev.getSource(), TmfTimestamp.fromNanos(val))); } ev.doit = false; } } @Override public void changed(LocationEvent ev) { } }); setupControl(browser); String toolTipHtml = toHtml(); browser.setText(toolTipHtml); scrolledComposite.setContent(browser); Point p = computePreferredSize(); scrolledComposite.setMinSize(Math.min(p.x > fScrollBarSize.x ? p.x - fScrollBarSize.x : p.x, 750 - fScrollBarSize.x), 0); }

Target:
public void create() { Composite parent = getParent(); Map<String, HyperLink> model = getModel(); if (parent == null || model.size() == 0) { return; } setupControl(parent); ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); scrolledComposite.setExpandVertical(true); scrolledComposite.setExpandHorizontal(true); Browser browser = new Browser(scrolledComposite, SWT.NONE); browser.setJavascriptEnabled(false); browser.addLocationListener(new LocationListener() { @Override public void changing(LocationEvent ev) { Matcher matcher = TIME_PATTERN.matcher(ev.location); if (matcher.find()) { String time = matcher.group(1); Long val = Longs.tryParse(time); if (val != null) { TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(ev.getSource(), TmfTimestamp.fromNanos(val))); } ev.doit = false; } } @Override public void changed(LocationEvent ev) { } }); setupControl(browser); String toolTipHtml = toHtml(); browser.setText(toolTipHtml); scrolledComposite.setContent(browser); Point preferredSize = computePreferredSize(); scrolledComposite.setMinSize(Math.min(preferredSize.x > fScrollBarSize.x ? preferredSize.x - fScrollBarSize.x : preferredSize.x, MAX_SHELL_WIDTH - fScrollBarSize.x), 0); }
Source:
public static void main(String[] args) { TextAnalyticsAsyncClient client = new TextAnalyticsClientBuilder() .subscriptionKey("subscription-key") .endpoint("<LINK_0>") .buildAsyncClient(); String text = "hello world"; client.detectLanguage(text).subscribe( result -> { final DetectedLanguage primaryLanguage = result.getPrimaryLanguage(); System.out.printf("Detected Language: %s, ISO 6391 Name: %s, Score: %s", primaryLanguage.getName(), primaryLanguage.getIso6391Name(), primaryLanguage.getScore()); }, error -> System.err.println("There was an error detecting language of the text" + error), () -> System.out.println("Language detected.")); }

Target:
public static void main(String[] args) { TextAnalyticsAsyncClient client = new TextAnalyticsClientBuilder() .subscriptionKey("subscription-key") .endpoint("<LINK_0>") .buildAsyncClient(); String text = "hello world"; client.detectLanguage(text).subscribe( result -> { final DetectedLanguage primaryLanguage = result.getPrimaryLanguage(); System.out.printf("Detected Language: %s, ISO 6391 Name: %s, Score: %s.%n", primaryLanguage.getName(), primaryLanguage.getIso6391Name(), primaryLanguage.getScore()); }, error -> System.err.println("There was an error detecting language of the text." + error), () -> System.out.println("Language detected.")); try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException ignored) { } }
Source:
public void testNumberOfOwners() { addNode(testAddresses[0], "m0", null, null); updateConsistentHash(1); assertNumberOwners(testAddresses[0], 1); updateConsistentHash(2); assertNumberOwners(testAddresses[0], 1); addNode(testAddresses[1], "m1", null, null); updateConsistentHash(1); for (Address testAddress : ch.getMembers()) { assertNumberOwners(testAddress, 1); } updateConsistentHash(2); for (Address testAddress : ch.getMembers()) { assertNumberOwners(testAddress, 2); } updateConsistentHash(3); for (Address testAddress : ch.getMembers()) { assertNumberOwners(testAddress, 2); } addNode(testAddresses[2], "m0", null, null); updateConsistentHash(1); for (Address testAddress : ch.getMembers()) { assertNumberOwners(testAddress, 1); } updateConsistentHash(2); for (Address testAddress : ch.getMembers()) { assertNumberOwners(testAddress, 2); } updateConsistentHash(3); for (Address testAddress : ch.getMembers()) { assertNumberOwners(testAddress, 3); } updateConsistentHash(4); for (Address testAddress : ch.getMembers()) { assertNumberOwners(testAddress, 3); } }

Target:
public void testNumberOfOwners() { addNode(testAddresses[0], "m0", null, null); updateConsistentHash(1); IntStream.range(0, numSegments).forEach(i -> assertOwners(i, 1)); updateConsistentHash(2); IntStream.range(0, numSegments).forEach(i -> assertOwners(i, 1)); addNode(testAddresses[1], "m1", null, null); updateConsistentHash(1); int numSegments = ch.getNumSegments(); IntStream.range(0, numSegments).forEach(i -> assertOwners(i, 1)); updateConsistentHash(2); IntStream.range(0, numSegments).forEach(i -> assertOwners(i, 2)); updateConsistentHash(3); IntStream.range(0, numSegments).forEach(i -> assertOwners(i, 2)); addNode(testAddresses[2], "m0", null, null); updateConsistentHash(1); IntStream.range(0, numSegments).forEach(i -> assertOwners(i, 1)); updateConsistentHash(2); IntStream.range(0, numSegments).forEach(i -> assertOwners(i, 2)); updateConsistentHash(3); IntStream.range(0, numSegments).forEach(i -> assertOwners(i, 3)); updateConsistentHash(4); IntStream.range(0, numSegments).forEach(i -> assertOwners(i, 3)); }
Source:
private static void runErlc(ErlangTarget target, CompileContext context, ErlangCompilerOptions compilerOptions, List<String> erlangModulePathsToCompile, BuildOutputConsumer outputConsumer, File outputDirectory, boolean isTest) throws ProjectBuildException, IOException { GeneralCommandLine commandLine = getErlcCommandLine(target, context, compilerOptions, outputDirectory, erlangModulePathsToCompile, isTest); Process process; LOG.debug("Run erlc compiler with command" + commandLine.getCommandLineString()); try { process = commandLine.createProcess(); } catch (ExecutionException e) { throw new ProjectBuildException("Failed to launch erlang compiler", e); } BaseOSProcessHandler handler = new BaseOSProcessHandler(process, commandLine.getCommandLineString(), Charset.defaultCharset()); ProcessAdapter adapter = new ErlangCompilerProcessAdapter(context, NAME, ""); handler.addProcessListener(adapter); handler.startNotify(); handler.waitFor(); consumeFiles(outputConsumer, getOutputErlangModuleFiles(erlangModulePathsToCompile, outputDirectory)); }

Target:
private static void runErlc(ErlangTarget target, CompileContext context, ErlangCompilerOptions compilerOptions, List<String> erlangModulePathsToCompile, BuildOutputConsumer outputConsumer, File outputDirectory, boolean isTest) throws ProjectBuildException, IOException { GeneralCommandLine commandLine = getErlcCommandLine(target, context, compilerOptions, outputDirectory, erlangModulePathsToCompile, isTest); Process process; LOG.debug("Run erlc compiler with command " + commandLine.getCommandLineString()); try { process = commandLine.createProcess(); } catch (ExecutionException e) { throw new ProjectBuildException("Failed to launch erlang compiler", e); } BaseOSProcessHandler handler = new BaseOSProcessHandler(process, commandLine.getCommandLineString(), Charset.defaultCharset()); ProcessAdapter adapter = new ErlangCompilerProcessAdapter(context, NAME, ""); handler.addProcessListener(adapter); handler.startNotify(); handler.waitFor(); consumeFiles(outputConsumer, getBeams(erlangModulePathsToCompile, outputDirectory)); }
Source:
private static void checkCfgBlock(CfgBlock cfgBlock, SubscriptionContext ctx, DefinedVariables definedVariables, Set<CfgBlock> unreachableBlocks, DefinedVariablesAnalysis analysis, List<Symbol> ignoredSymbols) { Map<Symbol, DefinedVariablesAnalysis.VariableDefinition> currentState = new HashMap<>(definedVariables.getIn()); for (Tree element : cfgBlock.elements()) { definedVariables.getVariableUsages(element).forEach((symbol, symbolUsage) -> { if (symbolUsage.isWrite()) { currentState.put(symbol, DefinedVariablesAnalysis.VariableDefinition.DEFINED); } DefinedVariablesAnalysis.VariableDefinition varDef = currentState.getOrDefault(symbol, DefinedVariablesAnalysis.VariableDefinition.DEFINED); if (symbolUsage.isRead() && isUndefined(varDef) && !isSymbolUsedInUnreachableBlocks(analysis, unreachableBlocks, symbol) && !isParameter(element) && !ignoredSymbols.contains(symbol)) { ignoredSymbols.add(symbol); Optional<Usage> suspectUsage = symbol.usages().stream().filter(u -> TreeUtils.hasDescendant(element, t -> t.equals(u.tree()))).findFirst(); suspectUsage.ifPresent(s -> { PreciseIssue issue = ctx.addIssue(s.tree(), symbol.name() + " is used before it is defined. Move the definition before."); symbol.usages().stream().filter(u -> !u.equals(s)).forEach(us -> issue.secondary(us.tree(), null)); }); } }); } }

Target:
private static void checkCfgBlock(CfgBlock cfgBlock, SubscriptionContext ctx, DefinedVariables definedVariables, Set<CfgBlock> unreachableBlocks, DefinedVariablesAnalysis analysis, List<Symbol> ignoredSymbols) { Map<Symbol, DefinedVariablesAnalysis.VariableDefinition> currentState = new HashMap<>(definedVariables.getIn()); for (Tree element : cfgBlock.elements()) { definedVariables.getSymbolReadWrites(element).forEach((symbol, symbolReadWrite) -> { if (symbolReadWrite.isWrite()) { currentState.put(symbol, DefinedVariablesAnalysis.VariableDefinition.DEFINED); } DefinedVariablesAnalysis.VariableDefinition varDef = currentState.getOrDefault(symbol, DefinedVariablesAnalysis.VariableDefinition.DEFINED); if (symbolReadWrite.isRead() && isUndefined(varDef) && !isSymbolUsedInUnreachableBlocks(analysis, unreachableBlocks, symbol) && !isParameter(element) && !ignoredSymbols.contains(symbol)) { ignoredSymbols.add(symbol); Usage suspectUsage = symbolReadWrite.usages().get(0); PreciseIssue issue = ctx.addIssue(suspectUsage.tree(), symbol.name() + " is used before it is defined. Move the definition before."); symbol.usages().stream().filter(u -> !u.equals(suspectUsage)).forEach(us -> issue.secondary(us.tree(), null)); } }); } }
Source:
private void moveLog(String feedback) { try { File lFile = new File(NavigationService.LOG_FILE); FileUtils.write(lFile, System.getProperty("line.separator") + "User Feedback - " + feedback, true); Log.d(TAG, "Feedback appended"); File destFolder = new File(Application.get().getApplicationContext().getFilesDir() .getAbsolutePath() + File.separator + LOG_DIRECTORY + File.separator + mAction); Log.d(TAG, "sourceLocation: " + lFile); Log.d(TAG, "targetLocation: " + destFolder); try { FileUtils.moveFileToDirectory( FileUtils.getFile(lFile), FileUtils.getFile(destFolder), true); Log.d(TAG, "Move file successful."); } catch (Exception e) { Log.d(TAG, "File move failed"); } } catch (IOException e) { Log.e(TAG, "File write failed: " + e.toString()); } }

Target:
private void moveLog(String feedback) { try { Log.d(TAG, "Log file: "+ mLogFile); File lFile = new File(mLogFile); FileUtils.write(lFile, System.getProperty("line.separator") + feedback, true); Log.d(TAG, "Feedback appended"); File destFolder = new File(Application.get().getApplicationContext().getFilesDir() .getAbsolutePath() + File.separator + LOG_DIRECTORY + File.separator + mUserResponse); Log.d(TAG, "sourceLocation: " + lFile); Log.d(TAG, "targetLocation: " + destFolder); try { FileUtils.moveFileToDirectory( FileUtils.getFile(lFile), FileUtils.getFile(destFolder), true); Log.d(TAG, "Move file successful."); } catch (Exception e) { Log.d(TAG, "File move failed"); } setupLogUploadTask(); } catch (IOException e) { Log.e(TAG, "File write failed: " + e.toString()); } }
Source:
public SSHClient create() throws Exception { ssh = new net.schmizz.sshj.SSHClient(); ssh.addHostKeyVerifier(new PromiscuousVerifier()); if (connectTimeout != 0) { ssh.setConnectTimeout(connectTimeout); } if (sessionTimeout != 0) { ssh.setTimeout(sessionTimeout); } ssh.connect(hostAndPort.getHostText(), hostAndPort.getPortOrDefault(22)); if (loginCredentials.getPassword() != null) { ssh.authPassword(loginCredentials.getUser(), loginCredentials.getPassword()); } else if (SshjSshClient.hasValidPrivateKey(loginCredentials)){ OpenSSHKeyFile key = new OpenSSHKeyFile(); key.init(loginCredentials.getPrivateKey(), null); ssh.authPublickey(loginCredentials.getUser(), key); } else { AgentProxy proxy= SshjSshClient.getSSHAgentProxy(); if (proxy != null) { ssh.auth(loginCredentials.getUser(), getAuthMethods(proxy)); } } return ssh; }

Target:
public SSHClient create() throws Exception { ssh = new net.schmizz.sshj.SSHClient(); ssh.addHostKeyVerifier(new PromiscuousVerifier()); if (connectTimeout != 0) { ssh.setConnectTimeout(connectTimeout); } if (sessionTimeout != 0) { ssh.setTimeout(sessionTimeout); } ssh.connect(hostAndPort.getHostText(), hostAndPort.getPortOrDefault(22)); if (loginCredentials.getPassword() != null) { ssh.authPassword(loginCredentials.getUser(), loginCredentials.getPassword()); } else if (loginCredentials.hasUnencryptedPrivateKey()) { OpenSSHKeyFile key = new OpenSSHKeyFile(); key.init(loginCredentials.getPrivateKey(), null); ssh.authPublickey(loginCredentials.getUser(), key); } else if (agentConnector.isPresent()) { AgentProxy proxy = new AgentProxy(agentConnector.get()); ssh.auth(loginCredentials.getUser(), getAuthMethods(proxy)); } return ssh; }
Source:
public ConfigurationClientBuilder connectionString(String connectionString) { Objects.requireNonNull(connectionString); try { this.credential = new ConfigurationClientCredentials(connectionString); } catch (InvalidKeyException err) { throw logger.logExceptionAsError(new IllegalArgumentException( "The secret is invalid and cannot instantiate the HMAC-SHA256 algorithm.")); } catch (NoSuchAlgorithmException err) { throw logger.logExceptionAsError( new IllegalArgumentException("HMAC-SHA256 MAC algorithm cannot be instantiated.")); } this.endpoint = credential.getBaseUri(); return this; }

Target:
public ConfigurationClientBuilder connectionString(String connectionString) { Objects.requireNonNull(connectionString); try { this.credential = new ConfigurationClientCredentials(connectionString); } catch (InvalidKeyException err) { throw logger.logExceptionAsError(new IllegalArgumentException( "The secret is invalid and cannot instantiate the HMAC-SHA256 algorithm.", err)); } catch (NoSuchAlgorithmException err) { throw logger.logExceptionAsError( new IllegalArgumentException("HMAC-SHA256 MAC algorithm cannot be instantiated.", err)); } this.endpoint = credential.getBaseUri(); return this; }
Source:
private List<EvaluatorParameters> filterLatestParams(final List<EvaluatorParameters> params) { final Set<String> uniqueIds = params.stream().map(EvaluatorParameters::getId).distinct().collect(Collectors.toSet()); final List<EvaluatorParameters> latestParams = new ArrayList<>(uniqueIds.size()); for (final String id : uniqueIds) { final List<EvaluatorParameters> filteredList = params.stream().filter(param -> param.getId().equals(id)).collect(Collectors.toList()); final EvaluatorParameters latestParam = filteredList.get(filteredList.size() - 1); latestParams.add(latestParam); } return latestParams; }

Target:
private List<EvaluatorParameters> filterLatestParams(final List<EvaluatorParameters> params) { final Map<String, EvaluatorParameters> evalIdToParameters = new HashMap<>(); final ListIterator<EvaluatorParameters> listIterator = params.listIterator(params.size()); while (listIterator.hasPrevious()) { final EvaluatorParameters evalParams = listIterator.previous(); evalIdToParameters.putIfAbsent(evalParams.getId(), evalParams); } return new ArrayList<>(evalIdToParameters.values()); }
Source:
public String getBulkSamples(@RequestBody JSONObject json) throws IOException { JSONArray ids = JSONArray.fromObject(json.get("ids")); StringBuffer stringBuffer = new StringBuffer(); for (int i = 0; i < ids.size(); ++i) { stringBuffer.append(ids.getLong(i)); if (i + 1 < ids.size()) { stringBuffer.append(","); } } return "redirect:/miso/sample/bulk/edit/" + stringBuffer.toString(); }

Target:
public String getBulkSamples(@RequestBody JSONObject json) throws IOException { JSONArray ids = JSONArray.fromObject(json.get("ids")); StringBuffer stringBuffer = new StringBuffer(); for (int i = 0; i < ids.size(); ++i) { if (i > 0) stringBuffer.append(","); stringBuffer.append(ids.getLong(i)); } return "redirect:/miso/sample/bulk/edit/" + stringBuffer.toString(); }
Source:
public Map<String, Integer> getStats() { int in = 0; int out = 0; for (Peer peer : peers.values()) { Map<String, Integer> connStats = peer.getStats(); in += connStats.get("connections.in"); out += connStats.get("connections.out"); } Map<String, Integer> result = new HashMap<>(2); result.put("connections.in", in); result.put("connections.out", out); return result; }

Target:
public Map<String, Integer> getStats() { int in = 0; int out = 0; for (Peer peer : peers.values()) { Map<String, Integer> connStats = peer.getStats(); in += connStats.get("connections.in"); out += connStats.get("connections.out"); } Map<String, Integer> result = new HashMap<>(3); result.put("connections.in", in); result.put("connections.out", out); return result; }
Source:
private void runReplicableCommand(ReplicableCommand command, Reply reply, boolean preserveOrder) { try { invokeReplicableCommand(command, reply, preserveOrder); } catch (Throwable throwable) { if (throwable.getCause() != null && (throwable instanceof CompletionException || throwable instanceof CacheConfigurationException)) { throwable = throwable.getCause(); } if (throwable instanceof InterruptedException || throwable instanceof IllegalLifecycleStateException) { log.shutdownHandlingCommand(command); reply.reply(shuttingDownResponse()); } else { log.exceptionHandlingCommand(command, throwable); reply.reply(exceptionHandlingCommand(throwable)); } } }

Target:
private void runReplicableCommand(ReplicableCommand command, Reply reply, boolean preserveOrder) { try { invokeReplicableCommand(command, reply, preserveOrder); } catch (Throwable throwable) { if (throwable.getCause() != null && throwable instanceof CompletionException) { throwable = throwable.getCause(); } if (throwable instanceof InterruptedException || throwable instanceof IllegalLifecycleStateException) { log.shutdownHandlingCommand(command); reply.reply(shuttingDownResponse()); } else { log.exceptionHandlingCommand(command, throwable); reply.reply(exceptionHandlingCommand(throwable)); } } }
Source:
public DurableTracker(int leeway, String topic, int partition, String consumerGroup) { if (leeway <= 0) { throw new IllegalArgumentException("leeways is zero or negative"); } lag = new long[leeway]; this.topic = topic; this.partition = partition; this.consumerGroup = consumerGroup; }

Target:
public DurableTracker(int leeway, String topic, int partition, String consumerGroup) { if (leeway <= 0) { throw new IllegalArgumentException("leeways is zero or negative"); } committedOffsets = new long[leeway]; this.topic = topic; this.partition = partition; this.consumerGroup = consumerGroup; }
Source:
private void registerAllOvfDisks(List<DiskImage> ovfStoreDiskImages) { for (DiskImage ovfStoreDiskImage : ovfStoreDiskImages) { ovfStoreDiskImage.setDiskAlias(OvfInfoFileConstants.OvfStoreDescriptionLabel); ovfStoreDiskImage.setDiskDescription(OvfInfoFileConstants.OvfStoreDescriptionLabel); ovfStoreDiskImage.setShareable(true); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(ovfStoreDiskImage, getParameters().getStorageDomainId()); boolean registerDiskResult = runInternalAction(VdcActionType.RegisterDisk, registerDiskParams, cloneContext()).getSucceeded(); log.infoFormat("Register new floating OVF_STORE disk with disk id {0} for storage domain {1} has {2}", ovfStoreDiskImage.getId(), getParameters().getStorageDomainId(), registerDiskResult ? "succeeded" : "failed"); if (registerDiskResult) { log.infoFormat("Adding OVF_STORE disk with disk id {0} to storage domain {1}", ovfStoreDiskImage.getId(), getParameters().getStorageDomainId()); addOvfStoreDiskToDomain(ovfStoreDiskImage); } } }

Target:
private void registerAllOvfDisks(List<DiskImage> ovfStoreDiskImages) { for (DiskImage ovfStoreDiskImage : ovfStoreDiskImages) { ovfStoreDiskImage.setDiskAlias(OvfInfoFileConstants.OvfStoreDescriptionLabel); ovfStoreDiskImage.setDiskDescription(OvfInfoFileConstants.OvfStoreDescriptionLabel); ovfStoreDiskImage.setShareable(true); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(ovfStoreDiskImage, getParameters().getStorageDomainId()); boolean registerDiskResult = runInternalAction(VdcActionType.RegisterDisk, registerDiskParams, cloneContext()).getSucceeded(); log.info("Register new floating OVF_STORE disk with disk id '{}' for storage domain '{}' has {}", ovfStoreDiskImage.getId(), getParameters().getStorageDomainId(), registerDiskResult ? "succeeded" : "failed"); if (registerDiskResult) { addOvfStoreDiskToDomain(ovfStoreDiskImage); } } }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } RealmConfiguration that = (RealmConfiguration) obj; if (schemaVersion != that.schemaVersion) { return false; } if (deleteRealmIfMigrationNeeded != that.deleteRealmIfMigrationNeeded) { return false; } if (!realmDirectory.equals(that.realmDirectory)) { return false; } if (!realmFileName.equals(that.realmFileName)) { return false; } if (!canonicalPath.equals(that.canonicalPath)) { return false; } if (!Arrays.equals(key, that.key)) { return false; } if (!durability.equals(that.durability)) { return false; } if (migration != null ? !migration.equals(that.migration) : that.migration != null) { return false; } if (rxObservableFactory != null ? !rxObservableFactory.equals(that.rxObservableFactory) : that.rxObservableFactory != null) { return false; } if (initialDataTransaction != null ? !initialDataTransaction.equals(that.initialDataTransaction) : that.initialDataTransaction != null) { return false; } return schemaMediator.equals(that.schemaMediator); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } RealmConfiguration that = (RealmConfiguration) obj; if (schemaVersion != that.schemaVersion) { return false; } if (deleteRealmIfMigrationNeeded != that.deleteRealmIfMigrationNeeded) { return false; } if (!realmDirectory.equals(that.realmDirectory)) { return false; } if (!realmFileName.equals(that.realmFileName)) { return false; } if (!canonicalPath.equals(that.canonicalPath)) { return false; } if (!Arrays.equals(key, that.key)) { return false; } if (!durability.equals(that.durability)) { return false; } if (migration != null ? !migration.equals(that.migration) : that.migration != null) { return false; } if (rxObservableFactory != null ? !rxObservableFactory.equals(that.rxObservableFactory) : that.rxObservableFactory != null) { return false; } if (initialDataTransaction != null ? !initialDataTransaction.equals(that.initialDataTransaction) : that.initialDataTransaction != null) { return false; } if (readOnly != that.readOnly) { return false; } return schemaMediator.equals(that.schemaMediator); }