auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean isNotModified(HttpServletRequest request, HttpServletResponse response) { <START> String currentEtag = String.format("W/\"%s\"", <END> Objects.hash( getLastModified(), getProjectMessages(), getEnv().getDateForLastIndexRun().getTime(), Info.getVersion() ) ); String headerEtag = request.getHeader("If-None-Match"); if (headerEtag != null && headerEtag.equals(currentEtag)) { response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); return true; } response.setHeader("ETag", currentEtag); return false; }</code><technical_language>is standard</technical_language>

Target:
public boolean isNotModified(HttpServletRequest request, HttpServletResponse response) { String currentEtag = String.format("W/\"%s\"", Objects.hash( getLastModified(), getProjectMessages(), getEnv().getDateForLastIndexRun().getTime(), Info.getVersion() ) ); String headerEtag = request.getHeader(HttpHeaders.IF_NONE_MATCH); if (headerEtag != null && headerEtag.equals(currentEtag)) { response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); return true; } response.setHeader(HttpHeaders.ETAG, currentEtag); return false; }
Source:
<code>private void handleCookies(String url) { String cookies = CookieManager.getInstance().getCookie(url); if (MainActivity.DEBUG) Log.d(TAG, "handleCookies: url=" + url + "; cookies=" + (cookies == null ? "null" : cookies)); <START> Log.e(TAG, "handleCookies: url=" + url + "; cookies=" + (cookies == null ? "null" : cookies)); <END> if (cookies == null) return; addYoutubeCookies(cookies); }</code><technical_language>I guess this accidentally committed</technical_language>

Target:
private void handleCookies(String url) { String cookies = CookieManager.getInstance().getCookie(url); if (MainActivity.DEBUG) Log.d(TAG, "handleCookies: url=" + url + "; cookies=" + (cookies == null ? "null" : cookies)); if (cookies == null) return; addYoutubeCookies(cookies); }
Source:
<code>public void testSaveExternalEvent() { AuditLog newExternalEvent = new AuditLog(); newExternalEvent.setLogType(AuditLogType.EXTERNAL_EVENT_NORMAL); newExternalEvent.setExternal(true); newExternalEvent.setOrigin("XYZ"); newExternalEvent.setCustomEventId(123123123); newExternalEvent.setCustomData("Some text here"); newExternalEvent.setMessage("And here"); newExternalEvent.setEventFloodInSec(100); dao.save(newExternalEvent); AuditLog result = dao.get(newExternalEvent.getAuditLogId()); <START> <END> assertNotNull(result); assertEquals(newExternalEvent.getOrigin(), result.getOrigin()); assertEquals(newExternalEvent.getCustomEventId(), result.getCustomEventId()); assertEquals(newExternalEvent.getCustomData(), result.getCustomData()); assertEquals(newExternalEvent.getMessage(), result.getMessage()); assertEquals(newExternalEvent.getEventFloodInSec(), result.getEventFloodInSec()); }</code><technical_language>if fixing a bug in returned id for ext event, test log id > 0</technical_language>

Target:
public void testSaveExternalEvent() { AuditLog newExternalEvent = new AuditLog(); newExternalEvent.setLogType(AuditLogType.EXTERNAL_EVENT_NORMAL); newExternalEvent.setExternal(true); newExternalEvent.setOrigin("XYZ"); newExternalEvent.setCustomEventId(123123123); newExternalEvent.setCustomData("Some text here"); newExternalEvent.setMessage("And here"); newExternalEvent.setEventFloodInSec(100); dao.save(newExternalEvent); AuditLog result = dao.get(newExternalEvent.getAuditLogId()); assertNotNull(result); assertTrue(result.getAuditLogId() > 0); assertEquals(newExternalEvent.getOrigin(), result.getOrigin()); assertEquals(newExternalEvent.getCustomEventId(), result.getCustomEventId()); assertEquals(newExternalEvent.getCustomData(), result.getCustomData()); assertEquals(newExternalEvent.getMessage(), result.getMessage()); assertEquals(newExternalEvent.getEventFloodInSec(), result.getEventFloodInSec()); }
Source:
<code><START> private Map<String, Object> getOss() throws IOException { <END> CharSource charSource = backingStore.asByteSource().asCharSource(UTF_8); try (Reader reader = charSource.openBufferedStream(); JsonInput input = json.newInput(reader)) { input.beginObject(); while (input.hasNext()) { String name = input.nextName(); if ("desiredCapabilities".equals(name)) { return input.read(MAP_TYPE); } else { input.skipValue(); } } } return null; }</code><technical_language>Nullable</technical_language>

Target:
private @Nullable Map<String, Object> getOss() throws IOException { CharSource charSource = backingStore.asByteSource().asCharSource(UTF_8); try (Reader reader = charSource.openBufferedStream(); JsonInput input = json.newInput(reader)) { input.beginObject(); while (input.hasNext()) { String name = input.nextName(); if (DESIRED_CAPABILITIES.equals(name)) { return input.read(MAP_TYPE); } input.skipValue(); } } return null; }
Source:
<code>public ISwingScoutFormField<?> createFormField(JComponent parent, IFormField field, ISwingEnvironment environment) { IButton scoutField = (IButton) field; switch (scoutField.getDisplayStyle()) { case IButton.DISPLAY_STYLE_RADIO: { SwingScoutButton uiField = new SwingScoutRadioButton(); uiField.createField(scoutField, environment); <START> return uiField; <END> } case IButton.DISPLAY_STYLE_TOGGLE: { SwingScoutButton uiField = new SwingScoutButton(); uiField.createField(scoutField, environment); return uiField; } case IButton.DISPLAY_STYLE_LINK: { SwingScoutLink uiField = new SwingScoutLink(); uiField.createField(scoutField, environment); return uiField; } default: { SwingScoutButton uiField = new SwingScoutButton(); uiField.createField(scoutField, environment); return uiField; } } }</code><technical_language>moment is model interface IRadioButton is in UI. ISwingScoutRadioButton IButton generic type. I suggest change for moment in UI fields. ISwingScoutButton<IButton> uiField = new SwingScoutRadioButton() more sense interface determine ui is created. if do this display style removed button interface, is a larger step (could done later)</technical_language>

