auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void tellDidChange(String str) { <START> if (str.equals("")) { <END> return; } Integer min = 0; Integer max = str.length() - 1; Position p1 = new Position(min, Character.getNumericValue(str.charAt(min)) ); Position p2 = new Position(max, Character.getNumericValue(str.charAt(min)) ); Range r = new Range(p1,p2); TextDocumentContentChangeEvent change = new TextDocumentContentChangeEvent(r, max, str); List<TextDocumentContentChangeEvent> changelist = new ArrayList(); changelist.add(change); DidChangeTextDocumentParams params = new DidChangeTextDocumentParams(); params.setContentChanges(changelist); serverProxy.getTextDocumentService().didChange(params); }</code><technical_language>!str.isEmpty()</technical_language>

Target:
public void tellDidChange(String str) { if (str.isEmpty()) { return; } Integer min = 0; Integer max = str.length() - 1; cursor = max; Position p1 = new Position(0, min); Position p2 = new Position(0, max); Range r = new Range(p1, p2); TextDocumentContentChangeEvent change = new TextDocumentContentChangeEvent(r, max + 1, str); List<TextDocumentContentChangeEvent> changelist = new ArrayList(); changelist.add(change); DidChangeTextDocumentParams params = new DidChangeTextDocumentParams(); params.setContentChanges(changelist); serverProxy.getTextDocumentService().didChange(params); }
Source:
<code>PrintWriter createErrorWriter() { return new PrintWriter( new OutputStreamWriter(System.err, <START> StandardCharsets.UTF_8)); <END> }</code><technical_language>optional: import UTF_8 static</technical_language>

