auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean matches(DataSourceMetadata other) { if (getClass() != other.getClass()) { return false; } DerivativeDataSourceMetadata that = (DerivativeDataSourceMetadata) other; if (!baseDataSource.equals(that.getBaseDataSource()) || !metrics.equals(that.getMetrics())) { return false; } return dimensions.equals(that.getDimensions()); <START> } <END></code><technical_language>nit: please break a line</technical_language>

Target:
public boolean matches(DataSourceMetadata other) { return equals(other); }
Source:
<code>public static void addBulletList(XWPFDocument document, List<String> bulletListItems, boolean bulletListItemsAsLink) throws XmlException { CTNumbering cTNumbering = CTNumbering.Factory.parse(cTAbstractNumBulletXML); CTAbstractNum cTAbstractNum = cTNumbering.getAbstractNumArray(0); XWPFAbstractNum abstractNum = new XWPFAbstractNum(cTAbstractNum); XWPFNumbering numbering = document.createNumbering(); BigInteger abstractNumID = numbering.addAbstractNum(abstractNum); BigInteger numID = numbering.addNum(abstractNumID); for (int i = 0; i < bulletListItems.size(); i++) { String bulletItem = bulletListItems.get(i); XWPFParagraph paragraph = document.createParagraph(); paragraph.setNumID(numID); if (bulletListItemsAsLink) { <START> addHyperLink(paragraph, "bookmark_" + bulletItem, bulletItem); <END> } else { setText(paragraph.createRun(), bulletItem); } if (i < bulletListItems.size() - 1) { paragraph.setSpacingAfter(0); } } }</code><technical_language>magic string "bookmark_"</technical_language>

Target:
public static void addBulletList(XWPFDocument document, List<String> bulletListItems, boolean bulletListItemsAsLink) throws XmlException { CTNumbering cTNumbering = CTNumbering.Factory.parse(cTAbstractNumBulletXML); CTAbstractNum cTAbstractNum = cTNumbering.getAbstractNumArray(0); XWPFAbstractNum abstractNum = new XWPFAbstractNum(cTAbstractNum); XWPFNumbering numbering = document.createNumbering(); BigInteger abstractNumID = numbering.addAbstractNum(abstractNum); BigInteger numID = numbering.addNum(abstractNumID); for (int i = 0; i < bulletListItems.size(); i++) { String bulletItem = bulletListItems.get(i); XWPFParagraph paragraph = document.createParagraph(); paragraph.setNumID(numID); if (bulletListItemsAsLink) { addBookmarkHyperLink(paragraph, bulletItem, bulletItem); } else { setText(paragraph.createRun(), bulletItem); } if (i < bulletListItems.size() - 1) { paragraph.setSpacingAfter(0); } } }
Source:
<code>public boolean supportsReset() { return delegates.stream() <START> .map(EventHandlerInvoker::supportsReset) <END> .reduce(false, Boolean::logicalOr); }</code><technical_language>delegates.stream().anyMatch(EventHandlerInvoker::supportsReset)? allow stop checking "true"</technical_language>

Target:
public boolean supportsReset() { return delegates.stream() .anyMatch(EventHandlerInvoker::supportsReset); }
Source:
<code>protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) { <START> if (myHyperlinks.length == 1) { <END> myHyperlinks[0].executeIfClicked(myProject, e); return; } for (NotificationHyperlink hyperlink : myHyperlinks) { if (hyperlink.executeIfClicked(myProject, e)) { return; } } }</code><technical_language>I do loop unrolling</technical_language>

Target:
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) { for (NotificationHyperlink hyperlink : myHyperlinks) { if (hyperlink.executeIfClicked(myProject, e)) { return; } } }
Source:
<code><START> public void clearWindowState(W window) { <END> windowAccumulateData.setCurrentNamespace(window); windowAccumulateData.clear(); windowRetractData.setCurrentNamespace(window); windowRetractData.clear(); }</code><technical_language>this method called</technical_language>

Target:
public void clearWindowState(W window) { throw new RuntimeException("The method clearWindowState should not be called."); }
Source:
<code>public Response getClusterStateModelDefinition(@PathParam("clusterId") String clusterId, @PathParam("statemodel") String statemodel) { HelixDataAccessor dataAccessor = getDataAccssor(clusterId); StateModelDefinition stateModelDef = dataAccessor.getProperty(dataAccessor.keyBuilder().stateModelDef(statemodel)); if (stateModelDef == null) { <START> return notFound(); <END> } return JSONRepresentation(stateModelDef.getRecord()); }</code><technical_language>remove extra space? great code quality for open source :-)</technical_language>

Target:
public Response getClusterStateModelDefinition(@PathParam("clusterId") String clusterId, @PathParam("statemodel") String statemodel) { HelixDataAccessor dataAccessor = getDataAccssor(clusterId); StateModelDefinition stateModelDef = dataAccessor.getProperty(dataAccessor.keyBuilder().stateModelDef(statemodel)); if (stateModelDef == null) { return badRequest("Statemodel not found!"); } return JSONRepresentation(stateModelDef.getRecord()); }
Source:
<code>public BugReportDialog(Context context) { super(context); final BugReportView view = (BugReportView) LayoutInflater.from(context).inflate(R.layout.bugreport_view, null); view.setBugReportListener(this); setTitle("Report a bug"); setView(view); <START> setButton(Dialog.BUTTON_NEGATIVE, "Cancel", new OnClickListener() { <END> @Override public void onClick(DialogInterface dialog, int which) { } }); setButton(Dialog.BUTTON_POSITIVE, "Submit", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (listener != null) { listener.onBugReportSubmit(view.getReport()); } } }); }</code><technical_language>pass null instead of empty listener</technical_language>

