Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
/** * authorize relationship type * @param request * @return * @throws AtlasAuthorizationException */ default boolean isAccessAllowed(AtlasRelationshipAccessRequest request) throws AtlasAuthorizationException { return true; }
0
throw new InterruptedException("Operation interrupted"); } throw new InterruptedException("Operation interrupted"); }
0
public static volatile long SCHEDULE_TIMEOUT_VAL = 30000; SCHEDULE_TIMEOUT_VAL = Long.valueOf(scheduleTimeout);
0
import org.apache.felix.sigil.eclipse.ui.SigilUI;
0
* Catches any exception thrown by provided {@link ThrowingSupplier} and rethrows it as {@link public static <T> T unchecked(ThrowingSupplier<T> supplier) { /** User defined {@link Exception} throwing supplier */ public interface ThrowingSupplier<T> { /** User defined {@link Exception} throwing action. */ /** User defined {@link Exception} throwing consumer. */
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Defines coders used while reading and writing from/to HBase. * * @see org.apache.beam.sdk.io.hbase.HBaseIO */ package org.apache.beam.sdk.io.hbase.coders;
0
* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
import org.apache.hc.core5.http.EndpointDetails; public EndpointDetails getEndpointDetails() { return streamDuplexer.getEndpointDetails();
0
* @return service config version created ServiceConfigVersionResponse setServiceConfigVersion(String serviceName, Long version, String user, String note) throws AmbariException; Map<String, Collection<ServiceConfigVersionResponse>> getActiveServiceConfigVersions();
0
import org.apache.beam.runners.core.OldDoFn;
0
private long length = -1; length = writer.getLength(); @Override public long getLength() throws IOException { if (closed) { return length; } return writer.getLength(); }
0
* Extension of {@link AbstractListTest} for exercising the public class PredicatedListTest<E> extends AbstractListTest<E> { public PredicatedListTest(String testName) {
0
// TODO: what is intended here?? @Override public Serializing view() { return null; }
0
Copyright 2001-2002 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */
0
* Copyright 1999-2004 The Apache Software Foundation. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
import javax.inject.Singleton; import org.apache.aurora.scheduler.app.SchedulerMain; import org.apache.aurora.scheduler.mesos.FrameworkInfoFactory; import org.apache.aurora.scheduler.mesos.FrameworkInfoFactory.FrameworkInfoFactoryImpl; import org.apache.aurora.scheduler.mesos.FrameworkInfoFactory.FrameworkInfoFactoryImpl.BaseFrameworkInfo; install(new SchedulerMain.ProtocolModule()); FrameworkInfo base = FrameworkInfo.newBuilder() .setUser("framework user") .setName("test framework") .build(); com.google.common.base.Optional.absent())); bind(FrameworkInfo.class) .annotatedWith(BaseFrameworkInfo.class) .toInstance(base); bind(FrameworkInfoFactory.class).to(FrameworkInfoFactoryImpl.class); bind(FrameworkInfoFactoryImpl.class).in(Singleton.class);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//codec/src/java/org/apache/commons/codec/net/URLCodec.java,v 1.3 2003/07/31 20:09:21 tobrien Exp $ * $Revision: 1.3 $ * $Date: 2003/07/31 20:09:21 $ * @version $Id: URLCodec.java,v 1.3 2003/07/31 20:09:21 tobrien Exp $ if (b >= 0 && urlsafe.get(b)) {
0
import com.twitter.aurora.scheduler.base.JobKeys; JobKey key = JobKeys.assertValid(jobConfig.getKey()).deepCopy(); managers.getUnchecked(managerId).jobs.put(key, DEEP_COPY.apply(jobConfig)); public void removeJob(JobKey jobKey) { return FluentIterable.from(manager.jobs.values()).transform(DEEP_COPY).toSet(); return Optional.fromNullable(manager.get().jobs.get(jobKey)).transform(DEEP_COPY); private final Map<JobKey, JobConfiguration> jobs = Maps.newConcurrentMap();
0
SVGSVGElement svg = c.getViewport(); SVGSVGElement svg = c.getViewport(); /** * Returns the viewport used to compute percentages and units. */ SVGSVGElement getViewport();
0
import org.apache.beam.sdk.io.fs.EmptyMatchTreatment; this(fileSpec, EmptyMatchTreatment.DISALLOW); } TextSource(ValueProvider<String> fileSpec, EmptyMatchTreatment emptyMatchTreatment) { super(fileSpec, emptyMatchTreatment, 1L);
0
@SuppressWarnings({"unused"}) public enum TDurability implements org.apache.thrift.TEnum {
0
// This is broken for charsets that don't map each char to a byte @Ignore // test is broken for charsets that generate multiple bytes per char.
0
import org.apache.hc.core5.http.ContentType; import org.apache.hc.core5.http.HttpException; public void sendResponse(final ResponseChannel responseChannel) throws HttpException, IOException { responseChannel.sendResponse(response, dataProducer);
0
* @version $Revision: 1.5 $ $Date: 2004/05/15 12:33:23 $ * @return a new typed Buffer super();
0
import static org.apache.beam.sdk.io.hcatalog.HCatalogIOTestUtils.TEST_DATABASE; import static org.apache.beam.sdk.io.hcatalog.HCatalogIOTestUtils.TEST_FILTER; import static org.apache.beam.sdk.io.hcatalog.HCatalogIOTestUtils.TEST_TABLE; private static final PipelineOptions OPTIONS = PipelineOptionsFactory.create(); private @interface NeedsTestData {} private @interface NeedsEmptyTestTables {} service.executeQuery("drop table " + TEST_TABLE); .withDatabase(TEST_DATABASE) .withTable(TEST_TABLE) .withPartition(new java.util.HashMap<String, String>()) .withBatchSize(512L)); PCollection<String> output = readAfterWritePipeline .apply( HCatalogIO.read() .withConfigProperties(getConfigPropertiesAsMap(service.getHiveConf())) .withDatabase(TEST_DATABASE) .withTable(TEST_TABLE) .withFilter(TEST_FILTER)) .apply( ParDo.of( new DoFn<HCatRecord, String>() { @ProcessElement public void processElement(ProcessContext c) { c.output(c.element().get(0).toString()); } })); .withTable(TEST_TABLE); .withTable(TEST_TABLE); service.executeQuery("drop table " + TEST_TABLE); service.executeQuery("create table " + TEST_TABLE + "(mycol1 string, mycol2 int)");
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableListShortList.java,v 1.2 2003/08/31 17:21:17 scolebourne Exp $ * any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * @version $Revision: 1.2 $ $Date: 2003/08/31 17:21:17 $
0
PCollection<KV<K, OutputT>> doTranslate( return (PCollection) combined; private static class ReduceDoFn<K, V, OutT> extends DoFn<KV<K, Iterable<V>>, KV<K, OutT>> { private final DoFnCollector<KV<K, Iterable<V>>, KV<K, OutT>, OutT> collector; private static class Collector<K, V, OutT> implements DoFnCollector.BeamCollector<KV<K, Iterable<V>>, KV<K, OutT>, OutT> { public void collect(DoFn<KV<K, Iterable<V>>, KV<K, OutT>>.ProcessContext ctx, OutT out) { ctx.output(KV.of(ctx.element().getKey(), out));
0
public void configure(ServerContext context, String configuration) { conf = context.getConfiguration(); final AccumuloConfiguration localConf = conf;
0
import org.apache.beam.dsls.sql.schema.BeamSqlRecordType; import org.apache.beam.dsls.sql.schema.BeamSqlRow; BeamSqlRecordType dataType = BeamSqlRecordType.from( BeamSqlRow row1 = new BeamSqlRow(dataType); BeamSqlRow row2 = new BeamSqlRow(dataType); BeamSqlRow row3 = new BeamSqlRow(dataType); BeamSqlRow row4 = new BeamSqlRow(dataType); return new MockedBeamSqlTable(protoRowType).withInputRecords(
0
* Copyright 2001-2005 The Apache Software Foundation * @version $Id: VMSFTPEntryParserTest.java,v 1.17 2005/01/02 03:17:50 scohen Exp $ "FREEWARE40.DIR;1 27/36 16-FEB-1999 10:01:46 [AP_HTTPD,APACHE$WWW (RWE,RWE,RE,RE)", "1-JUN.LIS;1 9/9 2-jun-1998 07:32:04 [GROUP,OWNER] (RWED,RWED,RWED,RE)", parser.configure(null); parser.configure(null); ConfigurableFTPFileEntryParserImpl parser = new VMSFTPEntryParser(); parser.configure(null); return parser; } protected FTPFileEntryParser getVersioningParser() { ConfigurableFTPFileEntryParserImpl parser = new VMSVersioningFTPEntryParser(); parser.configure(null); return parser;
0
outputDebugMessage("Created %s", dir);
0
/* $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. */ package org.apache.commons.digester3.annotations.spi; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; import org.apache.commons.digester3.DigesterLoadingException; import org.apache.commons.digester3.annotations.AnnotationHandler; /** * An object capable of providing instances of {@link AnnotationHandler}. */ public interface AnnotationHandlerFactory { /** * Return an instance of the specified type. * * @param <H> * @param type the class of the object to be returned. * @return an instance of the specified class. * @throws DigesterLoadingException if any error occurs while creating the * {@code type} instance. */ <H extends AnnotationHandler<? extends Annotation, ? extends AnnotatedElement>> H newInstance( Class<H> type) throws Exception; }
0
import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.state.Clusters; import java.util.HashMap; @Inject Clusters clusters; if (!cacheLoaded) { if (configGroupHostMappingByHost == null) { configGroupHostMappingByHost = new HashMap<Long, Set<ConfigGroupHostMapping>>(); TypedQuery<ConfigGroupHostMappingEntity> query = entityManagerProvider.get().createQuery( "SELECT entity FROM ConfigGroupHostMappingEntity entity", ConfigGroupHostMappingEntity.class); List<ConfigGroupHostMappingEntity> configGroupHostMappingEntities = daoUtils.selectList(query); for (ConfigGroupHostMappingEntity configGroupHostMappingEntity : configGroupHostMappingEntities) { Set<ConfigGroupHostMapping> setByHost = configGroupHostMappingByHost.get((configGroupHostMappingEntity.getHostId())); if (setByHost == null) { setByHost = new HashSet<ConfigGroupHostMapping>(); configGroupHostMappingByHost.put(configGroupHostMappingEntity.getHostId(), setByHost); } ConfigGroupHostMapping configGroupHostMapping = buildConfigGroupHostMapping(configGroupHostMappingEntity); setByHost.add(configGroupHostMapping); } cacheLoaded = true; Cluster cluster = null; try { cluster = clusters.getClusterById(configGroupEntity.getClusterId()); } catch (AmbariException e) { //almost impossible }
0
@Override @Override @Override @Override @Override
0
"check" private final String startUser = "agent"; private final String prestartUser = "agent"; private final String checkUser = "agent";
0
if (!"[--bar Bar, --foo Foo]".equals(group1.toString())) { assertEquals("[--foo Foo, --bar Bar]", group1.toString()); } if (!"[-b Bar, -f Foo]".equals(group2.toString())) { assertEquals("[-f Foo, -b Bar]", group2.toString()); }
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap;
0
@RequiresSession public AlertCurrentEntity findCurrentByHostAndName(long clusterId, String hostName, String alertName) { TypedQuery<AlertCurrentEntity> query = entityManagerProvider.get().createNamedQuery( "AlertCurrentEntity.findByHostAndName", AlertCurrentEntity.class); query.setParameter("clusterId", Long.valueOf(clusterId)); query.setParameter("hostName", hostName); query.setParameter("definitionName", alertName); return daoUtils.selectOne(query); }
0
* @version $Id$
0
public void write(final byte[] b) throws IOException public void write(final byte[] b, final int off, final int len) throws IOException public void write(final int b) throws IOException public void writeBoolean(final boolean v) throws IOException public void writeByte(final int v) throws IOException public void writeBytes(final String s) throws IOException public void writeChar(final int v) throws IOException public void writeChars(final String s) throws IOException public void writeDouble(final double v) throws IOException public void writeFloat(final float v) throws IOException public void writeInt(final int v) throws IOException public void writeLong(final long v) throws IOException public void writeShort(final int v) throws IOException public void writeUTF(final String str) throws IOException
1
* @version $Id$
0
package org.apache.accumulo.tserver;
1
* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.
0
@Override
0
import java.util.Locale; /** * The name of the request attribute holding the language {@link Map} * for the request (value is "felix.webconsole.langMap"). * * This map contains the web console supported languages, which are automatically detected. * The keys of the map are the language codes, like "en", "en_US" .. and so-on. * The value for each key is the locale user-friendly name - exactly the same as * returned by {@link Locale#getDisplayLanguage()}. * * The automatic detection of languages is very simple. It relies on having a * 'res/flags/[lang].gif' file in the bundle. So translators should not only provide * localized l10n/bundle.properties but also a flag image. * * The image should be obtained from http://famfamfam.com/lab/icons/flags/ and eventually * renamed to the correct locale. * * @since 3.1.2 */ public static final String ATTR_LANG_MAP = "felix.webconsole.langMap"; //$NON-NLS-1$
0
private ReferenceQueue<Object> q = new ReferenceQueue<Object>(); private final Collection<Tracker> trackers = Collections.synchronizedSet(new HashSet<Tracker>()); // synchronized private final List<String> deleteFailures = Collections.synchronizedList(new ArrayList<String>()); private volatile boolean exitWhenFinished = false; private Thread reaper;
0
Map<String, List<String>> entities = new HashMap<>();
0
* <p> Code example which provides a "LogService" aspect that performs spell-checking of each log message.
0
import org.apache.http.params.HttpCoreConfigBuilder; this.serverParams = new HttpCoreConfigBuilder() .setSocketTimeout(60000) .setSocketBufferSize(8 * 1024) .setTcpNoDelay(true) .setOriginServer("TEST-SERVER/1.1").build(); this.clientParams = new HttpCoreConfigBuilder() .setSocketTimeout(60000) .setConnectTimeout(60000) .setSocketBufferSize(8 * 1024) .setTcpNoDelay(true) .setUserAgent("TEST-CLIENT/1.1").build();
0
/* * $Header: /cvshome/build/ee.foundation/src/java/io/InputStream.java,v 1.6 2006/03/14 01:20:24 hargrave Exp $ * * (C) Copyright 2001 Sun Microsystems, Inc. * Copyright (c) OSGi Alliance (2001, 2005). 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 java.io; public abstract class InputStream { public InputStream() { } public int available() throws java.io.IOException { return 0; } public void close() throws java.io.IOException { } public void mark(int var0) { } public boolean markSupported() { return false; } public abstract int read() throws java.io.IOException; public int read(byte[] var0) throws java.io.IOException { return 0; } public int read(byte[] var0, int var1, int var2) throws java.io.IOException { return 0; } public void reset() throws java.io.IOException { } public long skip(long var0) throws java.io.IOException { return 0l; } }
0
buffer = session.createBuffer(SshConstants.SSH_MSG_REQUEST_SUCCESS, Integer.BYTES);
0
import javax.servlet.Filter; import org.osgi.framework.Bundle; import org.osgi.service.http.HttpService; public FilterMapping(Bundle bundle, Filter filter, String pattern, int ranking) super(bundle); if (!this.isRegistered() && getContext() != null) { try { httpService.registerFilter(this.filter, this.pattern, getInitParams(), ranking, getContext()); setRegistered(true); } catch (Exception e) { SystemLogger.error("Failed to register filter", e); } if (httpService instanceof ExtHttpService && this.isRegistered()) { unregister((ExtHttpService) httpService); setRegistered(false);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestArrayList.java,v 1.5 2002/10/12 22:36:21 scolebourne Exp $ * $Revision: 1.5 $ * $Date: 2002/10/12 22:36:21 $ * @version $Id: TestArrayList.java,v 1.5 2002/10/12 22:36:21 scolebourne Exp $
0
/* * Copyright 2001-2004 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. package org.apache.commons.net.io;
0
private final HttpCache<CacheEntry> cache; private final URIExtractor uriExtractor;
0
new HashSet<>(Arrays.asList(new String[]{ HC_PROCESS_CLUSTER_NAME_ID, HC_PROCESS_HOST_NAME_ID, HC_PROCESS_COMPONENT_NAME_ID, HC_PROCESS_NAME_ID})); Set<Resource> resources = new HashSet<>(); Set<HostComponentProcessResponse> results = new HashSet<>();
1
PCollection<Long> vals = pipeline.apply(GenerateSequence.from(0).to(5)); PCollection<Long> vals = pipeline.apply(GenerateSequence.from(0).to(5)); PCollection<Long> vals = pipeline.apply(GenerateSequence.from(0).to(5)); PCollection<Long> vals = pipeline.apply(GenerateSequence.from(0).to(5));
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
import org.apache.commons.jexl2.parser.ASTNumberLiteral; public Object visit(ASTNumberLiteral node, Object data) {
0
result = continueMultiScan(sid, mss); return continueMultiScan(scanID, session); private MultiScanResult continueMultiScan(long scanID, MultiScanSession session) sendables.forEach((commitSession, value) -> commitSession.abortCommit()); if (!security.canConditionallyUpdate(credentials, tableId, namespaceId)) statsKeeper.updateTime(Operation.SPLIT, 0, true); statsKeeper.updateTime(Operation.SPLIT, 0, true); statsKeeper.updateTime(Operation.SPLIT, start, false); data = new TabletData(context, fs, getTableConfiguration(extent)); data = new TabletData(extent, fs, tabletsKeyValues.entrySet().iterator()); private static Pair<Text,KeyExtent> verifyRootTablet(ServerContext context, return verifyRootTablet(context, instance); tabletEntries.get(metadataEntry), lock); public void minorCompactionFinished(CommitSession tablet, long walogSeq) throws IOException { logger.minorCompactionFinished(tablet, walogSeq, durability); public void recover(VolumeManager fs, KeyExtent extent, List<LogEntry> logEntries, Set<String> tabletFiles, MutationReceiver mutationReceiver) throws IOException { Path finished = RecoveryPath.getRecoveryPath(fs.getFullPath(FileType.WAL, entry.filename)); private final RateProvider rateProvider = () -> getConfiguration() .getAsBytes(Property.TSERV_MAJC_THROUGHPUT);
0
import org.apache.sshd.util.test.CoreTestSupportUtils; sshd = CoreTestSupportUtils.setupTestServer(KexTest.class); client = CoreTestSupportUtils.setupTestClient(KexTest.class);
0
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
0
import java.util.TreeMap; @SuppressWarnings("serial") userpass = tpc.proxy().login("root", new TreeMap<String, String>() {{put("password",""); }});
0
* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
package org.apache.felix.sigil.ui.eclipse.ui.views; import org.apache.felix.sigil.eclipse.SigilCore; import org.apache.felix.sigil.eclipse.model.repository.IRepositoryModel; import org.apache.felix.sigil.eclipse.model.util.ModelHelper; import org.apache.felix.sigil.model.ICompoundModelElement; import org.apache.felix.sigil.model.IModelElement; import org.apache.felix.sigil.model.eclipse.ISigilBundle; import org.apache.felix.sigil.repository.IBundleRepository; import org.apache.felix.sigil.repository.IRepositoryChangeListener; import org.apache.felix.sigil.repository.IRepositoryVisitor; import org.apache.felix.sigil.repository.RepositoryChangeEvent; import org.apache.felix.sigil.ui.eclipse.ui.SigilUI; import org.apache.felix.sigil.ui.eclipse.ui.util.DefaultTreeContentProvider; import org.apache.felix.sigil.ui.eclipse.ui.util.ModelLabelProvider;
0
import org.apache.ambari.server.state.StackId; Config createConfig(StackId stackId, Cluster cluster, String type, Map<String, String> properties,
0
* @return the list of active compactions
0
* @version $Id$
0
LOG.debug("Agent {} vetoed task {}: {}", offer.getOffer().getHostname(), taskId, vetoes);
0
package org.apache.felix.bundlerepository.impl; import org.apache.felix.bundlerepository.Capability; import org.apache.felix.bundlerepository.Requirement; import org.apache.felix.bundlerepository.Resource; import org.apache.felix.bundlerepository.impl.metadataparser.XmlCommonHandler; import org.apache.felix.bundlerepository.impl.metadataparser.kxmlsax.KXml2SAXParser; import org.apache.felix.bundlerepository.Repository; public static final String OBR_PARSER_CLASS_DEFAULT = "org.apache.felix.bundlerepository.impl.StaxParser";
0
import org.apache.atlas.ocf.properties.beans.Connection; /** * Return the local server name - used for outbound events. * * @return String name */ String getLocalServerName(); /** * Return the local server type - used for outbound events. * * @return String name */ String getLocalServerType(); /** * Return the name of the organization that owns this local repository. * * @return String name */ String getOrganizationName();
0
import org.osgi.service.metatype.MetaTypeProvider; static final String PROP_FACTORY_ENABLED = "ds.factory.enabled"; static final String PROP_LOGLEVEL = "ds.loglevel"; static final String PID = "org.apache.felix.scr.ScrService"; // add meta type provider if interfaces are available Object enhancedService = tryToCreateMetaTypeProvider(service); final String[] interfaceNames; if ( enhancedService == null ) { interfaceNames = new String[] {ManagedService.class.getName()}; } else { interfaceNames = new String[] {ManagedService.class.getName(), MetaTypeProvider.class.getName()}; service = enhancedService; } props.put( Constants.SERVICE_PID, PID ); bundleContext.registerService( interfaceNames, service, props ); factoryEnabled = getDefaultFactoryEnabled(); private boolean getDefaultFactoryEnabled() { return VALUE_TRUE.equals( bundleContext.getProperty( PROP_FACTORY_ENABLED ) ); } private Object tryToCreateMetaTypeProvider(final Object managedService) { try { return new MetaTypeProviderImpl(getLogLevel( bundleContext ), getDefaultFactoryEnabled(), (ManagedService)managedService); } catch (Throwable t) { // we simply ignore this } return null; }
0
* Creates a <code>Mask</code> according to the specified parameters.
0
maxIdleTime > 0 ? maxIdleTime : 10, maxIdleTimeUnit != null ? maxIdleTimeUnit : TimeUnit.SECONDS, maxIdleTime, maxIdleTimeUnit);
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableSet; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Lists; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.io.BaseEncoding;
0
(AvroCoder<T>) transform.getDefaultOutputCoder(), context.getPipelineOptions());
0
final int r = super.read(); public synchronized int read(final byte b[], final int off, int len) throws IOException final int nread = super.read(b, off, len); final long nskip = super.skip(n); protected long calcFilePosition(final long nadd) public synchronized void mark(final int readlimit) public InputStream newStream(final long start, final long end) final long newFileStart = this.fileStart+start; final long newFileEnd = end<0?this.fileEnd:this.fileStart+end; final RandomAccessContent rac = fo.getContent().getRandomAccessContent(RandomAccessMode.READ); catch (final IOException e) final SharedRandomContentInputStream[] streams = new SharedRandomContentInputStream[createdStreams.size()]; for (final SharedRandomContentInputStream stream : streams) {
0
Resource src = this.resolver.getResource(getUrl(includeURI, contextURI)); loadURI(src, loadedURIs, includeStatement); throw new ConfigurationException("Cannot load '" + includeURI + "' at " + includeStatement.getLocation(), e); Configuration includeConfig; includeStatement.getLocation()); Resource src = this.resolver.getResource(getUrl(includeURI, contextURI)); this.configInfo.addImport(getUrl(src)); throw new ConfigurationException("Cannot load '" + includeURI + "' at " + includeStatement.getLocation(), e); if (!includeStatement.getAttributeAsBoolean("optional", false)) { throw new ConfigurationException("Directory '" + directoryURI + "' does not exist (" + includeStatement.getLocation() + ").");
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
1
* <li>{@link org.apache.http.params.CoreProtocolPNames#HTTP_ELEMENT_CHARSET}</li>
0
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
0
import com.google.common.base.MoreObjects; return MoreObjects.toStringHelper(this)
0
Assert.assertFalse(sc.isRecoveryEnabled()); // default value of recoveryEnabled sc.setRecoveryEnabled(true); Assert.assertTrue(sc.isRecoveryEnabled());
0
import cz.seznam.euphoria.core.client.type.TypeHint; @Override public boolean equals(Object obj) { return obj instanceof TestWindowing; } @Override public int hashCode() { return 0; } .keyBy(e -> e, TypeHint.of(String.class)) .valueBy(e -> 1L, TypeHint.of(Long.class)) .combineBy(Sums.ofLongs(), TypeHint.of(Long.class)) @Override public boolean equals(Object obj) { if (obj instanceof CWindowing) { CWindowing other = (CWindowing) obj; return other.size == size; } return false; } @Override public int hashCode() { return size; } @Override public boolean equals(Object obj) { return obj instanceof AssertingWindowing; } @Override public int hashCode() { return 0; } .keyBy(e -> "", new TypeHint<String>() {}) .valueBy(Pair::getFirst, new TypeHint<Integer>() {}) .combineBy(Sums.ofInts(), new TypeHint<Integer>() {})
0
import org.apache.accumulo.core.client.Durability; private final Durability durability; this.durability = config.getDurability(); tableId, durability.toThrift());
1
JEXL.setLenient(false); JEXL.setCache(128); public void setUp() throws Exception { // ensure jul logging is only error java.util.logging.Logger.getLogger(JexlEngine.class.getName()).setLevel(java.util.logging.Level.SEVERE); } JexlContext jc = null; JexlContext jc = null; new UnifiedJEXLTest("debug").testAssign(); }
0
import net.jcip.annotations.NotThreadSafe; @NotThreadSafe // AbstractCookieSpec is not thread-safe
0
import java.util.Objects; public boolean areEqualValues(Object val1, Object val2) { final boolean ret; if (val1 == null) { ret = val2 == null; } else if (val2 == null) { ret = false; } else { Object normalizedVal1 = getNormalizedValue(val1); if (normalizedVal1 == null) { ret = false; } else { Object normalizedVal2 = getNormalizedValue(val2); if (normalizedVal2 == null) { ret = false; } else { ret = Objects.equals(normalizedVal1, normalizedVal2); } } } return ret; }
0
import java.nio.charset.StandardCharsets; try (InputStream is = new ByteArrayInputStream(DATA.getBytes(StandardCharsets.UTF_8))) { try (InputStream is = new ByteArrayInputStream(MULTIPLE_USER_DATA.getBytes(StandardCharsets.UTF_8))) {
1
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.jexl; import org.apache.commons.jexl2.JexlEngine; /** * <p> * Creates {@link Script}s. To create a JEXL Script, pass * valid JEXL syntax to the static createScript() method: * </p> * * <pre> * String jexl = "y = x * 12 + 44; y = y * 4;"; * Script script = ScriptFactory.createScript( jexl ); * </pre> * * <p> * When an {@link Script} is created, the JEXL syntax is * parsed and verified. * </p> * * <p> * This is a convenience class; using an instance of a {@link JexlEngine} * that serves the same purpose with more control is recommended. * </p> * @since 1.1 * @version $Id: ScriptFactory.java 884175 2009-11-25 16:23:41Z henrib $ * @deprecated Create a JexlEngine and use the createScript method on that instead. */ @Deprecated public final class ScriptFactory extends JexlOne {}
0
* @version CVS $Id$
0
package org.apache.http.impl.io; import org.apache.http.io.HttpDataTransmitter;
0
import static org.junit.Assert.assertEquals; @Test public void testStructuralValueReturnTheSameValue() { Double expected = 23.32; Object actual = TEST_CODER.structuralValue(expected); assertEquals(expected, actual); }
0
* limitations under the License.
0
this(iteratorClass, iteratorOptions, range, input, Collections.emptySet(), false);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/compiler/Path.java,v 1.3 2002/04/24 04:05:38 dmitri Exp $ * $Revision: 1.3 $ * $Date: 2002/04/24 04:05:38 $ * @version $Revision: 1.3 $ $Date: 2002/04/24 04:05:38 $
0
StackId stackId = new StackId("HDP", STACK_VERSION); ormHelper.createStack(stackId); clusters.addCluster(clusterName, stackId);
0
* Sets the owner's (or everybody's) write permission * * @param executable * True to allow read access, false to disallow * @param ownerOnly * If <code>true</code>, the permission applies only to the owner; otherwise, it applies to everybody. * @return true if the operation succeeded * @throws FileSystemException * On error determining if this file exists. * @since 2.1 */ boolean setExecutable(boolean executable, boolean ownerOnly) throws FileSystemException; /** * Sets the owner's (or everybody's) read permission * * @param readable * True to allow read access, false to disallow * @param ownerOnly * If <code>true</code>, the permission applies only to the owner; otherwise, it applies to everybody. * @return true if the operation succeeded * @throws FileSystemException * On error determining if this file exists. * @since 2.1 */ boolean setReadable(boolean readable, boolean ownerOnly) throws FileSystemException; /** * Sets the owner's (or everybody's) write permission * * @param writable * True to allow read access, false to disallow * @param ownerOnly * If <code>true</code>, the permission applies only to the owner; otherwise, it applies to everybody. * @return true if the operation succeeded * @throws FileSystemException * On error determining if this file exists. * @since 2.1 */ boolean setWritable(boolean writable, boolean ownerOnly) throws FileSystemException; /**
0
import com.google.gson.Gson; import com.google.inject.Inject; import com.google.inject.Injector; import com.google.inject.Provider; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_LOCATION; e.printStackTrace(); throw new SystemException("Can not perform request. " + e.getMessage(), e); e.printStackTrace(); throw new SystemException("Can not perform request. " + e.getMessage(), e);
0
import java.nio.charset.StandardCharsets; import org.apache.hc.core5.http.Header; import org.apache.hc.core5.http.HttpResponse; import org.apache.hc.core5.http.HttpVersion; import org.apache.hc.core5.http.MessageConstraintException; import org.apache.hc.core5.http.NoHttpResponseException; import org.apache.hc.core5.http.config.MessageConstraints; import org.apache.hc.core5.http.io.HttpMessageParser; import org.apache.hc.core5.http.io.SessionInputBuffer; import org.junit.Ignore; * Tests for {@link LenientHttpResponseParser}. @Test @Ignore(value = "Requires a fix in DefaultHttpResponseParser") final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, StandardCharsets.US_ASCII); final MessageConstraints messageConstraints = MessageConstraints.custom().setMaxEmptyLineCount(Integer.MAX_VALUE).build(); final HttpMessageParser<HttpResponse> parser = new LenientHttpResponseParser(messageConstraints); final HttpResponse response = parser.parse(inbuffer); @Test(expected=MessageConstraintException.class) final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, StandardCharsets.US_ASCII); final MessageConstraints messageConstraints = MessageConstraints.custom().setMaxEmptyLineCount(2).build(); final HttpMessageParser<HttpResponse> parser = new LenientHttpResponseParser(messageConstraints); parser.parse(inbuffer); final SessionInputBuffer inbuffer = new SessionInputBufferMock("", StandardCharsets.US_ASCII); final HttpMessageParser<HttpResponse> parser = new LenientHttpResponseParser(MessageConstraints.DEFAULT); parser.parse(inbuffer); @Test(expected=MessageConstraintException.class) final SessionInputBuffer inbuffer = new SessionInputBufferMock(s, StandardCharsets.US_ASCII); final HttpMessageParser<HttpResponse> parser = new LenientHttpResponseParser(MessageConstraints.DEFAULT); parser.parse(inbuffer);
0