Target:
PrintWriter createErrorWriter() { return new PrintWriter(new OutputStreamWriter(System.err, UTF_8)); }
Source:
<code>public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session) { if (!(node instanceof ProjectNode)) { return Optional.empty(); } ProjectNode parent = (ProjectNode) node; PlanNode child = lookup.resolve(parent.getSource()); if (!(child instanceof SemiJoinNode)) { return Optional.empty(); } SemiJoinNode semiJoinNode = (SemiJoinNode) child; Optional<List<Symbol>> prunedOutputs = pruneInputs(child.getOutputSymbols(), parent.getAssignments().getExpressions()); if (!prunedOutputs.isPresent()) { return Optional.empty(); } <START> if (prunedOutputs.get().stream().noneMatch(semiJoinNode.getSemiJoinOutput()::equals)) { <END> return Optional.of( parent.replaceChildren(ImmutableList.of(semiJoinNode.getSource()))); } Set<Symbol> requiredSourceInputs = Streams.concat( prunedOutputs.get().stream() .filter(symbol -> !symbol.equals(semiJoinNode.getSemiJoinOutput())), Stream.of(semiJoinNode.getSourceJoinSymbol()), semiJoinNode.getSourceHashSymbol().map(Stream::of).orElse(Stream.empty())) .collect(toImmutableSet()); return restrictOutputs(idAllocator, semiJoinNode.getSource(), requiredSourceInputs) .map(newSource -> parent.replaceChildren(ImmutableList.of( semiJoinNode.replaceChildren(ImmutableList.of( newSource, semiJoinNode.getFilteringSource()))))); }</code><technical_language>just: if (!pruneOutputs.get().contains(semijoinNode.getSemiJoinOutput()) { ... I do need streams here, overkill</technical_language>

Target:
public Optional<PlanNode> apply(PlanNode node, Lookup lookup, PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session) { ProjectNode parent = (ProjectNode) node; PlanNode child = lookup.resolve(parent.getSource()); if (!(child instanceof SemiJoinNode)) { return Optional.empty(); } SemiJoinNode semiJoinNode = (SemiJoinNode) child; Optional<List<Symbol>> prunedOutputs = pruneInputs(child.getOutputSymbols(), parent.getAssignments().getExpressions()); if (!prunedOutputs.isPresent()) { return Optional.empty(); } if (!prunedOutputs.get().contains(semiJoinNode.getSemiJoinOutput())) { return Optional.of( parent.replaceChildren(ImmutableList.of(semiJoinNode.getSource()))); } Set<Symbol> requiredSourceInputs = Streams.concat( prunedOutputs.get().stream() .filter(symbol -> !symbol.equals(semiJoinNode.getSemiJoinOutput())), Stream.of(semiJoinNode.getSourceJoinSymbol()), semiJoinNode.getSourceHashSymbol().map(Stream::of).orElse(Stream.empty())) .collect(toImmutableSet()); return restrictOutputs(idAllocator, semiJoinNode.getSource(), requiredSourceInputs) .map(newSource -> parent.replaceChildren(ImmutableList.of( semiJoinNode.replaceChildren(ImmutableList.of( newSource, semiJoinNode.getFilteringSource()))))); }
Source:
<code>private boolean findSelectedFiles() { try { if (selectedFolderIds.size() > 0) { for (String selectedFolder : selectedFolderIds) { List<ContentResource> folderContents = contentService.getAllResources(selectedFolder); for (ContentResource folderFile: folderContents) { <START> if (!("org.sakaiproject.citation.impl.CitationList".equals(folderFile.getResourceType()))) { <END> selectedFilesToExport.put(folderFile.getId(), folderFile); } } } } for (String selectedFile : selectedFiles) { ContentResource contentFile = contentService.getResource(selectedFile); selectedFilesToExport.put(contentFile.getId(), contentFile); } for (Iterator<Map.Entry<String, ContentResource>> it = selectedFilesToExport.entrySet().iterator(); it.hasNext();) { ContentResource contentResource = it.next().getValue(); if ("org.sakaiproject.citation.impl.CitationList".equals(contentResource.getResourceType())) { it.remove(); } } } catch (PermissionException pe) { log.error("export-common-cartridge permission error finding selected files" + pe); setErrMessage("Error finding files selected for export: " + pe.getMessage()); return false; } catch (IdUnusedException ide) { log.error("export-common-cartridge ID unused error finding selected files" + ide); setErrMessage("Error finding files selected for export: " + ide.getMessage()); return false; } catch (TypeException te) { log.error("export-common-cartridge type error finding selected files" + te); setErrMessage("Error finding files selected for export.: " + te.getMessage()); return false; } return true; }</code><technical_language>Is this needed loop remove all</technical_language>

Target:
private boolean findSelectedFiles() { try { if (selectedFolderIds.size() > 0) { for (String selectedFolder : selectedFolderIds) { List<ContentResource> folderContents = contentService.getAllResources(selectedFolder); for (ContentResource folderFile: folderContents) { selectedFilesToExport.put(folderFile.getId(), folderFile); } } } for (String selectedFile : selectedFiles) { ContentResource contentFile = contentService.getResource(selectedFile); selectedFilesToExport.put(contentFile.getId(), contentFile); } for (Iterator<Map.Entry<String, ContentResource>> it = selectedFilesToExport.entrySet().iterator(); it.hasNext();) { ContentResource contentResource = it.next().getValue(); if ("org.sakaiproject.citation.impl.CitationList".equals(contentResource.getResourceType())) { it.remove(); } } } catch (PermissionException pe) { log.error("export-common-cartridge permission error finding selected files" + pe); setErrMessage("Error finding files selected for export: " + pe.getMessage()); return false; } catch (IdUnusedException ide) { log.error("export-common-cartridge ID unused error finding selected files" + ide); setErrMessage("Error finding files selected for export: " + ide.getMessage()); return false; } catch (TypeException te) { log.error("export-common-cartridge type error finding selected files" + te); setErrMessage("Error finding files selected for export.: " + te.getMessage()); return false; } return true; }
Source:
<code>public UserDevice(UUID id, UUID userPrivateId, String name) { super(id, name); <START> Objects.requireNonNull(userPrivateId); <END> Objects.requireNonNull(name); this.userPrivateId = userPrivateId; this.registrationTime = LocalDateTime.now(); this.appLastOpenedDate = LocalDate.now(); }</code><technical_language>put lines</technical_language>

Target:
public UserDevice(UUID id, UUID userPrivateId, String name) { super(id, name); this.userPrivateId = Objects.requireNonNull(userPrivateId); this.registrationTime = LocalDateTime.now(); this.appLastOpenedDate = LocalDate.now(); }
Source:
<code>protected void process(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String baseURL = req.getRequestURL().toString(); baseURL = baseURL.substring(0, baseURL.indexOf(req.getServletPath())); Locale locale = UrlUtil.getLocaleObj(req,resp); String service = req.getRequestURL().toString().substring( (baseURL).length()+("/vs".length())); try { HttpServletResponseAdv response = new HttpServletResponseAdv(resp); HttpServlet servlet = getServlet(service); ServletConfig config = getServletConfig(); servlet.init(config); servlet.service(req, response); if (isSecure(req, response)) response.commitOutput(); } catch(Exception ex) { String errorMsg = WebappResources.getString("cantCreateServlet", locale, service); HelpWebappPlugin.logError(errorMsg, ex); <START> try (PrintWriter writer = resp.getWriter()) { <END> writer.println(errorMsg); ex.printStackTrace(writer); } resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }</code><technical_language>Writer closed, close now. Why</technical_language>

Target:
protected void process(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String baseURL = req.getRequestURL().toString(); baseURL = baseURL.substring(0, baseURL.indexOf(req.getServletPath())); Locale locale = UrlUtil.getLocaleObj(req,resp); String service = req.getRequestURL().toString().substring( (baseURL).length()+("/vs".length())); try { HttpServletResponseAdv response = new HttpServletResponseAdv(resp); HttpServlet servlet = getServlet(service); ServletConfig config = getServletConfig(); servlet.init(config); servlet.service(req, response); if (isSecure(req, response)) response.commitOutput(); } catch(Exception ex) { String errorMsg = WebappResources.getString("cantCreateServlet", locale, service); HelpWebappPlugin.logError(errorMsg, ex); @SuppressWarnings("resource") PrintWriter writer = resp.getWriter(); writer.println(errorMsg); ex.printStackTrace(writer); resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }
Source:
<code>private void internalSetValue(T value) { if ( procedureParameter.getMode() != ParameterMode.IN && procedureParameter.getMode() != ParameterMode.INOUT ) { throw new IllegalStateException( "Can only bind values for IN/INOUT parameters : " + procedureParameter ); } if ( procedureParameter.getParameterType() != null ) { <START> if ( value != null && !procedureParameter.getParameterType().isInstance( value ) && <END> !procedureParameter.getHibernateType().getReturnedClass().isInstance( value ) ) { throw new IllegalArgumentException( "Bind value [" + value + "] was not of specified type [" + procedureParameter.getParameterType() ); } } this.value = value; this.isBound = true; }</code><technical_language>check if procedureParameter.isPassNullsEnabled() is true</technical_language>

Target:
private void internalSetValue(T value) { if ( procedureParameter.getMode() != ParameterMode.IN && procedureParameter.getMode() != ParameterMode.INOUT ) { throw new IllegalStateException( "Can only bind values for IN/INOUT parameters : " + procedureParameter ); } if ( procedureParameter.getParameterType() != null ) { if ( value == null ) { if ( !procedureParameter.isPassNullsEnabled() ) { throw new IllegalArgumentException( "The parameter with the [" + ( procedureParameter.getName() != null ? procedureParameter.getName() + "] name" : procedureParameter.getPosition() + "] position" ) + " was null. You need to call ParameterRegistration#enablePassingNulls(true) in order to pass null parameters." ); } } else if ( !procedureParameter.getParameterType().isInstance( value ) && !procedureParameter.getHibernateType().getReturnedClass().isInstance( value ) ) { throw new IllegalArgumentException( "Bind value [" + value + "] was not of specified type [" + procedureParameter .getParameterType() ); } } this.value = value; this.isBound = true; }
Source:
<code>protected void onInitUI() { super.onInitUI(); setPageTitle(Util.C.projectListTitle()); projects = new ProjectsTable() { @Override protected void initColumnHeaders() { super.initColumnHeaders(); <START> if(Gerrit.getGitwebLink() != null) { <END> table.setText(0, 3, Util.C.projectRepoBrowser()); table.getFlexCellFormatter(). addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader()); } } @Override protected void onOpenRow(final int row) { History.newItem(link(getRowItem(row))); } private String link(final ProjectInfo item) { return Dispatcher.toProjectAdmin(item.name_key(), ProjectScreen.INFO); } @Override protected void insert(int row, ProjectInfo k) { super.insert(row, k); table.getFlexCellFormatter(). addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell()); } @Override protected void populate(final int row, final ProjectInfo k) { table.setWidget(row, 1, new Hyperlink(k.name(), link(k))); table.setText(row, 2, k.description()); GitwebLink l = Gerrit.getGitwebLink(); if (l != null) { table.setWidget(row, 3, new Anchor(l.getLinkName(), false, l.toProject(k .name_key()))); } setRowItem(row, k); } }; projects.setSavePointerId(PageLinks.ADMIN_PROJECTS); add(projects); }</code><technical_language>nit: missing space 'if'</technical_language>

Target:
protected void onInitUI() { super.onInitUI(); setPageTitle(Util.C.projectListTitle()); projects = new ProjectsTable() { @Override protected void initColumnHeaders() { super.initColumnHeaders(); if (Gerrit.getGitwebLink() != null) { table.setText(0, 3, Util.C.projectRepoBrowser()); table.getFlexCellFormatter(). addStyleName(0, 3, Gerrit.RESOURCES.css().dataHeader()); } } @Override protected void onOpenRow(final int row) { History.newItem(link(getRowItem(row))); } private String link(final ProjectInfo item) { return Dispatcher.toProjectAdmin(item.name_key(), ProjectScreen.INFO); } @Override protected void insert(int row, ProjectInfo k) { super.insert(row, k); if (Gerrit.getGitwebLink() != null) { table.getFlexCellFormatter(). addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell()); } } @Override protected void populate(final int row, final ProjectInfo k) { table.setWidget(row, 1, new Hyperlink(k.name(), link(k))); table.setText(row, 2, k.description()); GitwebLink l = Gerrit.getGitwebLink(); if (l != null) { table.setWidget(row, 3, new Anchor(l.getLinkName(), false, l.toProject(k .name_key()))); } setRowItem(row, k); } }; projects.setSavePointerId(PageLinks.ADMIN_PROJECTS); add(projects); }
Source:
<code>public void clientEarlyTerminateTest() throws Exception { EmbeddedChannel channel = createEmbeddedChannel(); TestingUri uri = TestingUri.OnResponseCompleteWithEarlyClientTerminate; HttpRequest httpRequest = RestTestUtils.createRequest(HttpMethod.POST, uri.toString(), null); HttpUtil.setKeepAlive(httpRequest, false); String iseMetricName = MetricRegistry.name(NettyResponseChannel.class, "InternalServerErrorCount"); long iseBeforeCount = MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(iseMetricName).getCount(); <START> String citMetricName = MetricRegistry.name(NettyResponseChannel.class, "ClientEarlyTerminateCount"); <END> long citBeforeCount = MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(citMetricName).getCount(); channel.writeInbound(httpRequest); HttpResponse response = channel.readOutbound(); assertEquals("Unexpected response status", HttpResponseStatus.INTERNAL_SERVER_ERROR, response.status()); if (!(response instanceof FullHttpResponse)) { while (channel.readOutbound() != null) { } } assertEquals("Client terminates should not count towards InternalServerError count", iseBeforeCount, MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(iseMetricName).getCount()); assertEquals("Client terminate should have been tracked", citBeforeCount + 1, MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(citMetricName).getCount()); }</code><technical_language>cetMetricName</technical_language>

Target:
public void clientEarlyTerminateTest() throws Exception { EmbeddedChannel channel = createEmbeddedChannel(); TestingUri uri = TestingUri.OnResponseCompleteWithEarlyClientTerminate; HttpRequest httpRequest = RestTestUtils.createRequest(HttpMethod.POST, uri.toString(), null); HttpUtil.setKeepAlive(httpRequest, false); String iseMetricName = MetricRegistry.name(NettyResponseChannel.class, "InternalServerErrorCount"); long iseBeforeCount = MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(iseMetricName).getCount(); String cetMetricName = MetricRegistry.name(NettyResponseChannel.class, "ClientEarlyTerminateCount"); long cetBeforeCount = MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(cetMetricName).getCount(); channel.writeInbound(httpRequest); HttpResponse response = channel.readOutbound(); assertEquals("Unexpected response status", HttpResponseStatus.INTERNAL_SERVER_ERROR, response.status()); if (!(response instanceof FullHttpResponse)) { while (channel.readOutbound() != null) { } } assertEquals("Client terminates should not count towards InternalServerError count", iseBeforeCount, MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(iseMetricName).getCount()); assertEquals("Client terminate should have been tracked", cetBeforeCount + 1, MockNettyMessageProcessor.METRIC_REGISTRY.getCounters().get(cetMetricName).getCount()); }
Source:
<code>public ListenableFuture<?> truncateExportToSeqNo(boolean isRecover, long sequenceNumber) { return m_es.submit(new Runnable() { @Override public void run() { try { m_tupleCount = sequenceNumber; if (isRecover) { if (sequenceNumber < 0) { exportLog.error("Snapshot does not include valid truncation point for partition " + m_partitionId); } else { m_committedBuffers.truncateToSequenceNumber(sequenceNumber); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncating export pdb files to sequence number " + sequenceNumber); <START> } <END> } } m_gapTracker.truncate(sequenceNumber); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncate tracker via snapshot truncation to " + sequenceNumber + " now is " + m_gapTracker.toString()); } queryForBestCandidate(); } catch (Throwable t) { VoltDB.crashLocalVoltDB("Error while trying to truncate export to seq " + sequenceNumber, true, t); } } }); }</code><technical_language>BUG? log error continue processing invalid sequence number... happen? call m_gapTracker.truncate invalid value</technical_language>

Target:
public ListenableFuture<?> truncateExportToSeqNo(boolean isRecover, long sequenceNumber) { return m_es.submit(new Runnable() { @Override public void run() { try { m_tupleCount = sequenceNumber; if (isRecover) { if (sequenceNumber < 0) { exportLog.error("Snapshot does not include valid truncation point for partition " + m_partitionId); return; } m_committedBuffers.truncateToSequenceNumber(sequenceNumber); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncating export pdb files to sequence number " + sequenceNumber); } } m_gapTracker.truncateAfter(sequenceNumber); resetStateInRejoinOrRecover(); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncate tracker via snapshot truncation to " + sequenceNumber + " now is " + m_gapTracker.toString()); } } catch (Throwable t) { VoltDB.crashLocalVoltDB("Error while trying to truncate export to seq " + sequenceNumber, true, t); } } }); }
Source:
<code>@Override public boolean evaluate(CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e) throws CacheEntryListenerException { if (e.getKey().key() < 0) { IgniteCache<QueryTestKey, QueryTestValue> cache = ignite.cache(cacheName); boolean committed = false; Transaction tx = null; boolean startTx = cache.getConfiguration(CacheConfiguration.class).getAtomicityMode() != ATOMIC; Set<QueryTestKey> keys = new LinkedHashSet<>(); int startKey = ThreadLocalRandom.current().nextInt(KEYS_FROM_CALLBACK_RANGE - KEYS_FROM_CALLBACK); for (int key = startKey; key < startKey + KEYS_FROM_CALLBACK; key++) keys.add(new QueryTestKey(key)); while (!committed && !Thread.currentThread().isInterrupted()) { try { if (startTx) tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ); if (ThreadLocalRandom.current().nextBoolean()) cache.invokeAll(keys, new IncrementTestEntryProcessor()); else { for (QueryTestKey key : keys) cache.invoke(key, new IncrementTestEntryProcessor()); } if (tx != null) tx.commit(); committed = true; } catch (Exception ex) { <START> assertTrue(ex.getMessage(), ex.getMessage() != null && <END> (ex.getMessage().contains("Transaction has been rolled back") || ex.getMessage().contains("Cannot serialize transaction due to write conflict"))); } finally { if (tx != null) tx.close(); } } filterCbCntr.incrementAndGet(); } return true; }</code><technical_language>do expect TransactionRollback here? check for TransactionSerializationException</technical_language>

