auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testBehaviorSwitches() { assertMarkup("<p></p>", "__NOTOC__"); assertMarkup("<p></p>", "__FORCETOC__"); assertMarkup("<p></p>", "__NOEDITSECTION__"); assertMarkup("<p></p>", "__NEWSECTIONLINK__"); assertMarkup("<p></p>", "__NONEWSECTIONLINK__"); assertMarkup("<p></p>", "__NOGALLERY__"); assertMarkup("<p></p>", "__HIDDENCAT__"); assertMarkup("<p></p>", "__NOCONTENTCONVERT__"); assertMarkup("<p></p>", "__NOCC__"); assertMarkup("<p></p>", "__NOTITLECONVERT__"); assertMarkup("<p></p>", "__NOTC__"); assertMarkup("<p></p>", "__START__"); assertMarkup("<p></p>", "__END__"); assertMarkup("<p></p>", "__INDEX__"); assertMarkup("<p></p>", "__NOINDEX__"); assertMarkup("<p></p>", "__STATICREDIRECT__"); assertMarkup("<p></p>", "__DISAMBIG__"); }

Target:
public void testBehaviorSwitches() { assertMarkup("", "__NOTOC__"); assertMarkup("", "__FORCETOC__"); assertMarkup("", "__NOEDITSECTION__"); assertMarkup("", "__NEWSECTIONLINK__"); assertMarkup("", "__NONEWSECTIONLINK__"); assertMarkup("", "__NOGALLERY__"); assertMarkup("", "__HIDDENCAT__"); assertMarkup("", "__NOCONTENTCONVERT__"); assertMarkup("", "__NOCC__"); assertMarkup("", "__NOTITLECONVERT__"); assertMarkup("", "__NOTC__"); assertMarkup("", "__START__"); assertMarkup("", "__END__"); assertMarkup("", "__INDEX__"); assertMarkup("", "__NOINDEX__"); assertMarkup("", "__STATICREDIRECT__"); assertMarkup("", "__DISAMBIG__"); }
Source:
protected CompletableFuture<LogListInfo> handleRequest(@Nonnull HandlerRequest<EmptyRequestBody, EmptyMessageParameters> request, @Nonnull RestfulGateway gateway) throws RestHandlerException { if (logFileLocation.logFile == null || StringUtils.isNullOrWhitespaceOnly(logFileLocation.logFile.getParent())) { return CompletableFuture.completedFuture(new LogListInfo(Collections.emptyList())); } else { final File[] logFiles = new File(logFileLocation.logFile.getParent()).listFiles(); final List<LogInfo> logsWithLength = Arrays.stream(logFiles) .filter(File::isFile) .map(logFile -> new LogInfo(logFile.getName(), logFile.length())) .collect(Collectors.toList()); return CompletableFuture.completedFuture(new LogListInfo(logsWithLength)); } }

Target:
protected CompletableFuture<LogListInfo> handleRequest(@Nonnull HandlerRequest<EmptyRequestBody, EmptyMessageParameters> request, @Nonnull RestfulGateway gateway) throws RestHandlerException { if (logDir == null) { return CompletableFuture.completedFuture(new LogListInfo(Collections.emptyList())); } final File[] logFiles = logDir.listFiles(); if (logFiles == null) { return FutureUtils.completedExceptionally(new IOException("Could not list files in " + logDir)); } final List<LogInfo> logsWithLength = Arrays.stream(logFiles) .filter(File::isFile) .map(logFile -> new LogInfo(logFile.getName(), logFile.length())) .collect(Collectors.toList()); return CompletableFuture.completedFuture(new LogListInfo(logsWithLength)); }
Source:
public ResourceVerifier verifyListAttributeContainsValue(String attributeName, ModelNode value, String errorMessageSuffix) throws Exception { waitFor(() -> { ModelNodeResult actualResult = ops.readAttribute(resourceAddress, attributeName); return actualResult.isSuccess() && actualResult.hasDefined(Constants.RESULT); }); final ModelNodeResult modelNodeResult = ops.readAttribute(resourceAddress, attributeName); modelNodeResult.assertSuccess(); Assert.assertTrue("Given value '" + value.toString() + "' is not present in list attribute '" + attributeName + "'!" + (errorMessageSuffix == null || errorMessageSuffix.isEmpty() ? "" : " " + errorMessageSuffix), modelNodeResult.listValue().stream() .peek(modelNode -> log.debug("Comparing '{}' with list member '{}'.", modelNode.toString(), value.toString())) .anyMatch(modelNode -> modelNode.equals(value))); return this; }

Target:
public ResourceVerifier verifyListAttributeContainsValue(String attributeName, ModelNode value, String errorMessageSuffix) throws Exception { waitFor(() -> { ModelNodeResult actualResult = ops.readAttribute(resourceAddress, attributeName); return actualResult.isSuccess() && actualResult.hasDefined(Constants.RESULT) && isModelNodePresentInListAttributeValue(attributeName, value); }); final ModelNodeResult modelNodeResult = ops.readAttribute(resourceAddress, attributeName); modelNodeResult.assertSuccess(); Assert.assertTrue("Given value '" + value.toString() + "' is not present in list attribute '" + attributeName + "'!" + (errorMessageSuffix == null || errorMessageSuffix.isEmpty() ? "" : " " + errorMessageSuffix), isModelNodePresentInListAttributeValue(attributeName, value)); return this; }
Source:
private boolean isAdAggregatorIdValid(Bond bond, HostInterfaceLineModel lineModel) { String bondAdAggregatorId = Objects.toString(bond.getAdAggregatorId(), ""); for (HostInterface nic : lineModel.getInterfaces()) { String nicAggregatorId = Objects.toString(nic.getInterface().getAdAggregatorId(), ""); if (!bondAdAggregatorId.equals(nicAggregatorId)) { return false; } } return true; }

Target:
private boolean isAdAggregatorIdValid(Bond bond, HostInterfaceLineModel lineModel) { String bondAdAggregatorId = Objects.toString(bond.getAdAggregatorId()); if (bondAdAggregatorId==null) { return false; } for (HostInterface nic : lineModel.getInterfaces()) { String nicAggregatorId = Objects.toString(nic.getInterface().getAdAggregatorId()); if (!bondAdAggregatorId.equals(nicAggregatorId)) { return false; } } return true; }
Source:
public AlluxioURIStatus(FileInfo fileInfo, HiveFileContext hiveFileContext) { super(fileInfo); this.hiveFileContext = hiveFileContext; }

