auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void processRedirectUrl(final WebView view, String url) { if (isBrokerRequest(getIntent())) { Logger.i(TAG, "It is a broker request", ""); displaySpinnerWithMessage(AuthenticationActivity.this .getText(AuthenticationActivity.this.getResources().getIdentifier( "broker_processing", "string", getPackageName()))); view.stopLoading(); new TokenTask(mWebRequestHandler, mAuthRequest, mCallingPackage, mCallingUID) .execute(url); return; } Logger.i(TAG, "It is not a broker request", ""); Intent resultIntent = new Intent(); resultIntent.putExtra(AuthenticationConstants.Browser.RESPONSE_FINAL_URL, url); resultIntent.putExtra(AuthenticationConstants.Browser.RESPONSE_REQUEST_INFO, mAuthRequest); returnToCaller(AuthenticationConstants.UIResponse.BROWSER_CODE_COMPLETE, resultIntent); view.stopLoading(); }

Target:
public void processRedirectUrl(final WebView view, String url) { if (!isBrokerRequest(getIntent())) { Logger.i(TAG, "It is not a broker request", ""); Intent resultIntent = new Intent(); resultIntent.putExtra(AuthenticationConstants.Browser.RESPONSE_FINAL_URL, url); resultIntent.putExtra(AuthenticationConstants.Browser.RESPONSE_REQUEST_INFO, mAuthRequest); returnToCaller(AuthenticationConstants.UIResponse.BROWSER_CODE_COMPLETE, resultIntent); view.stopLoading(); } else { Logger.i(TAG, "It is a broker request", ""); displaySpinnerWithMessage(AuthenticationActivity.this .getText(AuthenticationActivity.this.getResources().getIdentifier( "broker_processing", "string", getPackageName()))); view.stopLoading(); new TokenTask(mWebRequestHandler, mAuthRequest, mCallingPackage, mCallingUID) .execute(url); } }
Source:
public synchronized Endpoint getDefaultEndpoint(String uriScheme) throws IllegalArgumentException { if (null == uriScheme) { uriScheme = CoAP.COAP_URI_SCHEME; } if (!CoAP.isSupportedScheme(uriScheme)) { throw new IllegalArgumentException("URI scheme " + uriScheme + " not supported!"); } uriScheme = uriScheme.toLowerCase(); Endpoint endpoint = endpoints.get(uriScheme); if (null == endpoint) { endpoint = createDefaultEndpoint(uriScheme); } return endpoint; }

Target:
public synchronized Endpoint getDefaultEndpoint(String uriScheme) { if (null == uriScheme) { uriScheme = CoAP.COAP_URI_SCHEME; } if (!CoAP.isSupportedScheme(uriScheme)) { throw new IllegalArgumentException("URI scheme " + uriScheme + " not supported!"); } uriScheme = uriScheme.toLowerCase(); Endpoint endpoint = endpoints.get(uriScheme); if (null == endpoint) { endpoint = createDefaultEndpoint(uriScheme); } return endpoint; }
Source:
public SamzaMonitorService(SamzaRestConfig config, MetricsRegistry metricsRegistry) { this.config = config; this.metricsRegistry = metricsRegistry; scheduledExecutors = new ArrayList<>(); }

Target:
public SamzaMonitorService(SamzaRestConfig config, MetricsRegistry metricsRegistry) { this.config = config; this.metricsRegistry = metricsRegistry; this.scheduledExecutors = new ArrayList<>(); }
Source:
private Map<String, InterMineBag> filterBagsByType(Map<String, InterMineBag> bags, String type, boolean onlyCurrent, boolean includeSupers) { Set<String> classAndSubs = new HashSet<String>(); classAndSubs.add(type); ClassDescriptor bagTypeCld = model.getClassDescriptorByName(type); if (bagTypeCld == null) { throw new NullPointerException("Could not find ClassDescriptor for name " + type); } for (ClassDescriptor cld : model.getAllSubs(bagTypeCld)) { classAndSubs.add(cld.getUnqualifiedName()); } if( includeSupers ){ for (ClassDescriptor cld : bagTypeCld.getAllSuperDescriptors()) { classAndSubs.add(cld.getUnqualifiedName()); } } Map<String, InterMineBag> bagsOfType = new HashMap<String, InterMineBag>(); for (Map.Entry<String, InterMineBag> entry : bags.entrySet()) { InterMineBag bag = entry.getValue(); if (classAndSubs.contains(bag.getType())) { if ((onlyCurrent && bag.isCurrent()) || !onlyCurrent) { bagsOfType.put(entry.getKey(), bag); } } } return bagsOfType; }

Target:
private Map<String, InterMineBag> filterBagsByType(Map<String, InterMineBag> bags, String type, boolean onlyCurrent, boolean includeSupers) { Set<String> acceptableTypes = new HashSet<String>(); acceptableTypes.add(type); ClassDescriptor bagTypeCld = model.getClassDescriptorByName(type); if (bagTypeCld == null) { throw new NullPointerException("Could not find ClassDescriptor for name " + type); } for (ClassDescriptor cld : model.getAllSubs(bagTypeCld)) { acceptableTypes.add(cld.getUnqualifiedName()); } if (includeSupers) { for (ClassDescriptor cld : bagTypeCld.getAllSuperDescriptors()) { acceptableTypes.add(cld.getUnqualifiedName()); } } Map<String, InterMineBag> bagsOfType = new HashMap<String, InterMineBag>(); for (Map.Entry<String, InterMineBag> entry : bags.entrySet()) { InterMineBag bag = entry.getValue(); if (acceptableTypes.contains(bag.getType())) { if ((onlyCurrent && bag.isCurrent()) || !onlyCurrent) { bagsOfType.put(entry.getKey(), bag); } } } return bagsOfType; }
Source:
public SessionDatum getNeededDatum(Entry entry) { Vector<SessionDatum> allDatumsNeeded = entry.getSessionDataReqs(); OrderedHashtable datumsSoFar = getCollectedDatums(); if (datumsSoFar.size() >= allDatumsNeeded.size()) { return null; } return getFirstMissingDatum(datumsSoFar, allDatumsNeeded); }

Target:
public SessionDatum getNeededDatum(Entry entry) { return getFirstMissingDatum(getData(), entry.getSessionDataReqs()); }
Source:
protected Schema getSchema(String topic) { Schema schema; if (schemaSubjectOverride != null && !schemaSubjectOverride.isEmpty()) { schema = schemaRegistryClient.getSchema(schemaSubjectOverride); } else { try { schema = schemaRegistryClient.getSchema(topic); } catch (IllegalStateException exc) { topic += schemaSubjectSuffix; schema = schemaRegistryClient.getSchema(topic); } } return schema; }

