auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void prepare() { KieBaseConfiguration kieBaseConfiguration = KieServices.Factory.get().newKieBaseConfiguration(); kieBaseConfiguration.setOption(EventProcessingOption.STREAM); KieSessionConfiguration kieSessionConfiguration = KieServices.Factory.get().newKieSessionConfiguration(); kieSessionConfiguration.setOption(TimerJobFactoryOption.get("trackable")); Resource resource = KieServices.Factory.get().getResources().newReaderResource(new StringReader(DRL)); resource.setTargetPath(TestConstants.DRL_TEST_TARGET_PATH); final KieBuilder kbuilder = KieBaseUtil.getKieBuilderFromResources(true, resource); final KieContainer kcontainer = KieServices.Factory.get().newKieContainer(kbuilder.getKieModule().getReleaseId()); final KieBase kbase = kcontainer.newKieBase(kieBaseConfiguration); this.ksession = kbase.newKieSession(kieSessionConfiguration, null); }

Target:
public void prepare() { final Resource resource = KieServices.Factory.get().getResources().newReaderResource(new StringReader(DRL)); resource.setTargetPath(TestConstants.DRL_TEST_TARGET_PATH); final KieBuilder kbuilder = KieBaseUtil.getKieBuilderFromResources(true, resource); final KieContainer kcontainer = KieServices.Factory.get().newKieContainer(kbuilder.getKieModule().getReleaseId()); final KieBaseConfiguration kieBaseConfiguration = KieServices.Factory.get().newKieBaseConfiguration(); kieBaseConfiguration.setOption(EventProcessingOption.STREAM); final KieSessionConfiguration kieSessionConfiguration = KieServices.Factory.get().newKieSessionConfiguration(); kieSessionConfiguration.setOption(TimerJobFactoryOption.get("trackable")); final KieBase kbase = kcontainer.newKieBase(kieBaseConfiguration); this.ksession = kbase.newKieSession(kieSessionConfiguration, null); }
Source:
private void putECDHKeyAgreementImplClass(String className) { String prefix = getClass().getPackage().getName() + "."; String supportedKeyClasses = prefix + "OpenSSLKeyHolder" + "|" + ECPrivateKey.class.getName(); String supportedKeyFormats = "PKCS#8"; putImplClassWithKeyConstraints( "KeyAgreement.ECDH", prefix + className, supportedKeyClasses, supportedKeyFormats); }

Target:
private void putECDHKeyAgreementImplClass(String className) { String prefix = getClass().getPackage().getName() + "."; String supportedKeyClasses = prefix + "OpenSSLKeyHolder" + "|" + STANDARD_EC_PRIVATE_KEY_INTERFACE_CLASS_NAME; String supportedKeyFormats = "PKCS#8"; putImplClassWithKeyConstraints( "KeyAgreement.ECDH", prefix + className, supportedKeyClasses, supportedKeyFormats); }
Source:
private static boolean matchesSuffix(Optional<String> summary, Optional<String> summary1) { if (!summary.isPresent() && !summary1.isPresent()) return true; else if (summary.isPresent() && summary1.isPresent()) { int startOfRealSummary = summary.get().indexOf(")") + 1; int startOfRealSummary1 = summary1.get().indexOf(")") + 1; return summary.get().substring(startOfRealSummary).equals(summary1.get().substring(startOfRealSummary1)); } return false; }

Target:
private static boolean matchesSuffix(Optional<String> summary, Optional<String> summary1) { if (!summary.isPresent() && !summary1.isPresent()) return true; else if (summary.isPresent() && summary1.isPresent()) { int endOfPrefix = summary.get().indexOf(")") + 1; int endOfPrefix1 = summary1.get().indexOf(")") + 1; String trimmedSummaryWithoutPrefix = summary.get().substring(endOfPrefix).trim(); String trimmedSummaryWithoutPrefix1 = summary1.get().substring(endOfPrefix1).trim(); return trimmedSummaryWithoutPrefix.equals(trimmedSummaryWithoutPrefix1); } return false; }
Source:
public void retireOrderType_shouldRetiredTheGivenUnretiredOrderType() { OrderService orderService = Context.getOrderService(); OrderType orderType = orderService.getOrderType(10); assertFalse(orderType.getRetired()); orderService.retireOrderType(orderType, "Retire for testing purposes"); orderType = orderService.getOrderType(10); assertTrue(orderType.getRetired()); }

Target:
public void retireOrderType_shouldRetiredTheGivenUnretiredOrderType() { OrderService orderService = Context.getOrderService(); OrderType orderType = orderService.getOrderType(15); assertFalse(orderType.getRetired()); assertNull(orderType.getRetiredBy()); assertNull(orderType.getRetireReason()); assertNull(orderType.getDateRetired()); orderService.retireOrderType(orderType, "Retire for testing purposes"); orderType = orderService.getOrderType(15); assertTrue(orderType.getRetired()); assertNotNull(orderType.getRetiredBy()); assertNotNull(orderType.getRetireReason()); assertNotNull(orderType.getDateRetired()); }
Source:
public void loadWorkflowsFromDatabase() { try { List<ConfigItem<WorkflowRepresentation>> load = getPersistence().load(null); for (ConfigItem<WorkflowRepresentation> configItem : load) { final WorkflowRepresentation content = configItem.getContent(); workflows.put(content.getName(), content); } } catch (InvalidConfigurationException e) { throw new RuntimeException(e); } catch (PersistenceException e) { throw new RuntimeException(e); } }

Target:
public void loadWorkflowsFromDatabase() throws PersistenceException { try { List<ConfigItem<WorkflowRepresentation>> load = getPersistence().load(new HashMap<String, String>()); for (ConfigItem<WorkflowRepresentation> configItem : load) { final WorkflowRepresentation content = configItem.getContent(); workflows.put(content.getName(), content); } } catch (InvalidConfigurationException e) { LOGGER.error("Invalid Configuration: " + e.getMessage()); throw new PersistenceException(e); } }
Source:
public static File getFileById(final String id) throws IOException { ensureDirExists(); try (DirectoryStream<Path> stream = Files.newDirectoryStream(getTempdir(), "*" + id + RECOVERY_FILE_EXTENSION)) { final Iterator<Path> iterator = stream.iterator(); if (iterator.hasNext()) { return iterator.next().toFile(); } throw new IOException("File not found matching ID: " + id); } catch (final IOException e) { throw new IOException("Could not open file for ID:" + id, e); } }

