repo_id
stringclasses
875 values
size
int64
974
38.9k
file_path
stringlengths
10
308
content
stringlengths
974
38.9k
apache/incubator-kie-kogito-apps
1,076
data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/UserTaskInstanceEntityMapperIT.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR 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.index.jdbc.mapper; import org.kie.kogito.index.jpa.mapper.AbstractUserTaskInstanceEntityMapperIT; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest class UserTaskInstanceEntityMapperIT extends AbstractUserTaskInstanceEntityMapperIT { }
apache/incubator-kie-kogito-runtimes
1,060
quarkus/extensions/kogito-quarkus-extension-spi/src/main/java/org/kie/kogito/quarkus/extensions/spi/deployment/TrustyServiceAvailableBuildItem.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR 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.quarkus.extensions.spi.deployment; import io.quarkus.builder.item.SimpleBuildItem; /** * Signals that a Trusty Service instance is available. */ public final class TrustyServiceAvailableBuildItem extends SimpleBuildItem { }
apache/incubator-myriad
1,121
myriad-scheduler/src/main/java/org/apache/myriad/scheduler/event/StatusUpdateEventFactory.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * <p/> * http://www.apache.org/licenses/LICENSE-2.0 * <p/> * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.myriad.scheduler.event; import com.lmax.disruptor.EventFactory; /** * mesos status update event */ public class StatusUpdateEventFactory implements EventFactory<StatusUpdateEvent> { @Override public StatusUpdateEvent newInstance() { return new StatusUpdateEvent(); } }
apache/incubator-weex
1,138
android/sdk/src/main/java/org/apache/weex/IWXActivityStateListener.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.weex; /** * Listener class for activity lifecycle */ @Deprecated public interface IWXActivityStateListener { void onActivityCreate(); void onActivityStart(); void onActivityPause(); void onActivityResume(); void onActivityStop(); void onActivityDestroy(); boolean onActivityBack(); }
apache/inlong
1,113
inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/service/tube/RebalanceGroupResult.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.inlong.tubemq.manager.service.tube; import com.google.common.collect.Lists; import lombok.Data; import java.util.List; @Data public class RebalanceGroupResult { private List<String> failConsumers = Lists.newArrayList(); private List<String> successConsumers = Lists.newArrayList(); }
apache/inlong
1,120
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/IntListValuable.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.inlong.manager.common.enums; import java.util.List; /** * An interface that generates a list of Int * e.g. for generating enum values */ public interface IntListValuable { /** * generates a list of Int * * @return list of Integer values */ List<Integer> valueList(); }
apache/inlong
1,120
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/sink/DirtyDataResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.inlong.manager.pojo.sink; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * Dirty data info. */ @Data @ApiModel("Dirty data info") public class DirtyDataResponse { @ApiModelProperty(value = "Task id") private String taskId; }
apache/iotdb
1,099
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/memcontrol/IReleaseFlushStrategy.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.iotdb.db.schemaengine.schemaregion.mtree.impl.pbtree.memcontrol; /** This interface defines the threshold strategy for release and flush task */ public interface IReleaseFlushStrategy { /** Check if exceed release threshold */ boolean isExceedReleaseThreshold(); }
apache/jclouds
1,152
providers/packet/src/main/java/org/jclouds/packet/domain/Pricing.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jclouds.packet.domain; import org.jclouds.json.SerializedNames; import com.google.auto.value.AutoValue; @AutoValue public abstract class Pricing { public abstract double hour(); @SerializedNames({ "hour" }) public static Pricing create(double hour) { return new AutoValue_Pricing(hour); } Pricing() {} }
apache/jclouds
1,153
core/src/main/java/org/jclouds/location/suppliers/RegionIdsSupplier.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jclouds.location.suppliers; import java.util.Set; import org.jclouds.location.suppliers.fromconfig.RegionIdsFromConfiguration; import com.google.common.base.Supplier; import com.google.inject.ImplementedBy; /** */ @ImplementedBy(RegionIdsFromConfiguration.class) public interface RegionIdsSupplier extends Supplier<Set<String>> { }
apache/jena
1,153
jena-arq/src/main/java/org/apache/jena/sparql/util/EqualityTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jena.sparql.util; import org.apache.jena.graph.Node; /** * Interface for tests when two nodes are considered "equal". This may be "same * term", "same value" or "same object" or customised such as with a blank node * mapping. */ @FunctionalInterface public interface EqualityTest { boolean equal(Node n1, Node n2); }
apache/jena
1,167
jena-cmds/src/test/java/org/apache/jena/cmds/TS_Cmd.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jena.cmds; import org.junit.platform.suite.api.SelectClasses; import org.junit.platform.suite.api.Suite; import jena.Test_schemagen; import org.apache.jena.atlas.logging.LogCtl ; @Suite @SelectClasses({ TestCmdLine.class , Test_schemagen.class , TestCmdExt.class }) public class TS_Cmd { static { LogCtl.setLogging();} }
apache/kafka
1,144
clients/src/main/java/org/apache/kafka/common/errors/InvalidRegistrationException.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kafka.common.errors; /** * Thrown when a broker registration request is considered invalid by the controller. */ public class InvalidRegistrationException extends ApiException { private static final long serialVersionUID = 1L; public InvalidRegistrationException(String message) { super(message); } }
apache/kafka
1,148
clients/src/main/java/org/apache/kafka/common/errors/DuplicateVoterException.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kafka.common.errors; public class DuplicateVoterException extends ApiException { private static final long serialVersionUID = 1L; public DuplicateVoterException(String message) { super(message); } public DuplicateVoterException(String message, Throwable cause) { super(message, cause); } }
apache/karaf
1,104
examples/karaf-mbean-example/karaf-mbean-example-api/src/main/java/org/apache/karaf/examples/mbean/api/BookingService.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.karaf.examples.mbean.api; import java.util.Collection; /** * Simple interface describing the booking service. */ public interface BookingService { Collection<Booking> list(); Booking get(Long id); void add(Booking booking); void remove(Long id); }
apache/karaf
1,107
examples/karaf-soap-example/karaf-soap-example-api/src/main/java/org/apache/karaf/examples/soap/api/BookingService.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.karaf.examples.soap.api; import java.util.Collection; /** * Simple interface describing the booking service. */ public interface BookingService { Collection<Booking> list(); Booking get(Long id); void add(Booking booking); void remove(Long id); }
apache/kylin
1,126
src/common-service/src/main/java/org/apache/kylin/rest/response/CompositePermissionResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kylin.rest.response; import java.util.Set; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; @Data public class CompositePermissionResponse { @JsonProperty private String permission; @JsonProperty("ext_permissions") private Set<String> extPermissions; }
apache/kylin
1,130
src/core-common/src/main/java/org/apache/kylin/common/exception/ResourceLimitExceededException.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kylin.common.exception; public class ResourceLimitExceededException extends RuntimeException { public ResourceLimitExceededException(String message) { super(message); } public ResourceLimitExceededException(String message, Throwable cause) { super(message, cause); } }
apache/kylin
1,139
src/core-common/src/main/java/org/apache/kylin/common/scheduler/JobDiscardNotifier.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kylin.common.scheduler; import lombok.Getter; import lombok.Setter; @Setter @Getter public class JobDiscardNotifier extends SchedulerEventNotifier { private String jobType; public JobDiscardNotifier(String project, String jobType) { setProject(project); this.jobType = jobType; } }
apache/kylin
1,147
src/streaming/src/main/scala/org/apache/kylin/source/kafka/KafkaExplorer.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kylin.source.kafka; import java.util.Set; import org.apache.kylin.engine.spark.source.NSparkMetadataExplorer; import lombok.extern.slf4j.Slf4j; @Slf4j public class KafkaExplorer extends NSparkMetadataExplorer { @Override public boolean checkTablesAccess(Set<String> tableSet) { return true; } }
apache/logging-log4j2
1,140
log4j-api-java9/src/main/java/org/apache/logging/log4j/util/ProcessIdUtil.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to you under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.logging.log4j.util; public class ProcessIdUtil { public static final String DEFAULT_PROCESSID = "-"; public static String getProcessId() { try { return Long.toString(ProcessHandle.current().pid()); } catch (Exception ex) { return DEFAULT_PROCESSID; } } }
apache/logging-log4j2
1,142
log4j-core/src/main/java/org/apache/logging/log4j/core/net/MailManagerFactory.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to you under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.logging.log4j.core.net; import org.apache.logging.log4j.core.appender.ManagerFactory; import org.apache.logging.log4j.core.net.MailManager.FactoryData; public interface MailManagerFactory extends ManagerFactory<MailManager, FactoryData> { @Override MailManager createManager(String name, FactoryData data); }
apache/mnemonic
1,156
mnemonic-core/src/main/java/org/apache/mnemonic/CloseableIterator.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.mnemonic; import java.io.Closeable; import java.util.Iterator; /** * An iterator that is also a Closeable resource. * * @param <E> the type of elements returned by this iterator */ public interface CloseableIterator<E> extends Iterator<E>, Closeable { // No additional methods needed, inherits from Iterator and Closeable }
apache/nifi
1,105
nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/provenance/ClusteredReplayProvenanceIT.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.nifi.tests.system.provenance; import org.apache.nifi.tests.system.NiFiInstanceFactory; public class ClusteredReplayProvenanceIT extends ReplayProvenanceIT { @Override public NiFiInstanceFactory getInstanceFactory() { return createTwoNodeInstanceFactory(); } }
apache/nifi
1,124
nifi-commons/nifi-security-kerberos/src/main/java/org/apache/nifi/security/krb/ConfigurationUtil.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.nifi.security.krb; public interface ConfigurationUtil { boolean IS_IBM = System.getProperty("java.vendor", "").contains("IBM"); String IBM_KRB5_LOGIN_MODULE = "com.ibm.security.auth.module.Krb5LoginModule"; String SUN_KRB5_LOGIN_MODULE = "com.sun.security.auth.module.Krb5LoginModule"; }
apache/nifi
1,134
nifi-commons/nifi-utils/src/main/java/org/apache/nifi/util/file/monitor/LastModifiedMonitor.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.nifi.util.file.monitor; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; public class LastModifiedMonitor implements UpdateMonitor { @Override public Object getCurrentState(final Path path) throws IOException { return Files.getLastModifiedTime(path); } }
apache/oozie
1,156
examples/src/main/java/org/apache/oozie/example/DemoJavaMain.java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.oozie.example; public class DemoJavaMain { public static void main(String[] args) { System.out.println("Demo Java Main"); System.out.println("# Arguments: " + args.length); for (int i = 0; i < args.length; i++) { System.out.println("Argument[" + i + "]: " + args[i]); } } }
apache/openjpa
1,128
openjpa-persistence/src/main/java/org/apache/openjpa/persistence/query/ValueExpression.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.openjpa.persistence.query; /** * Denotes VALUE(e) Expression. * * @author Pinaki Poddar * */ public class ValueExpression extends OperatorPath { private static final long serialVersionUID = 1L; public ValueExpression(AbstractDomainObject expr) { super(expr, PathOperator.VALUE); } }
apache/openmeetings
1,121
openmeetings-install/src/main/java/org/apache/openmeetings/cli/ExitException.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License") + you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.openmeetings.cli; public class ExitException extends RuntimeException { private static final long serialVersionUID = 1L; private final int code; public ExitException() { this(1); } public ExitException(int code) { this.code = code; } public int getCode() { return code; } }
apache/openwebbeans
1,104
webbeans-impl/src/test/java/org/apache/webbeans/test/component/decorator/broken/DelegateAttributeIsnotInterface.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.webbeans.test.component.decorator.broken; import jakarta.decorator.Delegate; import jakarta.decorator.Decorator; import org.apache.webbeans.test.component.BindingComponent; @Decorator public class DelegateAttributeIsnotInterface { @Delegate BindingComponent decorates; }
apache/openwebbeans
1,127
webbeans-web/src/it/webcdiapp/src/main/java/org/superbiz/beans/NonAnnotatedDependentBean.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.superbiz.beans; /** * This bean is _not_ annotated with a bean scope * but we are in a BDA with implicit bean-discovery mode ALL. * That means this class should get picked up as dependent scoped bean */ public class NonAnnotatedDependentBean { public int meaningOfLife() { return 42; } }
apache/ozhera
1,109
ozhera-operator/ozhera-operator-service/src/main/java/org/apache/ozhera/operator/bo/dashboard/GrafanaApiKeyReq.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.ozhera.operator.bo.dashboard; import lombok.Data; /** * @date 2023-02-22 */ @Data public class GrafanaApiKeyReq { private String name; private String role; public GrafanaApiKeyReq(String name,String role){ this.name = name; this.role = role; } }
apache/ozhera
1,118
ozhera-webhook/ozhera-webhook-server/src/main/java/org/apache/ozhera/webhook/domain/k8s/VolumeMount.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.ozhera.webhook.domain.k8s; import lombok.Data; import lombok.ToString; /** * @author zhangxiaowei6 * @Date 2024/3/6 10:41 */ @Data @ToString public class VolumeMount { private String name; private String mountPath; private String subPathExpr; private String subPath; }
apache/ozone
1,125
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/ozone/admin/om/lease/LeaseSubCommand.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.ozone.admin.om.lease; import picocli.CommandLine; /** * Handler of ozone admin om lease command. */ @CommandLine.Command( name = "lease", description = "Command for all lease related queries.", subcommands = { LeaseRecoverer.class } ) public class LeaseSubCommand { }
apache/paimon-webui
1,113
paimon-web-api/src/test/java/org/apache/paimon/web/api/action/context/FlinkCdcActionContextTestBase.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.paimon.web.api.action.context; /** FlinkCdcActionContextTestBase. */ public class FlinkCdcActionContextTestBase { protected static final String WAREHOUSE = "warehouse"; protected static final String DATABASE = "database"; protected static final String TABLE = "table"; }
apache/paimon-webui
1,120
paimon-web-api/src/main/java/org/apache/paimon/web/api/action/context/factory/ActionContextFactory.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.paimon.web.api.action.context.factory; import org.apache.paimon.web.api.action.context.ActionContext; import com.fasterxml.jackson.databind.node.ObjectNode; /** ActionContextFactory. */ public interface ActionContextFactory { ActionContext getActionContext(ObjectNode actionConfigs); }
apache/parquet-java
1,148
parquet-column/src/main/java/org/apache/parquet/filter/RecordFilter.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.parquet.filter; /** * Filter to be applied to a record to work out whether to skip it. */ public interface RecordFilter { /** * Works out whether the current record can pass through the filter. * * @return true if the current value for the column reader matches the predicate. */ boolean isMatch(); }
apache/pekko-http
1,128
http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/AccessControlAllowMethods.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * license agreements; and to You under the Apache License, version 2.0: * * https://www.apache.org/licenses/LICENSE-2.0 * * This file is part of the Apache Pekko project, which was derived from Akka. */ /* * Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com> */ package org.apache.pekko.http.javadsl.model.headers; import org.apache.pekko.http.javadsl.model.HttpMethod; /** * Model for the `Access-Control-Allow-Methods` header. Specification: * http://www.w3.org/TR/cors/#access-control-allow-methods-response-header */ public abstract class AccessControlAllowMethods extends org.apache.pekko.http.scaladsl.model.HttpHeader { public abstract Iterable<HttpMethod> getMethods(); public static AccessControlAllowMethods create(HttpMethod... methods) { return new org.apache.pekko.http.scaladsl.model.headers .Access$minusControl$minusAllow$minusMethods( org.apache.pekko.http.impl.util.Util .<HttpMethod, org.apache.pekko.http.scaladsl.model.HttpMethod>convertArray(methods)); } }
apache/phoenix
1,156
phoenix-core/src/test/java/org/apache/phoenix/schema/PLongColumn.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.phoenix.schema; import org.apache.phoenix.schema.types.PDataType; import org.apache.phoenix.schema.types.PLong; /** * Base class for PColumn implementors of type Long. * @since 0.1 */ public abstract class PLongColumn extends PBaseColumn { @Override public final PDataType getDataType() { return PLong.INSTANCE; } }
apache/polygene-java
1,115
libraries/sql-generator/src/test/java/org/apache/polygene/library/sql/generator/MySQLModificationTest.java
/* * Copyright (c) 2012, Stanislav Muhametsin. 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 org.apache.polygene.library.sql.generator; import org.apache.polygene.library.sql.generator.vendor.MySQLVendor; import org.apache.polygene.library.sql.generator.vendor.SQLVendor; import org.apache.polygene.library.sql.generator.vendor.SQLVendorProvider; public class MySQLModificationTest extends AbstractModificationTest { @Override protected SQLVendor loadVendor() throws Exception { return SQLVendorProvider.createVendor( MySQLVendor.class ); } }
apache/polygene-java
1,122
libraries/locking/src/main/java/org/apache/polygene/library/locking/LockingAbstractComposite.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package org.apache.polygene.library.locking; import org.apache.polygene.api.concern.Concerns; import org.apache.polygene.api.mixin.Mixins; /** * JAVADOC */ @Concerns( { ReadLockConcern.class, WriteLockConcern.class } ) @Mixins( LockMixin.class ) public interface LockingAbstractComposite { }
apache/polygene-java
1,136
core/spi/src/main/java/org/apache/polygene/spi/entitystore/StateChangeListener.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package org.apache.polygene.spi.entitystore; import org.apache.polygene.spi.entity.EntityState; /** * Implement this interface in a Service if you want it to listen * to changes from EntityStores. */ public interface StateChangeListener { void notifyChanges( Iterable<EntityState> changedStates ); }
apache/pulsar
1,121
pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/TransactionInBufferStats.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.pulsar.common.policies.data; import lombok.Data; @Data public class TransactionInBufferStats { /** The start position of this transaction in transaction buffer. */ public String startPosition; /** The flag of this transaction have been aborted. */ public boolean aborted; }
apache/pulsar
1,129
pulsar-common/src/main/java/org/apache/pulsar/common/protocol/schema/DeleteSchemaResponse.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.pulsar.common.protocol.schema; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; /** * Response for schema deletion. */ @Data @Builder @AllArgsConstructor @NoArgsConstructor public class DeleteSchemaResponse { private long version; }
apache/qpid-broker-j
1,126
broker-core/src/main/java/org/apache/qpid/server/security/auth/SocketConnectionPrincipal.java
/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.qpid.server.security.auth; import java.io.Serializable; import java.net.SocketAddress; import java.security.Principal; public interface SocketConnectionPrincipal extends Principal, Serializable { SocketAddress getRemoteAddress(); SocketConnectionMetaData getConnectionMetaData(); }
apache/qpid-broker-j
1,136
systests/systests-utils/src/main/java/org/apache/qpid/tests/utils/ConfigItems.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ package org.apache.qpid.tests.utils; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface ConfigItems { ConfigItem[] value(); }
apache/seatunnel
1,077
seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/serialize/sink/SeaTunnelRowSerializer.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seatunnel.connectors.seatunnel.typesense.serialize.sink; import org.apache.seatunnel.api.table.type.SeaTunnelRow; public interface SeaTunnelRowSerializer { String serializeRow(SeaTunnelRow row); String serializeRowForDelete(SeaTunnelRow row); }
apache/seatunnel
1,105
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/exception/ConfigCheckException.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seatunnel.core.starter.exception; public class ConfigCheckException extends CommandException { public ConfigCheckException(String message) { super(message); } public ConfigCheckException(String message, Throwable cause) { super(message, cause); } }
apache/seatunnel
1,105
seatunnel-core/seatunnel-core-starter/src/main/java/org/apache/seatunnel/core/starter/exception/TaskExecuteException.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seatunnel.core.starter.exception; public class TaskExecuteException extends RuntimeException { public TaskExecuteException(String message) { super(message); } public TaskExecuteException(String message, Throwable cause) { super(message, cause); } }
apache/seatunnel
1,134
seatunnel-api/src/main/java/org/apache/seatunnel/api/table/schema/event/AlterTableEvent.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.seatunnel.api.table.schema.event; import org.apache.seatunnel.api.table.catalog.TableIdentifier; import lombok.ToString; @ToString(callSuper = true) public abstract class AlterTableEvent extends TableEvent { public AlterTableEvent(TableIdentifier tableIdentifier) { super(tableIdentifier); } }
apache/servicecomb-java-chassis
1,104
demo/demo-pojo/pojo-server/src/main/java/org/apache/servicecomb/demo/pojo/server/same/pk1/SameInterface.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.servicecomb.demo.pojo.server.same.pk1; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.servers.Server; @OpenAPIDefinition(servers = {@Server(url = "/SameInterface1")}) public interface SameInterface { String sayHello(String name); }
apache/servicecomb-java-chassis
1,104
demo/demo-pojo/pojo-server/src/main/java/org/apache/servicecomb/demo/pojo/server/same/pk2/SameInterface.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.servicecomb.demo.pojo.server.same.pk2; import io.swagger.v3.oas.annotations.OpenAPIDefinition; import io.swagger.v3.oas.annotations.servers.Server; @OpenAPIDefinition(servers = {@Server(url = "/SameInterface2")}) public interface SameInterface { String sayHello(String name); }
apache/servicecomb-samples
1,050
java-chassis-samples/local-service-registry/local-registry-server/src/main/java/org/apache/servicecomb/samples/localregistry/localregistryserver/LocalRegistryServer.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.servicecomb.samples.localregistry.localregistryserver; import org.apache.servicecomb.foundation.common.utils.BeanUtils; public class LocalRegistryServer { public static void main(String[] args) { BeanUtils.init(); } }
apache/shardingsphere-elasticjob
1,118
restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.elasticjob.restful.pojo; import lombok.Getter; import lombok.Setter; /** * A simple POJO for test. */ @Getter @Setter public final class JobPojo { private String group; private String name; private String cron; private String description; }
apache/shardingsphere
1,082
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/ingest/position/type/finished/IngestFinishedPosition.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.data.pipeline.core.ingest.position.type.finished; import org.apache.shardingsphere.data.pipeline.core.ingest.position.IngestPosition; /** * Ingest finished position. */ public final class IngestFinishedPosition implements IngestPosition { }
apache/shardingsphere
1,119
kernel/sql-parser/core/src/main/java/org/apache/shardingsphere/parser/constant/SQLParserOrder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.parser.constant; import lombok.AccessLevel; import lombok.NoArgsConstructor; /** * SQL parser order. */ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class SQLParserOrder { /** * SQL parser order. */ public static final int ORDER = 700; }
apache/shenyu
1,138
shenyu-common/src/main/java/org/apache/shenyu/common/concurrent/DiscardOldestPolicy.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shenyu.common.concurrent; import java.util.Queue; /** * A handler for rejected element that discards the oldest element. */ public class DiscardOldestPolicy<E> implements Rejector<E> { @Override public void reject(final E e, final Queue<E> queue) { queue.poll(); queue.offer(e); } }
apache/shenyu
1,140
shenyu-admin/src/test/java/org/apache/shenyu/admin/model/query/ShenyuDictQueryTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shenyu.admin.model.query; import org.apache.shenyu.admin.AbstractReflectGetterSetterTest; /** * Test case for ShenyuDictQuery. */ public final class ShenyuDictQueryTest extends AbstractReflectGetterSetterTest { @Override protected Class<?> getTargetClass() { return ShenyuDictQuery.class; } }
apache/sis
1,113
endorsed/src/org.apache.sis.referencing.gazetteer/main/org/apache/sis/referencing/gazetteer/internal/Resources_en.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.sis.referencing.gazetteer.internal; /** * Resource in English language. */ public class Resources_en extends Resources { /** * Constructs a new resource bundle loading data from * the resource file of the same name as this class. */ public Resources_en() { } }
apache/skywalking-java
1,059
apm-sniffer/apm-sdk-plugin/shardingsphere-plugins/sharding-sphere-4.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v40/Constant.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.skywalking.apm.plugin.shardingsphere.v40; /** * The type Constant. */ public final class Constant { /** * The constant CONTEXT_SNAPSHOT. */ public static final String CONTEXT_SNAPSHOT = "CONTEXT_SNAPSHOT"; }
apache/skywalking-java
1,059
apm-sniffer/apm-sdk-plugin/shardingsphere-plugins/sharding-sphere-4.1.0-plugin/src/main/java/org/apache/skywalking/apm/plugin/shardingsphere/v41/Constant.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.skywalking.apm.plugin.shardingsphere.v41; /** * The type Constant. */ public final class Constant { /** * The constant CONTEXT_SNAPSHOT. */ public static final String CONTEXT_SNAPSHOT = "CONTEXT_SNAPSHOT"; }
apache/skywalking-java
1,114
apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/logging/core/Converter.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.apache.skywalking.apm.agent.core.logging.core; /** * The Converter, it is used to convert the LogEvent to the String. * For JsonLogger, the `getKey()` method is used to generate the key for json. */ public interface Converter { String convert(LogEvent logEvent); String getKey(); }
apache/solr
1,156
solr/core/src/java/org/apache/solr/cluster/placement/ReplicaMetrics.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.solr.cluster.placement; import java.util.Iterator; import java.util.Map; import java.util.Optional; /** Strongly-typed replica-level metrics. */ public interface ReplicaMetrics { String getReplicaName(); <T> Optional<T> getReplicaMetric(ReplicaMetric<T> metric); Iterator<Map.Entry<ReplicaMetric<?>, Object>> iterator(); }
apache/stanbol
1,135
enhancer/generic/rdfentities/src/main/java/org/apache/stanbol/enhancer/rdfentities/Rdf.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.stanbol.enhancer.rdfentities; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Retention; /** * Annotation used to define the RDF concept/property represented * by an Java class/method * @author Rupert Westenthaler * */ @Retention(RUNTIME) public @interface Rdf { String id(); }
apache/struts-examples
1,112
shiro-basic/src/main/java/org/apache/struts2/shiro/example/interceptor/ShiroUserInterceptor.java
/** * */ package org.apache.struts2.shiro.example.interceptor; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; import org.apache.struts2.ActionInvocation; import org.apache.struts2.interceptor.Interceptor; /** * Inserts the current Shiro user into the value stack so that it can be * injected into Struts 2 actions should they have a JavaBeans setter * <code>setShiroUser(org.apache.shiro.subject.Subject shiroUser)</code>. */ public class ShiroUserInterceptor implements Interceptor { @Override public void destroy() { //release resources here } @Override public void init() { // create resources here } @Override public String intercept(ActionInvocation actionInvocation) throws Exception { if (actionInvocation.getAction() instanceof org.apache.struts2.shiro.example.action.ShiroBaseAction) { Subject shiroUser = SecurityUtils.getSubject(); actionInvocation.getStack().setValue("shiroUser", shiroUser); } return actionInvocation.invoke(); } }
apache/struts
1,142
plugins/json/src/main/java/org/apache/struts2/json/annotations/SMDMethodParameter.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 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.json.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface SMDMethodParameter { String name(); }
apache/syncope
1,099
common/keymaster/client-zookeeper/src/test/java/org/apache/syncope/common/keymaster/client/zookeeper/ZookeeperServiceOpsTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.syncope.common.keymaster.client.zookeeper; import org.junit.jupiter.api.BeforeAll; public class ZookeeperServiceOpsTest extends ZookeeperServiceOpsITCase { @BeforeAll public static void setUp() throws Exception { ZookeeperTestingServer.start(); } }
apache/syncope
1,133
core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/FIQLQueryDAO.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.syncope.core.persistence.api.dao; import java.util.List; import org.apache.syncope.core.persistence.api.entity.FIQLQuery; import org.apache.syncope.core.persistence.api.entity.user.User; public interface FIQLQueryDAO extends DAO<FIQLQuery> { List<FIQLQuery> findByOwner(User user, String target); }
apache/tapestry-5
1,114
tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ZoneUpdateNamespace.java
// Copyright 2009 Formos // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package org.apache.tapestry5.integration.app1.pages; import org.apache.tapestry5.annotations.InjectComponent; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.corelib.components.Zone; import java.util.Date; public class ZoneUpdateNamespace { @InjectComponent private Zone zone; @Property private String message; Object onSuccess() { message = "Zone updated"; return zone.getBody(); } public Date getNow() { return new Date(); } }
apache/teaclave-java-tee-sdk
1,126
sdk/enclave/src/test/java/org/apache/teaclave/javasdk/enclave/testservice/Point.java
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. package org.apache.teaclave.javasdk.enclave.testservice; import java.io.Serializable; public class Point implements Serializable { private static final long serialVersionUID = -3715916707782706029L; public int x; public int y; public Point(int x, int y){ this.x = x; this.y = y; } }
apache/tiles
1,151
tiles-core/src/main/java/org/apache/tiles/preparer/factory/package-info.java
/* * $Id$ * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * "View preparers" are objects that allows the "preparation" of a Tiles artifact * (definition, template or attribute) before it is rendered.<br> * It is useful, for example, when a view item should be built and stored in a * particular context (e.g. a menu) and then rendered. */ package org.apache.tiles.preparer.factory;
apache/tomcat
1,163
java/org/apache/catalina/ha/deploy/FileChangeListener.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.catalina.ha.deploy; import java.io.File; public interface FileChangeListener { /** * Modification from watchDir war detected. * * @param f the modified file */ void fileModified(File f); /** * War remove from watchDir. * * @param f the file removed */ void fileRemoved(File f); }
apache/tomcat
1,174
test/org/apache/jasper/compiler/TesterTagPlugin.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jasper.compiler; import org.apache.jasper.compiler.tagplugin.TagPlugin; import org.apache.jasper.compiler.tagplugin.TagPluginContext; /** * Plug-in for {@link TesterTag}. */ public class TesterTagPlugin implements TagPlugin { @Override public void doTag(TagPluginContext ctxt) { ctxt.generateJavaSource("//Just a comment"); } }
apache/tomee
1,124
container/openejb-core/src/test/java/org/apache/openejb/core/mdb/connector/api/SampleConnectionFactory.java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 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.core.mdb.connector.api; import jakarta.resource.Referenceable; import jakarta.resource.ResourceException; import java.io.Serializable; public interface SampleConnectionFactory extends Serializable, Referenceable { public SampleConnection getConnection() throws ResourceException; }
apache/tomee
1,141
container/openejb-junit/src/main/java/org/apache/openejb/junit/jee/config/Properties.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS 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.junit.jee.config; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Properties { Property[] value() default {}; }
apache/tomee
1,159
container/openejb-jee/src/main/java/org/apache/openejb/jee/jpa/package-info.java
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ @jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter(value = jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter.class, type = String.class) @jakarta.xml.bind.annotation.XmlSchema(namespace = "http://java.sun.com/xml/ns/persistence/orm", elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.openejb.jee.jpa;
apache/trafficcontrol
1,106
traffic_router/connector/src/main/java/org/apache/traffic_control/traffic_router/secure/PrivateKeyDecoder.java
/* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.traffic_control.traffic_router.secure; import java.io.IOException; import java.security.GeneralSecurityException; import java.security.PrivateKey; import java.util.Base64; public class PrivateKeyDecoder { public PrivateKey decode(final String data) throws IOException, GeneralSecurityException { final String decodedData = new String(Base64.getMimeDecoder().decode(data.getBytes())); return decodedData.contains(Pkcs1.HEADER) ? new Pkcs1(decodedData).getPrivateKey() : new Pkcs8(decodedData).getPrivateKey(); } }
apache/tvm
1,169
jvm/core/src/main/java/org/apache/tvm/APIInternal.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tvm; /** * Internal api functions. */ public final class APIInternal { /** * Get a tvm api function according by name. * @param name function name. * @return a TVM Function. */ public static Function get(final String name) { return API.get(name); } /** * Cannot be instantiated. */ private APIInternal() { } }
apache/uniffle
1,146
common/src/main/java/org/apache/uniffle/common/netty/handle/BaseMessageHandler.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.uniffle.common.netty.handle; import org.apache.uniffle.common.netty.client.TransportClient; import org.apache.uniffle.common.netty.protocol.RequestMessage; public interface BaseMessageHandler { void receive(TransportClient client, RequestMessage msg); void exceptionCaught(Throwable cause, TransportClient client); }
apache/usergrid
1,110
stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/LegacyQueueManagerInternalFactory.java
/* * * * Licensed to the Apache Software Foundation (ASF) under one or more * * contributor license agreements. The ASF licenses this file to You * * under the Apache License, Version 2.0 (the "License"); you may not * * use this file except in compliance with the License. * * You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. For additional information regarding * * copyright in this work, please see the NOTICE file in the top level * * directory of this distribution. * */ package org.apache.usergrid.persistence.queue; /** * QueueManagerInternal guice factory */ public interface LegacyQueueManagerInternalFactory { LegacyQueueManager getQueueManager(final LegacyQueueScope scope ); }
apache/wicket
1,133
wicket-guice/src/test/java/org/apache/wicket/guice/GuiceInjectInjectorTest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS 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.guice; /** */ public class GuiceInjectInjectorTest extends AbstractInjectorTest { @Override protected TestComponentInterface newTestComponent(String id) { return new TestComponent(id); } @Override protected TestNoComponentInterface newTestNoComponent() { return new TestNoComponent(); } }
apache/wicket
1,136
wicket-core-tests/src/test/java/org/apache/wicket/stateless/pages/Page1.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS 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.stateless.pages; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.StatelessForm; /** */ public class Page1 extends WebPage { private static final long serialVersionUID = 1L; /** * Construct. */ public Page1() { add(new StatelessForm<Void>("form")); } }
google/asylo
1,146
asylo/binding/java/src/main/java/com/asylo/client/EnclaveException.java
/* * * Copyright 2019 Asylo 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.asylo.client; /** * Exception to represent any error during initialization and execution of enclave */ public class EnclaveException extends RuntimeException { private static final long serialVersionUID = -747104125131272523L; public EnclaveException() { super(); } public EnclaveException(String message) { super(message); } public EnclaveException(String message, Throwable throwable) { super(message, throwable); } public EnclaveException(Throwable throwable) { super(throwable); } }
google/binnavi
1,144
src/main/java/com/google/security/zynamics/zylib/gui/zygraph/EdgeHidingMode.java
// Copyright 2011-2016 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.security.zynamics.zylib.gui.zygraph; public enum EdgeHidingMode { HIDE_NEVER, HIDE_ALWAYS, HIDE_ON_THRESHOLD; public static EdgeHidingMode parseInt(final int edgeHidingMode) { if (edgeHidingMode == HIDE_NEVER.ordinal()) { return HIDE_NEVER; } else if (edgeHidingMode == HIDE_ALWAYS.ordinal()) { return HIDE_ALWAYS; } else if (edgeHidingMode == HIDE_ON_THRESHOLD.ordinal()) { return HIDE_ON_THRESHOLD; } else { throw new IllegalStateException("Error: Invalid edge hiding mode"); } } }
google/cel-java
1,158
common/src/main/java/dev/cel/common/internal/EnvVisitor.java
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package dev.cel.common.internal; import dev.cel.expr.Decl; import dev.cel.common.annotations.Internal; import dev.cel.parser.CelMacro; import java.util.List; /** * Simple API for visiting the declarations of a CEL environment * * <p>CEL Library Internals. Do Not Use. */ @Internal public interface EnvVisitor { /** * Visit the declaration {@code name} and associated types, identifiers, and functions associated * with that name. */ void visitDecl(String name, List<Decl> decls); /** Visit the CEL macro. */ void visitMacro(CelMacro macro); }
google/closure-templates
1,149
java/src/com/google/template/soy/jssrc/dsl/SpecialToken.java
/* * Copyright 2023 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.template.soy.jssrc.dsl; import java.util.stream.Stream; /** A special token, typically whitespace or a comment, that isn't preserved in the AST. */ public abstract class SpecialToken extends CodeChunk { @Override Stream<? extends CodeChunk> childrenStream() { return Stream.empty(); } @Override public final Statement asStatement() { return Statements.EMPTY.prepend(this); } @Override final void doFormatInitialStatements(FormattingContext ctx) {} abstract void doFormatToken(FormattingContext ctx); }
google/fhir-data-pipes
1,129
pipelines/batch/src/main/java/com/google/fhir/analytics/metrics/PipelineMetrics.java
/* * Copyright 2020-2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.fhir.analytics.metrics; public interface PipelineMetrics { /** * Fetch the CumulativeMetrics object for the currently running batch of pipelines. * * @return CumulativeMetrics total metrics of the currently running pipeline */ CumulativeMetrics getCumulativeMetricsForOngoingBatch(); /** Clears all the metrics */ void clearAllMetrics(); /** * Sets the total number of resources * * @param totalNumOfResources */ void setTotalNumOfResources(long totalNumOfResources); }
google/fhir-data-pipes
1,133
bunsen/bunsen-core/src/main/java/com/cerner/bunsen/definitions/StringConverter.java
package com.cerner.bunsen.definitions; import org.hl7.fhir.instance.model.api.IPrimitiveType; public class StringConverter<T> extends PrimitiveConverter<T> { private final T dataType; public StringConverter(T dataType) { super("String"); this.dataType = dataType; } @Override public void toHapi(Object input, IPrimitiveType primitive) { // Note we cannot simply cast `input` to `String` because the type used // is not necessarily String when reading the Avro record with a `string` // field; it can be Utf8, and it is controlled by `avro.java.string` field // type property in the schema, see: // https://github.com/apache/parquet-mr/commit/918609f2cc4e4de95445ce4fdd7dc952b9625017 // https://github.com/apache/parquet-mr/blob/8264d8b2329f6e7a9ad900e2f9d32abee80f29ff/parquet-avro/src/main/java/org/apache/parquet/avro/AvroRecordConverter.java#L410 primitive.setValueAsString(input.toString()); } @Override protected Object fromHapi(IPrimitiveType primitive) { return primitive.getValueAsString(); } @Override public T getDataType() { return dataType; } }
google/guava
1,162
guava-tests/test/com/google/common/io/TestStreamSupplier.java
/* * Copyright (C) 2012 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.common.io; import org.jspecify.annotations.NullUnmarked; /** * Interface for a supplier of streams that can report whether a stream was opened and whether that * stream was closed. Intended for use in a test where only a single stream should be opened and * possibly closed. * * @author Colin Decker */ @NullUnmarked public interface TestStreamSupplier { /** Returns whether or not a new stream was opened. */ boolean wasStreamOpened(); /** Returns whether or not an open stream was closed. */ boolean wasStreamClosed(); }
google/j2cl
1,134
transpiler/javatests/com/google/j2cl/readable/java/j2kt/NullabilityInferenceProblem2.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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package j2kt; import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.Nullable; @NullMarked public class NullabilityInferenceProblem2 { interface Supplier<T extends @Nullable Object> { T get(); } public abstract class Test<T extends @Nullable Object> { public <E extends T> E foo(Supplier<E> supplier) { E local = supplier.get(); // local is E? in Kotlin. return foo(local, supplier.get()); } public <E extends T> E foo(E a, E b) { throw new RuntimeException(); } } }
google/j2cl
1,148
transpiler/javatests/com/google/j2cl/integration/java/cyclicclinits/Child.java
/* * Copyright 2017 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package cyclicclinits; import static com.google.j2cl.integration.testing.Asserts.assertTrue; class Parent { static { // Parent.$clinit() executes before Child.$clinit(), so fieldInChild has not been initialized. assertTrue(Child.fieldInChild == null); } } public class Child extends Parent { public static Object fieldInChild = 1; // Intention boxing to avoid binaryen optimization public static void test() { // Child.$clinit() has been called, so fieldInChild has been initialized. assertTrue(fieldInChild != null); } }
google/j2objc
1,133
jre_emul/android/platform/libcore/luni/src/main/java/libcore/io/StructGroupReq.java
/* * Copyright (C) 2011 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 libcore.io; import java.net.InetAddress; /** * Corresponds to C's {@code struct group_req}. */ public final class StructGroupReq { public final int gr_interface; public final InetAddress gr_group; public StructGroupReq(int gr_interface, InetAddress gr_group) { this.gr_interface = gr_interface; this.gr_group = gr_group; } @Override public String toString() { return "StructGroupReq[gr_interface=" + gr_interface + ",gr_group=" + gr_group + "]"; } }
google/MOE
1,152
client/src/main/java/com/google/devtools/moe/client/tools/EagerLazy.java
/* * Copyright (c) 2011 Google, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.devtools.moe.client.tools; import dagger.Lazy; /** An implementation of {@link dagger.Lazy} used for testing (and in one legacy position) */ // TODO(cgruber) move to testing this when all directives inject Lazy<ProjectContext> public final class EagerLazy<T> implements Lazy<T> { private final T instance; private EagerLazy(T instance) { this.instance = instance; } @Override public T get() { return instance; } public static <T> Lazy<T> fromInstance(T instance) { return new EagerLazy<T>(instance); } }
google/oss-fuzz
1,178
projects/angus-mail/ASCIIUtilityFuzzer.java
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////////// import com.code_intelligence.jazzer.api.FuzzedDataProvider; import java.lang.NumberFormatException; import org.eclipse.angus.mail.util.ASCIIUtility; public class ASCIIUtilityFuzzer { public static void fuzzerTestOneInput(FuzzedDataProvider data) { byte[] input = data.consumeRemainingAsBytes(); try{ ASCIIUtility.parseInt(input, 0, input.length); ASCIIUtility.parseLong(input, 0, input.length); } catch(NumberFormatException e){} ASCIIUtility.toString(input); } }
google/safe-html-types
1,131
examples/banned_use_of_from_constant/src/main/java/com/example/Example.java
package com.example; import com.google.common.html.types.SafeHtml; import com.google.common.html.types.SafeHtmlBuilder; import com.google.common.html.types.SafeUrl; import com.google.common.html.types.SafeUrls; /** * This is an example of how the Safe HTML types, in conjunction with * the ErrorProne source code checker can be used to guide developers * away from practices that lead to security bugs. */ public final class Example { public static SafeHtml makeLink(String href) { SafeUrl safeHref; safeHref = SafeUrls.fromConstant(href); // href is not a constant!!! // If href is "javascript:doEvil()" we could be in trouble. // Instead, sanitize the URL. // safeHref = SafeUrls.sanitize(href); // Use the builder to make the link. return new SafeHtmlBuilder("a") .setHref(safeHref) .build(); } public static void main(String... argv) { String href; if (argv.length == 0) { href = "http://example.com/"; } else { href = argv[0]; } SafeHtml safeHtml = makeLink(href); System.out.println("Safe Link:" + safeHtml.getSafeHtmlString()); } }
google/shipshape
1,132
third_party/kythe/java/com/google/devtools/kythe/platform/shared/AnalysisException.java
/* * Copyright 2014 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.devtools.kythe.platform.shared; /** * Exception to signal catastrophic failure in sharded analysis. */ public class AnalysisException extends Exception { private static final long serialVersionUID = -2938235520850434072L; public AnalysisException(String message) { super(message); } public AnalysisException(String message, Throwable innerException) { super(message, innerException); } public AnalysisException(Throwable innerException) { super(innerException); } }
google/truth
1,166
core/src/main/java/com/google/common/truth/J2ktIncompatible.java
/* * Copyright (C) 2022 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package com.google.common.truth; import static java.lang.annotation.ElementType.CONSTRUCTOR; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.TYPE; import java.lang.annotation.Target; /** * The presence of this annotation on an API indicates that the method may <em>not</em> be used with * J2KT. This can be removed once we can safely depend on a Guava release that contains it. */ @Target({TYPE, METHOD, CONSTRUCTOR, FIELD}) @interface J2ktIncompatible {}
googleapis/google-cloud-java
1,051
java-financialservices/proto-google-cloud-financialservices-v1/src/main/java/com/google/cloud/financialservices/v1/ExportPredictionResultMetadataResponseOrBuilder.java
/* * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/financialservices/v1/prediction_result.proto // Protobuf Java Version: 3.25.8 package com.google.cloud.financialservices.v1; public interface ExportPredictionResultMetadataResponseOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.financialservices.v1.ExportPredictionResultMetadataResponse) com.google.protobuf.MessageOrBuilder {}
googleapis/google-cloud-java
1,087
java-resourcemanager/google-cloud-resourcemanager/src/main/java/com/google/cloud/resourcemanager/testing/package-info.java
/* * Copyright 2015 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. */ /** * A testing helper for Google Cloud Resource Manager. * * <p>A simple usage example: Before the test: * * <pre>{@code * LocalResourceManagerHelper resourceManagerHelper = LocalResourceManagerHelper.create(); * resourceManagerHelper.start(); * ResourceManager resourceManager = resourceManagerHelper.getOptions().getService(); * }</pre> * * <p>After the test: * * <pre>{@code * resourceManagerHelper.stop(); * }</pre> */ package com.google.cloud.resourcemanager.testing;
googlearchive/science-journal
1,062
OpenScienceJournal/whistlepunk_library/src/main/java/com/google/android/apps/forscience/whistlepunk/metadata/MkrSciBleDeviceSpec.java
package com.google.android.apps.forscience.whistlepunk.metadata; import com.google.android.apps.forscience.whistlepunk.SensorAppearance; import com.google.android.apps.forscience.whistlepunk.devicemanager.SensorTypeProvider; /** Represents a specification of a MkrSciBle device. */ public class MkrSciBleDeviceSpec extends ExternalSensorSpec { public static final String TYPE = "bluetooth_le"; private String address; private String name; public MkrSciBleDeviceSpec(String address, String name) { this.address = address; this.name = name; } @Override public String getType() { return TYPE; } @Override public String getAddress() { return address; } @Override public String getName() { return name; } @Override public SensorAppearance getSensorAppearance() { return SensorTypeProvider.getSensorAppearance(SensorTypeProvider.TYPE_CUSTOM, name); } @Override public byte[] getConfig() { return null; } @Override public boolean shouldShowOptionsOnConnect() { return false; } }