auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void loanCompleteMessageNotify(WeChatMessageNotify weChatMessageNotify) { if (weChatMessageNotify.getBusinessId() == null) { logger.info("[MQ WeChatMessageNotify] type:{} BusinessId is null", weChatMessageNotify.getWeChatMessageType()); return; } LoanModel loanModel = loanMapper.findById(weChatMessageNotify.getBusinessId()); List<String> notifyLoginNames = loanCompleteNotifyUser.stream() .filter(mobile -> userMapper.findByLoginNameOrMobile(mobile) != null) .map(mobile -> userMapper.findByLoginNameOrMobile(mobile).getLoginName()) .collect(Collectors.toList()); notifyLoginNames.stream() .forEach(s -> { if (fetchOpenId(s) == null){ <START> return; <END> } weChatClient.sendTemplateMessage(WeChatMessageType.LOAN_COMPLETE, Maps.newHashMap(ImmutableMap.<String, String>builder() .put("openid", fetchOpenId(s)) .put("first", String.format("%s满标通知（运营内部）。", loanModel.getName())) .put("keyword1", convertCentToTenThousandString(loanModel.getLoanAmount())) .put("keyword2", "已满标") .put("keyword3", new DateTime(loanModel.getRaisingCompleteTime()).toString("yyyy-MM-dd HH:mm")) .put("remark", String.format("%s上线的%s天投资项目已满，30分钟内将完成复核。", new DateTime(loanModel.getFundraisingStartTime()).toString("yyyy-MM-dd HH:mm"), loanModel.getDuration())) .build())); }); }</code><technical_language>break</technical_language>

Target:
private void loanCompleteMessageNotify(WeChatMessageNotify weChatMessageNotify) { if (weChatMessageNotify.getBusinessId() == null) { logger.info("[MQ WeChatMessageNotify] type:{} BusinessId is null", weChatMessageNotify.getWeChatMessageType()); return; } LoanModel loanModel = loanMapper.findById(weChatMessageNotify.getBusinessId()); List<String> notifyLoginNames = loanCompleteNotifyUser.stream() .filter(mobile -> userMapper.findByLoginNameOrMobile(mobile) != null) .map(mobile -> userMapper.findByLoginNameOrMobile(mobile).getLoginName()) .collect(Collectors.toList()); notifyLoginNames.stream() .filter(s -> fetchOpenId(s) != null) .forEach(s -> weChatClient.sendTemplateMessage(WeChatMessageType.LOAN_COMPLETE, Maps.newHashMap(ImmutableMap.<String, String>builder() .put("openid", fetchOpenId(s)) .put("first", String.format("%s满标通知（运营内部）。", loanModel.getName())) .put("keyword1", convertCentToTenThousandString(loanModel.getLoanAmount())) .put("keyword2", "已满标") .put("keyword3", new DateTime(loanModel.getRaisingCompleteTime()).toString("yyyy-MM-dd HH:mm")) .put("remark", String.format("%s上线的%s天投资项目已满，30分钟内将完成复核。", new DateTime(loanModel.getFundraisingStartTime()).toString("yyyy-MM-dd HH:mm"), loanModel.getDuration())) .build()))); }
Source:
<code>private void discardChanges(IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor, CoreText.DiscardChangesOperation_discardingChanges, pathsByRepository.size() * 2); boolean errorOccurred = false; for (Entry<Repository, Collection<String>> entry : pathsByRepository .entrySet()) { Repository repository = entry.getKey(); Collection<String> paths = entry.getValue(); try { discardChanges(repository, paths, progress); } catch (GitAPIException e) { errorOccurred = true; Activator.logError( CoreText.DiscardChangesOperation_discardFailed, e); } <START> progress.worked(1); <END> try { ProjectUtil.refreshRepositoryResources(repository, paths, progress.newChild(1)); } catch (CoreException e) { errorOccurred = true; Activator.logError( CoreText.DiscardChangesOperation_refreshFailed, e); } } if (errorOccurred) { IStatus status = Activator.error( CoreText.DiscardChangesOperation_discardFailedSeeLog, null); throw new CoreException(status); } }</code><technical_language>Remove</technical_language>

Target:
private void discardChanges(IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor, CoreText.DiscardChangesOperation_discardingChanges, pathsByRepository.size() * 2); boolean errorOccurred = false; for (Entry<Repository, Collection<String>> entry : pathsByRepository .entrySet()) { Repository repository = entry.getKey(); Collection<String> paths = entry.getValue(); try { discardChanges(repository, paths, progress.newChild(1)); } catch (GitAPIException e) { errorOccurred = true; Activator.logError( CoreText.DiscardChangesOperation_discardFailed, e); } try { ProjectUtil.refreshRepositoryResources(repository, paths, progress.newChild(1)); } catch (CoreException e) { errorOccurred = true; Activator.logError( CoreText.DiscardChangesOperation_refreshFailed, e); } } if (errorOccurred) { IStatus status = Activator.error( CoreText.DiscardChangesOperation_discardFailedSeeLog, null); throw new CoreException(status); } }
Source:
<code>public static Fs fromJar(URL url) { try { if (url.toURI().getPath().contains(" ")) { try { url = new URL(url.toURI().getPath().replace(" ", "%20")); } catch (MalformedURLException e) { <START> e.printStackTrace(); <END> } } return new JarFs(new File(url.toURI().getPath())); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } }</code><technical_language>this throw IllegalArgumentException (as below)? means collapse catch below</technical_language>

Target:
public static Fs fromJar(URL url) { try { return new JarFs(new File(url.toURI().getPath())); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } }
Source:
<code>public static Archive<?> deploy() { WebArchive war = TestUtil.prepareArchive(ResourceClassProcessorNotAppliedTest.class.getSimpleName()); war.addClass(ResourceClassProcessorNotAppliedTest.class); war.addClass(PortProviderUtil.class); war.addClass(ResourceClassProcessorNotAppliedImplementation.class); war.addAsManifestResource(PermissionUtil.createPermissionsXmlAsset( new SocketPermission(PortProviderUtil.getHost(), "connect,resolve"), new PropertyPermission("org.jboss.resteasy.port", "read"), new RuntimePermission("getenv.RESTEASY_PORT"), <START> new PropertyPermission("ipv6", "read"), <END> new PropertyPermission("node", "read"), new RuntimePermission("getClassLoader"), new PropertyPermission("arquillian.*", "read"), new RuntimePermission("accessDeclaredMembers"), new ReflectPermission("suppressAccessChecks") ), "permissions.xml"); return TestUtil.finishContainerPrepare(war, null, ResourceClassProcessorPureEndPoint.class); }</code><technical_language>concerns "org.jboss.resteasy.port" property permission</technical_language>

