auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
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(fromAddress.getPersonal() + "on behalf of " + 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); } }

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:
private void stopClientAwakeTimer() { try { timerSemaphore.acquire(); } catch (InterruptedException e) { e.printStackTrace(); } if (clientAwakeTimer != null) { clientAwakeTimer.cancel(); clientAwakeTimer.purge(); } timerSemaphore.release(); }

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:
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", new Integer(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); }

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:
JpegInputStream(final int[] interval) { this.interval = interval; this.nextPos = 0; }

Target:
JpegInputStream(final int[] interval) { this.interval = Arrays.copyOf(interval, interval.length); this.nextPos = 0; }
Source:
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; TracingService.logErrorInSpan(getContext().getCurrentSpan(), 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; } }

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:
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)); RevObject o = rw.parseAny(tree); 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); } }

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:
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(-1); throw ex; } }

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:
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); assertEquals(0, h.halfClosureCount.intValue()); } finally { if (sc != null) { sc.close(); } close(s); } }

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:
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 { if (!entitlementService.ccmV2Enabled(request.getAccountId())) { 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)); }

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:
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(";"))); 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)); }

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:
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], new ArrayList<>(), null, true, useDDLSchema); }

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:
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 -> { Set<String> relatedSourceEvents = new LinkedHashSet<>(); 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()); }

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:
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)); ((ArrayList<CommandAndHandler>) 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()); } }

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:
protected void finalize() throws Throwable { log.debug("finalize: garbage collecting router for node {}.", node); stop(); }

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

Target:
public CardinalityAggregator( String name, List<DimensionSelector> selectorList, boolean byRow ) { this.name = name; this.selectorList = selectorList; this.collector = HyperLogLogCollector.makeLatestCollector(); this.byRow = byRow; }
Source:
public <T> Provider<T> provider(final Class<T> type) { return new Provider<T>() { @Override public T get() { return service(type); } }; }

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:
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( "keyVersion is not supported in this SDK. AndroidKeyStore is supported API18 and above."); } } throw new IllegalArgumentException("keyVersion"); }

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:
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()); for (int i = 0; i<13; 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\"")); } }

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:
private String getPackageFileList(String downloadedTestProject1PackageName) throws IOException { try { return downloadedFileUtil .getPackageFileList(seleniumWebDriver.getSessionId(), downloadedTestProject1PackageName) .toString(); } catch (IOException e) { WaitUtils.sleepQuietly(2); return downloadedFileUtil .getPackageFileList(seleniumWebDriver.getSessionId(), downloadedTestProject1PackageName) .toString(); } }

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:
public Builder body(String json) { checkNotNull(json, "body required"); checkArgument(json.getBytes().length <= getInteger(MESSAGE_BODY_MAX_IN_BYTES), "json size must be <= %s bytes", getInteger(MESSAGE_BODY_MAX_IN_BYTES)); this.body = new JsonBall(json).toString(); return self(); }

Target:
public Builder body(String json) { checkNotNull(json, "body required"); this.body = new JsonBall(json).toString(); return self(); }
Source:
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")); ksession.insert(createNotEvent(ksession, "different value")); ksession.fireAllRules(); Assertions.assertThat(firedRules.isRuleFired(RULE2)).as(RULE2).isTrue(); }

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:
boolean isReady(TaskActionClient taskActionClient) throws Exception; boolean canRestore(); void stopGracefully(); TaskStatusWithReports run(TaskToolbox toolbox) throws Exception; Map<String, Object> getContext(); @Nullable default <ContextValueType> ContextValueType getContextValue(String key) { return getContext() == null ? null : (ContextValueType) getContext().get(key); }

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:
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; }

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:
public Date getSessionCredentitalsExpiration() { credentialsLock.readLock().lock(); try { return sessionCredentialsExpiration; } finally { credentialsLock.readLock().unlock(); } }

