auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Disks list() { GetStorageDomainsByVmTemplateIdQueryParameters queryParams = new GetStorageDomainsByVmTemplateIdQueryParameters(parentId); List<storage_domains> storageDomains = getBackendCollection(storage_domains.class, VdcQueryType.GetStorageDomainsByVmTemplateId, queryParams); List<org.ovirt.engine.core.common.businessentities.Disk> backendCollection = getBackendCollection(queryType, queryParams); for (org.ovirt.engine.core.common.businessentities.Disk disk : backendCollection) { disk.setvm_guid(null); } Disks disks = mapCollection(backendCollection); for (Disk disk : disks.getDisks()) { if (disk.isSetStorageDomains()) { disk.getStorageDomains().getStorageDomains().clear(); } else { disk.setStorageDomains(new StorageDomains()); } for (storage_domains sd : storageDomains) { StorageDomain storageDomain = new StorageDomain(); storageDomain.setId(sd.getId().toString()); disk.getStorageDomains().getStorageDomains().add(storageDomain); } } return disks; }

Target:
public Disks list() { GetStorageDomainsByVmTemplateIdQueryParameters queryParams = new GetStorageDomainsByVmTemplateIdQueryParameters(parentId); List<storage_domains> storageDomains = getBackendCollection(storage_domains.class, VdcQueryType.GetStorageDomainsByVmTemplateId, queryParams); List<org.ovirt.engine.core.common.businessentities.Disk> backendCollection = getBackendCollection(queryType, queryParams); Disks disks = mapCollection(backendCollection, false); for (Disk disk : disks.getDisks()) { disk.setVm(null); if (disk.isSetStorageDomains()) { disk.getStorageDomains().getStorageDomains().clear(); } else { disk.setStorageDomains(new StorageDomains()); } for (storage_domains sd : storageDomains) { StorageDomain storageDomain = new StorageDomain(); storageDomain.setId(sd.getId().toString()); disk.getStorageDomains().getStorageDomains().add(storageDomain); } addLinks(disk); } return disks; }
Source:
private void validateParams() { if(StringUtils.isEmpty(getPassword())) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Empty passwords are not allowed"); } if (getAccountType() == null && getRoleId() == null) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Both account type and role ID are not provided"); } }

Target:
private void validateParams() { if(StringUtils.isEmpty(getPassword())) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Empty passwords are not allowed"); } if (getAccountType() == null && (getRoleId() == null || getRoleId() < 1L)) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Neither account type and role ID are not provided"); } }
Source:
private SemanticFn parseSemanticFn(LispTree tree) { if (tree.isLeaf()) { LispTree newTree = LispTree.proto.newList(); newTree.addChild("ConstantFn"); newTree.addChild(tree.value); tree = newTree; } String name = tree.child(0).value; if (name.equals("lambda") && Grammar.opts.useApplyFn == null) { LispTree newTree = LispTree.proto.newList(); newTree.addChild("JoinFn"); newTree.addChild("betaReduce"); newTree.addChild("forward"); newTree.addChild(LispTree.proto.newList("arg0", tree)); tree = newTree; name = tree.child(0).value; } if (name.equals("lambda") && Grammar.opts.useApplyFn != null) { LispTree newTree = LispTree.proto.newList(); newTree.addChild(Grammar.opts.useApplyFn); newTree.addChild(tree); tree = newTree; name = tree.child(0).value; } if (name.equals("LexiconFn") || name.equals("BridgeFn")) name = "freebase." + name; SemanticFn fn; fn = (SemanticFn) Utils.newInstanceHard(SempreUtils.resolveClassName(name)); if (fn == null) throw new RuntimeException("Invalid SemanticFn name: " + name); fn.init(tree); return fn; }

Target:
private SemanticFn parseSemanticFn(LispTree tree) { if (tree.isLeaf()) { LispTree newTree = LispTree.proto.newList(); newTree.addChild("ConstantFn"); newTree.addChild(tree.value); tree = newTree; } String name = tree.child(0).value; if (name.equals("lambda")) { LispTree newTree = LispTree.proto.newList(); if (Grammar.opts.useApplyFn == null) { newTree.addChild("JoinFn"); newTree.addChild("betaReduce"); newTree.addChild("forward"); newTree.addChild(LispTree.proto.newList("arg0", tree)); } else { newTree.addChild(Grammar.opts.useApplyFn); newTree.addChild(tree); } tree = newTree; name = tree.child(0).value; } if (name.equals("LexiconFn") || name.equals("BridgeFn")) name = "freebase." + name; SemanticFn fn; fn = (SemanticFn) Utils.newInstanceHard(SempreUtils.resolveClassName(name)); if (fn == null) throw new RuntimeException("Invalid SemanticFn name: " + name); fn.init(tree); return fn; }
Source:
private OracleChangeEvent generateOracleChangeEvent() throws SQLException, DatastreamException { long scn = _resultSet.getLong(SCN_INDEX); Timestamp ts = _resultSet.getTimestamp(TIMESTAMP_INDEX); long sourceTimestamp = ts.getTime(); OracleChangeEvent oracleChangeEvent = null; try { oracleChangeEvent = generateEvent(_resultSet, _schema, scn, sourceTimestamp, 3); } catch (Exception e) { String msg = String.format("Failed to process ResultSet with SCN: %s, Timestamp: %s, Schema: %s", scn, ts, _schema.getFullName()); LOG.error(msg, e); throw new DatastreamException(msg, e); } return oracleChangeEvent; }

Target:
private OracleChangeEvent generateOracleChangeEvent() throws SQLException, DatastreamException { long scn = _resultSet.getLong(SCN_COLUMN_INDEX); Timestamp ts = _resultSet.getTimestamp(TIMESTAMP_COLUMN_INDEX); long sourceTimestamp = ts.getTime(); OracleChangeEvent oracleChangeEvent = null; try { oracleChangeEvent = generateEvent(_resultSet, _schema, scn, sourceTimestamp); } catch (Exception e) { String msg = String.format("Failed to process ResultSet with SCN: %s, Timestamp: %s, Schema: %s", scn, ts, _schema.getFullName()); LOG.error(msg, e); throw new DatastreamException(msg, e); } return oracleChangeEvent; }
Source:
public static Float calcNum(Question question, float idSurvey) { if (question == null) { return null; } Value value = question.getValueBySurvey(idSurvey); if(question.getCompulsory() && question.hasParent()){ if (question.isHiddenBySurvey(idSurvey)) { if (value == null) return null; } } if(!question.getCompulsory()) { if (value == null) return null; } Option option=question.getOptionBySurvey(idSurvey); if(option==null){ return 0f; } return question.getNumerator_w()*option.getFactor(); }

