Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
/**
*
* @version CVS $Id: FOM_WebContinuation.java,v 1.3 2004/01/22 16:53:57 vgritsenko Exp $
*/
pwk.setPrototype(getClassPrototype(getParentScope(),
NativeArray arr =
cwk.setPrototype(getClassPrototype(getParentScope(),
FOM_Cocoon cocoon =
ComponentManager componentManager =
public void jsFunction_display() {
wk.display();
}
| 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.commons.fileupload.servlet;
import javax.servlet.ServletContextListener;
import javax.servlet.ServletContextEvent;
import org.apache.commons.io.FileCleaner;
/**
* A servlet context listener, which ensures that the
* {@link org.apache.commons.io.FileCleaner FileCleaner's} reaper thread is terminated,
* when the web application is destroyed.
*/
public class FileCleanerCleanup implements ServletContextListener {
/**
* Called when the web application is initialized. Does
* nothing.
* @param sce The servlet context (ignored).
*/
public void contextInitialized(ServletContextEvent sce) {
// Does nothing.
}
/**
* Called when the web application is being destroyed.
* Calls {@link FileCleaner#exitWhenFinished()}.
* @param sce The servlet context (ignored).
*/
public void contextDestroyed(ServletContextEvent sce) {
FileCleaner.exitWhenFinished();
}
} | 0 |
/**
* Stores the path to the server actions folder which contains server actions jars for the given service.
*/
@XmlTransient
private File serverActionsFolder;
public File getServerActionsFolder() {
return serverActionsFolder;
}
public void setServerActionsFolder(File serverActionsFolder) {
this.serverActionsFolder = serverActionsFolder;
}
| 0 |
*
* <p>Please see 'build_rules.gradle' file for instructions regarding | 0 |
import org.apache.atlas.repository.Constants;
import org.apache.commons.configuration.Configuration;
private HttpServletRequest httpServletRequest;
private final int maxFullTextQueryLength;
private final int maxDslQueryLength;
public DiscoveryREST(AtlasDiscoveryService atlasDiscoveryService, Configuration configuration) {
this.atlasDiscoveryService = atlasDiscoveryService;
maxFullTextQueryLength = configuration.getInt(Constants.MAX_FULLTEXT_QUERY_STR_LENGTH, 4096);
maxDslQueryLength = configuration.getInt(Constants.MAX_DSL_QUERY_STR_LENGTH, 4096);
if (StringUtils.isNotEmpty(query) && query.length() > maxDslQueryLength) {
throw new AtlasBaseException(AtlasErrorCode.INVALID_QUERY_LENGTH, Constants.MAX_DSL_QUERY_STR_LENGTH);
}
// Validate FullText query for max allowed length
if(StringUtils.isNotEmpty(query) && query.length() > maxFullTextQueryLength){
throw new AtlasBaseException(AtlasErrorCode.INVALID_QUERY_LENGTH, Constants.MAX_FULLTEXT_QUERY_STR_LENGTH );
}
if (StringUtils.isNotEmpty(query) && query.length() > maxFullTextQueryLength) {
throw new AtlasBaseException(AtlasErrorCode.INVALID_QUERY_LENGTH, Constants.MAX_FULLTEXT_QUERY_STR_LENGTH);
}
if (StringUtils.isNotEmpty(parameters.getQuery()) && parameters.getQuery().length() > maxFullTextQueryLength) {
throw new AtlasBaseException(AtlasErrorCode.INVALID_QUERY_LENGTH, Constants.MAX_FULLTEXT_QUERY_STR_LENGTH);
}
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//fileupload/src/java/org/apache/commons/fileupload/MultipartStream.java,v 1.11 2003/04/27 17:30:06 martinc Exp $
* $Revision: 1.11 $
* $Date: 2003/04/27 17:30:06 $
import java.io.ByteArrayOutputStream;
* @version $Id: MultipartStream.java,v 1.11 2003/04/27 17:30:06 martinc Exp $
*
*
*
*
*
*
*
/**
* Returns a string representation of this object.
*
* @return The string representation of this object.
*/
public String toString()
{
StringBuffer sbTemp = new StringBuffer();
sbTemp.append("boundary='");
sbTemp.append(String.valueOf(boundary));
sbTemp.append("'\nbufSize=");
sbTemp.append(bufSize);
return sbTemp.toString();
} | 1 |
public static <T> Factory<T> constantFactory(final T constantToReturn) {
public ConstantFactory(final T constantToReturn) { | 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 |
boolean debugEnabled = log.isDebugEnabled();
if (debugEnabled) {
if (debugEnabled) { | 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 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ShortArrayList.java,v 1.2 2002/08/13 19:41:36 pjack Exp $
* $Revision: 1.2 $
* $Date: 2002/08/13 19:41:36 $
* A list of <Code>short</Code> elements.
*
* @version $Revision: 1.2 $ $Date: 2002/08/13 19:41:36 $
/**
* Constructs a new <Code>ShortArrayList</CodE> with a default initial
* capacity.
*/
/**
* Constructs a new <Code>ShortArrayList</CodE> with the given initial
* capacity.
*
* @param capacity the initial capacity for the array
* @throws IllegalArgumentException if the capacity is less than or
* equal to zero
*/
if (capacity <= 0) {
throw new IllegalArgumentException("capacity=" + capacity);
} | 0 |
} else if (sumLength >= FIVE && sumLength <= SEVEN) {
} else if (sumLength >= EIGHT && sumLength <= ELEVEN) {
name1LtREnd = name1.substring(name1Size - i, name1Size - i + 1);
name2RtLEnd = name2.substring(name2Size - i, name2Size - i + 1);
return firstLetter + name; | 0 |
return new XMLSecStartDocumentImpl(systemId, xmlStreamReader.getCharacterEncodingScheme(), | 0 |
import java.util.Collections;
import org.apache.accumulo.examples.wikisearch.sample.Field;
table.setUnevaluatedFields(Collections.singletonList("TEXT"));
results = table.runQuery(c, auths, "TEXT == 'abacus'", null, null, null);
docs = results.getResults();
assertEquals(1, docs.size());
for (Document doc : docs) {
System.out.println("id: " + doc.getId());
for (Field field : doc.getFields())
System.out.println(field.getFieldName() + " -> " + field.getFieldValue());
} | 0 |
volatile boolean finished = false;
@Override
finished = true;
queuedRequests.clear(); | 0 |
columnFamilies = new HashSet<>(columnFamilies);
columnFamilies = new HashSet<>(columnFamilies); | 0 |
private Manifest m_manifest;
m_manifest = new Manifest();
m_manifest.read(is);
return m_manifest; | 0 |
/**
* Tests the clone() method.
*/
public void testClone()
{
Configuration c = (Configuration) conf.clone();
assertTrue(c instanceof XMLConfiguration);
XMLConfiguration copy = (XMLConfiguration) c;
assertNotNull(conf.getDocument());
assertNull(copy.getDocument());
assertNotNull(conf.getFileName());
assertNull(copy.getFileName());
} | 0 |
* Check if <code>request(profileName)</code> will return with a ICCColorSpaceExt
* Check if <code>request(profileName)</code> will return immediately with the | 0 |
new HashMap<>(); | 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.servicemix.kernel.jaas.config.impl;
import java.util.Map;
/**
* POJO for a login module.
* It contains the class name, flags and a map of options.
*/
public class Module {
private String className;
private String flags;
private Map<String,String> options;
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getFlags() {
return flags;
}
public void setFlags(String flags) {
this.flags = flags;
}
public Map<String, String> getOptions() {
return options;
}
public void setOptions(Map<String, String> options) {
this.options = options;
}
} | 0 |
PublicKeyEntry keyEntry = PublicKeyEntry.parsePublicKeyEntry(KEY_STRING);
key = keyEntry.resolvePublicKey(null, PublicKeyEntryResolver.FAILING); | 0 |
buffer.putInt(0); // reserve space for actual packet length | 0 |
* <p/>
* The following parameters can be used to customize the behavior of this
* class:
* <ul>
* <li>{@link org.apache.http.params.CoreProtocolPNames#HTTP_ELEMENT_CHARSET}</li>
* <li>{@link org.apache.http.params.CoreConnectionPNames#TCP_NODELAY}</li>
* <li>{@link org.apache.http.params.CoreConnectionPNames#SO_TIMEOUT}</li>
* <li>{@link org.apache.http.params.CoreConnectionPNames#SO_LINGER}</li>
* <li>{@link org.apache.http.params.CoreConnectionPNames#SOCKET_BUFFER_SIZE}</li>
* <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_LINE_LENGTH}</li>
* </ul> | 0 |
interface ProxyListener extends EventListener {
static class ProxyListenerImpl implements ProxyListener { | 0 |
"duration, " +
" (?, ?, ?, ?, ?, ?, 0, ?, 0)"
"lastUpdateTime = ?, " +
"duration = ? - (SELECT startTime FROM " +
WORKFLOW_TABLE +
" WHERE workflowId = ?) " +
"WITH sums as (SELECT sum(inputBytes) as input, " +
"sum(outputBytes) as output, workflowId FROM " +
JOB_TABLE +
" WHERE workflowId = (SELECT workflowId FROM " +
JOB_TABLE +
" WHERE jobId = ?) AND status = 'SUCCESS'" +
" GROUP BY workflowId) " +
"UPDATE " +
"duration = ? - (SELECT startTime FROM " +
WORKFLOW_TABLE +
" WHERE workflowId = (SELECT workflowId FROM sums)), " +
"numJobsCompleted = numJobsCompleted + 1, " +
"inputBytes = (select input from sums), " +
"outputBytes = (select output from sums) " +
"WHERE workflowId = (select workflowId from sums)"
processJobFinishedEvent(entityPS, workflowUpdateNumCompletedPS,
processJobStatusChangedEvent(entityPS,
workflowUpdateTimePS.setLong(2, historyEvent.getSubmitTime());
workflowUpdateTimePS.setString(3, workflowContext.getWorkflowId());
workflowUpdateTimePS.setString(4, workflowContext.getWorkflowId());
PreparedStatement workflowUpdateNumCompletedPS,
// job finished events always have success status
workflowUpdateNumCompletedPS.setString(1, historyEvent.getJobid().toString());
workflowUpdateNumCompletedPS.setLong(2, historyEvent.getFinishTime());
workflowUpdateNumCompletedPS.setLong(3, historyEvent.getFinishTime());
workflowUpdateNumCompletedPS.executeUpdate(); | 0 |
private static final State THROTTLED = State.create(ScheduleStatus.THROTTLED);
final Closure<Transition<State>> deleteIfKilling =
Closures.filter(Transition.to(KILLING), addWorkClosure(WorkCommand.DELETE));
.to(PENDING, THROTTLED, UNKNOWN))
.withCallback(deleteIfKilling))
.addState(
Rule.from(THROTTLED)
.to(PENDING, KILLING)
.withCallback(deleteIfKilling))
private synchronized boolean updateState( | 0 |
import org.apache.hc.core5.http.nio.support.BasicRequestProducer;
import org.apache.hc.core5.http.nio.support.BasicResponseConsumer; | 0 |
LOG.warn("Exception occurred from thread {}", thName, e); | 0 |
// Manage the No Value case.
return prop.onGet(pojo, fieldName, value); | 0 |
return doVerify(encoded); | 0 |
if(null != mt.messages && !mt.messages.isEmpty()){
for(int i = 0; i < mt.messages.size(); i++){
String message = mt.messages.get(i);
message = tokenReplace(ctx, message, taskWrapper.getService(), taskWrapper.getComponent());
mt.messages.set(i, message);
} | 0 |
.apply(Combine.perKey(new MultiStepCombineFn()));
.apply(Window.into(windowFn))
.apply(Combine.perKey(new MultiStepCombineFn()));
.apply(Combine.perKey(new MultiStepCombineFn())); | 0 |
*/
public ISHL() {
super(org.apache.bcel.Constants.ISHL);
}
/**
* Call corresponding visitor method(s). The order is:
* Call visitor methods of implemented interfaces first, then
* call methods according to the class hierarchy in descending order,
* i.e., the most specific visitXXX() call comes last.
*
* @param v Visitor object
*/
public void accept( Visitor v ) {
v.visitTypedInstruction(this);
v.visitStackProducer(this);
v.visitStackConsumer(this);
v.visitArithmeticInstruction(this);
v.visitISHL(this);
} | 0 |
*
* @throws IllegalArgumentException if the uri is invalid.
| 0 |
name = SystemReadyServlet.PID,
public static final String PID = "org.apache.felix.systemready.impl.servlet.SystemReadyServlet";
| 0 |
final WritableByteChannel channel,
| 0 |
import com.google.api.services.bigquery.model.TableFieldSchema;
import com.google.api.services.bigquery.model.TableReference;
import com.google.api.services.bigquery.model.TableRow;
import com.google.api.services.bigquery.model.TableSchema;
import com.google.common.collect.Lists;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import org.apache.avro.reflect.Nullable; | 0 |
* @version $Id$ | 0 |
import org.apache.aurora.scheduler.base.Tasks;
import static org.apache.aurora.scheduler.TaskVars.rackStatName;
ScheduledTask task = new ScheduledTask()
.setOwner(new Identity(ROLE_A, ROLE_A + "-user"))));
if (Tasks.SLAVE_ASSIGNED_STATES.contains(status) || Tasks.isTerminated(status)) {
task.getAssignedTask().setSlaveHost(host);
}
return IScheduledTask.build(task);
IScheduledTask taskA = makeTask(JOB_A, INIT);
expectGetHostRack("hostA", "rackA").atLeastOnce();
expectStatExport(rackStatName("rackA"));
changeState(makeTask(JOB_A, INIT), PENDING);
taskA = makeTask(JOB_A, ASSIGNED, "hostA");
assertEquals(0, getValue(rackStatName("rackA")));
expectGetHostRack("hostA", "rackA").atLeastOnce();
expectGetHostRack("hostB", "rackB").atLeastOnce();
expectStatExport(rackStatName("rackA"));
expectStatExport(rackStatName("rackB"));
makeTask(JOB_A, RUNNING, "hostA"),
makeTask(JOB_A, FINISHED, "hostA"),
makeTask(JOB_B, FAILED, "hostB"));
assertEquals(0, getValue(rackStatName("rackA")));
assertEquals(0, getValue(rackStatName("rackB")));
expectStatExport(rackStatName("rackA"));
expectStatExport(rackStatName("rackB"));
assertEquals(2, getValue(rackStatName("rackA")));
assertEquals(2, getValue(rackStatName("rackB"))); | 0 |
import org.apache.ambari.logsearch.util.SolrUtil;
import org.apache.solr.schema.TextField;
@Autowired
SolrUtil solrUtil;
String typeXAxis = solrDaoBase.schemaFieldsNameMap.get(xAxisField);
return rangeStackGraph(xAxisField, stackField, from, to, unit, solrDaoBase, solrQuery);
if (solrUtil.isSolrFieldNumber(typeXAxis,solrDaoBase)) {
if (solrUtil.isSolrFieldNumber(typeXAxis,solrDaoBase)) {
private VBarDataList rangeStackGraph(String xAxisField, String stackField,
String from, String to, String unit, SolrDaoBase solrDaoBase, | 0 |
log.debug("Waiting {}ms before starting main replication loop", millisToWait); | 0 |
Predicate predicate = new LessPredicate(propertyId, 10);
resource.setProperty(propertyId, 1);
resource.setProperty(propertyId, 100);
resource.setProperty(propertyId, 10);
LessPredicate predicate = new LessPredicate(propertyId, 1); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/Functions.java,v 1.4 2003/01/11 05:41:22 dmitri Exp $
* $Revision: 1.4 $
* $Date: 2003/01/11 05:41:22 $
* {@link ClassFunctions ClassFunctions} and
* {@link PackageFunctions PackageFunctions}
* @version $Revision: 1.4 $ $Date: 2003/01/11 05:41:22 $ | 1 |
final Candidate masterCandidate = new Candidate(masterGroup);
masterCandidate.watchLeader(new Candidate.LeaderChangeListener() {
@Override public void onLeaderChange(String leaderId) {
LOG.info("Received notification of nexus master group change: " + leaderId);
}
});
nexusMaster = masterCandidate.getLeaderId();
} catch (Group.WatchException e) {
LOG.log(Level.SEVERE, "Failed to watch master server set for leader changes.", e); | 0 |
* $Revision: 1.11 $
* $Date: 2003/10/26 17:18:11 $
import org.apache.commons.dbcp.datasources.TestFactory;
* @version $Revision: 1.11 $ $Date: 2003/10/26 17:18:11 $
suite.addTest(TestFactory.suite()); | 0 |
package org.apache.commons.ognl;
* http://www.apache.org/licenses/LICENSE-2.0
import java.util.Enumeration;
import java.util.Iterator; | 0 |
* can be invoked in order to start/register (or stop/unregister) a Service at any time. When this annotation
* Runnable starter
*
* @LifecycleController(start=false)
* Runnable stopper
* // start our "Z" service (our "start" method will be called, juste before service registration
* starter.run();
*
* sleep(2000);
* // now, stop/unregister the "Z" service (we'll then be called in our stop() method
* stopper.run();
* // This method will be called after we invoke our starter Runnable, and our service will be
* @Stop
* public void stop() {
* // This method will be called after we invoke our "stop" Runnable, and our service will be
* // unregistered after our method returns, as in normal case. Notice that the service won't
* // be destroyed here, and the "starter" runnable can be re-invoked later.
* } | 0 |
@Deprecated
| 0 |
void killTasks(Query.Builder query, String user); | 0 |
/*
Collection<String> roles = autoInstanceConfig.getRoles();
setViewInstanceRoleAccess(viewInstanceEntity, roles);
* Set access to the a particular view instance based on a set of roles.
* <p>
* View access to the specified view instances will be granted to anyone directly or indirectly
* assigned to one of the roles in the suppled set of role names.
*
* @param viewInstanceEntity a view instance entity
* @param roles the set of roles to use to for granting access
protected void setViewInstanceRoleAccess(ViewInstanceEntity viewInstanceEntity, Collection<String> roles) {
if ((roles != null) && !roles.isEmpty()) {
PermissionEntity permissionViewUser = permissionDAO.findViewUsePermission();
if (permissionViewUser == null) {
LOG.error("Missing the {} role. Access to view cannot be set.",
PermissionEntity.VIEW_USER_PERMISSION_NAME, viewInstanceEntity.getName());
} else {
for (String role : roles) {
PermissionEntity permissionRole = permissionDAO.findByName(role);
if (permissionRole == null) {
LOG.warn("Invalid role {} encountered while setting access to view {}, Ignoring.",
role, viewInstanceEntity.getName());
} else {
PrincipalEntity principalRole = permissionRole.getPrincipal();
if (principalRole == null) {
LOG.warn("Missing principal ID for role {} encountered while setting access to view {}. Ignoring.",
role, viewInstanceEntity.getName());
} else {
PrivilegeEntity privilegeEntity = new PrivilegeEntity();
privilegeEntity.setPermission(permissionViewUser);
privilegeEntity.setPrincipal(principalRole);
privilegeEntity.setResource(viewInstanceEntity.getResource());
privilegeDAO.create(privilegeEntity);
}
}
}
} | 0 |
private String activate;
private String deactivate;
private String modified;
public String getActivate() {
public void setActivate(String activate) {
public String getDeactivate() {
public void setDeactivate(String deactivate) {
public String getModified() {
public void setModified(String modified) {
public void setSpecVersion(final SpecVersion specVersion) {
if ( this.specVersion == null || this.specVersion.ordinal() < specVersion.ordinal() ) {
this.specVersion = specVersion;
} | 0 |
@Override
protected int defaultTimeoutSeconds() {
return 10 * 60;
}
@Test | 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 |
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 |
* {@code null} if the client is not yet ready to send a
* @return an HTTP request to be sent or {@code null} if no | 0 |
} else if (DatabaseConsistencyCheckHelper.ifWarningsFound()) {
System.out.println("Database consistency check: warning"); | 0 |
* <p>
* Spring namespace handler for the Cocoon servlet namespace (<code>http://cocoon.apache.org/schema/servlet</code>).
* The {@link ServletDecorator} deals with the implementation details.
* @version $Id: ServletNamespaceHandler.java 562806 2007-08-05 02:26:41Z
* vgritsenko $ | 0 |
System.out.println(instance.getStatus().getMessage());
| 0 |
/** Tests of InstanceBuilder. */
@Rule public ExpectedException expectedEx = ExpectedException.none();
TupleTag tag =
InstanceBuilder.ofType(TupleTag.class)
.fromClassName(InstanceBuilderTest.class.getName())
.fromFactoryMethod("createTag")
.withArg(String.class, "hello world!")
.build();
TupleTag tag =
InstanceBuilder.ofType(TupleTag.class).withArg(String.class, "hello world!").build();
expectedEx.expectMessage(Matchers.containsString("Unable to find factory method"));
expectedEx.expectMessage(Matchers.containsString("Unable to find factory method"));
expectedEx.expectMessage(Matchers.containsString("must be assignable to String"));
expectedEx.expectMessage(Matchers.containsString("must be assignable to TupleTag")); | 1 |
/*
* Copyright 2005 The Apache Software Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cocoon.core;
/**
* Throw this exception in the case that the wiring.xml is not found.
*
* @version SVN $Id$
*/
public class WiringNotFoundException extends RuntimeException {
public WiringNotFoundException(String message) {
super(message);
}
} | 0 |
private String fieldName;
public CompactionsType(String which) {
this.fieldName = which;
}
@Override
public String format(Object obj) {
if (obj == null) return "-";
TableInfo summary = (TableInfo) obj;
Compacting c = summary.major;
if (fieldName.equals("minor")) c = summary.minor;
else if (fieldName.equals("scans")) c = summary.scans;
if (c == null) c = new Compacting();
return String.format("%s (%,d)", NumberType.commas(c.running, c.queued == 0 ? 0 : 1, summary.onlineTablets), c.queued);
}
@Override
public int compare(TableInfo o1, TableInfo o2) {
if (o1 == null) return -1;
if (o2 == null) return 1;
Compacting c1 = o1.major;
Compacting c2 = o2.major;
if (fieldName.equals("minor")) {
c1 = o1.minor;
c2 = o2.minor;
} else if (fieldName.equals("scans")) {
c1 = o1.scans;
c2 = o2.scans;
if (c1 == null) return -1;
if (c2 == null) return 1;
return c1.running + c1.queued - c2.running - c2.queued;
}
@Override
public String alignment() {
return "right";
}
| 1 |
public static class DocumentURIResolver implements URIResolver { | 0 |
import org.apache.batik.ext.awt.image.Light; | 0 |
Object v1 = children[0].getValue( context, source );
Object v2 = children[1].getValue( context, source ); | 0 |
public Long lengthString(String str) {
public Long lengthBytes(byte[] bytes) {
public String reverseString(String str) {
public byte[] reverseBytes(byte[] bytes) { | 0 |
public static Object invokeCallbackMethod(Object instance, String methodName, Class[][] signatures, Object[][] parameters) throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
return invokeMethod(instance, currentClazz, methodName, signatures, parameters, false); | 0 |
* @throws IOException
* @throws IOException | 0 |
final class CallParamRule
extends AbstractXmlRule
{
public CallParamRule( RulesBinder targetRulesBinder, PatternStack patternStack )
{
super( targetRulesBinder, patternStack );
protected void bindRule( LinkedRuleBuilder linkedRuleBuilder, Attributes attributes )
throws Exception
{
int paramIndex = Integer.parseInt( attributes.getValue( "paramnumber" ) );
CallParamBuilder builder = linkedRuleBuilder.callParam().ofIndex( paramIndex );
String attributeName = attributes.getValue( "attrname" );
String fromStack = attributes.getValue( "from-stack" );
String stackIndex = attributes.getValue( "stack-index" );
if ( attributeName == null )
{
if ( stackIndex != null )
{
builder.withStackIndex( Integer.parseInt( stackIndex ) );
else if ( fromStack != null )
{
builder.fromStack( Boolean.valueOf( fromStack ).booleanValue() );
}
}
else
{
if ( fromStack == null )
{
builder.fromAttribute( attributeName );
}
else
{
throw new RuntimeException( "Attributes from-stack and attrname cannot both be present." ); | 0 |
package org.apache.cocoon.portal.profile;
public class ConverterException extends Exception { | 0 |
import java.net.InetAddress;
import org.apache.http.annotation.ThreadSafe;
import org.apache.http.conn.ClientConnectionOperator;
import org.apache.http.conn.DnsResolver;
import org.apache.http.conn.scheme.SchemeLayeredSocketFactory;
import org.apache.http.conn.socket.LayeredConnectionSocketFactory;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.protocol.HttpContext;
import org.apache.http.util.Args;
import org.apache.http.util.Asserts;
Args.notNull(schemes, "Scheme registry");
Args.notNull(schemes, "Scheme registry");
Args.notNull(dnsResolver, "DNS resolver");
Args.notNull(conn, "Connection");
Args.notNull(target, "Target host");
Args.notNull(params, "HTTP parameters");
Asserts.check(!conn.isOpen(), "Connection must not be open");
Args.notNull(conn, "Connection");
Args.notNull(target, "Target host");
Args.notNull(params, "Parameters");
Asserts.check(conn.isOpen(), "Connection must be open");
Asserts.check(schm.getSchemeSocketFactory() instanceof LayeredConnectionSocketFactory,
"Socket factory must implement SchemeLayeredSocketFactory"); | 0 |
import com.twitter.common.application.modules.LocalServiceRegistry; | 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.scr.annotations;
/**
* Options for {@link Property#unbounded()} property.
* @since 1.4
*/
public enum PropertyUnbounded {
/** Property is not unbounded. This is the default. */
DEFAULT,
/** Property is an unbounded array. */
ARRAY,
/** Property is an unbounded vector. */
VECTOR
} | 0 |
package org.apache.aurora.scheduler.storage.log;
import org.apache.aurora.codec.ThriftBinaryCodec;
import org.apache.aurora.codec.ThriftBinaryCodec.CodingException;
import org.apache.aurora.gen.storage.LogEntry;
import org.apache.aurora.gen.storage.LogEntry._Fields;
| 0 |
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkState;
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Optional;
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Predicate;
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Predicates;
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Strings;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.FluentIterable;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Maps; | 0 |
import org.apache.hc.core5.net.URIAuthority;
import org.apache.hc.core5.net.URIBuilder;
* Convenience factory method for {@link URI} instances.
*
* @since 5.0
*/
public static URI create(final HttpHost host, final String path) throws URISyntaxException {
final URIBuilder builder = new URIBuilder(path);
if (host != null) {
builder.setHost(host.getHostName()).setPort(host.getPort()).setScheme(host.getSchemeName());
}
return builder.build();
}
/**
* Convenience factory method for {@link URI} instances.
*
* @since 5.0
*/
public static URI create(final String scheme, final URIAuthority host, final String path) throws URISyntaxException {
final URIBuilder builder = new URIBuilder(path);
if (scheme != null) {
builder.setScheme(scheme);
}
if (host != null) {
builder.setHost(host.getHostName()).setPort(host.getPort());
}
return builder.build();
}
/** | 0 |
import org.apache.http.HttpResponse;
protected void doService(final HttpRequest request, final HttpResponse response) | 0 |
package org.apache.atlas.model;
import org.apache.atlas.model.SearchFilter.SortType;
import javax.xml.bind.annotation.XmlRootElement;
* Paginated-list, for returning search results.
@XmlRootElement
public PList(List<T> list) {
this(list, 0, list.size(), list.size(), SortType.NONE, null);
}
public void setList(List<T> list) { this.list = list; }
public List<T> getList() { return this.list; }
sb.append("PList{");
sb.append("listSize=").append((list == null ? 0 : list.size()));
sb.append(", sortBy=").append(sortBy); | 0 |
Map<String, Map<String, String>> userProvidedProperties = getUserProvidedProperties(topology, existingConfigurations);
blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes())); | 0 |
package org.apache.xml.security.test.dom.c14n.implementations; | 0 |
import java.util.Map;
import java.util.TreeMap;
Map<String, String> headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
headers.put(hdrName, hdrValue);
return loadKeyPairs(session, resourceKey, pubLines, prvLines, prvEncryption, passwordProvider, headers);
FilePasswordProvider passwordProvider, Map<String, String> headers)
prvEncryption, passwordProvider, headers);
FilePasswordProvider passwordProvider, Map<String, String> headers)
return loadKeyPairs(resourceKey, pubBytes, prvBytes, headers);
keys = loadKeyPairs(resourceKey, pubBytes, decBytes, headers);
public Collection<KeyPair> loadKeyPairs(
NamedResource resourceKey, byte[] pubData, byte[] prvData, Map<String, String> headers)
throws IOException, GeneralSecurityException {
return loadKeyPairs(resourceKey, pubStream, prvStream, headers);
public Collection<KeyPair> loadKeyPairs(
NamedResource resourceKey, InputStream pubData, InputStream prvData, Map<String, String> headers)
throws IOException, GeneralSecurityException {
return loadKeyPairs(resourceKey, pubReader, prvReader, headers);
public abstract Collection<KeyPair> loadKeyPairs(
NamedResource resourceKey, PuttyKeyReader pubReader, PuttyKeyReader prvReader, Map<String, String> headers) | 0 |
import org.apache.beam.runners.core.TimerInternals.TimerData; | 0 |
import org.apache.accumulo.core.client.AccumuloClient;
AccumuloClient c = getAccumuloClient();
AccumuloClient c = getAccumuloClient(); | 0 |
return ZeroArgsAdapter.INSTANCE;
* If SQL aggregation call doesn't have actual arguments, we pass an empty row to it.
*
* <p>This is for cases like COUNT(1) which doesn't take any arguments, or COUNT(*) that is a
* special case that returns the same result. In both of these cases we should count all Rows no
* matter whether they have NULLs or not.
* <p>This is a special case of the MultiArgsAdapter below.
private static final Schema EMPTY_SCHEMA = Schema.builder().build();
private static final Row EMPTY_ROW = Row.withSchema(EMPTY_SCHEMA).build();
private static final Coder<Row> EMPTY_ROW_CODER = SchemaCoder.of(EMPTY_SCHEMA);
static final ZeroArgsAdapter INSTANCE = new ZeroArgsAdapter();
return EMPTY_ROW;
return EMPTY_ROW_CODER; | 0 |
private static final String SLAVE_ID = OFFER.getOffer().getSlaveId().getValue();
expectPreemptorCall(TASK_A, Optional.of(SLAVE_ID));
expectPreemptorCall(TASK_B, Optional.<String>absent());
expectPreemptorCall(TASK_A, Optional.of(SLAVE_ID));
expectPreemptorCall(TASK_A, Optional.of(SLAVE_ID));
expectPreemptorCall(TASK_A, Optional.of(SLAVE_ID));
expectPreemptorCall(TASK_B, Optional.of(SLAVE_ID));
private void expectPreemptorCall(IScheduledTask task, Optional<String> result) {
expect(preemptor.attemptPreemptionFor(
task.getAssignedTask(),
emptyJob,
storageUtil.mutableStoreProvider)).andReturn(result);
}
private void expectActiveJobFetch(IScheduledTask task) {
Query.jobScoped(Tasks.SCHEDULED_TO_JOB_KEY.apply(task))
.byStatus(Tasks.SLAVE_ASSIGNED_STATES), | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/XMLDocumentContainer.java,v 1.4 2002/04/26 03:28:36 dmitri Exp $
* $Revision: 1.4 $
* $Date: 2002/04/26 03:28:36 $
* @version $Revision: 1.4 $ $Date: 2002/04/26 03:28:36 $
throw new JXPathException("URL is null");
throw new JXPathException(
"Cannot read XML from: " +
(xmlURL != null ? xmlURL.toString() :
(source != null ?
source.getSystemId() : "<<undefined source>>")),
ex); | 0 |
aggregate = deltaAggregate = Double.NEGATIVE_INFINITY;
aggregate = deltaAggregate = Double.POSITIVE_INFINITY;
deltaAggregate = Double.NEGATIVE_INFINITY;
deltaAggregate = Double.POSITIVE_INFINITY; | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/CursorableLinkedList.java,v 1.8 2002/06/16 03:39:40 mas Exp $
* $Revision: 1.8 $
* $Date: 2002/06/16 03:39:40 $
* @version $Id: CursorableLinkedList.java,v 1.8 2002/06/16 03:39:40 mas Exp $
* @return the newly created
* {@link org.apache.commons.collections.CursorableLinkedList.Listable}
* Removes the given
* {@link org.apache.commons.collections.CursorableLinkedList.Listable}
* from my list.
* Returns the
* {@link org.apache.commons.collections.CursorableLinkedList.Listable}
* at the specified index.
*
* if a given
* {@link org.apache.commons.collections.CursorableLinkedList.Listable}
* is the first or last element in the list.
* @return the newly created {@link CursorableLinkedList.Listable} | 0 |
* @version $Id$ | 0 |
final File baseDir = AbstractVfsTestCase.getTestDirectory(); | 0 |
* @version CVS $Id: Principal.java,v 1.2 2003/03/16 17:49:06 vgritsenko Exp $ | 0 |
// Set supported execution environments to default value,
// if not explicitly configured.
if (!getConfig().containsKey(Constants.FRAMEWORK_EXECUTIONENVIRONMENT))
{
s = Util.getDefaultProperty(
m_logger, Constants.FRAMEWORK_EXECUTIONENVIRONMENT);
if (s != null)
{
m_configMutableMap.put(
Constants.FRAMEWORK_EXECUTIONENVIRONMENT, s);
}
} | 0 |
import java.io.IOException;
SshdSocketAddress startLocalPortForwarding(SshdSocketAddress local, SshdSocketAddress remote) throws IOException;
void stopLocalPortForwarding(SshdSocketAddress local) throws IOException;
SshdSocketAddress startRemotePortForwarding(SshdSocketAddress remote, SshdSocketAddress local) throws IOException;
void stopRemotePortForwarding(SshdSocketAddress remote) throws IOException;
SshdSocketAddress localPortForwardingRequested(SshdSocketAddress local) throws IOException;
void localPortForwardingCancelled(SshdSocketAddress local) throws IOException; | 0 |
@Override
@Override
@Override
@Override
@Override
@Override | 0 |
import java.util.ArrayList;
import java.util.List;
public ListenerEndpoint[] getEndpoints() {
List<ListenerEndpoint> list = new ArrayList<ListenerEndpoint>();
Set<SelectionKey> keys = this.selector.keys();
for (Iterator<SelectionKey> it = keys.iterator(); it.hasNext(); ) {
SelectionKey key = it.next();
if (key.isValid()) {
ListenerEndpoint endpoint = (ListenerEndpoint) key.attachment();
if (endpoint != null) {
list.add(endpoint);
}
}
}
return list.toArray(new ListenerEndpoint[list.size()]);
}
| 0 |
m.put("colf", "colq", new Value(new byte[] {}));
m.put("colf", "colq", new Value(new byte[] {}));
m.put(new Text(oversized), new Text("colq"), new Value(new byte[] {}));
m.put(new Text(oversized), new Text("colq"), new Value(new byte[] {})); | 0 |
getListIterator().add(object);
getListIterator().set(object); | 0 |
* @param paramType The request {@link KexProposalOption} value
* - ignored if {@code null}
* otherwise for the outgoing data
* otherwise for the outgoing data
* otherwise for the outgoing data
* @return The {@link IoSession} associated to this session | 0 |
import org.apache.zookeeper.ZKTestCase;
public class QuorumPeerTestBase extends ZKTestCase implements Watcher { | 0 |
(new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI(), 1); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.