auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void endWindow() { super.endWindow(); if (responseCounterForThisWindow < requestCounterForThisWindow) { <START> LOG.info("Detected stragglers and configured flag/state for blocking at end of window is " + <END> blockAtEndOfWindowForStragglers); if (blockAtEndOfWindowForStragglers) { while (responseCounterForThisWindow < requestCounterForThisWindow) { LOG.debug("Trying to emit all stragglers before the next window can be processed"); emitStragglers(); } } } }</code><technical_language>debug possibly logged repeatedly</technical_language>

Target:
public void endWindow() { super.endWindow(); if (responseCounterForThisWindow < requestCounterForThisWindow) { LOG.debug("Detected stragglers and configured flag/state for blocking at end of window is " + blockAtEndOfWindowForStragglers); if (blockAtEndOfWindowForStragglers) { LOG.debug("Trying to emit all stragglers before the next window can be processed"); while (responseCounterForThisWindow < requestCounterForThisWindow) { emitStragglers(); try { Thread.sleep(50); } catch (InterruptedException e) { LOG.debug("Thread interrupted while trying to emit all stragglers"); throw new RuntimeException(e); } } } } }
Source:
<code>public void testGetVariableListOutputBusinessRule() { when(definition.getDefinition()).thenReturn(businessRuleTask); <START> Collection<String> delete = bpmnProcessVariableDeleteHandler.delete(graphInstance.graph, <END> VARIABLE_ID_OUTPUT); assertTrue(delete.size() == 1); }</code><technical_language>for consistency, named testGetVariableListOutputBusinessRuleTask I think</technical_language>

Target:
public void testGetVariableListOutputBusinessRule() { when(definition.getDefinition()).thenReturn(businessRuleTask); boolean isVariableBound = bpmnProcessVariableDeleteHandler.isVariableBoundToNodes(graphInstance.graph, VARIABLE_ID_OUTPUT); assertTrue(isVariableBound); }
Source:
<code>private void performActionForServicesOfServer() { List<String> serviceList = getServiceList(); VDSReturnValue returnValue = null; returnValue = runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(serverId, serviceList, actionType)); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { <START> handleVdsError(manageActionDetailsMap.get(getParameters().getActionType()).getActionFailedActionLog(), <END> returnValue.getVdsError().getMessage()); } else { updateService(serverId, (List<GlusterServerService>) returnValue.getReturnValue()); } }</code><technical_language>Minor - getAuditLogTypeValue() here</technical_language>

Target:
private void performActionForServicesOfServer() { List<String> serviceList = getServiceList(); VDSReturnValue returnValue = null; returnValue = runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(serverId, serviceList, actionType)); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(getAuditLogTypeValue(), returnValue.getVdsError().getMessage()); } else { updateService(serverId, (List<GlusterServerService>) returnValue.getReturnValue()); } }
Source:
<code>public RemoveMemoryVolumesParameters() { this.memoryVolumes = ""; this.vmId = Guid.Empty; <START> this.forceRemove = false; <END> }</code><technical_language>I drop is false default</technical_language>

Target:
public RemoveMemoryVolumesParameters() { this.memoryVolumes = ""; this.vmId = Guid.Empty; }
Source:
<code>private String charsetFix(String s) { if (s != null && !enc.canEncode(s)) { <START> return new String(s.getBytes(Charsets.UTF_8), Charsets.UTF_8); <END> } else { return s; } }</code><technical_language>this MMX StringUtils functions</technical_language>

Target:
private String charsetFix(String s) { if (s != null && !enc.canEncode(s)) { return StringUtils.fromUtf8(StringUtils.toUtf8(s)); } else { return s; } }
Source:
<code>public Object readResolve() throws ObjectStreamException { try { Constructor<? extends SerializableObject> constructor = this.getClass().getConstructor(this.getClass()); try { constructor.setAccessible(true); } catch (SecurityException ex) { logger.warn("Accessing copy constructor failed.", constructor, ex); } try { return constructor.newInstance(this); <START> } catch (InstantiationException ex) { <END> throw new RuntimeException("Instantiation using copy constructor failed!", ex); } catch (IllegalAccessException ex) { throw new RuntimeException("Instantiation using copy constructor failed!", ex); } catch (IllegalArgumentException ex) { throw new RuntimeException("Instantiation using copy constructor failed!", ex); } catch (InvocationTargetException ex) { throw new RuntimeException("Instantiation using copy constructor failed!", ex); } } catch (NoSuchMethodException snme) { logger.debug("No copy constructor detected for class {}, trying default constructor.", this.getClass().getSimpleName()); try { SerializableObject newInstance = this.getClass().newInstance(); transferStateTo(newInstance); return newInstance; } catch (IllegalAccessException ex) { throw new RuntimeException("Deserialization using default constructor failed!", ex); } catch (InstantiationException ex) { throw new RuntimeException("Deserialization using default constructor failed!", ex); } } }</code><technical_language>Multi exception catch usage of ReflectiveOperationException</technical_language>

Target:
public Object readResolve() throws ObjectStreamException { try { Constructor<? extends SerializableObject> constructor = this.getClass().getConstructor(this.getClass()); try { constructor.setAccessible(true); } catch (SecurityException ex) { logger.warn("Accessing copy constructor failed.", constructor, ex); } try { return constructor.newInstance(this); } catch (ReflectiveOperationException | IllegalArgumentException ex) { throw new RuntimeException("Instantiation using copy constructor failed!", ex); } } catch (NoSuchMethodException snme) { logger.debug("No copy constructor detected for class {}, trying default constructor.", this.getClass().getSimpleName()); try { SerializableObject newInstance = this.getClass().newInstance(); transferStateTo(newInstance); return newInstance; } catch (ReflectiveOperationException ex) { throw new RuntimeException("Deserialization using default constructor failed!", ex); } } }
Source:
<code>public static void reportPrivilegeEnabled(String privilegeName, String username) { reportEvent(GoogleAnalyticsFields.CATEGORY_PRIVILEGE_ENABLED, privilegeName, <START> Base64.encode(username.getBytes())); <END> }</code><technical_language>Fuck, sorry, I this in a confusing way. need Md5 value, read. want is MD5 -> Base64, get a consistent string version of MD5 hashed value</technical_language>

