auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Content updateEventPublisher(Content content) { <START> for(EventRef eventRef: content.events()) { <END> Event event = eventResolver.fetch(eventRef.id()).orNull(); if(event != null && event.publisher() != null) { eventRef.setPublisher(event.publisher()); } } return content; }</code><technical_language>modifying EventRefs in place model allows for it. want models immutable change content.events() return a copy of internal collection. Instead get events collection, modify set in Content</technical_language>

Target:
private Content updateEventPublisher(Content content) { List<EventRef> eventRefs = content.events(); for(EventRef eventRef: eventRefs) { Event event = eventResolver.fetch(eventRef.id()).orNull(); checkNotNull(event); checkNotNull(event.publisher()); eventRef.setPublisher(event.publisher()); } content.setEventRefs(ImmutableList.copyOf(eventRefs)); return content; }
Source:
<code><START> public boolean isEmptyOrNullAllowed() { <END> return emptyOrNullAllowed; }</code><technical_language>If need this method for unit tests only, default (package) visibility instead of public: boolean isEmptyOrNullAllowed() { ... }</technical_language>

Target:
boolean isEmptyOrNullAllowed() { return emptyOrNullAllowed; }
Source:
<code>private void listen(int port) { try { socket = new ServerSocket(port); logger.info("Started Language Server Protocol (LSP) service on port {}", port); while (!socket.isClosed()) { <START> logger.debug("Going to wait for a client to connect"); <END> try { Socket client = socket.accept(); new Thread(() -> { handleConnection(client); }, "Client " + client.getRemoteSocketAddress()).start(); } catch (SocketException e) { logger.trace("Error accepting the client connection", e); } catch (IOException e) { logger.debug("Error accepting the client connection", e); } } } catch (IOException e) { logger.error("Error starting the Language Server", e); } }</code><technical_language>WRT changed logging, this method return a success indication (boolean), caller log error message server is running / listen</technical_language>

Target:
private void listen(int port) { try { socket = new ServerSocket(port); logger.info("Started Language Server Protocol (LSP) service on port {}", port); while (!socket.isClosed()) { logger.debug("Going to wait for a client to connect"); try { Socket client = socket.accept(); new Thread(() -> { handleConnection(client); }, "Client " + client.getRemoteSocketAddress()).start(); } catch (IOException e) { if (!socket.isClosed()) { logger.error("Error accepting client connection: {}", e.getMessage()); } } } } catch (IOException e) { logger.error("Error starting the Language Server", e); } }
Source:
<code>public void revertSamRecord(final SAMRecord rec) { if (RESTORE_ORIGINAL_QUALITIES) { final byte[] oq = rec.getOriginalBaseQualities(); if (oq != null) { rec.setBaseQualities(oq); rec.setOriginalBaseQualities(null); } } if (REMOVE_DUPLICATE_INFORMATION) { rec.setDuplicateReadFlag(false); } if (REMOVE_ALIGNMENT_INFORMATION) { if (rec.getReadNegativeStrandFlag()) { SAMRecordUtil.reverseComplement(rec); rec.setReadNegativeStrandFlag(false); } rec.setReferenceIndex(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); rec.setAlignmentStart(SAMRecord.NO_ALIGNMENT_START); rec.setCigarString(SAMRecord.NO_ALIGNMENT_CIGAR); rec.setMappingQuality(SAMRecord.NO_MAPPING_QUALITY); <START> rec.setAttribute(SAMTag.AS.name(), null); <END> if (!rec.getReadUnmappedFlag()) { rec.setInferredInsertSize(0); rec.setNotPrimaryAlignmentFlag(false); rec.setProperPairFlag(false); rec.setReadUnmappedFlag(true); } if (rec.getReadPairedFlag()) { rec.setMateAlignmentStart(SAMRecord.NO_ALIGNMENT_START); rec.setMateNegativeStrandFlag(false); rec.setMateReferenceIndex(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); rec.setMateUnmappedFlag(true); } for (final String tag : ATTRIBUTE_TO_CLEAR) { rec.setAttribute(tag, null); } } }</code><technical_language>other alignment based tags, MD, MC, NM? add ATTRIBUTE_TO_CLEAR</technical_language>

Target:
public void revertSamRecord(final SAMRecord rec) { if (RESTORE_ORIGINAL_QUALITIES) { final byte[] oq = rec.getOriginalBaseQualities(); if (oq != null) { rec.setBaseQualities(oq); rec.setOriginalBaseQualities(null); } } if (REMOVE_DUPLICATE_INFORMATION) { rec.setDuplicateReadFlag(false); } if (REMOVE_ALIGNMENT_INFORMATION) { if (rec.getReadNegativeStrandFlag()) { SAMRecordUtil.reverseComplement(rec); rec.setReadNegativeStrandFlag(false); } rec.setReferenceIndex(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); rec.setAlignmentStart(SAMRecord.NO_ALIGNMENT_START); rec.setCigarString(SAMRecord.NO_ALIGNMENT_CIGAR); rec.setMappingQuality(SAMRecord.NO_MAPPING_QUALITY); if (!rec.getReadUnmappedFlag()) { rec.setInferredInsertSize(0); rec.setNotPrimaryAlignmentFlag(false); rec.setProperPairFlag(false); rec.setReadUnmappedFlag(true); } if (rec.getReadPairedFlag()) { rec.setMateAlignmentStart(SAMRecord.NO_ALIGNMENT_START); rec.setMateNegativeStrandFlag(false); rec.setMateReferenceIndex(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); rec.setMateUnmappedFlag(true); } for (final String tag : ATTRIBUTE_TO_CLEAR) { rec.setAttribute(tag, null); } } }
Source:
<code><START> public static char complementBase(char base, boolean RNA) { <END> if (base == 'A' && RNA) return 'U'; if (base == 'A') return 'T'; if (base == 'T' && !RNA) return 'A'; if (base == 'U' && RNA) return 'A'; if (base == 'C') return 'G'; if (base == 'G') return 'C'; return ' '; }</code><technical_language>this present in biojava</technical_language>