Target:
public BugReportDialog(Context context) { super(context); final BugReportView view = (BugReportView) LayoutInflater.from(context).inflate(R.layout.bugreport_view, null); view.setBugReportListener(this); setTitle("Report a bug"); setView(view); setButton(Dialog.BUTTON_NEGATIVE, "Cancel", (OnClickListener) null); setButton(Dialog.BUTTON_POSITIVE, "Submit", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (listener != null) { listener.onBugReportSubmit(view.getReport()); } } }); }
Source:
<code>public static void setUp() throws IOException, TimeoutException, InterruptedException { operations.add(endpointConfigurationAddress); administration.reloadIfRequired(); operations.add(preHandlerChainAddress); administration.reloadIfRequired(); operations.add(postHandlerChainAddress); <START> administration.reloadIfRequired(); <END> }</code><technical_language>If resources dependent other, reload adding needed. reload adding endpointConfigurationAddress adding preHandlerChainAddress postHandlerChainAddress enough</technical_language>

Target:
public static void setUp() throws IOException, TimeoutException, InterruptedException { operations.add(endpointConfigurationAddress); administration.reloadIfRequired(); operations.add(preHandlerChainAddress); operations.add(postHandlerChainAddress); administration.reloadIfRequired(); }
Source:
<code>private static ImmutableList<Arguments> getRequiredArgs(final Ds3Request ds3Request) { final ImmutableList.Builder<Arguments> requiredArgsBuilder = ImmutableList.builder(); LOG.debug("Getting required args..."); if (ds3Request.getBucketRequirement() == Requirement.REQUIRED) { LOG.debug("bucket name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "bucketName")); if (ds3Request.getObjectRequirement() == Requirement.REQUIRED) { LOG.debug("object name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "objectName")); } } LOG.debug("Getting required query params..."); if (ConverterUtil.isEmpty(ds3Request.getRequiredQueryParams())) { return requiredArgsBuilder.build(); } for (final Ds3Param ds3Param : ds3Request.getRequiredQueryParams()) { if (ds3Param == null) break; LOG.debug(" query param " + ds3Param.getType()); final String paramType = ds3Param.getType().substring(ds3Param.getType().lastIndexOf(".") + 1); <START> LOG.debug(" param " + paramType + " is required."); <END> requiredArgsBuilder.add(new Arguments(paramType, ds3Param.getName())); } return requiredArgsBuilder.build(); }</code><technical_language>\t for indentation instead of spaces</technical_language>

Target:
private static ImmutableList<Arguments> getRequiredArgs(final Ds3Request ds3Request) { final ImmutableList.Builder<Arguments> requiredArgsBuilder = ImmutableList.builder(); LOG.debug("Getting required args..."); if (ds3Request.getBucketRequirement() == Requirement.REQUIRED) { LOG.debug("\tbucket name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "bucketName")); if (ds3Request.getObjectRequirement() == Requirement.REQUIRED) { LOG.debug("\tobject name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "objectName")); } } LOG.debug("Getting required query params..."); if (ConverterUtil.isEmpty(ds3Request.getRequiredQueryParams())) { return requiredArgsBuilder.build(); } for (final Ds3Param ds3Param : ds3Request.getRequiredQueryParams()) { if (ds3Param == null) break; LOG.debug("\tquery param " + ds3Param.getType()); final String paramType = ds3Param.getType().substring(ds3Param.getType().lastIndexOf(".") + 1); LOG.debug("\tparam " + paramType + " is required."); requiredArgsBuilder.add(new Arguments(paramType, ds3Param.getName())); } return requiredArgsBuilder.build(); }
Source:
<code>private void setupKeyEvents() { addEventHandler(KeyEvent.KEY_PRESSED, event -> { if ((KeyboardShortcuts.rightPanel.match(event) || KeyboardShortcuts.leftPanel.match(event))) { handleKeys(KeyboardShortcuts.rightPanel.match(event)); assert currentlySelectedPanel.isPresent() : "handleKeys doesn't set selectedIndex!"; } if (KeyboardShortcuts.SWAP_PANEL_LEFT.match(event)) { Optional<Integer> current = this.currentlySelectedPanel; if (current.isPresent()) { movePanelLeft(current.get()); <START> } <END> } else if (KeyboardShortcuts.SWAP_PANEL_RIGHT.match(event)) { Optional<Integer> current = this.currentlySelectedPanel; if (current.isPresent()) { movePanelRight(current.get()); } } }); }</code><technical_language>This branch replaced java currentlySelectedPanel.ifPresent(this::movePanelLeft);</technical_language>

Target:
private void setupKeyEvents() { addEventHandler(KeyEvent.KEY_PRESSED, event -> { if ((KeyboardShortcuts.rightPanel.match(event) || KeyboardShortcuts.leftPanel.match(event))) { handleKeys(KeyboardShortcuts.rightPanel.match(event)); assert currentlySelectedPanel.isPresent() : "handleKeys doesn't set selectedIndex!"; } if (KeyboardShortcuts.SWAP_PANEL_LEFT.match(event)) { currentlySelectedPanel.ifPresent(this::movePanelLeft); } else if (KeyboardShortcuts.SWAP_PANEL_RIGHT.match(event)) { currentlySelectedPanel.ifPresent(this::movePanelRight); } }); }
Source:
<code>public Expression visitTerminal(TerminalNode node) { <START> if (node.getSymbol().getType() == ManifoldLexer.INTEGER_VALUE) { <END> Value value = new IntegerValue(Integer.valueOf(node.getText())); return new LiteralExpression(value); } else { assert(false); return null; } }</code><technical_language>booleans easy put in some similar code, I assume</technical_language>

Target:
public Expression visitTerminal(TerminalNode node) { if (node.getSymbol().getType() == ManifoldLexer.INTEGER_VALUE) { return new LiteralExpression( new IntegerValue(Integer.valueOf(node.getText())) ); } else if (node.getSymbol().getType() == ManifoldLexer.BOOLEAN_VALUE) { return new LiteralExpression( BooleanValue.getInstance(Boolean.parseBoolean(node.getText())) ); } else { assert(false); return null; } }
Source:
<code>public AbstractBuilder withCommunicationWindow(final List<WindowElementDto> communicationWindow) { if (communicationWindow == null) { this.communicationWindow = null; } else { <START> this.communicationWindow = new ArrayList<>(communicationWindow); <END> } this.communicationWindow = communicationWindow; return this; }</code><technical_language>Is this wanted functionality? Making a new list this refer object anymore, done in original situation</technical_language>

