auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean imageStorageValidation() { if (getDisk().getDiskStorageType() != DiskStorageType.IMAGE || !getVm().getStatus().isRunningOrPaused()) { return true; } DiskImage diskImage = (DiskImage) getDisk(); StorageDomain storageDomain = storageDomainDao.getForStoragePool( diskImage.getStorageIds().get(0), diskImage.getStoragePoolId()); StorageDomainValidator storageDomainValidator = getStorageDomainValidator(storageDomain); return validate(storageDomainValidator.isDomainExistAndActive()) && validate(storageDomainValidator.isBackupDomain()); }

Target:
private boolean imageStorageValidation() { if (getDisk().getDiskStorageType() != DiskStorageType.IMAGE || !getVm().getStatus().isRunningOrPaused()) { return true; } DiskImage diskImage = (DiskImage) getDisk(); StorageDomain storageDomain = storageDomainDao.getForStoragePool( diskImage.getStorageIds().get(0), diskImage.getStoragePoolId()); StorageDomainValidator storageDomainValidator = getStorageDomainValidator(storageDomain); return validate(storageDomainValidator.isDomainExistAndActive()) && validate(storageDomainValidator.isNotBackupDomain()); }
Source:
private boolean isChainFinish() { RebalanceFuture fut = this; while (nonNull(fut)) { if (fut.isInitial() || !fut.isDone() || !fut.result()) return false; else fut = fut.next; } return true; }

Target:
private boolean isChainFinish() { assert isDone() : this; if (isInitial() || !result()) return false; RebalanceFuture fut = next; while (nonNull(fut)) { if (fut.isInitial() || !fut.isDone()) return false; else fut = fut.next; } return true; }
Source:
public int estimateMemoryUsage() { int memEstimate = BASE_MEMORY_USAGE; for (int i = 0; i < numElements; i++) { memEstimate += dvd[i].estimateMemoryUsage(); } return memEstimate; }

Target:
public int estimateMemoryUsage() { int memEstimate = BASE_MEMORY_USAGE; for (int i = 0; i < numElements; i++) { if (dvd[i] != null) memEstimate += dvd[i].estimateMemoryUsage(); } return memEstimate; }
Source:
public String query() { if (query == null) { synchronized (conn) { if (query == null) { query = path() == uri || queryStart == -1 ? null : queryStart > 0 && uri.length() > queryStart ? uri.substring(queryStart + 1) : HttpUtils.parseQuery(uri); } } } return query; }

Target:
public String query() { if (query == null && uri != null) { query = path() == uri || queryStart == -1 ? null : queryStart > 0 && uri.length() > queryStart ? uri.substring(queryStart + 1) : HttpUtils.parseQuery(uri); } return query; }
Source:
public T next() throws IOException { if (firstRead) { int firstByte = inputStream.read(); if (firstByte == -1) { return null; } else { inputStream.unread(firstByte); firstRead = false; } } if (streamParser.hasNext()) { try { return GSON.fromJson(streamParser.next(), messageClass); } catch (JsonIOException e) { throw new IOException(e); } catch (JsonParseException ignore) { } } return null; }

Target:
public T next() throws IOException { if (firstRead) { int firstChar = reader.read(); if (firstChar == -1) { return null; } else { reader.unread(firstChar); firstRead = false; } } if (streamParser.hasNext()) { try { return GSON.fromJson(streamParser.next(), messageClass); } catch (JsonIOException e) { throw new IOException(e); } catch (JsonParseException ignore) { } } return null; }
Source:
private List<String> filterConflictsInCourses(String feedbackSessionName, String[] coursesIdToCopyTo) { List<String> courses = new ArrayList<String>(); for (String courseIdToCopy : coursesIdToCopyTo) { FeedbackSessionAttributes existingFs = logic.getFeedbackSession(feedbackSessionName, courseIdToCopy); boolean isFsAlreadyExist = existingFs != null; if (isFsAlreadyExist) { courses.add(existingFs.getCourseId()); } } return courses; }

Target:
private List<String> filterConflictsInCourses(String feedbackSessionName, String[] coursesIdToCopyTo) { List<String> courses = new ArrayList<String>(); for (String courseIdToCopy : coursesIdToCopyTo) { FeedbackSessionAttributes existingFs = logic.getFeedbackSession(feedbackSessionName, courseIdToCopy); boolean hasExistingFs = existingFs != null; if (hasExistingFs) { courses.add(existingFs.getCourseId()); } } return courses; }
Source:
public Storable get(StorableKey key) throws StorageException { Storable val = null; try { val = guavaCache.get(key); } catch (CacheLoader.InvalidCacheLoadException e) { log.debug("Failed to load nonexistent key [" + key + "]. Returning null value.", e); } catch (ExecutionException e) { throw new StorageException(e); } return val; }

Target:
public Storable get(StorableKey key) throws StorageException { Storable val = null; try { val = guavaCache.get(key); } catch (UncheckedExecutionException e) { if (e.getCause() instanceof NonexistentStorableKeyException) { log.debug("Failed to load nonexistent key [" + key + "]. Returning null value." + Thread.currentThread()); return val; } throw new StorageException(e); } catch (ExecutionException e) { throw new StorageException(e); } return val; }
Source:
public void testInvalidProducerEpochFromProduce() throws InterruptedException { doInitTransactions(); transactionManager.beginTransaction(); transactionManager.failIfNotReadyForSend(); transactionManager.maybeAddPartitionToTransaction(tp0); Future<RecordMetadata> responseFuture = appendToAccumulator(tp0); assertFalse(responseFuture.isDone()); prepareAddPartitionsToTxnResponse(Errors.NONE, tp0, epoch, producerId); prepareProduceResponse(Errors.INVALID_PRODUCER_EPOCH, producerId, epoch); prepareProduceResponse(Errors.NONE, producerId, epoch); sender.runOnce(); runUntil(responseFuture::isDone); assertFalse(transactionManager.hasError()); }

