auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void unblockCommands() { for (Iterator<CompletableFuture<Void>> delayedEvent = delayedEvents.iterator(); delayedEvent.hasNext(); ) { CompletableFuture<Void> cf = delayedEvent.next(); delayedEvent.remove(); cf.complete(null); } }

Target:
private void unblockCommands() { for (Iterator<CompletableFuture<Void>> delayedEventIter = delayedEvents.iterator(); delayedEventIter.hasNext(); ) { CompletableFuture<Void> cf = delayedEventIter.next(); delayedEventIter.remove(); cf.complete(null); } }
Source:
public String shell(String cmd) { CommandOutputCapture capture = new CommandOutputCapture(); try { device.executeShellCommand(cmd, capture); } catch (TimeoutException e) { LOG.log(Level.SEVERE, "Error executing command: " + cmd, e); return null; } catch (ShellCommandUnresponsiveException e) { LOG.log(Level.SEVERE, "Error executing command: " + cmd, e); return null; } catch (AdbCommandRejectedException e) { LOG.log(Level.SEVERE, "Error executing command: " + cmd, e); return null; } catch (IOException e) { LOG.log(Level.SEVERE, "Error executing command: " + cmd, e); return null; } return capture.toString(); }

Target:
public String shell(String cmd) { return shell(cmd, 5000); }
Source:
public void provisionInputWithPathSpaces() { File helloWDL = new File(ResourceHelpers.resourceFilePath("helloSpaces.wdl")); File helloJSON = new File(ResourceHelpers.resourceFilePath("helloSpaces.json")); ArrayList<String> args = new ArrayList<String>() {{ add("--local-entry"); add("--json"); add(helloJSON.getPath()); }}; WorkflowsApi api = mock(WorkflowsApi.class); UsersApi usersApi = mock(UsersApi.class); Client client = new Client(); client.setConfigFile(ResourceHelpers.resourceFilePath("config")); WorkflowClient workflowClient = new WorkflowClient(api, usersApi, client, false); workflowClient.checkEntryFile(helloWDL.getAbsolutePath(), args, null); assertTrue("output should include a successful cromwell run", systemOutRule.getLog().contains("Cromwell exit code: 0")); }

Target:
public void provisionInputWithPathSpaces() { File helloWDL = new File(ResourceHelpers.resourceFilePath("helloSpaces.wdl")); File helloJSON = new File(ResourceHelpers.resourceFilePath("helloSpaces.json")); ArrayList<String> args = new ArrayList<String>() {{ add("workflow"); add("launch"); add("--local-entry"); add(helloWDL.getAbsolutePath()); add("--json"); add(helloJSON.getPath()); }}; File config = new File(ResourceHelpers.resourceFilePath("clientConfig")); runClientCommandConfig(args, config); assertTrue("output should include a successful cromwell run", systemOutRule.getLog().contains("Cromwell exit code: 0")); }
Source:
static Consumer<List<BatchElement<Integer, TimestampRange>>> consumer(TimestampService delegate) { return batch -> { long totalTimestamps = batch.stream().mapToLong(BatchElement::argument).reduce(0, Math::addExact); long startInclusive = 0; long endExclusive = 0; for (BatchElement<Integer, TimestampRange> element : batch) { int timestampsRequired = element.argument(); if (element.argument() == 0) { element.result().setException(new IllegalArgumentException("Cannot ask for 0 timestamps")); } else if (element.argument() <= endExclusive - startInclusive) { element.result().set(createExclusiveRange(startInclusive, startInclusive + timestampsRequired)); startInclusive += timestampsRequired; totalTimestamps -= timestampsRequired; } else { TimestampRange requested = getFreshTimestampsFromDelegate( delegate, Ints.saturatedCast(totalTimestamps)); startInclusive = requested.getLowerBound(); endExclusive = Math.addExact(requested.getUpperBound(), 1); int toTake = Math.min(Ints.checkedCast(endExclusive - startInclusive), timestampsRequired); element.result().set(createExclusiveRange(startInclusive, startInclusive + toTake)); startInclusive += toTake; totalTimestamps -= timestampsRequired; } } }; }

Target:
static Consumer<List<BatchElement<Integer, TimestampRange>>> consumer(TimestampService delegate) { return batch -> { long totalTimestamps = batch.stream().mapToLong(BatchElement::argument).reduce(0, Math::addExact); long startInclusive = 0; long endExclusive = 0; for (BatchElement<Integer, TimestampRange> element : batch) { int timestampsRequired = element.argument(); if (element.argument() <= endExclusive - startInclusive) { element.result().set(createExclusiveRange(startInclusive, startInclusive + timestampsRequired)); startInclusive += timestampsRequired; totalTimestamps -= timestampsRequired; } else { TimestampRange requested = getFreshTimestampsFromDelegate( delegate, Ints.saturatedCast(totalTimestamps)); startInclusive = requested.getLowerBound(); endExclusive = Math.addExact(requested.getUpperBound(), 1); int toTake = Math.min(Ints.checkedCast(endExclusive - startInclusive), timestampsRequired); element.result().set(createExclusiveRange(startInclusive, startInclusive + toTake)); startInclusive += toTake; totalTimestamps -= timestampsRequired; } } }; }
Source:
private void createVolumeProfileDoc() throws DocumentException, IOException { createPdf = new CreatePdf(); ExportData exportData = getParameters().getExportData(); String userId = getParameters().getUserId(); GlusterVolumeProfileInfo profileInfo = getParameters().getProfileInfo(); String filePath = getParameters().getFilePath(); Date today = new Date(); if(filePath == null || filePath.isEmpty()) { filePath = "/home/ababu/" + getGlusterVolumeDao().getById(profileInfo.getVolumeId()).getName() + "-" + exportData.toString()+ "-" + today.getTime() + ".pdf"; } try { Document document = new Document(); PdfWriter.getInstance(document, new FileOutputStream(filePath)); document.open(); createPdf.addMetaData(document, createMetaData(getGlusterVolumeDao().getById(profileInfo.getVolumeId()).getName(), userId)); addContent(document, profileInfo, exportData); document.close(); setSucceeded(true); VdcReturnValueBase returnValue = new VdcReturnValueBase(); returnValue.setDescription("Pdf Saved"); returnValue.setSucceeded(true); setActionReturnValue(returnValue); } catch (Exception e) { setSucceeded(false); setActionReturnValue(e.toString()); } }