Target:
protected Schema getSchema(String topic) { String subjectOverride = getSchemaSubjectOverride(topic); if (!subjectOverride.isEmpty()) { topic = subjectOverride; } else if (!schemaSubjectSuffix.isEmpty()) { topic += schemaSubjectSuffix; } return schemaRegistryClient.getSchema(topic); }
Source:
protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException { if (! hasProLicense()) { return; } Database database = liquibase.getDatabase(); LiquibaseCommand liquibaseCommand = (CommandFactory.getInstance().getCommand("rollbackOneChangeSet")); AbstractSelfConfiguratingCommand configuratingCommand = (AbstractSelfConfiguratingCommand)liquibaseCommand; Map<String, Object> argsMap = getCommandArgsObjectMap(liquibase); ChangeLogParameters clp = new ChangeLogParameters(database); argsMap.put("changeLogParameters", clp); if (force != null) { argsMap.put("force", Boolean.TRUE); } configuratingCommand.configure(argsMap); try { liquibaseCommand.execute(); } catch (CommandExecutionException cee) { throw new LiquibaseException("Error executing rollbackOneChangeSet", cee); } }

Target:
protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException { if (! hasProLicense()) { throw new LiquibaseException("The command 'rollbackOneChangeSet' requires a Liquibase Pro License, available at <LINK_0>"); } Database database = liquibase.getDatabase(); LiquibaseCommand liquibaseCommand = (CommandFactory.getInstance().getCommand("rollbackOneChangeSet")); AbstractSelfConfiguratingCommand configuratingCommand = (AbstractSelfConfiguratingCommand)liquibaseCommand; Map<String, Object> argsMap = getCommandArgsObjectMap(liquibase); ChangeLogParameters clp = new ChangeLogParameters(database); argsMap.put("changeLogParameters", clp); if (force == null || (force != null && ! Boolean.parseBoolean(force))) { throw new LiquibaseException("Invalid value for --force. You must specify 'liquibase.force=true' to use rollbackOneChangeSet."); } argsMap.put("force", Boolean.TRUE); argsMap.put("liquibase", liquibase); configuratingCommand.configure(argsMap); try { liquibaseCommand.execute(); } catch (CommandExecutionException cee) { throw new LiquibaseException("Error executing rollbackOneChangeSet", cee); } }
Source:
public IScheduledFuture<?> scheduleOnKeyOwnerAtFixedRate(@Nonnull Runnable command, @Nonnull Object key, long initialDelay, long period, @Nonnull TimeUnit unit) { checkNotNull(command, "Command is null"); checkNotNull(key, "Key is null"); checkNotNull(unit, "Unit is null"); initializeManagedContext(command); String name = extractNameOrGenerateOne(command); int partitionId = getKeyPartitionId(key); ScheduledRunnableAdapter<?> adapter = createScheduledRunnableAdapter(command); TaskDefinition definition = new TaskDefinition(TaskDefinition.Type.AT_FIXED_RATE, name, adapter, initialDelay, period, unit); return submitOnPartitionSync(name, new ScheduleTaskOperation(getName(), definition), partitionId); }

Target:
public <V> IScheduledFuture<V> scheduleOnKeyOwnerAtFixedRate(@Nonnull Runnable command, @Nonnull Object key, long initialDelay, long period, @Nonnull TimeUnit unit) { checkNotNull(command, "Command is null"); checkNotNull(key, "Key is null"); checkNotNull(unit, "Unit is null"); initializeManagedContext(command); String name = extractNameOrGenerateOne(command); int partitionId = getKeyPartitionId(key); ScheduledRunnableAdapter<?> adapter = createScheduledRunnableAdapter(command); TaskDefinition definition = new TaskDefinition(TaskDefinition.Type.AT_FIXED_RATE, name, adapter, initialDelay, period, unit); return submitOnPartitionSync(name, new ScheduleTaskOperation(getName(), definition), partitionId); }
Source:
private String requestTicketGrantingTicket(final String username, final String password) { HttpURLConnection connection = null; try { connection = HttpUtils.openConnection(endpointURL); final String payload = HttpUtils.encodeQueryParam("username", username) + "&" + HttpUtils.encodeQueryParam("password", password); final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream())); out.write(payload); out.close(); final String locationHeader = connection.getHeaderField("location"); final int responseCode = connection.getResponseCode(); if (locationHeader != null && responseCode == HttpStatus.SC_CREATED) { return locationHeader.substring(locationHeader.lastIndexOf("/") + 1); } throw new IllegalStateException("Ticket granting ticket request failed: " + HttpUtils.buildHttpErrorMessage(connection)); } catch (final IOException e) { throw new RuntimeException(e); } finally { HttpUtils.closeConnection(connection); } }

Target:
private String requestTicketGrantingTicket(final String username, final String password) { HttpURLConnection connection = null; try { connection = HttpUtils.openConnection(new URL(getCasRestUrl())); final String payload = HttpUtils.encodeQueryParam(getUsernameParameter(), username) + "&" + HttpUtils.encodeQueryParam(getPasswordParameter(), password); final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream())); out.write(payload); out.close(); final String locationHeader = connection.getHeaderField("location"); final int responseCode = connection.getResponseCode(); if (locationHeader != null && responseCode == HttpStatus.SC_CREATED) { return locationHeader.substring(locationHeader.lastIndexOf("/") + 1); } throw new TechnicalException("Ticket granting ticket request failed: " + locationHeader + " " + responseCode + HttpUtils.buildHttpErrorMessage(connection)); } catch (final IOException e) { throw new TechnicalException(e); } finally { HttpUtils.closeConnection(connection); } }
Source:
public void preprocess(DataSetLookup lookup) { if (identityProvider == null || userGroupCallback == null) { return; } ColumnFilter columnFilter; List<Comparable> orgEntities = new ArrayList<>(); if (lookup.getFirstFilterOp() != null) { List<String> potOwners = new ArrayList<String>(); List<CoreFunctionFilter> columnFilters = extractCoreFunctionFilter(lookup.getFirstFilterOp().getColumnFilterList()); Iterator<CoreFunctionFilter> it = columnFilters.iterator(); while (orgEntities.isEmpty() && it.hasNext()) { CoreFunctionFilter column = it.next(); if (column.getColumnId().toUpperCase().equals(columnId)) { potOwners.addAll(column.getParameters()); for (String potOwner : potOwners) { addUserAndGroupsFromIdentityProvider(orgEntities, potOwner); } } removeCoreFunctionFilter(lookup.getFirstFilterOp().getColumnFilterList(), column); } if (orgEntities.isEmpty()) { addUserAndGroupsFromIdentityProvider(orgEntities, identityProvider.getName()); } columnFilter = AND(in(COLUMN_POTOWNER, orgEntities)); lookup.getFirstFilterOp().addFilterColumn(columnFilter); } else { DataSetFilter filter = new DataSetFilter(); addUserAndGroupsFromIdentityProvider(orgEntities, identityProvider.getName()); columnFilter = AND(in(COLUMN_POTOWNER, orgEntities)); filter.addFilterColumn(columnFilter); lookup.addOperation(filter); } LOGGER.debug("Adding column filter: {}", columnFilter); super.preprocess(lookup); }

