auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public OneReplicaPipelineSafeModeRule(String ruleName, EventQueue eventQueue, PipelineManager pipelineManager, SCMSafeModeManager safeModeManager, Configuration configuration) { super(safeModeManager, ruleName, eventQueue); double percent = configuration.getDouble( HddsConfigKeys.HDDS_SCM_SAFEMODE_ONE_NODE_REPORTED_PIPELINE_PCT, HddsConfigKeys. HDDS_SCM_SAFEMODE_ONE_NODE_REPORTED_PIPELINE_PCT_DEFAULT); Preconditions.checkArgument((percent >= 0.0 && percent <= 1.0), HddsConfigKeys. HDDS_SCM_SAFEMODE_ONE_NODE_REPORTED_PIPELINE_PCT + " value should be >= 0.0 and <= 1.0"); int totalPipelineCount = pipelineManager.getPipelines(HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.THREE, Pipeline.PipelineState.OPEN) .size() + pipelineManager.getPipelines(HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.THREE, <START> Pipeline.PipelineState.ALLOCATED).size(); <END> thresholdCount = (int) Math.ceil(percent * totalPipelineCount); LOG.info("Total pipeline count is {}, pipeline's with at least one " + "datanode reported threshold count is {}", totalPipelineCount, thresholdCount); getSafeModeMetrics().setNumPipelinesWithAtleastOneReplicaReportedThreshold( thresholdCount); }</code><technical_language>allocated pipeline guarantee usable DNs. exclude calculation here</technical_language>

Target:
public OneReplicaPipelineSafeModeRule(String ruleName, EventQueue eventQueue, PipelineManager pipelineManager, SCMSafeModeManager safeModeManager, Configuration configuration) { super(safeModeManager, ruleName, eventQueue); double percent = configuration.getDouble( HddsConfigKeys.HDDS_SCM_SAFEMODE_ONE_NODE_REPORTED_PIPELINE_PCT, HddsConfigKeys. HDDS_SCM_SAFEMODE_ONE_NODE_REPORTED_PIPELINE_PCT_DEFAULT); Preconditions.checkArgument((percent >= 0.0 && percent <= 1.0), HddsConfigKeys. HDDS_SCM_SAFEMODE_ONE_NODE_REPORTED_PIPELINE_PCT + " value should be >= 0.0 and <= 1.0"); oldPipelineIDSet = ((SCMPipelineManager)pipelineManager).getOldPipelineIdSet(); int totalPipelineCount = pipelineManager.getPipelines(HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.THREE).size(); Preconditions.checkState(totalPipelineCount >= oldPipelineIDSet.size()); oldPipelineThresholdCount = (int) Math.ceil(percent * oldPipelineIDSet.size()); newPipelineThresholdCount = (int) Math.ceil( percent * (totalPipelineCount - oldPipelineIDSet.size())); thresholdCount = oldPipelineThresholdCount + newPipelineThresholdCount; LOG.info("Total pipeline count is {}, pipeline's with at least one " + "datanode reported threshold count is {}", totalPipelineCount, thresholdCount); getSafeModeMetrics().setNumPipelinesWithAtleastOneReplicaReportedThreshold( thresholdCount); }
Source:
<code><START> public void close() throws IOException { <END> allBarriersReceivedFuture.cancel(false); }</code><technical_language>syncrhonized</technical_language>

Target:
public synchronized void close() throws IOException { allBarriersReceivedFuture.cancel(false); }
Source:
<code>private void createInterrupt(final ITmfStateSystem ssq, long startTime, long endTime, ResourcesEntryModel cpuEntry, List<Integer> irqQuarks, Type type, List<ResourcesEntryModel> builder) { for (Integer irqQuark : irqQuarks) { String resourceName = ssq.getAttributeName(irqQuark); int resourceId = Integer.parseInt(resourceName); long irqId = getId(irqQuark); builder.add(new ResourcesEntryModel(irqId, cpuEntry.getId(), computeEntryName(type, resourceId), startTime, endTime, resourceId, type)); fEntryModelTypes.put(irqQuark, type); String aggregateIrqtype = type == Type.IRQ ? Attributes.IRQS : Attributes.SOFT_IRQS; int aggregateQuark = <START> ssq.optQuarkAbsolute(aggregateIrqtype, <END> resourceName); long aggregateId = getId(aggregateQuark); if (!Iterables.any(builder, entry -> entry.getId() == aggregateId)) { builder.add(new ResourcesEntryModel(aggregateId, cpuEntry.getParentId(), computeEntryName(type, resourceId), startTime, endTime, resourceId, type)); } builder.add(new ResourcesEntryModel(irqId, aggregateId, computeEntryName(Type.CPU, cpuEntry.getResourceId()), startTime, endTime, cpuEntry.getResourceId(), type)); fEntryModelTypes.put(aggregateQuark, type); } }</code><technical_language>woops, need handle case aggregateQuark is ITmfStateSystem.INVALID.. I missed in prev patch</technical_language>

Target:
private void createInterrupt(final ITmfStateSystem ssq, long startTime, long endTime, ResourcesEntryModel cpuEntry, List<Integer> irqQuarks, Type type, List<ResourcesEntryModel> builder) { for (Integer irqQuark : irqQuarks) { String resourceName = ssq.getAttributeName(irqQuark); int resourceId = Integer.parseInt(resourceName); long irqId = getId(irqQuark); builder.add(new ResourcesEntryModel(irqId, cpuEntry.getId(), computeEntryName(type, resourceId), startTime, endTime, resourceId, type)); fEntryModelTypes.put(irqQuark, type); String aggregateIrqtype = type == Type.IRQ ? Attributes.IRQS : Attributes.SOFT_IRQS; int aggregateQuark = ssq.optQuarkAbsolute(aggregateIrqtype, resourceName); if (aggregateQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return; } long aggregateId = getId(aggregateQuark); if (!Iterables.any(builder, entry -> entry.getId() == aggregateId)) { builder.add(new ResourcesEntryModel(aggregateId, cpuEntry.getParentId(), computeEntryName(type, resourceId), startTime, endTime, resourceId, type)); } builder.add(new ResourcesEntryModel(irqId, aggregateId, computeEntryName(Type.CPU, cpuEntry.getResourceId()), startTime, endTime, cpuEntry.getResourceId(), type)); fEntryModelTypes.put(aggregateQuark, type); } }
Source:
<code>public boolean equals(final Object other) { if(this == other) return true; if(other == null || this.getClass() != other.getClass()) return false; Description that = (Description)other; <START> if(id != that.id || alias != that.alias) return false; <END> return true; }</code><technical_language>wrong, compare String == for Person</technical_language>

