auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { if (transformProvider == null) { throw new ConversionException( "Unable to locate Converter for outputSchema: " + CswConstants.CSW_OUTPUT_SCHEMA); } CswRecordCollection cswRecords = new CswRecordCollection(); List<Metacard> metacards = cswRecords.getCswRecords(); XStreamAttributeCopier.copyXmlNamespaceDeclarationsIntoContext(reader, context); while (reader.hasMoreChildren()) { reader.moveDown(); if (reader.getNodeName().contains("SearchResults")) { setSearchResults(reader, cswRecords); while (reader.hasMoreChildren()) { reader.moveDown(); String name = reader.getNodeName(); LOGGER.debug("node name = {}", name); try { Metacard metacard = (Metacard) context.convertAnother(null, MetacardImpl.class, transformProvider); metacards.add(metacard); } catch (ConversionException e) { LOGGER.warn( "Failed to convert result to a metacard. Ignoring this resource because: " + e); cswRecords.setNumberOfRecordsMatched(cswRecords.getNumberOfRecordsMatched() - 1); } reader.moveUp(); } } reader.moveUp(); } LOGGER.debug("Unmarshalled metacards", metacards.size()); if (LOGGER.isTraceEnabled()) { int index = 1; for (Metacard m : metacards) { LOGGER.trace("metacard {}: ", index); LOGGER.trace(" id = {}", m.getId()); LOGGER.trace(" title = {}", m.getTitle()); Attribute boundingBoxAttr = m.getAttribute("BoundingBox"); if (boundingBoxAttr != null) { LOGGER.trace(" bounding box = {}", boundingBoxAttr.getValue()); } index++; } } return cswRecords; }

Target:
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { if (transformProvider == null) { throw new ConversionException( "Unable to locate Converter for outputSchema: " + CswConstants.CSW_OUTPUT_SCHEMA); } CswRecordCollection cswRecords = new CswRecordCollection(); List<Metacard> metacards = cswRecords.getCswRecords(); XStreamAttributeCopier.copyXmlNamespaceDeclarationsIntoContext(reader, context); while (reader.hasMoreChildren()) { reader.moveDown(); if (reader.getNodeName().contains("SearchResults")) { setSearchResults(reader, cswRecords); while (reader.hasMoreChildren()) { reader.moveDown(); String name = reader.getNodeName(); LOGGER.debug("node name = {}", name); try { Metacard metacard = (Metacard) context.convertAnother(null, MetacardImpl.class, transformProvider); metacards.add(metacard); } catch (ConversionException e) { LOGGER.warn( "Failed to convert result to a metacard. Ignoring this resource. Set the log level to DEBUG for more information."); LOGGER.debug("Failed to convert result to a metacard.", e); cswRecords.setNumberOfRecordsMatched(cswRecords.getNumberOfRecordsMatched() - 1); } reader.moveUp(); } } reader.moveUp(); } LOGGER.debug("Unmarshalled metacards", metacards.size()); if (LOGGER.isTraceEnabled()) { int index = 1; for (Metacard m : metacards) { LOGGER.trace("metacard {}: ", index); LOGGER.trace(" id = {}", m.getId()); LOGGER.trace(" title = {}", m.getTitle()); Attribute boundingBoxAttr = m.getAttribute("BoundingBox"); if (boundingBoxAttr != null) { LOGGER.trace(" bounding box = {}", boundingBoxAttr.getValue()); } index++; } } return cswRecords; }
Source:
protected void processOptions(Map<String, String> options) { isFullReport = true; performGeoRollup = true; maxSteps = FULL_STEPS; generateCharts = true; if (options != null) { if (log.isDebugEnabled()) { log.debug(options); } locale = options.get(LOCALE_OPT); imagePrefix = options.get(IMAGE_PREFIX_OPT); if (RAW_ONLY_TYPE.equalsIgnoreCase(options.get(TYPE_OPT))) { isFullReport = false; maxSteps = RAW_STEPS; } if (options.get(DO_ROLLUP_OPT) != null) { if ("false".equalsIgnoreCase(options.get(DO_ROLLUP_OPT))) { performGeoRollup = false; } } if (options.get(NO_CHART_OPT) != null) { if ("true".equalsIgnoreCase(options.get(NO_CHART_OPT))) { generateCharts = false; } } if (options.get(LAST_COLLECTION_OPT) != null && "true".equals(options.get(LAST_COLLECTION_OPT))) { lastCollection = true; } } if (locale != null) { locale = locale.trim().toLowerCase(); if (DEFAULT.equalsIgnoreCase(locale)) { locale = DEFAULT_LOCALE; } } else { locale = DEFAULT_LOCALE; } if (imagePrefix != null) { imagePrefix = imagePrefix.trim(); if (!imagePrefix.endsWith("/")) { imagePrefix = imagePrefix + "/"; } } else { imagePrefix = DEFAULT_IMAGE_PREFIX; } }

Target:
protected void processOptions(Map<String, String> options) { isFullReport = true; performGeoRollup = true; maxSteps = FULL_STEPS; generateCharts = true; if (options != null) { log.debug(options); locale = options.get(LOCALE_OPT); imagePrefix = options.get(IMAGE_PREFIX_OPT); if (RAW_ONLY_TYPE.equalsIgnoreCase(options.get(TYPE_OPT))) { isFullReport = false; maxSteps = RAW_STEPS; } if (options.get(DO_ROLLUP_OPT) != null) { if ("false".equalsIgnoreCase(options.get(DO_ROLLUP_OPT))) { performGeoRollup = false; } } if (options.get(NO_CHART_OPT) != null) { if ("true".equalsIgnoreCase(options.get(NO_CHART_OPT))) { generateCharts = false; } } if (options.get(LAST_COLLECTION_OPT) != null && "true".equals(options.get(LAST_COLLECTION_OPT))) { lastCollection = true; } } if (locale != null) { locale = locale.trim().toLowerCase(); if (DEFAULT.equalsIgnoreCase(locale)) { locale = DEFAULT_LOCALE; } } else { locale = DEFAULT_LOCALE; } if (imagePrefix != null) { imagePrefix = imagePrefix.trim(); if (!imagePrefix.endsWith("/")) { imagePrefix = imagePrefix + "/"; } } else { imagePrefix = DEFAULT_IMAGE_PREFIX; } }
Source:
generatesFiles(JavaFileObject first, JavaFileObject... rest) { CompilationResult result = compile(getSubject()); if (result.successful()) { List<JavaFileObject> expectedList = Lists.newArrayList(Lists.asList(first, rest)); Iterator<JavaFileObject> expectedIterator = expectedList.iterator(); while (expectedIterator.hasNext()) { if (wasGenerated(result, expectedIterator.next())) { expectedIterator.remove(); } } if (!expectedList.isEmpty()) { failureStrategy.fail("Failed to find some files: " + expectedList); } } else { System.out.println(result.diagnosticsByKind); failureStrategy.fail("Failed with some errors: " + result.output); } return result.diagnosticsByKind; }