Target:
public void testInvalidProducerEpochFromProduce() throws InterruptedException { doInitTransactions(); transactionManager.beginTransaction(); transactionManager.failIfNotReadyForSend(); transactionManager.maybeAddPartitionToTransaction(tp0); Future<RecordMetadata> responseFuture = appendToAccumulator(tp0); assertFalse(responseFuture.isDone()); prepareAddPartitionsToTxnResponse(Errors.NONE, tp0, epoch, producerId); prepareProduceResponse(Errors.INVALID_PRODUCER_EPOCH, producerId, epoch); prepareProduceResponse(Errors.NONE, producerId, epoch); sender.runOnce(); runUntil(responseFuture::isDone); assertFalse(transactionManager.hasError()); transactionManager.beginCommit(); TransactionManager.TxnRequestHandler handler = transactionManager.nextRequest(false); assertNotNull(handler); assertTrue(handler.requestBuilder() instanceof EndTxnRequest.Builder); handler = transactionManager.nextRequest(false); assertNotNull(handler); assertTrue(handler.requestBuilder() instanceof InitProducerIdRequest.Builder); }
Source:
public WFIterator() throws IOException { final InputStream inputStream = ParsingUtils.openInputStream(path, wrapper); final PositionalBufferedStream pbs; if (hasBlockCompressedExtension(path)) { final InputStream is = new BlockCompressedInputStream(new BufferedInputStream(inputStream, 512000)); pbs = new PositionalBufferedStream(is, 1000); } else { pbs = new PositionalBufferedStream(inputStream, 512000); } pbs.skip(header.getHeaderEnd()); source = codec.makeSourceFromStream(pbs); readNextRecord(); }

Target:
public WFIterator() throws IOException { final InputStream inputStream = new BufferedInputStream(ParsingUtils.openInputStream(path, wrapper), 512000); final PositionalBufferedStream pbs; if (hasBlockCompressedExtension(path)) { final InputStream is = BlockCompressedInputStream.isValidFile(inputStream) ? new BlockCompressedInputStream(inputStream) : new GZIPInputStream(inputStream); pbs = new PositionalBufferedStream(is, 1000); } else { pbs = new PositionalBufferedStream(inputStream, 512000); } pbs.skip(header.getHeaderEnd()); source = codec.makeSourceFromStream(pbs); readNextRecord(); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Provider)) { return false; } Provider other = (Provider) obj; if (!name.equals(other.name) || !role.equals(other.role) || enabled != other.enabled) { return false; } if (params.size() != other.params.size()) { return false; } for (Map.Entry<String, String> param : params.entrySet()) { if (!param.getValue().equals(other.params.get(param.getKey()))) { return false; } } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Provider)) { return false; } Provider other = (Provider) obj; return (new EqualsBuilder()).append(name, other.name) .append(role, other.role) .append(params, other.params) .append(enabled, other.enabled) .build(); }
Source:
public void onLoginSuccess(final Credentials credentials) { PullOrganisationCredentialsController pullOrganisationCredentialsController = new PullOrganisationCredentialsController(credentials, loginActivity); IAsyncExecutor asyncExecutor = new AsyncExecutor(); IMainExecutor mainExecutor = new UIThreadExecutor(); PullOrganisationCredentialsUseCase pullOrganisationCredentialsUseCase = new PullOrganisationCredentialsUseCase(asyncExecutor, mainExecutor, pullOrganisationCredentialsController); pullOrganisationCredentialsUseCase.execute( new PullOrganisationCredentialsUseCase.Callback() { @Override public void onComplete() { CheckCredentialsWithOrgUnitUseCase checkCredentialsWithOrgUnitUseCase = new CheckCredentialsWithOrgUnitUseCase(); checkCredentialsWithOrgUnitUseCase.execute(credentials,LoginActivityStrategy.this); } @Override public void onError(String message) { loginActivity.hideProgressBar(); Log.e(this.getClass().getSimpleName(), message); loginActivity.showError(R.string.dialog_title_error); } @Override public void onNetworkError() { CheckCredentialsWithOrgUnitUseCase checkCredentialsWithOrgUnitUseCase = new CheckCredentialsWithOrgUnitUseCase(); checkCredentialsWithOrgUnitUseCase.execute(credentials,LoginActivityStrategy.this); } @Override public void onPullConversionError() { loginActivity.hideProgressBar(); Log.e(this.getClass().getSimpleName(), "Pull conversion error"); loginActivity.showError(R.string.dialog_pull_error); } @Override public void onInvalidCredentials() { loginActivity.hideProgressBar(); Log.e(this.getClass().getSimpleName(), "Invalid credentials"); loginActivity.showError(R.string.login_invalid_credentials); } }); }

Target:
public void onLoginSuccess(final Credentials credentials) { loginActivity.checkAnnouncement(); }
Source:
public List<Filter> build(Stack<Object> params) { final Object value = params.pop(); final Filter filter = new Filter(propertyName(), convertToComparisonOperator(part.getType()), value); filter.setOwnerEntityType(entityType); filter.setBooleanOperator(booleanOperator); filter.setNegated(isNegated()); setNestedAttributes(part, filter); applyCaseInsensitivityIfShouldIgnoreCase(part, filter); return Collections.singletonList(filter); }

Target:
public List<Filter> build(Stack<Object> params) { Object value = params.pop(); Filter filter = new Filter(propertyName(), convertToComparisonOperator(part.getType()), value); filter.setOwnerEntityType(entityType); filter.setBooleanOperator(booleanOperator); filter.setNegated(isNegated()); setNestedAttributes(part, filter); applyCaseInsensitivityIfShouldIgnoreCase(part, filter); return Collections.singletonList(filter); }
Source:
private void processApplicationDataRecord(final Record record) { DTLSSession session = null; Connection connection = connectionStore.get(record.getPeerAddress()); if (connection != null && (session = connection.getEstablishedSession()) != null) { RawData receivedApplicationMessage = null; synchronized (session) { if (session.isRecordProcessable(record.getEpoch(), record.getSequenceNumber())) { try { record.setSession(session); ApplicationMessage message = (ApplicationMessage) record.getFragment(); connection.handshakeCompleted(record.getPeerAddress()); session.markRecordAsRead(record.getEpoch(), record.getSequenceNumber()); if (messageHandler != null) { receivedApplicationMessage = createApplicationMessage(message, session); } } catch (HandshakeException | GeneralSecurityException e) { discardRecord(record, e); } } else { LOGGER.log(Level.FINER, "Discarding duplicate APPLICATION_DATA record received from peer [{0}]", record.getPeerAddress()); } } RawDataChannel channel = messageHandler; if (channel != null && receivedApplicationMessage != null) { channel.receiveData(receivedApplicationMessage); } } else { LOGGER.log(Level.FINER, "Discarding APPLICATION_DATA record received from peer [{0}] without an active session", new Object[]{record.getPeerAddress()}); } }

