auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Cluster getCluster(String clusterName, Map<Tuple2<Integer, String>, Node> nodeNameNodeConfigMap) { validateProvidedConfiguration(nodeNameNodeConfigMap, allServers); Map<Integer, Node> oneConfigPerStripe = new HashMap<>(); for (Map.Entry<Tuple2<Integer, String>, Node> entry : nodeNameNodeConfigMap.entrySet()) { if (!oneConfigPerStripe.containsKey(entry.getKey().t1)) { oneConfigPerStripe.put(entry.getKey().t1, entry.getValue()); } } List<Cluster> stripes = new ArrayList<>(); for (Map.Entry<Integer, Node> entry : oneConfigPerStripe.entrySet()) { Node doc = entry.getValue(); try { String xml = XmlUtility.getPrettyPrintableXmlString(doc); Cluster stripe = getStripe(xml); stripe.setName("stripe[" + stripes.size() + "]"); stripe.getSingleStripe().get().setName("stripe[" + stripes.size() + "]"); stripes.add(stripe); } catch (TransformerException e) { throw new RuntimeException(e); } } return stripes.stream().reduce((result, stripe) -> result .addStripe(stripe.getSingleStripe().get().clone())) .orElseThrow(() -> new RuntimeException("No server specified.")) .setName(clusterName); }

Target:
private Cluster getCluster(String clusterName, Map<Tuple2<Integer, String>, Node> nodeNameNodeConfigMap) { validateProvidedConfiguration(nodeNameNodeConfigMap, allServers); Map<Integer, Node> oneConfigPerStripe = new HashMap<>(); for (Map.Entry<Tuple2<Integer, String>, Node> entry : nodeNameNodeConfigMap.entrySet()) { if (!oneConfigPerStripe.containsKey(entry.getKey().t1)) { oneConfigPerStripe.put(entry.getKey().t1, entry.getValue()); } } List<Cluster> stripes = new ArrayList<>(); for (Map.Entry<Integer, Node> entry : oneConfigPerStripe.entrySet()) { Node doc = entry.getValue(); try { String xml = XmlUtility.getPrettyPrintableXmlString(doc); Cluster stripe = getStripe(xml); stripe.getSingleStripe().get().setName("stripe[" + stripes.size() + "]"); stripes.add(stripe); } catch (TransformerException e) { throw new RuntimeException(e); } } return stripes.stream().reduce((result, stripe) -> result .addStripe(stripe.getSingleStripe().get().clone())) .orElseThrow(() -> new RuntimeException("No server specified.")) .setName(clusterName); }
Source:
public Firehose connect() throws IOException { wrapperTupac.start(); return new Firehose() { Map<String, Object> map = null; @Override public boolean hasMore() { map = wrapperTupac.takeFromQueue(waitTime, unit); return map != null; } @Override public InputRow nextRow() { try { DateTime date = new DateTime(map.get("time")); return new MapBasedInputRow(date.getMillis(), new ArrayList(map.keySet()), map); } catch (NullPointerException e) { throw Throwables.propagate(e); } finally { map = null; } } @Override public Runnable commit() { return Runnables.getNoopRunnable(); } @Override public void close() throws IOException { } }; }

Target:
public Firehose connect() throws IOException { final BlockingQueue<Map<String, Object>> queue = Queues.newArrayBlockingQueue((int) waitTime); final Conjurer conjurer = builder.withPrinter(Conjurer.queuePrinter(queue)).build(); conjurer.start(); return new Firehose() { Map<String, Object> map; @Override public boolean hasMore() { try { map = queue.poll(waitTime, unit); } catch (InterruptedException e) { e.printStackTrace(); } return map != null; } @Override public InputRow nextRow() { try { DateTime date = new DateTime(map.get("time")); System.out.println(map); return new MapBasedInputRow(date.getMillis(), Lists.newArrayList(map.keySet()), map); } catch (NullPointerException e) { throw Throwables.propagate(e); } finally { map = null; } } @Override public Runnable commit() { return Runnables.getNoopRunnable(); } @Override public void close() throws IOException { conjurer.stop(); } }; }
Source:
public static String parse(String uriHost, String partToExtract) { Matcher m = uriHostProjectPattern.matcher(uriHost); if (m.find( )) { if(partToExtract.toLowerCase().equals("project")) return m.group(5); else if(partToExtract.toLowerCase().equals("qualifier")) return m.group(3); else return null; } else { return null; } }

Target:
public static String parse(String uriHost, String partToExtract) { String param = partToExtract.toLowerCase(); Matcher m = uriHostProjectPattern.matcher(uriHost); if (m.matches()) { if (param.equals("project")) return m.group(6); else if (param.equals("variant")) return m.group(3); else if (param.equals("mobile_qualifier")) return m.group(5); else return null; } else { return null; } }
Source:
private void invokeTestWatchers(JupiterEngineExecutionContext context, Consumer<TestWatcher> callback, boolean reverseOrder) { ExtensionRegistry registry = context.getExtensionRegistry(); List<? extends TestWatcher> watchers = reverseOrder ? registry.getReversedExtensions(TestWatcher.class) : registry.getExtensions(TestWatcher.class); watchers.forEach(watcher -> { try { callback.accept(watcher); } catch (Exception e) { logger.warn(() -> { return String.format("Error invoking TestWatcher %s for test %s : %s", watcher.getClass().getName(), e); }); } }); }

Target:
private void invokeTestWatchers(JupiterEngineExecutionContext context, Consumer<TestWatcher> callback, boolean reverseOrder) { ExtensionRegistry registry = context.getExtensionRegistry(); List<? extends TestWatcher> watchers = reverseOrder ? registry.getReversedExtensions(TestWatcher.class) : registry.getExtensions(TestWatcher.class); watchers.forEach(watcher -> { try { callback.accept(watcher); } catch (Throwable throwable) { ExtensionContext extensionContext = context.getExtensionContext(); BlacklistedExceptions.rethrowIfBlacklisted(throwable); logger.warn(throwable, () -> String.format("Failed to invoke TestWatcher %s for test %s", watcher.getClass().getName(), ReflectionUtils.getFullyQualifiedMethodName(extensionContext.getRequiredTestClass(), extensionContext.getRequiredTestMethod().getName(), extensionContext.getRequiredTestMethod().getParameterTypes()))); } }); }
Source:
public void setEventListener(ServerStoreEventListener listener) { this.listener = listener; OffHeapChainMap.ChainMapEvictionListener<Long> chainMapEvictionListener = listener::onEviction; for (OffHeapChainMap<Long> segment : segments) { segment.setEvictionListener(chainMapEvictionListener); } }

