auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static List<ExtMap> fetchPrincipalsByIdsRecursively( final ExtensionProxy extension, final String namespace, final List<String> ids) { Map<String, ExtMap> groupsCache = new HashMap<>(); Set<String> idsToFetch = new HashSet<>(); List<ExtMap> principals = findPrincipalsByIds(extension, namespace, ids, true, false); for (ExtMap principal : principals) { for (ExtMap memberOf : principal.get(PrincipalRecord.GROUPS, Collections.<ExtMap> emptyList())) { idsToFetch.add(memberOf.<String> get(GroupRecord.ID)); } } while (!idsToFetch.isEmpty()) { List<ExtMap> groups = <START> findGroupRecordsByIds(extension, namespace, new ArrayList<String>(idsToFetch), true, false); <END> idsToFetch.clear(); for (ExtMap group : groups) { groupsCache.put(group.<String> get(GroupRecord.ID), group); for (ExtMap memberOf : group.get(GroupRecord.GROUPS, Collections.<ExtMap> emptyList())) { if (!groupsCache.containsKey(memberOf.get(GroupRecord.ID))) { idsToFetch.add(memberOf.<String> get(GroupRecord.ID)); } } } } for (ExtMap principal : principals) { constructGroupsMembershipTree(principal, PrincipalRecord.GROUPS, groupsCache); } return principals; }</code><technical_language>oh! namespace group, need do this namespace</technical_language>

Target:
public static List<ExtMap> fetchPrincipalsByIdsRecursively( final ExtensionProxy extension, final String namespace, final List<String> ids) { Map<String, ExtMap> groupsCache = new HashMap<>(); Map<String, Set<String>> idsToFetchPerNamespace = new HashMap<String, Set<String>>(); List<ExtMap> principals = findPrincipalsByIds(extension, namespace, ids, true, false); for (ExtMap principal : principals) { for (ExtMap memberOf : principal.get(PrincipalRecord.GROUPS, Collections.<ExtMap> emptyList())) { addIdToFetch(idsToFetchPerNamespace, memberOf); } } while (!idsToFetchPerNamespace.isEmpty()) { List<ExtMap> groups = new ArrayList<>(); for (String namespaceOfIdsToFetch: idsToFetchPerNamespace.keySet()) { groups.addAll(findGroupRecordsByIds(extension, namespace, new ArrayList<String>(idsToFetchPerNamespace.get(namespaceOfIdsToFetch)), true, false)); } idsToFetchPerNamespace.clear(); for (ExtMap group : groups) { groupsCache.put(group.<String> get(GroupRecord.ID), group); for (ExtMap memberOf : group.get(GroupRecord.GROUPS, Collections.<ExtMap> emptyList())) { if (!groupsCache.containsKey(memberOf.get(GroupRecord.ID))) { addIdToFetch(idsToFetchPerNamespace, memberOf); } } } } for (ExtMap principal : principals) { constructGroupsMembershipTree(principal, PrincipalRecord.GROUPS, groupsCache); } return principals; }
Source:
<code>private ReferencedEnvelope getBoundsForGranuleCRS(GranuleDescriptor templateDescriptor, ReferencedEnvelope requestBounds) throws IOException { String crsAttribute = configuration.getCRSAttribute(); if (crsAttribute == null) { crsAttribute = CRSExtractor.DEFAULT_ATTRIBUTE_NAME; } GranuleSource granuleSource = getGranuleSource(true, null); if(granuleSource.getSchema().getDescriptor(crsAttribute) == null) { throw new IllegalStateException("Invalid heterogeneous mosaic configuration, " <START> + "the crs property is missing collector must be configured"); <END> } String granuleCRSCode = (String) templateDescriptor.getOriginator() .getAttribute(crsAttribute); FilterFactory2 ff = FeatureUtilities.DEFAULT_FILTER_FACTORY; PropertyIsEqualTo crsFilter = ff.equal(ff.property(crsAttribute), ff.literal(granuleCRSCode), false); BBOX bbox = ff.bbox(ff.property(""), requestBounds); Filter filter = ff.and(crsFilter, bbox); Query q = new Query(granuleSource.getSchema().getTypeName(), filter); SimpleFeatureCollection granules = granuleSource.getGranules(q); ReferencedEnvelope bounds = granules.getBounds(); return bounds; }</code><technical_language>Do need a comma a period in this error message more clear? (Maybe "missing" "collector"?)</technical_language>

Target:
private ReferencedEnvelope getBoundsForGranuleCRS(GranuleDescriptor templateDescriptor, ReferencedEnvelope requestBounds) throws IOException { String crsAttribute = configuration.getCRSAttribute(); if (crsAttribute == null) { crsAttribute = CRSExtractor.DEFAULT_ATTRIBUTE_NAME; } GranuleSource granuleSource = getGranuleSource(true, null); if(granuleSource.getSchema().getDescriptor(crsAttribute) == null) { throw new IllegalStateException("Invalid heterogeneous mosaic configuration, " + "the 'crs' property is missing from the index schema"); } String granuleCRSCode = (String) templateDescriptor.getOriginator() .getAttribute(crsAttribute); FilterFactory2 ff = FeatureUtilities.DEFAULT_FILTER_FACTORY; PropertyIsEqualTo crsFilter = ff.equal(ff.property(crsAttribute), ff.literal(granuleCRSCode), false); BBOX bbox = ff.bbox(ff.property(""), requestBounds); Filter filter = ff.and(crsFilter, bbox); Query q = new Query(granuleSource.getSchema().getTypeName(), filter); SimpleFeatureCollection granules = granuleSource.getGranules(q); ReferencedEnvelope bounds = granules.getBounds(); return bounds; }
Source:
<code>public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { double total = price * volume; <START> if (orderType == OrderType.BUY && total > cashInHand) { <END> throw new StockMarketExpection(this.name + " cannot afford to buy this stock"); } Order order = null; if (orderType == OrderType.BUY) { order = new BuyOrder(symbol, volume, price, this); } else { order = new SellOrder(symbol, volume, price, this); } if (OrderUtility.isAlreadyPresent(ordersPlaced, order)) { throw new StockMarketExpection("There is already an order for this stock"); } if (orderType == OrderType.SELL && volume > OrderUtility.ownedQuantity(this.position, symbol)) { throw new StockMarketExpection("Sell order volume is larger than amount of stock owned"); } if (orderType == OrderType.SELL && !OrderUtility.owns(position, symbol)) { throw new StockMarketExpection(this.name + " cannot place a sell order for a stock not owned"); } m.addOrder(order); this.ordersPlaced.add(order); }</code><technical_language>if statement if-else statement for readability reason</technical_language>