Target:
public void preprocess(DataSetLookup lookup) { if (identityProvider == null || userGroupCallback == null) { return; } ColumnFilter columnFilter; List<Comparable> orgEntities = new ArrayList<>(); if (lookup.getFirstFilterOp() != null) { List<String> potOwners = new ArrayList<String>(); List<CoreFunctionFilter> columnFilters = extractCoreFunctionFilter(lookup.getFirstFilterOp().getColumnFilterList()); Iterator<CoreFunctionFilter> it = columnFilters.iterator(); while (orgEntities.isEmpty() && it.hasNext()) { CoreFunctionFilter column = it.next(); if (column.getColumnId().toUpperCase().equals(columnId)) { potOwners.addAll(column.getParameters()); for (String potOwner : potOwners) { addUserAndGroupsFromIdentityProvider(orgEntities, potOwner); } removeCoreFunctionFilter(lookup.getFirstFilterOp().getColumnFilterList(), column); } } if (orgEntities.isEmpty()) { addUserAndGroupsFromIdentityProvider(orgEntities, identityProvider.getName()); } columnFilter = AND(in(COLUMN_POTOWNER, orgEntities)); lookup.getFirstFilterOp().addFilterColumn(columnFilter); } else { DataSetFilter filter = new DataSetFilter(); addUserAndGroupsFromIdentityProvider(orgEntities, identityProvider.getName()); columnFilter = AND(in(COLUMN_POTOWNER, orgEntities)); filter.addFilterColumn(columnFilter); lookup.addOperation(filter); } LOGGER.debug("Adding column filter: {}", columnFilter); super.preprocess(lookup); }
Source:
public void verifyKafkaRpcWithIcmpServiceDetection() throws Exception { DetectorsOnMinionIT.addRequisition(restClient, "MINION", LOCALHOST); await().atMost(3, MINUTES).pollInterval(15, SECONDS) .until(this::detectJdbcAtLocationMinion, containsString("'JDBC' WAS detected on localhost")); }

Target:
public void verifyKafkaRpcWithIcmpServiceDetection() throws Exception { DetectorsOnMinionIT.addRequisition(restClient, "MINION", LOCALHOST); await().atMost(3, MINUTES).pollInterval(15, SECONDS) .until(this::detectIcmpAtLocationMinion, containsString("'ICMP' WAS detected on 127.0.0.1")); }
Source:
public void testAdaptWithTable(){ int maxVersion = 1; GCRules.GCRule gcRule = GCRULES.maxVersions(maxVersion); ColumnFamily columnFamily = ColumnFamily.newBuilder() .setGcRule(gcRule.toProto()).build(); Table table = Table.fromProto(com.google.bigtable.admin.v2.Table.newBuilder() .setName(TABLE_NAME) .putColumnFamilies(COLUMN_FAMILY, columnFamily).build()); TableDescriptor actualTableDesc = tableAdapter2x.adapt(table); TableDescriptor expected = new HTableDescriptor(TableName.valueOf(TABLE_ID)) .addFamily(new HColumnDescriptor(COLUMN_FAMILY)); Assert.assertEquals(expected, actualTableDesc); }

Target:
public void testAdaptWithTable(){ int maxVersion = 1; GCRules.GCRule gcRule = GCRULES.maxVersions(maxVersion); ColumnFamily columnFamily = ColumnFamily.newBuilder() .setGcRule(gcRule.toProto()).build(); Table table = Table.newBuilder() .setName(TABLE_NAME) .putColumnFamilies(COLUMN_FAMILY, columnFamily).build(); TableDescriptor actualTableDesc = tableAdapter2x.adapt( com.google.cloud.bigtable.admin.v2.models.Table.fromProto(table)); TableDescriptor expected = new HTableDescriptor(TableName.valueOf(TABLE_ID)) .addFamily(new HColumnDescriptor(COLUMN_FAMILY)); Assert.assertEquals(expected, actualTableDesc); }
Source:
public void testGetCatalogEntityPlusVersionDetails() { CatalogEntitySummary details = client().resource( URI.create("/v1/catalog/entities/brooklyn.entity.nosql.redis.RedisStore:0.0.0.SNAPSHOT")) .get(CatalogEntitySummary.class); assertTrue(details.toString().contains("redis.port"), "expected more config, only got: "+details); String iconUrl = "/v1/catalog/icon/" + details.getSymbolicName(); assertTrue(details.getIconUrl().contains(iconUrl), "expected brooklyn URL for icon image, but got: "+details.getIconUrl()); }

Target:
public void testGetCatalogEntityPlusVersionDetails() { CatalogEntitySummary details = client().resource( URI.create("/v1/catalog/entities/brooklyn.entity.nosql.redis.RedisStore:0.0.0.SNAPSHOT")) .get(CatalogEntitySummary.class); assertTrue(details.toString().contains("redis.port"), "expected more config, only got: "+details); String expectedIconUrl = "/v1/catalog/icon/" + details.getSymbolicName() + "/" + details.getVersion(); assertEquals(details.getIconUrl(), expectedIconUrl, "expected brooklyn URL for icon image ("+expectedIconUrl+"), but got: "+details.getIconUrl()); }
Source:
private void startFileIngestProgressBar() { if (this.doUI) { synchronized (this.fileIngestProgressLock) { String displayName = NbBundle.getMessage(this.getClass(), "IngestJob.progress.fileIngest.displayName", getDataSourceName()); this.fileIngestProgress = ProgressHandle.createHandle(displayName, new Cancellable() { @Override public boolean cancel() { IngestJobPipeline.this.cancel(IngestJob.CancellationReason.USER_CANCELLED); return true; } }); this.fileIngestProgress.start(); this.fileIngestProgress.switchToDeterminate((int) this.estimatedFilesToProcess); } } }

