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 Float getIndex() {
return index;
} | Float function() { return index; } | /**
* returns index
*
* @return
*/ | returns index | getIndex | {
"repo_name": "SensorsINI/jaer",
"path": "src/ch/unizh/ini/jaer/projects/einsteintunnel/sensoryprocessing/BlurringTunnelFilter.java",
"license": "lgpl-2.1",
"size": 60624
} | [
"java.awt.geom.Point2D"
] | import java.awt.geom.Point2D; | import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 687,350 |
List<NeighboringCellInfo> getNeighboringCellInfo(); | List<NeighboringCellInfo> getNeighboringCellInfo(); | /**
* Returns the neighboring cell information of the device.
*/ | Returns the neighboring cell information of the device | getNeighboringCellInfo | {
"repo_name": "oasis2008/GTalkSMS-1",
"path": "src/com/android/internal/telephony/ITelephony.java",
"license": "gpl-3.0",
"size": 6942
} | [
"android.telephony.NeighboringCellInfo",
"java.util.List"
] | import android.telephony.NeighboringCellInfo; import java.util.List; | import android.telephony.*; import java.util.*; | [
"android.telephony",
"java.util"
] | android.telephony; java.util; | 866,233 |
protected Connection doGetNativeConnection(Connection con) throws SQLException {
if (this.webSphere5ConnectionClass.isAssignableFrom(con.getClass())) {
return (Connection) ReflectionUtils.invokeMethod(
this.webSphere5NativeConnectionMethod, null, new Object[] {con});
}
return con;
} | Connection function(Connection con) throws SQLException { if (this.webSphere5ConnectionClass.isAssignableFrom(con.getClass())) { return (Connection) ReflectionUtils.invokeMethod( this.webSphere5NativeConnectionMethod, null, new Object[] {con}); } return con; } | /**
* Retrieve the Connection via WebSphere's <code>getNativeConnection</code> method.
*/ | Retrieve the Connection via WebSphere's <code>getNativeConnection</code> method | doGetNativeConnection | {
"repo_name": "mattxia/spring-2.5-analysis",
"path": "src/org/springframework/jdbc/support/nativejdbc/WebSphereNativeJdbcExtractor.java",
"license": "apache-2.0",
"size": 3635
} | [
"java.sql.Connection",
"java.sql.SQLException",
"org.springframework.util.ReflectionUtils"
] | import java.sql.Connection; import java.sql.SQLException; import org.springframework.util.ReflectionUtils; | import java.sql.*; import org.springframework.util.*; | [
"java.sql",
"org.springframework.util"
] | java.sql; org.springframework.util; | 2,393,038 |
public ExtensionResultStatusType overrideClassNameForSection(ExtensionResultHolder erh, String sectionKey,
AdminSection section); | ExtensionResultStatusType function(ExtensionResultHolder erh, String sectionKey, AdminSection section); | /**
* Invoked whenever {@link AdminAbstractController#getClassNameForSection(String)} is invoked. If an extension
* handler sets the {@link #NEW_CLASS_NAME} variable in the ExtensionResultHolder, the overriden value will be used.
*
* @param erh
* @param sectionKey
* @param section
* ... | Invoked whenever <code>AdminAbstractController#getClassNameForSection(String)</code> is invoked. If an extension handler sets the <code>#NEW_CLASS_NAME</code> variable in the ExtensionResultHolder, the overriden value will be used | overrideClassNameForSection | {
"repo_name": "cengizhanozcan/BroadleafCommerce",
"path": "admin/broadleaf-open-admin-platform/src/main/java/org/broadleafcommerce/openadmin/web/controller/AdminAbstractControllerExtensionHandler.java",
"license": "apache-2.0",
"size": 3978
} | [
"org.broadleafcommerce.common.extension.ExtensionResultHolder",
"org.broadleafcommerce.common.extension.ExtensionResultStatusType",
"org.broadleafcommerce.openadmin.server.security.domain.AdminSection"
] | import org.broadleafcommerce.common.extension.ExtensionResultHolder; import org.broadleafcommerce.common.extension.ExtensionResultStatusType; import org.broadleafcommerce.openadmin.server.security.domain.AdminSection; | import org.broadleafcommerce.common.extension.*; import org.broadleafcommerce.openadmin.server.security.domain.*; | [
"org.broadleafcommerce.common",
"org.broadleafcommerce.openadmin"
] | org.broadleafcommerce.common; org.broadleafcommerce.openadmin; | 1,492,109 |
public static String QaE(String v) {
return escape(Pattern.quote(v));
} | static String function(String v) { return escape(Pattern.quote(v)); } | /**
* Quote and Escape a String by adding ESCAPE_STRING at the beginning.
*
* @param v String
* @return Escaped and Quoted String
*/ | Quote and Escape a String by adding ESCAPE_STRING at the beginning | QaE | {
"repo_name": "AlternaCraft/ACLIB",
"path": "src/main/java/com/alternacraft/aclib/utils/RegExp.java",
"license": "gpl-3.0",
"size": 3224
} | [
"java.util.regex.Pattern"
] | import java.util.regex.Pattern; | import java.util.regex.*; | [
"java.util"
] | java.util; | 2,591,692 |
static String getHelpID(Component c) {
initialize();
boolean found = false;
String result = null;
if (c instanceof JTree) {
String idInTree = getHelpIDInTree((JTree) c);
if (idInTree != null) {
found = true;
result = idInTree;
}
}
Component working = c;
if (c != null)
logger.trace("... | static String getHelpID(Component c) { initialize(); boolean found = false; String result = null; if (c instanceof JTree) { String idInTree = getHelpIDInTree((JTree) c); if (idInTree != null) { found = true; result = idInTree; } } Component working = c; if (c != null) logger.trace(STR + working.getClass()); while (!fou... | /**
* Try to find an id for the Component. This code should be re-written when
* we have more experience in how to couple the UI and HelpSets.
*
* @param c
* @return
*/ | Try to find an id for the Component. This code should be re-written when we have more experience in how to couple the UI and HelpSets | getHelpID | {
"repo_name": "apache/incubator-taverna-workbench",
"path": "taverna-helper-api/src/main/java/org/apache/taverna/workbench/helper/HelpCollator.java",
"license": "apache-2.0",
"size": 9497
} | [
"java.awt.Component",
"javax.swing.JTree"
] | import java.awt.Component; import javax.swing.JTree; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 540,723 |
@Test
public void testRequestTTL() throws Exception {
InputStream jmxInputStream = IOUtils.toInputStream("{ \"beans\": [] }");
// only allow a single call to the mock
StreamProvider streamProvider = createStrictMock(StreamProvider.class);
EasyMock.expect(streamProvider.readFrom(JMX_URL)).andReturn(... | void function() throws Exception { InputStream jmxInputStream = IOUtils.toInputStream(STRbeans\STR); StreamProvider streamProvider = createStrictMock(StreamProvider.class); EasyMock.expect(streamProvider.readFrom(JMX_URL)).andReturn(jmxInputStream).once(); replayAll(); m_service.startAsync(); m_service.awaitRunning(MET... | /**
* Tests that many requests to the same URL do not invoke the stream provider
* more than once.
*/ | Tests that many requests to the same URL do not invoke the stream provider more than once | testRequestTTL | {
"repo_name": "sekikn/ambari",
"path": "ambari-server/src/test/java/org/apache/ambari/server/state/services/MetricsRetrievalServiceTest.java",
"license": "apache-2.0",
"size": 10898
} | [
"java.io.InputStream",
"java.util.concurrent.TimeUnit",
"org.apache.ambari.server.controller.utilities.StreamProvider",
"org.apache.ambari.server.state.services.MetricsRetrievalService",
"org.apache.ambari.server.utils.SynchronousThreadPoolExecutor",
"org.apache.commons.io.IOUtils",
"org.easymock.EasyMo... | import java.io.InputStream; import java.util.concurrent.TimeUnit; import org.apache.ambari.server.controller.utilities.StreamProvider; import org.apache.ambari.server.state.services.MetricsRetrievalService; import org.apache.ambari.server.utils.SynchronousThreadPoolExecutor; import org.apache.commons.io.IOUtils; import... | import java.io.*; import java.util.concurrent.*; import org.apache.ambari.server.controller.utilities.*; import org.apache.ambari.server.state.services.*; import org.apache.ambari.server.utils.*; import org.apache.commons.io.*; import org.easymock.*; | [
"java.io",
"java.util",
"org.apache.ambari",
"org.apache.commons",
"org.easymock"
] | java.io; java.util; org.apache.ambari; org.apache.commons; org.easymock; | 1,816,336 |
static native long capgetPermitted(int pid)
throws IOException; | static native long capgetPermitted(int pid) throws IOException; | /**
* Retrieves the permitted capability set from another process.
*
* @param pid >=0 process ID or 0 for this process
* @throws IOException on error
*/ | Retrieves the permitted capability set from another process | capgetPermitted | {
"repo_name": "mateor/pdroid",
"path": "android-4.0.3_r1/trunk/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java",
"license": "gpl-3.0",
"size": 27111
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 698,107 |
@Override
public double fire(IInstantiation instantiation, double firingTime)
{
IModel model = instantiation.getModel();
IProceduralModule procMod = model.getProceduralModule();
double finishTime = firingTime + procMod.getDefaultProductionFiringTime();
final IChunk chunk = (IChunk) ... | double function(IInstantiation instantiation, double firingTime) { IModel model = instantiation.getModel(); IProceduralModule procMod = model.getProceduralModule(); double finishTime = firingTime + procMod.getDefaultProductionFiringTime(); final IChunk chunk = (IChunk) getSlot(STR).getValue(); final double sum = ((Numb... | /**
* here we will change the sum slot of the count-chunk to the actual sum value.
* Instead of doing it immediately, we delay until the production finish time (typically
* 50ms after the firingTime).
* @see IAction#fire(IInstantiation, double)
*/ | here we will change the sum slot of the count-chunk to the actual sum value. Instead of doing it immediately, we delay until the production finish time (typically 50ms after the firingTime) | fire | {
"repo_name": "amharrison/jactr-tutorials",
"path": "org.jactr.examples.custom/java/org/jactr/examples/custom/SetResultAction.java",
"license": "gpl-2.0",
"size": 6028
} | [
"org.jactr.core.chunk.IChunk",
"org.jactr.core.model.IModel",
"org.jactr.core.module.procedural.IProceduralModule",
"org.jactr.core.production.IInstantiation"
] | import org.jactr.core.chunk.IChunk; import org.jactr.core.model.IModel; import org.jactr.core.module.procedural.IProceduralModule; import org.jactr.core.production.IInstantiation; | import org.jactr.core.chunk.*; import org.jactr.core.model.*; import org.jactr.core.module.procedural.*; import org.jactr.core.production.*; | [
"org.jactr.core"
] | org.jactr.core; | 1,621,690 |
static <V> KeyValueMatcher<V> of(final Key<? extends Value<V>> key, final V value) {
return KeyValueMatcher.of(key, value, Operator.EQUAL);
} | static <V> KeyValueMatcher<V> of(final Key<? extends Value<V>> key, final V value) { return KeyValueMatcher.of(key, value, Operator.EQUAL); } | /**
* Creates a {@link KeyValueMatcher} from the given key and value. The
* default operator {@link Operator#EQUAL} will be used.
*
* @param key The key of which the value should be matched
* @param value The matcher value that key values will be matched against
* @param <V> The value type... | Creates a <code>KeyValueMatcher</code> from the given key and value. The default operator <code>Operator#EQUAL</code> will be used | of | {
"repo_name": "SpongePowered/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/data/KeyValueMatcher.java",
"license": "mit",
"size": 7226
} | [
"org.spongepowered.api.data.value.Value"
] | import org.spongepowered.api.data.value.Value; | import org.spongepowered.api.data.value.*; | [
"org.spongepowered.api"
] | org.spongepowered.api; | 1,597,002 |
public static void trackAnalyticsAccountCreated(String username, String email, Map<String, Object> properties) {
AnalyticsUtils.refreshMetadataNewUser(username, email);
// This stat is part of a funnel that provides critical information. Before
// making ANY modification to this stat please... | static void function(String username, String email, Map<String, Object> properties) { AnalyticsUtils.refreshMetadataNewUser(username, email); AnalyticsTracker.track(AnalyticsTracker.Stat.CREATED_ACCOUNT, properties); } | /**
* Refreshes analytics metadata and bumps the account created stat.
*
* @param username
* @param email
*/ | Refreshes analytics metadata and bumps the account created stat | trackAnalyticsAccountCreated | {
"repo_name": "wordpress-mobile/WordPress-Android",
"path": "WordPress/src/main/java/org/wordpress/android/util/analytics/AnalyticsUtils.java",
"license": "gpl-2.0",
"size": 33822
} | [
"java.util.Map",
"org.wordpress.android.analytics.AnalyticsTracker"
] | import java.util.Map; import org.wordpress.android.analytics.AnalyticsTracker; | import java.util.*; import org.wordpress.android.analytics.*; | [
"java.util",
"org.wordpress.android"
] | java.util; org.wordpress.android; | 2,475,371 |
return (Document) documents.get(name);
} | return (Document) documents.get(name); } | /**
* Returns the document for the specified name or <code>null</code> if no
* such document exists.
*
* @param name
* The name of the document to be returned.
* @return Returns the backing document.
*/ | Returns the document for the specified name or <code>null</code> if no such document exists | getDocument | {
"repo_name": "harryho/demo-r-java-statistics-prototype",
"path": "rm/rm/src/com/rm/app/ui/tool/RMAppDocumentBuilder.java",
"license": "mit",
"size": 17393
} | [
"org.w3c.dom.Document"
] | import org.w3c.dom.Document; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,449,051 |
public static void shutdownProgressManager() {
if (singleton == null) {
return;
}
singleton.shutdown();
}
class JobMonitor implements IProgressMonitorWithBlocking {
Job job;
String currentTaskName;
IProgressMonitorWithBlocking listener;
JobMonitor(Job newJob) {
job = newJob;
} | static void function() { if (singleton == null) { return; } singleton.shutdown(); } class JobMonitor implements IProgressMonitorWithBlocking { Job job; String currentTaskName; IProgressMonitorWithBlocking listener; JobMonitor(Job newJob) { job = newJob; } | /**
* Shutdown the singleton if there is one.
*/ | Shutdown the singleton if there is one | shutdownProgressManager | {
"repo_name": "CohesionForce/eclipse4-parts",
"path": "org.eclipse.e4.ui.part/src/org/eclipse/e4/ui/internal/progress/ProgressManager.java",
"license": "epl-1.0",
"size": 32895
} | [
"org.eclipse.core.runtime.IProgressMonitorWithBlocking",
"org.eclipse.core.runtime.jobs.Job"
] | import org.eclipse.core.runtime.IProgressMonitorWithBlocking; import org.eclipse.core.runtime.jobs.Job; | import org.eclipse.core.runtime.*; import org.eclipse.core.runtime.jobs.*; | [
"org.eclipse.core"
] | org.eclipse.core; | 2,891,230 |
public VMMetrics.Record getRecord(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "VM_metrics.get_record";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXML... | VMMetrics.Record function(Connection c) throws BadServerResponse, XenAPIException, XmlRpcException { String method_call = STR; String session = c.getSessionReference(); Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)}; Map response = c.dispatch(method_call, method_params); Object... | /**
* Get a record containing the current state of the given VM_metrics.
*
* @return all fields from the object
*/ | Get a record containing the current state of the given VM_metrics | getRecord | {
"repo_name": "guzy/OnceCenter",
"path": "src/com/once/xenapi/VMMetrics.java",
"license": "apache-2.0",
"size": 18952
} | [
"com.once.xenapi.Types",
"java.util.Map",
"org.apache.xmlrpc.XmlRpcException"
] | import com.once.xenapi.Types; import java.util.Map; import org.apache.xmlrpc.XmlRpcException; | import com.once.xenapi.*; import java.util.*; import org.apache.xmlrpc.*; | [
"com.once.xenapi",
"java.util",
"org.apache.xmlrpc"
] | com.once.xenapi; java.util; org.apache.xmlrpc; | 1,545,124 |
public static String defaultIndexName(QueryIndex idx) {
StringBuilder idxName = new StringBuilder();
for (Map.Entry<String, Boolean> field : idx.getFields().entrySet()) {
idxName.append(field.getKey());
idxName.append('_');
idxName.append(field.getValue() ? "asc... | static String function(QueryIndex idx) { StringBuilder idxName = new StringBuilder(); for (Map.Entry<String, Boolean> field : idx.getFields().entrySet()) { idxName.append(field.getKey()); idxName.append('_'); idxName.append(field.getValue() ? "asc_" : "desc_"); } for (int i = 0; i < idxName.length(); i++) { char ch = i... | /**
* Generates default index name by concatenating all index field names.
*
* @param idx Index to build name for.
* @return Index name.
*/ | Generates default index name by concatenating all index field names | defaultIndexName | {
"repo_name": "agura/incubator-ignite",
"path": "modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java",
"license": "apache-2.0",
"size": 6317
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,893,679 |
public ItemStack transferStackInSlot(EntityPlayer playerIn, int sourceSlotIndex) {
Slot sourceSlot = inventorySlots.get(sourceSlotIndex);
if (sourceSlot == null || !sourceSlot.getHasStack()) {
return ItemStackTools.getEmptyStack();
}
ItemStack sourceStack = sourceSlot.get... | ItemStack function(EntityPlayer playerIn, int sourceSlotIndex) { Slot sourceSlot = inventorySlots.get(sourceSlotIndex); if (sourceSlot == null !sourceSlot.getHasStack()) { return ItemStackTools.getEmptyStack(); } ItemStack sourceStack = sourceSlot.getStack(); ItemStack sourceStackCopy = sourceStack.copy(); if (PLAYER_F... | /**
* Perform an action on SHIFT-Click
*/ | Perform an action on SHIFT-Click | transferStackInSlot | {
"repo_name": "MasterEric/META",
"path": "src/main/java/com/mastereric/meta/common/blocks/container/ContainerMETA.java",
"license": "gpl-3.0",
"size": 7455
} | [
"com.mastereric.meta.init.ModItems",
"com.mastereric.meta.util.LogUtility",
"net.minecraft.entity.player.EntityPlayer",
"net.minecraft.inventory.Slot",
"net.minecraft.item.ItemStack"
] | import com.mastereric.meta.init.ModItems; import com.mastereric.meta.util.LogUtility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; | import com.mastereric.meta.init.*; import com.mastereric.meta.util.*; import net.minecraft.entity.player.*; import net.minecraft.inventory.*; import net.minecraft.item.*; | [
"com.mastereric.meta",
"net.minecraft.entity",
"net.minecraft.inventory",
"net.minecraft.item"
] | com.mastereric.meta; net.minecraft.entity; net.minecraft.inventory; net.minecraft.item; | 1,301,794 |
@Override
public String toString() {
return "(" + StringUtils.arrayAwareToString(this.f0)
+ "," + StringUtils.arrayAwareToString(this.f1)
+ "," + StringUtils.arrayAwareToString(this.f2)
+ "," + StringUtils.arrayAwareToString(this.f3)
+ "," + StringUtils.arrayAwareToString(this.f4)
+ "," + StringUti... | String function() { return "(" + StringUtils.arrayAwareToString(this.f0) + "," + StringUtils.arrayAwareToString(this.f1) + "," + StringUtils.arrayAwareToString(this.f2) + "," + StringUtils.arrayAwareToString(this.f3) + "," + StringUtils.arrayAwareToString(this.f4) + "," + StringUtils.arrayAwareToString(this.f5) + "," +... | /**
* Creates a string representation of the tuple in the form
* (f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17),
* where the individual fields are the value returned by calling {@link Object#toString} on that field.
* @return The string representation of the tuple.
*/ | Creates a string representation of the tuple in the form (f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17), where the individual fields are the value returned by calling <code>Object#toString</code> on that field | toString | {
"repo_name": "WangTaoTheTonic/flink",
"path": "flink-core/src/main/java/org/apache/flink/api/java/tuple/Tuple18.java",
"license": "apache-2.0",
"size": 14569
} | [
"org.apache.flink.util.StringUtils"
] | import org.apache.flink.util.StringUtils; | import org.apache.flink.util.*; | [
"org.apache.flink"
] | org.apache.flink; | 2,848,889 |
private CharSequence getPreviewText(Key key) {
if (mInMultiTap) {
// Multi-tap
mPreviewLabel.setLength(0);
mPreviewLabel.append((char) key.codes[mTapCount < 0 ? 0 : mTapCount]);
return adjustCase(mPreviewLabel);
} else {
return adjustCase(k... | CharSequence function(Key key) { if (mInMultiTap) { mPreviewLabel.setLength(0); mPreviewLabel.append((char) key.codes[mTapCount < 0 ? 0 : mTapCount]); return adjustCase(mPreviewLabel); } else { return adjustCase(key.label); } } | /**
* Handle multi-tap keys by producing the key label for the current multi-tap state.
*/ | Handle multi-tap keys by producing the key label for the current multi-tap state | getPreviewText | {
"repo_name": "xorware/android_frameworks_base",
"path": "core/java/android/inputmethodservice/KeyboardView.java",
"license": "apache-2.0",
"size": 63113
} | [
"android.inputmethodservice.Keyboard"
] | import android.inputmethodservice.Keyboard; | import android.inputmethodservice.*; | [
"android.inputmethodservice"
] | android.inputmethodservice; | 1,217,590 |
public List<ExpressRouteCircuitPeeringInner> peerings() {
return this.peerings;
} | List<ExpressRouteCircuitPeeringInner> function() { return this.peerings; } | /**
* Get a collection of references to express route circuit peerings.
*
* @return the peerings value
*/ | Get a collection of references to express route circuit peerings | peerings | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFilterInner.java",
"license": "mit",
"size": 3547
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,548,280 |
public static boolean isQueuePrefix(String destination) {
if (ObjectHelper.isEmpty(destination)) {
return false;
}
return destination.startsWith(QUEUE_PREFIX) || destination.startsWith(TEMP_QUEUE_PREFIX);
} | static boolean function(String destination) { if (ObjectHelper.isEmpty(destination)) { return false; } return destination.startsWith(QUEUE_PREFIX) destination.startsWith(TEMP_QUEUE_PREFIX); } | /**
* Whether the destination name has either queue or temp queue prefix.
*
* @param destination the destination
* @return <tt>true</tt> if queue or temp-queue prefix, <tt>false</tt> otherwise
*/ | Whether the destination name has either queue or temp queue prefix | isQueuePrefix | {
"repo_name": "isavin/camel",
"path": "components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessageHelper.java",
"license": "apache-2.0",
"size": 16024
} | [
"org.apache.camel.util.ObjectHelper"
] | import org.apache.camel.util.ObjectHelper; | import org.apache.camel.util.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,012,788 |
public static BLOB storeDocumentToBLOB (Document document) {
Connection conn = null;
BLOB blobDocument = null;
try {
//Class.forName("oracle.jdbc.driver.OracleDriver");
//conn = DriverManager.getConnection("jdbc:oracle:thin:@192.168.2.150:1521:orcl", "edocpki", "redmoon");
conn = Dr... | static BLOB function (Document document) { Connection conn = null; BLOB blobDocument = null; try { conn = DriverManager.getConnection(STR); ByteArrayOutputStream outArray = new ByteArrayOutputStream(); TransformerFactory tf = TransformerFactory.newInstance(); Transformer trans = tf.newTransformer(); trans.transform(new... | /**
* Store a document in a BLOB.
* @param document The document.
* @return A BLOB containing the document or null in case of error.
*/ | Store a document in a BLOB | storeDocumentToBLOB | {
"repo_name": "gialnet/eDocPKI",
"path": "src/es/redmoon/utils/XML.java",
"license": "gpl-2.0",
"size": 4440
} | [
"java.io.ByteArrayOutputStream",
"java.io.OutputStream",
"java.sql.Connection",
"java.sql.DriverManager",
"java.util.logging.Level",
"java.util.logging.Logger",
"javax.xml.transform.Transformer",
"javax.xml.transform.TransformerFactory",
"javax.xml.transform.dom.DOMSource",
"javax.xml.transform.st... | import java.io.ByteArrayOutputStream; import java.io.OutputStream; import java.sql.Connection; import java.sql.DriverManager; import java.util.logging.Level; import java.util.logging.Logger; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; ... | import java.io.*; import java.sql.*; import java.util.logging.*; import javax.xml.transform.*; import javax.xml.transform.dom.*; import javax.xml.transform.stream.*; import oracle.sql.*; import org.w3c.dom.*; | [
"java.io",
"java.sql",
"java.util",
"javax.xml",
"oracle.sql",
"org.w3c.dom"
] | java.io; java.sql; java.util; javax.xml; oracle.sql; org.w3c.dom; | 1,422,203 |
public static int[] jsonArrayToIntArray(String json) {
try {
JSONArray jsonArray = new JSONArray(json);
int[] stringArray = new int[jsonArray.length()];
for (int i = 0; i < jsonArray.length(); i++) {
stringArray[i] = jsonArray.getInt(i);
}
... | static int[] function(String json) { try { JSONArray jsonArray = new JSONArray(json); int[] stringArray = new int[jsonArray.length()]; for (int i = 0; i < jsonArray.length(); i++) { stringArray[i] = jsonArray.getInt(i); } return stringArray; } catch (JSONException e) { Log.e(TAG, STR, e); } return new int[0]; } | /**
* Creates an int array out of a json array.
*
* @param json The String containing the json array.
* @return An array with the extracted integers or an
* empty int array if an exception occurred.
*/ | Creates an int array out of a json array | jsonArrayToIntArray | {
"repo_name": "Dunkin53000/ToutStade",
"path": "app/src/main/java/com/google/samples/apps/topeka/helper/JsonHelper.java",
"license": "apache-2.0",
"size": 2414
} | [
"android.util.Log",
"org.json.JSONArray",
"org.json.JSONException"
] | import android.util.Log; import org.json.JSONArray; import org.json.JSONException; | import android.util.*; import org.json.*; | [
"android.util",
"org.json"
] | android.util; org.json; | 2,479,327 |
public int delete(final byte[] regionName, final List<Delete> deletes)
throws IOException; | int function(final byte[] regionName, final List<Delete> deletes) throws IOException; | /**
* Put an array of deletes into the specified region
*
* @param regionName region name
* @param deletes delete List to execute
* @return The number of processed deletes. Returns -1 if all Deletes
* processed successfully.
* @throws IOException e
*/ | Put an array of deletes into the specified region | delete | {
"repo_name": "axfcampos/hbase-0.94.19",
"path": "src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java",
"license": "apache-2.0",
"size": 23798
} | [
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.hbase.client.Delete"
] | import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.client.Delete; | import java.io.*; import java.util.*; import org.apache.hadoop.hbase.client.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 2,161,866 |
public boolean query(Query query) {
return GSTELEMENT_API.gst_element_query(this, query);
} | boolean function(Query query) { return GSTELEMENT_API.gst_element_query(this, query); } | /**
* Performs a query on the element.
*
* For elements that don't implement a query handler, this function forwards
* the query to a random srcpad or to the peer of a random linked sinkpad of
* this element.
*
* Please note that some queries might need a running pipeline to work.
... | Performs a query on the element. For elements that don't implement a query handler, this function forwards the query to a random srcpad or to the peer of a random linked sinkpad of this element. Please note that some queries might need a running pipeline to work | query | {
"repo_name": "neilcsmith-net/gst1-java-core",
"path": "src/org/freedesktop/gstreamer/Element.java",
"license": "lgpl-3.0",
"size": 28085
} | [
"org.freedesktop.gstreamer.query.Query"
] | import org.freedesktop.gstreamer.query.Query; | import org.freedesktop.gstreamer.query.*; | [
"org.freedesktop.gstreamer"
] | org.freedesktop.gstreamer; | 1,547,321 |
private void add(String entry, HostMap<String> hostMap)
{
if (entry != null && entry.length() > 0)
{
entry = entry.trim();
if (hostMap.get(entry) == null)
{
hostMap.put(entry, entry);
}
}
} | void function(String entry, HostMap<String> hostMap) { if (entry != null && entry.length() > 0) { entry = entry.trim(); if (hostMap.get(entry) == null) { hostMap.put(entry, entry); } } } | /**
* Helper method to process the new entry and add it to
* the specified host map.
*
* @param entry new entry
* @param hostMap target host map
*/ | Helper method to process the new entry and add it to the specified host map | add | {
"repo_name": "thomasbecker/jetty-spdy",
"path": "jetty-server/src/main/java/org/eclipse/jetty/server/handler/ConnectHandler.java",
"license": "apache-2.0",
"size": 30481
} | [
"org.eclipse.jetty.util.HostMap"
] | import org.eclipse.jetty.util.HostMap; | import org.eclipse.jetty.util.*; | [
"org.eclipse.jetty"
] | org.eclipse.jetty; | 1,631,829 |
@SuppressWarnings("TypeMayBeWeakened")
private void collectPendingVersions(Iterable<IgniteTxEntry> entries,
GridCacheVersion baseVer, Set<GridCacheVersion> vers) {
// The locks are not released yet, so we can safely list pending candidates versions.
for (IgniteTxEntry txEntry : entries)... | @SuppressWarnings(STR) void function(Iterable<IgniteTxEntry> entries, GridCacheVersion baseVer, Set<GridCacheVersion> vers) { for (IgniteTxEntry txEntry : entries) { GridCacheEntryEx cached = txEntry.cached(); try { if (!cached.obsolete()) { for (GridCacheMvccCandidate cand : cached.localCandidates()) { if (!cand.owner... | /**
* Gets versions of all not acquired locks for collection of tx entries that are less then base version.
*
* @param entries Tx entries to process.
* @param baseVer Base version to compare with.
* @param vers Collection of versions that will be populated.
*/ | Gets versions of all not acquired locks for collection of tx entries that are less then base version | collectPendingVersions | {
"repo_name": "psadusumilli/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java",
"license": "apache-2.0",
"size": 96066
} | [
"java.util.Set",
"org.apache.ignite.internal.processors.cache.GridCacheEntryEx",
"org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException",
"org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate",
"org.apache.ignite.internal.processors.cache.version.GridCacheVersion"
] | import java.util.Set; import org.apache.ignite.internal.processors.cache.GridCacheEntryEx; import org.apache.ignite.internal.processors.cache.GridCacheEntryRemovedException; import org.apache.ignite.internal.processors.cache.GridCacheMvccCandidate; import org.apache.ignite.internal.processors.cache.version.GridCacheVer... | import java.util.*; import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.version.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 2,858,922 |
public void addUserLogin(UserLogin userLogin);
| void function(UserLogin userLogin); | /**
* Update the userLogin with the values from the supplied object.
*/ | Update the userLogin with the values from the supplied object | addUserLogin | {
"repo_name": "andrewbissada/gss",
"path": "src/org/gss_project/gss/server/ejb/ExternalAPI.java",
"license": "gpl-3.0",
"size": 50977
} | [
"org.gss_project.gss.server.domain.UserLogin"
] | import org.gss_project.gss.server.domain.UserLogin; | import org.gss_project.gss.server.domain.*; | [
"org.gss_project.gss"
] | org.gss_project.gss; | 2,344,046 |
void addMessage(@NotNull CompilerMessageCategory category, String message, @Nullable String url, int lineNum, int columnNum); | void addMessage(@NotNull CompilerMessageCategory category, String message, @Nullable String url, int lineNum, int columnNum); | /**
* Allows to add a message to be shown in Compiler message view.
* If correct url, line and column numbers are supplied, the navigation to the specified file is available from the view.
*
* @param category the category of a message (information, error, warning).
* @param message the text of the mes... | Allows to add a message to be shown in Compiler message view. If correct url, line and column numbers are supplied, the navigation to the specified file is available from the view | addMessage | {
"repo_name": "msebire/intellij-community",
"path": "java/compiler/openapi/src/com/intellij/openapi/compiler/CompileContext.java",
"license": "apache-2.0",
"size": 5522
} | [
"org.jetbrains.annotations.NotNull",
"org.jetbrains.annotations.Nullable"
] | import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 2,824,769 |
public static List<DistChannelMap> listCompatibleDcmByServerInNullOrg(Server server) {
Map params = new HashMap();
params.put("release", server.getRelease());
params.put("server_arch_id", server.getServerArch().getId());
return singleton.listObjectsByNamedQuery(
"Dist... | static List<DistChannelMap> function(Server server) { Map params = new HashMap(); params.put(STR, server.getRelease()); params.put(STR, server.getServerArch().getId()); return singleton.listObjectsByNamedQuery( STR, params); } | /**
* Lists compatible dist channel mappings for a server available within an organization
* Returns empty list if none is found.
* @param server server
* @return list of dist channel mappings, empty list if none is found
*/ | Lists compatible dist channel mappings for a server available within an organization Returns empty list if none is found | listCompatibleDcmByServerInNullOrg | {
"repo_name": "dmacvicar/spacewalk",
"path": "java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java",
"license": "gpl-2.0",
"size": 41646
} | [
"com.redhat.rhn.domain.server.Server",
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] | import com.redhat.rhn.domain.server.Server; import java.util.HashMap; import java.util.List; import java.util.Map; | import com.redhat.rhn.domain.server.*; import java.util.*; | [
"com.redhat.rhn",
"java.util"
] | com.redhat.rhn; java.util; | 2,515,020 |
private static Pair<String, Integer> getDisplayName(GalData galDataRow, List<PhoneInfo> phones) {
String displayName = galDataRow.get(GalData.DISPLAY_NAME);
if (!TextUtils.isEmpty(displayName)) {
return Pair.create(displayName, DisplayNameSources.STRUCTURED_NAME);
}
// t... | static Pair<String, Integer> function(GalData galDataRow, List<PhoneInfo> phones) { String displayName = galDataRow.get(GalData.DISPLAY_NAME); if (!TextUtils.isEmpty(displayName)) { return Pair.create(displayName, DisplayNameSources.STRUCTURED_NAME); } final String firstName = galDataRow.get(GalData.FIRST_NAME); final ... | /**
* Try to create a display name from various fields.
*
* @return a display name for contact and its source
*/ | Try to create a display name from various fields | getDisplayName | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "packages/apps/Exchange/src/com/android/exchange/provider/ExchangeDirectoryProvider.java",
"license": "gpl-3.0",
"size": 31308
} | [
"android.provider.ContactsContract",
"android.text.TextUtils",
"android.util.Pair",
"com.android.exchange.provider.GalResult",
"java.util.List"
] | import android.provider.ContactsContract; import android.text.TextUtils; import android.util.Pair; import com.android.exchange.provider.GalResult; import java.util.List; | import android.provider.*; import android.text.*; import android.util.*; import com.android.exchange.provider.*; import java.util.*; | [
"android.provider",
"android.text",
"android.util",
"com.android.exchange",
"java.util"
] | android.provider; android.text; android.util; com.android.exchange; java.util; | 1,439,545 |
@Test
public void testDeleteHeadPacket_OutPacket_EmptyPacket() throws Exception {
PacketQueue queue = new OutPacketQueue();
Response result = Whitebox.invokeMethod(target, "deleteHeadPacket",
queue);
assertThat(result.statusCode, is(Response.NO_CONTENT));
} | void function() throws Exception { PacketQueue queue = new OutPacketQueue(); Response result = Whitebox.invokeMethod(target, STR, queue); assertThat(result.statusCode, is(Response.NO_CONTENT)); } | /**
* Test method for {@link org.o3project.odenos.core.component.network.Network#deleteHeadPacket(PacketQueue)}.
*
* @throws Exception
*/ | Test method for <code>org.o3project.odenos.core.component.network.Network#deleteHeadPacket(PacketQueue)</code> | testDeleteHeadPacket_OutPacket_EmptyPacket | {
"repo_name": "y-higuchi/odenos",
"path": "src/test/java/org/o3project/odenos/core/component/network/NetworkTest.java",
"license": "apache-2.0",
"size": 116642
} | [
"org.hamcrest.CoreMatchers",
"org.junit.Assert",
"org.o3project.odenos.core.component.network.packet.OutPacketQueue",
"org.o3project.odenos.core.component.network.packet.PacketQueue",
"org.o3project.odenos.remoteobject.message.Response",
"org.powermock.reflect.Whitebox"
] | import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.o3project.odenos.core.component.network.packet.OutPacketQueue; import org.o3project.odenos.core.component.network.packet.PacketQueue; import org.o3project.odenos.remoteobject.message.Response; import org.powermock.reflect.Whitebox; | import org.hamcrest.*; import org.junit.*; import org.o3project.odenos.core.component.network.packet.*; import org.o3project.odenos.remoteobject.message.*; import org.powermock.reflect.*; | [
"org.hamcrest",
"org.junit",
"org.o3project.odenos",
"org.powermock.reflect"
] | org.hamcrest; org.junit; org.o3project.odenos; org.powermock.reflect; | 1,632,227 |
protected boolean storeUserInfo(int row) throws RemoteException {
User user = null;
SchoolType schoolType = null;
String schoolClassName = getUserProperty(COLUMN_SCHOOL_CLASS);
if (schoolClassName == null) {
errorLog.put(new Integer(row), "The Class name is empty.");
return false;
}
String schoo... | boolean function(int row) throws RemoteException { User user = null; SchoolType schoolType = null; String schoolClassName = getUserProperty(COLUMN_SCHOOL_CLASS); if (schoolClassName == null) { errorLog.put(new Integer(row), STR); return false; } String schoolYearName = getUserProperty(COLUMN_SCHOOL_YEAR); if (schoolYea... | /**
* Stores one placement.
*/ | Stores one placement | storeUserInfo | {
"repo_name": "idega/platform2",
"path": "src/se/idega/idegaweb/commune/block/importer/business/NackaProgmaPlacementImportFileHandlerBean.java",
"license": "gpl-3.0",
"size": 26897
} | [
"com.idega.block.school.data.SchoolType",
"com.idega.user.data.User",
"java.rmi.RemoteException"
] | import com.idega.block.school.data.SchoolType; import com.idega.user.data.User; import java.rmi.RemoteException; | import com.idega.block.school.data.*; import com.idega.user.data.*; import java.rmi.*; | [
"com.idega.block",
"com.idega.user",
"java.rmi"
] | com.idega.block; com.idega.user; java.rmi; | 2,390,478 |
CompletableFuture<User> findByEmail(String email); | CompletableFuture<User> findByEmail(String email); | /**
* Retrieves the user with the given email from the DynamoDB table.
*
* @param email the email of the user to retrieve
* @return a {@link CompletableFuture} that is eventually completed with the user that was
* requested, or completed exceptionally with a {@link DatabaseException} if the user
... | Retrieves the user with the given email from the DynamoDB table | findByEmail | {
"repo_name": "RohanNagar/thunder",
"path": "application/src/main/java/com/sanctionco/thunder/dao/UsersDao.java",
"license": "mit",
"size": 5557
} | [
"com.sanctionco.thunder.models.User",
"java.util.concurrent.CompletableFuture"
] | import com.sanctionco.thunder.models.User; import java.util.concurrent.CompletableFuture; | import com.sanctionco.thunder.models.*; import java.util.concurrent.*; | [
"com.sanctionco.thunder",
"java.util"
] | com.sanctionco.thunder; java.util; | 2,815,142 |
public interface Restorable extends RestorePolicy {
@Override
default Object doRedirectAttrRestore(HttpServletRequest request, String attrName, Map<String, Object> saveAttrMap) {
return this;
}
} | interface Restorable extends RestorePolicy { default Object function(HttpServletRequest request, String attrName, Map<String, Object> saveAttrMap) { return this; } } | /**
* Invoked just before this object is about to be restored from session attributes to request upon any controller redirect;
* returns the object that should be saved in session, by default <code>this</code>.
* @param request The request
* @param attrName The name o... | Invoked just before this object is about to be restored from session attributes to request upon any controller redirect; returns the object that should be saved in session, by default <code>this</code> | doRedirectAttrRestore | {
"repo_name": "ilscipio/scipio-erp",
"path": "framework/webapp/src/org/ofbiz/webapp/control/RequestAttrPolicy.java",
"license": "apache-2.0",
"size": 60112
} | [
"java.util.Map",
"javax.servlet.http.HttpServletRequest"
] | import java.util.Map; import javax.servlet.http.HttpServletRequest; | import java.util.*; import javax.servlet.http.*; | [
"java.util",
"javax.servlet"
] | java.util; javax.servlet; | 44,961 |
private Collection<ZipStarNode> getChildren(final ZipStarNode node) {
List<ZipStarNode> children = new ArrayList<ZipStarNode>();
for (Node n : node.node.adjacentNodes()) {
if (activeNodes.contains(n)) {
children.add(new ZipStarNode(n, n.directDistanceTo(target)));
}
}
return children;
}
| Collection<ZipStarNode> function(final ZipStarNode node) { List<ZipStarNode> children = new ArrayList<ZipStarNode>(); for (Node n : node.node.adjacentNodes()) { if (activeNodes.contains(n)) { children.add(new ZipStarNode(n, n.directDistanceTo(target))); } } return children; } | /**
* Calculates a set of currently reachable graph nodes from <tt>node</tt>.
* <tt>getChildren()</tt> returns only the active/not evaluated reachable
* nodes. The result set changes as the path search proceeds.
*
* @param node
* @return current list of reachable and active/not visited nodes for a given ... | Calculates a set of currently reachable graph nodes from node. getChildren() returns only the active/not evaluated reachable nodes. The result set changes as the path search proceeds | getChildren | {
"repo_name": "asmyczek/java-zipper",
"path": "examples/com/mu/zipper/examples/zipstar/ZipStar.java",
"license": "bsd-3-clause",
"size": 5686
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.List"
] | import java.util.ArrayList; import java.util.Collection; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 547,928 |
public boolean addAssemblerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); | boolean function(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); | /**
* Adds a Circuit Assembler Recipe
*
* @param aInput1 must be != null
* @param aOutput1 must be != null
* @param aDuration must be > 0
* @param aEUt should be > 0
*/ | Adds a Circuit Assembler Recipe | addAssemblerRecipe | {
"repo_name": "Tictim/TTMPMOD",
"path": "libs_n/gregtech/api/interfaces/internal/IGT_RecipeAdder.java",
"license": "lgpl-2.1",
"size": 20136
} | [
"net.minecraft.item.ItemStack",
"net.minecraftforge.fluids.FluidStack"
] | import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; | import net.minecraft.item.*; import net.minecraftforge.fluids.*; | [
"net.minecraft.item",
"net.minecraftforge.fluids"
] | net.minecraft.item; net.minecraftforge.fluids; | 1,139,184 |
@Override
public void execute(Runnable task) {
if (!executeTask(task)) {
throw new RejectedExecutionException(
"This thread pool is already closed.");
}
}
// AutoCloseable
/**
* Close this thread pool instance.
*
* <p>
* Threads tha... | void function(Runnable task) { if (!executeTask(task)) { throw new RejectedExecutionException( STR); } } /** * Close this thread pool instance. * * <p> * Threads that did not exit within {@link #SHUTDOWN_TIMEOUT} | /**
* Execute the specified task on one of worker threads in the pool.
*
* @param task A task to be executed on this thread pool.
* @throws RejectedExecutionException
* The specified task was rejected.
* @throws NullPointerException
* {@code task} is {@code null}.
*/ | Execute the specified task on one of worker threads in the pool | execute | {
"repo_name": "opendaylight/vtn",
"path": "manager/implementation/src/main/java/org/opendaylight/vtn/manager/internal/util/concurrent/VTNThreadPool.java",
"license": "epl-1.0",
"size": 16958
} | [
"java.util.concurrent.RejectedExecutionException"
] | import java.util.concurrent.RejectedExecutionException; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 1,868,934 |
private void initRecyclerViewItems() {
rvMessages = (RecyclerView) findViewById(R.id.rvMessages);
rvMessages.setLayoutManager(new LinearLayoutManager(this));
//creating your adapter, it could be a custom adapter as well
RecyclerExampleAdapter adapter = new RecyclerExampleAdapter(th... | void function() { rvMessages = (RecyclerView) findViewById(R.id.rvMessages); rvMessages.setLayoutManager(new LinearLayoutManager(this)); RecyclerExampleAdapter adapter = new RecyclerExampleAdapter(this); | /**
* Inits an adapter with items, wrapping your adapter with a {@link AdmobBannerRecyclerAdapterWrapper} and setting the recyclerview to this wrapper
* FIRST OF ALL Please notice that the following code will work on a real devices but emulator!
*/ | Inits an adapter with items, wrapping your adapter with a <code>AdmobBannerRecyclerAdapterWrapper</code> and setting the recyclerview to this wrapper FIRST OF ALL Please notice that the following code will work on a real devices but emulator | initRecyclerViewItems | {
"repo_name": "clockbyte/admobadapter",
"path": "sampleapp/src/main/java/com/clockbyte/admobadapter/sampleapp/banner/MainActivity_RecyclerView_Banner.java",
"license": "apache-2.0",
"size": 5964
} | [
"androidx.recyclerview.widget.LinearLayoutManager",
"androidx.recyclerview.widget.RecyclerView",
"com.clockbyte.admobadapter.sampleapp.RecyclerExampleAdapter"
] | import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.clockbyte.admobadapter.sampleapp.RecyclerExampleAdapter; | import androidx.recyclerview.widget.*; import com.clockbyte.admobadapter.sampleapp.*; | [
"androidx.recyclerview",
"com.clockbyte.admobadapter"
] | androidx.recyclerview; com.clockbyte.admobadapter; | 1,457,350 |
public Read withUsername(String username) {
checkArgument(username != null, "username can not be null");
return builder().setUsername(username).build();
} | Read function(String username) { checkArgument(username != null, STR); return builder().setUsername(username).build(); } | /**
* Define the username to connect to the JMS broker (authenticated).
*/ | Define the username to connect to the JMS broker (authenticated) | withUsername | {
"repo_name": "shakamunyi/beam",
"path": "sdks/java/io/jms/src/main/java/org/apache/beam/sdk/io/jms/JmsIO.java",
"license": "apache-2.0",
"size": 23197
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 758,308 |
private JSplitPane getJSplitPane1() {
if (jSplitPane1 == null) {
jSplitPane1 = new JSplitPane();
jSplitPane1.setDividerLocation(200);
jSplitPane1.setLeftComponent(getJPanel1());
jSplitPane1.setRightComponent(getJTabbedPane());
}
return jSplitPane1;
} | JSplitPane function() { if (jSplitPane1 == null) { jSplitPane1 = new JSplitPane(); jSplitPane1.setDividerLocation(200); jSplitPane1.setLeftComponent(getJPanel1()); jSplitPane1.setRightComponent(getJTabbedPane()); } return jSplitPane1; } | /**
* This method initializes jSplitPane1
*
* @return javax.swing.JSplitPane
*/ | This method initializes jSplitPane1 | getJSplitPane1 | {
"repo_name": "ACS-Community/ACS",
"path": "LGPL/CommonSoftware/acsGUIs/errorBrowser/src/cl/utfsm/acs/ebe/ErrorBrowserEditor.java",
"license": "lgpl-2.1",
"size": 44518
} | [
"javax.swing.JSplitPane"
] | import javax.swing.JSplitPane; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 2,399,108 |
public List<StepMeta> getSteps() {
return steps;
} | List<StepMeta> function() { return steps; } | /**
* Get a list of defined steps in this transformation.
*
* @return an ArrayList of defined steps.
*/ | Get a list of defined steps in this transformation | getSteps | {
"repo_name": "airy-ict/pentaho-kettle",
"path": "engine/src/org/pentaho/di/trans/TransMeta.java",
"license": "apache-2.0",
"size": 219546
} | [
"java.util.List",
"org.pentaho.di.trans.step.StepMeta"
] | import java.util.List; import org.pentaho.di.trans.step.StepMeta; | import java.util.*; import org.pentaho.di.trans.step.*; | [
"java.util",
"org.pentaho.di"
] | java.util; org.pentaho.di; | 457,614 |
public static EntityDeleteOperation delete(String locatorId) {
return new DefaultDeleteOperation(ENTITY_SET, locatorId);
} | static EntityDeleteOperation function(String locatorId) { return new DefaultDeleteOperation(ENTITY_SET, locatorId); } | /**
* Create an operation to delete the given locator.
*
* @param locatorId
* id of locator to delete
* @return the operation
*/ | Create an operation to delete the given locator | delete | {
"repo_name": "flydream2046/azure-sdk-for-java",
"path": "services/azure-media/src/main/java/com/microsoft/windowsazure/services/media/models/Locator.java",
"license": "apache-2.0",
"size": 9393
} | [
"com.microsoft.windowsazure.services.media.entityoperations.DefaultDeleteOperation",
"com.microsoft.windowsazure.services.media.entityoperations.EntityDeleteOperation"
] | import com.microsoft.windowsazure.services.media.entityoperations.DefaultDeleteOperation; import com.microsoft.windowsazure.services.media.entityoperations.EntityDeleteOperation; | import com.microsoft.windowsazure.services.media.entityoperations.*; | [
"com.microsoft.windowsazure"
] | com.microsoft.windowsazure; | 2,144,648 |
EReference getValue_States(); | EReference getValue_States(); | /**
* Returns the meta object for the reference list '{@link org.eclipse.gemoc.trace.commons.model.trace.Value#getStates <em>States</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>States</em>'.
* @see org.eclipse.gemoc.trace.commons.model.trace.V... | Returns the meta object for the reference list '<code>org.eclipse.gemoc.trace.commons.model.trace.Value#getStates States</code>'. | getValue_States | {
"repo_name": "SiriusLab/SiriusAnimator",
"path": "trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/src/org/eclipse/gemoc/trace/commons/model/trace/TracePackage.java",
"license": "epl-1.0",
"size": 52505
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 4,287 |
@ServiceMethod(returns = ReturnType.SINGLE)
public PollerFlux<PollResult<VirtualNetworkGatewayInner>, VirtualNetworkGatewayInner> beginUpdateTagsAsync(
String resourceGroupName, String virtualNetworkGatewayName, Map<String, String> tags) {
Mono<Response<Flux<ByteBuffer>>> mono =
upda... | @ServiceMethod(returns = ReturnType.SINGLE) PollerFlux<PollResult<VirtualNetworkGatewayInner>, VirtualNetworkGatewayInner> function( String resourceGroupName, String virtualNetworkGatewayName, Map<String, String> tags) { Mono<Response<Flux<ByteBuffer>>> mono = updateTagsWithResponseAsync(resourceGroupName, virtualNetwo... | /**
* Updates a virtual network gateway tags.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkGatewayName The name of the virtual network gateway.
* @param tags Resource tags.
* @throws IllegalArgumentException thrown if parameters fail the validation.
... | Updates a virtual network gateway tags | beginUpdateTagsAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/VirtualNetworkGatewaysClientImpl.java",
"license": "mit",
"size": 322151
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.Context",
"com.azure.core.util.polling.PollerFlux",
"com.azure.resourcemanager.network.fluent.models.VirtualNetwork... | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.PollerFlux; import com.azure.resourcemanager.network.fluent.m... | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.network.fluent.models.*; import java.nio.*; import java.util.*; | [
"com.azure.core",
"com.azure.resourcemanager",
"java.nio",
"java.util"
] | com.azure.core; com.azure.resourcemanager; java.nio; java.util; | 2,797,273 |
azure.networks().manager().serviceClient().getVirtualNetworkGateways().listByResourceGroup("rg1", Context.NONE);
} | azure.networks().manager().serviceClient().getVirtualNetworkGateways().listByResourceGroup("rg1", Context.NONE); } | /**
* Sample code: ListVirtualNetworkGatewaysinResourceGroup.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/ | Sample code: ListVirtualNetworkGatewaysinResourceGroup | listVirtualNetworkGatewaysinResourceGroup | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/network/generated/VirtualNetworkGatewaysListByResourceGroupSamples.java",
"license": "mit",
"size": 959
} | [
"com.azure.core.util.Context"
] | import com.azure.core.util.Context; | import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 376,688 |
public String filterResources2() {
String os = amazon2os;
int ram = amazon2ram;
int procs = amazon2procs;
int hd = amazon2harddisk;
for (int i = myNodesAma.size() - 1; i >= 0; i--) {
NodeMetadata node = myNodesAma.get(i);
log.info(node.getHardware().getRam());
log.info(node.getHardware().getPro... | String function() { String os = amazon2os; int ram = amazon2ram; int procs = amazon2procs; int hd = amazon2harddisk; for (int i = myNodesAma.size() - 1; i >= 0; i--) { NodeMetadata node = myNodesAma.get(i); log.info(node.getHardware().getRam()); log.info(node.getHardware().getProcessors().size()); log.info(node.getHard... | /**
* Diese Methode filtert die Ressourcen der zweiten Partition.
* @return null
*/ | Diese Methode filtert die Ressourcen der zweiten Partition | filterResources2 | {
"repo_name": "jenskohler/SeDiCo",
"path": "SeDiCo-webIntegration/src/de/sedico/cloudservices/AmazonCloudService.java",
"license": "agpl-3.0",
"size": 50279
} | [
"org.jclouds.compute.domain.NodeMetadata"
] | import org.jclouds.compute.domain.NodeMetadata; | import org.jclouds.compute.domain.*; | [
"org.jclouds.compute"
] | org.jclouds.compute; | 766,284 |
public DestinationSet destinationSet() {
return this.ds;
} | DestinationSet function() { return this.ds; } | /**
* Returns the destination set in the key.
*
* @return destination set
*/ | Returns the destination set in the key | destinationSet | {
"repo_name": "osinstom/onos",
"path": "apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/storekey/DestinationSetNextObjectiveStoreKey.java",
"license": "apache-2.0",
"size": 2492
} | [
"org.onosproject.segmentrouting.grouphandler.DestinationSet"
] | import org.onosproject.segmentrouting.grouphandler.DestinationSet; | import org.onosproject.segmentrouting.grouphandler.*; | [
"org.onosproject.segmentrouting"
] | org.onosproject.segmentrouting; | 2,264,929 |
EReference getPDIS_AngLod(); | EReference getPDIS_AngLod(); | /**
* Returns the meta object for the reference '{@link gluemodel.substationStandard.LNNodes.LNGroupP.PDIS#getAngLod <em>Ang Lod</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Ang Lod</em>'.
* @see gluemodel.substationStandard.LNNodes.LNGroupP.PDIS#g... | Returns the meta object for the reference '<code>gluemodel.substationStandard.LNNodes.LNGroupP.PDIS#getAngLod Ang Lod</code>'. | getPDIS_AngLod | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/eMoflon/rgse.ttc17.metamodels.src/src/gluemodel/substationStandard/LNNodes/LNGroupP/LNGroupPPackage.java",
"license": "mit",
"size": 291175
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 555,052 |
public TableCellElement getElement() {
return element;
} | TableCellElement function() { return element; } | /**
* Returns the element of the cell.
*
* @return the cell element
*/ | Returns the element of the cell | getElement | {
"repo_name": "jdahlstrom/vaadin.react",
"path": "client/src/main/java/com/vaadin/client/widget/escalator/Cell.java",
"license": "apache-2.0",
"size": 2019
} | [
"com.google.gwt.dom.client.TableCellElement"
] | import com.google.gwt.dom.client.TableCellElement; | import com.google.gwt.dom.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 2,716,857 |
public Timestamp getCreated();
public static final String COLUMNNAME_CreatedBy = "CreatedBy"; | Timestamp function(); public static final String COLUMNNAME_CreatedBy = STR; | /** Get Created.
* Date this record was created
*/ | Get Created. Date this record was created | getCreated | {
"repo_name": "geneos/adempiere",
"path": "base/src/org/compiere/model/I_AD_TreeNodeU2.java",
"license": "gpl-2.0",
"size": 4654
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,532,869 |
public static void verifyParallelism(ExecutionEnvironment env, int expectedParallelism) {
env.setParallelism(2 * expectedParallelism);
Optimizer compiler = new Optimizer(null, new DefaultCostEstimator(), new Configuration());
OptimizedPlan optimizedPlan = compiler.compile(env.createProgramPlan());
List<Pla... | static void function(ExecutionEnvironment env, int expectedParallelism) { env.setParallelism(2 * expectedParallelism); Optimizer compiler = new Optimizer(null, new DefaultCostEstimator(), new Configuration()); OptimizedPlan optimizedPlan = compiler.compile(env.createProgramPlan()); List<PlanNode> queue = new ArrayList<... | /**
* Verify operator parallelism.
*
* @param env the Flink execution environment.
* @param expectedParallelism expected operator parallelism
*/ | Verify operator parallelism | verifyParallelism | {
"repo_name": "tzulitai/flink",
"path": "flink-libraries/flink-gelly/src/test/java/org/apache/flink/graph/generator/TestUtils.java",
"license": "apache-2.0",
"size": 4258
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.flink.api.java.ExecutionEnvironment",
"org.apache.flink.configuration.Configuration",
"org.apache.flink.optimizer.Optimizer",
"org.apache.flink.optimizer.costs.DefaultCostEstimator",
"org.apache.flink.optimizer.plan.Channel",
"org.apache.flink.optim... | import java.util.ArrayList; import java.util.List; import org.apache.flink.api.java.ExecutionEnvironment; import org.apache.flink.configuration.Configuration; import org.apache.flink.optimizer.Optimizer; import org.apache.flink.optimizer.costs.DefaultCostEstimator; import org.apache.flink.optimizer.plan.Channel; import... | import java.util.*; import org.apache.flink.api.java.*; import org.apache.flink.configuration.*; import org.apache.flink.optimizer.*; import org.apache.flink.optimizer.costs.*; import org.apache.flink.optimizer.plan.*; import org.junit.*; | [
"java.util",
"org.apache.flink",
"org.junit"
] | java.util; org.apache.flink; org.junit; | 2,293,767 |
public static Bounds<RowPosition> makeRowBounds(Token left, Token right, IPartitioner partitioner)
{
return new Bounds<RowPosition>(left.minKeyBound(partitioner), right.maxKeyBound(partitioner), partitioner);
} | static Bounds<RowPosition> function(Token left, Token right, IPartitioner partitioner) { return new Bounds<RowPosition>(left.minKeyBound(partitioner), right.maxKeyBound(partitioner), partitioner); } | /**
* Compute a bounds of keys corresponding to a given bounds of token.
*/ | Compute a bounds of keys corresponding to a given bounds of token | makeRowBounds | {
"repo_name": "vcostet/cassandra-kmean",
"path": "src/java/org/apache/cassandra/dht/Bounds.java",
"license": "apache-2.0",
"size": 4392
} | [
"org.apache.cassandra.db.RowPosition"
] | import org.apache.cassandra.db.RowPosition; | import org.apache.cassandra.db.*; | [
"org.apache.cassandra"
] | org.apache.cassandra; | 1,232,665 |
public RowIterator getCsCsi1()
{
return (RowIterator)getAttributeInternal(CSCSI1);
} | RowIterator function() { return (RowIterator)getAttributeInternal(CSCSI1); } | /**
*
* Gets the associated entity oracle.jbo.RowIterator
*/ | Gets the associated entity oracle.jbo.RowIterator | getCsCsi1 | {
"repo_name": "CBIIT/cadsr-util",
"path": "cadsrutil/src/java/gov/nih/nci/ncicb/cadsr/common/persistence/bc4j/CsCsiImpl.java",
"license": "bsd-3-clause",
"size": 10810
} | [
"oracle.jbo.RowIterator"
] | import oracle.jbo.RowIterator; | import oracle.jbo.*; | [
"oracle.jbo"
] | oracle.jbo; | 2,121,541 |
public Constructor<?>[] getConstructors() {
return getDeclaredConstructorsInternal(true);
} | Constructor<?>[] function() { return getDeclaredConstructorsInternal(true); } | /**
* Returns an array containing {@code Constructor} objects for all public
* constructors for this {@code Class}. If there
* are no public constructors or if this {@code Class} represents an array
* class, a primitive type or void then an empty array is returned.
*
* @see #getDeclaredCon... | Returns an array containing Constructor objects for all public constructors for this Class. If there are no public constructors or if this Class represents an array class, a primitive type or void then an empty array is returned | getConstructors | {
"repo_name": "syslover33/ctank",
"path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/java/lang/Class.java",
"license": "gpl-3.0",
"size": 60639
} | [
"java.lang.reflect.Constructor"
] | import java.lang.reflect.Constructor; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 626,202 |
private List<DbChunk> retrieveChunks(DbChunk firstChunk) throws RemoteException {
List<DbChunk> aggregatedChunks = new LinkedList<>();
aggregatedChunks.add(firstChunk);
DbChunk currChunk = firstChunk;
while (currChunk.hasNextID()) {
ParcelUuid parcelUuid = new ParcelUuid(currChunk.getNextID());... | List<DbChunk> function(DbChunk firstChunk) throws RemoteException { List<DbChunk> aggregatedChunks = new LinkedList<>(); aggregatedChunks.add(firstChunk); DbChunk currChunk = firstChunk; while (currChunk.hasNextID()) { ParcelUuid parcelUuid = new ParcelUuid(currChunk.getNextID()); currChunk = dbInterface.getChunk(parce... | /**
* Iterate through the chunks like a linked list, retrieving them one by one from the service
*
* @param firstChunk
* @return
* @throws RemoteException
*/ | Iterate through the chunks like a linked list, retrieving them one by one from the service | retrieveChunks | {
"repo_name": "opendatakit/androidlibrary",
"path": "androidlibrary_lib/src/main/java/org/opendatakit/database/service/InternalUserDbInterfaceAidlWrapperImpl.java",
"license": "apache-2.0",
"size": 68258
} | [
"android.os.ParcelUuid",
"android.os.RemoteException",
"java.util.LinkedList",
"java.util.List"
] | import android.os.ParcelUuid; import android.os.RemoteException; import java.util.LinkedList; import java.util.List; | import android.os.*; import java.util.*; | [
"android.os",
"java.util"
] | android.os; java.util; | 1,143,960 |
public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) {
} | void function(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { } | /**
* Sets the raw JSON object
*
* @param serializer the serializer
* @param json the JSON object to set this object to
*/ | Sets the raw JSON object | setRawObject | {
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/models/TeleconferenceDeviceQuality.java",
"license": "mit",
"size": 4879
} | [
"com.google.gson.JsonObject",
"com.microsoft.graph.serializer.ISerializer",
"javax.annotation.Nonnull"
] | import com.google.gson.JsonObject; import com.microsoft.graph.serializer.ISerializer; import javax.annotation.Nonnull; | import com.google.gson.*; import com.microsoft.graph.serializer.*; import javax.annotation.*; | [
"com.google.gson",
"com.microsoft.graph",
"javax.annotation"
] | com.google.gson; com.microsoft.graph; javax.annotation; | 1,782,547 |
public static NXfilter createNXfilter(long oid) {
return new NXfilterImpl(oid);
} | static NXfilter function(long oid) { return new NXfilterImpl(oid); } | /**
* Create a new NXfilter with the given oid.
*/ | Create a new NXfilter with the given oid | createNXfilter | {
"repo_name": "colinpalmer/dawnsci",
"path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NexusNodeFactory.java",
"license": "epl-1.0",
"size": 25082
} | [
"org.eclipse.dawnsci.nexus.impl.NXfilterImpl"
] | import org.eclipse.dawnsci.nexus.impl.NXfilterImpl; | import org.eclipse.dawnsci.nexus.impl.*; | [
"org.eclipse.dawnsci"
] | org.eclipse.dawnsci; | 306,373 |
IPermission getPermission(); | IPermission getPermission(); | /**
* Get the permission players must have in order to join the arena.
*/ | Get the permission players must have in order to join the arena | getPermission | {
"repo_name": "JCThePants/PV-StarAPI",
"path": "src/com/jcwhatever/pvs/api/arena/IArena.java",
"license": "mit",
"size": 4622
} | [
"com.jcwhatever.nucleus.providers.permissions.IPermission"
] | import com.jcwhatever.nucleus.providers.permissions.IPermission; | import com.jcwhatever.nucleus.providers.permissions.*; | [
"com.jcwhatever.nucleus"
] | com.jcwhatever.nucleus; | 2,495,895 |
@Nullable
private Object handleNullValue(String name, @Nullable Object value, Class<?> paramType) {
if (value == null) {
if (Boolean.TYPE.equals(paramType)) {
return Boolean.FALSE;
}
else if (paramType.isPrimitive()) {
throw new IllegalStateException("Optional " + paramType + " parameter '" + nam... | Object function(String name, @Nullable Object value, Class<?> paramType) { if (value == null) { if (Boolean.TYPE.equals(paramType)) { return Boolean.FALSE; } else if (paramType.isPrimitive()) { throw new IllegalStateException(STR + paramType + STR + name + STR + STR + STR); } } return value; } | /**
* One last chance to handle a possible null value.
* Specifically for booleans method parameters, use {@link Boolean#FALSE}.
* Also raise an ISE for primitive types.
*/ | One last chance to handle a possible null value. Specifically for booleans method parameters, use <code>Boolean#FALSE</code>. Also raise an ISE for primitive types | handleNullValue | {
"repo_name": "spring-projects/spring-framework",
"path": "spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/AbstractNamedValueMethodArgumentResolver.java",
"license": "apache-2.0",
"size": 10036
} | [
"org.springframework.lang.Nullable"
] | import org.springframework.lang.Nullable; | import org.springframework.lang.*; | [
"org.springframework.lang"
] | org.springframework.lang; | 2,008,568 |
boolean isValidInContext(PsiElement element); | boolean isValidInContext(PsiElement element); | /**
* Checks if given tag is valid in the context. In this context tag will be suggested in completion.
* If it is invalid in given context then it will be highlighted.
*
* @param element element which owns JavaDoc (for example {@link com.intellij.psi.PsiMethod})
*/ | Checks if given tag is valid in the context. In this context tag will be suggested in completion. If it is invalid in given context then it will be highlighted | isValidInContext | {
"repo_name": "smmribeiro/intellij-community",
"path": "java/java-psi-api/src/com/intellij/psi/javadoc/JavadocTagInfo.java",
"license": "apache-2.0",
"size": 1520
} | [
"com.intellij.psi.PsiElement"
] | import com.intellij.psi.PsiElement; | import com.intellij.psi.*; | [
"com.intellij.psi"
] | com.intellij.psi; | 272,028 |
public ResultSet executeQuery(final String query) throws SQLException {
// logger.debug("Query to SQLite: " + query);
return getStatment().executeQuery(query);
} | ResultSet function(final String query) throws SQLException { return getStatment().executeQuery(query); } | /**
* Executes an SQL query as a new Statement.
*
* @param query
* an SQL statement to be sent to the database, typically a
* static SQL SELECT statement
*
* @return a ResultSet object that contains the data produced by the given
* query; never null
* @throws SQLExcepti... | Executes an SQL query as a new Statement | executeQuery | {
"repo_name": "schnatterer/songbirdDbApi4j",
"path": "src/main/java/info/schnatterer/songbirddbapi4j/SongbirdDbConnection.java",
"license": "apache-2.0",
"size": 5753
} | [
"java.sql.ResultSet",
"java.sql.SQLException"
] | import java.sql.ResultSet; import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,534,546 |
public static void addStatements (CompoundStatement cmpstmt, List<Statement> listStatementsToAdd)
{
for (Statement stmt : listStatementsToAdd)
cmpstmt.addStatement (stmt);
} | static void function (CompoundStatement cmpstmt, List<Statement> listStatementsToAdd) { for (Statement stmt : listStatementsToAdd) cmpstmt.addStatement (stmt); } | /**
* Appends the statements in <code>listStatementsToAdd</code> to the
* compound statement <code>cmpstmt</code>.
*
* @param cmpstmt
* The compound statement to which to add the statements in
* <code>rgStatementsToAdd</code>
* @param listStatementsToAdd
* The list of s... | Appends the statements in <code>listStatementsToAdd</code> to the compound statement <code>cmpstmt</code> | addStatements | {
"repo_name": "intersense/patus-gw",
"path": "src/ch/unibas/cs/hpwc/patus/util/CodeGeneratorUtil.java",
"license": "lgpl-2.1",
"size": 17902
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,079,756 |
public void setOutlinePaint(Paint paint) {
if (paint == null) {
throw new IllegalArgumentException("Null 'paint' argument.");
}
this.outlinePaint = paint;
notifyListeners(new DialLayerChangeEvent(this));
} | void function(Paint paint) { if (paint == null) { throw new IllegalArgumentException(STR); } this.outlinePaint = paint; notifyListeners(new DialLayerChangeEvent(this)); } | /**
* Sets the paint used to draw the outline of the cap and sends a
* {@link DialLayerChangeEvent} to all registered listeners.
*
* @param paint the paint (<code>null</code> not permitted).
*
* @see #getOutlinePaint()
*/ | Sets the paint used to draw the outline of the cap and sends a <code>DialLayerChangeEvent</code> to all registered listeners | setOutlinePaint | {
"repo_name": "integrated/jfreechart",
"path": "source/org/jfree/chart/plot/dial/DialCap.java",
"license": "lgpl-2.1",
"size": 10384
} | [
"java.awt.Paint"
] | import java.awt.Paint; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,182,944 |
public ValueFormatter getDefaultValueFormatter() {
return mDefaultFormatter;
} | ValueFormatter function() { return mDefaultFormatter; } | /**
* Returns the default ValueFormatter that has been determined by the chart
* considering the provided minimum and maximum values.
*
* @return
*/ | Returns the default ValueFormatter that has been determined by the chart considering the provided minimum and maximum values | getDefaultValueFormatter | {
"repo_name": "CarpOrange/CarpDoctor",
"path": "MPChartLib/src/com/github/mikephil/charting/charts/Chart.java",
"license": "apache-2.0",
"size": 47412
} | [
"com.github.mikephil.charting.utils.ValueFormatter"
] | import com.github.mikephil.charting.utils.ValueFormatter; | import com.github.mikephil.charting.utils.*; | [
"com.github.mikephil"
] | com.github.mikephil; | 273,458 |
T visitExpression(@NotNull JavaParser.ExpressionContext ctx); | T visitExpression(@NotNull JavaParser.ExpressionContext ctx); | /**
* Visit a parse tree produced by {@link JavaParser#expression}.
* @param ctx the parse tree
* @return the visitor result
*/ | Visit a parse tree produced by <code>JavaParser#expression</code> | visitExpression | {
"repo_name": "hgkmail/HelloJava",
"path": "src/cn/hgk/hellojava/JavaVisitor.java",
"license": "gpl-2.0",
"size": 22753
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 2,380,640 |
public static List<ResponseTypeReference> getResponseDomainReferenceList() {
List<ResponseTypeReference> responseDomainReferenceList = new ArrayList<ResponseTypeReference>();
responseDomainReferenceList.add(new ResponseTypeReference(
RESPONSE_TYPE_LABELS[ResponseType.UNDEFINED.ordinal()],
ResponseType.U... | static List<ResponseTypeReference> function() { List<ResponseTypeReference> responseDomainReferenceList = new ArrayList<ResponseTypeReference>(); responseDomainReferenceList.add(new ResponseTypeReference( RESPONSE_TYPE_LABELS[ResponseType.UNDEFINED.ordinal()], ResponseType.UNDEFINED)); responseDomainReferenceList.add(n... | /**
* Return list of Response Domain references
*
* @return List<ResponseDomainReference>
*/ | Return list of Response Domain references | getResponseDomainReferenceList | {
"repo_name": "DdiEditor/ddieditor-model",
"path": "src/org/ddialliance/ddieditor/ui/model/question/Response.java",
"license": "lgpl-3.0",
"size": 5904
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,536,406 |
public static long getSumIgnoreNegatives(List<Long> vals) {
long result = 0;
for (Long l : vals) {
if (l > 0) {
result = safeAdd(result, l);
}
}
return result;
} | static long function(List<Long> vals) { long result = 0; for (Long l : vals) { if (l > 0) { result = safeAdd(result, l); } } return result; } | /**
* Get sum of all values in the list that are >0
* @param vals
* - list of values
* @return sum
*/ | Get sum of all values in the list that are >0 | getSumIgnoreNegatives | {
"repo_name": "vergilchiu/hive",
"path": "ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java",
"license": "apache-2.0",
"size": 68077
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,575,561 |
private JScrollPane getJScrollPane() {
if (jScrollPane == null) {
jScrollPane = new JScrollPane();
jScrollPane.setViewportView(getNotes());
}
return jScrollPane;
} | JScrollPane function() { if (jScrollPane == null) { jScrollPane = new JScrollPane(); jScrollPane.setViewportView(getNotes()); } return jScrollPane; } | /**
* This method initializes jScrollPane
*
* @return javax.swing.JScrollPane
*/ | This method initializes jScrollPane | getJScrollPane | {
"repo_name": "NCIP/cagrid",
"path": "cagrid/Software/core/caGrid/projects/gaards-ui/src/org/cagrid/gaards/ui/dorian/federation/UserCertificateWindow.java",
"license": "bsd-3-clause",
"size": 19407
} | [
"javax.swing.JScrollPane"
] | import javax.swing.JScrollPane; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 2,905,885 |
public static void assertXpathsNotEqual(String controlXpath,
String testXpath,
String inXMLString)
throws SAXException, IOException, XpathException {
assertXpathsNotEqual(controlXpath, testXpath,
... | static void function(String controlXpath, String testXpath, String inXMLString) throws SAXException, IOException, XpathException { assertXpathsNotEqual(controlXpath, testXpath, XMLUnit.buildControlDocument(inXMLString)); } | /**
* Assert that the node lists of two Xpaths in the same XML string are NOT
* equal
* @param controlXpath
* @param testXpath
* @param inXMLString
* @throws SAXException
* @throws IOException
*/ | Assert that the node lists of two Xpaths in the same XML string are NOT equal | assertXpathsNotEqual | {
"repo_name": "xmlunit/xmlunit",
"path": "xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java",
"license": "apache-2.0",
"size": 47140
} | [
"java.io.IOException",
"org.custommonkey.xmlunit.exceptions.XpathException",
"org.xml.sax.SAXException"
] | import java.io.IOException; import org.custommonkey.xmlunit.exceptions.XpathException; import org.xml.sax.SAXException; | import java.io.*; import org.custommonkey.xmlunit.exceptions.*; import org.xml.sax.*; | [
"java.io",
"org.custommonkey.xmlunit",
"org.xml.sax"
] | java.io; org.custommonkey.xmlunit; org.xml.sax; | 314,448 |
public static Matcher<java.lang.String> endsWith(final java.lang.String suffix) {
return org.hamcrest.core.StringEndsWith.endsWith(suffix);
} | static Matcher<java.lang.String> function(final java.lang.String suffix) { return org.hamcrest.core.StringEndsWith.endsWith(suffix); } | /**
* Creates a matcher that matches if the examined {@link String} ends with the specified
* {@link String}.
* <p/>
* For example:
* <pre>assertThat("myStringOfNote", endsWith("Note"))</pre>
*
* @param suffix
* the substring that the returned matcher will expect at the end of any examined ... | Creates a matcher that matches if the examined <code>String</code> ends with the specified <code>String</code>. For example: <code>assertThat("myStringOfNote", endsWith("Note"))</code> | endsWith | {
"repo_name": "gv2011/util",
"path": "testutil/src/main/java/com/github/gv2011/testutil/Matchers.java",
"license": "mit",
"size": 65674
} | [
"org.hamcrest.Matcher"
] | import org.hamcrest.Matcher; | import org.hamcrest.*; | [
"org.hamcrest"
] | org.hamcrest; | 1,123,425 |
private void setupPermissions() {
// If we don't have the record audio permission...
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
// And if we're on SDK M or later...
if (Build.VERSION.SDK_INT >= Build.... | void function() { if (ActivityCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { String[] permissionsWeNeed = new String[]{ Manifest.permission.RECORD_AUDIO }; requestPermissions(permissionsWeNeed, MY_PERMISSIO... | /**
* App Permissions for Audio
**/ | App Permissions for Audio | setupPermissions | {
"repo_name": "f1dz/ud851-Exercises",
"path": "Lesson06-Visualizer-Preferences/T06.01-Exercise-SetupTheActivity/app/src/main/java/android/example/com/visualizerpreferences/VisualizerActivity.java",
"license": "apache-2.0",
"size": 5085
} | [
"android.content.pm.PackageManager",
"android.example.com.visualizerpreferences.AudioVisuals",
"android.os.Build",
"android.support.v4.app.ActivityCompat"
] | import android.content.pm.PackageManager; import android.example.com.visualizerpreferences.AudioVisuals; import android.os.Build; import android.support.v4.app.ActivityCompat; | import android.content.pm.*; import android.example.com.visualizerpreferences.*; import android.os.*; import android.support.v4.app.*; | [
"android.content",
"android.example",
"android.os",
"android.support"
] | android.content; android.example; android.os; android.support; | 110,359 |
Cause getCause(); | Cause getCause(); | /**
* Gets the cause of this {@link DamageModifier}.
*
* @return The cause of this damage modifier
*/ | Gets the cause of this <code>DamageModifier</code> | getCause | {
"repo_name": "Kiskae/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/event/cause/entity/damage/DamageModifier.java",
"license": "mit",
"size": 2049
} | [
"org.spongepowered.api.event.cause.Cause"
] | import org.spongepowered.api.event.cause.Cause; | import org.spongepowered.api.event.cause.*; | [
"org.spongepowered.api"
] | org.spongepowered.api; | 70,548 |
public boolean sync() {
if (ulog == null) {
return false;
}
log.info(msg() + "START replicas=" + replicas + " nUpdates=" + nUpdates);
// TODO: does it ever make sense to allow sync when buffering or applying buffered? Someone might request that we do it...
if (!(ulog.getState() == UpdateL... | boolean function() { if (ulog == null) { return false; } log.info(msg() + STR + replicas + STR + nUpdates); if (!(ulog.getState() == UpdateLog.State.ACTIVE ulog.getState()==UpdateLog.State.REPLAYING)) { log.error(msg() + STR + ulog); } if (debug) { if (startingVersions != null) { log.debug(msg() + STR + startingVersion... | /** Returns true if peer sync was successful, meaning that this core may not be considered to have the latest updates
* when considering the last N updates between it and it's peers.
* A commit is not performed.
*/ | Returns true if peer sync was successful, meaning that this core may not be considered to have the latest updates when considering the last N updates between it and it's peers. A commit is not performed | sync | {
"repo_name": "terrancesnyder/solr-analytics",
"path": "solr/core/src/java/org/apache/solr/update/PeerSync.java",
"license": "apache-2.0",
"size": 20877
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.HashSet",
"java.util.List",
"org.apache.solr.handler.component.ShardResponse"
] | import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import org.apache.solr.handler.component.ShardResponse; | import java.util.*; import org.apache.solr.handler.component.*; | [
"java.util",
"org.apache.solr"
] | java.util; org.apache.solr; | 2,425,950 |
@Test
public void testUpdate() {
Network before = dao.getByName(EXISTING_NETWORK_NAME1);
before.setDescription("This is a completely changed description");
dao.update(before);
Network after = dao.getByName(EXISTING_NETWORK_NAME1);
assertNotNull(after);
assertE... | void function() { Network before = dao.getByName(EXISTING_NETWORK_NAME1); before.setDescription(STR); dao.update(before); Network after = dao.getByName(EXISTING_NETWORK_NAME1); assertNotNull(after); assertEquals(before, after); } | /**
* Ensures updating a network works as expected.
*/ | Ensures updating a network works as expected | testUpdate | {
"repo_name": "OpenUniversity/ovirt-engine",
"path": "backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/network/NetworkDaoTest.java",
"license": "apache-2.0",
"size": 12422
} | [
"org.junit.Assert",
"org.ovirt.engine.core.common.businessentities.network.Network"
] | import org.junit.Assert; import org.ovirt.engine.core.common.businessentities.network.Network; | import org.junit.*; import org.ovirt.engine.core.common.businessentities.network.*; | [
"org.junit",
"org.ovirt.engine"
] | org.junit; org.ovirt.engine; | 2,304,676 |
public static void assertCompoundSegments(SolrCore core, boolean compound) {
RefCounted<SolrIndexSearcher> searcherRef = core.getRegisteredSearcher();
try {
assertCompoundSegments(searcherRef.get().getRawReader(), compound);
} finally {
searcherRef.decref();
}
} | static void function(SolrCore core, boolean compound) { RefCounted<SolrIndexSearcher> searcherRef = core.getRegisteredSearcher(); try { assertCompoundSegments(searcherRef.get().getRawReader(), compound); } finally { searcherRef.decref(); } } | /**
* Given an SolrCore, asserts that each segment in the (searchable) index has a compound file
* status that matches the expected input.
*/ | Given an SolrCore, asserts that each segment in the (searchable) index has a compound file status that matches the expected input | assertCompoundSegments | {
"repo_name": "apache/solr",
"path": "solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java",
"license": "apache-2.0",
"size": 10550
} | [
"org.apache.solr.search.SolrIndexSearcher",
"org.apache.solr.util.RefCounted"
] | import org.apache.solr.search.SolrIndexSearcher; import org.apache.solr.util.RefCounted; | import org.apache.solr.search.*; import org.apache.solr.util.*; | [
"org.apache.solr"
] | org.apache.solr; | 1,558,342 |
public void addExtraClasses(Map<Class<?>, String> classMap, Class<?> clazz, Annotation annotation) {
RepositoryPlugin repositoryPlugin = (RepositoryPlugin) annotation;
classMap.put(RepositoryMeta.class, repositoryPlugin.metaClass());
} | void function(Map<Class<?>, String> classMap, Class<?> clazz, Annotation annotation) { RepositoryPlugin repositoryPlugin = (RepositoryPlugin) annotation; classMap.put(RepositoryMeta.class, repositoryPlugin.metaClass()); } | /**
* Extract extra classes information from a plugin annotation.
*
* @param classMap
* @param annotation
*/ | Extract extra classes information from a plugin annotation | addExtraClasses | {
"repo_name": "bsspirit/kettle-4.4.0-stable",
"path": "src/org/pentaho/di/core/plugins/RepositoryPluginType.java",
"license": "apache-2.0",
"size": 5423
} | [
"java.lang.annotation.Annotation",
"java.util.Map",
"org.pentaho.di.core.annotations.RepositoryPlugin",
"org.pentaho.di.repository.RepositoryMeta"
] | import java.lang.annotation.Annotation; import java.util.Map; import org.pentaho.di.core.annotations.RepositoryPlugin; import org.pentaho.di.repository.RepositoryMeta; | import java.lang.annotation.*; import java.util.*; import org.pentaho.di.core.annotations.*; import org.pentaho.di.repository.*; | [
"java.lang",
"java.util",
"org.pentaho.di"
] | java.lang; java.util; org.pentaho.di; | 600,593 |
@Test
public void getNumeratorDenominatorPair_NONEXISTENT1() {
try {
User nonExistentUser = cloneNonExistentUser();
Geography validGeography = cloneValidGeography();
HealthTheme validHealthTheme = cloneValidHealthTheme();
rifStudySubmissionService.getNumeratorDenominatorPairs(
nonExistentUse... | void function() { try { User nonExistentUser = cloneNonExistentUser(); Geography validGeography = cloneValidGeography(); HealthTheme validHealthTheme = cloneValidHealthTheme(); rifStudySubmissionService.getNumeratorDenominatorPairs( nonExistentUser, validGeography, validHealthTheme); fail(); } catch(RIFServiceException... | /**
* Gets the numerator denominator pair e3.
*
* @return the numerator denominator pair e3
*/ | Gets the numerator denominator pair e3 | getNumeratorDenominatorPair_NONEXISTENT1 | {
"repo_name": "smallAreaHealthStatisticsUnit/rapidInquiryFacility",
"path": "rifServices/src/test/java/org/sahsu/rif/services/test/services/pg/GetNumeratorDenominatorPair.java",
"license": "lgpl-3.0",
"size": 10815
} | [
"org.junit.Assert",
"org.sahsu.rif.generic.concepts.User",
"org.sahsu.rif.generic.system.RIFGenericLibraryError",
"org.sahsu.rif.generic.system.RIFServiceException",
"org.sahsu.rif.services.concepts.Geography",
"org.sahsu.rif.services.concepts.HealthTheme"
] | import org.junit.Assert; import org.sahsu.rif.generic.concepts.User; import org.sahsu.rif.generic.system.RIFGenericLibraryError; import org.sahsu.rif.generic.system.RIFServiceException; import org.sahsu.rif.services.concepts.Geography; import org.sahsu.rif.services.concepts.HealthTheme; | import org.junit.*; import org.sahsu.rif.generic.concepts.*; import org.sahsu.rif.generic.system.*; import org.sahsu.rif.services.concepts.*; | [
"org.junit",
"org.sahsu.rif"
] | org.junit; org.sahsu.rif; | 2,247,383 |
@Override()
public java.lang.Class getJavaClass(
) {
return org.chocolate_milk.model.CreditMemoQueryChoice.class;
} | @Override() java.lang.Class function( ) { return org.chocolate_milk.model.CreditMemoQueryChoice.class; } | /**
* Method getJavaClass.
*
* @return the Java class represented by this descriptor.
*/ | Method getJavaClass | getJavaClass | {
"repo_name": "galleon1/chocolate-milk",
"path": "src/org/chocolate_milk/model/descriptors/CreditMemoQueryChoiceDescriptor.java",
"license": "lgpl-3.0",
"size": 13049
} | [
"org.chocolate_milk.model.CreditMemoQueryChoice"
] | import org.chocolate_milk.model.CreditMemoQueryChoice; | import org.chocolate_milk.model.*; | [
"org.chocolate_milk.model"
] | org.chocolate_milk.model; | 2,404,678 |
public OvhItem cart_cartId_sslGateway_POST(String cartId, String duration, String planCode, String pricingMode, Long quantity) throws IOException {
String qPath = "/order/cart/{cartId}/sslGateway";
StringBuilder sb = path(qPath, cartId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "d... | OvhItem function(String cartId, String duration, String planCode, String pricingMode, Long quantity) throws IOException { String qPath = STR; StringBuilder sb = path(qPath, cartId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, STR, duration); addBody(o, STR, planCode); addBody(o, STR, pricingMod... | /**
* Post a new SSL Gateway item in your cart
*
* REST: POST /order/cart/{cartId}/sslGateway
* @param cartId [required] Cart identifier
* @param planCode [required] Identifier of the SSL Gateway offer
* @param duration [required] Duration selected for the purchase of the product
* @param pricingMode [req... | Post a new SSL Gateway item in your cart | cart_cartId_sslGateway_POST | {
"repo_name": "UrielCh/ovh-java-sdk",
"path": "ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java",
"license": "bsd-3-clause",
"size": 511080
} | [
"java.io.IOException",
"java.util.HashMap",
"net.minidev.ovh.api.order.cart.OvhItem"
] | import java.io.IOException; import java.util.HashMap; import net.minidev.ovh.api.order.cart.OvhItem; | import java.io.*; import java.util.*; import net.minidev.ovh.api.order.cart.*; | [
"java.io",
"java.util",
"net.minidev.ovh"
] | java.io; java.util; net.minidev.ovh; | 1,423,339 |
private boolean updateMonetizationPlan(SubscriptionPolicy subPolicy) throws APIManagementException {
Monetization monetizationImplementation = getMonetizationImplClass();
if (monetizationImplementation != null) {
try {
return monetizationImplementation.updateBillingPlan(... | boolean function(SubscriptionPolicy subPolicy) throws APIManagementException { Monetization monetizationImplementation = getMonetizationImplClass(); if (monetizationImplementation != null) { try { return monetizationImplementation.updateBillingPlan(subPolicy); } catch (MonetizationException e) { APIUtil.handleException... | /**
* This methods updates the monetization plan for a given subscription policy
*
* @param subPolicy subscription policy
* @return true if successful, false otherwise
* @throws APIManagementException if failed to update the plan
*/ | This methods updates the monetization plan for a given subscription policy | updateMonetizationPlan | {
"repo_name": "Rajith90/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java",
"license": "apache-2.0",
"size": 520854
} | [
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.api.MonetizationException",
"org.wso2.carbon.apimgt.api.model.Monetization",
"org.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy",
"org.wso2.carbon.apimgt.impl.utils.APIUtil"
] | import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.MonetizationException; import org.wso2.carbon.apimgt.api.model.Monetization; import org.wso2.carbon.apimgt.api.model.policy.SubscriptionPolicy; import org.wso2.carbon.apimgt.impl.utils.APIUtil; | import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.api.model.policy.*; import org.wso2.carbon.apimgt.impl.utils.*; | [
"org.wso2.carbon"
] | org.wso2.carbon; | 707,917 |
public String getAsString(String charset) throws UnsupportedEncodingException {
return info.getString(charset);
}
| String function(String charset) throws UnsupportedEncodingException { return info.getString(charset); } | /**
* Returns the uploaded file as a string, using the specified character set.
*
* @param charset
* the character set to use for decoding the file content.
* @return
* the uploaded file as a string, using the specified character set.
* @throws UnsupportedEncodingException
* if the specified cha... | Returns the uploaded file as a string, using the specified character set | getAsString | {
"repo_name": "dihedron/dihedron-strutlets",
"path": "dihedron-strutlets/src/main/java/org/dihedron/strutlets/upload/UploadedFile.java",
"license": "lgpl-3.0",
"size": 5938
} | [
"java.io.UnsupportedEncodingException"
] | import java.io.UnsupportedEncodingException; | import java.io.*; | [
"java.io"
] | java.io; | 2,247,399 |
@Test(timeout = 120000)
public void testValidCredentials() throws Exception {
String serverPrincipal = hostServerPrincipal.substring(0, hostServerPrincipal.lastIndexOf("@"));
Map<String, String> authConfigs = new HashMap<String, String>();
authConfigs.put(QuorumAuth.QUORUM_SASL_AUTH_ENAB... | @Test(timeout = 120000) void function() throws Exception { String serverPrincipal = hostServerPrincipal.substring(0, hostServerPrincipal.lastIndexOf("@")); Map<String, String> authConfigs = new HashMap<String, String>(); authConfigs.put(QuorumAuth.QUORUM_SASL_AUTH_ENABLED, "true"); authConfigs.put(QuorumAuth.QUORUM_SER... | /**
* Test to verify that server is able to start with valid credentials
*/ | Test to verify that server is able to start with valid credentials | testValidCredentials | {
"repo_name": "shayhatsor/zookeeper",
"path": "src/java/test/org/apache/zookeeper/server/quorum/auth/QuorumKerberosHostBasedAuthTest.java",
"license": "apache-2.0",
"size": 8965
} | [
"java.util.HashMap",
"java.util.Map",
"org.apache.zookeeper.CreateMode",
"org.apache.zookeeper.ZooDefs",
"org.apache.zookeeper.ZooKeeper",
"org.apache.zookeeper.test.ClientBase",
"org.junit.Test"
] | import java.util.HashMap; import java.util.Map; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.ZooDefs; import org.apache.zookeeper.ZooKeeper; import org.apache.zookeeper.test.ClientBase; import org.junit.Test; | import java.util.*; import org.apache.zookeeper.*; import org.apache.zookeeper.test.*; import org.junit.*; | [
"java.util",
"org.apache.zookeeper",
"org.junit"
] | java.util; org.apache.zookeeper; org.junit; | 967,601 |
public static void deleteEntity(Key key) {
logger.log(Level.INFO, "Deleting entity");
Transaction txn = datastore.beginTransaction();
try {
datastore.delete(key);
txn.commit();
} finally {
if (txn.isActive()) {
txn.rollback();
} else {
deleteFromCache(key);
}
}
}
| static void function(Key key) { logger.log(Level.INFO, STR); Transaction txn = datastore.beginTransaction(); try { datastore.delete(key); txn.commit(); } finally { if (txn.isActive()) { txn.rollback(); } else { deleteFromCache(key); } } } | /**
* Delete the entity from persistent store represented by the key
* Also delete it from cache
*
* @param key
* : key to delete the entity from the persistent store
*/ | Delete the entity from persistent store represented by the key Also delete it from cache | deleteEntity | {
"repo_name": "LookThisCode/DeveloperBus",
"path": "Season 2013/Bogota/Projects/Agronome_Grupo9/backend/agronome/src/co/com/agronome/proveedores/servlet/Util.java",
"license": "apache-2.0",
"size": 10052
} | [
"com.google.appengine.api.datastore.Key",
"com.google.appengine.api.datastore.Transaction",
"java.util.logging.Level"
] | import com.google.appengine.api.datastore.Key; import com.google.appengine.api.datastore.Transaction; import java.util.logging.Level; | import com.google.appengine.api.datastore.*; import java.util.logging.*; | [
"com.google.appengine",
"java.util"
] | com.google.appengine; java.util; | 349,430 |
SourcePage load(File.Owner fileOwner, PageIdentifier id) throws IOException; | SourcePage load(File.Owner fileOwner, PageIdentifier id) throws IOException; | /**
* Physically position the open file or sheet for loading and
* return the page for reading. Throw an exception if the file or
* sheet can't be positioned either physically or logically.
*/ | Physically position the open file or sheet for loading and return the page for reading. Throw an exception if the file or sheet can't be positioned either physically or logically | load | {
"repo_name": "rdesantis/hauldata",
"path": "dbpa/src/main/java/com/hauldata/dbpa/file/SourcePage.java",
"license": "apache-2.0",
"size": 4163
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,304,269 |
public static Map<String, Object> findPartyById(DispatchContext ctx, Map<String, Object> context) {
Delegator delegator = ctx.getDelegator();
String idToFind = (String) context.get("idToFind");
String partyIdentificationTypeId = (String) context.get("partyIdentificationTypeId");
Stri... | static Map<String, Object> function(DispatchContext ctx, Map<String, Object> context) { Delegator delegator = ctx.getDelegator(); String idToFind = (String) context.get(STR); String partyIdentificationTypeId = (String) context.get(STR); String searchPartyFirstContext = (String) context.get(STR); String searchAllIdConte... | /**
* Finds partyId(s) corresponding to a party reference, partyId or a GoodIdentification idValue
* @param ctx the dispatch context
* @param context use to search with partyId or goodIdentification.idValue
* @return a GenericValue with a partyId and a List of complementary partyId found
*/ | Finds partyId(s) corresponding to a party reference, partyId or a GoodIdentification idValue | findPartyById | {
"repo_name": "gildaslemoal/elpi",
"path": "applications/party/src/org/ofbiz/party/party/PartyServices.java",
"license": "gpl-2.0",
"size": 112446
} | [
"java.util.List",
"java.util.Map",
"org.ofbiz.base.util.Debug",
"org.ofbiz.base.util.UtilValidate",
"org.ofbiz.entity.Delegator",
"org.ofbiz.entity.GenericEntityException",
"org.ofbiz.entity.GenericValue",
"org.ofbiz.entity.util.EntityUtil",
"org.ofbiz.service.DispatchContext",
"org.ofbiz.service.... | import java.util.List; import java.util.Map; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.service.DispatchConte... | import java.util.*; import org.ofbiz.base.util.*; import org.ofbiz.entity.*; import org.ofbiz.entity.util.*; import org.ofbiz.service.*; | [
"java.util",
"org.ofbiz.base",
"org.ofbiz.entity",
"org.ofbiz.service"
] | java.util; org.ofbiz.base; org.ofbiz.entity; org.ofbiz.service; | 2,342,394 |
static void removeStatementListener(AS400JDBCStatementListener listener)
{
if (listener != null) statementListeners_.remove(listener);
}
JDSQLStatement(String sql) throws SQLException
{
// decimalSeparator is "" because we only need it if convert is true
// this construct... | static void removeStatementListener(AS400JDBCStatementListener listener) { if (listener != null) statementListeners_.remove(listener); } JDSQLStatement(String sql) throws SQLException { this(sql, STRSQL statement modified. Result: STRSTRSAVEPOINTSTR)STR, ?\n\r\tSTR?STRsqlSTR.STR/STR') == -1 && separatorPos > 0 && separ... | /**
* Removes an AS400JDBCStatementListener.
**/ | Removes an AS400JDBCStatementListener | removeStatementListener | {
"repo_name": "devjunix/libjt400-java",
"path": "src/com/ibm/as400/access/JDSQLStatement.java",
"license": "epl-1.0",
"size": 52429
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,797,557 |
public static NotificationInfo of(TopicName topic) {
return newBuilder(topic).build();
} | static NotificationInfo function(TopicName topic) { return newBuilder(topic).build(); } | /**
* Creates a {@code NotificationInfo} object for the provided topic name.
*/ | Creates a NotificationInfo object for the provided topic name | of | {
"repo_name": "mbrukman/gcloud-java",
"path": "google-cloud-notification/src/main/java/com/google/cloud/notification/NotificationInfo.java",
"license": "apache-2.0",
"size": 9244
} | [
"com.google.pubsub.v1.TopicName"
] | import com.google.pubsub.v1.TopicName; | import com.google.pubsub.v1.*; | [
"com.google.pubsub"
] | com.google.pubsub; | 1,092,672 |
public Optional<SubjectEntity> getDefault() {
return this.get(GlowstonePermissionService.SUBJECT_DEFAULT);
} | Optional<SubjectEntity> function() { return this.get(GlowstonePermissionService.SUBJECT_DEFAULT); } | /**
* Get the default SubjectEntity
*
* @return Optional<SubjectEntity>
*/ | Get the default SubjectEntity | getDefault | {
"repo_name": "glowstone-io/Glowstone",
"path": "src/main/java/com/github/glowstone/io/core/persistence/repositories/SubjectRepository.java",
"license": "mit",
"size": 5513
} | [
"com.github.glowstone.io.core.entities.SubjectEntity",
"com.github.glowstone.io.core.permissions.GlowstonePermissionService",
"java.util.Optional"
] | import com.github.glowstone.io.core.entities.SubjectEntity; import com.github.glowstone.io.core.permissions.GlowstonePermissionService; import java.util.Optional; | import com.github.glowstone.io.core.entities.*; import com.github.glowstone.io.core.permissions.*; import java.util.*; | [
"com.github.glowstone",
"java.util"
] | com.github.glowstone; java.util; | 2,133,745 |
public String getRelativeInstallationPath(PackageId id) {
StringBuilder b = new StringBuilder("/");
if (id.getGroup().length() > 0) {
b.append(id.getGroup());
b.append("/");
}
b.append(id.getName());
String v = id.getVersion().toString();
if (v... | String function(PackageId id) { StringBuilder b = new StringBuilder("/"); if (id.getGroup().length() > 0) { b.append(id.getGroup()); b.append("/"); } b.append(id.getName()); String v = id.getVersion().toString(); if (v.length() > 0) { b.append("-").append(v); } return b.toString(); } | /**
* Returns the relative path of this package. please note that since 2.3 this also
* includes the version, but never the extension (.zip).
*
* @param id the package id
* @return the relative path of this package
* @since 2.2
*/ | Returns the relative path of this package. please note that since 2.3 this also includes the version, but never the extension (.zip) | getRelativeInstallationPath | {
"repo_name": "tripodsan/jackrabbit-filevault",
"path": "vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/registry/impl/AbstractPackageRegistry.java",
"license": "apache-2.0",
"size": 7004
} | [
"org.apache.jackrabbit.vault.packaging.PackageId"
] | import org.apache.jackrabbit.vault.packaging.PackageId; | import org.apache.jackrabbit.vault.packaging.*; | [
"org.apache.jackrabbit"
] | org.apache.jackrabbit; | 547,722 |
public void testSetObject() throws Exception {
Properties props = new Properties();
props.put("noDatetimeStringSync", "true"); // value=true for #5
Connection conn1 = getConnectionWithProps(props);
Statement stmt1 = conn1.createStatement();
createTable("t1", " (" + "c1 DECIMAL," // instance of
... | void function() throws Exception { Properties props = new Properties(); props.put(STR, "true"); Connection conn1 = getConnectionWithProps(props); Statement stmt1 = conn1.createStatement(); createTable("t1", STR + STR + STR + STR + STR + STR + STR + STR); this.pstmt = conn1 .prepareStatement(STR); long currentTime = Sys... | /**
* Tests for PreparedStatement.setObject()
*
* @throws Exception
*/ | Tests for PreparedStatement.setObject() | testSetObject | {
"repo_name": "suthat/signal",
"path": "vendor/mysql-connector-java-5.1.26/src/testsuite/simple/StatementsTest.java",
"license": "apache-2.0",
"size": 58641
} | [
"java.sql.Connection",
"java.sql.Date",
"java.sql.Statement",
"java.sql.Time",
"java.sql.Timestamp",
"java.sql.Types",
"java.util.Properties"
] | import java.sql.Connection; import java.sql.Date; import java.sql.Statement; import java.sql.Time; import java.sql.Timestamp; import java.sql.Types; import java.util.Properties; | import java.sql.*; import java.util.*; | [
"java.sql",
"java.util"
] | java.sql; java.util; | 1,791,509 |
public void startGame (View view)
{
cVibration.activateVibrationShort ();
introMusic.stop ();
Intent game = new Intent(this, GameStart.class);
game.addFlags (Intent.FLAG_ACTIVITY_CLEAR_TOP);
game.putExtra ("MusicSwitch", mMusicSelection);
game.putExtra ("SoundSwitch", mSoundSelectio... | void function (View view) { cVibration.activateVibrationShort (); introMusic.stop (); Intent game = new Intent(this, GameStart.class); game.addFlags (Intent.FLAG_ACTIVITY_CLEAR_TOP); game.putExtra (STR, mMusicSelection); game.putExtra (STR, mSoundSelection); startActivity (game); } | /**
* Vibrates short, stops music, creates a new instance linked to game start,
* and passes the extra music and sound switches, and starts the activity
*
* @param view : the current view the device is in
*/ | Vibrates short, stops music, creates a new instance linked to game start, and passes the extra music and sound switches, and starts the activity | startGame | {
"repo_name": "JormungandrGames/Spritandroidimals",
"path": "app/src/main/java/cs/pacificu/edu/spritandroidimals/title_screen.java",
"license": "gpl-2.0",
"size": 5945
} | [
"android.content.Intent",
"android.view.View"
] | import android.content.Intent; import android.view.View; | import android.content.*; import android.view.*; | [
"android.content",
"android.view"
] | android.content; android.view; | 2,171,326 |
RESULT_TYPE visitDepositCounterpartDefinition(DepositCounterpartDefinition deposit); | RESULT_TYPE visitDepositCounterpartDefinition(DepositCounterpartDefinition deposit); | /**
* Counterparty deposit method.
* @param deposit The counterparty deposit
* @return The result
*/ | Counterparty deposit method | visitDepositCounterpartDefinition | {
"repo_name": "jerome79/OG-Platform",
"path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/instrument/InstrumentDefinitionVisitor.java",
"license": "apache-2.0",
"size": 78879
} | [
"com.opengamma.analytics.financial.instrument.cash.DepositCounterpartDefinition"
] | import com.opengamma.analytics.financial.instrument.cash.DepositCounterpartDefinition; | import com.opengamma.analytics.financial.instrument.cash.*; | [
"com.opengamma.analytics"
] | com.opengamma.analytics; | 2,216,766 |
@Override
public void writeInstallationRecord(File file, UninstallData uninstallData) throws Exception
{
panels.writeInstallationRecord(file, uninstallData);
} | void function(File file, UninstallData uninstallData) throws Exception { panels.writeInstallationRecord(file, uninstallData); } | /**
* Writes the installation record to a file.
*
* @param out The file to write to.
* @throws Exception Description of the Exception
*/ | Writes the installation record to a file | writeInstallationRecord | {
"repo_name": "mtjandra/izpack",
"path": "izpack-installer/src/main/java/com/izforge/izpack/installer/gui/InstallerFrame.java",
"license": "apache-2.0",
"size": 52151
} | [
"com.izforge.izpack.installer.data.UninstallData",
"java.io.File"
] | import com.izforge.izpack.installer.data.UninstallData; import java.io.File; | import com.izforge.izpack.installer.data.*; import java.io.*; | [
"com.izforge.izpack",
"java.io"
] | com.izforge.izpack; java.io; | 2,466,746 |
public static void copyDTOToDBO(MessageToUser dto, List<DBOMessageRecipient> recipients) {
for (String recipient : dto.getRecipients()) {
DBOMessageRecipient dbo = new DBOMessageRecipient();
dbo.setMessageId(parseLong(dto.getId()));
dbo.setRecipientId(parseLong(recipient));
recipients.add(dbo);
}
}
... | static void function(MessageToUser dto, List<DBOMessageRecipient> recipients) { for (String recipient : dto.getRecipients()) { DBOMessageRecipient dbo = new DBOMessageRecipient(); dbo.setMessageId(parseLong(dto.getId())); dbo.setRecipientId(parseLong(recipient)); recipients.add(dbo); } } | /**
* Copies message information
* Note: DBOMessageRecipient contains a subset of the fields of MessageToUser
*/ | Copies message information Note: DBOMessageRecipient contains a subset of the fields of MessageToUser | copyDTOToDBO | {
"repo_name": "hhu94/Synapse-Repository-Services",
"path": "lib/jdomodels/src/main/java/org/sagebionetworks/repo/model/dbo/dao/MessageUtils.java",
"license": "apache-2.0",
"size": 15077
} | [
"java.util.List",
"org.sagebionetworks.repo.model.dbo.persistence.DBOMessageRecipient",
"org.sagebionetworks.repo.model.message.MessageToUser"
] | import java.util.List; import org.sagebionetworks.repo.model.dbo.persistence.DBOMessageRecipient; import org.sagebionetworks.repo.model.message.MessageToUser; | import java.util.*; import org.sagebionetworks.repo.model.dbo.persistence.*; import org.sagebionetworks.repo.model.message.*; | [
"java.util",
"org.sagebionetworks.repo"
] | java.util; org.sagebionetworks.repo; | 569,403 |
public void setWorldstate(final CidsBean worldstate) {
this.worldstate = worldstate;
} | void function(final CidsBean worldstate) { this.worldstate = worldstate; } | /**
* DOCUMENT ME!
*
* @param worldstate DOCUMENT ME!
*/ | DOCUMENT ME | setWorldstate | {
"repo_name": "cismet/cids-custom-crisma-pilot-d",
"path": "src/main/java/de/cismet/cids/custom/crisma/pilotD/cascadeeffects/FFProbabilityWizardPanel.java",
"license": "lgpl-3.0",
"size": 4860
} | [
"de.cismet.cids.dynamics.CidsBean"
] | import de.cismet.cids.dynamics.CidsBean; | import de.cismet.cids.dynamics.*; | [
"de.cismet.cids"
] | de.cismet.cids; | 2,335,727 |
static Node getCatchHandlerForBlock(Node block) {
if (block.isBlock()
&& block.getParent().isTry()
&& block.getParent().getFirstChild() == block) {
for (Node s = block.getNext(); s != null; s = s.getNext()) {
if (NodeUtil.hasCatchHandler(s)) {
return s.getFirstChild();
... | static Node getCatchHandlerForBlock(Node block) { if (block.isBlock() && block.getParent().isTry() && block.getParent().getFirstChild() == block) { for (Node s = block.getNext(); s != null; s = s.getNext()) { if (NodeUtil.hasCatchHandler(s)) { return s.getFirstChild(); } } } return null; } private static class AstContr... | /**
* Locate the catch BLOCK given the first block in a TRY.
* @return The CATCH node or null there is no catch handler.
*/ | Locate the catch BLOCK given the first block in a TRY | getCatchHandlerForBlock | {
"repo_name": "mprobst/closure-compiler",
"path": "src/com/google/javascript/jscomp/ControlFlowAnalysis.java",
"license": "apache-2.0",
"size": 35386
} | [
"com.google.javascript.jscomp.ControlFlowGraph",
"com.google.javascript.jscomp.graph.DiGraph",
"com.google.javascript.rhino.Node",
"java.util.Map"
] | import com.google.javascript.jscomp.ControlFlowGraph; import com.google.javascript.jscomp.graph.DiGraph; import com.google.javascript.rhino.Node; import java.util.Map; | import com.google.javascript.jscomp.*; import com.google.javascript.jscomp.graph.*; import com.google.javascript.rhino.*; import java.util.*; | [
"com.google.javascript",
"java.util"
] | com.google.javascript; java.util; | 1,899,903 |
public Map<String, CommandFlowWrapper> getFlows() {
return flows;
}
/**
* Allows to get the singleton instance in order to query for some
* information about commands
*
* @return the singleton instance of {@link CommandRegistry} | Map<String, CommandFlowWrapper> function() { return flows; } /** * Allows to get the singleton instance in order to query for some * information about commands * * @return the singleton instance of {@link CommandRegistry} | /**
* Allows to retrieve all the flows which have been contributed from the
* extension point
*
* @return {@link #flows} all the flows defined in the extension point
*/ | Allows to retrieve all the flows which have been contributed from the extension point | getFlows | {
"repo_name": "awltech/clic",
"path": "com.worldline.clic/src/main/java/com/worldline/clic/internal/commands/CommandRegistry.java",
"license": "lgpl-2.1",
"size": 6506
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,611,287 |
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
} | void function(ApiClient apiClient) { this.apiClient = apiClient; } | /**
* set ApiClient
*
* @param apiClient ApiClient pass into the new instance of this class
*/ | set ApiClient | setApiClient | {
"repo_name": "XeroAPI/Xero-Java",
"path": "src/main/java/com/xero/api/client/BankFeedsApi.java",
"license": "mit",
"size": 35862
} | [
"com.xero.api.ApiClient"
] | import com.xero.api.ApiClient; | import com.xero.api.*; | [
"com.xero.api"
] | com.xero.api; | 1,159,557 |
int next(int position, int probePosition, Page allProbeChannelsPage); | int next(int position, int probePosition, Page allProbeChannelsPage); | /**
* Iterate over position links. When there are no more position -1 is returned.
*/ | Iterate over position links. When there are no more position -1 is returned | next | {
"repo_name": "facebook/presto",
"path": "presto-main/src/main/java/com/facebook/presto/operator/PositionLinks.java",
"license": "apache-2.0",
"size": 2289
} | [
"com.facebook.presto.common.Page"
] | import com.facebook.presto.common.Page; | import com.facebook.presto.common.*; | [
"com.facebook.presto"
] | com.facebook.presto; | 730,610 |
public static WrapImage gridCombine(WrapImage[] images, int gridWidth) {
assert(images.length > 0);
// Give some padding.
int charWidth = images[0].width() + 30;
int charHeight = images[0].height() + 30;
int totalWidth = charWidth * gridWidth;
int totalHeight = charHeight * (int... | static WrapImage function(WrapImage[] images, int gridWidth) { assert(images.length > 0); int charWidth = images[0].width() + 30; int charHeight = images[0].height() + 30; int totalWidth = charWidth * gridWidth; int totalHeight = charHeight * (int)Math.ceil(images.length / (double)gridWidth); WrapImage baseImage = Wrap... | /**
* Combine the images into a single image grid.
* This is intended for characters, so it assumes that all the characters are the same size.
*/ | Combine the images into a single image grid. This is intended for characters, so it assumes that all the characters are the same size | gridCombine | {
"repo_name": "eriq-augustine/jocr",
"path": "src/com/eriqaugustine/ocr/utils/ImageUtils.java",
"license": "gpl-2.0",
"size": 15917
} | [
"com.eriqaugustine.ocr.image.WrapImage"
] | import com.eriqaugustine.ocr.image.WrapImage; | import com.eriqaugustine.ocr.image.*; | [
"com.eriqaugustine.ocr"
] | com.eriqaugustine.ocr; | 2,392,237 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.