Target:
public static Archive<?> deploy() { WebArchive war = TestUtil.prepareArchive(ResourceClassProcessorNotAppliedTest.class.getSimpleName()); war.addClass(ResourceClassProcessorNotAppliedTest.class); war.addClass(PortProviderUtil.class); war.addClass(ResourceClassProcessorNotAppliedImplementation.class); war.addAsManifestResource(PermissionUtil.createPermissionsXmlAsset( new SocketPermission(PortProviderUtil.getHost(), "connect,resolve"), new PropertyPermission("org.jboss.resteasy.port", "read"), new RuntimePermission("getenv.RESTEASY_PORT"), new PropertyPermission("ipv6", "read"), new PropertyPermission("node", "read"), new PropertyPermission("arquillian.*", "read"), new RuntimePermission("accessDeclaredMembers"), new ReflectPermission("suppressAccessChecks") ), "permissions.xml"); return TestUtil.finishContainerPrepare(war, null, ResourceClassProcessorPureEndPoint.class); }
Source:
<code>public GetShard(String name) { super(name); setIdentifier("shard"); setDescription("Gets the name of the shard you're in"); <START> setUsage("/shard <name>"); <END> setArguments(0, 1); }</code><technical_language>change name player</technical_language>

Target:
public GetShard(String name) { super(name); setIdentifier("shard"); setDescription("Gets the name of the shard you're in."); setUsage("/shard <player>"); setArguments(0, 1); }
Source:
<code>public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (!isLegacyCall) { ModelNode op = operation.clone(); PathAddress target = context.getCurrentAddress().getParent(); OperationStepHandler removeHandler; try { <START> context.readResourceFromRoot(target.append(CommonAttributes.JGROUP_DISCOVERY_GROUP, context.getCurrentAddressValue())); <END> target = target.append(CommonAttributes.JGROUP_DISCOVERY_GROUP, context.getCurrentAddressValue()); removeHandler = JGroupDiscoveryGroupRemove.LEGACY_INSTANCE; } catch(Resource.NoSuchResourceException ex) { target = target.append(CommonAttributes.SOCKET_DISCOVERY_GROUP, context.getCurrentAddressValue()); removeHandler = SocketDiscoveryGroupRemove.LEGACY_INSTANCE; } op.get(OP_ADDR).set(target.toModelNode()); context.addStep(op, removeHandler, OperationContext.Stage.MODEL, true); } super.execute(context, operation); }</code><technical_language>this non-recursive</technical_language>

Target:
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (!isLegacyCall) { ModelNode op = operation.clone(); PathAddress target = context.getCurrentAddress().getParent(); OperationStepHandler removeHandler; try { context.readResourceFromRoot(target.append(CommonAttributes.JGROUPS_DISCOVERY_GROUP, context.getCurrentAddressValue()), false); target = target.append(CommonAttributes.JGROUPS_DISCOVERY_GROUP, context.getCurrentAddressValue()); removeHandler = JGroupsDiscoveryGroupRemove.LEGACY_INSTANCE; } catch(Resource.NoSuchResourceException ex) { target = target.append(CommonAttributes.SOCKET_DISCOVERY_GROUP, context.getCurrentAddressValue()); removeHandler = SocketDiscoveryGroupRemove.LEGACY_INSTANCE; } op.get(OP_ADDR).set(target.toModelNode()); context.addStep(op, removeHandler, OperationContext.Stage.MODEL, true); } super.execute(context, operation); }
Source:
<code>public FlairActions(RestClient restClient) { this.restClient = restClient; <START> this.user = null; <END> }</code><technical_language>if **this.user = null**, null class is instantianciated, this line is redundant</technical_language>

Target:
public FlairActions(RestClient restClient) { this.restClient = restClient; }
Source:
<code>private ModelDependencyProviderRegistry createRegistryWithCustomResolver() { final ModelDependencyProviderRegistry registry = new ModelDependencyProviderRegistry() { @Override public Set<URI> getDependencies(URI uri) { final String uriString = uri.toPlatformString(false); final String baseUriString = uriString.substring(0, uriString.lastIndexOf("/")); final String file1UriString = baseUriString + "/" + MODEL_FILE1; final String file2UriString = baseUriString + "/" + MODEL_FILE2; final URI file1Uri = URI.createPlatformResourceURI(file1UriString, false); final URI file2Uri = URI.createPlatformResourceURI(file2UriString, false); <START> return Sets.newHashSet(file1Uri, file2Uri); <END> } }; return registry; }</code><technical_language>iterate set, a linked one</technical_language>

Target:
private ModelDependencyProviderRegistry createRegistryWithCustomResolver() { final ModelDependencyProviderRegistry registry = new ModelDependencyProviderRegistry() { @Override public Set<URI> getDependencies(URI uri) { final String uriString = uri.toPlatformString(false); final String baseUriString = uriString.substring(0, uriString.lastIndexOf("/")); final String file1UriString = baseUriString + "/" + MODEL_FILE1; final String file2UriString = baseUriString + "/" + MODEL_FILE2; final URI file1Uri = URI.createPlatformResourceURI(file1UriString, false); final URI file2Uri = URI.createPlatformResourceURI(file2UriString, false); final LinkedHashSet<URI> dependencies = Sets.newLinkedHashSet(); dependencies.add(file1Uri); dependencies.add(file2Uri); return dependencies; } }; return registry; }
Source:
<code>public RowMapper<C> specialize(ResultSet rs, StatementContext ctx) throws SQLException { Constructor<C> constructor; try { constructor = clazz.getDeclaredConstructor(); } catch (ReflectiveOperationException e) { throw new EntityMemberAccessException("Unable to get constructor for " + clazz, e); } constructor.setAccessible(true); List<MemberSetter<C>> setters = new ArrayList<>(); for (int colIndex = rs.getMetaData().getColumnCount(); colIndex >= 1; colIndex--) { String columnLabel = rs.getMetaData().getColumnLabel(colIndex); JpaMember member = jpaClass.lookupMember(columnLabel); if (member != null) { Type memberType = member.getType(); ColumnMapper<?> columnMapper = ctx.findColumnMapperFor(memberType) .orElseThrow(() -> new NoSuchMapperException("No column mapper for " + memberType)); <START> setters.add(obj -> member.write(obj, columnMapper.map(rs, columnLabel, ctx))); <END> } } return (r, c) -> { C obj; try { obj = constructor.newInstance(); } catch (ReflectiveOperationException e) { throw new EntityMemberAccessException("Unable to invoke " + constructor, e); } for (MemberSetter<C> setter : setters) { setter.mapAndSetMember(obj); } return obj; }; }</code><technical_language>good colIndex instead</technical_language>