Target:
private void processApplicationDataRecord(final Record record) { DTLSSession session = null; Connection connection = connectionStore.get(record.getPeerAddress()); if (connection != null && (session = connection.getEstablishedSession()) != null) { RawData receivedApplicationMessage = null; synchronized (session) { if (session.isRecordProcessable(record.getEpoch(), record.getSequenceNumber())) { try { record.setSession(session); ApplicationMessage message = (ApplicationMessage) record.getFragment(); connection.handshakeCompleted(record.getPeerAddress()); session.markRecordAsRead(record.getEpoch(), record.getSequenceNumber()); receivedApplicationMessage = createApplicationMessage(message, session); } catch (HandshakeException | GeneralSecurityException e) { discardRecord(record, e); } } else { LOGGER.log(Level.FINER, "Discarding duplicate APPLICATION_DATA record received from peer [{0}]", record.getPeerAddress()); } } RawDataChannel channel = messageHandler; if (channel != null && receivedApplicationMessage != null) { channel.receiveData(receivedApplicationMessage); } } else { LOGGER.log(Level.FINER, "Discarding APPLICATION_DATA record received from peer [{0}] without an active session", new Object[]{record.getPeerAddress()}); } }
Source:
public void twoSquares() { String squareOf2 = "2S 2H 2C 8D 2H"; String squareOf5 = "4S 5H 5S 5D 5C"; assertEquals(Arrays.asList(squareOf5), new Poker(Arrays.asList(squareOf2, squareOf5)).getBestHands()); }

Target:
public void twoSquares() { String squareOf2 = "2S 2H 2C 8D 2D"; String squareOf5 = "4S 5H 5S 5D 5C"; assertEquals(Collections.singletonList(squareOf5), new Poker(Arrays.asList(squareOf2, squareOf5)).getBestHands()); }
Source:
static Long getAdjustedMemoryLimit(Job job, Long requestedLimit, AbstractAuditor<? extends AbstractAuditMessage> auditor) { if (requestedLimit == null || requestedLimit == DEFAULT_MAX_MODEL_MEMORY.getBytes()) { return null; } long jobLimitMegaBytes = job.getAnalysisLimits() == null || job.getAnalysisLimits().getModelMemoryLimit() == null ? AnalysisLimits.DEFAULT_MODEL_MEMORY_LIMIT_MB : job.getAnalysisLimits().getModelMemoryLimit(); long allowedMax = (long)(new ByteSizeValue(jobLimitMegaBytes, ByteSizeUnit.MB).getBytes() * 0.40); long adjustedMax = Math.min(requestedLimit, allowedMax - 1); if (adjustedMax != requestedLimit) { String msg = "requested forecast limit [" + requestedLimit + "] exceeded [" + allowedMax + "] (40% of the anomaly job memory limit). Reducing to allowed maximum before running forecast."; logger.warn("[{}] {}", job.getId(), msg); auditor.warning(job.getId(), msg); } return adjustedMax; }

Target:
static Long getAdjustedMemoryLimit(Job job, Long requestedLimit, AbstractAuditor<? extends AbstractAuditMessage> auditor) { if (requestedLimit == null) { return null; } long jobLimitMegaBytes = job.getAnalysisLimits() == null || job.getAnalysisLimits().getModelMemoryLimit() == null ? AnalysisLimits.PRE_6_1_DEFAULT_MODEL_MEMORY_LIMIT_MB : job.getAnalysisLimits().getModelMemoryLimit(); long allowedMax = (long)(new ByteSizeValue(jobLimitMegaBytes, ByteSizeUnit.MB).getBytes() * 0.40); long adjustedMax = Math.min(requestedLimit, allowedMax - 1); if (adjustedMax != requestedLimit) { String msg = "requested forecast memory limit [" + requestedLimit + "] bytes is greater than or equal to [" + allowedMax + "] bytes (40% of the job memory limit). Reducing to [" + adjustedMax + "]."; logger.warn("[{}] {}", job.getId(), msg); auditor.warning(job.getId(), msg); } return adjustedMax; }
Source:
static long calculateDiskCacheSize(File dir) { long size = MIN_DISK_CACHE_SIZE; try { StatFs statFs = new StatFs(dir.getAbsolutePath()); long available = statFs.getBlockCount() * statFs.getBlockSize(); size = available / 50; } catch (IllegalArgumentException ignored) { } return Math.max(Math.min(size, MAX_DISK_CACHE_SIZE), MIN_DISK_CACHE_SIZE); }

Target:
static long calculateDiskCacheSize(File dir) { long size = MIN_DISK_CACHE_SIZE; try { StatFs statFs = new StatFs(dir.getAbsolutePath()); long available = ((long) statFs.getBlockCount()) * statFs.getBlockSize(); size = available / 50; } catch (IllegalArgumentException ignored) { } return Math.max(Math.min(size, MAX_DISK_CACHE_SIZE), MIN_DISK_CACHE_SIZE); }
Source:
private void checkEmptyResultForTargetOnEmptyStorage(Query readCustomersQuery) { final StandStorage standStorageMock = mock(StandStorage.class); when(standStorageMock.readAllByType(any(TypeUrl.class))) .thenReturn(emptyIterator()); when(standStorageMock.readMultiple(any(Iterable.class))) .thenReturn(Collections.<EntityRecord>emptyIterator()); final Stand stand = prepareStandWithAggregateRepo(standStorageMock); final MemoizeQueryResponseObserver responseObserver = new MemoizeQueryResponseObserver(); stand.execute(readCustomersQuery, responseObserver); final List<Any> messageList = checkAndGetMessageList(responseObserver); assertTrue(messageList.isEmpty(), "Query returned a non-empty response message list though the target was empty"); }

