auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public DosingInstructions getDosingInstructions(DrugOrder order) { if (!order.getDosingType().equals(this.getClass())) { throw new APIException("DrugOrder.error.dosingTypeIsMismatched", new Object[] { this.getClass().getName(), order.getDosingType() }); } ChemoDosingInstructions chemoDosingInstructions = new ChemoDosingInstructions(); StringTokenizer tokenizeDosingInstructions = new StringTokenizer(order.getDosingInstructions(), "\n"); while (tokenizeDosingInstructions.hasMoreTokens()) { String instructionLine = tokenizeDosingInstructions.nextToken(); int indexOfColon = instructionLine.indexOf(':'); String instructionLineType = instructionLine.substring(0, indexOfColon - 1); String instructionLineValue = instructionLine.substring(indexOfColon + 2); <START> if (instructionLineType.equals("Dosage Adjustment Percentage")) { <END> chemoDosingInstructions.dosageAdjustmentPercentage = Double.parseDouble(instructionLineValue); } else if (instructionLineType.equals("Dosage Delivered Timing")) { chemoDosingInstructions.dosageDeliveredTiming = instructionLineValue; } else { chemoDosingInstructions.dosageDilutionInstructions = instructionLineValue; } } return chemoDosingInstructions; }</code><technical_language>Please create a constant for ""Dosage Adjustment Percentage""</technical_language>

Target:
public DosingInstructions getDosingInstructions(DrugOrder order) { if (!order.getDosingType().equals(this.getClass())) { throw new APIException("DrugOrder.error.dosingTypeIsMismatched", new Object[] { this.getClass().getName(), order.getDosingType() }); } ChemoDosingInstructions chemoDosingInstructions = new ChemoDosingInstructions(); StringTokenizer tokenizeDosingInstructions = new StringTokenizer(order.getDosingInstructions(), "\n"); while (tokenizeDosingInstructions.hasMoreTokens()) { String instructionLine = tokenizeDosingInstructions.nextToken(); int indexOfColon = instructionLine.indexOf(':'); String instructionLineType = instructionLine.substring(0, indexOfColon - 1); String instructionLineValue = instructionLine.substring(indexOfColon + 2); if (instructionLineType.equals(ADJUSTMENT_PERCENTAGE)) { chemoDosingInstructions.dosageAdjustmentPercentage = Double.parseDouble(instructionLineValue); } else if (instructionLineType.equals(DELIVERED_TIMING)) { chemoDosingInstructions.dosageDeliveredTiming = instructionLineValue; } else { chemoDosingInstructions.dosageDilutionInstructions = instructionLineValue; } } return chemoDosingInstructions; }
Source:
<code>public void fireDiscoveryComplete() { try { <START> inventoryListenerRWLock.readLock().lock(); <END> LOG.debugf("Firing inventory event for discovery complete"); DiscoveryEvent<L> event = new DiscoveryEvent<L>(EndpointService.this, getResourceManager(), getResourceTypeManager()); for (InventoryListener inventoryListener : inventoryListeners) { inventoryListener.discoveryCompleted(event); } } finally { inventoryListenerRWLock.readLock().unlock(); } }</code><technical_language>acquisition of locks (just before) entering try-catch. if wrong, finally block is try unlock a lock acquired. swap lines 118-119. Do for others</technical_language>

Target:
public void fireDiscoveryComplete() { inventoryListenerRWLock.readLock().lock(); try { LOG.debugf("Firing inventory event for discovery complete"); DiscoveryEvent<L> event = new DiscoveryEvent<L>(EndpointService.this, getResourceManager(), getResourceTypeManager()); for (InventoryListener inventoryListener : inventoryListeners) { inventoryListener.discoveryCompleted(event); } } finally { inventoryListenerRWLock.readLock().unlock(); } }
Source:
<code>public int hashCode() { return (mDestination.hashCode() * 41) + (mGateway == null ? 0 :mGateway.hashCode() * 47) + (mInterface == null ? 0 :mInterface.hashCode() * 67) + (mType * <START> 71); <END> }</code><technical_language>This MTU well</technical_language>

Target:
public int hashCode() { return (mDestination.hashCode() * 41) + (mGateway == null ? 0 :mGateway.hashCode() * 47) + (mInterface == null ? 0 :mInterface.hashCode() * 67) + (mType * 71) + (mMtu * 89); }
Source:
<code><START> public Object getItem(int position) { <END> return itemsList.get(position); }</code><technical_language>This return T</technical_language>

Target:
public T getItem(int position){ return itemsList.get(position); }
Source:
<code>public boolean matches(Object o) { <START> return (this.getClass().isInstance(o) && ((AbstractEventStreamEvent) o).getEvent().equals(this.event)); <END> }</code><technical_language>means create a listener actually, listener match: ((AbstractEventStreamEvent) o).getEvent().equals(this.event)) I mean</technical_language>

Target:
public boolean matches(Object o) { return (this.getClass().isInstance(o)); }
Source:
<code>public synchronized IPAddress getAllocatedTask(final String appId) { if (!appTaskListMap.containsKey(appId)) { appTaskListMap.putIfAbsent(appId, new ArrayList<>()); modifyTaskListLockMap.putIfAbsent(appId, new ReentrantLock()); } final List<IPAddress> taskList = appTaskListMap.get(appId); double minTaskLoad = Double.MAX_VALUE; IPAddress minLoadTask = null; <START> for (final IPAddress task: taskList) { <END> final double currentTaskLoad = taskInfoMap.get(task).getCpuLoad(); if (minTaskLoad > currentTaskLoad) { minLoadTask = task; minTaskLoad = currentTaskLoad; } } boolean isThereNotOverloadedTask = false; if (minTaskLoad > overloadedTaskThreshold) { for (final Map.Entry<IPAddress, TaskInfo> entry: taskInfoMap.entrySet()) { final IPAddress task = entry.getKey(); final double currentTaskLoad = entry.getValue().getCpuLoad(); if (!taskList.contains(task) && minTaskLoad > currentTaskLoad) { isThereNotOverloadedTask = true; minLoadTask = task; minTaskLoad = currentTaskLoad; } } if (isThereNotOverloadedTask) { taskList.add(minLoadTask); } else { } } return minLoadTask; }</code><technical_language>task :</technical_language>