Target:
public RowMapper<C> specialize(ResultSet rs, StatementContext ctx) throws SQLException { Constructor<C> constructor; try { constructor = clazz.getDeclaredConstructor(); } catch (ReflectiveOperationException e) { throw new EntityMemberAccessException("Unable to get constructor for " + clazz, e); } constructor.setAccessible(true); List<MemberSetter<C>> setters = new ArrayList<>(); for (int colIndex = rs.getMetaData().getColumnCount(); colIndex >= 1; colIndex--) { String columnLabel = rs.getMetaData().getColumnLabel(colIndex); JpaMember member = jpaClass.lookupMember(columnLabel); if (member != null) { Type memberType = member.getType(); ColumnMapper<?> columnMapper = ctx.findColumnMapperFor(memberType) .orElseThrow(() -> new NoSuchMapperException("No column mapper for " + memberType)); final int columnIndex = colIndex; setters.add(obj -> member.write(obj, columnMapper.map(rs, columnIndex, ctx))); } } return (r, c) -> { C obj; try { obj = constructor.newInstance(); } catch (ReflectiveOperationException e) { throw new EntityMemberAccessException("Unable to invoke " + constructor, e); } for (MemberSetter<C> setter : setters) { setter.mapAndSetMember(obj); } return obj; }; }
Source:
<code>public void scrollToIndex(int index) { ListModel<Object> model = getModel(); double scrollRatio; if (model != null) { <START> if (index < 0 || index > model.getSize() - 1) { <END> throw new IndexOutOfBoundsException("Illegal index: " + index); } scrollRatio = (double) index / model.getSize(); } else { int rowCount = getRows().getChildren().size(); if (index < 0 || index > rowCount - 1) { throw new IndexOutOfBoundsException("Illegal index: " + index); } scrollRatio = (double) index / rowCount; } response(new AuInvoke(this, "_scrollToIndex", index, scrollRatio)); }</code><technical_language>int rowCount = model.getSize(); code in if block shared</technical_language>

Target:
public void scrollToIndex(int index) { ListModel<Object> model = getModel(); int rowCount = model != null ? model.getSize() : getRows().getChildren().size(); if (index < 0 || index > rowCount - 1) { throw new IndexOutOfBoundsException("Illegal index: " + index); } response(new AuInvoke(this, "scrollToIndex", index, (double) index / rowCount)); }
Source:
<code>public static void validateNodeId(Cluster cluster, HostMatcher matcher, int nodeId) { if(isSingleLocalCluster(cluster, matcher)) { cluster.getNodeById(nodeId); return; } List<String> errors = Lists.newArrayList(); for(Node node: cluster.getNodes()) { if(nodeId == node.getId()) { if(!matcher.match(node)) { errors.add(node.briefToString() + " selected as current node " + nodeId + " failed to match"); } }else { if(matcher.match(node)) { errors.add(node.briefToString() + " matched, though the expected node is " + nodeId); } } } if(!errors.isEmpty()) { if(errors.size() == 1) { throw new VoldemortApplicationException(errors.get(0)); } else { throw new VoldemortApplicationException(" Number of Validation failures " + errors.size() + ". Details : " <START> + Arrays.toString(errors.toArray())); <END> } } else { logger.info("Node Id Validation succeeded. Node Id " + nodeId); } }</code><technical_language>a lot easier logger.error() report errors in exception</technical_language>

Target:
public static void validateNodeId(Cluster cluster, HostMatcher matcher, int nodeId) { logger.info(" Using Matcher " + matcher.getDebugInfo()); cluster.getNodeById(nodeId); if(isSingleLocalCluster(cluster, matcher)) { return; } List<String> errors = Lists.newArrayList(); for(Node node: cluster.getNodes()) { if(nodeId == node.getId()) { if(!matcher.match(node)) { errors.add(node.briefToString() + " selected as current node " + nodeId + " failed to match"); } }else { if(matcher.match(node)) { errors.add(node.briefToString() + " matched, though the expected node is " + nodeId); } } } if(!errors.isEmpty()) { String errorMessage = " Number of Validation failures " + errors.size() + ". Details : " + Arrays.toString(errors.toArray()); logger.error(errorMessage); if(errors.size() == 1) { throw new VoldemortApplicationException(errors.get(0)); } else { throw new VoldemortApplicationException(errorMessage); } } else { logger.info("Node Id Validation succeeded. Node Id " + nodeId); } }
Source:
<code>public ArrayOfDoublesSketch apply(final int nominalEntries, final int numberOfValues, final ArrayOfDoublesSketch[] sketches) { <START> switch (this) { <END> case UNION: final ArrayOfDoublesUnion union = new ArrayOfDoublesSetOperationBuilder().setNominalEntries(nominalEntries) .setNumberOfValues(numberOfValues).buildUnion(); for (final ArrayOfDoublesSketch sketch : sketches) { union.update(sketch); } return union.getResult(); case INTERSECT: final ArrayOfDoublesIntersection intersection = new ArrayOfDoublesSetOperationBuilder() .setNominalEntries(nominalEntries).setNumberOfValues(numberOfValues).buildIntersection(); for (final ArrayOfDoublesSketch sketch : sketches) { intersection.update(sketch, COMBINER); } return intersection.getResult(); case NOT: if (sketches.length < 1) { throw new IAE("A-Not-B requires at least 1 sketch"); } if (sketches.length == 1) { return sketches[0]; } ArrayOfDoublesSketch result = sketches[0]; for (int i = 1; i < sketches.length; i++) { final ArrayOfDoublesAnotB aNotB = new ArrayOfDoublesSetOperationBuilder().setNumberOfValues(numberOfValues) .buildAnotB(); aNotB.update(result, sketches[i]); result = aNotB.getResult(); } return result; default: throw new IAE("Unknown sketch operation %s", this.toString()); } }</code><technical_language>I asked move this method enum previous of review specifically avoid this lengthy switch statement. enum constant implements logic</technical_language>