Target:
private void checkEmptyResultForTargetOnEmptyStorage(Query readCustomersQuery) { final StandStorage standStorageMock = mock(StandStorage.class); when(standStorageMock.readAllByType(any(TypeUrl.class))) .thenReturn(emptyIterator()); when(standStorageMock.readMultiple(any(Iterable.class))) .thenReturn(Collections.<EntityRecord>emptyIterator()); final Stand stand = prepareStandWithAggregateRepo(standStorageMock); final MemoizeQueryResponseObserver responseObserver = new MemoizeQueryResponseObserver(); stand.execute(readCustomersQuery, responseObserver); final List<Any> messageList = checkAndGetMessageList(responseObserver); assertTrue(messageList.isEmpty(), "Query returned a non-empty response message list though the target had been " + "empty"); }
Source:
public SpockExecutionContext execute(SpockExecutionContext context, DynamicTestExecutor dynamicTestExecutor) throws Exception { verifyNotSkipped(featureInfo); ErrorInfoCollector errorInfoCollector = new ErrorInfoCollector(); context = context.withErrorInfoCollector(errorInfoCollector); ChildExecutor testExecutor = new ChildExecutor(dynamicTestExecutor); context.getRunner().runParameterizedFeature(context, testExecutor); errorInfoCollector.assertEmpty(); if (testExecutor.getExecutionCount() < 1) { throw new SpockExecutionException("Data provider has no data"); } if (featureInfo.isReportIterations()) { return context; } if (testExecutor.results.containsKey(FAILED)) { List<Throwable> failures = testExecutor.results .get(FAILED) .stream() .filter(Objects::nonNull) .collect(toList()); switch (failures.size()) { case 0: throw new SpockAssertionError("At least one iteration failed"); case 1: sneakyThrow(failures.get(0)); default: MultipleFailuresError multipleFailuresError = new MultipleFailuresError(null, failures); multipleFailuresError.setStackTrace(failures.get(0).getStackTrace()); throw multipleFailuresError; } } else if (!testExecutor.results.containsKey(SUCCESSFUL)) { List<Throwable> abortions = testExecutor.results .get(ABORTED) .stream() .filter(Objects::nonNull) .collect(toList()); Throwable abortion; switch (abortions.size()) { case 0: abortion = new TestAbortedException("All iterations were aborted"); break; case 1: abortion = abortions.get(0); break; default: abortion = new MultipleFailuresError(null, abortions); abortion.setStackTrace(abortions.get(0).getStackTrace()); break; } TestAbortedException testAbortedException; if (abortion instanceof TestAbortedException) { testAbortedException = (TestAbortedException) abortion; } else { testAbortedException = new TestAbortedException("All iterations were aborted", abortion); testAbortedException.setStackTrace(abortion.getStackTrace()); } throw testAbortedException; } return context; }

Target:
public SpockExecutionContext execute(SpockExecutionContext context, DynamicTestExecutor dynamicTestExecutor) throws Exception { verifyNotSkipped(featureInfo); ErrorInfoCollector errorInfoCollector = new ErrorInfoCollector(); context = context.withErrorInfoCollector(errorInfoCollector); ParameterizedFeatureChildExecutor childExecutor = new ParameterizedFeatureChildExecutor(this, dynamicTestExecutor); context.getRunner().runParameterizedFeature(context, childExecutor); errorInfoCollector.assertEmpty(); if (childExecutor.getExecutionCount() < 1) { throw new SpockExecutionException("Data provider has no data"); } if (featureInfo.isReportIterations()) { return context; } Map<Status, Queue<Throwable>> childResults = childExecutor.getResults(); if (childResults.containsKey(FAILED)) { handleFailedChildren(childResults); } else if (!childResults.containsKey(SUCCESSFUL)) { handleOnlyAbortedChildren(childResults); } return context; }
Source:
public boolean applyCrossSettingWithNamingRules(final CrossSetting crossSetting, final ImportedCrossesList importedCrossesList, final Integer userId, final Workbook workbook) { int entryIdCounter = 1; for (final ImportedCrosses importedCross : importedCrossesList.getImportedCrosses()) { populateSeedSource(importedCross, workbook); importedCross.setEntryCode(String.valueOf(entryIdCounter)); importedCross.setEntryId(entryIdCounter); entryIdCounter = entryIdCounter + 1; } final GermplasmListResult pairsResult = this.generateGermplasmNamePairs(crossSetting, importedCrossesList.getImportedCrosses(), userId, importedCrossesList.hasPlotDuplicate()); final List<Germplasm> germplasmList = this.extractGermplasmList(pairsResult.germplasmPairs); final Integer crossingNameTypeId = this.getIDForUserDefinedFieldCrossingName(); CrossingUtil.applyMethodNameType(this.germplasmDataManager, pairsResult.germplasmPairs, crossingNameTypeId); this.verifyGermplasmMethodPresent(germplasmList); this.save(crossSetting, importedCrossesList, pairsResult.germplasmPairs); return pairsResult.isTrimed; }

Target:
public boolean applyCrossSettingWithNamingRules(final CrossSetting crossSetting, final ImportedCrossesList importedCrossesList, final Integer userId, final Workbook workbook) { int entryIdCounter = 1; for (final ImportedCrosses importedCross : importedCrossesList.getImportedCrosses()) { populateSeedSource(importedCross, workbook); importedCross.setEntryCode(String.valueOf(entryIdCounter)); importedCross.setEntryId(entryIdCounter); entryIdCounter++; } final GermplasmListResult pairsResult = this.generateGermplasmNamePairs(crossSetting, importedCrossesList.getImportedCrosses(), userId, importedCrossesList.hasPlotDuplicate()); final List<Germplasm> germplasmList = this.extractGermplasmList(pairsResult.germplasmPairs); final Integer crossingNameTypeId = this.getIDForUserDefinedFieldCrossingName(); CrossingUtil.applyMethodNameType(this.germplasmDataManager, pairsResult.germplasmPairs, crossingNameTypeId); this.verifyGermplasmMethodPresent(germplasmList); this.save(crossSetting, importedCrossesList, pairsResult.germplasmPairs); return pairsResult.isTrimed; }
Source:
public void visitNode(Tree tree) { SwitchStatementTree switchStatementTree = (SwitchStatementTree) tree; List<CaseGroupTree> cases = switchStatementTree.cases(); cases.stream().forEach(c -> c.accept(new NestedSwitchVisitor())); }