Target:
public AlluxioURIStatus(FileInfo fileInfo, HiveFileContext hiveFileContext) { super(fileInfo); this.hiveFileContext = requireNonNull(hiveFileContext, "hiveFileContext is null"); }
Source:
private void testEditQuestionNumberAction() { ______TS("edit question number success"); assertEquals(true, feedbackEditPage.clickEditQuestionButton(2)); feedbackEditPage.selectQuestionNumber(2, 1); feedbackEditPage.clickSaveExistingQuestionButton(2); assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, feedbackEditPage.getStatus()); ______TS("questions still editable even if questions numbers became inconsistent"); FeedbackQuestionAttributes firstQuestion = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); assertEquals(1, firstQuestion.questionNumber); FeedbackQuestionAttributes secondQuestion = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 2); assertEquals(2, secondQuestion.questionNumber); secondQuestion.questionNumber = 1; BackDoor.editFeedbackQuestion(secondQuestion); feedbackEditPage = getFeedbackEditPage(); assertTrue(feedbackEditPage.clickEditQuestionButton(1)); assertTrue(feedbackEditPage.clickEditQuestionButton(2)); secondQuestion.questionNumber = 2; BackDoor.editFeedbackQuestion(secondQuestion); feedbackEditPage = getFeedbackEditPage(); }

Target:
private void testEditQuestionNumberAction() { ______TS("edit question number success"); assertEquals(true, feedbackEditPage.clickEditQuestionButton(2)); feedbackEditPage.selectQuestionNumber(2, 1); feedbackEditPage.clickSaveExistingQuestionButton(2); assertEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, feedbackEditPage.getStatus()); ______TS("questions still editable even if questions numbers became inconsistent"); FeedbackQuestionAttributes firstQuestion = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); assertEquals(1, firstQuestion.questionNumber); FeedbackQuestionAttributes secondQuestion = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 2); assertEquals(2, secondQuestion.questionNumber); int originalSecondQuestionNumber = secondQuestion.questionNumber; secondQuestion.questionNumber = firstQuestion.questionNumber; BackDoor.editFeedbackQuestion(secondQuestion); feedbackEditPage = getFeedbackEditPage(); assertTrue(feedbackEditPage.clickEditQuestionButton(1)); assertTrue(feedbackEditPage.clickEditQuestionButton(2)); secondQuestion.questionNumber = originalSecondQuestionNumber; BackDoor.editFeedbackQuestion(secondQuestion); feedbackEditPage = getFeedbackEditPage(); }
Source:
public synchronized void createOrUpdateMeter(Class<?> clazz, String key, String metricName, long value) { Map<String, Metric> metricMap = getMetricsForKey(key); if (!metricMap.containsKey(metricName)) { Meter meter = _metricRegistry.meter(MetricRegistry.name(clazz, key, metricName)); meter.mark(value); metricMap.put(metricName, meter); } else { Metric metric = metricMap.get(metricName); if (metric instanceof Meter) { ((Meter) metric).mark(value); } } }

Target:
public synchronized void createOrUpdateMeter(Class<?> clazz, String key, String metricName, long value) { validateArguments(clazz, key, metricName); String fullMetricName = MetricRegistry.name(clazz, key, metricName); Meter meter = _metricRegistry.getMeters().get(fullMetricName); if (meter == null) { meter = _metricRegistry.meter(fullMetricName); } meter.mark(value); }
Source:
private void executeCommand(ChannelHandlerContext ctx, Command command) throws Exception { RedisResponse response; if (isAuthenticated) { if (command.isOfType(RedisCommandType.SHUTDOWN)) { this.server.shutdown(); return; } if (hasTransaction() && !command.isTransactional()) { response = executeWithTransaction(ctx, command); } else { response = executeWithoutTransaction(command); } if (hasTransaction() && command.isOfType(RedisCommandType.MULTI)) { response = RedisResponse.string(RedisConstants.COMMAND_QUEUED); } } else if (command.isOfType(RedisCommandType.AUTH)) { response = command.execute(this); } else { response = RedisResponse.error(RedisConstants.ERROR_NOT_AUTH); } if (response != null) { writeToChannel(response); } else { if (command.getCommandType() != RedisCommandType.PUBLISH) { writeToChannel(command.getResponse()); } } if (command.isOfType(RedisCommandType.QUIT)) { channelInactive(ctx); } }

Target:
private void executeCommand(ChannelHandlerContext ctx, Command command) throws Exception { RedisResponse response; if (isAuthenticated) { if (command.isOfType(RedisCommandType.SHUTDOWN)) { this.server.shutdown(); return; } if (hasTransaction() && !command.isTransactional()) { response = executeWithTransaction(ctx, command); } else { response = executeWithoutTransaction(command); } logResponse(command); if (hasTransaction() && command.isOfType(RedisCommandType.MULTI)) { response = RedisResponse.string(RedisConstants.COMMAND_QUEUED); } } else if (command.isOfType(RedisCommandType.AUTH)) { response = command.execute(this); } else { response = RedisResponse.error(RedisConstants.ERROR_NOT_AUTH); } if (response == null && !command.isOfType(PUBLISH)) { writeToChannel(command.getResponse()); } else if (response != null) { writeToChannel(response); } if (command.isOfType(RedisCommandType.QUIT)) { channelInactive(ctx); } }
Source:
public Table getTable(TableName tableName, ExecutorService pool) throws IOException { BigtableDataClient client = session.getDataClient(); AsyncExecutor asyncMutator = new AsyncExecutor(client, AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT, AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT, pool); HBaseRequestAdapter adapter = createAdapter(tableName); BatchExecutor batchExecutor = new BatchExecutor(asyncMutator, options, MoreExecutors.listeningDecorator(pool), adapter); return new BigtableTable(this, tableName, options,client, adapter, batchExecutor); }

Target:
public Table getTable(TableName tableName, ExecutorService pool) throws IOException { BigtableDataClient client = session.getDataClient(); AsyncExecutor asyncExecutor = new AsyncExecutor(client, AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT, AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT, pool); HBaseRequestAdapter adapter = createAdapter(tableName); BatchExecutor batchExecutor = new BatchExecutor(asyncExecutor, options, MoreExecutors.listeningDecorator(pool), adapter); return new BigtableTable(this, tableName, options, client, adapter, batchExecutor); }
Source:
public InputStream createInputStream(String filename, IProgressMonitor monitor) throws IOException { String url = OpenshiftUIConstants.URL_VALIDATOR.isValid(filename)?filename:new File(filename).toURI().toString(); try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { IStatus status = OpenshiftUIConstants.TRANSPORT_UTILITY.download(filename, url, out, monitor); if (!status.isOK()) { throw new IOException(status.getMessage()); } return new ByteArrayInputStream(out.toByteArray()); } }