Target:
public void placeNewOrder(Market m, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { double total = price * volume; Order order = null; if (orderType == OrderType.BUY) { order = new BuyOrder(symbol, volume, price, this); } else { order = new SellOrder(symbol, volume, price, this); } if (orderType == OrderType.BUY && total > cashInHand) { throw new StockMarketExpection(this.name + " cannot afford to buy this stock"); } if (OrderUtility.isAlreadyPresent(ordersPlaced, order)) { throw new StockMarketExpection("There is already an order for this stock"); } if (orderType == OrderType.SELL && volume > OrderUtility.ownedQuantity(this.position, symbol)) { throw new StockMarketExpection("Sell order volume is larger than amount of stock owned"); } if (orderType == OrderType.SELL && !OrderUtility.owns(position, symbol)) { throw new StockMarketExpection(this.name + " cannot place a sell order for a stock not owned"); } m.addOrder(order); this.ordersPlaced.add(order); }
Source:
<code>public Set<String> getListOfRemoteIds(SyncManager syncManager, Set<String> localIds) { if (localIds == null) { return null; } final String idFieldName = getIdFieldName(); final Set<String> remoteIds = new HashSet<String>(); final StringBuilder soql = new StringBuilder("SELECT "); soql.append(idFieldName); soql.append(" FROM"); <START> final String[] fromClause = query.toLowerCase().split("from"); <END> soql.append(fromClause[1]); try { JSONArray records = startFetch(syncManager, 0, soql.toString()); remoteIds.addAll(parseIdsFromResponse(records)); while (records != null) { records = continueFetch(syncManager); remoteIds.addAll(parseIdsFromResponse(records)); } } catch (IOException e) { Log.e(TAG, "IOException thrown while fetching records", e); } catch (JSONException e) { Log.e(TAG, "JSONException thrown while fetching records", e); } return remoteIds; }</code><technical_language>Do if object type / field names need properly capitalized? If do, locate "from" in case query, split original query location</technical_language>

Target:
public Set<String> getListOfRemoteIds(SyncManager syncManager, Set<String> localIds) { if (localIds == null) { return null; } final String idFieldName = getIdFieldName(); final Set<String> remoteIds = new HashSet<String>(); final StringBuilder soql = new StringBuilder("SELECT "); soql.append(idFieldName); soql.append(" FROM"); final String[] fromClause = query.split("([fF][rR][oO][mM])"); soql.append(fromClause[1]); try { JSONArray records = startFetch(syncManager, 0, soql.toString()); remoteIds.addAll(parseIdsFromResponse(records)); while (records != null) { records = continueFetch(syncManager); remoteIds.addAll(parseIdsFromResponse(records)); } } catch (IOException e) { Log.e(TAG, "IOException thrown while fetching records", e); } catch (JSONException e) { Log.e(TAG, "JSONException thrown while fetching records", e); } return remoteIds; }
Source:
<code>public RuleEvaluationWorker(Map<String, Set<String>> docsToCheckAndEvents) { this.docsToCheckAndEvents = docsToCheckAndEvents; <START> List<String> docs = new ArrayList<String>(); <END> docs.addAll(docsToCheckAndEvents.keySet()); setDocuments(Framework.getService(RepositoryManager.class).getDefaultRepositoryName(), docs); }</code><technical_language>new ArrayList<String>(); -> new ArrayList<>();</technical_language>

Target:
public RuleEvaluationWorker(Map<String, Set<String>> docsToCheckAndEvents) { this.docsToCheckAndEvents = docsToCheckAndEvents; List<String> docs = new ArrayList<>(); docs.addAll(docsToCheckAndEvents.keySet()); setDocuments(Framework.getService(RepositoryManager.class).getDefaultRepositoryName(), docs); }
Source:
<code>private void validateCascadedValues(Object value, ValidationContext<?> context, ValueContext<?, ?> valueContext, Cascadable cascadable, ValidationOrder validationOrder) { for ( TypeVariable<?> cascadingTypeParameter : cascadable.getCascadingTypeParameters() ) { <START> List<TypeVariable<?>> cascadingOrConstrainedTypeParametersOfValueType = getCorrespondingTypeParametersInSubType( <END> value.getClass(), TypeHelper.getErasedReferenceType( cascadable.getCascadableType() ), cascadingTypeParameter ); for ( TypeVariable<?> cascadingOrConstrainedTypeParameterOfValueType : cascadingOrConstrainedTypeParametersOfValueType ) { ValueExtractor<?> extractor = valueExtractors.getCascadedValueExtractor( value.getClass(), cascadingOrConstrainedTypeParameterOfValueType ); valueContext.setCurrentTypeParameter( cascadingOrConstrainedTypeParameterOfValueType ); if ( extractor == null ) { continue; } CascadingValueReceiver receiver = new CascadingValueReceiver( context, valueContext, validationOrder ); ( (ValueExtractor) extractor ).extractValues( value, receiver ); } } }</code><technical_language>remove OrConstrained too</technical_language>

Target:
private void validateCascadedValues(Object value, ValidationContext<?> context, ValueContext<?, ?> valueContext, Cascadable cascadable, ValidationOrder validationOrder) { for ( TypeVariable<?> cascadingTypeParameter : cascadable.getCascadingTypeParameters() ) { List<TypeVariable<?>> cascadingTypeParametersOfValueType = getCorrespondingTypeParametersInSubType( value.getClass(), TypeHelper.getErasedReferenceType( cascadable.getCascadableType() ), cascadingTypeParameter ); for ( TypeVariable<?> cascadingTypeParameterOfValueType : cascadingTypeParametersOfValueType ) { ValueExtractorDescriptor extractor = valueExtractors.getCascadedValueExtractor( value.getClass(), cascadingTypeParameterOfValueType ); if ( extractor == null ) { continue; } CascadingValueReceiver receiver = new CascadingValueReceiver( context, valueContext, validationOrder ); ( (ValueExtractor) extractor.getValueExtractor() ).extractValues( value, receiver ); } } }
Source:
<code>private void initializeListLayout() { mList = (ListView) mParentActivity.findViewById(R.id.profile_options); ArrayList<String> options = new ArrayList <String>(); options.add("Field-Reports " + mUser.getFieldReportsCount()); options.add("Tasks " + mUser.getFieldReportsCount()); options.add("Sites " + mUser.getSitesCount()); <START> if (mUser.isEmployee() || mUser.isManager()){ <END> } mAdapter = new ProfileOptionsAdapter(getActivity(), R.layout.option_item, options); mList.setAdapter(mAdapter); mList.setOnItemClickListener(this); }</code><technical_language>models implemented backend yet</technical_language>

Target:
private void initializeListLayout() { mList = (ListView) mParentActivity.findViewById(R.id.profile_options); ArrayList<String> options = new ArrayList <String>(); options.add("Field-Reports " + mUser.getFieldReportsCount()); if (mUser.isEmployee() || mUser.isManager()){ } mAdapter = new ProfileOptionsAdapter(getActivity(), R.layout.option_item, options); mList.setAdapter(mAdapter); mList.setOnItemClickListener(this); }
Source:
<code><START> public String getIdentityStream() { <END> if(identityStream == null) { Map beatsData = (HashMap<String, String>) this.getData().get("beat"); if(beatsData != null) { String id = (String) beatsData.get("id"); String resourceId = (String) beatsData.get("resource_id"); if(id != null && resourceId != null) { identityStream = id + "-" + resourceId; } else { identityStream = (String) beatsData.get("name") + "-" + (String) beatsData.get("source"); } } } return identityStream; }</code><technical_language>this done in constructor</technical_language>

Target:
public String getIdentityStream() { return identityStream; }
Source:
<code>public void should_fail_if_actual_contains_value_at_index() { AssertionInfo info = someInfo(); Index index = atIndex(0); <START> Throwable error = catchThrowable(() -> arrays.assertDoesNotContain(info, actual, new int[] {0, 2, 4}, index)); <END> assertThat(error).isInstanceOf(AssertionError.class); verify(failures).failure(info, shouldNotContainAtIndex(actual, new int[] {0, 2, 4}, index)); }</code><technical_language>expectAssertionErrror in place of catchThrowable, need get assertion error, verify(failures)... is enough expectAssertionErrror check AssertionError thrown</technical_language>

Target:
public void should_fail_if_actual_contains_value_at_index() { Index index = atIndex(0); int[] expectedElement = {0, 2, 4}; AssertionError assertionError = expectAssertionError(() -> arrays.assertDoesNotContain(someInfo(), actual, expectedElement, index)); then(assertionError).hasMessage(shouldNotContainAtIndex(actual, new int[] {0, 2, 4}, index).create()); }
Source:
<code>private void onMouseClicked(MouseEvent e) { <START> if (e.getClickCount() == 2) { <END> if (dbpath == SELECT_OPTION) { File dir = selectDirectory(); if (dir == null) { return; } dbload.setDatabase(dir.getAbsolutePath()); items.add(dir.getAbsolutePath()); list.getSelectionModel().select(getDBPath()); } else { progressDialog = new ProgressDialog(list.getParent()); dbload.restart(); } } }</code><technical_language>want a double click, else in UI works a single click</technical_language>

Target:
private void onMouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { loadDB(); } }
Source:
<code>public QuotaBalanceResponse createQuotaLastBalanceResponse(List<QuotaBalanceVO> quotaBalance, Date startDate) { if (quotaBalance.size() == 0) { new InvalidParameterValueException("There are no balance entries on or before the requested date."); } if (startDate == null) { startDate = new Date(); } QuotaBalanceResponse resp = new QuotaBalanceResponse(); BigDecimal lastCredits = new BigDecimal(0); <START> for (Iterator<QuotaBalanceVO> it = quotaBalance.iterator(); it.hasNext();) { <END> QuotaBalanceVO entry = it.next(); s_logger.info("createQuotaLastBalanceResponse Date=" + entry.getUpdatedOn() + " balance=" + entry.getCreditBalance() + " credit=" + entry.getCreditsId()); lastCredits = lastCredits.add(entry.getCreditBalance()); } resp.setStartQuota(lastCredits); resp.setStartDate(_quotaService.computeAdjustedTime(startDate)); resp.setCurrency(QuotaConfig.QuotaCurrencySymbol.value()); resp.setObjectName("balance"); return resp; }</code><technical_language>a for-each for more concise iteration code</technical_language>

