auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static int getDeviceConfigPropertyInt(@NonNull String namespace, @NonNull String name, int defaultValue) { String value = getDeviceConfigProperty(namespace, name, null ); try { return (value != null) ? Integer.parseInt(value) : defaultValue; } catch (NumberFormatException | <START> NullPointerException e) <END> { return defaultValue; } }</code><technical_language>In scenarios is this</technical_language>

Target:
public static int getDeviceConfigPropertyInt(@NonNull String namespace, @NonNull String name, int defaultValue) { String value = getDeviceConfigProperty(namespace, name, null ); try { return (value != null) ? Integer.parseInt(value) : defaultValue; } catch (NumberFormatException e) { return defaultValue; } }
Source:
<code>public ValueHolder<V> get(final K key) throws StoreAccessException { Chain chain = storeProxy.get(key.hashCode()); V value = null; if(!chain.isEmpty()) { ResolvedChain<K, V> resolvedChain = resolver.resolve(chain, key); Chain compactedChain = resolvedChain.getCompactedChain(); storeProxy.replaceAtHead(key.hashCode(), chain, compactedChain); Operation<K, V> resolvedOperation = resolvedChain.getResolvedOperation(key); if(resolvedOperation != null) { value = resolvedOperation.getValue(); } } <START> return new ClusteredValueHolder<V>(value); <END> }</code><technical_language>changes, this is longer correct. A ValueHolder a null. need return null instead</technical_language>

Target:
public ValueHolder<V> get(final K key) throws StoreAccessException { Chain chain = storeProxy.get(key.hashCode()); V value = null; if(!chain.isEmpty()) { ResolvedChain<K, V> resolvedChain = resolver.resolve(chain, key); Chain compactedChain = resolvedChain.getCompactedChain(); storeProxy.replaceAtHead(key.hashCode(), chain, compactedChain); Result<V> resolvedResult = resolvedChain.getResolvedResult(key); if(resolvedResult != null) { value = resolvedResult.getValue(); } else { return null; } } else { return null; } return new ClusteredValueHolder<V>(value); }
Source:
<code>public long countPhenotypesForDataset(final Integer datasetId, final List<Integer> traitIds) { <START> final SQLQuery query = this.getSession().createSQLQuery( <END> "SELECT COUNT(1) FROM phenotype ph " + "INNER JOIN nd_experiment e ON ph.nd_experiment_id = e.nd_experiment_id " + "WHERE e.project_id = :datasetId AND observable_id in (:traitIds);"); query.setParameter("datasetId", datasetId); query.setParameterList(TRAIT_IDS, traitIds); return ((BigInteger) query.uniqueResult()).longValue(); }</code><technical_language>start criterias possible, understanding model is a bit tricky. This simple written Criteria</technical_language>

Target:
public long countPhenotypesForDataset(final Integer datasetId, final List<Integer> traitIds) { final Criteria criteria = this.getSession().createCriteria(Phenotype.class); criteria.createAlias("experiment", "experiment"); criteria.add(Restrictions.eq("experiment.project.projectId", datasetId)); criteria.add(Restrictions.in("observableId", traitIds)); criteria.setProjection(Projections.rowCount()); return (Long) criteria.uniqueResult(); }
Source:
<code>public boolean applyDetermination(ScriptPath path, ObjectTag determinationObj) { <START> if (determinationObj instanceof LocationTag) { <END> event.getAcceleration().copy(((LocationTag) determinationObj).toVector()); return true; } return super.applyDetermination(path, determinationObj); }</code><technical_language>a reliable check, object is guaranteed of expected type fed in, LocationTag.matches + valueOf required. Also, !isDefaultDetermination</technical_language>

Target:
public boolean applyDetermination(ScriptPath path, ObjectTag determinationObj) { if (!isDefaultDetermination(determinationObj)) { String determination = determinationObj.toString(); if (LocationTag.matches(determination)) { event.getAcceleration().copy((LocationTag.valueOf(determination)).toVector()); return true; } } return super.applyDetermination(path, determinationObj); }
Source:
<code>private static String _getEngineSSHPublicKey() { String keystoreFile = Config.<String>GetValue(ConfigValues.keystoreUrl); String alias = Config.<String>GetValue(ConfigValues.CertAlias); InputStream in = null; try { in = new FileInputStream(keystoreFile); KeyStore ks = KeyStore.getInstance("PKCS12"); ks.load( in, <START> Config.<String>GetValue(ConfigValues.keystorePass).toCharArray() <END> ); Certificate cert = ks.getCertificate(alias); if (cert == null) { throw new KeyStoreException( String.format( "Failed to find certificate store '%1$s' using alias '%2$s'", keystoreFile, alias ) ); } return OpenSSHUtils.getKeyString( cert.getPublicKey(), Config.<String>GetValue(ConfigValues.SSHKeyAlias) ); } catch (Exception e) { throw new RuntimeException( String.format( "Failed to decode own public key from store '%1$s' using alias '%2$s'", keystoreFile, alias ), e ); } finally { if (in != null) { try { in.close(); } catch(IOException e) { log.error("Cannot close key store", e); } } } }</code><technical_language>Another leaked password</technical_language>

Target:
private static String _getEngineSSHPublicKey() { String keystoreFile = Config.<String>GetValue(ConfigValues.keystoreUrl); String alias = Config.<String>GetValue(ConfigValues.CertAlias); char[] password = Config.<String>GetValue(ConfigValues.keystorePass).toCharArray(); InputStream in = null; try { in = new FileInputStream(keystoreFile); KeyStore ks = KeyStore.getInstance("PKCS12"); ks.load(in, password); final Certificate cert = ks.getCertificate(alias); if (cert == null) { throw new KeyStoreException( String.format( "Failed to find certificate store '%1$s' using alias '%2$s'", keystoreFile, alias ) ); } return OpenSSHUtils.getKeyString( cert.getPublicKey(), Config.<String>GetValue(ConfigValues.SSHKeyAlias) ); } catch (Exception e) { throw new RuntimeException( String.format( "Failed to decode own public key from store '%1$s' using alias '%2$s'", keystoreFile, alias ), e ); } finally { Arrays.fill(password, '*'); if (in != null) { try { in.close(); } catch(IOException e) { log.error("Cannot close key store", e); } } } }
Source:
<code>public Secret(ModelNode node, IClient client, Map<String, String []> propertyKeys) { super(node, client, propertyKeys); <START> initializeCapabilities(getModifiableCapabilities(), this, getClient()); <END> }</code><technical_language>This is required initializing specific capabilites apply a Secret kind</technical_language>

