auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testToMap() { Map<?, ?> map = ArrayUtils.toMap(new String[][]{{"foo", "bar"}, {"hello", "world"}}); assertEquals("bar", map.get("foo")); assertEquals("world", map.get("hello")); assertNull(ArrayUtils.toMap(null)); assertThrows(IllegalArgumentException.class, () -> ArrayUtils.toMap(new String[][]{{"foo", "bar"}, {"short"}})); assertThrows(IllegalArgumentException.class, () -> ArrayUtils.toMap(new Object[]{new Object[]{"foo", "bar"}, "illegal type"})); assertThrows(IllegalArgumentException.class, () -> ArrayUtils.toMap(new Object[]{new Object[]{"foo", "bar"}, null})); map = ArrayUtils.toMap(new Object[]{new Map.Entry<Object, Object>() { @Override public Object getKey() { return "foo"; } @Override public Object getValue() { return "bar"; } @Override public Object setValue(final Object value) { throw new UnsupportedOperationException(); } @Override public boolean equals(final Object o) { throw new UnsupportedOperationException(); } @Override public int hashCode() { throw new UnsupportedOperationException(); } }}); assertEquals("bar", map.get("foo")); assertEquals(Collections.emptyMap(), ArrayUtils.toMap(new Object[0])); map = ArrayUtils.toMap(new Object[][] { {null, null}, {null, null} }); assertEquals(new HashMap<Object, Object>() { private static final long serialVersionUID = 1L; { put(null, null); } }, map); map = ArrayUtils.toMap(new Object[][] { {"key", "value2"}, {"key", "value1"} }); assertEquals(new HashMap<Object, Object>() { private static final long serialVersionUID = 1L; { put("key", "value1"); } }, map); }

Target:
public void testToMap() { Map<?, ?> map = ArrayUtils.toMap(new String[][]{{"foo", "bar"}, {"hello", "world"}}); assertEquals("bar", map.get("foo")); assertEquals("world", map.get("hello")); assertNull(ArrayUtils.toMap(null)); assertThrows(IllegalArgumentException.class, () -> ArrayUtils.toMap(new String[][]{{"foo", "bar"}, {"short"}})); assertThrows(IllegalArgumentException.class, () -> ArrayUtils.toMap(new Object[]{new Object[]{"foo", "bar"}, "illegal type"})); assertThrows(IllegalArgumentException.class, () -> ArrayUtils.toMap(new Object[]{new Object[]{"foo", "bar"}, null})); map = ArrayUtils.toMap(new Object[]{new Map.Entry<Object, Object>() { @Override public Object getKey() { return "foo"; } @Override public Object getValue() { return "bar"; } @Override public Object setValue(final Object value) { throw new UnsupportedOperationException(); } @Override public boolean equals(final Object o) { throw new UnsupportedOperationException(); } @Override public int hashCode() { throw new UnsupportedOperationException(); } }}); assertEquals("bar", map.get("foo")); assertEquals(Collections.emptyMap(), ArrayUtils.toMap(new Object[0])); map = ArrayUtils.toMap(new Object[][] { {null, null}, {null, null} }); assertEquals(Collections.singletonMap(null, null), map); map = ArrayUtils.toMap(new Object[][] { {"key", "value2"}, {"key", "value1"} }); assertEquals(Collections.singletonMap("key", "value1"), map); }
Source:
public HierarchicalBrowseResultResponse getExpandedStructurePath(HierarchicalBrowseRequest browseRequest) { HierarchicalBrowseResultResponse browseResponse = new HierarchicalBrowseResultResponse(); AccessGroupSet principals = browseRequest.getAccessGroups(); BriefObjectMetadata contentRootMd = getContentRootMetadata(principals); browseResponse.getResultList().add(contentRootMd); CutoffFacet path = getObjectPath(browseRequest.getRootPid(), principals); if (path.getFacetNodes() == null) { return browseResponse; } CutoffFacet stepPath = new CutoffFacet(ANCESTOR_PATH.name(), asList(), 0); for (HierarchicalFacetNode stepFacetNode : path.getFacetNodes()) { stepPath.addNode(stepFacetNode); SearchState stepState = new SearchState(browseRequest.getSearchState()); HierarchicalBrowseRequest stepRequest = new HierarchicalBrowseRequest(stepState, 1, principals); HierarchicalBrowseResultResponse tierResponse = retrieveTier(stepRequest, stepPath); browseResponse.populateItemResults(tierResponse.getResultList()); } assignCounts(browseRequest.getSearchState(), principals, browseResponse.getResultList()); filterToDirectMatches(browseRequest, browseResponse); browseResponse.generateResultTree(); retrieveFacets(browseRequest, browseResponse); return browseResponse; }

Target:
public HierarchicalBrowseResultResponse getExpandedStructurePath(HierarchicalBrowseRequest browseRequest) { HierarchicalBrowseResultResponse browseResponse = new HierarchicalBrowseResultResponse(); AccessGroupSet principals = browseRequest.getAccessGroups(); BriefObjectMetadata contentRootMd = getContentRootMetadata(principals); browseResponse.getResultList().add(contentRootMd); CutoffFacet path = getObjectPath(browseRequest.getRootPid(), principals); List<HierarchicalFacetNode> pathFacetNodes = path.getFacetNodes(); if (pathFacetNodes == null) { return browseResponse; } CutoffFacet stepPath = new CutoffFacet(ANCESTOR_PATH.name(), asList(), 0); for (HierarchicalFacetNode stepFacetNode : pathFacetNodes) { stepPath.addNode(stepFacetNode); SearchState stepState = new SearchState(browseRequest.getSearchState()); HierarchicalBrowseRequest stepRequest = new HierarchicalBrowseRequest(stepState, 1, principals); HierarchicalBrowseResultResponse tierResponse = retrieveTier(stepRequest, stepPath); browseResponse.populateItemResults(tierResponse.getResultList()); } assignCounts(browseRequest.getSearchState(), principals, browseResponse.getResultList()); filterToDirectMatches(browseRequest, browseResponse); browseResponse.generateResultTree(); retrieveFacets(browseRequest, browseResponse); return browseResponse; }
Source:
void cleanup () { for (Entry<String, CacheFileCopy> entry : this.filesTable.entrySet()) { String tempFilePathname = RAImageIngestModule.getRATempPath(currentCase, moduleName) + File.separator + entry.getKey(); try { entry.getValue().getFileCopy().getChannel().close(); entry.getValue().getFileCopy().close(); File tmpFile = new File(tempFilePathname); if (!tmpFile.delete()) { tmpFile.deleteOnExit(); } } catch (IOException ex) { logger.log(Level.WARNING, String.format("Failed to delete cache file copy %s", tempFilePathname), ex); } } }