Target:
public ISwingScoutFormField<?> createFormField(JComponent parent, IFormField field, ISwingEnvironment environment) { if (field instanceof IRadioButton) { IRadioButton scoutField = (IRadioButton) field; SwingScoutRadioButton uiField = new SwingScoutRadioButton(); uiField.createField(scoutField, environment); return uiField; } else if (field instanceof IButton) { IButton scoutField = (IButton) field; switch (scoutField.getDisplayStyle()) { case IButton.DISPLAY_STYLE_TOGGLE: { SwingScoutButton<IButton> uiField = new SwingScoutButton<IButton>(); uiField.createField(scoutField, environment); return uiField; } case IButton.DISPLAY_STYLE_RADIO: { LOG.warn("It seems your RadioButton extends from AbstractButton with getConfiguredDisplayStyle set to DISPLAY_STYLE_RADIO. Please use the class AbstractRadioButton instead."); SwingScoutButton<IButton> uiField = new SwingScoutButton<IButton>(); uiField.createField(scoutField, environment); return uiField; } case IButton.DISPLAY_STYLE_LINK: { SwingScoutLink uiField = new SwingScoutLink(); uiField.createField(scoutField, environment); return uiField; } default: { SwingScoutButton<IButton> uiField = new SwingScoutButton<IButton>(); uiField.createField(scoutField, environment); return uiField; } } } return null; }
Source:
<code>public List<String> getStreams() { <START> List<String> streams = new ArrayList<>(); <END> for(ActionRuntime action: actions) { streams.add(action.getStream()); } return streams; }</code><technical_language>Please add logging in for idea of is on</technical_language>

Target:
public List<String> getStreams() { LOG.debug("in getStreams"); List<String> streams = new ArrayList<>(); for(ActionRuntime action: actions) { LOG.debug("Action {}, Stream {}", action, action.getStream()); streams.add(action.getStream()); } LOG.debug("Returning streams {}", streams); return streams; }
Source:
<code>private void readBinaries( int total, BytesColumnVector c, int rowId) throws IOException { int left = total; while (left > 0) { consume(); readRepetitionAndDefinitionLevels(); if (definitionLevel >= maxDefLevel) { Binary binary = dataColumn.readBytes(); c.setVal(rowId, binary.getBytesUnsafe()); c.isNull[rowId] = false; c.isRepeating = c.isRepeating && Arrays.equals(binary.getBytesUnsafe(), <START> ArrayUtils.subarray(c.vector[0], c.start[0], c.length[0])); <END> } else { c.isNull[rowId] = true; c.isRepeating = false; c.noNulls = false; } rowId++; left--; } }</code><technical_language>subarray copying. avoid that</technical_language>

Target:
private void readBinaries( int total, BytesColumnVector c, int rowId) throws IOException { int left = total; while (left > 0) { readRepetitionAndDefinitionLevels(); if (definitionLevel >= maxDefLevel) { c.setVal(rowId, dataColumn.readBytes().getBytesUnsafe()); c.isNull[rowId] = false; c.isRepeating = false; } else { c.isNull[rowId] = true; c.isRepeating = false; c.noNulls = false; } rowId++; left--; } }
Source:
<code>public void addExecutorInGUI() { String name = "ScheduledExecutorGUI" + RandomStringUtils.randomAlphanumeric(6); ConfigFragment config = page.getConfigFragment(); WizardWindow wizard = config.getResourceManager().addResource(); Editor editor = wizard.getEditor(); editor.text("name", name); editor.text(JNDI_NAME, JNDI_VALID); wizard.clickSave(); <START> Console.withBrowser(browser).dismissReloadRequiredWindowIfPresent(); <END> assertTrue("Scheduled executor should be present in table", config.resourceIsPresent(name)); ResourceAddress address = new ResourceAddress(eeAddress).add(EE_CHILD, name); verifier.verifyResource(address, true, 5000); removeEEChild(EE_CHILD, name); }</code><technical_language>In <LINK_0> merged WizardWindow.finishAndDismissReloadRequiredWindow() instead</technical_language>

