auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean removeVMFromBackupOffering(VirtualMachine vm) { s_logger.debug("Removing VM ID " + vm.getUuid() + " from backup offering by the Dummy Backup Provider"); final List<Backup> backups = backupDao.listByVmId(null, vm.getId()); for (final Backup backup : backups) { <START> backupDao.remove(backup.getId()); <END> } return true; }</code><technical_language>If assignVMToBackupOffering try remove VM here? return true well</technical_language>

Target:
public boolean removeVMFromBackupOffering(VirtualMachine vm) { s_logger.debug("Removing VM ID " + vm.getUuid() + " from backup offering by the Dummy Backup Provider"); return true; }
Source:
<code>public void updateVmDevices(VmManagementParametersBase params, VM oldVm) { VmBase oldVmBase = oldVm.getStaticData(); VmBase newVmBase = params.getVmStaticData(); if (newVmBase == null) { return; } updateCdPath(oldVmBase, newVmBase); updateBootOrder(oldVmBase, newVmBase); updateVideoDevices(oldVmBase, newVmBase); updateUsbSlots(oldVmBase, newVmBase); updateMemoryBalloon(newVmBase.getId(), params.isBalloonEnabled()); updateSoundDevice(oldVmBase, newVmBase, oldVm.getCompatibilityVersion(), params.isSoundDeviceEnabled()); updateSmartcardDevice(oldVm, newVmBase); updateConsoleDevice(newVmBase.getId(), params.isConsoleEnabled()); int scsiControllers = (newVmBase.getNumOfIoThreads() > 1 && params.isVirtioScsiEnabled()) ? newVmBase.getNumOfIoThreads() : 1; for (int i = 1; i <= scsiControllers; i++) { <START> updateVirtioScsiController(newVmBase.getId(), params.isVirtioScsiEnabled()); <END> } }</code><technical_language>I this is work updateVirtioScsiController() guards one. - need add <driver iothread='<< ID of iothread >>'/> part (or, well, somewhere, of addVirtioScsiController)</technical_language>

Target:
public void updateVmDevices(VmManagementParametersBase params, VM oldVm) { VmBase oldVmBase = oldVm.getStaticData(); VmBase newVmBase = params.getVmStaticData(); if (newVmBase == null) { return; } updateCdPath(oldVmBase, newVmBase); updateBootOrder(oldVmBase, newVmBase); updateVideoDevices(oldVmBase, newVmBase); updateUsbSlots(oldVmBase, newVmBase); updateMemoryBalloon(newVmBase.getId(), params.isBalloonEnabled()); updateSoundDevice(oldVmBase, newVmBase, oldVm.getCompatibilityVersion(), params.isSoundDeviceEnabled()); updateSmartcardDevice(oldVm, newVmBase); updateConsoleDevice(newVmBase.getId(), params.isConsoleEnabled()); updateVirtioScsiController(newVmBase, params.isVirtioScsiEnabled()); }
Source:
<code>public GeneratorPriceIndexCurveInterpolatedAnchorNode(final double[] nodePoints, final Interpolator1D interpolator, final double anchorNode, final double anchorValue) { ArgumentChecker.notNull(nodePoints, "Node points"); ArgumentChecker.notNull(interpolator, "Interpolator"); _nbPoints = nodePoints.length; <START> _nodePoints = nodePoints; <END> _anchorNode = anchorNode; _anchorValue = anchorValue; _interpolator = interpolator; }</code><technical_language>Please copy construction for primitive arrays</technical_language>

Target:
public GeneratorPriceIndexCurveInterpolatedAnchorNode(final double[] nodePoints, final Interpolator1D interpolator, final double anchorNode, final double anchorValue) { ArgumentChecker.notNull(nodePoints, "Node points"); ArgumentChecker.notNull(interpolator, "Interpolator"); _nbPoints = nodePoints.length; _nodePoints = nodePoints.clone(); _anchorNode = anchorNode; _anchorValue = anchorValue; _interpolator = interpolator; }
Source:
<code>public void testTaskUpdateSizeLimit() { Session session = Session.builder(getSession()).build(); <START> assertQueryFails(session, "SELECT * " + <END> "FROM ORDERS " + "WHERE ORDERKEY != 50303681 " + "AND ORDERKEY != 50303682 " + "AND ORDERKEY != 50303683 " + "AND ORDERKEY != 50303684 " + "AND ORDERKEY != 50303685 " + "AND CUSTKEY != 1327381 " + "AND CUSTKEY != 1327382 " + "AND CUSTKEY != 1327383 " + "AND CUSTKEY != 1327384 " + "AND CUSTKEY != 1327385 " + "LIMIT 10", "TaskUpdate size of [0-9]* Bytes has exceeded the limit of 100 Bytes"); }</code><technical_language>param line; leave line empty</technical_language>

Target:
public void testTaskUpdateSizeLimit() { assertQueryFails( getSession(), "SELECT * FROM ORDERS LIMIT 10", "TaskUpdate size of [0-9]* Bytes has exceeded the limit of 100 Bytes"); }
Source:
<code>public HideData asMutable() { <START> return new SpongeHideData(enchantments, attributes, unbreakable, canDestroy, canPlace, miscellaneous); <END> }</code><technical_language>this</technical_language>

Target:
public HideData asMutable() { return new SpongeHideData(this.enchantments, this.attributes, this.unbreakable, this.canDestroy, this.canPlace, this.miscellaneous); }
Source:
<code><START> public SecurityProfile getDeletionSecurityProfile() { <END> return securityProfile; }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Update this method implementation is identical "getSecurityProfile" line 386. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public SecurityProfile getDeletionSecurityProfile() { return getSecurityProfile(); }
Source:
<code>public void bindComparisonOperator() throws StandardException{ boolean nullableResult; if (singleLeftOperand) rightOperandList.comparable(getLeftOperand()); boolean leftNullable = false; for (int index = 0; index < leftOperandList.size(); index++) { ValueNode ln = (ValueNode) leftOperandList.elementAt(index); if (ln.getTypeServices().isNullable()) { leftNullable = true; break; } } <START> nullableResult= leftNullable || <END> rightOperandList.isNullable(); setType(new DataTypeDescriptor(TypeId.BOOLEAN_ID,nullableResult)); }</code><technical_language>simplify computation of leftNullable leftOperandList.isNullable()</technical_language>