Target:
protected static char complementBase(char base, boolean RNA) { if (base == 'A' && RNA) return 'U'; if (base == 'A') return 'T'; if (base == 'T' && !RNA) return 'A'; if (base == 'U' && RNA) return 'A'; if (base == 'C') return 'G'; if (base == 'G') return 'C'; return ' '; }
Source:
<code>public void placeBlock(GlowPlayer player, GlowBlockState state, BlockFace face, ItemStack holding, Vector clickedLoc) { state.setType(getMaterial()); state.setRawData((byte) 0); <START> state.getBlock().getWorld().requestSinglePulse(state.getBlock(), isWater(state.getBlock().getType()) || state.getBlock().getBiome() == Biome.HELL ? TICK_RATE_WATER : TICK_RATE_LAVA); <END> }</code><technical_language>tick delay 0</technical_language>

Target:
public void placeBlock(GlowPlayer player, GlowBlockState state, BlockFace face, ItemStack holding, Vector clickedLoc) { state.setType(getMaterial()); state.setRawData((byte) 0); state.getBlock().getWorld().requestSinglePulse(state.getBlock(), isWater(state.getType()) || state.getBlock().getBiome() == Biome.HELL ? TICK_RATE_WATER : TICK_RATE_LAVA); }
Source:
<code>public SubTabHostGeneralHostErrataPresenter(EventBus eventBus, ViewDef view, ProxyDef proxy, PlaceManager placeManager, DetailTabModelProvider<HostListModel<Void>, HostErrataCountModel> errataCountModelProvider) { super(eventBus, view, proxy, placeManager, errataCountModelProvider, HostGeneralSubTabPanelPresenter.TYPE_SetTabContent); currentErrataModel = getModelProvider().getModel(); <START> logger.info("SubTabHostGeneralHostErrataPresenter created: " + this.toString()); END> }</code><technical_language>debug/trace/remove</technical_language>

Target:
public SubTabHostGeneralHostErrataPresenter(EventBus eventBus, ViewDef view, ProxyDef proxy, PlaceManager placeManager, DetailTabModelProvider<HostListModel<Void>, HostErrataCountModel> errataCountModelProvider) { super(eventBus, view, proxy, placeManager, errataCountModelProvider, HostGeneralSubTabPanelPresenter.TYPE_SetTabContent); currentErrataModel = getModelProvider().getModel(); }
Source:
<code>protected void download(final long objectSize, final WebResponse response) throws IOException { try (final InputStream responseStream = response.getResponseStream()) { final long startTime = PerformanceUtils.getCurrentTime(); final long totalBytes = IOUtils.copy(responseStream, destinationChannel, bufferSize, objName, false); <START> final long endTime = PerformanceUtils.getCurrentTime(); <END> if (objectSize != -1 && totalBytes != objectSize) { throw new ContentLengthNotMatchException(objName, objectSize, totalBytes); } PerformanceUtils.logMbps(startTime, endTime, totalBytes, objName, false); } }</code><technical_language>This is autogen file manually modified. If need a change in autogened file, know</technical_language>

Target:
protected void download(final long objectSize, final WebResponse response) throws IOException { try (final InputStream responseStream = response.getResponseStream()) { final long startTime = PerformanceUtils.getCurrentTime(); final long totalBytes = IOUtils.copy(responseStream, destinationChannel, bufferSize, objName, false); destinationChannel.close(); final long endTime = PerformanceUtils.getCurrentTime(); if (objectSize != -1 && totalBytes != objectSize) { throw new ContentLengthNotMatchException(objName, objectSize, totalBytes); } PerformanceUtils.logMbps(startTime, endTime, totalBytes, objName, false); } }
Source:
<code>private void updateLogviewerState(TaskStatus status) { String nodeId = status.getTaskId().getValue().split("\\" + DEFAULT_MESOS_COMPONENT_NAME_DELIMITER)[0]; switch (status.getState()) { case TASK_STAGING: return; case TASK_STARTING: return; case TASK_RUNNING: return; default: } String logviewerZKPath = String.format("%s/%s", logviewerZkDir, nodeId); if (zkClient.nodeExists(logviewerZKPath)) { LOG.info("updateLogviewerState: Remove logviewer state in zk: {}", logviewerZKPath); zkClient.deleteNode(logviewerZKPath); LOG.info("updateLogviewerState: Reviving offers for logviewer relaunch"); mesosNimbus._driver.reviveOffers(); StormSchedulerImpl stormScheduler = (StormSchedulerImpl) mesosNimbus.getForcedScheduler(); stormScheduler.unsetOffersSuppressed(); } else { <START> LOG.error("Task exists for logviewer that isn't tracked in ZooKeeper"); <END> } }</code><technical_language>task *still* exist, "Mesos task existed" more appropriate</technical_language>

Target:
private void updateLogviewerState(TaskStatus status) { String taskId = status.getTaskId().getValue(); if (!taskId.contains(MesosCommon.MESOS_COMPONENT_ID_DELIMITER)) { LOG.error("updateLogviewerState: taskId for logviewer, {}, isn't formatted correctly so ignoring task update", taskId); return; } String nodeId = taskId.split("\\" + MesosCommon.MESOS_COMPONENT_ID_DELIMITER)[1]; String logviewerZKPath = String.format("%s/%s", logviewerZkDir, nodeId); switch (status.getState()) { case TASK_STAGING: checkRunningLogviewerState(logviewerZKPath); return; case TASK_STARTING: checkRunningLogviewerState(logviewerZKPath); return; case TASK_RUNNING: checkRunningLogviewerState(logviewerZKPath); return; case TASK_LOST: break; default: mesosNimbus._driver.killTask(status.getTaskId()); } if (zkClient.nodeExists(logviewerZKPath)) { LOG.info("updateLogviewerState: Remove logviewer state in zk at for logviewer task {}", logviewerZKPath, taskId); zkClient.deleteNode(logviewerZKPath); LOG.info("updateLogviewerState: Add offer request for logviewer"); StormSchedulerImpl stormScheduler = (StormSchedulerImpl) mesosNimbus.getForcedScheduler(); stormScheduler.addOfferRequest(MesosCommon.LOGVIEWER_OFFERS_REQUEST_KEY); } }
Source:
<code>public ProcessVariablesMap<String, Object> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { ProcessVariablesMap<String, Object> map = new ProcessVariablesMap<>(); JsonNode node = jp.getCodec().readTree(jp); node.fields().forEachRemaining(entry -> { String name = entry.getKey(); JsonNode entryValue = entry.getValue(); if(!entryValue.isNull()) { if (entryValue.get("type") != null && entryValue.get("value") != null) { String type = entryValue.get("type").textValue(); String value = entryValue.get("value").asText(); Class<?> clazz = ProcessVariablesMapTypeRegistry.forType(type); Object result = conversionService.convert(value, clazz); if(ObjectValue.class.isInstance(result)) { result = ObjectValue.class.cast(result) .getObject(); } map.put(name, result); } else { Object value = null; try { <START> value = new ObjectMapper().treeToValue(entryValue, <END> Object.class); } catch (JsonProcessingException e) { e.printStackTrace(); } map.put(name, value); } } else { map.put(name, null); } }); return map; }</code><technical_language>Shaw, try inject ObjectMapper instead of creating a new one</technical_language>