Target:
private void createVolumeProfileDoc() throws DocumentException, IOException { createPdf = new CreatePdf(); ExportData exportData = getParameters().getExportData(); String userId = getParameters().getUserId(); GlusterVolumeProfileInfo profileInfo = getParameters().getProfileInfo(); try { Document document = new Document(); ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); PdfWriter.getInstance(document, byteStream); document.open(); createPdf.addMetaData(document, createMetaData(getGlusterVolumeDao().getById(profileInfo.getVolumeId()).getName(), userId)); addContent(document, profileInfo, exportData); document.close(); setSucceeded(true); VdcReturnValueBase returnValue = new VdcReturnValueBase(); returnValue.setDescription("Pdf Saved"); returnValue.setSucceeded(true); setActionReturnValue(byteStream.toByteArray()); } catch (Exception e) { setSucceeded(false); setActionReturnValue(e.toString()); } }
Source:
public void copy(INDArray x, INDArray y) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, x, y); if(x.isSparse() || y.isSparse()){ Nd4j.getSparseBlasWrapper().level1().copy(x, y); } if (x.data().dataType() == DataBuffer.Type.DOUBLE) { DefaultOpExecutioner.validateDataType(DataBuffer.Type.DOUBLE, x, y); dcopy(x.length(), x, BlasBufferUtil.getBlasStride(x), y, BlasBufferUtil.getBlasStride(y)); } else { DefaultOpExecutioner.validateDataType(DataBuffer.Type.FLOAT, x, y); scopy(x.length(), x, BlasBufferUtil.getBlasStride(x), y, BlasBufferUtil.getBlasStride(y)); } }