Target:
public static void reportPrivilegeEnabled(String privilegeName, String username) { reportEvent(GoogleAnalyticsFields.CATEGORY_PRIVILEGE_ENABLED, privilegeName, EncryptionUtils.getMD5HashAsString(username)); }
Source:
<code>public SiteMapTreeCellRenderer(List<SiteMapListener> listeners) { this.listeners = listeners; <START> this.component = new JPanel(); <END> }</code><technical_language>extra spacing nodes, need some tweaks (to before)</technical_language>

Target:
public SiteMapTreeCellRenderer(List<SiteMapListener> listeners) { this.listeners = listeners; this.component = new JPanel(new FlowLayout(FlowLayout.CENTER, 4, 2)); component.setOpaque(false); this.putClientProperty("html.disable", Boolean.TRUE); }
Source:
<code>private ComponentImplementation getComponentImplFromString(String qualifiedName) { IResourceDescriptions resourceDescriptions = resourceDescriptionsProvider <START> .getResourceDescriptions(OsateResourceUtil.getResourceSet()); <END> for (IEObjectDescription eobjDesc : resourceDescriptions .getExportedObjectsByType( Aadl2Package.eINSTANCE.getComponentImplementation())) { if (eobjDesc.getName().toString("::").equalsIgnoreCase(qualifiedName)) { EObject res = eobjDesc.getEObjectOrProxy(); res = EcoreUtil.resolve(res, OsateResourceUtil.getResourceSet()); if (!Aadl2Util.isNull(res)) { return (ComponentImplementation) res; } } } throw new TcgException("Error: test suite implementation under test: [" + qualifiedName + "] does not correspond to any " + "system implementation in the workspace.\n"); }</code><technical_language>better: new ResourceSet()</technical_language>

Target:
private ComponentImplementation getComponentImplFromString(String qualifiedName) { IResourceDescriptions resourceDescriptions = resourceDescriptionsProvider .getResourceDescriptions(new XtextResourceSet()); for (IEObjectDescription eobjDesc : resourceDescriptions .getExportedObjectsByType( Aadl2Package.eINSTANCE.getComponentImplementation())) { if (eobjDesc.getName().toString("::").equalsIgnoreCase(qualifiedName)) { EObject res = eobjDesc.getEObjectOrProxy(); res = EcoreUtil.resolve(res, new XtextResourceSet()); if (!Aadl2Util.isNull(res)) { return (ComponentImplementation) res; } } } throw new TcgException("Error: test suite implementation under test: [" + qualifiedName + "] does not correspond to any " + "system implementation in the workspace.\n"); }
Source:
<code>public static List<BlockFace> calculateConnections(GlowBlock block) { List<BlockFace> value = new ArrayList<>(); List<BlockFace> connections = new ArrayList<>(); value.add(BlockFace.DOWN); for (BlockFace face : SIDES) { GlowBlock target = block.getRelative(face); switch (target.getType()) { case REDSTONE_BLOCK: case REDSTONE_TORCH_ON: case REDSTONE_TORCH_OFF: case REDSTONE_WIRE: connections.add(face); break; default: if (target.getType().isSolid() && !block.getRelative(BlockFace.UP).getType().isSolid() && target.getRelative(BlockFace.UP).getType() == Material.REDSTONE_WIRE) { connections.add(face); } else if (!target.getType().isSolid() && target.getRelative(BlockFace.DOWN).getType() == Material.REDSTONE_WIRE) { connections.add(face); } break; } } if (connections.isEmpty()) { value.addAll(Arrays.asList(SIDES)); } else { value.addAll(connections); if (connections.size() == 1) { value.add(connections.get(0).getOppositeFace()); } } <START> <END> return value; }</code><technical_language>I forgot remove connections, redstone dust turns off</technical_language>

Target:
public static List<BlockFace> calculateConnections(GlowBlock block) { List<BlockFace> value = new ArrayList<>(); List<BlockFace> connections = new ArrayList<>(); value.add(BlockFace.DOWN); for (BlockFace face : SIDES) { GlowBlock target = block.getRelative(face); switch (target.getType()) { case DIODE_BLOCK_ON: case DIODE_BLOCK_OFF: Diode diode = (Diode) target.getState().getData(); if (face == diode.getFacing() || face == diode.getFacing().getOppositeFace()) { connections.add(face); } break; case REDSTONE_BLOCK: case REDSTONE_TORCH_ON: case REDSTONE_TORCH_OFF: case REDSTONE_WIRE: case WOOD_BUTTON: case STONE_BUTTON: case LEVER: connections.add(face); break; default: if (target.getType().isSolid() && !block.getRelative(BlockFace.UP).getType().isSolid() && target.getRelative(BlockFace.UP).getType() == Material.REDSTONE_WIRE) { connections.add(face); } else if (!target.getType().isSolid() && target.getRelative(BlockFace.DOWN).getType() == Material.REDSTONE_WIRE) { connections.add(face); } break; } } if (connections.isEmpty()) { value.addAll(Arrays.asList(SIDES)); } else { value.addAll(connections); if (connections.size() == 1) { value.add(connections.get(0).getOppositeFace()); } } return value; }
Source:
<code>private List<Disk> getDiskCandidatesForPartition(int replicaCountPerDatacenter, long replicaCapacityInBytes, Datacenter datacenter, boolean rackAware) { ArrayList<Disk> disksToAllocate = new ArrayList<Disk>(); Set<DataNode> nodesToExclude = new HashSet<>(); List<DataNode> dataNodes = new ArrayList<>(datacenter.getDataNodes()); for (int i = 0; i < replicaCountPerDatacenter; i++) { <START> Disk diskCandidate = <END> getBestDiskCandidate(dataNodes, nodesToExclude, replicaCapacityInBytes, rackAware, NUM_CHOICES); if (diskCandidate != null) { disksToAllocate.add(diskCandidate); nodesToExclude.add(diskCandidate.getDataNode()); } else { break; } } return disksToAllocate; }</code><technical_language>this point this is bestDisk - is not</technical_language>

