auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testVpnMsgOrLinkToBrowser() throws Exception { doReturn(mNetwork).when(sMockConnectivityManager).getActiveNetwork(); final NetworkCapabilities nonVpnCapabilities = new NetworkCapabilities(); doReturn(nonVpnCapabilities).when(sMockConnectivityManager).getNetworkCapabilities( mNetwork); final String continueMsg = mActivity.getString(R.string.ssl_error_continue); final String linkMatcher = ".*<a\\s+href.*"; assertTrue(mActivity.mWebViewClient.getVpnMsgOrLinkToBrowser().matches(linkMatcher)); final NetworkCapabilities vpnCapabilities = new NetworkCapabilities(); vpnCapabilities.addTransportType(NetworkCapabilities.TRANSPORT_VPN); doReturn(vpnCapabilities).when(sMockConnectivityManager).getNetworkCapabilities(mNetwork); final String vpnWarning = mActivity.getString(R.string.ssl_error_vpnwarning); final String vpnMatcher = ".*<div.*vpnwarning.*"; assertTrue(mActivity.mWebViewClient.getVpnMsgOrLinkToBrowser().matches(vpnMatcher)); }

Target:
public void testVpnMsgOrLinkToBrowser() throws Exception { doReturn(mNetwork).when(sMockConnectivityManager).getActiveNetwork(); final NetworkCapabilities nonVpnCapabilities = new NetworkCapabilities(); doReturn(nonVpnCapabilities).when(sMockConnectivityManager).getNetworkCapabilities( mNetwork); final String continueMsg = mActivity.getString(R.string.ssl_error_continue); final String linkMatcher = ".*<a\\s+href.*"; assertTrue(mActivity.mWebViewClient.getVpnMsgOrLinkToBrowser().matches(linkMatcher)); doReturn(null).when(sMockConnectivityManager).getNetworkCapabilities(mNetwork); assertTrue(mActivity.mWebViewClient.getVpnMsgOrLinkToBrowser().matches(linkMatcher)); final NetworkCapabilities vpnCapabilities = new NetworkCapabilities(); vpnCapabilities.addTransportType(NetworkCapabilities.TRANSPORT_VPN); doReturn(vpnCapabilities).when(sMockConnectivityManager).getNetworkCapabilities(mNetwork); final String vpnWarning = mActivity.getString(R.string.ssl_error_vpnwarning); final String vpnMatcher = ".*<div.*vpnwarning.*"; assertTrue(mActivity.mWebViewClient.getVpnMsgOrLinkToBrowser().matches(vpnMatcher)); }
Source:
private void logNoSuccessWarning(long now) { long lastUpdateNanos = now - noSuccessCheckDeadlineNanos + INTERVAL_NO_SUCCESS_WARNING_NANOS; long lastUpdated = TimeUnit.NANOSECONDS.toSeconds(lastUpdateNanos); LOG.warn( "No operations completed within the last %d seconds. " + "There are still %d simple operations in progress.", lastUpdated, operations.size()); noSuccessWarningCount++; }

Target:
private void logNoSuccessWarning(long now) { long lastUpdateNanos = now - noSuccessCheckDeadlineNanos + INTERVAL_NO_SUCCESS_WARNING_NANOS; long lastUpdated = TimeUnit.NANOSECONDS.toSeconds(lastUpdateNanos); LOG.warn( "No operations completed within the last %d seconds. " + "There are still %d operations in progress.", lastUpdated, operations.size()); noSuccessWarningCount++; }
Source:
protected void zoomEntries(@NonNull Iterable<@NonNull TimeGraphEntry> entries, long zoomStartTime, long zoomEndTime, long resolution, @NonNull IProgressMonitor monitor) { if (resolution < 0) { return; } long start = Long.min(zoomStartTime, zoomEndTime); long end = Long.max(zoomStartTime, zoomEndTime); List<@NonNull Long> times = StateSystemUtils.getTimes(start, end, resolution); Sampling sampling = new Sampling(start, end, resolution); Multimap<ITimeGraphDataProvider<? extends TimeGraphEntryModel>, Long> providersToModelIds = filterGroupEntries(entries, zoomStartTime, zoomEndTime); SubMonitor subMonitor = SubMonitor.convert(monitor, getClass().getSimpleName() + "#zoomEntries", providersToModelIds.size()); for (Entry<ITimeGraphDataProvider<? extends TimeGraphEntryModel>, Collection<Long>> entry : providersToModelIds.asMap().entrySet()) { ITimeGraphDataProvider<? extends TimeGraphEntryModel> dataProvider = entry.getKey(); TimeGraphStateQueryFilter filter = new TimeGraphStateQueryFilter(times, entry.getValue(), getRegexes()); TmfModelResponse<List<ITimeGraphRowModel>> response = dataProvider.fetchRowModel(filter, monitor); List<ITimeGraphRowModel> model = response.getModel(); if (model != null) { Map<Long, TimeGraphEntry> map; synchronized (fEntries) { map = ImmutableMap.copyOf(fEntries.row(dataProvider)); } zoomEntries(map, model, response.getStatus() == ITmfResponse.Status.COMPLETED, sampling); } subMonitor.worked(1); } }