Target:
generatesFiles(JavaFileObject first, JavaFileObject... rest) { CompilationResult result = compile(getSubject()); if (result.successful()) { List<JavaFileObject> expectedList = Lists.newArrayList(Lists.asList(first, rest)); Iterator<JavaFileObject> expectedIterator = expectedList.iterator(); while (expectedIterator.hasNext()) { if (wasGenerated(result, expectedIterator.next())) { expectedIterator.remove(); } } if (!expectedList.isEmpty()) { failureStrategy.fail("Failed to find some files: " + expectedList); } } else { failureStrategy.fail("Failed with some errors: " + result.output); } return result.diagnosticsByKind; }
Source:
public static TestingMySqlServer setupMySql() throws Exception { TestingMySqlServer mySqlServer = new TestingMySqlServer("testuser", "testpass", ImmutableList.of(XDB), MY_SQL_OPTIONS); try (Handle handle = getJdbi(mySqlServer).open()) { handle.execute("CREATE TABLE benchmark_suites (\n" + " id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n" + " suite varchar(256) NOT NULL,\n" + " query_set varchar(256) NOT NULL,\n" + " phases mediumtext NOT NULL,\n" + " session_properties mediumtext NOT NULL,\n" + " created_by varchar(256) NOT NULL,\n" + " create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n" + " update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n" + " PRIMARY KEY (id),\n" + " UNIQUE KEY suite (suite))"); handle.execute("CREATE TABLE benchmark_queries (\n" + " id bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n" + " query_set varchar(256) NOT NULL,\n" + " name varchar(256) NOT NULL,\n" + " catalog varchar(256) NOT NULL,\n" + " benchmark_schema varchar(256) NOT NULL,\n" + " query mediumtext NOT NULL,\n" + " create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n" + " update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n" + " PRIMARY KEY (id),\n" + " UNIQUE KEY query_set_name (query_set,name))"); } return mySqlServer; }

Target:
public static TestingMySqlServer setupMySql() throws Exception { TestingMySqlServer mySqlServer = new TestingMySqlServer("testuser", "testpass", ImmutableList.of(XDB)); Handle handle = getJdbi(mySqlServer).open(); BenchmarkSuiteDao benchmarkDao = handle.attach(BenchmarkSuiteDao.class); benchmarkDao.createBenchmarkSuitesTable("benchmark_suites"); benchmarkDao.createBenchmarkQueriesTable("benchmark_queries"); return mySqlServer; }
Source:
public ReplicationPolicy getSystemReplicationPolicy() { DatabaseAccount databaseAccount = this.globalEndpointManager.getDatabaseAccountFromCache(this.serviceEndpoint).block(); return BridgeInternal.getSystemReplicationPolicy(databaseAccount); }

Target:
public Mono<ReplicationPolicy> getSystemReplicationPolicy() { return this.globalEndpointManager.getDatabaseAccountFromCache(this.serviceEndpoint).map(databaseAccount -> BridgeInternal.getSystemReplicationPolicy(databaseAccount)); }
Source:
private BundleHandoverResponse handleDeployment(BundleHandoverRequest request) { HandoverContentUploader contentUploader = new HandoverContentUploader(request, getASConnection()); boolean uploaded = contentUploader.upload(); if (!uploaded) { return contentUploader.getFailureResponse(); } Operation addDeploymentStep = new Operation("add", "deployment", contentUploader.getRuntimeName()); List<Object> addDeploymentContentProperty = new ArrayList<Object>(1); Map<String, Object> contentValues = new HashMap<String, Object>(); contentValues.put("hash", new PROPERTY_VALUE("BYTES_VALUE", contentUploader.getHash())); addDeploymentContentProperty.add(contentValues); addDeploymentStep.addAdditionalProperty("content", addDeploymentContentProperty); addDeploymentStep.addAdditionalProperty("name", contentUploader.getFilename()); addDeploymentStep.addAdditionalProperty("runtime-name", contentUploader.getRuntimeName()); Operation deployStep = new Operation("deploy", addDeploymentStep.getAddress()); CompositeOperation compositeOperation = new CompositeOperation(); compositeOperation.addStep(addDeploymentStep); compositeOperation.addStep(deployStep); Result result = getASConnection().execute(compositeOperation, 300); if (!result.isSuccess()) { return BundleHandoverResponse.failure(EXECUTION, result.getFailureDescription()); } else { return BundleHandoverResponse.success(); } }

Target:
private BundleHandoverResponse handleDeployment(BundleHandoverRequest request) { HandoverContentUploader contentUploader = new HandoverContentUploader(request, getASConnection()); boolean uploaded = contentUploader.upload(); if (!uploaded) { return contentUploader.getFailureResponse(); } String filename = contentUploader.getFilename(); String runtimeName = contentUploader.getRuntimeName(); String hash = contentUploader.getHash(); Redeployer redeployer = new Redeployer(runtimeName, hash, getASConnection()); if (redeployer.deploymentExists()) { Result result = redeployer.redeployOnServer(); if (result.isRolledBack()) { return BundleHandoverResponse.failure(EXECUTION, result.getFailureDescription()); } return BundleHandoverResponse.success(); } Operation addDeploymentStep = new Operation("add", "deployment", runtimeName); List<Object> addDeploymentContentProperty = new ArrayList<Object>(1); Map<String, Object> contentValues = new HashMap<String, Object>(); contentValues.put("hash", new PROPERTY_VALUE("BYTES_VALUE", hash)); addDeploymentContentProperty.add(contentValues); addDeploymentStep.addAdditionalProperty("content", addDeploymentContentProperty); addDeploymentStep.addAdditionalProperty("name", filename); addDeploymentStep.addAdditionalProperty("runtime-name", runtimeName); Operation deployStep = new Operation("deploy", addDeploymentStep.getAddress()); CompositeOperation compositeOperation = new CompositeOperation(); compositeOperation.addStep(addDeploymentStep); compositeOperation.addStep(deployStep); Result result = getASConnection().execute(compositeOperation, 300); if (!result.isSuccess()) { return BundleHandoverResponse.failure(EXECUTION, result.getFailureDescription()); } else { return BundleHandoverResponse.success(); } }
Source:
private Cursor makeEmojiCursor(CharSequence emoji) throws SQLException { if (emoji == null) { emoji = ""; } return ((AndroidDatabaseResults) app .getDao(Emoji.class) .queryRaw("SELECT rowid _id,* FROM emoji WHERE name LIKE '%" + emoji + "%'") .closeableIterator().getRawResults()).getRawCursor(); }

