repo_id
stringclasses
875 values
size
int64
974
38.9k
file_path
stringlengths
10
308
content
stringlengths
974
38.9k
apache/stratos
1,096
components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/applications/ClusterInformation.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.applications; public interface ClusterInformation { public String getClusterId(String applicationId, String alias, String cartridgeType); public String getHostName(String applicationId, String alias, String cartridgeDefinitionHostName); }
apache/streampipes
1,048
streampipes-extensions/streampipes-processors-enricher-jvm/src/main/java/org/apache/streampipes/processors/enricher/jvm/processor/math/operation/OperationDivide.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.processors.enricher.jvm.processor.math.operation; public class OperationDivide implements Operation { @Override public Double operate(Double valLeft, Double valRight) { return valLeft / valRight; } }
apache/streampipes
1,048
streampipes-extensions/streampipes-processors-enricher-jvm/src/main/java/org/apache/streampipes/processors/enricher/jvm/processor/math/operation/OperationModulo.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.processors.enricher.jvm.processor.math.operation; public class OperationModulo implements Operation { @Override public Double operate(Double valLeft, Double valRight) { return valLeft % valRight; } }
apache/streampipes
1,094
streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/query/expression/LesserThanExpression.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.streampipes.wrapper.siddhi.query.expression; public class LesserThanExpression extends RelationalOperatorExpression { public LesserThanExpression(PropertyExpressionBase exp1, PropertyExpressionBase exp2) { super(RelationalOperator.LESSER_THAN, exp1, exp2); } }
apache/streampipes
1,109
streampipes-wrapper-flink/src/main/java/org/apache/streampipes/wrapper/flink/IDataProcessorProgram.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.streampipes.wrapper.flink; import org.apache.streampipes.model.runtime.Event; import org.apache.flink.streaming.api.datastream.DataStream; public interface IDataProcessorProgram extends IFlinkProgram { DataStream<Event> getApplicationLogic(DataStream<Event>... messageStream); }
apache/streampipes
1,110
streampipes-model/src/main/java/org/apache/streampipes/model/pipeline/compact/OutputConfiguration.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.streampipes.model.pipeline.compact; import com.fasterxml.jackson.annotation.JsonInclude; import java.util.List; @JsonInclude(JsonInclude.Include.NON_NULL) public record OutputConfiguration(List<String> keep, List<UserDefinedOutput> userDefined) { }
apache/streampipes
1,110
streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/data/PipelineGraph.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.data; import org.apache.streampipes.model.base.NamedStreamPipesEntity; import org.jgrapht.graph.DirectedMultigraph; public class PipelineGraph extends DirectedMultigraph<NamedStreamPipesEntity, String> { public PipelineGraph() { super(String.class); } }
apache/struts
1,140
core/src/test/java/org/apache/struts2/inject/InitializableBean.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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; public class InitializableBean implements Initializable { private String message = ""; static boolean initialized; public String getMessage() { return message; } @Override public void init() { message += "initialized"; initialized = true; } }
apache/tika
1,117
tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/emitter/TikaEmitterException.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.pipes.core.emitter; import org.apache.tika.exception.TikaException; public class TikaEmitterException extends TikaException { public TikaEmitterException(String msg) { super(msg); } public TikaEmitterException(String msg, Throwable t) { super(msg, t); } }
apache/tomee
1,110
container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/OpenEjbConfigurationFactory.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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 org.apache.openejb.OpenEJBException; import java.util.Properties; public interface OpenEjbConfigurationFactory { void init(Properties props) throws OpenEJBException; OpenEjbConfiguration getOpenEjbConfiguration() throws OpenEJBException; }
apache/usergrid
1,118
stack/services/src/main/java/org/apache/usergrid/security/shiro/credentials/AdminUserPassword.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.usergrid.security.shiro.credentials; public class AdminUserPassword extends AbstractPasswordCredentials implements AdminUserCredentials { public AdminUserPassword(){} //do not remove, needed for Jackson public AdminUserPassword( String password ) { super( password ); } }
apache/wicket
1,110
wicket-core-tests/src/test/java/org/apache/wicket/markup/html/panel/SimplePanel_1.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.html.panel; /** * Mock page for testing. * * @author Chris Turner */ public class SimplePanel_1 extends Panel { private static final long serialVersionUID = 1L; /** * Construct. * * @param id */ public SimplePanel_1(final String id) { super(id); } }
apache/wicket
1,110
wicket-core-tests/src/test/java/org/apache/wicket/markup/html/panel/SimplePanel_2.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.html.panel; /** * Mock page for testing. * * @author Chris Turner */ public class SimplePanel_2 extends Panel { private static final long serialVersionUID = 1L; /** * Construct. * * @param id */ public SimplePanel_2(final String id) { super(id); } }
apache/wicket
1,110
wicket-core-tests/src/test/java/org/apache/wicket/markup/html/panel/SimplePanel_3.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.wicket.markup.html.panel; /** * Mock page for testing. * * @author Chris Turner */ public class SimplePanel_3 extends Panel { private static final long serialVersionUID = 1L; /** * Construct. * * @param id */ public SimplePanel_3(final String id) { super(id); } }
apache/wicket
1,114
wicket-core-tests/src/test/java/org/apache/wicket/markup/html/link/AutolinkPage_4.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.html.link; import org.apache.wicket.markup.html.WebPage; /** * Mock page for testing. * * @author Chris Turner */ public class AutolinkPage_4 extends WebPage { private static final long serialVersionUID = 1L; /** * Construct. */ public AutolinkPage_4() { } }
apache/zeppelin
1,114
elasticsearch/src/main/java/org/apache/zeppelin/elasticsearch/client/ElasticsearchClientType.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.elasticsearch.client; public enum ElasticsearchClientType { HTTP(true), HTTPS(true), TRANSPORT(false), UNKNOWN(false); private final boolean isHttp; ElasticsearchClientType(boolean isHttp) { this.isHttp = isHttp; } public boolean isHttp() { return isHttp; } }
google/adk-java
1,141
core/src/main/java/com/google/adk/utils/ModelNameUtils.java
package com.google.adk.utils; import java.util.regex.Matcher; import java.util.regex.Pattern; public class ModelNameUtils { private static final Pattern GEMINI_2_PATTERN = Pattern.compile("^gemini-2\\..*"); private static final Pattern PATH_PATTERN = Pattern.compile("^projects/[^/]+/locations/[^/]+/publishers/[^/]+/models/(.+)$"); public static boolean isGemini2Model(String modelString) { if (modelString == null) { return false; } String modelName = extractModelName(modelString); return GEMINI_2_PATTERN.matcher(modelName).matches(); } /** * Extract the actual model name from either simple or path-based format. * * @param modelString Either a simple model name like "gemini-2.5-pro" or a path-based model name * like "projects/.../models/gemini-2.0-flash-001" * @return The extracted model name (e.g., "gemini-2.5-pro") */ private static String extractModelName(String modelString) { Matcher matcher = PATH_PATTERN.matcher(modelString); if (matcher.matches()) { return matcher.group(1); } return modelString; } private ModelNameUtils() {} }
google/binnavi
1,129
src/main/java/com/google/security/zynamics/binnavi/API/plugins/IPluginServer.java
// Copyright 2011-2016 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.security.zynamics.binnavi.API.plugins; import com.google.security.zynamics.binnavi.api2.plugins.IPlugin; import java.util.Collection; /** * This interface should be implemented by plugins that do not want to implement IPlugin but offer * more than one plugin. * * @param <T> The plugin interface used by the plugin to interface with BinNavi. */ public interface IPluginServer<T> { /** * Returns all created plugins. * * @return Collection of all plugins. */ Collection<IPlugin<T>> getPlugins(); }
google/copybara
1,150
java/com/google/copybara/tsjs/npm/NpmDistInfo.java
/* * Copyright (C) 2024 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.copybara.tsjs.npm; import com.google.api.client.util.Key; import com.google.common.base.MoreObjects; /** Represents the 'dist' keys in various NPM Registry responses. */ public class NpmDistInfo { @Key("tarball") private String tarball; public NpmDistInfo() {} // NOTE there's also download hashes... would be nice to use those. public String getTarball() { return tarball; } @Override public String toString() { return MoreObjects.toStringHelper(this).add("tarball", this.getTarball()).toString(); } }
google/gson
1,139
gson/src/main/java-templates/com/google/gson/internal/GsonBuildConfig.java
/* * Copyright (C) 2018 The Gson 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.gson.internal; /** * Build configuration for Gson. This file is automatically populated by templating-maven-plugin and * .java/.class files are generated for use in Gson. * * @author Inderjeet Singh */ public final class GsonBuildConfig { // Based on https://stackoverflow.com/questions/2469922/generate-a-version-java-file-in-maven /** This field is automatically populated by Maven when a build is triggered */ public static final String VERSION = "${project.version}"; private GsonBuildConfig() {} }
google/j2cl
1,116
transpiler/javatests/com/google/j2cl/readable/java/overwrittentypevariables/ParameterizedType.java
/* * Copyright 2024 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 overwrittentypevariables; // Reuse the ParameterizedType class name to ensure that unique to the FQN of the enclosing type, // not just the relative class name. // // Redefine T in a different position from the parent. public interface ParameterizedType<F, T> extends overwrittentypevariables.otherpkg.ParameterizedType<F, T> { @Override T accept(F value); } class ParameterizedTypeImpl implements ParameterizedType<String, Integer> { @Override public Integer accept(String value) { return 1; } }
google/jsinterop-generator
1,142
java/jsinterop/generator/model/ReturnStatement.java
/* * Copyright 2016 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. * */ package jsinterop.generator.model; import com.google.j2cl.common.visitor.Processor; import com.google.j2cl.common.visitor.Visitable; /** Models a return statement. */ @Visitable public class ReturnStatement extends Statement { @Visitable Expression expression; public ReturnStatement(Expression expression) { this.expression = expression; } public Expression getExpression() { return expression; } @Override Statement acceptInternal(Processor processor) { return Visitor_ReturnStatement.visit(processor, this); } }
google/nomulus
1,140
core/src/main/java/google/registry/model/domain/DomainObjectSpec.java
// Copyright 2017 The Nomulus Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package google.registry.model.domain; import google.registry.model.ImmutableObject; /** * Specification of a domain by name, as used in version 0.11 fee check response items and version * 0.12 fee check commands. This class is used by JAXB, although it turns out that no JAXB-specific * annotations are necessary. */ public class DomainObjectSpec extends ImmutableObject { final String name; public String getName() { return name; } public DomainObjectSpec(String name) { this.name = name; } }
google/nomulus
1,149
common/src/main/java/google/registry/util/SystemClock.java
// Copyright 2017 The Nomulus Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package google.registry.util; import static org.joda.time.DateTimeZone.UTC; import jakarta.inject.Inject; import javax.annotation.concurrent.ThreadSafe; import org.joda.time.DateTime; /** Clock implementation that proxies to the real system clock. */ @ThreadSafe public class SystemClock implements Clock { private static final long serialVersionUID = 5165372013848947515L; @Inject public SystemClock() {} /** Returns the current time. */ @Override public DateTime nowUtc() { return DateTime.now(UTC); } }
google/truth
1,138
core/src/test/java/com/google/common/truth/StandardSubjectBuilderTest.java
/* * Copyright (c) 2019 Google, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.common.truth; import static com.google.common.truth.ExpectFailure.assertThat; import static com.google.common.truth.ExpectFailure.expectFailure; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Tests for {@link StandardSubjectBuilder}. */ @RunWith(JUnit4.class) public final class StandardSubjectBuilderTest { @Test public void failNoMessage() { AssertionError e = expectFailure(whenTesting -> whenTesting.fail()); assertThat(e).hasMessageThat().isEmpty(); } }
google/tsunami-security-scanner
1,131
plugin/src/main/java/com/google/tsunami/plugin/PluginType.java
/* * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.tsunami.plugin; /** The types of a Tsunami plugin. */ public enum PluginType { /** A plugin that identifies the open ports of the scanning target. */ PORT_SCAN, /** * A plugin that performs service specific fingerprints and identifies running software and * versions. */ SERVICE_FINGERPRINT, /** A plugin that detects certain vulnerabilities on an exposed network service. */ VULN_DETECTION, /** A plugin that contains vulnerability detectors from language servers. */ REMOTE_VULN_DETECTION }
googleapis/gapic-generator
1,137
src/main/java/com/google/api/codegen/gapic/ServiceMessages.java
/* Copyright 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 * * 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.api.codegen.gapic; import com.google.api.tools.framework.model.TypeRef; import com.google.protobuf.Empty; /** Utility class with methods to work with service methods. */ public class ServiceMessages { /** Returns true if the message is the empty message. */ public boolean isEmptyType(TypeRef type) { return s_isEmptyType(type); } public static boolean s_isEmptyType(TypeRef type) { return type.isMessage() && type.getMessageType().getFullName().equals(Empty.getDescriptor().getFullName()); } }
googlearchive/android-text
1,101
TextStyling-Java/app/src/main/java/com/android/example/text/styling/parser/TextMarkdown.java
/* * Copyright (C) 2018 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.android.example.text.styling.parser; import androidx.annotation.NonNull; import java.util.List; /** * Simple markdown parsing of text. * Contains a list of markdown {@link Element}s */ public class TextMarkdown { @NonNull private final List<Element> elements; public TextMarkdown(@NonNull final List<Element> elements) { this.elements = elements; } @NonNull public List<Element> getElements() { return elements; } }
hibernate/hibernate-ogm
1,087
core/src/main/java/org/hibernate/ogm/datastore/impl/EmptyAssociationSnapshot.java
/* * Hibernate OGM, Domain model persistence for NoSQL datastores * * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ package org.hibernate.ogm.datastore.impl; import java.util.Collections; import java.util.Set; import org.hibernate.ogm.model.key.spi.RowKey; import org.hibernate.ogm.model.spi.AssociationSnapshot; import org.hibernate.ogm.model.spi.Tuple; /** * Represents an empty {@link AssociationSnapshot}. * * @author Davide D'Alto &lt;davide@hibernate.org&gt; */ public final class EmptyAssociationSnapshot implements AssociationSnapshot { public static final EmptyAssociationSnapshot INSTANCE = new EmptyAssociationSnapshot(); private EmptyAssociationSnapshot() { } @Override public Tuple get(RowKey column) { return null; } @Override public boolean containsKey(RowKey column) { return false; } @Override public int size() { return 0; } @Override public Set<RowKey> getRowKeys() { return Collections.emptySet(); } }
hibernate/hibernate-orm
1,043
hibernate-core/src/test/java/org/hibernate/orm/test/any/annotations/LongProperty.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.orm.test.any.annotations; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.Table; import jakarta.persistence.Column; @Entity @Table(name = "long_property") public class LongProperty implements Property { private Integer id; private String name; private Long value; public LongProperty() { super(); } public LongProperty(String name, Long value) { super(); this.name = name; this.value = value; } public String asString() { return Long.toString(value); } public String getName() { return name; } @Id @GeneratedValue public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @Column(name = "`value`") public Long getValue() { return value; } public void setValue(Long value) { this.value = value; } public void setName(String name) { this.name = name; } }
hibernate/hibernate-orm
1,045
hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Summarization.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.sql.ast.tree.expression; import java.util.List; import org.hibernate.metamodel.mapping.MappingModelExpressible; import org.hibernate.sql.ast.SqlAstWalker; /** * @author Christian Beikov */ public class Summarization implements Expression { private final Kind kind; private final List<Expression> groupings; public Summarization(Kind kind, List<Expression> groupings) { this.kind = kind; this.groupings = groupings; } public Kind getKind() { return kind; } public List<Expression> getGroupings() { return groupings; } @Override public MappingModelExpressible getExpressionType() { return null; } @Override public void accept(SqlAstWalker walker) { walker.visitSummarization( this ); } public enum Kind { ROLLUP( "rollup" ), CUBE( "cube" ); private final String sqlText; Kind(String sqlText) { this.sqlText = sqlText; } public String sqlText() { return sqlText; } } }
hibernate/hibernate-orm
1,059
hibernate-core/src/test/java/org/hibernate/orm/test/annotations/FlyingObject.java
/* * SPDX-License-Identifier: Apache-2.0 * Copyright Red Hat Inc. and Hibernate Authors */ package org.hibernate.orm.test.annotations; import java.io.Serializable; import jakarta.persistence.Column; import jakarta.persistence.MappedSuperclass; import jakarta.persistence.Transient; /** * @author Emmanuel Bernard */ @MappedSuperclass public abstract class FlyingObject extends Thing implements Serializable { private String serial; private int altitude; private int metricAltitude; private String color = "white"; public int getAltitude() { return altitude; } public void setAltitude(int i) { altitude = i; } @Transient public int getMetricAltitude() { return metricAltitude; } public void setMetricAltitude(int i) { metricAltitude = i; } @Column(name = "serialnbr") public String getSerial() { return serial; } public void setSerial(String serial) { this.serial = serial; } @Column(nullable = false) public String getColor() { return color; } public void setColor(String color) { this.color = color; } }
hibernate/hibernate-shards
1,135
src/main/java/org/hibernate/shards/query/SetMaxResultsEvent.java
/** * Copyright (C) 2007 Google Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library 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 * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ package org.hibernate.shards.query; import org.hibernate.Query; /** * @author Maulik Shah */ public class SetMaxResultsEvent implements QueryEvent { private final int maxResults; public SetMaxResultsEvent(int maxResults) { this.maxResults = maxResults; } public void onEvent(Query query) { query.setMaxResults(maxResults); } }
openjdk/jdk8
1,138
jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSQName.java
/* * reserved comment block * DO NOT REMOVE OR ALTER! */ /* * Copyright 2005 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 com.sun.org.apache.xerces.internal.xs.datatypes; /** * Interface to expose QName actual values * * @author Ankit Pasricha, IBM */ public interface XSQName { /** * @return com.sun.org.apache.xerces.internal.xni.QName class instance */ public com.sun.org.apache.xerces.internal.xni.QName getXNIQName(); /** * @return javax.xml.namespace.QName class instance */ public javax.xml.namespace.QName getJAXPQName(); }
openjdk/jdk8
1,142
langtools/test/tools/javac/diags/examples/UncheckedPlural/UncheckedFilename.java
/* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ import java.util.*; class UncheckedFilename { List<String> list = new ArrayList(); }
openjdk/jdk8
1,152
langtools/test/com/sun/javadoc/testMemberInheritence/diamond/B.java
/* * Copyright (c) 2005, 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 diamond; public interface B extends A { /** * bDoc. */ void bMethod(); }
openjdk/jdk8
1,152
langtools/test/com/sun/javadoc/testMemberInheritence/diamond/C.java
/* * Copyright (c) 2005, 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 diamond; public interface C extends B { /** * cDoc. */ void cMethod(); }
openjdk/jdk8
1,152
langtools/test/com/sun/javadoc/testMemberInheritence/diamond/X.java
/* * Copyright (c) 2005, 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 diamond; public interface X extends A { /** * xDoc. */ void xMethod(); }
openjdk/jdk8
1,153
langtools/test/tools/javac/diags/examples/IntfMethodCantHaveBody.java
/* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ // key: compiler.err.intf.meth.cant.have.body interface IntfMethodCantHaveBody { void m() { } }
openjdk/jdk8
1,153
langtools/test/tools/javac/diags/examples/MethodDoesNotOverride.java
/* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ // key: compiler.err.method.does.not.override.superclass class X { @Override void m() { } }
openjdk/jdk8
1,154
langtools/test/com/sun/javadoc/testProfiles/pkg4/Class1Pkg4.java
/* * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package pkg4; /** * Another test class. * * @author Bhavesh Patel */ public class Class1Pkg4 { }
openjdk/jdk8
1,156
langtools/test/tools/javac/diags/examples/RepeatedInterface.java
/* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ // key: compiler.err.repeated.interface interface I { } class RepeatedInterface implements I, I { }
openjdk/jdk8
1,156
langtools/test/tools/javadoc/annotations/shortcuts/pkg1/A.java
/* * Copyright (c) 2003, 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 pkg1; @Value("there is only one") @Array(favoriteNumbers={3.5}) @Marker public interface A { }
openjdk/jdk8
1,157
jdk/test/java/lang/reflect/Proxy/returnTypes/GetSerializable.java
/* * Copyright (c) 2003, 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. */ import java.io.Serializable; public interface GetSerializable { Serializable get(double[][][] x); }
openjdk/jdk8
1,162
langtools/test/tools/javac/cast/intersection/model/Check.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. */ /** * Annotation used by ModelChecker to mark the class whose model is to be checked */ @interface Check {}
openjdk/jdk8
1,163
langtools/test/tools/javac/diags/examples/WarnSelfRef.java
/* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ // key: compiler.warn.self.ref // options: -XDuseBeforeDeclarationWarning class X { static int x = X.x; }
openjdk/jdk8
1,165
langtools/test/tools/javac/diags/examples/NoJavaLang.java
/* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ // key: compiler.misc.fatal.err.no.java.lang // options: -Xbootclasspath: // run: backdoor class NoJavaLang { }
openjdk/jdk8
1,171
langtools/test/tools/javadoc/sourceOption/p/A.java
/* * Copyright (c) 2004, 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 p; public class A { boolean assert; // illegal since 1.4 boolean enum; // illegal since 5 }
openjdk/jtreg
1,167
test/modlibs/buildAction/BuildLibUserModClasses.java
/* * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * @test * @library /libs/usermods * @build * lum2/lum2_p1.lum2_p1_C * lum3/lum3_p1.lum3_p1_C */
oracle/coherence
1,087
prj/test/unit/coherence-core-tests/src/test/java/com/oracle/coherence/common/schema/AbstractPropertyHandlerTest.java
/* * Copyright (c) 2000, 2022, Oracle and/or its affiliates. * * Licensed under the Universal Permissive License v 1.0 as shown at * http://oss.oracle.com/licenses/upl. */ package com.oracle.coherence.common.schema; import com.oracle.coherence.common.schema.lang.java.JavaProperty; import org.junit.Test; import static org.junit.Assert.assertEquals; /** * @author as 2013.11.20 */ public class AbstractPropertyHandlerTest { @Test public void testGenericArguments() { TestPropertyHandler t = new TestPropertyHandler(); assertEquals(JavaProperty.class, t.getInternalPropertyClass()); assertEquals(String.class, t.getExternalPropertyClass()); } private static class TestPropertyHandler extends AbstractPropertyHandler<JavaProperty, String> { public JavaProperty createProperty(ExtensibleProperty parent) { return null; } public void importProperty(JavaProperty property, String source, Schema schema) { } } }
oracle/nosql
1,149
kvmain/src/main/java/oracle/kv/impl/test/TestHookExecute.java
/*- * Copyright (C) 2011, 2025 Oracle and/or its affiliates. All rights reserved. * * This file was distributed by Oracle as part of a version of Oracle NoSQL * Database made available at: * * http://www.oracle.com/technetwork/database/database-technologies/nosqldb/downloads/index.html * * Please see the LICENSE file included in the top-level directory of the * appropriate version of Oracle NoSQL Database for a copy of the license and * additional information. */ package oracle.kv.impl.test; import java.io.IOException; /** * Execute a test hook if set. This wrapper is used so that test hook execution * can be packaged into a single statement that can be done within an assert * statement. */ public class TestHookExecute { public static <T> boolean doHookIfSet(TestHook<T> testHook, T obj) { if (testHook != null) { testHook.doHook(obj); } return true; } public static <T> boolean doIOHookIfSet(TestIOHook<T> testHook, T obj) throws IOException { if (testHook != null) { testHook.doHook(obj); } return true; } }
oracle/nosql
1,151
kvmain/src/main/java/com/sleepycat/je/rep/SyncUpFailedException.java
/*- * Copyright (C) 2002, 2025, Oracle and/or its affiliates. All rights reserved. * * This file was distributed by Oracle as part of a version of Oracle NoSQL * Database made available at: * * http://www.oracle.com/technetwork/database/database-technologies/nosqldb/downloads/index.html * * Please see the LICENSE file included in the top-level directory of the * appropriate version of Oracle NoSQL Database for a copy of the license and * additional information. */ package com.sleepycat.je.rep; import com.sleepycat.je.DatabaseException; import com.sleepycat.je.utilint.NotSerializable; /** * SyncUpFailedException will be thrown out during feeder-replica syncup. * During syncup, feeder/replica may spend too much time reading its log * files backwards to locate a potential matchpoint and channel is idle * because of no read activity. If the channel is detected to be closed, * syncup will be terminated and will throw a SyncUpFailedException. */ public class SyncUpFailedException extends DatabaseException implements NotSerializable { public SyncUpFailedException(String message) { super(message); } }
oracle/oci-java-sdk
1,162
bmc-common/src/main/java/com/oracle/bmc/InternalSdk.java
/** * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. */ package com.oracle.bmc; /** * Annotation to indicate a class or method is only meant for internal SDK usage, and may * break/change without notice. * * <p>Classes or methods with this annotation generally appear in non-'internal' packages so that * they show up for documentation but are not intended to for consumers to actually use. * * <p>Note, by convention, any class with 'internal' in the package name is not intended for * consumers to directly use, regardless of whether or not it contains this annotation. */ public @interface InternalSdk { /** * If set to true, backward compatibility should be maintained, even though this is internal SDK * code. * * @return true if backward compatibility should be maintained */ boolean backwardCompatibilityRequired() default false; }
apache/ctakes
1,126
ctakes-core/src/main/java/org/apache/ctakes/core/resource/StringIntegerMapResource.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.ctakes.core.resource; import java.util.Map; /** * Resource that defines a map between a String (KEY) and Integer. * @author Mayo Clinic */ public interface StringIntegerMapResource { /** * Gets a map of the String/Integer values. */ public Map<String, Integer> getMap(); }
apache/curator
1,123
curator-framework/src/main/java/org/apache/curator/framework/api/UnhandledErrorListener.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.curator.framework.api; public interface UnhandledErrorListener { /** * Called when an exception is caught in a background thread, handler, etc. * * @param message Source message * @param e exception */ public void unhandledError(String message, Throwable e); }
apache/curator
1,125
curator-framework/src/main/java/org/apache/curator/framework/imps/NamespaceWatchedEvent.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.curator.framework.imps; import org.apache.zookeeper.WatchedEvent; class NamespaceWatchedEvent extends WatchedEvent { NamespaceWatchedEvent(CuratorFrameworkBase client, WatchedEvent event) { super(event.getType(), event.getState(), client.unfixForNamespace(event.getPath())); } }
apache/cxf
1,147
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/Oneway.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.cxf.jaxrs.ext; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Can be used to nominate oneway methods * */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface Oneway { }
apache/dolphinscheduler
1,077
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/exception/dispatch/WorkerGroupNotFoundException.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.dolphinscheduler.server.master.exception.dispatch; public class WorkerGroupNotFoundException extends TaskDispatchException { public WorkerGroupNotFoundException(String workerGroup) { super("Cannot find worker group: " + workerGroup); } }
apache/dolphinscheduler
1,094
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/vo/resources/FetchFileContentResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.dolphinscheduler.api.vo.resources; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; @Data @Builder @NoArgsConstructor @AllArgsConstructor public class FetchFileContentResponse { private String content; }
apache/drill
1,152
exec/java-exec/src/main/java/org/apache/drill/exec/disk/Spool.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.drill.exec.disk; import java.io.IOException; import org.apache.drill.exec.record.RecordBatch; public interface Spool { static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Spool.class); public void write(RecordBatch batch) throws IOException; public void read(RecordBatch batch) throws IOException; }
apache/dubbo-samples
1,105
online_bontique_demo/common/src/main/java/org/apache/dubbo/shop/common/dto/request/GetCartRequest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dubbo.shop.common.dto.request; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; @Data @AllArgsConstructor @NoArgsConstructor public class GetCartRequest implements Serializable { private String userId; }
apache/dubbo
1,101
dubbo-plugin/dubbo-spring-security/src/main/java/org/apache/dubbo/spring/security/jackson/ObjectMapperCodecCustomer.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.dubbo.spring.security.jackson; import org.apache.dubbo.common.extension.ExtensionScope; import org.apache.dubbo.common.extension.SPI; @SPI(scope = ExtensionScope.FRAMEWORK) public interface ObjectMapperCodecCustomer { void customize(ObjectMapperCodec objectMapperCodec); }
apache/dubbo
1,122
dubbo-compatible/src/main/java/com/alibaba/dubbo/remoting/exchange/ResponseCallback.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.dubbo.remoting.exchange; /** * 2019-06-20 */ @Deprecated public interface ResponseCallback { /** * done. * * @param response */ void done(Object response); /** * caught exception. * * @param exception */ void caught(Throwable exception); }
apache/dubbo
1,147
dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/RpcResult.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.dubbo.rpc; import org.apache.dubbo.rpc.AppResponse; @Deprecated public class RpcResult extends AppResponse implements com.alibaba.dubbo.rpc.Result { public RpcResult() {} public RpcResult(Object result) { super(result); } public RpcResult(Throwable exception) { super(exception); } }
apache/eventmesh
1,094
eventmesh-common/src/main/java/org/apache/eventmesh/common/config/connector/rdb/mongodb/SourceConnectorConfig.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.eventmesh.common.config.connector.rdb.mongodb; import lombok.Data; @Data public class SourceConnectorConfig { private String connectorName; private String connectorType; private String url; private String database; private String collection; }
apache/felix-dev
1,077
ipojo/runtime/core-it/ipojo-core-annotations-test/src/main/java/org/apache/felix/ipojo/runtime/core/test/components/FactoryMethod.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.felix.ipojo.runtime.core.test.components; import org.apache.felix.ipojo.annotations.Component; @Component(factoryMethod="create") public class FactoryMethod { public static FactoryMethod create() { return new FactoryMethod(); } }
apache/fineract
1,108
fineract-core/src/main/java/org/apache/fineract/portfolio/client/domain/search/SearchingClientRepository.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.fineract.portfolio.client.domain.search; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; public interface SearchingClientRepository { Page<SearchedClient> searchByText(String searchText, Pageable pageable, String officeHierarchy); }
apache/fory
1,129
java/fory-core/src/main/java/org/apache/fory/exception/ClassUnregisteredException.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.fory.exception; public class ClassUnregisteredException extends ForyException { public ClassUnregisteredException(Class<?> cls) { this(cls.getName()); } public ClassUnregisteredException(String qualifiedName) { super(String.format("Class %s is not registered", qualifiedName)); } }
apache/geaflow
1,069
geaflow/geaflow-dsl/geaflow-dsl-connector/geaflow-dsl-connector-api/src/main/java/org/apache/geaflow/dsl/connector/api/TableReadableConnector.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.geaflow.dsl.connector.api; import org.apache.geaflow.common.config.Configuration; /** * A readable table connector. */ public interface TableReadableConnector extends TableConnector { TableSource createSource(Configuration conf); }
apache/giraph
1,135
giraph-core/src/main/java/org/apache/giraph/types/LongToLongWritableWrapper.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.giraph.types; import org.apache.hadoop.io.LongWritable; /** * Converts Longs to LongWritables */ public class LongToLongWritableWrapper implements WritableWrapper<LongWritable, Long> { @Override public void wrap(Long javaValue, LongWritable writableValue) { writableValue.set(javaValue); } }
apache/gobblin
1,119
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/exception/MetadataException.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.gobblin.source.extractor.exception; public class MetadataException extends Exception { private static final long serialVersionUID = 1L; public MetadataException(String message) { super(message); } public MetadataException(String message, Exception e) { super(message, e); } }
apache/gobblin
1,129
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/JobStatusMonitor.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.gobblin.service.monitoring; import com.google.common.util.concurrent.Service; /** * A marker interface for job status monitors to generalize initialization in {@link org.apache.gobblin.service.modules.core.GobblinServiceManager#jobStatusMonitor} */ public interface JobStatusMonitor extends Service { }
apache/groovy
1,148
src/main/java/org/codehaus/groovy/transform/TransformWithPriority.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.codehaus.groovy.transform; /** * AST transforms may optionally implement this interface and return a priority value. * Transforms within the same phase will be executed from greater to lower values of priority. * The default priority is zero. */ public interface TransformWithPriority { int priority(); }
apache/hadoop-common
1,048
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/KillJobRequest.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.mapreduce.v2.api.protocolrecords; import org.apache.hadoop.mapreduce.v2.api.records.JobId; public interface KillJobRequest { public abstract JobId getJobId(); public abstract void setJobId(JobId jobId); }
apache/hadoop-common
1,059
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/commit/CommitterEvent.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.mapreduce.v2.app.commit; import org.apache.hadoop.yarn.event.AbstractEvent; public class CommitterEvent extends AbstractEvent<CommitterEventType> { public CommitterEvent(CommitterEventType type) { super(type); } }
apache/hadoop
1,108
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/checker/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. */ /** * Datanode support for running disk checks. */ @InterfaceAudience.LimitedPrivate({"HDFS"}) @InterfaceStability.Evolving package org.apache.hadoop.hdfs.server.datanode.checker; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability;
apache/hadoop
1,109
hadoop-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/conf/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. */ /** * Classes for hadoop-tos conf. */ @InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce", "YARN", "Hive"}) @InterfaceStability.Evolving package org.apache.hadoop.fs.tosfs.conf; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability;
apache/hadoop
1,109
hadoop-cloud-storage-project/hadoop-tos/src/main/java/org/apache/hadoop/fs/tosfs/util/package-info.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Classes for hadoop-tos util. */ @InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce", "YARN", "Hive"}) @InterfaceStability.Evolving package org.apache.hadoop.fs.tosfs.util; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability;
apache/hadoop
1,121
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestSetrepDecreasing.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.hdfs; import java.io.IOException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; public class TestSetrepDecreasing { @Test @Timeout(value = 120) public void testSetrepDecreasing() throws IOException { TestSetrepIncreasing.setrep(5, 3, false); } }
apache/harmony
1,098
classlib/modules/beans/src/test/support/java/org/apache/harmony/beans/tests/support/mock/MockBean4CodecBadSetter.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.harmony.beans.tests.support.mock; public class MockBean4CodecBadSetter extends MockBean4Codec { public MockBean4CodecBadSetter() { super(); } @Override public void setName(String name) { throw new UnsupportedOperationException(); } }
apache/harmony
1,163
drlvm/vm/tests/smoke/jni/LoadLibrary.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT 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 Gregory Shimansky */ package jni; /** * @keyword */ public class LoadLibrary { public static void main (String[] args) { try { System.loadLibrary("nosuchlibrary"); } catch (Throwable e) { System.out.println("caught " + e); System.out.println("PASSED"); } } }
apache/hertzbeat
1,088
template-marketplace/hertzbeat-template-hub/src/main/java/org/apache/hertzbeat/templatehub/exception/RestErrorResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.hertzbeat.templatehub.exception; import lombok.AllArgsConstructor; import lombok.Data; import lombok.ToString; import java.io.Serializable; @Data @ToString @AllArgsConstructor public class RestErrorResponse implements Serializable { private String errMsg; }
apache/hop
1,116
engine/src/test/java/org/apache/hop/pipeline/transforms/loadsave/initializer/TransformMetaInitializer.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hop.pipeline.transforms.loadsave.initializer; import org.apache.hop.pipeline.transform.ITransformMeta; public abstract class TransformMetaInitializer<T extends ITransformMeta> implements IInitializer<ITransformMeta> { @Override public abstract void modify(ITransformMeta object); }
apache/hudi
1,095
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/exception/HoodieDeletePartitionPendingTableServiceException.java
/* * * * Licensed to the Apache Software Foundation (ASF) under one * * or more contributor license agreements. See the NOTICE file * * distributed with this work for additional information * * regarding copyright ownership. The ASF licenses this file * * to you under the Apache License, Version 2.0 (the * * "License"); you may not use this file except in compliance * * with the License. You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES 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.hudi.exception; public class HoodieDeletePartitionPendingTableServiceException extends HoodieDeletePartitionException { public HoodieDeletePartitionPendingTableServiceException(String msg) { super(msg); } }
apache/hudi
1,139
hudi-aws/src/main/java/org/apache/hudi/aws/sync/HoodieGlueSyncException.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.hudi.aws.sync; import org.apache.hudi.hive.HoodieHiveSyncException; public class HoodieGlueSyncException extends HoodieHiveSyncException { public HoodieGlueSyncException(String message) { super(message); } public HoodieGlueSyncException(String message, Throwable t) { super(message, t); } }
apache/ignite-3
1,130
modules/rest-api/src/test/java/org/apache/ignite/internal/rest/TimeController.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ignite.internal.rest; import io.micronaut.http.annotation.Body; import io.micronaut.http.annotation.Controller; import io.micronaut.http.annotation.Post; @Controller("/time") class TimeController { @Post public static String time(@Body TimeDto time) { return time.time().toString(); } }
apache/ignite
1,080
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalFlushLogOnlyWithMmapBufferSelfTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ignite.internal.processors.cache.persistence.db.wal; /** * */ public class IgniteWalFlushLogOnlyWithMmapBufferSelfTest extends IgniteWalFlushLogOnlySelfTest { /** {@inheritDoc} */ @Override protected boolean mmap() { return true; } }
apache/impala
1,139
fe/src/main/java/org/apache/impala/common/UnsupportedFeatureException.java
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. package org.apache.impala.common; /** * Identifies that a feature or operation is not supported in * the analyzer. Allows fine-grain error checking in tests. */ @SuppressWarnings("serial") public class UnsupportedFeatureException extends AnalysisException { public UnsupportedFeatureException(String msg) { super(msg); } }
apache/incubator-datalab
1,109
services/provisioning-service/src/main/java/com/epam/datalab/backendapi/core/MetadataHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.epam.datalab.backendapi.core; import com.epam.datalab.dto.imagemetadata.ImageMetadataDTO; import com.epam.datalab.dto.imagemetadata.ImageType; import java.util.Set; @FunctionalInterface public interface MetadataHolder { Set<ImageMetadataDTO> getMetadata(ImageType metadataType); }
apache/incubator-gluten
1,137
gluten-arrow/src/main/java/org/apache/gluten/runtime/RuntimeAware.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES 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.gluten.runtime; /** * This defines the base abstraction for the contextual objects that can be transmitted to C++ side * for further native processing. */ public interface RuntimeAware { default boolean isCompatibleWith(RuntimeAware other) { return rtHandle() == other.rtHandle(); } long rtHandle(); }
apache/incubator-heron
1,132
heron/api/src/java/org/apache/heron/api/metric/MetricStatTimer.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.heron.api.metric; import java.util.Timer; /** * Just holds a singleton metric/stat timer for use by metric/stat calculations */ final class MetricStatTimer { private MetricStatTimer() { } @SuppressWarnings("VisibilityModifier") static Timer timer = new Timer("metric/stat timer", true); }
apache/incubator-heron
1,147
heron/api/src/java/org/apache/heron/api/bolt/IRichBolt.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.heron.api.bolt; import org.apache.heron.api.topology.IComponent; /** * When writing topologies using Java, {@link IRichBolt} and * {@link org.apache.heron.api.spout.IRichSpout} are the main interfaces * to use to implement components of the topology. */ public interface IRichBolt extends IBolt, IComponent { }
apache/incubator-hugegraph-computer
1,099
computer/computer-core/src/main/java/org/apache/hugegraph/computer/core/input/VertexFetcher.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with this * work for additional information regarding copyright ownership. The ASF * licenses this file to You under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package org.apache.hugegraph.computer.core.input; import org.apache.hugegraph.structure.graph.Vertex; /** * Streamed read the data of each input split, and return one HugeVertex object * at each iteration */ public interface VertexFetcher extends ElementFetcher<Vertex> { void close(); }
apache/incubator-hugegraph
1,094
hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/tinkerpop/StructureTestGraphProvider.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hugegraph.tinkerpop; import java.io.IOException; public class StructureTestGraphProvider extends TestGraphProvider { public static final String STRUCTURE = "structure"; public StructureTestGraphProvider() throws IOException { super(STRUCTURE); } }
apache/incubator-kie-drools
1,095
drools-test-coverage/test-compiler-integration/src/test/java/org/drools/mvel/compiler/RoutingMessage.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.drools.mvel.compiler; public class RoutingMessage { private String routingValue; public String getRoutingValue() { return routingValue; } public void setRoutingValue(String routingValue) { this.routingValue = routingValue; } }
apache/incubator-kie-drools
1,126
drools-templates/src/main/java/org/drools/template/parser/DoubleCell.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.drools.template.parser; /** * A cell in a decision table containing a long value */ public class DoubleCell extends AbstractCell<Double> { public DoubleCell(Row row, Column column) { super(row, column); } public void setValue(String v) { value = Double.valueOf(v); } }
apache/incubator-kie-drools
1,138
kie-api/src/main/java/org/kie/api/definition/type/Duration.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.kie.api.definition.type; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(value = RetentionPolicy.RUNTIME) @Target(value = ElementType.TYPE) public @interface Duration { String value(); }
apache/incubator-kie-kogito-runtimes
1,126
api/kogito-api/src/main/java/org/kie/kogito/ExecutionIdSupplier.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.kie.kogito; import java.util.function.Supplier; /** * Wraps logic to generate unique identifiers per execution (e.g. evaluation of DMN model) * * Each call of the {@link #get()} method is considered a separate request of a new ID. */ public interface ExecutionIdSupplier extends Supplier<String> { }
apache/incubator-retired-edgent
1,110
connectors/jdbc/src/main/java/org/apache/edgent/connectors/jdbc/CheckedSupplier.java
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.apache.edgent.connectors.jdbc; /** * Function that supplies a result and may throw an Exception. * * @param <T> stream tuple type */ @FunctionalInterface public interface CheckedSupplier<T> { /** * Get a result. * @return the result * @throws Exception if there are errors */ T get() throws Exception; }
apache/incubator-retired-wave
1,125
wave/src/main/java/org/waveprotocol/wave/model/adt/BasicValue.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES 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.waveprotocol.wave.model.adt; /** * Encapsulates a value can be set and read. * * @param <T> value type */ public interface BasicValue<T> { /** * Sets this value. * * @param value value to set, may be null */ void set(T value); /** * @return current value. */ T get(); }