Target:
private List<Disk> getDiskCandidatesForPartition(int replicaCountPerDatacenter, long replicaCapacityInBytes, Datacenter datacenter, boolean rackAware) { ArrayList<Disk> disksToAllocate = new ArrayList<Disk>(); Set<DataNode> nodesToExclude = new HashSet<>(); List<DataNode> dataNodes = new ArrayList<>(datacenter.getDataNodes()); for (int i = 0; i < replicaCountPerDatacenter; i++) { Disk bestDisk = getBestDiskCandidate(dataNodes, nodesToExclude, replicaCapacityInBytes, rackAware, NUM_CHOICES); if (bestDisk != null) { disksToAllocate.add(bestDisk); nodesToExclude.add(bestDisk.getDataNode()); } else { break; } } return disksToAllocate; }
Source:
<code>public void runSample() { List<LoadBalancerMetadata> loadBalancerMetadataList = searchLoadBalancers( new LoadBalancerFilter().dataCenters(DataCenter.US_EAST_STERLING) ); assertEquals(loadBalancerMetadataList.size(), 0); LoadBalancer loadBalancer1 = createLoadBalancer("LB1"); LoadBalancer loadBalancer2 = createLoadBalancer("LB2"); LoadBalancerMetadata loadBalancer1Metadata = fetchLoadBalancerMetadata(loadBalancer1); LoadBalancerMetadata loadBalancer2Metadata = fetchLoadBalancerMetadata(loadBalancer2); assertNotNull(loadBalancer1Metadata); assertNotNull(loadBalancer2Metadata); loadBalancerMetadataList = searchLoadBalancers( new LoadBalancerFilter().dataCenters(DataCenter.US_EAST_STERLING) ); assertEquals(loadBalancerMetadataList.size(), 2); LoadBalancerPool pool1 = createLoadBalancerPool(loadBalancer1, 80); LoadBalancerPool pool2 = createLoadBalancerPool(loadBalancer1, 443); LoadBalancerPoolMetadata pool1Metadata = fetchLoadBalancerPoolMetadata(pool1); LoadBalancerPoolMetadata pool2Metadata = fetchLoadBalancerPoolMetadata(pool2); assertNotNull(pool1Metadata); assertNotNull(pool2Metadata); assertEquals(pool1Metadata.getPort(), Integer.valueOf(80)); assertEquals(pool2Metadata.getPort(), Integer.valueOf(443)); assertEquals(pool1Metadata.getNodes().size(), 0); setLoadBalancerNodes(pool1, composeNodeList()); <START> pool1Metadata = loadBalancerPoolService.findByRef(pool1); <END> assertEquals(pool1Metadata.getNodes().size(), 2); }</code><technical_language>_fetchLoadBalancerPoolMetadata_ method</technical_language>

Target:
public void runSample() { List<LoadBalancerMetadata> loadBalancerMetadataList = searchLoadBalancers( new LoadBalancerFilter().dataCenters(DataCenter.US_EAST_STERLING) ); assertEquals(loadBalancerMetadataList.size(), 0); LoadBalancer loadBalancer1 = createLoadBalancer("LB1"); LoadBalancer loadBalancer2 = createLoadBalancer("LB2"); LoadBalancerMetadata loadBalancer1Metadata = fetchLoadBalancerMetadata(loadBalancer1); LoadBalancerMetadata loadBalancer2Metadata = fetchLoadBalancerMetadata(loadBalancer2); assertNotNull(loadBalancer1Metadata); assertNotNull(loadBalancer2Metadata); loadBalancerMetadataList = searchLoadBalancers( new LoadBalancerFilter().dataCenters(DataCenter.US_EAST_STERLING) ); assertEquals(loadBalancerMetadataList.size(), 2); LoadBalancerPool pool1 = createLoadBalancerPool(loadBalancer1, 80); LoadBalancerPool pool2 = createLoadBalancerPool(loadBalancer1, 443); LoadBalancerPoolMetadata pool1Metadata = fetchLoadBalancerPoolMetadata(pool1); LoadBalancerPoolMetadata pool2Metadata = fetchLoadBalancerPoolMetadata(pool2); assertNotNull(pool1Metadata); assertNotNull(pool2Metadata); assertEquals(pool1Metadata.getPort(), Integer.valueOf(80)); assertEquals(pool2Metadata.getPort(), Integer.valueOf(443)); assertEquals(pool1Metadata.getNodes().size(), 0); setLoadBalancerNodes(pool1, composeNodeList()); pool1Metadata = fetchLoadBalancerPoolMetadata(pool1); assertEquals(pool1Metadata.getNodes().size(), 2); }
Source:
<code>public Response getClusterFaultZoneMap(@PathParam("clusterId") String clusterId) { HelixAdmin admin = getHelixAdmin(); <START> Map<String, List<String>> topologyMap = admin.getClusterTopology(clusterId).getTopologyMap(); <END> return JSONRepresentation(topologyMap); }</code><technical_language>Typo? getTopologyMap -> getFaultZoneMap. getFaultZoneMap throws IllegalArgumentException "The fault zone in cluster config is defined" - client error. consider catching exception returning a client error, instead of a server error. I differentiate a client error a server error</technical_language>

Target:
public Response getClusterFaultZoneMap(@PathParam("clusterId") String clusterId) { HelixAdmin admin = getHelixAdmin(); Map<String, List<String>> faultZoneMap; try { faultZoneMap = admin.getClusterTopology(clusterId).getFaultZoneMap(); } catch (HelixException ex) { return badRequest(ex.getMessage()); } return JSONRepresentation(faultZoneMap); }
Source:
<code>private Object resolveParameter(Annotation[] parmAnnos, Class<?> paramType, String parameterName, int index) { Object val = null; boolean hitResolver = false; Default defAnno = null; for (Annotation anno : parmAnnos) { Class<?> annotype = anno.annotationType(); if (defAnno == null && annotype.equals(Default.class)) { defAnno = (Default) anno; continue; } ParamResolver<Annotation> resolver = _paramResolvers.get(annotype); if (resolver == null) continue; hitResolver = true; val = resolver.resolveParameter(anno, paramType, parameterName); if (val != null) { break; } } if (val == null && defAnno != null) { val = Classes.coerce(paramType, defAnno.value()); } if (_mappingType && val == null && !hitResolver && _types != null) { for (Type type : _types) { if (type != null && paramType.isAssignableFrom(type.clz)) { val = type.value; break; } } } if (val == null && _bindingArgs != null && index < _bindingArgs.size()) { <START> int argIndex = 0; <END> for (Map.Entry<String, Object> entry : _bindingArgs.entrySet()) { if (argIndex == index && !entry.getKey().startsWith(Parser.SIMPLIFIED_COMMAND_PARAM_PREFIX)) return null; argIndex++; } val = resolvePositionalParameter(paramType, index); } return val; }</code><technical_language>move resolvePositionalParameter</technical_language>