Target:
public static File getFileById(final String id) throws IOException { ensureDirExists(); try (final DirectoryStream<Path> stream = Files.newDirectoryStream(getTempdir(), "*" + id + RECOVERY_FILE_EXTENSION)) { final Iterator<Path> iterator = stream.iterator(); if (iterator.hasNext()) { return iterator.next().toFile(); } throw new IOException("File not found matching ID: " + id); } catch (final IOException e) { throw new IOException("Could not open file for ID:" + id, e); } }
Source:
private void checkNotTranslation(XWikiDocument doc) { if (isTranslation(doc)) { throw new IllegalStateException("Trying to access XObjects on translation '" + doc.getLanguage() + "' of doc '" + doc.getDocumentReference() + "'"); } }

Target:
void checkNotTranslation(XWikiDocument doc) { checkState(!isTranslation(doc), MessageFormat.format( "Trying to access XObjects on translation ''{0}'' of doc ''{1}''", doc.getLanguage(), doc.getDocumentReference())); }
Source:
public static Status fromValue(String status) { try { return valueOf(checkNotNull(status, "type")); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } }

Target:
public static Status fromValue(String status) { try { return valueOf(checkNotNull(status, "status")); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } }
Source:
private static void checkKeyValue(String[] keyValue) { if (keyValue.length != 2) { final String exMessage = "Illegal key - value format, key value should be " + "separated with single `:` character"; throw conversionArgumentException(exMessage); } }

Target:
private static void checkKeyValue(String[] keyValue) { if (keyValue.length != 2 || !isQuotedKeyValue(keyValue[0], keyValue[1])) { final String exMessage = "Illegal key-value format. The key-value should be quoted " + "and separated with the `" + KEY_VALUE_DELIMITER + "` character."; throw newIllegalArgumentException(exMessage); } }
Source:
public void assertOpen() { if ( terminationReason != null ) { throw new TransactionTerminatedException( terminationReason ); } }

Target:
public void assertOpen() { Status reason = this.terminationReason; if ( reason != null ) { throw new TransactionTerminatedException( reason ); } }
Source:
private SourceResponse cloneResponse(SourceResponse sourceResponse) { List<Result> clonedResults = new ArrayList<>(); sourceResponse .getResults() .forEach( result -> { Metacard metacard = result.getMetacard(); Metacard clonedMetacard = new MetacardImpl(metacard, metacard.getMetacardType()); Result clonedResult = new ResultImpl(clonedMetacard); ((ResultImpl) clonedResult).setDistanceInMeters(result.getDistanceInMeters()); ((ResultImpl) clonedResult).setRelevanceScore(result.getRelevanceScore()); clonedResults.add(clonedResult); }); return new QueryResponseImpl( sourceResponse.getRequest(), clonedResults, true, sourceResponse.getHits(), sourceResponse.getProperties()); }

Target:
private SourceResponse cloneResponse(SourceResponse sourceResponse) { List<Result> clonedResults = sourceResponse.getResults().stream().map(this::cloneResult).collect(Collectors.toList()); return new QueryResponseImpl( sourceResponse.getRequest(), clonedResults, true, sourceResponse.getHits(), sourceResponse.getProperties()); }
Source:
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { try{ String upgradeQuery = "ALTER TABLE " + DbStructure.Table.DOWNLOADS + " ADD COLUMN " + DbStructure.Column.UNIT_URL + " TEXT " + " ADD COLUMN " + DbStructure.Column.URL_HIGH_QUALITY + " TEXT " + " ADD COLUMN " + DbStructure.Column.URL_LOW_QUALITY + " TEXT " + " ADD COLUMN " + DbStructure.Column.URL_YOUTUBE + " TEXT "; if (oldVersion == 1 && newVersion == 2) { db.execSQL(upgradeQuery); } logger.debug("Database upgraded from " + oldVersion + " to " + newVersion); }catch(Exception e){ logger.error(e); } }

Target:
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { try { String upgradeToV2 = "ALTER TABLE " + DbStructure.Table.DOWNLOADS + " ADD COLUMN " + DbStructure.Column.UNIT_URL + " TEXT "; String[] upgradeToV3 = new String[] { "ALTER TABLE " + DbStructure.Table.DOWNLOADS + " ADD COLUMN " + DbStructure.Column.UNIT_URL + " TEXT ", "ALTER TABLE " + DbStructure.Table.DOWNLOADS + " ADD COLUMN " + DbStructure.Column.URL_HIGH_QUALITY + " TEXT ", "ALTER TABLE " + DbStructure.Table.DOWNLOADS + " ADD COLUMN " + DbStructure.Column.URL_LOW_QUALITY + " TEXT ", "ALTER TABLE " + DbStructure.Table.DOWNLOADS + " ADD COLUMN " + DbStructure.Column.URL_YOUTUBE + " TEXT "}; if (oldVersion == 1 && newVersion == 2) { db.execSQL(upgradeToV2); } if (oldVersion == 1 && newVersion == 3) { for (String query : upgradeToV3) { db.execSQL(query); } } logger.debug("Database upgraded from " + oldVersion + " to " + newVersion); }catch(Exception e){ logger.error(e); } }
Source:
static Vector<Vector<Integer>> loadTriangle(String fileName) { return Vector.ofAll( Utils.readLines(Utils.file(fileName)).map(line -> Arrays.stream(line.split("\\s")).map(Integer::parseInt) ).map(s -> List.ofAll(s::iterator).toVector()) ); }

