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
spring-projects__spring-boot
core/spring-boot/src/main/java/org/springframework/boot/task/ThreadPoolTaskSchedulerBuilder.java
{ "start": 1630, "end": 9966 }
class ____ { private final @Nullable Integer poolSize; private final @Nullable Boolean awaitTermination; private final @Nullable Duration awaitTerminationPeriod; private final @Nullable String threadNamePrefix; private final @Nullable TaskDecorator taskDecorator; private final @Nullable Set<ThreadPoolTaskSchedulerCustomizer> customizers; public ThreadPoolTaskSchedulerBuilder() { this(null, null, null, null, null, null); } private ThreadPoolTaskSchedulerBuilder(@Nullable Integer poolSize, @Nullable Boolean awaitTermination, @Nullable Duration awaitTerminationPeriod, @Nullable String threadNamePrefix, @Nullable TaskDecorator taskDecorator, @Nullable Set<ThreadPoolTaskSchedulerCustomizer> taskSchedulerCustomizers) { this.poolSize = poolSize; this.awaitTermination = awaitTermination; this.awaitTerminationPeriod = awaitTerminationPeriod; this.threadNamePrefix = threadNamePrefix; this.taskDecorator = taskDecorator; this.customizers = taskSchedulerCustomizers; } /** * Set the maximum allowed number of threads. * @param poolSize the pool size to set * @return a new builder instance */ public ThreadPoolTaskSchedulerBuilder poolSize(int poolSize) { return new ThreadPoolTaskSchedulerBuilder(poolSize, this.awaitTermination, this.awaitTerminationPeriod, this.threadNamePrefix, this.taskDecorator, this.customizers); } /** * Set whether the executor should wait for scheduled tasks to complete on shutdown, * not interrupting running tasks and executing all tasks in the queue. * @param awaitTermination whether the executor needs to wait for the tasks to * complete on shutdown * @return a new builder instance * @see #awaitTerminationPeriod(Duration) */ public ThreadPoolTaskSchedulerBuilder awaitTermination(boolean awaitTermination) { return new ThreadPoolTaskSchedulerBuilder(this.poolSize, awaitTermination, this.awaitTerminationPeriod, this.threadNamePrefix, this.taskDecorator, this.customizers); } /** * Set the maximum time the executor is supposed to block on shutdown. When set, the * executor blocks on shutdown in order to wait for remaining tasks to complete their * execution before the rest of the container continues to shut down. This is * particularly useful if your remaining tasks are likely to need access to other * resources that are also managed by the container. * @param awaitTerminationPeriod the await termination period to set * @return a new builder instance */ public ThreadPoolTaskSchedulerBuilder awaitTerminationPeriod(@Nullable Duration awaitTerminationPeriod) { return new ThreadPoolTaskSchedulerBuilder(this.poolSize, this.awaitTermination, awaitTerminationPeriod, this.threadNamePrefix, this.taskDecorator, this.customizers); } /** * Set the prefix to use for the names of newly created threads. * @param threadNamePrefix the thread name prefix to set * @return a new builder instance */ public ThreadPoolTaskSchedulerBuilder threadNamePrefix(@Nullable String threadNamePrefix) { return new ThreadPoolTaskSchedulerBuilder(this.poolSize, this.awaitTermination, this.awaitTerminationPeriod, threadNamePrefix, this.taskDecorator, this.customizers); } /** * Set the {@link TaskDecorator} to be applied to the {@link ThreadPoolTaskScheduler}. * @param taskDecorator the task decorator to set * @return a new builder instance * @since 3.5.0 */ public ThreadPoolTaskSchedulerBuilder taskDecorator(@Nullable TaskDecorator taskDecorator) { return new ThreadPoolTaskSchedulerBuilder(this.poolSize, this.awaitTermination, this.awaitTerminationPeriod, this.threadNamePrefix, taskDecorator, this.customizers); } /** * Set the {@link ThreadPoolTaskSchedulerCustomizer * threadPoolTaskSchedulerCustomizers} that should be applied to the * {@link ThreadPoolTaskScheduler}. Customizers are applied in the order that they * were added after builder configuration has been applied. Setting this value will * replace any previously configured customizers. * @param customizers the customizers to set * @return a new builder instance * @see #additionalCustomizers(ThreadPoolTaskSchedulerCustomizer...) */ public ThreadPoolTaskSchedulerBuilder customizers(ThreadPoolTaskSchedulerCustomizer... customizers) { Assert.notNull(customizers, "'customizers' must not be null"); return customizers(Arrays.asList(customizers)); } /** * Set the {@link ThreadPoolTaskSchedulerCustomizer * threadPoolTaskSchedulerCustomizers} that should be applied to the * {@link ThreadPoolTaskScheduler}. Customizers are applied in the order that they * were added after builder configuration has been applied. Setting this value will * replace any previously configured customizers. * @param customizers the customizers to set * @return a new builder instance * @see #additionalCustomizers(ThreadPoolTaskSchedulerCustomizer...) */ public ThreadPoolTaskSchedulerBuilder customizers( Iterable<? extends ThreadPoolTaskSchedulerCustomizer> customizers) { Assert.notNull(customizers, "'customizers' must not be null"); return new ThreadPoolTaskSchedulerBuilder(this.poolSize, this.awaitTermination, this.awaitTerminationPeriod, this.threadNamePrefix, this.taskDecorator, append(null, customizers)); } /** * Add {@link ThreadPoolTaskSchedulerCustomizer threadPoolTaskSchedulerCustomizers} * that should be applied to the {@link ThreadPoolTaskScheduler}. Customizers are * applied in the order that they were added after builder configuration has been * applied. * @param customizers the customizers to add * @return a new builder instance * @see #customizers(ThreadPoolTaskSchedulerCustomizer...) */ public ThreadPoolTaskSchedulerBuilder additionalCustomizers(ThreadPoolTaskSchedulerCustomizer... customizers) { Assert.notNull(customizers, "'customizers' must not be null"); return additionalCustomizers(Arrays.asList(customizers)); } /** * Add {@link ThreadPoolTaskSchedulerCustomizer threadPoolTaskSchedulerCustomizers} * that should be applied to the {@link ThreadPoolTaskScheduler}. Customizers are * applied in the order that they were added after builder configuration has been * applied. * @param customizers the customizers to add * @return a new builder instance * @see #customizers(ThreadPoolTaskSchedulerCustomizer...) */ public ThreadPoolTaskSchedulerBuilder additionalCustomizers( Iterable<? extends ThreadPoolTaskSchedulerCustomizer> customizers) { Assert.notNull(customizers, "'customizers' must not be null"); return new ThreadPoolTaskSchedulerBuilder(this.poolSize, this.awaitTermination, this.awaitTerminationPeriod, this.threadNamePrefix, this.taskDecorator, append(this.customizers, customizers)); } /** * Build a new {@link ThreadPoolTaskScheduler} instance and configure it using this * builder. * @return a configured {@link ThreadPoolTaskScheduler} instance. * @see #configure(ThreadPoolTaskScheduler) */ public ThreadPoolTaskScheduler build() { return configure(new ThreadPoolTaskScheduler()); } /** * Configure the provided {@link ThreadPoolTaskScheduler} instance using this builder. * @param <T> the type of task scheduler * @param taskScheduler the {@link ThreadPoolTaskScheduler} to configure * @return the task scheduler instance * @see #build() */ public <T extends ThreadPoolTaskScheduler> T configure(T taskScheduler) { PropertyMapper map = PropertyMapper.get(); map.from(this.poolSize).to(taskScheduler::setPoolSize); map.from(this.awaitTermination).to(taskScheduler::setWaitForTasksToCompleteOnShutdown); map.from(this.awaitTerminationPeriod).asInt(Duration::getSeconds).to(taskScheduler::setAwaitTerminationSeconds); map.from(this.threadNamePrefix).to(taskScheduler::setThreadNamePrefix); map.from(this.taskDecorator).to(taskScheduler::setTaskDecorator); if (!CollectionUtils.isEmpty(this.customizers)) { this.customizers.forEach((customizer) -> customizer.customize(taskScheduler)); } return taskScheduler; } private <T> Set<T> append(@Nullable Set<T> set, Iterable<? extends T> additions) { Set<T> result = new LinkedHashSet<>((set != null) ? set : Collections.emptySet()); additions.forEach(result::add); return Collections.unmodifiableSet(result); } }
ThreadPoolTaskSchedulerBuilder
java
micronaut-projects__micronaut-core
http/src/main/java/io/micronaut/http/context/event/HttpRequestTerminatedEvent.java
{ "start": 1072, "end": 1426 }
class ____ extends ApplicationEvent { /** * @param request The request. Never null. */ public HttpRequestTerminatedEvent(@NonNull HttpRequest<?> request) { super(request); } @Override @NonNull public HttpRequest<?> getSource() { return (HttpRequest<?>) super.getSource(); } }
HttpRequestTerminatedEvent
java
elastic__elasticsearch
server/src/main/java/org/elasticsearch/cluster/coordination/PreVoteCollector.java
{ "start": 986, "end": 1973 }
class ____ { private static final Logger logger = LogManager.getLogger(PreVoteCollector.class); // Tuple for simple atomic updates. null until the first call to `update()`. protected volatile Tuple<DiscoveryNode, PreVoteResponse> state; // DiscoveryNode component is null if there is currently no known // leader. // only for testing PreVoteResponse getPreVoteResponse() { return state.v2(); } // only for testing @Nullable DiscoveryNode getLeader() { return state.v1(); } public void update(final PreVoteResponse preVoteResponse, @Nullable final DiscoveryNode leader) { logger.trace("updating with preVoteResponse={}, leader={}", preVoteResponse, leader); state = new Tuple<>(leader, preVoteResponse); } public abstract Releasable start(ClusterState clusterState, Iterable<DiscoveryNode> broadcastNodes); public
PreVoteCollector
java
quarkusio__quarkus
integration-tests/redis-devservices/src/test/java/io/quarkus/redis/devservices/it/DevServicesRedisCustomPortTest.java
{ "start": 433, "end": 680 }
class ____ { @Test @DisplayName("should start redis container with the given custom port") public void shouldStartRedisContainer() { Assertions.assertTrue(SocketKit.isPortAlreadyUsed(6371)); } }
DevServicesRedisCustomPortTest
java
apache__hadoop
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestErasureCodingAddConfig.java
{ "start": 1527, "end": 3141 }
class ____ { @Test public void testECAddPolicyConfigDisable() throws IOException { Configuration conf = new HdfsConfiguration(); conf.setBoolean( DFSConfigKeys.DFS_NAMENODE_EC_POLICIES_USERPOLICIES_ALLOWED_KEY, false); try (MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(0).build()) { cluster.waitActive(); DistributedFileSystem fs = cluster.getFileSystem(); ErasureCodingPolicy newPolicy1 = new ErasureCodingPolicy(new ECSchema("rs", 5, 3), 1024 * 1024); AddErasureCodingPolicyResponse[] response = fs.addErasureCodingPolicies(new ErasureCodingPolicy[] {newPolicy1}); assertFalse(response[0].isSucceed()); assertEquals( "Addition of user defined erasure coding policy is disabled.", response[0].getErrorMsg()); } } @Test public void testECAddPolicyConfigEnable() throws IOException { Configuration conf = new HdfsConfiguration(); conf.setBoolean( DFSConfigKeys.DFS_NAMENODE_EC_POLICIES_USERPOLICIES_ALLOWED_KEY, true); try (MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(0).build()) { DistributedFileSystem fs = cluster.getFileSystem(); ErasureCodingPolicy newPolicy1 = new ErasureCodingPolicy(new ECSchema("rs", 5, 3), 1024 * 1024); AddErasureCodingPolicyResponse[] response = fs.addErasureCodingPolicies(new ErasureCodingPolicy[] {newPolicy1}); assertTrue(response[0].isSucceed()); assertNull(response[0].getErrorMsg()); } } }
TestErasureCodingAddConfig
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/engine/spi/SharedSessionDelegatorBaseImpl.java
{ "start": 2350, "end": 2640 }
class ____ delegates all method invocations to a delegate instance of * {@link SharedSessionContractImplementor}. This is useful for custom implementations * of that API, so that only some methods need to be overridden * * @author Gavin King */ @SuppressWarnings("deprecation") public
that
java
alibaba__druid
core/src/test/java/com/alibaba/druid/bvt/pool/UrlNotSetTest.java
{ "start": 209, "end": 864 }
class ____ extends TestCase { protected DruidDataSource dataSource; protected void setUp() throws Exception { dataSource = new DruidDataSource(); dataSource.setMaxWait(10); } protected void tearDown() throws Exception { dataSource.close(); } public void test_wait() throws Exception { Exception error = null; try { DruidPooledConnection conn = dataSource.getConnection(); assertNull(conn); //conn.close(); } catch (SQLException ex) { error = ex; } //assertEquals("url not set", error.getMessage()); } }
UrlNotSetTest
java
apache__maven
impl/maven-core/src/main/java/org/apache/maven/execution/BuildResumptionAnalyzer.java
{ "start": 1026, "end": 1460 }
interface ____ { /** * Construct an instance of {@link BuildResumptionData} based on the outcome of the current Maven build. * @param result Outcome of the current Maven build. * @return A {@link BuildResumptionData} instance or {@link Optional#empty()} if resuming the build is not possible. */ Optional<BuildResumptionData> determineBuildResumptionData(MavenExecutionResult result); }
BuildResumptionAnalyzer
java
apache__camel
components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/AbstractMessagingSpanDecorator.java
{ "start": 1344, "end": 3208 }
class ____ extends AbstractSpanDecorator { @Override public String getOperationName(Exchange exchange, Endpoint endpoint) { // Use the destination name return getDestination(exchange, endpoint); } @Override public void pre(SpanAdapter span, Exchange exchange, Endpoint endpoint) { super.pre(span, exchange, endpoint); span.setTag(TagConstants.MESSAGE_BUS_DESTINATION, getDestination(exchange, endpoint)); String messageId = getMessageId(exchange); if (messageId != null) { span.setTag(TagConstants.MESSAGE_ID, messageId); } } /** * This method identifies the destination from the supplied exchange and/or endpoint. * * @param exchange The exchange * @param endpoint The endpoint * @return The message bus destination */ protected String getDestination(Exchange exchange, Endpoint endpoint) { return stripSchemeAndOptions(endpoint); } @Override public SpanKind getInitiatorSpanKind() { return SpanKind.PRODUCER; } @Override public SpanKind getReceiverSpanKind() { return SpanKind.CONSUMER; } /** * This method identifies the message id for the messaging exchange. * * @return The message id, or null if no id exists for the exchange */ protected String getMessageId(Exchange exchange) { return null; } @Override public ExtractAdapter getExtractAdapter(final Map<String, Object> map, final boolean jmsEncoding) { return new CamelMessagingHeadersExtractAdapter(map, jmsEncoding); } @Override public InjectAdapter getInjectAdapter(final Map<String, Object> map, final boolean jmsEncoding) { return new CamelMessagingHeadersInjectAdapter(map, jmsEncoding); } }
AbstractMessagingSpanDecorator
java
apache__flink
flink-core/src/main/java/org/apache/flink/types/ListValue.java
{ "start": 1504, "end": 8622 }
class ____<V extends Value> implements Value, List<V> { private static final long serialVersionUID = 1L; // Type of list elements private final Class<V> valueClass; // Encapsulated list private final List<V> list; /** * Initializes the encapsulated list with an empty ArrayList. * * @see java.util.ArrayList */ public ListValue() { this.valueClass = ReflectionUtil.<V>getTemplateType1(this.getClass()); this.list = new ArrayList<V>(); } /** * Initializes the encapsulated list with an ArrayList filled with all object contained in the * specified Collection object. * * @see java.util.ArrayList * @see java.util.Collection * @param c Collection of initial element of the encapsulated list. */ public ListValue(final Collection<V> c) { this.valueClass = ReflectionUtil.<V>getTemplateType1(this.getClass()); this.list = new ArrayList<V>(c); } /* * (non-Javadoc) * @see java.util.List#iterator() */ @Override public Iterator<V> iterator() { return this.list.iterator(); } @Override public void read(final DataInputView in) throws IOException { int size = in.readInt(); this.list.clear(); try { for (; size > 0; size--) { final V val = this.valueClass.newInstance(); val.read(in); this.list.add(val); } } catch (final InstantiationException e) { throw new RuntimeException(e); } catch (final IllegalAccessException e) { throw new RuntimeException(e); } } @Override public void write(final DataOutputView out) throws IOException { out.writeInt(this.list.size()); for (final V value : this.list) { value.write(out); } } /* * (non-Javadoc) * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 41; int result = 1; result = prime * result + (this.list == null ? 0 : this.list.hashCode()); return result; } /* * (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (this.getClass() != obj.getClass()) { return false; } final ListValue<?> other = (ListValue<?>) obj; if (this.list == null) { if (other.list != null) { return false; } } else if (!this.list.equals(other.list)) { return false; } return true; } /* * (non-Javadoc) * @see java.util.List#add(int, java.lang.Object) */ @Override public void add(final int index, final V element) { this.list.add(index, element); } /* * (non-Javadoc) * @see java.util.List#add(java.lang.Object) */ @Override public boolean add(final V e) { return this.list.add(e); } /* * (non-Javadoc) * @see java.util.List#addAll(java.util.Collection) */ @Override public boolean addAll(final Collection<? extends V> c) { return this.list.addAll(c); } /* * (non-Javadoc) * @see java.util.List#addAll(int, java.util.Collection) */ @Override public boolean addAll(final int index, final Collection<? extends V> c) { return this.list.addAll(index, c); } /* * (non-Javadoc) * @see java.util.List#clear() */ @Override public void clear() { this.list.clear(); } /* * (non-Javadoc) * @see java.util.List#contains(java.lang.Object) */ @Override public boolean contains(final Object o) { return this.list.contains(o); } @Override public String toString() { return this.list.toString(); } /* * (non-Javadoc) * @see java.util.List#containsAll(java.util.Collection) */ @Override public boolean containsAll(final Collection<?> c) { return this.list.containsAll(c); } /* * (non-Javadoc) * @see java.util.List#get(int) */ @Override public V get(final int index) { return this.list.get(index); } /* * (non-Javadoc) * @see java.util.List#indexOf(java.lang.Object) */ @Override public int indexOf(final Object o) { return this.list.indexOf(o); } /* * (non-Javadoc) * @see java.util.List#isEmpty() */ @Override public boolean isEmpty() { return this.list.isEmpty(); } /* * (non-Javadoc) * @see java.util.List#lastIndexOf(java.lang.Object) */ @Override public int lastIndexOf(final Object o) { return this.list.lastIndexOf(o); } /* * (non-Javadoc) * @see java.util.List#listIterator() */ @Override public ListIterator<V> listIterator() { return this.list.listIterator(); } /* * (non-Javadoc) * @see java.util.List#listIterator(int) */ @Override public ListIterator<V> listIterator(final int index) { return this.list.listIterator(index); } /* * (non-Javadoc) * @see java.util.List#remove(int) */ @Override public V remove(final int index) { return this.list.remove(index); } /* * (non-Javadoc) * @see java.util.List#remove(java.lang.Object) */ @Override public boolean remove(final Object o) { return this.list.remove(o); } /* * (non-Javadoc) * @see java.util.List#removeAll(java.util.Collection) */ @Override public boolean removeAll(final Collection<?> c) { return this.list.removeAll(c); } /* * (non-Javadoc) * @see java.util.List#retainAll(java.util.Collection) */ @Override public boolean retainAll(final Collection<?> c) { return this.list.retainAll(c); } /* * (non-Javadoc) * @see java.util.List#set(int, java.lang.Object) */ @Override public V set(final int index, final V element) { return this.list.set(index, element); } /* * (non-Javadoc) * @see java.util.List#size() */ @Override public int size() { return this.list.size(); } /* * (non-Javadoc) * @see java.util.List#subList(int, int) */ @Override public List<V> subList(final int fromIndex, final int toIndex) { return this.list.subList(fromIndex, toIndex); } /* * (non-Javadoc) * @see java.util.List#toArray() */ @Override public Object[] toArray() { return this.list.toArray(); } /* * (non-Javadoc) * @see java.util.List#toArray(T[]) */ @Override public <T> T[] toArray(final T[] a) { return this.list.toArray(a); } }
ListValue
java
apache__dubbo
dubbo-remoting/dubbo-remoting-http12/src/main/java/org/apache/dubbo/remoting/http12/h2/CancelableTransportListener.java
{ "start": 1031, "end": 1233 }
interface ____<HEADER extends HttpMetadata, MESSAGE extends HttpInputMessage> extends HttpTransportListener<HEADER, MESSAGE> { void cancelByRemote(long errorCode); }
CancelableTransportListener
java
apache__hadoop
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ContainerLaunchContext.java
{ "start": 2311, "end": 8537 }
class ____ { @Public @Stable public static ContainerLaunchContext newInstance( Map<String, LocalResource> localResources, Map<String, String> environment, List<String> commands, Map<String, ByteBuffer> serviceData, ByteBuffer tokens, Map<ApplicationAccessType, String> acls) { return newInstance(localResources, environment, commands, serviceData, tokens, acls, null); } @Public @Unstable public static ContainerLaunchContext newInstance( Map<String, LocalResource> localResources, Map<String, String> environment, List<String> commands, Map<String, ByteBuffer> serviceData, ByteBuffer tokens, Map<ApplicationAccessType, String> acls, ContainerRetryContext containerRetryContext) { ContainerLaunchContext container = Records.newRecord(ContainerLaunchContext.class); container.setLocalResources(localResources); container.setEnvironment(environment); container.setCommands(commands); container.setServiceData(serviceData); container.setTokens(tokens); container.setApplicationACLs(acls); container.setContainerRetryContext(containerRetryContext); return container; } /** * Get all the tokens needed by this container. It may include file-system * tokens, ApplicationMaster related tokens if this container is an * ApplicationMaster or framework level tokens needed by this container to * communicate to various services in a secure manner. * * @return tokens needed by this container. */ @Public @Stable public abstract ByteBuffer getTokens(); /** * Set security tokens needed by this container. * @param tokens security tokens */ @Public @Stable public abstract void setTokens(ByteBuffer tokens); /** * Get the configuration used by RM to renew tokens. * @return The configuration used by RM to renew the tokens. */ @Public @Unstable public abstract ByteBuffer getTokensConf(); /** * Set the configuration used by RM to renew the tokens. * @param tokensConf The configuration used by RM to renew the tokens */ @Public @Unstable public abstract void setTokensConf(ByteBuffer tokensConf); /** * Get <code>LocalResource</code> required by the container. * @return all <code>LocalResource</code> required by the container */ @Public @Stable public abstract Map<String, LocalResource> getLocalResources(); /** * Set <code>LocalResource</code> required by the container. All pre-existing * Map entries are cleared before adding the new Map * @param localResources <code>LocalResource</code> required by the container */ @Public @Stable public abstract void setLocalResources(Map<String, LocalResource> localResources); /** * <p> * Get application-specific binary <em>service data</em>. This is a map keyed * by the name of each {@link AuxiliaryService} that is configured on a * NodeManager and value correspond to the application specific data targeted * for the keyed {@link AuxiliaryService}. * </p> * * <p> * This will be used to initialize this application on the specific * {@link AuxiliaryService} running on the NodeManager by calling * {@link AuxiliaryService#initializeApplication(ApplicationInitializationContext)} * </p> * * @return application-specific binary <em>service data</em> */ @Public @Stable public abstract Map<String, ByteBuffer> getServiceData(); /** * <p> * Set application-specific binary <em>service data</em>. This is a map keyed * by the name of each {@link AuxiliaryService} that is configured on a * NodeManager and value correspond to the application specific data targeted * for the keyed {@link AuxiliaryService}. All pre-existing Map entries are * preserved. * </p> * * @param serviceData * application-specific binary <em>service data</em> */ @Public @Stable public abstract void setServiceData(Map<String, ByteBuffer> serviceData); /** * Get <em>environment variables</em> for the container. * @return <em>environment variables</em> for the container */ @Public @Stable public abstract Map<String, String> getEnvironment(); /** * Add <em>environment variables</em> for the container. All pre-existing Map * entries are cleared before adding the new Map * @param environment <em>environment variables</em> for the container */ @Public @Stable public abstract void setEnvironment(Map<String, String> environment); /** * Get the list of <em>commands</em> for launching the container. * @return the list of <em>commands</em> for launching the container */ @Public @Stable public abstract List<String> getCommands(); /** * Add the list of <em>commands</em> for launching the container. All * pre-existing List entries are cleared before adding the new List * @param commands the list of <em>commands</em> for launching the container */ @Public @Stable public abstract void setCommands(List<String> commands); /** * Get the <code>ApplicationACL</code>s for the application. * @return all the <code>ApplicationACL</code>s */ @Public @Stable public abstract Map<ApplicationAccessType, String> getApplicationACLs(); /** * Set the <code>ApplicationACL</code>s for the application. All pre-existing * Map entries are cleared before adding the new Map * @param acls <code>ApplicationACL</code>s for the application */ @Public @Stable public abstract void setApplicationACLs(Map<ApplicationAccessType, String> acls); /** * Get the <code>ContainerRetryContext</code> to relaunch container. * @return <code>ContainerRetryContext</code> to relaunch container. */ @Public @Unstable public abstract ContainerRetryContext getContainerRetryContext(); /** * Set the <code>ContainerRetryContext</code> to relaunch container. * @param containerRetryContext <code>ContainerRetryContext</code> to * relaunch container. */ @Public @Unstable public abstract void setContainerRetryContext( ContainerRetryContext containerRetryContext); }
ContainerLaunchContext
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/NonApiTypeTest.java
{ "start": 8646, "end": 8916 }
class ____ { public void test1(Timestamp timestamp) {} } """) .doTest(); } @Test public void normalApisAreNotFlagged() { helper .addSourceLines( "Test.java", """ public
Test
java
junit-team__junit5
junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodSource.java
{ "start": 917, "end": 5513 }
class ____ which this annotation * is declared or from static factory methods in external classes referenced * by <em>fully qualified method name</em>. * * <p>Each factory method must generate a <em>stream</em> of <em>arguments</em>, * and each set of "arguments" within the "stream" will be provided as the * physical arguments for individual invocations of the annotated * {@code org.junit.jupiter.params.ParameterizedClass @ParameterizedClass} or * {@link org.junit.jupiter.params.ParameterizedTest @ParameterizedTest}. * Generally speaking this translates to a {@link java.util.stream.Stream Stream} * of {@link Arguments} (i.e., {@code Stream<Arguments>}); however, the actual * concrete return type can take on many forms. In this context, a "stream" is * anything that JUnit can reliably convert into a {@code Stream}, such as * {@link java.util.stream.Stream Stream}, * {@link java.util.stream.DoubleStream DoubleStream}, * {@link java.util.stream.LongStream LongStream}, * {@link java.util.stream.IntStream IntStream}, * {@link java.util.Collection Collection}, * {@link java.util.Iterator Iterator}, an array of objects or primitives, or * any type that provides an {@link java.util.Iterator Iterator}-returning * {@code iterator()} method (such as, for example, a * {@code kotlin.sequences.Sequence}). Each set of "arguments" within the * "stream" can be supplied as an instance of {@link Arguments}, an array of * objects (e.g., {@code Object[]}, {@code String[]}, etc.), or a single * <em>value</em> if the parameterized test method accepts a single argument. * * <p>If the return type is {@code Stream} or * one of the primitive streams, JUnit will properly close it by calling * {@link java.util.stream.BaseStream#close() BaseStream.close()}, * making it safe to use a resource such as * {@link java.nio.file.Files#lines(java.nio.file.Path) Files.lines()}. * * <p>Please note that a one-dimensional array of objects supplied as a set of * "arguments" will be handled differently than other types of arguments. * Specifically, all of the elements of a one-dimensional array of objects will * be passed as individual physical arguments to the {@code @ParameterizedTest} * method. This behavior can be seen in the table below for the * {@code static Stream<Object[]> factory()} method: the {@code @ParameterizedTest} * method accepts individual {@code String} and {@code int} arguments rather than * a single {@code Object[]} array. In contrast, any multidimensional array * supplied as a set of "arguments" will be passed as a single physical argument * to the {@code @ParameterizedTest} method without modification. This behavior * can be seen in the table below for the {@code static Stream<int[][]> factory()} * and {@code static Stream<Object[][]> factory()} methods: the * {@code @ParameterizedTest} methods for those factories accept individual * {@code int[][]} and {@code Object[][]} arguments, respectively. * * <h2>Examples</h2> * * <p>The following table displays compatible method signatures for parameterized * test methods and their corresponding factory methods. * * <table class="plain"> * <caption>Compatible method signatures and factory methods</caption> * <tr><th>{@code @ParameterizedTest} method</th><th>Factory method</th></tr> * <tr><td>{@code void test(int)}</td><td>{@code static int[] factory()}</td></tr> * <tr><td>{@code void test(int)}</td><td>{@code static IntStream factory()}</td></tr> * <tr><td>{@code void test(String)}</td><td>{@code static String[] factory()}</td></tr> * <tr><td>{@code void test(String)}</td><td>{@code static List<String> factory()}</td></tr> * <tr><td>{@code void test(String)}</td><td>{@code static Stream<String> factory()}</td></tr> * <tr><td>{@code void test(String, String)}</td><td>{@code static String[][] factory()}</td></tr> * <tr><td>{@code void test(String, int)}</td><td>{@code static Object[][] factory()}</td></tr> * <tr><td>{@code void test(String, int)}</td><td>{@code static Stream<Object[]> factory()}</td></tr> * <tr><td>{@code void test(String, int)}</td><td>{@code static Stream<Arguments> factory()}</td></tr> * <tr><td>{@code void test(int[])}</td><td>{@code static int[][] factory()}</td></tr> * <tr><td>{@code void test(int[])}</td><td>{@code static Stream<int[]> factory()}</td></tr> * <tr><td>{@code void test(int[][])}</td><td>{@code static Stream<int[][]> factory()}</td></tr> * <tr><td>{@code void test(Object[][])}</td><td>{@code static Stream<Object[][]> factory()}</td></tr> * </table> * * <p>Factory methods within the test
in
java
micronaut-projects__micronaut-core
inject/src/main/java/io/micronaut/inject/BeanConfiguration.java
{ "start": 1837, "end": 1913 }
class ____ within this bean configuration. * * @param className The
is
java
spring-projects__spring-data-jpa
spring-data-jpa/src/test/java/org/springframework/data/jpa/convert/threeten/DateTimeSample.java
{ "start": 976, "end": 1140 }
class ____ { @Id @GeneratedValue Long id; Instant instant; LocalDate localDate; LocalTime localTime; LocalDateTime localDateTime; ZoneId zoneId; }
DateTimeSample
java
netty__netty
buffer/src/main/java/io/netty/buffer/SimpleLeakAwareCompositeByteBuf.java
{ "start": 776, "end": 3842 }
class ____ extends WrappedCompositeByteBuf { final ResourceLeakTracker<ByteBuf> leak; SimpleLeakAwareCompositeByteBuf(CompositeByteBuf wrapped, ResourceLeakTracker<ByteBuf> leak) { super(wrapped); this.leak = ObjectUtil.checkNotNull(leak, "leak"); } @Override public boolean release() { // Call unwrap() before just in case that super.release() will change the ByteBuf instance that is returned // by unwrap(). ByteBuf unwrapped = unwrap(); if (super.release()) { closeLeak(unwrapped); return true; } return false; } @Override public boolean release(int decrement) { // Call unwrap() before just in case that super.release() will change the ByteBuf instance that is returned // by unwrap(). ByteBuf unwrapped = unwrap(); if (super.release(decrement)) { closeLeak(unwrapped); return true; } return false; } private void closeLeak(ByteBuf trackedByteBuf) { // Close the ResourceLeakTracker with the tracked ByteBuf as argument. This must be the same that was used when // calling DefaultResourceLeak.track(...). boolean closed = leak.close(trackedByteBuf); assert closed; } @Override public ByteBuf order(ByteOrder endianness) { if (order() == endianness) { return this; } else { return newLeakAwareByteBuf(super.order(endianness)); } } @Override public ByteBuf slice() { return newLeakAwareByteBuf(super.slice()); } @Override public ByteBuf retainedSlice() { return newLeakAwareByteBuf(super.retainedSlice()); } @Override public ByteBuf slice(int index, int length) { return newLeakAwareByteBuf(super.slice(index, length)); } @Override public ByteBuf retainedSlice(int index, int length) { return newLeakAwareByteBuf(super.retainedSlice(index, length)); } @Override public ByteBuf duplicate() { return newLeakAwareByteBuf(super.duplicate()); } @Override public ByteBuf retainedDuplicate() { return newLeakAwareByteBuf(super.retainedDuplicate()); } @Override public ByteBuf readSlice(int length) { return newLeakAwareByteBuf(super.readSlice(length)); } @Override public ByteBuf readRetainedSlice(int length) { return newLeakAwareByteBuf(super.readRetainedSlice(length)); } @Override public ByteBuf asReadOnly() { return newLeakAwareByteBuf(super.asReadOnly()); } private SimpleLeakAwareByteBuf newLeakAwareByteBuf(ByteBuf wrapped) { return newLeakAwareByteBuf(wrapped, unwrap(), leak); } protected SimpleLeakAwareByteBuf newLeakAwareByteBuf( ByteBuf wrapped, ByteBuf trackedByteBuf, ResourceLeakTracker<ByteBuf> leakTracker) { return new SimpleLeakAwareByteBuf(wrapped, trackedByteBuf, leakTracker); } }
SimpleLeakAwareCompositeByteBuf
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/AnnotationPositionTest.java
{ "start": 7538, "end": 7771 }
interface ____ { public @EitherUse static /** Javadoc */ @NonTypeUse int foo = 1; } """) .addOutputLines( "Test.java", """
Test
java
spring-projects__spring-framework
spring-core/src/main/java/org/springframework/util/FileSystemUtils.java
{ "start": 1329, "end": 5819 }
class ____ { /** * Delete the supplied {@link File} - for directories, * recursively delete any nested directories or files as well. * <p>Note: Like {@link File#delete()}, this method does not throw any * exception but rather silently returns {@code false} in case of I/O * errors. Consider using {@link #deleteRecursively(Path)} for NIO-style * handling of I/O errors, clearly differentiating between non-existence * and failure to delete an existing file. * @param root the root {@code File} to delete * @return {@code true} if the {@code File} was successfully deleted, * otherwise {@code false} */ @Contract("null -> false") public static boolean deleteRecursively(@Nullable File root) { if (root == null) { return false; } try { return deleteRecursively(root.toPath()); } catch (IOException ex) { return false; } } /** * Delete the supplied {@link Path} &mdash; for directories, * recursively delete any nested directories or files as well. * @param root the root {@code Path} to delete * @return {@code true} if the {@code Path} existed and was deleted, * or {@code false} if it did not exist * @throws IOException in the case of I/O errors * @since 5.0 */ @Contract("null -> false") public static boolean deleteRecursively(@Nullable Path root) throws IOException { if (root == null) { return false; } if (!Files.exists(root)) { return false; } Files.walkFileTree(root, new SimpleFileVisitor<>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attr) throws IOException { Files.delete(file); return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException ex) throws IOException { Files.delete(dir); return FileVisitResult.CONTINUE; } }); return true; } /** * Recursively copy the contents of the {@code src} file/directory * to the {@code dest} file/directory. * @param src the source directory * @param dest the destination directory * @throws IOException in the case of I/O errors */ public static void copyRecursively(File src, File dest) throws IOException { Assert.notNull(src, "Source File must not be null"); Assert.notNull(dest, "Destination File must not be null"); copyRecursively(src.toPath(), dest.toPath()); } /** * Recursively copy the contents of the {@code src} file/directory * to the {@code dest} file/directory. * @param src the source directory * @param dest the destination directory * @throws IOException in the case of I/O errors * @since 5.0 */ public static void copyRecursively(Path src, Path dest) throws IOException { Assert.notNull(src, "Source Path must not be null"); Assert.notNull(dest, "Destination Path must not be null"); BasicFileAttributes srcAttr = Files.readAttributes(src, BasicFileAttributes.class); if (srcAttr.isDirectory()) { if (src.getClass() == dest.getClass()) { // dest.resolve(Path) only works for same Path type Files.walkFileTree(src, EnumSet.of(FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor<>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attr) throws IOException { Files.createDirectories(dest.resolve(src.relativize(dir))); return FileVisitResult.CONTINUE; } @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attr) throws IOException { Files.copy(file, dest.resolve(src.relativize(file)), StandardCopyOption.REPLACE_EXISTING); return FileVisitResult.CONTINUE; } }); } else { // use dest.resolve(String) for different Path types Files.walkFileTree(src, EnumSet.of(FOLLOW_LINKS), Integer.MAX_VALUE, new SimpleFileVisitor<>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attr) throws IOException { Files.createDirectories(dest.resolve(src.relativize(dir).toString())); return FileVisitResult.CONTINUE; } @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attr) throws IOException { Files.copy(file, dest.resolve(src.relativize(file).toString()), StandardCopyOption.REPLACE_EXISTING); return FileVisitResult.CONTINUE; } }); } } else if (srcAttr.isRegularFile()) { Files.copy(src, dest); } else { throw new IllegalArgumentException("Source File must denote a directory or file"); } } }
FileSystemUtils
java
apache__camel
core/camel-management/src/test/java/org/apache/camel/management/ManagedComponentTest.java
{ "start": 4387, "end": 5300 }
class ____ extends DefaultComponent { public MyVerifiableComponent() { registerExtension(() -> new DefaultComponentVerifierExtension("my-verifiable-component", getCamelContext()) { @Override protected Result verifyConnectivity(Map<String, Object> parameters) { return ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.CONNECTIVITY).build(); } @Override protected Result verifyParameters(Map<String, Object> parameters) { return ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.PARAMETERS).build(); } }); } @Override protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) { throw new UnsupportedOperationException(); } } }
MyVerifiableComponent
java
apache__commons-lang
src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java
{ "start": 16554, "end": 18019 }
class ____ implements Rule { static final TimeZoneNumberRule INSTANCE_COLON = new TimeZoneNumberRule(true); static final TimeZoneNumberRule INSTANCE_NO_COLON = new TimeZoneNumberRule(false); private final boolean colon; /** * Constructs an instance of {@link TimeZoneNumberRule} with the specified properties. * * @param colon add colon between HH and MM in the output if {@code true}. */ TimeZoneNumberRule(final boolean colon) { this.colon = colon; } /** * {@inheritDoc} */ @Override public void appendTo(final Appendable buffer, final Calendar calendar) throws IOException { int offset = calendar.get(Calendar.ZONE_OFFSET) + calendar.get(Calendar.DST_OFFSET); if (offset < 0) { buffer.append('-'); offset = -offset; } else { buffer.append('+'); } final int hours = offset / (60 * 60 * 1000); appendDigits(buffer, hours); if (colon) { buffer.append(':'); } final int minutes = offset / (60 * 1000) - 60 * hours; appendDigits(buffer, minutes); } /** * {@inheritDoc} */ @Override public int estimateLength() { return 5; } } /** * Inner
TimeZoneNumberRule
java
hibernate__hibernate-orm
hibernate-core/src/test/java/org/hibernate/orm/test/temporal/FractionalSecondsTests.java
{ "start": 10467, "end": 10773 }
class ____ { @Id private Integer id; @FractionalSeconds(3) private Instant theInstant; @FractionalSeconds(3) private LocalDateTime theLocalDateTime; @FractionalSeconds(3) private LocalTime theLocalTime; } @Entity(name="TestEntity9") @Table(name="TestEntity9") public static
TestEntity3
java
apache__kafka
raft/src/main/java/org/apache/kafka/raft/KafkaNetworkChannel.java
{ "start": 2844, "end": 8972 }
class ____ extends InterBrokerSendThread { private final Queue<RequestAndCompletionHandler> queue = new ConcurrentLinkedQueue<>(); public SendThread(String name, KafkaClient networkClient, int requestTimeoutMs, Time time, boolean isInterruptible) { super(name, networkClient, requestTimeoutMs, time, isInterruptible); } @Override public Collection<RequestAndCompletionHandler> generateRequests() { List<RequestAndCompletionHandler> list = new ArrayList<>(); while (true) { RequestAndCompletionHandler request = queue.poll(); if (request == null) { return list; } else { list.add(request); } } } public void sendRequest(RequestAndCompletionHandler request) { queue.add(request); wakeup(); } } private static final Logger log = LoggerFactory.getLogger(KafkaNetworkChannel.class); private final SendThread requestThread; private final AtomicInteger correlationIdCounter = new AtomicInteger(0); private final ListenerName listenerName; public KafkaNetworkChannel( Time time, ListenerName listenerName, KafkaClient client, int requestTimeoutMs, String threadNamePrefix ) { this.listenerName = listenerName; this.requestThread = new SendThread( threadNamePrefix + "-outbound-request-thread", client, requestTimeoutMs, time, false ); } @Override public int newCorrelationId() { return correlationIdCounter.getAndIncrement(); } @Override public void send(RaftRequest.Outbound request) { Node node = request.destination(); if (node != null) { requestThread.sendRequest(new RequestAndCompletionHandler( request.createdTimeMs(), node, buildRequest(request.data()), response -> sendOnComplete(request, response) )); } else sendCompleteFuture(request, errorResponse(request.data(), Errors.BROKER_NOT_AVAILABLE)); } private void sendCompleteFuture(RaftRequest.Outbound request, ApiMessage message) { RaftResponse.Inbound response = new RaftResponse.Inbound( request.correlationId(), message, request.destination() ); request.completion.complete(response); } private void sendOnComplete(RaftRequest.Outbound request, ClientResponse clientResponse) { ApiMessage response; if (clientResponse.versionMismatch() != null) { log.error("Request {} failed due to unsupported version error", request, clientResponse.versionMismatch()); response = errorResponse(request.data(), Errors.UNSUPPORTED_VERSION); } else if (clientResponse.authenticationException() != null) { // For now, we treat authentication errors as retriable. We use the // `NETWORK_EXCEPTION` error code for lack of a good alternative. // Note that `NodeToControllerChannelManager` will still log the // authentication errors so that users have a chance to fix the problem. log.error("Request {} failed due to authentication error", request, clientResponse.authenticationException()); response = errorResponse(request.data(), Errors.NETWORK_EXCEPTION); } else if (clientResponse.wasDisconnected()) { response = errorResponse(request.data(), Errors.BROKER_NOT_AVAILABLE); } else { response = clientResponse.responseBody().data(); } sendCompleteFuture(request, response); } private ApiMessage errorResponse(ApiMessage request, Errors error) { ApiKeys apiKey = ApiKeys.forId(request.apiKey()); return RaftUtil.errorResponse(apiKey, error); } @Override public ListenerName listenerName() { return listenerName; } public void start() { requestThread.start(); } @Override public void close() throws InterruptedException { requestThread.shutdown(); } // Visible for testing public void pollOnce() { requestThread.doWork(); } static AbstractRequest.Builder<? extends AbstractRequest> buildRequest(ApiMessage requestData) { if (requestData instanceof VoteRequestData) return new VoteRequest.Builder((VoteRequestData) requestData); else if (requestData instanceof BeginQuorumEpochRequestData) return new BeginQuorumEpochRequest.Builder((BeginQuorumEpochRequestData) requestData); else if (requestData instanceof EndQuorumEpochRequestData) return new EndQuorumEpochRequest.Builder((EndQuorumEpochRequestData) requestData); else if (requestData instanceof FetchRequestData) return new FetchRequest.SimpleBuilder((FetchRequestData) requestData); else if (requestData instanceof FetchSnapshotRequestData) return new FetchSnapshotRequest.Builder((FetchSnapshotRequestData) requestData); else if (requestData instanceof UpdateRaftVoterRequestData) return new UpdateRaftVoterRequest.Builder((UpdateRaftVoterRequestData) requestData); else if (requestData instanceof AddRaftVoterRequestData) return new AddRaftVoterRequest.Builder((AddRaftVoterRequestData) requestData); else if (requestData instanceof RemoveRaftVoterRequestData) return new RemoveRaftVoterRequest.Builder((RemoveRaftVoterRequestData) requestData); else if (requestData instanceof ApiVersionsRequestData) return new ApiVersionsRequest.Builder((ApiVersionsRequestData) requestData, ApiKeys.API_VERSIONS.oldestVersion(), ApiKeys.API_VERSIONS.latestVersion()); else throw new IllegalArgumentException("Unexpected type for requestData: " + requestData); } }
SendThread
java
apache__hadoop
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestApplicationMasterLauncher.java
{ "start": 5759, "end": 5927 }
class ____ { private static final Logger LOG = LoggerFactory .getLogger(TestApplicationMasterLauncher.class); private static final
TestApplicationMasterLauncher
java
apache__avro
lang/java/avro/src/main/java/org/apache/avro/util/internal/Accessor.java
{ "start": 2022, "end": 3693 }
class ____ { protected abstract JsonEncoder jsonEncoder(EncoderFactory factory, Schema schema, JsonGenerator gen) throws IOException; } private static volatile JsonPropertiesAccessor jsonPropertiesAccessor; private static volatile FieldAccessor fieldAccessor; private static volatile ResolvingGrammarGeneratorAccessor resolvingGrammarGeneratorAccessor; public static void setAccessor(JsonPropertiesAccessor accessor) { if (jsonPropertiesAccessor != null) throw new IllegalStateException("JsonPropertiesAccessor already initialized"); jsonPropertiesAccessor = accessor; } public static void setAccessor(FieldAccessor accessor) { if (fieldAccessor != null) throw new IllegalStateException("FieldAccessor already initialized"); fieldAccessor = accessor; } private static FieldAccessor fieldAccessor() { if (fieldAccessor == null) ensureLoaded(Field.class); return fieldAccessor; } public static void setAccessor(ResolvingGrammarGeneratorAccessor accessor) { if (resolvingGrammarGeneratorAccessor != null) throw new IllegalStateException("ResolvingGrammarGeneratorAccessor already initialized"); resolvingGrammarGeneratorAccessor = accessor; } private static ResolvingGrammarGeneratorAccessor resolvingGrammarGeneratorAccessor() { if (resolvingGrammarGeneratorAccessor == null) ensureLoaded(ResolvingGrammarGenerator.class); return resolvingGrammarGeneratorAccessor; } private static void ensureLoaded(Class<?> c) { try { Class.forName(c.getName()); } catch (ClassNotFoundException e) { // Shall never happen as the
EncoderFactoryAccessor
java
apache__camel
components/camel-bean/src/main/java/org/apache/camel/component/bean/ParameterInfo.java
{ "start": 1021, "end": 2442 }
class ____ { private final int index; private final Class<?> type; private final boolean varargs; private final Annotation[] annotations; private Expression expression; ParameterInfo(int index, Class<?> type, boolean varargs, Annotation[] annotations, Expression expression) { this.index = index; this.type = type; this.varargs = varargs; this.annotations = annotations; this.expression = expression; } public Annotation[] getAnnotations() { return annotations; } public Expression getExpression() { return expression; } public int getIndex() { return index; } public Class<?> getType() { return type; } public boolean isVarargs() { return varargs; } public void setExpression(Expression expression) { this.expression = expression; } @Override public String toString() { final StringBuilder sb = new StringBuilder(256); sb.append("ParameterInfo"); sb.append("[index=").append(index); sb.append(", type=").append(type); sb.append(", varargs=").append(varargs); sb.append(", annotations=").append(annotations == null ? "null" : Arrays.asList(annotations).toString()); sb.append(", expression=").append(expression); sb.append(']'); return sb.toString(); } }
ParameterInfo
java
apache__camel
components/camel-pqc/src/main/java/org/apache/camel/component/pqc/lifecycle/KeyMetadata.java
{ "start": 1430, "end": 3652 }
enum ____ { ACTIVE, EXPIRED, REVOKED, PENDING_ROTATION, DEPRECATED } public KeyMetadata(String keyId, String algorithm) { this.keyId = keyId; this.algorithm = algorithm; this.createdAt = Instant.now(); this.lastUsedAt = createdAt; this.usageCount = 0; this.status = KeyStatus.ACTIVE; } public String getKeyId() { return keyId; } public String getAlgorithm() { return algorithm; } public Instant getCreatedAt() { return createdAt; } public Instant getLastUsedAt() { return lastUsedAt; } public void updateLastUsed() { this.lastUsedAt = Instant.now(); this.usageCount++; } public Instant getExpiresAt() { return expiresAt; } public void setExpiresAt(Instant expiresAt) { this.expiresAt = expiresAt; } public Instant getNextRotationAt() { return nextRotationAt; } public void setNextRotationAt(Instant nextRotationAt) { this.nextRotationAt = nextRotationAt; } public long getUsageCount() { return usageCount; } public KeyStatus getStatus() { return status; } public void setStatus(KeyStatus status) { this.status = status; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public boolean isExpired() { return status == KeyStatus.EXPIRED || (expiresAt != null && Instant.now().isAfter(expiresAt)); } public boolean needsRotation() { return status == KeyStatus.PENDING_ROTATION || (nextRotationAt != null && Instant.now().isAfter(nextRotationAt)); } public long getAgeInDays() { return java.time.Duration.between(createdAt, Instant.now()).toDays(); } @Override public String toString() { return String.format( "KeyMetadata[keyId=%s, algorithm=%s, status=%s, created=%s, age=%d days, usage=%d]", keyId, algorithm, status, createdAt, getAgeInDays(), usageCount); } }
KeyStatus
java
apache__hadoop
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/wrappedio/WrappedStatistics.java
{ "start": 6540, "end": 11926 }
class ____ not a snapshot */ public static String iostatisticsSnapshot_toJsonString(@Nullable Serializable snapshot) { return applyToIOStatisticsSnapshot(snapshot, IOStatisticsSnapshot.serializer()::toJson); } /** * Load IOStatisticsSnapshot from a JSON string. * @param json JSON string value. * @return deserialized snapshot. * @throws UncheckedIOException Any IO/jackson exception. */ public static Serializable iostatisticsSnapshot_fromJsonString( final String json) { return uncheckIOExceptions(() -> IOStatisticsSnapshot.serializer().fromJson(json)); } /** * Get the counters of an IOStatisticsSnapshot. * @param source source of statistics. * @return the map of counters. */ public static Map<String, Long> iostatistics_counters( Serializable source) { return applyToIOStatisticsSnapshot(source, IOStatisticsSnapshot::counters); } /** * Get the gauges of an IOStatisticsSnapshot. * @param source source of statistics. * @return the map of gauges. */ public static Map<String, Long> iostatistics_gauges( Serializable source) { return applyToIOStatisticsSnapshot(source, IOStatisticsSnapshot::gauges); } /** * Get the minimums of an IOStatisticsSnapshot. * @param source source of statistics. * @return the map of minimums. */ public static Map<String, Long> iostatistics_minimums( Serializable source) { return applyToIOStatisticsSnapshot(source, IOStatisticsSnapshot::minimums); } /** * Get the maximums of an IOStatisticsSnapshot. * @param source source of statistics. * @return the map of maximums. */ public static Map<String, Long> iostatistics_maximums( Serializable source) { return applyToIOStatisticsSnapshot(source, IOStatisticsSnapshot::maximums); } /** * Get the means of an IOStatisticsSnapshot. * Each value in the map is the (sample, sum) tuple of the values; * the mean is then calculated by dividing sum/sample wherever sample count is non-zero. * @param source source of statistics. * @return a map of mean key to (sample, sum) tuples. */ public static Map<String, Map.Entry<Long, Long>> iostatistics_means( Serializable source) { return applyToIOStatisticsSnapshot(source, stats -> { Map<String, Map.Entry<Long, Long>> map = new HashMap<>(); stats.meanStatistics().forEach((k, v) -> map.put(k, Tuples.pair(v.getSamples(), v.getSum()))); return map; }); } /** * Get the context's {@link IOStatisticsContext} which * implements {@link IOStatisticsSource}. * This is either a thread-local value or a global empty context. * @return instance of {@link IOStatisticsContext}. */ public static Object iostatisticsContext_getCurrent() { return getCurrentIOStatisticsContext(); } /** * Set the IOStatisticsContext for the current thread. * @param statisticsContext IOStatistics context instance for the * current thread. If null, the context is reset. */ public static void iostatisticsContext_setThreadIOStatisticsContext( @Nullable Object statisticsContext) { setThreadIOStatisticsContext((IOStatisticsContext) statisticsContext); } /** * Static probe to check if the thread-level IO statistics enabled. * @return true if the thread-level IO statistics are enabled. */ public static boolean iostatisticsContext_enabled() { return IOStatisticsContext.enabled(); } /** * Reset the context's IOStatistics. * {@link IOStatisticsContext#reset()} */ public static void iostatisticsContext_reset() { getCurrentIOStatisticsContext().reset(); } /** * Take a snapshot of the context IOStatistics. * {@link IOStatisticsContext#snapshot()} * @return an instance of {@link IOStatisticsSnapshot}. */ public static Serializable iostatisticsContext_snapshot() { return getCurrentIOStatisticsContext().snapshot(); } /** * Aggregate into the IOStatistics context the statistics passed in via * IOStatistics/source parameter. * <p> * Returns false if the source is null or does not contain any statistics. * @param source implementation of {@link IOStatisticsSource} or {@link IOStatistics} * @return true if the the source object was aggregated. */ public static boolean iostatisticsContext_aggregate(Object source) { IOStatistics stats = retrieveIOStatistics(source); if (stats != null) { getCurrentIOStatisticsContext().getAggregator().aggregate(stats); return true; } else { return false; } } /** * Convert IOStatistics to a string form, with all the metrics sorted * and empty value stripped. * @param statistics A statistics instance; may be null * @return string value or the empty string if null */ public static String iostatistics_toPrettyString(@Nullable Object statistics) { return statistics == null ? "" : ioStatisticsToPrettyString((IOStatistics) statistics); } /** * Apply a function to an object which may be an IOStatisticsSnapshot. * @param <T> return type * @param source statistics snapshot * @param fun function to invoke if {@code source} is valid. * @return the applied value * @throws UncheckedIOException Any IO exception. * @throws IllegalArgumentException if the supplied
is
java
google__error-prone
core/src/test/java/com/google/errorprone/bugpatterns/DifferentNameButSameTest.java
{ "start": 1653, "end": 1945 }
class ____ { public static void foo() {} } } } """) .expectUnchanged() .addInputLines( "ClassAnnotation.java", """ package pkg; public @
C
java
quarkusio__quarkus
extensions/oidc-token-propagation/deployment/src/test/java/io/quarkus/oidc/token/propagation/deployment/test/OidcTokenPropagationTest.java
{ "start": 538, "end": 1588 }
class ____ { final static OidcTestClient client = new OidcTestClient(); private static Class<?>[] testClasses = { FrontendResource.class, ProtectedResource.class, AccessTokenPropagationService.class }; @RegisterExtension static final QuarkusUnitTest test = new QuarkusUnitTest() .withApplicationRoot((jar) -> jar .addClasses(testClasses) .addAsResource("application.properties")); @AfterAll public static void close() { client.close(); } @Test public void testGetUserNameWithTokenPropagation() { RestAssured.given().auth().oauth2(getBearerAccessToken()) .when().get("/frontend/token-propagation") .then() .statusCode(200) .body(equalTo("Token issued to alice has been exchanged, new user name: bob")); } public String getBearerAccessToken() { return client.getAccessToken("alice", "alice"); } }
OidcTokenPropagationTest
java
alibaba__druid
core/src/main/java/com/alibaba/druid/filter/FilterChainImpl.java
{ "start": 1142, "end": 194013 }
class ____ implements FilterChain { protected int pos; private final DataSourceProxy dataSource; private final int filterSize; public FilterChainImpl(DataSourceProxy dataSource) { this.dataSource = dataSource; this.filterSize = getFilters().size(); } public FilterChainImpl(DataSourceProxy dataSource, int pos) { this.dataSource = dataSource; this.pos = pos; this.filterSize = getFilters().size(); } public int getFilterSize() { return filterSize; } public int getPos() { return pos; } public void reset() { pos = 0; } @Override public FilterChain cloneChain() { return new FilterChainImpl(dataSource, pos); } public DataSourceProxy getDataSource() { return dataSource; } @Override public boolean isWrapperFor(Wrapper wrapper, Class<?> iface) throws SQLException { if (this.pos < filterSize) { return nextFilter() .isWrapperFor(this, wrapper, iface); } if (wrapper instanceof DruidStatementConnection) { if (iface.isInstance(((DruidStatementConnection) wrapper).getConnection())) { return true; } } // // if driver is for jdbc 3.0 if (iface.isInstance(wrapper)) { return true; } return wrapper.isWrapperFor(iface); } @SuppressWarnings("unchecked") @Override public <T> T unwrap(Wrapper wrapper, Class<T> iface) throws SQLException { if (this.pos < filterSize) { return nextFilter() .unwrap(this, wrapper, iface); } if (iface == null) { return null; } if (wrapper instanceof DruidStatementConnection) { Connection conn = ((DruidStatementConnection) wrapper).getConnection(); if (iface.isAssignableFrom(conn.getClass())) { return (T) conn; } } // if driver is for jdbc 3.0 if (iface.isAssignableFrom(wrapper.getClass())) { return (T) wrapper; } return wrapper.unwrap(iface); } public ConnectionProxy connection_connect(Properties info) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_connect(this, info); } Driver driver = dataSource.getRawDriver(); String url = dataSource.getRawJdbcUrl(); Connection nativeConnection = driver.connect(url, info); if (nativeConnection == null) { return null; } Statement stmt = nativeConnection.createStatement(); Connection conn = new DruidStatementConnection(nativeConnection, stmt); return new ConnectionProxyImpl(dataSource, conn, info, dataSource.createConnectionId()); } @Override public void connection_clearWarnings(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_clearWarnings(this, connection); return; } connection.getRawObject() .clearWarnings(); } @Override public void connection_close(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_close(this, connection); return; } connection.getRawObject() .close(); connection.clearAttributes(); } @Override public void connection_commit(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_commit(this, connection); return; } connection.getRawObject() .commit(); } @Override public Array connection_createArrayOf(ConnectionProxy connection, String typeName, Object[] elements) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_createArrayOf(this, connection, typeName, elements); } return connection.getRawObject() .createArrayOf(typeName, elements); } @Override public Blob connection_createBlob(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_createBlob(this, connection); } return connection.getRawObject() .createBlob(); } @Override public Clob connection_createClob(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_createClob(this, connection); } return wrap( connection, connection .getRawObject() .createClob() ); } @Override public NClob connection_createNClob(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_createNClob(this, connection); } return wrap( connection, connection .getRawObject() .createNClob() ); } @Override public SQLXML connection_createSQLXML(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_createSQLXML(this, connection); } return connection.getRawObject() .createSQLXML(); } @Override public StatementProxy connection_createStatement(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_createStatement(this, connection); } Statement statement = connection.getRawObject() .createStatement(); if (statement == null) { return null; } return new StatementProxyImpl( connection, statement, dataSource.createStatementId() ); } @Override public StatementProxy connection_createStatement( ConnectionProxy connection, int resultSetType, int resultSetConcurrency) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_createStatement(this, connection, resultSetType, resultSetConcurrency); } Statement statement = connection.getRawObject() .createStatement(resultSetType, resultSetConcurrency); if (statement == null) { return null; } return new StatementProxyImpl(connection, statement, dataSource.createStatementId()); } @Override public StatementProxy connection_createStatement( ConnectionProxy connection, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_createStatement(this, connection, resultSetType, resultSetConcurrency, resultSetHoldability); } Statement statement = connection.getRawObject() .createStatement(resultSetType, resultSetConcurrency, resultSetHoldability); if (statement == null) { return null; } return new StatementProxyImpl( connection, statement, dataSource.createStatementId()); } @Override public Struct connection_createStruct( ConnectionProxy connection, String typeName, Object[] attributes) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_createStruct(this, connection, typeName, attributes); } return connection.getRawObject() .createStruct(typeName, attributes); } @Override public boolean connection_getAutoCommit(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_getAutoCommit(this, connection); } return connection.getRawObject() .getAutoCommit(); } @Override public String connection_getCatalog(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_getCatalog(this, connection); } return connection.getRawObject() .getCatalog(); } @Override public Properties connection_getClientInfo(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_getClientInfo(this, connection); } return connection.getRawObject() .getClientInfo(); } @Override public String connection_getClientInfo(ConnectionProxy connection, String name) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_getClientInfo(this, connection, name); } return connection.getRawObject() .getClientInfo(name); } public List<Filter> getFilters() { return dataSource.getProxyFilters(); } @Override public int connection_getHoldability(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_getHoldability(this, connection); } return connection.getRawObject() .getHoldability(); } @Override public DatabaseMetaData connection_getMetaData(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_getMetaData(this, connection); } return connection.getRawObject() .getMetaData(); } @Override public int connection_getTransactionIsolation(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_getTransactionIsolation(this, connection); } return connection.getRawObject() .getTransactionIsolation(); } @Override public Map<String, Class<?>> connection_getTypeMap(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_getTypeMap(this, connection); } return connection.getRawObject() .getTypeMap(); } @Override public SQLWarning connection_getWarnings(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_getWarnings(this, connection); } return connection.getRawObject() .getWarnings(); } @Override public boolean connection_isClosed(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_isClosed(this, connection); } return connection.getRawObject() .isClosed(); } @Override public boolean connection_isReadOnly(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_isReadOnly(this, connection); } return connection.getRawObject() .isReadOnly(); } @Override public boolean connection_isValid(ConnectionProxy connection, int timeout) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_isValid(this, connection, timeout); } return connection.getRawObject() .isValid(timeout); } @Override public String connection_nativeSQL(ConnectionProxy connection, String sql) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_nativeSQL(this, connection, sql); } return connection.getRawObject() .nativeSQL(sql); } private Filter nextFilter() { return getFilters() .get(pos++); } @Override public CallableStatementProxy connection_prepareCall(ConnectionProxy connection, String sql) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_prepareCall(this, connection, sql); } CallableStatement statement = connection.getRawObject() .prepareCall(sql); if (statement == null) { return null; } return new CallableStatementProxyImpl(connection, statement, sql, dataSource.createStatementId()); } @Override public CallableStatementProxy connection_prepareCall( ConnectionProxy connection, String sql, int resultSetType, int resultSetConcurrency) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_prepareCall(this, connection, sql, resultSetType, resultSetConcurrency); } CallableStatement statement = connection.getRawObject() .prepareCall(sql, resultSetType, resultSetConcurrency); if (statement == null) { return null; } return new CallableStatementProxyImpl(connection, statement, sql, dataSource.createStatementId()); } @Override public CallableStatementProxy connection_prepareCall( ConnectionProxy connection, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_prepareCall( this, connection, sql, resultSetType, resultSetConcurrency, resultSetHoldability ); } CallableStatement statement = connection.getRawObject() .prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability); if (statement == null) { return null; } return new CallableStatementProxyImpl(connection, statement, sql, dataSource.createStatementId()); } @Override public PreparedStatementProxy connection_prepareStatement( ConnectionProxy connection, String sql) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_prepareStatement(this, connection, sql); } PreparedStatement statement = connection.getRawObject() .prepareStatement(sql); if (statement == null) { return null; } return new PreparedStatementProxyImpl(connection, statement, sql, dataSource.createStatementId()); } @Override public PreparedStatementProxy connection_prepareStatement( ConnectionProxy connection, String sql, int autoGeneratedKeys) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_prepareStatement(this, connection, sql, autoGeneratedKeys); } PreparedStatement statement = connection.getRawObject().prepareStatement(sql, autoGeneratedKeys); if (statement == null) { return null; } return new PreparedStatementProxyImpl(connection, statement, sql, dataSource.createStatementId()); } @Override public PreparedStatementProxy connection_prepareStatement( ConnectionProxy connection, String sql, int resultSetType, int resultSetConcurrency) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_prepareStatement(this, connection, sql, resultSetType, resultSetConcurrency); } PreparedStatement statement = connection.getRawObject() .prepareStatement(sql, resultSetType, resultSetConcurrency); if (statement == null) { return null; } return new PreparedStatementProxyImpl(connection, statement, sql, dataSource.createStatementId()); } @Override public PreparedStatementProxy connection_prepareStatement( ConnectionProxy connection, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_prepareStatement(this, connection, sql, resultSetType, resultSetConcurrency, resultSetHoldability); } PreparedStatement statement = connection.getRawObject() .prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability); if (statement == null) { return null; } return new PreparedStatementProxyImpl( connection, statement, sql, dataSource.createStatementId() ); } @Override public PreparedStatementProxy connection_prepareStatement( ConnectionProxy connection, String sql, int[] columnIndexes) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_prepareStatement(this, connection, sql, columnIndexes); } PreparedStatement statement = connection.getRawObject() .prepareStatement(sql, columnIndexes); if (statement == null) { return null; } return new PreparedStatementProxyImpl( connection, statement, sql, dataSource.createStatementId() ); } @Override public PreparedStatementProxy connection_prepareStatement(ConnectionProxy connection, String sql, String[] columnNames) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_prepareStatement(this, connection, sql, columnNames); } PreparedStatement statement = connection.getRawObject() .prepareStatement(sql, columnNames); if (statement == null) { return null; } return new PreparedStatementProxyImpl(connection, statement, sql, dataSource.createStatementId()); } @Override public void connection_releaseSavepoint(ConnectionProxy connection, Savepoint savepoint) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_releaseSavepoint(this, connection, savepoint); return; } connection.getRawObject() .releaseSavepoint(savepoint); } @Override public void connection_rollback(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_rollback(this, connection); return; } connection.getRawObject() .rollback(); } @Override public void connection_rollback(ConnectionProxy connection, Savepoint savepoint) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_rollback(this, connection, savepoint); return; } connection.getRawObject() .rollback(savepoint); } @Override public void connection_setAutoCommit(ConnectionProxy connection, boolean autoCommit) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_setAutoCommit(this, connection, autoCommit); return; } connection.getRawObject() .setAutoCommit(autoCommit); } @Override public void connection_setCatalog(ConnectionProxy connection, String catalog) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_setCatalog(this, connection, catalog); return; } connection.getRawObject() .setCatalog(catalog); } @Override public void connection_setClientInfo( ConnectionProxy connection, Properties properties) throws SQLClientInfoException { if (this.pos < filterSize) { nextFilter() .connection_setClientInfo(this, connection, properties); return; } connection.getRawObject() .setClientInfo(properties); } @Override public void connection_setClientInfo( ConnectionProxy connection, String name, String value) throws SQLClientInfoException { if (this.pos < filterSize) { nextFilter() .connection_setClientInfo(this, connection, name, value); return; } connection.getRawObject() .setClientInfo(name, value); } @Override public void connection_setHoldability(ConnectionProxy connection, int holdability) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_setHoldability(this, connection, holdability); return; } connection.getRawObject() .setHoldability(holdability); } @Override public void connection_setReadOnly(ConnectionProxy connection, boolean readOnly) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_setReadOnly(this, connection, readOnly); return; } connection.getRawObject() .setReadOnly(readOnly); } @Override public Savepoint connection_setSavepoint(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_setSavepoint(this, connection); } return connection.getRawObject() .setSavepoint(); } @Override public Savepoint connection_setSavepoint(ConnectionProxy connection, String name) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_setSavepoint(this, connection, name); } return connection.getRawObject() .setSavepoint(name); } @Override public void connection_setTransactionIsolation(ConnectionProxy connection, int level) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_setTransactionIsolation(this, connection, level); return; } connection.getRawObject() .setTransactionIsolation(level); } @Override public void connection_setTypeMap(ConnectionProxy connection, Map<String, Class<?>> map) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_setTypeMap(this, connection, map); return; } connection.getRawObject() .setTypeMap(map); } @Override public String connection_getSchema(ConnectionProxy connection) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_getSchema(this, connection); } return connection.getRawObject() .getSchema(); } @Override public void connection_setSchema(ConnectionProxy connection, String schema) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_setSchema(this, connection, schema); return; } connection.getRawObject() .setSchema(schema); } public void connection_abort(ConnectionProxy conn, Executor executor) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_abort(this, conn, executor); return; } conn.getRawObject() .abort(executor); } public void connection_setNetworkTimeout(ConnectionProxy conn, Executor executor, int milliseconds) throws SQLException { if (this.pos < filterSize) { nextFilter() .connection_setNetworkTimeout(this, conn, executor, milliseconds); return; } conn.getRawObject() .setNetworkTimeout(executor, milliseconds); } public int connection_getNetworkTimeout(ConnectionProxy conn) throws SQLException { if (this.pos < filterSize) { return nextFilter() .connection_getNetworkTimeout(this, conn); } return conn.getRawObject().getNetworkTimeout(); } // /////////////////////////////////////// @Override public boolean resultSet_next(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_next(this, rs); } return rs .getResultSetRaw().next(); } @Override public void resultSet_close(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { nextFilter() .resultSet_close(this, rs); return; } rs.getResultSetRaw() .close(); rs.clearAttributes(); } @Override public boolean resultSet_wasNull(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_wasNull(this, rs); } return rs.getResultSetRaw().wasNull(); } @Override public String resultSet_getString(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getString(this, rs, columnIndex); } return rs.getResultSetRaw() .getString(columnIndex); } @Override public boolean resultSet_getBoolean(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getBoolean(this, rs, columnIndex); } return rs.getResultSetRaw() .getBoolean(columnIndex); } @Override public byte resultSet_getByte(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getByte(this, rs, columnIndex); } return rs.getResultSetRaw() .getByte(columnIndex); } @Override public short resultSet_getShort(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getShort(this, rs, columnIndex); } return rs.getResultSetRaw() .getShort(columnIndex); } @Override public int resultSet_getInt(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getInt(this, rs, columnIndex); } return rs.getResultSetRaw() .getInt(columnIndex); } @Override public long resultSet_getLong(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getLong(this, rs, columnIndex); } return rs.getResultSetRaw() .getLong(columnIndex); } @Override public float resultSet_getFloat(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getFloat(this, resultSet, columnIndex); } return resultSet.getResultSetRaw() .getFloat(columnIndex); } @Override public double resultSet_getDouble(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getDouble(this, rs, columnIndex); } return rs.getResultSetRaw() .getDouble(columnIndex); } @SuppressWarnings("deprecation") @Override public BigDecimal resultSet_getBigDecimal(ResultSetProxy rs, int columnIndex, int scale) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getBigDecimal(this, rs, columnIndex, scale); } return rs.getResultSetRaw() .getBigDecimal(columnIndex, scale); } @Override public byte[] resultSet_getBytes(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getBytes(this, rs, columnIndex); } return rs.getResultSetRaw() .getBytes(columnIndex); } @Override public java.sql.Date resultSet_getDate(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getDate(this, rs, columnIndex); } return rs.getResultSetRaw() .getDate(columnIndex); } @Override public java.sql.Time resultSet_getTime(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getTime(this, rs, columnIndex); } return rs.getResultSetRaw() .getTime(columnIndex); } @Override public java.sql.Timestamp resultSet_getTimestamp(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getTimestamp(this, rs, columnIndex); } return rs.getResultSetRaw() .getTimestamp(columnIndex); } @Override public java.io.InputStream resultSet_getAsciiStream(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getAsciiStream(this, rs, columnIndex); } return rs.getResultSetRaw() .getAsciiStream(columnIndex); } @SuppressWarnings("deprecation") @Override public java.io.InputStream resultSet_getUnicodeStream(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getUnicodeStream(this, rs, columnIndex); } return rs.getResultSetRaw() .getUnicodeStream(columnIndex); } @Override public java.io.InputStream resultSet_getBinaryStream(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getBinaryStream(this, rs, columnIndex); } return rs.getResultSetRaw() .getBinaryStream(columnIndex); } @Override public String resultSet_getString(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getString(this, rs, columnLabel); } return rs.getResultSetRaw() .getString(columnLabel); } @Override public boolean resultSet_getBoolean(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getBoolean(this, rs, columnLabel); } return rs.getResultSetRaw() .getBoolean(columnLabel); } @Override public byte resultSet_getByte(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getByte(this, rs, columnLabel); } return rs.getResultSetRaw() .getByte(columnLabel); } @Override public short resultSet_getShort(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getShort(this, rs, columnLabel); } return rs.getResultSetRaw() .getShort(columnLabel); } @Override public int resultSet_getInt(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getInt(this, rs, columnLabel); } return rs.getResultSetRaw() .getInt(columnLabel); } @Override public long resultSet_getLong(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getLong(this, rs, columnLabel); } return rs.getResultSetRaw() .getLong(columnLabel); } @Override public float resultSet_getFloat(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getFloat(this, rs, columnLabel); } return rs.getResultSetRaw() .getFloat(columnLabel); } @Override public double resultSet_getDouble(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getDouble(this, rs, columnLabel); } return rs.getResultSetRaw() .getDouble(columnLabel); } @SuppressWarnings("deprecation") @Override public BigDecimal resultSet_getBigDecimal(ResultSetProxy rs, String columnLabel, int scale) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getBigDecimal(this, rs, columnLabel, scale); } return rs.getResultSetRaw() .getBigDecimal(columnLabel, scale); } @Override public byte[] resultSet_getBytes(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getBytes(this, rs, columnLabel); } return rs.getResultSetRaw().getBytes(columnLabel); } @Override public java.sql.Date resultSet_getDate(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getDate(this, rs, columnLabel); } return rs.getResultSetRaw() .getDate(columnLabel); } @Override public java.sql.Time resultSet_getTime(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getTime(this, rs, columnLabel); } return rs.getResultSetRaw() .getTime(columnLabel); } @Override public java.sql.Timestamp resultSet_getTimestamp(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getTimestamp(this, rs, columnLabel); } return rs.getResultSetRaw() .getTimestamp(columnLabel); } @Override public java.io.InputStream resultSet_getAsciiStream(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getAsciiStream(this, rs, columnLabel); } return rs.getResultSetRaw() .getAsciiStream(columnLabel); } @SuppressWarnings("deprecation") @Override public java.io.InputStream resultSet_getUnicodeStream(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getUnicodeStream(this, rs, columnLabel); } return rs.getResultSetRaw() .getUnicodeStream(columnLabel); } @Override public java.io.InputStream resultSet_getBinaryStream(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getBinaryStream(this, rs, columnLabel); } return rs.getResultSetRaw() .getBinaryStream(columnLabel); } @Override public SQLWarning resultSet_getWarnings(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getWarnings(this, rs); } return rs.getResultSetRaw() .getWarnings(); } @Override public void resultSet_clearWarnings(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { nextFilter() .resultSet_clearWarnings(this, rs); return; } rs.getResultSetRaw() .clearWarnings(); } @Override public String resultSet_getCursorName(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getCursorName(this, rs); } return rs.getResultSetRaw() .getCursorName(); } @Override public ResultSetMetaData resultSet_getMetaData(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getMetaData(this, rs); } ResultSetMetaData metaData = rs.getResultSetRaw() .getMetaData(); if (metaData == null) { return null; } return new ResultSetMetaDataProxyImpl(metaData, dataSource.createMetaDataId(), rs); } @Override public Object resultSet_getObject(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getObject(this, rs, columnIndex); } Object obj = rs.getResultSetRaw().getObject(columnIndex); if (obj instanceof ResultSet) { StatementProxy statement = rs.getStatementProxy(); return new ResultSetProxyImpl( statement, (ResultSet) obj, dataSource.createResultSetId(), statement.getLastExecuteSql() ); } if (obj instanceof Clob) { return wrap( rs.getStatementProxy(), (Clob) obj); } return obj; } @Override public <T> T resultSet_getObject(ResultSetProxy rs, int columnIndex, Class<T> type) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getObject(this, rs, columnIndex, type); } Object obj = rs.getResultSetRaw().getObject(columnIndex, type); if (obj instanceof ResultSet) { StatementProxy statement = rs.getStatementProxy(); return (T) new ResultSetProxyImpl( statement, (ResultSet) obj, dataSource.createResultSetId(), statement.getLastExecuteSql() ); } if (obj instanceof Clob) { return (T) wrap( rs.getStatementProxy(), (Clob) obj); } return (T) obj; } @Override public Object resultSet_getObject(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getObject(this, rs, columnLabel); } Object obj = rs.getResultSetRaw() .getObject(columnLabel); if (obj instanceof ResultSet) { StatementProxy stmt = rs.getStatementProxy(); return new ResultSetProxyImpl( stmt, (ResultSet) obj, dataSource.createResultSetId(), stmt.getLastExecuteSql() ); } if (obj instanceof Clob) { return wrap(rs.getStatementProxy(), (Clob) obj); } return obj; } @Override public <T> T resultSet_getObject(ResultSetProxy rs, String columnLabel, Class<T> type) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getObject(this, rs, columnLabel, type); } T obj = rs.getResultSetRaw() .getObject(columnLabel, type); if (obj instanceof ResultSet) { StatementProxy stmt = rs.getStatementProxy(); return (T) new ResultSetProxyImpl( stmt, (ResultSet) obj, dataSource.createResultSetId(), stmt.getLastExecuteSql() ); } if (obj instanceof Clob) { return (T) wrap(rs.getStatementProxy(), (Clob) obj); } return obj; } @Override public int resultSet_findColumn(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_findColumn(this, rs, columnLabel); } return rs.getResultSetRaw() .findColumn(columnLabel); } @Override public java.io.Reader resultSet_getCharacterStream(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getCharacterStream(this, rs, columnIndex); } return rs.getResultSetRaw() .getCharacterStream(columnIndex); } @Override public java.io.Reader resultSet_getCharacterStream(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getCharacterStream(this, rs, columnLabel); } return rs.getResultSetRaw() .getCharacterStream(columnLabel); } @Override public BigDecimal resultSet_getBigDecimal(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getBigDecimal(this, rs, columnIndex); } return rs.getResultSetRaw() .getBigDecimal(columnIndex); } @Override public BigDecimal resultSet_getBigDecimal(ResultSetProxy rs, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getBigDecimal(this, rs, columnLabel); } return rs.getResultSetRaw() .getBigDecimal(columnLabel); } @Override public boolean resultSet_isBeforeFirst(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_isBeforeFirst(this, rs); } return rs.getResultSetRaw() .isBeforeFirst(); } @Override public boolean resultSet_isAfterLast(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_isAfterLast(this, rs); } return rs.getResultSetRaw() .isAfterLast(); } @Override public boolean resultSet_isFirst(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_isFirst(this, rs); } return rs.getResultSetRaw() .isFirst(); } @Override public boolean resultSet_isLast(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_isLast(this, rs); } return rs.getResultSetRaw() .isLast(); } @Override public void resultSet_beforeFirst(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { nextFilter() .resultSet_beforeFirst(this, rs); return; } rs.getResultSetRaw() .beforeFirst(); } @Override public void resultSet_afterLast(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { nextFilter() .resultSet_afterLast(this, rs); return; } rs.getResultSetRaw() .afterLast(); } @Override public boolean resultSet_first(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_first(this, rs); } return rs.getResultSetRaw() .first(); } @Override public boolean resultSet_last(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_last(this, rs); } return rs.getResultSetRaw() .last(); } @Override public int resultSet_getRow(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getRow(this, rs); } return rs.getResultSetRaw() .getRow(); } @Override public boolean resultSet_absolute(ResultSetProxy rs, int row) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_absolute(this, rs, row); } return rs.getResultSetRaw() .absolute(row); } @Override public boolean resultSet_relative(ResultSetProxy rs, int rows) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_relative(this, rs, rows); } return rs.getResultSetRaw().relative(rows); } @Override public boolean resultSet_previous(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_previous(this, rs); } return rs.getResultSetRaw() .previous(); } @Override public void resultSet_setFetchDirection(ResultSetProxy rs, int direction) throws SQLException { if (this.pos < filterSize) { nextFilter() .resultSet_setFetchDirection(this, rs, direction); return; } rs.getResultSetRaw() .setFetchDirection(direction); } @Override public int resultSet_getFetchDirection(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getFetchDirection(this, rs); } return rs.getResultSetRaw() .getFetchDirection(); } @Override public void resultSet_setFetchSize(ResultSetProxy rs, int rows) throws SQLException { if (this.pos < filterSize) { nextFilter() .resultSet_setFetchSize(this, rs, rows); return; } rs.getResultSetRaw() .setFetchSize(rows); } @Override public int resultSet_getFetchSize(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getFetchSize(this, rs); } return rs.getResultSetRaw() .getFetchSize(); } @Override public int resultSet_getType(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getType(this, rs); } return rs.getResultSetRaw() .getType(); } @Override public int resultSet_getConcurrency(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_getConcurrency(this, rs); } return rs.getResultSetRaw() .getConcurrency(); } @Override public boolean resultSet_rowUpdated(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_rowUpdated(this, rs); } return rs.getResultSetRaw() .rowUpdated(); } @Override public boolean resultSet_rowInserted(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_rowInserted(this, rs); } return rs.getResultSetRaw() .rowInserted(); } @Override public boolean resultSet_rowDeleted(ResultSetProxy resultSet) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_rowDeleted(this, resultSet); } return resultSet.getResultSetRaw() .rowDeleted(); } @Override public void resultSet_updateNull(ResultSetProxy rs, int columnIndex) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNull(this, rs, columnIndex); return; } rs.getResultSetRaw() .updateNull(columnIndex); } @Override public void resultSet_updateBoolean(ResultSetProxy rs, int columnIndex, boolean x) throws SQLException { if (this.pos < filterSize) { nextFilter() .resultSet_updateBoolean(this, rs, columnIndex, x); return; } rs.getResultSetRaw() .updateBoolean(columnIndex, x); } @Override public void resultSet_updateByte(ResultSetProxy resultSet, int columnIndex, byte x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateByte(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateByte(columnIndex, x); } @Override public void resultSet_updateShort(ResultSetProxy resultSet, int columnIndex, short x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateShort(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateShort(columnIndex, x); } @Override public void resultSet_updateInt(ResultSetProxy resultSet, int columnIndex, int x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateInt(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateInt(columnIndex, x); } @Override public void resultSet_updateLong(ResultSetProxy resultSet, int columnIndex, long x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateLong(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateLong(columnIndex, x); } @Override public void resultSet_updateFloat(ResultSetProxy resultSet, int columnIndex, float x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateFloat(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateFloat(columnIndex, x); } @Override public void resultSet_updateDouble(ResultSetProxy resultSet, int columnIndex, double x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateDouble(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateDouble(columnIndex, x); } @Override public void resultSet_updateBigDecimal(ResultSetProxy resultSet, int columnIndex, BigDecimal x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBigDecimal(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateBigDecimal(columnIndex, x); } @Override public void resultSet_updateString(ResultSetProxy resultSet, int columnIndex, String x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateString(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateString(columnIndex, x); } @Override public void resultSet_updateBytes(ResultSetProxy resultSet, int columnIndex, byte[] x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBytes(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateBytes(columnIndex, x); } @Override public void resultSet_updateDate(ResultSetProxy resultSet, int columnIndex, java.sql.Date x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateDate(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateDate(columnIndex, x); } @Override public void resultSet_updateTime(ResultSetProxy resultSet, int columnIndex, java.sql.Time x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateTime(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateTime(columnIndex, x); } @Override public void resultSet_updateTimestamp(ResultSetProxy resultSet, int columnIndex, java.sql.Timestamp x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateTimestamp(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateTimestamp(columnIndex, x); } @Override public void resultSet_updateAsciiStream(ResultSetProxy resultSet, int columnIndex, java.io.InputStream x, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateAsciiStream(this, resultSet, columnIndex, x, length); return; } resultSet.getResultSetRaw().updateAsciiStream(columnIndex, x, length); } @Override public void resultSet_updateBinaryStream(ResultSetProxy resultSet, int columnIndex, java.io.InputStream x, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBinaryStream(this, resultSet, columnIndex, x, length); return; } resultSet.getResultSetRaw().updateBinaryStream(columnIndex, x, length); } @Override public void resultSet_updateCharacterStream(ResultSetProxy resultSet, int columnIndex, java.io.Reader x, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateCharacterStream(this, resultSet, columnIndex, x, length); return; } resultSet.getResultSetRaw().updateCharacterStream(columnIndex, x, length); } @Override public void resultSet_updateObject(ResultSetProxy resultSet, int columnIndex, Object x, int scaleOrLength) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateObject(this, resultSet, columnIndex, x, scaleOrLength); return; } resultSet.getResultSetRaw().updateObject(columnIndex, x, scaleOrLength); } @Override public void resultSet_updateObject(ResultSetProxy resultSet, int columnIndex, Object x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateObject(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateObject(columnIndex, x); } @Override public void resultSet_updateNull(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNull(this, resultSet, columnLabel); return; } resultSet.getResultSetRaw().updateNull(columnLabel); } @Override public void resultSet_updateBoolean(ResultSetProxy resultSet, String columnLabel, boolean x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBoolean(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateBoolean(columnLabel, x); } @Override public void resultSet_updateByte(ResultSetProxy resultSet, String columnLabel, byte x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateByte(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateByte(columnLabel, x); } @Override public void resultSet_updateShort(ResultSetProxy resultSet, String columnLabel, short x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateShort(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateShort(columnLabel, x); } @Override public void resultSet_updateInt(ResultSetProxy resultSet, String columnLabel, int x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateInt(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateInt(columnLabel, x); } @Override public void resultSet_updateLong(ResultSetProxy resultSet, String columnLabel, long x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateLong(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateLong(columnLabel, x); } @Override public void resultSet_updateFloat(ResultSetProxy resultSet, String columnLabel, float x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateFloat(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateFloat(columnLabel, x); } @Override public void resultSet_updateDouble(ResultSetProxy resultSet, String columnLabel, double x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateDouble(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateDouble(columnLabel, x); } @Override public void resultSet_updateBigDecimal(ResultSetProxy resultSet, String columnLabel, BigDecimal x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBigDecimal(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateBigDecimal(columnLabel, x); } @Override public void resultSet_updateString(ResultSetProxy resultSet, String columnLabel, String x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateString(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateString(columnLabel, x); } @Override public void resultSet_updateBytes(ResultSetProxy resultSet, String columnLabel, byte[] x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBytes(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateBytes(columnLabel, x); } @Override public void resultSet_updateDate(ResultSetProxy resultSet, String columnLabel, java.sql.Date x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateDate(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateDate(columnLabel, x); } @Override public void resultSet_updateTime(ResultSetProxy resultSet, String columnLabel, java.sql.Time x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateTime(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateTime(columnLabel, x); } @Override public void resultSet_updateTimestamp(ResultSetProxy resultSet, String columnLabel, java.sql.Timestamp x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateTimestamp(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateTimestamp(columnLabel, x); } @Override public void resultSet_updateAsciiStream(ResultSetProxy resultSet, String columnLabel, java.io.InputStream x, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateAsciiStream(this, resultSet, columnLabel, x, length); return; } resultSet.getResultSetRaw().updateAsciiStream(columnLabel, x, length); } @Override public void resultSet_updateBinaryStream(ResultSetProxy resultSet, String columnLabel, java.io.InputStream x, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBinaryStream(this, resultSet, columnLabel, x, length); return; } resultSet.getResultSetRaw().updateBinaryStream(columnLabel, x, length); } @Override public void resultSet_updateCharacterStream(ResultSetProxy resultSet, String columnLabel, java.io.Reader reader, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateCharacterStream(this, resultSet, columnLabel, reader, length); return; } resultSet.getResultSetRaw().updateCharacterStream(columnLabel, reader, length); } @Override public void resultSet_updateObject(ResultSetProxy resultSet, String columnLabel, Object x, int scaleOrLength) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateObject(this, resultSet, columnLabel, x, scaleOrLength); return; } resultSet.getResultSetRaw().updateObject(columnLabel, x, scaleOrLength); } @Override public void resultSet_updateObject(ResultSetProxy resultSet, String columnLabel, Object x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateObject(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateObject(columnLabel, x); } @Override public void resultSet_insertRow(ResultSetProxy resultSet) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_insertRow(this, resultSet); return; } resultSet.getResultSetRaw().insertRow(); } @Override public void resultSet_updateRow(ResultSetProxy resultSet) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateRow(this, resultSet); return; } resultSet.getResultSetRaw().updateRow(); } @Override public void resultSet_deleteRow(ResultSetProxy resultSet) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_deleteRow(this, resultSet); return; } resultSet.getResultSetRaw().deleteRow(); } @Override public void resultSet_refreshRow(ResultSetProxy resultSet) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_refreshRow(this, resultSet); return; } resultSet.getResultSetRaw().refreshRow(); } @Override public void resultSet_cancelRowUpdates(ResultSetProxy resultSet) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_cancelRowUpdates(this, resultSet); return; } resultSet.getResultSetRaw().cancelRowUpdates(); } @Override public void resultSet_moveToInsertRow(ResultSetProxy resultSet) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_moveToInsertRow(this, resultSet); return; } resultSet.getResultSetRaw().moveToInsertRow(); } @Override public void resultSet_moveToCurrentRow(ResultSetProxy resultSet) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_moveToCurrentRow(this, resultSet); return; } resultSet.getResultSetRaw().moveToCurrentRow(); } @Override public Statement resultSet_getStatement(ResultSetProxy resultSet) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getStatement(this, resultSet); } return resultSet.getResultSetRaw().getStatement(); } @Override public Object resultSet_getObject(ResultSetProxy resultSet, int columnIndex, java.util.Map<String, Class<?>> map) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getObject(this, resultSet, columnIndex, map); } Object obj = resultSet.getResultSetRaw().getObject(columnIndex, map); if (obj instanceof ResultSet) { StatementProxy statement = resultSet.getStatementProxy(); return new ResultSetProxyImpl(statement, (ResultSet) obj, dataSource.createResultSetId(), statement.getLastExecuteSql()); } if (obj instanceof Clob) { return wrap(resultSet.getStatementProxy(), (Clob) obj); } return obj; } @Override public Ref resultSet_getRef(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getRef(this, resultSet, columnIndex); } return resultSet.getResultSetRaw().getRef(columnIndex); } @Override public Blob resultSet_getBlob(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getBlob(this, resultSet, columnIndex); } return resultSet.getResultSetRaw().getBlob(columnIndex); } @Override public Clob resultSet_getClob(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getClob(this, resultSet, columnIndex); } Clob clob = resultSet.getResultSetRaw().getClob(columnIndex); return wrap(resultSet.getStatementProxy(), clob); } @Override public Array resultSet_getArray(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getArray(this, resultSet, columnIndex); } Array rawArray = resultSet.getResultSetRaw().getArray(columnIndex); return rawArray; } @Override public Object resultSet_getObject(ResultSetProxy resultSet, String columnLabel, java.util.Map<String, Class<?>> map) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getObject(this, resultSet, columnLabel, map); } Object obj = resultSet.getResultSetRaw().getObject(columnLabel, map); if (obj instanceof ResultSet) { StatementProxy statement = resultSet.getStatementProxy(); return new ResultSetProxyImpl(statement, (ResultSet) obj, dataSource.createResultSetId(), statement.getLastExecuteSql()); } if (obj instanceof Clob) { return wrap(resultSet.getStatementProxy(), (Clob) obj); } return obj; } @Override public Ref resultSet_getRef(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getRef(this, resultSet, columnLabel); } return resultSet.getResultSetRaw().getRef(columnLabel); } @Override public Blob resultSet_getBlob(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getBlob(this, resultSet, columnLabel); } return resultSet.getResultSetRaw().getBlob(columnLabel); } @Override public Clob resultSet_getClob(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getClob(this, resultSet, columnLabel); } Clob clob = resultSet.getResultSetRaw().getClob(columnLabel); return wrap(resultSet.getStatementProxy(), clob); } @Override public Array resultSet_getArray(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getArray(this, resultSet, columnLabel); } return resultSet.getResultSetRaw().getArray(columnLabel); } @Override public java.sql.Date resultSet_getDate(ResultSetProxy resultSet, int columnIndex, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getDate(this, resultSet, columnIndex, cal); } return resultSet.getResultSetRaw().getDate(columnIndex, cal); } @Override public java.sql.Date resultSet_getDate(ResultSetProxy resultSet, String columnLabel, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getDate(this, resultSet, columnLabel, cal); } return resultSet.getResultSetRaw().getDate(columnLabel, cal); } @Override public java.sql.Time resultSet_getTime(ResultSetProxy resultSet, int columnIndex, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getTime(this, resultSet, columnIndex, cal); } return resultSet.getResultSetRaw().getTime(columnIndex, cal); } @Override public java.sql.Time resultSet_getTime(ResultSetProxy resultSet, String columnLabel, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getTime(this, resultSet, columnLabel, cal); } return resultSet.getResultSetRaw().getTime(columnLabel, cal); } @Override public java.sql.Timestamp resultSet_getTimestamp(ResultSetProxy resultSet, int columnIndex, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getTimestamp(this, resultSet, columnIndex, cal); } return resultSet.getResultSetRaw().getTimestamp(columnIndex, cal); } @Override public java.sql.Timestamp resultSet_getTimestamp(ResultSetProxy resultSet, String columnLabel, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getTimestamp(this, resultSet, columnLabel, cal); } return resultSet.getResultSetRaw().getTimestamp(columnLabel, cal); } @Override public java.net.URL resultSet_getURL(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getURL(this, resultSet, columnIndex); } return resultSet.getResultSetRaw().getURL(columnIndex); } @Override public java.net.URL resultSet_getURL(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getURL(this, resultSet, columnLabel); } return resultSet.getResultSetRaw().getURL(columnLabel); } @Override public void resultSet_updateRef(ResultSetProxy resultSet, int columnIndex, java.sql.Ref x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateRef(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateRef(columnIndex, x); } @Override public void resultSet_updateRef(ResultSetProxy resultSet, String columnLabel, java.sql.Ref x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateRef(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateRef(columnLabel, x); } @Override public void resultSet_updateBlob(ResultSetProxy resultSet, int columnIndex, Blob x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBlob(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateBlob(columnIndex, x); } @Override public void resultSet_updateBlob(ResultSetProxy resultSet, String columnLabel, Blob x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBlob(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateBlob(columnLabel, x); } @Override public void resultSet_updateClob(ResultSetProxy resultSet, int columnIndex, Clob x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateClob(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateClob(columnIndex, x); } @Override public void resultSet_updateClob(ResultSetProxy resultSet, String columnLabel, Clob x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateClob(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateClob(columnLabel, x); } @Override public void resultSet_updateArray(ResultSetProxy resultSet, int columnIndex, java.sql.Array x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateArray(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateArray(columnIndex, x); } @Override public void resultSet_updateArray(ResultSetProxy resultSet, String columnLabel, java.sql.Array x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateArray(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateArray(columnLabel, x); } @Override public RowId resultSet_getRowId(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getRowId(this, resultSet, columnIndex); } return resultSet.getResultSetRaw().getRowId(columnIndex); } @Override public RowId resultSet_getRowId(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getRowId(this, resultSet, columnLabel); } return resultSet.getResultSetRaw().getRowId(columnLabel); } @Override public void resultSet_updateRowId(ResultSetProxy resultSet, int columnIndex, RowId x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateRowId(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateRowId(columnIndex, x); } @Override public void resultSet_updateRowId(ResultSetProxy resultSet, String columnLabel, RowId x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateRowId(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateRowId(columnLabel, x); } @Override public int resultSet_getHoldability(ResultSetProxy resultSet) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getHoldability(this, resultSet); } return resultSet.getResultSetRaw().getHoldability(); } @Override public boolean resultSet_isClosed(ResultSetProxy resultSet) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_isClosed(this, resultSet); } return resultSet.getResultSetRaw().isClosed(); } @Override public void resultSet_updateNString(ResultSetProxy resultSet, int columnIndex, String x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNString(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateNString(columnIndex, x); } @Override public void resultSet_updateNString(ResultSetProxy resultSet, String columnLabel, String nString) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNString(this, resultSet, columnLabel, nString); return; } resultSet.getResultSetRaw().updateNString(columnLabel, nString); } @Override public void resultSet_updateNClob(ResultSetProxy resultSet, int columnIndex, NClob x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNClob(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateNClob(columnIndex, x); } @Override public void resultSet_updateNClob(ResultSetProxy resultSet, String columnLabel, NClob x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNClob(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw() .updateNClob(columnLabel, x); } @Override public NClob resultSet_getNClob(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getNClob(this, resultSet, columnIndex); } NClob nclob = resultSet.getResultSetRaw().getNClob(columnIndex); return wrap(resultSet.getStatementProxy().getConnectionProxy(), nclob); } @Override public NClob resultSet_getNClob(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getNClob(this, resultSet, columnLabel); } NClob nclob = resultSet.getResultSetRaw() .getNClob(columnLabel); return wrap(resultSet.getStatementProxy().getConnectionProxy(), nclob); } @Override public SQLXML resultSet_getSQLXML(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getSQLXML(this, resultSet, columnIndex); } return resultSet.getResultSetRaw().getSQLXML(columnIndex); } @Override public SQLXML resultSet_getSQLXML(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getSQLXML(this, resultSet, columnLabel); } return resultSet.getResultSetRaw().getSQLXML(columnLabel); } @Override public void resultSet_updateSQLXML(ResultSetProxy resultSet, int columnIndex, SQLXML xmlObject) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateSQLXML(this, resultSet, columnIndex, xmlObject); return; } resultSet.getResultSetRaw().updateSQLXML(columnIndex, xmlObject); } @Override public void resultSet_updateSQLXML(ResultSetProxy resultSet, String columnLabel, SQLXML xmlObject) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateSQLXML(this, resultSet, columnLabel, xmlObject); return; } resultSet.getResultSetRaw().updateSQLXML(columnLabel, xmlObject); } @Override public String resultSet_getNString(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getNString(this, resultSet, columnIndex); } return resultSet.getResultSetRaw().getNString(columnIndex); } @Override public String resultSet_getNString(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getNString(this, resultSet, columnLabel); } return resultSet.getResultSetRaw().getNString(columnLabel); } @Override public java.io.Reader resultSet_getNCharacterStream(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getNCharacterStream(this, resultSet, columnIndex); } return resultSet.getResultSetRaw().getNCharacterStream(columnIndex); } @Override public java.io.Reader resultSet_getNCharacterStream(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getNCharacterStream(this, resultSet, columnLabel); } return resultSet.getResultSetRaw().getNCharacterStream(columnLabel); } @Override public void resultSet_updateNCharacterStream(ResultSetProxy resultSet, int columnIndex, java.io.Reader x, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNCharacterStream(this, resultSet, columnIndex, x, length); return; } resultSet.getResultSetRaw().updateNCharacterStream(columnIndex, x, length); } @Override public void resultSet_updateNCharacterStream(ResultSetProxy resultSet, String columnLabel, java.io.Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNCharacterStream(this, resultSet, columnLabel, reader, length); return; } resultSet.getResultSetRaw().updateNCharacterStream(columnLabel, reader, length); } @Override public void resultSet_updateAsciiStream(ResultSetProxy resultSet, int columnIndex, java.io.InputStream x, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateAsciiStream(this, resultSet, columnIndex, x, length); return; } resultSet.getResultSetRaw().updateAsciiStream(columnIndex, x, length); } @Override public void resultSet_updateBinaryStream(ResultSetProxy resultSet, int columnIndex, java.io.InputStream x, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBinaryStream(this, resultSet, columnIndex, x, length); return; } resultSet.getResultSetRaw().updateBinaryStream(columnIndex, x, length); } @Override public void resultSet_updateCharacterStream(ResultSetProxy resultSet, int columnIndex, java.io.Reader x, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateCharacterStream(this, resultSet, columnIndex, x, length); return; } resultSet.getResultSetRaw().updateCharacterStream(columnIndex, x, length); } @Override public void resultSet_updateAsciiStream(ResultSetProxy resultSet, String columnLabel, java.io.InputStream x, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateAsciiStream(this, resultSet, columnLabel, x, length); return; } resultSet.getResultSetRaw().updateAsciiStream(columnLabel, x, length); } @Override public void resultSet_updateBinaryStream(ResultSetProxy resultSet, String columnLabel, java.io.InputStream x, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBinaryStream(this, resultSet, columnLabel, x, length); return; } resultSet.getResultSetRaw().updateBinaryStream(columnLabel, x, length); } @Override public void resultSet_updateCharacterStream(ResultSetProxy resultSet, String columnLabel, java.io.Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateCharacterStream(this, resultSet, columnLabel, reader, length); return; } resultSet.getResultSetRaw().updateCharacterStream(columnLabel, reader, length); } @Override public void resultSet_updateBlob(ResultSetProxy resultSet, int columnIndex, InputStream inputStream, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBlob(this, resultSet, columnIndex, inputStream, length); return; } resultSet.getResultSetRaw().updateBlob(columnIndex, inputStream, length); } @Override public void resultSet_updateBlob(ResultSetProxy resultSet, String columnLabel, InputStream inputStream, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBlob(this, resultSet, columnLabel, inputStream, length); return; } resultSet.getResultSetRaw().updateBlob(columnLabel, inputStream, length); } @Override public void resultSet_updateClob(ResultSetProxy resultSet, int columnIndex, Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateClob(this, resultSet, columnIndex, reader, length); return; } resultSet.getResultSetRaw().updateClob(columnIndex, reader, length); } @Override public void resultSet_updateClob(ResultSetProxy resultSet, String columnLabel, Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateClob(this, resultSet, columnLabel, reader, length); return; } resultSet.getResultSetRaw().updateClob(columnLabel, reader, length); } @Override public void resultSet_updateNClob(ResultSetProxy resultSet, int columnIndex, Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNClob(this, resultSet, columnIndex, reader, length); return; } resultSet.getResultSetRaw().updateNClob(columnIndex, reader, length); } @Override public void resultSet_updateNClob(ResultSetProxy resultSet, String columnLabel, Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNClob(this, resultSet, columnLabel, reader, length); return; } resultSet.getResultSetRaw().updateNClob(columnLabel, reader, length); } @Override public void resultSet_updateNCharacterStream(ResultSetProxy resultSet, int columnIndex, java.io.Reader x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNCharacterStream(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateNCharacterStream(columnIndex, x); } @Override public void resultSet_updateNCharacterStream(ResultSetProxy resultSet, String columnLabel, java.io.Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNCharacterStream(this, resultSet, columnLabel, reader); return; } resultSet.getResultSetRaw().updateNCharacterStream(columnLabel, reader); } @Override public void resultSet_updateAsciiStream(ResultSetProxy resultSet, int columnIndex, java.io.InputStream x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateAsciiStream(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateAsciiStream(columnIndex, x); } @Override public void resultSet_updateBinaryStream(ResultSetProxy resultSet, int columnIndex, java.io.InputStream x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBinaryStream(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateBinaryStream(columnIndex, x); } @Override public void resultSet_updateCharacterStream(ResultSetProxy resultSet, int columnIndex, java.io.Reader x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateCharacterStream(this, resultSet, columnIndex, x); return; } resultSet.getResultSetRaw().updateCharacterStream(columnIndex, x); } @Override public void resultSet_updateAsciiStream(ResultSetProxy resultSet, String columnLabel, java.io.InputStream x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateAsciiStream(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateAsciiStream(columnLabel, x); } @Override public void resultSet_updateBinaryStream(ResultSetProxy resultSet, String columnLabel, java.io.InputStream x) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBinaryStream(this, resultSet, columnLabel, x); return; } resultSet.getResultSetRaw().updateBinaryStream(columnLabel, x); } @Override public void resultSet_updateCharacterStream(ResultSetProxy resultSet, String columnLabel, java.io.Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateCharacterStream(this, resultSet, columnLabel, reader); return; } resultSet.getResultSetRaw().updateCharacterStream(columnLabel, reader); } @Override public void resultSet_updateBlob(ResultSetProxy resultSet, int columnIndex, InputStream inputStream) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBlob(this, resultSet, columnIndex, inputStream); return; } resultSet.getResultSetRaw().updateBlob(columnIndex, inputStream); } @Override public void resultSet_updateBlob(ResultSetProxy resultSet, String columnLabel, InputStream inputStream) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateBlob(this, resultSet, columnLabel, inputStream); return; } resultSet.getResultSetRaw().updateBlob(columnLabel, inputStream); } @Override public void resultSet_updateClob(ResultSetProxy resultSet, int columnIndex, Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateClob(this, resultSet, columnIndex, reader); return; } resultSet.getResultSetRaw().updateClob(columnIndex, reader); } @Override public void resultSet_updateClob(ResultSetProxy resultSet, String columnLabel, Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateClob(this, resultSet, columnLabel, reader); return; } resultSet.getResultSetRaw().updateClob(columnLabel, reader); } @Override public void resultSet_updateNClob(ResultSetProxy resultSet, int columnIndex, Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNClob(this, resultSet, columnIndex, reader); return; } resultSet.getResultSetRaw().updateNClob(columnIndex, reader); } @Override public void resultSet_updateNClob(ResultSetProxy resultSet, String columnLabel, Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().resultSet_updateNClob(this, resultSet, columnLabel, reader); return; } resultSet.getResultSetRaw().updateNClob(columnLabel, reader); } // //////////////////////////////////////// statement @Override public ResultSetProxy statement_executeQuery(StatementProxy statement, String sql) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_executeQuery(this, statement, sql); } ResultSet resultSet = statement.getRawObject().executeQuery(sql); if (resultSet == null) { return null; } return new ResultSetProxyImpl(statement, resultSet, dataSource.createResultSetId(), statement.getLastExecuteSql()); } @Override public int statement_executeUpdate(StatementProxy statement, String sql) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_executeUpdate(this, statement, sql); } return statement.getRawObject().executeUpdate(sql); } @Override public void statement_close(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_close(this, statement); return; } statement.getRawObject().close(); } @Override public int statement_getMaxFieldSize(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getMaxFieldSize(this, statement); } return statement.getRawObject().getMaxFieldSize(); } @Override public void statement_setMaxFieldSize(StatementProxy statement, int max) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_setMaxFieldSize(this, statement, max); return; } statement.getRawObject().setMaxFieldSize(max); } @Override public int statement_getMaxRows(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getMaxRows(this, statement); } return statement.getRawObject().getMaxRows(); } @Override public void statement_setMaxRows(StatementProxy statement, int max) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_setMaxRows(this, statement, max); return; } statement.getRawObject().setMaxRows(max); } @Override public void statement_setEscapeProcessing(StatementProxy statement, boolean enable) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_setEscapeProcessing(this, statement, enable); return; } statement.getRawObject().setEscapeProcessing(enable); } @Override public int statement_getQueryTimeout(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getQueryTimeout(this, statement); } return statement.getRawObject().getQueryTimeout(); } @Override public void statement_setQueryTimeout(StatementProxy statement, int seconds) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_setQueryTimeout(this, statement, seconds); return; } statement.getRawObject().setQueryTimeout(seconds); } @Override public void statement_cancel(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_cancel(this, statement); return; } statement.getRawObject().cancel(); } @Override public SQLWarning statement_getWarnings(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getWarnings(this, statement); } return statement.getRawObject().getWarnings(); } @Override public void statement_clearWarnings(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_clearWarnings(this, statement); return; } statement.getRawObject().clearWarnings(); } @Override public void statement_setCursorName(StatementProxy statement, String name) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_setCursorName(this, statement, name); return; } statement.getRawObject().setCursorName(name); } @Override public boolean statement_execute(StatementProxy statement, String sql) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_execute(this, statement, sql); } return statement.getRawObject().execute(sql); } @Override public ResultSetProxy statement_getResultSet(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getResultSet(this, statement); } ResultSet resultSet = statement.getRawObject().getResultSet(); if (resultSet == null) { return null; } return new ResultSetProxyImpl(statement, resultSet, dataSource.createResultSetId(), statement.getLastExecuteSql()); } @Override public int statement_getUpdateCount(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getUpdateCount(this, statement); } return statement.getRawObject().getUpdateCount(); } @Override public boolean statement_getMoreResults(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getMoreResults(this, statement); } return statement.getRawObject().getMoreResults(); } @Override public void statement_setFetchDirection(StatementProxy statement, int direction) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_setFetchDirection(this, statement, direction); return; } statement.getRawObject().setFetchDirection(direction); } @Override public int statement_getFetchDirection(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getFetchDirection(this, statement); } return statement.getRawObject().getFetchDirection(); } @Override public void statement_setFetchSize(StatementProxy statement, int rows) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_setFetchSize(this, statement, rows); return; } statement.getRawObject().setFetchSize(rows); } @Override public int statement_getFetchSize(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getFetchSize(this, statement); } return statement.getRawObject().getFetchSize(); } @Override public int statement_getResultSetConcurrency(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getResultSetConcurrency(this, statement); } return statement.getRawObject().getResultSetConcurrency(); } @Override public int statement_getResultSetType(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getResultSetType(this, statement); } return statement.getRawObject().getResultSetType(); } @Override public void statement_addBatch(StatementProxy statement, String sql) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_addBatch(this, statement, sql); return; } statement.getRawObject().addBatch(sql); } @Override public void statement_clearBatch(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_clearBatch(this, statement); return; } statement.getRawObject().clearBatch(); } @Override public int[] statement_executeBatch(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_executeBatch(this, statement); } return statement.getRawObject().executeBatch(); } @Override public Connection statement_getConnection(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getConnection(this, statement); } return statement.getRawObject().getConnection(); } @Override public boolean statement_getMoreResults(StatementProxy statement, int current) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getMoreResults(this, statement, current); } return statement.getRawObject().getMoreResults(current); } @Override public ResultSetProxy statement_getGeneratedKeys(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getGeneratedKeys(this, statement); } ResultSet resultSet = statement.getRawObject().getGeneratedKeys(); if (resultSet == null) { return null; } return new ResultSetProxyImpl(statement, resultSet, dataSource.createResultSetId(), statement.getLastExecuteSql()); } @Override public int statement_executeUpdate(StatementProxy statement, String sql, int autoGeneratedKeys) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_executeUpdate(this, statement, sql, autoGeneratedKeys); } return statement.getRawObject().executeUpdate(sql, autoGeneratedKeys); } @Override public int statement_executeUpdate(StatementProxy statement, String sql, int[] columnIndexes) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_executeUpdate(this, statement, sql, columnIndexes); } return statement.getRawObject().executeUpdate(sql, columnIndexes); } @Override public int statement_executeUpdate(StatementProxy statement, String sql, String[] columnNames) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_executeUpdate(this, statement, sql, columnNames); } return statement.getRawObject().executeUpdate(sql, columnNames); } @Override public boolean statement_execute(StatementProxy statement, String sql, int autoGeneratedKeys) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_execute(this, statement, sql, autoGeneratedKeys); } return statement.getRawObject().execute(sql, autoGeneratedKeys); } @Override public boolean statement_execute(StatementProxy statement, String sql, int[] columnIndexes) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_execute(this, statement, sql, columnIndexes); } return statement.getRawObject().execute(sql, columnIndexes); } @Override public boolean statement_execute(StatementProxy statement, String sql, String[] columnNames) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_execute(this, statement, sql, columnNames); } return statement.getRawObject().execute(sql, columnNames); } @Override public int statement_getResultSetHoldability(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_getResultSetHoldability(this, statement); } return statement.getRawObject().getResultSetHoldability(); } @Override public boolean statement_isClosed(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_isClosed(this, statement); } return statement.getRawObject().isClosed(); } @Override public void statement_setPoolable(StatementProxy statement, boolean poolable) throws SQLException { if (this.pos < filterSize) { nextFilter().statement_setPoolable(this, statement, poolable); return; } statement.getRawObject().setPoolable(poolable); } @Override public boolean statement_isPoolable(StatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().statement_isPoolable(this, statement); } return statement.getRawObject().isPoolable(); } // //////////////// @Override public ResultSetProxy preparedStatement_executeQuery(PreparedStatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().preparedStatement_executeQuery(this, statement); } ResultSet resultSet = statement.getRawObject().executeQuery(); if (resultSet == null) { return null; } return new ResultSetProxyImpl(statement, resultSet, dataSource.createResultSetId(), statement.getLastExecuteSql()); } @Override public int preparedStatement_executeUpdate(PreparedStatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().preparedStatement_executeUpdate(this, statement); } return statement.getRawObject().executeUpdate(); } @Override public void preparedStatement_setNull(PreparedStatementProxy statement, int parameterIndex, int sqlType) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setNull(this, statement, parameterIndex, sqlType); return; } statement.getRawObject().setNull(parameterIndex, sqlType); } @Override public void preparedStatement_setBoolean(PreparedStatementProxy statement, int parameterIndex, boolean x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBoolean(this, statement, parameterIndex, x); return; } statement.getRawObject().setBoolean(parameterIndex, x); } @Override public void preparedStatement_setByte(PreparedStatementProxy statement, int parameterIndex, byte x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setByte(this, statement, parameterIndex, x); return; } statement.getRawObject().setByte(parameterIndex, x); } @Override public void preparedStatement_setShort(PreparedStatementProxy statement, int parameterIndex, short x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setShort(this, statement, parameterIndex, x); return; } statement.getRawObject().setShort(parameterIndex, x); } @Override public void preparedStatement_setInt(PreparedStatementProxy statement, int parameterIndex, int x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setInt(this, statement, parameterIndex, x); return; } statement.getRawObject().setInt(parameterIndex, x); } @Override public void preparedStatement_setLong(PreparedStatementProxy statement, int parameterIndex, long x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setLong(this, statement, parameterIndex, x); return; } statement.getRawObject().setLong(parameterIndex, x); } @Override public void preparedStatement_setFloat(PreparedStatementProxy statement, int parameterIndex, float x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setFloat(this, statement, parameterIndex, x); return; } statement.getRawObject().setFloat(parameterIndex, x); } @Override public void preparedStatement_setDouble(PreparedStatementProxy statement, int parameterIndex, double x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setDouble(this, statement, parameterIndex, x); return; } statement.getRawObject().setDouble(parameterIndex, x); } @Override public void preparedStatement_setBigDecimal(PreparedStatementProxy statement, int parameterIndex, BigDecimal x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBigDecimal(this, statement, parameterIndex, x); return; } statement.getRawObject().setBigDecimal(parameterIndex, x); } @Override public void preparedStatement_setString(PreparedStatementProxy statement, int parameterIndex, String x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setString(this, statement, parameterIndex, x); return; } statement.getRawObject().setString(parameterIndex, x); } @Override public void preparedStatement_setBytes(PreparedStatementProxy statement, int parameterIndex, byte[] x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBytes(this, statement, parameterIndex, x); return; } statement.getRawObject().setBytes(parameterIndex, x); } @Override public void preparedStatement_setDate(PreparedStatementProxy statement, int parameterIndex, java.sql.Date x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setDate(this, statement, parameterIndex, x); return; } statement.getRawObject().setDate(parameterIndex, x); } @Override public void preparedStatement_setTime(PreparedStatementProxy statement, int parameterIndex, java.sql.Time x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setTime(this, statement, parameterIndex, x); return; } statement.getRawObject().setTime(parameterIndex, x); } @Override public void preparedStatement_setTimestamp(PreparedStatementProxy statement, int parameterIndex, java.sql.Timestamp x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setTimestamp(this, statement, parameterIndex, x); return; } statement.getRawObject().setTimestamp(parameterIndex, x); } @Override public void preparedStatement_setAsciiStream(PreparedStatementProxy statement, int parameterIndex, java.io.InputStream x, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setAsciiStream(this, statement, parameterIndex, x, length); return; } statement.getRawObject().setAsciiStream(parameterIndex, x, length); } @SuppressWarnings("deprecation") @Override public void preparedStatement_setUnicodeStream(PreparedStatementProxy statement, int parameterIndex, java.io.InputStream x, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setUnicodeStream(this, statement, parameterIndex, x, length); return; } statement.getRawObject().setUnicodeStream(parameterIndex, x, length); } @Override public void preparedStatement_setBinaryStream(PreparedStatementProxy statement, int parameterIndex, java.io.InputStream x, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBinaryStream(this, statement, parameterIndex, x, length); return; } statement.getRawObject().setBinaryStream(parameterIndex, x, length); } @Override public void preparedStatement_clearParameters(PreparedStatementProxy statement) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_clearParameters(this, statement); return; } statement.getRawObject().clearParameters(); } @Override public void preparedStatement_setObject(PreparedStatementProxy statement, int parameterIndex, Object x, int targetSqlType) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setObject(this, statement, parameterIndex, x, targetSqlType); return; } statement.getRawObject().setObject(parameterIndex, x, targetSqlType); } @Override public void preparedStatement_setObject(PreparedStatementProxy statement, int parameterIndex, Object x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setObject(this, statement, parameterIndex, x); return; } statement.getRawObject().setObject(parameterIndex, x); } @Override public boolean preparedStatement_execute(PreparedStatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().preparedStatement_execute(this, statement); } return statement.getRawObject().execute(); } @Override public void preparedStatement_addBatch(PreparedStatementProxy statement) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_addBatch(this, statement); return; } statement.getRawObject().addBatch(); } @Override public void preparedStatement_setCharacterStream(PreparedStatementProxy statement, int parameterIndex, java.io.Reader reader, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setCharacterStream(this, statement, parameterIndex, reader, length); return; } statement.getRawObject().setCharacterStream(parameterIndex, reader, length); } @Override public void preparedStatement_setRef(PreparedStatementProxy statement, int parameterIndex, Ref x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setRef(this, statement, parameterIndex, x); return; } statement.getRawObject().setRef(parameterIndex, x); } @Override public void preparedStatement_setBlob(PreparedStatementProxy statement, int parameterIndex, Blob x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBlob(this, statement, parameterIndex, x); return; } statement.getRawObject() .setBlob(parameterIndex, x); } @Override public void preparedStatement_setClob(PreparedStatementProxy statement, int parameterIndex, Clob x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setClob(this, statement, parameterIndex, x); return; } if (x instanceof ClobProxy) { x = ((ClobProxy) x).getRawClob(); } statement.getRawObject() .setClob(parameterIndex, x); } @Override public void preparedStatement_setArray(PreparedStatementProxy statement, int parameterIndex, Array x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setArray(this, statement, parameterIndex, x); return; } statement.getRawObject().setArray(parameterIndex, x); } @Override public ResultSetMetaData preparedStatement_getMetaData(PreparedStatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().preparedStatement_getMetaData(this, statement); } return statement.getRawObject().getMetaData(); } @Override public void preparedStatement_setDate(PreparedStatementProxy statement, int parameterIndex, java.sql.Date x, Calendar cal) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setDate(this, statement, parameterIndex, x, cal); return; } statement.getRawObject().setDate(parameterIndex, x, cal); } @Override public void preparedStatement_setTime(PreparedStatementProxy statement, int parameterIndex, java.sql.Time x, Calendar cal) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setTime(this, statement, parameterIndex, x, cal); return; } statement.getRawObject().setTime(parameterIndex, x, cal); } @Override public void preparedStatement_setTimestamp(PreparedStatementProxy statement, int parameterIndex, java.sql.Timestamp x, Calendar cal) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setTimestamp(this, statement, parameterIndex, x, cal); return; } statement.getRawObject().setTimestamp(parameterIndex, x, cal); } @Override public void preparedStatement_setNull(PreparedStatementProxy statement, int parameterIndex, int sqlType, String typeName) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setNull(this, statement, parameterIndex, sqlType, typeName); return; } statement.getRawObject().setNull(parameterIndex, sqlType, typeName); } @Override public void preparedStatement_setURL(PreparedStatementProxy statement, int parameterIndex, java.net.URL x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setURL(this, statement, parameterIndex, x); return; } statement.getRawObject().setURL(parameterIndex, x); } @Override public ParameterMetaData preparedStatement_getParameterMetaData(PreparedStatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().preparedStatement_getParameterMetaData(this, statement); } return statement.getRawObject().getParameterMetaData(); } @Override public void preparedStatement_setRowId(PreparedStatementProxy statement, int parameterIndex, RowId x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setRowId(this, statement, parameterIndex, x); return; } statement.getRawObject().setRowId(parameterIndex, x); } @Override public void preparedStatement_setNString(PreparedStatementProxy statement, int parameterIndex, String value) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setNString(this, statement, parameterIndex, value); return; } statement.getRawObject().setNString(parameterIndex, value); } @Override public void preparedStatement_setNCharacterStream(PreparedStatementProxy statement, int parameterIndex, Reader value, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setNCharacterStream(this, statement, parameterIndex, value, length); return; } statement.getRawObject().setNCharacterStream(parameterIndex, value, length); } @Override public void preparedStatement_setNClob(PreparedStatementProxy statement, int parameterIndex, NClob x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setNClob(this, statement, parameterIndex, x); return; } if (x instanceof NClobProxy) { x = ((NClobProxy) x).getRawNClob(); } statement.getRawObject() .setNClob(parameterIndex, x); } @Override public void preparedStatement_setClob(PreparedStatementProxy statement, int parameterIndex, Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setClob(this, statement, parameterIndex, reader, length); return; } statement.getRawObject().setClob(parameterIndex, reader, length); } @Override public void preparedStatement_setBlob(PreparedStatementProxy statement, int parameterIndex, InputStream inputStream, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBlob(this, statement, parameterIndex, inputStream, length); return; } statement.getRawObject().setBlob(parameterIndex, inputStream, length); } @Override public void preparedStatement_setNClob(PreparedStatementProxy statement, int parameterIndex, Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setNClob(this, statement, parameterIndex, reader, length); return; } statement.getRawObject().setNClob(parameterIndex, reader, length); } @Override public void preparedStatement_setSQLXML(PreparedStatementProxy statement, int parameterIndex, SQLXML xmlObject) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setSQLXML(this, statement, parameterIndex, xmlObject); return; } statement.getRawObject().setSQLXML(parameterIndex, xmlObject); } @Override public void preparedStatement_setObject(PreparedStatementProxy statement, int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setObject(this, statement, parameterIndex, x, targetSqlType, scaleOrLength); return; } statement.getRawObject().setObject(parameterIndex, x, targetSqlType, scaleOrLength); } @Override public void preparedStatement_setAsciiStream(PreparedStatementProxy statement, int parameterIndex, java.io.InputStream x, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setAsciiStream(this, statement, parameterIndex, x, length); return; } statement.getRawObject().setAsciiStream(parameterIndex, x, length); } @Override public void preparedStatement_setBinaryStream(PreparedStatementProxy statement, int parameterIndex, java.io.InputStream x, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBinaryStream(this, statement, parameterIndex, x, length); return; } statement.getRawObject().setBinaryStream(parameterIndex, x, length); } @Override public void preparedStatement_setCharacterStream(PreparedStatementProxy statement, int parameterIndex, java.io.Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setCharacterStream(this, statement, parameterIndex, reader, length); return; } statement.getRawObject().setCharacterStream(parameterIndex, reader, length); } @Override public void preparedStatement_setAsciiStream(PreparedStatementProxy statement, int parameterIndex, java.io.InputStream x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setAsciiStream(this, statement, parameterIndex, x); return; } statement.getRawObject().setAsciiStream(parameterIndex, x); } @Override public void preparedStatement_setBinaryStream(PreparedStatementProxy statement, int parameterIndex, java.io.InputStream x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBinaryStream(this, statement, parameterIndex, x); return; } statement.getRawObject().setBinaryStream(parameterIndex, x); } @Override public void preparedStatement_setCharacterStream(PreparedStatementProxy statement, int parameterIndex, java.io.Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setCharacterStream(this, statement, parameterIndex, reader); return; } statement.getRawObject().setCharacterStream(parameterIndex, reader); } @Override public void preparedStatement_setNCharacterStream(PreparedStatementProxy statement, int parameterIndex, Reader value) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setNCharacterStream(this, statement, parameterIndex, value); return; } statement.getRawObject().setNCharacterStream(parameterIndex, value); } @Override public void preparedStatement_setClob(PreparedStatementProxy statement, int parameterIndex, Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setClob(this, statement, parameterIndex, reader); return; } statement.getRawObject().setClob(parameterIndex, reader); } @Override public void preparedStatement_setBlob(PreparedStatementProxy statement, int parameterIndex, InputStream inputStream) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBlob(this, statement, parameterIndex, inputStream); return; } statement.getRawObject().setBlob(parameterIndex, inputStream); } @Override public void preparedStatement_setNClob(PreparedStatementProxy statement, int parameterIndex, Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setNClob(this, statement, parameterIndex, reader); return; } statement.getRawObject().setNClob(parameterIndex, reader); } // ///////////////////////////////////// @Override public void callableStatement_registerOutParameter(CallableStatementProxy statement, int parameterIndex, int sqlType) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_registerOutParameter(this, statement, parameterIndex, sqlType); return; } statement.getRawObject().registerOutParameter(parameterIndex, sqlType); } @Override public void callableStatement_registerOutParameter(CallableStatementProxy statement, int parameterIndex, int sqlType, int scale) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_registerOutParameter(this, statement, parameterIndex, sqlType, scale); return; } statement.getRawObject().registerOutParameter(parameterIndex, sqlType, scale); } @Override public boolean callableStatement_wasNull(CallableStatementProxy statement) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_wasNull(this, statement); } return statement.getRawObject().wasNull(); } @Override public String callableStatement_getString(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getString(this, statement, parameterIndex); } return statement.getRawObject().getString(parameterIndex); } @Override public boolean callableStatement_getBoolean(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getBoolean(this, statement, parameterIndex); } return statement.getRawObject().getBoolean(parameterIndex); } @Override public byte callableStatement_getByte(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getByte(this, statement, parameterIndex); } return statement.getRawObject().getByte(parameterIndex); } @Override public short callableStatement_getShort(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getShort(this, statement, parameterIndex); } return statement.getRawObject().getShort(parameterIndex); } @Override public int callableStatement_getInt(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getInt(this, statement, parameterIndex); } return statement.getRawObject().getInt(parameterIndex); } @Override public long callableStatement_getLong(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getLong(this, statement, parameterIndex); } return statement.getRawObject().getLong(parameterIndex); } @Override public float callableStatement_getFloat(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getFloat(this, statement, parameterIndex); } return statement.getRawObject().getFloat(parameterIndex); } @Override public double callableStatement_getDouble(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getDouble(this, statement, parameterIndex); } return statement.getRawObject().getDouble(parameterIndex); } @SuppressWarnings("deprecation") @Override public BigDecimal callableStatement_getBigDecimal(CallableStatementProxy statement, int parameterIndex, int scale) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getBigDecimal(this, statement, parameterIndex, scale); } return statement.getRawObject().getBigDecimal(parameterIndex, scale); } @Override public byte[] callableStatement_getBytes(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getBytes(this, statement, parameterIndex); } return statement.getRawObject().getBytes(parameterIndex); } @Override public java.sql.Date callableStatement_getDate(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getDate(this, statement, parameterIndex); } return statement.getRawObject().getDate(parameterIndex); } @Override public java.sql.Time callableStatement_getTime(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getTime(this, statement, parameterIndex); } return statement.getRawObject().getTime(parameterIndex); } @Override public java.sql.Timestamp callableStatement_getTimestamp(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getTimestamp(this, statement, parameterIndex); } return statement.getRawObject().getTimestamp(parameterIndex); } @Override public Object callableStatement_getObject(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getObject(this, statement, parameterIndex); } Object obj = statement.getRawObject().getObject(parameterIndex); if (obj instanceof ResultSet) { return new ResultSetProxyImpl(statement, (ResultSet) obj, dataSource.createResultSetId(), statement.getLastExecuteSql()); } if (obj instanceof Clob) { return wrap(statement, (Clob) obj); } return obj; } @Override public Object callableStatement_getObject(CallableStatementProxy statement, int parameterIndex, java.util.Map<String, Class<?>> map) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getObject(this, statement, parameterIndex, map); } Object obj = statement.getRawObject().getObject(parameterIndex, map); if (obj instanceof ResultSet) { return new ResultSetProxyImpl(statement, (ResultSet) obj, dataSource.createResultSetId(), statement.getLastExecuteSql()); } if (obj instanceof Clob) { return wrap(statement, (Clob) obj); } return obj; } @Override public Object callableStatement_getObject(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getObject(this, statement, parameterName); } Object obj = statement.getRawObject().getObject(parameterName); if (obj instanceof ResultSet) { return new ResultSetProxyImpl(statement, (ResultSet) obj, dataSource.createResultSetId(), statement.getLastExecuteSql()); } if (obj instanceof Clob) { return wrap(statement, (Clob) obj); } return obj; } @Override public Object callableStatement_getObject(CallableStatementProxy statement, String parameterName, java.util.Map<String, Class<?>> map) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getObject(this, statement, parameterName, map); } Object obj = statement.getRawObject().getObject(parameterName, map); if (obj instanceof ResultSet) { return new ResultSetProxyImpl(statement, (ResultSet) obj, dataSource.createResultSetId(), statement.getLastExecuteSql()); } if (obj instanceof Clob) { return wrap(statement, (Clob) obj); } return obj; } @Override public BigDecimal callableStatement_getBigDecimal(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getBigDecimal(this, statement, parameterIndex); } return statement.getRawObject().getBigDecimal(parameterIndex); } @Override public Ref callableStatement_getRef(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getRef(this, statement, parameterIndex); } return statement.getRawObject().getRef(parameterIndex); } @Override public Blob callableStatement_getBlob(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getBlob(this, statement, parameterIndex); } return statement.getRawObject().getBlob(parameterIndex); } @Override public Clob callableStatement_getClob(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getClob(this, statement, parameterIndex); } Clob clob = statement.getRawObject() .getClob(parameterIndex); return wrap(statement, clob); } @Override public Array callableStatement_getArray(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getArray(this, statement, parameterIndex); } return statement.getRawObject().getArray(parameterIndex); } @Override public java.sql.Date callableStatement_getDate(CallableStatementProxy statement, int parameterIndex, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getDate(this, statement, parameterIndex, cal); } return statement.getRawObject().getDate(parameterIndex, cal); } @Override public java.sql.Time callableStatement_getTime(CallableStatementProxy statement, int parameterIndex, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getTime(this, statement, parameterIndex, cal); } return statement.getRawObject().getTime(parameterIndex, cal); } @Override public java.sql.Timestamp callableStatement_getTimestamp(CallableStatementProxy statement, int parameterIndex, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getTimestamp(this, statement, parameterIndex, cal); } return statement.getRawObject().getTimestamp(parameterIndex, cal); } @Override public void callableStatement_registerOutParameter(CallableStatementProxy statement, int parameterIndex, int sqlType, String typeName) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_registerOutParameter(this, statement, parameterIndex, sqlType, typeName); return; } statement.getRawObject().registerOutParameter(parameterIndex, sqlType, typeName); } @Override public void callableStatement_registerOutParameter(CallableStatementProxy statement, String parameterName, int sqlType) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_registerOutParameter(this, statement, parameterName, sqlType); return; } statement.getRawObject().registerOutParameter(parameterName, sqlType); } @Override public void callableStatement_registerOutParameter(CallableStatementProxy statement, String parameterName, int sqlType, int scale) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_registerOutParameter(this, statement, parameterName, sqlType, scale); return; } statement.getRawObject().registerOutParameter(parameterName, sqlType, scale); } @Override public void callableStatement_registerOutParameter(CallableStatementProxy statement, String parameterName, int sqlType, String typeName) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_registerOutParameter(this, statement, parameterName, sqlType, typeName); return; } statement.getRawObject().registerOutParameter(parameterName, sqlType, typeName); } @Override public java.net.URL callableStatement_getURL(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getURL(this, statement, parameterIndex); } return statement.getRawObject().getURL(parameterIndex); } @Override public void callableStatement_setURL(CallableStatementProxy statement, String parameterName, java.net.URL val) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setURL(this, statement, parameterName, val); return; } statement.getRawObject().setURL(parameterName, val); } @Override public void callableStatement_setNull(CallableStatementProxy statement, String parameterName, int sqlType) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setNull(this, statement, parameterName, sqlType); return; } statement.getRawObject().setNull(parameterName, sqlType); } @Override public void callableStatement_setBoolean(CallableStatementProxy statement, String parameterName, boolean x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setBoolean(this, statement, parameterName, x); return; } statement.getRawObject().setBoolean(parameterName, x); } @Override public void callableStatement_setByte(CallableStatementProxy statement, String parameterName, byte x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setByte(this, statement, parameterName, x); } statement.getRawObject().setByte(parameterName, x); } @Override public void callableStatement_setShort(CallableStatementProxy statement, String parameterName, short x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setShort(this, statement, parameterName, x); return; } statement.getRawObject().setShort(parameterName, x); } @Override public void callableStatement_setInt(CallableStatementProxy statement, String parameterName, int x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setInt(this, statement, parameterName, x); return; } statement.getRawObject().setInt(parameterName, x); } @Override public void callableStatement_setLong(CallableStatementProxy statement, String parameterName, long x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setLong(this, statement, parameterName, x); return; } statement.getRawObject().setLong(parameterName, x); } @Override public void callableStatement_setFloat(CallableStatementProxy statement, String parameterName, float x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setFloat(this, statement, parameterName, x); return; } statement.getRawObject().setFloat(parameterName, x); } @Override public void callableStatement_setDouble(CallableStatementProxy statement, String parameterName, double x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setDouble(this, statement, parameterName, x); return; } statement.getRawObject().setDouble(parameterName, x); } @Override public void callableStatement_setBigDecimal(CallableStatementProxy statement, String parameterName, BigDecimal x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setBigDecimal(this, statement, parameterName, x); return; } statement.getRawObject().setBigDecimal(parameterName, x); } @Override public void callableStatement_setString(CallableStatementProxy statement, String parameterName, String x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setString(this, statement, parameterName, x); return; } statement.getRawObject().setString(parameterName, x); } @Override public void callableStatement_setBytes(CallableStatementProxy statement, String parameterName, byte[] x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setBytes(this, statement, parameterName, x); return; } statement.getRawObject().setBytes(parameterName, x); } @Override public void callableStatement_setDate(CallableStatementProxy statement, String parameterName, java.sql.Date x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setDate(this, statement, parameterName, x); return; } statement.getRawObject().setDate(parameterName, x); } @Override public void callableStatement_setTime(CallableStatementProxy statement, String parameterName, java.sql.Time x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setTime(this, statement, parameterName, x); return; } statement.getRawObject().setTime(parameterName, x); } @Override public void callableStatement_setTimestamp(CallableStatementProxy statement, String parameterName, java.sql.Timestamp x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setTimestamp(this, statement, parameterName, x); return; } statement.getRawObject().setTimestamp(parameterName, x); } @Override public void callableStatement_setAsciiStream(CallableStatementProxy statement, String parameterName, java.io.InputStream x, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setAsciiStream(this, statement, parameterName, x, length); return; } statement.getRawObject().setAsciiStream(parameterName, x, length); } @Override public void callableStatement_setBinaryStream(CallableStatementProxy statement, String parameterName, java.io.InputStream x, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setBinaryStream(this, statement, parameterName, x, length); return; } statement.getRawObject().setBinaryStream(parameterName, x, length); } @Override public void callableStatement_setObject(CallableStatementProxy statement, String parameterName, Object x, int targetSqlType, int scale) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setObject(this, statement, parameterName, x, targetSqlType, scale); return; } statement.getRawObject().setObject(parameterName, x, targetSqlType, scale); } @Override public void callableStatement_setObject(CallableStatementProxy statement, String parameterName, Object x, int targetSqlType) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setObject(this, statement, parameterName, x, targetSqlType); return; } statement.getRawObject().setObject(parameterName, x, targetSqlType); } @Override public void callableStatement_setObject(CallableStatementProxy statement, String parameterName, Object x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setObject(this, statement, parameterName, x); return; } statement.getRawObject().setObject(parameterName, x); } @Override public void callableStatement_setCharacterStream(CallableStatementProxy statement, String parameterName, java.io.Reader reader, int length) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setCharacterStream(this, statement, parameterName, reader, length); return; } statement.getRawObject().setCharacterStream(parameterName, reader, length); } @Override public void callableStatement_setDate(CallableStatementProxy statement, String parameterName, java.sql.Date x, Calendar cal) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setDate(this, statement, parameterName, x, cal); return; } statement.getRawObject().setDate(parameterName, x, cal); } @Override public void callableStatement_setTime(CallableStatementProxy statement, String parameterName, java.sql.Time x, Calendar cal) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setTime(this, statement, parameterName, x, cal); return; } statement.getRawObject().setTime(parameterName, x, cal); } @Override public void callableStatement_setTimestamp(CallableStatementProxy statement, String parameterName, java.sql.Timestamp x, Calendar cal) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setTimestamp(this, statement, parameterName, x, cal); return; } statement.getRawObject().setTimestamp(parameterName, x, cal); } @Override public void callableStatement_setNull(CallableStatementProxy statement, String parameterName, int sqlType, String typeName) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setNull(this, statement, parameterName, sqlType, typeName); return; } statement.getRawObject().setNull(parameterName, sqlType, typeName); } @Override public String callableStatement_getString(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getString(this, statement, parameterName); } return statement.getRawObject().getString(parameterName); } @Override public boolean callableStatement_getBoolean(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getBoolean(this, statement, parameterName); } return statement.getRawObject().getBoolean(parameterName); } @Override public byte callableStatement_getByte(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getByte(this, statement, parameterName); } return statement.getRawObject().getByte(parameterName); } @Override public short callableStatement_getShort(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getShort(this, statement, parameterName); } return statement.getRawObject().getShort(parameterName); } @Override public int callableStatement_getInt(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getInt(this, statement, parameterName); } return statement.getRawObject().getInt(parameterName); } @Override public long callableStatement_getLong(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getLong(this, statement, parameterName); } return statement.getRawObject().getLong(parameterName); } @Override public float callableStatement_getFloat(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getFloat(this, statement, parameterName); } return statement.getRawObject().getFloat(parameterName); } @Override public double callableStatement_getDouble(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getDouble(this, statement, parameterName); } return statement.getRawObject().getDouble(parameterName); } @Override public byte[] callableStatement_getBytes(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getBytes(this, statement, parameterName); } return statement.getRawObject().getBytes(parameterName); } @Override public java.sql.Date callableStatement_getDate(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getDate(this, statement, parameterName); } return statement.getRawObject().getDate(parameterName); } @Override public java.sql.Time callableStatement_getTime(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getTime(this, statement, parameterName); } return statement.getRawObject().getTime(parameterName); } @Override public java.sql.Timestamp callableStatement_getTimestamp(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getTimestamp(this, statement, parameterName); } return statement.getRawObject().getTimestamp(parameterName); } @Override public BigDecimal callableStatement_getBigDecimal(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getBigDecimal(this, statement, parameterName); } return statement.getRawObject().getBigDecimal(parameterName); } @Override public Ref callableStatement_getRef(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getRef(this, statement, parameterName); } return statement.getRawObject().getRef(parameterName); } @Override public Blob callableStatement_getBlob(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getBlob(this, statement, parameterName); } return statement.getRawObject().getBlob(parameterName); } @Override public Clob callableStatement_getClob(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getClob(this, statement, parameterName); } Clob clob = statement.getRawObject() .getClob(parameterName); return wrap(statement, clob); } @Override public Array callableStatement_getArray(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getArray(this, statement, parameterName); } return statement.getRawObject().getArray(parameterName); } @Override public java.sql.Date callableStatement_getDate(CallableStatementProxy statement, String parameterName, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getDate(this, statement, parameterName, cal); } return statement.getRawObject().getDate(parameterName, cal); } @Override public java.sql.Time callableStatement_getTime(CallableStatementProxy statement, String parameterName, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getTime(this, statement, parameterName, cal); } return statement.getRawObject().getTime(parameterName, cal); } @Override public java.sql.Timestamp callableStatement_getTimestamp(CallableStatementProxy statement, String parameterName, Calendar cal) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getTimestamp(this, statement, parameterName, cal); } return statement.getRawObject().getTimestamp(parameterName, cal); } @Override public java.net.URL callableStatement_getURL(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getURL(this, statement, parameterName); } return statement.getRawObject().getURL(parameterName); } @Override public RowId callableStatement_getRowId(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getRowId(this, statement, parameterIndex); } return statement.getRawObject().getRowId(parameterIndex); } @Override public RowId callableStatement_getRowId(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getRowId(this, statement, parameterName); } return statement.getRawObject().getRowId(parameterName); } @Override public void callableStatement_setRowId(CallableStatementProxy statement, String parameterName, RowId x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setRowId(this, statement, parameterName, x); return; } statement.getRawObject().setRowId(parameterName, x); } @Override public void callableStatement_setNString(CallableStatementProxy statement, String parameterName, String value) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setNString(this, statement, parameterName, value); return; } statement.getRawObject().setNString(parameterName, value); } @Override public void callableStatement_setNCharacterStream(CallableStatementProxy statement, String parameterName, Reader value, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setNCharacterStream(this, statement, parameterName, value, length); return; } statement.getRawObject().setNCharacterStream(parameterName, value, length); } @Override public void callableStatement_setNClob(CallableStatementProxy statement, String parameterName, NClob x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setNClob(this, statement, parameterName, x); return; } if (x instanceof NClobProxy) { x = ((NClobProxy) x).getRawNClob(); } statement.getRawObject() .setNClob(parameterName, x); } @Override public void callableStatement_setClob(CallableStatementProxy statement, String parameterName, Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setClob(this, statement, parameterName, reader, length); return; } statement.getRawObject().setClob(parameterName, reader, length); } @Override public void callableStatement_setBlob(CallableStatementProxy statement, String parameterName, InputStream inputStream, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setBlob(this, statement, parameterName, inputStream, length); return; } statement.getRawObject().setBlob(parameterName, inputStream, length); } @Override public void callableStatement_setNClob(CallableStatementProxy statement, String parameterName, Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setNClob(this, statement, parameterName, reader, length); return; } statement.getRawObject().setNClob(parameterName, reader, length); } @Override public NClob callableStatement_getNClob(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getNClob(this, statement, parameterIndex); } NClob nclob = statement.getRawObject() .getNClob(parameterIndex); return wrap(statement.getConnectionProxy(), nclob); } @Override public NClob callableStatement_getNClob(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getNClob(this, statement, parameterName); } NClob nclob = statement.getRawObject() .getNClob(parameterName); return wrap(statement.getConnectionProxy(), nclob); } @Override public void callableStatement_setSQLXML(CallableStatementProxy statement, String parameterName, SQLXML xmlObject) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setSQLXML(this, statement, parameterName, xmlObject); return; } statement.getRawObject().setSQLXML(parameterName, xmlObject); } @Override public SQLXML callableStatement_getSQLXML(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getSQLXML(this, statement, parameterIndex); } return statement.getRawObject().getSQLXML(parameterIndex); } @Override public SQLXML callableStatement_getSQLXML(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getSQLXML(this, statement, parameterName); } return statement.getRawObject().getSQLXML(parameterName); } @Override public String callableStatement_getNString(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getNString(this, statement, parameterIndex); } return statement.getRawObject().getNString(parameterIndex); } @Override public String callableStatement_getNString(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getNString(this, statement, parameterName); } return statement.getRawObject().getNString(parameterName); } @Override public java.io.Reader callableStatement_getNCharacterStream(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getNCharacterStream(this, statement, parameterIndex); } return statement.getRawObject().getNCharacterStream(parameterIndex); } @Override public java.io.Reader callableStatement_getNCharacterStream(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getNCharacterStream(this, statement, parameterName); } return statement.getRawObject().getNCharacterStream(parameterName); } @Override public java.io.Reader callableStatement_getCharacterStream(CallableStatementProxy statement, int parameterIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getCharacterStream(this, statement, parameterIndex); } return statement.getRawObject().getCharacterStream(parameterIndex); } @Override public java.io.Reader callableStatement_getCharacterStream(CallableStatementProxy statement, String parameterName) throws SQLException { if (this.pos < filterSize) { return nextFilter().callableStatement_getCharacterStream(this, statement, parameterName); } return statement.getRawObject().getCharacterStream(parameterName); } @Override public void callableStatement_setBlob(CallableStatementProxy statement, String parameterName, Blob x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setBlob(this, statement, parameterName, x); return; } statement.getRawObject().setBlob(parameterName, x); } @Override public void callableStatement_setClob(CallableStatementProxy statement, String parameterName, Clob x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setClob(this, statement, parameterName, x); return; } if (x instanceof ClobProxy) { x = ((ClobProxy) x).getRawClob(); } statement.getRawObject() .setClob(parameterName, x); } @Override public void callableStatement_setAsciiStream(CallableStatementProxy statement, String parameterName, java.io.InputStream x, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setAsciiStream(this, statement, parameterName, x, length); return; } statement.getRawObject().setAsciiStream(parameterName, x, length); } @Override public void callableStatement_setBinaryStream(CallableStatementProxy statement, String parameterName, java.io.InputStream x, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setBinaryStream(this, statement, parameterName, x, length); return; } statement.getRawObject().setBinaryStream(parameterName, x, length); } @Override public void callableStatement_setCharacterStream(CallableStatementProxy statement, String parameterName, java.io.Reader reader, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setCharacterStream(this, statement, parameterName, reader, length); return; } statement.getRawObject().setCharacterStream(parameterName, reader, length); } @Override public void callableStatement_setAsciiStream(CallableStatementProxy statement, String parameterName, java.io.InputStream x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setAsciiStream(this, statement, parameterName, x); return; } statement.getRawObject().setAsciiStream(parameterName, x); } @Override public void callableStatement_setBinaryStream(CallableStatementProxy statement, String parameterName, java.io.InputStream x) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setBinaryStream(this, statement, parameterName, x); return; } statement.getRawObject().setBinaryStream(parameterName, x); } @Override public void callableStatement_setCharacterStream(CallableStatementProxy statement, String parameterName, java.io.Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setCharacterStream(this, statement, parameterName, reader); return; } statement.getRawObject().setCharacterStream(parameterName, reader); } @Override public void callableStatement_setNCharacterStream(CallableStatementProxy statement, String parameterName, Reader value) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setNCharacterStream(this, statement, parameterName, value); return; } statement.getRawObject().setNCharacterStream(parameterName, value); } @Override public void callableStatement_setClob(CallableStatementProxy statement, String parameterName, Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setClob(this, statement, parameterName, reader); return; } statement.getRawObject().setClob(parameterName, reader); } @Override public void callableStatement_setBlob(CallableStatementProxy statement, String parameterName, InputStream inputStream) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setBlob(this, statement, parameterName, inputStream); return; } statement.getRawObject().setBlob(parameterName, inputStream); } @Override public void callableStatement_setNClob(CallableStatementProxy statement, String parameterName, Reader reader) throws SQLException { if (this.pos < filterSize) { nextFilter().callableStatement_setNClob(this, statement, parameterName, reader); return; } statement.getRawObject().setNClob(parameterName, reader); } @Override public long clob_length(ClobProxy clob) throws SQLException { if (this.pos < filterSize) { return nextFilter().clob_length(this, clob); } return clob.getRawClob().length(); } @Override public String clob_getSubString(ClobProxy clob, long pos, int length) throws SQLException { if (this.pos < filterSize) { return nextFilter().clob_getSubString(this, clob, pos, length); } return clob.getRawClob().getSubString(pos, length); } @Override public java.io.Reader clob_getCharacterStream(ClobProxy clob) throws SQLException { if (this.pos < filterSize) { return nextFilter().clob_getCharacterStream(this, clob); } return clob.getRawClob().getCharacterStream(); } @Override public java.io.InputStream clob_getAsciiStream(ClobProxy clob) throws SQLException { if (this.pos < filterSize) { return nextFilter().clob_getAsciiStream(this, clob); } return clob.getRawClob().getAsciiStream(); } @Override public long clob_position(ClobProxy clob, String searchstr, long start) throws SQLException { if (this.pos < filterSize) { return nextFilter().clob_position(this, clob, searchstr, start); } return clob.getRawClob().position(searchstr, start); } @Override public long clob_position(ClobProxy clob, Clob searchstr, long start) throws SQLException { if (this.pos < filterSize) { return nextFilter().clob_position(this, clob, searchstr, start); } return clob.getRawClob().position(searchstr, start); } @Override public int clob_setString(ClobProxy clob, long pos, String str) throws SQLException { if (this.pos < filterSize) { return nextFilter().clob_setString(this, clob, pos, str); } return clob.getRawClob().setString(pos, str); } @Override public int clob_setString(ClobProxy clob, long pos, String str, int offset, int len) throws SQLException { if (this.pos < filterSize) { return nextFilter().clob_setString(this, clob, pos, str, offset, len); } return clob.getRawClob().setString(pos, str, offset, len); } @Override public java.io.OutputStream clob_setAsciiStream(ClobProxy clob, long pos) throws SQLException { if (this.pos < filterSize) { return nextFilter().clob_setAsciiStream(this, clob, pos); } return clob.getRawClob().setAsciiStream(pos); } @Override public java.io.Writer clob_setCharacterStream(ClobProxy clob, long pos) throws SQLException { if (this.pos < filterSize) { return nextFilter().clob_setCharacterStream(this, clob, pos); } return clob.getRawClob().setCharacterStream(pos); } @Override public void clob_truncate(ClobProxy clob, long len) throws SQLException { if (this.pos < filterSize) { nextFilter().clob_truncate(this, clob, len); return; } clob.getRawClob().truncate(len); } @Override public void clob_free(ClobProxy clob) throws SQLException { if (this.pos < filterSize) { nextFilter().clob_free(this, clob); return; } clob.getRawClob().free(); } @Override public Reader clob_getCharacterStream(ClobProxy clob, long pos, long length) throws SQLException { if (this.pos < filterSize) { return nextFilter().clob_getCharacterStream(this, clob, pos, length); } return clob.getRawClob().getCharacterStream(pos, length); } // //////////// public ClobProxy wrap(ConnectionProxy conn, Clob clob) { if (clob == null) { return null; } if (clob instanceof NClob) { return wrap(conn, (NClob) clob); } return new ClobProxyImpl(dataSource, conn, clob); } public NClobProxy wrap(ConnectionProxy conn, NClob clob) { if (clob == null) { return null; } return new NClobProxyImpl(dataSource, conn, clob); } public ClobProxy wrap(StatementProxy stmt, Clob clob) { if (clob == null) { return null; } if (clob instanceof NClob) { return wrap(stmt, (NClob) clob); } return new ClobProxyImpl(dataSource, stmt.getConnectionProxy(), clob); } public NClobProxy wrap(StatementProxy stmt, NClob nclob) { if (nclob == null) { return null; } return new NClobProxyImpl(dataSource, stmt.getConnectionProxy(), nclob); } @Override public void dataSource_recycle(DruidPooledConnection connection) throws SQLException { if (this.pos < filterSize) { nextFilter().dataSource_releaseConnection(this, connection); return; } connection.recycle(); } @Override public DruidPooledConnection dataSource_connect(DruidDataSource dataSource, long maxWaitMillis) throws SQLException { if (this.pos < filterSize) { DruidPooledConnection conn = nextFilter().dataSource_getConnection(this, dataSource, maxWaitMillis); return conn; } return dataSource.getConnectionDirect(maxWaitMillis); } @Override public int resultSetMetaData_getColumnCount(ResultSetMetaDataProxy metaData) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_getColumnCount(this, metaData); } return metaData.getResultSetMetaDataRaw().getColumnCount(); } @Override public boolean resultSetMetaData_isAutoIncrement(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_isAutoIncrement(this, metaData, column); } return metaData.getResultSetMetaDataRaw().isAutoIncrement(column); } @Override public boolean resultSetMetaData_isCaseSensitive(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_isCaseSensitive(this, metaData, column); } return metaData.getResultSetMetaDataRaw().isCaseSensitive(column); } @Override public boolean resultSetMetaData_isSearchable(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_isSearchable(this, metaData, column); } return metaData.getResultSetMetaDataRaw().isSearchable(column); } @Override public boolean resultSetMetaData_isCurrency(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_isCurrency(this, metaData, column); } return metaData.getResultSetMetaDataRaw().isCurrency(column); } @Override public int resultSetMetaData_isNullable(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_isNullable(this, metaData, column); } return metaData.getResultSetMetaDataRaw().isNullable(column); } @Override public boolean resultSetMetaData_isSigned(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_isSigned(this, metaData, column); } return metaData.getResultSetMetaDataRaw().isSigned(column); } @Override public int resultSetMetaData_getColumnDisplaySize(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_getColumnDisplaySize(this, metaData, column); } return metaData.getResultSetMetaDataRaw().getColumnDisplaySize(column); } @Override public String resultSetMetaData_getColumnLabel(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_getColumnLabel(this, metaData, column); } return metaData.getResultSetMetaDataRaw().getColumnLabel(column); } @Override public String resultSetMetaData_getColumnName(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_getColumnName(this, metaData, column); } return metaData.getResultSetMetaDataRaw().getColumnName(column); } @Override public String resultSetMetaData_getSchemaName(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_getSchemaName(this, metaData, column); } return metaData.getResultSetMetaDataRaw().getSchemaName(column); } @Override public int resultSetMetaData_getPrecision(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSetMetaData_getPrecision(this, metaData, column); } return metaData.getResultSetMetaDataRaw() .getPrecision(column); } @Override public int resultSetMetaData_getScale(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSetMetaData_getScale(this, metaData, column); } return metaData.getResultSetMetaDataRaw() .getScale(column); } @Override public String resultSetMetaData_getTableName(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSetMetaData_getTableName(this, metaData, column); } return metaData.getResultSetMetaDataRaw() .getTableName(column); } @Override public String resultSetMetaData_getCatalogName(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSetMetaData_getCatalogName(this, metaData, column); } return metaData.getResultSetMetaDataRaw() .getCatalogName(column); } @Override public int resultSetMetaData_getColumnType(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSetMetaData_getColumnType(this, metaData, column); } return metaData.getResultSetMetaDataRaw() .getColumnType(column); } @Override public String resultSetMetaData_getColumnTypeName(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSetMetaData_getColumnTypeName(this, metaData, column); } return metaData.getResultSetMetaDataRaw() .getColumnTypeName(column); } @Override public boolean resultSetMetaData_isReadOnly(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSetMetaData_isReadOnly(this, metaData, column); } return metaData.getResultSetMetaDataRaw() .isReadOnly(column); } @Override public boolean resultSetMetaData_isWritable(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSetMetaData_isWritable(this, metaData, column); } return metaData.getResultSetMetaDataRaw() .isWritable(column); } @Override public boolean resultSetMetaData_isDefinitelyWritable(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSetMetaData_isDefinitelyWritable(this, metaData, column); } return metaData.getResultSetMetaDataRaw() .isDefinitelyWritable(column); } @Override public String resultSetMetaData_getColumnClassName(ResultSetMetaDataProxy metaData, int column) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSetMetaData_getColumnClassName(this, metaData, column); } return metaData.getResultSetMetaDataRaw() .getColumnClassName(column); } }
FilterChainImpl
java
apache__camel
components/camel-jaxb/src/test/java/org/apache/camel/example/InvalidOrderException.java
{ "start": 845, "end": 1047 }
class ____ extends Exception { private static final long serialVersionUID = 383958238537555588L; public InvalidOrderException(String message) { super(message); } }
InvalidOrderException
java
apache__camel
components/camel-jms/src/test/java/org/apache/camel/component/jms/integration/spring/tx/error/JMXTXUseOriginalBodyIT.java
{ "start": 3239, "end": 4201 }
class ____ extends RouteBuilder { @Override public void configure() { onException(Exception.class) .handled(true) .useOriginalMessage() .maximumRedeliveries(2) .to("mock:error"); from("activemq:JMXTXUseOriginalBodyTest.broken") .transacted() .to("mock:checkpoint1") .setBody(method("foo")) .to("mock:checkpoint2") .throwException(new Exception("boo")) .to("mock:end"); from("activemq:JMXTXUseOriginalBodyTest.start") .transacted() .to("mock:checkpoint1") .setBody(constant("oh no")) .to("mock:checkpoint2") .throwException(new Exception("boo")) .to("mock:end"); } } }
TestRoutes
java
grpc__grpc-java
util/src/main/java/io/grpc/util/TransmitStatusRuntimeExceptionInterceptor.java
{ "start": 1859, "end": 3936 }
class ____ implements ServerInterceptor { private TransmitStatusRuntimeExceptionInterceptor() { } public static ServerInterceptor instance() { return new TransmitStatusRuntimeExceptionInterceptor(); } @Override public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall( ServerCall<ReqT, RespT> call, Metadata headers, ServerCallHandler<ReqT, RespT> next) { final ServerCall<ReqT, RespT> serverCall = new SerializingServerCall<>(call); ServerCall.Listener<ReqT> listener = next.startCall(serverCall, headers); return new ForwardingServerCallListener.SimpleForwardingServerCallListener<ReqT>(listener) { @Override public void onMessage(ReqT message) { try { super.onMessage(message); } catch (StatusRuntimeException e) { closeWithException(e); } } @Override public void onHalfClose() { try { super.onHalfClose(); } catch (StatusRuntimeException e) { closeWithException(e); } } @Override public void onCancel() { try { super.onCancel(); } catch (StatusRuntimeException e) { closeWithException(e); } } @Override public void onComplete() { try { super.onComplete(); } catch (StatusRuntimeException e) { closeWithException(e); } } @Override public void onReady() { try { super.onReady(); } catch (StatusRuntimeException e) { closeWithException(e); } } private void closeWithException(StatusRuntimeException t) { Metadata metadata = t.getTrailers(); if (metadata == null) { metadata = new Metadata(); } serverCall.close(t.getStatus(), metadata); } }; } /** * A {@link ServerCall} that wraps around a non thread safe delegate and provides thread safe * access by serializing everything on an executor. */ private static
TransmitStatusRuntimeExceptionInterceptor
java
apache__camel
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HazelcastRingbufferEndpointBuilderFactory.java
{ "start": 5747, "end": 8298 }
interface ____ extends EndpointProducerBuilder { default HazelcastRingbufferEndpointBuilder basic() { return (HazelcastRingbufferEndpointBuilder) this; } /** * Whether the producer should be started lazy (on the first message). * By starting lazy you can use this to allow CamelContext and routes to * startup in situations where a producer may otherwise fail during * starting and cause the route to fail being started. By deferring this * startup to be lazy then the startup failure can be handled during * routing messages via Camel's routing error handlers. Beware that when * the first message is processed then creating and starting the * producer may take a little time and prolong the total processing time * of the processing. * * The option is a: <code>boolean</code> type. * * Default: false * Group: producer (advanced) * * @param lazyStartProducer the value to set * @return the dsl builder */ default AdvancedHazelcastRingbufferEndpointBuilder lazyStartProducer(boolean lazyStartProducer) { doSetProperty("lazyStartProducer", lazyStartProducer); return this; } /** * Whether the producer should be started lazy (on the first message). * By starting lazy you can use this to allow CamelContext and routes to * startup in situations where a producer may otherwise fail during * starting and cause the route to fail being started. By deferring this * startup to be lazy then the startup failure can be handled during * routing messages via Camel's routing error handlers. Beware that when * the first message is processed then creating and starting the * producer may take a little time and prolong the total processing time * of the processing. * * The option will be converted to a <code>boolean</code> type. * * Default: false * Group: producer (advanced) * * @param lazyStartProducer the value to set * @return the dsl builder */ default AdvancedHazelcastRingbufferEndpointBuilder lazyStartProducer(String lazyStartProducer) { doSetProperty("lazyStartProducer", lazyStartProducer); return this; } } public
AdvancedHazelcastRingbufferEndpointBuilder
java
apache__flink
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/TaskManagerRegistrationInformation.java
{ "start": 1084, "end": 2569 }
class ____ implements Serializable { private static final long serialVersionUID = 1767026305134276540L; private final String taskManagerRpcAddress; private final UnresolvedTaskManagerLocation unresolvedTaskManagerLocation; private final UUID taskManagerSession; private TaskManagerRegistrationInformation( String taskManagerRpcAddress, UnresolvedTaskManagerLocation unresolvedTaskManagerLocation, UUID taskManagerSession) { this.taskManagerRpcAddress = Preconditions.checkNotNull(taskManagerRpcAddress); this.unresolvedTaskManagerLocation = Preconditions.checkNotNull(unresolvedTaskManagerLocation); this.taskManagerSession = Preconditions.checkNotNull(taskManagerSession); } public String getTaskManagerRpcAddress() { return taskManagerRpcAddress; } public UnresolvedTaskManagerLocation getUnresolvedTaskManagerLocation() { return unresolvedTaskManagerLocation; } public UUID getTaskManagerSession() { return taskManagerSession; } public static TaskManagerRegistrationInformation create( String taskManagerRpcAddress, UnresolvedTaskManagerLocation unresolvedTaskManagerLocation, UUID taskManagerSession) { return new TaskManagerRegistrationInformation( taskManagerRpcAddress, unresolvedTaskManagerLocation, taskManagerSession); } }
TaskManagerRegistrationInformation
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/type/descriptor/java/AbstractJavaType.java
{ "start": 673, "end": 2603 }
class ____<T> implements BasicJavaType<T>, Serializable { private final Type type; private final MutabilityPlan<T> mutabilityPlan; private final Comparator<T> comparator; /** * Initialize a type descriptor for the given type. Assumed immutable. * * @param type The Java type. * * @see #AbstractJavaType(Type, MutabilityPlan) */ protected AbstractJavaType(Type type) { this( type, ImmutableMutabilityPlan.instance() ); } /** * Initialize a type descriptor for the given type. Assumed immutable. * * @param type The Java type. * @param mutabilityPlan The plan for handling mutability aspects of the java type. */ @SuppressWarnings("unchecked") protected AbstractJavaType(Type type, MutabilityPlan<T> mutabilityPlan) { this.type = type; this.mutabilityPlan = mutabilityPlan; this.comparator = type != null && Comparable.class.isAssignableFrom( getJavaTypeClass() ) ? ComparableComparator.INSTANCE : null; } @Override public MutabilityPlan<T> getMutabilityPlan() { return mutabilityPlan; } @Override public Type getJavaType() { return type; } @Override public int extractHashCode(T value) { return value.hashCode(); } @Override public boolean areEqual(T one, T another) { return Objects.equals( one, another ); } @Override public Comparator<T> getComparator() { return comparator; } @Override public String extractLoggableRepresentation(T value) { return (value == null) ? "null" : value.toString(); } protected HibernateException unknownUnwrap(Class<?> conversionType) { throw new HibernateException( "Unknown unwrap conversion requested: " + type.getTypeName() + " to " + conversionType.getName() ); } protected HibernateException unknownWrap(Class<?> conversionType) { throw new HibernateException( "Unknown wrap conversion requested: " + conversionType.getName() + " to " + type.getTypeName() ); } }
AbstractJavaType
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/AbstractBinder.java
{ "start": 1086, "end": 5409 }
class ____<T> implements Binder<T> { private final LocalXmlResourceResolver xmlResourceResolver; protected AbstractBinder(ResourceStreamLocator resourceStreamLocator) { this.xmlResourceResolver = new LocalXmlResourceResolver( resourceStreamLocator ); } public abstract boolean isValidationEnabled(); @Override public <X extends T> Binding<X> bind(InputStream stream, Origin origin) { final XMLEventReader eventReader = createReader( stream, origin ); try { return doBind( eventReader, origin ); } finally { try { eventReader.close(); } catch (XMLStreamException e) { JAXB_LOGGER.unableToCloseStaxReader( e ); } } } protected XMLEventReader createReader(InputStream stream, Origin origin) { try { // create a standard StAX reader final XMLEventReader staxReader = staxFactory().createXMLEventReader( stream ); // and wrap it in a buffered reader (keeping 100 element sized buffer) return new BufferedXMLEventReader( staxReader, 100 ); } catch ( XMLStreamException e ) { throw new MappingException( "Unable to create StAX reader", e, origin ); } } @Override public <X extends T> Binding<X> bind(Source source, Origin origin) { final XMLEventReader eventReader = createReader( source, origin ); return doBind( eventReader, origin ); } protected XMLEventReader createReader(Source source, Origin origin) { try { // create a standard StAX reader final XMLEventReader staxReader = staxFactory().createXMLEventReader( source ); // and wrap it in a buffered reader (keeping 100 element sized buffer) return new BufferedXMLEventReader( staxReader, 100 ); } catch ( XMLStreamException e ) { throw new MappingException( "Unable to create StAX reader", e, origin ); } } private <X extends T> Binding<X> doBind(XMLEventReader eventReader, Origin origin) { try { final StartElement rootElementStartEvent = seekRootElementStartEvent( eventReader, origin ); return doBind( eventReader, rootElementStartEvent, origin ); } finally { try { eventReader.close(); } catch (Exception e) { JAXB_LOGGER.unableToCloseStaxReader( e ); } } } private XMLInputFactory staxFactory; private XMLInputFactory staxFactory() { if ( staxFactory == null ) { staxFactory = buildStaxFactory(); } return staxFactory; } private XMLInputFactory buildStaxFactory() { XMLInputFactory staxFactory = XMLInputFactory.newInstance(); staxFactory.setXMLResolver( xmlResourceResolver ); return staxFactory; } protected StartElement seekRootElementStartEvent(XMLEventReader staxEventReader, Origin origin) { XMLEvent rootElementStartEvent; try { rootElementStartEvent = staxEventReader.peek(); while ( rootElementStartEvent != null && !rootElementStartEvent.isStartElement() ) { staxEventReader.nextEvent(); rootElementStartEvent = staxEventReader.peek(); } } catch ( Exception e ) { throw new MappingException( "Error accessing StAX stream", e, origin ); } if ( rootElementStartEvent == null ) { throw new MappingException( "Could not locate root element", origin ); } return rootElementStartEvent.asStartElement(); } protected abstract <X extends T> Binding<X> doBind(XMLEventReader staxEventReader, StartElement rootElementStartEvent, Origin origin); @SuppressWarnings("unused") protected static boolean hasNamespace(StartElement startElement) { return StringHelper.isNotEmpty( startElement.getName().getNamespaceURI() ); } protected <X extends T> X jaxb(XMLEventReader reader, Schema xsd, JAXBContext jaxbContext, Origin origin) { final ContextProvidingValidationEventHandler handler = new ContextProvidingValidationEventHandler(); try { final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); if ( isValidationEnabled() ) { unmarshaller.setSchema( xsd ); } else { unmarshaller.setSchema( null ); } unmarshaller.setEventHandler( handler ); //noinspection unchecked return (X) unmarshaller.unmarshal( reader ); } catch ( JAXBException e ) { throw new MappingException( "Unable to perform unmarshalling at line number " + handler.getLineNumber() + " and column " + handler.getColumnNumber() + ". Message: " + handler.getMessage(), e, origin ); } } }
AbstractBinder
java
apache__flink
flink-runtime/src/test/java/org/apache/flink/runtime/state/JavaSerializerUpgradeTest.java
{ "start": 2457, "end": 2835 }
class ____ implements TypeSerializerUpgradeTestBase.PreUpgradeSetup<Serializable> { @Override public TypeSerializer<Serializable> createPriorSerializer() { return new JavaSerializer<>(); } @Override public Serializable createTestData() { return 26; } } /** * This
JavaSerializerSetup
java
google__dagger
javatests/dagger/internal/codegen/ModuleFactoryGeneratorTest.java
{ "start": 17009, "end": 17465 }
class ____ {", " @Inject public String s;", "}"); Source moduleFile = CompilerTests.javaSource( "test.TestModule", "package test;", "", "import dagger.MembersInjector;", "import dagger.Module;", "import dagger.Provides;", "import java.util.Arrays;", "import java.util.List;", "", "@Module", "final
X
java
alibaba__druid
core/src/test/java/com/alibaba/druid/bvt/sql/mysql/createTable/MySqlCreateTableTest116.java
{ "start": 329, "end": 3170 }
class ____ extends MysqlTest { public void test_0() throws Exception { String sql = "CREATE TABLE IF NOT EXISTS `Employee` (\n" + " id int(10)" + " ) broadcast ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin"; MySqlStatementParser parser = new MySqlStatementParser(sql); List<SQLStatement> statementList = parser.parseStatementList(); MySqlCreateTableStatement stmt = (MySqlCreateTableStatement) statementList.get(0); assertEquals(1, statementList.size()); assertEquals("CREATE TABLE IF NOT EXISTS `Employee` (\n" + "\tid int(10)\n" + ") BROADCAST ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_bin", stmt.toString()); } public void test_1() throws Exception { String sql = "CREATE TABLE `t1` (\n" + " `id` int NOT NULL,\n" + " `e_id` varchar(45) COLLATE utf8_bin NOT NULL,\n" + " `m_id` varchar(45) COLLATE utf8_bin NOT NULL,\n" + " `m_id1` varchar(45) COLLATE utf8_bin NOT NULL,\n" + " `m_id2` varchar(45) COLLATE utf8_bin NOT NULL,\n" + " `name` varchar(256) COLLATE utf8_bin DEFAULT NULL,\n" + " `addr` varchar(45) COLLATE utf8_bin DEFAULT NULL,\n" + " PRIMARY KEY (`id`),\n" + " KEY `index_e_id` (`e_id`),\n" + " index `index_m_id` (`m_id`),\n" + " KEY `index_m1_id` (m_id1(10)),\n" + " index `index_m2_id` (m_id2(30))\n" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin"; MySqlStatementParser parser = new MySqlStatementParser(sql); List<SQLStatement> statementList = parser.parseStatementList(); MySqlCreateTableStatement stmt = (MySqlCreateTableStatement) statementList.get(0); assertEquals(1, statementList.size()); assertEquals("CREATE TABLE `t1` (\n" + "\t`id` int NOT NULL,\n" + "\t`e_id` varchar(45) COLLATE utf8_bin NOT NULL,\n" + "\t`m_id` varchar(45) COLLATE utf8_bin NOT NULL,\n" + "\t`m_id1` varchar(45) COLLATE utf8_bin NOT NULL,\n" + "\t`m_id2` varchar(45) COLLATE utf8_bin NOT NULL,\n" + "\t`name` varchar(256) COLLATE utf8_bin DEFAULT NULL,\n" + "\t`addr` varchar(45) COLLATE utf8_bin DEFAULT NULL,\n" + "\tPRIMARY KEY (`id`),\n" + "\tKEY `index_e_id` (`e_id`),\n" + "\tINDEX `index_m_id`(`m_id`),\n" + "\tKEY `index_m1_id` (m_id1(10)),\n" + "\tINDEX `index_m2_id`(m_id2(30))\n" + ") ENGINE = InnoDB CHARSET = utf8 COLLATE = utf8_bin", stmt.toString()); } }
MySqlCreateTableTest116
java
apache__camel
core/camel-core/src/test/java/org/apache/camel/component/validator/ValidatorBeanCallTest.java
{ "start": 2756, "end": 2942 }
class ____ { public InputStream loadFile() throws Exception { return Files.newInputStream(Paths.get("src/test/resources/report.xsd")); } } }
MyValidatorBean
java
quarkusio__quarkus
integration-tests/micrometer-security/src/test/java/io/quarkus/it/micrometer/security/SecuredResourceTest.java
{ "start": 324, "end": 816 }
class ____ { @Test void testMetricsForUnauthorizedRequest() { when().get("/secured/foo") .then() .statusCode(403); when().get("/q/metrics") .then() .statusCode(200) .body( allOf( not(containsString("/secured/foo")), containsString("/secured/{message}")) ); } }
SecuredResourceTest
java
alibaba__druid
core/src/test/java/com/alibaba/druid/bvt/sql/oceanbase/OceanbaseAlterTableCheckPartitionTest.java
{ "start": 967, "end": 2464 }
class ____ extends MysqlTest { public void test_0() throws Exception { String sql = "ALTER TABLE tnrange CHECK PARTITION p1;"; MySqlStatementParser parser = new MySqlStatementParser(sql); List<SQLStatement> stmtList = parser.parseStatementList(); SQLStatement stmt = stmtList.get(0); { String result = SQLUtils.toMySqlString(stmt); assertEquals("ALTER TABLE tnrange" + "\n\tCHECK PARTITION p1;", result); } { String result = SQLUtils.toMySqlString(stmt, SQLUtils.DEFAULT_LCASE_FORMAT_OPTION); assertEquals("alter table tnrange" + "\n\tcheck partition p1;", result); } assertEquals(1, stmtList.size()); MySqlSchemaStatVisitor visitor = new MySqlSchemaStatVisitor(); stmt.accept(visitor); System.out.println("Tables : " + visitor.getTables()); System.out.println("fields : " + visitor.getColumns()); System.out.println("coditions : " + visitor.getConditions()); System.out.println("orderBy : " + visitor.getOrderByColumns()); assertEquals(1, visitor.getTables().size()); assertEquals(0, visitor.getColumns().size()); assertEquals(0, visitor.getConditions().size()); // assertTrue(visitor.getTables().containsKey(new TableStat.Name("t_basic_store"))); } }
OceanbaseAlterTableCheckPartitionTest
java
junit-team__junit5
jupiter-tests/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterEachTests.java
{ "start": 14880, "end": 15148 }
class ____ implements BeforeEachCallback { @Override public void beforeEach(ExtensionContext context) { callSequence.add("exceptionThrowingBeforeEachCallback"); throw new EnigmaException("BeforeEachCallback"); } } static
ExceptionThrowingBeforeEachCallback
java
spring-projects__spring-framework
spring-test/src/main/java/org/springframework/test/json/JsonContentAssert.java
{ "start": 829, "end": 1115 }
class ____ extends AbstractJsonContentAssert<JsonContentAssert> { /** * Create an assert for the given JSON document. * @param json the JSON document to assert */ public JsonContentAssert(@Nullable JsonContent json) { super(json, JsonContentAssert.class); } }
JsonContentAssert
java
processing__processing4
app/src/processing/app/syntax/JEditTextArea.java
{ "start": 1957, "end": 2167 }
class ____ {\n" * + " public static void main(String[] args) {\n" * + " System.out.println(\"Hello World\");\n" * + " }\n" * + "}");</pre> * * @author Slava Pestov */ public
Test
java
spring-projects__spring-boot
module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/CloudFoundryConditionalOnAvailableEndpointTests.java
{ "start": 2388, "end": 2958 }
class ____ { @Bean @ConditionalOnAvailableEndpoint HealthEndpoint health() { return new HealthEndpoint(); } @Bean @ConditionalOnAvailableEndpoint InfoEndpoint info() { return new InfoEndpoint(); } @Bean @ConditionalOnAvailableEndpoint SpringEndpoint spring() { return new SpringEndpoint(); } @Bean @ConditionalOnAvailableEndpoint TestEndpoint test() { return new TestEndpoint(); } @Bean @ConditionalOnAvailableEndpoint ShutdownEndpoint shutdown() { return new ShutdownEndpoint(); } } }
AllEndpointsConfiguration
java
apache__camel
components/camel-nitrite/src/main/java/org/apache/camel/component/nitrite/operation/common/UpdateOperation.java
{ "start": 1316, "end": 1816 }
class ____ extends AbstractPayloadAwareOperation implements CommonOperation { public UpdateOperation(Object payload) { super(payload); } public UpdateOperation() { } @Override protected void execute(Exchange exchange, NitriteEndpoint endpoint) throws Exception { exchange.getMessage().setHeader( NitriteConstants.WRITE_RESULT, endpoint.getNitriteCollection().update(getPayload(exchange, endpoint), false)); } }
UpdateOperation
java
elastic__elasticsearch
modules/lang-painless/src/test/java/org/elasticsearch/painless/JsonTests.java
{ "start": 615, "end": 1660 }
class ____ extends ScriptTestCase { public void testDump() { // simple object dump Object output = exec("Json.dump(params.data)", singletonMap("data", singletonMap("hello", "world")), true); assertEquals("{\"hello\":\"world\"}", output); output = exec("Json.dump(params.data)", singletonMap("data", singletonList(42)), true); assertEquals("[42]", output); // pretty print output = exec("Json.dump(params.data, true)", singletonMap("data", singletonMap("hello", "world")), true); assertEquals(""" { "hello" : "world" }""", output); } public void testLoad() { String json = "{\"hello\":\"world\"}"; Object output = exec("Json.load(params.json)", singletonMap("json", json), true); assertEquals(singletonMap("hello", "world"), output); json = "[42]"; output = exec("Json.load(params.json)", singletonMap("json", json), true); assertEquals(singletonList(42), output); } }
JsonTests
java
apache__camel
core/camel-core/src/test/java/org/apache/camel/processor/DynamicRouterThrowExceptionFromExpressionTest.java
{ "start": 1097, "end": 2150 }
class ____ extends ContextTestSupport { @Test public void testDynamicRouterAndVerifyException() throws Exception { getMockEndpoint("mock:error").expectedMessageCount(1); getMockEndpoint("mock:result").expectedMessageCount(0); template.sendBody("direct:start", "Hello World"); assertMockEndpointsSatisfied(); } @Override protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { onException(ExpressionEvaluationException.class).handled(true).to("mock://error"); from("direct://start").to("log:foo").dynamicRouter() .method(DynamicRouterThrowExceptionFromExpressionTest.class, "routeTo").to("mock://result").end(); } }; } public List<String> routeTo(Exchange exchange) throws ExpressionEvaluationException { throw new ExpressionEvaluationException(null, exchange, null); } }
DynamicRouterThrowExceptionFromExpressionTest
java
apache__hadoop
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/dao/ExecutionTypeRequestInfo.java
{ "start": 1204, "end": 1346 }
class ____ an execution type request. */ @XmlRootElement(name = "ExecutionTypeRequest") @XmlAccessorType(XmlAccessType.FIELD) public
representing
java
hibernate__hibernate-orm
hibernate-core/src/test/java/org/hibernate/orm/test/annotations/referencedcolumnname/Inhabitant.java
{ "start": 437, "end": 1263 }
class ____ implements Serializable { private Integer id; private String name; private Set<House> livesIn = new HashSet<>(); @Id @GeneratedValue public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } @ManyToMany(mappedBy = "hasInhabitants") public Set<House> getLivesIn() { return livesIn; } public void setLivesIn(Set<House> livesIn) { this.livesIn = livesIn; } public boolean equals(Object o) { if ( this == o ) return true; if ( !(o instanceof Inhabitant inhabitant) ) return false; return name != null ? name.equals( inhabitant.name ) : inhabitant.name == null; } public int hashCode() { return ( name != null ? name.hashCode() : 0 ); } }
Inhabitant
java
spring-projects__spring-boot
module/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpointAutoConfiguration.java
{ "start": 1454, "end": 1719 }
class ____ { @Bean @ConditionalOnMissingBean(search = SearchStrategy.CURRENT) ConditionsReportEndpoint conditionsReportEndpoint(ConfigurableApplicationContext context) { return new ConditionsReportEndpoint(context); } }
ConditionsReportEndpointAutoConfiguration
java
apache__camel
core/camel-support/src/main/java/org/apache/camel/support/ObjectHelper.java
{ "start": 2155, "end": 25124 }
class ____ { static { PARENTHESIS_PATTERN = Pattern.compile(",(?!(?:[^\\(,]|[^\\)],[^\\)])+\\))"); } private static final Pattern PARENTHESIS_PATTERN; private static final String DEFAULT_DELIMITER = ","; private static final char DEFAULT_DELIMITER_CHAR = ','; /** * Utility classes should not have a public constructor. */ private ObjectHelper() { } /** * A helper method for comparing objects for equality in which it uses type coercion to coerce types between the * left and right values. This allows you test for equality for example with a String and Integer type as Camel will * be able to coerce the types. */ public static boolean typeCoerceEquals(TypeConverter converter, Object leftValue, Object rightValue) { return typeCoerceEquals(converter, leftValue, rightValue, false); } /** * A helper method for comparing objects for equality in which it uses type coercion to coerce types between the * left and right values. This allows you test for equality for example with a String and Integer type as Camel will * be able to coerce the types. */ public static boolean typeCoerceEquals(TypeConverter converter, Object leftValue, Object rightValue, boolean ignoreCase) { // sanity check if (leftValue == null || rightValue == null) { return evalNulls(leftValue, rightValue); } // optimize for common combinations of comparing numbers if (leftValue instanceof String) { return typeCoerceString(converter, leftValue, rightValue, ignoreCase); } else if (rightValue instanceof String str && (leftValue instanceof Integer || leftValue instanceof Long) && isNumber(str)) { return typeCoerceIntLong(leftValue, str); } else if (leftValue instanceof Integer && rightValue instanceof Integer) { return integerPairComparison(leftValue, rightValue); } else if (leftValue instanceof Long && rightValue instanceof Long) { return longPairComparison(leftValue, rightValue); } else if (leftValue instanceof Double && rightValue instanceof Double) { return doublePairComparison(leftValue, rightValue); } else if (rightValue instanceof String string && leftValue instanceof Boolean booleanValue) { return booleanStringComparison(booleanValue, string); } // try without type coerce return tryConverters(converter, leftValue, rightValue, ignoreCase); } private static boolean typeCoerceString(TypeConverter converter, Object leftValue, Object rightValue, boolean ignoreCase) { if (rightValue instanceof String string) { return typeCoerceStringPair((String) leftValue, string, ignoreCase); } else if ((rightValue instanceof Integer || rightValue instanceof Long) && isNumber((String) leftValue)) { return typeCoerceILString((String) leftValue, rightValue); } else if (rightValue instanceof Double doubleValue && isFloatingNumber((String) leftValue)) { return stringDoubleComparison((String) leftValue, doubleValue); } else if (rightValue instanceof Boolean) { return stringBooleanComparison(leftValue, rightValue); } return tryConverters(converter, leftValue, rightValue, ignoreCase); } private static boolean evalNulls(Object leftValue, Object rightValue) { // they are equal if (leftValue == rightValue) { return true; } // only one of them is null so they are not equal return false; } private static boolean tryConverters(TypeConverter converter, Object leftValue, Object rightValue, boolean ignoreCase) { final boolean isEqual = org.apache.camel.util.ObjectHelper.equal(leftValue, rightValue, ignoreCase); if (isEqual) { return true; } // are they same type, if so return false as the equals returned false if (leftValue.getClass().isInstance(rightValue)) { return false; } // convert left to right StreamCache sc = null; try { if (leftValue instanceof StreamCache streamCache) { sc = streamCache; } Object value = converter.tryConvertTo(rightValue.getClass(), leftValue); final boolean isEqualLeftToRight = org.apache.camel.util.ObjectHelper.equal(value, rightValue, ignoreCase); if (isEqualLeftToRight) { return true; } // convert right to left if (rightValue instanceof StreamCache streamCache) { sc = streamCache; } value = converter.tryConvertTo(leftValue.getClass(), rightValue); return org.apache.camel.util.ObjectHelper.equal(leftValue, value, ignoreCase); } finally { if (sc != null) { sc.reset(); } } } private static boolean booleanStringComparison(Boolean leftBool, String rightValue) { Boolean rightBool = Boolean.valueOf(rightValue); return leftBool.compareTo(rightBool) == 0; } private static boolean doublePairComparison(Object leftValue, Object rightValue) { return doublePairComparison((Double) leftValue, (Double) rightValue); } private static boolean doublePairComparison(Double leftValue, Double rightValue) { return leftValue.compareTo(rightValue) == 0; } private static boolean longPairComparison(Object leftValue, Object rightValue) { return longPairComparison((Long) leftValue, (Long) rightValue); } private static boolean longPairComparison(Long leftValue, Long rightValue) { return leftValue.compareTo(rightValue) == 0; } private static boolean integerPairComparison(Object leftValue, Object rightValue) { return integerPairComparison((Integer) leftValue, (Integer) rightValue); } private static boolean integerPairComparison(Integer leftValue, Integer rightValue) { return leftValue.compareTo(rightValue) == 0; } private static boolean stringBooleanComparison(Object leftValue, Object rightValue) { return stringBooleanComparison((String) leftValue, (Boolean) rightValue); } private static boolean stringBooleanComparison(String leftValue, Boolean rightValue) { Boolean leftBool = Boolean.valueOf(leftValue); return leftBool.compareTo(rightValue) == 0; } private static boolean stringDoubleComparison(String leftValue, Double rightValue) { return doublePairComparison(Double.valueOf(leftValue), rightValue); } private static boolean typeCoerceIntLong(Object leftValue, String rightValue) { if (leftValue instanceof Integer) { return integerPairComparison((Integer) leftValue, Integer.valueOf(rightValue)); } else { return longPairComparison((Long) leftValue, Long.valueOf(rightValue)); } } private static boolean typeCoerceILString(String leftValue, Object rightValue) { if (rightValue instanceof Integer) { return integerPairComparison(Integer.valueOf(leftValue), (Integer) rightValue); } else { return longPairComparison(Long.valueOf(leftValue), (Long) rightValue); } } private static boolean typeCoerceStringPair(String leftNum, String rightNum, boolean ignoreCase) { if (isNumber(leftNum) && isNumber(rightNum)) { // favour to use numeric comparison return longPairComparison(Long.parseLong(leftNum), Long.parseLong(rightNum)); } if (ignoreCase) { return leftNum.compareToIgnoreCase(rightNum) == 0; } else { return leftNum.compareTo(rightNum) == 0; } } /** * A helper method for comparing objects for inequality in which it uses type coercion to coerce types between the * left and right values. This allows you test for inequality for example with a String and Integer type as Camel * will be able to coerce the types. */ public static boolean typeCoerceNotEquals(TypeConverter converter, Object leftValue, Object rightValue) { return !typeCoerceEquals(converter, leftValue, rightValue); } /** * A helper method for comparing objects ordering in which it uses type coercion to coerce types between the left * and right values. This allows you test for ordering for example with a String and Integer type as Camel will be * able to coerce the types. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static int typeCoerceCompare(TypeConverter converter, Object leftValue, Object rightValue) { // optimize for common combinations of comparing numbers if (leftValue instanceof String leftNum && rightValue instanceof String rightNum) { return typeCoerceCompareStringString(leftNum, rightNum); } else if (leftValue instanceof Integer leftNum && rightValue instanceof Integer rightNum) { return leftNum.compareTo(rightNum); } else if (leftValue instanceof Long leftNum && rightValue instanceof Long rightNum) { return leftNum.compareTo(rightNum); } else if (leftValue instanceof Double leftNum && rightValue instanceof Double rightNum) { return leftNum.compareTo(rightNum); } else if (leftValue instanceof Float leftNum && rightValue instanceof Float rightNum) { return leftNum.compareTo(rightNum); } else if ((rightValue instanceof Integer || rightValue instanceof Long) && leftValue instanceof String leftStr && isNumber(leftStr)) { if (rightValue instanceof Integer rightNum) { Integer leftNum = Integer.valueOf(leftStr); return leftNum.compareTo(rightNum); } else { Long leftNum = Long.valueOf(leftStr); Long rightNum = (Long) rightValue; return leftNum.compareTo(rightNum); } } else if (rightValue instanceof String && (leftValue instanceof Integer || leftValue instanceof Long) && isNumber((String) rightValue)) { if (leftValue instanceof Integer leftNum) { Integer rightNum = Integer.valueOf((String) rightValue); return leftNum.compareTo(rightNum); } else { Long leftNum = (Long) leftValue; Long rightNum = Long.valueOf((String) rightValue); return leftNum.compareTo(rightNum); } } else if (rightValue instanceof Double rightNum && leftValue instanceof String && isFloatingNumber((String) leftValue)) { Double leftNum = Double.valueOf((String) leftValue); return leftNum.compareTo(rightNum); } else if (rightValue instanceof Float rightNum && leftValue instanceof String && isFloatingNumber((String) leftValue)) { Float leftNum = Float.valueOf((String) leftValue); return leftNum.compareTo(rightNum); } else if (rightValue instanceof Boolean rightBool && leftValue instanceof String) { Boolean leftBool = Boolean.valueOf((String) leftValue); return leftBool.compareTo(rightBool); } else if (rightValue instanceof String && leftValue instanceof Boolean leftBool) { Boolean rightBool = Boolean.valueOf((String) rightValue); return leftBool.compareTo(rightBool); } // if both values is numeric then compare using numeric Long leftNum = converter.tryConvertTo(Long.class, leftValue); Long rightNum = converter.tryConvertTo(Long.class, rightValue); if (leftNum != null && rightNum != null) { return leftNum.compareTo(rightNum); } // also try with floating point numbers Double leftDouble = converter.tryConvertTo(Double.class, leftValue); Double rightDouble = converter.tryConvertTo(Double.class, rightValue); if (leftDouble != null && rightDouble != null) { return leftDouble.compareTo(rightDouble); } // prefer to NOT coerce to String so use the type which is not String // for example if we are comparing String vs Integer then prefer to coerce to Integer // as all types can be converted to String which does not work well for comparison // as eg "10" < 6 would return true, where as 10 < 6 will return false. // if they are both String then it doesn't matter if (rightValue instanceof String) { // if right is String and left is not then flip order (remember to * -1 the result then) return typeCoerceCompare(converter, rightValue, leftValue) * -1; } // prefer to coerce to the right hand side at first if (rightValue instanceof Comparable rightComparable) { Object value = converter.tryConvertTo(rightValue.getClass(), leftValue); if (value != null) { return rightComparable.compareTo(value) * -1; } } // then fallback to the left hand side if (leftValue instanceof Comparable leftComparable) { Object value = converter.tryConvertTo(leftValue.getClass(), rightValue); if (value != null) { return leftComparable.compareTo(value); } } // use regular compare return compare(leftValue, rightValue); } private static int typeCoerceCompareStringString(String leftNum, String rightNum) { // prioritize non-floating numbers first Long num1 = isNumber(leftNum) ? Long.parseLong(leftNum) : null; Long num2 = isNumber(rightNum) ? Long.parseLong(rightNum) : null; Double dec1 = num1 == null && isFloatingNumber(leftNum) ? Double.parseDouble(leftNum) : null; Double dec2 = num2 == null && isFloatingNumber(rightNum) ? Double.parseDouble(rightNum) : null; if (num1 != null && num2 != null) { return num1.compareTo(num2); } else if (dec1 != null && dec2 != null) { return dec1.compareTo(dec2); } // okay mixed but we need to convert to floating if (num1 != null && dec2 != null) { dec1 = Double.parseDouble(leftNum); return dec1.compareTo(dec2); } else if (num2 != null && dec1 != null) { dec2 = Double.parseDouble(rightNum); return dec1.compareTo(dec2); } // fallback to string comparison return leftNum.compareTo(rightNum); } /** * Checks whether the text is an integer number */ public static boolean isNumber(String text) { final int startPos = findStartPosition(text); if (startPos < 0) { return false; } for (int i = startPos; i < text.length(); i++) { char ch = text.charAt(i); if (!Character.isDigit(ch)) { return false; } } return true; } private static int findStartPosition(String text) { if (text == null || text.isEmpty()) { // invalid return -1; } int startPos = 0; if (text.charAt(0) == '-') { if (text.length() == 1) { // invalid return -1; } // skip leading negative startPos = 1; } return startPos; } /** * Checks whether the text is a float point number */ public static boolean isFloatingNumber(String text) { final int startPos = findStartPosition(text); if (startPos < 0) { return false; } boolean dots = false; boolean digits = false; char ch = 0; for (int i = startPos; i < text.length(); i++) { ch = text.charAt(i); if (!Character.isDigit(ch)) { if (ch == '.') { if (dots) { return false; } dots = true; } else { return false; } } else { digits = true; } } // there must be digits and not start or end with a dot return digits && text.charAt(startPos) != '.' && ch != '.'; } /** * A helper method to invoke a method via reflection and wrap any exceptions as {@link RuntimeCamelException} * instances * * @param method the method to invoke * @param instance the object instance (or null for static methods) * @param parameters the parameters to the method * @return the result of the method invocation */ public static Object invokeMethod(Method method, Object instance, Object... parameters) { try { if (parameters != null) { return method.invoke(instance, parameters); } else { return method.invoke(instance); } } catch (IllegalAccessException e) { throw new RuntimeCamelException(e); } catch (InvocationTargetException e) { throw RuntimeCamelException.wrapRuntimeCamelException(e.getCause()); } } /** * A helper method to invoke a method via reflection in a safe way by allowing to invoke methods that are not * accessible by default and wrap any exceptions as {@link RuntimeCamelException} instances * * @param method the method to invoke * @param instance the object instance (or null for static methods) * @param parameters the parameters to the method * @return the result of the method invocation */ public static Object invokeMethodSafe(Method method, Object instance, Object... parameters) throws InvocationTargetException, IllegalAccessException { Object answer; if (Modifier.isStatic(method.getModifiers())) { if (!method.canAccess(null)) { method.setAccessible(true); } } else { if (!method.canAccess(instance)) { method.setAccessible(true); } } if (parameters != null) { answer = method.invoke(instance, parameters); } else { answer = method.invoke(instance); } return answer; } /** * A helper method to invoke a method via reflection in a safe way by allowing to invoke methods that are not * accessible by default and wrap any exceptions as {@link RuntimeCamelException} instances * * @param name the method name * @param instance the object instance (or null for static methods) * @param parameters the parameters to the method * @return the result of the method invocation */ public static Object invokeMethodSafe(String name, Object instance, Object... parameters) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException { // find method first Class<?>[] arr = null; if (parameters != null) { arr = new Class[parameters.length]; for (int i = 0; i < parameters.length; i++) { Object p = parameters[i]; if (p != null) { arr[i] = p.getClass(); } } } Method m = ReflectionHelper.findMethod(instance.getClass(), name, arr); if (m != null) { return invokeMethodSafe(m, instance, parameters); } else { throw new NoSuchMethodException(name); } } /** * A helper method to create a new instance of a type using the default constructor arguments. */ public static <T> T newInstance(Class<T> type) { try { return type.getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeCamelException(e); } } /** * A helper method to create a new instance of a type using the default constructor arguments. */ public static <T> T newInstance(Class<?> actualType, Class<T> expectedType) { try { Object value = actualType.getDeclaredConstructor().newInstance(); return org.apache.camel.util.ObjectHelper.cast(expectedType, value); } catch (Exception e) { throw new RuntimeCamelException(e); } } /** * A helper method for performing an ordered comparison on the objects handling nulls and objects which do not * handle sorting gracefully */ public static int compare(Object a, Object b) { return compare(a, b, false); } /** * A helper method for performing an ordered comparison on the objects handling nulls and objects which do not * handle sorting gracefully * * @param a the first object * @param b the second object * @param ignoreCase ignore case for string comparison */ @SuppressWarnings({ "unchecked", "rawtypes" }) public static int compare(Object a, Object b, boolean ignoreCase) { if (a == b) { return 0; } if (a == null) { return -1; } if (b == null) { return 1; } if (a instanceof Ordered orderedA && b instanceof Ordered orderedB) { return orderedA.getOrder() - orderedB.getOrder(); } if (ignoreCase && a instanceof String strA && b instanceof String strB) { return strA.compareToIgnoreCase(strB); } if (a instanceof Comparable comparable) { return comparable.compareTo(b); } int answer = a.getClass().getName().compareTo(b.getClass().getName()); if (answer == 0) { answer = a.hashCode() - b.hashCode(); } return answer; } /** * Calling the Callable with the setting of TCCL with the camel context application classloader. * * @param call the Callable instance * @param exchange the exchange * @return the result of Callable return */ public static Object callWithTCCL(Callable<?> call, Exchange exchange) throws Exception { ClassLoader apcl = null; if (exchange != null && exchange.getContext() != null) { apcl = exchange.getContext().getApplicationContextClassLoader(); } return callWithTCCL(call, apcl); } /** * Calling the Callable with the setting of TCCL with a given classloader. * * @param call the Callable instance * @param classloader the
ObjectHelper
java
spring-projects__spring-security
docs/src/test/java/org/springframework/security/docs/servlet/authentication/servletx509config/X509ConfigurationTests.java
{ "start": 1835, "end": 3059 }
class ____ { public final SpringTestContext spring = new SpringTestContext(this); @Autowired MockMvc mockMvc; @Test void x509WhenDefaultX509Configuration() throws Exception { this.spring.register(DefaultX509Configuration.class, Http200Controller.class).autowire(); // @formatter:off this.mockMvc.perform(get("/").with(x509("rod.cer"))) .andExpect(status().isOk()) .andExpect(authenticated().withUsername("rod")); // @formatter:on } @Test void x509WhenDefaultX509ConfigurationXml() throws Exception { this.spring.testConfigLocations("DefaultX509Configuration.xml").autowire(); // @formatter:off this.mockMvc.perform(get("/").with(x509("rod.cer"))) .andExpect(authenticated().withUsername("rod")); // @formatter:on } @Test void x509WhenCustomX509Configuration() throws Exception { this.spring.register(CustomX509Configuration.class, Http200Controller.class).autowire(); X509Certificate certificate = X509TestUtils.buildTestCertificate(); // @formatter:off this.mockMvc.perform(get("/").with(x509(certificate))) .andExpect(status().isOk()) .andExpect(authenticated().withUsername("luke@monkeymachine")); // @formatter:on } @RestController static
X509ConfigurationTests
java
alibaba__fastjson
src/test/java/com/alibaba/json/bvt/issue_2200/Issue2244.java
{ "start": 141, "end": 332 }
class ____ extends TestCase { public void test_for_issue() throws Exception { String str = "\"2019-01-14T06:32:09.029Z\""; JSON.parseObject(str, Date.class); } }
Issue2244
java
apache__camel
components/camel-aws/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3ConsumerMaxMessagesPerPollIT.java
{ "start": 1384, "end": 4496 }
class ____ extends Aws2S3Base { @EndpointInject private ProducerTemplate template; @EndpointInject("mock:result") private MockEndpoint result; @Test public void sendIn() throws Exception { result.expectedMessageCount(3); template.send("direct:putObject", new Processor() { @Override public void process(Exchange exchange) { exchange.getIn().setHeader(AWS2S3Constants.KEY, "test.txt"); exchange.getIn().setBody("Test"); } }); template.send("direct:putObject", new Processor() { @Override public void process(Exchange exchange) { exchange.getIn().setHeader(AWS2S3Constants.KEY, "test1.txt"); exchange.getIn().setBody("Test1"); } }); template.send("direct:putObject", new Processor() { @Override public void process(Exchange exchange) { exchange.getIn().setHeader(AWS2S3Constants.KEY, "test2.txt"); exchange.getIn().setBody("Test2"); } }); Awaitility.await().atMost(10, TimeUnit.SECONDS) .untilAsserted(() -> MockEndpoint.assertIsSatisfied(context)); // in-progress should remove keys when complete AWS2S3Endpoint s3 = (AWS2S3Endpoint) context.getRoute("s3consumer").getEndpoint(); Awaitility.await().atMost(5, TimeUnit.SECONDS) .untilAsserted(() -> { Assertions.assertFalse(s3.getInProgressRepository().contains("test.txt")); Assertions.assertFalse(s3.getInProgressRepository().contains("test1.txt")); Assertions.assertFalse(s3.getInProgressRepository().contains("test2.txt")); }); } @Override protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { String awsEndpoint = "aws2-s3://" + name.get() + "?autoCreateBucket=true"; from("direct:putObject").startupOrder(1).to(awsEndpoint); from("aws2-s3://" + name.get() + "?maxMessagesPerPoll=2&moveAfterRead=true&destinationBucket=camel-kafka-connector&autoCreateBucket=true&destinationBucketPrefix=RAW(movedPrefix)&destinationBucketSuffix=RAW(movedSuffix)") .routeId("s3consumer") .startupOrder(2).log("${body}") .process(e -> { String key = e.getMessage().getHeader(AWS2S3Constants.KEY, String.class); log.info("Processing S3Object: {}", key); // should be in-progress AWS2S3Endpoint s3 = (AWS2S3Endpoint) context.getRoute("s3consumer").getEndpoint(); Assertions.assertTrue(s3.getInProgressRepository().contains(key)); }) .to("mock:result"); } }; } }
S3ConsumerMaxMessagesPerPollIT
java
apache__hadoop
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/monitor/RMAppToMonitor.java
{ "start": 1095, "end": 2281 }
class ____ { private ApplicationId applicationId; private ApplicationTimeoutType appTimeoutType; RMAppToMonitor(ApplicationId appId, ApplicationTimeoutType timeoutType) { this.applicationId = appId; this.appTimeoutType = timeoutType; } public ApplicationId getApplicationId() { return applicationId; } public ApplicationTimeoutType getAppTimeoutType() { return appTimeoutType; } @Override public int hashCode() { return applicationId.hashCode() + appTimeoutType.hashCode(); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } RMAppToMonitor other = (RMAppToMonitor) obj; if (!this.applicationId.equals(other.getApplicationId())) { return false; } if (this.appTimeoutType != other.getAppTimeoutType()) { return false; } return true; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(applicationId.toString()).append("_").append(appTimeoutType); return sb.toString(); } }
RMAppToMonitor
java
apache__camel
dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AMQPEndpointBuilderFactory.java
{ "start": 308101, "end": 314610 }
class ____ { /** * The internal instance of the builder used to access to all the * methods representing the name of headers. */ private static final AMQPHeaderNameBuilder INSTANCE = new AMQPHeaderNameBuilder(); /** * The destination. * * The option is a: {@code jakarta.jms.Destination} type. * * Group: producer * * @return the name of the header {@code JmsDestination}. */ public String jmsDestination() { return "CamelJmsDestination"; } /** * The name of the queue or topic to use as destination. * * The option is a: {@code String} type. * * Group: producer * * @return the name of the header {@code JmsDestinationName}. */ public String jmsDestinationName() { return "CamelJmsDestinationName"; } /** * The name of the queue or topic the message was sent to. * * The option is a: {@code String} type. * * Group: common * * @return the name of the header {@code JMSDestinationProduced}. */ public String jMSDestinationProduced() { return "CamelJMSDestinationProduced"; } /** * The JMS group ID. * * The option is a: {@code String} type. * * Group: common * * @return the name of the header {@code JMSXGroupID}. */ public String jMSXGroupID() { return "JMSXGroupID"; } /** * The JMS unique message ID. * * The option is a: {@code String} type. * * Group: common * * @return the name of the header {@code JMSMessageID}. */ public String jMSMessageID() { return "JMSMessageID"; } /** * The JMS correlation ID. * * The option is a: {@code String} type. * * Group: common * * @return the name of the header {@code JMSCorrelationID}. */ public String jMSCorrelationID() { return "JMSCorrelationID"; } /** * The JMS correlation ID as bytes. * * The option is a: {@code byte[]} type. * * Group: common * * @return the name of the header {@code JMSCorrelationIDAsBytes}. */ public String jMSCorrelationIDAsBytes() { return "JMSCorrelationIDAsBytes"; } /** * The JMS delivery mode. * * The option is a: {@code int} type. * * Group: common * * @return the name of the header {@code JMSDeliveryMode}. */ public String jMSDeliveryMode() { return "JMSDeliveryMode"; } /** * The JMS destination. * * The option is a: {@code jakarta.jms.Destination} type. * * Group: common * * @return the name of the header {@code JMSDestination}. */ public String jMSDestination() { return "JMSDestination"; } /** * The JMS expiration. * * The option is a: {@code long} type. * * Group: common * * @return the name of the header {@code JMSExpiration}. */ public String jMSExpiration() { return "JMSExpiration"; } /** * The JMS priority (with 0 as the lowest priority and 9 as the * highest). * * The option is a: {@code int} type. * * Group: common * * @return the name of the header {@code JMSPriority}. */ public String jMSPriority() { return "JMSPriority"; } /** * Is the JMS message redelivered. * * The option is a: {@code boolean} type. * * Group: common * * @return the name of the header {@code JMSRedelivered}. */ public String jMSRedelivered() { return "JMSRedelivered"; } /** * The JMS timestamp. * * The option is a: {@code long} type. * * Group: common * * @return the name of the header {@code JMSTimestamp}. */ public String jMSTimestamp() { return "JMSTimestamp"; } /** * The JMS reply-to destination. * * The option is a: {@code jakarta.jms.Destination} type. * * Group: common * * @return the name of the header {@code JMSReplyTo}. */ public String jMSReplyTo() { return "JMSReplyTo"; } /** * The JMS type. * * The option is a: {@code String} type. * * Group: common * * @return the name of the header {@code JMSType}. */ public String jMSType() { return "JMSType"; } /** * The XUser id. * * The option is a: {@code String} type. * * Group: common * * @return the name of the header {@code JMSXUserID}. */ public String jMSXUserID() { return "JMSXUserID"; } /** * The message type. * * The option is a: {@code * org.apache.camel.component.jms.JmsMessageType} type. * * Group: common * * @return the name of the header {@code JmsMessageType}. */ public String jmsMessageType() { return "CamelJmsMessageType"; } /** * The timeout for waiting for a reply when using the InOut Exchange * Pattern (in milliseconds). * * The option is a: {@code long} type. * * Default: 20000 * Group: producer * * @return the name of the header {@code JmsRequestTimeout}. */ public String jmsRequestTimeout() { return "CamelJmsRequestTimeout"; } } static AMQPEndpointBuilder endpointBuilder(String componentName, String path) {
AMQPHeaderNameBuilder
java
micronaut-projects__micronaut-core
http-server/src/main/java/io/micronaut/http/server/exceptions/BufferLengthExceededHandler.java
{ "start": 1182, "end": 1721 }
class ____ extends ErrorResponseProcessorExceptionHandler<BufferLengthExceededException> { /** * Constructor. * @param responseProcessor Error Response Processor */ public BufferLengthExceededHandler(ErrorResponseProcessor<?> responseProcessor) { super(responseProcessor); } @Override @NonNull protected MutableHttpResponse<?> createResponse(BufferLengthExceededException exception) { return HttpResponse.status(HttpStatus.REQUEST_ENTITY_TOO_LARGE); } }
BufferLengthExceededHandler
java
quarkusio__quarkus
extensions/hibernate-reactive/deployment/src/test/java/io/quarkus/hibernate/reactive/config/unsupportedproperties/UnsupportedPropertiesTest.java
{ "start": 1093, "end": 7168 }
class ____ { private static final Formatter LOG_FORMATTER = new PatternFormatter("%s"); @RegisterExtension static QuarkusUnitTest runner = new QuarkusUnitTest() .withApplicationRoot((jar) -> jar .addClass(SpyingIdentifierGeneratorEntity.class) .addClass(SettingsSpyingIdentifierGenerator.class)) .withConfigurationResource("application.properties") .overrideConfigKey("quarkus.hibernate-orm.jdbc.statement-batch-size", "10") // This should be taken into account by Hibernate ORM .overrideConfigKey("quarkus.hibernate-orm.unsupported-properties.\"" + AvailableSettings.ORDER_INSERTS + "\"", "true") // This is just to test a property set at build time .overrideConfigKey("quarkus.hibernate-orm.unsupported-properties.\"hibernate.some.unknown.key.static-and-runtime\"", "some-value-1") // This is just to test a property set at runtime, which would not be available during the build // (or even during static init with native applications). .overrideRuntimeConfigKey( "quarkus.hibernate-orm.unsupported-properties.\"hibernate.some.unknown.key.runtime-only\"", "some-value-2") // This overrides a property set by Quarkus, and thus should trigger an additional warning .overrideConfigKey( "quarkus.hibernate-orm.unsupported-properties.\"" + AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION + "\"", // Deliberately using the Hibernate-native name instead of the JPA one that Quarkus uses // This allows us to check the override did happen "create-drop") .overrideConfigKey( "quarkus.hibernate-orm.unsupported-properties.\"" + AvailableSettings.ORDER_UPDATES + "\"", "false") // Expect warnings on startup .setLogRecordPredicate( record -> FastBootHibernateReactivePersistenceProvider.class.getName().equals(record.getLoggerName()) && record.getLevel().intValue() >= Level.WARNING.intValue()) .assertLogRecords(records -> { var assertion = assertThat(records) .as("Warnings on startup") .hasSize(2); assertion.element(0).satisfies(record -> assertThat(LOG_FORMATTER.formatMessage(record)) .contains("Persistence-unit [<default>] sets unsupported properties", "These properties may not work correctly", "may change when upgrading to a newer version of Quarkus (even just a micro/patch version)", "Consider using a supported configuration property", "make sure to file a feature request so that a supported configuration property can be added to Quarkus") .contains(AvailableSettings.ORDER_INSERTS, AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "hibernate.some.unknown.key.static-and-runtime", "hibernate.some.unknown.key.runtime-only") // We should not log property values, that could be a security breach for some properties. .doesNotContain("some-value")); assertion.element(1).satisfies(record -> assertThat(LOG_FORMATTER.formatMessage(record)) .contains( "Persistence-unit [<default>] sets unsupported properties that override Quarkus' own settings", "These properties may break assumptions in Quarkus code and cause malfunctions", "make sure to file a feature request or bug report so that a solution can be implemented in Quarkus") .contains(AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION) .doesNotContain(AvailableSettings.ORDER_INSERTS, "hibernate.some.unknown.key.static-and-runtime", "hibernate.some.unknown.key.runtime-only")); }); @Inject Mutiny.SessionFactory sessionFactory; @Test public void testPropertiesPropagatedToStaticInit() { // Two sets of settings: 0 is static init, 1 is runtime init. assertThat(SettingsSpyingIdentifierGenerator.collectedSettings).hasSize(2); Map<String, Object> settings = SettingsSpyingIdentifierGenerator.collectedSettings.get(0); assertThat(settings) .containsEntry("hibernate.some.unknown.key.static-and-runtime", "some-value-1") .doesNotContainKey("hibernate.some.unknown.key.runtime-only"); } @Test public void testPropertiesPropagatedToRuntimeInit() throws IllegalAccessException, NoSuchFieldException { // Please look elsewhere while we're doing this, // it's only necessary for testing purposes, but it's a bit embarrassing... Field field = MutinySessionFactoryImpl.class.getDeclaredField("delegate"); field.setAccessible(true); SessionFactory ormSessionFactory = (SessionFactory) field.get(ClientProxy.unwrap(sessionFactory)); // All good, you can look now. assertThat(ormSessionFactory.getProperties()) .contains(entry(AvailableSettings.ORDER_INSERTS, "true"), entry(AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop"), entry(AvailableSettings.ORDER_UPDATES, "false"), // Also test a property that Quarkus cannot possibly know about entry("hibernate.some.unknown.key.static-and-runtime", "some-value-1"), entry("hibernate.some.unknown.key.runtime-only", "some-value-2")); } @Entity public static
UnsupportedPropertiesTest
java
spring-projects__spring-boot
module/spring-boot-micrometer-tracing/src/main/java/org/springframework/boot/micrometer/tracing/autoconfigure/LogCorrelationEnvironmentPostProcessor.java
{ "start": 1519, "end": 1988 }
class ____ implements EnvironmentPostProcessor { @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { if (ClassUtils.isPresent("io.micrometer.tracing.Tracer", application.getClassLoader())) { environment.getPropertySources().addLast(new LogCorrelationPropertySource(this, environment)); } } /** * Log correlation {@link PropertySource}. */ private static
LogCorrelationEnvironmentPostProcessor
java
hibernate__hibernate-orm
hibernate-core/src/test/java/org/hibernate/orm/test/inheritance/embeddable/StructAggregateEmbeddableInheritanceTest.java
{ "start": 14356, "end": 14814 }
class ____ { @Id private Long id; @Embedded @Struct( name = "inheritance_embeddable" ) private ParentEmbeddable embeddable; public TestEntity() { } public TestEntity(Long id, ParentEmbeddable embeddable) { this.id = id; this.embeddable = embeddable; } public ParentEmbeddable getEmbeddable() { return embeddable; } public void setEmbeddable(ParentEmbeddable embeddable) { this.embeddable = embeddable; } } }
TestEntity
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/boot/model/source/spi/JpaCallbackSource.java
{ "start": 222, "end": 1358 }
interface ____ { /** * @param callbackType {@link jakarta.persistence.PrePersist}, {@link jakarta.persistence.PreRemove}, {@link jakarta.persistence.PreUpdate}, {@link jakarta.persistence.PostLoad}, * {@link jakarta.persistence.PostPersist}, {@link jakarta.persistence.PostRemove}, or {@link jakarta.persistence.PostUpdate} * @return the name of the JPA callback method defined for the associated {@linkplain jakarta.persistence.Entity entity} or {@linkplain jakarta.persistence.MappedSuperclass * mapped superclass} and for the supplied callback annotation class. */ String getCallbackMethod(Class<? extends Annotation> callbackType); /** * @return the name of the instantiated container where the JPA callbacks for the associated {@linkplain jakarta.persistence.Entity entity} or * {@linkplain jakarta.persistence.MappedSuperclass mapped superclass} are defined. This can be either the entity/mapped superclass itself or an * {@linkplain jakarta.persistence.EntityListeners entity listener}. */ String getName(); /** * @return <code>true</code> if this callback
JpaCallbackSource
java
apache__flink
flink-tests/src/test/java/org/apache/flink/test/recovery/TaskManagerProcessFailureStreamingRecoveryITCase.java
{ "start": 7227, "end": 7867 }
class ____ extends RichMapFunction<Long, Long> { private boolean markerCreated = false; private File coordinateDir; public Mapper(File coordinateDir) { this.coordinateDir = coordinateDir; } @Override public Long map(Long value) throws Exception { if (!markerCreated) { int taskIndex = getRuntimeContext().getTaskInfo().getIndexOfThisSubtask(); touchFile(new File(coordinateDir, READY_MARKER_FILE_PREFIX + taskIndex)); markerCreated = true; } return value; } } private static
Mapper
java
elastic__elasticsearch
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForRolloverReadyStep.java
{ "start": 1357, "end": 13707 }
class ____ extends AsyncWaitStep { private static final Logger logger = LogManager.getLogger(WaitForRolloverReadyStep.class); public static final String NAME = "check-rollover-ready"; public static final long MAX_PRIMARY_SHARD_DOCS = 200_000_000L; private final RolloverConditions conditions; public WaitForRolloverReadyStep( StepKey key, StepKey nextStepKey, Client client, ByteSizeValue maxSize, ByteSizeValue maxPrimaryShardSize, TimeValue maxAge, Long maxDocs, Long maxPrimaryShardDocs, ByteSizeValue minSize, ByteSizeValue minPrimaryShardSize, TimeValue minAge, Long minDocs, Long minPrimaryShardDocs ) { super(key, nextStepKey, client); this.conditions = RolloverConditions.newBuilder() .addMaxIndexSizeCondition(maxSize) .addMaxPrimaryShardSizeCondition(maxPrimaryShardSize) .addMaxIndexAgeCondition(maxAge) .addMaxIndexDocsCondition(maxDocs) .addMaxPrimaryShardDocsCondition(maxPrimaryShardDocs) .addMinIndexSizeCondition(minSize) .addMinPrimaryShardSizeCondition(minPrimaryShardSize) .addMinIndexAgeCondition(minAge) .addMinIndexDocsCondition(minDocs) .addMinPrimaryShardDocsCondition(minPrimaryShardDocs) .build(); } public WaitForRolloverReadyStep(StepKey key, StepKey nextStepKey, Client client, RolloverConditions conditions) { super(key, nextStepKey, client); this.conditions = conditions; } @Override public boolean isRetryable() { return true; } @Override public void evaluateCondition(ProjectState state, IndexMetadata indexMetadata, Listener listener, TimeValue masterTimeout) { Index index = indexMetadata.getIndex(); IndexAbstraction indexAbstraction = state.metadata().getIndicesLookup().get(index.getName()); assert indexAbstraction != null : "invalid cluster metadata. index [" + index.getName() + "] was not found"; final String rolloverTarget; final boolean targetFailureStore; DataStream dataStream = indexAbstraction.getParentDataStream(); if (dataStream != null) { targetFailureStore = dataStream.isFailureStoreIndex(index.getName()); boolean isFailureStoreWriteIndex = index.equals(dataStream.getWriteFailureIndex()); if (isFailureStoreWriteIndex == false && dataStream.getWriteIndex().equals(index) == false) { logger.warn( "index [{}] is not the {}write index for data stream [{}]. skipping rollover for policy [{}]", index.getName(), targetFailureStore ? "failure store " : "", dataStream.getName(), indexMetadata.getLifecyclePolicyName() ); listener.onResponse(true, EmptyInfo.INSTANCE); return; } rolloverTarget = dataStream.getName(); } else { String rolloverAlias = RolloverAction.LIFECYCLE_ROLLOVER_ALIAS_SETTING.get(indexMetadata.getSettings()); if (Strings.isNullOrEmpty(rolloverAlias)) { listener.onFailure( new IllegalArgumentException( Strings.format( "setting [%s] for index [%s] is empty or not defined", RolloverAction.LIFECYCLE_ROLLOVER_ALIAS, index.getName() ) ) ); return; } if (indexMetadata.getRolloverInfos().get(rolloverAlias) != null) { logger.info( "index [{}] was already rolled over for alias [{}], not attempting to roll over again", index.getName(), rolloverAlias ); listener.onResponse(true, EmptyInfo.INSTANCE); return; } // The order of the following checks is important in ways which may not be obvious. // First, figure out if 1) The configured alias points to this index, and if so, // whether this index is the write alias for this index boolean aliasPointsToThisIndex = indexMetadata.getAliases().containsKey(rolloverAlias); Boolean isWriteIndex = null; if (aliasPointsToThisIndex) { // The writeIndex() call returns a tri-state boolean: // true -> this index is the write index for this alias // false -> this index is not the write index for this alias // null -> this alias is a "classic-style" alias and does not have a write index configured, but only points to one index // and is thus the write index by default isWriteIndex = indexMetadata.getAliases().get(rolloverAlias).writeIndex(); } boolean indexingComplete = LifecycleSettings.LIFECYCLE_INDEXING_COMPLETE_SETTING.get(indexMetadata.getSettings()); if (indexingComplete) { logger.trace("{} has lifecycle complete set, skipping {}", index, WaitForRolloverReadyStep.NAME); // If this index is still the write index for this alias, skipping rollover and continuing with the policy almost certainly // isn't what we want, as something likely still expects to be writing to this index. // If the alias doesn't point to this index, that's okay as that will be the result if this index is using a // "classic-style" alias and has already rolled over, and we want to continue with the policy. if (aliasPointsToThisIndex && Boolean.TRUE.equals(isWriteIndex)) { listener.onFailure( new IllegalStateException( Strings.format( "index [%s] has [%s] set to [true], but is still the write index for alias [%s]", index.getName(), LifecycleSettings.LIFECYCLE_INDEXING_COMPLETE, rolloverAlias ) ) ); return; } listener.onResponse(true, EmptyInfo.INSTANCE); return; } // If indexing_complete is *not* set, and the alias does not point to this index, we can't roll over this index, so error out. if (aliasPointsToThisIndex == false) { listener.onFailure( new IllegalArgumentException( Strings.format( "%s [%s] does not point to index [%s]", RolloverAction.LIFECYCLE_ROLLOVER_ALIAS, rolloverAlias, index.getName() ) ) ); return; } // Similarly, if isWriteIndex is false (see note above on false vs. null), we can't roll over this index, so error out. if (Boolean.FALSE.equals(isWriteIndex)) { listener.onFailure( new IllegalArgumentException( Strings.format("index [%s] is not the write index for alias [%s]", index.getName(), rolloverAlias) ) ); return; } rolloverTarget = rolloverAlias; targetFailureStore = false; } // if we should only rollover if not empty, *and* if neither an explicit min_docs nor an explicit min_primary_shard_docs // has been specified on this policy, then inject a default min_docs: 1 condition so that we do not rollover empty indices boolean rolloverOnlyIfHasDocuments = LifecycleSettings.LIFECYCLE_ROLLOVER_ONLY_IF_HAS_DOCUMENTS_SETTING.get( state.cluster().metadata().settings() ); RolloverRequest rolloverRequest = createRolloverRequest( rolloverTarget, masterTimeout, rolloverOnlyIfHasDocuments, targetFailureStore ); getClient(state.projectId()).admin().indices().rolloverIndex(rolloverRequest, ActionListener.wrap(response -> { final var conditionStatus = response.getConditionStatus(); final var conditionsMet = rolloverRequest.getConditions().areConditionsMet(conditionStatus); if (conditionsMet) { logger.info("index [{}] is ready for rollover, conditions: [{}]", index.getName(), conditionStatus); } else { logger.debug("index [{}] is not ready for rollover, conditions: [{}]", index.getName(), conditionStatus); } listener.onResponse(conditionsMet, EmptyInfo.INSTANCE); }, listener::onFailure)); } /** * Builds a RolloverRequest that captures the various max_* and min_* conditions of this {@link WaitForRolloverReadyStep}. * <p> * To prevent empty indices from rolling over, a `min_docs: 1` condition will be injected if `rolloverOnlyIfHasDocuments` is true * and the request doesn't already have an associated min_docs or min_primary_shard_docs condition. * * @param rolloverTarget the index to rollover * @param masterTimeout the master timeout to use with the request * @param rolloverOnlyIfHasDocuments whether to inject a min_docs 1 condition if there is not already a min_docs * (or min_primary_shard_docs) condition * @return A RolloverRequest suitable for passing to {@code rolloverIndex(...) }. */ // visible for testing RolloverRequest createRolloverRequest( String rolloverTarget, TimeValue masterTimeout, boolean rolloverOnlyIfHasDocuments, boolean targetFailureStore ) { RolloverRequest rolloverRequest = new RolloverRequest(rolloverTarget, null).masterNodeTimeout(masterTimeout); rolloverRequest.dryRun(true); rolloverRequest.setConditions(applyDefaultConditions(conditions, rolloverOnlyIfHasDocuments)); if (targetFailureStore) { rolloverRequest.setRolloverTarget(IndexNameExpressionResolver.combineSelector(rolloverTarget, IndexComponentSelector.FAILURES)); } return rolloverRequest; } /** * Apply default conditions to the set of user-defined conditions. * * @param conditions the existing conditions * @param rolloverOnlyIfHasDocuments whether to inject a min_docs 1 condition if there is not already a min_docs * (or min_primary_shard_docs) condition * @return the rollover conditions with the default conditions applied. */ public static RolloverConditions applyDefaultConditions(RolloverConditions conditions, boolean rolloverOnlyIfHasDocuments) { var builder = RolloverConditions.newBuilder(conditions); if (rolloverOnlyIfHasDocuments && (conditions.getMinDocs() == null && conditions.getMinPrimaryShardDocs() == null)) { builder.addMinIndexDocsCondition(1L); } long currentMaxPrimaryShardDocs = conditions.getMaxPrimaryShardDocs() != null ? conditions.getMaxPrimaryShardDocs() : Long.MAX_VALUE; builder.addMaxPrimaryShardDocsCondition(Math.min(currentMaxPrimaryShardDocs, MAX_PRIMARY_SHARD_DOCS)); return builder.build(); } public RolloverConditions getConditions() { return conditions; } @Override public int hashCode() { return Objects.hash(super.hashCode(), conditions); } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } WaitForRolloverReadyStep other = (WaitForRolloverReadyStep) obj; return super.equals(obj) && Objects.equals(conditions, other.conditions); } }
WaitForRolloverReadyStep
java
elastic__elasticsearch
x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/FirstLongByTimestampAggregatorFunctionSupplier.java
{ "start": 659, "end": 1720 }
class ____ implements AggregatorFunctionSupplier { public FirstLongByTimestampAggregatorFunctionSupplier() { } @Override public List<IntermediateStateDesc> nonGroupingIntermediateStateDesc() { return FirstLongByTimestampAggregatorFunction.intermediateStateDesc(); } @Override public List<IntermediateStateDesc> groupingIntermediateStateDesc() { return FirstLongByTimestampGroupingAggregatorFunction.intermediateStateDesc(); } @Override public FirstLongByTimestampAggregatorFunction aggregator(DriverContext driverContext, List<Integer> channels) { return FirstLongByTimestampAggregatorFunction.create(driverContext, channels); } @Override public FirstLongByTimestampGroupingAggregatorFunction groupingAggregator( DriverContext driverContext, List<Integer> channels) { return FirstLongByTimestampGroupingAggregatorFunction.create(channels, driverContext); } @Override public String describe() { return FirstLongByTimestampAggregator.describe(); } }
FirstLongByTimestampAggregatorFunctionSupplier
java
apache__kafka
connect/runtime/src/test/java/org/apache/kafka/connect/integration/TaskHandle.java
{ "start": 12233, "end": 13301 }
class ____ { private final TopicPartition topicPartition; private boolean assigned = false; private int timesAssigned = 0; private int timesRevoked = 0; private int timesCommitted = 0; public PartitionHistory(TopicPartition topicPartition) { this.topicPartition = topicPartition; } public void assigned() { timesAssigned++; assigned = true; } public void revoked() { timesRevoked++; assigned = false; } public void committed() { timesCommitted++; } public TopicPartition topicPartition() { return topicPartition; } public boolean isAssigned() { return assigned; } public int timesAssigned() { return timesAssigned; } public int timesRevoked() { return timesRevoked; } public int timesCommitted() { return timesCommitted; } } }
PartitionHistory
java
spring-projects__spring-security
config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpBasicConfigurerTests.java
{ "start": 10860, "end": 11304 }
class ____ { static ObjectPostProcessor<Object> objectPostProcessor = spy(ReflectingObjectPostProcessor.class); @Bean SecurityFilterChain filterChain(HttpSecurity http) throws Exception { // @formatter:off http .httpBasic(withDefaults()); return http.build(); // @formatter:on } @Bean static ObjectPostProcessor<Object> objectPostProcessor() { return objectPostProcessor; } } static
ObjectPostProcessorConfig
java
netty__netty
codec-http3/src/main/java/io/netty/handler/codec/http3/DefaultHttp3Headers.java
{ "start": 6994, "end": 7993 }
class ____ extends HeaderEntry<CharSequence, CharSequence> { protected Http3HeaderEntry(int hash, CharSequence key, CharSequence value, HeaderEntry<CharSequence, CharSequence> next) { super(hash, key); this.value = value; this.next = next; // Make sure the pseudo headers fields are first in iteration order if (hasPseudoHeaderFormat(key)) { after = firstNonPseudo; before = firstNonPseudo.before(); } else { after = head; before = head.before(); if (firstNonPseudo == head) { firstNonPseudo = this; } } pointNeighborsToThis(); } @Override protected void remove() { if (this == firstNonPseudo) { firstNonPseudo = firstNonPseudo.after(); } super.remove(); } } }
Http3HeaderEntry
java
quarkusio__quarkus
extensions/hibernate-orm/runtime/src/main/java/io/quarkus/hibernate/orm/runtime/SchemaToolingUtil.java
{ "start": 306, "end": 1992 }
class ____ { private static final String SQL_LOAD_SCRIPT_UNZIPPED_DIR_PREFIX = "import-sql-unzip-"; public static String unzipZipFilesAndReplaceZips(String commaSeparatedFileNames) { List<String> unzippedFilesNames = new ArrayList<>(); if (commaSeparatedFileNames != null) { String[] fileNames = commaSeparatedFileNames.split(","); for (String fileName : fileNames) { if (fileName.endsWith(".zip")) { try { Path unzipDir = Files.createTempDirectory(SQL_LOAD_SCRIPT_UNZIPPED_DIR_PREFIX); URL resource = Thread.currentThread() .getContextClassLoader() .getResource(fileName); Path zipFile = Paths.get(resource.toURI()); ZipUtils.unzip(zipFile, unzipDir); try (DirectoryStream<Path> paths = Files.newDirectoryStream(unzipDir)) { for (Path path : paths) { unzippedFilesNames.add(path.toAbsolutePath().toString()); } } } catch (Exception e) { throw new IllegalStateException(String.format(Locale.ROOT, "Error unzipping import file %s: %s", fileName, e.getMessage()), e); } } else { unzippedFilesNames.add(fileName); } } return String.join(",", unzippedFilesNames); } else { return null; } } }
SchemaToolingUtil
java
hibernate__hibernate-orm
hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AggregateFunctionChecker.java
{ "start": 3059, "end": 3229 }
class ____ extends AbstractSqlAstWalker { private static final AggregateFunctionChecker INSTANCE = new AggregateFunctionChecker(); private static
AggregateFunctionChecker
java
dropwizard__dropwizard
dropwizard-hibernate/src/test/java/io/dropwizard/hibernate/TransactionHandlingTest.java
{ "start": 7000, "end": 7978 }
class ____ { private final DogDAO dao; DogResource(DogDAO dao) { this.dao = dao; } @GET @Path("serialized") @UnitOfWork(transactional = false) public DogResult findSerialized(@PathParam("name") String name) { return new DogResult() { @Override public void setDog(@Nullable Dog dog) { throw new UnsupportedOperationException(); } @Override public Optional<Dog> getDog() { return dao.findByName(name); } }; } @GET @Path("nested") @UnitOfWork(transactional = false) public Optional<Dog> findNested(@PathParam("name") String name) { return dao.findByName(name); } @PUT @UnitOfWork public void create(Dog dog) { dao.create(dog); } } }
DogResource
java
hibernate__hibernate-orm
hibernate-testing/src/main/java/org/hibernate/testing/orm/domain/contacts/Contact.java
{ "start": 3227, "end": 3272 }
enum ____ { MALE, FEMALE, OTHER } }
Gender
java
junit-team__junit5
platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassSelectorTests.java
{ "start": 1293, "end": 1580 }
class ____ name: org.example.TestClass")// .withCauseInstanceOf(ClassNotFoundException.class); } @Test void usesClassClassLoader() { var selector = new ClassSelector(getClass()); assertThat(selector.getClassLoader()).isNotNull().isSameAs(getClass().getClassLoader()); } }
with
java
google__auto
value/src/main/java/com/google/auto/value/processor/AutoOneOfProcessor.java
{ "start": 7915, "end": 8689 }
enum ____ transformedPropertyNames.forEach( (transformed, property) -> { if (!transformedEnumConstants.containsKey(transformed)) { errorReporter() .reportError( kindElement, "[AutoOneOfNoEnumConstant] Enum has no constant with name corresponding to" + " property '%s'", property); } }); // Enum constants that have no property transformedEnumConstants.forEach( (transformed, constant) -> { if (!transformedPropertyNames.containsKey(transformed)) { errorReporter() .reportError( constant, "[AutoOneOfBadEnumConstant] Name of
constant
java
elastic__elasticsearch
server/src/main/java/org/elasticsearch/index/codec/postings/Lucene90BlockTreeTermsWriter.java
{ "start": 16612, "end": 16796 }
class ____ { public final boolean isTerm; protected PendingEntry(boolean isTerm) { this.isTerm = isTerm; } } private static final
PendingEntry
java
google__error-prone
core/src/test/java/com/google/errorprone/fixes/SuggestedFixesTest.java
{ "start": 49993, "end": 50253 }
class ____ { void f() { int x = 0; int y = 1; System.err.println(y); } } """) .addOutputLines( "out/Test.java", """
Test
java
micronaut-projects__micronaut-core
core/src/main/java/io/micronaut/core/io/file/FileSystemResourceLoader.java
{ "start": 753, "end": 1386 }
interface ____ extends ResourceLoader { /** * The resource name prefix. */ String PREFIX = "file:"; /** * Creation method. * @return loader */ static FileSystemResourceLoader defaultLoader() { return new DefaultFileSystemResourceLoader(); } /** * Does the loader support a prefix. * @param path The path to a resource including a prefix * appended by a colon. Ex (classpath:, file:) * @return boolean */ @Override default boolean supportsPrefix(String path) { return path.startsWith(PREFIX); } }
FileSystemResourceLoader
java
spring-projects__spring-security
config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java
{ "start": 96176, "end": 97875 }
class ____ { private LoginPageSpec() { } protected void configure(ServerHttpSecurity http) { if (http.authenticationEntryPoint != null) { return; } if (http.formLogin != null && http.formLogin.isEntryPointExplicit || http.oauth2Login != null && StringUtils.hasText(http.oauth2Login.loginPage) || http.oneTimeTokenLogin != null && StringUtils.hasText(http.oneTimeTokenLogin.loginPage)) { return; } LoginPageGeneratingWebFilter loginPage = null; if (http.formLogin != null && !http.formLogin.isEntryPointExplicit) { loginPage = new LoginPageGeneratingWebFilter(); loginPage.setFormLoginEnabled(true); } if (http.oauth2Login != null) { Map<String, String> urlToText = http.oauth2Login.getLinks(); if (loginPage == null) { loginPage = new LoginPageGeneratingWebFilter(); } loginPage.setOauth2AuthenticationUrlToClientName(urlToText); } if (http.oneTimeTokenLogin != null) { if (loginPage == null) { loginPage = new LoginPageGeneratingWebFilter(); } loginPage.setOneTimeTokenEnabled(true); loginPage.setGenerateOneTimeTokenUrl(http.oneTimeTokenLogin.tokenGeneratingUrl); } if (loginPage != null) { http.addFilterAt(loginPage, SecurityWebFiltersOrder.LOGIN_PAGE_GENERATING); http.addFilterBefore(DefaultResourcesWebFilter.css(), SecurityWebFiltersOrder.LOGIN_PAGE_GENERATING); if (http.logout != null) { http.addFilterAt(new LogoutPageGeneratingWebFilter(), SecurityWebFiltersOrder.LOGOUT_PAGE_GENERATING); } } } } /** * Configures HTTP Response Headers. * * @author Rob Winch * @since 5.0 * @see #headers(Customizer) */ public final
LoginPageSpec
java
playframework__playframework
core/play/src/main/java/play/inject/BindingKey.java
{ "start": 4706, "end": 5321 }
class ____ needed. */ public <P extends Provider<? extends T>> Binding<T> toProvider(final Class<P> provider) { return underlying.toProvider(provider).asJava(); } /** Bind this binding key to the given instance. */ public Binding<T> toInstance(final T instance) { return underlying.toInstance(instance).asJava(); } /** Bind this binding key to itself. */ public Binding<T> toSelf() { return underlying.toSelf().asJava(); } @Override public String toString() { return underlying.toString(); } public play.api.inject.BindingKey<T> asScala() { return underlying; } }
is
java
hibernate__hibernate-orm
hibernate-core/src/test/java/org/hibernate/orm/test/id/enhanced/SequenceNamingStrategyTest.java
{ "start": 1728, "end": 7491 }
class ____ { @Test public void testSequenceNameStandardStrategy() { verify( TestEntity.class, "TestEntity_SEQ" ); verify( TestEntity.class, StandardNamingStrategy.STRATEGY_NAME, "TestEntity_SEQ" ); verify( TestEntity.class, StandardNamingStrategy.class.getName(), "TestEntity_SEQ" ); } @Test public void testSequenceNameHibernateSequenceStrategy() { verify( TestEntity.class, SingleNamingStrategy.STRATEGY_NAME, "hibernate_sequence" ); verify( TestEntity.class, SingleNamingStrategy.class.getName(), "hibernate_sequence" ); } @Test public void testSequenceNamePreferGeneratorNameStrategy() { verify( TestEntity.class, LegacyNamingStrategy.STRATEGY_NAME, "hibernate_sequence" ); verify( TestEntity.class, LegacyNamingStrategy.class.getName(), "hibernate_sequence" ); } @Test public void testNoGeneratorStandardStrategy() { verify( TestEntity2.class, "table_generator" ); verify( TestEntity2.class, StandardNamingStrategy.STRATEGY_NAME, "table_generator" ); verify( TestEntity2.class, StandardNamingStrategy.class.getName(), "table_generator" ); } @Test public void testNoGeneratorHibernateSequenceStrategy() { verify( TestEntity2.class, SingleNamingStrategy.STRATEGY_NAME, "hibernate_sequence" ); verify( TestEntity2.class, SingleNamingStrategy.class.getName(), "hibernate_sequence" ); } @Test public void testNoGeneratorPreferGeneratorNameStrategy() { verify( TestEntity2.class, LegacyNamingStrategy.STRATEGY_NAME, "table_generator" ); verify( TestEntity2.class, LegacyNamingStrategy.class.getName(), "table_generator" ); } @Test public void testGeneratorWithoutSequenceNameStandardStrategy() { verify( TestEntity3.class, "table_generator" ); verify( TestEntity3.class, StandardNamingStrategy.STRATEGY_NAME, "table_generator" ); verify( TestEntity3.class, StandardNamingStrategy.class.getName(), "table_generator" ); } @Test public void testGeneratorWithoutSequenceNameHibernateSequenceStrategy() { verify( TestEntity3.class, SingleNamingStrategy.STRATEGY_NAME, "hibernate_sequence" ); verify( TestEntity3.class, SingleNamingStrategy.class.getName(), "hibernate_sequence" ); } @Test public void testGeneratorWithoutSequenceNamePreferGeneratorNameStrategy() { verify( TestEntity3.class, LegacyNamingStrategy.STRATEGY_NAME, "table_generator" ); verify( TestEntity3.class, LegacyNamingStrategy.class.getName(), "table_generator" ); } @Test public void testGeneratorWithSequenceNameStandardStrategy() throws Exception { verify( TestEntity4.class, "test_sequence" ); verify( TestEntity4.class, StandardNamingStrategy.STRATEGY_NAME, "test_sequence" ); verify( TestEntity4.class, StandardNamingStrategy.class.getName(), "test_sequence" ); } @Test public void testGeneratorWithSequenceNameHibernateSequenceStrategy() { verify( TestEntity4.class, SingleNamingStrategy.STRATEGY_NAME, "test_sequence" ); verify( TestEntity4.class, SingleNamingStrategy.class.getName(), "test_sequence" ); } @Test public void testGeneratorWithSequenceNamePreferGeneratorNameStrategy() throws Exception { verify( TestEntity4.class, LegacyNamingStrategy.STRATEGY_NAME, "test_sequence" ); verify( TestEntity4.class, LegacyNamingStrategy.class.getName(), "test_sequence" ); } private void verify(Class<?> entityType, String expectedName) { verify( entityType, null, expectedName ); } private void verify(Class<?> entityType, String strategy, String expectedName) { withMetadata( entityType, strategy, (metadata) -> { final Namespace defaultNamespace = metadata.getDatabase().getDefaultNamespace(); final Sequence sequence = defaultNamespace.locateSequence( Identifier.toIdentifier( expectedName ) ); assertThat( sequence ).isNotNull(); final PersistentClass entityBinding = metadata.getEntityBinding( entityType.getName() ); final IdentifierGenerator generator = extractGenerator( metadata, entityBinding ); assertThat( generator ).isInstanceOf( SequenceStyleGenerator.class ); final SequenceStyleGenerator sequenceStyleGenerator = (SequenceStyleGenerator) generator; assertThat( sequenceStyleGenerator.getDatabaseStructure() ).isInstanceOf( SequenceStructure.class ); final SequenceStructure sequenceStructure = (SequenceStructure) sequenceStyleGenerator.getDatabaseStructure(); assertThat( sequenceStructure.getPhysicalName().getObjectName().getText() ).isEqualTo( expectedName ); } ); } private static void withMetadata(Class<?> entityClass, String namingStrategy, Consumer<MetadataImplementor> consumer) { final StandardServiceRegistryBuilder ssrb = ServiceRegistryUtil.serviceRegistryBuilder(); ssrb.applySetting( AvailableSettings.FORMAT_SQL, "false" ); if ( namingStrategy != null ) { ssrb.applySetting( AvailableSettings.ID_DB_STRUCTURE_NAMING_STRATEGY, namingStrategy ); } try ( final ServiceRegistry ssr = ssrb.build() ) { final MetadataSources metadataSources = new MetadataSources( ssr ); metadataSources.addAnnotatedClass( entityClass ); final MetadataImplementor metadata = (MetadataImplementor) metadataSources.buildMetadata(); metadata.orderColumns( false ); metadata.validate(); consumer.accept( metadata ); } } private IdentifierGenerator extractGenerator(MetadataImplementor metadataImplementor, PersistentClass entityBinding) { KeyValue keyValue = entityBinding.getIdentifier(); final Generator generator = keyValue.createGenerator( metadataImplementor.getDatabase().getDialect(), entityBinding.getRootClass(), entityBinding.getIdentifierProperty(), new GeneratorSettingsImpl( metadataImplementor ) ); return generator instanceof IdentifierGenerator ? (IdentifierGenerator) generator : null; } @Entity(name = "TestEntity") public static
SequenceNamingStrategyTest
java
spring-projects__spring-boot
module/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/AcknowledgeMode.java
{ "start": 1206, "end": 3548 }
class ____ { private static final Map<String, AcknowledgeMode> knownModes = new HashMap<>(3); /** * Messages sent or received from the session are automatically acknowledged. This is * the simplest mode and enables once-only message delivery guarantee. */ public static final AcknowledgeMode AUTO = new AcknowledgeMode(Session.AUTO_ACKNOWLEDGE); /** * Messages are acknowledged once the message listener implementation has called * {@link jakarta.jms.Message#acknowledge()}. This mode gives the application (rather * than the JMS provider) complete control over message acknowledgement. */ public static final AcknowledgeMode CLIENT = new AcknowledgeMode(Session.CLIENT_ACKNOWLEDGE); /** * Similar to auto acknowledgment except that said acknowledgment is lazy. As a * consequence, the messages might be delivered more than once. This mode enables * at-least-once message delivery guarantee. */ public static final AcknowledgeMode DUPS_OK = new AcknowledgeMode(Session.DUPS_OK_ACKNOWLEDGE); static { knownModes.put("auto", AUTO); knownModes.put("client", CLIENT); knownModes.put("dupsok", DUPS_OK); } private final int mode; private AcknowledgeMode(int mode) { this.mode = mode; } public int getMode() { return this.mode; } /** * Creates an {@code AcknowledgeMode} of the given {@code mode}. The mode may be * {@code auto}, {@code client}, {@code dupsok} or a non-standard acknowledge mode * that can be {@link Integer#parseInt parsed as an integer}. * @param mode the mode * @return the acknowledge mode */ public static AcknowledgeMode of(String mode) { String canonicalMode = canonicalize(mode); AcknowledgeMode knownMode = knownModes.get(canonicalMode); try { return (knownMode != null) ? knownMode : new AcknowledgeMode(Integer.parseInt(canonicalMode)); } catch (NumberFormatException ex) { throw new IllegalArgumentException("'" + mode + "' is neither a known acknowledge mode (auto, client, or dups_ok) nor an integer value"); } } private static String canonicalize(String input) { StringBuilder canonicalName = new StringBuilder(input.length()); input.chars() .filter(Character::isLetterOrDigit) .map(Character::toLowerCase) .forEach((c) -> canonicalName.append((char) c)); return canonicalName.toString(); } }
AcknowledgeMode
java
google__guice
core/test/com/google/inject/ProvisionExceptionTest.java
{ "start": 13306, "end": 13428 }
class ____ { @Inject void setObject(Object o) { throw new UnsupportedOperationException(); } } static
E
java
spring-projects__spring-boot
module/spring-boot-freemarker/src/main/java/org/springframework/boot/freemarker/autoconfigure/FreeMarkerAutoConfiguration.java
{ "start": 1872, "end": 3286 }
class ____ { private static final Log logger = LogFactory.getLog(FreeMarkerAutoConfiguration.class); private final ApplicationContext applicationContext; private final FreeMarkerProperties properties; FreeMarkerAutoConfiguration(ApplicationContext applicationContext, FreeMarkerProperties properties) { this.applicationContext = applicationContext; this.properties = properties; checkTemplateLocationExists(); } private void checkTemplateLocationExists() { if (logger.isWarnEnabled() && this.properties.isCheckTemplateLocation()) { List<TemplateLocation> locations = getLocations(); if (locations.stream().noneMatch(this::locationExists)) { String suffix = (locations.size() == 1) ? "" : "s"; logger.warn("Cannot find template location" + suffix + ": " + locations + " (please add some templates, " + "check your FreeMarker configuration, or set " + "spring.freemarker.check-template-location=false)"); } } } private List<TemplateLocation> getLocations() { List<TemplateLocation> locations = new ArrayList<>(); for (String templateLoaderPath : this.properties.getTemplateLoaderPath()) { TemplateLocation location = new TemplateLocation(templateLoaderPath); locations.add(location); } return locations; } private boolean locationExists(TemplateLocation location) { return location.exists(this.applicationContext); } }
FreeMarkerAutoConfiguration
java
grpc__grpc-java
util/src/main/java/io/grpc/util/OutlierDetectionLoadBalancer.java
{ "start": 16460, "end": 17303 }
class ____ extends SubchannelPicker { private final SubchannelPicker delegate; OutlierDetectionPicker(SubchannelPicker delegate) { this.delegate = delegate; } @Override public PickResult pickSubchannel(PickSubchannelArgs args) { PickResult pickResult = delegate.pickSubchannel(args); Subchannel subchannel = pickResult.getSubchannel(); if (subchannel != null) { return PickResult.withSubchannel(subchannel, new ResultCountingClientStreamTracerFactory( subchannel.getAttributes().get(ENDPOINT_TRACKER_KEY), pickResult.getStreamTracerFactory())); } return pickResult; } /** * Builds instances of a {@link ClientStreamTracer} that increments the call count in the * tracker for each closed stream. */ final
OutlierDetectionPicker
java
quarkusio__quarkus
extensions/micrometer/runtime/src/main/java/io/quarkus/micrometer/runtime/binder/vertx/VertxPoolMetrics.java
{ "start": 601, "end": 4611 }
class ____ implements PoolMetrics<EventTiming> { private final String poolType; private final int maxPoolSize; private final Timer usage; private final AtomicReference<Double> ratio = new AtomicReference<>(); private final LongAdder current = new LongAdder(); private final LongAdder queue = new LongAdder(); private final Counter completed; private final Counter rejected; private final Timer queueDelay; VertxPoolMetrics(MeterRegistry registry, String poolType, String poolName, int maxPoolSize) { this.poolType = poolType; this.maxPoolSize = maxPoolSize; Tags tags = Tags.of(Tag.of("pool.type", poolType), Tag.of("pool.name", poolName)); queueDelay = Timer.builder(name("queue.delay")) .description("Time spent in the waiting queue before being processed") .tags(tags) .register(registry); usage = Timer.builder(name("usage")) .description("Time spent using resources from the pool") .tags(tags) .register(registry); Gauge.builder(name("queue.size"), new Supplier<Number>() { @Override public Number get() { return queue.doubleValue(); } }) .description("Number of pending elements in the waiting queue") .tags(tags) .strongReference(true) .register(registry); Gauge.builder(name("active"), new Supplier<Number>() { @Override public Number get() { return current.doubleValue(); } }) .description("The number of resources from the pool currently used") .tags(tags) .strongReference(true) .register(registry); if (maxPoolSize > 0) { Gauge.builder(name("idle"), new Supplier<Number>() { @Override public Number get() { return maxPoolSize - current.doubleValue(); } }) .description("The number of resources from the pool currently used") .tags(tags) .strongReference(true) .register(registry); Gauge.builder(name("ratio"), ratio::get) .description("Pool usage ratio") .tags(tags) .strongReference(true) .register(registry); } completed = Counter.builder(name("completed")) .description("Number of times resources from the pool have been acquired") .tags(tags) .register(registry); rejected = Counter.builder(name("rejected")) .description("Number of times submissions to the pool have been rejected") .tags(tags) .register(registry); } private String name(String suffix) { return poolType + ".pool." + suffix; } @Override public EventTiming submitted() { queue.increment(); return new EventTiming(queueDelay); } @Override public void rejected(EventTiming submitted) { queue.decrement(); rejected.increment(); submitted.end(); } @Override public EventTiming begin(EventTiming submitted) { queue.decrement(); submitted.end(); current.increment(); computeRatio(current.longValue()); return new EventTiming(usage); } @Override public void end(EventTiming timer, boolean succeeded) { current.decrement(); computeRatio(current.longValue()); timer.end(); completed.increment(); } @Override public void close() { } private void computeRatio(long inUse) { if (maxPoolSize > 0) { ratio.set((double) inUse / maxPoolSize); } } }
VertxPoolMetrics
java
quarkusio__quarkus
extensions/vertx-http/deployment/src/test/java/io/quarkus/vertx/http/proxy/TrustedXForwarderProxiesFailureTest.java
{ "start": 180, "end": 468 }
class ____ extends AbstractTrustedXForwarderProxiesTest { @RegisterExtension static final QuarkusUnitTest config = createTrustedProxyUnitTest("1.2.3.4"); @Test public void testHeadersAreIgnored() { assertRequestFailure(); } }
TrustedXForwarderProxiesFailureTest
java
mockito__mockito
mockito-core/src/main/java/org/mockito/Mock.java
{ "start": 2859, "end": 5012 }
interface ____ { /** * Mock will have custom answer, see {@link MockSettings#defaultAnswer(Answer)}. * For examples how to use 'Mock' annotation and parameters see {@link Mock}. */ Answers answer() default Answers.RETURNS_DEFAULTS; /** * Mock will be 'stubOnly', see {@link MockSettings#stubOnly()}. * For examples how to use 'Mock' annotation and parameters see {@link Mock}. */ boolean stubOnly() default false; /** * Mock will have custom name (shown in verification errors), see {@link MockSettings#name(String)}. * For examples how to use 'Mock' annotation and parameters see {@link Mock}. */ String name() default ""; /** * Mock will have extra interfaces, see {@link MockSettings#extraInterfaces(Class[])}. * For examples how to use 'Mock' annotation and parameters see {@link Mock}. */ Class<?>[] extraInterfaces() default {}; /** * Mock will be serializable, see {@link MockSettings#serializable()}. * For examples how to use 'Mock' annotation and parameters see {@link Mock}. */ boolean serializable() default false; /** * @deprecated Use {@link Mock#strictness()} instead. * * Mock will be lenient, see {@link MockSettings#lenient()}. * For examples how to use 'Mock' annotation and parameters see {@link Mock}. * * @since 2.23.3 */ @Deprecated boolean lenient() default false; /** * Mock will have custom strictness, see {@link MockSettings#strictness(org.mockito.quality.Strictness)}. * For examples how to use 'Mock' annotation and parameters see {@link Mock}. * * @since 4.6.1 */ Strictness strictness() default Strictness.TEST_LEVEL_DEFAULT; /** * Mock will be created by the given {@link MockMaker}, see {@link MockSettings#mockMaker(String)}. * * @since 4.8.0 */ String mockMaker() default ""; /** * Mock will not attempt to preserve all annotation metadata, see {@link MockSettings#withoutAnnotations()}. * * @since 5.3.0 */ boolean withoutAnnotations() default false;
Mock
java
apache__camel
dsl/camel-xml-io-dsl/src/test/java/org/apache/camel/dsl/xml/io/XmlMainRestsTest.java
{ "start": 1433, "end": 4007 }
class ____ { @Test public void testMainRestsCollector() { // will load XML from target/classes when testing doTestMain( "org/apache/camel/main/xml/camel-rests.xml", null); } @Test public void testMainRestsCollectorScan() { // will load XML from target/classes when testing doTestMain( "org/apache/camel/main/xml/camel-res*.xml", null); } @Test public void testMainRestsCollectorScanWildcardDirClasspathPath() { // will load XML from target/classes when testing doTestMain( "org/apache/camel/main/**/camel-res*.xml", null); } @Test public void testMainRestsCollectorScanClasspathPrefix() { // will load XML from target/classes when testing doTestMain( "classpath:org/apache/camel/main/xml/camel-res*.xml", null); } @Test public void testMainRestsCollectorScanInDir() { doTestMain( "file:src/test/resources/org/apache/camel/main/xml/camel-res*.xml", null); } @Test public void testMainRestsCollectorScanWildcardDirFilePath() { doTestMain( "file:src/test/resources/**/camel-res*.xml", null); } @Test public void testMainRestsCollectorFile() { doTestMain( "file:src/test/resources/org/apache/camel/main/xml/camel-rests.xml,", null); } protected void doTestMain(String includes, String excludes) { Main main = new Main(); main.bind("restConsumerFactory", new MockRestConsumerFactory()); main.configure().withRoutesIncludePattern(includes); main.configure().withRoutesExcludePattern(excludes); main.start(); CamelContext camelContext = main.getCamelContext(); assertNotNull(camelContext); List<RestDefinition> restDefinitions = ((ModelCamelContext) camelContext).getRestDefinitions(); assertEquals(1, restDefinitions.size()); RestDefinition restDefinition = restDefinitions.get(0); assertEquals("bar", restDefinition.getId()); assertEquals("/say/hello", restDefinition.getPath()); List<VerbDefinition> verbs = restDefinition.getVerbs(); assertNotNull(verbs); assertEquals(1, verbs.size()); VerbDefinition verbDefinition = verbs.get(0); assertTrue(verbDefinition instanceof GetDefinition); main.stop(); } }
XmlMainRestsTest
java
apache__dubbo
dubbo-common/src/main/java/org/apache/dubbo/common/convert/multiple/StringToCollectionConverter.java
{ "start": 973, "end": 1069 }
class ____ convert {@link String} to {@link Collection}-based value * * @since 2.7.6 */ public
to
java
spring-projects__spring-framework
spring-websocket/src/test/java/org/springframework/web/socket/AbstractHttpRequestTests.java
{ "start": 1191, "end": 1323 }
class ____ tests using {@link ServerHttpRequest} and {@link ServerHttpResponse}. * * @author Rossen Stoyanchev */ public abstract
for
java
apache__avro
lang/java/archetypes/avro-service-archetype/src/main/resources/archetype-resources/src/main/java/service/SimpleOrderService.java
{ "start": 1142, "end": 1755 }
class ____ implements OrderProcessingService { private Logger log = LoggerFactory.getLogger(SimpleOrderService.class); @Override public Confirmation submitOrder(Order order) throws OrderFailure { log.info("Received order for '{}' items from customer with id '{}'", new Object[] {order.getOrderItems().size(), order.getCustomerId()}); long estimatedCompletion = System.currentTimeMillis() + (5 * 60 * 60); return Confirmation.newBuilder().setCustomerId(order.getCustomerId()).setEstimatedCompletion(estimatedCompletion) .setOrderId(order.getOrderId()).build(); } }
SimpleOrderService
java
elastic__elasticsearch
modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java
{ "start": 16143, "end": 17170 }
class ____ extends Parser<ShapeBuilder<?, ?, ?>> { private LegacyGeoShapeParser() {} @Override public void parse( XContentParser parser, CheckedConsumer<ShapeBuilder<?, ?, ?>, IOException> consumer, MalformedValueHandler malformedHandler ) throws IOException { try { if (parser.currentToken() == XContentParser.Token.START_ARRAY) { while (parser.nextToken() != XContentParser.Token.END_ARRAY) { parse(parser, consumer, malformedHandler); } } else { consumer.accept(ShapeParser.parse(parser)); } } catch (ElasticsearchParseException e) { malformedHandler.notify(e); } } @Override public ShapeBuilder<?, ?, ?> normalizeFromSource(ShapeBuilder<?, ?, ?> geometry) { return geometry; } } public static final
LegacyGeoShapeParser
java
netty__netty
codec-http/src/test/java/io/netty/handler/codec/spdy/TestSpdyFrameDecoderDelegate.java
{ "start": 768, "end": 3562 }
class ____ implements SpdyFrameDecoderDelegate { private final SpdyFrameDecoderDelegate delegate; private final Queue<ByteBuf> buffers = new ArrayDeque<ByteBuf>(); TestSpdyFrameDecoderDelegate(final SpdyFrameDecoderDelegate delegate) { this.delegate = delegate; } @Override public void readDataFrame(int streamId, boolean last, ByteBuf data) { delegate.readDataFrame(streamId, last, data); buffers.add(data); } @Override public void readSynStreamFrame(int streamId, int associatedToStreamId, byte priority, boolean last, boolean unidirectional) { delegate.readSynStreamFrame(streamId, associatedToStreamId, priority, last, unidirectional); } @Override public void readSynReplyFrame(int streamId, boolean last) { delegate.readSynReplyFrame(streamId, last); } @Override public void readRstStreamFrame(int streamId, int statusCode) { delegate.readRstStreamFrame(streamId, statusCode); } @Override public void readSettingsFrame(boolean clearPersisted) { delegate.readSettingsFrame(clearPersisted); } @Override public void readSetting(int id, int value, boolean persistValue, boolean persisted) { delegate.readSetting(id, value, persistValue, persisted); } @Override public void readSettingsEnd() { delegate.readSettingsEnd(); } @Override public void readPingFrame(int id) { delegate.readPingFrame(id); } @Override public void readGoAwayFrame(int lastGoodStreamId, int statusCode) { delegate.readGoAwayFrame(lastGoodStreamId, statusCode); } @Override public void readHeadersFrame(int streamId, boolean last) { delegate.readHeadersFrame(streamId, last); } @Override public void readWindowUpdateFrame(int streamId, int deltaWindowSize) { delegate.readWindowUpdateFrame(streamId, deltaWindowSize); } @Override public void readHeaderBlock(ByteBuf headerBlock) { delegate.readHeaderBlock(headerBlock); buffers.add(headerBlock); } @Override public void readHeaderBlockEnd() { delegate.readHeaderBlockEnd(); } @Override public void readFrameError(String message) { delegate.readFrameError(message); } @Override public void readUnknownFrame(final int frameType, final byte flags, final ByteBuf payload) { delegate.readUnknownFrame(frameType, flags, payload); buffers.add(payload); } void releaseAll() { for (;;) { ByteBuf buf = buffers.poll(); if (buf == null) { return; } buf.release(); } } }
TestSpdyFrameDecoderDelegate
java
spring-projects__spring-security
web/src/main/java/org/springframework/security/web/bind/support/AuthenticationPrincipalArgumentResolver.java
{ "start": 4311, "end": 5080 }
class ____ the {@link Annotation} to find on the * {@link MethodParameter} * @param parameter the {@link MethodParameter} to search for an {@link Annotation} * @return the {@link Annotation} that was found or null. */ private <T extends Annotation> @Nullable T findMethodAnnotation(Class<T> annotationClass, MethodParameter parameter) { T annotation = parameter.getParameterAnnotation(annotationClass); if (annotation != null) { return annotation; } Annotation[] annotationsToSearch = parameter.getParameterAnnotations(); for (Annotation toSearch : annotationsToSearch) { annotation = AnnotationUtils.findAnnotation(toSearch.annotationType(), annotationClass); if (annotation != null) { return annotation; } } return null; } }
of
java
spring-projects__spring-security
config/src/test/java/org/springframework/security/config/annotation/web/configurers/HttpSecuritySecurityMatchersNoMvcTests.java
{ "start": 2431, "end": 4611 }
class ____ { AnnotationConfigWebApplicationContext context; MockHttpServletRequest request; MockHttpServletResponse response; MockFilterChain chain; @Autowired FilterChainProxy springSecurityFilterChain; @BeforeEach public void setup() throws Exception { this.request = new MockHttpServletRequest(); this.request.setMethod("GET"); this.response = new MockHttpServletResponse(); this.chain = new MockFilterChain(); } @AfterEach public void cleanup() { if (this.context != null) { this.context.close(); } } @Test public void securityMatcherWhenNoMvcThenAntMatcher() throws Exception { loadConfig(SecurityMatcherNoMvcConfig.class); this.request.setRequestURI("/path"); this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain); assertThat(this.response.getStatus()).isEqualTo(HttpServletResponse.SC_UNAUTHORIZED); setup(); this.request.setRequestURI("/path.html"); this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain); assertThat(this.response.getStatus()).isEqualTo(HttpServletResponse.SC_OK); setup(); this.request.setRequestURI("/path/"); this.springSecurityFilterChain.doFilter(this.request, this.response, this.chain); List<RequestMatcher> requestMatchers = this.springSecurityFilterChain.getFilterChains() .stream() .map((chain) -> ((DefaultSecurityFilterChain) chain).getRequestMatcher()) .map((matcher) -> ReflectionTestUtils.getField(matcher, "requestMatchers")) .map((matchers) -> (List<RequestMatcher>) matchers) .findFirst() .get(); assertThat(this.response.getStatus()).isEqualTo(HttpServletResponse.SC_OK); assertThat(requestMatchers).hasOnlyElementsOfType(PathPatternRequestMatcher.class); } public void loadConfig(Class<?>... configs) { this.context = new AnnotationConfigWebApplicationContext(); this.context.register(configs); this.context.setServletContext(new MockServletContext()); this.context.refresh(); this.context.getAutowireCapableBeanFactory().autowireBean(this); } @EnableWebSecurity @Configuration @Import(HttpSecuritySecurityMatchersTests.UsersConfig.class) static
HttpSecuritySecurityMatchersNoMvcTests
java
elastic__elasticsearch
modules/lang-painless/src/main/java/org/elasticsearch/painless/node/STry.java
{ "start": 766, "end": 1766 }
class ____ extends AStatement { private final SBlock blockNode; private final List<SCatch> catchNodes; public STry(int identifier, Location location, SBlock blockNode, List<SCatch> catchNodes) { super(identifier, location); this.blockNode = blockNode; this.catchNodes = Collections.unmodifiableList(Objects.requireNonNull(catchNodes)); } public SBlock getBlockNode() { return blockNode; } public List<SCatch> getCatchNodes() { return catchNodes; } @Override public <Scope> void visit(UserTreeVisitor<Scope> userTreeVisitor, Scope scope) { userTreeVisitor.visitTry(this, scope); } @Override public <Scope> void visitChildren(UserTreeVisitor<Scope> userTreeVisitor, Scope scope) { if (blockNode != null) { blockNode.visit(userTreeVisitor, scope); } for (SCatch catchNode : catchNodes) { catchNode.visit(userTreeVisitor, scope); } } }
STry
java
google__gson
gson/src/main/java/com/google/gson/stream/JsonToken.java
{ "start": 751, "end": 2033 }
enum ____ { /** * The opening of a JSON array. Written using {@link JsonWriter#beginArray} and read using {@link * JsonReader#beginArray}. */ BEGIN_ARRAY, /** * The closing of a JSON array. Written using {@link JsonWriter#endArray} and read using {@link * JsonReader#endArray}. */ END_ARRAY, /** * The opening of a JSON object. Written using {@link JsonWriter#beginObject} and read using * {@link JsonReader#beginObject}. */ BEGIN_OBJECT, /** * The closing of a JSON object. Written using {@link JsonWriter#endObject} and read using {@link * JsonReader#endObject}. */ END_OBJECT, /** * A JSON property name. Within objects, tokens alternate between names and their values. Written * using {@link JsonWriter#name} and read using {@link JsonReader#nextName} */ NAME, /** A JSON string. */ STRING, /** * A JSON number represented in this API by a Java {@code double}, {@code long}, or {@code int}. */ NUMBER, /** A JSON {@code true} or {@code false}. */ BOOLEAN, /** A JSON {@code null}. */ NULL, /** * The end of the JSON stream. This sentinel value is returned by {@link JsonReader#peek()} to * signal that the JSON-encoded value has no more tokens. */ END_DOCUMENT }
JsonToken