Target:
public ArrayOfDoublesSketch apply(final int nominalEntries, final int numberOfValues, final ArrayOfDoublesSketch[] sketches) { final ArrayOfDoublesUnion union = new ArrayOfDoublesSetOperationBuilder().setNominalEntries(nominalEntries) .setNumberOfValues(numberOfValues).buildUnion(); for (final ArrayOfDoublesSketch sketch : sketches) { union.update(sketch); } return union.getResult(); }
Source:
<code>public ZestStatement deepCopy() { ZestConditional copy=new ZestConditional(getIndex()); copy.rootExpression=(ZestExpressionElement)rootExpression.deepCopy(); ArrayList<ZestStatement> ifList=new ArrayList<>(); for(ZestStatement stmt:ifStatements) <START> copy.ifStatements.add(stmt.deepCopy()); <END> ArrayList<ZestStatement> elseList=new ArrayList<>(); for(ZestStatement stmt:elseStatements) copy.elseStatements.add(stmt.deepCopy()); copy.elseStatements=elseList; copy.ifStatements=ifList; return copy; }</code><technical_language>brackets prevent confusion, for (ZestStatement stmt:ifStatements) { copy.ifStatements.add(stmt.deepCopy()); }</technical_language>

Target:
public ZestStatement deepCopy() { ZestConditional copy=new ZestConditional(getIndex()); copy.rootExpression=(ZestExpressionElement)rootExpression.deepCopy(); ArrayList<ZestStatement> ifList=new ArrayList<>(); for(ZestStatement stmt:ifStatements){ copy.ifStatements.add(stmt.deepCopy()); } ArrayList<ZestStatement> elseList=new ArrayList<>(); for(ZestStatement stmt:elseStatements){ copy.elseStatements.add(stmt.deepCopy()); } copy.elseStatements=elseList; copy.ifStatements=ifList; return copy; }
Source:
<code>public void validateBaseEncodedURLTest() throws UnsupportedEncodingException, Base64DecoderException { String goodUrlBase = "<LINK_2>"; String goodUrl = Base64.encode(goodUrlBase.getBytes("UTF-8")); assertEquals(goodUrlBase, SigningUtil.decodeUrl(goodUrl)); <START> String badUrlBase = "<LINK_1>"; <END> String badUrl = Base64.encode(badUrlBase.getBytes("UTF-8")); boolean didFail = false; try { SigningUtil.decodeUrl(badUrl); } catch (RuntimeException e) { didFail = true; } assertTrue(didFail); }</code><technical_language>damn corncare</technical_language>

Target:
public void validateBaseEncodedURLTest() throws UnsupportedEncodingException, Base64DecoderException { String goodUrlBase = "<LINK_2>"; String goodUrl = Base64.encode(goodUrlBase.getBytes("UTF-8")); assertEquals(goodUrlBase, SigningUtil.decodeUrl(goodUrl)); assertWhitelistURLFailure("<LINK_1>"); assertWhitelistURLFailure("<LINK_0>"); }
Source:
<code>public void visitAnnotation(DetailAST ast) { <START> if (ast.getParent().getParent().getType() != TokenTypes.ANNOTATION_DEF) { <END> classContext.visitAnnotationType(ast); } }</code><technical_language>do ignore annotations ANNOTATION_DEF</technical_language>

Target:
public void visitAnnotation(DetailAST ast) { classContext.visitAnnotationType(ast); }
Source:
<code>IssueManager(Project project, LiveIssueCache liveIssueCache) { myProject = project; this.liveIssueCache = liveIssueCache; project.getMessageBus().connect().subscribe(ProjectManager.TOPIC, new ProjectManagerListener() { @Override public void projectClosing(@NotNull Project project) { try { if (project == myProject) { liveIssueCache.flushAll(); } } catch (Exception e) { <START> Logger.getInstance(getClass()).error("Cannot flush issues", e); <END> } } }); }</code><technical_language>suggestion LOGGER.error("Cannot flush issues", e);</technical_language>

Target:
IssueManager(Project project, LiveIssueCache liveIssueCache) { myProject = project; this.liveIssueCache = liveIssueCache; project.getMessageBus().connect().subscribe(ProjectManager.TOPIC, new ProjectManagerListener() { @Override public void projectClosing(@NotNull Project project) { try { if (project == myProject) { liveIssueCache.flushAll(); } } catch (Exception e) { LOGGER.error("Cannot flush issues", e); } } }); }
Source:
<code>public void setEnabled(boolean enabled) { asTextBox().setEnabled(enabled); <START> if (enabled) { <END> asTextBox().getElement().getStyle().setBackgroundColor("#ffffff"); } else { asTextBox().getElement().getStyle().setBackgroundColor("#e5e5e5"); } }</code><technical_language>more sense add/remove a style class instead of hard coding a background color box? if change default background color of application white, this change too. I a quick search I find other 'disabled' color in application #E5E5E5, color from</technical_language>

Target:
public void setEnabled(boolean enabled) { asTextBox().setEnabled(enabled); }
Source:
<code>public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) { InformationSchemaTableHandle handle = checkTableHandle(table); TupleDomain<ColumnHandle> predicate = constraint.getSummary(); Optional<Stream<Map<ColumnHandle, NullableValue>>> partitions = getPartitions(session, handle.getSchemaTableName(), handle.getCatalogName(), predicate); if (partitions.isPresent()) { List<TupleDomain<ColumnHandle>> partitionsTupleDomains = partitions.get() <START> .filter(constraint.predicate()) <END> .map(TupleDomain::fromFixedValues) .collect(toImmutableList()); if (partitionsTupleDomains.isEmpty()) { return ImmutableList.of(); } predicate = predicate.intersect(TupleDomain.columnWiseUnion(partitionsTupleDomains)); } ConnectorTableLayout layout = new ConnectorTableLayout( new InformationSchemaTableLayoutHandle(handle, predicate), Optional.empty(), predicate, Optional.empty(), Optional.empty(), Optional.empty(), ImmutableList.of()); return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary())); }</code><technical_language>constraint column_name right</technical_language>