Target:
public ProcessVariablesMap<String, Object> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { ProcessVariablesMap<String, Object> map = new ProcessVariablesMap<>(); JsonNode node = jp.getCodec().readTree(jp); node.fields().forEachRemaining(entry -> { String name = entry.getKey(); JsonNode entryValue = entry.getValue(); if(!entryValue.isNull()) { if (entryValue.get(TYPE) != null && entryValue.get(VALUE) != null) { String type = entryValue.get(TYPE).textValue(); String value = entryValue.get(VALUE).asText(); Class<?> clazz = ProcessVariablesMapTypeRegistry.forType(type); Object result = conversionService.convert(value, clazz); if(ObjectValue.class.isInstance(result)) { result = ObjectValue.class.cast(result) .getObject(); } map.put(name, result); } else { Object value = null; try { value = objectMapper.treeToValue(entryValue, Object.class); } catch (JsonProcessingException e) { logger.error("Unexpected Json Processing Exception: ", e); } map.put(name, value); } } else { map.put(name, null); } }); return map; }
Source:
<code>private ChannelWriteController channelWriteController() { <START> return new ChannelWriteController( <END> configFetcher, channelStore, new DefaultGsonModelReader(), new ChannelModelTransformer( v4ChannelCodec(), new ImageModelTranslator() ) ); }</code><technical_language>Code style. static factory methods builders for classes. Constructors private</technical_language>

Target:
ChannelWriteController channelWriteController() { return ChannelWriteController.create( configFetcher, channelStore, DefaultGsonModelReader.create(), ChannelModelTransformer.create( v4ChannelCodec(), ImageModelTranslator.create() ) ); }
Source:
<code>public byte[] toBytes(Tuple tuple, Expression[] expressions, ValueBitSet valueSet, ImmutableBytesWritable ptr) { int offset = 0; int index = 0; valueSet.clear(); int minNullableIndex = getMinNullable(); byte[] b = new byte[getEstimatedValueLength() + valueSet.getEstimatedLength()]; List<Field> fields = getFields(); for (int i = 0; i < fields.size(); i++) { Field field = fields.get(i); PDataType type = field.getDataType(); for (int j = 0; j < field.getCount(); j++) { if (expressions[index].evaluate(tuple, ptr) && ptr.getLength() > 0) { if (index >= minNullableIndex) { valueSet.set(index - minNullableIndex); } if (!type.isFixedWidth()) { b = ensureSize(b, offset, offset + getVarLengthBytes(ptr.getLength())); offset = writeVarLengthField(ptr, b, offset); } else { int nBytes = ptr.getLength(); b = ensureSize(b, offset, offset + nBytes); System.arraycopy(ptr.get(), ptr.getOffset(), b, offset, nBytes); <START> if (field.getMaxLength() != null && field.getMaxLength() > 0 ) { <END> if (field.getMaxLength() > nBytes){ Arrays.fill(b, offset + nBytes, offset + field.getMaxLength(), StringUtil.SPACE_UTF8); } offset += field.getMaxLength(); } else { offset += nBytes; } } } index++; } } b = ensureSize(b, offset, offset + valueSet.getEstimatedLength()); offset = valueSet.toBytes(b, offset); if (offset == b.length) { return b; } else { byte[] bExact = new byte[offset]; System.arraycopy(b, 0, bExact, 0, offset); return bExact; } }</code><technical_language>Is this change required handle existing data of type char increase length? do this padding if type is PChar right? Is change length of other fixed length data type</technical_language>

Target:
public byte[] toBytes(Tuple tuple, Expression[] expressions, ValueBitSet valueSet, ImmutableBytesWritable ptr) { int offset = 0; int index = 0; valueSet.clear(); int minNullableIndex = getMinNullable(); byte[] b = new byte[getEstimatedValueLength() + valueSet.getEstimatedLength()]; List<Field> fields = getFields(); for (int i = 0; i < fields.size(); i++) { Field field = fields.get(i); PDataType type = field.getDataType(); for (int j = 0; j < field.getCount(); j++) { if (expressions[index].evaluate(tuple, ptr) && ptr.getLength() > 0) { if (index >= minNullableIndex) { valueSet.set(index - minNullableIndex); } if (!type.isFixedWidth()) { b = ensureSize(b, offset, offset + getVarLengthBytes(ptr.getLength())); offset = writeVarLengthField(ptr, b, offset); } else { int nBytes = ptr.getLength(); b = ensureSize(b, offset, offset + nBytes); System.arraycopy(ptr.get(), ptr.getOffset(), b, offset, nBytes); if (field.getDataType() == PChar.INSTANCE && field.getMaxLength() != null && field.getMaxLength() > 0) { if (field.getMaxLength() > nBytes){ Arrays.fill(b, offset + nBytes, offset + field.getMaxLength(), StringUtil.SPACE_UTF8); } offset += field.getMaxLength(); } else { offset += nBytes; } } } index++; } } b = ensureSize(b, offset, offset + valueSet.getEstimatedLength()); offset = valueSet.toBytes(b, offset); if (offset == b.length) { return b; } else { byte[] bExact = new byte[offset]; System.arraycopy(b, 0, bExact, 0, offset); return bExact; } }
Source:
<code>public int compareTo(LocalizedMessage other) { int result = Integer.compare(lineNo, other.lineNo); if (lineNo == other.lineNo) { if (columnNo == other.columnNo) { <START> result = Comparator.nullsFirst(Comparator.<String>naturalOrder()) <END> .compare(moduleId, other.getModuleId()); if (result == 0) { result = getMessage().compareTo(other.getMessage()); } } else { result = Integer.compare(columnNo, other.columnNo); } } return result; }</code><technical_language>@romani > Classes missed in Cobertura coverage report: com/puppycrawl/tools/checkstyle/api/LocalizedMessage Comparator.nullsFirst Comparator.naturalOrder forces cobertura ignore entire class streams. @Luolc Please rewrite this class 2 methods figure out is causing problem</technical_language>