Target:
@Override public boolean evaluate(CacheEntryEvent<? extends QueryTestKey, ? extends QueryTestValue> e) throws CacheEntryListenerException { if (e.getKey().key() < 0) { IgniteCache<QueryTestKey, QueryTestValue> cache = ignite.cache(cacheName); boolean committed = false; Transaction tx = null; boolean startTx = cache.getConfiguration(CacheConfiguration.class).getAtomicityMode() != ATOMIC; Set<QueryTestKey> keys = new LinkedHashSet<>(); int startKey = ThreadLocalRandom.current().nextInt(KEYS_FROM_CALLBACK_RANGE - KEYS_FROM_CALLBACK); for (int key = startKey; key < startKey + KEYS_FROM_CALLBACK; key++) keys.add(new QueryTestKey(key)); while (!committed && !Thread.currentThread().isInterrupted()) { try { if (startTx) tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ); if (ThreadLocalRandom.current().nextBoolean()) cache.invokeAll(keys, new IncrementTestEntryProcessor()); else { for (QueryTestKey key : keys) cache.invoke(key, new IncrementTestEntryProcessor()); } if (tx != null) tx.commit(); committed = true; } catch (Exception ex) { assertTrue(ex.getCause() instanceof TransactionSerializationException); assertEquals(cache.getConfiguration(CacheConfiguration.class).getAtomicityMode(), TRANSACTIONAL_SNAPSHOT); } finally { if (tx != null) tx.close(); } } filterCbCntr.incrementAndGet(); } return true; }
Source:
<code>public void stopGame() { super.stopGame(); calc.stop(); <START> DebugMenu.unregisterMenuCallback("Hard AI"); <END> }</code><technical_language>If game frame is away, menu destroyed GC'd. Do need unregister? this happen implicitly TripleAFrame closing</technical_language>

