repo_id
stringclasses
875 values
size
int64
974
38.9k
file_path
stringlengths
10
308
content
stringlengths
974
38.9k
apache/crunch
1,029
crunch-core/src/main/java/org/apache/crunch/io/FileReaderFactory.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.crunch.io; import java.util.Iterator; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; public interface FileReaderFactory<T> { Iterator<T> read(FileSystem fs, Path path); }
apache/cxf
1,031
rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HelloWsa.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.cxf.jaxws; import jakarta.jws.WebService; import jakarta.xml.ws.soap.Addressing; @Addressing @WebService public class HelloWsa { public int add(int arg0, int arg1) { return arg0 + arg1; } }
apache/fluss
1,033
fluss-common/src/main/java/org/apache/fluss/metrics/Metric.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.fluss.metrics; import org.apache.fluss.annotation.PublicEvolving; /** * Common super interface for all metrics. * * @since 0.2 */ @PublicEvolving public interface Metric { MetricType getMetricType(); }
apache/freemarker
1,035
freemarker-core/src/main/java/freemarker/core/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. */ /** * The seldom used or advanced parts of the fundamental FreeMarker API, compared to {@link freemarker.template}. * This package also encloses FreeMarker's core parsing/rendering functionality. */ package freemarker.core;
apache/geode
1,040
geode-core/src/main/java/org/apache/geode/ra/GFConnection.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.geode.ra; import java.io.Serializable; import javax.resource.Referenceable; import javax.resource.ResourceException; public interface GFConnection extends Serializable, Referenceable { void close() throws ResourceException; }
apache/giraph
1,030
giraph-core/src/main/java/org/apache/giraph/utils/Factory.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.giraph.utils; /** * Factory for any kind of objects * * @param <T> Return object type */ public interface Factory<T> { /** * Create new object * * @return New object */ T create(); }
apache/gora
1,027
gora-infinispan/src/main/java/org/apache/gora/infinispan/query/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. */ /** * This package contains all the Infinispan store query representation class as well as Result set representing class * when query is executed over the Infinispan dataStore. */ package org.apache.gora.infinispan.query;
apache/harmony
1,028
jdktools/modules/jdktools/src/test/resources/Sample.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 resources; import jdktools.Dependency; public class Sample { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Dependency d = new Dependency(10,20); } }
apache/incubator-weex
1,026
android/sdk/src/main/java/org/apache/weex/dom/CSSConstants.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.weex.dom; public class CSSConstants { public static final float UNDEFINED = Float.NaN; public static boolean isUndefined(float value) { return Float.compare(value, UNDEFINED) == 0; } }
apache/incubator-xtable
1,024
xtable-core/src/test/java/org/apache/xtable/testutil/Issues.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.xtable.testutil; public class Issues { /** Refer to <a href="https://github.com/apache/incubator-xtable/issues/102">GitHub #102</a> */ public static final boolean ISSUE_102_FIXED = false; }
apache/lucene
1,031
lucene/facet/src/java/org/apache/lucene/facet/facetset/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. */ /** * Provides FacetSets faceting capabilities which allows users to facet on high dimensional field * values. See FacetSets.adoc in the docs folder for more information on usage. */ package org.apache.lucene.facet.facetset;
apache/maven-compiler-plugin
1,030
src/it/non-english-warnings/src/test/java/MyTest.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 foo; public class MyTest { public static void main(String[] args) { // the date constructor is deprecated and will cause a warning System.out.println(new java.util.Date(2010, 8, 29)); } }
apache/solr
1,024
solr/core/src/test/org/apache/solr/search/stats/TestExactSharedStatsCache.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.search.stats; public class TestExactSharedStatsCache extends TestBaseStatsCache { @Override protected String getStatsCacheClassName() { return ExactSharedStatsCache.class.getName(); } }
apache/solr
1,036
solr/core/src/java/org/apache/solr/update/processor/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. */ /** * {@link org.apache.solr.update.processor.UpdateRequestProcessorFactory} APIs and implementations * for use in {@link org.apache.solr.update.processor.UpdateRequestProcessorChain}s */ package org.apache.solr.update.processor;
apache/tapestry-5
1,024
tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/IOOperation.java
// Copyright 2013 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; import java.io.IOException; /** * An operation that, when performed, returns a value (like {@link Invokable}, but may throw an {@link java.io.IOException}. * * @since 5.4 * @see OperationTracker#perform(String, IOOperation) */ public interface IOOperation<T> { /** Perform an operation and return a value, or throw the exception. */ T perform() throws IOException; }
apache/tomcat80
1,034
java/org/apache/tomcat/util/http/fileupload/util/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. */ /** * This package contains various IO related utility classes * or methods, which are basically reusable and not necessarily * restricted to the scope of a file upload. */ package org.apache.tomcat.util.http.fileupload.util;
apache/tomee
1,026
container/openejb-core/src/test/java/org/apache/openejb/cdi/AnExtension.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.openejb.cdi; import jakarta.enterprise.inject.spi.Extension; // just here for org.apache.openejb.cdi.AppComposerCdiExtensionTest public class AnExtension implements Extension { // no need of body }
apache/wicket
1,053
wicket-velocity/src/main/java/module-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. */ module org.apache.wicket.velocity { requires static jakarta.servlet; requires org.apache.wicket.util; requires org.apache.wicket.core; requires org.slf4j; requires velocity.engine.core; exports org.apache.wicket.velocity; }
google/guice
1,045
core/src/com/google/inject/ImplementedBy.java
/* * Copyright (C) 2006 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.inject; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Retention; import java.lang.annotation.Target; /** * A pointer to the default implementation of a type. * * @author crazybob@google.com (Bob Lee) */ @Retention(RUNTIME) @Target(TYPE) public @interface ImplementedBy { /** The implementation type. */ Class<?> value(); }
google/startup-os
1,053
common/firestore/MessageWithId.java
/* * Copyright 2018 The StartupOS Authors. * * 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 com.google.startupos.common.firestore; import com.google.auto.value.AutoValue; import com.google.protobuf.Message; /** A holder class for a proto message and an ID, typically the Firestore document ID. */ @AutoValue public abstract class MessageWithId { public abstract String id(); public abstract Message message(); static MessageWithId create(String id, Message msg) { return new AutoValue_MessageWithId(id, msg); } }
openjdk/jdk8
1,045
langtools/test/tools/javac/jvm/T7024096.java
/* * @test /nodynamiccopyright/ * @bug 7024096 * @summary Stack trace has invalid line numbers * @author Bruce Chapman * @compile T7024096.java * @run main T7024096 */ public class T7024096 { private static final int START = 14; // starting line number for the test public static void main(String[] args) { T7024096 m = new T7024096(); m.nest(START); m.nest(START + 1, m.nest(START + 1), m.nest(START + 1), m.nest(START + 2), m.nest(START + 3, m.nest(START + 3))); } public T7024096 nest(int expectedline, T7024096... args) { Exception e = new Exception("expected line#: " + expectedline); int myline = e.getStackTrace()[1].getLineNumber(); if( myline != expectedline) { throw new RuntimeException("Incorrect line number " + "expected: " + expectedline + ", got: " + myline, e); } System.out.format("Got expected line number %d correct %n", myline); return null; } }
openjdk/jtreg
1,082
test/6585912/Fail.java
/* * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* @test */ public class Fail
oracle/nosql
1,025
kvmain/src/main/java/com/sleepycat/je/rep/LogFileRewriteListener.java
/*- * Copyright (C) 2002, 2025, Oracle and/or its affiliates. All rights reserved. * * This file was distributed by Oracle as part of a version of Oracle NoSQL * Database made available at: * * http://www.oracle.com/technetwork/database/database-technologies/nosqldb/downloads/index.html * * Please see the LICENSE file included in the top-level directory of the * appropriate version of Oracle NoSQL Database for a copy of the license and * additional information. */ package com.sleepycat.je.rep; import java.io.File; import java.util.Set; /** * @hidden * A notification callback interface to warn the user that JE is about to * modify previously written log files as part of sync-up rollback. * * @see RollbackException */ public interface LogFileRewriteListener { /** * @hidden * Notifies the user that JE is about to modify previously written log * files. * * @param files the log files that will be modified. */ public void rewriteLogFiles(Set<File> files); }
apache/cxf
1,028
core/src/main/java/org/apache/cxf/staxutils/XMLStreamReaderWrapper.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.cxf.staxutils; import javax.xml.stream.XMLStreamReader; /** * Interface for XMLStreamReader wrappers * */ public interface XMLStreamReaderWrapper { XMLStreamReader wrap(XMLStreamReader reader); }
apache/drill
1,038
common/src/test/java/org/apache/drill/categories/EvfTest.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.drill.categories; /** * A category for tests that test the "Extended Vector Framework" * (EVF): the mechanism that drives the plugin-based scan operator. */ public interface EvfTest { // Junit category marker }
apache/gora
1,029
gora-cassandra/src/main/java/org/apache/gora/cassandra/query/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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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. */ /** * This package contains all the Cassandra store query representation class as well as Result set representing class * when query is executed over the Cassandra dataStore. */ package org.apache.gora.cassandra.query;
apache/gora
1,030
gora-orientdb/src/main/java/org/apache/gora/orientdb/query/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. */ /** * This package contains all the OrientDB dataStore query representation class as well as Result set representing class * when query is executed over the OrientDB dataStore. */ package org.apache.gora.orientdb.query;
apache/impala
1,035
fe/src/main/java/org/apache/impala/catalog/FeDataSource.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.impala.catalog; /** * Frontend interface for interacting with data sources. */ public interface FeDataSource { String getName(); String getLocation(); String getClassName(); String getApiVersion(); }
apache/incubator-heron
1,030
heron/api/src/java/org/apache/heron/api/Constants.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.heron.api; public final class Constants { private Constants() { } public static final String SYSTEM_COMPONENT_ID = "__system"; public static final String SYSTEM_TICK_STREAM_ID = "__tick"; }
apache/jmeter
1,036
src/core/src/main/java/org/apache/jmeter/samplers/Remoteable.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.jmeter.samplers; /** * Marker interface used by ConvertListeners to determine which test elements to wrap * so that the results are processed by the client rather than the server */ public interface Remoteable { }
apache/myfaces
1,026
api/src/main/java/jakarta/faces/event/ComponentSystemEventListener.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 jakarta.faces.event; /** * * @since 2.0 */ public interface ComponentSystemEventListener extends FacesListener { public void processEvent(ComponentSystemEvent event) throws AbortProcessingException; }
apache/pinot
1,025
pinot-common/src/main/java/org/apache/pinot/common/tier/TierStorage.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.pinot.common.tier; /** * Interface for the storage type of the tier */ public interface TierStorage { /** * Returns the type of the storage (e.g. PINOT_SERVER) */ String getType(); }
apache/tomee
1,025
examples/ejb-remote-call-2/src/main/java/org/superbiz/remote/Greetings.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.remote; public interface Greetings extends jakarta.ejb.SessionBean { String morning(String name); String afternoon(String name); String hello(String input) throws GreetingsException; }
apache/xmlbeans
1,026
src/main/java/org/apache/xmlbeans/impl/values/XmlUnsignedByteImpl.java
/* Copyright 2004 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.xmlbeans.impl.values; import org.apache.xmlbeans.XmlUnsignedByte; import org.apache.xmlbeans.SchemaType; public class XmlUnsignedByteImpl extends JavaIntHolderEx implements XmlUnsignedByte { public XmlUnsignedByteImpl() { super(XmlUnsignedByte.type, false); } public XmlUnsignedByteImpl(SchemaType type, boolean complex) { super(type, complex); } }
google/copybara
1,042
java/com/google/copybara/profiler/Listener.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.profiler; /** * A listener that, when registered in a {@link Profiler}, will be notified everytime * a task is started/finished. */ public interface Listener { /** * A notification about a task that has started. */ void taskStarted(Task task); /** * A notification about a task finish. It is guaranteed that {@link Task#isFinished()} * will return true. */ void taskFinished(Task task); }
google/gapid
1,047
gapic/src/main/com/google/gapid/views/Tab.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.views; import org.eclipse.swt.widgets.Control; /** * A tab in the main ui. */ public interface Tab { /** * Reinitializes this tab from the current state of the models. Called if the tab was created * after the UI has already been visible for some time. */ public default void reinitialize() { /* do nothing */ } /** * @return the {@link Control} for this tab. */ public Control getControl(); }
google/oss-fuzz
1,043
projects/apache-commons-imaging/ImagingBmpFuzzer.java
// Copyright 2021 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. // //////////////////////////////////////////////////////////////////////////////// import java.io.IOException; import org.apache.commons.imaging.bytesource.ByteSource; import org.apache.commons.imaging.formats.bmp.BmpImageParser; public class ImagingBmpFuzzer { public static void fuzzerTestOneInput(byte[] input) { try { new BmpImageParser().getBufferedImage(ByteSource.array(input), null); } catch (IOException ignored) { } } }
google/oss-fuzz
1,043
projects/apache-commons-imaging/ImagingGifFuzzer.java
// Copyright 2021 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. // //////////////////////////////////////////////////////////////////////////////// import java.io.IOException; import org.apache.commons.imaging.bytesource.ByteSource; import org.apache.commons.imaging.formats.gif.GifImageParser; public class ImagingGifFuzzer { public static void fuzzerTestOneInput(byte[] input) { try { new GifImageParser().getBufferedImage(ByteSource.array(input), null); } catch (IOException ignored) { } } }
google/oss-fuzz
1,043
projects/apache-commons-imaging/ImagingPngFuzzer.java
// Copyright 2021 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. // //////////////////////////////////////////////////////////////////////////////// import java.io.IOException; import org.apache.commons.imaging.bytesource.ByteSource; import org.apache.commons.imaging.formats.png.PngImageParser; public class ImagingPngFuzzer { public static void fuzzerTestOneInput(byte[] input) { try { new PngImageParser().getBufferedImage(ByteSource.array(input), null); } catch (IOException ignored) { } } }
google/oss-fuzz
1,055
projects/jul-to-slf4j/BridgeFuzzer.java
// Copyright 2022 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. // //////////////////////////////////////////////////////////////////////////////// import com.code_intelligence.jazzer.api.FuzzedDataProvider; import org.slf4j.bridge.SLF4JBridgeHandler; import java.util.logging.Logger; public class BridgeFuzzer { public static void fuzzerTestOneInput(FuzzedDataProvider data) { SLF4JBridgeHandler.install(); Logger julLogger = Logger.getLogger("fuzzLogger"); julLogger.fine(data.consumeRemainingAsString()); } }
google/paco
1,024
Paco/src/com/pacoapp/paco/js/bridge/JavascriptSensorManager.java
package com.pacoapp.paco.js.bridge; import android.content.Context; import android.webkit.JavascriptInterface; import com.pacoapp.paco.sensors.StepSensor; import com.pacoapp.paco.sensors.StepSensorFactory; public class JavascriptSensorManager { private Context context; public JavascriptSensorManager(Context context) { this.context = context; } /** * Returns -1 if there is no step sensor in the phone. * @return */ @JavascriptInterface public int getStepCountFrom(int type) { StepSensor stepSensor = StepSensorFactory.getStepSensor(context, type); if (stepSensor != null) { return stepSensor.getStepCount(); } return -1; } /** * Returns -1 if there is no step sensor in the phone. * @return */ @JavascriptInterface public int getStepCount() { StepSensor stepSensor = StepSensorFactory.getStepSensor(context, StepSensorFactory.ANDROID_STEP_SENSOR); if (stepSensor != null) { return stepSensor.getStepCount(); } return -1; } }
google/zetasql
1,042
java/com/google/zetasql/GraphPropertyDefinition.java
/* * Copyright 2019 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.zetasql; import java.io.Serializable; /** * Represents a property definition in a {@link GraphElementTable}. GraphPropertyDefinition * describes how a {@link GraphPropertyDeclaration} is defined within a {@link GraphElementTable} * with the value expression's original SQL. */ public interface GraphPropertyDefinition extends Serializable { GraphPropertyDeclaration getDeclaration(); String getExpressionSql(); }
apache/cxf
1,026
rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLConstants.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.cxf.binding.xml; public final class XMLConstants { public static final String NS_XML_FORMAT = "http://cxf.apache.org/bindings/xformat"; private XMLConstants() { //utility class } }
apache/dubbo
1,032
dubbo-common/src/main/java/org/apache/dubbo/common/context/ModuleExt.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.dubbo.common.context; import org.apache.dubbo.common.extension.ExtensionScope; import org.apache.dubbo.common.extension.SPI; @SPI(scope = ExtensionScope.MODULE) public interface ModuleExt extends Lifecycle {}
apache/flink
1,030
flink-tests/src/test/java/org/apache/flink/test/plugin/OtherTestSpi.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.flink.test.plugin; import org.apache.flink.core.plugin.Plugin; /** Another service interface for tests of plugin mechanism. */ public interface OtherTestSpi extends Plugin { String otherTestMethod(); }
apache/groovy
1,050
src/main/java/groovy/util/BufferedIterator.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 groovy.util; import java.util.Iterator; /** * An iterator that allows examining the next element without consuming it. * * @since 2.5.0 */ public interface BufferedIterator<T> extends Iterator<T> { T head(); }
apache/groovy
1,055
src/main/java/groovy/util/IFileNameFinder.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 groovy.util; import java.util.List; public interface IFileNameFinder { List<String> getFileNames(String basedir, String pattern); List<String> getFileNames(String basedir, String pattern, String excludesPattern); }
apache/harmony
1,028
classlib/support/src/test/java/tests/support/Support_Proxy_I1.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 tests.support; public interface Support_Proxy_I1 { boolean equals(Object o); int[] array(long[] f); void foo(int i, boolean b); String string(String s) throws Support_Proxy_ParentException, LinkageError; }
apache/hbase
1,026
hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/QuotaType.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.hbase.quotas; import org.apache.yetus.audience.InterfaceAudience; /** * Describe the Quota Type. */ @InterfaceAudience.Public public enum QuotaType { THROTTLE, GLOBAL_BYPASS, SPACE, }
apache/hcatalog
1,028
webhcat/svr/src/main/java/org/apache/hcatalog/templeton/BadParam.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.hcatalog.templeton; /** * Missing required or badly configured paramater. */ public class BadParam extends SimpleWebException { public BadParam(String msg) { super(400, msg); } }
apache/jena
1,027
jena-arq/src/test/java/org/apache/jena/sparql/negation/TS_Negation.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.sparql.negation; import org.junit.platform.suite.api.SelectClasses; import org.junit.platform.suite.api.Suite; @Suite @SelectClasses({ TestGraphDeltas.class }) public class TS_Negation { }
apache/jena
1,031
jena-arq/src/test/java/org/apache/jena/atlas/web/TS_Altas_Web.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.web; import org.junit.platform.suite.api.SelectClasses; import org.junit.platform.suite.api.Suite; @Suite @SelectClasses({ TestContentNegotiation.class } ) public class TS_Altas_Web { }
apache/lucene
1,030
lucene/core/src/java/org/apache/lucene/util/FloatToFloatFunction.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.util; /** * Simple interface to map one float to another (useful in scaling scores). * * @lucene.internal */ @FunctionalInterface public interface FloatToFloatFunction { float apply(float f); }
apache/maven-compiler-plugin
1,031
src/it/non-english-warnings/src/main/java/MyClass.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 foo; public class MyClass { public static void main(String[] args) { // the date constructor is deprecated and will cause a warning System.out.println(new java.util.Date(2010, 8, 29)); } }
apache/pekko
1,044
docs/src/test/java/jdocs/duration/Java.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * license agreements; and to You under the Apache License, version 2.0: * * https://www.apache.org/licenses/LICENSE-2.0 * * This file is part of the Apache Pekko project, which was derived from Akka. */ /* * Copyright (C) 2013-2022 Lightbend Inc. <https://www.lightbend.com> */ package jdocs.duration; // #import import static org.junit.Assert.assertTrue; import scala.concurrent.duration.Deadline; import scala.concurrent.duration.Duration; // #import class Java { public void demo() { // #dsl final Duration fivesec = Duration.create(5, "seconds"); final Duration threemillis = Duration.create("3 millis"); final Duration diff = fivesec.minus(threemillis); assertTrue(diff.lt(fivesec)); assertTrue(Duration.Zero().lt(Duration.Inf())); // #dsl // #deadline final Deadline deadline = Duration.create(10, "seconds").fromNow(); final Duration rest = deadline.timeLeft(); // #deadline rest.toString(); } }
apache/solr
1,024
solr/api/src/java/org/apache/solr/client/api/model/SchemaUniqueKeyResponse.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; public class SchemaUniqueKeyResponse extends SolrJerseyResponse { @JsonProperty("uniqueKey") public String uniqueKey; }
apache/struts
1,032
plugins/tiles/src/main/java/org/apache/tiles/template/package-info.java
/* * $Id: package-info.java 1049711 2010-12-15 21:12:00Z apetrelli $ * * 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. */ /** * Tiles template classes, that enable to write support code for template languages (JSP, FreeMarker, Velocity). */ package org.apache.tiles.template;
apache/tiles
1,032
tiles-template/src/main/java/org/apache/tiles/template/package-info.java
/* * $Id: package-info.java 1049711 2010-12-15 21:12:00Z apetrelli $ * * 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. */ /** * Tiles template classes, that enable to write support code for template languages (JSP, FreeMarker, Velocity). */ package org.apache.tiles.template;
google/cdep
1,031
cdep/src/main/java/io/cdep/cdep/yml/cdepsha25/HashEntry.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 * * 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 io.cdep.cdep.yml.cdepsha25; import io.cdep.annotations.Nullable; @SuppressWarnings("unused") public class HashEntry { @Nullable final public String coordinate; @Nullable final public String sha256; private HashEntry() { this.coordinate = null; this.sha256 = null; } public HashEntry(@Nullable String coordinate, @Nullable String sha256) { this.coordinate = coordinate; this.sha256 = sha256; } }
google/guava
1,028
guava-tests/test/com/google/common/math/TestPlatform.java
/* * Copyright (C) 2011 The Guava Authors * * 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.common.math; import com.google.common.annotations.GwtCompatible; import org.jspecify.annotations.NullUnmarked; /** * @author Chris Povirk */ @GwtCompatible @NullUnmarked final class TestPlatform { static boolean intsCanGoOutOfRange() { return false; } static boolean isAndroid() { return System.getProperty("java.runtime.name", "").contains("Android"); } private TestPlatform() {} }
google/nomulus
1,025
core/src/main/java/google/registry/tools/ListPremiumListsCommand.java
// Copyright 2017 The Nomulus Authors. All Rights Reserved. // // 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 google.registry.tools; import com.beust.jcommander.Parameters; import google.registry.tools.server.ListPremiumListsAction; /** Command to list all premium lists. */ @Parameters(separators = " =", commandDescription = "List all premium lists.") final class ListPremiumListsCommand extends ListObjectsCommand { @Override String getCommandPath() { return ListPremiumListsAction.PATH; } }
google/nomulus
1,028
core/src/main/java/google/registry/model/common/CrossTldSingleton.java
// Copyright 2017 The Nomulus Authors. All Rights Reserved. // // 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 google.registry.model.common; import google.registry.model.ImmutableObject; import jakarta.persistence.Id; import jakarta.persistence.MappedSuperclass; /** A singleton entity in the database. */ @MappedSuperclass public abstract class CrossTldSingleton extends ImmutableObject { public static final long SINGLETON_ID = 1; // There is always exactly one of these. @Id long id = SINGLETON_ID; }
google/paco
1,024
Paco-Server/tests/com/google/sampling/experiential/shared/AllTests.java
/* * Copyright 2011 Google Inc. All Rights Reserved. * * 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.sampling.experiential.shared; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Paco Shared lib tests * @author(Bob Evans) */ public class AllTests extends TestCase { public static Test suite() { Class[] tests = new Class[] { com.google.sampling.experiential.shared.WordCloudTest.class }; return new TestSuite(tests); } }
oracle/nosql
1,035
kvmain/src/main/java/com/sleepycat/je/utilint/NanoTimeUtil.java
/*- * Copyright (C) 2002, 2025, Oracle and/or its affiliates. All rights reserved. * * This file was distributed by Oracle as part of a version of Oracle NoSQL * Database made available at: * * http://www.oracle.com/technetwork/database/database-technologies/nosqldb/downloads/index.html * * Please see the LICENSE file included in the top-level directory of the * appropriate version of Oracle NoSQL Database for a copy of the license and * additional information. */ package com.sleepycat.je.utilint; /** * Utility class for dealing with special cases of System.nanoTime */ public class NanoTimeUtil { /** * Special compare function for comparing times returned by * System.nanoTime() to protect against numerical overflows. * * @return a negative integer, zero, or a positive integer as the * first argument is less than, equal to, or greater than the second. * * @see System#nanoTime */ public static long compare(long t1, long t2) { return t1 - t2; } }
apache/cxf
1,031
rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/Customer.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.cxf.jaxrs.client; public class Customer { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } }
apache/giraph
1,028
giraph-core/src/test/java/org/apache/giraph/comm/MockExceptionHandler.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.giraph.comm; public class MockExceptionHandler implements Thread.UncaughtExceptionHandler{ @Override public void uncaughtException(Thread t, Throwable e) { throw new RuntimeException(e); } }
apache/gobblin
1,027
gobblin-core/src/main/java/org/apache/gobblin/converter/EmptyIterable.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.gobblin.converter; /** * @deprecated. Please use {@link org.apache.gobblin.util.EmptyIterable} instead. */ @Deprecated public class EmptyIterable<T> extends org.apache.gobblin.util.EmptyIterable<T> { }
apache/gora
1,042
gora-core/src/main/java/org/apache/gora/util/Null.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.gora.util; /** * Placeholder for Null type arguments */ public class Null { private static final Null INSTANCE = new Null(); public Null() { } public static Null get() { return INSTANCE; } }
apache/groovy
1,038
src/main/java/org/apache/groovy/internal/util/Supplier.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.groovy.internal.util; import org.apache.groovy.lang.annotation.Incubating; /** * Backport of Java8 Supplier. * INTERNAL USE ONLY. */ @Incubating public interface Supplier<T> { T get(); }
apache/groovy
1,054
src/test/groovy/bugs/ClassInScriptBug.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 bugs; import org.codehaus.groovy.classgen.TestSupport; public class ClassInScriptBug extends TestSupport { public void testBug() throws Exception { assertScript("class X {}\nx = new X()\nprintln(x)"); } }
apache/groovy
1,063
benchmark/bench/spellcheck.java
// $Id: spellcheck.java,v 1.1 2004-05-23 07:14:28 bfulgham Exp $ // http://www.bagley.org/~doug/shootout/ import java.io.*; import java.util.*; public class spellcheck { public static void main(String args[]) throws IOException { int n = Integer.parseInt(args[0]); HashMap dict = new HashMap(); String word; try { BufferedReader in = new BufferedReader(new FileReader("Usr.Dict.Words")); while ((word = in.readLine()) != null) { dict.put(word, new Integer(1)); } in.close(); } catch (IOException e) { System.err.println(e); return; } try { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while ((word = in.readLine()) != null) { if (!dict.containsKey(word)) { System.out.println(word); } } } catch (IOException e) { System.err.println(e); return; } } }
apache/hadoop-mapreduce
1,030
src/java/org/apache/hadoop/mapreduce/jobhistory/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. */ @InterfaceAudience.Private @InterfaceStability.Unstable package org.apache.hadoop.mapreduce.jobhistory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability;
apache/hop
1,024
plugins/tech/neo4j/src/main/java/org/apache/hop/neo4j/core/Neo4jDefaults.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.hop.neo4j.core; public class Neo4jDefaults { public static String TRANS_NODE_UPDATES_GROUP = "NODE_UPDATES"; public static String VARIABLE_NEO4J_CLEANUP_DRIVERS = "NEO4J_CLEANUP_DRIVERS"; }
apache/ignite-3
1,028
modules/raft/src/main/java/org/apache/ignite/raft/jraft/Closure.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.raft.jraft; /** * Callback closure. */ public interface Closure { /** * Called when task is done. * * @param status the task status. */ void run(final Status status); }
apache/impala
1,044
fe/src/main/java/org/apache/impala/catalog/HasName.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.impala.catalog; /** * Interface for named catalog objects, used for sorting and pattern * matching. */ public interface HasName { /** * @return the unqualified name of the object */ public String getName(); }
apache/incubator-hivemall
1,030
core/src/main/java/hivemall/utils/lang/RandomUtils.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.utils.lang; import java.util.UUID; public final class RandomUtils { private RandomUtils() {} public synchronized static String getUUID() { return UUID.randomUUID().toString(); } }
apache/storm
1,025
storm-server/src/main/java/org/apache/storm/daemon/nimbus/TopologyActions.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.storm.daemon.nimbus; /** * Actions that can be done to a topology in nimbus. */ public enum TopologyActions { GAIN_LEADERSHIP, INACTIVATE, ACTIVATE, REBALANCE, KILL, DO_REBALANCE, REMOVE }
apache/tomcat80
1,057
java/javax/websocket/EndpointConfig.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 javax.websocket; import java.util.List; import java.util.Map; public interface EndpointConfig { List<Class<? extends Encoder>> getEncoders(); List<Class<? extends Decoder>> getDecoders(); Map<String,Object> getUserProperties(); }
apache/zeppelin
1,025
cassandra/src/main/java/org/apache/zeppelin/cassandra/ParsingException.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.zeppelin.cassandra; /** * Parsing Exception for Cassandra CQL statement. */ public class ParsingException extends RuntimeException{ public ParsingException(String message) { super(message); } }
google/caliper
1,027
caliper-api/src/main/java/com/google/caliper/model/ExcludeFromJson.java
/* * Copyright (C) 2012 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.caliper.model; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Retention; import java.lang.annotation.Target; /** Indicates that a field or type should not be serialized to JSON. */ @Target({FIELD, TYPE}) @Retention(RUNTIME) public @interface ExcludeFromJson {}
google/cel-java
1,031
protobuf/src/main/java/dev/cel/protobuf/DebugPrinter.java
// Copyright 2025 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 // // 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 dev.cel.protobuf; import picocli.CommandLine.Help.Ansi; final class DebugPrinter { private final boolean debug; static DebugPrinter newInstance(boolean debug) { return new DebugPrinter(debug); } void print(String message) { if (debug) { System.out.println(Ansi.ON.string("@|cyan [CelLiteDescriptorGenerator] |@" + message)); } } private DebugPrinter(boolean debug) { this.debug = debug; } }
google/conscrypt
1,029
openjdk/src/test/java/org/conscrypt/ZpenSSLX509Certificate.java
/* * Copyright 2015 The Android Open Source Project * * 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.conscrypt; import java.io.Serializable; /** * This is a fake class to test de-serialization with malicious payloads. */ public class ZpenSSLX509Certificate implements Serializable { /** This will be set via reflection in the test. */ private static final long serialVersionUID = 0L; public final long mContext; ZpenSSLX509Certificate(long ctx) { mContext = ctx; } }
google/error-prone
1,032
check_api/src/main/java/com/google/errorprone/apply/Diff.java
/* * Copyright 2011 The Error Prone Authors. * * 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.errorprone.apply; /** * All the differences to be applied to a source file to be applied in a refactoring. * * @author sjnickerson@google.com (Simon Nickerson) */ public interface Diff { /** Gets the name of the file this difference applies to */ String getRelevantFileName(); /** Applies this difference to the supplied {@code sourceFile}. */ void applyDifferences(SourceFile sourceFile); }
google/nomulus
1,031
core/src/main/java/google/registry/request/OptionalJsonPayload.java
// Copyright 2023 The Nomulus Authors. All Rights Reserved. // // 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 google.registry.request; import jakarta.inject.Qualifier; import java.lang.annotation.Documented; /** * Dagger qualifier for the HTTP request payload as parsed JSON wrapped in Optional. Can be used for * any kind of request methods - GET, POST, etc. Will provide Optional.empty() if body is not * present. * * @see RequestModule */ @Qualifier @Documented public @interface OptionalJsonPayload {}
google/schemaorg-java
1,026
src/main/java/com/google/schemaorg/JsonLdSyntaxException.java
/* * Copyright 2016 Google Inc. All Rights Reserved. * * 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.schemaorg; import java.io.IOException; /** * Represents the exception related to JSON-LD syntax error during * serializing and deserializing. */ public final class JsonLdSyntaxException extends IOException { public JsonLdSyntaxException(String message) { super(message); } public JsonLdSyntaxException(String message, Throwable throwable) { super(message, throwable); } }
googleworkspace/java-samples
1,026
drive/snippets/drive_v3/src/test/java/TestCreateDrive.java
// Copyright 2022 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 // // 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. import static org.junit.Assert.assertNotNull; import java.io.IOException; import java.security.GeneralSecurityException; import org.junit.Test; // Unit test class for create-drive Drive snippet public class TestCreateDrive extends BaseTest { @Test public void createDrive() throws IOException, GeneralSecurityException { String id = CreateDrive.createDrive(); assertNotNull(id); this.service.drives().delete(id); } }
openjdk/jtreg
1,076
test/rerun/std/IgnoreTest.java
/* * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* @test * @ignore */
apache/cxf
1,030
tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/inherit/C.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.cxf.tools.fortest.inherit; import jakarta.jws.WebMethod; public interface C { String hello(String hello); String bye(String bye); @WebMethod(operationName = "anotherHello") String hello(); }
apache/drill
1,032
drill-yarn/src/main/java/org/apache/drill/yarn/appMaster/Pollable.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.drill.yarn.appMaster; /** * Interface for objects that are polled on each * controller clock tick in order to perform * time-based tasks. */ public interface Pollable { public void tick(long curTime); }
apache/dubbo
1,030
dubbo-compatible/src/main/java/com/alibaba/dubbo/config/MonitorConfig.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 com.alibaba.dubbo.config; @Deprecated public class MonitorConfig extends org.apache.dubbo.config.MonitorConfig { public MonitorConfig() {} public MonitorConfig(String address) { super(address); } }
apache/flex-blazeds
1,033
core/src/main/java/flex/messaging/io/UnknownTypeException.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 flex.messaging.io; /** * */ public class UnknownTypeException extends SerializationException { static final long serialVersionUID = 8407391043989798441L; public UnknownTypeException() { super(); } }
apache/geode
1,025
geode-core/src/main/java/org/apache/geode/internal/util/ObjectIntProcedure.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.geode.internal.util; /** * Similar to the Trove TObjectProcedure, this is used in iterating over some GemFire collections * * */ public interface ObjectIntProcedure { boolean executeWith(Object a, int b); }
apache/gravitino
1,031
core/src/main/java/org/apache/gravitino/storage/IdGenerator.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.gravitino.storage; /** Generate a unique id that maps to a name. */ public interface IdGenerator { /** * Returns a unique identifier. * * @return Next id to be used. */ long nextId(); }
apache/groovy
1,027
subprojects/groovy-swing/src/main/java/groovy/swing/model/ValueModel.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 groovy.swing.model; /** * Represents a model of a value */ public interface ValueModel { Object getValue(); void setValue(Object value); Class getType(); boolean isEditable(); }
apache/hive
1,029
common/src/java/org/apache/hadoop/hive/conf/HiveServer2TransportMode.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.hive.conf; /** * Hive Transport mode. */ public enum HiveServer2TransportMode { /** * Three modes: http, binary or all (which includes binary as well as http). */ http, binary, all }
apache/hop
1,034
ui/src/main/java/org/apache/hop/ui/core/dialog/IDirectoryDialog.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.hop.ui.core.dialog; public interface IDirectoryDialog { void setText(String text); String open(); void setMessage(String message); void setFilterPath(String filterPath); String getFilterPath(); }
apache/iceberg
1,042
api/src/main/java/org/apache/iceberg/IncrementalAppendScan.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.iceberg; /** API for configuring an incremental table scan for appends only snapshots */ public interface IncrementalAppendScan extends IncrementalScan<IncrementalAppendScan, FileScanTask, CombinedScanTask> {}
apache/incubator-tuweni
1,025
rlp/src/main/java/org/apache/tuweni/rlp/InvalidRLPEncodingException.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.tuweni.rlp; /** * Indicates that invalid RLP encoding was encountered. */ public class InvalidRLPEncodingException extends RLPException { public InvalidRLPEncodingException(String message) { super(message); } }
apache/jena
1,025
jena-rdfpatch/src/main/java/org/apache/jena/rdfpatch/system/TxnSyncHandler.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.rdfpatch.system; import org.apache.jena.query.TxnType; public interface TxnSyncHandler { void onBegin(TxnType txnType); void onPromote(); // void onCommit(); // void onAbort(); }
apache/jena
1,027
jena-arq/src/test/java/org/apache/jena/sparql/core/TestDatasetGraphMem.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.sparql.core; public class TestDatasetGraphMem extends AbstractDatasetGraphTests { @Override public DatasetGraph emptyDataset() { return DatasetGraphFactory.create(); } }