Target:
public int compareTo(LocalizedMessage other) { final int result; if (lineNo == other.lineNo) { if (columnNo == other.columnNo) { if (Objects.equals(moduleId, other.moduleId)) { result = getMessage().compareTo(other.getMessage()); } else if (moduleId == null) { result = -1; } else if (other.moduleId == null) { result = 1; } else { result = moduleId.compareTo(other.moduleId); } } else { result = Integer.compare(columnNo, other.columnNo); } } else { result = Integer.compare(lineNo, other.lineNo); } return result; }
Source:
<code>private <T, K extends Exception> T applyAndRelease(Semaphore semaphore, FunctionCheckedException<F, T, K> function) throws K { try { <START> return function.apply(delegate()); <END> } finally { semaphore.release(); } }</code><technical_language>I guess delegate now, if want</technical_language>

Target:
private <T, K extends Exception> T applyAndRelease(Semaphore semaphore, FunctionCheckedException<F, T, K> function) throws K { try { return function.apply(delegate); } finally { semaphore.release(); } }
Source:
<code>private static DataSource createDataSource() { DataSource result = null; Properties properties = new Properties(); Config.setConfigUtils(new DBConfigUtils(false)); try { String job = System.getProperty("JOB_NAME"); if (job == null) job = ""; String number = System.getProperty("BUILD_NUMBER"); if (number == null) number = ""; String schemaNamePostfix = job + number; InputStream is = BaseDAOTestCase.class.getResourceAsStream( "/test-database.properties"); properties.load(is); <START> is.close(); <END> ClassLoader.getSystemClassLoader().loadClass( properties.getProperty("database.driver")); String dbUrl = properties.getProperty("database.url") + schemaNamePostfix; result = new SingleConnectionDataSource( dbUrl, properties.getProperty("database.username"), properties.getProperty("database.password"), true); initSql = properties.getProperty("database.initsql"); loadDataFactory(properties.getProperty("database.testing.datafactory")); if (initSql != null && !initSql.isEmpty()) { needInitializationSql = true; } } catch (Exception error) { error.printStackTrace(); throw new RuntimeException("Cannot create data source", error); } return result; }</code><technical_language>done in finally block</technical_language>

Target:
private static DataSource createDataSource() { DataSource result = null; Properties properties = new Properties(); Config.setConfigUtils(new DBConfigUtils(false)); InputStream is = null; try { String job = System.getProperty("JOB_NAME"); if (job == null) job = ""; String number = System.getProperty("BUILD_NUMBER"); if (number == null) number = ""; String schemaNamePostfix = job + number; is = BaseDAOTestCase.class.getResourceAsStream( "/test-database.properties"); properties.load(is); ClassLoader.getSystemClassLoader().loadClass( properties.getProperty("database.driver")); String dbUrl = properties.getProperty("database.url") + schemaNamePostfix; result = new SingleConnectionDataSource( dbUrl, properties.getProperty("database.username"), properties.getProperty("database.password"), true); initSql = properties.getProperty("database.initsql"); loadDataFactory(properties.getProperty("database.testing.datafactory")); if (initSql != null && !initSql.isEmpty()) { needInitializationSql = true; } } catch (Exception error) { error.printStackTrace(); throw new RuntimeException("Cannot create data source", error); } finally { if (is != null) { try { is.close(); } catch (IOException e) { } } } return result; }
Source:
<code>public void setSlaveAgentPort(int port) throws IOException { if (!SLAVE_AGENT_PORT_ENFORCE) { forceSetSlaveAgentPort(port); <START> } <END> }</code><technical_language>NIT: else Logging IOException</technical_language>

Target:
public void setSlaveAgentPort(int port) throws IOException { if (SLAVE_AGENT_PORT_ENFORCE) { LOGGER.log(Level.WARNING, "setSlaveAgentPort({0}) call ignored because system property {1} is true", new String[] { Integer.toString(port), Jenkins.class.getName()+".slaveAgentPortEnforce" }); } else { forceSetSlaveAgentPort(port); } }
Source:
<code>public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException, OperationCanceledException { RefactoringStatus status = new RefactoringStatus(); try { RenameParams params = new RenameParams(); params.setPosition(LSPEclipseUtils.toPosition(offset, info.getDocument())); TextDocumentIdentifier identifier = new TextDocumentIdentifier(); identifier.setUri(info.getFileUri().toString()); params.setTextDocument(identifier); params.setNewName(newName); if (params.getNewName() != null) { <START> rename = info.getInitializedLanguageClient().get(1000, TimeUnit.MILLISECONDS).getTextDocumentService() <END> .rename(params).get(1000, TimeUnit.MILLISECONDS); } } catch (Exception e) { status.addError(e.getMessage()); } return status; }</code><technical_language>Avoid chaining "gets", a thenAccept work a timeout Future is enough</technical_language>

Target:
public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException, OperationCanceledException { RefactoringStatus status = new RefactoringStatus(); try { RenameParams params = new RenameParams(); params.setPosition(LSPEclipseUtils.toPosition(offset, info.getDocument())); TextDocumentIdentifier identifier = new TextDocumentIdentifier(); identifier.setUri(info.getFileUri().toString()); params.setTextDocument(identifier); params.setNewName(newName); if (params.getNewName() != null) { rename = info.getInitializedLanguageClient() .thenCompose(langaugeServer -> langaugeServer.getTextDocumentService().rename(params)) .get(1000, TimeUnit.MILLISECONDS); } } catch (Exception e) { status.addError(e.getMessage()); } return status; }
Source:
<code>public void destroy() throws Exception { restAPIStore.deleteApplication(applicationID); <START> super.cleanUp(); <END> }</code><technical_language>Lets super.cleanUpUsingRest()</technical_language>

