auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public RecordWriter getRecordWriter(final HdfsSinkConnectorConfig conf, final String filename) { try { return new RecordWriter() { final Path path = new Path(filename); final OutputStream out = path.getFileSystem(conf.getHadoopConfiguration()).create(path); final OutputStreamWriter writer = new OutputStreamWriter(out); @Override public void write(SinkRecord record) { log.trace("Sink record: {}", record.toString()); try { String value = (String) record.value(); <START> <END> writer.write(value); writer.write(LINE_SEPARATOR); } catch (IOException e) { throw new ConnectException(e); } } @Override public void commit() @Override public void close() { try { writer.close(); } catch (IOException e) { throw new ConnectException(e); } } }; } catch (IOException e) { throw new ConnectException(e); } }</code><technical_language>tighter here. Extra blank line</technical_language>

Target:
public RecordWriter getRecordWriter(final HdfsSinkConnectorConfig conf, final String filename) { try { return new RecordWriter() { final Path path = new Path(filename); final OutputStream out = path.getFileSystem(conf.getHadoopConfiguration()).create(path); final OutputStreamWriter streamWriter = new OutputStreamWriter( out, Charset.defaultCharset() ); final BufferedWriter writer = new BufferedWriter(streamWriter, WRITER_BUFFER_SIZE); @Override public void write(SinkRecord record) { log.trace("Sink record: {}", record.toString()); try { String value = (String) record.value(); writer.write(value); writer.newLine(); } catch (IOException e) { throw new ConnectException(e); } } @Override public void commit() @Override public void close() { try { writer.close(); } catch (IOException e) { throw new ConnectException(e); } } }; } catch (IOException e) { throw new ConnectException(e); } }
Source:
<code>public boolean isStaticQnNumberVisible(int qnNumber) { <START> WebElement discardChangesButton = <END> browser.driver.findElement( By.id(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER_STATIC + "-" + qnNumber)); return discardChangesButton.isDisplayed(); }</code><technical_language>element referencing is discardChanges button. Lets rename variable in testing functions element is</technical_language>

Target:
public boolean isStaticQnNumberVisible(int qnNumber) { try { WebElement selectQuestionNumberStatic = browser.driver.findElement(By.id(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER_STATIC + "-" + qnNumber)); return selectQuestionNumberStatic.isDisplayed(); } catch (NoSuchElementException nsee) { return false; } }
Source:
<code>private void flush() { synchronized (lock) { tableToBulkMutation.values().stream().forEach(mutation -> { try { mutation.flush(); <START> } catch (final InterruptedException e) { <END> throw new RuntimeException(e); } }); } }</code><technical_language>This block, flush method part of block either. change that, eat threads in other places. blocks BigtableMutatorImpl#lock Lock, is queue new mutations is in direct write path. work this, a nonblocking API (if available), spin another thread pool queue deal this here</technical_language>

Target:
private void flush() { synchronized (flushLock) { tableToBulkMutation.values().stream().forEach(mutation -> { try { mutation.flush(); } catch (final InterruptedException e) { throw new RuntimeException(e); } }); } }
Source:
<code>private void registerServerTransactionTable(ComponentRegistry componentRegistry, String cacheName) { if (GLOBAL_TX_TABLE_CACHE_NAME.equals(cacheName) || !componentRegistry.getComponent(Configuration.class).transaction().transactionMode().isTransactional()) { return; } EmbeddedCacheManager cacheManager = componentRegistry.getGlobalComponentRegistry() .getComponent(EmbeddedCacheManager.class); createGlobalTxTable(cacheManager); BasicComponentRegistry basicComponentRegistry = componentRegistry.getComponent(BasicComponentRegistry.class); basicComponentRegistry.replaceComponent(PerCacheTxTable.class.getName(), new PerCacheTxTable(cacheManager.getAddress()), true); basicComponentRegistry.replaceComponent(TransactionOriginatorChecker.class.getName(), new ServerTransactionOriginatorChecker(), true); <START> basicComponentRegistry.rewire(); <END> componentRegistry.rewire(); }</code><technical_language>This rewire BCR a time</technical_language>

Target:
private void registerServerTransactionTable(ComponentRegistry componentRegistry, String cacheName) { if (GLOBAL_TX_TABLE_CACHE_NAME.equals(cacheName) || !componentRegistry.getComponent(Configuration.class).transaction().transactionMode().isTransactional()) { return; } EmbeddedCacheManager cacheManager = componentRegistry.getGlobalComponentRegistry() .getComponent(EmbeddedCacheManager.class); createGlobalTxTable(cacheManager); BasicComponentRegistry basicComponentRegistry = componentRegistry.getComponent(BasicComponentRegistry.class); basicComponentRegistry.replaceComponent(PerCacheTxTable.class.getName(), new PerCacheTxTable(cacheManager.getAddress()), true); basicComponentRegistry.replaceComponent(TransactionOriginatorChecker.class.getName(), new ServerTransactionOriginatorChecker(), true); componentRegistry.rewire(); }
Source:
<code>public boolean equals(byte[] obj, Object otherObj) { if (obj == otherObj) return true; <START> if (obj == null || byte[].class != obj.getClass()) return false; <END> if (otherObj == null || byte[].class != otherObj.getClass()) return false; byte[] byteArray = obj; byte[] otherByteArray = (byte[]) otherObj; return Arrays.equals(byteArray, otherByteArray); }</code><technical_language>part of is redundant: byte[].class != obj.getClass()</technical_language>

Target:
public boolean equals(byte[] obj, Object otherObj) { if (obj == otherObj) return true; if (obj == null) return false; if (otherObj == null || byte[].class != otherObj.getClass()) return false; byte[] otherByteArray = (byte[]) otherObj; return Arrays.equals(obj, otherByteArray); }
Source:
<code>public MaintenanceWorkflow() { super(MAINTENANCE_WORKFLOW_TYPE); <START> setDescription("Do nFlow maintenance periodically."); <END> }</code><technical_language>suggestion setDescription("Clean workflow instances periodically.");</technical_language>