Target:
public Secret(ModelNode node, IClient client, Map<String, String []> propertyKeys) { super(node, client, propertyKeys); }
Source:
<code>public @Bean OrganisationStore organisationStore() { LookupEntryStore organisationLookupEntryStore = new MongoLookupEntryStore(db.collection("organisationLookup")); OrganisationStore organisationStore = new MongoOrganisationStore(db, TransitiveLookupWriter.explicitTransitiveLookupWriter(organisationLookupEntryStore), organisationLookupEntryStore, persistenceAuditLog()); if (Boolean.valueOf(generateIds)) { <START> organisationStore = new IdSettingOrganisationStore(organisationStore, new MongoSequentialIdGenerator(db, "content")); <END> } return organisationStore; }</code><technical_language>wiring in a MongoSequentialIdGenerator keyed content, eventStore keyed events. latter, no</technical_language>

Target:
public @Bean OrganisationStore organisationStore() { LookupEntryStore organisationLookupEntryStore = new MongoLookupEntryStore(db.collection("organisationLookup")); OrganisationStore organisationStore = new MongoOrganisationStore(db, TransitiveLookupWriter.explicitTransitiveLookupWriter(organisationLookupEntryStore), organisationLookupEntryStore, persistenceAuditLog()); if (Boolean.valueOf(generateIds)) { organisationStore = new IdSettingOrganisationStore(organisationStore, new MongoSequentialIdGenerator(db, "organisations")); } return organisationStore; }
Source:
<code>private Class<?> findMySqlDriverClass() { Class<?> foundClass = null; for (String knownCleanupThreadClassAddress : CONNECTION_CLEANUP_THREAD_KNOWN_CLASS_ADDRESES) { try { foundClass = this.getClass().getClassLoader().loadClass(knownCleanupThreadClassAddress); } catch (ClassNotFoundException e) { logger.warn("No AbandonedConnectionCleanupThread registered with class address " + knownCleanupThreadClassAddress); } } <START> return foundClass; <END> }</code><technical_language>return null, return Optional fail a ClassNotFound a clear message of classes for cleanup</technical_language>

Target:
private Class<?> findMySqlDriverClass() throws ClassNotFoundException { Class<?> foundClass = null; for (String knownCleanupThreadClassAddress : CONNECTION_CLEANUP_THREAD_KNOWN_CLASS_ADDRESES) { try { return this.getClass().getClassLoader().loadClass(knownCleanupThreadClassAddress); } catch (ClassNotFoundException e) { logger.warn("No AbandonedConnectionCleanupThread registered with class address " + knownCleanupThreadClassAddress); } } throw new ClassNotFoundException("No MySql's AbandonedConnectionCleanupThread class was found"); }
Source:
<code>public List<CramCompressionRecord> getRecords(final Container container, ArrayList<CramCompressionRecord> records, final ValidationStringency validationStringency) throws IllegalArgumentException, IllegalAccessException { if (container.isEOF()) return Collections.emptyList(); final long time1 = System.nanoTime(); if (records == null) { records = new ArrayList<>(container.nofRecords); <START> } <END> for (final Slice slice : container.slices) { records.addAll(getRecords(slice, container.header, validationStringency)); } final long time2 = System.nanoTime(); container.parseTime = time2 - time1; return records; }</code><technical_language>remove of timing code while (i.e. final long time1 = System.nanoTime();, etc.). in next PR</technical_language>

Target:
public List<CramCompressionRecord> getRecords(final Container container, ArrayList<CramCompressionRecord> records, final ValidationStringency validationStringency) throws IllegalArgumentException, IllegalAccessException { if (container.isEOF()) { return Collections.emptyList(); } if (records == null) { records = new ArrayList<>(container.nofRecords); } for (final Slice slice : container.slices) { records.addAll(getRecords(slice, container.header, validationStringency)); } return records; }
Source:
<code>public void loadMoreProcessInstanceLogs() { setCurrentPage(currentPage + 1); <START> displayVisibleLogs(); <END> }</code><technical_language>call _loadTaskLogs_</technical_language>

Target:
public void loadMoreProcessInstanceLogs() { setCurrentPage(currentPage + 1); loadTaskLogs(); }
Source:
<code>protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { HttpSession session = req.getSession(); Matcher keyMatched = putKeyPattern.matcher(req.getRequestURI()); if (keyMatched.find()) { String[] split = keyMatched.group().split("/"); String key = split[1]; String value = split[2]; <START> System.out.println("put sessionId="+session.getId()+" key="+key+" val="+value); <END> session.setAttribute(key, value); resp.getWriter().write(value.toString()); } }</code><technical_language>Replace logging + if(logenabled) check</technical_language>

Target:
protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { HttpSession session = req.getSession(); Matcher keyMatched = putKeyPattern.matcher(req.getRequestURI()); if (keyMatched.find()) { String[] split = keyMatched.group().split("/"); String key = split[1]; String value = split[2]; session.setAttribute(key, value); resp.getWriter().write(value.toString()); } }
Source:
<code>public static List<TimelineObjectHolder<String, DataSegment>> getTimelineForSegmentIds( CoordinatorClient coordinatorClient, String dataSource, List<WindowedSegmentId> segmentIds ) { final SortedMap<Interval, TimelineObjectHolder<String, DataSegment>> timeline = new TreeMap<>( Comparators.intervalsByStartThenEnd() ); for (WindowedSegmentId windowedSegmentId : Preconditions.checkNotNull(segmentIds, "segmentIds")) { <START> final DataSegment segment = coordinatorClient.fetchSegment( <END> dataSource, windowedSegmentId.getSegmentId() ); for (Interval interval : windowedSegmentId.getIntervals()) { final TimelineObjectHolder<String, DataSegment> existingHolder = timeline.get(interval); if (existingHolder != null) { if (!existingHolder.getVersion().equals(segment.getVersion())) { throw new ISE("Timeline segments with the same interval should have the same version: " + "existing version[%s] vs new segment[%s]", existingHolder.getVersion(), segment); } existingHolder.getObject().add(segment.getShardSpec().createChunk(segment)); } else { timeline.put( interval, new TimelineObjectHolder<>( interval, segment.getInterval(), segment.getVersion(), new PartitionHolder<>(segment.getShardSpec().createChunk(segment)) ) ); } } } Interval lastInterval = null; for (Interval interval : timeline.keySet()) { if (lastInterval != null && interval.overlaps(lastInterval)) { throw new IAE( "Distinct intervals in input segments may not overlap: [%s] vs [%s]", lastInterval, interval ); } lastInterval = interval; } return new ArrayList<>(timeline.values()); }</code><technical_language>Suggest fetchUsedSegments</technical_language>