Target:
protected void zoomEntries(@NonNull Iterable<@NonNull TimeGraphEntry> entries, long zoomStartTime, long zoomEndTime, long resolution, @NonNull IProgressMonitor monitor) { if (resolution < 0) { return; } long start = Long.min(zoomStartTime, zoomEndTime); long end = Long.max(zoomStartTime, zoomEndTime); List<@NonNull Long> times = StateSystemUtils.getTimes(start, end, resolution); Sampling sampling = new Sampling(start, end, resolution); Multimap<ITimeGraphDataProvider<? extends TimeGraphEntryModel>, Long> providersToModelIds = filterGroupEntries(entries, zoomStartTime, zoomEndTime); SubMonitor subMonitor = SubMonitor.convert(monitor, getClass().getSimpleName() + "#zoomEntries", providersToModelIds.size()); for (Entry<ITimeGraphDataProvider<? extends TimeGraphEntryModel>, Collection<Long>> entry : providersToModelIds.asMap().entrySet()) { ITimeGraphDataProvider<? extends TimeGraphEntryModel> dataProvider = entry.getKey(); TimeGraphStateQueryFilter filter = new TimeGraphStateQueryFilter(times, entry.getValue(), getRegexes()); TmfModelResponse<List<ITimeGraphRowModel>> response = dataProvider.fetchRowModel(filter, monitor); List<ITimeGraphRowModel> model = response.getModel(); if (model != null) { zoomEntries(fEntries.row(dataProvider), model, response.getStatus() == ITmfResponse.Status.COMPLETED, sampling); } subMonitor.worked(1); } }
Source:
private List<Pipeline> fetchHydratedPipelines() { List<Map<String, Object>> rawPipelines = front50.getPipelines(); if (rawPipelines == null) { return Collections.emptyList(); } Predicate<Map<String, Object>> isV2Pipeline = p -> { return p.getOrDefault("type", "").equals("templatedPipeline") && p.getOrDefault("schema", "").equals("v2"); }; return rawPipelines.stream() .map((Map<String, Object> p) -> { if (isV2Pipeline.test(p)) { try { return orca.v2Plan(p); } catch (Exception e) { log.error("Caught exception while planning templated pipeline: {}", p, e); return Collections.emptyMap(); } } else { return p; } }) .filter(m -> !m.isEmpty()) .map(m -> { try { return objectMapper.convertValue(m, Pipeline.class); } catch (Exception e) { log.warn("Pipeline failed to be converted to Pipeline.class: {}", m, e); return null; } }) .filter(Objects::nonNull) .collect(Collectors.toList()); }

Target:
private List<Pipeline> fetchHydratedPipelines() { List<Map<String, Object>> rawPipelines = front50.getPipelines(); if (rawPipelines == null) { return Collections.emptyList(); } Predicate<Map<String, Object>> isV2Pipeline = p -> { return p.getOrDefault("type", "").equals("templatedPipeline") && p.getOrDefault("schema", "").equals("v2"); }; return rawPipelines.stream() .map((Map<String, Object> p) -> planPipelineIfNeeded(p, isV2Pipeline)) .filter(m -> !m.isEmpty()) .map(m -> convertToPipeline(m)) .filter(Objects::nonNull) .collect(Collectors.toList()); }
Source:
public static final void executeDeleteTestresultOfSummary( EntityManager session, Long resultId) { boolean isDeleteAll = resultId == null; String paramQueryBaseString = "delete from PARAMETER_DETAILS"; if (isDeleteAll) { session.createNativeQuery(paramQueryBaseString).executeUpdate(); } else { Query paramQuery = session.createNativeQuery( paramQueryBaseString + " where FK_TESTRESULT in (select ID from TESTRESULT where INTERNAL_TESTRUN_ID = #summaryId)"); paramQuery.setParameter("summaryId", resultId); paramQuery.executeUpdate(); } String additionsQueryBaseString = "delete from TESTRESULT_ADDITIONS"; if (isDeleteAll) { session.createNativeQuery(additionsQueryBaseString).executeUpdate(); } else { Query paramQuery = session.createNativeQuery( additionsQueryBaseString + " where FK_TESTRESULT in (select ID from TESTRESULT where INTERNAL_TESTRUN_ID = #summaryId)"); paramQuery.setParameter("summaryId", resultId); paramQuery.executeUpdate(); } StringBuilder resultQueryBuilder = new StringBuilder(); resultQueryBuilder.append( "delete from TestResultPO testResult"); if (!isDeleteAll) { resultQueryBuilder.append(" where testResult.internalTestResultSummaryID = :id"); } Query resultQuery = session.createQuery(resultQueryBuilder.toString()); if (!isDeleteAll) { resultQuery.setParameter("id", resultId); } resultQuery.executeUpdate(); }

Target:
public static final void executeDeleteTestresultOfSummary( EntityManager session, Long resultId) { boolean isDeleteAll = resultId == null; String paramQueryBaseString = "delete from PARAMETER_DETAILS"; String queryExtension = " where FK_TESTRESULT in (select ID from TESTRESULT where INTERNAL_TESTRUN_ID = #summaryId)"; if (isDeleteAll) { session.createNativeQuery(paramQueryBaseString).executeUpdate(); } else { Query paramQuery = session.createNativeQuery( paramQueryBaseString + queryExtension); paramQuery.setParameter("summaryId", resultId); paramQuery.executeUpdate(); } String additionsQueryBaseString = "delete from TESTRESULT_ADDITIONS"; if (isDeleteAll) { session.createNativeQuery(additionsQueryBaseString).executeUpdate(); } else { Query commentQuery = session.createNativeQuery( additionsQueryBaseString + queryExtension); commentQuery.setParameter("summaryId", resultId); commentQuery.executeUpdate(); } StringBuilder resultQueryBuilder = new StringBuilder(); resultQueryBuilder.append( "delete from TestResultPO testResult"); if (!isDeleteAll) { resultQueryBuilder.append(" where testResult.internalTestResultSummaryID = :id"); } Query resultQuery = session.createQuery(resultQueryBuilder.toString()); if (!isDeleteAll) { resultQuery.setParameter("id", resultId); } resultQuery.executeUpdate(); }
Source:
public void marshallTransaction(TxnView txn, ManagedCache<String, Optional<String>> propertyCache, TransactionController reuseTC, String localUserName, Integer sessionNumber) throws StandardException, SQLException{ assert !updated; try { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "marshallTransaction with transactionID %s", txn); } cm = csf.newContextManager(); csf.setCurrentContextManager(cm); updated = true; String userName = localUserName != null ? localUserName : username; ArrayList<String> grouplist = new ArrayList<>(); grouplist.add(userName); if (propertyCache != null) { database.getDataDictionary().getDataDictionaryCache().setPropertyCache(propertyCache); } lcc=database.generateLanguageConnectionContext(txn, cm, userName,grouplist,drdaID, dbname, rdbIntTkn, DataSetProcessorType.DEFAULT_CONTROL, false, -1, ipAddress, reuseTC); } catch (Throwable t) { LOG.error("Exception during marshallTransaction", t); if (updated) close(); throw t; } }