Target:
public void copy(INDArray x, INDArray y) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, x, y); if (x.isSparse() || y.isSparse()) { Nd4j.getSparseBlasWrapper().level1().copy(x, y); return; } if (x.data().dataType() == DataBuffer.Type.DOUBLE) { DefaultOpExecutioner.validateDataType(DataBuffer.Type.DOUBLE, x, y); dcopy(x.length(), x, BlasBufferUtil.getBlasStride(x), y, BlasBufferUtil.getBlasStride(y)); } else { DefaultOpExecutioner.validateDataType(DataBuffer.Type.FLOAT, x, y); scopy(x.length(), x, BlasBufferUtil.getBlasStride(x), y, BlasBufferUtil.getBlasStride(y)); } }
Source:
public void deleteRecording(final String callID, final String legID, final String recordingID) throws NotFoundException, GeneralException, UnauthorizedException { String url = String.format( "%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, callID, LEGSPATH, legID, RECORDINGPATH ); messageBirdService.deleteByID(url, recordingID); }

Target:
public void deleteRecording(final String callID, final String legID, final String recordingID) throws NotFoundException, GeneralException, UnauthorizedException { if (callID == null) { throw new IllegalArgumentException("Call ID must be specified."); } if (legID == null) { throw new IllegalArgumentException("Leg ID must be specified."); } if (recordingID == null) { throw new IllegalArgumentException("Recording ID must be specified."); } String url = String.format( "%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, callID, LEGSPATH, legID, RECORDINGPATH ); messageBirdService.deleteByID(url, recordingID); }
Source:
private void buildStatisticsTree(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; fTimeRange = timeRange; } else { updateJobs = fUpdateJobsPartial; fTimeRangePartial = timeRange; } synchronized (statsData) { for (final ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = aTrace.getAnalysisModuleOfClass(TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new UpdateJob("Statistics update", aTrace, isGlobal, statsMod); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } } }

Target:
private void buildStatisticsTree(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; fTimeRange = timeRange; } else { updateJobs = fUpdateJobsPartial; fTimeRangePartial = timeRange; } for (final ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = aTrace.getAnalysisModuleOfClass(TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new UpdateJob("Statistics update", aTrace, isGlobal, statsMod); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } }
Source:
public static synchronized void setEnabled(boolean enabled) { ENABLED = enabled && isEventLoggingEnabled(); if (ENABLED) { OutputBuffer.sendAllScheduled(); } }

Target:
public static synchronized void setEnabled(boolean enabled) { ENABLED = enabled; if (ENABLED) { OutputBuffer.sendAllScheduled(); } }
Source:
@Override public void init() { localInputSource = Objects.equals(System.getenv("HYDRA_JOBID"), jobId); if (!localInputSource) { throw new IllegalStateException("At this time only queries to ${hydra.task.jobid} are supported"); } if (fields != null) { fieldsIn = new IndexField[fields.length]; fieldsOut = new AutoField[fields.length]; for (int i = 0; i < fields.length; i++) { fieldsIn[i] = new IndexField(i); fieldsOut[i] = AutoField.newAutoField(fields[i]); } } try { File dir = Paths.get(treeDir).toFile(); tempDir = Files.createTempDir(); queryEngine = new QueryEngineSourceSingle(new ReadTree(dir)); Query query = new Query(jobId, new String[] {path}, null); QueryOpProcessor proc = new QueryOpProcessor.Builder(this, new String[]{ops}) .tempDir(tempDir).build(); queryHandle = queryEngine.query(query, proc); } catch (Exception ex) { throw Throwables.propagate(ex); } }

Target:
@Override public void init() { super.init(); localInputSource = (jobId == null); if (!localInputSource) { throw new UnsupportedOperationException("At this time only local queries are supported"); } try { File dir = Paths.get(treeDir).toFile(); tempDir = LessFiles.createTempDir(); queryEngine = new QueryEngineSourceSingle(new ReadTree(dir)); Query query = new Query(config.jobId, new String[] {path}, null); QueryOpProcessor proc = new QueryOpProcessor.Builder(this, new String[]{ops}) .tempDir(tempDir).build(); queryHandle = queryEngine.query(query, proc); initialized.countDown(); localInitialized = true; } catch (Exception ex) { throw Throwables.propagate(ex); } }
Source:
public void notAccruedTest() { ZonedDateTime valuationDate = DateUtils.getUTCDate(2013, 8, 10); SwapFixedCoupon<Coupon> fixedCouponSwap = SWAP_FIXED_3M_S_DEFINITION.toDerivative(valuationDate, TS_ARRAY_USDLIBOR3M); MulticurveProviderDiscount multicurve = MULTICURVE_SET[1]; Calendar calendar = USD6MLIBOR3M.getCalendar(); DayCount dcIbor = USD6MLIBOR3M.getIborIndex().getDayCount(); DayCount dcFixed = USD6MLIBOR3M.getFixedLegDayCount(); double parRate = CPRC.parRate(SWAP_FIXED_3M_S_DEFINITION, dcFixed, dcIbor, calendar, valuationDate, TS_USDLIBOR3M, multicurve); double accruedInterest = CPRC.accruedInterest(SWAP_FIXED_3M_S_DEFINITION, dcFixed, dcIbor, calendar, valuationDate, TS_USDLIBOR3M, multicurve).getAmount(Currency.USD); double refParRate = fixedCouponSwap.accept(PRDC, multicurve); assertRelative("", refParRate, parRate, TOL); assertRelative("", 0.0, accruedInterest, TOL); }

Target:
public void notAccruedTest() { ZonedDateTime valuationDate = DateUtils.getUTCDate(2013, 8, 10); for (SwapFixedIborDefinition swapDefinition : new SwapFixedIborDefinition[] {SWAP_FIXED_3M_PAY_DEFINITION, SWAP_FIXED_3M_REC_DEFINITION_ }) { SwapFixedCoupon<Coupon> fixedCouponSwap = swapDefinition.toDerivative(valuationDate, TS_ARRAY_USDLIBOR3M); MulticurveProviderDiscount multicurve = MULTICURVE_SET[1]; Calendar calendar = USD6MLIBOR3M.getCalendar(); DayCount dcIbor = USD6MLIBOR3M.getIborIndex().getDayCount(); DayCount dcFixed = USD6MLIBOR3M.getFixedLegDayCount(); double parRate = CPRC.parRate(swapDefinition, dcFixed, dcIbor, calendar, valuationDate, TS_USDLIBOR3M, multicurve); double accruedInterest = CPRC.accruedInterest(swapDefinition, dcFixed, dcIbor, calendar, valuationDate, TS_USDLIBOR3M, multicurve).getAmount(Currency.USD); double refParRate = fixedCouponSwap.accept(PRDC, multicurve); assertRelative("notAccruedTest", refParRate, parRate, TOL); assertRelative("notAccruedTest", 0.0, accruedInterest, TOL); } }
Source:
public void stop(BundleContext context) throws Exception { Preferences.getInstance().dispose(); super.stop(context); }

Target:
public void stop(BundleContext context) throws Exception { try { Preferences.getInstance().dispose(); } finally { super.stop(context); } }
Source:
public static String extractBirthdate(PRPAMT201306UV02ParameterList params) { LOG.trace("Entering HL7Parser201305.ExtractBirthdate method..."); String birthDate = null; if (CollectionUtils.isNotEmpty(params.getLivingSubjectBirthTime()) && params.getLivingSubjectBirthTime().get(0) != null) { PRPAMT201306UV02LivingSubjectBirthTime birthTime = params.getLivingSubjectBirthTime().get(0); if (CollectionUtils.isNotEmpty(birthTime.getValue()) && birthTime.getValue().get(0) != null) { IVLTSExplicit birthday = birthTime.getValue().get(0); LOG.info("Found birthTime in query parameters = ", birthday.getValue()); birthDate = birthday.getValue(); } else { LOG.info("message does not contain a birthtime"); } } else { LOG.info("message does not contain a birthtime"); } LOG.trace("Exiting HL7Parser201305.ExtractBirthdate method..."); return birthDate; }

Target:
public static String extractBirthdate(PRPAMT201306UV02ParameterList params) { LOG.trace("Entering HL7Parser201305.ExtractBirthdate method..."); String birthDate = null; if (CollectionUtils.isNotEmpty(params.getLivingSubjectBirthTime()) && params.getLivingSubjectBirthTime().get(0) != null) { PRPAMT201306UV02LivingSubjectBirthTime birthTime = params.getLivingSubjectBirthTime().get(0); if (CollectionUtils.isNotEmpty(birthTime.getValue()) && birthTime.getValue().get(0) != null) { IVLTSExplicit birthday = birthTime.getValue().get(0); LOG.info("Found birthTime in query parameters{} ", birthday.getValue()); birthDate = birthday.getValue(); } else { LOG.info("message does not contain a birthtime"); } } else { LOG.info("message does not contain a birthtime"); } LOG.trace("Exiting HL7Parser201305.ExtractBirthdate method..."); return birthDate; }
Source:
private String getOidFromExpression(String expression, int patternIndex, int expressionIndex) throws OpenClinicaSystemException { String[] splitExpression = expression.split(ESCAPED_SEPERATOR); if (!match(splitExpression[splitExpression.length - 1 - expressionIndex], pattern[patternIndex])) { if (!match(splitExpression[splitExpression.length - 1 - expressionIndex], ruleActionPattern[patternIndex])) { return expression; } } return splitExpression[splitExpression.length - 1 - expressionIndex]; }

Target:
private String getOidFromExpression(String expression, int patternIndex, int expressionIndex) throws OpenClinicaSystemException { String[] splitExpression = expression.split(ESCAPED_SEPERATOR); if (!match(splitExpression[splitExpression.length - 1 - expressionIndex], pattern[patternIndex])) { if (!match(splitExpression[splitExpression.length - 1 - expressionIndex], ruleActionPattern[patternIndex])) { throw new OpenClinicaSystemException("OCRER'R_0019", new String[] { expression }); } } return splitExpression[splitExpression.length - 1 - expressionIndex]; }
Source:
public void stepOut() { depth--; if(state == null) { if(seenImports) { SSTImportDescriptor temp = decImports.getLast(); if(temp.maxID == 0 || temp.name == null || temp.version == 0) throw new UnsupportedOperationException("Illegal Shared Symbol Table Import declared in local symbol table." + temp.name + "." + temp.version); LinkedList<SymbolTable> tempImports = new LinkedList<SymbolTable>(); tempImports.add(symbolTable.getSystemSymbolTable()); SymbolTable tempTable = null; for(SSTImportDescriptor desc : decImports) { tempTable = catalog.getTable(desc.name, desc.version); if(tempTable == null) { tempTable = new SubstituteSymbolTable(desc.name, desc.version, desc.maxID); } else if(tempTable.getMaxId() != desc.maxID) { tempTable = new SubstituteSymbolTable(tempTable, desc.version, desc.maxID); } tempImports.add(tempTable); } symbolTable = new LocalSymbolTable(new LocalSymbolTableImports(tempImports), decSymbols); seenImports = false; } else { for(String sym : decSymbols) { symbolTable.intern(sym); } } } else { switch (state) { case impDesc: state = State.impList; break; case impList: case sym: state = null; break; case preSym: case impMID: case impVer: case impName: throw new UnsupportedOperationException(); } } }

Target:
public void stepOut() { depth--; if(state == State.LST_STRUCT) { state = null; if(seenImports) { LinkedList<SymbolTable> tempImports = new LinkedList<SymbolTable>(); tempImports.add(symbolTable.getSystemSymbolTable()); SymbolTable tempTable = null; for(SSTImportDescriptor desc : declaredImports) { tempTable = catalog.getTable(desc.name, desc.version); if(tempTable == null) { tempTable = new SubstituteSymbolTable(desc.name, desc.version, desc.maxID); } else if(tempTable.getMaxId() != desc.maxID) { tempTable = new SubstituteSymbolTable(tempTable, desc.version, desc.maxID); } tempImports.add(tempTable); } symbolTable = new LocalSymbolTable(new LocalSymbolTableImports(tempImports), declaredSymbols); seenImports = false; } else { for(String sym : declaredSymbols) { symbolTable.intern(sym); } } } else { switch (state) { case IMPORT_DESCRIPTOR: SSTImportDescriptor temp = declaredImports.getLast(); if(temp.maxID == 0 || temp.name == null || temp.version == 0){ throw new UnsupportedOperationException("Illegal Shared Symbol Table Import declared in local symbol table." + temp.name + "." + temp.version); } state = State.IMPORT_LIST; break; case IMPORT_LIST: case SYMBOL_LIST: state = State.LST_STRUCT; break; case PRE_SYMBOL_LIST: case IMPORT_MAX_ID: case IMPORT_VERSION: case IMPORT_NAME: throw new UnsupportedOperationException(); } } }
Source:
public ServiceBusErrorSource getErrorSource() { return errorSource; }

Target:
ServiceBusErrorSource getErrorSource() { return errorSource; }
Source:
public void onRefresh() { mRepositoryFragment = null; mContentListFragment = null; mActivityFragment = null; mRepository = null; mIsStarring = null; mIsWatching = null; mBranches = null; mTags = null; clearRefDependentFragments(); setContentShown(false); invalidateTabs(); loadRepository(true); if (Gh4Application.get().isAuthorized()) { isWatching(true); isStarring(true); } super.onRefresh(); }

Target:
public void onRefresh() { mRepositoryFragment = null; mContentListFragment = null; mActivityFragment = null; mRepository = null; mIsStarring = null; mIsWatching = null; mBranches = null; mTags = null; clearRefDependentFragments(); setContentShown(false); invalidateTabs(); loadRepository(true); if (Gh4Application.get().isAuthorized()) { loadWatchingStatus(true); loadStarringStatus(true); } super.onRefresh(); }
Source:
private ObjectNode httpRequest(ObjectNode query) throws IOException { Objects.requireNonNull(query, "query"); String uri = String.format(Locale.ROOT, "/%s/%s/_search", indexName, typeName); Hook.QUERY_PLAN.run(query); final String json = mapper.writeValueAsString(query); LOGGER.debug("Elasticsearch Query: {}", json); HttpEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON); Response response = restClient.performRequest("POST", uri, Collections.emptyMap(), entity); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { final String error = EntityUtils.toString(response.getEntity()); final String message = String.format(Locale.ROOT, "Error while querying Elastic (on %s/%s) status: %s\nQuery:\n%s\nError:\n%s\n", response.getHost(), response.getRequestLine(), response.getStatusLine(), query, error); throw new RuntimeException(message); } try (InputStream is = response.getEntity().getContent()) { return (ObjectNode) mapper.readTree(is); } }

Target:
private ElasticsearchJson.Result httpRequest(ObjectNode query) throws IOException { Objects.requireNonNull(query, "query"); String uri = String.format(Locale.ROOT, "/%s/%s/_search", indexName, typeName); Hook.QUERY_PLAN.run(query); final String json = mapper.writeValueAsString(query); LOGGER.debug("Elasticsearch Query: {}", json); HttpEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON); Response response = restClient.performRequest("POST", uri, Collections.emptyMap(), entity); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { final String error = EntityUtils.toString(response.getEntity()); final String message = String.format(Locale.ROOT, "Error while querying Elastic (on %s/%s) status: %s\nQuery:\n%s\nError:\n%s\n", response.getHost(), response.getRequestLine(), response.getStatusLine(), query, error); throw new RuntimeException(message); } try (InputStream is = response.getEntity().getContent()) { return mapper.readValue(is, ElasticsearchJson.Result.class); } }
Source:
public Observable<U> getCached(@NonNull final T id) { checkNotNull(id); final U value = cache.get(getHashCodeForId(id)); return value != null ? Observable.just(value) : Observable.empty(); }

Target:
public Observable<U> getCached(@NonNull final T id) { checkNotNull(id); final U value = cache.get(getHashCodeForId(id)); return value == null ? Observable.empty() : Observable.just(value); }
Source:
public DBI build(Environment environment, DataSourceFactory configuration, ManagedDataSource dataSource, String name) { final String validationQuery = configuration.getValidationQuery(); final DBI dbi = new DBI(dataSource); environment.lifecycle().manage(dataSource); ExecutorService executorService = environment.lifecycle().executorService("DBIHealthCheck") .workQueue(new ArrayBlockingQueue<Runnable>(1)) .minThreads(1) .maxThreads(1).build(); environment.healthChecks().register(name, new DBIHealthCheck(executorService, dbi, validationQuery, configuration.getValidationQueryTimeout().or(Duration.seconds(5)))); dbi.setSQLLog(new LogbackLog(LOGGER, Level.TRACE)); dbi.setTimingCollector(new InstrumentedTimingCollector(environment.metrics(), new SanerNamingStrategy())); if (configuration.isAutoCommentsEnabled()) { dbi.setStatementRewriter(new NamePrependingStatementRewriter(new ColonPrefixNamedParamStatementRewriter())); } dbi.registerArgumentFactory(new OptionalArgumentFactory(configuration.getDriverClass())); dbi.registerContainerFactory(new ImmutableListContainerFactory()); dbi.registerContainerFactory(new ImmutableSetContainerFactory()); dbi.registerContainerFactory(new OptionalContainerFactory()); dbi.registerArgumentFactory(new JodaDateTimeArgumentFactory()); dbi.registerMapper(new JodaDateTimeMapper()); return dbi; }

Target:
public DBI build(Environment environment, DataSourceFactory configuration, ManagedDataSource dataSource, String name) { final String validationQuery = configuration.getValidationQuery(); final DBI dbi = new DBI(dataSource); environment.lifecycle().manage(dataSource); environment.healthChecks().register(name, new DBIHealthCheck( environment.getHealthCheckExecutorService(), configuration.getValidationQueryTimeout().or(Duration.seconds(5)), dbi, validationQuery)); dbi.setSQLLog(new LogbackLog(LOGGER, Level.TRACE)); dbi.setTimingCollector(new InstrumentedTimingCollector(environment.metrics(), new SanerNamingStrategy())); if (configuration.isAutoCommentsEnabled()) { dbi.setStatementRewriter(new NamePrependingStatementRewriter(new ColonPrefixNamedParamStatementRewriter())); } dbi.registerArgumentFactory(new OptionalArgumentFactory(configuration.getDriverClass())); dbi.registerContainerFactory(new ImmutableListContainerFactory()); dbi.registerContainerFactory(new ImmutableSetContainerFactory()); dbi.registerContainerFactory(new OptionalContainerFactory()); dbi.registerArgumentFactory(new JodaDateTimeArgumentFactory()); dbi.registerMapper(new JodaDateTimeMapper()); return dbi; }
Source:
protected void onCreate(Bundle savedInstanceState) { setVolumeControlStream(AudioManager.STREAM_MUSIC); AnkiDroidApp.updateContextWithLanguage(this); Themes.setTheme(this); super.onCreate(savedInstanceState); mCustomTabActivityHelper = new CustomTabActivityHelper(); }

Target:
protected void onCreate(Bundle savedInstanceState) { Timber.i("AnkiActivity::onCreate"); setVolumeControlStream(AudioManager.STREAM_MUSIC); Themes.setTheme(this); super.onCreate(savedInstanceState); mCustomTabActivityHelper = new CustomTabActivityHelper(); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_brand); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); progressBar = (ProgressBar) findViewById(R.id.progress_bar); countProductsView.setVisibility(View.INVISIBLE); Bundle extras = getIntent().getExtras(); typeStrings = new String[]{ "brand", "country", "additive", "search", "store", "packaging", "label" }; searchType = extras.getString("search_type"); key = extras.getString("key"); getSupportActionBar().setTitle(key); switch (searchType) { case "brand": { getSupportActionBar().setSubtitle(R.string.brand_string); break; } case "country": { getSupportActionBar().setSubtitle(R.string.country_string); break; } case "additive": { getSupportActionBar().setSubtitle(R.string.additive_string); break; } case "search": { getSupportActionBar().setSubtitle(R.string.search_string); break; } case "store": { getSupportActionBar().setSubtitle(getString(R.string.store_string)); break; } case "packaging": { getSupportActionBar().setSubtitle(getString(R.string.packaging_string)); break; } case "label": { getSupportActionBar().setSubtitle(getString(R.string.label_string)); } } apiClient = new OpenFoodAPIClient(ProductBrowsingListActivity.this, BuildConfig.OFWEBSITE); api = new OpenFoodAPIClient(ProductBrowsingListActivity.this); productsRecyclerView = (RecyclerView) findViewById(R.id.products_recycler_view); setup(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_brand); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); progressBar = (ProgressBar) findViewById(R.id.progress_bar); countProductsView.setVisibility(View.INVISIBLE); Bundle extras = getIntent().getExtras(); typeStrings = new String[]{ "brand", "country", "additive", "search", "store", "packaging", "label" , "category" }; searchType = extras.getString("search_type"); key = extras.getString("key"); getSupportActionBar().setTitle(key); switch (searchType) { case "brand": { getSupportActionBar().setSubtitle(R.string.brand_string); break; } case "country": { getSupportActionBar().setSubtitle(R.string.country_string); break; } case "additive": { getSupportActionBar().setSubtitle(R.string.additive_string); break; } case "search": { getSupportActionBar().setSubtitle(R.string.search_string); break; } case "store": { getSupportActionBar().setSubtitle(getString(R.string.store_string)); break; } case "packaging": { getSupportActionBar().setSubtitle(getString(R.string.packaging_string)); break; } case "label": { getSupportActionBar().setSubtitle(getString(R.string.label_string)); break; } case "category": { getSupportActionBar().setSubtitle(getString(R.string.category_string)); break; } } apiClient = new OpenFoodAPIClient(ProductBrowsingListActivity.this, BuildConfig.OFWEBSITE); api = new OpenFoodAPIClient(ProductBrowsingListActivity.this); productsRecyclerView = (RecyclerView) findViewById(R.id.products_recycler_view); setup(); }
Source:
private String[] parseFQ(String fq) { fq = StringUtils.trimToEmpty(fq); if (StringUtils.isNotEmpty(fq)) { boolean globalInclusive = true; int start = fq.indexOf('('); int end = fq.indexOf(')'); if ((start != -1) ^ (end != -1)) return null; if (start != -1) { if (fq.charAt(0) == '-') { globalInclusive = false; } fq = fq.substring(start + 1, end); } String[] fv = fq.split(":"); if (fv.length >= 2 && StringUtils.isNotBlank(fv[0]) && StringUtils.isNotBlank(fv[1])) { boolean localInclusive = fv[0].charAt(0) != '-'; String key = localInclusive ? fv[0] : fv[0].substring(1); String calculatedKey = globalInclusive ^ localInclusive ? "-" + key : key; String value = fq.replace(fv[0] + ":", ""); return new String[]{ calculatedKey, value }; } } return null; }

