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
String query = context.next(); Optional<Profile> optional = profileService.getByName(query); if (!optional.isPresent()) { throw new NoSuchProfileException(query); } return optional.get(); } public static class NoSuchProfileException extends Exception { private static final long seria...
String query = context.next(); Optional<Profile> optional = profileService.getByName(query); if (!optional.isPresent()) { throw new NoSuchProfileException(query); } return optional.get(); } public static class NoSuchProfileException extends Exception { private static final long serialVersionUID = 5770626202494099277L; ...
/** * Gets a Profile matching the name given by the command. * * @param context the command's context * @return a matching Profile * @throws NoSuchProfileException if no matching Profile was found * @throws ParameterException on a parameter error */
Gets a Profile matching the name given by the command
getProfile
{ "repo_name": "epicbastion/MyWarp", "path": "mywarp-bukkit/src/main/java/me/taylorkelly/mywarp/bukkit/util/parametric/binding/ProfileBinding.java", "license": "gpl-3.0", "size": 2932 }
[ "com.google.common.base.Optional", "me.taylorkelly.mywarp.util.profile.Profile" ]
import com.google.common.base.Optional; import me.taylorkelly.mywarp.util.profile.Profile;
import com.google.common.base.*; import me.taylorkelly.mywarp.util.profile.*;
[ "com.google.common", "me.taylorkelly.mywarp" ]
com.google.common; me.taylorkelly.mywarp;
1,792,014
private void buildDeleteMethod(InvocableMemberBodyBuilder builder) { // HttpHeaders headers = new HttpHeaders(); builder.appendFormalLine(String.format( "%s headers = new HttpHeaders();", helper.getFinalTypeName(SpringJavaType.HTTP_HEADERS))); // headers.add(...
void function(InvocableMemberBodyBuilder builder) { builder.appendFormalLine(String.format( STR, helper.getFinalTypeName(SpringJavaType.HTTP_HEADERS))); builder.appendFormalLine(STRContent-Type\STRapplication/json\");"); builder.appendFormalLine(STR); builder.appendFormalLine(TRY); builder.indent(); builder.appendForma...
/** * Builds delete method body * * @param builder */
Builds delete method body
buildDeleteMethod
{ "repo_name": "osroca/gvnix", "path": "addon-web-mvc/addon/src/main/java/org/gvnix/addon/web/mvc/addon/batch/WebJpaBatchMetadata.java", "license": "gpl-3.0", "size": 58704 }
[ "org.springframework.roo.classpath.itd.InvocableMemberBodyBuilder", "org.springframework.roo.model.SpringJavaType" ]
import org.springframework.roo.classpath.itd.InvocableMemberBodyBuilder; import org.springframework.roo.model.SpringJavaType;
import org.springframework.roo.classpath.itd.*; import org.springframework.roo.model.*;
[ "org.springframework.roo" ]
org.springframework.roo;
1,909,108
@Test public void testHashcode() throws Exception { result1 = opaqueHeader.hashCode(); assertThat(result1, is(Matchers.notNullValue())); }
void function() throws Exception { result1 = opaqueHeader.hashCode(); assertThat(result1, is(Matchers.notNullValue())); }
/** * Tests hashCode() method. */
Tests hashCode() method
testHashcode
{ "repo_name": "Shashikanth-Huawei/bmp", "path": "protocols/ospf/protocol/src/test/java/org/onosproject/ospf/protocol/lsa/OpaqueLsaHeaderTest.java", "license": "apache-2.0", "size": 3768 }
[ "org.hamcrest.CoreMatchers", "org.hamcrest.Matchers", "org.junit.Assert" ]
import org.hamcrest.CoreMatchers; import org.hamcrest.Matchers; import org.junit.Assert;
import org.hamcrest.*; import org.junit.*;
[ "org.hamcrest", "org.junit" ]
org.hamcrest; org.junit;
1,566,442
public static String buildUrlWithQueryParams(@NonNull Logger logger, @NonNull String baseUrl, @NonNull Map<String, String> queryParams) { final Uri.Builder uriBuilder = Uri.parse(baseUrl).buildUpon(); for (Map.Entry<String, String> entry : queryParams...
static String function(@NonNull Logger logger, @NonNull String baseUrl, @NonNull Map<String, String> queryParams) { final Uri.Builder uriBuilder = Uri.parse(baseUrl).buildUpon(); for (Map.Entry<String, String> entry : queryParams.entrySet()) { uriBuilder.appendQueryParameter(entry.getKey(), entry.getValue()); } final S...
/** * Builds a valid URL with the given query params. * * @param logger For logging purpose. * @param baseUrl The base URL. * @param queryParams The query params to add in the URL. * @return URL String with query params added to it. */
Builds a valid URL with the given query params
buildUrlWithQueryParams
{ "repo_name": "edx/edx-app-android", "path": "OpenEdXMobile/src/main/java/org/edx/mobile/util/UrlUtil.java", "license": "apache-2.0", "size": 4135 }
[ "android.net.Uri", "androidx.annotation.NonNull", "java.util.Map", "org.edx.mobile.logger.Logger" ]
import android.net.Uri; import androidx.annotation.NonNull; import java.util.Map; import org.edx.mobile.logger.Logger;
import android.net.*; import androidx.annotation.*; import java.util.*; import org.edx.mobile.logger.*;
[ "android.net", "androidx.annotation", "java.util", "org.edx.mobile" ]
android.net; androidx.annotation; java.util; org.edx.mobile;
1,950,513
@org.junit.Test public void action() throws Exception { RMTHelper helper = RMTHelper.getDefaultInstance(); ResourceManager resourceManager = helper.getResourceManager(); final int initialNodesNumber = helper.createNodeSource("SelectionWithNodesExclusionTest"); RMTHelper.log("Tes...
@org.junit.Test void function() throws Exception { RMTHelper helper = RMTHelper.getDefaultInstance(); ResourceManager resourceManager = helper.getResourceManager(); final int initialNodesNumber = helper.createNodeSource(STR); RMTHelper.log(STR); NodeSet nodeSetWithNodeToExclude = resourceManager.getAtMostNodes(1, null)...
/** Actions to be Perform by this test. * The method is called automatically by Junit framework. * @throws Exception If the test fails. */
Actions to be Perform by this test. The method is called automatically by Junit framework
action
{ "repo_name": "acontes/scheduling", "path": "src/resource-manager/tests/functionaltests/selectionscript/SelectionWithNodesExclusionTest.java", "license": "agpl-3.0", "size": 13321 }
[ "java.io.File", "java.util.ArrayList", "java.util.HashMap", "junit.framework.Assert", "org.junit.Assert", "org.objectweb.proactive.api.PAFuture", "org.objectweb.proactive.core.node.Node", "org.objectweb.proactive.core.node.NodeFactory", "org.ow2.proactive.resourcemanager.common.NodeState", "org.ow...
import java.io.File; import java.util.ArrayList; import java.util.HashMap; import junit.framework.Assert; import org.junit.Assert; import org.objectweb.proactive.api.PAFuture; import org.objectweb.proactive.core.node.Node; import org.objectweb.proactive.core.node.NodeFactory; import org.ow2.proactive.resourcemanager.co...
import java.io.*; import java.util.*; import junit.framework.*; import org.junit.*; import org.objectweb.proactive.api.*; import org.objectweb.proactive.core.node.*; import org.ow2.proactive.resourcemanager.common.*; import org.ow2.proactive.resourcemanager.common.event.*; import org.ow2.proactive.resourcemanager.front...
[ "java.io", "java.util", "junit.framework", "org.junit", "org.objectweb.proactive", "org.ow2.proactive" ]
java.io; java.util; junit.framework; org.junit; org.objectweb.proactive; org.ow2.proactive;
1,451,764
private static boolean isDeferredAuthView(Table t){ String tableType = t.getTTable().getTableType(); String authorizedKeyword = "Authorized"; boolean isView = false; if (TableType.MATERIALIZED_VIEW.name().equals(tableType) || TableType.VIRTUAL_VIEW.name().equals(tableType)) { isView = true; ...
static boolean function(Table t){ String tableType = t.getTTable().getTableType(); String authorizedKeyword = STR; boolean isView = false; if (TableType.MATERIALIZED_VIEW.name().equals(tableType) TableType.VIRTUAL_VIEW.name().equals(tableType)) { isView = true; } if(isView){ Map<String, String> params = t.getParameters...
/** * A deferred authorization view is view created by non-super user like spark-user. This view contains a parameter "Authorized" * set to false, so ranger will not authorize it during view creation. When a select statement is issued, then the ranger authorizes * the under lying tables. * @param Table t ...
A deferred authorization view is view created by non-super user like spark-user. This view contains a parameter "Authorized" set to false, so ranger will not authorize it during view creation. When a select statement is issued, then the ranger authorizes the under lying tables
isDeferredAuthView
{ "repo_name": "lirui-apache/hive", "path": "ql/src/java/org/apache/hadoop/hive/ql/security/authorization/command/CommandAuthorizerV2.java", "license": "apache-2.0", "size": 12575 }
[ "java.util.Map", "org.apache.hadoop.hive.metastore.TableType", "org.apache.hadoop.hive.ql.metadata.Table" ]
import java.util.Map; import org.apache.hadoop.hive.metastore.TableType; import org.apache.hadoop.hive.ql.metadata.Table;
import java.util.*; import org.apache.hadoop.hive.metastore.*; import org.apache.hadoop.hive.ql.metadata.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
1,906,427
@Resource("saffron.opt.allowInfiniteCostConverters") @Default("true") BooleanProp allowInfiniteCostConverters();
@Resource(STR) @Default("true") BooleanProp allowInfiniteCostConverters();
/** * The boolean property "saffron.opt.allowInfiniteCostConverters" determines * whether the optimizer will consider adding converters of infinite cost in * order to convert a relational expression from one calling convention to * another. The default value is <code>true</code>. */
The boolean property "saffron.opt.allowInfiniteCostConverters" determines whether the optimizer will consider adding converters of infinite cost in order to convert a relational expression from one calling convention to another. The default value is <code>true</code>
allowInfiniteCostConverters
{ "repo_name": "datametica/calcite", "path": "core/src/main/java/org/apache/calcite/util/SaffronProperties.java", "license": "apache-2.0", "size": 6164 }
[ "org.apache.calcite.runtime.Resources" ]
import org.apache.calcite.runtime.Resources;
import org.apache.calcite.runtime.*;
[ "org.apache.calcite" ]
org.apache.calcite;
24,832
public Constant getConstant(String constantName) { Constant constant = constants.get(constantName); if (constant == null) { throw DbException.get(ErrorCode.CONSTANT_NOT_FOUND_1, constantName); } return constant; }
Constant function(String constantName) { Constant constant = constants.get(constantName); if (constant == null) { throw DbException.get(ErrorCode.CONSTANT_NOT_FOUND_1, constantName); } return constant; }
/** * Get the user defined constant with the given name. * * @param constantName the constant name * @return the constant * @throws DbException if no such object exists */
Get the user defined constant with the given name
getConstant
{ "repo_name": "vdr007/ThriftyPaxos", "path": "src/applications/h2/src/main/org/h2/schema/Schema.java", "license": "apache-2.0", "size": 19877 }
[ "org.h2.api.ErrorCode", "org.h2.message.DbException" ]
import org.h2.api.ErrorCode; import org.h2.message.DbException;
import org.h2.api.*; import org.h2.message.*;
[ "org.h2.api", "org.h2.message" ]
org.h2.api; org.h2.message;
529,365
@FeatureDescriptor(name = FEATURE_BOOLEAN_VALUES) public default boolean supportsBooleanValues() { return true; }
@FeatureDescriptor(name = FEATURE_BOOLEAN_VALUES) default boolean function() { return true; }
/** * Supports setting of a boolean value. */
Supports setting of a boolean value
supportsBooleanValues
{ "repo_name": "jorgebay/tinkerpop", "path": "gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java", "license": "apache-2.0", "size": 57344 }
[ "org.apache.tinkerpop.gremlin.structure.util.FeatureDescriptor" ]
import org.apache.tinkerpop.gremlin.structure.util.FeatureDescriptor;
import org.apache.tinkerpop.gremlin.structure.util.*;
[ "org.apache.tinkerpop" ]
org.apache.tinkerpop;
737,088
public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof AbstractXYItemRenderer)) { return false; } AbstractXYItemRenderer that = (AbstractXYItemRenderer) obj; if (!ObjectUtilities.equal(this.itemLabelGenerator...
boolean function(Object obj) { if (obj == this) { return true; } if (!(obj instanceof AbstractXYItemRenderer)) { return false; } AbstractXYItemRenderer that = (AbstractXYItemRenderer) obj; if (!ObjectUtilities.equal(this.itemLabelGenerator, that.itemLabelGenerator)) { return false; } if (!this.itemLabelGeneratorList.eq...
/** * Tests this renderer for equality with another object. * * @param obj the object (<code>null</code> permitted). * * @return <code>true</code> or <code>false</code>. */
Tests this renderer for equality with another object
equals
{ "repo_name": "JSansalone/JFreeChart", "path": "source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java", "license": "lgpl-2.1", "size": 73289 }
[ "org.jfree.util.ObjectUtilities" ]
import org.jfree.util.ObjectUtilities;
import org.jfree.util.*;
[ "org.jfree.util" ]
org.jfree.util;
1,283,991
public BaseBlock getBlock(Vec3D pos) throws ArrayIndexOutOfBoundsException { return data[pos.X][pos.Y][pos.Z]; }
BaseBlock function(Vec3D pos) throws ArrayIndexOutOfBoundsException { return data[pos.X][pos.Y][pos.Z]; }
/** * Get one point in the copy. * * @param pos The point, relative to the origin of the copy (0, 0, 0) and not to the actual copy origin. * @return null, if this block was outside the (non-cuboid) selection while copying * @throws ArrayIndexOutOfBoundsException if the position is outside the ...
Get one point in the copy
getBlock
{ "repo_name": "trichner/libschem", "path": "src/main/java/ch/n1b/worldedit/schematic/schematic/Cuboid.java", "license": "gpl-3.0", "size": 7798 }
[ "ch.n1b.vector.Vec3D", "ch.n1b.worldedit.schematic.block.BaseBlock" ]
import ch.n1b.vector.Vec3D; import ch.n1b.worldedit.schematic.block.BaseBlock;
import ch.n1b.vector.*; import ch.n1b.worldedit.schematic.block.*;
[ "ch.n1b.vector", "ch.n1b.worldedit" ]
ch.n1b.vector; ch.n1b.worldedit;
1,216,088
public File getParentDirectory(File dir) { //System.out.println("dir : " + dir); if (dir == null) { return null; } else if (dir.equals(this.homedir)) { return this.homedir; } else { //System.out.println("getParentDirectory : calling getParen...
File function(File dir) { if (dir == null) { return null; } else if (dir.equals(this.homedir)) { return this.homedir; } else { return dir.getParentFile(); } }
/** * Returns the parent directory of <code>dir</code>. * @param dir the <code>File</code> being queried * @return the parent directory of <code>dir</code>, or * <code>null</code> if <code>dir</code> is <code>null</code> */
Returns the parent directory of <code>dir</code>
getParentDirectory
{ "repo_name": "markkimsal/pengyou-clients", "path": "webdavclient/clientlib/src/java/org/apache/webdav/ui/WebdavSystemView.java", "license": "apache-2.0", "size": 21303 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,233,558
public DataNode setFrequency(IDataset frequency);
DataNode function(IDataset frequency);
/** * Frequency of oscillating collimator * <p> * <b>Type:</b> NX_FLOAT * <b>Units:</b> NX_FREQUENCY * </p> * * @param frequency the frequency */
Frequency of oscillating collimator Type: NX_FLOAT Units: NX_FREQUENCY
setFrequency
{ "repo_name": "jamesmudd/dawnsci", "path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NXcollimator.java", "license": "epl-1.0", "size": 9995 }
[ "org.eclipse.dawnsci.analysis.api.tree.DataNode", "org.eclipse.january.dataset.IDataset" ]
import org.eclipse.dawnsci.analysis.api.tree.DataNode; import org.eclipse.january.dataset.IDataset;
import org.eclipse.dawnsci.analysis.api.tree.*; import org.eclipse.january.dataset.*;
[ "org.eclipse.dawnsci", "org.eclipse.january" ]
org.eclipse.dawnsci; org.eclipse.january;
1,000,085
protected void initialize( TestParameters tParam, PrintWriter log ) { SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() ); try { log.println( "creating a textdocument" ); xTextDoc = SOF.createTextDoc( null ); } catch ( com.sun.star....
void function( TestParameters tParam, PrintWriter log ) { SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory)tParam.getMSF() ); try { log.println( STR ); xTextDoc = SOF.createTextDoc( null ); } catch ( com.sun.star.uno.Exception e ) { e.printStackTrace( log ); throw new StatusException( STR, e ); } }
/** * Creates text document. */
Creates text document
initialize
{ "repo_name": "qt-haiku/LibreOffice", "path": "qadevOOo/tests/java/mod/_sw/SwXReferenceMark.java", "license": "gpl-3.0", "size": 4851 }
[ "com.sun.star.lang.XMultiServiceFactory", "java.io.PrintWriter" ]
import com.sun.star.lang.XMultiServiceFactory; import java.io.PrintWriter;
import com.sun.star.lang.*; import java.io.*;
[ "com.sun.star", "java.io" ]
com.sun.star; java.io;
816,296
private static void testStatementRemembersTimeout(Statement stmt) throws SQLException, TestFailedException { System.out.println("Testing that Statement remembers timeout."); stmt.setQueryTimeout(1); long runTime=0; for (int i = 0; i < 3; i++) { try { ...
static void function(Statement stmt) throws SQLException, TestFailedException { System.out.println(STR); stmt.setQueryTimeout(1); long runTime=0; for (int i = 0; i < 3; i++) { try { long startTime = System.currentTimeMillis(); ResultSet rs = stmt.executeQuery(getFetchQuery("t")); while (rs.next()); long endTime = Syste...
/** Test that a statement remembers its timeout value when executed * multiple times. */
Test that a statement remembers its timeout value when executed
testStatementRemembersTimeout
{ "repo_name": "viaper/DBPlus", "path": "DerbyHodgepodge/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SetQueryTimeoutTest.java", "license": "apache-2.0", "size": 28303 }
[ "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Statement" ]
import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;
import java.sql.*;
[ "java.sql" ]
java.sql;
454,830
public void addOldMessage(String senderJID, String nickname, Date sentDate, String subject, String body, String stanza) { Message message = new Message(); message.setType(Message.Type.groupchat); if (stanza != null) { // payload initialized as XML string from DB ...
void function(String senderJID, String nickname, Date sentDate, String subject, String body, String stanza) { Message message = new Message(); message.setType(Message.Type.groupchat); if (stanza != null) { SAXReader xmlReader = new SAXReader(); xmlReader.setEncoding("UTF-8"); try { Element element = xmlReader.read(new ...
/** * Creates a new message and adds it to the history. The new message will be created based on * the provided information. This information will likely come from the database when loading * the room history from the database. * * @param senderJID the sender's JID of the message to add to the ...
Creates a new message and adds it to the history. The new message will be created based on the provided information. This information will likely come from the database when loading the room history from the database
addOldMessage
{ "repo_name": "Gugli/Openfire", "path": "src/java/org/jivesoftware/openfire/muc/MUCRoomHistory.java", "license": "apache-2.0", "size": 9888 }
[ "java.io.StringReader", "java.util.Date", "java.util.List", "org.dom4j.Attribute", "org.dom4j.Element", "org.dom4j.Namespace", "org.dom4j.io.SAXReader", "org.jivesoftware.util.XMPPDateTimeFormat", "org.xmpp.packet.Message" ]
import java.io.StringReader; import java.util.Date; import java.util.List; import org.dom4j.Attribute; import org.dom4j.Element; import org.dom4j.Namespace; import org.dom4j.io.SAXReader; import org.jivesoftware.util.XMPPDateTimeFormat; import org.xmpp.packet.Message;
import java.io.*; import java.util.*; import org.dom4j.*; import org.dom4j.io.*; import org.jivesoftware.util.*; import org.xmpp.packet.*;
[ "java.io", "java.util", "org.dom4j", "org.dom4j.io", "org.jivesoftware.util", "org.xmpp.packet" ]
java.io; java.util; org.dom4j; org.dom4j.io; org.jivesoftware.util; org.xmpp.packet;
1,818,515
@EventHandler(priority = EventPriority.LOW, ignoreCancelled=true) public void onExplode(EntityExplodeEvent event) { //getLogger().info("DEBUG: " + event.getEventName()); World world = event.getLocation().getWorld(); if (!world.equals(getBeaconzWorld())) { return; } ...
@EventHandler(priority = EventPriority.LOW, ignoreCancelled=true) void function(EntityExplodeEvent event) { World world = event.getLocation().getWorld(); if (!world.equals(getBeaconzWorld())) { return; } Iterator<Block> it = event.blockList().iterator(); while(it.hasNext()) { Block b = it.next(); if (getRegister().isAb...
/** * Protects the beacon defenses from any damage * @param event */
Protects the beacon defenses from any damage
onExplode
{ "repo_name": "tastybento/beaconz", "path": "src/main/java/com/wasteofplastic/beaconz/listeners/BeaconPassiveDefenseListener.java", "license": "mit", "size": 25373 }
[ "java.util.Iterator", "org.bukkit.World", "org.bukkit.block.Block", "org.bukkit.event.EventHandler", "org.bukkit.event.EventPriority", "org.bukkit.event.entity.EntityExplodeEvent" ]
import java.util.Iterator; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityExplodeEvent;
import java.util.*; import org.bukkit.*; import org.bukkit.block.*; import org.bukkit.event.*; import org.bukkit.event.entity.*;
[ "java.util", "org.bukkit", "org.bukkit.block", "org.bukkit.event" ]
java.util; org.bukkit; org.bukkit.block; org.bukkit.event;
1,267,613
public Properties getOutputProperties() { return _output; }
Properties function() { return _output; }
/** * Returns the output properties for the stylesheet. */
Returns the output properties for the stylesheet
getOutputProperties
{ "repo_name": "dlitz/resin", "path": "modules/resin/src/com/caucho/xsl/AbstractStylesheet.java", "license": "gpl-2.0", "size": 6098 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
238,635
@Test public void recursionDetection() throws Exception { assumeFalse("Symlinks don't work on Windows very well", Functions.isWindows()); SecretRewriter sw = new SecretRewriter(); TaskListener st = StreamTaskListener.fromStdout(); String o = encryptOld("Hello world"); St...
void function() throws Exception { assumeFalse(STR, Functions.isWindows()); SecretRewriter sw = new SecretRewriter(); TaskListener st = StreamTaskListener.fromStdout(); String o = encryptOld(STR); String n = encryptNew(STR); String payload = "<msg>" + o + STR; File t = tmp.newFolder("t"); List<String> dirs = Arrays.asL...
/** * Directory rewrite and recursion detection */
Directory rewrite and recursion detection
recursionDetection
{ "repo_name": "rsandell/jenkins", "path": "core/src/test/java/hudson/util/SecretRewriterTest.java", "license": "mit", "size": 4929 }
[ "hudson.model.TaskListener", "java.io.File", "java.nio.charset.Charset", "java.util.Arrays", "java.util.List", "org.apache.commons.io.FileUtils", "org.junit.Assert", "org.junit.Assume" ]
import hudson.model.TaskListener; import java.io.File; import java.nio.charset.Charset; import java.util.Arrays; import java.util.List; import org.apache.commons.io.FileUtils; import org.junit.Assert; import org.junit.Assume;
import hudson.model.*; import java.io.*; import java.nio.charset.*; import java.util.*; import org.apache.commons.io.*; import org.junit.*;
[ "hudson.model", "java.io", "java.nio", "java.util", "org.apache.commons", "org.junit" ]
hudson.model; java.io; java.nio; java.util; org.apache.commons; org.junit;
1,602,619
@Override public void onClick(View v) { mSnackbars.removeCurrentDueToAction(); updatePopup(); }
void function(View v) { mSnackbars.removeCurrentDueToAction(); updatePopup(); }
/** * Handles click event for action button at end of snackbar. */
Handles click event for action button at end of snackbar
onClick
{ "repo_name": "highweb-project/highweb-webcl-html5spec", "path": "chrome/android/java/src/org/chromium/chrome/browser/snackbar/SnackbarManager.java", "license": "bsd-3-clause", "size": 10945 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
981,939
public synchronized String getReferenceKey(Object txnuser, TopicMapStoreIF store) { synchronized (txnuser) { if (txnusers.containsKey(txnuser)) { Map<String, TopicMapStoreIF> stores = txnusers.get(txnuser); Iterator<Entry<String, TopicMapStoreIF>> iter = stores.entrySet().iterator(); ...
synchronized String function(Object txnuser, TopicMapStoreIF store) { synchronized (txnuser) { if (txnusers.containsKey(txnuser)) { Map<String, TopicMapStoreIF> stores = txnusers.get(txnuser); Iterator<Entry<String, TopicMapStoreIF>> iter = stores.entrySet().iterator(); while (iter.hasNext()) { Entry<String, TopicMapSt...
/** * INTERNAL: Returns the reference key for the given transaction * user's topic map store. An exception is thrown if the store is * not registered with the registry. */
user's topic map store. An exception is thrown if the store is not registered with the registry
getReferenceKey
{ "repo_name": "ontopia/ontopia", "path": "ontopia-engine/src/main/java/net/ontopia/topicmaps/entry/StoreRegistry.java", "license": "apache-2.0", "size": 6323 }
[ "java.util.Iterator", "java.util.Map", "net.ontopia.topicmaps.core.TopicMapStoreIF", "net.ontopia.utils.OntopiaRuntimeException" ]
import java.util.Iterator; import java.util.Map; import net.ontopia.topicmaps.core.TopicMapStoreIF; import net.ontopia.utils.OntopiaRuntimeException;
import java.util.*; import net.ontopia.topicmaps.core.*; import net.ontopia.utils.*;
[ "java.util", "net.ontopia.topicmaps", "net.ontopia.utils" ]
java.util; net.ontopia.topicmaps; net.ontopia.utils;
1,536,089
public static boolean equals(List left, Object[] right) { return coercedEquals(right, left); }
static boolean function(List left, Object[] right) { return coercedEquals(right, left); }
/** * Determines if the contents of this list are equal to the * contents of the given array in the same order. This returns * <code>false</code> if either collection is <code>null</code>. * <pre class="groovyTestCase">assert [1, "a"].equals( [ 1, "a" ] as Object[] )</pre> * * @param left ...
Determines if the contents of this list are equal to the contents of the given array in the same order. This returns <code>false</code> if either collection is <code>null</code>. assert [1, "a"].equals( [ 1, "a" ] as Object[] )</code>
equals
{ "repo_name": "apache/incubator-groovy", "path": "src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java", "license": "apache-2.0", "size": 703151 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,620,726
public boolean hasNewMessages() throws MessagingException { int oldLast = lastArticle; updateGroupStats(); return lastArticle > oldLast; }
boolean function() throws MessagingException { int oldLast = lastArticle; updateGroupStats(); return lastArticle > oldLast; }
/** * Ping the NNTP server to check if a newsgroup has any new messages. * * @return True if the server has new articles from the last time we * checked. Also returns true if this is the first time we've * checked. * @exception MessagingException */
Ping the NNTP server to check if a newsgroup has any new messages
hasNewMessages
{ "repo_name": "apache/geronimo-javamail", "path": "geronimo-javamail_1.5/geronimo-javamail_1.5_provider/src/main/java/org/apache/geronimo/javamail/store/nntp/NNTPGroupFolder.java", "license": "apache-2.0", "size": 13266 }
[ "javax.mail.MessagingException" ]
import javax.mail.MessagingException;
import javax.mail.*;
[ "javax.mail" ]
javax.mail;
667,483
@Override public void close() { for (MultipageTiffReader r : new HashSet<MultipageTiffReader>(tiffReadersByLabel_.values())) { try { r.close(); } catch (IOException ex) { ReportingUtils.logError(ex); } } }
void function() { for (MultipageTiffReader r : new HashSet<MultipageTiffReader>(tiffReadersByLabel_.values())) { try { r.close(); } catch (IOException ex) { ReportingUtils.logError(ex); } } }
/** * Disposes of the tagged images in the imagestorage */
Disposes of the tagged images in the imagestorage
close
{ "repo_name": "kmdouglass/Micro-Manager", "path": "mmstudio/src/org/micromanager/acquisition/TaggedImageStorageMultipageTiff.java", "license": "mit", "size": 34743 }
[ "java.io.IOException", "java.util.HashSet", "org.micromanager.utils.ReportingUtils" ]
import java.io.IOException; import java.util.HashSet; import org.micromanager.utils.ReportingUtils;
import java.io.*; import java.util.*; import org.micromanager.utils.*;
[ "java.io", "java.util", "org.micromanager.utils" ]
java.io; java.util; org.micromanager.utils;
1,350,764
private void handle422SessionTooSmall(SipResponse resp) { try { // 422 response received if (logger.isActivated()) { logger.info("422 response received"); } // Extract the Min-SE value int minExpire = SipUtils.getMinSessionExpirePeriod(resp); if (minExpire == -1) ...
void function(SipResponse resp) { try { if (logger.isActivated()) { logger.info(STR); } int minExpire = SipUtils.getMinSessionExpirePeriod(resp); if (minExpire == -1) { if (logger.isActivated()) { logger.error(STR); } handleError(new SipSessionError(SipSessionError.UNEXPECTED_EXCEPTION, STR)); return; } getDialogPath()...
/** * Handle 422 response * * @param resp 422 response */
Handle 422 response
handle422SessionTooSmall
{ "repo_name": "rex-xxx/mt6572_x201", "path": "mediatek/packages/apps/RCSe/core/src/com/orangelabs/rcs/core/ims/service/sip/OriginatingSipSession.java", "license": "gpl-2.0", "size": 11833 }
[ "com.orangelabs.rcs.core.ims.network.sip.SipMessageFactory", "com.orangelabs.rcs.core.ims.network.sip.SipUtils", "com.orangelabs.rcs.core.ims.protocol.sip.SipRequest", "com.orangelabs.rcs.core.ims.protocol.sip.SipResponse" ]
import com.orangelabs.rcs.core.ims.network.sip.SipMessageFactory; import com.orangelabs.rcs.core.ims.network.sip.SipUtils; import com.orangelabs.rcs.core.ims.protocol.sip.SipRequest; import com.orangelabs.rcs.core.ims.protocol.sip.SipResponse;
import com.orangelabs.rcs.core.ims.network.sip.*; import com.orangelabs.rcs.core.ims.protocol.sip.*;
[ "com.orangelabs.rcs" ]
com.orangelabs.rcs;
1,556,804
public void setLegendShape(int series, Shape shape) { this.legendShapeList.setShape(series, shape); fireChangeEvent(); }
void function(int series, Shape shape) { this.legendShapeList.setShape(series, shape); fireChangeEvent(); }
/** * Sets the shape used for the legend item for the specified series, and * sends a {@link RendererChangeEvent} to all registered listeners. * * @param series the series index. * @param shape the shape (<code>null</code> permitted). * * @since 1.0.11 */
Sets the shape used for the legend item for the specified series, and sends a <code>RendererChangeEvent</code> to all registered listeners
setLegendShape
{ "repo_name": "greearb/jfreechart-fse-ct", "path": "src/main/java/org/jfree/chart/renderer/AbstractRenderer.java", "license": "lgpl-2.1", "size": 108424 }
[ "java.awt.Shape" ]
import java.awt.Shape;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,973,794
private void setupSort(RunData data, String criteria) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); // current sorting sequence String asc = ""; if (!criteria.equals(state.getAttribute(SORTED_BY))) { state.setAttribute(SORTED_BY, criteri...
void function(RunData data, String criteria) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); String asc = ""; if (!criteria.equals(state.getAttribute(SORTED_BY))) { state.setAttribute(SORTED_BY, criteria); asc = Boolean.TRUE.toString(); state.setAttribute(S...
/** * setup sorting parameters * * @param criteria * String for sortedBy */
setup sorting parameters
setupSort
{ "repo_name": "lorenamgUMU/sakai", "path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java", "license": "apache-2.0", "size": 677150 }
[ "org.sakaiproject.cheftool.JetspeedRunData", "org.sakaiproject.cheftool.RunData", "org.sakaiproject.event.api.SessionState" ]
import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.event.api.SessionState;
import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*;
[ "org.sakaiproject.cheftool", "org.sakaiproject.event" ]
org.sakaiproject.cheftool; org.sakaiproject.event;
868,661
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<Void>, Void> beginWalkUpdateDomain( String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters);
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<Void>, Void> beginWalkUpdateDomain( String resourceGroupName, String cloudServiceName, int updateDomain, UpdateDomainInner parameters);
/** * Updates the role instances in the specified update domain. * * @param resourceGroupName Name of the resource group. * @param cloudServiceName Name of the cloud service. * @param updateDomain Specifies an integer value that identifies the update domain. Update domains are identified *...
Updates the role instances in the specified update domain
beginWalkUpdateDomain
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/CloudServicesUpdateDomainsClient.java", "license": "mit", "size": 17683 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.management.polling.PollResult", "com.azure.core.util.polling.SyncPoller", "com.azure.resourcemanager.compute.fluent.models.UpdateDomainInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.compute.fluent.models.UpdateDomainInner;
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.compute.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
69,036
public List<ListObject> getSupplimentalCodeList();
List<ListObject> function();
/** * Gets the supplimental code list. * * @return the supplimental code list */
Gets the supplimental code list
getSupplimentalCodeList
{ "repo_name": "JaLandry/MeasureAuthoringTool_LatestSprint", "path": "mat/src/mat/dao/ListObjectDAO.java", "license": "apache-2.0", "size": 6319 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
461,519
public static <T extends Model<T>> Model<T> jsonToModel(String json, Class<T> clazz){ Model<T> model = null; try { model = clazz.newInstance(); } catch (InstantiationException e) { JsonExtKit.log.error(e.getLocalizedMessage()); } catch (IllegalAccessException e) { JsonExtKit.log.error(e.getLocalized...
static <T extends Model<T>> Model<T> function(String json, Class<T> clazz){ Model<T> model = null; try { model = clazz.newInstance(); } catch (InstantiationException e) { JsonExtKit.log.error(e.getLocalizedMessage()); } catch (IllegalAccessException e) { JsonExtKit.log.error(e.getLocalizedMessage()); } Map<String, Obje...
/** * json String to Model<T extends Model<T>> * @param json * @param clazz * @return */
json String to Model>
jsonToModel
{ "repo_name": "yangyining/JFinal-plus", "path": "src/main/java/com/janeluo/jfinalplus/kit/JsonExtKit.java", "license": "apache-2.0", "size": 2829 }
[ "com.jfinal.plugin.activerecord.Model", "java.util.Map" ]
import com.jfinal.plugin.activerecord.Model; import java.util.Map;
import com.jfinal.plugin.activerecord.*; import java.util.*;
[ "com.jfinal.plugin", "java.util" ]
com.jfinal.plugin; java.util;
2,061,876
public void manageChildren( int viewTag, @Nullable ReadableArray moveFrom, @Nullable ReadableArray moveTo, @Nullable ReadableArray addChildTags, @Nullable ReadableArray addAtIndices, @Nullable ReadableArray removeFrom) { super.manageChildren(viewTag, moveFrom, moveTo, addChildT...
void function( int viewTag, @Nullable ReadableArray moveFrom, @Nullable ReadableArray moveTo, @Nullable ReadableArray addChildTags, @Nullable ReadableArray addAtIndices, @Nullable ReadableArray removeFrom) { super.manageChildren(viewTag, moveFrom, moveTo, addChildTags, addAtIndices, removeFrom); }
/** * Invoked when there is a mutation in a node tree. * * @param tag react tag of the node we want to manage * @param indicesToRemove ordered (asc) list of indicies at which view should be removed * @param viewsToAdd ordered (asc based on mIndex property) list of tag-index pairs that represent * ...
Invoked when there is a mutation in a node tree
manageChildren
{ "repo_name": "exponentjs/exponent", "path": "android/versioned-abis/expoview-abi44_0_0/src/main/java/abi44_0_0/host/exp/exponent/modules/api/reanimated/layoutReanimation/ReanimatedUIImplementation.java", "license": "bsd-3-clause", "size": 2613 }
[ "androidx.annotation.Nullable" ]
import androidx.annotation.Nullable;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
960,850
public ImmutableList<S2Point> getRandomFrame() { S2Point p0 = randomPoint(); S2Point p1 = S2Point.normalize(S2Point.crossProd(p0, randomPoint())); S2Point p2 = S2Point.normalize(S2Point.crossProd(p0, p1)); return ImmutableList.of(p0, p1, p2); }
ImmutableList<S2Point> function() { S2Point p0 = randomPoint(); S2Point p1 = S2Point.normalize(S2Point.crossProd(p0, randomPoint())); S2Point p2 = S2Point.normalize(S2Point.crossProd(p0, p1)); return ImmutableList.of(p0, p1, p2); }
/** * Return a right-handed coordinate frame (three orthonormal vectors). Returns * an array of three points: x,y,z */
Return a right-handed coordinate frame (three orthonormal vectors). Returns an array of three points: x,y,z
getRandomFrame
{ "repo_name": "tsandor/s2-geometry-library-java", "path": "tests/com/google/common/geometry/GeometryTestCase.java", "license": "apache-2.0", "size": 6997 }
[ "com.google.common.collect.ImmutableList" ]
import com.google.common.collect.ImmutableList;
import com.google.common.collect.*;
[ "com.google.common" ]
com.google.common;
1,001,731
return Ecoinomy.plugin.getServer().getOfflinePlayer(this.playerName); }
return Ecoinomy.plugin.getServer().getOfflinePlayer(this.playerName); }
/** * Gets the corresponding Bukkit Player for this AccountMember. * The return value might be null, if the player could not be found. * @return The corresponding Bukkit Player. */
Gets the corresponding Bukkit Player for this AccountMember. The return value might be null, if the player could not be found
getPlayer
{ "repo_name": "morphesus/eCoinomy", "path": "src/main/java/de/mdstv/bukkit/ecoinomy/account/AccountMember.java", "license": "gpl-2.0", "size": 1215 }
[ "de.mdstv.bukkit.ecoinomy.Ecoinomy" ]
import de.mdstv.bukkit.ecoinomy.Ecoinomy;
import de.mdstv.bukkit.ecoinomy.*;
[ "de.mdstv.bukkit" ]
de.mdstv.bukkit;
1,622,795
Collection<String> listSecuredTypes();
Collection<String> listSecuredTypes();
/** * Returns the types that will be secured. * * @return */
Returns the types that will be secured
listSecuredTypes
{ "repo_name": "cucina/opencucina", "path": "nosql/security/src/main/java/org/cucina/security/access/SecuredTypeRegistry.java", "license": "apache-2.0", "size": 631 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,084,163
AbstractFile createDestinationFile(AbstractFile destFolder, String destFileName) { do { // Loop for retry try { return destFolder.getDirectChild(destFileName); } catch (IOException e) { // Destination file couldn't be instantiated i...
AbstractFile createDestinationFile(AbstractFile destFolder, String destFileName) { do { try { return destFolder.getDirectChild(destFileName); } catch (IOException e) { int ret = showErrorDialog(errorDialogTitle, Translator.get(STR, destFileName)); if (ret == RETRY_ACTION) { continue; } return null; } } while(true); }
/** * Creates a destination file given a destination folder and a new file name. * @param destFolder a destination folder * @param destFileName a destination file name * @return the destination file or null if it cannot be created */
Creates a destination file given a destination folder and a new file name
createDestinationFile
{ "repo_name": "trol73/mucommander", "path": "src/main/com/mucommander/job/AbstractCopyJob.java", "license": "gpl-3.0", "size": 9744 }
[ "com.mucommander.commons.file.AbstractFile", "com.mucommander.utils.text.Translator", "java.io.IOException" ]
import com.mucommander.commons.file.AbstractFile; import com.mucommander.utils.text.Translator; import java.io.IOException;
import com.mucommander.commons.file.*; import com.mucommander.utils.text.*; import java.io.*;
[ "com.mucommander.commons", "com.mucommander.utils", "java.io" ]
com.mucommander.commons; com.mucommander.utils; java.io;
888,052
protected Size2D arrangeFR(BlockContainer container, Canvas canvas, RectangleConstraint constraint) { Size2D s = arrangeFN(container, canvas, constraint); if (constraint.getHeightRange().contains(s.height)) { return s; } else { RectangleConstraint c = con...
Size2D function(BlockContainer container, Canvas canvas, RectangleConstraint constraint) { Size2D s = arrangeFN(container, canvas, constraint); if (constraint.getHeightRange().contains(s.height)) { return s; } else { RectangleConstraint c = constraint.toFixedHeight(constraint .getHeightRange().constrain(s.getHeight()))...
/** * Arranges the blocks in the container with a fixed with and a range * constraint on the height. * * @param container * the container. * @param canvas * the graphics device. * @param constraint * the constraint. * * @return Th...
Arranges the blocks in the container with a fixed with and a range constraint on the height
arrangeFR
{ "repo_name": "djun100/afreechart", "path": "src/org/afree/chart/block/CenterArrangement.java", "license": "lgpl-3.0", "size": 12254 }
[ "android.graphics.Canvas", "org.afree.ui.Size2D" ]
import android.graphics.Canvas; import org.afree.ui.Size2D;
import android.graphics.*; import org.afree.ui.*;
[ "android.graphics", "org.afree.ui" ]
android.graphics; org.afree.ui;
627,431
public static boolean isDark(@NonNull Bitmap bitmap, int backupPixelX, int backupPixelY) { // first try palette with a small color quant size Palette palette = Palette.from(bitmap).maximumColorCount(3).generate(); if (palette != null && palette.getSwatches().size() > 0) { return ...
static boolean function(@NonNull Bitmap bitmap, int backupPixelX, int backupPixelY) { Palette palette = Palette.from(bitmap).maximumColorCount(3).generate(); if (palette != null && palette.getSwatches().size() > 0) { return isDark(palette) == IS_DARK; } else { return isDark(bitmap.getPixel(backupPixelX, backupPixelY));...
/** * Determines if a given bitmap is dark. This extracts a palette inline so should not be called * with a large image!! If palette fails then check the color of the specified pixel */
Determines if a given bitmap is dark. This extracts a palette inline so should not be called with a large image!! If palette fails then check the color of the specified pixel
isDark
{ "repo_name": "haihaio/AmenEye", "path": "app/src/main/java/cn/aaronyi/ameneye/utils/ColorUtil.java", "license": "mit", "size": 8175 }
[ "android.graphics.Bitmap", "android.support.annotation.NonNull", "android.support.v7.graphics.Palette" ]
import android.graphics.Bitmap; import android.support.annotation.NonNull; import android.support.v7.graphics.Palette;
import android.graphics.*; import android.support.annotation.*; import android.support.v7.graphics.*;
[ "android.graphics", "android.support" ]
android.graphics; android.support;
418,574
if (CollectionUtils.isEmpty(headerMappings)) { return; } for (Entry<String, Object> entry : headerMappings.entrySet()) { String headerElementName = entry.getKey(); String targetVariableName = Optional.ofNullable(entry.getValue()) .map(Object::toString) ...
if (CollectionUtils.isEmpty(headerMappings)) { return; } for (Entry<String, Object> entry : headerMappings.entrySet()) { String headerElementName = entry.getKey(); String targetVariableName = Optional.ofNullable(entry.getValue()) .map(Object::toString) .orElseThrow(() -> new CitrusRuntimeException(String.format(STR + S...
/** * Reads header information and saves new test variables. */
Reads header information and saves new test variables
extractVariables
{ "repo_name": "christophd/citrus", "path": "core/citrus-base/src/main/java/com/consol/citrus/variable/MessageHeaderVariableExtractor.java", "license": "apache-2.0", "size": 4431 }
[ "com.consol.citrus.exceptions.CitrusRuntimeException", "com.consol.citrus.exceptions.UnknownElementException", "java.util.LinkedHashMap", "java.util.Map", "java.util.Optional", "org.springframework.util.CollectionUtils" ]
import com.consol.citrus.exceptions.CitrusRuntimeException; import com.consol.citrus.exceptions.UnknownElementException; import java.util.LinkedHashMap; import java.util.Map; import java.util.Optional; import org.springframework.util.CollectionUtils;
import com.consol.citrus.exceptions.*; import java.util.*; import org.springframework.util.*;
[ "com.consol.citrus", "java.util", "org.springframework.util" ]
com.consol.citrus; java.util; org.springframework.util;
566,827
public static PropertyValuesHolder ofInt(Property<?, Integer> property, int... values) { return new IntPropertyValuesHolder(property, values); }
static PropertyValuesHolder function(Property<?, Integer> property, int... values) { return new IntPropertyValuesHolder(property, values); }
/** * Constructs and returns a PropertyValuesHolder with a given property and * set of int values. * @param property The property being animated. Should not be null. * @param values The values that the property will animate between. * @return PropertyValuesHolder The constructed PropertyValuesH...
Constructs and returns a PropertyValuesHolder with a given property and set of int values
ofInt
{ "repo_name": "cymcsg/UltimateAndroid", "path": "deprecated/UltimateAndroidNormal/UltimateAndroidUi/src/com/marshalchen/common/uimodule/nineoldandroids/animation/PropertyValuesHolder.java", "license": "apache-2.0", "size": 46193 }
[ "com.marshalchen.common.uimodule.nineoldandroids.util.Property" ]
import com.marshalchen.common.uimodule.nineoldandroids.util.Property;
import com.marshalchen.common.uimodule.nineoldandroids.util.*;
[ "com.marshalchen.common" ]
com.marshalchen.common;
1,251,611
public int update(SQLiteDatabase db, ContentValues values) { assertTable(); if (BuildConfig.DEBUG) { Log.v(TAG, "update() " + this); } return db.update(mTable, values, getSelection(), getSelectionArgs()); }
int function(SQLiteDatabase db, ContentValues values) { assertTable(); if (BuildConfig.DEBUG) { Log.v(TAG, STR + this); } return db.update(mTable, values, getSelection(), getSelectionArgs()); }
/** * Execute update using the current internal state as {@code WHERE} clause. */
Execute update using the current internal state as WHERE clause
update
{ "repo_name": "rfc1459/moca", "path": "src/main/java/org/level28/android/moca/util/SelectionBuilder.java", "license": "gpl-2.0", "size": 5958 }
[ "android.content.ContentValues", "android.database.sqlite.SQLiteDatabase", "android.util.Log", "org.level28.android.moca.BuildConfig" ]
import android.content.ContentValues; import android.database.sqlite.SQLiteDatabase; import android.util.Log; import org.level28.android.moca.BuildConfig;
import android.content.*; import android.database.sqlite.*; import android.util.*; import org.level28.android.moca.*;
[ "android.content", "android.database", "android.util", "org.level28.android" ]
android.content; android.database; android.util; org.level28.android;
418,692
public Placemark getPlacemark(int n) { return placemarkList.get(n); }
Placemark function(int n) { return placemarkList.get(n); }
/** * Returns the Nth placemark in the list. * * @param n The index into the list * @return Returns the nth placemark */
Returns the Nth placemark in the list
getPlacemark
{ "repo_name": "AsherBond/MondocosmOS", "path": "wonderland/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/EditPlacemarksJFrame.java", "license": "agpl-3.0", "size": 18905 }
[ "org.jdesktop.wonderland.modules.placemarks.api.common.Placemark" ]
import org.jdesktop.wonderland.modules.placemarks.api.common.Placemark;
import org.jdesktop.wonderland.modules.placemarks.api.common.*;
[ "org.jdesktop.wonderland" ]
org.jdesktop.wonderland;
2,553,803
private PDFObject readObjectDescription( int objNum, int objGen, PDFDecrypter decrypter) throws IOException { // we've already read the 4 0 obj bit. Next thing up is the object. // object descriptions end with the keyword endobj long debugpos = this.buf.position(); ...
PDFObject function( int objNum, int objGen, PDFDecrypter decrypter) throws IOException { long debugpos = this.buf.position(); PDFObject obj = readObject(objNum, objGen, decrypter); PDFObject endkey = readObject(objNum, objGen, decrypter); if (endkey.getType() != PDFObject.KEYWORD && endkey.getType() != PDFObject.STREAM...
/** * read an entire PDFObject. The intro line, which looks something * like "4 0 obj" has already been read. * @param objNum the object number of the object being read, being * the first number in the intro line (4 in "4 0 obj") * @param objGen the object generation of the object being ...
read an entire PDFObject. The intro line, which looks something like "4 0 obj" has already been read
readObjectDescription
{ "repo_name": "katjas/PDFrenderer", "path": "src/com/sun/pdfview/PDFFile.java", "license": "lgpl-2.1", "size": 72428 }
[ "com.sun.pdfview.decrypt.PDFDecrypter", "java.io.IOException", "java.nio.ByteBuffer" ]
import com.sun.pdfview.decrypt.PDFDecrypter; import java.io.IOException; import java.nio.ByteBuffer;
import com.sun.pdfview.decrypt.*; import java.io.*; import java.nio.*;
[ "com.sun.pdfview", "java.io", "java.nio" ]
com.sun.pdfview; java.io; java.nio;
268,446
public synchronized void okToUseGui() { if (!okToUseGui) { okToUseGui = true; // lets also tell the Children that can that they may use their GUI's synchronized(children) { for (Iterator i = children.keySet().iterator(); i.hasNext();) { ...
synchronized void function() { if (!okToUseGui) { okToUseGui = true; synchronized(children) { for (Iterator i = children.keySet().iterator(); i.hasNext();) { Visibility v = getChildVisibility(i.next()); if (v != null) v.okToUseGui(); } } } }
/** * Notify this instance that it may now render a GUI */
Notify this instance that it may now render a GUI
okToUseGui
{ "repo_name": "demidenko05/a-javabeans", "path": "src/main/java/ajava/beans/beancontext/BeanContextSupport.java", "license": "gpl-2.0", "size": 45673 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,498,952
public static void shareText(Activity activity, CharSequence text, int stringTitle, int stringMessage, int stringButtonYes, int stringButtonNo) { shareText(acti...
static void function(Activity activity, CharSequence text, int stringTitle, int stringMessage, int stringButtonYes, int stringButtonNo) { shareText(activity, text, activity.getString(stringTitle), activity.getString(stringMessage), activity.getString(stringButtonYes), activity.getString(stringButtonNo)); }
/** * See {@link #shareText(Activity, CharSequence, CharSequence, CharSequence, CharSequence, CharSequence)} -- * same, but takes string IDs which refer to the {@link Activity}'s resource bundle entries. */
See <code>#shareText(Activity, CharSequence, CharSequence, CharSequence, CharSequence, CharSequence)</code> -- same, but takes string IDs which refer to the <code>Activity</code>'s resource bundle entries
shareText
{ "repo_name": "LabBook/labbook-android", "path": "src/uk/ac/ic/bss/labbook/barcode/IntentIntegrator.java", "license": "gpl-2.0", "size": 12508 }
[ "android.app.Activity" ]
import android.app.Activity;
import android.app.*;
[ "android.app" ]
android.app;
1,367,522
public MulticurveSensitivity priceCurveSensitivity(final BondFuturesSecurity future, final HullWhiteIssuerProviderInterface data) { return priceCurveSensitivity(future, data, DEFAULT_NB_POINTS); }
MulticurveSensitivity function(final BondFuturesSecurity future, final HullWhiteIssuerProviderInterface data) { return priceCurveSensitivity(future, data, DEFAULT_NB_POINTS); }
/** * Computes the future price curve sensitivity. The default number of points is used for the numerical search. * * @param future * The future derivative. * @param data * The curve and Hull-White parameters. * @return The curve sensitivity. */
Computes the future price curve sensitivity. The default number of points is used for the numerical search
priceCurveSensitivity
{ "repo_name": "McLeodMoores/starling", "path": "projects/analytics/src/main/java/com/opengamma/analytics/financial/interestrate/future/provider/BondFuturesSecurityHullWhiteMethod.java", "license": "apache-2.0", "size": 21286 }
[ "com.opengamma.analytics.financial.interestrate.future.derivative.BondFuturesSecurity", "com.opengamma.analytics.financial.provider.description.interestrate.HullWhiteIssuerProviderInterface", "com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity" ]
import com.opengamma.analytics.financial.interestrate.future.derivative.BondFuturesSecurity; import com.opengamma.analytics.financial.provider.description.interestrate.HullWhiteIssuerProviderInterface; import com.opengamma.analytics.financial.provider.sensitivity.multicurve.MulticurveSensitivity;
import com.opengamma.analytics.financial.interestrate.future.derivative.*; import com.opengamma.analytics.financial.provider.description.interestrate.*; import com.opengamma.analytics.financial.provider.sensitivity.multicurve.*;
[ "com.opengamma.analytics" ]
com.opengamma.analytics;
1,990,252
public Complex[] transform(double f[]) throws IllegalArgumentException { return fft(f, false); }
Complex[] function(double f[]) throws IllegalArgumentException { return fft(f, false); }
/** * Transform the given real data set. * <p> * The formula is $ y_n = \Sigma_{k=0}^{N-1} e^{-2 \pi i nk/N} x_k $ * </p> * * @param f the real data array to be transformed * @return the complex transformed array * @throws IllegalArgumentException if any parameters are invalid ...
Transform the given real data set. The formula is $ y_n = \Sigma_{k=0}^{N-1} e^{-2 \pi i nk/N} x_k $
transform
{ "repo_name": "SpoonLabs/astor", "path": "examples/math_76/src/main/java/org/apache/commons/math/transform/FastFourierTransformer.java", "license": "gpl-2.0", "size": 34431 }
[ "org.apache.commons.math.complex.Complex" ]
import org.apache.commons.math.complex.Complex;
import org.apache.commons.math.complex.*;
[ "org.apache.commons" ]
org.apache.commons;
1,589,932
@Override public String getDropColumnStatement( String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon ) { return "ALTER TABLE " + tablename + " DROP COLUMN " + v.getName() + Const.CR; }
String function( String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon ) { return STR + tablename + STR + v.getName() + Const.CR; }
/** * Generates the SQL statement to drop a column from the specified table * * @param tablename * The table to add * @param v * The column defined as a value * @param tk * the name of the technical key field * @param use_autoinc * whether or not this fi...
Generates the SQL statement to drop a column from the specified table
getDropColumnStatement
{ "repo_name": "apratkin/pentaho-kettle", "path": "core/src/org/pentaho/di/core/database/Exasol4DatabaseMeta.java", "license": "apache-2.0", "size": 16190 }
[ "org.pentaho.di.core.Const", "org.pentaho.di.core.row.ValueMetaInterface" ]
import org.pentaho.di.core.Const; import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.*; import org.pentaho.di.core.row.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,476,761
private void checkCells(Cell[] steps) throws OccupiedWayException { for (Cell step : steps) { try { if (this.findBy(step) != -1) { throw new OccupiedWayException(); } } catch (FigureNotFoundException exc) { } } ...
void function(Cell[] steps) throws OccupiedWayException { for (Cell step : steps) { try { if (this.findBy(step) != -1) { throw new OccupiedWayException(); } } catch (FigureNotFoundException exc) { } } }
/** * Method check Cells. * @param steps - way of the figure. * @throws OccupiedWayException if the way is not empty. */
Method check Cells
checkCells
{ "repo_name": "NatashaPanchina/npanchina", "path": "chess/src/main/java/ru/job4j/chess/Logic.java", "license": "apache-2.0", "size": 2797 }
[ "ru.job4j.chess.firuges.Cell" ]
import ru.job4j.chess.firuges.Cell;
import ru.job4j.chess.firuges.*;
[ "ru.job4j.chess" ]
ru.job4j.chess;
578,885
public List<String> getUpgradeScripts(String gDbName);
List<String> function(String gDbName);
/** * Returns list of upgrade script names (01.sql, 02.sql, ...). * @param gDbName database name * @return list of scripts */
Returns list of upgrade script names (01.sql, 02.sql, ...)
getUpgradeScripts
{ "repo_name": "skoumalcz/joogar", "path": "joogar/src/main/java/net/skoumal/joogar/shared/SystemUtils.java", "license": "apache-2.0", "size": 476 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
938,575
public int topLevelCommit () { if (tsLogger.logger.isDebugEnabled()) { tsLogger.logger.debug("RecoveryRecord::topLevelCommit() for " + order()); } forgetAction(true); return TwoPhaseOutcome.FINISH_OK; }
int function () { if (tsLogger.logger.isDebugEnabled()) { tsLogger.logger.debug(STR + order()); } forgetAction(true); return TwoPhaseOutcome.FINISH_OK; }
/** * topLevelCommit has nothing to do for RecoveryRecords as no changes have * been made in the object store. In fact since topLevelPrepare returns * PREPARE_READONLY this function should never actually be called */
topLevelCommit has nothing to do for RecoveryRecords as no changes have been made in the object store. In fact since topLevelPrepare returns PREPARE_READONLY this function should never actually be called
topLevelCommit
{ "repo_name": "nmcl/scratch", "path": "graalvm/transactions/fork/narayana/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/RecoveryRecord.java", "license": "apache-2.0", "size": 8777 }
[ "com.arjuna.ats.arjuna.coordinator.TwoPhaseOutcome" ]
import com.arjuna.ats.arjuna.coordinator.TwoPhaseOutcome;
import com.arjuna.ats.arjuna.coordinator.*;
[ "com.arjuna.ats" ]
com.arjuna.ats;
1,615,146
public IStructuredModel createNewInstance(Object requester, IStructuredModel model) throws IOException;
IStructuredModel function(Object requester, IStructuredModel model) throws IOException;
/** * createNewInstance is similar to clone, except the new instance has no * text content. Note: this produces an UNSHARED model, for temporary use, * that has the same characteristics as original model. If a true shared * model is desired, use "copy". * * ISSUE: still needed? * * @param requester ...
createNewInstance is similar to clone, except the new instance has no text content. Note: this produces an UNSHARED model, for temporary use, that has the same characteristics as original model. If a true shared model is desired, use "copy"
createNewInstance
{ "repo_name": "ttimbul/eclipse.wst", "path": "bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/model/IModelManagerProposed.java", "license": "epl-1.0", "size": 12075 }
[ "java.io.IOException", "org.eclipse.wst.sse.core.internal.provisional.IStructuredModel" ]
import java.io.IOException; import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import java.io.*; import org.eclipse.wst.sse.core.internal.provisional.*;
[ "java.io", "org.eclipse.wst" ]
java.io; org.eclipse.wst;
1,114,993
public static boolean isCollectional(final Class<?> entityType, final String doNotationExp) { final Field field = Finder.findFieldByName(entityType, doNotationExp); return EntityUtils.isCollectional(field.getType()); }
static boolean function(final Class<?> entityType, final String doNotationExp) { final Field field = Finder.findFieldByName(entityType, doNotationExp); return EntityUtils.isCollectional(field.getType()); }
/** * Identifies whether property <code>doNotationExp</code> in type <code>entityType</code> is collectional. * * @param entityType * @param doNotationExp * @return */
Identifies whether property <code>doNotationExp</code> in type <code>entityType</code> is collectional
isCollectional
{ "repo_name": "fieldenms/tg", "path": "platform-pojo-bl/src/main/java/ua/com/fielden/platform/reflection/PropertyTypeDeterminator.java", "license": "mit", "size": 22866 }
[ "java.lang.reflect.Field", "ua.com.fielden.platform.utils.EntityUtils" ]
import java.lang.reflect.Field; import ua.com.fielden.platform.utils.EntityUtils;
import java.lang.reflect.*; import ua.com.fielden.platform.utils.*;
[ "java.lang", "ua.com.fielden" ]
java.lang; ua.com.fielden;
1,095,464
@Test public void testEmbeddedCollectionResourceLinkId() throws Exception { // Create Collection resource List<EntityResource<OEntity>> oentities = new ArrayList<EntityResource<OEntity>>(); EdmDataServices edmDataServices = createMockFlightEdmDataServices(); EdmEntitySet entitySe...
void function() throws Exception { List<EntityResource<OEntity>> oentities = new ArrayList<EntityResource<OEntity>>(); EdmDataServices edmDataServices = createMockFlightEdmDataServices(); EdmEntitySet entitySet = edmDataServices.findEdmEntitySet(STR); List<OLink> olinks = new ArrayList<OLink>(); olinks.add(OLinks.relat...
/** * Test case to ensure the whether the writer contain all the embedded * resource link along with id param * * @throws Exception */
Test case to ensure the whether the writer contain all the embedded resource link along with id param
testEmbeddedCollectionResourceLinkId
{ "repo_name": "junejosheeraz/IRIS", "path": "interaction-media-odata-xml/src/test/java/com/temenos/interaction/media/odata/xml/atom/TestAtomXMLProvider.java", "license": "agpl-3.0", "size": 95139 }
[ "com.temenos.interaction.core.hypermedia.Link", "com.temenos.interaction.core.hypermedia.Transition", "com.temenos.interaction.core.resource.CollectionResource", "com.temenos.interaction.core.resource.EntityResource", "com.temenos.interaction.core.resource.RESTResource", "java.util.ArrayList", "java.uti...
import com.temenos.interaction.core.hypermedia.Link; import com.temenos.interaction.core.hypermedia.Transition; import com.temenos.interaction.core.resource.CollectionResource; import com.temenos.interaction.core.resource.EntityResource; import com.temenos.interaction.core.resource.RESTResource; import java.util.ArrayL...
import com.temenos.interaction.core.hypermedia.*; import com.temenos.interaction.core.resource.*; import java.util.*; import javax.ws.rs.core.*; import org.mockito.*; import org.odata4j.core.*; import org.odata4j.edm.*;
[ "com.temenos.interaction", "java.util", "javax.ws", "org.mockito", "org.odata4j.core", "org.odata4j.edm" ]
com.temenos.interaction; java.util; javax.ws; org.mockito; org.odata4j.core; org.odata4j.edm;
1,541,438
public static boolean isSupported(Context context) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { return false; } CameraManager cameraManager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE); try { String[] cameraIds = cameraManager.getCameraIdList(); ...
static boolean function(Context context) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { return false; } CameraManager cameraManager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE); try { String[] cameraIds = cameraManager.getCameraIdList(); for (String id : cameraIds) { CameraCharacter...
/** * Checks if API is supported and all cameras have better than legacy support. */
Checks if API is supported and all cameras have better than legacy support
isSupported
{ "repo_name": "endlessm/chromium-browser", "path": "third_party/webrtc/sdk/android/api/org/webrtc/Camera2Enumerator.java", "license": "bsd-3-clause", "size": 9974 }
[ "android.content.Context", "android.hardware.camera2.CameraCharacteristics", "android.hardware.camera2.CameraManager", "android.os.Build", "android.util.AndroidException" ]
import android.content.Context; import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CameraManager; import android.os.Build; import android.util.AndroidException;
import android.content.*; import android.hardware.camera2.*; import android.os.*; import android.util.*;
[ "android.content", "android.hardware", "android.os", "android.util" ]
android.content; android.hardware; android.os; android.util;
1,804,964
public static Event[] maskToEvents(int mask) { List<Event> evs = new ArrayList<Event>(); for (Event e : values()) if (e.value == (e.value & mask)) evs.add(e); return evs.toArray(new Event[0]); }
static Event[] function(int mask) { List<Event> evs = new ArrayList<Event>(); for (Event e : values()) if (e.value == (e.value & mask)) evs.add(e); return evs.toArray(new Event[0]); }
/** * Returns an array of Event enums set in the specified {@code mask}. * * @param mask Mask to convert * @return Event[] */
Returns an array of Event enums set in the specified mask
maskToEvents
{ "repo_name": "glassbeam/watcher", "path": "src/java/classes/com/den_4/inotify_java/enums/Event.java", "license": "gpl-3.0", "size": 8017 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,568,280
public void setMetadata(Map<String, String> metadataMap) { this.metadata = metadataMap; }
void function(Map<String, String> metadataMap) { this.metadata = metadataMap; }
/** * Set AWS metadata. * * @param metadataMap * the map containing AWS metadata. */
Set AWS metadata
setMetadata
{ "repo_name": "brharrington/eureka", "path": "eureka-client/src/main/java/com/netflix/appinfo/AmazonInfo.java", "license": "apache-2.0", "size": 11153 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,001,098
public void testCancelWithMessageAndApplicationError() { // Make the XML to test String xml = "<error type='cancel' code='10'>" + "<conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>" + "<text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>" + "Some special applicati...
void function() { String xml = STR + STR + STR + STR + STR + STR + STR; try { XmlPullParser parser = getParserFromXML(xml); XMPPError error = parseError(parser); assertNotNull(error); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
/** * Check the parser with an xml with the 404 error. */
Check the parser with an xml with the 404 error
testCancelWithMessageAndApplicationError
{ "repo_name": "qingsong-xu/Smack", "path": "smack-core/src/integration-test/java/org/jivesoftware/smack/util/XMPPErrorTest.java", "license": "apache-2.0", "size": 6683 }
[ "org.jivesoftware.smack.packet.XMPPError", "org.xmlpull.v1.XmlPullParser" ]
import org.jivesoftware.smack.packet.XMPPError; import org.xmlpull.v1.XmlPullParser;
import org.jivesoftware.smack.packet.*; import org.xmlpull.v1.*;
[ "org.jivesoftware.smack", "org.xmlpull.v1" ]
org.jivesoftware.smack; org.xmlpull.v1;
1,923,873
@Test public void testUpdateProperties() throws Exception { assertEmpty(mgr.directoryListing(ROOT_ID)); assertTrue(mgr.mkdirs(new IgfsPath("/dir"), IgfsImpl.DFLT_DIR_META)); assertNotNull(mgr.create(new IgfsPath("/file"), null, false, 400, null, false, null, null)); IgfsListing...
void function() throws Exception { assertEmpty(mgr.directoryListing(ROOT_ID)); assertTrue(mgr.mkdirs(new IgfsPath("/dir"), IgfsImpl.DFLT_DIR_META)); assertNotNull(mgr.create(new IgfsPath("/file"), null, false, 400, null, false, null, null)); IgfsListingEntry dirEntry = mgr.directoryListing(ROOT_ID).get("dir"); assertNo...
/** * Test properties management in meta-cache. * * @throws Exception If failed. */
Test properties management in meta-cache
testUpdateProperties
{ "repo_name": "ilantukh/ignite", "path": "modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java", "license": "apache-2.0", "size": 15599 }
[ "java.util.Arrays", "java.util.Collections", "java.util.Map", "java.util.UUID", "org.apache.ignite.igfs.IgfsPath", "org.apache.ignite.internal.util.typedef.F", "org.apache.ignite.lang.IgniteBiTuple", "org.apache.ignite.lang.IgniteUuid" ]
import java.util.Arrays; import java.util.Collections; import java.util.Map; import java.util.UUID; import org.apache.ignite.igfs.IgfsPath; import org.apache.ignite.internal.util.typedef.F; import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.lang.IgniteUuid;
import java.util.*; import org.apache.ignite.igfs.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.lang.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
1,024,071
protected String validateCounterName(final String counterName) { Preconditions.checkNotNull(counterName); Preconditions.checkArgument(counterName.length() > 0); return counterName; }
String function(final String counterName) { Preconditions.checkNotNull(counterName); Preconditions.checkArgument(counterName.length() > 0); return counterName; }
/** * Helper to validate the name of the counter to be operated upon. * * @param counterName * @return */
Helper to validate the name of the counter to be operated upon
validateCounterName
{ "repo_name": "instacount/instacount-java-client-feign", "path": "src/main/java/io/instacount/client/model/shardedcounters/inputs/AbstractCounterInput.java", "license": "apache-2.0", "size": 2714 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,052,661
public void visitCounterexample(Counterexample result) { makeAlertBody(result); AlertFactory.createAlert(Alert.AlertType.INFORMATION, "Counterexample Available", "A counterexample is available.", alertBody, logFileContents).showAndWait(); StvsRootModel rootModel = controller.getRootModel(); //...
void function(Counterexample result) { makeAlertBody(result); AlertFactory.createAlert(Alert.AlertType.INFORMATION, STR, STR, alertBody, logFileContents).showAndWait(); StvsRootModel rootModel = controller.getRootModel(); ConstraintSpecification verifiedSpec = rootModel.getScenario() .getVerificationEngine().getVerific...
/** * Visits a {@link Counterexample}. This displays the counterexample in a new tab. * * @param result Counterexample to visit. */
Visits a <code>Counterexample</code>. This displays the counterexample in a new tab
visitCounterexample
{ "repo_name": "VerifAPS/stvs", "path": "src/main/java/edu/kit/iti/formal/stvs/view/VerificationResultHandler.java", "license": "gpl-3.0", "size": 4249 }
[ "edu.kit.iti.formal.stvs.model.StvsRootModel", "edu.kit.iti.formal.stvs.model.table.ConstraintSpecification", "edu.kit.iti.formal.stvs.model.table.HybridSpecification", "edu.kit.iti.formal.stvs.model.verification.Counterexample", "edu.kit.iti.formal.stvs.view.common.AlertFactory" ]
import edu.kit.iti.formal.stvs.model.StvsRootModel; import edu.kit.iti.formal.stvs.model.table.ConstraintSpecification; import edu.kit.iti.formal.stvs.model.table.HybridSpecification; import edu.kit.iti.formal.stvs.model.verification.Counterexample; import edu.kit.iti.formal.stvs.view.common.AlertFactory;
import edu.kit.iti.formal.stvs.model.*; import edu.kit.iti.formal.stvs.model.table.*; import edu.kit.iti.formal.stvs.model.verification.*; import edu.kit.iti.formal.stvs.view.common.*;
[ "edu.kit.iti" ]
edu.kit.iti;
1,824,872
public List<String> getSimilarMatches(String term, int limit) { List<String> uris = getExactMatches(term); // difference between the limit and the current size of the result int free; // check if we reached the limit if (uris.size() > limit) { uris = uris.subList(0, limit); return uris; } ...
List<String> function(String term, int limit) { List<String> uris = getExactMatches(term); int free; if (uris.size() > limit) { uris = uris.subList(0, limit); return uris; } Set<String> result = new HashSet<String>(); List<String> tmp; result.addAll(uris); free = limit - result.size(); if (free > 0) { for (String u : u...
/** * Look up <code>term</code> in the ontology and return a list of similar * concepts (URIs) that corresponds to the term. The result is limited to * <code>limit</code> number of concepts. The order is exact matches, * synonyms, children, parents. The list does not contain duplicates. Never * returns <code>...
Look up <code>term</code> in the ontology and return a list of similar concepts (URIs) that corresponds to the term. The result is limited to <code>limit</code> number of concepts. The order is exact matches, synonyms, children, parents. The list does not contain duplicates. Never returns <code>null</code>
getSimilarMatches
{ "repo_name": "ag-csw/ExpertFinder", "path": "src-framework/de/csw/expertfinder/ontology/OntologyIndex.java", "license": "lgpl-3.0", "size": 29170 }
[ "java.util.ArrayList", "java.util.HashSet", "java.util.List", "java.util.Set" ]
import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
94,853
private void verifyQuota(INode[] inodes, int pos, long nsDelta, long dsDelta, INode commonAncestor) throws QuotaExceededException { if (!ready) { // Do not check quota if edits log is still being processed return; } if (nsDelta <= 0 && dsDelta <= 0) { // if quota is being freed or ...
void function(INode[] inodes, int pos, long nsDelta, long dsDelta, INode commonAncestor) throws QuotaExceededException { if (!ready) { return; } if (nsDelta <= 0 && dsDelta <= 0) { return; } if (pos>inodes.length) { pos = inodes.length; } int i = pos - 1; try { for(; i >= 0; i--) { if (commonAncestor == inodes[i]) { re...
/** * Verify quota for adding or moving a new INode with required * namespace and diskspace to a given position. * * @param inodes INodes corresponding to a path * @param pos position where a new INode will be added * @param nsDelta needed namespace * @param dsDelta needed diskspace * @param ...
Verify quota for adding or moving a new INode with required namespace and diskspace to a given position
verifyQuota
{ "repo_name": "moreus/hadoop", "path": "hadoop-0.23.10/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java", "license": "apache-2.0", "size": 81206 }
[ "org.apache.hadoop.hdfs.protocol.QuotaExceededException" ]
import org.apache.hadoop.hdfs.protocol.QuotaExceededException;
import org.apache.hadoop.hdfs.protocol.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,105,918
public String cancelAPurchaseorder(String purchaseorderId)throws Exception { String urlString = url+"/"+purchaseorderId+"/status/cancelled"; //No I18N String response = ZohoHTTPClient.post(urlString, getQueryMap()); return purchaseOrderParser.getMessage(response); }
String function(String purchaseorderId)throws Exception { String urlString = url+"/"+purchaseorderId+STR; String response = ZohoHTTPClient.post(urlString, getQueryMap()); return purchaseOrderParser.getMessage(response); }
/** * Mark a purchase order as cancelled. * * @param purchaseorderId ID of the purchase order. * * @return Returns the success message. * * @throws Exception */
Mark a purchase order as cancelled
cancelAPurchaseorder
{ "repo_name": "zoho/books-java-wrappers", "path": "source/com/zoho/books/api/PurchaseOrderApi.java", "license": "mit", "size": 16252 }
[ "com.zoho.books.util.ZohoHTTPClient" ]
import com.zoho.books.util.ZohoHTTPClient;
import com.zoho.books.util.*;
[ "com.zoho.books" ]
com.zoho.books;
2,005,464
@Override public Expression normalize(ExpressionNormalizer normalizer) { if (hasBeenNormalized()) { return this; } else { setHasBeenNormalized(true); } // Normalize the ON clause if present. Need to use rebuild, not twist as parameters are real parameter...
Expression function(ExpressionNormalizer normalizer) { if (hasBeenNormalized()) { return this; } else { setHasBeenNormalized(true); } if (this.onClause != null) { this.onClause = this.onClause.normalize(normalizer); if (shouldUseOuterJoin() (!getSession().getPlatform().shouldPrintInnerJoinInWhereClause())) { normalizer...
/** * INTERNAL: * Normalize the expression into a printable structure. * Any joins must be added to form a new root. */
Normalize the expression into a printable structure. Any joins must be added to form a new root
normalize
{ "repo_name": "RallySoftware/eclipselink.runtime", "path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/expressions/ExpressionBuilder.java", "license": "epl-1.0", "size": 19037 }
[ "org.eclipse.persistence.exceptions.QueryException", "org.eclipse.persistence.history.AsOfClause", "org.eclipse.persistence.internal.expressions.ExpressionNormalizer", "org.eclipse.persistence.queries.ReadQuery" ]
import org.eclipse.persistence.exceptions.QueryException; import org.eclipse.persistence.history.AsOfClause; import org.eclipse.persistence.internal.expressions.ExpressionNormalizer; import org.eclipse.persistence.queries.ReadQuery;
import org.eclipse.persistence.exceptions.*; import org.eclipse.persistence.history.*; import org.eclipse.persistence.internal.expressions.*; import org.eclipse.persistence.queries.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
287,597
private boolean shouldRetry(HttpRequestBase method, Throwable t, int retries) { if (retries > this.numRetries) { return false; } if (method instanceof HttpEntityEnclosingRequest) { HttpEntity entity = ((HttpEntityEnclosingRequest) method).getEntity(); if (entity != null && !entity.isRep...
boolean function(HttpRequestBase method, Throwable t, int retries) { if (retries > this.numRetries) { return false; } if (method instanceof HttpEntityEnclosingRequest) { HttpEntity entity = ((HttpEntityEnclosingRequest) method).getEntity(); if (entity != null && !entity.isRepeatable()) { return false; } } if (t instanc...
/** * Returns true if a failed request should be retried. * * @param method The current HTTP method being executed. * @param t The throwable from the failed request. * @param retries The number of times the current request has been attempted. * @return True if the failed request should be retri...
Returns true if a failed request should be retried
shouldRetry
{ "repo_name": "sbg/sevenbridges-java", "path": "extensions/httpclient/src/main/java/com/sevenbridges/apiclient/impl/http/httpclient/HttpClientRequestExecutor.java", "license": "apache-2.0", "size": 17820 }
[ "com.sevenbridges.apiclient.impl.http.RestException", "java.net.SocketException", "java.net.SocketTimeoutException", "org.apache.http.HttpEntity", "org.apache.http.HttpEntityEnclosingRequest", "org.apache.http.NoHttpResponseException", "org.apache.http.client.methods.HttpRequestBase", "org.apache.http...
import com.sevenbridges.apiclient.impl.http.RestException; import java.net.SocketException; import java.net.SocketTimeoutException; import org.apache.http.HttpEntity; import org.apache.http.HttpEntityEnclosingRequest; import org.apache.http.NoHttpResponseException; import org.apache.http.client.methods.HttpRequestBase;...
import com.sevenbridges.apiclient.impl.http.*; import java.net.*; import org.apache.http.*; import org.apache.http.client.methods.*; import org.apache.http.conn.*;
[ "com.sevenbridges.apiclient", "java.net", "org.apache.http" ]
com.sevenbridges.apiclient; java.net; org.apache.http;
171,238
@Test public void checkAccessors() { // There are seven possible scenarios with the old and new values for a // key. // These are (oldValue/newValue): // empty/null // empty/!null // null/null (no change in value) // null/!null // !null/null // !null/!null and not equal // !null/!null and equal ...
void function() { String key; Object oldValue; Object newValue; key = "key1"; newValue = null; oldValue = broker.putValue(key, newValue); assertEquals(newValue, broker.getValue(key)); assertEquals(oldValue, null); newValue = null; oldValue = broker.putValue(key, newValue); assertEquals(newValue, broker.getValue(key)); ...
/** * Checks the putValue() and getValue() functions. */
Checks the putValue() and getValue() functions
checkAccessors
{ "repo_name": "gorindn/ice", "path": "tests/org.eclipse.ice.client.widgets.reactoreditor.test/src/org/eclipse/ice/client/widgets/reactoreditor/test/StateBrokerTester.java", "license": "epl-1.0", "size": 14101 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,121,699
public boolean equals( Object obj ) { if ( obj instanceof CSSUnknownValue ) { CSSUnknownValue that = (CSSUnknownValue) obj; return ObjectUtilities.equal( this.cssText, that.cssText ); } else { return false; } }
boolean function( Object obj ) { if ( obj instanceof CSSUnknownValue ) { CSSUnknownValue that = (CSSUnknownValue) obj; return ObjectUtilities.equal( this.cssText, that.cssText ); } else { return false; } }
/** * Determines if this instance of the object is equals to another Object * * @return <code>true</code> if the supplied object is equivalent to this object, <code>false</code> otherwise */
Determines if this instance of the object is equals to another Object
equals
{ "repo_name": "EgorZhuk/pentaho-reporting", "path": "libraries/libcss/src/main/java/org/pentaho/reporting/libraries/css/values/CSSUnknownValue.java", "license": "lgpl-2.1", "size": 1822 }
[ "org.pentaho.reporting.libraries.base.util.ObjectUtilities" ]
import org.pentaho.reporting.libraries.base.util.ObjectUtilities;
import org.pentaho.reporting.libraries.base.util.*;
[ "org.pentaho.reporting" ]
org.pentaho.reporting;
789,532
public int pendingRequestCount(Node node) { List<ClientRequest> pending = unsent.get(node); int unsentCount = pending == null ? 0 : pending.size(); return unsentCount + client.inFlightRequestCount(node.idString()); }
int function(Node node) { List<ClientRequest> pending = unsent.get(node); int unsentCount = pending == null ? 0 : pending.size(); return unsentCount + client.inFlightRequestCount(node.idString()); }
/** * Get the count of pending requests to the given node. This includes both request that * have been transmitted (i.e. in-flight requests) and those which are awaiting transmission. * @param node The node in question * @return The number of pending requests */
Get the count of pending requests to the given node. This includes both request that have been transmitted (i.e. in-flight requests) and those which are awaiting transmission
pendingRequestCount
{ "repo_name": "juhanishen/kafka", "path": "clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java", "license": "apache-2.0", "size": 11617 }
[ "java.util.List", "org.apache.kafka.clients.ClientRequest", "org.apache.kafka.common.Node" ]
import java.util.List; import org.apache.kafka.clients.ClientRequest; import org.apache.kafka.common.Node;
import java.util.*; import org.apache.kafka.clients.*; import org.apache.kafka.common.*;
[ "java.util", "org.apache.kafka" ]
java.util; org.apache.kafka;
2,096,508
public static <T, R> R foldr(BiFunction<T, R, R> reducer, R initialValue, ArrayList<T> list) { R output = initialValue; for (int i = list.size() - 1; i >= 0; i--) { output = reducer.apply(list.get(i), output); } return output; }
static <T, R> R function(BiFunction<T, R, R> reducer, R initialValue, ArrayList<T> list) { R output = initialValue; for (int i = list.size() - 1; i >= 0; i--) { output = reducer.apply(list.get(i), output); } return output; }
/** * Performs right fold on {@code list}. * @param reducer The reducer function. * @param initialValue The initial value fed to {@code reducer}. If {@code list} is empty, this value is returned. * @param list The {@code ArrayList} to fold. * @param <T> The type of the {@code ArrayList}. *...
Performs right fold on list
foldr
{ "repo_name": "CS2103AUG2016-W11-C1/main", "path": "src/main/java/linenux/util/ArrayListUtil.java", "license": "mit", "size": 10324 }
[ "java.util.ArrayList", "java.util.function.BiFunction" ]
import java.util.ArrayList; import java.util.function.BiFunction;
import java.util.*; import java.util.function.*;
[ "java.util" ]
java.util;
101,748
public static LinkedHashMap<String, String> computeInstanceTopologyMap( ClusterConfig clusterConfig, String instanceName, InstanceConfig instanceConfig, boolean earlyQuitForFaultZone) { ClusterTopologyConfig clusterTopologyConfig = ClusterTopologyConfig.createFromClusterConfig(clusterConfig); Stri...
static LinkedHashMap<String, String> function( ClusterConfig clusterConfig, String instanceName, InstanceConfig instanceConfig, boolean earlyQuitForFaultZone) { ClusterTopologyConfig clusterTopologyConfig = ClusterTopologyConfig.createFromClusterConfig(clusterConfig); String faultZoneForEarlyQuit = earlyQuitForFaultZon...
/** * This function returns a LinkedHashMap<String, String> object representing * the topology path for an instance. * LinkedHashMap is used here since the order of the path needs to be preserved * when creating the topology tree. * * @param clusterConfig clusterConfig of the given cluster. ...
This function returns a LinkedHashMap object representing the topology path for an instance. LinkedHashMap is used here since the order of the path needs to be preserved when creating the topology tree
computeInstanceTopologyMap
{ "repo_name": "apache/helix", "path": "helix-core/src/main/java/org/apache/helix/controller/rebalancer/topology/Topology.java", "license": "apache-2.0", "size": 13498 }
[ "java.util.LinkedHashMap", "org.apache.helix.model.ClusterConfig", "org.apache.helix.model.ClusterTopologyConfig", "org.apache.helix.model.InstanceConfig" ]
import java.util.LinkedHashMap; import org.apache.helix.model.ClusterConfig; import org.apache.helix.model.ClusterTopologyConfig; import org.apache.helix.model.InstanceConfig;
import java.util.*; import org.apache.helix.model.*;
[ "java.util", "org.apache.helix" ]
java.util; org.apache.helix;
354,404
if (UIManager.get(getUIClassID()) != null) { setUI((CommandButtonUI) UIManager.getUI(this)); } else { setUI(BasicCommandToggleButtonUI.createUI(this)); } }
if (UIManager.get(getUIClassID()) != null) { setUI((CommandButtonUI) UIManager.getUI(this)); } else { setUI(BasicCommandToggleButtonUI.createUI(this)); } }
/** * Resets the UI property to a value from the current look and feel. * * @see JComponent#updateUI */
Resets the UI property to a value from the current look and feel
updateUI
{ "repo_name": "Mindtoeye/Hoop", "path": "src/org/pushingpixels/flamingo/api/common/JCommandToggleButton.java", "license": "lgpl-3.0", "size": 3605 }
[ "javax.swing.UIManager", "org.pushingpixels.flamingo.internal.ui.common.BasicCommandToggleButtonUI", "org.pushingpixels.flamingo.internal.ui.common.CommandButtonUI" ]
import javax.swing.UIManager; import org.pushingpixels.flamingo.internal.ui.common.BasicCommandToggleButtonUI; import org.pushingpixels.flamingo.internal.ui.common.CommandButtonUI;
import javax.swing.*; import org.pushingpixels.flamingo.internal.ui.common.*;
[ "javax.swing", "org.pushingpixels.flamingo" ]
javax.swing; org.pushingpixels.flamingo;
2,346,325
Job rescheduleTimeDurationJob(String jobId, String timeDuration);
Job rescheduleTimeDurationJob(String jobId, String timeDuration);
/** * Reschedule a timer job with a time duration. * * @param jobId * id of the timer job to reschedule, cannot be null. * @param timeDuration * How long the timer should run before it is fired in ISO 8601 format. For example, PT10D means the timer will run for 10 da...
Reschedule a timer job with a time duration
rescheduleTimeDurationJob
{ "repo_name": "lsmall/flowable-engine", "path": "modules/flowable-engine/src/main/java/org/flowable/engine/ManagementService.java", "license": "apache-2.0", "size": 15046 }
[ "org.flowable.job.api.Job" ]
import org.flowable.job.api.Job;
import org.flowable.job.api.*;
[ "org.flowable.job" ]
org.flowable.job;
1,045,764
static Dict<String, Object> buildSettings( BuildOptions buildOptions, Map<String, OptionInfo> optionInfoMap, StarlarkDefinedConfigTransition starlarkTransition) throws ValidationException { Map<String, String> inputsCanonicalizedToGiven = starlarkTransition.getInputsCanonicalizedTo...
static Dict<String, Object> buildSettings( BuildOptions buildOptions, Map<String, OptionInfo> optionInfoMap, StarlarkDefinedConfigTransition starlarkTransition) throws ValidationException { Map<String, String> inputsCanonicalizedToGiven = starlarkTransition.getInputsCanonicalizedToGiven(); LinkedHashSet<String> remaini...
/** * Enter the options in buildOptions into a Starlark dictionary, and return the dictionary. * * @throws IllegalArgumentException If the method is unable to look up the value in buildOptions * corresponding to an entry in optionInfoMap * @throws RuntimeException If the field corresponding to an opt...
Enter the options in buildOptions into a Starlark dictionary, and return the dictionary
buildSettings
{ "repo_name": "cushon/bazel", "path": "src/main/java/com/google/devtools/build/lib/analysis/starlark/FunctionTransitionUtil.java", "license": "apache-2.0", "size": 21824 }
[ "com.google.common.base.Joiner", "com.google.common.collect.Sets", "com.google.devtools.build.lib.analysis.config.BuildOptions", "com.google.devtools.build.lib.analysis.config.FragmentOptions", "com.google.devtools.build.lib.analysis.config.StarlarkDefinedConfigTransition", "com.google.devtools.build.lib....
import com.google.common.base.Joiner; import com.google.common.collect.Sets; import com.google.devtools.build.lib.analysis.config.BuildOptions; import com.google.devtools.build.lib.analysis.config.FragmentOptions; import com.google.devtools.build.lib.analysis.config.StarlarkDefinedConfigTransition; import com.google.de...
import com.google.common.base.*; import com.google.common.collect.*; import com.google.devtools.build.lib.analysis.config.*; import com.google.devtools.build.lib.cmdline.*; import java.lang.reflect.*; import java.util.*; import net.starlark.java.eval.*;
[ "com.google.common", "com.google.devtools", "java.lang", "java.util", "net.starlark.java" ]
com.google.common; com.google.devtools; java.lang; java.util; net.starlark.java;
1,196,266
public synchronized PrimaryContext startRelocationHandoff(String targetAllocationId) { assert invariant(); assert primaryMode; assert handoffInProgress == false; assert pendingInSync.isEmpty() : "relocation handoff started while there are still shard copies pending in-sync: " + pendi...
synchronized PrimaryContext function(String targetAllocationId) { assert invariant(); assert primaryMode; assert handoffInProgress == false; assert pendingInSync.isEmpty() : STR + pendingInSync; if (checkpoints.containsKey(targetAllocationId) == false) { throw new IllegalStateException(STR + targetAllocationId + STR); ...
/** * Initiates a relocation handoff and returns the corresponding primary context. */
Initiates a relocation handoff and returns the corresponding primary context
startRelocationHandoff
{ "repo_name": "nknize/elasticsearch", "path": "server/src/main/java/org/elasticsearch/index/seqno/ReplicationTracker.java", "license": "apache-2.0", "size": 79067 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,283,752
public boolean finish(boolean commit) throws IgniteCheckedException;
boolean function(boolean commit) throws IgniteCheckedException;
/** * Finishes transaction (either commit or rollback). * * @param commit {@code True} if commit, {@code false} if rollback. * @return {@code True} if state has been changed. * @throws IgniteCheckedException If finish failed. */
Finishes transaction (either commit or rollback)
finish
{ "repo_name": "agura/incubator-ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java", "license": "apache-2.0", "size": 6893 }
[ "org.apache.ignite.IgniteCheckedException" ]
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,888,532
public static void addSaslMechs(Collection<String> mechs) { for (String mech : mechs) { addSaslMech(mech); } }
static void function(Collection<String> mechs) { for (String mech : mechs) { addSaslMech(mech); } }
/** * Add a Collection of SASL mechanisms to the list to be used. * * @param mechs the Collection of SASL mechanisms to be added */
Add a Collection of SASL mechanisms to the list to be used
addSaslMechs
{ "repo_name": "igniterealtime/Smack", "path": "smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java", "license": "apache-2.0", "size": 13690 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,517,794
@Query("select new " + "org.helianto.core.internal.SimpleCounter(" + " report_.id" + ", count(report_.id)" + ", max(reportJournal_.issueDate)" + ") " + "from Report report_ " + "join report_.reportJournals reportJournal_ " + "where reportJournal_.user.id = ?1 " + "and report_.res...
@Query(STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR) List<SimpleCounter> findByReportCheckIn(int userId);
/** * Last user journal report check-in. * * @param userId */
Last user journal report check-in
findByReportCheckIn
{ "repo_name": "eldevanjr/helianto-plan", "path": "src/main/java/org/helianto/task/repository/ReportJournalRepository.java", "license": "apache-2.0", "size": 3235 }
[ "java.util.List", "org.helianto.core.internal.SimpleCounter", "org.springframework.data.jpa.repository.Query" ]
import java.util.List; import org.helianto.core.internal.SimpleCounter; import org.springframework.data.jpa.repository.Query;
import java.util.*; import org.helianto.core.internal.*; import org.springframework.data.jpa.repository.*;
[ "java.util", "org.helianto.core", "org.springframework.data" ]
java.util; org.helianto.core; org.springframework.data;
206,965
public static Throwable catchThrowable(ThrowingCallable shouldRaiseThrowable) { return AssertionsForClassTypes.catchThrowable(shouldRaiseThrowable); } /** * Entry point to check that an exception of type T is thrown by a given {@code throwingCallable}
static Throwable function(ThrowingCallable shouldRaiseThrowable) { return AssertionsForClassTypes.catchThrowable(shouldRaiseThrowable); } /** * Entry point to check that an exception of type T is thrown by a given {@code throwingCallable}
/** * Allows to catch an {@link Throwable} more easily when used with Java 8 lambdas. * * <p> * This caught {@link Throwable} can then be asserted. * </p> * * <p> * Example: * </p> * * <pre><code class='java'> {@literal @}Test * public void testException() { * // when * T...
Allows to catch an <code>Throwable</code> more easily when used with Java 8 lambdas. This caught <code>Throwable</code> can then be asserted. Example: <code> @Test public void testException() { when Throwable thrown = catchThrowable(() -> { throw new Exception("boom!"); }); then assertThat(thrown).isInstanceOf(Exceptio...
catchThrowable
{ "repo_name": "lpandzic/assertj-core", "path": "src/main/java/org/assertj/core/api/Assertions.java", "license": "apache-2.0", "size": 64122 }
[ "org.assertj.core.api.ThrowableAssert" ]
import org.assertj.core.api.ThrowableAssert;
import org.assertj.core.api.*;
[ "org.assertj.core" ]
org.assertj.core;
816,821
private SetMultimap<Type, Coder<?>> getTypeToCoderBindings(Type type, Coder<?> coder) { checkArgument(type != null); checkArgument(coder != null); if (type instanceof TypeVariable || type instanceof Class) { return ImmutableSetMultimap.of(type, coder); } else if (type instanceof ParameterizedTyp...
SetMultimap<Type, Coder<?>> function(Type type, Coder<?> coder) { checkArgument(type != null); checkArgument(coder != null); if (type instanceof TypeVariable type instanceof Class) { return ImmutableSetMultimap.of(type, coder); } else if (type instanceof ParameterizedType) { return getTypeToCoderBindings((Parameterized...
/** * Returns an immutable {@code SetMultimap} from each of the type variables embedded in the given * type to the corresponding types in the given {@link Coder}. */
Returns an immutable SetMultimap from each of the type variables embedded in the given type to the corresponding types in the given <code>Coder</code>
getTypeToCoderBindings
{ "repo_name": "lukecwik/incubator-beam", "path": "sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java", "license": "apache-2.0", "size": 33315 }
[ "java.lang.reflect.ParameterizedType", "java.lang.reflect.Type", "java.lang.reflect.TypeVariable", "org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions", "org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableSetMultimap", "org.apache.beam.vendor.guava.v26_0_jre...
import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableSetMultimap; import org.apache.beam.vendo...
import java.lang.reflect.*; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.*; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.*;
[ "java.lang", "org.apache.beam" ]
java.lang; org.apache.beam;
1,469,392
public BiomeGenBase getBiomeGenAt(int par1, int par2) { return this.biomeCache.getBiomeGenAt(par1, par2); }
BiomeGenBase function(int par1, int par2) { return this.biomeCache.getBiomeGenAt(par1, par2); }
/** * Returns the BiomeGenBase related to the x, z position on the world. */
Returns the BiomeGenBase related to the x, z position on the world
getBiomeGenAt
{ "repo_name": "DirectCodeGraveyard/Minetweak", "path": "src/main/java/net/minecraft/world/chunk/WorldChunkManager.java", "license": "lgpl-3.0", "size": 7931 }
[ "net.minecraft.world.biome.BiomeGenBase" ]
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.*;
[ "net.minecraft.world" ]
net.minecraft.world;
1,529,598
public CreateTranscodingJobResponse createTranscodingJob( String pipelineName, String sourceKey, String targetKey, String presetName) { return createTranscodingJob(pipelineName, sourceKey, targetKey, presetName, null, null); }
CreateTranscodingJobResponse function( String pipelineName, String sourceKey, String targetKey, String presetName) { return createTranscodingJob(pipelineName, sourceKey, targetKey, presetName, null, null); }
/** * Creates a new transcoder job which converts media files in BOS buckets with specified preset. * * @param pipelineName The name of pipeline used by this job. * @param sourceKey The key of the source media file in the bucket specified in the pipeline. * @param targetKey The key of the...
Creates a new transcoder job which converts media files in BOS buckets with specified preset
createTranscodingJob
{ "repo_name": "baidubce/bce-sdk-java", "path": "src/main/java/com/baidubce/services/media/MediaClient.java", "license": "apache-2.0", "size": 91398 }
[ "com.baidubce.services.media.model.CreateTranscodingJobResponse" ]
import com.baidubce.services.media.model.CreateTranscodingJobResponse;
import com.baidubce.services.media.model.*;
[ "com.baidubce.services" ]
com.baidubce.services;
1,847,265
public static MultivaluedMap<String, String> decode(MultivaluedMap<String, String> map, String charset) { if (charset == null) { charset = UTF_8; } MultivaluedMap<String, String> decoded = new QuarkusMultivaluedHashMap<String, String>(); for (Map.Entry<String, List<String...
static MultivaluedMap<String, String> function(MultivaluedMap<String, String> map, String charset) { if (charset == null) { charset = UTF_8; } MultivaluedMap<String, String> decoded = new QuarkusMultivaluedHashMap<String, String>(); for (Map.Entry<String, List<String>> entry : map.entrySet()) { List<String> values = en...
/** * decode an encoded map * * @param map map * @param charset charset * @return decoded map */
decode an encoded map
decode
{ "repo_name": "quarkusio/quarkus", "path": "independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/util/Encode.java", "license": "apache-2.0", "size": 17935 }
[ "java.io.UnsupportedEncodingException", "java.net.URLDecoder", "java.util.List", "java.util.Map", "javax.ws.rs.core.MultivaluedMap" ]
import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.List; import java.util.Map; import javax.ws.rs.core.MultivaluedMap;
import java.io.*; import java.net.*; import java.util.*; import javax.ws.rs.core.*;
[ "java.io", "java.net", "java.util", "javax.ws" ]
java.io; java.net; java.util; javax.ws;
940,551
private void formatButton(JToggleButton button, String text) { button.setOpaque(false); button.setBackground(UIUtilities.BACKGROUND_COLOR); button.setBorder(new EmptyBorder(2, 2, 2, 2)); button.setToolTipText(text); }
void function(JToggleButton button, String text) { button.setOpaque(false); button.setBackground(UIUtilities.BACKGROUND_COLOR); button.setBorder(new EmptyBorder(2, 2, 2, 2)); button.setToolTipText(text); }
/** * Formats the specified button. * * @param button The button to handle. * @param text The tool tip text. * @param actionID The action command id. */
Formats the specified button
formatButton
{ "repo_name": "joansmith/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/PropertiesUI.java", "license": "gpl-2.0", "size": 47623 }
[ "javax.swing.JToggleButton", "javax.swing.border.EmptyBorder", "org.openmicroscopy.shoola.util.ui.UIUtilities" ]
import javax.swing.JToggleButton; import javax.swing.border.EmptyBorder; import org.openmicroscopy.shoola.util.ui.UIUtilities;
import javax.swing.*; import javax.swing.border.*; import org.openmicroscopy.shoola.util.ui.*;
[ "javax.swing", "org.openmicroscopy.shoola" ]
javax.swing; org.openmicroscopy.shoola;
813,286
@Override public long getValueLong(String key) { Object o = this.getValue(key); if (o == null) return 0; if (AtomicLong.class.isAssignableFrom(o.getClass())) { return AtomicLong.class.cast(o).get(); } else { return 0; } }
long function(String key) { Object o = this.getValue(key); if (o == null) return 0; if (AtomicLong.class.isAssignableFrom(o.getClass())) { return AtomicLong.class.cast(o).get(); } else { return 0; } }
/** * get the value as long type */
get the value as long type
getValueLong
{ "repo_name": "xxxllluuu/uavstack", "path": "com.creditease.uav.monitorframework/src/main/java/com/creditease/monitor/captureframework/repository/StandardMonitorElementInstance.java", "license": "apache-2.0", "size": 10691 }
[ "java.util.concurrent.atomic.AtomicLong" ]
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.*;
[ "java.util" ]
java.util;
554,559
public void forEachByteArrayThrowingIOException( final ByteArrayConsumerThrowsIOException byteArrayConsumerThrowsIOException) throws IOException { for (final Resource resource : this) { try (Resource resourceToClose = resource) { final byte[] resourceContent = resourc...
void function( final ByteArrayConsumerThrowsIOException byteArrayConsumerThrowsIOException) throws IOException { for (final Resource resource : this) { try (Resource resourceToClose = resource) { final byte[] resourceContent = resource.load(); byteArrayConsumerThrowsIOException.accept(resource, resourceContent); } } }
/** * Fetch the content of each {@link Resource} in this {@link ResourceList} as a byte array, pass the byte array * to the given {@link ByteArrayConsumer}, then close the underlying InputStream or release the underlying * ByteBuffer by calling {@link Resource#close()}. * * @param byteArrayCon...
Fetch the content of each <code>Resource</code> in this <code>ResourceList</code> as a byte array, pass the byte array to the given <code>ByteArrayConsumer</code>, then close the underlying InputStream or release the underlying ByteBuffer by calling <code>Resource#close()</code>
forEachByteArrayThrowingIOException
{ "repo_name": "classgraph/classgraph", "path": "src/main/java/io/github/classgraph/ResourceList.java", "license": "mit", "size": 30542 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,153,940
public static void save(Document doc, String location) throws TransformerException { doc.normalize(); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource source = new DOMSource(doc); ...
static void function(Document doc, String location) throws TransformerException { doc.normalize(); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource source = new DOMSource(doc); StreamResult streamResult = new StreamResult(...
/** * Stores an XMl document into a file. * * @param doc xml document to be stored * @param location absolute path where to write down the document * @throws TransformerException If an unrecoverable error occurs during the * course of the transformation. */
Stores an XMl document into a file
save
{ "repo_name": "flordan/final", "path": "code/programmingModel/parallelizer/src/main/java/es/bsc/mobile/parallelizer/utils/XMLUtils.java", "license": "apache-2.0", "size": 3512 }
[ "java.io.File", "javax.xml.transform.Transformer", "javax.xml.transform.TransformerException", "javax.xml.transform.TransformerFactory", "javax.xml.transform.dom.DOMSource", "javax.xml.transform.stream.StreamResult", "org.w3c.dom.Document" ]
import java.io.File; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.w3c.dom.Document;
import java.io.*; import javax.xml.transform.*; import javax.xml.transform.dom.*; import javax.xml.transform.stream.*; import org.w3c.dom.*;
[ "java.io", "javax.xml", "org.w3c.dom" ]
java.io; javax.xml; org.w3c.dom;
2,749,247
public static <T extends Tree> Matcher<T> isSameType(Type type) { return new IsSameType<>(type); }
static <T extends Tree> Matcher<T> function(Type type) { return new IsSameType<>(type); }
/** * Matches an AST node if its type is the same as the given type. * * @param type the type to check against */
Matches an AST node if its type is the same as the given type
isSameType
{ "repo_name": "davidzchen/error-prone", "path": "core/src/main/java/com/google/errorprone/matchers/Matchers.java", "license": "apache-2.0", "size": 46821 }
[ "com.sun.source.tree.Tree", "com.sun.tools.javac.code.Type" ]
import com.sun.source.tree.Tree; import com.sun.tools.javac.code.Type;
import com.sun.source.tree.*; import com.sun.tools.javac.code.*;
[ "com.sun.source", "com.sun.tools" ]
com.sun.source; com.sun.tools;
1,742,011
public BigFraction subtract(final BigFraction fraction) { if (fraction == null) { throw new NullArgumentException(LocalizedFormats.FRACTION); } if (ZERO.equals(fraction)) { return this; } BigInteger num = null; BigInteger den = null; i...
BigFraction function(final BigFraction fraction) { if (fraction == null) { throw new NullArgumentException(LocalizedFormats.FRACTION); } if (ZERO.equals(fraction)) { return this; } BigInteger num = null; BigInteger den = null; if (denominator.equals(fraction.denominator)) { num = numerator.subtract(fraction.numerator);...
/** * <p> * Subtracts the value of another fraction from the value of this one, * returning the result in reduced form. * </p> * * @param fraction {@link BigFraction} to subtract, must not be {@code null}. * @return a {@link BigFraction} instance with the resulting values * @thro...
Subtracts the value of another fraction from the value of this one, returning the result in reduced form.
subtract
{ "repo_name": "martingwhite/astor", "path": "examples/math_50v2/src/main/java/org/apache/commons/math/fraction/BigFraction.java", "license": "gpl-2.0", "size": 37396 }
[ "java.math.BigInteger", "org.apache.commons.math.exception.NullArgumentException", "org.apache.commons.math.exception.util.LocalizedFormats" ]
import java.math.BigInteger; import org.apache.commons.math.exception.NullArgumentException; import org.apache.commons.math.exception.util.LocalizedFormats;
import java.math.*; import org.apache.commons.math.exception.*; import org.apache.commons.math.exception.util.*;
[ "java.math", "org.apache.commons" ]
java.math; org.apache.commons;
2,777,471
public void makeColumnDrop(StringBuilder b, Attribute attribute) throws SQLException { b.append("DROP "); b.append(makeColumnIdentifier(attribute)); b.append(" CASCADE"); }
void function(StringBuilder b, Attribute attribute) throws SQLException { b.append(STR); b.append(makeColumnIdentifier(attribute)); b.append(STR); }
/** * This will create an add statement for the given role that can be used for constructing * a table alteration. */
This will create an add statement for the given role that can be used for constructing a table alteration
makeColumnDrop
{ "repo_name": "aborg0/rapidminer-vega", "path": "src/com/rapidminer/tools/jdbc/StatementCreator.java", "license": "agpl-3.0", "size": 16511 }
[ "com.rapidminer.example.Attribute", "java.sql.SQLException" ]
import com.rapidminer.example.Attribute; import java.sql.SQLException;
import com.rapidminer.example.*; import java.sql.*;
[ "com.rapidminer.example", "java.sql" ]
com.rapidminer.example; java.sql;
2,459,878
public URL getURL() { try { return new URL("http", socket.getInetAddress().getHostAddress(), socket.getLocalPort(), "/test"); } catch (MalformedURLException e) { throw new RuntimeException(e); } }
URL function() { try { return new URL("http", socket.getInetAddress().getHostAddress(), socket.getLocalPort(), "/test"); } catch (MalformedURLException e) { throw new RuntimeException(e); } }
/** * get current url (depends on local address & port) * @return url */
get current url (depends on local address & port)
getURL
{ "repo_name": "SvenEwald/xmlbeam", "path": "src/test/java/org/xmlbeam/testutils/HTTPParrot.java", "license": "apache-2.0", "size": 3023 }
[ "java.net.MalformedURLException" ]
import java.net.MalformedURLException;
import java.net.*;
[ "java.net" ]
java.net;
2,808,016
void removeKeySignalListener(KeySignalListener listener);
void removeKeySignalListener(KeySignalListener listener);
/** * Removes a key signal event listener. * @param listener */
Removes a key signal event listener
removeKeySignalListener
{ "repo_name": "wisebaldone/incubator-wave", "path": "wave/src/main/java/org/waveprotocol/wave/client/editor/Editor.java", "license": "apache-2.0", "size": 7567 }
[ "org.waveprotocol.wave.client.common.util.KeySignalListener" ]
import org.waveprotocol.wave.client.common.util.KeySignalListener;
import org.waveprotocol.wave.client.common.util.*;
[ "org.waveprotocol.wave" ]
org.waveprotocol.wave;
968,814
@ApiModelProperty(example = "null", value = "") public List<LocalizedValue> getNames() { return names; }
@ApiModelProperty(example = "null", value = "") List<LocalizedValue> function() { return names; }
/** * Get names * @return names **/
Get names
getNames
{ "repo_name": "Metatavu/kunta-api-spec", "path": "java-client-generated/src/main/java/fi/metatavu/kuntaapi/client/model/Law.java", "license": "agpl-3.0", "size": 3584 }
[ "fi.metatavu.kuntaapi.client.model.LocalizedValue", "io.swagger.annotations.ApiModelProperty", "java.util.List" ]
import fi.metatavu.kuntaapi.client.model.LocalizedValue; import io.swagger.annotations.ApiModelProperty; import java.util.List;
import fi.metatavu.kuntaapi.client.model.*; import io.swagger.annotations.*; import java.util.*;
[ "fi.metatavu.kuntaapi", "io.swagger.annotations", "java.util" ]
fi.metatavu.kuntaapi; io.swagger.annotations; java.util;
2,705,931
public default void disable(ModemDevice modemDevice) throws KuraException { if (modemDevice instanceof UsbModemDevice) { disable(((UsbModemDevice) modemDevice).getVendorId(), ((UsbModemDevice) modemDevice).getProductId()); } else { throw new KuraException(KuraErrorCode.OPERAT...
default void function(ModemDevice modemDevice) throws KuraException { if (modemDevice instanceof UsbModemDevice) { disable(((UsbModemDevice) modemDevice).getVendorId(), ((UsbModemDevice) modemDevice).getProductId()); } else { throw new KuraException(KuraErrorCode.OPERATION_NOT_SUPPORTED); } }
/** * Disables the resource specified by the passed parameters * * @param modemDevice * @throws KuraException * @since 1.1 */
Disables the resource specified by the passed parameters
disable
{ "repo_name": "nicolatimeus/kura", "path": "kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/internal/linux/net/modem/GatewayModemDriver.java", "license": "epl-1.0", "size": 4572 }
[ "org.eclipse.kura.KuraErrorCode", "org.eclipse.kura.KuraException", "org.eclipse.kura.net.modem.ModemDevice", "org.eclipse.kura.usb.UsbModemDevice" ]
import org.eclipse.kura.KuraErrorCode; import org.eclipse.kura.KuraException; import org.eclipse.kura.net.modem.ModemDevice; import org.eclipse.kura.usb.UsbModemDevice;
import org.eclipse.kura.*; import org.eclipse.kura.net.modem.*; import org.eclipse.kura.usb.*;
[ "org.eclipse.kura" ]
org.eclipse.kura;
439,196
public static <T> List<T> asList(@Nullable T t) { return t == null ? Collections.<T>emptyList() : Collections.singletonList(t); }
static <T> List<T> function(@Nullable T t) { return t == null ? Collections.<T>emptyList() : Collections.singletonList(t); }
/** * Creates read-only list with given values. * * @param t Element (if {@code null}, then empty list is returned). * @param <T> Element's type. * @return Created list. */
Creates read-only list with given values
asList
{ "repo_name": "f7753/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java", "license": "apache-2.0", "size": 159864 }
[ "java.util.Collections", "java.util.List", "org.jetbrains.annotations.Nullable" ]
import java.util.Collections; import java.util.List; import org.jetbrains.annotations.Nullable;
import java.util.*; import org.jetbrains.annotations.*;
[ "java.util", "org.jetbrains.annotations" ]
java.util; org.jetbrains.annotations;
607,217
public MetricsTimeVaryingRate getTaskLaunchMsecs() { return null; }
MetricsTimeVaryingRate function() { return null; }
/** * Get the metrics for the task launch msecs. * * @return Metrics for task launch msecs. Returns null if no such metric * exists. */
Get the metrics for the task launch msecs
getTaskLaunchMsecs
{ "repo_name": "iVCE/RDFS", "path": "src/mapred/org/apache/hadoop/mapred/TaskTrackerInstrumentation.java", "license": "apache-2.0", "size": 3016 }
[ "org.apache.hadoop.metrics.util.MetricsTimeVaryingRate" ]
import org.apache.hadoop.metrics.util.MetricsTimeVaryingRate;
import org.apache.hadoop.metrics.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
202,147
public final ObservableMap<String, Object> getMetadata() { return metadata; } private final ObservableMap<String,Object> metadataBacking = FXCollections.observableMap(new HashMap<String,Object>()); private ReadOnlyIntegerWrapper width;
final ObservableMap<String, Object> function() { return metadata; } private final ObservableMap<String,Object> metadataBacking = FXCollections.observableMap(new HashMap<String,Object>()); private ReadOnlyIntegerWrapper width;
/** * Retrieve the metadata contained in this media source. If there are * no metadata, the returned {@link ObservableMap} will be empty. * @return the metadata contained in this media source. */
Retrieve the metadata contained in this media source. If there are no metadata, the returned <code>ObservableMap</code> will be empty
getMetadata
{ "repo_name": "teamfx/openjfx-10-dev-rt", "path": "modules/javafx.media/src/main/java/javafx/scene/media/Media.java", "license": "gpl-2.0", "size": 22706 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,725,383
public static String getStamp() { return TimeFormatUtils.getStamp(); }
static String function() { return TimeFormatUtils.getStamp(); }
/** * Gets stamp. * * @return the stamp */
Gets stamp
getStamp
{ "repo_name": "pepperonas/AndBasx", "path": "library/src/main/java/com/pepperonas/andbasx/format/TimeFormatUtilsLocalized.java", "license": "apache-2.0", "size": 5951 }
[ "com.pepperonas.jbasx.format.TimeFormatUtils" ]
import com.pepperonas.jbasx.format.TimeFormatUtils;
import com.pepperonas.jbasx.format.*;
[ "com.pepperonas.jbasx" ]
com.pepperonas.jbasx;
2,497,438
public static <I extends IInstance> I replaceHostAndStart(AbstractCluster<I> cluster, IInstance toReplace) { return replaceHostAndStart(cluster, toReplace, ignore -> {}); }
static <I extends IInstance> I function(AbstractCluster<I> cluster, IInstance toReplace) { return replaceHostAndStart(cluster, toReplace, ignore -> {}); }
/** * Create and start a new instance that replaces an existing instance. * * The instance will be in the same datacenter and rack as the existing instance. * * @param cluster to add to * @param toReplace instance to replace * @param <I> instance type * @return the instance added...
Create and start a new instance that replaces an existing instance. The instance will be in the same datacenter and rack as the existing instance
replaceHostAndStart
{ "repo_name": "aholmberg/cassandra", "path": "test/distributed/org/apache/cassandra/distributed/shared/ClusterUtils.java", "license": "apache-2.0", "size": 32254 }
[ "org.apache.cassandra.distributed.api.IInstance", "org.apache.cassandra.distributed.impl.AbstractCluster" ]
import org.apache.cassandra.distributed.api.IInstance; import org.apache.cassandra.distributed.impl.AbstractCluster;
import org.apache.cassandra.distributed.api.*; import org.apache.cassandra.distributed.impl.*;
[ "org.apache.cassandra" ]
org.apache.cassandra;
1,269,459
protected final T getRow(BPlusIO<L> io, long pageAddr, int idx) throws IgniteCheckedException { return getRow(io, pageAddr, idx, null); }
final T function(BPlusIO<L> io, long pageAddr, int idx) throws IgniteCheckedException { return getRow(io, pageAddr, idx, null); }
/** * Get a full detached data row. * * @param io IO. * @param pageAddr Page address. * @param idx Index. * @return Full detached data row. * @throws IgniteCheckedException If failed. */
Get a full detached data row
getRow
{ "repo_name": "a1vanov/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/database/tree/BPlusTree.java", "license": "apache-2.0", "size": 153676 }
[ "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.internal.processors.cache.database.tree.io.BPlusIO" ]
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.processors.cache.database.tree.io.BPlusIO;
import org.apache.ignite.*; import org.apache.ignite.internal.processors.cache.database.tree.io.*;
[ "org.apache.ignite" ]
org.apache.ignite;
1,965,865
ThreadLocalRandom random = ThreadLocalRandom.current(); for (int i = inArr.length -1 ; i > 0; i--) { int index = random.nextInt(i+1); String t = inArr[i]; inArr[i] = inArr[index]; inArr[index] = t; } }
ThreadLocalRandom random = ThreadLocalRandom.current(); for (int i = inArr.length -1 ; i > 0; i--) { int index = random.nextInt(i+1); String t = inArr[i]; inArr[i] = inArr[index]; inArr[index] = t; } }
/** * Shuffle Array in place. * @param inArr */
Shuffle Array in place
Shuffle
{ "repo_name": "wavefancy/Exome-Java", "path": "BIDMC/src/shortestPath/edu/princeton/cs/algs4/FisherYatesArrayShuffle.java", "license": "mit", "size": 2530 }
[ "java.util.concurrent.ThreadLocalRandom" ]
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,371,545