Target:
public void visitNode(Tree tree) { NestedSwitchVisitor visitor = new NestedSwitchVisitor(); ((SwitchStatementTree) tree).cases().stream().forEach(c -> c.accept(visitor)); }
Source:
private static void appendTimespans(RDF rdf, List<TimespanImpl> timespans) { if (timespans != null) { List<TimeSpanType> timespanList = new ArrayList<>(); for (Timespan ts : timespans) { TimeSpanType timeSpan = new TimeSpanType(); timeSpan.setAbout(ts.getAbout()); addAsList(timeSpan, AltLabel.class, ts.getAltLabel()); addAsObject(timeSpan, Begin.class, ts.getBegin()); addAsObject(timeSpan, End.class, ts.getEnd()); addAsList(timeSpan, HasPart.class, ts.getDctermsHasPart()); addAsList(timeSpan, IsPartOf.class, ts.getIsPartOfArray()); addAsList(timeSpan, Note.class, ts.getNote()); addAsList(timeSpan, SameAs.class, ts.getOwlSameAs()); addAsList(timeSpan, PrefLabel.class, ts.getPrefLabel()); timespanList.add(timeSpan); } rdf.setTimeSpanList(timespanList); } }

Target:
private static void appendTimespans(RDF rdf, List<TimespanImpl> timespans) { if (timespans != null) { List<TimeSpanType> timespanList = new ArrayList<>(); for (Timespan ts : timespans) { TimeSpanType timeSpan = new TimeSpanType(); timeSpan.setAbout(ts.getAbout()); addAsList(timeSpan, AltLabel.class, ts.getAltLabel()); addAsObject(timeSpan, Begin.class, ts.getBegin()); addAsObject(timeSpan, End.class, ts.getEnd()); addAsList(timeSpan, HasPart.class, ts.getDctermsHasPart()); addAsList(timeSpan, IsPartOf.class, ts.getIsPartOf()); addAsList(timeSpan, Note.class, ts.getNote()); addAsList(timeSpan, SameAs.class, ts.getOwlSameAs()); addAsList(timeSpan, PrefLabel.class, ts.getPrefLabel()); timespanList.add(timeSpan); } rdf.setTimeSpanList(timespanList); } }
Source:
public T set(int index, T element) { try { if (element.equals(this.get(index))) { return element; } T oldObject = null; if (comparingSet.add(element)) { oldObject = super.set(index, element); comparingSet.remove(oldObject); } return oldObject; } catch (IndexOutOfBoundsException ioobException) { throw new IndexOutOfBoundsException(); } }

Target:
public T set(int index, T element) { try { if (element.equals(this.get(index))) { return element; } T oldObject = null; if (comparingSet.add(element)) { oldObject = super.set(index, element); comparingSet.remove(oldObject); } return oldObject; } catch (IndexOutOfBoundsException ioobException) { throw ioobException; } }
Source:
protected void open() { super.open(); this.waitUntil((driver) -> Boolean.TRUE .equals(this.getCommandExecutor().executeScript( "return Array.from(document.getElementsByTagName('*')).some(x => x.shadowRoot !== null)"))); }

Target:
protected void open() { super.open(); this.waitUntil((driver) -> Boolean.TRUE .equals(this.getCommandExecutor().executeScript( "return Array.prototype.slice.call(document.getElementsByTagName(\"*\")).some(function (x) { return !!x.shadowRoot })"))); }
Source:
public ClusterConnectionStates(long reconnectBackoffMs, long reconnectBackoffMaxMs, long connectionSetupTimeoutMs, long connectionSetupTimeoutMaxMs, LogContext logContext) { this.log = logContext.logger(ClusterConnectionStates.class); this.reconnectBackoff = new GeometricProgression( reconnectBackoffMs, 2, reconnectBackoffMaxMs, 0.2); this.connectionSetupTimeout = new GeometricProgression( connectionSetupTimeoutMs, 2, connectionSetupTimeoutMaxMs, 0.2); this.nodeState = new HashMap<>(); this.connectingNodes = new HashSet<>(); }

Target:
public ClusterConnectionStates(long reconnectBackoffMs, long reconnectBackoffMaxMs, long connectionSetupTimeoutMs, long connectionSetupTimeoutMaxMs, LogContext logContext) { this.log = logContext.logger(ClusterConnectionStates.class); this.reconnectBackoff = new GeometricProgression( reconnectBackoffMs, RECONNECT_BACKOFF_EXP_BASE, reconnectBackoffMaxMs, RECONNECT_BACKOFF_JITTER); this.connectionSetupTimeout = new GeometricProgression( connectionSetupTimeoutMs, CONNECTION_SETUP_TIMEOUT_EXP_BASE, connectionSetupTimeoutMaxMs, CONNECTION_SETUP_TIMEOUT_JITTER); this.nodeState = new HashMap<>(); this.connectingNodes = new HashSet<>(); }
Source:
private String[] createInvalidParamsForProfileWithScriptInjection() { return new String[] { Const.ParamsNames.STUDENT_SHORT_NAME, "short%<script>alert(\"was here\");</script>", Const.ParamsNames.STUDENT_PROFILE_EMAIL, "<script>alert(\"was here\");</script>", Const.ParamsNames.STUDENT_PROFILE_INSTITUTION, "<script>alert(\"was here\");</script>", Const.ParamsNames.STUDENT_NATIONALITY, "USA<script>alert(\"was here\");</script>", Const.ParamsNames.STUDENT_GENDER, "FEMALE", Const.ParamsNames.STUDENT_PROFILE_MOREINFO, "This is more info on me<script>alert(\"was here\");</script>" }; }

Target:
private String[] createInvalidParamsForProfileWithScriptInjection() { return new String[] { Const.ParamsNames.STUDENT_SHORT_NAME, "short%<script>alert(\"was here\");</script>", Const.ParamsNames.STUDENT_PROFILE_EMAIL, "<script>alert(\"was here\");</script>", Const.ParamsNames.STUDENT_PROFILE_INSTITUTION, "<script>alert(\"was here\");</script>", Const.ParamsNames.STUDENT_NATIONALITY, "USA<script>alert(\"was here\");</script>", Const.ParamsNames.STUDENT_GENDER, "female<script>alert(\"was here\");</script>", Const.ParamsNames.STUDENT_PROFILE_MOREINFO, "This is more info on me<script>alert(\"was here\");</script>" }; }
Source:
static int getEncodedSize(Collection<Cube> cubes) { int size = 0; size += 3 * cubes.size(); for (Cube cube : cubes) { if (!cube.isEmpty()) { size += cube.getStorage().getData().getSerializedSize(); } if (cube.getStorage() != null) { size += cube.getStorage().getBlockLight().getData().length; if (cube.getWorld().provider.hasSkyLight()) { size += cube.getStorage().getSkyLight().getData().length; } } } size += 256 * Integer.BYTES * cubes.size(); for (Cube cube : cubes) { byte[] biomeArray = cube.getBiomeArray(); if (biomeArray == null) continue; size += biomeArray.length; } return size; }