Target:
public AbstractBuilder withCommunicationWindow(final List<WindowElementDto> communicationWindow) { if (communicationWindow == null) { this.communicationWindow = null; } else { this.communicationWindow = communicationWindow; } this.communicationWindow = communicationWindow; return this; }
Source:
<code>public String getJBossDiscoveryDirectory() { String directory = System.getProperty(JBOSS_DISCOVERY_DIRECTORY, null); if (directory == null) { IPropertiesProvider pp = PropertiesHelper.getPropertiesProvider(); try { directory = pp.getValue(JBOSS_DISCOVERY_DIRECTORY, new NullProgressMonitor()); } catch (CoreException e) { <START> throw new RuntimeException(e); <END> } } return directory; }</code><technical_language>a default this</technical_language>

Target:
public String getJBossDiscoveryDirectory() { String directory = System.getProperty(JBOSS_DISCOVERY_DIRECTORY, null); if (directory == null) { IPropertiesProvider pp = PropertiesHelper.getPropertiesProvider(); directory = pp.getValue(JBOSS_DISCOVERY_DIRECTORY); } return directory; }
Source:
<code>public void getLdapAccessHandlesNull() { GitlabGroup group = new GitlabGroup(); group.setLdapAccess(null); <START> group.getLdapAccess(); <END> }</code><technical_language>assertion this</technical_language>

Target:
public void getLdapAccessHandlesNull() { GitlabGroup group = new GitlabGroup(); group.setLdapAccess(null); assertNull( group.getLdapAccess() ); }
Source:
<code>private void assertCostHasUnknownComponentsForUnknownStats(PlanNode node, Map<String, Type> types) { new CostAssertionBuilder(calculateCumulativeCost( costCalculatorUsingExchanges, <START> node, <END> planNode -> UNKNOWN_COST, planNode -> PlanNodeStatsEstimate.unknown(), types)) .hasUnknownComponents(); new CostAssertionBuilder(calculateCumulativeCost( costCalculatorWithEstimatedExchanges, node, planNode -> UNKNOWN_COST, planNode -> PlanNodeStatsEstimate.unknown(), types)) .hasUnknownComponents(); }</code><technical_language>replace UNKNOWN_COST Cost.unknown() for consistency</technical_language>

Target:
private void assertCostHasUnknownComponentsForUnknownStats(PlanNode node, Map<String, Type> types) { new CostAssertionBuilder(calculateCumulativeCost( costCalculatorUsingExchanges, node, planNode -> PlanNodeCostEstimate.unknown(), planNode -> PlanNodeStatsEstimate.unknown(), types)) .hasUnknownComponents(); new CostAssertionBuilder(calculateCumulativeCost( costCalculatorWithEstimatedExchanges, node, planNode -> PlanNodeCostEstimate.unknown(), planNode -> PlanNodeStatsEstimate.unknown(), types)) .hasUnknownComponents(); }
Source:
<code>protected void sharedHarvest(ItemStack stack, World world, EntityPlayer player, BlockPos blockPos, IBlockState blockState, boolean silkTouch, int fortuneLvl) { if (blockState.getBlockHardness(world, blockPos) != -1.0F) { float strengthVsBlock = getDestroySpeed(stack, blockState); if (strengthVsBlock > 1.1F && world.canMineBlockBody(player, blockPos)) { if (silkTouch && blockState.getBlock().canSilkHarvest(world, blockPos, world.getBlockState(blockPos), player)) ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(Item.getItemFromBlock(blockState.getBlock()))); else { <START> NonNullList<ItemStack> itemDrops = NonNullList.create(); <END> blockState.getBlock().getDrops(itemDrops, world, blockPos, world.getBlockState(blockPos), fortuneLvl); for (ItemStack stacks : itemDrops) ItemHandlerHelper.giveItemToPlayer(player, stacks); } blockState.getBlock().removedByPlayer(world.getBlockState(blockPos), world, blockPos, player, false); } } }</code><technical_language>Irrelevant change do this myself</technical_language>

Target:
protected void sharedHarvest(ItemStack stack, World world, EntityPlayer player, BlockPos blockPos, IBlockState blockState, boolean silkTouch, int fortuneLvl) { if (blockState.getBlockHardness(world, blockPos) != -1.0F) { float strengthVsBlock = getDestroySpeed(stack, blockState); if (strengthVsBlock > 1.1F && world.canMineBlockBody(player, blockPos)) { if (silkTouch && blockState.getBlock().canSilkHarvest(world, blockPos, world.getBlockState(blockPos), player)) ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(Item.getItemFromBlock(blockState.getBlock()))); else { NonNullList<ItemStack> itemDrops = new NonNullList<>(); blockState.getBlock().getDrops(itemDrops, world, blockPos, world.getBlockState(blockPos), fortuneLvl); for (ItemStack stacks : itemDrops) ItemHandlerHelper.giveItemToPlayer(player, stacks); } blockState.getBlock().removedByPlayer(world.getBlockState(blockPos), world, blockPos, player, false); } } }
Source:
<code>public void setSessionId(long sessionId) { <START> this.fSessionId = sessionId; <END> }</code><technical_language>remote this</technical_language>

Target:
public void setSessionId(long sessionId) { fSessionId = sessionId; }
Source:
<code>public String addSharedScope(Scope scope, String tenantDomain) throws APIManagementException { Set<Scope> scopeSet = new HashSet<>(); scopeSet.add(scope); int tenantId = APIUtil.getTenantIdFromTenantDomain(tenantDomain); scopesDAO.addScopes(scopeSet, tenantId); Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain); for (Map.Entry<String, KeyManagerDto> keyManagerDtoEntry : tenantKeyManagers.entrySet()) { KeyManager keyManager = keyManagerDtoEntry.getValue().getKeyManager(); if (keyManager != null) { try{ keyManager.registerScope(scope); }catch (APIManagementException e){ <START> log.error("Error occured while registering Scope in KeyManager " + keyManagerDtoEntry.getKey(), e); <END> } } if (log.isDebugEnabled()) { log.debug("Adding shared scope mapping: " + scope.getKey() + " to Keymanager: " + keyManagerDtoEntry.getKey()); } } return ApiMgtDAO.getInstance().addSharedScope(scope, tenantDomain); }</code><technical_language>shouldnt throw exception</technical_language>