Target:
static Vector<Vector<Integer>> loadTriangle(String fileName) { return Vector.ofAll( Utils.readLines(Utils.file(fileName)).map(line -> Arrays.stream(line.split("\\s")).map(Integer::parseInt) ).map(s -> Vector.ofAll(s::iterator)) ); }
Source:
public void onLightStateChanged(HueBridge bridge, FullLight fullLight) { logger.trace("onLightStateChanged() was called"); if (fullLight == null) { logger.warn("Unable to change state for null light."); return; } if (!fullLight.getId().equals(lightId)) { logger.trace("Received state change for another handler's light ({}). Will be ignored.", fullLight.getId()); return; } initializeProperties(); lastSentColorTemp = null; lastSentBrightness = null; if (fullLight.getState().isReachable()) { updateStatus(ThingStatus.ONLINE); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "Bridge reports light as not reachable"); } HSBType hsbType = LightStateConverter.toHSBType(fullLight.getState()); if (!fullLight.getState().isOn()) { hsbType = new HSBType(hsbType.getHue(), hsbType.getSaturation(), new PercentType(0)); } updateState(CHANNEL_COLOR, hsbType); PercentType percentType = LightStateConverter.toColorTemperaturePercentType(fullLight.getState()); updateState(CHANNEL_COLORTEMPERATURE, percentType); percentType = LightStateConverter.toBrightnessPercentType(fullLight.getState()); if (!fullLight.getState().isOn()) { percentType = new PercentType(0); } updateState(CHANNEL_BRIGHTNESS, percentType); if (fullLight.getState().isOn()) { updateState(CHANNEL_SWITCH, OnOffType.ON); } else { updateState(CHANNEL_SWITCH, OnOffType.OFF); } StringType stringType = LightStateConverter.toAlertStringType(fullLight.getState()); if (!stringType.toString().equals("NULL")) { updateState(CHANNEL_ALERT, stringType); scheduleAlertStateRestore(stringType); } }

Target:
public void onLightStateChanged(HueBridge bridge, FullLight fullLight) { logger.trace("onLightStateChanged() was called"); if (!fullLight.getId().equals(lightId)) { logger.trace("Received state change for another handler's light ({}). Will be ignored.", fullLight.getId()); return; } initializeProperties(); lastSentColorTemp = null; lastSentBrightness = null; if (fullLight.getState().isReachable()) { updateStatus(ThingStatus.ONLINE); } else { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, "@text/offline.light-not-reachable"); } HSBType hsbType = LightStateConverter.toHSBType(fullLight.getState()); if (!fullLight.getState().isOn()) { hsbType = new HSBType(hsbType.getHue(), hsbType.getSaturation(), new PercentType(0)); } updateState(CHANNEL_COLOR, hsbType); PercentType percentType = LightStateConverter.toColorTemperaturePercentType(fullLight.getState()); updateState(CHANNEL_COLORTEMPERATURE, percentType); percentType = LightStateConverter.toBrightnessPercentType(fullLight.getState()); if (!fullLight.getState().isOn()) { percentType = new PercentType(0); } updateState(CHANNEL_BRIGHTNESS, percentType); if (fullLight.getState().isOn()) { updateState(CHANNEL_SWITCH, OnOffType.ON); } else { updateState(CHANNEL_SWITCH, OnOffType.OFF); } StringType stringType = LightStateConverter.toAlertStringType(fullLight.getState()); if (!stringType.toString().equals("NULL")) { updateState(CHANNEL_ALERT, stringType); scheduleAlertStateRestore(stringType); } }
Source:
public HttpClient build() { if (connectionPool != null) { this.httpClientBuilder = httpClientBuilder.connectionPool(connectionPool); } if (dispatcher != null) { this.httpClientBuilder = httpClientBuilder.dispatcher(dispatcher); } return new OkHttpAsyncHttpClient(this.httpClientBuilder.build()); }

Target:
public HttpClient build() { OkHttpClient.Builder httpClientBuilder = this.okHttpClient == null ? new OkHttpClient.Builder() : this.okHttpClient.newBuilder(); for (Interceptor interceptor : this.networkInterceptors) { httpClientBuilder = httpClientBuilder.addNetworkInterceptor(interceptor); } if (this.readTimeout != null) { httpClientBuilder = httpClientBuilder.readTimeout(this.readTimeout); } else { httpClientBuilder = httpClientBuilder.readTimeout(DEFAULT_READ_TIMEOUT); } if (this.connectionTimeout != null) { httpClientBuilder = httpClientBuilder.connectTimeout(this.connectionTimeout); } else { httpClientBuilder = httpClientBuilder.connectTimeout(DEFAULT_CONNECT_TIMEOUT); } if (this.connectionPool != null) { httpClientBuilder = httpClientBuilder.connectionPool(connectionPool); } if (this.dispatcher != null) { httpClientBuilder = httpClientBuilder.dispatcher(dispatcher); } httpClientBuilder = httpClientBuilder.proxy(this.proxy); if (this.proxyAuthenticator != null) { httpClientBuilder = httpClientBuilder.authenticator(this.proxyAuthenticator); } return new OkHttpAsyncHttpClient(httpClientBuilder.build()); }
Source:
public void setIconSclass(String iconSclass) { if (_iconSclass != iconSclass) { _iconSclass = iconSclass; smartUpdate("iconSclass", iconSclass); } }

Target:
public void setIconSclass(String iconSclass) { if (!Objects.equals(_iconSclass, iconSclass)) { _iconSclass = iconSclass; smartUpdate("iconSclass", iconSclass); } }
Source:
private static boolean shouldAnalyzeMethod(MethodTree methodTree) { return methodTree.block() != null && ((ClassTree) methodTree.parent()).simpleName() != null && !isWithinLocalClass(methodTree); }

Target:
private static boolean shouldAnalyzeMethod(MethodTree methodTree) { return methodTree.block() != null && !memberOfAnonymousClass(methodTree) && !isWithinLocalClass(methodTree); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } BaseCardinalityKey that = (BaseCardinalityKey) o; if (alias != null ? !alias.equals(that.alias) : that.alias != null) { return false; } if (key != null ? !key.equals(that.key) : that.key != null) { return false; } if (normalizedValue != null ? !normalizedValue.equals(that.normalizedValue) : that.normalizedValue != null) { return false; } return true; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } else if(o == null) return false; BaseCardinalityKey that = (BaseCardinalityKey) o; if (alias != null ? !alias.equals(that.alias) : that.alias != null) { return false; } if (key != null ? !key.equals(that.key) : that.key != null) { return false; } if (normalizedValue != null ? !normalizedValue.equals(that.normalizedValue) : that.normalizedValue != null) { return false; } return true; }
Source:
void createStreams(List<StreamSpec> intStreams) throws Exception { if (!intStreams.isEmpty()) { StandAloneCoordinationUtils coordinationUtils1 = null; try { coordinationUtils1 = new StandAloneCoordinationUtils("APP_ID", uid, config); } catch (SamzaException e) { LOG.warn("Coordination utils are not available.", e); } if (coordinationUtils1 != null) { Latch initLatch = coordinationUtils1.getLatch(1, INIT_LATCH_ID); LeaderElector leaderElector = coordinationUtils1.getLeaderElector(); leaderElector.setLeaderElectorListener(() -> { getStreamManager().createStreams(intStreams); initLatch.countDown(); }); leaderElector.tryBecomeLeader(); initLatch.await(LATCH_TIMEOUT_MINUTES, TimeUnit.MINUTES); leaderElector.close(); initLatch.close(); } else { getStreamManager().createStreams(intStreams); } } }