Target:
public MaintenanceWorkflow() { super(MAINTENANCE_WORKFLOW_TYPE); setDescription("Clean up workflow instances periodically."); }
Source:
<code>public IgniteConfiguration() { compressorsSelector = new HashMap<>(); compressorsSelector.put(CompressionType.GZIP, new GZipCompressor()); compressorsSelector.put(CompressionType.DEFLATE, new DeflaterCompressor()); <START> fullCompressionType = CompressionType.GZIP; <END> }</code><technical_language>add COMPRESSED_CUSTOM</technical_language>

Target:
public IgniteConfiguration() { }
Source:
<code>public Change(String entityId, long revision, Date timestamp, long rcid) { if (entityId.startsWith("Property:")) { this.entityId = entityId.substring("Property:".length()); } else if (entityId.startsWith("Item:")) { this.entityId = entityId.substring("Item:".length()); } else { this.entityId = entityId; } this.revision = revision; <START> this.timestamp = timestamp != null ? new Date(timestamp.getTime()) : null; <END> this.rcid = rcid; }</code><technical_language>a big fan of this one. leave move Java 8 immutable dates in next patch</technical_language>

Target:
public Change(String entityId, long revision, Date timestamp, long rcid) { if (entityId.startsWith("Property:")) { this.entityId = entityId.substring("Property:".length()); } else if (entityId.startsWith("Item:")) { this.entityId = entityId.substring("Item:".length()); } else { this.entityId = entityId; } this.revision = revision; this.timestamp = timestamp; this.rcid = rcid; }
Source:
<code>private Jwt validateJwt(Jwt jwt) { OAuth2TokenValidatorResult result = this.jwtValidator.validate(jwt); if ( result.hasErrors() ) { final Collection<OAuth2Error> errors = result.getErrors(); <START> final Optional<String> validationErrorString = errors.stream() <END> .map(OAuth2Error::getDescription) .filter(Objects::nonNull) .findFirst(); throw new JwtValidationException(validationErrorString.orElse("Unable to validate Jwt"), errors); } return jwt; }</code><technical_language>I agree this more check is improvement. For now, Optional Stream taxing garbage collector in Spring Security. please change this a for loop finds non-null description? do in a separate method</technical_language>

Target:
private Jwt validateJwt(Jwt jwt) { OAuth2TokenValidatorResult result = this.jwtValidator.validate(jwt); if ( result.hasErrors() ) { final Collection<OAuth2Error> errors = result.getErrors(); String validationErrorString = "Unable to validate Jwt"; for (OAuth2Error oAuth2Error: errors){ if (!StringUtils.isEmpty(oAuth2Error.getDescription())) { validationErrorString = oAuth2Error.getDescription(); break; } } throw new JwtValidationException(validationErrorString, errors); } return jwt; }
Source:
<code>private static Extent extentFromSource(CommandSource origin) { <START> if (origin instanceof ICommandSender) { <END> return (Extent) ((ICommandSender) origin).getEntityWorld(); } return null; }</code><technical_language>LocatedSource instead</technical_language>

Target:
private static Extent extentFromSource(CommandSource origin) { if (origin instanceof LocatedSource) { return ((LocatedSource) origin).getWorld(); } return null; }
Source:
<code>protected Map<String, Pair<String, String>> getSharedLocks() { Map<String, Pair<String, String>> locks = new HashMap<>(); if (isTemplateVersion()) { locks.put(getParameters().getBaseTemplateId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.TEMPLATE, EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } locks.put(getParameters().getVm().getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM, <START> EngineMessage.ACTION_TYPE_FAILED_VM_IS_BEING_CLONED)); <END> return locks; }</code><technical_language>ACTION_TYPE_FAILED_TEMPLATE_IS_BEING_CREATED</technical_language>

Target:
protected Map<String, Pair<String, String>> getSharedLocks() { Map<String, Pair<String, String>> locks = new HashMap<>(); if (isTemplateVersion()) { locks.put(getParameters().getBaseTemplateId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.TEMPLATE, EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } locks.put(getParameters().getVm().getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM, EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_IS_BEING_CREATED)); return locks; }
Source:
<code>public static CassandraKeyValueService create( MetricsManager metricsManager, CassandraKeyValueServiceConfig config, CassandraMutationTimestampProvider mutationTimestampProvider, CassandraClientPool clientPool) { return createOrShutdownClientPool(metricsManager, config, CassandraKeyValueServiceRuntimeConfig::getDefault, clientPool, <START> Optional.empty(), <END> mutationTimestampProvider, LoggerFactory.getLogger(CassandraKeyValueService.class), AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC); }</code><technical_language>is this Optional.empty config.cqlClientManager()? pushing remove manager this PR, unclear nonetheless</technical_language>

Target:
public static CassandraKeyValueService create( MetricsManager metricsManager, CassandraKeyValueServiceConfig config, CassandraMutationTimestampProvider mutationTimestampProvider, CassandraClientPool clientPool) { return createOrShutdownClientPool(metricsManager, config, CassandraKeyValueServiceRuntimeConfig::getDefault, clientPool, mutationTimestampProvider, LoggerFactory.getLogger(CassandraKeyValueService.class), AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC); }
Source:
<code>public void parseFromBufferedReaderTest() throws IOException { YoutubeScraper ytubeScrape = new YoutubeScraper(); String url = "<LINK_0>"; String postType = "video"; String postScraper = "youtube"; try { BufferedReader br = new BufferedReader(new InputStreamReader((new URL(url)).openStream(), StandardCharsets.UTF_8)); Post video = ytubeScrape.parseVideo(br, "url", "<LINK_0>"); DAO.log(video.toString()); assertThat(video.get("html_title").toString(), is("[\"Iggy Azalea - Team (Explicit) - YouTube\"]")); assertEquals(postType, video.get("post_type")); <START> assertEquals(postScraper, video.get("post_scraper")); <END> } catch (IOException e) { DAO.log("YoutubeScraperTest.parseFromBufferedReaderTest()() failed to connect to network. url:" + url); } }</code><technical_language>assertThat is preferred favor consistency</technical_language>