Target:
public void stopGame() { super.stopGame(); calc.stop(); }
Source:
<code>public void onStart() { super.onStart(); <START> EventBusExt.getDefault().registerSticky(this); <END> }</code><technical_language>sticky</technical_language>

Target:
public void onStart() { super.onStart(); EventBusExt.getDefault().register(this); String campaigns = StringUtils.join(sampleIdsSubset, ","); TaskQueue.loadQueueDefault(getActivity()) .execute(new ReportBackListTask(position, campaigns, 1)); }
Source:
<code>public void test_submodule_update_with_error() throws Exception { w.init(); try { w.git.addSubmodule("non-existent-submodule-url", "submodule-dir"); fail("Expected submodule update exception not thrown"); } catch (GitException e) { <START> assertTrue(e.getMessage().startsWith("Command \"git submodule add non-existent-submodule-url submodule-dir\" returned status code 1")); <END> } }</code><technical_language>assertThat(...) (Hamcrest) here. In case exception message expected message assertTrue(...) provide a helpful output</technical_language>

Target:
public void test_submodule_update_with_error() throws Exception { w.git.clone_().url(localMirror()).execute(); w.git.checkout().ref("origin/tests/getSubmodules").execute(); w.rm("modules/ntp"); w.touch("modules/ntp", "file that interferes with ntp submodule folder"); try { w.git.submoduleUpdate().execute(); fail("Did not throw expected submodule update exception"); } catch (GitException e) { assertThat(e.getMessage(), containsString("Command \"git submodule update modules/ntp\" returned status code 1")); } }
Source:
<code>public boolean isAvailable(ScalarResourceEntry scalarResourceEntry, ReservationType reservationType) { <START> return (availableResourcesByReservationType.get(reservationType).getValue() <= scalarResourceEntry.getValue()); <END> }</code><technical_language>this >= <=</technical_language>