Target:
void createStreams(List<StreamSpec> intStreams) throws Exception { if (!intStreams.isEmpty()) { CoordinationUtils coordinationUtils = null; try { coordinationUtils = CoordinationUtils.getCoordinationUtils("APP_ID", uid, config); } catch (SamzaException e) { LOG.warn("Coordination utils are not available.", e); } if (coordinationUtils != null) { Latch initLatch = coordinationUtils.getLatch(1, INIT_LATCH_ID); LeaderElector leaderElector = coordinationUtils.getLeaderElector(); leaderElector.setLeaderElectorListener(() -> { getStreamManager().createStreams(intStreams); initLatch.countDown(); }); leaderElector.tryBecomeLeader(); initLatch.await(LATCH_TIMEOUT_MINUTES, TimeUnit.MINUTES); leaderElector.close(); initLatch.close(); } else { getStreamManager().createStreams(intStreams); } } }
Source:
public static synchronized EventDeclaration getLostEventDeclaration() { EventDeclaration lostEvent = new EventDeclaration(); IntegerDeclaration lostEventsDeclaration = new IntegerDeclaration(32, false, 32, ByteOrder.LITTLE_ENDIAN, Encoding.ASCII, null, 32); lostEvent.fields = new StructDeclaration(1); lostEvent.fields.addField("Lost events", lostEventsDeclaration); lostEvent.id = -1L; lostEvent.name = "Lost event"; return lostEvent; }

Target:
public static synchronized EventDeclaration getLostEventDeclaration() { EventDeclaration lostEvent = new EventDeclaration(); IntegerDeclaration lostEventsDeclaration = new IntegerDeclaration(32, false, 32, ByteOrder.LITTLE_ENDIAN, Encoding.ASCII, null, 32); lostEvent.fields = new StructDeclaration(1); lostEvent.fields.addField(CTFStrings.LOST_EVENTS_FIELD, lostEventsDeclaration); lostEvent.id = -1L; lostEvent.name = CTFStrings.LOST_EVENT_NAME; return lostEvent; }
Source:
private By buildByFromHtmlElementListAnnotations() { assertValidAnnotations(); if (getField().isAnnotationPresent(FindBys.class)) { FindBys findBys = getField().getAnnotation(FindBys.class); return buildByFromFindBys(findBys); } if (getField().isAnnotationPresent(FindAll.class)) { FindAll findBys = getField().getAnnotation(FindAll.class); return buildBysFromFindAll(findBys); } if (getField().isAnnotationPresent(FindBy.class)) { FindBy findBy = getField().getAnnotation(FindBy.class); return buildByFromFindBy(findBy); } Class<?> listParameterClass = getGenericParameterClass(getField()); while (listParameterClass != Object.class) { if (listParameterClass.isAnnotationPresent(Block.class)) { Block block = listParameterClass.getAnnotation(Block.class); FindBy findBy = block.value(); return buildByFromFindBy(findBy); } listParameterClass = listParameterClass.getSuperclass(); } throw new HtmlElementsException(String.format("Cannot determine how to locate element %s", getField())); }

Target:
private By buildByFromHtmlElementListAnnotations() { assertValidAnnotations(); By result = buildByFromFindAnnotations(); if (result != null) { return result; } Class<?> listParameterClass = getGenericParameterClass(getField()); while (listParameterClass != Object.class) { if (listParameterClass.isAnnotationPresent(Block.class)) { Block block = listParameterClass.getAnnotation(Block.class); FindBy findBy = block.value(); return buildByFromFindBy(findBy); } listParameterClass = listParameterClass.getSuperclass(); } throw new HtmlElementsException(String.format("Cannot determine how to locate element %s", getField())); }
Source:
protected void configure() { install (new ThreadDelegatedScopeModule()); final MetricRegistry metricRegistry = new MetricRegistry(); bind(MetricRegistry.class).toInstance(metricRegistry); install (new MetricsInstrumentationModule(metricRegistry)); bind(HealthCheckRegistry.class).toInstance(new HealthCheckRegistry()); install (new JmxServerModule()); install (new JolokiaModule()); install (new HttpServerModule(config)); bind (OTJacksonJsonProvider.class); install (new OpenTableJacksonModule()); install (new DefaultMetricsModule()); install (new ServerInfoModule()); install (new ConservedHeadersModule()); JaxRsClientBinder.bindFeatureToGroup(binder(), StandardFeatureGroup.PLATFORM_INTERNAL) .to(ClientConservedHeadersFeature.class); install (new OpenTableJaxRsServletModule(config, paths)); install (new OpenTableJaxRsExceptionMapperModule()); }

Target:
protected void configure() { install (new ThreadDelegatedScopeModule()); final MetricRegistry metricRegistry = new MetricRegistry(); bind(MetricRegistry.class).toInstance(metricRegistry); install (new MetricsInstrumentationModule(metricRegistry)); bind(HealthCheckRegistry.class).toInstance(new HealthCheckRegistry()); install (new JmxServerModule()); install (new JolokiaModule()); install (new HttpServerModule(config)); bind (OTJacksonJsonProvider.class); install (new OpenTableJacksonModule()); install (new DefaultMetricsModule()); install (new HealthHttpModule()); install (new ServerInfoModule()); install (new ConservedHeadersModule()); JaxRsClientBinder.bindFeatureToGroup(binder(), StandardFeatureGroup.PLATFORM_INTERNAL) .to(ClientConservedHeadersFeature.class); install (new OpenTableJaxRsServletModule(config, paths)); install (new OpenTableJaxRsExceptionMapperModule()); }
Source:
public CacheStream<CacheEntry<K, V>> stream() { return stream(false); }