Target:
public static List<TimelineObjectHolder<String, DataSegment>> getTimelineForSegmentIds( CoordinatorClient coordinatorClient, String dataSource, List<WindowedSegmentId> segmentIds ) { final SortedMap<Interval, TimelineObjectHolder<String, DataSegment>> timeline = new TreeMap<>( Comparators.intervalsByStartThenEnd() ); for (WindowedSegmentId windowedSegmentId : Preconditions.checkNotNull(segmentIds, "segmentIds")) { final DataSegment segment = coordinatorClient.fetchUsedSegment( dataSource, windowedSegmentId.getSegmentId() ); for (Interval interval : windowedSegmentId.getIntervals()) { final TimelineObjectHolder<String, DataSegment> existingHolder = timeline.get(interval); if (existingHolder != null) { if (!existingHolder.getVersion().equals(segment.getVersion())) { throw new ISE("Timeline segments with the same interval should have the same version: " + "existing version[%s] vs new segment[%s]", existingHolder.getVersion(), segment); } existingHolder.getObject().add(segment.getShardSpec().createChunk(segment)); } else { timeline.put( interval, new TimelineObjectHolder<>( interval, segment.getInterval(), segment.getVersion(), new PartitionHolder<>(segment.getShardSpec().createChunk(segment)) ) ); } } } Interval lastInterval = null; for (Interval interval : timeline.keySet()) { if (lastInterval != null && interval.overlaps(lastInterval)) { throw new IAE( "Distinct intervals in input segments may not overlap: [%s] vs [%s]", lastInterval, interval ); } lastInterval = interval; } return new ArrayList<>(timeline.values()); }
Source:
<code>public void sendMail(String reply, String to, String subject, String messageText, Map<Object, Object> extraHeaders) { try { MimeMessage msg = new MimeMessage(session); InternetAddress fromAddress=getSystemAddress(); try { <START> fromAddress.setPersonal(fromAddress.getPersonal() + "on behalf of " + reply, charset); <END> } catch (UnsupportedEncodingException ex) { logger.severe(ex.getMessage()); } msg.setFrom(fromAddress); if (reply.matches(EMAIL_PATTERN)) { msg.setReplyTo(new Address[] {new InternetAddress(reply)}); } else { messageText = "From: " + reply + "\n\n" + messageText; } msg.setSentDate(new Date()); msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false)); msg.setSubject(subject, charset); msg.setText(messageText, charset); if (extraHeaders != null) { for (Object key : extraHeaders.keySet()) { String headerName = key.toString(); String headerValue = extraHeaders.get(key).toString(); msg.addHeader(headerName, headerValue); } } Transport.send(msg); } catch (AddressException ae) { ae.printStackTrace(System.out); } catch (MessagingException me) { me.printStackTrace(System.out); } }</code><technical_language>a space "on" internationalization</technical_language>

Target:
public void sendMail(String reply, String to, String subject, String messageText, Map<Object, Object> extraHeaders) { try { MimeMessage msg = new MimeMessage(session); InternetAddress fromAddress=getSystemAddress(); try { fromAddress.setPersonal(BundleUtil.getStringFromBundle("contact.delegation", Arrays.asList( fromAddress.getPersonal(), reply)), charset); } catch (UnsupportedEncodingException ex) { logger.severe(ex.getMessage()); } msg.setFrom(fromAddress); if (reply.matches(EMAIL_PATTERN)) { msg.setReplyTo(new Address[] {new InternetAddress(reply)}); } else { messageText = "From: " + reply + "\n\n" + messageText; } msg.setSentDate(new Date()); msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false)); msg.setSubject(subject, charset); msg.setText(messageText, charset); if (extraHeaders != null) { for (Object key : extraHeaders.keySet()) { String headerName = key.toString(); String headerValue = extraHeaders.get(key).toString(); msg.addHeader(headerName, headerValue); } } Transport.send(msg); } catch (AddressException ae) { ae.printStackTrace(System.out); } catch (MessagingException me) { me.printStackTrace(System.out); } }
Source:
<code>private void stopClientAwakeTimer() { try { timerSemaphore.acquire(); } catch (InterruptedException e) { <START> e.printStackTrace(); <END> } if (clientAwakeTimer != null) { clientAwakeTimer.cancel(); clientAwakeTimer.purge(); } timerSemaphore.release(); }</code><technical_language>ugh .</technical_language>

Target:
private void stopClientAwakeTimer() { try { try { timerSemaphore.acquire(); if (clientAwakeTimer != null) { clientAwakeTimer.cancel(); clientAwakeTimer.purge(); } } finally { timerSemaphore.release(); } } catch (InterruptedException e) { LOG.warn("Unable to stop the client timer due to semaphore exception", e); } }
Source:
<code>public void testComputeResult() { BaseAverager<Number, Double> avg = new LongMeanAverager(3, "test", "field", 1); assertEquals(0.0, avg.computeResult(), 0.0); avg.addElement(Collections.singletonMap("field", 3L), new HashMap<>()); assertEquals(1.0, avg.computeResult(), 0.0); avg.addElement(Collections.singletonMap("field", 3L), new HashMap<>()); assertEquals(2.0, avg.computeResult(), 0.0); <START> avg.addElement(Collections.singletonMap("field", new Integer(3)), new HashMap<>()); <END> assertEquals(3.0, avg.computeResult(), 0.0); avg.addElement(Collections.singletonMap("field", 2L), new HashMap<>()); avg.addElement(Collections.singletonMap("field", 2L), new HashMap<>()); avg.addElement(Collections.singletonMap("field", 2L), new HashMap<>()); assertEquals(2.0, avg.computeResult(), 0.0); avg.skip(); assertEquals(4.0 / 3, avg.computeResult(), 0.0); }</code><technical_language>simply 3</technical_language>