Target:
void cleanup () { for (Entry<String, CacheFileCopy> entry : this.filesTable.entrySet()) { Path tempFilePath = Paths.get(RAImageIngestModule.getRATempPath(currentCase, moduleName), entry.getKey() ); try { entry.getValue().getFileCopy().getChannel().close(); entry.getValue().getFileCopy().close(); File tmpFile = tempFilePath.toFile(); if (!tmpFile.delete()) { tmpFile.deleteOnExit(); } } catch (IOException ex) { logger.log(Level.WARNING, String.format("Failed to delete cache file copy %s", tempFilePath.toString()), ex); } } }
Source:
final static public < A extends LongAccess > ArrayImg< UnsignedVariableBitLengthType, A > unsignedVariableBitLengths( final A access, final int nbits, final long... dim ) { final ArrayImg< UnsignedVariableBitLengthType, A > img = new ArrayImg<>( access, dim, new Fraction( 1, 64 ) ); final UnsignedVariableBitLengthType t = new UnsignedVariableBitLengthType( img, nbits ); img.setLinkedType( t ); return img; }

Target:
final static public < A extends LongAccess > ArrayImg< UnsignedVariableBitLengthType, A > unsignedVariableBitLengths( final A access, final int nbits, final long... dim ) { final ArrayImg< UnsignedVariableBitLengthType, A > img = new ArrayImg<>( access, dim, new Fraction( nbits, 64 ) ); final UnsignedVariableBitLengthType t = new UnsignedVariableBitLengthType( img, nbits ); img.setLinkedType( t ); return img; }
Source:
private long measureMachinePerformance() { Random r = new Random(); final int NUMBER_ITERATIONS = 20000; double counter = 0.0; long start = System.currentTimeMillis(); for (int i = 0; i < NUMBER_ITERATIONS; i++) { counter += r.nextDouble(); } if (counter < 0) logger.info("this should never happen."); return System.currentTimeMillis() - start; }

Target:
private long measureMachinePerformance() { Random r = new Random(); final int NUMBER_ITERATIONS = 20000; double counter = 0.0; long start = System.currentTimeMillis(); for (int i = 0; i < NUMBER_ITERATIONS; i++) { counter += r.nextDouble(); } if (counter < 0) System.err.println("this should never happen."); return System.currentTimeMillis() - start; }
Source:
public Path generateArtifact(URI uri, int size) throws IOException { PypiWheelArtifactCoordinates coordinates = PypiWheelArtifactCoordinates.parse(FilenameUtils.getName(uri.getPath())); return generateArtifact(coordinates); }

Target:
public Path generateArtifact(URI uri, int size) throws IOException { PypiWheelArtifactCoordinates coordinates = PypiWheelArtifactCoordinates.parse(FilenameUtils.getName(uri.toString())); return generateArtifact(coordinates); }
Source:
public String addOrUpdateEntity(Referenceable referenceable, String uniqueAttrId) throws AtlasException { log.debug("Updating new entity [{}]", referenceable); Object attrValue = referenceable.getValuesMap().get(uniqueAttrId); Collection<Referenceable> entities = getEntities(referenceable.getTypeName(), Collections.singletonMap(uniqueAttrId, attrValue)); if (entities.isEmpty()) { Referenceable newEntity = new Referenceable(referenceable.getTypeName(), referenceable.getValuesMap()); return createEntity(newEntity); } Referenceable entity = entities.iterator().next(); entity.getValuesMap().clear(); entity.getValuesMap().putAll(referenceable.getValuesMap()); String entityJSON = InstanceSerialization.toJson(entity, true); AtlasClient.EntityResult entityResult = _updateEntities(entityJSON); log.debug("Updated instance for type [{}]", referenceable.getTypeName() + ", guids: " + entityResult.getUpdateEntities()); List<String> result = null; List<String> createdEntities = entityResult.getCreatedEntities(); if(createdEntities != null && !createdEntities.isEmpty()) { result = createdEntities; } else { result = entityResult.getUpdateEntities(); } return result!= null && !result.isEmpty() ? result.get(0) : null; }

Target:
public String addOrUpdateEntity(Referenceable referenceable, String uniqueAttrId) throws AtlasException { LOG.debug("Updating new entity [{}]", referenceable); Object attrValue = referenceable.getValuesMap().get(uniqueAttrId); Collection<Referenceable> entities = getEntities(referenceable.getTypeName(), Collections.singletonMap(uniqueAttrId, attrValue)); String result = null; if (entities.isEmpty()) { Referenceable newEntity = new Referenceable(referenceable.getTypeName(), referenceable.getValuesMap()); result = createEntity(newEntity); } else { Referenceable entity = entities.iterator().next(); entity.getValuesMap().clear(); entity.getValuesMap().putAll(referenceable.getValuesMap()); String entityJSON = InstanceSerialization.toJson(entity, true); AtlasClient.EntityResult entityResult = _updateEntities(entityJSON); LOG.debug("Updated instance for type [{}]", referenceable.getTypeName() + ", guids: " + entityResult.getUpdateEntities()); List<String> entityIds = null; List<String> createdEntities = entityResult.getCreatedEntities(); if (createdEntities != null && !createdEntities.isEmpty()) { entityIds = createdEntities; } else { entityIds = entityResult.getUpdateEntities(); } if (entityIds != null && !entityIds.isEmpty()) { result = entityIds.get(0); } } return result; }
Source:
public void refreshGlusterServices() { if (getServiceNameMap().isEmpty()) { populateServiceMap(); } List<VDSGroup> clusters = getClusterDao().getAll(); for (VDSGroup cluster : clusters) { if (supportsGlusterServicesFeature(cluster)) { try { List<VDS> upServers = getClusterUtils().getAllUpServers(cluster.getId()); List<VDS> servers = getClusterUtils().getAllServers(cluster.getId()); List<Callable<Map<String, GlusterServiceStatus>>> taskListForNonRunningServers = createTaskListForNonRunningServers(servers); if (taskListForNonRunningServers != null && taskListForNonRunningServers.size() > 0) { ThreadPoolUtil.invokeAll(taskListForNonRunningServers); } log.debugFormat("Syncing gluster related services for cluster {0}", cluster.getname()); List<Callable<Map<String, GlusterServiceStatus>>> taskList = createTaskList(upServers); if (taskList != null && taskList.size() > 0) { refreshClusterServices(cluster, ThreadPoolUtil.invokeAll(createTaskList(upServers))); } } catch (Exception e) { log.errorFormat("Error while refreshing service statuses of cluster {0}!", cluster.getname(), e); } } } }