Target:
public String addSharedScope(Scope scope, String tenantDomain) throws APIManagementException { Set<Scope> scopeSet = new HashSet<>(); scopeSet.add(scope); int tenantId = APIUtil.getTenantIdFromTenantDomain(tenantDomain); addScopes(scopeSet, tenantId); Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain); for (Map.Entry<String, KeyManagerDto> keyManagerDtoEntry : tenantKeyManagers.entrySet()) { KeyManager keyManager = keyManagerDtoEntry.getValue().getKeyManager(); if (keyManager != null) { try { keyManager.registerScope(scope); } catch (APIManagementException e) { log.error("Error occurred while registering Scope in Key Manager " + keyManagerDtoEntry.getKey(), e); } } if (log.isDebugEnabled()) { log.debug("Adding shared scope mapping: " + scope.getKey() + " to Key Manager : " + keyManagerDtoEntry.getKey()); } } return ApiMgtDAO.getInstance().addSharedScope(scope, tenantDomain); }
Source:
<code>public void addPrimaryReassignmentDetails(PartitionRebalanceInfo details) { totalPrimaryTransfersCompleted += details.getPrimaryTransfersCompleted(); <START> totalPrimaryTransferTime = totalPrimaryTransferTime + details.getPrimaryTransferTime(); <END> }</code><technical_language>This replaced totalPrimaryTransferTime += details.getPrimaryTransferTime();</technical_language>

