Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
Pair<Object,Object> pair = Pair.<Object,Object,Integer,String>fromEntry(entry); Pair<Number,CharSequence> pair2 = Pair.<Number,CharSequence,Integer,String>fromEntry(entry);
0
m_instance.addAttribute(new Attribute("component", m_className.replace('/', '.')));
0
import io.gearpump.streaming.dsl.api.functions.FoldFunction; import io.gearpump.streaming.dsl.api.functions.MapFunction; import io.gearpump.streaming.dsl.javaapi.JavaStream; import io.gearpump.streaming.dsl.javaapi.functions.GroupByFunction; import io.gearpump.streaming.dsl.window.api.Discarding$; import io.gearpump.streaming.dsl.window.api.EventTimeTrigger$; import io.gearpump.streaming.dsl.window.api.WindowFunction; import io.gearpump.streaming.dsl.window.api.Windows; import io.gearpump.streaming.dsl.window.impl.Window;
0
public class EAN13CheckDigitTest extends AbstractCheckDigitTest {
0
* limitations under the License.
0
import org.apache.beam.runners.core.construction.TransformInputs; return (T) Iterables.getOnlyElement(TransformInputs.nonAdditionalInputs(currentTransform));
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.
0
import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger log = LoggerFactory.getLogger(ThriftTransportPool.class); // connection unreserved, but it seems io may still be happening log.warn("Connection returned to thrift connection pool that may still be in use {} {}", ioThreadName, Thread.currentThread().getName(), log.warn("Thread \"{}\" stuck on IO to {} for at least {} ms", ioThreadName, cacheKey, delta); log.info("Thread \"{}\" no longer stuck on IO to {} sawError = {}", stuckThreadName, cacheKey, sawError); log.info("Thread \"{}\" no longer stuck on IO to {} sawError = {}", stuckThreadName, cacheKey, sawError); log.trace("Using existing connection to {}:{}", cacheKey.getLocation(), cacheKey.getPort()); log.trace("Using existing connection to {}:{}", ttk.getLocation(), ttk.getPort()); log.trace("Using existing connection to {}:{} timeout {}", ttk.getLocation(), ttk.getPort(), ttk.getTimeout()); log.trace("Creating new connection to connection to {}:{}", cacheKey.getLocation(), cacheKey.getPort()); log.trace("Returned connection had error {}", ctsc.getCacheKey()); log.warn("Server {} had {} failures in a short time period, will not complain anymore", ctsc.getCacheKey(), ecount); log.trace("Returned connection {} ioCount: {}", ctsc.getCacheKey(), cachedConnection.transport.ioCount); log.debug("Set thrift transport pool idle time to {}", time);
0
public static Info create(GremlinQueryComposer.Context context, org.apache.atlas.query.Lookup lookup, String identifier) { Info idInfo = new Info(identifier); idInfo.update(lookup, context); return idInfo; public static class Info { public Info(String s) {
0
import org.apache.accumulo.core.data.TableId; private TableId tableIdBeingServiced; TableId tableIdBeingServiced) { public TableId getServicedTableId() {
0
* <p> * It requires Java runtime with ALPN protocol support (such as Oracle JRE 9). public class Http2TlsAlpnRequestExecutionExample {
0
import javax.persistence.PrePersist; import javax.persistence.PreUpdate; @NamedQuery(name = "UserAuthenticationEntity.findAll", query = "SELECT entity FROM UserAuthenticationEntity entity"), @NamedQuery(name = "UserAuthenticationEntity.findByType", query = "SELECT entity FROM UserAuthenticationEntity entity where lower(entity.authenticationType)=lower(:authenticationType)") /** * Ensure the create time and update time are set properly when the record is created. */ @PrePersist protected void onCreate() { createTime = new Date(); updateTime = new Date(); } /** * Ensure the update time is set properly when the record is updated. */ @PreUpdate protected void onUpdate() { updateTime = new Date(); }
0
package org.apache.beam.runners.spark;
0
import java.util.Set; * @return a set of maps containing the properties contained in the http body public Set<Map<PropertyId, Object>> getHttpBodyProperties();
0
import org.apache.hc.core5.http.HttpHost; import org.apache.hc.core5.http.config.SocketConfig; import org.apache.hc.core5.http.protocol.HttpContext;
0
* @version $Revision$ $Date$
0
GraphicsNodeRenderContext rc = bridgeContext.getGraphicsNodeRenderContext(); DocumentLoader loader = bridgeContext.getDocumentLoader(); uctx, loader);
0
* TODO: may want to add more bit vector functions like and/or/xor/nand * TODO: also might be good to generate boolean[] from byte[] et. cetera.
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; private org.apache.felix.bundlerepository.RepositoryAdmin m_repoAdmin = null; public ObrCommandImpl(BundleContext context, org.apache.felix.bundlerepository.RepositoryAdmin repoAdmin) org.apache.felix.bundlerepository.Repository[] repos = m_repoAdmin.listRepositories(); org.apache.felix.bundlerepository.Resolver resolver = m_repoAdmin.resolver();
0
package org.apache.servicemix.kernel.deployer.filemonitor; import org.apache.servicemix.kernel.deployer.filemonitor.FileMonitor;
0
import org.apache.http.HeaderElement; Header h = entity.getContentType(); if (h != null) { HeaderElement[] elems = h.getElements(); if (elems.length > 0) { String contentType = elems[0].getName(); return contentType.equalsIgnoreCase(CONTENT_TYPE); } else { return false; } } else { return false; }
0
return CHARS_C;
0
public AtlasCluster getCluster(@PathParam("clusterName") String clusterName) throws AtlasBaseException { public List<ExportImportAuditEntry> getExportImportAudit(@QueryParam("clusterName") String cluster, @QueryParam("userName") String userName, @QueryParam("operation") String operation, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime, @QueryParam("limit") int limit, @QueryParam("offset") int offset) throws AtlasBaseException { perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "getExportImportAudit(" + cluster + ")"); return exportImportAuditService.get(userName, operation, cluster, startTime, endTime, limit, offset);
0
/** {@inheritDoc} */ /** {@inheritDoc} */ /** {@inheritDoc} */ /** {@inheritDoc} */ /** {@inheritDoc} */ /** {@inheritDoc} */
0
acls = AclUtils.updatePermissionForScheme(acls, "world", ZooDefs.Perms.READ);
0
response.setMessage("This client version is deprecated. Please, sync Aurora client " + "to the latest version and retry your action. See: go/getaurora for more details."); response.setResponseCode(ERROR);
0
import java.util.Properties; * Set Accumulo client properties used to connect to Accumulo * * @param job * Hadoop job to be configured * @param clientProps * Accumulo client properties * @since 2.0.0 */ public static void setClientProperties(JobConf job, Properties clientProps) { OutputConfigurator.setClientProperties(CLASS, job, clientProps); } /** * Set Accumulo client properties file used to connect to Accumulo * * @param job * Hadoop job to be configured * @param clientPropsFile * URL (hdfs:// or http://) to Accumulo client properties file * @since 2.0.0 */ public static void setClientPropertiesFile(JobConf job, String clientPropsFile) { OutputConfigurator.setClientPropertiesFile(CLASS, job, clientPropsFile); } /**
0
try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) { try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) {
0
package org.apache.commons.codec;
1
* Copyright 2002,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. * @version $Id: MethodPropertyExample.java,v 1.4 2004/02/28 13:45:20 yoavs Exp $
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. * */ package org.apache.bcel.data; public class PLSETestClass2 { public static void main(String args[]) { int t = 0; for (int i = 0; i < 100; i++) { t += i; } } }
0
import static org.apache.aurora.scheduler.resources.ResourceType.GPUS; private final boolean allowGpuResource; boolean requireDockerUseExecutor, boolean allowGpuResource) { this.allowGpuResource = allowGpuResource; if (!settings.allowGpuResource && config.getResources().stream() .filter(r -> ResourceType.fromResource(r).equals(GPUS)) .findAny() .isPresent()) { throw new TaskDescriptionException("GPU resource support is disabled in this cluster."); }
0
HashMap<Long,DoubleWrapper> aggregation1 = new HashMap<>(); HashMap<Long,DoubleWrapper> aggregation2 = new HashMap<>(); HashMap<Long,DoubleWrapper> aggregation3 = new HashMap<>(); HashMap<Long,DoubleWrapper> aggregation4 = new HashMap<>(); TreeMap<Long,DoubleWrapper> sorted = new TreeMap<>(aggregation1);
0
package org.apache.ambari.logsearch.common; public enum LogType { SERVICE("Service"), AUDIT("Audit"); private String label; private LogType(String label) { this.label = label; public String getLabel() { return label;
0
* Interface for a context provider. * Objects of this class provide special context, e.g. authentication or portal. * The provider has to take care that the context is instantiated and managed * correctly: for example a request context object should only created once * per request, an authentication context once per session etc. * @version CVS $Id: SessionContextProvider.java,v 1.2 2003/05/04 20:19:40 cziegeler Exp $ SessionContext getSessionContext(String name) throws ProcessingException; /** * Does the context exist? */ boolean existsSessionContext(String name)
0
// getLogger().debug("done registered factory for inserting node -- " + this);
0
/** * Extracts BigDecimal from the JsonNode if it is within bounds. * * <p>Throws {@link UnsupportedRowJsonException} if value is out of bounds. */ static ValueExtractor<BigDecimal> decimalValueExtractor() { return ValidatingValueExtractor.<BigDecimal>builder() .setExtractor(JsonNode::decimalValue) .setValidator(jsonNode -> jsonNode.isNumber()) .build(); }
0
import org.apache.beam.sdk.options.PipelineOptions; import org.apache.beam.sdk.options.PortablePipelineOptions; public static SdkComponents create(PipelineOptions options) { SdkComponents sdkComponents = new SdkComponents(); sdkComponents.registerEnvironment( Environments.createOrGetDefaultEnvironment( options.as(PortablePipelineOptions.class).getDefaultJavaEnvironmentUrl())); return sdkComponents; } // TODO Support multiple environments. The environment should be decided by the translation. return Iterables.getOnlyElement(componentsBuilder.getEnvironmentsMap().keySet());
0
package org.apache.commons.vfs.provider.webdav; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpURL; import org.apache.commons.httpclient.UsernamePasswordCredentials; import org.apache.commons.httpclient.MethodRetryHandler; import org.apache.commons.httpclient.HttpMethod; import org.apache.commons.httpclient.HttpConnection; import org.apache.commons.httpclient.HttpRecoverableException; import org.apache.commons.vfs.FileSystemOptions; import org.apache.commons.vfs.FileSystemException; import org.apache.commons.vfs.UserAuthenticator; import org.apache.commons.vfs.UserAuthenticationData; import org.apache.commons.vfs.util.UserAuthenticatorUtils; import org.apache.webdav.lib.WebdavResource; import java.io.IOException; /** * A retry handler which will retry a failed webdav method one time.<br /> * Now that webdavlib didnt support adding a MethodRetryHandler only a few operations are restartable yet. * * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a> * @version $Revision$ $Date$ */ public class WebdavMethodRetryHandler implements MethodRetryHandler { private final static WebdavMethodRetryHandler INSTANCE = new WebdavMethodRetryHandler(); private WebdavMethodRetryHandler() { } public static WebdavMethodRetryHandler getInstance() { return INSTANCE; } public boolean retryMethod(HttpMethod method, HttpConnection connection, HttpRecoverableException recoverableException, int executionCount, boolean requestSent) { return executionCount < 2; } }
0
* @version CVS $Id: ModifiableTraversableSource.java,v 1.2 2003/03/16 17:49:06 vgritsenko Exp $
0
* @version CVS $Id: StyleShading.java,v 1.4 2004/01/31 08:50:39 antonio Exp $ public class StyleShading { public static final int STYLE_SHADING_NONE = 0; public static final int STYLE_SHADING_SOLID = 1; public static final int STYLE_SHADING_PERCENT75 = 2; public static final int STYLE_SHADING_PERCENT50 = 3; public static final int STYLE_SHADING_PERCENT25 = 4; public static final int STYLE_SHADING_PERCENT12PT5 = 5; public static final int STYLE_SHADING_PERCENT6PT25 = 6; public static final int STYLE_SHADING_HORIZONTAL_STRIPE = 7; public static final int STYLE_SHADING_VERTICAL_STRIPE = 8; public static final int STYLE_SHADING_REVERSE_DIAGONAL_STRIPE = 9; public static final int STYLE_SHADING_DIAGONAL_STRIPE = 10; public static final int STYLE_SHADING_DIAGONAL_CROSSHATCH = 11; public static final int STYLE_SHADING_THICK_DIAGONAL_CROSSHATCH = 12; public static final int STYLE_SHADING_THIN_HORIZONTAL_STRIPE = 13; public static final int STYLE_SHADING_THIN_VERTICAL_STRIPE = 14; public static final int STYLE_SHADING_THIN_DIAGONAL_STRIPE = 16; public static final int STYLE_SHADING_THIN_CROSSHATCH = 17; public static final int STYLE_SHADING_THIN_DIAGONAL_CROSSHATCH = 18; public static final int STYLE_SHADING_APPLIX_SMALL_CIRCLE = 19; public static final int STYLE_SHADING_APPLIX_SEMICIRCLE = 20; public static final int STYLE_SHADING_APPLIX_SMALL_THATCH = 21; public static final int STYLE_SHADING_APPLIX_ROUND_THATCH = 22; public static final int STYLE_SHADING_APPLIX_BRICK = 23; public static final int STYLE_SHADING_PERCENT100 = 24; public static final int STYLE_SHADING_PERCENT87PT5 = 25; private StyleShading() {} public static boolean isValid(int val) { return (val >= STYLE_SHADING_NONE && val <= STYLE_SHADING_PERCENT87PT5); } // end public class StyleShading
0
import org.apache.beam.sdk.extensions.sql.BeamSqlTable;
0
import org.w3c.dom.Element; * @throws IllegalStateException if the context was not able to compute * the value. public float getViewportWidth(Element e) throws IllegalStateException { // !!! TODO throw new IllegalStateException(); * @throws IllegalStateException if the context was not able to compute * the value. public float getViewportHeight(Element e) throws IllegalStateException { // !!! TODO throw new IllegalStateException();
0
* Autogenerated by Thrift Compiler (0.9.1) import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; @SuppressWarnings("all") public class Compacting implements org.apache.thrift.TBase<Compacting, Compacting._Fields>, java.io.Serializable, Cloneable, Comparable<Compacting> { @Override lastComparison = Boolean.valueOf(isSetRunning()).compareTo(other.isSetRunning()); lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.running, other.running); lastComparison = Boolean.valueOf(isSetQueued()).compareTo(other.isSetQueued()); lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queued, other.queued);
0
/** * 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.aurora.scheduler.discovery; import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; import javax.inject.Inject; import com.google.common.collect.ImmutableSet; import org.apache.aurora.common.base.Command; import org.apache.aurora.common.net.pool.DynamicHostSet; import org.apache.aurora.common.thrift.ServiceInstance; import org.apache.aurora.scheduler.app.ServiceGroupMonitor; import static java.util.Objects.requireNonNull; class CommonsServiceGroupMonitor implements ServiceGroupMonitor { private Optional<Command> closeCommand = Optional.empty(); private final DynamicHostSet<ServiceInstance> serverSet; private final AtomicReference<ImmutableSet<ServiceInstance>> services = new AtomicReference<>(ImmutableSet.of()); @Inject CommonsServiceGroupMonitor(DynamicHostSet<ServiceInstance> serverSet) { this.serverSet = requireNonNull(serverSet); } @Override public void start() throws MonitorException { try { closeCommand = Optional.of(serverSet.watch(services::set)); } catch (DynamicHostSet.MonitorException e) { throw new MonitorException("Unable to watch scheduler host set.", e); } } @Override public void close() { closeCommand.ifPresent(Command::execute); } @Override public ImmutableSet<ServiceInstance> get() { return services.get(); } }
0
public <T> void addListProperty(String propertyName, T value) { try { getAsTitanVertex().addProperty(propertyName, value); } catch (SchemaViolationException e) { if (getPropertyValues(propertyName, value.getClass()).contains(value)) { // follow java set semantics, don't throw an exception if // value is already there. return; } throw new AtlasSchemaViolationException(e); } } @Override
1
import org.apache.ambari.server.controller.utilities.PropertyHelper; String propertyId = PropertyHelper.getPropertyId("category1", "foo"); EqualsPredicate predicate = new EqualsPredicate<String>(propertyId, "bar"); String propertyId = PropertyHelper.getPropertyId("category1", "foo"); EqualsPredicate predicate = new EqualsPredicate<String>(propertyId, "bar"); Set<String> ids = predicate.getPropertyIds();
1
Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("root", "superSecret"); Connector uconn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("user1", "pass1"); Connector conn = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers()).getConnector("root", "superSecret");
0
import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger log = LoggerFactory.getLogger(ZKAuthorizor.class); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e); log.error(e.getMessage(), e);
0
* @version $Id$
1
private static final String ZK_CLIENT_PORT = "hbase.zookeeper.property.clientPort"; if (amsHbaseSiteProperties.containsKey(ZK_CLIENT_PORT)) { String newValue = "{{zookeeper_clientPort}}"; LOG.info("Replacing value of hbase.zookeeper.property.clientPort from " + amsHbaseSiteProperties.get(ZK_CLIENT_PORT) + " to " + newValue); newProperties.put(ZK_CLIENT_PORT, newValue); }
0
Copyright 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
if (DateUtils.isAfter(entry, response, HttpHeaders.DATE)) {
0
package org.apache.commons.fileupload2; import org.apache.commons.fileupload2.disk.DiskFileItemFactory; * <p>The default {@link org.apache.commons.fileupload2.FileItemFactory} * {@link org.apache.commons.fileupload2.FileItem} instances which keep their * Create a new {@link org.apache.commons.fileupload2.DefaultFileItem}
0
json.put("title", ocd.getName());
0
import net.jcip.annotations.Immutable; @Immutable
0
List<ServletHandler> servlets = new ArrayList<ServletHandler>(); List<ServletHandler> resources = new ArrayList<ServletHandler>(); ContextRuntime contextRuntime_0 = new ContextRuntime(filters_0, errorPages_0, null, null); ContextRuntime contextRuntime_A = new ContextRuntime(filters_A, errorPages_A, null, null); ContextRuntime contextRuntime_B = new ContextRuntime(filters_B, errorPages_B, null, null); null); null, null); null); null); null, null); null);
0
import org.apache.beam.sdk.PipelineRunner; * {@link PipelineRunner} * {@link PipelineRunner} * {@link PipelineRunner} * {@link PipelineRunner}
0
import java.io.ByteArrayInputStream; import java.io.InputStream; String commandLine = "ambari-python-wrap /tmp/stacks/S1/V1/PIG/package/null generate_configs null " + "/tmp/stacks/S1/V1/PIG/package /var/lib/ambari-server/tmp/structured-out.json " + "INFO /var/lib/ambari-server/tmp"; ProcessBuilder processBuilder = PowerMock.createNiceMock(ProcessBuilder.class); PowerMock.expectNew(ProcessBuilder.class,Arrays.asList(commandLine.split("\\s+"))).andReturn(processBuilder).once(); expect(processBuilder.start()).andReturn(process).once(); InputStream inputStream = new ByteArrayInputStream("some logging info".getBytes()); expect(process.getInputStream()).andReturn(inputStream);
0
E v = getCollection().set(i, n); getConfirmed().set(i, n); getCollection().set(0, getFullElements()[0]); E o1 = getCollection().remove(i); E o2 = getConfirmed().remove(i);
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. */ * @version CVS $Id: EPStyles.java,v 1.5 2004/03/05 13:02:04 bdelacretaz Exp $
1
public abstract class BaseTracker<S> extends ServiceTracker<S, ConfigurationMap<?>> public ConfigurationMap<?> addingService( ServiceReference<S> reference ) this.cm.log( LogService.LOG_DEBUG, "Registering service {0}", new String[] { ConfigurationManager.toString( reference ) } ); return createConfigurationMap( pids ); public void modifiedService( ServiceReference<S> reference, ConfigurationMap<?> service ) this.cm.log( LogService.LOG_DEBUG, "Modified service {0}", new String[] { ConfigurationManager.toString( reference ) } ); @Override public void removedService( ServiceReference<S> reference, ConfigurationMap<?> service ) { // just log this.cm.log( LogService.LOG_DEBUG, "Unregistering service {0}", new String[] { ConfigurationManager.toString( reference ) } ); } this.cm.configure( pids, reference, managedServiceFactory ); protected abstract ConfigurationMap<?> createConfigurationMap( String[] pids ); public abstract void provideConfiguration( ServiceReference<S> service, TargetedPID configPid, TargetedPID factoryPid, Dictionary<String, ?> properties, long revision ); public abstract void removeConfiguration( ServiceReference<S> service, TargetedPID configPid, TargetedPID factoryPid ); protected final Dictionary getProperties( Dictionary<String, ?> rawProperties, ServiceReference service, String configPid, String factoryPid ) this.cm.callPlugins( props, service, configPid, factoryPid ); protected final void handleCallBackError( final Throwable error, final ServiceReference target, final TargetedPID pid ) { ConfigurationManager.toString( target ), ce.getProperty(), pid, ce.getReason(), ce } ); { ConfigurationManager.toString( target ), pid, ce.getReason(), ce } ); { ConfigurationManager.toString( target ), pid, error } );
0
shellState.getConnector().securityOperations().createUser(user, password.getBytes());
0
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AttributeInfo that = (AttributeInfo) o; if (isComposite != that.isComposite) { return false; } if (isUnique != that.isUnique) { return false; } if (isIndexable != that.isIndexable) { return false; } if (!dataType.getName().equals(that.dataType.getName())) { return false; } if (!multiplicity.equals(that.multiplicity)) { return false; } if (!name.equals(that.name)) { return false; } if (reverseAttributeName != null ? !reverseAttributeName.equals(that.reverseAttributeName) : that.reverseAttributeName != null) { return false; } return true; }
0
EasyMock.expect(i1.isRoot()).andReturn(true); Assert.assertTrue(cd1.containsValue(true));
0
class CachedResponseSuitabilityChecker {
0
throws PortalException { throw new PortalException("Unable configure component.", ce);
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. */
0
import org.apache.beam.sdk.runners.AppliedPTransform;
0
import java.util.Date; Date date = cal.getTime(); notifier.propertyChange(new PropertyChangeEvent(variable,"Time",null,date));
0
public static void addCastString( OgnlContext context, String cast )
0
Learner learner; SendAckRequestProcessor(Learner peer) { this.learner = peer; learner.writePacket(qp, false); if (!learner.sock.isClosed()) { learner.sock.close(); learner.writePacket(null, true); if (!learner.sock.isClosed()) { learner.sock.close();
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. */ package org.apache.cocoon.components.language.markup; import org.apache.excalibur.source.Source; import org.apache.cocoon.xml.AbstractXMLPipe; /** * This interfaces defines the functionality of a source code generator * * @version $Id$ */ public interface MarkupCodeGenerator { /** * Generate source code from the given markup source. * Start and end specify SAX pre processing pipeline. * * @param source The source of the markup program * @param filter Pre-processing SAX filter * @return The generated source code * @exception Exception If an error occurs during code generation */ String generateCode(Source source, AbstractXMLPipe filter) throws Exception; }
0
/** * Adds property to the given entity id * @param guid entity id * @param property property to add * @param value property's value * @return */ @PUT @Path("addProperty/{guid}") @Produces(MediaType.APPLICATION_JSON) public Response addProperty(@PathParam("guid") String guid, @QueryParam("property") String property, @QueryParam("value") String value) { try { metadataService.addProperty(guid, property, value); JSONObject response = new JSONObject(); response.put("requestId", Thread.currentThread().getName()); return Response.ok(response).build(); } catch (MetadataException e) { LOG.error("Unable to add property {} to entity id {}", property, guid, e); throw new WebApplicationException( Servlets.getErrorResponse(e, Response.Status.BAD_REQUEST)); } catch (JSONException e) { LOG.error("Unable to add property {} to entity id {}", property, guid, e); throw new WebApplicationException( Servlets.getErrorResponse(e, Response.Status.INTERNAL_SERVER_ERROR)); } }
0
/** * @since 4.2 */
0
return Type.getTypeSize(getSignature(cpg));
0
import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger LOG = LoggerFactory.getLogger(UnboundedDataset.class); public void cache(String storageLevel) { // we "force" MEMORY storage level in streaming LOG.warn("Provided StorageLevel ignored for stream, using default level"); cache(); } @Override
0
package cz.seznam.euphoria.flink; public class FlinkOperator<OP extends Operator> extends Operator {
0
// non-javadoc, see interface ManagedClientConnection public boolean isStateful() { assertAttached(); return poolEntry.state != null; } // non-javadoc, see interface ManagedClientConnection public void setState(final Object state) { poolEntry.state = state; }
0
* @param revalidationRequest the request to be executed; not {@code null}
0
public static final Transformer<DHFactory, NamedFactory<KeyExchange>> DH2KEX = new Transformer<DHFactory, NamedFactory<KeyExchange>>() { @Override public NamedFactory<KeyExchange> transform(DHFactory factory) { if (factory == null) { return null; } else if (factory.isGroupExchange()) { return DHGEXServer.newFactory(factory); } else { return DHGServer.newFactory(factory); } }; public static final List<NamedFactory<Channel>> DEFAULT_CHANNEL_FACTORIES = Collections.unmodifiableList(Arrays.<NamedFactory<Channel>>asList( ChannelSessionFactory.INSTANCE, DirectTcpipFactory.INSTANCE )); public static final List<RequestHandler<ConnectionService>> DEFAULT_GLOBAL_REQUEST_HANDLERS = Collections.unmodifiableList(Arrays.<RequestHandler<ConnectionService>>asList( KeepAliveHandler.INSTANCE, NoMoreSessionsHandler.INSTANCE, TcpipForwardHandler.INSTANCE, CancelTcpipForwardHandler.INSTANCE )); public static final PublickeyAuthenticator DEFAULT_PUBLIC_KEY_AUTHENTICATOR = DefaultAuthorizedKeysAuthenticator.INSTANCE; * key exchanges are included, regardless of whether they are currently * supported by the JCE. Otherwise, only the supported ones out of the * list are included * @see org.apache.sshd.common.kex.BuiltinDHFactories#isSupported()
1
for (int unicodeChar : unicodeChars) { buffer.append((char)unicodeChar);
0
* TODO: Remove once splitting/checkpointing are available in SDKs and rewinding in readers. *
0
/** Constant for the prefix of binary numbers.*/ private static final String BIN_PREFIX = "0b"; /** Constant for the radix of binary numbers.*/ private static final int BIN_RADIX = 2; if (str.startsWith(BIN_PREFIX)) { try { return new BigInteger(str.substring(BIN_PREFIX.length()), BIN_RADIX); } catch (NumberFormatException nex) { throw new ConversionException("Could not convert " + str + " to " + targetClass.getName() + "! Invalid binary number.", nex); } }
0
Copyright 2000-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
import org.apache.felix.webconsole.ModeAwareConfigurationPrinter; /** * This class provides the Threads tab in the configuration status. */ public class ThreadPrinter extends AbstractConfigurationPrinter implements ModeAwareConfigurationPrinter private final ThreadDumper dumper = new ThreadDumper(); /** * @see org.apache.felix.webconsole.ConfigurationPrinter#getTitle() */ /** * @see org.apache.felix.webconsole.ConfigurationPrinter#printConfiguration(java.io.PrintWriter) */ printConfiguration(pw, MODE_TXT); /** * @see ModeAwareConfigurationPrinter#printConfiguration(java.io.PrintWriter, java.lang.String) */ public void printConfiguration(PrintWriter pw, String mode) dumper.printThreads(pw, MODE_ZIP.equals(mode));
0
/* * Copyright 2000-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.bcel.generic;
0
* */ private static final long serialVersionUID = 1L;
1
* Copyright 2000-2009 The Apache Software Foundation
0
SSLSocketFactory socketFactory = new SSLSocketFactory(sslcontext, hostnameVerifier); Scheme https = new Scheme("https", 443, socketFactory);
0
private static final String API_PRIVILEGES_ALL_PATTERN = API_VERSION_PREFIX + "/privileges.*"; } else if(!authorizationPerformedInternally(requestURI)) { /** * Tests the URI to determine if authorization checks are performed internally or should be * performed in the filter. * * @param requestURI the request uri * @return true if handled internally; otherwise false */ private boolean authorizationPerformedInternally(String requestURI) { return requestURI.matches(API_USERS_ALL_PATTERN) || requestURI.matches(API_PRIVILEGES_ALL_PATTERN); }
0
import org.apache.accumulo.server.security.SecurityOperationImpl; SecurityOperationImpl.getInstance().deleteTable(SecurityConstants.getSystemCredentials(), tableId);
0
private ClientInfo clientInfo; return Connector.builder().usingClientInfo(getClientInfo()).usingToken(user, token).build(); if (clientInfo == null) { clientInfo = Connector.builder() .usingProperties(config.getClientPropsFile().getAbsolutePath()).info(); } return clientInfo; ClientContext context = new ClientContext(getClientInfo());
0
/* * $Header: /cvshome/build/ee.foundation/src/java/util/zip/CheckedInputStream.java,v 1.6 2006/03/14 01:20:30 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.util.zip; public class CheckedInputStream extends java.io.FilterInputStream { public CheckedInputStream(java.io.InputStream var0, java.util.zip.Checksum var1) { super((java.io.InputStream) null); } public int read() throws java.io.IOException { return 0; } public int read(byte[] var0, int var1, int var2) throws java.io.IOException { return 0; } public java.util.zip.Checksum getChecksum() { return null; } public long skip(long var0) throws java.io.IOException { return 0l; } }
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList;
0
* Copyright 2002,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 java.util.concurrent.TimeUnit; BatchWriter bw = getConnector().createBatchWriter("bwlt", new BatchWriterConfig().setMaxLatency(2000, TimeUnit.MILLISECONDS));
0
public class ObjectCreateRule extends Rule {
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. */ package org.apache.cocoon.caching.validity; /** * An external uncache event that consists of a name/value pair. * An example might be "table_name", "primary_key" * * @author Geoff Howard (ghoward@apache.org) * @version $Id$ */ public class NameValueEvent extends Event { private String m_name; private String m_value; private int m_hashcode; /** * Constructor requires two Strings - the name/value * pair which defines this Event. * * @param name * @param value */ public NameValueEvent(String name, String value) { m_name = name; m_value = value; m_hashcode = (name + value).hashCode(); } /** * Must return true when both name and value are * equivalent Strings. */ public boolean equals(Event e) { if (e instanceof NameValueEvent) { NameValueEvent nve = (NameValueEvent)e; return ( m_name.equals(nve.m_name) && m_value.equals(nve.m_value) ); } return false; } public int hashCode() { return m_hashcode; } public String toString() { return "NameValueEvent[" + m_name + "," + m_value + "]"; } }
0
int scPos = pathInfo.indexOf(';'); if (scPos > 0) { pathInfo = pathInfo.substring(0, scPos);
0