Target:
public QuotaBalanceResponse createQuotaLastBalanceResponse(List<QuotaBalanceVO> quotaBalance, Date startDate) { if (quotaBalance == null || quotaBalance.size() == 0) { new InvalidParameterValueException("There are no balance entries on or before the requested date."); } if (startDate == null) { startDate = new Date(); } QuotaBalanceResponse resp = new QuotaBalanceResponse(); BigDecimal lastCredits = new BigDecimal(0); for (Iterator<QuotaBalanceVO> it = quotaBalance.iterator(); it.hasNext();) { QuotaBalanceVO entry = it.next(); if (s_logger.isDebugEnabled()){ s_logger.info("createQuotaLastBalanceResponse Date=" + entry.getUpdatedOn() + " balance=" + entry.getCreditBalance() + " credit=" + entry.getCreditsId()); } lastCredits = lastCredits.add(entry.getCreditBalance()); } resp.setStartQuota(lastCredits); resp.setStartDate(_quotaService.computeAdjustedTime(startDate)); resp.setCurrency(QuotaConfig.QuotaCurrencySymbol.value()); resp.setObjectName("balance"); return resp; }
Source:
<code>protected void updateMemoryBalloon() { if (getModel().getSelectedCluster() != null) { VDSGroup cluster = getModel().getSelectedCluster(); boolean hasMemoryBalloon = (cluster.getcompatibility_version() .compareTo(VmListModel.BALLOON_DEVICE_MIN_VERSION) >= 0 && cluster.getArchitecture() <START> .compareTo(VmListModel.BALLOON_DEVICE_BLACKLISTED_ARCH) != 0); <END> getModel().getMemoryBalloonDeviceEnabled().setIsAvailable(hasMemoryBalloon); } }</code><technical_language>please change equals()</technical_language>