Target:
static int getEncodedSize(Collection<Cube> cubes) { int size = 0; size += cubes.size(); for (Cube cube : cubes) { if (!cube.isEmpty()) { size += cube.getStorage().getData().getSerializedSize(); } if (cube.getStorage() != null) { size += cube.getStorage().getBlockLight().getData().length; if (cube.getWorld().provider.hasSkyLight()) { size += cube.getStorage().getSkyLight().getData().length; } } } size += 256 * Integer.BYTES * cubes.size(); for (Cube cube : cubes) { byte[] biomeArray = cube.getBiomeArray(); if (biomeArray == null) continue; size += biomeArray.length; } return size; }
Source:
public void writeBlock(BlockEncodingSerde blockEncodingSerde, SliceOutput sliceOutput, Block block) { DictionaryBlock dictionaryBlock = (DictionaryBlock) block; dictionaryBlock = dictionaryBlock.compact(); int positionCount = dictionaryBlock.getPositionCount(); sliceOutput.appendInt(positionCount); Block dictionary = dictionaryBlock.getDictionary(); blockEncodingSerde.writeBlock(sliceOutput, dictionary); ImmutableIntArray ids = dictionaryBlock.getIds(); writeIds(sliceOutput, ids.getArray(), ids.getOffset(), ids.getLength()); sliceOutput.appendLong(dictionaryBlock.getDictionarySourceId().getMostSignificantBits()); sliceOutput.appendLong(dictionaryBlock.getDictionarySourceId().getLeastSignificantBits()); sliceOutput.appendLong(dictionaryBlock.getDictionarySourceId().getSequenceId()); }

Target:
public void writeBlock(BlockEncodingSerde blockEncodingSerde, SliceOutput sliceOutput, Block block) { DictionaryBlock dictionaryBlock = (DictionaryBlock) block; dictionaryBlock = dictionaryBlock.compact(); int positionCount = dictionaryBlock.getPositionCount(); sliceOutput.appendInt(positionCount); Block dictionary = dictionaryBlock.getDictionary(); blockEncodingSerde.writeBlock(sliceOutput, dictionary); sliceOutput.writeBytes(dictionaryBlock.getIds()); sliceOutput.appendLong(dictionaryBlock.getDictionarySourceId().getMostSignificantBits()); sliceOutput.appendLong(dictionaryBlock.getDictionarySourceId().getLeastSignificantBits()); sliceOutput.appendLong(dictionaryBlock.getDictionarySourceId().getSequenceId()); }
Source:
public void setUp() { bst = new BinarySearchTree<>(); }

Target:
public void setUp() { binarySearchTree = new BinarySearchTree<>(); }
Source:
public void testWithNoNamespace() throws Exception { ActionChainResult result = new ActionChainResult(); result.setActionName("${actionName}"); String expectedActionName = "testActionName"; String expectedNamespace = "${1-1}"; Map<String, Object> values = new HashMap<>(); values.put("actionName", expectedActionName); ValueStack stack = ActionContext.getContext().getValueStack(); stack.push(values); Mock actionProxyMock = new Mock(ActionProxy.class); actionProxyMock.expect("execute"); actionProxyMock.expectAndReturn("getNamespace", expectedNamespace); actionProxyMock.expectAndReturn("getActionName", expectedActionName); actionProxyMock.expectAndReturn("getMethod", null); ActionProxy actionProxy = (ActionProxy) actionProxyMock.proxy(); ActionProxyFactory testActionProxyFactory = new NamespaceActionNameTestActionProxyFactory(expectedNamespace, expectedActionName, actionProxy); result.setActionProxyFactory(testActionProxyFactory); Mock invocationMock = new Mock(ActionInvocation.class); invocationMock.matchAndReturn("getProxy", actionProxy); invocationMock.matchAndReturn("getInvocationContext", ActionContext.getContext()); try { ActionContext.bound(stack.getActionContext()); result.execute((ActionInvocation) invocationMock.proxy()); actionProxyMock.verify(); } finally { ActionContext.clear(); } }

Target:
public void testWithNoNamespace() throws Exception { ActionChainResult result = new ActionChainResult(); result.setActionName("${actionName}"); String expectedActionName = "testActionName"; String expectedNamespace = "${1-1}"; Map<String, Object> values = new HashMap<>(); values.put("actionName", expectedActionName); ValueStack stack = ActionContext.getContext().getValueStack(); stack.push(values); Mock actionProxyMock = new Mock(ActionProxy.class); actionProxyMock.expect("execute"); actionProxyMock.expectAndReturn("getNamespace", expectedNamespace); actionProxyMock.expectAndReturn("getActionName", expectedActionName); actionProxyMock.expectAndReturn("getMethod", null); ActionProxy actionProxy = (ActionProxy) actionProxyMock.proxy(); ActionProxyFactory testActionProxyFactory = new NamespaceActionNameTestActionProxyFactory(expectedNamespace, expectedActionName, actionProxy); result.setActionProxyFactory(testActionProxyFactory); Mock invocationMock = new Mock(ActionInvocation.class); invocationMock.matchAndReturn("getProxy", actionProxy); invocationMock.matchAndReturn("getInvocationContext", ActionContext.getContext()); try { ActionContext.bind(stack.getActionContext()); result.execute((ActionInvocation) invocationMock.proxy()); actionProxyMock.verify(); } finally { ActionContext.clear(); } }
Source:
public void testRenderPlaceHolder() { final String placeHolder = "placeholder"; final GridRenderer renderer = mock(GridRenderer.class); final GridRendererTheme theme = mock(GridRendererTheme.class); final Text text = mock(Text.class); setup(Optional.empty()); when(context.getRenderer()).thenReturn(renderer); when(renderer.getTheme()).thenReturn(theme); when(theme.getPlaceholderText()).thenReturn(text); metaData.renderPlaceHolder(context, BLOCK_WIDTH, BLOCK_HEIGHT); verify(text).setX(BLOCK_WIDTH / 2); verify(text).setY(BLOCK_HEIGHT / 2); verify(text).setText(placeHolder); verify(text).setListening(false); }

