auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void visitToken(DetailAST ast) { final DetailAST defaultGroupAST = ast.getParent(); if (ast.getPreviousSibling() != null) { <START> TOKEN_TYPE.add(ast.getPreviousSibling().getType()); <END> } if (ast.getNextSibling() != null) { TOKEN_TYPE.add(ast.getNextSibling().getType()); } if (defaultGroupAST.getType() != TokenTypes.ANNOTATION_FIELD_DEF && defaultGroupAST.getType() != TokenTypes.MODIFIERS) { final DetailAST switchAST = defaultGroupAST.getParent(); final DetailAST lastGroupAST = switchAST.getLastChild().getPreviousSibling(); if (!TOKEN_TYPE.contains(TokenTypes.LITERAL_CASE) && (defaultGroupAST.getLineNo() != lastGroupAST.getLineNo() || defaultGroupAST.getColumnNo() != lastGroupAST.getColumnNo())) { log(ast, MSG_KEY); } } }</code><technical_language>do alot of adding removes clears. If run this multiple files, this list bigger bigger end in sight lead false handling. is clear need this field get tokens line 94</technical_language>

Target:
public void visitToken(DetailAST ast) { final DetailAST defaultGroupAST = ast.getParent(); if (defaultGroupAST.getType() != TokenTypes.ANNOTATION_FIELD_DEF && defaultGroupAST.getType() != TokenTypes.MODIFIERS) { if (skipIfLastAndSharedWithCase) { if (Objects.nonNull(findNextSibling(ast, TokenTypes.LITERAL_CASE))) { log(ast, MSG_KEY_SKIP_IF_LAST_AND_SHARED_WITH_CASE); } else if (ast.getPreviousSibling() == null && Objects.nonNull(findNextSibling(defaultGroupAST, TokenTypes.CASE_GROUP))) { log(ast, MSG_KEY); } } else if (Objects.nonNull(findNextSibling(defaultGroupAST, TokenTypes.CASE_GROUP))) { log(ast, MSG_KEY); } } }
Source:
<code>private boolean isCEditor(IWorkbenchPartReference ref) { if (ref == null) return false; String id= ref.getId(); if (CUIPlugin.EDITOR_ID.equals(id)) return true; IWorkbenchPart part = ref.getPart(false); if (part instanceof CEditor) return true; if (part instanceof IEditorPart) <START> return part.getAdapter(ITranslationUnitProvider.class) != null; <END> return false; }</code><technical_language>Instead of introducing a new ITranslationUnitProvider interface, simpler get editor's input check if is instance of ITranslationUnitEditorInput</technical_language>

