auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void reactOnEventTypesChange() throws InterruptedException { checkForNewChange(); while (null != queuedChanges.peek()) { final DelayedChange change = queuedChanges.peek(); LOG.info("Reacting on delayed change {}", change); final Set<String> unlockedEventTypes = localLocking.lockedEventTypesChanged(change.lockedEventTypes); for (final String unlocked : unlockedEventTypes) { LOG.info("Notifying about unlock of {}", unlocked); final List<Consumer<String>> toNotify; synchronized (consumerListeners) { toNotify = consumerListeners.containsKey(unlocked) ? new ArrayList<>(consumerListeners.get(unlocked)) : null; } if (null != toNotify) { for (final Consumer<String> listener : toNotify) { try { listener.accept(unlocked); } catch (final RuntimeException ex) { LOG.error("Failed to notify about event type unlock", unlocked, ex); } } } } try { zooKeeperHolder.get().setData().forPath( toZkPath("/nodes/" + thisId), String.valueOf(change.version).getBytes(Charsets.UTF_8)); } catch (final Exception ex) { LOG.error("Failed to update node version in zk. Will try to reprocess again", ex); return; } queuedChanges.poll(); LOG.info("Delayed change successfully processed", change); } }

Target:
public void reactOnEventTypesChange() throws InterruptedException { checkForNewChange(); while (!queuedChanges.isEmpty()) { final DelayedChange change = queuedChanges.peek(); LOG.info("Reacting on delayed change {}", change); final Set<String> unlockedEventTypes = localLocking.lockedEventTypesChanged(change.lockedEventTypes); for (final String unlocked : unlockedEventTypes) { LOG.info("Notifying about unlock of {}", unlocked); final List<Consumer<String>> toNotify; synchronized (consumerListeners) { toNotify = consumerListeners.containsKey(unlocked) ? new ArrayList<>(consumerListeners.get(unlocked)) : null; } if (null != toNotify) { for (final Consumer<String> listener : toNotify) { try { listener.accept(unlocked); } catch (final RuntimeException ex) { LOG.error("Failed to notify about event type unlock", unlocked, ex); } } } } try { zooKeeperHolder.get().setData().forPath( toZkPath("/nodes/" + nodeId), String.valueOf(change.version).getBytes(Charsets.UTF_8)); } catch (final Exception ex) { LOG.error("Failed to update node version in zk. Will try to reprocess again", ex); return; } queuedChanges.poll(); LOG.info("Delayed change successfully processed", change); } }
Source:
public Factory(Connection conn) { this(conn, ""); }

Target:
public Factory(Connection conn) { this(conn, null); }
Source:
public CompletionStage<Void> putAllAsync(@Nonnull Map<? extends K, Collection<? extends V>> m) { checkTrueUnsupportedOperation(isClusterVersionGreaterOrEqual(Versions.V4_1), MINIMUM_VERSION_ERROR_4_1); InternalCompletableFuture<Void> future = new InternalCompletableFuture<>(); Map<Data, Data> dataMap = new HashMap<>(); for (Map.Entry e : m.entrySet()) { dataMap.put(toData(e.getKey()), toData(e.getValue())); } putAllInternal(dataMap, future); return future; }

Target:
public CompletionStage<Void> putAllAsync(@Nonnull Map<? extends K, Collection<? extends V>> m) { checkTrueUnsupportedOperation(isClusterVersionGreaterOrEqual(Versions.V4_1), MINIMUM_VERSION_ERROR_4_1); InternalCompletableFuture<Void> future = new InternalCompletableFuture<>(); Map<Data, Data> dataMap = new HashMap<>(); for (Map.Entry e : m.entrySet()) { Collection<Data> dataCollection = CollectionUtil .objectToDataCollection(((Collection<? extends V>) e.getValue()), getNodeEngine().getSerializationService()); dataMap.put(toData(e.getKey()), toData(new DataCollection(dataCollection))); } putAllInternal(dataMap, future); return future; }
Source:
public String getDefaultValue4Build() { if (isTrim() && defaultValue != null) { return defaultValue.trim(); } else { return defaultValue; } }

Target:
public String getDefaultValue4Build() { if (isTrim()) { return Util.fixNull(defaultValue).trim(); } return defaultValue; }
Source:
public static List<String> getPropertyStrings(Resource resource, String namePattern) { String[] vals = resource.getValueMap().get(namePattern, String[].class); List<String> valsList = new ArrayList<>(); if (vals != null) { for (String val : vals) { valsList.add(val); } } return valsList; }

Target:
public static List<String> getPropertyStrings(Resource resource, String namePattern) { String[] vals = resource.getValueMap().get(namePattern, String[].class); return vals != null ? Arrays.asList(vals) : Collections.EMPTY_LIST; }
Source:
private ValidationResult validateWithHostSetupNetworksValidator(VDS host) { NetworkAttachment networkAttachment = selectNetworkAttachmentForValidatation(); HostSetupNetworksValidator validator = new HostSetupNetworksValidator(host, getParameters(), getExistingNics(), getExistingAttachments(), networkAttachment, getNetworkBusinessEntityMap(), networkClusterDao, networkDao, vdsDao, findActiveVmsUsingNetwork, hostSetupNetworksValidatorHelper, networkExclusivenessValidatorResolver, networkAttachmentIpConfigurationValidator, unmanagedNetworkValidator, backend); return validator.validate(); }

Target:
private ValidationResult validateWithHostSetupNetworksValidator(VDS host) { HostSetupNetworksValidator validator = new HostSetupNetworksValidator(host, getParameters(), getExistingNics(), getExistingAttachments(), selectNetworkAttachmentForValidatation(), getNetworkBusinessEntityMap(), networkClusterDao, networkDao, vdsDao, findActiveVmsUsingNetwork, hostSetupNetworksValidatorHelper, networkExclusivenessValidatorResolver, networkAttachmentIpConfigurationValidator, unmanagedNetworkValidator, backend); return validator.validate(); }
Source:
private static int getLastNodeLineNumber(DetailAST lambdaBody) { DetailAST node = lambdaBody.getLastChild(); int result = node.getLineNo(); while (node != null) { result = node.getLineNo(); node = node.getLastChild(); } return result; }