Target:
public boolean isAvailable(ScalarResourceEntry scalarResourceEntry, ReservationType reservationType) { return (availableResourcesByReservationType.get(reservationType).getValue() >= scalarResourceEntry.getValue()); }
Source:
<code>X509Certificate generateCertificate(KeyPair pair) throws Exception { PrivateKey privkey = pair.getPrivate(); X509CertInfo info = new X509CertInfo(); Date from = new Date(); <START> Date to = new Date(from.getTime() + (1000L * 60L * 60L * 24L * 365L * 10L)); <END> CertificateValidity interval = new CertificateValidity(from, to); BigInteger sn = new BigInteger(64, new SecureRandom()); X500Name owner = new X500Name("CN=" + autoGenerateCertHostName); info.set(X509CertInfo.VALIDITY, interval); info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(sn)); info.set(X509CertInfo.SUBJECT, owner); info.set(X509CertInfo.ISSUER, owner); info.set(X509CertInfo.KEY, new CertificateX509Key(pair.getPublic())); info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3)); AlgorithmId algo = new AlgorithmId(AlgorithmId.sha256WithRSAEncryption_oid); info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algo)); X509CertImpl cert = new X509CertImpl(info); cert.sign(privkey, SHA_256_WITH_RSA); algo = (AlgorithmId)cert.get(X509CertImpl.SIG_ALG); info.set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM, algo); cert = new X509CertImpl(info); cert.sign(privkey, SHA_256_WITH_RSA); return cert; }</code><technical_language>I tempted this shorter longer, i.e. is out of box solution a long term solution</technical_language>

Target:
X509Certificate generateCertificate(KeyPair pair) throws Exception { PrivateKey privkey = pair.getPrivate(); X509CertificateBuilder builder = new X509CertificateBuilder(); Date from = new Date(); Date to = new Date(from.getTime() + (1000L * 60L * 60L * 24L * 365L * 10L)); BigInteger sn = new BigInteger(64, new SecureRandom()); builder.setNotValidAfter(ZonedDateTime.ofInstant(Instant.ofEpochMilli(to.getTime()), TimeZone.getDefault().toZoneId())); builder.setNotValidBefore(ZonedDateTime.ofInstant(Instant.ofEpochMilli(from.getTime()), TimeZone.getDefault().toZoneId())); builder.setSerialNumber(sn); X500Principal owner = new X500Principal("CN=" + autoGenerateCertHostName); builder.setSubjectDn(owner); builder.setIssuerDn(owner); builder.setPublicKey(pair.getPublic()); builder.setVersion(3); builder.setSignatureAlgorithmName(SHA_256_WITH_RSA); builder.setSigningKey(privkey); return builder.build(); }
Source:
<code>public void use(String iconSetName) { try { IconSet iconSet = iconSetManager.getIconSet(iconSetName); if (iconSet == null) { <START> iconSet = iconSetManager.getDefaultIconSet(); <END> } iconRenderer.use(iconSet); } catch (IconException e) { setLastError(e); } }</code><technical_language>I do a fallback here</technical_language>

Target:
public void use(String iconSetName) { try { IconSet iconSet = iconSetManager.getIconSet(iconSetName); iconRenderer.use(iconSet); } catch (IconException e) { setLastError(e); } }
Source:
<code>public static RelationshipType fromSchedulableEntityType(String type) { switch (type) { <START> case "FEED": <END> return RelationshipType.FEED_ENTITY; case "PROCESS": return RelationshipType.PROCESS_ENTITY; default: throw new IllegalArgumentException("Invalid entity type: " + type); } }</code><technical_language>Please EntityType.getEnum(type) instead of string literals</technical_language>

Target:
public static RelationshipType fromSchedulableEntityType(String type) { EntityType entityType = EntityType.getEnum(type); switch (entityType) { case FEED: return RelationshipType.FEED_ENTITY; case PROCESS: return RelationshipType.PROCESS_ENTITY; default: throw new IllegalArgumentException("Invalid schedulable entity type: " + entityType.name()); } }
Source:
<code>private void closeTempFile() { ConnectException connectException = null; for (String encodedPartition : tempFiles.keySet()) { try { closeTempFile(encodedPartition); } catch (ConnectException e) { connectException = e; log.error( "Failed to close temporary file for partition " + encodedPartition + ". The connector will attempt to rewrite the temporary file." ); } } if (connectException != null) { for (String encodedPartition : tempFiles.keySet()) { <START> deleteTempFile(encodedPartition); <END> startOffsets.remove(encodedPartition); offsets.remove(encodedPartition); buffer.clear(); } log.debug("Resetting offset for to {}", tp, offset); context.offset(tp, offset); recordCounter = 0; throw connectException; } }</code><technical_language>if delete fails ConnectException too? problem? try delete files least</technical_language>

Target:
private void closeTempFile() { ConnectException connectException = null; for (String encodedPartition : tempFiles.keySet()) { try { closeTempFile(encodedPartition); } catch (ConnectException e) { connectException = e; log.error( "Failed to close temporary file for partition {}. The connector will attempt to" + " rewrite the temporary file.", encodedPartition ); } } if (connectException != null) { for (String encodedPartition : tempFiles.keySet()) { try { deleteTempFile(encodedPartition); } catch (ConnectException e) { log.error("Failed to delete tmp file {}", tempFiles.get(encodedPartition), e); } startOffsets.remove(encodedPartition); offsets.remove(encodedPartition); buffer.clear(); } log.debug("Resetting offset for to {}", tp, offset); context.offset(tp, offset); recordCounter = 0; throw connectException; } }
Source:
<code>public void deleteTasksWithPrefix(String connector, String taskPrefix) { Set<String> tasksToDelete = _liveTaskMap.values() .stream() .flatMap(Collection::stream) .filter(x -> x.getTaskPrefix().equals(taskPrefix) && x.getConnectorType().equals(connector)) .map(DatastreamTask::getDatastreamTaskName) .collect(Collectors.toSet()); <START> LOG.info("Cleaning up deprecated connector tasks: for connector: {}", <END> tasksToDelete, connector); for (String taskToDelete : tasksToDelete) { deleteConnectorTask(connector, taskToDelete); } }</code><technical_language>fault nit: replace deprecated w/ stale expired</technical_language>