Target:
public static Float calcNum(Question question, float idSurvey) { if (question == null) { return null; } Value value = question.getValueBySurvey(idSurvey); if(value == null){ return null; } Option option=question.getOptionBySurvey(idSurvey); if(option==null){ return 0f; } return question.getNumerator_w()*option.getFactor(); }
Source:
private List<Feed> getFeeds(List<FormDataBodyPart> feedForms) { List<Feed> feeds = new ArrayList<>(); if (feedForms != null && !feedForms.isEmpty()) { for (FormDataBodyPart formDataBodyPart : feedForms) { feeds.add(formDataBodyPart.getValueAs(Feed.class)); } } return feeds; }

Target:
private List<Entity> getFeeds(List<FormDataBodyPart> feedForms) { List<Entity> feeds = new ArrayList<>(); if (feedForms != null && !feedForms.isEmpty()) { for (FormDataBodyPart formDataBodyPart : feedForms) { feeds.add(formDataBodyPart.getValueAs(Feed.class)); } } return feeds; }
Source:
public void setMaxBreadcrumbs(int maxBreadcrumbs) { impl.setMaxBreadcrumbs(maxBreadcrumbs); }

Target:
public void setMaxBreadcrumbs(int maxBreadcrumbs) { if (maxBreadcrumbs >= MIN_BREADCRUMBS && maxBreadcrumbs <= MAX_BREADCRUMBS) { impl.setMaxBreadcrumbs(maxBreadcrumbs); } else { getLogger().e(String.format(Locale.US, "Invalid configuration value detected. " + "Option maxBreadcrumbs should be an integer between 0-100. " + "Supplied value is %d", maxBreadcrumbs)); } }
Source:
public boolean askSessionReopeningWithResourceVersionMismatch(AirdResourceVersionMismatchException e) { AskSessionOpeningRunnable askSessionOpeningRunnable = new AskSessionOpeningRunnable(e); Display.getDefault().syncExec(askSessionOpeningRunnable); return askSessionOpeningRunnable.mustReopenSessionIgnoringVersionMismach(); }

Target:
public boolean askSessionReopeningWithResourceVersionMismatch(AirdResourceVersionMismatchException e) { return false; }
Source:
public void testGetGraphQLComplexityDetails() throws APIManagementException { APIIdentifier apiIdentifier = new APIIdentifier("RASIKA", "API1", "1.0.0"); apiMgtDAO.addOrUpdateComplexityDetails(apiIdentifier, getGraphqlComplexityInfoDetails()); apiMgtDAO.getComplexityDetails(apiIdentifier); }

Target:
public void testGetGraphQLComplexityDetails() throws APIManagementException { APIIdentifier apiIdentifier = new APIIdentifier("RASIKA", "API1", "1.0.0"); apiMgtDAO.addOrUpdateComplexityDetails(apiIdentifier, getGraphqlComplexityInfoDetails()); GraphqlComplexityInfo graphqlComplexityInfo = apiMgtDAO.getComplexityDetails(apiIdentifier); assertEquals(2,graphqlComplexityInfo.getList().size()); }
Source:
protected static ReadMapping dateReadMapping() { return longReadMapping(DATE, (resultSet, columnIndex) -> { long localMillis = resultSet.getDate(columnIndex).getTime(); long utcMillis = ISOChronology.getInstance().getZone().getMillisKeepLocal(UTC, localMillis); return MILLISECONDS.toDays(utcMillis); }); }

Target:
public static ReadMapping dateReadMapping() { return longReadMapping(DATE, (resultSet, columnIndex) -> { long localMillis = resultSet.getDate(columnIndex).getTime(); long utcMillis = ISOChronology.getInstance().getZone().getMillisKeepLocal(UTC, localMillis); return MILLISECONDS.toDays(utcMillis); }); }
Source:
private void sleepQuietly( long milliseconds ) { try { sleep( milliseconds ); } catch ( InterruptedException e ) { ; } }

Target:
private void sleepQuietly( long milliseconds ) { try { sleep( milliseconds ); } catch ( InterruptedException e ) { logger.trace( "Sleep interrupted: {}", e ); } }
Source:
public int hashCode() { return new HashCodeBuilder(47, 19) .appendSuper(super.hashCode()) .append(getName()) .append(getClassName()) .append(getXtype()) .toHashCode(); }

Target:
public int hashCode() { return new HashCodeBuilder(47, 19) .appendSuper(super.hashCode()) .append(getName()) .append(getClassName()) .append(getXtype()) .append(getSourceCode()) .append(getStyleSheet()) .toHashCode(); }
Source:
public void addCluster() { ClusterModel model = new ClusterModel(); model.init(false); model.setAddMacPoolCommand(ClusterListModel.createAddMacPoolCommand(this)); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().newClusterTitle()); model.setHelpTag(HelpTag.new_cluster); model.setHashName("new_cluster"); model.setIsNew(true); ArrayList<StoragePool> dataCenters = new ArrayList<>(); dataCenters.add(getEntity()); model.getDataCenter().setItems(dataCenters, getEntity()); model.getDataCenter().setIsChangeable(false); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnAddCluster", this); model.getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this); model.getCommands().add(tempVar2); }

Target:
public void addCluster() { ClusterModel model = new ClusterModel(); model.init(false); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().newClusterTitle()); model.setHelpTag(HelpTag.new_cluster); model.setHashName("new_cluster"); model.setIsNew(true); ArrayList<StoragePool> dataCenters = new ArrayList<>(); dataCenters.add(getEntity()); model.getDataCenter().setItems(dataCenters, getEntity()); model.getDataCenter().setIsChangeable(false); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnAddCluster", this); model.getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this); model.getCommands().add(tempVar2); }
Source:
public byte[] getAPIData() { ByteArrayOutputStream os = new ByteArrayOutputStream(); try { os.write(frameID); os.write(command.getBytes()); os.write(status.getId()); if (commandData != null) os.write(commandData); } catch (IOException e) { e.printStackTrace(); } return os.toByteArray(); }

