auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ResponseEntity<String> removeOrphanDocuments(@RequestParam(defaultValue = "12") Long hoursToKeep) throws SdkClientException, AmazonServiceException { Date startDateTime = null; if (hoursToKeep > 0) { Instant dateTime = Instant.now().minus(hoursToKeep, ChronoUnit.HOURS); startDateTime = Date.from(dateTime); } int numberOfOrphanDocuments = 0; List<String> fourCharacterIds = getDistinctFourCharacterIdsInBucket(); for (String fourCharacterId : fourCharacterIds) { List<String> documentNames = this.documents.findDocumentNamesByFourCharacterId(fourCharacterId); List<String> objectKeys = this.getObjectKeys(fourCharacterId, startDateTime); for (String objectKey : objectKeys) { if (!documentNames.contains(objectKey)) { DeleteObjectRequest deleteObjectRequest = new DeleteObjectRequest(this.bucketName, objectKey); s3Client.deleteObject(deleteObjectRequest); numberOfOrphanDocuments++; } } } if (numberOfOrphanDocuments == 0) { return new ResponseEntity<String>(HttpStatus.OK); } else { log.info(numberOfOrphanDocuments + " orphan documents have been removed from " + this.bucketName); <START> return new ResponseEntity<String>(HttpStatus.NO_CONTENT); <END> } }</code><technical_language>need if-statement anymore</technical_language>

Target:
public ResponseEntity<String> removeOrphanDocuments(@RequestParam(defaultValue = "12") Long hoursToKeep) throws SdkClientException, AmazonServiceException { Date startDateTime = null; if (hoursToKeep > 0) { Instant dateTime = Instant.now().minus(hoursToKeep, ChronoUnit.HOURS); startDateTime = Date.from(dateTime); } List<String> objectKeys = this.getAllObjectKeys(startDateTime); List<Document> documents = this.documentRepository.findAll(); List<String> documentNames = documents.stream().map(d -> d.getName()).collect(Collectors.toList()); int numberOfOrphanDocuments = 0; for (String objectKey : objectKeys) { if (!documentNames.contains(objectKey)) { DeleteObjectRequest deleteObjectRequest = new DeleteObjectRequest(this.bucketName, objectKey); s3Client.deleteObject(deleteObjectRequest); numberOfOrphanDocuments++; } } log.info(numberOfOrphanDocuments + " orphan documents have been removed"); return ResponseEntity.ok().body("Number of orphan documents removed: " + numberOfOrphanDocuments); }
Source:
<code>public Hc4ProviderImpl( final ApplicationConfiguration applicationConfiguration, final UserAgentBuilder userAgentBuilder, final EventBus eventBus, final PoolingClientConnectionManagerMBeanInstaller jmxInstaller ) { this.applicationConfiguration = Preconditions.checkNotNull( applicationConfiguration ); this.userAgentBuilder = Preconditions.checkNotNull( userAgentBuilder ); this.jmxInstaller = Preconditions.checkNotNull( jmxInstaller ); this.sharedConnectionManager = createClientConnectionManager(); this.evictingThread = new EvictingThread( sharedConnectionManager, getConnectionPoolIdleTime() ); this.evictingThread.start(); this.eventBus = Preconditions.checkNotNull( eventBus ); this.eventBus.register( this ); this.jmxInstaller.register( sharedConnectionManager ); getLogger().info( <START> "{} started up (connectionPoolMaxSize {}, connectionPoolSize {}, connectionPoolIdleTime ms, connectionPoolTimeout ms, keepAliveMaxDuration ms)", <END> getClass().getSimpleName(), getConnectionPoolMaxSize(), getConnectionPoolSize(), getConnectionPoolIdleTime(), getConnectionPoolTimeout(), getKeepAliveMaxDuration() ); }</code><technical_language>I change 'started up' 'started'</technical_language>

Target:
public Hc4ProviderImpl( final ApplicationConfiguration applicationConfiguration, final UserAgentBuilder userAgentBuilder, final EventBus eventBus, final PoolingClientConnectionManagerMBeanInstaller jmxInstaller ) { this.applicationConfiguration = Preconditions.checkNotNull( applicationConfiguration ); this.userAgentBuilder = Preconditions.checkNotNull( userAgentBuilder ); this.jmxInstaller = Preconditions.checkNotNull( jmxInstaller ); this.sharedConnectionManager = createClientConnectionManager(); this.evictingThread = new EvictingThread( sharedConnectionManager, getConnectionPoolIdleTime() ); this.evictingThread.start(); this.eventBus = Preconditions.checkNotNull( eventBus ); this.eventBus.register( this ); this.jmxInstaller.register( sharedConnectionManager ); getLogger().info( "{} started (connectionPoolMaxSize {}, connectionPoolSize {}, connectionPoolIdleTime ms, connectionPoolTimeout ms, keepAliveMaxDuration ms)", getClass().getSimpleName(), getConnectionPoolMaxSize(), getConnectionPoolSize(), getConnectionPoolIdleTime(), getConnectionPoolTimeout(), getKeepAliveMaxDuration() ); }
Source:
<code>public void sessionChanged(Session session) { startPassiveScanThread(); <START> getScanStatus().setScanCount(0); <END> }</code><technical_language>check view is initialised</technical_language>

Target:
public void sessionChanged(Session session) { startPassiveScanThread(); if (View.isInitialised()) { getScanStatus().setScanCount(0); } }
Source:
<code>public Stream<Output> bloomFulltextNodes( @Name( "terms" ) List<String> terms ) throws Exception { <START> Stream<Output> stream; <END> try ( ReadOnlyFulltext indexReader = provider.getReader( BLOOM_NODES, FulltextProvider.FulltextIndexType.NODES ) ) { stream = queryAsStream( terms, indexReader ); } return stream; }</code><technical_language>i simply do this (here method below): try ( ReadOnlyFulltext indexReader = provider.getReader( BLOOM_NODES, FulltextProvider.FulltextIndexType.NODES ) ) { return queryAsStream( terms, indexReader ); }</technical_language>

Target:
public Stream<Output> bloomFulltextNodes( @Name( "terms" ) List<String> terms ) throws Exception { try ( ReadOnlyFulltext indexReader = provider.getReader( BLOOM_NODES, FulltextProvider.FulltextIndexType.NODES ) ) { return queryAsStream( terms, indexReader ); } }
Source:
<code>public int hashCode() { <START> return Objects.hashCode( referenceExpression ); <END> }</code><technical_language>Revert this. referenceExpression is non-null AFAICS</technical_language>