Target:
public List<ConnectorTableLayoutResult> getTableLayouts(ConnectorSession session, ConnectorTableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) { if (constraint.getSummary().isNone()) { return ImmutableList.of(); } InformationSchemaTableHandle handle = checkTableHandle(table); Set<QualifiedTablePrefix> prefixes = calculatePrefixesWithSchemaName(session, constraint.getSummary(), constraint.predicate()); if (isTablesEnumeratingTable(handle.getSchemaTableName())) { Set<QualifiedTablePrefix> tablePrefixes = calculatePrefixesWithTableName(session, prefixes, constraint.getSummary(), constraint.predicate()); if (tablePrefixes.size() <= MAX_PREFIXES_COUNT) { prefixes = tablePrefixes; } } if (prefixes.size() > MAX_PREFIXES_COUNT) { prefixes = ImmutableSet.of(new QualifiedTablePrefix(catalogName)); } ConnectorTableLayout layout = new ConnectorTableLayout(new InformationSchemaTableLayoutHandle(handle, prefixes)); return ImmutableList.of(new ConnectorTableLayoutResult(layout, constraint.getSummary())); }
Source:
<code>public List<MessageItem> onDisconnect() { int messageSize = 0; List<MessageItem> items = null; synchronized(sendBufferLock) { for(Map<Integer, MessageWrapper> queue : startedByPrio) { <START> if(items == null) <END> items = new ArrayList<>(); for(MessageWrapper wrapper : queue.values()) { items.add(wrapper.getItem()); messageSize += wrapper.getLength(); } queue.clear(); } sendBufferUsed -= messageSize; if(sendBufferUsed != 0) { Logger.warning(this, "Possible leak in transport code: Buffer size not empty after disconnecting on "+this+" for "+pn+" after removing "+messageSize+" total was "+sendBufferUsed); sendBufferUsed = 0; } } return items; }</code><technical_language>Is this if seriously want initialize items declared</technical_language>

Target:
public List<MessageItem> onDisconnect() { int messageSize = 0; final List<MessageItem> items = new ArrayList<>(); synchronized(sendBufferLock) { for(Map<Integer, MessageWrapper> queue : startedByPrio) { for(MessageWrapper wrapper : queue.values()) { items.add(wrapper.getItem()); messageSize += wrapper.getLength(); } queue.clear(); } sendBufferUsed -= messageSize; if(sendBufferUsed != 0) { Logger.warning(this, "Possible leak in transport code: Buffer size not empty after disconnecting on "+this+" for "+pn+" after removing "+messageSize+" total was "+sendBufferUsed); sendBufferUsed = 0; } } return items; }
Source:
<code>public void afterClass() throws Exception { <START> String testClassName = this.getShortClassName(); <END> System.out.println("AfterClass: " + testClassName + " of TestListenerCallbackBatchMode called."); _manager.disconnect(); deleteCluster(clusterName); }</code><technical_language>Do need in BeforeClass? If need this print out class methods, put this ZkTestBase (like do in for beforeTest afterTest in ZkTestBase)</technical_language>

Target:
public void afterClass() throws Exception { _manager.disconnect(); deleteCluster(clusterName); }
Source:
<code>public @NonNull Query setAlternativesAsExact(AlternativesAsExact[] types) { <START> if (types == null || types.length == 0) { <END> set(KEY_ALTERNATIVES_AS_EXACT, null); } else { List<String> stringList = new ArrayList<>(types.length); for (AlternativesAsExact type : types) { switch (type) { case IGNORE_PLURALS: stringList.add("ignorePlurals"); break; case MULTI_WORDS_SYNONYM: stringList.add("multiWordsSynonym"); break; case SINGLE_WORD_SYNONYM: stringList.add("singleWordSynonym"); break; } } String alternatives = TextUtils.join(",", stringList); set(KEY_ALTERNATIVES_AS_EXACT, alternatives); } return this; }</code><technical_language>For sake of symmetry, I allow zero-length arrays (resulting in empty string value). getter return a zero-length array for empty string value</technical_language>

Target:
public @NonNull Query setAlternativesAsExact(AlternativesAsExact[] types) { if (types == null) { set(KEY_ALTERNATIVES_AS_EXACT, null); } else { List<String> stringList = new ArrayList<>(types.length); for (AlternativesAsExact type : types) { switch (type) { case IGNORE_PLURALS: stringList.add("ignorePlurals"); break; case MULTI_WORDS_SYNONYM: stringList.add("multiWordsSynonym"); break; case SINGLE_WORD_SYNONYM: stringList.add("singleWordSynonym"); break; } } String alternatives = TextUtils.join(",", stringList); set(KEY_ALTERNATIVES_AS_EXACT, alternatives); } return this; }
Source:
<code>public void beforeTest() throws IOException { Mockito.mockitoSession().initMocks(this); request = PowerMockito.mock(HttpRequest.class); response = PowerMockito.mock(HttpResponse.class); client = PowerMockito.mock(DatabaseClient.class); <START> BufferedReader reader = new BufferedReader(new StringReader("{}")); <END> PowerMockito.when(request.getReader()).thenReturn(reader); responseOut = new StringWriter(); writerOut = new BufferedWriter(responseOut); PowerMockito.when(response.getWriter()).thenReturn(writerOut); logHandler.clear(); }</code><technical_language>Nit: do need lines</technical_language>

Target:
public void beforeTest() throws IOException { Mockito.mockitoSession().initMocks(this); request = PowerMockito.mock(HttpRequest.class); response = PowerMockito.mock(HttpResponse.class); client = PowerMockito.mock(DatabaseClient.class); responseOut = new StringWriter(); writerOut = new BufferedWriter(responseOut); PowerMockito.when(response.getWriter()).thenReturn(writerOut); logHandler.clear(); }
Source:
<code>public void onReceive(Context context, Intent intent) { int wifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, -1); if (WifiManager.WIFI_STATE_CHANGED_ACTION.equals(intent.getAction()) && WifiManager.WIFI_STATE_ENABLED == wifiState) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(new Intent(context, ServedService.class)); } else { context.startService(new Intent(context, ServedService.class)); } <START> } <END> }</code><technical_language>ServedService.class replaced WifiService.class in lines</technical_language>

