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
private String fullClassName(Element element) { String pkg = findPackage(element); return ((TypeElement) element).getQualifiedName().toString().substring(pkg.length() + 1); }
String function(Element element) { String pkg = findPackage(element); return ((TypeElement) element).getQualifiedName().toString().substring(pkg.length() + 1); }
/** * Strip the package off a class name leaving the full class name including any outer classes. */
Strip the package off a class name leaving the full class name including any outer classes
fullClassName
{ "repo_name": "md-5/jdk10", "path": "src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java", "license": "gpl-2.0", "size": 42790 }
[ "javax.lang.model.element.Element", "javax.lang.model.element.TypeElement" ]
import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement;
import javax.lang.model.element.*;
[ "javax.lang" ]
javax.lang;
382,696
public void setRejectedConnectionsValue(String rejectedConnectionsValue) throws JNCException { setRejectedConnectionsValue(new YangUInt32(rejectedConnectionsValue)); }
void function(String rejectedConnectionsValue) throws JNCException { setRejectedConnectionsValue(new YangUInt32(rejectedConnectionsValue)); }
/** * Sets the value for child leaf "rejected-connections", * using a String value. * @param rejectedConnectionsValue used during instantiation. */
Sets the value for child leaf "rejected-connections", using a String value
setRejectedConnectionsValue
{ "repo_name": "jnpr-shinma/yangfile", "path": "hitel/src/hctaEpc/mmeSgsn/interface_/iu/FgwRncOper.java", "license": "apache-2.0", "size": 27566 }
[ "com.tailf.jnc.YangUInt32" ]
import com.tailf.jnc.YangUInt32;
import com.tailf.jnc.*;
[ "com.tailf.jnc" ]
com.tailf.jnc;
2,620,032
public void testMultiThreadedUpdateRowLocking() throws SQLException, InterruptedException { testMultiThreadedUpdate(false , false ); }
void function() throws SQLException, InterruptedException { testMultiThreadedUpdate(false , false ); }
/** * Test multithreaded clob update using standard row locking * @throws SQLException * @throws InterruptedException */
Test multithreaded clob update using standard row locking
testMultiThreadedUpdateRowLocking
{ "repo_name": "trejkaz/derby", "path": "java/testing/org/apache/derbyTesting/functionTests/tests/store/ClobReclamationTest.java", "license": "apache-2.0", "size": 17703 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
751,107
@Path("serverStats") @GET public ServerStats getServerStats() { ServerStats stats = new ServerStats(); stats.addStats(new ServerStat(ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors(), true, 100, "OS Load", "osload")); stats.addStats(new ServerStat(1000, true, 1, "Ingest Entries",...
@Path(STR) ServerStats function() { ServerStats stats = new ServerStats(); stats.addStats(new ServerStat(ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors(), true, 100, STR, STR)); stats.addStats(new ServerStat(1000, true, 1, STR, STR)); stats.addStats(new ServerStat(10000, true, 1, STR, "query")); st...
/** * Generates the server stats * * @return Server stat list */
Generates the server stats
getServerStats
{ "repo_name": "mikewalch/accumulo", "path": "server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/TabletServerResource.java", "license": "apache-2.0", "size": 13505 }
[ "java.lang.management.ManagementFactory", "javax.ws.rs.Path" ]
import java.lang.management.ManagementFactory; import javax.ws.rs.Path;
import java.lang.management.*; import javax.ws.rs.*;
[ "java.lang", "javax.ws" ]
java.lang; javax.ws;
1,012,128
public void moveSinkInput(SinkInput sinkInput, Sink sink) { if (sinkInput == null || sink == null) { return; } sendRawCommand("move-sink-input " + sinkInput.getId() + " " + sink.getId()); sinkInput.setSink(sink); }
void function(SinkInput sinkInput, Sink sink) { if (sinkInput == null sink == null) { return; } sendRawCommand(STR + sinkInput.getId() + " " + sink.getId()); sinkInput.setSink(sink); }
/** * sets the sink a sink-input should be routed to * * @param sinkInput the sink-input to be rerouted * @param sink the new sink the sink-input should be routed to */
sets the sink a sink-input should be routed to
moveSinkInput
{ "repo_name": "lewie/openhab2", "path": "addons/binding/org.openhab.binding.pulseaudio/src/main/java/org/openhab/binding/pulseaudio/internal/PulseaudioClient.java", "license": "epl-1.0", "size": 20506 }
[ "org.openhab.binding.pulseaudio.internal.items.Sink", "org.openhab.binding.pulseaudio.internal.items.SinkInput" ]
import org.openhab.binding.pulseaudio.internal.items.Sink; import org.openhab.binding.pulseaudio.internal.items.SinkInput;
import org.openhab.binding.pulseaudio.internal.items.*;
[ "org.openhab.binding" ]
org.openhab.binding;
2,082,451
public void setFeatureOfInterestNames( DefaultComboBoxModel<String> featureOfInterestNames) { this.featureOfInterestNames = featureOfInterestNames; }
void function( DefaultComboBoxModel<String> featureOfInterestNames) { this.featureOfInterestNames = featureOfInterestNames; }
/** * <p>Setter for the field <code>featureOfInterestNames</code>.</p> * * @param featureOfInterestNames a {@link javax.swing.DefaultComboBoxModel} object. */
Setter for the field <code>featureOfInterestNames</code>
setFeatureOfInterestNames
{ "repo_name": "EHJ-52n/sos-importer", "path": "wizard/src/main/java/org/n52/sos/importer/view/combobox/EditableComboBoxItems.java", "license": "gpl-2.0", "size": 14178 }
[ "javax.swing.DefaultComboBoxModel" ]
import javax.swing.DefaultComboBoxModel;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
2,135,824
public Context getSelectedContext() { return contextSelectBox.getSelectedContext(); }
Context function() { return contextSelectBox.getSelectedContext(); }
/** * Gets the selected context. * * @return the selected context */
Gets the selected context
getSelectedContext
{ "repo_name": "0xkasun/zaproxy", "path": "src/org/zaproxy/zap/view/panels/AbstractContextSelectToolbarStatusPanel.java", "license": "apache-2.0", "size": 9278 }
[ "org.zaproxy.zap.model.Context" ]
import org.zaproxy.zap.model.Context;
import org.zaproxy.zap.model.*;
[ "org.zaproxy.zap" ]
org.zaproxy.zap;
1,107,956
Convention getConvention();
Convention getConvention();
/** * Return the CallingConvention trait from this RelNode's * {@link #getTraitSet() trait set}. * * @return this RelNode's CallingConvention */
Return the CallingConvention trait from this RelNode's <code>#getTraitSet() trait set</code>
getConvention
{ "repo_name": "googleinterns/calcite", "path": "core/src/main/java/org/apache/calcite/rel/RelNode.java", "license": "apache-2.0", "size": 16536 }
[ "org.apache.calcite.plan.Convention" ]
import org.apache.calcite.plan.Convention;
import org.apache.calcite.plan.*;
[ "org.apache.calcite" ]
org.apache.calcite;
2,636,081
protected void onCellTapped(Cell cell) { }
void function(Cell cell) { }
/** * Called when cell is tapped. * * @param cell */
Called when cell is tapped
onCellTapped
{ "repo_name": "ogarcia/opensudoku", "path": "app/src/main/java/org/moire/opensudoku/gui/inputmethod/InputMethod.java", "license": "gpl-3.0", "size": 4629 }
[ "org.moire.opensudoku.game.Cell" ]
import org.moire.opensudoku.game.Cell;
import org.moire.opensudoku.game.*;
[ "org.moire.opensudoku" ]
org.moire.opensudoku;
1,277,790
void disable(Class<? extends EntityEventProcessor<?>> processorType);
void disable(Class<? extends EntityEventProcessor<?>> processorType);
/** * Disables given processor * * @param processorType */
Disables given processor
disable
{ "repo_name": "bcvsolutions/CzechIdMng", "path": "Realization/backend/core/core-test-api/src/main/java/eu/bcvsolutions/idm/test/api/TestHelper.java", "license": "mit", "size": 30086 }
[ "eu.bcvsolutions.idm.core.api.event.EntityEventProcessor" ]
import eu.bcvsolutions.idm.core.api.event.EntityEventProcessor;
import eu.bcvsolutions.idm.core.api.event.*;
[ "eu.bcvsolutions.idm" ]
eu.bcvsolutions.idm;
2,228,046
public File getFile(final String str) throws FtpException { String value = getProperty(str); if (value == null) { throw new FtpException(str + " not found"); } return new File(value); }
File function(final String str) throws FtpException { String value = getProperty(str); if (value == null) { throw new FtpException(str + STR); } return new File(value); }
/** * Get <code>File</code> object. */
Get <code>File</code> object
getFile
{ "repo_name": "CasparLi/ftpserver", "path": "core/src/main/java/org/apache/ftpserver/util/BaseProperties.java", "license": "apache-2.0", "size": 10456 }
[ "java.io.File", "org.apache.ftpserver.ftplet.FtpException" ]
import java.io.File; import org.apache.ftpserver.ftplet.FtpException;
import java.io.*; import org.apache.ftpserver.ftplet.*;
[ "java.io", "org.apache.ftpserver" ]
java.io; org.apache.ftpserver;
909,344
protected PreparedStatement prepareStatement(Connection con, final String query, final int month, final int year, final int start, final int limit, final String sort) throws SQLException { String q = query.replace("@sort@", sort); PreparedStatement st = con.prepareStatement(q); st.setInt(1, month); ...
PreparedStatement function(Connection con, final String query, final int month, final int year, final int start, final int limit, final String sort) throws SQLException { String q = query.replace(STR, sort); PreparedStatement st = con.prepareStatement(q); st.setInt(1, month); st.setInt(2, year); st.setInt(3, limit); st...
/** * Prepare the statement with controller attributes * * @return * @throws SQLException */
Prepare the statement with controller attributes
prepareStatement
{ "repo_name": "pgiraud/georchestra", "path": "analytics/src/main/java/org/georchestra/analytics/model/AbstractModel.java", "license": "gpl-3.0", "size": 4668 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.SQLException" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,210,008
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) public void runAfterDismiss(Runnable task) { assert mPendingRunAfterDismissTask == null; mPendingRunAfterDismissTask = task; mDialog.dismiss(true); } @Override public void onClick(PropertyModel model, @ButtonType int ...
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) void function(Runnable task) { assert mPendingRunAfterDismissTask == null; mPendingRunAfterDismissTask = task; mDialog.dismiss(true); } public void onClick(PropertyModel model, @ButtonType int buttonType) {}
/** * Dismiss the popup, and then run a task after the animation has completed (if there is one). */
Dismiss the popup, and then run a task after the animation has completed (if there is one)
runAfterDismiss
{ "repo_name": "ric2b/Vivaldi-browser", "path": "chromium/components/page_info/android/java/src/org/chromium/components/page_info/PageInfoController.java", "license": "bsd-3-clause", "size": 26955 }
[ "androidx.annotation.VisibleForTesting", "org.chromium.ui.modaldialog.ModalDialogProperties", "org.chromium.ui.modelutil.PropertyModel" ]
import androidx.annotation.VisibleForTesting; import org.chromium.ui.modaldialog.ModalDialogProperties; import org.chromium.ui.modelutil.PropertyModel;
import androidx.annotation.*; import org.chromium.ui.modaldialog.*; import org.chromium.ui.modelutil.*;
[ "androidx.annotation", "org.chromium.ui" ]
androidx.annotation; org.chromium.ui;
1,331,088
public long getTimeSpent(int type) { long totTime = constructorTime + openTime + nextTime + closeTime; if (type == NoPutResultSet.CURRENT_RESULTSET_ONLY) { return totTime - leftSource.getTimeSpent(ENTIRE_RESULTSET_TREE) - rightSource.getTimeSpent(ENTIRE_RESULTSET_TREE); } else { ret...
long function(int type) { long totTime = constructorTime + openTime + nextTime + closeTime; if (type == NoPutResultSet.CURRENT_RESULTSET_ONLY) { return totTime - leftSource.getTimeSpent(ENTIRE_RESULTSET_TREE) - rightSource.getTimeSpent(ENTIRE_RESULTSET_TREE); } else { return totTime; } }
/** * Return the total amount of time spent in this ResultSet * * @param type CURRENT_RESULTSET_ONLY - time spent only in this ResultSet * ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below. * * @return long The total amount of time spent (in milliseconds). */
Return the total amount of time spent in this ResultSet
getTimeSpent
{ "repo_name": "apache/derby", "path": "java/org.apache.derby.engine/org/apache/derby/impl/sql/execute/SetOpResultSet.java", "license": "apache-2.0", "size": 13858 }
[ "org.apache.derby.iapi.sql.execute.NoPutResultSet" ]
import org.apache.derby.iapi.sql.execute.NoPutResultSet;
import org.apache.derby.iapi.sql.execute.*;
[ "org.apache.derby" ]
org.apache.derby;
625,118
@Override public Iterator getKeys() { return config.getKeys(); }
Iterator function() { return config.getKeys(); }
/** * Delegates to the underlying configuration. */
Delegates to the underlying configuration
getKeys
{ "repo_name": "ouyangkongtong/archaius", "path": "archaius-core/src/main/java/com/netflix/config/ConfigurationWithPollingSource.java", "license": "apache-2.0", "size": 9834 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
828,565
public ConnectionWithParams[] getAllConnections() { Iterator iter = connections.keySet().iterator(); if (!iter.hasNext()) return null; ArrayList aux = new ArrayList(); while (iter.hasNext()) { ConnectionWithParams _cwp = (ConnectionWithParams) connections.get(iter.next()); aux.add(_cwp); } C...
ConnectionWithParams[] function() { Iterator iter = connections.keySet().iterator(); if (!iter.hasNext()) return null; ArrayList aux = new ArrayList(); while (iter.hasNext()) { ConnectionWithParams _cwp = (ConnectionWithParams) connections.get(iter.next()); aux.add(_cwp); } ConnectionWithParams[] resp = new ConnectionW...
/** * Gets all available connections. * * @return array of all connections with parameters */
Gets all available connections
getAllConnections
{ "repo_name": "iCarto/siga", "path": "libFMap/src/com/iver/cit/gvsig/fmap/drivers/db/utils/SingleDBConnectionManager.java", "license": "gpl-3.0", "size": 10943 }
[ "java.util.ArrayList", "java.util.Iterator" ]
import java.util.ArrayList; import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,395,458
@SuppressWarnings("unchecked") public void loadConfiguration() throws JDOMException, IOException { SAXBuilder saxBuilder = new SAXBuilder(); Document document = saxBuilder.build(getClass().getClassLoader().getResourceAsStream(MAPPING_FILE)); if (document == null) { LOG.warn("Mapping file '" + MAPP...
@SuppressWarnings(STR) void function() throws JDOMException, IOException { SAXBuilder saxBuilder = new SAXBuilder(); Document document = saxBuilder.build(getClass().getClassLoader().getResourceAsStream(MAPPING_FILE)); if (document == null) { LOG.warn(STR + MAPPING_FILE + STR); } Element root = document.getRootElement()...
/** * Primary class for loading Cassandra configuration from the 'MAPPING_FILE'. * * @throws JDOMException * @throws IOException */
Primary class for loading Cassandra configuration from the 'MAPPING_FILE'
loadConfiguration
{ "repo_name": "thainb/GoraDynamoDB", "path": "gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraMapping.java", "license": "apache-2.0", "size": 7746 }
[ "java.io.IOException", "java.util.List", "me.prettyprint.cassandra.model.BasicColumnFamilyDefinition", "me.prettyprint.hector.api.ddl.ColumnType", "me.prettyprint.hector.api.ddl.ComparatorType", "org.jdom.Document", "org.jdom.Element", "org.jdom.JDOMException", "org.jdom.input.SAXBuilder" ]
import java.io.IOException; import java.util.List; import me.prettyprint.cassandra.model.BasicColumnFamilyDefinition; import me.prettyprint.hector.api.ddl.ColumnType; import me.prettyprint.hector.api.ddl.ComparatorType; import org.jdom.Document; import org.jdom.Element; import org.jdom.JDOMException; import org.jdom.in...
import java.io.*; import java.util.*; import me.prettyprint.cassandra.model.*; import me.prettyprint.hector.api.ddl.*; import org.jdom.*; import org.jdom.input.*;
[ "java.io", "java.util", "me.prettyprint.cassandra", "me.prettyprint.hector", "org.jdom", "org.jdom.input" ]
java.io; java.util; me.prettyprint.cassandra; me.prettyprint.hector; org.jdom; org.jdom.input;
1,729,992
public ExtensibleType<TldExtensionType<T>> getOrCreateExtensionElement() { List<Node> nodeList = childNode.get("extension-element"); if (nodeList != null && nodeList.size() > 0) { return new ExtensibleTypeImpl<TldExtensionType<T>>(this, "extension-element", childNode, nodeList.get(0));...
ExtensibleType<TldExtensionType<T>> function() { List<Node> nodeList = childNode.get(STR); if (nodeList != null && nodeList.size() > 0) { return new ExtensibleTypeImpl<TldExtensionType<T>>(this, STR, childNode, nodeList.get(0)); } return createExtensionElement(); }
/** * If not already created, a new <code>extension-element</code> element will be created and returned. * Otherwise, the first existing <code>extension-element</code> element will be returned. * @return the instance defined for the element <code>extension-element</code> */
If not already created, a new <code>extension-element</code> element will be created and returned. Otherwise, the first existing <code>extension-element</code> element will be returned
getOrCreateExtensionElement
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/jsptaglibrary21/TldExtensionTypeImpl.java", "license": "epl-1.0", "size": 6210 }
[ "java.util.List", "org.jboss.shrinkwrap.descriptor.api.jsptaglibrary21.ExtensibleType", "org.jboss.shrinkwrap.descriptor.api.jsptaglibrary21.TldExtensionType", "org.jboss.shrinkwrap.descriptor.spi.node.Node" ]
import java.util.List; import org.jboss.shrinkwrap.descriptor.api.jsptaglibrary21.ExtensibleType; import org.jboss.shrinkwrap.descriptor.api.jsptaglibrary21.TldExtensionType; import org.jboss.shrinkwrap.descriptor.spi.node.Node;
import java.util.*; import org.jboss.shrinkwrap.descriptor.api.jsptaglibrary21.*; import org.jboss.shrinkwrap.descriptor.spi.node.*;
[ "java.util", "org.jboss.shrinkwrap" ]
java.util; org.jboss.shrinkwrap;
2,144,976
public synchronized SharedPreferences getAppPreferences() { return YonaApplication.getAppContext().getSharedPreferences(PreferenceConstant.APP_PREFERENCE_KEY, Context.MODE_PRIVATE); }
synchronized SharedPreferences function() { return YonaApplication.getAppContext().getSharedPreferences(PreferenceConstant.APP_PREFERENCE_KEY, Context.MODE_PRIVATE); }
/** * Gets user preferences. * * @return the user preferences */
Gets user preferences
getAppPreferences
{ "repo_name": "yonadev/yona-app-android", "path": "app/src/main/java/nu/yona/app/state/SharedPreference.java", "license": "mpl-2.0", "size": 6089 }
[ "android.content.Context", "android.content.SharedPreferences", "nu.yona.app.YonaApplication", "nu.yona.app.utils.PreferenceConstant" ]
import android.content.Context; import android.content.SharedPreferences; import nu.yona.app.YonaApplication; import nu.yona.app.utils.PreferenceConstant;
import android.content.*; import nu.yona.app.*; import nu.yona.app.utils.*;
[ "android.content", "nu.yona.app" ]
android.content; nu.yona.app;
2,134,069
public static String urlDecodeQuery(String query) { String strRes = ""; try { strRes = URLDecoder.decode(query, "UTF-8"); } catch (UnsupportedEncodingException e) { // do nothing } return (strRes); }
static String function(String query) { String strRes = STRUTF-8"); } catch (UnsupportedEncodingException e) { } return (strRes); }
/** * Decodes a string which came as a part of of URL (e.g. a URL parameter). This converts * codes of escaped special characters back into those special characters. * * @param query The string that needs URL decoded. * @return Decoded string that will contain all the special characters. */
Decodes a string which came as a part of of URL (e.g. a URL parameter). This converts codes of escaped special characters back into those special characters
urlDecodeQuery
{ "repo_name": "ThilinaManamgoda/incubator-taverna-workbench", "path": "taverna-perspective-biocatalogue/src/main/java/org/apache/taverna/biocatalogue/model/Util.java", "license": "apache-2.0", "size": 32324 }
[ "java.io.UnsupportedEncodingException" ]
import java.io.UnsupportedEncodingException;
import java.io.*;
[ "java.io" ]
java.io;
2,512,110
public boolean isPluginInstalled(String pluginId){ if(pluginId == null ) return false; try{ IFolder pluginHome = getPluginHomeFolder(pluginId); if(pluginHome != null ){ IFile pluginxml = pluginHome.getFile(PlatformConstants.FILE_XML_PLUGIN); return pluginxml.getLocation() != null && pluginHome.get...
boolean function(String pluginId){ if(pluginId == null ) return false; try{ IFolder pluginHome = getPluginHomeFolder(pluginId); if(pluginHome != null ){ IFile pluginxml = pluginHome.getFile(PlatformConstants.FILE_XML_PLUGIN); return pluginxml.getLocation() != null && pluginHome.getLocation().toFile().exists(); } }catch...
/** * Checks if the given plug-in with pluginId is installed for the project. * Also uses {@link CordovaPluginRegistryMapper} to check alternate IDs * for plugins. * * @param pluginId * @return true if the plug-in is installed */
Checks if the given plug-in with pluginId is installed for the project. Also uses <code>CordovaPluginRegistryMapper</code> to check alternate IDs for plugins
isPluginInstalled
{ "repo_name": "eclipse/thym", "path": "plugins/org.eclipse.thym.core/src/org/eclipse/thym/core/plugin/CordovaPluginManager.java", "license": "epl-1.0", "size": 13617 }
[ "org.eclipse.core.resources.IFile", "org.eclipse.core.resources.IFolder", "org.eclipse.core.runtime.CoreException", "org.eclipse.thym.core.platform.PlatformConstants" ]
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.runtime.CoreException; import org.eclipse.thym.core.platform.PlatformConstants;
import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.thym.core.platform.*;
[ "org.eclipse.core", "org.eclipse.thym" ]
org.eclipse.core; org.eclipse.thym;
2,164,849
private void adjustTop(RectF rect, float top, RectF bounds, float snapMargin, float aspectRatio, boolean leftMoves, boolean rightMoves) { float newTop = top; if (newTop < 0) { newTop /= 1.05f; mTouchOffset.y -= newTop / 1.1f; } if (newTop < bounds.top) { ...
void function(RectF rect, float top, RectF bounds, float snapMargin, float aspectRatio, boolean leftMoves, boolean rightMoves) { float newTop = top; if (newTop < 0) { newTop /= 1.05f; mTouchOffset.y -= newTop / 1.1f; } if (newTop < bounds.top) { mTouchOffset.y -= (newTop - bounds.top) / 2f; } if (newTop - bounds.top < ...
/** * Get the resulting y-position of the top edge of the crop window given the * handle's position and the image's bounding box and snap radius. * * @param top the x-position that the top edge is dragged to * @param bounds the bounding box of the image that is being cropped * @param snapM...
Get the resulting y-position of the top edge of the crop window given the handle's position and the image's bounding box and snap radius
adjustTop
{ "repo_name": "anuj7sharma/ImagePicker", "path": "app/src/main/java/com/imagepicker/cropper/CropWindowMoveHandler.java", "license": "apache-2.0", "size": 29072 }
[ "android.graphics.RectF" ]
import android.graphics.RectF;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
1,507,846
@Override public Request<ImportInstanceRequest> getDryRunRequest() { Request<ImportInstanceRequest> request = new ImportInstanceRequestMarshaller() .marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request; }
Request<ImportInstanceRequest> function() { Request<ImportInstanceRequest> request = new ImportInstanceRequestMarshaller() .marshall(this); request.addParameter(STR, Boolean.toString(true)); return request; }
/** * This method is intended for internal use only. Returns the marshaled * request configured with additional parameters to enable operation * dry-run. */
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run
getDryRunRequest
{ "repo_name": "mhurne/aws-sdk-java", "path": "aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/ImportInstanceRequest.java", "license": "apache-2.0", "size": 10693 }
[ "com.amazonaws.Request", "com.amazonaws.services.ec2.model.transform.ImportInstanceRequestMarshaller" ]
import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.ImportInstanceRequestMarshaller;
import com.amazonaws.*; import com.amazonaws.services.ec2.model.transform.*;
[ "com.amazonaws", "com.amazonaws.services" ]
com.amazonaws; com.amazonaws.services;
950,161
public void open() { Shell parentShell = getParent(); dialogShell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); // Configure dialog shell internal layout. FormLayout dialogShellLayout = new FormLayout(); dialogShellLayout.marginHeight = 5; dialogShellLayout.marginWidth = 5; dial...
void function() { Shell parentShell = getParent(); dialogShell = new Shell(parentShell, SWT.DIALOG_TRIM SWT.APPLICATION_MODAL); FormLayout dialogShellLayout = new FormLayout(); dialogShellLayout.marginHeight = 5; dialogShellLayout.marginWidth = 5; dialogShell.setLayout(dialogShellLayout); propertyGroupBox = new Group(d...
/** * Creates ui components and opens the dialog. */
Creates ui components and opens the dialog
open
{ "repo_name": "sohaniwso2/devstudio-tooling-esb", "path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/custom/provider/NamespacedPropertyEditorDialog.java", "license": "apache-2.0", "size": 16411 }
[ "org.eclipse.swt.layout.FormAttachment", "org.eclipse.swt.layout.FormData", "org.eclipse.swt.layout.FormLayout", "org.eclipse.swt.widgets.Button", "org.eclipse.swt.widgets.Display", "org.eclipse.swt.widgets.Group", "org.eclipse.swt.widgets.Label", "org.eclipse.swt.widgets.List", "org.eclipse.swt.wid...
import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.List; ...
import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
1,008,145
public InputStream getContentInputStream() throws IOException { HttpEntity entity = wrappedResponse.getEntity(); return entity.getContent(); }
InputStream function() throws IOException { HttpEntity entity = wrappedResponse.getEntity(); return entity.getContent(); }
/** * Returns the input stream associated with response content * @return the input stream associated with response content * @throws IOException if there was an I/O error while processing the response. */
Returns the input stream associated with response content
getContentInputStream
{ "repo_name": "agapsys/simple-http-client", "path": "src/main/java/com/agapsys/http/HttpResponse.java", "license": "apache-2.0", "size": 9974 }
[ "java.io.IOException", "java.io.InputStream", "org.apache.http.HttpEntity" ]
import java.io.IOException; import java.io.InputStream; import org.apache.http.HttpEntity;
import java.io.*; import org.apache.http.*;
[ "java.io", "org.apache.http" ]
java.io; org.apache.http;
981,423
SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } private final Duration defaultPollInterval;
SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } private final Duration defaultPollInterval;
/** * Gets The serializer to serialize an object into a string. * * @return the serializerAdapter value. */
Gets The serializer to serialize an object into a string
getSerializerAdapter
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchManagementImpl.java", "license": "mit", "size": 14369 }
[ "com.azure.core.util.serializer.SerializerAdapter", "java.time.Duration" ]
import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration;
import com.azure.core.util.serializer.*; import java.time.*;
[ "com.azure.core", "java.time" ]
com.azure.core; java.time;
1,438,091
protected void addDefaultDigesterRules(Digester digester) { digester.addSetProperties(TAG_QUARTZ, TAG_OVERWRITE_EXISTING_JOBS, "overWriteExistingJobs"); digester.addObjectCreate(TAG_QUARTZ + "/" + TAG_JOB_LISTENER, "jobListener","class-name"); digester.addCallMethod(TAG_QUARTZ + "/" + TAG_JO...
void function(Digester digester) { digester.addSetProperties(TAG_QUARTZ, TAG_OVERWRITE_EXISTING_JOBS, STR); digester.addObjectCreate(TAG_QUARTZ + "/" + TAG_JOB_LISTENER, STR,STR); digester.addCallMethod(TAG_QUARTZ + "/" + TAG_JOB_LISTENER,STR,1); digester.addCallParam(TAG_QUARTZ + "/" + TAG_JOB_LISTENER,0,"name"); dige...
/** * Add the default set of digest rules */
Add the default set of digest rules
addDefaultDigesterRules
{ "repo_name": "chandrasekhar4u/opensymphony-quartz-backup", "path": "trunk/src/java/org/quartz/xml/JobSchedulingDataProcessor.java", "license": "apache-2.0", "size": 52482 }
[ "java.util.TimeZone", "org.apache.commons.digester.Digester", "org.quartz.CronTrigger", "org.quartz.JobDataMap", "org.quartz.JobDetail", "org.quartz.SimpleTrigger" ]
import java.util.TimeZone; import org.apache.commons.digester.Digester; import org.quartz.CronTrigger; import org.quartz.JobDataMap; import org.quartz.JobDetail; import org.quartz.SimpleTrigger;
import java.util.*; import org.apache.commons.digester.*; import org.quartz.*;
[ "java.util", "org.apache.commons", "org.quartz" ]
java.util; org.apache.commons; org.quartz;
2,324,643
private static Class[] getAccessibleInterfaces(Class clazz) { ClassLoader loader = clazz.getClassLoader(); Set interfaces = new HashSet(); while (clazz != null) { Class[] candidates = clazz.getInterfaces(); for (int c = 0; c < candidates.length; c++) { Class candidate = candidates[c]; if (!Modi...
static Class[] function(Class clazz) { ClassLoader loader = clazz.getClassLoader(); Set interfaces = new HashSet(); while (clazz != null) { Class[] candidates = clazz.getInterfaces(); for (int c = 0; c < candidates.length; c++) { Class candidate = candidates[c]; if (!Modifier.isPublic(candidate.getModifiers())) { if (c...
/** * Utility method to retrieve all accessible interfaces of a class and its * superclasses. * * @param clazz * class to get interfaces for * @return implemented interfaces */
Utility method to retrieve all accessible interfaces of a class and its superclasses
getAccessibleInterfaces
{ "repo_name": "magsilva/spin", "path": "src/main/java/spin/proxy/JDKProxyFactory.java", "license": "lgpl-2.1", "size": 4191 }
[ "java.lang.reflect.Modifier", "java.util.HashSet", "java.util.Set" ]
import java.lang.reflect.Modifier; import java.util.HashSet; import java.util.Set;
import java.lang.reflect.*; import java.util.*;
[ "java.lang", "java.util" ]
java.lang; java.util;
23,798
@SimpleEvent(description = "This event is raised when the messages " + "requested through <code>RequestFriendTimeline</code> have " + "been retrieved. The <code>timeline</code> parameter and the " + "<code>Timeline</code> property will contain a list of lists, where " + "each sub-list contains...
@SimpleEvent(description = STR + STR + STR + STR + STR) void function(final List<List<String>> timeline) { EventDispatcher.dispatchEvent(this, STR, timeline); }
/** * Indicates when the friend timeline requested through * {@link #RequestFriendTimeline()} has been received. */
Indicates when the friend timeline requested through <code>#RequestFriendTimeline()</code> has been received
FriendTimelineReceived
{ "repo_name": "bitsecure/appinventor1-sources", "path": "appinventor/components/src/com/google/appinventor/components/runtime/Twitter.java", "license": "apache-2.0", "size": 38561 }
[ "com.google.appinventor.components.annotations.SimpleEvent", "java.util.List" ]
import com.google.appinventor.components.annotations.SimpleEvent; import java.util.List;
import com.google.appinventor.components.annotations.*; import java.util.*;
[ "com.google.appinventor", "java.util" ]
com.google.appinventor; java.util;
1,408,770
// todo [cdm 2012]: This duplicates the functionality of the methods above. Should be refactored. public void readSVMLightFormat(File file) { for (String line : IOUtils.readLines(file)) { line = line.replaceAll("#.*", ""); // remove any trailing comments String[] items = line.split("\\s+"); I...
void function(File file) { for (String line : IOUtils.readLines(file)) { line = line.replaceAll("#.*", STR\\s+STR:"); int feature = Integer.parseInt(featureItems[0]); double value = Double.parseDouble(featureItems[1]); features.incrementCount(this.featureIndex.get(feature), value); } this.add(new RVFDatum<L, F>(feature...
/** * Read SVM-light formatted data into this dataset. * * A strict SVM-light format is expected, where labels and features are both * encoded as integers. These integers are converted into the dataset label * and feature types using the indexes stored in this dataset. * * @param file The file from...
Read SVM-light formatted data into this dataset. A strict SVM-light format is expected, where labels and features are both encoded as integers. These integers are converted into the dataset label and feature types using the indexes stored in this dataset
readSVMLightFormat
{ "repo_name": "tabladrum/CoreNLP", "path": "src/edu/stanford/nlp/classify/RVFDataset.java", "license": "gpl-2.0", "size": 32420 }
[ "edu.stanford.nlp.io.IOUtils", "edu.stanford.nlp.ling.RVFDatum", "java.io.File" ]
import edu.stanford.nlp.io.IOUtils; import edu.stanford.nlp.ling.RVFDatum; import java.io.File;
import edu.stanford.nlp.io.*; import edu.stanford.nlp.ling.*; import java.io.*;
[ "edu.stanford.nlp", "java.io" ]
edu.stanford.nlp; java.io;
2,871,555
public static void main(String[] args) throws Exception { int res = ToolRunner.run(new Configuration(), new WordsInCorpusTFIDF(), args); System.exit(res); }
static void function(String[] args) throws Exception { int res = ToolRunner.run(new Configuration(), new WordsInCorpusTFIDF(), args); System.exit(res); }
/** * Main driver * * @param args * @throws Exception */
Main driver
main
{ "repo_name": "kl0u/visco", "path": "src/examples/org/apache/hadoop/examples/tfidf/WordsInCorpusTFIDF.java", "license": "apache-2.0", "size": 2420 }
[ "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.util.ToolRunner" ]
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.util.ToolRunner;
import org.apache.hadoop.conf.*; import org.apache.hadoop.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
311,497
public boolean isFile(Path pathRelativeToProjectRoot) { return Files.isRegularFile( getPathForRelativePath(pathRelativeToProjectRoot)); }
boolean function(Path pathRelativeToProjectRoot) { return Files.isRegularFile( getPathForRelativePath(pathRelativeToProjectRoot)); }
/** * Checks whether there is a normal file at the specified path. */
Checks whether there is a normal file at the specified path
isFile
{ "repo_name": "bocon13/buck", "path": "src/com/facebook/buck/io/ProjectFilesystem.java", "license": "apache-2.0", "size": 43079 }
[ "java.nio.file.Files", "java.nio.file.Path" ]
import java.nio.file.Files; import java.nio.file.Path;
import java.nio.file.*;
[ "java.nio" ]
java.nio;
581,424
public TweetDao composeNewReplyTweet( String msg, TweetDao mainTweet ) throws TwitterActionException { return customComposeNewTweet(msg, mainTweet, TweetAttachments.empty()); }
TweetDao function( String msg, TweetDao mainTweet ) throws TwitterActionException { return customComposeNewTweet(msg, mainTweet, TweetAttachments.empty()); }
/** * Method which compose new reply tweet in Tweeter account * * @param msg * textual representation of tweet * @param mainTweetId * identifier of tweet for which we reply * @throws TwitterActionException */
Method which compose new reply tweet in Tweeter account
composeNewReplyTweet
{ "repo_name": "voncuver/cwierkacz", "path": "src/main/java/com/pk/cwierkacz/twitter/TwitterAccount.java", "license": "agpl-3.0", "size": 20730 }
[ "com.pk.cwierkacz.model.dao.TweetDao", "com.pk.cwierkacz.twitter.attachment.TweetAttachments" ]
import com.pk.cwierkacz.model.dao.TweetDao; import com.pk.cwierkacz.twitter.attachment.TweetAttachments;
import com.pk.cwierkacz.model.dao.*; import com.pk.cwierkacz.twitter.attachment.*;
[ "com.pk.cwierkacz" ]
com.pk.cwierkacz;
225,483
public ListView getListView() { return listView; }
ListView function() { return listView; }
/** Gets the ListView of this fragment * * @return {@link AllBussesFragment#listView} */
Gets the ListView of this fragment
getListView
{ "repo_name": "mehmetakiftutuncu/eshotroid-legacy", "path": "Eshotroid/src/com/mehmetakiftutuncu/eshotroid/fragment/FavoriteBussesFragment.java", "license": "gpl-3.0", "size": 3751 }
[ "android.widget.ListView" ]
import android.widget.ListView;
import android.widget.*;
[ "android.widget" ]
android.widget;
1,862,269
public Editor edit() throws IOException { return DiskLruCache.this.edit(key, sequenceNumber); }
Editor function() throws IOException { return DiskLruCache.this.edit(key, sequenceNumber); }
/** * Returns an editor for this snapshot's entry, or null if either the * entry has changed since this snapshot was created or if another edit * is in progress. */
Returns an editor for this snapshot's entry, or null if either the entry has changed since this snapshot was created or if another edit is in progress
edit
{ "repo_name": "tinyvampirepudge/Android_Basis_Demo", "path": "Android_Basis_Demo/app/src/main/java/com/tiny/demo/firstlinecode/kfysts/chapter12/ryg/DiskLruCache.java", "license": "apache-2.0", "size": 33936 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,912,787
protected String createPassword() { final Random randomGenerator = new Random(); final int numSaltChars = saltChars.length; final StringBuffer outPassword = new StringBuffer(); for (int i = 0; i < 6; i++) { outPassword.append(saltChars[randomGenerator.nextInt(Integer...
String function() { final Random randomGenerator = new Random(); final int numSaltChars = saltChars.length; final StringBuffer outPassword = new StringBuffer(); for (int i = 0; i < 6; i++) { outPassword.append(saltChars[randomGenerator.nextInt(Integer.MAX_VALUE) % numSaltChars]); } return new String(outPassword); }
/** Creates a new password. * * @return java.lang.String The new password. */
Creates a new password
createPassword
{ "repo_name": "aktion-hip/vif", "path": "org.hip.vif.admin.member/src/org/hip/vif/admin/member/tasks/AbstractMemberTask.java", "license": "gpl-2.0", "size": 4907 }
[ "java.util.Random" ]
import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
172,732
Observable<Map<String, List<String>>> getArrayValidAsync();
Observable<Map<String, List<String>>> getArrayValidAsync();
/** * Get an array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. * * @return the observable to the Map&lt;String, List&lt;String&gt;&gt; object */
Get an array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}
getArrayValidAsync
{ "repo_name": "anudeepsharma/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodydictionary/Dictionarys.java", "license": "mit", "size": 79030 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
788,901
void setUpperBound(XExpression value);
void setUpperBound(XExpression value);
/** * Sets the value of the '{@link org.eclipse.elk.core.meta.metaData.MdOption#getUpperBound <em>Upper Bound</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Upper Bound</em>' containment reference. * @see #getUpperBound() * @gen...
Sets the value of the '<code>org.eclipse.elk.core.meta.metaData.MdOption#getUpperBound Upper Bound</code>' containment reference.
setUpperBound
{ "repo_name": "eNBeWe/elk", "path": "plugins/org.eclipse.elk.core.meta/src-gen/org/eclipse/elk/core/meta/metaData/MdOption.java", "license": "epl-1.0", "size": 14340 }
[ "org.eclipse.xtext.xbase.XExpression" ]
import org.eclipse.xtext.xbase.XExpression;
import org.eclipse.xtext.xbase.*;
[ "org.eclipse.xtext" ]
org.eclipse.xtext;
1,277,546
public List<Entity<EntityMappings<T>>> getAllEntity();
List<Entity<EntityMappings<T>>> function();
/** * Returns all <code>entity</code> elements * @return list of <code>entity</code> */
Returns all <code>entity</code> elements
getAllEntity
{ "repo_name": "forge/javaee-descriptors", "path": "api/src/main/java/org/jboss/shrinkwrap/descriptor/api/orm10/EntityMappings.java", "license": "epl-1.0", "size": 19256 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
768,277
@Test() public void testMultilevelSetType() throws Exception { final Field f = TypeInfoTestCase.class.getDeclaredField("multiLevelSetType"); assertNotNull(f); final TypeInfo ti = new TypeInfo(f.getGenericType()); assertNotNull(ti); assertEquals(ti.getType(), f.getGenericTyp...
@Test() void function() throws Exception { final Field f = TypeInfoTestCase.class.getDeclaredField(STR); assertNotNull(f); final TypeInfo ti = new TypeInfo(f.getGenericType()); assertNotNull(ti); assertEquals(ti.getType(), f.getGenericType()); assertFalse(ti.isSupported()); }
/** * Tests the behavior with a multilevel set type. * * @throws Exception If an unexpected problem occurs. */
Tests the behavior with a multilevel set type
testMultilevelSetType
{ "repo_name": "UnboundID/ldapsdk", "path": "tests/unit/src/com/unboundid/ldap/sdk/persist/TypeInfoTestCase.java", "license": "gpl-2.0", "size": 12173 }
[ "java.lang.reflect.Field", "org.testng.annotations.Test" ]
import java.lang.reflect.Field; import org.testng.annotations.Test;
import java.lang.reflect.*; import org.testng.annotations.*;
[ "java.lang", "org.testng.annotations" ]
java.lang; org.testng.annotations;
1,575,702
private void doFlush() { FileWriteHandle hnd = currentHandle(); try { hnd.flush(null); } catch (Exception e) { U.warn(log, "Failed to flush WAL record queue", e); } } @SuppressWarnings("ForLoopReplaceableByForEach") private class WAL...
void function() { FileWriteHandle hnd = currentHandle(); try { hnd.flush(null); } catch (Exception e) { U.warn(log, STR, e); } } @SuppressWarnings(STR) private class WALWriter extends Thread { private static final long UNCONDITIONAL_FLUSH = -1L; private static final long FILE_CLOSE = -2L; private static final long FILE...
/** * Flushes current file handle for {@link WALMode#BACKGROUND} WALMode. Called periodically from scheduler. */
Flushes current file handle for <code>WALMode#BACKGROUND</code> WALMode. Called periodically from scheduler
doFlush
{ "repo_name": "vladisav/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FileWriteAheadLogManager.java", "license": "apache-2.0", "size": 118308 }
[ "java.util.Map", "java.util.concurrent.ConcurrentHashMap", "org.apache.ignite.internal.util.typedef.internal.U" ]
import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.apache.ignite.internal.util.typedef.internal.U;
import java.util.*; import java.util.concurrent.*; import org.apache.ignite.internal.util.typedef.internal.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
2,464,609
public VirtualHubRouteTable routeTable() { return this.innerProperties() == null ? null : this.innerProperties().routeTable(); }
VirtualHubRouteTable function() { return this.innerProperties() == null ? null : this.innerProperties().routeTable(); }
/** * Get the routeTable property: The routeTable associated with this virtual hub. * * @return the routeTable value. */
Get the routeTable property: The routeTable associated with this virtual hub
routeTable
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualHubInner.java", "license": "mit", "size": 9351 }
[ "com.azure.resourcemanager.network.models.VirtualHubRouteTable" ]
import com.azure.resourcemanager.network.models.VirtualHubRouteTable;
import com.azure.resourcemanager.network.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
1,296,946
protected Locale getLocale(String destination, List properties) { String localeName = CmsProperty.get(CmsPropertyDefinition.PROPERTY_LOCALE, properties).getValue(); if (localeName != null) { // locale was already set on the files properties return OpenCms.getLocaleManager()...
Locale function(String destination, List properties) { String localeName = CmsProperty.get(CmsPropertyDefinition.PROPERTY_LOCALE, properties).getValue(); if (localeName != null) { return OpenCms.getLocaleManager().getAvailableLocales(localeName).get(0); } return OpenCms.getLocaleManager().getDefaultLocales(m_cms, CmsRe...
/** * Returns the appropriate locale for the given destination.<p> * * @param destination the destination path (parent must exist) * @param properties the properties to check at first * * @return the locale */
Returns the appropriate locale for the given destination
getLocale
{ "repo_name": "serrapos/opencms-core", "path": "src/org/opencms/importexport/A_CmsImport.java", "license": "lgpl-2.1", "size": 45017 }
[ "java.util.List", "java.util.Locale", "org.opencms.file.CmsProperty", "org.opencms.file.CmsPropertyDefinition", "org.opencms.file.CmsResource", "org.opencms.main.OpenCms" ]
import java.util.List; import java.util.Locale; import org.opencms.file.CmsProperty; import org.opencms.file.CmsPropertyDefinition; import org.opencms.file.CmsResource; import org.opencms.main.OpenCms;
import java.util.*; import org.opencms.file.*; import org.opencms.main.*;
[ "java.util", "org.opencms.file", "org.opencms.main" ]
java.util; org.opencms.file; org.opencms.main;
964,860
protected boolean includeLess() { return getConfigurationService().getPropertyValueAsBoolean(KRADConstants.ConfigParameters.KRAD_INCLUDE_LESS); }
boolean function() { return getConfigurationService().getPropertyValueAsBoolean(KRADConstants.ConfigParameters.KRAD_INCLUDE_LESS); }
/** * Indicates whether Less files should be included instead of Css files when running in dev mode. * * @return true if less files should be subsituted, false if not */
Indicates whether Less files should be included instead of Css files when running in dev mode
includeLess
{ "repo_name": "bhutchinson/rice", "path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/uif/view/ViewTheme.java", "license": "apache-2.0", "size": 24680 }
[ "org.kuali.rice.krad.util.KRADConstants" ]
import org.kuali.rice.krad.util.KRADConstants;
import org.kuali.rice.krad.util.*;
[ "org.kuali.rice" ]
org.kuali.rice;
2,153,735
@Test public void testSetUtilizationOfBandwidth_1() throws Exception { RdaCloudlet cloudlet = new RdaCloudlet(1, 1, 1L, 1L, "src/test/resources/input1.csv", false); cloudlet.setUtilizationOfBandwidth(1.0); double value = 1.0; cloudlet.setUtilizationOfBandwidth(value); assertEquals(1.0, cl...
void function() throws Exception { RdaCloudlet cloudlet = new RdaCloudlet(1, 1, 1L, 1L, STR, false); cloudlet.setUtilizationOfBandwidth(1.0); double value = 1.0; cloudlet.setUtilizationOfBandwidth(value); assertEquals(1.0, cloudlet.getUtilizationOfBw(0.0), 0); }
/** * Run the void setUtilizationOfBandwidth(double) method test. * * @throws Exception * * @generatedBy CodePro at 5/11/15 10:59 AM */
Run the void setUtilizationOfBandwidth(double) method test
testSetUtilizationOfBandwidth_1
{ "repo_name": "pattad/cloudsim-rda", "path": "src/test/java/ch/uzh/ifi/csg/cloudsim/rda/RdaCloudletTest.java", "license": "gpl-2.0", "size": 16697 }
[ "ch.uzh.ifi.csg.cloudsim.rda.RdaCloudlet", "org.junit.Assert" ]
import ch.uzh.ifi.csg.cloudsim.rda.RdaCloudlet; import org.junit.Assert;
import ch.uzh.ifi.csg.cloudsim.rda.*; import org.junit.*;
[ "ch.uzh.ifi", "org.junit" ]
ch.uzh.ifi; org.junit;
1,841,896
Map<String, Object> getResponseContext();
Map<String, Object> getResponseContext();
/** * Get the context that resulted from processing a response message. * * The returned context is for the most recently completed synchronous * operation. Subsequent synchronous operation invocations overwrite the * response context. Asynchronous operations return their response context ...
Get the context that resulted from processing a response message. The returned context is for the most recently completed synchronous operation. Subsequent synchronous operation invocations overwrite the response context. Asynchronous operations return their response context via the Response interface
getResponseContext
{ "repo_name": "flyzsd/java-code-snippets", "path": "ibm.jdk8/src/javax/xml/ws/BindingProvider.java", "license": "mit", "size": 6418 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,431,323
@Override public void close() throws IOException { tailPipeRead.close(); tailListener.close(); fileTailer.stop(); }
void function() throws IOException { tailPipeRead.close(); tailListener.close(); fileTailer.stop(); }
/** * Closes this input stream and releases any system resources associated * with the stream. * <p> * <p> The <code>close</code> method of <code>InputStream</code> does * nothing. * * @throws IOException if an I/O error occurs. */
Closes this input stream and releases any system resources associated with the stream. The <code>close</code> method of <code>InputStream</code> does nothing
close
{ "repo_name": "jmckinney88/deneir", "path": "io/src/main/java/com/pyrese/io/TailInputStream.java", "license": "mit", "size": 10015 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,218,336
public void setMessageConfig(ConfigMessage messageConfig) { this.messageConfig = messageConfig; }
void function(ConfigMessage messageConfig) { this.messageConfig = messageConfig; }
/** * Set a reference to the message config, used to determine the current username casing resolution type * * @param messageConfig */
Set a reference to the message config, used to determine the current username casing resolution type
setMessageConfig
{ "repo_name": "qial/ChatGameFontificator", "path": "src/main/java/com/glitchcog/fontificator/bot/ChatViewerBot.java", "license": "unlicense", "size": 12218 }
[ "com.glitchcog.fontificator.config.ConfigMessage" ]
import com.glitchcog.fontificator.config.ConfigMessage;
import com.glitchcog.fontificator.config.*;
[ "com.glitchcog.fontificator" ]
com.glitchcog.fontificator;
1,880,735
public static void pdbParse(String theFile, Electro2D electro2D, String data, int fileNum) { //error in reading file? boolean anerror = false; //structures to hold file data Vector fileData = new Vector(); //holds complete file Vector compoun...
static void function(String theFile, Electro2D electro2D, String data, int fileNum) { boolean anerror = false; Vector fileData = new Vector(); Vector compoundInfo = new Vector(); Vector sequenceInfo = new Vector(); Vector keywordInfo = new Vector(); Vector moleculeTitles = new Vector(); Vector chainData = new Vector();...
/** * This method parses a .pdb file, extracting sequence information and * appropriate descriptor for the sequence. * * @param theFile file to retrieve sequence data from * @param electro2D reference to calling applet * @param data user-inputted file data * @param fileNum the ...
This method parses a .pdb file, extracting sequence information and appropriate descriptor for the sequence
pdbParse
{ "repo_name": "RITJBF/JBioFramework", "path": "src/main/java/Utilities/GenomeFileParser.java", "license": "mit", "size": 53296 }
[ "java.io.IOException", "java.util.Hashtable", "java.util.Vector" ]
import java.io.IOException; import java.util.Hashtable; import java.util.Vector;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
506,433
public Object invoke(Object proxy, final Method method, final Object[] args) throws Throwable { if (method.getDeclaringClass() == Object.class) { return method.invoke(this, args); } AssistData data = assistDataByMethod.get(method); Provider<?> provider; if(data.cachedBinding != null) { // T...
Object function(Object proxy, final Method method, final Object[] args) throws Throwable { if (method.getDeclaringClass() == Object.class) { return method.invoke(this, args); } AssistData data = assistDataByMethod.get(method); Provider<?> provider; if(data.cachedBinding != null) { provider = data.cachedBinding.getProvi...
/** * When a factory method is invoked, we create a child injector that binds all parameters, then * use that to get an instance of the return type. */
When a factory method is invoked, we create a child injector that binds all parameters, then use that to get an instance of the return type
invoke
{ "repo_name": "emmby/guice", "path": "extensions/assistedinject/src/com/google/inject/assistedinject/FactoryProvider2.java", "license": "apache-2.0", "size": 28684 }
[ "com.google.common.collect.Iterables", "com.google.inject.Provider", "com.google.inject.ProvisionException", "com.google.inject.spi.Message", "java.lang.reflect.Method" ]
import com.google.common.collect.Iterables; import com.google.inject.Provider; import com.google.inject.ProvisionException; import com.google.inject.spi.Message; import java.lang.reflect.Method;
import com.google.common.collect.*; import com.google.inject.*; import com.google.inject.spi.*; import java.lang.reflect.*;
[ "com.google.common", "com.google.inject", "java.lang" ]
com.google.common; com.google.inject; java.lang;
440,733
public static String customDirectoryLogFileName(@Nullable String dir, String fileName) { assert fileName != null; if (dir == null) return fileName; int sep = fileName.lastIndexOf(File.separator); return dir + (sep < 0 ? File.separator + fileName : fileName.substring(se...
static String function(@Nullable String dir, String fileName) { assert fileName != null; if (dir == null) return fileName; int sep = fileName.lastIndexOf(File.separator); return dir + (sep < 0 ? File.separator + fileName : fileName.substring(sep)); }
/** * Substitutes log directory with a custom one. * * @param dir Directory. * @param fileName Original path. * @return New path. */
Substitutes log directory with a custom one
customDirectoryLogFileName
{ "repo_name": "WilliamDo/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 325083 }
[ "java.io.File", "org.jetbrains.annotations.Nullable" ]
import java.io.File; import org.jetbrains.annotations.Nullable;
import java.io.*; import org.jetbrains.annotations.*;
[ "java.io", "org.jetbrains.annotations" ]
java.io; org.jetbrains.annotations;
1,202,758
public static Set<Shell> getAllShells() { synchronized (CHILD_SHELLS) { return new HashSet<>(CHILD_SHELLS.keySet()); } }
static Set<Shell> function() { synchronized (CHILD_SHELLS) { return new HashSet<>(CHILD_SHELLS.keySet()); } }
/** * Static method to return a Set of all <code>Shell</code> objects. */
Static method to return a Set of all <code>Shell</code> objects
getAllShells
{ "repo_name": "nandakumar131/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java", "license": "apache-2.0", "size": 46607 }
[ "java.util.HashSet", "java.util.Set" ]
import java.util.HashSet; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
526,196
@Override public final Set<String> getPropertyNames() { Set<String> propertyNames = new HashSet<String>(); Object jsPropertyNames = this.invokeFunction("getPropertyNames", this.jsObject); Double numPropertyNames = this.invokeFunction("getArrayLength", jsPropertyNames); for (int i = 0; i < numPr...
final Set<String> function() { Set<String> propertyNames = new HashSet<String>(); Object jsPropertyNames = this.invokeFunction(STR, this.jsObject); Double numPropertyNames = this.invokeFunction(STR, jsPropertyNames); for (int i = 0; i < numPropertyNames.intValue(); i++) { String propertyName = this.invokeFunction(STR, ...
/** * Retrieve the names of the properties of the JSON object. * * @return The name of the properties of the JSON object. */
Retrieve the names of the properties of the JSON object
getPropertyNames
{ "repo_name": "kjots/json-toolkit", "path": "json-object.js/src/main/java/org/kjots/json/object/js/impl/JsJsonObjectImpl.java", "license": "apache-2.0", "size": 13455 }
[ "java.util.HashSet", "java.util.Set" ]
import java.util.HashSet; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,490,532
EClass getTracedModelParameter();
EClass getTracedModelParameter();
/** * Returns the meta object for class '{@link org.eclectic.frontend.core.TracedModelParameter <em>Traced Model Parameter</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Traced Model Parameter</em>'. * @see org.eclectic.frontend.core.TracedModelParameter *...
Returns the meta object for class '<code>org.eclectic.frontend.core.TracedModelParameter Traced Model Parameter</code>'.
getTracedModelParameter
{ "repo_name": "jesusc/eclectic", "path": "plugins/org.eclectic.frontend.asm/src-gen/org/eclectic/frontend/core/CorePackage.java", "license": "gpl-3.0", "size": 187193 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,635,954
public void toggleOverlayView(boolean isShow) { if (mOverlayShowRequest != isShow) { mOverlayShowRequest = isShow; mHandler.sendMessage(Message.obtain(null, MSG_ID_TOGGLE_OVERLAY, isShow ? 1 : 0, 0)); } }
void function(boolean isShow) { if (mOverlayShowRequest != isShow) { mOverlayShowRequest = isShow; mHandler.sendMessage(Message.obtain(null, MSG_ID_TOGGLE_OVERLAY, isShow ? 1 : 0, 0)); } }
/** * Called from C++ world to show or hide overlay view * * @param items * @param isShow * @param mode */
Called from C++ world to show or hide overlay view
toggleOverlayView
{ "repo_name": "garymabin/YGOMobile", "path": "proj.android/src/cn/garymb/ygomobile/YGOMobileActivity.java", "license": "mit", "size": 13698 }
[ "android.os.Message" ]
import android.os.Message;
import android.os.*;
[ "android.os" ]
android.os;
1,251,699
public static List<Animation> unitMove(FreeColClient freeColClient, Unit unit, Tile source, Tile destination, float scale) { List<Animation> ret = new ArrayList<>(); int s...
static List<Animation> function(FreeColClient freeColClient, Unit unit, Tile source, Tile destination, float scale) { List<Animation> ret = new ArrayList<>(); int speed = freeColClient.getAnimationSpeed(unit.getOwner()); if (speed > 0) { UnitMoveAnimation a = new UnitMoveAnimation(unit, source, destination, speed, scal...
/** * Collect animations for a unit move. * * @param freeColClient The enclosing {@code FreeColClient}. * @param unit The {@code Unit} to be animated. * @param source The source {@code Tile} for the unit. * @param destination The destination {@code Tile} for the unit. * @param scale T...
Collect animations for a unit move
unitMove
{ "repo_name": "FreeCol/freecol", "path": "src/net/sf/freecol/client/gui/animation/Animations.java", "license": "gpl-2.0", "size": 5075 }
[ "java.util.ArrayList", "java.util.List", "net.sf.freecol.client.FreeColClient", "net.sf.freecol.common.model.Tile", "net.sf.freecol.common.model.Unit" ]
import java.util.ArrayList; import java.util.List; import net.sf.freecol.client.FreeColClient; import net.sf.freecol.common.model.Tile; import net.sf.freecol.common.model.Unit;
import java.util.*; import net.sf.freecol.client.*; import net.sf.freecol.common.model.*;
[ "java.util", "net.sf.freecol" ]
java.util; net.sf.freecol;
594,456
@ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<DataBoxEdgeDeviceInner>, DataBoxEdgeDeviceInner> beginCreateOrUpdate( String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context);
@ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<DataBoxEdgeDeviceInner>, DataBoxEdgeDeviceInner> beginCreateOrUpdate( String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, Context context);
/** * Creates or updates a Data Box Edge/Data Box Gateway resource. * * @param deviceName The device name. * @param resourceGroupName The resource group name. * @param dataBoxEdgeDevice The resource object. * @param context The context to associate with this operation. * @throws Illeg...
Creates or updates a Data Box Edge/Data Box Gateway resource
beginCreateOrUpdate
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DevicesClient.java", "license": "mit", "size": 31816 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.management.polling.PollResult", "com.azure.core.util.Context", "com.azure.core.util.polling.SyncPoller", "com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.databoxedge.fluent.models.DataBoxEdgeDeviceInner;
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.databoxedge.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,022,521
@Override protected boolean isSwitchFor(EPackage ePackage) { return ePackage == modelPackage; }
boolean function(EPackage ePackage) { return ePackage == modelPackage; }
/** * Checks whether this is a switch for the given package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @parameter ePackage the package in question. * @return whether this is a switch for the given package. * @generated */
Checks whether this is a switch for the given package.
isSwitchFor
{ "repo_name": "nasa/OpenSPIFe", "path": "gov.nasa.ensemble.core.model.plan.temporal/src/gov/nasa/ensemble/core/model/plan/temporal/util/TemporalSwitch.java", "license": "apache-2.0", "size": 5996 }
[ "org.eclipse.emf.ecore.EPackage" ]
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,306,652
public void throwExceptionIfErrorsFound(final RifError rifErrorEnumeration, final ArrayList<String> errorMessages) throws RIFServiceException { if (errorMessages.size() > 0) { throw new RIFServiceException(rifErrorEnumeration, errorMessages); } }
void function(final RifError rifErrorEnumeration, final ArrayList<String> errorMessages) throws RIFServiceException { if (errorMessages.size() > 0) { throw new RIFServiceException(rifErrorEnumeration, errorMessages); } }
/** * Count errors. * * @param rifErrorEnumeration the rif service errors * @param errorMessages the error messages * @throws RIFServiceException the RIF service exception */
Count errors
throwExceptionIfErrorsFound
{ "repo_name": "smallAreaHealthStatisticsUnit/rapidInquiryFacility", "path": "rifGenericLibrary/src/main/java/org/sahsu/rif/generic/util/FieldValidationUtility.java", "license": "lgpl-3.0", "size": 11268 }
[ "java.util.ArrayList", "org.sahsu.rif.generic.system.RIFServiceException", "org.sahsu.rif.generic.system.RifError" ]
import java.util.ArrayList; import org.sahsu.rif.generic.system.RIFServiceException; import org.sahsu.rif.generic.system.RifError;
import java.util.*; import org.sahsu.rif.generic.system.*;
[ "java.util", "org.sahsu.rif" ]
java.util; org.sahsu.rif;
2,629,309
File file = new File(path); if (file.exists()) { if (file.isDirectory()) { return true; } else { throw new IOException("Given path points to an existing file, not a directory: "+path); } } else { return false; } }
File file = new File(path); if (file.exists()) { if (file.isDirectory()) { return true; } else { throw new IOException(STR+path); } } else { return false; } }
/** * Checks whether the given path exists and is a directory. * * @param path the path to check * @return <code>true</code> if the directory exists, <code>false</code> * if there exists no directory (or file) with the given name * @throws IOException if the given path points to a file, i.e., not a...
Checks whether the given path exists and is a directory
exists
{ "repo_name": "stochastics-ulm-university/GeoLing", "path": "src/geoling/util/Directory.java", "license": "gpl-3.0", "size": 2314 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
938,007
public static void addRectangularOutlineProvider(View view, Resources res) { view.setOutlineProvider(RECT_OUTLINE_PROVIDER); }
static void function(View view, Resources res) { view.setOutlineProvider(RECT_OUTLINE_PROVIDER); }
/** * Adds a rectangular outline to a view. This can be useful when you want to add a shadow * to a transparent view. See b/16856049. * @param view view that the outline is added to * @param res The resources file. */
Adds a rectangular outline to a view. This can be useful when you want to add a shadow to a transparent view. See b/16856049
addRectangularOutlineProvider
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "packages/apps/ContactsCommon/src/com/android/contacts/common/util/ViewUtil.java", "license": "gpl-3.0", "size": 4026 }
[ "android.content.res.Resources", "android.view.View" ]
import android.content.res.Resources; import android.view.View;
import android.content.res.*; import android.view.*;
[ "android.content", "android.view" ]
android.content; android.view;
1,093,586
@Override protected void doPut(final HttpServletRequest request, final HttpServletResponse response) { LOG.trace("Start VtnServiceWebAPIServlet#init()"); JSONObject serviceErrorJSON = null; VtnServiceWebAPIHandler vtnServiceWebAPIHandler = null; try { vtnServiceWebAPIHandler = new VtnServiceWebAPIHand...
void function(final HttpServletRequest request, final HttpServletResponse response) { LOG.trace(STR); JSONObject serviceErrorJSON = null; VtnServiceWebAPIHandler vtnServiceWebAPIHandler = null; try { vtnServiceWebAPIHandler = new VtnServiceWebAPIHandler(); final JSONObject responseJson = vtnServiceWebAPIHandler.put(req...
/** * Do put.This method will be used to post the data either in xml or json to * the java api by converting all the request to JSON and getting response * in specified format. * * @param request * the request * @param response * the response * @see HttpServlet#doPut(HttpServlet...
Do put.This method will be used to post the data either in xml or json to the java api by converting all the request to JSON and getting response in specified format
doPut
{ "repo_name": "opendaylight/vtn", "path": "coordinator/java/vtn-webapi/src/org/opendaylight/vtn/webapi/endpoint/VtnServiceWebAPIServlet.java", "license": "epl-1.0", "size": 21725 }
[ "java.io.IOException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.json.JSONObject", "org.opendaylight.vtn.webapi.constants.ApplicationConstants", "org.opendaylight.vtn.webapi.enums.HttpErrorCodeEnum", "org.opendaylight.vtn.webapi.exception.VtnServiceWebAPIExc...
import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.JSONObject; import org.opendaylight.vtn.webapi.constants.ApplicationConstants; import org.opendaylight.vtn.webapi.enums.HttpErrorCodeEnum; import org.opendaylight.vtn.webapi.exception...
import java.io.*; import javax.servlet.http.*; import org.json.*; import org.opendaylight.vtn.webapi.constants.*; import org.opendaylight.vtn.webapi.enums.*; import org.opendaylight.vtn.webapi.exception.*; import org.opendaylight.vtn.webapi.services.*; import org.opendaylight.vtn.webapi.utils.*;
[ "java.io", "javax.servlet", "org.json", "org.opendaylight.vtn" ]
java.io; javax.servlet; org.json; org.opendaylight.vtn;
2,895,545
public Object[] getData(RequestScope request, ParameterMap parameterMap, Object parameterObject);
Object[] function(RequestScope request, ParameterMap parameterMap, Object parameterObject);
/** * Gets a data array from a parameter object. * * @param request - the scope of the request * @param parameterMap - the parameter map * @param parameterObject - the parameter object * * @return - the objects */
Gets a data array from a parameter object
getData
{ "repo_name": "cavajtennis/ibatis", "path": "java/mapper/mapper2/src/com/ibatis/sqlmap/engine/exchange/DataExchange.java", "license": "apache-2.0", "size": 2636 }
[ "com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap", "com.ibatis.sqlmap.engine.scope.RequestScope" ]
import com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap; import com.ibatis.sqlmap.engine.scope.RequestScope;
import com.ibatis.sqlmap.engine.mapping.parameter.*; import com.ibatis.sqlmap.engine.scope.*;
[ "com.ibatis.sqlmap" ]
com.ibatis.sqlmap;
600,295
public LeafNode createNode() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { PubSub reply = sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.CREATE), null); NodeExtension elem = reply.getExtension("create", PubSubNamespace.BASIC.getXmlns()); LeafNod...
LeafNode function() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { PubSub reply = sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.CREATE), null); NodeExtension elem = reply.getExtension(STR, PubSubNamespace.BASIC.getXmlns()); LeafNode newNode = new LeafNode(...
/** * Creates an instant node, if supported. * * @return The node that was created * @throws XMPPErrorException * @throws NoResponseException * @throws NotConnectedException * @throws InterruptedException */
Creates an instant node, if supported
createNode
{ "repo_name": "lovely3x/Smack", "path": "smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java", "license": "apache-2.0", "size": 17900 }
[ "org.jivesoftware.smack.SmackException", "org.jivesoftware.smack.XMPPException", "org.jivesoftware.smack.packet.IQ", "org.jivesoftware.smackx.pubsub.packet.PubSub", "org.jivesoftware.smackx.pubsub.packet.PubSubNamespace" ]
import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smackx.pubsub.packet.PubSub; import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
import org.jivesoftware.smack.*; import org.jivesoftware.smack.packet.*; import org.jivesoftware.smackx.pubsub.packet.*;
[ "org.jivesoftware.smack", "org.jivesoftware.smackx" ]
org.jivesoftware.smack; org.jivesoftware.smackx;
1,570,861
public boolean match(Map<String, String> parameters, String[] parts, int start, int end) { for (int i = start; i < end; i++) { if (!text.equals(parts[i])) { return false; } } return true; }
boolean function(Map<String, String> parameters, String[] parts, int start, int end) { for (int i = start; i < end; i++) { if (!text.equals(parts[i])) { return false; } } return true; }
/** * Return true if the literal matches the string parts from the ranges * specified by the start inclusive and end exclusive. * * @param parameters * The map of parameters. * @param parts * The component parts of a URL path. * @param start * ...
Return true if the literal matches the string parts from the ranges specified by the start inclusive and end exclusive
match
{ "repo_name": "defunct/dovetail", "path": "src/main/java/com/goodworkalan/dovetail/LiteralPart.java", "license": "mit", "size": 3357 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,585,049
public static Schema getBulkImportLeadSchema() { Schema s = SchemaBuilder.builder().record("bulkImportLead").fields() // .name("batchId").prop(SchemaConstants.TALEND_COLUMN_IS_KEY, "true").type().nullable().intType().noDefault() // .name("importId").type().nullable().stringTy...
static Schema function() { Schema s = SchemaBuilder.builder().record(STR).fields() .name(STR).type().nullable().stringType().noDefault() .name(STR).type().nullable().intType().noDefault() .name(STR).type().nullable().intType().noDefault() .name(STR).type().nullable().stringType().noDefault() .endRecord(); s.addProp(Sch...
/** * Bulk Operations */
Bulk Operations
getBulkImportLeadSchema
{ "repo_name": "Talend/components", "path": "components/components-marketo/components-marketo-definition/src/main/java/org/talend/components/marketo/MarketoConstants.java", "license": "apache-2.0", "size": 32544 }
[ "org.apache.avro.Schema", "org.apache.avro.SchemaBuilder", "org.talend.daikon.avro.SchemaConstants" ]
import org.apache.avro.Schema; import org.apache.avro.SchemaBuilder; import org.talend.daikon.avro.SchemaConstants;
import org.apache.avro.*; import org.talend.daikon.avro.*;
[ "org.apache.avro", "org.talend.daikon" ]
org.apache.avro; org.talend.daikon;
2,154,859
public boolean match(final Dictionary<String, ?> values) { if (operator == AND_OPERATOR) { final Filter[] operandArray = operands.toArray(new Filter[operands .size()]); for (int i = 0; i < operandArray.length; i++) { if (!operandArray[i].match(valu...
boolean function(final Dictionary<String, ?> values) { if (operator == AND_OPERATOR) { final Filter[] operandArray = operands.toArray(new Filter[operands .size()]); for (int i = 0; i < operandArray.length; i++) { if (!operandArray[i].match(values)) { return false; } } return true; } else if (operator == OR_OPERATOR) { ...
/** * check if the filter matches a dictionary of attributes. * * @param values * the attributes. * @return true, if the filter matches, false otherwise. * @see org.osgi.framework.Filter#match(java.util.Dictionary) * @category Filter */
check if the filter matches a dictionary of attributes
match
{ "repo_name": "ly-android/OpenAtlas", "path": "OpenAtlasCore/src/com/openatlas/framework/RFC1960Filter.java", "license": "mit", "size": 41391 }
[ "java.util.Dictionary", "org.osgi.framework.Filter" ]
import java.util.Dictionary; import org.osgi.framework.Filter;
import java.util.*; import org.osgi.framework.*;
[ "java.util", "org.osgi.framework" ]
java.util; org.osgi.framework;
1,380,221
public static InetAddress appInfoToAddress(String info) { Matcher m = INET_ADDRESS_PATTERN.matcher(info); if (m.find()) { int port = Integer.parseInt(m.group(2)); return new InetAddress(m.group(1), port); } return null; }
static InetAddress function(String info) { Matcher m = INET_ADDRESS_PATTERN.matcher(info); if (m.find()) { int port = Integer.parseInt(m.group(2)); return new InetAddress(m.group(1), port); } return null; }
/** * Convert the appinfo string to the address the application is available on * @param info the string of the appinfo * @return the address application is available on */
Convert the appinfo string to the address the application is available on
appInfoToAddress
{ "repo_name": "iVCE/RDFS", "path": "src/contrib/corona/src/java/org/apache/hadoop/corona/Utilities.java", "license": "apache-2.0", "size": 5375 }
[ "java.util.regex.Matcher" ]
import java.util.regex.Matcher;
import java.util.regex.*;
[ "java.util" ]
java.util;
1,139,823
public void setLastModifiedTimestamp(java.sql.Timestamp lastModifiedTimestamp) { this.lastModifiedTimestamp = lastModifiedTimestamp; }
void function(java.sql.Timestamp lastModifiedTimestamp) { this.lastModifiedTimestamp = lastModifiedTimestamp; }
/** * Set Last modified time. * * @param lastModifiedTimestamp the lastModifiedTimestamp to set */
Set Last modified time
setLastModifiedTimestamp
{ "repo_name": "terrancesnyder/oozie-hadoop2", "path": "core/src/main/java/org/apache/oozie/BundleActionBean.java", "license": "apache-2.0", "size": 11479 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,853,928
public List<String> getHTML();
List<String> function();
/** * Gets HTML content added via addHTML() * * @return List<String> of HTML components * @since org.openntf.domino 4.5.0 */
Gets HTML content added via addHTML()
getHTML
{ "repo_name": "rPraml/org.openntf.domino", "path": "domino/deprecated/src/main/java/org/openntf/domino/email/IEmail.java", "license": "apache-2.0", "size": 9473 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
454,925
public void doCancelQueue( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { checkPermission(BUILD); Hudson.getInstance().getQueue().cancel(this); rsp.forwardToPreviousPage(req); }
void function( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { checkPermission(BUILD); Hudson.getInstance().getQueue().cancel(this); rsp.forwardToPreviousPage(req); }
/** * Cancels a scheduled build. */
Cancels a scheduled build
doCancelQueue
{ "repo_name": "fujibee/hudson", "path": "core/src/main/java/hudson/model/AbstractProject.java", "license": "mit", "size": 52449 }
[ "java.io.IOException", "javax.servlet.ServletException", "org.kohsuke.stapler.StaplerRequest", "org.kohsuke.stapler.StaplerResponse" ]
import java.io.IOException; import javax.servlet.ServletException; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse;
import java.io.*; import javax.servlet.*; import org.kohsuke.stapler.*;
[ "java.io", "javax.servlet", "org.kohsuke.stapler" ]
java.io; javax.servlet; org.kohsuke.stapler;
1,563,652
public static DialogFixture prepareDialogFixture(LanguageDialog languageDialog) { DialogFixture dialogFixture = new DialogFixture(languageDialog); dialogFixture.show(); return dialogFixture; }
static DialogFixture function(LanguageDialog languageDialog) { DialogFixture dialogFixture = new DialogFixture(languageDialog); dialogFixture.show(); return dialogFixture; }
/** * Prepare fest fixture for lang selection * * @param languageDialog */
Prepare fest fixture for lang selection
prepareDialogFixture
{ "repo_name": "mtjandra/izpack", "path": "izpack-test/src/test/java/com/izforge/izpack/integration/HelperTestMethod.java", "license": "apache-2.0", "size": 3005 }
[ "com.izforge.izpack.installer.language.LanguageDialog", "org.fest.swing.fixture.DialogFixture" ]
import com.izforge.izpack.installer.language.LanguageDialog; import org.fest.swing.fixture.DialogFixture;
import com.izforge.izpack.installer.language.*; import org.fest.swing.fixture.*;
[ "com.izforge.izpack", "org.fest.swing" ]
com.izforge.izpack; org.fest.swing;
1,575,320
@Override public void handleComponentEvent(ComponentEventRequestParameters parameters, ComponentRequestHandler handler) throws IOException { AuthCheckResult result = checkAuthorityToPage(parameters.getActivePageName()); if (result == AuthCheckResult.AUTHORISED) { handler.handleComponentEvent(parameters)...
void function(ComponentEventRequestParameters parameters, ComponentRequestHandler handler) throws IOException { AuthCheckResult result = checkAuthorityToPage(parameters.getActivePageName()); if (result == AuthCheckResult.AUTHORISED) { handler.handleComponentEvent(parameters); } else if (result == AuthCheckResult.DENY) ...
/** * Use when component activate * @param parameters * @param handler * @throws IOException */
Use when component activate
handleComponentEvent
{ "repo_name": "lromal/elib-project", "path": "src/main/java/com/example/tutorial/services/PageProtectionFilter.java", "license": "mit", "size": 10944 }
[ "com.example.tutorial.pages.PageDenied", "java.io.IOException", "java.io.OutputStream", "org.apache.tapestry5.Link", "org.apache.tapestry5.services.ComponentEventRequestParameters", "org.apache.tapestry5.services.ComponentRequestHandler" ]
import com.example.tutorial.pages.PageDenied; import java.io.IOException; import java.io.OutputStream; import org.apache.tapestry5.Link; import org.apache.tapestry5.services.ComponentEventRequestParameters; import org.apache.tapestry5.services.ComponentRequestHandler;
import com.example.tutorial.pages.*; import java.io.*; import org.apache.tapestry5.*; import org.apache.tapestry5.services.*;
[ "com.example.tutorial", "java.io", "org.apache.tapestry5" ]
com.example.tutorial; java.io; org.apache.tapestry5;
2,759,425
public static File namesDir() { lock.readLock().lock(); try { return (names_dir != null) ? names_dir : new File(dataDir(), DEFAULT_DIR_NAME_NAMES); } finally { lock.readLock().unlock(); } }
static File function() { lock.readLock().lock(); try { return (names_dir != null) ? names_dir : new File(dataDir(), DEFAULT_DIR_NAME_NAMES); } finally { lock.readLock().unlock(); } }
/** * Return the configured names directory, if set, otherwise return the * default path, relative to the configured data directory. * * @return {@link File} containing the path to the names directory. */
Return the configured names directory, if set, otherwise return the default path, relative to the configured data directory
namesDir
{ "repo_name": "chvink/kilomek", "path": "megamek/src/megamek/common/Configuration.java", "license": "gpl-3.0", "size": 16433 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,575,770
public static void runExample( AdManagerServices adManagerServices, AdManagerSession session, long cmsMetadataKeyId) throws RemoteException { // Get the CmsMetadataService. CmsMetadataServiceInterface cmsMetadataService = adManagerServices.get(session, CmsMetadataServiceInterface.class); ...
static void function( AdManagerServices adManagerServices, AdManagerSession session, long cmsMetadataKeyId) throws RemoteException { CmsMetadataServiceInterface cmsMetadataService = adManagerServices.get(session, CmsMetadataServiceInterface.class); StatementBuilder statementBuilder = new StatementBuilder() .where(STR) ...
/** * Runs the example. * * @param adManagerServices the services factory. * @param session the session. * @param cmsMetadataKeyId the ID of the CMS Metadata Key to activate values for. * @throws ApiException if the API request failed with one or more service errors. * @throws RemoteException if th...
Runs the example
runExample
{ "repo_name": "googleads/googleads-java-lib", "path": "examples/admanager_axis/src/main/java/admanager/axis/v202202/cmsmetadataservice/ActivateCmsMetadataValues.java", "license": "apache-2.0", "size": 7975 }
[ "com.google.api.ads.admanager.axis.factory.AdManagerServices", "com.google.api.ads.admanager.axis.utils.v202202.StatementBuilder", "com.google.api.ads.admanager.axis.v202202.CmsMetadataKeyStatus", "com.google.api.ads.admanager.axis.v202202.CmsMetadataServiceInterface", "com.google.api.ads.admanager.axis.v20...
import com.google.api.ads.admanager.axis.factory.AdManagerServices; import com.google.api.ads.admanager.axis.utils.v202202.StatementBuilder; import com.google.api.ads.admanager.axis.v202202.CmsMetadataKeyStatus; import com.google.api.ads.admanager.axis.v202202.CmsMetadataServiceInterface; import com.google.api.ads.adma...
import com.google.api.ads.admanager.axis.factory.*; import com.google.api.ads.admanager.axis.utils.v202202.*; import com.google.api.ads.admanager.axis.v202202.*; import com.google.api.ads.admanager.lib.client.*; import java.rmi.*;
[ "com.google.api", "java.rmi" ]
com.google.api; java.rmi;
461,800
private static Map<Object, Object> request(final String transactionId, final String request) { Map<Object, Object> map = new HashMap<Object, Object>(); map.put("t", transactionId); map.put("y", "q"); map.put("q", request); return map; }
static Map<Object, Object> function(final String transactionId, final String request) { Map<Object, Object> map = new HashMap<Object, Object>(); map.put("t", transactionId); map.put("y", "q"); map.put("q", request); return map; }
/** * Create Request Map. * @param transactionId TransactinId * @param request request type * @return Map<Object, Object> */
Create Request Map
request
{ "repo_name": "mfriesen/cthulhu-dht", "path": "src/main/java/ca/gobits/dht/server/DHTQueryProtocol.java", "license": "apache-2.0", "size": 3499 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,117,947
public final void setBucketizer(String bucketizer) { this.bucketizer = ReflectionHelper.getGetter(bucketizer); }
final void function(String bucketizer) { this.bucketizer = ReflectionHelper.getGetter(bucketizer); }
/** * Sets the bucketizer member. * This method is used to determine what data to bucket off of * This method must exist on the object being passed in. * Cannot be used with "bucket" * * @param bucketizer the bucketizer */
Sets the bucketizer member. This method is used to determine what data to bucket off of This method must exist on the object being passed in. Cannot be used with "bucket"
setBucketizer
{ "repo_name": "aol/Webservice_Base", "path": "src/main/java/com/aol/webservice_base/persistence/AbstractBaseQuery.java", "license": "bsd-3-clause", "size": 4472 }
[ "com.aol.webservice_base.util.reflection.ReflectionHelper" ]
import com.aol.webservice_base.util.reflection.ReflectionHelper;
import com.aol.webservice_base.util.reflection.*;
[ "com.aol.webservice_base" ]
com.aol.webservice_base;
2,551,479
@Override public DistributedLockService getGatewaySenderLockService() { if (this.gatewayLockService == null) { synchronized (this.gatewayLockServiceLock) { this.stopper.checkCancelInProgress(null); if (this.gatewayLockService == null) { try { this.gatewayLockService =...
DistributedLockService function() { if (this.gatewayLockService == null) { synchronized (this.gatewayLockServiceLock) { this.stopper.checkCancelInProgress(null); if (this.gatewayLockService == null) { try { this.gatewayLockService = DLockService.create(AbstractGatewaySender.LOCK_SERVICE_NAME, getInternalDistributedSyst...
/** * Gets or lazily creates the GatewaySender distributed lock service. * * @return the GatewaySender distributed lock service */
Gets or lazily creates the GatewaySender distributed lock service
getGatewaySenderLockService
{ "repo_name": "charliemblack/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java", "license": "apache-2.0", "size": 186222 }
[ "org.apache.geode.distributed.DistributedLockService", "org.apache.geode.distributed.internal.locks.DLockService", "org.apache.geode.internal.cache.wan.AbstractGatewaySender" ]
import org.apache.geode.distributed.DistributedLockService; import org.apache.geode.distributed.internal.locks.DLockService; import org.apache.geode.internal.cache.wan.AbstractGatewaySender;
import org.apache.geode.distributed.*; import org.apache.geode.distributed.internal.locks.*; import org.apache.geode.internal.cache.wan.*;
[ "org.apache.geode" ]
org.apache.geode;
1,073,260
@Nullable public static String getSavedHeader(@NonNull final File baseFile, final String name) { try { final File file = filenameForHeader(baseFile, name); final Reader reader = new InputStreamReader(new FileInputStream(file), CharEncoding.UTF_8); try { ...
static String function(@NonNull final File baseFile, final String name) { try { final File file = filenameForHeader(baseFile, name); final Reader reader = new InputStreamReader(new FileInputStream(file), CharEncoding.UTF_8); try { final char[] value = new char[256]; final int count = reader.read(value); return new Stri...
/** * Get the saved header value for this file. * * @param baseFile * the name of the cached resource * @param name * the name of the header ("etag" or "last-modified") * @return the cached value, or <tt>null</tt> if none has been cached */
Get the saved header value for this file
getSavedHeader
{ "repo_name": "SammysHP/cgeo", "path": "main/src/cgeo/geocaching/storage/LocalStorage.java", "license": "apache-2.0", "size": 17142 }
[ "java.io.File", "java.io.FileInputStream", "java.io.FileNotFoundException", "java.io.InputStreamReader", "java.io.Reader", "org.apache.commons.lang3.CharEncoding", "org.eclipse.jdt.annotation.NonNull" ]
import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.io.Reader; import org.apache.commons.lang3.CharEncoding; import org.eclipse.jdt.annotation.NonNull;
import java.io.*; import org.apache.commons.lang3.*; import org.eclipse.jdt.annotation.*;
[ "java.io", "org.apache.commons", "org.eclipse.jdt" ]
java.io; org.apache.commons; org.eclipse.jdt;
2,599,458
List<String> files = Lists.newArrayList(); RevWalk rw = new RevWalk(repository); try { if (commit.getParentCount() == 0) { TreeWalk tw = new TreeWalk(repository); tw.reset(); tw.setRecursive(true); tw.addTree(commit.getTree());...
List<String> files = Lists.newArrayList(); RevWalk rw = new RevWalk(repository); try { if (commit.getParentCount() == 0) { TreeWalk tw = new TreeWalk(repository); tw.reset(); tw.setRecursive(true); tw.addTree(commit.getTree()); while (tw.next()) { files.add(tw.getPathString()); } tw.close(); } else { RevCommit parent =...
/** * Returns the list of files changed in a specified commit. * Adapted from gitblit: * https://github.com/gitblit/gitblit/blob/master/src/main/java/com/gitblit/utils/JGitUtils.java#L718 * * @param repository * @param commit * @return list of files changed in a commit */
Returns the list of files changed in a specified commit. Adapted from gitblit: HREF
getFilesInCommit
{ "repo_name": "bocon13/moduleowner", "path": "src/main/java/com/googlesource/gerrit/plugins/moduleowner/ModuleOwnerUtils.java", "license": "apache-2.0", "size": 4997 }
[ "com.google.common.collect.Lists", "java.util.List", "org.eclipse.jgit.api.Git", "org.eclipse.jgit.diff.DiffEntry", "org.eclipse.jgit.lib.ObjectReader", "org.eclipse.jgit.revwalk.RevCommit", "org.eclipse.jgit.revwalk.RevWalk", "org.eclipse.jgit.treewalk.CanonicalTreeParser", "org.eclipse.jgit.treewa...
import com.google.common.collect.Lists; import java.util.List; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.diff.DiffEntry; import org.eclipse.jgit.lib.ObjectReader; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevWalk; import org.eclipse.jgit.treewalk.CanonicalTreeParser; impo...
import com.google.common.collect.*; import java.util.*; import org.eclipse.jgit.api.*; import org.eclipse.jgit.diff.*; import org.eclipse.jgit.lib.*; import org.eclipse.jgit.revwalk.*; import org.eclipse.jgit.treewalk.*;
[ "com.google.common", "java.util", "org.eclipse.jgit" ]
com.google.common; java.util; org.eclipse.jgit;
2,558,318
public static String getLocaleDisplayNameInLocale(final String localeString) { final Locale displayLocale = getDisplayLocale(localeString); return getLocaleDisplayNameInternal(localeString, displayLocale); }
static String function(final String localeString) { final Locale displayLocale = getDisplayLocale(localeString); return getLocaleDisplayNameInternal(localeString, displayLocale); }
/** * Get the full display name of the locale in its locale. * For example, en_US: "English (US)", fr_CA: "Français (Canada)" * @param localeString the locale to display. * @return the full display name of the locale. */
Get the full display name of the locale in its locale
getLocaleDisplayNameInLocale
{ "repo_name": "rkkr/simple-keyboard", "path": "app/src/main/java/rkr/simplekeyboard/inputmethod/latin/utils/LocaleResourceUtils.java", "license": "apache-2.0", "size": 7501 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
1,209,716
public static ExcelWriterSheetBuilder writerSheet(Integer sheetNo) { return writerSheet(sheetNo, null); }
static ExcelWriterSheetBuilder function(Integer sheetNo) { return writerSheet(sheetNo, null); }
/** * Build excel the <code>writerSheet</code> * * @param sheetNo * Index of sheet,0 base. * @return Excel sheet writer builder. */
Build excel the <code>writerSheet</code>
writerSheet
{ "repo_name": "alibaba/easyexcel", "path": "src/main/java/com/alibaba/excel/EasyExcelFactory.java", "license": "apache-2.0", "size": 11124 }
[ "com.alibaba.excel.write.builder.ExcelWriterSheetBuilder" ]
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
import com.alibaba.excel.write.builder.*;
[ "com.alibaba.excel" ]
com.alibaba.excel;
1,326,126
public Item getItemDropped(IBlockState state, Random rand, int fortune) { return this == Blocks.coal_ore ? Items.coal : (this == Blocks.diamond_ore ? Items.diamond : (this == Blocks.lapis_ore ? Items.dye : (this == Blocks.emerald_ore ? Items.emerald : (this == Blocks.quartz_ore ? Items.quartz : Item.get...
Item function(IBlockState state, Random rand, int fortune) { return this == Blocks.coal_ore ? Items.coal : (this == Blocks.diamond_ore ? Items.diamond : (this == Blocks.lapis_ore ? Items.dye : (this == Blocks.emerald_ore ? Items.emerald : (this == Blocks.quartz_ore ? Items.quartz : Item.getItemFromBlock(this))))); }
/** * Get the Item that this Block should drop when harvested. */
Get the Item that this Block should drop when harvested
getItemDropped
{ "repo_name": "dogjaw2233/tiu-s-mod", "path": "build/tmp/recompileMc/sources/net/minecraft/block/BlockOre.java", "license": "lgpl-2.1", "size": 3902 }
[ "java.util.Random", "net.minecraft.block.state.IBlockState", "net.minecraft.init.Blocks", "net.minecraft.init.Items", "net.minecraft.item.Item" ]
import java.util.Random; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item;
import java.util.*; import net.minecraft.block.state.*; import net.minecraft.init.*; import net.minecraft.item.*;
[ "java.util", "net.minecraft.block", "net.minecraft.init", "net.minecraft.item" ]
java.util; net.minecraft.block; net.minecraft.init; net.minecraft.item;
1,781,785
@Test public void testSimplePurge() { LoggingRegistry loggingRegistry = LoggingRegistry.getInstance(); loggingRegistry.setMaxSize( 10 ); loggingRegistry.reset(); // Test that registry is not purged when below the map. populateLoggingRegistry( 1, loggingRegistry, true, false ); loggingRegist...
void function() { LoggingRegistry loggingRegistry = LoggingRegistry.getInstance(); loggingRegistry.setMaxSize( 10 ); loggingRegistry.reset(); populateLoggingRegistry( 1, loggingRegistry, true, false ); loggingRegistry.invokePurge(); assertEquals( 0, loggingRegistry.getPurgedObjectCount() ); loggingRegistry.reset(); pop...
/** * Tests Purge logic in the happy path, no fileWritersBuffer in play. */
Tests Purge logic in the happy path, no fileWritersBuffer in play
testSimplePurge
{ "repo_name": "ddiroma/pentaho-kettle", "path": "core/src/test/java/org/pentaho/di/core/logging/LoggingRegistryTest.java", "license": "apache-2.0", "size": 16886 }
[ "org.hamcrest.Matchers", "org.junit.Assert" ]
import org.hamcrest.Matchers; import org.junit.Assert;
import org.hamcrest.*; import org.junit.*;
[ "org.hamcrest", "org.junit" ]
org.hamcrest; org.junit;
1,120,615
public synchronized void removeTabTitleListener(@NotNull TabTitleChangeListener listener) { titleListeners.remove(listener); }
synchronized void function(@NotNull TabTitleChangeListener listener) { titleListeners.remove(listener); }
/** * Removes the specified listener * * @param listener the listener to remove */
Removes the specified listener
removeTabTitleListener
{ "repo_name": "dmtolpeko/sqlines", "path": "sqlines-studio-java/src/main/java/com/sqlines/studio/model/tabsdata/ObservableTabsData.java", "license": "apache-2.0", "size": 23316 }
[ "com.sqlines.studio.model.tabsdata.listener.TabTitleChangeListener", "org.jetbrains.annotations.NotNull" ]
import com.sqlines.studio.model.tabsdata.listener.TabTitleChangeListener; import org.jetbrains.annotations.NotNull;
import com.sqlines.studio.model.tabsdata.listener.*; import org.jetbrains.annotations.*;
[ "com.sqlines.studio", "org.jetbrains.annotations" ]
com.sqlines.studio; org.jetbrains.annotations;
1,446
@FormatMethod private void reportError( SourcePosition position, @FormatString String message, Object... arguments) { errorReporter.reportError(position, message, arguments); }
void function( SourcePosition position, @FormatString String message, Object... arguments) { errorReporter.reportError(position, message, arguments); }
/** * Reports an error at the specified location. * * @param position The position of the error. * @param message The message to report in String.format style. * @param arguments The arguments to fill in the message format. */
Reports an error at the specified location
reportError
{ "repo_name": "GoogleChromeLabs/chromeos_smart_card_connector", "path": "third_party/closure-compiler/src/src/com/google/javascript/jscomp/parsing/parser/Parser.java", "license": "apache-2.0", "size": 131537 }
[ "com.google.errorprone.annotations.FormatString", "com.google.javascript.jscomp.parsing.parser.util.SourcePosition" ]
import com.google.errorprone.annotations.FormatString; import com.google.javascript.jscomp.parsing.parser.util.SourcePosition;
import com.google.errorprone.annotations.*; import com.google.javascript.jscomp.parsing.parser.util.*;
[ "com.google.errorprone", "com.google.javascript" ]
com.google.errorprone; com.google.javascript;
2,246,350
protected EntityManagerFactory newEntityManagerFactory() { logger.trace("Creating EntityManagerFactory..."); Map<String, String> properties = new HashMap<>(); properties.put("javax.persistence.jdbc.url", config.dbConnectionUrl); properties.put("javax.persistence.jdbc.driver", config...
EntityManagerFactory function() { logger.trace(STR); Map<String, String> properties = new HashMap<>(); properties.put(STR, config.dbConnectionUrl); properties.put(STR, config.dbDriverClass); if (config.dbUserName != null) { properties.put(STR, config.dbUserName); } if (config.dbPassword != null) { properties.put(STR, c...
/** * Creates a new EntityManagerFactory with properties read from openhab.cfg via JpaConfiguration. * * @return initialized EntityManagerFactory */
Creates a new EntityManagerFactory with properties read from openhab.cfg via JpaConfiguration
newEntityManagerFactory
{ "repo_name": "openhab/openhab2", "path": "bundles/org.openhab.persistence.jpa/src/main/java/org/openhab/persistence/jpa/internal/JpaPersistenceService.java", "license": "epl-1.0", "size": 11018 }
[ "java.util.HashMap", "java.util.Map", "javax.persistence.EntityManagerFactory", "javax.persistence.Persistence" ]
import java.util.HashMap; import java.util.Map; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence;
import java.util.*; import javax.persistence.*;
[ "java.util", "javax.persistence" ]
java.util; javax.persistence;
1,712,632
public org.json.JSONObject toJSONObject() { final org.json.JSONObject o = new org.json.JSONObject(); try { o.put("x", getX()); o.put("y", getY()); o.put("z", getZ()); o.put("yaw", getYaw()); o.put("pitch", getPitch()); o.put("world", getWorld().getName()); } catch (final Exception e) { e.p...
org.json.JSONObject function() { final org.json.JSONObject o = new org.json.JSONObject(); try { o.put("x", getX()); o.put("y", getY()); o.put("z", getZ()); o.put("yaw", getYaw()); o.put("pitch", getPitch()); o.put("world", getWorld().getName()); } catch (final Exception e) { e.printStackTrace(); } return o; }
/** * Turn the location into a JSON Object <br> * Contains: x, y, z, yaw, pitch & world * * @return JSON Object */
Turn the location into a JSON Object Contains: x, y, z, yaw, pitch & world
toJSONObject
{ "repo_name": "MarineMC/MarineStandalone", "path": "src/main/java/org/marinemc/util/Location.java", "license": "gpl-2.0", "size": 10771 }
[ "org.json.simple.JSONObject" ]
import org.json.simple.JSONObject;
import org.json.simple.*;
[ "org.json.simple" ]
org.json.simple;
658,689
synchronized boolean isIdle() { long quietFor = System.currentTimeMillis() - lastActive; boolean idle = quietFor > MAX_AGE_MS; if (idle || (connection != null && !connection.isOpen())) { log.debug("IDLE (or closed) websocket [{} ms]", quietFor); return true; }...
synchronized boolean isIdle() { long quietFor = System.currentTimeMillis() - lastActive; boolean idle = quietFor > MAX_AGE_MS; if (idle (connection != null && !connection.isOpen())) { log.debug(STR, quietFor); return true; } else if (connection != null) { try { control.sendControl(PING, PING_DATA, 0, PING_DATA.length);...
/** * Indicates if this connection is idle. * * @return true if idle or closed */
Indicates if this connection is idle
isIdle
{ "repo_name": "planoAccess/clonedONOS", "path": "web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java", "license": "apache-2.0", "size": 8255 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
21,895
@Test public void testCustomFactoryInvalidPropertyName() { final PlatformJavaObjectFactoryProxy proxy = proxyForCustom(NO_DFLT_CTOR_FACTORY_CLS_NAME, Collections.singletonMap("invalid", (Object)1));
void function() { final PlatformJavaObjectFactoryProxy proxy = proxyForCustom(NO_DFLT_CTOR_FACTORY_CLS_NAME, Collections.singletonMap(STR, (Object)1));
/** * Test object creation with invalid property name. */
Test object creation with invalid property name
testCustomFactoryInvalidPropertyName
{ "repo_name": "ilantukh/ignite", "path": "modules/core/src/test/java/org/apache/ignite/platform/PlatformJavaObjectFactoryProxySelfTest.java", "license": "apache-2.0", "size": 8053 }
[ "java.util.Collections", "org.apache.ignite.internal.processors.platform.PlatformJavaObjectFactoryProxy" ]
import java.util.Collections; import org.apache.ignite.internal.processors.platform.PlatformJavaObjectFactoryProxy;
import java.util.*; import org.apache.ignite.internal.processors.platform.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
2,255,923
@Message(id = 89, value = "Failed to process jboss-ejb-client.xml") DeploymentUnitProcessingException failedToProcessEJBClientDescriptor(@Cause Throwable cause);
@Message(id = 89, value = STR) DeploymentUnitProcessingException failedToProcessEJBClientDescriptor(@Cause Throwable cause);
/** * Creates an exception indicating that the jboss-ejb-client.xml couldn't be processed * * @return a {@link DeploymentUnitProcessingException} for the error. */
Creates an exception indicating that the jboss-ejb-client.xml couldn't be processed
failedToProcessEJBClientDescriptor
{ "repo_name": "tomazzupan/wildfly", "path": "ee/src/main/java/org/jboss/as/ee/logging/EeLogger.java", "license": "lgpl-2.1", "size": 48634 }
[ "org.jboss.as.server.deployment.DeploymentUnitProcessingException", "org.jboss.logging.annotations.Cause", "org.jboss.logging.annotations.Message" ]
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; import org.jboss.logging.annotations.Cause; import org.jboss.logging.annotations.Message;
import org.jboss.as.server.deployment.*; import org.jboss.logging.annotations.*;
[ "org.jboss.as", "org.jboss.logging" ]
org.jboss.as; org.jboss.logging;
638,312
public ArrayList getSubstitutionFonts() { return substitutionFonts; }
ArrayList function() { return substitutionFonts; }
/** * Gets the list of substitution fonts. The list is composed of * <CODE>BaseFont</CODE> and can be <CODE>null</CODE>. The fonts in this * list will be used if the original font doesn't contain the needed glyphs. * * @return the list */
Gets the list of substitution fonts. The list is composed of <code>BaseFont</code> and can be <code>null</code>. The fonts in this list will be used if the original font doesn't contain the needed glyphs
getSubstitutionFonts
{ "repo_name": "bullda/DroidText", "path": "src/core/com/lowagie/text/pdf/AcroFields.java", "license": "lgpl-3.0", "size": 84860 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
338,695
public static MethodHandle createDynamicInvoker(final String name, final int flags, final MethodType type) { return bootstrap(MethodHandles.publicLookup(), name, type, flags).dynamicInvoker(); }
static MethodHandle function(final String name, final int flags, final MethodType type) { return bootstrap(MethodHandles.publicLookup(), name, type, flags).dynamicInvoker(); }
/** * Returns a dynamic invoker for a specified dynamic operation using the * public lookup. Similar to * {@link #createDynamicInvoker(String, int, Class, Class...)} but with * already precomposed method type. * @param name name at the call site. * @param flags flags at the call site ...
Returns a dynamic invoker for a specified dynamic operation using the public lookup. Similar to <code>#createDynamicInvoker(String, int, Class, Class...)</code> but with already precomposed method type
createDynamicInvoker
{ "repo_name": "FauxFaux/jdk9-nashorn", "path": "src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/Bootstrap.java", "license": "gpl-2.0", "size": 24540 }
[ "java.lang.invoke.MethodHandle", "java.lang.invoke.MethodHandles", "java.lang.invoke.MethodType" ]
import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType;
import java.lang.invoke.*;
[ "java.lang" ]
java.lang;
511,456
@LogMessage(level = ERROR) @Message(id = 7, value = "Failed to close resource %s") void failedToCloseResource(@Cause Throwable cause, Closeable closeable);
@LogMessage(level = ERROR) @Message(id = 7, value = STR) void failedToCloseResource(@Cause Throwable cause, Closeable closeable);
/** * Logs an error message indicating to failure to close the resource represented by the {@code closeable} parameter. * * @param cause the cause of the error. * @param closeable the resource. */
Logs an error message indicating to failure to close the resource represented by the closeable parameter
failedToCloseResource
{ "repo_name": "aloubyansky/wildfly-core", "path": "controller/src/main/java/org/jboss/as/controller/logging/ControllerLogger.java", "license": "lgpl-2.1", "size": 164970 }
[ "java.io.Closeable", "org.jboss.logging.annotations.Cause", "org.jboss.logging.annotations.LogMessage", "org.jboss.logging.annotations.Message" ]
import java.io.Closeable; import org.jboss.logging.annotations.Cause; import org.jboss.logging.annotations.LogMessage; import org.jboss.logging.annotations.Message;
import java.io.*; import org.jboss.logging.annotations.*;
[ "java.io", "org.jboss.logging" ]
java.io; org.jboss.logging;
79,026
@SuppressWarnings("unchecked") public static <K, V> Cache2kBuilder<K, V> enforceWiredCache(Cache2kBuilder<K, V> b) { return b.addListener(new CacheEntryRemovedListener<K, V>() { @Override public void onEntryRemoved(Cache<K, V> cache, CacheEntry<K, V> entry) { }
@SuppressWarnings(STR) static <K, V> Cache2kBuilder<K, V> function(Cache2kBuilder<K, V> b) { return b.addListener(new CacheEntryRemovedListener<K, V>() { public void onEntryRemoved(Cache<K, V> cache, CacheEntry<K, V> entry) { }
/** * Enforce the usage of wired cache by registering a dummy listener. */
Enforce the usage of wired cache by registering a dummy listener
enforceWiredCache
{ "repo_name": "headissue/cache2k", "path": "cache2k-core/src/test/java/org/cache2k/test/core/StaticUtil.java", "license": "gpl-3.0", "size": 1868 }
[ "org.cache2k.Cache", "org.cache2k.Cache2kBuilder", "org.cache2k.CacheEntry", "org.cache2k.event.CacheEntryRemovedListener" ]
import org.cache2k.Cache; import org.cache2k.Cache2kBuilder; import org.cache2k.CacheEntry; import org.cache2k.event.CacheEntryRemovedListener;
import org.cache2k.*; import org.cache2k.event.*;
[ "org.cache2k", "org.cache2k.event" ]
org.cache2k; org.cache2k.event;
1,887,704
public boolean sendUncommitted() throws SQLException { return sendUncommitted(mutations.keySet().iterator()); }
boolean function() throws SQLException { return sendUncommitted(mutations.keySet().iterator()); }
/** * Send to HBase any uncommitted data for transactional tables. * @return true if any data was sent and false otherwise. * @throws SQLException */
Send to HBase any uncommitted data for transactional tables
sendUncommitted
{ "repo_name": "RCheungIT/phoenix", "path": "phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java", "license": "apache-2.0", "size": 69769 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,094,776
void updateDrawerState(int forGravity, int activeState, View activeDrawer) { final int leftState = mLeftDragger.getViewDragState(); final int rightState = mRightDragger.getViewDragState(); final int state; if (leftState == STATE_DRAGGING || rightState == STATE_DRAGGING) { ...
void updateDrawerState(int forGravity, int activeState, View activeDrawer) { final int leftState = mLeftDragger.getViewDragState(); final int rightState = mRightDragger.getViewDragState(); final int state; if (leftState == STATE_DRAGGING rightState == STATE_DRAGGING) { state = STATE_DRAGGING; } else if (leftState == ST...
/** * Resolve the shared state of all drawers from the component ViewDragHelpers. * Should be called whenever a ViewDragHelper's state changes. */
Resolve the shared state of all drawers from the component ViewDragHelpers. Should be called whenever a ViewDragHelper's state changes
updateDrawerState
{ "repo_name": "groupsky/generator-android", "path": "templates/common/libs-src/android-support-v4/android/support/v4/widget/DrawerLayout.java", "license": "mit", "size": 61718 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
363,642
public static ApplicationContextRunner applicationContextRunner(Class<?>... additionalConfigurationClasses) { return new ApplicationContextRunner() .withUserConfiguration(getCompleteConfiguration(additionalConfigurationClasses)); }
static ApplicationContextRunner function(Class<?>... additionalConfigurationClasses) { return new ApplicationContextRunner() .withUserConfiguration(getCompleteConfiguration(additionalConfigurationClasses)); }
/** * Create an {@link ApplicationContextRunner} with user configuration using {@link #getCompleteConfiguration}. * @param additionalConfigurationClasses config classes to be added to the default * config * @return the ApplicationContextRunner */
Create an <code>ApplicationContextRunner</code> with user configuration using <code>#getCompleteConfiguration</code>
applicationContextRunner
{ "repo_name": "ilayaperumalg/spring-cloud-stream", "path": "spring-cloud-stream/src/test/java/org/springframework/cloud/stream/binder/test/TestChannelBinderConfiguration.java", "license": "apache-2.0", "size": 4455 }
[ "org.springframework.boot.test.context.runner.ApplicationContextRunner" ]
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.test.context.runner.*;
[ "org.springframework.boot" ]
org.springframework.boot;
1,021,248
public Set<Label> possibleLabels(TypeMirror thrown) { // Work up from the innermost frame until the exception is known to // be caught. Set<Label> labels = new MostlySingleton<>(); for (TryFrame frame : frames) { if (frame.possibleLabels(thrown, la...
Set<Label> function(TypeMirror thrown) { Set<Label> labels = new MostlySingleton<>(); for (TryFrame frame : frames) { if (frame.possibleLabels(thrown, labels)) { return labels; } } labels.add(exitLabel); return labels; } } public static class CFGTranslationPhaseThree {
/** * Returns the set of possible {@link Label}s where control may transfer when an exception * of the given type is thrown. */
Returns the set of possible <code>Label</code>s where control may transfer when an exception of the given type is thrown
possibleLabels
{ "repo_name": "damienmg/bazel", "path": "third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/CFGBuilder.java", "license": "apache-2.0", "size": 193266 }
[ "java.util.Set", "javax.lang.model.type.TypeMirror", "org.checkerframework.dataflow.util.MostlySingleton" ]
import java.util.Set; import javax.lang.model.type.TypeMirror; import org.checkerframework.dataflow.util.MostlySingleton;
import java.util.*; import javax.lang.model.type.*; import org.checkerframework.dataflow.util.*;
[ "java.util", "javax.lang", "org.checkerframework.dataflow" ]
java.util; javax.lang; org.checkerframework.dataflow;
957,348
private static boolean isExecutable(Target target) { return isOutputFile(target) || isExecutableNonTestRule(target) || TargetUtils.isTestRule(target); }
static boolean function(Target target) { return isOutputFile(target) isExecutableNonTestRule(target) TargetUtils.isTestRule(target); }
/** * Return true iff {@code target} is a rule that has an executable file. This includes * *_test rules, *_binary rules, and generated outputs. */
Return true iff target is a rule that has an executable file. This includes _test rules, *_binary rules, and generated outputs
isExecutable
{ "repo_name": "wakashige/bazel", "path": "src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java", "license": "apache-2.0", "size": 22234 }
[ "com.google.devtools.build.lib.packages.Target", "com.google.devtools.build.lib.packages.TargetUtils" ]
import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.packages.TargetUtils;
import com.google.devtools.build.lib.packages.*;
[ "com.google.devtools" ]
com.google.devtools;
1,132,070