Target:
public Date getSessionCredentitalsExpiration() { return getSessionCredentialsExpiration(); }
Source:
public void migrationDoesNotProceedIfInvalidationFails() { when(invalidator.backupAndInvalidate()).thenThrow(new IllegalStateException()); TimeLockMigrator migrator = TimeLockMigrator.create(timestampManagementService, invalidator); assertThatThrownBy(migrator::migrate).isInstanceOf(IllegalStateException.class); verify(timestampManagementService, times(0)).fastForwardTimestamp(anyLong()); }

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()); }
Source:
public List<Field> getLayoutFieldsToDelete() { try { if (notStrictFieldLayoutRowSyntaxValidator == null) { notStrictFieldLayoutRowSyntaxValidator = new NotStrictFieldLayoutRowSyntaxValidator(this.contentType, this.fields); notStrictFieldLayoutRowSyntaxValidator.validate(); } return notStrictFieldLayoutRowSyntaxValidator.getFieldsToRemove(); } catch (FieldLayoutValidationException e) { throw new DotRuntimeException(e); } }

Target:
public List<Field> getLayoutFieldsToDelete() { try { if (notStrictFieldLayoutRowSyntaxValidator == null) { notStrictFieldLayoutRowSyntaxValidator = new NotStrictFieldLayoutRowSyntaxValidator(this.contentType, this.fields); notStrictFieldLayoutRowSyntaxValidator.validate(); } return notStrictFieldLayoutRowSyntaxValidator.getFieldsToRemove(); } catch (FieldLayoutValidationException e) { Logger.error(FieldLayout.class, e.getMessage()); throw new DotRuntimeException(e); } }
Source:
public void testJsonConstructorAnnotation() { try { ClassFactory<DemoModel> factory = ClassFactory.get(DemoModel.class); DemoModel demoModel = factory.newInstance(); Assert.assertEquals(0, demoModel.s); Assert.assertEquals(0, demoModel.i); Assert.assertEquals(Integer.valueOf(0), demoModel.i2); Assert.assertEquals("", demoModel.str); Assert.assertNotNull("Interface parameters should be passed proxy objects.", demoModel.list); Assert.assertEquals("Enum parameters should be passed the first enum value.", Enum.VALUE, demoModel.testEnum); Assert.assertNotNull("Other objects should be created using a no-arg constructor.", demoModel.date); } catch (IllegalArgumentException e) { Assert.fail("Should be able to construct ClassFactory."); } catch (IllegalAccessException | InstantiationException | InvocationTargetException e) { Assert.fail("Should be able to construct object using ClassFactory."); } }

Target:
@Test public void testJsonConstructorAnnotation() throws IllegalAccessException, InstantiationException, InvocationTargetException { ClassFactory<DemoModel> factory = ClassFactory.get(DemoModel.class); DemoModel demoModel = factory.newInstance(); Assert.assertEquals(0, demoModel.s); Assert.assertEquals(0, demoModel.i); Assert.assertEquals(Integer.valueOf(0), demoModel.i2); Assert.assertEquals("", demoModel.str); Assert.assertNotNull("Interface parameters should be passed proxy objects.", demoModel.list); Assert.assertEquals("Enum parameters should be passed the first enum value.", Enum.VALUE, demoModel.testEnum); Assert.assertNotNull("Other objects should be created using a no-arg constructor.", demoModel.date); }
Source:
public void setUp() { n = new CacheNotifierImpl(); mockCache = mock(EncoderCache.class); EmbeddedCacheManager cacheManager = mock(EmbeddedCacheManager.class); when(mockCache.getCacheManager()).thenReturn(cacheManager); when(mockCache.getAdvancedCache()).thenReturn(mockCache); when(mockCache.getKeyDataConversion()).thenReturn(DataConversion.DEFAULT_KEY); when(mockCache.getValueDataConversion()).thenReturn(DataConversion.DEFAULT_VALUE); when(mockCache.getStatus()).thenReturn(ComponentStatus.INITIALIZING); ComponentRegistry componentRegistry = mock(ComponentRegistry.class); when(mockCache.getComponentRegistry()).thenReturn(componentRegistry); MockBasicComponentRegistry mockRegistry = new MockBasicComponentRegistry(); when(componentRegistry.getComponent(BasicComponentRegistry.class)).thenReturn(mockRegistry); mockRegistry.registerMocks(RpcManager.class, StreamingMarshaller.class, CancellationService.class, CommandsFactory.class, Encoder.class); Configuration config = new ConfigurationBuilder().memory().storageType(StorageType.OBJECT).build(); TestingUtil.inject(n, mockCache, cdl, config, mockRegistry, mock(InternalEntryFactory.class), mock(ClusterEventManager.class), mock(KeyPartitioner.class), TestingUtil.named(KnownComponentNames.ASYNC_NOTIFICATION_EXECUTOR, new WithinThreadExecutor())); cl = new PrimaryOwnerCacheListener(); n.start(); n.addListener(cl); ctx = new NonTxInvocationContext(null); }