Target:
public void marshallTransaction(TxnView txn, ManagedCache<String, Optional<String>> propertyCache, TransactionController reuseTC, String localUserName, Integer sessionNumber) throws StandardException, SQLException{ if (updated) { throw new IllegalStateException("Cannot create a new marshall Transaction as the last one wasn't closed"); } try { if (LOG.isDebugEnabled()) { SpliceLogUtils.debug(LOG, "marshallTransaction with transactionID %s", txn); } cm = csf.newContextManager(); csf.setCurrentContextManager(cm); updated = true; String userName = localUserName != null ? localUserName : username; ArrayList<String> grouplist = new ArrayList<>(); grouplist.add(userName); if (propertyCache != null) { database.getDataDictionary().getDataDictionaryCache().setPropertyCache(propertyCache); } lcc=database.generateLanguageConnectionContext(txn, cm, userName,grouplist,drdaID, dbname, rdbIntTkn, DataSetProcessorType.DEFAULT_CONTROL, false, -1, ipAddress, reuseTC); } catch (Throwable t) { LOG.error("Exception during marshallTransaction", t); if (updated) close(); throw t; } }
Source:
public void removeSocketBinding_nullName() throws Exception { new RemoveSocketBinding(null); fail("Creating command with null handler name should throw an exception"); }

Target:
public void removeSocketBinding_nullName() throws Exception { new RemoveSocketBinding(null); fail("Creating command with null name should throw an exception"); }
Source:
private void validateInputFields(Schema inputSchema) { if (!inputSchema.getFields().toString().contains(conf.getKeyField())) { throw new IllegalArgumentException( String.format("Cannot denormalize using this field '%s' as it does not exist in input schema %s", conf.getKeyField(), inputSchema)); } else if (!inputSchema.getFields().toString().contains(conf.getFieldName())) { throw new IllegalArgumentException( String.format("Cannot find field '%s' in input schema %s", conf.getFieldName(), inputSchema)); } else if (!inputSchema.getFields().toString().contains(conf.getFieldValue())) { throw new IllegalArgumentException( String.format("Cannot find field '%s' in input schema %s", conf.getFieldValue(), inputSchema)); } }

Target:
private void validateInputFields(Schema inputSchema) { if (inputSchema.getField(conf.getKeyField()) == null) { throw new IllegalArgumentException( String.format("Keyfield '%s' does not exist in input schema %s", conf.getKeyField(), inputSchema)); } else if (inputSchema.getField(conf.getNameField()) == null) { throw new IllegalArgumentException( String.format("Namefield '%s' does not exist in input schema %s", conf.getNameField(), inputSchema)); } else if (inputSchema.getField(conf.getValueField()) == null) { throw new IllegalArgumentException( String.format("Valuefield '%s' does not exist in input schema %s", conf.getValueField(), inputSchema)); } Schema keyFieldSchema = inputSchema.getField(conf.getKeyField()).getSchema(); Schema nameFieldSchema = inputSchema.getField(conf.getNameField()).getSchema(); Schema valueFieldSchema = inputSchema.getField(conf.getValueField()).getSchema(); if (!((keyFieldSchema.isNullable() ? keyFieldSchema.getNonNullable().getType() : keyFieldSchema .getType()).equals(Schema.Type.STRING))) { throw new IllegalArgumentException( String.format("Keyfield '%s' in the input record must be of type String or Nullable String", conf.getKeyField())); } else if (!((nameFieldSchema.isNullable() ? nameFieldSchema.getNonNullable().getType() : nameFieldSchema .getType()).equals(Schema.Type.STRING))) { throw new IllegalArgumentException( String.format("Namefield '%s' in the input record must be of type String or Nullable String", conf.getNameField())); } else if (!((valueFieldSchema.isNullable() ? valueFieldSchema.getNonNullable().getType() : valueFieldSchema .getType()).equals(Schema.Type.STRING))) { throw new IllegalArgumentException( String.format("Valuefield '%s' in the input record must be of type String or Nullable String", conf.getValueField())); } }
Source:
public void run() { logger.info("Aggregating stats for local report"); try { long totalFetchAndAggregateStartTimeMs = time.milliseconds(); StatsSnapshot aggregatedSnapshot = new StatsSnapshot(0L, null); List<PartitionId> unreachablePartitions = new ArrayList<>(); Iterator<PartitionId> iterator = (new HashSet<>(partitionToReplicaMap.keySet())).iterator(); while (!cancelled && iterator.hasNext()) { PartitionId partitionId = iterator.next(); logger.info("Aggregating stats for local report started for store {}", partitionId); collectAndAggregate(aggregatedSnapshot, partitionId, unreachablePartitions); } List<String> unreachableStores = examineUnreachablePartitions(unreachablePartitions); if (!cancelled) { metrics.totalFetchAndAggregateTimeMs.update(time.milliseconds() - totalFetchAndAggregateStartTimeMs); StatsHeader statsHeader = new StatsHeader(StatsHeader.StatsDescription.STORED_DATA_SIZE, time.milliseconds(), partitionToReplicaMap.keySet().size(), partitionToReplicaMap.keySet().size() - unreachableStores.size(), unreachableStores); StatsWrapper statsWrapper = new StatsWrapper(statsHeader, aggregatedSnapshot); if (accountStatsMySqlStore != null) { accountStatsMySqlStore.publish(statsWrapper); } publish(new StatsWrapper(statsHeader, aggregatedSnapshot)); logger.info("Local stats snapshot published to {}", statsOutputFile.getAbsolutePath()); } } catch (Exception | Error e) { metrics.statsAggregationFailureCount.inc(); logger.error("Exception while aggregating stats for local report. Stats output file path - {}", statsOutputFile.getAbsolutePath(), e); } }