Target:
public int hashCode() { return referenceExpression.hashCode(); }
Source:
<code>public CloudObjectLocation createCloudObjectLocation(CloudBlobHolder cloudBlob) { try { return new CloudObjectLocation(cloudBlob.getContainerName(), cloudBlob.getName()); } catch (Exception e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>In Druid, I throw extends RuntimeExceptions choose throw instead of RE? I is right throw..</technical_language>

Target:
public CloudObjectLocation createCloudObjectLocation(CloudBlobHolder cloudBlob) { try { return new CloudObjectLocation(cloudBlob.getContainerName(), cloudBlob.getName()); } catch (Exception e) { throw new RE(e); } }
Source:
<code>public void addMediaFromChoice(AudioVideoImageTextLabel audioVideoImageTextLabel, int index, TextView textView, List<SelectChoice> items) { SelectChoice item = items.get(index); audioVideoImageTextLabel.setTag(getClipID(props.getPrompt(), item)); audioVideoImageTextLabel.setTextView(textView); String imageURI = getImageURI(index, items); String videoURI = props.getPrompt().getSpecialFormSelectChoiceText(item, "video"); String bigImageURI = props.getPrompt().getSpecialFormSelectChoiceText(item, "big-image"); String audioURI = getPlayableAudioURI(props.getPrompt(), item, props.getReferenceManager()); try { if (imageURI != null) { audioVideoImageTextLabel.setImage(new File(props.getReferenceManager().deriveReference(imageURI).getLocalURI())); } if (bigImageURI != null) { audioVideoImageTextLabel.setBigImage(new File(props.getReferenceManager().deriveReference(bigImageURI).getLocalURI())); } if (videoURI != null) { audioVideoImageTextLabel.setVideo(new File(props.getReferenceManager().deriveReference(videoURI).getLocalURI())); } if (audioURI != null) { audioVideoImageTextLabel.setAudio(audioURI, props.getAudioHelper()); } } catch (InvalidReferenceException e) { <START> Timber.e(e, "Invalid image reference due to %s ", e.getMessage()); <END> } textView.setGravity(Gravity.CENTER_VERTICAL); }</code><technical_language>While here, change Timber.d developer-actionable. Message "Invalid media ref"</technical_language>

Target:
public void addMediaFromChoice(AudioVideoImageTextLabel audioVideoImageTextLabel, int index, TextView textView, List<SelectChoice> items) { SelectChoice item = items.get(index); audioVideoImageTextLabel.setTag(getClipID(prompt, item)); audioVideoImageTextLabel.setTextView(textView); String imageURI = getImageURI(index, items); String videoURI = prompt.getSpecialFormSelectChoiceText(item, "video"); String bigImageURI = prompt.getSpecialFormSelectChoiceText(item, "big-image"); String audioURI = getPlayableAudioURI(prompt, item, referenceManager); try { if (imageURI != null) { audioVideoImageTextLabel.setImage(new File(referenceManager.deriveReference(imageURI).getLocalURI())); } if (bigImageURI != null) { audioVideoImageTextLabel.setBigImage(new File(referenceManager.deriveReference(bigImageURI).getLocalURI())); } if (videoURI != null) { audioVideoImageTextLabel.setVideo(new File(referenceManager.deriveReference(videoURI).getLocalURI())); } if (audioURI != null) { audioVideoImageTextLabel.setAudio(audioURI, audioHelper); } } catch (InvalidReferenceException e) { Timber.d(e, "Invalid media reference due to %s ", e.getMessage()); } textView.setGravity(Gravity.CENTER_VERTICAL); }
Source:
<code><START> public BVDesignOutput runBVDesign(final WorkbenchService workbenchService, final FieldbookProperties fieldbookProperties, <END> final MainDesign design) throws IOException { final String bvDesignPath = fieldbookProperties.getBvDesignPath(); int returnCode = -1; if (bvDesignPath != null && design != null && design.getDesign() != null) { final String xml = this.getXMLStringForDesign(design); final String filepath = BVDesignRunner.writeToFile(xml, fieldbookProperties); final ProcessBuilder pb = new ProcessBuilder(bvDesignPath, "-i" + filepath); final Process p = pb.start(); final ProcessTimeoutThread processTimeoutThread = new ProcessTimeoutThread(p, BVDesignRunner.DESIGN_RUNNER_TIMEOUT_MILLIS); processTimeoutThread.start(); try { final InputStreamReader isr = new InputStreamReader(p.getInputStream()); final BufferedReader br = new BufferedReader(isr); String lineRead; while ((lineRead = br.readLine()) != null) { BVDesignRunner.LOG.debug(lineRead); } returnCode = p.waitFor(); } catch (final InterruptedException e) { BVDesignRunner.LOG.error(e.getMessage(), e); } finally { if (processTimeoutThread != null) { processTimeoutThread.interrupt(); } if (p != null) { p.getInputStream().close(); p.getOutputStream().close(); p.getErrorStream().close(); } } } final BVDesignOutput output = new BVDesignOutput(returnCode); if (returnCode == 0) { final File outputFile = new File(design.getDesign().getParameterValue(ExperimentDesignGenerator.OUTPUTFILE_PARAM)); final FileReader fileReader = new FileReader(outputFile); final CSVReader reader = new CSVReader(fileReader); final List<String[]> myEntries = reader.readAll(); output.setResults(myEntries); fileReader.close(); reader.close(); outputFile.delete(); } return output; }</code><technical_language>explored/tried creating unit test for BVDesignRunner#runBVDesign? I if Mockito.spy calling actual executable</technical_language>

Target:
public BVDesignOutput runBVDesign(final WorkbenchService workbenchService, final FieldbookProperties fieldbookProperties, final MainDesign design) throws IOException { final String bvDesignPath = fieldbookProperties.getBvDesignPath(); int returnCode = -1; if (bvDesignPath != null && design != null && design.getDesign() != null) { final String xml = this.getXMLStringForDesign(design); final String filepath = this.inputWriter.write(xml, fieldbookProperties); returnCode = this.processRunner.run(bvDesignPath, "-i" + filepath); } final BVDesignOutput output = new BVDesignOutput(returnCode); if (returnCode == 0) { output.setResults(outputReader.read(design.getDesign().getParameterValue(ExperimentDesignGenerator.OUTPUTFILE_PARAM))); } return output; }
Source:
<code>private List<CramCompressionRecord> initRTRecords() { final List<CramCompressionRecord> initialRecords = new ArrayList<>(); <START> CramCompressionRecord record = createRecord(); <END> record.readBases = record.qualityScores = null; initialRecords.add(record); return initialRecords; }</code><technical_language>kind of funny this 1 record. records though</technical_language>

Target:
private List<CramCompressionRecord> initRTRecords() { List<CramCompressionRecord> records = createRecords(); for (CramCompressionRecord record : records) { record.readBases = record.qualityScores = null; } return records; }
Source:
<code>private void addOrUpdateDayTruncatedActivity(UserAnonymizedEntityHolder userAnonymizedHolder, ActivityPayload payload, GoalDto matchingGoal) { Optional<ActivityDto> lastRegisteredActivity = getLastRegisteredActivity(payload, matchingGoal); <START> if (precedesLastRegisteredActivity(payload, lastRegisteredActivity)) <END> { Optional<Activity> overlappingActivity = findOverlappingActivity(payload, matchingGoal); if (overlappingActivity.isPresent()) { updateTimeExistingActivity(userAnonymizedHolder, payload, overlappingActivity.get()); return; } } if (canCombineWithLastRegisteredActivity(payload, lastRegisteredActivity)) { if (payload.startTime.isBefore(lastRegisteredActivity.get().getStartTime()) || isBeyondSkipWindowAfterLastRegisteredActivity(payload, lastRegisteredActivity.get())) { updateTimeLastActivity(userAnonymizedHolder, payload, matchingGoal, lastRegisteredActivity.get()); } return; } addActivity(userAnonymizedHolder, payload, matchingGoal, lastRegisteredActivity); }</code><technical_language>Suggestion: For readability, I move this common case (if (canCombineWithLastRegisteredActivity...)</technical_language>

Target:
private void addOrUpdateDayTruncatedActivity(UserAnonymizedEntityHolder userAnonymizedHolder, ActivityPayload payload, GoalDto matchingGoal) { Optional<ActivityDto> lastRegisteredActivity = getLastRegisteredActivity(payload, matchingGoal); if (precedesLastRegisteredActivity(payload, lastRegisteredActivity)) { Optional<Activity> overlappingActivity = findOverlappingActivitySameApp(payload, matchingGoal); if (overlappingActivity.isPresent()) { updateTimeExistingActivity(userAnonymizedHolder, payload, overlappingActivity.get()); return; } } if (canCombineWithLastRegisteredActivity(payload, lastRegisteredActivity)) { if (payload.startTime.isBefore(lastRegisteredActivity.get().getStartTime()) || isBeyondSkipWindowAfterLastRegisteredActivity(payload, lastRegisteredActivity.get())) { updateTimeLastActivity(userAnonymizedHolder, payload, matchingGoal, lastRegisteredActivity.get()); } return; } addActivity(userAnonymizedHolder, payload, matchingGoal, lastRegisteredActivity); }
Source:
<code>@Test public void retainsAccept() { server.enqueue(new MockResponse().setBody("" + "data: hey\n" + "\n").setHeader("content-type", "text/event-stream")); EventSource source = newEventSource("text/plain"); assertThat(source.request().url().encodedPath()).isEqualTo("/"); <START> assertThat(source.request().header("Accept")).isEqualTo("text/plain"); <END> listener.assertOpen(); listener.assertEvent(null, null, "hey"); listener.assertClose(); }</code><technical_language>alternately RecordedRequest assert header server</technical_language>

Target:
@Test public void retainsAccept() throws InterruptedException { server.enqueue(new MockResponse().setBody("" + "data: hey\n" + "\n").setHeader("content-type", "text/event-stream")); EventSource source = newEventSource("text/plain"); listener.assertOpen(); listener.assertEvent(null, null, "hey"); listener.assertClose(); assertThat(server.takeRequest().getHeader("Accept")).isEqualTo("text/plain"); }
Source:
<code>public void postProcessRefresh(boolean succeeded) { try { try { moveVDSToMaintenanceIfNeeded(); <START> saveDataToDb(); <END> if (firstStatus != vds.getStatus() && vds.getStatus() == VDSStatus.Up) { vdsManager.cancelRecoveryJob(); log.debug("Host '{}' ({}) firing up event.", vds.getName(), vds.getId()); vdsManager.setIsSetNonOperationalExecuted(!getVdsEventListener().vdsUpEvent(vds)); } } finally { saveDataToDb(); } } catch (Throwable t) { logFailureMessage("ResourceManager::refreshVdsRunTimeInfo:", t); log.debug("Exception", t); } finally { vdsManager.afterRefreshTreatment(succeeded); } }</code><technical_language>is required save data db in this flow ? in line 103</technical_language>

Target:
public void postProcessRefresh(boolean succeeded) { try { try { moveVDSToMaintenanceIfNeeded(); if (firstStatus != vds.getStatus() && vds.getStatus() == VDSStatus.Up) { vdsManager.cancelRecoveryJob(); log.debug("Host '{}' ({}) firing up event.", vds.getName(), vds.getId()); vdsManager.setIsSetNonOperationalExecuted(!getVdsEventListener().vdsUpEvent(vds)); } } finally { saveDataToDb(); } } catch (Throwable t) { logFailureMessage("ResourceManager::refreshVdsRunTimeInfo:", t); log.debug("Exception", t); } finally { vdsManager.afterRefreshTreatment(succeeded); } }
Source:
<code><START> private DiffEntry bestPathMatch(DiffEntry src, List<DiffEntry> list) { <END> DiffEntry best = null; int score = -1; for (DiffEntry d : list) { if (sameType(mode(d), mode(src))) { int tmp = SimilarityRenameDetector .nameScore(path(d), path(src)); if (tmp > score) { best = d; score = tmp; } } } return best; }</code><technical_language>Style-nit: This a static method</technical_language>

Target:
private static DiffEntry bestPathMatch(DiffEntry src, List<DiffEntry> list) { DiffEntry best = null; int score = -1; for (DiffEntry d : list) { if (sameType(mode(d), mode(src))) { int tmp = SimilarityRenameDetector .nameScore(path(d), path(src)); if (tmp > score) { best = d; score = tmp; } } } return best; }
Source:
<code>public void afterTriggerCampaignForLeadsInBatch() { if (batchSize.getValue() > 300) { <START> batchSize.setValue(300); <END> } afterCampaignAction(); }</code><technical_language>This is code. moving a Constant everywhere</technical_language>

Target:
public void afterTriggerCampaignForLeadsInBatch() { if (batchSize.getValue() > REST_API_LIMIT) { batchSize.setValue(REST_API_LIMIT); } afterCampaignAction(); }
Source:
<code>protected CreateIdentityZoneResponse getResponse() { return CreateIdentityZoneResponse.builder() <START> .createdAt(new Date(1426258488910L)) <END> .description("Like the Twilight Zone but tastier[testzone1].") .identityZoneId("testzone1") .name("The Twiglet Zone[testzone1]") .subDomain("testzone1") .version(0) .build(); }</code><technical_language>problem is actually, date all. type is a Long while represents millis-since-epoch, -client APIs supposed map closely original data types. CreateIdentityZoneResponse needs Longs Dates</technical_language>

Target:
protected CreateIdentityZoneResponse getResponse() { return CreateIdentityZoneResponse.builder() .createdAt(1426258488910L) .description("Like the Twilight Zone but tastier[testzone1].") .identityZoneId("testzone1") .name("The Twiglet Zone[testzone1]") .subDomain("testzone1") .version(0) .build(); }
Source:
<code>public SwaggerParseResult readContents(String swaggerAsString, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult result = new SwaggerParseResult(); if(swaggerAsString != null && !"".equals(swaggerAsString.trim())) { ObjectMapper mapper; if(swaggerAsString.trim().startsWith("{")) { mapper = JSON_MAPPER; } else { mapper = YAML_MAPPER; } if(auth == null) { auth = new ArrayList<>(); } if(options != null) { if (options.isResolve()) { try { OpenAPIDeserializer deserializer = new OpenAPIDeserializer(); JsonNode rootNode = mapper.readTree(swaggerAsString.getBytes()); SwaggerParseResult deserializeOpenAPI = deserializer.deserialize(rootNode); OpenAPIResolver resolver = new OpenAPIResolver(deserializeOpenAPI.getOpenAPI(), auth, null); result.setOpenAPI(resolver.resolve()); } catch (Exception e) { result.setMessages(Arrays.asList(e.getMessage())); } <START> } <END> } } else { result.setMessages(Arrays.asList("No swagger supplied")); } return result; }</code><technical_language>above, please deserializer if resolve is set, if options null</technical_language>

Target:
public SwaggerParseResult readContents(String swaggerAsString, List<AuthorizationValue> auth, ParseOptions options) { SwaggerParseResult result = new SwaggerParseResult(); if(swaggerAsString != null && !"".equals(swaggerAsString.trim())) { ObjectMapper mapper; if(swaggerAsString.trim().startsWith("{")) { mapper = JSON_MAPPER; } else { mapper = YAML_MAPPER; } if(auth == null) { auth = new ArrayList<>(); } if(options != null) { if (options.isResolve()) { try { OpenAPIDeserializer deserializer = new OpenAPIDeserializer(); JsonNode rootNode = mapper.readTree(swaggerAsString.getBytes()); SwaggerParseResult deserializeOpenAPI = deserializer.deserialize(rootNode); OpenAPIResolver resolver = new OpenAPIResolver(deserializeOpenAPI.getOpenAPI(), auth, null); result.setOpenAPI(resolver.resolve()); } catch (Exception e) { result.setMessages(Arrays.asList(e.getMessage())); } }else{ try { JsonNode rootNode = mapper.readTree(swaggerAsString.getBytes()); result = new OpenAPIDeserializer().deserialize(rootNode); } catch (Exception e) { result.setMessages(Arrays.asList(e.getMessage())); } } }else{ try { JsonNode rootNode = mapper.readTree(swaggerAsString.getBytes()); result = new OpenAPIDeserializer().deserialize(rootNode); } catch (Exception e) { result.setMessages(Arrays.asList(e.getMessage())); } } } else { result.setMessages(Arrays.asList("No swagger supplied")); } return result; }
Source:
<code>boolean validatePluginAction(String pluginName, boolean allowWhileLoading) { Plugin plugin = getPlugin(pluginName); if (plugin == null) { return false; } boolean isInitializingOrInUse = plugin.isInState(PluginState.INITIALIZING) || plugin.isInState(PluginState.IN_USE); boolean isLoading = plugin.isInState(PluginState.LOADING); <START> return allowWhileLoading ? (isLoading || isInitializingOrInUse) : isInitializingOrInUse; <END> }</code><technical_language>return isInitializingOrInUse || (allowWhileLoading && isLoading);</technical_language>

Target:
boolean validatePluginAction(String pluginName, boolean allowWhileLoading) { Plugin plugin = getPlugin(pluginName); if (plugin == null) { return false; } boolean isInitializingOrInUse = plugin.isInState(PluginState.INITIALIZING) || plugin.isInState(PluginState.IN_USE); boolean isLoading = plugin.isInState(PluginState.LOADING); return isInitializingOrInUse || (allowWhileLoading && isLoading); }
Source:
<code>public void initTrackerServers(List<TrackerServer> serverList) { TrackerServer server = new TrackerServer(new ServerBootstrap(), this.getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { <START> pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024, true, false)); <END> pipeline.addLast("objectEncoder", new GranitProtocolEncoder()); pipeline.addLast("objectDecoder", new GranitProtocolDecoder(GranitProtocol.this)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); serverList.add(server); }</code><technical_language>do 3-argument constructor here</technical_language>

Target:
public void initTrackerServers(List<TrackerServer> serverList) { TrackerServer server = new TrackerServer(new ServerBootstrap(), this.getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("objectEncoder", new GranitProtocolEncoder()); pipeline.addLast("objectDecoder", new GranitProtocolDecoder(GranitProtocol.this)); } }; server.setEndianness(ByteOrder.LITTLE_ENDIAN); serverList.add(server); }
Source:
<code>public API(String name, String context) { super(name); setContext(context); <START> restUtils = new RESTUtils(); <END> }</code><technical_language>avoid this a static function below</technical_language>

Target:
public API(String name, String context) { super(name); setContext(context); }
Source:
<code>public void handle(FilterResult result, Message message, Subscription subscription) { if (result.isFiltered()) { if (logger.isDebugEnabled()) { logger.debug("Message filtered for subscription {}", subscription.getQualifiedName(), result); } offsetQueue.offerCommittedOffset(SubscriptionPartitionOffset.subscriptionPartitionOffset(message, subscription)); updateMetrics(message, subscription); <START> trackers.get(subscription).logFiltered(toMessageMetadata(message, subscription), result.getFilterType().get()); <END> consumerRateLimiter.acquireFiltered(); } }</code><technical_language>I leave this if { ... }, code is synchronous calling toMessageMetadata a message converter everytime, noOpTracker is used</technical_language>

Target:
public void handle(FilterResult result, Message message, Subscription subscription) { if (result.isFiltered()) { if (logger.isDebugEnabled()) { logger.debug("Message filtered for subscription {}", subscription.getQualifiedName(), result); } offsetQueue.offerCommittedOffset(SubscriptionPartitionOffset.subscriptionPartitionOffset(message, subscription)); updateMetrics(message, subscription); if(subscription.isTrackingEnabled()) { trackers.get(subscription).logFiltered(toMessageMetadata(message, subscription), result.getFilterType().get()); } consumerRateLimiter.acquireFiltered(); } }
Source:
<code>public List<String> getLZOsOlderThan(int daysAgo) throws IOException { List<String> out = new ArrayList<String>(); List<Long> hourDirs = new ArrayList<Long>(); int nFiles = 0; FileStatus[] stats = getFileSystem().listStatus(new Path(HadoopLogsConfigs.getMapreduceInputPrefix())); <START> Long ninetyDaysAgoLong = StaticDateTimeUtils.dateTimeToHourLong( <END> StaticDateTimeUtils.nowDateTime( true).minusDays(daysAgo)); for (FileStatus stat : stats) { try { String pathStr = pathTailString(stat); long hourLong = Long.parseLong(pathStr); if (hourLong < ninetyDaysAgoLong) { nFiles++; hourDirs.add(hourLong); } } catch (Exception ex) { continue; } } Collections.sort(hourDirs); for (Long hourLong : hourDirs) { String pathStr = StaticFileUtils.joinPath(HadoopLogsConfigs.getMapreduceInputPrefix(), hourLong.toString()); out.add(pathStr); } return out; }</code><technical_language>variable 'ninetyDaysAgoLong' changed 'daysAgoLong' similar days</technical_language>

Target:
public List<String> getLZOsOlderThan(int daysAgo) throws IOException { List<String> out = new ArrayList<String>(); List<Long> hourDirs = new ArrayList<Long>(); int nFiles = 0; FileStatus[] stats = getFileSystem().listStatus(new Path(HadoopLogsConfigs.getMapreduceInputPrefix())); Long daysAgoLimit = StaticDateTimeUtils.dateTimeToHourLong( StaticDateTimeUtils.nowDateTime( true).minusDays(daysAgo)); for (FileStatus stat : stats) { try { String pathStr = pathTailString(stat); long hourLong = Long.parseLong(pathStr); if (hourLong < daysAgoLimit) { nFiles++; hourDirs.add(hourLong); } } catch (Exception ex) { continue; } } Collections.sort(hourDirs); for (Long hourLong : hourDirs) { String pathStr = StaticFileUtils.joinPath(HadoopLogsConfigs.getMapreduceInputPrefix(), hourLong.toString()); out.add(pathStr); } return out; }
Source:
<code>public String getModuleName() { if (moduleAttribute == null) return null; <START> return moduleAttribute.module_name; <END> }</code><technical_language>methods delegate equivalent methods in ClassDef</technical_language>

Target:
public String getModuleName() { return classDef.getModuleName(); }
Source:
<code>private BigDecimal fromDenonValue(String string) { BigDecimal value = new BigDecimal(string); if (value.compareTo(new BigDecimal("99")) == 1 || (string.startsWith("0") && string.length() > 2)) { <START> value = value.divide(new BigDecimal("10")); <END> } return value; }</code><technical_language>extract 99 10 a final static member constant</technical_language>

Target:
private BigDecimal fromDenonValue(String string) { BigDecimal value = new BigDecimal(string); if (value.compareTo(NINETYNINE) == 1 || (string.startsWith("0") && string.length() > 2)) { value = value.divide(BigDecimal.TEN); } return value; }
Source:
<code>public Document getPolicyDocumentByPatientId(String patientId) { LOG.info("Begin AdapterPAPImpl.getPolicyDocument(...)"); Document document = new Document(); try { DocumentQueryParams params = new DocumentQueryParams(); LOG.debug("patientid:" + patientId); params.setPatientId(patientId); List<String> classCodeValues = new ArrayList<>(); classCodeValues.add(AdapterPAPConstants.DOCUMENT_CLASS_CODE); params.setClassCodes(classCodeValues); DocumentService service = new DocumentService(); List<Document> docs = service.documentQuery(params); int docsSize = 0; <START> if (!CollectionUtils.isEmpty(docs)){ <END> docsSize = docs.size(); document = docs.get(0); } LOG.debug("Document size: {}", docsSize); } catch (Exception ex) { LOG.error("Exception occured while retrieving documents: {}", ex.getLocalizedMessage(), ex); } LOG.info("End AdapterPAPImpl.getPolicyDocument(...)"); return document; }</code><technical_language>CollectionUtils.isNotEmpty(docs) -this more clearer easy read</technical_language>

Target:
public Document getPolicyDocumentByPatientId(String patientId) { LOG.info("Begin AdapterPAPImpl.getPolicyDocument(...)"); Document document = new Document(); try { DocumentQueryParams params = new DocumentQueryParams(); LOG.debug("patientid:" + patientId); params.setPatientId(patientId); List<String> classCodeValues = new ArrayList<>(); classCodeValues.add(AdapterPAPConstants.DOCUMENT_CLASS_CODE); params.setClassCodes(classCodeValues); DocumentService service = new DocumentService(); List<Document> docs = service.documentQuery(params); int docsSize = 0; if (CollectionUtils.isNotEmpty(docs)){ docsSize = docs.size(); document = docs.get(0); } LOG.debug("Document size: {}", docsSize); } catch (Exception ex) { LOG.error("Exception occured while retrieving documents: {}", ex.getLocalizedMessage(), ex); } LOG.info("End AdapterPAPImpl.getPolicyDocument(...)"); return document; }
Source:
<code>protected Object setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, WriteCommand command, CompletionStage<Void> delay) { <START> if (delay != null) { <END> return asyncValue(delay).thenApply(ctx, command, (rCtx, rCommand, rValue) -> invokeNextAndHandle(ctx, command, handleManyWriteReturn)); } return invokeNextAndHandle(ctx, command, handleManyWriteReturn); }</code><technical_language>check if delay is completed</technical_language>

Target:
protected Object setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, WriteCommand command, CompletionStage<Void> delay) { return makeStage(asyncInvokeNext(ctx, command, delay)).andHandle(ctx, command, handleManyWriteReturn); }
Source:
<code>private static ObjectMapper createObjectMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false); <START> mapper.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true); <END> mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.setDateFormat(new ISO8601DateFormat()); return mapper; }</code><technical_language>Remove this (ORDER_MAP_ENTRIES_BY_KEYS)</technical_language>