Target:
public void deleteTasksWithPrefix(String connector, String taskPrefix) { Set<String> tasksToDelete = _liveTaskMap.values() .stream() .flatMap(Collection::stream) .filter(x -> x.getTaskPrefix().equals(taskPrefix) && x.getConnectorType().equals(connector)) .map(DatastreamTask::getDatastreamTaskName) .collect(Collectors.toSet()); LOG.info("Cleaning up stale connector tasks: for connector: {}", tasksToDelete, connector); for (String taskToDelete : tasksToDelete) { deleteConnectorTask(connector, taskToDelete); } }
Source:
<code>public void tagSuggestNoIdx() throws Exception { <START> <END> final TagSuggest.Request request = new TagSuggest.Request(TrueFilter.get(), range, OptionalLimit.empty(), MatchOptions.builder().build(), Optional.empty(), Optional.of("ba")); final Set<Pair<String, String>> result = backend .tagSuggest(request) .get() .getSuggestions() .stream() .map(s -> Pair.of(s.getKey(), s.getValue())) .collect(Collectors.toSet()); assertEquals(Collections.emptySet(), result); }</code><technical_language>Rogue empty line</technical_language>

Target:
public void tagSuggestNoIdx() throws Exception { final Set<Pair<String, String>> result = getTagSuggest(tagSuggestReq); assertEquals(Collections.emptySet(), result); }
Source:
<code><START> public List<EventType> list() { <END> return jdbcTemplate.query( "SELECT et_topic, et_event_type_object, et_deleted FROM zn_data.event_type WHERE et_deleted = FALSE", new EventTypeMapper()); }</code><technical_language>I adjust saving of event-type. current implementation for user delete event-type create another name (method throw DuplicatedEventTypeNameException)</technical_language>

Target:
public List<EventType> list() { return jdbcTemplate.query( "SELECT et_topic, et_event_type_object, et_archived FROM zn_data.event_type WHERE et_archived = FALSE", new EventTypeMapper()); }
Source:
<code>protected void initGenomixConfiguration() throws HyracksDataException { Configuration conf = hadoopJobConfFactory.getConf(); <START> Kmer.setGlobalKmerLength(Integer.parseInt(conf.get(GenomixJobConf.KMER_LENGTH))); <END> frameLimits = Integer.parseInt(conf.get(GenomixJobConf.FRAME_LIMIT)); frameSize = Integer.parseInt(conf.get(GenomixJobConf.FRAME_SIZE)); }</code><technical_language>missed this one</technical_language>

Target:
protected void initGenomixConfiguration() throws HyracksDataException { Configuration conf = hadoopJobConfFactory.getConf(); GenomixJobConf.setGlobalStaticConstants(conf); frameLimits = Integer.parseInt(conf.get(GenomixJobConf.FRAME_LIMIT)); frameSize = Integer.parseInt(conf.get(GenomixJobConf.FRAME_SIZE)); }
Source:
<code>public long persistDataset(final RelationKey relationKey) throws DbException, InterruptedException { long queryID; try { catalog.markRelationPersistent(relationKey); } catch (CatalogException e) { throw new DbException(e); } try { <START> Map<Integer, SubQueryPlan> workerPlans = new HashMap<>(); <END> for (Integer workerId : getWorkersForRelation(relationKey, null)) { String partitionName = String.format("hdfs://vega.cs.washington.edu:8020/partition%s/%s/%s/%s", workerId, relationKey .getUserName(), relationKey.getProgramName(), relationKey.getRelationName()); DataSink workerSink = new UriSink(partitionName); workerPlans.put(workerId, new SubQueryPlan(new DataOutput(new DbQueryScan(relationKey, getSchema(relationKey)), new HdfsTupleWriter(), workerSink))); } ListenableFuture<Query> qf = queryManager.submitQuery("persist " + relationKey.toString(), "persist " + relationKey.toString(), "persisting from " + relationKey.toString(getDBMS()), new SubQueryPlan(new SinkRoot(new EOSSource())), workerPlans); try { queryID = qf.get().getQueryId(); } catch (ExecutionException e) { throw new DbException("Error executing query", e.getCause()); } } catch (CatalogException e) { throw new DbException(e); } return queryID; }</code><technical_language>Nitpick: this ImmutableMap (with a builder)</technical_language>

Target:
public long persistDataset(final RelationKey relationKey) throws DbException, InterruptedException { long queryID; try { catalog.markRelationPersistent(relationKey); } catch (CatalogException e) { throw new DbException(e); } try { ImmutableMap.Builder<Integer, SubQueryPlan> workerPlans = new ImmutableMap.Builder<Integer, SubQueryPlan>(); for (Integer workerId : getWorkersForRelation(relationKey, null)) { String partitionName = String.format(persistURI + "/myria-system/partition-%s/%s/%s/%s", workerId, relationKey.getUserName(), relationKey.getProgramName(), relationKey.getRelationName()); DataSink workerSink = new UriSink(partitionName); workerPlans.put(workerId, new SubQueryPlan(new DataOutput(new DbQueryScan(relationKey, getSchema(relationKey)), new PostgresBinaryTupleWriter(), workerSink))); } ListenableFuture<Query> qf = queryManager.submitQuery("persist " + relationKey.toString(), "persist " + relationKey.toString(), "persisting from " + relationKey.toString(getDBMS()), new SubQueryPlan(new SinkRoot(new EOSSource())), workerPlans.build()); try { queryID = qf.get().getQueryId(); } catch (ExecutionException e) { throw new DbException("Error executing query", e.getCause()); } } catch (CatalogException e) { throw new DbException(e); } return queryID; }
Source:
<code>public void removeAuthToken(String xAuth) { if (Strings.isNullOrEmpty(xAuth)) { throw new IllegalArgumentException("No X-Auth-Token present"); } Optional<AuthenticationToken> tokenOptional = authenticationTokenRepository.findByToken(xAuth); <START> AuthenticationToken token = tokenOptional.orElseThrow(XAuthTokenNotFoundException::new); <END> if (!token.isValid()) { throw new InvalidTokenException(); } token.revoke(); authenticationTokenRepository.saveAndFlush(token); }</code><technical_language>This chained AuthenticationToken token = authenticationTokenRepository.findByToken(xAuth).orElseThrow(XAuthTokenNotFoundException::new);</technical_language>