Target:
public void testComputeResult() { BaseAverager<Number, Double> avg = new LongMeanAverager(3, "test", "field", 1); assertEquals(0.0, avg.computeResult(), 0.0); avg.addElement(Collections.singletonMap("field", 3L), new HashMap<>()); assertEquals(1.0, avg.computeResult(), 0.0); avg.addElement(Collections.singletonMap("field", 3L), new HashMap<>()); assertEquals(2.0, avg.computeResult(), 0.0); avg.addElement(Collections.singletonMap("field", 3), new HashMap<>()); assertEquals(3.0, avg.computeResult(), 0.0); avg.addElement(Collections.singletonMap("field", 2L), new HashMap<>()); avg.addElement(Collections.singletonMap("field", 2L), new HashMap<>()); avg.addElement(Collections.singletonMap("field", 2L), new HashMap<>()); assertEquals(2.0, avg.computeResult(), 0.0); avg.skip(); assertEquals(4.0 / 3, avg.computeResult(), 0.0); }
Source:
<code>JpegInputStream(final int[] interval) { <START> this.interval = interval; <END> this.nextPos = 0; }</code><technical_language>this.interval = Arrays.copyOf(interval, interval.length); prevent mutability issues? if is risk (i.e. if internal only, risk, a good idea play defensively here)</technical_language>

Target:
JpegInputStream(final int[] interval) { this.interval = Arrays.copyOf(interval, interval.length); this.nextPos = 0; }
Source:
<code>private void freePartitions(final Collection<EventTypePartition> keys) { RuntimeException exceptionCaught = null; for (final EventTypePartition partitionKey : keys) { uncommittedOffsets.remove(partitionKey); final ZkSubscription<SubscriptionCursorWithoutToken> listener = listeners.remove(partitionKey); if (null != listener) { try { listener.close(); } catch (final RuntimeException ex) { exceptionCaught = ex; <START> TracingService.logErrorInSpan(getContext().getCurrentSpan(), <END> String.format("Failed to cancel offsets listener {}", listener, ex.getMessage())); getLog().error("Failed to cancel offsets listener {}", listener, ex); } } } getZk().runLocked(() -> getZk().transfer(getSessionId(), keys)); if (null != exceptionCaught) { throw exceptionCaught; } }</code><technical_language>user need it, is internal exception, track in logs</technical_language>

Target:
private void freePartitions(final Collection<EventTypePartition> keys) { RuntimeException exceptionCaught = null; for (final EventTypePartition partitionKey : keys) { uncommittedOffsets.remove(partitionKey); final ZkSubscription<SubscriptionCursorWithoutToken> listener = listeners.remove(partitionKey); if (null != listener) { try { listener.close(); } catch (final RuntimeException ex) { exceptionCaught = ex; getLog().error("Failed to cancel offsets listener {}", listener, ex); } } } getZk().runLocked(() -> getZk().transfer(getSessionId(), keys)); if (null != exceptionCaught) { throw exceptionCaught; } }
Source:
<code>private <T extends Closeable> OutputStream writeArchive(Format<T> fmt) { try { try (TreeWalk walk = new TreeWalk(repo); RevWalk rw = new RevWalk(walk.getObjectReader()); T outa = fmt.createArchiveOutputStream(out, formatOptions)) { String pfx = prefix == null ? "" : prefix; MutableObjectId idBuf = new MutableObjectId(); ObjectReader reader = walk.getObjectReader(); walk.reset(rw.parseTree(tree)); <START> RevObject o = rw.parseAny(tree); <END> if (!paths.isEmpty()) walk.setFilter(PathFilterGroup.createFromStrings(paths)); if (pfx.endsWith("/")) { fmt.putEntry(outa, o, pfx.replaceAll("[/]+$", "/"), FileMode.TREE, null); } while (walk.next()) { String name = pfx + walk.getPathString(); FileMode mode = walk.getFileMode(0); if (walk.isSubtree()) walk.enterSubtree(); if (mode == FileMode.GITLINK) mode = FileMode.TREE; if (mode == FileMode.TREE) { fmt.putEntry(outa, o, name + "/", mode, null); continue; } walk.getObjectId(idBuf, 0); fmt.putEntry(outa, o, name, mode, reader.open(idBuf)); } return out; } finally { out.close(); } } catch (IOException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfArchiveCommand, e); } }</code><technical_language>parse (parseTree parseAny)? Besides, parseTree peels, parseAny doesn't</technical_language>

Target:
private <T extends Closeable> OutputStream writeArchive(Format<T> fmt) { try { try (TreeWalk walk = new TreeWalk(repo); RevWalk rw = new RevWalk(walk.getObjectReader()); T outa = fmt.createArchiveOutputStream(out, formatOptions)) { String pfx = prefix == null ? "" : prefix; MutableObjectId idBuf = new MutableObjectId(); ObjectReader reader = walk.getObjectReader(); RevObject o = rw.peel(rw.parseAny(tree)); final RevTree t; if (o instanceof RevCommit) { t = ((RevCommit) o).getTree(); } else if (!(o instanceof RevTree)) { throw new IncorrectObjectTypeException(tree.toObjectId(), Constants.TYPE_TREE); } else { t = (RevTree) o; } walk.reset(t); if (!paths.isEmpty()) walk.setFilter(PathFilterGroup.createFromStrings(paths)); if (pfx.endsWith("/")) { fmt.putEntry(outa, o, pfx.replaceAll("[/]+$", "/"), FileMode.TREE, null); } while (walk.next()) { String name = pfx + walk.getPathString(); FileMode mode = walk.getFileMode(0); if (walk.isSubtree()) walk.enterSubtree(); if (mode == FileMode.GITLINK) mode = FileMode.TREE; if (mode == FileMode.TREE) { fmt.putEntry(outa, o, name + "/", mode, null); continue; } walk.getObjectId(idBuf, 0); fmt.putEntry(outa, o, name, mode, reader.open(idBuf)); } return out; } finally { out.close(); } } catch (IOException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfArchiveCommand, e); } }
Source:
<code>public ResponseEntity postEvent(@PathVariable final String eventTypeName, @RequestBody final String eventsAsString, final NativeWebRequest nativeWebRequest) { LOG.trace("Received event for event type {}", eventsAsString, eventTypeName); final EventTypeMetrics eventTypeMetrics = eventTypeMetricRegistry.metricsFor(eventTypeName); try { final ResponseEntity response = postEventInternal(eventTypeName, eventsAsString, nativeWebRequest, eventTypeMetrics); eventTypeMetrics.incrementResponseCount(response.getStatusCode().value()); return response; } catch (RuntimeException ex) { <START> eventTypeMetrics.incrementResponseCount(-1); END> throw ex; } }</code><technical_language>This result in a 500, it</technical_language>