Target:
private Object resolveParameter(Annotation[] parmAnnos, Class<?> paramType, String parameterName, int index) { Object val = null; boolean hitResolver = false; Default defAnno = null; for (Annotation anno : parmAnnos) { Class<?> annotype = anno.annotationType(); if (defAnno == null && annotype.equals(Default.class)) { defAnno = (Default) anno; continue; } ParamResolver<Annotation> resolver = _paramResolvers.get(annotype); if (resolver == null) continue; hitResolver = true; val = resolver.resolveParameter(anno, paramType, parameterName); if (val != null) { break; } } if (val == null && defAnno != null) { val = Classes.coerce(paramType, defAnno.value()); } if (_mappingType && val == null && !hitResolver && _types != null) { for (Type type : _types) { if (type != null && paramType.isAssignableFrom(type.clz)) { val = type.value; break; } } } if (val == null) val = resolvePositionalParameter(paramType, index); return val; }
Source:
<code>private boolean hasFailed() { <START> return totalReplicaCount - failedCount < successTarget; <END> }</code><technical_language>add braces</technical_language>

Target:
private boolean hasFailed() { return (totalReplicaCount - failedCount ) < successTarget; }
Source:
<code>public void handlesToken() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:5"; final User user = base.user(new URN(urn)); user.aliases().add("Jane"); final String[] msgs = { "Hello World", "I shouldn't be created as new", "I should be created as new", "I am new too", "Another new", }; final String[] tokens = { "13579", <START> "13579", <END> "24680", "", "", }; final long[] loc = new long[msgs.length]; for (int count = 0; count < msgs.length; count += 1) { final String head = new RsPrint( new TkForward(new TkStart(base)).act( new RqWithAuth( urn, new RqFake( RqMethod.GET, String.format( "/start?post=%s&token=%s", URLEncoder.encode( msgs[count], CharEncoding.UTF_8 ), URLEncoder.encode( tokens[count], CharEncoding.UTF_8 ) ) ) ) ) ).printHead(); final Matcher matcher = TkStartTest.LOCATION.matcher(head); MatcherAssert.assertThat( "Found matching location header", matcher.find() ); user.aliases().iterate().iterator().next().inbox() .bout(Long.parseLong(matcher.group(1))); loc[count] = Long.parseLong(matcher.group(1)); } MatcherAssert.assertThat(loc[0], Matchers.equalTo(loc[1])); MatcherAssert.assertThat(loc[0], Matchers.not(loc[2])); MatcherAssert.assertThat(loc[0], Matchers.not(loc[3])); MatcherAssert.assertThat(loc[2], Matchers.not(loc[3])); MatcherAssert.assertThat(loc[3], Matchers.not(loc[4])); }</code><technical_language>@kitsook a variable reuse times, remove exclude</technical_language>

Target:
public void handlesToken() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:5"; final User user = base.user(new URN(urn)); user.aliases().add("Jane"); final String[] msgs = { "Hello World", "I shouldn't be created as new", "I should be created as new", "I am new too", "Another new", }; final String same = "13579"; final String[] tokens = { same, same, "24680", "", "", }; final long[] loc = new long[msgs.length]; for (int count = 0; count < msgs.length; count += 1) { final String head = new RsPrint( new TkForward(new TkStart(base)).act( new RqWithAuth( urn, new RqFake( RqMethod.GET, String.format( "/start?post=%s&token=%s", URLEncoder.encode( msgs[count], StandardCharsets.UTF_8.name() ), URLEncoder.encode( tokens[count], StandardCharsets.UTF_8.name() ) ) ) ) ) ).printHead(); final Matcher matcher = TkStartTest.LOCATION.matcher(head); MatcherAssert.assertThat( "Found matching location header", matcher.find() ); user.aliases().iterate().iterator().next().inbox() .bout(Long.parseLong(matcher.group(1))); loc[count] = Long.parseLong(matcher.group(1)); } MatcherAssert.assertThat(loc[0], Matchers.equalTo(loc[1])); MatcherAssert.assertThat(loc[0], Matchers.not(loc[2])); MatcherAssert.assertThat(loc[0], Matchers.not(loc[3])); MatcherAssert.assertThat(loc[2], Matchers.not(loc[3])); MatcherAssert.assertThat(loc[3], Matchers.not(loc[4])); }
Source:
<code>void store(VirtualFile file, final Collection<LocalIssuePointer> rawIssues) { boolean firstAnalysis = !storePerFile.containsKey(file); cleanInvalid(file); if (firstAnalysis) { storePerFile.put(file, rawIssues); } else { <START> matchingInProgress.lock(); <END> Collection<LocalIssuePointer> previousIssues = getForFile(file); Collection<LocalIssuePointer> trackedIssues = new ArrayList<>(); Input<LocalIssuePointer> baseInput = () -> previousIssues; Input<LocalIssuePointer> rawInput = () -> rawIssues; updateTrackedIssues(file, trackedIssues, baseInput, rawInput); matchingInProgress.unlock(); } }</code><technical_language>If IssueStore multiple threads, other problems reaching here, I</technical_language>

Target:
void store(VirtualFile file, final Collection<LocalIssuePointer> rawIssues) { boolean firstAnalysis = !storePerFile.containsKey(file); cleanInvalid(file); if (firstAnalysis) { storePerFile.put(file, rawIssues); } else { matchWithPreviousIssues(file, rawIssues); } }
Source:
<code>public boolean equals(Object o) { <START> if (this == o) return true; <END> if (o == null || getClass() != o.getClass()) return false; BinLogPositionSourceOffset that = (BinLogPositionSourceOffset) o; if (position != that.position) return false; return filename != null ? filename.equals(that.filename) : that.filename == null; }</code><technical_language>lines 54, 55, 59 2 statements line. 1 statement line is mandated style guide: <LINK_0> e.g. java if (o == null || getClass() != o.getClass()) { return false; }</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BinLogPositionSourceOffset that = (BinLogPositionSourceOffset) o; if (position != that.position) { return false; } return filename.equals(that.filename); }
Source:
<code><START> private void checkAndSetPrerequisites() throws InternalErrorException, SQLException { <END> if (getAttributes().get("url") == null) { throw new InternalErrorException("url attribute is required"); } if (getAttributes().get("driver") != null) { try { Class.forName(getAttributes().get("driver")); } catch (ClassNotFoundException e) { throw new InternalErrorException("Driver " + getAttributes().get("driver") + " cannot be registered", e); } } if (this.con == null || (this.isOracle && !this.con.isValid(0))) { this.createConnection(); } }</code><technical_language>This method is called</technical_language>