Target:
private String parseFQ(String fq) { fq = StringUtils.trimToEmpty(fq); if (StringUtils.isNotEmpty(fq)) { boolean globalInclusive = true; int start = fq.indexOf('('); int end = fq.indexOf(')'); if ((start != -1) ^ (end != -1)) return null; if (start != -1) { if (fq.charAt(0) == '-') { globalInclusive = false; } fq = fq.substring(start + 1, end); } String[] fv = fq.split(":"); if (fv.length >= 2 && StringUtils.isNotBlank(fv[0]) && StringUtils.isNotBlank(fv[1])) { boolean localInclusive = fv[0].charAt(0) != '-'; String key = localInclusive ? fv[0] : fv[0].substring(1); return globalInclusive ^ localInclusive ? "-" + key : key; } } return null; }
Source:
public static Properties loadProps(String filename, List<String> onlyIncludeKeys) throws IOException { Properties props = new Properties(); if (filename != null) { try (InputStream propStream = Files.newInputStream(Paths.get(filename))) { props.load(propStream); } } else { System.out.println("Did not load any properties since the property file is not specified"); } if (onlyIncludeKeys == null || onlyIncludeKeys.size() == 0) return props; Properties requestedProps = new Properties(); onlyIncludeKeys.forEach(key -> { String value = props.getProperty(key); if (value != null) requestedProps.setProperty(key, value); }); return requestedProps; }