Target:
public void refreshGlusterServices() { if (getServiceNameMap().isEmpty()) { populateServiceMap(); } List<VDSGroup> clusters = getClusterDao().getAll(); for (VDSGroup cluster : clusters) { if (supportsGlusterServicesFeature(cluster)) { try { List<VDS> serversList = getClusterUtils().getAllServers(cluster.getId()); List<Callable<Map<String, GlusterServiceStatus>>> taskList = createTaskList(serversList); if (taskList != null && taskList.size() > 0) { refreshClusterServices(cluster, ThreadPoolUtil.invokeAll(taskList)); } } catch (Exception e) { log.errorFormat("Error while refreshing service statuses of cluster {0}!", cluster.getname(), e); } } } }
Source:
public GitService call() throws Exception { configProperties = configManager.getDefaultProperties(); branch = configProperties.getProperty("com.meltmedia.cadmium.branch"); repoUri = configProperties.getProperty("com.meltmedia.cadmium.git.uri"); GitService cloned = null; if(repoUri != null && branch != null) { Throwable t = null; try { logger.debug("Attempting to initialize content for `{}` into `{}`", warName, contentRoot); cloned = GitService.initializeContentDirectory(repoUri, branch, contentRoot, warName, historyManager, configManager); if(metaProcessor != null) { logger.debug("Processing META-INF dir in `{}`", warName); this.metaProcessor.processDir(contentDirectory); } if(servlet != null) { logger.debug("Switching content root of {}", warName); this.servlet.switchContent(System.currentTimeMillis()); } logger.debug("Successfully initialized `{}`", warName); } catch(RefNotFoundException e) { logger.warn("Branch `"+branch+"` does not exist.", e); return null; } catch(Throwable t1) { logger.error("Failed to initialize git repo `"+warName+"`", t); t = t1; } if(t != null) { throw new Exception(t); } } return cloned; }

Target:
public GitService call() throws Exception { Properties configProperties = configManager.getDefaultProperties(); String branch = configProperties.getProperty("com.meltmedia.cadmium.branch"); String repoUri = configProperties.getProperty("com.meltmedia.cadmium.git.uri"); GitService cloned = null; if(repoUri != null && branch != null) { Throwable t = null; try { logger.debug("Attempting to initialize content for `{}` into `{}`", warName, contentRoot); cloned = GitService.initializeContentDirectory(repoUri, branch, contentRoot, warName, historyManager, configManager); if(metaProcessor != null) { logger.debug("Processing META-INF dir in `{}`", warName); this.metaProcessor.processDir(contentDirectory); } if(servlet != null) { logger.debug("Switching content root of {}", warName); this.servlet.switchContent(System.currentTimeMillis()); } logger.debug("Successfully initialized `{}`", warName); } catch(RefNotFoundException e) { logger.warn("Branch `"+branch+"` does not exist.", e); return null; } catch(Throwable t1) { logger.error("Failed to initialize git repo `"+warName+"`", t); t = t1; } if(t != null) { throw new Exception(t); } } return cloned; }
Source:
protected void createCacheManagers() throws Throwable { Configuration replSync = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC); Configuration replAsync = getDefaultClusteredConfig(Configuration.CacheMode.REPL_ASYNC); Configuration invalSync = getDefaultClusteredConfig(Configuration.CacheMode.INVALIDATION_SYNC); Configuration invalAsync = getDefaultClusteredConfig(Configuration.CacheMode.INVALIDATION_ASYNC); Configuration local = getDefaultClusteredConfig(Configuration.CacheMode.LOCAL); createClusteredCaches(2, "replSync", replSync); defineConfigurationOnAllManagers("replAsync", replAsync); waitForClusterToForm("replAsync"); defineConfigurationOnAllManagers("invalSync", invalSync); waitForClusterToForm("invalSync"); defineConfigurationOnAllManagers("invalAsync", invalAsync); waitForClusterToForm("invalAsync"); defineConfigurationOnAllManagers("local", local); waitForClusterToForm("local"); }

Target:
protected void createCacheManagers() throws Throwable { Configuration replSync = getDefaultClusteredConfig(Configuration.CacheMode.REPL_SYNC); Configuration replAsync = getDefaultClusteredConfig(Configuration.CacheMode.REPL_ASYNC); Configuration invalSync = getDefaultClusteredConfig(Configuration.CacheMode.INVALIDATION_SYNC); Configuration invalAsync = getDefaultClusteredConfig(Configuration.CacheMode.INVALIDATION_ASYNC); Configuration local = getDefaultClusteredConfig(Configuration.CacheMode.LOCAL); createClusteredCaches(2, "replSync", replSync); defineConfigurationOnAllManagers("replAsync", replAsync); waitForClusterToForm("replAsync"); defineConfigurationOnAllManagers("invalSync", invalSync); waitForClusterToForm("invalSync"); defineConfigurationOnAllManagers("invalAsync", invalAsync); waitForClusterToForm("invalAsync"); defineConfigurationOnAllManagers("local", local); }
Source:
public void editMaxRequests() throws Exception { int value = 42; ModelNodeResult originalValue = operations.readAttribute(REQUEST_CONTROLLER_SUBSYSTEM_ADDRESS, MAX_REQUESTS, ReadAttributeOption.INCLUDE_DEFAULTS); originalValue.assertSuccess(); try { new ConfigChecker.Builder(client, REQUEST_CONTROLLER_SUBSYSTEM_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, MAX_REQUESTS, String.valueOf(value)) .verifyFormSaved() .verifyAttribute(MAX_REQUESTS, value); } finally { operations.writeAttribute(REQUEST_CONTROLLER_SUBSYSTEM_ADDRESS, MAX_REQUESTS, originalValue.value()) .assertSuccess(); } }