Target:
public void addExecutorInGUI() { String name = "ScheduledExecutorGUI" + RandomStringUtils.randomAlphanumeric(6); ConfigFragment config = page.getConfigFragment(); WizardWindow wizard = config.getResourceManager().addResource(); Editor editor = wizard.getEditor(); editor.text("name", name); editor.text(JNDI_NAME, JNDI_VALID); wizard.saveAndDismissReloadRequiredWindow(); assertTrue("Scheduled executor should be present in table", config.resourceIsPresent(name)); ResourceAddress address = new ResourceAddress(eeAddress).add(EE_CHILD, name); verifier.verifyResource(address, true, 5000); removeEEChild(EE_CHILD, name); }
Source:
<code>public void dumpTreeAsString(String filePath) { try { FileWriter writer = new FileWriter(filePath); List<ConceptTreeNode<T>> nodeList = getBreadthOrderedNodeList(); for (ConceptTreeNode<T> node : nodeList) { String parent = ""; if (isRoot(node)) <START> parent = "NIL"; <END> else parent = getParent(node).getLabel(); writer.write(parent + "\t" + node.getLabel() + "\t" + node.getLabelDescription() + "\t" + node.getConceptVector().toString() + "\n"); } writer.close(); } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>I prefer a static constant field for string values this... is defined, this statement, is checked (if ever)</technical_language>

Target:
public void dumpTreeAsString(String filePath) { try(FileWriter writer = new FileWriter(filePath)) { List<ConceptTreeNode<T>> nodeList = getBreadthOrderedNodeList(); for (ConceptTreeNode<T> node : nodeList) { String parent; if (isRoot(node)) parent = NIL; else parent = getParent(node).getLabelID(); writer.write(parent + "\t" + node.getLabelID() + "\t" + node.getLabelDescription() + "\t" + node.getConceptVector().toString() + "\n"); } } catch (IOException e) { e.printStackTrace(); logger.error("Error writing to file at " + filePath); throw new RuntimeException("Error writing to file at " + filePath); } }
Source:
<code>private List<AttributeValidationReport> validateAttributeSerializable( String attributeName, Serializable serializable) { List<AttributeValidationReport> validationReportList = new ArrayList<>(); for (AttributeValidator attributeValidator : validators) { <START> Attribute newAttribute = new AttributeImpl(attributeName, serializable); <END> Optional<AttributeValidationReport> attributeValidationReport = attributeValidator.validate(newAttribute); if (attributeValidationReport.isPresent()) { validationReportList.add(attributeValidationReport.get()); } } return validationReportList; }</code><technical_language>Attribute created loop reused</technical_language>

Target:
private List<AttributeValidationReport> validateAttributeSerializable( String attributeName, Serializable serializable) { Attribute newAttribute = new AttributeImpl(attributeName, serializable); List<AttributeValidationReport> validationReportList = new ArrayList<>(); for (AttributeValidator attributeValidator : validators) { Optional<AttributeValidationReport> attributeValidationReport = attributeValidator.validate(newAttribute); if (attributeValidationReport.isPresent()) { validationReportList.add(attributeValidationReport.get()); } } return validationReportList; }
Source:
<code>public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 0) { return false; } Player p; String reason = ""; try { p = getPlayer(args[0]); if(args.length > 1) { for(int i = 1; i < args.length; i++) { reason = reason + args[i] + " "; } } } catch (CantFindPlayerException ex) { playerMsg(ex.getMessage(), ChatColor.RED); return true; } TFM_Util.bcastMsg(p.getName() + " has been a VERY naughty, naughty boy.", ChatColor.RED); TFM_WorldEditBridge.getInstance().undo(p, 15); TFM_RollbackManager.rollback(p); p.setOp(false); p.setGameMode(GameMode.SURVIVAL); p.getInventory().clear(); final Location target_pos = p.getLocation(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(target_pos.getWorld(), target_pos.getBlockX() + x, target_pos.getBlockY(), target_pos.getBlockZ() + z); target_pos.getWorld().strikeLightning(strike_pos); } } String user_ip = p.getAddress().getAddress().getHostAddress(); String[] ip_parts = user_ip.split("\\."); if (ip_parts.length == 4) { user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]); } TFM_Util.bcastMsg(String.format("Banning: %s, IP: %s.", p.getName(), user_ip), ChatColor.RED); TFM_ServerInterface.banIP(user_ip, null, null, null); <START> TFM_ServerInterface.banUsername(p.getName(), null, null, null); <END> if(args.length == 1) { p.kickPlayer("GTFO"); } else { p.kickPlayer(reason); } return true; }</code><technical_language>This is want set banning of username a reason</technical_language>

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 0) { return false; } Player p; String ban_reason = ""; try { p = getPlayer(args[0]); if(args.length > 1) { ban_reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " "); } } catch (CantFindPlayerException ex) { playerMsg(ex.getMessage(), ChatColor.RED); return true; } TFM_Util.bcastMsg(p.getName() + " has been a VERY naughty, naughty boy.", ChatColor.RED); TFM_WorldEditBridge.getInstance().undo(p, 15); TFM_RollbackManager.rollback(p); p.setOp(false); p.setGameMode(GameMode.SURVIVAL); p.getInventory().clear(); final Location target_pos = p.getLocation(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(target_pos.getWorld(), target_pos.getBlockX() + x, target_pos.getBlockY(), target_pos.getBlockZ() + z); target_pos.getWorld().strikeLightning(strike_pos); } } String user_ip = p.getAddress().getAddress().getHostAddress(); String[] ip_parts = user_ip.split("\\."); if (ip_parts.length == 4) { user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]); } TFM_Util.bcastMsg(String.format("Banning: %s, IP: %s.", p.getName(), user_ip), ChatColor.RED); TFM_ServerInterface.banIP(user_ip, ban_reason, null, null); TFM_ServerInterface.banUsername(p.getName(), ban_reason, null, null); p.kickPlayer("GTFO"); return true; }
Source:
<code>public PersistentLockId acquireBackupLock(String reason) { Preconditions.checkNotNull(reason, "Please provide a reason for acquiring the lock."); <START> return PersistentLockId.withId(lockStore.acquireBackupLock(reason).instanceId()); <END> }</code><technical_language>withId -> of</technical_language>

Target:
public PersistentLockId acquireBackupLock(String reason) { Preconditions.checkNotNull(reason, "Please provide a reason for acquiring the lock."); return PersistentLockId.of(lockStore.acquireBackupLock(reason).instanceId()); }
Source:
<code>public static void main(final String... args) throws IOException { cliThread = new CLIThread(); new Thread(cliThread, "CLIThread").start(); log("Type \"stop\" or \"q\" to exit."); try (ServerSocket sock = new ServerSocket(PORT)) { serverSocket = sock; log("Server is now accepting clients."); <START> Socket socket; <END> while (running) { socket = serverSocket.accept(); new Thread(new HighscoreServerThread(socket), "HsServerThread" + socket.getRemoteSocketAddress().toString()).start(); } } catch (IOException e) { if (running) { logError("Could not listen on port " + PORT + ", exiting!"); cliThread.handleCommand("stop"); } } }</code><technical_language>is this variable of loop? Based usages easily place of while loop. < logic</technical_language>

Target:
public static void main(final String... args) throws IOException { cliThread = new CLIThread(); new Thread(cliThread, "CLIThread").start(); log("Type \"stop\" or \"q\" to exit."); try (ServerSocket sock = new ServerSocket(PORT)) { serverSocket = sock; log("Server is now accepting clients."); while (running) { final Socket socket = serverSocket.accept(); new Thread(new HighscoreServerThread(socket), "HsServerThread" + socket.getRemoteSocketAddress().toString()).start(); } } catch (IOException e) { if (running) { logError("Could not listen on port " + PORT + ", exiting!"); cliThread.handleCommand("stop"); } } }
Source:
<code>public Response getTechnologies() throws InternalServerErrorException, NotFoundException { List<Technology> techEntities = technologyDAO.findAll(); if (techEntities == null) { <START> throw new NotFoundException("Não foi encontrado nenhuma tecnologia!"); <END> } else { TechnologiesResponse response = new TechnologiesResponse(); List<TechnologyResponse> internList = new ArrayList<TechnologyResponse>(); for (int i = 0; i < techEntities.size(); i++) { Technology tech = techEntities.get(i); TechnologyResponse techResponseItem = new TechnologyResponse(); techResponseItem.setId(tech.getId()); techResponseItem.setName(tech.getName()); internList.add(techResponseItem); } response.setTechnologies(internList); return response; } }</code><technical_language>Please English for messages</technical_language>