Target:
public boolean equals(final Object other) { if(this == other) return true; if(other == null || this.getClass() != other.getClass()) return false; Description that = (Description)other; if(id != that.id) return false; if ((alias == null) ? (alias != null) : !alias.equals(that.alias)) return false; return true; }
Source:
<code><START> public boolean removeNeededItem(Map<String, Integer> items, int slotNumber, EntityRef player) { <END> EntityRef inventorySlot = inventoryManager.getItemInSlot(player, slotNumber); BlockItemComponent blockItemComponent = inventorySlot.getComponent(BlockItemComponent.class); String blockFamilyName = blockItemComponent.blockFamily.toString(); logger.info("This Oreon has an item demand for spawning: " + blockFamilyName); logger.info("Found the item needed to spawn stuff! Decrementing by {}, then spawning", items.get(blockFamilyName)); EntityRef result = inventoryManager.removeItem(player, player, inventorySlot, false, items.get(blockFamilyName)); if(result == null) { logger.info("Could not decrement the required amount from inventory, not spawning"); return false; } return true; }</code><technical_language>this method private</technical_language>

Target:
private boolean removeNeededItem(Map<String, Integer> items, int slotNumber, EntityRef player) { EntityRef inventorySlot = inventoryManager.getItemInSlot(player, slotNumber); BlockItemComponent blockItemComponent = inventorySlot.getComponent(BlockItemComponent.class); String blockFamilyName = blockItemComponent.blockFamily.toString(); logger.info("This Oreon has an item demand for spawning: " + blockFamilyName); logger.info("Found the item needed to spawn stuff! Decrementing by {}, then spawning", items.get(blockFamilyName)); EntityRef result = inventoryManager.removeItem(player, player, inventorySlot, false, items.get(blockFamilyName)); if (result == null) { logger.info("Could not decrement the required amount from inventory, not spawning"); return false; } return true; }
Source:
<code>public static void refreshCache() { try { <START> ZK.createOnceExt(KRYO_REGISTERED_CLASS_PATH, <END> null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, true); } catch (KeeperException e) { throw new IllegalStateException( "Failed to refresh kryo cache " + KRYO_REGISTERED_CLASS_PATH, e); } catch (InterruptedException e) { throw new IllegalStateException( "Interrupted while refreshing kryo cache " + KRYO_REGISTERED_CLASS_PATH, e); } List<String> registeredList; try { registeredList = ZK.getChildrenExt(KRYO_REGISTERED_CLASS_PATH, false, true, false); } catch (KeeperException e) { throw new IllegalStateException( "Failed to retrieve child nodes for " + KRYO_REGISTERED_CLASS_PATH, e); } catch (InterruptedException e) { throw new IllegalStateException( "Interrupted while retrieving child nodes for " + KRYO_REGISTERED_CLASS_PATH, e); } for (String name : registeredList) { String className = name.substring(0, name.length() - ZooKeeperExt.SEQUENCE_NUMBER_LENGTH); int classId = Integer.parseInt( name.substring(name.length() - ZooKeeperExt.SEQUENCE_NUMBER_LENGTH)); if (MIN_CLASS_ID == -1) { MIN_CLASS_ID = classId; } int adjustedId = classId - MIN_CLASS_ID + BASE_CLASS_ID; if (CLASS_NAME_TO_ID.putIfAbsent(className, adjustedId) == null) { ID_TO_CLASS_NAME.put(adjustedId, className); } } }</code><technical_language>I avoid calling this time refresh cache and, instead, call initialization (e.g. in setZookeeperInfo</technical_language>

Target:
public static void refreshCache() { if (!IS_CLASS_PATH_CREATED) { try { ZK.createOnceExt(KRYO_REGISTERED_CLASS_PATH, null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, true); IS_CLASS_PATH_CREATED = true; } catch (KeeperException e) { throw new IllegalStateException( "Failed to refresh kryo cache " + KRYO_REGISTERED_CLASS_PATH, e); } catch (InterruptedException e) { throw new IllegalStateException( "Interrupted while refreshing kryo cache " + KRYO_REGISTERED_CLASS_PATH, e); } } List<String> registeredList; try { registeredList = ZK.getChildrenExt(KRYO_REGISTERED_CLASS_PATH, false, true, false); } catch (KeeperException e) { throw new IllegalStateException( "Failed to retrieve child nodes for " + KRYO_REGISTERED_CLASS_PATH, e); } catch (InterruptedException e) { throw new IllegalStateException( "Interrupted while retrieving child nodes for " + KRYO_REGISTERED_CLASS_PATH, e); } for (String name : registeredList) { if (LOG.isDebugEnabled()) { LOG.debug("Registered class: " + name); } String className = name.substring(0, name.length() - ZooKeeperExt.SEQUENCE_NUMBER_LENGTH); int classId = Integer.parseInt( name.substring(name.length() - ZooKeeperExt.SEQUENCE_NUMBER_LENGTH)); if (MIN_CLASS_ID == -1) { MIN_CLASS_ID = classId; } int adjustedId = classId - MIN_CLASS_ID + BASE_CLASS_ID; if (CLASS_NAME_TO_ID.putIfAbsent(className, adjustedId) == null) { ID_TO_CLASS_NAME.put(adjustedId, className); } } }
Source:
<code>public <T> Mono<CosmosAsyncItemResponse<T>> createItem(T item, CosmosItemRequestOptions options) { if (options == null) { options = new CosmosItemRequestOptions(); } final CosmosItemRequestOptions requestOptions = options; return withContext(context -> createItem(item, requestOptions, context)).subscriberContext(reactorContext -> { Optional<String> master = reactorContext.getOrEmpty(TracerProvider.MASTER_CALL); if (master.isPresent()) { reactorContext = reactorContext.put(TracerProvider.NESTED_CALL, true); } <START> return reactorContext.put(TracerProvider.MASTER_CALL, true); <END> }); }</code><technical_language>code, this factored out java return withContext(context -> replace(containerProperties, requestOptions, context)) .subscriberContext(reactorContext -> factoredOutFunc())</technical_language>

Target:
public <T> Mono<CosmosItemResponse<T>> createItem(T item, CosmosItemRequestOptions options) { if (options == null) { options = new CosmosItemRequestOptions(); } if (!database.getClient().getTracerProvider().isEnabled()) { return createItemInternal(item, options); } final CosmosItemRequestOptions requestOptions = options; return withContext(context -> createItemInternal(item, requestOptions, context)); }
Source:
<code>public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { try { <START> LOG.trace("message received called {}", msg); <END> try { LOG.debug("New message from {}", msg, ctx.channel()); NettyServerCnxn cnxn = ctx.channel().attr(CONNECTION_ATTRIBUTE).get(); if (cnxn == null) { LOG.error("channelRead() on a closed or closing NettyServerCnxn"); } else { cnxn.processMessage((ByteBuf) msg); } } catch (Exception ex) { LOG.error("Unexpected exception in receive", ex); throw ex; } } finally { ReferenceCountUtil.release(msg); } }</code><technical_language>isTraceEnabled</technical_language>

Target:
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { try { if (LOG.isTraceEnabled()) { LOG.trace("message received called {}", msg); } try { if (LOG.isDebugEnabled()) { LOG.debug("New message from {}", msg, ctx.channel()); } NettyServerCnxn cnxn = ctx.channel().attr(CONNECTION_ATTRIBUTE).get(); if (cnxn == null) { LOG.error("channelRead() on a closed or closing NettyServerCnxn"); } else { cnxn.processMessage((ByteBuf) msg); } } catch (Exception ex) { LOG.error("Unexpected exception in receive", ex); throw ex; } } finally { ReferenceCountUtil.release(msg); } }
Source:
<code>public Node call() throws Exception { Thread.sleep(time); System.out.println("launching slave"); DumbSlave slave = rule.createSlave(label); <START> slave.getNodeProperties().addAll(nodeProperties); <END> computer = slave.toComputer(); computer.connect(false).get(); synchronized (DummyCloudImpl.this) { System.out.println(computer.getName()+" launch"+(computer.isOnline()?"ed successfully":" failed")); System.out.println(computer.getLog()); } return slave; }</code><technical_language>A NodeProperty owning node (backreference) this is dangerous: if multiple nodes provisioned, clobber backreference earlier ones. switch this a Provider<NodeProperty>, throw assertion error if cloud provision multiple nodes some nodeProperties</technical_language>

Target:
public Node call() throws Exception { Thread.sleep(time); System.out.println("launching slave"); final DumbSlave slave = rule.createSlave(label); Provider<NodeProperty> nodePropertyProvider = new Provider<NodeProperty>() { @Override public NodeProperty invoke(NodeProperty request) { request.setNode(slave); return request; } }; for (NodeProperty nodeProperty : nodeProperties) { slave.getNodeProperties().add(nodePropertyProvider.invoke(nodeProperty)); } computer = slave.toComputer(); computer.connect(false).get(); synchronized (DummyCloudImpl.this) { System.out.println(computer.getName()+" launch"+(computer.isOnline()?"ed successfully":" failed")); System.out.println(computer.getLog()); } return slave; }
Source:
<code>public ContainerInfo getContainerInfo() { ContainerInfo ci = new ContainerInfo(); ci.id = container.getExternalId(); ci.host = container.host; ci.state = container.getState().name(); ci.jvmName = this.jvmName; ci.numOperators = container.getOperators().size(); <START> ci.operatorsIdandName = new HashMap<>(); <END> for (PTOperator ptOperator : container.getOperators()) { ci.operatorsIdandName.put(ptOperator.getId(), ptOperator.getName()); } ci.memoryMBAllocated = container.getAllocatedMemoryMB(); ci.lastHeartbeat = lastHeartbeatMillis; ci.memoryMBFree = this.memoryMBFree; ci.gcCollectionCount = this.gcCollectionCount; ci.gcCollectionTime = this.gcCollectionTime; ci.startedTime = container.getStartedTime(); ci.finishedTime = container.getFinishedTime(); if (this.container.nodeHttpAddress != null) { YarnConfiguration conf = new YarnConfiguration(); ci.containerLogsUrl = ConfigUtils .getSchemePrefix(conf) + this.container.nodeHttpAddress + "/node/containerlogs/" + ci.id + "/" + System .getenv(ApplicationConstants.Environment.USER.toString()); ci.rawContainerLogsUrl = ConfigUtils .getRawContainerLogsUrl(conf, container.nodeHttpAddress, container.getPlan().getLogicalPlan().getAttributes() .get(LogicalPlan.APPLICATION_ID), ci.id); } return ci; }</code><technical_language>this a TreeMap output of json sorted</technical_language>

Target:
public ContainerInfo getContainerInfo() { ContainerInfo ci = new ContainerInfo(); ci.id = container.getExternalId(); ci.host = container.host; ci.state = container.getState().name(); ci.jvmName = this.jvmName; ci.numOperators = container.getOperators().size(); ci.operators = new TreeMap<>(); for (PTOperator ptOperator : container.getOperators()) { ci.operators.put(ptOperator.getId(), ptOperator.getName()); } ci.memoryMBAllocated = container.getAllocatedMemoryMB(); ci.lastHeartbeat = lastHeartbeatMillis; ci.memoryMBFree = this.memoryMBFree; ci.gcCollectionCount = this.gcCollectionCount; ci.gcCollectionTime = this.gcCollectionTime; ci.startedTime = container.getStartedTime(); ci.finishedTime = container.getFinishedTime(); if (this.container.nodeHttpAddress != null) { YarnConfiguration conf = new YarnConfiguration(); ci.containerLogsUrl = ConfigUtils .getSchemePrefix(conf) + this.container.nodeHttpAddress + "/node/containerlogs/" + ci.id + "/" + System .getenv(ApplicationConstants.Environment.USER.toString()); ci.rawContainerLogsUrl = ConfigUtils .getRawContainerLogsUrl(conf, container.nodeHttpAddress, container.getPlan().getLogicalPlan().getAttributes() .get(LogicalPlan.APPLICATION_ID), ci.id); } return ci; }
Source:
<code>public VoltXMLElement voltAnnotateWindowedAggregateXML(VoltXMLElement exp, SimpleColumnContext context) throws HSQLParseException { VoltXMLElement winspec = new VoltXMLElement("winspec"); VoltXMLElement winargs = new VoltXMLElement("winargs"); exp.children.add(winspec); exp.children.add(winargs); if (m_partitionByList.size() > 0) { VoltXMLElement pxe = new VoltXMLElement("partitionbyList"); winspec.children.add(pxe); for (Expression e : m_partitionByList) { pxe.children.add(e.voltGetXML(context, null)); } } VoltXMLElement rxe = new VoltXMLElement("orderbyList"); winspec.children.add(rxe); if (m_sortAndSlice != null) { for (int i = 0; i < m_sortAndSlice.exprList.size(); i++) { Expression e = (Expression) m_sortAndSlice.exprList.get(i); assert(e instanceof ExpressionOrderBy); ExpressionOrderBy expr = (ExpressionOrderBy)e; VoltXMLElement orderby = expr.voltGetXML(context, null); boolean isDecending = expr.isDescending(); orderby.attributes.put("decending", isDecending ? "true": "false"); rxe.children.add(orderby); } } if (nodes.length > 0) { for (Expression expr : nodes) { winargs.children.add(expr.voltGetXML(context, null)); } <START> } <END> return exp; }</code><technical_language>this more consistent other methods processing nodes m_partitionByList</technical_language>

Target:
public VoltXMLElement voltAnnotateWindowedAggregateXML(VoltXMLElement exp, SimpleColumnContext context) throws HSQLParseException { VoltXMLElement winspec = new VoltXMLElement("winspec"); VoltXMLElement winargs = new VoltXMLElement("winargs"); exp.children.add(winspec); exp.children.add(winargs); if (nodes.length > 0) { for (Expression expr : nodes) { winargs.children.add(expr.voltGetXML(context, null)); } } if (m_partitionByList.size() > 0) { VoltXMLElement pxe = new VoltXMLElement("partitionbyList"); winspec.children.add(pxe); for (Expression e : m_partitionByList) { pxe.children.add(e.voltGetXML(context, null)); } } VoltXMLElement rxe = new VoltXMLElement("orderbyList"); winspec.children.add(rxe); if (m_sortAndSlice != null) { for (int i = 0; i < m_sortAndSlice.exprList.size(); i++) { Expression e = (Expression) m_sortAndSlice.exprList.get(i); assert(e instanceof ExpressionOrderBy); ExpressionOrderBy expr = (ExpressionOrderBy)e; VoltXMLElement orderby = expr.voltGetXML(context, null); boolean isDecending = expr.isDescending(); orderby.attributes.put("decending", isDecending ? "true": "false"); rxe.children.add(orderby); } } return exp; }
Source:
<code>public void onPartitionRemoved(PartitionId partitionId) { <START> <END> }</code><technical_language>extra newline</technical_language>

Target:
public void onPartitionRemoved(PartitionId partitionId) { partitionSet.remove(partitionId); latchForRemove.countDown(); }
Source:
<code>public static <M extends MessageEnvelope, K> Window<M, K, WindowKey<K>, Collection<M>, WindowOutput<WindowKey<K>, Collection<M>>> keyedSessionWindow(Function<M, K> keyFn, Duration sessionGap) { <START> <END> BiFunction<M, Collection<M>, Collection<M>> aggregator = (m, c) -> { c.add(m); return c; }; return keyedSessionWindow(keyFn, sessionGap, aggregator); }</code><technical_language>Remove newline</technical_language>

Target:
public static <M extends MessageEnvelope, K> Window<M, K, Collection<M>, WindowPane<K, Collection<M>>> keyedSessionWindow(Function<M, K> keyFn, Duration sessionGap) { BiFunction<M, Collection<M>, Collection<M>> aggregator = (m, c) -> { c.add(m); return c; }; return keyedSessionWindow(keyFn, sessionGap, aggregator); }
Source:
<code>public @Nullable VirtualTableLine getElement(long index) { if (fProvider == null) { return null; } if (fCache == null) { populateCache((int) index); } ITmfVirtualTableModel<VirtualTableLine> cache = fCache; if (cache != null) { long cacheStartingIndex = cache.getIndex(); int lineInCache = cache.getData().size(); long lastIndex = cacheStartingIndex + lineInCache; if (index >= cacheStartingIndex && index < lastIndex) { return cache.getData().get((int) (index - cacheStartingIndex)); } populateCache((int) (index)); return <START> getElement(index); <END> } return null; }</code><technical_language>this risk infinite loop if queried position is larger max size of segment store</technical_language>

Target:
public @Nullable SegmentStoreTableLine getElement(long index) { if(index > getTotalNbLine()) { return null; } if (fProvider == null) { return null; } if (fCache == null) { populateCache((int) index); } ITmfVirtualTableModel<SegmentStoreTableLine> cache = fCache; if (cache != null) { long cacheStartingIndex = cache.getIndex(); int lineInCache = cache.getData().size(); long lastIndex = cacheStartingIndex + lineInCache; if (index >= cacheStartingIndex && index < lastIndex) { return cache.getData().get((int) (index - cacheStartingIndex)); } populateCache((int) (index)); if (fTotalNbLine == -1) { return null; } return getElement(index); } return null; }
Source:
<code>public synchronized void removeRemoteSource(TaskId sourceTaskId) { requireNonNull(sourceTaskId, "sourceTaskId is null"); if (closed.get()) { return; } URI location = taskIdToURI.get(sourceTaskId); if (location == null) { return; } HttpPageBufferClient client = allClients.get(location); if (client == null) { return; } <START> client.close(); <END> cancelledClients.add(client); completedClients.add(client); }</code><technical_language>close throw here? If yes, a problem if add client collections in case</technical_language>

Target:
public synchronized void removeRemoteSource(TaskId sourceTaskId) { requireNonNull(sourceTaskId, "sourceTaskId is null"); if (closed.get()) { return; } removedRemoteSourceTaskIds.add(sourceTaskId); URI location = taskIdToLocationMap.get(sourceTaskId); if (location == null) { return; } HttpPageBufferClient client = allClients.get(location); if (client == null) { return; } closeQuietly(client); removedClients.add(client); completedClients.add(client); }
Source:
<code>private Map<String, Object> getAttributes() { Map<String, Object> attributeValues = new HashMap<String, Object>(); for (String attribute : attributes) { int equalsIndex = <START> attribute.indexOf(ATTRIBUTE_SEPARATOR); <END> if(equalsIndex > -1) { String attributeName = attribute.substring(0, equalsIndex); String attributeValue = attribute.substring(equalsIndex+1, attribute.length()); attributeValues.put(attributeName, attributeValue); } else { attributeValues.put(attribute, ""); } } return attributeValues; }</code><technical_language>inline '='. easier read</technical_language>

Target:
private Map<String, Object> getAttributes() { Map<String, Object> attributeValues = new HashMap<String, Object>(); for (String attribute : attributes) { int equalsIndex = attribute.indexOf('='); if(equalsIndex > -1) { String name = attribute.substring(0, equalsIndex); String value = attribute.substring(equalsIndex + 1, attribute.length()); attributeValues.put(name, value); } else { attributeValues.put(attribute, ""); } } return attributeValues; }
Source:
<code>private Jwt createJwt(String token, JWT parsedJwt) { Jwt jwt; try { JWTClaimsSet jwtClaimsSet = this.jwtProcessor.process(parsedJwt, null); Instant expiresAt = null; if (jwtClaimsSet.getExpirationTime() != null) { expiresAt = jwtClaimsSet.getExpirationTime().toInstant(); } Instant issuedAt = null; if (jwtClaimsSet.getIssueTime() != null) { issuedAt = jwtClaimsSet.getIssueTime().toInstant(); } else if (expiresAt != null) { issuedAt = Instant.from(expiresAt).minusSeconds(1); } Map<String, Object> headers = new LinkedHashMap<>(parsedJwt.getHeader().toJSONObject()); jwt = new Jwt(token, issuedAt, expiresAt, headers, jwtClaimsSet.getClaims()); } catch (RemoteKeySourceException ex) { if (ex.getCause() instanceof ParseException) { <START> throw new JwtException("An error occurred while attempting to decode the Jwt: Malformed Jwk set"); <END> } else { throw new JwtException("An error occurred while attempting to decode the Jwt: " + ex.getMessage(), ex); } } catch (Exception ex) { if (ex.getCause() instanceof ParseException) { throw new JwtException("An error occurred while attempting to decode the Jwt: Malformed payload"); } else { throw new JwtException("An error occurred while attempting to decode the Jwt: " + ex.getMessage(), ex); } } return jwt; }</code><technical_language>text error occurred while attempting decode Jwt: is duplicated 4 times, please reuse</technical_language>

Target:
private Jwt createJwt(String token, JWT parsedJwt) { Jwt jwt; try { JWTClaimsSet jwtClaimsSet = this.jwtProcessor.process(parsedJwt, null); Instant expiresAt = null; if (jwtClaimsSet.getExpirationTime() != null) { expiresAt = jwtClaimsSet.getExpirationTime().toInstant(); } Instant issuedAt = null; if (jwtClaimsSet.getIssueTime() != null) { issuedAt = jwtClaimsSet.getIssueTime().toInstant(); } else if (expiresAt != null) { issuedAt = Instant.from(expiresAt).minusSeconds(1); } Map<String, Object> headers = new LinkedHashMap<>(parsedJwt.getHeader().toJSONObject()); jwt = new Jwt(token, issuedAt, expiresAt, headers, jwtClaimsSet.getClaims()); } catch (RemoteKeySourceException ex) { if (ex.getCause() instanceof ParseException) { throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed Jwk set")); } else { throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, ex.getMessage()), ex); } } catch (Exception ex) { if (ex.getCause() instanceof ParseException) { throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, "Malformed payload")); } else { throw new JwtException(String.format(DECODING_ERROR_MESSAGE_TEMPLATE, ex.getMessage()), ex); } } return jwt; }
Source:
<code>private void checkSubtype(TypeMirror expected, Object givenValue) { if (expected.getKind().isPrimitive()) { expected = types.boxedClass((PrimitiveType) expected).asType(); } if (expected.getKind() == TypeKind.DECLARED && TypesUtils.isClass(expected) && givenValue instanceof TypeMirror) { return; } TypeMirror found; boolean isSubtype; if (expected.getKind() == TypeKind.DECLARED && ((DeclaredType) expected).asElement().getKind() == ElementKind.ANNOTATION_TYPE && givenValue instanceof AnnotationMirror) { found = ((AnnotationMirror) givenValue).getAnnotationType(); isSubtype = ((DeclaredType) expected) .asElement() .equals(((DeclaredType) found).asElement()); } else if (givenValue instanceof AnnotationMirror) { found = ((AnnotationMirror) givenValue).getAnnotationType(); isSubtype = false; } else if (givenValue instanceof VariableElement) { found = ((VariableElement) givenValue).asType(); if (expected.getKind() == TypeKind.DECLARED) { isSubtype = types.isSubtype(types.erasure(found), types.erasure(expected)); } else { isSubtype = false; } } else { found = elements.getTypeElement(givenValue.getClass().getCanonicalName()).asType(); isSubtype = types.isSubtype(types.erasure(found), types.erasure(expected)); } <START> if (!isSubtype) { <END> isSubtype = found.toString().equals(expected.toString()); } if (!isSubtype) { if (found.toString().equals(expected.toString())) { throw new BugInCF( "given value differs from expected, but same string representation; " + "this is likely a bootclasspath/classpath issue; " + "found: " + found); } else { throw new BugInCF( "given value differs from expected; " + "found: " + found + "; expected: " + expected); } } }</code><technical_language>Is this a left-over a change</technical_language>

Target:
private void checkSubtype(TypeMirror expected, Object givenValue) { if (expected.getKind().isPrimitive()) { expected = types.boxedClass((PrimitiveType) expected).asType(); } if (expected.getKind() == TypeKind.DECLARED && TypesUtils.isClass(expected) && givenValue instanceof TypeMirror) { return; } TypeMirror found; boolean isSubtype; if (expected.getKind() == TypeKind.DECLARED && ((DeclaredType) expected).asElement().getKind() == ElementKind.ANNOTATION_TYPE && givenValue instanceof AnnotationMirror) { found = ((AnnotationMirror) givenValue).getAnnotationType(); isSubtype = ((DeclaredType) expected) .asElement() .equals(((DeclaredType) found).asElement()); } else if (givenValue instanceof AnnotationMirror) { found = ((AnnotationMirror) givenValue).getAnnotationType(); isSubtype = false; } else if (givenValue instanceof VariableElement) { found = ((VariableElement) givenValue).asType(); if (expected.getKind() == TypeKind.DECLARED) { isSubtype = types.isSubtype(types.erasure(found), types.erasure(expected)); } else { isSubtype = false; } } else { found = elements.getTypeElement(givenValue.getClass().getCanonicalName()).asType(); isSubtype = types.isSubtype(types.erasure(found), types.erasure(expected)); } if (!isSubtype) { isSubtype = found.toString().equals(expected.toString()); } if (!isSubtype) { throw new BugInCF( "given value differs from expected; " + "found: " + found + "; expected: " + expected); } }
Source:
<code>private void updateNotPropagatedHeaders(String[] headers, boolean merge) { if (!ObjectUtils.isEmpty(headers)) { Assert.noNullElements(headers, "null elements are not allowed in 'headers'"); if (!merge) { this.notPropagatedHeaders.clear(); } this.notPropagatedHeaders.addAll(Arrays.asList(headers)); } this.selectiveHeaderPropagation = this.notPropagatedHeaders.size() > 0; <START> this.shouldCopyRequestHeaders = !this.notPropagatedHeaders.contains("*"); <END> }</code><technical_language>this ..equals("\*") instead of ..contains("\*")</technical_language>

Target:
private void updateNotPropagatedHeaders(String[] headers, boolean merge) { Set<String> headerPatterns = new HashSet<>(); if (merge) { headerPatterns.addAll(Arrays.asList(this.notPropagatedHeaders)); } if (!ObjectUtils.isEmpty(headers)) { Assert.noNullElements(headers, "null elements are not allowed in 'headers'"); headerPatterns.addAll(Arrays.asList(headers)); this.notPropagatedHeaders = headerPatterns.toArray(new String[headerPatterns.size()]); } boolean hasAsterisk = headerPatterns.contains("*"); if (hasAsterisk) { this.notPropagatedHeaders = new String[] { "*" }; this.noHeadersPropagation = true; } this.selectiveHeaderPropagation = this.notPropagatedHeaders.length > 0; }
Source:
<code>private CommTestRobot() { super(); try { <START> Thread.sleep(2000); <END> } catch (InterruptedException e) { e.printStackTrace(); } nodeList.add(new RBSMNode(NodeChannel.ENCODER, NodeChannel.STEERING, RobobuggyConfigFile.getComPortRBSM(), RobobuggyConfigFile.RBSM_COMMAND_PERIOD)); nodeList.add(new SweepNode(NodeChannel.DRIVE_CTRL)); RobobuggyJFrame mainWindow = new RobobuggyJFrame("MainWindow", 1.0, 1.0); Gui.getInstance().addWindow(mainWindow); RobobuggyGUITabs tabs = new RobobuggyGUITabs(); mainWindow.addComponent(tabs, 0.0, 0.0, 1.0, 1.0); tabs.addTab(new MainGuiWindow(), "Home"); tabs.add(new PathPanel(), "Path Visualizer"); tabs.addTab(new ConfigurationPanel(), "Configuration"); }</code><technical_language>Magic number; a variable</technical_language>

Target:
private CommTestRobot() { super(); try { Thread.sleep(ARDUINO_BOOTLOADER_TIMEOUT_MS); } catch (InterruptedException e) { e.printStackTrace(); } nodeList.add(new RBSMNode(NodeChannel.ENCODER, NodeChannel.STEERING, RobobuggyConfigFile.getComPortRBSM(), RobobuggyConfigFile.RBSM_COMMAND_PERIOD)); nodeList.add(new SweepNode(NodeChannel.DRIVE_CTRL)); RobobuggyJFrame mainWindow = new RobobuggyJFrame("MainWindow", 1.0, 1.0); Gui.getInstance().addWindow(mainWindow); RobobuggyGUITabs tabs = new RobobuggyGUITabs(); mainWindow.addComponent(tabs, 0.0, 0.0, 1.0, 1.0); tabs.addTab(new MainGuiWindow(), "Home"); }
Source:
<code>public void testQueryElementPrecedingOne() throws Exception { final String xpath = " <START> final RootNode rootNode = getRootNode("InputXpathMapperPreceding.java"); <END> final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); assertEquals("Invalid number of nodes", 17, actual.length); }</code><technical_language>please rename InputXpathMapperSingleTopClass name</technical_language>

Target:
public void testQueryElementPrecedingOne() throws Exception { final String xpath = " final RootNode rootNode = getRootNode("InputXpathMapperSingleTopClass.java"); final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); assertThat("Invalid number of nodes", actual.length, equalTo(17)); }
Source:
<code>public void getCandidateByApplicationIdShouldReturnNullWhenThereIsNoApplicationWithTheGivenId() { <START> given(applicationsRepository.findOne(APPLICATION_ID)) <END> .willReturn(dummyApplicationEntity); given(converterService.convert(dummyCandidateEntity, CandidateDTO.class)) .willReturn(dummyCandidateDto); CandidateDTO candidate = candidateService.getCandidateByApplicationID(NON_EXISTENT_APPLICATION_ID); assertThat(candidate, nullValue()); }</code><technical_language>situation in this line executed production code, findOne called NON_EXISTENT_APPLICATION_ID parameter. is output defined for existent application id, findOne return null default. Please clear findOne method called NON_EXISTENT_APPLICATION_ID explicitly show return null</technical_language>

Target:
public void getCandidateByApplicationIdShouldReturnNullWhenThereIsNoApplicationWithTheGivenId() { given(applicationsRepository.findOne(NON_EXISTENT_APPLICATION_ID)).willReturn(null); CandidateDTO candidate = candidateService.getCandidateByApplicationID(NON_EXISTENT_APPLICATION_ID); assertThat(candidate, nullValue()); }
Source:
<code>public static boolean validateStatementID(String statementID) { if(statementID.equals("")) return true; String separator = "\\$"; String statementFormat ="^\\{?[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}\\}?$"; String[] statementParts = statementID.split(separator); if(statementParts.length != 2) throw new IllegalArgumentException("Statement ID does not have the correct number of parts"); if(statementParts[0].charAt(0) != 'Q' && statementParts[0].charAt(0) != 'P' && statementParts[0].charAt(0) != 'L') throw new TypeNotPresentException("Query,Property or Lexeme", null); if(!statementParts[1].matches(statementFormat)) <START> throw new IllegalStateException("Statement part does not have a correct format"); <END> return true; }</code><technical_language>indentation of this line is inconsistent rest. Also, I do IllegalStateException is appropriate: this detect some data structure reached inconsistent state. validate arguments, IllegalArgumentException is use</technical_language>

Target:
public static boolean validateStatementID(String statementID) { if(statementID.equals("")) return true; String separator = "\\$"; String statementFormat ="^\\{?[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}\\}?$"; String[] statementParts = statementID.split(separator); if(statementParts.length != 2) throw new IllegalArgumentException("Statement ID does not have the correct number of parts"); if(statementParts[0].charAt(0) != 'Q' && statementParts[0].charAt(0) != 'P' && statementParts[0].charAt(0) != 'L' && statementParts[0].charAt(0) != 'M') throw new TypeNotPresentException("Query,Property or Lexeme", null); if(!statementParts[1].matches(statementFormat)) throw new IllegalStateException("Statement part does not have a correct format"); return true; }
Source:
<code>public SwrveConversationCampaign(ISwrveCampaignManager campaignManager, SwrveCampaignDisplayer campaignDisplayer, JSONObject campaignData, Set<SwrveAssetsQueueItem> assetImageQueue, Set<SwrveAssetsQueueItem> assetFontQueue) throws JSONException { super(campaignManager, campaignDisplayer, campaignData); if(campaignData.has("conversation")) { JSONObject conversationData = campaignData.getJSONObject("conversation"); this.conversation = createConversation(this, conversationData, campaignManager); for (ConversationPage conversationPage : conversation.getPages()) { for (ConversationAtom conversationAtom : conversationPage.getContent()) { switch (conversationAtom.getType()) { case CONTENT_IMAGE: addImageToQ(assetImageQueue, (Content) conversationAtom); break; case CONTENT_HTML: case INPUT_STARRATING: addFontToQ(assetFontQueue, conversationAtom.getStyle()); break; case INPUT_MULTIVALUE: MultiValueInput multiValueInput = (MultiValueInput) conversationAtom; addFontToQ(assetFontQueue, multiValueInput.getStyle()); for (ChoiceInputItem item : multiValueInput.getValues()) { addFontToQ(assetFontQueue, item.getStyle()); } break; } } for (ButtonControl buttonControl : conversationPage.getControls()) { <START> addFontToQ(assetFontQueue, buttonControl.getStyle()); <END> } } } }</code><technical_language>~~~ preferred name, change</technical_language>

Target:
public SwrveConversationCampaign(ISwrveCampaignManager campaignManager, SwrveCampaignDisplayer campaignDisplayer, JSONObject campaignData, Set<SwrveAssetsQueueItem> assetImageQueue, Set<SwrveAssetsQueueItem> assetFontQueue) throws JSONException { super(campaignManager, campaignDisplayer, campaignData); if(campaignData.has("conversation")) { JSONObject conversationData = campaignData.getJSONObject("conversation"); this.conversation = createConversation(this, conversationData, campaignManager); for (ConversationPage conversationPage : conversation.getPages()) { for (ConversationAtom conversationAtom : conversationPage.getContent()) { switch (conversationAtom.getType()) { case CONTENT_IMAGE: queueImageAsset(assetImageQueue, (Content) conversationAtom); break; case CONTENT_HTML: case INPUT_STARRATING: queueFontAsset(assetFontQueue, conversationAtom.getStyle()); break; case INPUT_MULTIVALUE: MultiValueInput multiValueInput = (MultiValueInput) conversationAtom; queueFontAsset(assetFontQueue, multiValueInput.getStyle()); for (ChoiceInputItem item : multiValueInput.getValues()) { queueFontAsset(assetFontQueue, item.getStyle()); } break; } } for (ButtonControl buttonControl : conversationPage.getControls()) { queueFontAsset(assetFontQueue, buttonControl.getStyle()); } } } }
Source:
<code>public Computation attach(String handle, String filters, Integer resolution) { <START> <END> Map<String, String> params = new HashMap<String, String>(); addParam(params, "filters", filters); addParam(params, "resolution", resolution); return new Computation(this.transport, handle, params, true); }</code><technical_language>rm</technical_language>

Target:
public Computation attach(String handle, String filters, Integer resolution) { return new Computation(this.transport, handle, buildParams("filters", filters, "resolution", resolution), true); }
Source:
<code>public void shouldSerializeAllBasicFieldsIndented() { <START> String expectedResult = "<order>\n <price>15.0</price>\n <comments>pack it nicely, please</comments>\n</order>"; <END> Order order = new Order(new Client("guilherme silveira"), 15.0, "pack it nicely, please"); serialization.indented().from(order).serialize(); assertThat(result(), is(equalTo(expectedResult))); }</code><technical_language>break lines \n easier read</technical_language>

Target:
public void shouldSerializeAllBasicFieldsIndented() { String expectedResult = "<order>\n" + " <price>15.0</price>\n" + " <comments>pack it nicely, please</comments>\n" + "</order>"; Order order = new Order(new Client("guilherme silveira"), 15.0, "pack it nicely, please"); serialization.indented().from(order).serialize(); assertThat(result(), is(equalTo(expectedResult))); }
Source:
<code>public static <T, E extends Throwable> T execute(final short databaseId, TransactionCallbackWithException<T, E> callback) throws E { String name = "tx-" + counter.incrementAndGet(); TransactionLegacy currentTxn = TransactionLegacy.currentTxn(false); short outer_txn_databaseId = (currentTxn != null ? currentTxn.getDatabaseId() : databaseId); TransactionLegacy txn = TransactionLegacy.open(name, databaseId, true); <START> try { <END> txn.start(); T result = callback.doInTransaction(STATUS); txn.commit(); return result; } finally { txn.close(); TransactionLegacy.open(outer_txn_databaseId).close(); } }</code><technical_language>Lines 67 68 combined a try resources follows: try (final TransactionLegacy txn = TransactionLegacy.open(name, databaseId, false)) { This construct removes need for txn.close() line 74</technical_language>

Target:
public static <T, E extends Throwable> T execute(final short databaseId, TransactionCallbackWithException<T, E> callback) throws E { String name = "tx-" + counter.incrementAndGet(); TransactionLegacy currentTxn = TransactionLegacy.currentTxn(false); short outer_txn_databaseId = (currentTxn != null ? currentTxn.getDatabaseId() : databaseId); try (final TransactionLegacy txn = TransactionLegacy.open(name, databaseId, true)) { txn.start(); T result = callback.doInTransaction(STATUS); txn.commit(); return result; } finally { TransactionLegacy.open(outer_txn_databaseId).close(); } }
Source:
<code>public void review(final PendingCertifiedProductDTO listing) { for (PendingCertificationResultDTO cert : listing.getCertificationCriterion()) { if (cert.getMeetsCriteria() != null && cert.getMeetsCriteria()) { <START> if (cert.getTestTools() != null && cert.getTestTools().size() > 0) { <END> Iterator<PendingCertificationResultTestToolDTO> testToolIter = cert.getTestTools().iterator(); while (testToolIter.hasNext()) { PendingCertificationResultTestToolDTO testTool = testToolIter.next(); if (!StringUtils.isEmpty(testTool.getName()) && StringUtils.isEmpty(testTool.getVersion())) { if (listing.getIcs() != null && listing.getIcs().booleanValue()) { listing.getWarningMessages() .add(msgUtil.getMessage("listing.criteria.missingTestToolVersion", testTool.getName(), cert.getNumber())); } else { listing.getErrorMessages() .add(msgUtil.getMessage("listing.criteria.missingTestToolVersion", testTool.getName(), cert.getNumber())); } } } } } } }</code><technical_language>Nesting question</technical_language>

Target:
public void review(final PendingCertifiedProductDTO listing) { for (PendingCertificationResultDTO cert : listing.getCertificationCriterion()) { if (cert.getMeetsCriteria() != null && cert.getMeetsCriteria() && cert.getTestTools() != null && cert.getTestTools().size() > 0) { for (PendingCertificationResultTestToolDTO testTool : cert.getTestTools()) { if (!StringUtils.isEmpty(testTool.getName()) && StringUtils.isEmpty(testTool.getVersion())) { if (listing.getIcs() != null && listing.getIcs().booleanValue()) { listing.getWarningMessages() .add(msgUtil.getMessage("listing.criteria.missingTestToolVersion", testTool.getName(), cert.getNumber())); } else { listing.getErrorMessages() .add(msgUtil.getMessage("listing.criteria.missingTestToolVersion", testTool.getName(), cert.getNumber())); } } } } } }
Source:
<code>protected Position handlePosition(Position position) { Collection<Attribute> attributes = Context.getAttributesManager().getItems( Context.getAttributesManager().getAllDeviceItems(position.getDeviceId())); for (Attribute attribute : attributes) { if (attribute.getAttribute() != null) { Object result = null; try { result = computeAttribute(attribute, position); } catch (JexlException error) { Log.warning(error); } if (result != null) { try { switch (attribute.getType()) { case "number": position.getAttributes().put(attribute.getAttribute(), (Number) result); break; case "boolean": position.getAttributes().put(attribute.getAttribute(), (Boolean) result); break; default: String attributeValue = null; String attributeName = attribute.getAttribute(); if (attributeName.equals("alarm") <START> || attributeName.equals("event")) { <END> Object temp = position.getAttributes(). get(attribute.getAttribute()); if (temp != null) { attributeValue = temp.toString(); } } if (attributeValue != null) { attributeValue += "," + result.toString(); } else { attributeValue = result.toString(); } position.getAttributes().put(attribute.getAttribute(), attributeValue); } } catch (ClassCastException error) { Log.warning(error); } } } } return position; }</code><technical_language>do need handle event here? Event special significance. Also, KEY_* position instead of hardcoded strings</technical_language>

Target:
protected Position handlePosition(Position position) { Collection<Attribute> attributes = Context.getAttributesManager().getItems( Context.getAttributesManager().getAllDeviceItems(position.getDeviceId())); for (Attribute attribute : attributes) { if (attribute.getAttribute() != null) { Object result = null; try { result = computeAttribute(attribute, position); } catch (JexlException error) { Log.warning(error); } if (result != null) { try { switch (attribute.getType()) { case "number": position.getAttributes().put(attribute.getAttribute(), (Number) result); break; case "boolean": position.getAttributes().put(attribute.getAttribute(), (Boolean) result); break; default: String attributeValue = null; String attributeName = attribute.getAttribute(); if (attributeName.equals(Position.KEY_ALARM)) { if (position.getAttributes(). get(attribute.getAttribute()) != null) { attributeValue = (String) position.getAttributes(). get(attribute.getAttribute()); } } if (attributeValue != null) { attributeValue += "," + result.toString(); } else { attributeValue = result.toString(); } position.getAttributes().put(attribute.getAttribute(), attributeValue); } } catch (ClassCastException error) { Log.warning(error); } } } } return position; }
Source:
<code>protected void addToStack(String value, String property, boolean addToMdc) { <START> if (!isNotBlank(property) || value == null) { <END> return; } Deque<String> deque = getDeque(property); String current = deque.peekFirst(); if (value.equals(current)) { return; } deque.addFirst(value); addToCurrentSection(property); if (addToMdc) { MDC.put(property, value); } }</code><technical_language>log null values</technical_language>

Target:
protected void addToStack(String value, String property, boolean addToMdc) { if (!isNotBlank(property)) { return; } Deque<String> deque = getDeque(property); String current = deque.peekFirst(); if (valuesEqual(current, value)) { return; } addToCurrentSection(property); if (value == null) { deque.addFirst(NULL_VALUE); if (addToMdc) { MDC.remove(property); } } else { deque.addFirst(value); if (addToMdc) { MDC.put(property, value); } } }