Target:
private static ObjectMapper createObjectMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); mapper.setDateFormat(new ISO8601DateFormat()); return mapper; }
Source:
<code>public void updateInPerspective(@NotNull ActionEvent e) { CurrentProject project = appContext.getCurrentProject(); <START> if (project == null || !"maven".equals(project.getRootProject().getType())) { <END> e.getPresentation().setEnabledAndVisible(false); return; } Selection<?> selection = projectExplorer.getSelection(); if (selection == null) { e.getPresentation().setEnabledAndVisible(false); return; } e.getPresentation().setVisible(true); e.getPresentation().setEnabled(selection.isSingleSelection() && (selection.getHeadElement() instanceof SourceFolderNode || selection.getHeadElement() instanceof PackageNode)); }</code><technical_language>special constant for Maven PType ID: <LINK_0></technical_language>

Target:
public void updateInPerspective(@NotNull ActionEvent e) { CurrentProject project = appContext.getCurrentProject(); if (project == null || !MAVEN.equals(project.getRootProject().getType())) { e.getPresentation().setEnabledAndVisible(false); return; } Selection<?> selection = projectExplorer.getSelection(); if (selection == null) { e.getPresentation().setEnabledAndVisible(false); return; } e.getPresentation().setVisible(true); e.getPresentation().setEnabled(selection.isSingleSelection() && (selection.getHeadElement() instanceof SourceFolderNode || selection.getHeadElement() instanceof PackageNode)); }
Source:
<code>public void getConditionByUuid_shouldFindConditionGivenValidUuid() { executeDataSet(CONDITION_XML); String uuid="2cc6880e-2c46-15e4-9038-a6c5e4d22fb7"; String clinical_status = "INACTIVE"; String verification_status = "PROVISIONAL"; <START> expectedException = ExpectedException.none(); <END> Condition condition = conditionService.getConditionByUuid(uuid); Assert.assertEquals(clinical_status, condition.getClinicalStatus().toString()); Assert.assertEquals(verification_status, condition.getVerificationStatus().toString()); }</code><technical_language>is of expectedException</technical_language>

