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__hadoop
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapred/join/TestDatamerge.java
{ "start": 5495, "end": 6253 }
class ____ extends SimpleCheckerBase<TupleWritable> { public void map(IntWritable key, TupleWritable val, OutputCollector<IntWritable, IntWritable> out, Reporter reporter) throws IOException { int k = key.get(); final String kvstr = "Unexpected tuple: " + stringify(key, val); ...
InnerJoinChecker
java
square__retrofit
retrofit/java-test/src/test/java/retrofit2/RetrofitTest.java
{ "start": 39990, "end": 41172 }
class ____.lang.String.\n" + " Tried:\n" + " * retrofit2.BuiltInConverters\n" + " * retrofit2.helpers.NonMatchingConverterFactory\n" + " * retrofit2.OptionalConverterFactory"); } assertThat(nonMatchingFactory.called).isTrue(); } ...
java
java
apache__camel
components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyStreamCacheIssueTest.java
{ "start": 1104, "end": 2644 }
class ____ extends BaseJettyTest { private String input; @Override protected CamelContext createCamelContext() throws Exception { CamelContext context = super.createCamelContext(); // ensure we overflow and spool to disk context.getStreamCachingStrategy().setSpoolEnabled(true); ...
JettyStreamCacheIssueTest
java
hibernate__hibernate-orm
hibernate-core/src/test/java/org/hibernate/orm/test/jpa/emops/MergeMultipleEntityCopiesAllowedTest.java
{ "start": 1074, "end": 4255 }
class ____ { @AfterEach void cleanup(EntityManagerFactoryScope scope) { scope.getEntityManagerFactory().getSchemaManager().truncate(); } @Test public void testCascadeFromDetachedToNonDirtyRepresentations(EntityManagerFactoryScope scope) { Item item1 = new Item(); item1.setName( "item1" ); Hoarder hoarde...
MergeMultipleEntityCopiesAllowedTest
java
elastic__elasticsearch
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/OpenIndexStep.java
{ "start": 770, "end": 1919 }
class ____ extends AsyncActionStep { static final String NAME = "open-index"; OpenIndexStep(StepKey key, StepKey nextStepKey, Client client) { super(key, nextStepKey, client); } @Override public void performAction( IndexMetadata indexMetadata, ProjectState currentState, ...
OpenIndexStep
java
apache__camel
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/DebeziumMySqlEndpointBuilderFactory.java
{ "start": 121063, "end": 124593 }
class ____ should be used to * determine the topic name for data change, schema change, transaction, * heartbeat event etc. * * The option is a: <code>java.lang.String</code> type. * * Default: io.debezium.schema.SchemaTopicNamingStrategy * Group: mysql ...
that
java
netty__netty
transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueEventLoopGroup.java
{ "start": 1993, "end": 9551 }
class ____ loaded by this time! KQueue.ensureAvailability(); } private static final InternalLogger LOGGER = InternalLoggerFactory.getInstance(KQueueEventLoopGroup.class); /** * Create a new instance using the default number of threads and the default {@link ThreadFactory}. */ public ...
is
java
apache__camel
components/camel-opensearch/src/generated/java/org/apache/camel/component/opensearch/OpensearchComponentConfigurer.java
{ "start": 737, "end": 5736 }
class ____ extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { @Override public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { OpensearchComponent target = (OpensearchComponent) obj; swit...
OpensearchComponentConfigurer
java
apache__flink
flink-metrics/flink-metrics-otel/src/main/java/org/apache/flink/metrics/otel/OpenTelemetryReporterBase.java
{ "start": 1375, "end": 3156 }
class ____ { private static final Logger LOG = LoggerFactory.getLogger(OpenTelemetryReporterBase.class); protected Resource resource; protected MetricExporter exporter; protected OpenTelemetryReporterBase() { resource = Resource.getDefault(); } protected void open(MetricConfig metricC...
OpenTelemetryReporterBase
java
apache__kafka
clients/src/test/java/org/apache/kafka/clients/MockClient.java
{ "start": 24925, "end": 25865 }
class ____ { final MetadataResponse updateResponse; final boolean expectMatchRefreshTopics; MetadataUpdate(MetadataResponse updateResponse, boolean expectMatchRefreshTopics) { this.updateResponse = updateResponse; this.expectMatchRefreshTopics = expectMatchRefreshTopics;...
MetadataUpdate
java
hibernate__hibernate-orm
hibernate-core/src/test/java/org/hibernate/orm/test/onetoone/bidirectional/BidirectionalOneToOneCascadeRemoveTest.java
{ "start": 1797, "end": 2175 }
class ____ { @Id protected String id; @Column( name = "name_col" ) protected String name; @Column( name = "value_col" ) protected int value; @OneToOne( mappedBy = "a1" ) protected B b1; public A() { } public A(String id, String name, int value) { this.id = id; this.name = name; this...
A
java
dropwizard__dropwizard
dropwizard-jersey/src/main/java/io/dropwizard/jersey/validation/NonEmptyStringParamValueExtractor.java
{ "start": 677, "end": 1210 }
class ____ implements ValueExtractor<@ExtractedValue(type = String.class) NonEmptyStringParam> { static final ValueExtractorDescriptor DESCRIPTOR = new ValueExtractorDescriptor(new NonEmptyStringParamValueExtractor()); private NonEmptyStringParamValueExtractor() { } @Override public void extractVa...
NonEmptyStringParamValueExtractor
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/dialect/DB2iDialect.java
{ "start": 1697, "end": 6825 }
class ____ extends DB2Dialect { private final static DatabaseVersion MINIMUM_VERSION = DatabaseVersion.make( 7, 2 ); public final static DatabaseVersion DB2_LUW_VERSION = DB2Dialect.MINIMUM_VERSION; private static final String FOR_UPDATE_SQL = " for update with rs"; private static final String FOR_UPDATE_SKIP_LOC...
DB2iDialect
java
apache__flink
flink-core/src/test/java/org/apache/flink/api/common/typeutils/base/BasicTypeSerializerUpgradeTestSpecifications.java
{ "start": 25188, "end": 25635 }
class ____ implements TypeSerializerUpgradeTestBase.PreUpgradeSetup<LongValue> { @Override public TypeSerializer<LongValue> createPriorSerializer() { return LongValueSerializer.INSTANCE; } @Override public LongValue createTestData() { return n...
LongValueSerializerSetup
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/boot/internal/Extends.java
{ "start": 489, "end": 618 }
interface ____ { /** * The type extended. String because dynamic models have named "classes". */ String superType(); }
Extends
java
quarkusio__quarkus
extensions/spring-security/deployment/src/main/java/io/quarkus/spring/security/deployment/BeanMethodInvocationGenerator.java
{ "start": 1674, "end": 2829 }
class ____ { private static final String METHOD_PARAMETER_REGEX = "#(\\w+)"; private static final Pattern METHOD_PARAMETER_PATTERN = Pattern.compile(METHOD_PARAMETER_REGEX); private final IndexView index; private final Map<String, DotName> springBeansNameToDotName; private final Map<String, ClassI...
BeanMethodInvocationGenerator
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/LogicalAssignmentTest.java
{ "start": 998, "end": 1229 }
class ____ { @Test public void positive() { BugCheckerRefactoringTestHelper.newInstance(LogicalAssignment.class, getClass()) .addInputLines( "in/Test.java", """
LogicalAssignmentTest
java
elastic__elasticsearch
build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/InternalYamlRestTestPlugin.java
{ "start": 1145, "end": 3262 }
class ____ implements Plugin<Project> { public static final String SOURCE_SET_NAME = "yamlRestTest"; @Override public void apply(Project project) { project.getPluginManager().apply(RestTestBasePlugin.class); project.getPluginManager().apply(RestResourcesPlugin.class); // create so...
InternalYamlRestTestPlugin
java
google__dagger
hilt-compiler/main/java/dagger/hilt/processor/internal/Processors.java
{ "start": 11420, "end": 12999 }
class ____. */ public static ClassName prepend(ClassName name, String prefix) { return name.peerClass(prefix + name.simpleName()); } /** * Removes the string {@code suffix} from the simple name of {@code type} and returns it. * * @throws BadInputException if the simple name of {@code type} does not ...
name
java
spring-projects__spring-security
access/src/test/java/org/springframework/security/messaging/access/intercept/ChannelSecurityInterceptorTests.java
{ "start": 2084, "end": 6029 }
class ____ { @Mock Message<Object> message; @Mock MessageChannel channel; @Mock MessageSecurityMetadataSource source; @Mock AccessDecisionManager accessDecisionManager; @Mock RunAsManager runAsManager; @Mock Authentication runAs; Authentication originalAuth; List<ConfigAttribute> attrs; ChannelS...
ChannelSecurityInterceptorTests
java
elastic__elasticsearch
x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/AbstractCrossClusterTestCase.java
{ "start": 3988, "end": 4401 }
class ____ extends Plugin { @Override public List<Setting<?>> getSettings() { return List.of( Setting.timeSetting( ExchangeService.INACTIVE_SINKS_INTERVAL_SETTING, TimeValue.timeValueSeconds(30), Setting.Property.Nod...
InternalExchangePlugin
java
apache__maven
impl/maven-core/src/main/java/org/apache/maven/plugin/LegacySupport.java
{ "start": 1283, "end": 2158 }
interface ____ { /** * Sets the currently active session. Some legacy components are basically stateful and their API is missing * parameters that would be required to delegate to a stateless component. Saving the session (in a thread-local * variable) is our best effort to record any state that is ...
LegacySupport
java
square__moshi
moshi/src/test/java/com/squareup/moshi/internal/ClassJsonAdapterTest.java
{ "start": 12342, "end": 12810 }
class ____ {} @Test public void abstractClassNotSupported() throws Exception { try { ClassJsonAdapter.Factory.create(Abstract.class, NO_ANNOTATIONS, moshi); fail(); } catch (IllegalArgumentException expected) { assertThat(expected) .hasMessageThat() .isEqualTo( ...
Abstract
java
grpc__grpc-java
core/src/main/java/io/grpc/internal/Framer.java
{ "start": 735, "end": 1452 }
interface ____ { /** * Writes out a payload message. * * @param message contains the message to be written out. It will be completely consumed. */ void writePayload(InputStream message); /** Flush the buffered payload. */ void flush(); /** Returns whether the framer is closed. */ boolean isClo...
Framer
java
elastic__elasticsearch
modules/lang-painless/src/main/java/org/elasticsearch/painless/ir/TypedInterfaceReferenceNode.java
{ "start": 616, "end": 1152 }
class ____ extends ExpressionNode { /* ---- begin visitor ---- */ @Override public <Scope> void visit(IRTreeVisitor<Scope> irTreeVisitor, Scope scope) { irTreeVisitor.visitTypedInterfaceReference(this, scope); } @Override public <Scope> void visitChildren(IRTreeVisitor<Scope> irTreeVi...
TypedInterfaceReferenceNode
java
apache__camel
core/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionHandleAndThrowNewExceptionTest.java
{ "start": 1259, "end": 2607 }
class ____ extends ContextTestSupport { @Test public void testOnExceptionHandleAndThrowNewException() { try { template.sendBody("direct:start", "Hello World"); fail("Should have thrown exception"); } catch (CamelExecutionException e) { IOException cause = ass...
OnExceptionHandleAndThrowNewExceptionTest
java
ReactiveX__RxJava
src/main/java/io/reactivex/rxjava3/internal/operators/observable/ObservableWindowBoundary.java
{ "start": 7757, "end": 8619 }
class ____<T, B> extends DisposableObserver<B> { final WindowBoundaryMainObserver<T, B> parent; boolean done; WindowBoundaryInnerObserver(WindowBoundaryMainObserver<T, B> parent) { this.parent = parent; } @Override public void onNext(B t) { if ...
WindowBoundaryInnerObserver
java
apache__dubbo
dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/matcher/argument/ArgumentConditionMatcher.java
{ "start": 1699, "end": 3207 }
class ____ extends AbstractConditionMatcher { private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(ArgumentConditionMatcher.class); private static final Pattern ARGUMENTS_PATTERN = Pattern.compile("arguments\\[([0-9]+)\\]"); public ArgumentConditionMatcher(St...
ArgumentConditionMatcher
java
apache__camel
components/camel-wordpress/src/main/java/org/apache/camel/component/wordpress/api/service/WordpressServicePostRevision.java
{ "start": 1025, "end": 1292 }
interface ____ extends WordpressService { void delete(Integer postId, Integer revisionId); PostRevision retrieve(Integer postId, Integer revisionId, Context context); List<PostRevision> list(Integer postId, Context context); }
WordpressServicePostRevision
java
spring-projects__spring-boot
loader/spring-boot-loader/src/test/java/org/springframework/boot/loader/net/protocol/jar/JarUrlClassLoaderTests.java
{ "start": 3321, "end": 4352 }
class ____.Application"); } } @Test void loadClassFromNested() throws Exception { File appJar = new File("src/test/resources/jars/app.jar"); File jarFile = new File(this.tempDir, "test.jar"); FileOutputStream fileOutputStream = new FileOutputStream(jarFile); try (JarOutputStream jarOutputStream = new JarO...
demo
java
spring-projects__spring-security
config/src/test/java/org/springframework/security/config/annotation/web/configurers/NamespaceHttpCustomFilterTests.java
{ "start": 5193, "end": 5651 }
class ____ { @Bean SecurityFilterChain filterChain(HttpSecurity http) throws Exception { // @formatter:off TestHttpSecurities.disableDefaults(http); http // this works so long as the CustomFilter extends one of the standard filters // if not, use addFilterBefore or addFilterAfter .addFilter(ne...
CustomFilterPositionConfig
java
redisson__redisson
redisson-hibernate/redisson-hibernate-5/src/main/java/org/redisson/hibernate/strategy/ReadWriteNaturalIdRegionAccessStrategy.java
{ "start": 1260, "end": 2829 }
class ____ extends AbstractReadWriteAccessStrategy implements NaturalIdRegionAccessStrategy { public ReadWriteNaturalIdRegionAccessStrategy(Settings settings, GeneralDataRegion region, RMapCache<Object, Object> mapCache) { super(settings, region, mapCache); } @Override public Natur...
ReadWriteNaturalIdRegionAccessStrategy
java
lettuce-io__lettuce-core
src/main/java/io/lettuce/core/protocol/HasQueuedCommands.java
{ "start": 279, "end": 365 }
interface ____ { Collection<RedisCommand<?, ?, ?>> drainQueue(); }
HasQueuedCommands
java
apache__camel
components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/processor/SpringRecipientListWithStringDelimitedPropertyTest.java
{ "start": 1065, "end": 1411 }
class ____ extends RecipientListWithStringDelimitedPropertyTest { @Override protected CamelContext createCamelContext() throws Exception { return createSpringCamelContext(this, "org/apache/camel/spring/processor/recipientListWithStringDelimitedProperty.xml"); } }
SpringRecipientListWithStringDelimitedPropertyTest
java
apache__camel
components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
{ "start": 1592, "end": 8128 }
class ____ extends DefaultAsyncProducer { private static final Logger LOG = LoggerFactory.getLogger(StreamProducer.class); private static final String TYPES = "out,err,file,header"; private static final String INVALID_URI = "Invalid uri, valid form: 'stream:{" + TYPES + "}'"; private static final List...
StreamProducer
java
assertj__assertj-core
assertj-core/src/test/java/org/assertj/core/error/ShouldHaveSameClass_create_Test.java
{ "start": 1530, "end": 1579 }
class ____: java.lang.String".formatted()); } }
was
java
elastic__elasticsearch
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorsIntersectionTests.java
{ "start": 1448, "end": 4911 }
class ____ extends ESTestCase { public void testSerialization() throws IOException { final RoleDescriptorsIntersection roleDescriptorsIntersection = new RoleDescriptorsIntersection( randomList(0, 3, () -> Set.copyOf(randomUniquelyNamedRoleDescriptors(0, 3))) ); final NamedWrite...
RoleDescriptorsIntersectionTests
java
apache__flink
flink-libraries/flink-state-processing-api/src/test/java/org/apache/flink/state/api/SavepointWriterWindowITCase.java
{ "start": 16710, "end": 17673 }
class ____ implements AggregateFunction< Tuple2<String, Integer>, Tuple2<String, Integer>, Tuple2<String, Integer>> { @Override public Tuple2<String, Integer> createAccumulator() { return null; } @Override public Tuple2<String, Intege...
Aggregator
java
apache__hadoop
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/filter/TimelineKeyValueFilter.java
{ "start": 1029, "end": 1182 }
class ____ represents filter to be applied based on key-value pair * being equal or not to the values in back-end store. */ @Private @Unstable public
which
java
apache__flink
flink-tests/src/test/java/org/apache/flink/test/checkpointing/UnalignedCheckpointFailureHandlingITCase.java
{ "start": 9337, "end": 10527 }
class ____ implements CheckpointStorage { private final CheckpointStorage delegate; private final SharedReference<AtomicBoolean> failOnCloseRef; private final SharedReference<TemporaryFolder> tempFolderRef; private TestCheckpointStorage( CheckpointStorage delegate, ...
TestCheckpointStorage
java
apache__dubbo
dubbo-plugin/dubbo-spring6-security/src/main/java/org/apache/dubbo/spring/security/oauth2/jackson/OAuth2ObjectMapperCodecCustomer.java
{ "start": 1220, "end": 1700 }
class ____ implements ObjectMapperCodecCustomer { @Override public void customize(ObjectMapperCodec objectMapperCodec) { objectMapperCodec.configureMapper(mapper -> { mapper.registerModule(new OAuth2SecurityModule()); List<Module> securityModules = SecurityJa...
OAuth2ObjectMapperCodecCustomer
java
apache__hadoop
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/store/TestDataBlocks.java
{ "start": 1600, "end": 5302 }
class ____ { private final Configuration configuration = new Configuration(); private static final int ONE_KB = 1024; private static final Logger LOG = LoggerFactory.getLogger(TestDataBlocks.class); /** * Test to verify different DataBlocks factories, different operations. */ @Test public void ...
TestDataBlocks
java
elastic__elasticsearch
server/src/test/java/org/elasticsearch/index/mapper/AbstractShapeGeometryFieldMapperTests.java
{ "start": 8174, "end": 9019 }
class ____ new Rectangle( encoder.decodeX(ints[0]), encoder.decodeX(ints[1]), encoder.decodeY(ints[2]), encoder.decodeY(ints[3]) ); } else { throw new IllegalArgumentException("Exp...
return
java
elastic__elasticsearch
server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScorePluginIT.java
{ "start": 4694, "end": 5917 }
class ____ extends DecayFunctionBuilder<CustomDistanceScoreBuilder> { public static final String NAME = "linear_mult"; public static final ScoreFunctionParser<CustomDistanceScoreBuilder> PARSER = new DecayFunctionParser<>( CustomDistanceScoreBuilder::new ); public CustomDist...
CustomDistanceScoreBuilder
java
apache__camel
dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/MybatisBeanComponentBuilderFactory.java
{ "start": 1421, "end": 1952 }
interface ____ { /** * MyBatis Bean (camel-mybatis) * Perform queries, inserts, updates or deletes in a relational database * using MyBatis. * * Category: database * Since: 2.22 * Maven coordinates: org.apache.camel:camel-mybatis * * @return the dsl builder */ ...
MybatisBeanComponentBuilderFactory
java
google__gson
gson/src/test/java/com/google/gson/FieldNamingPolicyTest.java
{ "start": 3483, "end": 4587 }
class ____ { @SuppressWarnings({"unused", "ConstantField"}) int I; } FieldNamingPolicy[] policies = { FieldNamingPolicy.LOWER_CASE_WITH_DASHES, FieldNamingPolicy.LOWER_CASE_WITH_DOTS, FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES, }; Field field = Dummy.class.getDeclaredF...
Dummy
java
apache__camel
core/camel-api/src/main/java/org/apache/camel/spi/CompilePostProcessor.java
{ "start": 1256, "end": 1873 }
class ____ been compiled * * @param camelContext the camel context * @param name the name of the resource/class * @param clazz the class * @param byteCode byte code that was compiled from the source as the class (only supported on some DSLs) * @param instance th...
has
java
elastic__elasticsearch
x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/pytorch/results/PyTorchResultTests.java
{ "start": 460, "end": 1631 }
class ____ extends AbstractXContentTestCase<PyTorchResult> { @Override protected PyTorchResult createTestInstance() { String requestId = randomAlphaOfLength(5); int type = randomIntBetween(0, 3); return switch (type) { case 0 -> new PyTorchResult( requestId, ...
PyTorchResultTests
java
grpc__grpc-java
core/src/main/java/io/grpc/internal/ForwardingNameResolver.java
{ "start": 786, "end": 869 }
class ____ ensure non overridden methods are forwarded to the delegate. */ abstract
to
java
apache__commons-lang
src/main/java/org/apache/commons/lang3/SystemUtils.java
{ "start": 45159, "end": 45679 }
class ____ loaded. * </p> * * @since 3.15.0 */ public static final boolean IS_JAVA_22 = getJavaVersionMatches("22"); /** * The constant {@code true} if this is Java version 23 (also 23.x versions). * <p> * The result depends on the value of the {@link #JAVA_SPECIFICATION_VERS...
is
java
apache__flink
flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/ClientHandlerCallback.java
{ "start": 1032, "end": 1810 }
interface ____<RESP extends MessageBody> { /** * Called on a successful request. * * @param requestId ID of the request * @param response The received response */ void onRequestResult(long requestId, RESP response); /** * Called on a failed request. * * @param reque...
ClientHandlerCallback
java
google__auto
value/src/it/functional/src/test/java/com/google/auto/value/AutoValueTest.java
{ "start": 8733, "end": 9429 }
class ____ { abstract Builder setNumberClass(Class<? extends Number> x); abstract ClassPropertyWithBuilder build(); } } @Test public void testClassPropertyWithBuilder() { ClassPropertyWithBuilder instance = ClassPropertyWithBuilder.builder().setNumberClass(Integer.class).build(); ...
Builder
java
google__auto
factory/src/test/resources/expected/SimpleClassNullableParametersFactory.java
{ "start": 905, "end": 2111 }
class ____ { private final Provider<String> providedNullableProvider; private final Provider<String> providedQualifiedNullableProvider; @Inject SimpleClassNullableParametersFactory( Provider<String> providedNullableProvider, @BQualifier Provider<String> providedQualifiedNullableProvider) { thi...
SimpleClassNullableParametersFactory
java
quarkusio__quarkus
independent-projects/qute/core/src/test/java/io/quarkus/qute/ParserTest.java
{ "start": 27262, "end": 27957 }
class ____ implements ErrorInitializer, WithOrigin { @Override public Origin getOrigin() { return null; } @Override public Builder error(String message) { return TemplateException.builder().message(message); } ...
Dummy
java
google__error-prone
core/src/main/java/com/google/errorprone/bugpatterns/PreferInstanceofOverGetKind.java
{ "start": 2470, "end": 2818 }
class ____ extends BugChecker implements BinaryTreeMatcher, MethodInvocationTreeMatcher { private static final Matcher<ExpressionTree> GET_KIND = Matchers.instanceMethod().onDescendantOf(Tree.class.getName()).named("getKind"); /** * A map from {@link Kind} to the {@link Class} of tree it denotes, iff ...
PreferInstanceofOverGetKind
java
assertj__assertj-core
assertj-core/src/test/java/org/assertj/core/api/abstract_/AbstractAssert_as_with_description_text_supplier_Test.java
{ "start": 1074, "end": 2985 }
class ____ { @Test void descriptionText_should_evaluate_lazy_description() { // GIVEN ConcreteAssert assertions = new ConcreteAssert("foo"); // WHEN assertions.as(() -> "description"); // THEN then(assertions.descriptionText()).isEqualTo("description"); } @Test void should_not_evalua...
AbstractAssert_as_with_description_text_supplier_Test
java
apache__hadoop
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/package-info.java
{ "start": 1499, "end": 2565 }
interface ____ the even simpler and more concise and declarative metrics annotations. The consumers of metrics just need to implement the simple {@link org.apache.hadoop.metrics2.MetricsSink} interface. Producers register the metrics sources with a metrics system, while consumers register the sinks....
or
java
resilience4j__resilience4j
resilience4j-rxjava2/src/main/java/io/github/resilience4j/AbstractObserver.java
{ "start": 180, "end": 1283 }
class ____<T> extends AbstractDisposable implements Observer<T> { protected final AtomicBoolean eventWasEmitted = new AtomicBoolean(false); private final Observer<? super T> downstreamObserver; public AbstractObserver(Observer<? super T> downstreamObserver) { this.downstreamObserver = requireNonNu...
AbstractObserver
java
apache__camel
components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbServerTestSupport.java
{ "start": 1442, "end": 1503 }
class ____ unit testing using a SMBServer */ public abstract
for
java
spring-projects__spring-security
core/src/main/java/org/springframework/security/authentication/event/AuthenticationSuccessEvent.java
{ "start": 871, "end": 1120 }
class ____ extends AbstractAuthenticationEvent { @Serial private static final long serialVersionUID = 2537206344128673963L; public AuthenticationSuccessEvent(Authentication authentication) { super(authentication); } }
AuthenticationSuccessEvent
java
apache__hadoop
hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/dancing/DancingLinks.java
{ "start": 1512, "end": 1821 }
class ____<ColumnName> { private static final Logger LOG = LoggerFactory.getLogger(DancingLinks.class); /** * A cell in the table with up/down and left/right links that form doubly * linked lists in both directions. It also includes a link to the column * head. */ private static
DancingLinks
java
elastic__elasticsearch
server/src/test/java/org/elasticsearch/action/admin/cluster/hotthreads/NodesHotThreadsResponseTests.java
{ "start": 1103, "end": 2206 }
class ____ extends ESTestCase { public void testGetTextChunks() { final var node0 = DiscoveryNodeUtils.create("node-0"); final var node1 = DiscoveryNodeUtils.create("node-1"); final var response = new NodesHotThreadsResponse( ClusterName.DEFAULT, List.of( ...
NodesHotThreadsResponseTests
java
alibaba__druid
core/src/main/java/com/alibaba/druid/wall/WallSqlTableStat.java
{ "start": 656, "end": 3646 }
class ____ { private int selectCount; private int selectIntoCount; private int insertCount; private int updateCount; private int deleteCount; private int truncateCount; private int createCount; private int alterCount; private int dropCount; private int replaceCount; private i...
WallSqlTableStat
java
apache__dubbo
dubbo-rpc/dubbo-rpc-triple/src/test/java/org/apache/dubbo/rpc/protocol/tri/support/IGreeter2Impl.java
{ "start": 861, "end": 1201 }
class ____ implements IGreeter2 { @Override public String echo(String request) throws IGreeterException { throw new IGreeterException("I am self define exception"); } @Override public Exception echoException(String request) { return new IGreeterException("I am self define exception"...
IGreeter2Impl
java
spring-projects__spring-boot
module/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/autoconfigure/TomcatVirtualThreadsWebServerFactoryCustomizerTests.java
{ "start": 1222, "end": 2102 }
class ____ { private final TomcatVirtualThreadsWebServerFactoryCustomizer customizer = new TomcatVirtualThreadsWebServerFactoryCustomizer(); @Test @EnabledForJreRange(min = JRE.JAVA_21) void shouldSetVirtualThreadExecutor() { withWebServer((webServer) -> assertThat(webServer.getTomcat().getConnector().getProtoc...
TomcatVirtualThreadsWebServerFactoryCustomizerTests
java
grpc__grpc-java
interop-testing/src/test/java/io/grpc/testing/integration/CascadingTest.java
{ "start": 2354, "end": 7119 }
class ____ { @Rule public final MockitoRule mocks = MockitoJUnit.rule(); @Mock TestServiceGrpc.TestServiceImplBase service; private ManagedChannel channel; private Server server; private CountDownLatch observedCancellations; private CountDownLatch receivedCancellations; private TestServiceGrpc.TestServ...
CascadingTest
java
assertj__assertj-core
assertj-core/src/main/java/org/assertj/core/error/ShouldBeInstance.java
{ "start": 842, "end": 2662 }
class ____ extends BasicErrorMessageFactory { /** * Creates a new <code>{@link ShouldBeInstance}</code>. * * @param object the object value in the failed assertion. * @param type the type {@code object} is \nExpecting:\n to belong to. * @return the created {@code ErrorMessageFactory}. */ public s...
ShouldBeInstance
java
apache__camel
components/camel-telemetry/src/test/java/org/apache/camel/telemetry/SpanTestSupport.java
{ "start": 928, "end": 1517 }
class ____ { protected static MockSpanAdapter getSpan(List<Span> trace, String uri, Op op) { for (Span span : trace) { MockSpanAdapter mockSpanAdapter = (MockSpanAdapter) span; if (mockSpanAdapter.getTag("camel.uri") != null && mockSpanAdapter.getTag("camel.uri").equals(uri)) { ...
SpanTestSupport
java
apache__dubbo
dubbo-plugin/dubbo-qos-api/src/main/java/org/apache/dubbo/qos/api/BaseCommand.java
{ "start": 987, "end": 1142 }
interface ____ { default boolean logResult() { return true; } String execute(CommandContext commandContext, String[] args); }
BaseCommand
java
reactor__reactor-core
reactor-core/src/jcstress/java/reactor/core/publisher/FluxSwitchMapStressTest.java
{ "start": 8340, "end": 9858 }
class ____ extends FluxSwitchMapStressTest { final TestPublisher<Object> testPublisher = TestPublisher.createColdNonCompliant(false, TestPublisher.Violation.CLEANUP_ON_TERMINATE, TestPublisher.Violation.DEFER_CANCELLATION); { switchMapMain.onSubscribe(stressSubscription); } @Override Publisher<Objec...
RequestAndProduceStressTest2
java
spring-projects__spring-boot
module/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/audit/AuditAutoConfigurationTests.java
{ "start": 5181, "end": 5373 }
class ____ { @Bean TestAuthorizationAuditListener authorizationAuditListener() { return new TestAuthorizationAuditListener(); } } static
CustomAuthorizationAuditListenerConfiguration
java
micronaut-projects__micronaut-core
core/src/main/java/io/micronaut/core/cli/CommandLine.java
{ "start": 813, "end": 2902 }
interface ____ { /** * @return The remaining arguments after the command name */ List<String> getRemainingArgs(); /** * @return The system properties specified */ Properties getSystemProperties(); /** * @return The declared option values */ Map<Option, Object> ge...
CommandLine
java
apache__commons-lang
src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
{ "start": 22441, "end": 22528 }
interface ____ found: " + midType); } // check if this
type
java
alibaba__nacos
client/src/test/java/com/alibaba/nacos/client/naming/NacosNamingMaintainServiceTest.java
{ "start": 1835, "end": 12087 }
class ____ { private NacosNamingMaintainService nacosNamingMaintainService; private NamingHttpClientProxy serverProxy; private NamingServerListManager serverListManager; private SecurityProxy securityProxy; private ScheduledExecutorService executorService; @BeforeEa...
NacosNamingMaintainServiceTest
java
apache__camel
core/camel-core/src/test/java/org/apache/camel/processor/OnCompletionAsyncTest.java
{ "start": 1259, "end": 6965 }
class ____ extends ContextTestSupport { @Override public boolean isUseRouteBuilder() { return false; } @Test public void testAsyncComplete() throws Exception { context.addRoutes(new RouteBuilder() { @Override public void configure() { onCompl...
OnCompletionAsyncTest
java
apache__flink
flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/DefaultTimerService.java
{ "start": 1464, "end": 4566 }
class ____<K> implements TimerService<K> { /** Executor service for the scheduled timeouts. */ private final ScheduledExecutorService scheduledExecutorService; /** Timeout for the shutdown of the service. */ private final long shutdownTimeout; /** Map of currently active timeouts. */ private ...
DefaultTimerService
java
elastic__elasticsearch
server/src/main/java/org/elasticsearch/index/analysis/PreBuiltAnalyzerProviderFactory.java
{ "start": 3516, "end": 4926 }
class ____ implements PreBuiltCacheFactory.PreBuiltCache<AnalyzerProvider<?>> { private final String name; private final PreBuiltAnalyzers preBuiltAnalyzer; private PreBuiltAnalyzersDelegateCache(String name, PreBuiltAnalyzers preBuiltAnalyzer) { this.name = name; this....
PreBuiltAnalyzersDelegateCache
java
spring-projects__spring-security
web/src/main/java/org/springframework/security/web/method/annotation/CurrentSecurityContextArgumentResolver.java
{ "start": 2404, "end": 2731 }
class ____ { * &#64;RequestMapping("/im") * public void security(@CurrentSecurityContext SecurityContext context) { * // do something with context * } * } * </pre> * * it can also support the spring SPEL expression to get the value from SecurityContext * <pre> * &#64;Controller * public
MyController
java
hibernate__hibernate-orm
tooling/metamodel-generator/src/test/java/org/hibernate/processor/test/typeliteral/TypeLiteralTest.java
{ "start": 775, "end": 1643 }
class ____ { @Test @WithClasses(value = {}, sources = { "org.hibernate.processor.test.typeliteral.Account", "org.hibernate.processor.test.typeliteral.CreditAccount", "org.hibernate.processor.test.typeliteral.DebitAccount" }) @TestForIssue(jiraKey = "HHH-18358") void inheritance() { final var...
TypeLiteralTest
java
elastic__elasticsearch
x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/process/normalizer/NormalizerProcessFactory.java
{ "start": 453, "end": 864 }
interface ____ { /** * Create an implementation of {@link NormalizerProcess} * * @param executorService Executor service used to start the async tasks a job needs to operate the analytical process * @return The process */ NormalizerProcess createNormalizerProcess(String jobId, String q...
NormalizerProcessFactory
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/UndefinedEqualsTest.java
{ "start": 13518, "end": 13904 }
class ____ { void f(Iterable a, Iterable b) { assertThat(a).containsExactlyElementsIn(b); } } """) .doTest(); } @Test public void positiveSparseArray() { compilationHelper .addSourceLines( "SparseArray.java", ...
Test
java
apache__flink
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/ModelChange.java
{ "start": 2150, "end": 3441 }
class ____ implements ModelChange { private final String key; private final String value; public SetOption(String key, String value) { this.key = key; this.value = value; } public String getKey() { return key; } public String...
SetOption
java
quarkusio__quarkus
extensions/tls-registry/deployment/src/test/java/io/quarkus/tls/ProvidedKeyStoreWithJavaNetSslNameTest.java
{ "start": 1012, "end": 1781 }
class ____ { private static final String configuration = """ # no configuration by default """; @RegisterExtension static final QuarkusUnitTest config = new QuarkusUnitTest().setArchiveProducer( () -> ShrinkWrap.create(JavaArchive.class) .add(new Str...
ProvidedKeyStoreWithJavaNetSslNameTest
java
elastic__elasticsearch
libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/DynamicInstrumentation.java
{ "start": 5463, "end": 14869 }
class ____ the time to get detailed diagnostic transformer.enableClassVerification(); for (var classToRetransform : classesToRetransform) { inst.retransformClasses(classToRetransform); } // We should have failed already in the loop above, but just in cas...
at
java
apache__flink
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/SlotSharingExecutionSlotAllocator.java
{ "start": 18063, "end": 18766 }
class ____ { private final ExecutionVertexID executionVertexId; private final CompletableFuture<LogicalSlot> logicalSlotFuture; SlotExecutionVertexAssignment( ExecutionVertexID executionVertexId, CompletableFuture<LogicalSlot> logicalSlotFuture) { t...
SlotExecutionVertexAssignment
java
elastic__elasticsearch
server/src/main/java/org/elasticsearch/gateway/PersistedClusterStateService.java
{ "start": 74671, "end": 74819 }
interface ____ { void consumePage(BytesRef bytesRef, int pageIndex, boolean isLastPage) throws IOException; } private static
PageWriter
java
apache__camel
components/camel-mllp/src/test/java/org/apache/camel/test/stub/tcp/SocketOutputStreamStub.java
{ "start": 947, "end": 2564 }
class ____ extends OutputStream { public boolean failOnWrite; public boolean failOnWriteArray; public Byte writeFailOn; public byte[] writeArrayFailOn; ByteArrayOutputStream fakeOutputStream = new ByteArrayOutputStream(); @Override public void write(int b) throws IOException { if (f...
SocketOutputStreamStub
java
bumptech__glide
library/src/main/java/com/bumptech/glide/load/resource/drawable/AnimatedWebpDecoder.java
{ "start": 4175, "end": 4926 }
class ____ implements ResourceDecoder<InputStream, Drawable> { private final AnimatedWebpDecoder delegate; StreamAnimatedWebpDecoder(AnimatedWebpDecoder delegate) { this.delegate = delegate; } @Override public boolean handles(@NonNull InputStream source, @NonNull Options options) ...
StreamAnimatedWebpDecoder
java
spring-projects__spring-framework
spring-test/src/test/java/org/springframework/test/web/servlet/assertj/MockMvcTesterIntegrationTests.java
{ "start": 21767, "end": 22085 }
class ____ { @GetMapping(path = "/greet", produces = "text/plain") String greet() { return "hello"; } @GetMapping(path = "/message", produces = MediaType.APPLICATION_JSON_VALUE) String message() { return "{\"message\": \"hello\"}"; } } @Controller @RequestMapping("/persons") static
TestController
java
bumptech__glide
library/src/main/java/com/bumptech/glide/load/data/BufferedOutputStream.java
{ "start": 389, "end": 2724 }
class ____ extends OutputStream { @NonNull private final OutputStream out; private byte[] buffer; private ArrayPool arrayPool; private int index; public BufferedOutputStream(@NonNull OutputStream out, @NonNull ArrayPool arrayPool) { this(out, arrayPool, ArrayPool.STANDARD_BUFFER_SIZE_BYTES); } @Visi...
BufferedOutputStream
java
hibernate__hibernate-orm
hibernate-envers/src/test/java/org/hibernate/orm/test/envers/entities/manytomany/sametable/Child2Entity.java
{ "start": 655, "end": 2428 }
class ____ { @Id @GeneratedValue private Integer id; private String child2Data; public Child2Entity() { } public Child2Entity(String child2Data) { this.child2Data = child2Data; } public Child2Entity(Integer id, String child2Data) { this.id = id; this.child2Data = child2Data; } @ManyToMany(fetch = ...
Child2Entity
java
quarkusio__quarkus
extensions/spring-di/deployment/src/main/java/io/quarkus/spring/di/deployment/SpringDiBuildTimeConfig.java
{ "start": 320, "end": 608 }
interface ____ { /** * Whether Spring DI is enabled **during the build**. * <p> * Turning this setting off will result in Quarkus completely ignoring beans annotated with Spring annotations */ @WithDefault("true") boolean enabled(); }
SpringDiBuildTimeConfig
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/StructHelper.java
{ "start": 1412, "end": 6887 }
class ____ { public static StructAttributeValues getAttributeValues( EmbeddableMappingType embeddableMappingType, Object[] rawJdbcValues, WrapperOptions options) throws SQLException { final int numberOfAttributeMappings = embeddableMappingType.getNumberOfAttributeMappings(); final int size = numberOfAttri...
StructHelper
java
google__auto
value/src/test/java/com/google/auto/value/processor/AutoValueCompilationTest.java
{ "start": 131812, "end": 132631 }
interface ____ {", " Class<?>[] values() default {};", " }", "}"); ImmutableList<String> annotations = ImmutableList.of( "@ReferenceClass(BarFoo.class)", "@ReferenceClass(values = {Void.class, BarFoo.class})", "@ReferenceClass(neste...
Nested
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/SubstringOfZeroTest.java
{ "start": 877, "end": 1180 }
class ____ { private final BugCheckerRefactoringTestHelper helper = BugCheckerRefactoringTestHelper.newInstance(SubstringOfZero.class, getClass()); @Test public void positiveJustVars() { helper .addInputLines( "Test.java", """
SubstringOfZeroTest
java
mapstruct__mapstruct
core/src/main/java/org/mapstruct/ValueMappings.java
{ "start": 1349, "end": 1407 }
interface ____ { ValueMapping[] value(); }
ValueMappings
java
apache__flink
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/slowtaskdetector/SlowTaskDetector.java
{ "start": 1069, "end": 1376 }
interface ____ { /** Start detecting slow tasks periodically. */ void start( ExecutionGraph executionGraph, SlowTaskDetectorListener listener, ComponentMainThreadExecutor mainThreadExecutor); /** Stop detecting slow tasks. */ void stop(); }
SlowTaskDetector
java
apache__hadoop
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/test/java/org/apache/hadoop/mapred/nativetask/handlers/TestNativeCollectorOnlyHandler.java
{ "start": 2136, "end": 5536 }
class ____ { private NativeCollectorOnlyHandler handler; private INativeHandler nativeHandler; private BufferPusher pusher; private ICombineHandler combiner; private TaskContext taskContext; private static final String LOCAL_DIR = TestConstants.NATIVETASK_TEST_DIR + "/local"; @BeforeEach public void s...
TestNativeCollectorOnlyHandler
java
spring-projects__spring-security
web/src/main/java/org/springframework/security/web/firewall/RequestRejectedHandler.java
{ "start": 1030, "end": 1615 }
interface ____ { /** * Handles an request rejected failure. * @param request that resulted in an <code>RequestRejectedException</code> * @param response so that the user agent can be advised of the failure * @param requestRejectedException that caused the invocation * @throws IOException in the event of an ...
RequestRejectedHandler
java
google__gson
gson/src/test/java/com/google/gson/functional/NullObjectAndFieldTest.java
{ "start": 6122, "end": 6740 }
class ____ { // Using a mix of no-args constructor and field initializers // Also, some fields are initialized and some are not (so initialized per JVM spec) public static final String MY_STRING_DEFAULT = "string"; private static final int MY_INT_DEFAULT = 2; private static final boolean MY_BOOLEAN_...
ClassWithInitializedMembers