repo_id
stringclasses
875 values
size
int64
974
38.9k
file_path
stringlengths
10
308
content
stringlengths
974
38.9k
apache/incubator-seata
1,140
core/src/main/java/org/apache/seata/core/protocol/transaction/BranchRollbackResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seata.core.protocol.transaction; import org.apache.seata.core.protocol.MessageType; /** * The type Branch rollback response. * */ public class BranchRollbackResponse extends AbstractBranchEndResponse { @Override public short getTypeCode() { return MessageType.TYPE_BRANCH_ROLLBACK_RESULT; } }
apache/incubator-seata
1,140
core/src/main/java/org/apache/seata/core/protocol/transaction/GlobalRollbackResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seata.core.protocol.transaction; import org.apache.seata.core.protocol.MessageType; /** * The type Global rollback response. * */ public class GlobalRollbackResponse extends AbstractGlobalEndResponse { @Override public short getTypeCode() { return MessageType.TYPE_GLOBAL_ROLLBACK_RESULT; } }
apache/incubator-tuweni
1,173
junit/src/main/java/org/apache/tuweni/junit/LuceneIndex.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ package org.apache.tuweni.junit; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * A parameter annotation for injecting a Lucene index directory into junit5 tests. */ @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface LuceneIndex { }
apache/inlong
1,125
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/queue/tubemq/TubeHttpResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.inlong.manager.pojo.queue.tubemq; import lombok.Data; /** * The response info of TubeMQ manager. */ @Data public class TubeHttpResponse { // true, or false private boolean result; // 0 is success, other is failed private int errCode; // OK, or err msg private String errMsg; }
apache/iotdb-web-workbench
1,152
backend/src/main/java/org/apache/iotdb/admin/model/vo/DeviceInfo.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.iotdb.admin.model.vo; import lombok.Data; import java.io.Serializable; import java.util.List; @Data public class DeviceInfo implements Serializable { private String deviceName; private String description; private String creator; private Integer line; private Integer deviceId; private List<String> parents; }
apache/iotdb
1,140
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/exception/ConsensusException.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.iotdb.consensus.exception; public class ConsensusException extends Exception { public ConsensusException(String message) { super(message); } public ConsensusException(String message, Throwable cause) { super(message, cause); } public ConsensusException(Exception e) { super(e); } }
apache/iotdb
1,147
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/windowing/api/Evaluator.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.iotdb.db.utils.windowing.api; import java.util.concurrent.RejectedExecutionException; @FunctionalInterface public interface Evaluator { @SuppressWarnings("squid:S112") void evaluate(Window window) throws Exception; default void onRejection(Window window) { throw new RejectedExecutionException(); } }
apache/jclouds
1,169
core/src/main/java/org/jclouds/events/config/ConfiguresEventBus.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jclouds.events.config; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Designates the module configures an {@link EventBus}. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface ConfiguresEventBus { }
apache/jena
1,136
jena-geosparql/src/main/java/org/apache/jena/geosparql/spatial/property_functions/cardinal/NorthPF.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jena.geosparql.spatial.property_functions.cardinal; import org.apache.jena.geosparql.spatial.CardinalDirection; /** * * */ public class NorthPF extends GenericCardinalPropertyFunction { @Override protected CardinalDirection getCardinalDirection() { return CardinalDirection.NORTH; } }
apache/jspwiki
1,183
jspwiki-main/src/test/java/SamplePlugin2.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. */ import org.apache.wiki.api.core.Context; import org.apache.wiki.api.core.Engine; import org.apache.wiki.api.exceptions.PluginException; import org.apache.wiki.api.plugin.Plugin; import java.util.Map; /** * Implements a simple plugin that just returns its text. * <P> * Parameters: text - text to return. * */ public class SamplePlugin2 implements Plugin { public void initialize( final Engine engine ) throws PluginException { } @Override public String execute(final Context context, final Map< String, String > params ) throws PluginException { return params.get( "text" ); } }
apache/kafka
1,147
streams/src/main/java/org/apache/kafka/streams/processor/internals/tasks/TaskExecutorCreator.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.kafka.streams.processor.internals.tasks; import org.apache.kafka.common.utils.Time; import org.apache.kafka.streams.processor.internals.TaskExecutionMetadata; public interface TaskExecutorCreator { TaskExecutor create(final TaskManager taskManager, String name, Time time, TaskExecutionMetadata taskExecutionMetadata); }
apache/kafka
1,154
clients/src/main/java/org/apache/kafka/common/errors/UnstableOffsetCommitException.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.kafka.common.errors; /** * Exception thrown when there are unstable offsets for the requested topic partitions. */ public class UnstableOffsetCommitException extends RetriableException { private static final long serialVersionUID = 1L; public UnstableOffsetCommitException(String message) { super(message); } }
apache/kafka
1,168
clients/src/main/java/org/apache/kafka/clients/RequestCompletionHandler.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.kafka.clients; /** * A callback interface for attaching an action to be executed when a request is complete and the corresponding response * has been received. This handler will also be invoked if there is a disconnection while handling the request. */ public interface RequestCompletionHandler { void onComplete(ClientResponse response); }
apache/linkis
1,064
linkis-public-enhancements/linkis-datasource/linkis-metadata/src/main/java/org/apache/linkis/metadata/type/ModelLevel.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.linkis.metadata.type; public enum ModelLevel { ODS("原始数据层"), DWD("明细数据层"), DWS("汇总数据层"), ADS("应用数据层"); private String name; ModelLevel(String name) { this.name = name; } public String getName() { return name; } }
apache/linkis
1,110
linkis-public-enhancements/linkis-cs-server/src/main/java/org/apache/linkis/cs/execution/matcher/AbstractContextSearchMatcher.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.linkis.cs.execution.matcher; import org.apache.linkis.cs.condition.Condition; public abstract class AbstractContextSearchMatcher implements ContextSearchMatcher { Condition condition; public AbstractContextSearchMatcher(Condition condition) { this.condition = condition; } }
apache/linkis
1,129
linkis-public-enhancements/linkis-cs-server/src/main/java/org/apache/linkis/cs/persistence/annotation/Ignore.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.linkis.cs.persistence.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({ElementType.TYPE, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface Ignore {}
apache/linkis
1,146
linkis-commons/linkis-rpc/src/main/java/org/apache/linkis/rpc/message/annotation/Chain.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.linkis.rpc.message.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Chain { String value() default "default"; }
apache/lucene
1,159
lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseShape.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.lucene.spatial3d.geom; /** * Base extended shape object. * * @lucene.internal */ public abstract class GeoBaseShape extends GeoBaseBounds implements GeoShape { /** * Constructor. * * @param planetModel is the planet model to use. */ public GeoBaseShape(final PlanetModel planetModel) { super(planetModel); } }
apache/maven-plugins
1,120
maven-project-info-reports-plugin/src/test/java/org/apache/maven/report/projectinfo/stubs/IndexStub.java
package org.apache.maven.report.projectinfo.stubs; /* * 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. */ /** * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a> * @version $Id$ */ public class IndexStub extends ProjectInfoProjectStub { @Override protected String getPOM() { return "index-plugin-config.xml"; } }
apache/maven-plugins
1,145
maven-site-plugin/src/it/emma-plugin-it/b/src/test/java/byebye/ByeByeTest.java
package byebye; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import byebye.ByeBye; import junit.framework.TestCase; public class ByeByeTest extends TestCase { public void testByeBye() { final ByeBye byeBye = new ByeBye(); assertEquals( "Bye bye world!", byeBye.byebye( null ) ); assertEquals( "Bye bye EMMA!", byeBye.byebye( "EMMA" ) ); } }
apache/maven-surefire
1,111
surefire-its/src/test/resources/surefire-257-rerunningTests/module1/src/test/java/surefire257/MyModule1ClassTest.java
package surefire257; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.Assert; import junit.framework.TestCase; import surefire257.MyModule1Class; public class MyModule1ClassTest extends TestCase { public void testGetFooOK() { MyModule1Class mc = new MyModule1Class(); Assert.assertEquals(42, mc.getFoo()); } }
apache/metamodel
1,153
core/src/main/java/org/apache/metamodel/intercept/TableCreationInterceptor.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.metamodel.intercept; import org.apache.metamodel.create.TableCreationBuilder; /** * An {@link Interceptor} for {@link TableCreationBuilder}s, which allows for * intercepting "create table" operations before they are executed. */ public interface TableCreationInterceptor extends Interceptor<TableCreationBuilder> { }
apache/mina-sshd
1,154
sshd-core/src/main/java/org/apache/sshd/client/simple/AbstractSimpleClient.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.sshd.client.simple; import org.apache.sshd.common.util.logging.AbstractLoggingBean; /** * @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a> */ public abstract class AbstractSimpleClient extends AbstractLoggingBean implements SimpleClient { protected AbstractSimpleClient() { super(); } }
apache/mnemonic
1,152
mnemonic-core/src/main/java/org/apache/mnemonic/RestoreDurableEntityError.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.mnemonic; /** * * */ public class RestoreDurableEntityError extends RuntimeException { private static final long serialVersionUID = -2433590448661478594L; /** * construct a error instance * @param s * specify an error information */ public RestoreDurableEntityError(String s) { super(s); } }
apache/nifi
1,101
nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/repository/metrics/EventContainer.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.nifi.controller.repository.metrics; import org.apache.nifi.controller.repository.FlowFileEvent; public interface EventContainer { void addEvent(FlowFileEvent event); void purgeEvents(long cutoffEpochMillis); FlowFileEvent generateReport(long sinceEpochMillis); }
apache/nifi
1,109
nifi-extension-bundles/nifi-py4j-extension-bundle/nifi-py4j-bridge/src/main/java/org/apache/nifi/python/processor/RecordTransform.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.nifi.python.processor; import org.apache.nifi.serialization.record.RecordSchema; import java.util.List; public interface RecordTransform extends PythonProcessor { List<RecordTransformResult> transformRecord(String jsonContent, RecordSchema schema, AttributeMap attributeMap); }
apache/openjpa
1,144
openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/Place.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.openjpa.persistence.simple; import jakarta.persistence.Entity; import jakarta.persistence.Id; @Entity public class Place { private String location; @Id public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } }
apache/openjpa
1,149
openjpa-kernel/src/main/java/org/apache/openjpa/util/RuntimeExceptionTranslator.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.openjpa.util; import java.io.Serializable; /** * Interface used by many facade helpers to translate exceptions. * * @author Abe White */ public interface RuntimeExceptionTranslator extends Serializable { /** * Translate the given exception. */ RuntimeException translate(RuntimeException re); }
apache/opennlp
1,156
opennlp-api/src/main/java/opennlp/tools/cmdline/params/BasicFormatParams.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.cmdline.params; import java.io.File; import opennlp.tools.cmdline.ArgumentParser.ParameterDescription; /** * Common format parameters. */ public interface BasicFormatParams extends EncodingParameter { @ParameterDescription(valueName = "sampleData", description = "data to be used, usually a file name.") File getData(); }
apache/openwebbeans
1,137
webbeans-impl/src/test/java/org/apache/webbeans/test/component/service/ServiceImpl1.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.service; import jakarta.enterprise.context.ApplicationScoped; import org.apache.webbeans.test.annotation.binding.Binding1; @Binding1 @ApplicationScoped public class ServiceImpl1 implements IService { @Override public String service() { return "ServiceImpl1"; } }
apache/ozhera
1,099
ozhera-prometheus-agent/ozhera-prometheus-agent-common/src/main/java/org/apache/ozhera/prometheus/agent/param/prometheus/Alertmanagers.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.prometheus.agent.param.prometheus; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; import java.util.List; @JsonInclude(JsonInclude.Include.NON_NULL) @Data public class Alertmanagers { private List<Static_configs> static_configs; }
apache/ozhera
1,113
ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/alarm/duty/UserInfo.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.alarm.duty; import lombok.Data; import java.io.Serializable; /** * @author gaoxihui * @date 2023/6/8 1:59 下午 */ @Data public class UserInfo implements Serializable { private String user; private Long start_time; private Long end_time; }
apache/ozone
1,097
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestContainerStateMachineFollower.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.ozone.container.common.transport.server.ratis; /** * Test class to ContainerStateMachine class for follower. */ public class TestContainerStateMachineFollower extends TestContainerStateMachine { public TestContainerStateMachineFollower() { super(false); } }
apache/paimon
1,148
paimon-common/src/test/resources/codesplit/member/code/TestNotRewriteLocalVariable.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. */ public class TestNotRewriteLocalVariable { int a = 1; int b = 2; int c = 3; public TestNotRewriteFunctionParameter() { int b = this.b; int c = this.c; System.out.println(this.c + b + c + this.b); } public int myFun() { int a = this.a; return this.a + a + this.b + c; } }
apache/pekko-http
1,138
http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/StrictTransportSecurity.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * license agreements; and to You under the Apache License, version 2.0: * * https://www.apache.org/licenses/LICENSE-2.0 * * This file is part of the Apache Pekko project, which was derived from Akka. */ /* * Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com> */ package org.apache.pekko.http.javadsl.model.headers; /** * Model for the `Strict-Transport-Security` header. Specification: * https://tools.ietf.org/html/rfc6797 */ public abstract class StrictTransportSecurity extends org.apache.pekko.http.scaladsl.model.HttpHeader { public abstract long maxAge(); public abstract boolean includeSubDomains(); public static StrictTransportSecurity create(long maxAge) { return new org.apache.pekko.http.scaladsl.model.headers.Strict$minusTransport$minusSecurity( maxAge, false); } public static StrictTransportSecurity create(long maxAge, boolean includeSubDomains) { return new org.apache.pekko.http.scaladsl.model.headers.Strict$minusTransport$minusSecurity( maxAge, includeSubDomains); } }
apache/phoenix
1,141
phoenix-core-client/src/main/java/org/apache/phoenix/iterate/ParallelIteratorRegionSplitter.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.phoenix.iterate; import java.sql.SQLException; import java.util.List; import org.apache.phoenix.query.KeyRange; /** * Interface for strategies determining how to split regions in ParallelIterators. */ public interface ParallelIteratorRegionSplitter { public List<KeyRange> getSplits() throws SQLException; }
apache/polygene-java
1,126
tools/qidea/src/main/java/org/apache/polygene/ide/plugin/idea/mixins/common/PolygeneMixinConstants.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.ide.plugin.idea.mixins.common; /** * @author edward.yakop@gmail.com * @since 0.1 */ public final class PolygeneMixinConstants { public static final String QUALIFIED_NAME_MIXINS = "org.apache.polygene.api.mixin.Mixins"; private PolygeneMixinConstants() { } }
apache/polygene-java
1,148
manual/src/main/java/org/apache/polygene/manual/recipes/createEntity/Accident.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.manual.recipes.createEntity; import java.time.LocalDate; import org.apache.polygene.api.property.Property; // START SNIPPET: entity public interface Accident { Property<String> description(); Property<LocalDate> occured(); Property<LocalDate> repaired(); } // END SNIPPET: entity
apache/pulsar
1,151
pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/SourceStatusUtil.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.pulsar.common.policies.data; import java.io.IOException; import org.apache.pulsar.common.util.ObjectMapperFactory; public class SourceStatusUtil { public static SourceStatus decode(String json) throws IOException { return ObjectMapperFactory.getMapper().reader().readValue(json, SourceStatus.class); } }
apache/qpid-broker-j
1,106
broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/EncodingRetainingSection.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.type.messaging; import org.apache.qpid.server.protocol.v1_0.type.Section; import org.apache.qpid.server.protocol.v1_0.type.messaging.codec.EncodingRetaining; public interface EncodingRetainingSection<T> extends Section<T>, EncodingRetaining { }
apache/ranger
1,163
security-admin/src/main/java/org/apache/ranger/db/XXCredentialStoreDao.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.ranger.db; import org.apache.ranger.common.db.BaseDao; import org.apache.ranger.entity.XXCredentialStore; import org.springframework.stereotype.Service; @Service public class XXCredentialStoreDao extends BaseDao<XXCredentialStore> { public XXCredentialStoreDao(RangerDaoManagerBase daoManager) { super(daoManager); } }
apache/reef
1,130
lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/pojos/ContextState.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.reef.runtime.common.driver.evaluator.pojos; import org.apache.reef.annotations.audience.DriverSide; import org.apache.reef.annotations.audience.Private; /** * DriverSide representation of ContextStatusProto.State. */ @DriverSide @Private public enum ContextState { READY, DONE, FAIL; }
apache/rocketmq-eventbridge
1,131
adapter/api/src/main/java/org/apache/rocketmq/eventbridge/adapter/api/dto/BaseResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.rocketmq.eventbridge.adapter.api.dto; import java.util.UUID; import lombok.Data; import lombok.NoArgsConstructor; @NoArgsConstructor @Data public class BaseResponse extends BaseDTO { public String requestId = UUID.randomUUID() .toString(); public String code; public String message; }
apache/rocketmq
1,162
common/src/main/java/org/apache/rocketmq/common/action/RocketMQAction.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.rocketmq.common.action; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import org.apache.rocketmq.common.resource.ResourceType; @Retention(RetentionPolicy.RUNTIME) public @interface RocketMQAction { int value(); ResourceType resource() default ResourceType.UNKNOWN; Action[] action(); }
apache/seatunnel-web
1,118
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/domain/request/job/DataSourceOption.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seatunnel.app.domain.request.job; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; @Data @AllArgsConstructor @NoArgsConstructor public class DataSourceOption { private List<String> databases; private List<String> tables; }
apache/servicecomb-java-chassis
1,120
demo/demo-edge/edge-service/src/main/java/org/apache/servicecomb/demo/edge/service/encrypt/Encrypt.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.demo.edge.service.encrypt; import java.util.concurrent.CompletableFuture; import org.apache.servicecomb.demo.edge.authentication.encrypt.Hcr; public interface Encrypt { CompletableFuture<String> queryUserId(String serviceToken); CompletableFuture<Hcr> queryHcr(String hcrId); }
apache/servicecomb-toolkit
1,089
oas-validator/oas-validator-core/src/main/java/org/apache/servicecomb/toolkit/oasv/diffvalidation/factory/OasObjectDiffValidatorFactory.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.diffvalidation.factory; import java.util.List; import org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasObjectDiffValidator; public interface OasObjectDiffValidatorFactory<T extends OasObjectDiffValidator> { List<T> create(); }
apache/shardingsphere-elasticjob
1,099
ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.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.elasticjob.dataflow.props; /** * Dataflow job properties. */ public final class DataflowJobProperties { /** * Whether to use stream mode to process dataflow job. */ public static final String STREAM_PROCESS_KEY = "streaming.process"; }
apache/sirona
1,164
api/src/main/java/org/apache/sirona/store/gauge/CommonGaugeDataStore.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.sirona.store.gauge; import org.apache.sirona.Role; import java.util.Collection; import java.util.SortedMap; public interface CommonGaugeDataStore { SortedMap<Long, Double> getGaugeValues(GaugeValuesRequest gaugeValuesRequest); Collection<Role> gauges(); Role findGaugeRole(String name); void gaugeStopped(Role gauge); }
apache/sling-org-apache-sling-app-cms
1,144
api/src/main/java/org/apache/sling/cms/insights/InsightsModel.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.sling.cms.insights; import java.util.List; /** * A model interface for retrieving insights for the current resource */ public interface InsightsModel { /** * Retrieve the insights for the current resource. * * @return the insights for the resource */ List<Insight> getInsights(); }
apache/solr
1,150
solr/api/src/java/org/apache/solr/client/api/model/UpdateCollectionPropertyRequestBody.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.solr.client.api.model; import com.fasterxml.jackson.annotation.JsonProperty; public class UpdateCollectionPropertyRequestBody { public UpdateCollectionPropertyRequestBody() {} public UpdateCollectionPropertyRequestBody(String value) { this.value = value; } @JsonProperty(required = true) public String value; }
apache/solr
1,157
solr/api/src/java/org/apache/solr/client/api/model/RenameCollectionRequestBody.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 static org.apache.solr.client.api.model.Constants.ASYNC; import com.fasterxml.jackson.annotation.JsonProperty; public class RenameCollectionRequestBody { @JsonProperty(required = true) public String to; @JsonProperty(ASYNC) public String async; @JsonProperty public Boolean followAliases; }
apache/solr
1,160
solr/api/src/java/org/apache/solr/client/api/model/SchemaGetFieldInfoResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.solr.client.api.model; import com.fasterxml.jackson.annotation.JsonProperty; public class SchemaGetFieldInfoResponse extends SolrJerseyResponse { // TODO Server code sets this field as 'SimpleOrderedMap'; make this type declaration more // specific once SOLR-12959 is completed @JsonProperty("field") public Object fieldInfo; }
apache/stratos
1,098
components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/exception/application/UnremovableApplicationException.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.autoscaler.exception.application; import org.apache.stratos.autoscaler.exception.AutoScalerException; public class UnremovableApplicationException extends AutoScalerException { public UnremovableApplicationException(String msg) { super(msg); } }
apache/streampipes
1,117
streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/setup/design/DesignDocumentUtils.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.manager.setup.design; import org.lightcouch.DesignDocument; public class DesignDocumentUtils { public static DesignDocument prepareDocument(String id) { DesignDocument doc = new DesignDocument(); doc.setLanguage("javascript"); doc.setId(id); return doc; } }
apache/struts
1,159
core/src/test/java/org/apache/struts2/inject/EarlyInitializableBean.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.inject; class EarlyInitializableBean implements EarlyInitializable { private String message = ""; static boolean initializedEarly; public String getMessage() { return message; } @Override public void init() { message += "initialized early"; initializedEarly = true; } }
apache/syncope
1,145
common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/types/TraceLevel.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.common.lib.types; public enum TraceLevel { /** * No details at all. */ NONE, /** * Only failed entries. */ FAILURES, /** * Only an overall summary. */ SUMMARY, /** * All available information, including per-entry information. */ ALL }
apache/tapestry-5
1,127
tapestry-kaptcha/src/main/java/org/apache/tapestry5/kaptcha/internal/services/KaptchaDataTypeAnalyzer.java
// Copyright 2011 The Apache Software Foundation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package org.apache.tapestry5.kaptcha.internal.services; import org.apache.tapestry5.commons.services.DataTypeAnalyzer; import org.apache.tapestry5.commons.services.PropertyAdapter; import org.apache.tapestry5.kaptcha.annotations.Kaptcha; public class KaptchaDataTypeAnalyzer implements DataTypeAnalyzer { @Override public String identifyDataType(PropertyAdapter adapter) { final Kaptcha annotation = adapter.getAnnotation(Kaptcha.class); return annotation == null ? null : "kaptcha"; } }
apache/tika
1,136
tika-server/tika-server-client/src/main/java/org/apache/tika/server/client/TikaClientConfigException.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.tika.server.client; import org.apache.tika.exception.TikaException; public class TikaClientConfigException extends TikaException { public TikaClientConfigException(String msg) { super(msg); } public TikaClientConfigException(String msg, Throwable cause) { super(msg, cause); } }
apache/tomcat
1,188
java/org/apache/catalina/SessionListener.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.catalina; import java.util.EventListener; /** * Interface defining a listener for significant Session generated events. */ public interface SessionListener extends EventListener { /** * Acknowledge the occurrence of the specified event. * * @param event SessionEvent that has occurred */ void sessionEvent(SessionEvent event); }
apache/tomcat80
1,176
java/org/apache/jasper/el/JspPropertyNotFoundException.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.jasper.el; import javax.el.PropertyNotFoundException; public final class JspPropertyNotFoundException extends PropertyNotFoundException { private static final long serialVersionUID = 1L; public JspPropertyNotFoundException(String mark, PropertyNotFoundException e) { super(mark + " " + e.getMessage(), e.getCause()); } }
apache/tomee
1,150
container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ClassListInfo.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.openejb.assembler.classic; import java.util.HashSet; import java.util.Set; // just to store a kind of Map<String, Set<String>> // TODO: find a better name, key can be a classname, a jar/file path... public class ClassListInfo extends InfoObject { public String name; public final Set<String> list = new HashSet<>(); }
apache/tomee
1,165
container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/unit/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. */ @jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter(value = jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter.class, type = String.class) @jakarta.xml.bind.annotation.XmlSchema(namespace = "http://java.sun.com/xml/ns/persistence", elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.openejb.jee.jpa.unit;
apache/wicket
1,129
wicket-core-tests/src/test/java/org/apache/wicket/markup/parser/filter/HeaderSectionPage_18.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.parser.filter; import org.apache.wicket.markup.html.WebPage; /** * Mock page for testing. * * @author Chris Turner */ public class HeaderSectionPage_18 extends WebPage { private static final long serialVersionUID = 1L; /** * Construct. */ public HeaderSectionPage_18() { } }
apache/wicket
1,137
wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/IDebugBarContributor.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.devutils.debugbar; import org.apache.wicket.Component; import org.apache.wicket.util.io.IClusterable; /** * */ public interface IDebugBarContributor extends IClusterable { /** * * @param id * @param debugBar * @return Component */ Component createComponent(String id, DebugBar debugBar); }
apache/wicket
1,168
wicket-core/src/main/java/org/apache/wicket/IRequestCycleProvider.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; import java.util.function.Function; import org.apache.wicket.request.cycle.RequestCycle; import org.apache.wicket.request.cycle.RequestCycleContext; /** * Provides instances of {@link RequestCycle} objects * * @author igor.vaynberg */ public interface IRequestCycleProvider extends Function<RequestCycleContext, RequestCycle> { }
apache/xmlgraphics-batik
1,123
batik-codec/src/main/java/org/apache/batik/ext/awt/image/codec/imageio/ImageIOTIFFImageWriter.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.batik.ext.awt.image.codec.imageio; /** * ImageWriter that encodes TIFF images using Image I/O. * * @version $Id$ */ public class ImageIOTIFFImageWriter extends ImageIOImageWriter { /** * Main constructor. */ public ImageIOTIFFImageWriter() { super("image/tiff"); } }
apache/zeppelin
1,136
zeppelin-jupyter/src/main/java/org/apache/zeppelin/jupyter/types/ZeppelinOutputType.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.zeppelin.jupyter.types; /** * Zeppelin Output Types. */ public enum ZeppelinOutputType { TEXT("TEXT"), HTML("HTML"), TABLE("TABLE") ; private final String type; private ZeppelinOutputType(final String type) { this.type = type; } @Override public String toString() { return type; } }
apache/zookeeper
1,152
zookeeper-server/src/main/java/org/apache/zookeeper/cli/CliParseException.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.zookeeper.cli; import org.apache.commons.cli.ParseException; @SuppressWarnings("serial") public class CliParseException extends CliException { public CliParseException(ParseException parseException) { super(parseException); } public CliParseException(String message) { super(message); } }
google/Accessibility-Test-Framework-for-Android
1,081
src/main/java/com/google/android/apps/common/testing/accessibility/framework/suggestions/TouchTargetSizeFixSuggestionsProvider.java
package com.google.android.apps.common.testing.accessibility.framework.suggestions; import com.google.android.apps.common.testing.accessibility.framework.AccessibilityHierarchyCheckResult; import com.google.android.apps.common.testing.accessibility.framework.checks.TouchTargetSizeCheck; import com.google.common.collect.ImmutableList; /** * A {@link FixSuggestionsProvider} which provides fix suggestions to a {@link * AccessibilityHierarchyCheckResult} generated by a {@link TouchTargetSizeCheck}. */ class TouchTargetSizeFixSuggestionsProvider extends BaseFixSuggestionsProvider<TouchTargetSizeCheck> { private static final ImmutableList<FixSuggestionProducer<? extends FixSuggestion>> FIX_SUGGESTION_PRODUCERS = ImmutableList.of(new ExpandViewSizeFixSuggestionProducer()); @Override protected ImmutableList<FixSuggestionProducer<? extends FixSuggestion>> getFixSuggestionProducers() { return FIX_SUGGESTION_PRODUCERS; } @Override protected Class<TouchTargetSizeCheck> getTargetCheckClass() { return TouchTargetSizeCheck.class; } }
google/binnavi
1,138
src/main/java/com/google/security/zynamics/zylib/disassembly/DuplicateFunctionNameException.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.disassembly; @Deprecated // Delete this class when you see this comment public class DuplicateFunctionNameException extends Exception { private static final long serialVersionUID = 8935154529155710030L; private final StackTraceElement[] m_originalStacktrace; public DuplicateFunctionNameException(final String msg) { super(msg); m_originalStacktrace = new Throwable().getStackTrace(); } @Override public StackTraceElement[] getStackTrace() { return m_originalStacktrace; } }
google/depan
1,143
DepanGraphDoc/prod/src/com/google/devtools/depan/analysis_doc/model/ModelMatcher.java
/* * Copyright 2016 The Depan 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 * * 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.depan.analysis_doc.model; import com.google.devtools.depan.graph_doc.model.DependencyModel; /** * @author <a href="leeca@pnambic.com">Lee Carver</a> */ public interface ModelMatcher { /** * Indicate whether this object is appropriate for the supplied * {@link DependencyModel}. */ boolean forModel(DependencyModel model); public static ModelMatcher ALL_MODELS = new ModelMatcher() { @Override public boolean forModel(DependencyModel model) { return true; } }; }
google/filament
1,149
android/filament-android/src/main/java/com/google/android/filament/EntityInstance.java
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.filament; import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.LOCAL_VARIABLE; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.CLASS; @Retention(CLASS) @Target({PARAMETER, METHOD, LOCAL_VARIABLE, FIELD}) public @interface EntityInstance { int NULL = 0; }
google/gdata-java-client
1,160
java/src/com/google/gdata/data/ValidatingExtension.java
/* Copyright (c) 2008 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.gdata.data; import com.google.gdata.util.ParseException; /** * Extends the base {@link Extension} interface to enable validation * of extension contents. * * */ public interface ValidatingExtension extends Extension { /** * Enables an extension to perform final validation after all extension * elements of the parent ExtensionPoint have been processed. * * @param parent * parent ExtensionPoint * * @throws ParseException */ void validate(ExtensionPoint parent) throws ParseException; }
google/graphicsfuzz
1,152
ast/src/main/java/com/graphicsfuzz/common/glslversion/Glsl450.java
/* * Copyright 2018 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.glslversion; final class Glsl450 extends CompositeShadingLanguageVersion { static final ShadingLanguageVersion INSTANCE = new Glsl450(Glsl440.INSTANCE); private Glsl450(ShadingLanguageVersion prototype) { super(prototype); // Singleton } @Override public String getVersionString() { return "450"; } @Override public boolean supportedExplicitDerivativeFunctions() { return true; } @Override public boolean supportedMixNonfloatBool() { return true; } }
google/gson
1,164
gson/src/test/java/com/google/gson/internal/sql/SqlTypesSupportTest.java
/* * Copyright (C) 2020 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.gson.internal.sql; import static com.google.common.truth.Truth.assertThat; import org.junit.Test; public class SqlTypesSupportTest { @Test public void testSupported() { assertThat(SqlTypesSupport.SUPPORTS_SQL_TYPES).isTrue(); assertThat(SqlTypesSupport.DATE_DATE_TYPE).isNotNull(); assertThat(SqlTypesSupport.TIMESTAMP_DATE_TYPE).isNotNull(); assertThat(SqlTypesSupport.DATE_FACTORY).isNotNull(); assertThat(SqlTypesSupport.TIME_FACTORY).isNotNull(); assertThat(SqlTypesSupport.TIMESTAMP_FACTORY).isNotNull(); } }
google/j2cl
1,127
junit/generator/javatests/com/google/j2cl/junit/integration/stacktrace/data/LambdaStacktraceTest.java
/* * Copyright 2017 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.j2cl.junit.integration.stacktrace.data; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Simple throwing test case */ @RunWith(JUnit4.class) public class LambdaStacktraceTest extends StacktraceTestBase { @Test public void test() { final Runnable first = () -> { if (true) { throw new RuntimeException("__the_message__!"); } }; Runnable r = () -> { first.run(); }; r.run(); } }
google/j2cl
1,128
transpiler/javatests/com/google/j2cl/integration/java/jsinteroptests/MyClassExportsMethodWithClinit.java
/* * Copyright 2014 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 jsinteroptests; import static com.google.j2cl.integration.testing.Asserts.assertEquals; import jsinterop.annotations.JsConstructor; class MyClassExportsMethodWithClinit { public static int magicNumber = 0; static { // prevent optimizations from inlining this clinit() if (Math.random() > -1) { magicNumber = 42; } } @JsConstructor public MyClassExportsMethodWithClinit() { // ensure clinit() is called even when invoked from JS assertEquals(42, magicNumber); magicNumber = 23; } }
google/j2cl
1,138
transpiler/javatests/com/google/j2cl/integration/java/instancejsmethods/Parent.java
/* * Copyright 2017 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package instancejsmethods; import jsinterop.annotations.JsMethod; public class Parent extends SuperParent { /** * JsMethod that overrides a non-JsMethod with renaming. */ @Override @JsMethod(name = "sum") public int fun(int a, int b) { return a + b; } /** * JsMethod that overrides a non-JsMethod without renaming. */ @Override @JsMethod public int bar(int a, int b) { return a * b; } /** * A top level JsMethod. */ @JsMethod(name = "myFoo") public int foo(int a) { return a; } }
google/j2cl
1,157
tools/javatests/com/google/j2cl/tools/rta/pruningresults/Foo.java
/* * Copyright 2018 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 com.google.j2cl.tools.rta.pruningresults; import jsinterop.annotations.JsMethod; /** * Entry point of our program. We expect that RTA removes the default constructor, the * unusedMethod() and the unusedStaticField. */ public class Foo { public static String unusedStaticField; { System.err.println("This is unused"); } public Foo() { System.err.println("This is unused"); } @JsMethod public static void entryPoint() { new Bar().bar(); } public void unusedMethod() { System.err.println("This is unused"); } }
google/MOE
1,155
client/src/main/java/com/google/devtools/moe/client/codebase/CodebaseCreator.java
/* * Copyright (c) 2011 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.codebase; import java.util.Map; /** * A CodebaseCreator allows us to create Codebases. * * <p>This may bundle an existing codebase, or check it out from source control. */ public abstract class CodebaseCreator { /** * Creates a Codebase. * * @param options options to affect the codebase creation. * @return the created Codebase * @throw CodebaseCreationError if we cannot create the Codebase. */ public abstract Codebase create(Map<String, String> options) throws CodebaseCreationError; }
google/paco
1,169
Paco/src/com/pacoapp/paco/model/EsmSignalColumns.java
/* * Copyright 2011 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.pacoapp.paco.model; import android.provider.BaseColumns; public class EsmSignalColumns implements BaseColumns { public static final String DATE = "date"; public static final String EXPERIMENT_ID = "experiment_id"; public static final String TIME = "time"; public static final String NOTIFICATION_CREATED = "fired"; public static final String GROUP_NAME = "group_name"; public static final String ACTION_TRIGGER_ID = "action_trigger_id"; public static final String SCHEDULE_ID = "schedule_id"; private EsmSignalColumns() { } }
googleads/google-ads-java
1,121
google-ads-stubs-v19/src/main/java/com/google/ads/googleads/v19/common/LifeEventSegmentOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/ads/googleads/v19/common/audiences.proto // Protobuf Java Version: 3.25.7 package com.google.ads.googleads.v19.common; public interface LifeEventSegmentOrBuilder extends // @@protoc_insertion_point(interface_extends:google.ads.googleads.v19.common.LifeEventSegment) com.google.protobuf.MessageOrBuilder { /** * <pre> * The life event resource. * </pre> * * <code>optional string life_event = 1 [(.google.api.resource_reference) = { ... }</code> * @return Whether the lifeEvent field is set. */ boolean hasLifeEvent(); /** * <pre> * The life event resource. * </pre> * * <code>optional string life_event = 1 [(.google.api.resource_reference) = { ... }</code> * @return The lifeEvent. */ java.lang.String getLifeEvent(); /** * <pre> * The life event resource. * </pre> * * <code>optional string life_event = 1 [(.google.api.resource_reference) = { ... }</code> * @return The bytes for lifeEvent. */ com.google.protobuf.ByteString getLifeEventBytes(); }
googleads/google-ads-java
1,121
google-ads-stubs-v20/src/main/java/com/google/ads/googleads/v20/common/LifeEventSegmentOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/ads/googleads/v20/common/audiences.proto // Protobuf Java Version: 3.25.7 package com.google.ads.googleads.v20.common; public interface LifeEventSegmentOrBuilder extends // @@protoc_insertion_point(interface_extends:google.ads.googleads.v20.common.LifeEventSegment) com.google.protobuf.MessageOrBuilder { /** * <pre> * The life event resource. * </pre> * * <code>optional string life_event = 1 [(.google.api.resource_reference) = { ... }</code> * @return Whether the lifeEvent field is set. */ boolean hasLifeEvent(); /** * <pre> * The life event resource. * </pre> * * <code>optional string life_event = 1 [(.google.api.resource_reference) = { ... }</code> * @return The lifeEvent. */ java.lang.String getLifeEvent(); /** * <pre> * The life event resource. * </pre> * * <code>optional string life_event = 1 [(.google.api.resource_reference) = { ... }</code> * @return The bytes for lifeEvent. */ com.google.protobuf.ByteString getLifeEventBytes(); }
googleads/google-ads-java
1,121
google-ads-stubs-v21/src/main/java/com/google/ads/googleads/v21/common/LifeEventSegmentOrBuilder.java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/ads/googleads/v21/common/audiences.proto // Protobuf Java Version: 3.25.7 package com.google.ads.googleads.v21.common; public interface LifeEventSegmentOrBuilder extends // @@protoc_insertion_point(interface_extends:google.ads.googleads.v21.common.LifeEventSegment) com.google.protobuf.MessageOrBuilder { /** * <pre> * The life event resource. * </pre> * * <code>optional string life_event = 1 [(.google.api.resource_reference) = { ... }</code> * @return Whether the lifeEvent field is set. */ boolean hasLifeEvent(); /** * <pre> * The life event resource. * </pre> * * <code>optional string life_event = 1 [(.google.api.resource_reference) = { ... }</code> * @return The lifeEvent. */ java.lang.String getLifeEvent(); /** * <pre> * The life event resource. * </pre> * * <code>optional string life_event = 1 [(.google.api.resource_reference) = { ... }</code> * @return The bytes for lifeEvent. */ com.google.protobuf.ByteString getLifeEventBytes(); }
googleapis/google-cloud-java
1,055
java-video-intelligence/proto-google-cloud-video-intelligence-v1p3beta1/src/main/java/com/google/cloud/videointelligence/v1p3beta1/StreamingObjectTrackingConfigOrBuilder.java
/* * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/videointelligence/v1p3beta1/video_intelligence.proto // Protobuf Java Version: 3.25.8 package com.google.cloud.videointelligence.v1p3beta1; public interface StreamingObjectTrackingConfigOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig) com.google.protobuf.MessageOrBuilder {}
hibernate/hibernate-ogm
1,098
core/src/test/java/org/hibernate/ogm/backendtck/embeddable/Account.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.embeddable; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Version; /** * @author Emmanuel Bernard */ @Entity public class Account { private String login; private String password; private Address homeAddress; private Integer version; @Id public String getLogin() { return login; } public void setLogin(String login) { this.login = login; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public Address getHomeAddress() { return homeAddress; } public void setHomeAddress(Address homeAddress) { this.homeAddress = homeAddress; } @Version public Integer getVersion() { return version; } public void setVersion(Integer version) { this.version = version; } }
hibernate/hibernate-ogm
1,135
core/src/main/java/org/hibernate/ogm/type/impl/ByteMappedType.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.type.impl; import org.hibernate.MappingException; import org.hibernate.engine.spi.Mapping; import org.hibernate.ogm.type.descriptor.impl.ByteMappedGridTypeDescriptor; import org.hibernate.type.descriptor.java.ByteTypeDescriptor; /** * Convert a value to {@link Byte} before persisting it. * * @author Davide D'Alto */ public class ByteMappedType extends AbstractGenericBasicType<Byte> { public static final ByteMappedType INSTANCE = new ByteMappedType(); public ByteMappedType() { super( ByteMappedGridTypeDescriptor.INSTANCE, ByteTypeDescriptor.INSTANCE ); } @Override public String getName() { return "byte"; } @Override public String[] getRegistrationKeys() { return new String[] { getName(), int.class.getName(), Byte.class.getName() }; } @Override public int getColumnSpan(Mapping mapping) throws MappingException { return 1; } }
hibernate/hibernate-orm
1,027
hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/interfaces/components/Component1.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.orm.test.envers.integration.interfaces.components; import jakarta.persistence.Embeddable; /** * @author Adam Warski (adam at warski dot org) */ @Embeddable public class Component1 implements IComponent { private String data; public Component1(String data) { this.data = data; } public Component1() { } public String getData() { return data; } public void setData(String data) { this.data = data; } @Override public boolean equals(Object o) { if ( this == o ) { return true; } if ( !(o instanceof Component1) ) { return false; } Component1 that = (Component1) o; if ( data != null ? !data.equals( that.data ) : that.data != null ) { return false; } return true; } @Override public int hashCode() { return data != null ? data.hashCode() : 0; } @Override public String toString() { return "Component1{" + "data='" + data + '\'' + '}'; } }
hibernate/hibernate-orm
1,051
hibernate-core/src/test/java/org/hibernate/orm/test/component/cascading/toone/Address.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.orm.test.component.cascading.toone; /** * {@inheritDoc} * * @author Steve Ebersole */ public class Address { private Long id; private String street1; private String street2; private String city; private String state; private String zipCode; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getStreet1() { return street1; } public void setStreet1(String street1) { this.street1 = street1; } public String getStreet2() { return street2; } public void setStreet2(String street2) { this.street2 = street2; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getZipCode() { return zipCode; } public void setZipCode(String zipCode) { this.zipCode = zipCode; } }
hibernate/hibernate-orm
1,091
hibernate-envers/src/main/java/org/hibernate/envers/boot/model/Key.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.envers.boot.model; import java.util.ArrayList; import java.util.List; import org.hibernate.boot.jaxb.hbm.spi.JaxbHbmKeyType; /** * Contract for declaring a column name of a foreign key. * * @author Chris Cranford */ public class Key implements ColumnContainer, Bindable<JaxbHbmKeyType>, Cloneable<Key> { private final List<Column> columns; public Key() { this.columns = new ArrayList<>(); } public Key(Key key) { this.columns = new ArrayList<>(); for ( Column column : key.columns ) { this.columns.add( new Column( column ) ); } } @Override public List<Column> getColumns() { return columns; } @Override public void addColumn(Column column) { this.columns.add( column ); } @Override public Key deepCopy() { return new Key( this ); } @Override public JaxbHbmKeyType build() { final JaxbHbmKeyType key = new JaxbHbmKeyType(); for ( Column column : columns ) { key.getColumn().add( column.build() ); } return key; } }
hibernate/hibernate-orm
1,103
hibernate-core/src/test/java/org/hibernate/orm/test/pc/Person.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.orm.test.pc; import java.util.ArrayList; import java.util.List; import jakarta.persistence.CascadeType; import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.OneToMany; /** * @author Vlad Mihalcea */ //tag::pc-cascade-domain-model-example[] @Entity public class Person { @Id private Long id; private String name; @OneToMany(mappedBy = "owner", cascade = CascadeType.ALL) private List<Phone> phones = new ArrayList<>(); //Getters and setters are omitted for brevity //end::pc-cascade-domain-model-example[] public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<Phone> getPhones() { return phones; } //tag::pc-cascade-domain-model-example[] public void addPhone(Phone phone) { this.phones.add(phone); phone.setOwner(this); } } //end::pc-cascade-domain-model-example[]
hibernate/hibernate-search
1,053
documentation/src/test/java/org/hibernate/search/documentation/mapper/orm/spatial/geopointbinding/property/MyCoordinates.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.search.documentation.mapper.orm.spatial.geopointbinding.property; import jakarta.persistence.Basic; import jakarta.persistence.Embeddable; import org.hibernate.search.mapper.pojo.bridge.builtin.annotation.Latitude; import org.hibernate.search.mapper.pojo.bridge.builtin.annotation.Longitude; //tag::include[] @Embeddable public class MyCoordinates { // <1> @Basic @Latitude // <2> private Double latitude; @Basic @Longitude // <3> private Double longitude; protected MyCoordinates() { // For Hibernate ORM } public MyCoordinates(double latitude, double longitude) { this.latitude = latitude; this.longitude = longitude; } public double getLatitude() { return latitude; } public void setLatitude(Double latitude) { // <4> this.latitude = latitude; } public double getLongitude() { return longitude; } public void setLongitude(Double longitude) { this.longitude = longitude; } } //end::include[]
hibernate/hibernate-tools
1,134
jbt/src/test/java/org/hibernate/tool/orm/jbt/internal/util/MockDialectTest.java
/* * Hibernate Tools, Tooling for your Hibernate Projects * * Copyright 2022-2025 Red Hat, 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 org.hibernate.tool.orm.jbt.internal.util; import static org.junit.jupiter.api.Assertions.assertEquals; import org.hibernate.dialect.DatabaseVersion; import org.junit.jupiter.api.Test; public class MockDialectTest { @Test public void testGetVersion() { DatabaseVersion version = new MockDialect().getVersion(); assertEquals(Integer.MAX_VALUE, version.getDatabaseMajorVersion()); assertEquals(Integer.MIN_VALUE, version.getDatabaseMinorVersion()); } }
hibernate/hibernate-validator
1,048
documentation/src/test/java/org/hibernate/validator/referenceguide/chapter12/failfastonpropertyviolation/Book.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ // tag::include[] package org.hibernate.validator.referenceguide.chapter12.failfastonpropertyviolation; //end::include[] import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import org.hibernate.validator.constraints.ISBN; //tag::include[] @NonSelfPublishing public class Book { @ISBN private String isbn; @NotBlank private String title; @NotNull private Person author; @NotNull private Person publisher; //constructors, getters and setters... //end::include[] public Book(String isbn, String title, Person author, Person publisher) { this.isbn = isbn; this.title = title; this.author = author; this.publisher = publisher; } public String getIsbn() { return this.isbn; } public String getTitle() { return this.title; } public Person getAuthor() { return this.author; } public Person getPublisher() { return this.publisher; } //tag::include[] } //end::include[]
hibernate/hibernate-validator
1,073
documentation/src/test/java/org/hibernate/validator/referenceguide/chapter03/inheritance/parameter/CarTest.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.validator.referenceguide.chapter03.inheritance.parameter; import java.lang.reflect.Method; import jakarta.validation.ConstraintDeclarationException; import jakarta.validation.Validation; import jakarta.validation.ValidatorFactory; import jakarta.validation.executable.ExecutableValidator; import org.junit.BeforeClass; import org.junit.Test; public class CarTest { private static ExecutableValidator executableValidator; @BeforeClass public static void setUpValidator() { ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); executableValidator = factory.getValidator().forExecutables(); } @Test(expected = ConstraintDeclarationException.class) public void illegalParameterConstraints() throws Exception { Car object = new Car(); Method method = Car.class.getMethod( "drive", int.class ); Object[] parameterValues = { }; executableValidator.validateParameters( object, method, parameterValues ); } }
openjdk/jdk8
1,161
langtools/test/tools/javac/generics/forwardSeparateBound/ForwardSeparateBound1.java
/* * Copyright (c) 2001, 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. */ /* * Auxiliary file for 4488671 (ForwardSeparateBound2). */ class X<T> {} class T1<A extends X<B>, B> {}
openjdk/jdk8
1,171
langtools/test/tools/javac/Paths/6638501/HelloLib/test/HelloImpl.java
/* * Copyright (c) 2007, 2008, 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 test; public class HelloImpl { public void Hello() { java.lang.System.out.println("Hello"); } }
openjdk/jdk8
1,172
langtools/test/tools/javac/lambda/MethodReference64.java
/* * @test /nodynamiccopyright/ * @bug 8008540 8008539 8008538 * @summary Constructor reference to non-reifiable array should be rejected * @compile/fail/ref=MethodReference64.out -XDrawDiagnostics MethodReference64.java */ class MethodReference64 { interface ClassFactory { Object m(); } interface ArrayFactory { Object m(int i); } @interface Anno { } enum E { } interface I { } static class Foo<X> { } void m(ClassFactory cf) { } void m(ArrayFactory cf) { } void testAssign() { ClassFactory c1 = Anno::new; //error ClassFactory c2 = E::new; //error ClassFactory c3 = I::new; //error ClassFactory c4 = Foo<?>::new; //error ClassFactory c5 = 1::new; //error ArrayFactory a1 = Foo<?>[]::new; //ok ArrayFactory a2 = Foo<? extends String>[]::new; //error } void testMethod() { m(Anno::new); //error m(E::new); //error m(I::new); //error m(Foo<?>::new); //error m(1::new); //error m(Foo<?>[]::new); //ok - resolves to m(ArrayFactory) m(Foo<? extends String>[]::new); //error } }
openjdk/jdk8
1,181
langtools/test/tools/javac/diags/examples/NotAllowedClass.java
/* * Copyright (c) 2012, 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.class.not.allowed class NotAllowedClass { void t1() { if (true) class X {} } }