Target:
public InputStream createInputStream(String filename, IProgressMonitor monitor) throws IOException { if (OpenshiftUIConstants.URL_VALIDATOR.isValid(filename)) { try (ByteArrayOutputStream out = new ByteArrayOutputStream()) { IStatus status = OpenshiftUIConstants.TRANSPORT_UTILITY.download(filename, filename, out, monitor); if (!status.isOK()) { throw new IOException(status.getMessage()); } return new ByteArrayInputStream(out.toByteArray()); } } else { return new FileInputStream(filename); } }
Source:
protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> locks = new HashMap<String, Pair<String, String>>(); VDSGroup cluster = getVdsGroup(); if (cluster == null || cluster.supportsVirtService()) { locks.put(getParameters().getVdsId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VDS, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } return locks; }

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> locks = new HashMap<String, Pair<String, String>>(); locks.put(getParameters().getVdsId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VDS, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); return locks; }
Source:
public Mono<ReactiveGridFsResource> getResource(GridFSFile file) { Assert.notNull(file, "GridFSFile must not be null!"); return Mono.fromSupplier(() -> new ReactiveGridFsResource(file, this.doGetBucket(), dataBufferFactory)); }

Target:
public Mono<ReactiveGridFsResource> getResource(GridFSFile file) { Assert.notNull(file, "GridFSFile must not be null!"); return this.doGetBucket() .map(it -> new ReactiveGridFsResource(file, it.downloadToPublisher(file.getId()), dataBufferFactory)); }
Source:
private static AuditListener createListener(String format, String outputLocation) throws UnsupportedEncodingException, FileNotFoundException { OutputStream out; boolean closeOutputStream; if (outputLocation != null) { out = new FileOutputStream(outputLocation); closeOutputStream = true; } else { out = System.out; closeOutputStream = false; } AuditListener listener; if ("xml".equals(format)) { listener = new XMLLogger(out, closeOutputStream); } else if ("plain".equals(format)) { listener = new DefaultLogger(out, closeOutputStream); } else { if (closeOutputStream) { IOUtils.closeQuietly(out); } throw new IllegalStateException("Invalid output format. Found '" + format + "' but expected 'plain' or 'xml'."); } return listener; }

Target:
private static AuditListener createListener(String format, String outputLocation) throws UnsupportedEncodingException, FileNotFoundException { OutputStream out; boolean closeOutputStream; if (outputLocation != null) { out = new FileOutputStream(outputLocation); closeOutputStream = true; } else { out = System.out; closeOutputStream = false; } AuditListener listener; if ("xml".equals(format)) { listener = new XMLLogger(out, closeOutputStream); } else if ("plain".equals(format)) { listener = new DefaultLogger(out, closeOutputStream); } else { if (closeOutputStream) { Utils.close(out); } throw new IllegalStateException("Invalid output format. Found '" + format + "' but expected 'plain' or 'xml'."); } return listener; }
Source:
synchronized void handleResult(List<MutateRowsResponse> results) { mutateRowsFuture = null; if (results.size() != 1) { setFailure(io.grpc.Status.INTERNAL.withDescription("Expected only a single response.") .asRuntimeException()); return; } List<MutateRowsResponse.Entry> entries = new ArrayList<>(); for (MutateRowsResponse response : results) { entries.addAll(response.getEntriesList()); } if (entries.isEmpty()) { setFailure(io.grpc.Status.INTERNAL .withDescription("No MutateRowsResponses entries were found.").asRuntimeException()); return; } try { if (operationsAreComplete()) { LOG.warn("Got duplicate responses for bulk mutation."); setComplete(); return; } if (entries.isEmpty()) { setFailure(io.grpc.Status.INTERNAL.withDescription("No MutateRowResponses were found.") .asRuntimeException()); return; } handleResponses(entries); handleExtraFutures(entries); setComplete(); } catch (Throwable e) { setFailure(e); } }

Target:
synchronized void handleResult(List<MutateRowsResponse> results) { mutateRowsFuture = null; List<MutateRowsResponse.Entry> entries = new ArrayList<>(); for (MutateRowsResponse response : results) { entries.addAll(response.getEntriesList()); } if (entries.isEmpty()) { setFailure(io.grpc.Status.INTERNAL .withDescription("No MutateRowsResponses entries were found.").asRuntimeException()); return; } try { if (operationsAreComplete()) { LOG.warn("Got duplicate responses for bulk mutation."); setComplete(); return; } if (entries.isEmpty()) { setFailure(io.grpc.Status.INTERNAL.withDescription("No MutateRowResponses were found.") .asRuntimeException()); return; } handleResponses(entries); handleExtraFutures(entries); setComplete(); } catch (Throwable e) { setFailure(e); } }
Source:
public List<Response> getFromCanvas(@NotNull String oauthToken, @NotNull String url, Consumer<Response> callback) throws InvalidOauthTokenException, IOException { LOG.debug("Sending GET request to: " + url); final List<Response> responses = new ArrayList<>(); while (!StringUtils.isBlank(url)) { Response response = getSingleResponseFromCanvas(oauthToken, url); if (response.getResponseCode() == 401) { throw new InvalidOauthTokenException(); } else if (response.getErrorHappened() || response.getResponseCode() != 200) { LOG.error("Errors retrieving responses from canvas for url: " + url); return Collections.emptyList(); } responses.add(response); url = response.getNextLink(); if (callback != null) { callback.accept(response); } } return responses; }

Target:
public List<Response> getFromCanvas(@NotNull String oauthToken, @NotNull String url, Consumer<Response> callback) throws InvalidOauthTokenException, IOException { LOG.debug("Sending GET request to: " + url); final List<Response> responses = new ArrayList<>(); while (StringUtils.isNotBlank(url)) { Response response = getSingleResponseFromCanvas(oauthToken, url); if (response.getResponseCode() == 401) { throw new InvalidOauthTokenException(); } else if (response.getErrorHappened() || response.getResponseCode() != 200) { LOG.error("Errors retrieving responses from canvas for url: " + url); return Collections.emptyList(); } responses.add(response); url = response.getNextLink(); if (callback != null) { callback.accept(response); } } return responses; }
Source:
private static SslContext getClientSslContext(SSLConfig config) throws GeneralSecurityException, IOException { return SslContextBuilder.forClient() .keyManager(getKeyManagerFactory(config)) .trustManager(getTrustManagerFactory(config)) .sslProvider(SslProvider.OPENSSL) .ciphers(getCipherSuites(config)) .protocols(getEnabledProtocols(config)) .build(); }