Target:
public Response getTechnologies() throws InternalServerErrorException, NotFoundException { List<Technology> techEntities = technologyDAO.findAll(); if (techEntities == null) { throw new NotFoundException("No technology was found."); } else { TechnologiesResponse response = new TechnologiesResponse(); List<TechnologyResponse> internList = new ArrayList<TechnologyResponse>(); for (int i = 0; i < techEntities.size(); i++) { Technology tech = techEntities.get(i); TechnologyResponse techResponseItem = new TechnologyResponse(); techResponseItem.setId(tech.getId()); techResponseItem.setName(tech.getName()); internList.add(techResponseItem); } response.setTechnologies(internList); return response; } }
Source:
<code>public void testGetAnalysisRequirements() { Iterable<TmfAnalysisRequirement> requirements = fKernelAnalysisModule.getAnalysisRequirements(); assertNotNull(requirements); assertTrue(requirements.iterator().hasNext()); TmfAnalysisRequirement eventReq = null; TmfAnalysisRequirement domainReq = null; int numberOfRequirement = 0; for (TmfAnalysisRequirement requirement : requirements) { ++numberOfRequirement; if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_EVENT)) { eventReq = requirement; } else if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN)) { domainReq = requirement; } } assertNotNull(eventReq); assertNotNull(domainReq); assertEquals(2, numberOfRequirement); assertEquals(1, domainReq.getValues().size()); for (String domain : domainReq.getValues()) { assertEquals(SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL, domain); } <START> List<String> expectedEvents = ImmutableList.of( <END> LttngStrings.EXIT_SYSCALL, LttngStrings.IRQ_HANDLER_ENTRY, LttngStrings.IRQ_HANDLER_EXIT, LttngStrings.SOFTIRQ_ENTRY, LttngStrings.SOFTIRQ_EXIT, LttngStrings.SOFTIRQ_RAISE, LttngStrings.SCHED_SWITCH, LttngStrings.SCHED_PROCESS_FORK, LttngStrings.SCHED_PROCESS_EXIT, LttngStrings.SCHED_PROCESS_FREE, LttngStrings.STATEDUMP_PROCESS_STATE, LttngStrings.SCHED_WAKEUP, LttngStrings.SCHED_WAKEUP_NEW, LttngStrings.SYSCALL_PREFIX ); assertEquals(14, eventReq.getValues().size()); for (String event : eventReq.getValues()) { assertTrue("Unexpected event " + event, expectedEvents.contains(event)); } }</code><technical_language>do .contains, a Set here. matter in test code (but in runtime code!!)</technical_language>

Target:
public void testGetAnalysisRequirements() { Iterable<TmfAnalysisRequirement> requirements = fKernelAnalysisModule.getAnalysisRequirements(); assertNotNull(requirements); assertTrue(requirements.iterator().hasNext()); TmfAnalysisRequirement eventReq = null; TmfAnalysisRequirement domainReq = null; int numberOfRequirement = 0; for (TmfAnalysisRequirement requirement : requirements) { ++numberOfRequirement; if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_EVENT)) { eventReq = requirement; } else if (requirement.getType().equals(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN)) { domainReq = requirement; } } assertNotNull(eventReq); assertNotNull(domainReq); assertEquals(2, numberOfRequirement); assertEquals(1, domainReq.getValues().size()); for (String domain : domainReq.getValues()) { assertEquals(SessionConfigStrings.CONFIG_DOMAIN_TYPE_KERNEL, domain); } Set<String> expectedEvents = ImmutableSet.of( LttngStrings.EXIT_SYSCALL, LttngStrings.IRQ_HANDLER_ENTRY, LttngStrings.IRQ_HANDLER_EXIT, LttngStrings.SOFTIRQ_ENTRY, LttngStrings.SOFTIRQ_EXIT, LttngStrings.SOFTIRQ_RAISE, LttngStrings.SCHED_SWITCH, LttngStrings.SCHED_PROCESS_FORK, LttngStrings.SCHED_PROCESS_EXIT, LttngStrings.SCHED_PROCESS_FREE, LttngStrings.STATEDUMP_PROCESS_STATE, LttngStrings.SCHED_WAKEUP, LttngStrings.SCHED_WAKEUP_NEW, LttngStrings.SYSCALL_PREFIX ); assertEquals(14, eventReq.getValues().size()); for (String event : eventReq.getValues()) { assertTrue("Unexpected event " + event, expectedEvents.contains(event)); } }
Source:
<code>public TaskResult runTask() { try (TDOperator op = TDOperator.fromConfigWithRetries(params)) { if (!existingDomainKey.isPresent()) { String domainKey = UUID.randomUUID().toString(); state.set(DOMAIN_KEY, domainKey); <START> throw TaskExecutionException.ofNextPolling(0, ConfigElement.copyOf(state.deepCopy())); <END> } if (!existingJobId.isPresent()) { String jobId = startJob(op); state.set(JOB_ID, jobId); state.set(POLL_INTERVAL, INITIAL_POLL_INTERVAL); throw TaskExecutionException.ofNextPolling(INITIAL_POLL_INTERVAL, ConfigElement.copyOf(state.deepCopy())); } String jobId = existingJobId.get(); TDJobOperator job = op.newJobOperator(jobId); TDJobSummary status = checkJobStatus(job); boolean done = status.getStatus().isFinished(); if (!done) { int prevPollInterval = state.get(POLL_INTERVAL, int.class, INITIAL_POLL_INTERVAL); int nextPollInterval = Math.min(MAX_POLL_INTERVAL, prevPollInterval * 2); state.set(POLL_INTERVAL, nextPollInterval); throw TaskExecutionException.ofNextPolling(INITIAL_POLL_INTERVAL, ConfigElement.copyOf(state.deepCopy())); } return processJobResult(op, job, status); } }</code><technical_language>need deepCopy() ConfigElement.copyOf copies deeply. ConfigElement is immutable. Config is mutable</technical_language>