Target:
public IPAddress getAllocatedTask(final String appId) { if (!appTaskListMap.containsKey(appId)) { appTaskListMap.putIfAbsent(appId, new ArrayList<>()); } final List<IPAddress> taskList = appTaskListMap.get(appId); double minTaskLoad = Double.MAX_VALUE; IPAddress minLoadTask = null; synchronized (taskList) { for (final IPAddress task : taskList) { final double currentTaskLoad = taskInfoMap.get(task).getCpuLoad(); if (minTaskLoad > currentTaskLoad) { minLoadTask = task; minTaskLoad = currentTaskLoad; } } boolean isThereNotOverloadedTask = false; if (minTaskLoad > overloadedTaskThreshold) { for (final Map.Entry<IPAddress, TaskInfo> entry : taskInfoMap.entrySet()) { final IPAddress task = entry.getKey(); final double currentTaskLoad = entry.getValue().getCpuLoad(); if (!taskList.contains(task) && minTaskLoad > currentTaskLoad) { isThereNotOverloadedTask = true; minLoadTask = task; minTaskLoad = currentTaskLoad; } } if (isThereNotOverloadedTask) { taskList.add(minLoadTask); } else { } } } return minLoadTask; }
Source:
<code>protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); detailRequired = getParameters().isDetailRequired(); <START> volumeId = getParameters().getVolumeId(); <END> if (volumeId != null) { brick = getBrick(getParameters().getBrickId()); getQueryReturnValue().setReturnValue(fetchAdvancedDetails(getGlusterVolumeDao().getById(volumeId).getName())); } else { getQueryReturnValue().setReturnValue(getServiceInfo()); } }</code><technical_language>i initialization code in constructor opinion, mandatory</technical_language>

Target:
protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); detailRequired = getParameters().isDetailRequired(); volumeId = getParameters().getVolumeId(); if (volumeId != null) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); if (volume == null) { throw new RuntimeException(String.format("Invalid volume id %s", volumeId)); } brick = getBrick(getParameters().getBrickId()); getQueryReturnValue().setReturnValue(fetchAdvancedDetails(volume.getName())); } else { getQueryReturnValue().setReturnValue(getServiceInfo()); } }
Source:
<code><START> public ATCommand(String command) { <END> this.command = command; this.parameter = null; }</code><technical_language>I guess null is invalid for command, if throw a NullPointerException</technical_language>

Target:
public ATCommand(String command) { if (command == null) throw new NullPointerException("Command cannot be null."); this.command = command; this.parameter = null; }
Source:
<code>public byte[] update(byte[] input, int offset, int len) { <START> if (inDirectBuffer == null) { <END> inDirectBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE); } if (outDirectBuffer == null) { outDirectBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE + transformation.getAlgorithmBlockSize()); } int estimatedOutputLen = estimateUpdateOutputSize(len); byte[] estimatedOutput = new byte[estimatedOutputLen]; int outputLen = 0; byte[] output = null; int cursor = 0; while (len > BUFFER_SIZE) { updateSlice(input, offset, BUFFER_SIZE); int outputSliceLength = outDirectBuffer.remaining(); outDirectBuffer.get(estimatedOutput, cursor, outputSliceLength); cursor += outputSliceLength; len -= BUFFER_SIZE; offset += BUFFER_SIZE; } updateSlice(input, offset, len); int outputSliceLength = outDirectBuffer.remaining(); outputLen = cursor + outputSliceLength; if (outputLen == estimatedOutputLen) { outDirectBuffer.get(estimatedOutput, cursor, outputSliceLength); output = estimatedOutput; } else { output = new byte[outputLen]; System.arraycopy(estimatedOutput, 0, output, 0, cursor); outDirectBuffer.get(output, cursor, outputSliceLength); } return output; }</code><technical_language>check allocation code put in a method doFinal share piece of code</technical_language>

Target:
public byte[] update(byte[] input, int offset, int len) { byte[] output = null; try { output = updateOrDoFinal(input, offset, len, false); } catch (IllegalBlockSizeException ibse) { } catch (BadPaddingException bpe) { } catch (ShortBufferException sbe) { } return output; }
Source:
<code>private InternalCDOObject createObject(CDOID id) { if (TRACER.isEnabled()) { TRACER.trace("Creating object for " + id); } InternalCDORevision revision = getRevision(id, true); if (revision == null) { throw new ObjectNotFoundException(id, this); } EClass eClass = revision.getEClass(); InternalCDOObject object; if (CDOModelUtil.isResource(eClass) && id != getSession().getRepositoryInfo().getRootResourceID()) { object = (InternalCDOObject)newResourceInstance(revision); } else { object = newInstance(eClass); } cleanObject(object, revision); CDOStateMachine.INSTANCE.dispatchLoadNotification(object); <START> if (!CDOModelUtil.isResourceNode(eClass)) <END> { getStore().getResource(object); } return object; }</code><technical_language>Why</technical_language>

Target:
private InternalCDOObject createObject(CDOID id) { if (TRACER.isEnabled()) { TRACER.trace("Creating object for " + id); } InternalCDORevision revision = getRevision(id, true); if (revision == null) { throw new ObjectNotFoundException(id, this); } EClass eClass = revision.getEClass(); InternalCDOObject object; if (CDOModelUtil.isResource(eClass) && id != getSession().getRepositoryInfo().getRootResourceID()) { object = (InternalCDOObject)newResourceInstance(revision); } else { object = newInstance(eClass); } cleanObject(object, revision); CDOStateMachine.INSTANCE.dispatchLoadNotification(object); if (!CDOModelUtil.isResource(eClass)) { getStore().getResource(object); } return object; }
Source:
<code>public String create(Request req, Response res) { PipelineConfig pipelineConfigFromRequest = buildEntityFromRequestBody(req); haltIfEntityBySameNameInRequestExists(pipelineConfigFromRequest); String group = getOrHaltForGroupName(req); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); Username userName = SessionUtils.currentUsername(); pipelineConfigService.createPipelineConfig(userName, pipelineConfigFromRequest, result, group); if(shouldPausePipelineOnCreate(req)){ <START> pipelinePauseService.pause(pipelineConfigFromRequest.name().toString(), null, userName); <END> } return handleCreateOrUpdateResponse(req, res, pipelineConfigFromRequest, result); }</code><technical_language>add a pause message for this</technical_language>