Target:
private Cursor makeEmojiCursor(CharSequence emoji) throws SQLException { if (emoji == null) { emoji = ""; } return ((AndroidDatabaseResults) app .getDao(Emoji.class) .queryRaw("SELECT rowid _id,name FROM emoji WHERE name LIKE '%" + emoji + "%'") .closeableIterator().getRawResults()).getRawCursor(); }
Source:
public void deactivate(ComponentContext context) { super.deactivate(context); subscribers.clear(); provider.close(); provider = null; }

Target:
public void deactivate(ComponentContext context) { subscribers.clear(); provider.close(); provider = null; super.deactivate(context); }
Source:
private void removeFromCache(String path) { if (isSubscription(path)) { subscriptionConstraintsCache.remove(SubscriptionName.fromString(paths.extractChildNode(path, "/hermes/consumers-workload-constraints"))); } else { topicConstraintsCache.remove(TopicName.fromQualifiedName(paths.extractChildNode(path, "/hermes/consumers-workload-constraints"))); } }

Target:
private void removeFromCache(String path) { if (isSubscription(path)) { subscriptionConstraintsCache.remove( SubscriptionName.fromString(paths.extractChildNode(path, paths.consumersWorkloadConstraintsPath()))); } else { topicConstraintsCache.remove( TopicName.fromQualifiedName(paths.extractChildNode(path, paths.consumersWorkloadConstraintsPath()))); } }
Source:
public String toString() { return "DataSchema{" + "dataSource='" + dataSource + '\'' + ", aggregators=" + Arrays.toString(aggregators) + ", granularitySpec=" + granularitySpec + ", transformSpec=" + transformSpec + (parserMap == null ? "" : ", parserMap=" + parserMap) + ", timestampSpec=" + timestampSpec + ", dimensionsSpec=" + dimensionsSpec + '}'; }

Target:
public String toString() { return "DataSchema{" + "dataSource='" + dataSource + '\'' + ", aggregators=" + Arrays.toString(aggregators) + ", granularitySpec=" + granularitySpec + ", transformSpec=" + transformSpec + ", parserMap=" + parserMap + ", timestampSpec=" + timestampSpec + ", dimensionsSpec=" + dimensionsSpec + ", inputRowParser=" + inputRowParser + '}'; }
Source:
public Pair<ExecutionStatus, T> execute(Supplier<T> callable) { Callable<T> task = callable::get; final long startTime = System.currentTimeMillis(); Future<T> futureObject = executor.submit(() -> { xrayUtils.beginSegment(); long totalWaitTime = System.currentTimeMillis() - startTime; logger.debug("Card operation task spent ms in queue", totalWaitTime); if (totalWaitTime > QUEUE_WAIT_WARN_THRESHOLD_MILLIS) { logger.warn("CardExecutor Service delay - queue_wait_time={}", totalWaitTime); } metricRegistry.histogram("card-executor.delay").update(totalWaitTime); try { return task.call(); } finally { xrayUtils.endSegment(); } }); try { return Pair.of(COMPLETED, futureObject.get(config.getTimeoutInSeconds(), TimeUnit.SECONDS)); } catch (ExecutionException | InterruptedException exception) { Throwable cause = exception.getCause(); if (cause instanceof WebApplicationException) { throw (WebApplicationException) cause; } return Pair.of(FAILED, null); } catch (TimeoutException timeoutException) { return Pair.of(IN_PROGRESS, null); } }

Target:
public Pair<ExecutionStatus, T> execute(Supplier<T> callable) { Callable<T> task = callable::get; final long startTime = System.currentTimeMillis(); Future<T> futureObject = executor.submit(() -> { xrayUtils.beginSegment(); long totalWaitTime = System.currentTimeMillis() - startTime; logger.debug("Card operation task spent ms in queue", totalWaitTime); if (totalWaitTime > QUEUE_WAIT_WARN_THRESHOLD_MILLIS) { logger.warn("CardExecutor Service delay - queue_wait_time={}", totalWaitTime); } metricRegistry.histogram("card-executor.delay").update(totalWaitTime); try { return task.call(); } finally { xrayUtils.endSegment(); } }); try { return Pair.of(COMPLETED, futureObject.get(config.getTimeoutInSeconds(), TimeUnit.SECONDS)); } catch (ExecutionException | InterruptedException exception) { if (exception.getCause() instanceof WebApplicationException) { throw (WebApplicationException) exception.getCause(); } return Pair.of(FAILED, null); } catch (TimeoutException timeoutException) { return Pair.of(IN_PROGRESS, null); } }
Source:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); sourceConfig.validate(collector); Class<? extends Driver> driverClass = dbManager.validateJDBCPluginPipeline(pipelineConfigurer, getJDBCPluginId(), collector); Schema configuredSchema = sourceConfig.getSchema(collector); if (configuredSchema != null) { pipelineConfigurer.getStageConfigurer().setOutputSchema(sourceConfig.getSchema(collector)); } else if (sourceConfig.query != null) { try { pipelineConfigurer.getStageConfigurer().setOutputSchema(getSchema(driverClass)); } catch (IllegalAccessException | InstantiationException e) { throw new InvalidStageException("Unable to instantiate JDBC driver: " + e.getMessage(), e); } catch (SQLException e) { throw new IllegalArgumentException("SQL error while getting query schema: " + e.getMessage(), e); } } }

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); sourceConfig.validate(collector); Class<? extends Driver> driverClass = dbManager.validateJDBCPluginPipeline(pipelineConfigurer, getJDBCPluginId(), collector); collector.getOrThrowException(); Schema configuredSchema = sourceConfig.getSchema(collector); if (configuredSchema != null) { pipelineConfigurer.getStageConfigurer().setOutputSchema(configuredSchema); } else if (!sourceConfig.containsMacro(DBSourceConfig.IMPORT_QUERY)) { try { pipelineConfigurer.getStageConfigurer().setOutputSchema(getSchema(driverClass)); } catch (IllegalAccessException | InstantiationException e) { collector.addFailure(String.format("Failed to instantiate JDBC driver: %s", e.getMessage()), null); } catch (SQLException e) { collector.addFailure( String.format("Encountered SQL error while getting query schema: %s", e.getMessage()), null); } } }
Source:
private synchronized void scheduleDriversForSplitLifeCycle(List<TaskSource> sources) { checkArgument(sources.stream().allMatch(TaskSource::isNoMoreSplits), "All task sources are expected to be final"); Map<PlanNodeId, List<ScheduledSplit>> splits = sources.stream() .collect(groupingBy( TaskSource::getPlanNodeId, collectingAndThen( mapping(TaskSource::getSplits, toImmutableList()), s -> s.stream().flatMap(Set::stream).collect(toImmutableList())))); for (PlanNodeId planNodeId : schedulingOrder) { DriverSplitRunnerFactory driverSplitRunnerFactory = driverRunnerFactoriesWithSplitLifeCycle.get(planNodeId); List<ScheduledSplit> planNodeSplits = splits.getOrDefault(planNodeId, ImmutableList.of()); scheduleTableScanSource(driverSplitRunnerFactory, planNodeSplits); } }