Target:
public static Properties loadProps(String filename, List<String> onlyIncludeKeys) throws IOException { Properties props = new Properties(); if (filename != null) { try (InputStream propStream = Files.newInputStream(Paths.get(filename))) { props.load(propStream); } } else { System.out.println("Did not load any properties since the property file is not specified"); } if (onlyIncludeKeys == null || onlyIncludeKeys.isEmpty()) return props; Properties requestedProps = new Properties(); onlyIncludeKeys.forEach(key -> { String value = props.getProperty(key); if (value != null) requestedProps.setProperty(key, value); }); return requestedProps; }
Source:
public void execute(IProgressMonitor monitor) throws CVSException, InterruptedException { super.execute(monitor); if (tempFile.length() == 0) { tempFile.delete(); reportEmptyDiff(); return; } if (this.isMultiPatch && (!patchHasContents && !patchHasNewFiles && !emptyDiffReported)){ tempFile.delete(); reportEmptyDiff(); return; } copyFile(); }

Target:
public void execute(IProgressMonitor monitor) throws CVSException, InterruptedException { super.execute(monitor); if (tempFile.length() == 0) { tempFile.delete(); reportEmptyDiff(); return; } if (this.isMultiPatch && (!patchHasContents && !patchHasNewFiles)){ tempFile.delete(); reportEmptyDiff(); return; } copyFile(); }
Source:
public static String getBMXUrl() { return bmxUrl; }

