language
stringclasses
1 value
repo
stringclasses
60 values
path
stringlengths
22
294
class_span
dict
source
stringlengths
13
1.16M
target
stringlengths
1
113
java
apache__avro
lang/java/ipc/src/test/java/org/apache/avro/generic/TestBuilderCopy.java
{ "start": 1137, "end": 1893 }
class ____ { @Test void builderCopy() { StringablesRecord.Builder builder = StringablesRecord.newBuilder(); builder.setValue(new BigDecimal("1314.11")); HashMap<String, BigDecimal> mapWithBigDecimalElements = new HashMap<>(); mapWithBigDecimalElements.put("testElement", new BigDecimal("220.11")); ...
TestBuilderCopy
java
apache__flink
flink-core/src/main/java/org/apache/flink/util/Visitable.java
{ "start": 1579, "end": 2493 }
interface ____<T extends Visitable<T>> { /** * Contains the logic to invoke the visitor and continue the traversal. Typically invokes the * pre-visit method of the visitor, then sends the visitor to the children (or predecessors) and * then invokes the post-visit method. * * <p>A typical c...
Visitable
java
apache__camel
components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulClusteredRoutePolicyIT.java
{ "start": 1691, "end": 4634 }
class ____ { @RegisterExtension public static ConsulService service = ConsulServiceFactory.createService(); private static final Logger LOGGER = LoggerFactory.getLogger(ConsulClusteredRoutePolicyIT.class); private static final List<String> CLIENTS = IntStream.range(0, 3).mapToObj(Integer::toString).toL...
ConsulClusteredRoutePolicyIT
java
elastic__elasticsearch
server/src/test/java/org/elasticsearch/script/ScriptContextTests.java
{ "start": 955, "end": 1051 }
interface ____ { String typoNewInstanceMethod(int foo); } public
MissingNewInstance
java
elastic__elasticsearch
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/action/CreateTrainedModelAssignmentActionRequestTests.java
{ "start": 516, "end": 1061 }
class ____ extends AbstractWireSerializingTestCase<Request> { @Override protected Request createTestInstance() { return new Request(StartTrainedModelDeploymentTaskParamsTests.createRandom(), null); } @Override protected Request mutateInstance(Request instance) { return null;// TODO...
CreateTrainedModelAssignmentActionRequestTests
java
alibaba__druid
core/src/test/java/com/alibaba/druid/bvt/sql/mysql/param/MySqlParameterizedOutputVisitorTest_58.java
{ "start": 331, "end": 1419 }
class ____ extends TestCase { final DbType dbType = JdbcConstants.MYSQL; public void test_for_parameterize() throws Exception { String sql = "select * from t where id = 101"; List<Object> params = new ArrayList<Object>(); String psql = ParameterizedOutputVisitorUtils.parameterize(sql, ...
MySqlParameterizedOutputVisitorTest_58
java
apache__flink
flink-end-to-end-tests/flink-tpch-test/src/main/java/org/apache/flink/table/tpch/TpchDataGenerator.java
{ "start": 1227, "end": 5051 }
class ____ { public static final int QUERY_NUM = 22; public static void main(String[] args) throws IOException { if (args.length != 2) { System.out.println("Exactly 1 double value and 1 path should be provided as argument"); return; } double scale = Double.valu...
TpchDataGenerator
java
apache__hadoop
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/Merger.java
{ "start": 21197, "end": 33738 }
class ____ the inmem segment's byte[]. //When we load the value bytes from disk, we shouldn't use //the same byte[] since it would corrupt the data in the inmem //segment. So we maintain an explicit DIB for value bytes //obtained from disk, and if the current segment is a disk //...
to
java
spring-projects__spring-boot
loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/ReachabilityMetadataProperties.java
{ "start": 893, "end": 2578 }
class ____ { /** * Location of the properties file. Must be formatted using * {@link String#format(String, Object...)} with the group id, artifact id and version * of the dependency. */ public static final String REACHABILITY_METADATA_PROPERTIES_LOCATION_TEMPLATE = "META-INF/native-image/%s/%s/%s/reachabilit...
ReachabilityMetadataProperties
java
apache__flink
flink-python/src/main/java/org/apache/flink/table/runtime/operators/python/table/EmbeddedPythonTableFunctionOperator.java
{ "start": 2062, "end": 7228 }
class ____ extends AbstractEmbeddedStatelessFunctionOperator { private static final long serialVersionUID = 1L; /** The Python {@link TableFunction} to be executed. */ private final PythonFunctionInfo tableFunction; /** The correlate join type. */ private final FlinkJoinType joinType; /** Th...
EmbeddedPythonTableFunctionOperator
java
apache__kafka
streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java
{ "start": 8385, "end": 25238 }
class ____ extends AbstractConfig { private static final Logger log = LoggerFactory.getLogger(StreamsConfig.class); private static final ConfigDef CONFIG; private final boolean eosEnabled; private static final long DEFAULT_COMMIT_INTERVAL_MS = 30000L; private static final long EOS_DEFAULT_COMMIT_...
StreamsConfig
java
spring-projects__spring-boot
module/spring-boot-amqp/src/main/java/org/springframework/boot/amqp/autoconfigure/AbstractConnectionFactoryConfigurer.java
{ "start": 1289, "end": 4043 }
class ____<T extends AbstractConnectionFactory> { private final RabbitProperties rabbitProperties; private @Nullable ConnectionNameStrategy connectionNameStrategy; private final RabbitConnectionDetails connectionDetails; /** * Creates a new configurer that will configure the connection factory using the given...
AbstractConnectionFactoryConfigurer
java
spring-projects__spring-framework
spring-messaging/src/test/java/org/springframework/messaging/simp/config/MessageBrokerConfigurationTests.java
{ "start": 25070, "end": 25495 }
class ____ extends SimpleBrokerConfig { @Override public void configureMessageBroker(MessageBrokerRegistry registry) { registry.enableStompBrokerRelay("/topic", "/queue") .setAutoStartup(true) .setTcpClient(new NoOpTcpClient()) .setUserDestinationBroadcast("/topic/unresolved-user-destination") ...
BrokerRelayConfig
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/dialect/identity/HANAIdentityColumnSupport.java
{ "start": 182, "end": 751 }
class ____ extends IdentityColumnSupportImpl { public static final HANAIdentityColumnSupport INSTANCE = new HANAIdentityColumnSupport(); @Override public boolean supportsIdentityColumns() { return true; } @Override public String getIdentitySelectString(String table, String column, int type) throws MappingExc...
HANAIdentityColumnSupport
java
spring-projects__spring-boot
core/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java
{ "start": 98656, "end": 98990 }
class ____ { private final CustomList<String> values; ConstructorBoundCustomListProperties(CustomList<String> values) { this.values = values; } CustomList<String> getValues() { return this.values; } } @EnableConfigurationProperties(SetterBoundCustomListProperties.class) static
ConstructorBoundCustomListProperties
java
apache__camel
core/camel-management/src/test/java/org/apache/camel/management/ManagedStatisticsLevelOffTest.java
{ "start": 1331, "end": 2974 }
class ____ extends ManagementTestSupport { @Override protected CamelContext createCamelContext() throws Exception { CamelContext context = super.createCamelContext(); // disable it by default context.getManagementStrategy().getManagementAgent().setStatisticsLevel(ManagementStatisticsLev...
ManagedStatisticsLevelOffTest
java
alibaba__fastjson
src/test/java/com/alibaba/json/bvt/issue_1100/Issue1150.java
{ "start": 648, "end": 718 }
class ____ { public Item[] values; } public static
Model2
java
apache__kafka
metadata/src/test/java/org/apache/kafka/controller/ReplicationControlManagerTest.java
{ "start": 9885, "end": 10106 }
class ____ { private static final Logger log = LoggerFactory.getLogger(ReplicationControlManagerTest.class); private static final int BROKER_SESSION_TIMEOUT_MS = 1000; private static
ReplicationControlManagerTest
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/collectionincompatibletype/TruthIncompatibleTypeTest.java
{ "start": 4158, "end": 4571 }
class ____ { public void f() { assertThat(Byte.valueOf((byte) 2)).isEqualTo(2); } } """) .doTest(); } @Test public void chainedThrowAssertion_noMatch() { compilationHelper .addSourceLines( "Test.java", ...
Test
java
playframework__playframework
web/play-java-forms/src/main/java/play/data/validation/Constraints.java
{ "start": 24695, "end": 25027 }
interface ____ { String message() default "error.invalid"; Class<?>[] groups() default {}; Class<? extends Payload>[] payload() default {}; /** Defines several {@code @ValidateWithPayload} annotations on the same element. */ @Target({TYPE, ANNOTATION_TYPE}) @Retention(RUNTIME) public @
ValidateWithPayload
java
apache__flink
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/runtime/util/GenericRowRecordSortComparator.java
{ "start": 1121, "end": 1243 }
class ____ compare two GenericRowData based on sortKey value. Note: Only support sortKey * is Comparable value. */ public
to
java
apache__logging-log4j2
log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/action/CommonsCompressAction.java
{ "start": 1330, "end": 5685 }
class ____ extends AbstractAction { private static final int BUF_SIZE = 8192; /** * Compressor name. One of "gz", "bzip2", "xz", "zst", "pack200" or "deflate". */ private final String name; /** * Source file. */ private final File source; /** * Destination file. ...
CommonsCompressAction
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/mapping/FilterConfiguration.java
{ "start": 370, "end": 2233 }
class ____ { private final String name; private final String condition; private final boolean autoAliasInjection; private final Map<String, String> aliasTableMap; private final Map<String, String> aliasEntityMap; private final PersistentClass persistentClass; public FilterConfiguration( String name, Strin...
FilterConfiguration
java
google__dagger
dagger-producers/main/java/dagger/producers/monitoring/internal/Monitors.java
{ "start": 1156, "end": 3112 }
class ____ { private static final Logger logger = Logger.getLogger(Monitors.class.getName()); /** * Returns a monitor factory that delegates to the given factories, and ensures that any method * called on this object, even transitively, does not throw a {@link RuntimeException} or return * null. * *...
Monitors
java
apache__flink
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/SubtaskStateStatsTest.java
{ "start": 1005, "end": 2968 }
class ____ { /** Tests simple access via the getters. */ @Test void testSimpleAccess() throws Exception { test(false); } /** Tests that the snapshot is actually serializable. */ @Test void testIsJavaSerializable() throws Exception { test(true); } public void test(b...
SubtaskStateStatsTest
java
grpc__grpc-java
alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java
{ "start": 4865, "end": 5692 }
interface ____ { /** * <pre> * Handshaker service accepts a stream of handshaker request, returning a * stream of handshaker response. Client is expected to send exactly one * message with either client_start or server_start followed by one or more * messages with next. Each time client se...
AsyncService
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmCoalesce.java
{ "start": 939, "end": 4570 }
class ____<T> extends AbstractSqmExpression<T> implements JpaCoalesce<T> { private final SqmFunctionDescriptor functionDescriptor; private final List<SqmExpression<? extends T>> arguments; public SqmCoalesce(NodeBuilder nodeBuilder) { this( null, nodeBuilder ); } public SqmCoalesce(@Nullable SqmBindableType<T>...
SqmCoalesce
java
assertj__assertj-core
assertj-tests/assertj-integration-tests/assertj-core-tests/src/test/java/org/assertj/tests/core/api/Assertions_assertThat_with_InputStream_Test.java
{ "start": 986, "end": 1362 }
class ____ { private static InputStream actual; @BeforeAll static void setUpOnce() { actual = new ByteArrayInputStream(new byte[0]); } @Test void should_create_Assert() { AbstractInputStreamAssert<?, ? extends InputStream> assertions = Assertions.assertThat(actual); assertThat(assertions).isN...
Assertions_assertThat_with_InputStream_Test
java
hibernate__hibernate-orm
hibernate-core/src/test/java/org/hibernate/orm/test/mapping/mutability/attribute/MutableMapAsBasicTests.java
{ "start": 3424, "end": 3716 }
class ____ { @Id private Integer id; @Convert( converter = MapConverter.class ) private Map<String,String> data; private TestEntity() { // for use by Hibernate } public TestEntity(Integer id, Map<String,String> data) { this.id = id; this.data = data; } } }
TestEntity
java
apache__camel
tooling/maven/camel-package-maven-plugin/src/it/HeaderSupport/src/main/java/org/apache/camel/component/foo/FooEndpoint.java
{ "start": 1267, "end": 2154 }
class ____ { @UriPath(description = "Hostname of the Foo server") @Metadata(required = true) private String host; @UriPath(description = "Port of the Foo server") private int port; @UriParam(label = "common", defaultValue = "5") private int intervalSeconds = 5; public int getIntervalSe...
FooEndpoint
java
hibernate__hibernate-orm
hibernate-core/src/test/java/org/hibernate/orm/test/orphan/one2one/fk/composite/EmployeeInfo.java
{ "start": 282, "end": 1478 }
class ____ implements Serializable { private Long companyId; private Long personId; public Id() { } public Id(Long companyId, Long personId) { this.companyId = companyId; this.personId = personId; } public Long getCompanyId() { return companyId; } public void setCompanyId(Long companyId) ...
Id
java
quarkusio__quarkus
integration-tests/main/src/test/java/io/quarkus/it/main/QuarkusTestNestedWithResourcesTestCase.java
{ "start": 1238, "end": 1858 }
class ____ { public static final AtomicInteger COUNTER = new AtomicInteger(0); public static final AtomicInteger COUNT_RESOURCE_STARTS = new AtomicInteger(0); @InjectDummyString String bar; @Test @Order(1) public void testBarFromOuter() { Assertions.assertEquals("bar", bar); ...
QuarkusTestNestedWithResourcesTestCase
java
spring-projects__spring-framework
spring-core/src/test/java/org/springframework/core/GenericTypeResolverTests.java
{ "start": 13423, "end": 13446 }
class ____ extends A {}
C
java
apache__camel
components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackConstants.java
{ "start": 871, "end": 2325 }
class ____ { public static final String SLACK_USERNAME_FIELD = "username"; public static final String SLACK_TEXT_FIELD = "text"; public static final String SLACK_CHANNEL_FIELD = "channel"; public static final String SLACK_ICON_URL_FIELD = "icon_url"; public static final String SLACK_ICON_EMOJI_FIEL...
SlackConstants
java
alibaba__fastjson
src/test/java/com/alibaba/json/bvt/asm/ASMDeserTest.java
{ "start": 1508, "end": 1645 }
class ____ extends ArrayList<String> { public EntityError(){ throw new RuntimeException(); } } }
EntityError
java
spring-projects__spring-framework
spring-test/src/test/java/org/springframework/test/context/aot/samples/basic/DisabledInAotProcessingTests.java
{ "start": 2135, "end": 2426 }
class ____ { @Test void disabledInAotMode(@Autowired String enigma) { assertThat(AotDetector.useGeneratedArtifacts()).as("Should be disabled in AOT mode").isFalse(); assertThat(enigma).isEqualTo("puzzle"); } @Configuration(proxyBeanMethods = false) static
DisabledInAotProcessingTests
java
google__guava
android/guava-tests/benchmark/com/google/common/util/concurrent/ExecutionListBenchmark.java
{ "start": 15855, "end": 16145 }
class ____ { final Runnable runnable; final Executor executor; @Nullable RunnableExecutorPair next; RunnableExecutorPair(Runnable runnable, Executor executor) { this.runnable = runnable; this.executor = executor; } } } }
RunnableExecutorPair
java
junit-team__junit5
platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsWithGenericTypeHierarchiesTests.java
{ "start": 5268, "end": 5463 }
class ____ implements InterfaceWithGenericObjectParameter { public void foo(@SuppressWarnings("unused") Number a) { } } public static
ClassImplementingGenericInterfaceWithMoreSpecificMethod
java
spring-projects__spring-boot
module/spring-boot-micrometer-tracing-opentelemetry/src/test/java/org/springframework/boot/micrometer/tracing/opentelemetry/autoconfigure/OpenTelemetryTracingAutoConfigurationTests.java
{ "start": 20911, "end": 21535 }
class ____ { @Bean @Order(1) SdkTracerProviderBuilderCustomizer sdkTracerProviderBuilderCustomizerOne() { return (builder) -> { SpanLimits spanLimits = SpanLimits.builder().setMaxNumberOfEvents(42).build(); builder.setSpanLimits(spanLimits); }; } @Bean @Order(0) SdkTracerProviderBuilderCus...
SdkTracerProviderCustomizationConfiguration
java
apache__dubbo
dubbo-compatible/src/test/java/org/apache/dubbo/service/MockInvocation.java
{ "start": 1600, "end": 5128 }
class ____ implements Invocation { private String arg0; private Map<String, Object> attachments; public MockInvocation(String arg0) { this.arg0 = arg0; attachments = new HashMap<>(); attachments.put(PATH_KEY, "dubbo"); attachments.put(GROUP_KEY, "dubbo"); attachme...
MockInvocation
java
elastic__elasticsearch
modules/runtime-fields-common/src/yamlRestTest/java/org/elasticsearch/painless/RuntimeFieldsClientYamlTestSuiteIT.java
{ "start": 896, "end": 1516 }
class ____ extends ESClientYamlSuiteTestCase { @ClassRule public static ElasticsearchCluster cluster = ElasticsearchCluster.local().module("runtime-fields-common").build(); public RuntimeFieldsClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) { super(testCandidate); } ...
RuntimeFieldsClientYamlTestSuiteIT
java
hibernate__hibernate-orm
hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/LoggingInspections.java
{ "start": 1030, "end": 1600 }
interface ____ { /** * The message-key to watch for. The message-key is the combination of * {@link org.jboss.logging.annotations.MessageLogger#projectCode()} * and {@link org.jboss.logging.annotations.Message#id()} used by * JBoss Logging to prefix each messaged log event */ String messageKey(); ...
Message
java
quarkusio__quarkus
extensions/tls-registry/deployment/src/test/java/io/quarkus/tls/NamedP12TrustStoreTest.java
{ "start": 845, "end": 2217 }
class ____ { private static final String configuration = """ quarkus.tls.http.trust-store.p12.path=target/certs/test-formats-truststore.p12 quarkus.tls.http.trust-store.p12.password=password """; @RegisterExtension static final QuarkusUnitTest config = new QuarkusUnitTe...
NamedP12TrustStoreTest
java
ReactiveX__RxJava
src/test/java/io/reactivex/rxjava3/tck/SingleFlatMapFlowableTckTest.java
{ "start": 813, "end": 1339 }
class ____ extends BaseTck<Integer> { @Override public Publisher<Integer> createPublisher(final long elements) { return Single.just(1).hide().flatMapPublisher(new Function<Integer, Publisher<Integer>>() { @Override public Publisher<Integer> apply(...
SingleFlatMapFlowableTckTest
java
apache__camel
core/camel-api/src/main/java/org/apache/camel/spi/HasGroup.java
{ "start": 857, "end": 1008 }
interface ____ an object which has belongs to a group Group which is useful for group related * operation such as clustering, JMX style API */ public
for
java
apache__dubbo
dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/rest/mapping/meta/CorsMeta.java
{ "start": 1504, "end": 7219 }
class ____ { private final String[] allowedOrigins; private final Pattern[] allowedOriginsPatterns; private final String[] allowedMethods; private final String[] allowedHeaders; private final String[] exposedHeaders; private final Boolean allowCredentials; private final Long maxAge; pr...
CorsMeta
java
google__guava
android/guava-testlib/src/com/google/common/collect/testing/SortedMapInterfaceTest.java
{ "start": 966, "end": 1098 }
class ____ * conformance of concrete {@link SortedMap} subclasses to that contract. * * @author Jared Levy */ // TODO: Use this
test
java
quarkusio__quarkus
independent-projects/arc/tests/src/test/java/io/quarkus/arc/test/invoker/lookup/LookupUnsatisfiedTest.java
{ "start": 566, "end": 1422 }
class ____ { @RegisterExtension public ArcTestContainer container = ArcTestContainer.builder() .beanClasses(MyService.class) .beanRegistrars(new InvokerHelperRegistrar(MyService.class, (bean, factory, invokers) -> { MethodInfo method = bean.getImplClazz().firstMethod("hel...
LookupUnsatisfiedTest
java
elastic__elasticsearch
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/spatial/SpatialDisjointTests.java
{ "start": 1001, "end": 2380 }
class ____ extends SpatialRelatesFunctionTestCase { public SpatialDisjointTests(@Name("TestCase") Supplier<TestCaseSupplier.TestCase> testCaseSupplier) { this.testCase = testCaseSupplier.get(); } @ParametersFactory public static Iterable<Object[]> parameters() { List<TestCaseSupplier> s...
SpatialDisjointTests
java
elastic__elasticsearch
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/SurrogateExpression.java
{ "start": 987, "end": 1164 }
interface ____ { /** * Returns the expression to be replaced by or {@code null} if this cannot * be replaced. */ Expression surrogate(); }
SurrogateExpression
java
elastic__elasticsearch
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/QuerySettings.java
{ "start": 763, "end": 5577 }
class ____ { public static final QuerySettingDef<String> PROJECT_ROUTING = new QuerySettingDef<>( "project_routing", DataType.KEYWORD, true, false, true, "A project routing expression, " + "used to define which projects to route the query to. " ...
QuerySettings
java
elastic__elasticsearch
x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/Attachment.java
{ "start": 7117, "end": 8469 }
class ____ extends Bytes { protected XContent(String id, ToXContent content, XContentType type) { this(id, id, content, type); } protected XContent(String id, String name, ToXContent content, XContentType type) { super(id, name, bytes(name, content, type), mimeType(type...
XContent
java
apache__kafka
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java
{ "start": 42111, "end": 51659 }
class ____ implements RaftClient.Listener<ApiMessageAndVersion> { @Override public void handleCommit(BatchReader<ApiMessageAndVersion> reader) { appendRaftEvent("handleCommit[baseOffset=" + reader.baseOffset() + "]", () -> { try { boolean isActive = isActi...
QuorumMetaLogListener
java
google__guava
android/guava/src/com/google/common/cache/LongAddables.java
{ "start": 1741, "end": 2057 }
class ____ extends AtomicLong implements LongAddable { @Override public void increment() { getAndIncrement(); } @Override public void add(long x) { getAndAdd(x); } @Override public long sum() { return get(); } } private LongAddables() {} }
PureJavaLongAddable
java
elastic__elasticsearch
test/framework/src/main/java/org/elasticsearch/ingest/TestIngestDocument.java
{ "start": 796, "end": 3163 }
class ____ { public static final long DEFAULT_VERSION = 12345L; private static final String VERSION = IngestDocument.Metadata.VERSION.getFieldName(); /** * Create an {@link IngestDocument} from the given sourceAndMetadata and ingestMetadata and a version validator that allows null * _versions. N...
TestIngestDocument
java
apache__flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/AsyncScalarFunction.java
{ "start": 3679, "end": 3959 }
class ____ extends AsyncScalarFunction { * public void eval(@DataTypeHint("DECIMAL(10, 4)") CompletableFuture<BigDecimal> future, * Long... values) { * // ... * } * } * }</pre> * * <p>For storing a user-defined function in a catalog, the
SumFunction
java
apache__flink
flink-core-api/src/main/java/org/apache/flink/api/common/typeinfo/TypeDescriptors.java
{ "start": 1126, "end": 6903 }
class ____ implements Serializable { @SuppressWarnings("unchecked") public static <T> TypeDescriptor<T> value(TypeDescriptor<T> typeDescriptor) throws ReflectiveOperationException { return (TypeDescriptor<T>) TypeUtils.getInstance( "org.apache.flink.a...
TypeDescriptors
java
spring-projects__spring-framework
spring-test/src/test/java/org/springframework/test/web/servlet/client/assertj/RestTestClientResponseTests.java
{ "start": 1412, "end": 3777 }
class ____ { private final RestTestClient client = RestTestClient.bindToController(HelloController.class) .configureMessageConverters(HttpMessageConverters.Builder::registerDefaults) .build(); @Test void status() { ResponseSpec spec = client.get().uri("/greeting").exchange(); assertThat(RestTestC...
RestTestClientResponseTests
java
apache__camel
core/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateCompletionSizeExpressionAndTimeoutTest.java
{ "start": 1098, "end": 1934 }
class ____ extends ContextTestSupport { @Test public void testAggregateExpressionSize() throws Exception { MockEndpoint result = getMockEndpoint("mock:result"); result.expectedBodiesReceived("A+B", "C+D", "E"); template.sendBody("direct:start", "A,B,C,D,E"); assertMockEndpoint...
AggregateCompletionSizeExpressionAndTimeoutTest
java
mockito__mockito
mockito-core/src/test/java/org/mockitousage/bugs/creation/MockClassWithMissingStaticDepTest.java
{ "start": 1644, "end": 1880 }
class ____ { static { //noinspection ConstantValue if (true) { throw new NoClassDefFoundError( "Simulate missing transitive dependency used in
ClassWithErrorInClassInit
java
elastic__elasticsearch
x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/FloatVector.java
{ "start": 759, "end": 6067 }
interface ____ extends Vector permits ConstantFloatVector, FloatArrayVector, FloatBigArrayVector, ConstantNullVector { float getFloat(int position); @Override FloatBlock asBlock(); @Override FloatVector filter(int... positions); @Override FloatBlock keepMask(BooleanVector mask); /**...
FloatVector
java
apache__hadoop
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-documentstore/src/test/java/org/apache/hadoop/yarn/server/timelineservice/documentstore/reader/DummyDocumentStoreReader.java
{ "start": 1820, "end": 4651 }
class ____<TimelineDoc extends TimelineDocument> implements DocumentStoreReader<TimelineDoc> { private final TimelineEntityDocument entityDoc; private final List<TimelineEntityDocument> entityDocs; private final FlowRunDocument flowRunDoc; private final FlowActivityDocument flowActivityDoc; public Dummy...
DummyDocumentStoreReader
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/dialect/aggregate/CockroachDBAggregateSupport.java
{ "start": 9836, "end": 11268 }
class ____ implements JsonWriteExpression { private final SelectableMapping selectableMapping; private final String customWriteExpressionStart; private final String customWriteExpressionEnd; BasicJsonWriteExpression(SelectableMapping selectableMapping, String customWriteExpression) { this.selectableMapping...
BasicJsonWriteExpression
java
google__truth
extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesFluentAssertion.java
{ "start": 1936, "end": 23558 }
interface ____<M extends Message> { /** * Specifies that the 'has' bit of individual fields should be ignored when comparing for * equality. * * <p>For version 2 Protocol Buffers, this setting determines whether two protos with the same * value for a field compare equal if one explicitly sets the valu...
MapWithProtoValuesFluentAssertion
java
hibernate__hibernate-orm
hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromIdClassTests.java
{ "start": 9078, "end": 9932 }
class ____ { private Integer id1; private Integer id2; private Name name; private Contact alternativeContact; public Contact() { } public Contact(Integer id, Name name) { this.id1 = id; this.id2 = id; this.name = name; } @Id public Integer getId1() { return id1; } public void se...
Contact
java
apache__kafka
metadata/src/test/java/org/apache/kafka/metadata/bootstrap/BootstrapMetadataTest.java
{ "start": 1529, "end": 5699 }
class ____ { static final List<ApiMessageAndVersion> SAMPLE_RECORDS1 = List.of( new ApiMessageAndVersion(new FeatureLevelRecord(). setName(FEATURE_NAME). setFeatureLevel((short) 8), (short) 0), new ApiMessageAndVersion(new NoOpRecord(), (short) 0), new ApiMessageAndVe...
BootstrapMetadataTest
java
apache__dubbo
dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/h2/Http2ServerChannelObserver.java
{ "start": 1512, "end": 3820 }
class ____ extends AbstractServerHttpChannelObserver<H2StreamChannel> implements FlowControlStreamObserver<Object>, Http2CancelableStreamObserver<Object> { private CancellationContext cancellationContext; private StreamingDecoder streamingDecoder; private boolean autoRequestN = true; public ...
Http2ServerChannelObserver
java
google__guice
core/test/com/googlecode/guice/bundle/OSGiTestActivator.java
{ "start": 6311, "end": 6727 }
class ____ implements C { CD() {} @Inject public void setA(Undefined undefined) {} @Inject protected void setB(Undefined undefined) {} @Inject void setC(Undefined undefined) {} @Inject private void setD(Undefined undefined) {} @Inject public Undefined a; @Inject protec...
CD
java
apache__maven
compat/maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoNotFoundException.java
{ "start": 1052, "end": 2480 }
class ____ extends Exception { private String goal; private PluginDescriptor pluginDescriptor; public MojoNotFoundException(String goal, PluginDescriptor pluginDescriptor) { super(toMessage(goal, pluginDescriptor)); this.goal = goal; this.pluginDescriptor = pluginDescriptor; }...
MojoNotFoundException
java
apache__camel
core/camel-core/src/test/java/org/apache/camel/impl/converter/Country.java
{ "start": 852, "end": 1174 }
class ____ { private String iso; private String name; public String getIso() { return iso; } public void setIso(String iso) { this.iso = iso; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
Country
java
apache__flink
flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/rest/SqlGatewayRestEndpointITCase.java
{ "start": 17510, "end": 17724 }
class ____ implements RequestBody { public final int id; @JsonCreator public TestRequest(@JsonProperty("id") int id) { this.id = id; } } private static
TestRequest
java
apache__camel
core/camel-core-model/src/main/java/org/apache/camel/model/dataformat/RssDataFormat.java
{ "start": 1429, "end": 1850 }
class ____ extends DataFormatDefinition { public RssDataFormat() { super("rss"); } protected RssDataFormat(RssDataFormat source) { super(source); } @Override public RssDataFormat copyDefinition() { return new RssDataFormat(this); } /** * {@code Builder} i...
RssDataFormat
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/StatementSwitchToExpressionSwitchTest.java
{ "start": 26554, "end": 26941 }
class ____ { void foo(int value) { switch (value) { case 0 -> {} default -> {} } } } """) .doTest(); } @Test public void nonEmptyExpressionSwitchCases_noMatch() { helper .ad...
Test
java
apache__flink
flink-runtime/src/test/java/org/apache/flink/streaming/api/TypeFillTest.java
{ "start": 7667, "end": 7740 }
class ____<T> extends AbstractTestSource<T> {} private static
TestSource
java
apache__flink
flink-rpc/flink-rpc-akka/src/test/java/org/apache/flink/runtime/rpc/pekko/TimeoutCallStackTest.java
{ "start": 4755, "end": 5215 }
class ____ extends RpcEndpoint implements TestingGateway { TestingRpcEndpoint(RpcService rpcService, String endpointId) { super(rpcService, endpointId); } @Override public CompletableFuture<Void> callThatTimesOut(@RpcTimeout Duration timeout) { // return a futur...
TestingRpcEndpoint
java
apache__hadoop
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/sps/BlockStorageMovementNeeded.java
{ "start": 1708, "end": 7425 }
class ____ { public static final Logger LOG = LoggerFactory.getLogger(BlockStorageMovementNeeded.class); private final Queue<ItemInfo> storageMovementNeeded = new LinkedList<ItemInfo>(); /** * Map of startPath and number of child's. Number of child's indicate the * number of files pending to ...
BlockStorageMovementNeeded
java
elastic__elasticsearch
x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/core/Streams.java
{ "start": 545, "end": 2443 }
class ____ { /** * Copy the contents of the given InputStream to the given OutputStream. Optionally, closes both streams when done. * * @param in the stream to copy from * @param out the stream to copy to * @param close whether to close both streams after copying * @param buff...
Streams
java
apache__spark
examples/src/main/java/org/apache/spark/examples/ml/JavaPowerIterationClusteringExample.java
{ "start": 1329, "end": 2467 }
class ____ { public static void main(String[] args) { // Create a SparkSession. SparkSession spark = SparkSession .builder() .appName("JavaPowerIterationClustering") .getOrCreate(); // $example on$ List<Row> data = Arrays.asList( RowFactory.create(0L, 1L, 1.0), RowFactor...
JavaPowerIterationClusteringExample
java
netty__netty
codec-compression/src/main/java/io/netty/handler/codec/compression/CompressionOptions.java
{ "start": 935, "end": 981 }
interface ____ { // Empty }
CompressionOptions
java
spring-projects__spring-security
core/src/main/java/org/springframework/security/concurrent/AbstractDelegatingSecurityContextSupport.java
{ "start": 1250, "end": 2625 }
class ____ { private SecurityContextHolderStrategy securityContextHolderStrategy = SecurityContextHolder .getContextHolderStrategy(); private final @Nullable SecurityContext securityContext; /** * Creates a new {@link AbstractDelegatingSecurityContextSupport} that uses the * specified {@link SecurityContext...
AbstractDelegatingSecurityContextSupport
java
apache__rocketmq
client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultMQPushConsumerImpl.java
{ "start": 24708, "end": 75299 }
class ____ ); try { this.pullAPIWrapper.pullKernelImpl( pullRequest.getMessageQueue(), subExpression, subscriptionData.getExpressionType(), subscriptionData.getSubVersion(), pullRequest.getNextOffset(), ...
filter
java
playframework__playframework
documentation/manual/working/javaGuide/main/http/code/javaguide/http/JavaResponse.java
{ "start": 1089, "end": 10521 }
class ____ extends WithApplication { @Test public void textContentType() { // #text-content-type Result textResult = ok("Hello World!"); // #text-content-type assertThat(textResult.contentType()) .hasValueSatisfying(__ -> assertThat(__).contains("text/plain")); } @Test public void j...
JavaResponse
java
elastic__elasticsearch
x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/MvEvaluatorImplementer.java
{ "start": 22331, "end": 23653 }
class ____ { static SingleValueFunction from(TypeElement declarationType, String name, TypeName resultType, TypeName fieldType) { if (name.equals("")) { return null; } ExecutableElement fn = findMethod( declarationType, new Stri...
SingleValueFunction
java
google__dagger
dagger-compiler/main/java/dagger/internal/codegen/validation/ProvidesMethodValidator.java
{ "start": 2345, "end": 2752 }
class ____ extends MethodValidator { Validator(XMethodElement method) { super(method); } /** Adds an error if a {@link dagger.Provides @Provides} method depends on a producer type. */ @Override protected void checkParameter(XVariableElement parameter) { super.checkParameter(parameter); ...
Validator
java
mybatis__mybatis-3
src/test/java/org/apache/ibatis/submitted/foreach/ForEachTest.java
{ "start": 4343, "end": 8057 }
class ____.apache.ibatis.submitted.foreach.User'"); } } @Test void shouldRemoveItemVariableInTheContext() { try (SqlSession sqlSession = sqlSessionFactory.openSession()) { Mapper mapper = sqlSession.getMapper(Mapper.class); int result = mapper.itemVariableConflict(5, Arrays.asList(1, 2), Arra...
org
java
spring-projects__spring-security
itest/context/src/integration-test/java/org/springframework/security/integration/StubUserRepository.java
{ "start": 684, "end": 784 }
class ____ implements UserRepository { @Override public void doSomething() { } }
StubUserRepository
java
apache__flink
flink-tests/src/test/java/org/apache/flink/test/checkpointing/CoStreamCheckpointingITCase.java
{ "start": 10502, "end": 12128 }
class ____ extends RichReduceFunction<PrefixCount> { private static volatile boolean hasFailed = false; private final long numElements; private long failurePos; private long count; OnceFailingReducer(long numElements) { this.numElements = numElements; } ...
OnceFailingReducer
java
apache__camel
core/camel-core/src/test/java/org/apache/camel/processor/XPathWithNamespaceBuilderFilterAndResultTypeTest.java
{ "start": 946, "end": 1681 }
class ____ extends XPathWithNamespaceBuilderFilterTest { @Override protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { // START SNIPPET: example // lets define the namespaces we'll need in our filters ...
XPathWithNamespaceBuilderFilterAndResultTypeTest
java
google__guava
android/guava-tests/test/com/google/common/util/concurrent/JdkFutureAdaptersTest.java
{ "start": 6980, "end": 8135 }
class ____<V> implements Future<V> { final CountDownLatch allowGetToComplete = new CountDownLatch(1); @Override public boolean cancel(boolean mayInterruptIfRunning) { throw new AssertionFailedError(); } @Override public V get() throws InterruptedException { /* * Wait a littl...
RuntimeExceptionThrowingFuture
java
apache__hadoop
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/constraint/algorithm/TestLocalAllocationTagsManager.java
{ "start": 1992, "end": 6317 }
class ____ { private RMContext rmContext; @BeforeEach public void setup() { MockRM rm = new MockRM(); rm.start(); MockNodes.resetHostIds(); List<RMNode> rmNodes = MockNodes.newNodes(2, 4, Resource.newInstance(4096, 4)); for (RMNode rmNode : rmNodes) { rm.getRMContext().getRMNod...
TestLocalAllocationTagsManager
java
spring-projects__spring-security
core/src/test/java/org/springframework/security/authentication/anonymous/AnonymousAuthenticationProviderTests.java
{ "start": 1474, "end": 3294 }
class ____ { @Test public void testDetectsAnInvalidKey() { AnonymousAuthenticationProvider aap = new AnonymousAuthenticationProvider("qwerty"); AnonymousAuthenticationToken token = new AnonymousAuthenticationToken("WRONG_KEY", "Test", AuthorityUtils.createAuthorityList("ROLE_ONE", "ROLE_TWO")); assertThatE...
AnonymousAuthenticationProviderTests
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/BoxedPrimitiveConstructorTest.java
{ "start": 4849, "end": 5156 }
class ____ { { String s = new String((String) null); } } """) .doTest(); } @Test public void autoboxing() { compilationHelper .addSourceLines( "Test.java", """ public abstract
Test
java
dropwizard__dropwizard
dropwizard-hibernate/src/test/java/io/dropwizard/hibernate/LazyLoadingTest.java
{ "start": 6620, "end": 7134 }
class ____ extends AbstractDAO<Dog> { DogDAO(SessionFactory sessionFactory) { super(sessionFactory); } Optional<Dog> findByName(String name) { return Optional.ofNullable(get(name)); } void create(Dog dog) throws HibernateException { currentSe...
DogDAO
java
elastic__elasticsearch
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/datafeed/delayeddatacheck/DelayedDataDetectorFactory.java
{ "start": 941, "end": 4376 }
class ____ { // There are eight 15min buckets in a two hour span, so matching that number as the fallback for very long buckets private static final int DEFAULT_NUMBER_OF_BUCKETS_TO_SPAN = 8; private static final long DEFAULT_CHECK_WINDOW_MS = 7_200_000L; // 2 hours in Milliseconds /** * This wil...
DelayedDataDetectorFactory
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/CharacterGetNumericValueTest.java
{ "start": 3589, "end": 4011 }
class ____ { void f() { // BUG: Diagnostic contains: CharacterGetNumericValue Character.getNumericValue(41); } } """) .doTest(); } @Test public void uCharacter_getNumericValue_char() { helper .addSourceLines( ...
Test
java
google__dagger
javatests/dagger/internal/codegen/ComponentCreatorTest.java
{ "start": 26576, "end": 27020 }
interface ____")); }); } @Test public void testMultipleSettersPerTypeIncludingResolvedGenericsFails() { assume().that(compilerType).isEqualTo(JAVAC); Source moduleFile = CompilerTests.javaSource( "test.TestModule", "package test;", "", "...
Builder
java
apache__flink
flink-datastream-api/src/main/java/org/apache/flink/datastream/api/stream/NonKeyedPartitionStream.java
{ "start": 4502, "end": 4680 }
interface ____ a combination of two {@link NonKeyedPartitionStream}. It will be * used as the return value of operation with two output. */ @Experimental
represents
java
apache__camel
core/camel-core/src/test/java/org/apache/camel/util/DumpModelAsXmlChoiceFilterRoutePropertyPlaceholderTest.java
{ "start": 1177, "end": 3447 }
class ____ extends ContextTestSupport { @Test public void testDumpModelAsXml() throws Exception { String xml = PluginHelper.getModelToXMLDumper(context).dumpModelAsXml(context, context.getRouteDefinition("myRoute")); assertNotNull(xml); log.info(xml); assertTrue(xml.contains("<...
DumpModelAsXmlChoiceFilterRoutePropertyPlaceholderTest
java
google__dagger
hilt-android/main/java/dagger/hilt/android/internal/legacy/AggregatedElementProxy.java
{ "start": 1033, "end": 1160 }
interface ____ { /** A reference to the legacy package-private aggregating class. */ Class<?> value(); }
AggregatedElementProxy
java
spring-projects__spring-boot
module/spring-boot-cassandra/src/main/java/org/springframework/boot/cassandra/health/CassandraDriverReactiveHealthIndicator.java
{ "start": 1464, "end": 2411 }
class ____ extends AbstractReactiveHealthIndicator { private final CqlSession session; /** * Create a new {@link CassandraDriverReactiveHealthIndicator} instance. * @param session the {@link CqlSession}. */ public CassandraDriverReactiveHealthIndicator(CqlSession session) { super("Cassandra health check fa...
CassandraDriverReactiveHealthIndicator