Target:
private synchronized void scheduleDriversForSplitLifeCycle(List<TaskSource> sources) { checkArgument(sources.stream().allMatch(TaskSource::isNoMoreSplits), "All task sources are expected to be final"); ListMultimap<PlanNodeId, ScheduledSplit> splits = ArrayListMultimap.create(); for (TaskSource taskSource : sources) { splits.putAll(taskSource.getPlanNodeId(), taskSource.getSplits()); } for (PlanNodeId planNodeId : schedulingOrder) { DriverSplitRunnerFactory driverSplitRunnerFactory = driverRunnerFactoriesWithSplitLifeCycle.get(planNodeId); List<ScheduledSplit> planNodeSplits = splits.get(planNodeId); scheduleTableScanSource(driverSplitRunnerFactory, planNodeSplits); } }
Source:
public ServerInfo getServer(UUID uuid) { if(playerServerCache.containsKey(uuid)){ return playerServerCache.get(uuid); } if (!db.isConnected()) db.connect(); PreparedStatement getServer = db.prepareStatement(this.getServer); try { getServer.setString(1, uuid.toString()); ResultSet set = getServer.executeQuery(); if (!set.next()) return null; return ProxyServer.getInstance().getServerInfo(set.getString(1)); } catch (SQLException e) { e.printStackTrace(); } return null; }

Target:
public ServerInfo getServer(UUID uuid) { if(playerServerCache.containsKey(uuid)){ return playerServerCache.get(uuid); } if (!db.isConnected()) db.connect(); PreparedStatement getServer = db.prepareStatement(this.getServer); try { getServer.setString(1, uuid.toString()); ResultSet set = getServer.executeQuery(); if (!set.next()) return null; ServerInfo server = ProxyServer.getInstance().getServerInfo(set.getString(1)); playerServerCache.put(uuid, server); return server; } catch (SQLException e) { e.printStackTrace(); } return null; }
Source:
private void readBounds(BufferedReader reader, MD5 md5) throws IOException { md5.bounds = new AABB[md5.numFrames]; for (int i = 0; i < md5.numFrames; ++i) { String line = MD5ParserCommon.readNextLine(reader); Matcher matcher = doubleVectorPattern.matcher(line); if (!matcher.find()) { throw new IOException("Invalid bounds line: \"" + line + "\""); } Vector3f a = MD5ParserCommon.readVector3fAndCorrect(matcher.group(1), matcher.group(2), matcher.group(3)); Vector3f b = MD5ParserCommon.readVector3fAndCorrect(matcher.group(4), matcher.group(5), matcher.group(6)); Vector3f min = new Vector3f(); min.x = Math.min(a.x, b.x); min.y = Math.min(a.y, b.y); min.z = Math.min(a.z, b.z); Vector3f max = new Vector3f(); max.x = Math.max(a.x, b.x); max.y = Math.max(a.y, b.y); max.z = Math.max(a.z, b.z); md5.bounds[i] = AABB.createMinMax(JomlUtil.from(min), JomlUtil.from(max)); } }

Target:
private void readBounds(BufferedReader reader, MD5 md5) throws IOException { md5.bounds = new AABB[md5.numFrames]; for (int i = 0; i < md5.numFrames; ++i) { String line = MD5ParserCommon.readNextLine(reader); Matcher matcher = doubleVectorPattern.matcher(line); if (!matcher.find()) { throw new IOException("Invalid bounds line: \"" + line + "\""); } Vector3f a = MD5ParserCommon.readVector3fAndCorrect(matcher.group(1), matcher.group(2), matcher.group(3)); Vector3f b = MD5ParserCommon.readVector3fAndCorrect(matcher.group(4), matcher.group(5), matcher.group(6)); Vector3f min = new Vector3f(a).min(b); Vector3f max = new Vector3f(a).max(b); md5.bounds[i] = AABB.createMinMax(JomlUtil.from(min), JomlUtil.from(max)); } }
Source:
public void test_isFocusControl() throws InterruptedException { assertFalse(control.isFocusControl()); shell.open(); processEvents(5000, () -> shell.getDisplay().getActiveShell() == shell); assertEquals("Unexpected focus", control.forceFocus(), control.isFocusControl()); }

Target:
public void test_isFocusControl() { assertFalse(control.isFocusControl()); shell.open(); if (SwtTestUtil.isGTK) { shell.forceActive(); } assertEquals(shell, shell.getDisplay().getActiveShell()); assertEquals("Unexpected focus", control.forceFocus(), control.isFocusControl()); }
Source:
public void onReceive(Context context, Intent intent) { int command = PeriodicReplicationService.COMMAND_NONE; if (ALARM_ACTION.equals(intent.getAction())) { command = PeriodicReplicationService.COMMAND_START_REPLICATION; } else if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { command = PeriodicReplicationService.COMMAND_DEVICE_REBOOTED; } if (command != PeriodicReplicationService.COMMAND_NONE) { Intent serviceIntent = new Intent(context.getApplicationContext(), clazz); serviceIntent.putExtra(PeriodicReplicationService.EXTRA_COMMAND, command); startWakefulService(context, serviceIntent); } }

