method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public Dimension getMaximumSize()
{
return ui.getMaximumSize(this);
} | Dimension function() { return ui.getMaximumSize(this); } | /**
* This method returns the maximum size for this scroll bar.
*
* @return The maximum size.
*/ | This method returns the maximum size for this scroll bar | getMaximumSize | {
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/javax/swing/JScrollBar.java",
"license": "gpl-2.0",
"size": 19641
} | [
"java.awt.Dimension"
] | import java.awt.Dimension; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,691,972 |
public InstanceRef getPattern() {
JsonObject obj = (JsonObject) json.get("pattern");
if (obj == null) return null;
return new InstanceRef(obj);
} | InstanceRef function() { JsonObject obj = (JsonObject) json.get(STR); if (obj == null) return null; return new InstanceRef(obj); } | /**
* The pattern of a RegExp instance.
*
* The pattern is always an instance of kind String.
*
* Provided for instance kinds:
* - RegExp
*
* Can return <code>null</code>.
*/ | The pattern of a RegExp instance. The pattern is always an instance of kind String. Provided for instance kinds: - RegExp Can return <code>null</code> | getPattern | {
"repo_name": "flutter/flutter-intellij",
"path": "flutter-idea/third_party/vmServiceDrivers/org/dartlang/vm/service/element/InstanceRef.java",
"license": "bsd-3-clause",
"size": 7005
} | [
"com.google.gson.JsonObject"
] | import com.google.gson.JsonObject; | import com.google.gson.*; | [
"com.google.gson"
] | com.google.gson; | 965,553 |
@Test
public void whenReadOnlyCommandsExecutedConcurrentlyThenAllSucceed()
throws IOException, InterruptedException, ExecutionException {
final ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(
this, "exclusive_execution", tmp);
workspace.setUp();
executorServ... | void function() throws IOException, InterruptedException, ExecutionException { final ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario( this, STR, tmp); workspace.setUp(); executorService.invokeAll( ImmutableList.of( createCallableCommand(SUCCESS_EXIT_CODE, "auditSTRinput", STRauditSTRinput"... | /**
* This verifies that multiple read only commands can be executed concurrently successfully.
*/ | This verifies that multiple read only commands can be executed concurrently successfully | whenReadOnlyCommandsExecutedConcurrentlyThenAllSucceed | {
"repo_name": "mikekap/buck",
"path": "test/com/facebook/buck/cli/DaemonIntegrationTest.java",
"license": "apache-2.0",
"size": 22609
} | [
"com.facebook.buck.testutil.integration.ProjectWorkspace",
"com.facebook.buck.testutil.integration.TestDataHelper",
"com.google.common.collect.ImmutableList",
"java.io.IOException",
"java.util.concurrent.ExecutionException"
] | import com.facebook.buck.testutil.integration.ProjectWorkspace; import com.facebook.buck.testutil.integration.TestDataHelper; import com.google.common.collect.ImmutableList; import java.io.IOException; import java.util.concurrent.ExecutionException; | import com.facebook.buck.testutil.integration.*; import com.google.common.collect.*; import java.io.*; import java.util.concurrent.*; | [
"com.facebook.buck",
"com.google.common",
"java.io",
"java.util"
] | com.facebook.buck; com.google.common; java.io; java.util; | 922,080 |
public void addSelectionListener(final SelectionListener listener) {
configurations.addSelectionListener(listener);
} | void function(final SelectionListener listener) { configurations.addSelectionListener(listener); } | /**
* Adds the listener to the collection of listeners who will be notified
* when the user changes the receiver's selection, by sending it one of
* the messages defined in the <code>SelectionListener</code> interface.
* */ | Adds the listener to the collection of listeners who will be notified when the user changes the receiver's selection, by sending it one of the messages defined in the <code>SelectionListener</code> interface | addSelectionListener | {
"repo_name": "eroslevi/titan.EclipsePlug-ins",
"path": "org.eclipse.titan.designer/src/org/eclipse/titan/designer/properties/pages/ConfigurationManagerControl.java",
"license": "epl-1.0",
"size": 19435
} | [
"org.eclipse.swt.events.SelectionListener"
] | import org.eclipse.swt.events.SelectionListener; | import org.eclipse.swt.events.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 201,426 |
public void errorOp(final Marker marker, final String message, final Throwable t) {
logger.logIfEnabled(FQCN, ERROR, marker, message, t);
} | void function(final Marker marker, final String message, final Throwable t) { logger.logIfEnabled(FQCN, ERROR, marker, message, t); } | /**
* Logs a message at the {@code ERROR} level including the stack trace of
* the {@link Throwable} {@code t} passed as parameter.
*
* @param marker the marker data specific to this log statement
* @param message the message to log.
* @param t the exception to log, including its stack tr... | Logs a message at the ERROR level including the stack trace of the <code>Throwable</code> t passed as parameter | errorOp | {
"repo_name": "ppatierno/kaas",
"path": "operator-common/src/main/java/io/strimzi/operator/common/ReconciliationLogger.java",
"license": "apache-2.0",
"size": 352724
} | [
"org.apache.logging.log4j.Marker"
] | import org.apache.logging.log4j.Marker; | import org.apache.logging.log4j.*; | [
"org.apache.logging"
] | org.apache.logging; | 399,409 |
protected Instances normalizedCharacteristicInstances(SoftwareVersion testversion,
SetUniqueList<SoftwareVersion> trainversionSet)
{
Instances data = characteristicInstances(testversion, trainversionSet);
try {
final Norm... | Instances function(SoftwareVersion testversion, SetUniqueList<SoftwareVersion> trainversionSet) { Instances data = characteristicInstances(testversion, trainversionSet); try { final Normalize normalizer = new Normalize(); normalizer.setInputFormat(data); data = Filter.useFilter(data, normalizer); } catch (Exception e) ... | /**
* Returns the normalized distributional characteristics of the training data.
*
* @param testversion
* version of the test data
* @param trainversionSet
* versions of the training data sets
* @return normalized distributional characteristics of the da... | Returns the normalized distributional characteristics of the training data | normalizedCharacteristicInstances | {
"repo_name": "sherbold/CrossPare",
"path": "CrossPare/src/main/java/de/ugoe/cs/cpdp/dataselection/AbstractCharacteristicSelection.java",
"license": "apache-2.0",
"size": 8528
} | [
"de.ugoe.cs.cpdp.versions.SoftwareVersion",
"org.apache.commons.collections4.list.SetUniqueList"
] | import de.ugoe.cs.cpdp.versions.SoftwareVersion; import org.apache.commons.collections4.list.SetUniqueList; | import de.ugoe.cs.cpdp.versions.*; import org.apache.commons.collections4.list.*; | [
"de.ugoe.cs",
"org.apache.commons"
] | de.ugoe.cs; org.apache.commons; | 466,183 |
public void stop() throws NoSuchObjectException; | void function() throws NoSuchObjectException; | /**
* Stops this MBean: rmiregistry cannot accept anymore incoming calls
*
* @see #start
*/ | Stops this MBean: rmiregistry cannot accept anymore incoming calls | stop | {
"repo_name": "prasi-in/geode",
"path": "geode-core/src/main/java/org/apache/geode/admin/jmx/internal/RMIRegistryServiceMBean.java",
"license": "apache-2.0",
"size": 2649
} | [
"java.rmi.NoSuchObjectException"
] | import java.rmi.NoSuchObjectException; | import java.rmi.*; | [
"java.rmi"
] | java.rmi; | 2,269,820 |
default void addAll (@Nullable final Map <? extends KEYTYPE, ? extends VALUETYPE> aValues)
{
if (aValues != null)
putAll (aValues);
}
/**
* Clear and add all provided values.
*
* @param aValues
* The values to be added. May be <code>null</code>.
* @return {@link EChange} | default void addAll (@Nullable final Map <? extends KEYTYPE, ? extends VALUETYPE> aValues) { if (aValues != null) putAll (aValues); } /** * Clear and add all provided values. * * @param aValues * The values to be added. May be <code>null</code>. * @return {@link EChange} | /**
* Add all provided values.
*
* @param aValues
* The values to be added. May be <code>null</code>.
*/ | Add all provided values | addAll | {
"repo_name": "phax/ph-commons",
"path": "ph-commons/src/main/java/com/helger/commons/collection/impl/ICommonsMap.java",
"license": "apache-2.0",
"size": 25410
} | [
"com.helger.commons.state.EChange",
"java.util.Map",
"javax.annotation.Nullable"
] | import com.helger.commons.state.EChange; import java.util.Map; import javax.annotation.Nullable; | import com.helger.commons.state.*; import java.util.*; import javax.annotation.*; | [
"com.helger.commons",
"java.util",
"javax.annotation"
] | com.helger.commons; java.util; javax.annotation; | 2,832,088 |
public static <T> Collection<T> retain(Collection<T> c, boolean cp, int num) {
A.notNull(c, "c");
A.ensure(num >= 0, "num >= 0");
Collection<T> res;
if (!cp) {
res = c;
if (num < res.size()) {
int i = 0;
for (Iterator<T> ite... | static <T> Collection<T> function(Collection<T> c, boolean cp, int num) { A.notNull(c, "c"); A.ensure(num >= 0, STR); Collection<T> res; if (!cp) { res = c; if (num < res.size()) { int i = 0; for (Iterator<T> iter = res.iterator(); iter.hasNext();) { iter.next(); if (i++ >= num) iter.remove(); } } } else { res = new Ar... | /**
* Retains only up to first {@code num} elements in the input collection.
*
* @param c Input collection.
* @param cp If {@code true} method creates collection not modifying input, otherwise does
* <tt>in-place</tt> modifications.
* @param num Maximum number of elements to retain (t... | Retains only up to first num elements in the input collection | retain | {
"repo_name": "f7753/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java",
"license": "apache-2.0",
"size": 159864
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.Iterator",
"org.apache.ignite.internal.util.typedef.internal.A"
] | import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import org.apache.ignite.internal.util.typedef.internal.A; | import java.util.*; import org.apache.ignite.internal.util.typedef.internal.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 607,138 |
public static Map<String, AttributeValue> toAttributeValueMap(
KeyAttribute... primaryKey) {
return ItemUtils.toAttributeValueMap(primaryKey);
} | static Map<String, AttributeValue> function( KeyAttribute... primaryKey) { return ItemUtils.toAttributeValueMap(primaryKey); } | /**
* Converts the specified primary key into the low-level representation.
*/ | Converts the specified primary key into the low-level representation | toAttributeValueMap | {
"repo_name": "jentfoo/aws-sdk-java",
"path": "aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/internal/InternalUtils.java",
"license": "apache-2.0",
"size": 11471
} | [
"com.amazonaws.services.dynamodbv2.document.ItemUtils",
"com.amazonaws.services.dynamodbv2.document.KeyAttribute",
"com.amazonaws.services.dynamodbv2.model.AttributeValue",
"java.util.Map"
] | import com.amazonaws.services.dynamodbv2.document.ItemUtils; import com.amazonaws.services.dynamodbv2.document.KeyAttribute; import com.amazonaws.services.dynamodbv2.model.AttributeValue; import java.util.Map; | import com.amazonaws.services.dynamodbv2.document.*; import com.amazonaws.services.dynamodbv2.model.*; import java.util.*; | [
"com.amazonaws.services",
"java.util"
] | com.amazonaws.services; java.util; | 2,857,022 |
public static void applyFields(Date datetarget, Date datesource, int fields) {
// This *should* be a TZ-independent operation.
DateFormat breaker = LocalSDF.breakformat.get();
String breaktarget = breaker.format(datetarget);
String breaksource = breaker.format(datesource);
String fused = fiel... | static void function(Date datetarget, Date datesource, int fields) { DateFormat breaker = LocalSDF.breakformat.get(); String breaktarget = breaker.format(datetarget); String breaksource = breaker.format(datesource); String fused = fields == DateUtil.DATE_FIELDS ? breaksource.substring(0,8) + breaktarget.substring(8) : ... | /**
* Takes the Date-defining fields from the source and applies them onto the
* target, preserving its Time-defining fields, or the reverse
* @param datetarget destination date
* @param datesource source date
* @param fields date fields
*/ | Takes the Date-defining fields from the source and applies them onto the target, preserving its Time-defining fields, or the reverse | applyFields | {
"repo_name": "ern/rsf",
"path": "rsf-core/ponderutilcore/src/uk/org/ponder/dateutil/DateUtil.java",
"license": "bsd-3-clause",
"size": 2472
} | [
"java.text.DateFormat",
"java.util.Date"
] | import java.text.DateFormat; import java.util.Date; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 2,082,400 |
EClass getTaskListenerType(); | EClass getTaskListenerType(); | /**
* Returns the meta object for class '{@link org.camunda.bpm.modeler.runtime.engine.model.TaskListenerType <em>Task Listener Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Task Listener Type</em>'.
* @see org.camunda.bpm.modeler.runtime.engine.model.... | Returns the meta object for class '<code>org.camunda.bpm.modeler.runtime.engine.model.TaskListenerType Task Listener Type</code>'. | getTaskListenerType | {
"repo_name": "camunda/camunda-eclipse-plugin",
"path": "org.camunda.bpm.modeler/src/org/camunda/bpm/modeler/runtime/engine/model/ModelPackage.java",
"license": "epl-1.0",
"size": 231785
} | [
"org.eclipse.emf.ecore.EClass"
] | import org.eclipse.emf.ecore.EClass; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 171,486 |
public static void attemptAskAccess(TomahawkMainActivity activity) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (!getBoolean(ASKED_FOR_ACCESS)) {
askAccess(activity);
}
}
} | static void function(TomahawkMainActivity activity) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (!getBoolean(ASKED_FOR_ACCESS)) { askAccess(activity); } } } | /**
* Starts the AskAccessActivity in order to ask the user for permission to the notification
* listener, if the user hasn't been asked before and is logged into hatchet
*/ | Starts the AskAccessActivity in order to ask the user for permission to the notification listener, if the user hasn't been asked before and is logged into hatchet | attemptAskAccess | {
"repo_name": "tomahawk-player/tomahawk-android",
"path": "app/src/main/java/org/tomahawk/tomahawk_android/utils/PreferenceUtils.java",
"license": "gpl-3.0",
"size": 7489
} | [
"android.os.Build",
"org.tomahawk.tomahawk_android.activities.TomahawkMainActivity"
] | import android.os.Build; import org.tomahawk.tomahawk_android.activities.TomahawkMainActivity; | import android.os.*; import org.tomahawk.tomahawk_android.activities.*; | [
"android.os",
"org.tomahawk.tomahawk_android"
] | android.os; org.tomahawk.tomahawk_android; | 761,666 |
protected IRubyObject setReader(InputStream istream)
{
Ruby runtime = this.getRuntime();
IRubyObject oldValue = runtime.getObject().getConstant(STDIN_CONSTANT);
if (istream != null)
{
setReader(new RubyIO(runtime, istream));
}
return oldValue;
} | IRubyObject function(InputStream istream) { Ruby runtime = this.getRuntime(); IRubyObject oldValue = runtime.getObject().getConstant(STDIN_CONSTANT); if (istream != null) { setReader(new RubyIO(runtime, istream)); } return oldValue; } | /**
* setReader - based on ScriptContainer#setReader
*
* @param istream
*/ | setReader - based on ScriptContainer#setReader | setReader | {
"repo_name": "gitmeri/studio3",
"path": "plugins/com.aptana.scripting/src/com/aptana/scripting/model/CommandBlockRunner.java",
"license": "gpl-3.0",
"size": 13682
} | [
"java.io.InputStream",
"org.jruby.Ruby",
"org.jruby.RubyIO",
"org.jruby.runtime.builtin.IRubyObject"
] | import java.io.InputStream; import org.jruby.Ruby; import org.jruby.RubyIO; import org.jruby.runtime.builtin.IRubyObject; | import java.io.*; import org.jruby.*; import org.jruby.runtime.builtin.*; | [
"java.io",
"org.jruby",
"org.jruby.runtime"
] | java.io; org.jruby; org.jruby.runtime; | 1,197,182 |
@Test
public void testStore() {
SimpleDHTObject value1 = new SimpleDHTObject(key1, null);
server.join(getOperationCallback());
int id1 = this.client1.store(key1, value1, getOperationCallback());
runSimulation(seconds(1000));
assertEquals(value1, this.server.getDHTObject(key1));
assertEquals(StoreResul... | void function() { SimpleDHTObject value1 = new SimpleDHTObject(key1, null); server.join(getOperationCallback()); int id1 = this.client1.store(key1, value1, getOperationCallback()); runSimulation(seconds(1000)); assertEquals(value1, this.server.getDHTObject(key1)); assertEquals(StoreResultMsg.STORE_SUCCEEDED, results.ge... | /**
* Test store while the server is online.
*
*/ | Test store while the server is online | testStore | {
"repo_name": "flyroom/PeerfactSimKOM_Clone",
"path": "test/org/peerfact/impl/overlay/dht/centralized/CentralizedTest.java",
"license": "gpl-2.0",
"size": 7651
} | [
"org.peerfact.impl.overlay.dht.centralizedstorage.messages.StoreResultMsg"
] | import org.peerfact.impl.overlay.dht.centralizedstorage.messages.StoreResultMsg; | import org.peerfact.impl.overlay.dht.centralizedstorage.messages.*; | [
"org.peerfact.impl"
] | org.peerfact.impl; | 2,690,230 |
private static int unsafeHashCode(byte[] bytes) {
if (bytes == null) {
return 0;
}
final int len = bytes.length;
int hashCode = 1;
final int intCount = len >>> 2;
int arrayIndex = 0;
// reading in batch both help hash code computation data dependencies and save memo... | static int function(byte[] bytes) { if (bytes == null) { return 0; } final int len = bytes.length; int hashCode = 1; final int intCount = len >>> 2; int arrayIndex = 0; for (int i = 0; i < intCount; i++) { hashCode = 31 * hashCode + PlatformDependent.getInt(bytes, arrayIndex); arrayIndex += Integer.BYTES; } final byte ... | /**
* This hash code computation is borrowed by {@link io.netty.buffer.ByteBufUtil#hashCode(ByteBuf)}.
*/ | This hash code computation is borrowed by <code>io.netty.buffer.ByteBufUtil#hashCode(ByteBuf)</code> | unsafeHashCode | {
"repo_name": "kjniemi/activemq-artemis",
"path": "artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ByteUtil.java",
"license": "apache-2.0",
"size": 17886
} | [
"io.netty.util.internal.PlatformDependent"
] | import io.netty.util.internal.PlatformDependent; | import io.netty.util.internal.*; | [
"io.netty.util"
] | io.netty.util; | 2,025,199 |
RedisFuture<Void> punsubscribe(K... patterns); | RedisFuture<Void> punsubscribe(K... patterns); | /**
* Stop listening for messages posted to channels matching the given patterns.
*
* @param patterns the patterns
* @return RedisFuture<Void> Future to synchronize {@code punsubscribe} completion
*/ | Stop listening for messages posted to channels matching the given patterns | punsubscribe | {
"repo_name": "Hocdoc/lettuce",
"path": "src/main/java/com/lambdaworks/redis/pubsub/RedisPubSubConnection.java",
"license": "apache-2.0",
"size": 1745
} | [
"com.lambdaworks.redis.RedisFuture"
] | import com.lambdaworks.redis.RedisFuture; | import com.lambdaworks.redis.*; | [
"com.lambdaworks.redis"
] | com.lambdaworks.redis; | 1,335,754 |
@Test
public void testListEmptySet() throws Exception {
String V0 = "onsite";
IndexStoreMemory fake = new IndexStoreMemory();
fake.addVolumeSet(V0);
IndexStore index = fake;
assertEquals(list(V0), index.listVolumeSets());
assertEquals(list(), index.listVolumeNam... | void function() throws Exception { String V0 = STR; IndexStoreMemory fake = new IndexStoreMemory(); fake.addVolumeSet(V0); IndexStore index = fake; assertEquals(list(V0), index.listVolumeSets()); assertEquals(list(), index.listVolumeNames(V0)); } | /**
* List the volume indexes. When the store has one index set, and the set is
* empty.
*
* @throws Exception
*/ | List the volume indexes. When the store has one index set, and the set is empty | testListEmptySet | {
"repo_name": "sarah-happy/happy-archive",
"path": "archive/src/main/java/org/yi/happy/archive/index/IndexStoreMemoryTest.java",
"license": "apache-2.0",
"size": 2669
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,618,482 |
public Boolean peekCompletedVersionsHistory(GridCacheVersion xid) {
Object o = completedVersHashMap.get(xid);
return (o instanceof Boolean) ? (Boolean)o : null;
} | Boolean function(GridCacheVersion xid) { Object o = completedVersHashMap.get(xid); return (o instanceof Boolean) ? (Boolean)o : null; } | /**
* Peeks completed versions history map to find out whether transaction was committed or rolled back
* in the recent past.
*
* @param xid Transaction XID version.
* @return <code>true</code> if transaction was committed, <code>false</code> if transaction was rolled back,
* <code>null</c... | Peeks completed versions history map to find out whether transaction was committed or rolled back in the recent past | peekCompletedVersionsHistory | {
"repo_name": "andrey-kuznetsov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java",
"license": "apache-2.0",
"size": 116196
} | [
"org.apache.ignite.internal.processors.cache.version.GridCacheVersion"
] | import org.apache.ignite.internal.processors.cache.version.GridCacheVersion; | import org.apache.ignite.internal.processors.cache.version.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,354,679 |
synchronized void logEdit(final int length, final byte[] data) {
long start = beginTransaction();
try {
editLogStream.writeRaw(data, 0, length);
} catch (IOException ex) {
// All journals have failed, it will be handled in logSync.
}
endTransaction(start);
} | synchronized void logEdit(final int length, final byte[] data) { long start = beginTransaction(); try { editLogStream.writeRaw(data, 0, length); } catch (IOException ex) { } endTransaction(start); } | /**
* Write an operation to the edit log. Do not sync to persistent
* store yet.
*/ | Write an operation to the edit log. Do not sync to persistent store yet | logEdit | {
"repo_name": "Reidddddd/mo-hadoop2.6.0",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java",
"license": "apache-2.0",
"size": 67388
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,773,899 |
T adapt(DocumentEventRouter<? super E, E, ?> router, E element); | T adapt(DocumentEventRouter<? super E, E, ?> router, E element); | /**
* Creates an abstract object for a document element. The document and element
* must not be modified by this method.
*
* @param router the document event router supporting the object
* @param element the element node to adapt
* @return an abstract element backed by the document element
*/ | Creates an abstract object for a document element. The document and element must not be modified by this method | adapt | {
"repo_name": "nelsonsilva/wave-protocol",
"path": "src/org/waveprotocol/wave/model/adt/docbased/Factory.java",
"license": "apache-2.0",
"size": 1857
} | [
"org.waveprotocol.wave.model.document.util.DocumentEventRouter"
] | import org.waveprotocol.wave.model.document.util.DocumentEventRouter; | import org.waveprotocol.wave.model.document.util.*; | [
"org.waveprotocol.wave"
] | org.waveprotocol.wave; | 2,866,426 |
public IFile getModelFile() {
return newFileCreationPage.getModelFile();
}
| IFile function() { return newFileCreationPage.getModelFile(); } | /**
* Get the file from the page.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | Get the file from the page. | getModelFile | {
"repo_name": "BaSys-PC1/models",
"path": "de.dfki.iui.basys.model.domain.editor/src/de/dfki/iui/basys/model/domain/topology/presentation/TopologyModelWizard.java",
"license": "epl-1.0",
"size": 18501
} | [
"org.eclipse.core.resources.IFile"
] | import org.eclipse.core.resources.IFile; | import org.eclipse.core.resources.*; | [
"org.eclipse.core"
] | org.eclipse.core; | 2,556,994 |
public void reject() throws NotConnectedException, InterruptedException {
manager.rejectIncomingFileTransfer(this);
} | void function() throws NotConnectedException, InterruptedException { manager.rejectIncomingFileTransfer(this); } | /**
* Rejects the file transfer request.
* @throws NotConnectedException
* @throws InterruptedException
*/ | Rejects the file transfer request | reject | {
"repo_name": "opg7371/Smack",
"path": "smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferRequest.java",
"license": "apache-2.0",
"size": 3853
} | [
"org.jivesoftware.smack.SmackException"
] | import org.jivesoftware.smack.SmackException; | import org.jivesoftware.smack.*; | [
"org.jivesoftware.smack"
] | org.jivesoftware.smack; | 2,002,589 |
public void testOfflineStorageWithNegativePriority() throws Exception {
// Set this connection with negative priority
Presence presence = new Presence(Presence.Type.available);
presence.setMode(Presence.Mode.available);
presence.setPriority(-1);
getConnection(0).sendPacket(pr... | void function() throws Exception { Presence presence = new Presence(Presence.Type.available); presence.setMode(Presence.Mode.available); presence.setPriority(-1); getConnection(0).sendPacket(presence); Thread.sleep(200); PacketCollector collector = getConnection(0).createPacketCollector(new MessageTypeFilter(Message.Ty... | /**
* User0 is connected from 1 resource with a negative priority presence. User1
* sends a message to the bare JID of User0. Messages should be stored offline.
* User0 then changes the priority presence to a positive value. Check that
* offline messages were delivered to the user.
*
* @th... | User0 is connected from 1 resource with a negative priority presence. User1 sends a message to the bare JID of User0. Messages should be stored offline. User0 then changes the priority presence to a positive value. Check that offline messages were delivered to the user | testOfflineStorageWithNegativePriority | {
"repo_name": "magnetsystems/message-smack",
"path": "smack-core/src/integration-test/java/org/jivesoftware/smack/MessageTest.java",
"license": "apache-2.0",
"size": 16936
} | [
"org.jivesoftware.smack.filter.MessageTypeFilter",
"org.jivesoftware.smack.packet.Message",
"org.jivesoftware.smack.packet.Presence"
] | import org.jivesoftware.smack.filter.MessageTypeFilter; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Presence; | import org.jivesoftware.smack.filter.*; import org.jivesoftware.smack.packet.*; | [
"org.jivesoftware.smack"
] | org.jivesoftware.smack; | 1,189,954 |
@Authorized( { PrivilegeConstants.PURGE_PERSON_ATTRIBUTE_TYPES })
public void purgePersonAttributeType(PersonAttributeType type) throws APIException;
| @Authorized( { PrivilegeConstants.PURGE_PERSON_ATTRIBUTE_TYPES }) void function(PersonAttributeType type) throws APIException; | /**
* Purges a PersonAttribute type from the database (cannot be undone)
*
* @param type type to be purged from the database
* @throws APIException
* @should delete person attribute type from database
*/ | Purges a PersonAttribute type from the database (cannot be undone) | purgePersonAttributeType | {
"repo_name": "Bhamni/openmrs-core",
"path": "api/src/main/java/org/openmrs/api/PersonService.java",
"license": "mpl-2.0",
"size": 41991
} | [
"org.openmrs.PersonAttributeType",
"org.openmrs.annotation.Authorized",
"org.openmrs.util.PrivilegeConstants"
] | import org.openmrs.PersonAttributeType; import org.openmrs.annotation.Authorized; import org.openmrs.util.PrivilegeConstants; | import org.openmrs.*; import org.openmrs.annotation.*; import org.openmrs.util.*; | [
"org.openmrs",
"org.openmrs.annotation",
"org.openmrs.util"
] | org.openmrs; org.openmrs.annotation; org.openmrs.util; | 1,998,954 |
public BigDecimal getStmtAmt();
public static final String COLUMNNAME_TrxAmt = "TrxAmt"; | BigDecimal function(); public static final String COLUMNNAME_TrxAmt = STR; | /** Get Statement amount.
* Statement Amount
*/ | Get Statement amount. Statement Amount | getStmtAmt | {
"repo_name": "arthurmelo88/palmetalADP",
"path": "adempiere_360/base/src/org/compiere/model/I_C_BankStatementLine.java",
"license": "gpl-2.0",
"size": 14776
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 2,089,102 |
static void doUpgrade(World world, Planet planet, Building b) {
do {
// maximize upgrade level if the player has enough money relative to the building's cost
if (!upgrade(world, planet, b, b.upgradeLevel + 1)) {
break;
}
} while (b.upgradeLev... | static void doUpgrade(World world, Planet planet, Building b) { do { if (!upgrade(world, planet, b, b.upgradeLevel + 1)) { break; } } while (b.upgradeLevel < b.type.upgrades.size() && planet.owner.money() >= 30L * b.type.cost); } | /**
* Increase the level of the given building by one.
* @param world the world for the models
* @param planet the target planet
* @param b the building to upgrade
*/ | Increase the level of the given building by one | doUpgrade | {
"repo_name": "akarnokd/open-ig",
"path": "src/hu/openig/mechanics/AutoBuilder.java",
"license": "lgpl-3.0",
"size": 18744
} | [
"hu.openig.model.Building",
"hu.openig.model.Planet",
"hu.openig.model.World"
] | import hu.openig.model.Building; import hu.openig.model.Planet; import hu.openig.model.World; | import hu.openig.model.*; | [
"hu.openig.model"
] | hu.openig.model; | 1,682,319 |
private static void scorePlaintext(MeteorScorer scorer, Properties props,
MeteorConfiguration config, String testFile, String refFile)
throws IOException {
ArrayList<String> lines1 = new ArrayList<String>();
ArrayList<String> lines2 = new ArrayList<String>();
ArrayList<ArrayList<String>> lines2mref = ne... | static void function(MeteorScorer scorer, Properties props, MeteorConfiguration config, String testFile, String refFile) throws IOException { ArrayList<String> lines1 = new ArrayList<String>(); ArrayList<String> lines2 = new ArrayList<String>(); ArrayList<ArrayList<String>> lines2mref = new ArrayList<ArrayList<String>>... | /**
* Input is in plaintext format, output is in simple format
*/ | Input is in plaintext format, output is in simple format | scorePlaintext | {
"repo_name": "qingsongma/blend",
"path": "tools/meteor-1.5/src/Meteor.java",
"license": "gpl-3.0",
"size": 29246
} | [
"edu.cmu.meteor.scorer.MeteorConfiguration",
"edu.cmu.meteor.scorer.MeteorScorer",
"edu.cmu.meteor.scorer.MeteorStats",
"java.io.BufferedReader",
"java.io.FileInputStream",
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.InputStreamReader",
"java.io.OutputStreamWriter",
"java.io.PrintW... | import edu.cmu.meteor.scorer.MeteorConfiguration; import edu.cmu.meteor.scorer.MeteorScorer; import edu.cmu.meteor.scorer.MeteorStats; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream... | import edu.cmu.meteor.scorer.*; import java.io.*; import java.util.*; | [
"edu.cmu.meteor",
"java.io",
"java.util"
] | edu.cmu.meteor; java.io; java.util; | 445,214 |
private boolean isDefaultGiven(String swaggerContent) throws APIManagementException {
OpenAPI openAPI = getOpenAPI(swaggerContent);
Components components = openAPI.getComponents();
if (components == null) {
return false;
}
Map<String, SecurityScheme> securitySche... | boolean function(String swaggerContent) throws APIManagementException { OpenAPI openAPI = getOpenAPI(swaggerContent); Components components = openAPI.getComponents(); if (components == null) { return false; } Map<String, SecurityScheme> securitySchemes = components.getSecuritySchemes(); if (securitySchemes == null) { r... | /**
* This method returns the boolean value which checks whether the swagger is included default security scheme or not
*
* @param swaggerContent resource json
* @return boolean
* @throws APIManagementException
*/ | This method returns the boolean value which checks whether the swagger is included default security scheme or not | isDefaultGiven | {
"repo_name": "nuwand/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OAS3Parser.java",
"license": "apache-2.0",
"size": 75509
} | [
"io.swagger.v3.oas.models.Components",
"io.swagger.v3.oas.models.OpenAPI",
"io.swagger.v3.oas.models.security.SecurityScheme",
"java.util.Map",
"org.wso2.carbon.apimgt.api.APIManagementException"
] | import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.security.SecurityScheme; import java.util.Map; import org.wso2.carbon.apimgt.api.APIManagementException; | import io.swagger.v3.oas.models.*; import io.swagger.v3.oas.models.security.*; import java.util.*; import org.wso2.carbon.apimgt.api.*; | [
"io.swagger.v3",
"java.util",
"org.wso2.carbon"
] | io.swagger.v3; java.util; org.wso2.carbon; | 2,570,739 |
return readFile(new File(path));
}
| return readFile(new File(path)); } | /**
* Reads the root CompoundTag from the given file.
*
* @param path Path of the file.
* @return CompoundTag The read compound tag.
*/ | Reads the root CompoundTag from the given file | readFile | {
"repo_name": "darkhax/OpenNBT",
"path": "src/main/java/net/darkhax/opennbt/NBTHelper.java",
"license": "mit",
"size": 9097
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 773,276 |
public static final DlpServiceClient create(DlpServiceSettings settings) throws IOException {
return new DlpServiceClient(settings);
} | static final DlpServiceClient function(DlpServiceSettings settings) throws IOException { return new DlpServiceClient(settings); } | /**
* Constructs an instance of DlpServiceClient, using the given settings. The channels are created
* based on the settings passed in, or defaults for any settings that are not set.
*/ | Constructs an instance of DlpServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set | create | {
"repo_name": "pongad/api-client-staging",
"path": "generated/java/gapic-google-cloud-dlp-v2beta1/src/main/java/com/google/cloud/dlp/v2beta1/DlpServiceClient.java",
"license": "bsd-3-clause",
"size": 43052
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,004,545 |
public static StateEventLog from(StateEventBody eventBody)
{
if (eventBody == null) throw new ArgumentNullException("eventBody");
return new StateEventLog(
eventBody.getStateId(),
eventBody.getName().orElse(null));
}
private StateEventLog(
UUID stateId,
String name)
{
if (stateId == null) thr... | static StateEventLog function(StateEventBody eventBody) { if (eventBody == null) throw new ArgumentNullException(STR); return new StateEventLog( eventBody.getStateId(), eventBody.getName().orElse(null)); } private StateEventLog( UUID stateId, String name) { if (stateId == null) throw new ArgumentNullException(STR); thi... | /**
* Creates a new StateEventLog to match the supplied StateEventBody.
*
* @param eventBody the StateEventBody to copy into a new StateEventLog.
* @return a new StateEventLog matching the supplied StateEventBody.
* @since 4.0
*/ | Creates a new StateEventLog to match the supplied StateEventBody | from | {
"repo_name": "zendigitalstudios/wildebeest",
"path": "MV.Wildebeest.Core/source/core/java/co/mv/wb/event/StateEventLog.java",
"license": "gpl-2.0",
"size": 2229
} | [
"co.mv.wb.framework.ArgumentNullException"
] | import co.mv.wb.framework.ArgumentNullException; | import co.mv.wb.framework.*; | [
"co.mv.wb"
] | co.mv.wb; | 1,996,470 |
public void removeRows(int[] rows) {
if (!(_realModel instanceof DefaultTableModel)) {
throw new RuntimeException("removeRows() requires a DefaultTableModel");
}
DefaultTableModel model = (DefaultTableModel) _realModel;
// avoid multiple updates
model.removeTable... | void function(int[] rows) { if (!(_realModel instanceof DefaultTableModel)) { throw new RuntimeException(STR); } DefaultTableModel model = (DefaultTableModel) _realModel; model.removeTableModelListener(tableModelListener); if (_mapToSorted != null) { for (int i = 0; i < rows.length; i++) rows[i] = _mapToSorted[rows[i]]... | /**
* Remove the given rows from the table (assumes use of DefaultTableModel).
*
* @param rows array of row indexes
*/ | Remove the given rows from the table (assumes use of DefaultTableModel) | removeRows | {
"repo_name": "fnussber/ocs",
"path": "bundle/jsky.util.gui/src/main/java/jsky/util/gui/SortedJTable.java",
"license": "bsd-3-clause",
"size": 18437
} | [
"java.util.Arrays",
"javax.swing.table.DefaultTableModel"
] | import java.util.Arrays; import javax.swing.table.DefaultTableModel; | import java.util.*; import javax.swing.table.*; | [
"java.util",
"javax.swing"
] | java.util; javax.swing; | 2,712,096 |
@CanIgnoreReturnValue
public static <T> T checkNotNull(
T obj, @Nullable String errorMessageTemplate, @Nullable Object p1, char p2) {
if (obj == null) {
throw new NullPointerException(format(errorMessageTemplate, p1, p2));
}
return obj;
} | static <T> T function( T obj, @Nullable String errorMessageTemplate, @Nullable Object p1, char p2) { if (obj == null) { throw new NullPointerException(format(errorMessageTemplate, p1, p2)); } return obj; } | /**
* Ensures that an object reference passed as a parameter to the calling method is not null.
*
* <p>See {@link #checkNotNull(Object, String, Object...)} for details.
*/ | Ensures that an object reference passed as a parameter to the calling method is not null. See <code>#checkNotNull(Object, String, Object...)</code> for details | checkNotNull | {
"repo_name": "jakubmalek/guava",
"path": "guava/src/com/google/common/base/Preconditions.java",
"license": "apache-2.0",
"size": 51675
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 1,514,831 |
public RecordDescriptor[] getOutputRecordDescriptors(); | RecordDescriptor[] function(); | /**
* Gets the output record descriptor
*
* @return Array of RecordDescriptor, one per output.
*/ | Gets the output record descriptor | getOutputRecordDescriptors | {
"repo_name": "waans11/incubator-asterixdb-hyracks",
"path": "hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/dataflow/IOperatorDescriptor.java",
"license": "apache-2.0",
"size": 2767
} | [
"org.apache.hyracks.api.dataflow.value.RecordDescriptor"
] | import org.apache.hyracks.api.dataflow.value.RecordDescriptor; | import org.apache.hyracks.api.dataflow.value.*; | [
"org.apache.hyracks"
] | org.apache.hyracks; | 365,752 |
public List<JobLog> findByJobContextId(String jobContextId) {
return (List<JobLog>) this
.getEntityManager()
.createQuery(
"select e from JobLog e where e.clientId = :clientId and e.jobContext.id = :jobContextId",
JobLog.class)
.setParameter("clientId",
Session.user.get().getClient().... | List<JobLog> function(String jobContextId) { return (List<JobLog>) this .getEntityManager() .createQuery( STR, JobLog.class) .setParameter(STR, Session.user.get().getClient().getId()) .setParameter(STR, jobContextId).getResultList(); } | /**
* Find by ID of reference: jobContext.id
*/ | Find by ID of reference: jobContext.id | findByJobContextId | {
"repo_name": "seava/seava.mod.ad",
"path": "seava.mod.ad.business/src/main/java/seava/ad/business/impl/scheduler/JobLog_Service.java",
"license": "apache-2.0",
"size": 2906
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 92,979 |
public Configuration getConfig() {
return this.config;
} | Configuration function() { return this.config; } | /**
* Returns the configuration for that object description.
*
* @return the configuration or null, if not yet set.
*/ | Returns the configuration for that object description | getConfig | {
"repo_name": "mbatchelor/pentaho-reporting",
"path": "engine/core/src/main/java/org/pentaho/reporting/engine/classic/core/modules/parser/ext/factory/base/AbstractObjectDescription.java",
"license": "lgpl-2.1",
"size": 8561
} | [
"org.pentaho.reporting.libraries.base.config.Configuration"
] | import org.pentaho.reporting.libraries.base.config.Configuration; | import org.pentaho.reporting.libraries.base.config.*; | [
"org.pentaho.reporting"
] | org.pentaho.reporting; | 518,619 |
ImageFlavor getTargetFlavor(); | ImageFlavor getTargetFlavor(); | /**
* Returns the flavor that this converter converts images into.
* @return the target flavor
*/ | Returns the flavor that this converter converts images into | getTargetFlavor | {
"repo_name": "apache/xml-graphics-commons",
"path": "src/main/java/org/apache/xmlgraphics/image/loader/spi/ImageConverter.java",
"license": "apache-2.0",
"size": 2595
} | [
"org.apache.xmlgraphics.image.loader.ImageFlavor"
] | import org.apache.xmlgraphics.image.loader.ImageFlavor; | import org.apache.xmlgraphics.image.loader.*; | [
"org.apache.xmlgraphics"
] | org.apache.xmlgraphics; | 1,118,451 |
public void executeSqlStatement(String sqlStatement)
throws ClassNotFoundException, SQLException, FileNotFoundException, IOException
{
if(sqlStatement == null || sqlStatement.length() == 0)
throw new IllegalArgumentException("Empty sqlStatement!");
Connection con = null;
Stateme... | void function(String sqlStatement) throws ClassNotFoundException, SQLException, FileNotFoundException, IOException { if(sqlStatement == null sqlStatement.length() == 0) throw new IllegalArgumentException(STR); Connection con = null; Statement st = null; try { con = getConnection(); st = con.createStatement(); st.execut... | /**
* Executes a single SQL statement given by a string parameter.
*
* @param sqlStatement
* @throws ClassNotFoundException
* @throws SQLException
* @throws FileNotFoundException
* @throws IOException
*/ | Executes a single SQL statement given by a string parameter | executeSqlStatement | {
"repo_name": "chr-krenn/fhj-ws2015-sd13-pse",
"path": "pse/src/test/java/at/fhj/swd13/pse/test/util/JdbcTestHelper.java",
"license": "mit",
"size": 6171
} | [
"java.io.FileNotFoundException",
"java.io.IOException",
"java.sql.Connection",
"java.sql.SQLException",
"java.sql.Statement"
] | import java.io.FileNotFoundException; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; | import java.io.*; import java.sql.*; | [
"java.io",
"java.sql"
] | java.io; java.sql; | 263,685 |
public List<CalendarReminder> getCalendarReminderBefore(Date sendDate);
| List<CalendarReminder> function(Date sendDate); | /**
* Retrieve all the CalendarReminders before the specified date
* @param sendDate The Date used to retrieve the CalendarReminders
* @return
*/ | Retrieve all the CalendarReminders before the specified date | getCalendarReminderBefore | {
"repo_name": "ggonzales/ksl",
"path": "src/com/dotmarketing/portlets/calendar/business/CalendarReminderFactory.java",
"license": "gpl-3.0",
"size": 1593
} | [
"com.dotmarketing.portlets.calendar.model.CalendarReminder",
"java.util.Date",
"java.util.List"
] | import com.dotmarketing.portlets.calendar.model.CalendarReminder; import java.util.Date; import java.util.List; | import com.dotmarketing.portlets.calendar.model.*; import java.util.*; | [
"com.dotmarketing.portlets",
"java.util"
] | com.dotmarketing.portlets; java.util; | 876,745 |
@Generated
@Selector("cancel")
public native void cancel(); | @Selector(STR) native void function(); | /**
* Cancel an ASWebAuthenticationSession. If the view controller is already presented to load the webpage for
* authentication, it will be dismissed. Calling cancel on an already canceled session will have no effect.
*/ | Cancel an ASWebAuthenticationSession. If the view controller is already presented to load the webpage for authentication, it will be dismissed. Calling cancel on an already canceled session will have no effect | cancel | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/authenticationservices/ASWebAuthenticationSession.java",
"license": "apache-2.0",
"size": 11356
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 1,172,937 |
public void setValue(int value) {
this.value = Address.fromIntZeroExtend(value);
validate();
set.logChange(this);
} | void function(int value) { this.value = Address.fromIntZeroExtend(value); validate(); set.logChange(this); } | /**
* Update the value of the option, echoing the change if the echoOptions
* option is set. This method also calls the validate method to allow
* subclasses to perform any required validation.
*
* @param value The new value for the option.
*/ | Update the value of the option, echoing the change if the echoOptions option is set. This method also calls the validate method to allow subclasses to perform any required validation | setValue | {
"repo_name": "xjbhenry/hack_rvm",
"path": "src/org/vmutil/options/AddressOption.java",
"license": "epl-1.0",
"size": 2132
} | [
"org.vmmagic.unboxed.Address"
] | import org.vmmagic.unboxed.Address; | import org.vmmagic.unboxed.*; | [
"org.vmmagic.unboxed"
] | org.vmmagic.unboxed; | 1,337,803 |
void init()
throws JspException
{
md = MetaData.getDbMetaData( datasource );
req = pageContext.getRequest();
// schema = MetaData.getDbProperties( datasource ).getProperty("SCHEMA");
} | void init() throws JspException { md = MetaData.getDbMetaData( datasource ); req = pageContext.getRequest(); } | /**
* Description of the Method
*
*@exception JspException Description of the Exception
*/ | Description of the Method | init | {
"repo_name": "jchoyt/mrald-lite",
"path": "src/org/mitre/mrald/taglib/DisplayDBTag.java",
"license": "apache-2.0",
"size": 14808
} | [
"javax.servlet.jsp.JspException",
"org.mitre.mrald.util.MetaData"
] | import javax.servlet.jsp.JspException; import org.mitre.mrald.util.MetaData; | import javax.servlet.jsp.*; import org.mitre.mrald.util.*; | [
"javax.servlet",
"org.mitre.mrald"
] | javax.servlet; org.mitre.mrald; | 1,801,488 |
public void setEnd(final String s) {
SimpleDateFormat stf = new SimpleDateFormat("HH:mm:ss");
stf.setTimeZone(TimeZone.getTimeZone("UTC"));
try {
end = stf.parse(s).getTime();
} catch(ParseException ex) {
LogLog.warn("Error parsing end value " + s, ex);
... | void function(final String s) { SimpleDateFormat stf = new SimpleDateFormat(STR); stf.setTimeZone(TimeZone.getTimeZone("UTC")); try { end = stf.parse(s).getTime(); } catch(ParseException ex) { LogLog.warn(STR + s, ex); } } | /**
* Set end (exclusive) of time span.
* @param s string representation of end time as HH:mm:ss.
*/ | Set end (exclusive) of time span | setEnd | {
"repo_name": "apache/log4j-extras",
"path": "src/main/java/org/apache/log4j/filter/TimeFilter.java",
"license": "apache-2.0",
"size": 4361
} | [
"java.text.ParseException",
"java.text.SimpleDateFormat",
"java.util.TimeZone",
"org.apache.log4j.helpers.LogLog"
] | import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.TimeZone; import org.apache.log4j.helpers.LogLog; | import java.text.*; import java.util.*; import org.apache.log4j.helpers.*; | [
"java.text",
"java.util",
"org.apache.log4j"
] | java.text; java.util; org.apache.log4j; | 1,877,305 |
Configuration conf = new Configuration();
conf.setLong("dfs.blockreport.intervalMsec", 1000L);
conf.set("dfs.replication.pending.timeout.sec", Integer.toString(2));
MiniDFSCluster cluster = new MiniDFSCluster(conf, 3, true, null);
FileSystem fs = cluster.getFileSystem();
try {
final Path file... | Configuration conf = new Configuration(); conf.setLong(STR, 1000L); conf.set(STR, Integer.toString(2)); MiniDFSCluster cluster = new MiniDFSCluster(conf, 3, true, null); FileSystem fs = cluster.getFileSystem(); try { final Path fileName = new Path("/foo1"); DFSTestUtil.createFile(fs, fileName, 2, (short)3, 0L); DFSTest... | /** Test processOverReplicatedBlock can handle corrupt replicas fine.
* It make sure that it won't treat corrupt replicas as valid ones
* thus prevents NN deleting valid replicas but keeping
* corrupt ones.
*/ | Test processOverReplicatedBlock can handle corrupt replicas fine. It make sure that it won't treat corrupt replicas as valid ones thus prevents NN deleting valid replicas but keeping corrupt ones | testProcesOverReplicateBlock | {
"repo_name": "dhootha/hadoop-common",
"path": "src/test/org/apache/hadoop/hdfs/server/namenode/TestOverReplicatedBlocks.java",
"license": "apache-2.0",
"size": 3208
} | [
"java.io.File",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hdfs.DFSTestUtil",
"org.apache.hadoop.hdfs.MiniDFSCluster",
"org.apache.hadoop.hdfs.TestDatanodeBlockScanner",
"org.apache.hadoop.hdfs.protocol.Block",
"org.apac... | import java.io.File; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.DFSTestUtil; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.hdfs.TestDatanodeBlockScanner; import org.apache.hadoop.hdfs.proto... | import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.*; import org.apache.hadoop.hdfs.protocol.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,598,937 |
protected static Map<String, Endpoint[]> getEndpoints() {
return new HashMap<String, Endpoint[]>(endpoints);
}
| static Map<String, Endpoint[]> function() { return new HashMap<String, Endpoint[]>(endpoints); } | /**
* Returns a map of installed endpoints keyed by the JMXMP connector URL
* @return a map of installed endpoints keyed by the JMXMP connector URL
*/ | Returns a map of installed endpoints keyed by the JMXMP connector URL | getEndpoints | {
"repo_name": "nickman/JMXMPAgent",
"path": "agent-publisher/src/main/java/com/heliosapm/endpoint/publisher/agent/AbstractAgentCommandProcessor.java",
"license": "apache-2.0",
"size": 6109
} | [
"com.heliosapm.endpoint.publisher.endpoint.Endpoint",
"java.util.HashMap",
"java.util.Map"
] | import com.heliosapm.endpoint.publisher.endpoint.Endpoint; import java.util.HashMap; import java.util.Map; | import com.heliosapm.endpoint.publisher.endpoint.*; import java.util.*; | [
"com.heliosapm.endpoint",
"java.util"
] | com.heliosapm.endpoint; java.util; | 2,376,571 |
Collection<CaseInstance> getCaseInstancesByDataItemAndValue(String dataItemName, String dataItemValue, List<CaseStatus> statuses, boolean withData, QueryContext queryContext); | Collection<CaseInstance> getCaseInstancesByDataItemAndValue(String dataItemName, String dataItemValue, List<CaseStatus> statuses, boolean withData, QueryContext queryContext); | /**
* Returns all available active case instances that match given statuses and has case file data item with given name and value
* @param dataItemName name of the case file data item
* @param dataItemValue expected value of the data item
* @param statuses list of statuses that case should be in to ... | Returns all available active case instances that match given statuses and has case file data item with given name and value | getCaseInstancesByDataItemAndValue | {
"repo_name": "droolsjbpm/jbpm",
"path": "jbpm-case-mgmt/jbpm-case-mgmt-api/src/main/java/org/jbpm/casemgmt/api/CaseRuntimeDataService.java",
"license": "apache-2.0",
"size": 19580
} | [
"java.util.Collection",
"java.util.List",
"org.jbpm.casemgmt.api.model.CaseStatus",
"org.jbpm.casemgmt.api.model.instance.CaseInstance",
"org.kie.api.runtime.query.QueryContext"
] | import java.util.Collection; import java.util.List; import org.jbpm.casemgmt.api.model.CaseStatus; import org.jbpm.casemgmt.api.model.instance.CaseInstance; import org.kie.api.runtime.query.QueryContext; | import java.util.*; import org.jbpm.casemgmt.api.model.*; import org.jbpm.casemgmt.api.model.instance.*; import org.kie.api.runtime.query.*; | [
"java.util",
"org.jbpm.casemgmt",
"org.kie.api"
] | java.util; org.jbpm.casemgmt; org.kie.api; | 1,497,194 |
public boolean waitForDialogToOpen() {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForDialogToOpen()");
}
return dialogUtils.waitForDialogToOpen(Timeout.getLargeTimeout(), true);
} | boolean function() { if(config.commandLogging){ Log.d(config.commandLoggingTag, STR); } return dialogUtils.waitForDialogToOpen(Timeout.getLargeTimeout(), true); } | /**
* Waits for a Dialog to open. Default timeout is 20 seconds.
*
* @return {@code true} if the {@link android.app.Dialog} is opened before the timeout and {@code false} if it is not opened
*/ | Waits for a Dialog to open. Default timeout is 20 seconds | waitForDialogToOpen | {
"repo_name": "IfengAutomation/test_agent_android",
"path": "app/src/androidTest/java/com/robotium/solo/Solo.java",
"license": "apache-2.0",
"size": 134036
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 1,675,848 |
public float getSampleFloat(int x, int y, int b,
DataBuffer data) {
float sample =
data.getElemFloat(bankIndices[b],
y*scanlineStride + x*pixelStride +
bandOffsets[b]);
return sample;
}... | float function(int x, int y, int b, DataBuffer data) { float sample = data.getElemFloat(bankIndices[b], y*scanlineStride + x*pixelStride + bandOffsets[b]); return sample; } | /**
* Returns the sample in a specified band
* for the pixel located at (x,y) as a float.
* ArrayIndexOutOfBoundsException may be thrown if the coordinates are
* not in bounds.
* @param x The X coordinate of the pixel location.
* @param y The Y coordinate of the pixel location.
... | Returns the sample in a specified band for the pixel located at (x,y) as a float. ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds | getSampleFloat | {
"repo_name": "ai-ku/langvis",
"path": "src/edu/cmu/cs/stage3/image/codec/ComponentSampleModelJAI.java",
"license": "mit",
"size": 38159
} | [
"java.awt.image.DataBuffer"
] | import java.awt.image.DataBuffer; | import java.awt.image.*; | [
"java.awt"
] | java.awt; | 826,667 |
public static void close(DirContext dirCtx) {
try {
if (dirCtx != null)
dirCtx.close();
} catch (Exception e) {
// ignore the exception
LOG.warn("Error while closing the context", e);
}
} | static void function(DirContext dirCtx) { try { if (dirCtx != null) dirCtx.close(); } catch (Exception e) { LOG.warn(STR, e); } } | /**
* Cose an Ldap directory context.
* @param dirCtx
*/ | Cose an Ldap directory context | close | {
"repo_name": "programmingforliving/sonar-ad-plugin",
"path": "src/main/java/org/pfl/sonar/plugins/ad/ContextUtil.java",
"license": "apache-2.0",
"size": 3884
} | [
"javax.naming.directory.DirContext"
] | import javax.naming.directory.DirContext; | import javax.naming.directory.*; | [
"javax.naming"
] | javax.naming; | 2,135,099 |
private void connect(String host, String username, String password) {
ManagerConnectionFactory factory = new ManagerConnectionFactory(host, username, password);
AsteriskBinding.managerConnection = factory.createManagerConnection();
AsteriskBinding.managerConnection.addEventListener(new Aste... | void function(String host, String username, String password) { ManagerConnectionFactory factory = new ManagerConnectionFactory(host, username, password); AsteriskBinding.managerConnection = factory.createManagerConnection(); AsteriskBinding.managerConnection.addEventListener(new AsteriskEventManager()); try { AsteriskB... | /**
* Connects to <code>host</code> and opens a ManagerConnection by using the
* given <code>username</code> and <code>password</code>. Note: The Asterisk
* ManagerInterface on your Asterisk PBX is deactivated by default. Please
* refer to the documentation how to activate the ManagerInterface (AMI)... | Connects to <code>host</code> and opens a ManagerConnection by using the given <code>username</code> and <code>password</code>. Note: The Asterisk ManagerInterface on your Asterisk PBX is deactivated by default. Please refer to the documentation how to activate the ManagerInterface (AMI) | connect | {
"repo_name": "swatchy2dot0/openhab",
"path": "bundles/binding/org.openhab.binding.asterisk/src/main/java/org/openhab/binding/asterisk/internal/AsteriskBinding.java",
"license": "epl-1.0",
"size": 8995
} | [
"java.io.IOException",
"org.asteriskjava.manager.AuthenticationFailedException",
"org.asteriskjava.manager.ManagerConnectionFactory",
"org.asteriskjava.manager.action.StatusAction"
] | import java.io.IOException; import org.asteriskjava.manager.AuthenticationFailedException; import org.asteriskjava.manager.ManagerConnectionFactory; import org.asteriskjava.manager.action.StatusAction; | import java.io.*; import org.asteriskjava.manager.*; import org.asteriskjava.manager.action.*; | [
"java.io",
"org.asteriskjava.manager"
] | java.io; org.asteriskjava.manager; | 1,517,844 |
public Set<Long> getAll(String docname, boolean withunactive); | Set<Long> function(String docname, boolean withunactive); | /**
* Gets the all.
*
* @param docname
* the docname
* @return the all
*/ | Gets the all | getAll | {
"repo_name": "alexript/balas",
"path": "src/net/autosauler/ballance/client/DocumentService.java",
"license": "apache-2.0",
"size": 3675
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,056,346 |
protected String InputStreamToString(InputStream in) {
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(in, IConstants.UTF8_ENCODING));
} catch (UnsupportedEncodingException e1) {
LogUtil.logError(Activator.PLUGIN_ID, e1);
... | String function(InputStream in) { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(in, IConstants.UTF8_ENCODING)); } catch (UnsupportedEncodingException e1) { LogUtil.logError(Activator.PLUGIN_ID, e1); } catch (IllegalArgumentException e) { LogUtil.logError(Activator.PLUGIN_ID, e); ... | /**
* reads the current value from an input stream
*
* @param in the input stream
*/ | reads the current value from an input stream | InputStreamToString | {
"repo_name": "jcryptool/crypto",
"path": "org.jcryptool.analysis.fleissner/src/org/jcryptool/analysis/fleissner/UI/LoadFiles.java",
"license": "epl-1.0",
"size": 8315
} | [
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStream",
"java.io.InputStreamReader",
"java.io.UnsupportedEncodingException",
"org.jcryptool.analysis.fleissner.Activator",
"org.jcryptool.core.logging.utils.LogUtil",
"org.jcryptool.core.util.constants.IConstants"
] | import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import org.jcryptool.analysis.fleissner.Activator; import org.jcryptool.core.logging.utils.LogUtil; import org.jcryptool.core.util.constants.IConstants; | import java.io.*; import org.jcryptool.analysis.fleissner.*; import org.jcryptool.core.logging.utils.*; import org.jcryptool.core.util.constants.*; | [
"java.io",
"org.jcryptool.analysis",
"org.jcryptool.core"
] | java.io; org.jcryptool.analysis; org.jcryptool.core; | 997,096 |
void setBlockState(int x, int y, int z, IBlockState state); | void setBlockState(int x, int y, int z, IBlockState state); | /**
* Sets a block state at the given location
*
* @param x cube local x
* @param y cube local y
* @param z cube local z
* @param state the block state
*/ | Sets a block state at the given location | setBlockState | {
"repo_name": "Cyclonit/CubicChunks",
"path": "src/main/java/cubicchunks/worldgen/generator/ICubePrimer.java",
"license": "mit",
"size": 2370
} | [
"net.minecraft.block.state.IBlockState"
] | import net.minecraft.block.state.IBlockState; | import net.minecraft.block.state.*; | [
"net.minecraft.block"
] | net.minecraft.block; | 1,834,286 |
@Test
public void testHighlightUnloaded() {
final String testSource = "test";
services.highlight(testSource);
verifyZeroInteractions(loaded);
verify(unloaded).highlight(testSource);
} | void function() { final String testSource = "test"; services.highlight(testSource); verifyZeroInteractions(loaded); verify(unloaded).highlight(testSource); } | /**
* Tests the strategy delegation of
* {@link IEditorServices#highlight(String)} to the unloaded strategy.
*/ | Tests the strategy delegation of <code>IEditorServices#highlight(String)</code> to the unloaded strategy | testHighlightUnloaded | {
"repo_name": "spoofax-shell-2017/spoofax-shell",
"path": "org.metaborg.spoofax.shell.core/src/test/java/org/metaborg/spoofax/shell/services/SpoofaxEditorServicesTest.java",
"license": "apache-2.0",
"size": 3352
} | [
"org.mockito.Mockito"
] | import org.mockito.Mockito; | import org.mockito.*; | [
"org.mockito"
] | org.mockito; | 1,687,552 |
private static Map<String, Object> getBeans(final ApplicationContext ctx) {
final String[] all = BeanFactoryUtils.beanNamesIncludingAncestors(ctx);
final Map<String, Object> singletons = new HashMap<>(all.length);
for (final String name : all) {
try {
final Objec... | static Map<String, Object> function(final ApplicationContext ctx) { final String[] all = BeanFactoryUtils.beanNamesIncludingAncestors(ctx); final Map<String, Object> singletons = new HashMap<>(all.length); for (final String name : all) { try { final Object object = ctx.getBean(name); if (object != null) { boolean found... | /**
* Gets beans in the application context.
*
* @param ctx the ctx
* @return the beans
*/ | Gets beans in the application context | getBeans | {
"repo_name": "jasonchw/cas",
"path": "cas-server-webapp-support/src/main/java/org/jasig/cas/web/report/InternalConfigStateController.java",
"license": "apache-2.0",
"size": 10021
} | [
"java.util.HashMap",
"java.util.Map",
"org.springframework.beans.factory.BeanFactoryUtils",
"org.springframework.beans.factory.BeanIsAbstractException",
"org.springframework.context.ApplicationContext"
] | import java.util.HashMap; import java.util.Map; import org.springframework.beans.factory.BeanFactoryUtils; import org.springframework.beans.factory.BeanIsAbstractException; import org.springframework.context.ApplicationContext; | import java.util.*; import org.springframework.beans.factory.*; import org.springframework.context.*; | [
"java.util",
"org.springframework.beans",
"org.springframework.context"
] | java.util; org.springframework.beans; org.springframework.context; | 2,864,128 |
public static long readVLOld(DataInput in) throws IOException {
byte code = in.readByte();
long result;
if (code < 0) {
// mask off sign bit
result = code & 0x7F;
result <<= 8;
result |= in.readByte() & 0xFF;
} else if (code <= StaticSerialization.MAX_BYTE_VL) {
result = ... | static long function(DataInput in) throws IOException { byte code = in.readByte(); long result; if (code < 0) { result = code & 0x7F; result <<= 8; result = in.readByte() & 0xFF; } else if (code <= StaticSerialization.MAX_BYTE_VL) { result = code; } else if (code == StaticSerialization.INT_VL) { result = in.readInt(); ... | /**
* Write a variable length long the old way (pre 7.0). Use this only in contexts where you might
* need to communicate with pre 7.0 members or files.
*/ | Write a variable length long the old way (pre 7.0). Use this only in contexts where you might need to communicate with pre 7.0 members or files | readVLOld | {
"repo_name": "masaki-yamakawa/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/InternalDataSerializer.java",
"license": "apache-2.0",
"size": 132544
} | [
"java.io.DataInput",
"java.io.IOException",
"org.apache.geode.internal.serialization.StaticSerialization"
] | import java.io.DataInput; import java.io.IOException; import org.apache.geode.internal.serialization.StaticSerialization; | import java.io.*; import org.apache.geode.internal.serialization.*; | [
"java.io",
"org.apache.geode"
] | java.io; org.apache.geode; | 2,852,586 |
public short[] getCoords()
{
short x = (short) Math.round( (getX() * 256) / ColHandle.COL_UNITS_TO_PIXELS );
short y = (short) Math.round( (getY() * 20) / (RowHandle.ROW_HEIGHT_DIVISOR - 4) ); /
return new short[]{ x, y, w, h };
} | short[] function() { short x = (short) Math.round( (getX() * 256) / ColHandle.COL_UNITS_TO_PIXELS ); short y = (short) Math.round( (getY() * 20) / (RowHandle.ROW_HEIGHT_DIVISOR - 4) ); / return new short[]{ x, y, w, h }; } | /**
* return coordinates as {X, Y, W, H} in pixels
*
* @param coords
*/ | return coordinates as {X, Y, W, H} in pixels | getCoords | {
"repo_name": "Maxels88/openxls",
"path": "src/main/java/org/openxls/formats/XLS/MSODrawing.java",
"license": "gpl-3.0",
"size": 94219
} | [
"org.openxls.ExtenXLS"
] | import org.openxls.ExtenXLS; | import org.openxls.*; | [
"org.openxls"
] | org.openxls; | 532,523 |
public void update(String email, String secret, String oldEmail,
OtpType type, Integer counter, Boolean googleAccount) {
ContentValues values = new ContentValues();
values.put(EMAIL_COLUMN, email);
values.put(SECRET_COLUMN, secret);
values.put(TYPE_COLUMN, type.ordinal());
values.put(COUNTER... | void function(String email, String secret, String oldEmail, OtpType type, Integer counter, Boolean googleAccount) { ContentValues values = new ContentValues(); values.put(EMAIL_COLUMN, email); values.put(SECRET_COLUMN, secret); values.put(TYPE_COLUMN, type.ordinal()); values.put(COUNTER_COLUMN, counter); if (googleAcco... | /**
* Save key to database, creating a new user entry if necessary.
* @param email the user email address. When editing, the new user email.
* @param secret the secret key.
* @param oldEmail If editing, the original user email, otherwise null.
* @param type hotp vs totp
* @param counter only important... | Save key to database, creating a new user entry if necessary | update | {
"repo_name": "ocdtrekkie/authenticator",
"path": "app/src/main/java/com/sandstormbox/authenticator/AccountDb.java",
"license": "apache-2.0",
"size": 14264
} | [
"android.content.ContentValues"
] | import android.content.ContentValues; | import android.content.*; | [
"android.content"
] | android.content; | 52,100 |
public void removeNetwork(OVXNetwork network); | void function(OVXNetwork network); | /**
* Deletes the OVXNetwork object.
*
* @param network
* network This is object representing the virtual network
*/ | Deletes the OVXNetwork object | removeNetwork | {
"repo_name": "Gyeong-Sik/vsdn_monitoring",
"path": "src/main/java/net/onrc/openvirtex/elements/Mappable.java",
"license": "apache-2.0",
"size": 12071
} | [
"net.onrc.openvirtex.elements.network.OVXNetwork"
] | import net.onrc.openvirtex.elements.network.OVXNetwork; | import net.onrc.openvirtex.elements.network.*; | [
"net.onrc.openvirtex"
] | net.onrc.openvirtex; | 2,628,084 |
public static String getFormat(File file) {
return getFormat(file.getAbsolutePath());
}
| static String function(File file) { return getFormat(file.getAbsolutePath()); } | /**
* Returns the file format without a dot (f.e. "pdf") or "" if there is no format
*
* @param file
* @return
*/ | Returns the file format without a dot (f.e. "pdf") or "" if there is no format | getFormat | {
"repo_name": "du-lab/mzmine2",
"path": "src/main/java/net/sf/mzmine/util/files/FileAndPathUtil.java",
"license": "gpl-2.0",
"size": 13773
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 339,625 |
void addAllValues(List<E> values); | void addAllValues(List<E> values); | /**
* Adds the given values to the {@link List} of values
*
* @param values
* the values to add
*/ | Adds the given values to the <code>List</code> of values | addAllValues | {
"repo_name": "4treesCH/strolch",
"path": "li.strolch.model/src/main/java/li/strolch/model/parameter/ListParameter.java",
"license": "apache-2.0",
"size": 3446
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,154,413 |
List<HoldingReproduction> list(CriteriaQuery<HoldingReproduction> q, int firstResult, int maxResults); | List<HoldingReproduction> list(CriteriaQuery<HoldingReproduction> q, int firstResult, int maxResults); | /**
* List all HoldingReproductions matching a built query.
*
* @param q The criteria query to execute
* @param firstResult The first result to obtain
* @param maxResults The max number of results to obtain
* @return A list of matching HoldingReproductions.
*/ | List all HoldingReproductions matching a built query | list | {
"repo_name": "IISH/delivery",
"path": "src/main/java/org/socialhistoryservices/delivery/reproduction/dao/HoldingReproductionDAO.java",
"license": "gpl-3.0",
"size": 1705
} | [
"java.util.List",
"javax.persistence.criteria.CriteriaQuery",
"org.socialhistoryservices.delivery.reproduction.entity.HoldingReproduction"
] | import java.util.List; import javax.persistence.criteria.CriteriaQuery; import org.socialhistoryservices.delivery.reproduction.entity.HoldingReproduction; | import java.util.*; import javax.persistence.criteria.*; import org.socialhistoryservices.delivery.reproduction.entity.*; | [
"java.util",
"javax.persistence",
"org.socialhistoryservices.delivery"
] | java.util; javax.persistence; org.socialhistoryservices.delivery; | 1,273,562 |
public void setJmsConnector(JmsConnector jmsConnector) {
this._jmsConnector = jmsConnector;
} | void function(JmsConnector jmsConnector) { this._jmsConnector = jmsConnector; } | /**
* Sets the JMS connector.
* @param jmsConnector the new value of the property
*/ | Sets the JMS connector | setJmsConnector | {
"repo_name": "McLeodMoores/starling",
"path": "projects/component/src/main/java/com/opengamma/component/factory/source/RemoteSourcesComponentFactory.java",
"license": "apache-2.0",
"size": 12504
} | [
"com.opengamma.util.jms.JmsConnector"
] | import com.opengamma.util.jms.JmsConnector; | import com.opengamma.util.jms.*; | [
"com.opengamma.util"
] | com.opengamma.util; | 2,499,959 |
private void assertEqualMatrices(Matrix expected, Matrix actual) {
try {
MatrixBlock expectedMB = expected.toMatrixObject().acquireRead();
MatrixBlock actualMB = actual.toMatrixObject().acquireRead();
long rows = expectedMB.getNumRows();
long cols = expectedMB.getNumColumns();
Assert.assertEquals(r... | void function(Matrix expected, Matrix actual) { try { MatrixBlock expectedMB = expected.toMatrixObject().acquireRead(); MatrixBlock actualMB = actual.toMatrixObject().acquireRead(); long rows = expectedMB.getNumRows(); long cols = expectedMB.getNumColumns(); Assert.assertEquals(rows, actualMB.getNumRows()); Assert.asse... | /**
* Asserts that the values in two matrices are in {@link UnaryOpTests#THRESHOLD} of each other
*
* @param expected expected matrix
* @param actual actual matrix
*/ | Asserts that the values in two matrices are in <code>UnaryOpTests#THRESHOLD</code> of each other | assertEqualMatrices | {
"repo_name": "iyounus/incubator-systemml",
"path": "src/test/java/org/apache/sysml/test/gpu/GPUTests.java",
"license": "apache-2.0",
"size": 8935
} | [
"org.apache.sysml.api.mlcontext.Matrix",
"org.apache.sysml.runtime.DMLRuntimeException",
"org.apache.sysml.runtime.matrix.data.MatrixBlock",
"org.junit.Assert"
] | import org.apache.sysml.api.mlcontext.Matrix; import org.apache.sysml.runtime.DMLRuntimeException; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.junit.Assert; | import org.apache.sysml.api.mlcontext.*; import org.apache.sysml.runtime.*; import org.apache.sysml.runtime.matrix.data.*; import org.junit.*; | [
"org.apache.sysml",
"org.junit"
] | org.apache.sysml; org.junit; | 2,884,240 |
public void evaluateTransition(final Rule fromRule, final Attribute attribute,
final Target toTarget, TransitionApplier transitionApplier) {
// Fantastic configurations and where to find them:
// I. Input files and package groups have no configurations. We don't want to duplicate them.
if (usesNull... | void function(final Rule fromRule, final Attribute attribute, final Target toTarget, TransitionApplier transitionApplier) { if (usesNullConfiguration(toTarget)) { transitionApplier.applyTransition(Attribute.ConfigurationTransition.NULL); return; } if (isHostConfiguration()) { transitionApplier.applyTransition(Attribute... | /**
* Calculates the configurations of a direct dependency. If a rule in some BUILD file refers
* to a target (like another rule or a source file) using a label attribute, that target needs
* to have a configuration, too. This method figures out the proper configuration for the
* dependency.
*
* @para... | Calculates the configurations of a direct dependency. If a rule in some BUILD file refers to a target (like another rule or a source file) using a label attribute, that target needs to have a configuration, too. This method figures out the proper configuration for the dependency | evaluateTransition | {
"repo_name": "mbrukman/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java",
"license": "apache-2.0",
"size": 96626
} | [
"com.google.devtools.build.lib.packages.Attribute",
"com.google.devtools.build.lib.packages.Rule",
"com.google.devtools.build.lib.packages.Target",
"com.google.devtools.build.lib.util.Preconditions"
] | import com.google.devtools.build.lib.packages.Attribute; import com.google.devtools.build.lib.packages.Rule; import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.util.Preconditions; | import com.google.devtools.build.lib.packages.*; import com.google.devtools.build.lib.util.*; | [
"com.google.devtools"
] | com.google.devtools; | 938,269 |
public void setArgs(Map<String, Object> args) {
this.args = args;
} | void function(Map<String, Object> args) { this.args = args; } | /**
* Specify arguments for configuring the different RabbitMQ concepts, a
* different prefix is required for each:
* <ul>
* <li>Exchange: arg.exchange.</li>
* <li>Queue: arg.queue.</li>
* <li>Binding: arg.binding.</li>
* </ul>
* For example to declare a queue with message ttl ar... | Specify arguments for configuring the different RabbitMQ concepts, a different prefix is required for each: Exchange: arg.exchange. Queue: arg.queue. Binding: arg.binding. For example to declare a queue with message ttl argument: HREF | setArgs | {
"repo_name": "objectiser/camel",
"path": "components/camel-rabbitmq/src/main/java/org/apache/camel/component/rabbitmq/RabbitMQEndpoint.java",
"license": "apache-2.0",
"size": 30112
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,601,587 |
synchronized int list(int msg) throws IOException {
Response r = simpleCommand("LIST " + msg);
int size = -1;
if (r.ok && r.data != null) {
try {
StringTokenizer st = new StringTokenizer(r.data);
st.nextToken(); // skip message number
size = Integer.parseInt(st.nextToken());
} catch (Exception... | synchronized int list(int msg) throws IOException { Response r = simpleCommand(STR + msg); int size = -1; if (r.ok && r.data != null) { try { StringTokenizer st = new StringTokenizer(r.data); st.nextToken(); size = Integer.parseInt(st.nextToken()); } catch (Exception e) { } } return size; } | /**
* Return the size of the message using the LIST command.
*/ | Return the size of the message using the LIST command | list | {
"repo_name": "arthurzaczek/kolab-android",
"path": "javamail/com/sun/mail/pop3/Protocol.java",
"license": "gpl-3.0",
"size": 13521
} | [
"java.io.IOException",
"java.util.StringTokenizer"
] | import java.io.IOException; import java.util.StringTokenizer; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,555,867 |
List<MapData> getChildrenData(); | List<MapData> getChildrenData(); | /**
* Get the children aggregated data if any.
*
* @return the list of aggregated data
*/ | Get the children aggregated data if any | getChildrenData | {
"repo_name": "PtitNoony/FxTreeMap",
"path": "src/main/java/com/github/ptitnoony/components/fxtreemap/MapData.java",
"license": "mit",
"size": 3281
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,284,099 |
boolean dispatchSetRepeatMode(Player player, @Player.RepeatMode int repeatMode);
}
public static final ControlDispatcher DEFAULT_CONTROL_DISPATCHER = new ControlDispatcher() { | boolean dispatchSetRepeatMode(Player player, @Player.RepeatMode int repeatMode); } public static final ControlDispatcher DEFAULT_CONTROL_DISPATCHER = new ControlDispatcher() { | /**
* Dispatches a {@link Player#setRepeatMode(int)} operation.
*
* @param player The {@link Player} to which the operation should be dispatched.
* @param repeatMode The repeat mode.
* @return True if the operation was dispatched. False if suppressed.
*/ | Dispatches a <code>Player#setRepeatMode(int)</code> operation | dispatchSetRepeatMode | {
"repo_name": "Zooc/AnDevHelper",
"path": "app/src/main/java/an/devhp/widget/PlayCtrlView.java",
"license": "apache-2.0",
"size": 37498
} | [
"com.google.android.exoplayer2.Player"
] | import com.google.android.exoplayer2.Player; | import com.google.android.exoplayer2.*; | [
"com.google.android"
] | com.google.android; | 745,446 |
public static void sendPlayerToServer(String player, String server) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("ConnectOther");
out.writeUTF(player);
out.writeUTF(server);
PluginMessager.getInstance().sendPluginMessage(null, "BungeeCord", out.toByteArray());
}
| static void function(String player, String server) { ByteArrayDataOutput out = ByteStreams.newDataOutput(); out.writeUTF(STR); out.writeUTF(player); out.writeUTF(server); PluginMessager.getInstance().sendPluginMessage(null, STR, out.toByteArray()); } | /**
* Sends a specified player to a specified server
* @param player The name of the player you wish to send
* @param server The name of the server you wish to send them to
*/ | Sends a specified player to a specified server | sendPlayerToServer | {
"repo_name": "LightCraftNetwork/FuseboxV2",
"path": "src/mc/lightcraft/java/remote/BungeeCord/BungeeCordAPI.java",
"license": "mit",
"size": 3147
} | [
"com.google.common.io.ByteArrayDataOutput",
"com.google.common.io.ByteStreams"
] | import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; | import com.google.common.io.*; | [
"com.google.common"
] | com.google.common; | 809,476 |
//This function is called to load in the CSV data that it uses
//to generate random data
public void PrepareGenerator(){
CSVReader CSVCustom = null;
try{
//If the database was previously prepared, don't load the data;
//This reads the CSV file line by line a parses it.
CSVCustom = new CSVReader(csvFi... | void function(){ CSVReader CSVCustom = null; try{ CSVCustom = new CSVReader(csvFile); String[] Tuple; s = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); try{ s.execute(STR + this.temp_table); }catch(Throwable R){ } try{ s.execute(STR + table_prefix); }catch(Throwable R){ } s.execute(... | /**
* This is used to prepare the generator, creating required tables in the database, loading required
* data into memory, and handling any other dependencies.
*/ | This is used to prepare the generator, creating required tables in the database, loading required data into memory, and handling any other dependencies | PrepareGenerator | {
"repo_name": "wildbillcat/ProjectGenerator",
"path": "src/datagenerator/generators/CustomGenerator.java",
"license": "apache-2.0",
"size": 6918
} | [
"java.sql.ResultSet"
] | import java.sql.ResultSet; | import java.sql.*; | [
"java.sql"
] | java.sql; | 740,994 |
public static String getUrlParams(CMnQueryData data) {
StringBuffer url = new StringBuffer();
if (data.getHostname() != null) {
url.append(HOSTNAME_LABEL + "=" + data.getHostname());
}
if (data.getPort() != null) {
if (url.length() > 0) url.append("&");
... | static String function(CMnQueryData data) { StringBuffer url = new StringBuffer(); if (data.getHostname() != null) { url.append(HOSTNAME_LABEL + "=" + data.getHostname()); } if (data.getPort() != null) { if (url.length() > 0) url.append("&"); url.append(PORT_LABEL + "=" + data.getPort()); } if (data.getUsername() != nu... | /**
* Construct a URL from the form values.
*
* @return URL composed of the form values
*/ | Construct a URL from the form values | getUrlParams | {
"repo_name": "ModelN/build-management",
"path": "mn-build-webapp/src/main/java/com/modeln/build/ctrl/forms/CMnDatabaseQueryForm.java",
"license": "mit",
"size": 13427
} | [
"com.modeln.build.common.data.database.CMnQueryData"
] | import com.modeln.build.common.data.database.CMnQueryData; | import com.modeln.build.common.data.database.*; | [
"com.modeln.build"
] | com.modeln.build; | 2,743,412 |
protected static void processPrimaryKeys(String databaseName, String tableName,
ASTNode child, List<SQLPrimaryKey> primaryKeys) throws SemanticException {
List<ConstraintInfo> primaryKeyInfos = new ArrayList<ConstraintInfo>();
generateConstraintInfos(child, primaryKeyInfos);
constraintInfosToPrimary... | static void function(String databaseName, String tableName, ASTNode child, List<SQLPrimaryKey> primaryKeys) throws SemanticException { List<ConstraintInfo> primaryKeyInfos = new ArrayList<ConstraintInfo>(); generateConstraintInfos(child, primaryKeyInfos); constraintInfosToPrimaryKeys(databaseName, tableName, primaryKey... | /**
* Process the primary keys from the ast node and populate the SQLPrimaryKey list.
*/ | Process the primary keys from the ast node and populate the SQLPrimaryKey list | processPrimaryKeys | {
"repo_name": "b-slim/hive",
"path": "ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java",
"license": "apache-2.0",
"size": 91275
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.hive.metastore.api.SQLPrimaryKey"
] | import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hive.metastore.api.SQLPrimaryKey; | import java.util.*; import org.apache.hadoop.hive.metastore.api.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 2,603,139 |
public void remove(BluetoothDevice device) {
String address = device.getAddress();
remove(address);
} | void function(BluetoothDevice device) { String address = device.getAddress(); remove(address); } | /**
* Remove ScanResult associated with the device from the adapter.
*
* @param device The device to remove from the adapter.
*/ | Remove ScanResult associated with the device from the adapter | remove | {
"repo_name": "roywant/uribeacon",
"path": "android-uribeacon/uribeacon-library/src/main/java/org/uribeacon/widget/ScanResultAdapter.java",
"license": "apache-2.0",
"size": 6881
} | [
"android.bluetooth.BluetoothDevice"
] | import android.bluetooth.BluetoothDevice; | import android.bluetooth.*; | [
"android.bluetooth"
] | android.bluetooth; | 2,637,533 |
@Override
public List<Long> copyFeatures( int userId, int collabRoomId){
//dynamically get the list of columns to avoid hard-coding them all
QueryModel selectColumnsQuery = QueryManager.createQuery("information_schema.columns")
.selectFromTable("column_name")
.where().equals("table_name", S... | List<Long> function( int userId, int collabRoomId){ QueryModel selectColumnsQuery = QueryManager.createQuery(STR) .selectFromTable(STR) .where().equals(STR, SADisplayConstants.FEATURE_TABLE) .and().notEqual(STR, SADisplayConstants.FEATURE_ID.toLowerCase()); List<String> columns = this.template.queryForList(selectColumn... | /**
* Copy all of the specified user's userfeatures to a given collabroom
*
* We duplicate all the user's features and add a collabroom feature for each.
*
* @param userId The id of the user whose userfeatures to copy
* @param collabRoomId The id of the collabroom to copy to
*/ | Copy all of the specified user's userfeatures to a given collabroom We duplicate all the user's features and add a collabroom feature for each | copyFeatures | {
"repo_name": "hadrsystems/nics-common",
"path": "nics-dao/src/main/java/edu/mit/ll/nics/nicsdao/impl/FeatureDAOImpl.java",
"license": "bsd-3-clause",
"size": 21216
} | [
"edu.mit.ll.dao.QueryModel",
"edu.mit.ll.nics.common.constants.SADisplayConstants",
"edu.mit.ll.nics.nicsdao.QueryManager",
"java.util.Arrays",
"java.util.List"
] | import edu.mit.ll.dao.QueryModel; import edu.mit.ll.nics.common.constants.SADisplayConstants; import edu.mit.ll.nics.nicsdao.QueryManager; import java.util.Arrays; import java.util.List; | import edu.mit.ll.dao.*; import edu.mit.ll.nics.common.constants.*; import edu.mit.ll.nics.nicsdao.*; import java.util.*; | [
"edu.mit.ll",
"java.util"
] | edu.mit.ll; java.util; | 273,929 |
public Map<String, Object> getMitabOptions(InteractionCategory objectCategory, psidev.psi.mi.jami.model.ComplexType complexType,
boolean streaming, MIFileParserListener listener, Object input){
return getOptions(MIFileType.mitab, objectCategory, complexType, st... | Map<String, Object> function(InteractionCategory objectCategory, psidev.psi.mi.jami.model.ComplexType complexType, boolean streaming, MIFileParserListener listener, Object input){ return getOptions(MIFileType.mitab, objectCategory, complexType, streaming, listener, input); } | /**
* Create the options for the MITAB datasource.
*
* @param objectCategory : interaction object type to load
* @param complexType: the kind of complex : n-ary or binary
* @param streaming : true if we want to load interactions in a streaming way
* @param listener : the listener to use fo... | Create the options for the MITAB datasource | getMitabOptions | {
"repo_name": "MICommunity/psi-jami",
"path": "jami-commons/src/main/java/psidev/psi/mi/jami/commons/MIDataSourceOptionFactory.java",
"license": "apache-2.0",
"size": 14278
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 300,113 |
private void initMap() {
mapThread = new Thread(new InitialiseMapRunnable());
if (EventQueue.isDispatchThread()) {
mapThread.start();
} else {
EventQueue.invokeLater(mapThread);
}
revalidate();
repaint();
} | void function() { mapThread = new Thread(new InitialiseMapRunnable()); if (EventQueue.isDispatchThread()) { mapThread.start(); } else { EventQueue.invokeLater(mapThread); } revalidate(); repaint(); } | /**
* DOCUMENT ME!
*/ | DOCUMENT ME | initMap | {
"repo_name": "cismet/cids-custom-wuppertal",
"path": "src/main/java/de/cismet/cids/custom/objectrenderer/wunda_blau/AlkisLandparcelAggregationRenderer.java",
"license": "lgpl-3.0",
"size": 49974
} | [
"java.awt.EventQueue"
] | import java.awt.EventQueue; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,152,065 |
private String handleSingleLogout(HttpServletRequest request, HttpServletResponse response) {
log.info("OpenID Single Logout for " + request.getSession().getAttribute("authenticatedOpenID"));
// removing the authenticated user from the session
request.getSession().setAttribute("authenticat... | String function(HttpServletRequest request, HttpServletResponse response) { log.info(STR + request.getSession().getAttribute(STR)); request.getSession().setAttribute(STR, null); Cookie[] cookies = request.getCookies(); if (cookies != null) { Cookie curCookie = null; for (int x = 0; x < cookies.length; x++) { curCookie ... | /**
* This method handles single logout requests.
* Basically we are invalidating the session data and cookies.
*
* @param request
* @param response
* @return
*/ | This method handles single logout requests. Basically we are invalidating the session data and cookies | handleSingleLogout | {
"repo_name": "ChamaraPhilipsuom/carbon-identity",
"path": "components/openid/org.wso2.carbon.identity.provider/src/main/java/org/wso2/carbon/identity/provider/openid/handlers/OpenIDHandler.java",
"license": "apache-2.0",
"size": 33003
} | [
"javax.servlet.http.Cookie",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.*; | [
"javax.servlet"
] | javax.servlet; | 1,239,870 |
FieldRef getCurrentRenderee() {
FieldRef local = currentRendereeField;
if (local == null) {
local =
currentRendereeField =
FieldRef.createField(owner, CURRENT_RENDEREE_FIELD, SoyValueProvider.class);
}
return local;
} | FieldRef getCurrentRenderee() { FieldRef local = currentRendereeField; if (local == null) { local = currentRendereeField = FieldRef.createField(owner, CURRENT_RENDEREE_FIELD, SoyValueProvider.class); } return local; } | /**
* Returns the field that holds the currently rendering SoyValueProvider.
*
* <p>Unlike normal variables the VariableSet doesn't maintain responsibility for saving and
* restoring the current renderee to a local.
*/ | Returns the field that holds the currently rendering SoyValueProvider. Unlike normal variables the VariableSet doesn't maintain responsibility for saving and restoring the current renderee to a local | getCurrentRenderee | {
"repo_name": "Medium/closure-templates",
"path": "java/src/com/google/template/soy/jbcsrc/TemplateVariableManager.java",
"license": "apache-2.0",
"size": 24360
} | [
"com.google.template.soy.data.SoyValueProvider",
"com.google.template.soy.jbcsrc.restricted.FieldRef"
] | import com.google.template.soy.data.SoyValueProvider; import com.google.template.soy.jbcsrc.restricted.FieldRef; | import com.google.template.soy.data.*; import com.google.template.soy.jbcsrc.restricted.*; | [
"com.google.template"
] | com.google.template; | 498,744 |
private void handleCancelTicket(Event e) throws InsufficientInformationException {
EventUtils.requireParm(e, EventConstants.PARM_ALARM_ID);
EventUtils.requireParm(e, EventConstants.PARM_ALARM_UEI);
EventUtils.requireParm(e, EventConstants.PARM_USER);
EventUtils.requireParm(e, EventCon... | void function(Event e) throws InsufficientInformationException { EventUtils.requireParm(e, EventConstants.PARM_ALARM_ID); EventUtils.requireParm(e, EventConstants.PARM_ALARM_UEI); EventUtils.requireParm(e, EventConstants.PARM_USER); EventUtils.requireParm(e, EventConstants.PARM_TROUBLE_TICKET); int alarmId = EventUtils... | /**
* Makes call to API to Cancel a Trouble Ticket associated with an OnmsAlarm.
* @param e
* @throws InsufficientInformationException
*/ | Makes call to API to Cancel a Trouble Ticket associated with an OnmsAlarm | handleCancelTicket | {
"repo_name": "rdkgit/opennms",
"path": "opennms-services/src/main/java/org/opennms/netmgt/ticketd/TroubleTicketer.java",
"license": "agpl-3.0",
"size": 9701
} | [
"org.opennms.netmgt.capsd.EventUtils",
"org.opennms.netmgt.capsd.InsufficientInformationException",
"org.opennms.netmgt.events.api.EventConstants",
"org.opennms.netmgt.xml.event.Event"
] | import org.opennms.netmgt.capsd.EventUtils; import org.opennms.netmgt.capsd.InsufficientInformationException; import org.opennms.netmgt.events.api.EventConstants; import org.opennms.netmgt.xml.event.Event; | import org.opennms.netmgt.capsd.*; import org.opennms.netmgt.events.api.*; import org.opennms.netmgt.xml.event.*; | [
"org.opennms.netmgt"
] | org.opennms.netmgt; | 1,763,538 |
public DateFormat getDateFormat() {
return dateFormat;
} | DateFormat function() { return dateFormat; } | /**
* Get the date format used to parse/format date parameters.
* @return Date format
*/ | Get the date format used to parse/format date parameters | getDateFormat | {
"repo_name": "knetikmedia/knetikcloud-java-client",
"path": "src/main/java/com/knetikcloud/client/ApiClient.java",
"license": "apache-2.0",
"size": 24898
} | [
"java.text.DateFormat"
] | import java.text.DateFormat; | import java.text.*; | [
"java.text"
] | java.text; | 847,884 |
public View.OnClickListener getButtonClickListener() {
return mButtonClickListener;
} | View.OnClickListener function() { return mButtonClickListener; } | /**
* Returns the button click listener.
*/ | Returns the button click listener | getButtonClickListener | {
"repo_name": "kingargyle/adt-leanback-support",
"path": "leanback-v17/src/main/java/android/support/v17/leanback/app/ErrorSupportFragment.java",
"license": "apache-2.0",
"size": 8936
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 1,697,018 |
OnDiskBuildInfo createOnDiskBuildInfoFor(BuildTarget target) {
return new OnDiskBuildInfo(target, projectFilesystem);
} | OnDiskBuildInfo createOnDiskBuildInfoFor(BuildTarget target) { return new OnDiskBuildInfo(target, projectFilesystem); } | /**
* Creates an {@link OnDiskBuildInfo}.
* <p>
* This method should be visible to {@link AbstractCachingBuildRule}, but not {@link Buildable}s
* in general.
*/ | Creates an <code>OnDiskBuildInfo</code>. This method should be visible to <code>AbstractCachingBuildRule</code>, but not <code>Buildable</code>s in general | createOnDiskBuildInfoFor | {
"repo_name": "denizt/buck",
"path": "src/com/facebook/buck/rules/BuildContext.java",
"license": "apache-2.0",
"size": 9168
} | [
"com.facebook.buck.model.BuildTarget"
] | import com.facebook.buck.model.BuildTarget; | import com.facebook.buck.model.*; | [
"com.facebook.buck"
] | com.facebook.buck; | 2,330,463 |
public Image image
(InputStream in)
throws IOException
{
readImageContents (in);
getBufferedImage();
return this;
} | Image function (InputStream in) throws IOException { readImageContents (in); getBufferedImage(); return this; } | /**
* Read this image item's image from the given input stream. The entire
* input stream is read until EOF is encountered, then the input stream is
* closed.
*
* @param in Input stream.
*
* @return This image item.
*
* @exception IOException
* Thrown if an I/O error occurred.
*/ | Read this image item's image from the given input stream. The entire input stream is read until EOF is encountered, then the input stream is closed | image | {
"repo_name": "JimiHFord/pj2",
"path": "lib/edu/rit/draw/item/Image.java",
"license": "lgpl-3.0",
"size": 20880
} | [
"java.io.IOException",
"java.io.InputStream"
] | import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,520,819 |
HFileContext getFileContext();
}
public static class WriterFactory {
protected final Configuration conf;
protected final CacheConfig cacheConf;
protected FileSystem fs;
protected Path path;
protected FSDataOutputStream ostream;
protected InetSocketAddress[] favoredNodes;
private ... | HFileContext getFileContext(); } public static class WriterFactory { protected final Configuration conf; protected final CacheConfig cacheConf; protected FileSystem fs; protected Path path; protected FSDataOutputStream ostream; protected InetSocketAddress[] favoredNodes; private HFileContext fileContext; protected bool... | /**
* Return the file context for the HFile this writer belongs to
*/ | Return the file context for the HFile this writer belongs to | getFileContext | {
"repo_name": "HubSpot/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java",
"license": "apache-2.0",
"size": 26448
} | [
"java.net.InetSocketAddress",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FSDataOutputStream",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path"
] | import java.net.InetSocketAddress; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; | import java.net.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; | [
"java.net",
"org.apache.hadoop"
] | java.net; org.apache.hadoop; | 1,077,762 |
public Vector updatePosition() {
long timeElapsed = Calendar.getInstance().getTimeInMillis() - lastMove;
if(isMoving()) {
if(timeElapsed < time) {
//Usuario se esta moviendo, devuelve position
isMoving(true);
timeRemaining = time - timeElapsed;
Vector flyPosition = new Vector(oldP... | Vector function() { long timeElapsed = Calendar.getInstance().getTimeInMillis() - lastMove; if(isMoving()) { if(timeElapsed < time) { isMoving(true); timeRemaining = time - timeElapsed; Vector flyPosition = new Vector(oldPosition.getX() + (direction.getX() * (timeElapsed / time)), oldPosition.getY() + (direction.getY()... | /**
* Devuelve la posicion del usuario
* @return
*/ | Devuelve la posicion del usuario | updatePosition | {
"repo_name": "BorjaSanchidrian/DarkOrbitServer",
"path": "src/com/darkorbit/objects/Npc.java",
"license": "gpl-2.0",
"size": 5448
} | [
"com.darkorbit.utils.Vector",
"java.util.Calendar"
] | import com.darkorbit.utils.Vector; import java.util.Calendar; | import com.darkorbit.utils.*; import java.util.*; | [
"com.darkorbit.utils",
"java.util"
] | com.darkorbit.utils; java.util; | 1,055,802 |
public int addTo(final K k, final int incr) {
// The starting point.
int pos = ( (k) == null ? 0x87fcd5c : it.unimi.dsi.fastutil.HashCommon.murmurHash3( System.identityHashCode(k) ) ) & mask;
// There's always an unused entry.
while( used[ pos ] ) {
if ( ( strategy.equals( (key[ pos ]), (K) (k) ) ) ) {
... | int function(final K k, final int incr) { int pos = ( (k) == null ? 0x87fcd5c : it.unimi.dsi.fastutil.HashCommon.murmurHash3( System.identityHashCode(k) ) ) & mask; while( used[ pos ] ) { if ( ( strategy.equals( (key[ pos ]), (K) (k) ) ) ) { final int oldValue = value[ pos ]; value[ pos ] += incr; return oldValue; } po... | /** Adds an increment to value currently associated with a key.
*
* <P>Note that this method respects the {@linkplain #defaultReturnValue() default return value} semantics: when
* called with a key that does not currently appears in the map, the key
* will be associated with the default return value plus
* th... | Adds an increment to value currently associated with a key. Note that this method respects the #defaultReturnValue() default return value semantics: when called with a key that does not currently appears in the map, the key will be associated with the default return value plus the given increment | addTo | {
"repo_name": "karussell/fastutil",
"path": "src/it/unimi/dsi/fastutil/objects/Reference2IntOpenCustomHashMap.java",
"license": "apache-2.0",
"size": 30805
} | [
"it.unimi.dsi.fastutil.HashCommon"
] | import it.unimi.dsi.fastutil.HashCommon; | import it.unimi.dsi.fastutil.*; | [
"it.unimi.dsi"
] | it.unimi.dsi; | 1,906,776 |
public double lastIndexOf(BigDecimal number) {
return this.data.lastIndexOf(number);
} | double function(BigDecimal number) { return this.data.lastIndexOf(number); } | /**
* Returns the index of the last occurrence of the specified element in this
* list, or -1 if this list does not contain the element.
* @param int the index
* @return the index of the last occurrence
*/ | Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element | lastIndexOf | {
"repo_name": "jessemull/MicroFlex",
"path": "src/main/java/com/github/jessemull/microflex/bigdecimalflex/plate/WellBigDecimal.java",
"license": "apache-2.0",
"size": 25559
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 1,538,357 |
@SuppressLint("Override")
public static String normalizeNumber(String phoneNumber) {
StringBuilder sb = new StringBuilder();
int len = phoneNumber.length();
for (int i = 0; i < len; i++) {
char c = phoneNumber.charAt(i);
// Character.digit() supports ASCII and Uni... | @SuppressLint(STR) static String function(String phoneNumber) { StringBuilder sb = new StringBuilder(); int len = phoneNumber.length(); for (int i = 0; i < len; i++) { char c = phoneNumber.charAt(i); int digit = Character.digit(c, 10); if (digit != -1) { sb.append(digit); } else if (i == 0 && c == '+') { sb.append(c); ... | /**
* Normalize a phone number by removing the characters other than digits. If
* the given number has keypad letters, the letters will be converted to
* digits first.
*
* @param phoneNumber
* the number to be normalized.
* @return the normalized number.
*
*/ | Normalize a phone number by removing the characters other than digits. If the given number has keypad letters, the letters will be converted to digits first | normalizeNumber | {
"repo_name": "AdeebNqo/Thula",
"path": "Thula/src/main/java/com/adeebnqo/Thula/common/utils/PhoneNumberUtils.java",
"license": "gpl-3.0",
"size": 15892
} | [
"android.annotation.SuppressLint"
] | import android.annotation.SuppressLint; | import android.annotation.*; | [
"android.annotation"
] | android.annotation; | 1,467,649 |
//ODE_API
public static void dWorldSetAngularDampingThreshold(DWorld w, double threshold) {
w.setAngularDampingThreshold(threshold);
} | static void function(DWorld w, double threshold) { w.setAngularDampingThreshold(threshold); } | /**
* Set the world's angular damping threshold.
* @param threshold The damping won't be applied if the angular speed is
* below this threshold. Default is 0.01.
*/ | Set the world's angular damping threshold | dWorldSetAngularDampingThreshold | {
"repo_name": "billhj/Etoile-java",
"path": "Ode4j/src/org/ode4j/cpp/internal/ApiCppWorld.java",
"license": "mit",
"size": 19846
} | [
"org.ode4j.ode.DWorld"
] | import org.ode4j.ode.DWorld; | import org.ode4j.ode.*; | [
"org.ode4j.ode"
] | org.ode4j.ode; | 2,438,702 |
public static Boolean isExistingSingleSignOnSessionAvailable(final MockRequestContext context) {
return context.getFlowScope().get("existingSingleSignOnSessionAvailable", Boolean.class);
} | static Boolean function(final MockRequestContext context) { return context.getFlowScope().get(STR, Boolean.class); } | /**
* Is existing single sign on session available boolean.
*
* @param context the context
* @return the boolean
*/ | Is existing single sign on session available boolean | isExistingSingleSignOnSessionAvailable | {
"repo_name": "fogbeam/cas_mirror",
"path": "core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java",
"license": "apache-2.0",
"size": 67337
} | [
"org.springframework.webflow.test.MockRequestContext"
] | import org.springframework.webflow.test.MockRequestContext; | import org.springframework.webflow.test.*; | [
"org.springframework.webflow"
] | org.springframework.webflow; | 825,890 |
public final ICompoundRequestMapper getRootRequestMapperAsCompound()
{
IRequestMapper root = getRootRequestMapper();
if (!(root instanceof ICompoundRequestMapper))
{
root = new CompoundRequestMapper().add(root);
setRootRequestMapper(root);
}
return (ICompoundRequestMapper)root;
} | final ICompoundRequestMapper function() { IRequestMapper root = getRootRequestMapper(); if (!(root instanceof ICompoundRequestMapper)) { root = new CompoundRequestMapper().add(root); setRootRequestMapper(root); } return (ICompoundRequestMapper)root; } | /**
* Converts the root mapper to a {@link ICompoundRequestMapper} if necessary and returns the
* converted instance.
*
* @return compound instance of the root mapper
*/ | Converts the root mapper to a <code>ICompoundRequestMapper</code> if necessary and returns the converted instance | getRootRequestMapperAsCompound | {
"repo_name": "afiantara/apache-wicket-1.5.7",
"path": "src/wicket-core/src/main/java/org/apache/wicket/Application.java",
"license": "apache-2.0",
"size": 49077
} | [
"org.apache.wicket.request.IRequestMapper",
"org.apache.wicket.request.mapper.CompoundRequestMapper",
"org.apache.wicket.request.mapper.ICompoundRequestMapper"
] | import org.apache.wicket.request.IRequestMapper; import org.apache.wicket.request.mapper.CompoundRequestMapper; import org.apache.wicket.request.mapper.ICompoundRequestMapper; | import org.apache.wicket.request.*; import org.apache.wicket.request.mapper.*; | [
"org.apache.wicket"
] | org.apache.wicket; | 1,650,077 |
Person p = new Person();
assertNotNull(p.getAddresses());
PersonAddress pa1 = new PersonAddress();
pa1.setAddress1("firsttest");
pa1.setAddress2("firsttest2");
pa1.setDateCreated(new Date());
pa1.setVoided(false);
p.addAddress(pa1);
// make sure the address is added.
assertTrue("There... | Person p = new Person(); assertNotNull(p.getAddresses()); PersonAddress pa1 = new PersonAddress(); pa1.setAddress1(STR); pa1.setAddress2(STR); pa1.setDateCreated(new Date()); pa1.setVoided(false); p.addAddress(pa1); assertTrue(STR + p.getAddresses().size(), p .getAddresses().size() == 1); p.addAddress(pa1); assertTrue(... | /**
* Test the add/removeAddresses method in the person object
*
* @throws Exception
*/ | Test the add/removeAddresses method in the person object | shouldAddRemoveAddress | {
"repo_name": "MitchellBot/openmrs-core",
"path": "api/src/test/java/org/openmrs/PersonTest.java",
"license": "mpl-2.0",
"size": 32619
} | [
"java.util.Date",
"org.junit.Assert"
] | import java.util.Date; import org.junit.Assert; | import java.util.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 1,791,352 |
@Named("node:update")
@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Path("/nodes/{id}")
void update(@PathParam("id") int id, @WrapWith("node") UpdateNode updateNode); | @Named(STR) @Consumes(MediaType.APPLICATION_JSON) @Path(STR) void update(@PathParam("id") int id, @WrapWith("node") UpdateNode updateNode); | /**
* Update the attributes of a node.
*/ | Update the attributes of a node | update | {
"repo_name": "yanzhijun/jclouds-aliyun",
"path": "apis/rackspace-cloudloadbalancers/src/main/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/NodeApi.java",
"license": "apache-2.0",
"size": 7608
} | [
"javax.inject.Named",
"javax.ws.rs.Consumes",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.core.MediaType",
"org.jclouds.rackspace.cloudloadbalancers.v1.domain.UpdateNode",
"org.jclouds.rest.annotations.WrapWith"
] | import javax.inject.Named; import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.MediaType; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.UpdateNode; import org.jclouds.rest.annotations.WrapWith; | import javax.inject.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.jclouds.rackspace.cloudloadbalancers.v1.domain.*; import org.jclouds.rest.annotations.*; | [
"javax.inject",
"javax.ws",
"org.jclouds.rackspace",
"org.jclouds.rest"
] | javax.inject; javax.ws; org.jclouds.rackspace; org.jclouds.rest; | 2,390,706 |
public void update(IPermission[] perms) throws AuthorizationException
{
if ( perms.length > 0 )
{
try
{
primUpdate(perms);
}
catch (Exception ex)
{
log.error("Exception updating permissions " + perms, ex)... | void function(IPermission[] perms) throws AuthorizationException { if ( perms.length > 0 ) { try { primUpdate(perms); } catch (Exception ex) { log.error(STR + perms, ex); throw new AuthorizationException(ex); } } } | /**
* Update the IPermissions in the store.
* @param perms org.jasig.portal.security.IPermission[]
* @exception org.jasig.portal.AuthorizationException - wraps an Exception specific to the store.
*/ | Update the IPermissions in the store | update | {
"repo_name": "ASU-Capstone/uPortal-Forked",
"path": "uportal-war/src/main/java/org/jasig/portal/security/provider/RDBMPermissionImpl.java",
"license": "apache-2.0",
"size": 30705
} | [
"org.jasig.portal.AuthorizationException",
"org.jasig.portal.security.IPermission"
] | import org.jasig.portal.AuthorizationException; import org.jasig.portal.security.IPermission; | import org.jasig.portal.*; import org.jasig.portal.security.*; | [
"org.jasig.portal"
] | org.jasig.portal; | 1,875,343 |
void updateImage(Header header, DataSource headerImg, DataSource fullImg)
throws CillaServiceException; | void updateImage(Header header, DataSource headerImg, DataSource fullImg) throws CillaServiceException; | /**
* Updates the images of an existing {@link Header}.
*
* @param header
* {@link Header} to change the images of
* @param headerImg
* The uploaded file to be used as header image, or {@code null} to keep
* the existing image
* @param fullImg
... | Updates the images of an existing <code>Header</code> | updateImage | {
"repo_name": "shred/cilla",
"path": "cilla-service/src/main/java/org/shredzone/cilla/service/HeaderService.java",
"license": "agpl-3.0",
"size": 3874
} | [
"javax.activation.DataSource",
"org.shredzone.cilla.core.model.Header",
"org.shredzone.cilla.ws.exception.CillaServiceException"
] | import javax.activation.DataSource; import org.shredzone.cilla.core.model.Header; import org.shredzone.cilla.ws.exception.CillaServiceException; | import javax.activation.*; import org.shredzone.cilla.core.model.*; import org.shredzone.cilla.ws.exception.*; | [
"javax.activation",
"org.shredzone.cilla"
] | javax.activation; org.shredzone.cilla; | 1,485,709 |
private void logRenewDelegationToken(DelegationTokenIdentifier id,
long expiryTime) throws IOException {
synchronized (this) {
getEditLog().logRenewDelegationToken(id, expiryTime);
}
getEditLog().logSync();
} | void function(DelegationTokenIdentifier id, long expiryTime) throws IOException { synchronized (this) { getEditLog().logRenewDelegationToken(id, expiryTime); } getEditLog().logSync(); } | /**
* Log the renewDelegationToken operation to edit logs
*
* @param id identifer of the delegation token being renewed
* @param expiryTime when delegation token expires
*/ | Log the renewDelegationToken operation to edit logs | logRenewDelegationToken | {
"repo_name": "wzhuo918/release-1.1.2-MDP",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java",
"license": "apache-2.0",
"size": 226670
} | [
"java.io.IOException",
"org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier"
] | import java.io.IOException; import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier; | import java.io.*; import org.apache.hadoop.hdfs.security.token.delegation.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,605,792 |
@Test
public void testIteratorNonEmptyStoreNext() throws Exception {
this.store = new FakeStore(this.getTestStoreEntries());
final InternalCache<String, String> ehcache = this.getEhcache();
final Iterator<Cache.Entry<String, String>> iterator = ehcache.iterator();
assertThat(iterator.next(), is(notN... | void function() throws Exception { this.store = new FakeStore(this.getTestStoreEntries()); final InternalCache<String, String> ehcache = this.getEhcache(); final Iterator<Cache.Entry<String, String>> iterator = ehcache.iterator(); assertThat(iterator.next(), is(notNullValue())); } | /**
* Tests {@link java.util.Iterator#next()} from {@link Ehcache#iterator()} on a non-empty cache.
*/ | Tests <code>java.util.Iterator#next()</code> from <code>Ehcache#iterator()</code> on a non-empty cache | testIteratorNonEmptyStoreNext | {
"repo_name": "akomakom/ehcache3",
"path": "core/src/test/java/org/ehcache/core/EhcacheBasicIteratorTest.java",
"license": "apache-2.0",
"size": 10636
} | [
"java.util.Iterator",
"org.ehcache.Cache",
"org.hamcrest.Matchers",
"org.junit.Assert"
] | import java.util.Iterator; import org.ehcache.Cache; import org.hamcrest.Matchers; import org.junit.Assert; | import java.util.*; import org.ehcache.*; import org.hamcrest.*; import org.junit.*; | [
"java.util",
"org.ehcache",
"org.hamcrest",
"org.junit"
] | java.util; org.ehcache; org.hamcrest; org.junit; | 2,067,600 |
public static BufferedImage makeImage(double[] data,
int w, int h, int c, boolean interleaved)
{
if (c == 1) return makeImage(data, w, h);
int dataType = DataBuffer.TYPE_DOUBLE;
DataBuffer buffer = new DataBufferDouble(data, c * w * h);
return constructImage(c, dataType, w, h, interleaved, false... | static BufferedImage function(double[] data, int w, int h, int c, boolean interleaved) { if (c == 1) return makeImage(data, w, h); int dataType = DataBuffer.TYPE_DOUBLE; DataBuffer buffer = new DataBufferDouble(data, c * w * h); return constructImage(c, dataType, w, h, interleaved, false, buffer); } | /**
* Creates an image from the given double data.
*
* @param data Array containing image data.
* @param w Width of image plane.
* @param h Height of image plane.
* @param c Number of channels.
* @param interleaved If set, the channels are assumed to be interleaved;
* otherwise they are assume... | Creates an image from the given double data | makeImage | {
"repo_name": "hflynn/bioformats",
"path": "components/formats-bsd/src/loci/formats/gui/AWTImageTools.java",
"license": "gpl-2.0",
"size": 71756
} | [
"java.awt.image.BufferedImage",
"java.awt.image.DataBuffer",
"java.awt.image.DataBufferDouble"
] | import java.awt.image.BufferedImage; import java.awt.image.DataBuffer; import java.awt.image.DataBufferDouble; | import java.awt.image.*; | [
"java.awt"
] | java.awt; | 894,070 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.