Target:
protected void updateMemoryBalloon() { if (getModel().getSelectedCluster() != null) { VDSGroup cluster = getModel().getSelectedCluster(); boolean hasMemoryBalloon = (cluster.getcompatibility_version() .compareTo(VmListModel.BALLOON_DEVICE_MIN_VERSION) >= 0 && cluster.getArchitecture() .equals(VmListModel.BALLOON_DEVICE_BLACKLISTED_ARCH)); getModel().getMemoryBalloonDeviceEnabled().setIsAvailable(hasMemoryBalloon); } }
Source:
<code>public int[] convertFromState(State value, ComfoAirCommandType commandType) { int[] template = commandType.getChangeDataTemplate(); int[] possibleValues = commandType.getPossibleValues(); int intValue = ((DecimalType) value).intValue(); if (possibleValues == null) { template[commandType.getChangeDataPos()] = intValue; } else { for (int i = 0; i < possibleValues.length; i++) { if (possibleValues[i] == intValue) { template[commandType.getChangeDataPos()] = intValue; break; } } } <START> System.out.println(template); <END> return template; }</code><technical_language>println is used. Convert a logger statement remove</technical_language>

Target:
public int[] convertFromState(State value, ComfoAirCommandType commandType) { if (value == null || commandType == null) { logger.trace("\"DataTypeNumber\" class \"convertFromState\" method parameter: null"); return null; } else { int[] template = commandType.getChangeDataTemplate(); int[] possibleValues = commandType.getPossibleValues(); int position = commandType.getChangeDataPos(); int intValue = ((DecimalType) value).intValue(); if (possibleValues == null) { template[position] = intValue; } else { for (int i = 0; i < possibleValues.length; i++) { if (possibleValues[i] == intValue) { template[position] = intValue; break; } } } return template; } }
Source:
<code>synchronized void sendMessageToListeners(LIRCResponse message) { try { <START> <END> for (LIRCEventListener listener : listeners) { listener.messageReceived(message); } } catch (Exception e) { logger.error("Error invoking event listener", e); } }</code><technical_language>blank line</technical_language>

Target:
public synchronized void sendMessageToListeners(LIRCResponse message) { try { for (LIRCEventListener listener : listeners) { listener.messageReceived(message); } } catch (Exception e) { logger.error("Error invoking event listener", e); } }
Source:
<code>public boolean tick() { <START> profiler.startSection("providerTick(" + cubeMap.getSize() + ")"); <END> long i = System.currentTimeMillis(); int randomTickSpeed = this.world.getGameRules().getInt("randomTickSpeed"); Random rand = this.world.rand; for (Cube cube : cubeMap) { cube.tickCubeServer(() -> System.currentTimeMillis() - i > 40, rand); if (cube.isEmpty()) continue; int randomTickCounter = randomTickSpeed; while (--randomTickCounter > 0) cube.randomTick(this.world, rand); } profiler.endSection(); return false; }</code><technical_language>done right writing this for time</technical_language>

Target:
public boolean tick() { profiler.startSection("providerTick("+cubeMap.getSize()+")"); long i = System.currentTimeMillis(); int randomTickSpeed = this.world.getGameRules().getInt("randomTickSpeed"); Random rand = this.world.rand; for (Cube cube : cubeMap) { cube.tickCubeServer(() -> System.currentTimeMillis() - i > 40, rand); if (cube.isEmpty() || !doRandomBlockTicksHere) continue; int randomTickCounter = randomTickSpeed; while (randomTickCounter-- > 0) cube.randomTick(this.world, rand); } profiler.endSection(); return false; }
Source:
<code>private FieldValue convert(Map.Entry<String, JsonNode> entry) { <START> return fieldsConfiguration.getField(entry.getKey()).getRegister().isPresent() ? new LinkValue(entry.getKey(), entry.getValue().textValue()) : new StringValue(entry.getValue().textValue()); <END> }</code><technical_language>this assumes field.getRegister() is string fieldName. fail specifically for registry field links public-body register, (non-existent) registry register</technical_language>

Target:
private FieldValue convert(Map.Entry<String, JsonNode> entry) { Optional<String> register = fieldsConfiguration.getField(entry.getKey()).getRegister(); return register.isPresent() ? new LinkValue(register.get(), entry.getValue().textValue()) : new StringValue(entry.getValue().textValue()); }
Source:
<code>public final boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos) { IMicroblockContainerTile tile = getMicroblockTile(world, pos); MicroblockContainer container = tile != null ? tile.getMicroblockContainer() : null; if (container == null) { return false; } <START> return container.getPartContainer().canPlaceTorchOnTop() || canPlaceTorchOnTopDefault(state, world, pos); <END> }</code><technical_language>of early returns do this need switched if (!=null)'s 1) cleaner 2) code easier understand 3) future expansion easier need refactor lines. mention single line ifs need converted lined braces</technical_language>

Target:
public final boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos) { IMicroblockContainerTile tile = getMicroblockTile(world, pos); if (tile != null) { return tile.getMicroblockContainer().getPartContainer().canPlaceTorchOnTop() || canPlaceTorchOnTopDefault(state, world, pos); } return false; }
Source:
<code>protected DocumentModel attach(DocumentModel doc) { String sid = ctx.getCoreSession().getSessionId(); try { <START> doc = doc.clone(); <END> } catch (CloneNotSupportedException e) { } doc.attach(sid); return doc; }</code><technical_language>clone doc</technical_language>

Target:
protected void attach(DocumentModel doc) { String sid = ctx.getCoreSession().getSessionId(); doc.attach(sid); }
Source:
<code>private void createPresenter() { RenderedTemplate renderedTemplate = null; <START> if (presenterConfigModel.getNestedPresenter()) { <END> renderedTemplate = createdNestedPresenterTemplates.getPresenter(); } else if (presenterConfigModel.getPresenterWidget()) { renderedTemplate = createdPresenterWidgetTemplates.getPresenter(); } else if (presenterConfigModel.getPopupPresenter()) { renderedTemplate = createdPopupPresenterTemplates.getPresenter(); } PsiClass createdPsiClass = createPsiClass(createdPresenterPackage, renderedTemplate); createdPsiClass.navigate(true); }</code><technical_language>extract</technical_language>