Target:
public void run() { logger.info("Aggregating stats for local report"); try { long totalFetchAndAggregateStartTimeMs = time.milliseconds(); StatsSnapshot aggregatedSnapshot = new StatsSnapshot(0L, null); List<PartitionId> unreachablePartitions = new ArrayList<>(); Iterator<PartitionId> iterator = (new HashSet<>(partitionToReplicaMap.keySet())).iterator(); while (!cancelled && iterator.hasNext()) { PartitionId partitionId = iterator.next(); logger.info("Aggregating stats for local report started for store {}", partitionId); collectAndAggregate(aggregatedSnapshot, partitionId, unreachablePartitions); } List<String> unreachableStores = examineUnreachablePartitions(unreachablePartitions); if (!cancelled) { metrics.totalFetchAndAggregateTimeMs.update(time.milliseconds() - totalFetchAndAggregateStartTimeMs); StatsHeader statsHeader = new StatsHeader(StatsHeader.StatsDescription.STORED_DATA_SIZE, time.milliseconds(), partitionToReplicaMap.keySet().size(), partitionToReplicaMap.keySet().size() - unreachableStores.size(), unreachableStores); StatsWrapper statsWrapper = new StatsWrapper(statsHeader, aggregatedSnapshot); if (accountStatsMySqlStore != null) { accountStatsMySqlStore.publish(statsWrapper); } publish(statsWrapper); logger.info("Local stats snapshot published to {}", statsOutputFile.getAbsolutePath()); } } catch (Exception | Error e) { metrics.statsAggregationFailureCount.inc(); logger.error("Exception while aggregating stats for local report. Stats output file path - {}", statsOutputFile.getAbsolutePath(), e); } }
Source:
private void execute(TopicPartition topicPart) throws IOException { Queue<SinkRecord> records = buffer.get(topicPart); while(!records.isEmpty()) { try { switch (states.get(topicPart)) { case RECOVERY_STARTED: pause(topicPart); nextState(topicPart); case RECOVERY_PARTITION_PAUSED: createWAL(topicPart); nextState(topicPart); case WAL_CREATED: applyWAL(topicPart); nextState(topicPart); case WAL_APPLIED: truncateWAL(topicPart); nextState(topicPart); case WAL_TRUNCATED: resetOffsets(topicPart); nextState(topicPart); case OFFSET_RESET: resume(topicPart); nextState(topicPart); case WRITE_STARTED: pause(topicPart); nextState(topicPart); case WRITE_PARTITION_PAUSED: writeRecord(topicPart, records.peek()); records.poll(); if (shouldRotate(topicPart)) { nextState(topicPart); } else { break; } case SHOULD_ROTATE: closeTempfile(topicPart); nextState(topicPart); case TEMP_FILE_CLOSED: appendToWAL(topicPart); nextState(topicPart); case WAL_APPENDED: commitFile(topicPart); nextState(topicPart); case FILE_COMMITTED: setState(topicPart, State.WRITE_PARTITION_PAUSED); } resume(topicPart); } catch (IllegalWorkerStateException e) { throw e; } catch (IOException | CopycatException e) { log.error("Exception on {}", topicPart); setRetryBackoff(backOffMs); break; } } }

Target:
private void execute(TopicPartition topicPart) throws IOException { Queue<SinkRecord> records = buffer.get(topicPart); if (states.get(topicPart).compareTo(State.WRITE_STARTED) < 0) { recover(topicPart); } while(!records.isEmpty()) { try { switch (states.get(topicPart)) { case WRITE_STARTED: pause(topicPart); nextState(topicPart); case WRITE_PARTITION_PAUSED: writeRecord(topicPart, records.peek()); records.poll(); if (shouldRotate(topicPart)) { nextState(topicPart); } else { break; } case SHOULD_ROTATE: closeTempfile(topicPart); nextState(topicPart); case TEMP_FILE_CLOSED: appendToWAL(topicPart); nextState(topicPart); case WAL_APPENDED: commitFile(topicPart); nextState(topicPart); case FILE_COMMITTED: setState(topicPart, State.WRITE_PARTITION_PAUSED); break; default: log.error("{} is not a valid state to write record.", states.get(topicPart)); } } catch (IllegalWorkerStateException e) { throw e; } catch (IOException | CopycatException e) { log.error("Exception on {}", topicPart); recordFailureTime(topicPart); setRetryBackoff(backOffMs); break; } } if (records.isEmpty()) { resume(topicPart); setState(topicPart, State.WRITE_STARTED); } }
Source:
public void testAuditLogTypeValueUniqueness() { BitSet bitset = new BitSet(bitSetSize); Set<Integer> nonUniqueValues = new TreeSet<>(); for (ActionType vat : ActionType.values()) { if (bitset.get(vat.getValue())) { nonUniqueValues.add(vat.getValue()); } else { bitset.set(vat.getValue()); } } assertTrue("ActionType contains the following non unique values: " + nonUniqueValues, nonUniqueValues.isEmpty()); }

Target:
public void testAuditLogTypeValueUniqueness() { BitSet bitset = new BitSet(bitSetSize); Set<Integer> nonUniqueValues = new TreeSet<>(); for (ActionType at : ActionType.values()) { if (bitset.get(at.getValue())) { nonUniqueValues.add(at.getValue()); } else { bitset.set(at.getValue()); } } assertTrue("ActionType contains the following non unique values: " + nonUniqueValues, nonUniqueValues.isEmpty()); }
Source:
public void visit(NodeTraversal t, Node n, Node parent) { if (NodeUtil.isNameDeclaration(n)) { Node node = n.getFirstFirstChild(); if (node == null) { return; } if (node.isCall() && node.getFirstChild().matchesQualifiedName("goog.require")) { Node callNode = node; String requiredNamespace = callNode.getLastChild().getString(); String localName = n.getFirstChild().getQualifiedName(); convertRequireToImportStatements( n, Collections.singletonList(localName), requiredNamespace, false); return; } if (node.isObjectPattern() && node.getNext().getFirstChild() != null && node.getNext().getFirstChild().matchesQualifiedName("goog.require")) { Node importedNode = node.getFirstChild(); List<String> namedExports = new ArrayList(); while (importedNode != null) { namedExports.add(importedNode.getString()); importedNode = importedNode.getNext(); } String requiredNamespace = node.getNext().getFirstChild().getNext().getString(); requiredNamespace += "." + namedExports.get(0); convertRequireToImportStatements(n, namedExports, requiredNamespace, true); return; } } else if (n.isExprResult()) { Node callNode = n.getFirstChild(); if (callNode == null || !callNode.isCall()) { return; } if (callNode.getFirstChild().matchesQualifiedName("goog.require")) { String requiredNamespace = callNode.getLastChild().getString(); convertRequireToImportStatements( n, Collections.singletonList(requiredNamespace), requiredNamespace, false); return; } } }

Target:
public void visit(NodeTraversal t, Node n, Node parent) { if (NodeUtil.isNameDeclaration(n)) { Node node = n.getFirstFirstChild(); if (node == null) { return; } if (node.isCall() && node.getFirstChild().matchesQualifiedName("goog.require")) { Node callNode = node; String requiredNamespace = callNode.getLastChild().getString(); String localName = n.getFirstChild().getQualifiedName(); convertRequireToImportStatements( n, Collections.singletonList(localName), requiredNamespace, false); return; } if (node.isObjectPattern() && node.getNext().getFirstChild() != null && node.getNext().getFirstChild().matchesQualifiedName("goog.require")) { Node importedNode = node.getFirstChild(); List<String> namedExports = new ArrayList(); while (importedNode != null) { namedExports.add(importedNode.getString()); importedNode = importedNode.getNext(); } String requiredNamespace = node.getNext().getFirstChild().getNext().getString(); convertRequireToImportStatements(n, namedExports, requiredNamespace, true); return; } } else if (n.isExprResult()) { Node callNode = n.getFirstChild(); if (callNode == null || !callNode.isCall()) { return; } if (callNode.getFirstChild().matchesQualifiedName("goog.require")) { String requiredNamespace = callNode.getLastChild().getString(); convertRequireToImportStatements( n, Collections.singletonList(requiredNamespace), requiredNamespace, false); return; } } }
Source:
public int concurrencyKey() { return (int) key; }