Target:
public void getConditionByUuid_shouldFindConditionGivenValidUuid() { String uuid="2cc6880e-2c46-15e4-9038-a6c5e4d22fb7"; Condition condition = conditionService.getConditionByUuid(uuid); Assert.assertEquals(uuid, condition.getUuid()); }
Source:
<code>public ValidationResult validate(Object value) { ValidationResult result = new ValidationResult(); if (value != null && ((value instanceof String && !value.equals("")) || value instanceof Integer)) { Integer intValue = value instanceof String ? IntegerCompat.tryParse((String) value) : (Integer) value; String msg = ""; String prefixMsg = ConstantsManager.getInstance().getConstants().thisFieldMustContainIntegerNumberInvalidReason(); if (intValue == null) { result.setSuccess(false); msg = ConstantsManager.getInstance() .getMessages() .integerValidationNumberBetweenInvalidReason(prefixMsg, getMinimum(), getMaximum()); result.getReasons().add(msg); } else if (intValue < getMinimum() || intValue > getMaximum()) { if (getMinimum() != Integer.MIN_VALUE && getMaximum() != Integer.MAX_VALUE) { msg = ConstantsManager.getInstance() .getMessages() .integerValidationNumberBetweenInvalidReason(prefixMsg, getMinimum(), getMaximum()); } else if (getMinimum() != Integer.MIN_VALUE) { msg = ConstantsManager.getInstance() .getMessages() .integerValidationNumberGreaterInvalidReason(prefixMsg, getMinimum()); } else if (getMaximum() != Integer.MAX_VALUE) { if (getMaximum() == 0) { msg = <START> ConstantsManager.getInstance().getConstants().virtualDiskMaxSizeReached(); <END> } else { msg = ConstantsManager.getInstance() .getMessages() .integerValidationNumberLessInvalidReason(prefixMsg, getMaximum()); } } result.setSuccess(false); result.getReasons().add(msg); } } return result; }</code><technical_language>This class is for generic Integer validation. Adding specific message for disk this in unwanted places</technical_language>