Target:
public void onReceive(Context context, Intent intent) { if (intent != null) { int command = PeriodicReplicationService.COMMAND_NONE; if (ALARM_ACTION.equals(intent.getAction())) { command = PeriodicReplicationService.COMMAND_START_REPLICATION; } else if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { command = PeriodicReplicationService.COMMAND_DEVICE_REBOOTED; } if (command != PeriodicReplicationService.COMMAND_NONE) { Intent serviceIntent = new Intent(context.getApplicationContext(), clazz); serviceIntent.putExtra(PeriodicReplicationService.EXTRA_COMMAND, command); startWakefulService(context, serviceIntent); } } }
Source:
public Maven(String targets,String name, String pom, String properties, String jvmOptions, boolean usePrivateRepository, SettingsProvider settings, GlobalSettingsProvider globalSettings) { this(targets, name, pom, properties, jvmOptions, usePrivateRepository, settings, globalSettings, true); }

Target:
public Maven(String targets,String name, String pom, String properties, String jvmOptions, boolean usePrivateRepository, SettingsProvider settings, GlobalSettingsProvider globalSettings) { this(targets, name, pom, properties, jvmOptions, usePrivateRepository, settings, globalSettings, false); }
Source:
public List<String> doSearchAutocomplete(String searchString) { String url = "<LINK_0>"; String requestJson = "{ \"query\": { \"match\": { \"name\": { \"query\": \""+searchString+"\", \"analyzer\": \"standard\" } } } };"; try { log.info("Creating autocomplete search url with url:", url); HttpURLConnection conn = IOHelper.getConnection(url); String userpass = "asdiuser:3sto9AHT"; String basicAuth = "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(userpass.getBytes()); conn.setRequestProperty ("Authorization", basicAuth); IOHelper.writeToConnection(conn, requestJson); String result = IOHelper.readString(conn); JSONObject jsonObject = new JSONObject(result); JSONArray jsonHitsArray = jsonObject.getJSONObject("hits").getJSONArray("hits"); List<String> resultList = new ArrayList<>(); for (int i = 0; i < jsonHitsArray.length(); ++i ) { String resultName = jsonHitsArray.getJSONObject(i).getJSONObject("_source").getString("name"); resultList.add(resultName); } return resultList; } catch (Exception ex) { log.error("Couldn't open or read from connection for search channel!"); throw new RuntimeException("Couldn't open or read from connection!", ex); } }

Target:
public List<String> doSearchAutocomplete(String searchString) { if(PROPERTY_AUTOCOMPLETE_URL == null || PROPERTY_AUTOCOMPLETE_URL.isEmpty()) { return Collections.emptyList(); } String requestJson = "{ \"query\": { \"match\": { \"name\": { \"query\": \""+searchString+"\", \"analyzer\": \"standard\" } } } };"; try { log.info("Creating autocomplete search url with url:", PROPERTY_AUTOCOMPLETE_URL); HttpURLConnection conn = IOHelper.getConnection(PROPERTY_AUTOCOMPLETE_URL, PROPERTY_AUTOCOMPLETE_USERNAME, PROPERTY_AUTOCOMPLETE_PASSWORD); IOHelper.writeToConnection(conn, requestJson); String result = IOHelper.readString(conn); JSONObject jsonObject = new JSONObject(result); JSONArray jsonHitsArray = jsonObject.getJSONObject("hits").getJSONArray("hits"); List<String> resultList = new ArrayList<>(); for (int i = 0; i < jsonHitsArray.length(); ++i ) { String resultName = jsonHitsArray.getJSONObject(i).getJSONObject("_source").getString("name"); resultList.add(resultName); } return resultList; } catch (Exception ex) { log.error("Couldn't open or read from connection for search channel!"); throw new RuntimeException("Couldn't open or read from connection!", ex); } }
Source:
public static List<TableColumnState> backupTableColumns(ITable table) { ArrayList<TableColumnState> allColumns = new ArrayList<TableColumnState>(); ColumnSet columnSet = table.getColumnSet(); for (IColumn<?> c : columnSet.getAllColumnsInUserOrder()) { TableColumnState colState = new TableColumnState(); colState.setColumnClassName(c.getColumnId()); colState.setDisplayable(c.isDisplayable()); colState.setVisible(c.isDisplayable() && c.isVisible()); colState.setWidth(c.getWidth()); if (c instanceof INumberColumn) { colState.setAggregationFunction(((INumberColumn) c).getAggregationFunction()); colState.setBackgroundEffect(((INumberColumn) c).getAggregationFunction()); } if (columnSet.isUserSortColumn(c)) { int sortOrder = columnSet.getSortColumnIndex(c); if (sortOrder >= 0) { colState.setSortOrder(sortOrder); colState.setSortAscending(c.isSortAscending()); colState.setGroupingActive(c.isGroupingActive()); } else { colState.setSortOrder(-1); } } allColumns.add(colState); } return allColumns; }

Target:
public static List<TableColumnState> backupTableColumns(ITable table) { ArrayList<TableColumnState> allColumns = new ArrayList<TableColumnState>(); ColumnSet columnSet = table.getColumnSet(); for (IColumn<?> c : columnSet.getAllColumnsInUserOrder()) { TableColumnState colState = new TableColumnState(); colState.setColumnClassName(c.getColumnId()); colState.setDisplayable(c.isDisplayable()); colState.setVisible(c.isDisplayable() && c.isVisible()); colState.setWidth(c.getWidth()); if (c instanceof INumberColumn) { colState.setAggregationFunction(((INumberColumn) c).getAggregationFunction()); colState.setBackgroundEffect(((INumberColumn) c).getBackgroundEffect()); } if (columnSet.isUserSortColumn(c)) { int sortOrder = columnSet.getSortColumnIndex(c); if (sortOrder >= 0) { colState.setSortOrder(sortOrder); colState.setSortAscending(c.isSortAscending()); colState.setGroupingActive(c.isGroupingActive()); } else { colState.setSortOrder(-1); } } allColumns.add(colState); } return allColumns; }
Source:
protected <T> void sendOrPub(OutboundDeliveryContext<T> sendContext) { if (((ClusteredMessage) sendContext.message).getRepliedTo() != null) { clusteredSendReply(((ClusteredMessage) sendContext.message).getRepliedTo(), sendContext); } else if (sendContext.options.isLocalOnly()) { super.sendOrPub(sendContext); } else { sendContext.ctx.succeededFuture(sendContext.message) .flatMap(deliveryStrategy::chooseNodes) .onFailure(t -> { if (log.isDebugEnabled()) { log.error("Failed to send message", t); } sendContext.written(t); }) .onSuccess(nodeList -> sendToNodes(nodeList, sendContext)); } }

Target:
protected <T> void sendOrPub(OutboundDeliveryContext<T> sendContext) { if (((ClusteredMessage) sendContext.message).getRepliedTo() != null) { clusteredSendReply(((ClusteredMessage) sendContext.message).getRepliedTo(), sendContext); } else if (sendContext.options.isLocalOnly()) { super.sendOrPub(sendContext); } else { Serializer serializer = Serializer.get(sendContext.ctx); if (sendContext.message.isSend()) { serializer.queue(sendContext, nodeSelector::selectForSend, this::sendToNode, this::sendOrPublishFailed); } else { serializer.queue(sendContext, nodeSelector::selectForPublish, this::sendToNodes, this::sendOrPublishFailed); } } }
Source:
public void auditResponseMessage(T request, K response, AssertionType assertion, NhinTargetSystemType target, String direction, String _interface, Boolean isRequesting, Properties webContextProperties, String serviceName) { LOG.trace("--- Before auditing of response message ---"); if (getAuditLogger() != null && isAuditLoggingOn(serviceName)) { getAuditLogger().auditResponseMessage(request, response, assertion, target, direction, _interface, isRequesting, webContextProperties, serviceName, getAuditTransforms()); } LOG.trace("--- After auditing of response message ---"); }

Target:
public void auditResponseMessage(T request, K response, AssertionType assertion, NhinTargetSystemType target, String direction, String _interface, Boolean isRequesting, Properties webContextProperties, String serviceName) { LOG.trace("--- Before auditing of response message ---"); if (isAuditLoggingOn(serviceName) && getAuditLogger() != null) { getAuditLogger().auditResponseMessage(request, response, assertion, target, direction, _interface, isRequesting, webContextProperties, serviceName, getAuditTransforms()); } LOG.trace("--- After auditing of response message ---"); }
Source:
public OrganizationEntity create(SchoolDataSource dataSource, String identifier, String name) { OrganizationEntity roleSchoolDataIdentifier = new OrganizationEntity(); roleSchoolDataIdentifier.setDataSource(dataSource); roleSchoolDataIdentifier.setIdentifier(identifier); roleSchoolDataIdentifier.setName(name); return persist(roleSchoolDataIdentifier); }

Target:
public OrganizationEntity create(SchoolDataSource dataSource, String identifier, String name) { OrganizationEntity organizationEntity = new OrganizationEntity(); organizationEntity.setDataSource(dataSource); organizationEntity.setIdentifier(identifier); organizationEntity.setName(name); return persist(organizationEntity); }
Source:
protected void executeCommand() { ConnectStorageServerVDSCommandParameters newConnectionParametersForVdsm = new ConnectStorageServerVDSCommandParameters(getParameters().getVdsId(), getParameters() .getStoragePoolId(), getParameters().getStorageServerConnection().getstorage_type(), new ArrayList<StorageServerConnections>(Arrays .asList(getParameters().getStorageServerConnection()))); VDSReturnValue returnValueConnect = runVdsCommand(VDSCommandType.ConnectStorageServer,newConnectionParametersForVdsm); if (returnValueConnect.getSucceeded()) { getDbFacade().getStorageServerConnectionDao().update(getParameters().getStorageServerConnection()); ConnectStorageServerVDSCommandParameters oldConnectionParametersForVdsm = new ConnectStorageServerVDSCommandParameters(getParameters().getVdsId(), getParameters() .getStoragePoolId(), oldConnection.getstorage_type(), new ArrayList<StorageServerConnections>(Arrays .asList(oldConnection))); runVdsCommand(VDSCommandType.DisconnectStorageServer,oldConnectionParametersForVdsm); setSucceeded(true); } }

Target:
protected void executeCommand() { boolean hasConnectStorageSucceeded = connectToStorage(); VDSReturnValue returnValueUpdatedStorageDomain = updateStatsForDomain(); if (hasConnectStorageSucceeded && returnValueUpdatedStorageDomain.getSucceeded()) { final StorageDomain updatedStorageDomain = (StorageDomain) returnValueUpdatedStorageDomain.getReturnValue(); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getStorageConnDao().update(getParameters().getStorageServerConnection()); getStorageDomainDynamicDao().update(updatedStorageDomain.getStorageDynamicData()); return null; } }); setSucceeded(true); } }
Source:
private static CliOptions convertCliToPojo(CommandLine cmdLine, List<File> filesToProcess) { final CliOptions conf = new CliOptions(); conf.format = cmdLine.getOptionValue(OPTION_F_NAME); if (conf.format == null) { conf.format = PLAIN_FORMAT_NAME; } conf.outputLocation = cmdLine.getOptionValue(OPTION_O_NAME); conf.configLocation = cmdLine.getOptionValue(OPTION_C_NAME); conf.propertiesLocation = cmdLine.getOptionValue(OPTION_P_NAME); conf.files = filesToProcess; conf.executeIgnoredModules = cmdLine.hasOption(OPTION_EXECUTE_IGNORED_MODULES_NAME); final String checkerThreadsNumber = cmdLine.getOptionValue(OPTION_CAPITAL_C_NAME); if (checkerThreadsNumber == null) { conf.checkerThreadsNumber = 1; } else { conf.checkerThreadsNumber = Integer.parseInt(checkerThreadsNumber); } final String treeWalkerThreadsNumber = cmdLine.getOptionValue(OPTION_CAPITAL_W_NAME); if (treeWalkerThreadsNumber == null) { conf.treeWalkerThreadsNumber = 1; } else { conf.treeWalkerThreadsNumber = Integer.parseInt(treeWalkerThreadsNumber); } return conf; }