Target:
public void addPrimaryReassignmentDetails(PartitionRebalanceInfo details) { totalPrimaryTransfersCompleted += details.getPrimaryTransfersCompleted(); totalPrimaryTransferTime += details.getPrimaryTransferTime(); }
Source:
<code>public SourceState poll(Emitter<StructuredRecord> writer, SourceState currentState) throws Exception { URL url = new URL(config.getUrl()); String response; URLConnection rawConnection = url.openConnection(); try { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); try { if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { <START> response = new String(ByteStreams.toByteArray(connection.getInputStream()), Charsets.UTF_8); <END> } else if (connection.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) { response = new String(ByteStreams.toByteArray(connection.getErrorStream()), Charsets.UTF_8); } else { throw new Exception("Invalid response code returned: " + connection.getResponseCode()); } } finally { connection.disconnect(); } } catch (ClassCastException e) { if (e.getMessage().contains("FileURLConnection cannot be cast to java.net.HttpURLConnection")) { response = new String(ByteStreams.toByteArray(rawConnection.getInputStream()), Charsets.UTF_8); } else { throw e; } } Map<String, List<String>> headers = rawConnection.getHeaderFields(); Map<String, String> flattenedHeaders = new HashMap<>(); for (Map.Entry<String, List<String>> entry : headers.entrySet()) { if (!Strings.isNullOrEmpty(entry.getKey())) { flattenedHeaders.put(entry.getKey(), Joiner.on(',').skipNulls().join(entry.getValue())); } } writeDefaultRecords(writer, response, flattenedHeaders); TimeUnit.SECONDS.sleep(config.getDelayInSeconds()); return currentState; }</code><technical_language>Bytes.toString(ByteStreams.toByteArray(connection.getInputStream()) for brevity</technical_language>

Target:
public SourceState poll(Emitter<StructuredRecord> writer, SourceState currentState) throws Exception { URL url = new URL(config.getUrl()); String response; URLConnection rawConnection = url.openConnection(); try { HttpURLConnection connection = (HttpURLConnection) rawConnection; try { if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { response = Bytes.toString(ByteStreams.toByteArray(connection.getInputStream())); } else if (connection.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) { response = Bytes.toString(ByteStreams.toByteArray(connection.getErrorStream())); } else { throw new Exception("Invalid response code returned: " + connection.getResponseCode()); } } finally { connection.disconnect(); } } catch (ClassCastException e) { if (e.getMessage().contains("FileURLConnection cannot be cast to java.net.HttpURLConnection")) { response = Bytes.toString(ByteStreams.toByteArray(rawConnection.getInputStream())); } else { throw e; } } Map<String, List<String>> headers = rawConnection.getHeaderFields(); Map<String, String> flattenedHeaders = new HashMap<>(); for (Map.Entry<String, List<String>> entry : headers.entrySet()) { if (!Strings.isNullOrEmpty(entry.getKey())) { flattenedHeaders.put(entry.getKey(), Joiner.on(',').skipNulls().join(entry.getValue())); } } writeDefaultRecords(writer, response, flattenedHeaders); TimeUnit.SECONDS.sleep(config.getIntervalInSeconds()); return currentState; }
Source:
<code>public void afterPlace(GlowPlayer player, GlowBlock block, ItemStack holding) { if (block.getType() == Material.BED_BLOCK) { <START> BlockFace direction; <END> direction = ((Bed)block.getState().getData()).getFacing(); GlowBlock headBlock; headBlock = block.getRelative(direction); headBlock.setType(Material.BED_BLOCK); GlowBlockState headBlockState; headBlockState = headBlock.getState(); MaterialData data = headBlockState.getData(); ((Bed)data).setHeadOfBed(true); ((Bed)data).setFacingDirection(direction); headBlockState.setData(data); headBlockState.update(true); } }</code><technical_language>of variables declared set. Instead set declared</technical_language>

Target:
public void afterPlace(GlowPlayer player, GlowBlock block, ItemStack holding) { if (block.getType() == Material.BED_BLOCK) { BlockFace direction = ((Bed)block.getState().getData()).getFacing(); GlowBlock headBlock = block.getRelative(direction); headBlock.setType(Material.BED_BLOCK); GlowBlockState headBlockState = headBlock.getState(); MaterialData data = headBlockState.getData(); ((Bed)data).setHeadOfBed(true); ((Bed)data).setFacingDirection(direction); headBlockState.setData(data); headBlockState.update(true); } }
Source:
<code>private static Integer sysPropToIntOrNull(String sysProp) { final String val = System.getProperty(sysProp, null); if (val == null) { return null; } try { return Integer.parseInt(val); } catch (NumberFormatException e) { <START> LOG.error("Failed to parse value of system property {}='{}' to an integer. Using default value."); <END> return null; } }</code><technical_language>Missing substitutions for {}'s. suggestion LOG.error("Failed parse of system property {}='{}' integer. default value.", sysProp, val);</technical_language>

Target:
private static Integer sysPropToIntOrNull(String sysProp) { final String val = System.getProperty(sysProp, null); if (val == null) { return null; } try { return Integer.parseInt(val); } catch (NumberFormatException e) { LOG.error("Failed to parse value of system property {}='{}' to an integer. Using default value.", sysProp, val); return null; } }
Source:
<code>public void testPutFunctionExtension1() throws InterruptedException { log.info("PutFunctionExtension TestCase with test attributeExpressionExecutors length"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "\ndefine stream inputStream (symbol string, price long, volume long);"; String query = ("@info(name = 'query1') from inputStream select symbol,price, " + "map:create() as tmpMap insert into tmpStream;" + "@info(name = 'query2') from tmpStream select symbol,price,tmpMap, map:put(tmpMap,symbol) as newmap" + " insert into outputStream;" ); <START> ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query); <END> InputHandler inputHandler = executionPlanRuntime.getInputHandler("inputStream"); executionPlanRuntime.start(); executionPlanRuntime.shutdown(); }</code><technical_language>lines needed. createExecutionplanRuntime throw exception</technical_language>

Target:
public void testPutFunctionExtension1() throws InterruptedException { log.info("PutFunctionExtension TestCase with test attributeExpressionExecutors length"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "\ndefine stream inputStream (symbol string, price long, volume long);"; String query = ("@info(name = 'query1') from inputStream select symbol,price, " + "map:create() as tmpMap insert into tmpStream;" + "@info(name = 'query2') from tmpStream select symbol,price,tmpMap, map:put(tmpMap,symbol) as newmap" + " insert into outputStream;" ); ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query); executionPlanRuntime.start(); executionPlanRuntime.shutdown(); }
Source:
<code>static byte[] hash(byte[] secret, byte[] label, byte[] seed, int length, String algo) { if (length < 0) { throw new IllegalArgumentException("You must provide a length greater than zero."); } try { Mac hmac = Mac.getInstance(algo); hmac.init(new SecretKeySpec(secret, algo)); <START> int iterations = (int) Math.ceil(length / (double) hmac.getMacLength()); <END> byte[] expansion = new byte[0]; byte[] data = concat(label, seed); byte[] A = data; for (int i = 0; i < iterations; i++) { A = hmac.doFinal(A); expansion = concat(expansion, hmac.doFinal(concat(A, data))); } return Arrays.copyOf(expansion, length); } catch (GeneralSecurityException e) { throw new IllegalArgumentException("Could not find algo: " + algo, e); } }</code><technical_language>remove</technical_language>

Target:
static byte[] hash(byte[] secret, byte[] label, byte[] seed, int length, String algo) { if (length < 0) { throw new IllegalArgumentException("You must provide a length greater than zero."); } try { Mac hmac = Mac.getInstance(algo); hmac.init(new SecretKeySpec(secret, algo)); int iterations = (int) Math.ceil(length / (double) hmac.getMacLength()); byte[] expansion = EmptyArrays.EMPTY_BYTES; byte[] data = concat(label, seed); byte[] A = data; for (int i = 0; i < iterations; i++) { A = hmac.doFinal(A); expansion = concat(expansion, hmac.doFinal(concat(A, data))); } return Arrays.copyOf(expansion, length); } catch (GeneralSecurityException e) { throw new IllegalArgumentException("Could not find algo: " + algo, e); } }
Source:
<code>synchronized List<T> take(int n) throws InterruptedException { readingLock.lock(); List<T> result = new LinkedList<T>(); while (queue.size() < n) { try { nonEmpty.await(); } catch (InterruptedException e) { throw e; } } for (int i = 0; i < n; ++i) { result.add(queue.element()); <START> queue.remove(); <END> } if (queue.size() == 0) { empty.signal(); } readingLock.unlock(); return result; }</code><technical_language>result.add(queue.remove())</technical_language>

Target:
public synchronized List<T> take(int n) throws InterruptedException { try { lock.lock(); List<T> result = new LinkedList<T>(); while (queue.size() < n) { try { boolean flag = nonEmpty.await(5, TimeUnit.SECONDS); if (!flag) { return result; } } catch (InterruptedException e) { throw e; } } for (int i = 0; i < n; ++i) { result.add(queue.remove()); } empty.signal(); return result; } finally { lock.unlock(); } }
Source:
<code>public void validateConnectionParams_Valid() { HashMap<String, Object> connectParams = new HashMap<String, Object>(); connectParams.put(RCConnection.ParameterKeys.CONNECTION_PEER, "restcomm"); connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, true); connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, true); connectParams.put(RCConnection.ParameterKeys.CONNECTION_LOCAL_VIDEO, new PercentFrameLayout(context)); connectParams.put(RCConnection.ParameterKeys.CONNECTION_LOCAL_VIDEO, new PercentFrameLayout(context)); connectParams.put(RCConnection.ParameterKeys.CONNECTION_REMOTE_VIDEO, new PercentFrameLayout(context)); try { connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, false); RCUtils.validateConnectionParms(connectParams); } catch (RCException ex) { <START> assertThat(ex.errorCode).isEqualTo(RCClient.ErrorCodes.SUCCESS); <END> } }</code><technical_language>this is a valid scenario prefer instead of asserting SUCCESS fail() cleaner. Wdyt</technical_language>