Target:
public byte[] getAPIData() { ByteArrayOutputStream os = new ByteArrayOutputStream(); try { os.write(frameID); os.write(command.getBytes()); os.write(status.getId()); if (commandData != null) os.write(commandData); } catch (IOException e) { } return os.toByteArray(); }
Source:
public static Map<String, Boolean> validateTrials(List<String> nctIds) throws ParserConfigurationException, SAXException, IOException { Map<String, Boolean> result = new HashMap<>(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); for (String nctId : nctIds) { String strUrl = "<LINK_0>" + nctId + "?displayxml=true"; try { Document doc = db.parse(strUrl); result.put(nctId, true); } catch (IOException e) { result.put(nctId, false); } } return result; }

Target:
public static Map<String, Boolean> validateTrials(List<String> nctIds) throws ParserConfigurationException, SAXException, IOException { Map<String, Boolean> result = new HashMap<>(); if (nctIds == null || nctIds.size() == 0) { return result; } DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); for (String nctId : nctIds) { String strUrl = "<LINK_0>" + nctId + "?displayxml=true"; try { Document doc = db.parse(strUrl); result.put(nctId, true); } catch (IOException e) { result.put(nctId, false); } } return result; }
Source:
public Map<String, String> getAllMappingUnderPath(String path) { TrieNode curNode; try { curNode = findTrieNode(path, false); } catch (IllegalArgumentException e) { return Collections.emptyMap(); } Map<String, String> resultMap = new HashMap<>(); if (path.substring(path.length() - 1).equals("/")) { path = path.substring(0, path.length() - 1); } addAllAddressesToMapping(resultMap, curNode, path); return resultMap; }

Target:
public Map<String, String> getAllMappingUnderPath(String path) { TrieNode curNode; try { curNode = findTrieNode(path, false); } catch (NoSuchElementException e) { return Collections.emptyMap(); } Map<String, String> resultMap = new HashMap<>(); Deque<TrieNode> nodeStack = new ArrayDeque<>(); nodeStack.push(curNode); while (!nodeStack.isEmpty()) { curNode = nodeStack.pop(); if (curNode._isLeaf) { resultMap.put(curNode._name, curNode._realmAddress); } else { for (TrieNode child : curNode._children.values()) { nodeStack.push(child); } } } return resultMap; }
Source:
private void setBackgroundColour() { if (buttonData.type == ValueType.CUSTOM) { butt.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.button_default)); butt.setTextColor(ContextCompat.getColor(getContext(), R.color.steel)); butt.setTypeface(null, Typeface.BOLD); } else { butt.setBackgroundResource(R.drawable.button_background_kitkat); butt.setTextColor(Color.WHITE); butt.setTypeface(null, Typeface.NORMAL); } }

Target:
private void setBackgroundColour() { switch (buttonData.type) { case CUSTOM: butt.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.button_default)); butt.setTextColor(ContextCompat.getColor(getContext(), R.color.steel)); butt.setTypeface(null, Typeface.BOLD); break; default: butt.setBackgroundResource(R.drawable.button_background_kitkat); butt.setTextColor(Color.WHITE); butt.setTypeface(null, Typeface.NORMAL); break; } }
Source:
private Estimate calculateDistinctValuesCount(Map<String, PartitionStatistics> statisticsByPartitionName, String column) { return summarizePartitionStatistics( statisticsByPartitionName.values(), column, columnStatistics -> { if (columnStatistics.getDistinctValuesCount().isPresent()) { return OptionalDouble.of(columnStatistics.getDistinctValuesCount().getAsLong()); } else if (columnStatistics.getBooleanStatistics().isPresent() && columnStatistics.getBooleanStatistics().get().getFalseCount().isPresent() && columnStatistics.getBooleanStatistics().get().getTrueCount().isPresent() && columnStatistics.getNullsCount().isPresent()) { long falseCount = columnStatistics.getBooleanStatistics().get().getFalseCount().getAsLong(); long trueCount = columnStatistics.getBooleanStatistics().get().getTrueCount().getAsLong(); return OptionalDouble.of((falseCount > 0 ? 1 : 0) + (trueCount > 0 ? 1 : 0)); } else { return OptionalDouble.empty(); } }, DoubleStream::max); }

Target:
private Estimate calculateDistinctValuesCount(Map<String, PartitionStatistics> statisticsByPartitionName, String column) { return summarizePartitionStatistics( statisticsByPartitionName.values(), column, columnStatistics -> { if (columnStatistics.getDistinctValuesCount().isPresent()) { return OptionalDouble.of(columnStatistics.getDistinctValuesCount().getAsLong()); } if (columnStatistics.getBooleanStatistics().isPresent() && columnStatistics.getBooleanStatistics().get().getFalseCount().isPresent() && columnStatistics.getBooleanStatistics().get().getTrueCount().isPresent()) { long falseCount = columnStatistics.getBooleanStatistics().get().getFalseCount().getAsLong(); long trueCount = columnStatistics.getBooleanStatistics().get().getTrueCount().getAsLong(); return OptionalDouble.of((falseCount > 0 ? 1 : 0) + (trueCount > 0 ? 1 : 0)); } return OptionalDouble.empty(); }, DoubleStream::max); }
Source:
private void send(String message, String vmID, boolean removeClient) throws ClientConnectionException{ String hostName = null; try { ReactorClient client = JsonRpcServer.getReactorsMap().get(vmID); hostName = client.getHostname(); client.sendMessage(message.getBytes()); log.debug("sending events message {}", message); }catch (ClientConnectionException e) { log.error("Host {}, failed to send event message {}", hostName, e); } if (removeClient){ JsonRpcServer.removeReactorsMap(vmID); } }