Target:
private static CliOptions convertCliToPojo(CommandLine cmdLine, List<File> filesToProcess) { final CliOptions conf = new CliOptions(); conf.format = cmdLine.getOptionValue(OPTION_F_NAME); if (conf.format == null) { conf.format = PLAIN_FORMAT_NAME; } conf.outputLocation = cmdLine.getOptionValue(OPTION_O_NAME); conf.configLocation = cmdLine.getOptionValue(OPTION_C_NAME); conf.propertiesLocation = cmdLine.getOptionValue(OPTION_P_NAME); conf.files = filesToProcess; conf.executeIgnoredModules = cmdLine.hasOption(OPTION_EXECUTE_IGNORED_MODULES_NAME); final String checkerThreadsNumber = cmdLine.getOptionValue( OPTION_CAPITAL_C_NAME, ONE_STRING_VALUE); conf.checkerThreadsNumber = Integer.parseInt(checkerThreadsNumber); final String treeWalkerThreadsNumber = cmdLine.getOptionValue( OPTION_CAPITAL_W_NAME, ONE_STRING_VALUE); conf.treeWalkerThreadsNumber = Integer.parseInt(treeWalkerThreadsNumber); return conf; }
Source:
protected void updateExecCredsIfRequired() { if (this.needToRefreshCreds) { this.needToRefreshCreds = false; LOG.info("The credentials are being updated {}.", executorId); Credentials creds = this.workerData.getCredentials(); idToTask.stream().map(Task::getTaskObject).filter(taskObject -> taskObject instanceof ICredentialsListener) .forEach(taskObject -> { ((ICredentialsListener) taskObject).setCredentials(creds == null ? null : creds.get_creds()); }); } }