Target:
public String getBMXUrl() { return bmxUrl; }
Source:
public ServletRegistration( ServiceHolder<Servlet> servletHolder, ExtendedServletDTO servletDTO, ErrorPageDTO errorPageDTO, ServletContextHelper servletContextHelper, ContextController contextController, ServletContext servletContext, ClassLoader legacyTCCL) { super(servletHolder, servletDTO, servletContextHelper, contextController, legacyTCCL); this.errorPageDTO = errorPageDTO; if (servletDTO.multipartEnabled && (factory != null)) { multipartSupport = factory.newInstance(servletDTO, servletContext); } else { multipartSupport = null; } }

Target:
public ServletRegistration( ServiceHolder<Servlet> servletHolder, ExtendedServletDTO servletDTO, ErrorPageDTO errorPageDTO, ServletContextHelper servletContextHelper, ContextController contextController, ServletContext servletContext, ClassLoader legacyTCCL) { super(servletHolder, servletDTO, servletContextHelper, contextController, legacyTCCL); this.errorPageDTO = errorPageDTO; if (servletDTO.multipartEnabled) { if (factory == null) { throw new IllegalStateException( "Multipart support not enabled due to missing, optional commons-fileupload dependency!"); } multipartSupport = factory.newInstance(servletDTO, servletContext); } else { multipartSupport = null; } }
Source:
public boolean acquireWifiLock(IBinder binder, int lockMode, String tag, WorkSource ws) { mLog.trace("acquireWifiLock uid=%").c(Binder.getCallingUid()).flush(); if (mWifiLockManager.acquireWifiLock(lockMode, tag, binder, ws)) { mWifiController.sendMessage(CMD_LOCKS_CHANGED); return true; } return false; }

Target:
public boolean acquireWifiLock(IBinder binder, int lockMode, String tag, WorkSource ws) { mLog.trace("acquireWifiLock uid=% lockMode=%") .c(Binder.getCallingUid()) .c(lockMode).flush(); if (mWifiLockManager.acquireWifiLock(lockMode, tag, binder, ws)) { mWifiController.sendMessage(CMD_LOCKS_CHANGED); return true; } return false; }
Source:
private void mark(State state, Map<NonTerminal, Set<NonTerminalState>> nonTerminalCallers) { if (!entryNullable.contains(state)) { entryNullable.add(state); if (state instanceof NextableState) { if (isNullable(state)) for (State s : ((NextableState) state).next) mark(s, nonTerminalCallers); } else { assert state instanceof ExitState: "I was expecting this element to be of type ExitState"; for (State s : nonTerminalCallers.get(state.nt)) { if (entryNullable.contains(s)) { for (State child : ((NextableState)s).next) { mark(child, nonTerminalCallers); } } } } } }