Target:
private void send(String message, String vmID, boolean removeClient) throws ClientConnectionException{ ReactorClient client = null; try { client = JsonRpcServer.getReactorsMap().get(vmID); client.sendMessage(message.getBytes()); log.debug("sending events message {}", message); }catch (ClientConnectionException e) { log.error("Host {}, failed to send event message {}", client.getHostname(), e); } if (removeClient){ JsonRpcServer.removeReactorsMap(vmID); } }
Source:
private static String initMultiGetEntitiesQuery(EntityKeyMetadata entityKeyMetadata, boolean includeEmbedded) { StringBuilder queryBuilder = new StringBuilder( "MATCH " ); queryBuilder.append( "(owner:" ); queryBuilder.append( ENTITY ); queryBuilder.append( ":" ); appendLabel( entityKeyMetadata, queryBuilder ); queryBuilder.append( ") " ); queryBuilder.append( " WHERE " ); if ( entityKeyMetadata.getColumnNames().length == 1 ) { queryBuilder.append( "owner." ); escapeIdentifier( queryBuilder, entityKeyMetadata.getColumnNames()[0] ); queryBuilder.append( " IN {0}" ); appendGetEmbeddedNodesIfNeeded( includeEmbedded, queryBuilder ); } return queryBuilder.toString(); }

Target:
private static String initMultiGetEntitiesQuery(EntityKeyMetadata entityKeyMetadata, boolean includeEmbedded) { StringBuilder queryBuilder = new StringBuilder( "MATCH " ); queryBuilder.append( "(" ); queryBuilder.append( ENTITY_ALIAS ); queryBuilder.append( ":" ); queryBuilder.append( ENTITY ); queryBuilder.append( ":" ); appendLabel( entityKeyMetadata, queryBuilder ); queryBuilder.append( ") " ); queryBuilder.append( " WHERE " ); if ( entityKeyMetadata.getColumnNames().length == 1 ) { queryBuilder.append( ENTITY_ALIAS ); queryBuilder.append( "." ); escapeIdentifier( queryBuilder, entityKeyMetadata.getColumnNames()[0] ); queryBuilder.append( " IN {0}" ); appendGetEmbeddedNodesIfNeeded( includeEmbedded, queryBuilder ); } return queryBuilder.toString(); }
Source:
private ConnectorInfo createConnector(Server server, String name, IntSupplier port, ServerConnectorConfig config) { final List<ConnectionFactory> factories = new ArrayList<>(); final SslContextFactory ssl; switch (config.getProtocol()) { case "proxy+http": factories.add(new ProxyConnectionFactory()); case "http": ssl = null; break; case "proxy+https": factories.add(new ProxyConnectionFactory()); case "https": ssl = new SuperSadSslContextFactory(name, config); break; default: throw new UnsupportedOperationException(String.format("For connector '%s', unsupported protocol '%s'", name, config.getProtocol())); } final HttpConfiguration httpConfig = new HttpConfiguration(); if (ssl != null || tlsProvider.isPresent()) { httpConfig.addCustomizer(new SecureRequestCustomizer()); } else if (config.isForceSecure()) { httpConfig.addCustomizer(new SuperSecureCustomizer()); } httpConfigCustomizers.ifPresent(c -> c.forEach(h -> h.accept(httpConfig))); final HttpConnectionFactory http = new HttpConnectionFactory(httpConfig); if (ssl != null) { factories.add(new SslConnectionFactory(ssl, http.getProtocol())); } factories.add(http); final ServerConnector connector = new ServerConnector(server, factories.toArray(new ConnectionFactory[factories.size()])); connector.setName(name); connector.setPort(selectPort(port, config)); server.addConnector(connector); return new ServerConnectorInfo(name, connector, config); }

Target:
private ConnectorInfo createConnector(Server server, String name, IntSupplier port, ServerConnectorConfig config) { final List<ConnectionFactory> factories = new ArrayList<>(); final SslContextFactory ssl; switch (config.getProtocol()) { case "proxy+http": factories.add(new ProxyConnectionFactory()); case "http": ssl = null; break; case "proxy+https": factories.add(new ProxyConnectionFactory()); case "https": ssl = new SuperSadSslContextFactory(name, config); break; default: throw new UnsupportedOperationException(String.format("For connector '%s', unsupported protocol '%s'", name, config.getProtocol())); } final HttpConfiguration httpConfig = new HttpConfiguration(); if (ssl != null || tlsProvider.isPresent()) { httpConfig.addCustomizer(new SecureRequestCustomizer()); } else if (config.isForceSecure()) { httpConfig.addCustomizer(new SuperSecureCustomizer()); } httpConfigCustomizers.ifPresent(c -> c.forEach(h -> h.accept(httpConfig))); final HttpConnectionFactory http = new HttpConnectionFactory(httpConfig); if (ssl != null) { factories.add(new SslConnectionFactory(ssl, http.getProtocol())); } factories.add(http); final ServerConnector connector = new ServerConnector(server, factories.toArray(new ConnectionFactory[factories.size()])); connector.setName(name); connector.setHost(config.getBindAddress()); connector.setPort(selectPort(port, config)); server.addConnector(connector); return new ServerConnectorInfo(name, connector, config); }
Source:
public void testBuildXMLGenerateRemoteRegistryClients() throws CarbonToolsIntegrationTestException { boolean isJarCreated = false; Process process = null; try { File folder = new File(carbonHome + File.separator + "repository" + File.separator + "lib"); File[] listOfFilesBeforeRunAntCommand = folder.listFiles(); String[] cmdArray; if (CarbonCommandToolsUtil.isCurrentOSWindows()) { cmdArray = new String[]{"cmd.exe", "/c", "start", "ant" }; } else { cmdArray = new String[]{"ant"}; } process = CarbonCommandToolsUtil.runScript(carbonHome + File.separator + "bin", cmdArray); long startTime = System.currentTimeMillis(); long timeout = 20000; while ((System.currentTimeMillis() - startTime) < timeout) { File[] listOfFilesAfterRunAntCommand = folder.listFiles(); if (listOfFilesBeforeRunAntCommand != null && listOfFilesAfterRunAntCommand != null) { if (listOfFilesAfterRunAntCommand.length > listOfFilesBeforeRunAntCommand.length) { log.info("Jars created successfully"); isJarCreated = true; break; } } else { if (listOfFilesAfterRunAntCommand != null && listOfFilesAfterRunAntCommand.length > 0) { log.info("Jars created successfully"); isJarCreated = true; break; } } } } finally { if (process != null) { process.destroy(); } } assertTrue(isJarCreated, "Jar not created successfully"); }