Target:
public void destroy() throws Exception { restAPIStore.deleteApplication(applicationID); super.cleanUpUsingRest(); }
Source:
<code>public void rules_targeting_tests_should_have_tests_tag() throws Exception { List<Class> checks = CheckList.getChecks(); Set<Class> testChecks = new HashSet<>(CheckList.getJavaTestChecks()); for (Class cls : checks) { String key = getKey(cls, AnnotationUtils.getAnnotation(cls, Rule.class)); URL metadataURL = getClass().getResource("/org/sonar/l10n/java/rules/" + CheckList.REPOSITORY_KEY + "/" + key + "_java.json"); File metadataFile = new File(metadataURL.toURI()); assertThat(metadataFile).exists(); <START> FileReader jsonReader = new FileReader(metadataFile); <END> DummyMetatada metatada = gson.fromJson(jsonReader, DummyMetatada.class); if (testChecks.contains(cls)) { assertThat(metatada.tags).as("Rule " + key + " is targeting tests sources and should contain the 'tests' tag.").contains("tests"); } else { assertThat(metatada.tags).as("Rule " + key + " is targeting main sources and should not contain the 'tests' tag.").doesNotContain("tests"); } jsonReader.close(); } }</code><technical_language>try resource</technical_language>

Target:
public void rules_targeting_tests_should_have_tests_tag() throws Exception { Set<Class> testChecks = new HashSet<>(CheckList.getJavaTestChecks()); for (Class cls : CheckList.getChecks()) { String key = getKey(cls, AnnotationUtils.getAnnotation(cls, Rule.class)); URL metadataURL = getClass().getResource("/org/sonar/l10n/java/rules/" + CheckList.REPOSITORY_KEY + "/" + key + "_java.json"); File metadataFile = new File(metadataURL.toURI()); assertThat(metadataFile).exists(); try (FileReader jsonReader = new FileReader(metadataFile)) { DummyMetatada metatada = gson.fromJson(jsonReader, DummyMetatada.class); if (testChecks.contains(cls)) { assertThat(metatada.tags).as("Rule " + key + " is targeting tests sources and should contain the 'tests' tag.").contains("tests"); } else { assertThat(metatada.tags).as("Rule " + key + " is targeting main sources and should not contain the 'tests' tag.").doesNotContain("tests"); } } } }
Source:
<code>private Element addedElement(AbstractEditPart added, String label, ElementType type) { List<EditPart> selected = processEditor.getViewer().getSelectedEditParts(); if(selected.size() != 1) { StringBuilder builder = new StringBuilder(); for(int i = 0; i < selected.size(); i++) { builder.append(selected.get(i).toString()); builder.append(", "); } throw new IllegalStateException("Adding element caused selecting more elements: " + builder.toString()); } Element addedElement = new Element(selected.get(0), type); try{ if("Tasks".compareTo(type.getSectionName()) == 0) { added.setLabel(label); } else { addedElement.setName(label); } <START> } catch (CoreLayerException e) { <END> addedElement.setName(label); } return addedElement; }</code><technical_language>Is this a safe change? Consider of java catch (SWTLayerException|CoreLayerException ex)</technical_language>

Target:
private Element addedElement(AbstractEditPart added, String label, ElementType type) { List<EditPart> selected = processEditor.getViewer().getSelectedEditParts(); if(selected.size() != 1) { StringBuilder builder = new StringBuilder(); for(int i = 0; i < selected.size(); i++) { builder.append(selected.get(i).toString()); builder.append(", "); } throw new IllegalStateException("Adding element caused selecting more elements: " + builder.toString()); } Element addedElement = new Element(selected.get(0), type); try{ if("Tasks".compareTo(type.getSectionName()) == 0) { added.setLabel(label); } else { addedElement.setName(label); } } catch (SWTLayerException | CoreLayerException e) { addedElement.setName(label); } return addedElement; }
Source:
<code>public void activate(Context.OperatorContext context) { ApexKuduConnection.ApexKuduConnectionBuilder apexKuduConnectionBuilder = getKuduConnectionConfig(); apexKuduConnection = apexKuduConnectionBuilder.build(); checkNotNull(apexKuduConnection,"Kudu connection cannot be null"); kuduTable = apexKuduConnection.getKuduTable(); kuduSession = apexKuduConnection.getKuduSession(); kuduClientHandle = apexKuduConnection.getKuduClient(); checkNotNull(kuduTable,"Kudu Table cannot be null"); checkNotNull(kuduSession, "Kudu session cannot be null"); allColumnDefs = new HashMap(); primaryKeyColumnNames = new HashSet<>(); kuduColumnBasedGetters = new HashMap(); buildGettersForPojoPayload(); isInSafeMode = false; <START> isInReconcilingMode = false; <END> reconcilingWindowId = Stateless.WINDOW_ID; if ( (context.getValue(Context.OperatorContext.ACTIVATION_WINDOW_ID) != Stateless.WINDOW_ID) && context.getValue(Context.OperatorContext.ACTIVATION_WINDOW_ID) < windowDataManager.getLargestCompletedWindow()) { isInSafeMode = true; reconcilingWindowId = windowDataManager.getLargestCompletedWindow() + 1; isInReconcilingMode = false; } }</code><technical_language>Redundant initializations for isInSafeMode isInReconcilingMode</technical_language>

Target:
public void activate(Context.OperatorContext context) { ApexKuduConnection.ApexKuduConnectionBuilder apexKuduConnectionBuilder = getKuduConnectionConfig(); apexKuduConnection = apexKuduConnectionBuilder.build(); checkNotNull(apexKuduConnection,"Kudu connection cannot be null"); kuduTable = apexKuduConnection.getKuduTable(); kuduSession = apexKuduConnection.getKuduSession(); kuduClientHandle = apexKuduConnection.getKuduClient(); checkNotNull(kuduTable,"Kudu Table cannot be null"); checkNotNull(kuduSession, "Kudu session cannot be null"); allColumnDefs = new HashMap(); primaryKeyColumnNames = new HashSet<>(); kuduColumnBasedGetters = new HashMap(); buildGettersForPojoPayload(); reconcilingWindowId = Stateless.WINDOW_ID; if ( (context.getValue(Context.OperatorContext.ACTIVATION_WINDOW_ID) != Stateless.WINDOW_ID) && context.getValue(Context.OperatorContext.ACTIVATION_WINDOW_ID) < windowDataManager.getLargestCompletedWindow()) { reconcilingWindowId = windowDataManager.getLargestCompletedWindow() + 1; } if ( (context.getValue(Context.OperatorContext.ACTIVATION_WINDOW_ID) != Stateless.WINDOW_ID) && context.getValue(Context.OperatorContext.ACTIVATION_WINDOW_ID) == windowDataManager.getLargestCompletedWindow()) { reconcilingWindowId = windowDataManager.getLargestCompletedWindow(); } }
Source:
<code>private void testSaveAndReadMessage(String messageId) { <START> final ProjectId expected = TestAggregateIdFactory.createProjectId(messageId); <END> storage.write(expected.getId(), expected); final ProjectId actual = storage.read(expected.getId()); assertEquals(expected, actual); }</code><technical_language>Remove "TestAggregateIdFactory" this method is static-imported</technical_language>