Target:
private static SslContext getClientSslContext(SSLConfig config) throws GeneralSecurityException, IOException { logger.info("Using provider for client SslContext", SslContext.defaultClientProvider()); return SslContextBuilder.forClient() .keyManager(getKeyManagerFactory(config)) .trustManager(getTrustManagerFactory(config)) .ciphers(getCipherSuites(config)) .protocols(getEnabledProtocols(config)) .build(); }
Source:
public void test_exactDivide_reverse(Frequency test, Frequency other, int expected) { if (!test.equals(other)) { assertThrowsIllegalArg(() -> Frequency.P1W.exactDivide(Frequency.P1M)); } }

Target:
public void test_exactDivide_reverse(Frequency test, Frequency other, int expected) { if (!test.equals(other)) { assertThrowsIllegalArg(() -> other.exactDivide(test)); } }
Source:
public void execute() throws Exception { while (!CassandraMonitor.hasCassadraStarted()) { logger.debug( "Cassandra has not yet started, hence Snapshot Backup will start after [" + WAIT_TIME_MS / 1000 + "] secs ..."); sleeper.sleep(WAIT_TIME_MS); } if (!lock.tryLock()) { logger.error("Snapshot Operation is already running! Try again later."); throw new Exception("Snapshot Operation already running"); } try { executeSnapshot(); } finally { lock.unlock(); } }

Target:
public void execute() throws Exception { while (!CassandraMonitor.hasCassadraStarted()) { logger.debug( "Cassandra has not yet started, hence Snapshot Backup will start after [" + WAIT_TIME_MS / 1000 + "] secs ..."); sleeper.sleep(WAIT_TIME_MS); } if (!lock.tryLock()) { logger.warn("Snapshot Operation is already running! Try again later."); throw new Exception("Snapshot Operation already running"); } try { executeSnapshot(); } finally { lock.unlock(); } }
Source:
public void subscribe(Pattern pattern, ConsumerRebalanceListener listener) { maybeThrowInvalidGroupIdException(); if (pattern == null || pattern.toString().equals("")) throw new IllegalArgumentException("Topic pattern to subscribe to cannot be " + pattern == null ? "null" : "empty"); acquireAndEnsureOpen(); try { throwIfNoAssignorsConfigured(); log.info("Subscribed to pattern: '{}'", pattern); this.subscriptions.subscribe(pattern, listener); this.coordinator.updatePatternSubscription(metadata.fetch()); this.metadata.requestUpdateForNewTopics(); } finally { release(); } }

Target:
public void subscribe(Pattern pattern, ConsumerRebalanceListener listener) { maybeThrowInvalidGroupIdException(); if (pattern == null || pattern.toString().equals("")) throw new IllegalArgumentException("Topic pattern to subscribe to cannot be " + (pattern == null ? "null" : "empty")); acquireAndEnsureOpen(); try { throwIfNoAssignorsConfigured(); log.info("Subscribed to pattern: '{}'", pattern); this.subscriptions.subscribe(pattern, listener); this.coordinator.updatePatternSubscription(metadata.fetch()); this.metadata.requestUpdateForNewTopics(); } finally { release(); } }
Source:
public void onDisable() { boolean stopping = false; if (isStopping != null) { try { stopping = (boolean) isStopping.invoke(); } catch (Throwable throwable) { throwable.printStackTrace(); } } for (User user : getOnlineUsers()) { if (user.isVanished()) { user.setVanished(false); user.sendMessage(tl("unvanishedReload")); } if (stopping) { user.setLogoutLocation(); if (!user.isHidden()) { user.setLastLogout(System.currentTimeMillis()); } user.stopTransaction(); user.dispose(); continue; } user.stopTransaction(); } cleanupOpenInventories(); if (i18n != null) { i18n.onDisable(); } if (backup != null) { backup.stopTask(); } Economy.setEss(null); Trade.closeLog(); getUserMap().getUUIDMap().shutdown(); HandlerList.unregisterAll(this); }

Target:
public void onDisable() { for (User user : getOnlineUsers()) { if (user.isVanished()) { user.setVanished(false); user.sendMessage(tl("unvanishedReload")); } if (ServerState.isStopping()) { user.setLastLocation(); if (!user.isHidden()) { user.setLastLogout(System.currentTimeMillis()); } user.cleanup(); } else { user.stopTransaction(); } } cleanupOpenInventories(); if (i18n != null) { i18n.onDisable(); } if (backup != null) { backup.stopTask(); } Economy.setEss(null); Trade.closeLog(); getUserMap().getUUIDMap().shutdown(); HandlerList.unregisterAll(this); }
Source:
public static void setTransactionSynchronizationRegistry(TransactionSynchronizationRegistry tsr) { if (tsr != transactionSynchronizationRegistry) { synchronized (WildFlyCustomJtaPlatform.class) { if (tsr != transactionSynchronizationRegistry) { transactionSynchronizationRegistry = tsr; } } } }

Target:
public static void setTransactionSynchronizationRegistry(TransactionSynchronizationRegistry tsr) { if ((Assert.checkNotNullParam("tsr", tsr)) != transactionSynchronizationRegistry) { synchronized (WildFlyCustomJtaPlatform.class) { if (tsr != transactionSynchronizationRegistry) { transactionSynchronizationRegistry = tsr; } } } }
Source:
public void disabledCommand() { jedis.set("mykey", "hello world"); jedis.del("mykey"); }