Target:
public ValidationResult validate(Object value) { ValidationResult result = new ValidationResult(); if (value != null && ((value instanceof String && !value.equals("")) || value instanceof Integer)) { Integer intValue = value instanceof String ? IntegerCompat.tryParse((String) value) : (Integer) value; String msg = ""; String prefixMsg = ConstantsManager.getInstance().getConstants().thisFieldMustContainIntegerNumberInvalidReason(); if (intValue == null) { result.setSuccess(false); msg = ConstantsManager.getInstance() .getMessages() .integerValidationNumberBetweenInvalidReason(prefixMsg, getMinimum(), getMaximum()); result.getReasons().add(msg); } else if (intValue < getMinimum() || intValue > getMaximum()) { if (getMinimum() != Integer.MIN_VALUE && getMaximum() != Integer.MAX_VALUE) { msg = ConstantsManager.getInstance() .getMessages() .integerValidationNumberBetweenInvalidReason(prefixMsg, getMinimum(), getMaximum()); } else if (getMinimum() != Integer.MIN_VALUE) { msg = ConstantsManager.getInstance() .getMessages() .integerValidationNumberGreaterInvalidReason(prefixMsg, getMinimum()); } else if (getMaximum() != Integer.MAX_VALUE) { msg = ConstantsManager.getInstance() .getMessages() .integerValidationNumberLessInvalidReason(prefixMsg, getMaximum()); } result.setSuccess(false); result.getReasons().add(msg); } } return result; }
Source:
<code>public <START> synchronized IncrementalProjectBuilder <END> getBuilder(IBuildConfiguration config) { synchronized (builderLock) { if (builders != null && supportsConfigs()) return builders.get(config); return builder; } }</code><technical_language>Please remove this</technical_language>