Target:
public String create(Request req, Response res) { PipelineConfig pipelineConfigFromRequest = buildEntityFromRequestBody(req); haltIfEntityBySameNameInRequestExists(pipelineConfigFromRequest); String group = getOrHaltForGroupName(req); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); Username userName = SessionUtils.currentUsername(); pipelineConfigService.createPipelineConfig(userName, pipelineConfigFromRequest, result, group); return handleCreateOrUpdateResponse(req, res, pipelineConfigFromRequest, result); }
Source:
<code>public void commitMigration(PartitionMigrationEvent event) { if (event.getMigrationEndpoint() == DESTINATION) { populateIndexes(event, TargetIndexes.GLOBAL); } else { depopulateIndexes(event); } if (SOURCE == event.getMigrationEndpoint()) { removeRecordStoresHavingLesserBackupCountThan(event.getPartitionId(), event.getNewReplicaIndex()); <START> mapServiceContext <END> .getWbqCapacityCounter() .release(event.getPartitionId()); } PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(event.getPartitionId()); for (RecordStore recordStore : partitionContainer.getAllRecordStores()) { recordStore.startLoading(); } mapServiceContext.reloadOwnedPartitions(); removeOrRegenerateNearCacheUuid(event); }</code><technical_language>Do need check if this member is a replica clearing counter (same check is done clearing record stores)</technical_language>

Target:
public void commitMigration(PartitionMigrationEvent event) { if (event.getMigrationEndpoint() == DESTINATION) { populateIndexes(event, TargetIndexes.GLOBAL); } else { depopulateIndexes(event); } if (SOURCE == event.getMigrationEndpoint()) { removeWbqCountersHavingLesserBackupCountThan(event.getPartitionId(), event.getNewReplicaIndex()); removeRecordStoresHavingLesserBackupCountThan(event.getPartitionId(), event.getNewReplicaIndex()); } PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(event.getPartitionId()); for (RecordStore recordStore : partitionContainer.getAllRecordStores()) { recordStore.startLoading(); } mapServiceContext.reloadOwnedPartitions(); removeOrRegenerateNearCacheUuid(event); }
Source:
<code>public static TopologyDef parseResource(String resource, boolean dumpYaml, boolean processIncludes, String propertiesFile, boolean envSub) throws IOException { InputStream in = FluxParser.class.getResourceAsStream(resource); InputStream propertiesIn = null; if (propertiesFile != null) { propertiesIn = FluxParser.class.getResourceAsStream(propertiesFile); } <START> TopologyDef topology = parseInputStream(in, dumpYaml, processIncludes, propertiesIn, propertiesFile, envSub); <END> in.close(); return topology; }</code><technical_language>a corner case here: 1. --resource option is provided this method called. 2. yaml file include statement sets resource false. 3. parseFile is called handle propertiesFile resource. needs more fine-grained approach dealing propertiesFile. If understanding is right, read modify properties file loading it, create Properties instance pass instead of passing properties file name. sense</technical_language>

Target:
public static TopologyDef parseResource(String resource, boolean dumpYaml, boolean processIncludes, String propertiesFile, boolean envSub) throws IOException { InputStream in = FluxParser.class.getResourceAsStream(resource); TopologyDef topology = parseInputStream(in, dumpYaml, processIncludes, propertiesFile, envSub); in.close(); return topology; }
Source:
<code>public static EnumSet<ElementKind> getElementKindsForElementType(ElementType elementType) { switch (elementType) { case TYPE: <START> EnumSet<ElementKind> typeKinds = EnumSet.noneOf(ElementKind.class); <END> for (ElementKind kind : ElementKind.values()) { if (kind.isClass() || kind.isInterface()) { typeKinds.add(kind); } } return typeKinds; case FIELD: return EnumSet.of(ElementKind.FIELD, ElementKind.ENUM_CONSTANT); case METHOD: return EnumSet.of(ElementKind.METHOD); case PARAMETER: return EnumSet.of(ElementKind.PARAMETER); case CONSTRUCTOR: return EnumSet.of(ElementKind.CONSTRUCTOR); case LOCAL_VARIABLE: return EnumSet.of( ElementKind.LOCAL_VARIABLE, ElementKind.RESOURCE_VARIABLE, ElementKind.EXCEPTION_PARAMETER); case ANNOTATION_TYPE: return EnumSet.of(ElementKind.ANNOTATION_TYPE); case PACKAGE: return EnumSet.of(ElementKind.PACKAGE); case TYPE_PARAMETER: return EnumSet.of(ElementKind.TYPE_PARAMETER); case TYPE_USE: return EnumSet.noneOf(ElementKind.class); default: if (elementType.name().contentEquals("MODULE")) { return EnumSet.noneOf(ElementKind.class); } if (elementType.name().equals("RECORD_COMPONENT")) { return EnumSet.of(ElementKind.valueOf("RECORD_COMPONENT")); } throw new BugInCF("Unrecognized ElementType: " + elementType); } }</code><technical_language>wondering worth extract this a field, is done for trees. This method a hot path I tell, symmetry separate code improve readability of code. do think</technical_language>

Target:
public static EnumSet<ElementKind> getElementKindsForElementType(ElementType elementType) { switch (elementType) { case TYPE: return EnumSet.copyOf(ElementUtils.classElementKinds()); case FIELD: return EnumSet.of(ElementKind.FIELD, ElementKind.ENUM_CONSTANT); case METHOD: return EnumSet.of(ElementKind.METHOD); case PARAMETER: return EnumSet.of(ElementKind.PARAMETER); case CONSTRUCTOR: return EnumSet.of(ElementKind.CONSTRUCTOR); case LOCAL_VARIABLE: return EnumSet.of( ElementKind.LOCAL_VARIABLE, ElementKind.RESOURCE_VARIABLE, ElementKind.EXCEPTION_PARAMETER); case ANNOTATION_TYPE: return EnumSet.of(ElementKind.ANNOTATION_TYPE); case PACKAGE: return EnumSet.of(ElementKind.PACKAGE); case TYPE_PARAMETER: return EnumSet.of(ElementKind.TYPE_PARAMETER); case TYPE_USE: return EnumSet.noneOf(ElementKind.class); default: if (elementType.name().contentEquals("MODULE")) { return EnumSet.noneOf(ElementKind.class); } if (elementType.name().equals("RECORD_COMPONENT")) { return EnumSet.of(ElementKind.valueOf("RECORD_COMPONENT")); } throw new BugInCF("Unrecognized ElementType: " + elementType); } }
Source:
<code>public AnnotationCommandTargetResolver build() { <START> try { <END> return resolver; } finally { resolver = null; } }</code><technical_language>I nicer call AnnotationCommandTargetResolver constructor here, with, suggested earlier, this sole parameter, AnnotationCommandTargetResolver constructor pull identifierAnnotation versionAnnotation it</technical_language>