Target:
public void removeAuthToken(String xAuth) { if (Strings.isNullOrEmpty(xAuth)) { throw new IllegalArgumentException("No X-Auth-Token present"); } AuthenticationToken token = authenticationTokenRepository.findByToken(xAuth).orElseThrow(XAuthTokenNotFoundException::new); if (!token.isValid()) { throw new InvalidTokenException(); } token.revoke(); authenticationTokenRepository.saveAndFlush(token); }
Source:
<code>public ObjectDirectory(final Config cfg, final File dir, File[] alternatePaths, FS fs, File shallowFile) throws IOException { config = cfg; objects = dir; <START> infoDirectory = new File(objects, "info"); END> packDirectory = fs.createFile(objects, "pack", config); alternatesFile = new File(infoDirectory, "alternates"); packList = new AtomicReference<PackList>(NO_PACKS); unpackedObjectCache = new UnpackedObjectCache(); this.fs = fs; this.shallowFile = shallowFile; alternates = new AtomicReference<AlternateHandle[]>(); if (alternatePaths != null) { AlternateHandle[] alt; alt = new AlternateHandle[alternatePaths.length]; for (int i = 0; i < alternatePaths.length; i++) alt[i] = openAlternate(alternatePaths[i]); alternates.set(alt); } }</code><technical_language>thought fs.createFile() for creating .pack files for .info .alternates files. inaccurate lastModified() exists() results more acceptable files</technical_language>

Target:
public ObjectDirectory(final Config cfg, final File dir, File[] alternatePaths, FS fs, File shallowFile) throws IOException { config = cfg; objects = dir; infoDirectory = fs.createFile(objects, "info", config); packDirectory = fs.createFile(objects, "pack", config); alternatesFile = fs.createFile(infoDirectory, "alternates", config); packList = new AtomicReference<PackList>(NO_PACKS); unpackedObjectCache = new UnpackedObjectCache(); this.fs = fs; this.shallowFile = shallowFile; alternates = new AtomicReference<AlternateHandle[]>(); if (alternatePaths != null) { AlternateHandle[] alt; alt = new AlternateHandle[alternatePaths.length]; for (int i = 0; i < alternatePaths.length; i++) alt[i] = openAlternate(alternatePaths[i]); alternates.set(alt); } }
Source:
<code>private void categorizeRequiredField(Element element, VariableElement variableElement) { if (Utils.isPrimitiveType(variableElement)) { Utils.error(String.format(Locale.US, <START> "@Required and @NotNull annotation is unnecessary for primitive field \"%s\".", element)); <END> return; } if (Utils.isRealmModel(variableElement)) { Utils.error(String.format(Locale.US, "Field \"%s\" with type \"%s\" cannot be @Required or @NotNull.", element, element.asType())); return; } if (nullableFields.contains(variableElement)) { Utils.error(String.format(Locale.US, "Field \"%s\" with type \"%s\" appears to be nullable. Consider removing @Required.", element, element.asType())); } }</code><technical_language>@Required @NotNull</technical_language>

Target:
private void categorizeRequiredField(Element element, VariableElement variableElement) { if (Utils.isPrimitiveType(variableElement)) { Utils.error(String.format(Locale.US, "@Required or @NotNull annotation is unnecessary for primitive field \"%s\".", element)); return; } if (Utils.isRealmModel(variableElement)) { Utils.error(String.format(Locale.US, "Field \"%s\" with type \"%s\" cannot be @Required or @NotNull.", element, element.asType())); return; } if (nullableFields.contains(variableElement)) { Utils.error(String.format(Locale.US, "Field \"%s\" with type \"%s\" appears to be nullable. Consider removing @Required.", element, element.asType())); } }
Source:
<code>public Publisher<Void> apply(HttpServerRequest httpRequest, HttpServerResponse httpResponse) { LOGGER.debug( "Accepted request: {}, headers: {}, params: {}", httpRequest, httpRequest.requestHeaders(), httpRequest.params()); if (httpRequest.method() != POST) { LOGGER.error("Unsupported HTTP method. Expected POST, actual {}", httpRequest.method()); return methodNotAllowed(httpResponse); } return httpRequest .receive() .aggregate() .switchIfEmpty( <START> Mono.defer(() -> ByteBufMono.just(ByteBufAllocator.DEFAULT.compositeBuffer()))) <END> .map(ByteBuf::retain) .doOnNext(content -> metrics.markRequest()) .flatMap(content -> handleRequest(content, httpRequest, httpResponse)) .doOnSuccess(avoid -> metrics.markResponse()) .onErrorResume(t -> error(httpResponse, DefaultErrorMapper.INSTANCE.toMessage(t))); }</code><technical_language>is composite buffer need empty buffer</technical_language>

Target:
public Publisher<Void> apply(HttpServerRequest httpRequest, HttpServerResponse httpResponse) { LOGGER.debug( "Accepted request: {}, headers: {}, params: {}", httpRequest, httpRequest.requestHeaders(), httpRequest.params()); if (httpRequest.method() != POST) { LOGGER.error("Unsupported HTTP method. Expected POST, actual {}", httpRequest.method()); return methodNotAllowed(httpResponse); } return httpRequest .receive() .aggregate() .switchIfEmpty(Mono.defer(() -> ByteBufMono.just(Unpooled.EMPTY_BUFFER))) .map(ByteBuf::retain) .doOnNext(content -> metrics.markRequest()) .flatMap(content -> handleRequest(content, httpRequest, httpResponse)) .doOnSuccess(avoid -> metrics.markResponse()) .onErrorResume(t -> error(httpResponse, DefaultErrorMapper.INSTANCE.toMessage(t))); }
Source:
<code><START> private void addOrUpdateActivity(ActivityPayload payload, UserAnonymizedDTO userAnonymized, Goal matchingGoal) <END> { Date minEndTime = new Date(payload.startTime.getTime() - yonaProperties.getAnalysisService().getConflictInterval()); DayActivity dayActivity = cacheService.fetchDayActivityForUser(userAnonymized.getID(), matchingGoal.getID(), getZonedStartOfDay(payload.startTime, userAnonymized)); Activity activity = dayActivity != null ? dayActivity.getLatestActivity() : null; if (activity == null || activity.getEndTime().before(minEndTime)) { dayActivity = createNewActivity(dayActivity, payload, userAnonymized, matchingGoal); cacheService.updateDayActivityForUser(dayActivity); if (matchingGoal.isNoGoGoal()) { sendConflictMessageToAllDestinationsOfUser(dayActivity, payload, userAnonymized, dayActivity.getLatestActivity(), matchingGoal); } } else if (payload.endTime.getTime() - activity.getEndTime().getTime() >= yonaProperties.getAnalysisService() .getUpdateSkipWindow() || payload.startTime.before(activity.getStartTime())) { updateLastActivity(dayActivity, payload, userAnonymized, matchingGoal, activity); cacheService.updateDayActivityForUser(dayActivity); } }</code><technical_language>This method is growing long. Please move branches if if/elsif separate methods</technical_language>