Target:
private static int getLastNodeLineNumber(DetailAST lambdaBody) { DetailAST node = lambdaBody; int result; do { result = node.getLineNo(); node = node.getLastChild(); } while (node != null); return result; }
Source:
private void requestForbidden(HttpServerExchange exchange, String messageId, String qualifiedTopicName) { messageErrorProcessor.sendQuietly( exchange, error("Permission.", AUTH_ERROR), messageId, qualifiedTopicName); }

Target:
private void requestForbidden(HttpServerExchange exchange, String messageId, String qualifiedTopicName) { messageErrorProcessor.sendQuietly( exchange, error("Permission denied.", AUTH_ERROR), messageId, qualifiedTopicName); }
Source:
public HttpResponse doTest() { Jenkins j = Jenkins.getInstance(); String referer = Stapler.getCurrentRequest().getReferer(); String redirect = buildRedirect(referer, j); LOGGER.log(Level.FINE, "coming from {0} and redirecting to {1}", new Object[] {referer, redirect}); return new HttpRedirect(redirect); }

Target:
public HttpResponse doTest() { String referer = Stapler.getCurrentRequest().getReferer(); Jenkins j = Jenkins.getInstance(); String redirect = j.getRootUrl() + "administrativeMonitor/" + id + "/testForReverseProxySetup/" + (referer != null ? Util.rawEncode(referer) : "NO-REFERER") + "/"; LOGGER.log(Level.FINE, "coming from {0} and redirecting to {1}", new Object[] {referer, redirect}); return new HttpRedirect(redirect); }
Source:
public void calculateDerivedFields() { OBSERVED_UNIQUE_UMIS = observedUmis.size(); INFERRED_UNIQUE_UMIS = inferredUmis.size(); PCT_UMI_WITH_N = (double) observedUmiWithN/ ((double) observedUmiWithN + (double) totalObservedUmis); OBSERVED_UMI_ENTROPY = effectiveNumberOfBases(observedUmis); INFERRED_UMI_ENTROPY = effectiveNumberOfBases(inferredUmis); UMI_BASE_QUALITIES = QualityUtil.getPhredScoreFromErrorProbability((double) OBSERVED_BASE_ERRORS / (double) observedUmiBases); }

Target:
public void calculateDerivedFields() { OBSERVED_UNIQUE_UMIS = observedUmis.size(); INFERRED_UNIQUE_UMIS = inferredUmis.size(); PCT_UMI_WITH_N = (double) observedUmiWithNs/ ((double) observedUmiWithNs + (double) totalObservedUmisWithoutNs); OBSERVED_UMI_ENTROPY = effectiveNumberOfBases(observedUmis); INFERRED_UMI_ENTROPY = effectiveNumberOfBases(inferredUmis); UMI_BASE_QUALITIES = QualityUtil.getPhredScoreFromErrorProbability((double) OBSERVED_BASE_ERRORS / (double) observedUmiBases); }
Source:
public Matrix feedForward(final Matrix input) { this.bernoulliMatrix = matrixFactory.bernoulli(inputHeight, inputWidth, dropoutRatio); return bernoulliMatrix.mul(input); }

Target:
public Matrix feedForward(final Matrix input) { this.bernoulliMatrix = matrixFactory .bernoulli(input.getRows(), input.getColumns(), 1 - dropoutRatio, 1 / (1 - dropoutRatio)); return bernoulliMatrix.mul(input); }
Source:
public GetConfigurationObjectResponse getGetConfigurationObjectResponse( @RequestPayload final GetConfigurationObjectAsyncRequest request) throws OsgpException { GetConfigurationObjectResponse response = null; try { response = new GetConfigurationObjectResponse(); final MeterResponseData meterResponseData = this.meterResponseDataService .dequeue(request.getCorrelationUid()); response.setResult(OsgpResultType.fromValue(meterResponseData.getResultType().getValue())); if (meterResponseData.getMessageData() instanceof String) { response.setDescription((String) meterResponseData.getMessageData()); } } catch (final Exception e) { this.handleException(e); } return response; }

Target:
public GetConfigurationObjectResponse getGetConfigurationObjectResponse( @RequestPayload final GetConfigurationObjectAsyncRequest request) throws OsgpException { GetConfigurationObjectResponse response = null; try { final MeterResponseData meterResponseData = this.meterResponseDataService.dequeue( request.getCorrelationUid(), com.alliander.osgp.domain.core.valueobjects.smartmetering.GetConfigurationObjectResponse.class); this.throwExceptionIfResultNotOk(meterResponseData, "retrieving the configuration object"); response = this.configurationMapper.map(meterResponseData.getMessageData(), GetConfigurationObjectResponse.class); } catch (final Exception e) { this.handleException(e); } return response; }
Source:
public void testListCustomerImages() { FluentIterable<CustomerImage> customerImages = api.getServerImageApi().listCustomerImages().concat(); assertNotNull(customerImages); for (CustomerImage customerImage : customerImages) { assertNotNull(customerImage); } }

Target:
public void testListCustomerImages() { FluentIterable<CustomerImage> customerImages = api.getServerImageApi().listCustomerImages().concat(); assertNotNull(customerImages); assertTrue(customerImages.anyMatch(new Predicate<CustomerImage>() { @Override public boolean apply(CustomerImage input) { return input.id().equals(cloneImageId); } })); }
Source:
public String chooseForm() { String response = super.chooseForm(); try { this.loadFieldIntoDatatableFromBpm(); } catch (ApsSystemException t) { logger.error("Error in chooseForm", t); } return response; }

Target:
public String chooseForm() { String response = super.chooseForm(); try { this.loadFieldIntoDatatableFromBpm(); } catch (ApsSystemException t) { logger.error("Error in chooseForm", t); return FAILURE; } return response; }
Source:
Builder addClientCapabilities(Collection<String> clientCapabilities) { for (String cap: clientCapabilities) { if (cap.startsWith("agent=")) { setAgent(cap.substring("agent=".length())); } else { clientCaps.add(cap); } } return this; }

Target:
Builder addClientCapabilities(Collection<String> clientCapabilities) { for (String cap: clientCapabilities) { if (cap.startsWith("agent=")) { agent = cap.substring("agent=".length()); } else { clientCaps.add(cap); } } return this; }
Source:
public StorageDeviceListReturnForXmlRpc getStorageDeviceList() { JsonRpcRequest request = new RequestBuilder("GlusterHost.storageDevicesList").build(); Map<String, Object> response = new FutureMap(this.client, request).withIgnoreResponseKey(); return new StorageDeviceListReturnForXmlRpc(response); }