Target:
protected void updateExecCredsIfRequired() { if (this.needToRefreshCreds.get()) { this.needToRefreshCreds.set(false); LOG.info("The credentials are being updated {}.", executorId); Credentials creds = this.workerData.getCredentials(); idToTask.stream().map(Task::getTaskObject).filter(taskObject -> taskObject instanceof ICredentialsListener) .forEach(taskObject -> { ((ICredentialsListener) taskObject).setCredentials(creds == null ? null : creds.get_creds()); }); } }
Source:
public void storageAndPoolExists() { StorageDomain sd = new StorageDomain(); Guid storagePoolId = Guid.newGuid(); sd.setStoragePoolId(storagePoolId); when(storageDomainDao.getAllForStorageDomain(any(Guid.class))).thenReturn(Collections.singletonList(sd)); when(storagePoolDao.get(storagePoolId)).thenReturn(new StoragePool()); assertTrue(cmd.validate()); }

Target:
public void storageAndPoolExists() { StorageDomain sd = new StorageDomain(); Guid storagePoolId = Guid.newGuid(); sd.setStoragePoolId(storagePoolId); when(storageDomainDao.getAllForStorageDomain(any())).thenReturn(Collections.singletonList(sd)); when(storagePoolDao.get(storagePoolId)).thenReturn(new StoragePool()); assertTrue(cmd.validate()); }
Source:
public AbstractListDataView<T> addItems(Collection<T> items) { final ListDataProvider<T> dataProvider = getDataProvider(); Collection<T> backendItems = dataProvider.getItems(); if (items != null && !items.isEmpty()) { items.stream() .filter(item -> !contains(item, dataProvider)) .forEach(backendItems::add); dataProvider.refreshAll(); } return this; }

Target:
public AbstractListDataView<T> addItems(Collection<T> items) { Objects.requireNonNull(items, NULL_COLLECTION_ERROR_MESSAGE); if (!items.isEmpty()) { final ListDataProvider<T> dataProvider = getDataProvider(); Collection<T> backendItems = dataProvider.getItems(); items.stream() .filter(item -> contains(item, dataProvider)) .forEach(item -> removeItemIfPresent(item, dataProvider)); backendItems.addAll(items); dataProvider.refreshAll(); } return this; }
Source:
private void onChunkOperationComplete(GetChunk chunk) { if (chunk.getChunkException() != null) { setOperationException(chunk.getChunkException()); } if (chunk == firstChunk) { if (operationCallbackInvoked.compareAndSet(false, true)) { ReadableStreamChannel result = getOperationException() == null ? this : null; operationCompleteCallback .completeOperation(operationFuture, operationCallback, result, getOperationException()); } } chunk.postCompletionCleanup(); maybeWriteToChannel(); }

Target:
private void onChunkOperationComplete(GetChunk chunk) { if (chunk.getChunkException() != null) { setOperationException(chunk.getChunkException()); } if (chunk == firstChunk) { if (operationCallbackInvoked.compareAndSet(false, true)) { getBlobResult = getOperationException() == null ? new GetBlobResult() : null; operationCompleteCallback .completeOperation(operationFuture, operationCallback, getBlobResult, getOperationException()); } } chunk.postCompletionCleanup(); if (getBlobResult != null) { getBlobResult.maybeWriteToChannel(); } }
Source:
private void updateBrickStatusDown() { List<GlusterBrickEntity> brickEntities = getDbFacade().getGlusterBrickDao().getGlusterVolumeBricksByServerId(getVdsId()); for (GlusterBrickEntity brick : brickEntities) { brick.setStatus(GlusterStatus.DOWN); } getDbFacade().getGlusterBrickDao().updateAll(brickEntities); }

Target:
private void updateBrickStatusDown() { List<GlusterBrickEntity> brickEntities = getDbFacade().getGlusterBrickDao().getGlusterVolumeBricksByServerId(getVdsId()); for (GlusterBrickEntity brick : brickEntities) { brick.setStatus(GlusterStatus.DOWN); } getDbFacade().getGlusterBrickDao().updateBrickStatuses(brickEntities); }
Source:
private void updateWatchdogModels(Integer osType) { VDSGroup cluster = getSelectedCluster(); if (osType != null && cluster != null) { AsyncQuery asyncQuery = new AsyncQuery(); asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { ArrayList<String> watchDogModels = (ArrayList<String>) ((VdcQueryReturnValue) returnValue) .getReturnValue(); watchDogModels.add(0, null); getWatchdogModel().setItems( (ArrayList<String>) watchDogModels); } }; AsyncDataProvider.getWatchDogModels(osType, cluster.getcompatibility_version(), asyncQuery); } }

Target:
private void updateWatchdogModels(Integer osType) { VDSGroup cluster = getSelectedCluster(); if (osType != null && cluster != null && getWatchdogModel() != null) { AsyncQuery asyncQuery = new AsyncQuery(); asyncQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { updateWatchdogItems((ArrayList<String>) ((VdcQueryReturnValue) returnValue) .getReturnValue()); } }; AsyncDataProvider.getWatchDogModels(osType, cluster.getcompatibility_version(), asyncQuery); } }
Source:
private void setSync(double defaultDisplayRefreshRate) { if (useDefaultDisplayVsync) { vsyncDurationNs = (long) (C.NANOS_PER_SECOND / defaultDisplayRefreshRate); vsyncOffsetNs = (vsyncDurationNs * VSYNC_OFFSET_PERCENTAGE) / 100; } }