Target:
public void testBuildXMLGenerateRemoteRegistryClients() throws CarbonToolsIntegrationTestException { boolean isJarCreated = false; Process process = null; try { File folder = new File(carbonHome + File.separator + "repository" + File.separator + "lib"); File[] listOfFilesBeforeRunAntCommand = folder.listFiles(); String[] cmdArray; if ((CarbonCommandToolsUtil.getCurrentOperatingSystem(). contains(OperatingSystems.WINDOWS.name().toLowerCase()))) { cmdArray = new String[]{"cmd.exe", "/c", "start", "ant" }; } else { cmdArray = new String[]{"ant"}; } process = CarbonCommandToolsUtil.runScript(carbonHome + File.separator + "bin", cmdArray); long startTime = System.currentTimeMillis(); long timeout = 20000; while ((System.currentTimeMillis() - startTime) < timeout) { File[] listOfFilesAfterRunAntCommand = folder.listFiles(); if (listOfFilesBeforeRunAntCommand != null && listOfFilesAfterRunAntCommand != null) { if (listOfFilesAfterRunAntCommand.length > listOfFilesBeforeRunAntCommand.length) { log.info("Jars created successfully"); isJarCreated = true; break; } } else { if (listOfFilesAfterRunAntCommand != null && listOfFilesAfterRunAntCommand.length > 0) { log.info("Jars created successfully"); isJarCreated = true; break; } } } } finally { if (process != null) { process.destroy(); } } assertTrue(isJarCreated, "Jar not created successfully"); }
Source:
public void getVariable() { TestSuiteModel testSuite = new TestSuiteModel(); String variable_indentifier = "variable_indentifier"; String variable_content = "variable_content"; String variable_description = "variable_description"; testSuite.setVariable(variable_indentifier, variable_content, variable_description); assertEquals(1, testSuite.getVariables().size()); assertEquals(variable_indentifier, testSuite.getVariables().get(0).getName()); assertEquals(variable_content, testSuite.getVariables().get(0).getContent()); assertEquals(variable_description, testSuite.getVariables().get(0).getDescription()); assertNotNull(testSuite.getVariable(variable_indentifier)); assertEquals(variable_indentifier, testSuite.getVariable(variable_indentifier).getName()); assertEquals(variable_content, testSuite.getVariable(variable_indentifier).getContent()); assertEquals(variable_description, testSuite.getVariable(variable_indentifier).getDescription()); String variable_indentifier_1 = variable_indentifier + "_1"; String variable_content_1 = variable_content + "_1"; String variable_description_1 = variable_description + "_1"; testSuite.setVariable(variable_indentifier_1, variable_content_1, variable_description_1); assertEquals(2, testSuite.getVariables().size()); assertEquals(variable_indentifier, testSuite.getVariables().get(0).getName()); assertEquals(variable_content, testSuite.getVariables().get(0).getContent()); assertEquals(variable_description, testSuite.getVariables().get(0).getDescription()); assertNotNull(testSuite.getVariable(variable_indentifier_1)); assertEquals(variable_indentifier_1, testSuite.getVariable(variable_indentifier_1).getName()); assertEquals(variable_content_1, testSuite.getVariable(variable_indentifier_1).getContent()); assertEquals(variable_description_1, testSuite.getVariable(variable_indentifier_1).getDescription()); }

Target:
public void getVariable() { TestSuiteModel testSuite = new TestSuiteModel(); for (int index = 0; index < elements; index++) { testSuite.setVariable(variableIndentifier[index], variableContent[index], variableDescription[index]); } for (int index = elements-1; index >= 0; index--) { assertEquals(variableIndentifier[index], testSuite.getVariable(variableIndentifier[index]).getName()); assertEquals(variableContent[index], testSuite.getVariable(variableIndentifier[index]).getContent()); assertEquals(variableDescription[index], testSuite.getVariable(variableIndentifier[index]).getDescription()); } }
Source:
public void testNamespace(){ String testTermEntry = "\n[Term]\n" + "id: SO:0000691\n" + "name: cleaved_initiator_methionine \n" + "namespace: sequence\n" + "alt_id: BS:00067\n" + "def: \"The initiator methionine that has been cleaved from a mature polypeptide sequence.\" [EBIBS:GAR]\n" + "subset: biosapiens\n" + "synonym: \"cleaved initiator methionine\" EXACT []\n" + "synonym: \"init_met\" RELATED [uniprot:feature_type]\n" + "synonym: \"initiator methionine\" RELATED []\n" + "is_a: SO:0100011 ! cleaved_peptide_region\n\n"; OboParser parser = new OboParser(); try { InputStream inStream = new ByteArrayInputStream(testTermEntry.getBytes()); assertNotNull(inStream); BufferedReader oboFile = new BufferedReader ( new InputStreamReader ( inStream ) ); Ontology ontology; ontology = parser.parseOBO(oboFile, "so-xp/subsets/biosapiens", "snippet from biosapiens protein feature ontology"); Set<Term> keys = ontology.getTerms(); assertTrue(keys.size() > 1); assertTrue(ontology.getTerm("SO:0000691").getAnnotation().containsProperty(NAMESPACE)); assertEquals("sequence",ontology.getTerm("SO:0000691").getAnnotation().getProperty(NAMESPACE)); } catch (Exception e) { logger.error("Exception: ", e); fail(e.getMessage()); } }

Target:
public void testNamespace() throws IOException, ParseException { String testTermEntry = "\n[Term]\n" + "id: SO:0000691\n" + "name: cleaved_initiator_methionine \n" + "namespace: sequence\n" + "alt_id: BS:00067\n" + "def: \"The initiator methionine that has been cleaved from a mature polypeptide sequence.\" [EBIBS:GAR]\n" + "subset: biosapiens\n" + "synonym: \"cleaved initiator methionine\" EXACT []\n" + "synonym: \"init_met\" RELATED [uniprot:feature_type]\n" + "synonym: \"initiator methionine\" RELATED []\n" + "is_a: SO:0100011 ! cleaved_peptide_region\n\n"; OboParser parser = new OboParser(); InputStream inStream = new ByteArrayInputStream(testTermEntry.getBytes()); assertNotNull(inStream); BufferedReader oboFile = new BufferedReader ( new InputStreamReader ( inStream ) ); Ontology ontology = parser.parseOBO(oboFile, "so-xp/subsets/biosapiens", "snippet from biosapiens protein feature ontology"); Set<Term> keys = ontology.getTerms(); assertTrue(keys.size() > 1); assertTrue(ontology.getTerm("SO:0000691").getAnnotation().containsProperty(NAMESPACE)); assertEquals("sequence",ontology.getTerm("SO:0000691").getAnnotation().getProperty(NAMESPACE)); }
Source:
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final CommandResult<RuleViolation> results = allow(context); if (!results.getType().equals(CommandResult.Type.ERROR)) { final org.kie.workbench.common.stunner.core.graph.Graph graph = getGraph(context); graph.addNode(candidate); getMutableIndex(context).addNode(candidate); } return results; }