Target:
public ResponseEntity postEvent(@PathVariable final String eventTypeName, @RequestBody final String eventsAsString, final NativeWebRequest nativeWebRequest) { LOG.trace("Received event for event type {}", eventsAsString, eventTypeName); final EventTypeMetrics eventTypeMetrics = eventTypeMetricRegistry.metricsFor(eventTypeName); try { final ResponseEntity response = postEventInternal(eventTypeName, eventsAsString, nativeWebRequest, eventTypeMetrics); eventTypeMetrics.incrementResponseCount(response.getStatusCode().value()); return response; } catch (RuntimeException ex) { eventTypeMetrics.incrementResponseCount(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); throw ex; } }
Source:
<code>public void testShutdownOutputWithoutOption(ServerBootstrap sb) throws Throwable { TestHandler h = new TestHandler(); Socket s = newSocket(); Channel sc = null; try { sc = sb.childHandler(h).bind().sync().channel(); connect(s, sc.localAddress()); write(s, 1); assertEquals(1, (int) h.queue.take()); assertTrue(h.ch.isOpen()); assertTrue(h.ch.isActive()); assertFalse(h.ch.isInputShutdown()); assertFalse(h.ch.isOutputShutdown()); shutdownOutput(s); h.closure.await(); assertFalse(h.ch.isOpen()); assertFalse(h.ch.isActive()); assertTrue(h.ch.isInputShutdown()); assertTrue(h.ch.isOutputShutdown()); assertEquals(1, h.halfClosure.getCount()); Thread.sleep(100); <START> assertEquals(0, h.halfClosureCount.intValue()); <END> } finally { if (sc != null) { sc.close(); } close(s); } }</code><technical_language>@zhongl I if do this reduce risk of false-positives: while (h.halfClosure.getCount() != 1 && h.halfClosureCount.intValue() != 0) { Thread.sleep(100); } ensure a timeout in @Test declaration end in endless loop if wrong</technical_language>

Target:
public void testShutdownOutputWithoutOption(ServerBootstrap sb) throws Throwable { TestHandler h = new TestHandler(); Socket s = newSocket(); Channel sc = null; try { sc = sb.childHandler(h).bind().sync().channel(); connect(s, sc.localAddress()); write(s, 1); assertEquals(1, (int) h.queue.take()); assertTrue(h.ch.isOpen()); assertTrue(h.ch.isActive()); assertFalse(h.ch.isInputShutdown()); assertFalse(h.ch.isOutputShutdown()); shutdownOutput(s); h.closure.await(); assertFalse(h.ch.isOpen()); assertFalse(h.ch.isActive()); assertTrue(h.ch.isInputShutdown()); assertTrue(h.ch.isOutputShutdown()); while (h.halfClosure.getCount() != 1 && h.halfClosureCount.intValue() != 0) { Thread.sleep(100); } } finally { if (sc != null) { sc.close(); } close(s); } }
Source:
<code>public void accept(Event<CcmKeyDeregistrationRequest> requestEvent) { CcmKeyDeregistrationRequest request = requestEvent.getData(); if (Boolean.TRUE.equals(request.getUseCcm())) { LOGGER.debug("De-registering CCM key for freeipa stack {}", request.getResourceId()); try { <START> if (!entitlementService.ccmV2Enabled(request.getAccountId())) { <END> ccmResourceTerminationListener.deregisterCcmSshTunnelingKey(request.getActorCrn(), request.getAccountId(), request.getKeyId(), request.getMinaSshdServiceId()); } else { ccmV2AgentTerminationListener.deregisterInvertingProxyAgent(request.getCcmV2AgentCrn()); } } catch (Exception ex) { LOGGER.warn("CCM key de-registration failed", ex); } } else { LOGGER.info("CCM is DISABLED, skipping de-registering of key from CCM. FreeIPA stack: {}", request.getResourceId()); } Selectable result = new CcmKeyDeregistrationFinished(request.getResourceId(), request.getForced()); eventBus.notify(result.selector(), new Event<>(requestEvent.getHeaders(), result)); }</code><technical_language>for this handler. depend tunnel, entitlement</technical_language>

Target:
public void accept(Event<CcmKeyDeregistrationRequest> requestEvent) { CcmKeyDeregistrationRequest request = requestEvent.getData(); try { if (request.getTunnel().useCcmV1()) { LOGGER.debug("De-registering CCM key '{}' for freeipa stack '{}'", request.getMinaSshdServiceId(), request.getResourceId()); ccmResourceTerminationListener.deregisterCcmSshTunnelingKey(request.getActorCrn(), request.getAccountId(), request.getKeyId(), request.getMinaSshdServiceId()); LOGGER.debug("De-registered CCM key '{}' for freeipa stack '{}'", request.getMinaSshdServiceId(), request.getResourceId()); } else if (request.getTunnel().useCcmV2()) { LOGGER.debug("De-registering CCM V2 key '{}' for freeipa stack {}", request.getCcmV2AgentCrn(), request.getResourceId()); ccmV2AgentTerminationListener.deregisterInvertingProxyAgent(request.getCcmV2AgentCrn()); LOGGER.debug("De-registered CCM V2 key '{}' for freeipa stack {}", request.getCcmV2AgentCrn(), request.getResourceId()); } else { LOGGER.debug("CCM is DISABLED, skipping de-registering of key from CCM. FreeIPA stack: {}", request.getResourceId()); } } catch (Exception ex) { LOGGER.warn("CCM key de-registration failed", ex); } Selectable result = new CcmKeyDeregistrationFinished(request.getResourceId(), request.getForced()); eventBus.notify(result.selector(), new Event<>(requestEvent.getHeaders(), result)); }
Source:
<code>public void testLoadingListenersFromConfiguration() { StreamExecutionEnvironment envFromConfiguration = StreamExecutionEnvironment.getExecutionEnvironment(); List<Class> listenersClass = Arrays.asList(BasicJobSubmittedCounter.class, BasicJobExecutedCounter.class); Configuration configuration = new Configuration(); configuration.setString("execution.job-listeners", listenersClass.stream().map(l -> l.getName()).collect(Collectors.joining(";"))); <START> <END> envFromConfiguration.configure(configuration, Thread.currentThread().getContextClassLoader()); assertEquals(envFromConfiguration.getJobListeners().size(), 2); assertThat(envFromConfiguration.getJobListeners().get(0), instanceOf(BasicJobSubmittedCounter.class)); assertThat(envFromConfiguration.getJobListeners().get(1), instanceOf(BasicJobExecutedCounter.class)); }</code><technical_language>ConfigUtils#encodeCollectionToConfig()</technical_language>