Target:
public void validateConnectionParams_Valid() { HashMap<String, Object> connectParams = new HashMap<String, Object>(); connectParams.put(RCConnection.ParameterKeys.CONNECTION_PEER, "restcomm"); connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, true); connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, true); connectParams.put(RCConnection.ParameterKeys.CONNECTION_LOCAL_VIDEO, new PercentFrameLayout(context)); connectParams.put(RCConnection.ParameterKeys.CONNECTION_LOCAL_VIDEO, new PercentFrameLayout(context)); connectParams.put(RCConnection.ParameterKeys.CONNECTION_REMOTE_VIDEO, new PercentFrameLayout(context)); try { connectParams.put(RCConnection.ParameterKeys.CONNECTION_VIDEO_ENABLED, false); RCUtils.validateConnectionParms(connectParams); } catch (RCException ex) { fail(ex.toString()); } }
Source:
<code>public void testMethod() { String suite = "src/test/resources/parametertest/1417.xml"; <START> TestNG testNG = new TestNG(); <END> testNG.setTestSuites(Collections.singletonList(suite)); testNG.run(); Assert.assertFalse(testNG.hasFailure()); Assert.assertFalse(testNG.hasSkip()); }</code><technical_language>A test @AfterClass improve coverage</technical_language>

Target:
public void testMethod() { String suite = "src/test/resources/parametertest/1417.xml"; TestNG testNG = new TestNG(); testNG.setTestSuites(Collections.singletonList(suite)); testNG.run(); Assert.assertFalse(testNG.hasFailure()); Assert.assertFalse(testNG.hasSkip()); Assert.assertEquals(AnotherTestClassSample.getInstance().getBrowsername(), "chrome"); List<String> actual = YetAnotherTestClassSample.getInstance().getBrowsers(); Assert.assertEquals(actual.size(), 2); Assert.assertEquals(actual, Arrays.asList("safari", "safari")); }
Source:
<code>protected void consumeRecordHeaderNameWithTypeParameters() { consumeTypeHeaderNameWithTypeParameters(); TypeDeclaration typeDecl = (TypeDeclaration)this.astStack[this.astPtr]; <START> typeDecl.modifiers |= ExtraCompilerModifiers.AccRecord; <END> }</code><technical_language>changes in consumeRec...() methods in fact a property of RecordDecl - public RecordDeclaration(TypeDeclaration t) { this.modifiers =.. -> add this.modifier |=</technical_language>

Target:
protected void consumeRecordHeaderNameWithTypeParameters() { consumeTypeHeaderNameWithTypeParameters(); }
Source:
<code>private void setupOneSignalSDK() { <START> boolean privacyConsent = true; <END> boolean isLocationShared = OneSignalPrefs.getCachedLocationSharedStatus(context); boolean isInAppMessagingPaused = OneSignalPrefs.getCachedInAppMessagingPausedStatus(context); OneSignal.pauseInAppMessages(isInAppMessagingPaused); Log.d(Tag.DEBUG, Text.PRIVACY_CONSENT_REQUIRED_SET + ": " + privacyConsent); boolean isEmailCached = attemptSignIn(new EmailUpdateCallback() { @Override public void onSuccess() { tasks[0] = true; attemptEnterApplication(); } @Override public void onFailure() { tasks[0] = true; attemptEnterApplication(); } }); if (!isEmailCached) { tasks[0] = true; attemptEnterApplication(); } new Thread() { public void run() { boolean isExternalUserIdCached = attemptExternalUserId(); tasks[1] = true; attemptEnterApplication(); } }.start(); new Thread() { public void run() { boolean hasConsent = OneSignalPrefs.getUserPrivacyConsent(context); OneSignal.provideUserConsent(hasConsent); tasks[2] = true; attemptEnterApplication(); } }.start(); }</code><technical_language>Remove this privacy consent boolean</technical_language>

Target:
private void setupOneSignalSDK() { boolean isInAppMessagingPaused = OneSignalPrefs.getCachedInAppMessagingPausedStatus(context); OneSignal.pauseInAppMessages(isInAppMessagingPaused); boolean isEmailCached = attemptSignIn(new EmailUpdateCallback() { @Override public void onSuccess() { tasks[0] = true; attemptEnterApplication(); } @Override public void onFailure() { tasks[0] = true; attemptEnterApplication(); } }); if (!isEmailCached) { tasks[0] = true; attemptEnterApplication(); } new Thread() { public void run() { boolean isExternalUserIdCached = attemptExternalUserId(); tasks[1] = true; attemptEnterApplication(); } }.start(); new Thread() { public void run() { boolean hasConsent = OneSignalPrefs.getUserPrivacyConsent(context); OneSignal.provideUserConsent(hasConsent); tasks[2] = true; attemptEnterApplication(); } }.start(); }
Source:
<code>public String toString() { <START> return Objects.toStringHelper("ConversationEndCause") <END> .add("ConversationEndType", this.endType) .toString(); }</code><technical_language>toStringHelper(this)</technical_language>

Target:
public String toString() { return Objects.toStringHelper(this) .add("ConversationEndType", this.endType) .toString(); }
Source:
<code>protected boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode newValue, final ModelNode currentValue, final HandbackHolder<Void> handbackHolder) throws OperationFailedException { AttributeDefinition attr = getAttributeDefinition(attributeName); <START> if(attr == ServerDefinition.JOURNAL_FILE_SIZE){ <END> context.addStep(new OperationStepHandler(){ final ModelNode model = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); final ModelNode journalType = ServerDefinition.JOURNAL_TYPE.resolveModelAttribute(context, model); final ModelNode journalFileSize = ServerDefinition.JOURNAL_FILE_SIZE.resolveModelAttribute(context, model); @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (journalType.asString().equalsIgnoreCase(JournalType.ASYNCIO.name()) && (journalFileSize.asLong() % 512 != 0)) { throw MessagingLogger.ROOT_LOGGER.invalidJournalFileSize(journalFileSize.asLong()); } } }, Stage.RUNTIME); } if (attr.getFlags().contains(AttributeAccess.Flag.RESTART_ALL_SERVICES)) { return true; } else { ServiceRegistry registry = context.getServiceRegistry(true); final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(OP_ADDR))); ServiceController<?> service = registry.getService(serviceName); if (service == null) { return false; } else if (service.getState() != ServiceController.State.UP) { return true; } else { if (!ActiveMQActivationService.isActiveMQServerActive(context, operation)) { return false; } applyOperationToActiveMQService(context, operation, attributeName, service); return false; } } }</code><technical_language>implement this validation extending LongRangeValidator in attribute definition</technical_language>

