auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private String buildIncrementalLookupQuery( final CacheScheduler.EntryImpl<JdbcExtractionNamespace> key, final JdbcExtractionNamespace namespace, String tsColumn, Long lastLoadTs) { <START> final DBI dbi = ensureDBI(key, namespace); <END> final String table = namespace.getTable(); final String filter = namespace.getFilter(); final String valueColumn = namespace.getValueColumn(); final String keyColumn = namespace.getKeyColumn(); if (Strings.isNullOrEmpty(filter)) { return StringUtils.format( "SELECT %s, %s FROM %s WHERE %s >= '%s' AND %s IS NOT NULL", keyColumn, valueColumn, table, tsColumn, new Timestamp(lastLoadTs).toString(), valueColumn ); } return StringUtils.format( "SELECT %s, %s FROM %s WHERE %s%s IS NOT NULL", keyColumn, valueColumn, table, Strings.isNullOrEmpty(filter) ? "" : filter + " AND ", valueColumn ); }</code><technical_language>[ERROR] Dead store dbi in org.apache.druid.server.lookup.namespace.JdbcCacheGenerator.buildIncrementalLookupQuery(CacheScheduler$EntryImpl, JdbcExtractionNamespace, String, Long) [org.apache.druid.server.lookup.namespace.JdbcCacheGenerator] JdbcCacheGenerator.java:[line 195] DLS_DEAD_LOCAL_STORE I spotbugs is complaining this variable is used</technical_language>

Target:
private String buildIncrementalLookupQuery( final CacheScheduler.EntryImpl<JdbcExtractionNamespace> key, final JdbcExtractionNamespace namespace, String tsColumn, Long lastLoadTs) { final String table = namespace.getTable(); final String filter = namespace.getFilter(); final String valueColumn = namespace.getValueColumn(); final String keyColumn = namespace.getKeyColumn(); if (Strings.isNullOrEmpty(filter)) { return StringUtils.format( "SELECT %s, %s FROM %s WHERE %s >= '%s' AND %s IS NOT NULL", keyColumn, valueColumn, table, tsColumn, new Timestamp(lastLoadTs).toString(), valueColumn ); } return StringUtils.format( "SELECT %s, %s FROM %s WHERE %s%s IS NOT NULL", keyColumn, valueColumn, table, Strings.isNullOrEmpty(filter) ? "" : filter + " AND ", valueColumn ); }
Source:
<code>public String normalize(String value) { <START> String filteredValue = StringUtils.replacePattern(value, "\\(.*?\\)", ""); <END> return stringNormalizer.normalize(filteredValue); }</code><technical_language>removePattern</technical_language>

Target:
public String normalize(String value) { String filteredValue = StringUtils.removePattern(value, "\\(.*?\\)"); return stringNormalizer.normalize(filteredValue); }
Source:
<code>public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { mPhoneTextView = view.findViewById(R.id.edit_phone_number); mCountDownTextView = view.findViewById(R.id.ticker); mResendCodeTextView = view.findViewById(R.id.resend_code); mConfirmationCodeEditText = view.findViewById(R.id.confirmation_code); mSubmitConfirmationButton = view.findViewById(R.id.submit_confirmation_code); getActivity().setTitle(getString(R.string.fui_verify_your_phone_title)); <START> mCountdown.run(); <END> setupSubmitConfirmationButton(); setupConfirmationCodeEditText(); setupEditPhoneNumberTextView(); setupResendConfirmationCodeTextView(); PreambleHandler.setup( getContext(), getFlowParams(), R.string.fui_continue_phone_login, view.<TextView>findViewById(R.id.create_account_tos)); }</code><technical_language>this mHandler.postRunnable(mCountDown()) instead</technical_language>

Target:
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { mProgressBar = view.findViewById(R.id.top_progress_bar); mPhoneTextView = view.findViewById(R.id.edit_phone_number); mCountDownTextView = view.findViewById(R.id.ticker); mResendCodeTextView = view.findViewById(R.id.resend_code); mConfirmationCodeEditText = view.findViewById(R.id.confirmation_code); mSubmitConfirmationButton = view.findViewById(R.id.submit_confirmation_code); requireActivity().setTitle(getString(R.string.fui_verify_your_phone_title)); processCountdownTick(); setupSubmitConfirmationButton(); setupConfirmationCodeEditText(); setupEditPhoneNumberTextView(); setupResendConfirmationCodeTextView(); PrivacyDisclosureUtils.setupTermsOfServiceFooter( requireContext(), getFlowParams(), view.<TextView>findViewById(R.id.email_footer_tos_and_pp_text)); }
Source:
<code>public void writePlane(final int imageIndex, final long planeIndex, final Plane plane, final long[] planeMin, final long[] planeMax) throws FormatException, IOException { final byte[] buf = plane.getBytes(); final Metadata meta = getMetadata(); checkParams(imageIndex, planeIndex, buf, planeMin, planeMax); if (!SCIFIOMetadataTools.wholePlane(imageIndex, meta, planeMin, planeMax)) { throw new FormatException( "JavaWriter does not yet support saving image tiles."); } final ImageMetadata imageMeta = meta.get(imageIndex); final int type = imageMeta.getPixelType(); if (!ArrayUtils.contains(getPixelTypes(getCompression()), type)) { final String typeString = FormatTools.getPixelTypeString(type); throw new FormatException("Unsupported image type '" + typeString + "'."); } final int bpp = FormatTools.getBytesPerPixel(type); final boolean fp = FormatTools.isFloatingPoint(type); <START> final boolean little = imageMeta.isLittleEndian(); <END> final String varName = "image" + imageIndex + "Plane" + planeIndex; final Object array = Bytes.makeArray(buf, bpp, fp, little); final RandomAccessOutputStream output = getStream(); output.seek(output.length()); writePlane(varName, getType(array), (int) planeMax[0], (int) planeMax[1]); }</code><technical_language>Wow, nice WTF catch there. :+1:</technical_language>