Target:
private void startFileIngestProgressBar() { if (this.doUI) { synchronized (this.fileIngestProgressLock) { String displayName = NbBundle.getMessage(this.getClass(), "IngestJob.progress.fileIngest.displayName", this.dataSource.getName()); this.fileIngestProgress = ProgressHandle.createHandle(displayName, new Cancellable() { @Override public boolean cancel() { IngestJobPipeline.this.cancel(IngestJob.CancellationReason.USER_CANCELLED); return true; } }); this.fileIngestProgress.start(); this.fileIngestProgress.switchToDeterminate((int) this.estimatedFilesToProcess); } } }
Source:
public TokenTag(String token, String tag, String[] addtionalData) { this.token = token; this.tag = tag; this.addtionalData = addtionalData; }

Target:
public TokenTag(String token, String tag, String[] addtionalData) { this.token = token; this.tag = tag; if (addtionalData != null) { this.addtionalData = Arrays.copyOf(addtionalData, addtionalData.length); } else { this.addtionalData = null; } }
Source:
public E addEdge(V vertex, V targetVertex, Object... attributes) { final VertexInfo<V, E> outInfo = vertexOutMap.get(vertex); if (outInfo == null) { throw new IllegalArgumentException("no vertex " + vertex); } final VertexInfo<V, E> inInfo = vertexInMap.get(targetVertex); if (inInfo == null) { throw new IllegalArgumentException("no vertex " + targetVertex); } @SuppressWarnings("unchecked") final AttributedEdgeFactory<V, E> f = (AttributedEdgeFactory) this.edgeFactory; final E edge = f.createEdge(vertex, targetVertex, attributes); if (edges.add(edge)) { outInfo.edges.add(edge); inInfo.edges.add(edge); return edge; } else { return null; } }

Target:
public E addEdge(V vertex, V targetVertex, Object... attributes) { final VertexInfo<V, E> srcInfo = vertexMap.get(vertex); if (srcInfo == null) { throw new IllegalArgumentException("no vertex " + vertex); } final VertexInfo<V, E> dstInfo = vertexMap.get(targetVertex); if (dstInfo == null) { throw new IllegalArgumentException("no vertex " + targetVertex); } @SuppressWarnings("unchecked") final AttributedEdgeFactory<V, E> f = (AttributedEdgeFactory) this.edgeFactory; final E edge = f.createEdge(vertex, targetVertex, attributes); if (edges.add(edge)) { srcInfo.outEdges.add(edge); dstInfo.inEdges.add(edge); return edge; } else { return null; } }
Source:
public List<InputSplit> allocateWork(List<CamusRequest> requests, JobContext context) throws IOException { int numTasks = context.getConfiguration() .getInt("mapred.map.tasks", 30); List<InputSplit> kafkaETLSplits = new ArrayList<InputSplit>(); for (int i = 0; i < numTasks; i++) { if (requests.size() > 0) { kafkaETLSplits.add(new EtlSplit()); } } long avgSize = getAvgRequestSize(requests); Set<String> smallTopics = getSmallTopicList(requests, avgSize); List<CamusRequest> groupedRequests = groupSmallRequest(requests, smallTopics); reverseSortRequests(groupedRequests); for (CamusRequest r : requests) { EtlSplit split = getSmallestMultiSplit(kafkaETLSplits); if (r instanceof GroupedRequest){ for (CamusRequest r1 : (GroupedRequest)r) { split.addRequest(r1); } } else { split.addRequest(r); } } return kafkaETLSplits; }

Target:
public List<InputSplit> allocateWork(List<CamusRequest> requests, JobContext context) throws IOException { int numTasks = context.getConfiguration() .getInt("mapred.map.tasks", 30); List<InputSplit> kafkaETLSplits = new ArrayList<InputSplit>(); for (int i = 0; i < numTasks; i++) { if (requests.size() > 0) { kafkaETLSplits.add(new EtlSplit()); } } long avgSize = getAvgRequestSize(requests); List<CamusRequest> groupedRequests = groupSmallRequest(requests, avgSize); reverseSortRequests(groupedRequests); for (CamusRequest r : requests) { EtlSplit split = getSmallestMultiSplit(kafkaETLSplits); if (r instanceof GroupedRequest){ for (CamusRequest r1 : (GroupedRequest)r) { split.addRequest(r1); } } else { split.addRequest(r); } } return kafkaETLSplits; }
Source:
protected static Tick nextTick() { Calendar calendar = new GregorianCalendar(); calendar.setTimeInMillis(EnvironmentEdgeManager.currentTime()); int currentHour = calendar.get(Calendar.HOUR_OF_DAY); moveToNextHour(calendar); return new Tick(currentHour, calendar.getTimeInMillis()); }

Target:
static Tick nextTick() { Calendar calendar = new GregorianCalendar(); calendar.setTimeInMillis(EnvironmentEdgeManager.currentTime()); int currentHour = calendar.get(Calendar.HOUR_OF_DAY); moveToNextHour(calendar); return new Tick(currentHour, calendar.getTimeInMillis()); }
Source:
private static List<FormField> toFieldValueArray(List<FieldValue> valueArray, List<ReadResult> readResults) { return valueArray.stream() .map(fieldValue -> setFormField(fieldValue.getText(), null, fieldValue, readResults)) .collect(Collectors.toList()); }

Target:
private static List<FormField> toFieldValueArray(List<FieldValue> valueArray, List<ReadResult> readResults) { return valueArray.stream() .map(fieldValue -> { FieldData valueData = null; if (ARRAY != fieldValue.getType()) { valueData = new FieldData(fieldValue.getText(), toBoundingBox(fieldValue.getBoundingBox()), fieldValue.getPage() == null ? 1 : fieldValue.getPage(), setReferenceElements(fieldValue.getElements(), readResults)); } return setFormField(null, valueData, fieldValue, readResults); }) .collect(Collectors.toList()); }
Source:
public JdbcRecordCursor(JdbcClient jdbcClient, JdbcSplit split, List<JdbcColumnHandle> columnHandles) { this.columnHandles = requireNonNull(columnHandles, "columnHandles is null").stream() .toArray(JdbcColumnHandle[]::new); booleanReadFunctions = new BooleanReadFunction[this.columnHandles.length]; doubleReadFunctions = new DoubleReadFunction[this.columnHandles.length]; longReadFunctions = new LongReadFunction[this.columnHandles.length]; sliceReadFunctions = new SliceReadFunction[this.columnHandles.length]; for (int i = 0; i < this.columnHandles.length; i++) { ReadMapping readMapping = jdbcClient.toPrestoType(this.columnHandles[i].getJdbcTypeHandle()) .orElseThrow(() -> new IllegalStateException("Unsupported column type")); Class<?> javaType = readMapping.getType().getJavaType(); ReadFunction readFunction = readMapping.getReadFunction(); if (javaType == boolean.class) { booleanReadFunctions[i] = (BooleanReadFunction) readFunction; } else if (javaType == double.class) { doubleReadFunctions[i] = (DoubleReadFunction) readFunction; } else if (javaType == long.class) { longReadFunctions[i] = (LongReadFunction) readFunction; } else if (javaType == Slice.class) { sliceReadFunctions[i] = (SliceReadFunction) readFunction; } else { throw new IllegalStateException(format("Unsupported java type %s", javaType)); } } try { connection = jdbcClient.getConnection(split); statement = jdbcClient.buildSql(connection, split, columnHandles); log.debug("Executing: %s", statement.toString()); resultSet = statement.executeQuery(); } catch (SQLException | RuntimeException e) { throw handleSqlException(e); } }