Target:
public void setEventListener(ServerStoreEventListener listener) { if (this.listener != null) { throw new IllegalStateException("ServerStoreEventListener instance already set"); } this.listener = listener; OffHeapChainMap.ChainMapEvictionListener<Long> chainMapEvictionListener = listener::onEviction; for (OffHeapChainMap<Long> segment : segments) { segment.setEvictionListener(chainMapEvictionListener); } }
Source:
public int read(byte[] b, int off, int len) throws IOException { if (readOffset == readLength) { if (writePending) flushForced(); fillReadBuffer(); if (readOffset == readLength) { return -1; } } int remains = len; int transferLength = Math.min(readLength - readOffset, remains); System.arraycopy(readBuffer, readOffset, b, off, transferLength); readOffset += transferLength; off += transferLength; remains -= transferLength; return len - remains; }

Target:
public int read(byte[] b, int off, int len) throws IOException { long remaining = length() - position(); if (remaining == 0) return -1; else if (len > remaining) len = (int)remaining; readFully(b, off, len); return len; }
Source:
protected void dumpState(StateDumpCollector stateDumpCollector) { stateDumpCollector.addState("cacheName", cache.getName()); stateDumpCollector.addState("cacheSie", String.valueOf(cache.size())); }

Target:
protected void dumpState(StateDumpCollector stateDumpCollector) { stateDumpCollector.addState("cacheName", cache.getName()); stateDumpCollector.addState("cacheSize", String.valueOf(cache.size())); }
Source:
T build(ServiceLocator serviceLocator) { try { serviceLocator.startAllServices(new HashMap<Service, ServiceConfiguration<?>>()); } catch (Exception e) { logger.error("StandaloneCacheBuilder failed due to {}.", e.getMessage());; } Store.Provider storeProvider = serviceLocator.findService(Store.Provider.class); final StoreConfigurationImpl<K, V> storeConfig = new StoreConfigurationImpl<K, V>(keyType, valueType, capacityConstraint, evictionVeto, evictionPrioritizer, classLoader, expiry); final Store<K, V> store = storeProvider.createStore(storeConfig); CacheConfiguration<K, V> cacheConfig = new BaseCacheConfiguration<K, V>(keyType, valueType, capacityConstraint, evictionVeto, evictionPrioritizer, classLoader, expiry, persistent); final Ehcache<K, V> ehcache = new Ehcache<K, V>(cacheConfig, store, cacheLoaderWriter, cacheEventNotificationService, statisticsExecutor,logger); return cast(ehcache); }

Target:
T build(ServiceLocator serviceLocator) throws IllegalStateException { try { serviceLocator.startAllServices(new HashMap<Service, ServiceConfiguration<?>>()); } catch (Exception e) { throw new IllegalStateException("StandaloneCacheBuilder failed to build.", e); } Store.Provider storeProvider = serviceLocator.findService(Store.Provider.class); final StoreConfigurationImpl<K, V> storeConfig = new StoreConfigurationImpl<K, V>(keyType, valueType, capacityConstraint, evictionVeto, evictionPrioritizer, classLoader, expiry); final Store<K, V> store = storeProvider.createStore(storeConfig); CacheConfiguration<K, V> cacheConfig = new BaseCacheConfiguration<K, V>(keyType, valueType, capacityConstraint, evictionVeto, evictionPrioritizer, classLoader, expiry, persistent); final Ehcache<K, V> ehcache = new Ehcache<K, V>(cacheConfig, store, cacheLoaderWriter, cacheEventNotificationService, statisticsExecutor,logger); return cast(ehcache); }
Source:
private String extractProjectName(URIish u) { String path = u.getPath().substring(1); if (path.endsWith(".git")) { return path.substring(0, path.length() - 4); } else { return path; } }

Target:
private String extractProjectName(URIish u) { String path = u.getPath().substring(1); if (path.endsWith(org.eclipse.jgit.lib.Constants.DOT_GIT)) { return path.substring(0, path.length() - 4); } else { return path; } }
Source:
public static void storeRetrievedAvailableApps(Vector<AppAvailableForInstall> availableAppsRetrieved) { if (availableAppsRetrieved != null && availableAppsRetrieved.size() > 0) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream serializedStream = new DataOutputStream(baos); try { ExtUtil.write(serializedStream, new ExtWrapList(availableAppsRetrieved)); String serializedAppsList = Base64.encodeToString(baos.toByteArray(), Base64.DEFAULT); getGlobalPrivilegesRecord().edit() .putString(RETRIEVED_AVAILABLE_APPS, serializedAppsList).commit(); serializedStream.close(); } catch (IOException e) { } } }

Target:
public static void storeRetrievedAvailableApps(Vector<AppAvailableForInstall> availableAppsRetrieved) { if (availableAppsRetrieved != null && availableAppsRetrieved.size() > 0) { ByteArrayOutputStream baos = null; DataOutputStream serializedStream = null; try { baos = new ByteArrayOutputStream(); serializedStream = new DataOutputStream(baos); try { ExtUtil.write(serializedStream, new ExtWrapList(availableAppsRetrieved)); String serializedAppsList = Base64.encodeToString(baos.toByteArray(), Base64.DEFAULT); getGlobalPrivilegesRecord().edit() .putString(RETRIEVED_AVAILABLE_APPS, serializedAppsList).commit(); baos.close(); serializedStream.close(); } catch (IOException e) { System.out.println("IO error encountered while serializing retrieved available apps"); clearPreviouslyRetrivedApps(); } } finally { try { if (baos != null) { baos.close(); } if (serializedStream != null) { serializedStream.close(); } } catch (IOException e) { } } } }
Source:
private CoverageProvider getCoverageProvider(Run<?, ?> build, FilePath workspace, TaskListener listener, Set<String> includeFileNames) { Result buildResult = null; if (build.getResult() == null) { buildResult = Result.SUCCESS; } else { buildResult = build.getResult(); } if (!buildResult.isBetterOrEqualTo(Result.UNSTABLE)) { return null; } Logger logger = new Logger(listener.getLogger()); InstanceProvider<CoverageProvider> provider = new InstanceProvider<CoverageProvider>( Jenkins.getInstance(), COBERTURA_PLUGIN_NAME, COBERTURA_CLASS_NAME, logger ); CoverageProvider coberturaCoverage = provider.getInstance(); InstanceProvider<CoverageProvider> jacocoProvider = new InstanceProvider<CoverageProvider>( Jenkins.getInstance(), JACOCO_PLUGIN_NAME, JACOCO_CLASS_NAME, logger ); CoverageProvider jacocoCoverage = jacocoProvider.getInstance(); if (coberturaCoverage == null && jacocoCoverage == null) { return null; } CoverageProvider coverage = Objects.firstNonNull(coberturaCoverage, jacocoCoverage); coverage.setBuild(build); coverage.setWorkspace(workspace); coverage.setIncludeFileNames(includeFileNames); coverage.setCoverageReportPattern(coverageReportPattern); if (coverage.hasCoverage()) { return coverage; } else { logger.info(UBERALLS_TAG, "No coverage results found"); return null; } }