Target:
public void testRenderPlaceHolder() { final GridRenderer renderer = mock(GridRenderer.class); final GridRendererTheme theme = mock(GridRendererTheme.class); final Text text = mock(Text.class); setup(Optional.empty()); when(context.getRenderer()).thenReturn(renderer); when(renderer.getTheme()).thenReturn(theme); when(theme.getPlaceholderText()).thenReturn(text); metaData.renderPlaceHolder(context, BLOCK_WIDTH, BLOCK_HEIGHT); verify(text).setX(BLOCK_WIDTH / 2); verify(text).setY(BLOCK_HEIGHT / 2); verify(text).setText(PLACEHOLDER); verify(text).setListening(false); }
Source:
private ImmutableList<String> installRpmBased() { ImmutableList.Builder<String> commands = ImmutableList.<String>builder(); commands.add("curl <LINK_0> | sudo bash"); commands.add("sudo yum install -y riak"); return commands.build(); }

Target:
private ImmutableList<String> installRpmBased() { return ImmutableList.<String>builder() .add("curl <LINK_0> | " + BashCommands.sudo("bash")) .add(BashCommands.sudo("yum install -y riak")) .build(); }
Source:
private String getArrayResourceMethodName(Element element) { TypeMirror typeMirror = element.asType(); if (TypeKind.ARRAY.equals(typeMirror.getKind())) { ArrayType arrayType = (ArrayType) typeMirror; String componentType = arrayType.getComponentType().toString(); if ("java.lang.String".equals(componentType)) { return "getStringArray"; } else if ("int".equals(componentType)) { return "getIntArray"; } else if ("java.lang.CharSequence".equals(componentType)) { return "getTextArray"; } } else if (TYPED_ARRAY_TYPE.equals(typeMirror.toString())) { return "obtainTypedArray"; } return null; }

Target:
private static String getArrayResourceMethodName(Element element) { TypeMirror typeMirror = element.asType(); if (TYPED_ARRAY_TYPE.equals(typeMirror.toString())) { return "obtainTypedArray"; } if (TypeKind.ARRAY.equals(typeMirror.getKind())) { ArrayType arrayType = (ArrayType) typeMirror; String componentType = arrayType.getComponentType().toString(); if ("java.lang.String".equals(componentType)) { return "getStringArray"; } else if ("int".equals(componentType)) { return "getIntArray"; } else if ("java.lang.CharSequence".equals(componentType)) { return "getTextArray"; } } return null; }
Source:
public void testListDatacenters() { List<Datacenter> datacenters = api().listDatacenters().concat().toList(); assertNotNull(datacenters); for (Datacenter datacenter : datacenters) { assertNotNull(datacenter); } }

Target:
public void testListDatacenters() { FluentIterable<Datacenter> datacenters = api().listDatacenters().concat(); assertNotNull(datacenters); for (Datacenter datacenter : datacenters) { assertNotNull(datacenter); } }
Source:
public MongoDBQueryParsingResult getResult() { OgmEntityPersister entityPersister = (OgmEntityPersister) sessionFactory.getMetamodel().entityPersister( targetType ); Document query = appendDiscriminatorClause( entityPersister, builder.build() ); return new MongoDBQueryParsingResult( targetType, entityPersister.getTableName(), query, getProjectionDocument(), orderBy, unwinds, count ); }

Target:
public MongoDBQueryParsingResult getResult() { OgmEntityPersister entityPersister = (OgmEntityPersister) sessionFactory.getMetamodel().entityPersister( targetType ); Document query = appendDiscriminatorClause( entityPersister, builder.build() ); return new MongoDBQueryParsingResult( targetType, entityPersister.getTableName(), query, getProjectionDocument(), orderBy, unwinds, getOperation() ); }
Source:
public void updateStatData() { URI curStatPathURI = null; URI oldStatPathURI = null; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(PerfPlugin.PERF_COMMAND); stringBuilder.append("%s."); stringBuilder.append(PerfSaveStatsHandler.DATA_EXT); String statNameFormat = stringBuilder.toString(); IPath workingDir = getWorkDir(); String curStatName = String.format(statNameFormat, ""); IPath curStatPath = workingDir.append(curStatName); IRemoteFileProxy proxy = null; try { curStatPathURI = new URI(curStatPath.toPortableString()); proxy = RemoteProxyManager.getInstance().getFileProxy(curStatPathURI); IFileStore curFileStore = proxy.getResource(curStatPathURI.getPath()); if (curFileStore.fetchInfo().exists()) { String oldStatName = String.format(statNameFormat, ".old"); IPath oldStatPath = workingDir.append(oldStatName); oldStatPathURI = new URI(oldStatPath.toPortableString()); IFileStore oldFileStore = proxy.getResource(oldStatPathURI.getPath()); if (oldFileStore.fetchInfo().exists()) { oldFileStore.delete(EFS.NONE, null); } curFileStore.copy(oldFileStore, EFS.NONE, null); } PerfSaveStatsHandler saveStats = new PerfSaveStatsHandler(); saveStats.saveData(PerfPlugin.PERF_COMMAND); } catch (URISyntaxException e) { e.printStackTrace(); } catch (CoreException e) { e.printStackTrace(); } }

Target:
public void updateStatData() { URI curStatPathURI = null; URI oldStatPathURI = null; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(PerfPlugin.PERF_COMMAND); stringBuilder.append("%s."); stringBuilder.append(PerfSaveStatsHandler.DATA_EXT); String statNameFormat = stringBuilder.toString(); IPath workingDir = getWorkDir(); String curStatName = String.format(statNameFormat, ""); IPath curStatPath = workingDir.append(curStatName); IRemoteFileProxy proxy = null; try { curStatPathURI = new URI(curStatPath.toPortableString()); proxy = RemoteProxyManager.getInstance().getFileProxy(curStatPathURI); IFileStore curFileStore = proxy.getResource(curStatPathURI.getPath()); if (curFileStore.fetchInfo().exists()) { String oldStatName = String.format(statNameFormat, ".old"); IPath oldStatPath = workingDir.append(oldStatName); oldStatPathURI = new URI(oldStatPath.toPortableString()); IFileStore oldFileStore = proxy.getResource(oldStatPathURI.getPath()); if (oldFileStore.fetchInfo().exists()) { oldFileStore.delete(EFS.NONE, null); } curFileStore.copy(oldFileStore, EFS.NONE, null); } PerfSaveStatsHandler saveStats = new PerfSaveStatsHandler(); saveStats.saveData(PerfPlugin.PERF_COMMAND); } catch (URISyntaxException e) { MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.MsgProxyError, Messages.MsgProxyError); } catch (CoreException e) { MessageDialog.openError(Display.getCurrent().getActiveShell(), Messages.MsgProxyError, Messages.MsgProxyError); } }
Source:
private DockerClient.BuildParam[] buildParams() throws UnsupportedEncodingException, JsonProcessingException { final List<DockerClient.BuildParam> buildParams = Lists.newArrayList(); if (pullOnBuild) { buildParams.add(DockerClient.BuildParam.pullNewerImage()); } if (noCache) { buildParams.add(DockerClient.BuildParam.noCache()); } if (!buildArgs.isEmpty()) { buildParams.add(DockerClient.BuildParam.create("buildargs", URLEncoder.encode(new ObjectMapper().writeValueAsString(buildArgs), "UTF-8"))); } return buildParams.toArray(new DockerClient.BuildParam[buildParams.size()]); }