Target:
public JdbcRecordCursor(JdbcClient jdbcClient, JdbcSplit split, List<JdbcColumnHandle> columnHandles) { this.columnHandles = columnHandles.toArray(new JdbcColumnHandle[0]); booleanReadFunctions = new BooleanReadFunction[columnHandles.size()]; doubleReadFunctions = new DoubleReadFunction[columnHandles.size()]; longReadFunctions = new LongReadFunction[columnHandles.size()]; sliceReadFunctions = new SliceReadFunction[columnHandles.size()]; for (int i = 0; i < this.columnHandles.length; i++) { ReadMapping readMapping = jdbcClient.toPrestoType(columnHandles.get(i).getJdbcTypeHandle()) .orElseThrow(() -> new VerifyException("Unsupported column type")); Class<?> javaType = readMapping.getType().getJavaType(); ReadFunction readFunction = readMapping.getReadFunction(); if (javaType == boolean.class) { booleanReadFunctions[i] = (BooleanReadFunction) readFunction; } else if (javaType == double.class) { doubleReadFunctions[i] = (DoubleReadFunction) readFunction; } else if (javaType == long.class) { longReadFunctions[i] = (LongReadFunction) readFunction; } else if (javaType == Slice.class) { sliceReadFunctions[i] = (SliceReadFunction) readFunction; } else { throw new IllegalStateException(format("Unsupported java type %s", javaType)); } } try { connection = jdbcClient.getConnection(split); statement = jdbcClient.buildSql(connection, split, columnHandles); log.debug("Executing: %s", statement.toString()); resultSet = statement.executeQuery(); } catch (SQLException | RuntimeException e) { throw handleSqlException(e); } }
Source:
public <T> T construct(Class<T> componentType) { if (!configuration.clustering().cacheMode().isClustered()) { return null; } else if (configuration.transaction().transactionMode().isTransactional() && configuration.transaction().transactionProtocol().isTotalOrder()) { return (T) new TotalOrderTxPerCacheInboundInvocationHandler(); } else if (configuration.transaction().transactionMode().isTransactional()){ return (T) new TxNonTotalOrderPerCacheInboundInvocationHandler(); } else { return (T) new NonTotalOrderPerCacheInboundInvocationHandler(); } }

Target:
public <T> T construct(Class<T> componentType) { if (!configuration.clustering().cacheMode().isClustered()) { return null; } else if (configuration.transaction().transactionMode().isTransactional()) { return configuration.transaction().transactionProtocol().isTotalOrder() ? (T) new TotalOrderTxPerCacheInboundInvocationHandler() : (T) new NonTotalOrderTxPerCacheInboundInvocationHandler(); } else { return (T) new NonTotalOrderPerCacheInboundInvocationHandler(); } }
Source:
private InstanceId createInstance(Spanner spanner) throws InterruptedException, ExecutionException { InstanceConfigId instanceConfig = InstanceConfigId.of(PROJECT_NAME, "emulator-config"); InstanceId instanceId = InstanceId.of(PROJECT_NAME, INSTANCE_NAME); InstanceAdminClient insAdminClient = spanner.getInstanceAdminClient(); Instance instance = insAdminClient.createInstance(InstanceInfo.newBuilder(instanceId).setInstanceConfigId(instanceConfig).build()).get(); System.out.println(">>>" + instance.getState()); return instanceId; }