Target:
public void editMaxRequests() throws Exception { int value = 42; ModelNodeResult originalValue = operations.readAttribute(REQUEST_CONTROLLER_SUBSYSTEM_ADDRESS, MAX_REQUESTS, ReadAttributeOption.NOT_INCLUDE_DEFAULTS); originalValue.assertSuccess(); try { new ConfigChecker.Builder(client, REQUEST_CONTROLLER_SUBSYSTEM_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, MAX_REQUESTS, String.valueOf(value)) .verifyFormSaved() .verifyAttribute(MAX_REQUESTS, value); } finally { operations.writeAttribute(REQUEST_CONTROLLER_SUBSYSTEM_ADDRESS, MAX_REQUESTS, originalValue.value()) .assertSuccess(); } }
Source:
protected boolean checkIfLunDiskCanBeAdded() { LUNs lun = ((LunDisk) getParameters().getDiskInfo()).getLun(); switch (lun.getLunType()) { case UNKNOWN: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE); case ISCSI: if (lun.getLunConnections() == null || lun.getLunConnections().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } for (StorageServerConnections conn : lun.getLunConnections()) { if (StringUtils.isEmpty(conn.getiqn()) || StringUtils.isEmpty(conn.getconnection()) || StringUtils.isEmpty(conn.getport())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } } break; } if (getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_IS_ALREADY_IN_USE); } if (getVm() != null && !(isVmNotInPreviewSnapshot() && isVmNotLocked())) { return false; } return true; }

Target:
protected boolean checkIfLunDiskCanBeAdded() { LUNs lun = ((LunDisk) getParameters().getDiskInfo()).getLun(); switch (lun.getLunType()) { case UNKNOWN: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE); case ISCSI: if (lun.getLunConnections() == null || lun.getLunConnections().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } for (StorageServerConnections conn : lun.getLunConnections()) { if (StringUtils.isEmpty(conn.getiqn()) || StringUtils.isEmpty(conn.getconnection()) || StringUtils.isEmpty(conn.getport())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } } break; } if (getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_IS_ALREADY_IN_USE); } if (getVm() != null && !(isVmNotLocked() && isVmNotInPreviewSnapshot())) { return false; } return true; }
Source:
public final List<BrandingTheme> getBrandingThemes() { if (themes == null) { if (brandingRootPath.exists() && brandingRootPath.isDirectory() && brandingRootPath.canRead()) { themes = new ArrayList<BrandingTheme>(); List<File> directories = Arrays.asList( brandingRootPath.listFiles(new DirectoryFilter())); for (File directory : directories) { BrandingTheme theme = new BrandingTheme( directory.getAbsolutePath(), brandingRootPath); if (theme.isAvailable()) { themes.add(theme); } } Collections.sort(themes, new BrandingComparator()); } } return themes; }

Target:
public List<BrandingTheme> getBrandingThemes() { if (themes == null && brandingRootPath.exists() && brandingRootPath.isDirectory() && brandingRootPath.canRead()) { themes = new ArrayList<BrandingTheme>(); List<File> directories = Arrays.asList( brandingRootPath.listFiles(new FileFilter() { @Override public boolean accept(final File file) { return file.isDirectory(); } })); for (File directory : directories) { BrandingTheme theme = new BrandingTheme( directory.getAbsolutePath(), brandingRootPath); if (theme.isAvailable()) { themes.add(theme); } } Collections.sort(themes); Collections.reverse(themes); } return themes; }
Source:
public static void main(String[] args) throws Exception { Connection connection = connection() .url("https://engine/ovirt-engine/api") .user("admin@internal") .password("redhat123") .trustStoreFile("truststore.jks") .build(); StorageDomainsService storageDomainsService = connection.systemService().storageDomainsService(); StorageDomain sd = storageDomainsService.list().search("name=mysd").send().storageDomains().get(0); StorageDomainService storageDomainService = storageDomainsService.storageDomainService(sd.id()); StorageDomainVmsService storageDomainVmsService = storageDomainService.vmsService(); List<Vm> unregisteredVms = storageDomainVmsService.list().unregistered(true).send().vm(); Vm vm = null; for (Vm x : unregisteredVms) { if ("myvm".equals(x.name())) { vm = x; break; } } StorageDomainVmService storageDomainVmService = storageDomainVmsService.vmService(vm.id()); storageDomainVmService.register() .vm( vm() .name("exported_myvm") ) .cluster( cluster() .name("mycluster") ) .vnicProfileMappings( vnicProfileMapping() .sourceNetworkName("mynetwork") .sourceNetworkProfileName("mynetwork") .targetVnicProfile( vnicProfile() .name("mynetwork") ) ) .reassignBadMacs(Boolean.TRUE) .send(); connection.close(); }

Target:
public static void main(String[] args) throws Exception { Connection connection = connection() .url("https://engine/ovirt-engine/api") .user("admin@internal") .password("redhat123") .trustStoreFile("truststore.jks") .build(); StorageDomainsService storageDomainsService = connection.systemService().storageDomainsService(); StorageDomain sd = storageDomainsService.list().search("name=mysd").send().storageDomains().get(0); StorageDomainService storageDomainService = storageDomainsService.storageDomainService(sd.id()); StorageDomainVmsService storageDomainVmsService = storageDomainService.vmsService(); List<Vm> unregisteredVms = storageDomainVmsService.list().unregistered(true).send().vm(); Vm vm = null; for (Vm x : unregisteredVms) { if ("myvm".equals(x.name())) { vm = x; break; } } StorageDomainVmService storageDomainVmService = storageDomainVmsService.vmService(vm.id()); storageDomainVmService.register() .vm( vm() .name("exported_myvm") ) .cluster( cluster() .name("mycluster") ) .vnicProfileMappings( vnicProfileMapping() .sourceNetworkName("mynetwork") .sourceNetworkProfileName("mynetwork") .targetVnicProfile( vnicProfile() .name("mynetwork") ) ) .reassignBadMacs(true) .send(); connection.close(); }
Source:
public void adjust(Mechanism mechanism) { CoreUtilities.autoPropertyMechanism(this, mechanism); if (!mechanism.fulfilled()) { mechanism.reportInvalid(); } }

Target:
public void adjust(Mechanism mechanism) { CoreUtilities.autoPropertyMechanism(this, mechanism); }
Source:
public void dump(PrintWriter pw) { try { pw.println("Root: " + root); pw.println("Original rel:"); if (originalRoot != null) { originalRoot.explain( new RelWriterImpl(pw, SqlExplainLevel.ALL_ATTRIBUTES, false)); } if (CalciteSystemProperty.DUMP_SETS.value()) { pw.println(); pw.println("Sets:"); dumpSets(pw); } if (CalciteSystemProperty.DUMP_GRAPHVIZ.value()) { pw.println(); pw.println("Graphviz:"); dumpGraphviz(pw); } } catch (Exception ex) { throw new AssertionError("Dumps the internal state ", ex); } }