Target:
public void bindComparisonOperator() throws StandardException{ boolean nullableResult; if (singleLeftOperand) rightOperandList.comparable(getLeftOperand()); nullableResult= leftOperandList.isNullable() || rightOperandList.isNullable(); setType(new DataTypeDescriptor(TypeId.BOOLEAN_ID,nullableResult)); }
Source:
<code>public void testSparkSVDOnTestMatrix() { final RealMatrix dataMatrix = new Array2DRowRealMatrix(TEST_MATRIX); final JavaSparkContext sparkContext = SparkContextFactory.getSparkContext("test", SparkContextFactory.DEFAULT_SPARK_MASTER); final PCA pca = PCA.createPCA(dataMatrix, dm -> SVDFactory.createSVD(dm, sparkContext)); final RealVector centers = pca.getCenters(); final RealVector variances = pca.getVariances(); final RealMatrix loadings = pca.getLoadings(); Assert.assertNotNull(loadings); assertEquals(centers, new ArrayRealVector(TEST_EXPECTED_CENTERS), EPSILON); assertEquals(variances, new ArrayRealVector(TEST_EXPECTED_VARS), EPSILON); assertEqualLoadings(loadings, new Array2DRowRealMatrix(TEST_EXPECTED_LOADINGS), variances, EPSILON); <START> <END> }</code><technical_language>whitespace</technical_language>

Target:
public void testSparkSVDOnTestMatrix() { final RealMatrix dataMatrix = new Array2DRowRealMatrix(TEST_MATRIX); final JavaSparkContext sparkContext = SparkContextFactory.getSparkContext("test", SparkContextFactory.DEFAULT_SPARK_MASTER); final PCA pca = PCA.createPCA(dataMatrix, dm -> SVDFactory.createSVD(dm, sparkContext)); final RealVector centers = pca.getCenters(); final RealVector variances = pca.getVariances(); final RealMatrix eigenVectors = pca.getEigenVectors(); Assert.assertNotNull(eigenVectors); assertEquals(centers, new ArrayRealVector(TEST_EXPECTED_CENTERS), EPSILON); assertEquals(variances, new ArrayRealVector(TEST_EXPECTED_VARS), EPSILON); assertEqualEigenVectors(eigenVectors, new Array2DRowRealMatrix(TEST_EXPECTED_EIGENVECTORS), variances, EPSILON); }
Source:
<code>private static void assertNotEmptyCanDoActionMessage() { <START> assertTrue(EXPECTED_CAN_DO_MESSAGE, canDoActionMessages.size() > 0); <END> canDoActionMessages.clear(); }</code><technical_language>optional: consider assertFalse(EXPECTED_CAN_DO_MESSAGE, canDoActionMessages.isEmpty())</technical_language>

Target:
private void assertNotEmptyCanDoActionMessage() { assertTrue(EXPECTED_CAN_DO_MESSAGE, !canDoActionMessages.isEmpty()); canDoActionMessages.clear(); }
Source:
<code>public Access checkPermission(Document doc, ACP mergedAcp, Principal principal, String permission, String[] resolvedPermissions, String[] additionalPrincipals) { Access access = Access.UNKNOWN; <START> if (doc.getType().getName().equals(MAIL_MESSAGE_TYPE) && SecurityConstants.WRITE.equals(permission)) { <END> access = Access.DENY; } return access; }</code><technical_language>do check permission resolvedPermissions. Arrays.asList(resolvedPermissions).contains(WRITE). check Write, is a high-level permission low-level ones. instead check for presence in list of low-level permission WriteProperties checked code in AbstractSession</technical_language>

Target:
public Access checkPermission(Document doc, ACP mergedAcp, Principal principal, String permission, String[] resolvedPermissions, String[] additionalPrincipals) { Access access = Access.UNKNOWN; if (doc.getType().getName().equals(MAIL_MESSAGE_TYPE)) { List<String> resolvedPermissionsList = Arrays.asList(resolvedPermissions); if (resolvedPermissionsList.contains(SecurityConstants.WRITE_PROPERTIES) || resolvedPermissionsList.contains(SecurityConstants.WRITE)) { access = Access.DENY; } } return access; }
Source:
<code>public long getTokenExpiration(final String token) throws UnknownTokenException { long expiration; try { validateToken(token); } catch (final UnknownTokenException e) { <START> if (permissiveFailureEnabled && StringUtils <END> .containsIgnoreCase(e.toString(), "Unknown token")) { return getJWTTokenExpiration(token); } else { throw e; } } synchronized (tokenExpirations) { expiration = tokenExpirations.get(token); } return expiration; }</code><technical_language>do exact twice? Why</technical_language>

Target:
public long getTokenExpiration(final String token) throws UnknownTokenException { long expiration; try { validateToken(token); } catch (final UnknownTokenException e) { if (permissiveValidationEnabled && getJWTTokenExpiration(token).isPresent()) { return getJWTTokenExpiration(token).getAsLong(); } else { throw e; } } synchronized (tokenExpirations) { expiration = tokenExpirations.get(token); } return expiration; }
Source:
<code>public String toString() { <START> return "print state of tree"; <END> }</code><technical_language>capital letter</technical_language>

Target:
public String toString() { return "Print state of tree"; }
Source:
<code>private boolean contributeObjectActionsOld(IMenuManager manager) { try { DummyPart part = new DummyPart(); <START> MethodUtils.invokeExactMethod(ObjectActionContributorManager.getManager(), "contributeObjectActions", END> new Object[] { part, manager, activeTaskSelectionProvider }); } catch (NoSuchMethodException e) { return false; } catch (IllegalAccessException e) { return false; } catch (InvocationTargetException e) { return false; } return true; }</code><technical_language>invokeExactMethod(Object object, String methodName, Object[] args, Class[] parameterTypes) a DummyPart</technical_language>

