repo_id
stringclasses
875 values
size
int64
974
38.9k
file_path
stringlengths
10
308
content
stringlengths
974
38.9k
apache/ignite
1,130
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheInterceptorAtomicWithStoreSelfTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ignite.internal.processors.cache; /** * Tests {@link org.apache.ignite.cache.CacheInterceptor}. */ public class GridCacheInterceptorAtomicWithStoreSelfTest extends GridCacheInterceptorAtomicSelfTest { /** {@inheritDoc} */ @Override protected boolean storeEnabled() { return true; } }
apache/ignite
1,149
modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/startcache/CacheAllNodesFilter.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ignite.tests.p2p.startcache; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.lang.IgnitePredicate; /** * */ public class CacheAllNodesFilter implements IgnitePredicate<ClusterNode> { /** {@inheritDoc} */ @Override public boolean apply(ClusterNode clusterNode) { return true; } }
apache/ignite
1,153
modules/core/src/test/java/org/apache/ignite/testsuites/IgniteExternalizableSelfTestSuite.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ignite.testsuites; import org.apache.ignite.internal.GridTopicExternalizableSelfTest; import org.junit.runner.RunWith; import org.junit.runners.Suite; /** * Externalizable self-test suite. */ @RunWith(Suite.class) @Suite.SuiteClasses({GridTopicExternalizableSelfTest.class}) public class IgniteExternalizableSelfTestSuite { }
apache/incubator-hivemall
1,169
core/src/test/java/hivemall/tools/math/InfinityUDFTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package hivemall.tools.math; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class InfinityUDFTest { private InfinityUDF udf; @Before public void setUp() { this.udf = new InfinityUDF(); } @Test public void test() { Assert.assertEquals(true, Double.isInfinite(udf.evaluate())); } }
apache/incubator-hugegraph
1,125
hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/HgStoreNodeBuilder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hugegraph.store.client; /** * created on 2021/10/11 */ public interface HgStoreNodeBuilder { HgStoreNodeBuilder setNodeId(Long nodeId); HgStoreNodeBuilder setAddress(String address); /** * To build a HgStoreNode instance. * * @return */ HgStoreNode build(); }
apache/incubator-kie-drools
1,103
drools-drlonyaml-parent/drools-drlonyaml-integration-tests/src/test/java/org/drools/drlonyaml/integration/tests/Message.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.drools.drlonyaml.integration.tests; public class Message { private final String text; public Message(String text) { this.text = text; } public String getText() { return text; } public int getSize() { return text.length(); } }
apache/incubator-kie-drools
1,140
drools-ruleunits/drools-ruleunits-api/src/main/java/org/drools/ruleunits/api/conf/Clock.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.drools.ruleunits.api.conf; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(value = RetentionPolicy.RUNTIME) @Target(value = ElementType.TYPE) public @interface Clock { ClockType value(); }
apache/incubator-kie-drools
1,152
drools-examples/src/main/java/org/drools/games/numberguess/Guess.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.drools.games.numberguess; public class Guess { private int value; public Guess(int value) { this.value = value; } public int getValue() { return this.value; } @Override public String toString() { return "Guess{" + "value=" + value + '}'; } }
apache/incubator-kie-kogito-runtimes
1,138
grafana-api/src/main/java/org/kie/kogito/grafana/model/panel/table/TableSort.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.kie.kogito.grafana.model.panel.table; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @JsonInclude(JsonInclude.Include.NON_NULL) public class TableSort { @JsonProperty("col") public int col = 0; @JsonProperty("desc") public boolean desc; }
apache/incubator-kie-optaplanner
1,110
core/optaplanner-core-impl/src/test/java/org/optaplanner/core/impl/testdata/domain/multivar/TestdataOtherValue.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.optaplanner.core.impl.testdata.domain.multivar; import org.optaplanner.core.impl.testdata.domain.TestdataObject; public class TestdataOtherValue extends TestdataObject { public TestdataOtherValue() { } public TestdataOtherValue(String code) { super(code); } }
apache/incubator-kie-optaplanner
1,125
core/optaplanner-core-impl/src/main/java/org/optaplanner/core/config/heuristic/selector/package-info.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ @XmlSchema( namespace = SolverConfig.XML_NAMESPACE, elementFormDefault = XmlNsForm.QUALIFIED) package org.optaplanner.core.config.heuristic.selector; import jakarta.xml.bind.annotation.XmlNsForm; import jakarta.xml.bind.annotation.XmlSchema; import org.optaplanner.core.config.solver.SolverConfig;
apache/incubator-kie-optaplanner
1,125
core/optaplanner-core-impl/src/main/java/org/optaplanner/core/config/solver/termination/package-info.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ @XmlSchema( namespace = SolverConfig.XML_NAMESPACE, elementFormDefault = XmlNsForm.QUALIFIED) package org.optaplanner.core.config.solver.termination; import jakarta.xml.bind.annotation.XmlNsForm; import jakarta.xml.bind.annotation.XmlSchema; import org.optaplanner.core.config.solver.SolverConfig;
apache/incubator-nemo
1,173
common/src/main/java/org/apache/nemo/common/KeyExtractor.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.nemo.common; import java.io.Serializable; /** * Extracts a key from an element. * Keys are used for partitioning. */ public interface KeyExtractor extends Serializable { /** * Extracts key. * * @param element Element to get the key from. * @return The extracted key of the element. */ Object extractKey(Object element); }
apache/incubator-retired-edgent
1,107
connectors/file/src/test/java/org/apache/edgent/test/connectors/file/FileStreamsGlobalTest.java
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.apache.edgent.test.connectors.file; /** * FileStreams connector globalization tests. */ public class FileStreamsGlobalTest extends FileStreamsTest { private static final String[] globalLines = new String[] { "學而時習之", "不亦說乎" }; public String[] getLines() { return globalLines; } }
apache/incubator-retired-wave
1,159
wave/src/main/java/org/waveprotocol/box/common/ListReceiver.java
package org.waveprotocol.box.common; /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ import java.util.ArrayList; /** * Callback interface to sequential reception objects to list. * * @author akaplanov@gmail.com (Andrew Kaplanov) */ public class ListReceiver<T> extends ArrayList<T> implements Receiver<T> { @Override public boolean put(T obj) { add(obj); return true; } }
apache/incubator-seata
1,139
saga/seata-saga-engine/src/main/java/org/apache/seata/saga/engine/expression/ExpressionResolver.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seata.saga.engine.expression; /** * Expression structure resolver * */ public interface ExpressionResolver { Expression getExpression(String expressionStr); ExpressionFactoryManager getExpressionFactoryManager(); void setExpressionFactoryManager(ExpressionFactoryManager expressionFactoryManager); }
apache/inlong
1,159
inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/plugin/Source.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.inlong.agent.plugin; import org.apache.inlong.agent.conf.JobProfile; import java.util.List; /** * Source can be split into multiple reader. */ public interface Source { /** * Split source into a list of readers. * * @param conf job conf * @return list of reader */ List<Reader> split(JobProfile conf); }
apache/jackrabbit-oak
1,130
oak-benchmarks-lucene/src/main/java/org/apache/jackrabbit/oak/benchmark/LuceneStatisticalFacetSearchTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jackrabbit.oak.benchmark; public class LuceneStatisticalFacetSearchTest extends LuceneFacetSearchTest { public LuceneStatisticalFacetSearchTest(Boolean storageEnabled) { super(storageEnabled); } @Override protected String getFacetMode() { return STATISTICAL_FACET; } }
apache/jackrabbit-oak
1,152
oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/operation/NodeOperation.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jackrabbit.oak.jcr.session.operation; import org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate; public abstract class NodeOperation<U> extends ItemOperation<U> { protected final NodeDelegate node; protected NodeOperation(NodeDelegate node, String name) { super(node, name); this.node = node; } }
apache/jackrabbit
1,164
jackrabbit-webdav/src/test/java/org/apache/jackrabbit/webdav/io/TestAll.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jackrabbit.webdav.io; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class TestAll extends TestCase { public static Test suite() { TestSuite suite = new TestSuite("WebDAV IO tests"); suite.addTestSuite(OutputContextImplTest.class); return suite; } }
apache/james-project
1,144
protocols/managesieve/src/main/java/org/apache/james/managesieve/api/commands/CheckScript.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.james.managesieve.api.commands; import org.apache.james.managesieve.api.Session; /** * @see <a href=http://tools.ietf.org/html/rfc5804#section-2.12>RFC 5804 CHECKSCRIPT Command</a> */ public interface CheckScript { String checkScript(Session session, String content); }
apache/jclouds
1,139
providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobSignerLiveTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jclouds.azureblob.blobstore.integration; import org.jclouds.blobstore.integration.internal.BaseBlobSignerLiveTest; import org.testng.annotations.Test; @Test(groups = { "live" }) public class AzureBlobSignerLiveTest extends BaseBlobSignerLiveTest { public AzureBlobSignerLiveTest() { provider = "azureblob"; } }
apache/jclouds
1,150
apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/internal/BaseCloudWatchApiLiveTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jclouds.cloudwatch.internal; import org.jclouds.apis.BaseApiLiveTest; import org.jclouds.cloudwatch.CloudWatchApi; import org.testng.annotations.Test; @Test(groups = "live") public class BaseCloudWatchApiLiveTest extends BaseApiLiveTest<CloudWatchApi> { public BaseCloudWatchApiLiveTest() { provider = "cloudwatch"; } }
apache/jena
1,150
jena-geosparql/src/main/java/org/apache/jena/geosparql/spatial/property_functions/EqualsPF.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jena.geosparql.spatial.property_functions; import org.apache.jena.geosparql.geo.topological.GenericPropertyFunction; import org.apache.jena.geosparql.spatial.filter_functions.EqualsFF; /** * * * */ public class EqualsPF extends GenericPropertyFunction { public EqualsPF() { super(new EqualsFF()); } }
apache/jena
1,167
jena-core/src/main/java/org/apache/jena/rdf/model/SeqIndexBoundsException.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jena.rdf.model; import org.apache.jena.shared.JenaException ; /** Exception to throw when the index of a sequence is not in range. */ public class SeqIndexBoundsException extends JenaException { public SeqIndexBoundsException( int limit, int index ) { super( "" + index + " must be in the range 1.." + limit ); } }
apache/jena
1,173
jena-shex/src/test/java/org/apache/jena/shex/runner/RunnerShexValidation.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jena.shex.runner; import org.junit.runners.model.InitializationError; import org.apache.jena.arq.junit4.runners.AbstractRunnerOfTests; public class RunnerShexValidation extends AbstractRunnerOfTests { public RunnerShexValidation(Class<? > klass) throws InitializationError { super(klass, ShexTests::makeShexValidationTest); } }
apache/jena
1,175
jena-base/src/test/java/org/apache/jena/atlas/io/TestPeekReaderSource.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jena.atlas.io; import java.io.StringReader; public class TestPeekReaderSource extends AbstractTestPeekReader { @Override PeekReader make(String contents, int size) { // Very carefully ensure this is not a string-based PeekReader StringReader r = new StringReader(contents); return PeekReader.make(r, size); } }
apache/jena
1,176
jena-base/src/main/java/org/apache/jena/atlas/lib/tuple/TConsumer4.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jena.atlas.lib.tuple; /** * A four-argument consumer in which all arguments are of the same type. Unlike most other functional interfaces, * {@code TConsumer4} is expected to operate via side-effects. * * @param <X> the type of all arguments */ @FunctionalInterface public interface TConsumer4<X> { void accept(X x1, X x2, X x3, X x4); }
apache/kylin
1,159
src/common-service/src/main/java/org/apache/kylin/rest/response/DDLResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kylin.rest.response; import java.util.Map; import org.apache.spark.sql.DDLDesc; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; @Data public class DDLResponse { @JsonProperty("succeed") private Map<String, DDLDesc> succeed; @JsonProperty("failed") private Map<String, String> failed; }
apache/linkis
1,105
linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/java/org/apache/linkis/manager/am/locker/EngineNodeLocker.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.linkis.manager.am.locker; import org.apache.linkis.manager.common.entity.node.EngineNode; import java.util.Optional; public interface EngineNodeLocker { Optional<String> lockEngine(EngineNode engineNode, long timeout); void releaseLock(EngineNode engineNode, String lock); }
apache/linkis
1,126
linkis-public-enhancements/linkis-pes-client/src/main/java/org/apache/linkis/cs/client/listener/ContextClientListener.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.linkis.cs.client.listener; import org.apache.linkis.common.listener.Event; import org.apache.linkis.common.listener.EventListener; public interface ContextClientListener extends EventListener { void onContextCreated(Event event); void onContextUpdated(Event event); void onEvent(Event event); }
apache/linkis
1,140
linkis-public-enhancements/linkis-cs-server/src/test/java/org/apache/linkis/cs/csid/TestContextID.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.linkis.cs.csid; import org.apache.linkis.cs.common.entity.source.ContextID; public class TestContextID implements ContextID { String contextID; @Override public String getContextId() { return contextID; } @Override public void setContextId(String contextId) { this.contextID = contextId; } }
apache/lucene
1,174
lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Bounded.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.lucene.spatial3d.geom; /** * This interface describes methods that determine what the bounds are for a shape. * * @lucene.experimental */ public interface Bounded { /** * Compute bounds for the shape. * * @param bounds is the input bounds object. The input object will be modified. */ public void getBounds(final Bounds bounds); }
apache/maven-archetype
1,151
archetype-common/src/main/java/org/apache/maven/archetype/creator/ArchetypeCreator.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.maven.archetype.creator; import org.apache.maven.archetype.ArchetypeCreationRequest; import org.apache.maven.archetype.ArchetypeCreationResult; /** * Create an archetype from a project. */ public interface ArchetypeCreator { void createArchetype(ArchetypeCreationRequest request, ArchetypeCreationResult result); }
apache/maven-checkstyle-plugin
1,143
src/test/java/org/apache/maven/plugins/checkstyle/ViolationTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.maven.plugins.checkstyle; import junit.framework.TestCase; public class ViolationTest extends TestCase { public void testEquals() { Violation v1 = new Violation("", null, null, "", "", "", ""); Violation v2 = new Violation("", null, null, "", "", "", ""); assertEquals(v1, v2); } }
apache/maven-javadoc-plugin
1,108
src/it/projects/MJAVADOC-639_aggr_static_modulepath/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java
package com.javamodularity.modulea; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * <p>Javadoc aggregation from module a.</p> */ public class HelloWorld { /** * <p>method f does something</p> */ public void f() { } public static void main(String... args) { System.out.println("Hello Modular World!"); } }
apache/maven-javadoc-plugin
1,108
src/it/projects/MJAVADOC-639_aggr_static_modulepath/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java
package com.javamodularity.moduleb; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * <p>Javadoc aggregation from module a.</p> */ public class HelloWorld { /** * <p>method f does something</p> */ public void f() { } public static void main(String... args) { System.out.println("Hello Modular World!"); } }
apache/maven-jlink-plugin
1,153
src/it/projects/MJLINK-26/src/main/java/com/corporate/project/Main.java
package com.corporate.project; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ public class Main { public static void main( String[] args ) { System.out.println( "Main one from Java 9+" ); if ( args.length > 0 ) { for ( String arg : args ) { System.out.println( " Arg: '" + arg + "'" ); } } } }
apache/maven-plugins
1,120
maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/repository/RepositoryBuilderConfigSource.java
package org.apache.maven.plugins.assembly.repository; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuildingRequest; /** * */ public interface RepositoryBuilderConfigSource { MavenProject getProject(); ProjectBuildingRequest getProjectBuildingRequest(); }
apache/mina-sshd
1,150
sshd-common/src/main/java/org/apache/sshd/common/util/io/input/InputStreamWithChannel.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.sshd.common.util.io.input; import java.io.InputStream; import java.nio.channels.Channel; /** * @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a> */ public abstract class InputStreamWithChannel extends InputStream implements Channel { protected InputStreamWithChannel() { super(); } }
apache/mina-sshd
1,171
sshd-common/src/test/java/org/apache/sshd/util/test/NoIoTestCase.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.sshd.util.test; /** * Marker interface used as <A HREF="https://github.com/junit-team/junit4/wiki/categories">jUnit category</A> to * indicate a test that does not require real client/server interaction. * * @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a> */ public interface NoIoTestCase { // Marker interface }
apache/mnemonic
1,180
mnemonic-core/src/main/java/org/apache/mnemonic/RefBreak.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.mnemonic; /** * this class defines an annotation for refbreak methods of non-volatile entity * */ import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.METHOD) @Retention(RetentionPolicy.CLASS) public @interface RefBreak { }
apache/nifi
1,133
nifi-commons/nifi-security-cert-builder/src/main/java/org/apache/nifi/security/cert/builder/CertificateBuilder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.nifi.security.cert.builder; import java.security.cert.X509Certificate; /** * Abstraction for building X.509 Certificates */ public interface CertificateBuilder { /** * Build X.509 Certificate using configured properties * * @return X.509 Certificate */ X509Certificate build(); }
apache/nifi
1,150
nifi-commons/nifi-web-client/src/main/java/org/apache/nifi/web/client/ssl/SSLContextProvider.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.nifi.web.client.ssl; import javax.net.ssl.SSLContext; /** * SSLContext Provider from TLS Context configured */ public interface SSLContextProvider { /** * Get SSL Context * * @param tlsContext TLS Context configured * @return SSL Context */ SSLContext getSslContext(TlsContext tlsContext); }
apache/openjpa
1,143
openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/access/MappedCallbackSup.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.openjpa.persistence.access; import jakarta.persistence.MappedSuperclass; import jakarta.persistence.PrePersist; /* * Mapped superclass which contains no persistent attributes, but contains * a callback. */ @MappedSuperclass public class MappedCallbackSup { @PrePersist public void prePersist() { } }
apache/opennlp
1,146
opennlp-extensions/opennlp-uima/src/main/java/opennlp/uima/namefind/TokenNameFinderModelResource.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package opennlp.uima.namefind; import opennlp.tools.namefind.TokenNameFinderModel; /** * A resource encapsulating an OpenNLP {@link TokenNameFinderModel} which can be shared between * <i>analysis engines</i> and loaded via the UIMA resource model. */ public interface TokenNameFinderModelResource { TokenNameFinderModel getModel(); }
apache/openwebbeans
1,124
webbeans-impl/src/test/java/org/apache/webbeans/test/component/exception/AroundInvokeWithFinalMethodComponent.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.webbeans.test.component.exception; import jakarta.interceptor.AroundInvoke; import jakarta.interceptor.InvocationContext; public class AroundInvokeWithFinalMethodComponent { @AroundInvoke public final Object method2(InvocationContext ctx) throws Exception { return null; } }
apache/openwebbeans
1,133
webbeans-tck/src/test/java/org/apache/webbeans/tck/test/beandiscovery/scoped/ModeScopedModule.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.webbeans.tck.test.beandiscovery.scoped; import jakarta.enterprise.context.RequestScoped; /** * Will get loaded with a beans.xml with bean-discovery-mode="scoped" */ public interface ModeScopedModule { @RequestScoped class ExcplicitlyScopedBeanA { } class NonScopedClassB { } }
apache/ozone
1,135
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/interfaces/ScanResult.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.ozone.container.common.interfaces; import java.util.List; import org.apache.hadoop.ozone.container.ozoneimpl.ContainerScanError; /** * Encapsulates the result of a container scan. */ public interface ScanResult { boolean hasErrors(); boolean isDeleted(); List<ContainerScanError> getErrors(); }
apache/paimon
1,164
paimon-core/src/main/java/org/apache/paimon/operation/metrics/MetricUtils.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.paimon.operation.metrics; import org.slf4j.Logger; /** Utils for metrics. */ public class MetricUtils { public static void safeCall(Runnable runnable, Logger logger) { try { runnable.run(); } catch (Throwable t) { logger.warn("Exception occurs when reporting metrics", t); } } }
apache/phoenix
1,158
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/jmx/monitors/HeapMemoryMonitor.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.phoenix.pherf.jmx.monitors; import java.lang.management.ManagementFactory; import org.apache.phoenix.pherf.jmx.Stat; public class HeapMemoryMonitor implements Monitor { @Override public Stat getStat() { Stat<Long> stat = new Stat(ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed()); return stat; } }
apache/pig
1,208
src/org/apache/pig/builtin/ATAN.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.pig.builtin; /** * ATAN implements a binding to the Java function * {@link java.lang.Math#atan(double) Math.atan(double)} for computing the * arc tangent of value of the argument. The returned value will be a double which is * the arc tangent of the value of input. * */ public class ATAN extends DoubleBase{ Double compute(Double input){ return Math.atan(input); } }
apache/plc4x
1,147
plc4j/drivers/eip/src/test/java/org/apache/plc4x/java/eip/base/EIPParserSerializerBigEndianTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.plc4x.java.eip.base; import org.apache.plc4x.test.parserserializer.ParserSerializerTestsuiteRunner; public class EIPParserSerializerBigEndianTest extends ParserSerializerTestsuiteRunner { public EIPParserSerializerBigEndianTest() { super("/protocols/eip/ParserSerializerTestsuiteBigEndian.xml"); } }
apache/plc4x
1,167
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/codegen/io/DataReaderComplex.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.plc4x.java.spi.codegen.io; import org.apache.plc4x.java.spi.generation.ParseException; import org.apache.plc4x.java.spi.generation.WithReaderArgs; public interface DataReaderComplex<T> extends DataReader<T> { T read(String logicalName, ComplexTypeSupplier<T> complexSupplier, WithReaderArgs... readerArgs) throws ParseException; }
apache/poi
1,167
poi-scratchpad/src/main/java/org/apache/poi/hdgf/exceptions/OldVisioFormatException.java
/* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ package org.apache.poi.hdgf.exceptions; import org.apache.poi.OldFileFormatException; public class OldVisioFormatException extends OldFileFormatException { public OldVisioFormatException(String s) { super(s); } }
apache/polygene-java
1,108
libraries/sql-generator/src/main/java/org/apache/polygene/library/sql/generator/grammar/common/datatypes/ParametrizableDataType.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package org.apache.polygene.library.sql.generator.grammar.common.datatypes; /** * This is marker interface for SQL data types which may be parametrized (like, {@code DECIMAL} or {@code VARCHAR}). * * @author Stanislav Muhametsin */ public interface ParametrizableDataType { }
apache/polygene-java
1,121
libraries/sql-generator/src/main/java/org/apache/polygene/library/sql/generator/grammar/literals/TemporalLiteral.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package org.apache.polygene.library.sql.generator.grammar.literals; /** * This syntax element represents any literal that represents some kind of time. * * @author 2011 Stanislav Muhametsin * @see TimestampTimeLiteral */ public interface TemporalLiteral extends LiteralExpression { }
apache/pulsar
1,136
pulsar-io/kafka-connect-adaptor/src/test/java/org/apache/pulsar/io/kafka/connect/ErrFileStreamSourceTask.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.pulsar.io.kafka.connect; import org.apache.kafka.connect.file.FileStreamSourceTask; public class ErrFileStreamSourceTask extends FileStreamSourceTask { @Override public void commit() throws InterruptedException { throw new org.apache.kafka.connect.errors.ConnectException("blah"); } }
apache/pulsar
1,156
pulsar-common/src/main/java/org/apache/pulsar/common/intercept/InterceptException.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.pulsar.common.intercept; import lombok.Getter; /** * Base exception for the broker interceptor. */ @Getter public class InterceptException extends Exception { private final int errorCode; public InterceptException(int errorCode, String message) { super(message); this.errorCode = errorCode; } }
apache/qpid-broker-j
1,140
broker-core/src/main/java/org/apache/qpid/server/model/ManagedAttributeValueTypeFactoryMethod.java
/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.qpid.server.model; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface ManagedAttributeValueTypeFactoryMethod { }
apache/qpid-broker-j
1,149
broker-core/src/main/java/org/apache/qpid/server/store/UnresolvedConfiguredObject.java
/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.qpid.server.store; import org.apache.qpid.server.model.ConfiguredObject; import java.util.Collection; public interface UnresolvedConfiguredObject<X extends ConfiguredObject<X>> { ConfiguredObject<?> getParent(); Collection<ConfiguredObjectDependency<?>> getUnresolvedDependencies(); X resolve(); }
apache/rocketmq-eventbridge
1,140
common/src/main/java/org/apache/rocketmq/eventbridge/tools/transform/ConstantTransform.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.rocketmq.eventbridge.tools.transform; public class ConstantTransform implements Transform { private String constant; public ConstantTransform(String constant) { this.constant = constant; } @Override public Data process(Data inputData) { return new StringData(constant); } }
apache/rya
1,174
common/rya.api/src/main/java/org/apache/rya/api/utils/CloseableIterator.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.rya.api.utils; import java.util.Iterator; /** * An {@link Iterator} that also extends {@link AutoCloseable} because it has reference to resources * that need to be released once you are done iterating. * * @param <T> The type of object that is iterated over. */ public interface CloseableIterator<T> extends Iterator<T>, AutoCloseable { }
apache/seatunnel
1,089
seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/source/enumerator/state/PendingSplitsState.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seatunnel.connectors.cdc.base.source.enumerator.state; import java.io.Serializable; /** * A checkpoint of the current state of the containing the currently pending splits that are not yet * assigned. */ public interface PendingSplitsState extends Serializable {}
apache/seatunnel
1,098
seatunnel-connectors-v2/connector-tablestore/src/main/java/org/apache/seatunnel/connectors/seatunnel/tablestore/serialize/SeaTunnelRowSerializer.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seatunnel.connectors.seatunnel.tablestore.serialize; import org.apache.seatunnel.api.table.type.SeaTunnelRow; import com.alicloud.openservices.tablestore.model.RowPutChange; public interface SeaTunnelRowSerializer { RowPutChange serialize(SeaTunnelRow seaTunnelRow); }
apache/seatunnel
1,103
seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalogEnum.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seatunnel.connectors.seatunnel.paimon.catalog; public enum PaimonCatalogEnum { FILESYSTEM("filesystem"), HIVE("hive"); final String type; PaimonCatalogEnum(String type) { this.type = type; } public String getType() { return type; } }
apache/seatunnel
1,119
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/dag/execution/ExecutionVertex.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seatunnel.engine.server.dag.execution; import org.apache.seatunnel.engine.core.dag.actions.Action; import lombok.AllArgsConstructor; import lombok.Data; @Data @AllArgsConstructor public class ExecutionVertex { private Long vertexId; private Action action; private int parallelism; }
apache/servicecomb-java-chassis
1,100
swagger/swagger-invocation/invocation-core/src/test/java/org/apache/servicecomb/swagger/invocation/schemas/JaxrsAddBodyV2.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.servicecomb.swagger.invocation.schemas; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; import org.apache.servicecomb.swagger.invocation.schemas.models.AddWrapperV2; @Path("/") public interface JaxrsAddBodyV2 { @Path("/add") @POST int add(AddWrapperV2 addBody); }
apache/shardingsphere
1,097
infra/algorithm/type/key-generator/type/snowflake/src/main/java/org/apache/shardingsphere/infra/algorithm/keygen/snowflake/TimeService.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.infra.algorithm.keygen.snowflake; /** * Time service. */ public class TimeService { /** * Get current millis. * * @return current millis */ public long getCurrentMillis() { return System.currentTimeMillis(); } }
apache/shardingsphere
1,132
test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/cases/casse/SQLE2ETestCaseContext.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.test.e2e.sql.cases.casse; import lombok.Getter; import lombok.RequiredArgsConstructor; /** * SQL E2E test case context. */ @RequiredArgsConstructor @Getter public final class SQLE2ETestCaseContext { private final SQLE2ETestCase testCase; private final String parentPath; }
apache/sis
1,168
endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/ScaleRateOfChange.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.sis.measure; import javax.measure.Quantity; /** * The rate of change of a scale factor, in unity per second. This unit is specific to the EPSG database. * It has the same units as frequency, but it still not the same thing. * * @author Martin Desruisseaux (Geomatys) */ interface ScaleRateOfChange extends Quantity<ScaleRateOfChange> { }
apache/sis
1,169
optional/src/org.apache.sis.gui/main/org/apache/sis/gui/internal/package-info.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * A set of helper classes for the SIS implementation. * * <STRONG>Do not use!</STRONG> * * This package is for internal use by SIS only. Classes in this package * may change in incompatible ways in any future version without notice. * * @author Johann Sorel (Geomatys) * @author Martin Desruisseaux (Geomatys) */ package org.apache.sis.gui.internal;
apache/skywalking-java
1,124
test/plugin/scenarios/kafka-scenario/src/main/java/org/apache/skywalking/apm/toolkit/kafka/KafkaPollAndInvoke.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.skywalking.apm.toolkit.kafka; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface KafkaPollAndInvoke { }
apache/solr
1,166
solr/api/src/java/org/apache/solr/client/api/model/GetClusterPropertyResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.solr.client.api.model; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.v3.oas.annotations.media.Schema; public class GetClusterPropertyResponse extends SolrJerseyResponse { @JsonProperty("clusterProperty") @Schema(description = "The requested cluster property.") public ClusterPropertyDetails clusterProperty; }
apache/sqoop
1,181
src/test/org/apache/sqoop/testcategories/sqooptest/IntegrationTest.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.sqoop.testcategories.sqooptest; /** * An integration test shall test if independently developed classes work together correctly. * An integration test checks a whole scenario and thus may start mini clusters or embedded databases and may connect to * external resources like RDBMS instances. */ public interface IntegrationTest extends SqoopTest { }
apache/stanbol
1,119
ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/cache/URIUnresolvableException.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * */ package org.apache.stanbol.ontologymanager.registry.impl.cache; /** * @author Enrico Daga * @see ODPRegistryCacheManager * */ public class URIUnresolvableException extends ODPRegistryCacheException { /** * */ private static final long serialVersionUID = 2787947324775105883L; }
apache/streampipes
1,119
streampipes-service-discovery-api/src/main/java/org/apache/streampipes/svcdiscovery/api/model/SpServicePathPrefix.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.streampipes.svcdiscovery.api.model; public class SpServicePathPrefix { public static final String DATA_PROCESSOR = "sepa"; public static final String DATA_SINK = "sec"; public static final String DATA_STREAM = "stream"; public static final String ADAPTER = "api/v1/worker/adapters"; }
apache/streampipes
1,135
streampipes-wrapper-flink/src/main/java/org/apache/streampipes/wrapper/flink/FlinkDataProcessorProgram.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.streampipes.wrapper.flink; import org.apache.streampipes.wrapper.params.compat.ProcessorParams; public abstract class FlinkDataProcessorProgram<T extends ProcessorParams> implements IDataProcessorProgram { protected T params; public FlinkDataProcessorProgram(T params) { this.params = params; } }
apache/streampipes
1,142
streampipes-model/src/main/java/org/apache/streampipes/model/canvas/CanvasPosition.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.streampipes.model.canvas; public class CanvasPosition { private float x; private float y; public CanvasPosition() { } public float getX() { return x; } public void setX(float x) { this.x = x; } public float getY() { return y; } public void setY(float y) { this.y = y; } }
apache/syncope
1,141
core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/repo/FIQLQueryRepoExt.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.syncope.core.persistence.jpa.dao.repo; import java.util.List; import org.apache.syncope.core.persistence.api.entity.FIQLQuery; import org.apache.syncope.core.persistence.api.entity.user.User; @FunctionalInterface public interface FIQLQueryRepoExt { List<FIQLQuery> findByOwner(User user, String target); }
apache/syncope
1,146
client/idrepo/console/src/main/java/org/apache/syncope/client/console/commons/PolicyTabProvider.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.syncope.client.console.commons; import java.io.Serializable; import java.util.List; import org.apache.wicket.PageReference; import org.apache.wicket.extensions.markup.html.tabs.ITab; @FunctionalInterface public interface PolicyTabProvider extends Serializable { List<ITab> buildTabList(PageReference pageRef); }
apache/tajo
1,171
tajo-common/src/main/java/org/apache/tajo/exception/InvalidURLException.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tajo.exception; import org.apache.tajo.error.Errors; import org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.ReturnState; public class InvalidURLException extends TajoException { public InvalidURLException(ReturnState e) { super(e); } public InvalidURLException(String url) { super(Errors.ResultCode.INVALID_URL, url); } }
apache/tapestry-5
1,140
tapestry-http/src/main/java/org/apache/tapestry5/http/services/ServletApplicationInitializerFilter.java
// Copyright 2006 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package org.apache.tapestry5.http.services; import jakarta.servlet.ServletContext; /** * Filter interface for {@link org.apache.tapestry5.http.services.ServletApplicationInitializer}. * * @see org.apache.tapestry5.http.services.ServletApplicationInitializer */ public interface ServletApplicationInitializerFilter { /** * Peforms one step of initializing the application before passing off to the next step. */ void initializeApplication(ServletContext context, ServletApplicationInitializer initializer); }
apache/tapestry-5
1,150
tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/InitializationPlan.java
// Copyright 2011 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package org.apache.tapestry5.ioc.internal.util; /** * Performs one initialization step on a newly created object. * * @since 5.3 */ public interface InitializationPlan<T> { /** * The description of the operation, used with the {@link org.apache.tapestry5.ioc.OperationTracker}. * */ String getDescription(); /** * Invoked by the {@link ConstructionPlan} inside a {@linkplain org.apache.tapestry5.ioc.OperationTracker#run(String, Runnable) operation tracker block}. */ void initialize(T instance); }
apache/tomcat
1,177
webapps/examples/WEB-INF/classes/sessions/Item.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package sessions; public enum Item { VIDEO("Beavis & Butt-head Video collection"), MOVIE("X-files movie"), TAPES("Twin peaks tapes"), CD("NIN CD"), BOOK("JSP Book"), TICKETS("Concert tickets"); private final String title; Item(String title) { this.title = title; } public String getTitle() { return title; } }
apache/tomee
1,138
examples/rest-applicationcomposer-mockito/src/main/java/org/superbiz/composed/rest/GreetingService.java
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.superbiz.composed.rest; import jakarta.ejb.Singleton; import jakarta.inject.Inject; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; @Singleton @Path("/greeting") public class GreetingService { @Inject private Messager messager; @GET public String message() { return messager.message(); } }
apache/usergrid
1,126
stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/qakka/exceptions/QakkaRuntimeException.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.usergrid.persistence.qakka.exceptions; public class QakkaRuntimeException extends RuntimeException { public QakkaRuntimeException(String message) { super( message ); } public QakkaRuntimeException(String message, Throwable cause) { super( message, cause ); } }
google/agi
1,179
gapic/src/main/com/google/gapid/glviewer/gl/GlObject.java
/* * Copyright (C) 2017 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.gapid.glviewer.gl; /** * Base class for OpenGL objects owned by a {@link Renderer}. */ public abstract class GlObject { private final Renderer owner; private boolean deleted = false; GlObject(Renderer owner) { this.owner = owner; } /** * Frees the underlying object. * Once deleted the object should no longer be used. */ public void delete() { if (!deleted) { owner.unregister(this); deleted = true; release(); } } /** Delete the underlying OpenGL object */ protected abstract void release(); }
google/android-classyshark
1,142
ClassySharkAndroid/app/src/main/java/com/google/classysharkandroid/utils/UriUtils.java
/* * Copyright 2015 Google, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.classysharkandroid.utils; import android.content.Context; import android.net.Uri; import java.io.FileNotFoundException; import java.io.InputStream; public class UriUtils { public static InputStream getStreamFromUri(Context context, Uri uriFromIntent) throws FileNotFoundException { return context.getContentResolver().openInputStream(uriFromIntent); } public static boolean isAttach(Uri uriFromIntent) { return (uriFromIntent != null) && (uriFromIntent.getScheme().contains("content")); } }
google/binnavi
1,142
src/main/java/com/google/security/zynamics/binnavi/debug/connection/packets/replies/TerminateReply.java
// Copyright 2011-2016 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.security.zynamics.binnavi.debug.connection.packets.replies; /** * Represents the reply to a Terminate request sent to the debug client. */ public final class TerminateReply extends DebuggerReply { /** * Creates a new Terminate reply object. * * @param packetId Packet ID of the reply. * @param errorCode Error code of the reply. If this error code is 0, the requested operation was * successful. */ public TerminateReply(final int packetId, final int errorCode) { super(packetId, errorCode); } }
google/copybara
1,182
java/com/google/copybara/util/SettableSupplier.java
/* * Copyright (C) 2016 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.copybara.util; import com.google.common.base.Preconditions; import java.util.function.Supplier; /** * A {@link Supplier} that allows to defer setting the value after passing it as a parameter. */ public class SettableSupplier<T> implements Supplier<T> { private T value; public void set(T value) { Preconditions.checkState(this.value == null, "Value already set to: %s", this.value); this.value = Preconditions.checkNotNull(value); } @Override public T get() { return Preconditions.checkNotNull(value, "Value is still not set!"); } }
google/gdata-java-client
1,166
java/src/com/google/gdata/wireformats/WireFormatGenerator.java
/* Copyright (c) 2008 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.gdata.wireformats; import com.google.gdata.model.Element; import java.io.IOException; /** * A generator that translates an in-memory representation * into wire content. */ public interface WireFormatGenerator { /** * Generate wire content for tree rooted at {@code root}. * * @param root root of tree * @throws IOException if content generation failed * @throws ContentValidationException if content fails metadata validation */ public void generate(Element root) throws IOException, ContentValidationException; }
google/j2cl
1,140
transpiler/javatests/com/google/j2cl/integration/java/overwrittentypevariables/HashFunctions.java
/* * Copyright 2017 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package overwrittentypevariables; import org.jspecify.annotations.Nullable; public class HashFunctions { public static final <T extends @Nullable Object> HashFunction<T> hashFunction() { return new HashFunction<T>() { @Override public String apply(T input) { return "a"; } }; } public static final <T extends Enum<T>> HashFunction<T> enumHashFunction() { return new HashFunction<T>() { @Override public String apply(T input) { return "" + input.ordinal(); } }; } }
google/j2cl
1,153
transpiler/javatests/com/google/j2cl/readable/java/genericequals/GenericEquals.java
/* * Copyright 2017 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package genericequals; public class GenericEquals<T> { private final T value; private final GenericEquals<T> value2; public GenericEquals(T value) { this.value = value; this.value2 = null; } public Object foo(GenericEquals<?> other) { return other.value2.value; } @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof GenericEquals)) { return false; } GenericEquals<?> other = (GenericEquals<?>) obj; return value.equals(other.value); } }
google/j2cl
1,156
transpiler/javatests/com/google/j2cl/readable/java/typeannotations/ParametricType.java
/* * Copyright 2019 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package typeannotations; import java.util.List; import java.util.Map; import jsinterop.annotations.JsNonNull; /** A parametric type with @JsNonNull annotations. */ interface ParametricType<T> { T m(@JsNonNull String s, T t); List<T> m(List<@JsNonNull String> l, T t); default @JsNonNull List<T> m( @JsNonNull List< @JsNonNull Map< @JsNonNull String @JsNonNull [], Map<@JsNonNull List<@JsNonNull String>[], String @JsNonNull []>>> l) { return null; } }
google/j2objc
1,118
jre_emul/apache_harmony/classlib/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/FakeFox031.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.harmony.beans.tests.support.mock; public class FakeFox031 { public int[] getDefault() { return null; } public void setDefault( int[] i ) {} public int indexedGetDefault( int i) { return 0; } public void indexedSetDefault( int i, int b ) {} }
hibernate/hibernate-orm
1,098
hibernate-core/src/main/java/org/hibernate/sql/results/internal/RowTransformerMapImpl.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.sql.results.internal; import jakarta.persistence.TupleElement; import org.hibernate.sql.results.spi.RowTransformer; import java.util.HashMap; import java.util.List; import java.util.Map; /** * {@link RowTransformer} instantiating a {@link Map} * * @author Gavin King */ public class RowTransformerMapImpl implements RowTransformer<Map<String,Object>> { private final TupleMetadata tupleMetadata; public RowTransformerMapImpl(TupleMetadata tupleMetadata) { this.tupleMetadata = tupleMetadata; } @Override public Map<String,Object> transformRow(Object[] row) { Map<String,Object> map = new HashMap<>( row.length ); List<TupleElement<?>> list = tupleMetadata.getList(); for ( int i = 0; i < row.length; i++ ) { String alias = list.get(i).getAlias(); if ( alias == null ) { alias = Integer.toString(i); } map.put( alias, row[i] ); } return map; } @Override public int determineNumberOfResultElements(int rawElementCount) { return 1; } }
hibernate/hibernate-search
1,095
documentation/src/test/java/org/hibernate/search/documentation/mapper/orm/identifiermapping/customtype/Book.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.search.documentation.mapper.orm.identifiermapping.customtype; import jakarta.persistence.Entity; import jakarta.persistence.Id; import org.hibernate.annotations.Type; import org.hibernate.search.documentation.testsupport.data.ISBN; import org.hibernate.search.documentation.testsupport.data.ISBNUserType; import org.hibernate.search.mapper.pojo.bridge.mapping.annotation.IdentifierBridgeRef; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.DocumentId; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; //tag::include[] @Entity @Indexed public class Book { @Id @Type(ISBNUserType.class) @DocumentId(identifierBridge = @IdentifierBridgeRef(type = ISBNIdentifierBridge.class)) private ISBN isbn; public Book() { } // Getters and setters // ... //tag::getters-setters[] public ISBN getIsbn() { return isbn; } public void setIsbn(ISBN isbn) { this.isbn = isbn; } //end::getters-setters[] } //end::include[]
hibernate/hibernate-validator
1,091
engine/src/main/java/org/hibernate/validator/internal/util/actions/GetDeclaredField.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.validator.internal.util.actions; import java.lang.reflect.Field; /** * Returns the declared field with the specified name or {@code null} if it does not exist. * * @author Emmanuel Bernard */ public final class GetDeclaredField { private GetDeclaredField() { } public static Field action(Class<?> clazz, String fieldName) { return action( clazz, fieldName, false ); } /** * Before using this method, you need to check the {@code HibernateValidatorPermission.ACCESS_PRIVATE_MEMBERS} * permission against the security manager. */ public static Field andMakeAccessible(Class<?> clazz, String fieldName) { return action( clazz, fieldName, true ); } private static Field action(Class<?> clazz, String fieldName, boolean makeAccessible) { try { final Field field = clazz.getDeclaredField( fieldName ); if ( makeAccessible ) { field.setAccessible( true ); } return field; } catch (NoSuchFieldException e) { return null; } } }
hibernate/hibernate-validator
1,109
engine/src/main/java/org/hibernate/validator/internal/util/actions/NewInstance.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.validator.internal.util.actions; import java.lang.invoke.MethodHandles; import java.lang.reflect.InvocationTargetException; import org.hibernate.validator.internal.util.logging.Log; import org.hibernate.validator.internal.util.logging.LoggerFactory; /** * Execute instance creation as privileged action. * * @author Emmanuel Bernard * @author Hardy Ferentschik */ public final class NewInstance { private static final Log LOG = LoggerFactory.make( MethodHandles.lookup() ); private NewInstance() { } public static <T> T action(Class<T> clazz, String message) { try { return clazz.getConstructor().newInstance(); } catch (InstantiationException | NoSuchMethodException | InvocationTargetException e) { throw LOG.getUnableToInstantiateException( message, clazz, e ); } catch (IllegalAccessException e) { throw LOG.getUnableToInstantiateException( clazz, e ); } catch (RuntimeException e) { throw LOG.getUnableToInstantiateException( clazz, e ); } } }