Target:
public void setUp() { n = new CacheNotifierImpl(); mockCache = mock(EncoderCache.class); EmbeddedCacheManager cacheManager = mock(EmbeddedCacheManager.class); when(mockCache.getCacheManager()).thenReturn(cacheManager); when(mockCache.getAdvancedCache()).thenReturn(mockCache); when(mockCache.getKeyDataConversion()).thenReturn(DataConversion.DEFAULT_KEY); when(mockCache.getValueDataConversion()).thenReturn(DataConversion.DEFAULT_VALUE); when(mockCache.getStatus()).thenReturn(ComponentStatus.INITIALIZING); ComponentRegistry componentRegistry = mock(ComponentRegistry.class); when(mockCache.getComponentRegistry()).thenReturn(componentRegistry); MockBasicComponentRegistry mockRegistry = new MockBasicComponentRegistry(); when(componentRegistry.getComponent(BasicComponentRegistry.class)).thenReturn(mockRegistry); mockRegistry.registerMocks(RpcManager.class, StreamingMarshaller.class, CancellationService.class, CommandsFactory.class, Encoder.class); Configuration config = new ConfigurationBuilder().memory().storageType(StorageType.OBJECT).build(); TestingUtil.inject(n, mockCache, cdl, config, mockRegistry, mock(InternalEntryFactory.class), mock(ClusterEventManager.class), mock(KeyPartitioner.class)); cl = new PrimaryOwnerCacheListener(); n.start(); n.addListener(cl); ctx = new NonTxInvocationContext(null); }
Source:
public static Expression create(Expression expression, PDataType toType) throws SQLException { final PDataType dataType = expression.getDataType(); if (toType != null && !dataType.isCoercibleTo(toType)) { throw new TypeMismatchException(dataType, toType, expression.toString()); } return toType == dataType ? expression : expression instanceof LiteralExpression ? LiteralExpression.newConstant(((LiteralExpression)expression).getValue(), toType) : new CoerceExpression(expression, toType); }

Target:
public static Expression create(Expression expression, PDataType toType) throws SQLException { return toType == expression.getDataType() ? expression : expression instanceof LiteralExpression ? LiteralExpression.newConstant(((LiteralExpression)expression).getValue(), toType) : new CoerceExpression(expression, toType); }
Source:
public void onBookmarkClick(boolean bookmarkSaved) { if (getPage() == null) { return; } if (bookmarkSaved) { SavedPage.markPageToSave(getTitle()); FeedbackUtil.showMessage(getActivity(), R.string.snackbar_saving_page); } else { deleteBookmark(); } }