Target:
protected boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode newValue, final ModelNode currentValue, final HandbackHolder<Void> handbackHolder) throws OperationFailedException { AttributeDefinition attr = getAttributeDefinition(attributeName); if (attr.getFlags().contains(AttributeAccess.Flag.RESTART_ALL_SERVICES)) { return true; } else { ServiceRegistry registry = context.getServiceRegistry(true); final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(OP_ADDR))); ServiceController<?> service = registry.getService(serviceName); if (service == null) { return false; } else if (service.getState() != ServiceController.State.UP) { return true; } else { if (!ActiveMQActivationService.isActiveMQServerActive(context, operation)) { return false; } applyOperationToActiveMQService(context, operation, attributeName, service); return false; } } }
Source:
<code>public Request append(Request target, Message message) { <START> message.getExternalMetadata().forEach((header, value) -> target.getHeaders().put(header, value)); <END> return target; }</code><technical_language>difference purpose? is add -> set/override</technical_language>

Target:
public Request append(Request target, Message message) { message.getExternalMetadata().forEach(target::header); return target; }
Source:
<code>protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException, OrmException { Transaction transaction = null; Statement stmt = null; try { <START> transaction = db.beginTransaction(); <END> Connection connection = ((JdbcSchema) db).getConnection(); final boolean projectIdColumnExists = checkColumn(connection); stmt = connection.createStatement(); final SqlDialect dialect = ((JdbcSchema) db).getDialect(); if (dialect instanceof DialectPostgreSQL) { if (!projectIdColumnExists) { stmt.execute("ALTER TABLE projects ADD COLUMN project_id INTEGER"); } stmt.execute("UPDATE projects SET project_id = nextval('project_id')"); } else if (dialect instanceof DialectH2) { if (!projectIdColumnExists) { stmt.execute("ALTER TABLE projects ADD COLUMN project_id INTEGER"); } stmt.execute("UPDATE projects SET project_id = nextval('project_id')"); } else if (dialect instanceof DialectMySQL) { if (!projectIdColumnExists){ stmt.execute("ALTER TABLE projects ADD project_id INTEGER"); } stmt.execute("CREATE FUNCTION nextval_project_id () RETURNS BIGINT" + " LANGUAGE SQL NOT DETERMINISTIC MODIFIES SQL DATA" + " BEGIN INSERT INTO project_id (s) VALUES (NULL);" + " DELETE FROM project_id WHERE s = LAST_INSERT_ID();" + " RETURN LAST_INSERT_ID(); END"); stmt.execute("UPDATE projects SET project_id = nextval_project_id()"); } else { throw new OrmException("Unsupported dialect " + dialect); } if (transaction != null) { transaction.commit(); } } catch (OrmException ormex) { if (transaction != null) { transaction.rollback(); } throw ormex; } catch (SQLException sqlex) { if (transaction != null) { transaction.rollback(); } throw sqlex; } finally { if (stmt != null) { stmt.close(); } } }</code><technical_language>sure, is needed care begin/commit/rollback of database transaction yourself? other migrations care it</technical_language>

Target:
protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException { Statement stmt = ((JdbcSchema) db).getConnection().createStatement(); try { if (((JdbcSchema) db).getDialect() instanceof DialectMySQL) { stmt.execute("DROP INDEX account_project_watches_ntNew ON account_project_watches"); stmt.execute("DROP INDEX account_project_watches_ntCmt ON account_project_watches"); stmt.execute("DROP INDEX account_project_watches_ntSub ON account_project_watches"); } else { stmt.execute("DROP INDEX account_project_watches_ntNew"); stmt.execute("DROP INDEX account_project_watches_ntCmt"); stmt.execute("DROP INDEX account_project_watches_ntSub"); } stmt.execute("CREATE INDEX account_project_watches_byProject" + " ON account_project_watches (project_name)"); } finally { stmt.close(); } }
Source:
<code>private int fluxSequentialMergePrefetch(FeedOptions options, int numberOfPartitions, int pageSize, int fluxConcurrency) { int maxBufferedItemCount = options.getMaxBufferedItemCount(); if (maxBufferedItemCount <= 0) { <START> maxBufferedItemCount = Math.min(Configs.CPU_CNT * numberOfPartitions * pageSize, 100_000); <END> } int fluxPrefetch = Math.max(maxBufferedItemCount / (Math.max(fluxConcurrency * pageSize, 1)), 1); return Math.min(fluxPrefetch, Queues.XS_BUFFER_SIZE); }</code><technical_language>reason 100_000</technical_language>

Target:
private int fluxSequentialMergePrefetch(FeedOptions options, int numberOfPartitions, int pageSize, int fluxConcurrency) { int maxBufferedItemCount = options.getMaxBufferedItemCount(); if (maxBufferedItemCount <= 0) { maxBufferedItemCount = Math.min(Configs.getCPUCnt() * numberOfPartitions * pageSize, 100_000); } int fluxPrefetch = Math.max(maxBufferedItemCount / (Math.max(fluxConcurrency * pageSize, 1)), 1); return Math.min(fluxPrefetch, Queues.XS_BUFFER_SIZE); }
Source:
<code>private boolean isServerMetrics(final MetricMsg metricMsg) { <START> return metricMsg.getCustomMetrics() == null; <END> }</code><technical_language>distinguish executor local blocks of model/input table..</technical_language>

Target:
private boolean isServerMetrics(final MetricMsg metricMsg) { return metricMsg.getTableToNumBlocks().containsKey(MODEL_TABLE_ID); }
Source:
<code>private void handleImage(Object image) { <START> TiDrawableReference source = TiDrawableReference.fromObject(this, image); <END> BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(source.getBitmap()); groundOverlayOptions.image(bitmapDescriptor); }</code><technical_language>source null</technical_language>