Target:
private InstanceId createInstance(Spanner spanner) throws InterruptedException, ExecutionException { InstanceConfigId instanceConfig = InstanceConfigId.of(PROJECT_NAME, "emulator-config"); InstanceId instanceId = InstanceId.of(PROJECT_NAME, INSTANCE_NAME); InstanceAdminClient insAdminClient = spanner.getInstanceAdminClient(); Instance instance = insAdminClient.createInstance(InstanceInfo.newBuilder(instanceId).setNodeCount(1).setDisplayName("Test instance").setInstanceConfigId(instanceConfig).build()).get(); return instanceId; }
Source:
public void setupRoutes() { path(controllerPath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", this::verifyContentType); before("/*", this::verifyContentType); before(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); before(Routes.Stage.TRIGGER_FAILED_JOBS_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); before(Routes.Stage.TRIGGER_SELECTED_JOBS_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); before(Routes.Stage.TRIGGER_SELECTED_JOBS_PATH, mimeType, (req, res) -> { JsonReader requestBody = GsonTransformer.getInstance().jsonReaderFrom(req.body()); if (!requestBody.hasJsonObject(JOB_NAMES_PROPERTY)) { throw HaltApiResponses.haltBecauseOfReason(String.format("Could not read property '%s' in request body", JOB_NAMES_PROPERTY)); } requestBody.readStringArrayIfPresent(JOB_NAMES_PROPERTY); }); post(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, this::triggerStage); post(Routes.Stage.TRIGGER_FAILED_JOBS_PATH, mimeType, this::rerunFailedJobs); post(Routes.Stage.TRIGGER_SELECTED_JOBS_PATH, mimeType, this::rerunSelectedJobs); }); }

Target:
public void setupRoutes() { path(controllerPath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", this::verifyContentType); before("/*", this::verifyContentType); before(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); before(Routes.Stage.TRIGGER_FAILED_JOBS_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); before(Routes.Stage.TRIGGER_SELECTED_JOBS_PATH, mimeType, apiAuthenticationHelper::checkPipelineGroupOperateUserAnd403); post(Routes.Stage.TRIGGER_STAGE_PATH, mimeType, this::triggerStage); post(Routes.Stage.TRIGGER_FAILED_JOBS_PATH, mimeType, this::rerunFailedJobs); post(Routes.Stage.TRIGGER_SELECTED_JOBS_PATH, mimeType, this::rerunSelectedJobs); exception(RecordNotFoundException.class, this::notFound); }); }
Source:
public void testGetVmHostCount() throws Exception { Guid guid = Guid.createGuidFromString("b399944a-81ab-4ec5-8266-e19ba7c3c9d1"); List<VDSGroup> vdsGroups = new ArrayList<>(); vdsGroups.add(dao.get(guid)); List<VDSGroup> data = ((VdsGroupDAODbFacadeImpl) dao).getHostsAndVmsForClusters(vdsGroups); assertEquals("Incorrect number of VMs in cluster", data.get(0).getGroupHostsAndVms().getVms(), 11); assertEquals("Incorrect number of Hosts in cluster", data.get(0).getGroupHostsAndVms().getHosts(), 1); }

Target:
public void testGetVmHostCount() throws Exception { Guid guid = FixturesTool.VDS_GROUP_RHEL6_ISCSI; List<VDSGroup> vdsGroups = new ArrayList<>(); vdsGroups.add(dao.get(guid)); List<VDSGroup> data = ((VdsGroupDAODbFacadeImpl) dao).getHostsAndVmsForClusters(vdsGroups); assertEquals("Incorrect number of VMs in cluster", data.get(0).getGroupHostsAndVms().getVms(), 11); assertEquals("Incorrect number of Hosts in cluster", data.get(0).getGroupHostsAndVms().getHosts(), 1); }
Source:
public long count(String login, String loginPattern, Integer role, Integer status) { final CriteriaBuilder cb = criteriaBuilder(); final CriteriaQuery<User> criteria = cb.createQuery(User.class); final Root<User> from = criteria.from(User.class); final Predicate[] predicates = CriteriaHelper.userListPredicates(cb, from, ofNullable(login), ofNullable(loginPattern), ofNullable(role), ofNullable(status)); criteria.where(predicates); final TypedQuery<User> query = createQuery(criteria); return query.getResultList().size(); }

Target:
public long count(String login, String loginPattern, Integer role, Integer status) { final CriteriaBuilder cb = criteriaBuilder(); final CriteriaQuery<Long> criteria = cb.createQuery(Long.class); final Root<User> from = criteria.from(User.class); final Predicate[] predicates = CriteriaHelper.userListPredicates(cb, from, ofNullable(login), ofNullable(loginPattern), ofNullable(role), ofNullable(status)); criteria.where(predicates); criteria.select(cb.count(from)); return count(criteria); }
Source:
private void assertExecutionResults(Class<?> testClass, boolean nested) { EngineTestKit.engine("junit-jupiter") .selectors(selectClass(testClass)) .configurationParameter("junit.jupiter.conditions.deactivate", "org.junit.jupiter.engine.extension.DisabledCondition") .execute().tests() .assertStatistics(stats -> stats.started(nested ? 8 : 4).succeeded(nested ? 4 : 2).failed(nested ? 4 : 2)) .failed() .assertThatEvents().haveExactly(nested ? 2 : 1, event(test("multipleFailures"), finishedWithFailure(instanceOf(AssertJMultipleFailuresError.class), message(msg -> msg.contains("Multiple Failures (2 failures)"))))) .haveExactly(nested ? 2 : 1, event(test("parameterizedTest"), finishedWithFailure(instanceOf(AssertJMultipleFailuresError.class), message(msg -> msg.contains("Multiple Failures (1 failure)"))))); }

Target:
private void assertExecutionResults(Class<?> testClass, boolean nested) { EngineTestKit.engine("junit-jupiter") .selectors(selectClass(testClass)) .configurationParameter("junit.jupiter.conditions.deactivate", "*") .execute().tests() .assertStatistics(stats -> stats.started(nested ? 8 : 4).succeeded(nested ? 4 : 2).failed(nested ? 4 : 2)) .failed() .assertThatEvents().haveExactly(nested ? 2 : 1, event(test("multipleFailures"), finishedWithFailure(instanceOf(AssertJMultipleFailuresError.class), message(msg -> msg.contains("Multiple Failures (2 failures)"))))) .haveExactly(nested ? 2 : 1, event(test("parameterizedTest"), finishedWithFailure(instanceOf(AssertJMultipleFailuresError.class), message(msg -> msg.contains("Multiple Failures (1 failure)"))))); }
Source:
public boolean add(@NonNull Disposable disposable) { ObjectHelper.requireNonNull(disposable, "Disposable item is null"); if (!disposed) { synchronized (this) { if (!disposed) { OpenHashSet<Disposable> set = resources; if (set == null) { set = new OpenHashSet<Disposable>(); resources = set; } set.add(disposable); return true; } } } disposable.dispose(); return false; }

Target:
public boolean add(@NonNull Disposable disposable) { ObjectHelper.requireNonNull(disposable, "disposable is null"); if (!disposed) { synchronized (this) { if (!disposed) { OpenHashSet<Disposable> set = resources; if (set == null) { set = new OpenHashSet<Disposable>(); resources = set; } set.add(disposable); return true; } } } disposable.dispose(); return false; }
Source:
private SqlSingleOperandTypeChecker getChecker(SqlCallBinding callBinding) { final RelDataType operandType = callBinding.getOperandType(0); switch (operandType.getSqlTypeName()) { case ARRAY: return OperandTypes.family(SqlTypeFamily.INTEGER); case MAP: return OperandTypes.family( operandType.getKeyType().getSqlTypeName().getFamily()); case ROW: return OperandTypes.STRING; case ANY: case DYNAMIC_STAR: return OperandTypes.or( OperandTypes.family(SqlTypeFamily.INTEGER), OperandTypes.family(SqlTypeFamily.CHARACTER)); default: throw callBinding.newValidationSignatureError(); } }

Target:
private SqlSingleOperandTypeChecker getChecker(SqlCallBinding callBinding) { final RelDataType operandType = callBinding.getOperandType(0); switch (operandType.getSqlTypeName()) { case ARRAY: return OperandTypes.family(SqlTypeFamily.INTEGER); case MAP: return OperandTypes.family( operandType.getKeyType().getSqlTypeName().getFamily()); case ROW: return OperandTypes.CHARACTER; case ANY: case DYNAMIC_STAR: return OperandTypes.or( OperandTypes.family(SqlTypeFamily.INTEGER), OperandTypes.family(SqlTypeFamily.CHARACTER)); default: throw callBinding.newValidationSignatureError(); } }
Source:
public void onRollback() { log.debug("Rollback occured, releasing macs {}.", Arrays.toString(super.macs.toArray())); releaseMacs(); }

Target:
public void onRollback() { log.debug("Rollback occurred, releasing macs {}.", super.macs); releaseMacs(); }
Source:
int maybeCommitPerUserRequested() { int committed = 0; RuntimeException firstException = null; for (final StreamTask task : running.values()) { try { if (task.commitRequested() && task.commitNeeded()) { task.commit(); committed++; log.debug("Committed active task per user request in", task.id()); } } catch (final TaskMigratedException e) { log.info("Failed to commit since it got migrated to another thread already. " + "Will trigger a new rebalance and close all tasks as zombies together.", task.id()); throw e; } catch (final RuntimeException t) { log.error("Failed to commit StreamTask due to the following error:", task.id(), t); if (firstException == null) { firstException = t; } } } if (firstException != null) { throw firstException; } return committed; }

Target:
int maybeCommitPerUserRequested() { int committed = 0; RuntimeException firstException = null; for (final StreamTask task : running.values()) { try { if (task.commitRequested() && task.commitNeeded()) { task.commit(); committed++; log.debug("Committed stream task per user request in", task.id()); } } catch (final TaskMigratedException e) { log.info("Failed to commit stream task since it got migrated to another thread already. " + "Will trigger a new rebalance and close all tasks as zombies together.", task.id()); throw e; } catch (final RuntimeException t) { log.error("Failed to commit stream task due to the following error:", task.id(), t); if (firstException == null) { firstException = t; } } } if (firstException != null) { throw firstException; } return committed; }
Source:
public LinuxSensors() { for (String sensor : SENSORS) { final String sensorPrefix = sensor; getSensorFilesFromPath(HWMON, sensor, new FileFilter() { @Override public boolean accept(File f) { try { return f.getName().startsWith(sensorPrefix) && f.getName().endsWith("_input") && FileUtil.getIntFromFile(f.getCanonicalPath()) > 0; } catch(Exception e) { return false; } } }); } if (!this.sensorsMap.containsKey(TEMP)) { getSensorFilesFromPath(THERMAL_ZONE, TEMP, new FileFilter() { @Override public boolean accept(File f) { return f.getName().equals(TEMP); } }); } }

Target:
public LinuxSensors() { for (String sensor : SENSORS) { final String sensorPrefix = sensor; getSensorFilesFromPath(HWMON, sensor, new FileFilter() { @Override public boolean accept(File f) { try { return f.getName().startsWith(sensorPrefix) && f.getName().endsWith("_input") && FileUtil.getIntFromFile(f.getCanonicalPath()) > 0; } catch (IOException e) { return false; } } }); } if (!this.sensorsMap.containsKey(TEMP)) { getSensorFilesFromPath(THERMAL_ZONE, TEMP, new FileFilter() { @Override public boolean accept(File f) { return f.getName().equals(TEMP); } }); } }
Source:
public boolean equals(Object other) { if (other == this) { return true; } else if (other instanceof AggregateMetadata) { AggregateMetadata that = (AggregateMetadata) other; return Objects.equals(this.keyspace, that.getKeyspace()) && Objects.equals(this.signature, that.getSignature()) && Objects.equals(this.finalFuncSignature, that.getFinalFuncSignature().orElse(null)) && Objects.equals(this.initCond, that.getInitCond()) && Objects.equals(this.returnType, that.getReturnType()) && Objects.equals(this.stateFuncSignature, that.getStateFuncSignature()) && Objects.equals(this.stateType, that.getStateType()); } else { return false; } }

Target:
public boolean equals(Object other) { if (other == this) { return true; } else if (other instanceof AggregateMetadata) { AggregateMetadata that = (AggregateMetadata) other; return Objects.equals(this.keyspace, that.getKeyspace()) && Objects.equals(this.signature, that.getSignature()) && Objects.equals(this.finalFuncSignature, that.getFinalFuncSignature().orElse(null)) && Objects.equals(this.initCond, that.getInitCond().orElse(null)) && Objects.equals(this.returnType, that.getReturnType()) && Objects.equals(this.stateFuncSignature, that.getStateFuncSignature()) && Objects.equals(this.stateType, that.getStateType()); } else { return false; } }
Source:
public Mapping<String, V> build() { return new ImmutableDomainWildcardMapping<V>(defaultValue, new LinkedHashMap<String, V>(map)); }

Target:
public Mapping<String, V> build() { return new ImmutableDomainWildcardMapping<V>(defaultValue, map); }
Source:
RequestSpec sslContext(Factory<SSLContext> factory) throws Exception; MutableHeaders getHeaders(); RequestSpec headers(Action<? super MutableHeaders> action) throws Exception; RequestSpec method(String method); URI getUrl(); default RequestSpec readTimeoutSeconds(int seconds) { return readTimeout(Duration.of(seconds, SECONDS)); }

Target:
default RequestSpec sslContext(Factory<SSLContext> factory) throws Exception { return sslContext(factory.create()); }
Source:
public void shouldReturnDifferentResourceVariant() throws Exception { String fileName = "Main.java"; File file = testRepo.createFile(iProject, fileName); testRepo.appendContentAndCommit(iProject, file, "class Main {}", "initial commit"); IFile mainJava = testRepo.getIFile(iProject, file); testRepo.createAndCheckoutBranch(Constants.R_HEADS + Constants.MASTER, Constants.R_HEADS + "test"); testRepo.appendContentAndCommit(iProject, file, " GitSynchronizeData data = new GitSynchronizeData(repo, Constants.HEAD, Constants.MASTER, false); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); GitResourceVariantTree grvt = new GitRemoteResourceVariantTree(dataSet); IResourceVariant actual = grvt.getResourceVariant(mainJava); assertNotNull(actual); assertEquals(fileName, actual.getName()); InputStream actualIn = actual.getStorage(new NullProgressMonitor()) .getContents(); byte[] actualByte = new byte[actualIn.available()]; actualIn.read(actualByte); InputStream expectedIn = mainJava.getContents(); byte[] expectedByte = new byte[expectedIn.available()]; expectedIn.read(expectedByte); if (Arrays.equals(expectedByte, actualByte)) fail(); else assertTrue(true); }

Target:
public void shouldReturnDifferentResourceVariant() throws Exception { String fileName = "Main.java"; File file = testRepo.createFile(iProject, fileName); testRepo.appendContentAndCommit(iProject, file, "class Main {}", "initial commit"); IFile mainJava = testRepo.getIFile(iProject, file); testRepo.createAndCheckoutBranch(Constants.R_HEADS + Constants.MASTER, Constants.R_HEADS + "test"); testRepo.appendContentAndCommit(iProject, file, " GitSynchronizeData data = new GitSynchronizeData(repo, Constants.HEAD, Constants.MASTER, false); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); GitResourceVariantTree grvt = new GitRemoteResourceVariantTree(dataSet); IResourceVariant actual = grvt.getResourceVariant(mainJava); assertNotNull(actual); assertEquals(fileName, actual.getName()); InputStream actualIn = actual.getStorage(new NullProgressMonitor()) .getContents(); byte[] actualByte = getBytesAndCloseStream(actualIn); InputStream expectedIn = mainJava.getContents(); byte[] expectedByte = getBytesAndCloseStream(expectedIn); if (Arrays.equals(expectedByte, actualByte)) fail(); else assertTrue(true); }
Source:
public void generateDiskDescriptionWhenDescriptionIsCompletelyTruncated() throws IOException { String alias = generateRandomString(194); disk.setDiskAlias(alias); disk.setDiskDescription("DiskDescription"); assertDiskDescriptionMap(disk, generateDiskAliasJsonEntry(alias)); }

Target:
public void generateDiskDescriptionWhenDescriptionIsCompletelyTruncated() throws IOException { String alias = generateRandomString(DISK_ALIAS_MAX_LENGTH); disk.setDiskAlias(alias); disk.setDiskDescription("DiskDescription"); assertDiskDescriptionMap(disk, generateDiskAliasJsonEntry(alias)); }
Source:
protected boolean isConnWithSameDetailsExists(StorageServerConnections connection, Guid storagePoolId) { List<StorageServerConnections> connections = null; connections = getConnWithSameDetailsExists(connection, storagePoolId); if (connections == null) { return false; } boolean isDuplicateConnExists = connections.size() > 1 || (connections.size() == 1 && !connections.get(0).getId().equalsIgnoreCase(connection.getId())); return isDuplicateConnExists; }

Target:
protected String isConnWithSameDetailsExists(StorageServerConnections connection, Guid storagePoolId) { List<StorageServerConnections> connections = null; if (connection.getStorageType() == StorageType.LOCALFS) { List<StorageServerConnections> connectionsForPool = storagePoolId == null ? Collections.emptyList() : storageServerConnectionDao.getAllConnectableStorageSeverConnection(storagePoolId); List<StorageServerConnections> connectionsForPath = storageServerConnectionDao.getAllForStorage(connection.getConnection()); connections = (List<StorageServerConnections>) CollectionUtils.intersection(connectionsForPool, connectionsForPath); } else if (connection.getStorageType().isFileDomain()) { String connectionField = connection.getConnection(); connections = storageServerConnectionDao.getAllForStorage(connectionField); } else { StorageServerConnections sameConnection = iscsiStorageHelper.findConnectionWithSameDetails(connection); connections = sameConnection != null ? Collections.singletonList(sameConnection) : Collections.emptyList(); } return (connections != null && connections.size() == 1 && connections.get(0) != null) ? connections.get(0).getId() : ""; }
Source:
@Override public void attach(Linker linker) { String requiredBy = type.getQualifiedName().toString(); for (int i = 0; i < keys.size(); i++) { bindings[i] = linker.requestBinding(keys.get(i), requiredBy); } if (supertypeKey != null) { linker.requestBinding(supertypeKey, requiredBy, false, true); } }

Target:
@Override public void attach(Linker linker) { String requiredBy = type.getQualifiedName().toString(); for (int i = 0; i < keys.size(); i++) { bindings[i] = linker.requestBinding(keys.get(i), requiredBy, getClass().getClassLoader()); } if (supertypeKey != null) { linker.requestBinding(supertypeKey, requiredBy, getClass().getClassLoader(), false, true); } }
Source:
public ParsedIteratorConfig getParsedIteratorConfig(IteratorScope scope) { long count = getUpdateCount(); AtomicReference<ParsedIteratorConfig> ref = iteratorConfig.get(scope); ParsedIteratorConfig pic = ref.get(); if (pic == null || pic.updateCount != count) { Map<String,Map<String,String>> allOpts = new HashMap<>(); List<IterInfo> iters = IterConfigUtil.parseIterConf(scope, new ArrayList<>(), allOpts, this); ParsedIteratorConfig newPic = new ParsedIteratorConfig(iters, allOpts, get(Property.TABLE_CLASSPATH), count); ref.compareAndSet(pic, newPic); pic = newPic; } return pic; }

Target:
public ParsedIteratorConfig getParsedIteratorConfig(IteratorScope scope) { long count = getUpdateCount(); AtomicReference<ParsedIteratorConfig> ref = iteratorConfig.get(scope); ParsedIteratorConfig pic = ref.get(); if (pic == null || pic.updateCount != count) { Map<String,Map<String,String>> allOpts = new HashMap<>(); List<IterInfo> iters = IterConfigUtil.parseIterConf(scope, Collections.emptyList(), allOpts, this); ParsedIteratorConfig newPic = new ParsedIteratorConfig(iters, allOpts, get(Property.TABLE_CLASSPATH), count); ref.compareAndSet(pic, newPic); pic = newPic; } return pic; }
Source:
public static IJavaElement resolveJavaElement(Object object, ILaunch launch) throws CoreException { Object sourceElement = resolveSourceElement(object, launch); IJavaElement javaElement = getJavaElement(sourceElement); if (javaElement == null) { sourceElement = resolveSourceElement(object, JAVA_STRATUM, launch); if (sourceElement != null) javaElement = getJavaElement(sourceElement); } return javaElement; }

Target:
public static IJavaElement resolveJavaElement(Object object, ILaunch launch) throws CoreException { Object sourceElement = resolveSourceElement(object, launch); IJavaElement javaElement = getJavaElement(sourceElement); if (javaElement == null) { sourceElement = resolveSourceElement(object, JAVA_STRATUM, launch); javaElement = getJavaElement(sourceElement); } return javaElement; }
Source:
private static Set<Integer> extractCpuSet(Map<String, Object> parameters) { Object cpus = parameters.get(CPUS_PARAMETER_KEY); if (cpus instanceof Collection<?>) { Set<Integer> cpuSet = new HashSet<>(); if (!((Collection<?>) cpus).isEmpty()) { for (Integer cpu : (Collection<Integer>) cpus) { cpuSet.add(cpu); } } return cpuSet; } return Collections.emptySet(); }

Target:
private static Set<Integer> extractCpuSet(Map<String, Object> parameters) { Object cpus = parameters.get(CPUS_PARAMETER_KEY); if (cpus instanceof Collection<?>) { return ((Collection<?>) cpus).stream().filter(cpu -> cpu instanceof Integer) .map(cpu -> (Integer) cpu) .collect(Collectors.toSet()); } return Collections.emptySet(); }