Target:
private void testSaveAndReadMessage(String messageId) { final ProjectId expected = createProjectId(messageId); storage.write(expected.getId(), expected); final ProjectId actual = storage.read(expected.getId()); assertEquals(expected, actual); }
Source:
<code>public RemoteFile readFileWithMode(String uri, String ref, String path) throws GitAPIException, IOException { File dir = FileUtils.createTempDir("jgit_", ".git", null); try (Git git = Git.cloneRepository().setBare(true).setDirectory(dir) .setURI(uri).call()) { Repository repo = git.getRepository(); ObjectId refCommitId = sha1(uri, ref); RevCommit commit = repo.parseCommit(refCommitId); TreeWalk tw = TreeWalk.forPath(repo, path, commit.getTree()); <START> tw.setRecursive(true); <END> return new RemoteFile( readFileFromRepo(git.getRepository(), ref, path), tw.getFileMode(0)); } finally { FileUtils.delete(dir, FileUtils.RECURSIVE); } }</code><technical_language>need --- TreeWalk.forPath right</technical_language>

Target:
public RemoteFile readFileWithMode(String uri, String ref, String path) throws GitAPIException, IOException { File dir = FileUtils.createTempDir("jgit_", ".git", null); try (Git git = Git.cloneRepository().setBare(true).setDirectory(dir) .setURI(uri).call()) { Repository repo = git.getRepository(); ObjectId refCommitId = sha1(uri, ref); RevCommit commit = repo.parseCommit(refCommitId); TreeWalk tw = TreeWalk.forPath(repo, path, commit.getTree()); return new RemoteFile( tw.getObjectReader().open(tw.getObjectId(0)).getBytes( Integer.MAX_VALUE), tw.getFileMode(0)); } finally { FileUtils.delete(dir, FileUtils.RECURSIVE); } }
Source:
<code>public void score(List<String> sentences, String output) throws Exception { EnglishAnalyzer ea = new EnglishAnalyzer(EnglishAnalyzer.getDefaultStopSet()); QueryParser qp = new QueryParser(LuceneDocumentGenerator.FIELD_BODY, ea); ClassicSimilarity similarity = new ClassicSimilarity(); Query question = qp.parse(sentences.remove(0)); List<String> questionTerms = Arrays.asList(question.toString().trim().split("\\s+")); for (String sent: sentences) { double idf = 0.0; String[] terms = sent.split("\\s+"); for (String term: terms) { try { TermQuery q = (TermQuery) qp.parse(term); Term t = q.getTerm(); <START> if (questionTerms.contains(t.toString().trim())) { <END> idf += similarity.idf(reader.docFreq(t), reader.numDocs()); } else { idf += 0.0; } } catch (Exception e) { continue; } } double normalizedScore = idf / sent.length(); ScoredPassage scoredPassage = new ScoredPassage(sent, normalizedScore); if (scoredPassageHeap.size() < topPassages || normalizedScore > scoredPassageHeap.peekFirst().getScore()) { if (scoredPassageHeap.size() == topPassages) { scoredPassageHeap.pollLast(); } scoredPassageHeap.add(scoredPassage); } } }</code><technical_language>stick questionTerms in a hash this faster? Also, pre-trim terms time in loop</technical_language>

Target:
public void score(List<String> sentences, String output) throws Exception { EnglishAnalyzer ea = new EnglishAnalyzer(EnglishAnalyzer.getDefaultStopSet()); QueryParser qp = new QueryParser(LuceneDocumentGenerator.FIELD_BODY, ea); ClassicSimilarity similarity = new ClassicSimilarity(); Query question = qp.parse(sentences.remove(0)); HashSet<String> questionTerms = new HashSet<>(Arrays.asList(question.toString().trim().split("\\s+"))); for (String sent: sentences) { double idf = 0.0; String[] terms = sent.split("\\s+"); for (String term: terms) { try { TermQuery q = (TermQuery) qp.parse(term); Term t = q.getTerm(); if (questionTerms.contains(t.toString())) { idf += similarity.idf(reader.docFreq(t), reader.numDocs()); } else { idf += 0.0; } } catch (Exception e) { continue; } } double normalizedScore = idf / sent.length(); ScoredPassage scoredPassage = new ScoredPassage(sent, normalizedScore); if (scoredPassageHeap.size() < topPassages || normalizedScore > scoredPassageHeap.peekFirst().getScore()) { if (scoredPassageHeap.size() == topPassages) { scoredPassageHeap.pollLast(); } scoredPassageHeap.add(scoredPassage); } } }
Source:
<code>public void run() { try { int logCount = 0; int randRoll = r.nextInt(snapCount/2); while (true) { ServerMetrics.SYNC_PROCESSOR_QUEUE_SIZE.add(queuedRequests.size()); Request si; if (toFlush.isEmpty()) { si = queuedRequests.take(); } else { si = queuedRequests.poll(); if (si == null) { flush(toFlush); continue; } } if (si == requestOfDeath) { break; } long startProcessTime = Time.currentElapsedTime(); ServerMetrics.SYNC_PROCESSOR_REAL_QUEUE_TIME.add( startProcessTime - si.syncQueueStartTime); if (zks.getZKDatabase().append(si)) { logCount++; if (logCount > (snapCount / 2 + randRoll)) { randRoll = r.nextInt(snapCount/2); zks.getZKDatabase().rollLog(); if (snapInProcess != null && snapInProcess.isAlive()) { LOG.warn("Too busy to snap, skipping"); } else { snapInProcess = new ZooKeeperThread("Snapshot Thread") { public void run() { try { zks.takeSnapshot(); } catch(Exception e) { LOG.warn("Unexpected exception", e); } } }; <START> snapInProcess.start(); <END> } logCount = 0; } } toFlush.add(si); if (toFlush.size() > 1000) { flush(toFlush); } ServerMetrics.SYNC_PROCESS_TIME.add( Time.currentElapsedTime() - startProcessTime); } } catch (Throwable t) { handleException(this.getName(), t); } finally{ running = false; } LOG.info("SyncRequestProcessor exited!"); }</code><technical_language>This is legacy code now, get rid of it, PR simple a single purpose, code review future reference easier. If spotbugs complains caused change here, leave is, fix in another PR</technical_language>