Target:
private CoverageProvider getCoverageProvider(Run<?, ?> build, FilePath workspace, TaskListener listener, Set<String> includeFileNames) { Result buildResult = null; if (build.getResult() == null) { buildResult = Result.SUCCESS; } else { buildResult = build.getResult(); } if (!buildResult.isBetterOrEqualTo(Result.UNSTABLE)) { return null; } Logger logger = new Logger(listener.getLogger()); List<CoverageProvider> coverageProviders = new ArrayList<CoverageProvider>(); CoverageProvider coberturaCoverage = makeProvider(COBERTURA_PLUGIN_NAME, COBERTURA_CLASS_NAME, logger); if (coberturaCoverage != null) { coverageProviders.add(coberturaCoverage); } CoverageProvider jacocoCoverage = makeProvider(JACOCO_PLUGIN_NAME, JACOCO_CLASS_NAME, logger); if (jacocoCoverage != null) { coverageProviders.add(jacocoCoverage); } for (Iterator<CoverageProvider> i = coverageProviders.iterator(); i.hasNext(); ) { CoverageProvider coverageProvider = i.next(); coverageProvider.setBuild(build); coverageProvider.setWorkspace(workspace); coverageProvider.setIncludeFileNames(includeFileNames); coverageProvider.setCoverageReportPattern(coverageReportPattern); if (!coverageProvider.hasCoverage()) { i.remove(); } } if (!coverageProviders.isEmpty()) { CoverageProvider provider = coverageProviders.get(0); logger.info(UBERALLS_TAG, "Selected Coverage Provider: " + provider); return provider; } logger.info(UBERALLS_TAG, "No coverage results found"); return null; }
Source:
private TablePanel buildConvergenceTable(final MixedTreatmentComparison mtc, ValueHolder<Boolean> modelConstructed) { ConvergenceDiagnosticTableModel tableModel = convergenceTable(mtc, modelConstructed); EnhancedTable convergenceTable = EnhancedTable.createBare(tableModel); TablePanel pane = new TablePanel(convergenceTable); convergenceTable.autoSizeColumns(); convergenceTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() > 1) { JTable table = (JTable)e.getComponent(); int row = table.convertRowIndexToModel(table.rowAtPoint(e.getPoint())); Parameter p = mtc.getResults().getParameters()[row]; showConvergencePlots(mtc, p); } } }); return pane; }

Target:
private TablePanel buildConvergenceTable(final MixedTreatmentComparison mtc, ValueHolder<Boolean> modelConstructed) { ConvergenceDiagnosticTableModel tableModel = convergenceTable(mtc, modelConstructed); EnhancedTable convergenceTable = EnhancedTable.createBare(tableModel); TablePanel pane = new TablePanel(convergenceTable); convergenceTable.autoSizeColumns(); convergenceTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() > 1) { JTable table = (JTable)e.getComponent(); int row = table.convertRowIndexToModel(table.rowAtPoint(e.getPoint())); Parameter[] parameters = mtc.getResults().getParameters(); if (row <= parameters.length) { Parameter p = parameters[row]; showConvergencePlots(mtc, p); } } } }); return pane; }
Source:
public SettingsDto getProperties(SettingsDto dto, SettingsFacade settingsFacade) { dto.setTaskPossibleErrors(settingsFacade.getProperty(TASK_POSSIBLE_ERRORS)); try { InputStream retries = settingsFacade.getRawConfig(TASK_PROPERTIES_FILE_NAME); Properties props = new Properties(); props.load(retries); if (props != null) { for (Map.Entry<Object, Object> entry : props.entrySet()) { dto.taskRetries.put((String) entry.getKey(), (String) entry.getValue()); } } } catch (IOException e) { throw new MotechException("Error loading raw file config to properties", e); } catch (NullPointerException e) { dto.setTaskRetries(new HashMap<String, String>()); } return dto; }

Target:
public SettingsDto getProperties(SettingsDto dto, SettingsFacade settingsFacade) { dto.setTaskPossibleErrors(settingsFacade.getProperty(TASK_POSSIBLE_ERRORS)); try (InputStream retries = settingsFacade.getRawConfig(TASK_PROPERTIES_FILE_NAME)){ if(retries != null) { Properties props = new Properties(); props.load(retries); for (Map.Entry<Object, Object> entry : props.entrySet()) { dto.taskRetries.put((String) entry.getKey(), (String) entry.getValue()); } } else { dto.taskRetries = new HashMap<String, String>(); } } catch (IOException e) { throw new MotechException("Error loading raw file config to properties", e); } return dto; }
Source:
public void remove(Group group, Map out) { String homePerspectiveKey = GROUP + "." + group.getName() + "." + HOME; String priorityKey = GROUP + "." + group.getName() + "." + PRIORITY; out.remove(priorityKey); out.remove(homePerspectiveKey); }

Target:
private void remove(Group group, Map out) { String homePerspectiveKey = GROUP + "." + group.getName() + "." + HOME; String priorityKey = GROUP + "." + group.getName() + "." + PRIORITY; out.remove(priorityKey); out.remove(homePerspectiveKey); }
Source:
public ServerBootstrap childHandler(ChannelHandler childHandler) { ObjectUtil.checkNotNull(childHandler, "childHandler"); this.childHandler = childHandler; return this; }