Target:
public CacheStream<CacheEntry<K, V>> stream() { return doStream(false); }
Source:
public void onServiceConnected(ComponentName component, IBinder service) { if (component.equals(new ComponentName( FileDisplayActivity.this, FileDownloader.class))) { Log_OC.d(TAG, "Download service connected"); mDownloaderBinder = (FileDownloaderBinder) service; if (mFileWaitingToPreview != null) if (getStorageManager() != null) { mFileWaitingToPreview = getStorageManager().getFileById(mFileWaitingToPreview.getFileId()); if (!mFileWaitingToPreview.isDown()) { requestForDownload(); } } if (getFile() != null && mDownloaderBinder.isDownloading(getAccount(), getFile())) { FileFragment secondFragment = getSecondFragment(); if (secondFragment != null && secondFragment instanceof PreviewVideoFragment) { cleanSecondFragment(); Fragment detailFragment = FileDetailFragment.newInstance(getFile(), getAccount()); setSecondFragment(detailFragment); updateFragmentsVisibility(true); updateActionBarTitleAndHomeButton(getFile()); } } } else if (component.equals(new ComponentName(FileDisplayActivity.this, FileUploader.class))) { Log_OC.d(TAG, "Upload service connected"); mUploaderBinder = (FileUploaderBinder) service; } else { return; } OCFileListFragment listOfFiles = getListOfFilesFragment(); if (listOfFiles != null) { listOfFiles.listDirectory(false); } FileFragment secondFragment = getSecondFragment(); if (secondFragment != null) { secondFragment.onTransferServiceConnected(); } }

Target:
public void onServiceConnected(ComponentName component, IBinder service) { if (component.equals(new ComponentName( FileDisplayActivity.this, FileDownloader.class))) { Log_OC.d(TAG, "Download service connected"); mDownloaderBinder = (FileDownloaderBinder) service; if (mFileWaitingToPreview != null) if (getStorageManager() != null) { mFileWaitingToPreview = getStorageManager().getFileById(mFileWaitingToPreview.getFileId()); if (!mFileWaitingToPreview.isDown()) { requestForDownload(); } } if (getFile() != null && mDownloaderBinder.isDownloading(getAccount(), getFile())) { FileFragment secondFragment = getSecondFragment(); if (secondFragment != null && secondFragment instanceof PreviewVideoFragment) { cleanSecondFragment(); showDetails(getFile()); } } } else if (component.equals(new ComponentName(FileDisplayActivity.this, FileUploader.class))) { Log_OC.d(TAG, "Upload service connected"); mUploaderBinder = (FileUploaderBinder) service; } else { return; } OCFileListFragment listOfFiles = getListOfFilesFragment(); if (listOfFiles != null) { listOfFiles.listDirectory(false); } FileFragment secondFragment = getSecondFragment(); if (secondFragment != null) { secondFragment.onTransferServiceConnected(); } }
Source:
public NetworkSecurityRuleImpl withAnyProtocol() { return this.withProtocol(SecurityRuleProtocol.fromString("*")); }

Target:
public NetworkSecurityRuleImpl withAnyProtocol() { return this.withProtocol(SecurityRuleProtocol.STAR); }
Source:
private Properties collapse(final Properties properties, final String envName) { Properties collapsed = new Properties(); for (final String key : properties.stringPropertyNames()) { if (isDefaultProperty(key)) { String value = properties.getProperty(key); LOG.debug("Set Key=" + key + " with value=" + value); collapsed.setProperty(key, value); } } for (final String key : properties.stringPropertyNames()) { if (key.startsWith(envName + ".")) { String value = properties.getProperty(key); String strippedName = key.substring(envName.length() + 1); LOG.debug("Overwrite Key=" + key + " with value=" + value); collapsed.setProperty(strippedName, value); } } for (final String key : properties.stringPropertyNames()) { String value = sysReader.read(key); if (value == null) { value = envReader.read(key); } if (value != null) { if (key.startsWith(envName + ".")) { String strippedName = key.substring(envName.length() + 1); LOG.debug("Overwrite with Env Key=" + strippedName + " with value=" + value); collapsed.setProperty(strippedName, value); } else { LOG.debug("Overwrite with Env Key=" + key + " with value=" + value); collapsed.setProperty(key, value); } } } return collapsed; }

Target:
private Properties collapse(final Properties properties, final String envName) { Properties collapsed = new Properties(); for (final String key : properties.stringPropertyNames()) { if (isDefaultProperty(key)) { collapsed.setProperty(key, properties.getProperty(key)); } } for (final String key : properties.stringPropertyNames()) { if (key.startsWith(envName + ".")) { String strippedName = key.substring(envName.length() + 1); collapsed.setProperty(strippedName, properties.getProperty(key)); } } for (final String key : properties.stringPropertyNames()) { String value = sysReader.read(key); if (value == null) { value = envReader.read(key); } if (value != null) { if (key.startsWith(envName + ".")) { String strippedName = key.substring(envName.length() + 1); collapsed.setProperty(strippedName, value); } else { collapsed.setProperty(key, value); } } } return collapsed; }
Source:
public CoreEvent process(final CoreEvent event) throws MuleException { if (nestedChain == null) { return event; } final boolean alreadyActiveTx = isTransactionActive(); ExecutionTemplate<CoreEvent> executionTemplate = createScopeTransactionalExecutionTemplate(muleContext, transactionConfig); ExecutionCallback<CoreEvent> processingCallback = () -> { if (!alreadyActiveTx && isTransactionActive()) { TransactionAdapter transaction = (TransactionAdapter) TransactionCoordination.getInstance().getTransaction(); transaction.setComponentLocation(getLocation()); return processWithChildContextBlocking(event, nestedChain, ofNullable(getLocation()), messagingExceptionHandler); } else { return processWithChildContextBlocking(event, nestedChain, ofNullable(getLocation()), messagingExceptionHandler); } }; try { return executionTemplate.execute(processingCallback); } catch (MuleException e) { throw e; } catch (Exception e) { throw new DefaultMuleException(errorInvokingMessageProcessorWithinTransaction(nestedChain, transactionConfig), e); } }

