Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.atlas.TestModules; @Guice(modules = TestModules.TestOnlyModule.class)
0
* Autogenerated by Thrift Compiler (0.9.3) import javax.annotation.Generated; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2015-12-16") public class IteratorConfig implements org.apache.thrift.TBase<IteratorConfig, IteratorConfig._Fields>, java.io.Serializable, Cloneable, Comparable<IteratorConfig> { List<Object> list = new ArrayList<Object>(); boolean present_iterators = true && (isSetIterators()); list.add(present_iterators); if (present_iterators) list.add(iterators); return list.hashCode(); TIteratorSetting _elem99; for (int _i100 = 0; _i100 < _list98.size; ++_i100) _elem99 = new TIteratorSetting(); _elem99.read(iprot); struct.iterators.add(_elem99); TIteratorSetting _elem104; for (int _i105 = 0; _i105 < _list103.size; ++_i105) _elem104 = new TIteratorSetting(); _elem104.read(iprot); struct.iterators.add(_elem104);
0
put("timeline.metrics.service.default.result.limit", String.valueOf(5760)); put("timeline.metrics.cluster.aggregator.minute.interval", String.valueOf(1000)); put("timeline.metrics.host.aggregator.minute.interval", String.valueOf(1000)); put("timeline.metrics.service.default.result.limit", String.valueOf(11520)); put("timeline.metrics.cluster.aggregator.second.interval", String.valueOf(120)); put("timeline.metrics.cluster.aggregator.minute.interval", String.valueOf(300)); put("timeline.metrics.host.aggregator.minute.interval", String.valueOf(300));
0
// Save the prefix of the log file paths hostObject.setPrefix(register.getPrefix());
1
oldContentHandler = digester.getCustomContentHandler(); getDigester().setCustomContentHandler(oldContentHandler); * When this method fires, the digester is told to forward all SAX * ContentHandler events to the builder object, resulting in a DOM being * handler is restored (expected to be NULL, allowing normal Digester * operations to continue). // the NodeBuilder constructor has already saved the original // value of the digester's custom content handler (expected to // be null, but we save it just in case). So now we just // need to tell the digester to forward events to the builder. getDigester().setCustomContentHandler(builder);
0
/** * The component manager given by the upper level * (root manager or parent concrete processor) */ protected ServiceManager manager; enableLogging(parent.getLogger()); this.manager = parent.concreteProcessor.getComponentInfo().getServiceManager(); this.resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE); ContainerUtil.service(this.environmentHelper, this.manager); this.manager = manager; this.resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE); ContainerUtil.service(this.environmentHelper, this.manager); this.sitemapExecutor = (SitemapExecutor) this.manager.lookup(SitemapExecutor.ROLE); SourceUtil.toSAX(this.manager, source, null, handler); return (TreeBuilder) this.manager.lookup(result); } catch (Exception e) { version + " at " + this.source.getURI(), e); EnvironmentHelper.enterProcessor(this, this.manager, env); treeBuilder.setParentProcessorManager(this.manager); this.manager.release(treeBuilder); this.manager.release(this.sitemapExecutor); if (this.manager != null) { this.manager.release(this.resolver); this.manager = null;
0
Object condition = node.jjtGetChild(0).jjtAccept(this, data); Object lhs = node.jjtGetChild(0).jjtAccept(this, data); && !(context.has(name))) { if (object == null) {
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 $Revision: 1.8 $ $Date: 2004/02/18 00:59:50 $
0
// Implementation methods
0
package org.apache.ambari.logsearch.model.response; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @ApiModel @JsonIgnoreProperties(ignoreUnknown = true) public class CountData { @ApiModelProperty private String name; @ApiModelProperty private Long count;
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. */ /** * SCR plugin annotation tag provider default implementation for annotations provided in package * <code>org.apache.felix.scrplugin.annotations</code>. */ package org.apache.felix.scrplugin.tags.annotation.defaulttag;
0
@SuppressWarnings("serial")
0
@Override public void visit(State state, Properties props) throws Exception { Connector conn = state.getConnector(); Random rand = (Random) state.get("rand"); @SuppressWarnings("unchecked") List<String> tableNames = (List<String>) state.get("tables"); String tableName = tableNames.get(rand.nextInt(tableNames.size())); try { conn.tableOperations().offline(tableName); log.debug("Offlined " + tableName); UtilWaitThread.sleep(rand.nextInt(200)); conn.tableOperations().online(tableName); log.debug("Onlined " + tableName); } catch (TableNotFoundException tne) { log.debug("offline or online failed " + tableName + ", doesnt exist"); }
1
/* ==================================================================== * Copyright (c) 2003-2004 The Apache Software Foundation. All rights * @version $Revision: 1.4 $ $Date: 2004/01/14 21:34:34 $
0
import org.apache.http.annotation.Immutable;
0
public static final String CONSUMER_RETRY_INTERVAL="atlas.notification.consumer.retry.interval"; private final int consumerRetryInterval; consumerRetryInterval = applicationProperties.getInt(CONSUMER_RETRY_INTERVAL, 500); LOG.warn("Error handling message" + e.getMessage()); try{ LOG.info("Sleeping for {} ms before retry", consumerRetryInterval); Thread.sleep(consumerRetryInterval); }catch (InterruptedException ie){ LOG.error("Notification consumer thread sleep interrupted"); }
0
try (final CloseableHttpAsyncClient client = HttpAsyncClients.custom()
0
GroupReducer reducer = new GroupReducer<>( FlinkElement::new,
0
*/ private final Map<InstructionContext, Frame> outFrames; // key: the last-executed JSR * The 'execution predecessors' - a list of type InstructionContext */ // new inFrame is already merged in, see above. // default case: Fall through. /** /** }
0
* In ASCII mode, if convertCRtoCRLF is true (currently always true), any CR is converted to CRLF. * Also a bare LF is converted to CRLF and a bare CR is converted to CR\0 case '\n': if (!__lastWasCR) { // convert LF to CRLF __client._sendByte('\r'); } __client._sendByte(ch); __lastWasCR = false; break; __lastWasCR = false; __lastWasCR = false;
0
@Test public void testGetRequestsByStatus() throws AmbariException { List<Long> requestIds = new ArrayList<Long>(); requestIds.add(requestId + 1); requestIds.add(requestId); populateActionDB(db, hostName, requestId, stageId); clusters.addHost("host2"); clusters.getHost("host2").persist(); populateActionDB(db, hostName, requestId + 1, stageId); List<Long> requestIdsResult = db.getRequestsByStatus(null); assertNotNull("List of request IDs is null", requestIdsResult); assertEquals("Request IDs not matches", requestIds, requestIdsResult); }
0
* @version CVS $Id: EmptySelectionList.java,v 1.2 2004/03/09 13:08:46 cziegeler Exp $ contentHandler.startElement(Constants.INSTANCE_NS, SELECTION_LIST_EL, Constants.INSTANCE_PREFIX_COLON + SELECTION_LIST_EL, Constants.EMPTY_ATTRS); contentHandler.startElement(Constants.INSTANCE_NS, ITEM_EL, Constants.INSTANCE_PREFIX_COLON + ITEM_EL, itemAttrs); contentHandler.startElement(Constants.INSTANCE_NS, LABEL_EL, Constants.INSTANCE_PREFIX_COLON + LABEL_EL, Constants.EMPTY_ATTRS); contentHandler.endElement(Constants.INSTANCE_NS, LABEL_EL, Constants.INSTANCE_PREFIX_COLON + LABEL_EL); contentHandler.endElement(Constants.INSTANCE_NS, ITEM_EL, Constants.INSTANCE_PREFIX_COLON + ITEM_EL); contentHandler.endElement(Constants.INSTANCE_NS, SELECTION_LIST_EL, Constants.INSTANCE_PREFIX_COLON + SELECTION_LIST_EL);
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.bcel.verifier; import java.util.Collection; import junit.framework.TestCase; public class VerifierTestCase extends TestCase { public void testDefaultMethodValidation() { String classname = Collection.class.getName(); Verifier verifier = VerifierFactory.getVerifier(classname); VerificationResult result = verifier.doPass1(); assertEquals("Pass 1 verification of " + classname + " failed: " + result.getMessage(), VerificationResult.VERIFIED_OK, result.getStatus()); result = verifier.doPass2(); assertEquals("Pass 2 verification of " + classname + " failed: " + result.getMessage(), VerificationResult.VERIFIED_OK, result.getStatus()); } }
0
if (!(e instanceof CSSStylableElement)) return false; // Can't match an unstylable element.
0
import com.sun.jersey.core.util.MultivaluedMapImpl; import javax.ws.rs.core.MultivaluedMap; import java.util.Collections; import static org.testng.Assert.*; MultivaluedMap<String, String> filterParams = new MultivaluedMapImpl(); filterParams.add(SearchFilter.PARAM_TYPE, "ENTITY"); MultivaluedMap<String, String> searchParams = new MultivaluedMapImpl(); searchParams.add(SearchFilter.PARAM_TYPE, "CLASS"); searchParams.add(SearchFilter.PARAM_SUPERTYPE, classDefA.getName()); searchParams.add(SearchFilter.PARAM_NOT_SUPERTYPE, classDefB.getName());
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestPredicatedBag.java,v 1.3 2003/09/20 17:05:36 scolebourne Exp $ import java.util.Set; import org.apache.commons.collections.TestBag; * @version $Revision: 1.3 $ $Date: 2003/09/20 17:05:36 $
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. */
0
// Add sequence for hostcomponentstate id addSequence("hostcomponentstate_id_seq", id.get(), false);
0
* @version CVS $Id: JavascriptLanguage.java,v 1.2 2003/10/07 15:13:20 tcurdt Exp $ return XSLTExtension.escapeJavaString(constant);
0
script.execute(new MapContext(payload)); public static class Foo245 { private Object bar = null; void setBar(Object bar) { this.bar = bar; } public Object getBar() { return bar; } } @Test public void test245() throws Exception { MapContext ctx = new MapContext(); Foo245 foo245 = new Foo245(); ctx.set("foo", foo245); JexlEngine engine = new JexlBuilder().strict(true).silent(false).create(); JexlExpression foobar = engine.createExpression("foo.bar"); JexlExpression foobaz = engine.createExpression("foo.baz"); JexlExpression foobarbaz = engine.createExpression("foo.bar.baz"); // add ambiguity with null & not-null Object[] args = { null, 245 }; for(Object arg : args ){ foo245.setBar(arg); // ok Assert.assertEquals(foo245.getBar(), foobar.evaluate(ctx)); // fail level 1 try { foobaz.evaluate(ctx); Assert.fail("foo.baz is not solvable"); } catch(JexlException xp) { Assert.assertTrue(xp instanceof JexlException.Property); } // fail level 2 try { foobarbaz.evaluate(ctx); Assert.fail("foo.bar.baz is not solvable"); } catch(JexlException xp) { Assert.assertTrue(xp instanceof JexlException.Property); } } }
0
public enum HttpAuthenticationMechanism { /** * No security. */ NONE, Arg.create(HttpAuthenticationMechanism.NONE); private final HttpAuthenticationMechanism mechanism; this(HTTP_AUTHENTICATION_MECHANISM.get(), SHIRO_REALM_MODULE.get()); this(HttpAuthenticationMechanism.BASIC, ImmutableSet.of(shiroConfigurationModule)); private ApiSecurityModule( HttpAuthenticationMechanism mechanism, Set<Module> shiroConfigurationModules) { this.mechanism = requireNonNull(mechanism); if (mechanism != HttpAuthenticationMechanism.NONE) { switch (mechanism) { addError("Unrecognized HTTP authentication mechanism: " + mechanism);
0
import org.apache.accumulo.core.iterators.system.InterruptibleIterator; import org.apache.accumulo.core.iterators.system.LocalityGroupIterator; import org.apache.accumulo.core.iterators.system.LocalityGroupIterator.LocalityGroup; import org.apache.accumulo.core.util.MutableByteSequence; import org.apache.commons.lang.mutable.MutableLong; private Map<ByteSequence,MutableLong> columnFamilies; columnFamilies = new HashMap<ByteSequence,MutableLong>(); columnFamilies = new HashMap<ByteSequence,MutableLong>(); columnFamilies = new HashMap<ByteSequence,MutableLong>(); columnFamilies.put(cf, new MutableLong(0)); MutableLong count = columnFamilies.get(cf); count = new MutableLong(0); count.increment(); columnFamilies = new HashMap<ByteSequence,MutableLong>(); columnFamilies.put(new ArrayByteSequence(cf), new MutableLong(count)); for (Entry<ByteSequence,MutableLong> entry : columnFamilies.entrySet()) { out.writeLong(entry.getValue().longValue()); private static class LocalityGroupReader extends LocalityGroup implements FileSKVIterator { super(lgm.columnFamilies, lgm.isDefaultLG); super(lgr.columnFamilies, lgr.isDefaultLocalityGroup); MutableByteSequence valbs = new MutableByteSequence(new byte[64], 0, 0); MutableByteSequence valbs = new MutableByteSequence(new byte[64], 0, 0); valbs = new MutableByteSequence(val.get(), 0, val.getSize()); @Override public InterruptibleIterator getIterator() { return this; } numLGSeeked = LocalityGroupIterator.seek(this, lgReaders, nonDefaultColumnFamilies, range, columnFamilies, inclusive);
0
import org.apache.flink.test.util.AbstractTestBase; import org.junit.After; import org.junit.Before; import org.junit.Test; public class TopWikipediaSessionsTest extends AbstractTestBase implements Serializable { @Before public void preSubmit() throws Exception { @After public void postSubmit() throws Exception { @Test public void testProgram() throws Exception {
0
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * 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.ipojo.test.scenarios.bad.service; import java.util.Properties; public interface BarService { public boolean bar(); public Properties getProps(); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/TestAll.java,v 1.4 2003/12/30 21:56:17 scolebourne Exp $ * @version $Revision: 1.4 $ $Date: 2003/12/30 21:56:17 $ suite.addTest(TestAbstractOrderedBidiMapDecorator.suite());
0
* @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
0
import org.apache.accumulo.core.client.Instance; import org.junit.Before; import org.junit.Rule; import org.junit.rules.TestName; private Connector conn; @Rule public TestName test = new TestName(); @Before public void setupInstance() throws Exception { Instance instance = new org.apache.accumulo.core.client.mock.MockInstance(test.getMethodName()); conn = instance.getConnector("root", new PasswordToken("")); } assertEquals(0, CIFTester.main(conn.getInstance().getInstanceName(), "root", "", "test", CIFTester.TestMapper.class.getName())); assertEquals(1, CIFTester.main(conn.getInstance().getInstanceName(), "root", "", "test", CIFTester.TestNoClose.class.getName())); assertEquals(0, CIFTester.main(conn.getInstance().getInstanceName(), "root", "", "test", CIFTester.TestBadData.class.getName()));
0
/** * 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
* Gets the system info. e.g. Available schemes, provider configuration builder, ... SystemInfo getSystemInfo(); * The class to use to determine the content-type (mime-type) * * @return FileContentInfoFactory getFileContentInfoFactory();
0
import org.apache.commons.digester3.binder.SetTopBuilder; protected void bindRule( LinkedRuleBuilder linkedRuleBuilder, String methodName, String paramType ) SetTopBuilder builder = linkedRuleBuilder.setTop( methodName ); if ( paramType != null && paramType.length() > 0 ) { builder.withParameterType( paramType ); }
0
private static final long serialVersionUID = -9135052498044877965L;
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
builder.append(node.isSafe() ? "?." : "."); if (node.isExpression()) { builder.append('`'); builder.append(image.replace("`", "\\`")); builder.append('`'); } else if (needQuotes(image)) { builder.append('\''); builder.append(image.replace("'", "\\'")); builder.append('\''); } else { builder.append(image);
1
final TlsStrategy tlsStrategy) { super(ioReactorConfig, eventHandlerFactory, connPool, tlsStrategy);
0
import org.apache.commons.beanutils.DynaProperty;
0
* * @version $Id: AbstractDatatypeWidgetDefinitionBuilder.java,v 1.6 2004/02/11 10:43:30 antonio Exp $
0
import org.apache.accumulo.cloudtrace.instrument.Tracer; mmi = client.getMasterStats(Tracer.traceInfo(), SecurityConstants.getSystemCredentials()); GCMonitorService.Client client = ThriftUtil.getClient(new GCMonitorService.Client.Factory(), address, config.getConfiguration()); result = client.getStatus(Tracer.traceInfo(), SecurityConstants.getSystemCredentials());
1
import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.apache.ambari.server.api.resources.ResourceInstance; import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.orm.entities.ViewEntity; import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
0
/** * Copyright 2013 Apache Software Foundation
0
TreeSet<FTPFile> sorted = new TreeSet<FTPFile>(new Comparator<Object>() {
0
import org.apache.accumulo.core.metadata.MetadataTable; import org.apache.accumulo.core.metadata.RootTable; /** * current version reflects the addition of a separate root table (ACCUMULO-1481) */ public static final int DATA_VERSION = 6; public static final int PREV_DATA_VERSION = 5; return prefix(getRootTableDirs(), RootTable.ROOT_TABLET_LOCATION)[0];
1
import org.apache.beam.runners.spark.translation.streaming.utils.TestPipelineOptionsForStreaming; public TestPipelineOptionsForStreaming pipelineOptions = new TestPipelineOptionsForStreaming(); SparkPipelineOptions options = pipelineOptions.withTmpCheckpointDir(checkpointParentDir);
0
import static com.google.common.base.Preconditions.checkNotNull; this.logFactory = checkNotNull(logFactory); this.readerFactory = checkNotNull(readerFactory); this.readTimeout = checkNotNull(readTimeout); this.writerFactory = checkNotNull(writerFactory); this.writeTimeout = checkNotNull(writeTimeout); this.noopEntry = checkNotNull(noopEntry); Entry result = checkNotNull(entry); checkNotNull(contents);
0
* @param opts * * * * @param opts *
0
public void setUp() throws Exception { initServer(); initClient(); public void tearDown() throws Exception { shutDownClient(); shutDownServer();
0
import org.apache.sshd.client.session.ClientConnectionService; import org.apache.sshd.client.session.ClientUserAuthService; if (getServiceFactories() == null) { setServiceFactories(Arrays.asList( new ClientUserAuthService.Factory(), new ClientConnectionService.Factory() )); }
0
import javax.servlet.http.HttpServlet; /** Endpoint service registration property from RFC 189 */ private static final String REG_PROPERTY_ENDPOINTS = "osgi.http.service.endpoints"; /** Framework property containing the endpoint registration information (optional). */ private static final String FELIX_HTTP_SERVICE_ENDPOINTS = "org.apache.felix.http.service.endpoints"; private static final String VENDOR = "The Apache Software Foundation"; props.put(Constants.SERVICE_VENDOR, VENDOR); props.put(Constants.SERVICE_VENDOR, VENDOR); // check for endpoint registration property if ( getBundleContext().getProperty(FELIX_HTTP_SERVICE_ENDPOINTS) != null ) { final Hashtable<String, Object> serviceRegProps = new Hashtable<String, Object>(); serviceRegProps.put(REG_PROPERTY_ENDPOINTS, getBundleContext().getProperty(FELIX_HTTP_SERVICE_ENDPOINTS)); this.getHttpServiceController().setProperties(serviceRegProps); }
0
import javax.swing.Box; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JCheckBoxMenuItem; import javax.swing.JComboBox; import javax.swing.JDesktopPane; import javax.swing.JEditorPane; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JInternalFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JPopupMenu; import javax.swing.JProgressBar; import javax.swing.JRadioButton; import javax.swing.JRadioButtonMenuItem; import javax.swing.JScrollPane; import javax.swing.JSeparator; import javax.swing.JSplitPane; import javax.swing.JTabbedPane; import javax.swing.JTable; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.JToggleButton; import javax.swing.JToolBar; import javax.swing.JTree; import org.apache.commons.jelly.impl.TagScript; import org.apache.commons.jelly.tags.swing.converters.ColorConverter; //CardLayout registerTag( "cardLayout", CardLayoutTag.class);
0
try { channel.close(); } catch (final IOException ignore) {}
0
result = dummySource.<WindowedValue<T>>flatMap((s, collector) -> { // never return anything result = result.filter(tWindowedValue -> true).name("UnionFixFilter");
0
@SuppressWarnings("deprecation") conf.set(Property.INSTANCE_DFS_URI, "file:///"); conf.set(Property.INSTANCE_DFS_DIR, "/");
0
import com.twitter.common.util.BuildInfo; import com.twitter.mesos.gen.comm.ExecutorStatus; import java.util.Properties; import java.util.Queue;
0
public class HttpResources { GuicedProcess.registerHttpResource(binder, "/js/mootools-core.js", HttpResources.class, GuicedProcess.registerHttpResource(binder, "/js/mootools-more.js", HttpResources.class, GuicedProcess.registerHttpResource(binder, "/js/tit.js", HttpResources.class, GuicedProcess.registerHttpResource(binder, "/css/global.css", HttpResources.class, private HttpResources() {
0
if (isAdmin(session)) { LOG.info("Granting kill query to admin user: " + query); } else { try { validateSessionKeyForTasks(session, new Query(query)); } catch (AuthFailedException e) { response.setResponseCode(AUTH_FAILED).setMessage(e.getMessage()); return response; } schedulerCore.killTasks(new Query(query), session.getUser()); private boolean isAdmin(SessionKey session) { try { assertAdmin(session); return true; } catch (AuthFailedException e) { return false; } }
0
package org.apache.felix.dm.lambda.callbacks; import java.util.Objects; /** * Represents a callback(Service) on an Object instance. * * @author <a href="mailto:[email protected]">Felix Project Team</a> */ @FunctionalInterface public interface CbService<S> { /** * Handles the given argument. * @param service a Service */ void accept(S service); default CbService<S> andThen(CbService<S> after) { Objects.requireNonNull(after); return (S service) -> { accept(service); after.accept(service); }; } }
0
public String getCheckedForeignKey(String tableName, String fkName) throws SQLException { DatabaseMetaData metaData = getDatabaseMetaData(); ResultSet rs = metaData.getImportedKeys(null, null, convertObjectName(tableName)); if (rs != null) { try { while (rs.next()) { if (StringUtils.equalsIgnoreCase(fkName, rs.getString("FK_NAME"))) { return rs.getString("FK_NAME"); } } } finally { rs.close(); } } LOG.warn("FK {} not found for table {}", convertObjectName(fkName), convertObjectName(tableName)); return null; } String checkedConstraintName = getCheckedForeignKey(convertObjectName(tableName), constraintName); if (checkedConstraintName != null) { String query = dbmsHelper.getDropFKConstraintStatement(tableName, checkedConstraintName);
0
package org.apache.commons.ognl;
0
* The id for the "selection started" event. */ public static final int SELECTION_START = 4; /**
0
String attrName = evt.getAttrName(); if (attrName.equals(SVG_POINTS_ATTRIBUTE)) {
0
* @version CVS $Id: CachedResponse.java,v 1.4 2003/08/06 09:26:44 cziegeler Exp $ * @param validityObject The SourceValidity object * @param response The cached sax stream or character stream */ public CachedResponse(SourceValidity validityObject, byte[] response) { this(new SourceValidity[] {validityObject}, response, null); } /** * Create a new entry for the cache. *
0
@Override @Override
0
KeyResolverSpi tmp = cloneIfNeeded(); if (!tmp.engineCanResolve(element, BaseURI, storage)) return null; return tmp.engineResolvePublicKey(element, BaseURI, storage); } private KeyResolverSpi cloneIfNeeded() throws KeyResolverException { KeyResolverSpi tmp=this; if (globalResolver) { try { tmp = (KeyResolverSpi) getClass().newInstance(); } catch (InstantiationException e) { throw new KeyResolverException("",e); } catch (IllegalAccessException e) { throw new KeyResolverException("",e); } return tmp; KeyResolverSpi tmp = cloneIfNeeded(); if (!tmp.engineCanResolve(element, BaseURI, storage)) return null; return tmp.engineResolveX509Certificate(element, BaseURI, storage); KeyResolverSpi tmp = cloneIfNeeded(); if (!tmp.engineCanResolve(element, BaseURI, storage)) return null; return tmp.engineResolveSecretKey(element, BaseURI, storage); protected boolean globalResolver=false; public void setGlobalResolver(boolean globalResolver) { this.globalResolver = globalResolver; }
0
for (Method method : methods) for (ParameterAnnotationEntry parameterAnnotation : parameterAnnotations)
0
import org.apache.accumulo.trace.thrift.RemoteSpan; *
0
hdb.insertMetricRecordsWithMetadata(metadataManager, timelineMetrics, true);
0
// set propertyProvider2 as the default provider VersioningPropertyProvider provider = new VersioningPropertyProvider(clusterVersionsMap, providers, propertyProvider2, PropertyHelper.getPropertyId("HostRoles", "cluster_name")); // test resource with no associated cluster ... should go to default provider2 propertyProvider1.setResource(null); propertyProvider2.setResource(null); Resource resource3 = new ResourceImpl(Resource.Type.HostComponent); provider.populateResources(Collections.singleton(resource3), request, null); Assert.assertNull(propertyProvider1.getResource()); Assert.assertEquals(resource3, propertyProvider2.getResource());
0
import java.nio.channels.FileChannel; FileChannel input = new FileInputStream(srcFile).getChannel(); FileChannel output = new FileOutputStream(destFile).getChannel(); output.transferFrom(input, 0, input.size());
1
return "scans for and displays a single entry"; timestampOpt = new Option("st", "show-timestamps", false, "enable displaying timestamps"); disablePaginationOpt = new Option("np", "no-pagination", false, "disable pagination of output"); tableOpt = new Option(Shell.tableOption, "tableName", true, "table to select entry from");
0
/** {@inheritDoc} */ @Override public Object structuralValue(Short value) { return value; }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/locale/converters/DateLocaleConverter.java,v 1.5 2003/03/09 21:25:17 rdonkin Exp $ * $Revision: 1.5 $ * $Date: 2003/03/09 21:25:17 $ import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; * @author Michael Szlapa /** All logging goes through this logger */ private static Log log = LogFactory.getLog(DateLocaleConverter.class); private SimpleDateFormat formatter = getPattern(pattern, locale); * @exception org.apache.commons.beanutils.ConversionException if conversion cannot be performed /** * Gets an appropriate <code>SimpleDateFormat</code> for given locale, * default Date format pattern is not provided. */ private SimpleDateFormat getPattern(String pattern, Locale locale) { // This method is a fix for null pattern, which would cause // Null pointer exception when applied // Note: that many constructors default the pattern to null, // so it only makes sense to handle nulls gracefully if(pattern == null) { pattern = locPattern ? new SimpleDateFormat().toLocalizedPattern() : new SimpleDateFormat().toPattern(); log.warn("Null pattern was provided, defaulting to: " + pattern); } SimpleDateFormat format = new SimpleDateFormat(pattern, locale); format.setLenient(false); return format; }
0
return handleRequest(headers, ui, Request.Type.GET, return handleRequest(headers, ui, Request.Type.GET,
1
DOMSignatureMethod(AlgorithmParameterSpec params) if (params != null &&
0
public NodeUpdateData(final Map<QueryResult<T>, Object> changedValues, final Collection<Object> newValues, final Collection<QueryResult<T>> removedNodes, final String key) private static <K, V> Map<K, V> copyMap(final Map<? extends K, ? extends V> map) private static <T> Collection<T> copyCollection(final Collection<? extends T> col)
0
import org.apache.ambari.server.controller.spi.Predicate;
0
* @version $Revision: 1.7 $ $Date: 2004/05/10 20:09:52 $ manager.addProvider("sftp", new SftpFileProvider());
0
/* * Copyright 2002, 2003,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.6 $ $Date: 2004/02/28 03:35:53 $
0
protected static final String SCHEMA_IS_NOT_SUPPORTED_MESSAGE = "Configuration format provided in Blueprint is not supported"; throw new IllegalArgumentException(SCHEMA_IS_NOT_SUPPORTED_MESSAGE);
0
return DigestUtils.shaHex(in);
0
* @throws AccumuloSecurityException * @since 1.5.0 * @since 1.5.0 * @since 1.5.0 * @since 1.5.0
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.
0
if (response.getStatusLine().getStatusCode() >= HttpStatus.SC_SUCCESS) {
0
private Map<QName, String> attributes = new HashMap<>(); private List<PropertyInfo> properties = new ArrayList<>(); private Set<String> errorSet = new HashSet<>();
1
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.project.DefaultProjectBuildingRequest; import org.apache.maven.project.ProjectBuildingRequest; ProjectBuildingRequest projectBuilderConfiguration = new DefaultProjectBuildingRequest(); ArtifactRepositoryLayout layout = new DefaultRepositoryLayout(); project.setProjectBuildingRequest( projectBuilderConfiguration );
0
cr.setRoleCommand("INSTALL"); Role.DATANODE, null, RoleCommand.INSTALL); cr.setRoleCommand("INSTALL"); cr.setRoleCommand("INSTALL"); cr1.setRoleCommand("INSTALL"); cr2.setRoleCommand("INSTALL"); cr1.setRoleCommand("INSTALL"); cr2.setRoleCommand("INSTALL");
0
JexlContext jc = new MapContext(); JexlContext jc = new MapContext(); JexlContext jc = new MapContext(); jc.set("i", Integer.valueOf(5)); jc.set("k", Integer.valueOf(7)); jc.set("k", "7"); JexlContext jc = new MapContext(); JexlContext jc = new MapContext(); JexlContext jc = new MapContext(); JexlContext jc = new MapContext(); jc.set("outer", o); JexlContext jc = new MapContext(); jc.set("outer", o);
0
int xVal = (int) (readShort( is ) * xSign * scaleXY); x1 = (int) (readShort( is ) * xSign * scaleXY); x2 = (int) (readShort( is ) * xSign * scaleXY); int xVal = (int) (readShort( is ) * xSign * scaleXY);
0
PublicKey key = keyEntry.resolvePublicKey( null, Collections.emptyMap(), PublicKeyEntryResolver.FAILING);
0
* @version CVS $Id: AbstractStreamWriteableSource.java,v 1.2 2003/03/16 17:49:10 vgritsenko Exp $
0
import org.apache.felix.webconsole.WebConsoleUtil; try WebConsoleUtil.keyVal( jw, key, value ); } catch ( JSONException je ) { // don't care
0