Target:
public StorageDeviceListReturnForXmlRpc getStorageDeviceList() { JsonRpcRequest request = new RequestBuilder("GlusterHost.storageDevicesList").build(); Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("deviceInfo"); return new StorageDeviceListReturnForXmlRpc(response); }
Source:
public void nodePublishVolume(NodePublishVolumeRequest request, StreamObserver<NodePublishVolumeResponse> responseObserver) { try { Files.createDirectories(Paths.get(request.getTargetPath())); String mountCommand = String.format("goofys --endpoint %s %s %s", s3Endpoint, request.getVolumeId(), request.getTargetPath()); LOG.info("Executing " + mountCommand); executeCommand(mountCommand); responseObserver.onNext(NodePublishVolumeResponse.newBuilder() .build()); responseObserver.onCompleted(); } catch (Exception e) { responseObserver.onError(e); } }

Target:
public void nodePublishVolume(NodePublishVolumeRequest request, StreamObserver<NodePublishVolumeResponse> responseObserver) { try { Files.createDirectories(Paths.get(request.getTargetPath())); String mountCommand = String.format("goofys --endpoint %s %s %s", s3Endpoint, request.getVolumeId(), request.getTargetPath()); LOG.info("Executing {}", mountCommand); executeCommand(mountCommand); responseObserver.onNext(NodePublishVolumeResponse.newBuilder() .build()); responseObserver.onCompleted(); } catch (Exception e) { responseObserver.onError(e); } }
Source:
void beginTransaction() throws ProducerFencedException; void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, String consumerGroupId) throws ProducerFencedException; void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata) throws ProducerFencedException, IllegalGenerationException, UnknownMemberIdException, FencedInstanceIdException; void commitTransaction() throws ProducerFencedException; void abortTransaction() throws ProducerFencedException; Future<RecordMetadata> send(ProducerRecord<K, V> record); Future<RecordMetadata> send(ProducerRecord<K, V> record, Callback callback); void flush(); List<PartitionInfo> partitionsFor(String topic); Map<MetricName, ? extends Metric> metrics(); void close(); @Deprecated default void close(long timeout, TimeUnit unit) { close(Duration.ofMillis(unit.toMillis(timeout))); }

Target:
void beginTransaction() throws ProducerFencedException; void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, String consumerGroupId) throws ProducerFencedException; void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata) throws ProducerFencedException; void commitTransaction() throws ProducerFencedException; void abortTransaction() throws ProducerFencedException; Future<RecordMetadata> send(ProducerRecord<K, V> record); Future<RecordMetadata> send(ProducerRecord<K, V> record, Callback callback); void flush(); List<PartitionInfo> partitionsFor(String topic); Map<MetricName, ? extends Metric> metrics(); void close(); @Deprecated default void close(long timeout, TimeUnit unit) { close(Duration.ofMillis(unit.toMillis(timeout))); }
Source:
public void start() throws ServerConnectorException { String pollingInterval = getProperties().get(Constants.POLLING_INTERVAL); if (pollingInterval != null) { this.interval = Long.parseLong(pollingInterval); } pollingTaskRunner = new PollingTaskRunner(this); pollingTaskRunner.start(); }

Target:
public void start() throws ServerConnectorException { String pollingInterval = getProperties().get(Constants.POLLING_INTERVAL); if (pollingInterval != null) { try { this.interval = Long.parseLong(pollingInterval); } catch (NumberFormatException e) { throw new ServerConnectorException("Could not parse parameter: " + Constants.POLLING_INTERVAL + " to numeric type: Long", e); } } pollingTaskRunner = new PollingTaskRunner(this); pollingTaskRunner.start(); }
Source:
public AttributeEntryModel(long id, long parentId, String name, long start, long end, int quark) { super(id, parentId, name, start, end, true); fQuark = quark; }

Target:
protected AttributeEntryModel(long id, long parentId, String name, long start, long end, int quark) { super(id, parentId, name, start, end, true); fQuark = quark; }
Source:
public static Identifiers extractPersonIdentifiers(PRPAMT201306UV02ParameterList params) { LOG.trace("Entering HL7Parser201305.ExtractPersonIdentifiers method..."); Identifiers ids = new Identifiers(); Identifier id = new Identifier(); if (CollectionUtils.isNotEmpty(params.getLivingSubjectId()) && params.getLivingSubjectId().get(0) != null) { PRPAMT201306UV02LivingSubjectId livingSubjectId = params.getLivingSubjectId().get(0); if (CollectionUtils.isNotEmpty(livingSubjectId.getValue()) && livingSubjectId.getValue().get(0) != null) { II subjectId = livingSubjectId.getValue().get(0); if (subjectId.getExtension() != null && subjectId.getExtension().length() > 0 && subjectId.getRoot() != null && subjectId.getRoot().length() > 0) { id.setId(subjectId.getExtension()); id.setOrganizationId(subjectId.getRoot()); LOG.info("Created id from patient identifier [organization{}", id.getOrganizationId() + "][id=" + id.getId() + "]"); ids.add(id); } else { LOG.info("message does not contain an id"); } } else { LOG.info("message does not contain an id"); } } else { LOG.info("message does not contain an id"); } LOG.trace("Exiting HL7Parser201305.ExtractPersonIdentifiers method..."); return ids; }