Target:
public long concurrencyKey() { return key; }
Source:
static String applyModifiers(final String label, final List<String> parts, final int offset) { String resultingLabel = label; for (int j = offset; j < parts.size(); j++) { String modifier = parts.get(j); if ("abbr".equals(modifier)) { StringBuilder abbreviateSB = new StringBuilder(); String[] words = resultingLabel.replaceAll("[\\{\\}']", "") .split("[\\(\\) \r\n\"]"); for (String word : words) { if (!word.isEmpty()) { abbreviateSB.append(word.charAt(0)); } } resultingLabel = abbreviateSB.toString(); } else if (modifier.matches("truncate[\\d]+")) { int N = Integer.parseInt(modifier.substring(8)); N = Math.min(N, resultingLabel.length()); resultingLabel = resultingLabel.substring(0, N).stripTrailing(); } else { Optional<Formatter> formatter = Formatters.getFormatterForModifier(modifier); if (formatter.isPresent()) { resultingLabel = formatter.get().format(resultingLabel); } else if (!modifier.isEmpty() && (modifier.length() >= 2) && (modifier.charAt(0) == '(') && modifier.endsWith(")")) { if (label.isEmpty() && (modifier.length() > 2)) { resultingLabel = modifier.substring(1, modifier.length() - 1); } } else { LOGGER.warn("Key generator warning: unknown modifier '" + modifier + "'."); } } } return resultingLabel; }

Target:
static String applyModifiers(final String label, final List<String> parts, final int offset) { String resultingLabel = label; for (int j = offset; j < parts.size(); j++) { String modifier = parts.get(j); if ("abbr".equals(modifier)) { StringBuilder abbreviateSB = new StringBuilder(); String[] words = resultingLabel.replaceAll("[\\{\\}']", "") .split("[\\(\\) \r\n\"]"); for (String word : words) { if (!word.isEmpty()) { abbreviateSB.append(word.charAt(0)); } } resultingLabel = abbreviateSB.toString(); } else { Optional<Formatter> formatter = Formatters.getFormatterForModifier(modifier); if (formatter.isPresent()) { resultingLabel = formatter.get().format(resultingLabel); } else if (!modifier.isEmpty() && (modifier.length() >= 2) && (modifier.charAt(0) == '(') && modifier.endsWith(")")) { if (label.isEmpty() && (modifier.length() > 2)) { resultingLabel = modifier.substring(1, modifier.length() - 1); } } else { LOGGER.warn("Key generator warning: unknown modifier '" + modifier + "'."); } } } return resultingLabel; }
Source:
public void prefixTrim(final Token address) { log.info("PrefixTrim[{}]", address); final int numRetries = 3; for (int x = 0; x < numRetries; x++) { try { layoutHelper(e -> { e.getLayout().getPrefixSegments(address.getSequence()).stream() .flatMap(seg -> seg.getStripes().stream()) .flatMap(stripe -> stripe.getLogServers().stream()) .map(e::getLogUnitClient) .map(client -> client.prefixTrim(address)) .forEach(CFUtils::getUninterruptibly); return null; }, true); runtime.getSequencerView().trimCache(address.getSequence()); break; } catch (NetworkException | TimeoutException e) { log.warn("prefixTrim: encountered a network error on try {}", x, e); Duration retryRate = runtime.getParameters().getConnectionRetryRate(); Sleep.sleepUninterruptibly(retryRate); } catch (RuntimeException re) { if (re.getCause().getClass().equals(WrongEpochException.class)) { log.warn("prefixTrim[{}]: wrongEpochException", address); long runtimeEpoch = runtime.getLayoutView().getLayout().getEpoch(); long serverEpoch = ((WrongEpochException)re.getCause()).getCorrectEpoch(); if (runtimeEpoch != serverEpoch) { log.warn("prefixTrim[{}]: wrongEpochException, runtime is in epoch {}, " + "while server is in epoch {}. Invalidate layout for this client and retry.", address, runtimeEpoch, serverEpoch); runtime.invalidateLayout(); } else { throw re; } } else { throw re; } } } }

Target:
public void prefixTrim(final Token address) { log.info("PrefixTrim[{}]", address); final int numRetries = 3; for (int x = 0; x < numRetries; x++) { try { layoutHelper(e -> { e.getLayout().getPrefixSegments(address.getSequence()).stream() .flatMap(seg -> seg.getStripes().stream()) .flatMap(stripe -> stripe.getLogServers().stream()) .map(e::getLogUnitClient) .map(client -> client.prefixTrim(address)) .forEach(cf -> {CFUtils.getUninterruptibly(cf, NetworkException.class, TimeoutException.class, WrongEpochException.class); }); return null; }, true); runtime.getSequencerView().trimCache(address.getSequence()); break; } catch (NetworkException | TimeoutException e) { log.warn("prefixTrim: encountered a network error on try {}", x, e); Duration retryRate = runtime.getParameters().getConnectionRetryRate(); Sleep.sleepUninterruptibly(retryRate); } catch (WrongEpochException wee) { long serverEpoch = wee.getCorrectEpoch(); if (address.getEpoch() == serverEpoch) { long runtimeEpoch = runtime.getLayoutView().getLayout().getEpoch(); log.warn("prefixTrim[{}]: wrongEpochException, runtime is in epoch {}, " + "while server is in epoch {}. Invalidate layout for this client " + "and retry, attempt: {}/{}", address, runtimeEpoch, serverEpoch, x+1, numRetries); runtime.invalidateLayout(); } else { log.error("prefixTrim[{}]: stale prefix trim. Prefix trim on wrong epoch {}, " + "while server on epoch {}", address, address.getEpoch(), serverEpoch); throw wee; } } } }
Source:
private void flushReplicationStream(FlushAction action) throws Exception { action.reset(); replicationStream.execute(action); if (!action.await(this.timeout, TimeUnit.MILLISECONDS)) { throw ActiveMQMessageBundle.BUNDLE.replicationSynchronizationTimeout(timeout); } }