Target:
public void writePlane(final int imageIndex, final long planeIndex, final Plane plane, final long[] planeMin, final long[] planeMax) throws FormatException, IOException { final byte[] buf = plane.getBytes(); final Metadata meta = getMetadata(); checkParams(imageIndex, planeIndex, buf, planeMin, planeMax); if (!SCIFIOMetadataTools.wholePlane(imageIndex, meta, planeMin, planeMax)) { throw new FormatException( "JavaWriter does not yet support saving image tiles."); } final ImageMetadata imageMeta = meta.get(imageIndex); final int type = imageMeta.getPixelType(); if (!ArrayUtils.contains(getPixelTypes(getCompression()), type)) { final String typeString = FormatTools.getPixelTypeString(type); throw new FormatException("Unsupported image type '" + typeString + "'."); } final int bpp = FormatTools.getBytesPerPixel(type); final boolean fp = FormatTools.isFloatingPoint(type); final boolean little = imageMeta.isLittleEndian(); final String varName = "image" + imageIndex + "Plane" + planeIndex; final Object array = Bytes.makeArray(buf, bpp, fp, little); getStream().seek(getStream().length()); writePlane(varName, getType(array), (int) planeMax[0], (int) planeMax[1]); }
Source:
<code><START> public static <E> Map<String, E> copyMap( <END> Map<String, E> dest, Map<String, E> source, Function<E, E> copyFn) { dest.clear(); source.entrySet() .forEach(entry -> dest.put(entry.getKey(), copyFn.apply(entry.getValue()))); return dest; }</code><technical_language>this method private</technical_language>

Target:
private static <E> Map<String, E> copyMap( Map<String, E> dest, Map<String, E> source, Function<E, E> copyFn) { dest.clear(); source.entrySet() .forEach(entry -> dest.put(entry.getKey(), copyFn.apply(entry.getValue()))); return dest; }
Source:
<code>private Set<String> filterAuthorizedSupervisorIds( final HttpServletRequest req, SupervisorManager manager, Collection<String> supervisorIds ) { final Set<String> authorizedSupervisorIds = Sets.newHashSet(); <START> if (supervisorIds.size() == 0) { <END> AuthorizationUtils.authorizeAllResourceActions( req, Lists.newArrayList(), authorizerMapper ); } else { Function<String, Iterable<ResourceAction>> raGenerator = supervisorId -> { Optional<SupervisorSpec> supervisorSpecOptional = manager.getSupervisorSpec(supervisorId); if (supervisorSpecOptional.isPresent()) { return Iterables.transform( supervisorSpecOptional.get().getDataSources(), AuthorizationUtils.DATASOURCE_WRITE_RA_GENERATOR ); } else { return null; } }; AuthorizationUtils.filterAuthorizedResources( req, supervisorIds, raGenerator, authorizerMapper, authorizedSupervisorIds ); } return authorizedSupervisorIds; }</code><technical_language>Is necessary a separate branch for this case? filterAuthorizedResources empty list do thing</technical_language>