Target:
private void handleImage(Object image) { TiDrawableReference source = TiDrawableReference.fromObject(this, image); if (!source.isTypeNull()) { BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(source.getBitmap()); groundOverlayOptions.image(bitmapDescriptor); } }
Source:
<code>static BundleNameInstanceTypeProvider getInstance() { final ExtensionList<BundleNameInstanceTypeProvider> all = ExtensionList.lookup(BundleNameInstanceTypeProvider.class); final int extensionCount = all.size(); if (extensionCount < 1) { LOGGER.fine("No alternative strategy provided for support bundle prefixing."); return DEFAULT_STRATEGY; } if (all.size() > 1) { if (LOGGER.isLoggable(Level.WARNING)) { <START> LOGGER.warning("{0} implementations found for support bundle prefix naming strategy. " + <END> "Can be only 0 or 1. Choosing the first found."); for (BundleNameInstanceTypeProvider bundlePrefixProvider : all) { LOGGER.log(Level.WARNING, "class '{0}' found", bundlePrefixProvider.getClass().getName()); } } } return all.get(0); }</code><technical_language>bug: missing a parameter here. NIT: a stylistic point I Logger.log(Level.XXX ...) Logger.xxx(...)</technical_language>

Target:
static BundleNameInstanceTypeProvider getInstance() { final ExtensionList<BundleNameInstanceTypeProvider> all = ExtensionList.lookup(BundleNameInstanceTypeProvider.class); final int extensionCount = all.size(); if (extensionCount > 2) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, "{0} implementations found for support bundle prefix naming strategy. " + "Can be only 1 (default one) or 2 (default one, plus alternative). " + "Choosing the first found among the following:", extensionCount); for (BundleNameInstanceTypeProvider nameProvider : all) { LOGGER.log(Level.WARNING, "Class {0} found", nameProvider.getClass().getName()); } } } final BundleNameInstanceTypeProvider chosen = all.get(0); if (extensionCount > 1) { LOGGER.log(Level.FINE, "Using {0} as BundleNameInstanceTypeProvider implementation", chosen.getClass().getName()); } return chosen; }
Source:
<code>public static Config defaultOverrides() { <START> if (!getOverrideWithEnv()) { <END> return systemProperties(); } else { return systemEnvironmentOverrides().withFallback(systemProperties()); } }</code><technical_language>easier read if reverse if/else avoid</technical_language>

Target:
public static Config defaultOverrides() { if (getOverrideWithEnv()) { return systemEnvironmentOverrides().withFallback(systemProperties()); } else { return systemProperties(); } }
Source:
<code>public void preferenceChange(PreferenceChangeEvent event) { final IWorkspace ws = ResourcesPlugin.getWorkspace(); if (!ws.isAutoBuilding()) return; Job job = new Job(Messages.DSAnnotationPreferenceListener_jobName) { @Override protected IStatus run(IProgressMonitor monitor) { try { ws.run(new IWorkspaceRunnable() { public void run(IProgressMonitor monitor) throws CoreException { IProject[] projects = ws.getRoot().getProjects(); ArrayList<IProject> managedProjects = new ArrayList<IProject>(projects.length); for (IProject project : projects) { if (project.isOpen() && DSAnnotationCompilationParticipant.isManaged(project)) managedProjects.add(project); } <START> if (monitor != null) <END> monitor.beginTask(Messages.DSAnnotationPreferenceListener_taskName, managedProjects.size()); try { for (IProject project : managedProjects) project.build(IncrementalProjectBuilder.FULL_BUILD, new SubProgressMonitor(monitor, 1)); } finally { if (monitor != null) monitor.done(); } } }, monitor); } catch (CoreException e) { return e.getStatus(); } return Status.OK_STATUS; }; }; PlatformUI.getWorkbench().getProgressService().showInDialog(null, job); job.schedule(); }</code><technical_language>Replace SubMonitor.convert</technical_language>

Target:
public void preferenceChange(PreferenceChangeEvent event) { final IWorkspace ws = ResourcesPlugin.getWorkspace(); if (!ws.isAutoBuilding()) return; Job job = new Job(Messages.DSAnnotationPreferenceListener_jobName) { @Override protected IStatus run(IProgressMonitor monitor) { try { ws.run(new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { IProject[] projects = ws.getRoot().getProjects(); ArrayList<IProject> managedProjects = new ArrayList<>(projects.length); for (IProject project : projects) { if (project.isOpen() && DSAnnotationCompilationParticipant.isManaged(project)) managedProjects.add(project); } SubMonitor progress = SubMonitor.convert(monitor, Messages.DSAnnotationPreferenceListener_taskName, managedProjects.size()); for (IProject project : managedProjects) project.build(IncrementalProjectBuilder.FULL_BUILD, progress.newChild(1)); } }, monitor); } catch (CoreException e) { return e.getStatus(); } return Status.OK_STATUS; }; }; PlatformUI.getWorkbench().getProgressService().showInDialog(null, job); job.schedule(); }
Source:
<code>public void edit(final SetupNetworksBondModel object) { <START> object.getBond().getPropertyChangedEvent().addListener((ev, sender, arg) -> { SortedListModel<String> model = (SortedListModel<String>) sender; if (model.getSelectedItem().length() > 10) { bondSuggestEditor.addStyleName(HAS_WARNING); nameWarningLabel.setVisible(true); } else { bondSuggestEditor.removeStyleName(HAS_WARNING); nameWarningLabel.setVisible(false); } }); <END> driver.edit(object); }</code><technical_language>choose validate length part of SetupNetworksBondModel::validate()? bond name length validation is done change 10 chars instead of 15: getBond().validateSelectedItem(new IValidation[] { new NotEmptyValidation(), new LengthValidation(BusinessEntitiesDefinitions.HOST_NIC_NAME_LENGTH),..</technical_language>

Target:
public void edit(final SetupNetworksBondModel object) { object.getBond().getPropertyChangedEvent().addListener((ev, sender, arg) -> { SortedListModel<String> model = (SortedListModel<String>) sender; int length = model.getSelectedItem().length(); if (length > BusinessEntitiesDefinitions.BOND_NAME_WARNING_LENGTH && length <= BusinessEntitiesDefinitions.HOST_NIC_NAME_LENGTH) { bondSuggestEditor.addStyleName(HAS_WARNING); nameWarningLabel.setVisible(true); } else { bondSuggestEditor.removeStyleName(HAS_WARNING); nameWarningLabel.setVisible(false); } }); driver.edit(object); }