Target:
private void setSync(double defaultDisplayRefreshRate) { vsyncDurationNs = (long) (C.NANOS_PER_SECOND / defaultDisplayRefreshRate); vsyncOffsetNs = (vsyncDurationNs * VSYNC_OFFSET_PERCENTAGE) / 100; }
Source:
public ExitStatus afterStep(StepExecution stepExecution) { logger.info("Items read = " + stepExecution .getReadCount() + ", items written = " + stepExecution .getWriteCount() + " items skipped = " + stepExecution.getSkipCount()); return null; }

Target:
public ExitStatus afterStep(StepExecution stepExecution) { logger.info("Items read = " + stepExecution.getReadCount() + ", items written = " + stepExecution.getWriteCount() + ", items skipped = " + stepExecution.getSkipCount()); return null; }
Source:
public PalantirContent deletePlayerPosition() { waitForElementVisibleByElement(mapFrame); driver.switchTo().activeElement(); JavascriptExecutor jsexec = (JavascriptExecutor) driver; driver.manage().timeouts().setScriptTimeout(20, TimeUnit.SECONDS); Object res = jsexec.executeAsyncScript(PalantirContent.PONTO_REMOVEPLAYER); PalantirContent handle = new PalantirContent(); try { JSONObject json = new JSONObject(res.toString()); handle.success = json.getString(PalantirContent.PONTO_MSG_SUCCESS); handle.responseCode = json.getString(PalantirContent.PONTO_MSG_RESPONSECODE); handle.message = json.getString(PalantirContent.PONTO_MSG_MESSAGE); PageObjectLogging.log( "deletePlayerPosition", handle.message, true, driver ); }catch (JSONException e) { PageObjectLogging.log( "deletePlayerPosition", "Player position was not deleted", false, driver ); } return handle; }

Target:
public PalantirContent deletePlayerPosition() { waitForElementVisibleByElement(mapFrame); JavascriptExecutor jsexec = (JavascriptExecutor) driver; driver.manage().timeouts().setScriptTimeout(20, TimeUnit.SECONDS); Object res = jsexec.executeAsyncScript(PalantirContent.PONTO_REMOVEPLAYER); return getResponse(res, "deletePlayerPosition"); }
Source:
private boolean updateVmLease() { if (Objects.equals(oldVm.getLeaseStorageDomainId(), newVmStatic.getLeaseStorageDomainId())) { return true; } if (getVm().isDown()) { if (!addVmLease(newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId())){ return false; } removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); } else { if (oldVm.getLeaseStorageDomainId() != null) { runVdsCommand(VDSCommandType.HotUnplugLease, new LeaseVDSParameters(getVm().getRunOnVds(), oldVm.getId(), oldVm.getLeaseStorageDomainId())); removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); } else { VmLeaseParameters params = new VmLeaseParameters(getStoragePoolId(), newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId()); params.setVdsId(getVm().getRunOnVds()); params.setHotPlugLease(true); return runInternalAction(ActionType.AddVmLease, params).getSucceeded(); } } return true; }

Target:
private boolean updateVmLease() { if (Objects.equals(oldVm.getLeaseStorageDomainId(), newVmStatic.getLeaseStorageDomainId())) { return true; } if (getVm().isNotRunning()) { if (!addVmLease(newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId())) { return false; } } else { if (oldVm.getLeaseStorageDomainId() == null) { VmLeaseParameters params = new VmLeaseParameters(getStoragePoolId(), newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId()); params.setVdsId(getVm().getRunOnVds()); params.setHotPlugLease(true); return runInternalAction(ActionType.AddVmLease, params).getSucceeded(); } runVdsCommand(VDSCommandType.HotUnplugLease, new LeaseVDSParameters(getVm().getRunOnVds(), oldVm.getId(), oldVm.getLeaseStorageDomainId())); } removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); return true; }
Source:
public List<PatientIdentifier> getPatientIdentifiers(String identifier, List<PatientIdentifierType> patientIdentifierTypes, List<Location> locations, List<Patient> patients, Boolean isPreferred) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(PatientIdentifier.class); criteria.createAlias("patient", "patient"); criteria.add(Restrictions.eq("patient.voided", false)); criteria.add(Restrictions.eq("voided", false)); if (identifier != null) { criteria.add(Restrictions.eq("identifier", identifier)); } if (!patientIdentifierTypes.isEmpty()) { criteria.add(Restrictions.in("identifierType", patientIdentifierTypes)); } if (!locations.isEmpty()) { criteria.add(Restrictions.in("location", locations)); } if (!patients.isEmpty()) { criteria.add(Restrictions.in("patient", patients)); } if (isPreferred != null) { criteria.add(Restrictions.eq("preferred", isPreferred)); } return criteria.list(); }

Target:
public List<PatientIdentifier> getPatientIdentifiers(String identifier, List<PatientIdentifierType> patientIdentifierTypes, List<Location> locations, List<Patient> patients, Boolean isPreferred) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(PatientIdentifier.class); criteria.createAlias("patient", "patient"); criteria.add(Restrictions.eq("patient.voided", false)); criteria.add(Restrictions.eq("voided", false)); if (identifier != null) { criteria.add(Restrictions.eq("identifier", identifier)); } if (CollectionUtils.isNotEmpty(patientIdentifierTypes)) { criteria.add(Restrictions.in("identifierType", patientIdentifierTypes)); } if (CollectionUtils.isNotEmpty(locations)) { criteria.add(Restrictions.in("location", locations)); } if (CollectionUtils.isNotEmpty(patients)) { criteria.add(Restrictions.in("patient", patients)); } if (isPreferred != null) { criteria.add(Restrictions.eq("preferred", isPreferred)); } return criteria.list(); }
Source:
private void releaseHolder(SearcherHolder holder) { synchronized (holder) { decrementSearcherUsageCount(holder.searcher); } }

Target:
private void releaseHolder(SearcherHolder holder) { if (holder.releasedHolder.compareAndSet(false, true)) { decrementSearcherUsageCount(holder.searcher); } }
Source:
private int logPartition(String e, AtomicInteger counter) { final int log4jMaxBufSize = 64507; return counter.getAndAdd(e.length() + securityAuditDelimiter.length()) / log4jMaxBufSize; }

Target:
private int logPartition(String e, AtomicInteger counter) { return counter.getAndAdd(e.length() + SECURITY_AUDIT_DELIMITER.length()) / LOG4J_MAX_BUF_SIZE; }