Target:
public void onBookmarkClick(boolean bookmarkSaved) { if (getPage() == null) { return; } if (bookmarkSaved) { saveBookmark(); } else { deleteBookmark(); } }
Source:
public ConnectorSplitSource getSplits( ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorTableLayoutHandle layout, SplitSchedulingContext splitSchedulingContext) { PinotTableLayoutHandle layoutHandle = checkType(layout, PinotTableLayoutHandle.class, "layout"); PinotTableHandle tableHandle = layoutHandle.getTable(); PinotTable table = null; PinotColumn timeColumn = null; Map<String, Map<String, List<String>>> routingTable = null; Map<String, String> timeBoundary = null; try { table = pinotPrestoConnection.getTable(tableHandle.getTableName()); timeColumn = pinotPrestoConnection.getPinotTimeColumnForTable(tableHandle.getTableName()); routingTable = pinotPrestoConnection.getRoutingTable(tableHandle.getTableName()); timeBoundary = pinotPrestoConnection.getTimeBoundary(tableHandle.getTableName()); checkState(table != null, "Table %s no longer exists", tableHandle.getTableName()); } catch (Exception e) { throw new PrestoException( PINOT_FAILURE_GETTING_TABLE, "Failed to fetch table status for Pinot table: " + tableHandle.getTableName(), e); } List<ConnectorSplit> splits = new ArrayList<>(); if (!routingTable.isEmpty()) { setSplits(splits, timeColumn, routingTable, timeBoundary, getOfflineTableName(tableHandle.getTableName()), tableHandle.getConstraintSummary()); setSplits(splits, timeColumn, routingTable, timeBoundary, getRealtimeTableName(tableHandle.getTableName()), tableHandle.getConstraintSummary()); } Collections.shuffle(splits); log.debug("PinotSplits is %s", Arrays.toString(splits.toArray())); return new FixedSplitSource(splits); }

Target:
public ConnectorSplitSource getSplits( ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorTableLayoutHandle layout, SplitSchedulingContext splitSchedulingContext) { PinotTableLayoutHandle layoutHandle = checkType(layout, PinotTableLayoutHandle.class, "layout"); PinotTableHandle tableHandle = layoutHandle.getTable(); PinotTable table; PinotColumn timeColumn; Map<String, Map<String, List<String>>> routingTable; Map<String, String> timeBoundary; try { table = pinotPrestoConnection.getTable(tableHandle.getTableName()); timeColumn = pinotPrestoConnection.getPinotTimeColumnForTable(tableHandle.getTableName()); routingTable = pinotPrestoConnection.getRoutingTable(tableHandle.getTableName()); timeBoundary = pinotPrestoConnection.getTimeBoundary(tableHandle.getTableName()); checkState(table != null, "Table %s no longer exists", tableHandle.getTableName()); } catch (Exception e) { throw new PrestoException( PINOT_FAILURE_GETTING_TABLE, "Failed to fetch table status for Pinot table: " + tableHandle.getTableName(), e); } List<ConnectorSplit> splits = new ArrayList<>(); if (!routingTable.isEmpty()) { setSplits(splits, timeColumn, routingTable, timeBoundary, TableNameBuilder.OFFLINE.tableNameWithType(tableHandle.getTableName()), tableHandle.getConstraintSummary()); setSplits(splits, timeColumn, routingTable, timeBoundary, TableNameBuilder.REALTIME.tableNameWithType(tableHandle.getTableName()), tableHandle.getConstraintSummary()); } Collections.shuffle(splits); return new FixedSplitSource(splits); }
Source:
public List<String> getTemplateUrl(UUID templateId) throws GeneralSecurityException, IOException { Template template = repository.findOne(templateId); if (template == null) { throw new IllegalArgumentException("team.invalid"); } Long expiration = (System.currentTimeMillis() / 1000) + 7200; return storage.exposeFilesInFolder(bucket, template.filePath(), expiration); }