Target:
private void checkAndSetPrerequisites() throws InternalErrorException { if (getAttributes().get("url") == null) { throw new InternalErrorException("url attribute is required"); } if (getAttributes().get("driver") != null) { try { Class.forName(getAttributes().get("driver")); } catch (ClassNotFoundException e) { throw new InternalErrorException("Driver " + getAttributes().get("driver") + " cannot be registered", e); } } try { if (this.con == null || (this.isOracle && !this.con.isValid(0))) { this.createConnection(); } } catch (SQLException ex) { throw new InternalErrorException("Can't check if connection to database is still valid in SQL ExtSource.", ex); } }
Source:
<code>public void onNewHead(FlowNode flowNode) { if (!isMonitored(flowNode)) { return; } DatadogClient client = ClientFactory.getClient(); if (client == null){ return; } StepEndNode endNode = (StepEndNode) flowNode; StepStartNode startNode = endNode.getStartNode(); int stageDepth = 0; String directParentName = null; for (BlockStartNode node : startNode.iterateEnclosingBlocks()) { if (isStageNode(node)) { if(directParentName == null){ directParentName = getStageName(node); } stageDepth++; } } if(directParentName == null){ directParentName = "root"; } WorkflowRun run = getRun(flowNode); if(run == null){ return; } try { String result = getResultTag(endNode); BuildData buildData = new BuildData(run, flowNode.getExecution().getOwner().getListener()); String hostname = buildData.getHostname(""); Map<String, Set<String>> tags = buildData.getTags(); TagsUtil.addTagToTags(tags, "stage_name", getStageName(startNode)); TagsUtil.addTagToTags(tags, "parent_stage_name", directParentName); TagsUtil.addTagToTags(tags, "stage_depth", String.valueOf(stageDepth)); <START> tags.remove("result"); END> TagsUtil.addTagToTags(tags, "result", result); client.gauge("jenkins.job.stage_duration", getTime(startNode, endNode), hostname, tags); } catch (IOException | InterruptedException e) { DatadogUtilities.severe(logger, e, "Unable to submit the stage duration metric for " + getStageName(startNode)); } }</code><technical_language>Is this needed if overwritten in next line</technical_language>

Target:
public void onNewHead(FlowNode flowNode) { if (!isMonitored(flowNode)) { return; } DatadogClient client = ClientFactory.getClient(); if (client == null){ return; } StepEndNode endNode = (StepEndNode) flowNode; StepStartNode startNode = endNode.getStartNode(); int stageDepth = 0; String directParentName = null; for (BlockStartNode node : startNode.iterateEnclosingBlocks()) { if (isStageNode(node)) { if(directParentName == null){ directParentName = getStageName(node); } stageDepth++; } } if(directParentName == null){ directParentName = "root"; } WorkflowRun run = getRun(flowNode); if(run == null){ return; } try { String result = getResultTag(endNode); BuildData buildData = new BuildData(run, flowNode.getExecution().getOwner().getListener()); String hostname = buildData.getHostname(""); Map<String, Set<String>> tags = buildData.getTags(); TagsUtil.addTagToTags(tags, "stage_name", getStageName(startNode)); TagsUtil.addTagToTags(tags, "parent_stage_name", directParentName); TagsUtil.addTagToTags(tags, "stage_depth", String.valueOf(stageDepth)); TagsUtil.addTagToTags(tags, "result", result); client.gauge("jenkins.job.stage_duration", getTime(startNode, endNode), hostname, tags); } catch (IOException | InterruptedException e) { DatadogUtilities.severe(logger, e, "Unable to submit the stage duration metric for " + getStageName(startNode)); } }
Source:
<code>public ChargeRefundResponse doRefund(Long accountId, String chargeExternalId, RefundRequest refundRequest) { GatewayAccountEntity gatewayAccountEntity = gatewayAccountDao.findById(accountId).orElseThrow( () -> new GatewayAccountNotFoundException(accountId)); <START> ChargeEntity chargeEntity = chargeDao.findByExternalId(chargeExternalId) <END> .orElseThrow(() -> new ChargeNotFoundRuntimeException(chargeExternalId)); RefundEntity refundEntity = createRefund(gatewayAccountEntity, chargeEntity, refundRequest); GatewayRefundResponse gatewayRefundResponse = providers .byName(PaymentGatewayName.valueFrom(gatewayAccountEntity.getGatewayName())) .refund(RefundGatewayRequest.valueOf(refundEntity, gatewayAccountEntity, chargeEntity)); RefundEntity refund = processRefund(gatewayRefundResponse, refundEntity.getId(), gatewayAccountEntity, chargeEntity); return new ChargeRefundResponse(gatewayRefundResponse, refund); }</code><technical_language>chargeService find ChargeEntity ? This <LINK_0> ensures object returned connector ledger</technical_language>

Target:
public ChargeRefundResponse doRefund(Long accountId, String chargeExternalId, RefundRequest refundRequest) { GatewayAccountEntity gatewayAccountEntity = gatewayAccountDao.findById(accountId).orElseThrow( () -> new GatewayAccountNotFoundException(accountId)); Charge charge = chargeService.findCharge(chargeExternalId, gatewayAccountEntity.getId()) .orElseThrow(() -> new ChargeNotFoundRuntimeException(chargeExternalId)); RefundEntity refundEntity = createRefund(charge, gatewayAccountEntity, refundRequest); GatewayRefundResponse gatewayRefundResponse = providers .byName(PaymentGatewayName.valueFrom(gatewayAccountEntity.getGatewayName())) .refund(RefundGatewayRequest.valueOf(charge, refundEntity, gatewayAccountEntity)); RefundEntity refund = processRefund(gatewayRefundResponse, refundEntity.getId(), gatewayAccountEntity, charge); return new ChargeRefundResponse(gatewayRefundResponse, refund); }
Source:
<code>public LocalGitUserResolver(@Named("che.api") String apiUrl, HttpJsonRequestFactory requestFactory) { <START> this.preferencessUrl = apiUrl + "/preferences"; <END> this.requestFactory = requestFactory; }</code><technical_language>reuse this preferencessUrl parameter</technical_language>