Target:
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final CommandResult<RuleViolation> results = allow(context); if (!results.getType().equals(CommandResult.Type.ERROR)) { final Graph graph = getGraph(context); graph.addNode(candidate); getMutableIndex(context).addNode(candidate); } return results; }
Source:
public void storeWorkerMetrics(final String workerId, final WorkerMetrics metrics) { if (metricCollectionEnabled) { try { final int numDataBlocksOnWorker = metrics.getNumDataBlocks(); final int numDataBlocksOnDriver = numBlockOwnershipByEvalIdForWorker.get(workerId); if (numDataBlocksOnWorker == numDataBlocksOnDriver) { final DataInfo dataInfo = new DataInfoImpl(numDataBlocksOnWorker); final EvaluatorParameters evaluatorParameters = new WorkerEvaluatorParameters(workerId, dataInfo, metrics); workerEvalParams.computeIfAbsent(workerId, metricList -> new ArrayList<>()).add(evaluatorParameters); } else { LOG.log(Level.FINE, "{0} contains {1} blocks, driver says {2} blocks. Dropping metric.", new Object[]{workerId, numDataBlocksOnWorker, numDataBlocksOnDriver}); } } catch (NullPointerException e) { LOG.log(Level.FINE, "No information about {0}. Dropping metric.", workerId); } } else { LOG.log(Level.FINE, "Metric collection disabled. Dropping metric from {0}", workerId); } }

Target:
public void storeWorkerMetrics(final String workerId, final WorkerMetrics metrics) { if (metricCollectionEnabled) { final int numDataBlocksOnWorker = metrics.getNumDataBlocks(); if (numBlockByEvalIdForWorker != null && numBlockByEvalIdForWorker.containsKey(workerId)) { final int numDataBlocksOnDriver = numBlockByEvalIdForWorker.get(workerId); if (numDataBlocksOnWorker == numDataBlocksOnDriver) { final DataInfo dataInfo = new DataInfoImpl(numDataBlocksOnWorker); final EvaluatorParameters evaluatorParameters = new WorkerEvaluatorParameters(workerId, dataInfo, metrics); synchronized (workerEvalParams) { if (!workerEvalParams.containsKey(workerId)) { workerEvalParams.put(workerId, new ArrayList<>()); } workerEvalParams.get(workerId).add(evaluatorParameters); } } else { LOG.log(Level.FINE, "{0} contains {1} blocks, driver says {2} blocks. Dropping metric.", new Object[]{workerId, numDataBlocksOnWorker, numDataBlocksOnDriver}); } } else { LOG.log(Level.FINE, "No information about {0}. Dropping metric.", workerId); } } else { LOG.log(Level.FINE, "Metric collection disabled. Dropping metric from {0}", workerId); } if (this.dashboardEnabled) { sendMetricsToDashboard(workerId, metrics.toString()); } }
Source:
public void unselect(final int row) { waitForEnabled(); setFocus(); asyncExec(new VoidResult() { public void run() { log.debug(MessageFormat.format("Unselecting row {0} in {1}", row, widget)); widget.deselect(row); lastSelectionItem = widget.getItem(row); } }); notifySelect(); }

Target:
public void unselect(final int row) { waitForEnabled(); setFocus(); asyncExec(new VoidResult() { public void run() { if (widget.isSelected(row)) { log.debug(MessageFormat.format("Unselecting row {0} in {1}", row, widget)); widget.deselect(row); lastSelectionItem = widget.getItem(row); notifySelect(true); } else { log.debug(MessageFormat.format("Nothing to unselect in {0}", widget)); } } }); }
Source:
public List getResultList() { log.info( "I am called!" ); if ( isResultSet() ) { return resultList; } return null; }

Target:
public List getResultList() { if ( isResultSet() ) { return resultList; } return null; }
Source:
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateTimerEvent emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertTimerEventEmpty(emptyEvent.getExecutionSet(), NON_CANCELLING, ""); }

Target:
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateTimerEvent emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertTimerEventEmpty(emptyEvent.getExecutionSet(), NON_CANCELLING, EMPTY_VALUE); }
Source:
private String decodeBase64EncodedPassword(String prefixEncodedPasswordString) { try { String algorithmUsed = extractId(prefixEncodedPasswordString); String base64DecodedPasswordAfterAlgorithm; String extractBase64EncodedHash = prefixEncodedPasswordString; if (StringUtils.isNotEmpty(algorithmUsed)) { extractBase64EncodedHash = extractEncodedPassword(prefixEncodedPasswordString); base64DecodedPasswordAfterAlgorithm = PREFIX + algorithmUsed + SUFFIX + decodeBase64EncodedHashWithHex(extractBase64EncodedHash); } else { base64DecodedPasswordAfterAlgorithm = new String( java.util.Base64.getDecoder().decode(Utf8.encode(extractBase64EncodedHash))); } return base64DecodedPasswordAfterAlgorithm; } catch (Exception e) { logger.warn("Failed to match password after decoding base64encoded hash after algorithm"); return prefixEncodedPasswordString; } }

Target:
private String decodeBase64EncodedPassword(String prefixEncodedPasswordString) { try { String algorithmUsed = extractId(prefixEncodedPasswordString); String extractBase64EncodedHash = prefixEncodedPasswordString; if (!StringUtils.isEmpty(algorithmUsed)) { extractBase64EncodedHash = extractEncodedPassword(prefixEncodedPasswordString); return PREFIX + algorithmUsed + SUFFIX + decodeBase64EncodedHashWithHex(extractBase64EncodedHash); } else { return new String(Base64.getDecoder().decode(Utf8.encode(extractBase64EncodedHash))); } } catch (Exception e) { logger.warn("Failed to match password after decoding base64encoded hash after algorithm", e); return prefixEncodedPasswordString; } }
Source:
public void onLogout() { AsyncQuery query = new AsyncQuery(); query.setHandleFailure(true); query.setModel(this); query.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { Window.Location.reload(); } }; frontend.logoffAsync(frontend.getLoggedInUser(), query); }

