Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
/** * 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 com.google.inject.Provider; import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.state.Clusters; * Used for looking cluster name by cluster id */ @Inject Provider<Clusters> m_clusters; /** try { aggregateAlert.setCluster(m_clusters.get().getClusterById(clusterId).getClusterName()); } catch (AmbariException exception) { LOG.error("Unable to lookup cluster with ID {}", clusterId, exception); }
0
/** * Sets a timeout threshold for a server to respond. The batch scanner will accomplish as much work as possible before throwing an exception. BatchScanner * iterators will throw a {@link TimedOutException} when all needed servers timeout. * * <p> * If not set, the timeout defaults to MAX_INT * * @param timeout * in seconds */ @Override void setTimeOut(int timeout);
0
long lastMod = 0; if (reloadScripts && lastExecTime != 0) { lastMod = entry.getSource().getLastModified(); }
0
* Copyright 2016-2017 Seznam.cz, a.s.
0
p.getCoderRegistry().registerCoderForClass(UserString.class, UserStringCoder.of()); p.getCoderRegistry().registerCoderForClass(UserString.class, UserStringCoder.of()); p.getCoderRegistry().registerCoderForClass( UserString.class, NullableCoder.of(UserStringCoder.of())); p.getCoderRegistry().registerCoderForClass( String.class, NullableCoder.of(StringUtf8Coder.of()));
0
// Temporarily remove dependency callback instance (if set), because we don't want to call it twice (one time from the // internal aspect/adapter AbstractDecorator object, and another one time from the actual aspect/adapter component instances). // See FELIX-5155.
0
EqualsPredicate p1 = new EqualsPredicate<>("p1", "one"); EqualsPredicate p2 = new EqualsPredicate<>("p2", "two");
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.felix.ipojo.test.scenarios.ps.service; import java.util.Properties; public interface FooService { boolean foo(); Properties fooProps(); Boolean getObject(); boolean getBoolean(); int getInt(); long getLong(); double getDouble(); }
0
this.initParams = getInitParams(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_INIT_PARAM_PREFIX);
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 * 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
@Parameter(names = {"-zi", "--zooKeeperInstanceName"}, description="use a zookeeper instance with the given instance name") private String zooKeeperInstanceName; @Parameter(names = {"-zh", "--zooKeeperHosts"}, description="use a zookeeper instance with the given list of zoo hosts") private String zooKeeperHosts; public String getZooKeeperInstanceName() { return zooKeeperInstanceName; } public String getZooKeeperHosts() { return zooKeeperHosts; }
0
import org.junit.Assert; AuthInfo auth = new AuthInfo("root", ByteBuffer.wrap("".getBytes()), "instance"); gc.init(fs, instance, auth, false);
1
package org.apache.batik.gvt.filter; import org.apache.batik.ext.awt.image.GraphicsUtil;
0
comparator = DirectoryFileComparator.DIRECTORY_COMPARATOR;
0
final String baseTmpDir = System.getProperty("java.io.tmpdir"); protected void deleteFile(final File file) protected void removeFile(final Object file) protected void addFile(final Object file) final String safeBasename = UriParser.encode(baseName, TMP_RESERVED_CHARS).replace('%', '_');
1
assertEquals(null, header.getValue());
0
import org.apache.http.annotation.Immutable; import org.apache.http.util.Args; Args.notNull(response, "HTTP response");
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.sandbox.scrplugin.tags; /** * <code>JavaParameter.java</code>... * */ public interface JavaParameter { String getType(); }
0
* Copyright (c) OSGi Alliance (2000, 2009). All Rights Reserved. * <code>BundleActivator</code> is an interface that may be implemented when a * bundle's <code>BundleActivator</code> as required. If an instance's * <code>BundleActivator.start</code> method executes successfully, it is * guaranteed that the same instance's <code>BundleActivator.stop</code> * not concurrently call a <code>BundleActivator</code> object. * <code>BundleActivator</code> is specified through the * <code>Bundle-Activator</code> Manifest header. A bundle can only specify a * single <code>BundleActivator</code> in the Manifest file. Fragment bundles * must not have a <code>BundleActivator</code>. The form of the Manifest * <code>Bundle-Activator: <i>class-name</i></code> * where <code><i>class-name</i></code> is a fully qualified Java classname. * The specified <code>BundleActivator</code> class must have a public * constructor that takes no parameters so that a <code>BundleActivator</code> * object can be created by <code>Class.newInstance()</code>. * @version $Revision: 6361 $ * method should undo the work that the <code>BundleActivator.start</code>
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.bridge; /** * Interface for Bridges which handle DOM events for the element they map to GVT * objects (such as <tt>GraphicsNode</tt> instances) or related objects (such as * <tt>java.awt.Paint</tt>) * * @author <a href="mailto:vincent.hardy@apache.org">Vincent Hardy</a> * @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a> * @version $Id$ */ public interface DynamicBridge extends Bridge { /** * */ public BridgeUpdateHandler getBridgeUpdateHandler(); /** * */ public void setBridgeUpdateHandler(BridgeUpdateHandler handler, int handlerKey); }
0
* DatastoreV1 Datastore related pipeline options. public interface V1TestOptions extends TestPipelineOptions {
0
* Autogenerated by Thrift Compiler (0.11.0) @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)")
0
import com.twitter.mesos.scheduler.ThermosJank; @ThermosJank if (config.isSetThermosConfig()) { config.setConfigParsed(true); return config; }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/ObjectCreateRule.java,v 1.5 2001/08/20 16:10:13 craigmcc Exp $ * $Revision: 1.5 $ * $Date: 2001/08/20 16:10:13 $ * @version $Revision: 1.5 $ $Date: 2001/08/20 16:10:13 $
0
this(context, new ZooCache(context), new ReplicaSystemFactory());
0
FileSystemUtils fsu = new MockFileSystemUtils(0, lines, "dir /-c \"C:\""); FileSystemUtils fsu = new MockFileSystemUtils(0, lines, "dir /-c \"C:\\somedir\""); public void testGetFreeSpaceWindows_String_quoted() throws Exception { String lines = " Volume in drive C is HDD\n" + " Volume Serial Number is XXXX-YYYY\n" + "\n" + " Directory of C:\\Documents and Settings\\Xxxx\n" + "\n" + "19/08/2005 22:43 <DIR> .\n" + "19/08/2005 22:43 <DIR> ..\n" + "11/08/2005 01:07 81 build.properties\n" + "17/08/2005 21:44 <DIR> Desktop\n" + " 7 File(s) 180260 bytes\n" + " 10 Dir(s) 41411551232 bytes free"; FileSystemUtils fsu = new MockFileSystemUtils(0, lines, "dir /-c \"C:\\somedir\""); assertEquals(41411551232L, fsu.freeSpaceWindows("\"C:\\somedir\"", -1)); }
0
package org.apache.http.testserver;
0
final StringBuilder buffer = new StringBuilder(uri);
0
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, IOException, ShellCommandException { @SuppressWarnings("deprecation") String deprecatedClassName = org.apache.accumulo.core.iterators.AggregatingIterator.class.getName(); classname = deprecatedClassName; } @SuppressWarnings("deprecation") String deprecatedAggregatorClassName = org.apache.accumulo.core.iterators.aggregation.Aggregator.class.getName(); if (aggregatorClass != null && !shellState.getConnector().instanceOperations().testClassLoad(aggregatorClass, deprecatedAggregatorClassName)) { + deprecatedAggregatorClassName); } final String name) throws AccumuloException, AccumuloSecurityException, ShellCommandException, TableNotFoundException { } private static String setUpOptions(final ConsoleReader reader, final String className, final Map<String,String> options) throws IOException, ShellCommandException { @Override
0
/* * Copyright 2016-2018 Seznam.cz, a.s.
0
return Combine.globally(new TopCombineFn<>(count, compareFn)).named("Top"); return Combine.globally(new TopCombineFn<>(count, new Smallest<T>())).named("Top.Smallest"); return Combine.globally(new TopCombineFn<>(count, new Largest<T>())).named("Top.Largest"); new TopCombineFn<>(count, compareFn).<K>asKeyedFn()).named("Top.PerKey"); new TopCombineFn<>(count, new Smallest<V>()).<K>asKeyedFn()).named("Top.SmallestPerKey"); new TopCombineFn<>(count, new Largest<V>()).<K>asKeyedFn()).named("Top.LargestPerKey");
0
private DefaultHttpClientConnectionOperator connectionOperator; connectionOperator = new DefaultHttpClientConnectionOperator(
0
handler.handleUnimplementedMessage(this, SshConstants.SSH_MSG_UNIMPLEMENTED, buffer);
0
private final Coder<W> windowCoder; IsmRecordForSingularValuePerWindowDoFn(Coder<W> windowCoder) { this.windowCoder = windowCoder; } Optional<Object> previousWindowStructuralValue = Optional.absent(); T previousValue = null; Object currentWindowStructuralValue = windowCoder.structuralValue(next.getKey()); // Verify that the user isn't trying to have more than one element per window as // a singleton. checkState(!previousWindowStructuralValue.isPresent() || !previousWindowStructuralValue.get().equals(currentWindowStructuralValue), "Multiple values [%s, %s] found for singleton within window [%s].", previousValue, next.getValue().getValue(), next.getKey()); previousWindowStructuralValue = Optional.of(currentWindowStructuralValue); previousValue = next.getValue().getValue(); @SuppressWarnings("unchecked") Coder<BoundedWindow> windowCoder = (Coder<BoundedWindow>) input.getWindowingStrategy().getWindowFn().windowCoder(); new IsmRecordForSingularValuePerWindowDoFn<T, BoundedWindow>(windowCoder),
0
/** * @since 4.1 */ public DefaultHttpClient( final ClientConnectionManager conman) { super(conman, null); } connManager = new SingleClientConnManager(registry);
0
@SuppressWarnings({"unused"}) public enum TableOperation implements org.apache.thrift.TEnum {
0
* @throws NullPointerException if comparator is null * @throws NullPointerException if comparator or criterion is null throw new NullPointerException("Comparator must not be null."); throw new NullPointerException("Criterion must not be null.");
0
Object clone();
0
Iterable<String> provided = kpp.getKeyTypes(); for (String keyType : provided) { log.debug("sendKexInit(" + provided + ") " + keyType + " not in list of supported: " + supported); if (resolvedHostKeys == null) { resolvedHostKeys = new StringBuilder(); if (resolvedHostKeys.length() > 0) { resolvedHostKeys.append(','); resolvedHostKeys.append(keyType); } // make sure the new list has at least one supported AND provided key type if (GenericUtils.isEmpty(resolvedHostKeys)) { throw new SshException(SshConstants.SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE, "sendKexInit(" + provided + ") none of the keys appears in supported list: " + supported); serverProposal = createProposal(resolvedHostKeys.toString());
0
package org.apache.ambari.server.state.live.job;
0
* @version CVS $Id$ public PartInMemory(Map headers, InputStream in, int size) {
0
* object, but with all attributes added defined by the given map. This * method is analogous to {@link #setAttribute(String, Object)}, but all * attributes in the given map are added. If the map is <b>null</b> or * empty, this method has no effect. * * @param newAttributes the map with attributes to be added * @return the new node with these attributes */ public ImmutableNode setAttributes(Map<String, ?> newAttributes) { if (newAttributes == null || newAttributes.isEmpty()) { return this; } Map<String, Object> newAttrs = new HashMap<String, Object>(attributes); newAttrs.putAll(newAttributes); return createWithNewAttributes(newAttrs); } /** * Returns a new {@code ImmutableNode} instance which is a copy of this
0
private javax.xml.parsers.DocumentBuilder db; db = XMLUtils.createDocumentBuilder(false); org.w3c.dom.Document doc = db.newDocument(); org.w3c.dom.Document doc = this.db.parse(is);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//io/src/test/org/apache/commons/io/Attic/IOTestCase.java,v 1.3 2002/01/28 05:01:49 sanders Exp $ * $Revision: 1.3 $ * $Date: 2002/01/28 05:01:49 $ import junit.framework.TestCase; * @version $Revision: 1.3 $ * Test the FileUtils implementation.
1
updateValuesAsRate(metric.getMetricValues()); static Map<Long, Double> updateValuesAsRate(Map<Long, Double> metricValues) { Double prevVal = null; Double diff; diff = currVal - prevVal; Double rate = diff / TimeUnit.MILLISECONDS.toSeconds(step); prevVal = currVal; static HashMap<String, List<Function>> parseMetricNamesToAggregationFunctions(List<String> metricNames) { HashMap<String, List<Function>> metricsFunctions = new HashMap<>(); if (functionStartIndex > 0) { functionsList = new ArrayList<>(1);
0
artifact = this.factory.createArtifactWithClassifier(groupId, artifactId, version, type, classifier);
0
import org.apache.beam.sdk.extensions.euphoria.core.client.operator.base.Builders.Output;
0
* @version CVS $Id$
0
/** * A singleton. */ public static final ClosedInputStream CLOSED_INPUT_STREAM = new ClosedInputStream();
0
static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(C14nHelperTest.class.getName());
1
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
0
import org.apache.aurora.GuavaUtils.PassiveService; public class TaskHistoryPruner extends PassiveService implements EventSubscriber { private Runnable failureNotifyingRunnable(Runnable runnable) { return () -> { try { runnable.run(); } catch (Throwable t) { notifyFailed(t); } }; } executor.execute( failureNotifyingRunnable(() -> { LOG.info("Pruning expired inactive task " + taskId); deleteTasks(ImmutableSet.of(taskId)); }), Amount.of(timeRemaining, Time.MILLISECONDS)); executor.execute(failureNotifyingRunnable(() -> { }));
0
* Copyright 2001-2006 The Apache Software Foundation
0
ChunkInputFormat.setInputInfo(job, user, pass.getBytes(), table, AUTHS); ChunkInputFormat.setMockInstance(job, instance); @SuppressWarnings("unchecked") Class<? extends Mapper<?,?,?,?>> forName = (Class<? extends Mapper<?,?,?,?>>) Class.forName(args[4]); job.setMapperClass(forName);
0
import java.util.Collections; import com.google.common.collect.Ordering; import com.google.common.primitives.Longs; Collections.sort(taskEvents, BY_TIMESTAMP); private static final Ordering<TaskEvent> BY_TIMESTAMP = new Ordering<TaskEvent>() { @Override public int compare(TaskEvent left, TaskEvent right) { return Longs.compare(left.getTimestamp(), right.getTimestamp()); } };
0
/** * Recursively lists the files and directories under a given path, ingests their names and file info into one Accumulo table, indexes the file names in a * separate table, and the file data into a third table. See docs/examples/README.dirlist for instructions. */
0
* @cocoon.sitemap.component.documentation * Rewrites URIs in links to a value determined by an InputModule. * The URI scheme identifies the InputModule to use, and the rest of the URI is * used as the attribute name. *
0
SortedSet<Text> splits = new TreeSet<>();
0
package org.apache.beam.dsls.sql.transform; import org.apache.beam.dsls.sql.interpreter.BeamSQLExpressionExecutor; import org.apache.beam.dsls.sql.rel.BeamProjectRel; import org.apache.beam.dsls.sql.schema.BeamSQLRecordType; import org.apache.beam.dsls.sql.schema.BeamSQLRow;
0
@Test(expected = TaskDescriptionException.class) public void testCreateJobNoResources() throws Exception { control.replay(); buildScheduler(); TwitterTaskInfo task = new TwitterTaskInfo(DEFAULT_TASK); task.getConfiguration().remove("num_cpus"); task.getConfiguration().remove("ram_mb"); task.getConfiguration().remove("disk_mb"); JobConfiguration job = makeJob(OWNER_A, JOB_A, task, 1); scheduler.createJob(job); } .put("num_cpus", "1.0") .put("disk_mb", "1024") .put("num_cpus", "1.0") .put("disk_mb", "1024") .put("num_cpus", "1.0") .put("disk_mb", "1024")
0
// The component has registered a service: notify all component instances Object[] componentInstances = c.getCompositionInstances(); for (Object instance : componentInstances) try { Class[][] signatures = new Class[][] { { ServiceRegistration.class }, {} }; Object[][] params = new Object[][] { { c.getServiceRegistration() }, {} }; InvocationUtil.invokeCallbackMethod(instance, m_registered, signatures, params); } catch (Throwable t) { Log.instance().error("Exception caught while invoking method %s on component %s", t, m_registered, instance); }
0
/* import java.util.Collections; import org.apache.ambari.server.orm.entities.PrincipalEntity; * Find a permission entity with the given name. * * @param name permission name * * @return a matching permission entity or null */ @RequiresSession public PermissionEntity findByName(String name) { TypedQuery<PermissionEntity> query = entityManagerProvider.get().createNamedQuery("PermissionEntity.findByName", PermissionEntity.class); query.setParameter("permissionName", name); return daoUtils.selectSingle(query); } /** * Find the permission entities for the given list of principals * * @param principalList the list of principal entities * * @return the list of permissions (or roles) matching the query */ @RequiresSession public List<PermissionEntity> findPermissionsByPrincipal(List<PrincipalEntity> principalList) { if (principalList == null || principalList.isEmpty()) { return Collections.emptyList(); } TypedQuery<PermissionEntity> query = entityManagerProvider.get().createNamedQuery("PermissionEntity.findByPrincipals", PermissionEntity.class); query.setParameter("principalList", principalList); return daoUtils.selectList(query); } /**
0
public void doTag(XMLOutput output) throws Exception { getBody().run(context, output);
0
public void contextualize(Context avalonContext) throws ContextException { this.context = avalonContext; public void service(ServiceManager serviceManager) throws ServiceException { this.manager = serviceManager; final Context itsContext = this.createContext(); * Create the context for this sitemap. protected Context createContext() {
0
if (isInherited != manager.isInheritedProperty()) { for (String identValue : identValues) { LexicalUnit lu = cssParser.parsePropertyValue(identValue); if (!identValue.equalsIgnoreCase(s)) { identValue + '/' + 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
package org.apache.http.nio.impl;
0
/* Copyright 2003 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
package org.apache.cocoon.core.container.spring.logger; * Spring factory bean to setup a child Commons Logging logger. public class ChildLoggerFactoryBean extends LoggerFactoryBean implements FactoryBean, BeanFactoryAware { private BeanFactory factory; public ChildLoggerFactoryBean() { // Child logger has no default category: uses parent's category. setCategory(null); * @see BeanFactoryAware#setBeanFactory(BeanFactory) this.factory = factory; public void init() { final BeanFactory parent = ((HierarchicalBeanFactory) this.factory).getParentBeanFactory(); // Construct full category final LoggerFactoryBean bean = (LoggerFactoryBean) parent.getBean("&" + LoggerUtils.LOGGER_ROLE); setCategory(LoggerUtils.getChildCategory(bean, getCategory())); // Initialize logger setLogger(LogFactory.getLog(getCategory())); * @see FactoryBean#getObject() final BeanFactory parent = ((HierarchicalBeanFactory) this.factory).getParentBeanFactory(); return LoggerUtils.getChildLogger(parent, getCategory()); return Log.class;
0
if (LogFeederUtil.hostName == null) { timelineMetric.setHostName(LogFeederUtil.hostName);
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
public static Configuration getConfiguration(JobContext context) {
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.parser; import org.w3c.css.sac.AttributeCondition; /** * This class provides an abstract implementation of the {@link * org.w3c.css.sac.AttributeCondition} interface. * * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a> * @version $Id$ */ public abstract class AbstractAttributeCondition implements AttributeCondition { /** * The attribute value. */ protected String value; /** * Creates a new AbstractAttributeCondition object. */ protected AbstractAttributeCondition(String value) { this.value = value; } /** * <b>SAC</b>: Implements {@link AttributeCondition#getValue()}. */ public String getValue() { return value; } }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java,v 1.31 2003/07/03 19:10:27 craigmcc Exp $ * $Revision: 1.31 $ * $Date: 2003/07/03 19:10:27 $ * @version $Revision: 1.31 $ $Date: 2003/07/03 19:10:27 $ * <p>Negative tests on an invalid property with two different boolean * getters (which is fine, according to the JavaBeans spec) but a * String setter instead of a boolean setter.</p> * * <p>Although one could logically argue that this combination of method * signatures should not identify a property at all, there is a sentence * in Section 8.3.1 making it clear that the behavior tested for here * is correct: "If we find only one of these methods, then we regard * it as defining either a read-only or write-only property called * <em>&lt;property-name&gt;</em>.</p> */ public void testGetDescriptorInvalidBoolean() throws Exception { PropertyDescriptor pd = PropertyUtils.getPropertyDescriptor(bean, "invalidBoolean"); assertNotNull("invalidBoolean is a property", pd); assertNotNull("invalidBoolean has a getter method", pd.getReadMethod()); assertNull("invalidBoolean has no write method", pd.getWriteMethod()); assertTrue("invalidBoolean getter method is isInvalidBoolean", "isInvalidBoolean".equals(pd.getReadMethod().getName())); } /**
0
import org.apache.hc.core5.http.HttpHeaders; import org.apache.hc.core5.http.HttpHost; import org.apache.hc.core5.http.HttpRequest; import org.apache.hc.core5.http.HttpResponse; import org.apache.hc.core5.http.HttpStatus; import org.apache.hc.core5.http.HttpVersion; import org.apache.hc.core5.http.config.Lookup; import org.apache.hc.core5.http.config.RegistryBuilder; import org.apache.hc.core5.http.message.BasicHeader; import org.apache.hc.core5.http.message.BasicHttpRequest; import org.apache.hc.core5.http.message.BasicHttpResponse; import org.apache.hc.core5.http.protocol.BasicHttpContext; import org.apache.hc.core5.http.protocol.HttpContext; import org.apache.hc.core5.http.protocol.HttpCoreContext; import org.apache.http.auth.AuthExchange;
0
List<? extends Source<T>> shards = initialSource.splitIntoBundles(desiredSizeBytes,
0
package org.apache.commons.net.io;
0
import org.apache.hc.core5.io.CloseMode; client.shutdown(CloseMode.GRACEFUL);
0
final Map<String,Stats> summary = new TreeMap<>();
1
import org.apache.ambari.server.events.MetadataUpdateEvent; expect(cluster1.getClusterId()).andReturn(1L).atLeastOnce(); expect(controller.getClusterMetadataOnConfigsUpdate(eq(cluster1))).andReturn(createNiceMock(MetadataUpdateEvent.class)).once(); replay(controller, clusters, cluster1, cluster2, configWithGroup, configWithoutGroup, newConfig, response, injector, kerberosHelperMock); verify(controller, clusters, cluster1, cluster2, configWithGroup, configWithoutGroup, newConfig, response, injector, upgradeCatalog270);
0
ReplicationTableUtil.updateFiles(context, new KeyExtent("1", null, null), myFile, StatusUtil.fileCreated(createdTime)); KeyExtent extent = new KeyExtent("1", new Text("b"), new Text("a")); Assert.assertEquals(extent.getTableId(), new Text(col.getColumnQualifier()).toString());
0
import org.apache.http.auth.AUTH; Header header = new BasicHeader(AUTH.WWW_AUTH, challenge); Header challenge = new BasicHeader(AUTH.WWW_AUTH, "Basic realm=\"test\""); assertEquals(AUTH.WWW_AUTH_RESP, authResponse.getName()); Header challenge = new BasicHeader(AUTH.PROXY_AUTH, "Basic realm=\"test\""); assertEquals(AUTH.PROXY_AUTH_RESP, authResponse.getName());
0
@Column(name = "short_url") @Basic private String shortUrl; this.shortUrl = instanceConfig.getShortUrl(); this.shortUrl = null; @Override public String getShortUrl() { return shortUrl; } /** * Set the short URL * @param shortUrl */ public void setShortUrl(String shortUrl) { this.shortUrl = shortUrl; }
0
final int fragmentSizeHint, super(buffersize, fragmentSizeHint, chardecoder, charencoder, this(buffersize, buffersize, null, null, null, null, null, null, null);
0
public final class SHA256KeyHashingScheme implements KeyHashingScheme { public static final SHA256KeyHashingScheme INSTANCE = new SHA256KeyHashingScheme();
0
import org.ow2.chameleon.testing.helpers.BaseTest; import java.util.Arrays; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; public class Common extends BaseTest { @Override protected Option[] getCustomOptions() { return new Option[]{ eventadmin() }; @Override protected List<String> getExtraExports() { return Arrays.asList( "org.apache.felix.ipojo.runtime.core.test.components.inner" );
0
throw new IllegalArgumentException("Integer coercion exception. Can't coerce type: " + val.getClass().getName()); throw new NumberFormatException("Long coercion exception. Can't coerce type: " + val.getClass().getName()); throw new IllegalArgumentException("BigInteger coercion exception. Can't coerce type: " + val.getClass().getName()); throw new IllegalArgumentException("BigDecimal coercion exception. Can't coerce type: " + val.getClass().getName()); throw new IllegalArgumentException("Double coercion exception. Can't coerce type: " + val.getClass().getName());
0
if (list != null){ for (int i = 0 ; i < list.size(); i++) { StrokingTextPainter.TextRun run = (StrokingTextPainter.TextRun)list.get(i); AttributedCharacterIterator aci = run.getACI(); TextSpanLayout layout = run.getLayout(); float x = (float)coords.getX(); float y = (float)coords.getY(); TextHit textHit = layout.hitTestChar(x, y); if (textHit != null && layout.getBounds().contains(x, y)) { Object delimiter = aci.getAttribute (GVTAttributedCharacterIterator.TextAttribute.TEXT_COMPOUND_DELIMITER); if (delimiter instanceof Element) { return (Element)delimiter; } }
0
URL url = f.toURI().toURL();
0
import static junit.framework.Assert.assertEquals; import java.io.ByteArrayInputStream; import org.junit.Test; import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning;
0
* @param beginCharIndex the index of the first char in the * contiguous selection. * @param endCharIndex the index of the last char in the * contiguous selection. * @return The highlight shape or null if the spacified char range * does not overlap with the chars in this layout. */ advance = new Point2D.Float((float)(advance.getX()*xscale), (float)(advance.getY()*yscale)); * @param lengthAdjust Indicates the method to use when adjusting * the text length. * @param kern The kerning adjustment to apply to the space * between each char. * @param wordSpacing The amount of spacing required between each word. */ float gvWidth = (float)gv.getVisualBounds().getWidth(); float lastCharWidth = (float)gv.getGlyphMetrics (gv.getNumGlyphs()-1).getBounds2D().getWidth(); if (gvWidth > lastCharWidth) { // System.out.println("Len: " + length.floatValue() + // " LCW: " + lastCharWidth + // " Wid: " + gvWidth); xscale = ((length.floatValue()-lastCharWidth)/ (gvWidth-lastCharWidth)); } yscale = (length.floatValue()/ (float) gv.getVisualBounds().getHeight()); Rectangle2D glyphB = gv.getGlyphMetrics(numGlyphs-1).getBounds2D(); float xAdj = 0; float yAdj = 0; if (vertical) yAdj = (float)glyphB.getHeight(); else xAdj = (float)glyphB.getWidth(); advance = new Point2D.Float ((float)(initX+dx*xscale-offset.getX()+xAdj), (float)(initY+dy*yscale-offset.getY()+yAdj));
0
String[] fileNameParts = originalPath.getName().split("\\.");
0
import org.testng.Assert; import org.testng.annotations.Test; import org.testng.annotations.BeforeMethod; @BeforeMethod
0
boolean created = false; created = true; if (created) { eventListeners.fire(new ConfigurationBuilderResultCreatedEvent( this, ConfigurationBuilderResultCreatedEvent.RESULT_CREATED, resObj)); }
0
abstract Builder<T> setKmsKey(String kmsKey); @Nullable abstract String getKmsKey(); getQueryLocation(), getKmsKey()); /** For query sources, use this Cloud KMS key to encrypt any temporary tables created. */ public TypedRead<T> withKmsKey(String kmsKey) { return toBuilder().setKmsKey(kmsKey).build(); } @Nullable abstract String getKmsKey(); abstract Builder<T> setKmsKey(String kmsKey); * Specfies a policy for handling failed inserts. Write<T> withKmsKey(String kmsKey) { return toBuilder().setKmsKey(kmsKey).build(); } .withIgnoreUnknownValues(getIgnoreUnknownValues()) .withKmsKey(getKmsKey()); getIgnoreUnknownValues(), getKmsKey());
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/converters/FloatArrayConverter.java,v 1.4 2003/01/15 21:59:40 rdonkin Exp $ * $Revision: 1.4 $ * $Date: 2003/01/15 21:59:40 $ * Copyright (c) 1999-2003 The Apache Software Foundation. All rights * @version $Revision: 1.4 $ $Date: 2003/01/15 21:59:40 $
0
expect(permissionEntity.getPermissionName()).andReturn("CLUSTER.ADMINISTRATOR").anyTimes(); Assert.assertEquals("CLUSTER.ADMINISTRATOR", resource.getPropertyValue(AmbariPrivilegeResourceProvider.PERMISSION_NAME_PROPERTY_ID)); expect(permissionEntity.getPermissionName()).andReturn("CLUSTER.ADMINISTRATOR").anyTimes();
0
import org.apache.hc.core5.http.HttpVersion; import org.apache.hc.core5.http.ProtocolVersion; import org.apache.hc.core5.http.UnsupportedHttpVersionException; final ProtocolVersion transportVersion = request.getVersion(); if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException("Unsupported version: " + transportVersion); } this.version = transportVersion;
0
} else if (i.dataType() == DataTypes.INT_TYPE) { ints[pos] = 0; } else if (i.dataType() == DataTypes.BOOLEAN_TYPE) { bools[pos] = false;
0