Target:
public void dump(PrintWriter pw) { pw.println("Root: " + root); pw.println("Original rel:"); if (originalRoot != null) { originalRoot.explain( new RelWriterImpl(pw, SqlExplainLevel.ALL_ATTRIBUTES, false)); } try { if (CalciteSystemProperty.DUMP_SETS.value()) { pw.println(); pw.println("Sets:"); dumpSets(pw); } if (CalciteSystemProperty.DUMP_GRAPHVIZ.value()) { pw.println(); pw.println("Graphviz:"); dumpGraphviz(pw); } } catch (Exception | AssertionError e) { pw.println("Error when dumping plan state: \n" + e); } }
Source:
private void commit(boolean pushUpstream) { if (!isCommitWithoutFilesAllowed()) { MessageDialog.openError(getSite().getShell(), UIText.StagingView_committingNotPossible, UIText.StagingView_noStagedFiles); return; } if (!commitMessageComponent.checkCommitInfo()) return; if (!UIUtils.saveAllEditors(currentRepository, UIText.StagingView_cancelCommitAfterSaving)) return; String commitMessage = commitMessageComponent.getCommitMessage(); CommitOperation commitOperation = null; try { commitOperation = new CommitOperation(currentRepository, commitMessageComponent.getAuthor(), commitMessageComponent.getCommitter(), commitMessage); } catch (CoreException e) { Activator.handleError(UIText.StagingView_commitFailed, e, true); return; } if (amendPreviousCommitAction.isChecked()) commitOperation.setAmending(true); commitOperation.setComputeChangeId(addChangeIdAction.isChecked()); final CommitJob commitJob = new CommitJob(currentRepository, commitOperation) .setOpenCommitEditor(openNewCommitsAction.isChecked()) .setPushUpstream(pushUpstream); enableAllWidgets(false); commitJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { asyncExec(new Runnable() { public void run() { enableAllWidgets(true); if (commitJob.isCommitSucceeded()) { commitMessageText.setText(EMPTY_STRING); } } }); } }); schedule(commitJob, true); CommitMessageHistory.saveCommitHistory(commitMessage); clearCommitMessageToggles(); }

Target:
private void commit(boolean pushUpstream) { if (!isCommitWithoutFilesAllowed()) { MessageDialog.openError(getSite().getShell(), UIText.StagingView_committingNotPossible, UIText.StagingView_noStagedFiles); return; } if (!commitMessageComponent.checkCommitInfo()) return; if (!UIUtils.saveAllEditors(currentRepository, UIText.StagingView_cancelCommitAfterSaving)) return; String commitMessage = commitMessageComponent.getCommitMessage(); CommitOperation commitOperation = null; try { commitOperation = new CommitOperation(currentRepository, commitMessageComponent.getAuthor(), commitMessageComponent.getCommitter(), commitMessage); } catch (CoreException e) { Activator.handleError(UIText.StagingView_commitFailed, e, true); return; } if (amendPreviousCommitAction.isChecked()) commitOperation.setAmending(true); commitOperation.setComputeChangeId(addChangeIdAction.isChecked()); final CommitJob commitJob = new CommitJob(currentRepository, commitOperation) .setOpenCommitEditor(openNewCommitsAction.isChecked()) .setPushUpstream(pushUpstream); enableAllWidgets(false); commitJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { asyncExec(new Runnable() { public void run() { enableAllWidgets(true); if (commitJob.getResult().isOK()) { commitMessageText.setText(EMPTY_STRING); } } }); } }); schedule(commitJob, true); CommitMessageHistory.saveCommitHistory(commitMessage); clearCommitMessageToggles(); }
Source:
public void onAuthEmailSent(AccountStore.OnAuthEmailSent event) { if (!mInProgress) { return; } endProgress(); if (event.isError()) { AppLog.e(AppLog.T.API, "OnAuthEmailSent has error: " + event.error.type + " - " + event.error.message); if (isAdded()) { ToastUtils.showToast(getActivity(), R.string.magic_link_unavailable_error_message, ToastUtils.Duration.LONG); } } else { if (mLoginListener != null) { mLoginListener.showMagicLinkSentScreen(mEmail); } } }

Target:
public void onAuthEmailSent(AccountStore.OnAuthEmailSent event) { if (!mInProgress) { return; } endProgress(); if (event.isError()) { AppLog.e(AppLog.T.API, "OnAuthEmailSent has error: " + event.error.type + " - " + event.error.message); if (isAdded()) { ToastUtils.showToast(getActivity(), R.string.magic_link_unavailable_error_message, ToastUtils .Duration.LONG); } return; } if (mLoginListener != null) { mLoginListener.showMagicLinkSentScreen(mEmail); } }
Source:
protected CassandraServersConfigs() { }

Target:
private CassandraServersConfigs() { }
Source:
private Attributes getAttributes(ConfigSection cfg, String revision) { return AttributesBuilder.attributes() .tableOfContents(cfg.getBoolean(KEY_INCLUDE_TOC, true)) .sourceHighlighter("prettify") .attribute("newline", "\\n") .attribute("asterisk", "&#42;") .attribute("plus", "&#43;") .attribute("caret", "&#94;") .attribute("startsb", "&#91;") .attribute("endsb", "&#93;") .attribute("tilde", "&#126;") .attribute("last-update-label!") .attribute("revnumber", revision) .get(); }