Target:
public AnnotationCommandTargetResolver build() { return new AnnotationCommandTargetResolver(this); }
Source:
<code>static EncryptedDataPayload deserialize(ByteBuffer inputBuffer) throws GeneralSecurityException { int startOffset = inputBuffer.position(); Crc32 crc = new Crc32(); short version = inputBuffer.getShort(); if (version != 1) { throw new GeneralSecurityException("Unrecognized version: " + version); } int encryptedKeySize = inputBuffer.getInt(); int encryptedDataSize = (int) inputBuffer.getLong(); if (encryptedKeySize < 0) { throw new GeneralSecurityException("Encrypted key size is less than 0"); } if (encryptedDataSize < 0) { throw new GeneralSecurityException("Encrypted data size is less than 0"); } byte[] encryptedKey = new byte[encryptedKeySize]; byte[] encryptedData = new byte[encryptedDataSize]; try { inputBuffer.get(encryptedKey); } catch (Exception e) { throw new GeneralSecurityException("Reading encrypted key from buffer", e); } try { <START> inputBuffer.get(encryptedData); <END> } catch (Exception e) { throw new GeneralSecurityException("Reading encrypted data from buffer", e); } crc.update(inputBuffer.array(), startOffset, INITIAL_MESSAGE_LENGTH + encryptedKeySize + encryptedDataSize); long expectedCrc; try { expectedCrc = inputBuffer.getLong(); } catch (Exception e) { throw new GeneralSecurityException("Reading crc from buffer", e); } long actualCrc = crc.getValue(); if (actualCrc != expectedCrc) { throw new GeneralSecurityException( "Encrypted blob is corrupt. ExpectedCRC: " + expectedCrc + " ActualCRC: " + actualCrc); } return new EncryptedDataPayload(ByteBuffer.wrap(encryptedKey), ByteBuffer.wrap(encryptedData)); }</code><technical_language>put line 165 170 in try catch. Also, some deserialization issues throw runtime exceptions if fail while others throw GeneralSecurityException (e.g line 154 line 177). worth want wrap of in GeneralSecurityException, of them</technical_language>

Target:
static EncryptedDataPayload deserialize(ByteBuffer inputBuffer) throws GeneralSecurityException { int startOffset = inputBuffer.position(); Crc32 crc = new Crc32(); try { short version = inputBuffer.getShort(); if (version != 1) { throw new GeneralSecurityException("Unrecognized version: " + version); } int encryptedKeySize = inputBuffer.getInt(); int encryptedDataSize = (int) inputBuffer.getLong(); if (encryptedKeySize < 0) { throw new GeneralSecurityException("Encrypted key size is less than 0"); } if (encryptedDataSize < 0) { throw new GeneralSecurityException("Encrypted data size is less than 0"); } byte[] encryptedKey = new byte[encryptedKeySize]; byte[] encryptedData = new byte[encryptedDataSize]; inputBuffer.get(encryptedKey); inputBuffer.get(encryptedData); crc.update(inputBuffer.array(), startOffset, INITIAL_MESSAGE_LENGTH + encryptedKeySize + encryptedDataSize); long expectedCrc = inputBuffer.getLong(); long actualCrc = crc.getValue(); if (actualCrc != expectedCrc) { throw new GeneralSecurityException( "Encrypted blob is corrupt. ExpectedCRC: " + expectedCrc + " ActualCRC: " + actualCrc); } return new EncryptedDataPayload(ByteBuffer.wrap(encryptedKey), ByteBuffer.wrap(encryptedData)); } catch (RuntimeException rex) { throw new GeneralSecurityException("Reading payload from buffer", rex); } }
Source:
<code>private List<Interval> determineIntervals(List<Integer> intervalEndOffsets) { Interval.setNextBegin(LocalDate.now()); List<Interval> intervals = intervalEndOffsets.stream().map(ieo -> Interval.nextInstance(ieo)) .collect(Collectors.toList()); <START> intervals.add(Interval.nextInstance(LocalDate.of(2017, 1, 1))); <END> return intervals; }</code><technical_language>Consider name this a static firstReleaseDate</technical_language>

Target:
private List<HistoryInterval> determineIntervals(List<Integer> intervalEndOffsets) { HistoryInterval.setNextStart(LocalDate.now()); List<HistoryInterval> intervals = intervalEndOffsets.stream().map(ieo -> HistoryInterval.nextInstance(ieo)) .collect(Collectors.toList()); intervals.add(HistoryInterval.nextInstance(LONG_AGO)); return intervals; }
Source:
<code>public RatpackRetrofitCallException(Request request, Response<?> response) { super(request.url().toString() + ": " + Exceptions.uncheck(() -> { Charset charset = response.errorBody().contentType() == null ? null : response.errorBody().contentType().charset(); <START> if (charset == null) charset = Charset.forName("UTF-8"); <END> return response.errorBody().source().buffer().clone().readString(charset); })); this.response = response; }</code><technical_language>need wrap body of if statement in order comply style check in this project</technical_language>