Target:
private void createPresenter() { RenderedTemplate renderedTemplate = null; if (presenterConfigModel.getNestedPresenter()) { renderedTemplate = createdNestedPresenterTemplates.getPresenter(); } else if (presenterConfigModel.getPresenterWidget()) { renderedTemplate = createdPresenterWidgetTemplates.getPresenter(); } else if (presenterConfigModel.getPopupPresenter()) { renderedTemplate = createdPopupPresenterTemplates.getPresenter(); } createdPresenterPsiClass = createPsiClass(createdPresenterPackage, renderedTemplate); navigateToClass(createdPresenterPsiClass); }
Source:
<code>public void TestJSON() { byte input[] = new byte[14]; input[0] = Byte.valueOf((byte) 0); input[1] = Byte.valueOf((byte) 1); input[2] = Byte.valueOf((byte) 0); input[3] = Byte.valueOf((byte) 13); input[4] = Byte.valueOf((byte) 0); input[5] = Byte.valueOf((byte) 11); input[6] = Byte.valueOf((byte) 0); input[7] = Byte.valueOf((byte) 2); input[8] = Byte.valueOf((byte) 0); input[9] = Byte.valueOf((byte) 5); input[10] = Byte.valueOf((byte) 3); input[11] = Byte.valueOf((byte) 0); input[12] = Byte.valueOf((byte) 105); <START> input[13] = Byte.valueOf((byte) 100); <END> ColumnDef d = ColumnDef.build("bar", "ascii", "json", 1, false, null, null); RawJSONString result = (RawJSONString) d.asJSON(input); assertThat(result.json, is("{\"id\":3}")); }</code><technical_language>a verbose, new byte[] { ... } instead of setting individual byte</technical_language>

Target:
public void TestJSON() { byte input[] = new byte[] { (byte) 0, (byte) 1, (byte) 0, (byte) 13, (byte) 0, (byte) 11, (byte) 0, (byte) 2, (byte) 0, (byte) 5, (byte) 3, (byte) 0, (byte) 105, (byte) 100 }; ColumnDef d = ColumnDef.build("bar", "ascii", "json", 1, false, null, null); RawJSONString result = (RawJSONString) d.asJSON(input); assertThat(result.json, is("{\"id\":3}")); }
Source:
<code>public static void setThrottledOpWaitTime(int time) { <START> LOG.info("throttledOpWaitTime set to " + time); <END> throttledOpWaitTime = time; }</code><technical_language>please parameterized logging :)</technical_language>

Target:
public static void setThrottledOpWaitTime(int time) { LOG.info("throttledOpWaitTime set to {}", time); throttledOpWaitTime = time; }
Source:
<code>public void setInterrupted(boolean interrupted) { this.interrupted = interrupted; this.interrupt(); try { if (connector != null) { connector.disconnect(); } } catch (SwegonVentilationException e) { <START> logger.error("Error occured when closing connection", e); <END> } }</code><technical_language>This a WARN lower. spelling fix: "occurred"</technical_language>

Target:
public void setInterrupted(boolean interrupted) { this.interrupted = interrupted; this.interrupt(); try { if (connector != null) { connector.disconnect(); } } catch (SwegonVentilationException e) { logger.warn("Error occurred when closing connection", e); } }
Source:
<code>private void setupControl(JTable table, Object value, boolean isSelected, boolean hasFocus) { myPanel.setBorder(getCellBorder(table, isSelected && hasFocus)); Color foreground; Color background; if (isSelected) { background = table.getSelectionBackground(); foreground = table.getSelectionForeground(); } else { background = table.getBackground(); foreground = table.getForeground(); } <START> myPanel.setBackground(background); <END> myCheckBox.setBackground(background); myCheckBox.setForeground(foreground); myPanel.remove(myCheckBox); InstallableComponent installableComponent = (InstallableComponent)value; int indent = 0; if (installableComponent != null) { myCheckBox.setEnabled(installableComponent.isOptional()); myCheckBox.setText(installableComponent.getLabel()); myCheckBox.setSelected(isSelected((InstallableComponent)value)); while (installableComponent.getParent() != null) { indent++; installableComponent = installableComponent.getParent(); } } myPanel.add(myCheckBox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, indent * 2)); }</code><technical_language>if relevant I ended setting "opaque" property of components false in Navigation Editor -- avoid copy background colors around</technical_language>

Target:
private void setupControl(JTable table, Object value, boolean isSelected, boolean hasFocus) { myPanel.setBorder(getCellBorder(table, isSelected && hasFocus)); Color foreground; Color background; if (isSelected) { background = table.getSelectionBackground(); foreground = table.getSelectionForeground(); } else { background = table.getBackground(); foreground = table.getForeground(); } myPanel.setBackground(background); myCheckBox.setForeground(foreground); myPanel.remove(myCheckBox); InstallableComponent installableComponent = (InstallableComponent)value; int indent = 0; if (installableComponent != null) { myCheckBox.setEnabled(installableComponent.isOptional()); myCheckBox.setText(installableComponent.getLabel()); myCheckBox.setSelected(isSelected((InstallableComponent)value)); while (installableComponent.getParent() != null) { indent++; installableComponent = installableComponent.getParent(); } } myPanel.add(myCheckBox, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, indent * 2)); }
Source:
<code>private List<TypeDTO> fetchTypes(File[] typeDirectories) { final List<TypeDTO> results = new ArrayList<>(); for (File typeDirectory : typeDirectories) { if (typeDirectory.isDirectory() && !typeDirectory.getName().startsWith(".")) { final File typeJson = new File(typeDirectory, "type.json"); if (typeJson.exists()) { final TypeDTO jsonTypeDTO = unSerializeType(typeJson); final TypeDTO.Builder typeDTOBuilder = new TypeDTO.Builder(jsonTypeDTO); if (StringUtils.isBlank(jsonTypeDTO.getId())) { if (!StringUtils.isBlank(jsonTypeDTO.getName())) { <START> typeDTOBuilder.withId(jsonTypeDTO.getName().replaceAll("[^a-zA-Z0-9_]", "")); <END> } else { typeDTOBuilder.withId(jsonTypeDTO.getName().replaceAll("[^a-zA-Z0-9_]", "")); } } final File typeIconFile = new File(typeDirectory, ICON_NAME); if (typeIconFile.exists()) { typeDTOBuilder.withIcon(typeIconFile.toURI()); } typeDTOBuilder.withCategories(fetchCategories(typeDTOBuilder.getId(), typeDirectory)); final TypeDTO type = typeDTOBuilder.build(); results.add(type); } } } results.sort(Comparator.comparing(TypeDTO::getName)); return results; }</code><technical_language>I suggest, move regex ([^a-zA-Z0-9_]) a separate constant field, in multiple places I prone misspellings</technical_language>