Target:
public LocalGitUserResolver(@Named("che.api") String apiUrl, HttpJsonRequestFactory requestFactory) { this.apiUrl = apiUrl; this.requestFactory = requestFactory; }
Source:
<code>Cluster findBestProbe(List<Cluster> clusters) { int highestProbeBitrateBps = 0; Cluster bestIt = new Cluster(); for (Cluster cluster : clusters) { if (cluster.sendMeanMs == 0 || cluster.recvMeanMs == 0) continue; if (cluster.numAboveMinDelta > cluster.count / 2 && (cluster.recvMeanMs - cluster.sendMeanMs <= 2.0f && cluster.sendMeanMs - cluster.recvMeanMs <= 5.0f)) { int probeBitrateBps = Math.min(cluster.getSendBitrateBps(), cluster .getRecvBitrateBps()); if (probeBitrateBps > highestProbeBitrateBps) <START> { <END> highestProbeBitrateBps = probeBitrateBps; bestIt = cluster; } } else { double sendBitrateBps = cluster.meanSize * 8 * 1000 / cluster.sendMeanMs; double recvBitrateBps = cluster.meanSize * 8 * 1000 / cluster.recvMeanMs; logger.warn( "Probe failed, sent at " + sendBitrateBps + " bps, received at " + recvBitrateBps + " bps. Mean send delta: " + cluster.sendMeanMs + " ms, mean recv delta: " + cluster.recvMeanMs + " ms, num probes: " + cluster.count); break; } } return bestIt; }</code><technical_language>do arguments from</technical_language>

Target:
private Cluster findBestProbe(List<Cluster> clusters) { int highestProbeBitrateBps = 0; Cluster bestIt = new Cluster(); for (Cluster cluster : clusters) { if (cluster.sendMeanMs == 0 || cluster.recvMeanMs == 0) continue; if (cluster.numAboveMinDelta > cluster.count / 2 && (cluster.recvMeanMs - cluster.sendMeanMs <= 2.0f && cluster.sendMeanMs - cluster.recvMeanMs <= 5.0f)) { int probeBitrateBps = Math.min(cluster.getSendBitrateBps(), cluster .getRecvBitrateBps()); if (probeBitrateBps > highestProbeBitrateBps) { highestProbeBitrateBps = probeBitrateBps; bestIt = cluster; } } else { double sendBitrateBps = cluster.meanSize * 8 * 1000 / cluster.sendMeanMs; double recvBitrateBps = cluster.meanSize * 8 * 1000 / cluster.recvMeanMs; logger.warn( "Probe failed, sent at " + sendBitrateBps + " bps, received at " + recvBitrateBps + " bps. Mean send delta: " + cluster.sendMeanMs + " ms, mean recv delta: " + cluster.recvMeanMs + " ms, num probes: " + cluster.count); break; } } return bestIt; }
Source:
<code>public void addChild(Description description) { <START> String msg = "This method is no longer supported. Please refer to the %s for more information."; <END> throw new UnsupportedOperationException(String.format(msg, DescriptionBuilder.class.getSimpleName())); }</code><technical_language>"no longer supported" -> "not supported for immutable description instances"</technical_language>

Target:
public void addChild(Description description) { String msg = "This method is not supported for immutable description instances. " + "Please refer to the %s for more information."; throw new UnsupportedOperationException(String.format(msg, DescriptionBuilder.class.getSimpleName())); }
Source:
<code><START> EapAkaAttributeFactory() <END> {}</code><technical_language>Suggest protected signal this is for subclass</technical_language>

Target:
protected EapAkaAttributeFactory()
Source:
<code>private void loadResources(final Composite container, OpenShiftServerEditorModel model) { IServerWorkingCopy server = input.getServer(); <START> OpenShiftServerUtils.getConnection(server); <END> final IProject deployProject = OpenShiftServerUtils.getDeployProject(server); Cursor busyCursor = new Cursor(container.getDisplay(), SWT.CURSOR_WAIT); IProgressMonitor chainProgressMonitor = new NullProgressMonitor() { @Override public boolean isCanceled() { return container.isDisposed(); } }; new JobChainBuilder( new DisableAllWidgetsJob(true, container, busyCursor), chainProgressMonitor) .runWhenDone(loadingProjectsJob(model, server, deployProject)) .runWhenDone(new DisableAllWidgetsJob(false, container, false, busyCursor)) .schedule(); }</code><technical_language>I if this method a side effect not. I it, I cleaned code removing unused parameter time check if getConnection call side effect (creating connection if for instance)</technical_language>

Target:
private void loadResources(final Composite container, OpenShiftServerEditorModel model) { IServerWorkingCopy server = input.getServer(); final IProject deployProject = OpenShiftServerUtils.getDeployProject(server); Cursor busyCursor = new Cursor(container.getDisplay(), SWT.CURSOR_WAIT); IProgressMonitor chainProgressMonitor = new NullProgressMonitor() { @Override public boolean isCanceled() { return container.isDisposed(); } }; new JobChainBuilder( new DisableAllWidgetsJob(true, container, busyCursor), chainProgressMonitor) .runWhenDone(loadingProjectsJob(model, server, deployProject)) .runWhenDone(new DisableAllWidgetsJob(false, container, false, busyCursor)) .schedule(); }
Source:
<code>protected void addTask(String queueName, String workerUrl, Map<String, String> paramMap) { Map<String, String[]> multisetParamMap = new HashMap<>(); paramMap.forEach((key, value) -> { <START> multisetParamMap.put(key, new String[] { value }); <END> }); TaskWrapper task = new TaskWrapper(queueName, workerUrl, multisetParamMap); tasksAdded.add(task); }</code><technical_language>This inlined</technical_language>