Target:
public void run() { try { resetSnapshotStats(); lastFlushTime = Time.currentElapsedTime(); while (true) { ServerMetrics.getMetrics().SYNC_PROCESSOR_QUEUE_SIZE.add(queuedRequests.size()); long pollTime = Math.min(zks.getMaxWriteQueuePollTime(), getRemainingDelay()); Request si = queuedRequests.poll(pollTime, TimeUnit.MILLISECONDS); if (si == null) { flush(); si = queuedRequests.take(); } if (si == REQUEST_OF_DEATH) { break; } long startProcessTime = Time.currentElapsedTime(); ServerMetrics.getMetrics().SYNC_PROCESSOR_QUEUE_TIME.add( startProcessTime - si.syncQueueStartTime); if (zks.getZKDatabase().append(si)) { if (shouldSnapshot()) { resetSnapshotStats(); zks.getZKDatabase().rollLog(); if (!snapThreadMutex.tryAcquire()) { LOG.warn("Too busy to snap, skipping"); } else { new ZooKeeperThread("Snapshot Thread") { public void run() { try { zks.takeSnapshot(); } catch (Exception e) { LOG.warn("Unexpected exception", e); } finally { snapThreadMutex.release(); } } }.start(); } } } else if (toFlush.isEmpty()) { if (nextProcessor != null) { nextProcessor.processRequest(si); if (nextProcessor instanceof Flushable) { ((Flushable)nextProcessor).flush(); } } continue; } toFlush.add(si); if (shouldFlush()) { flush(); } ServerMetrics.getMetrics().SYNC_PROCESS_TIME.add(Time.currentElapsedTime() - startProcessTime); } } catch (Throwable t) { handleException(this.getName(), t); } LOG.info("SyncRequestProcessor exited!"); }
Source:
<code>public void updatePermissions() throws Exception { Config config = new Config(); <START> setup(config); <END> Set<PermissionConfig> permissionConfigs = new HashSet<PermissionConfig>(); permissionConfigs.add(new PermissionConfig(PermissionConfig.PermissionType.MAP, "test", "*")); UpdatePermissionConfigRequest request = new UpdatePermissionConfigRequest(permissionConfigs); String result = communicator.updatePermissions(config.getGroupConfig().getName(), config.getGroupConfig().getPassword(), request.toJson().toString()); assertEquals("{\"status\":\"forbidden\"}", result); }</code><technical_language>Minor: calls setup(null) setup(config) is confusing. If need config object setup do private Config setup() { Config config = new Config(); ... return config; }</technical_language>

Target:
public void updatePermissions() throws Exception { Config config = setup(); Set<PermissionConfig> permissionConfigs = new HashSet<PermissionConfig>(); permissionConfigs.add(new PermissionConfig(PermissionConfig.PermissionType.MAP, "test", "*")); UpdatePermissionConfigRequest request = new UpdatePermissionConfigRequest(permissionConfigs); String result = communicator.updatePermissions(config.getGroupConfig().getName(), config.getGroupConfig().getPassword(), request.toJson().toString()); assertEquals("{\"status\":\"forbidden\"}", result); }
Source:
<code>public void emitReplayedTuples(PreparedStatement ps) { LOG.debug("Emitting replayed statement is -" + ps.toString()); ResultSet rs = null; try (PreparedStatement pStat = ps;) { <START> pStat.setFetchSize(10000); <END> LOG.debug("sql query = {}", pStat); rs = pStat.executeQuery(); if (rs == null || rs.isClosed()) { LOG.debug("Nothing to replay"); return; } while (rs.next()) { previousUpperBound = rs.getObject(getKey()).toString(); outputPort.emit((T)rs.getObject(getKey())); } } catch (SQLException ex) { throw new RuntimeException(ex); } }</code><technical_language>this picked some property. Else declare a constant top</technical_language>

Target:
public void emitReplayedTuples(PreparedStatement ps) { LOG.debug("Emitting replayed statement is -" + ps.toString()); ResultSet rs = null; try (PreparedStatement pStat = ps;) { pStat.setFetchSize(getFetchSize()); LOG.debug("sql query = {}", pStat); rs = pStat.executeQuery(); if (rs == null || rs.isClosed()) { LOG.debug("Nothing to replay"); return; } while (rs.next()) { previousUpperBound = rs.getObject(getKey()).toString(); outputPort.emit((T)rs.getObject(getKey())); } } catch (SQLException ex) { throw new RuntimeException(ex); } }
Source:
<code>public void notAllowSimpleGetsOnThoroughTables() throws IllegalAccessException { Method[] declaredMethods = ReadTransaction.class.getDeclaredMethods(); for (Method m : declaredMethods) { <START> if (simpleGets.containsKey(m.getName()) && simpleGets.get(m.getName()).length == m.getParameterCount()) { <END> checkThrowsAndNoInteraction(() -> { try { m.invoke(readTransaction, simpleGets.get(m.getName())); } catch (InvocationTargetException e) { Throwables.throwIfInstance(e.getCause(), IllegalStateException.class); } catch (IllegalAccessException e) { Throwables.throwUncheckedException(e); } }, IllegalStateException.class, "Cannot read"); } } }</code><technical_language>nit: extract simpleGets.get(m.getName()).length == m.getParameterCount() hasEqualParameterCount</technical_language>