Target:
private List<TypeDTO> fetchTypes(File[] typeDirectories) { final List<TypeDTO> results = new ArrayList<>(); for (File typeDirectory : typeDirectories) { if (typeDirectory.isDirectory() && !typeDirectory.getName().startsWith(".")) { final File typeJson = new File(typeDirectory, "type.json"); if (typeJson.exists()) { final TypeDTO jsonTypeDTO = unSerializeType(typeJson); final TypeDTO.Builder typeDTOBuilder = new TypeDTO.Builder(jsonTypeDTO); if (StringUtils.isBlank(jsonTypeDTO.getId())) { if (!StringUtils.isBlank(jsonTypeDTO.getName())) { typeDTOBuilder.withId(jsonTypeDTO.getName().replaceAll(ID_REGEX, "")); } else { typeDTOBuilder.withId(jsonTypeDTO.getName().replaceAll(ID_REGEX, "")); } } final File typeIconFile = new File(typeDirectory, ICON_NAME); if (typeIconFile.exists()) { typeDTOBuilder.withIcon(typeIconFile.toURI()); } typeDTOBuilder.withCategories(fetchCategories(typeDTOBuilder.getId(), typeDirectory)); final TypeDTO type = typeDTOBuilder.build(); results.add(type); } } } results.sort(Comparator.comparing(TypeDTO::getName)); return results; }
Source:
<code>public void onReaderSitesSearched(OnReaderSitesSearched event) { if (!isAdded()) { return; } mRecyclerView.setRefreshing(false); showLoadingProgress(false); ReaderSiteSearchAdapter adapter = getSiteSearchAdapter(); if (event.isError()) { <START> adapter.clear(); <END> } else if (StringUtils.equals(event.searchTerm, mCurrentSearchQuery)) { adapter.setCanLoadMore(event.canLoadMore); if (event.offset == 0) { adapter.setSiteList(event.sites); } else { adapter.addSiteList(event.sites); } } }</code><technical_language>error handling is handled in this app...should user a notification</technical_language>