Target:
public TaskResult runTask() { try (TDOperator op = TDOperator.fromConfig(params)) { if (!existingDomainKey.isPresent()) { String domainKey = UUID.randomUUID().toString(); state.set(DOMAIN_KEY, domainKey); throw TaskExecutionException.ofNextPolling(0, ConfigElement.copyOf(state)); } if (!existingJobId.isPresent()) { String jobId = startJob(op); state.set(JOB_ID, jobId); state.set(POLL_ITERATION, 1); throw TaskExecutionException.ofNextPolling(INITIAL_POLL_INTERVAL, ConfigElement.copyOf(state)); } String jobId = existingJobId.get(); TDJobOperator job = op.newJobOperator(jobId); TDJobSummary status = checkJobStatus(job); boolean done = status.getStatus().isFinished(); if (!done) { int pollIteration = state.get(POLL_ITERATION, int.class, 1); state.set(POLL_ITERATION, pollIteration + 1); int pollInterval = (int) Math.min(INITIAL_POLL_INTERVAL * Math.pow(2, pollIteration), MAX_POLL_INTERVAL); throw TaskExecutionException.ofNextPolling(pollInterval, ConfigElement.copyOf(state)); } return processJobResult(op, job, status); } }
Source:
<code>private Map<String, Object> getAssertionAttributes(Assertion assertion) { <START> Map<String, Object> attributeMap = new HashMap<>(); <END> for (AttributeStatement attributeStatement : assertion.getAttributeStatements()) { for (Attribute attribute : attributeStatement.getAttributes()) { List<String> attributeValues = new ArrayList<>(); for (XMLObject xmlObject : attribute.getAttributeValues()) { attributeValues.add(getXmlObjectValue(xmlObject)); } attributeMap.put(attribute.getName(), attributeValues); } } return attributeMap; }</code><technical_language>please a LinkedHashMap preserves order in OpenSAML gave us</technical_language>

Target:
private Map<String, List<Object>> getAssertionAttributes(Assertion assertion) { Map<String, List<Object>> attributeMap = new LinkedHashMap<>(); for (AttributeStatement attributeStatement : assertion.getAttributeStatements()) { for (Attribute attribute : attributeStatement.getAttributes()) { List<Object> attributeValues = new ArrayList<>(); for (XMLObject xmlObject : attribute.getAttributeValues()) { Object attributeValue = getXmlObjectValue(xmlObject); if (attributeValue != null) { attributeValues.add(attributeValue); } } attributeMap.put(attribute.getName(), attributeValues); } } return attributeMap; }
Source:
<code>private void assertSetAuthorAttributionText(TextView textView, DiscussionTextUtils.AuthorAttributionLabel type, IAuthorData input, long now, String expectedOutput) { Runnable listener = Mockito.mock(Runnable.class); DiscussionTextUtils.setAuthorAttributionText(textView, type, input, now, listener); if (expectedOutput == null) { assertTrue(textView.getVisibility() == View.GONE); } else { String output = textView.getText().toString(); assertEquals(expectedOutput, output); if (!input.isAuthorAnonymous()) { int start = output.indexOf(input.getAuthor()); int end = start + input.getAuthor().length(); SpannableString spannableString = (SpannableString) textView.getText(); ClickableSpan[] spans = spannableString.getSpans(start, end, ClickableSpan.class); if (config.isUserProfilesEnabled()) { assertTrue(spans.length == 1); <START> spans[0].onClick(textView); <END> Mockito.verify(listener).run(); } else { assertTrue(spans.length == 0); } } } }</code><technical_language>verify span encompasses of author text, e.g.: java assertEquals(start, spannableString.getSpanStart(span)); assertEquals(end, spannableString.getSpanEnd(span));</technical_language>

Target:
private void assertSetAuthorAttributionText(TextView textView, DiscussionTextUtils.AuthorAttributionLabel type, IAuthorData input, long now, String expectedOutput) { final Runnable listener = Mockito.mock(Runnable.class); DiscussionTextUtils.setAuthorAttributionText(textView, type, input, now, listener); if (expectedOutput == null) { assertTrue(textView.getVisibility() == View.GONE); } else { String output = textView.getText().toString(); assertEquals(expectedOutput, output); if (!input.isAuthorAnonymous()) { int start = output.indexOf(input.getAuthor()); int end = start + input.getAuthor().length(); Spanned text = (Spanned) textView.getText(); StyleSpan[] styleSpans = text.getSpans(start, end, StyleSpan.class); ForegroundColorSpan[] colorSpans = text.getSpans(start, end, ForegroundColorSpan.class); if (config.isUserProfilesEnabled()) { assertEquals(1, styleSpans.length); assertEquals(start, text.getSpanStart(styleSpans[0])); assertEquals(end, text.getSpanEnd(styleSpans[0])); assertEquals(Typeface.BOLD, styleSpans[0].getStyle()); assertEquals(1, colorSpans.length); assertEquals(start, text.getSpanStart(colorSpans[0])); assertEquals(end, text.getSpanEnd(colorSpans[0])); assertEquals(context.getResources().getColor(R.color.edx_brand_primary_base), colorSpans[0].getForegroundColor()); textView.performClick(); Mockito.verify(listener).run(); } else { assertEquals(0, styleSpans.length); assertEquals(0, colorSpans.length); assertFalse(textView.isClickable()); } } } }
Source:
<code>public void should_wait_for_contact_points_if_reconnection_enabled() throws Exception { simulacronRule.cluster().rejectConnections(0, RejectScope.STOP); DriverConfigLoader loader = SessionUtils.configLoaderBuilder() .withBoolean(DefaultDriverOption.RECONNECT_ON_INIT, true) <START> .withString( <END> DefaultDriverOption.RECONNECTION_POLICY_CLASS, InitOnlyReconnectionPolicy.class.getName()) .withDuration(DefaultDriverOption.RECONNECTION_BASE_DELAY, Duration.ofMillis(500)) .build(); CompletableFuture<? extends Session> sessionFuture = newSessionAsync(simulacronRule, loader).toCompletableFuture(); TimeUnit.SECONDS.sleep(2); assertThat(sessionFuture).isNotCompleted(); simulacronRule.cluster().acceptConnections(); Session session = sessionFuture.get(2, TimeUnit.SECONDS); session.close(); }</code><technical_language>remove withClass</technical_language>

Target:
public void should_wait_for_contact_points_if_reconnection_enabled() throws Exception { simulacronRule.cluster().rejectConnections(0, RejectScope.STOP); DriverConfigLoader loader = SessionUtils.configLoaderBuilder() .withBoolean(DefaultDriverOption.RECONNECT_ON_INIT, true) .withClass( DefaultDriverOption.RECONNECTION_POLICY_CLASS, InitOnlyReconnectionPolicy.class) .withDuration(DefaultDriverOption.RECONNECTION_BASE_DELAY, Duration.ofMillis(500)) .build(); CompletableFuture<? extends Session> sessionFuture = newSessionAsync(simulacronRule, loader).toCompletableFuture(); TimeUnit.SECONDS.sleep(2); assertThat(sessionFuture).isNotCompleted(); simulacronRule.cluster().acceptConnections(); Session session = sessionFuture.get(2, TimeUnit.SECONDS); session.close(); }
Source:
<code>private void executeAndSetReturnValue(String volumeName) { VDSReturnValue returnValue = executeCommand(volumeName); getQueryReturnValue().setReturnValue(returnValue.getReturnValue()); <START> return; <END> }</code><technical_language>this "return;" statement is of use</technical_language>