Target:
public ServerBootstrap childHandler(ChannelHandler childHandler) { this.childHandler = ObjectUtil.checkNotNull(childHandler, "childHandler"); return this; }
Source:
public void testParseEditInfo() throws Exception { JsonElement jsonElement = getJsonElement("edit.json"); List<EditInfo> editInfos = editInfoParser.parseEditInfos(jsonElement); Truth.assertThat(editInfos).hasSize(1); System.out.println(editInfos.get(0)); Truth.assertThat(editInfos.get(0).baseRevision.equals("184ebe53805e102605d11f6b143486d15c23a09c")); Truth.assertThat(editInfos.get(0).fetch.get("git").url.equals("git://localhost/gerrit")); Truth.assertThat(editInfos.get(0).files.size() == 2); }

Target:
public void testParseEditInfo() throws Exception { JsonElement jsonElement = getJsonElement("edit.json"); List<EditInfo> editInfos = editInfoParser.parseEditInfos(jsonElement); Truth.assertThat(editInfos).hasSize(1); Truth.assertThat(editInfos.get(0).baseRevision.equals("184ebe53805e102605d11f6b143486d15c23a09c")); Truth.assertThat(editInfos.get(0).fetch.get("git").url.equals("git://localhost/gerrit")); Truth.assertThat(editInfos.get(0).files.size() == 2); }
Source:
protected boolean shouldNotFilter(final HttpServletRequest request) throws ServletException { SiteContext siteContext = SiteContext.getCurrent(); HierarchicalConfiguration config = siteContext.getConfig(); try { HierarchicalConfiguration corsConfig = config.configurationAt(CONFIG_KEY); if (corsConfig != null) { boolean enable = corsConfig.getBoolean(ENABLE_KEY, false); return !enable; } } catch (Exception e) { logger.debug("Site '{}' has no CORS configuration", siteContext.getSiteName()); } return true; }

Target:
protected boolean shouldNotFilter(final HttpServletRequest request) throws ServletException { SiteContext siteContext = SiteContext.getCurrent(); HierarchicalConfiguration config = siteContext.getConfig(); try { HierarchicalConfiguration corsConfig = config.configurationAt(CONFIG_KEY); if (corsConfig != null) { return !corsConfig.getBoolean(ENABLE_KEY, false); } } catch (Exception e) { logger.debug("Site '{}' has no CORS configuration", siteContext.getSiteName()); } return true; }
Source:
public boolean approveRequest(IEditCommandRequest request) { if (request instanceof CreateElementRequest) { EObject container = ((CreateElementRequest) request).getContainer(); System.out.println("container: " + container); if (container instanceof Interface) { IElementType messageSetType = ElementTypeRegistry.getInstance().getType(IUMLRTElementTypes.RT_MESSAGE_SET_ID); if (messageSetType instanceof ISpecializationType) { if (!((ISpecializationType) messageSetType).getMatcher().matches(container)) { return false; } if (RTMessageKind.OUT == MessageSetUtils.getMessageKind(container)) { return true; } } } else if (container instanceof Operation) { return true; } return false; } return super.approveRequest(request); }

Target:
public boolean approveRequest(IEditCommandRequest request) { if (request instanceof CreateElementRequest) { EObject container = ((CreateElementRequest) request).getContainer(); if (container instanceof Interface) { IElementType messageSetType = ElementTypeRegistry.getInstance().getType(IUMLRTElementTypes.RT_MESSAGE_SET_ID); if (messageSetType instanceof ISpecializationType) { if (!((ISpecializationType) messageSetType).getMatcher().matches(container)) { return false; } if (RTMessageKind.OUT == MessageSetUtils.getMessageKind(container)) { return true; } } } else if (container instanceof Operation) { return true; } return false; } return super.approveRequest(request); }
Source:
public synchronized SubscriptionContext getSubscriptionContext(Entity entity) { if (!this.entity.equals(entity)) throw new IllegalStateException("Non-deployment context "+this+" can only use a single Entity: has "+this.entity+", but passed "+entity); if (mode==NonDeploymentManagementContextMode.MANAGEMENT_STOPPED) return null; return subscriptionContext; }

Target:
public synchronized SubscriptionContext getSubscriptionContext(Entity entity) { if (!this.entity.equals(entity)) throw new IllegalStateException("Non-deployment context "+this+" can only use a single Entity: has "+this.entity+", but passed "+entity); if (mode==NonDeploymentManagementContextMode.MANAGEMENT_STOPPED) return new NonDeploymentSubscriptionContext(initialManagementContext, entity); return subscriptionContext; }
Source:
public static String setState(final Connection conn, final String userId, final String classification, final String itemId, final State state) throws DatabaseAccessException { String result; final String query = "SELECT * FROM State WHERE UserID=? AND SchoolItemType=? AND SchoolItemID=?;"; try (PreparedStatement stmt = conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)) { stmt.setString(1, userId); stmt.setString(2, classification); stmt.setString(3, itemId); try (final ResultSet rst = stmt.executeQuery()) { if (rst.next()) { rst.updateBoolean("Completed", state.getCompleted()); rst.updateBoolean("Started", state.getStarted()); rst.updateBoolean("Graded", state.getGraded()); rst.updateRow(); result = "SET"; } else { rst.moveToInsertRow(); rst.updateString("UserID", userId); rst.updateString("SchoolItemType", classification); rst.updateString("SchoolItemID", itemId); rst.updateBoolean("Completed", state.getCompleted()); rst.updateBoolean("Started", state.getStarted()); rst.updateBoolean("Graded", state.getGraded()); rst.insertRow(); rst.moveToCurrentRow(); result = "INSERT"; } } catch (SQLException e) { throw new DatabaseAccessException(e, false); } } catch (SQLException e) { throw new DatabaseAccessException(e, false); } return result; }