Target:
public List<String> getTemplateUrl(UUID templateId) throws GeneralSecurityException, IOException { Template template = repository.findOne(templateId); if (template == null) { throw new IllegalArgumentException("template.invalid"); } Long expiration = (System.currentTimeMillis() / 1000) + 7200; return storage.exposeFilesInFolder(bucket, template.filePath(), expiration); }
Source:
protected void write( FeatureCollectionResponse featureCollection, OutputStream output, Operation getFeature) throws IOException, ServiceException { GetFeatureType getFeatureType = (GetFeatureType) getFeature.getParameters()[0]; Integer resolution = 256; try { resolution = Integer.parseInt(getFeatureType.getResolution()); } catch (NumberFormatException e) { } FeatureCollection collection = featureCollection.getFeatures().get(0); final Rectangle paintArea = new Rectangle(resolution, resolution); CoordinateReferenceSystem refSys = collection .getSchema() .getGeometryDescriptor() .getType() .getCoordinateReferenceSystem(); ReferencedEnvelope area = ReferencedEnvelope.create(collection.getBounds(), refSys); Pipeline pipeline = getPipeline(area, paintArea, refSys, resolution / 32); VectorTileEncoder encoder = new VectorTileEncoderNoClip(resolution, resolution / 32, false); try (FeatureIterator<SimpleFeature> features = collection.features()) { while (features.hasNext()) { SimpleFeature feature = features.next(); Geometry geom = (Geometry) feature.getDefaultGeometryProperty().getValue(); Geometry finalGeom = finalGeom = pipeline.execute(geom); final String layerName = feature.getName().getLocalPart(); final Map<String, Object> properties = getProperties(feature); if (finalGeom.getCoordinates().length > 0) encoder.addFeature(layerName, properties, finalGeom); } output.write(encoder.encode()); } catch (Exception e) { e.printStackTrace(); } }