Target:
private boolean isCEditor(IWorkbenchPartReference ref) { if (ref == null) return false; String id= ref.getId(); if (CUIPlugin.EDITOR_ID.equals(id)) return true; IWorkbenchPart part = ref.getPart(false); if (part instanceof CEditor) return true; if (part instanceof IEditorPart) return part.getAdapter(ITranslationUnitHolder.class) != null; return false; }
Source:
<code>public void testOrdering() throws Exception { final String xpath = "( final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); for (int i = 1; i < actual.length; i++) { <START> if (actual[i].getLineNo() < actual[i - 1].getLineNo()) { <END> fail("Line number is not in document order"); } if (actual[i].getLineNo() == actual[i - 1].getLineNo() && actual[i].getColumnNo() < actual[i - 1].getColumnNo()) { fail("Column number is not in document order"); } } }</code><technical_language>DetailAST current = actual[i] DetailAST previous = actual[i - 1] this simplify code</technical_language>

Target:
public void testOrdering() throws Exception { final String xpath = "( final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); for (int i = 1; i < actual.length; i++) { final DetailAST current = actual[i]; final DetailAST previous = actual[i - 1]; assertWithMessage("Line number is not in document order") .that(previous.getLineNo()) .isGreaterThan(current.getLineNo()); if (current.getLineNo() == previous.getLineNo()) { assertWithMessage("Column number is not in document order") .that(previous.getColumnNo()) .isLessThan(current.getColumnNo()); } } }
Source:
<code>public AbstractResponse getErrorResponse(int throttleTimeMs, Throwable throwable) { ApiError error = ApiError.fromThrowable(throwable); DescribeAclsResponseData response = new DescribeAclsResponseData() .setThrottleTimeMs(throttleTimeMs) .setErrorCode(error.error().code()) .setErrorMessage(error.message()) <START> .setResources(Collections.emptyList()); <END> return new DescribeAclsResponse(response); }</code><technical_language>This is necessary, right</technical_language>

Target:
public AbstractResponse getErrorResponse(int throttleTimeMs, Throwable throwable) { ApiError error = ApiError.fromThrowable(throwable); DescribeAclsResponseData response = new DescribeAclsResponseData() .setThrottleTimeMs(throttleTimeMs) .setErrorCode(error.error().code()) .setErrorMessage(error.message()); return new DescribeAclsResponse(response); }
Source:
<code>private Process launch() throws IOException { StringBuilder command=new StringBuilder(12+arguments.size()*8); <START> command.append("raspistill "); <END> for(Entry<String, String> entry:this.arguments.entrySet()) { command.append(entry.getKey()).append(" "); if(entry.getValue()!=null) { command.append(entry.getValue()).append(" "); } } if (command.length() == 0) throw new IllegalArgumentException("Empty command"); StringTokenizer st = new StringTokenizer(command.toString()); String[] cmdarray = new String[st.countTokens()]; for (int i = 0; st.hasMoreTokens(); i++) cmdarray[i] = st.nextToken(); return new ProcessBuilder(cmdarray) .directory(new File(".")) .redirectErrorStream(true) .start(); }</code><technical_language>raspistill extracted a constant is called couple times</technical_language>

Target:
private Process launch() throws IOException { StringBuilder command=new StringBuilder(12+arguments.size()*8); command.append("raspistill "); for(Entry<String, String> entry:this.arguments.entrySet()) { command.append("--").append(entry.getKey()).append(" "); if(entry.getValue()!=null) { command.append(entry.getValue()).append(" "); } } if (command.length() == 0) throw new IllegalArgumentException("Empty command"); String commandString=command.toString(); if(LOGGER.isDebugEnabled()) { LOGGER.debug("final raspistill command: {}", commandString); } StringTokenizer st = new StringTokenizer(commandString); String[] cmdarray = new String[st.countTokens()]; for (int i = 0; st.hasMoreTokens(); i++) cmdarray[i] = st.nextToken(); return new ProcessBuilder(cmdarray) .directory(new File(".")) .redirectErrorStream(true) .start(); }
Source:
<code>private static RelayMap convertStringsToRelayMap(final String relayMapString) { final String[] fields = relayMapString.split(","); final RelayType relayType = RelayType.valueOf(fields[2]); <START> return new RelayMap(Integer.parseInt(fields[0]), Integer.parseInt(fields[1]), relayType, null); <END> }</code><technical_language>give relayType variable rcIndex rcIntern not? is safe parse a String Int a try / catch</technical_language>

Target:
private static RelayMap convertStringsToRelayMap(final String relayMapString) { final String[] fields = relayMapString.split(","); return new RelayMap(Integer.parseInt(fields[0]), Integer.parseInt(fields[1]), RelayType.valueOf(fields[2]), null); }
Source:
<code>Resources getResourcesForSubId(@NonNull final Context c, final int subId) { <START> return SubscriptionManager.getResourcesForSubId(c, subId); <END> }</code><technical_language>{ final TelephonyManager tm = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); final String mccmnc = tm.getSimOperator(); final String gid1 = tm.getGroupIdLevel1(); final Resources res = SubscriptionManager.getResourcesForSubId(c, subId); if (mccmnc.equals("20404") && gid1.equals("BAE0000000000000")) { final Configuration config = res.getConfiguration(); config.mcc = // verizon mcc mnc return mContext.createConfigurationContext(config); } else { return res; } }</technical_language>

Target:
Resources getResourcesForSubId(@NonNull final Context c, final int subId) { final Resources res = SubscriptionManager.getResourcesForSubId(c, subId); if (isSpecificRoamingMccMnc()) { final Configuration config = res.getConfiguration(); config.mcc = 311; config.mnc = 480; return mContext.createConfigurationContext(config).getResources(); } return res; }
Source:
<code>public static int setKey(RowKeySchema schema, List<List<KeyRange>> slots, int[] position, Bound bound, byte[] key, int byteOffset, int slotStartIndex, int slotEndIndex) { int offset = byteOffset; boolean incrementKey = bound == Bound.UPPER; boolean incrementAtEnd = false; for (int i = slotStartIndex; i < slotEndIndex; i++) { KeyRange range = slots.get(i).get(position[i]); boolean isFixedWidth = schema.getField(i).getType().isFixedWidth(); if ( range.isUnbound(bound) && ( bound == Bound.UPPER || isFixedWidth) ){ break; } incrementKey = (!range.isInclusive(bound) && bound == Bound.LOWER) || (range.isSingleKey() && range.isInclusive(bound) && bound == Bound.UPPER); incrementAtEnd = incrementAtEnd || (!range.isSingleKey() && range.isInclusive(bound) && bound == Bound.UPPER); byte[] bytes = range.getRange(bound); System.arraycopy(bytes, 0, key, offset, bytes.length); <START> offset += bytes.length; <END> if (i < schema.getMaxFields()-1 && !isFixedWidth) { key[offset++] = QueryConstants.SEPARATOR_BYTE; } if (!range.isSingleKey() && incrementKey) { if (!ByteUtil.nextKey(key, offset)) { return -byteOffset; } incrementKey = false; } } if (incrementAtEnd || incrementKey) { if (!ByteUtil.nextKey(key, offset)) { return -byteOffset; } } return offset - byteOffset; }</code><technical_language>Do need !range.isSingleKey() condition in if nextKey? simplify statement for setting incrementKey incrementAtEnd? If incrementKey above, do incrementAtEnd? get situations increment key in loop immediately end of loop (essentially incrementing twice)? set incrementKeyAtEnd false below</technical_language>

Target:
public static int setKey(RowKeySchema schema, List<List<KeyRange>> slots, int[] position, Bound bound, byte[] key, int byteOffset, int slotStartIndex, int slotEndIndex) { int offset = byteOffset; boolean singleInclusiveUpperKeyAtEnd = false; boolean rangeExclusiveUpperKey = false; boolean isFixedWidth = false; for (int i = slotStartIndex; i < slotEndIndex; i++) { KeyRange range = slots.get(i).get(position[i]); isFixedWidth = schema.getField(i).getType().isFixedWidth(); if ( range.isUnbound(bound) && ( bound == Bound.UPPER || isFixedWidth) ){ break; } singleInclusiveUpperKeyAtEnd = range.isSingleKey() && range.isInclusive(bound) && bound == Bound.UPPER; rangeExclusiveUpperKey = rangeExclusiveUpperKey || (!range.isSingleKey() && range.isInclusive(bound) && bound == Bound.UPPER); byte[] bytes = range.getRange(bound); System.arraycopy(bytes, 0, key, offset, bytes.length); offset += bytes.length; if (i < schema.getMaxFields()-1 && !isFixedWidth) { key[offset++] = QueryConstants.SEPARATOR_BYTE; } if (!range.isSingleKey() && !range.isInclusive(bound) && bound == Bound.LOWER) { if (!ByteUtil.nextKey(key, offset)) { return -byteOffset; } } } if (singleInclusiveUpperKeyAtEnd || rangeExclusiveUpperKey) { if (!ByteUtil.nextKey(key, offset)) { return -byteOffset; } } return offset - byteOffset; }
Source:
<code>private List<String> determineContentStatus(DocumentIndexingPackage dip) throws IndexingException { List<String> status = new ArrayList<>(); ContentObject obj = dip.getContentObject(); Resource resc = obj.getResource(); if (resc.hasProperty(Cdr.hasMods)) { status.add(FacetConstants.CONTENT_DESCRIBED); } else { status.add(FacetConstants.CONTENT_NOT_DESCRIBED); } if (resc.hasProperty(Cdr.invalidTerm)) { status.add(FacetConstants.INVALID_VOCAB_TERM); } if (obj instanceof WorkObject) { <START> if (((WorkObject) obj).getPrimaryObject() == null) { <END> status.add(FacetConstants.NO_PRIMARY_OBJECT); } } if (resc.hasProperty(Cdr.unpublished)) { status.add(FacetConstants.UNPUBLISHED); } return status; }</code><technical_language>decide if do a resc.hasProperty(Cdr.primaryObject) stick this. nice able api this kind of determination put implementation details here. other hand, getPrimaryObject is retrieving primary object fedora. matter of planned caching changes object cached other filters need primary object. this is fine, do think</technical_language>

Target:
private List<String> determineContentStatus(DocumentIndexingPackage dip) throws IndexingException { List<String> status = new ArrayList<>(); ContentObject obj = dip.getContentObject(); Resource resc = obj.getResource(); if (resc.hasProperty(Cdr.hasMods)) { status.add(FacetConstants.CONTENT_DESCRIBED); } else { status.add(FacetConstants.CONTENT_NOT_DESCRIBED); } if (resc.hasProperty(Cdr.invalidTerm)) { status.add(FacetConstants.INVALID_VOCAB_TERM); } if (obj instanceof WorkObject) { if (!resc.hasProperty(Cdr.primaryObject)) { status.add(FacetConstants.NO_PRIMARY_OBJECT); } } if (resc.hasProperty(Cdr.unpublished)) { status.add(FacetConstants.UNPUBLISHED); } return status; }
Source:
<code>public void compactInternally() { if (config.enableOracleEnterpriseFeatures()) { try { conns.get().executeUnregisteredQuery( "ALTER TABLE " + oracleTableNameGetter.getInternalShortTableName(conns, tableRef) + " MOVE ONLINE"); } catch (PalantirSqlException e) { log.error("Tried to clean up bloat after a sweep operation," + " but underlying Oracle database or configuration does not support this" + " (Enterprise Edition that requires this user to be able to perform DDL operations)" + " feature online. Since this can't be automated in your configuration," + " good practice would be do to occasional offline manual maintenance of rebuilding" + " IOT tables to compensate for bloat. You can contact Palantir Support if you'd" <START> + " like more information. Underlying error was: {}", tableRef, e.getMessage()); <END> } catch (TableMappingNotFoundException e) { throw new RuntimeException(e); } } else if (config.enableShrinkOnOracleStandardEdition()) { oracleShrinkExecutor.shrinkAsync(tableRef); } }</code><technical_language>look, some SafeArgs :)</technical_language>

Target:
public void compactInternally() { if (config.enableOracleEnterpriseFeatures()) { try { conns.get().executeUnregisteredQuery( "ALTER TABLE " + oracleTableNameGetter.getInternalShortTableName(conns, tableRef) + " MOVE ONLINE"); } catch (PalantirSqlException e) { log.error("Tried to clean up bloat after a sweep operation," + " but underlying Oracle database or configuration does not support this" + " (Enterprise Edition that requires this user to be able to perform DDL operations)" + " feature online. Since this can't be automated in your configuration," + " good practice would be do to occasional offline manual maintenance of rebuilding" + " IOT tables to compensate for bloat. You can contact Palantir Support if you'd" + " like more information. Underlying error was: {}", LoggingArgs.tableRef(tableRef), UnsafeArg.of("exception message", e.getMessage())); } catch (TableMappingNotFoundException e) { throw new RuntimeException(e); } } else if (config.shrinkConfig().enableShrinkOnOracleStandardEdition()) { oracleShrinkExecutor.shrinkAsync(tableRef); } }
Source:
<code>public ValidationResult validate(ConfigKey key, String value) { if (StringUtils.isBlank(value)) { return new ValidationResult(false, "The MAC address range cannot be empty."); } String[] ranges = value.split("[,]", -1); for (String range : ranges) { String[] rangeParts = range.split("[-]", -1); if (rangeParts.length == 2) { String rangeStart = rangeParts[0].toLowerCase(); String rangeEnd = rangeParts[1].toLowerCase(); <START> if (!validateRangePart(rangeStart) || !validateRangePart(rangeEnd) <END> || rangeStart.compareTo(rangeEnd) > 0) { return new ValidationResult(false, "The entered range is invalid. " + StringUtils.join(rangeParts, '-') + " should be in a format of AA:AA:AA:AA:AA:AA-BB:BB:BB:BB:BB:BB,..."); } } else { return new ValidationResult(false, "The entered value is in imporper format. " + value + " should be in a format of AA:AA:AA:AA:AA:AA-BB:BB:BB:BB:BB:BB,..."); } } return new ValidationResult(true); }</code><technical_language>differentiate cases user part is invalid, end MAC greater start MAC</technical_language>

Target:
public ValidationResult validate(ConfigKey key, String value) { if (StringUtils.isBlank(value)) { return new ValidationResult(false, "The MAC address range cannot be empty."); } String[] ranges = value.split(","); for (String range : ranges) { String[] rangeParts = range.split("-"); if (rangeParts.length == 2) { String rangeStart = rangeParts[0].toLowerCase(); String rangeEnd = rangeParts[1].toLowerCase(); if (!validateRangePart(rangeStart) || !validateRangePart(rangeEnd) || rangeStart.compareTo(rangeEnd) > 0) { return new ValidationResult(false, "The entered range is invalid. " + StringUtils.join(rangeParts, '-') + " should be in a format of AA:AA:AA:AA:AA:AA-BB:BB:BB:BB:BB:BB,..."); } } else { return new ValidationResult(false, "The entered value is in imporper format. " + value + " should be in a format of AA:AA:AA:AA:AA:AA-BB:BB:BB:BB:BB:BB,..."); } } return new ValidationResult(true); }
Source:
<code>public CommandResult exec(ContextAwareCommandInvocation invocation) { if (help) { invocation.println(invocation.getHelpInfo()); } CommandInputLine cmd = new CommandInputLine(Shutdown.CMD) .arg(TYPE, Shutdown.Cluster.CMD); <START> return invocation.execute(Collections.singletonList(cmd)); <END> }</code><technical_language>do need a Collections.singletonList(cmd) here</technical_language>

Target:
public CommandResult exec(ContextAwareCommandInvocation invocation) { if (help) { invocation.println(invocation.getHelpInfo()); } CommandInputLine cmd = new CommandInputLine(Shutdown.CMD) .arg(TYPE, Shutdown.Cluster.CMD); return invocation.execute(cmd); }
Source:
<code>public Object apply(RevisionResource resource) throws AuthException, <START> BadRequestException, ResourceConflictException, Exception { <END> PatchSet basePatchSet = null; if (base != null) { RevisionResource baseResource = revisions.get().parse( resource.getChangeResource(), IdString.fromUrl(base)); basePatchSet = baseResource.getPatchSet(); } return fileInfoJson.toFileInfoMap( resource.getChange(), resource.getPatchSet(), basePatchSet); }</code><technical_language>drop Exception throw explicit names, drop other names throw Exception. do both. :-)</technical_language>

Target:
public Object apply(RevisionResource resource) throws ResourceNotFoundException, OrmException, PatchListNotAvailableException { PatchSet basePatchSet = null; if (base != null) { RevisionResource baseResource = revisions.get().parse( resource.getChangeResource(), IdString.fromDecoded(base)); basePatchSet = baseResource.getPatchSet(); } return fileInfoJson.toFileInfoMap( resource.getChange(), resource.getPatchSet(), basePatchSet); }
Source:
<code>public Map toMap() { <START> Set<String> instanceVariableNames = ReflectionHelper.getFieldNamesToTypes(this).keySet(); <END> Map<String, Object> result = new HashMap<>(); for(String name : instanceVariableNames) { try { result.put(name, ReflectionHelper.invokeGetter(name, this)); } catch (NoSuchMethodException|InvocationTargetException|IllegalAccessException e) { throw new StorageException(e); } } return result; }</code><technical_language>fieldNames</technical_language>

Target:
public Map<String, Object> toMap() { Set<String> instanceVariableNames = ReflectionHelper.getFieldNamesToTypes(this).keySet(); Map<String, Object> fieldToVal = new HashMap<>(); for(String fieldName : instanceVariableNames) { try { Object val = ReflectionHelper.invokeGetter(fieldName, this); fieldToVal.put(fieldName, val); if(LOG.isTraceEnabled()) { LOG.trace("toMap: Adding fieldName = ", fieldName, val); } } catch (NoSuchMethodException|InvocationTargetException|IllegalAccessException e) { throw new StorageException(e); } } return fieldToVal; }
Source:
<code>public StringBuilder GetTagNameAndChildrenNames() { StringBuilder builder = new StringBuilder(); builder.append(StringFormat.format("'%1$s'", gettag_name())); for (tags tag : _children) { <START> builder.append("," + tag.GetTagNameAndChildrenNames()); <END> } return builder; }</code><technical_language>builder.append(",").append(tag.GetTagNameAndChildrenNames());</technical_language>

Target:
public StringBuilder GetTagNameAndChildrenNames() { StringBuilder builder = new StringBuilder(); builder.append("'").append(gettag_name()).append("'"); for (tags tag : _children) { builder.append("," + tag.GetTagNameAndChildrenNames()); } return builder; }
Source:
<code>protected String getEntityVersionLabel(String separator) { return elvis(entity.getClass().getSimpleName(), <START> entity.getClass().getName())+(!getVersion().equals(NO_VERSION_INFO) ? separator+getVersion() : ""); <END> }</code><technical_language>getVersion return null</technical_language>

Target:
protected String getEntityVersionLabel(String separator) { return elvis(entity.getClass().getSimpleName(), entity.getClass().getName())+(!NO_VERSION_INFO.equals(getVersion()) ? separator+getVersion() : ""); }
Source:
<code>public void remove() { <START> bitSet.clear(index); <END> }</code><technical_language>slightly effective, delegate PartitionIdSet.remove here, ImmutablePartitionIdSet iterator immutable well</technical_language>

Target:
public void remove() { PartitionIdSet.this.remove(index); }
Source:
<code>public ViatraQueryEngineImpl(ViatraQueryEngineManager manager, QueryScope scope, ViatraQueryEngineOptions engineOptions) throws ViatraQueryException { super(); this.manager = manager; this.scope = scope; this.lifecycleProvider = new LifecycleProvider(this, getLogger()); this.modelUpdateProvider = new ModelUpdateProvider(this, getLogger()); this.engineContext = scope.createEngineContext(this, taintListener, getLogger()); <START> if (engineOptions != null){ <END> QueryEvaluationHint engineOptionsDefaultHints = engineOptions.getEngineDefaultHints(); if (engineOptionsDefaultHints != null && engineOptionsDefaultHints.getQueryBackendFactory() != null){ this.engineDefaultHint = new QueryEvaluationHint(engineOptionsDefaultHints.getQueryBackendFactory(), ImmutableMap.copyOf(engineOptionsDefaultHints.getBackendHints())); }else{ this.engineDefaultHint = new QueryEvaluationHint(new ReteBackendFactory(), Collections.<String, Object>emptyMap()); } if (engineOptions.getDefaultCachingBackendFactory() != null){ this.defaultCachingBackendFactory = engineOptions.getDefaultCachingBackendFactory(); }else{ this.defaultCachingBackendFactory = new ReteBackendFactory(); } }else{ this.engineDefaultHint = new QueryEvaluationHint(new ReteBackendFactory(), Collections.<String, Object>emptyMap());; this.defaultCachingBackendFactory = new ReteBackendFactory(); } }</code><technical_language>if (a) a default implementation of EngineOptions contains defaults, reuse them. (b) EngineOptions immutable, similar BaseIndexOptions</technical_language>

Target:
public ViatraQueryEngineImpl(ViatraQueryEngineManager manager, QueryScope scope, ViatraQueryEngineOptions engineOptions) throws ViatraQueryException { super(); this.manager = manager; this.scope = scope; this.lifecycleProvider = new LifecycleProvider(this, getLogger()); this.modelUpdateProvider = new ModelUpdateProvider(this, getLogger()); this.engineContext = scope.createEngineContext(this, taintListener, getLogger()); if (engineOptions != null){ this.engineOptions = engineOptions; }else{ this.engineOptions = new ViatraQueryEngineOptions( new QueryEvaluationHint(new ReteBackendFactory(), Collections.<String, Object>emptyMap()), new ReteBackendFactory()); } }
Source:
<code>private Component createToolBar() { <START> JToolBar toolPanel = new JToolBar(); toolPanel.setFloatable(false); <END> this.toolbar = JMeterToolBar.createToolbar(true); GuiPackage guiInstance = GuiPackage.getInstance(); guiInstance.setMainToolbar(toolbar); toolPanel.add(toolbar); toolPanel.add(Box.createRigidArea(new Dimension(5, 15))); toolPanel.add(Box.createGlue()); toolPanel.add(testTimeDuration); toolPanel.add(Box.createRigidArea(new Dimension(5, 15))); toolPanel.add(warnIndicator); warnIndicator.setText("0"); toolPanel.add(Box.createRigidArea(new Dimension(5, 15))); toolPanel.add(activeAndTotalThreads); toolPanel.add(Box.createRigidArea(new Dimension(5, 15))); toolPanel.add(runningIndicator); return toolPanel; }</code><technical_language>Oh, this odd. However, a single toolbar is enough, work: java JMeterToolBar toolPanel = JMeterToolBar.createToolbar(true); this.toolbar = toolPanel; GuiPackage guiInstance = GuiPackage.getInstance(); guiInstance.setMainToolbar(toolbar); toolPanel.add(Box.createRigidArea(new Dimension(5, 15)));</technical_language>

Target:
private Component createToolBar() { JMeterToolBar toolPanel = JMeterToolBar.createToolbar(true); this.toolbar = toolPanel; GuiPackage guiInstance = GuiPackage.getInstance(); guiInstance.setMainToolbar(toolbar); toolPanel.add(Box.createRigidArea(new Dimension(5, 15))); toolPanel.add(Box.createGlue()); toolPanel.add(testTimeDuration); toolPanel.add(Box.createRigidArea(new Dimension(5, 15))); toolPanel.add(warnIndicator); warnIndicator.setText("0"); toolPanel.add(Box.createRigidArea(new Dimension(5, 15))); toolPanel.add(activeAndTotalThreads); toolPanel.add(Box.createRigidArea(new Dimension(5, 15))); toolPanel.add(runningIndicator); return toolPanel; }
Source:
<code>private static File processBitmapForSharing(final Context context, final Bitmap bmp, final String imageFileName, final boolean recycleBmp) { File dir = clearFolder(context); if (dir == null) { return null; } dir.mkdirs(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.JPEG, JPEG_QUALITY, bytes); if (recycleBmp) { bmp.recycle(); } File f = new File(dir, cleanFileName(imageFileName)); try { FileOutputStream fo = new FileOutputStream(f); fo.write(bytes.toByteArray()); fo.close(); } catch (IOException e) { <START> displayOnCatchMessage(e, context); <END> } return f; }</code><technical_language>code more generic Exception escape SaneAsyncTask handles Exceptions</technical_language>

Target:
private static File processBitmapForSharing(final Context context, final Bitmap bmp, final String imageFileName, final boolean recycleBmp) throws IOException { File dir = clearFolder(context); if (dir == null) { return null; } dir.mkdirs(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.JPEG, JPEG_QUALITY, bytes); if (recycleBmp) { bmp.recycle(); } File f = new File(dir, cleanFileName(imageFileName)); FileOutputStream fo = new FileOutputStream(f); fo.write(bytes.toByteArray()); fo.close(); return f; }
Source:
<code>private void buildEpisodeCleanupPreference() { final Resources res = ui.getActivity().getResources(); ListPreference pref = (ListPreference) ui.findPreference(UserPreferences.PREF_EPISODE_CLEANUP); String[] values = res.getStringArray( R.array.episode_cleanup_values); String[] entries = new String[values.length]; for (int x = 0; x < values.length; x++) { float v = Float.parseFloat(values[x]); <START> if (v == UserPreferences.EPISODE_CLEANUP_QUEUE) { <END> entries[x] = res.getString(R.string.episode_cleanup_queue_removal); } else if (v == UserPreferences.EPISODE_CLEANUP_NULL){ entries[x] = res.getString(R.string.episode_cleanup_never); } else if (v == 0) { entries[x] = res.getString(R.string.episode_cleanup_after_listening); } else if (v > 0 && v < 1) { int numHours = Converter.numberOfDaysFloatToNumberOfHours(v); entries[x] = res.getQuantityString(R.plurals.episode_cleanup_hours_after_listening, numHours, numHours); } else { int vInt = (int)v; entries[x] = res.getQuantityString(R.plurals.episode_cleanup_days_after_listening, vInt, vInt); } } pref.setEntries(entries); }</code><technical_language>if I cast 0.99999999...? ^^</technical_language>

Target:
private void buildEpisodeCleanupPreference() { final Resources res = ui.getActivity().getResources(); ListPreference pref = (ListPreference) ui.findPreference(UserPreferences.PREF_EPISODE_CLEANUP); String[] values = res.getStringArray( R.array.episode_cleanup_values); String[] entries = new String[values.length]; for (int x = 0; x < values.length; x++) { int v = Integer.parseInt(values[x]); if (v == UserPreferences.EPISODE_CLEANUP_QUEUE) { entries[x] = res.getString(R.string.episode_cleanup_queue_removal); } else if (v == UserPreferences.EPISODE_CLEANUP_NULL){ entries[x] = res.getString(R.string.episode_cleanup_never); } else if (v == 0) { entries[x] = res.getString(R.string.episode_cleanup_after_listening); } else if (v > 0 && v < 24) { entries[x] = res.getQuantityString(R.plurals.episode_cleanup_hours_after_listening, v, v); } else { int numDays = (int)(v / 24); entries[x] = res.getQuantityString(R.plurals.episode_cleanup_days_after_listening, numDays, numDays); } } pref.setEntries(entries); }
Source:
<code>public void onLivePacket(IMediaStream stream, AMFPacket packet) { final int DEFAULT_CODEC = -1; if (FLVUtils.isVideoKeyFrame(packet)) { WMSProperties properties = getConnectionProperties(stream); if(properties == null) return; String streamName = stream.getName(); String entryId = getEntryIdFromStreamName(streamName); if(entryId == null){ <START> logger.info("Stream [" + streamName + "] does not match entry id"); <END> return; } long pts = packet.getAbsTimecode(); int codec = properties.getPropertyInt(LiveStreamEntry.CLIENT_PROPERTY_CODEC_TYPE, DEFAULT_CODEC); if ((codec == IVHost.CODEC_VIDEO_H264 || codec == IVHost.CODEC_VIDEO_H265) && packet.getSize() >= 5) pts += BufferUtils.byteArrayToLong(packet.getData(), 2, 3); ILiveStreamManager liveManager = KalturaServer.getManager(ILiveStreamManager.class); Map<String, List<Long>> defaultValue = new HashMap<String, List<Long>>(); Map<String, List<Long>> streamsPtses = (Map<String, List<Long>>)liveManager.getMetadata(entryId, KNOWN_PTS, defaultValue); addPts(streamsPtses, streamName, pts); compareStreams(streamsPtses, streamName, pts); cleanOldPtses(streamsPtses, streamName, pts); } }</code><technical_language>this error</technical_language>

Target:
public void onLivePacket(IMediaStream stream, AMFPacket packet) { final int DEFAULT_CODEC = -1; if (FLVUtils.isVideoKeyFrame(packet)) { WMSProperties properties = getConnectionProperties(stream); if(properties == null) return; String streamName = stream.getName(); String entryId = getEntryIdFromStreamName(streamName); if(entryId == null){ logger.warn("Stream [" + streamName + "] does not match entry id"); return; } long pts = packet.getAbsTimecode(); int codec = properties.getPropertyInt(LiveStreamEntry.CLIENT_PROPERTY_CODEC_TYPE, DEFAULT_CODEC); if ((codec == IVHost.CODEC_VIDEO_H264 || codec == IVHost.CODEC_VIDEO_H265) && packet.getSize() >= 5) pts += BufferUtils.byteArrayToLong(packet.getData(), 2, 3); ILiveStreamManager liveManager = KalturaServer.getManager(ILiveStreamManager.class); Map<String, List<Long>> defaultValue = new HashMap<String, List<Long>>(); Map<String, List<Long>> streamsPtses = (Map<String, List<Long>>)liveManager.getOrAddMetadata(entryId, KNOWN_PTS, defaultValue); addPtsToStream(streamsPtses, streamName, pts); if(ptsAppearInAllStreams(streamsPtses, streamName, pts)) { removePtsFromStreams(streamsPtses, pts); } handleOldPtses(streamsPtses, streamName, pts); } }
Source:
<code>public void testMountNamespaces() throws Exception { final int rootMountIdOfInit = getMountEntry("1", "/").mountId; final int rootMountIdOfVold = getMountEntry("$(pidof vold)", "/").mountId; if (isApexUpdatable()) { <START> Assert.assertNotEquals(rootMountIdOfInit, <END> rootMountIdOfVold); } else { Assert.assertEquals(rootMountIdOfInit, rootMountIdOfVold); } }</code><technical_language>assertEquals(String message, int, int) message explain wrong (otherwise error message confusing)</technical_language>

Target:
public void testMountNamespaces() throws Exception { final int rootMountIdOfInit = getMountEntry("1", "/").mountId; final int rootMountIdOfVold = getMountEntry("$(pidof vold)", "/").mountId; if (isApexUpdatable()) { Assert.assertNotEquals("device supports updatable APEX, but is not using multiple mount namespaces", rootMountIdOfInit, rootMountIdOfVold); } else { Assert.assertEquals("device supports updatable APEX, but is using multiple mount namespaces", rootMountIdOfInit, rootMountIdOfVold); } }
Source:
<code>String getUsage() { <START> return "decommissionbookie [-bookieid <bookieaddress>]"; <END> }</code><technical_language>CMD_DECOMMISSIONBOOKIE + " [-bookieid <bookieaddress>]"</technical_language>

Target:
String getUsage() { return CMD_DECOMMISSIONBOOKIE + " [-bookieid <bookieaddress>]"; }
Source:
<code>public ITmfTrace getTrace() { ITmfProjectModelElement parent = getParent(); IResource resource = <START> getElementUnderTraceFolder().getResource(); <END> if (parent instanceof TmfExperimentElement) { return lookupExperimentTrace((TmfExperimentElement) parent, resource); } return lookupSingleTrace(resource); }</code><technical_language>This necessary in experiment trace branch</technical_language>

Target:
public ITmfTrace getTrace() { ITmfProjectModelElement parent = getParent(); if (parent instanceof TmfExperimentElement) { ITmfTrace parentTrace = ((TmfExperimentElement) parent).getTrace(); if (parentTrace == null) { return null; } for (ITmfEventProvider sibling : parentTrace.getChildren()) { if (sibling instanceof ITmfTrace) { ITmfTrace siblingTrace = (ITmfTrace) sibling; if (getElementUnderTraceFolder().getResource().equals(siblingTrace.getResource())) { return siblingTrace; } } } return null; } return super.getTrace(); }
Source:
<code><START> public void whenExceedMaxConsumersNumThen429() throws IOException, InterruptedException, ExecutionException, <END> TimeoutException { final String etName = NakadiTestUtils.createEventType().getName(); final List<CompletableFuture<Integer>> statusCodeFutures = range(0, 8) .mapToObj(x -> createConsumingConnection(etName)) .collect(Collectors.toList()); assertThat("first 5 connections should be accepted", countStatusCode(statusCodeFutures, HttpStatus.OK.value()), equalTo(5)); assertThat("last 3 connections should be rejected", countStatusCode(statusCodeFutures, HttpStatus.TOO_MANY_REQUESTS.value()), equalTo(3)); }</code><technical_language>@v-stepanov good a test case for a connection is closed. release slot</technical_language>

Target:
public void whenExceedMaxConsumersNumThen429() throws IOException, InterruptedException, ExecutionException, TimeoutException { final String etName = NakadiTestUtils.createEventType().getName(); final List<CompletableFuture<HttpURLConnection>> connectionFutures = range(0, 8) .mapToObj(x -> createConsumingConnection(etName)) .collect(Collectors.toList()); assertThat("first 5 connections should be accepted", countStatusCode(connectionFutures, HttpStatus.OK.value()), equalTo(5)); assertThat("last 3 connections should be rejected", countStatusCode(connectionFutures, HttpStatus.TOO_MANY_REQUESTS.value()), equalTo(3)); for (final CompletableFuture<HttpURLConnection> conn : connectionFutures) { if (conn.get().getResponseCode() == HttpStatus.OK.value()) { conn.get().disconnect(); break; } } Thread.sleep(1000); final List<CompletableFuture<HttpURLConnection>> moreConnectionFutures = range(0, 3) .mapToObj(x -> createConsumingConnection(etName)) .collect(Collectors.toList()); assertThat("one more connection should be accepted", countStatusCode(moreConnectionFutures, HttpStatus.OK.value()), equalTo(1)); assertThat("other 2 connections should be rejected as we had only one new free slot", countStatusCode(moreConnectionFutures, HttpStatus.TOO_MANY_REQUESTS.value()), equalTo(2)); }
Source:
<code>public void testLeastBytesUsedLocationSelectorStrategy() throws Exception { List<StorageLocation> storageLocations = new ArrayList<>(); final File localStorageFolder1 = tmpFolder.newFolder("local_storage_folder_1"); final File localStorageFolder2 = tmpFolder.newFolder("local_storage_folder_2"); final File localStorageFolder3 = tmpFolder.newFolder("local_storage_folder_3"); StorageLocation storageLocation1 = new StorageLocation(localStorageFolder1, 10000000000L, null); storageLocations.add(storageLocation1); storageLocations.add(new StorageLocation(localStorageFolder2, 10000000000L, null)); storageLocations.add(new StorageLocation(localStorageFolder3, 10000000000L, null)); StorageLocationSelectorStrategy leastBytesUsedStrategy = new LeastBytesUsedStorageLocationSelectorStrategy(storageLocations); storageLocation1.reserve("tmp_loc1", "__seg1", 1024L); Iterator<StorageLocation> locations = leastBytesUsedStrategy.getLocations(); StorageLocation loc1 = locations.next(); Assert.assertTrue("The next element of the iterator should point to path local_storage_folder_2", loc1.getPath().equals(localStorageFolder2)); StorageLocation loc2 = locations.next(); Assert.assertTrue("The next element of the iterator should point to path local_storage_folder_3", loc2.getPath().equals(localStorageFolder3)); StorageLocation loc3 = locations.next(); System.out.println(loc3); <START> Assert.assertTrue("The next element of the iterator should point to path local_storage_folder_3", <END> loc3.getPath().equals(localStorageFolder1)); }</code><technical_language>assertTrue()s simplified assertEquals()s</technical_language>

Target:
public void testLeastBytesUsedLocationSelectorStrategy() throws Exception { List<StorageLocation> storageLocations = new ArrayList<>(); final File localStorageFolder1 = tmpFolder.newFolder("local_storage_folder_1"); final File localStorageFolder2 = tmpFolder.newFolder("local_storage_folder_2"); final File localStorageFolder3 = tmpFolder.newFolder("local_storage_folder_3"); StorageLocation storageLocation1 = new StorageLocation(localStorageFolder1, 10000000000L, null); storageLocations.add(storageLocation1); storageLocations.add(new StorageLocation(localStorageFolder2, 10000000000L, null)); storageLocations.add(new StorageLocation(localStorageFolder3, 10000000000L, null)); StorageLocationSelectorStrategy leastBytesUsedStrategy = new LeastBytesUsedStorageLocationSelectorStrategy(storageLocations); storageLocation1.reserve("tmp_loc1", "__seg1", 1024L); Iterator<StorageLocation> locations = leastBytesUsedStrategy.getLocations(); StorageLocation loc1 = locations.next(); Assert.assertEquals("The next element of the iterator should point to path local_storage_folder_2", localStorageFolder2, loc1.getPath()); StorageLocation loc2 = locations.next(); Assert.assertEquals("The next element of the iterator should point to path local_storage_folder_3", localStorageFolder3, loc2.getPath()); StorageLocation loc3 = locations.next(); Assert.assertEquals("The next element of the iterator should point to path local_storage_folder_1", localStorageFolder1, loc3.getPath()); }
Source:
<code>private Map<Long, Chain> decodeChainMapEntries(StructDecoder<Void> decoder) { StructArrayDecoder<? extends StructDecoder<?>> entriesDecoder = decoder.structs(CHAIN_MAP_ENTRIES_SUB_STRUCT); if (entriesDecoder != null) { int len = entriesDecoder.length(); <START> Map<Long, Chain> chainMap = (len < 16) ? new HashMap<>() : new HashMap<>((int) ((float) len / 0.75f + 1.0f)); <END> for (int i = 0; i < len; i++) { StructDecoder<?> entryDecoder = entriesDecoder.next(); Long key = entryDecoder.int64(KEY_FIELD); StructDecoder<?> chainDecoder = entryDecoder.struct(CHAIN_FIELD); Chain chain = ChainCodec.decode(chainDecoder); chainMap.put(key, chain); entryDecoder.end(); } return chainMap; } else { return Collections.emptyMap(); } }</code><technical_language>default 16? Also, need apply a factor initial capacity. This is done HashMap. put length. expecting new entries added we</technical_language>

Target:
private Map<Long, Chain> decodeChainMapEntries(StructDecoder<Void> decoder) { StructArrayDecoder<? extends StructDecoder<?>> entriesDecoder = decoder.structs(CHAIN_MAP_ENTRIES_SUB_STRUCT); if (entriesDecoder != null) { int len = entriesDecoder.length(); Map<Long, Chain> chainMap = new HashMap<>((int) ((float) len / 0.75f + 1.0f)); for (int i = 0; i < len; i++) { StructDecoder<?> entryDecoder = entriesDecoder.next(); Long key = entryDecoder.int64(KEY_FIELD); StructDecoder<?> chainDecoder = entryDecoder.struct(CHAIN_FIELD); Chain chain = ChainCodec.decode(chainDecoder); chainMap.put(key, chain); entryDecoder.end(); } return chainMap; } else { return Collections.emptyMap(); } }
Source:
<code>private void dereferencePage(SerializedPage pageSplit, Lifespan lifespan) { long outstandingPageCount = outstandingPageCountPerLifespan.get(lifespan).decrementAndGet(); if (outstandingPageCount == 0 && noMorePagesForLifespan.contains(lifespan)) { <START> checkState(lifespanCompletionCallback != null); <END> lifespanCompletionCallback.accept(lifespan); } checkState(totalBufferedPages.decrementAndGet() >= 0); memoryManager.updateMemoryUsage(-pageSplit.getRetainedSizeInBytes()); }</code><technical_language>Add a message, in case fails</technical_language>

Target:
private void dereferencePage(SerializedPage pageSplit, Lifespan lifespan) { long outstandingPageCount = outstandingPageCountPerLifespan.get(lifespan).decrementAndGet(); if (outstandingPageCount == 0 && noMorePagesForLifespan.contains(lifespan)) { checkState(lifespanCompletionCallback != null, "lifespanCompletionCallback is not null"); lifespanCompletionCallback.accept(lifespan); } checkState(totalBufferedPages.decrementAndGet() >= 0); memoryManager.updateMemoryUsage(-pageSplit.getRetainedSizeInBytes()); }
Source:
<code>public void setPriority(final TableName tn) { <START> if (!tn.isSystemTable() && !PhoenixDatabaseMetaData.SYSTEM_TABLE_NAMES.contains(tn.getNameAsString())) { <END> setPriority(this.priority); } else { super.setPriority(tn); } }</code><technical_language>!SchemaUtil.isSystemTable(tn.getName()) instead of this</technical_language>

Target:
public void setPriority(final TableName tn) { if (!tn.isSystemTable() && !SchemaUtil.isSystemTable(tn.getName())) { setPriority(this.priority); } else { super.setPriority(tn); } }
Source:
<code>public String[] getAvailableClusterGroups() throws Exception { HPCCWsTopologyClient hpccWsTopologyClient = HPCCWsTopologyClient.get(connection); try { if (hpccWsTopologyClient != null) return hpccWsTopologyClient.getValidTargetGroupNames(); else throw new Exception("Could not initialize HPCC WsTopology Client"); } catch (Exception e) { e.printStackTrace(); } catch (org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper e) { <START> e.toString(); <END> } return null; }</code><technical_language>e.toString()? this logged</technical_language>

Target:
public String[] getAvailableClusterGroups() throws Exception { HPCCWsTopologyClient hpccWsTopologyClient = HPCCWsTopologyClient.get(connection); try { if (hpccWsTopologyClient != null) return hpccWsTopologyClient.getValidTargetGroupNames(); else throw new Exception("Could not initialize HPCC WsTopology Client"); } catch (Exception e) { e.printStackTrace(); } catch (org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper e) { log.error(e.toString()); } return null; }
Source:
<code>public static Class getSchemaForRelDataType(TupleSchemaRegistry registry, String schemaName, RelDataType rowType) { if (rowType.isStruct()) { TupleSchemaRegistry.Schema newSchema = registry.createNewSchema(schemaName); for (RelDataTypeField field : rowType.getFieldList()) { RelDataType type = field.getType(); newSchema.addField(OperatorUtils.getValidFieldName(field), convertPrimitiveToSqlType(type)); } try { newSchema.generateBean(); } catch (IOException | JSONException e) { <START> throw new RuntimeException("Failed t generate schema", e); <END> } return newSchema.beanClass; } else { throw new UnsupportedOperationException("Not struct row type is not implemented."); } }</code><technical_language>typo</technical_language>

Target:
public static Class getSchemaForRelDataType(TupleSchemaRegistry registry, String schemaName, RelDataType rowType) { if (rowType.isStruct()) { TupleSchemaRegistry.Schema newSchema = registry.createNewSchema(schemaName); for (RelDataTypeField field : rowType.getFieldList()) { RelDataType type = field.getType(); newSchema.addField(OperatorUtils.getValidFieldName(field), convertPrimitiveToSqlType(type)); } try { newSchema.generateBean(); } catch (IOException | JSONException e) { throw new RuntimeException("Failed to generate schema", e); } return newSchema.beanClass; } else { throw new UnsupportedOperationException("Non-struct row type is not implemented."); } }
Source:
<code>public boolean savePhonenumber() { boolean actionResult = false; if (isValidPatientId()) { try { Phonenumber phonenumber = readPhonenumber(); phonenumber.setPatient(withPatient); actionResult = loadTestDataService.savePhonenumber(phonenumber); if (actionResult) { addPatientInfoMessages("Save Phonenumber Successful: " + phonenumber.getPhonenumberId()); clearInputsPhonenumbers(); } } catch (LoadTestDataException e) { logPatientError("Patient Phonenumber", e); } } else { addPatientErrorMessages("Phonenumber cannot be save: patient does not exist."); } <START> return actionResult; <END> }</code><technical_language>Phonenumber save: patient exist --> Phonenumber saved: patient exist</technical_language>

Target:
public boolean savePhonenumber() { boolean actionResult = false; if (isValidPatientId()) { try { Phonenumber phonenumber = readPhonenumber(); phonenumber.setPatient(withPatient); actionResult = loadTestDataService.savePhonenumber(phonenumber); if (actionResult) { addPatientInfoMessages(msgForSaveSuccess("phonenumber", phonenumber.getPhonenumberId())); clearInputsPhonenumbers(); } } catch (LoadTestDataException e) { logPatientError("Patient Phonenumber", e); } } else { addPatientErrorMessages(msgForInvalidPatient("Phonenumber")); } return actionResult; }
Source:
<code>public void provision(Environment envConfig, CheServicesEnvironmentImpl internalEnv) throws EnvironmentException { String devMachineName = envConfig.getMachines() .entrySet() .stream() .filter(entry -> entry.getValue() .getAgents() != null && entry.getValue() .getAgents() .contains("org.eclipse.che.ws-agent")) .map(Map.Entry::getKey) .findAny() .orElseThrow(() -> new EnvironmentException( "ws-machine is not found on agents applying")); String projectFolderVolume; try { <START> if (Strings.isNullOrEmpty(volumesOptions)) { <END> projectFolderVolume = format("%s:%s", workspaceFolderPathProvider.getPath(internalEnv.getWorkspaceId()), projectFolderPath); } else { projectFolderVolume = format("%s:%s:%s", workspaceFolderPathProvider.getPath(internalEnv.getWorkspaceId()), projectFolderPath, volumesOptions); } } catch (IOException e) { throw new EnvironmentException("Error occurred on resolving path to files of workspace " + internalEnv.getWorkspaceId()); } internalEnv.getServices() .get(devMachineName) .getVolumes() .add(SystemInfo.isWindows() ? pathEscaper.escapePath(projectFolderVolume) : projectFolderVolume); super.provision(envConfig, internalEnv); }</code><technical_language>form suffix in constructor. need this clause in main code</technical_language>

Target:
public void provision(Environment envConfig, CheServicesEnvironmentImpl internalEnv) throws EnvironmentException { String devMachineName = envConfig.getMachines() .entrySet() .stream() .filter(entry -> entry.getValue() .getAgents() != null && entry.getValue() .getAgents() .contains("org.eclipse.che.ws-agent")) .map(Map.Entry::getKey) .findAny() .orElseThrow(() -> new EnvironmentException( "ws-machine is not found on agents applying")); String projectFolderVolume; try { projectFolderVolume = format("%s:%s%s", workspaceFolderPathProvider.getPath(internalEnv.getWorkspaceId()), projectFolderPath, projectsVolumeOptions); } catch (IOException e) { throw new EnvironmentException("Error occurred on resolving path to files of workspace " + internalEnv.getWorkspaceId()); } internalEnv.getServices() .get(devMachineName) .getVolumes() .add(SystemInfo.isWindows() ? pathEscaper.escapePath(projectFolderVolume) : projectFolderVolume); super.provision(envConfig, internalEnv); }