Target:
protected void addTask(String queueName, String workerUrl, Map<String, String> paramMap) { Map<String, String[]> multisetParamMap = new HashMap<>(); paramMap.forEach((key, value) -> multisetParamMap.put(key, new String[] { value })); TaskWrapper task = new TaskWrapper(queueName, workerUrl, multisetParamMap); tasksAdded.add(task); }
Source:
<code>public String getTitle() { <START> return this.id; <END> }</code><technical_language>this.id -> id</technical_language>

Target:
public String getTitle() { return id; }
Source:
<code>public static Properties loadPropertiesFromFile(String filename, Properties props) { FileInputStream fileistream = null; <START> try { <END> fileistream = new FileInputStream(filename); if (props == null) { props = new Properties(); } props.load(fileistream); fileistream.close(); return props; }catch(IOException e) { throw new RuntimeException("Could not load properties from file "+filename,e); }catch(IllegalArgumentException e) { throw new RuntimeException("Could not load properties from file "+filename,e); }finally { if(fileistream != null) try { fileistream.close(); }catch(IOException e) { } } }</code><technical_language>try-with-resource, need close manually : try(FileInputStream fileistream = new FileInputStream(filename)) { .... }</technical_language>

Target:
public static Properties loadPropertiesFromFile(String filename, Properties props) { try (FileInputStream fileistream = new FileInputStream(filename)) { if (props == null) { props = new Properties(); } props.load(fileistream); return props; } catch (IOException | IllegalArgumentException e) { throw new RuntimeException("Could not load properties from file " + filename, e); } }
Source:
<code>void afterGroupNumChanged() { <START> String groupsNumber = numGroups.getText().toString().trim(); <END> if (numGroups.isFocused() && isValid(groupsNumber)) { namesPerGroup.setText(getOffset(groupsNumber)); } dialog.getActionButton(DialogAction.POSITIVE).setEnabled(isValid(groupsNumber)); }</code><technical_language>suggestion String numberOfGroupsInput = numGroups.getText().toString().trim();</technical_language>

Target:
void afterGroupNumChanged() { String numberOfGroupsInput = numGroups.getText().toString().trim(); if (numGroups.isFocused() && isValid(groupsNumber)) { namesPerGroup.setText(getOffset(groupsNumber)); } dialog.getActionButton(DialogAction.POSITIVE).setEnabled(isValid(groupsNumber)); }
Source:
<code>public void addChildConnection(PhoenixConnection connection) { <START> synchronized (this) { <END> if (childConnections == null) { childConnections = new ConcurrentLinkedQueue<>(); } } childConnections.add(connection); }</code><technical_language>Avoid synchronizing this. a separate variable synchronize relates childConnections @GuardedBy syntax denote this. Today other methods synchronized this PhoenixConnection, if do tomorrow, unnecessary contention</technical_language>

Target:
public void addChildConnection(PhoenixConnection connection) { if(childConnections == null) { synchronized (queueCreationLock) { if (childConnections == null) { childConnections = new ConcurrentLinkedQueue<>(); } } } childConnections.add(connection); }
Source:
<code>public void testGetRank() { <START> setUp(); <END> long result = iterator.getRank(); assertEquals(1L, result); }</code><technical_language>calling setUp()? Is a avoid this</technical_language>

Target:
public void testGetRank() { long result = iterator.getRank(); assertEquals(2L, result); }
Source:
<code>private boolean isMbeanAccessible() { Object attr = null; long startTime = System.currentTimeMillis(); while (attr == null && (System.currentTimeMillis() - startTime < mbeanTimeoutMillis)) { try { attr = localMBeanServer.getAttribute(new ObjectName(mbeanName), mbeanAttributeName); if (!isNumeric(attr)) { LOGGER.debug("{} from MBean has non-numeric data", mbeanAttributeName, mbeanName); return false; } if (!(attr instanceof Integer) && !(attr instanceof Long) && !(attr instanceof Float) && !(attr instanceof Double)) { return false; } } catch (Exception e) { try { LOGGER.trace("MBean not found, sleeping...", mbeanName); Thread.sleep(1000); } catch (InterruptedException ie) { <START> Thread.currentThread().interrupt(); <END> } } } return attr != null; }</code><technical_language>Flag interruption propagate of while loop in a finally clause</technical_language>

Target:
private boolean isMbeanAccessible() { Object attr = null; long startTime = System.currentTimeMillis(); while (attr == null && (System.currentTimeMillis() - startTime < mbeanTimeoutMillis)) { try { attr = localMBeanServer.getAttribute(new ObjectName(mbeanName), mbeanAttributeName); if (!isNumeric(attr)) { LOGGER.debug("{} from MBean has non-numeric data", mbeanAttributeName, mbeanName); return false; } if (!(attr instanceof Integer) && !(attr instanceof Long) && !(attr instanceof Float) && !(attr instanceof Double)) { return false; } } catch (Exception e) { try { LOGGER.trace("MBean not found, sleeping...", mbeanName); Thread.sleep(1000); } catch (InterruptedException ie) { } } } return attr != null; }
Source:
<code>private void toggleOffline(@NonNull ReadingListPage page) { <START> updatePageItemUI(page); <END> if (shouldForceDownloadOverMobileData()) { ReadingListsFragment.showMobileDataWarningDialog(requireActivity(), (dialog, which) -> toggleOffline(page, true)); } else { toggleOffline(page, !Prefs.isDownloadingReadingListArticlesEnabled()); } }</code><technical_language>invalidating entire dataset in adapter (a lines below), views redrawn, do need do this here</technical_language>