Target:
public void onLogout() { AsyncQuery query = new AsyncQuery(); query.setHandleFailure(true); query.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object ReturnValue) { Window.Location.reload(); } }; frontend.logoffAsync(frontend.getLoggedInUser(), query); }
Source:
public void canSupportGuaranteedSize() throws CameraInfoUnavailableException { for (int i = 0; i <= 1; i++) { final int lensFacing = i; if (CameraUtil.hasCameraWithLensFacing(lensFacing)) { continue; } String cameraId = CameraX.getCameraFactory().cameraIdForLensFacing(lensFacing); boolean isRotateNeeded = (CameraX.getCameraInfo(cameraId).getSensorRotationDegrees( Surface.ROTATION_0) % 180) != 0; ImageCapture useCase = new ImageCapture.Builder().setTargetResolution( GUARANTEED_RESOLUTION).setTargetRotation( isRotateNeeded ? Surface.ROTATION_90 : Surface.ROTATION_0).build(); mInstrumentation.runOnMainSync( () -> { CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing(lensFacing).build(); CameraX.bindToLifecycle(mLifecycleOwner, cameraSelector, useCase); mLifecycleOwner.startAndResume(); }); AtomicReference<ImageProperties> imageProperties = new AtomicReference<>(null); OnImageCapturedCallback callback = createMockOnImageCapturedCallback(imageProperties); useCase.takePicture(mListenerExecutor, callback); verify(callback, timeout(3000)).onCaptureSuccess(any(ImageProxy.class)); assertEquals(GUARANTEED_RESOLUTION, imageProperties.get().size); } }

Target:
public void canSupportGuaranteedSize() throws CameraInfoUnavailableException { for (int i = 0; i <= 1; i++) { final int lensFacing = i; if (!CameraUtil.hasCameraWithLensFacing(lensFacing)) { continue; } String cameraId = CameraX.getCameraFactory().cameraIdForLensFacing(lensFacing); boolean isRotateNeeded = (CameraX.getCameraInfo(cameraId).getSensorRotationDegrees( Surface.ROTATION_0) % 180) != 0; ImageCapture useCase = new ImageCapture.Builder().setTargetResolution( GUARANTEED_RESOLUTION).setTargetRotation( isRotateNeeded ? Surface.ROTATION_90 : Surface.ROTATION_0).build(); mInstrumentation.runOnMainSync( () -> { CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing(lensFacing).build(); CameraX.bindToLifecycle(mLifecycleOwner, cameraSelector, useCase); mLifecycleOwner.startAndResume(); }); AtomicReference<ImageProperties> imageProperties = new AtomicReference<>(null); OnImageCapturedCallback callback = createMockOnImageCapturedCallback(imageProperties); useCase.takePicture(mListenerExecutor, callback); verify(callback, timeout(3000)).onCaptureSuccess(any(ImageProxy.class)); assertEquals(GUARANTEED_RESOLUTION, imageProperties.get().size); mInstrumentation.runOnMainSync(() -> { CameraX.unbindAll(); mLifecycleOwner.pauseAndStop(); }); } }
Source:
public void addFileField(String name, File file) throws IOException { String fileName = file.getName(); writer.append("--" + boundary).append(LINE_BREAK); writer.append( "Content-Disposition: form-data; name=\"" + name + "\"; filename=\"" + fileName + "\"").append( LINE_BREAK); String probableContentType = URLConnection .guessContentTypeFromName(fileName); writer.append("Content-Type: " + probableContentType) .append(LINE_BREAK); writer.append("Content-Transfer-Encoding: binary").append(LINE_BREAK); writer.append(LINE_BREAK); FileInputStream inputStream = new FileInputStream(file); try { byte[] buffer = new byte[4096]; int bytesRead = -1; while ((bytesRead = inputStream.read(buffer)) != -1) { outputStream.write(buffer, 0, bytesRead); } outputStream.flush(); } finally { inputStream.close(); } writer.append(LINE_BREAK); }

Target:
public void addFileField(String name, File file) throws IOException { String fileName = file.getName(); writer.append("--" + boundary).append(LINE_BREAK); writer.append( "Content-Disposition: form-data; name=\"" + name + "\"; filename=\"" + fileName + "\"").append( LINE_BREAK); String probableContentType = URLConnection .guessContentTypeFromName(fileName); writer.append("Content-Type: " + probableContentType) .append(LINE_BREAK); writer.append("Content-Transfer-Encoding: binary").append(LINE_BREAK); writer.append(LINE_BREAK); writer.flush(); FileInputStream inputStream = new FileInputStream(file); try { byte[] buffer = new byte[4096]; int bytesRead = -1; while ((bytesRead = inputStream.read(buffer)) != -1) { outputStream.write(buffer, 0, bytesRead); } outputStream.flush(); } finally { inputStream.close(); } writer.append(LINE_BREAK); writer.flush(); }
Source:
private JobDescriptorImpl createJob(JobPriority jobPriority, Optional<Date> deadline) { final JobDescriptorImpl job = mock(JobDescriptorImpl.class); final JobId jobId = mock(JobId.class); if (deadline.isPresent()) { when(jobId.value()).thenReturn("id " + jobPriority + deadline.get()); } else { when(jobId.value()).thenReturn("id " + jobPriority + " no date"); } when(job.getJobId()).thenReturn(jobId); final InternalJob internalJob = mock(InternalJob.class); when(job.getInternal()).thenReturn(internalJob); when(internalJob.getJobDeadline()).thenReturn(deadline); when(internalJob.getPriority()).thenReturn(jobPriority); final EligibleTaskDescriptor taskDescriptor0 = mock(EligibleTaskDescriptor.class); when(taskDescriptor0.getJobId()).thenReturn(jobId); final EligibleTaskDescriptor taskDescriptor1 = mock(EligibleTaskDescriptor.class); when(taskDescriptor1.getJobId()).thenReturn(jobId); when(job.getEligibleTasks()).thenReturn(Arrays.asList(taskDescriptor0, taskDescriptor1)); return job; }