Target:
private void executeAndSetReturnValue(String volumeName) { VDSReturnValue returnValue = executeCommand(volumeName); getQueryReturnValue().setReturnValue(returnValue.getReturnValue()); }
Source:
<code>private int receiveCommand(String commandId, Writer out, Writer err) { while(true) { Receive receive = new Receive(); DesiredStreamType stream = new DesiredStreamType(); stream.setCommandId(commandId); stream.setValue("stdout stderr"); receive.setDesiredStream(stream); setActionToContext((BindingProvider) winrm, "<LINK_1>"); try { numberOfReceiveCalls++; ReceiveResponse receiveResponse = winrm.receive(receive, RESOURCE_URI, MAX_ENVELOPER_SIZE, operationTimeout, locale, shellSelector); getStreams(receiveResponse, out, err); System.out.println(String.format("receiveResponse: %s", receiveResponse.toString())); CommandStateType state = receiveResponse.getCommandState(); if (COMMAND_STATE_DONE.equals(state.getState())) { return state.getExitCode().intValue(); } } catch (SOAPFaultException e) { <START> if(e.getFault().getDetail().getFirstChild().getAttributes().getNamedItem("Code").getNodeValue().equals("2150858793")) { <END> LOG.debug("Re-polling a receive request", this); } else { throw e; } } } }</code><technical_language>Suggest include a link <LINK_2> for this cryptic error code (and explain need do)</technical_language>

Target:
private int receiveCommand(String commandId, Writer out, Writer err) { while(true) { Receive receive = new Receive(); DesiredStreamType stream = new DesiredStreamType(); stream.setCommandId(commandId); stream.setValue("stdout stderr"); receive.setDesiredStream(stream); setActionToContext((BindingProvider) winrm, "<LINK_1>"); try { numberOfReceiveCalls++; ReceiveResponse receiveResponse = winrm.receive(receive, RESOURCE_URI, MAX_ENVELOPER_SIZE, operationTimeout, locale, shellSelector); getStreams(receiveResponse, out, err); CommandStateType state = receiveResponse.getCommandState(); if (COMMAND_STATE_DONE.equals(state.getState())) { return state.getExitCode().intValue(); } else { LOG.debug("{} is not done. Response it received: {}", this, receiveResponse); } } catch (SOAPFaultException soapFault) { try { if (soapFault.getFault().getDetail().getFirstChild().getAttributes().getNamedItem("Code").getNodeValue().equals(WSMAN_FAULT_CODE_OPERATION_TIMEOUT_EXPIRED)) { LOG.trace("winrm client received an operation response {}", this, soapFault); } else { throw soapFault; } } catch (NullPointerException e) { throw soapFault; } } } }
Source:
<code>protected Map<String, Set<Watcher>> getWatches(int rc) { <START> return getWatchManager().dataWatches; <END> }</code><technical_language>dataWatches -> getDataWatches() breaking incapsulation introducing</technical_language>

Target:
protected Map<String, Set<Watcher>> getWatches(int rc) { return getWatchManager().getDataWatches(); }
Source:
<code>protected void initializeDataSource() { ITmfTrace trace = getTrace(); <START> fXYDataProvider = DisksIODataProvider.create(trace); <END> }</code><technical_language>call a setter fXYDataProvider private. null-check trace avoid a null warning</technical_language>

Target:
protected void initializeDataSource() { ITmfTrace trace = getTrace(); setDataProvider(DisksIODataProvider.create(trace)); }
Source:
<code>public void multiWikiFinderTests_002_maxAmoutOfLinksOnPage() { SpecialUserLoginPageObject login = new SpecialUserLoginPageObject(driver); login.openWikiPage(); login.loginAndVerify(Properties.userNameStaff, Properties.passwordStaff); SpecialMultiWikiFinderPageObject multiWikiFinder = new SpecialMultiWikiFinderPageObject(driver); multiWikiFinder.openSpecialMultiWikiFinderPage(); multiWikiFinder.findPageName(pageName); <START> for(int element : SearchDataProvider.getSearchLimits()){ <END> multiWikiFinder.limitResults(pageName, element); multiWikiFinder.compareResultsCount(element); } }</code><technical_language>change name element->limit</technical_language>

Target:
public void multiWikiFinderTests_002_maxAmoutOfLinksOnPage() { SpecialMultiWikiFinderPageObject multiWikiFinder = new SpecialMultiWikiFinderPageObject(driver); multiWikiFinder.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); multiWikiFinder.openSpecialMultiWikiFinderPage(wikiURL); multiWikiFinder.findPageName(pageName); multiWikiFinder.checkAllLimits(); }
Source:
<code>public Builder compactOnLaunch(CompactOnLaunchCallback compactOnLaunch) { <START> this.compactOnLaunch = compactOnLaunch; <END> return this; }</code><technical_language>I a check if compactOnLaunch is null. If users pass null callback, current implementation compact file all</technical_language>

Target:
public Builder compactOnLaunch(CompactOnLaunchCallback compactOnLaunch) { if (compactOnLaunch == null) { throw new IllegalArgumentException("A non-null compactOnLaunch must be provided"); } this.compactOnLaunch = compactOnLaunch; return this; }
Source:
<code>private KfsVendorDataWrapper populateFirstLastLegalName(PaymentWorksVendor pmwVendor, KfsVendorDataWrapper kfsVendorDataWrapper) { kfsVendorDataWrapper.getVendorDetail().setVendorFirstLastNameIndicator(true); kfsVendorDataWrapper.getVendorDetail().setVendorLastName(truncateValueToMaxLength(pmwVendor.getRequestingCompanyLegalLastName(), VendorConstants.MAX_VENDOR_NAME_LENGTH)); <START> kfsVendorDataWrapper.getVendorDetail().setVendorFirstName(truncateLegalFirstNameToMaximumAllowedLengthWhenFormattedWithLegalLastName(pmwVendor.getRequestingCompanyLegalLastName(), pmwVendor.getRequestingCompanyLegalFirstName())); <END> return kfsVendorDataWrapper; }</code><technical_language>this function in kfsVendorDataWrapper.getVendorDetail().getVendorLastName() instead of . pmwVendor.getRequestingCompanyLegalLastName()? I asking previous line truncated needed. I if matters really</technical_language>