Target:
private Set<String> filterAuthorizedSupervisorIds( final HttpServletRequest req, SupervisorManager manager, Collection<String> supervisorIds ) { Function<String, Iterable<ResourceAction>> raGenerator = supervisorId -> { Optional<SupervisorSpec> supervisorSpecOptional = manager.getSupervisorSpec(supervisorId); if (supervisorSpecOptional.isPresent()) { return Iterables.transform( supervisorSpecOptional.get().getDataSources(), AuthorizationUtils.DATASOURCE_WRITE_RA_GENERATOR ); } else { return null; } }; return Sets.newHashSet( AuthorizationUtils.filterAuthorizedResources( req, supervisorIds, raGenerator, authorizerMapper ) ); }
Source:
<code><START> private void processBlockElements(CFG.Block block, Set<Symbol> blockKill, Set<Symbol> blockGen) { <END> Set<Tree> assignmentLHS = new HashSet<>(); for (Tree element : block.elements) { Symbol symbol; switch (element.kind()) { case ASSIGNMENT: ExpressionTree lhs = ((AssignmentExpressionTree) element).variable(); if (lhs.is(Tree.Kind.IDENTIFIER)) { symbol = ((IdentifierTree) lhs).symbol(); if (isLocalVariable(symbol)) { assignmentLHS.add(lhs); blockGen.remove(symbol); blockKill.add(symbol); } } break; case IDENTIFIER: symbol = ((IdentifierTree) element).symbol(); if (!assignmentLHS.contains(element) && isLocalVariable(symbol)) { blockGen.add(symbol); } break; case VARIABLE: blockKill.add(((VariableTree) element).symbol()); blockGen.remove(((VariableTree) element).symbol()); break; case LAMBDA_EXPRESSION: LocalVariableReadExtractor extractor = new LocalVariableReadExtractor(cfg.methodSymbol()); ((LambdaExpressionTree) element).body().accept(extractor); blockGen.addAll(extractor.usedVariables()); break; case NEW_CLASS: ClassTree body = ((NewClassTree) element).classBody(); if (body != null) { LocalVariableReadExtractor extractorFromClass = new LocalVariableReadExtractor(cfg.methodSymbol()); body.accept(extractorFromClass); blockGen.addAll(extractorFromClass.usedVariables()); } break; default: } } }</code><technical_language>![MAJOR](<LINK_0> Cyclomatic Complexity of this method "processBlockElements" is 12 is greater 10 authorized. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
private void processBlockElements(CFG.Block block, Set<Symbol> blockKill, Set<Symbol> blockGen) { Set<Tree> assignmentLHS = new HashSet<>(); for (Tree element : Lists.reverse(block.elements())) { Symbol symbol; switch (element.kind()) { case ASSIGNMENT: ExpressionTree lhs = ((AssignmentExpressionTree) element).variable(); if (lhs.is(Tree.Kind.IDENTIFIER)) { symbol = ((IdentifierTree) lhs).symbol(); if (isLocalVariable(symbol)) { assignmentLHS.add(lhs); blockGen.remove(symbol); blockKill.add(symbol); } } break; case IDENTIFIER: symbol = ((IdentifierTree) element).symbol(); if (!assignmentLHS.contains(element) && isLocalVariable(symbol)) { blockGen.add(symbol); } break; case VARIABLE: blockKill.add(((VariableTree) element).symbol()); blockGen.remove(((VariableTree) element).symbol()); break; case LAMBDA_EXPRESSION: LocalVariableReadExtractor extractor = new LocalVariableReadExtractor(cfg.methodSymbol()); ((LambdaExpressionTree) element).body().accept(extractor); blockGen.addAll(extractor.usedVariables()); break; case NEW_CLASS: ClassTree body = ((NewClassTree) element).classBody(); if (body != null) { LocalVariableReadExtractor extractorFromClass = new LocalVariableReadExtractor(cfg.methodSymbol()); body.accept(extractorFromClass); blockGen.addAll(extractorFromClass.usedVariables()); } break; default: } } }
Source:
<code>public boolean hasDictionarySupport() { <START> return delegate.hasDictionarySupport(); <END> }</code><technical_language>this independent</technical_language>

Target:
public boolean hasDictionarySupport() { return true; }
Source:
<code>public static QueryInfo parseQuery(String sql) { Planner planner = createPlanner(); SqlNode sqlNode; try { sqlNode = planner.parse(sql); } catch (SqlParseException e) { throw new SamzaException(e); } String sink; String selectQuery; ArrayList<String> sources; if (sqlNode instanceof SqlInsert) { SqlInsert sqlInsert = ((SqlInsert) sqlNode); sink = sqlInsert.getTargetTable().toString(); if (sqlInsert.getSource() instanceof SqlSelect) { SqlSelect sqlSelect = (SqlSelect) sqlInsert.getSource(); selectQuery = sqlSelect.toString(); LOG.info("Parsed select query from sql {}", selectQuery, sql); sources = getSourcesFromSelectQuery(sqlSelect); } else { <START> throw new SamzaException("Sql query is not of the expected format"); <END> } } else { throw new SamzaException("Sql query is not of the expected format"); } return new QueryInfo(selectQuery, sources, sink, sql); }</code><technical_language>nit: related this PR, want add expected format is in exception message below</technical_language>

Target:
public static QueryInfo parseQuery(String sql) { Planner planner = createPlanner(); SqlNode sqlNode; try { sqlNode = planner.parse(sql); } catch (SqlParseException e) { throw new SamzaException(e); } String sink; String selectQuery; ArrayList<String> sources; if (sqlNode instanceof SqlInsert) { SqlInsert sqlInsert = ((SqlInsert) sqlNode); sink = sqlInsert.getTargetTable().toString(); if (sqlInsert.getSource() instanceof SqlSelect) { SqlSelect sqlSelect = (SqlSelect) sqlInsert.getSource(); selectQuery = sqlSelect.toString(); LOG.info("Parsed select query from sql {}", selectQuery, sql); sources = getSourcesFromSelectQuery(sqlSelect); } else { String msg = String.format("Sql query is not of the expected format. Select node expected, found %s", sqlInsert.getSource().getClass().toString()); LOG.error(msg); throw new SamzaException(msg); } } else { String msg = String.format("Sql query is not of the expected format. Insert node expected, found %s", sqlNode.getClass().toString()); LOG.error(msg); throw new SamzaException(msg); } return new QueryInfo(selectQuery, sources, sink, sql); }
Source:
<code>private void setupLoggers() { final boolean isDebugMode = Boolean.getBoolean("saros.debug") || isDebugging(); try { File mainLogDir = getStateLocation().toFile(); <START> final String logDir = mainLogDir + File.separator + "SarosLogs"; <END> final String logLevel = isDebugMode ? LOG_LEVEL_DEBUG : LOG_LEVEL_RELEASE; URL configFileU = getBundle().getResource(LOG4J2_CONFIG_FILENAME); if (configFileU == null) { throw new RuntimeException( "Failed to get the log4j2 config file from the bundle class loader"); } String configFileUri = configFileU.toString(); System.setProperty("log4j.configurationFile", configFileUri); System.setProperty("logging.logDir", logDir); System.setProperty("logging.logLevel", logLevel); LoggerContext context = (LoggerContext) LogManager.getContext(false); context.reconfigure(); } catch (RuntimeException e) { System.err.println("initializing log support failed"); e.printStackTrace(); } log = Logger.getLogger(this.getClass()); }</code><technical_language>do name SarosLogs instead of log ? ../.metadata/.plugins/saros.eclipse/SarosLogs this final name</technical_language>

Target:
private void setupLoggers() { final boolean isDebugMode = Boolean.getBoolean("saros.debug") || isDebugging(); try { final File pluginLogDir = new File(getStateLocation().toFile(), "log"); final Level logLevel = isDebugMode ? Level.ALL : Level.WARN; MainMapLookup.setMainArguments("logDir", pluginLogDir.getPath(), "logLevel", logLevel.name()); Configurator.initialize( null, ConfigurationSource.fromResource(LOG4J2_CONFIG_FILENAME, Saros.class.getClassLoader())); } catch (RuntimeException e) { StatusLogger.getLogger().error("initializing loggers failed", e); e.printStackTrace(); } log = Logger.getLogger(this.getClass()); }
Source:
<code>public void testFilterSinglePattern() throws Exception { StringPattern stringPattern = new RegexStringPattern("very simple email pattern", ".+@.+", true); MockInputColumn<String> column = new MockInputColumn<String>("my col", String.class); StringPatternFilter filter = new StringPatternFilter(column, new StringPattern[] { stringPattern }, MatchFilterCriteria.ANY, configuration); <START> filter.init(); <END> assertEquals(ValidationCategory.VALID, filter.categorize(new MockInputRow().put(column, "kasper@eobjects.org"))); assertEquals(ValidationCategory.INVALID, filter.categorize(new MockInputRow().put(column, "kasper@"))); filter.close(); filter = new StringPatternFilter(column, new StringPattern[] { stringPattern }, MatchFilterCriteria.ALL, configuration); filter.init(); assertEquals(ValidationCategory.VALID, filter.categorize(new MockInputRow().put(column, "kasper@eobjects.org"))); assertEquals(ValidationCategory.INVALID, filter.categorize(new MockInputRow().put(column, "kasper@"))); filter.close(); }</code><technical_language>reason missing annotations spotted. viable a test runs engine find kinds of bugs</technical_language>

Target:
public void testFilterSinglePattern() throws Exception { final LifeCycleHelper lifeCycleHelper = new LifeCycleHelper(new DataCleanerConfigurationImpl(), null, true); final StringPattern stringPattern = new RegexStringPattern("very simple email pattern", ".+@.+", true); final MockInputColumn<String> column = new MockInputColumn<String>("my col", String.class); StringPatternFilter filter = new StringPatternFilter(column, new StringPattern[] { stringPattern }, MatchFilterCriteria.ANY, configuration); lifeCycleHelper.initialize(descriptor, filter); assertEquals(ValidationCategory.VALID, filter.categorize(new MockInputRow().put(column, "kasper@eobjects.org"))); assertEquals(ValidationCategory.INVALID, filter.categorize(new MockInputRow().put(column, "kasper@"))); lifeCycleHelper.close(descriptor, filter, true); filter = new StringPatternFilter(column, new StringPattern[] { stringPattern }, MatchFilterCriteria.ALL, configuration); filter.init(); assertEquals(ValidationCategory.VALID, filter.categorize(new MockInputRow().put(column, "kasper@eobjects.org"))); assertEquals(ValidationCategory.INVALID, filter.categorize(new MockInputRow().put(column, "kasper@"))); filter.close(); }
Source:
<code>public List<MetricFamilySamples> collect() { return Arrays.asList( buildGauge("jetty_queued_thread_pool_threads", "Number of total threads", QueuedThreadPool::getThreads), buildGauge("jetty_queued_thread_pool_threads_idle", "Number of idle threads", QueuedThreadPool::getIdleThreads), buildGauge("jetty_queued_thread_pool_jobs", "Number of total jobs", QueuedThreadPool::getQueueSize), <START> buildGauge("jetty_queued_thread_pool_max", "Max size of thread pool", <END> QueuedThreadPool::getQueueSize)); }</code><technical_language>I right function</technical_language>

Target:
public List<MetricFamilySamples> collect() { return Arrays.asList( buildGauge("jetty_queued_thread_pool_threads", "Number of total threads", QueuedThreadPool::getThreads), buildGauge("jetty_queued_thread_pool_threads_idle", "Number of idle threads", QueuedThreadPool::getIdleThreads), buildGauge("jetty_queued_thread_pool_threads_max", "Max size of thread pool", QueuedThreadPool::getMaxThreads), buildGauge("jetty_queued_thread_pool_jobs", "Number of total jobs", QueuedThreadPool::getQueueSize)); }
Source:
<code>public Builder newBuilder() { log.warn("Attempting to copy RemotingOkHttpClient. Some of the functionality like rate limiting and qos will " <START> + "not be available to the new client"); <END> return super.newBuilder(); }</code><technical_language>pass a new SafeRuntimeException("stacktrace") this well, this called track it</technical_language>

Target:
public Builder newBuilder() { log.warn("Attempting to copy RemotingOkHttpClient. Some of the functionality like rate limiting and qos will " + "not be available to the new client", new SafeRuntimeException("stacktrace")); return super.newBuilder(); }
Source:
<code>public static void main(String[] args) throws IOException, GeneralSecurityException { if (!CONFIG_DIR.exists() && !CONFIG_DIR.mkdirs()) { throw new IOException("Cannot create " + CONFIG_DIR.getAbsolutePath()); } if (args.length > 0 && "init".equals(args[0])) { String password = new Auth(CONFIG_DIR).init(); System.out.println(password); } else { <START> int port = Integer.parseInt(System.getProperty("batmSshTunnelPort", "22222")); <END> new SshServer(CONFIG_DIR, port).start(); while (true) { try { Thread.sleep(10000); } catch (InterruptedException e) { } } } }</code><technical_language>do camelcase for property names. _ if need separate words</technical_language>

Target:
public static void main(String[] args) throws IOException, GeneralSecurityException { if (!CONFIG_DIR.exists() && !CONFIG_DIR.mkdirs()) { throw new IOException("Cannot create " + CONFIG_DIR.getAbsolutePath()); } if (args.length > 0 && "init".equals(args[0])) { String password = new Auth(CONFIG_DIR).init(); System.out.println(password); } else { new SshServer(CONFIG_DIR, PORT).start(); while (true) { try { Thread.sleep(10000); } catch (InterruptedException e) { } } } }
Source:
<code><START> private PlanNode buildProjectedIndexSource(PlanBuilder p, Predicate<Symbol> projectionFilter) <END> { Symbol orderkey = p.symbol("orderkey", INTEGER); Symbol custkey = p.symbol("custkey", INTEGER); Symbol totalprice = p.symbol("totalprice", DOUBLE); ColumnHandle orderkeyHandle = new TpchColumnHandle(orderkey.getName(), INTEGER); ColumnHandle custkeyHandle = new TpchColumnHandle(custkey.getName(), INTEGER); ColumnHandle totalpriceHandle = new TpchColumnHandle(totalprice.getName(), DOUBLE); return p.project( Assignments.identity( ImmutableList.of(orderkey, custkey, totalprice).stream() .filter(projectionFilter) .collect(toImmutableList())), p.indexSource( new TableHandle( new ConnectorId("local"), new TpchTableHandle("local", "orders", TINY_SCALE_FACTOR)), ImmutableSet.of(orderkey, custkey), ImmutableList.of(orderkey, custkey, totalprice), ImmutableMap.of( orderkey, orderkeyHandle, custkey, custkeyHandle, totalprice, totalpriceHandle), TupleDomain.fromFixedValues(ImmutableMap.of(totalpriceHandle, asNull(DOUBLE))))); }</code><technical_language>static</technical_language>

Target:
private static PlanNode buildProjectedIndexSource(PlanBuilder p, Predicate<Symbol> projectionFilter) { Symbol orderkey = p.symbol("orderkey", INTEGER); Symbol custkey = p.symbol("custkey", INTEGER); Symbol totalprice = p.symbol("totalprice", DOUBLE); ColumnHandle orderkeyHandle = new TpchColumnHandle(orderkey.getName(), INTEGER); ColumnHandle custkeyHandle = new TpchColumnHandle(custkey.getName(), INTEGER); ColumnHandle totalpriceHandle = new TpchColumnHandle(totalprice.getName(), DOUBLE); return p.project( Assignments.identity( ImmutableList.of(orderkey, custkey, totalprice).stream() .filter(projectionFilter) .collect(toImmutableList())), p.indexSource( new TableHandle( new ConnectorId("local"), new TpchTableHandle("local", "orders", TINY_SCALE_FACTOR)), ImmutableSet.of(orderkey, custkey), ImmutableList.of(orderkey, custkey, totalprice), ImmutableMap.of( orderkey, orderkeyHandle, custkey, custkeyHandle, totalprice, totalpriceHandle), TupleDomain.fromFixedValues(ImmutableMap.of(totalpriceHandle, asNull(DOUBLE))))); }
Source:
<code>public Optional<RecordCursor> createRecordCursor(Configuration configuration, ConnectorSession session, Path path, long start, long length, long fileSize, Properties schema, List<HiveColumnHandle> columns, TupleDomain<HiveColumnHandle> effectivePredicate, DateTimeZone hiveStorageTimeZone, TypeManager typeManager) { boolean isOptimizedForS3 = configuration.getBoolean(S3_SELECT_OPTIMIZED, false); if (!isOptimizedForS3) { <START> log.info("S3Select is not used for path: %s", path); <END> return Optional.empty(); } try { this.hdfsEnvironment.getFileSystem(session.getUser(), path, configuration); } catch (IOException e) { throw new PrestoException(HIVE_FILESYSTEM_ERROR, "Failed getting FileSystem: " + path, e); } S3SelectClient selectClient = new PrestoS3SelectClient(configuration, clientConfig); String serdeName = HiveUtil.getDeserializerClassName(schema); if (csvSerdes.contains(serdeName)) { S3SelectLineRecordReader recordReader = new S3SelectCsvRecordReader(selectClient, path, start, length, schema, columns, effectivePredicate, typeManager); return Optional.of(new S3SelectRecordCursor(recordReader, length, schema, columns, hiveStorageTimeZone, typeManager)); } else { return Optional.empty(); } }</code><technical_language>Do need log statements</technical_language>

Target:
public Optional<RecordCursor> createRecordCursor( Configuration configuration, ConnectorSession session, Path path, long start, long length, long fileSize, Properties schema, List<HiveColumnHandle> columns, TupleDomain<HiveColumnHandle> effectivePredicate, DateTimeZone hiveStorageTimeZone, TypeManager typeManager) { boolean isS3SelectPushdownEnabled = configuration.getBoolean(S3_SELECT_PUSHDOWN_ENABLED, false); if (!isS3SelectPushdownEnabled) { return Optional.empty(); } try { this.hdfsEnvironment.getFileSystem(session.getUser(), path, configuration); } catch (IOException e) { throw new PrestoException(HIVE_FILESYSTEM_ERROR, "Failed getting filesystem for path: " + path, e); } String serdeName = getDeserializerClassName(schema); if (CSV_SERDES.contains(serdeName)) { IonSqlQueryBuilder queryBuilder = new IonSqlQueryBuilder(typeManager); String ionSqlQuery = buildQuery(queryBuilder, columns, effectivePredicate); S3SelectLineRecordReader recordReader = new S3SelectCsvRecordReader(configuration, clientConfig, path, start, length, schema, ionSqlQuery, s3ClientFactory); return Optional.of(new S3SelectRecordCursor(configuration, path, recordReader, length, schema, columns, hiveStorageTimeZone, typeManager)); } return Optional.empty(); }
Source:
<code>private void destroyTree(RepositoryObject rootOfTree) throws FedoraException { if (rootOfTree instanceof ContentContainerObject) { ContentContainerObject container = (ContentContainerObject) rootOfTree; List<ContentObject> members = container.getMembers(); for (ContentObject member : members) { destroyTree(member); } } else if (rootOfTree instanceof FileObject) { FileObject file = (FileObject) rootOfTree; List<BinaryObject> binaries = file.getBinaryObjects(); for (BinaryObject binary : binaries) { destroyTree(binary); } } Model stoneModel = rootOfTree.getModel(); stoneModel = convertModelToTombstone(rootOfTree); <START> repoObjFactory.createObject(rootOfTree.getUri(), stoneModel); <END> rootOfTree.getPremisLog().buildEvent(Premis.Deletion) .addImplementorAgent(agent.getUsernameUri()) .addEventDetail("Item deleted from repository and replaced by tombstone") .write(); repoObjFactory.createObject(rootOfTree.getUri(), stoneModel); }</code><technical_language>kind of weirding out method is named createObject PUT existing resource, work</technical_language>

Target:
private void destroyTree(RepositoryObject rootOfTree) throws FedoraException, IOException, FcrepoOperationFailedException { if (rootOfTree instanceof ContentContainerObject) { ContentContainerObject container = (ContentContainerObject) rootOfTree; List<ContentObject> members = container.getMembers(); for (ContentObject member : members) { destroyTree(member); } } Resource rootResc = rootOfTree.getResource(); Model rootModel = rootResc.getModel(); if (rootOfTree instanceof FileObject) { FileObject file = (FileObject) rootOfTree; BinaryObject origFile = file.getOriginalFile(); if (origFile != null) { addBinaryMetadataToParent(rootResc, origFile); } } boolean hasLdpContains = rootModel.contains(rootResc, Ldp.contains); if (hasLdpContains) { deleteNonContentObjects(rootModel); } Model stoneModel = convertModelToTombstone(rootOfTree, rootResc); repoObjFactory.createOrTransformObject(rootOfTree.getUri(), stoneModel); rootOfTree.getPremisLog().buildEvent(Premis.Deletion) .addEventDetail("Item deleted from repository and replaced by tombstone") .write(); }
Source:
<code>public void onRefreshEvent(RefreshEvent event) { <START> Log.d("YOLO", getClass().getSimpleName() + " is refrehshing!"); <END> startLoadingData(); }</code><technical_language>Rubbish</technical_language>

Target:
public void onRefreshEvent(RefreshEvent event) { startLoadingData(); }
Source:
<code>public void testPersistentParamString() throws Exception { <START> org.junit.Assert.assertEquals(DEFAULT_STRING, m_stringParam.value()); <END> String randomString = getRandomString(); m_stringParam.set(randomString); org.junit.Assert.assertEquals(randomString, m_stringParam.value()); org.junit.Assert.assertEquals(randomString, m_stringParam.value(true)); randomString = getRandomString(); m_stringParam.set(randomString); org.junit.Assert.assertEquals(randomString, m_stringParam.value()); org.junit.Assert.assertEquals(randomString, m_stringParam.value(true)); }</code><technical_language>add top of file (note 'static') import static org.junit.Assert.assertEquals; remove org.junit.Assert in file</technical_language>

Target:
public void testPersistentParamString() throws Exception { assertEquals(DEFAULT_STRING, m_stringParam.value()); String randomString = getRandomString(); m_stringParam.set(randomString); assertEquals(randomString, m_stringParam.value()); assertEquals(randomString, m_stringParam.value(true)); randomString = getRandomString(); m_stringParam.set(randomString); assertEquals(randomString, m_stringParam.value()); assertEquals(randomString, m_stringParam.value(true)); }
Source:
<code>public Form(final FormType type) { <START> this(); <END> setType(type); }</code><technical_language>I indentation is wrong here. 2 spaces</technical_language>

Target:
public Form(final FormType type) { setType(type); }
Source:
<code>public InputStream prefetchStream(URI uri, Map<?, ?> options) throws IOException { InputStream stream = createInputStream(uri, options); if (stream != null) { synchronized(prefetchedStreams) { <START> prefetchedStreams.put(uri, stream); <END> } } return stream; }</code><technical_language>put(uri, stream) a concurrentHashMap avoids "synchronized"</technical_language>

Target:
public boolean prefetchStream(URI uri, Map<?, ?> options) throws IOException { InputStream stream = createInputStream(uri, options); if (stream != null) { prefetchedStreams.put(uri, stream); } return stream != null; }
Source:
<code>public static AffinityGroup map(org.ovirt.engine.core.common.scheduling.AffinityGroup entity, AffinityGroup template) { AffinityGroup model = template != null ? template : new AffinityGroup(); model.setId(entity.getId().toString()); model.setName(entity.getName()); model.setDescription(entity.getDescription()); model.setPositive(entity.isVmAffinityEnabled() ? entity.getVmPolarityBooleanObject() : null); model.setEnforcing(entity.isVmEnforcing()); AffinityRule hostsRule = model.getHostsRule(); if (hostsRule == null) { hostsRule = new AffinityRule(); model.setHostsRule(hostsRule); } hostsRule.setEnabled(true); hostsRule.setEnforcing(entity.isVdsEnforcing()); hostsRule.setPositive(entity.isVdsPositive()); AffinityRule vmsRule = model.getVmsRule(); if (vmsRule == null) { vmsRule = new AffinityRule(); model.setVmsRule(vmsRule); } vmsRule.setEnabled(entity.isVmAffinityEnabled()); vmsRule.setEnforcing(entity.isVmEnforcing()); <START> vmsRule.setPositive(entity.isVmPositive()); <END> Cluster cluster = new Cluster(); cluster.setId(entity.getClusterId().toString()); model.setCluster(cluster); return model; }</code><technical_language>worth noting currently if isVMAffinityEnabled == false isVmPositive == false (always)</technical_language>

Target:
public static AffinityGroup map(org.ovirt.engine.core.common.scheduling.AffinityGroup entity, AffinityGroup template) { AffinityGroup model = template != null ? template : new AffinityGroup(); model.setId(entity.getId().toString()); model.setName(entity.getName()); model.setDescription(entity.getDescription()); model.setPositive(entity.isVmAffinityEnabled() ? entity.getVmPolarityBooleanObject() : null); model.setEnforcing(entity.isVmEnforcing()); AffinityRule hostsRule = model.getHostsRule(); if (hostsRule == null) { hostsRule = new AffinityRule(); model.setHostsRule(hostsRule); } hostsRule.setEnabled(true); hostsRule.setEnforcing(entity.isVdsEnforcing()); hostsRule.setPositive(entity.isVdsPositive()); AffinityRule vmsRule = model.getVmsRule(); if (vmsRule == null) { vmsRule = new AffinityRule(); model.setVmsRule(vmsRule); } vmsRule.setEnabled(entity.isVmAffinityEnabled()); vmsRule.setEnforcing(entity.isVmEnforcing()); vmsRule.setPositive(entity.isVmPositive()); Cluster cluster = new Cluster(); cluster.setId(entity.getClusterId().toString()); model.setCluster(cluster); Hosts hosts = model.getHosts(); if (hosts == null) { hosts = new Hosts(); model.setHosts(hosts); } entity.getVdsIds().stream().map(id -> { Host host = new Host(); host.setId(id.toString()); return host; }).forEach(model.getHosts().getHosts()::add); Vms vms = model.getVms(); if (vms == null) { vms = new Vms(); model.setVms(vms); } entity.getVmIds().stream().map(id -> { Vm vm = new Vm(); vm.setId(id.toString()); return vm; }).forEach(model.getVms().getVms()::add); return model; }
Source:
<code>public JavaRDD<StructuredRecord> transform(SparkExecutionPluginContext context, JavaRDD<StructuredRecord> input) throws Exception { JavaSparkContext javaSparkContext = context.getSparkContext(); SQLContext sqlContext = new SQLContext(javaSparkContext); outputSchema = Schema.recordOf("outputSchema", Schema.Field.of(config.outputColumn, Schema.arrayOf(Schema.of(Schema.Type.STRING)))); StructType schema = new StructType(new StructField[]{ new StructField(config.columnToBeTokenized, DataTypes.StringType, false, Metadata.empty())}); JavaRDD<Row> rowRDD = input.map(new Function<StructuredRecord, Row>() { @Override public Row call(StructuredRecord rec) throws Exception { return RowFactory.create(rec.get(config.columnToBeTokenized)); } }); DataFrame sentenceDataFrame = sqlContext.createDataFrame(rowRDD, schema); RegexTokenizer tokenizer = new RegexTokenizer().setInputCol(config.columnToBeTokenized) .setOutputCol(config.outputColumn).setPattern(config.delimiter); DataFrame tokenizedDataFrame = tokenizer.transform(sentenceDataFrame); JavaRDD<Row> tokenizedRDD = javaSparkContext.parallelize(tokenizedDataFrame. select(config.outputColumn).collectAsList()); JavaRDD<StructuredRecord> output = tokenizedRDD.map(new Function<Row, StructuredRecord>() { @Override public StructuredRecord call(Row row) throws Exception { StructuredRecord.Builder builder = StructuredRecord.builder(outputSchema); <START> for (Schema.Field f : outputSchema.getFields()) { <END> builder.set(f.getName(), row.getList(0)); } return builder.build(); } }); return output; }</code><technical_language>please names for fields</technical_language>

Target:
public JavaRDD<StructuredRecord> transform(SparkExecutionPluginContext context, JavaRDD<StructuredRecord> input) throws Exception { JavaSparkContext javaSparkContext = context.getSparkContext(); SQLContext sqlContext = new SQLContext(javaSparkContext); outputSchema = Schema.recordOf("outputSchema", Schema.Field.of(config.outputColumn, Schema.arrayOf(Schema.of(Schema.Type.STRING)))); StructType schema = new StructType(new StructField[]{ new StructField(config.columnToBeTokenized, DataTypes.StringType, false, Metadata.empty())}); JavaRDD<Row> rowRDD = input.map(new Function<StructuredRecord, Row>() { @Override public Row call(StructuredRecord rec) throws Exception { return RowFactory.create(rec.get(config.columnToBeTokenized)); } }); DataFrame sentenceDataFrame = sqlContext.createDataFrame(rowRDD, schema); RegexTokenizer tokenizer = new RegexTokenizer().setInputCol(config.columnToBeTokenized) .setOutputCol(config.outputColumn).setPattern(config.delimiter); DataFrame tokenizedDataFrame = tokenizer.transform(sentenceDataFrame); JavaRDD<Row> tokenizedRDD = javaSparkContext.parallelize(tokenizedDataFrame. select(config.outputColumn).collectAsList()); JavaRDD<StructuredRecord> output = tokenizedRDD.map(new Function<Row, StructuredRecord>() { @Override public StructuredRecord call(Row row) throws Exception { StructuredRecord.Builder builder = StructuredRecord.builder(outputSchema); for (Schema.Field field : outputSchema.getFields()) { builder.set(field.getName(), row.getList(0)); } return builder.build(); } }); return output; }
Source:
<code>public FileBasedConfig getConfig() { <START> if (userConfig.isOutdated()) { <END> try { loadUserConfig(); } catch (IOException e) { throw new RuntimeException(e); } } if (repoConfig.isOutdated()) { try { loadRepoConfig(); } catch (IOException e) { throw new RuntimeException(e); } } return repoConfig; }</code><technical_language>check for systemConfig.isOutdated() well</technical_language>

Target:
public FileBasedConfig getConfig() { if (systemConfig.isOutdated()) { try { loadSystemConfig(); } catch (IOException e) { throw new RuntimeException(e); } } if (userConfig.isOutdated()) { try { loadUserConfig(); } catch (IOException e) { throw new RuntimeException(e); } } if (repoConfig.isOutdated()) { try { loadRepoConfig(); } catch (IOException e) { throw new RuntimeException(e); } } return repoConfig; }
Source:
<code>public static Map<String, List<String>> removeAuthHeaders(Map<String, List<String>> headers) { try { Map<String, List<String>> requestHeaders = new HashMap<String, List<String>>(headers); if (requestHeaders.get(HttpHeaders.AUTHORIZATION) != null) { requestHeaders.remove(HttpHeaders.AUTHORIZATION); } if (requestHeaders.get("Proxy-Authorization") != null) { requestHeaders.remove("Proxy-Authorization"); } return requestHeaders; <START> } catch (NullPointerException e) { <END> return null; } }</code><technical_language>catch a NPE. prevent happening. is resulting in NPE</technical_language>

Target:
public static Map<String, List<String>> removeAuthHeaders(Map<String, List<String>> headers) { Map<String, List<String>> requestHeaders = new HashMap<String, List<String>>(headers); if (requestHeaders.get(HttpHeaders.AUTHORIZATION) != null) { requestHeaders.remove(HttpHeaders.AUTHORIZATION); } if (requestHeaders.get("Proxy-Authorization") != null) { requestHeaders.remove("Proxy-Authorization"); } return requestHeaders; }
Source:
<code>public void testCompareRanges() { <START> assertTrue(compareRanges("abcdefghij".getBytes(), 0, 10, "abcdefghij".getBytes(), 0, 10) == 0); <END> assertTrue(compareRanges("123abcdefghij".getBytes(), 3, 10, "abcdefghij".getBytes(), 0, 10) == 0); }</code><technical_language>assertEquals</technical_language>

Target:
public void testCompareRanges() { assertEquals(compareRanges("abcdefghij".getBytes(), 0, 10, "abcdefghij".getBytes(), 0, 10), 0); assertEquals(compareRanges("123abcdefghij".getBytes(), 3, 10, "abcdefghij".getBytes(), 0, 10), 0); }
Source:
<code>protected IModel<List<Person>> createModel() { <START> return CollectionCopyModel.custom(Suppliers2.<Person>arrayListAsList(), GenericEntityModel.<Person>factory()); <END> }</code><technical_language>tests for CollectionCopyModels in TestSerializableCollectionCopyModel TestGenericEntityCollectionCopyModel. If removed GenericEntityArrayListModel, this test (TestSuiteGenericEntityCollectionModel) away. If simply deprecated GenericEntityArrayListModel, tests stayed (since GenericEntityArrayListModel is used, want ensure works properly). for other models. please fix that</technical_language>

Target:
protected IModel<List<Person>> createModel() { return GenericEntityArrayListModel.of(Person.class); }
Source:
<code>public void shouldMarkHostDeadSinceServerIsDown() throws Exception { final Cluster cluster = TestClientFactory.open(); try { assertEquals(0, cluster.availableHosts().size()); final Client client1 = cluster.connect().init(); assertEquals(1, cluster.availableHosts().size()); stopServer(); cluster.connect().init(); try { <START> client1.submit("1+1").all().join(); <END> } catch (Exception ex) { } assertEquals(0, cluster.availableHosts().size()); } finally { cluster.close(); } }</code><technical_language>If expect exception (i.e. i meant ignored) test fail() if request succeeds</technical_language>

Target:
public void shouldMarkHostDeadSinceServerIsDown() throws Exception { final Cluster cluster = TestClientFactory.open(); try { assertEquals(0, cluster.availableHosts().size()); final Client client1 = cluster.connect().init(); assertEquals(1, cluster.availableHosts().size()); stopServer(); cluster.connect().init(); try { client1.submit("1+1").all().join(); fail("Expecting an exception because the server is shut down."); } catch (Exception ex) { } assertEquals(0, cluster.availableHosts().size()); } finally { cluster.close(); } }
Source:
<code>public Response updateCustomizedStateAggregationConfig(@PathParam("clusterId") String clusterId, @QueryParam("command") String commandStr, @QueryParam("type") String type) { HelixZkClient zkClient = getHelixZkClient(); if (!ZKUtil.isClusterSetup(clusterId, zkClient)) { return notFound(); } Command command; if (commandStr == null || commandStr.isEmpty()) { command = Command.update; } else { try { command = getCommand(commandStr); } catch (HelixException ex) { return badRequest(ex.getMessage()); } } HelixAdmin admin = getHelixAdmin(); try { switch (command) { <START> case delete: { <END> admin.removeTypeFromCustomizedStateAggregationConfig(clusterId, type); } break; case update: { admin.addTypeToCustomizedStateAggregationConfig(clusterId, type); } break; default: return badRequest("Unsupported command " + commandStr); } } catch (Exception ex) { _logger.error("Failed to " + command + " CustomizedStateAggregationConfig for cluster " + clusterId + " new type: " + type + ", Exception: " + ex); return serverError(ex); } return OK(); }</code><technical_language>I remove for case blocks</technical_language>

Target:
public Response updateCustomizedStateAggregationConfig(@PathParam("clusterId") String clusterId, @QueryParam("command") String commandStr, @QueryParam("type") String type) { if (!doesClusterExist(clusterId)) { return notFound(String.format("Cluster %s does not exist", clusterId)); } Command command; if (commandStr == null || commandStr.isEmpty()) { command = Command.add; } else { try { command = getCommand(commandStr); } catch (HelixException ex) { return badRequest(ex.getMessage()); } } HelixAdmin admin = getHelixAdmin(); try { switch (command) { case delete: admin.removeTypeFromCustomizedStateAggregationConfig(clusterId, type); break; case add: admin.addTypeToCustomizedStateAggregationConfig(clusterId, type); break; default: return badRequest("Unsupported command " + commandStr); } } catch (Exception ex) { _logger.error("Failed to CustomizedStateAggregationConfig for cluster new type: {}, Exception: {}", command, clusterId, type, ex); return serverError(ex); } return OK(); }
Source:
<code>public void testBAMThroughCRAMRoundTrip() throws IOException, NoSuchAlgorithmException { final File TEST_DATA_DIR = new File("src/test/resources/htsjdk/samtools/cram"); final File originalBAMInputFile = new File(TEST_DATA_DIR, "CEUTrio.HiSeq.WGS.b37.NA12878.20.first.8000.bam"); final File referenceFile = new File(TEST_DATA_DIR, "human_g1k_v37.20.subset.fasta"); List<SAMRecord> originalBAMRecords = getSAMRecordsFromFile(originalBAMInputFile, referenceFile); for (int i = 0; i < originalBAMRecords.size(); i++) { originalBAMRecords.get(i).setIndexingBin(null); } final File tempCRAMFile = File.createTempFile("testBAMThroughCRAMRoundTrip", CramIO.CRAM_FILE_EXTENSION); tempCRAMFile.deleteOnExit(); SAMFileHeader samHeader = getFileHeader(originalBAMInputFile, referenceFile); writeRecordsToFile(originalBAMRecords, tempCRAMFile, referenceFile, samHeader); List<SAMRecord> cramRecords = getSAMRecordsFromFile(tempCRAMFile, referenceFile); Assert.assertEquals(cramRecords.size(), originalBAMRecords.size()); for (int i = 0; i < originalBAMRecords.size(); i++) { Assert.assertEquals(originalBAMRecords.get(i), cramRecords.get(i)); } final File roundTrippedBAMFile = File.createTempFile("testBAMThroughCRAMRoundTrip", BamFileIoUtils.BAM_FILE_EXTENSION); roundTrippedBAMFile.deleteOnExit(); writeRecordsToFile(cramRecords, roundTrippedBAMFile, referenceFile, samHeader); <START> Assert.assertTrue(compareMD5Digests(roundTrippedBAMFile, originalBAMInputFile)); <END> }</code><technical_language>binary equality of BAM files, for example changing compression level break this</technical_language>

Target:
public void testBAMThroughCRAMRoundTrip() throws IOException, NoSuchAlgorithmException { final File TEST_DATA_DIR = new File("src/test/resources/htsjdk/samtools/cram"); final File originalBAMInputFile = new File(TEST_DATA_DIR, "CEUTrio.HiSeq.WGS.b37.NA12878.20.first.8000.bam"); final File referenceFile = new File(TEST_DATA_DIR, "human_g1k_v37.20.subset.fasta"); List<SAMRecord> originalBAMRecords = getSAMRecordsFromFile(originalBAMInputFile, referenceFile); for (int i = 0; i < originalBAMRecords.size(); i++) { originalBAMRecords.get(i).setIndexingBin(null); } final File tempCRAMFile = File.createTempFile("testBAMThroughCRAMRoundTrip", CramIO.CRAM_FILE_EXTENSION); tempCRAMFile.deleteOnExit(); SAMFileHeader samHeader = getFileHeader(originalBAMInputFile, referenceFile); writeRecordsToFile(originalBAMRecords, tempCRAMFile, referenceFile, samHeader); List<SAMRecord> cramRecords = getSAMRecordsFromFile(tempCRAMFile, referenceFile); Assert.assertEquals(cramRecords.size(), originalBAMRecords.size()); for (int i = 0; i < originalBAMRecords.size(); i++) { Assert.assertEquals(originalBAMRecords.get(i), cramRecords.get(i)); } }
Source:
<code>public void onNext(T t) { if (done) { return; } boolean callOnOverflow = false; Deque<T> dq = deque; synchronized (dq) { if (dq.size() == bufferSize) { switch (strategy) { case DROP_LATEST: dq.pollLast(); dq.offer(t); callOnOverflow = true; break; case DROP_OLDEST: dq.poll(); dq.offer(t); callOnOverflow = true; break; default: break; } } else { dq.offer(t); <START> drain(); <END> return; } } if (callOnOverflow) { if (onOverflow != null) { try { onOverflow.run(); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); s.cancel(); onError(ex); } } } else { s.cancel(); onError(new MissingBackpressureException()); } }</code><technical_language>call drain while in synchronized block. this: java if (done) { return; } boolean callOnOverflow = false; boolean callError = false; Deque<T> dq = deque; synchronized (dq) { if (dq.size() == bufferSize) { switch (strategy) { case DROP_LATEST: dq.pollLast(); dq.offer(t); callOnOverflow = true; break; case DROP_OLDEST: dq.poll(); dq.offer(t); callOnOverflow = true; break; default: // signal error callError = true; break; } } else { dq.offer(t); return; } } if (callOnOverflow) { if (onOverflow != null) { try { onOverflow.run(); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); s.cancel(); onError(ex); } } } else if (callError) { s.cancel(); onError(new MissingBackpressureException()); } else { drain(); }</technical_language>

Target:
public void onNext(T t) { if (done) { return; } boolean callOnOverflow = false; boolean callError = false; Deque<T> dq = deque; synchronized (dq) { if (dq.size() == bufferSize) { switch (strategy) { case DROP_LATEST: dq.pollLast(); dq.offer(t); callOnOverflow = true; break; case DROP_OLDEST: dq.poll(); dq.offer(t); callOnOverflow = true; break; default: callError = true; break; } } else { dq.offer(t); } } if (callOnOverflow) { if (onOverflow != null) { try { onOverflow.run(); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); s.cancel(); onError(ex); } } } else if(callError) { s.cancel(); onError(new MissingBackpressureException()); } else { drain(); } }
Source:
<code><START> public Fixture compareStoredQueriesHideMatchingRows(String symbol1, String symbol2) { <END> return new dbfit.fixture.CompareStoredQueries(environment,symbol1, symbol2, true); }</code><technical_language>a new method - this work in Flow Mode. in order in Standalone Mode I need a separate fixture name</technical_language>

Target:
public Fixture compareStoredQueriesHideMatchingRows(String symbol1, String symbol2) { return new dbfit.fixture.CompareStoredQueriesHideMatchingRows(environment, symbol1, symbol2); }
Source:
<code>private void registerFileType( FileTypeRegistry fileTypeRegistry, MavenResources mavenResources, EditorRegistry editorRegistry) { <START> FileType pomFile = new FileType(mavenResources.maven(), null, ".*pom\\.xml"); <END> fileTypeRegistry.registerFileType(pomFile); }</code><technical_language>This match a file named "foopom.xml", want</technical_language>

Target:
private void registerFileType( FileTypeRegistry fileTypeRegistry, MavenResources mavenResources, EditorRegistry editorRegistry) { FileType pomFile = new FileType(mavenResources.maven(), null, ".*[/\\\\]?pom\\.xml$"); fileTypeRegistry.registerFileType(pomFile); }