Target:
private boolean contributeObjectActionsOld(IMenuManager manager) { try { MethodUtils.invokeExactMethod(ObjectActionContributorManager.getManager(), "contributeObjectActions", new Object[] { null, manager, activeTaskSelectionProvider }, new Class[] { IWorkbenchPart.class, IMenuManager.class, ISelectionProvider.class }); } catch (NoSuchMethodException e) { return false; } catch (IllegalAccessException e) { return false; } catch (InvocationTargetException e) { return false; } return true; }
Source:
<code>public SheetLocation getSheetLocation(EObject eObject, EStructuralFeature structuralFeature) { SheetLocation possibleResult = null; for (final SettingToSheetMapping settingToSheetMapping : getSettingToSheetMap()) { if (structuralFeature != settingToSheetMapping.getSettingLocation().getFeature()) { continue; } if (possibleResult == null) { possibleResult = settingToSheetMapping.getSheetLocation(); } if (eObject != settingToSheetMapping.getSettingLocation().getEObject()) { continue; } return EcoreUtil.copy(settingToSheetMapping.getSheetLocation()); } if (possibleResult != null) { final SheetLocation result = EcoreUtil.copy(possibleResult); result.setRow(-1); return result; } <START> return ErrorFactory.eINSTANCE.createSheetLocation("NO SHEET", -1, -1, getFeatureName(structuralFeature)); END> }</code><technical_language>return a NoSheetLocation Object remove resolved feature name SheetLocation. Callers resolve themselfes a public static getFeatureName method</technical_language>

Target:
public SheetLocation getSheetLocation(EObject eObject, EStructuralFeature structuralFeature) { SheetLocation possibleResult = null; for (final SettingToSheetMapping settingToSheetMapping : getSettingToSheetMap()) { if (structuralFeature != settingToSheetMapping.getSettingLocation().getFeature()) { continue; } if (possibleResult == null) { possibleResult = settingToSheetMapping.getSheetLocation(); } if (eObject != settingToSheetMapping.getSettingLocation().getEObject()) { continue; } return EcoreUtil.copy(settingToSheetMapping.getSheetLocation()); } if (possibleResult != null) { final SheetLocation result = EcoreUtil.copy(possibleResult); result.setRow(-1); return result; } return ErrorFactory.eINSTANCE.createInvalidSheetLocation(getFeatureName(structuralFeature)); }
Source:
<code>public static File createIndexedBamOrCram(final File samFile, final File tempFilePrefix, final SamReader.Type type, final File referenceFasta) throws IOException { if (type != SamReader.Type.BAM_TYPE && type != SamReader.Type.CRAM_TYPE) { throw new PicardException("Cannot create indexed file of type "+type); } if (type == SamReader.Type.CRAM_TYPE && referenceFasta == null) { throw new PicardException("Cannot create indexed CRAM file without reference"); } final File output = File.createTempFile(tempFilePrefix.getAbsolutePath(), "."+type.fileExtension()); output.deleteOnExit(); <START> final File indexFile = new File(output.getAbsolutePath() + "."+type.indexExtension()); <END> indexFile.deleteOnExit(); final SamReader in = SamReaderFactory.makeDefault().open(samFile); SAMFileWriter out = new SAMFileWriterFactory().setCreateIndex(true).makeWriter(in.getFileHeader(), true, output,referenceFasta); in.iterator().stream().forEach(out::addAlignment); out.close(); in.close(); return output; }</code><technical_language>file needs automatic re-formatting</technical_language>

Target:
public static File createIndexedBamOrCram(final File samFile, final File tempFilePrefix, final SamReader.Type type, final File referenceFasta) throws IOException { if (type != SamReader.Type.BAM_TYPE && type != SamReader.Type.CRAM_TYPE) { throw new PicardException("Cannot create indexed file of type " + type); } if (type == SamReader.Type.CRAM_TYPE && referenceFasta == null) { throw new PicardException("Cannot create indexed CRAM file without reference"); } final File output = File.createTempFile(tempFilePrefix.getAbsolutePath(), "." + type.fileExtension()); output.deleteOnExit(); final File indexFile; if (type == SamReader.Type.BAM_TYPE) { final String fileBase = output.getAbsolutePath().substring(0, output.getAbsolutePath().lastIndexOf('.')); indexFile = new File(fileBase + BAMIndex.BAI_INDEX_SUFFIX); indexFile.deleteOnExit(); } else if (type == SamReader.Type.CRAM_TYPE) { indexFile = IOUtil.addExtension(Paths.get(output.getAbsolutePath()), BAMIndex.BAI_INDEX_SUFFIX).toFile(); indexFile.deleteOnExit(); } try (final SamReader in = SamReaderFactory.makeDefault().open(samFile); final SAMFileWriter out = new SAMFileWriterFactory().setCreateIndex(true).makeWriter(in.getFileHeader(), true, output, referenceFasta);) { in.iterator().stream().forEach(out::addAlignment); } return output; }
Source:
<code>public static void prepareBriefcaseStorageFolder() { try { BriefcasePreferences.setBriefcaseDirectoryProperty(Files.createTempDirectory("briefcase_test").toString()); File briefcaseFolder = new StorageLocation().getBriefcaseFolder(); <START> boolean mkdirs = briefcaseFolder.mkdirs(); <END> if (mkdirs) log.info("Created test Briefcase storage folder at " + briefcaseFolder); else throw new RuntimeException("Can't create test Briefcase storage folder"); } catch (IOException e) { throw new RuntimeException(e); } }</code><technical_language>Consider a more meaningful name, dirsMade created something? (15 seconds later) inline variable</technical_language>