Target:
private void flushReplicationStream(FlushAction action) throws Exception { action.reset(); replicationStream.execute(action); if (!action.await(this.initialReplicationSyncTimeout, TimeUnit.MILLISECONDS)) { throw ActiveMQMessageBundle.BUNDLE.replicationSynchronizationTimeout(initialReplicationSyncTimeout); } }
Source:
protected void updatePlayer(Server server, CommandSource sender, User user, String[] args) throws NotEnoughArgumentsException, PlayerExemptException, ChargeException, MaxMoneyException { }

Target:
protected abstract void updatePlayer(Server server, CommandSource sender, User user, String[] args) throws NotEnoughArgumentsException, PlayerExemptException, ChargeException, MaxMoneyException; @Override protected List<String> getPlayers(final Server server, final CommandSource interactor) { List<String> players = super.getPlayers(server, interactor); players.add("**"); players.add("*"); return players; }
Source:
public static void parseAndReact(@NonNull Activity activity, @NonNull JSONObject paramsJson) throws JSONException { logger.debug("DeepLink received. JSON Details:\n" + paramsJson); final Router router = new Router(); final boolean isLoggedIn = new LoginPrefs(activity).getUsername() != null; if (!isLoggedIn) { activity.startActivity(router.getLogInIntent()); } else { @ScreenDef final String screenName = paramsJson.getString(KEY_SCREEN_NAME); switch (screenName) { case Screen.COURSE_DASHBOARD: { final String courseId = paramsJson.getString(KEY_COURSE_ID); router.showCourseDashboardTabs(activity, null, courseId, false); break; } case Screen.COURSE_VIDEOS: { final String courseId = paramsJson.getString(KEY_COURSE_ID); router.showCourseDashboardTabs(activity, null, courseId, false, screenName); break; } case Screen.PROGRAM: { router.showMainDashboard(activity, screenName); break; } } } }

Target:
public static void parseAndReact(@NonNull Activity activity, @NonNull JSONObject paramsJson) throws JSONException { logger.debug("DeepLink received. JSON Details:\n" + paramsJson); final Router router = new Router(); final boolean isLoggedIn = new LoginPrefs(activity).getUsername() != null; if (!isLoggedIn) { activity.startActivity(router.getLogInIntent()); } else { @ScreenDef final String screenName = paramsJson.getString(KEY_SCREEN_NAME); switch (screenName) { case Screen.COURSE_DASHBOARD: case Screen.COURSE_VIDEOS: { final String courseId = paramsJson.getString(KEY_COURSE_ID); router.showCourseDashboardTabs(activity, null, courseId, false, screenName); break; } case Screen.PROGRAM: { router.showMainDashboard(activity, screenName); break; } } } }
Source:
public FileSystemSecurityRealm(final Path root, final NameRewriter nameRewriter, final int levels, final boolean encoded, final Encoding hashEncoding, final Charset hashCharset) { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(CREATE_SECURITY_REALM); } this.root = root; this.nameRewriter = nameRewriter; this.levels = levels; this.encoded = encoded; this.hashCharset = hashCharset; this.hashEncoding = hashEncoding; }

Target:
public FileSystemSecurityRealm(final Path root, final NameRewriter nameRewriter, final int levels, final boolean encoded, final Encoding hashEncoding, final Charset hashCharset) { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(CREATE_SECURITY_REALM); } this.root = root; this.nameRewriter = nameRewriter; this.levels = levels; this.encoded = encoded; this.hashCharset = hashCharset != null ? hashCharset : StandardCharsets.UTF_8; this.hashEncoding = hashEncoding != null ? hashEncoding : Encoding.BASE64; }
Source:
public Response add(VM vm) { validateParameters(vm, "name", "cluster.id|name"); validateEnums(VM.class, vm); Response response = null; if (isCreateFromSnapshot(vm)) { response = createVmFromSnapshot(vm); } else { validateParameters(vm, "template.id|name"); Guid templateId = getTemplateId(vm); VmStatic staticVm = getMapper(VM.class, VmStatic.class).map(vm, getMapper(VmTemplate.class, VmStatic.class).map(lookupTemplate(templateId), null)); if (namedCluster(vm)) { staticVm.setvds_group_id(getClusterId(vm)); } UsbPolicy usbPolicy = UsbResourceUtils.getUsbPolicy(vm.getUsb(), lookupCluster(staticVm.getvds_group_id())); if (usbPolicy != null) { staticVm.setusb_policy(usbPolicy); } if (!isFiltered()) { if (vm.isSetPlacementPolicy() && vm.getPlacementPolicy().isSetHost() && vm.getPlacementPolicy().getHost().isSetName() && !vm.getPlacementPolicy().getHost().isSetId()) { staticVm.setdedicated_vm_for_vds(createGuidFromString(getHostId(vm.getPlacementPolicy().getHost().getName()))); } } else { vm.setPlacementPolicy(null); } Guid storageDomainId = (vm.isSetStorageDomain() && vm.getStorageDomain().isSetId()) ? asGuid(vm.getStorageDomain().getId()) : Guid.Empty; if (vm.isSetDisks() && vm.getDisks().isSetClone() && vm.getDisks().isClone()) { response = cloneVmFromTemplate(staticVm, vm, templateId); } else if (Guid.Empty.equals(templateId)) { response = addVmFromScratch(staticVm, vm, storageDomainId); } else { response = addVm(staticVm, vm, storageDomainId, templateId); } } return removeRestrictedInfoFromResponse(response); }