Target:
public IncrementalProjectBuilder getBuilder(IBuildConfiguration config) { synchronized (builderLock) { if (builders != null && supportsConfigs()) return builders.get(config); return builder; } }
Source:
<code>public void testInputOutputBindingOrder() { <START> ConfigurableApplicationContext applicationContext = SpringApplication.run(TestSource.class, "--server.port=-1", <END> "--spring.cloud.stream.defaultBinder=mock"); @SuppressWarnings("rawtypes") Binder binder = applicationContext.getBean(BinderFactory.class).getBinder(null, MessageChannel.class); Processor processor = applicationContext.getBean(Processor.class); verify(binder).bindConsumer(eq("input"), isNull(), eq(processor.input()), Mockito.any()); SomeLifecycle someLifecycle = applicationContext.getBean(SomeLifecycle.class); assertThat(someLifecycle.isRunning()); applicationContext.close(); assertThat(someLifecycle.isRunning()).isFalse(); applicationContext.close(); }</code><technical_language>wrong web exclude property again. I is guarantee a server.port=-1 turn web environment in application context</technical_language>

Target:
public void testInputOutputBindingOrder() { ConfigurableApplicationContext applicationContext = SpringApplication.run(TestSource.class, "--spring.cloud.stream.defaultBinder=mock"); @SuppressWarnings("rawtypes") Binder binder = applicationContext.getBean(BinderFactory.class).getBinder(null, MessageChannel.class); Processor processor = applicationContext.getBean(Processor.class); verify(binder).bindConsumer(eq("input"), isNull(), eq(processor.input()), Mockito.any()); SomeLifecycle someLifecycle = applicationContext.getBean(SomeLifecycle.class); assertThat(someLifecycle.isRunning()); applicationContext.close(); assertThat(someLifecycle.isRunning()).isFalse(); applicationContext.close(); }
Source:
<code>public void set(TypedHistogram value) { if (value instanceof SingleTypedHistogram) { typedHistogram = (SingleTypedHistogram) value; } else { <START> slowPathSet(value); <END> } }</code><technical_language>fail if is of expected type</technical_language>