Target:
public void disabledCommand() { jedis.set("mykey", "hello world2"); try { jedis.del("mykey"); fail("'DEL' command should be unknown"); } catch (JedisDataException expected) { assertEquals("ERR unknown command 'DEL'", expected.getMessage()); } String value = jedis.get("mykey"); assertEquals("hello world2", value); }
Source:
protected TaskLauncherInitializer getDefaultTaskLauncherInitializer(InternalJob job) { TaskLauncherInitializer tli = new TaskLauncherInitializer(); tli.setTaskId(getId()); tli.setJobOwner(job.getJobInfo().getJobOwner()); tli.setRestUrl(System.getProperty("rest.server.url")); tli.setPreScript(getPreScript()); tli.setPostScript(getPostScript()); tli.setControlFlowScript(getFlowScript()); tli.setTaskInputFiles(getInputFilesList()); tli.setTaskOutputFiles(getOutputFilesList()); tli.setNamingService( job.getTaskDataSpaceApplications().get(getId().longValue()).getNamingServiceStub()); tli.setIterationIndex(getIterationIndex()); tli.setReplicationIndex(getReplicationIndex()); Map<String, String> gInfo = getGenericInformationOverridden(job); tli.setGenericInformation(gInfo); tli.setForkEnvironment(getForkEnvironment()); if (isWallTimeSet()) { tli.setWalltime(wallTime); } tli.setPreciousLogs(isPreciousLogs()); tli.setVariables(job.getVariables()); tli.setPingPeriod(PASchedulerProperties.SCHEDULER_NODE_PING_FREQUENCY.getValueAsInt()); tli.setPingAttempts(PASchedulerProperties.SCHEDULER_NODE_PING_ATTEMPTS.getValueAsInt()); return tli; }

Target:
protected TaskLauncherInitializer getDefaultTaskLauncherInitializer(InternalJob job) { TaskLauncherInitializer tli = new TaskLauncherInitializer(); tli.setTaskId(getId()); tli.setJobOwner(job.getJobInfo().getJobOwner()); tli.setSchedulerRestUrl(PASchedulerProperties.SCHEDULER_REST_URL.getValueAsStringOrNull()); tli.setPreScript(getPreScript()); tli.setPostScript(getPostScript()); tli.setControlFlowScript(getFlowScript()); tli.setTaskInputFiles(getInputFilesList()); tli.setTaskOutputFiles(getOutputFilesList()); tli.setNamingService( job.getTaskDataSpaceApplications().get(getId().longValue()).getNamingServiceStub()); tli.setIterationIndex(getIterationIndex()); tli.setReplicationIndex(getReplicationIndex()); Map<String, String> gInfo = getGenericInformationOverridden(job); tli.setGenericInformation(gInfo); tli.setForkEnvironment(getForkEnvironment()); if (isWallTimeSet()) { tli.setWalltime(wallTime); } tli.setPreciousLogs(isPreciousLogs()); tli.setVariables(job.getVariables()); tli.setPingPeriod(PASchedulerProperties.SCHEDULER_NODE_PING_FREQUENCY.getValueAsInt()); tli.setPingAttempts(PASchedulerProperties.SCHEDULER_NODE_PING_ATTEMPTS.getValueAsInt()); return tli; }
Source:
public PortfolioItemSummary summarize() { StringBuilder buf = new StringBuilder(96); CurrencyAmount base = product.getUnderlying().getBaseCurrencyAmount(); CurrencyAmount counter = product.getUnderlying().getCounterCurrencyAmount(); buf.append(product.getLongShort()); buf.append(' '); buf.append(SummarizerUtils.fx(base, counter)); buf.append(" : "); buf.append(SummarizerUtils.date(product.getExpiryDate())); CurrencyPair currencyPair = product.getCurrencyPair(); return SummarizerUtils.summary( this, ProductType.FX_VANILLA_OPTION, buf.toString(), currencyPair.getBase(), currencyPair.getCounter()); }

Target:
public PortfolioItemSummary summarize() { StringBuilder buf = new StringBuilder(96); CurrencyAmount base = product.getUnderlying().getBaseCurrencyAmount(); CurrencyAmount counter = product.getUnderlying().getCounterCurrencyAmount(); buf.append(product.getLongShort()); buf.append(' '); buf.append(SummarizerUtils.fx(base, counter)); buf.append(" Premium "); buf.append(SummarizerUtils.amount(premium.getValue().mapAmount(v -> Math.abs(v)))); buf.append(" : "); buf.append(SummarizerUtils.date(product.getExpiryDate())); CurrencyPair currencyPair = product.getCurrencyPair(); return SummarizerUtils.summary( this, ProductType.FX_VANILLA_OPTION, buf.toString(), currencyPair.getBase(), currencyPair.getCounter()); }
Source:
public boolean equalValues(QosBase obj) { if (this == obj) return true; if (getClass() != obj.getClass()) return false; CpuQos other = (CpuQos) obj; if (cpuLimit == null) { if (other.cpuLimit != null) return false; } else if (!cpuLimit.equals(other.cpuLimit)) return false; return true; }

Target:
public boolean equalValues(QosBase obj) { if (!(obj instanceof CpuQos)) { return false; } CpuQos other = (CpuQos) obj; return ObjectUtils.objectsEqual(cpuLimit, other.getCpuLimit()); }
Source:
public void logMessage(String level, String message) { switch (level) { case "error": LOGGER.error(message); break; case "info": LOGGER.info(message); break; case "debug": LOGGER.debug(message); break; } }

Target:
public void logMessage(String level, String message) { switch (level) { case "logger.log.level.trace": LOGGER.trace(message); break; case "logger.log.level.debug": LOGGER.debug(message); break; case "logger.log.level.info": LOGGER.info(message); break; case "logger.log.level.warn": LOGGER.warn(message); break; default: LOGGER.error(message); break; } }
Source:
public void fromBytes(ByteBuf buf) { int size = ByteBufUtils.readVarInt(buf, 5); data = new long[size][]; for (int i = 0; i < size; i++) { long[] array = new long[3]; for (int j = 0; j < 3; j++) { int val = ByteBufUtils.readVarInt(buf, 5); if (j == 2) { array[j] = (long) val << 32 | ByteBufUtils.readVarInt(buf, 5) & 0xffffffffL; } else { array[j] = val; } } data[i] = array; } }

Target:
public void fromBytes(ByteBuf buf) { int size = ByteBufUtils.readVarInt(buf, 5); data = new EmcPKTInfo[size]; for (int i = 0; i < size; i++) { data[i] = new EmcPKTInfo(ByteBufUtils.readVarInt(buf, 5), ByteBufUtils.readVarInt(buf, 5), buf.readLong()); } }
Source:
public boolean isCallerCalculationRequired() { final int callerCalculationState = this.callerCalculationState; if (callerCalculationState == 0) { return false; } else if (callerCalculationState == 1) { return true; } return super.isCallerCalculationRequired(); }

Target:
public boolean isCallerCalculationRequired() { return callerCalculationRequired || super.isCallerCalculationRequired(); }
Source:
@Override public String toString() { return "StatsQueryRequest{" + "metrics=" + metrics + ", start=" + start + ", end=" + end + ", buckets=" + buckets + ", bucketDuration=" + bucketDuration + ", percentiles=" + percentiles + '}'; }