Target:
public static Identifiers extractPersonIdentifiers(PRPAMT201306UV02ParameterList params) { LOG.trace("Entering HL7Parser201305.ExtractPersonIdentifiers method..."); Identifiers ids = new Identifiers(); Identifier id = new Identifier(); if (CollectionUtils.isNotEmpty(params.getLivingSubjectId()) && params.getLivingSubjectId().get(0) != null) { PRPAMT201306UV02LivingSubjectId livingSubjectId = params.getLivingSubjectId().get(0); if (CollectionUtils.isNotEmpty(livingSubjectId.getValue()) && livingSubjectId.getValue().get(0) != null) { II subjectId = livingSubjectId.getValue().get(0); if (StringUtils.isNotEmpty(subjectId.getExtension()) && StringUtils.isNotEmpty(subjectId.getRoot())) { id.setId(subjectId.getExtension()); id.setOrganizationId(subjectId.getRoot()); LOG.info("Created id from patient identifier [organization : {}][id : {}] ", id.getOrganizationId() , id.getId()); ids.add(id); } else { LOG.info("message does not contain an id"); } } else { LOG.info("message does not contain an id"); } } else { LOG.info("message does not contain an id"); } LOG.trace("Exiting HL7Parser201305.ExtractPersonIdentifiers method..."); return ids; }
Source:
private SearchRequest getScrollRequestBuilder(Query parameter) { SearchRequest searchRequest = new SearchRequest(ElasticsearchUtils.getIndices(parameter.getTable(), parameter)) .indicesOptions(Utils.indicesOptions()) .types(ElasticsearchUtils.DOCUMENT_TYPE_NAME) .searchType(SearchType.QUERY_THEN_FETCH) .source(new SearchSourceBuilder() .timeout(new TimeValue(getGetQueryTimeout(), TimeUnit.MILLISECONDS)) .size(parameter.getLimit()) .query(new ElasticSearchQueryGenerator().genFilter(parameter.getFilters())) .sort(Utils.storedFieldName(parameter.getSort().getField()), ResultSort.Order.desc == parameter.getSort().getOrder() ? SortOrder.DESC : SortOrder.ASC)); searchRequest.scroll(TimeValue.timeValueSeconds(elasticsearchTuningConfig.getScrollTimeInSeconds())); return searchRequest; }

Target:
private SearchRequest getScrollRequestBuilder(Query parameter) { SearchRequest searchRequest = getSearchRequest(parameter); searchRequest.scroll(TimeValue.timeValueSeconds(elasticsearchTuningConfig.getScrollTimeInSeconds())); return searchRequest; }
Source:
public void commitWithMessageShouldReturnTheTransaction() throws Exception{ String responseString = "{ \"id\": \"foobar\" }"; MockRestAdapter<Transaction> adapter = new MockRestAdapter<>("foobar", responseString, null); adapter.request(new RepromiseFunction<BitreserveRestAdapter, Transaction>() { @Override public Promise<Transaction> call(BitreserveRestAdapter adapter) { Transaction transaction = Fixtures.loadTransaction(new HashMap<String, String>() {{ put("transactionStatus", "pending"); put("originCardId", "foo"); put("transactionId", "bar"); }}); transaction.setBitreserveRestAdapter(adapter); return transaction.commit(new TransactionMessageRequest("foobar")); } }); Request request = adapter.getRequest(); Transaction transaction = adapter.getResult(); Assert.assertEquals(request.getUrl(), "<LINK_0>"); Assert.assertEquals(request.getMethod(), "POST"); Assert.assertEquals(transaction.getId(), "foobar"); }

Target:
public void commitWithMessageShouldReturnTheTransaction() throws Exception { ByteArrayOutputStream bodyOutput = new ByteArrayOutputStream(); String responseString = "{ \"id\": \"foobar\" }"; MockRestAdapter<Transaction> adapter = new MockRestAdapter<>("foobar", responseString, null); adapter.request(new RepromiseFunction<BitreserveRestAdapter, Transaction>() { @Override public Promise<Transaction> call(BitreserveRestAdapter adapter) { Transaction transaction = Fixtures.loadTransaction(new HashMap<String, String>() {{ put("transactionStatus", "pending"); put("originCardId", "foo"); put("transactionId", "bar"); }}); transaction.setBitreserveRestAdapter(adapter); return transaction.commit(new TransactionCommitRequest("foobar")); } }); Request request = adapter.getRequest(); Transaction transaction = adapter.getResult(); request.getBody().writeTo(bodyOutput); Assert.assertEquals(request.getUrl(), "<LINK_0>"); Assert.assertEquals(request.getMethod(), "POST"); Assert.assertEquals(transaction.getId(), "foobar"); Assert.assertEquals(bodyOutput.toString(), "{\"message\":\"foobar\"}"); }
Source:
public void testProcessEapMessageResponse() throws Exception { EapCallback eapCallback = new EapCallback() { @Override public void onResponse(byte[] eapMsg) { synchronized (mCallbackLock) { assertArrayEquals(EAP_SIM_RESPONSE_PACKET, eapMsg); assertFalse("Callback has already been fired", mCallbackFired); mCallbackFired = true; mCallbackLock.notifyAll(); } } }; EapResponse eapResponse = new EapResponse(EAP_SIM_RESPONSE_PACKET); when(mMockEapStateMachine.process(eq(EAP_REQUEST_SIM_START_PACKET))) .thenReturn(eapResponse); synchronized (mCallbackLock) { getEapAuthenticatorWithCallback(eapCallback) .processEapMessage(EAP_REQUEST_SIM_START_PACKET); mCallbackLock.wait(TEST_TIMEOUT_MILLIS); } assertTrue(mCallbackFired); verify(mMockEapStateMachine).process(eq(EAP_REQUEST_SIM_START_PACKET)); verifyNoMoreInteractions(mMockEapStateMachine); }

Target:
public void testProcessEapMessageResponse() throws Exception { EapCallback eapCallback = new EapCallback() { @Override public void onResponse(byte[] eapMsg) { assertArrayEquals(EAP_SIM_RESPONSE_PACKET, eapMsg); synchronized (mCallbackLock) { assertFalse("Callback has already been fired", mCallbackFired); mCallbackFired = true; mCallbackLock.notifyAll(); } } }; EapResponse eapResponse = new EapResponse(EAP_SIM_RESPONSE_PACKET); when(mMockEapStateMachine.process(eq(EAP_REQUEST_SIM_START_PACKET))) .thenReturn(eapResponse); synchronized (mCallbackLock) { getEapAuthenticatorWithCallback(eapCallback) .processEapMessage(EAP_REQUEST_SIM_START_PACKET); mCallbackLock.wait(TEST_TIMEOUT_MILLIS); assertTrue(mCallbackFired); } verify(mMockEapStateMachine).process(eq(EAP_REQUEST_SIM_START_PACKET)); verifyNoMoreInteractions(mMockEapStateMachine); }
Source:
private boolean validate() { controlResult = executeQueryControl(); if (controlResult.getState() == State.TOO_MANY_ROWS) { testResult = new QueryResult(State.INVALID, null, null, null, null, ImmutableList.of()); return false; } if (controlResult.getState() != State.SUCCESS) { testResult = new QueryResult(State.INVALID, null, null, null, null, ImmutableList.of()); return true; } testResult = executeQueryTest(); if (controlResult.getState() != State.SUCCESS || testResult.getState() != State.SUCCESS) { return false; } if (!checkCorrectness) { return true; } boolean matches = resultsMatch(controlResult, testResult, precision); if (!matches && checkDeterministic) { matches = checkForDeterministicAndRerunTestQueriesIfNeeded(); } if (matches && skipDroppingTemporaryTables) { QueryResult controlTearDownResult = tearDownQueryControl(); QueryResult testTearDownResult = tearDownQueryTest(); controlResult = controlTearDownResult.getState() == State.SUCCESS ? controlResult : controlTearDownResult; testResult = testTearDownResult.getState() == State.SUCCESS ? testResult : testTearDownResult; return controlResult.getState() == State.SUCCESS && testResult.getState() == State.SUCCESS; } return matches; }