Target:
public static String setState(final Connection conn, final String userId, final String classification, final String itemId, final State state) throws DatabaseAccessException { String result; final String query = "SELECT * FROM State WHERE UserID=? AND SchoolItemType=? AND SchoolItemID=?;"; try (PreparedStatement stmt = conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)) { stmt.setString(1, userId); stmt.setString(2, classification); stmt.setString(3, itemId); try (final ResultSet rst = stmt.executeQuery()) { if (rst.next()) { rst.updateBoolean(DatabaseStringConstants.STATE_COMPLETED, state.getCompleted()); rst.updateBoolean(DatabaseStringConstants.STATE_STARTED, state.getStarted()); rst.updateBoolean(DatabaseStringConstants.STATE_GRADED, state.getGraded()); rst.updateRow(); result = "SET"; } else { rst.moveToInsertRow(); rst.updateString(DatabaseStringConstants.USER_ID, userId); rst.updateString(DatabaseStringConstants.SCHOOLITEMTYPE, classification); rst.updateString(DatabaseStringConstants.SCHOOLITEMID, itemId); rst.updateBoolean(DatabaseStringConstants.STATE_COMPLETED, state.getCompleted()); rst.updateBoolean(DatabaseStringConstants.STATE_STARTED, state.getStarted()); rst.updateBoolean(DatabaseStringConstants.STATE_GRADED, state.getGraded()); rst.insertRow(); rst.moveToCurrentRow(); result = "INSERT"; } } catch (SQLException e) { throw new DatabaseAccessException(e, false); } } catch (SQLException e) { throw new DatabaseAccessException(e, false); } return result; }
Source:
public void convertsToJsonWhenAllPresent() { final String success = "Everything is awesome"; MatcherAssert.assertThat( new Statuses.StatusCreate(Status.State.SUCCESS) .withTargetUrl(Optional.of(URL)) .withDescription(success) .withContext(Optional.of(CONTEXT)) .json().toString(), Matchers.equalTo("{\"state\":\"success\",\"description\":\"Everything is awesome\",\"context\":\"jcabi/github/test\",\"target_url\":\"<LINK_0>\"}") ); }

Target:
public void convertsToJsonWhenAllPresent() { final String success = "Everything is not so awesome"; MatcherAssert.assertThat( new Statuses.StatusCreate(Status.State.ERROR) .withTargetUrl(Optional.of(StatusesTest.URL)) .withDescription(success) .withContext(Optional.of(StatusesTest.CONTEXT)) .json().toString(), Matchers.equalTo( Json.createObjectBuilder() .add(StatusesTest.STATE_PROP, "error") .add(StatusesTest.DESCRIPTION_PROP, success) .add(StatusesTest.CONTEXT_PROP, StatusesTest.CONTEXT) .add(StatusesTest.TARGET_PROP, StatusesTest.URL) .build().toString() ) ); }
Source:
protected String generateDomainXml() { VmNic nic = getParameters().getNic(); VmDevice vmDevice = getParameters().getVmDevice(); LibvirtVmXmlBuilder builder = new LibvirtVmXmlBuilder( getParameters().getVm(), getVds().getId(), nic, vmDevice, vmInfoBuildUtils, nic.isPassthrough() ? Collections.singletonMap(nic.getId(), vmDevice.getHostDevice()) : Collections.emptyMap()); String libvirtXml = builder.buildHotplugNic(false); String prettyLibvirtXml = XmlUtils.prettify(libvirtXml); if (prettyLibvirtXml != null) { log.info("NIC hot-plug: {}", prettyLibvirtXml); } return libvirtXml; }

Target:
protected String generateDomainXml() { VmNic nic = getParameters().getNic(); VmDevice vmDevice = getParameters().getVmDevice(); LibvirtVmXmlBuilder builder = new LibvirtVmXmlBuilder( getParameters().getVm(), getVds().getId(), nic, vmDevice, vmInfoBuildUtils, nic.isPassthrough() ? Collections.singletonMap(nic.getId(), vmDevice.getHostDevice()) : Collections.emptyMap()); String libvirtXml = builder.buildHotplugNic(); String prettyLibvirtXml = XmlUtils.prettify(libvirtXml); if (prettyLibvirtXml != null) { log.info("NIC hot-plug: {}", prettyLibvirtXml); } return libvirtXml; }
Source:
void maybeDeleteRecordedAutoDeleteExchange(String exchange) { synchronized (this.consumers) { synchronized (this.recordedExchanges) { if(!hasMoreDestinationsBoundToExchange(Utility.copy(this.recordedBindings), exchange)) { RecordedExchange x = this.recordedExchanges.get(exchange); if((x != null) && x.isAutoDelete()) { deleteRecordedExchange(exchange); } } } } }

Target:
void maybeDeleteRecordedAutoDeleteExchange(String exchange) { synchronized (this.consumers) { synchronized (this.recordedExchanges) { if(!hasMoreDestinationsBoundToExchange(Utility.copy(this.recordedBindings), exchange)) { RecordedExchange x = this.recordedExchanges.get(exchange); if((x != null) && x.isAutoDelete()) { this.recordedExchanges.remove(exchange); } } } } }
Source:
public void setCounterValue(String sequence, long nextValue, boolean force) { try { if (oma.select(SequenceCounter.class).eq(SequenceCounter.NAME, sequence).exists()) { if (force) { int updatedRows = oma.getDatabase() .createQuery("UPDATE sequencecounter " + "SET nextValue = ${value} " + "WHERE name = ${name}") .set("name", sequence) .set("value", nextValue) .executeUpdate(); if (updatedRows == 1) { return; } } else { int updatedRows = oma.getDatabase() .createQuery("UPDATE sequencecounter " + "SET nextValue = ${value} " + "WHERE name = ${name} " + " AND nextValue <= ${value}") .set("name", sequence) .set("value", nextValue) .executeUpdate(); if (updatedRows == 1) { return; } } } else { try { SequenceCounter counter = new SequenceCounter(); counter.setName(sequence); counter.setNextValue(nextValue); oma.update(counter); return; } catch (HandledException e) { Exceptions.ignore(e); } } throw Exceptions.handle() .to(LOG) .withSystemErrorMessage("Failed to specify the next value for sequence %s", sequence) .handle(); } catch (SQLException e) { throw Exceptions.handle() .to(LOG) .error(e) .withSystemErrorMessage( "Failed to specify the next value for sequence %s due to a database error: %s", sequence) .handle(); } }