Target:
public CoreEvent process(final CoreEvent event) throws MuleException { if (nestedChain == null) { return event; } final boolean txPrevoiuslyActive = isTransactionActive(); ExecutionTemplate<CoreEvent> executionTemplate = createScopeTransactionalExecutionTemplate(muleContext, transactionConfig); ExecutionCallback<CoreEvent> processingCallback = () -> { if (!txPrevoiuslyActive && isTransactionActive()) { TransactionAdapter transaction = (TransactionAdapter) TransactionCoordination.getInstance().getTransaction(); transaction.setComponentLocation(getLocation()); return processWithChildContextBlocking(event, nestedChain, ofNullable(getLocation()), messagingExceptionHandler); } else { return processWithChildContextBlocking(event, nestedChain, ofNullable(getLocation()), messagingExceptionHandler); } }; try { return executionTemplate.execute(processingCallback); } catch (MuleException e) { throw e; } catch (Exception e) { throw new DefaultMuleException(errorInvokingMessageProcessorWithinTransaction(nestedChain, transactionConfig), e); } }
Source:
public int compareTo(TextTrackScore other) { if (this.isWithinRendererCapabilities != other.isWithinRendererCapabilities) { return this.isWithinRendererCapabilities ? 1 : -1; } if (this.preferredLanguageScore != other.preferredLanguageScore) { return compareInts(this.preferredLanguageScore, other.preferredLanguageScore); } if (this.preferredRoleFlagsScore != other.preferredRoleFlagsScore) { return compareInts(this.preferredRoleFlagsScore, other.preferredRoleFlagsScore); } if (this.isDefault != other.isDefault) { return this.isDefault ? 1 : -1; } if (this.hasPreferredIsForcedFlag != other.hasPreferredIsForcedFlag) { return this.hasPreferredIsForcedFlag ? 1 : -1; } return compareInts(this.selectedAudioLanguageScore, other.selectedAudioLanguageScore); }

Target:
public int compareTo(TextTrackScore other) { if (this.isWithinRendererCapabilities != other.isWithinRendererCapabilities) { return this.isWithinRendererCapabilities ? 1 : -1; } if (this.preferredLanguageScore != other.preferredLanguageScore) { return compareInts(this.preferredLanguageScore, other.preferredLanguageScore); } if (this.isDefault != other.isDefault) { return this.isDefault ? 1 : -1; } if (this.hasPreferredIsForcedFlag != other.hasPreferredIsForcedFlag) { return this.hasPreferredIsForcedFlag ? 1 : -1; } if (this.selectedAudioLanguageScore != other.selectedAudioLanguageScore) { return compareInts(this.selectedAudioLanguageScore, other.selectedAudioLanguageScore); } if (!this.hasPreferredRoleFlags) { return compareInts(other.hasCaptionRoleFlags, this.hasCaptionRoleFlags); } return compareInts(this.preferredRoleFlagsScore, other.preferredRoleFlagsScore); }
Source:
public void attach(Attachable attachable) { if (attachable instanceof OpenCV) { opencv = (OpenCV) attachable; subscribe(opencv.getName(), "publishClassification"); } else if (attachable instanceof SpeechRecognizer) { if (attachable.getClass().getSimpleName().equals("WebkitSpeechRecognition")) { WebGui webgui = (WebGui) Runtime.create("webgui", "WebGui"); webgui.autoStartBrowser(false); webgui.startService(); webgui.startBrowser("http://localhost:8888/#/service/" + attachable.getName()); } ear = (SpeechRecognizer) attachable; } else if (attachable instanceof ProgramAB) { if (htmlFilter == null) { htmlFilter = (HtmlFilter) Runtime.start(this.getIntanceName() + ".htmlFilter", "HtmlFilter"); } chatBot = (ProgramAB) attachable; } if (chatBot != null && ear != null) { chatBot.attach((Attachable) ear); } if (chatBot != null && mouth != null) { chatBot.addTextListener(htmlFilter); htmlFilter.addListener("publishText", this.getName(), "speak"); } if (mouth != null && ear != null) { ear.addMouth(mouth); } broadcastState(); }

Target:
public void attach(Attachable attachable) { if (attachable instanceof OpenCV) { opencv = (OpenCV) attachable; subscribe(opencv.getName(), "publishClassification"); } else if (attachable instanceof SpeechSynthesis) { mouth = (SpeechSynthesis) attachable; if (ear != null) { ear.addMouth(mouth); } } else if (attachable instanceof SpeechRecognizer) { ear = (SpeechRecognizer) attachable; if (mouth != null) { ear.addMouth(mouth); } } else if (attachable instanceof ProgramAB) { chatBot = (ProgramAB) attachable; } }
Source:
public boolean downloadTemplate() { s_logger.debug("Retrieving metalink file from: " + getUrl() + " to file: " + getDownloadedFilePath()); List<String> metalinkUrls = UriUtils.getMetalinkUrls(getUrl()); if (CollectionUtils.isNotEmpty(metalinkUrls)) { String downloadDir = getDirectDownloadTempPath(getTemplateId()); boolean downloaded = false; int i = 0; while (!downloaded && i < metalinkUrls.size()) { try { setUrl(metalinkUrls.get(i)); s_logger.debug("Trying to download template from metalink url: " + getUrl()); File f = new File(getDestPoolPath() + File.separator + downloadDir + File.separator + getFileNameFromUrl()); if (f.exists()) { f.delete(); f.createNewFile(); } setDownloadedFilePath(f.getAbsolutePath()); request = createRequest(getUrl(), reqHeaders); downloaded = super.downloadTemplate(); if (downloaded) { s_logger.debug("Successfully downloaded template from metalink url: " + getUrl()); break; } } catch (Exception e) { s_logger.error("Error downloading template: " + getTemplateId() + " from " + getUrl() + ": " + e.getMessage()); } i++; } return downloaded; } return true; }