Target:
private boolean validate() { boolean tearDownControl = true; boolean tearDownTest = false; try { controlResult = executePreAndMainForControl(); if (controlResult.getState() == State.TOO_MANY_ROWS) { testResult = new QueryResult(State.INVALID, null, null, null, null, ImmutableList.of()); return false; } if (controlResult.getState() != State.SUCCESS) { testResult = new QueryResult(State.INVALID, null, null, null, null, ImmutableList.of()); return true; } testResult = executePreAndMainForTest(); tearDownTest = true; if (controlResult.getState() != State.SUCCESS || testResult.getState() != State.SUCCESS) { return false; } if (!checkCorrectness) { return true; } boolean matches = resultsMatch(controlResult, testResult, precision); if (!matches && checkDeterministic) { matches = checkForDeterministicAndRerunTestQueriesIfNeeded(); } if (!matches && !runTearDownOnResultMismatch) { tearDownControl = false; tearDownTest = false; } return matches; } finally { if (tearDownControl) { tearDownControl(); } if (tearDownTest) { tearDownTest(); } } }
Source:
static NetworkConnectionType getNetworkType(Context context) { TelephonyManager telephonyManager = (TelephonyManager) context.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); NetworkInfo networkInfo = getNetworkInfo(context); NetworkConnectionType networkConnectionType; if (networkInfo == null) { networkConnectionType = NetworkConnectionType.UNKNOWN; } else { int network = networkInfo.getType(); if (network == ConnectivityManager.TYPE_WIFI) { networkConnectionType = NetworkConnectionType.WIFI; } else { int mobileNetwork = telephonyManager.getNetworkType(); switch (mobileNetwork) { case TelephonyManager.NETWORK_TYPE_GPRS: case TelephonyManager.NETWORK_TYPE_EDGE: case TelephonyManager.NETWORK_TYPE_CDMA: case TelephonyManager.NETWORK_TYPE_1xRTT: networkConnectionType = NetworkConnectionType.TWO_G; break; case TelephonyManager.NETWORK_TYPE_HSDPA: case TelephonyManager.NETWORK_TYPE_UMTS: case TelephonyManager.NETWORK_TYPE_HSUPA: case TelephonyManager.NETWORK_TYPE_HSPA: case TelephonyManager.NETWORK_TYPE_EHRPD: case TelephonyManager.NETWORK_TYPE_EVDO_0: case TelephonyManager.NETWORK_TYPE_EVDO_A: case TelephonyManager.NETWORK_TYPE_EVDO_B: networkConnectionType = NetworkConnectionType.THREE_G; break; case TelephonyManager.NETWORK_TYPE_LTE: case TelephonyManager.NETWORK_TYPE_HSPAP: networkConnectionType = NetworkConnectionType.FOUR_G; break; default: networkConnectionType = NetworkConnectionType.UNKNOWN; break; } } } return networkConnectionType; }

Target:
static NetworkConnectionType getNetworkType(Context context) { TelephonyManager telephonyManager = (TelephonyManager) context.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); if (telephonyManager == null) { return NetworkConnectionType.UNKNOWN; } NetworkInfo networkInfo = getNetworkInfo(context); if (networkInfo == null) { return NetworkConnectionType.UNKNOWN; } int network = networkInfo.getType(); if (network == ConnectivityManager.TYPE_WIFI) { return NetworkConnectionType.WIFI; } int mobileNetwork = telephonyManager.getNetworkType(); switch (mobileNetwork) { case TelephonyManager.NETWORK_TYPE_GPRS: case TelephonyManager.NETWORK_TYPE_EDGE: case TelephonyManager.NETWORK_TYPE_CDMA: case TelephonyManager.NETWORK_TYPE_1xRTT: return NetworkConnectionType.TWO_G; case TelephonyManager.NETWORK_TYPE_HSDPA: case TelephonyManager.NETWORK_TYPE_UMTS: case TelephonyManager.NETWORK_TYPE_HSUPA: case TelephonyManager.NETWORK_TYPE_HSPA: case TelephonyManager.NETWORK_TYPE_EHRPD: case TelephonyManager.NETWORK_TYPE_EVDO_0: case TelephonyManager.NETWORK_TYPE_EVDO_A: case TelephonyManager.NETWORK_TYPE_EVDO_B: return NetworkConnectionType.THREE_G; case TelephonyManager.NETWORK_TYPE_LTE: case TelephonyManager.NETWORK_TYPE_HSPAP: return NetworkConnectionType.FOUR_G; default: return NetworkConnectionType.UNKNOWN; } }
Source:
public static synchronized ClientPrefs getInstance() { if (AppGlobals.isDebug && sInstance != null) { assert (sInstance.getClass().isInstance(ClientPrefs.class)); } return (ClientPrefs)sInstance; }

Target:
public static synchronized ClientPrefs getInstance() { if (sInstance != null && sInstance.getClass().isInstance(ClientPrefs.class)) { throw new IllegalArgumentException("sInstance is improperly initialized"); } return (ClientPrefs)sInstance; }
Source:
private List<AccountInfo> suggestAccountFullTextSearch( VisibilityControl visibilityControl) throws OrmException { int maxMatches = cfg.getInt("suggest", "fulltextsearchmaxmatches", DEFAULT_MAX_MATCHES); String str = query.toLowerCase(); LinkedHashMap<Account.Id, AccountInfo> accountMap = Maps.newLinkedHashMap(); List<Account> fullNameMatches = Lists.newArrayList(); List<Account> emailMatches = Lists.newArrayList(); for (Account a : dbProvider.get().accounts().all()) { if (a.getFullName() != null && a.getFullName().toLowerCase().contains(str)) { fullNameMatches.add(a); } else if (a.getPreferredEmail() != null && emailMatches.size() < maxMatches && a.getPreferredEmail().toLowerCase().contains(str)) { emailMatches.add(a); } if (fullNameMatches.size() >= maxMatches) { break; } } for (Account a : fullNameMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } if (accountMap.size() < limit) { for (Account a : emailMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } } return Lists.newArrayList(accountMap.values()); }