Target:
public Response add(VM vm) { validateParameters(vm, "name", "cluster.id|name"); validateEnums(VM.class, vm); Response response = null; if (isCreateFromSnapshot(vm)) { response = createVmFromSnapshot(vm); } else { validateParameters(vm, "template.id|name"); Guid templateId = getTemplateId(vm); VmStatic staticVm = getMapper(VM.class, VmStatic.class).map(vm, getMapper(VmTemplate.class, VmStatic.class).map(lookupTemplate(templateId), null)); if (namedCluster(vm)) { staticVm.setvds_group_id(getClusterId(vm)); } UsbPolicy usbPolicy = UsbResourceUtils.getUsbPolicy(vm.getUsb(), lookupCluster(staticVm.getvds_group_id())); if (usbPolicy != null) { staticVm.setusb_policy(usbPolicy); } if (!isFiltered()) { if (vm.isSetPlacementPolicy() && vm.getPlacementPolicy().isSetHost() && vm.getPlacementPolicy().getHost().isSetName() && !vm.getPlacementPolicy().getHost().isSetId()) { staticVm.setdedicated_vm_for_vds(asGuid(getHostId(vm.getPlacementPolicy().getHost().getName()))); } } else { vm.setPlacementPolicy(null); } Guid storageDomainId = (vm.isSetStorageDomain() && vm.getStorageDomain().isSetId()) ? asGuid(vm.getStorageDomain().getId()) : Guid.Empty; if (vm.isSetDisks() && vm.getDisks().isSetClone() && vm.getDisks().isClone()) { response = cloneVmFromTemplate(staticVm, vm, templateId); } else if (Guid.Empty.equals(templateId)) { response = addVmFromScratch(staticVm, vm, storageDomainId); } else { response = addVm(staticVm, vm, storageDomainId, templateId); } } return removeRestrictedInfoFromResponse(response); }
Source:
private static void saveHighlights(InputFile file, SensorContext context, AnalysisResponseHighlight[] highlights) { NewHighlighting highlighting = context.newHighlighting().onFile(file); for (AnalysisResponseHighlight highlight : highlights) { highlighting.highlight(highlight.startLine, highlight.startCol, highlight.endLine, highlight.endCol, TypeOfText.valueOf(highlight.textType.toUpperCase(Locale.ENGLISH))); } highlighting.save(); }

Target:
private static void saveHighlights(InputFile file, SensorContext context, AnalysisResponseHighlight[] highlights) { NewHighlighting highlighting = context.newHighlighting().onFile(file); for (AnalysisResponseHighlight highlight : highlights) { highlighting.highlight(highlight.startLine, highlight.startCol, highlight.endLine, highlight.endCol, TypeOfText.valueOf(highlight.textType)); } highlighting.save(); }
Source:
private String getAttributeValue(ProjectDescriptor projectDescriptor, String value) { List<String> attributes = projectDescriptor.getAttributes().get(value); if (attributes == null || attributes.isEmpty()) { return ""; } return projectDescriptor.getAttributes().get(value).get(0); }

Target:
private String getAttributeValue(ProjectDescriptor projectDescriptor, String value) { List<String> attributes = projectDescriptor.getAttributes().get(value); if (attributes == null || attributes.isEmpty()) { return null; } return projectDescriptor.getAttributes().get(value).get(0); }
Source:
private IterationStats gatherStats() { Stressor[] threads = backgroundOpsManager.getThreadManager().getStressorThreads(); List<Statistics> stats; if (threads == null) { stats = Collections.EMPTY_LIST; } else { stats = Arrays.asList(threads).stream().filter(t -> t != null).map(t -> t.getStatsSnapshot(true)).collect(Collectors.toList()); } Timeline timeline = backgroundOpsManager.getSlaveState().getTimeline(); long now = TimeService.currentTimeMillis(); long cacheSize = sizeThread.getAndResetSize(); timeline.addValue(Timeline.Category.customCategory(CACHE_SIZE), new Timeline.Value(now, cacheSize)); if (stats.isEmpty()) { for (Timeline.Category valueCategory : timeline.getValueCategories()) { if (valueCategory.getName().endsWith(" Throughput")) { timeline.addValue(valueCategory, new Timeline.Value(now)); } } } else { Statistics aggregated = stats.stream().reduce(Statistics.MERGE).orElseThrow(() -> new IllegalStateException("No statistics!")); for (String operation : aggregated.getOperations()) { OperationThroughput throughput = aggregated.getRepresentation(operation, OperationThroughput.class); Timeline.Category category = Timeline.Category.customCategory(operation + " Throughput"); if (throughput != null && (throughput.gross != 0 || timeline.getValues(category) != null)) { timeline.addValue(category, new Timeline.Value(now, throughput.gross)); } } } log.trace(String.format("Adding iteration %d: %s.", BackgroundStatisticsManager.this.stats.size(), stats)); return new IterationStats(stats, cacheSize); }

Target:
private IterationStats gatherStats() { Stressor[] threads = backgroundOpsManager.getThreadManager().getStressorThreads(); List<Statistics> stats; if (threads == null) { stats = Collections.EMPTY_LIST; } else { stats = Arrays.asList(threads).stream().filter(t -> t != null).map(t -> t.getStatsSnapshot(true)).collect(Collectors.toList()); } Timeline timeline = backgroundOpsManager.getSlaveState().getTimeline(); long now = TimeService.currentTimeMillis(); long cacheSize = sizeThread.getAndResetSize(); timeline.addValue(Timeline.Category.customCategory(CACHE_SIZE), new Timeline.Value(now, cacheSize)); if (stats.isEmpty()) { for (Timeline.Category valueCategory : timeline.getValueCategories()) { if (valueCategory.getName().endsWith(" Throughput")) { timeline.addValue(valueCategory, new Timeline.Value(now, 0)); } } } else { Statistics aggregated = stats.stream().reduce(Statistics.MERGE).orElseThrow(() -> new IllegalStateException("No statistics!")); for (String operation : aggregated.getOperations()) { OperationThroughput throughput = aggregated.getRepresentation(operation, OperationThroughput.class); Timeline.Category category = Timeline.Category.customCategory(operation + " Throughput"); if (throughput != null && (throughput.gross != 0 || timeline.getValues(category) != null)) { timeline.addValue(category, new Timeline.Value(now, throughput.gross)); } } } log.trace(String.format("Adding iteration %d: %s.", BackgroundStatisticsManager.this.stats.size(), stats)); return new IterationStats(stats, cacheSize); }
Source:
public void passesSafeHoursCorrectly() throws InterruptedException { Supplier<Boolean> alternatingSupplier = new Supplier<Boolean>() { Boolean nextValue = true; @Override public Boolean get() { Boolean toReturn = nextValue; nextValue = !nextValue; return toReturn; } }; BackgroundCompactor backgroundCompactor = new BackgroundCompactor(txManager, kvs, mock(LockService.class), alternatingSupplier, priorityCalculator); BackgroundCompactor.CompactionOutcome firstOutcome = backgroundCompactor.grabLockAndRunOnce(lockService); verify(kvs).compactInternally(TABLE, true); BackgroundCompactor.CompactionOutcome secondOutcome = backgroundCompactor.grabLockAndRunOnce(lockService); verify(kvs).compactInternally(TABLE, false); assertThat(firstOutcome).isEqualTo(BackgroundCompactor.CompactionOutcome.SUCCESS); assertThat(secondOutcome).isEqualTo(BackgroundCompactor.CompactionOutcome.SUCCESS); verifyNoMoreInteractions(kvs); }