Target:
private KfsVendorDataWrapper populateFirstLastLegalName(PaymentWorksVendor pmwVendor, KfsVendorDataWrapper kfsVendorDataWrapper) { kfsVendorDataWrapper.getVendorDetail().setVendorFirstLastNameIndicator(true); String vendorLastName = truncateValueToMaxLength(pmwVendor.getRequestingCompanyLegalLastName(), VendorConstants.MAX_VENDOR_NAME_LENGTH); kfsVendorDataWrapper.getVendorDetail().setVendorLastName(vendorLastName); kfsVendorDataWrapper.getVendorDetail().setVendorFirstName(truncateLegalFirstNameToMaximumAllowedLengthWhenFormattedWithLegalLastName(vendorLastName, pmwVendor.getRequestingCompanyLegalFirstName(), VendorConstants.NAME_DELIM, VendorConstants.MAX_VENDOR_NAME_LENGTH)); return kfsVendorDataWrapper; }
Source:
<code>public DeleteRequest(int correlationId, String clientId, BlobId blobId) { super(RequestOrResponseType.DeleteRequest, currentVersion, correlationId, clientId); <START> this.blobId = blobId; <END> sizeSent = 0; }</code><technical_language>please this() calls real code in constructor</technical_language>

Target:
public DeleteRequest(int correlationId, String clientId, BlobId blobId) { this(correlationId, clientId, blobId, Utils.Infinite_Time, CURRENT_VERSION); }
Source:
<code>@Override public ResultSet getTables(String catalog, String schemaPtrn, String tblNamePtrn, String[] tblTypes) throws SQLException { conn.ensureNotClosed(); List<List<?>> rows = Collections.emptyList(); <START> boolean areTypesValid = tblTypes == null || Arrays.asList(tblTypes).contains(TYPE_TABLE); <END> if (isValidCatalog(catalog) && areTypesValid) { List<JdbcTableMeta> tabMetas = meta.getTablesMeta(schemaPtrn, tblNamePtrn, tblTypes); rows = new ArrayList<>(tabMetas.size()); for (JdbcTableMeta m : tabMetas) rows.add(tableRow(m)); } return new JdbcResultSet(true, null, conn.createStatement0(), Collections.<String>emptyList(), Arrays.asList("TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "TABLE_TYPE", "REMARKS", "TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME", "SELF_REFERENCING_COL_NAME", "REF_GENERATION"), Arrays.asList(String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName()), rows, true ); }</code><technical_language>support VIEW type for jdbc2</technical_language>

Target:
@Override public ResultSet getTables(String catalog, String schemaPtrn, String tblNamePtrn, String[] tblTypes) throws SQLException { conn.ensureNotClosed(); List<List<?>> rows = Collections.emptyList(); boolean areTypesValid = false; if(tblTypes == null) areTypesValid = true; else { for (String type : tblTypes) { if (TYPE_TABLE.equals(type) || TYPE_VIEW.equals(type)) { areTypesValid = true; break; } } } if (isValidCatalog(catalog) && areTypesValid) { List<JdbcTableMeta> tabMetas = meta.getTablesMeta(schemaPtrn, tblNamePtrn, tblTypes); rows = new ArrayList<>(tabMetas.size()); for (JdbcTableMeta m : tabMetas) rows.add(tableRow(m)); } return new JdbcResultSet(true, null, conn.createStatement0(), Collections.<String>emptyList(), asList("TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "TABLE_TYPE", "REMARKS", "TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME", "SELF_REFERENCING_COL_NAME", "REF_GENERATION"), asList(String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), String.class.getName()), rows, true ); }
Source:
<code><START> public ClientCnxnSocketNIO(ZKClientConfig clientConfig) throws IOException { <END> this.clientConfig = clientConfig; initProperties(); }</code><technical_language>making this public for test purposes. Instead of making methods public, tests in package need access modifiers inappropriately. I inappropriately this method exposed applications, public</technical_language>

Target:
ClientCnxnSocketNIO(ZKClientConfig clientConfig) throws IOException { this.clientConfig = clientConfig; initProperties(); }
Source:
<code>public ObservableToMessageChannelResultAdapter( FluxToMessageChannelResultAdapter fluxToMessageChannelResultAdapter) { <START> this.fluxToMessageChannelResultAdapter = fluxToMessageChannelResultAdapter; <END> }</code><technical_language>assert null safe</technical_language>

Target:
public ObservableToMessageChannelResultAdapter( FluxToMessageChannelResultAdapter fluxToMessageChannelResultAdapter) { Assert.notNull(fluxToMessageChannelResultAdapter, "cannot be null"); this.fluxToMessageChannelResultAdapter = fluxToMessageChannelResultAdapter; }
Source:
<code>public static boolean isJsonScalar(@SqlType(StandardTypes.JSON) Slice json) { try (JsonParser parser = createJsonParser(JSON_FACTORY, json)) { JsonToken nextToken = parser.nextToken(); <START> checkCondition(nextToken != null, INVALID_FUNCTION_ARGUMENT, "Bad JSON value: %s", truncateIfNecessaryForErrorMessage(json)); <END> if (nextToken == START_ARRAY || nextToken == START_OBJECT) { parser.skipChildren(); checkCondition(parser.nextToken() == null, INVALID_FUNCTION_ARGUMENT, "Bad JSON value: %s", truncateIfNecessaryForErrorMessage(json)); return false; } checkCondition(parser.nextToken() == null, INVALID_FUNCTION_ARGUMENT, "Bad JSON value: %s", truncateIfNecessaryForErrorMessage(json)); return true; } catch (IOException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Bad JSON value: %s", truncateIfNecessaryForErrorMessage(json))); } }</code><technical_language>"Invalid" "Bad", a judgement</technical_language>

Target:
public static boolean isJsonScalar(@SqlType(StandardTypes.JSON) Slice json) { try (JsonParser parser = createJsonParser(JSON_FACTORY, json)) { JsonToken nextToken = parser.nextToken(); if (nextToken == null) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Invalid JSON value: " + truncateIfNecessaryForErrorMessage(json)); } if (nextToken == START_ARRAY || nextToken == START_OBJECT) { parser.skipChildren(); if (parser.nextToken() != null) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Invalid JSON value: " + truncateIfNecessaryForErrorMessage(json)); } return false; } if (parser.nextToken() != null) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Invalid JSON value: " + truncateIfNecessaryForErrorMessage(json)); } return true; } catch (IOException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Invalid JSON value: " + truncateIfNecessaryForErrorMessage(json)); } }
Source:
<code>protected void setVmLeaseDefaultStorageDomain(Guid defaultStorageDomainId) { Collection<StorageDomain> domains = getModel().getLease().getItems(); domains.stream() .filter(Objects::nonNull) .filter(sd -> sd.getId().equals(defaultStorageDomainId)) <START> .findFirst().ifPresent(d -> <END> getModel().getLease().setSelectedItem(d)); }</code><technical_language>I change 2</technical_language>

Target:
protected void setVmLeaseDefaultStorageDomain(Guid defaultStorageDomainId) { Collection<StorageDomain> domains = getModel().getLease().getItems(); domains.stream() .filter(Objects::nonNull) .filter(sd -> sd.getId().equals(defaultStorageDomainId)) .findFirst().ifPresent(sd -> getModel().getLease().setSelectedItem(sd)); }
Source:
<code>protected PreparedStatement getUpdateCommand() { PreparedStatement statement; if (query != null) { statement = store.getSession().prepare(query); } else { statement = super.getUpdateCommand(); } <START> LOG.info("Operator query: " + statement.getQueryString()); <END> return statement; }</code><technical_language>This a debug message. info is default level. info flood logs</technical_language>

Target:
protected PreparedStatement getUpdateCommand() { PreparedStatement statement; if (query != null) { statement = store.getSession().prepare(query); } else { statement = super.getUpdateCommand(); } LOG.debug("Operator query: " + statement.getQueryString()); return statement; }
Source:
<code>public String getAppID() { <START> return thingIfApi.getAppID(); <END> }</code><technical_language>Adding this a field is good manner</technical_language>

Target:
public String getAppID() { return this.thingIfApi.getAppID(); }
Source:
<code>public void lock() { this.delegate.lock(); try { boolean acquired = this.mutex.acquire(this.path); if (acquired) { this.lastUsed = System.currentTimeMillis(); } } catch (Exception e) { this.delegate.unlock(); <START> throw new RuntimeException("Failed to aquire mutex at " + this.path, e); <END> } }</code><technical_language>Typo: a**c**quire Also, iterate in this method obtain lock in DB? do TX guaranties blocking wait for us</technical_language>

Target:
public void lock() { this.delegate.lock(); boolean locked = false; try { while (!locked) { try { locked = doLock(); } catch (TransactionTimedOutException e) { } catch (DuplicateKeyException e) { } catch (RuntimeException e) { this.delegate.unlock(); throw e; } } } catch (Exception e) { this.delegate.unlock(); throw new RuntimeException("Failed to acquire mutex at " + this.path, e); } }
Source:
<code>public boolean applies(Ability abilityToModify, Ability source, Game game) { <START> return abilityToModify instanceof CyclingAbility && filter.match(abilityToModify, game) && abilityToModify.getControllerId().equals(source.getControllerId()); <END> }</code><technical_language>need filter call watcher in here</technical_language>

Target:
public boolean applies(Ability abilityToModify, Ability source, Game game) { GaviNestWardenWatcher watcher = game.getState().getWatcher(GaviNestWardenWatcher.class); return abilityToModify instanceof CyclingAbility && watcher != null && watcher.cyclingActivationsThisTurn(abilityToModify.getControllerId()) == 0 && abilityToModify.getControllerId().equals(source.getControllerId()); }
Source:
<code>public void shouldExecuteTestMethodsSuccessfully() { projectExplorer.openItemByPath(PATH_TO_ANOTHER_TEST_CLASS); editor.waitActive(); editor.goToCursorPositionVisible(25, 17); menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM); notifications.waitExpectedMessageOnProgressPanelAndClosed("Test runner executed successfully."); pluginConsole.waitMethodMarkedAsPassed("shouldSuccessOfAppAnother"); assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(PASSED).size() == 1); editor.goToCursorPositionVisible(30, 17); menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM); try { pluginConsole.waitMethodMarkedAsFailed("shouldFailOfAppAnother"); } catch (TimeoutException ex) { <START> fail("Known issue <LINK_0>"); <END> } assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(FAILED).size() == 1); String testErrorMessage = pluginConsole.getTestErrorMessage(); assertTrue( testErrorMessage.startsWith(APP_TEST_ANOTHER_FAIL_OUTPUT_TEMPLATE), "Actual message was: " + testErrorMessage); assertTrue( testErrorMessage.endsWith(END_OF_FAILED_TEST), "Actual message was: " + testErrorMessage); }</code><technical_language>pass **ex** variable fail() method additional info catching exception</technical_language>