Target:
private List<AccountInfo> suggestAccountFullTextSearch( VisibilityControl visibilityControl) throws OrmException { String str = query.toLowerCase(); LinkedHashMap<Account.Id, AccountInfo> accountMap = Maps.newLinkedHashMap(); List<Account> fullNameMatches = Lists.newArrayList(); List<Account> emailMatches = Lists.newArrayList(); for (Account a : dbProvider.get().accounts().all()) { if (a.getFullName() != null && a.getFullName().toLowerCase().contains(str)) { fullNameMatches.add(a); } else if (a.getPreferredEmail() != null && emailMatches.size() < fullTextMaxMatches && a.getPreferredEmail().toLowerCase().contains(str)) { emailMatches.add(a); } if (fullNameMatches.size() >= fullTextMaxMatches) { break; } } for (Account a : fullNameMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } if (accountMap.size() < limit) { for (Account a : emailMatches) { addSuggestion(accountMap, a, new AccountInfo(a.getId()), visibilityControl); if (accountMap.size() >= limit) { break; } } } return Lists.newArrayList(accountMap.values()); }
Source:
public Map<UUID, T> results() { if (results == null) results = new HashMap<>(); return results; }

Target:
public Map<UUID, T> results() { return results == null ? Collections.emptyMap() : results; }
Source:
public void setJavaClass(Class<?> clazz) { this.clazz = clazz; }

Target:
public void setJavaClass(Class<?> clazz) { this.urn = "java:" + clazz.getName(); }
Source:
public void onAllRequiredCapabilitiesAvailable() { DataHolder.getInstance().getBundleContext().registerService(WebSocketServerSC.class, this, null); log.info("All required capabilities are available of WebSocket service component is available."); }

Target:
public void onAllRequiredCapabilitiesAvailable() { DataHolder.getInstance().getBundleContext().registerService(WebSocketServerSC.class, this, null); log.info("All WebSocketEndpoints are available."); }
Source:
private void setupViewPager() { viewPager = (ViewPager) findViewById(R.id.viewpager); viewPager.setOffscreenPageLimit(3); viewPager.setOnPageChangeListener( new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { getActionBar().setSelectedNavigationItem(position); } } ); viewPager.setAdapter(viewPagerAdapter); }

Target:
private void setupViewPager() { viewPager = (ViewPager) findViewById(R.id.viewpager); viewPager.setOffscreenPageLimit(viewPagerAdapter.getCount()); viewPager.setOnPageChangeListener( new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { getActionBar().setSelectedNavigationItem(position); } } ); viewPager.setAdapter(viewPagerAdapter); }
Source:
public void run() { LOG.info("Starting QuerySubmitter thread"); while (!stopped && !querySubmitter.isInterrupted()) { try { QueryContext ctx = acceptedQueries.take(); synchronized (ctx) { if (ctx.getStatus().getStatus().equals(Status.QUEUED)) { LOG.info("Launching query:" + ctx.getDriverQuery()); try { acquire(ctx.getGrillSessionIdentifier()); rewriteAndSelect(ctx); ctx.getSelectedDriver().executeAsync(ctx); } catch (GrillException e) { LOG.error("Error launching query ", e); String reason = e.getCause() != null ? e.getCause().getMessage() : e.getMessage(); setFailedStatus(ctx, "Launching query failed", reason); continue; } setLaunchedStatus(ctx); LOG.info("Launched query " + ctx.getQueryHandle()); } } } catch (InterruptedException e) { LOG.info("Query Submitter has been interrupted, exiting"); return; } catch (Exception e) { LOG.error("Error in query submitter", e); } } }

Target:
public void run() { LOG.info("Starting QuerySubmitter thread"); while (!stopped && !querySubmitter.isInterrupted()) { try { QueryContext ctx = acceptedQueries.take(); synchronized (ctx) { if (ctx.getStatus().getStatus().equals(Status.QUEUED)) { LOG.info("Launching query:" + ctx.getDriverQuery()); try { acquire(ctx.getGrillSessionIdentifier()); rewriteAndSelect(ctx); ctx.getSelectedDriver().executeAsync(ctx); } catch (GrillException e) { LOG.error("Error launching query ", e); String reason = e.getCause() != null ? e.getCause().getMessage() : e.getMessage(); setFailedStatus(ctx, "Launching query failed", reason); continue; } finally { release(ctx.getGrillSessionIdentifier()); } setLaunchedStatus(ctx); LOG.info("Launched query " + ctx.getQueryHandle()); } } } catch (InterruptedException e) { LOG.info("Query Submitter has been interrupted, exiting"); return; } catch (Exception e) { LOG.error("Error in query submitter", e); } } }
Source:
private String[] parseCredentials(String credentialsString) { if (credentialsString == null) throw new BadCredentialsException("Authorization required"); String[] credentials = credentialsString.split(":"); if (credentials.length != 2) throw new BadCredentialsException("Authorization required"); return credentials; }

Target:
private String[] parseCredentials(String credentialsString) { if (credentialsString == null) throw new BadCredentialsException("Authorization required"); String[] credentials = credentialsString.split(":"); if (credentials.length != 2) { throw new BadCredentialsException("Authorization required"); } credentials[0] = credentials[0].trim(); credentials[1] = credentials[1].trim(); return credentials; }
Source:
CompletableFuture<Boolean> actualRemoveMaxIdleExpireEntry(K key, V value, long maxIdle, boolean skipLocking) { CompletableFuture<Boolean> completableFuture = new CompletableFuture<>(); Object expiringObject = expiring.putIfAbsent(key, completableFuture); if (expiringObject == null) { if (trace) { log.tracef("Submitting expiration removal for key %s which had maxIdle of %s", toStr(key), maxIdle); } completableFuture.whenComplete((b, t) -> expiring.remove(key, completableFuture)); try { AdvancedCache<K, V> cacheToUse = skipLocking ? cache.withFlags(Flag.SKIP_LOCKING) : cache; CompletableFuture<Boolean> future = removeMaxIdle(cacheToUse, key, value); future.whenComplete((b, t) -> { if (t != null) { completableFuture.completeExceptionally(t); } else { completableFuture.complete(b); } }); return completableFuture; } catch (Throwable t) { completableFuture.completeExceptionally(t); throw t; } } else if (expiringObject instanceof CompletableFuture) { return (CompletableFuture<Boolean>) expiringObject; } else { return CompletableFutures.completedTrue(); } }

