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
static long getLogFile(TestCase test, Cursor cursor) throws DatabaseException { CursorImpl impl = DbTestProxy.dbcGetCursorImpl(cursor); int index; BIN bin = impl.getDupBIN(); if (bin != null) { index = impl.getDupIndex(); } else { bin = impl.g...
static long getLogFile(TestCase test, Cursor cursor) throws DatabaseException { CursorImpl impl = DbTestProxy.dbcGetCursorImpl(cursor); int index; BIN bin = impl.getDupBIN(); if (bin != null) { index = impl.getDupIndex(); } else { bin = impl.getBIN(); TestCase.assertNotNull(bin); index = impl.getIndex(); } TestCase.ass...
/** * Gets the file of the LSN at the cursor position, using internal methods. */
Gets the file of the LSN at the cursor position, using internal methods
getLogFile
{ "repo_name": "nologic/nabs", "path": "client/trunk/shared/libraries/je-3.2.74/test/com/sleepycat/je/cleaner/CleanerTestUtils.java", "license": "gpl-2.0", "size": 5468 }
[ "com.sleepycat.je.Cursor", "com.sleepycat.je.DatabaseException", "com.sleepycat.je.DbTestProxy", "com.sleepycat.je.dbi.CursorImpl", "com.sleepycat.je.utilint.DbLsn", "junit.framework.TestCase" ]
import com.sleepycat.je.Cursor; import com.sleepycat.je.DatabaseException; import com.sleepycat.je.DbTestProxy; import com.sleepycat.je.dbi.CursorImpl; import com.sleepycat.je.utilint.DbLsn; import junit.framework.TestCase;
import com.sleepycat.je.*; import com.sleepycat.je.dbi.*; import com.sleepycat.je.utilint.*; import junit.framework.*;
[ "com.sleepycat.je", "junit.framework" ]
com.sleepycat.je; junit.framework;
1,264,335
private static Class<?>[] convertArgumentTypesToPrimitive(Class<?>[] paramTypes, Object[] arguments) { Class<?>[] types = new Class<?>[arguments.length]; for (int i = 0; i < arguments.length; i++) { Class<?> argumentType = null; if (arguments[i] == null) { arg...
static Class<?>[] function(Class<?>[] paramTypes, Object[] arguments) { Class<?>[] types = new Class<?>[arguments.length]; for (int i = 0; i < arguments.length; i++) { Class<?> argumentType = null; if (arguments[i] == null) { argumentType = paramTypes[i]; } else { argumentType = getType(arguments[i]); } Class<?> primit...
/** * Convert argument types to primitive. * * @param paramTypes the param types * @param arguments the arguments * @return the class[] */
Convert argument types to primitive
convertArgumentTypesToPrimitive
{ "repo_name": "jayway/powermock", "path": "powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java", "license": "apache-2.0", "size": 115150 }
[ "org.powermock.reflect.internal.primitivesupport.PrimitiveWrapper" ]
import org.powermock.reflect.internal.primitivesupport.PrimitiveWrapper;
import org.powermock.reflect.internal.primitivesupport.*;
[ "org.powermock.reflect" ]
org.powermock.reflect;
968,469
@Override public void exitMatch(@NotNull PoCoParser.MatchContext ctx) { }
@Override public void exitMatch(@NotNull PoCoParser.MatchContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
enterMatch
{ "repo_name": "Corjuh/PoCo-Compiler", "path": "src/com/poco/PoCoParser/PoCoParserBaseListener.java", "license": "lgpl-2.1", "size": 18510 }
[ "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;
1,869,383
public void setExporterService(ExporterService exporterService) { this.exporterService = exporterService; }
void function(ExporterService exporterService) { this.exporterService = exporterService; }
/** * Sets the ExporterService to use * * @param exporterService The ExporterService */
Sets the ExporterService to use
setExporterService
{ "repo_name": "Alfresco/alfresco-repository", "path": "src/main/java/org/alfresco/repo/action/executer/ExporterActionExecuter.java", "license": "lgpl-3.0", "size": 11162 }
[ "org.alfresco.service.cmr.view.ExporterService" ]
import org.alfresco.service.cmr.view.ExporterService;
import org.alfresco.service.cmr.view.*;
[ "org.alfresco.service" ]
org.alfresco.service;
1,192,157
protected final Element getEnclosingElement() { return Preconditions.checkNotNull(enclosingElement); }
final Element function() { return Preconditions.checkNotNull(enclosingElement); }
/** * Returns the {@link Element} that encloses the current tree path. */
Returns the <code>Element</code> that encloses the current tree path
getEnclosingElement
{ "repo_name": "daedric/buck", "path": "src/com/facebook/buck/jvm/java/abi/source/TreeContextScanner.java", "license": "apache-2.0", "size": 2995 }
[ "com.facebook.buck.util.liteinfersupport.Preconditions", "javax.lang.model.element.Element" ]
import com.facebook.buck.util.liteinfersupport.Preconditions; import javax.lang.model.element.Element;
import com.facebook.buck.util.liteinfersupport.*; import javax.lang.model.element.*;
[ "com.facebook.buck", "javax.lang" ]
com.facebook.buck; javax.lang;
2,566,768
public boolean isValidChoice(Currency curr) { if( curr == null ) { return !isRequired(); } for( Currency choice : choices ) { if( choice.equals(curr) ) { return true; } } return false;...
boolean function(Currency curr) { if( curr == null ) { return !isRequired(); } for( Currency choice : choices ) { if( choice.equals(curr) ) { return true; } } return false; }
/** * Validates that the specified currency is a valid value for this data type. The * specified currency is considered valid if it is among the choices setup * for the data type. * @param curr the currency being validated * @return true if the value is vvalid */
Validates that the specified currency is a valid value for this data type. The specified currency is considered valid if it is among the choices setup for the data type
isValidChoice
{ "repo_name": "greese/dasein-util", "path": "src/main/java/org/dasein/attributes/types/CurrencyFactory.java", "license": "apache-2.0", "size": 9278 }
[ "java.util.Currency" ]
import java.util.Currency;
import java.util.*;
[ "java.util" ]
java.util;
1,069,030
protected Manifest retrieveManifest () { try { FileObject object = this.processingEnv.getFiler ().getResource (StandardLocation.SOURCE_PATH, "", "META-INF/MANIFEST.MF"); try (InputStream manifestStream = object.openInputStream ()) { ...
Manifest function () { try { FileObject object = this.processingEnv.getFiler ().getResource (StandardLocation.SOURCE_PATH, STRMETA-INF/MANIFEST.MFSTRCannot access plugin manifest: " + ex.getMessage ()); ex.printStackTrace (); return null; } }
/** * Retrieves the plugin manifest (if present). * * @return The manifest. */
Retrieves the plugin manifest (if present)
retrieveManifest
{ "repo_name": "LordAkkarin/bukkit-plugin-annotations", "path": "src/main/java/com/torchmind/minecraft/annotation/processor/PluginAnnotationProcessor.java", "license": "apache-2.0", "size": 21712 }
[ "java.util.jar.Manifest", "javax.tools.FileObject", "javax.tools.StandardLocation" ]
import java.util.jar.Manifest; import javax.tools.FileObject; import javax.tools.StandardLocation;
import java.util.jar.*; import javax.tools.*;
[ "java.util", "javax.tools" ]
java.util; javax.tools;
2,213,876
public DateTime startTime() { return this.startTime; }
DateTime function() { return this.startTime; }
/** * Get the date-time when the container instance state started. * * @return the startTime value */
Get the date-time when the container instance state started
startTime
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerState.java", "license": "mit", "size": 2431 }
[ "org.joda.time.DateTime" ]
import org.joda.time.DateTime;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
955,521
public void setUnlikeDrawableRes(@DrawableRes int resId) { unLikeDrawable = ContextCompat.getDrawable(getContext(), resId); if (iconSize != 0) { unLikeDrawable = Utils.resizeDrawable(getContext(), unLikeDrawable, iconSize, iconSize); } icon.setImageDrawable(unLikeDrawabl...
void function(@DrawableRes int resId) { unLikeDrawable = ContextCompat.getDrawable(getContext(), resId); if (iconSize != 0) { unLikeDrawable = Utils.resizeDrawable(getContext(), unLikeDrawable, iconSize, iconSize); } icon.setImageDrawable(unLikeDrawable); }
/** * This drawable will be shown when the button is in on unLiked state. * * @param resId */
This drawable will be shown when the button is in on unLiked state
setUnlikeDrawableRes
{ "repo_name": "longluo/AndroidDemo", "path": "app/src/main/java/com/longluo/demo/likebutton/LikeButton.java", "license": "mit", "size": 16659 }
[ "android.support.annotation.DrawableRes", "android.support.v4.content.ContextCompat" ]
import android.support.annotation.DrawableRes; import android.support.v4.content.ContextCompat;
import android.support.annotation.*; import android.support.v4.content.*;
[ "android.support" ]
android.support;
863,638
List<TypedFlowEntryWithLoad> loadTopnByType(Device device, PortNumber pNumber, TypedStoredFlowEntry.FlowLiveType liveType, Instruction.Type instType, int topn);
List<TypedFlowEntryWithLoad> loadTopnByType(Device device, PortNumber pNumber, TypedStoredFlowEntry.FlowLiveType liveType, Instruction.Type instType, int topn);
/** * Obtain the flow type and load topn list for the device with the given link or port. * * @param device the Device to query. * @param pNumber the port number of the Device to query * @param liveType the FlowLiveType to filter, null means no filtering . * @param instType the Ins...
Obtain the flow type and load topn list for the device with the given link or port
loadTopnByType
{ "repo_name": "kkkane/ONOS", "path": "core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java", "license": "apache-2.0", "size": 4615 }
[ "java.util.List", "org.onosproject.net.Device", "org.onosproject.net.PortNumber", "org.onosproject.net.flow.TypedStoredFlowEntry", "org.onosproject.net.flow.instructions.Instruction" ]
import java.util.List; import org.onosproject.net.Device; import org.onosproject.net.PortNumber; import org.onosproject.net.flow.TypedStoredFlowEntry; import org.onosproject.net.flow.instructions.Instruction;
import java.util.*; import org.onosproject.net.*; import org.onosproject.net.flow.*; import org.onosproject.net.flow.instructions.*;
[ "java.util", "org.onosproject.net" ]
java.util; org.onosproject.net;
1,233,685
public Set<V> getAllReachableTargets(V source);
Set<V> function(V source);
/** * Returns all nodes which are reachable from the source node. * * @param source * the source node * @return the set of target nodes */
Returns all nodes which are reachable from the source node
getAllReachableTargets
{ "repo_name": "metaborg/nabl", "path": "nabl2.terms/src/main/java/mb/nabl2/util/graph/igraph/ITcDataSource.java", "license": "apache-2.0", "size": 2381 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,257,415
@Nullable Set<String> getStringSet(String key, @Nullable Set<String> defValues);
Set<String> getStringSet(String key, @Nullable Set<String> defValues);
/** * Retrieve a set of String values from the preferences. * * <p>Note that you <em>must not</em> modify the set instance returned * by this call. The consistency of the stored data is not guaranteed * if you do, nor is your ability to modify the instance at all. * * @param key The...
Retrieve a set of String values from the preferences. Note that you must not modify the set instance returned by this call. The consistency of the stored data is not guaranteed if you do, nor is your ability to modify the instance at all
getStringSet
{ "repo_name": "TachiWeb/TachiWeb-Server", "path": "AndroidCompat/src/main/java/android/content/SharedPreferences.java", "license": "apache-2.0", "size": 15356 }
[ "android.annotation.Nullable", "java.util.Set" ]
import android.annotation.Nullable; import java.util.Set;
import android.annotation.*; import java.util.*;
[ "android.annotation", "java.util" ]
android.annotation; java.util;
2,695,415
private File resolveCsvFile() { if (csvFile != null) { return csvFile; } else { return IOUtils.createTempFile("AnalyzeCovariates", ".csv"); } }
File function() { if (csvFile != null) { return csvFile; } else { return IOUtils.createTempFile(STR, ".csv"); } }
/** * Returns the csv file to use. * <p/> * This is the the one specified by the user if any or a temporary file * that will be deleted as soon as the VM exists by default. * * @return never <code>null</code>. */
Returns the csv file to use. This is the the one specified by the user if any or a temporary file that will be deleted as soon as the VM exists by default
resolveCsvFile
{ "repo_name": "davidadamsphd/hellbender", "path": "src/main/java/org/broadinstitute/hellbender/tools/walkers/bqsr/AnalyzeCovariates.java", "license": "bsd-3-clause", "size": 19384 }
[ "java.io.File", "org.broadinstitute.hellbender.utils.io.IOUtils" ]
import java.io.File; import org.broadinstitute.hellbender.utils.io.IOUtils;
import java.io.*; import org.broadinstitute.hellbender.utils.io.*;
[ "java.io", "org.broadinstitute.hellbender" ]
java.io; org.broadinstitute.hellbender;
202,735
public boolean getStoreHealth() throws ClusterMgtException { ClusterManagementBeans clusterManagementBeans = new ClusterManagementBeans(); return clusterManagementBeans.getStoreHealth(); }
boolean function() throws ClusterMgtException { ClusterManagementBeans clusterManagementBeans = new ClusterManagementBeans(); return clusterManagementBeans.getStoreHealth(); }
/** * Gets the message store's health status * * @return true if healthy, else false. */
Gets the message store's health status
getStoreHealth
{ "repo_name": "wso2/carbon-business-messaging", "path": "components/andes/org.wso2.carbon.andes.cluster.mgt/src/main/java/org/wso2/carbon/andes/cluster/mgt/ClusterManagerService.java", "license": "apache-2.0", "size": 2870 }
[ "org.wso2.carbon.andes.cluster.mgt.internal.ClusterMgtException", "org.wso2.carbon.andes.cluster.mgt.internal.managementBeans.ClusterManagementBeans" ]
import org.wso2.carbon.andes.cluster.mgt.internal.ClusterMgtException; import org.wso2.carbon.andes.cluster.mgt.internal.managementBeans.ClusterManagementBeans;
import org.wso2.carbon.andes.cluster.mgt.internal.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
2,702,963
public void setCurrentElement(Element element) { if (currentElement != element) { elementEditController.setCurrentElement(element); if (currentElement != null) { //Reset style of old button Button button = elementGroupListController.getButtonForElement(currentElement)...
void function(Element element) { if (currentElement != element) { elementEditController.setCurrentElement(element); if (currentElement != null) { Button button = elementGroupListController.getButtonForElement(currentElement); if (button != null) button.setStyle(null); } currentElement = element; } Button button = eleme...
/** * Sets new currently edited element * @param element new element to set as current */
Sets new currently edited element
setCurrentElement
{ "repo_name": "PoprostuRonin/spritor", "path": "src/main/java/com/poprosturonin/controller/DesignController.java", "license": "mit", "size": 8105 }
[ "com.poprosturonin.model.design.Element" ]
import com.poprosturonin.model.design.Element;
import com.poprosturonin.model.design.*;
[ "com.poprosturonin.model" ]
com.poprosturonin.model;
256,539
public Transform3D getTransform( Transform3D result ) { result.set( xform ); return result; }
Transform3D function( Transform3D result ) { result.set( xform ); return result; }
/** * Places the camera transform into <code>result</code> and returns it. */
Places the camera transform into <code>result</code> and returns it
getTransform
{ "repo_name": "jedwards1211/breakout", "path": "andork-j3d-utils/src/org/andork/j3d/camera/CameraPosition.java", "license": "gpl-2.0", "size": 25084 }
[ "javax.media.j3d.Transform3D" ]
import javax.media.j3d.Transform3D;
import javax.media.j3d.*;
[ "javax.media" ]
javax.media;
1,590,469
public void load(String fileName) throws Exception { File fileStream = new File(fileName); FileOutputStream fos = new FileOutputStream(fileStream); this.loadToStream = fos; try { this.load(); } finally { this.loadToStream.flush(); this.loadToStream = null; } this.fileName = fileNam...
void function(String fileName) throws Exception { File fileStream = new File(fileName); FileOutputStream fos = new FileOutputStream(fileStream); this.loadToStream = fos; try { this.load(); } finally { this.loadToStream.flush(); this.loadToStream = null; } this.fileName = fileName; this.content = null; this.contentStrea...
/** * * Loads the content of the file attachment into the specified file. * Calling this method results in a call to EWS. * * @param fileName * the file name * @throws Exception * the exception */
Loads the content of the file attachment into the specified file. Calling this method results in a call to EWS
load
{ "repo_name": "daitangio/exchangews", "path": "src/main/java/microsoft/exchange/webservices/data/FileAttachment.java", "license": "lgpl-3.0", "size": 8486 }
[ "java.io.File", "java.io.FileOutputStream" ]
import java.io.File; import java.io.FileOutputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,721,175
void deleteSnapshot(String snapshotName) throws IOException;
void deleteSnapshot(String snapshotName) throws IOException;
/** * Delete an existing snapshot. * * @param snapshotName name of the snapshot * @throws IOException if a remote or network exception occurs */
Delete an existing snapshot
deleteSnapshot
{ "repo_name": "ChinmaySKulkarni/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java", "license": "apache-2.0", "size": 101053 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,553,370
public static ZooKeeperWatcher createAndForceNodeToOpenedState( HBaseTestingUtility TEST_UTIL, HRegion region, ServerName serverName) throws ZooKeeperConnectionException, IOException, KeeperException, NodeExistsException { ZooKeeperWatcher zkw = getZooKeeperWatcher(TEST_UTIL); ZKAssign.creat...
static ZooKeeperWatcher function( HBaseTestingUtility TEST_UTIL, HRegion region, ServerName serverName) throws ZooKeeperConnectionException, IOException, KeeperException, NodeExistsException { ZooKeeperWatcher zkw = getZooKeeperWatcher(TEST_UTIL); ZKAssign.createNodeOffline(zkw, region.getRegionInfo(), serverName); int...
/** * Creates a znode with OPENED state. * @param TEST_UTIL * @param region * @param serverName * @return * @throws IOException * @throws ZooKeeperConnectionException * @throws KeeperException * @throws NodeExistsException */
Creates a znode with OPENED state
createAndForceNodeToOpenedState
{ "repo_name": "matteobertozzi/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java", "license": "apache-2.0", "size": 79792 }
[ "java.io.IOException", "org.apache.hadoop.hbase.regionserver.HRegion", "org.apache.hadoop.hbase.zookeeper.ZKAssign", "org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher", "org.apache.zookeeper.KeeperException" ]
import java.io.IOException; import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.zookeeper.ZKAssign; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.zookeeper.KeeperException;
import java.io.*; import org.apache.hadoop.hbase.regionserver.*; import org.apache.hadoop.hbase.zookeeper.*; import org.apache.zookeeper.*;
[ "java.io", "org.apache.hadoop", "org.apache.zookeeper" ]
java.io; org.apache.hadoop; org.apache.zookeeper;
1,571,869
private void renameColumn(CmsSetupDb dbCon, String tablename, String oldname, String newname) throws SQLException { System.out.println(new Exception().getStackTrace()[0].toString()); if (dbCon.hasTableOrColumn(tablename, oldname)) { String query = readQuery(QUERY_RENAME_COLUMN); ...
void function(CmsSetupDb dbCon, String tablename, String oldname, String newname) throws SQLException { System.out.println(new Exception().getStackTrace()[0].toString()); if (dbCon.hasTableOrColumn(tablename, oldname)) { String query = readQuery(QUERY_RENAME_COLUMN); Map<String, String> replacer = new HashMap<String, S...
/** * Renames the column of the given table the new name.<p> * * @param dbCon the db connection interface * @param tablename the table in which the column shall be renamed * @param oldname the old name of the column * @param newname the new name of the column * * @throws SQLExcep...
Renames the column of the given table the new name
renameColumn
{ "repo_name": "mediaworx/opencms-core", "path": "src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBProjectId.java", "license": "lgpl-2.1", "size": 30603 }
[ "java.sql.SQLException", "java.util.HashMap", "java.util.Map", "org.opencms.setup.CmsSetupDb" ]
import java.sql.SQLException; import java.util.HashMap; import java.util.Map; import org.opencms.setup.CmsSetupDb;
import java.sql.*; import java.util.*; import org.opencms.setup.*;
[ "java.sql", "java.util", "org.opencms.setup" ]
java.sql; java.util; org.opencms.setup;
212,453
public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; }
void function(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; }
/** * This sets the composed adapter factory that contains this factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This sets the composed adapter factory that contains this factory.
setParentAdapterFactory
{ "repo_name": "pgaufillet/topcased-req", "path": "plugins/org.topcased.typesmodel/src/org/topcased/typesmodel/model/inittypes/provider/InittypesItemProviderAdapterFactory.java", "license": "epl-1.0", "size": 10488 }
[ "org.eclipse.emf.edit.provider.ComposedAdapterFactory" ]
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
983,120
@Override public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException { if (Globals.IS_SECURITY_ENABLED) { try { PrivilegedInclude dp = new PrivilegedInclude(request,response); AccessController.doPrivi...
void function(ServletRequest request, ServletResponse response) throws ServletException, IOException { if (Globals.IS_SECURITY_ENABLED) { try { PrivilegedInclude dp = new PrivilegedInclude(request,response); AccessController.doPrivileged(dp); } catch (PrivilegedActionException pe) { Exception e = pe.getException(); if ...
/** * Include the response from another resource in the current response. * Any runtime exception, IOException, or ServletException thrown by the * called servlet will be propagated to the caller. * * @param request The servlet request that is including this one * @param response The servl...
Include the response from another resource in the current response. Any runtime exception, IOException, or ServletException thrown by the called servlet will be propagated to the caller
include
{ "repo_name": "plumer/codana", "path": "tomcat_files/7.0.61/ApplicationDispatcher.java", "license": "mit", "size": 40701 }
[ "java.io.IOException", "java.security.AccessController", "java.security.PrivilegedActionException", "javax.servlet.ServletException", "javax.servlet.ServletRequest", "javax.servlet.ServletResponse", "org.apache.catalina.Globals" ]
import java.io.IOException; import java.security.AccessController; import java.security.PrivilegedActionException; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import org.apache.catalina.Globals;
import java.io.*; import java.security.*; import javax.servlet.*; import org.apache.catalina.*;
[ "java.io", "java.security", "javax.servlet", "org.apache.catalina" ]
java.io; java.security; javax.servlet; org.apache.catalina;
453,382
private long calculateMedianValue(long[] durations) { long median; // figure out the median Arrays.sort(durations); int midPoint = durations.length /2; if ((durations.length & 1) == 1) { // odd median = durations[midPoint]; } else { // even median = (durations[midPoint-1] + durations[midPoint])...
long function(long[] durations) { long median; Arrays.sort(durations); int midPoint = durations.length /2; if ((durations.length & 1) == 1) { median = durations[midPoint]; } else { median = (durations[midPoint-1] + durations[midPoint]) / 2; } return median; }
/** * Calculate the median value from the given array * @param durations * @return median value */
Calculate the median value from the given array
calculateMedianValue
{ "repo_name": "bsmedberg/pig", "path": "src/org/apache/pig/tools/pigstats/JobStats.java", "license": "apache-2.0", "size": 22373 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,727,540
public static String contentOf(File file, String charsetName) { return Files.contentOf(file, charsetName); }
static String function(File file, String charsetName) { return Files.contentOf(file, charsetName); }
/** * Loads the text content of a file, so that it can be passed to {@link #assertThat(String)}. * <p> * Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative * with {@link #assertThat(File)}. * </p> * * @param file the file. * @param c...
Loads the text content of a file, so that it can be passed to <code>#assertThat(String)</code>. Note that this will load the entire file in memory; for larger files, there might be a more efficient alternative with <code>#assertThat(File)</code>.
contentOf
{ "repo_name": "michal-lipski/assertj-core", "path": "src/main/java/org/assertj/core/api/AssertionsForClassTypes.java", "license": "apache-2.0", "size": 55611 }
[ "java.io.File", "org.assertj.core.util.Files" ]
import java.io.File; import org.assertj.core.util.Files;
import java.io.*; import org.assertj.core.util.*;
[ "java.io", "org.assertj.core" ]
java.io; org.assertj.core;
1,163,361
public Set<TaskId> cachedTasksIds() { // A client could contain some inactive tasks whose states are still kept on the local storage in the following scenarios: // 1) the client is actively maintaining standby tasks by maintaining their states from the change log. // 2) the client has just g...
Set<TaskId> function() { final HashSet<TaskId> tasks = new HashSet<>(); final File[] stateDirs = taskCreator.stateDirectory().listTaskDirectories(); if (stateDirs != null) { for (final File dir : stateDirs) { try { final TaskId id = TaskId.parse(dir.getName()); if (new File(dir, ProcessorStateManager.CHECKPOINT_FILE_NA...
/** * Returns ids of tasks whose states are kept on the local storage. */
Returns ids of tasks whose states are kept on the local storage
cachedTasksIds
{ "repo_name": "mihbor/kafka", "path": "streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java", "license": "apache-2.0", "size": 18977 }
[ "java.io.File", "java.util.HashSet", "java.util.Set", "org.apache.kafka.streams.errors.TaskIdFormatException", "org.apache.kafka.streams.processor.TaskId" ]
import java.io.File; import java.util.HashSet; import java.util.Set; import org.apache.kafka.streams.errors.TaskIdFormatException; import org.apache.kafka.streams.processor.TaskId;
import java.io.*; import java.util.*; import org.apache.kafka.streams.errors.*; import org.apache.kafka.streams.processor.*;
[ "java.io", "java.util", "org.apache.kafka" ]
java.io; java.util; org.apache.kafka;
2,188,321
public static DepositZeroDefinition from(final Currency currency, final ZonedDateTime startDate, final ZonedDateTime endDate, final DayCount daycount, final InterestRate rate, final Calendar calendar, final DayCount dayCount) { ArgumentChecker.notNull(daycount, "day count"); return new DepositZeroDefini...
static DepositZeroDefinition function(final Currency currency, final ZonedDateTime startDate, final ZonedDateTime endDate, final DayCount daycount, final InterestRate rate, final Calendar calendar, final DayCount dayCount) { ArgumentChecker.notNull(daycount, STR); return new DepositZeroDefinition(currency, startDate, e...
/** * Builder. The day count is used to compute the accrual factor. The notional is 1. * @param currency The currency. * @param startDate The start date. * @param endDate The end date. * @param daycount The day count. * @param rate The interest rate and its composition type. * @param calendar The h...
Builder. The day count is used to compute the accrual factor. The notional is 1
from
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/instrument/cash/DepositZeroDefinition.java", "license": "apache-2.0", "size": 9658 }
[ "com.opengamma.analytics.financial.interestrate.InterestRate", "com.opengamma.financial.convention.calendar.Calendar", "com.opengamma.financial.convention.daycount.DayCount", "com.opengamma.util.ArgumentChecker", "com.opengamma.util.money.Currency", "org.threeten.bp.ZonedDateTime" ]
import com.opengamma.analytics.financial.interestrate.InterestRate; import com.opengamma.financial.convention.calendar.Calendar; import com.opengamma.financial.convention.daycount.DayCount; import com.opengamma.util.ArgumentChecker; import com.opengamma.util.money.Currency; import org.threeten.bp.ZonedDateTime;
import com.opengamma.analytics.financial.interestrate.*; import com.opengamma.financial.convention.calendar.*; import com.opengamma.financial.convention.daycount.*; import com.opengamma.util.*; import com.opengamma.util.money.*; import org.threeten.bp.*;
[ "com.opengamma.analytics", "com.opengamma.financial", "com.opengamma.util", "org.threeten.bp" ]
com.opengamma.analytics; com.opengamma.financial; com.opengamma.util; org.threeten.bp;
806,406
public CoordinatorConfig setBootstrapURLs(List<String> bootstrapUrls) { this.bootstrapURLs = Utils.notNull(bootstrapUrls); if(this.bootstrapURLs.size() <= 0) throw new IllegalArgumentException("Must provide at least one bootstrap URL."); return this; }
CoordinatorConfig function(List<String> bootstrapUrls) { this.bootstrapURLs = Utils.notNull(bootstrapUrls); if(this.bootstrapURLs.size() <= 0) throw new IllegalArgumentException(STR); return this; }
/** * Sets the bootstrap URLs used by the different Fat clients inside the * Coordinator * * @param bootstrapUrls list of bootstrap URLs defining which cluster to * connect to * @return modified CoordinatorConfig */
Sets the bootstrap URLs used by the different Fat clients inside the Coordinator
setBootstrapURLs
{ "repo_name": "HB-SI/voldemort", "path": "src/java/voldemort/rest/coordinator/CoordinatorConfig.java", "license": "apache-2.0", "size": 11902 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
138,909
@Override public void onStartRefresh() { // Start observing the event table to get notified when new events // arrive. mEventContentObserver = new EventContentObserver(mHandler); mContext.getContentResolver().registerContentObserver(Notification.Event.URI, true, ...
void function() { mEventContentObserver = new EventContentObserver(mHandler); mContext.getContentResolver().registerContentObserver(Notification.Event.URI, true, mEventContentObserver); updateWidget(false); }
/** * Start refreshing the widget. The widget is now visible. */
Start refreshing the widget. The widget is now visible
onStartRefresh
{ "repo_name": "BAILOOL/Assistant-for-People-with-Low-Vision", "path": "GlassApp/smartExtensionUtils/src/main/java/com/sonyericsson/extras/liveware/extension/util/widget/NotificationWidgetExtension.java", "license": "mit", "size": 16258 }
[ "com.sonyericsson.extras.liveware.aef.notification.Notification" ]
import com.sonyericsson.extras.liveware.aef.notification.Notification;
import com.sonyericsson.extras.liveware.aef.notification.*;
[ "com.sonyericsson.extras" ]
com.sonyericsson.extras;
463,410
public void copyView(int index) throws MalformedURLException, XPathExpressionException { getDriver().findElement(By.id("add-view")).click(); getDriver().findElement(By.id("copy-view")).click(); List<WebElement> links = driver.findElements(By.cssSelector("ul#page-views-menu>li>a")); l...
void function(int index) throws MalformedURLException, XPathExpressionException { getDriver().findElement(By.id(STR)).click(); getDriver().findElement(By.id(STR)).click(); List<WebElement> links = driver.findElements(By.cssSelector(STR)); links.get(index - 1).click(); }
/** * To create a new view by copying existing view * * @param index Index of the view to be copied */
To create a new view by copying existing view
copyView
{ "repo_name": "wso2/product-ues", "path": "modules/integration/tests-ui-integration/ui-test-utils/src/main/java/org/wso2/ds/ui/integration/util/DSUIIntegrationTest.java", "license": "apache-2.0", "size": 32053 }
[ "java.net.MalformedURLException", "java.util.List", "javax.xml.xpath.XPathExpressionException", "org.openqa.selenium.By", "org.openqa.selenium.WebElement" ]
import java.net.MalformedURLException; import java.util.List; import javax.xml.xpath.XPathExpressionException; import org.openqa.selenium.By; import org.openqa.selenium.WebElement;
import java.net.*; import java.util.*; import javax.xml.xpath.*; import org.openqa.selenium.*;
[ "java.net", "java.util", "javax.xml", "org.openqa.selenium" ]
java.net; java.util; javax.xml; org.openqa.selenium;
2,295,693
public String[] getCalendarNames() throws SchedulerException { return sched.getCalendarNames(schedCtxt); } /////////////////////////////////////////////////////////////////////////// /// /// Listener-related Methods /// ///////////////////////////////////////////////////////////////...
String[] function() throws SchedulerException { return sched.getCalendarNames(schedCtxt); }
/** * <p> * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>, * passing the <code>SchedulingContext</code> associated with this * instance. * </p> */
Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>, passing the <code>SchedulingContext</code> associated with this instance.
getCalendarNames
{ "repo_name": "feigeai/opensymphony-quartz-backup", "path": "trunk/src/java/org/quartz/impl/StdScheduler.java", "license": "apache-2.0", "size": 24746 }
[ "org.quartz.SchedulerException" ]
import org.quartz.SchedulerException;
import org.quartz.*;
[ "org.quartz" ]
org.quartz;
2,465,543
final ArrayList getLPConfigObjects() { String thisMethodName = "getLPConfigObjects"; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, thisMethodName, this); SibTr.exit(tc, thisMethodName, _lpConfig); } return _lpConfig; ...
final ArrayList getLPConfigObjects() { String thisMethodName = STR; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, thisMethodName, this); SibTr.exit(tc, thisMethodName, _lpConfig); } return _lpConfig; }
/** * Return the cache of localization point config objects (not a copy). * * @return Returns the _lpConfig. */
Return the cache of localization point config objects (not a copy)
getLPConfigObjects
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/BaseMessagingEngineImpl.java", "license": "epl-1.0", "size": 69838 }
[ "com.ibm.websphere.ras.TraceComponent", "com.ibm.ws.sib.utils.ras.SibTr", "java.util.ArrayList" ]
import com.ibm.websphere.ras.TraceComponent; import com.ibm.ws.sib.utils.ras.SibTr; import java.util.ArrayList;
import com.ibm.websphere.ras.*; import com.ibm.ws.sib.utils.ras.*; import java.util.*;
[ "com.ibm.websphere", "com.ibm.ws", "java.util" ]
com.ibm.websphere; com.ibm.ws; java.util;
1,562,657
public GHRequest setAlgorithm(String algo) { if (algo != null) this.algo = Helper.camelCaseToUnderScore(algo); return this; }
GHRequest function(String algo) { if (algo != null) this.algo = Helper.camelCaseToUnderScore(algo); return this; }
/** * For possible values see AlgorithmOptions.* */
For possible values see AlgorithmOptions
setAlgorithm
{ "repo_name": "ammagamma/graphhopper", "path": "api/src/main/java/com/graphhopper/GHRequest.java", "license": "apache-2.0", "size": 10586 }
[ "com.graphhopper.util.Helper" ]
import com.graphhopper.util.Helper;
import com.graphhopper.util.*;
[ "com.graphhopper.util" ]
com.graphhopper.util;
1,458,477
EClass getResourceMeasurement();
EClass getResourceMeasurement();
/** * Returns the meta object for class '{@link kieker.tools.slastic.metamodel.monitoring.ResourceMeasurement <em>Resource Measurement</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Resource Measurement</em>'. * @see kieker.tools.slastic.metamodel.monitoring...
Returns the meta object for class '<code>kieker.tools.slastic.metamodel.monitoring.ResourceMeasurement Resource Measurement</code>'.
getResourceMeasurement
{ "repo_name": "SLAsticSPE/slastic", "path": "src-gen/kieker/tools/slastic/metamodel/monitoring/MonitoringPackage.java", "license": "apache-2.0", "size": 40668 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
351,439
boolean resumeScheduler(final String sessionId) throws RestServerException, ServiceException;
boolean resumeScheduler(final String sessionId) throws RestServerException, ServiceException;
/** * Resumes the Scheduler. * @param sessionId the session id of the user which is logged in * @return true if the resume was successfully, false otherwise. */
Resumes the Scheduler
resumeScheduler
{ "repo_name": "ow2-proactive/scheduling-portal", "path": "scheduler-portal/src/main/java/org/ow2/proactive_grid_cloud_portal/scheduler/client/SchedulerService.java", "license": "agpl-3.0", "size": 21328 }
[ "org.ow2.proactive_grid_cloud_portal.common.shared.RestServerException", "org.ow2.proactive_grid_cloud_portal.common.shared.ServiceException" ]
import org.ow2.proactive_grid_cloud_portal.common.shared.RestServerException; import org.ow2.proactive_grid_cloud_portal.common.shared.ServiceException;
import org.ow2.proactive_grid_cloud_portal.common.shared.*;
[ "org.ow2.proactive_grid_cloud_portal" ]
org.ow2.proactive_grid_cloud_portal;
1,089,221
public static boolean getBoolean(Field field, Object obj) { try { return field.getBoolean(obj); } catch (Exception exp) { throw translate(exp); } }
static boolean function(Field field, Object obj) { try { return field.getBoolean(obj); } catch (Exception exp) { throw translate(exp); } }
/** * Gets the value of an instance <code>boolean</code> field. * * @param field Field object whose value is returned. * @param obj the object to extract the <code>boolean</code> value from * @return the value of the <code>boolean</code> field */
Gets the value of an instance <code>boolean</code> field
getBoolean
{ "repo_name": "jbachorik/btrace", "path": "btrace-core/src/main/java/org/openjdk/btrace/core/BTraceUtils.java", "license": "gpl-2.0", "size": 226306 }
[ "java.lang.reflect.Field" ]
import java.lang.reflect.Field;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,052,475
public final AdaptrisMessage moveMetadata(Message in, AdaptrisMessage out) throws JMSException { if (!(context.metadataFilter() instanceof RemoveAllMetadataFilter)) { MetadataCollection metadata = createMetadataCollection(in); MetadataCollection filtered = context.metadataFilter().filter(metadata); ...
final AdaptrisMessage function(Message in, AdaptrisMessage out) throws JMSException { if (!(context.metadataFilter() instanceof RemoveAllMetadataFilter)) { MetadataCollection metadata = createMetadataCollection(in); MetadataCollection filtered = context.metadataFilter().filter(metadata); for (MetadataElement e : filter...
/** * <p> * Moves metadata from a <code>javax.jms.Message</code> to a <code>AdaptrisMessage</code> if <code>moveMetadata</code> is * <code>true</code>. * </p> * * @param in the JMS <code>Message</code> to move metadata from * @param out the <code>AdaptrisMessage</code> to move metadata to * @ret...
Moves metadata from a <code>javax.jms.Message</code> to a <code>AdaptrisMessage</code> if <code>moveMetadata</code> is <code>true</code>.
moveMetadata
{ "repo_name": "adaptris/interlok", "path": "interlok-core/src/main/java/com/adaptris/core/jms/MetadataHandler.java", "license": "apache-2.0", "size": 9685 }
[ "com.adaptris.core.AdaptrisMessage", "com.adaptris.core.MetadataCollection", "com.adaptris.core.MetadataElement", "com.adaptris.core.metadata.RemoveAllMetadataFilter", "javax.jms.JMSException", "javax.jms.Message" ]
import com.adaptris.core.AdaptrisMessage; import com.adaptris.core.MetadataCollection; import com.adaptris.core.MetadataElement; import com.adaptris.core.metadata.RemoveAllMetadataFilter; import javax.jms.JMSException; import javax.jms.Message;
import com.adaptris.core.*; import com.adaptris.core.metadata.*; import javax.jms.*;
[ "com.adaptris.core", "javax.jms" ]
com.adaptris.core; javax.jms;
2,143,166
@Override public void execute() { if (activeBridge != null) { // Get settings and update the bulbs // Observation : If the power of a hue lamp is removed, the status is not updated in hue hub. // The heartbeat functionality should fix this, but HueSettings settings = activeBridge.getSettings(); ...
void function() { if (activeBridge != null) { HueSettings settings = activeBridge.getSettings(); if(settings==null){ logger.warn(STR); return; } Map<Integer, HueTapState> pressedTaps = tapStates.findPressedTapDevices(settings); if(pressedTaps.size()>0){ logger.debug(STR+pressedTaps.size()+STR); } for (int i = 1; i <= s...
/** * Get current hue settings of the bulbs and update the items that are connected with the bulb. * The refreshinterval determines the polling frequency. */
Get current hue settings of the bulbs and update the items that are connected with the bulb. The refreshinterval determines the polling frequency
execute
{ "repo_name": "gernoteger/openhab_contributions", "path": "bundles/binding/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/HueBinding.java", "license": "epl-1.0", "size": 13168 }
[ "java.util.Map", "org.openhab.binding.hue.HueBindingProvider", "org.openhab.binding.hue.internal.data.HueSettings", "org.openhab.binding.hue.internal.hardware.HueBulb", "org.openhab.binding.hue.internal.hardware.HueTapState" ]
import java.util.Map; import org.openhab.binding.hue.HueBindingProvider; import org.openhab.binding.hue.internal.data.HueSettings; import org.openhab.binding.hue.internal.hardware.HueBulb; import org.openhab.binding.hue.internal.hardware.HueTapState;
import java.util.*; import org.openhab.binding.hue.*; import org.openhab.binding.hue.internal.data.*; import org.openhab.binding.hue.internal.hardware.*;
[ "java.util", "org.openhab.binding" ]
java.util; org.openhab.binding;
470,912
public boolean equals(ConvexPolytope convpoly) { Vector<Geometry2D.LineSegment> edges1 = convpoly.getEdgesGeo2D(); Vector<Geometry2D.LineSegment> edges2 = this.getEdgesGeo2D(); for(int i=0;i<edges1.size();i++){ Geometry2D.LineSegment ls = (Geometry2D.LineSegment) edges1.elementAt(i); if...
boolean function(ConvexPolytope convpoly) { Vector<Geometry2D.LineSegment> edges1 = convpoly.getEdgesGeo2D(); Vector<Geometry2D.LineSegment> edges2 = this.getEdgesGeo2D(); for(int i=0;i<edges1.size();i++){ Geometry2D.LineSegment ls = (Geometry2D.LineSegment) edges1.elementAt(i); if(!edges2.contains(ls)) return false; }...
/** * Checks if two ConvexPolytopes are the identical. * * @param convpoly the Convpoly to compare with * @return true if the ConvexPolytopes are identical, else false */
Checks if two ConvexPolytopes are the identical
equals
{ "repo_name": "stochastics-ulm-university/GeoLing", "path": "src/geoling/util/sim/grain/ConvexPolytope.java", "license": "gpl-3.0", "size": 15306 }
[ "java.util.Vector" ]
import java.util.Vector;
import java.util.*;
[ "java.util" ]
java.util;
150,333
private TreeSet<Integer> union(TreeSet<Integer> u, TreeSet<Integer> v){ TreeSet<Integer> s = new TreeSet<Integer>(); s.addAll(u); s.addAll(v); return s; }
TreeSet<Integer> function(TreeSet<Integer> u, TreeSet<Integer> v){ TreeSet<Integer> s = new TreeSet<Integer>(); s.addAll(u); s.addAll(v); return s; }
/** * Union of u and v * @param u * @param v * @return Union */
Union of u and v
union
{ "repo_name": "CeriAvignon/GraphCentrality", "path": "src/fr/univavignon/graphcentr/g01/CliqueTreeSet.java", "license": "lgpl-3.0", "size": 8333 }
[ "java.util.TreeSet" ]
import java.util.TreeSet;
import java.util.*;
[ "java.util" ]
java.util;
456,645
private boolean hasFallTruComment(DetailAST aCurrentCase, DetailAST aNextCase) { final int startLineNo = aCurrentCase.getLineNo(); final int endLineNo = aNextCase.getLineNo(); final int endColNo = aNextCase.getColumnNo(); final String[] lines = getLines(); ...
boolean function(DetailAST aCurrentCase, DetailAST aNextCase) { final int startLineNo = aCurrentCase.getLineNo(); final int endLineNo = aNextCase.getLineNo(); final int endColNo = aNextCase.getColumnNo(); final String[] lines = getLines(); final String linepart = lines[endLineNo - 1].substring(0, endColNo); if (comment...
/** * Determines if the fall through case between <code>aCurrentCase</code> and * <code>aNextCase</code> is reliefed by a appropriate comment. * * @param aCurrentCase AST of the case that falls through to the next case. * @param aNextCase AST of the next case. * @return True if a relief co...
Determines if the fall through case between <code>aCurrentCase</code> and <code>aNextCase</code> is reliefed by a appropriate comment
hasFallTruComment
{ "repo_name": "gkzhong/checkstyle", "path": "src/checkstyle/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java", "license": "lgpl-2.1", "size": 13158 }
[ "com.puppycrawl.tools.checkstyle.api.DetailAST" ]
import com.puppycrawl.tools.checkstyle.api.DetailAST;
import com.puppycrawl.tools.checkstyle.api.*;
[ "com.puppycrawl.tools" ]
com.puppycrawl.tools;
1,521,561
public void testDescendingSize() { NavigableMap map = dmap5(); NavigableMap empty = dmap0(); assertEquals(0, empty.size()); assertEquals(5, map.size()); }
void function() { NavigableMap map = dmap5(); NavigableMap empty = dmap0(); assertEquals(0, empty.size()); assertEquals(5, map.size()); }
/** * size returns the correct values */
size returns the correct values
testDescendingSize
{ "repo_name": "life-beam/j2objc", "path": "jre_emul/android/platform/libcore/jsr166-tests/src/test/java/jsr166/TreeSubMapTest.java", "license": "apache-2.0", "size": 32611 }
[ "java.util.NavigableMap" ]
import java.util.NavigableMap;
import java.util.*;
[ "java.util" ]
java.util;
1,534,435
protected synchronized void onResponse(Response response) { for (ActionListener<Response> listener : completionListeners) { listener.onResponse(response); } }
synchronized void function(Response response) { for (ActionListener<Response> listener : completionListeners) { listener.onResponse(response); } }
/** * This method is called when the task is finished successfully before unregistering the task and storing the results */
This method is called when the task is finished successfully before unregistering the task and storing the results
onResponse
{ "repo_name": "robin13/elasticsearch", "path": "x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/async/StoredAsyncTask.java", "license": "apache-2.0", "size": 3454 }
[ "org.elasticsearch.action.ActionListener" ]
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
2,207,007
private static boolean shouldWriteSignature (String fileName, boolean append) { return shouldWriteSignature(new File(fileName),append); }
static boolean function (String fileName, boolean append) { return shouldWriteSignature(new File(fileName),append); }
/** * Checks whether signature injection should take place for the * given file and output mode. * * @param fileName The file name. * @param append True if data should be appended to the file. * * @return True if so. */
Checks whether signature injection should take place for the given file and output mode
shouldWriteSignature
{ "repo_name": "nagyist/marketcetera", "path": "trunk/util/src/main/java/org/marketcetera/util/unicode/UnicodeFileWriter.java", "license": "apache-2.0", "size": 13193 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
635,938
@Test public void testGetComponentHistory() throws Exception { final String uri = helper.getBaseUrl() + "/flow/history/components/my-component-id"; // will succeed due to controller level access // read ClientResponse response = helper.getReadUser().testGet(uri); assert...
void function() throws Exception { final String uri = helper.getBaseUrl() + STR; ClientResponse response = helper.getReadUser().testGet(uri); assertEquals(200, response.getStatus()); response = helper.getReadWriteUser().testGet(uri); assertEquals(200, response.getStatus()); response = helper.getWriteUser().testGet(uri)...
/** * Test get action. * * @throws Exception exception */
Test get action
testGetComponentHistory
{ "repo_name": "jjmeyer0/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/ITFlowAccessControl.java", "license": "apache-2.0", "size": 7875 }
[ "com.sun.jersey.api.client.ClientResponse", "org.junit.Assert" ]
import com.sun.jersey.api.client.ClientResponse; import org.junit.Assert;
import com.sun.jersey.api.client.*; import org.junit.*;
[ "com.sun.jersey", "org.junit" ]
com.sun.jersey; org.junit;
281,260
public void export(Path targetDir) throws IOException { ExportUtil.Builder builder = new ExportUtil.Builder(db); builder.setHeader(true); LOGGER.debug("Exporting all tables"); builder.exportAll(targetDir.toFile()); }
void function(Path targetDir) throws IOException { ExportUtil.Builder builder = new ExportUtil.Builder(db); builder.setHeader(true); LOGGER.debug(STR); builder.exportAll(targetDir.toFile()); }
/** * Exports all tables to separate CSV files. * * @param targetDir the target directory for the CSV files * @throws IOException if there was an error reading the source database or writing the target files */
Exports all tables to separate CSV files
export
{ "repo_name": "hzpz/access-export", "path": "src/main/java/net/kockert/access/export/CSVExporter.java", "license": "mpl-2.0", "size": 2093 }
[ "com.healthmarketscience.jackcess.util.ExportUtil", "java.io.IOException", "java.nio.file.Path" ]
import com.healthmarketscience.jackcess.util.ExportUtil; import java.io.IOException; import java.nio.file.Path;
import com.healthmarketscience.jackcess.util.*; import java.io.*; import java.nio.file.*;
[ "com.healthmarketscience.jackcess", "java.io", "java.nio" ]
com.healthmarketscience.jackcess; java.io; java.nio;
133,258
private OpenSprinklerBindingProvider findFirstMatchingBindingProvider(String itemName, Command command) { OpenSprinklerBindingProvider firstMatchingProvider = null; for (OpenSprinklerBindingProvider provider : this.providers) { boolean match = provider.providesBindingFor(itemName); if (match) { ...
OpenSprinklerBindingProvider function(String itemName, Command command) { OpenSprinklerBindingProvider firstMatchingProvider = null; for (OpenSprinklerBindingProvider provider : this.providers) { boolean match = provider.providesBindingFor(itemName); if (match) { firstMatchingProvider = provider; break; } } return firs...
/** * Find the first matching {@link OpenSprinklerBindingProvider} according to * <code>itemName</code> and <code>command</code>. * * @param itemName * @param command * * @return the matching binding provider or <code>null</code> if no binding * provider could be found */
Find the first matching <code>OpenSprinklerBindingProvider</code> according to <code>itemName</code> and <code>command</code>
findFirstMatchingBindingProvider
{ "repo_name": "clinique/openhab", "path": "bundles/binding/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/internal/OpenSprinklerBinding.java", "license": "epl-1.0", "size": 10075 }
[ "org.openhab.binding.opensprinkler.OpenSprinklerBindingProvider", "org.openhab.core.types.Command" ]
import org.openhab.binding.opensprinkler.OpenSprinklerBindingProvider; import org.openhab.core.types.Command;
import org.openhab.binding.opensprinkler.*; import org.openhab.core.types.*;
[ "org.openhab.binding", "org.openhab.core" ]
org.openhab.binding; org.openhab.core;
52,800
public static Collection<Track> search(String artist, String track, int limit, String apiKey) { Map<String, String> params = new HashMap<String, String>(); params.put("track", track); params.put("limit", String.valueOf(limit)); MapUtilities.nullSafePut(params, "artist", artist); Result result = Caller.getI...
static Collection<Track> function(String artist, String track, int limit, String apiKey) { Map<String, String> params = new HashMap<String, String>(); params.put("track", track); params.put("limit", String.valueOf(limit)); MapUtilities.nullSafePut(params, STR, artist); Result result = Caller.getInstance().call(STR, api...
/** * Searches for a track with the given name and returns a list of possible matches. * Specify an artist name or a limit to narrow down search results. * Pass <code>null</code> for the artist parameter if you want to specify a limit but don't want * to define an artist. * * @param artist Artist's name or ...
Searches for a track with the given name and returns a list of possible matches. Specify an artist name or a limit to narrow down search results. Pass <code>null</code> for the artist parameter if you want to specify a limit but don't want to define an artist
search
{ "repo_name": "xyleisure/helloww", "path": "src/main/java/de/umass/lastfm/Track.java", "license": "bsd-2-clause", "size": 29678 }
[ "de.umass.util.MapUtilities", "de.umass.xml.DomElement", "java.util.Collection", "java.util.Collections", "java.util.HashMap", "java.util.Map" ]
import de.umass.util.MapUtilities; import de.umass.xml.DomElement; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map;
import de.umass.util.*; import de.umass.xml.*; import java.util.*;
[ "de.umass.util", "de.umass.xml", "java.util" ]
de.umass.util; de.umass.xml; java.util;
702,977
@Test public void testLinkAccountByReauthentication_forgetPassword() throws Exception { brokerServerRule.update(new KeycloakRule.KeycloakSetup() {
void function() throws Exception { brokerServerRule.update(new KeycloakRule.KeycloakSetup() {
/** * Tests that duplication is detected and user wants to link federatedIdentity with existing account. He will confirm link by reauthentication (confirm password on login screen) * and additionally he goes through "forget password" */
Tests that duplication is detected and user wants to link federatedIdentity with existing account. He will confirm link by reauthentication (confirm password on login screen) and additionally he goes through "forget password"
testLinkAccountByReauthentication_forgetPassword
{ "repo_name": "didiez/keycloak", "path": "testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractFirstBrokerLoginTest.java", "license": "apache-2.0", "size": 20452 }
[ "org.keycloak.testsuite.rule.KeycloakRule" ]
import org.keycloak.testsuite.rule.KeycloakRule;
import org.keycloak.testsuite.rule.*;
[ "org.keycloak.testsuite" ]
org.keycloak.testsuite;
2,077,745
public void contextInitialized(ServletContextEvent event) { this.context = event.getServletContext(); log("contextInitialized()"); }
void function(ServletContextEvent event) { this.context = event.getServletContext(); log(STR); }
/** * Record the fact that this web application has been initialized. * * @param event The servlet context event */
Record the fact that this web application has been initialized
contextInitialized
{ "repo_name": "CDLUC3/datashare", "path": "tomcat/webapps/examples/WEB-INF/classes/listeners/SessionListener.java", "license": "bsd-3-clause", "size": 4377 }
[ "javax.servlet.ServletContextEvent" ]
import javax.servlet.ServletContextEvent;
import javax.servlet.*;
[ "javax.servlet" ]
javax.servlet;
1,617,480
@Test public void testCreatingAColumnTypeNullable() { ColumnType columnType = SchemaUtils.type(DataType.STRING, 10, 0, true); assertTrue("ColumnType type incorrect", columnType.getType().equals(DataType.STRING)); assertTrue("ColumnType width incorrect", columnType.getWidth() == 10); assertTrue(...
void function() { ColumnType columnType = SchemaUtils.type(DataType.STRING, 10, 0, true); assertTrue(STR, columnType.getType().equals(DataType.STRING)); assertTrue(STR, columnType.getWidth() == 10); assertTrue(STR, columnType.getScale() == 0); assertTrue(STR, columnType.isNullable()); }
/** * Tests that the type method creates a {@link ColumnType} with the requested properties and is nullable. */
Tests that the type method creates a <code>ColumnType</code> with the requested properties and is nullable
testCreatingAColumnTypeNullable
{ "repo_name": "badgerwithagun/morf", "path": "morf-core/src/test/java/org/alfasoftware/morf/metadata/TestSchemaUtils.java", "license": "apache-2.0", "size": 3968 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
602,476
private void initialize(int permissions, Color background) { if (background != null) setBackground(background); initComponents(permissions); buildGUI(); } public PermissionsPane() { this(GroupData.PERMISSIONS_PRIVATE); } public PermissionsPane(Color background) { this(GroupData....
void function(int permissions, Color background) { if (background != null) setBackground(background); initComponents(permissions); buildGUI(); } PermissionsPane() { this(GroupData.PERMISSIONS_PRIVATE); } public PermissionsPane(Color background) { this(GroupData.PERMISSIONS_PRIVATE, background); } public PermissionsPane...
/** * Initializes and builds the UI * * @param permissions The permissions level. * @param background The background color or <code>null</code>. */
Initializes and builds the UI
initialize
{ "repo_name": "hflynn/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/util/ui/PermissionsPane.java", "license": "gpl-2.0", "size": 15259 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,943,710
private int isFastConnection(int connectionSpeed) { switch (connectionSpeed) { case UserCredentials.HIGH: return RenderingControl.UNCOMPRESSED; case UserCredentials.MEDIUM: return RenderingControl.MEDIUM; case UserCredentials.LOW: ...
int function(int connectionSpeed) { switch (connectionSpeed) { case UserCredentials.HIGH: return RenderingControl.UNCOMPRESSED; case UserCredentials.MEDIUM: return RenderingControl.MEDIUM; case UserCredentials.LOW: default: return RenderingControl.LOW; } }
/** * Returns <code>true</code> if the connection is fast, * <code>false</code> otherwise. * * @param connectionSpeed The connection speed. * @return See above. */
Returns <code>true</code> if the connection is fast, <code>false</code> otherwise
isFastConnection
{ "repo_name": "stelfrich/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/DataServicesFactory.java", "license": "gpl-2.0", "size": 28422 }
[ "org.openmicroscopy.shoola.env.data.login.UserCredentials", "org.openmicroscopy.shoola.env.rnd.RenderingControl" ]
import org.openmicroscopy.shoola.env.data.login.UserCredentials; import org.openmicroscopy.shoola.env.rnd.RenderingControl;
import org.openmicroscopy.shoola.env.data.login.*; import org.openmicroscopy.shoola.env.rnd.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
1,822,327
public RestClientBuilder setRequestConfigCallback(RequestConfigCallback requestConfigCallback) { Objects.requireNonNull(requestConfigCallback, "requestConfigCallback must not be null"); this.requestConfigCallback = requestConfigCallback; return this; }
RestClientBuilder function(RequestConfigCallback requestConfigCallback) { Objects.requireNonNull(requestConfigCallback, STR); this.requestConfigCallback = requestConfigCallback; return this; }
/** * Sets the {@link RequestConfigCallback} to be used to customize http client configuration * * @throws NullPointerException if {@code requestConfigCallback} is {@code null}. */
Sets the <code>RequestConfigCallback</code> to be used to customize http client configuration
setRequestConfigCallback
{ "repo_name": "gingerwizard/elasticsearch", "path": "client/rest/src/main/java/org/elasticsearch/client/RestClientBuilder.java", "license": "apache-2.0", "size": 11413 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
2,117,210
@Reference( name = "oauth.config.service", service = OAuthServerConfiguration.class, cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.DYNAMIC, unbind = "unsetOauthServerConfiguration") protected void setOauthServerConfiguration(OA...
@Reference( name = STR, service = OAuthServerConfiguration.class, cardinality = ReferenceCardinality.MANDATORY, policy = ReferencePolicy.DYNAMIC, unbind = STR) void function(OAuthServerConfiguration oauthServerConfiguration) { ServiceReferenceHolder.getInstance().setOauthServerConfiguration(oauthServerConfiguration); }
/** * Initialize the Oauth Server configuration Service Service dependency * * @param oauthServerConfiguration Output EventAdapter Service reference */
Initialize the Oauth Server configuration Service Service dependency
setOauthServerConfiguration
{ "repo_name": "nuwand/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/internal/APIManagerComponent.java", "license": "apache-2.0", "size": 51979 }
[ "org.osgi.service.component.annotations.Reference", "org.osgi.service.component.annotations.ReferenceCardinality", "org.osgi.service.component.annotations.ReferencePolicy", "org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration" ]
import org.osgi.service.component.annotations.Reference; import org.osgi.service.component.annotations.ReferenceCardinality; import org.osgi.service.component.annotations.ReferencePolicy; import org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration;
import org.osgi.service.component.annotations.*; import org.wso2.carbon.identity.oauth.config.*;
[ "org.osgi.service", "org.wso2.carbon" ]
org.osgi.service; org.wso2.carbon;
641,455
private void jbInit () throws Exception { int width = 150; centerPanel.setLayout (centerLayout); fNode.setReadWrite (false); fDescription.setReadWrite (false); fDescription.setPreferredSize(new Dimension (width,40)); fHelp.setReadWrite (false); fHelp.setPreferredSize(new Dimension (width,40));...
void function () throws Exception { int width = 150; centerPanel.setLayout (centerLayout); fNode.setReadWrite (false); fDescription.setReadWrite (false); fDescription.setPreferredSize(new Dimension (width,40)); fHelp.setReadWrite (false); fHelp.setPreferredSize(new Dimension (width,40)); fHistory.setReadWrite (false); ...
/** * Static Init. * Called after Dynamic Init * @throws Exception */
Static Init. Called after Dynamic Init
jbInit
{ "repo_name": "arthurmelo88/palmetalADP", "path": "adempiere_360/client/src/org/compiere/apps/wf/WFActivity.java", "license": "gpl-2.0", "size": 25927 }
[ "java.awt.Dimension", "javax.swing.event.TableColumnModelListener", "org.compiere.minigrid.IDColumn" ]
import java.awt.Dimension; import javax.swing.event.TableColumnModelListener; import org.compiere.minigrid.IDColumn;
import java.awt.*; import javax.swing.event.*; import org.compiere.minigrid.*;
[ "java.awt", "javax.swing", "org.compiere.minigrid" ]
java.awt; javax.swing; org.compiere.minigrid;
2,772,317
void setViewState(GroupViewState viewState) { if (nonNull(getGrouping())) { getGrouping().fileIds().removeListener(filesSyncListener); } if (isNull(viewState) || isNull(viewState.getGroup())) { this.grouping.set(null); Platform.runLater(() -> { ...
void setViewState(GroupViewState viewState) { if (nonNull(getGrouping())) { getGrouping().fileIds().removeListener(filesSyncListener); } if (isNull(viewState) isNull(viewState.getGroup())) { this.grouping.set(null); Platform.runLater(() -> { gridView.getItems().setAll(Collections.emptyList()); setCenter(null); groupLab...
/** * assigns a grouping for this pane to represent and initializes grouping * specific properties and listeners * * @param grouping the new grouping assigned to this group */
assigns a grouping for this pane to represent and initializes grouping specific properties and listeners
setViewState
{ "repo_name": "sidheshenator/autopsy", "path": "ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/GroupPane.java", "license": "apache-2.0", "size": 33320 }
[ "java.util.Collections", "java.util.Objects", "org.sleuthkit.autopsy.casemodule.Case", "org.sleuthkit.autopsy.imagegallery.grouping.GroupViewMode", "org.sleuthkit.autopsy.imagegallery.grouping.GroupViewState" ]
import java.util.Collections; import java.util.Objects; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.imagegallery.grouping.GroupViewMode; import org.sleuthkit.autopsy.imagegallery.grouping.GroupViewState;
import java.util.*; import org.sleuthkit.autopsy.casemodule.*; import org.sleuthkit.autopsy.imagegallery.grouping.*;
[ "java.util", "org.sleuthkit.autopsy" ]
java.util; org.sleuthkit.autopsy;
2,573,569
void addReference(IReference reference) throws CouldntSaveDataException;
void addReference(IReference reference) throws CouldntSaveDataException;
/** * Adds an outgoing code or data reference to the operand tree node. * * @param reference The reference to add. * * @throws CouldntSaveDataException Thrown if the reference could not be saved in the database. */
Adds an outgoing code or data reference to the operand tree node
addReference
{ "repo_name": "chubbymaggie/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/disassembly/INaviOperandTreeNode.java", "license": "apache-2.0", "size": 4208 }
[ "com.google.security.zynamics.binnavi.Database", "com.google.security.zynamics.zylib.disassembly.IReference" ]
import com.google.security.zynamics.binnavi.Database; import com.google.security.zynamics.zylib.disassembly.IReference;
import com.google.security.zynamics.binnavi.*; import com.google.security.zynamics.zylib.disassembly.*;
[ "com.google.security" ]
com.google.security;
1,441,872
Object query(PreparedStatementCreator psc, ResultSetExtractor rse) throws DataAccessException;
Object query(PreparedStatementCreator psc, ResultSetExtractor rse) throws DataAccessException;
/** * Query using a prepared statement, reading the ResultSet with a * ResultSetExtractor. * <p>A PreparedStatementCreator can either be implemented directly or * configured through a PreparedStatementCreatorFactory. * @param psc object that can create a PreparedStatement given a Connection * @param r...
Query using a prepared statement, reading the ResultSet with a ResultSetExtractor. A PreparedStatementCreator can either be implemented directly or configured through a PreparedStatementCreatorFactory
query
{ "repo_name": "codeApeFromChina/resource", "path": "frame_packages/java_libs/spring-2.5.6-src/src/org/springframework/jdbc/core/JdbcOperations.java", "license": "unlicense", "size": 47160 }
[ "org.springframework.dao.DataAccessException" ]
import org.springframework.dao.DataAccessException;
import org.springframework.dao.*;
[ "org.springframework.dao" ]
org.springframework.dao;
2,489,713
public void deleteGroup(final String groupId) { final UUID locationId = UUID.fromString("5966283b-4196-4d57-9211-1b68f41ec1c2"); //$NON-NLS-1$ final ApiResourceVersion apiVersion = new ApiResourceVersion("3.1-preview.1"); //$NON-NLS-1$ final Map<String, Object> routeValues = new HashMap<S...
void function(final String groupId) { final UUID locationId = UUID.fromString(STR); final ApiResourceVersion apiVersion = new ApiResourceVersion(STR); final Map<String, Object> routeValues = new HashMap<String, Object>(); routeValues.put(STR, groupId); final VssRestRequest httpRequest = super.createRequest(HttpMethod.D...
/** * [Preview API 3.1-preview.1] * * @param groupId * */
[Preview API 3.1-preview.1]
deleteGroup
{ "repo_name": "Microsoft/vso-httpclient-java", "path": "Rest/alm-vss-client/src/main/generated/com/microsoft/alm/visualstudio/services/identity/client/IdentityHttpClientBase.java", "license": "mit", "size": 37296 }
[ "com.microsoft.alm.client.HttpMethod", "com.microsoft.alm.client.VssMediaTypes", "com.microsoft.alm.client.VssRestRequest", "com.microsoft.alm.visualstudio.services.webapi.ApiResourceVersion", "java.util.HashMap", "java.util.Map", "java.util.UUID" ]
import com.microsoft.alm.client.HttpMethod; import com.microsoft.alm.client.VssMediaTypes; import com.microsoft.alm.client.VssRestRequest; import com.microsoft.alm.visualstudio.services.webapi.ApiResourceVersion; import java.util.HashMap; import java.util.Map; import java.util.UUID;
import com.microsoft.alm.client.*; import com.microsoft.alm.visualstudio.services.webapi.*; import java.util.*;
[ "com.microsoft.alm", "java.util" ]
com.microsoft.alm; java.util;
2,694,161
private final RpcPacket procCreate(NFSSrvSession sess, RpcPacket rpc) { // Unpack the create arguments byte[] handle = new byte[NFS.FileHandleSize]; rpc.unpackByteArrayWithLength(handle); String fileName = rpc.unpackUTF8String(); int createMode = rpc.unpackInt(); // DEBUG if (Deb...
final RpcPacket function(NFSSrvSession sess, RpcPacket rpc) { byte[] handle = new byte[NFS.FileHandleSize]; rpc.unpackByteArrayWithLength(handle); String fileName = rpc.unpackUTF8String(); int createMode = rpc.unpackInt(); if (Debug.EnableInfo && hasDebugFlag(DBG_FILE)) sess.debugPrintln(STR + rpc.getClientDetails() + ...
/** * Process the create file request * * @param sess NFSSrvSession * @param rpc RpcPacket * @return RpcPacket */
Process the create file request
procCreate
{ "repo_name": "loftuxab/community-edition-old", "path": "projects/alfresco-jlan/source/java/org/alfresco/jlan/oncrpc/nfs/NFSServer.java", "license": "lgpl-3.0", "size": 140029 }
[ "org.alfresco.jlan.debug.Debug", "org.alfresco.jlan.oncrpc.Rpc", "org.alfresco.jlan.oncrpc.RpcPacket", "org.alfresco.jlan.server.filesys.AccessDeniedException", "org.alfresco.jlan.server.filesys.AccessMode", "org.alfresco.jlan.server.filesys.DiskDeviceContext", "org.alfresco.jlan.server.filesys.DiskInte...
import org.alfresco.jlan.debug.Debug; import org.alfresco.jlan.oncrpc.Rpc; import org.alfresco.jlan.oncrpc.RpcPacket; import org.alfresco.jlan.server.filesys.AccessDeniedException; import org.alfresco.jlan.server.filesys.AccessMode; import org.alfresco.jlan.server.filesys.DiskDeviceContext; import org.alfresco.jlan.ser...
import org.alfresco.jlan.debug.*; import org.alfresco.jlan.oncrpc.*; import org.alfresco.jlan.server.filesys.*;
[ "org.alfresco.jlan" ]
org.alfresco.jlan;
1,629,305
public int registerResultSetOutParameter(CallableStatement statement, int position) throws SQLException { throw new UnsupportedOperationException(getClass().getName() + " does not support resultsets via stored procedures"); }
int function(CallableStatement statement, int position) throws SQLException { throw new UnsupportedOperationException(getClass().getName() + STR); }
/** * Registers an OUT parameter which will be returing a * {@link java.sql.ResultSet}. How this is accomplished varies greatly from DB * to DB, hence its inclusion (along with {@link #getResultSet}) here. * * @param statement * The callable statement. * @param position * The ...
Registers an OUT parameter which will be returing a <code>java.sql.ResultSet</code>. How this is accomplished varies greatly from DB to DB, hence its inclusion (along with <code>#getResultSet</code>) here
registerResultSetOutParameter
{ "repo_name": "elminsterjimmy/java", "path": "EasyDaoFramework/src/main/java/com/elminster/easydao/db/dialect/Dialect.java", "license": "apache-2.0", "size": 4445 }
[ "java.sql.CallableStatement", "java.sql.SQLException" ]
import java.sql.CallableStatement; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,527,282
@Test void testFilterClauseWithNoConjunction() { String sql = "select sum(\"store_sales\")" + "from \"foodmart\" where \"product_id\" > 1555 or \"store_cost\" > 5 or extract(year " + "from \"timestamp\") = 1997 " + "group by floor(\"timestamp\" to DAY),\"product_id\""; sql(sql) ...
@Test void testFilterClauseWithNoConjunction() { String sql = STRstore_sales\")" + STRfoodmart\STRproduct_id\STRstore_cost\STR + STRtimestamp\STR + STRtimestamp\STRproduct_id\STR\STR:\STRSTR{\"type\":\STR,STR\STR:\STR,\STR:\"5\",\STR:true,STR\STR:\STR}")) .runs(); }
/** * Test case for * <a href="https://issues.apache.org/jira/browse/CALCITE-2098">[CALCITE-2098] * Push filters to Druid Query Scan when we have OR of AND clauses</a>. * * <p>Need to make sure that when there we have a valid filter with no * conjunction we still push all the valid filters. */
Test case for [CALCITE-2098] Push filters to Druid Query Scan when we have OR of AND clauses. Need to make sure that when there we have a valid filter with no conjunction we still push all the valid filters
testFilterClauseWithNoConjunction
{ "repo_name": "datametica/calcite", "path": "druid/src/test/java/org/apache/calcite/test/DruidAdapter2IT.java", "license": "apache-2.0", "size": 201561 }
[ "org.junit.jupiter.api.Test" ]
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.*;
[ "org.junit.jupiter" ]
org.junit.jupiter;
102,700
long toTimelineValue(Date date);
long toTimelineValue(Date date);
/** * Translates a date into a value on this timeline. * * @param date the date. * * @return A timeline value */
Translates a date into a value on this timeline
toTimelineValue
{ "repo_name": "JSansalone/JFreeChart", "path": "source/org/jfree/chart/axis/Timeline.java", "license": "lgpl-2.1", "size": 5672 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,380,175
public Set<SpaceVertex> getVertices(){ return vertices; }
Set<SpaceVertex> function(){ return vertices; }
/** * Access the set of all the vertices in this graph.<br> * The set which is returned <B>MUST NOT be modified</B> or this graph will be in an undefined state * @return The Set of all vertices in this graph */
Access the set of all the vertices in this graph. The set which is returned MUST NOT be modified or this graph will be in an undefined state
getVertices
{ "repo_name": "jffry/olin-directions", "path": "edu/olin/maps/graph/weighted/space/SpaceGraph.java", "license": "gpl-2.0", "size": 9358 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,645,532
protected KeyStore loadKeyStore() throws Exception { return _keyStore != null ? _keyStore : getKeyStore(_keyStoreInputStream, _keyStorePath, _keyStoreType, _keyStoreProvider, _keyStorePassword==null? null: _keyStorePassword.toString()); }
KeyStore function() throws Exception { return _keyStore != null ? _keyStore : getKeyStore(_keyStoreInputStream, _keyStorePath, _keyStoreType, _keyStoreProvider, _keyStorePassword==null? null: _keyStorePassword.toString()); }
/** * Override this method to provide alternate way to load a keystore. * * @return the key store instance * @throws Exception if the keystore cannot be loaded */
Override this method to provide alternate way to load a keystore
loadKeyStore
{ "repo_name": "itead/IoTgo_Android_App", "path": "plugins/com.knowledgecode.cordova.websocket/src/android/org/eclipse/jetty/util/ssl/SslContextFactory.java", "license": "mit", "size": 50483 }
[ "java.security.KeyStore" ]
import java.security.KeyStore;
import java.security.*;
[ "java.security" ]
java.security;
1,860,981
public XMLSchemaReference getSchemaReference() { return schemaReference; }
XMLSchemaReference function() { return schemaReference; }
/** * PUBLIC: * Return the SchemaReference associated with this descriptor * @return the SchemaReference associated with this descriptor * @see org.eclipse.persistence.oxm.schema */
Return the SchemaReference associated with this descriptor
getSchemaReference
{ "repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs", "path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/XMLDescriptor.java", "license": "epl-1.0", "size": 45778 }
[ "org.eclipse.persistence.oxm.schema.XMLSchemaReference" ]
import org.eclipse.persistence.oxm.schema.XMLSchemaReference;
import org.eclipse.persistence.oxm.schema.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
172,685
public PrintStream getStdout() { return mStdout; }
PrintStream function() { return mStdout; }
/** * Access the caller's stdout output stream. */
Access the caller's stdout output stream
getStdout
{ "repo_name": "facebook/stetho", "path": "stetho/src/main/java/com/facebook/stetho/dumpapp/DumperContext.java", "license": "mit", "size": 2052 }
[ "java.io.PrintStream" ]
import java.io.PrintStream;
import java.io.*;
[ "java.io" ]
java.io;
710,591
public static CommandResult execCommand(List<String> commands, boolean isRoot, boolean isNeedResultMsg) { return execCommand(commands == null ? null : commands.toArray(new String[]{}), isRoot, isNeedResultMsg); }
static CommandResult function(List<String> commands, boolean isRoot, boolean isNeedResultMsg) { return execCommand(commands == null ? null : commands.toArray(new String[]{}), isRoot, isNeedResultMsg); }
/** * execute shell commands * * @param commands command list * @param isRoot whether need to run with root * @param isNeedResultMsg whether need result msg * @return * @see ShellUtils#execCommand(String[], boolean, boolean) */
execute shell commands
execCommand
{ "repo_name": "sssemil/wear_AdvancedSettings", "path": "wear_languagesettingsprovider/src/main/java/sssemil/com/languagesettingsprovider/ShellUtils.java", "license": "gpl-3.0", "size": 8844 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,841,426
public String[] getAutowireCandidatePatterns() { String candidatePattern = this.defaults.getAutowireCandidates(); return (candidatePattern != null ? StringUtils.commaDelimitedListToStringArray(candidatePattern) : null); } /** * Parses the supplied {@code &lt;bean&gt;} element. May return {@code null}
String[] function() { String candidatePattern = this.defaults.getAutowireCandidates(); return (candidatePattern != null ? StringUtils.commaDelimitedListToStringArray(candidatePattern) : null); } /** * Parses the supplied {@code &lt;bean&gt;} element. May return {@code null}
/** * Return any patterns provided in the 'default-autowire-candidates' * attribute of the top-level {@code &lt;beans/&gt;} element. */
Return any patterns provided in the 'default-autowire-candidates' attribute of the top-level &lt;beans/&gt; element
getAutowireCandidatePatterns
{ "repo_name": "kingtang/spring-learn", "path": "spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java", "license": "gpl-3.0", "size": 56570 }
[ "org.springframework.util.StringUtils" ]
import org.springframework.util.StringUtils;
import org.springframework.util.*;
[ "org.springframework.util" ]
org.springframework.util;
1,150,304
@Override public void setValue(int index, Object value) { checkValid(index); // check updatable checkUpdateable(); // Special case ParentRecord if (value instanceof DBRecordBase) { // Special case: Value contains parent record setParentRecord(get...
void function(int index, Object value) { checkValid(index); checkUpdateable(); if (value instanceof DBRecordBase) { setParentRecord(getColumn(index), (DBRecordBase)value); return; } if ((value instanceof String) && ((String)value).length()==0) value = null; Object current = fields[index]; if (current==ObjectUtils.NO_VA...
/** * Sets the value of a column in the record. * The functions checks if the column and the value are valid and whether the * value has changed. * * @param index the index of the column * @param value the value */
Sets the value of a column in the record. The functions checks if the column and the value are valid and whether the value has changed
setValue
{ "repo_name": "apache/empire-db", "path": "empire-db/src/main/java/org/apache/empire/db/DBRecordBase.java", "license": "apache-2.0", "size": 38173 }
[ "org.apache.empire.commons.ObjectUtils", "org.apache.empire.db.exceptions.FieldReadOnlyException", "org.apache.empire.db.exceptions.FieldValueNotFetchedException" ]
import org.apache.empire.commons.ObjectUtils; import org.apache.empire.db.exceptions.FieldReadOnlyException; import org.apache.empire.db.exceptions.FieldValueNotFetchedException;
import org.apache.empire.commons.*; import org.apache.empire.db.exceptions.*;
[ "org.apache.empire" ]
org.apache.empire;
282,995
public void sendExtendedQuery(DeviceFeature f, byte aCmd1, byte aCmd2) { InsteonDevice d = f.getDevice(); try { Msg m = d.makeExtendedMessage((byte) 0x1f, aCmd1, aCmd2); m.setQuietTime(500L); d.enqueueMessage(m, f); } catch (IOException e) { lo...
void function(DeviceFeature f, byte aCmd1, byte aCmd2) { InsteonDevice d = f.getDevice(); try { Msg m = d.makeExtendedMessage((byte) 0x1f, aCmd1, aCmd2); m.setQuietTime(500L); d.enqueueMessage(m, f); } catch (IOException e) { logger.warn(STR, d.getAddress()); } catch (FieldException e) { logger.warn(STR, d.getAddress()...
/** * Method to send an extended insteon message for querying a device * * @param f DeviceFeature that is being currently handled * @param aCmd1 cmd1 for message to be sent * @param aCmd2 cmd2 for message to be sent */
Method to send an extended insteon message for querying a device
sendExtendedQuery
{ "repo_name": "computergeek1507/openhab", "path": "bundles/binding/org.openhab.binding.insteonplm/src/main/java/org/openhab/binding/insteonplm/internal/device/MessageHandler.java", "license": "epl-1.0", "size": 47197 }
[ "java.io.IOException", "org.openhab.binding.insteonplm.internal.message.FieldException", "org.openhab.binding.insteonplm.internal.message.Msg" ]
import java.io.IOException; import org.openhab.binding.insteonplm.internal.message.FieldException; import org.openhab.binding.insteonplm.internal.message.Msg;
import java.io.*; import org.openhab.binding.insteonplm.internal.message.*;
[ "java.io", "org.openhab.binding" ]
java.io; org.openhab.binding;
111,415
String GET_CHANGED_TOWNS = "SELECT name FROM towns WHERE information LIKE (?)"; String CHANGE_TOWN_NAMES_STMT = "UPDATE towns SET name = UPPER(name) WHERE information LIKE (?)"; try ( PreparedStatement updatePstmt = conn.prepareStatement(CHANGE_TOWN_NAMES_STMT); PreparedS...
String GET_CHANGED_TOWNS = STR; String CHANGE_TOWN_NAMES_STMT = STR; try ( PreparedStatement updatePstmt = conn.prepareStatement(CHANGE_TOWN_NAMES_STMT); PreparedStatement selectPstmt = conn.prepareStatement(GET_CHANGED_TOWNS)) { conn.setAutoCommit(false); updatePstmt.setString(1, "%" + country + "%"); updatePstmt.exec...
/** * Change the names of towns from given country to uppercase and write the result to the console * * @param conn - the existing connection * @param country - a country where the town is, which is in towns.information column */
Change the names of towns from given country to uppercase and write the result to the console
execute
{ "repo_name": "kostovhg/SoftUni", "path": "Java_DBFundamentals-Jan18/DBAdvanced_HibernateSpring/g_Db_Apps_Introduction/src/main/java/exercise/e_ChangeTownNamesCasing.java", "license": "gpl-3.0", "size": 2331 }
[ "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException", "java.util.ArrayList", "java.util.List" ]
import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
2,815,646
private static HttpURLConnection lease(final URI uri, final BlobRequestOptions blobOptions, final OperationContext opContext, final AccessCondition accessCondition, final LeaseAction action, final Integer leaseTimeInSeconds, final String proposedLeaseId, final Integer breakPeriodInSeconds, ...
static HttpURLConnection function(final URI uri, final BlobRequestOptions blobOptions, final OperationContext opContext, final AccessCondition accessCondition, final LeaseAction action, final Integer leaseTimeInSeconds, final String proposedLeaseId, final Integer breakPeriodInSeconds, final UriQueryBuilder builder) thr...
/** * Constructs a HttpURLConnection to Acquire,Release,Break, or Renew a blob/container lease. Sign with 0 length. * * @param uri * A <code>java.net.URI</code> object that specifies the absolute URI. * @param blobOptions * A {@link BlobRequestOptions} object that sp...
Constructs a HttpURLConnection to Acquire,Release,Break, or Renew a blob/container lease. Sign with 0 length
lease
{ "repo_name": "dominicjprice/runspotrun-android-client", "path": "src/com/microsoft/azure/storage/blob/BlobRequest.java", "license": "agpl-3.0", "size": 73213 }
[ "com.microsoft.azure.storage.AccessCondition", "com.microsoft.azure.storage.Constants", "com.microsoft.azure.storage.OperationContext", "com.microsoft.azure.storage.StorageException", "com.microsoft.azure.storage.core.UriQueryBuilder", "java.io.IOException", "java.net.HttpURLConnection", "java.net.URI...
import com.microsoft.azure.storage.AccessCondition; import com.microsoft.azure.storage.Constants; import com.microsoft.azure.storage.OperationContext; import com.microsoft.azure.storage.StorageException; import com.microsoft.azure.storage.core.UriQueryBuilder; import java.io.IOException; import java.net.HttpURLConnecti...
import com.microsoft.azure.storage.*; import com.microsoft.azure.storage.core.*; import java.io.*; import java.net.*;
[ "com.microsoft.azure", "java.io", "java.net" ]
com.microsoft.azure; java.io; java.net;
1,849,783
public void testCreateChildrenOfLockedNodes() throws Exception { assertEquals( LockStatus.NO_LOCK, this.lockService.getLockStatus(this.parentNode)); ChildAssociationRef child = nodeService.createNode(parentNode, ContentModel.ASSOC_CONTAINS, QName.creat...
void function() throws Exception { assertEquals( LockStatus.NO_LOCK, this.lockService.getLockStatus(this.parentNode)); ChildAssociationRef child = nodeService.createNode(parentNode, ContentModel.ASSOC_CONTAINS, QName.createQName(STR), ContentModel.TYPE_FOLDER); TestWithUserUtils.authenticateUser(GOOD_USER_NAME, PWD, ro...
/** * Unit test to validate the behaviour of creating children of locked nodes. * No lock - can create children * READ_ONLY_LOCK - can't create children * WRITE_LOCK - owner can create children * non owner can't create children * NODE_LOCK non owner can create children * ...
Unit test to validate the behaviour of creating children of locked nodes. No lock - can create children READ_ONLY_LOCK - can't create children WRITE_LOCK - owner can create children non owner can't create children NODE_LOCK non owner can create children owner can create children
testCreateChildrenOfLockedNodes
{ "repo_name": "Kast0rTr0y/community-edition", "path": "projects/repository/source/test-java/org/alfresco/repo/lock/LockServiceImplTest.java", "license": "lgpl-3.0", "size": 44941 }
[ "org.alfresco.model.ContentModel", "org.alfresco.service.cmr.lock.LockStatus", "org.alfresco.service.cmr.lock.LockType", "org.alfresco.service.cmr.lock.NodeLockedException", "org.alfresco.service.cmr.repository.ChildAssociationRef", "org.alfresco.service.namespace.QName", "org.alfresco.util.TestWithUser...
import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.lock.LockStatus; import org.alfresco.service.cmr.lock.LockType; import org.alfresco.service.cmr.lock.NodeLockedException; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.namespace.QName; import org.alfres...
import org.alfresco.model.*; import org.alfresco.service.cmr.lock.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.namespace.*; import org.alfresco.util.*;
[ "org.alfresco.model", "org.alfresco.service", "org.alfresco.util" ]
org.alfresco.model; org.alfresco.service; org.alfresco.util;
31,072
protected List retrieveObject(String sql) throws DatabaseDownException, SQLException { return retrieveObject(sql, false); }
List function(String sql) throws DatabaseDownException, SQLException { return retrieveObject(sql, false); }
/** * This method retrieves all common names from database. It uses the * following SQL: <br> * SELECT * FROM COMMON_NAME * * @return A list of <code>CommonName</code> objects * * @throws DatabaseDownException * If the database is down * @throws SQLExc...
This method retrieves all common names from database. It uses the SELECT * FROM COMMON_NAME
retrieveObject
{ "repo_name": "BackupTheBerlios/arara-svn", "path": "core/tags/arara-1.1/src/main/java/net/indrix/arara/dao/AbstractDAO.java", "license": "gpl-2.0", "size": 25225 }
[ "java.sql.SQLException", "java.util.List" ]
import java.sql.SQLException; import java.util.List;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
1,827,069
public void testXADataSource() throws Exception { MysqlXADataSource ds = new MysqlXADataSource(); ds.setUrl(dbUrl); String name = "XA"; this.ctx.rebind(name, ds); Object result = this.ctx.lookup(name); assertNotNull("XADataSource not bound into JNDI", result); ...
void function() throws Exception { MysqlXADataSource ds = new MysqlXADataSource(); ds.setUrl(dbUrl); String name = "XA"; this.ctx.rebind(name, ds); Object result = this.ctx.lookup(name); assertNotNull(STR, result); }
/** * Tests whether XADataSources can be bound into JNDI * * @throws Exception * if the test fails. */
Tests whether XADataSources can be bound into JNDI
testXADataSource
{ "repo_name": "richardgutkowski/ansible-roles", "path": "stash/files/mysql-connector-java-5.1.35/src/testsuite/simple/DataSourceTest.java", "license": "mit", "size": 7834 }
[ "com.mysql.jdbc.jdbc2.optional.MysqlXADataSource" ]
import com.mysql.jdbc.jdbc2.optional.MysqlXADataSource;
import com.mysql.jdbc.jdbc2.optional.*;
[ "com.mysql.jdbc" ]
com.mysql.jdbc;
80,755
private void maybeRecordEs6Subclass(Node n, Node parent, Name subclassNameObj) { if (subclassNameObj.type != Name.Type.CLASS || parent == null) { return; } Node superclass = null; if (parent.isClass()) { superclass = parent.getSecondChild(); } else if (n.isName() || n....
void function(Node n, Node parent, Name subclassNameObj) { if (subclassNameObj.type != Name.Type.CLASS parent == null) { return; } Node superclass = null; if (parent.isClass()) { superclass = parent.getSecondChild(); } else if (n.isName() n.isGetProp()){ Node classNode = NodeUtil.getAssignedValue(n); if (classNode != n...
/** * Given a new node and its name that is an ES6 class, checks if it is an ES6 class with an ES6 * superclass. If the superclass is a simple or qualified names, adds itself to the parent's * list of subclasses. Otherwise this does nothing. * * @param n The node being visited. * @param pa...
Given a new node and its name that is an ES6 class, checks if it is an ES6 class with an ES6 superclass. If the superclass is a simple or qualified names, adds itself to the parent's list of subclasses. Otherwise this does nothing
maybeRecordEs6Subclass
{ "repo_name": "mprobst/closure-compiler", "path": "src/com/google/javascript/jscomp/GlobalNamespace.java", "license": "apache-2.0", "size": 51093 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
410,150
public void revokeVoice(String nickname) throws XMPPException { changeRole(nickname, "visitor", null); }
void function(String nickname) throws XMPPException { changeRole(nickname, STR, null); }
/** * Revokes voice from a participant in the room. In a moderated room, a moderator may want to * revoke an occupant's privileges to speak. To have voice means that a room occupant * is able to send messages to the room occupants. * * @param nickname the nickname of the participant to revoke v...
Revokes voice from a participant in the room. In a moderated room, a moderator may want to revoke an occupant's privileges to speak. To have voice means that a room occupant is able to send messages to the room occupants
revokeVoice
{ "repo_name": "luchuangbin/test1", "path": "src/org/jivesoftware/smackx/muc/MultiUserChat.java", "license": "apache-2.0", "size": 122001 }
[ "org.jivesoftware.smack.XMPPException" ]
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.*;
[ "org.jivesoftware.smack" ]
org.jivesoftware.smack;
1,366,609
public void waitForClusterToStart() throws IOException { List<Thread> chkDaemonStart = new ArrayList<Thread>(); for (List<AbstractDaemonClient> set : daemons.values()) { for (AbstractDaemonClient daemon : set) { DaemonStartThread dmStart = new DaemonStartThread(daemon); chkDaemon...
void function() throws IOException { List<Thread> chkDaemonStart = new ArrayList<Thread>(); for (List<AbstractDaemonClient> set : daemons.values()) { for (AbstractDaemonClient daemon : set) { DaemonStartThread dmStart = new DaemonStartThread(daemon); chkDaemonStart.add(dmStart);; dmStart.start(); } } for (Thread daemon...
/** * It uses to wait until the cluster is started.<br/> * @throws IOException if an I/O error occurs. */
It uses to wait until the cluster is started
waitForClusterToStart
{ "repo_name": "YuMatsuzawa/HadoopEclipseProject", "path": "src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonCluster.java", "license": "apache-2.0", "size": 18165 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.List" ]
import java.io.IOException; import java.util.ArrayList; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,839,023
protected Checksum makeChecksumAlgorithm(){ return new Adler32(); }
Checksum function(){ return new Adler32(); }
/** * create a checksum algorithm * @return the checksum algorithm */
create a checksum algorithm
makeChecksumAlgorithm
{ "repo_name": "apurtell/zookeeper", "path": "src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java", "license": "apache-2.0", "size": 22283 }
[ "java.util.zip.Adler32", "java.util.zip.Checksum" ]
import java.util.zip.Adler32; import java.util.zip.Checksum;
import java.util.zip.*;
[ "java.util" ]
java.util;
2,053,422
public MetricName name() { return this.name; }
MetricName function() { return this.name; }
/** * Get the name property: The name information for the metric. * * @return the name value. */
Get the name property: The name information for the metric
name
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/fluent/models/MetricDefinitionInner.java", "license": "mit", "size": 3366 }
[ "com.azure.resourcemanager.sql.models.MetricName" ]
import com.azure.resourcemanager.sql.models.MetricName;
import com.azure.resourcemanager.sql.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
346,284
@Test public void testEquals() { final NiciraMatchEncapEthType encapEthType1 = new NiciraMatchEncapEthType(ethType1); final NiciraMatchEncapEthType sameAsEncapEthType1 = new NiciraMatchEncapEthType(ethType1); final NiciraMatchEncapEthType encapEthType2 = new NiciraMatchEncapEthType(ethTy...
void function() { final NiciraMatchEncapEthType encapEthType1 = new NiciraMatchEncapEthType(ethType1); final NiciraMatchEncapEthType sameAsEncapEthType1 = new NiciraMatchEncapEthType(ethType1); final NiciraMatchEncapEthType encapEthType2 = new NiciraMatchEncapEthType(ethType2); new EqualsTester().addEqualityGroup(encap...
/** * Checks the operation of equals() methods. */
Checks the operation of equals() methods
testEquals
{ "repo_name": "gkatsikas/onos", "path": "drivers/default/src/test/java/org/onosproject/driver/extensions/NiciraMatchEncapEthTypeTest.java", "license": "apache-2.0", "size": 1946 }
[ "com.google.common.testing.EqualsTester" ]
import com.google.common.testing.EqualsTester;
import com.google.common.testing.*;
[ "com.google.common" ]
com.google.common;
2,500,908
void shadeBitmap(Bitmap bitmap, Rectangle shadeRect, Rectangle tileRect, float magnitude);
void shadeBitmap(Bitmap bitmap, Rectangle shadeRect, Rectangle tileRect, float magnitude);
/** * Shade whole map tile when tileRect is null (and bitmap, shadeRect are null). * Shade tileRect neutral if bitmap is null (and shadeRect). * Shade tileRect with bitmap otherwise. */
Shade whole map tile when tileRect is null (and bitmap, shadeRect are null). Shade tileRect neutral if bitmap is null (and shadeRect). Shade tileRect with bitmap otherwise
shadeBitmap
{ "repo_name": "usrusr/mapsforge", "path": "mapsforge-core/src/main/java/org/mapsforge/core/graphics/GraphicContext.java", "license": "lgpl-3.0", "size": 2766 }
[ "org.mapsforge.core.model.Rectangle" ]
import org.mapsforge.core.model.Rectangle;
import org.mapsforge.core.model.*;
[ "org.mapsforge.core" ]
org.mapsforge.core;
545,590
TestThreadUtils.runOnUiThreadBlocking(() -> { Profile profile = Profile.getLastUsedRegularProfile(); PermissionInfo notifications = new PermissionInfo(ContentSettingsType.NOTIFICATIONS, url, null , false ); notifications.setContentSetting(profile, ContentSettingVa...
TestThreadUtils.runOnUiThreadBlocking(() -> { Profile profile = Profile.getLastUsedRegularProfile(); PermissionInfo notifications = new PermissionInfo(ContentSettingsType.NOTIFICATIONS, url, null , false ); notifications.setContentSetting(profile, ContentSettingValues.BLOCK); PermissionInfo mic = new PermissionInfo(Con...
/** * Set permissions to run the test. Notifications set to Block, Mic set to Allow, * Camera set to Allow, Location set to ASK. */
Set permissions to run the test. Notifications set to Block, Mic set to Allow, Camera set to Allow, Location set to ASK
setPermissionDefaults
{ "repo_name": "ric2b/Vivaldi-browser", "path": "chromium/chrome/browser/android/webapps/launchpad/java/src/org/chromium/chrome/browser/webapps/launchpad/LaunchpadTestUtils.java", "license": "bsd-3-clause", "size": 5316 }
[ "org.chromium.chrome.browser.profiles.Profile", "org.chromium.components.browser_ui.site_settings.PermissionInfo", "org.chromium.components.content_settings.ContentSettingValues", "org.chromium.components.content_settings.ContentSettingsType", "org.chromium.content_public.browser.test.util.TestThreadUtils" ...
import org.chromium.chrome.browser.profiles.Profile; import org.chromium.components.browser_ui.site_settings.PermissionInfo; import org.chromium.components.content_settings.ContentSettingValues; import org.chromium.components.content_settings.ContentSettingsType; import org.chromium.content_public.browser.test.util.Tes...
import org.chromium.chrome.browser.profiles.*; import org.chromium.components.browser_ui.site_settings.*; import org.chromium.components.content_settings.*; import org.chromium.content_public.browser.test.util.*;
[ "org.chromium.chrome", "org.chromium.components", "org.chromium.content_public" ]
org.chromium.chrome; org.chromium.components; org.chromium.content_public;
2,172,991
@NonNull public static Geocache loadCacheTexts(final String geocode) { final Geocache partial = new Geocache(); // in case of database issues, we still need to return a result to avoid endless loops partial.setDescription(StringUtils.EMPTY); partial.setShortDescription(StringUti...
static Geocache function(final String geocode) { final Geocache partial = new Geocache(); partial.setDescription(StringUtils.EMPTY); partial.setShortDescription(StringUtils.EMPTY); partial.setHint(StringUtils.EMPTY); partial.setLocation(StringUtils.EMPTY); init(); try { final Cursor cursor = database.query( dbTableCach...
/** * Load the lazily initialized fields of a cache and return them as partial cache (all other fields unset). * */
Load the lazily initialized fields of a cache and return them as partial cache (all other fields unset)
loadCacheTexts
{ "repo_name": "SammysHP/cgeo", "path": "main/src/cgeo/geocaching/storage/DataStore.java", "license": "apache-2.0", "size": 136428 }
[ "android.database.Cursor", "android.database.sqlite.SQLiteDoneException", "org.apache.commons.lang3.StringUtils" ]
import android.database.Cursor; import android.database.sqlite.SQLiteDoneException; import org.apache.commons.lang3.StringUtils;
import android.database.*; import android.database.sqlite.*; import org.apache.commons.lang3.*;
[ "android.database", "org.apache.commons" ]
android.database; org.apache.commons;
1,434,546
@Deprecated MethodMap getMethods(User user) throws RemoteException;
MethodMap getMethods(User user) throws RemoteException;
/** * DOCUMENT ME! * * @param user DOCUMENT ME! * * @return DOCUMENT ME! * * @throws RemoteException DOCUMENT ME! */
DOCUMENT ME
getMethods
{ "repo_name": "cismet/cids-server", "path": "src/main/java/Sirius/server/middleware/interfaces/domainserver/MetaService.java", "license": "lgpl-3.0", "size": 19093 }
[ "java.rmi.RemoteException" ]
import java.rmi.RemoteException;
import java.rmi.*;
[ "java.rmi" ]
java.rmi;
2,238,500
private ListSelectionListener createListSelectionListener() { return new ListSelectionHandler(); }
ListSelectionListener function() { return new ListSelectionHandler(); }
/** * Creates and returns an instance of ListSelectionHandler. */
Creates and returns an instance of ListSelectionHandler
createListSelectionListener
{ "repo_name": "another-dave/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/gui/JTreeTable.java", "license": "lgpl-2.1", "size": 18215 }
[ "javax.swing.event.ListSelectionListener" ]
import javax.swing.event.ListSelectionListener;
import javax.swing.event.*;
[ "javax.swing" ]
javax.swing;
790,400
public void importContext(Context ctx, Configuration config) throws ConfigurationException { validateContextNotNull(ctx); validateConfigNotNull(config); for (ContextDataFactory cdf : this.contextDataFactories) { cdf.importContextData(ctx, config); } }
void function(Context ctx, Configuration config) throws ConfigurationException { validateContextNotNull(ctx); validateConfigNotNull(config); for (ContextDataFactory cdf : this.contextDataFactories) { cdf.importContextData(ctx, config); } }
/** * Import a context from the given configuration * * @param ctx the context to import the context data to. * @param config the {@code Configuration} containing the context data. * @throws ConfigurationException if an error occurred while reading the context data from the {@code Configuration}. * @...
Import a context from the given configuration
importContext
{ "repo_name": "zapbot/zaproxy", "path": "src/org/parosproxy/paros/model/Model.java", "license": "apache-2.0", "size": 20221 }
[ "org.apache.commons.configuration.Configuration", "org.apache.commons.configuration.ConfigurationException", "org.zaproxy.zap.model.Context", "org.zaproxy.zap.model.ContextDataFactory" ]
import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.ConfigurationException; import org.zaproxy.zap.model.Context; import org.zaproxy.zap.model.ContextDataFactory;
import org.apache.commons.configuration.*; import org.zaproxy.zap.model.*;
[ "org.apache.commons", "org.zaproxy.zap" ]
org.apache.commons; org.zaproxy.zap;
533,190
public Observable<ServiceResponse<Void>> deleteOrderWithServiceResponseAsync(String orderId) { if (orderId == null) { throw new IllegalArgumentException("Parameter orderId is required and cannot be null."); }
Observable<ServiceResponse<Void>> function(String orderId) { if (orderId == null) { throw new IllegalArgumentException(STR); }
/** * Delete purchase order by ID. * For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors. * * @param orderId ID of the order that needs to be deleted * @return the {@link ServiceResponse} object if successful. */
Delete purchase order by ID. For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
deleteOrderWithServiceResponseAsync
{ "repo_name": "yugangw-msft/autorest", "path": "Samples/petstore/Java/implementation/SwaggerPetstoreImpl.java", "license": "mit", "size": 99949 }
[ "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,094,098
public XPerformanceProblem getDefaultHierarchy() { lastClientException = null; try { return client.getDefaultHierarchy(); } catch (Exception e) { handleException("getDefaultHierarchy", MSG_NO_DEFAULT_HIER, e, HandlerStyle.LOG_ONLY, true); } return RawHierarchyFactory.getInstance().createEmptyHierarch...
XPerformanceProblem function() { lastClientException = null; try { return client.getDefaultHierarchy(); } catch (Exception e) { handleException(STR, MSG_NO_DEFAULT_HIER, e, HandlerStyle.LOG_ONLY, true); } return RawHierarchyFactory.getInstance().createEmptyHierarchy(); }
/** * Returns the default hierarchy. * * @return the default hierarchy */
Returns the default hierarchy
getDefaultHierarchy
{ "repo_name": "sopeco/DynamicSpotter", "path": "org.spotter.eclipse.ui/src/org/spotter/eclipse/ui/ServiceClientWrapper.java", "license": "apache-2.0", "size": 23011 }
[ "org.spotter.shared.hierarchy.model.RawHierarchyFactory", "org.spotter.shared.hierarchy.model.XPerformanceProblem" ]
import org.spotter.shared.hierarchy.model.RawHierarchyFactory; import org.spotter.shared.hierarchy.model.XPerformanceProblem;
import org.spotter.shared.hierarchy.model.*;
[ "org.spotter.shared" ]
org.spotter.shared;
1,033,764
List<OnmsNode> getNodesWithIfAlias(String ifAlias);
List<OnmsNode> getNodesWithIfAlias(String ifAlias);
/** * Returns all non-deleted nodes that contain the given string in an ifAlias * * @Param ifAlias * the ifAlias string we are looking for * @return nodes * the nodes with a matching ifAlias on one or more interfaces * @param ifAlias a {@link java.lang.String} object. */
Returns all non-deleted nodes that contain the given string in an ifAlias
getNodesWithIfAlias
{ "repo_name": "tdefilip/opennms", "path": "opennms-webapp/src/main/java/org/opennms/web/element/NetworkElementFactoryInterface.java", "license": "agpl-3.0", "size": 14595 }
[ "java.util.List", "org.opennms.netmgt.model.OnmsNode" ]
import java.util.List; import org.opennms.netmgt.model.OnmsNode;
import java.util.*; import org.opennms.netmgt.model.*;
[ "java.util", "org.opennms.netmgt" ]
java.util; org.opennms.netmgt;
2,593,096
public Properties getProperties() { return properties; }
Properties function() { return properties; }
/** * Set/Get Property information to be passed down to *StorageHandler implementation * put implementation specific storage handler configurations here * @return the implementation specific job properties */
Set/Get Property information to be passed down to *StorageHandler implementation put implementation specific storage handler configurations here
getProperties
{ "repo_name": "cloudera/hcatalog", "path": "core/src/main/java/org/apache/hcatalog/mapreduce/OutputJobInfo.java", "license": "apache-2.0", "size": 8426 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
404,330
@Authorized(PrivilegeConstants.GET_CONCEPT_SOURCES) public List<ConceptSource> getAllConceptSources(boolean includeRetired) throws APIException;
@Authorized(PrivilegeConstants.GET_CONCEPT_SOURCES) List<ConceptSource> function(boolean includeRetired) throws APIException;
/** * Return a list of concept sources currenly in the database Whether or not to return retired * concept sources is decided by the boolean includeRetired param * * @param includeRetired whether or not to include retired sources * @return List of Concept source objects */
Return a list of concept sources currenly in the database Whether or not to return retired concept sources is decided by the boolean includeRetired param
getAllConceptSources
{ "repo_name": "preethi29/openmrs-core", "path": "api/src/main/java/org/openmrs/api/ConceptService.java", "license": "mpl-2.0", "size": 72694 }
[ "java.util.List", "org.openmrs.ConceptSource", "org.openmrs.annotation.Authorized", "org.openmrs.util.PrivilegeConstants" ]
import java.util.List; import org.openmrs.ConceptSource; import org.openmrs.annotation.Authorized; import org.openmrs.util.PrivilegeConstants;
import java.util.*; import org.openmrs.*; import org.openmrs.annotation.*; import org.openmrs.util.*;
[ "java.util", "org.openmrs", "org.openmrs.annotation", "org.openmrs.util" ]
java.util; org.openmrs; org.openmrs.annotation; org.openmrs.util;
806,010
private void initializeConfiguration() throws VtnServiceWebAPIException { LOG.trace("Start InitManager#initializeConfiguration()"); ConfigurationManager.initConfiguration(); LOG.trace("Complete InitManager#initializeConfiguration()"); }
void function() throws VtnServiceWebAPIException { LOG.trace(STR); ConfigurationManager.initConfiguration(); LOG.trace(STR); }
/** * Initialize configuration. * * @throws VtnServiceWebAPIException * the vtn service web api exception */
Initialize configuration
initializeConfiguration
{ "repo_name": "opendaylight/vtn", "path": "coordinator/java/vtn-webapi/src/org/opendaylight/vtn/webapi/utils/InitManager.java", "license": "epl-1.0", "size": 2379 }
[ "org.opendaylight.vtn.webapi.exception.VtnServiceWebAPIException" ]
import org.opendaylight.vtn.webapi.exception.VtnServiceWebAPIException;
import org.opendaylight.vtn.webapi.exception.*;
[ "org.opendaylight.vtn" ]
org.opendaylight.vtn;
461,035
private void updateControlsFromEntry() { if (entryIndex < 0) { return; } lblEntryNum .setText(String.format(Messages.getString("transactionDetailWindow.transactionHeading"), (entryIndex + 1) , transactionsToProcess.size())); //$NON-NLS-1$ if ((entryIndex == 0) && (maxEntryIndex == 0)) { btnFirst.s...
void function() { if (entryIndex < 0) { return; } lblEntryNum .setText(String.format(Messages.getString(STR), (entryIndex + 1) , transactionsToProcess.size())); if ((entryIndex == 0) && (maxEntryIndex == 0)) { btnFirst.setEnabled(false); btnPrev.setEnabled(false); btnNext.setEnabled(false); btnLast.setEnabled(false); }...
/** * load entry * */
load entry
updateControlsFromEntry
{ "repo_name": "DamianMcNulty/accounting-nua", "path": "GUILayer/transactionDetailWindow.java", "license": "gpl-3.0", "size": 34203 }
[ "java.math.BigDecimal", "java.util.Calendar", "java.util.GregorianCalendar", "org.eclipse.jface.viewers.StructuredSelection", "org.eclipse.swt.widgets.TableItem" ]
import java.math.BigDecimal; import java.util.Calendar; import java.util.GregorianCalendar; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.swt.widgets.TableItem;
import java.math.*; import java.util.*; import org.eclipse.jface.viewers.*; import org.eclipse.swt.widgets.*;
[ "java.math", "java.util", "org.eclipse.jface", "org.eclipse.swt" ]
java.math; java.util; org.eclipse.jface; org.eclipse.swt;
491,949
@ExperimentalApi public static SslContextBuilder configure(SslContextBuilder builder, SslProvider provider) { return builder.sslProvider(provider) .ciphers(Http2SecurityUtil.CIPHERS, SupportedCipherSuiteFilter.INSTANCE) .applicationProtocolConfig(selectApplicationProtocolConf...
static SslContextBuilder function(SslContextBuilder builder, SslProvider provider) { return builder.sslProvider(provider) .ciphers(Http2SecurityUtil.CIPHERS, SupportedCipherSuiteFilter.INSTANCE) .applicationProtocolConfig(selectApplicationProtocolConfig(provider)); }
/** * Set ciphers and APN appropriate for gRPC. Precisely what is set is permitted to change, so if * an application requires particular settings it should override the options set here. */
Set ciphers and APN appropriate for gRPC. Precisely what is set is permitted to change, so if an application requires particular settings it should override the options set here
configure
{ "repo_name": "wrwg/grpc-java", "path": "netty/src/main/java/io/grpc/netty/GrpcSslContexts.java", "license": "bsd-3-clause", "size": 6035 }
[ "io.netty.handler.codec.http2.Http2SecurityUtil", "io.netty.handler.ssl.SslContextBuilder", "io.netty.handler.ssl.SslProvider", "io.netty.handler.ssl.SupportedCipherSuiteFilter" ]
import io.netty.handler.codec.http2.Http2SecurityUtil; import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.SslProvider; import io.netty.handler.ssl.SupportedCipherSuiteFilter;
import io.netty.handler.codec.http2.*; import io.netty.handler.ssl.*;
[ "io.netty.handler" ]
io.netty.handler;
2,554,507
public void processEncodedText(byte[] string) throws IOException { final float fontSizeText = graphicsState.getTextState().getFontSize(); final float horizontalScalingText = graphicsState.getTextState().getHorizontalScalingPercent() / 100f; // float verticalScalingText = horizontalScaling;//not sure ...
void function(byte[] string) throws IOException { final float fontSizeText = graphicsState.getTextState().getFontSize(); final float horizontalScalingText = graphicsState.getTextState().getHorizontalScalingPercent() / 100f; final float riseText = graphicsState.getTextState().getRise(); final float wordSpacingText = gra...
/** * Process encoded text from the PDF Stream. You should override this method if you want to perform an action when encoded text is being processed. * * @param string The encoded text * * @throws IOException If there is an error processing the string */
Process encoded text from the PDF Stream. You should override this method if you want to perform an action when encoded text is being processed
processEncodedText
{ "repo_name": "sencko/NALB", "path": "nalb2013/src/org/apache/pdfbox/util/PDFStreamEngine.java", "license": "gpl-2.0", "size": 21496 }
[ "java.io.IOException", "org.apache.pdfbox.pdmodel.common.PDMatrix", "org.apache.pdfbox.pdmodel.font.PDFont", "org.apache.pdfbox.pdmodel.font.PDType3Font" ]
import java.io.IOException; import org.apache.pdfbox.pdmodel.common.PDMatrix; import org.apache.pdfbox.pdmodel.font.PDFont; import org.apache.pdfbox.pdmodel.font.PDType3Font;
import java.io.*; import org.apache.pdfbox.pdmodel.common.*; import org.apache.pdfbox.pdmodel.font.*;
[ "java.io", "org.apache.pdfbox" ]
java.io; org.apache.pdfbox;
2,370,972
Node masterNode = getMasterNode(); // construct self node String host = retrieveSelfExternalHost(masterNode, restTemplate); int port = servletWebServerInitializedEvent.getWebServer().getPort(); self = getSelfNode(host, port); LOG.info("Self address: " + self.getAddress()); ...
Node masterNode = getMasterNode(); String host = retrieveSelfExternalHost(masterNode, restTemplate); int port = servletWebServerInitializedEvent.getWebServer().getPort(); self = getSelfNode(host, port); LOG.info(STR + self.getAddress()); if (self.equals(masterNode)) { LOG.info(STR); } else { knownNodes.add(masterNode);...
/** * Initial setup, query master Node for * - Other Nodes * - All Addresses * - Current Blockchain * - Transactions in pool * and publish self on all other Nodes * @param servletWebServerInitializedEvent serverletContainer for port retrieval */
Initial setup, query master Node for - Other Nodes - All Addresses - Current Blockchain - Transactions in pool and publish self on all other Nodes
onApplicationEvent
{ "repo_name": "neozo-software/jblockchain", "path": "node/src/main/java/de/neozo/jblockchain/node/service/NodeService.java", "license": "apache-2.0", "size": 5118 }
[ "de.neozo.jblockchain.common.domain.Node" ]
import de.neozo.jblockchain.common.domain.Node;
import de.neozo.jblockchain.common.domain.*;
[ "de.neozo.jblockchain" ]
de.neozo.jblockchain;
2,806,083
@Override public T visitLimitClause(@NotNull CQLParser.LimitClauseContext ctx) { return visitChildren(ctx); }
@Override public T visitLimitClause(@NotNull CQLParser.LimitClauseContext ctx) { return visitChildren(ctx); }
/** * {@inheritDoc} * <p/> * The default implementation returns the result of calling * {@link #visitChildren} on {@code ctx}. */
The default implementation returns the result of calling <code>#visitChildren</code> on ctx
visitStreamAlias
{ "repo_name": "jack6215/StreamCQL", "path": "cql/src/main/java/com/huawei/streaming/cql/semanticanalyzer/parser/CQLParserBaseVisitor.java", "license": "apache-2.0", "size": 44928 }
[ "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;
1,486,318
public static HttpVersion getVersion(int spdyVersion, SpdyHeaderBlock block) { try { if (spdyVersion < 3) { return HttpVersion.valueOf(block.headers().get(Spdy2HttpNames.VERSION)); } else { return HttpVersion.valueOf(block.headers().get(HttpNames.VERSI...
static HttpVersion function(int spdyVersion, SpdyHeaderBlock block) { try { if (spdyVersion < 3) { return HttpVersion.valueOf(block.headers().get(Spdy2HttpNames.VERSION)); } else { return HttpVersion.valueOf(block.headers().get(HttpNames.VERSION)); } } catch (Exception e) { return null; } }
/** * Returns the {@link HttpVersion} represented by the HTTP version header. */
Returns the <code>HttpVersion</code> represented by the HTTP version header
getVersion
{ "repo_name": "menacher/netty", "path": "codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHeaders.java", "license": "apache-2.0", "size": 15227 }
[ "io.netty.handler.codec.http.HttpVersion" ]
import io.netty.handler.codec.http.HttpVersion;
import io.netty.handler.codec.http.*;
[ "io.netty.handler" ]
io.netty.handler;
1,316,047