Target:
public void set(TypedHistogram value) { checkArgument(value instanceof SingleTypedHistogram, "set must be called with class type % only. Received %s", this.getClass(), value.getClass()); typedHistogram = (SingleTypedHistogram) value; }
Source:
<code>private void rollbackCoveredTx(ExchangeActions exchActions) { <START> Set<Integer> cachesToStop; <END> if (!exchActions.cacheGroupsToStop().isEmpty() || !exchActions.cacheStopRequests().isEmpty()) { cachesToStop = new HashSet<>(); for (ExchangeActions.CacheGroupActionData act : exchActions.cacheGroupsToStop()) { @Nullable CacheGroupContext grpCtx = context().cache().cacheGroup(act.descriptor().groupId()); if (grpCtx != null && grpCtx.sharedGroup()) cachesToStop.addAll(grpCtx.cacheIds()); } for (ExchangeActions.CacheActionData act : exchActions.cacheStopRequests()) cachesToStop.add(act.descriptor().cacheId()); if (!cachesToStop.isEmpty()) { IgniteTxManager tm = context().tm(); Collection<IgniteInternalTx> active = tm.activeTransactions(); GridCompoundFuture<IgniteInternalTx, IgniteInternalTx> compFut = new GridCompoundFuture<>(); for (IgniteInternalTx tx : active) { for (IgniteTxEntry e : tx.allEntries()) { if (cachesToStop.contains(e.context().cacheId())) { compFut.add(tx.rollbackAsync()); break; } } } compFut.markInitialized(); try { compFut.get(); } catch (IgniteCheckedException e) { U.error(log, "Error occured during tx rollback.", e); } } } }</code><technical_language>get defining variable is necessary</technical_language>

Target:
private void rollbackCoveredTx(ExchangeActions exchActions) { if (!exchActions.cacheGroupsToStop().isEmpty() || !exchActions.cacheStopRequests().isEmpty()) { Set<Integer> cachesToStop = new HashSet<>(); for (ExchangeActions.CacheGroupActionData act : exchActions.cacheGroupsToStop()) { @Nullable CacheGroupContext grpCtx = context().cache().cacheGroup(act.descriptor().groupId()); if (grpCtx != null && grpCtx.sharedGroup()) cachesToStop.addAll(grpCtx.cacheIds()); } for (ExchangeActions.CacheActionData act : exchActions.cacheStopRequests()) cachesToStop.add(act.descriptor().cacheId()); if (!cachesToStop.isEmpty()) { IgniteTxManager tm = context().tm(); tm.rollbackTransactionsForCaches(cachesToStop); } } }
Source:
<code>private static Object getCellValueAsObject(final Workbook workbook, final Cell cell) { if (cell == null) { return null; } final Object result; switch (cell.getCellType()) { case BLANK: case _NONE: result = null; break; case BOOLEAN: result = Boolean.valueOf(cell.getBooleanCellValue()); break; case ERROR: <START> String errorResult; <END> try { errorResult = FormulaError.forInt(cell.getErrorCellValue()).getString(); } catch (final RuntimeException e) { logger .debug("Getting error code for ({},{}) failed!: {}", cell.getRowIndex(), cell.getColumnIndex(), e.getMessage()); if (cell instanceof XSSFCell) { errorResult = ((XSSFCell) cell).getErrorCellString(); } else { logger .error("Couldn't handle unexpected error scenario in cell: (" + cell.getRowIndex() + "," + cell.getColumnIndex() + ")", e); throw e; } } result = errorResult; break; case FORMULA: result = getFormulaCellValueAsObject(workbook, cell); break; case NUMERIC: if (DateUtil.isCellDateFormatted(cell)) { result = cell.getDateCellValue(); } else { result = getDoubleAsNumber(cell.getNumericCellValue()); } break; case STRING: result = cell.getRichStringCellValue().getString(); break; default: throw new IllegalStateException("Unknown cell type: " + cell.getCellType()); } logger.debug("cell ({},{}) resolved to value: {}", cell.getRowIndex(), cell.getColumnIndex(), result); return result; }</code><technical_language>This code a carbon copy of code (lines 189-209). extract a getErrorResult(Cell) method reuse places</technical_language>