Target:
private Attributes getAttributes(ConfigSection cfg, String revision) { AttributesBuilder ab = AttributesBuilder.attributes() .tableOfContents(cfg.getBoolean(KEY_INCLUDE_TOC, true)) .sourceHighlighter("prettify"); for (String name : attributes.stringPropertyNames()) { ab.attribute(name, attributes.getProperty(name)); } ab.attribute("last-update-label!"); ab.attribute("revnumber", revision); return ab.get(); }
Source:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { setProperlyConfigured(false); if (config != null) { String refreshIntervalString = (String) config.get("refresh"); if (StringUtils.isNotBlank(refreshIntervalString)) { refreshInterval = Long.parseLong(refreshIntervalString); } housecode = parseMandatoryValue(KEY_HOUSECODE, config); doTimeUpdate = Boolean.parseBoolean((String) config.get(KEY_UPDATE_TIME)); if (doTimeUpdate) { timeUpdatecronExpression = (String) config.get(KEY_UPDATE_CRON); if (StringUtils.isEmpty(timeUpdatecronExpression)) { setProperlyConfigured(false); logger.debug("Time update was configured but no cron expression"); throw new ConfigurationException(KEY_UPDATE_CRON, "Time update was configured but no cron expression"); } updateTimeJobKey = scheduleJob(UpdateFHTTimeJob.class, timeUpdatecronExpression); } else { unscheduleJob(updateTimeJobKey); } requestReports = Boolean.parseBoolean((String) config.get(KEY_REPORTS)); if (requestReports) { reportsCronExpression = (String) config.get(KEY_REPORTS_CRON); if (StringUtils.isEmpty(reportsCronExpression)) { setProperlyConfigured(false); throw new ConfigurationException(KEY_REPORTS_CRON, "Reports are requested, bu no cron expression is supplied"); } requestReportJobKey = scheduleJob(RequestReportsJob.class, reportsCronExpression); } else { unscheduleJob(requestReportJobKey); } culHandlerLifecycle.config(config); setProperlyConfigured(true); } }

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { boolean properlyConfigured = false; if (config != null) { String refreshIntervalString = (String) config.get("refresh"); if (StringUtils.isNotBlank(refreshIntervalString)) { refreshInterval = Long.parseLong(refreshIntervalString); } housecode = parseMandatoryValue(KEY_HOUSECODE, config); doTimeUpdate = Boolean.parseBoolean((String) config.get(KEY_UPDATE_TIME)); if (doTimeUpdate) { timeUpdatecronExpression = (String) config.get(KEY_UPDATE_CRON); if (StringUtils.isEmpty(timeUpdatecronExpression)) { setProperlyConfigured(false); logger.debug("Time update was configured but no cron expression"); throw new ConfigurationException(KEY_UPDATE_CRON, "Time update was configured but no cron expression"); } updateTimeJobKey = scheduleJob(UpdateFHTTimeJob.class, timeUpdatecronExpression); } else { unscheduleJob(updateTimeJobKey); } requestReports = Boolean.parseBoolean((String) config.get(KEY_REPORTS)); if (requestReports) { reportsCronExpression = (String) config.get(KEY_REPORTS_CRON); if (StringUtils.isEmpty(reportsCronExpression)) { setProperlyConfigured(false); throw new ConfigurationException(KEY_REPORTS_CRON, "Reports are requested, bu no cron expression is supplied"); } requestReportJobKey = scheduleJob(RequestReportsJob.class, reportsCronExpression); } else { unscheduleJob(requestReportJobKey); } culHandlerLifecycle.config(config); properlyConfigured = true; } setProperlyConfigured(properlyConfigured); }
Source:
public RoutingTableSnapshot(@JsonProperty("tableName") String tableName, @JsonProperty("routingTableEntries") List<Map<String, List<String>>> routingTableEntries) { this.tableName = tableName; this.routingTableEntries = routingTableEntries; }

Target:
public RoutingTableSnapshot( @JsonProperty("tableName") String tableName, @JsonProperty("routingTableEntries") List<Map<String, List<String>>> routingTableEntries) { this.tableName = requireNonNull(tableName, "table name is null"); this.routingTableEntries = requireNonNull(routingTableEntries, "routing table entries is null"); }
Source:
public void setup() throws IOException, GeneralSecurityException { Map<String, String> config = new HashMap<>(); config.put("ENGINE_PKI_TRUST_STORE_TYPE", "JKS"); URL systemResource = ClassLoader.getSystemResource("key.p12"); Path tmpkey = Files.createTempFile("benchmarktmp", "", asFileAttribute(fromString("rw-------"))); Files.copy(systemResource.openStream(), tmpkey, StandardCopyOption.REPLACE_EXISTING); config.put("ENGINE_PKI_TRUST_STORE", tmpkey.toString()); config.put("ENGINE_PKI_TRUST_STORE_PASSWORD", "NoSoup4U"); config.put("ENGINE_PKI_ENGINE_STORE_TYPE", "PKCS12"); config.put("ENGINE_PKI_ENGINE_STORE", tmpkey.toString()); config.put("ENGINE_PKI_ENGINE_STORE_PASSWORD", "NoSoup4U"); config.put("ENGINE_PKI_ENGINE_STORE_ALIAS", "1"); EngineLocalConfig.getInstance(config); encryptedPassword = EngineEncryptionUtils.encrypt(password); if (!Objects.equals(password, EngineEncryptionUtils.decrypt(encryptedPassword))) { throw new IllegalStateException("This benchmark is illegal because " + "the encrypt/decrypt yields a string which is different than the source"); } }

Target:
public void setup() throws IOException, GeneralSecurityException { Map<String, String> config = new HashMap<>(); URL systemResource = ClassLoader.getSystemResource("key.p12"); tmpKey = Files.createTempFile("benchmarktmp", "", asFileAttribute(fromString("rw-------"))); Files.copy(systemResource.openStream(), tmpKey, StandardCopyOption.REPLACE_EXISTING); config.put("ENGINE_PKI_TRUST_STORE", tmpKey.toString()); config.put("ENGINE_PKI_TRUST_STORE_TYPE", "JKS"); config.put("ENGINE_PKI_TRUST_STORE_PASSWORD", "NoSoup4U"); config.put("ENGINE_PKI_ENGINE_STORE", tmpKey.toString()); config.put("ENGINE_PKI_ENGINE_STORE_TYPE", "PKCS12"); config.put("ENGINE_PKI_ENGINE_STORE_PASSWORD", "NoSoup4U"); config.put("ENGINE_PKI_ENGINE_STORE_ALIAS", "1"); EngineLocalConfig.getInstance(config); encryptedPassword = EngineEncryptionUtils.encrypt(password); if (!Objects.equals(password, EngineEncryptionUtils.decrypt(encryptedPassword))) { throw new IllegalStateException("This benchmark is illegal because " + "the encrypt/decrypt yields a string which is different than the source"); } }
Source:
private Image getIncomingChangesImage() { return ReviewsImages.INCOMING_CHANGES.createImage(); }