Target:
public void onReceive(Context context, Intent intent) { int wifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, -1); if (WifiManager.WIFI_STATE_CHANGED_ACTION.equals(intent.getAction()) && WifiManager.WIFI_STATE_ENABLED == wifiState) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(new Intent(context, WifiService.class)); } else { context.startService(new Intent(context, WifiService.class)); } } }
Source:
<code>public DefaultCompilationResponse(final Boolean successful, final List<String> mavenOutput, final Path workingDir, final List<String> targetContent, final List<String> projectDependencies, final String requestUUID) { this.successful = successful; <START> if(mavenOutput != null) { <END> this.mavenOutput = new ArrayList<>(mavenOutput); }else{ this.mavenOutput = Collections.emptyList(); } this.workingDir = workingDir; if(targetContent != null) { this.targetContent = new ArrayList<>(targetContent); }else{ this.targetContent = Collections.emptyList(); } if(projectDependencies != null) { this.projectDependencies = new ArrayList<>(projectDependencies); }else{ this.projectDependencies = Collections.emptyList(); } this.requestUUID = requestUUID; }</code><technical_language>consider writing a helper this remove boilerplate: private <T> List<T> nullToEmpty(List<T> list) { if (list == null) { return Collections.emptyList(); } else { return new ArrayList<>(list); } } call in constructor this.mavenOuput = nullToEmpty(mavenOutput);</technical_language>

Target:
public DefaultCompilationResponse(final Boolean successful, final List<String> mavenOutput, final Path workingDir, final List<String> targetContent, final List<String> projectDependencies, final String requestUUID) { this.successful = successful; this.mavenOutput = nullToEmpty(mavenOutput); this.workingDir = workingDir; this.targetContent = nullToEmpty(targetContent); this.projectDependencies = nullToEmpty(projectDependencies); this.requestUUID = requestUUID; }
Source:
<code>private static void zip(OutputStream outputStream, VirtualFile dir, String glob) throws IOException { ZipOutputStream zos = new ZipOutputStream(outputStream); zos.setEncoding(System.getProperty("file.encoding")); for (String n : dir.list(glob.length() == 0 ? "**" : glob)) { String relativePath; if (glob.length() == 0) { relativePath = dir.getName() + '/' + n; } else { relativePath = n; } <START> ZipEntry e = new ZipEntry(File.separatorChar == '\\' ? relativePath.replace('\\', '/') : relativePath); <END> VirtualFile f = dir.child(n); e.setTime(f.lastModified()); zos.putNextEntry(e); InputStream in = f.open(); try { Util.copyStream(in, zos); } finally { IOUtils.closeQuietly(in); } zos.closeEntry(); } zos.close(); }</code><technical_language>shorter, more complete more readable (IMHO): ZipEntry e = new ZipEntry(relativePath.replace(File.separatorChar , '/'));</technical_language>

Target:
private static void zip(OutputStream outputStream, VirtualFile dir, String glob) throws IOException { ZipOutputStream zos = new ZipOutputStream(outputStream); zos.setEncoding(System.getProperty("file.encoding")); for (String n : dir.list(glob.length() == 0 ? "**" : glob)) { String relativePath; if (glob.length() == 0) { relativePath = dir.getName() + '/' + n; } else { relativePath = n; } ZipEntry e = new ZipEntry(relativePath.replace('\\', '/')); VirtualFile f = dir.child(n); e.setTime(f.lastModified()); zos.putNextEntry(e); InputStream in = f.open(); try { Util.copyStream(in, zos); } finally { IOUtils.closeQuietly(in); } zos.closeEntry(); } zos.close(); }
Source:
<code>public <K, JM extends Message<K, ?>, RM extends Message> MessageStream<RM> join(MessageStream<JM> otherStream, JoinFunction<M, JM, RM> joinFn) { MessageStreamImpl<RM> outputStream = new MessageStreamImpl<>(); BiFunction<M, JM, RM> parJoin1 = joinFn::apply; BiFunction<JM, M, RM> parJoin2 = (m, t1) -> joinFn.apply(t1, m); ((MessageStreamImpl<JM>) otherStream).getRegisteredOperatorSpecs().add( <START> OperatorSpecs.<JM, K, M, RM>createPartialJoinOperator(parJoin2, outputStream)); <END> this.getRegisteredOperatorSpecs().add(OperatorSpecs.<M, K, JM, RM>createPartialJoinOperator(parJoin1, outputStream)); return outputStream; }</code><technical_language>type parameter <JM, K,M, RM> inferable type of parJoin2</technical_language>

Target:
public <K, JM extends MessageEnvelope<K, ?>, RM extends MessageEnvelope> MessageStream<RM> join( MessageStream<JM> otherStream, JoinFunction<M, JM, RM> joinFn) { MessageStreamImpl<RM> outputStream = new MessageStreamImpl<>(); BiFunction<M, JM, RM> parJoin1 = joinFn::apply; BiFunction<JM, M, RM> parJoin2 = (m, t1) -> joinFn.apply(t1, m); ((MessageStreamImpl<JM>) otherStream).registeredOperatorSpecs.add( OperatorSpecs.createPartialJoinOperator(parJoin2, outputStream)); this.registeredOperatorSpecs.add(OperatorSpecs.createPartialJoinOperator(parJoin1, outputStream)); return outputStream; }
Source:
<code>private void closeMultiFiles() throws IOException { headerOut.close(); headerOutLong.close(); <START> valuesOut.close(); <END> Preconditions.checkState( headerOutLong.getCount() == (numWritten * 8), "numWritten[%s] number of rows should have [%s] bytes written to headerOutLong, had[%s]", numWritten, numWritten * 8, headerOutLong.getCount() ); Preconditions.checkState( headerOutLong.getCount() < Integer.MAX_VALUE, "Wrote[%s] bytes in header file, which is too many.", headerOutLong.getCount() ); }</code><technical_language>3 lines common in closeXXX() moved close()</technical_language>