Target:
private void addOrUpdateActivity(ActivityPayload payload, UserAnonymizedDTO userAnonymized, Goal matchingGoal) { Date minEndTime = new Date(payload.startTime.getTime() - yonaProperties.getAnalysisService().getConflictInterval()); DayActivity dayActivity = cacheService.fetchDayActivityForUser(userAnonymized.getID(), matchingGoal.getID(), getStartOfDay(payload.startTime, userAnonymized)); Activity activity = dayActivity == null ? null : dayActivity.getLastActivity(); if (activity == null || activity.getEndTime().before(minEndTime)) { addActivity(payload, userAnonymized, matchingGoal, dayActivity); } else if (payload.endTime.getTime() - activity.getEndTime().getTime() >= yonaProperties.getAnalysisService() .getUpdateSkipWindow() || payload.startTime.before(activity.getStartTime())) { updateActivity(payload, userAnonymized, matchingGoal, dayActivity, activity); } }
Source:
<code>public Value<Boolean> hideEnchantments() { <START> return SpongeValueFactory.getInstance().createValue(Keys.HIDE_ENCHANTMENTS, enchantments, false); <END> }</code><technical_language>this., for remaining methods</technical_language>

Target:
public Value<Boolean> hideEnchantments() { return SpongeValueFactory.getInstance().createValue(Keys.HIDE_ENCHANTMENTS, this.enchantments, false); }
Source:
<code><START> private BootstrapContextCoordinator() <END> { this.bootstrapContexts = new ConcurrentHashMap<String, CloneableBootstrapContext>(); this.defaultBootstrapContext = null; this.workManagerCoordinator = null; this.activeBootstrapContexts = new HashMap<String, CloneableBootstrapContext>(); this.refCountBootstrapContexts = new HashMap<String, Integer>(); }</code><technical_language>public</technical_language>

Target:
public BootstrapContextCoordinator() { this.bootstrapContexts = new ConcurrentHashMap<String, CloneableBootstrapContext>(); this.defaultBootstrapContext = null; this.workManagerCoordinator = null; this.activeBootstrapContexts = new HashMap<String, CloneableBootstrapContext>(); this.refCountBootstrapContexts = new HashMap<String, Integer>(); }
Source:
<code>public ExportWiki(String url, String user, String password) throws AuthenticationException { BasicEndpoint basicEndpoint = new BasicEndpoint(); basicEndpoint.setUrl(url); basicEndpoint.setForceTrustSSLCertificate(true); <START> basicEndpoint.setUser(user); <END> basicEndpoint.setPassword(password); basicEndpoint.login(user, password); wikiService = new WikiService(); setEndpoint(basicEndpoint); }</code><technical_language>need setUser setPassword anymore if call login(user, password)</technical_language>

Target:
public ExportWiki(String url, String user, String password) throws AuthenticationException { BasicEndpoint basicEndpoint = new BasicEndpoint(); basicEndpoint.setUrl(url); basicEndpoint.setForceTrustSSLCertificate(true); basicEndpoint.login(user, password); wikiService = new WikiService(); setEndpoint(basicEndpoint); }
Source:
<code>public String getRequestUri() { <START> return wrapped.getRequestPath(); <END> }</code><technical_language>please leave - intentionally referencing deprecated version</technical_language>

Target:
public String getRequestUri() { return wrapped.getRequestUri(); }
Source:
<code>public DataContext create(DataContextProperties properties, ResourceFactoryRegistry resourceFactoryRegistry) { final AmazonDynamoDBClientBuilder clientBuilder = AmazonDynamoDBClientBuilder.standard().withCredentials(getCredentials(properties)); final Object region = properties.toMap().get("region"); <START> if (region != null && region instanceof String) { <END> clientBuilder.setRegion(region.toString()); } final AmazonDynamoDB client = clientBuilder.build(); final SimpleTableDef[] tableDefs = properties.getTableDefs(); return new DynamoDbDataContext(client, tableDefs); }</code><technical_language>Unneeded null check</technical_language>

Target:
public DataContext create(DataContextProperties properties, ResourceFactoryRegistry resourceFactoryRegistry) { final AmazonDynamoDBClientBuilder clientBuilder = AmazonDynamoDBClientBuilder.standard().withCredentials(getCredentials(properties)); final Object region = properties.toMap().get("region"); if (region instanceof String) { clientBuilder.setRegion((String) region); } final AmazonDynamoDB client = clientBuilder.build(); final SimpleTableDef[] tableDefs = properties.getTableDefs(); return new DynamoDbDataContext(client, tableDefs); }
Source:
<code>public void process(EquivalentContentUpdatedMessage message) throws RecoverableException { Id contentId = message.getContentRef().getId(); <START> log.debug("Processing message on id {}, took PT{}S, message: {}", <END> contentId, getTimeToProcessInSeconds(message)); Timer.Context time = timer.time(); try { Content content = getContent(contentId); neo4JContentStore.writeContent(content); time.stop(); } catch (Exception e) { failureMeter.mark(); throw Throwables.propagate(e); } }</code><technical_language>passing in message a marker there. throw weird RTEs</technical_language>

Target:
public void process(EquivalentContentUpdatedMessage message) throws RecoverableException { Id contentId = message.getContentRef().getId(); log.debug("Processing message on id {}, took PT{}S, message: {}", contentId, getTimeToProcessInSeconds(message), message); Timer.Context time = timer.time(); try { Content content = getContent(contentId); neo4JContentStore.writeContent(content); time.stop(); } catch (Exception e) { failureMeter.mark(); throw Throwables.propagate(e); } }