Target:
private Image getIncomingChangesImage() { return CommonImages.getImage(ReviewsImages.INCOMING_CHANGES); }
Source:
private void emitPersistedFieldAccessors(final JavaWriter writer) throws IOException { for (final VariableElement field : metadata.getFields()) { final String fieldName = field.getSimpleName().toString(); final String fieldTypeCanonicalName = field.asType().toString(); if (Constants.JAVA_TO_REALM_TYPES.containsKey(fieldTypeCanonicalName)) { emitPrimitiveType(writer, field, fieldName, fieldTypeCanonicalName); } else if (Utils.isMutableRealmInteger(field)) { emitMutableRealmInteger(writer, field, fieldName, fieldTypeCanonicalName); } else if (Utils.isRealmModel(field)) { emitRealmModel(writer, field, fieldName, fieldTypeCanonicalName); } else if (Utils.isRealmList(field)) { final TypeMirror elementTypeMirror = Utils.getRealmListElementTypeMirror(field); emitRealmList(writer, field, fieldName, fieldTypeCanonicalName, elementTypeMirror); } else { throw new UnsupportedOperationException(String.format(Locale.US, "Field \"%s\" of type \"%s\" is not supported.", fieldName, fieldTypeCanonicalName)); } writer.emitEmptyLine(); } }

Target:
private void emitPersistedFieldAccessors(final JavaWriter writer) throws IOException { for (final VariableElement field : metadata.getFields()) { final String fieldName = field.getSimpleName().toString(); final String fieldTypeCanonicalName = field.asType().toString(); if (Constants.JAVA_TO_REALM_TYPES.containsKey(fieldTypeCanonicalName)) { emitPrimitiveType(writer, field, fieldName, fieldTypeCanonicalName); } else if (Utils.isMutableRealmInteger(field)) { emitMutableRealmInteger(writer, field, fieldName, fieldTypeCanonicalName); } else if (Utils.isRealmModel(field)) { emitRealmModel(writer, field, fieldName, fieldTypeCanonicalName); } else if (Utils.isRealmList(field)) { final TypeMirror elementTypeMirror = TypeMirrors.getRealmListElementTypeMirror(field); emitRealmList(writer, field, fieldName, fieldTypeCanonicalName, elementTypeMirror); } else { throw new UnsupportedOperationException(String.format(Locale.US, "Field \"%s\" of type \"%s\" is not supported.", fieldName, fieldTypeCanonicalName)); } writer.emitEmptyLine(); } }
Source:
public Integer getMinimumCodeReviewValue(MemoryImprint memoryImprint, boolean onlyBuilt) { Integer codeReview = Integer.MAX_VALUE; for (Entry entry : memoryImprint.getEntries()) { Run build = entry.getBuild(); if (build == null) { continue; } Result result = build.getResult(); if (onlyBuilt && result == Result.NOT_BUILT) { continue; } GerritTrigger trigger = GerritTrigger.getTrigger(entry.getProject()); if (shouldSkip(trigger.getSkipVote(), result)) { continue; } Integer codeReviewObj = getCodeReviewValue(result, trigger); if (codeReviewObj != null) { codeReview = Math.min(codeReview, codeReviewObj); } } return codeReview; }

Target:
public Integer getMinimumCodeReviewValue(MemoryImprint memoryImprint, boolean onlyBuilt) { Integer codeReview = Integer.MAX_VALUE; for (Entry entry : memoryImprint.getEntries()) { Run build = entry.getBuild(); if (build == null) { continue; } Result result = build.getResult(); if (onlyBuilt && result == Result.NOT_BUILT) { continue; } GerritTrigger trigger = GerritTrigger.getTrigger(entry.getProject()); if (shouldSkip(trigger.getSkipVote(), result)) { continue; } Integer codeReviewObj = getCodeReviewValue(result, trigger); if (codeReviewObj != null) { codeReview = Math.min(codeReview, codeReviewObj); } } if (codeReview == Integer.MAX_VALUE) { return null; } return codeReview; }
Source:
private void validateChange(SampleType sampleType, SampleType beforeChange) throws IOException { List<ValidationError> errors = new ArrayList<>(); if (ValidationUtils.isSetAndChanged(SampleType::getName, sampleType, beforeChange)) { if (sampleTypeDao.getByName(sampleType.getName()) != null) { errors.add(new ValidationError("name", "There is already a sample type with this name")); } long usage = sampleTypeDao.getUsage(beforeChange); if (usage > 0L) { errors .add(new ValidationError("name", "Cannot change name of sample type because it is already in use by " + usage + " sample(s)")); } } if (!errors.isEmpty()) { throw new ValidationException(errors); } }

Target:
private void validateChange(SampleType sampleType, SampleType beforeChange) throws IOException { List<ValidationError> errors = new ArrayList<>(); if (ValidationUtils.isSetAndChanged(SampleType::getName, sampleType, beforeChange)) { if (sampleTypeDao.getByName(sampleType.getName()) != null) { errors.add(new ValidationError("name", "There is already a sample type with this name")); } long usage = sampleTypeDao.getUsage(beforeChange); if (usage > 0L) { errors.add(new ValidationError("name", "Cannot change name of sample type because it is already in use by " + usage + " sample" + (usage > 1L ? "s" : ""))); } } if (!errors.isEmpty()) { throw new ValidationException(errors); } }
Source:
public void onApplicationEvent(ContextClosedEvent event) { CuratorFrameworkState state = client.getState(); if (state.equals(STARTED)) { try { byte[] streamStatusData; try { streamStatusData = client.getData().forPath(Paths.build(Paths.STREAM_DEPLOYMENTS, streamName, Paths.STATUS)); } catch (KeeperException.NoNodeException e) { streamStatusData = null; } DeploymentUnitStatus status = streamStatusData != null ? new DeploymentUnitStatus(ZooKeeperUtils.bytesToMap(streamStatusData)) : new DeploymentUnitStatus(DeploymentUnitStatus.State.undeployed); if (DeploymentUnitStatus.State.undeployed.equals(status.getState()) || DeploymentUnitStatus.State.undeploying.equals(status.getState())) { if (client.checkExists().forPath(getDataPath()) != null) { try { client.delete().deletingChildrenIfNeeded().forPath(getDataPath()); } catch (KeeperException.NoNodeException e) { if (KeeperException.Code.NONODE.equals(e.code())) { } else { log.error(e); e.printStackTrace(); } } } } else { System.out.println("We cannot clean, because: " + status); } } catch (Exception e) { log.error(e); e.printStackTrace(); } } else { log.warn("Could not check the stream state and perform cleanup, client state was " + state); } for (Partition partition : partitions) { if (log.isDebugEnabled()) { log.debug("Deleting offsets for " + partition.toString()); } offsetManager.deleteOffset(partition); try { offsetManager.flush(); } catch (IOException e) { log.error("Error while trying to flush offsets: " + e); } } }