Target:
public void parseFromBufferedReaderTest() throws IOException { YoutubeScraper ytubeScrape = new YoutubeScraper(); String url = "<LINK_0>"; String postType = "video"; String postScraper = "youtube"; try { BufferedReader br = new BufferedReader(new InputStreamReader((new URL(url)).openStream(), StandardCharsets.UTF_8)); Post video = ytubeScrape.parseVideo(br, "url", "<LINK_0>"); DAO.log(video.toString()); assertThat(video.get("html_title").toString(), is("[\"Iggy Azalea - Team (Explicit) - YouTube\"]")); assertThat(video.get("post_type"), is(postType)); assertThat(video.get("post_scraper"), is(postScraper)); } catch (IOException e) { DAO.log("YoutubeScraperTest.parseFromBufferedReaderTest()() failed to connect to network. url:" + url); } }
Source:
<code>public void testStringInputRowParserSerde() throws Exception { final StringInputRowParser parser = new StringInputRowParser( new JSONParseSpec( new TimestampSpec("timestamp", "iso", null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("foo", "bar")), null, null), null, null, <START> false <END> ), null ); final ByteBufferInputRowParser parser2 = jsonMapper.readValue( jsonMapper.writeValueAsBytes(parser), ByteBufferInputRowParser.class ); final InputRow parsed = parser2.parseBatch( ByteBuffer.wrap(StringUtils.toUtf8("{\"foo\":\"x\",\"bar\":\"y\",\"qux\":\"z\",\"timestamp\":\"2000\"}")) ).get(0); Assert.assertEquals(ImmutableList.of("foo", "bar"), parsed.getDimensions()); Assert.assertEquals(ImmutableList.of("x"), parsed.getDimension("foo")); Assert.assertEquals(ImmutableList.of("y"), parsed.getDimension("bar")); Assert.assertEquals(DateTimes.of("2000").getMillis(), parsed.getTimestampFromEpoch()); }</code><technical_language>nit: easier read if false a constant top of this test, DO_NOT_KEEP_NULL_COLUMNS</technical_language>

Target:
public void testStringInputRowParserSerde() throws Exception { final StringInputRowParser parser = new StringInputRowParser( new JSONParseSpec( new TimestampSpec("timestamp", "iso", null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("foo", "bar")), null, null), null, null, null ), null ); final ByteBufferInputRowParser parser2 = jsonMapper.readValue( jsonMapper.writeValueAsBytes(parser), ByteBufferInputRowParser.class ); final InputRow parsed = parser2.parseBatch( ByteBuffer.wrap(StringUtils.toUtf8("{\"foo\":\"x\",\"bar\":\"y\",\"qux\":\"z\",\"timestamp\":\"2000\"}")) ).get(0); Assert.assertEquals(ImmutableList.of("foo", "bar"), parsed.getDimensions()); Assert.assertEquals(ImmutableList.of("x"), parsed.getDimension("foo")); Assert.assertEquals(ImmutableList.of("y"), parsed.getDimension("bar")); Assert.assertEquals(DateTimes.of("2000").getMillis(), parsed.getTimestampFromEpoch()); }
Source:
<code>protected ActionResult execute() throws EntityDoesNotExistException { verifyBasicAccessibility(); courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); if(courseId == null){ courseId = ""; } List<String> coursePaginationList = new ArrayList<String>(); String courseName = getCoursePaginationList(coursePaginationList); if (!isJoinedCourse(courseId, account.googleId)) { return createPleaseJoinCourseResponse(courseId); } verifyAccessible(); studentEmail = logic.getStudentForGoogleId(courseId, account.googleId).email; CourseRoster roster = null; Map<String, FeedbackSessionResultsBundle> feedbackResultBundles = new HashMap<String, FeedbackSessionResultsBundle>(); List<CommentAttributes> comments = new ArrayList<CommentAttributes>(); if(coursePaginationList.size() > 0){ roster = new CourseRoster( logic.getStudentsForCourse(courseId), logic.getInstructorsForCourse(courseId)); StudentAttributes student = roster.getStudentForEmail(studentEmail); comments = logic.getCommentsForStudent(student); feedbackResultBundles = getFeedbackResultBundles(roster); } data = new StudentCommentsPageData(account); data.init(courseId, courseName, coursePaginationList, comments, roster, <START> previousPageLink, nextPageLink, studentEmail, feedbackResultBundles); <END> statusToAdmin = "studentComments Page Load<br>" + "Viewing <span class=\"bold\">" + account.googleId + "'s</span> comment records " + "for Course <span class=\"bold\">[" + courseId + "]</span>"; return createShowPageResult(Const.ViewURIs.STUDENT_COMMENTS, data); }</code><technical_language>While slightly previous one, of interpreted in *Data other variables</technical_language>

Target:
protected ActionResult execute() throws EntityDoesNotExistException { verifyBasicAccessibility(); courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); if (courseId == null) { courseId = ""; } List<String> coursePaginationList = new ArrayList<String>(); String courseName = getCoursePaginationList(coursePaginationList); if (!isJoinedCourse(courseId, account.googleId)) { return createPleaseJoinCourseResponse(courseId); } verifyAccessible(); studentEmail = logic.getStudentForGoogleId(courseId, account.googleId).email; CourseRoster roster = null; Map<String, FeedbackSessionResultsBundle> feedbackResultBundles = new HashMap<String, FeedbackSessionResultsBundle>(); List<CommentAttributes> comments = new ArrayList<CommentAttributes>(); if (coursePaginationList.size() > 0) { roster = new CourseRoster( logic.getStudentsForCourse(courseId), logic.getInstructorsForCourse(courseId)); StudentAttributes student = roster.getStudentForEmail(studentEmail); comments = logic.getCommentsForStudent(student); feedbackResultBundles = getFeedbackResultBundles(roster); } data = new StudentCommentsPageData(account); data.init(courseId, courseName, coursePaginationList, comments, roster, studentEmail, feedbackResultBundles); statusToAdmin = "studentComments Page Load<br>" + "Viewing <span class=\"bold\">" + account.googleId + "'s</span> comment records " + "for Course <span class=\"bold\">[" + courseId + "]</span>"; return createShowPageResult(Const.ViewURIs.STUDENT_COMMENTS, data); }
Source:
<code>public boolean isLossless() { return getCodecA() != null && (isPCM() || isFLAC() || isMLP() || isShorten() || isTrueHD() || <START> isWavPack() || isALAC() || isMonkeysAudio()) || isRALF() || isTTA() || isWMALossless(); <END> }</code><technical_language>AIFF</technical_language>