Target:
protected void write( FeatureCollectionResponse featureCollection, OutputStream output, Operation getFeature) throws IOException, ServiceException { GetFeatureType getFeatureType = (GetFeatureType) getFeature.getParameters()[0]; Integer resolution = getFeatureType.getResolution() != null ? getFeatureType.getResolution() : 256; FeatureCollection collection = featureCollection.getFeatures().get(0); final Rectangle paintArea = new Rectangle(resolution, resolution); CoordinateReferenceSystem refSys = collection .getSchema() .getGeometryDescriptor() .getType() .getCoordinateReferenceSystem(); ReferencedEnvelope area = ReferencedEnvelope.create( tileData.isTileRequest() ? envelopeFromTileRequestData() : collection.getBounds(), refSys); Pipeline pipeline = getPipeline(area, paintArea, refSys, resolution / 32); VectorTileEncoder encoder = new VectorTileEncoderNoClip(resolution, resolution / 32, false); try (FeatureIterator<SimpleFeature> features = collection.features()) { while (features.hasNext()) { SimpleFeature feature = features.next(); Geometry geom = (Geometry) feature.getDefaultGeometryProperty().getValue(); Geometry finalGeom = finalGeom = pipeline.execute(geom); final String layerName = feature.getName().getLocalPart(); final Map<String, Object> properties = getProperties(feature); if (finalGeom.getCoordinates().length > 0) encoder.addFeature(layerName, properties, finalGeom); } output.write(encoder.encode()); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public List<ClientScopeModel> getClientScopes() { if (isUpdated()) return updated.getClientScopes(); List<String> clientTemplates = cached.getClientScopes(); if (clientTemplates.isEmpty()) return Collections.EMPTY_LIST; List<ClientScopeModel> apps = new LinkedList<ClientScopeModel>(); for (String id : clientTemplates) { ClientScopeModel model = cacheSession.getClientScopeById(id, this); if (model == null) { throw new IllegalStateException("Cached clientemplate not found: " + id); } apps.add(model); } return Collections.unmodifiableList(apps); }

Target:
public List<ClientScopeModel> getClientScopes() { if (isUpdated()) return updated.getClientScopes(); List<String> clientScopes = cached.getClientScopes(); if (clientScopes.isEmpty()) return Collections.EMPTY_LIST; List<ClientScopeModel> apps = new LinkedList<ClientScopeModel>(); for (String id : clientScopes) { ClientScopeModel model = cacheSession.getClientScopeById(id, this); if (model == null) { throw new IllegalStateException("Cached clientScope not found: " + id); } apps.add(model); } return Collections.unmodifiableList(apps); }
Source:
private static void saveSpoilersWithoutTransaction(final Geocache cache) { final List<Image> spoilers = cache.getSpoilers(); if (CollectionUtils.isNotEmpty(spoilers)) { final String geocode = cache.getGeocode(); database.delete(dbTableSpoilers, "geocode = ?", new String[]{geocode}); final SQLiteStatement insertSpoiler = PreparedStatement.INSERT_SPOILER.getStatement(); final long timestamp = System.currentTimeMillis(); for (final Image spoiler : spoilers) { insertSpoiler.bindString(1, geocode); insertSpoiler.bindLong(2, timestamp); insertSpoiler.bindString(3, spoiler.getUrl()); insertSpoiler.bindString(4, StringUtils.defaultIfBlank(spoiler.title, "")); final String description = spoiler.getDescription(); if (StringUtils.isNotBlank(description)) { insertSpoiler.bindString(5, description); } else { insertSpoiler.bindNull(5); } insertSpoiler.executeInsert(); } } }

Target:
private static void saveSpoilersWithoutTransaction(final Geocache cache) { if (cache.hasSpoilersSet()) { final String geocode = cache.getGeocode(); final SQLiteStatement remove = PreparedStatement.REMOVE_SPOILERS.getStatement(); remove.bindString(1, cache.getGeocode()); remove.execute(); final SQLiteStatement insertSpoiler = PreparedStatement.INSERT_SPOILER.getStatement(); final long timestamp = System.currentTimeMillis(); for (final Image spoiler : cache.getSpoilers()) { insertSpoiler.bindString(1, geocode); insertSpoiler.bindLong(2, timestamp); insertSpoiler.bindString(3, spoiler.getUrl()); insertSpoiler.bindString(4, StringUtils.defaultIfBlank(spoiler.title, "")); final String description = spoiler.getDescription(); if (StringUtils.isNotBlank(description)) { insertSpoiler.bindString(5, description); } else { insertSpoiler.bindNull(5); } insertSpoiler.executeInsert(); } } }
Source:
public static ByteBuf generatePacket(long ledgerId, long entryId, long lastAddConfirmed, long length, byte[] data, int offset, int len) { DigestManager dm = null; try { dm = DigestManager.instantiate(ledgerId, new byte[2], CRC32); } catch (GeneralSecurityException gse) { } return dm.computeDigestAndPackageForSending(entryId, lastAddConfirmed, length, Unpooled.wrappedBuffer(data, offset, len)); }

Target:
public static ByteBuf generatePacket(long ledgerId, long entryId, long lastAddConfirmed, long length, byte[] data, int offset, int len) throws GeneralSecurityException { DigestManager dm = DigestManager.instantiate(ledgerId, new byte[2], CRC32); return dm.computeDigestAndPackageForSending(entryId, lastAddConfirmed, length, Unpooled.wrappedBuffer(data, offset, len)); }
Source:
public final SpawnPrim initialize(final VM vm) { super.initialize(vm); this.onExec = insert( Breakpoints.create(sourceSection, BreakpointType.ACTIVITY_ON_EXEC, vm)); this.forkJoinPool = vm.getForkJoinPool(); this.processesPool = vm.getProcessPool(); this.threadPool = vm.getThreadPool(); thrower = new ExceptionSignalingNode("NotAValue", "signalWith:", sourceSection); return this; }

Target:
public final SpawnPrim initialize(final VM vm) { super.initialize(vm); onExec = insert(Breakpoints.create(sourceSection, BreakpointType.ACTIVITY_ON_EXEC, vm)); notAValue = insert(ExceptionSignalingNode.createNotAValueNode(sourceSection)); forkJoinPool = vm.getForkJoinPool(); processesPool = vm.getProcessPool(); threadPool = vm.getThreadPool(); return this; }