Target:
public RatpackRetrofitCallException(Request request, Response<?> response) { super(request.url().toString() + ": " + Exceptions.uncheck(() -> { Charset charset = response.errorBody().contentType() == null ? null : response.errorBody().contentType().charset(); if (charset == null) { charset = Charset.forName("UTF-8"); } return response.errorBody().source().buffer().clone().readString(charset); })); this.response = response; }
Source:
<code>public boolean isSerializable(Object obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider, PropertyWriter writer) { DynamicFilterData filterData = ResteasyProviderFactory.getContextData(DynamicFilterData.class); if (filterData != null) { List<String> path = new ArrayList<String>(10); <START> path.clear(); <END> path.add(0, writer.getName()); JsonStreamContext context = jsonGenerator.getOutputContext(); while ((context = context.getParent()) != null) { String cname = context.getCurrentName(); if (cname != null) { path.add(0, cname); } } return !filterData.isAttributeExcluded(path); } return true; }</code><technical_language>clearing empty list is necessary</technical_language>

Target:
public boolean isSerializable(Object obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider, PropertyWriter writer) { DynamicFilterData filterData = ResteasyProviderFactory.getContextData(DynamicFilterData.class); if (filterData != null) { List<String> path = new ArrayList<String>(10); path.add(0, writer.getName()); JsonStreamContext context = jsonGenerator.getOutputContext(); while ((context = context.getParent()) != null) { String cname = context.getCurrentName(); if (cname != null) { path.add(0, cname); } } return !filterData.isAttributeExcluded(path); } return true; }
Source:
<code><START> protected void executeCommand() { <END> List<Disk> disks = getDiskDao().getAllForVm(getVmTemplateId()); for (Disk disk : disks) { StorageJobCommandParameters parameters = new StorageJobCommandParameters(((DiskImage) disk).getImageId()); parameters.setParentCommand(getParameters().getParentCommand()); parameters.setParentParameters(getParameters().getParentParameters()); CommandCoordinatorUtil.executeAsyncCommand( VdcActionType.SysprepImage, parameters, cloneContext().withoutCompensationContext().withoutExecutionContext()); } setSucceeded(true); }</code><technical_language>I it, I lock template in database indication in UI for ongoing operation. I prefer a mechanism for VMs expose in-memory exclusive locks for UI instead</technical_language>

Target:
protected void executeCommand() { if (getDiskImages().isEmpty()) { setSucceeded(true); return; } SysprepVDSCommandParameters parameters = new SysprepVDSCommandParameters(); getDiskImages().forEach(diskImage -> parameters.addVolume( diskImage.getStorageIds().get(0), diskImage.getId(), diskImage.getImageId())); lockTemplateInDb(); VDSReturnValue vdsReturnValue = VdsCommandsHelper.runVdsCommandWithFailover( VDSCommandType.Sysprep, parameters, getDiskImages().get(0).getStoragePoolId(), this); if (!vdsReturnValue.getSucceeded()) { setCommandStatus(CommandStatus.FAILED); unlockTemplateInDb(); } setSucceeded(vdsReturnValue.getSucceeded()); }
Source:
<code>private static IEditorInput getActiveEditorInput(ExecutionEvent event) { Object o = HandlerUtil.getVariable(event, ISources.ACTIVE_EDITOR_INPUT_NAME); <START> if (o instanceof IEditorInput) { <END> return (IEditorInput) o; } return null; }</code><technical_language>style nit: braces</technical_language>

Target:
private static IEditorInput getActiveEditorInput(ExecutionEvent event) { Object o = HandlerUtil.getVariable(event, ISources.ACTIVE_EDITOR_INPUT_NAME); if (o instanceof IEditorInput) return (IEditorInput) o; return null; }
Source:
<code>private TriggerPolicy<Tuple> getTriggerPolicy(Count slidingIntervalCount, Long slidingIntervalDurationMs, WindowManager<Tuple> manager, EvictionPolicy<Tuple> evictionPolicy, Map<String, Object> topoConf) { if (slidingIntervalCount != null) { if (isTupleTs()) { return new WatermarkCountTriggerPolicy<>(slidingIntervalCount.value, manager, evictionPolicy, manager); } else { return new CountTriggerPolicy<>(slidingIntervalCount.value, manager, evictionPolicy); } } else { if (isTupleTs()) { return new WatermarkTimeTriggerPolicy<>(slidingIntervalDurationMs, manager, evictionPolicy, manager); } else { <START> Config.setTickTupleFrequency(topoConf, slidingIntervalDurationMs); <END> return new TimeTriggerPolicy<>(slidingIntervalDurationMs, manager, evictionPolicy); } } }</code><technical_language>Instead of updating config a bolt, push this task topology creation time provide some default if user set it? In this way, need change BoltInstance code pass conf object</technical_language>

Target:
private TriggerPolicy<Tuple> getTriggerPolicy(Count slidingIntervalCount, Long slidingIntervalDurationMs, WindowManager<Tuple> manager, EvictionPolicy<Tuple> evictionPolicy, Map<String, Object> topoConf) { if (slidingIntervalCount != null) { if (isTupleTs()) { return new WatermarkCountTriggerPolicy<>(slidingIntervalCount.value, manager, evictionPolicy, manager); } else { return new CountTriggerPolicy<>(slidingIntervalCount.value, manager, evictionPolicy); } } else { if (isTupleTs()) { return new WatermarkTimeTriggerPolicy<>(slidingIntervalDurationMs, manager, evictionPolicy, manager); } else { Config.setTickTupleFrequencyMs(topoConf, slidingIntervalDurationMs); return new TimeTriggerPolicy<>(slidingIntervalDurationMs, manager, evictionPolicy); } } }
Source:
<code>public static void main(final String[] args) throws Exception { final int fragmentLimitCount = 10; final String channel = new String("udp://localhost:40123"); final int streamId = 10; System.out.println("Subscribing to " + channel + " on stream Id " + streamId); final AtomicBoolean running = new AtomicBoolean(true); final DataHandler dataHandler = new DataHandler() { public void onData(final DirectBuffer buffer, final int offset, final int length, final Header header) { final byte[] data = new byte[length]; buffer.getBytes(offset, data); System.out.println( String.format( "Received message (%s) to stream %d from session %x term id %x term offset %d (%d@%d)", new String(data), streamId, header.sessionId(), header.termId(), header.termOffset(), length, offset)); running.set(false); } }; SigInt.register(() -> running.set(false)); final Aeron.Context ctx = new Aeron.Context(); Subscription subscription = null; Aeron aeron = null; <START> try <END> { aeron = Aeron.connect(ctx); subscription = aeron.addSubscription(channel, streamId, dataHandler); final IdleStrategy idleStrategy = new BackoffIdleStrategy( 100, 10, TimeUnit.MICROSECONDS.toNanos(1), TimeUnit.MICROSECONDS.toNanos(100)); try { while (running.get()) { final int fragmentsRead = subscription.poll(fragmentLimitCount); idleStrategy.idle(fragmentsRead); } } catch (final Exception ex) { ex.printStackTrace(); } System.out.println("Shutting down..."); } finally { subscription.close(); aeron.close(); } }</code><technical_language>try resources</technical_language>