Target:
private void closeMultiFiles() throws IOException { headerOutLong.close(); Preconditions.checkState( headerOutLong.getCount() == (numWritten * Longs.BYTES), "numWritten[%s] number of rows should have [%s] bytes written to headerOutLong, had[%s]", numWritten, numWritten * Longs.BYTES, headerOutLong.getCount() ); Preconditions.checkState( headerOutLong.getCount() < (Integer.MAX_VALUE & ~PAGE_SIZE), "Wrote[%s] bytes in header file, which is too many.", headerOutLong.getCount() ); }
Source:
<code>public <T extends Throwable> boolean handle(final T throwable, final Object controller, final String controllerName, final String actionName) { Assert.requireNonNull(throwable, "throwable"); Assert.requireNonNull(controller, "controller"); Assert.requireNonBlank(controllerName, "controllerName"); Assert.requireNonBlank(actionName, "actionName"); final ActionExceptionEventImpl exceptionEvent = new ActionExceptionEventImpl(actionName, controllerName, throwable); final List<Consumer<ActionExceptionEvent<T>>> consumers = new ArrayList<>(); consumers.addAll(getConsumersForTypeInController(throwable.getClass(), controller)); LOG.debug("Found handlers to handle action exception of type {}", consumers.size(), throwable.getClass()); final Iterator<Consumer<ActionExceptionEvent<T>>> iterator = consumers.iterator(); while (!exceptionEvent.isAborted() && iterator.hasNext()) { final Consumer<ActionExceptionEvent<T>> handler = iterator.next(); try { handler.accept(exceptionEvent); <START> } catch (Exception e) { <END> LOG.error("Error in calling exception handler for error of type '" + throwable.getClass() + "' thrown by action '" + exceptionEvent.getActionName() + "' of controller '" + exceptionEvent.getControllerName() + "'!", e); } } return exceptionEvent.isAborted(); }</code><technical_language>Add final keyword</technical_language>

Target:
public <T extends Throwable> boolean handle(final T throwable, final Object controller, final String controllerName, final String actionName) { Assert.requireNonNull(throwable, "throwable"); Assert.requireNonNull(controller, "controller"); Assert.requireNonBlank(controllerName, "controllerName"); Assert.requireNonBlank(actionName, "actionName"); final ActionExceptionEventImpl exceptionEvent = new ActionExceptionEventImpl(actionName, controllerName, throwable); final List<Consumer<ActionExceptionEvent<T>>> consumers = new ArrayList<>(); consumers.addAll(getConsumersForTypeInController(throwable.getClass(), controller)); LOG.debug("Found handlers to handle action exception of type {}", consumers.size(), throwable.getClass()); final Iterator<Consumer<ActionExceptionEvent<T>>> iterator = consumers.iterator(); while (!exceptionEvent.isAborted() && iterator.hasNext()) { final Consumer<ActionExceptionEvent<T>> handler = iterator.next(); try { handler.accept(exceptionEvent); } catch (final Exception e) { LOG.error("Error in calling exception handler for error of type '" + throwable.getClass() + "' thrown by action '" + exceptionEvent.getActionName() + "' of controller '" + exceptionEvent.getControllerName() + "'!", e); } } return exceptionEvent.isAborted(); }
Source:
<code>public MotorIdle(Motor motor) <START> { <END> super("MotorIdle"); this.motor = motor; requires(motor); setInterruptible(true); LogKitten.d("MotorIdle created"); }</code><technical_language>format</technical_language>

Target:
public MotorIdle(Motor motor) { this("MotorIdle", motor); }
Source:
<code>private boolean check(File fingerprintFile, TaskListener listener) { try { Fingerprint fp = loadFingerprint(fingerprintFile); if (fp == null || (!fp.isAlive() && fp.getFacetBlockingDeletion() == null) ) { listener.getLogger().println("deleting obsolete " + fingerprintFile); fingerprintFile.delete(); return true; } else { if (!fp.isAlive()) { FingerprintFacet deletionBlockerFacet = fp.getFacetBlockingDeletion(); <START> listener.getLogger().println(deletionBlockerFacet.getClass().getName() + " created at timestamp: " + deletionBlockerFacet.getTimestamp() + " blocked deletion of " + fingerprintFile); <END> } fp = getFingerprint(fp); return fp.trim(); } } catch (IOException e) { Functions.printStackTrace(e, listener.error("Failed to process " + fingerprintFile)); return false; } }</code><technical_language>this nicer? suggestion listener.getLogger().println(deletionBlockerFacet.getClass().getName() + " created " + new Date(deletionBlockerFacet.getTimestamp()) + " blocked deletion of " + fingerprintFile); (Assuming this is millis. Untested.)</technical_language>

Target:
private boolean check(File fingerprintFile, TaskListener listener) { try { Fingerprint fp = loadFingerprint(fingerprintFile); if (fp == null || (!fp.isAlive() && fp.getFacetBlockingDeletion() == null) ) { listener.getLogger().println("deleting obsolete " + fingerprintFile); fingerprintFile.delete(); return true; } else { if (!fp.isAlive()) { FingerprintFacet deletionBlockerFacet = fp.getFacetBlockingDeletion(); listener.getLogger().println(deletionBlockerFacet.getClass().getName() + " created on " + new Date(deletionBlockerFacet.getTimestamp()) + " blocked deletion of " + fingerprintFile); } fp = getFingerprint(fp); return fp.trim(); } } catch (IOException e) { Functions.printStackTrace(e, listener.error("Failed to process " + fingerprintFile)); return false; } }
Source:
<code>protected String[] customCommandLineValidation() { if (BARCODE_PARAMS != null) { LIBRARY_PARAMS = BARCODE_PARAMS; } final ArrayList<String> messages = new ArrayList<String>(); readStructure = new ReadStructure(READ_STRUCTURE); if (!readStructure.sampleBarcodes.isEmpty() && LIBRARY_PARAMS == null) { messages.add("BARCODE_PARAMS or LIBRARY_PARAMS is missing. If READ_STRUCTURE contains a B (barcode)" + " then either LIBRARY_PARAMS or BARCODE_PARAMS(deprecated) must be provided!"); } if (READ_GROUP_ID == null) { READ_GROUP_ID = RUN_BARCODE.substring(0, 5) + "." + LANE; } if (!TAG_PER_MOLECULAR_INDEX.isEmpty() && TAG_PER_MOLECULAR_INDEX.size() != readStructure.molecularBarcode.length()) { messages.add("The number of tags given in TAG_PER_MOLECULAR_INDEX does not match the number of molecular indexes in READ_STRUCTURE"); } <START> if ((FIVE_PRIME_ADAPTER != null && THREE_PRIME_ADAPTER == null) || (THREE_PRIME_ADAPTER != null && FIVE_PRIME_ADAPTER == null)) { <END> messages.add("Either both or neither of THREE_PRIME_ADAPTER and FIVE_PRIME_ADAPTER must be set."); } if (messages.isEmpty()) { return null; } return messages.toArray(new String[messages.size()]); }</code><technical_language>is if((FIVE_PRIME_ADAPTER == null) != (THREE_PRIME_ADAPTER == null)) clearer/shorter</technical_language>

