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
square__retrofit
samples/src/main/java/com/example/retrofit/ErrorHandlingAdapter.java
{ "start": 3517, "end": 5523 }
class ____<T> implements MyCall<T> { private final Call<T> call; private final Executor callbackExecutor; MyCallAdapter(Call<T> call, Executor callbackExecutor) { this.call = call; this.callbackExecutor = callbackExecutor; } @Override public void cancel() { call.cancel(); ...
MyCallAdapter
java
elastic__elasticsearch
test/fixtures/azure-fixture/src/main/java/fixture/azure/MockAzureBlobStore.java
{ "start": 18676, "end": 18894 }
class ____ extends AzureBlobStoreError { public ConflictException(String errorCode, String message) { super(RestStatus.CONFLICT, errorCode, message); } } public static
ConflictException
java
apache__commons-lang
src/main/java/org/apache/commons/lang3/function/FailableIntToDoubleFunction.java
{ "start": 917, "end": 1098 }
interface ____ {@link IntToDoubleFunction} that declares a {@link Throwable}. * * @param <E> The kind of thrown exception or error. * @since 3.11 */ @FunctionalInterface public
like
java
apache__flink
flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java
{ "start": 1959, "end": 9421 }
enum ____ { /** No error occurred. */ NONE, /** The domain of the numeric type is not large enough to hold the parsed value. */ NUMERIC_VALUE_OVERFLOW_UNDERFLOW, /** A stand-alone sign was encountered while parsing a numeric type. */ NUMERIC_VALUE_ORPHAN_SIGN, ...
ParseErrorState
java
apache__camel
components/camel-ai/camel-langchain4j-embeddings/src/main/java/org/apache/camel/component/langchain4j/embeddings/LangChain4jEmbeddings.java
{ "start": 970, "end": 1177 }
class ____ { public static final String SCHEME = "langchain4j-embeddings"; private LangChain4jEmbeddings() { } /** * @deprecated As of Camel 4.15, this nested Headers
LangChain4jEmbeddings
java
grpc__grpc-java
api/src/main/java/io/grpc/InternalServerProvider.java
{ "start": 750, "end": 1151 }
class ____ { private InternalServerProvider() { } public static ServerBuilder<?> builderForPort(ServerProvider provider, int port) { return provider.builderForPort(port); } public static NewServerBuilderResult newServerBuilderForPort(ServerProvider provider, int port, ServerCredentials creds) { ...
InternalServerProvider
java
quarkusio__quarkus
extensions/panache/hibernate-orm-rest-data-panache/deployment/src/test/java/io/quarkus/hibernate/orm/rest/data/panache/deployment/entity/ProjectResource.java
{ "start": 383, "end": 460 }
interface ____ extends PanacheEntityResource<Project, String> { }
ProjectResource
java
mapstruct__mapstruct
processor/src/main/java/org/mapstruct/ap/internal/model/assignment/Java8FunctionWrapper.java
{ "start": 476, "end": 1406 }
class ____ extends AssignmentWrapper { private final Type functionType; public Java8FunctionWrapper(Assignment decoratedAssignment) { this( decoratedAssignment, null ); } public Java8FunctionWrapper(Assignment decoratedAssignment, Type functionType) { super( decoratedAssignment, false...
Java8FunctionWrapper
java
spring-projects__spring-boot
build-plugin/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/CacheSpec.java
{ "start": 1115, "end": 2336 }
class ____ { private final ObjectFactory objectFactory; private @Nullable Cache cache; @Inject public CacheSpec(ObjectFactory objectFactory) { this.objectFactory = objectFactory; } public @Nullable Cache asCache() { return this.cache; } /** * Configures a volume cache using the given {@code action}. ...
CacheSpec
java
elastic__elasticsearch
x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/request/RequestUtils.java
{ "start": 734, "end": 1968 }
class ____ { public static Header createAuthBearerHeader(SecureString apiKey) { return new BasicHeader(HttpHeaders.AUTHORIZATION, bearerToken(apiKey.toString())); } public static String bearerToken(String apiKey) { return "Bearer " + apiKey; } public static Header createAuthApiKey...
RequestUtils
java
spring-projects__spring-framework
spring-context/src/test/java/org/springframework/jmx/export/annotation/EnableMBeanExportConfigurationTests.java
{ "start": 8205, "end": 8485 }
class ____ { private String name; @ManagedAttribute public String getName() { return this.name; } @ManagedAttribute public void setName(String name) { this.name = name; } } @Configuration @EnableMBeanExport(server = "server") static
PackagePrivateTestBean
java
alibaba__nacos
config/src/main/java/com/alibaba/nacos/config/server/service/repository/ConfigInfoTagPersistService.java
{ "start": 1453, "end": 5878 }
interface ____ { /** * create Pagination utils. * * @param <E> Generic object * @return {@link PaginationHelper} */ <E> PaginationHelper<E> createPaginationHelper(); //------------------------------------------insert---------------------------------------------// ...
ConfigInfoTagPersistService
java
apache__camel
core/camel-core/src/test/java/org/apache/camel/impl/engine/IntrospectionSupportTest.java
{ "start": 4538, "end": 4915 }
class ____ { private ExampleBean bean; public void setBean(ExampleBean bean) { this.bean = bean; } public void setBean(String name) { bean = new ExampleBean(); bean.setName(name); } public String getName() { return bean.g...
MyOverloadedBean
java
alibaba__druid
core/src/main/java/com/alibaba/druid/sql/dialect/informix/parser/InformixSelectParser.java
{ "start": 369, "end": 1061 }
class ____ extends SQLSelectParser { public InformixSelectParser(SQLExprParser exprParser, SQLSelectListCache selectListCache) { super(exprParser, selectListCache); } protected void querySelectListBefore(SQLSelectQueryBlock queryBlock) { if (lexer.identifierEquals(FnvHash.Constants....
InformixSelectParser
java
redisson__redisson
redisson/src/main/java/org/redisson/api/RMultimapReactive.java
{ "start": 841, "end": 4825 }
interface ____<K, V> extends RExpirableReactive { /** * Returns the number of key-value pairs in this multimap. * * @return size of multimap */ Mono<Integer> size(); /** * Returns {@code true} if this multimap contains at least one key-value pair * with the key {@code key}. ...
RMultimapReactive
java
apache__kafka
server-common/src/main/java/org/apache/kafka/server/common/UnitTestFeatureVersion.java
{ "start": 937, "end": 1088 }
class ____ { /** * The feature is used for testing latest production is not one of the feature versions. */ public
UnitTestFeatureVersion
java
apache__kafka
connect/runtime/src/main/java/org/apache/kafka/connect/util/Table.java
{ "start": 895, "end": 1930 }
class ____<R, C, V> { private final Map<R, Map<C, V>> table = new HashMap<>(); public V put(R row, C column, V value) { Map<C, V> columns = table.computeIfAbsent(row, k -> new HashMap<>()); return columns.put(column, value); } public V get(R row, C column) { Map<C, V> columns ...
Table
java
ReactiveX__RxJava
src/test/java/io/reactivex/rxjava3/internal/observers/DeferredScalarObserverTest.java
{ "start": 4736, "end": 13437 }
class ____ extends DeferredScalarObserver<Integer, Integer> { private static final long serialVersionUID = -2793723002312330530L; TakeLast(Observer<? super Integer> downstream) { super(downstream); } @Override public void onNext(Integer value) { this.va...
TakeLast
java
spring-projects__spring-boot
core/spring-boot/src/test/java/org/springframework/boot/diagnostics/FailureAnalyzersTests.java
{ "start": 4166, "end": 4394 }
class ____ implements FailureAnalyzer { static { Object foo = null; foo.toString(); } @Override public FailureAnalysis analyze(Throwable failure) { return null; } } static
BrokenInitializationFailureAnalyzer
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/MethodCanBeStaticTest.java
{ "start": 6716, "end": 7008 }
class ____ { public String toString() { return ""; } } """) .doTest(); } @Test public void negativeSynchronized() { testHelper .addSourceLines( "Test.java", """
Test
java
quarkusio__quarkus
extensions/smallrye-metrics/runtime/src/main/java/io/quarkus/smallrye/metrics/runtime/TagHolder.java
{ "start": 334, "end": 946 }
class ____ { private String name; private String value; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getValue() { return value; } public void setValue(String value) { this.value = v...
TagHolder
java
alibaba__fastjson
src/test/java/com/alibaba/json/bvt/bug/Bug_for_JSONObject.java
{ "start": 231, "end": 476 }
class ____ extends TestCase { public void test_0 () throws Exception { JSONSerializer ser = new JSONSerializer(); ser.config(SerializerFeature.WriteClassName, true); ser.write(new JSONObject()); } }
Bug_for_JSONObject
java
apache__hadoop
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/test/java/org/apache/hadoop/yarn/server/router/webapp/TestRouterWebAppProxy.java
{ "start": 3199, "end": 14148 }
class ____ { private static final Logger LOG = LoggerFactory.getLogger(TestRouterWebAppProxy.class); public static final String AM_PREFIX = "AM"; public static final String RM_PREFIX = "RM"; public static final String AHS_PREFIX = "AHS"; /* * Mocked Server is used for simulating the web of AppMaster, Re...
TestRouterWebAppProxy
java
elastic__elasticsearch
server/src/test/java/org/elasticsearch/cluster/coordination/ElasticsearchNodeCommandTests.java
{ "start": 2292, "end": 10334 }
class ____ extends ESTestCase { public void testLoadStateWithoutMissingCustomsButPreserved() throws IOException { runLoadStateTest(false); } public void testLoadStateWithMissingCustomsButPreserved() throws IOException { runLoadStateTest(true); } @Override public Settings build...
ElasticsearchNodeCommandTests
java
grpc__grpc-java
grpclb/src/main/java/io/grpc/grpclb/GrpclbState.java
{ "start": 22717, "end": 23175 }
class ____ implements Runnable { private final Status reason; private FallbackModeTask(Status reason) { this.reason = reason; } @Override public void run() { // Timer should have been cancelled if entered fallback early. checkState(!usingFallbackBackends, "already in fallback"); ...
FallbackModeTask
java
google__guice
core/test/com/google/inject/ProvisionExceptionTest.java
{ "start": 14361, "end": 14483 }
class ____ implements D { @Inject RealD() { throw new UnsupportedOperationException(); } } static
RealD
java
hibernate__hibernate-orm
hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java
{ "start": 28717, "end": 28893 }
class ____ implements DialectFeatureCheck { public boolean apply(Dialect dialect) { return definesFunction( dialect, "json_object" ); } } public static
SupportsJsonObject
java
apache__camel
components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBasicAuthCustomSecurityAuthenticatorTest.java
{ "start": 1444, "end": 3215 }
class ____ extends BaseNettyTest { @BindToRegistry("myAuthenticator") private MyAuthenticator auth = new MyAuthenticator(); @Test public void testBasicAuth() throws Exception { try { template.requestBody("netty-http:http://localhost:{{port}}/foo", "Hello World", String.class); ...
NettyHttpBasicAuthCustomSecurityAuthenticatorTest
java
apache__flink
flink-core/src/test/java/org/apache/flink/core/state/StateFutureTest.java
{ "start": 11312, "end": 12316 }
class ____ { AtomicInteger value = new AtomicInteger(0); ExecutorService stateExecutor = Executors.newFixedThreadPool(3); AsyncFutureImpl.CallbackRunner runner; MockValueState(ExecutorService executor) { this.runner = new TestCallbackRunner(executor); } Stat...
MockValueState
java
eclipse-vertx__vert.x
vertx-core/src/main/java/io/vertx/core/spi/metrics/TCPMetrics.java
{ "start": 695, "end": 812 }
interface ____<S> extends TransportMetrics<S> { @Override default String type() { return "tcp"; } }
TCPMetrics
java
apache__hadoop
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-common/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/flow/FlowActivityRowKey.java
{ "start": 4712, "end": 9817 }
class ____ implements KeyConverter<FlowActivityRowKey>, KeyConverterToString<FlowActivityRowKey> { private FlowActivityRowKeyConverter() { } /** * The flow activity row key is of the form * clusterId!dayTimestamp!user!flowName with each segment separated by !. * The sizes below ...
FlowActivityRowKeyConverter
java
apache__hadoop
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/aggregate/StringValueMax.java
{ "start": 1021, "end": 1181 }
class ____ a value aggregator that maintain the biggest of * a sequence of strings. * */ @InterfaceAudience.Public @InterfaceStability.Stable public
implements
java
apache__camel
components/camel-aws/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/AmazonIAMClientMock.java
{ "start": 2979, "end": 7250 }
class ____ implements IamClient { @Override public CreateAccessKeyResponse createAccessKey(CreateAccessKeyRequest createAccessKeyRequest) { CreateAccessKeyResponse.Builder res = CreateAccessKeyResponse.builder(); AccessKey.Builder key = AccessKey.builder(); key.accessKeyId("test"); ...
AmazonIAMClientMock
java
resilience4j__resilience4j
resilience4j-micrometer/src/test/java/io/github/resilience4j/micrometer/tagged/TaggedBulkheadMetricsTest.java
{ "start": 1630, "end": 6980 }
class ____ { private MeterRegistry meterRegistry; private Bulkhead bulkhead; private BulkheadRegistry bulkheadRegistry; private TaggedBulkheadMetrics taggedBulkheadMetrics; @Before public void setUp() { meterRegistry = new SimpleMeterRegistry(); bulkheadRegistry = BulkheadRegis...
TaggedBulkheadMetricsTest
java
mapstruct__mapstruct
processor/src/test/resources/fixtures/org/mapstruct/ap/test/subclassmapping/fixture/SubclassAbstractMapperImpl.java
{ "start": 488, "end": 4382 }
class ____ implements SubclassAbstractMapper { @Override public AbstractParentTarget map(AbstractParentSource item) { if ( item == null ) { return null; } if (item instanceof SubSource) { return subSourceToSubTarget( (SubSource) item ); } else if...
SubclassAbstractMapperImpl
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/StringFormatWithLiteralTest.java
{ "start": 9310, "end": 9592 }
class ____ { String test() { return String.format("Formatting this string: %s;Integer: %d", "data", 1); } } """) .addOutputLines( "ExampleClass.java", """ public
ExampleClass
java
alibaba__fastjson
src/test/java/com/alibaba/json/bvt/IntArrayFieldTest_primitive.java
{ "start": 246, "end": 1248 }
class ____ extends TestCase { public void test_array() throws Exception { Assert.assertEquals("[1]", JSON.toJSONString(new int[] { 1 })); } public void test_codec_null() throws Exception { V0 v = new V0(); SerializeConfig mapping = new SerializeConfig(); mapping.setAsmEna...
IntArrayFieldTest_primitive
java
netty__netty
common/src/test/java/io/netty/util/internal/TypeParameterMatcherTest.java
{ "start": 2995, "end": 3101 }
class ____<D extends C, E extends A, F extends B> extends TypeX<E, F, D> { } public abstract static
TypeY
java
spring-projects__spring-boot
module/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ChildManagementContextInitializer.java
{ "start": 9298, "end": 10736 }
class ____ implements ApplicationListener<ApplicationEvent> { private final ApplicationContext parentContext; private final ConfigurableApplicationContext childContext; CloseManagementContextListener(ApplicationContext parentContext, ConfigurableApplicationContext childContext) { this.parentContext = parent...
CloseManagementContextListener
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/threadsafety/GuardedByCheckerTest.java
{ "start": 2575, "end": 3113 }
class ____ { @GuardedBy("Test.class") static int x; static synchronized void m() { x++; } } """) .doTest(); } @Test public void monitor() { compilationHelper .addSourceLines( "threadsa...
Test
java
apache__flink
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/parameters/AbstractKubernetesParameters.java
{ "start": 1883, "end": 7631 }
class ____ implements KubernetesParameters { protected final Configuration flinkConfig; public AbstractKubernetesParameters(Configuration flinkConfig) { this.flinkConfig = checkNotNull(flinkConfig); } public Configuration getFlinkConfiguration() { return flinkConfig; } @Overr...
AbstractKubernetesParameters
java
hibernate__hibernate-orm
hibernate-core/src/test/java/org/hibernate/orm/test/jpa/JpaqlStrictComplianceAliasTest.java
{ "start": 748, "end": 1499 }
class ____ { @Test public void testAlias(SessionFactoryScope scope) { scope.inTransaction( session -> session.createQuery( "select p.stockNumber as stockNo FROM Part p ORDER BY stockNo" ) .getResultList() ); } @Test public void testAlias2(SessionFactoryScope scope) { scope.inTransaction( ...
JpaqlStrictComplianceAliasTest
java
grpc__grpc-java
core/src/main/java/io/grpc/internal/RetriableStream.java
{ "start": 24308, "end": 24648 }
class ____ implements BufferEntry { @Override public void runWith(Substream substream) { substream.stream.setMaxInboundMessageSize(maxSize); } } delayOrExecute(new MaxInboundMessageSizeEntry()); } @Override public final void setMaxOutboundMessageSize(final int maxSize) {
MaxInboundMessageSizeEntry
java
apache__camel
components/camel-xchange/src/main/java/org/apache/camel/component/xchange/XChangeConfiguration.java
{ "start": 1177, "end": 1296 }
enum ____ { marketdata, metadata, account } // Available methods public
XChangeService
java
apache__maven
impl/maven-core/src/main/java/org/apache/maven/AbstractMavenLifecycleParticipant.java
{ "start": 1318, "end": 2965 }
class ____ { /** * Invoked after all MavenProject instances have been created. * * This callback is intended to allow extensions to manipulate MavenProjects * before they are sorted and actual build execution starts. * * @param session the Maven session * @throws MavenExecutionEx...
AbstractMavenLifecycleParticipant
java
apache__dubbo
dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ConsumerConfigTest.java
{ "start": 1593, "end": 12028 }
class ____ { @BeforeEach public void setUp() { DubboBootstrap.reset(); SysProps.clear(); SysProps.setProperty("dubbo.metrics.enabled", "false"); SysProps.setProperty("dubbo.metrics.protocol", "disabled"); } @AfterEach public void afterEach() { SysProps.clear...
ConsumerConfigTest
java
apache__camel
core/camel-api/src/main/java/org/apache/camel/spi/FactoryFinder.java
{ "start": 1520, "end": 1688 }
class ____ using the key to lookup * * @param key is the key to add to the path to find a text file containing the factory name * @param type the
instance
java
apache__flink
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/batch/BatchExecMultipleInput.java
{ "start": 4315, "end": 13414 }
class ____ extends ExecNodeBase<RowData> implements BatchExecNode<RowData>, SingleTransformationTranslator<RowData> { private final ExecNode<?> rootNode; private final List<ExecNode<?>> memberExecNodes; private final List<ExecEdge> originalEdges; public BatchExecMultipleInput( Read...
BatchExecMultipleInput
java
apache__camel
core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerPollStrategyPolledMessagesTest.java
{ "start": 1471, "end": 2863 }
class ____ extends ContextTestSupport { private static int maxPolls; private final CountDownLatch latch = new CountDownLatch(1); @Override protected Registry createCamelRegistry() throws Exception { Registry jndi = super.createCamelRegistry(); jndi.bind("myPoll", new MyPollStrategy());...
FileConsumerPollStrategyPolledMessagesTest
java
hibernate__hibernate-orm
hibernate-testing/src/main/java/org/hibernate/testing/orm/domain/retail/Vendor.java
{ "start": 609, "end": 1707 }
class ____ { private Integer id; private String name; private String billingEntity; private String supplementalDetail; public Vendor() { } public Vendor(Integer id, String name, String billingEntity) { this.id = id; this.name = name; this.billingEntity = billingEntity; } public Vendor(Integer id, Stri...
Vendor
java
hibernate__hibernate-orm
hibernate-core/src/test/java/org/hibernate/orm/test/mapping/access/ElementCollectionInOneToManyTest.java
{ "start": 2565, "end": 2756 }
class ____ { @Id @GeneratedValue long id; String name; @OneToMany(cascade = CascadeType.ALL) List<Book> books = new ArrayList<>(); } @Entity(name = "Book") public static
Author
java
apache__kafka
streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicConfig.java
{ "start": 1225, "end": 4248 }
class ____ { final String name; final Map<String, String> topicConfigs; final boolean enforceNumberOfPartitions; private Optional<Integer> numberOfPartitions = Optional.empty(); static final Map<String, String> INTERNAL_TOPIC_DEFAULT_OVERRIDES = new HashMap<>(); static { INTERNAL_TOPIC...
InternalTopicConfig
java
google__guava
guava/src/com/google/common/util/concurrent/FuturesGetChecked.java
{ "start": 4391, "end": 4684 }
class ____ { static final String CLASS_VALUE_VALIDATOR_NAME = GetCheckedTypeValidatorHolder.class.getName() + "$ClassValueValidator"; static final GetCheckedTypeValidator BEST_VALIDATOR = getBestValidator(); @J2ObjCIncompatible // ClassValue
GetCheckedTypeValidatorHolder
java
google__guava
guava/src/com/google/common/hash/LittleEndianByteArray.java
{ "start": 5460, "end": 6367 }
enum ____ implements LittleEndianBytes { INSTANCE { @Override public long getLongLittleEndian(byte[] array, int offset) { return (long) HANDLE.get(array, offset); } @Override public void putLongLittleEndian(byte[] array, int offset, long value) { HANDLE.set(array, offs...
VarHandleLittleEndianBytes
java
quarkusio__quarkus
extensions/jackson/runtime/src/main/java/io/quarkus/jackson/runtime/VertxHybridPoolObjectMapperCustomizer.java
{ "start": 259, "end": 876 }
class ____ implements ObjectMapperCustomizer { @Override public void customize(ObjectMapper objectMapper) { var existingMapperPool = objectMapper.getFactory()._getRecyclerPool(); // if the recycler pool in use is the default jackson one it means that user hasn't // explicitly chosen any...
VertxHybridPoolObjectMapperCustomizer
java
mockito__mockito
mockito-core/src/main/java/org/mockito/internal/invocation/InvocationMarker.java
{ "start": 348, "end": 1064 }
class ____ { private InvocationMarker() {} public static void markVerified(List<Invocation> invocations, MatchableInvocation wanted) { for (Invocation invocation : invocations) { markVerified(invocation, wanted); } } public static void markVerified(Invocation invocation, M...
InvocationMarker
java
apache__logging-log4j2
log4j-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java
{ "start": 2762, "end": 3554 }
class ____<T extends ExtendedLogger> implements MapFactory<T> { @Override public Map<String, T> createInnerMap() { return new ConcurrentHashMap<>(); } @Override public Map<String, Map<String, T>> createOuterMap() { return new ConcurrentHashMap<>(); ...
ConcurrentMapFactory
java
apache__flink
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/SynchronousCheckpointTest.java
{ "start": 4942, "end": 5729 }
class ____ extends NoOpStreamTask { private Queue<Event> eventQueue; private volatile boolean stopped; StreamTaskUnderTest(final Environment env, Queue<Event> eventQueue) throws Exception { super(env); this.eventQueue = checkNotNull(eventQueue); } @Over...
StreamTaskUnderTest
java
spring-projects__spring-boot
smoke-test/spring-boot-smoke-test-reactive-oauth2-resource-server/src/test/java/smoketest/oauth2/resource/SampleReactiveOAuth2ResourceServerApplicationTests.java
{ "start": 1336, "end": 4989 }
class ____ { @Autowired private WebTestClient webTestClient; private static final MockWebServer server = new MockWebServer(); private static final String VALID_TOKEN = "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJzdWJqZWN0Iiwic2NvcGUiOiJtZXNzYWdlOnJlYWQi" + "LCJleHAiOjQ2ODM4MDUxNDF9.h-j6FKRFdnTdmAueTZCdep45e6DPwqM68ZQ8do...
SampleReactiveOAuth2ResourceServerApplicationTests
java
apache__avro
lang/java/mapred/src/main/java/org/apache/avro/hadoop/io/AvroDatumConverterFactory.java
{ "start": 9797, "end": 10310 }
class ____ extends AvroDatumConverter<NullWritable, Object> { private final Schema mSchema; /** Constructor. */ public NullWritableConverter() { mSchema = Schema.create(Schema.Type.NULL); } /** {@inheritDoc} */ @Override public Object convert(NullWritable input) { return null; ...
NullWritableConverter
java
google__truth
core/src/test/java/com/google/common/truth/StandardSubjectBuilderTest.java
{ "start": 938, "end": 1138 }
class ____ { @Test public void failNoMessage() { AssertionError e = expectFailure(whenTesting -> whenTesting.fail()); assertThat(e).hasMessageThat().isEmpty(); } }
StandardSubjectBuilderTest
java
elastic__elasticsearch
build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/transform/RestTestTransform.java
{ "start": 713, "end": 1358 }
interface ____<T extends JsonNode> extends Named { /** * Transform the Json structure per the given {@link RestTestTransform} * Implementations are expected to mutate the parent to satisfy the transformation. * * @param parent The parent of the node to transform. */ void transformTest(...
RestTestTransform
java
spring-projects__spring-boot
module/spring-boot-http-client/src/main/java/org/springframework/boot/http/client/HttpComponentsHttpClientBuilder.java
{ "start": 1791, "end": 10574 }
class ____ { private final Consumer<HttpClientBuilder> customizer; private final Consumer<PoolingHttpClientConnectionManagerBuilder> connectionManagerCustomizer; private final Consumer<SocketConfig.Builder> socketConfigCustomizer; private final Consumer<ConnectionConfig.Builder> connectionConfigCustomizer; pr...
HttpComponentsHttpClientBuilder
java
FasterXML__jackson-databind
src/test/java/tools/jackson/databind/tofix/ObjectIdWithUnwrapping1298Test.java
{ "start": 1401, "end": 3070 }
class ____ { public Long id; public final String name; public Child(@JsonProperty("name") String name) { this.name = name; this.id = ObjectIdWithUnwrapping1298Test.nextId++; } } @JacksonTestFailureExpected @Test void objectIdWithRepeatedChild() ...
Child
java
spring-projects__spring-boot
core/spring-boot/src/test/java/org/springframework/boot/json/JsonValueWriterTests.java
{ "start": 1510, "end": 9620 }
class ____ { @Test void writeNameAndValueWhenNameIsNull() { assertThat(doWrite((writer) -> writer.write(null, "test"))).isEqualTo(quoted("test")); } @Test void writeNameAndValueWhenNameIsNotNull() { assertThat(doWrite((writer) -> { writer.start(Series.OBJECT); writer.write("name", "value"); writer.e...
JsonValueWriterTests
java
spring-projects__spring-security
access/src/main/java/org/springframework/security/access/method/AbstractFallbackMethodSecurityMetadataSource.java
{ "start": 2663, "end": 3366 }
class ____ null, the method will be unchanged. Method specificMethod = AopUtils.getMostSpecificMethod(method, targetClass); // First try is the method in the target class. Collection<ConfigAttribute> attr = findAttributes(specificMethod, targetClass); if (attr != null) { return attr; } // Second try is t...
is
java
apache__flink
flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/json/JobIDSerializer.java
{ "start": 1250, "end": 1631 }
class ____ extends StdSerializer<JobID> { private static final long serialVersionUID = -6598593519161574611L; protected JobIDSerializer() { super(JobID.class); } @Override public void serialize(JobID value, JsonGenerator gen, SerializerProvider provider) throws IOException { ...
JobIDSerializer
java
apache__camel
components/camel-cyberark-vault/src/generated/java/org/apache/camel/component/cyberark/vault/CyberArkVaultEndpointUriFactory.java
{ "start": 524, "end": 2699 }
class ____ extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory { private static final String BASE = ":label"; private static final Set<String> PROPERTY_NAMES; private static final Set<String> SECRET_PROPERTY_NAMES; private static final Map<String, String>...
CyberArkVaultEndpointUriFactory
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/sql/results/graph/Fetchable.java
{ "start": 717, "end": 3051 }
interface ____ extends ModelPart { /** * The name of the fetchable. This is the part's "local name". * * @see #getNavigableRole() * @see NavigableRole#getLocalName() */ String getFetchableName(); /** * The key that identifies this {@linkplain Fetchable} within a {@link FetchableContainer}. * If this ...
Fetchable
java
apache__flink
flink-python/src/main/java/org/apache/flink/streaming/api/utils/PythonTypeUtils.java
{ "start": 43237, "end": 44005 }
class ____ extends DataConverter<Integer, Long> { private static final long serialVersionUID = 1L; public static final IntDataConverter INSTANCE = new IntDataConverter(); @Override public Integer toInternal(Long value) { if (value == null) { return null; ...
IntDataConverter
java
netty__netty
codec-mqtt/src/main/java/io/netty/handler/codec/mqtt/MqttReasonCodes.java
{ "start": 8862, "end": 9368 }
enum ____ only correct values VALUES[unsignedByte] = code; // [java/index-out-of-bounds] } } private final byte byteValue; PubRel(byte byteValue) { this.byteValue = byteValue; } /** * @return the value number corresponding t...
contains
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/ThreadLocalUsageTest.java
{ "start": 2437, "end": 2563 }
interface ____ {}") .addSourceLines( "Test.java", """ @Singleton
Singleton
java
spring-projects__spring-data-jpa
spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/sample/IdClassExampleDepartment.java
{ "start": 792, "end": 1820 }
class ____ { private String name; @Id private long departmentId; public String getName() { return name; } public void setName(String name) { this.name = name; } public long getDepartmentId() { return departmentId; } public void setDepartmentId(long departmentId) { this.departmentId = departmentId...
IdClassExampleDepartment
java
apache__hadoop
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/runtime/runc/RuncContainerExecutorConfig.java
{ "start": 1615, "end": 5199 }
class ____ { final private String version; final private String runAsUser; final private String username; final private String containerId; final private String applicationId; final private String pidFile; final private String containerScriptPath; final private String containerCredentialsPath; final p...
RuncContainerExecutorConfig
java
micronaut-projects__micronaut-core
core/src/main/java/io/micronaut/core/io/Readable.java
{ "start": 1166, "end": 3041 }
interface ____ extends Named { /** * Represent this Readable as an input stream. * * @return The input stream * @throws IOException if an I/O exception occurs */ @NonNull InputStream asInputStream() throws IOException; /** * Does the underlying readable resource exist. ...
Readable
java
elastic__elasticsearch
x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/RollupIndexCaps.java
{ "start": 3070, "end": 4058 }
class ____ { public List<RollupJobConfig> jobs; // Ignore unknown fields because there could be unrelated doc types private static final ConstructingObjectParser<DocParser, Void> DOC_PARSER = new ConstructingObjectParser<>( "_rollup_doc_parser", true, a -> { ...
DocParser
java
apache__camel
components/camel-spring-parent/camel-spring-xml/src/test/java/org/apache/camel/spring/processor/SpringEnrichExpressionTest.java
{ "start": 1050, "end": 1314 }
class ____ extends EnrichExpressionTest { @Override protected CamelContext createCamelContext() throws Exception { return createSpringCamelContext(this, "org/apache/camel/spring/processor/enrichExpressionTest.xml"); } }
SpringEnrichExpressionTest
java
apache__dubbo
dubbo-common/src/test/java/org/apache/dubbo/common/extension/duplicated/impl/DuplicatedWithoutOverriddenExt2.java
{ "start": 954, "end": 1136 }
class ____ implements DuplicatedWithoutOverriddenExt { @Override public String echo() { return "DuplicatedWithoutOverriddenExt2"; } }
DuplicatedWithoutOverriddenExt2
java
spring-projects__spring-security
oauth2/oauth2-core/src/main/java/org/springframework/security/oauth2/core/authorization/OAuth2AuthorizationManagers.java
{ "start": 1156, "end": 3584 }
class ____ { private OAuth2AuthorizationManagers() { } /** * Create an {@link AuthorizationManager} that requires an {@link Authentication} to * have a {@code SCOPE_scope} authority. * * <p> * For example, if you call {@code hasScope("read")}, then this will require that each * authentication have a {@...
OAuth2AuthorizationManagers
java
google__dagger
javatests/dagger/hilt/android/processor/internal/GeneratorsTest.java
{ "start": 1046, "end": 1450 }
class ____ { private static final Joiner JOINER = Joiner.on("\n"); @Test public void copyConstructorParametersCopiesExternalNullables() { Source baseActivity = HiltCompilerTests.javaSource( "test.BaseActivity", "package test;", "", "import androidx.frag...
GeneratorsTest
java
spring-projects__spring-framework
spring-core/src/test/java/org/springframework/aot/generate/ValueCodeGeneratorTests.java
{ "start": 10158, "end": 10601 }
class ____ { @Test void generateWhenStringList() { List<String> list = List.of("a", "b", "c"); assertThat(resolve(generateCode(list))).hasImport(List.class) .hasValueCode("List.of(\"a\", \"b\", \"c\")"); } @Test void generateWhenEmptyList() { List<String> list = List.of(); assertThat(resolv...
ListTests
java
apache__hadoop
hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamInputFormat.java
{ "start": 1332, "end": 3062 }
class ____ extends KeyValueTextInputFormat { @SuppressWarnings("unchecked") public RecordReader<Text, Text> getRecordReader(final InputSplit genericSplit, JobConf job, Reporter reporter) throws IOException { String c = job.get("stream.recordreader.class"); if (c == nul...
StreamInputFormat
java
quarkusio__quarkus
integration-tests/grpc-hibernate/src/main/java/com/example/grpc/hibernate/Item.java
{ "start": 177, "end": 435 }
class ____ { @Id @GeneratedValue public Long id; public String text; @Override public String toString() { return "Item{" + "id=" + id + ", text='" + text + '\'' + '}'; } }
Item
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/SuperCallToObjectMethodTest.java
{ "start": 1621, "end": 2211 }
class ____ extends Exception { int i; @Override public boolean equals(Object obj) { if (obj instanceof Foo) { return i == ((Foo) obj).i; } // BUG: Diagnostic contains: return super.equals(obj); ...
Foo
java
spring-projects__spring-security
crypto/src/test/java/org/springframework/security/crypto/password/Md4PasswordEncoderTests.java
{ "start": 857, "end": 2227 }
class ____ extends AbstractPasswordEncoderValidationTests { @BeforeEach void setup() { setEncoder(new Md4PasswordEncoder()); } @Test public void matchesWhenEncodedPasswordNullThenFalse() { assertThat(getEncoder().matches("raw", null)).isFalse(); } @Test public void matchesWhenEncodedPasswordEmptyThenFals...
Md4PasswordEncoderTests
java
apache__dubbo
dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/command/impl/SerializeWarnedClassesTest.java
{ "start": 1113, "end": 2875 }
class ____ { @Test void test() { FrameworkModel frameworkModel = new FrameworkModel(); SerializeSecurityManager ssm = frameworkModel.getBeanFactory().getBean(SerializeSecurityManager.class); SerializeWarnedClasses serializeWarnedClasses = new SerializeWarnedClasses(frameworkModel); ...
SerializeWarnedClassesTest
java
spring-projects__spring-framework
spring-jms/src/test/java/org/springframework/jms/support/destination/SimpleDestinationResolverTests.java
{ "start": 1204, "end": 3646 }
class ____ { private static final String DESTINATION_NAME = "foo"; private final SimpleDestinationResolver resolver = new SimpleDestinationResolver(); @Test void resolveWithPubSubTopicSession() throws Exception { Topic expectedDestination1 = new StubTopic(); Topic expectedDestination2 = new StubTopic(); T...
SimpleDestinationResolverTests
java
spring-projects__spring-boot
module/spring-boot-restclient/src/main/java/org/springframework/boot/restclient/RestTemplateBuilder.java
{ "start": 13655, "end": 33641 }
class ____ should be used with the * {@link RestTemplate}. * @param requestFactoryType the request factory type to use * @return a new builder instance * @see ClientHttpRequestFactoryBuilder#of(Class) * @see #requestFactoryBuilder(ClientHttpRequestFactoryBuilder) */ public RestTemplateBuilder requestFactor...
that
java
spring-projects__spring-security
web/src/main/java/org/springframework/security/web/savedrequest/Enumerator.java
{ "start": 1214, "end": 1362 }
class ____<T> implements Enumeration<T> { /** * The <code>Iterator</code> over which the <code>Enumeration</code> represented by * this
Enumerator
java
apache__flink
flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/MessageParametersTest.java
{ "start": 1164, "end": 2340 }
class ____ { @Test void testResolveUrl() { String genericUrl = "/jobs/:jobid/state"; TestMessageParameters parameters = new TestMessageParameters(); JobID pathJobID = new JobID(); JobID queryJobID = new JobID(); parameters.pathParameter.resolve(pathJobID); paramet...
MessageParametersTest
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/ForEachIterableTest.java
{ "start": 4085, "end": 4628 }
class ____ { abstract void doSomething(Object element); void iteratorWhile(Iterable<?> list) { for (Object element : list) { doSomething(element); } } } """) .doTest(); } @Test public void...
Test
java
spring-projects__spring-security
oauth2/oauth2-client/src/test/java/org/springframework/security/oauth2/client/web/AuthenticatedPrincipalOAuth2AuthorizedClientRepositoryTests.java
{ "start": 1604, "end": 6174 }
class ____ { private String registrationId = "registrationId"; private String principalName = "principalName"; private OAuth2AuthorizedClientService authorizedClientService; private OAuth2AuthorizedClientRepository anonymousAuthorizedClientRepository; private AuthenticatedPrincipalOAuth2AuthorizedClientReposi...
AuthenticatedPrincipalOAuth2AuthorizedClientRepositoryTests
java
apache__hadoop
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/nodelabels/store/StoreOp.java
{ "start": 904, "end": 1087 }
interface ____ store activity. * Used by for FileSystem based operation. * * @param <W> write to be done to * @param <R> read to be done from * @param <M> manager used */ public
for
java
dropwizard__dropwizard
dropwizard-jersey/src/test/java/io/dropwizard/jersey/validation/ParamValidatorUnwrapperTest.java
{ "start": 643, "end": 2699 }
class ____ { @NotNull(payload = Unwrapping.Skip.class) @Min(3) IntParam inter = new IntParam("4"); @NotNull(payload = Unwrapping.Skip.class) @NotEmpty @Length(max = 3) public NonEmptyStringParam name = new NonEmptyStringParam("a"); } private final Valida...
Example
java
apache__flink
flink-runtime/src/main/java/org/apache/flink/api/connector/source/lib/InputFormatSource.java
{ "start": 5653, "end": 7388 }
class ____<OUT> implements SplitEnumerator<SourceSplit, Void> { private final InputFormat<OUT, InputSplit> format; private final SplitEnumeratorContext<SourceSplit> context; private Queue<SourceSplit> remainingSplits; public InputFormatSplitEnumerator( InputF...
InputFormatSplitEnumerator
java
google__dagger
dagger-runtime/main/java/dagger/multibindings/LongKey.java
{ "start": 1422, "end": 1460 }
interface ____ { long value(); }
LongKey
java
apache__camel
components/camel-smooks/src/main/java/org/apache/camel/component/smooks/SmooksEndpoint.java
{ "start": 1631, "end": 3863 }
class ____ extends DefaultEndpoint { @UriPath(description = "Path to the Smooks configuration file") @Metadata(required = true, supportFileReference = true) private String smooksConfig; @UriParam(description = "File path to place the generated HTML execution report. The report is a useful tool in the d...
SmooksEndpoint
java
spring-projects__spring-framework
spring-jms/src/test/java/org/springframework/jms/annotation/AbstractJmsAnnotationDrivenTests.java
{ "start": 10576, "end": 10828 }
class ____ { @JmsListeners({ @JmsListener(id = "first", destination = "myQueue"), @JmsListener(id = "second", destination = "anotherQueue", concurrency = "2-10") }) public void repeatableHandle(String msg) { } } static
JmsListenersBean
java
quarkusio__quarkus
extensions/amazon-lambda/deployment/src/test/java/io/quarkus/amazon/lambda/deployment/RequestHandlerJandexUtilTest.java
{ "start": 21494, "end": 21688 }
class ____ implements DefaultMethodInterface { // Uses the default implementation from interface } // Concrete method overrides default method public static
DefaultMethodHandler
java
quarkusio__quarkus
extensions/spring-data-jpa/deployment/src/main/java/io/quarkus/spring/data/deployment/MethodNameParser.java
{ "start": 32619, "end": 34212 }
class ____ is annotated with `@Id`. * * @param entityClass the `ClassInfo` object representing the entity class. * @return the `FieldInfo` of the first field annotated with `@Id`. * @throws NoSuchElementException if no field with the `@Id` annotation is found. */ private FieldInfo getIdFiel...
that