Target:
public void setCounterValue(String sequence, long nextValue, boolean force) { try { if (oma.select(SequenceCounter.class).eq(SequenceCounter.NAME, sequence).exists()) { String sql = "UPDATE sequencecounter " + "SET nextValue = ${value} " + "WHERE name = ${name}"; if (!force) { sql += " AND nextValue <= ${value}"; } int updatedRows = oma.getDatabase() .createQuery(sql) .set("name", sequence) .set("value", nextValue) .executeUpdate(); if (updatedRows == 1) { return; } } else { try { SequenceCounter counter = new SequenceCounter(); counter.setName(sequence); counter.setNextValue(nextValue); oma.update(counter); return; } catch (HandledException e) { Exceptions.ignore(e); } } throw Exceptions.handle() .to(LOG) .withSystemErrorMessage("Failed to specify the next value for sequence %s", sequence) .handle(); } catch (SQLException e) { throw Exceptions.handle() .to(LOG) .error(e) .withSystemErrorMessage( "Failed to specify the next value for sequence %s due to a database error: %s", sequence) .handle(); } }
Source:
public void duplicateNameTest() { clickMenu("Boards", "Save as"); type("board 1"); click("OK"); assertEquals(1, panelControl.getPanelCount()); clickMenu("Panels", "Create"); clickMenu("Boards", "Save as"); type("board 1"); click("OK"); assertNodeExists(hasText("A board by the name 'board 1' already exists.")); click("Yes"); clickMenu("Boards", "Open", "board 1"); assertEquals(2, panelControl.getPanelCount()); clickMenu("Panels", "Create"); clickMenu("Boards", "Save as"); type("board 1"); click("OK"); click("No"); click("Cancel"); clickMenu("Boards", "Open", "board 1"); assertEquals(2, panelControl.getPanelCount()); }

Target:
public void duplicateNameTest() { clickMenu("Boards", "Save as"); click("OK"); assertEquals(1, panelControl.getPanelCount()); clickMenu("Panels", "Create"); clickMenu("Boards", "Save as"); click("OK"); waitUntilNodeAppears(hasText("A board by the name 'New Board' already exists.")); click("Yes"); clickMenu("Boards", "Open", "New Board"); assertEquals(2, panelControl.getPanelCount()); clickMenu("Panels", "Create"); assertEquals(3, panelControl.getPanelCount()); clickMenu("Boards", "Save as"); click("OK"); click("No"); click("Cancel"); clickMenu("Boards", "Open", "New Board"); assertEquals(2, panelControl.getPanelCount()); }
Source:
public AddMemberBox() { addPanel = new FlowPanel(); addMember = new Button(Util.C.buttonAddGroupMember()); nameTxtBox = new HintTextBox(); nameTxt = new SuggestBox(new AccountSuggestOracle(), nameTxtBox); nameTxtBox.setVisibleLength(50); nameTxtBox.setHintText(Util.C.defaultAccountName()); nameTxtBox.setHintStyleName(Gerrit.RESOURCES.css().inputFieldTypeHint()); nameTxtBox.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { submitOnSelection = false; if (event.getCharCode() == KeyCodes.KEY_ENTER) { if (nameTxt.isSuggestionListShowing()) { submitOnSelection = true; } else { doAdd(); } } } }); nameTxt.addSelectionHandler(new SelectionHandler<Suggestion>() { @Override public void onSelection(SelectionEvent<Suggestion> event) { if (submitOnSelection) { submitOnSelection = false; doAdd(); } } }); addPanel.add(nameTxt); addPanel.add(addMember); initWidget(addPanel); }

Target:
public AddMemberBox() { addPanel = new FlowPanel(); addMember = new Button(Util.C.buttonAddGroupMember()); nameTxtBox = new HintTextBox(); nameTxt = new SuggestBox(new AccountSuggestOracle(), nameTxtBox); nameTxtBox.setVisibleLength(50); nameTxtBox.setHintText(Util.C.defaultAccountName()); nameTxtBox.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { submitOnSelection = false; if (event.getCharCode() == KeyCodes.KEY_ENTER) { if (nameTxt.isSuggestionListShowing()) { submitOnSelection = true; } else { doAdd(); } } } }); nameTxt.addSelectionHandler(new SelectionHandler<Suggestion>() { @Override public void onSelection(SelectionEvent<Suggestion> event) { if (submitOnSelection) { submitOnSelection = false; doAdd(); } } }); addPanel.add(nameTxt); addPanel.add(addMember); initWidget(addPanel); }
Source:
public void testIncludedAndExcludedGroups() { XmlSuite suite = new XmlSuite(); suite.addIncludedGroup("foo"); suite.addExcludedGroup("bar"); assertThat(suite.getIncludedGroups()).hasSameElementsAs(Collections.singletonList("foo")); assertThat(suite.getExcludedGroups()).hasSameElementsAs(Collections.singletonList("bar")); }

Target:
public void testIncludedAndExcludedGroups() { XmlSuite suite = new XmlSuite(); suite.addIncludedGroup("foo"); suite.addExcludedGroup("bar"); assertThat(suite.getIncludedGroups()).containsExactly("foo"); assertThat(suite.getExcludedGroups()).containsExactly("bar"); }
Source:
private void internalExtractResult(long startTs, byte[] row, byte[] col, byte[] val, long ts) { if (ts < startTs) { Cell cell = Cell.create(row, col); if (!collector.containsKey(row)) { collector.put(row, new LinkedHashMap<>()); collector.get(row).put(cell, Value.create(val, ts)); } else if (!collector.get(row).containsKey(cell)) { collector.get(row).put(cell, Value.create(val, ts)); } } else { getPostFilteredCellsMeter().mark(); } }

Target:
private void internalExtractResult(long startTs, byte[] row, byte[] col, byte[] val, long ts) { if (ts < startTs) { Cell cell = Cell.create(row, col); if (!collector.containsKey(row)) { collector.put(row, new LinkedHashMap<>()); collector.get(row).put(cell, Value.create(val, ts)); } else if (!collector.get(row).containsKey(cell)) { collector.get(row).put(cell, Value.create(val, ts)); } else { notLatestVisibleValueCellFilterMeter.mark(); } } else { notLatestVisibleValueCellFilterMeter.mark(); } }
Source:
public RepositoryGroup getSelectedRepositoryGroup(ExecutionEvent event) throws ExecutionException { Object singleSelection = null; if (HandlerUtil .getActivePartChecked(event) instanceof RepositoriesView) { List<?> selected = getSelectedNodes(event); if (selected.size() == 1 && selected.get(0) instanceof RepositoryTreeNode) { singleSelection = selected.get(0); } } else { RepositoriesView view = getRepositoriesView(); if (view != null) { IStructuredSelection selection = view.getCommonViewer() .getStructuredSelection(); if (selection != null && selection.size() == 1) { singleSelection = selection.getFirstElement(); } } } if (!(singleSelection instanceof RepositoryGroupNode)) { return null; } return ((RepositoryGroupNode) singleSelection).getObject(); }