Target:
@Override public String toString() { return MoreObjects.toStringHelper(this) .add("metrics", metrics) .add("tags", tags) .add("start", start) .add("end", end) .add("buckets", buckets) .add("bucketDuration", bucketDuration) .add("percentiles", percentiles) .add("types", types) .toString(); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { String platformName = config.getPlatformName(); View view = super.onCreateView(inflater, container, savedInstanceState); noFriendsLayout = (LinearLayout) view.findViewById(R.id.friends_course_no_friends_layout); TextView shareBtn = (TextView) view.findViewById(R.id.friends_course_no_btn_share_app); CharSequence shareText = ResourceUtil.getFormattedString(getResources(), R.string.btn_share_app, "platform_name", platformName); shareBtn.setText(shareText); shareBtn.setOnClickListener(this); CharSequence errorText = ResourceUtil.getFormattedString(getResources(), R.string.error_no_friends_connected, "platform_name", platformName); TextView errorMessage = (TextView)view.findViewById(R.id.error_message); errorMessage.setText(errorText); return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { String platformName = config.getPlatformName(); View view = super.onCreateView(inflater, container, savedInstanceState); noFriendsLayout = (LinearLayout) view.findViewById(R.id.friends_course_no_friends_layout); TextView shareBtn = (TextView) view.findViewById(R.id.friends_course_no_btn_share_app); CharSequence shareText = ResourceUtil.getFormattedString(getResources(), R.string.btn_share_app, "platform_name", platformName); shareBtn.setText(shareText); shareBtn.setOnClickListener(this); CharSequence errorText = ResourceUtil.getFormattedString(getResources(), R.string.error_no_friends_connected, "platform_name", platformName); TextView errorMessageView = (TextView)view.findViewById(R.id.error_message); errorMessageView.setText(errorText); return view; }
Source:
public void doNotLeakOnFailedInitializationForChannels() throws Exception { setUp(Http2FrameCodecBuilder.forServer(), new Http2Settings().maxConcurrentStreams(2)); Http2FrameStream stream1 = frameCodec.newStream(); Http2FrameStream stream2 = frameCodec.newStream(); ChannelPromise stream1HeaderPromise = channel.newPromise(); ChannelPromise stream2HeaderPromise = channel.newPromise(); channel.writeAndFlush(new DefaultHttp2HeadersFrame(new DefaultHttp2Headers()).stream(stream1), stream1HeaderPromise); channel.runPendingTasks(); frameInboundWriter.writeInboundGoAway(stream1.id(), 0L, Unpooled.EMPTY_BUFFER); channel.writeAndFlush(new DefaultHttp2HeadersFrame(new DefaultHttp2Headers()).stream(stream2), stream2HeaderPromise); channel.runPendingTasks(); assertTrue(stream1HeaderPromise.syncUninterruptibly().isSuccess()); assertTrue(stream2HeaderPromise.isDone()); assertEquals(0, frameCodec.numInitializingStreams()); channel.finishAndReleaseAll(); }

Target:
public void doNotLeakOnFailedInitializationForChannels() throws Exception { setUp(Http2FrameCodecBuilder.forServer(), new Http2Settings().maxConcurrentStreams(2)); Http2FrameStream stream1 = frameCodec.newStream(); Http2FrameStream stream2 = frameCodec.newStream(); ChannelPromise stream1HeaderPromise = channel.newPromise(); ChannelPromise stream2HeaderPromise = channel.newPromise(); channel.writeAndFlush(new DefaultHttp2HeadersFrame(new DefaultHttp2Headers()).stream(stream1), stream1HeaderPromise); channel.runPendingTasks(); frameInboundWriter.writeInboundGoAway(stream1.id(), 0L, Unpooled.EMPTY_BUFFER); channel.writeAndFlush(new DefaultHttp2HeadersFrame(new DefaultHttp2Headers()).stream(stream2), stream2HeaderPromise); channel.runPendingTasks(); assertTrue(stream1HeaderPromise.syncUninterruptibly().isSuccess()); assertTrue(stream2HeaderPromise.isDone()); assertEquals(0, frameCodec.numInitializingStreams()); assertFalse(channel.finishAndReleaseAll()); }
Source:
public void testBadReplicationLocations() throws Exception { processor = new ReplicationProcessor(repository, badReplicationLocations, maxRetries, retryDelay); try { processor.process(exchange); } finally { verify(processor).equals(ReplicationDestinationUnavailableException.class); } }

Target:
public void testBadReplicationLocations() throws Exception { processor = new ReplicationProcessor(repository, badReplicationLocations, maxRetries, retryDelay); }
Source:
public static boolean isUNC(String path) { if (path.length() < 2) { return false; } char c0 = path.charAt(0); char c1 = path.charAt(1); if (c0 != c1) { return false; } return (c0 == BSLASH || c0 == SLASH); }

Target:
public static boolean isUNC(String path) { if (path.length() >= 2) { char c= path.charAt(0); if (c == IPath.SEPARATOR || c == File.separatorChar) { c= path.charAt(1); return c == IPath.SEPARATOR || c == File.separatorChar; } } return false; }
Source:
public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case END_FAILURE: return getSucceeded() ? AuditLogType.UNASSIGNED: AuditLogType.USER_DEACTIVATE_STORAGE_DOMAIN_FAILED; default: return AuditLogType.UNASSIGNED; } }

Target:
public AuditLogType getAuditLogTypeValue() { return AuditLogType.UNASSIGNED; }
Source:
private boolean hasTenantSpecificTables(HRegion region, byte[] tableName) throws IOException { Scan scan = new Scan(); scan.setStartRow(new byte[]{1}); SingleColumnValueFilter filter = new SingleColumnValueFilter(TABLE_FAMILY_BYTES, DATA_TABLE_NAME_BYTES, EQUAL, tableName); filter.setFilterIfMissing(true); scan.setFilter(filter); RegionScanner scanner = region.getScanner(scan); try { List<KeyValue> results = newArrayList(); scanner.next(results); return results.size() > 0; } finally { scanner.close(); } }