Target:
public static void main(final String[] args) throws Exception { final int fragmentLimitCount = 10; final String channel = "udp://localhost:40123"; final int streamId = 10; System.out.println("Subscribing to " + channel + " on stream Id " + streamId); final AtomicBoolean running = new AtomicBoolean(true); SigInt.register(() -> running.set(false)); final DataHandler dataHandler = new DataHandler() { public void onData(final DirectBuffer buffer, final int offset, final int length, final Header header) { final byte[] data = new byte[length]; buffer.getBytes(offset, data); System.out.println( String.format( "Received message (%s) to stream %d from session %x term id %x term offset %d (%d@%d)", new String(data), streamId, header.sessionId(), header.termId(), header.termOffset(), length, offset)); running.set(false); } }; final Aeron.Context ctx = new Aeron.Context(); try (final Aeron aeron = Aeron.connect(ctx); final Subscription subscription = aeron.addSubscription(channel, streamId, dataHandler);) { final IdleStrategy idleStrategy = new BackoffIdleStrategy( 100, 10, TimeUnit.MICROSECONDS.toNanos(1), TimeUnit.MICROSECONDS.toNanos(100)); try { while (running.get()) { final int fragmentsRead = subscription.poll(fragmentLimitCount); idleStrategy.idle(fragmentsRead); } } catch (final Exception ex) { ex.printStackTrace(); } System.out.println("Shutting down..."); } finally { ctx.close(); } }
Source:
<code>private ActionEventRequest buildCreateEncounterAction(String configName) { SortedSet<ActionParameterRequest> actionParameters = new TreeSet<>(); int order = 0; actionParameters.add(prepareParameter(Keys.CONFIG_NAME, DisplayNames.CONFIG_NAME, configName, true, true, order++)); actionParameters.add(prepareParameter(Keys.ENCOUNTER_DATE, DisplayNames.ENCOUNTER_DATE, DATE, true, order++)); actionParameters.add(prepareParameter(Keys.ENCOUNTER_TYPE, DisplayNames.ENCOUNTER_TYPE, true, order++)); actionParameters.add(prepareParameter(Keys.LOCATION_NAME, DisplayNames.LOCATION_NAME, false, order++)); actionParameters.add(prepareParameter(Keys.PATIENT_UUID, DisplayNames.PATIENT_UUID, true, order++)); actionParameters.add(prepareParameter(Keys.PROVIDER_UUID, DisplayNames.PROVIDER_UUID, true, order++)); actionParameters.add(prepareParameter(Keys.OBSERVATION, DisplayNames.OBSERVATION, MAP, false, order)); return new ActionEventRequestBuilder() <START> .setDisplayName(String.format("Create Encounter [%s]", configName)) <END> .setServiceInterface("org.motechproject.openmrs19.tasks.OpenMRSActionProxyService") .setServiceMethod("createEncounter") .setActionParameters(actionParameters) .createActionEventRequest(); }</code><technical_language>move formatting of display name a separate method</technical_language>

Target:
private ActionEventRequest buildCreateEncounterAction(String configName) { SortedSet<ActionParameterRequest> actionParameters = new TreeSet<>(); int order = 0; actionParameters.add(prepareParameter(Keys.CONFIG_NAME, DisplayNames.CONFIG_NAME, configName, true, true, order++)); actionParameters.add(prepareParameter(Keys.ENCOUNTER_DATE, DisplayNames.ENCOUNTER_DATE, DATE, true, order++)); actionParameters.add(prepareParameter(Keys.ENCOUNTER_TYPE, DisplayNames.ENCOUNTER_TYPE, true, order++)); actionParameters.add(prepareParameter(Keys.LOCATION_NAME, DisplayNames.LOCATION_NAME, false, order++)); actionParameters.add(prepareParameter(Keys.PATIENT_UUID, DisplayNames.PATIENT_UUID, true, order++)); actionParameters.add(prepareParameter(Keys.PROVIDER_UUID, DisplayNames.PROVIDER_UUID, true, order++)); actionParameters.add(prepareParameter(Keys.OBSERVATION, DisplayNames.OBSERVATION, MAP, false, order)); return new ActionEventRequestBuilder() .setDisplayName(getDisplayName(CREATE_ENCOUNTER, configName)) .setServiceInterface("org.motechproject.openmrs19.tasks.OpenMRSActionProxyService") .setServiceMethod("createEncounter") .setActionParameters(actionParameters) .createActionEventRequest(); }
Source:
<code>public void testBuilderSetsPskCipherSuitesWhenPskStoreIsSet() { DtlsConnectorConfig config = builder.setPskStore(new StaticPskStore("ID", "KEY".getBytes())).build(); assertTrue(config.getSupportedCipherSuites().length > 0); for (CipherSuite suite : config.getSupportedCipherSuites()) { <START> assertThat(suite.getKeyExchange(), Matchers.either(Matchers.is(KeyExchangeAlgorithm.PSK)).or(Matchers.is(KeyExchangeAlgorithm.ECDHE_PSK))); <END> } }</code><technical_language>import Matchers statically ..</technical_language>

Target:
public void testBuilderSetsPskCipherSuitesWhenPskStoreIsSet() { DtlsConnectorConfig config = builder.setPskStore(new StaticPskStore("ID", "KEY".getBytes())).build(); assertTrue(config.getSupportedCipherSuites().length > 0); for (CipherSuite suite : config.getSupportedCipherSuites()) { assertThat(suite.getKeyExchange(), either(is(KeyExchangeAlgorithm.PSK)).or(is(KeyExchangeAlgorithm.ECDHE_PSK))); } }
Source:
<code>private CharSequence getLabelText(@NonNull String lang) { if (invokeSource == SUGGESTED_EDITS_TRANSLATE_DESC || invokeSource == FEED_CARD_SUGGESTED_EDITS_TRANSLATE_DESC) { return String.format(getContext().getString(R.string.description_edit_text_hint_per_language), <START> WikipediaApp.getInstance().language().getAppLanguageCanonicalName(lang)); <END> } else if (invokeSource == SUGGESTED_EDITS_TRANSLATE_CAPTION) { return String.format(getContext().getString(R.string.description_edit_caption_hint_per_language), WikipediaApp.getInstance().language().getAppLanguageCanonicalName(lang)); } else { return getContext().getString(R.string.description_edit_article); } }</code><technical_language>getString() function lets add parameters it. need String.format()</technical_language>