Target:
public void onApplicationEvent(ContextClosedEvent event) { CuratorFrameworkState state = client.getState(); if (state.equals(STARTED)) { try { byte[] streamStatusData; try { streamStatusData = client.getData().forPath(Paths.build(Paths.STREAM_DEPLOYMENTS, streamName, Paths.STATUS)); } catch (KeeperException.NoNodeException e) { streamStatusData = null; } DeploymentUnitStatus status = streamStatusData != null ? new DeploymentUnitStatus(ZooKeeperUtils.bytesToMap(streamStatusData)) : new DeploymentUnitStatus(DeploymentUnitStatus.State.undeployed); if (DeploymentUnitStatus.State.undeployed.equals(status.getState()) || DeploymentUnitStatus.State.undeploying.equals(status.getState())) { if (client.checkExists().forPath(getDataPath()) != null) { try { client.delete().deletingChildrenIfNeeded().forPath(getDataPath()); } catch (KeeperException.NoNodeException e) { if (KeeperException.Code.NONODE.equals(e.code())) { } else { log.error("Irrecoverable error while trying to clean partitions table:", e); } } } } } catch (Exception e) { log.error(e); } } else { log.warn("Could not check the stream state and perform cleanup, client state was " + state); } for (Partition partition : partitions) { if (log.isDebugEnabled()) { log.debug("Deleting offsets for " + partition.toString()); } offsetManager.deleteOffset(partition); try { offsetManager.flush(); } catch (IOException e) { log.error("Error while trying to flush offsets: " + e); } } }
Source:
public SipGatewaySession(SipGateway gateway, CallContext callContext) { super(gateway, callContext); this.sipProvider = gateway.getSipProvider(); this.jitsiMeetTools = sipProvider.getOperationSet( OperationSetJitsiMeetTools.class); jitsiMeetTools.addRequestListener(this); roomPassHeaderName = sipProvider.getAccountID() .getAccountPropertyString( JITSI_MEET_ROOM_PASS_HEADER_PROPERTY, JITSI_MEET_ROOM_PASS_HEADER_DEFAULT); domainBaseHeaderName = sipProvider.getAccountID() .getAccountPropertyString( JITSI_MEET_DOMAIN_BASE_HEADER_PROPERTY, JITSI_MEET_DOMAIN_BASE_HEADER_DEFAULT); }

Target:
public SipGatewaySession(SipGateway gateway, CallContext callContext) { super(gateway, callContext); this.sipProvider = gateway.getSipProvider(); this.jitsiMeetTools = sipProvider.getOperationSet( OperationSetJitsiMeetTools.class); roomPassHeaderName = sipProvider.getAccountID() .getAccountPropertyString( JITSI_MEET_ROOM_PASS_HEADER_PROPERTY, JITSI_MEET_ROOM_PASS_HEADER_DEFAULT); domainBaseHeaderName = sipProvider.getAccountID() .getAccountPropertyString( JITSI_MEET_DOMAIN_BASE_HEADER_PROPERTY, JITSI_MEET_DOMAIN_BASE_HEADER_DEFAULT); }
Source:
public TranscriptionResponse viewTranscription(String callID, String legId, String recordingId, String transcriptionId) throws UnauthorizedException, GeneralException, NotFoundException { if (callID == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } if (legId == null) { throw new IllegalArgumentException("Leg ID must be specified."); } if (recordingId == null) { throw new IllegalArgumentException("Recording ID must be specified."); } String url = String.format( "%s%s/%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, callID, LEGSPATH, legId, RECORDINGPATH, recordingId, TRANSCRIPTIONPATH); return messageBirdService.requestByID(url, transcriptionId, TranscriptionResponse.class); }

Target:
public TranscriptionResponse viewTranscription(String callID, String legId, String recordingId, String transcriptionId) throws UnauthorizedException, GeneralException, NotFoundException { if (callID == null) { throw new IllegalArgumentException("Voice call ID must be specified."); } if (legId == null) { throw new IllegalArgumentException("Leg ID must be specified."); } if (recordingId == null) { throw new IllegalArgumentException("Recording ID must be specified."); } if(transcriptionId == null) { throw new IllegalArgumentException("Transcription ID must be specified."); } String url = String.format( "%s%s/%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, callID, LEGSPATH, legId, RECORDINGPATH, recordingId, TRANSCRIPTIONPATH); return messageBirdService.requestByID(url, transcriptionId, TranscriptionResponse.class); }
Source:
private boolean canDeleteSegment(PBDSegment<M> segment) throws IOException { if (segment.getNumEntries() == 0) { return true; } for (ReadCursor cursor : m_readCursors.values()) { PBDSegmentReader<M> segmentReader = segment.getReader(cursor.m_cursorId); if (segmentReader == null && (cursor.m_segment == null || cursor.m_segment.segmentIndex() <= segment.segmentIndex()) ) { return false; } if (segmentReader != null) { if (!segmentReader.allReadAndDiscarded()) { return false; } } } return true; }

Target:
private boolean canDeleteSegment(PBDSegment<M> segment) throws IOException { if (segment.getNumEntries() == 0) { return true; } for (ReadCursor cursor : m_readCursors.values()) { PBDSegmentReader<M> segmentReader = segment.getReader(cursor.m_cursorId); if (segmentReader == null && (cursor.m_segment == null || cursor.m_segment.segmentIndex() <= segment.segmentIndex()) ) { return false; } if (segmentReader != null && !segmentReader.allReadAndDiscarded()) { return false; } } return true; }
Source:
public Long getMaxSize() { return this.maxSize; }

Target:
public long getMaxSize() { return this.maxSize; }
Source:
protected void fillMacAddressIfMissing(VmNic iface) { final MacPoolManagerStrategy pool = getMacPoolForVmNic(iface); if (StringUtils.isEmpty(iface.getMacAddress()) && (pool.getAvailableMacsCount() >= 1)) { iface.setMacAddress(pool.allocateNewMac()); } }

Target:
protected void fillMacAddressIfMissing(VmNic iface) { final MacPoolManagerStrategy pool = getMacPool(); if (StringUtils.isEmpty(iface.getMacAddress()) && (pool.getAvailableMacsCount() >= 1)) { iface.setMacAddress(pool.allocateNewMac()); } }