Target:
private boolean hasTenantSpecificTables(HRegion region, byte[] tableName) throws IOException { Scan scan = new Scan(); scan.setStartRow(KeyRange.IS_NOT_NULL_RANGE.getLowerRange()); SingleColumnValueFilter filter = new SingleColumnValueFilter(TABLE_FAMILY_BYTES, DATA_TABLE_NAME_BYTES, EQUAL, tableName); filter.setFilterIfMissing(true); scan.setFilter(filter); RegionScanner scanner = region.getScanner(scan); try { List<KeyValue> results = newArrayList(); scanner.next(results); return results.size() > 0; } finally { scanner.close(); } }
Source:
private void addMatchingProposals(SortedSet<BranchContentProposal> branches, String searchText) { if (proposals.size() > 0) { for (String branchProposal : proposals) { if (branchProposal.toLowerCase().contains(searchText)) { branches.add(new BranchContentProposal(branchProposal)); } } } }

Target:
private void addMatchingProposals(SortedSet<BranchContentProposal> branches, String searchText) { for (String branchProposal : proposals) { if (branchProposal.toLowerCase().contains(searchText)) { branches.add(new BranchContentProposal(branchProposal)); } } }
Source:
public static boolean looksLikeSql(String sql) { final String local = left(stripStart(sql), 7).toLowerCase(); return local.startsWith("insert ") || local.startsWith("update ") || local.startsWith("select ") || local.startsWith("call ") || local.startsWith("delete ") || local.startsWith("create ") || local.startsWith("alter ") || local.startsWith("merge ") || local.startsWith("replace ") || local.startsWith("drop "); }

Target:
public static boolean looksLikeSql(String sql) { final String local = left(stripStart(sql), 8).toLowerCase(); return local.startsWith("insert ") || local.startsWith("update ") || local.startsWith("select ") || local.startsWith("call ") || local.startsWith("delete ") || local.startsWith("create ") || local.startsWith("alter ") || local.startsWith("merge ") || local.startsWith("replace ") || local.startsWith("drop "); }
Source:
HttpSolrServer getMaCore() { return new HttpSolrServer("http://localhost:8090/solr" + "/ma"); }

Target:
HttpSolrServer getMaCore() { return new HttpSolrServer(solrBaseUrl + "/ma"); }
Source:
AzureFileStore(AzureFileSystem parentFileSystem, String containerName) throws IOException { if (Objects.isNull(parentFileSystem)) { throw new IllegalStateException("AzureFileStore cannot be instantiated without a parent FileSystem"); } this.parentFileSystem = parentFileSystem; this.containerClient = this.parentFileSystem.getBlobServiceClient().getBlobContainerClient(containerName); try { if (!this.containerClient.exists()) { this.containerClient.create(); } } catch (Exception e) { throw new IOException("There was an error in establishing the existence of container: " + containerName, e); } }

Target:
AzureFileStore(AzureFileSystem parentFileSystem, String containerName) throws IOException { if (Objects.isNull(parentFileSystem)) { throw Utility.logError(logger, new IllegalStateException("AzureFileStore cannot be instantiated without " + "a parent FileSystem")); } this.parentFileSystem = parentFileSystem; this.containerClient = this.parentFileSystem.getBlobServiceClient().getBlobContainerClient(containerName); try { if (!this.containerClient.exists()) { this.containerClient.create(); } } catch (Exception e) { throw Utility.logError(logger, new IOException("There was an error in establishing the existence of " + "container: " + containerName, e)); } }
Source:
private double settlementPrice(ResolvedDsfTrade trade, RatesProvider ratesProvider) { StandardId standardId = trade.getProduct().getSecurityId().getStandardId(); QuoteId id = QuoteId.of(standardId, FieldName.SETTLEMENT_PRICE); double price = ratesProvider.data(id); ArgChecker.isTrue(price < 10, "Price must be in decimal form, such as 1.007 for a 0.7% rate, but was: {}", price); return price; }

Target:
private double settlementPrice(ResolvedDsfTrade trade, RatesProvider ratesProvider) { StandardId standardId = trade.getProduct().getSecurityId().getStandardId(); QuoteId id = QuoteId.of(standardId, FieldName.SETTLEMENT_PRICE); double price = ratesProvider.data(id); ArgChecker.isTrue( price < 10, "Price must be in decimal form, such as 1.007 for a 0.7% present value, but was: {}", price); return price; }
Source:
private boolean readNextRow() { while (!stop) { String row = getLineWrapped(); if (row == null || row.startsWith("{\"last_seq\":")) { terminate(); return false; } else if (row.isEmpty()) { continue; } setNextRow(gson.fromJson(row, ChangesResult.Row.class)); return true; } return false; }

Target:
private boolean readNextRow() { while (!stop) { String row = getLineWrapped(); if (row == null || row.startsWith("{\"last_seq\":")) { terminate(); return false; } else if (row.isEmpty()) { continue; } setNextRow(gson.fromJson(row, ChangesResult.Row.class)); return true; } terminate(); return false; }
Source:
public Result loginUser() { DynamicForm bindedForm = new DynamicForm().bindFromRequest(); String username = bindedForm.get("loginUsername"); String password = bindedForm.get("loginPassword"); FrontEndDBInterface f = new FrontEndDBInterface(); String passCheck = f.authenticateUser(username, password); if (passCheck.equals("errorCheck")) { String error = "Some error"; LoginViewModel viewModel = new LoginViewModel(); viewModel.errorMessage = error; viewModel.loginUsername = username; viewModel.teamNames = getTeamNames(); return ok(login.render(viewModel)); } session().clear(); session("username", username); return redirect("/"); }

Target:
public Result loginUser() { DynamicForm bindedForm = new DynamicForm().bindFromRequest(); String username = bindedForm.get("loginUsername"); String password = bindedForm.get("loginPassword"); FrontEndDBInterface f = new FrontEndDBInterface(); boolean passCheck = f.authenticateUser(username, password); if (!passCheck) { String error = "Some error"; LoginViewModel viewModel = new LoginViewModel(); viewModel.errorMessage = error; viewModel.loginUsername = username; viewModel.teamNames = getTeamNames(); return ok(login.render(viewModel)); } session().clear(); session("username", username); return redirect("/"); }
Source:
public static void waitForKieServerMessage(final KieServicesClient client, final String containerId, final String expectedMessage) throws Exception { waitForCondition(() -> { ServiceResponse<KieContainerResource> containerResponse = client.getContainerInfo(containerId); if (!containerResponse.getType().equals(ServiceResponse.ResponseType.SUCCESS)) { return false; } List<Message> messagesList = containerResponse.getResult().getMessages(); if (messagesList.size() == 1) { for (String message : messagesList.get(0).getMessages()) { if (message.equals(expectedMessage)) { return true; } } } return false; }); }