Target:
private JobDescriptorImpl createJob(JobPriority jobPriority, Optional<Date> deadline) { final JobDescriptorImpl job = mock(JobDescriptorImpl.class); final JobId jobId = mock(JobId.class); when(jobId.value()).thenReturn("id " + jobPriority + deadline.map(Date::toString).orElse(" no deadline")); when(job.getJobId()).thenReturn(jobId); final InternalJob internalJob = mock(InternalJob.class); when(job.getInternal()).thenReturn(internalJob); when(internalJob.getJobDeadline()).thenReturn(deadline); when(internalJob.getPriority()).thenReturn(jobPriority); final EligibleTaskDescriptor taskDescriptor0 = mock(EligibleTaskDescriptor.class); when(taskDescriptor0.getJobId()).thenReturn(jobId); final EligibleTaskDescriptor taskDescriptor1 = mock(EligibleTaskDescriptor.class); when(taskDescriptor1.getJobId()).thenReturn(jobId); when(job.getEligibleTasks()).thenReturn(Arrays.asList(taskDescriptor0, taskDescriptor1)); return job; }
Source:
protected void addPermissionSubjectForAdminLevelProperties(List<PermissionSubject> permissionList) { VmStatic vmFromParams = getParameters().getVmStaticData(); VmTemplate vmTemplate = getVmTemplate(); if (vmFromParams != null && vmTemplate != null && !vmTemplate.isBlank()) { if (!Objects.equals(vmFromParams.getCustomProperties(), vmTemplate.getCustomProperties())) { permissionList.add(new PermissionSubject(getClusterId(), VdcObjectType.Cluster, ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES)); } Set<Guid> dedicatedVmForVdsFromUser = new HashSet<>(vmFromParams.getDedicatedVmForVdsList()); Set<Guid> dedicatedVmForVdsFromTemplate = new HashSet<>(vmTemplate.getDedicatedVmForVdsList()); if (!dedicatedVmForVdsFromUser.equals(dedicatedVmForVdsFromTemplate) || !StringUtils.isEmpty(vmFromParams.getCpuPinning())) { permissionList.add(new PermissionSubject(getClusterId(), VdcObjectType.Cluster, ActionGroup.EDIT_ADMIN_VM_PROPERTIES)); } } }

Target:
protected void addPermissionSubjectForAdminLevelProperties(List<PermissionSubject> permissionList) { VmStatic vmFromParams = getParameters().getVmStaticData(); VmTemplate vmTemplate = getVmTemplate(); if (vmFromParams != null && vmTemplate != null) { if (!Objects.equals(vmFromParams.getCustomProperties(), vmTemplate.getCustomProperties())) { permissionList.add(new PermissionSubject(getClusterId(), VdcObjectType.Cluster, ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES)); } if(vmTemplate.isBlank()){ return; } Set<Guid> dedicatedVmForVdsFromUser = new HashSet<>(vmFromParams.getDedicatedVmForVdsList()); Set<Guid> dedicatedVmForVdsFromTemplate = new HashSet<>(vmTemplate.getDedicatedVmForVdsList()); if (!dedicatedVmForVdsFromUser.equals(dedicatedVmForVdsFromTemplate) || !StringUtils.isEmpty(vmFromParams.getCpuPinning())) { permissionList.add(new PermissionSubject(getClusterId(), VdcObjectType.Cluster, ActionGroup.EDIT_ADMIN_VM_PROPERTIES)); } } }
Source:
public static ClientCompactQueryTuningConfig from( @Nullable UserCompactTuningConfig userCompactionTaskQueryTuningConfig, @Nullable Integer maxRowsPerSegment ) { return new ClientCompactQueryTuningConfig( maxRowsPerSegment, userCompactionTaskQueryTuningConfig == null ? null : userCompactionTaskQueryTuningConfig.getMaxRowsInMemory(), userCompactionTaskQueryTuningConfig == null ? null : userCompactionTaskQueryTuningConfig.getMaxBytesInMemory(), userCompactionTaskQueryTuningConfig == null ? null : userCompactionTaskQueryTuningConfig.getMaxTotalRows(), userCompactionTaskQueryTuningConfig == null ? null : userCompactionTaskQueryTuningConfig.getSplitHintSpec(), userCompactionTaskQueryTuningConfig == null ? null : userCompactionTaskQueryTuningConfig.getIndexSpec(), userCompactionTaskQueryTuningConfig == null ? null : userCompactionTaskQueryTuningConfig.getMaxPendingPersists(), userCompactionTaskQueryTuningConfig == null ? null : userCompactionTaskQueryTuningConfig.getPushTimeout(), userCompactionTaskQueryTuningConfig == null ? null : userCompactionTaskQueryTuningConfig.getMaxNumConcurrentSubTasks() ); }

Target:
public static ClientCompactQueryTuningConfig from( @Nullable UserCompactTuningConfig userCompactionTaskQueryTuningConfig, @Nullable Integer maxRowsPerSegment ) { if (userCompactionTaskQueryTuningConfig == null) { return new ClientCompactQueryTuningConfig( maxRowsPerSegment, null, null, null, null, null, null, null, null ); } else { return new ClientCompactQueryTuningConfig( maxRowsPerSegment, userCompactionTaskQueryTuningConfig.getMaxRowsInMemory(), userCompactionTaskQueryTuningConfig.getMaxBytesInMemory(), userCompactionTaskQueryTuningConfig.getMaxTotalRows(), userCompactionTaskQueryTuningConfig.getSplitHintSpec(), userCompactionTaskQueryTuningConfig.getIndexSpec(), userCompactionTaskQueryTuningConfig.getMaxPendingPersists(), userCompactionTaskQueryTuningConfig.getPushTimeout(), userCompactionTaskQueryTuningConfig.getMaxNumConcurrentSubTasks() ); } }
Source:
private <K, V> RemoteCache<K, V> getRemoteCache(HotRodServer hotRodServer) { org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder(); clientBuilder .marshaller(GenericJBossMarshaller.class) .addServer() .host("localhost") .port(hotRodServer.getPort()); RemoteCacheManager remoteCacheManager = new RemoteCacheManager(clientBuilder.build()); return remoteCacheManager.getCache(CACHE_NAME); }

Target:
private <K, V> RemoteCache<K, V> getRemoteCache(HotRodServer hotRodServer) { RemoteCacheManager remoteCacheManager = new RemoteCacheManager( HotRodClientTestingUtil.newRemoteConfigurationBuilder(hotRodServer) .marshaller(GenericJBossMarshaller.class) .build() ); return remoteCacheManager.getCache(CACHE_NAME); }