Target:
CompletableFuture<Boolean> actualRemoveMaxIdleExpireEntry(K key, V value, long maxIdle, boolean skipLocking) { CompletableFuture<Boolean> completableFuture = new CompletableFuture<>(); Object expiringObject = expiring.putIfAbsent(key, completableFuture); if (expiringObject == null) { if (trace) { log.tracef("Submitting expiration removal for key %s which had maxIdle of %s", toStr(key), maxIdle); } completableFuture.whenComplete((b, t) -> expiring.remove(key, completableFuture)); try { AdvancedCache<K, V> cacheToUse = skipLocking ? cache.withFlags(Flag.SKIP_LOCKING) : cache; CompletableFuture<Boolean> future = removeMaxIdle(cacheToUse, key, value); return future.whenComplete((b, t) -> { if (t != null) { completableFuture.completeExceptionally(t); } else { completableFuture.complete(b); } }); } catch (Throwable t) { completableFuture.completeExceptionally(t); throw t; } } else if (expiringObject instanceof CompletableFuture) { return (CompletableFuture<Boolean>) expiringObject; } else { return CompletableFutures.completedTrue(); } }
Source:
public void remove(int id) { locations.remove(id); }

Target:
public boolean remove(int id) { return locations.remove(id) != null; }
Source:
public void performApply(ILaunchConfigurationWorkingCopy configuration) { SDBGLaunchConfigWrapper dartLauncher = new SDBGLaunchConfigWrapper(configuration); dartLauncher.setApplicationName(fileText.getText()); dartLauncher.setArguments(argumentText.getText().trim()); dartLauncher.setEnvironmentString(envText.getText().trim()); }

Target:
public void performApply(ILaunchConfigurationWorkingCopy configuration) { SDBGLaunchConfigWrapper chromeLauncher = new SDBGLaunchConfigWrapper(configuration); chromeLauncher.setApplicationName(fileText.getText()); chromeLauncher.setArguments(argumentText.getText().trim()); chromeLauncher.setEnvironmentString(envText.getText().trim()); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_subscriptions, container, false); ((AppCompatActivity) getActivity()).setSupportActionBar(root.findViewById(R.id.toolbar)); subscriptionGridLayout = root.findViewById(R.id.subscriptions_grid); subscriptionGridLayout.setNumColumns(prefs.getInt(PREF_NUM_COLUMNS, getDefaultNumOfColumns())); registerForContextMenu(subscriptionGridLayout); subscriptionAddButton = root.findViewById(R.id.subscriptions_add); progressBar = root.findViewById(R.id.progLoading); feedsFilteredMsg = root.findViewById(R.id.feeds_filtered_message); feedsFilteredMsg.setOnClickListener((l) -> FeedFilterDialog.showDialog(requireContext())); SwipeRefreshLayout swipeRefreshLayout = root.findViewById(R.id.swiperefresh); swipeRefreshLayout.setOnRefreshListener(() -> { AutoUpdateManager.runImmediate(requireContext()); new Thread(() -> { try { Thread.sleep(800); } catch (Exception ignore) { } getActivity().runOnUiThread(() -> { swipeRefreshLayout.setRefreshing(false); }); }).start(); }); return root; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_subscriptions, container, false); ((AppCompatActivity) getActivity()).setSupportActionBar(root.findViewById(R.id.toolbar)); subscriptionGridLayout = root.findViewById(R.id.subscriptions_grid); subscriptionGridLayout.setNumColumns(prefs.getInt(PREF_NUM_COLUMNS, getDefaultNumOfColumns())); registerForContextMenu(subscriptionGridLayout); subscriptionAddButton = root.findViewById(R.id.subscriptions_add); progressBar = root.findViewById(R.id.progLoading); feedsFilteredMsg = root.findViewById(R.id.feeds_filtered_message); feedsFilteredMsg.setOnClickListener((l) -> FeedFilterDialog.showDialog(requireContext())); SwipeRefreshLayout swipeRefreshLayout = root.findViewById(R.id.swipeRefresh); swipeRefreshLayout.setOnRefreshListener(() -> { AutoUpdateManager.runImmediate(requireContext()); new Handler().postDelayed(() -> swipeRefreshLayout.setRefreshing(false), getResources().getInteger(R.integer.swipe_to_refresh_duration_in_ms)); }); return root; }
Source:
public void onDestroy() { super.onDestroy(); if (activity.isFinishing() && player != null && player.videoPlayerSelected()) stopService(); else unbind(); PreferenceManager.getDefaultSharedPreferences(activity) .unregisterOnSharedPreferenceChangeListener(this); activity.unregisterReceiver(broadcastReceiver); activity.getContentResolver().unregisterContentObserver(settingsContentObserver); if (positionSubscriber != null) positionSubscriber.dispose(); if (currentWorker != null) currentWorker.dispose(); if (disposables != null) disposables.clear(); positionSubscriber = null; currentWorker = null; disposables = null; bottomSheetBehavior.setBottomSheetCallback(null); }

Target:
public void onDestroy() { super.onDestroy(); if (activity.isFinishing() && player != null && player.videoPlayerSelected()) { stopService(requireContext()); } else { unbind(requireContext()); } PreferenceManager.getDefaultSharedPreferences(activity) .unregisterOnSharedPreferenceChangeListener(this); activity.unregisterReceiver(broadcastReceiver); activity.getContentResolver().unregisterContentObserver(settingsContentObserver); if (positionSubscriber != null) { positionSubscriber.dispose(); } if (currentWorker != null) { currentWorker.dispose(); } disposables.clear(); positionSubscriber = null; currentWorker = null; bottomSheetBehavior.setBottomSheetCallback(null); }
Source:
public boolean canContinue(CruiseConfig cruiseConfig) { return isUserAuthorized() && doesTemplateExist(cruiseConfig); }