Target:
public RepositoryGroup getSelectedRepositoryGroup(ExecutionEvent event) throws ExecutionException { Object singleSelection = null; if (HandlerUtil .getActivePartChecked(event) instanceof RepositoriesView) { List<?> selected = getSelectedNodes(event); if (selected.size() == 1) { singleSelection = selected.get(0); } } else { RepositoriesView view = getRepositoriesView(); if (view != null) { IStructuredSelection selection = view.getCommonViewer() .getStructuredSelection(); if (selection != null && selection.size() == 1) { singleSelection = selection.getFirstElement(); } } } if (!(singleSelection instanceof RepositoryGroupNode)) { return null; } return ((RepositoryGroupNode) singleSelection).getObject(); }
Source:
public void findByApplicationEntityOrderByStateIndexDescShouldFindSingleStateForApplicationWithSingleState() { ApplicationEntity applicationEntity = getApplicationByCandidateName(CANDIDATE_NAME_B); StateEntity expectedStateEntity = getExpectedStateEntityForSingleState(); StateEntity stateEntity = this.statesRepository.findByApplicationEntityOrderByStateIndexDesc(applicationEntity).get(ZEROTH_ELEMENT); assertStateEntity(stateEntity, expectedStateEntity); }

Target:
public void findByApplicationEntityOrderByStateIndexDescShouldFindSingleStateForApplicationWithSingleState() { ApplicationEntity applicationEntity = getApplicationByCandidateName(CANDIDATE_NAME_B); StateEntity expectedStateEntity = getExpectedStateEntityForSingleState(); List<StateEntity> stateEntityList = this.statesRepository.findByApplicationEntityOrderByStateIndexDesc(applicationEntity); assertThat(stateEntityList, notNullValue()); assertThat(stateEntityList.size(), is(VALUE_ONE)); StateEntity stateEntity = stateEntityList.get(ZEROTH_ELEMENT); assertStateEntity(stateEntity, expectedStateEntity); }
Source:
public CompositeChange flatten() { return new CompositeChange( changes.stream() .map( change -> { if (change instanceof CompositeChange) { return ((CompositeChange) change).flatten().getChanges(); } else { return List.of(change); } }) .flatMap(Collection::stream) .collect(Collectors.toList())); }

Target:
public CompositeChange flatten() { return new CompositeChange( changes.stream() .map( change -> change instanceof CompositeChange ? ((CompositeChange) change).flatten().getChanges() : List.of(change)) .flatMap(Collection::stream) .collect(Collectors.toList())); }
Source:
public static ZookeeperConnection valueOf(final String connStr) { final Matcher m = ZK_CONN_PATTERN.matcher(connStr); if (!m.matches()) { throw new RuntimeException("Unsupported format of zk connection string " + connStr); } final String typeString = m.group(1); final Optional<ZookeeperConnectionType> optType = Arrays.stream(ZookeeperConnectionType.values()) .filter(v -> v.name().equalsIgnoreCase(typeString)) .findAny(); if (!optType.isPresent()) { throw new RuntimeException("Can not detect type of connection from " + typeString + " in " + connStr); } final ZookeeperConnectionType type = optType.get(); final String[] hostsPorts = m.group(2).split(","); final List<Integer> ports = Arrays.stream(hostsPorts) .filter(v -> v.contains(":")) .map(v -> v.substring(v.lastIndexOf(':') + 1)) .map(Integer::parseInt) .collect(Collectors.toList()); if (ports.isEmpty()) { throw new RuntimeException("Ports are not defined for hosts, no default port could be found in " + connStr); } final Integer defaultPort = ports.get(ports.size() - 1); final List<AddressPort> addresses = Arrays.stream(hostsPorts).map(hostPort -> { final int sepIndex = hostPort.lastIndexOf(':'); if (sepIndex > 0) { return new AddressPort( hostPort.substring(0, sepIndex), Integer.parseInt(hostPort.substring(sepIndex + 1))); } else { return new AddressPort(hostPort, defaultPort); } }).collect(Collectors.toList()); final String path = m.groupCount() >= 3 ? m.group(3) : null; return new ZookeeperConnection(type, addresses, path); }

Target:
public static ZookeeperConnection valueOf(final String connStr) { final Matcher m = ZK_CONN_PATTERN.matcher(connStr); if (!m.matches()) { throw new RuntimeException("Unsupported format of zk connection string " + connStr); } final String typeString = m.group(1); final ZookeeperConnectionType type = Arrays.stream(ZookeeperConnectionType.values()) .filter(v -> v.name().equalsIgnoreCase(typeString)) .findAny() .orElseThrow(() -> new RuntimeException("Can not detect type of connection" + typeString + " in " + connStr)); final String[] hostsPorts = m.group(2).split(","); final List<Integer> ports = Arrays.stream(hostsPorts) .filter(v -> v.contains(":")) .map(v -> v.substring(v.lastIndexOf(':') + 1)) .map(Integer::parseInt) .collect(Collectors.toList()); if (ports.isEmpty()) { throw new RuntimeException("Ports are not defined for hosts, no default port could be found in " + connStr); } final Integer defaultPort = ports.get(ports.size() - 1); final List<AddressPort> addresses = Arrays.stream(hostsPorts).map(hostPort -> { final int sepIndex = hostPort.lastIndexOf(':'); if (sepIndex > 0) { return new AddressPort( hostPort.substring(0, sepIndex), Integer.parseInt(hostPort.substring(sepIndex + 1))); } else { return new AddressPort(hostPort, defaultPort); } }).collect(Collectors.toList()); final String path = m.groupCount() >= 3 ? m.group(3) : null; return new ZookeeperConnection(type, addresses, path); }
Source:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final DepthCommit c = (DepthCommit)pending.next(); if (c == null) return null; if ((c.flags & RevWalk.PARSED) == 0) c.parseHeaders(walk); if (c.depth > depth) { c.flags |= UNINTERESTING; continue; } if (c.depth == depth) c.add(SHALLOW); int newDepth = c.depth + 1; for (final RevCommit p : c.parents) { DepthCommit dp = (DepthCommit)p; boolean add = false; if (dp.depth == -1) { dp.depth = newDepth; add = true; } if ((c.flags & UNINTERESTING) == 0 && ((p.flags & UNINTERESTING) != 0) && (!p.has(BOUNDARY))) { p.add(BOUNDARY); add = true; } if (add) pending.add(p); } return c; } }