Target:
public boolean downloadTemplate() { if (StringUtils.isBlank(getUrl())) { throw new CloudRuntimeException("Download url has not been set, aborting"); } String downloadDir = getDirectDownloadTempPath(getTemplateId()); boolean downloaded = false; int i = 0; do { if (!isRedownload()) { setUrl(metalinkUrls.get(i)); } s_logger.info("Trying to download template from url: " + getUrl()); try { File f = new File(getDestPoolPath() + File.separator + downloadDir + File.separator + getFileNameFromUrl()); if (f.exists()) { f.delete(); f.createNewFile(); } setDownloadedFilePath(f.getAbsolutePath()); request = createRequest(getUrl(), reqHeaders); downloaded = super.downloadTemplate(); if (downloaded) { s_logger.info("Successfully downloaded template from url: " + getUrl()); } } catch (Exception e) { s_logger.error("Error downloading template: " + getTemplateId() + " from " + getUrl() + ": " + e.getMessage()); } i++; } while (!downloaded && !isRedownload() && i < metalinkUrls.size()); return downloaded; }
Source:
protected void execute() { logger.debug("execute() method is called!"); if (this.devicesMap.isEmpty()) { return; } List<MystromDevice> devices = this.mystromClient.getDevicesState(); for (MyStromEcoPowerBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { logger.debug("Mystrom eco power switch '{}' state will be updated", itemName); String friendlyName = provider.getMystromFriendlyName(itemName); String id = this.devicesMap.get(friendlyName); if (id != null) { MystromDevice device = null; for (MystromDevice searchDevice : devices) { if (searchDevice.id.equals(id)) { device = searchDevice; break; } } if (device != null) { if (provider.getIsSwitch(itemName)) { State state = device.state.equals("on") ? OnOffType.ON : OnOffType.OFF; eventPublisher.postUpdate(itemName, state); } if (provider.getIsStringItem(itemName)) { eventPublisher.postUpdate(itemName, new StringType(device.state)); } if (provider.getIsNumberItem(itemName)) { eventPublisher.postUpdate(itemName, new DecimalType(device.power)); } } } else { logger.warn("The device itemName '{}' not found on discovery verify device is not offline", itemName); } } } }

Target:
protected void execute() { logger.debug("execute() method is called!"); if (this.devicesMap.isEmpty()) { return; } List<MystromDevice> devices = this.mystromClient.getDevicesState(); for (MyStromEcoPowerBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { logger.debug("Mystrom eco power switch '{}' state will be updated", itemName); String friendlyName = provider.getMystromFriendlyName(itemName); String id = this.devicesMap.get(friendlyName); if (id != null) { MystromDevice device = null; for (MystromDevice searchDevice : devices) { if (searchDevice.id.equals(id)) { device = searchDevice; break; } } if (device != null) { if (provider.getIsSwitch(itemName)) { State state = device.state.equals("on") ? OnOffType.ON : OnOffType.OFF; eventPublisher.postUpdate(itemName, state); } if (provider.getIsStringItem(itemName)) { eventPublisher.postUpdate(itemName, new StringType(device.state)); } if (provider.getIsNumberItem(itemName)) { eventPublisher.postUpdate(itemName, new DecimalType(device.power)); } } } else { logger.warn("The device itemName '{}' not found on discovery. Verify device is not offline", itemName); } } } }
Source:
public boolean contains(OGCGeometry another) { if (another.geometryType() == OGCConcreteGeometryCollection.TYPE) { return another.contains(this); } com.esri.core.geometry.Geometry geom1 = getEsriGeometry(); com.esri.core.geometry.Geometry geom2 = another.getEsriGeometry(); return com.esri.core.geometry.GeometryEngine.contains(geom1, geom2, getEsriSpatialReference()); }

Target:
public boolean contains(OGCGeometry another) { if (another.geometryType() == OGCConcreteGeometryCollection.TYPE) { return new OGCConcreteGeometryCollection(this, esriSR).contains(another); } com.esri.core.geometry.Geometry geom1 = getEsriGeometry(); com.esri.core.geometry.Geometry geom2 = another.getEsriGeometry(); return com.esri.core.geometry.GeometryEngine.contains(geom1, geom2, getEsriSpatialReference()); }
Source:
protected void delete(Context context, Integer id) { XmlWorkflowItem witem = null; try { witem = wis.find(context, id); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } try { wfs.abort(context, witem, context.getCurrentUser()); context.addEvent(new Event(Event.MODIFY, Constants.ITEM, witem.getItem().getID(), null, itemService.getIdentifiers(context, witem.getItem()))); } catch (SQLException | AuthorizeException | IOException e) { log.error(e.getMessage(), e); } }

Target:
protected void delete(Context context, Integer id) { XmlWorkflowItem witem = null; try { witem = wis.find(context, id); if (witem == null) { throw new ResourceNotFoundException("WorkflowItem ID " + id + " not found"); } wfs.abort(context, witem, context.getCurrentUser()); } catch (AuthorizeException e) { throw new RESTAuthorizationException(e); } catch (SQLException | IOException e) { throw new RuntimeException(e.getMessage(), e); } }
Source:
public void shouldMakeAbsoluteUriOnRealPlatform() throws Exception { File testDir = new File( BASE_DIR, "target/@2 test with white spaces" ); testDir.mkdir(); URI testDirUri = new URI( JarManifestForkConfiguration.toAbsoluteUri( testDir.getCanonicalPath() ) ); assertThat( testDirUri.getScheme() ) .isEqualTo( "file" ); assertThat( testDirUri.getRawPath() ) .isEqualTo( testDir.toURI().getRawPath() ); }

Target:
public void shouldMakeAbsoluteUriOnRealPlatform() throws Exception { Path testDir = new File( TMP, "@2 test with white spaces" ) .toPath(); URI testDirUri = new URI( toAbsoluteUri( testDir ) ); assertThat( testDirUri.getScheme() ) .isEqualTo( "file" ); assertThat( testDirUri.getRawPath() ) .isEqualTo( testDir.toUri().getRawPath() ); }
Source:
public String getStringData() { try { return IOUtils.toString(this.stream); } catch (final IOException exception) { throw new RuntimeException("Unable to read input", exception); } }

Target:
public String getStringData() { try { return IOUtils.toString(this.stream); } catch (final IOException exception) { throw new IllegalArgumentException( "Unable to read input", exception ); } }
Source:
public EventExecutor next() { if (isPowerOfTwo(children.length)) { return children[idx.getAndIncrement() & children.length - 1]; } return children[Math.abs(idx.getAndIncrement() % children.length)]; }

Target:
public EventExecutor next() { if (powerOfTwo) { return children[idx.getAndIncrement() & children.length - 1]; } return children[Math.abs(idx.getAndIncrement() % children.length)]; }
Source:
private static boolean isAnalyticsEnabled() { Settings settings = SoapUI.getSettings(); boolean analyticsEnabled = settings.getBoolean(UISettings.DISABLE_ANALYTICS, false); if (analyticsEnabled) { return true; } Version optOutVersion = new Version(settings.getString(UISettings.ANALYTICS_OPT_OUT_VERSION, "0.0")); Version currentSoapUIVersion = new Version(SoapUI.SOAPUI_VERSION); if (!optOutVersion.getMajorVersion().equals(currentSoapUIVersion.getMajorVersion()) && SoapUI.usingGraphicalEnvironment()) { analyticsEnabled = StatisticsCollectionConfirmationDialog.showDialog() == JOptionPane.YES_OPTION; settings.setBoolean(UISettings.DISABLE_ANALYTICS, !analyticsEnabled); } if (!analyticsEnabled) { settings.setString(UISettings.ANALYTICS_OPT_OUT_VERSION, currentSoapUIVersion.getMajorVersion()); } return analyticsEnabled; }