Target:
public boolean canContinue(CruiseConfig cruiseConfig) { return super.canContinue(cruiseConfig) && doesTemplateExist(cruiseConfig); }
Source:
public ArrayInterface setNumber(int index, Number value) { return setObject(index, value); }

Target:
public Array setNumber(int index, Number value) { return setObject(index, value); }
Source:
protected Type build(String name) { Preconditions.checkState(logicalTypeAnnotation == null, "LIST is already the logical type and can't be changed"); Objects.requireNonNull(elementType, "List element type"); GroupBuilder<GroupType> builder = buildGroup(repetition).as(OriginalType.LIST); if (id != null) { builder.id(id.intValue()); } return builder .repeatedGroup().addFields(elementType).named("list") .named(name); }

Target:
protected Type build(String name) { Preconditions.checkState(logicalTypeAnnotation == null, "LIST is already the logical type and can't be changed"); Objects.requireNonNull(elementType, "List element type cannot be null"); GroupBuilder<GroupType> builder = buildGroup(repetition).as(OriginalType.LIST); if (id != null) { builder.id(id.intValue()); } return builder .repeatedGroup().addFields(elementType).named("list") .named(name); }
Source:
private IMergeContext prepareContext(IFile workspaceFile, String srcRev, String dstRev) throws Exception { GitSynchronizeData gsd = new GitSynchronizeData(repo, srcRev, dstRev, true, Collections.<IResource> singleton(workspaceFile)); GitSynchronizeDataSet gsds = new GitSynchronizeDataSet(gsd); GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber( gsds); subscriber.init(new NullProgressMonitor()); ResourceMapping mapping = AdapterUtils.adapt(workspaceFile, ResourceMapping.class); SubscriberScopeManager manager = new SubscriberScopeManager( subscriber.getName(), new ResourceMapping[] { mapping, }, subscriber, true); try { manager.initialize(new NullProgressMonitor()); } catch (CoreException e) { fail("Couldn't expand the subscriber scope"); } GitSubscriberMergeContext mergeContext = new GitSubscriberMergeContext( subscriber, manager, gsds); Job.getJobManager().join(mergeContext, new NullProgressMonitor()); return mergeContext; }

Target:
private IMergeContext prepareContext(IFile workspaceFile, String srcRev, String dstRev) throws Exception { GitSynchronizeData gsd = new GitSynchronizeData(repo, srcRev, dstRev, true, Collections.<IResource> singleton(workspaceFile)); GitSynchronizeDataSet gsds = new GitSynchronizeDataSet(gsd); GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber( gsds); subscriber.init(new NullProgressMonitor()); ResourceMapping mapping = AdapterUtils.adapt(workspaceFile, ResourceMapping.class); SubscriberScopeManager manager = new SubscriberScopeManager( subscriber.getName(), new ResourceMapping[] { mapping, }, subscriber, true); manager.initialize(new NullProgressMonitor()); GitSubscriberMergeContext mergeContext = new GitSubscriberMergeContext( subscriber, manager, gsds); Job.getJobManager().join(mergeContext, new NullProgressMonitor()); return mergeContext; }
Source:
protected boolean checkIfCpusExist(Cluster group) { if (group.getCompatibilityVersion() != getParameters().getCluster().getCompatibilityVersion() && cpuFlagsManagerHandler.checkIfCpusExist(group.getCpuName(), group.getCompatibilityVersion()) && !cpuFlagsManagerHandler.checkIfCpusExist(group.getCpuName(), getParameters().getCluster().getCompatibilityVersion())) { return true; } return cpuFlagsManagerHandler.checkIfCpusExist(getCluster().getCpuName(), getCluster().getCompatibilityVersion()); }

Target:
protected boolean checkIfCpusExist(Cluster group) { if (!group.getCompatibilityVersion().equals(getParameters().getCluster().getCompatibilityVersion()) && ((cpuFlagsManagerHandler.checkIfCpusExist(group.getCpuName(), group.getCompatibilityVersion()) && !cpuFlagsManagerHandler.checkIfCpusExist(group.getCpuName(), getParameters().getCluster().getCompatibilityVersion())) || !cpuFlagsManagerHandler.checkIfCpusExist(getCluster().getCpuName(), getParameters().getCluster().getCompatibilityVersion()))) { return true; } return cpuFlagsManagerHandler.checkIfCpusExist(getCluster().getCpuName(), getCluster().getCompatibilityVersion()); }
Source:
private String resolveAdditionalJoinCondition( Join join, String rhsTableAlias, String withClause, Joinable joinable, AssociationType associationType) { final String filter; if ( associationType.isEntityType() && join.getLeftHandSide().getDisposition() != QuerySpace.Disposition.COLLECTION ) { filter = joinable.filterFragment( rhsTableAlias, queryInfluencers.getEnabledFilters() ); } else if ( associationType != null ) { filter = associationType.getOnCondition( rhsTableAlias, factory, queryInfluencers.getEnabledFilters() ); } else { filter = joinable.filterFragment( rhsTableAlias, queryInfluencers.getEnabledFilters() ); } if ( StringHelper.isEmpty( withClause ) && StringHelper.isEmpty( filter ) ) { return ""; } else if ( StringHelper.isNotEmpty( withClause ) && StringHelper.isNotEmpty( filter ) ) { return filter + " and " + withClause; } else { return StringHelper.isNotEmpty( filter ) ? filter : withClause; } }

Target:
private String resolveAdditionalJoinCondition( Join join, String rhsTableAlias, String withClause, Joinable joinable, AssociationType associationType) { final String filter; if ( associationType != null ) { if ( associationType.isEntityType() && join.getLeftHandSide().getDisposition() != QuerySpace.Disposition.COLLECTION ) { filter = joinable.filterFragment( rhsTableAlias, queryInfluencers.getEnabledFilters() ); } else { filter = associationType.getOnCondition( rhsTableAlias, factory, queryInfluencers.getEnabledFilters() ); } } else { filter = joinable.filterFragment( rhsTableAlias, queryInfluencers.getEnabledFilters() ); } if ( StringHelper.isEmpty( withClause ) && StringHelper.isEmpty( filter ) ) { return ""; } else if ( StringHelper.isNotEmpty( withClause ) && StringHelper.isNotEmpty( filter ) ) { return filter + " and " + withClause; } else { return StringHelper.isNotEmpty( filter ) ? filter : withClause; } }