Target:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final DepthCommit c = (DepthCommit)pending.next(); if (c == null) return null; if ((c.flags & RevWalk.PARSED) == 0) c.parseHeaders(walk); if (c.depth > depth) { c.flags |= UNINTERESTING; continue; } if (c.depth == depth) c.add(SHALLOW); int newDepth = c.depth + 1; for (final RevCommit p : c.parents) { DepthCommit dp = (DepthCommit)p; boolean add = false; if (dp.depth == -1) { dp.depth = newDepth; add = true; } if ((c.flags & UNINTERESTING) == 0 && ((p.flags & UNINTERESTING) != 0) && (BOUNDARY != null) && !p.has(BOUNDARY)) { if (BOUNDARY != null) p.add(BOUNDARY); add = true; } if (add) pending.add(p); } return c; } }
Source:
AzureBlobWriter createNewWriter(String blobURL, AzureBlobWriterMetrics writerMetrics) { try { return writerFactory.getWriterInstance(containerAsyncClient, blobURL, asyncBlobThreadPool, writerMetrics, blockFlushThresholdSize, flushTimeoutMs, new CompressionFactory().getCompression(config.getCompressionType(systemName)), config.getSuffixRandomStringToBlobName(systemName), config.getMaxBlobSize(systemName), config.getMaxMessagesPerBlob(systemName)); } catch (Exception e) { throw new RuntimeException("Failed to create a writer for the producer.", e); } }

Target:
AzureBlobWriter createNewWriter(String blobURL, AzureBlobWriterMetrics writerMetrics) { try { return writerFactory.getWriterInstance(containerAsyncClient, blobURL, asyncBlobThreadPool, writerMetrics, blockFlushThresholdSize, flushTimeoutMs, CompressionFactory.getInstance().getCompression(config.getCompressionType(systemName)), config.getSuffixRandomStringToBlobName(systemName), config.getMaxBlobSize(systemName), config.getMaxMessagesPerBlob(systemName)); } catch (Exception e) { throw new RuntimeException("Failed to create a writer for the producer.", e); } }
Source:
public Subscription schedule(final Action0 action, long delayTime, TimeUnit unit) { ScheduledExecutorService executor = Executors.newScheduledThreadPool(1); final NSBlockOperation runOperation = new NSBlockOperation(); executor.schedule(new Runnable() { @Override public void run() { if (isUnsubscribed()) { return; } final Runnable actionRunner = new Runnable() { @Override public void run() { action.call(); } }; runOperation.addExecutionBlock$(actionRunner); operationQueue.addOperation(runOperation); } }, delayTime, unit); return Subscriptions.create(new Action0() { @Override public void call() { runOperation.cancel(); } }); }

Target:
public Subscription schedule(final Action0 action, long delayTime, TimeUnit unit) { return scheduledAction(action, delayTime, unit); }
Source:
PushCertificateParser(Repository into, ReceiveConfig cfg) { seed = cfg.certNonceSeed; nonceSlopLimit = cfg.certNonceSlopLimit; nonceGenerator = new HMACSHA1NonceGenerator(); db = into; }

Target:
PushCertificateParser(Repository into, ReceiveConfig cfg) { nonceSlopLimit = cfg.certNonceSlopLimit; nonceGenerator = cfg.certNonceSeed != null ? new HMACSHA1NonceGenerator(cfg.certNonceSeed) : null; db = into; }
Source:
void maybeNotifyForBlobCreation() { if (isOperationComplete()) { metadataPutChunk.maybeNotifyForFirstChunkCreation(); if (blobId != null) { NotificationBlobType notificationBlobType = getNumDataChunks() == 1 ? NotificationBlobType.Simple : NotificationBlobType.Composite; notificationSystem.onBlobCreated(getBlobIdString(), getBlobProperties(), getUserMetadata(), notificationBlobType); } } }

Target:
void maybeNotifyForBlobCreation() { if (isOperationComplete()) { boolean composite = !getSuccessfullyPutChunkIdsIfComposite().isEmpty(); if (composite) { metadataPutChunk.notifyForFirstChunkCreation(); } if (blobId != null) { notificationSystem.onBlobCreated(getBlobIdString(), getBlobProperties(), getUserMetadata(), composite ? NotificationBlobType.Composite : NotificationBlobType.Simple); } } }
Source:
public EventTypeCache eventTypeCache() throws Exception { final String connectString = zookeeperConfig.zooKeeperHolder().get().getZookeeperClient().getCurrentConnectionString(); final RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3); final CuratorFramework client = CuratorFrameworkFactory.newClient(connectString, retryPolicy); client.start(); EventBodyMustRespectSchema strategy = new EventBodyMustRespectSchema(); ValidationStrategy.register(EventBodyMustRespectSchema.NAME, strategy); return new EventTypeCache(dbRepo(), client); }

Target:
public EventTypeCache eventTypeCache() throws Exception { final CuratorFramework client = zookeeperConfig.zooKeeperHolder().get(); final EventTypeCache cache = new EventTypeCache(dbRepo(), client); final EventBodyMustRespectSchema strategy = new EventBodyMustRespectSchema(); ValidationStrategy.register(EventBodyMustRespectSchema.NAME, strategy); return new EventTypeCache(dbRepo(), client); }
Source:
private boolean isPropertyEmbeddedInJoinProperties(String propertyName) { EntityPersister entityPersister = this.getFromElement().getEntityPersister(); String propertyPath = String.join( ".", this.propertyPath, propertyName ); try { Type propertyType = entityPersister.getPropertyType( propertyPath ); return propertyType != null; } catch (QueryException e) { return false; } }

Target:
private boolean isPropertyEmbeddedInJoinProperties(String propertyName) { String propertyPath = String.join( ".", this.propertyPath, propertyName ); try { Type propertyType = getFromElement().getPropertyType( this.propertyPath, propertyPath ); return propertyType != null; } catch (QueryException e) { return false; } }