Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
c14n.setSecureValidation(secureValidation); | 0 |
} catch (NumberFormatException e)
* @param line a response line
* @return the parsed {@link Article}, if unparseable then isDummy()
*
return new ReplyIterator(_reader_);
return new ReplyIterator(_reader_);
* @see #iterateNewNewsgroups(NewGroupsOrNewsQuery)
* @see #iterateNewNewsgroupListing(NewGroupsOrNewsQuery)
return new ReplyIterator(_reader_);
* new news is found, no entries will be returned.
return new ReplyIterator(_reader_);
public Iterable<Article> iterateArticleInfo(long lowArticleNumber, long highArticleNumber) | 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.accumulo.wikisearch.normalizer;
public class NoOpNormalizer implements Normalizer {
public String normalizeFieldValue(String field, Object value) {
return value.toString();
}
} | 0 |
store.setDefault( RepositoryConfiguration.REPOSITORY_DEFAULT_SET, "org.apache.felix.sigil.core.workspaceprovider" ); | 0 |
private static final String RM_GET_SCHEDULER_CONFIG = "%s/ws/v1/cluster/scheduler";
/**
* Gets scheduler info from RM
*
* @return scheduler info
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/rmCurrentConfig")
public Response getRmSchedulerConfig() {
try {
String url = String.format(RM_GET_SCHEDULER_CONFIG, getRMUrl());
InputStream rmResponse = context.getURLStreamProvider().readFrom(
url, "GET", (String) null, new HashMap<String, String>());
String result = IOUtils.toString(rmResponse);
return Response.ok(result).build();
} catch (ConnectException ex) {
throw new ServiceFormattedException("Connection to Resource Manager refused", ex);
} catch (WebApplicationException ex) {
throw ex;
} catch (Exception ex) {
throw new ServiceFormattedException(ex.getMessage(), ex);
}
} | 0 |
* Copyright (C) 2015 Google Inc. | 0 |
import java.util.Properties;
ClientContext context = new ClientContext(inst, creds, new Properties());
ClientContext context = new ClientContext(inst, creds, new Properties()); | 0 |
import org.junit.Rule;
import org.junit.rules.ExpectedException;
@Rule
public ExpectedException thrown = ExpectedException.none();
@Test
thrown.expect(IllegalArgumentException.class);
@Test
thrown.expect(IllegalArgumentException.class);
@Test
thrown.expect(IllegalArgumentException.class);
@Test
thrown.expect(IllegalArgumentException.class);
public void invalidChooserConfigured() throws Exception {
List<String> volumes = Arrays.asList("file://one/", "file://two/", "file://three/");
ConfigurationCopy conf = new ConfigurationCopy();
conf.set(INSTANCE_DFS_URI, volumes.get(0));
conf.set(Property.INSTANCE_VOLUMES, StringUtils.join(volumes, ","));
conf.set(Property.GENERAL_VOLUME_CHOOSER, "org.apache.accumulo.server.fs.ChooserThatDoesntExist");
thrown.expect(RuntimeException.class);
VolumeManagerImpl.get(conf);
}
@Test
@Test
thrown.expect(IllegalArgumentException.class);
// Expected to throw a runtime exception when the WrongVolumeChooser picks an invalid volume.
thrown.expect(RuntimeException.class); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/ArrayStack.java,v 1.2 2001/04/16 22:39:21 geirm Exp $
* $Revision: 1.2 $
* $Date: 2001/04/16 22:39:21 $
* @version $Revision: 1.2 $ $Date: 2001/04/16 22:39:21 $
/**
* Return the n'th item down (zero-relative) from the top of this
* stack without removing it.
*
* @param n Number of items down to go
*
* @exception EmptyStackException if there are not enough items on the
* stack to satisfy this request
*/
public Object peek(int n) throws EmptyStackException {
int m = (size() - n) - 1;
if (m < 0)
throw new EmptyStackException();
else
return (get(m));
}
| 0 |
* Copyright 2000-2009 The Apache Software Foundation | 0 |
if (cl.hasOption(OptUtil.tableNamespaceOpt().getOpt())) {
String namespace = shellState.getConnector().tableNamespaceOperations().namespaceIdMap().get(OptUtil.getTableNamespaceOpt(cl, shellState));
o.addOption(OptUtil.tableNamespaceOpt("name of table namespace to list only its tables")); | 0 |
EVERYWHERE
if (required) { | 0 |
import java.util.Collections;
import java.util.Map;
public void writeTo(final OutputStream out, int mode) throws IOException {
byte[] tmp = new byte[4096];
int l;
while ((l = in.read(tmp)) != -1) {
out.write(tmp, 0, l);
}
out.flush();
public String getCharset() {
public Map<?, ?> getContentTypeParameters() {
return Collections.EMPTY_MAP;
}
public String getMediaType() {
return "application";
}
public String getSubType() {
return "octet-stream";
}
| 0 |
return getFramework().findBundleEntries(
adapt(BundleRevision.class), path, filePattern, recurse); | 1 |
package org.apache.accumulo.core.clientImpl; | 0 |
public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio( );
| 1 |
/**
* Returns the {@link GlobalCombineFn} used by this Combine operation.
*/
public GlobalCombineFn<? super InputT, ?, OutputT> getFn() {
return fn;
}
| 0 |
@JsonProperty("tags") | 0 |
* @version $Revision$ | 0 |
public static final HeaderElement[] parseElements(
final CharArrayBuffer buffer, final int indexFrom, final int indexTo) {
int cur = indexFrom;
int from = indexFrom;
while (cur < indexTo) {
char ch = buffer.charAt(cur);
element = parse(buffer, from, cur);
from = cur + 1;
} else if (cur == indexTo - 1) {
element = parse(buffer, from, indexTo);
cur++;
public static HeaderElement parse(
final CharArrayBuffer buffer, final int indexFrom, final int indexTo) { | 0 |
private LinkedList<Widget> children = new LinkedList<Widget>();
public List<Widget> getChildren() { | 0 |
if (source.hasNext())
currentRow = source.peek().getKey().getRow();
if (disabled)
throw new IllegalStateException("SingleRowIter no longer valid");
if (disabled)
throw new IllegalStateException("SingleRowIter no longer valid");
if (currentRow == null)
throw new NoSuchElementException();
if (!hasNext())
throw new NoSuchElementException(); | 1 |
import com.google.cloud.dataflow.sdk.transforms.windowing.GlobalWindows;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
final Map<TupleTag<?>, Map<BoundedWindow, Object>> sideInputCache;
<T> T sideInput(PCollectionView<T> view, BoundedWindow mainInputWindow) {
Map<BoundedWindow, Object> tagCache = sideInputCache.get(tag);
if (tagCache == null) {
tagCache = new HashMap<>();
sideInputCache.put(tag, tagCache);
}
final BoundedWindow sideInputWindow =
view.getWindowFnInternal().getSideInputWindow(mainInputWindow);
T result = (T) tagCache.get(sideInputWindow);
// TODO: Consider partial prefetching like in CoGBK to reduce iteration cost.
if (result == null) {
if (windowFn instanceof GlobalWindows) {
result = view.fromIterableInternal((Iterable<WindowedValue<?>>) sideInputs.get(tag));
} else {
result = view.fromIterableInternal(Iterables.filter(
(Iterable<WindowedValue<?>>) sideInputs.get(tag),
new Predicate<WindowedValue<?>>() {
@Override
public boolean apply(WindowedValue<?> element) {
return element.getWindows().contains(sideInputWindow);
}
}));
}
tagCache.put(sideInputWindow, result);
return result; | 0 |
String instanceName = c.info().getInstanceName();
String zookeepers = c.info().getZooKeepers(); | 0 |
return m_name.equals(capability.getName()) && m_filter.matchCase(capability.getProperties()); | 0 |
import java.nio.charset.StandardCharsets;
byte[] hmacKey = "secret".getBytes(StandardCharsets.US_ASCII);
XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, StandardCharsets.UTF_8.name());
// System.out.println("Got:\n" + new String(baos.toByteArray(), StandardCharsets.UTF_8.name()));
byte[] hmacKey = "secret".getBytes(StandardCharsets.US_ASCII);
XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, StandardCharsets.UTF_8.name());
// System.out.println("Got:\n" + new String(baos.toByteArray(), StandardCharsets.UTF_8.name()));
byte[] hmacKey = "secret".getBytes(StandardCharsets.US_ASCII);
XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, StandardCharsets.UTF_8.name());
// System.out.println("Got:\n" + new String(baos.toByteArray(), StandardCharsets.UTF_8.name()));
byte[] hmacKey = "secret".getBytes(StandardCharsets.US_ASCII);
XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, StandardCharsets.UTF_8.name());
// System.out.println("Got:\n" + new String(baos.toByteArray(), StandardCharsets.UTF_8.name()));
byte[] hmacKey = "secret".getBytes(StandardCharsets.US_ASCII);
XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, StandardCharsets.UTF_8.name());
// System.out.println("Got:\n" + new String(baos.toByteArray(), StandardCharsets.UTF_8.name()));
byte[] hmacKey = "secret".getBytes(StandardCharsets.US_ASCII);
XMLStreamWriter xmlStreamWriter = outboundXMLSec.processOutMessage(baos, StandardCharsets.UTF_8.name());
// System.out.println("Got:\n" + new String(baos.toByteArray(), StandardCharsets.UTF_8.name())); | 1 |
final String username = proxyConfiguration.getUsername();
final String password = proxyConfiguration.getPassword();
return new UsernamePasswordCredentials(username, password != null ? password.toCharArray() : null); | 0 |
import org.apache.http.nio.protocol.TestAllProtocol;
suite.addTest(TestAllProtocol.suite()); | 0 |
Table.ID tableId = Table.ID.of(c.tableOperations().tableIdMap().get(tableName)); | 1 |
TabletBalancer balancer = ServerConfiguration.getSystemConfiguration(instance).instantiateClassProperty(Property.MASTER_TABLET_BALANCER,
TabletBalancer.class, | 0 |
try {
channel.close();
} catch (final IOException ignore) {} | 0 |
package org.apache.commons.collections.functors;
import static org.apache.commons.collections.functors.EqualPredicate.equalPredicate;
import static org.apache.commons.collections.functors.NullPredicate.nullPredicate;
import static org.junit.Assert.assertSame;
import org.apache.commons.collections.Predicate;
import org.junit.Test;
public class TestEqualPredicate extends BasicPredicateTestBase {
private static final EqualsTestObject FALSE_OBJECT = new EqualsTestObject(false);
private static final EqualsTestObject TRUE_OBJECT = new EqualsTestObject(true);
@Override
protected Predicate<Object> generatePredicate() {
return equalPredicate(null);
}
@Test
public void testNullArgumentEqualsNullPredicate() throws Exception {
assertSame(nullPredicate(), equalPredicate(null));
}
@Test
public void objectFactoryUsesEqualsForTest() throws Exception {
Predicate<EqualsTestObject> predicate = equalPredicate(FALSE_OBJECT);
assertFalse(predicate, FALSE_OBJECT);
assertTrue(equalPredicate(TRUE_OBJECT), TRUE_OBJECT);
}
@Test
public void testPredicateTypeCanBeSuperClassOfObject() throws Exception {
Predicate<Number> predicate = equalPredicate((Number) 4);
assertTrue(predicate, 4);
}
public static class EqualsTestObject {
private final boolean b;
public EqualsTestObject(boolean b) {
this.b = b;
}
@Override
public boolean equals(Object obj) {
return b;
}
}
} | 0 |
import org.apache.accumulo.test.categories.AnyClusterTest;
import org.apache.accumulo.test.categories.SunnyDayTests;
import org.junit.experimental.categories.Category;
@Category({AnyClusterTest.class, SunnyDayTests.class}) | 0 |
package org.apache.commons.dbcp2.managed;
import org.apache.commons.dbcp2.ConnectionFactory; | 1 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ | 0 |
@Internal
public PipelineOptions getOptions(){
return defaultOptions;
}
| 0 |
BasicClientCookie cookie = new BasicClientCookie("name", null);
BasicClientCookie cookie = new BasicClientCookie("name", null);
BasicClientCookie cookie = new BasicClientCookie("name", null);
BasicClientCookie cookie = new BasicClientCookie("name", null);
BasicClientCookie cookie = new BasicClientCookie("name", null);
BasicClientCookie cookie = new BasicClientCookie("name", null);
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", "value");
BasicClientCookie cookie = new BasicClientCookie("name", null);
BasicClientCookie cookie = new BasicClientCookie("name", null);
cookiespec.validate(new BasicClientCookie("name", null), null);
cookiespec.match(new BasicClientCookie("name", null), null);
cookiespec.formatCookies(new BasicClientCookie[] {}); | 0 |
import java.util.ArrayList;
List<String> list;
if (obj instanceof String) {
list = new ArrayList<String>();
list.add((String)obj);
}
else {
list = (List<String>)obj;
}
return (T)Enum.valueOf(enumClass, enumName); | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(ViewDataMigrationService.class); | 1 |
* Creates a candidate that can be used to offer leadership for the given {@code group}.
final Membership membership = group.join(IP_ADDRESS_DATA_SUPPLIER, new Command() {
return Iterables.isEmpty(memberIds) ? null : MOST_RECENT_JUDGE.apply(memberIds); | 0 |
@Override | 0 |
MasterMonitorInfo mmi = monitor.getMmi();
if (mmi == null)
return servers;
for (String server : mmi.serversShuttingDown) { | 0 |
import org.apache.beam.vendor.grpc.v1_13_1.com.google.protobuf.Timestamp; | 0 |
* <tr><td>d+</td><td>-d [classname] (creates object via empty constructor)</td></tr>
* <tr><td>e%</td><td>-e [number] (creates Double/Long instance depending on existing of a '.')</td></tr> | 0 |
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.accumulo.monitor.servlets.BasicServlet;
import org.apache.accumulo.server.util.time.SimpleTimer;
public static AtomicReference<String> cachedInstanceName = new AtomicReference<String>("(Unavailable)");
// Learn our instance name asynchronously so we don't hang up if zookeeper is down
if (Monitor.cachedInstanceName.get() == null) {
SimpleTimer.getInstance().schedule(new TimerTask() {
@Override
public void run() {
synchronized (Monitor.class) {
if (cachedInstanceName.get() == null) {
cachedInstanceName.set(HdfsZooInstance.getInstance().getInstanceName());
}
}
}
}, 0);
}
}
synchronized (Monitor.class) { | 0 |
* @param _msgID
public ResourceResolverException(String _msgID, Attr uri, String BaseURI) {
super(_msgID);
* @param _msgID
public ResourceResolverException(String _msgID, Object exArgs[], Attr uri,
super(_msgID, exArgs);
* @param _msgID
public ResourceResolverException(String _msgID, Exception _originalException,
super(_msgID, _originalException);
* @param _msgID
public ResourceResolverException(String _msgID, Object exArgs[],
Exception _originalException, Attr uri,
super(_msgID, exArgs, _originalException); | 0 |
String CSS_FONT_PROPERTY = "font";
String CSS_CENTER_VALUE = "center"; | 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.ambari.server.controller.metrics.MetricsHostProvider;
public abstract class AbstractProviderModule implements ProviderModule, ResourceProviderObserver, JMXHostProvider, GangliaHostProvider, MetricsHostProvider {
// ----- MetricsHostProvider ---------------------------------------------------
// ----- JMXHostProvider ---------------------------------------------------
this,
PropertyHelper.getPropertyId("ServiceComponentInfo", "state"));
this,
this,
PropertyHelper.getPropertyId("HostRoles", "state"));
this,
MetricsHostProvider metricsHostProvider,
String statePropertyId) {
jmxHostProvider, metricsHostProvider, clusterNamePropertyId, hostNamePropertyId,
componentNamePropertyId, statePropertyId); | 0 |
values.apply(new DirectGroupByKeyOnly<>()); | 0 |
@SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/bag/TransformedSortedBag.java,v 1.2 2004/01/05 21:54:06 scolebourne Exp $
* Copyright (c) 2003-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.2 $ $Date: 2004/01/05 21:54:06 $
public class TransformedSortedBag
extends TransformedBag implements SortedBag { | 0 |
import javax.servlet.http.HttpSession;
* @version $Id$
HttpSession session = request.getSession(false); | 0 |
if (req.isSatisfied(caps[capIdx]))
if (req.isSatisfied(caps[capIdx])) | 0 |
* @version $Revision$ | 1 |
* @version CVS $Id: CopletThread.java,v 1.2 2003/05/16 07:19:44 cziegeler Exp $
SourceUtil.toSAX(source, xc); | 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.accumulo.server.rpc;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
/**
* Utility method to ensure that the instance of TCredentials which is passed to the implementation of a Thrift service has the correct principal from SASL at
* the Thrift transport layer when SASL/GSSAPI (kerberos) is enabled. This ensures that we use the strong authentication provided to us and disallow any other
* principal names that client (malicious or otherwise) might pass in.
*/
public class TCredentialsUpdatingWrapper {
public static <T> T service(final T instance, final Class<? extends T> originalClass) {
InvocationHandler handler = new TCredentialsUpdatingInvocationHandler<T>(instance);
@SuppressWarnings("unchecked")
T proxiedInstance = (T) Proxy.newProxyInstance(originalClass.getClassLoader(), originalClass.getInterfaces(), handler);
return proxiedInstance;
}
} | 1 |
SecurityContextHolder.getContext().setAuthentication(TestAuthenticationFactory.createAdministrator());
String serviceName, State desiredState)
throws AmbariException, AuthorizationException {
throws AmbariException, AuthorizationException {
State desiredState) throws AmbariException, AuthorizationException {
Assert.assertTrue(result.iterator().next().equals("host1")); | 0 |
try {
//update service info due to new stack
service.updateServiceInfo();
//update component info due to new stack
for (ServiceComponent sc : service.getServiceComponents().values()) {
}
} catch (AmbariException e) {
} | 0 |
valueCoder.encode(value.value, outStream);
valueCoder.decode(inStream), | 0 |
channel.getInvertedIn().write(buffer.array(), buffer.rpos(), buffer.available());
channel.getInvertedIn().flush();
invertedIn = out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA); | 0 |
public void clearHeaders() {
this.headergroup.clear();
}
| 0 |
dsVersion, configurableServiceProperties
dsVersion, configurableServiceProperties
dsVersion, configurableServiceProperties | 0 |
* Copyright 2016-2017 Seznam.cz, a.s. | 0 |
/* (non-Javadoc)
* @see org.apache.cocoon.Processor#getComponentConfigurations()
public Configuration[] getComponentConfigurations() {
return null; | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/model/dom/DOMNamespaceIterator.java,v 1.7 2003/10/09 21:31:41 rdonkin Exp $
* $Revision: 1.7 $
* $Date: 2003/10/09 21:31:41 $
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* permission of the Apache Software Foundation.
* @version $Revision: 1.7 $ $Date: 2003/10/09 21:31:41 $ | 0 |
import com.google.common.collect.Iterators;
assertTrue(Iterators.size(((Iterable<?>) s).iterator()) > 0);
assertEquals(0, Iterators.size(((Iterable<?>) s).iterator())); | 0 |
* @see org.apache.sshd.server.SshServer#setSessionFactory(SessionFactory) | 0 |
package org.apache.felix.ipojo.test.scenarios.component;
import foo.Foo;
@Foo(bar="bar")
public class OnlyFoo {
} | 0 |
import java.util.regex.Matcher;
Pattern pattern = Pattern.compile(nameSpace);
String nmSpace = namespaceDescriptor.getName();
Matcher matcher = pattern.matcher(nmSpace);
if (matcher.find()){ | 0 |
import org.apache.geronimo.gshell.clp.Option;
@Argument(required = true, multiValued = true, description = "Bundle IDs")
@Option(name = "--force")
boolean force;
if (force || !Util.isASystemBundle(getBundleContext(), bundle) || Util.accessToSystemBundleIsAllowed(bundle.getBundleId(), io)) {
bundles.add(bundle);
} | 0 |
import org.apache.ambari.server.stack.upgrade.orchestrate.UpgradeContextFactory; | 0 |
* @version $Id$ | 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.bcel6.data;
public class AnnotatedFields {
@SimpleAnnotation(id=1) int i;
@SimpleAnnotation(id=2) String s;
} | 1 |
import org.apache.hc.core5.io.CloseMode;
server.close(CloseMode.IMMEDIATE); | 0 |
import com.twitter.aurora.gen.AuroraAdmin;
bind(AuroraAdmin.Iface.class).to(SchedulerThriftInterface.class); | 0 |
package org.apache.commons.vfs2.provider.http;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.provider.AbstractRandomAccessStreamContent;
import org.apache.commons.vfs2.util.MonitorInputStream;
import org.apache.commons.vfs2.util.RandomAccessMode; | 1 |
* 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 $Id: NodeSet.java,v 1.2 2003/10/09 21:31:38 rdonkin Exp $ | 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.
* @version $Revision: 1.5 $ $Date: 2004/02/24 14:19:58 $ | 1 |
Set<String> propertyIdSet = null;
List<String> parameterList = null;
if (metric_name != null) {
propertyIdSet = metrics.get(metric_name);
parameterList = new LinkedList<String>();
if (propertyIdSet == null) {
for (Map.Entry<String, Set<String>> entry : metrics.entrySet()) {
String key = entry.getKey();
Pattern pattern = Pattern.compile(key);
Matcher matcher = pattern.matcher(metric_name);
if (matcher.matches()) {
propertyIdSet = entry.getValue();
// get parameters
for (int i = 0; i < matcher.groupCount(); ++i) {
parameterList.add(matcher.group(i + 1));
}
break;
if (metricsMap.containsKey(propertyId)) { | 0 |
config.put("proxy.user", "u"); | 0 |
package org.apache.commons.vfs2.example;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.FileSystemManager;
import org.apache.commons.vfs2.FileType;
import org.apache.commons.vfs2.VFS;
System.err.println("e.g. java org.apache.commons.vfs2.example.ShowProperties LICENSE.txt"); | 1 |
mainInput.getCoder(), | 0 |
* Copyright (c) OSGi Alliance (2004, 2008). All Rights Reserved.
import info.dmtree.DmtData;
import info.dmtree.DmtException;
import info.dmtree.DmtSession;
import info.dmtree.MetaNode;
* etc. All errors described by the error codes {@link DmtException#INVALID_URI}, {@link DmtException#URI_TOO_LONG}, {@link DmtException#PERMISSION_DENIED},
*
* @version $Revision: 5673 $ | 0 |
assertEquals("Expected 14 colums, but found " + parts.length + " instead for '" + Arrays.toString(parts) + "'", 14, parts.length);
// Scan ID should be a long (throwing an exception if it fails to parse)
Long.parseLong(parts[11].trim()); | 0 |
@SuppressWarnings("unchecked") // cannot easily avoid this warning
Collections.sort(testList, sCompare); // unchecked | 0 |
*
* {@code Import-Package: org.osgi.converter; version="[1.0,2.0)"}
* {@code Import-Package: org.osgi.converter; version="[1.0,1.1)"}
*
* @author $Id: 1b82a2a1db1431c5e4398f368662b5b6fb5f8547 $
package org.osgi.converter; | 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.sshd.common.util.security.bouncycastle;
import java.io.IOException;
import java.io.InputStream;
import java.security.GeneralSecurityException;
import java.security.KeyPair;
import org.apache.sshd.common.config.keys.FilePasswordProvider;
import org.apache.sshd.common.keyprovider.AbstractFileKeyPairProvider;
/**
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
*/
public class BouncyCastleFileKeyPairProvider extends AbstractFileKeyPairProvider {
public BouncyCastleFileKeyPairProvider() {
super();
}
@Override
protected KeyPair doLoadKey(String resourceKey, InputStream inputStream, FilePasswordProvider provider)
throws IOException, GeneralSecurityException {
return BouncyCastleInputStreamLoader.loadKeyPair(resourceKey, inputStream, provider);
}
} | 0 |
import org.apache.beam.sdk.options.GcsOptions;
import org.apache.beam.sdk.util.gcsfs.GcsPath; | 0 |
import java.io.InputStream;
import java.util.Iterator;
import org.apache.commons.vfs.FileContent;
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.FileType;
import org.apache.commons.vfs.NameScope;
* @version $Revision: 1.3 $ $Date: 2003/02/13 04:28:46 $
* Tests concurrent reads on a file.
file.getContent().getInputStream().close();
/**
* Tests that input streams are cleaned up on file close.
*/
public void testInstrCleanup() throws Exception
{
// Get the test file
FileObject file = getReadFolder().resolveFile( "file1.txt" );
assertEquals( FileType.FILE, file.getType() );
// Open some input streams
final InputStream instr1 = file.getContent().getInputStream();
assertTrue( instr1.read() == FILE1_CONTENT.charAt( 0 ) );
final InputStream instr2 = file.getContent().getInputStream();
assertTrue( instr2.read() == FILE1_CONTENT.charAt( 0 ) );
// Close the file
file.close();
// Check
assertTrue( instr1.read() == -1 );
assertTrue( instr2.read() == -1 );
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/impl/TagScript.java,v 1.35 2003/01/24 19:03:24 morgand Exp $
* $Revision: 1.35 $
* $Date: 2003/01/24 19:03:24 $
* $Id: TagScript.java,v 1.35 2003/01/24 19:03:24 morgand Exp $
import org.apache.commons.jelly.JellyTagException;
* @version $Revision: 1.35 $
public void run(JellyContext context, XMLOutput output) throws JellyTagException {
catch (JellyTagException e) {
handleException(e);
}
protected void handleException(JellyTagException e) throws JellyTagException {
/**
* A helper method to handle this Jelly exception.
* This method adorns the JellyException with location information
* such as adding line number information etc.
*/
protected void handleException(JellyException e) throws JellyTagException {
if (log.isTraceEnabled()) {
log.trace( "Caught exception: " + e, e );
}
applyLocation(e);
throw new JellyTagException(e);
}
protected void handleException(Exception e) throws JellyTagException {
throw new JellyTagException( ((InvocationTargetException)e).getTargetException(),
throw new JellyTagException(e, fileName, elementName, columnNumber, lineNumber);
protected void handleException(Error e) throws Error, JellyTagException {
throw new JellyTagException(e, fileName, elementName, columnNumber, lineNumber); | 1 |
if (sendCommand("STLS") != POP3Reply.OK) | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestAll.java,v 1.11 2003/12/14 21:42:55 psteitz Exp $
* @version $Revision: 1.11 $ $Date: 2003/12/14 21:42:55 $
suite.addTest(TestCompositeMap.suite()); | 0 |
/** Tests for {@link MultiStepCombine}. */ | 1 |
DataflowRunner.verifyStateSupportForWindowingStrategy(input.getWindowingStrategy());
DataflowRunner.verifyStateSupportForWindowingStrategy(input.getWindowingStrategy()); | 0 |
import com.esotericsoftware.kryo.io.InputChunked;
import com.esotericsoftware.kryo.io.OutputChunked;
private static ThreadLocal<OutputChunked> threadLocalOutput =
ThreadLocal.withInitial(() -> new OutputChunked(DEFAULT_BUFFER_SIZE));
private static ThreadLocal<InputChunked> threadLocalInput =
ThreadLocal.withInitial(() -> new InputChunked(DEFAULT_BUFFER_SIZE));
static InputChunked getKryoInput() {
static OutputChunked getKryoOutput() { | 0 |
import org.apache.accumulo.core.client.impl.AccumuloClientImpl;
import org.apache.accumulo.core.client.impl.ConnectorImpl;
* @deprecated since 2.0.0. Use {@link AccumuloClient} for writing new code. Connector is available
@Deprecated
return new ConnectorImpl((AccumuloClientImpl) client); | 0 |
package org.apache.accumulo.core.iterators.user;
import org.apache.accumulo.core.iterators.IteratorEnvironment;
import org.apache.accumulo.core.iterators.IteratorUtil;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.iterators.SortedMapIterator;
import org.apache.accumulo.core.iterators.user.RowDeletingIterator; | 0 |
if ( securityManager != null && !cache.getMethodPerm( method ) )
throw new IllegalAccessException( "Method [" + method + "] cannot be accessed." );
if ( method == null || ( method.getParameterTypes().length
> methodDescriptor.getMethod().getParameterTypes().length ) ) | 0 |
meth = bundle.getClass().getMethod("getBundleContext", new Class[0]); // This method is public and is specified in the Bundle interface.
m_logger.log(Logger.ERROR, "Cannot get the BundleContext by invoking " + fields[i].getName(), e);
m_logger.log(Logger.ERROR, "Cannot get the BundleContext by invoking " + fields[i].getName(), e); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.