Target:
public static void prepareBriefcaseStorageFolder() { try { BriefcasePreferences.setBriefcaseDirectoryProperty(Files.createTempDirectory("briefcase_test").toString()); File briefcaseFolder = new StorageLocation().getBriefcaseFolder(); if (briefcaseFolder.mkdirs()) log.info("Created test Briefcase storage folder at " + briefcaseFolder); else throw new RuntimeException("Can't create test Briefcase storage folder"); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>public void generateRetrieveFilesCall(final Map entryInfos, IPath destination, final String[] files, IAntScript script) { String gitRepo = (String) entryInfos.get(KEY_REPO); String localGitRepo = asLocalRepo(gitRepo); String path = (String) entryInfos.get(KEY_PATH); String tag = (String) entryInfos.get(IFetchFactory.KEY_ELEMENT_TAG); printCloneRepoAndCheckoutTagTasks(script, gitRepo, localGitRepo, tag, null); Map<String,String> params = new HashMap<String,String>(4); for (int i = 0; i < files.length; i++) { String file = files[i]; IPath filePath; <START> if (path != null) { <END> filePath = new Path(path).append(file); } else { filePath = new Path((String) entryInfos.get(KEY_ELEMENT_NAME)).append(file); } params.clear(); params.put(PROP_GITREPO_LOCAL_PATH, localGitRepo); params.put(PROP_DESTINATIONFOLDER, destination.toString()); params.put(PROP_PATH, filePath.toString()); params.put(PROP_FILE, file); script.printAntCallTask(TARGET_GET_FILE_FROM_REPO, true, params); } }</code><technical_language>style nit: avoid braces single line block</technical_language>

Target:
public void generateRetrieveFilesCall(final Map entryInfos, IPath destination, final String[] files, IAntScript script) { final String gitRepo = (String) entryInfos.get(KEY_REPO); final String localGitRepo = asLocalRepo(gitRepo); final String path = (String) entryInfos.get(KEY_PATH); final String tag = (String) entryInfos .get(IFetchFactory.KEY_ELEMENT_TAG); printCloneRepoAndCheckoutTagTasks(script, gitRepo, localGitRepo, tag, null); final Map<String, String> params = new HashMap<String, String>(4); for (int i = 0; i < files.length; i++) { final String file = files[i]; IPath filePath; if (path != null) { filePath = new Path(path).append(file); } else { filePath = new Path((String) entryInfos.get(KEY_ELEMENT_NAME)) .append(file); } params.clear(); params.put(PROP_GITREPO_LOCAL_PATH, localGitRepo); params.put(PROP_DESTINATIONFOLDER, destination.toString()); params.put(PROP_PATH, filePath.toString()); params.put(PROP_FILE, file); script.printAntCallTask(TARGET_GET_FILE_FROM_REPO, true, params); } }
Source:
<code>public void testRegistration() throws Exception { deployContrib(BUNDLE_TEST_NAME, "notification-contrib.xml"); <START> applyInlineDeployments(); <END> List<Notification> notifications = getService().getNotificationsForEvents("testEvent"); assertEquals(1, notifications.size()); Notification notif = notifications.get(0); assertEquals("email", notif.getChannel()); assertEquals(false, notif.getAutoSubscribed()); assertEquals("section", notif.getAvailableIn()); assertEquals("Test Notification Label", notif.getLabel()); assertEquals("Test Notification Subject", notif.getSubject()); assertEquals("Test Notification Subject Template", notif.getSubjectTemplate()); assertEquals("test-template", notif.getTemplate()); assertEquals("NotificationContext['exp1']", notif.getTemplateExpr()); Map<String, Serializable> infos = new HashMap<>(); infos.put("exp1", "myDynamicTemplate"); String template = mailHelper.evaluateMvelExpresssion(notif.getTemplateExpr(), infos); assertEquals("myDynamicTemplate", template); notifications = getService().getNotificationsForSubscriptions("section"); assertEquals(1, notifications.size()); URL newModifTemplate = NotificationService.getTemplateURL("test-template"); assertTrue(newModifTemplate.getFile().endsWith("templates/test-template.ftl")); }</code><technical_language>pushInlineDeployments ? - of deployContrib a test bundle</technical_language>

Target:
public void testRegistration() throws Exception { pushInlineDeployments(BUNDLE_TEST_NAME + ":notification-contrib.xml"); List<Notification> notifications = getService().getNotificationsForEvents("testEvent"); assertEquals(1, notifications.size()); Notification notif = notifications.get(0); assertEquals("email", notif.getChannel()); assertFalse(notif.getAutoSubscribed()); assertEquals("section", notif.getAvailableIn()); assertEquals("Test Notification Label", notif.getLabel()); assertEquals("Test Notification Subject", notif.getSubject()); assertEquals("Test Notification Subject Template", notif.getSubjectTemplate()); assertEquals("test-template", notif.getTemplate()); assertEquals("NotificationContext['exp1']", notif.getTemplateExpr()); Map<String, Serializable> infos = new HashMap<>(); infos.put("exp1", "myDynamicTemplate"); String template = mailHelper.evaluateMvelExpresssion(notif.getTemplateExpr(), infos); assertEquals("myDynamicTemplate", template); notifications = getService().getNotificationsForSubscriptions("section"); assertEquals(1, notifications.size()); URL newModifTemplate = NotificationService.getTemplateURL("test-template"); assertTrue(newModifTemplate.getFile().endsWith("templates/test-template.ftl")); }
Source:
<code>public OwnCloudClient removeClientFor(OwnCloudAccount account) { OwnCloudClient clientRemoved = mSimpleFactoryManager.removeClientFor(account); <START> OwnCloudClient clientRemoved2 = mSingleSessionManager.removeClientFor(account); <END> if (clientRemoved2 != null) { return clientRemoved2; } else { return clientRemoved; } }</code><technical_language>a number in a variable is a good idea.If in future more clientRemoved variables, continue increasing number variable name distinguish others. instead clientRemovedFactory clientRemovedSession that</technical_language>

Target:
public OwnCloudClient removeClientFor(OwnCloudAccount account) { OwnCloudClient clientRemovedFromFactoryManager = mSimpleFactoryManager.removeClientFor(account); OwnCloudClient clientRemovedFromSingleSessionManager = mSingleSessionManager.removeClientFor(account); if (clientRemovedFromSingleSessionManager != null) { return clientRemovedFromSingleSessionManager; } else { return clientRemovedFromFactoryManager; } }
Source:
<code>protected IFolder getFolder(IResource resource) { <START> if (resource instanceof IFolder) { return (IFolder) resource; } <END> return Adapters.getAdapter(resource, IFolder.class, true); }</code><technical_language>Lines 1068-1088 redundant</technical_language>

Target:
protected IFolder getFolder(IResource resource) { return Adapters.getAdapter(resource, IFolder.class, true); }
Source:
<code><START> protected T getCluster(Marker marker) { <END> return mMarkerCache.get(marker); }</code><technical_language>I this is "getClusterItem". a separate for "getCluster", I think. overloaded method for "getMarker"</technical_language>

Target:
protected Cluster<T> getCluster(Marker marker) { return mMarkerToCluster.get(marker); }
Source:
<code>public Callable<File> updateSynch(final String id, final InputStream content) { if (id.endsWith("/")) { throw new IllegalArgumentException( "Identifiers for use with this indexer may not end in '/'!"); } return new Callable<File>() { @Override public File call() throws IOException { <START> String fullPath = id.substring(id.indexOf(" END> final String idPath = substringAfterLast(fullPath, "/"); fullPath = StringUtils.substringBeforeLast(fullPath, "/"); final Path dir = Paths.get(getPath(), fullPath); if (Files.notExists(dir, LinkOption.NOFOLLOW_LINKS)) { Files.createDirectories(Paths.get(getPath(), fullPath)); } final String fileName = idPath + ".jcr.xml"; final Path p = Paths.get(dir.toString(), fileName); LOGGER.debug("Updating to file: {}", fullPath, p.toAbsolutePath().toString()); Files.copy(content, p, new CopyOption[]{}); return p.toFile(); } }; }</code><technical_language>identifiers of form "pid:55". I suspect want replace ":" if is a port, colons. However, appropriately encode URI is converted a directory path converted characters valid filesystems: Mac, Windows, Linux</technical_language>

Target:
public Callable<File> updateSynch(final String id, final InputStream content) { if (id.endsWith("/")) { throw new IllegalArgumentException( "Identifiers for use with this indexer may not end in '/'!"); } return new Callable<File>() { @Override public File call() throws IOException { String fullPath = id.substring(id.indexOf(" fullPath = StringUtils.substringBefore(fullPath, "/").replace(":", "/") + "/" + StringUtils.substringAfter(fullPath, "/"); final String idPath = URLEncoder.encode(substringAfterLast(fullPath, "/"), "UTF-8"); final String[] pathTokens = StringUtils.substringBeforeLast(fullPath, "/").split("/"); final StringBuilder pathBuilder = new StringBuilder(); for (final String token : pathTokens) { if (StringUtils.isNotBlank(token)) { pathBuilder.append(URLEncoder.encode(token, "UTF-8") + "/"); } } fullPath = pathBuilder.substring(0, pathBuilder.length() - 1).toString(); final Path dir = Paths.get(getPath(), fullPath); if (Files.notExists(dir, LinkOption.NOFOLLOW_LINKS)) { Files.createDirectories(Paths.get(getPath(), fullPath)); } final String fileName = idPath + ".jcr.xml"; final Path p = Paths.get(dir.toString(), fileName); LOGGER.debug("Updating to file: {}", fullPath, p.toAbsolutePath().toString()); Files.copy(content, p, new CopyOption[]{}); return p.toFile(); } }; }
Source:
<code>protected boolean processImageInIrs() { Guid taskId = this.createAsyncTask(getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId()); getReturnValue().getAsyncTaskIdList().add(taskId); VDSReturnValue vdsReturnValue = runVdsCommand( VDSCommandType.CreateImage, new CreateImageVDSCommandParameters(getParameters().getStoragePoolId(), getParameters() .getStorageDomainId(), getImageGroupId(), getParameters().getDiskInfo().getSize(), getParameters().getDiskInfo().getVolumeType(), getParameters().getDiskInfo() .getVolumeFormat(), getDestinationImageId(), "", getStoragePool() .getcompatibility_version().toString())); if (vdsReturnValue.getSucceeded()) { getParameters().setTaskIds(new ArrayList<Guid>()); getParameters().getTaskIds().add( createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); <START> getReturnValue().getInternalVdsmTaskIdList().add(getParameters().getTaskIds().get(0)); <END> return true; } return false; }</code><technical_language>find getTaskIds a bit confusing? task id is vdsm task id db task id? ;)</technical_language>

Target:
protected boolean processImageInIrs() { Guid taskId = this.createAsyncTask(getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId()); getReturnValue().getAsyncTaskIdList().add(taskId); VDSReturnValue vdsReturnValue = runVdsCommand( VDSCommandType.CreateImage, new CreateImageVDSCommandParameters(getParameters().getStoragePoolId(), getParameters() .getStorageDomainId(), getImageGroupId(), getParameters().getDiskInfo().getSize(), getParameters().getDiskInfo().getVolumeType(), getParameters().getDiskInfo() .getVolumeFormat(), getDestinationImageId(), "", getStoragePool() .getcompatibility_version().toString())); if (vdsReturnValue.getSucceeded()) { getParameters().setVdsmTaskIds(new ArrayList<Guid>()); getParameters().getVdsmTaskIds().add( createTask(taskId, vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); getReturnValue().getInternalVdsmTaskIdList().add(getParameters().getVdsmTaskIds().get(0)); return true; } return false; }
Source:
<code>public ContentResource wrap(final ContentResource content) { if (!isFiltered(content)) { return content; } Reference contentRef = entityManager.newReference(content.getReference()); Reference siteRef = entityManager.newReference(contentRef.getContext()); Entity entity = siteRef.getEntity(); String addHtml = content.getProperties().getProperty(ResourceProperties.PROP_ADD_HTML); String skinRepo = getSkinRepo(); String siteSkin = getSiteSkin(entity); String forcePopups = getForcePopupsOnMixedContent(); final boolean detectHtml = addHtml == null || addHtml.equals("auto"); String title = getTitle(content); StringBuilder header = new StringBuilder(); <START> if ("standards".equals(addHtml) || addHtml.equals("auto")) { <END> header.append(doctype); } header.append(MessageFormat.format(headerTemplate, skinRepo, siteSkin, title, forcePopups)); final String footer = footerTemplate; return new WrappedContentResource(content, header.toString(), footer, detectHtml); }</code><technical_language>NPE addHtml null. String constant first</technical_language>

Target:
public ContentResource wrap(final ContentResource content) { if (!isFiltered(content)) { return content; } Reference contentRef = entityManager.newReference(content.getReference()); Reference siteRef = entityManager.newReference(contentRef.getContext()); Entity entity = siteRef.getEntity(); String addHtml = content.getProperties().getProperty(ResourceProperties.PROP_ADD_HTML); String skinRepo = getSkinRepo(); String siteSkin = getSiteSkin(entity); String forcePopups = getForcePopupsOnMixedContent(); final boolean detectHtml = addHtml == null || addHtml.equals("auto"); String title = getTitle(content); StringBuilder header = new StringBuilder(); if ("standards".equals(addHtml) || "auto".equals(addHtml)) { header.append(doctype); } header.append(MessageFormat.format(headerTemplate, skinRepo, siteSkin, title, forcePopups)); final String footer = footerTemplate; return new WrappedContentResource(content, header.toString(), footer, detectHtml); }
Source:
<code>public void configure(Context context) { host = context.getString("host"); port = context.getInteger("port", DEFAULT_PORT); sslEnabled = context.getBoolean("sslEnabled", DEFAULT_SSL); version = context.getString("version", DEFAULT_VERSION); writerPoolSize = context.getInteger("writerPoolSize", DEFAULT_WRITER_POOL_SIZE); streamName = context.getString("streamName"); <START> authClientClassPath = context.getString("authClientClass", DEFAULT_AUTH_CLIENT); <END> authClientPropertiesPath = context.getString("authClientProperties", ""); Preconditions.checkState(host != null, "No hostname specified"); Preconditions.checkState(streamName != null, "No stream name specified"); }</code><technical_language>is a classpath a class name</technical_language>

Target:
public void configure(Context context) { host = context.getString("host"); port = context.getInteger("port", DEFAULT_PORT); sslEnabled = context.getBoolean("sslEnabled", DEFAULT_SSL); version = context.getString("version", DEFAULT_VERSION); writerPoolSize = context.getInteger("writerPoolSize", DEFAULT_WRITER_POOL_SIZE); streamName = context.getString("streamName"); authClientClassName = context.getString("authClientClass", DEFAULT_AUTH_CLIENT); authClientPropertiesPath = context.getString("authClientProperties", ""); Preconditions.checkState(host != null, "No hostname specified"); Preconditions.checkState(streamName != null, "No stream name specified"); }
Source:
<code>public LookupSnapshotTaker( final @Json ObjectMapper jsonMapper, String persistDirectory ) { this.objectMapper = jsonMapper; this.persistDirectory = persistDirectory == null <START> ? Files.createTempDir() <END> : new File(persistDirectory); if (!this.persistDirectory.exists()) { this.persistDirectory.mkdirs(); } if (!this.persistDirectory.isDirectory()) { throw new ISE("Can only persist to directories, [%s] wasn't a directory", persistDirectory); } this.persistFile = new File(persistDirectory, "lookupSnapshot.data"); }</code><technical_language>is purpose of snapshotting a random directory discoverable in future</technical_language>

Target:
public LookupSnapshotTaker( final @Json ObjectMapper jsonMapper, String persistDirectory ) { this.objectMapper = jsonMapper; Preconditions.checkArgument(!Strings.isNullOrEmpty(persistDirectory), "can not work without specifying persistDirectory"); this.persistDirectory = new File(persistDirectory); if (!this.persistDirectory.exists()) { Preconditions.checkArgument(this.persistDirectory.mkdirs(), "Oups was not able to create persist directory"); } if (!this.persistDirectory.isDirectory()) { throw new ISE("Can only persist to directories, [%s] wasn't a directory", persistDirectory); } this.persistFile = new File(persistDirectory, PERSIST_FILE_NAME); }
Source:
<code>public Date getExpiresOn() { <START> return mExpiresOn != null ? new Date(mExpiresOn.getTime()) : null; <END> }</code><technical_language>new Date(mExpiresOn.getTime() [](start = 36, length = 29) this? #Closed</technical_language>

Target:
public Date getExpiresOn() { return Utility.getImmutableDateObject(mExpiresOn); }
Source:
<code>public boolean isRegionOnline(RegionInfo ri) { RetryCounter rc = null; while (!master.isStopped()) { RegionState rs = regionStates.getRegionState(ri); if (rs.isOpened()) { if (master.getServerManager().isServerOnline(rs.getServerName())) { return true; <START> } <END> } Optional<Procedure<MasterProcedureEnv>> optProc = master.getMasterProcedureExecutor().getProcedures(). stream().filter(p -> p instanceof ServerCrashProcedure).findAny(); LOG.warn("{} is NOT online; state={}; ServerCrashProcedures={}. Master startup cannot " + "progress, in holding-pattern until region onlined.", ri.getRegionNameAsString(), rs, optProc.isPresent()); if (rc == null) { rc = new RetryCounterFactory(1000).create(); } Threads.sleep(rc.getBackoffTimeAndIncrementAttempts()); } return false; }</code><technical_language>Radical</technical_language>

Target:
public boolean isRegionOnline(RegionInfo ri) { RetryCounter rc = null; while (!master.isStopped()) { RegionState rs = regionStates.getRegionState(ri); if (rs.isOpened()) { if (master.getServerManager().isServerOnline(rs.getServerName())) { return true; } } Optional<Procedure<MasterProcedureEnv>> optProc = master.getMasterProcedureExecutor().getProcedures(). stream().filter(p -> p instanceof ServerCrashProcedure).findAny(); LOG.warn("{} is NOT online; state={}; ServerCrashProcedures={}. Master startup cannot " + "progress, in holding-pattern until region onlined.", ri.getRegionNameAsString(), rs, optProc.isPresent()); if (rc == null) { rc = new RetryCounterFactory(Integer.MAX_VALUE, 1000, 60_000).create(); } Threads.sleep(rc.getBackoffTimeAndIncrementAttempts()); } return false; }
Source:
<code>public static StreamAddressSpace getStreamAddressSpace(StreamAddressSpaceMsg msg) { Roaring64NavigableMap roaring64NavigableMap = new Roaring64NavigableMap(); <START> try(DataInputStream dis = new DataInputStream(msg.getAddressMap().newInput())) { <END> roaring64NavigableMap.deserialize(dis); } catch (Exception ex) { log.error("getStreamAddressSpace: error=[{}, {}] " + "while deserializing roaring64NavigableMap", ex, ex.getCause()); } return new StreamAddressSpace(msg.getTrimMark(), roaring64NavigableMap); }</code><technical_language>Style: missing space</technical_language>

Target:
public static StreamAddressSpace getStreamAddressSpace(StreamAddressSpaceMsg msg) { Roaring64NavigableMap roaring64NavigableMap = new Roaring64NavigableMap(); try (DataInputStream dis = new DataInputStream(msg.getAddressMap().newInput())) { roaring64NavigableMap.deserialize(dis); } catch (IOException ex) { throw new SerializerException("Unexpected error while deserializing roaring64NavigableMap", ex); } return new StreamAddressSpace(msg.getTrimMark(), roaring64NavigableMap); }
Source:
<code>protected boolean isBetweenOperator(ExpressionDTO prev, ExpressionDTO temp) { String prevOperator = prev.getOperator(); String tempOperator = temp.getOperator(); try { if (prevOperator.equals(BLCOperator.GREATER_THAN.name()) && tempOperator.equals(BLCOperator.LESS_THAN.name())) { return Long.parseLong(temp.getValue()) > Long.parseLong(prev.getValue()); } else if (prevOperator.equals(BLCOperator.LESS_THAN.name()) && tempOperator.equals(BLCOperator.GREATER_THAN.name())) { return Long.parseLong(prev.getValue()) > Long.parseLong(temp.getValue()); } return false; <START> } catch (NumberFormatException e) { <END> return false; } }</code><technical_language>log error warning</technical_language>

Target:
protected boolean isBetweenOperator(ExpressionDTO prev, ExpressionDTO temp) { String prevOperator = prev.getOperator(); String prevVal = prev.getValue(); String tempOperator = temp.getOperator(); String tempVal = temp.getValue(); try { if (prevOperator.equals(BLCOperator.GREATER_THAN.name()) && tempOperator.equals(BLCOperator.LESS_THAN.name())) { return Long.parseLong(tempVal) > Long.parseLong(prevVal); } else if (prevOperator.equals(BLCOperator.LESS_THAN.name()) && tempOperator.equals(BLCOperator.GREATER_THAN.name())) { return Long.parseLong(prevVal) > Long.parseLong(tempVal); } return false; } catch (NumberFormatException e) { LOG.warn(String.format("Used string values in expression %s %s && %s %s", prevOperator, prevVal, tempOperator, tempVal)); return false; } }
Source:
<code>public void badMultiService() { assert_().about(javaSources()) .that(Arrays.asList( <START> JavaFileObjects.forResource("test/SomeService.java"), <END> JavaFileObjects.forResource("test/BadMultiServiceProvider.java"), JavaFileObjects.forResource("test/AnotherService.java"))) .processedWith(new AutoServiceProcessor()) .failsToCompile() .withErrorContaining(MISSING_SERVICES_ERROR); }</code><technical_language>remove SomeService AnotherService, BadMultiServiceProvider implement anything</technical_language>

Target:
public void badMultiService() { assertThat(JavaFileObjects.forResource("test/NoServices.java")) .processedWith(new AutoServiceProcessor()) .failsToCompile() .withErrorContaining(MISSING_SERVICES_ERROR); }
Source:
<code><START> private void lazyInit() { <END> if (!initialized) { synchronized (this) { if (!initialized) { try { String ravenFactory = Lookup.lookup("ravenFactory"); if (ravenFactory != null) { setRavenFactory(ravenFactory); } String release = Lookup.lookup("release"); if (release != null) { setRelease(release); } String environment = Lookup.lookup("environment"); if (environment != null) { setEnvironment(environment); } String serverName = Lookup.lookup("serverName"); if (serverName != null) { setServerName(serverName); } String tags = Lookup.lookup("tags"); if (tags != null) { setTags(tags); } String extraTags = Lookup.lookup("extraTags"); if (extraTags != null) { setExtraTags(extraTags); } } finally { initialized = true; } } } } }</code><technical_language>this part of called initRaven? (I closely.)</technical_language>

Target:
private void lazyInit() { if (raven == null) { initRaven(); } if (!initialized) { synchronized (this) { if (!initialized) { try { String ravenFactory = Lookup.lookup("ravenFactory"); if (ravenFactory != null) { setRavenFactory(ravenFactory); } String release = Lookup.lookup("release"); if (release != null) { setRelease(release); } String environment = Lookup.lookup("environment"); if (environment != null) { setEnvironment(environment); } String serverName = Lookup.lookup("serverName"); if (serverName != null) { setServerName(serverName); } String tags = Lookup.lookup("tags"); if (tags != null) { setTags(tags); } String extraTags = Lookup.lookup("extraTags"); if (extraTags != null) { setExtraTags(extraTags); } } finally { initialized = true; } } } } }
Source:
<code>public boolean isAppPageview( String uriPath, String uriQuery, String contentType, String userAgent, String rawXAnalyticsHeader ) { final String appContentType = "application/json"; final String appUserAgent = "WikipediaApp"; final String appPageURIQuery = "sections=0"; final String iosAppPageURIQuery = "sections=all"; final String iosUserAgent = "iPhone"; Webrequest wr = Webrequest.getInstance(); if (!wr.getXAnalyticsValue(rawXAnalyticsHeader,"pageview").isEmpty()) return true; <START> if (!wr.getXAnalyticsValue(rawXAnalyticsHeader,"preview").isEmpty()) <END> return false; return ( Utilities.stringContains(uriPath, uriPathAPI) && ( Utilities.stringContains(uriQuery, appPageURIQuery) || (Utilities.stringContains(uriQuery, iosAppPageURIQuery) && Utilities.stringContains(userAgent, iosUserAgent)) ) && Utilities.stringContains(contentType, appContentType) && Utilities.stringContains(userAgent, appUserAgent) ); }</code><technical_language>this check precedence pageview check. more natural for clients understand, if is tagged preview preview matter what</technical_language>

Target:
public boolean isAppPageview( String uriPath, String uriQuery, String contentType, String userAgent, String rawXAnalyticsHeader ) { final String appContentType = "application/json"; final String appUserAgent = "WikipediaApp"; final String appPageURIQuery = "sections=0"; final String iosAppPageURIQuery = "sections=all"; final String iosUserAgent = "iPhone"; Webrequest wr = Webrequest.getInstance(); if (wr.getXAnalyticsValue(rawXAnalyticsHeader,"preview").trim().equalsIgnoreCase("1")) return false; if (wr.getXAnalyticsValue(rawXAnalyticsHeader,"pageview").trim().equalsIgnoreCase("1")) return true; return ( Utilities.stringContains(uriPath, uriPathAPI) && ( Utilities.stringContains(uriQuery, appPageURIQuery) || (Utilities.stringContains(uriQuery, iosAppPageURIQuery) && Utilities.stringContains(userAgent, iosUserAgent)) ) && Utilities.stringContains(contentType, appContentType) && Utilities.stringContains(userAgent, appUserAgent) ); }
Source:
<code>private void reset(final User player, final CommandSource sender) throws MaxMoneyException { BigDecimal startingBalance = ess.getSettings().getStartingBalance(); player.setMoney(startingBalance, UserBalanceUpdateEvent.Cause.COMMAND_ECO); <START> player.sendMessage(tl("resetBalSelf", startingBalance.toString())); <END> if(sender != null) { sender.sendMessage(tl("resetBalOther", player.getDisplayName(), startingBalance.toString())); } }</code><technical_language>NumberUtil::displayCurrency</technical_language>

Target:
private void reset(final User player, final CommandSource sender) throws MaxMoneyException { BigDecimal startingBalance = ess.getSettings().getStartingBalance(); player.setMoney(startingBalance, UserBalanceUpdateEvent.Cause.COMMAND_ECO); player.sendMessage(tl("resetBalSelf", NumberUtil.displayCurrency(startingBalance, ess))); if(sender != null) { sender.sendMessage(tl("resetBalOther", player.getDisplayName(), NumberUtil.displayCurrency(startingBalance, ess))); } }
Source:
<code>public OpenSslClientContext(File certChainFile, <START> TrustManagerFactory trustManagerFactory) throws SSLException { <END> this(certChainFile, trustManagerFactory, null, null, null, null, null, IdentityCipherSuiteFilter.INSTANCE, null, 0, 0, KeyStore.getDefaultType()); }</code><technical_language>revert please</technical_language>

Target:
public OpenSslClientContext(File certChainFile, TrustManagerFactory trustManagerFactory) throws SSLException { this(certChainFile, trustManagerFactory, null, null, null, null, null, IdentityCipherSuiteFilter.INSTANCE, null, 0, 0); }
Source:
<code>public void testNoInput() { <START> List<Object> booleanList = new ArrayList<>(); <END> assertCount(ImmutableList.of(), 0, 0); }</code><technical_language>unused variable</technical_language>

Target:
public void testNoInput() { assertCount(ImmutableList.of(), 0, 0); }
Source:
<code>private List<Key> formsOfSurvey(DatastoreService ds, Long qId) { <START> final Query optq = new Query("Survey").setFilter(new Query.FilterPredicate("surveyGroupId", FilterOperator.EQUAL, qId)); <END> final PreparedQuery pqopt = ds.prepare(optq); List<Key> result = new ArrayList<>(); for (Entity qa : pqopt.asIterable(FetchOptions.Builder.withChunkSize(500))) { result.add(qa.getKey()); } return result; }</code><technical_language>needs keys need return entire entities</technical_language>

Target:
private List<Key> formsOfSurvey(DatastoreService ds, Long qId) { final Query optq = new Query("Survey") .setFilter(new Query.FilterPredicate("surveyGroupId", FilterOperator.EQUAL, qId)) .setKeysOnly(); final PreparedQuery pqopt = ds.prepare(optq); List<Key> result = new ArrayList<>(); for (Entity qa : pqopt.asIterable(FetchOptions.Builder.withChunkSize(500))) { result.add(qa.getKey()); } return result; }
Source:
<code>private static void executeRunForRunnerClass(Class<?> runnerClass, String runMethodName, String[] runMethodArgs) { Method runMethod; try { runMethod = runnerClass.getDeclaredMethod(runMethodName, String[].class); } catch (NoSuchMethodException e) { throw new SamzaException(String.format("Isolation was enabled, but unable to find %s method", runMethodName), e); } runMethod.setAccessible(true); try { runMethod.invoke(null, new Object[]{runMethodArgs}); } catch (IllegalAccessException | InvocationTargetException e) { <START> throw new SamzaException("Exception while executing runClusterBasedJobCoordinator method", e); <END> } }</code><technical_language>Minor: please update method name in log message</technical_language>

Target:
private static void executeRunForRunnerClass(Class<?> runnerClass, String runMethodName, String[] runMethodArgs) { Method runMethod; try { runMethod = runnerClass.getDeclaredMethod(runMethodName, String[].class); } catch (NoSuchMethodException e) { throw new SamzaException(String.format("Isolation was enabled, but unable to find %s method", runMethodName), e); } runMethod.setAccessible(true); try { runMethod.invoke(null, new Object[]{runMethodArgs}); } catch (IllegalAccessException | InvocationTargetException e) { throw new SamzaException(String.format("Exception while executing %s method", runMethodName), e); } }
Source:
<code>public Set<Workflow> getWorkflowTypes() throws DtgovUiException { checkAuthorization(); Configuration dtgov_ui_conf = config.getConfiguration(); SrampAtomApiClient client = _srampClientAccessor.getClient(); <START> Set<Workflow> workflows = new HashSet<Workflow>(); <END> try { QueryResultSet results = client.buildQuery(SRAMP_WORKFLOW_QUERY) .parameter((String) dtgov_ui_conf.getProperty(WORKFLOW_ARTIFACT_GROUP_KEY)) .parameter((String) dtgov_ui_conf.getProperty(WORKFLOW_ARTIFACT_NAME_KEY)) .parameter((String) dtgov_ui_conf.getProperty(WORKFLOW_ARTIFACT_VERSION_KEY)).query(); if (results != null && results.iterator() != null) { Iterator<ArtifactSummary> results_iterator = results.iterator(); while (results_iterator.hasNext()) { ArtifactSummary artifact = results_iterator.next(); String name = artifact.getName().substring(0, artifact.getName().lastIndexOf(".")); Workflow workflow = new Workflow(); workflow.setUuid(artifact.getUuid()); workflow.setName(name); workflows.add(workflow); } } } catch (SrampClientException e) { throw new DtgovUiException(e.getMessage()); } catch (SrampAtomException e) { throw new DtgovUiException(e.getMessage()); } return workflows; }</code><technical_language>switch this Set List? losing sort order here. 'getWorkflowTypes()' method signature: public List<Workflow> getWorkflowTypes() throws DtgovUiException;</technical_language>

Target:
public List<Workflow> getWorkflowTypes() throws DtgovUiException { checkAuthorization(); Configuration dtgov_ui_conf = config.getConfiguration(); SrampAtomApiClient client = _srampClientAccessor.getClient(); List<Workflow> workflows = new ArrayList<Workflow>(); try { QueryResultSet results = client.buildQuery(SRAMP_WORKFLOW_QUERY) .parameter((String) dtgov_ui_conf.getProperty(WORKFLOW_ARTIFACT_GROUP_KEY)) .parameter((String) dtgov_ui_conf.getProperty(WORKFLOW_ARTIFACT_NAME_KEY)) .parameter((String) dtgov_ui_conf.getProperty(WORKFLOW_ARTIFACT_VERSION_KEY)).query(); if (results != null && results.iterator() != null) { Iterator<ArtifactSummary> results_iterator = results.iterator(); while (results_iterator.hasNext()) { ArtifactSummary artifact = results_iterator.next(); String name = artifact.getName().substring(0, artifact.getName().lastIndexOf(".")); Workflow workflow = new Workflow(); workflow.setUuid(artifact.getUuid()); workflow.setName(name); workflows.add(workflow); } } } catch (SrampClientException e) { throw new DtgovUiException(e.getMessage()); } catch (SrampAtomException e) { throw new DtgovUiException(e.getMessage()); } return workflows; }