Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.accumulo.core.client.mapreduce.lib.impl.InputConfigurator;
0
row = processor.toBean(this.rs, TestBean.class); row = processor.toBean(this.rs, TestBean.class); List<TestBean> list = processor.toBeanList(this.rs, TestBean.class); TestBean b = list.get(0); b = list.get(1); Map<String, Object> m = processor.toMap(this.rs);
0
assertEquals("TextIO.Write", NameUtils.approximatePTransformName(TextIO.Write.class));
0
import org.apache.hadoop.conf.Configuration; public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
0
public static ClusterRequest clusterRequest(Long clusterId, String clusterName, String stackVersion, Set<String> hostNames) public ClusterRequestMatcher(Long clusterId, String clusterName, String stackVersion, Set<String> hostNames) {
0
import org.w3c.dom.DOMException; * Returns the CSS text associated with the given type/value pair. */ public static String getCssText(short unit, float value) { if (unit < 0 || unit >= UNITS.length) { throw new DOMException(DOMException.SYNTAX_ERR, ""); } String s = String.valueOf(value); if (s.endsWith(".0")) { s = s.substring(0, s.length() - 2); } return s + UNITS[unit - CSSPrimitiveValue.CSS_NUMBER]; } /** return getCssText(unitType, floatValue);
0
* Returns a filter that returns true if the file was last modified before * or at the specified cutoff time. * Returns a filter that returns true if the file was last modified before * or at the specified cutoff date. * Returns a filter that returns true if the file was last modified before * or at the same time as the specified reference file.
0
import net.jcip.annotations.NotThreadSafe; @NotThreadSafe
0
* nor may "Apache" appear in their name, without
0
* <p>To prevent losing actual type arguments due to erasure, create an anonymous subclass
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.ambari.server.state.AlertState; protected static final String ALERT_REPEAT_TOLERANCE = "Alert/repeat_tolerance"; protected static final String ALERT_OCCURRENCES = "Alert/occurrences"; protected static final String ALERT_REPEAT_TOLERANCE_REMAINING = "Alert/repeat_tolerance_remaining"; PROPERTY_IDS.add(ALERT_REPEAT_TOLERANCE); PROPERTY_IDS.add(ALERT_OCCURRENCES); PROPERTY_IDS.add(ALERT_REPEAT_TOLERANCE_REMAINING); // repeat tolerance values int repeatTolerance = definition.getRepeatTolerance(); int occurrences = entity.getOccurrences(); int remaining = (occurrences > repeatTolerance) ? 0 : (repeatTolerance - occurrences); // the OK state is special; when received, we ignore tolerance and notify if (history.getAlertState() == AlertState.OK) { remaining = 0; } setResourceProperty(resource, ALERT_REPEAT_TOLERANCE, repeatTolerance, requestedIds); setResourceProperty(resource, ALERT_OCCURRENCES, occurrences, requestedIds); setResourceProperty(resource, ALERT_REPEAT_TOLERANCE_REMAINING, remaining, requestedIds);
0
* @version CVS $Id: NetUtils.java,v 1.4 2003/09/18 12:11:50 upayavira Exp $ /** * Remove any authorisation details from a URI */ public static String removeAuthorisation(String uri) { if (uri.indexOf("@")!=-1 && (uri.startsWith("ftp://") || uri.startsWith("http://"))) { return uri.substring(0, uri.indexOf(":")+2)+uri.substring(uri.indexOf("@")+1); } return uri; }
0
* Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ * @version CVS $Id: PortalManager.java,v 1.13 2004/03/05 13:02:18 bdelacretaz Exp $
1
/** Runtime context for the Samza runner. */
1
* @version CVS $Id$ } for(Enumeration e = req.getParameterNames(); e.hasMoreElements(); ) { String name = (String)e.nextElement(); if (name.startsWith(Constants.ACTION_PARAM_PREFIX)) { if (name.endsWith(".x") || name.endsWith(".y")) { return name.substring(Constants.ACTION_PARAM_PREFIX.length(),name.length()-2); return name.substring(Constants.ACTION_PARAM_PREFIX.length()); return null;
0
import org.apache.accumulo.core.data.TableId; throw new AcceptableThriftTableOperationException(tableInfo.tableID.canonical(), throw new AcceptableThriftTableOperationException(tableInfo.tableID.canonical(), throw new AcceptableThriftTableOperationException(tableInfo.tableID.canonical(), TableId tableID, String exportDir) throws Exception { osw.append("srcTableID:" + tableID.canonical() + "\n"); TableId tableID, ZipOutputStream zipOut, DataOutputStream dataOut) private static void exportConfig(ServerContext context, TableId tableID, ZipOutputStream zipOut,
0
* Copyright (c) OSGi Alliance (2002, 2008). All Rights Reserved. * @version $Revision: 5673 $
0
// Since this test does not rely on the BookKeeper client needing to // know via ZooKeeper which Bookies are available, okay, so pass in null // for the zkServers input parameter when constructing the BookieServer. bs = new BookieServer(port, null, tmpDir, new File[] { tmpDir });
0
import static com.google.common.base.Charsets.UTF_8; out.append(new String(expression, root.start, root.end - root.start, UTF_8)); return builder.toString().getBytes(UTF_8); throw new BadArgumentException("operator or missing parens", new String(expression, UTF_8), index - 1); throw new BadArgumentException("parenthesis mis-match", new String(expression, UTF_8), index - 1); throw new BadArgumentException("expression needs | or &", new String(expression, UTF_8), start); throw new BadArgumentException("empty term", new String(expression, UTF_8), start); throw new BadArgumentException("cannot mix & and |", new String(expression, UTF_8), index - 1); throw new BadArgumentException("cannot mix | and &", new String(expression, UTF_8), index - 1); throw new BadArgumentException("expression needs & or |", new String(expression, UTF_8), index - 1); throw new BadArgumentException("empty expression not allowed", new String(expression, UTF_8), index); throw new BadArgumentException("expression needs & or |", new String(expression, UTF_8), index - 1); throw new BadArgumentException("invalid escaping within quotes", new String(expression, UTF_8), index - 1); throw new BadArgumentException("unclosed quote", new String(expression, UTF_8), termStart); throw new BadArgumentException("empty term", new String(expression, UTF_8), termStart); throw new BadArgumentException("expression needs & or |", new String(expression, UTF_8), index - 1); throw new BadArgumentException("bad character (" + c + ")", new String(expression, UTF_8), index - 1); throw new BadArgumentException("missing term", new String(expression, UTF_8), index); this(expression.getBytes(UTF_8)); return "[" + new String(expression, UTF_8) + "]"; return new String(quote(term.getBytes(UTF_8)), UTF_8);
0
* @Deprecated public void setMaxStatusLineGarbage (final int maxStatusLineGarbage) {
0
import java.util.concurrent.ConcurrentHashMap; import org.apache.http.annotation.ThreadSafe; @ThreadSafe private final Map<String, Object> parameters = new ConcurrentHashMap<String, Object>(); if (name == null) { return this; } if (value != null) { this.parameters.put(name, value); } else { this.parameters.remove(name); }
0
if(attributeDef.getOptions() != null) { attribInfo.put("options", AtlasType.toJson(attributeDef.getOptions())); } if(attribInfo.get("options") != null) { ret.setOptions(AtlasType.fromJson((String) attribInfo.get("options"), Map.class)); }
0
/* * Copyright (c) OSGi Alliance (2010, 2012). All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Resolver Service Package Version 1.0. * * <p> * Bundles wishing to use this package must list the package in the * Import-Package header of the bundle's manifest. This package has two types of * users: the consumers that use the API in this package and the providers that * implement the API in this package. * * <p> * Example import for consumers using the API in this package: * <p> * {@code Import-Package: org.osgi.service.resolver; version="[1.0,2.0)"} * <p> * Example import for providers implementing the API in this package: * <p> * {@code Import-Package: org.osgi.service.resolver; version="[1.0,1.1)"} * * @version $Id: db1706d83ca104187f77cb1feb7cf52b92b3740d $ */ package org.osgi.service.resolver;
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 java.io.PrintWriter; import jline.Terminal; import org.apache.felix.karaf.shell.console.jline.TerminalFactory; Terminal terminal = null; terminal = new TerminalFactory().getTerminal(); ConsoleReader reader = new ConsoleReader(System.in, new PrintWriter(System.out), TerminalFactory.class.getResourceAsStream("keybinding.properties"), terminal); channel.setIn(reader.getInput()); try { if (terminal != null) { terminal.restoreTerminal(); } } catch (Throwable t) { }
0
import com.google.cloud.dataflow.sdk.transforms.windowing.GlobalWindow; counterSet.getAddCounterMutator(), new GlobalWindow());
0
@Override @Override @Override @Override @Override Thread thread=new Thread(this); thread.setDaemon(true); thread.start(); @Override @Override
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
* http://www.apache.org/licenses/LICENSE-2.0
0
* <p> * transparent client-side caching. * </p> * <p> * The current implementation is conditionally * </p> * <p> * </p> * <p> * </p>
0
public String getType() { return m_type.getName(); } /** * Gets the handler managing the property. * @return the configuration handler. */ public Handler getHandler() { return m_handler; }
0
* * public class JavaScriptJXPathBindingBuilder extends JXPathBindingBuilderBase implements Contextualizable { public JXPathBindingBase buildBinding(Element element, Assistant assistant) throws BindingException { if (otherBinding != null) { commonAtts = JXPathBindingBuilderBase.mergeCommonAttributes(otherBinding.getCommonAtts(), commonAtts); if (id == null) { id = otherBinding.getId(); } if (path == null) { path = otherBinding.getPath(); } if (otherBinding != null) { loadScript = otherBinding.getLoadScript(); } if (otherBinding != null) { saveScript = otherBinding.getSaveScript(); } Iterator it = otherChildren.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); childBindings.put(entry.getKey(), entry.getValue()); } Collections.unmodifiableMap(childBindings));
0
import org.apache.ambari.view.hive20.internal.dto.ColumnInfo; private final List<ColumnInfo> header; public TableDataReader(Iterator<Row> rowIterator, List<ColumnInfo> header, boolean encode) {
0
import org.apache.aurora.common.testing.easymock.EasyMockTest;
0
URI repositoryXml = ObrUtils.findRepositoryXml( mavenRepository, obrRepository ); URI bundleJar = ObrUtils.findBundleJar( localRepository, project.getArtifact() ); update = new ObrUpdate( repositoryXml, obrXml, project, bundleJar, mavenRepository, userConfig, log );
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//fileupload/src/java/org/apache/commons/fileupload/DefaultFileItem.java,v 1.16 2003/03/07 23:29:26 sullis Exp $ * $Revision: 1.16 $ * $Date: 2003/03/07 23:29:26 $ * Copyright (c) 2001-2003 The Apache Software Foundation. All rights * <p> The default implementation of the * @author Sean C. Sullivan * @version $Id: DefaultFileItem.java,v 1.16 2003/03/07 23:29:26 sullis Exp $ * * @see #DefaultFileItem(String, String) * * * @see #DefaultFileItem() * * * @see #setFieldName(String) * * * @see #getFieldName() * * * @see #setIsFormField(boolean) * * * @see #isFormField() *
0
keys = JobUpdates.saveUpdates( storage, new JobUpdates.Builder().setNumInstanceEvents(instances).build(1)); keys = JobUpdates.saveUpdates( storage, new JobUpdates.Builder().setNumInstanceOverrides(instanceOverrides).build(1));
0
/** * This interface specifies a {@link #convert(Object)} method that * returns an {@link InternalConverting} rather than a normal Converting * instance. */ interface InternalConverter extends Converter { /** * Start a conversion for the given object. This method overrides the * {@link Converter#convert(Object)} method with a co-variant return type. * * @param obj The object that should be converted. * @return An {@link InternalConverting} object to complete the conversion. */ @Override
0
return (T) convert(type.getType(), o); Class resultType = getRawClass(type); if (o == null) { if (resultType.isPrimitive()|| Number.class.isAssignableFrom(resultType)) return convert(type,0); } if (Map.class.isAssignableFrom(actualType) && resultType.isInterface()) { return proxy(resultType, (Map) o); } else { } /** * Convert a map to an interface. * * @param interfc * @param properties * @return */ public <T> T proxy(Class<T> interfc, final Map< ? , ? > properties) { return (T) Proxy.newProxyInstance(interfc.getClassLoader(), new Class[] { interfc }, new InvocationHandler() { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Object o = properties.get(method.getName()); if ( o == null) o = properties.get(mangleMethodName(method.getName())); return convert( method.getGenericReturnType(), o); } }); } public static String mangleMethodName(String id) { StringBuilder sb = new StringBuilder(id); for (int i = 0; i < sb.length(); i++) { char c = sb.charAt(i); boolean twice = i < sb.length() - 1 && sb.charAt(i + 1) == c; if (c == '$' || c == '_') { if (twice) sb.deleteCharAt(i + 1); else if (c == '$') sb.deleteCharAt(i--); // Remove dollars else sb.setCharAt(i, '.'); // Make _ into . } } return sb.toString(); }
0
dataConsumer.releaseResources();
0
if (value!=null) { if (((String) value).equals("??/??/??")) { setBackground(Color.white); } else{ setBackground((Color) eventName.get(state)); }
0
import java.util.Arrays; this.rows.addAll(buildRows(type, Arrays.asList(args))); return this; } /** * Add rows to the builder. * * <p>Note: check the class javadoc for for detailed example. */ public RowsBuilder addRows(final List args) { public static List<BeamSqlRow> buildRows(BeamSqlRecordType type, List args) { for (int i = 0; i < args.size(); i += fieldCount) { row.addField(j, args.get(i + j));
0
return TableState.ONLINE == Tables.getTableState(conn.getInstance(), ID);
0
public void testUnrederedNodes() { ns.addMapping("a","http://a",node2); assertTrue(l.contains(node2)); assertFalse(l.contains(node2)); assertTrue(l.contains(node2));
0
byte otherValue = other != null ? other.byteValue() : 0; int value1 = prefix.byteValue() << offsetInBits; mask |= 0x1 << i;
0
* @version $Id: JexlTest.java,v 1.60 2004/09/01 00:35:38 dion Exp $ assertExpression(jc, "\"foo\" + \"bar\" == \"foobar\"", Boolean.TRUE); assertExpression(jc, "x.a", Boolean.TRUE); assertExpression(jc, "!x.a", Boolean.FALSE); assertExpression(jc, "!x.b", Boolean.TRUE); //assertExpression(jc, "foo.array2.1.1", GET_METHOD_ARRAY2[1][1]); public void testAntPropertiesWithMethods() throws Exception { JexlContext jc = JexlHelper.createContext(); String value = "Stinky Cheese"; jc.getVars().put("maven.bob.food", value); assertExpression(jc, "maven.bob.food.length()", new Integer(value.length())); assertExpression(jc, "empty(maven.bob.food)", Boolean.FALSE); assertExpression(jc, "size(maven.bob.food)", new Integer(value.length())); assertExpression(jc, "maven.bob.food + ' is good'", value + " is good"); // DG: Note the following ant properties don't work // String version = "1.0.3"; // jc.getVars().put("commons-logging", version); // assertExpression(jc, "commons-logging", version); }
0
import static org.junit.Assert.assertEquals; import java.util.Collections; import java.util.List; import com.google.inject.Guice; import com.google.inject.Inject; import com.google.inject.Injector; "cluster1", List<ExecutionCommandWrapper> executionCommands = stage.getExecutionCommands(null);
1
import java.util.Optional; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Stream; public Iterable<KeyPair> loadKeys() { return loadKeys(null); } protected Iterable<KeyPair> loadKeys(Predicate<KeyPair> filter) { return () -> { Stream<KeyPair> stream = safeMap(GenericUtils.stream(providers), this::doGetKeyPair); if (filter != null) { stream = stream.filter(filter); } return stream.iterator(); }; } /** * Performs a mapping operation on the stream, discarding any null values * returned by the mapper. */ private <U, V> Stream<V> safeMap(Stream<U> stream, Function<U, V> mapper) { return stream.map(u -> Optional.ofNullable(mapper.apply(u))) .filter(Optional::isPresent) .map(Optional::get); } private KeyPair doGetKeyPair(ClientIdentityProvider p) { try { KeyPair kp = p.getClientIdentity(); if (kp == null) { log.debug("loadKeys({}) no key loaded", p); return kp; } catch (Throwable e) { log.warn("loadKeys({}) failed ({}) to load key: {}", p, e.getClass().getSimpleName(), e.getMessage()); if (log.isDebugEnabled()) { log.debug("loadKeys(" + p + ") key load failure details", e); } return null;
0
import org.apache.hc.core5.reactor.DefaultListeningIOReactor; import org.apache.hc.core5.reactor.IOEventDispatch; import org.apache.hc.core5.reactor.IOReactorConfig; import org.apache.hc.core5.reactor.IOReactorException; import org.apache.hc.core5.reactor.IOReactorExceptionHandler; import org.apache.hc.core5.reactor.ListenerEndpoint;
1
import org.apache.log4j.Logger; private static final Logger LOG = Logger.getLogger(QuorumPeer.class); LOG.error("Got more than just an xid! Len = " LOG.error("FIXMSG",e); LOG.error("QuorumPeer responder thread exited"); LOG.warn("LOOKING"); LOG.error("FIXMSG",e); LOG.warn("FOLLOWING"); LOG.error("FIXMSG",e); LOG.warn("LEADING"); LOG.error("FIXMSG",e); LOG.error("QuorumPeer main thread exited"); LOG.warn(e.toString()); LOG.error("FIXMSG",e); LOG.error("FIXMSG",e);
0
import static org.junit.Assert.assertEquals; @Test public void testFireDeadline() throws Exception { assertEquals(BoundedWindow.TIMESTAMP_MAX_VALUE, AfterPane.elementCountAtLeast(1).getWatermarkCutoff( new IntervalWindow(new Instant(0), new Instant(10)))); }
0
import org.apache.accumulo.server.cli.ClientOpts;
0
package org.apache.accumulo.tserver.tablet;
0
if (key instanceof RSAPublicKey ) {
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/DynaBean.java,v 1.8 2003/10/09 20:43:15 rdonkin Exp $ * $Revision: 1.8 $ * $Date: 2003/10/09 20:43:15 $ * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * @version $Revision: 1.8 $ $Date: 2003/10/09 20:43:15 $
0
if (uri != null && !uri.isEmpty()) {
0
package com.google.cloud.dataflow.sdk.transforms.windowing; import org.joda.time.Instant; * {@code CompositeTrigger} performs much of the book-keeping necessary for implementing a trigger * that has multiple sub-triggers. Specifically, it includes support for passing events to the * sub-triggers, and tracking the finished-states of each sub-trigger. * * TODO: Document the methods on this and SubTriggerExecutor to support writing new composite * triggers. * * <p> This functionality is experimental and likely to change. * @param <W> {@link BoundedWindow} subclass used to represent the windows used by this * {@code CompositeTrigger} public abstract class CompositeTrigger<W extends BoundedWindow> implements Trigger<W> { protected List<Trigger<W>> subTriggers; protected CompositeTrigger(List<Trigger<W>> subTriggers) { * Helper that allows allows a {@code CompositeTrigger} to execute callbacks. public BitSet getFinishedSet() { return (BitSet) isFinished.clone(); } TriggerContext<W> compositeContext, int index, Object value, Instant timestamp, W window, WindowStatus status) childContext, index, subTrigger.onElement(childContext, value, timestamp, window, status)); public void markFinished(TriggerContext<W> compositeContext, int index) throws Exception { markFinishedInChild(compositeContext.forChild(index), index); protected static class BitSetCoder extends AtomicCoder<BitSet> {
0
private final H1Config h1Config; public DefaultHttpRequestParserFactory( final H1Config h1Config, final HttpRequestFactory<HttpRequest> requestFactory, final LineParser lineParser) { this.h1Config = h1Config != null ? h1Config : H1Config.DEFAULT; public DefaultHttpRequestParserFactory(final H1Config h1Config) { this(h1Config, null, null); public NHttpMessageParser<HttpRequest> create() {
0
this.headergroup.updateHeader(header); } public void setHeaders(final Header[] headers) { this.headergroup.setHeaders(headers);
0
import org.apache.beam.dsls.sql.BeamSqlCli; import org.apache.beam.dsls.sql.BeamSqlEnv; BeamSqlEnv.registerTable("ORDER_DETAILS", getOrderTable()); BeamSqlEnv.registerTable("ORDER_SUMMARY", getSummaryTable()); BeamSqlCli.compilePipeline(sql, pipeline); BeamSqlCli.compilePipeline(sql, pipeline);
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.http.lightweight.servlet; import java.io.IOException; import java.io.OutputStream; import javax.servlet.ServletOutputStream; /** * ServletOutputStream Implementation. * */ public class ServletOutputStreamImpl extends ServletOutputStream { private final OutputStream m_outputStream; /** * @param outputStream OutputStream */ public ServletOutputStreamImpl(OutputStream outputStream) { this.m_outputStream = outputStream; } /* (non-Javadoc) * @see java.io.OutputStream#write(int) */ public void write(int i) throws IOException { m_outputStream.write(i); } }
0
* @deprecated (3.3) Use {@link FTPClient#_openDataConnection_(FTPCmd, String)} instead
0
* Copyright 1999-2004 The Apache Software Foundation. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
import java.util.Collections; import java.util.Map; import java.util.WeakHashMap; // global storage for all existing ListDataSources private static final Map<ListDataSource<?>, List<List<?>>> storage = Collections.synchronizedMap(new WeakHashMap<>()); return new ListDataSource<>(true, Arrays.asList(partitions)); return new ListDataSource<>(false, Arrays.asList(partitions)); private final int id = System.identityHashCode(this); @SuppressWarnings("unchecked") private ListDataSource(boolean bounded, List<List<T>> partitions) { // save partitions to static storage storage.put(this, (List) partitions); } @Override public boolean equals(Object o) { if (o instanceof ListDataSource) { ListDataSource that = (ListDataSource) o; return this.id == that.id; } return false; } @Override public int hashCode() { return id; return storage.get(this).stream().map(data -> { @SuppressWarnings("unchecked") return (T) data.get(pos++);
0
/** * Retrieve the list of global request handlers. * * @return a list of named <code>GlobalRequestHandler</code> */ List<GlobalRequestHandler> getGlobalRequestHandlers();
0
public List<PubsubSource<T>> split( // This reader has never been started and there was no call to #split; // create a single random subscription, which will be kept in the checkpoint.
0
import com.google.cloud.dataflow.sdk.util.common.worker.SourceFormat; public static SourceFormat.OperationRequest public static SourceFormat.OperationResponse public static SourceFormat.SourceSpec cloudSourceToSourceSpec( @Nullable SourceFormat.OperationRequest request) { @Nullable SourceFormat.OperationResponse response) { public static Source sourceSpecToCloudSource(@Nullable SourceFormat.SourceSpec spec) { static class DataflowSourceOperationRequest implements SourceFormat.OperationRequest { static class DataflowSourceOperationResponse implements SourceFormat.OperationResponse { static class DataflowSourceSpec implements SourceFormat.SourceSpec { // Represents a cloud Source as a dictionary for encoding inside the {@code SOURCE_STEP_INPUT} addDictionary(res, PropertyNames.SOURCE_SPEC, source.getSpec()); addDictionary(res, PropertyNames.SOURCE_METADATA, addBoolean(res, PropertyNames.SOURCE_DOES_NOT_NEED_SPLITTING, res, PropertyNames.SOURCE_PRODUCES_SORTED_KEYS, metadata.getProducesSortedKeys()); res, PropertyNames.SOURCE_ESTIMATED_SIZE_BYTES, metadata.getEstimatedSizeBytes()); addBoolean(res, PropertyNames.SOURCE_IS_INFINITE, metadata.getInfinite()); res.setSpec(getDictionary(params, PropertyNames.SOURCE_SPEC)); // SOURCE_METADATA and SOURCE_DOES_NOT_NEED_SPLITTING do not have to be
0
import com.google.gson.Gson; import java.util.Collections; import java.util.Map;
0
* @version CVS $Id: ValueChangedEvent.java,v 1.3 2004/02/11 09:27:55 antonio Exp $
0
protected byte[] workBuf = new byte[Math.max(DEFAULT_FILE_HANDLE_SIZE, Integer.BYTES)]; ValidateUtils.checkTrue(length >= (Integer.BYTES + 1 /* command */), "Bad length to read: %d", length); Buffer buffer = new ByteArrayBuffer(length + Integer.BYTES + Long.SIZE /* a bit extra */, false);
0
public void testGetOptions() { CommandLine cmd = new CommandLine(); assertNotNull(cmd.getOptions()); assertEquals(0, cmd.getOptions().length); cmd.addOption(new Option("a", null)); cmd.addOption(new Option("b", null)); cmd.addOption(new Option("c", null)); assertEquals(3, cmd.getOptions().length); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestTransformedSortedSet.java,v 1.5 2003/10/12 06:37:30 psteitz Exp $ import java.util.SortedSet; import org.apache.commons.collections.BulkTest; * @version $Revision: 1.5 $ $Date: 2003/10/12 06:37:30 $ return BulkTest.makeSuite(TestTransformedSortedSet.class); SortedSet set = new TreeSet(); //----------------------------------------------------------------------- }
0
/** * Indicates whether the current ambari server instance is the active instance. * If this property is missing, the value will be considered to be true. * If present, it should be explicitly set to "true" to set this as the active instance. * Any other value will be taken as a false. */ @Markdown(description = "Indicates whether the current ambari server instance is active or not.") public static final ConfigurationProperty<Boolean> ACTIVE_INSTANCE = new ConfigurationProperty<>( "active.instance", Boolean.TRUE); * Get whether the current ambari server instance the active instance * * @return true / false */ public boolean isActiveInstance() { return Boolean.parseBoolean(getProperty(ACTIVE_INSTANCE)); } /**
0
Objects.equals(relationGuid, that.relationGuid) && return Objects.hash(categoryGuid, parentCategoryGuid, relationGuid, description);
0
* Whether or not the current document was transformed. */ protected boolean documentTransformed; /** documentTransformed = false; if (!documentTransformed) { computeTransform(); rotateAngle = 0; rotateCos = 1; previousRotateTransform = null; rotateTransform = null; if (zoomHandler != null) { zoomHandler.zoomChanged(1); } if (thumbnailCanvas != null) { thumbnailCanvas.repaint(); } documentTransformed = false; documentTransformed = true; documentTransformed = true; documentTransformed = true; documentTransformed = true; documentTransformed = true;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/Script.java,v 1.10 2003/10/09 21:21:27 rdonkin Exp $ * $Revision: 1.10 $ * $Date: 2003/10/09 21:21:27 $ * 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. * $Id: Script.java,v 1.10 2003/10/09 21:21:27 rdonkin Exp $ * @version $Revision: 1.10 $
0
import org.apache.xml.security.exceptions.XMLSecurityException; throw new XMLSecurityException(e);
0
public final V get( Class<?> key )
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList;
0
package org.apache.commons.net; * {@link org.apache.commons.net.DatagramSocketClient} * implementations.
0
* @version $Id$
1
m.add(m.createComponent().setImplementation(this).setInterface(Sequencer.class.getName(), props)); m.add(m.createComponent().setImplementation(this).setInterface(Sequencer.class.getName(), props));
0
for (@SuppressWarnings("unused") Entry<Key,Value> e : s) {}
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
.transform(path -> LocalResourceId.fromPath(path, isDirectory)) .transformAndConcat(matchResult -> { try { return matchResult.metadata(); } catch (IOException e) { throw new RuntimeException(e); } }) .transform(metadata -> ((LocalResourceId) metadata.resourceId()).getPath().toString())
0
/** * Returns the KeyedCombineFn used by this Combine operation. */ public KeyedCombineFn<? super K, ? super VI, ?, VO> getFn() { return fn; }
0
package org.apache.beam.sdk.options; import org.apache.beam.sdk.runners.BlockingDataflowPipelineRunner;
0
* * * * @version CVS $Id: ContinuationsManagerImpl.java,v 1.10 2004/04/09 19:52:54 vgritsenko Exp $ int timeToLive, * wk.dispose(); private WebContinuation generateContinuation(Object kont, WebContinuation parent, int ttl, ContinuationsDisposer disposer) { removeContinuation(wk);
0
package org.apache.zookeeper.server; * This class implements the ZooKeeper server MBean interface. private final Date startTime; private final String name; protected final ZooKeeperServer zks; public ZooKeeperServerBean(ZooKeeperServer zks) { startTime = new Date(); this.zks = zks; name = "StandaloneServer_port" + zks.getClientPort(); return name; return zks.serverStats().getAvgLatency(); return zks.serverStats().getMaxLatency(); return zks.serverStats().getMinLatency(); return zks.serverStats().getOutstandingRequests(); } public int getTickTime() { return zks.getTickTime(); public void setTickTime(int tickTime) { zks.setTickTime(tickTime); } return zks.serverStats().getPacketsReceived(); return zks.serverStats().getPacketsSent(); zks.serverStats().resetLatency(); zks.serverStats().resetMaxLatency(); ServerStats serverStats = zks.serverStats(); serverStats.resetRequestCounters(); serverStats.resetLatency();
0
* @version $Id: JexlTest.java,v 1.45 2004/08/20 06:08:54 dion Exp $ assertExpression(jc, "empty nullthing", Boolean.TRUE); assertExpression(jc, "empty string", Boolean.TRUE); assertExpression(jc, "empty array", Boolean.TRUE); assertExpression(jc, "empty map", Boolean.TRUE); assertExpression(jc, "empty set", Boolean.TRUE); assertExpression(jc, "empty list", Boolean.TRUE); assertExpression(jc, "empty longstring", Boolean.FALSE); assertExpression(jc, "not empty longstring", Boolean.TRUE); } public void testNot() throws Exception { JexlContext jc = JexlHelper.createContext(); jc.getVars().put("string", ""); assertExpression(jc, "not empty string", Boolean.FALSE); assertExpression(jc, "not(empty string)", Boolean.FALSE); assertExpression(jc, "not empty(string)", Boolean.FALSE); assertExpression(jc, "! empty string", Boolean.FALSE); assertExpression(jc, "!(empty string)", Boolean.FALSE); assertExpression(jc, "!empty(string)", Boolean.FALSE);
0
return new MapBackedSet<>(map, dummyValue);
1
return new DefaultHttpServerIODispatch(serviceHandler);
0
@Setup public void setup() throws Exception { TextMessage message = session.createTextMessage(value); producer.send(message); @Teardown public void teardown() throws Exception {
0
fbLength = 0;
0
"org/apache/batik/apps/svgbrowser/resources/svgbrowser.policy");
0
* Copyright 2003-2006 The Apache Software Foundation * A {@link java.util.Map.Entry Map.Entry} tied to a map underneath. * Compares this <code>Map.Entry</code> with another <code>Map.Entry</code>.
0
* * * /** private XMLOutput output; public JellyStylesheet() { setValueOfAction( public void run(Node node) throws Exception { ); } // Properties //------------------------------------------------------------------------- /** * Returns the output. * @return XMLOutput */ public XMLOutput getOutput() { return output; } /** * Sets the output. * @param output The output to set */ public void setOutput(XMLOutput output) { this.output = output; }
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.cli2.option; import org.apache.commons.cli2.OptionException; /** * @author Rob Oxspring */ public abstract class ParentTestCase extends OptionTestCase { public abstract void testProcessParent() throws OptionException; }
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