Target:
public void notAllowSimpleGetsOnThoroughTables() throws IllegalAccessException { Method[] declaredMethods = ReadTransaction.class.getDeclaredMethods(); for (Method method : declaredMethods) { if (simpleGets.containsKey(method.getName()) && hasExpectedParameterCount(method)) { checkThrowsAndNoInteraction(() -> { try { method.invoke(readTransaction, simpleGets.get(method.getName())); } catch (InvocationTargetException e) { Throwables.throwIfInstance(e.getCause(), IllegalStateException.class); } catch (IllegalAccessException e) { Throwables.throwUncheckedException(e); } }, IllegalStateException.class, "Cannot read"); } } }
Source:
<code>public Optional<PillHeartBeat> retrievePillHeartBeat(final DeviceAccountPair pillAccountPair) { final Optional<PillHeartBeat> pillHeartBeatOptional = this.pillHeartBeatDAODynamoDB.get(pillAccountPair.externalDeviceId); if (pillHeartBeatOptional.isPresent()) { return pillHeartBeatOptional; } LOGGER.warn("No pill heartbeat for pill in dynamoDB", pillAccountPair.externalDeviceId); final Optional<DeviceStatus> pillStatusOptional = this.trackerMotionDAO.pillStatus(pillAccountPair.internalDeviceId, pillAccountPair.accountId); if(pillStatusOptional.isPresent()) { return Optional.of(PillHeartBeat.fromDeviceStatus(pillAccountPair.externalDeviceId, pillStatusOptional.get())); } <START> LOGGER.warn("No pill heartbeat for pill in postgres", pillAccountPair.externalDeviceId); <END> return Optional.absent(); }</code><technical_language>s/postgres/trackerMotionDAO tie this log message implementation detail of class</technical_language>

Target:
public Optional<PillHeartBeat> retrievePillHeartBeat(final DeviceAccountPair pillAccountPair) { final Optional<PillHeartBeat> pillHeartBeatOptional = this.pillHeartBeatDAODynamoDB.get(pillAccountPair.externalDeviceId); if (pillHeartBeatOptional.isPresent()) { return pillHeartBeatOptional; } LOGGER.warn("No pill heartbeat for pill in dynamoDB", pillAccountPair.externalDeviceId); final Optional<DeviceStatus> pillStatusOptional = this.trackerMotionDAO.pillStatus(pillAccountPair.internalDeviceId, pillAccountPair.accountId); if(pillStatusOptional.isPresent()) { return Optional.of(PillHeartBeat.fromDeviceStatus(pillAccountPair.externalDeviceId, pillStatusOptional.get())); } LOGGER.warn("No pill heartbeat for pill in trackerMotionDAO", pillAccountPair.externalDeviceId); return Optional.absent(); }
Source:
<code>private GenericObjectPool<UplinkConnector<?>> createPool(UplinkConnectorConfig<?> uplinkConnectorConfig) { UplinkConnectorFactory uplinkConnectorFactory = new UplinkConnectorFactory(uplinkConnectorConfig); GenericObjectPool<UplinkConnector<?>> pool = new GenericObjectPool<>(uplinkConnectorFactory); uplinkConnectorFactory.linkToPool(pool); pool.setMaxIdle(uplinkConnectorConfig.maxIdle); pool.setMaxTotal(uplinkConnectorConfig.maxActive); <START> pool.setTimeBetweenEvictionRunsMillis(30_000); <END> pool.setNumTestsPerEvictionRun(4); pool.setTestOnBorrow(true); pool.setTestWhileIdle(true); return pool; }</code><technical_language>Extract constants</technical_language>

Target:
private GenericObjectPool<UplinkConnector<?>> createPool(UplinkConnectorConfig<?> uplinkConnectorConfig) { UplinkConnectorFactory uplinkConnectorFactory = new UplinkConnectorFactory(uplinkConnectorConfig); GenericObjectPool<UplinkConnector<?>> pool = new GenericObjectPool<>(uplinkConnectorFactory); uplinkConnectorFactory.linkToPool(pool); pool.setMaxIdle(uplinkConnectorConfig.maxIdle); pool.setMaxTotal(uplinkConnectorConfig.maxActive); pool.setTimeBetweenEvictionRunsMillis(TIME_BETWEEN_EVICTION_RUNS_MILLIS); pool.setNumTestsPerEvictionRun(NUM_TESTS_PER_EVICTION_RUN); pool.setTestOnBorrow(true); pool.setTestWhileIdle(true); return pool; }
Source:
<code>public CompletableFuture<Event> process(CoreEvent event, EventProcessor router,String ramlPath) throws MuleException { logger.info("Handling odata enabled request."); HttpRequestAttributes attributes = ((HttpRequestAttributes) event.getMessage().getAttributes().getValue()); OdataContext oDataContext = null; if (isExecutable(event)) { try { <START> oDataContext = initializeModel(ramlPath,attributes.getMethod()); <END> } catch (OdataMetadataFieldsException | OdataMetadataResourceNotFound | OdataMetadataFormatException | OdataMetadataEntityNotFoundException e) { e.printStackTrace(); } } String path = attributes.getRelativePath(); if (path.contains(ODATA_SVC_URI_PREFIX)) { return ODataRouterService.processODataRequest(attributes, router, oDataContext,event); } else { return router.processEvent(event); } }</code><technical_language>This code is executed request, a approach transform this initialization static</technical_language>

Target:
public CompletableFuture<Event> process(CoreEvent event, EventProcessor router,String ramlPath) throws MuleException { logger.info("Handling odata enabled request."); HttpRequestAttributes attributes = CoreEventUtils.getHttpRequestAttributes(event); OdataContext oDataContext = getOdataContext(ramlPath); oDataContext.setMethod(attributes.getMethod()); String path = attributes.getRelativePath(); if (path.contains(ODATA_SVC_URI_PREFIX)) { return ODataRouterService.processODataRequest(attributes, router, oDataContext,event); } else { return router.processEvent(event); } }
Source:
<code>public static long stNumPoints(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { <START> GeometryCursor cursor = deserialize(input).getEsriGeometryCursor(); <END> int points = 0; while (true) { com.esri.core.geometry.Geometry geometry = cursor.next(); if (geometry == null) { return points; } if (geometry.isEmpty()) { continue; } if (geometry instanceof Point) { points++; } else { points += ((MultiVertexGeometry) geometry).getPointCount(); } } }</code><technical_language>utility method introduced in #10626</technical_language>

Target:
public static long stNumPoints(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { return getPointCount(deserialize(input)); }