Target:
protected String[] customCommandLineValidation() { if (BARCODE_PARAMS != null) { LIBRARY_PARAMS = BARCODE_PARAMS; } final ArrayList<String> messages = new ArrayList<String>(); readStructure = new ReadStructure(READ_STRUCTURE); if (!readStructure.sampleBarcodes.isEmpty() && LIBRARY_PARAMS == null) { messages.add("BARCODE_PARAMS or LIBRARY_PARAMS is missing. If READ_STRUCTURE contains a B (barcode)" + " then either LIBRARY_PARAMS or BARCODE_PARAMS(deprecated) must be provided!"); } if (READ_GROUP_ID == null) { READ_GROUP_ID = RUN_BARCODE.substring(0, 5) + "." + LANE; } if (!TAG_PER_MOLECULAR_INDEX.isEmpty() && TAG_PER_MOLECULAR_INDEX.size() != readStructure.molecularBarcode.length()) { messages.add("The number of tags given in TAG_PER_MOLECULAR_INDEX does not match the number of molecular indexes in READ_STRUCTURE"); } if ((FIVE_PRIME_ADAPTER == null) != (THREE_PRIME_ADAPTER == null)) { messages.add("THREE_PRIME_ADAPTER and FIVE_PRIME_ADAPTER must either both be null or both be set."); } if (messages.isEmpty()) { return null; } return messages.toArray(new String[messages.size()]); }
Source:
<code><START> public View getView(int position, View convertView, ViewGroup parent) { <END> return getCustomView(position, parent); }</code><technical_language>for this convertView recycle view, if is null inflate, if assume is of correct view type</technical_language>

Target:
public View getView(int position, View convertView, ViewGroup parent) { return getCustomView(position, convertView, parent); }
Source:
<code>public static void populateChoicePanel(Context context, Button choicePanel, DialogChoiceItem item, boolean iconToLeft) { choicePanel.setText(item.text); choicePanel.setOnClickListener(item.listener); if (item.iconResId != -1) { <START> Drawable icon = context.getResources().getDrawable(item.iconResId); <END> if (iconToLeft) { choicePanel.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null); } else { choicePanel.setCompoundDrawablesWithIntrinsicBounds(null, icon, null, null); } } }</code><technical_language>getDrawable is deprecated, ContextCompat.getDrawable(context, R.drawable.***)</technical_language>

Target:
public static void populateChoicePanel(Context context, Button choicePanel, DialogChoiceItem item, boolean iconToLeft) { choicePanel.setText(item.text); choicePanel.setOnClickListener(item.listener); if (item.iconResId != -1) { Drawable icon = ContextCompat.getDrawable(context, item.iconResId); if (iconToLeft) { choicePanel.setCompoundDrawablesWithIntrinsicBounds(icon, null, null, null); } else { choicePanel.setCompoundDrawablesWithIntrinsicBounds(null, icon, null, null); } } }
Source:
<code>private void parityCheckAndExpungeIfMet(ChargeEntity chargeEntity) { if (!inTerminalState(chargeEntity)) { logger.info("Charge not expunged because it is not in a terminal state {}", kv(PAYMENT_EXTERNAL_ID, chargeEntity.getExternalId())); } else if (parityCheckService.parityCheckChargeForExpunger(chargeEntity)) { chargeDao.expungeCharge(chargeEntity.getId()); logger.info("Charge expunged from connector {}", kv(PAYMENT_EXTERNAL_ID, chargeEntity.getExternalId())); } else { <START> if (chargeEntity.getParityCheckDate() == null) { <END> chargeDao.updateChargeParityCheckDate(chargeEntity.getId(), ZonedDateTime.now(UTC)); logger.info("Charge cannot be expunged because parity check with ledger failed {}", kv(PAYMENT_EXTERNAL_ID, chargeEntity.getExternalId())); } else { chargeDao.updateChargeParityCheckDate(chargeEntity.getId(), ZonedDateTime.now(UTC)); logger.error("Charge cannot be expunged because parity check with ledger repeatedly failed {}", kv(PAYMENT_EXTERNAL_ID, chargeEntity.getExternalId())); } } }</code><technical_language>parityCheckDate is null charge updated <LINK_0> mentioned in <LINK_1></technical_language>

Target:
private void parityCheckAndExpungeIfMet(ChargeEntity chargeEntity) { boolean hasChargeBeenParityCheckedBefore = chargeEntity.getParityCheckDate() != null; if (!inTerminalState(chargeEntity)) { logger.info("Charge not expunged because it is not in a terminal state {}", kv(PAYMENT_EXTERNAL_ID, chargeEntity.getExternalId())); } else if (parityCheckService.parityCheckChargeForExpunger(chargeEntity)) { chargeDao.expungeCharge(chargeEntity.getId()); logger.info("Charge expunged from connector {}", kv(PAYMENT_EXTERNAL_ID, chargeEntity.getExternalId())); } else { if (hasChargeBeenParityCheckedBefore) { logger.error("Charge cannot be expunged because parity check with ledger repeatedly failed {}", kv(PAYMENT_EXTERNAL_ID, chargeEntity.getExternalId())); } else { logger.info("Charge cannot be expunged because parity check with ledger failed {}", kv(PAYMENT_EXTERNAL_ID, chargeEntity.getExternalId())); } } }
Source:
<code>private final void verifyKeptExistingData(ResultSet res, String tableName) throws Exception { <START> res = executeString("select * from " + tableName + " where col2 = 1"); <END> String resultSetData = resultSetToString(res); res.close(); String expected = "col4,col1,col2,col3\n" + "-------------------------------\n" + "N,1,1,17.0\n" + "N,1,1,17.0\n" + "N,1,1,30.0\n" + "N,1,1,36.0\n" + "N,1,1,36.0\n"; assertEquals(expected, resultSetData); }</code><technical_language>order clause added</technical_language>

Target:
private final void verifyKeptExistingData(ResultSet res, String tableName) throws Exception { res = executeString("select * from " + tableName + " where col2 = 1 order by col4, col1, col2, col3"); String resultSetData = resultSetToString(res); res.close(); String expected = "col4,col1,col2,col3\n" + "-------------------------------\n" + "N,1,1,17.0\n" + "N,1,1,17.0\n" + "N,1,1,30.0\n" + "N,1,1,36.0\n" + "N,1,1,36.0\n"; assertEquals(expected, resultSetData); }