Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.ambari.server.utils.VersionUtils; String agentVersion = register.getAgentVersion(); String serverVersion = ambariMetaInfo.getServerVersion(); if (!VersionUtils.areVersionsCompatible(serverVersion, agentVersion)) { LOG.warn("Received registration request from host with non compatible" + " agent version" + ", hostname=" + hostname + ", agentVersion=" + agentVersion + ", serverVersion=" + serverVersion); throw new AmbariException("Cannot register host with non compatible" + " agent version" + ", hostname=" + hostname + ", agentVersion=" + agentVersion + ", serverVersion=" + serverVersion); }
0
if (entry.getName().equals("repository.xml") || entry.getName().equals("index.xml")) String repostr = url.toExternalForm(); if (repostr.endsWith("zip")) { repostr = "jar:".concat(repostr).concat("!/"); } else if (repostr.endsWith(".xml")) { repostr = repostr.substring(0, repostr.lastIndexOf('/')+1); } return repository(is, repostr); public RepositoryImpl repository(InputStream is, String uri) throws Exception RepositoryImpl repository = parser.parseRepository(is, uri);
0
log.warn("exceptionCaught({}) {}: {}", this, t.getClass().getSimpleName(), t.getMessage()); if (log.isDebugEnabled()) { log.debug("execeptionCaught(" + this + ") details", t); } log.warn(e.getClass().getSimpleName() + " while signal session " + toString() + " closed: " + e.getMessage()); if (log.isDebugEnabled()) { log.debug("preClose exception details", e); }
0
* @version CVS $Id: NewJXPathBinding.java,v 1.2 2004/04/12 14:05:08 tim Exp $
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: SourceLock.java,v 1.2 2004/03/05 13:02:21 bdelacretaz Exp $
1
import static org.easymock.EasyMock.createStrictMock; import org.apache.ambari.server.state.ConfigHelper; final ConfigHelper configHelper = injector.getInstance(ConfigHelper.class); configHelper.updateAgentConfigs(anyObject(Set.class)); expectLastCall().times(2); replay(configHelper); verify(clusters, cluster, zeppelinEnv, livy2Conf, livyConf, controller, configHelper); binder.bind(ConfigHelper.class).toInstance(createStrictMock(ConfigHelper.class));
0
* @param <I> Input type * @param <O> Output type
0
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; import org.apache.accumulo.core.iterators.system.ColumnFamilySkippingIterator; ColumnFamilySkippingIterator cfsi = new ColumnFamilySkippingIterator(delIter); SortedKeyValueIterator<Key,Value> itr = iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(env.getIteratorScope(), cfsi, extent, acuTableConf,
0
public List<Long> findTaskIdsByStage(long requestId, long stageId) { TypedQuery<Long> query = entityManagerProvider.get().createQuery("SELECT hostRoleCommand.taskId " + "FROM HostRoleCommandEntity hostRoleCommand " + "WHERE hostRoleCommand.stage.requestId=?1 " + "AND hostRoleCommand.stage.stageId=?2 "+ "ORDER BY hostRoleCommand.taskId", Long.class); return daoUtils.selectList(query, requestId, stageId); } @Transactional
1
package cz.seznam.euphoria.flink.streaming.windowing; import cz.seznam.euphoria.core.client.dataset.windowing.WindowID; import cz.seznam.euphoria.flink.streaming.StreamingWindowedElement; import org.apache.flink.streaming.api.windowing.windows.Window; import java.util.Objects; public class AttachedWindow<GROUP, LABEL> extends Window { private final WindowID<GROUP, LABEL> id; private final long emissionWatermark; public AttachedWindow(StreamingWindowedElement<GROUP, LABEL, ?> element) { this(element.getWindowID(), element.getEmissionWatermark()); } public AttachedWindow(WindowID<GROUP, LABEL> id, long emissionWatermark) { this.id = Objects.requireNonNull(id); this.emissionWatermark = emissionWatermark; } public long getEmissionWatermark() { return emissionWatermark; } @Override public long maxTimestamp() { return Long.MAX_VALUE; } @Override public boolean equals(Object o) { if (o instanceof AttachedWindow) { AttachedWindow<?, ?> that = (AttachedWindow<?, ?>) o; return this.id.equals(that.id); } return false; } @Override public int hashCode() { return id.hashCode(); } @Override public String toString() { return "AttachedWindow{" + "id=" + id + ", emissionWatermark=" + emissionWatermark + '}'; } }
0
import org.apache.batik.ext.awt.image.renderable.Filter;
0
/***************************************************************************** * Copyright (C) The Apache Software Foundation. All rights reserved. * * ------------------------------------------------------------------------- * * This software is published under the terms of the Apache Software License * * version 1.1, a copy of which has been included with this distribution in * * the LICENSE file. * *****************************************************************************/ package org.apache.batik.css.sac; import org.w3c.css.sac.Condition; import org.w3c.dom.Element; /** * This class provides an implementation of the * {@link org.w3c.css.sac.CombinatorCondition} interface. * * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a> * @version $Id$ */ public class CSSOMAndCondition extends AbstractCombinatorCondition { /** * Creates a new CombinatorCondition object. */ public CSSOMAndCondition(Condition c1, Condition c2) { super(c1, c2); } /** * <b>SAC</b>: Implements {@link * org.w3c.css.sac.Condition#getConditionType()}. */ public short getConditionType() { return SAC_AND_CONDITION; } /** * Tests whether this condition matches the given element. */ public boolean match(Element e, String pseudoE) { return ((ExtendedCondition)getFirstCondition()).match(e, pseudoE) && ((ExtendedCondition)getSecondCondition()).match(e, pseudoE); } /** * Returns a text representation of this object. */ public String toString() { return "" + getFirstCondition() + getSecondCondition(); } }
1
public void testNoEventReceiver() throws Exception { this.eventManager.send(new Event1()); } public void testUnsubscribe() throws Exception { EventReceiver receiver = new EventReceiver(); this.eventManager.subscribe(receiver); assertEquals(0, receiver.receiveCount); this.eventManager.send(new Event1()); assertEquals(1, receiver.receiveCount); this.eventManager.unsubscribe(receiver); this.eventManager.send(new Event1()); assertEquals(1, receiver.receiveCount); this.eventManager.subscribe(receiver); this.eventManager.send(new Event2()); assertEquals(2, receiver.receiveCount); } public void testMultiSubscribe() throws Exception { EventReceiver receiver = new EventReceiver(); this.eventManager.subscribe(receiver); assertEquals(0, receiver.receiveCount); this.eventManager.send(new Event1()); assertEquals(1, receiver.receiveCount); this.eventManager.subscribe(receiver); this.eventManager.send(new Event1()); assertEquals(2, receiver.receiveCount); this.eventManager.subscribe(receiver); this.eventManager.send(new Event2()); assertEquals(3, receiver.receiveCount); }
0
import org.apache.accumulo.core.data.TableId; ke = new KeyExtent(TableId.of(sa[0]), new Text(sa[1]), new Text(sa[2]));
0
* @version $Revision$
0
import static com.twitter.mesos.gen.ScheduleStatus.RESTARTING; public void testRestartShards() throws Exception { expectKillTask(2); control.replay(); buildScheduler(); scheduler.createJob(makeJob(OWNER_A, JOB_A, productionTask().setIsDaemon(true), 6)); changeStatus(Query.byJob(OWNER_A.role, JOB_A), ASSIGNED); changeStatus(Query.byJob(OWNER_A.role, JOB_A), RUNNING); scheduler.restartShards(OWNER_A.role, JOB_A, ImmutableSet.of(1, 5), OWNER_A.user); assertEquals(4, getTasks(Query.byStatus(RUNNING)).size()); assertEquals(2, getTasks(Query.byStatus(RESTARTING)).size()); changeStatus(Query.byStatus(RESTARTING), FINISHED); assertEquals(2, getTasks(Query.byStatus(PENDING)).size()); } @Test(expected = ScheduleException.class) public void testRestartNonexistentShard() throws Exception { control.replay(); buildScheduler(); scheduler.createJob(makeJob(OWNER_A, JOB_A, productionTask().setIsDaemon(true), 1)); changeStatus(Query.byJob(OWNER_A.role, JOB_A), ASSIGNED); changeStatus(Query.byJob(OWNER_A.role, JOB_A), FINISHED); scheduler.restartShards(OWNER_A.role, JOB_A, ImmutableSet.of(5), OWNER_A.user); } @Test public void testRestartPendingShard() throws Exception { control.replay(); buildScheduler(); scheduler.createJob(makeJob(OWNER_A, JOB_A, productionTask().setIsDaemon(true), 1)); scheduler.restartShards(OWNER_A.role, JOB_A, ImmutableSet.of(0), OWNER_A.user); } @Test
0
@SuppressWarnings("unchecked")
0
bundleSplitter.getBundleSizes(desiredNumBundles, this.getStartOffset(), this.getEndOffset())
0
* for the conversion. * if a conversion error occurs. An unlocalized pattern is used for the conversion. * if a conversion error occurs. An unlocalized pattern is used for the conversion. * @param pattern The conversion pattern * @param pattern The conversion pattern * for the conversion. * if a conversion error occurs. An unlocalized pattern is used for the conversion. * if a conversion error occurs. An unlocalized pattern is used for the conversion. * @param pattern The conversion pattern * @param pattern The conversion pattern * @param pattern The pattern is used for the conversion return Long.valueOf(((Number)result).longValue());
0
* <pre>{@code * --project=YOUR_PROJECT_ID * }</pre> * <pre>{@code * --output=[YOUR_LOCAL_FILE | gs://YOUR_OUTPUT_PREFIX] * }</pre> * <pre>{@code * --project=YOUR_PROJECT_ID * --stagingLocation=gs://YOUR_STAGING_DIRECTORY * --output=gs://YOUR_OUTPUT_PREFIX * }</pre> * <p> The default input is {@code gs://dataflow-samples/shakespeare/} and can be overridden with * {@code --input}.
0
import io.gearpump.streaming.dsl.javaapi.JavaStream;
0
import org.apache.beam.sdk.extensions.sql.impl.interpreter.BeamSqlExpressionEnvironments; assertEquals( "aaa", expression .evaluate(NULL_ROW, NULL_WINDOW, BeamSqlExpressionEnvironments.empty()) .getValue()); assertNull( expression .evaluate(NULL_ROW, NULL_WINDOW, BeamSqlExpressionEnvironments.empty()) .getValue());
0
List<ServiceTestInvocation> listInvocations = new ArrayList<>();
1
Map transformedInstructions = BundlePlugin.transformDirectives( instructions );
0
* Copyright 2001-2004 The Apache Software Foundation. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * @version $Id: DoubleMetaphone.java,v 1.19 2004/02/23 07:32:49 ggregory Exp $
0
import org.apache.aurora.gen.AppcImage; import org.apache.aurora.gen.Image; import org.apache.aurora.gen.MesosContainer; import org.apache.aurora.gen.Mode; import org.apache.aurora.gen.Volume; import static org.apache.aurora.scheduler.configuration.ConfigurationManager.NO_CONTAINER_VOLUMES; true, true, false, false, public void testContainerVolumesDisabled() throws Exception { TaskConfig builder = CONFIG_WITH_CONTAINER.newBuilder(); MesosContainer container = new MesosContainer() .setImage(Image.appc(new AppcImage("name", "id"))) .setVolumes(ImmutableList.of(new Volume("container", "host", Mode.RO))); builder.setContainer(Container.mesos(container)); expectTaskDescriptionException(NO_CONTAINER_VOLUMES); CONFIGURATION_MANAGER.validateAndPopulate(ITaskConfig.build(builder)); } @Test
0
import org.apache.beam.sdk.coders.StructuredCoder; public static class IntervalWindowCoder extends StructuredCoder<IntervalWindow> {
0
* Return a list of paths to files and dirs which are candidates for deletion from a given table, {@link RootTable#NAME} or {@link MetadataTable#NAME} * Fetch a list of paths for all bulk loads in progress (blip) from a given table, {@link RootTable#NAME} or {@link MetadataTable#NAME} * Fetches the references to files, {@link DataFileColumnFamily#NAME} or {@link ScanFileColumnFamily#NAME}, from tablets * @return An {@link Iterator} of {@link Entry}&lt;{@link Key}, {@link Value}&gt; which constitute a reference to a file.
0
* @version $Id: FileUploadBase.java,v 1.9 2004/10/11 05:06:33 martinc Exp $ if (!"post".equals(req.getMethod().toLowerCase())) { return false; }
0
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
0
public abstract static class Command {
0
import org.apache.accumulo.server.security.SecurityOperationImpl; SecurityOperation security = SecurityOperationImpl.getInstance(); SecurityOperationImpl.getInstance().deleteTable(SecurityConstants.getSystemCredentials(), tableInfo.tableId);
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.beam.sdk.options.Validation; @Validation.Required
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.beam.sdk.transforms.reflect; import org.apache.beam.sdk.transforms.DoFn; import org.apache.beam.sdk.transforms.DoFn.OnTimer; import org.apache.beam.sdk.transforms.DoFn.TimerId; /** * Provides {@link OnTimerInvoker} instances for invoking a particular {@link TimerId} * on a particular {@link DoFn}. */ interface OnTimerInvokerFactory { /** * Returns an invoker that will call the given {@link DoFn DoFn's} {@link OnTimer @OnTimer} method * for the given {@code timerId}. */ <InputT, OutputT> OnTimerInvoker<InputT, OutputT> forTimer( DoFn<InputT, OutputT> fn, String timerId); }
0
Map<String, TemporalInfo> temporalInfoMap = new HashMap<>();
1
public HttpMessageWriter<HttpRequest> create() { return new DefaultHttpRequestWriter(this.lineFormatter);
0
/* Generated By:JJTree&JavaCC: Do not edit this line. MiniParserConstants.java */ package Mini; public interface MiniParserConstants { int EOF = 0; int SINGLE_LINE_COMMENT = 7; int GT = 16; int LT = 17; int GEQ = 18; int LEQ = 19; int EQ = 20; int NEQ = 21; int NOT = 22; int FALSE = 23; int TRUE = 24; int AND = 25; int OR = 26; int PLUS = 27; int MINUS = 28; int MULT = 29; int MOD = 30; int DIV = 31; int LPAREN = 32; int RPAREN = 33; int ASSIGN = 34; int COMMA = 35; int READ = 36; int WRITE = 37; int DIGIT = 38; int LETTER = 39; int IDENT = 40; int INTEGER = 41; int STRING = 42; int DEFAULT = 0; int SINGLE_LINE_COMMENT_STATE = 1; String[] tokenImage = { "<EOF>", "\" \"", "\"\\t\"", "\"\\n\"", "\"\\r\"", "\"\\f\"", "\"--\"", "<SINGLE_LINE_COMMENT>", "<token of kind 8>", "\"FUN\"", "\"IF\"", "\"THEN\"", "\"ELSE\"", "\"FI\"", "\"LET\"", "\"IN\"", "\">\"", "\"<\"", "\">=\"", "\"<=\"", "\"==\"", "\"!=\"", "\"!\"", "\"FALSE\"", "\"TRUE\"", "\"AND\"", "\"OR\"", "\"+\"", "\"-\"", "\"*\"", "\"%\"", "\"/\"", "\"(\"", "\")\"", "\"=\"", "\",\"", "\"READ\"", "\"WRITE\"", "<DIGIT>", "<LETTER>", "<IDENT>", "<INTEGER>", "<STRING>", }; }
0
import java.nio.charset.StandardCharsets; import org.apache.sshd.common.util.GenericUtils; @Test public void testPutCharsWithNullOrEmptyValue() { Buffer buffer = new ByteArrayBuffer(Integer.SIZE); for (char[] chars : new char[][]{null, GenericUtils.EMPTY_CHAR_ARRAY}) { buffer.putChars(chars); String value = buffer.getString(); assertEquals("Mismatched value for " + ((chars == null) ? "null" : "empty") + " characters", "", value); } } @Test public void testPutCharsOnNonEmptyValue() { String expected = getCurrentTestName(); Buffer buffer = new ByteArrayBuffer(expected.length() + Byte.SIZE); buffer.putChars(expected.toCharArray()); String actual = buffer.getString(); assertEquals("Mismatched recovered values", expected, actual); } @Test public void testPutAndWipeChars() { String expected = getCurrentTestName(); char[] chars = expected.toCharArray(); Buffer buffer = new ByteArrayBuffer(chars.length + Byte.SIZE); buffer.putAndWipeChars(chars); String actual = buffer.getString(); assertEquals("Mismatched recovered values", expected, actual); for (int index = 0; index < chars.length; index++) { assertEquals("Character not wiped at index=" + index, 0, chars[index]); } } @Test public void testPutAndWipeBytes() { String expected = getCurrentTestName(); byte[] bytes = expected.getBytes(StandardCharsets.UTF_8); Buffer buffer = new ByteArrayBuffer(bytes.length + Byte.SIZE); buffer.putAndWipeBytes(bytes); String actual = buffer.getString(); assertEquals("Mismatched recovered values", expected, actual); for (int index = 0; index < bytes.length; index++) { assertEquals("Value not wiped at index=" + index, 0, bytes[index]); } }
0
AccumuloInputFormat.setConnectorInfo(job, getPrincipal(), getToken()); AccumuloOutputFormat.setConnectorInfo(job, getPrincipal(), getToken());
0
import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger LOGGER = LoggerFactory.getLogger(JaasPasswordAuthenticator.class); LOGGER.error("Authentication failed with error", e);
0
repo.load();
0
* * * * it wraps. This implementation can cache the content either * 1) Synchronously. This means that the cached contents are checked for validity * * period in seconds, and optionally a cache key: * The second querystring parameter instructs that the cache key be extended with the string * This factory creates either instances of {@link org.apache.cocoon.components.source.impl.CachingSource} * * * @version CVS $Id: CachingSourceFactory.java,v 1.11 2004/06/11 12:18:23 vgritsenko Exp $ public void service(ServiceManager manager) { // Due to cyclic dependencies we can't lookup the resolver, // the refresher or the cache until after the factory is // initialized. // 'async' parameter this.async = parameters.getParameterAsBoolean("async", false); this.defaultExpires = parameters.getParameterAsInteger("default-expires", -1); * } else { // ---------------------------------------------------- URIAbsolutizer implementation
0
{ XMLPropertyListConfiguration copy = new XMLPropertyListConfiguration((HierarchicalConfiguration) config); StrictConfigurationComparator comp = new StrictConfigurationComparator(); assertTrue("Configurations are not equal", comp.compare(config, copy)); }
0
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ambari.server.state; public class PropertyInfo { private String name; private String value; private String description; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
0
import org.apache.aurora.scheduler.resources.ResourceSlot;
0
List<ElementValuePairGen> out = new ArrayList<>(); evs = new ArrayList<>(); List<Attribute> newAttributes = new ArrayList<>(); List<Attribute> newAttributes = new ArrayList<>();
0
assertEquals(multiSet, synced);
0
package org.apache.felix.ipojo.runtime.core.services; public interface Service { public int count(); }
0
RandomAccessContent getRandomAccessContent(final RandomAccessMode mode) throws FileSystemException; FileContentInfo getContentInfo() throws FileSystemException; boolean isOpen();
0
* Copyright 2000-2009 The Apache Software Foundation
0
package org.apache.batik.anim.dom; import org.apache.batik.dom.svg.SVGMotionAnimatableElement;
0
import org.mozilla.javascript.Scriptable; Scriptable rootScope; return new JavaScriptExpression(language, expression, rootScope); } public Scriptable getRootScope() { return rootScope; } public void setRootScope(Scriptable rootScope) { this.rootScope = rootScope;
0
import java.util.List;
0
} if( localBuffer.size() == 0 ) { //If localBuffer is empty, then reset the timer lastDispatchTime = currTimeMS;
0
this.future = new BasicFuture<>(callback);
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Lists;
0
Preconditions.checkNotNull(inputWM); Preconditions.checkNotNull(inputWM); Preconditions.checkNotNull(inputWM); * Result of {@link #extractAndRelease}. */ public static class OldAndNewHolds { public final Instant oldHold; @Nullable public final Instant newHold; public OldAndNewHolds(Instant oldHold, @Nullable Instant newHold) { this.oldHold = oldHold; this.newHold = newHold; } } /** public ReadableState<OldAndNewHolds> extractAndRelease( return new ReadableState<OldAndNewHolds>() { public ReadableState<OldAndNewHolds> readLater() { public OldAndNewHolds read() { Instant oldHold; oldHold = extraHold; oldHold = elementHold; oldHold = elementHold; oldHold = extraHold; if (oldHold == null || oldHold.isAfter(context.window().maxTimestamp())) { oldHold, context.key(), context.window()); oldHold = context.window().maxTimestamp(); @Nullable Instant newHold = null; newHold = addEndOfWindowOrGarbageCollectionHolds(context); return new OldAndNewHolds(oldHold, newHold); /** * Return the current data hold, or null if none. Does not clear. For debugging only. */ @Nullable public Instant getDataCurrent(ReduceFn<?, ?, ?, W>.Context context) { return context.state().access(elementHoldTag).read(); }
0
import org.apache.accumulo.core.conf.DefaultConfiguration; import org.apache.accumulo.core.conf.SiteConfiguration; AccumuloConfiguration conf = SiteConfiguration.getInstance(DefaultConfiguration.getInstance());
0
import org.apache.hc.core5.http.HttpResponse; import org.apache.hc.core5.http.HttpStatus; /** * @since 5.0 */ public static boolean canResponseHaveBody(final String method, final HttpResponse response) { if ("HEAD".equalsIgnoreCase(method)) { return false; } final int status = response.getCode(); if ("CONNECT".equalsIgnoreCase(method) && status == HttpStatus.SC_OK) { return false; } return status >= HttpStatus.SC_SUCCESS && status != HttpStatus.SC_NO_CONTENT && status != HttpStatus.SC_NOT_MODIFIED; }
0
return PaneInfo.NO_FIRING; return PaneInfo.NO_FIRING;
0
* @version $Id: AbstractContainerWidget.java,v 1.12 2004/05/07 16:43:42 mpo Exp $ public void addChild(Widget widget) { public boolean hasChild(String id) { public Widget getChild(String id) { return widgets.getWidget(id);
0
* @version CVS $Id: ProxyTransformer.java,v 1.10 2004/03/20 17:02:46 cziegeler Exp $ protected void processRequest() throws SAXException { } catch (MalformedURLException ex) { } catch (IOException ex) { } catch (SAXException se) { throw se; } catch (Exception ex) { throw new SAXException(ex); protected Document readXML(HttpURLConnection connection) throws SAXException { } catch (Exception ex) { throw new SAXException(ex);
0
* @version CVS $Id: SourceDescriptionGenerator.java,v 1.3 2003/03/24 14:33:56 stefano Exp $ this.contentHandler.startPrefixMapping("", properties[i].getNamespace());
0
public void setTimeout(Short timeout) { this.timeout = timeout; }
0
import org.apache.http.conn.ConnectionRequest; import org.apache.http.impl.client.HttpClients; this.httpclient = HttpClients.custom().setConnectionManager(this.mgr).build();
0
* Standard authentication schemes supported by HttpClient.
0
package org.apache.commons.collections4.trie.analyzer; import org.apache.commons.collections4.trie.KeyAnalyzer; public class CharArrayKeyAnalyzer extends KeyAnalyzer<char[]> { /** A singleton instance of {@link CharArrayKeyAnalyzer}. */ /** The number of bits per {@link Character}. */ /** A bit mask where the first bit is 1 and the others are zero. */ /** Returns a bit mask where the given bit is set. */ final char[] other, final int otherOffsetInBits, final int otherLengthInBits) { public boolean isPrefix(final char[] prefix, final int offsetInBits, final int lengthInBits, final char[] key) {
0
try (PrintWriter file = new PrintWriter(new FileOutputStream(dir + class_name + ".html"))) { file.println("<HTML>\n" + "<HEAD><TITLE>Documentation for " + class_name + "</TITLE>" + "</HEAD>\n" + "<FRAMESET BORDER=1 cols=\"30%,*\">\n" + "<FRAMESET BORDER=1 rows=\"80%,*\">\n" + "<FRAME NAME=\"ConstantPool\" SRC=\"" + class_name + "_cp.html" + "\"\n MARGINWIDTH=\"0\" " + "MARGINHEIGHT=\"0\" FRAMEBORDER=\"1\" SCROLLING=\"AUTO\">\n" + "<FRAME NAME=\"Attributes\" SRC=\"" + class_name + "_attributes.html" + "\"\n MARGINWIDTH=\"0\" " + "MARGINHEIGHT=\"0\" FRAMEBORDER=\"1\" SCROLLING=\"AUTO\">\n" + "</FRAMESET>\n" + "<FRAMESET BORDER=1 rows=\"80%,*\">\n" + "<FRAME NAME=\"Code\" SRC=\"" + class_name + "_code.html\"\n MARGINWIDTH=0 " + "MARGINHEIGHT=0 FRAMEBORDER=1 SCROLLING=\"AUTO\">\n" + "<FRAME NAME=\"Methods\" SRC=\"" + class_name + "_methods.html\"\n MARGINWIDTH=0 " + "MARGINHEIGHT=0 FRAMEBORDER=1 SCROLLING=\"AUTO\">\n" + "</FRAMESET></FRAMESET></HTML>"); }
0
* Properties for type store graph */ public static final String TYPE_CATEGORY_PROPERTY_KEY = "type.category"; public static final String VERTEX_TYPE_PROPERTY_KEY = "type"; public static final String TYPENAME_PROPERTY_KEY = "type.name"; /**
0
logoutContext.putAll(Parameters.toProperties(par));
0
if ( file.equals( getOutputDirectory() ) ) { file.mkdirs(); } else { throw new FileNotFoundException( file.getPath() ); } analyzer.getJar().setManifest( analyzer.calcManifest() );
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.8 $
0
ArrayList<Text> rows = new ArrayList<>();
0
import org.apache.http.util.Asserts; Asserts.check(this.status.compareTo(IOReactorStatus.ACTIVE) <= 0, "I/O reactor has been shut down");
0
protected boolean syncEnabled = true; } else if (key.equals( "syncEnabled" )) { syncEnabled = Boolean.parseBoolean(value); dynamicConfigFileStr = value; public boolean getSyncEnabled() { return syncEnabled; }
0
import org.slf4j.LoggerFactory; LoggerFactory.getLogger(RenameTable.class).debug("Renamed table " + tableId + " " + oldTableName + " " + newTableName);
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.impl.manager; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.osgi.framework.ServiceEvent; import org.osgi.framework.ServiceReference; public class ExtendedServiceEvent extends ServiceEvent { private List<AbstractComponentManager<?>> managers; public ExtendedServiceEvent(ServiceEvent source) { super(source.getType(), source.getServiceReference()); } public ExtendedServiceEvent(int type, ServiceReference ref) { super(type, ref); } public void addComponentManager(AbstractComponentManager<?> manager) { if (managers == null) managers = new ArrayList<AbstractComponentManager<?>>(); managers.add(manager); } public List<AbstractComponentManager<?>> getManagers() { return managers == null ? Collections.<AbstractComponentManager<?>> emptyList() : managers; } public void activateManagers() { for (AbstractComponentManager<?> manager : getManagers()) { manager.activateInternal(); } } }
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
RequestStatus create(ResourceInstance resource, RequestBody requestBody) RequestStatus update(ResourceInstance resource, RequestBody requestBody) RequestStatus delete(ResourceInstance resource, RequestBody requestBody)
0
|| !fieldPresent( schema, ATTRIBUTES_FIELD, Schema.FieldType.map(VARCHAR.withNullable(false), VARCHAR)) return schema.hasField(field) && expectedType.equivalent( schema.getField(field).getType(), Schema.EquivalenceNullablePolicy.IGNORE);
0
* Session input buffer for non-blocking connections. boolean hasData(); int length();
0
// if nothing has matched and it is the last pipeline, then it's the right time // to throw an ResourceNotFoundException throw new ResourceNotFoundException("No pipeline matched request: " + env.getURIPrefix() + env.getURI());
0
// ~ just access the windows testifying their accessibility long firstWindowStart = assertOutput0(fs.subList(0, 4), 1000L, long secondWindowStart = assertOutput0(fs.subList(4, fs.size()), 1000L, private <F, S> long assertOutput0( assertOutput1(out.subList(0, 4), 1000L, "four", "one", "three", "two"); assertOutput1(out.subList(4, out.size()), 1000L, "one", "three", "two"); private <S> long assertOutput1( List<Pair<TimeInterval, S>> window, long expectedIntervalMillis, String ... expectedFirstAndSecond) { assertEquals( asList(expectedFirstAndSecond), window.stream().map(Pair::getSecond).sorted().collect(toList())); // ~ assert the windowing label (all elements of the window are expected to have // the same window label) long[] starts = window.stream().mapToLong(p -> { assertEquals(expectedIntervalMillis, p.getFirst().getIntervalMillis()); return p.getFirst().getStartMillis(); }).distinct().toArray(); assertEquals(1, starts.length); return starts[0]; }
0
* {@code FilePersistenceManager} class.
0
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
0
import org.apache.commons.vfs2.util.Os; import org.junit.Assume; if (Os.isFamily(Os.OS_FAMILY_WINDOWS)) { // We do not use newZipFile in the Assert message to avoid touching it before calling delete(). Assert.assertFalse("Could not delete file", newZipFile.delete()); } Assume.assumeTrue(Os.isFamily(Os.OS_FAMILY_WINDOWS));
0
private String desiredStackId; // UPDATE * @return the desiredStackId */ public String getDesiredStackId() { return desiredStackId; } /** * @param desiredStackId the desiredStackId to set */ public void setDesiredStackId(String desiredStackId) { this.desiredStackId = desiredStackId; } /** + ", desiredStackId=" + desiredStackId
0
import org.apache.accumulo.core.metadata.schema.DataFileValue;
1
* @version CVS $Id: Web3Properties.java,v 1.2 2003/03/16 17:49:10 vgritsenko Exp $ }
0
class UnsupportedOperatorsVisitor extends SqlShuttle {
0
final DnsResolver dnsResolver) { this(socketFactoryRegistry, connFactory, null, dnsResolver, -1, TimeUnit.MILLISECONDS); } public PoolingHttpClientConnectionManager( final Registry<ConnectionSocketFactory> socketFactoryRegistry, final HttpConnectionFactory<SocketClientConnection> connFactory,
0
* @version CVS $Id: RequestModule.java,v 1.2 2003/03/16 17:49:12 vgritsenko Exp $
0
import org.apache.sshd.common.util.security.SecurityUtils;
0
* Optional, unary reference: No service required to be available for the * refernce to be satisfied. Only a single service is available through this * reference. OPTIONAL_UNARY("0..1"), * Mandatory, unary reference: At least one service must be available for * the reference to be satisfied. Only a single service is available through * this reference. MANDATORY_UNARY("1..1"), * Optional, multiple reference: No service required to be available for the * refernce to be satisfied. All matching services are available through * this reference. OPTIONAL_MULTIPLE("0..n"), * Mandatory, multiple reference: At least one service must be available for * the reference to be satisified. All matching services are available * through this reference. MANDATORY_MULTIPLE("1..n");
0
/* * 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.commons.exec; /** * Interface for classes that want to be notified by Watchdog. * * @see org.apache.commons.exec.Watchdog */ public interface TimeoutObserver { /** * Called when the watchdow times out. * * @param w * the watchdog that timed out. */ void timeoutOccured(Watchdog w); }
1
* @version CVS $Id$
0
protected static final Random epochGen = new Random();
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
return getDH(new BigInteger(DHGroupData.getP1()), new BigInteger(DHGroupData.getG()));
0