Target:
private void toggleOffline(@NonNull ReadingListPage page) { updatePageProgress(page); if (shouldForceDownloadOverMobileData()) { ReadingListsFragment.showMobileDataWarningDialog(requireActivity(), (dialog, which) -> toggleOffline(page, true)); } else { toggleOffline(page, !Prefs.isDownloadingReadingListArticlesEnabled()); } }
Source:
<code>protected boolean validate() { if (!super.validate()) { return false; } StorageDomain dom = getStorageDomain(); if (dom == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST); } VDS vds = getVds(); StorageDomainToPoolRelationValidator domainPoolValidator = createDomainToPoolValidator(dom); boolean localFs = isLocalFs(dom); if (vds == null) { if (localFs) { if (!initializeVds()) { return false; } } else { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_INVALID_HOST_ID); } } else if (vds.getStatus() != VDSStatus.Up) { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_HOST_NOT_UP, String.format("$%1$s %2$s", "hostName", vds.getName())); } <START> <END> if (!checkStorageDomain()) { return false; } if (!localFs && !validate(domainPoolValidator.isStorageDomainNotInAnyPool())) { return false; } if (localFs && isDomainAttached(dom) && !canDetachDomain(getParameters().getDestroyingPool(), false)) { return false; } if (getParameters().getDoFormat() && !localFs && isStorageDomainAttached(dom)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_FORMAT_STORAGE_DOMAIN_WITH_ATTACHED_DATA_DOMAIN); } if (dom.getStorageType().isOpenStackDomain()) { return failValidation(EngineMessage.ERROR_CANNOT_MANAGE_STORAGE_DOMAIN); } return true; }</code><technical_language>I consider add this block of code line 121 domainPoolValidator in line 122 out of context</technical_language>

Target:
protected boolean validate() { if (!super.validate()) { return false; } StorageDomain dom = getStorageDomain(); if (dom == null) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST); } VDS vds = getVds(); boolean localFs = isLocalFs(dom); if (vds == null) { if (localFs) { if (!initializeVds()) { return false; } } else { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_INVALID_HOST_ID); } } else if (vds.getStatus() != VDSStatus.Up) { return failValidation(EngineMessage.CANNOT_REMOVE_STORAGE_DOMAIN_HOST_NOT_UP, String.format("$%1$s %2$s", "hostName", vds.getName())); } StorageDomainToPoolRelationValidator domainPoolValidator = createDomainToPoolValidator(dom); if (!checkStorageDomain()) { return false; } if (!localFs && !validate(domainPoolValidator.isStorageDomainNotInAnyPool())) { return false; } if (localFs && isDomainAttached(dom) && !canDetachDomain(getParameters().getDestroyingPool(), false)) { return false; } if (getParameters().getDoFormat() && !localFs && isStorageDomainAttached(dom)) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_FORMAT_STORAGE_DOMAIN_WITH_ATTACHED_DATA_DOMAIN); } if (dom.getStorageType().isOpenStackDomain()) { return failValidation(EngineMessage.ERROR_CANNOT_MANAGE_STORAGE_DOMAIN); } return true; }
Source:
<code><START> public boolean isGround() { <END> return isConcreteCollection() && super.isGround(); }</code><technical_language>final</technical_language>

Target:
public final boolean isGround() { return isConcreteCollection() && super.isGround(); }
Source:
<code>public void testEqualsId() { <START> import1.setId(new Id("123")); <END> import2.setId(new Id("123")); assertEquals(import1, import2); }</code><technical_language>need set Id done in setup() method (but harm test clearer!)</technical_language>

Target:
public void testEqualsId() { assertEquals(import1, import2); }
Source:
<code>public Builder setDataSize(Estimate dataSize) { <START> this.dataSize = requireNonNull(dataSize, "dataSize can not be null"); <END> return this; }</code><technical_language>validate in other builders method (and to)</technical_language>

Target:
public Builder setDataSize(Estimate dataSize) { this.dataSize = dataSize; return this; }
Source:
<code>public void testToStreamNonErrorHandlingThread() throws JSONException, IOException { StackTraceElement[] stacktrace = { new StackTraceElement("", "run_func", "librunner.so", 5038), new StackTraceElement("Runner", "runFunc", "Runner.java", 14), new StackTraceElement("App", "launch", "App.java", 70), }; CachedThread thread = new CachedThread(new Configuration("key"), 24, "main-one", "ando", false, stacktrace); JSONObject result = streamableToJson(thread); assertEquals(24, result.getLong("id")); assertEquals("main-one", result.getString("name")); assertEquals("ando", result.getString("type")); boolean thrown = false; try { result.getBoolean("errorReportingThread"); <START> } catch (JSONException ex) { <END> thrown = true; } assertTrue("errorReportingThread should not be set", thrown); JSONArray frames = result.getJSONArray("stacktrace"); assertEquals(3, frames.length()); assertEquals("run_func", frames.getJSONObject(0).getString("method")); assertEquals("librunner.so", frames.getJSONObject(0).getString("file")); assertEquals(5038, frames.getJSONObject(0).getInt("lineNumber")); assertEquals("Runner.runFunc", frames.getJSONObject(1).getString("method")); assertEquals("Runner.java", frames.getJSONObject(1).getString("file")); assertEquals(14, frames.getJSONObject(1).getInt("lineNumber")); assertEquals("App.launch", frames.getJSONObject(2).getString("method")); assertEquals("App.java", frames.getJSONObject(2).getString("file")); assertEquals(70, frames.getJSONObject(2).getInt("lineNumber")); }</code><technical_language>result.has("key") is useful for this sort of situation</technical_language>

Target:
public void testToStreamNonErrorHandlingThread() throws JSONException, IOException { StackTraceElement[] stacktrace = { new StackTraceElement("", "run_func", "librunner.so", 5038), new StackTraceElement("Runner", "runFunc", "Runner.java", 14), new StackTraceElement("App", "launch", "App.java", 70), }; CachedThread thread = new CachedThread(new Configuration("key"), 24, "main-one", "ando", false, stacktrace); JSONObject result = streamableToJson(thread); assertEquals(24, result.getLong("id")); assertEquals("main-one", result.getString("name")); assertEquals("ando", result.getString("type")); assertFalse("Error reporting thread should not be set when false", result.has("errorReportingThread")); JSONArray frames = result.getJSONArray("stacktrace"); assertEquals(3, frames.length()); assertEquals("run_func", frames.getJSONObject(0).getString("method")); assertEquals("librunner.so", frames.getJSONObject(0).getString("file")); assertEquals(5038, frames.getJSONObject(0).getInt("lineNumber")); assertEquals("Runner.runFunc", frames.getJSONObject(1).getString("method")); assertEquals("Runner.java", frames.getJSONObject(1).getString("file")); assertEquals(14, frames.getJSONObject(1).getInt("lineNumber")); assertEquals("App.launch", frames.getJSONObject(2).getString("method")); assertEquals("App.java", frames.getJSONObject(2).getString("file")); assertEquals(70, frames.getJSONObject(2).getInt("lineNumber")); }