Target:
private void mark(State state, Map<NonTerminal, Set<NonTerminalState>> nonTerminalCallers) { if (!entryNullable.contains(state)) { entryNullable.add(state); if (state instanceof NextableState) { if (isNullable(state)) for (State s : ((NextableState) state).next) mark(s, nonTerminalCallers); } else { assert state instanceof ExitState: "Expected element of type ExitState: " + state; for (State s : nonTerminalCallers.get(state.nt)) { if (entryNullable.contains(s)) { for (State child : ((NextableState)s).next) { mark(child, nonTerminalCallers); } } } } } }
Source:
public ChangePreview getChangePreview(RefactoringChange change) throws RefactoringException, CoreException { RefactoringSession session = getRefactoringSession(change.getSessionId()); PreviewNode previewNode = session.getChangePreview(change.getChangeId()); ChangePreviewViewerDescriptor descriptor = previewNode.getChangePreviewViewerDescriptor(); if(descriptor != null){ IChangePreviewViewer viewer = descriptor.createViewer(); if(viewer != null) { return previewNode.feedInput(viewer, Collections.EMPTY_LIST); } } return null; }

Target:
public ChangePreview getChangePreview(RefactoringChange change) throws RefactoringException { RefactoringSession session = getRefactoringSession(change.getSessionId()); PreviewNode previewNode = session.getChangePreview(change.getChangeId()); try { ChangePreviewViewerDescriptor descriptor = previewNode.getChangePreviewViewerDescriptor(); if (descriptor != null) { IChangePreviewViewer viewer = descriptor.createViewer(); if (viewer != null) { return previewNode.feedInput(viewer, Collections.EMPTY_LIST); } } } catch (CoreException e) { throw new RefactoringException(e.getMessage()); } return null; }
Source:
public double[] getDerivatives() { return _derivatives; }

Target:
public double[] getDerivatives() { return _derivatives.clone(); }
Source:
protected void loadSshConfig() throws BuildException { if (sshConfig != null) { if (!new File(sshConfig).exists()) { throw new BuildException("The SSH configuration file specified doesn't exist: " + sshConfig); } log("Loading SSH configuration file " + sshConfig, Project.MSG_DEBUG); ConfigRepository.Config config = null; try { config = OpenSSHConfig.parseFile(sshConfig).getConfig(host); } catch (IOException e) { throw new BuildException("Failed to load the SSH configuration file " + sshConfig, e); } host = config.getHostname(); if (userInfo.getName() == null) { userInfo.setName(config.getUser()); } if (userInfo.getKeyfile() == null) { log("Using SSH key file " + config.getValue("IdentityFile") + " for host " + host, Project.MSG_INFO); userInfo.setKeyfile(config.getValue("IdentityFile")); } } }

Target:
protected void loadSshConfig() throws BuildException { if (sshConfig != null && (userInfo.getName() == null || userInfo.getKeyfile() == null)) { if (!new File(sshConfig).exists()) { throw new BuildException("The SSH configuration file specified doesn't exist: " + sshConfig); } log("Loading SSH configuration file " + sshConfig, Project.MSG_DEBUG); ConfigRepository.Config config = null; try { config = OpenSSHConfig.parseFile(sshConfig).getConfig(host); } catch (IOException e) { throw new BuildException("Failed to load the SSH configuration file " + sshConfig, e); } host = config.getHostname(); if (userInfo.getName() == null) { userInfo.setName(config.getUser()); } if (userInfo.getKeyfile() == null) { log("Using SSH key file " + config.getValue("IdentityFile") + " for host " + host, Project.MSG_INFO); userInfo.setKeyfile(config.getValue("IdentityFile")); } } }
Source:
public IonValue get(String fieldName) { int field_idx = find_field_helper(fieldName); IonValue field; if (field_idx < 0) { if(hasNullFieldName) throw new UnknownSymbolException("Because a field exists with an unknown name we cannot say for certain whether the requested field exists or not."); field = null; } else { field = get_child(field_idx); } return field; }

Target:
public IonValue get(String fieldName) { int field_idx = find_field_helper(fieldName); IonValue field; if (field_idx < 0) { if(hasNullFieldName) throw new UnknownSymbolException("Unable to determine whether the field exists because the struct contains field names with unknown text."); field = null; } else { field = get_child(field_idx); } return field; }
Source:
private final IStatus hasADefinedRelationship() { final ElementTypeConfiguration etc = this.conf.getEditedElement(); if (null == etc) { return createErrorStatus(Messages.RelationshipOwnerValidator_NoRelationshipDefined); } final EClass eclass = ((MetamodelTypeConfiguration) etc).getEClass(); if (eclass.isAbstract()) { return createErrorStatus(Messages.RelationshipOwnerValidator_ChosenRelationshipIsAbstract); } return Status.OK_STATUS; }

Target:
private final IStatus hasADefinedRelationship() { final ElementTypeConfiguration etc = this.conf.getEditedElement(); if (null == etc) { return createErrorStatus(Messages.RelationshipOwnerValidator_NoRelationshipDefined); } final EClass eclass = getBaseMetamodelEClass(etc); if (null != eclass) { if (eclass.isAbstract()) { return createErrorStatus(Messages.RelationshipOwnerValidator_ChosenRelationshipIsAbstract); } } return Status.OK_STATUS; }
Source:
private void cacheCaseModelQuerySet(QueryContext queryContext, DualTableSingleMatchModelQuerySet ret) { if(ret.getSetBody().size() > 50 && ret.getSetBody().size() < CaseGroupResultCache.MAX_PREFETCH_CASE_BLOCK) { queryContext.getQueryCache(CaseGroupResultCache.class).reportBulkCaseBody(this.getCurrentQuerySetId(), ret.getSetBody()); } }