Target:
private CharSequence getLabelText(@NonNull String lang) { if (invokeSource == SUGGESTED_EDITS_TRANSLATE_DESC || invokeSource == FEED_CARD_SUGGESTED_EDITS_TRANSLATE_DESC) { return getContext().getString(R.string.description_edit_text_hint_per_language, WikipediaApp.getInstance().language().getAppLanguageCanonicalName(lang)); } else if (invokeSource == SUGGESTED_EDITS_TRANSLATE_CAPTION) { return getContext().getString(R.string.description_edit_caption_hint_per_language, WikipediaApp.getInstance().language().getAppLanguageCanonicalName(lang)); } else { return getContext().getString(R.string.description_edit_article); } }
Source:
<code>public ValidationResult isVmPluggedDiskUsingScsiReservation() { StringBuilder vmUsingScsiReservation = new StringBuilder(); for (VM vm : vms) { List<VmDevice> devices = getDbFacade().getVmDeviceDao().getVmDeviceByVmIdAndType(vm.getId(), VmDeviceGeneralType.DISK); for (VmDevice device : devices) { if (device.getIsPlugged() && device.isUsingScsiReservation()) { <START> vmUsingScsiReservation.append(vm.getName()).append(" "); <END> } } } if (vmUsingScsiReservation.length() == 0) { return ValidationResult.VALID; } return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION, String.format("$VmName %s", vmUsingScsiReservation.toString().substring(0, vmUsingScsiReservation.toString().length()-1))); }</code><technical_language>done bit differently a list store names join() in end a comma a separator - please do this way. other methods return message for violating vm I mind if version change in a patch</technical_language>

Target:
public ValidationResult isVmPluggedDiskUsingScsiReservation() { for (VM vm : vms) { List<VmDevice> devices = getDbFacade().getVmDeviceDao().getVmDeviceByVmIdAndType(vm.getId(), VmDeviceGeneralType.DISK); for (VmDevice device : devices) { if (device.getIsPlugged() && device.isUsingScsiReservation()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION, String.format("$VmName %s", vm.getName())); } } } return ValidationResult.VALID; }
Source:
<code>protected void addToEntryList(ITmfTrace trace, ITmfStateSystem ss, List<TimeGraphEntry> list) { addToEntryList(trace, list); synchronized (fSSEntryListMap) { List<TimeGraphEntry> entryList = fSSEntryListMap.get(ss); if (entryList == null) { fSSEntryListMap.put(ss, new CopyOnWriteArrayList<>(list)); } else { entryList.addAll(list); } <START> fTraceSSMap.put(trace, ss); <END> } }</code><technical_language>For experiment, parameter trace is experiment. However, handling traceClosed signal traces of experiment remove fTraceSSMap</technical_language>

Target:
protected void addToEntryList(ITmfTrace trace, ITmfStateSystem ss, List<TimeGraphEntry> list) { super.addToEntryList(trace, list); synchronized (fSSEntryListMap) { List<TimeGraphEntry> entryList = fSSEntryListMap.get(ss); if (entryList == null) { fSSEntryListMap.put(ss, new CopyOnWriteArrayList<>(list)); } else { entryList.addAll(list); } fTraceSSMap.put(trace, ss); } }
Source:
<code>public static byte[] ipV6XOR(String ip, byte[] transactionId) { InetAddress address; try { address = InetAddress.getByName(ip); } catch (UnknownHostException e) { <START> e.printStackTrace(); END> return null; } if (!(address instanceof Inet6Address)) { System.out.println("Address must be IPv6."); return null; } byte[] ipAddr = address.getAddress(); byte[] x = new byte[16]; x[0] = (byte) ((byte)0x21 ^ ipAddr[0]); x[1] = (byte) ((byte)0x12 ^ ipAddr[1]); x[2] = (byte) ((byte)0xA4 ^ ipAddr[2]); x[3] = (byte) ((byte)0x42 ^ ipAddr[3]); for (int i = 4; i < 16; i++) { x[i] = (byte) (transactionId[i-4] ^ ipAddr[i]); } return x; }</code><technical_language>If throw exception (maybe Runtime), k3po runtime throw exception print stack trace... thoughts</technical_language>

Target:
public static byte[] ipV6XOR(String ip, byte[] transactionId) { InetAddress address; try { address = InetAddress.getByName(ip); } catch (UnknownHostException e) { throw new RuntimeException("Unable to parse IPv6 address", e); } if (!(address instanceof Inet6Address)) { throw new RuntimeException("Address must be IPv6."); } byte[] ipAddr = address.getAddress(); byte[] x = new byte[16]; x[0] = (byte) ((byte)0x21 ^ ipAddr[0]); x[1] = (byte) ((byte)0x12 ^ ipAddr[1]); x[2] = (byte) ((byte)0xA4 ^ ipAddr[2]); x[3] = (byte) ((byte)0x42 ^ ipAddr[3]); for (int i = 4; i < 16; i++) { x[i] = (byte) (transactionId[i-4] ^ ipAddr[i]); } return x; }
Source:
<code>public EEFButtonLifecycleManager(EEFButtonDescription description, IVariableManager variableManager, IInterpreter interpreter, TransactionalEditingDomain editingDomain) { <START> super(description, variableManager, <END> interpreter, editingDomain); this.description = description; }</code><technical_language>done</technical_language>

Target:
public EEFButtonLifecycleManager(EEFButtonDescription description, IVariableManager variableManager, IInterpreter interpreter, TransactionalEditingDomain editingDomain) { super(variableManager, interpreter, editingDomain); this.description = description; }
Source:
<code>public static String normalizeLineEndings(String s) { <START> return s.replaceAll(CRLF, LF).replace(CR_CHAR, LF_CHAR); <END> }</code><technical_language>I agree Robin's proposal</technical_language>