Target:
public boolean isLossless() { return getCodecA() != null && ( isAIFF() || isALAC() || isFLAC() || isMLP() || isMonkeysAudio() || isPCM() || isRALF() || isShorten() || isTrueHD() || isTTA() || isWAV() || isWavPack() || isWMALossless() ); }
Source:
<code>public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Map.Entry<String, InternalMachineConfig> entry : internalEnv.getMachines().entrySet()) { String name = entry.getKey(); DockerContainerConfig container = internalEnv.getContainers().get(name); HashMap<String, String> attributes = new HashMap<>(); attributes.put(Machine.MEMORY_LIMIT_ATTRIBUTE, String.valueOf(container.getMemLimit())); container .getLabels() .putAll( Labels.newSerializer() .machineName(name) <START> .machineAttributes(attributes) <END> .runtimeId(identity) .labels()); } }</code><technical_language>other machine attributes in this case> I is save</technical_language>

Target:
public void provision(DockerEnvironment internalEnv, RuntimeIdentity identity) throws InfrastructureException { for (Map.Entry<String, InternalMachineConfig> entry : internalEnv.getMachines().entrySet()) { String name = entry.getKey(); DockerContainerConfig container = internalEnv.getContainers().get(name); container .getLabels() .putAll( Labels.newSerializer() .machineName(name) .machineAttributes(entry.getValue().getAttributes()) .runtimeId(identity) .labels()); } }
Source:
<code>public static void validateParameter(String parameter, String parameterName) { if (Pattern.matches(ParameterHelper.PATTERN, parameter)) { return; } <START> throw new RuntimeException("The " + parameter + "/" + parameterName + " parameter check failed"); <END> }</code><technical_language>"The parameter " + parameterName + "not match " + ParameterHelper.PATTERN</technical_language>

Target:
public static void validateParameter(String parameter, String parameterName) { if (Pattern.matches(ParameterHelper.PATTERN, parameter)) { return; } throw new RuntimeException("The parameter " + parameterName + " not match with " + ParameterHelper.PATTERN); }
Source:
<code>protected TupleBatch fetchNextReady() throws DbException { if (!nonBlocking) { return fetchNextReadySynchronousEOI(); } if (order.equals(JoinPullOrder.LEFT) || order.equals(JoinPullOrder.LEFT_EOS)) { pollLeft = true; } else if (order.equals(JoinPullOrder.RIGHT) || order.equals(JoinPullOrder.RIGHT_EOS)) { pollLeft = false; } TupleBatch nexttb = ans.popFilled(); if (nexttb != null) { return nexttb; } if (isEOIReady()) { nexttb = ans.popAny(); if (nexttb == null) { checkEOSAndEOI(); } return nexttb; } final Operator left = getLeft(); final Operator right = getRight(); int noDataStreak = 0; while (noDataStreak < 2 && (!left.eos() || !right.eos())) { Operator current; if (pollLeft) { current = left; } else { current = right; } TupleBatch tb = current.nextReady(); if (tb != null) { processChildTB(tb, pollLeft); noDataStreak = 0; if (order.equals(JoinPullOrder.ALTER)) { pollLeft = !pollLeft; } nexttb = ans.popAnyUsingTimeout(); if (nexttb != null) { return nexttb; } } else if (current.eoi()) { consumeChildEOI(pollLeft); noDataStreak = 0; if (order.equals(JoinPullOrder.ALTER)) { pollLeft = !pollLeft; } if (isEOIReady()) { break; } } else { <START> if (pollLeft && order.equals(JoinPullOrder.LEFT_EOS) || !pollLeft && order.equals(JoinPullOrder.RIGHT_EOS)) { <END> if (!current.eos()) { break; } } pollLeft = !pollLeft; noDataStreak++; } } if (isEOIReady()) { nexttb = ans.popAny(); if (nexttb == null) { checkEOSAndEOI(); } } return nexttb; }</code><technical_language>Sorry, parens need added here</technical_language>

Target:
protected TupleBatch fetchNextReady() throws DbException { if (!nonBlocking) { return fetchNextReadySynchronousEOI(); } if (order.equals(JoinPullOrder.LEFT) || order.equals(JoinPullOrder.LEFT_EOS)) { pollLeft = true; } else if (order.equals(JoinPullOrder.RIGHT) || order.equals(JoinPullOrder.RIGHT_EOS)) { pollLeft = false; } TupleBatch nexttb = ans.popFilled(); if (nexttb != null) { return nexttb; } if (isEOIReady()) { nexttb = ans.popAny(); if (nexttb == null) { checkEOSAndEOI(); } return nexttb; } final Operator left = getLeft(); final Operator right = getRight(); int noDataStreak = 0; while (noDataStreak < 2 && (!left.eos() || !right.eos())) { Operator current; if (pollLeft) { current = left; } else { current = right; } TupleBatch tb = current.nextReady(); if (tb != null) { processChildTB(tb, pollLeft); noDataStreak = 0; if (order.equals(JoinPullOrder.ALTER)) { pollLeft = !pollLeft; } nexttb = ans.popAnyUsingTimeout(); if (nexttb != null) { return nexttb; } } else if (current.eoi()) { consumeChildEOI(pollLeft); noDataStreak = 0; if (order.equals(JoinPullOrder.ALTER)) { pollLeft = !pollLeft; } if (isEOIReady()) { break; } } else { if ((pollLeft && order.equals(JoinPullOrder.LEFT_EOS)) || (!pollLeft && order.equals(JoinPullOrder.RIGHT_EOS))) { if (!current.eos()) { break; } } pollLeft = !pollLeft; noDataStreak++; } } if (isEOIReady()) { nexttb = ans.popAny(); if (nexttb == null) { checkEOSAndEOI(); } } return nexttb; }
Source:
<code>public void execute(int iterationId) { try { if (getStorageDomain() != null && getStorageDomain().getStorageDomainType() == StorageDomainType.Master) { try { Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.ConnectStoragePool, new ConnectStoragePoolVDSCommandParameters(getVdss().get(iterationId), getStoragePool(), masterStorageDomainId, storagePoolIsoMap)); } catch (Exception e) { <START> log.error("Could not connect vds '{}' to pool '{}' - moving host to non-operational. Error: {}", <END> getVdss().get(iterationId).getName(), getStoragePool().getName(), e.getMessage()); log.debug("Exception", e); synchronized (_vdsIdsToSetNonOperational) { _vdsIdsToSetNonOperational.add(getVdss().get(iterationId).getId()); } } } else { Backend.getInstance().getResourceManager().RunVdsCommand( VDSCommandType.ConnectStoragePool, new ConnectStoragePoolVDSCommandParameters(getVdss().get(iterationId), getStoragePool(), masterStorageDomainId, storagePoolIsoMap, true)); log.info("Refreshed vds '{}' in pool '{}'", getVdss().get(iterationId).getName(), getStoragePool().getName()); } } catch (RuntimeException e) { log.error("Failed to connect/refresh storagePool. Host '{}' to storage pool '{}'. Error: {}", getVdss().get(iterationId).getName(), getStoragePool().getName(), e.getMessage()); log.debug("Exception", e); } }</code><technical_language>s/. Error//</technical_language>