Target:
private void cacheCaseModelQuerySet(QueryContext queryContext, DualTableSingleMatchModelQuerySet ret) { int modelQueryMagnitude = ret.getSetBody().size(); if(modelQueryMagnitude > QueryContext.BULK_QUERY_THRESHOLD && modelQueryMagnitude < CaseGroupResultCache.MAX_PREFETCH_CASE_BLOCK) { queryContext.getQueryCache(CaseGroupResultCache.class).reportBulkCaseBody(this.getCurrentQuerySetId(), ret.getSetBody()); } }
Source:
protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); if (instanceState != null) { instanceState.saveState(outState); } outState.putBoolean(KEY_FORM_LOAD_HAS_TRIGGERED, hasFormLoadBeenTriggered); outState.putBoolean(KEY_FORM_LOAD_FAILED, hasFormLoadFailed); outState.putString(KEY_LOC_ERROR, locationRecieverErrorAction); outState.putString(KEY_LOC_ERROR_PATH, badLocationXpath); outState.putBoolean(KEY_INCOMPLETE_ENABLED, mIncompleteEnabled); outState.putBoolean(KEY_HAS_SAVED, hasSaved); outState.putString(KEY_RESIZING_ENABLED, ResizingImageView.resizeMethod); outState.putBoolean(KEY_IS_READ_ONLY, instanceIsReadOnly); formEntryRestoreSession.saveFormEntrySession(outState); if (indexOfWidgetWithVideoPlaying != -1) { outState.putInt(KEY_WIDGET_WITH_VIDEO_PLAYING, indexOfWidgetWithVideoPlaying); outState.putInt(KEY_POSITION_OF_VIDEO_PLAYING, positionOfVideoProgress); } if (symetricKey != null) { try { outState.putString(KEY_AES_STORAGE_KEY, new Base64Wrapper().encodeToString(symetricKey.getEncoded())); } catch (ClassNotFoundException e) { throw new RuntimeException("Base 64 encoding unavailable! Can't pass storage key"); } } uiController.saveInstanceState(outState); }

Target:
protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); instanceState.saveState(outState); outState.putBoolean(KEY_FORM_LOAD_HAS_TRIGGERED, hasFormLoadBeenTriggered); outState.putBoolean(KEY_FORM_LOAD_FAILED, hasFormLoadFailed); outState.putString(KEY_LOC_ERROR, locationRecieverErrorAction); outState.putString(KEY_LOC_ERROR_PATH, badLocationXpath); outState.putBoolean(KEY_INCOMPLETE_ENABLED, mIncompleteEnabled); outState.putBoolean(KEY_HAS_SAVED, hasSaved); outState.putString(KEY_RESIZING_ENABLED, ResizingImageView.resizeMethod); outState.putBoolean(KEY_IS_READ_ONLY, instanceIsReadOnly); formEntryRestoreSession.saveFormEntrySession(outState); if (indexOfWidgetWithVideoPlaying != -1) { outState.putInt(KEY_WIDGET_WITH_VIDEO_PLAYING, indexOfWidgetWithVideoPlaying); outState.putInt(KEY_POSITION_OF_VIDEO_PLAYING, positionOfVideoProgress); } if (symetricKey != null) { try { outState.putString(KEY_AES_STORAGE_KEY, new Base64Wrapper().encodeToString(symetricKey.getEncoded())); } catch (ClassNotFoundException e) { throw new RuntimeException("Base 64 encoding unavailable! Can't pass storage key"); } } uiController.saveInstanceState(outState); }
Source:
protected IRequestHandler processHybrid(PageInfo pageInfo, Class<? extends IRequestablePage> pageClass, PageParameters pageParameters, Integer renderCount) { PageProvider provider = new PageProvider(pageInfo.getPageId(), pageClass, pageParameters, renderCount); provider.setPageSource((IPageSource)Application.get().getMapperContext()); if (provider.isNewPageInstance() && !WebApplication.get().getPageSettings().getRecreateBookmarkablePagesAfterExpiry()) { throw new PageExpiredException(String.format("Bookmarkable page id '%d' has expired.", pageInfo.getPageId())); } else { return new RenderPageRequestHandler(provider); } }

Target:
protected IRequestHandler processHybrid(PageInfo pageInfo, Class<? extends IRequestablePage> pageClass, PageParameters pageParameters, Integer renderCount) { PageProvider provider = new PageProvider(pageInfo.getPageId(), pageClass, pageParameters, renderCount); Application application = Application.get(); provider.setPageSource((IPageSource)application.getMapperContext()); if (provider.isNewPageInstance() && !application.getPageSettings().getRecreateBookmarkablePagesAfterExpiry()) { throw new PageExpiredException(String.format("Bookmarkable page id '%d' class '%s' has expired.", pageInfo.getPageId(), pageClass.getName())); } else { return new RenderPageRequestHandler(provider); } }
Source:
@Test public void testRexSubQueryIn() { final RelBuilder builder = RelBuilder.create(config().build()); RelNode root = builder.scan("EMP") .filter( builder.in( builder.scan("DEPT") .filter( builder.call(SqlStdOperatorTable.EQUALS, builder.field("DNAME"), builder.literal("AAA"))) .project(builder.field("DEPTNO")) .build(), ImmutableList.of(builder.field("DEPTNO")))) .build(); final String expected = "LogicalFilter(condition=[IN($7, {\n" + "LogicalProject(DEPTNO=[$0])\n" + " LogicalFilter(condition=[=($1, 'AAA')])\n" + " LogicalTableScan(table=[[scott, DEPT]])\n" + "})])\n" + " LogicalTableScan(table=[[scott, EMP]])\n"; assertThat(root, hasTree(expected)); }

Target:
@Test void testRexSubQueryIn() { final RelBuilder builder = RelBuilder.create(config().build()); final RelNode root = builder.scan("EMP") .filter( builder.in( builder.scan("DEPT") .filter( builder.call(SqlStdOperatorTable.EQUALS, builder.field("DNAME"), builder.literal("Accounting"))) .project(builder.field("DEPTNO")) .build(), ImmutableList.of(builder.field("DEPTNO")))) .build(); final String expected = "LogicalFilter(condition=[IN($7, {\n" + "LogicalProject(DEPTNO=[$0])\n" + " LogicalFilter(condition=[=($1, 'Accounting')])\n" + " LogicalTableScan(table=[[scott, DEPT]])\n" + "})])\n" + " LogicalTableScan(table=[[scott, EMP]])\n"; assertThat(root, hasTree(expected)); }
Source:
public TransferBatchRequestForNode next() { List<Long> addresses = ImmutableList.copyOf(originalRequest.getAddresses()); String nextNode = iter.next(); return new TransferBatchRequestForNode(addresses, nextNode); }

Target:
public TransferBatchRequestForNode next() { String nextNode = iter.next(); return new TransferBatchRequestForNode(originalAddresses, nextNode); }