Target:
public static String normalizeLineEndings(String s) { if (s == null) return null; if (s.length() == 0) return EMPTY_STRING; StringBuilder result = new StringBuilder(); int length = s.length(); int i = 0; while (i < length) { if (s.charAt(i) == CR_CHAR) { if (i + 1 < length) { if (s.charAt(i + 1) == LF_CHAR) { result.append(LF_CHAR); i += 1; } else { result.append(LF_CHAR); } } else { result.append(LF_CHAR); } } else result.append(s.charAt(i)); i++; } return result.toString(); }
Source:
<code>public Observable<PutResults<T>> createObservable() { <START> try { <END> throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return Observable .create(OnSubscribeExecuteAsBlocking.newInstance(this)) .subscribeOn(Schedulers.io()); } catch (Throwable throwable) { throw new StorIOException(throwable); } }</code><technical_language>need in try/catch here</technical_language>

Target:
public Observable<PutResults<T>> createObservable() { throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return Observable .create(OnSubscribeExecuteAsBlocking.newInstance(this)) .subscribeOn(Schedulers.io()); }
Source:
<code>public boolean isSelectable(Run<?, ?> run, EnvVars env) { <START> return run.getArtifacts().isEmpty() ? false : true; <END> }</code><technical_language>getHasArtifacts better. <LINK_0></technical_language>

Target:
public boolean isSelectable(Run<?, ?> run, EnvVars env) { return run.getHasArtifacts(); }
Source:
<code>public String getIoThreadsAndEmulatorPinningCpus(VM vm, MemoizingSupplier<List<VdsNumaNode>> hostNumaNodesSupplier, int vdsCpuThreads) { if (vm.getVmType() != VmType.HighPerformance) { return null; } final String cpuPinning = vm.getCpuPinning(); List<VmNumaNode> vmNumaNodes = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()); Optional<VmNumaNode> pinnedVmNumaNode = vmNumaNodes.stream().filter(d -> !d.getVdsNumaNodeList().isEmpty()).findAny(); if (StringUtils.isEmpty(cpuPinning) || !pinnedVmNumaNode.isPresent() || vm.getNumOfIoThreads() == 0) { String msgReason1 = StringUtils.isEmpty(cpuPinning) ? "CPU Pinning topology is not set": ""; String msgReason2 = vm.getNumOfIoThreads() == 0 ? "IO Threads is not enabled": ""; String msgReason3 = !pinnedVmNumaNode.isPresent() ? "vm's virtual NUMA nodes are not pinned to host's NUMA nodes": ""; <START> String finalMsgReason = msgReason1 + (!msgReason1.isEmpty() && !msgReason2.isEmpty() ? ", " : "") + msgReason2 + <END> ((!msgReason1.isEmpty() || !msgReason2.isEmpty()) && !msgReason3.isEmpty() ? ", " : "") + msgReason3 + "."; log.warn("No IO thread(s) pinning and Emulator thread(s) pinning for High Performance VM due to wrong configuration: {}", vm.getName(), vm.getId(), finalMsgReason); return null; } return findCpusToPinIoAndEmulator(vm, hostNumaNodesSupplier, vdsCpuThreads); }</code><technical_language>interesting code.. if msgReason1 is empty, "... due wrong configuration: :". A more elegant add errors a list, filter empty strings 'join' list's elements ',' a separator</technical_language>

Target:
public String getIoThreadsAndEmulatorPinningCpus(VM vm, MemoizingSupplier<List<VdsNumaNode>> hostNumaNodesSupplier, int vdsCpuThreads) { if (vm.getVmType() != VmType.HighPerformance) { return null; } final String cpuPinning = vm.getCpuPinning(); List<VmNumaNode> vmNumaNodes = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()); Optional<VmNumaNode> pinnedVmNumaNode = vmNumaNodes.stream().filter(d -> !d.getVdsNumaNodeList().isEmpty()).findAny(); if (StringUtils.isEmpty(cpuPinning) || !pinnedVmNumaNode.isPresent() || vm.getNumOfIoThreads() == 0) { String msgReason1 = StringUtils.isEmpty(cpuPinning) ? "CPU Pinning topology is not set": ""; String msgReason2 = vm.getNumOfIoThreads() == 0 ? "IO Threads is not enabled": ""; String msgReason3 = !pinnedVmNumaNode.isPresent() ? "vm's virtual NUMA nodes are not pinned to host's NUMA nodes": ""; String finalMsgReason = Arrays.asList(msgReason1, msgReason2, msgReason3).stream().filter(r -> !r.isEmpty()).collect(Collectors.joining(", ")) + "."; log.warn("No IO thread(s) pinning and Emulator thread(s) pinning for High Performance VM due to wrong configuration: {}", vm.getName(), vm.getId(), finalMsgReason); return null; } return findCpusToPinIoAndEmulator(vm, hostNumaNodesSupplier, vdsCpuThreads); }
Source:
<code>protected void put(Data dataKey, Data dataValue) { <START> MultiMapContainer container = getOrCreateContainer(); <END> Collection c = (Collection) toObject(dataValue); Collection<MultiMapRecord> coll = container.getOrCreateMultiMapValue(dataKey).getCollection(false); Iterator it = c.iterator(); while (it.hasNext()) { Object o = it.next(); MultiMapRecord record = new MultiMapRecord(container.nextId(), isBinary() ? toData(o) : o); if (coll.add(record)) { response = true; } } }</code><technical_language>this method needs updated similarly PutAllOperation account serialization handle properly binary data</technical_language>

Target:
protected void put(Data dataKey, Data dataValue) { MultiMapContainer container = getOrCreateContainer(); Collection<Data> c = ((DataCollection) toObject(dataValue)).getCollection(); Collection<MultiMapRecord> coll = container.getOrCreateMultiMapValue(dataKey).getCollection(false); Iterator<Data> it = c.iterator(); while (it.hasNext()) { Data o = it.next(); MultiMapRecord record = new MultiMapRecord(container.nextId(), isBinary() ? o : toObject(o)); if (coll.add(record)) { response = true; } } }