Target:
public void onReaderSitesSearched(OnReaderSitesSearched event) { if (!isAdded()) { return; } mRecyclerView.setRefreshing(false); showLoadingProgress(false); ReaderSiteSearchAdapter adapter = getSiteSearchAdapter(); if (event.isError()) { adapter.clear(); } else if (StringUtils.equals(event.searchTerm, mCurrentSearchQuery)) { adapter.setCanLoadMore(event.canLoadMore); if (event.offset == 0) { adapter.setSiteList(event.sites); } else { adapter.addSiteList(event.sites); } if (mSiteSearchRestorePosition > 0) { mRecyclerView.scrollRecycleViewToPosition(mSiteSearchRestorePosition); } } if (getSearchTabsPosition() == TAB_SITES && adapter.isEmpty()) { setEmptyTitleAndDescription(event.isError()); showEmptyView(); } mSiteSearchRestorePosition = 0; }
Source:
<code>public void testNodesWithoutFlows() { <START> this.m_driver.get(this.getBaseUrl() + "opennms/element/nodeList.htm?flows=false"); <END> assertThat(Iterables.transform(m_driver.findElements(By.xpath(" containsInAnyOrder("TestMachine loc1node1", "TestMachine loc2node1")); }</code><technical_language>usage of this m_ is weird, omit this here</technical_language>

Target:
public void testNodesWithoutFlows() { m_driver.get(this.getBaseUrl() + "opennms/element/nodeList.htm?flows=false"); assertThat(Iterables.transform(m_driver.findElements(By.xpath(" containsInAnyOrder("TestMachine loc1node1", "TestMachine loc2node1")); }
Source:
<code>public OAuthToken token(@Required @QueryParam("oauth_provider") String oauthProvider) throws IOException { <START> OAuthAuthenticator provider = getAuthenticator(oauthProvider); <END> return provider.getToken(security.getUserPrincipal().getName()); }</code><technical_language>WebApplicationException anymore. Please replace BadRequestException</technical_language>

Target:
public OAuthToken token(@Required @QueryParam("oauth_provider") String oauthProvider) throws ServerException, BadRequestException { OAuthAuthenticator provider = getAuthenticator(oauthProvider); try { return provider.getToken(security.getUserPrincipal() .getName()); } catch (IOException e) { throw new ServerException(e.getLocalizedMessage(), e); } }
Source:
<code>public Subscriptions getSubscriptions(final SubscriptionState state, final QueryParams params) { <START> if (state != null) params.put("state", state.getType()); <END> return doGET(Subscriptions.SUBSCRIPTIONS_RESOURCE, Subscriptions.class, params); }</code><technical_language>Nit: explicit braces</technical_language>

Target:
public Subscriptions getSubscriptions(final SubscriptionState state, final QueryParams params) { if (state != null) { params.put("state", state.getType()); } return doGET(Subscriptions.SUBSCRIPTIONS_RESOURCE, Subscriptions.class, params); }
Source:
<code>public void navigateToObjectNoStepCreationTest() { Dispute dispute = new Dispute(); List<String> pathToProperty = Arrays.asList("creator", "firstName"); <START> ScenarioBeanUtil.navigateToObject(dispute, pathToProperty, false); <END> }</code><technical_language>I propose assertj check error message</technical_language>

Target:
public void navigateToObjectNoStepCreationTest() { Dispute dispute = new Dispute(); List<String> pathToProperty = Arrays.asList("creator", "firstName"); String message = "Impossible to reach field firstName because a step is not instantiated"; Assertions.assertThatThrownBy(() -> ScenarioBeanUtil.navigateToObject(dispute, pathToProperty, false)) .isInstanceOf(ScenarioException.class) .hasMessage(message); }
Source:
<code>private void throwIfNotBoolean(JsonNode payload) { if (!payload.get(FIELD_VALUE).isBoolean()) { <START> throw new ValidationException(Collections.singletonList(format("Value [%s] is not valid for path [%s]", payload.get(FIELD_VALUE).asText(), payload.get(FIELD_OPERATION_PATH).asText()))); <END> } }</code><technical_language>this mention valid, [%s] of type boolean for path [%s]'</technical_language>

Target:
private void throwIfNotBoolean(JsonNode payload) { if (payload.get(FIELD_VALUE) != null && !payload.get(FIELD_VALUE).isBoolean()) { throw new ValidationException(Collections.singletonList(format("Value [%s] must be of type boolean for path [%s]", payload.get(FIELD_VALUE).asText(), payload.get(FIELD_OPERATION_PATH).asText()))); } }
Source:
<code>public ReportModel(String baseUrl, String ssoToken) { <START> reportUrl = baseUrl.indexOf('?') < 0 ? baseUrl : baseUrl.substring(0, baseUrl.indexOf('?')); <END> paramsMap.parseUrlParams(baseUrl); paramsMap.setParameter("sessionID", ssoToken); paramsMap.setParameter("active_hosts_select", "AND+delete_date+IS+NULL"); String currentLocale = LocaleInfo.getCurrentLocale().getLocaleName(); paramsMap.setParameter("userLocale", (currentLocale.equals("default") ? "en_US" : currentLocale)); }</code><technical_language>some helper method avoid complex / duplicate code</technical_language>

Target:
public ReportModel(String baseUrl, String ssoToken) { reportUrl = FrontendUrlUtils.stripParameters(baseUrl); paramsMap.parseUrlParams(baseUrl); paramsMap.setParameter("sessionID", ssoToken); paramsMap.setParameter("active_hosts_select", "AND+delete_date+IS+NULL"); String currentLocale = LocaleInfo.getCurrentLocale().getLocaleName(); paramsMap.setParameter("userLocale", (currentLocale.equals("default") ? "en_US" : currentLocale)); }
Source:
<code>public void close() throws IOException { if (closed.getAndSet(true)) { LOG.debug("Ignoring close() as stream is already closed"); return; } S3ADataBlocks.DataBlock block = getActiveBlock(); boolean hasBlock = hasActiveBlock(); LOG.debug("{}: Closing block #{}: current block= {}", this, blockCount, hasBlock ? block : "(none)"); long bytes = 0; try { if (multiPartUpload == null) { if (hasBlock) { bytes = putObject(); bytesSubmitted = bytes; } } else { if (hasBlock && (block.hasData() || multiPartUpload.getPartsSubmitted() == 0)) { uploadCurrentBlock(); } final List<PartETag> partETags = multiPartUpload.waitForAllPartUploads(); bytes = bytesSubmitted; if (putTracker.aboutToComplete(multiPartUpload.getUploadId(), partETags, bytes)) { multiPartUpload.complete(partETags); } else { <START> LOG.info("File will be visible when the job is committed"); <END> } } if (!putTracker.outputImmediatelyVisible()) { statistics.commitUploaded(bytes); } LOG.debug("Upload complete to by {}", key, writeOperationHelper); } catch (IOException ioe) { writeOperationHelper.writeFailed(ioe); throw ioe; } finally { closeAll(LOG, block, blockFactory); LOG.debug("Statistics: {}", statistics); closeAll(LOG, statistics); clearActiveBlock(); } writeOperationHelper.writeSuccessful(bytes); }</code><technical_language>missing parameter for LOG.info()</technical_language>

Target:
public void close() throws IOException { if (closed.getAndSet(true)) { LOG.debug("Ignoring close() as stream is already closed"); return; } S3ADataBlocks.DataBlock block = getActiveBlock(); boolean hasBlock = hasActiveBlock(); LOG.debug("{}: Closing block #{}: current block= {}", this, blockCount, hasBlock ? block : "(none)"); long bytes = 0; try { if (multiPartUpload == null) { if (hasBlock) { bytes = putObject(); bytesSubmitted = bytes; } } else { if (hasBlock && (block.hasData() || multiPartUpload.getPartsSubmitted() == 0)) { uploadCurrentBlock(); } final List<PartETag> partETags = multiPartUpload.waitForAllPartUploads(); bytes = bytesSubmitted; if (putTracker.aboutToComplete(multiPartUpload.getUploadId(), partETags, bytes)) { multiPartUpload.complete(partETags); } else { LOG.info("File will be visible when the job is committed", key); } } if (!putTracker.outputImmediatelyVisible()) { statistics.commitUploaded(bytes); } LOG.debug("Upload complete to by {}", key, writeOperationHelper); } catch (IOException ioe) { writeOperationHelper.writeFailed(ioe); throw ioe; } finally { closeAll(LOG, block, blockFactory); LOG.debug("Statistics: {}", statistics); closeAll(LOG, statistics); clearActiveBlock(); } writeOperationHelper.writeSuccessful(bytes); }
Source:
<code>public <T> List<T> stores(final String storeName, final QueryableStoreType<T> queryableStoreType) { if (streamThread.state() == StreamThread.State.DEAD) { return Collections.emptyList(); } if (!streamThread.isRunning()) { throw new InvalidStateStoreException("Cannot get state store " + storeName + " because the stream thread is " + <START> streamThread.state() + ", not RUNNING"); <END> } final List<T> stores = new ArrayList<>(); final Set<Task> tasks = new HashSet<>(streamThread.tasks().values()); if (streamThread.standbyTasks() != null) { tasks.addAll(streamThread.standbyTasks().values()); } for (final Task streamTask : tasks) { final StateStore store = streamTask.getStore(storeName); if (store != null && queryableStoreType.accepts(store)) { if (!store.isOpen()) { throw new InvalidStateStoreException("Cannot get state store " + storeName + " for task " + streamTask + " because the store is not open. The state store may have migrated to another instances."); } if (store instanceof TimestampedKeyValueStore && queryableStoreType instanceof QueryableStoreTypes.KeyValueStoreType) { stores.add((T) new ReadOnlyKeyValueStoreFacade((TimestampedKeyValueStore<Object, Object>) store)); } else if (store instanceof TimestampedWindowStore && queryableStoreType instanceof QueryableStoreTypes.WindowStoreType) { stores.add((T) new ReadOnlyWindowStoreFacade((TimestampedWindowStore<Object, Object>) store)); } else { stores.add((T) store); } } } return stores; }</code><technical_language>suggestion streamThread.state() + ", RUNNING REBALANCING");</technical_language>

Target:
public <T> List<T> stores(final String storeName, final QueryableStoreType<T> queryableStoreType) { if (streamThread.state() == StreamThread.State.DEAD) { return Collections.emptyList(); } if (!streamThread.isRunning()) { throw new InvalidStateStoreException("Cannot get state store " + storeName + " because the stream thread is " + streamThread.state() + ", not RUNNING or REBALANCING"); } final List<T> stores = new ArrayList<>(); final Set<Task> tasks = new HashSet<>(streamThread.tasks().values()); if (streamThread.standbyTasks() != null) { tasks.addAll(streamThread.standbyTasks().values()); } for (final Task streamTask : tasks) { final StateStore store = streamTask.getStore(storeName); if (store != null && queryableStoreType.accepts(store)) { if (!store.isOpen()) { throw new InvalidStateStoreException("Cannot get state store " + storeName + " for task " + streamTask + " because the store is not open. The state store may have migrated to another instances."); } if (store instanceof TimestampedKeyValueStore && queryableStoreType instanceof QueryableStoreTypes.KeyValueStoreType) { stores.add((T) new ReadOnlyKeyValueStoreFacade((TimestampedKeyValueStore<Object, Object>) store)); } else if (store instanceof TimestampedWindowStore && queryableStoreType instanceof QueryableStoreTypes.WindowStoreType) { stores.add((T) new ReadOnlyWindowStoreFacade((TimestampedWindowStore<Object, Object>) store)); } else { stores.add((T) store); } } } return stores; }
Source:
<code>public ListIterator<StreamInputPacketIndexEntry> search(final long timestamp) { int max = this.entries.size() - 1; int min = 0; int guessI; StreamInputPacketIndexEntry guessEntry = null; if (this.getEntries().isEmpty()) { return this.getEntries().listIterator(); } if (timestamp < 0) { throw new IllegalArgumentException("timestamp is negative"); } for (;;) { <START> guessI = (max + min) / 2; <END> guessEntry = this.entries.get(guessI); if (min == max) { break; } if (timestamp <= guessEntry.getTimestampEnd()) { max = guessI; } else { min = guessI + 1; } } return this.entries.listIterator(guessI); }</code><technical_language>Hi, I stumbled change accident. This statement lead wrong behaviour if max is big. Assume max = Integer.MAX_VALUE min set middle position: min = guessI +1. In next iteration guessI overflow (max = Integer.MAX_VALUE + min = Integer.MAX_VALUE / 2) guessI = min + ((max - min) / 2)</technical_language>

Target:
public ListIterator<StreamInputPacketIndexEntry> search(final long timestamp) { if (this.getEntries().isEmpty()) { return this.getEntries().listIterator(); } if (timestamp < 0) { throw new IllegalArgumentException("timestamp is negative"); } StreamInputPacketIndexEntry key = new StreamInputPacketIndexEntry(0); key.setTimestampEnd(timestamp); int guessI = Collections.binarySearch(this.entries ,key, new StreamInputPacketIndexEntryComparator()); guessI = (guessI < 0)? ~guessI: guessI; return this.entries.listIterator(guessI); }
Source:
<code>private List<HasMetadata> unmarshalObjects(RecipeImpl k8sRecipe) throws DevfileException { if (!k8sBasedEnvTypes.contains(k8sRecipe.getType())) { String allowedEnvTypes = String.join(" or ", k8sBasedEnvTypes); throw new DevfileException( format( <START> "Kubernetes component can only be applied to a workspace with either %s recipe type" <END> + " but workspace has a recipe of type '%s'", allowedEnvTypes, k8sRecipe.getType())); } return unmarshal(k8sRecipe.getContent()); }</code><technical_language>rest of code is written perspective of arbitrary number of Kubernetes-based environment types existing, "either" suggests two. read "one of" something</technical_language>

Target:
private List<HasMetadata> unmarshalObjects(RecipeImpl k8sRecipe) throws DevfileException { if (!k8sBasedEnvTypes.contains(k8sRecipe.getType())) { String allowedEnvTypes = String.join(" or ", k8sBasedEnvTypes); throw new DevfileException( format( "Kubernetes component can only be applied to a workspace with any of %s recipe type" + " but workspace has a recipe of type '%s'", allowedEnvTypes, k8sRecipe.getType())); } return unmarshal(k8sRecipe.getContent()); }
Source:
<code>public void testValuesFromEnvironment() { AzureBlobStoreConfigProvider provider = new AzureBlobStoreConfigProvider(); XStream stream = new XStream(); stream = provider.getConfiguredXStream(stream); <START> Object config = stream.fromXML(getClass().getResourceAsStream("blobstore.xml")); <END> assertTrue(config instanceof AzureBlobStoreInfo); AzureBlobStoreInfo abConfig = (AzureBlobStoreInfo) config; assertEquals("MYCONTAINER", abConfig.getContainer()); assertEquals("30", abConfig.getMaxConnections()); assertEquals(true, abConfig.isEnabled()); }</code><technical_language>Please do remove, test is check environment variables survive a xstream load (this is core of issue report), while another test checking variable expansion works</technical_language>

Target:
public void testValuesFromEnvironment() { AzureBlobStoreConfigProvider provider = new AzureBlobStoreConfigProvider(); XStream stream = new XStream(); stream = provider.getConfiguredXStream(stream); Object config = stream.fromXML(getClass().getResourceAsStream("blobstore.xml")); assertTrue(config instanceof AzureBlobStoreInfo); AzureBlobStoreInfo abConfig = (AzureBlobStoreInfo) config; assertEquals("${CONTAINER}", abConfig.getContainer()); assertEquals("myname", abConfig.getAccountName()); assertEquals("${MYKEY}", abConfig.getAccountKey()); assertEquals("30", abConfig.getMaxConnections()); assertEquals(true, abConfig.isEnabled()); }
Source:
<code>private void init() { setTitle(ConstantsManager.getInstance().getConstants().editLogicalNetworkTitle()); setHashName("edit_logical_network"); getName().setEntity(getNetwork().getName()); if (isManagemet()) { getName().setIsChangable(false); } getDescription().setEntity(getNetwork().getDescription()); getIsStpEnabled().setEntity(getNetwork().getStp()); getHasVLanTag().setEntity(getNetwork().getVlanId() != null); <START> getVLanTag().setEntity((getNetwork().getVlanId() == null ? new Integer(0) : getNetwork().getVlanId())); <END> initMtu(); initIsVm(); }</code><technical_language>Integer.valueOf(0)</technical_language>

Target:
private void init() { setTitle(ConstantsManager.getInstance().getConstants().editLogicalNetworkTitle()); setHashName("edit_logical_network"); getName().setEntity(getNetwork().getName()); if (isManagemet()) { getName().setIsChangable(false); } getDescription().setEntity(getNetwork().getDescription()); getIsStpEnabled().setEntity(getNetwork().getStp()); getHasVLanTag().setEntity(getNetwork().getVlanId() != null); getVLanTag().setEntity((getNetwork().getVlanId() == null ? Integer.valueOf(0) : getNetwork().getVlanId())); initMtu(); initIsVm(); }