repo_id stringclasses 875
values | size int64 974 38.9k | file_path stringlengths 10 308 | content stringlengths 974 38.9k |
|---|---|---|---|
apache/opennlp | 1,119 | opennlp-core/opennlp-formats/src/test/java/opennlp/tools/formats/AbstractSampleStreamTest.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package opennlp.tools.formats;
import opennlp.tools.util.InputStreamFactory;
abstract class AbstractSampleStreamTest extends AbstractFormatTest {
protected InputStreamFactory getFactory(String resource) {
return new ResourceAsStreamFactory(AbstractSampleStreamTest.class, FORMATS_BASE_DIR + resource);
}
}
|
apache/openwebbeans | 1,090 | webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent4.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.webbeans.test.component.inject.broken;
import jakarta.enterprise.inject.Any;
import jakarta.enterprise.inject.Instance;
import jakarta.inject.Inject;
@SuppressWarnings("unchecked")
public class InstanceInjectedBrokenComponent4
{
@Inject @Any Instance instance;
}
|
apache/openwebbeans | 1,112 | webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/DecoratedBean.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.webbeans.test.decorators.generic;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Scope;
@ApplicationScoped
public class DecoratedBean implements GenericInterface<Scope>
{
@Override
public boolean isDecoratorCalled()
{
return false;
}
}
|
apache/ozhera | 1,084 | ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/Env.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.ozhera.monitor.service.model;
import lombok.Data;
/**
* @author gaoxihui
* @date 2022/2/18 11:37 AM
* 接入hera应用对应的环境
*/
@Data
public class Env {
String name;
public Env(){
}
public Env(String name){
this.name = name;
}
}
|
apache/ozhera | 1,088 | ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/TeslaMetric.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.ozhera.monitor.service.model.prometheus;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhangxiaowei
*/
@Data
public class TeslaMetric implements Serializable {
private String group;
private String url;
private double value;
}
|
apache/ozhera | 1,112 | trace-etl/trace-etl-api/src/main/java/org/apache/ozhera/trace/etl/api/service/TraceEtlService.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.ozhera.trace.etl.api.service;
import org.apache.ozhera.trace.etl.domain.HeraTraceEtlConfig;
public interface TraceEtlService {
void insertConfig(HeraTraceEtlConfig config);
void updateConfig(HeraTraceEtlConfig config);
void deleteConfig(HeraTraceEtlConfig config);
} |
apache/pig | 1,141 | src/org/apache/pig/tools/parameters/ParameterSubstitutionException.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.pig.tools.parameters;
public class ParameterSubstitutionException extends ParseException {
static final long serialVersionUID = 1L;
public ParameterSubstitutionException(String msg) {
super(msg);
}
@Override
public String getMessage() {
return super.getMessage();
}
}
|
apache/plc4x | 1,061 | code-generation/protocol-base-mspec/src/main/java/org/apache/plc4x/plugins/codegenerator/language/mspec/model/references/DefaultByteOrderTypeReference.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.plc4x.plugins.codegenerator.language.mspec.model.references;
import org.apache.plc4x.plugins.codegenerator.types.references.ByteOrderTypeReference;
public class DefaultByteOrderTypeReference implements ByteOrderTypeReference {
}
|
apache/poi | 1,154 | poi/src/main/java/org/apache/poi/hssf/OldExcelFormatException.java | /* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.hssf;
import org.apache.poi.OldFileFormatException;
public class OldExcelFormatException extends OldFileFormatException {
public OldExcelFormatException(String s) {
super(s);
}
} |
apache/polygene-java | 1,092 | libraries/logging/src/main/java/org/apache/polygene/library/logging/debug/records/CompositeDebugRecordEntity.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
package org.apache.polygene.library.logging.debug.records;
import org.apache.polygene.api.composite.Composite;
import org.apache.polygene.api.property.Property;
public interface CompositeDebugRecordEntity extends DebugRecord
{
Property<Composite> source();
}
|
apache/polygene-java | 1,095 | libraries/sql-generator/src/test/java/org/apache/polygene/library/sql/generator/SQLiteDataDefinitionTest.java | /*
* Copyright (c) 2012, Paul Merlin.
*
* 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.polygene.library.sql.generator;
import org.apache.polygene.library.sql.generator.vendor.SQLVendor;
import org.apache.polygene.library.sql.generator.vendor.SQLVendorProvider;
import org.apache.polygene.library.sql.generator.vendor.SQLiteVendor;
public class SQLiteDataDefinitionTest
extends AbstractDataDefinitionTest
{
@Override
protected SQLVendor loadVendor()
throws Exception
{
return SQLVendorProvider.createVendor( SQLiteVendor.class );
}
}
|
apache/polygene-java | 1,115 | core/runtime/src/main/java/org/apache/polygene/runtime/injection/InjectionProvider.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
package org.apache.polygene.runtime.injection;
import org.apache.polygene.runtime.injection.provider.InjectionProviderException;
/**
* JAVADOC
*/
public interface InjectionProvider
{
Object provideInjection( InjectionContext context )
throws InjectionProviderException;
}
|
apache/pulsar | 1,109 | tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarBKStateStoreTest.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.pulsar.tests.integration.functions;
import org.apache.pulsar.functions.instance.state.BKStateStoreProviderImpl;
public class PulsarBKStateStoreTest extends PulsarStateTest {
protected PulsarBKStateStoreTest() {
super(BKStateStoreProviderImpl.class.getName());
}
}
|
apache/qpid-broker-j | 1,079 | broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/codec/ValueProducingProtocolHandler.java | /*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
package org.apache.qpid.server.protocol.v1_0.codec;
import org.apache.qpid.server.protocol.v1_0.type.transport.Error;
public interface ValueProducingProtocolHandler extends ProtocolHandler
{
Object getValue();
boolean hasError();
Error getError();
}
|
apache/qpid-broker-j | 1,110 | perftests/src/main/java/org/apache/qpid/disttest/client/property/GeneratedPropertyValue.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.qpid.disttest.client.property;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Provides operations to generate message property values.
*/
public interface GeneratedPropertyValue extends PropertyValue
{
@JsonProperty(value = "@def")
String getDefinition();
}
|
apache/ratis | 1,109 | ratis-test/src/test/java/org/apache/ratis/server/simulation/TestPreAppendLeaderStepDownWithSimulatedRpc.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.ratis.server.simulation;
import org.apache.ratis.server.impl.PreAppendLeaderStepDownTest;
public class TestPreAppendLeaderStepDownWithSimulatedRpc
extends PreAppendLeaderStepDownTest<MiniRaftClusterWithSimulatedRpc>
implements MiniRaftClusterWithSimulatedRpc.FactoryGet {
}
|
apache/ratis | 1,140 | ratis-common/src/main/java/org/apache/ratis/util/function/TriConsumer.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.ratis.util.function;
/** Consumer with three input parameters. */
@FunctionalInterface
public interface TriConsumer<T, U, V> {
/**
* The same as {@link java.util.function.BiConsumer#accept(Object, Object)}}
* except that this method is declared with three parameters.
*/
void accept(T t, U u, V v);
}
|
apache/rya | 1,126 | sail/src/main/java/org/apache/rya/rdftriplestore/inference/InferConstants.java | package org.apache.rya.rdftriplestore.inference;
/*
* 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.
*/
/**
* Interface InferConstants
* Date: Apr 16, 2011
* Time: 7:30:47 AM
*/
public interface InferConstants {
public static final String INFERRED = "inferred";
public static final String TRUE = "true";
public static final String FALSE = "false";
}
|
apache/servicecomb-toolkit | 1,078 | oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/validation/api/OasSpecValidator.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.servicecomb.toolkit.oasv.validation.api;
import io.swagger.v3.oas.models.OpenAPI;
import java.util.List;
/**
* OAS Spec validator
*/
public interface OasSpecValidator {
List<OasViolation> validate(OasValidationContext context, OpenAPI openAPI);
}
|
apache/shardingsphere | 1,056 | proxy/frontend/dialect/firebird/src/main/java/org/apache/shardingsphere/proxy/frontend/firebird/authentication/authenticator/FirebirdAuthenticator.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.shardingsphere.proxy.frontend.firebird.authentication.authenticator;
import org.apache.shardingsphere.authentication.Authenticator;
/**
* Firebird authenticator.
*/
public interface FirebirdAuthenticator extends Authenticator {
}
|
apache/shardingsphere | 1,098 | database/protocol/core/src/main/java/org/apache/shardingsphere/database/protocol/binary/BinaryRow.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.shardingsphere.database.protocol.binary;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import java.util.Collection;
/**
* Binary row.
*/
@RequiredArgsConstructor
@Getter
public final class BinaryRow {
private final Collection<BinaryCell> cells;
}
|
apache/shardingsphere | 1,107 | features/shadow/core/src/main/java/org/apache/shardingsphere/shadow/constant/ShadowOrder.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.shardingsphere.shadow.constant;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
/**
* Shadow order.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ShadowOrder {
/**
* Shadow order.
*/
public static final int ORDER = 55;
}
|
apache/sis | 1,134 | endorsed/src/org.apache.sis.util/main/org/apache/sis/pending/jdk/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.
*/
/**
* Place-holder for classes that do not exist in JDK 11.
*
* <STRONG>Do not use!</STRONG>
*
* This package is for internal use by SIS only. Classes in this package
* may change in incompatible ways in any future version without notice.
*
* @author Martin Desruisseaux (Geomatys)
*/
package org.apache.sis.pending.jdk;
|
apache/solr | 1,136 | solr/api/src/java/org/apache/solr/client/api/model/ListAliasesResponse.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.client.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
public class ListAliasesResponse extends SolrJerseyResponse {
@JsonProperty("aliases")
public Map<String, String> aliases;
@JsonProperty("properties")
public Map<String, Map<String, String>> properties;
}
|
apache/solr | 1,143 | solr/core/src/test/org/apache/solr/cloud/TestLRUStatsCacheCloud.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.cloud;
import org.apache.solr.search.stats.LRUStatsCache;
/** */
public class TestLRUStatsCacheCloud extends TestBaseStatsCacheCloud {
@Override
protected boolean assertSameScores() {
return true;
}
@Override
protected String getImplementationName() {
return LRUStatsCache.class.getName();
}
}
|
apache/solr | 1,148 | solr/core/src/java/org/apache/solr/security/AuthorizationPlugin.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.security;
import java.io.Closeable;
import java.util.Map;
/** Authorization interface that needs to be implemented to write an authorization plugin. */
public interface AuthorizationPlugin extends Closeable {
AuthorizationResponse authorize(AuthorizationContext context);
void init(Map<String, Object> initInfo);
}
|
apache/stratos | 1,087 | components/org.apache.stratos.common/src/main/java/org/apache/stratos/common/services/ComponentActivationEventListener.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.stratos.common.services;
import org.apache.stratos.common.Component;
/**
* Component activation event listener.
*/
public interface ComponentActivationEventListener extends ComponentStartUpEventListener {
public void activated(Component component);
}
|
apache/streampark | 1,085 | streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/domain/ResponseCode.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.streampark.console.base.domain;
public interface ResponseCode {
Long CODE_SUCCESS = 200L;
Long CODE_FAIL = 500L;
Long CODE_UNAUTHORIZED = 401L;
Long CODE_FORBIDDEN = 403L;
Long CODE_FAIL_ALERT = 501L;
Long CODE_FAIL_DETAIL = 502L;
}
|
apache/streampipes | 1,058 | streampipes-extensions/streampipes-connectors-opcua/src/main/java/org/apache/streampipes/extensions/connectors/opcua/config/identity/IdentityConfig.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.streampipes.extensions.connectors.opcua.config.identity;
import org.eclipse.milo.opcua.sdk.client.api.config.OpcUaClientConfigBuilder;
public interface IdentityConfig {
void configureIdentity(OpcUaClientConfigBuilder builder);
}
|
apache/streampipes | 1,089 | streampipes-data-explorer-export/src/main/java/org/apache/streampipes/dataexplorer/export/ObjectStorge/IObjectStorage.java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.streampipes.dataexplorer.export.ObjectStorge;
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
import java.io.IOException;
public interface IObjectStorage {
void store(StreamingResponseBody datastream) throws IOException;
} |
apache/struts | 1,117 | plugins/tiles/src/main/java/org/apache/struts2/tiles/annotation/TilesAddAttribute.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.struts2.tiles.annotation;
/**
* Represents a <code><add-attribute></code> element in <code>tiles.xml</code>.
*
*/
public @interface TilesAddAttribute {
String expression() default "";
String role() default "";
String type() default "";
String value() default "";
}
|
apache/struts | 1,124 | core/src/main/java/org/apache/struts2/util/reflection/ReflectionExceptionHandler.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.struts2.util.reflection;
/**
* Declares a class that wants to handle its own reflection exceptions
*/
public interface ReflectionExceptionHandler {
/**
* Handles a reflection exception
*
* @param ex The reflection exception
*/
void handle(ReflectionException ex);
}
|
apache/struts | 1,136 | plugins/tiles/src/main/java/org/apache/tiles/api/preparer/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.
*/
/**
* "View preparers" are objects that allows the "preparation" of a Tiles artifact
* (definition, template or attribute) before it is rendered.<br>
* It is useful, for example, when a view item should be built and stored in a
* particular context (e.g. a menu) and then rendered.
*/
package org.apache.tiles.api.preparer;
|
apache/syncope | 1,124 | core/spring/src/main/java/org/apache/syncope/core/spring/policy/PolicyException.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.core.spring.policy;
public class PolicyException extends RuntimeException {
private static final long serialVersionUID = -6082115004491662910L;
public PolicyException() {
super();
}
public PolicyException(final String message) {
super(message);
}
}
|
apache/tajo | 1,152 | tajo-common/src/main/java/org/apache/tajo/type/Array.java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.tajo.type;
import com.google.common.collect.ImmutableList;
import static org.apache.tajo.common.TajoDataTypes.Type.ARRAY;
public class Array extends TypeParamterizedType {
Array(Type elementType) {
super(ARRAY, ImmutableList.of(elementType));
}
public Type elementType() {
return this.params.get(0);
}
}
|
apache/tapestry-5 | 1,092 | tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormCancelActionDemo.java | package org.apache.tapestry5.integration.app1.pages;
import org.apache.tapestry5.ComponentAction;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.services.FormSupport;
import java.util.ArrayList;
import java.util.List;
public class FormCancelActionDemo
{
@Property
@Persist
private List<String> messages;
static class AddMessage implements ComponentAction<FormCancelActionDemo>
{
public void execute(FormCancelActionDemo component)
{
component.addMessage("action trigger");
}
}
private void addMessage(String s)
{
if (messages == null)
{
messages = new ArrayList<String>();
}
messages.add(s);
}
@Environmental
private FormSupport formSupport;
void onBeginRenderFromForm()
{
formSupport.storeCancel(this, new AddMessage());
}
void onCanceledFromForm()
{
addMessage("cancel event");
}
}
|
apache/tapestry-5 | 1,106 | tapestry-core/src/test/java/org/apache/tapestry5/internal/services/BeanModelSourceBuilderTest.java | // Copyright 2014 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.internal.services;
import org.apache.tapestry5.beanmodel.BeanModelSourceBuilder;
import org.apache.tapestry5.beanmodel.services.BeanModelSource;
import org.testng.annotations.Test;
/**
* Tests a BeanModelSource created using {@link BeanModelSourceBuilder}.
*/
@Test
public class BeanModelSourceBuilderTest extends AbstractBeanModelSourceImplTest
{
@Override
protected BeanModelSource create()
{
return new BeanModelSourceBuilder().build();
}
}
|
apache/tapestry-5 | 1,116 | tapestry-core/src/main/java/org/apache/tapestry5/services/ComponentEventRequestFilter.java | // Copyright 2007, 2008 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.services;
import java.io.IOException;
/**
* Filter interface for {@link org.apache.tapestry5.services.ComponentEventRequestHandler}.
*/
public interface ComponentEventRequestFilter
{
/**
* Filter for a component action request.
*
* @param parameters defining details of the request
* @param handler to delegate to
*/
void handle(ComponentEventRequestParameters parameters, ComponentEventRequestHandler handler) throws IOException;
}
|
apache/tapestry-5 | 1,116 | tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/test/AutobuildInjectionModule.java | // Copyright 2008 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.test;
import org.apache.tapestry5.commons.MappedConfiguration;
import org.apache.tapestry5.ioc.annotations.Autobuild;
public class AutobuildInjectionModule
{
public static StringTransformer buildStringTransformer(@Autobuild SymbolExpandingTransformer transformer)
{
return transformer;
}
public static void contributeFactoryDefaults(MappedConfiguration<String, String> configuration)
{
configuration.add("fred", "flintstone");
}
}
|
apache/tapestry-5 | 1,117 | tapestry-kaptcha/src/main/java/org/apache/tapestry5/kaptcha/KaptchaSymbolConstants.java | // Copyright 2012-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.kaptcha;
/**
* Defines constants used by the {@link org.apache.tapestry5.kaptcha.modules.KaptchaModule} and related components.
*
* @since 5.3
*/
public class KaptchaSymbolConstants
{
/**
* Sets the default for the {@link org.apache.tapestry5.kaptcha.components.KaptchaField} component's visible parameter.
* This defaults to true.
*
* @since 5.3
*/
public static final String KAPTCHA_DEFAULT_VISIBLE = "tapestry.kaptcha-default-visible";
}
|
apache/tez | 1,117 | tez-dag/src/test/java/org/apache/tez/dag/app/launcher/TestContainerLauncherWrapper.java | /*
* 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.tez.dag.app.launcher;
import org.apache.tez.dag.app.PluginWrapperTestHelpers;
import org.apache.tez.serviceplugins.api.ContainerLauncher;
import com.google.common.collect.Sets;
import org.junit.Test;
public class TestContainerLauncherWrapper {
@Test(timeout = 5000)
public void testDelegation() throws Exception {
PluginWrapperTestHelpers.testDelegation(ContainerLauncherWrapper.class, ContainerLauncher.class,
Sets.newHashSet("getContainerLauncher", "dagComplete", "vertexComplete", "taskAttemptFailed"));
}
}
|
apache/tiles | 1,143 | tiles-api/src/main/java/org/apache/tiles/preparer/package-info.java | /*
* $Id$
*
* 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.
*/
/**
* "View preparers" are objects that allows the "preparation" of a Tiles artifact
* (definition, template or attribute) before it is rendered.<br>
* It is useful, for example, when a view item should be built and stored in a
* particular context (e.g. a menu) and then rendered.
*/
package org.apache.tiles.preparer;
|
apache/tomcat | 1,157 | java/jakarta/servlet/SessionTrackingMode.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.servlet;
/**
* Defines the permitted options for configuring the session tracking mode.
*
* @since Servlet 3.0
*/
public enum SessionTrackingMode {
/**
* Use HTTP cookies.
*/
COOKIE,
/**
* Use url rewriting (also known as path parameter)
*/
URL,
/**
* Use SSL session.
*/
SSL
}
|
apache/tomee | 1,127 | examples/junit5-application-composer/src/main/java/org/superbiz/composed/Movies.java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.superbiz.composed;
import java.util.List;
/**
* @version $Revision: 607077 $ $Date: 2007-12-27 06:55:23 -0800 (Thu, 27 Dec 2007) $
*/
public interface Movies {
void addMovie(Movie movie) throws Exception;
void deleteMovie(Movie movie) throws Exception;
List<Movie> getMovies() throws Exception;
}
|
apache/twill | 1,134 | twill-core/src/main/java/org/apache/twill/internal/ProcessController.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.twill.internal;
import org.apache.twill.common.Cancellable;
/**
* For controlling a launch yarn process.
*
* @param <R> Report type.
*/
public interface ProcessController<R> extends AutoCloseable, Cancellable {
R getReport();
/**
* Request to stop the running process.
*/
void cancel();
}
|
apache/usergrid | 1,122 | stack/rest/src/main/java/org/apache/usergrid/rest/exceptions/ServiceExceptionMapper.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.usergrid.rest.exceptions;
import javax.ws.rs.ext.Provider;
import org.apache.usergrid.services.exceptions.ServiceException;
/** Will map to HTTP 500 INTERNAL_SERVER_ERROR because parent does */
@Provider
public class ServiceExceptionMapper extends AbstractExceptionMapper<ServiceException> {
}
|
apache/usergrid | 1,133 | chop/api/src/main/java/org/apache/usergrid/chop/api/RunResult.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.usergrid.chop.api;
/**
* A single test run of a specific version of a Maven Module under test.
*/
public interface RunResult {
String getId();
String getRunId();
int getRunCount();
int getRunTime();
int getIgnoreCount();
int getFailureCount();
String getFailures();
}
|
apache/wicket | 1,102 | wicket-core-tests/src/test/java/org/apache/wicket/markup/MarkupInheritanceExtension_3.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.wicket.markup;
/**
*/
public class MarkupInheritanceExtension_3 extends MarkupInheritanceBase_3
{
private static final long serialVersionUID = 1L;
/**
* Construct.
*
*/
public MarkupInheritanceExtension_3()
{
// add(new Label("label5", "extension label"));
}
}
|
apache/wicket | 1,125 | wicket-util/src/main/java/org/apache/wicket/util/crypt/NoCryptFactory.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.wicket.util.crypt;
/**
* Crypt factory implementation for noop {@link NoCrypt} class
*
* @author Igor Vaynberg (ivaynberg)
*/
public class NoCryptFactory implements ICryptFactory
{
private static final ICrypt crypt = new NoCrypt();
@Override
public ICrypt newCrypt()
{
return crypt;
}
}
|
apache/xmlbeans | 1,122 | test/perf/src/org/apache/xmlbeans/test/performance/jibx/binding/JibxPurchaseOrder.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.test.performance.jibx.binding;
//import java.util.Calendar;
import java.util.ArrayList;
public class JibxPurchaseOrder{
private Customer customer;
// NEED TO: implement a deserializer for Calendar
private String date;
private ArrayList lineitems;
private Shipper shipper;
public Customer getCustomer(){return customer;}
public String getDate(){return date;}
public ArrayList getLineitems(){return lineitems;}
public Shipper getShipper(){return shipper;}
}
|
google-ar/sceneform-android-sdk | 1,102 | sceneformsrc/sceneform/src/main/java/com/google/ar/sceneform/rendering/FutureHelper.java | package com.google.ar.sceneform.rendering;
import android.util.Log;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
/** Prints error messages if needed. */
@SuppressWarnings({"AndroidApiChecker", "FutureReturnValueIgnored"}) // CompletableFuture
class FutureHelper {
private FutureHelper() {}
/**
* Outputs a log message if input completes exceptionally.
*
* <p>Does not remove the exception from input. If some later handler is able to do more with the
* exception it is still possible.
*
* @param tag tag for the log message.
* @param input A completable future that may have failed.
* @param errorMsg Message to print along with the exception.
* @return input so that the function may be chained.
*/
static <T> CompletableFuture<T> logOnException(
final String tag, final CompletableFuture<T> input, final String errorMsg) {
input.exceptionally(
throwable -> {
Log.e(tag, errorMsg, throwable);
throw new CompletionException(throwable);
});
return input;
}
}
|
google/auto | 1,135 | factory/src/test/resources/bad/AnnotationsToApplyNotAnnotations.java | /*
* Copyright 2023 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 tests;
import com.google.auto.factory.AutoFactory;
import com.google.errorprone.annotations.Immutable;
@AutoFactory.AnnotationsToApply
@interface ImmutableAndSuppressWarnings {
Immutable immutable() default @Immutable;
SuppressWarnings suppressWarnings() default @SuppressWarnings("Immutable");
int whatIsThis() default 23;
Immutable[] andWhatIsThis() default {};
}
@ImmutableAndSuppressWarnings(suppressWarnings = @SuppressWarnings({"unchecked", "Immutable"}))
@AutoFactory
final class AnnotationsToApplyNotAnnotations {}
|
google/binnavi | 1,108 | src/main/java/com/google/security/zynamics/binnavi/debug/connection/interfaces/DebugEventListener.java | // Copyright 2011-2016 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.security.zynamics.binnavi.debug.connection.interfaces;
import com.google.security.zynamics.binnavi.debug.connection.packets.replies.DebuggerReply;
/**
* Listener interface that must be implemented by all classes that want to be notified about raw
* events that arrived from a debug client.
*/
public interface DebugEventListener {
/**
* Called when a new debug event was received.
*
* @param event The debug event that was received.
*/
void receivedEvent(DebuggerReply event);
}
|
google/binnavi | 1,115 | src/main/java/com/google/security/zynamics/zylib/general/comparators/DateComparator.java | // Copyright 2011-2016 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.security.zynamics.zylib.general.comparators;
import java.io.Serializable;
import java.util.Comparator;
import java.util.Date;
public class DateComparator implements Comparator<Date>, Serializable {
/**
* Used for serialization.
*/
private static final long serialVersionUID = -846090338272302586L;
@Override
public int compare(final Date o1, final Date o2) {
if (o1.before(o2)) {
return -1;
} else if (o1.equals(o2)) {
return 0;
} else {
return 1;
}
}
}
|
google/caliper | 1,128 | caliper-runner/src/main/java/com/google/caliper/runner/worker/trial/TrialId.java | /*
* Copyright (C) 2013 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.runner.worker.trial;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.inject.Qualifier;
/** Binding annotation for the current trial id. */
@Retention(RUNTIME)
@Target({FIELD, PARAMETER, METHOD})
@Qualifier
public @interface TrialId {}
|
google/graphicsfuzz | 1,107 | ast/src/main/java/com/graphicsfuzz/common/ast/type/LocalSizeLayoutQualifier.java | /*
* Copyright 2019 The GraphicsFuzz Project 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.graphicsfuzz.common.ast.type;
import java.util.Arrays;
public class LocalSizeLayoutQualifier implements LayoutQualifier {
private final String dimension;
private final int value;
public LocalSizeLayoutQualifier(String dimension, int value) {
assert Arrays.asList("x", "y", "z").contains(dimension);
this.dimension = dimension;
this.value = value;
}
@Override
public String toString() {
return "local_size_" + dimension + " = " + value;
}
}
|
google/guava | 1,133 | guava-testlib/src/com/google/common/collect/testing/DerivedComparable.java | /*
* Copyright (C) 2010 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.collect.testing;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
/**
* Simple derived class to verify that we handle generics correctly.
*
* @author Kevin Bourrillion
*/
@GwtCompatible
public class DerivedComparable extends BaseComparable {
public DerivedComparable(String s) {
super(s);
}
@GwtIncompatible @J2ktIncompatible private static final long serialVersionUID = 0;
}
|
google/j2cl | 1,129 | transpiler/javatests/com/google/j2cl/readable/java/j2kt/ExplicitNotNullable.java | /*
* Copyright 2022 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package j2kt;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
@NullMarked
public class ExplicitNotNullable {
// Replicates wildcard problems in Guava's PairwiseEquivalence.
static class DependentTypeParameters<E, T extends @Nullable E> {
DependentTypeParameters<E, T> getThis() {
return this;
}
}
// TODO(b/255955130): Uncomment when fixed.
// DependentTypeParameters<?, ?> testDependentWildcards(DependentTypeParameters<?, ?> x) {
// return x.getThis();
// }
}
|
google/j2cl | 1,139 | jre/javatests/com/google/j2cl/jre/java/util/ArraysDoubleSemanticsTest.java | /*
* Copyright 2019 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* 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.j2cl.jre.java.util;
import java.util.Arrays;
/** Tests {@link Arrays} Double semantics. */
public class ArraysDoubleSemanticsTest extends EmulTestBase {
public void testEquals() throws Exception {
assertFalse(Arrays.equals(new Double[] {-0.0d}, new Double[] {0.0d}));
assertTrue(Arrays.equals(new Double[] {Double.NaN}, new Double[] {Double.NaN}));
assertFalse(Arrays.equals(new double[] {-0.0d}, new double[] {0.0d}));
assertTrue(Arrays.equals(new double[] {Double.NaN}, new double[] {Double.NaN}));
}
}
|
google/MOE | 1,122 | client/src/main/java/com/google/devtools/moe/client/options/DebugOptions.java | /*
* Copyright (c) 2015 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.devtools.moe.client.options;
import org.kohsuke.args4j.Option;
/**
* Options/Flag class to hold the {@code --debug} option
*/
public class DebugOptions {
@Option(name = "--debug", handler = BooleanOptionHandler.class, usage = "Logs debug information.")
boolean debug = false;
@Option(name = "--trace", handler = BooleanOptionHandler.class, usage = "Logs task timing.")
boolean trace = false;
public boolean debug() {
return debug;
}
public boolean trace() {
return trace;
}
}
|
google/mug | 1,144 | mug-safesql/src/test/java/com/google/mu/safesql/ResultMapperTest.java | package com.google.mu.safesql;
import static com.google.common.truth.Truth.assertThat;
import static java.util.stream.Collectors.toList;
import java.util.List;
import java.util.stream.Stream;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.google.common.primitives.Primitives;
import com.google.testing.junit.testparameterinjector.TestParameter;
import com.google.testing.junit.testparameterinjector.TestParameter.TestParameterValuesProvider;
import com.google.testing.junit.testparameterinjector.TestParameterInjector;
@RunWith(TestParameterInjector.class)
public class ResultMapperTest {
@Test public void testWrapperType(
@TestParameter(valuesProvider = SampleClassesProvider.class) Class<?> type) {
assertThat(ResultMapper.wrapperType(type)).isEqualTo(Primitives.wrap(type));
}
private static final class SampleClassesProvider implements TestParameterValuesProvider {
@Override
public List<?> provideValues() {
return Stream.concat(
Primitives.allPrimitiveTypes().stream(),
Primitives.allWrapperTypes().stream())
.collect(toList());
}
}
}
|
google/tsunami-security-scanner-plugins | 1,056 | google/detectors/rce/tomcat/ghostcat/src/main/java/com/google/tsunami/plugins/detectors/rce/tomcat/ghostcat/ajp/AjpConnection.java | /*
* Copyright 2020 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.tsunami.plugins.detectors.rce.tomcat.ghostcat.ajp;
import java.io.IOException;
/** An helper that performs the Ghostcat exploit against a given exposed AJP connector. */
public interface AjpConnection {
AjpResponse performGhostcat(String reqUri, String path) throws IOException;
/** The factory of {@link AjpConnection} types for usage with assisted injection. */
interface Factory {
AjpConnection create(String ip, int port);
}
}
|
googleads/google-ads-java | 1,090 | google-ads-stubs-v19/src/main/java/com/google/ads/googleads/v19/common/ProductChannelExclusivityInfoOrBuilder.java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/ads/googleads/v19/common/criteria.proto
// Protobuf Java Version: 3.25.7
package com.google.ads.googleads.v19.common;
public interface ProductChannelExclusivityInfoOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.ads.googleads.v19.common.ProductChannelExclusivityInfo)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* Value of the availability.
* </pre>
*
* <code>.google.ads.googleads.v19.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity channel_exclusivity = 1;</code>
* @return The enum numeric value on the wire for channelExclusivity.
*/
int getChannelExclusivityValue();
/**
* <pre>
* Value of the availability.
* </pre>
*
* <code>.google.ads.googleads.v19.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity channel_exclusivity = 1;</code>
* @return The channelExclusivity.
*/
com.google.ads.googleads.v19.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity getChannelExclusivity();
}
|
googleads/google-ads-java | 1,090 | google-ads-stubs-v20/src/main/java/com/google/ads/googleads/v20/common/ProductChannelExclusivityInfoOrBuilder.java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/ads/googleads/v20/common/criteria.proto
// Protobuf Java Version: 3.25.7
package com.google.ads.googleads.v20.common;
public interface ProductChannelExclusivityInfoOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.ads.googleads.v20.common.ProductChannelExclusivityInfo)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* Value of the availability.
* </pre>
*
* <code>.google.ads.googleads.v20.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity channel_exclusivity = 1;</code>
* @return The enum numeric value on the wire for channelExclusivity.
*/
int getChannelExclusivityValue();
/**
* <pre>
* Value of the availability.
* </pre>
*
* <code>.google.ads.googleads.v20.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity channel_exclusivity = 1;</code>
* @return The channelExclusivity.
*/
com.google.ads.googleads.v20.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity getChannelExclusivity();
}
|
googleads/google-ads-java | 1,090 | google-ads-stubs-v21/src/main/java/com/google/ads/googleads/v21/common/ProductChannelExclusivityInfoOrBuilder.java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/ads/googleads/v21/common/criteria.proto
// Protobuf Java Version: 3.25.7
package com.google.ads.googleads.v21.common;
public interface ProductChannelExclusivityInfoOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.ads.googleads.v21.common.ProductChannelExclusivityInfo)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* Value of the availability.
* </pre>
*
* <code>.google.ads.googleads.v21.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity channel_exclusivity = 1;</code>
* @return The enum numeric value on the wire for channelExclusivity.
*/
int getChannelExclusivityValue();
/**
* <pre>
* Value of the availability.
* </pre>
*
* <code>.google.ads.googleads.v21.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity channel_exclusivity = 1;</code>
* @return The channelExclusivity.
*/
com.google.ads.googleads.v21.enums.ProductChannelExclusivityEnum.ProductChannelExclusivity getChannelExclusivity();
}
|
googleapis/google-cloud-java | 1,097 | java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/Constants.java | /*
* Copyright 2024 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 com.google.cloud.vertexai;
/** A class that holds all constants for vertexai. */
public final class Constants {
// Constants for VertexAI class
public static final String USER_AGENT_HEADER = "model-builder";
static final String DEFAULT_LOCATION = "us-central1";
static final String GOOGLE_CLOUD_REGION = "GOOGLE_CLOUD_REGION";
static final String CLOUD_ML_REGION = "CLOUD_ML_REGION";
static final String GOOGLE_CLOUD_PROJECT = "GOOGLE_CLOUD_PROJECT";
private Constants() {}
}
|
googlecreativelab/tunnelvision | 1,089 | app/src/main/java/com/androidexperiments/tunnelvision/datatextures/NoiseSampler.java | package com.androidexperiments.tunnelvision.datatextures;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import com.androidexperiments.tunnelvision.datatextures.canvas.CanvasSampler;
import java.util.Random;
/**
* Created by kylephillips on 5/26/15.
*/
public class NoiseSampler extends CanvasSampler
{
protected int getRandom()
{
Random rn = new Random();
return rn.nextInt(getNumTones());
}
@Override
public boolean draw()
{
if( !super.draw() )
{
return false;
}
Random rand = new Random();
Canvas c = getCanvas();
Paint paint = new Paint();
paint.setStyle(Paint.Style.FILL_AND_STROKE);
for( int x=0; x<getWidth(); x++ )
{
for( int y=0; y<getHeight(); y++ )
{
int shade = rand.nextInt(mNumTones) + 1;
paint.setColor(Color.argb(255, 0, 0, shade));
c.drawPoint(x, y, paint);
}
}
return true;
}
}
|
hibernate/hibernate-demos | 1,031 | openshift/message-board/message-service/src/test/java/org/hibernate/demo/message/post/core/entity/BoardTest.java | package org.hibernate.demo.message.post.core.entity;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.List;
import org.junit.Test;
public class BoardTest {
private static final String USERNAME = "cacciapuoti";
@Test
public void testPopMiddleMessage() {
Message message1 = new Message( USERNAME, "Hi #a!" );
message1.setId( 1l );
Message message2 = new Message( USERNAME, "Hi #b!" );
message2.setId( 2l );
Message message3 = new Message( USERNAME, "Hi #c!" );
message3.setId( 3l );
Message message4 = new Message( USERNAME, "Hi #d!" );
message4.setId( 4l );
// add all messages
Board board = new Board( message1 );
board.pushMessage( message2 );
board.pushMessage( message3 );
board.pushMessage( message4 );
// pop from the middle
board.popMessage( message3 );
// getMessages presents the message in the reverse order
// for that message4 precedes the other messages
assertThat( board.getMessages() ).containsExactly( message4, message2, message1 );
}
}
|
hibernate/hibernate-demos | 1,046 | hibernate-search/hsearch-elasticsearch-wikipedia/src/main/java/org/hibernate/search/demos/wikipedia/data/User.java | package org.hibernate.search.demos.wikipedia.data;
import jakarta.persistence.Basic;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.SequenceGenerator;
import jakarta.persistence.Table;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField;
@Entity
@Table(name = "user_") // "user" is an SQL keyword
@Indexed(index = "user")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "userId")
@SequenceGenerator(name = "userId", sequenceName = "user_id_seq", allocationSize = 1)
private Long id;
@Basic(optional = false)
@KeywordField(normalizer = "cleaned_keyword")
private String username;
public Long getId() {
return id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
|
hibernate/hibernate-ogm | 1,055 | core/src/test/java/org/hibernate/ogm/backendtck/type/datetime/LocalTimeEntity.java | /*
* Hibernate OGM, Domain model persistence for NoSQL datastores
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ogm.backendtck.type.datetime;
import java.time.LocalTime;
import javax.persistence.Entity;
import javax.persistence.Id;
/**
* Owns a {@link LocalTime} field
*
* @author Fabio Massimo Ercoli
*/
@Entity
public class LocalTimeEntity {
@Id
private Integer id;
private String name;
private LocalTime time;
public LocalTimeEntity() {
}
public LocalTimeEntity(Integer id, String name, LocalTime time) {
this.id = id;
this.name = name;
this.time = time;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public LocalTime getTime() {
return time;
}
public void setTime(LocalTime time) {
this.time = time;
}
}
|
hibernate/hibernate-ogm | 1,063 | infinispan-remote/src/main/java/org/hibernate/ogm/datastore/infinispanremote/impl/protobuf/UUIDProtofieldAccessor.java | /*
* Hibernate OGM, Domain model persistence for NoSQL datastores
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ogm.datastore.infinispanremote.impl.protobuf;
import java.util.UUID;
import org.infinispan.protostream.MessageMarshaller.ProtoStreamReader;
import org.infinispan.protostream.MessageMarshaller.ProtoStreamWriter;
/**
* UUID are commonly encoded as 'string' in Protobuf
*/
public final class UUIDProtofieldAccessor extends BaseProtofieldAccessor<UUID> implements ProtofieldAccessor<UUID> {
public UUIDProtofieldAccessor(int tag, String name, boolean nullable, String columnName) {
super( tag, name, nullable, columnName,
(ProtoStreamWriter outProtobuf, UUID value) -> outProtobuf.writeString( name, value.toString() ),
(ProtoStreamReader reader) -> UUID.fromString( reader.readString( name ) )
);
}
@Override
protected String getProtobufTypeName() {
return "string";
}
}
|
hibernate/hibernate-ogm | 1,098 | core/src/test/java/org/hibernate/ogm/test/util/impl/ContractsTest.java | /*
* Hibernate OGM, Domain model persistence for NoSQL datastores
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ogm.test.util.impl;
import org.hibernate.ogm.util.impl.Contracts;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
/**
* Unit test for {@link Contracts}.
*
* @author Gunnar Morling
*/
public class ContractsTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
@Test
public void shouldRaiseExceptionOnNullObject() {
expectedException.expect( IllegalArgumentException.class );
expectedException.expectMessage( "'FooBar' must not be null" );
Contracts.assertNotNull( null, "FooBar" );
}
@Test
public void shouldRaiseExceptionOnNullParameter() {
expectedException.expect( IllegalArgumentException.class );
expectedException.expectMessage( "Parameter 'FooBar' must not be null" );
Contracts.assertParameterNotNull( null, "FooBar" );
}
}
|
hibernate/hibernate-orm | 1,063 | hibernate-core/src/main/java/org/hibernate/type/descriptor/java/MutableMutabilityPlan.java | /*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.type.descriptor.java;
import java.io.Serializable;
import org.hibernate.SharedSessionContract;
/**
* Mutability plan for mutable objects
*
* @author Steve Ebersole
*/
public abstract class MutableMutabilityPlan<T> implements MutabilityPlan<T> {
public static final MutableMutabilityPlan<Object> INSTANCE = new MutableMutabilityPlan<Object>() {
@Override
protected Object deepCopyNotNull(Object value) {
return value;
}
};
@Override
public boolean isMutable() {
return true;
}
@Override
public Serializable disassemble(T value, SharedSessionContract session) {
return (Serializable) deepCopy( value );
}
@Override
@SuppressWarnings("unchecked")
public T assemble(Serializable cached, SharedSessionContract session) {
return deepCopy( (T) cached );
}
@Override
public final T deepCopy(T value) {
return value == null ? null : deepCopyNotNull( value );
}
protected abstract T deepCopyNotNull(T value);
}
|
hibernate/hibernate-orm | 1,066 | hibernate-core/src/main/java/org/hibernate/boot/models/spi/NamedNativeQueryRegistration.java | /*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.boot.models.spi;
import java.util.Collections;
import java.util.Map;
import org.hibernate.internal.util.collections.CollectionHelper;
import jakarta.persistence.NamedNativeQuery;
import jakarta.persistence.QueryHint;
/**
* @author Steve Ebersole
*/
public record NamedNativeQueryRegistration(String name, NamedNativeQuery configuration) {
public String getQueryString() {
return configuration.query();
}
public Class<?> getResultClass() {
return configuration.resultClass();
}
public String getResultSetMapping() {
return configuration.resultSetMapping();
}
public Map<String,String> getQueryHints() {
final QueryHint[] hints = configuration.hints();
if ( CollectionHelper.isEmpty( hints ) ) {
return Collections.emptyMap();
}
final Map<String,String> result = CollectionHelper.linkedMapOfSize( hints.length );
for ( QueryHint hint : hints ) {
result.put( hint.name(), hint.value() );
}
return result;
}
}
|
hibernate/hibernate-orm | 1,083 | hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterNumericData.java | /*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.type.descriptor.jdbc.internal;
import org.hibernate.dialect.Dialect;
import org.hibernate.sql.ast.spi.SqlAppender;
import org.hibernate.type.descriptor.WrapperOptions;
import org.hibernate.type.descriptor.java.JavaType;
import org.hibernate.type.descriptor.jdbc.spi.BasicJdbcLiteralFormatter;
/**
* {@link org.hibernate.type.descriptor.jdbc.JdbcLiteralFormatter}
* implementation for handling numeric data
*
* @author Steve Ebersole
*/
public class JdbcLiteralFormatterNumericData<T> extends BasicJdbcLiteralFormatter<T> {
private final Class<? extends Number> unwrapJavaType;
public JdbcLiteralFormatterNumericData(JavaType<T> javaType, Class<? extends Number> unwrapJavaType) {
super( javaType );
this.unwrapJavaType = unwrapJavaType;
}
@Override
public void appendJdbcLiteral(SqlAppender appender, T value, Dialect dialect, WrapperOptions wrapperOptions) {
appender.appendSql( unwrap( value, unwrapJavaType, wrapperOptions ).toString() );
}
}
|
hibernate/hibernate-orm | 1,085 | hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/NestedColumnReference.java | /*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.sql.ast.tree.expression;
import org.hibernate.metamodel.mapping.SelectableMapping;
import org.hibernate.sql.ast.SqlAstWalker;
import org.hibernate.sql.ast.tree.from.EmbeddableFunctionTableReference;
/**
* Model a column which is relative to a base expression e.g. {@code array[1].columnName}.
* This is needed to model column references within e.g. arrays.
*/
public class NestedColumnReference extends ColumnReference {
private final Expression baseExpression;
public NestedColumnReference(EmbeddableFunctionTableReference tableReference, SelectableMapping selectableMapping) {
super( tableReference, selectableMapping );
this.baseExpression = tableReference.getExpression();
}
public Expression getBaseExpression() {
return baseExpression;
}
@Override
public String getReadExpression() {
return super.getReadExpression();
}
@Override
public void accept(SqlAstWalker sqlTreeWalker) {
sqlTreeWalker.visitNestedColumnReference( this );
}
}
|
hibernate/hibernate-orm | 1,089 | hibernate-core/src/main/java/org/hibernate/stat/CacheableDataStatistics.java | /*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.stat;
import java.io.Serializable;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
* @author Steve Ebersole
*/
public interface CacheableDataStatistics extends Serializable {
long NOT_CACHED_COUNT = Long.MIN_VALUE;
/**
* The name of the region where this data is cached.
*/
@Nullable String getCacheRegionName();
/**
* The number of times this data has been into its configured cache region
* since the last Statistics clearing
*/
long getCachePutCount();
/**
* The number of successful cache look-ups for this data from its
* configured cache region since the last Statistics clearing
*/
long getCacheHitCount();
/**
* The number of unsuccessful cache look-ups for this data from its
* configured cache region since the last Statistics clearing
*/
long getCacheMissCount();
/**
* The number of evictions from the configured cache region since
* the last Statistics clearing
*/
long getCacheRemoveCount();
}
|
hibernate/hibernate-orm | 1,092 | hibernate-envers/src/main/java/org/hibernate/envers/boot/model/CompositeIdentifier.java | /*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.envers.boot.model;
import org.hibernate.boot.jaxb.hbm.spi.JaxbHbmCompositeIdType;
import org.hibernate.boot.jaxb.hbm.spi.JaxbHbmToolingHintContainer;
import org.hibernate.envers.boot.spi.EnversMetadataBuildingContext;
/**
* Represents an identifier based on a {@code composite-id} mapping.
*
* @author Chris Cranford
*/
public class CompositeIdentifier extends AbstractIdentifier {
public CompositeIdentifier(EnversMetadataBuildingContext metadataBuildingContext) {
super( metadataBuildingContext.getConfiguration().getOriginalIdPropertyName() );
}
@Override
public JaxbHbmCompositeIdType build() {
final JaxbHbmCompositeIdType identifier = new JaxbHbmCompositeIdType();
identifier.setName( getName() );
// For all mapped attributes, add them to the list of key properties
for ( Attribute attribute : getAttributes() ) {
identifier.getKeyPropertyOrKeyManyToOne().add( (JaxbHbmToolingHintContainer) attribute.build() );
}
return identifier;
}
}
|
hibernate/hibernate-search | 1,028 | util/internal/integrationtest/common/src/main/java/org/hibernate/search/util/impl/integrationtest/common/stub/backend/document/model/impl/StubIndexModel.java | /*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.search.util.impl.integrationtest.common.stub.backend.document.model.impl;
import java.util.Collections;
import java.util.Map;
import org.hibernate.search.engine.backend.analysis.spi.AnalysisDescriptorRegistry;
import org.hibernate.search.engine.backend.document.model.spi.AbstractIndexModel;
import org.hibernate.search.engine.backend.document.model.spi.IndexIdentifier;
public class StubIndexModel extends AbstractIndexModel<StubIndexModel, StubIndexRoot, StubIndexField> {
public StubIndexModel(AnalysisDescriptorRegistry analysisDescriptorRegistry, String hibernateSearchIndexName,
String mappedTypeName,
IndexIdentifier identifier, StubIndexRoot root, Map<String, StubIndexField> fields) {
super( analysisDescriptorRegistry, hibernateSearchIndexName, mappedTypeName, identifier, root, fields,
Collections.emptyList() );
}
@Override
protected StubIndexModel self() {
return this;
}
}
|
hibernate/hibernate-search | 1,042 | backend/lucene/src/main/java/org/hibernate/search/backend/lucene/lowlevel/collector/impl/TimeoutCountCollector.java | /*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.search.backend.lucene.lowlevel.collector.impl;
import org.hibernate.search.engine.common.timing.Deadline;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.SimpleCollector;
/**
* Counts the total hit, as {@link org.apache.lucene.search.TotalHitCountCollector} does.
* Moreover, it periodically checks for timeout.
*
*/
public class TimeoutCountCollector extends SimpleCollector {
private final Deadline deadline;
public TimeoutCountCollector(Deadline deadline) {
this.deadline = deadline;
}
private int totalHits;
/** Returns how many hits matched the search. */
public int getTotalHits() {
return totalHits;
}
@Override
public void collect(int doc) {
// Check for timeout each 256 elements:
if ( totalHits % 256 == 0 ) {
deadline.checkRemainingTimeMillis();
}
totalHits++;
}
@Override
public ScoreMode scoreMode() {
return ScoreMode.COMPLETE_NO_SCORES;
}
}
|
hibernate/hibernate-search | 1,105 | engine/src/main/java/org/hibernate/search/engine/backend/scope/spi/IndexScope.java | /*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.search.engine.backend.scope.spi;
import org.hibernate.search.engine.backend.scope.IndexScopeExtension;
import org.hibernate.search.engine.search.query.spi.SearchQueryIndexScope;
import org.hibernate.search.util.common.SearchException;
/**
* The scope of an index-related operation, aware of the targeted indexes and of the underlying technology (backend).
*/
public interface IndexScope<SR> {
SearchQueryIndexScope<SR, ? extends SearchQueryIndexScope<?, ?>> searchScope();
/**
* Extend the current index scope with the given extension,
* resulting in an extended index scope offering backend-specific utilities.
*
* @param extension The extension to apply.
* @param <T> The type of index scope provided by the extension.
* @return The extended index scope.
* @throws SearchException If the extension cannot be applied (wrong underlying technology, ...).
*/
default <T> T extension(IndexScopeExtension<T> extension) {
return extension.extendOrFail( this );
}
}
|
openjdk/jdk8 | 1,144 | langtools/test/tools/javac/diags/examples/RecursiveConstrInvocation.java | /*
* Copyright (c) 2010, 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.
*/
// key: compiler.err.recursive.ctor.invocation
class X {
X() {
this();
}
}
|
openjdk/jdk8 | 1,150 | jdk/test/java/lang/invoke/lambda/T8032697_anotherpkg/T8032697_A.java | /*
* Copyright (c) 2014, 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.
*/
package T8032697_anotherpkg;
public class T8032697_A {
protected final int f() { return 2; }
}
|
openjdk/jdk8 | 1,153 | langtools/test/tools/javac/InnerNamedConstant_2.java | /*
* @test /nodynamiccopyright/
* @bug 4095568 4277286 4785453
* @summary Verify rejection of illegal static variables in inner classes.
* @author William Maddox (maddox)
*
* @compile/fail/ref=InnerNamedConstant_2.out -XDrawDiagnostics InnerNamedConstant_2.java
*/
public class InnerNamedConstant_2 {
static class Inner1 {
static int x = 1; // OK - class is top-level
static final int y = x * 5; // OK - class is top-level
static final String z; // OK - class is top-level
static {
z = "foobar";
}
}
class Inner2 {
static int x = 1; // ERROR - static not final
static final String z; // ERROR - static blank final
{
z = "foobar"; // Error may be reported here. See 4278961.
}
}
// This case must go in a separate class, as otherwise the detection
// of the error is suppressed as a result of recovery from the other
// errors.
class Inner3 {
static final int y = Inner1.x * 5; // ERROR - initializer not constant
}
}
|
openjdk/jdk8 | 1,163 | langtools/test/tools/javac/generics/7007615/acc2/p1/D.java | /*
* Copyright (c) 2011, 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.
*/
package p1;
public class D extends C<String> { public void m(String arg) {} /* implicit bridge: m(Object) */ }
|
openjdk/jtreg | 1,171 | test/share/basic/driver/ClassNotPublic.java | /*
* Copyright (c) 1998, 2014, 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
* @summary Error: Can't find `main' method
* @run driver ClassNotPublic
*/
class ClassNotPublic
{
}
|
openjdk/jtreg | 1,192 | test/match/p/Fail.java | /*
* Copyright (c) 2018, 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 {
public static void main(String... args) throws Exception {
throw new Exception("fail");
}
}
|
oracle/coherence-operator | 1,111 | java/coherence-operator/src/main/java/com/oracle/coherence/k8s/InetLookup.java | /*
* Copyright (c) 2020, 2023, Oracle and/or its affiliates.
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
package com.oracle.coherence.k8s;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* A utility to perform a DNS lookup in Java.
*/
public class InetLookup {
/**
* Private constructor for utility class.
*/
private InetLookup() {
}
/**
* The entry point for running a DNS lookup.
*
* @param args the array of DNS names to look up
*/
public static void main(String[] args) {
for (String sName: args) {
System.out.println("Looking up: " + sName);
try {
InetAddress[] aAddress = InetAddress.getAllByName(sName);
for (InetAddress address : aAddress) {
System.out.println(address);
}
System.out.println();
}
catch (UnknownHostException e) {
System.out.println(e.getMessage());
}
}
}
}
|
oracle/coherence | 1,116 | prj/coherence-core/src/main/java/com/tangosol/dev/assembler/Ifnonnull.java | /*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
package com.tangosol.dev.assembler;
import java.io.IOException;
import java.io.DataInput;
import java.io.DataOutput;
/**
* The IFNONNULL op branches to the label if the top reference on the stack is
* not null.
* <p><code><pre>
* JASM op : IFNONNULL (0xc7)
* JVM byte code(s): IFNONNULL (0xc7)
* Details :
* </pre></code>
*
* @version 0.50, 06/14/98, assembler/dis-assembler
* @author Cameron Purdy
*/
public class Ifnonnull extends OpBranch implements Constants
{
// ----- constructors ---------------------------------------------------
/**
* Construct the op.
*
* @param label the label to branch to
*/
public Ifnonnull(Label label)
{
super(IFNONNULL, label);
}
// ----- data members ---------------------------------------------------
/**
* The name of this class.
*/
private static final String CLASS = "Ifnonnull";
}
|
oracle/coherence | 1,124 | prj/test/functional/jmx/src/main/java/jmx/DescribedMBean.java | /*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
*/
package jmx;
import com.tangosol.net.management.annotation.Description;
/**
* A {@link DescribedMBean} is a standard MBean interface annotated
* with the {@link Description} annotation.
* <p>
* This interface is used in the functional tests.
*
* @author cf 2011-01-10
*/
@Description(DescribedMBean.MBEAN_DESCRIPTION)
public interface DescribedMBean
{
/**
* An annotated operation.
*/
@Description(OPER_DESCRIPTION)
void operation();
/**
* An annotated attribute.
*
* @return the value of the annotated attribute
*/
@Description(ATTR_DESCRIPTION)
int getAttribute();
/**
* The MBean description.
*/
String MBEAN_DESCRIPTION = "This is the mbean description";
/**
* The Attribute description.
*/
String ATTR_DESCRIPTION = "Attribute description";
/**
* The Operation description.
*/
String OPER_DESCRIPTION = "Operation description";
}
|
oracle/coherence | 1,127 | prj/coherence-core/src/main/java/com/tangosol/net/ProxyService.java | /*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
package com.tangosol.net;
/**
* A ProxyService is a clustered service that accepts connections from
* external clients (e.g. Coherence*Extend) and proxies requests to
* clustered services.
*
* @author rhl 2009.10.07
*
* @since Coherence 3.6
*/
public interface ProxyService
extends Service
{
// ----- inner interface: ProxyAction -----------------------------------
/**
* ProxyAction represents a type of action taken by a ProxyService.
*/
public interface ProxyAction
extends Action
{
/**
* Singleton action for accepting a client connection.
*/
public static final Action CONNECT = new ProxyAction(){};
}
// ----- constants ------------------------------------------------------
/**
* Proxy service type constant.
*
* @see Cluster#ensureService(String, String)
*/
public static final String TYPE_DEFAULT = "Proxy";
}
|
apache/commons-imaging | 1,124 | src/test/java/org/apache/commons/imaging/formats/tiff/write/PrintShallowSizes.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.imaging.formats.tiff.write;
import org.apache.commons.imaging.test.PrintShallowObjectSizes;
public class PrintShallowSizes {
public static void main(final String[] args) {
PrintShallowObjectSizes.print(AbstractTiffOutputItem.class, AbstractTiffOutputItem.Value.class);
}
}
|
apache/commons-lang | 1,123 | src/test/java/org/apache/commons/lang3/reflect/testbed/PrivatelyShadowedChild.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.lang3.reflect.testbed;
/**
*/
@SuppressWarnings({ "unused" }) // deliberate re-use of variable names
public class PrivatelyShadowedChild extends Parent {
private final String s = "ss";
private final boolean b = true;
private final int i = 1;
private final double d = 1.0;
}
|
apache/cxf | 1,091 | rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/ClientTokenContextClassProvider.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.rs.security.oauth2.client;
import org.apache.cxf.jaxrs.ext.ContextClassProvider;
public class ClientTokenContextClassProvider implements ContextClassProvider {
@Override
public Class<?> getContextClass() {
return ClientTokenContext.class;
}
}
|
apache/cxf | 1,128 | rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/ManyTags.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.resources;
import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "ManyTags")
public class ManyTags {
private Tags tags;
public ManyTags() {
}
public void setTags(Tags t) {
tags = t;
}
public Tags getTags() {
return tags;
}
}
|
apache/daffodil | 1,130 | daffodil-core/src/main/java/org/apache/daffodil/api/infoset/InfosetArray.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.daffodil.api.infoset;
import org.apache.daffodil.api.metadata.ElementMetadata;
/**
* API access to array objects in the DFDL Infoset
*/
public interface InfosetArray extends InfosetItem {
/**
* @return the metadata of the element that is an array
*/
@Override
ElementMetadata metadata();
}
|
apache/deltaspike | 1,077 | deltaspike/modules/test-control/impl/obsolete/src/test/java/org/apache/deltaspike/test/testcontrol/uc014/DefaultTestService.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.deltaspike.test.testcontrol.uc014;
import jakarta.enterprise.context.ApplicationScoped;
@ApplicationScoped
public class DefaultTestService implements TestService
{
@Override
public String getValue()
{
return "default-result";
}
}
|
apache/deltaspike | 1,077 | deltaspike/modules/test-control/impl/obsolete/src/test/java/org/apache/deltaspike/test/testcontrol/uc015/DefaultTestService.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.deltaspike.test.testcontrol.uc015;
import jakarta.enterprise.context.ApplicationScoped;
@ApplicationScoped
public class DefaultTestService implements TestService
{
@Override
public String getValue()
{
return "default-result";
}
}
|
apache/deltaspike | 1,077 | deltaspike/modules/test-control/impl/obsolete/src/test/java/org/apache/deltaspike/test/testcontrol/uc016/DefaultTestService.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.deltaspike.test.testcontrol.uc016;
import jakarta.enterprise.context.ApplicationScoped;
@ApplicationScoped
public class DefaultTestService implements TestService
{
@Override
public String getValue()
{
return "default-result";
}
}
|
apache/deltaspike | 1,107 | deltaspike/examples/jsf-examples/src/main/java/org/apache/deltaspike/example/message/Custom.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.deltaspike.example.message;
import jakarta.inject.Qualifier;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
*
*/
@Qualifier
@Documented
@Retention(RUNTIME)
public @interface Custom
{
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.