Target:
private DockerClient.BuildParam[] buildParams() throws UnsupportedEncodingException, JsonProcessingException { final List<DockerClient.BuildParam> buildParams = Lists.newArrayList(); if (pullOnBuild) { buildParams.add(DockerClient.BuildParam.pullNewerImage()); } if (noCache) { buildParams.add(DockerClient.BuildParam.noCache()); } if (!buildArgs.isEmpty()) { buildParams.add(DockerClient.BuildParam.create("buildargs", URLEncoder.encode(OBJECT_MAPPER.writeValueAsString(buildArgs), "UTF-8"))); } return buildParams.toArray(new DockerClient.BuildParam[buildParams.size()]); }
Source:
private void createMapVariant(final MethodNode mNode, final AnnotationNode anno, final Parameter mapParam, final List<Parameter> genParams, final ClassNode cNode, final BlockStatement inner, final ArgumentListExpression args, final List<String> propNames) { Parameter namedArgKey = param(STRING_TYPE, "namedArgKey"); inner.addStatement( new ForStatement( namedArgKey, callX(varX(mapParam), "keySet"), new AssertStatement(boolX(callX(list2args(propNames), "contains", varX(namedArgKey))), plusX(constX("Unrecognized namedArgKey: "), varX(namedArgKey))) )); Parameter[] genParamsArray = genParams.toArray(Parameter.EMPTY_ARRAY); if (cNode.hasMethod(mNode.getName(), genParamsArray)) { addError("Error during " + NAMED_VARIANT + " processing. Class " + cNode.getNameWithoutPackage() + " already has a named-arg " + (mNode instanceof ConstructorNode ? "constructor" : "method") + " of type " + genParams, mNode); return; } BlockStatement body = new BlockStatement(); int modifiers = getVisibility(anno, mNode, mNode.getClass(), mNode.getModifiers()); if (mNode instanceof ConstructorNode) { body.addStatement(stmt(ctorX(ClassNode.THIS, args))); body.addStatement(inner); skipTypeChecked(addGeneratedConstructor(cNode, modifiers, genParamsArray, mNode.getExceptions(), body )); } else { body.addStatement(inner); body.addStatement(stmt(callThisX(mNode.getName(), args))); skipTypeChecked(addGeneratedMethod(cNode, mNode.getName(), modifiers, mNode.getReturnType(), genParamsArray, mNode.getExceptions(), body )); } }

Target:
private void createMapVariant(final MethodNode mNode, final AnnotationNode anno, final Parameter mapParam, final List<Parameter> genParams, final ClassNode cNode, final BlockStatement inner, final ArgumentListExpression args, final List<String> propNames) { Parameter namedArgKey = param(STRING_TYPE, "namedArgKey"); inner.addStatement( new ForStatement( namedArgKey, callX(varX(mapParam), "keySet"), new AssertStatement(boolX(callX(list2args(propNames), "contains", varX(namedArgKey))), plusX(constX("Unrecognized namedArgKey: "), varX(namedArgKey))) )); Parameter[] genParamsArray = genParams.toArray(Parameter.EMPTY_ARRAY); if (cNode.hasMethod(mNode.getName(), genParamsArray)) { addError("Error during " + NAMED_VARIANT + " processing. Class " + cNode.getNameWithoutPackage() + " already has a named-arg " + (mNode instanceof ConstructorNode ? "constructor" : "method") + " of type " + genParams, mNode); return; } BlockStatement body = new BlockStatement(); int modifiers = getVisibility(anno, mNode, mNode.getClass(), mNode.getModifiers()); if (mNode instanceof ConstructorNode) { body.addStatement(stmt(ctorX(ClassNode.THIS, args))); body.addStatement(inner); addGeneratedConstructor(cNode, modifiers, genParamsArray, mNode.getExceptions(), body ); } else { body.addStatement(inner); body.addStatement(stmt(callThisX(mNode.getName(), args))); addGeneratedMethod(cNode, mNode.getName(), modifiers, mNode.getReturnType(), genParamsArray, mNode.getExceptions(), body ); } }
Source:
private Window(Node n, int capacity) { current = start = first = n; markCapacity = capacity; marked = new ArrayList<Node>(capacity); }

Target:
private Window(Node n, int capacity) { current = start = first = n; markCapacity = capacity; marked = new ArrayList<Node>(capacity + 1); }
Source:
private boolean waitForReady(final MessageContext msgContext) { synchronized (msgContext) { while (!Boolean.TRUE.equals(msgContext.getProperty(PassThroughConstants.WAIT_BUILDER_IN_STREAM_COMPLETE)) && !Boolean.TRUE.equals(msgContext.getProperty("PASSTHRU_CONNECT_ERROR"))) { try { msgContext.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } if (Boolean.TRUE.equals(msgContext.getProperty("PASSTHRU_CONNECT_ERROR"))) { return false; } return true; }

Target:
private boolean waitForReady(final MessageContext msgContext) { synchronized (msgContext) { while (!Boolean.TRUE.equals(msgContext.getProperty(PassThroughConstants.WAIT_BUILDER_IN_STREAM_COMPLETE)) && !Boolean.TRUE.equals(msgContext.getProperty("PASSTHRU_CONNECT_ERROR"))) { try { msgContext.wait(); } catch (InterruptedException e) { log.error("Interrupted while waiting for passthru connection..", e); } } } if (Boolean.TRUE.equals(msgContext.getProperty("PASSTHRU_CONNECT_ERROR"))) { return false; } return true; }