Target:
public void execute(int iterationId) { try { if (getStorageDomain() != null && getStorageDomain().getStorageDomainType() == StorageDomainType.Master) { try { Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.ConnectStoragePool, new ConnectStoragePoolVDSCommandParameters(getVdss().get(iterationId), getStoragePool(), masterStorageDomainId, storagePoolIsoMap)); } catch (Exception e) { log.error("Could not connect vds '{}' to pool '{}' - moving host to non-operational: {}", getVdss().get(iterationId).getName(), getStoragePool().getName(), e.getMessage()); log.debug("Exception", e); synchronized (_vdsIdsToSetNonOperational) { _vdsIdsToSetNonOperational.add(getVdss().get(iterationId).getId()); } } } else { Backend.getInstance().getResourceManager().RunVdsCommand( VDSCommandType.ConnectStoragePool, new ConnectStoragePoolVDSCommandParameters(getVdss().get(iterationId), getStoragePool(), masterStorageDomainId, storagePoolIsoMap, true)); log.info("Refreshed vds '{}' in pool '{}'", getVdss().get(iterationId).getName(), getStoragePool().getName()); } } catch (RuntimeException e) { log.error("Failed to connect/refresh storagePool. Host '{}' to storage pool '{}': {}", getVdss().get(iterationId).getName(), getStoragePool().getName(), e.getMessage()); log.debug("Exception", e); } }
Source:
<code><START> public static co.cask.cdap.etl.proto.v2.ETLPlugin getPlugin(String tableName) { <END> Map<String, String> properties = new HashMap<>(); properties.put("tableName", tableName); return new co.cask.cdap.etl.proto.v2.ETLPlugin("Mock", BatchSource.PLUGIN_TYPE, properties, null); }</code><technical_language>need fully qualified name (this is renamed v1.Plugin v2.ETLPlugin)</technical_language>

Target:
public static ETLPlugin getPlugin(String tableName) { Map<String, String> properties = new HashMap<>(); properties.put("tableName", tableName); return new ETLPlugin("Mock", BatchSource.PLUGIN_TYPE, properties, null); }
Source:
<code>protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String command = request.getParameter(COMMAND); String version = request.getParameter(VERSION); try { if (!VERSION.equals(command)) { if (StringUtils.isEmpty(version)) { throw new Exception("No version found in request."); } if (!SSOUtils.versionSupported(version)) { throw new Exception("Unsupported version found in request."); } } switch (command) { case AUTHN_CREDENTIALS: authCredentials(request, response); break; <START> case GET_TOKEN: <END> getToken(request, response); break; case INVALIDATE_SESSION: HttpSession existingSession = request.getSession(false); if (existingSession != null) { existingSession.invalidate(); } break; case TOKEN_QUERY: getTokenUser(request, response); break; case VALIDATE_SESSION: validateSession(request, response); break; case VERSION: response.getWriter().print(SSOUtils.SSO_VERSION); break; default: log.error("Unknown command " + command); response.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR); break; } } catch (Exception ex) { log.debug("Exception in handling command " + command, ex); response.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR); } }</code><technical_language>get ticket</technical_language>

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String command = request.getParameter(COMMAND); String version = request.getParameter(VERSION); try { if (!VERSION.equals(command)) { if (StringUtils.isEmpty(version)) { throw new Exception("No version found in request."); } if (!SSOUtils.versionSupported(version)) { throw new Exception("Unsupported version found in request."); } } switch (command) { case AUTHN_CREDENTIALS: authCredentials(request, response); break; case GET_TOKEN_PAYLOAD: getTokenPayload(request, response); break; case INVALIDATE_SESSION: HttpSession existingSession = request.getSession(false); if (existingSession != null) { existingSession.invalidate(); } break; case TOKEN_QUERY: getTicketUser(request, response); break; case VALIDATE_SESSION: validateSession(request, response); break; case VERSION: Map<String, String> versionData = new HashMap<>(); versionData.put(VERSION, SSOUtils.SSO_VERSION); response.getWriter().print(SSOUtils.getJson(versionData)); break; default: log.error("Unknown command " + command); response.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR); break; } } catch (Exception ex) { log.debug("Exception in handling command " + command, ex); response.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR); } }
Source:
<code>public ApplicationReportModel getMainApplicationReportForFile(FileModel fileModel) { GremlinPipeline<Vertex, Vertex> pipe = new GremlinPipeline<>(getGraphContext().getGraph()); pipe.V(WindupVertexFrame.TYPE_PROP, ApplicationReportModel.TYPE); pipe.has(ApplicationReportModel.MAIN_APPLICATION_REPORT, true); pipe.as("applicationReport"); pipe.out(ApplicationReportModel.REPORT_TO_PROJECT_MODEL); ProjectModel rootProjectModel = fileModel.getProjectModel(); if (rootProjectModel == null) { return null; } else { rootProjectModel = rootProjectModel.getRootProjectModel(); } String rootFilePath = rootProjectModel.getRootFileModel().getFilePath(); pipe.out(ProjectModel.ROOT_FILE_MODEL); pipe.has(FileModel.FILE_PATH, rootFilePath); pipe.back("applicationReport"); if (pipe.iterator().hasNext()) { Vertex v = pipe.iterator().next(); ApplicationReportModel mainAppReport = frame(v); if(pipe.iterator().hasNext()) { <START> System.err.println("There are multiple ApplicationReportModels for a single file " + fileModel.getFilePath() +". This may cause some broken" <END> + "links in the report file"); } return mainAppReport; } return null; }</code><technical_language>change this a LOG.warning</technical_language>