Target:
public static void waitForKieServerMessage(final KieServicesClient client, final String containerId, final String expectedMessage) throws Exception { waitForCondition(() -> { ServiceResponse<KieContainerResource> containerResponse = client.getContainerInfo(containerId); if (!containerResponse.getType().equals(ServiceResponse.ResponseType.SUCCESS)) { return false; } List<Message> messagesList = containerResponse.getResult().getMessages(); if (messagesList.size() == 1) { return messagesList.get(0).getMessages().stream().anyMatch(n -> n.equals(expectedMessage)); } return false; }); }
Source:
public MessageBundlesHelper( String dashboardFolderPath, IReadAccess dashboardAccess, IRWAccess pluginAccess, Locale locale, String pluginStaticBaseContentUrl ) throws CpfException { if ( dashboardAccess == null ) { throw new CpfException( "dashboardAccess is null" ); } else if ( pluginAccess == null ) { throw new CpfException( "pluginAccess is null" ); } else if ( locale == null || StringUtils.isEmpty( locale.getLanguage() ) ) { throw new CpfException( "locale language is null" ); } else if ( StringUtils.isEmpty( pluginStaticBaseContentUrl ) ) { throw new CpfException( "pluginStaticBaseContentUrl is null" ); } setDashboardFolderPath( StringUtils.isEmpty( dashboardFolderPath ) ? Util.SEPARATOR : dashboardFolderPath ); setDashboardAccess( dashboardAccess ); setPluginAccess( pluginAccess ); setPluginStaticBaseContentUrl( pluginStaticBaseContentUrl ); setLocale( locale ); init(); }

Target:
public MessageBundlesHelper( String dashboardFolderPath, IReadAccess dashboardAccess, IRWAccess pluginAccess, Locale locale, String pluginStaticBaseContentUrl ) throws IllegalArgumentException, IOException { if ( dashboardAccess == null ) { throw new IllegalArgumentException( "dashboardAccess is null" ); } else if ( pluginAccess == null ) { throw new IllegalArgumentException( "pluginAccess is null" ); } else if ( locale == null || StringUtils.isEmpty( locale.getLanguage() ) ) { throw new IllegalArgumentException( "locale language is null" ); } else if ( StringUtils.isEmpty( pluginStaticBaseContentUrl ) ) { throw new IllegalArgumentException( "pluginStaticBaseContentUrl is null" ); } setDashboardFolderPath( StringUtils.isEmpty( dashboardFolderPath ) ? Util.SEPARATOR : dashboardFolderPath ); setDashboardAccess( dashboardAccess ); setPluginAccess( pluginAccess ); setPluginStaticBaseContentUrl( pluginStaticBaseContentUrl ); setLocale( locale ); init(); }
Source:
public TestTpchDistributedStats() throws Exception { runner = createQueryRunnerWithoutCatalogs(emptyMap(), emptyMap(), 4); runner.createCatalog("tpch", "tpch", ImmutableMap.of( "tpch.column-naming", ColumnNaming.STANDARD.name() )); }

Target:
public TestTpchDistributedStats() throws Exception { runner = createQueryRunnerWithoutCatalogs(emptyMap(), emptyMap()); runner.createCatalog("tpch", "tpch", ImmutableMap.of( "tpch.column-naming", ColumnNaming.STANDARD.name() )); }
Source:
public Xid[] doRecover(Xid xid, String parentNodeName) throws XAException { Xid[] indoubt = null; try { RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); InputObjectState states = new InputObjectState(); if (recoveryStore.allObjUids(ServerTransaction.getType(), states) && (states.notempty())) { Stack<Transaction> values = new Stack<Transaction>(); boolean finished = false; do { Uid uid = null; try { uid = UidHelper.unpackFrom(states); } catch (IOException ex) { jtsLogger.i18NLogger.info_fail_to_read_subordinate_uid(recoveryStore, states, ex); finished = true; } if (uid.notEquals(Uid.nullUid())) { if (parentNodeName != null) { throw new IllegalArgumentException("JTS doRecover method does not handle parentNodeName, see JBTM-2124"); } else if (xid == null) { Transaction tx = SubordinationManager.getTransactionImporter().recoverTransaction(uid); if (tx != null) values.push(tx); } else { SubordinateAtomicTransaction sat = new SubordinateAtomicTransaction(uid); XidImple loadedXid = (XidImple) sat.getXid(); if ((loadedXid != null && loadedXid.getFormatId() == Arjuna.XID()) && (Arrays.equals(loadedXid.getGlobalTransactionId(), xid.getGlobalTransactionId()))) { TransactionImple tx = (TransactionImple) SubordinationManager.getTransactionImporter().recoverTransaction(uid); if (tx != null) values.push(tx); } } } else finished = true; } while (!finished); if (values.size() > 0) { int index = 0; indoubt = new Xid[values.size()]; while (!values.empty()) { TransactionImple id = (TransactionImple) values.pop(); indoubt[index] = id.baseXid(); index++; } } } } catch (Exception ex) { jtsLogger.i18NLogger.info_fail_to_dorecover(xid, parentNodeName, ex); } return indoubt; }

Target:
public Xid[] doRecover(Xid xid, String parentNodeName) throws XAException, NotSupportedException { if(xid != null || parentNodeName != null) throw new NotSupportedException("doRecover method works only with null arguments"); Xid[] indoubt = null; try { RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); InputObjectState states = new InputObjectState(); if (recoveryStore.allObjUids(ServerTransaction.getType(), states) && (states.notempty())) { Stack<Transaction> values = new Stack<Transaction>(); boolean finished = false; do { Uid uid = null; try { uid = UidHelper.unpackFrom(states); } catch (IOException ex) { jtsLogger.i18NLogger.info_fail_to_read_subordinate_uid(recoveryStore, states, ex); finished = true; } if (uid.notEquals(Uid.nullUid())) { Transaction tx = SubordinationManager.getTransactionImporter().recoverTransaction(uid); if (tx != null) values.push(tx); } else finished = true; } while (!finished); if (values.size() > 0) { int index = 0; indoubt = new Xid[values.size()]; while (!values.empty()) { TransactionImple id = (TransactionImple) values.pop(); indoubt[index] = id.baseXid(); index++; } } } } catch (Exception ex) { jtsLogger.i18NLogger.info_fail_to_dorecover(xid, parentNodeName, ex); } return indoubt; }