Target:
public void shouldExecuteTestMethodsSuccessfully() { projectExplorer.openItemByPath(PATH_TO_ANOTHER_TEST_CLASS); editor.waitActive(); editor.goToCursorPositionVisible(25, 17); menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM); notifications.waitExpectedMessageOnProgressPanelAndClosed("Test runner executed successfully."); pluginConsole.waitMethodMarkedAsPassed("shouldSuccessOfAppAnother"); assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(PASSED).size() == 1); editor.goToCursorPositionVisible(30, 17); menu.runCommand(RUN_MENU, TEST, TEST_NG_TEST_DROP_DAWN_ITEM); try { pluginConsole.waitMethodMarkedAsFailed("shouldFailOfAppAnother"); } catch (TimeoutException ex) { fail("Known issue <LINK_0>", ex); } assertTrue(pluginConsole.getAllNamesOfMethodsMarkedDefinedStatus(FAILED).size() == 1); String testErrorMessage = pluginConsole.getTestErrorMessage(); assertTrue( testErrorMessage.startsWith(APP_TEST_ANOTHER_FAIL_OUTPUT_TEMPLATE), "Actual message was: " + testErrorMessage); assertTrue( testErrorMessage.endsWith(END_OF_FAILED_TEST), "Actual message was: " + testErrorMessage); }