Target:
public void testLoadingListenersFromConfiguration() { StreamExecutionEnvironment envFromConfiguration = StreamExecutionEnvironment.getExecutionEnvironment(); List<Class> listenersClass = Arrays.asList(BasicJobSubmittedCounter.class, BasicJobExecutedCounter.class); Configuration configuration = new Configuration(); ConfigUtils.encodeCollectionToConfig(configuration, DeploymentOptions.JOB_LISTENERS, listenersClass, Class::getName); envFromConfiguration.configure(configuration, Thread.currentThread().getContextClassLoader()); assertEquals(envFromConfiguration.getJobListeners().size(), 2); assertThat(envFromConfiguration.getJobListeners().get(0), instanceOf(BasicJobSubmittedCounter.class)); assertThat(envFromConfiguration.getJobListeners().get(1), instanceOf(BasicJobExecutedCounter.class)); }
Source:
<code>public CompletableFuture<ClientResponse> run() { if (VoltDB.instance().getReplicationRole() == ReplicationRole.NONE) { return makeQuickResponse(ClientResponse.GRACEFUL_FAILURE, "@Promote issued on non-replica cluster. No action taken."); } if (!allowPausedModeWork(false, isAdminConnection())) { return makeQuickResponse( ClientResponse.SERVER_UNAVAILABLE, "Server is paused and is available in read-only mode - please try again later."); } boolean useDDLSchema = VoltDB.instance().getCatalogContext().cluster.getUseddlschema(); return updateApplication("@UpdateApplicationCatalog", null, null, <START> new String[0], new ArrayList<>(), <END> null, true, useDDLSchema); }</code><technical_language>Collections.emptyList() placement of argument match formatting</technical_language>

Target:
public CompletableFuture<ClientResponse> run() { if (VoltDB.instance().getReplicationRole() == ReplicationRole.NONE) { return makeQuickResponse(ClientResponse.GRACEFUL_FAILURE, "@Promote issued on non-replica cluster. No action taken."); } if (!allowPausedModeWork(false, isAdminConnection())) { return makeQuickResponse( ClientResponse.SERVER_UNAVAILABLE, "Server is paused and is available in read-only mode - please try again later."); } boolean useDDLSchema = VoltDB.instance().getCatalogContext().cluster.getUseddlschema(); return updateApplication("@UpdateApplicationCatalog", null, null, new String[0], Collections.emptyList(), null, true, useDDLSchema); }
Source:
<code>public List<Set<String>> groupByRelatedSourceEvents(Set<String> sources) { Multimap<Set<String>, Set<String>> allEventsToSourceEvents = HashMultimap.create(); Stream<String> rootEventIds = events.stream().filter(e -> e != null && e.getRootIds().isEmpty()) .map(EventInformation::getEventId); rootEventIds.forEach(rootEventId -> { <START> Set<String> relatedSourceEvents = new LinkedHashSet<>(); <END> relatedSourceEvents.add(rootEventId); Map<String, EventInformation> allRelatedEvents = buildRelatedEventsMap(rootEventId); allRelatedEvents.values().forEach(e -> { if (sources.contains(e.getComponentName())) { relatedSourceEvents.add(e.getEventId()); } }); allEventsToSourceEvents.put(allRelatedEvents.keySet(), relatedSourceEvents); }); return new ArrayList<>(allEventsToSourceEvents.values()); }</code><technical_language>need collect related source events allRelatedEvents, checking root events. root events related events grouped together, naturally correlated check it, A, B, C grouped, related events A, B, C</technical_language>