Target:
public ApplicationReportModel getMainApplicationReportForFile(FileModel fileModel) { GremlinPipeline<Vertex, Vertex> pipe = new GremlinPipeline<>(getGraphContext().getGraph()); pipe.V(WindupVertexFrame.TYPE_PROP, ApplicationReportModel.TYPE); pipe.has(ApplicationReportModel.MAIN_APPLICATION_REPORT, true); pipe.as("applicationReport"); pipe.out(ApplicationReportModel.REPORT_TO_PROJECT_MODEL); ProjectModel rootProjectModel = fileModel.getProjectModel(); if (rootProjectModel == null) { return null; } else { rootProjectModel = rootProjectModel.getRootProjectModel(); } String rootFilePath = rootProjectModel.getRootFileModel().getFilePath(); pipe.out(ProjectModel.ROOT_FILE_MODEL); pipe.has(FileModel.FILE_PATH, rootFilePath); pipe.back("applicationReport"); if (pipe.iterator().hasNext()) { Vertex v = pipe.iterator().next(); ApplicationReportModel mainAppReport = frame(v); if(pipe.iterator().hasNext()) { LOG.warning("There are multiple ApplicationReportModels for a single file " + fileModel.getFilePath() +". This may cause some broken" + "links in the report file"); } return mainAppReport; } return null; }
Source:
<code>public String getMessageLevel() { <START> return messageLevel.toString(); <END> }</code><technical_language>MessageLevel type</technical_language>

Target:
public MessageLevel getMessageLevel() { return messageLevel; }
Source:
<code>private void attemptExecuteAndUpdateRepository(final Instant scheduled) { if (!_cachedJob.isPresent()) { <START> LOGGER.error() <END> .setMessage("unable to execute: executor is not initialized") .log(); return; } final CachedJob<T> cachedJob = _cachedJob.get(); final JobRef<T> ref = cachedJob.getRef(); final Job<T> job = cachedJob.getJob(); final JobRepository<T> repo = ref.getRepository(_injector); if (_currentlyExecuting.getAndSet(true)) { return; } try { repo.jobStarted(ref.getJobId(), ref.getOrganization(), scheduled); } catch (final NoSuchElementException error) { _currentlyExecuting.set(false); killSelf(); return; } job.execute(getSelf(), scheduled) .handle((result, error) -> { try { if (error == null) { repo.jobSucceeded(ref.getJobId(), ref.getOrganization(), scheduled, result); } else { repo.jobFailed(ref.getJobId(), ref.getOrganization(), scheduled, error); } cachedJob.reload(_injector); } catch (final NoSuchElementException error2) { killSelf(); } return result; }) .whenComplete((result, error) -> _currentlyExecuting.set(false)); }</code><technical_language>note IllegalStateException; this feels a similar situation</technical_language>

Target:
private void attemptExecuteAndUpdateRepository(final Instant scheduled) throws ActorNotInitializedException, NoSuchJobException { if (!_cachedJob.isPresent()) { throw new ActorNotInitializedException("unable to execute: executor is not initialized"); } final CachedJob<T> cachedJob = _cachedJob.get(); final JobRef<T> ref = cachedJob.getRef(); final Job<T> job = cachedJob.getJob(); final JobRepository<T> repo = ref.getRepository(_injector); if (_currentlyExecuting) { return; } _currentlyExecuting = true; try { repo.jobStarted(ref.getJobId(), ref.getOrganization(), scheduled); } catch (final NoSuchElementException error) { _currentlyExecuting = false; throw new NoSuchJobException("job no longer exists in repository", error); } PatternsCS.pipe( job.execute(getSelf(), scheduled) .handle((result, error) -> new JobCompleted.Builder<T>() .setScheduled(scheduled) .setError(error) .setResult(result) .build()), getContext().system().dispatcher() ).to(getSelf()); }
Source:
<code>private void processIndexSegmentEntriesBackward(IndexSegment indexSegment, List<IndexEntry> indexEntries, Map<StoreKey, Long> deletedKeys) throws StoreException { <START> logger.trace("Processing index entries backward by IndexScanner for segment for store {}", indexSegment, <END> storeId); List<IndexEntry> validIndexEntries = getValidIndexEntries(indexSegment, indexEntries, newScanResults.containerForecastStartTimeMs, deletedKeys); processEntriesForContainerBucket(newScanResults, validIndexEntries, deletedKeys); validIndexEntries = getValidIndexEntries(indexSegment, indexEntries, newScanResults.logSegmentForecastStartTimeMs, deletedKeys); processEntriesForLogSegmentBucket(newScanResults, validIndexEntries, deletedKeys); }</code><technical_language>indexSegment.getFile().getName()</technical_language>

Target:
private void processIndexSegmentEntriesBackward(IndexSegment indexSegment, List<IndexEntry> indexEntries, Map<StoreKey, Long> deletedKeys) throws StoreException { logger.trace("Processing index entries backward by IndexScanner for segment for store {}", indexSegment.getFile().getName(), storeId); List<IndexEntry> validIndexEntries = getValidIndexEntries(indexSegment, indexEntries, newScanResults.containerForecastStartTimeMs, deletedKeys); processEntriesForContainerBucket(newScanResults, validIndexEntries, deletedKeys); validIndexEntries = getValidIndexEntries(indexSegment, indexEntries, newScanResults.logSegmentForecastStartTimeMs, deletedKeys); processEntriesForLogSegmentBucket(newScanResults, validIndexEntries, deletedKeys); }
Source:
<code>private float getCurrentSpeed() { if (isPlayingVideo) { return UserPreferences.getVideoPlaybackSpeed(); } <START> if (controller != null) { <END> Playable media = controller.getMedia(); boolean isFeedMedia = media instanceof FeedMedia; if (isFeedMedia) { return ((FeedMedia) media).getMediaPlaybackSpeed(); } } return UserPreferences.getPlaybackSpeed(); }</code><technical_language>lines above. Videos behavior default/global speed</technical_language>

