Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
import org.apache.accumulo.core.metadata.schema.MetadataSchema.CurrentLogsSection;
cfg.setProperty(Property.INSTANCE_ZK_TIMEOUT, "5s");
s.setRange(CurrentLogsSection.getRange());
s.fetchColumnFamily(CurrentLogsSection.COLF);
String path = new Path(entry.getKey().getColumnQualifier().toString()).toString(); | 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.cocoon.auth.impl;
import org.apache.cocoon.auth.User;
/**
* Interface for the user dao.
*
* @version $Id$
*/
public interface UserDAO {
/**
* Get a user info for the given user name.
*/
UserInfo getUserInfo(String name);
/**
* Store or update a user info in the database.
*/
void storeUserInfo(UserInfo info);
/**
* Get the complete user for the user info.
*/
User getUser(UserInfo info);
} | 0 |
(null, SVGConstants.SVG_ONKEYUP_ATTRIBUTE).length() > 0) {
return true;
}
if (elt.getAttributeNS
(null, SVGConstants.SVG_ONKEYDOWN_ATTRIBUTE).length() > 0) {
return true;
}
if (elt.getAttributeNS
(null, SVGConstants.SVG_ONKEYPRESS_ATTRIBUTE).length() > 0) {
return true;
}
if (elt.getAttributeNS
(null, SVGConstants.SVG_ONLOAD_ATTRIBUTE).length() > 0) {
return true;
}
if (elt.getAttributeNS | 0 |
* name of the callback method to invoke on swap.
*/
String swap() default "";
/** | 0 |
/** @since 1.0.9 */
/** @since 1.0.9 */
/** @since 1.0.9 */
/** @since 1.0.9 */ | 0 |
super.populateDisplayData(builder);
super.populateDisplayData(builder);
super.populateDisplayData(builder);
super.populateDisplayData(builder);
super.populateDisplayData(builder);
super.populateDisplayData(builder);
super.populateDisplayData(builder);
super.populateDisplayData(builder); | 0 |
provides, | 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 category;
/**
* Category of unit tests that can be annotated. E.g.,
* {@code @Category({ category.BlueprintTest.class}) }
*
* A Profile can have csv of categories, in order to run the unit tests like,
* mvn clean test -P BlueprintTests
*/
public interface BlueprintTest {} | 0 |
import com.google.common.collect.Maps;
import com.twitter.mesos.gen.TaskQuery;
StateManager stateManager) {
Set<ScheduledTask> tasksOnHost =
stateManager.fetchTasks(new TaskQuery().setSlaveHost(offer.getHostname()));
AdjustRetainedTasks message = new AdjustRetainedTasks()
.setRetainedTasks(Maps.transformValues(Tasks.mapById(tasksOnHost), Tasks.GET_STATUS)); | 0 |
* @deprecated 1.1 Use <code>DiskFileItem</code> instead.
* @deprecated 1.1 Use <code>DiskFileItem</code> instead. | 0 |
package org.apache.commons.jexl2.util; | 0 |
return vertex.getProperty(Constants.GUID_PROPERTY_KEY, String.class); | 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.beam.runners.fnexecution.environment;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import org.apache.beam.model.pipeline.v1.RunnerApi.Environment;
import org.apache.beam.runners.fnexecution.control.InstructionRequestHandler;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/** Tests for {@link ProcessEnvironment}. */
@RunWith(JUnit4.class)
public class ProcessEnvironmentTest {
@Test
public void closeClosesInstructionRequestHandler() throws Exception {
InstructionRequestHandler handler = mock(InstructionRequestHandler.class);
RemoteEnvironment env =
ProcessEnvironment.create(
mock(ProcessManager.class), Environment.getDefaultInstance(), "1", handler);
env.close();
verify(handler).close();
}
} | 0 |
* Copyright 2004-2005 The Apache Software Foundation.
/** Constant for the prefix of hex numbers.*/
private static final String HEX_PREFIX = "0x";
/** Constant for the radix of hex numbers.*/
private static final int HEX_RADIX = 16;
* @return the converted value
* @return the converted value
if (string.startsWith(HEX_PREFIX))
return new Byte((byte) Integer.parseInt(string.substring(2), HEX_RADIX));
* @return the converted value
if (string.startsWith(HEX_PREFIX))
return new Short((short) Integer.parseInt(string.substring(2), HEX_RADIX));
* @return the converted value
if (string.startsWith(HEX_PREFIX))
return new Integer((int) Long.parseLong(string.substring(2), HEX_RADIX));
* @return the converted value
if (string.startsWith(HEX_PREFIX))
return new Long(new BigInteger(string.substring(2), HEX_RADIX).longValue());
* @return the converted value
* @return the converted value
* @return the converted value
if (string.startsWith(HEX_PREFIX))
return new BigInteger(string.substring(2), HEX_RADIX);
* @return the converted value
* @return the converted value
* @return the converted value
* @return a list with the single tokens
*
* @return the converted value
* Convert the specified object into a Date.
* @return the converted value
* @return the converted value
* @return an iterator for accessing the single values | 0 |
* An exception that is thrown if the unique job name constraint of the Dataflow service is broken
* because an existing job with the same job name is currently active. The {@link
* DataflowPipelineJob} contained within this exception contains information about the pre-existing
* job.
public DataflowJobAlreadyExistsException(DataflowPipelineJob job, String message) { | 1 |
import org.apache.hc.core5.util.LangUtils;
int pendingCount = 0;
for (LeaseRequest<T, C, E> request: leasingRequests) {
if (LangUtils.equals(route, request.getRoute())) {
pendingCount++;
}
}
pendingCount + pool.getPendingCount(), | 0 |
public void execute(Executor exec) throws Exception { | 0 |
package org.apache.felix.ipojo.handler.transaction.services;
import javax.transaction.Transaction;
public interface CheckService {
public void doSomethingGood();
public void doSomethingBad() throws NullPointerException;
public void doSomethingBad2() throws UnsupportedOperationException;
public void doSomethingLong();
public int getNumberOfCommit();
public int getNumberOfRollback();
public Transaction getCurrentTransaction();
public Transaction getLastRolledBack();
public Transaction getLastCommitted();
} | 0 |
/*
* Copyright (C) 2015 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.cloud.dataflow.sdk.util;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.theInstance;
import static org.junit.Assert.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/**
* Tests for {@link FinishedTriggersBitSet}.
*/
@RunWith(JUnit4.class)
public class FinishedTriggersBitSetTest {
/**
* Tests that after a trigger is set to finished, it reads back as finished.
*/
@Test
public void testSetGet() {
FinishedTriggersProperties.verifyGetAfterSet(FinishedTriggersBitSet.emptyWithCapacity(1));
}
/**
* Tests that clearing a trigger recursively clears all of that triggers subTriggers, but no
* others.
*/
@Test
public void testClearRecursively() {
FinishedTriggersProperties.verifyClearRecursively(FinishedTriggersBitSet.emptyWithCapacity(1));
}
@Test
public void testCopy() throws Exception {
FinishedTriggersBitSet finishedSet = FinishedTriggersBitSet.emptyWithCapacity(10);
assertThat(finishedSet.copy().getBitSet(), not(theInstance(finishedSet.getBitSet())));
}
} | 0 |
package com.twitter.mesos.scheduler.http; | 0 |
import org.apache.cocoon.components.expression.ExpressionContext;
import org.apache.cocoon.template.jxtg.environment.ExecutionContext;
import org.apache.cocoon.xml.XMLConsumer;
private final String name;
private final String namespace;
public Event execute(final XMLConsumer consumer,
ExpressionContext expressionContext, ExecutionContext executionContext,
StartElement macroCall, Event startEvent, Event endEvent)
throws SAXException {
executionContext.getDefinitions().put(this.qname, this);
return getEndInstruction().getNext();
}
Object prev = this.parameters.put(startParam.name, startParam);
this.body = e;
this.body = e;
if (this.body == null) {
this.body = this.getEndInstruction();
private void setBody(Event body) {
private String getQname() { | 0 |
static org.slf4j.Logger log =
org.slf4j.LoggerFactory.getLogger(InteropTestBase.class);
Node n = iter.next(); | 1 |
* <p>
* <p>
package org.apache.atlas.typesystem.types;
/*
* this enum must be in package org.apache.atlas.typesystem.types, since vertex property in GraphDB has reference to this type
*/
public class DataTypes {
public enum TypeCategory {
PRIMITIVE,
ENUM,
ARRAY,
MAP,
STRUCT,
TRAIT,
CLASS,
RELATIONSHIP
} | 1 |
import org.apache.beam.sdk.extensions.euphoria.core.client.operator.base.Operator;
import org.apache.beam.sdk.extensions.euphoria.core.client.operator.base.SingleInputOperator; | 0 |
import org.apache.beam.runners.core.construction.SerializablePipelineOptions;
context.getSerializableOptions(),
context.getSerializableOptions(),
final SerializablePipelineOptions options = context.getSerializableOptions();
new SparkKeyedCombineFn<>(fn, options,
final SerializablePipelineOptions options = context.getSerializableOptions();
options, | 0 |
.setInstanceCount(1)); | 0 |
* by this BridgeExtension, these are added to the list of
* requiredExtensions that the User Agent supports for purposes
* of the 'switch' element in SVG. | 0 |
if (clientConf.hasSasl()) {
if (clientConf.hasSasl()) { | 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 |
public StorageResolverException(Exception ex) {
super(ex);
} | 0 |
e = JEXL.createScript("D[E[F]]");
vars = e.getVariables();
expect = mkref(new String[][]{{"D"}, {"E"}, {"F"}});
assertTrue(eq(expect, vars));
e = JEXL.createScript("D[E[F[G[H]]]]");
vars = e.getVariables();
expect = mkref(new String[][]{{"D"}, {"E"}, {"F"}, {"G"}, {"H"}});
assertTrue(eq(expect, vars));
e = JEXL.createScript(" A + B[C] + D[E[F]] + x[y[z]] ");
vars = e.getVariables();
expect = mkref(new String[][]{{"A"}, {"B"}, {"C"}, {"D"}, {"E"}, {"F"}, {"x"} , {"y"}, {"z"}});
assertTrue(eq(expect, vars));
e = JEXL.createScript(" A + B[C] + D.E['F'] + x[y.z] ");
vars = e.getVariables();
expect = mkref(new String[][]{{"A"}, {"B"}, {"C"}, {"D", "E", "F"}, {"x"} , {"y", "z"}});
assertTrue(eq(expect, vars)); | 0 |
import org.apache.http.auth.AUTH;
new RequestUserAgent()
String host = target.getHostName();
int port = target.getPort();
if (port < 0) {
port = 80;
}
StringBuilder buffer = new StringBuilder(host.length() + 6);
buffer.append(host);
buffer.append(':');
buffer.append(Integer.toString(port));
String authority = buffer.toString();
ProtocolVersion ver = HttpProtocolParams.getVersion(this.params);
HttpRequest connect = new BasicHttpRequest("CONNECT", authority, ver);
connect.setParams(this.params);
BasicCredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(new AuthScope(proxy), credentials);
// Populate the execution context
context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, target);
context.setAttribute(ExecutionContext.HTTP_PROXY_HOST, proxy);
context.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
context.setAttribute(ExecutionContext.HTTP_REQUEST, connect);
context.setAttribute(ClientContext.PROXY_AUTH_STATE, this.proxyAuthState);
context.setAttribute(ClientContext.CREDS_PROVIDER, credsProvider);
context.setAttribute(ClientContext.AUTHSCHEME_REGISTRY, this.authSchemeRegistry);
this.requestExec.preProcess(connect, this.httpProcessor, context);
this.authenticator.generateAuthResponse(connect, this.proxyAuthState, context);
if (this.authenticator.handleAuthChallenge(proxy, response,
// discard previous auth header
connect.removeHeaders(AUTH.PROXY_AUTH_RESP);
static class ProxyConnection extends DefaultHttpClientConnection { | 0 |
stderr.append("WARNING: ").append(e.getClass().getSimpleName()).append(": ").println(e.getMessage()); | 0 |
DirectionAttributes directionAtts = JXpathBindingBuilderBase.getDirectionAttributes(bindingElm);
return new InsertNodeJXPathBinding(directionAtts.loadEnabled, directionAtts.saveEnabled, domTemplate); | 0 |
return new NullIsTruePredicate<>(predicate); | 1 |
import org.apache.accumulo.core.util.HostAndPort; | 1 |
package org.apache.beam.harness.test;
import org.apache.beam.harness.test.TestExecutors.TestExecutorService; | 0 |
public Rectangle2D getPrimitiveBounds() { | 0 |
Iterator<RequestRequest> reqIterator = requests.iterator();
for (int i = 0; i < targets.size(); i++) {
org.apache.ambari.server.actionmanager.Request target = targets.get(i);
String reason = reqIterator.next().getAbortReason();
amc.getActionManager().cancelRequest(target.getRequestId(), reason); | 0 |
Object result = children[0].getValue( context, source );
for ( int i = 1; i < children.length; ++i )
result = OgnlOps.binaryAnd( result, children[i].getValue( context, source ) ); | 0 |
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "RoleToNodesMap") | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/GenericTypeValidator.java,v 1.4 2002/04/02 03:55:02 dwinterfeldt Exp $
* $Revision: 1.4 $
* $Date: 2002/04/02 03:55:02 $
* @version $Revision: 1.4 $ $Date: 2002/04/02 03:55:02 $
public static Long formatCreditCard(String value) {
Long result = null;
result = new Long(value); | 0 |
final boolean open = connReleaseTrigger != null && !connReleaseTrigger.isReleased();
} catch (final SocketException ex) { | 0 |
package org.apache.felix.karaf.shell.admin; | 0 |
package org.apache.atlas.web.filters;
import org.apache.atlas.security.BaseSecurityTest;
import org.apache.atlas.web.service.EmbeddedServer;
@Test (enabled = false)
TestEmbeddedServer server = new TestEmbeddedServer(23001, "webapp/target/apache-atlas");
config.setProperty("atlas.http.authentication.enabled", "true");
config.setProperty("atlas.http.authentication.type", "simple"); | 0 |
import org.apache.batik.anim.values.AnimatableValue;
* Updates the animated value with the gien {@link AnimatableValue}.
*/
protected abstract void updateAnimatedValue(AnimatableValue val);
/** | 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.ambari.server.security.authorization;
public enum GroupType {
LOCAL,
LDAP,
JWT,
PAM
} | 0 |
* <p>A {@link PipelineRunner} will support some set of materializations, and will reject {@link
* ViewFn ViewFns} that require materializations it does not support. See {@link Materializations}
* for known implementations. | 1 |
} catch (final UnsupportedCharsetException ex) { | 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.felix.serializer.test.prevayler;
public enum Command
{
clear,
remove,
put,
putAll;
} | 0 |
package org.apache.beam.sdk.extensions.sql.rel;
import org.apache.beam.sdk.extensions.sql.BeamSqlCli;
import org.apache.beam.sdk.extensions.sql.BeamSqlEnv;
import org.apache.beam.sdk.extensions.sql.TestUtils;
import org.apache.beam.sdk.extensions.sql.mock.MockedBoundedTable;
import org.apache.beam.sdk.extensions.sql.schema.BeamSqlRow; | 0 |
package aQute.bnd.osgi; | 0 |
public void testIsLdapEnabled_badConfiguration() {
EasyMock.expect(configuration.isLdapConfigured()).andReturn(true);
EasyMock.expect(populator.loadLdapTemplate().list(EasyMock. <String>anyObject())).andThrow(new NullPointerException()).once();
EasyMock.replay(populator.loadLdapTemplate(), configuration);
Assert.assertFalse(populator.isLdapEnabled());
EasyMock.verify(populator.loadLdapTemplate(), configuration);
EasyMock.expect(configuration.isLdapConfigured()).andReturn(true);
EasyMock.replay(populator.loadLdapTemplate(),configuration);
EasyMock.verify(populator.loadLdapTemplate(), configuration);
EasyMock.expect(configuration.isLdapConfigured()).andReturn(false);
EasyMock.replay(populator.loadLdapTemplate(), configuration);
EasyMock.verify(populator.loadLdapTemplate(), configuration); | 0 |
* @version $Revision: 1.13 $ $Date: 2004/03/27 17:47:34 $
throw new SQLException("ResultSet is closed."); | 0 |
private final String src; | 0 |
import org.apache.accumulo.core.client.sample.SamplerConfiguration; | 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 |
this.verifyReferences(); | 0 |
import java.io.Serializable;
public class VerhoeffCheckDigit implements CheckDigit, Serializable { | 0 |
public synchronized void close() throws IOException {
try {
close();
} catch(IOException e) {
throw new RuntimeException("Failed (" + e.getClass().getSimpleName() + ") to close agent: " + e.getMessage(), e);
} | 0 |
* Thrown by executors at flow submission time when an invalid flow set up is detected, requiring
* the user to explicitly provide a windowing strategy to a certain operator. | 0 |
package org.apache.atlas.web.listeners;
import org.apache.atlas.security.BaseSecurityTest;
config.setProperty("atlas.authentication.method", "kerberos");
config.setProperty("atlas.authentication.principal", "[email protected]");
config.setProperty("atlas.authentication.keytab", keytab.getAbsolutePath()); | 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 | 0 |
package com.twitter.aurora.scheduler.state;
import java.util.Set;
import com.google.inject.Binder;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.TypeLiteral;
import com.twitter.aurora.scheduler.events.PubsubEvent;
import com.twitter.aurora.scheduler.events.PubsubEventModule;
import com.twitter.common.application.StartupStage;
import com.twitter.common.base.Closure;
import com.twitter.common.base.ExceptionalCommand;
/**
* A convenience utility for unit tests that which to verify pubsub wiring.
* TODO(wfarner): Clean this up - make it integrate more cleanly with callers and LifecycleModule.
*/
final class PubsubTestUtil {
private PubsubTestUtil() {
// Utility class.
}
/**
* Installs the pubsub system on the given binder.
*
* @param binder Binder to install pubsub system onto.
*/
static void installPubsub(Binder binder) {
PubsubEventModule.installForTest(binder);
}
/**
* Starts the pubsub system and gets a handle to the event sink where pubsub events may be sent.
*
* @param injector Injector where the pubsub system was installed.
* @return The pubsub event sink.
* @throws Exception If the pubsub system failed to start.
*/
static Closure<PubsubEvent> startPubsub(Injector injector) throws Exception {
// TODO(wfarner): Make it easier to write a unit test wired for pubsub events.
// In this case, a trade-off was made to avoid installing several distant modules and providing
// required bindings that seem unrelated from this code.
Set<ExceptionalCommand> startupCommands = injector.getInstance(
Key.get(new TypeLiteral<Set<ExceptionalCommand>>() { }, StartupStage.class));
for (ExceptionalCommand command : startupCommands) {
command.execute();
}
return injector.getInstance(Key.get(new TypeLiteral<Closure<PubsubEvent>>() { }));
}
} | 0 |
* 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/10/09 21:31:39 $ | 0 |
*
*
*
* <p>So that the same mechanism used for parsing an <i>input</i> value
* <code>format()</code> methods are also provided. That is you can
private static final long serialVersionUID = 5867946581318211330L;
*
*
* @param strict <code>true</code> if strict
* <code>Locale</code>.
* specified <i>pattern</i>.
* specified <code>Locale</code>.
* specified pattern and/ or <code>Locale</code>.
*
*
*
*
*
*
*
* @return The validated/converted <code>Double</code> value if valid | 0 |
return Pipeline.create(opts); | 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.woody.datatype;
/**
* Description of Sex.
* @version CVS $Id: Sex.java,v 1.1 2004/03/09 10:33:58 reinhard Exp $
*/
public class Sex {
public static final Sex MALE = new Sex("M");
public static final Sex FEMALE = new Sex("F");
private String code;
private Sex(String code) { this.code = code; }
public String toString() {
// Will probably have some i18n support here
switch(code.charAt(0)) {
case 'M' : return this.getClass().getName() + ".MALE";
case 'F' : return this.getClass().getName() + ".FEMALE";
default : return "unknown"; // Should never happen
}
}
} | 0 |
import java.util.HashMap;
import java.util.Map;
public class MITKerberosOperationHandlerTest extends KerberosOperationHandlerTest {
private static final Map<String, String> KERBEROS_ENV_MAP = new HashMap<String, String>() {
{
put(MITKerberosOperationHandler.KERBEROS_ENV_ENCRYPTION_TYPES, null);
}
};
handler.open(new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD, null), DEFAULT_REALM, KERBEROS_ENV_MAP);
handler.open(new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD, null), DEFAULT_REALM, KERBEROS_ENV_MAP);
handler.open(new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD, null), DEFAULT_REALM, KERBEROS_ENV_MAP);
handler.open(new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD, null), DEFAULT_REALM, KERBEROS_ENV_MAP);
handler.open(new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD, null), DEFAULT_REALM, KERBEROS_ENV_MAP);
handler.open(new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD, null), DEFAULT_REALM, KERBEROS_ENV_MAP);
handler.open(new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD, null), DEFAULT_REALM, KERBEROS_ENV_MAP);
handler.open(new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD, null), DEFAULT_REALM, KERBEROS_ENV_MAP);
handler.open(new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD, null), DEFAULT_REALM, KERBEROS_ENV_MAP);
handler.open(new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD, null), DEFAULT_REALM, KERBEROS_ENV_MAP);
handler.open(credentials, realm, KERBEROS_ENV_MAP); | 0 |
import org.apache.batik.ext.awt.g2d.GraphicContext;
| 0 |
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkNotNull;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.MoreObjects; | 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 | 0 |
* Copyright 2000-2009 The Apache Software Foundation | 0 |
package org.apache.felix.sigil.ui.eclipse.ui.editors.project;
import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
import org.apache.felix.sigil.model.IModelElement;
import org.apache.felix.sigil.model.ModelElementFactory;
import org.apache.felix.sigil.model.eclipse.ISigilBundle;
import org.apache.felix.sigil.model.osgi.IPackageImport;
import org.apache.felix.sigil.model.osgi.IPackageModelElement;
import org.apache.felix.sigil.ui.eclipse.ui.form.SigilPage;
import org.apache.felix.sigil.ui.eclipse.ui.util.DefaultTableProvider;
import org.apache.felix.sigil.ui.eclipse.ui.util.ResourcesDialogHelper; | 0 |
import java.io.IOException;
import java.util.Arrays;
import org.apache.accumulo.core.file.rfile.bcfile.Utils;
import org.apache.accumulo.core.security.crypto.CryptoUtils;
import org.apache.accumulo.core.security.crypto.impl.NoFileEncrypter;
import org.apache.hadoop.fs.FSDataInputStream;
printCryptoParams(path, fs);
/**
* Print the unencrypted parameters that tell the Crypto Service how to decrypt the file. This
* information is useful for debugging if and how a file was encrypted.
*/
private void printCryptoParams(Path path, FileSystem fs) {
byte[] noCryptoBytes = new NoFileEncrypter().getDecryptionParameters();
try (FSDataInputStream fsDis = fs.open(path)) {
long fileLength = fs.getFileStatus(path).getLen();
fsDis.seek(fileLength - 16 - Utils.Version.size() - (Long.BYTES));
long cryptoParamOffset = fsDis.readLong();
fsDis.seek(cryptoParamOffset);
byte[] cryptoParams = CryptoUtils.readParams(fsDis);
if (!Arrays.equals(noCryptoBytes, cryptoParams)) {
System.out.println("Encrypted with Params: "
+ Key.toPrintableString(cryptoParams, 0, cryptoParams.length, cryptoParams.length));
} else {
System.out.println("No on disk encryption detected.");
}
} catch (IOException ioe) {
log.error("Error reading crypto params", ioe);
}
} | 0 |
public static final String ATTRIBUTES_PROPERTY_KEY = "attributes";
public static final String RELATIONSHIP_ATTRIBUTES_PROPERTY_KEY = "relationshipAttributes";
if (isEntityType) {
attr = ((AtlasEntityType) structType).getRelationshipAttribute(attrName, null);
}
if (attr == null) {
LOG.warn("ignored unknown attribute {}.{}", structType.getTypeName(), attrName);
continue;
}
Map<String, Object> ret = null;
AtlasEntityType entityType = (structType instanceof AtlasEntityType) ? ((AtlasEntityType) structType) : null;
if (entityType != null) {
attr = entityType.getRelationshipAttribute(attrName, null);
}
if (attr == null) {
LOG.warn("ignored unknown attribute {}.{}", structType.getTypeName(), attrName);
continue;
} | 0 |
@Override
public TabletStateImpl clone() throws CloneNotSupportedException {
return (TabletStateImpl) super.clone();
} | 0 |
import java.io.File;
import org.apache.commons.beanutils.Converter;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.tools.ant.types.Reference;
static {
// register standard converters for Ant types
ConvertUtils.register(
new Converter() {
public Object convert(Class type, Object value) {
if ( value instanceof File ) {
return (File) value;
}
else if ( value != null ) {
String text = value.toString();
return new File( text );
}
return null;
}
},
File.class
);
ConvertUtils.register(
new Converter() {
public Object convert(Class type, Object value) {
if ( value instanceof Reference ) {
return (Reference) value;
}
else if ( value != null ) {
String text = value.toString();
return new Reference( text );
}
return null;
}
},
Reference.class
);
} | 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.http.cookie.ClientCookie;
import org.apache.http.cookie.CommonCookieAttributeHandler;
public class RFC2965CommentUrlAttributeHandler implements CommonCookieAttributeHandler {
@Override
public String getAttributeName() {
return ClientCookie.COMMENTURL_ATTR;
}
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestShortList.java,v 1.4 2003/10/02 22:14:33 scolebourne Exp $
import org.apache.commons.collections.AbstractTestList;
* @version $Revision: 1.4 $ $Date: 2003/10/02 22:14:33 $
public abstract class TestShortList extends AbstractTestList { | 0 |
createTypeDefinitionsV1();
JSONObject response = atlasClientV1.callAPIWithBodyAndParams(AtlasClient.API.NAME_LINEAGE_INPUTS_GRAPH, null, salesMonthlyTable, "inputs", "graph");
String tableId = atlasClientV1.getEntity(HIVE_TABLE_TYPE, AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME,
JSONObject results = atlasClientV1.getInputGraphForEntity(tableId);
JSONObject response = atlasClientV1.callAPIWithBodyAndParams(AtlasClient.API.NAME_LINEAGE_OUTPUTS_GRAPH, null, salesFactTable, "outputs", "graph");
String tableId = atlasClientV1.getEntity(HIVE_TABLE_TYPE, AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME,
JSONObject results = atlasClientV1.getOutputGraphForEntity(tableId);
JSONObject response = atlasClientV1.callAPIWithBodyAndParams(AtlasClient.API.NAME_LINEAGE_SCHEMA, null, salesFactTable, "schema");
String tableId = atlasClientV1.getEntity(HIVE_TABLE_TYPE, AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, salesFactTable).getId()._getId();
JSONObject results = atlasClientV1.getSchemaForEntity(tableId);
JSONObject response = atlasClientV1.callAPIWithBodyAndParams(AtlasClient.API.NAME_LINEAGE_SCHEMA, null, "blah", "schema");
JSONObject response = atlasClientV1.callAPIWithBodyAndParams(AtlasClient.API.NAME_LINEAGE_SCHEMA, null, salesDBName, "schema");
referenceable.set(NAME, name);
referenceable.set(QUALIFIED_NAME, name);
referenceable.set(CLUSTER_NAME, locationUri + name);
referenceable.set(NAME, name);
referenceable.set(QUALIFIED_NAME, name); | 0 |
@SuppressWarnings("unchecked")
Class<T> clazz = (Class<T>) parameter;
throw new RuntimeException(
String.format("Unable to automatically infer a Coder for "
+ "the Kafka Deserializer %s: no coder registered for type %s",
deserializer, clazz));
throw new RuntimeException(
String.format("Could not extract the Kafaka Deserializer type from %s",
deserializer));
"Key coder must be inferable from input or set using readWithCoders");
"Value coder must be inferable from input or set using readWithCoders"); | 0 |
import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public void testRunFirstOutboundSignatureTimePerformance() throws Exception {
public void testRunSecondInboundSignatureTimePerformance() throws Exception {
public void testRunFirstOutboundEncryptionTimePerformance() throws Exception {
public void testRunSecondInboundDecryptionTimePerformance() throws Exception { | 0 |
import org.apache.sshd.common.FactoryManagerUtils;
channel.open().verify(FactoryManagerUtils.getLongProperty(this.service.getSession(), CHANNEL_OPEN_TIMEOUT_PROP, DEFAULT_CHANNEL_OPEN_TIMEOUT)); | 0 |
visitor.visitPrimitiveTransform(node); | 0 |
// Use %40 for @ in a URL | 0 |
.setName(JobKeys.canonicalString(Tasks.ASSIGNED_TO_JOB_KEY.apply(task))) | 0 |
import java.util.concurrent.CopyOnWriteArrayList;
import org.osgi.framework.ServiceReference;
private final List<ProxyConfiguration> proxyConfigurations = new CopyOnWriteArrayList<>();
new HttpClientBuilderConfigurator(context, proxyConfigurations, trustedHostConfiguration);
proxyConfigurations.add(proxyConfiguration);
final ServiceRegistration<ProxyConfiguration> registration = registeredConfigurations.remove(pid);
if (registration != null) {
final ServiceReference<ProxyConfiguration> ref = registration.getReference();
final ProxyConfiguration config = context.getService(ref);
proxyConfigurations.remove(config);
context.ungetService(ref);
safeUnregister(registration); | 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 |
// For VFS-412
// private static final String PROT =
*
// For VFS-412
// * | 0 |
import org.apache.aurora.scheduler.async.preemptor.BiCache.BiCacheSettings;
import org.apache.aurora.scheduler.async.preemptor.PreemptionSlotFinder.PreemptionSlot;
import org.apache.aurora.scheduler.base.TaskGroupKey;
bind(BiCacheSettings.class).toInstance(
new BiCacheSettings(PREEMPTION_SLOT_HOLD_TIME.get(), "preemption_slot_cache_size"));
bind(new TypeLiteral<BiCache<PreemptionSlot, TaskGroupKey>>() { }).in(Singleton.class); | 0 |
import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
bind(HostRoleCommandDAO.class).toInstance(createNiceMock(HostRoleCommandDAO.class)); | 0 |
* Returns a copy of the current {@link Reiterator}. The copy's iteration state is logically
* independent of the current iterator; each may be advanced without affecting the other.
* <p>The returned {@code Reiterator} is not guaranteed to return referentially identical
* iteration results as the original {@link Reiterator}, although {@link Object#equals} will
* typically return true for the corresponding elements of each if the original source is | 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
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT 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 |
* CVS $Id: AbstractContainerWidget.java,v 1.4 2004/02/04 17:25:57 sylvain Exp $
public AbstractContainerWidget(AbstractWidgetDefinition definition) {
// Validate self only if child widgets are valid
if (widgets.validate(formContext)) {
return super.validate(formContext);
} else {
return false;
} | 0 |
public static final String GANGLIA_HTTPS_KEY = "ganglia.https";
public static final String NAGIOS_HTTPS_KEY = "nagios.https";
* Get the property value for the given key.
*
* @return the property value
*/
public String getProperty(String key) {
return properties.getProperty(key);
}
/**
protected void loadSSLParams(){ | 0 |
public static enum TestCounts {
PASS, FAIL, ERROR
}
context.getCounter(TestCounts.ERROR);
context.getCounter(TestCounts.PASS);
context.getCounter(TestCounts.FAIL); | 0 |
@Description("Max records per micro-batch. For streaming sources only.")
@Default.Long(-1)
Long getMaxRecordsPerBatch();
void setMaxRecordsPerBatch(Long maxRecordsPerBatch);
| 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.