Target:
public void passesSafeHoursCorrectly() throws InterruptedException { BackgroundCompactor backgroundCompactor = new BackgroundCompactor(txManager, kvs, mock(LockService.class), Stream.iterate(true, bool -> !bool).iterator()::next, priorityCalculator); BackgroundCompactor.CompactionOutcome firstOutcome = backgroundCompactor.grabLockAndRunOnce(lockService); verify(kvs).compactInternally(TABLE, true); BackgroundCompactor.CompactionOutcome secondOutcome = backgroundCompactor.grabLockAndRunOnce(lockService); verify(kvs).compactInternally(TABLE, false); assertThat(firstOutcome).isEqualTo(BackgroundCompactor.CompactionOutcome.SUCCESS); assertThat(secondOutcome).isEqualTo(BackgroundCompactor.CompactionOutcome.SUCCESS); verifyNoMoreInteractions(kvs); }
Source:
String toString(final InputStream inputStream) { try { final ByteArrayOutputStream result = new ByteArrayOutputStream(); final byte[] buffer = new byte[1024]; int length; while ((length = inputStream.read(buffer)) != -1) { result.write(buffer, 0, length); } return result.toString(StandardCharsets.UTF_8.name()); } catch (IOException ioe) { } return null; }

Target:
String toString(final InputStream inputStream) { try (InputStream inputStreamAutoClosable = inputStream; ByteArrayOutputStream result = new ByteArrayOutputStream()) { final byte[] buffer = new byte[1024]; int length; while ((length = inputStreamAutoClosable.read(buffer)) != -1) { result.write(buffer, 0, length); } return result.toString(StandardCharsets.UTF_8.name()); } catch (IOException ioe) { } return null; }
Source:
public void happyPath() throws Exception { context.checking(new Expectations() {{ oneOf(catalog).isSupported(256); will(returnValue(true)); never(constraintValidator).buildConstraintViolationWithTemplate(with(any(String.class))); }}); boolean isValid = validator.isValid(Sets.newHashSet(256), constraintValidator); assertTrue(isValid); }

Target:
public void happyPath() throws Exception { context.checking(new Expectations() {{ oneOf(catalog).isSupported(256); will(returnValue(true)); never(constraintValidator).buildConstraintViolationWithTemplate(with(any(String.class))); }}); List<Integer> ids = Lists.newArrayList(256); boolean isValid = validator.isValid(ids, constraintValidator); assertTrue(isValid); }
Source:
public void testPodServiceAccountName() { assertThat(TASK_MANAGER_SERVICE_ACCOUNT_NAME, is(this.resultPod.getSpec().getServiceAccountName())); }

Target:
public void testPodServiceAccountName() { assertThat(this.resultPod.getSpec().getServiceAccountName(), is(TASK_MANAGER_SERVICE_ACCOUNT_NAME)); }
Source:
public void onMessage(Delivery delivery) throws ActiveMQAMQPException { connection.requireInHandler(); Receiver receiver = ((Receiver) delivery.getLink()); if (receiver.current() != delivery) { return; } try { if (delivery.isAborted()) { receiver.advance(); delivery.settle(); if (!receiver.getDrain()) { receiver.flow(1); } return; } else if (delivery.isPartial()) { if (sessionSPI.getStorageManager() instanceof NullStorageManager) { return; } if (currentLargeMessage == null) { long id = sessionSPI.getStorageManager().generateID(); currentLargeMessage = new AMQPLargeMessage(id, delivery.getMessageFormat(), null, sessionSPI.getCoreMessageObjectPools(), sessionSPI.getStorageManager()); currentLargeMessage.addBytes(receiver.recv()); } else { currentLargeMessage.addBytes(receiver.recv()); } return; } AMQPMessage message; if (currentLargeMessage != null) { currentLargeMessage.addBytes(receiver.recv()); receiver.advance(); currentLargeMessage.finishParse(); message = currentLargeMessage; currentLargeMessage = null; } else { ReadableBuffer data = receiver.recv(); receiver.advance(); message = sessionSPI.createStandardMessage(delivery, data); } Transaction tx = null; if (delivery.getRemoteState() instanceof TransactionalState) { TransactionalState txState = (TransactionalState) delivery.getRemoteState(); tx = this.sessionSPI.getTransaction(txState.getTxnId(), false); } actualDelivery(message, delivery, receiver, tx); } catch (Exception e) { throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e); } }

Target:
public void onMessage(Delivery delivery) throws ActiveMQAMQPException { connection.requireInHandler(); Receiver receiver = ((Receiver) delivery.getLink()); if (receiver.current() != delivery) { return; } try { if (delivery.isAborted()) { receiver.advance(); delivery.settle(); if (!receiver.getDrain()) { receiver.flow(1); } return; } else if (delivery.isPartial()) { if (sessionSPI.getStorageManager() instanceof NullStorageManager) { return; } if (currentLargeMessage == null) { if (minLargeMessageSize > 0 && delivery.available() >= minLargeMessageSize) { initializeCurrentLargeMessage(delivery, receiver); } } else { currentLargeMessage.addBytes(receiver.recv()); } return; } AMQPMessage message; if (!(sessionSPI.getStorageManager() instanceof NullStorageManager) && currentLargeMessage == null && minLargeMessageSize > 0 && delivery.available() >= minLargeMessageSize) { initializeCurrentLargeMessage(delivery, receiver); } if (currentLargeMessage != null) { currentLargeMessage.addBytes(receiver.recv()); receiver.advance(); currentLargeMessage.finishParse(); message = currentLargeMessage; currentLargeMessage = null; } else { ReadableBuffer data = receiver.recv(); receiver.advance(); message = sessionSPI.createStandardMessage(delivery, data); } Transaction tx = null; if (delivery.getRemoteState() instanceof TransactionalState) { TransactionalState txState = (TransactionalState) delivery.getRemoteState(); tx = this.sessionSPI.getTransaction(txState.getTxnId(), false); } actualDelivery(message, delivery, receiver, tx); } catch (Exception e) { throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e); } }