Target:
private static Object getCellValueAsObject(final Workbook workbook, final Cell cell) { if (cell == null) { return null; } final Object result; switch (cell.getCellType()) { case BLANK: case _NONE: result = null; break; case BOOLEAN: result = Boolean.valueOf(cell.getBooleanCellValue()); break; case ERROR: result = getErrorResult(cell); break; case FORMULA: result = getFormulaCellValueAsObject(workbook, cell); break; case NUMERIC: if (DateUtil.isCellDateFormatted(cell)) { result = cell.getDateCellValue(); } else { result = getDoubleAsNumber(cell.getNumericCellValue()); } break; case STRING: result = cell.getRichStringCellValue().getString(); break; default: throw new IllegalStateException("Unknown cell type: " + cell.getCellType()); } logger.debug("cell ({},{}) resolved to value: {}", cell.getRowIndex(), cell.getColumnIndex(), result); return result; }
Source:
<code>private void transitionSlotToAllocated(DeclarativeTaskManagerSlot slot, JobID jobId) { Preconditions.checkNotNull(slot); Preconditions.checkState(slot.getState() == SlotState.PENDING); Preconditions.checkState(jobId.equals(slot.getJobId())); <START> slotStatusUpdateListener.notifySlotStatusChange(slot, SlotState.PENDING, SlotState.ALLOCATED, jobId); slot.completeAllocation(); } <END></code><technical_language>a difference slotStatusUpdateListener.notifySlotStatusChange is called effectuating state change slot? I asking transitionSlotToPending transitionSlotToFree do in order</technical_language>

Target:
private void transitionSlotToAllocated(DeclarativeTaskManagerSlot slot, JobID jobId) { Preconditions.checkNotNull(slot); Preconditions.checkState(slot.getState() == SlotState.PENDING); Preconditions.checkState(jobId.equals(slot.getJobId())); slot.completeAllocation(); slotStatusUpdateListeners.notifySlotStatusChange(slot, SlotState.PENDING, SlotState.ALLOCATED, jobId); }
Source:
<code>public ProductItem(int id, @Nullable String description, @Nullable String softwareDescriptionId, @Nullable SoftwareDescription softwareDescription) { <START> this.id = checkNotNull(id, "id"); <END> this.description = description; this.softwareDescriptionId = softwareDescriptionId; this.softwareDescription = softwareDescription; }</code><technical_language>A primitive int null, remove this check</technical_language>

Target:
public ProductItem(int id, @Nullable String description, @Nullable String softwareDescriptionId, @Nullable SoftwareDescription softwareDescription) { this.id = id; this.description = description; this.softwareDescriptionId = softwareDescriptionId; this.softwareDescription = softwareDescription; }
Source:
<code>protected void readOsSection(XmlNode section) { _vm.getStaticData().setId(new Guid(section.Attributes.get("ovf:id").getValue())); XmlNode node = section.SelectSingleNode("Description"); <START> if (node.InnerText.equals(6)) { <END> node.InnerText = "0"; } if (node != null) { _vm.getStaticData().setOsId(osRepository.getOsIdByUniqueName(node.InnerText)); } }</code><technical_language>please magic numbers in code</technical_language>

Target:
protected void readOsSection(XmlNode section) { _vm.getStaticData().setId(new Guid(section.Attributes.get("ovf:id").getValue())); XmlNode node = section.SelectSingleNode("Description"); if (node.InnerText.equals(String.valueOf(OsRepository.OLD_OTHER_ID))) { node.InnerText = String.valueOf(OsRepository.DEFAULT_OS); } if (node != null) { _vm.getStaticData().setOsId(osRepository.getOsIdByUniqueName(node.InnerText)); } }
Source:
<code>@Override public Expression implement(RexToLixTranslator translator, Expression inputEnumerable, RexCall call, PhysType inputPhysType, PhysType outputPhysType) { Expression intervalExpression = translator.translate(call.getOperands().get(1)); RexCall descriptor = (RexCall) call.getOperands().get(0); List<Expression> translatedOperands = new ArrayList<>(); final ParameterExpression parameter = Expressions.parameter(Primitive.box(inputPhysType.getJavaRowType()), "_input"); Expression wmColExpr = inputPhysType.fieldReference(parameter, ((RexInputRef) descriptor.getOperands().get(0)).getIndex(), outputPhysType.getJavaFieldType( inputPhysType.getRowType().getFieldCount())); translatedOperands.add(wmColExpr); translatedOperands.add(intervalExpression); final Expression offsetExpr = call.getOperands().size() > 2 ? translator.translate(call.getOperands().get(2)) : Expressions.constant(0, long.class); translatedOperands.add(offsetExpr); return Expressions.call( BuiltInMethod.TUMBLING.method, inputEnumerable, EnumUtils.tumblingWindowSelector( inputPhysType, outputPhysType, <START> translatedOperands.get(0), <END> translatedOperands.get(1), translatedOperands.get(2))); }</code><technical_language>Is special reason a list translatedOperands</technical_language>

Target:
@Override public Expression implement(RexToLixTranslator translator, Expression inputEnumerable, RexCall call, PhysType inputPhysType, PhysType outputPhysType) { Expression intervalExpression = translator.translate(call.getOperands().get(1)); RexCall descriptor = (RexCall) call.getOperands().get(0); final ParameterExpression parameter = Expressions.parameter(Primitive.box(inputPhysType.getJavaRowType()), "_input"); Expression wmColExpr = inputPhysType.fieldReference(parameter, ((RexInputRef) descriptor.getOperands().get(0)).getIndex(), outputPhysType.getJavaFieldType( inputPhysType.getRowType().getFieldCount())); final Expression offsetExpr = call.getOperands().size() > 2 ? translator.translate(call.getOperands().get(2)) : Expressions.constant(0, long.class); return Expressions.call( BuiltInMethod.TUMBLING.method, inputEnumerable, EnumUtils.tumblingWindowSelector( inputPhysType, outputPhysType, wmColExpr, intervalExpression, offsetExpr)); }