Target:
private float getCurrentSpeed() { Playable media = null; if (controller != null) { media = controller.getMedia(); } return PlaybackSpeedHelper.getCurrentPlaybackSpeed(media); }
Source:
<code>public void shouldUseDocValues() { <START> <END> elasticsearchTemplate.createIndex(DocValuesEntity.class); elasticsearchTemplate.putMapping(DocValuesEntity.class); Map mapping = elasticsearchTemplate.getMapping(DocValuesEntity.class); Map descriptionMapping = (Map) ((Map) mapping.get("properties")).get("description"); Map keywordDescriptionMapping = (Map) ((Map) descriptionMapping.get("fields")).get("keyword"); Map nameMapping = (Map) ((Map) mapping.get("properties")).get("name"); Map bucketsMapping = (Map) ((Map) mapping.get("properties")).get("buckets"); assertTrue(bucketsMapping.size() == 1); assertThat(bucketsMapping.get("type")).isEqualTo("nested"); assertTrue(nameMapping.size() == 2); assertThat(nameMapping.get("type")).isEqualTo("keyword"); assertThat(nameMapping.get("doc_values")).isEqualTo(false); assertTrue(descriptionMapping.size() == 2); assertThat(descriptionMapping.get("type")).isEqualTo("text"); assertTrue(keywordDescriptionMapping.size() == 2); assertThat(keywordDescriptionMapping.get("type")).isEqualTo("keyword"); assertThat(keywordDescriptionMapping.get("doc_values")).isEqualTo(false); }</code><technical_language>check for mapping do need create index, put retrieve a mapping. Check shouldUseFieldNameOnId() method for example, is done there: define expected JSON string (no need format it), build mapping compare JSONAssert.assertEquals(...)</technical_language>

Target:
public void shouldUseDocValues() { elasticsearchTemplate.createIndex(DocValuesEntity.class); elasticsearchTemplate.putMapping(DocValuesEntity.class); Map mapping = elasticsearchTemplate.getMapping(DocValuesEntity.class); Map descriptionMapping = (Map) ((Map) mapping.get("properties")).get("description"); Map keywordDescriptionMapping = (Map) ((Map) descriptionMapping.get("fields")).get("keyword"); Map nameMapping = (Map) ((Map) mapping.get("properties")).get("name"); Map bucketsMapping = (Map) ((Map) mapping.get("properties")).get("buckets"); assertThat(bucketsMapping).hasSize(1); assertThat(bucketsMapping.get("type")).isEqualTo("nested"); assertThat(nameMapping).hasSize(2); assertThat(nameMapping.get("type")).isEqualTo("keyword"); assertThat(nameMapping.get("doc_values")).isEqualTo(false); assertThat(descriptionMapping).hasSize(2); assertThat(descriptionMapping.get("type")).isEqualTo("text"); assertThat(keywordDescriptionMapping).hasSize(2); assertThat(keywordDescriptionMapping.get("type")).isEqualTo("keyword"); assertThat(keywordDescriptionMapping.get("doc_values")).isEqualTo(false); }
Source:
<code>public void test_starting_states() throws Exception { BytecodeEGWalker walker = new BytecodeEGWalker(null, null); <START> String signature = "type#()V"; <END> walker.methodBehavior = new MethodBehavior(signature); ProgramState startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, false)); SymbolicValue thisSv = startingState.getValue(0); assertThat(thisSv).isNotNull(); assertThat(startingState.getConstraints(thisSv).get(ObjectConstraint.class)).isEqualTo(ObjectConstraint.NOT_NULL); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, true)); assertThat(startingState).isEqualTo(ProgramState.EMPTY_STATE); signature = "type#(DIJ)V"; walker.methodBehavior = new MethodBehavior(signature); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, true)); assertThat(startingState.getValue(0)).isNotNull(); SymbolicValue doubleArg = startingState.getValue(0); assertThat(startingState.getConstraint(doubleArg, BytecodeEGWalker.StackValueCategoryConstraint.class)).isEqualTo(BytecodeEGWalker.StackValueCategoryConstraint.LONG_OR_DOUBLE); assertThat(startingState.getValue(1)).isNull(); assertThat(startingState.getValue(2)).isNotNull(); SymbolicValue longArg = startingState.getValue(3); assertThat(longArg).isNotNull(); assertThat(startingState.getConstraint(longArg, BytecodeEGWalker.StackValueCategoryConstraint.class)).isEqualTo(BytecodeEGWalker.StackValueCategoryConstraint.LONG_OR_DOUBLE); }</code><technical_language>more correct method name</technical_language>

Target:
public void test_starting_states() throws Exception { BytecodeEGWalker walker = new BytecodeEGWalker(null, semanticModel); String signature = "type#foo()V"; walker.methodBehavior = new MethodBehavior(signature); ProgramState startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, false)); SymbolicValue thisSv = startingState.getValue(0); assertThat(thisSv).isNotNull(); assertThat(startingState.getConstraints(thisSv).get(ObjectConstraint.class)).isEqualTo(ObjectConstraint.NOT_NULL); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, true)); assertThat(startingState).isEqualTo(ProgramState.EMPTY_STATE); signature = "type#foo(DIJ)V"; walker.methodBehavior = new MethodBehavior(signature); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE, true)); assertThat(startingState.getValue(0)).isNotNull(); SymbolicValue doubleArg = startingState.getValue(0); assertThat(startingState.getConstraint(doubleArg, BytecodeEGWalker.StackValueCategoryConstraint.class)).isEqualTo(BytecodeEGWalker.StackValueCategoryConstraint.LONG_OR_DOUBLE); assertThat(startingState.getValue(1)).isNull(); assertThat(startingState.getValue(2)).isNotNull(); SymbolicValue longArg = startingState.getValue(3); assertThat(longArg).isNotNull(); assertThat(startingState.getConstraint(longArg, BytecodeEGWalker.StackValueCategoryConstraint.class)).isEqualTo(BytecodeEGWalker.StackValueCategoryConstraint.LONG_OR_DOUBLE); }
Source:
<code>protected IStatus validate() { final Object selectedData = selectedDataObservable.getValue(); if (selectedData != null && selectedData instanceof BusinessObjectData) { final BusinessObjectData value = (BusinessObjectData) selectedData; return toBusinessObject(value) != null ? Status.OK_STATUS : ValidationStatus.error(Messages.invalidBusinessDataSelected); } else { if (availableBusinessData.isEmpty()) { <START> return selectionTypeObservable.getValue().equals(Boolean.TRUE) ? ValidationStatus.warning(Messages.warningAddFromData_noDataAvailable) <END> : Status.OK_STATUS; } else { return selectionTypeObservable.getValue().equals(Boolean.TRUE) ? ValidationStatus.warning(Messages.warningAddFromData_noDataSelected) : Status.OK_STATUS; } } }</code><technical_language>invert equals</technical_language>