Target:
private static boolean isAnalyticsEnabled() { Settings settings = SoapUI.getSettings(); boolean analyticsEnabled = settings.getBoolean(UISettings.DISABLE_ANALYTICS, false); if (analyticsEnabled) { return true; } Version optOutVersion = new Version(settings.getString(UISettings.ANALYTICS_OPT_OUT_VERSION, "0.0")); Version currentSoapUIVersion = new Version(SoapUI.SOAPUI_VERSION); if (!optOutVersion.getMajorVersion().equals(currentSoapUIVersion.getMajorVersion()) && SoapUI.usingGraphicalEnvironment()) { analyticsEnabled = StatisticsCollectionConfirmationDialog.showDialog() == JOptionPane.YES_OPTION; settings.setBoolean(UISettings.DISABLE_ANALYTICS, !analyticsEnabled); if (!analyticsEnabled) { settings.setString(UISettings.ANALYTICS_OPT_OUT_VERSION, currentSoapUIVersion.getMajorVersion()); } } return analyticsEnabled; }
Source:
public void realm_closeInDoOnUnsubscribe() { Flowable<Realm> observable = realm.asFlowable() .doOnCancel(new Action() { @Override public void run() throws Exception { realm.close(); } }); subscription = observable.subscribe(new Consumer<Realm>() { @Override public void accept(Realm ignored) throws Exception { assertEquals(2, Realm.getLocalInstanceCount(ignored.getConfiguration())); } }); subscription.dispose(); assertTrue(realm.isClosed()); }

Target:
public void realm_closeInDoOnUnsubscribe() { Flowable<Realm> observable = realm.asFlowable() .doOnCancel(new Action() { @Override public void run() throws Exception { realm.close(); } }); subscription = observable.subscribe(new Consumer<Realm>() { @Override public void accept(Realm realm) throws Exception { assertEquals(2, Realm.getLocalInstanceCount(realm.getConfiguration())); } }); subscription.dispose(); assertTrue(realm.isClosed()); }
Source:
public Gateway3DSAuthorisationResponse authorise3dsResponse(Auth3dsResponseGatewayRequest request) { Either<GatewayError, GatewayClient.Response> response = client.postRequestFor(null, request.getGatewayAccount(), build3dsResponseAuthOrderFor(request)); GatewayResponse<BaseAuthoriseResponse> gatewayResponse = GatewayResponseGenerator.getSmartpayGatewayResponse(client, response, SmartpayAuthorisationResponse.class); if (gatewayResponse.getBaseResponse().isPresent()) { return new Gateway3DSAuthorisationResponse(gatewayResponse.getBaseResponse().get().authoriseStatus(), gatewayResponse.getBaseResponse().get().getTransactionId()); } return new Gateway3DSAuthorisationResponse(BaseAuthoriseResponse.AuthoriseStatus.EXCEPTION, null); }

Target:
public Gateway3DSAuthorisationResponse authorise3dsResponse(Auth3dsResponseGatewayRequest request) { Either<GatewayError, GatewayClient.Response> response = client.postRequestFor(null, request.getGatewayAccount(), build3dsResponseAuthOrderFor(request)); GatewayResponse<BaseAuthoriseResponse> gatewayResponse = GatewayResponseGenerator.getSmartpayGatewayResponse(client, response, SmartpayAuthorisationResponse.class); return gatewayResponse.getBaseResponse().map( baseResponse -> Gateway3DSAuthorisationResponse.of(baseResponse.authoriseStatus(), baseResponse.getTransactionId())) .orElseGet(Gateway3DSAuthorisationResponse::ofException); }
Source:
Type getPropertyType(String propertyName) throws MappingException; int[] findDirty(Object[] currentState, Object[] previousState, Object owner, SharedSessionContractImplementor session); int[] findModified(Object[] old, Object[] current, Object object, SharedSessionContractImplementor session); boolean hasIdentifierProperty(); boolean canExtractIdOutOfEntity(); boolean isVersioned(); VersionType getVersionType(); int getVersionProperty(); boolean hasNaturalIdentifier(); int[] getNaturalIdentifierProperties(); Object[] getNaturalIdentifierSnapshot(Serializable id, SharedSessionContractImplementor session); IdentifierGenerator getIdentifierGenerator(); boolean hasLazyProperties(); Serializable loadEntityIdByNaturalId( Object[] naturalIdValues, LockOptions lockOptions, SharedSessionContractImplementor session); Object load(Serializable id, Object optionalObject, LockMode lockMode, SharedSessionContractImplementor session, Boolean readOnly) throws HibernateException; default Object load(Serializable id, Object optionalObject, LockMode lockMode, SharedSessionContractImplementor session) { return load( id, optionalObject, lockMode, session, null ); }

Target:
Type getPropertyType(String propertyName) throws MappingException; int[] findDirty(Object[] currentState, Object[] previousState, Object owner, SharedSessionContractImplementor session); int[] findModified(Object[] old, Object[] current, Object object, SharedSessionContractImplementor session); boolean hasIdentifierProperty(); boolean canExtractIdOutOfEntity(); boolean isVersioned(); VersionType getVersionType(); int getVersionProperty(); boolean hasNaturalIdentifier(); int[] getNaturalIdentifierProperties(); Object[] getNaturalIdentifierSnapshot(Serializable id, SharedSessionContractImplementor session); IdentifierGenerator getIdentifierGenerator(); boolean hasLazyProperties(); Serializable loadEntityIdByNaturalId( Object[] naturalIdValues, LockOptions lockOptions, SharedSessionContractImplementor session); Object load(Serializable id, Object optionalObject, LockMode lockMode, SharedSessionContractImplementor session) throws HibernateException; default Object load(Serializable id, Object optionalObject, LockMode lockMode, SharedSessionContractImplementor session, Boolean readOnly) throws HibernateException { return load( id, optionalObject, lockMode, session ); }