Target:
public List<Set<String>> groupByRelatedSourceEvents(Set<String> sources) { Multimap<Set<String>, String> allEventsToSourceEvents = HashMultimap.create(); Stream<String> rootEventIds = events.stream().filter(e -> e != null && e.getRootIds().isEmpty()) .map(EventInformation::getEventId); rootEventIds.forEach(rootEventId -> { Map<String, EventInformation> allRelatedEvents = buildRelatedEventsMap(rootEventId); allEventsToSourceEvents.put(allRelatedEvents.keySet(), rootEventId); }); List<Set<String>> result = new ArrayList<>(); allEventsToSourceEvents.asMap().values().forEach(v -> result.add(new HashSet<>(v)) ); return result; }
Source:
<code>public void testMergeCreatePmAfterValueChange() { batcher.setMergeValueChanges(true); List<CommandAndHandler> list = new ArrayList<CommandAndHandler>(); ValueChangedCommand command = new ValueChangedCommand(); command.setAttributeId("0"); command.setOldValue(0); command.setNewValue(1); ((ArrayList<CommandAndHandler>) list).add(new CommandAndHandler(command)); <START> ((ArrayList<CommandAndHandler>) list).add(new CommandAndHandler(new CreatePresentationModelCommand())); <END> for (CommandAndHandler commandAndHandler : list) { batcher.batch(commandAndHandler); } try { List<CommandAndHandler> nextBatch = batcher.getWaitingBatches().getVal(); Assert.assertEquals(2, nextBatch.size()); Assert.assertEquals(ValueChangedCommand.class, nextBatch.get(0).getCommand().getClass()); Assert.assertEquals(CreatePresentationModelCommand.class, nextBatch.get(1).getCommand().getClass()); Assert.assertTrue(batcher.isEmpty()); } catch (InterruptedException e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }</code><technical_language>Typecasting is required</technical_language>

Target:
public void testMergeCreatePmAfterValueChange() { batcher.setMergeValueChanges(true); List<CommandAndHandler> list = new ArrayList<CommandAndHandler>(); ValueChangedCommand command = new ValueChangedCommand(); command.setAttributeId("0"); command.setOldValue(0); command.setNewValue(1); list.add(new CommandAndHandler(command)); list.add(new CommandAndHandler(new CreatePresentationModelCommand())); for (CommandAndHandler commandAndHandler : list) { batcher.batch(commandAndHandler); } try { List<CommandAndHandler> nextBatch = batcher.getWaitingBatches().getVal(); Assert.assertEquals(2, nextBatch.size()); Assert.assertEquals(ValueChangedCommand.class, nextBatch.get(0).getCommand().getClass()); Assert.assertEquals(CreatePresentationModelCommand.class, nextBatch.get(1).getCommand().getClass()); Assert.assertTrue(batcher.isEmpty()); } catch (InterruptedException e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }
Source:
<code><START> protected void finalize() throws Throwable { <END> log.debug("finalize: garbage collecting router for node {}.", node); stop(); }</code><technical_language>finalize, a bad practice</technical_language>

Target:
protected void finalize() throws Throwable { if (!shutdown) { log.debug("finalize: garbage collecting router for node {}.", node); stop(); } super.finalize(); }
Source:
<code>public CardinalityAggregator( String name, List<DimensionSelector> selectorList, boolean byRow ) { this.name = name; <START> this.selectorList = Lists.newArrayList(selectorList); <END> this.collector = HyperLogLogCollector.makeLatestCollector(); this.byRow = byRow; }</code><technical_language>copy</technical_language>

Target:
public CardinalityAggregator( String name, List<DimensionSelector> selectorList, boolean byRow ) { this.name = name; this.selectorList = selectorList; this.collector = HyperLogLogCollector.makeLatestCollector(); this.byRow = byRow; }
Source:
<code>public <T> Provider<T> provider(final Class<T> type) { return new Provider<T>() { @Override public T get() { <START> return service(type); <END> } }; }</code><technical_language>want repeat containsKey check here, allow delegate return a Provider. idea of a Provider is obtain "prototype" (new instance time) request-scoped objects a request, if wrap a singleton service here, allowed</technical_language>

Target:
public <T> Provider<T> provider(final Class<T> type) { if (registry.containsKey(type)) { return new Provider<T>() { @Override public T get() { return service(type); } }; } else { return delegate.provider(type); } }
Source:
<code>private SecretKey getKeyForVersion(String keyVersion) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, KeyStoreException, CertificateException, NoSuchProviderException, InvalidAlgorithmParameterException, UnrecoverableEntryException, IOException { if (keyVersion.equals(VERSION_USER_DEFINED)) { return AuthenticationSettings.INSTANCE.getSecretKey(); } if (keyVersion.equals(VERSION_ANDROID_KEY_STORE)) { if (Build.VERSION.SDK_INT >= 18) { try { return getSecretKeyFromAndroidKeyStore(); } catch (Exception e) { Logger.e(TAG, "Failed to get private key from AndroidKeyStore", "", ADALError.ANDROIDKEYSTORE_FAILED, e); } } else { throw new IllegalArgumentException( <START> "keyVersion is not supported in this SDK. AndroidKeyStore is supported API18 and above."); <END> } } throw new IllegalArgumentException("keyVersion"); }</code><technical_language>Echo keyVersion checked users</technical_language>

Target:
private SecretKey getKeyForVersion(String keyVersion) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, KeyStoreException, CertificateException, NoSuchProviderException, InvalidAlgorithmParameterException, UnrecoverableEntryException, IOException { if (keyVersion.equals(VERSION_USER_DEFINED)) { return getSecretKey(AuthenticationSettings.INSTANCE.getSecretKeyData()); } if (keyVersion.equals(VERSION_ANDROID_KEY_STORE)) { if (Build.VERSION.SDK_INT >= 18) { try { return getSecretKeyFromAndroidKeyStore(); } catch (Exception e) { Logger.e(TAG, "Failed to get private key from AndroidKeyStore", "", ADALError.ANDROIDKEYSTORE_FAILED, e); } } else { throw new IllegalArgumentException( String.format( "keyVersion '%s' is not supported in this SDK. AndroidKeyStore is supported API18 and above.", keyVersion)); } } throw new IllegalArgumentException("keyVersion"); }
Source:
<code>public void testExplainMultiTableView() throws IOException, ProcCallException { Client client = getClient(); String[] aggTypes = {"MAX", "MIN"}; VoltTable vt = client.callProcedure("@ExplainView", "V2" ).getResults()[0]; assertEquals(13, vt.getRowCount()); <START> for (int i = 0; i<13; i++) { <END> vt.advanceRow(); String task = vt.getString(0); String resolution = vt.getString(1); if (i == 0) { assertEquals("Join Evaluation", task); assertTrue(resolution.contains("Use the following execution plan with built-in delta tables:")); } else { assertEquals("Refresh " + aggTypes[(i-1) % 2] + " column \"C" + (i-1) + "\"", task); assertTrue(resolution.contains("Use the following execution plan:")); } assertTrue(resolution.contains("NESTLOOP INDEX INNER JOIN")); assertTrue(resolution.contains("inline INDEX SCAN of \"TSRC1\" using its primary key index")); assertTrue(resolution.contains("SEQUENTIAL SCAN of \"TSRC2\"")); } }</code><technical_language>spaces comparison operators, please</technical_language>

Target:
public void testExplainMultiTableView() throws IOException, ProcCallException { Client client = getClient(); final String[] aggTypes = {"MAX", "MIN"}; final int numOfMinMaxColumns = 12; VoltTable vt = client.callProcedure("@ExplainView", "V2" ).getResults()[0]; assertEquals(numOfMinMaxColumns + 1, vt.getRowCount()); for (int i = 0; i <= numOfMinMaxColumns; i++) { vt.advanceRow(); String task = vt.getString(0); String resolution = vt.getString(1); if (i == 0) { assertEquals("Join Evaluation", task); assertTrue(resolution.contains("Use the following execution plan with built-in delta tables:")); } else { assertEquals("Refresh " + aggTypes[(i-1) % 2] + " column \"C" + (i-1) + "\"", task); assertTrue(resolution.contains("Use the following execution plan:")); } assertTrue(resolution.contains("NESTLOOP INDEX INNER JOIN")); assertTrue(resolution.contains("inline INDEX SCAN of \"TSRC1\" using its primary key index")); assertTrue(resolution.contains("SEQUENTIAL SCAN of \"TSRC2\"")); } }
Source:
<code>private String getPackageFileList(String downloadedTestProject1PackageName) throws IOException { try { <START> return downloadedFileUtil <END> .getPackageFileList(seleniumWebDriver.getSessionId(), downloadedTestProject1PackageName) .toString(); } catch (IOException e) { WaitUtils.sleepQuietly(2); return downloadedFileUtil .getPackageFileList(seleniumWebDriver.getSessionId(), downloadedTestProject1PackageName) .toString(); } }</code><technical_language>improve waiting download - do 5 times 1 period</technical_language>

Target:
private String getPackageFileList(String downloadedTestProject1PackageName) throws IOException { IOException lastException = null; for (int i = 0; i < MAX_ATTEMPTS; i++) { try { return downloadedFileUtil .getPackageFileList(seleniumWebDriver.getSessionId(), downloadedTestProject1PackageName) .toString(); } catch (IOException e) { lastException = e; sleepQuietly(TestTimeoutsConstants.MINIMUM_SEC); } } throw lastException; }
Source:
<code>public Builder body(String json) { checkNotNull(json, "body required"); checkArgument(json.getBytes().length <= getInteger(MESSAGE_BODY_MAX_IN_BYTES), <START> "json size must be <= %s bytes", getInteger(MESSAGE_BODY_MAX_IN_BYTES)); <END> this.body = new JsonBall(json).toString(); return self(); }</code><technical_language>Ah, I guess lack of a Guice context (and above) is reason for system properties? do solve in jclouds? inject some kind of factory object Guice</technical_language>

Target:
public Builder body(String json) { checkNotNull(json, "body required"); this.body = new JsonBall(json).toString(); return self(); }
Source:
<code>public void testNoEntryPoint() throws Exception { KieSession ksession = session.getStateful(); ksession.insert(createNotEvent(ksession, "value")); ksession.fireAllRules(); Assertions.assertThat(firedRules.isRuleFired(RULE2)).isFalse(); ksession.insert(createNotEvent(ksession, "different value")); ksession.insert(createNotEvent(ksession, "different value")); <START> ksession.insert(createNotEvent(ksession, "different value")); <END> ksession.fireAllRules(); Assertions.assertThat(firedRules.isRuleFired(RULE2)).as(RULE2).isTrue(); }</code><technical_language>a loop</technical_language>

Target:
public void testNoEntryPoint() throws Exception { KieSession ksession = session.getStateful(); ksession.insert(createNotEvent(ksession, "value")); ksession.fireAllRules(); Assertions.assertThat(firedRules.isRuleFired(RULE2)).isFalse(); for (int i = 0; i < 3; i++) { ksession.insert(createNotEvent(ksession, "different value")); } ksession.fireAllRules(); Assertions.assertThat(firedRules.isRuleFired(RULE2)).as(RULE2).isTrue(); }
Source:
<code>boolean isReady(TaskActionClient taskActionClient) throws Exception; boolean canRestore(); void stopGracefully(); <START> TaskStatusWithReports run(TaskToolbox toolbox) throws Exception; <END> Map<String, Object> getContext(); @Nullable default <ContextValueType> ContextValueType getContextValue(String key) { return getContext() == null ? null : (ContextValueType) getContext().get(key); }</code><technical_language>This break compatibility existing third-party task implementations</technical_language>

Target:
boolean isReady(TaskActionClient taskActionClient) throws Exception; boolean canRestore(); void stopGracefully(); TaskStatus run(TaskToolbox toolbox) throws Exception; Map<String, Object> getContext(); @Nullable default <ContextValueType> ContextValueType getContextValue(String key) { return getContext() == null ? null : (ContextValueType) getContext().get(key); }
Source:
<code>protected Map<PartitionId, ReplicaId> createLocalPartitionToReplicaMap() { List<? extends PartitionId> partitionIds = clusterMap.getAllPartitionIds(null); Map<PartitionId, ReplicaId> partitionToReplica = new HashMap<>(); for (PartitionId partitionId : partitionIds) { partitionToReplica.put(partitionId, new CloudReplica(partitionId, currentNode)); } return partitionToReplica; <START> } <END></code><technical_language>simplify this to: return partitionIds.stream().collect(Collectors.toMap(Function.identity(), partitionId -> new CloudReplica(partitionId, currentNode)));</technical_language>

Target:
protected Map<PartitionId, ReplicaId> createLocalPartitionToReplicaMap() { List<? extends PartitionId> partitionIds = clusterMap.getAllPartitionIds(null); return partitionIds.stream() .collect(Collectors.toMap(Function.identity(), partitionId -> new CloudReplica(partitionId, currentNode))); }
Source:
<code><START> public Date getSessionCredentitalsExpiration() { <END> credentialsLock.readLock().lock(); try { return sessionCredentialsExpiration; } finally { credentialsLock.readLock().unlock(); } }</code><technical_language>This method call new method, avoid implementation logic duplicated in places</technical_language>

Target:
public Date getSessionCredentitalsExpiration() { return getSessionCredentialsExpiration(); }
Source:
<code>public void migrationDoesNotProceedIfInvalidationFails() { when(invalidator.backupAndInvalidate()).thenThrow(new IllegalStateException()); TimeLockMigrator migrator = TimeLockMigrator.create(timestampManagementService, invalidator); assertThatThrownBy(migrator::migrate).isInstanceOf(IllegalStateException.class); <START> verify(timestampManagementService, times(0)).fastForwardTimestamp(anyLong()); <END> }</code><technical_language>nit: never() times(0) for readability - equivalent</technical_language>

Target:
public void migrationDoesNotProceedIfInvalidationFails() { when(invalidator.backupAndInvalidate()).thenThrow(new IllegalStateException()); TimeLockMigrator migrator = TimeLockMigrator.create(timestampManagementService, invalidator); assertThatThrownBy(migrator::migrate).isInstanceOf(IllegalStateException.class); verify(timestampManagementService).ping(); verify(invalidator).backupAndInvalidate(); verify(timestampManagementService, never()).fastForwardTimestamp(anyLong()); }