Target:
protected IStatus validate() { final Object selectedData = selectedDataObservable.getValue(); if (selectedData != null && selectedData instanceof BusinessObjectData) { final BusinessObjectData value = (BusinessObjectData) selectedData; return toBusinessObject(value) != null ? Status.OK_STATUS : ValidationStatus.error(Messages.invalidBusinessDataSelected); } else { if (availableBusinessData.isEmpty()) { return Boolean.TRUE.equals(selectionTypeObservable.getValue()) ? ValidationStatus.warning(Messages.warningAddFromData_noDataAvailable) : Status.OK_STATUS; } else { return Boolean.TRUE.equals(selectionTypeObservable.getValue()) ? ValidationStatus.warning(Messages.warningAddFromData_noDataSelected) : Status.OK_STATUS; } } }
Source:
<code>private void saveTask(String processTitle, Task task) { try { serviceManager.getTaskService().save(task); } catch (DataException e) { <START> Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Error while saving - " + processTitle, e); <END> logger.error(KITODO_SCRIPT_FIELD + "Error while saving - " + processTitle, e); } }</code><technical_language>Please log error inform user</technical_language>

Target:
private void saveTask(String processTitle, Task task) { try { serviceManager.getTaskService().save(task); } catch (DataException e) { logger.error(KITODO_SCRIPT_FIELD + "Error while saving - " + processTitle, e); Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Error while saving - " + processTitle, e); } }
Source:
<code>public long offset() throws IOException { <START> return exists() ? writer().getFilePointer() : 0; <END> }</code><technical_language>This reader()</technical_language>

Target:
public long offset() throws IOException { return exists() ? reader().getFilePointer() : 0; }
Source:
<code><START> CommandResult build() { <END> return new CommandResult(this.processed, this.successCount, this.affectedBlocks, this.affectedEntities, this.affectedItems, this.queryResult, this.resultInfo); }</code><technical_language>public</technical_language>

Target:
public CommandResult build() { return new CommandResult(this.processed, this.successCount, this.affectedBlocks, this.affectedEntities, this.affectedItems, this.queryResult, this.resultInfo); }
Source:
<code>private void doBuildGetBlobOptionsTestForSubResource(Map<String, Object> args, RestUtils.SubResource subResource, ByteRange expectedRange, GetBlobOptions.OperationType expectedOpType, boolean shouldSucceed) throws RestServiceException { if (shouldSucceed) { GetBlobOptions options = RestUtils.buildGetBlobOptions(args, subResource); assertEquals("Unexpected range for args=" + args + " and subResource=" + subResource, expectedRange, options.getRange()); assertEquals("Unexpected operation type for args=" + args + " and subResource=" + subResource, expectedOpType, options.getOperationType()); } else { try { RestUtils.buildGetBlobOptions(args, subResource); fail("buildGetBlobOptions should not have succeeded with args=" + args + "and subResource=" + subResource); } catch (RestServiceException expected) { <START> } <END> } }</code><technical_language>check RestServiceErrorCode</technical_language>

Target:
private void doBuildGetBlobOptionsTestForSubResource(Map<String, Object> args, RestUtils.SubResource subResource, ByteRange expectedRange, GetBlobOptions.OperationType expectedOpType, boolean shouldSucceed) throws RestServiceException { if (shouldSucceed) { GetBlobOptions options = RestUtils.buildGetBlobOptions(args, subResource); assertEquals("Unexpected range for args=" + args + " and subResource=" + subResource, expectedRange, options.getRange()); assertEquals("Unexpected operation type for args=" + args + " and subResource=" + subResource, expectedOpType, options.getOperationType()); } else { try { RestUtils.buildGetBlobOptions(args, subResource); fail("buildGetBlobOptions should not have succeeded with args=" + args + "and subResource=" + subResource); } catch (RestServiceException expected) { assertEquals("Unexpected error code.", RestServiceErrorCode.InvalidArgs, expected.getErrorCode()); } } }
Source:
<code>public synchronized Collection<MetaAnnotation> getAnnotations() { final Annotation[] array; <START> if (_annotationsCache != null) { <END> array = _annotationsCache; } else { array = _annotationsCache = field.getAnnotations(); } return Arrays.stream(array).map(JavaReflectionAnnotation::new).collect(Collectors.toList()); }</code><technical_language>note for previous caches</technical_language>

Target:
public Collection<MetaAnnotation> getAnnotations() { return Arrays.stream(field.getAnnotations()).map(JavaReflectionAnnotation::new).collect(toList()); }
Source:
<code>private void checkIfOnRail() { for (y = -1; y != 2 && this.state == Minecart.STATE_INITIAL; y++) { positionToCheck = this.temporalVector.setComponents(this.x, this.y + y, this.z); Block block = this.level.getBlock(positionToCheck); if (this.isRail(block)) { minecartPosition = positionToCheck.floor().add(0.5, 0, 0.5); this.setPosition(minecartPosition); this.state = Minecart::STATE_ON_RAIL; } } <START> if (this.state != Minecart::STATE_ON_RAIL) { <END> this.state = Minecart::STATE_OFF_RAIL; } }</code><technical_language>java Minecart.STATE_ON_RAIL This is C C++</technical_language>

Target:
private void checkIfOnRail() { for (y = -1; y != 2 && this.state == Minecart.STATE_INITIAL; y++) { positionToCheck = this.temporalVector.setComponents(this.x, this.y + y, this.z); Block block = this.level.getBlock(positionToCheck); if (this.isRail(block)) { minecartPosition = positionToCheck.floor().add(0.5, 0, 0.5); this.setPosition(minecartPosition); this.state = Minecart.STATE_ON_RAIL; } } if (this.state != Minecart.STATE_ON_RAIL) { this.state = Minecart.STATE_OFF_RAIL; } }