method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
static HttpData of(ByteBuf buf) {
requireNonNull(buf, "buf");
if (!buf.isReadable()) {
return EMPTY_DATA;
}
return of(ByteBufUtil.getBytes(buf));
} | static HttpData of(ByteBuf buf) { requireNonNull(buf, "buf"); if (!buf.isReadable()) { return EMPTY_DATA; } return of(ByteBufUtil.getBytes(buf)); } | /**
* Converts the specified Netty {@link ByteBuf} into an {@link HttpData}. Unlike {@link #of(byte[])}, this
* method makes a copy of the {@link ByteBuf}.
*
* @return a new {@link HttpData}. {@link #EMPTY_DATA} if the readable bytes of {@code buf} is 0.
*/ | Converts the specified Netty <code>ByteBuf</code> into an <code>HttpData</code>. Unlike <code>#of(byte[])</code>, this method makes a copy of the <code>ByteBuf</code> | of | {
"repo_name": "imasahiro/armeria",
"path": "core/src/main/java/com/linecorp/armeria/common/HttpData.java",
"license": "apache-2.0",
"size": 7987
} | [
"io.netty.buffer.ByteBuf",
"io.netty.buffer.ByteBufUtil",
"java.util.Objects"
] | import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; import java.util.Objects; | import io.netty.buffer.*; import java.util.*; | [
"io.netty.buffer",
"java.util"
] | io.netty.buffer; java.util; | 170,669 |
void afterDevelopmentVersionChange(boolean modified) throws IOException; | void afterDevelopmentVersionChange(boolean modified) throws IOException; | /**
* Event that is called after a change has been done in the descriptor/property file, if the file has been modified
* an SCM operation of commit will occur.
*
* @param modified Flag to determine whether a modification has occurred within the descriptor/property file.
*/ | Event that is called after a change has been done in the descriptor/property file, if the file has been modified an SCM operation of commit will occur | afterDevelopmentVersionChange | {
"repo_name": "DimaNevelev/my-temp-bamboo",
"path": "src/main/java/org/jfrog/bamboo/release/provider/ReleaseProvider.java",
"license": "apache-2.0",
"size": 5726
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,706,841 |
@SuppressWarnings("unchecked")
protected String constructLabelValue(Object newValue) {
String caption = getMessageService().getMessage("ocs.no.item.selected", VaadinUtils.getLocale());
if (newValue instanceof Collection<?>) {
Collection<T> col = (Collection<T>) newValue;
... | @SuppressWarnings(STR) String function(Object newValue) { String caption = getMessageService().getMessage(STR, VaadinUtils.getLocale()); if (newValue instanceof Collection<?>) { Collection<T> col = (Collection<T>) newValue; if (!col.isEmpty()) { caption = EntityModelUtils.getDisplayPropertyValue(col, getEntityModel(), ... | /**
* Gets the value that must be displayed on the label that shows which items are
* currently selected
*
* @param newValue the new value
* @return
*/ | Gets the value that must be displayed on the label that shows which items are currently selected | constructLabelValue | {
"repo_name": "opencirclesolutions/dynamo",
"path": "dynamo-frontend/src/main/java/com/ocs/dynamo/ui/component/EntityLookupField.java",
"license": "apache-2.0",
"size": 13585
} | [
"com.ocs.dynamo.ui.utils.VaadinUtils",
"com.ocs.dynamo.util.SystemPropertyUtils",
"com.ocs.dynamo.utils.EntityModelUtils",
"java.util.Collection"
] | import com.ocs.dynamo.ui.utils.VaadinUtils; import com.ocs.dynamo.util.SystemPropertyUtils; import com.ocs.dynamo.utils.EntityModelUtils; import java.util.Collection; | import com.ocs.dynamo.ui.utils.*; import com.ocs.dynamo.util.*; import com.ocs.dynamo.utils.*; import java.util.*; | [
"com.ocs.dynamo",
"java.util"
] | com.ocs.dynamo; java.util; | 151,042 |
private static void preloadResources() {
final VMRuntime runtime = VMRuntime.getRuntime();
try {
mResources = Resources.getSystem();
mResources.startPreloading();
if (PRELOAD_RESOURCES) {
Log.i(TAG, "Preloading resources...");
lon... | static void function() { final VMRuntime runtime = VMRuntime.getRuntime(); try { mResources = Resources.getSystem(); mResources.startPreloading(); if (PRELOAD_RESOURCES) { Log.i(TAG, STR); long startTime = SystemClock.uptimeMillis(); TypedArray ar = mResources.obtainTypedArray( com.android.internal.R.array.preloaded_dr... | /**
* Load in commonly used resources, so they can be shared across
* processes.
*
* These tend to be a few Kbytes, but are frequently in the 20-40K
* range, and occasionally even larger.
*/ | Load in commonly used resources, so they can be shared across processes. These tend to be a few Kbytes, but are frequently in the 20-40K range, and occasionally even larger | preloadResources | {
"repo_name": "szpaddy/android-4.1.2_r2-core",
"path": "java/com/android/internal/os/ZygoteInit.java",
"license": "apache-2.0",
"size": 27453
} | [
"android.content.res.Resources",
"android.content.res.TypedArray",
"android.os.SystemClock",
"android.util.Log"
] | import android.content.res.Resources; import android.content.res.TypedArray; import android.os.SystemClock; import android.util.Log; | import android.content.res.*; import android.os.*; import android.util.*; | [
"android.content",
"android.os",
"android.util"
] | android.content; android.os; android.util; | 2,673,575 |
private DocumentRouteHeaderValue notifyPostProcessorBeforeProcess(DocumentRouteHeaderValue document, String nodeInstanceId, BeforeProcessEvent event) {
ProcessDocReport report = null;
try {
PostProcessor postProcessor = null;
// use the document's post processor unless specif... | DocumentRouteHeaderValue function(DocumentRouteHeaderValue document, String nodeInstanceId, BeforeProcessEvent event) { ProcessDocReport report = null; try { PostProcessor postProcessor = null; if (!isRunPostProcessorLogic()) { postProcessor = new DefaultPostProcessor(); } else { postProcessor = document.getDocumentTyp... | /**
* TODO get the routeContext in this method - it should be a better object
* than the nodeInstance
*/ | TODO get the routeContext in this method - it should be a better object than the nodeInstance | notifyPostProcessorBeforeProcess | {
"repo_name": "bsmith83/rice-1",
"path": "rice-middleware/impl/src/main/java/org/kuali/rice/kew/engine/StandardWorkflowEngine.java",
"license": "apache-2.0",
"size": 34116
} | [
"org.kuali.rice.kew.exception.RouteManagerException",
"org.kuali.rice.kew.framework.postprocessor.BeforeProcessEvent",
"org.kuali.rice.kew.framework.postprocessor.PostProcessor",
"org.kuali.rice.kew.framework.postprocessor.ProcessDocReport",
"org.kuali.rice.kew.postprocessor.DefaultPostProcessor",
"org.ku... | import org.kuali.rice.kew.exception.RouteManagerException; import org.kuali.rice.kew.framework.postprocessor.BeforeProcessEvent; import org.kuali.rice.kew.framework.postprocessor.PostProcessor; import org.kuali.rice.kew.framework.postprocessor.ProcessDocReport; import org.kuali.rice.kew.postprocessor.DefaultPostProcess... | import org.kuali.rice.kew.exception.*; import org.kuali.rice.kew.framework.postprocessor.*; import org.kuali.rice.kew.postprocessor.*; import org.kuali.rice.kew.routeheader.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 2,655,029 |
void getData(String filename, double minSupport) throws IOException {
numOfTrans = 0;
// (1) Scan the database and count the support of each item.
// The support of items is stored in map where
// key = item value = support count
Map<Integer, Integer> mapItemCount = new HashMap<Integer, Integer>();
// s... | void getData(String filename, double minSupport) throws IOException { numOfTrans = 0; Map<Integer, Integer> mapItemCount = new HashMap<Integer, Integer>(); BufferedReader reader = new BufferedReader(new FileReader(filename)); String line; while (((line = reader.readLine()) != null)) { if (line.isEmpty() == true line.ch... | /**
* Read the input file to find the frequent items
*
* @param filename
* input file name
* @param minSupport
* @throws IOException
*/ | Read the input file to find the frequent items | getData | {
"repo_name": "ArneBinder/LanguageAnalyzer",
"path": "src/main/java/ca/pfv/spmf/algorithms/frequentpatterns/fin_prepost/FIN.java",
"license": "gpl-3.0",
"size": 19287
} | [
"java.io.BufferedReader",
"java.io.FileReader",
"java.io.IOException",
"java.util.Arrays",
"java.util.HashMap",
"java.util.Map"
] | import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.Map; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,249,612 |
public static void recordAutoUpdateCompletion(CommCareApp app) {
updateAutoUpdateInProgressPref(app, false);
} | static void function(CommCareApp app) { updateAutoUpdateInProgressPref(app, false); } | /**
* Record that auto-updating has finished or been cancelled from too many
* retries. Used upon login to know whether to resume an auto-update check.
*/ | Record that auto-updating has finished or been cancelled from too many retries. Used upon login to know whether to resume an auto-update check | recordAutoUpdateCompletion | {
"repo_name": "dimagi/commcare-android",
"path": "app/src/org/commcare/engine/resource/ResourceInstallUtils.java",
"license": "apache-2.0",
"size": 10754
} | [
"org.commcare.CommCareApp"
] | import org.commcare.CommCareApp; | import org.commcare.*; | [
"org.commcare"
] | org.commcare; | 1,661,731 |
@NotNull
private List<String> getPackageVersionsFromAdditionalRepositories(@NotNull String packageName) throws IOException {
return getCachedValueOrRethrowIO(myAdditionalPackagesReleases, packageName);
} | List<String> function(@NotNull String packageName) throws IOException { return getCachedValueOrRethrowIO(myAdditionalPackagesReleases, packageName); } | /**
* Fetches available package versions by scrapping the page containing package archives.
* It's primarily used for additional repositories since, e.g. devpi doesn't provide another way to get this information.
*/ | Fetches available package versions by scrapping the page containing package archives. It's primarily used for additional repositories since, e.g. devpi doesn't provide another way to get this information | getPackageVersionsFromAdditionalRepositories | {
"repo_name": "paplorinc/intellij-community",
"path": "python/src/com/jetbrains/python/packaging/PyPIPackageUtil.java",
"license": "apache-2.0",
"size": 17550
} | [
"java.io.IOException",
"java.util.List",
"org.jetbrains.annotations.NotNull"
] | import java.io.IOException; import java.util.List; import org.jetbrains.annotations.NotNull; | import java.io.*; import java.util.*; import org.jetbrains.annotations.*; | [
"java.io",
"java.util",
"org.jetbrains.annotations"
] | java.io; java.util; org.jetbrains.annotations; | 10,500 |
public static void createUserClusterOperator(ConnectionParams connectionParams, String clusterName,
String userName, String password) throws Exception {
createUser(connectionParams, clusterName, userName, password, AmbariUserRole.CLUSTER_OPERATOR);
} | static void function(ConnectionParams connectionParams, String clusterName, String userName, String password) throws Exception { createUser(connectionParams, clusterName, userName, password, AmbariUserRole.CLUSTER_OPERATOR); } | /**
* Creates a user with CLUSTER.OPERATOR privilege
*
* @param connectionParams
* @param clusterName
* @param userName
* @param password
* @throws Exception
*/ | Creates a user with CLUSTER.OPERATOR privilege | createUserClusterOperator | {
"repo_name": "alexryndin/ambari",
"path": "ambari-funtest/src/test/java/org/apache/ambari/funtest/server/utils/ClusterUtils.java",
"license": "apache-2.0",
"size": 11612
} | [
"org.apache.ambari.funtest.server.AmbariUserRole",
"org.apache.ambari.funtest.server.ConnectionParams"
] | import org.apache.ambari.funtest.server.AmbariUserRole; import org.apache.ambari.funtest.server.ConnectionParams; | import org.apache.ambari.funtest.server.*; | [
"org.apache.ambari"
] | org.apache.ambari; | 2,014,020 |
public final void setReservedClasses(final File file) {
try {
reservedClasses = new ClassNameSet(file);
} catch (FileNotFoundException e) {
System.err.println("The file "
+ file.getAbsolutePath() + " does not exist.");
e.printStackTrace();
} catch (CNSFileFormatException e) {
System.err.prin... | final void function(final File file) { try { reservedClasses = new ClassNameSet(file); } catch (FileNotFoundException e) { System.err.println(STR + file.getAbsolutePath() + STR); e.printStackTrace(); } catch (CNSFileFormatException e) { System.err.println(STR + file.getAbsolutePath() + STR); e.printStackTrace(); } catc... | /**
* Set the reserved classes set to the ClassNameSet
* instance built from a cns file.
*
* @param file the java.io.File instance of the cns file
*/ | Set the reserved classes set to the ClassNameSet instance built from a cns file | setReservedClasses | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/tools/minijre/src/org/crazynut/harmony/minjre/JreGenerator.java",
"license": "apache-2.0",
"size": 10187
} | [
"java.io.File",
"java.io.FileNotFoundException",
"java.io.IOException"
] | import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 255,364 |
public static boolean validAll(CharSequence... lines) {
boolean valid = CollectionUtils.valid(lines);
if (valid) {
int length = lines.length;
CharSequence line;
for (int i = CollectionUtils.FIRST_INDEX; i < length && valid; i++) {
line = lines[i];
// TODO Think only second part of && is neede... | static boolean function(CharSequence... lines) { boolean valid = CollectionUtils.valid(lines); if (valid) { int length = lines.length; CharSequence line; for (int i = CollectionUtils.FIRST_INDEX; i < length && valid; i++) { line = lines[i]; valid = valid && valid(line); } } return valid; } | /**
* Checks if each of passed {@link CharSequence}s is not null and is not
* empty
*
* @param lines
* @return <code>boolean</code>
*/ | Checks if each of passed <code>CharSequence</code>s is not null and is not empty | validAll | {
"repo_name": "levants/lightmare",
"path": "lightmare-utils/src/main/java/org/lightmare/utils/StringUtils.java",
"license": "lgpl-2.1",
"size": 4904
} | [
"org.lightmare.utils.collections.CollectionUtils"
] | import org.lightmare.utils.collections.CollectionUtils; | import org.lightmare.utils.collections.*; | [
"org.lightmare.utils"
] | org.lightmare.utils; | 2,127,427 |
public final void error(Throwable t) {
int state = get();
if ((state & (FUSED_READY | FUSED_CONSUMED | TERMINATED | DISPOSED)) != 0) {
RxJavaPlugins.onError(t);
return;
}
lazySet(TERMINATED);
downstream.onError(t);
} | final void function(Throwable t) { int state = get(); if ((state & (FUSED_READY FUSED_CONSUMED TERMINATED DISPOSED)) != 0) { RxJavaPlugins.onError(t); return; } lazySet(TERMINATED); downstream.onError(t); } | /**
* Complete the target with an error signal.
* @param t the Throwable to signal, not null (not verified)
*/ | Complete the target with an error signal | error | {
"repo_name": "ReactiveX/RxJava",
"path": "src/main/java/io/reactivex/rxjava3/internal/observers/DeferredScalarDisposable.java",
"license": "apache-2.0",
"size": 4582
} | [
"io.reactivex.rxjava3.plugins.RxJavaPlugins"
] | import io.reactivex.rxjava3.plugins.RxJavaPlugins; | import io.reactivex.rxjava3.plugins.*; | [
"io.reactivex.rxjava3"
] | io.reactivex.rxjava3; | 2,876,857 |
public void refreshTimes() throws SQLException{
for (Intersection i : this.getConnections()) {
String sql = "SELECT Traffic.Delay FROM Traffic INNER JOIN (SELECT t.TrafficID FROM FromIntersection f INNER JOIN ToIntersection t ON t.trafficid = f.trafficid AND t.IntersectionID = ? AND f.IntersectionID = ?) t on T... | void function() throws SQLException{ for (Intersection i : this.getConnections()) { String sql = STR; PreparedStatement stmt = con.prepareStatement(sql); stmt.setInt(1, i.getID()); stmt.setInt(2, this.getID()); ResultSet result = stmt.executeQuery(); if(result.next()){ double del = result.getDouble("Delay"); if(del > 0... | /**
* Refresh traffic times
* @throws SQLException
*/ | Refresh traffic times | refreshTimes | {
"repo_name": "thethorne48/SE1-1",
"path": "src/Map/Intersection.java",
"license": "gpl-3.0",
"size": 12976
} | [
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException"
] | import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,842,692 |
public LogDeliveryErrorCode getErrorCode() {
return errorCode;
} | LogDeliveryErrorCode function() { return errorCode; } | /**
* Gets the error code.
*
* @return the error code
*/ | Gets the error code | getErrorCode | {
"repo_name": "Oleh-Kravchenko/kaa",
"path": "server/node/src/main/java/org/kaaproject/kaa/server/operations/service/akka/messages/core/logs/LogDeliveryMessage.java",
"license": "apache-2.0",
"size": 2311
} | [
"org.kaaproject.kaa.server.common.log.shared.appender.LogDeliveryErrorCode"
] | import org.kaaproject.kaa.server.common.log.shared.appender.LogDeliveryErrorCode; | import org.kaaproject.kaa.server.common.log.shared.appender.*; | [
"org.kaaproject.kaa"
] | org.kaaproject.kaa; | 2,431,304 |
@Override
public JSONObject execute(FileSystem fs) throws IOException {
boolean result = fs.truncate(path, newLength);
return toJSON(
StringUtils.toLowerCase(HttpFSFileSystem.TRUNCATE_JSON), result);
}
}
@InterfaceAudience.Private
public static class FSContentSummary impleme... | JSONObject function(FileSystem fs) throws IOException { boolean result = fs.truncate(path, newLength); return toJSON( StringUtils.toLowerCase(HttpFSFileSystem.TRUNCATE_JSON), result); } } @InterfaceAudience.Private public static class FSContentSummary implements FileSystemAccess.FileSystemExecutor<Map> { private Path p... | /**
* Executes the filesystem operation.
*
* @param fs filesystem instance to use.
*
* @return <code>true</code> if the file has been truncated to the desired,
* <code>false</code> if a background process of adjusting the
* length of the last block has been started, a... | Executes the filesystem operation | execute | {
"repo_name": "bitmybytes/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/server/FSOperations.java",
"license": "apache-2.0",
"size": 42894
} | [
"java.io.IOException",
"java.util.Map",
"org.apache.hadoop.classification.InterfaceAudience",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.fs.http.client.HttpFSFileSystem",
"org.apache.hadoop.lib.service.FileSystemAccess",
"org.apache.hadoop.util.StringUtils",
"... | import java.io.IOException; import java.util.Map; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.http.client.HttpFSFileSystem; import org.apache.hadoop.lib.service.FileSystemAccess; import org.apache.hadoop... | import java.io.*; import java.util.*; import org.apache.hadoop.classification.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.fs.http.client.*; import org.apache.hadoop.lib.service.*; import org.apache.hadoop.util.*; import org.json.simple.*; | [
"java.io",
"java.util",
"org.apache.hadoop",
"org.json.simple"
] | java.io; java.util; org.apache.hadoop; org.json.simple; | 764,971 |
boolean accept(String path) throws IOException; | boolean accept(String path) throws IOException; | /**
* Checks that this provider can fulfill a request to the specified
* resource.
*
* @param path The path to the resource, e.g. {@code /crc}.
* @return {@code true} if the provider can fulfill a request to the
* resource, {@code false} otherwise.
* @throws IOException if an I/O error occurs.
*... | Checks that this provider can fulfill a request to the specified resource | accept | {
"repo_name": "atomicint/aj8",
"path": "server/src/src/main/java/org/apollo/update/resource/ResourceProvider.java",
"license": "isc",
"size": 805
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,230,123 |
List<IConfigElement> list = new ArrayList<IConfigElement>();
//Add categories to config GUI
list.add(categoryElement(KernCraftConfig.CATEGORY_GENERAL,
"General", "kerncraft.config.category.general"));
list.add(categoryElement(KernCraftConfig.CATEGORY_ELEMENTS,
"E... | List<IConfigElement> list = new ArrayList<IConfigElement>(); list.add(categoryElement(KernCraftConfig.CATEGORY_GENERAL, STR, STR)); list.add(categoryElement(KernCraftConfig.CATEGORY_ELEMENTS, STR, STR)); return list; } | /**
* Compiles a list of configuration elements
**/ | Compiles a list of configuration elements | getConfigElements | {
"repo_name": "FilippoLeon/KernCraft",
"path": "src/main/java/com/R3DKn16h7/kerncraft/utils/config/KernCraftConfigGui.java",
"license": "gpl-3.0",
"size": 1684
} | [
"java.util.ArrayList",
"java.util.List",
"net.minecraftforge.fml.client.config.IConfigElement"
] | import java.util.ArrayList; import java.util.List; import net.minecraftforge.fml.client.config.IConfigElement; | import java.util.*; import net.minecraftforge.fml.client.config.*; | [
"java.util",
"net.minecraftforge.fml"
] | java.util; net.minecraftforge.fml; | 556,878 |
public void offline(final byte [] regionName)
throws IOException {
MasterAdminKeepAliveConnection master = connection.getKeepAliveMasterAdminService();
try {
master.offlineRegion(null,RequestConverter.buildOfflineRegionRequest(regionName));
} catch (ServiceException se) {
throw ProtobufUtil.... | void function(final byte [] regionName) throws IOException { MasterAdminKeepAliveConnection master = connection.getKeepAliveMasterAdminService(); try { master.offlineRegion(null,RequestConverter.buildOfflineRegionRequest(regionName)); } catch (ServiceException se) { throw ProtobufUtil.getRemoteException(se); } finally ... | /**
* Special method, only used by hbck.
*/ | Special method, only used by hbck | offline | {
"repo_name": "francisliu/hbase_namespace",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java",
"license": "apache-2.0",
"size": 118566
} | [
"com.google.protobuf.ServiceException",
"java.io.IOException",
"org.apache.hadoop.hbase.protobuf.ProtobufUtil",
"org.apache.hadoop.hbase.protobuf.RequestConverter"
] | import com.google.protobuf.ServiceException; import java.io.IOException; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.RequestConverter; | import com.google.protobuf.*; import java.io.*; import org.apache.hadoop.hbase.protobuf.*; | [
"com.google.protobuf",
"java.io",
"org.apache.hadoop"
] | com.google.protobuf; java.io; org.apache.hadoop; | 694,509 |
public Channel getChannel(Player player) {
Channel channel = channelLookup.get(player.getName());
// Lookup channel again
if (channel == null) {
Object connection = getConnection.get(getPlayerHandle.invoke(player));
Object manager = getManager.get(connection);
channelLookup.put(player.getName(), cha... | Channel function(Player player) { Channel channel = channelLookup.get(player.getName()); if (channel == null) { Object connection = getConnection.get(getPlayerHandle.invoke(player)); Object manager = getManager.get(connection); channelLookup.put(player.getName(), channel = getChannel.get(manager)); } return channel; } | /**
* Retrieve the Netty channel associated with a player. This is cached.
*
* @param player - the player.
* @return The Netty channel.
*/ | Retrieve the Netty channel associated with a player. This is cached | getChannel | {
"repo_name": "TheTonyk/CommandsUHC",
"path": "CommandsUHC/src/com/thetonyk/UHC/Packets/PacketHandler.java",
"license": "mit",
"size": 16134
} | [
"io.netty.channel.Channel",
"org.bukkit.entity.Player"
] | import io.netty.channel.Channel; import org.bukkit.entity.Player; | import io.netty.channel.*; import org.bukkit.entity.*; | [
"io.netty.channel",
"org.bukkit.entity"
] | io.netty.channel; org.bukkit.entity; | 2,624,408 |
@Test
void buildExcludeFilter() {
ConfigBuilder bldr = new ConfigBuilder();
Rectangle shape = new Rectangle(0, 0, 10, 10);
Config config = bldr.ignore(shape).build();
Assertions.assertTrue(config.getFilter().get(0) instanceof ExcludeAreaFilter);
Assertions.assertTrue(config.getComparatumFilter().get(0) in... | void buildExcludeFilter() { ConfigBuilder bldr = new ConfigBuilder(); Rectangle shape = new Rectangle(0, 0, 10, 10); Config config = bldr.ignore(shape).build(); Assertions.assertTrue(config.getFilter().get(0) instanceof ExcludeAreaFilter); Assertions.assertTrue(config.getComparatumFilter().get(0) instanceof ExcludeArea... | /*************************************************************************
* Unit test
************************************************************************/ | Unit test | buildExcludeFilter | {
"repo_name": "SwissAS/comparandum",
"path": "src/test/java/de/rosstauscher/comparandum/context/ConfigBuilderTest.java",
"license": "bsd-3-clause",
"size": 5073
} | [
"de.rosstauscher.comparandum.config.Config",
"de.rosstauscher.comparandum.config.ConfigBuilder",
"de.rosstauscher.comparandum.filter.ExcludeAreaFilter",
"java.awt.Rectangle",
"org.junit.jupiter.api.Assertions"
] | import de.rosstauscher.comparandum.config.Config; import de.rosstauscher.comparandum.config.ConfigBuilder; import de.rosstauscher.comparandum.filter.ExcludeAreaFilter; import java.awt.Rectangle; import org.junit.jupiter.api.Assertions; | import de.rosstauscher.comparandum.config.*; import de.rosstauscher.comparandum.filter.*; import java.awt.*; import org.junit.jupiter.api.*; | [
"de.rosstauscher.comparandum",
"java.awt",
"org.junit.jupiter"
] | de.rosstauscher.comparandum; java.awt; org.junit.jupiter; | 2,469,380 |
final boolean isEmpty() {
Object[] a; int n, cap, b;
VarHandle.acquireFence(); // needed by external callers
return ((n = (b = base) - top) >= 0 || // possibly one task
(n == -1 && ((a = array) == null ||
(cap = a.length) == 0 ||
... | final boolean isEmpty() { Object[] a; int n, cap, b; VarHandle.acquireFence(); return ((n = (b = base) - top) >= 0 (n == -1 && ((a = array) == null (cap = a.length) == 0 a[(cap - 1) & b] == null))); } | /**
* Provides a more accurate estimate of whether this queue has
* any tasks than does queueSize, by checking whether a
* near-empty queue has at least one unclaimed task.
*/ | Provides a more accurate estimate of whether this queue has any tasks than does queueSize, by checking whether a near-empty queue has at least one unclaimed task | isEmpty | {
"repo_name": "automenta/narchy",
"path": "util/src/main/java/jcog/exe/WorkQueue.java",
"license": "agpl-3.0",
"size": 15023
} | [
"java.lang.invoke.VarHandle"
] | import java.lang.invoke.VarHandle; | import java.lang.invoke.*; | [
"java.lang"
] | java.lang; | 691,591 |
public HttpRequest form(final Entry<?, ?> entry) throws HttpRequestException {
return form(entry, CHARSET_UTF8);
} | HttpRequest function(final Entry<?, ?> entry) throws HttpRequestException { return form(entry, CHARSET_UTF8); } | /**
* Write the key and value in the entry as form data to the request body
* <p>
* The pair specified will be URL-encoded in UTF-8 and sent with the
* 'application/x-www-form-urlencoded' content-type
*
* @param entry
* @return this request
* @throws HttpRequestException
*/ | Write the key and value in the entry as form data to the request body The pair specified will be URL-encoded in UTF-8 and sent with the 'application/x-www-form-urlencoded' content-type | form | {
"repo_name": "enricodeleo/cordova-HTTP",
"path": "src/android/com/synconset/CordovaHTTP/HttpRequest.java",
"license": "mit",
"size": 91482
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,453,676 |
@Generated
@IsOptional
@Selector("passwordRules")
default UITextInputPasswordRules passwordRules() {
throw new java.lang.UnsupportedOperationException();
} | @Selector(STR) default UITextInputPasswordRules passwordRules() { throw new java.lang.UnsupportedOperationException(); } | /**
* default is nil
*/ | default is nil | passwordRules | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/uikit/protocol/UITextInputTraits.java",
"license": "apache-2.0",
"size": 8048
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 1,006,965 |
public void updateProvisioningEntityName(ProvisioningEntity provisioningEntity) throws
IdentityApplicationManagementException {
Connection dbConnection = null;
String provisioningEntityName = null;
String en... | void function(ProvisioningEntity provisioningEntity) throws IdentityApplicationManagementException { Connection dbConnection = null; String provisioningEntityName = null; String entityLocalID = null; PreparedStatement prepStmt = null; try { dbConnection = JDBCPersistenceManager.getInstance().getDBConnection(); String s... | /**
* Applicable for only group name update
*
* @param provisioningEntity
* @throws IdentityApplicationManagementException
*/ | Applicable for only group name update | updateProvisioningEntityName | {
"repo_name": "damithsenanayake/carbon-identity",
"path": "components/provisioning/org.wso2.carbon.identity.provisioning/src/main/java/org/wso2/carbon/identity/provisioning/dao/ProvisioningManagementDAO.java",
"license": "apache-2.0",
"size": 23795
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.SQLException",
"org.wso2.carbon.identity.application.common.IdentityApplicationManagementException",
"org.wso2.carbon.identity.application.common.util.IdentityApplicationManagementUtil",
"org.wso2.carbon.identity.core.persistence.JDBCPersisten... | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import org.wso2.carbon.identity.application.common.IdentityApplicationManagementException; import org.wso2.carbon.identity.application.common.util.IdentityApplicationManagementUtil; import org.wso2.carbon.identity.core.persiste... | import java.sql.*; import org.wso2.carbon.identity.application.common.*; import org.wso2.carbon.identity.application.common.util.*; import org.wso2.carbon.identity.core.persistence.*; import org.wso2.carbon.identity.provisioning.*; import org.wso2.carbon.user.core.util.*; | [
"java.sql",
"org.wso2.carbon"
] | java.sql; org.wso2.carbon; | 2,875,125 |
public void onBlockAdded(World world, int x, int y, int z) {
//NO-OP
} | void function(World world, int x, int y, int z) { } | /**
* Called when this sub tile is added to the world.
*/ | Called when this sub tile is added to the world | onBlockAdded | {
"repo_name": "Lomeli12/JSS",
"path": "src/api/java/vazkii/botania/api/subtile/SubTileEntity.java",
"license": "lgpl-3.0",
"size": 6001
} | [
"net.minecraft.world.World"
] | import net.minecraft.world.World; | import net.minecraft.world.*; | [
"net.minecraft.world"
] | net.minecraft.world; | 1,497,968 |
@AllowedFFDC({ "com.ibm.websphere.security.jwt.InvalidTokenException" })
@Mode(TestMode.LITE)
@Test
public void Social_BasicDiscoveryConfigTests_goodJwt_builder() throws Exception {
reconfigIfProviderSpecificConfig(genericTestServer, providerConfigString + "_goodJwt_builder.xml", null);
... | @AllowedFFDC({ STR }) @Mode(TestMode.LITE) void function() throws Exception { reconfigIfProviderSpecificConfig(genericTestServer, providerConfigString + STR, null); WebClient webClient = getAndSaveWebClient(); SocialTestSettings updatedSocialTestSettings = socialSettings.copyTestSettings(); updatedSocialTestSettings.se... | /**
* Verify that when the authorization and token endpoints are discovered, that the main flow is successful with JWT and good
* jwt builder and default signature algorithm RS256.
*
* @throws Exception
*/ | Verify that when the authorization and token endpoints are discovered, that the main flow is successful with JWT and good jwt builder and default signature algorithm RS256 | Social_BasicDiscoveryConfigTests_goodJwt_builder | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.security.social_fat/fat/src/com/ibm/ws/security/social/fat/commonTests/Social_BasicDiscoveryConfigTests.java",
"license": "epl-1.0",
"size": 27221
} | [
"com.gargoylesoftware.htmlunit.WebClient",
"com.ibm.ws.security.social.fat.utils.SocialTestSettings",
"java.util.List"
] | import com.gargoylesoftware.htmlunit.WebClient; import com.ibm.ws.security.social.fat.utils.SocialTestSettings; import java.util.List; | import com.gargoylesoftware.htmlunit.*; import com.ibm.ws.security.social.fat.utils.*; import java.util.*; | [
"com.gargoylesoftware.htmlunit",
"com.ibm.ws",
"java.util"
] | com.gargoylesoftware.htmlunit; com.ibm.ws; java.util; | 2,442,551 |
@Test
public void userAgent() throws Exception {
final MkContainer container = new MkGrizzlyContainer()
.next(
new MkAnswer.Simple("hello, world!")
).start();
new RtHub(
container.home()
).entry().fetch();
container.stop();
... | void function() throws Exception { final MkContainer container = new MkGrizzlyContainer() .next( new MkAnswer.Simple(STR) ).start(); new RtHub( container.home() ).entry().fetch(); container.stop(); MatcherAssert.assertThat( container.take().headers(), Matchers.hasEntry( Matchers.equalTo(HttpHeaders.USER_AGENT), Matcher... | /**
* RtHub return Request with UserAgent.
* @throws Exception If fails
*/ | RtHub return Request with UserAgent | userAgent | {
"repo_name": "smallcreep/jb-hub-client",
"path": "src/test/java/com/github/smallcreep/jb/hub/api/RtHubTest.java",
"license": "mit",
"size": 4643
} | [
"com.jcabi.http.mock.MkAnswer",
"com.jcabi.http.mock.MkContainer",
"com.jcabi.http.mock.MkGrizzlyContainer",
"com.jcabi.manifests.Manifests",
"javax.ws.rs.core.HttpHeaders",
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers"
] | import com.jcabi.http.mock.MkAnswer; import com.jcabi.http.mock.MkContainer; import com.jcabi.http.mock.MkGrizzlyContainer; import com.jcabi.manifests.Manifests; import javax.ws.rs.core.HttpHeaders; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; | import com.jcabi.http.mock.*; import com.jcabi.manifests.*; import javax.ws.rs.core.*; import org.hamcrest.*; | [
"com.jcabi.http",
"com.jcabi.manifests",
"javax.ws",
"org.hamcrest"
] | com.jcabi.http; com.jcabi.manifests; javax.ws; org.hamcrest; | 2,672,552 |
private void setDelim(String delim) {
screen.getConversionModel().setDelim(Delimiter.stringToDelim(delim));
if (screen.getConversionModel().getDecimalSeparator() ==
screen.getConversionModel().getDelim().toString().charAt(0) &&
screen.getConversionModel().getDelim().toString().length() == 1) {
JOpt... | void function(String delim) { screen.getConversionModel().setDelim(Delimiter.stringToDelim(delim)); if (screen.getConversionModel().getDecimalSeparator() == screen.getConversionModel().getDelim().toString().charAt(0) && screen.getConversionModel().getDelim().toString().length() == 1) { JOptionPane.showMessageDialog(nul... | /**
* Sets delimeter for values of a row. Checks for collision with decimalSeparator.
* @param delim
*/ | Sets delimeter for values of a row. Checks for collision with decimalSeparator | setDelim | {
"repo_name": "ilarischeinin/chipster",
"path": "src/main/java/fi/csc/microarray/client/dataimport/tools/ToolsInternalFrame.java",
"license": "gpl-3.0",
"size": 18211
} | [
"fi.csc.microarray.client.dataimport.Delimiter",
"java.awt.Color",
"java.util.regex.Pattern",
"java.util.regex.PatternSyntaxException",
"javax.swing.JLabel",
"javax.swing.JOptionPane"
] | import fi.csc.microarray.client.dataimport.Delimiter; import java.awt.Color; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import javax.swing.JLabel; import javax.swing.JOptionPane; | import fi.csc.microarray.client.dataimport.*; import java.awt.*; import java.util.regex.*; import javax.swing.*; | [
"fi.csc.microarray",
"java.awt",
"java.util",
"javax.swing"
] | fi.csc.microarray; java.awt; java.util; javax.swing; | 2,793,946 |
public static boolean putFile(String username, String category,
String filename, byte[] content, Integer processorId) {
Connection c = Configuration.getConnection();
boolean success = false;
Integer payloadId = 0;
try {
payloadId = Configuration.getControlThread()
.getPayloadFromProcessor(proces... | static boolean function(String username, String category, String filename, byte[] content, Integer processorId) { Connection c = Configuration.getConnection(); boolean success = false; Integer payloadId = 0; try { payloadId = Configuration.getControlThread() .getPayloadFromProcessor(processorId).getId(); } catch (Excep... | /**
* Insert file into database-backed file store. Duplicates throw SQL errors,
* since the db backed file store has a constraint specifying a unique index
* for the file names.
*
* @param username
* @param category
* @param filename
* @param content
* @return Success, true or false.
*/ | Insert file into database-backed file store. Duplicates throw SQL errors, since the db backed file store has a constraint specifying a unique index for the file names | putFile | {
"repo_name": "freemed/remitt",
"path": "src/main/java/org/remitt/datastore/DbFileStore.java",
"license": "gpl-2.0",
"size": 4917
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"org.remitt.server.Configuration",
"org.remitt.server.DbUtil"
] | import java.sql.Connection; import java.sql.PreparedStatement; import org.remitt.server.Configuration; import org.remitt.server.DbUtil; | import java.sql.*; import org.remitt.server.*; | [
"java.sql",
"org.remitt.server"
] | java.sql; org.remitt.server; | 559,013 |
public Writer write(Writer writer) throws JSONException {
return this.write(writer, 0, 0);
} | Writer function(Writer writer) throws JSONException { return this.write(writer, 0, 0); } | /**
* Write the contents of the JSONObject as JSON text to a writer. For
* compactness, no whitespace is added.
* <p>
* Warning: This method assumes that the data structure is acyclical.
*
* @return The writer.
* @throws JSONException
*/ | Write the contents of the JSONObject as JSON text to a writer. For compactness, no whitespace is added. Warning: This method assumes that the data structure is acyclical | write | {
"repo_name": "alexeq/datacrown",
"path": "datacrow-core/_source/net/datacrow/core/utilities/json/JSONObject.java",
"license": "gpl-3.0",
"size": 58110
} | [
"java.io.Writer"
] | import java.io.Writer; | import java.io.*; | [
"java.io"
] | java.io; | 1,093,693 |
public static void fail(String message, Object... objects) {
AssertionError e;
if (message == null) {
e = new AssertionError();
} else {
e = new AssertionError(String.format(message, objects));
}
// Trim the assert frames from the stack trace
... | static void function(String message, Object... objects) { AssertionError e; if (message == null) { e = new AssertionError(); } else { e = new AssertionError(String.format(message, objects)); } StackTraceElement[] trace = e.getStackTrace(); int start = 1; String thisClassName = GraalTest.class.getName(); while (start < ... | /**
* Fails a test with the given message.
*
* @param message the identifying message for the {@link AssertionError} (<code>null</code>
* okay)
* @see AssertionError
*/ | Fails a test with the given message | fail | {
"repo_name": "YouDiSN/OpenJDK-Research",
"path": "jdk9/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java",
"license": "gpl-2.0",
"size": 15443
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 1,553,709 |
private IntervalXYDataset createDataset1() {
// create dataset 1...
TimeSeries series1 = new TimeSeries("Series 1", Day.class);
series1.add(new Day(1, MonthConstants.MARCH, 2002), 12353.3);
series1.add(new Day(2, MonthConstants.MARCH, 2002), 13734.4);
series1.add(new Day(3, ... | IntervalXYDataset function() { TimeSeries series1 = new TimeSeries(STR, Day.class); series1.add(new Day(1, MonthConstants.MARCH, 2002), 12353.3); series1.add(new Day(2, MonthConstants.MARCH, 2002), 13734.4); series1.add(new Day(3, MonthConstants.MARCH, 2002), 14525.3); series1.add(new Day(4, MonthConstants.MARCH, 2002)... | /**
* Creates a sample dataset.
*
* @return Series 1.
*/ | Creates a sample dataset | createDataset1 | {
"repo_name": "aaronc/jfreechart",
"path": "tests/org/jfree/chart/plot/XYPlotTest.java",
"license": "lgpl-2.1",
"size": 52433
} | [
"org.jfree.data.time.Day",
"org.jfree.data.time.TimeSeries",
"org.jfree.data.time.TimeSeriesCollection",
"org.jfree.data.xy.IntervalXYDataset",
"org.jfree.date.MonthConstants"
] | import org.jfree.data.time.Day; import org.jfree.data.time.TimeSeries; import org.jfree.data.time.TimeSeriesCollection; import org.jfree.data.xy.IntervalXYDataset; import org.jfree.date.MonthConstants; | import org.jfree.data.time.*; import org.jfree.data.xy.*; import org.jfree.date.*; | [
"org.jfree.data",
"org.jfree.date"
] | org.jfree.data; org.jfree.date; | 2,346,884 |
public void appendWithRelationships(
Iterable<EClassifier> coreClassifiers,
RelationshipDirection direction,
int depth) throws IOException {
Set<EClassifier> coreSet = new HashSet<>();
for (EClassifier cc: coreClassifiers) {
if (coreSet.add(cc)) {
append(cc);
}
}
Set<EClass... | void function( Iterable<EClassifier> coreClassifiers, RelationshipDirection direction, int depth) throws IOException { Set<EClassifier> coreSet = new HashSet<>(); for (EClassifier cc: coreClassifiers) { if (coreSet.add(cc)) { append(cc); } } Set<EClassifier> relatedSet = new HashSet<>(); switch (direction) { case both:... | /**
* Appends core classifiers, their related classifiers, and relationships
* @param coreClassifiers
* @throws IOException
*/ | Appends core classifiers, their related classifiers, and relationships | appendWithRelationships | {
"repo_name": "Nasdanika/server",
"path": "org.nasdanika.doc.ecore/src/org/nasdanika/doc/ecore/PlantUmlTextGenerator.java",
"license": "epl-1.0",
"size": 15402
} | [
"java.io.IOException",
"java.util.HashSet",
"java.util.Set",
"org.eclipse.emf.ecore.EClass",
"org.eclipse.emf.ecore.EClassifier",
"org.eclipse.emf.ecore.EReference"
] | import java.io.IOException; import java.util.HashSet; import java.util.Set; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EReference; | import java.io.*; import java.util.*; import org.eclipse.emf.ecore.*; | [
"java.io",
"java.util",
"org.eclipse.emf"
] | java.io; java.util; org.eclipse.emf; | 2,531,511 |
void setLogger(final Log log); | void setLogger(final Log log); | /**
* Sets the logger to use.
* @param log The logger to use.
*/ | Sets the logger to use | setLogger | {
"repo_name": "sandamal/wso2-commons-vfs",
"path": "core/src/main/java/org/apache/commons/vfs2/FileSystemManager.java",
"license": "apache-2.0",
"size": 13253
} | [
"org.apache.commons.logging.Log"
] | import org.apache.commons.logging.Log; | import org.apache.commons.logging.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,088,577 |
public static String generateResourceNameFromId(int resourceId) {
try {
if (resourceId <= 0) {
Log.d("Provided resource id is invalid.");
return null;
}
Resources resources = Leanplum.getContext().getResources();
// Get entryName from resourceId, which represents a file nam... | static String function(int resourceId) { try { if (resourceId <= 0) { Log.d(STR); return null; } Resources resources = Leanplum.getContext().getResources(); String entryName = resources.getResourceEntryName(resourceId); String typeName = resources.getResourceTypeName(resourceId); TypedValue value = new TypedValue(); re... | /**
* Generates a Resource name from resourceId located in res/ folder.
*
* @param resourceId id of the resource, must be greater then 0.
* @return resourceName in format folder/file.extension.
*/ | Generates a Resource name from resourceId located in res/ folder | generateResourceNameFromId | {
"repo_name": "Leanplum/Leanplum-Android-SDK",
"path": "AndroidSDKCore/src/main/java/com/leanplum/internal/Util.java",
"license": "apache-2.0",
"size": 23436
} | [
"android.content.res.Resources",
"android.util.TypedValue",
"com.leanplum.Leanplum"
] | import android.content.res.Resources; import android.util.TypedValue; import com.leanplum.Leanplum; | import android.content.res.*; import android.util.*; import com.leanplum.*; | [
"android.content",
"android.util",
"com.leanplum"
] | android.content; android.util; com.leanplum; | 814,650 |
@Test(groups = "unit")
public void sessionRead_ReplicasDoNotHaveTheRequestedLSN_NoResult() {
long lsn = 651175;
long globalCommittedLsn = 651174;
String partitionKeyRangeId = "73";
NotFoundException foundException = new NotFoundException();
foundException.getResponseHead... | @Test(groups = "unit") void function() { long lsn = 651175; long globalCommittedLsn = 651174; String partitionKeyRangeId = "73"; NotFoundException foundException = new NotFoundException(); foundException.getResponseHeaders().put(HttpConstants.HttpHeaders.SESSION_TOKEN, partitionKeyRangeId + ":-1#" + lsn); foundExceptio... | /**
* reading in session consistency, none of the replicas can support the requested session token.
*/ | reading in session consistency, none of the replicas can support the requested session token | sessionRead_ReplicasDoNotHaveTheRequestedLSN_NoResult | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/implementation/directconnectivity/StoreReaderTest.java",
"license": "mit",
"size": 50092
} | [
"com.azure.cosmos.ConsistencyLevel",
"com.azure.cosmos.implementation.DocumentServiceRequestContext",
"com.azure.cosmos.implementation.HttpConstants",
"com.azure.cosmos.implementation.ISessionContainer",
"com.azure.cosmos.implementation.ISessionToken",
"com.azure.cosmos.implementation.NotFoundException",
... | import com.azure.cosmos.ConsistencyLevel; import com.azure.cosmos.implementation.DocumentServiceRequestContext; import com.azure.cosmos.implementation.HttpConstants; import com.azure.cosmos.implementation.ISessionContainer; import com.azure.cosmos.implementation.ISessionToken; import com.azure.cosmos.implementation.Not... | import com.azure.cosmos.*; import com.azure.cosmos.implementation.*; import com.azure.cosmos.implementation.guava25.collect.*; import java.util.*; import org.assertj.core.api.*; import org.mockito.*; import org.testng.annotations.*; | [
"com.azure.cosmos",
"java.util",
"org.assertj.core",
"org.mockito",
"org.testng.annotations"
] | com.azure.cosmos; java.util; org.assertj.core; org.mockito; org.testng.annotations; | 997,763 |
public BigInteger getPublicExponent() {
return this.publicExponent;
} | BigInteger function() { return this.publicExponent; } | /**
* Returns the public exponent.
*
* @return the public exponent.
*/ | Returns the public exponent | getPublicExponent | {
"repo_name": "jgaltidor/VarJ",
"path": "analyzed_libs/jdk1.6.0_06_src/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java",
"license": "mit",
"size": 5728
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 1,322,155 |
public int removeByPrimaryKey(GenericPK primaryKey) throws GenericEntityException {
if (primaryKey == null) return 0;
if (Debug.verboseOn()) Debug.logVerbose("Removing GenericPK: " + primaryKey.toString(), module);
return genericDAO.delete(primaryKey);
} | int function(GenericPK primaryKey) throws GenericEntityException { if (primaryKey == null) return 0; if (Debug.verboseOn()) Debug.logVerbose(STR + primaryKey.toString(), module); return genericDAO.delete(primaryKey); } | /** Remove a Generic Entity corresponding to the primaryKey
*@param primaryKey The primary key of the entity to remove.
*@return int representing number of rows effected by this operation
*/ | Remove a Generic Entity corresponding to the primaryKey | removeByPrimaryKey | {
"repo_name": "yuri0x7c1/ofbiz-explorer",
"path": "src/test/resources/apache-ofbiz-16.11.03/framework/entity/src/main/java/org/apache/ofbiz/entity/datasource/GenericHelperDAO.java",
"license": "apache-2.0",
"size": 10032
} | [
"org.apache.ofbiz.base.util.Debug",
"org.apache.ofbiz.entity.GenericEntityException",
"org.apache.ofbiz.entity.GenericPK"
] | import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.entity.GenericEntityException; import org.apache.ofbiz.entity.GenericPK; | import org.apache.ofbiz.base.util.*; import org.apache.ofbiz.entity.*; | [
"org.apache.ofbiz"
] | org.apache.ofbiz; | 1,782,251 |
public void writeEntityToNBT(NBTTagCompound compound)
{
super.writeEntityToNBT(compound);
compound.setInteger("RabbitType", this.getRabbitType());
compound.setInteger("MoreCarrotTicks", this.carrotTicks);
} | void function(NBTTagCompound compound) { super.writeEntityToNBT(compound); compound.setInteger(STR, this.getRabbitType()); compound.setInteger(STR, this.carrotTicks); } | /**
* (abstract) Protected helper method to write subclass entity data to NBT.
*/ | (abstract) Protected helper method to write subclass entity data to NBT | writeEntityToNBT | {
"repo_name": "TheGreatAndPowerfulWeegee/wipunknown",
"path": "build/tmp/recompileMc/sources/net/minecraft/entity/passive/EntityRabbit.java",
"license": "gpl-3.0",
"size": 24853
} | [
"net.minecraft.nbt.NBTTagCompound"
] | import net.minecraft.nbt.NBTTagCompound; | import net.minecraft.nbt.*; | [
"net.minecraft.nbt"
] | net.minecraft.nbt; | 1,792,067 |
public static void main(String[] args) {
Logger logger = setConsoleHandler();
logger = Logger.getLogger("Test");
logger.severe("Does this come out?");
logger.severe("Does this come out?");
logger.severe("Does this come out?");
logger.log(Level.SEVERE, "hello", new Run... | static void function(String[] args) { Logger logger = setConsoleHandler(); logger = Logger.getLogger("Test"); logger.severe(STR); logger.severe(STR); logger.severe(STR); logger.log(Level.SEVERE, "hello", new RuntimeException("test")); } | /**
* Test this logger.
*/ | Test this logger | main | {
"repo_name": "gaowangyizu/myHeritrix",
"path": "myHeritrix/src/org/archive/util/OneLineSimpleLogger.java",
"license": "apache-2.0",
"size": 4436
} | [
"java.util.logging.Level",
"java.util.logging.Logger"
] | import java.util.logging.Level; import java.util.logging.Logger; | import java.util.logging.*; | [
"java.util"
] | java.util; | 34,215 |
public void threadAssertNull(Object x) {
try {
assertNull(x);
} catch (AssertionFailedError t) {
threadRecordFailure(t);
throw t;
}
} | void function(Object x) { try { assertNull(x); } catch (AssertionFailedError t) { threadRecordFailure(t); throw t; } } | /**
* Just like assertNull(x), but additionally recording (using
* threadRecordFailure) any AssertionFailedError thrown, so that
* the current testcase will fail.
*/ | Just like assertNull(x), but additionally recording (using threadRecordFailure) any AssertionFailedError thrown, so that the current testcase will fail | threadAssertNull | {
"repo_name": "madvay/j2objc",
"path": "jre_emul/android/libcore/jsr166-tests/src/test/java/jsr166/JSR166TestCase.java",
"license": "apache-2.0",
"size": 40137
} | [
"junit.framework.AssertionFailedError"
] | import junit.framework.AssertionFailedError; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 389,625 |
public Future<CommandResult> getMacTxBcastAsync() {
return read(attributes.get(ATTR_MACTXBCAST));
} | Future<CommandResult> function() { return read(attributes.get(ATTR_MACTXBCAST)); } | /**
* Get the <i>MacTxBcast</i> attribute [attribute ID <b>257</b>].
* <p>
* The attribute is of type {@link Integer}.
* <p>
* The implementation of this attribute by a device is MANDATORY
*
* @return the {@link Future<CommandResult>} command result future
*/ | Get the MacTxBcast attribute [attribute ID 257]. The attribute is of type <code>Integer</code>. The implementation of this attribute by a device is MANDATORY | getMacTxBcastAsync | {
"repo_name": "cschwer/com.zsmartsystems.zigbee",
"path": "com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/clusters/ZclDiagnosticsCluster.java",
"license": "epl-1.0",
"size": 61548
} | [
"com.zsmartsystems.zigbee.CommandResult",
"java.util.concurrent.Future"
] | import com.zsmartsystems.zigbee.CommandResult; import java.util.concurrent.Future; | import com.zsmartsystems.zigbee.*; import java.util.concurrent.*; | [
"com.zsmartsystems.zigbee",
"java.util"
] | com.zsmartsystems.zigbee; java.util; | 2,554,914 |
private static File getPortFileForNID(String nid) {
String filename = normalizeID(nid) + ".port";
return new File(LOCK_FILES_DIR, filename);
}
| static File function(String nid) { String filename = normalizeID(nid) + ".port"; return new File(LOCK_FILES_DIR, filename); } | /**
* It returns the port file associated to a normalized ID.
*
* @param nid
* The corresponding normalized ID.
* @return The port file for this normalized ID.
*/ | It returns the port file associated to a normalized ID | getPortFileForNID | {
"repo_name": "poolborges/it.sauronsoftware.junique",
"path": "src/main/java/it/sauronsoftware/junique/JUnique.java",
"license": "lgpl-2.1",
"size": 11538
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 891,007 |
public final String get(final File folder) {
String relative = ServiceCore.relativize(folder);
if (relative == null) {
l.log(Level.INFO, "Unknown folder ignored: {0}", folder.getAbsolutePath());
// fallthru
} else {
String description = lookup_description(... | final String function(final File folder) { String relative = ServiceCore.relativize(folder); if (relative == null) { l.log(Level.INFO, STR, folder.getAbsolutePath()); } else { String description = lookup_description(relative); if (description == null) { l.log(Level.INFO, STR, relative); return "<h3>"+relative+"</h3>"; ... | /**
* Returns a HTML fragment describing the data within the specified folder. The purpose of this
* is to enable the reviewer/researcher to understand what each plot/dataset signifies and its purpose. The only
* public member in this class. so that caller does not know how this description is obtained.
... | Returns a HTML fragment describing the data within the specified folder. The purpose of this is to enable the reviewer/researcher to understand what each plot/dataset signifies and its purpose. The only public member in this class. so that caller does not know how this description is obtained | get | {
"repo_name": "ozacas/hrgp-hub",
"path": "src/main/java/au/edu/unimelb/plantcell/hrgp/services/FolderDescription.java",
"license": "gpl-2.0",
"size": 3250
} | [
"java.io.File",
"java.util.logging.Level"
] | import java.io.File; import java.util.logging.Level; | import java.io.*; import java.util.logging.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,607,224 |
@Test
public void of_URLs_iterableBufferedImages() throws IOException
{
// given
URL f1 = new File("src/test/resources/Thumbnailator/grid.png").toURL();
URL f2 = new File("src/test/resources/Thumbnailator/grid.jpg").toURL();
// when
Iterable<BufferedImage> thumbnails = Thumbnails.of(f1, f2)
... | void function() throws IOException { URL f1 = new File(STR).toURL(); URL f2 = new File(STR).toURL(); Iterable<BufferedImage> thumbnails = Thumbnails.of(f1, f2) .size(50, 50) .iterableBufferedImages(); Iterator<BufferedImage> iter = thumbnails.iterator(); BufferedImage thumbnail1 = iter.next(); assertEquals(50, thumbnai... | /**
* Test for the {@link Thumbnails.Builder} class where,
* <ol>
* <li>Thumbnails.of(URL, URL)</li>
* <li>iterableBufferedImages()</li>
* </ol>
* and the expected outcome is,
* <ol>
* <li>Two images are generated and an Iterable which can iterate over the
* two BufferedImages is returned.</l... | Test for the <code>Thumbnails.Builder</code> class where, Thumbnails.of(URL, URL) iterableBufferedImages() and the expected outcome is, Two images are generated and an Iterable which can iterate over the two BufferedImages is returned. | of_URLs_iterableBufferedImages | {
"repo_name": "passerby4j/thumbnailator",
"path": "src/test/java/net/coobird/thumbnailator/ThumbnailsBuilderInputOutputTest.java",
"license": "mit",
"size": 303967
} | [
"java.awt.image.BufferedImage",
"java.io.File",
"java.io.IOException",
"java.util.Iterator",
"org.junit.Assert"
] | import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Iterator; import org.junit.Assert; | import java.awt.image.*; import java.io.*; import java.util.*; import org.junit.*; | [
"java.awt",
"java.io",
"java.util",
"org.junit"
] | java.awt; java.io; java.util; org.junit; | 272,325 |
@Override
JobExecutionResult execute(String jobName) throws Exception; | JobExecutionResult execute(String jobName) throws Exception; | /**
* Triggers the program execution. The environment will execute all parts of
* the program.
*
* <p>The program execution will be logged and displayed with the provided name
*
* <p>It calls the {@link StreamExecutionEnvironment#execute(String)} on the underlying
* {@link StreamExecutionEnvironment}. In ... | Triggers the program execution. The environment will execute all parts of the program. The program execution will be logged and displayed with the provided name It calls the <code>StreamExecutionEnvironment#execute(String)</code> on the underlying <code>StreamExecutionEnvironment</code>. In contrast to the <code>TableE... | execute | {
"repo_name": "jinglining/flink",
"path": "flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/api/bridge/java/StreamTableEnvironment.java",
"license": "apache-2.0",
"size": 29426
} | [
"org.apache.flink.api.common.JobExecutionResult"
] | import org.apache.flink.api.common.JobExecutionResult; | import org.apache.flink.api.common.*; | [
"org.apache.flink"
] | org.apache.flink; | 2,038,248 |
void removeAttributeValue(PerunSessionImpl perunSession, Group group, AttributeDefinition attribute) throws InternalErrorException; | void removeAttributeValue(PerunSessionImpl perunSession, Group group, AttributeDefinition attribute) throws InternalErrorException; | /**
* Currently do nothing.
*
* @param perunSession
* @param group group which is needed for computing the value
* @param attribute attribute to operate on
* @return
* @throws InternalErrorException if an exception is raised in particular
* implementation, the exception is wrapped in InternalErr... | Currently do nothing | removeAttributeValue | {
"repo_name": "licehammer/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/implApi/modules/attributes/GroupVirtualAttributesModuleImplApi.java",
"license": "bsd-2-clause",
"size": 2251
} | [
"cz.metacentrum.perun.core.api.AttributeDefinition",
"cz.metacentrum.perun.core.api.Group",
"cz.metacentrum.perun.core.api.exceptions.InternalErrorException",
"cz.metacentrum.perun.core.impl.PerunSessionImpl"
] | import cz.metacentrum.perun.core.api.AttributeDefinition; import cz.metacentrum.perun.core.api.Group; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import cz.metacentrum.perun.core.impl.PerunSessionImpl; | import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; import cz.metacentrum.perun.core.impl.*; | [
"cz.metacentrum.perun"
] | cz.metacentrum.perun; | 273,913 |
private void sendAckDataTransfer(Calendar time, int bytesTransferred) {
byte[] ackTime = MiBandDateConverter.calendarToRawBytes(time);
Prefs prefs = GBApplication.getPrefs();
byte[] ackChecksum = new byte[]{
(byte) (bytesTransferred & 0xff),
(byte) (0xff & (b... | void function(Calendar time, int bytesTransferred) { byte[] ackTime = MiBandDateConverter.calendarToRawBytes(time); Prefs prefs = GBApplication.getPrefs(); byte[] ackChecksum = new byte[]{ (byte) (bytesTransferred & 0xff), (byte) (0xff & (bytesTransferred >> 8)) }; if (prefs.getBoolean(MiBandConst.PREF_MIBAND_DONT_ACK_... | /**
* Acknowledge the transfer of activity data to the Mi Band.
* <p/>
* After receiving data from the band, it has to be acknowledged. This way the Mi Band will delete
* the data it has on record.
*
* @param time
* @param bytesTransferred
*/ | Acknowledge the transfer of activity data to the Mi Band. After receiving data from the band, it has to be acknowledged. This way the Mi Band will delete the data it has on record | sendAckDataTransfer | {
"repo_name": "MurshidMac/vimo",
"path": "app/src/main/java/vimo/service/devices/miband/operations/FetchActivityOperation.java",
"license": "agpl-3.0",
"size": 19523
} | [
"java.io.IOException",
"java.util.Calendar"
] | import java.io.IOException; import java.util.Calendar; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,340,253 |
public IndexService indexServiceSafe(String index) {
IndexService indexService = indexService(index);
if (indexService == null) {
throw new IndexNotFoundException(index);
}
return indexService;
} | IndexService function(String index) { IndexService indexService = indexService(index); if (indexService == null) { throw new IndexNotFoundException(index); } return indexService; } | /**
* Returns an IndexService for the specified index if exists otherwise a {@link IndexNotFoundException} is thrown.
*/ | Returns an IndexService for the specified index if exists otherwise a <code>IndexNotFoundException</code> is thrown | indexServiceSafe | {
"repo_name": "Ansh90/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/indices/IndicesService.java",
"license": "apache-2.0",
"size": 38601
} | [
"org.elasticsearch.index.IndexNotFoundException",
"org.elasticsearch.index.IndexService"
] | import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexService; | import org.elasticsearch.index.*; | [
"org.elasticsearch.index"
] | org.elasticsearch.index; | 2,866,456 |
public ServiceFuture<Void> updateAsync(String resourceGroupName, String serviceName, String productId, ProductUpdateParameters parameters, String ifMatch, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, productId... | ServiceFuture<Void> function(String resourceGroupName, String serviceName, String productId, ProductUpdateParameters parameters, String ifMatch, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, productId, parameters, ifMatch)... | /**
* Update existing product details.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the API Management service.
* @param productId Product identifier. Must be unique in the current API Management service instance.
* @param parameters Update ... | Update existing product details | updateAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/apimanagement/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/apimanagement/v2019_12_01/implementation/ProductsInner.java",
"license": "mit",
"size": 103688
} | [
"com.microsoft.azure.management.apimanagement.v2019_12_01.ProductUpdateParameters",
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] | import com.microsoft.azure.management.apimanagement.v2019_12_01.ProductUpdateParameters; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.azure.management.apimanagement.v2019_12_01.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 2,117,563 |
public POPUPMessage getMessage(long messageId) throws POPUPException {
return POPUPPersistence.getMessage(messageId);
} | POPUPMessage function(long messageId) throws POPUPException { return POPUPPersistence.getMessage(messageId); } | /**
* Method declaration
* @param messageId
* @return
* @see
*/ | Method declaration | getMessage | {
"repo_name": "SilverDav/Silverpeas-Core",
"path": "core-war/src/main/java/org/silverpeas/web/notificationserver/channel/popup/POPUPSessionController.java",
"license": "agpl-3.0",
"size": 3197
} | [
"org.silverpeas.core.notification.user.server.channel.popup.POPUPException",
"org.silverpeas.core.notification.user.server.channel.popup.POPUPMessage",
"org.silverpeas.core.notification.user.server.channel.popup.POPUPPersistence"
] | import org.silverpeas.core.notification.user.server.channel.popup.POPUPException; import org.silverpeas.core.notification.user.server.channel.popup.POPUPMessage; import org.silverpeas.core.notification.user.server.channel.popup.POPUPPersistence; | import org.silverpeas.core.notification.user.server.channel.popup.*; | [
"org.silverpeas.core"
] | org.silverpeas.core; | 566,677 |
public void setId(String id) {
this.id = id;
}
ContinueStmt() {
super();
}
ContinueStmt(String id, NodeList<AnnotationExpr> annotations, int posBegin, int posEnd) {
super(annotations, posBegin, posEnd);
this.id = id;
} | void function(String id) { this.id = id; } ContinueStmt() { super(); } ContinueStmt(String id, NodeList<AnnotationExpr> annotations, int posBegin, int posEnd) { super(annotations, posBegin, posEnd); this.id = id; } | /**
* Sets the id.
*
* @param id the new id
*/ | Sets the id | setId | {
"repo_name": "DigiArea/jse-model",
"path": "com.digiarea.jse/src/com/digiarea/jse/ContinueStmt.java",
"license": "epl-1.0",
"size": 2150
} | [
"com.digiarea.jse.AnnotationExpr",
"com.digiarea.jse.NodeList"
] | import com.digiarea.jse.AnnotationExpr; import com.digiarea.jse.NodeList; | import com.digiarea.jse.*; | [
"com.digiarea.jse"
] | com.digiarea.jse; | 1,497,497 |
public void setResourcePersistence(ResourcePersistence resourcePersistence) {
this.resourcePersistence = resourcePersistence;
} | void function(ResourcePersistence resourcePersistence) { this.resourcePersistence = resourcePersistence; } | /**
* Sets the resource persistence.
*
* @param resourcePersistence the resource persistence
*/ | Sets the resource persistence | setResourcePersistence | {
"repo_name": "fraunhoferfokus/govapps",
"path": "data-portlet/src/main/java/de/fraunhofer/fokus/movepla/service/base/LegalDetailsServiceBaseImpl.java",
"license": "bsd-3-clause",
"size": 32799
} | [
"com.liferay.portal.service.persistence.ResourcePersistence"
] | import com.liferay.portal.service.persistence.ResourcePersistence; | import com.liferay.portal.service.persistence.*; | [
"com.liferay.portal"
] | com.liferay.portal; | 1,886,132 |
public List<MemorySegment> requestBuffers() throws Exception {
List<MemorySegment> allocated = new ArrayList<>(numBuffersPerRequest);
synchronized (buffers) {
checkState(!destroyed, "Buffer pool is already destroyed.");
if (!initialized) {
initialize();
... | List<MemorySegment> function() throws Exception { List<MemorySegment> allocated = new ArrayList<>(numBuffersPerRequest); synchronized (buffers) { checkState(!destroyed, STR); if (!initialized) { initialize(); } Deadline deadline = Deadline.fromNow(WAITING_TIME); while (buffers.size() < numBuffersPerRequest) { checkStat... | /**
* Requests a collection of buffers (determined by {@link #numBuffersPerRequest}) from this
* buffer pool.
*/ | Requests a collection of buffers (determined by <code>#numBuffersPerRequest</code>) from this buffer pool | requestBuffers | {
"repo_name": "lincoln-lil/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/BatchShuffleReadBufferPool.java",
"license": "apache-2.0",
"size": 10008
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.flink.api.common.time.Deadline",
"org.apache.flink.core.memory.MemorySegment",
"org.apache.flink.util.Preconditions"
] | import java.util.ArrayList; import java.util.List; import org.apache.flink.api.common.time.Deadline; import org.apache.flink.core.memory.MemorySegment; import org.apache.flink.util.Preconditions; | import java.util.*; import org.apache.flink.api.common.time.*; import org.apache.flink.core.memory.*; import org.apache.flink.util.*; | [
"java.util",
"org.apache.flink"
] | java.util; org.apache.flink; | 1,897,903 |
@Override
public void updateUI() {
// collapsePane is null when updateUI() is called by the "super()"
// constructor
if (collapsePane == null) {
return;
}
setUI((TaskPaneUI)LookAndFeelAddons.getUI(this, TaskPaneUI.class));
} | void function() { if (collapsePane == null) { return; } setUI((TaskPaneUI)LookAndFeelAddons.getUI(this, TaskPaneUI.class)); } | /**
* Notification from the <code>UIManager</code> that the L&F has changed.
* Replaces the current UI object with the latest version from the <code>UIManager</code>.
*
* @see javax.swing.JComponent#updateUI
*/ | Notification from the <code>UIManager</code> that the L&F has changed. Replaces the current UI object with the latest version from the <code>UIManager</code> | updateUI | {
"repo_name": "Mindtoeye/Hoop",
"path": "src/org/jdesktop/swingx/JXTaskPane.java",
"license": "lgpl-3.0",
"size": 19807
} | [
"org.jdesktop.swingx.plaf.LookAndFeelAddons",
"org.jdesktop.swingx.plaf.TaskPaneUI"
] | import org.jdesktop.swingx.plaf.LookAndFeelAddons; import org.jdesktop.swingx.plaf.TaskPaneUI; | import org.jdesktop.swingx.plaf.*; | [
"org.jdesktop.swingx"
] | org.jdesktop.swingx; | 1,971,140 |
public static File findLog4jConfigInCurrentDir() {
return ConfigLocator.findConfigInWorkingDirectory();
} | static File function() { return ConfigLocator.findConfigInWorkingDirectory(); } | /**
* Finds a Log4j configuration file in the current directory. The names of
* the files to look for are the same as those that Log4j would look for on
* the classpath.
*
* @return A File for the configuration file or null if one isn't found.
*/ | Finds a Log4j configuration file in the current directory. The names of the files to look for are the same as those that Log4j would look for on the classpath | findLog4jConfigInCurrentDir | {
"repo_name": "robertgeiger/incubator-geode",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogService.java",
"license": "apache-2.0",
"size": 15799
} | [
"com.gemstone.gemfire.internal.logging.log4j.ConfigLocator",
"java.io.File"
] | import com.gemstone.gemfire.internal.logging.log4j.ConfigLocator; import java.io.File; | import com.gemstone.gemfire.internal.logging.log4j.*; import java.io.*; | [
"com.gemstone.gemfire",
"java.io"
] | com.gemstone.gemfire; java.io; | 2,695,641 |
private LinkedHashMap<String, ProfileDto> orderProfiles(Map<String, ProfileDto> profiles) {
// separate profiles per role
Map<Role, List<Entry<String, ProfileDto>>> roleListMap = new HashMap<Role, List<Entry<String, ProfileDto>>>();
for (Entry<String, ProfileDto> profileDtoEntry : profiles.entrySet()) {
Rol... | LinkedHashMap<String, ProfileDto> function(Map<String, ProfileDto> profiles) { Map<Role, List<Entry<String, ProfileDto>>> roleListMap = new HashMap<Role, List<Entry<String, ProfileDto>>>(); for (Entry<String, ProfileDto> profileDtoEntry : profiles.entrySet()) { Role role = profileDtoEntry.getValue().getRole(); if (!rol... | /**
* Order the profiles: first show administrator role, then the desk manager roles, then the others.
*
* @param profiles the map of token/profile as provided from server side
* @return an order retaining {@link LinkedHashMap} containing the same information as input,
* but ordered by {@link Role} based on ... | Order the profiles: first show administrator role, then the desk manager roles, then the others | orderProfiles | {
"repo_name": "geomajas/geomajas-project-deskmanager",
"path": "gwt/src/main/java/org/geomajas/plugin/deskmanager/client/gwt/common/impl/RolesWindowImpl.java",
"license": "agpl-3.0",
"size": 5773
} | [
"java.util.ArrayList",
"java.util.HashMap",
"java.util.LinkedHashMap",
"java.util.List",
"java.util.Map",
"org.geomajas.plugin.deskmanager.domain.security.dto.ProfileDto",
"org.geomajas.plugin.deskmanager.domain.security.dto.Role"
] | import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.geomajas.plugin.deskmanager.domain.security.dto.ProfileDto; import org.geomajas.plugin.deskmanager.domain.security.dto.Role; | import java.util.*; import org.geomajas.plugin.deskmanager.domain.security.dto.*; | [
"java.util",
"org.geomajas.plugin"
] | java.util; org.geomajas.plugin; | 2,874,266 |
WriterAndPath getWriterAndPath(Entry entry) throws IOException {
byte region[] = entry.getKey().getEncodedRegionName();
WriterAndPath ret = logWriters.get(region);
if (ret != null) {
return ret;
}
// If we already decided that this region doesn't get any output
// we don'... | WriterAndPath getWriterAndPath(Entry entry) throws IOException { byte region[] = entry.getKey().getEncodedRegionName(); WriterAndPath ret = logWriters.get(region); if (ret != null) { return ret; } if (blacklistedRegions.contains(region)) { return null; } ret = createWAP(region, entry, rootDir, fs, conf); if (ret == nul... | /**
* Get a writer and path for a log starting at the given entry.
*
* This function is threadsafe so long as multiple threads are always
* acting on different regions.
*
* @return null if this region shouldn't output any logs
*/ | Get a writer and path for a log starting at the given entry. This function is threadsafe so long as multiple threads are always acting on different regions | getWriterAndPath | {
"repo_name": "jyates/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java",
"license": "apache-2.0",
"size": 49758
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.regionserver.wal.HLog"
] | import java.io.IOException; import org.apache.hadoop.hbase.regionserver.wal.HLog; | import java.io.*; import org.apache.hadoop.hbase.regionserver.wal.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 652,490 |
WebSiteAsyncOperationResponse getOperation(String resourceGroupName, String webSiteName, String slotName, String operationId) throws IOException, ServiceException; | WebSiteAsyncOperationResponse getOperation(String resourceGroupName, String webSiteName, String slotName, String operationId) throws IOException, ServiceException; | /**
* You can retrieve details for a web site by issuing an HTTP GET request.
* (see http://msdn.microsoft.com/en-us/library/windowsazure/dn167007.aspx
* for more information)
*
* @param resourceGroupName Required. The name of the resource group.
* @param webSiteName Required. The name of the we... | You can retrieve details for a web site by issuing an HTTP GET request. (see HREF for more information) | getOperation | {
"repo_name": "southworkscom/azure-sdk-for-java",
"path": "resource-management/azure-mgmt-websites/src/main/java/com/microsoft/azure/management/websites/WebSiteOperations.java",
"license": "apache-2.0",
"size": 60715
} | [
"com.microsoft.azure.management.websites.models.WebSiteAsyncOperationResponse",
"com.microsoft.windowsazure.exception.ServiceException",
"java.io.IOException"
] | import com.microsoft.azure.management.websites.models.WebSiteAsyncOperationResponse; import com.microsoft.windowsazure.exception.ServiceException; import java.io.IOException; | import com.microsoft.azure.management.websites.models.*; import com.microsoft.windowsazure.exception.*; import java.io.*; | [
"com.microsoft.azure",
"com.microsoft.windowsazure",
"java.io"
] | com.microsoft.azure; com.microsoft.windowsazure; java.io; | 1,280,655 |
public void setDevicesEnabled(String[] addresses, boolean add) {
List<String> addressesList = Arrays.asList(addresses);
this.disabledAddresses.removeAll(addressesList);
if(add) {
this.disabledAddresses.addAll(addressesList);
}
this.saveSettings();
manage();
}
| void function(String[] addresses, boolean add) { List<String> addressesList = Arrays.asList(addresses); this.disabledAddresses.removeAll(addressesList); if(add) { this.disabledAddresses.addAll(addressesList); } this.saveSettings(); manage(); } | /**
* Enables/Disables specified list of BT devices
* @param addresses List of BT device addresses to enable/disable
* @param b True = Add devices, false = remove devices
*/ | Enables/Disables specified list of BT devices | setDevicesEnabled | {
"repo_name": "t2health/BSPAN---Bluetooth-Sensor-Processing-for-Android",
"path": "AndroidBTService/src/com/t2/biofeedback/DeviceManager.java",
"license": "epl-1.0",
"size": 17676
} | [
"java.util.Arrays",
"java.util.List"
] | import java.util.Arrays; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,679,509 |
public String toString()
{
String lineSeparator = System.getProperty("line.separator");
String result = "( " + lineSeparator;
Iterator<DataPoint> it = dataPoints.iterator();
while ( it.hasNext() )
{
result += " " + it.next().toString()
... | String function() { String lineSeparator = System.getProperty(STR); String result = STR + lineSeparator; Iterator<DataPoint> it = dataPoints.iterator(); while ( it.hasNext() ) { result += " " + it.next().toString() + lineSeparator; } return result + ")"; } } | /**
* Overrides the default toString method. Lists all data points in this
* data set. Note that if there are a large number of data points in this
* data set, then the String returned could be very long.
* @return a string representation of this data set.
*/ | Overrides the default toString method. Lists all data points in this data set. Note that if there are a large number of data points in this data set, then the String returned could be very long | toString | {
"repo_name": "arrahtec/osdq-core",
"path": "src/main/java/net/sourceforge/openforecast/DataSet.java",
"license": "apache-2.0",
"size": 20328
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,364,525 |
public void syncAfterKObjectAddedToKRCNode(String krcNodeName,
KObject associatedkObject, String activeKObjectName) {
OWLOntology koOntology = manager.getKObjectOntology();
// add association of krc node to kobject
OWLNamedIndividual krcNodeIndividual = dataFactory
.getKRCNodeIndi(krcNodeName, activeK... | void function(String krcNodeName, KObject associatedkObject, String activeKObjectName) { OWLOntology koOntology = manager.getKObjectOntology(); OWLNamedIndividual krcNodeIndividual = dataFactory .getKRCNodeIndi(krcNodeName, activeKObjectName); OWLObjectPropertyAssertionAxiom hasAssociatedAssertion; OWLNamedIndividual k... | /**
* Assossiaces a Kobject with a krc node
* if the associated (child) konject is k resource,
* the psysical location not sure if exists in the ontology
*
* @param krcNodeName
* the name (label) of the krc node
* @param kobjectname
* the name (just label, no postfix) of the kobje... | Assossiaces a Kobject with a krc node if the associated (child) konject is k resource, the psysical location not sure if exists in the ontology | syncAfterKObjectAddedToKRCNode | {
"repo_name": "tsiakmaki/jcropeditor",
"path": "src/edu/teilar/jcropeditor/OntologySynchronizer.java",
"license": "gpl-3.0",
"size": 115156
} | [
"edu.teilar.jcropeditor.util.KObject",
"org.semanticweb.owlapi.model.AddAxiom",
"org.semanticweb.owlapi.model.OWLNamedIndividual",
"org.semanticweb.owlapi.model.OWLObjectPropertyAssertionAxiom",
"org.semanticweb.owlapi.model.OWLOntology"
] | import edu.teilar.jcropeditor.util.KObject; import org.semanticweb.owlapi.model.AddAxiom; import org.semanticweb.owlapi.model.OWLNamedIndividual; import org.semanticweb.owlapi.model.OWLObjectPropertyAssertionAxiom; import org.semanticweb.owlapi.model.OWLOntology; | import edu.teilar.jcropeditor.util.*; import org.semanticweb.owlapi.model.*; | [
"edu.teilar.jcropeditor",
"org.semanticweb.owlapi"
] | edu.teilar.jcropeditor; org.semanticweb.owlapi; | 1,794,250 |
public void addCookie(Cookie cookie) {
_frameworkModel.addCookie(cookie);
} | void function(Cookie cookie) { _frameworkModel.addCookie(cookie); } | /**
* adds a cookie to the model
* @param cookie the cookie to add
*/ | adds a cookie to the model | addCookie | {
"repo_name": "Neraud/PADListener",
"path": "SandroProxyLib/src/main/java/org/sandrop/webscarab/plugin/FrameworkModelWrapper.java",
"license": "gpl-2.0",
"size": 9142
} | [
"org.sandrop.webscarab.model.Cookie"
] | import org.sandrop.webscarab.model.Cookie; | import org.sandrop.webscarab.model.*; | [
"org.sandrop.webscarab"
] | org.sandrop.webscarab; | 1,381,171 |
private void setAnimation(View viewToAnimate, int position)
{
// If the bound view wasn't previously displayed on screen, it's animated
if (position > lastPosition)
{
Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.fade_in);
... | void function(View viewToAnimate, int position) { if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.fade_in); viewToAnimate.startAnimation(animation); lastPosition = position; } } } | /**
* Here is the key method to apply the animation
*/ | Here is the key method to apply the animation | setAnimation | {
"repo_name": "mhwong2007/NCTU-LIbrary",
"path": "Android Application/app/src/main/java/com/example/mhwong/nctulibrary/BorrowListActivity.java",
"license": "mit",
"size": 15056
} | [
"android.view.View",
"android.view.animation.Animation",
"android.view.animation.AnimationUtils"
] | import android.view.View; import android.view.animation.Animation; import android.view.animation.AnimationUtils; | import android.view.*; import android.view.animation.*; | [
"android.view"
] | android.view; | 2,674,822 |
public synchronized void closeAll() {
for (Window window : windows) {
try {
window.removeEventListener("close", this);
window.destroy();
} catch (Throwable e) {
}
}
windows.clear();
resetPos... | synchronized void function() { for (Window window : windows) { try { window.removeEventListener("close", this); window.destroy(); } catch (Throwable e) { } } windows.clear(); resetPosition(); } | /**
* Close all open popups.
*/ | Close all open popups | closeAll | {
"repo_name": "carewebframework/carewebframework-core",
"path": "org.carewebframework.ui-parent/org.carewebframework.ui.popupsupport/src/main/java/org/carewebframework/ui/popupsupport/PopupSupport.java",
"license": "apache-2.0",
"size": 5872
} | [
"org.fujion.component.Window"
] | import org.fujion.component.Window; | import org.fujion.component.*; | [
"org.fujion.component"
] | org.fujion.component; | 1,720,167 |
ConsistencyLevel getDefaultReadConsistencyLevel(); | ConsistencyLevel getDefaultReadConsistencyLevel(); | /**
* Default consistency level used when reading from the cluster. This value
* can be overwritten on the Query operations (returned by
* Keyspace.prepareXXQuery) by calling Query.setConsistencyLevel().
*/ | Default consistency level used when reading from the cluster. This value can be overwritten on the Query operations (returned by Keyspace.prepareXXQuery) by calling Query.setConsistencyLevel() | getDefaultReadConsistencyLevel | {
"repo_name": "bazaarvoice/astyanax",
"path": "astyanax-cassandra/src/main/java/com/netflix/astyanax/AstyanaxConfiguration.java",
"license": "apache-2.0",
"size": 3177
} | [
"com.netflix.astyanax.model.ConsistencyLevel"
] | import com.netflix.astyanax.model.ConsistencyLevel; | import com.netflix.astyanax.model.*; | [
"com.netflix.astyanax"
] | com.netflix.astyanax; | 2,146,919 |
private List<String> getExcludedSitesFromTabs() {
PreferencesService m_pre_service = (PreferencesService) ComponentManager.get(PreferencesService.class.getName());
final Preferences prefs = m_pre_service.getPreferences(SessionManager.getCurrentSessionUserId());
final ResourceProperties props = prefs.g... | List<String> function() { PreferencesService m_pre_service = (PreferencesService) ComponentManager.get(PreferencesService.class.getName()); final Preferences prefs = m_pre_service.getPreferences(SessionManager.getCurrentSessionUserId()); final ResourceProperties props = prefs.getProperties(TABS_EXCLUDED_PREFS); final L... | /**
* Pulls excluded site ids from Tabs preferences
*/ | Pulls excluded site ids from Tabs preferences | getExcludedSitesFromTabs | {
"repo_name": "ouit0408/sakai",
"path": "announcement/announcement-tool/tool/src/java/org/sakaiproject/announcement/tool/AnnouncementAction.java",
"license": "apache-2.0",
"size": 173337
} | [
"java.util.List",
"org.sakaiproject.component.cover.ComponentManager",
"org.sakaiproject.entity.api.ResourceProperties",
"org.sakaiproject.tool.cover.SessionManager",
"org.sakaiproject.user.api.Preferences",
"org.sakaiproject.user.api.PreferencesService"
] | import java.util.List; import org.sakaiproject.component.cover.ComponentManager; import org.sakaiproject.entity.api.ResourceProperties; import org.sakaiproject.tool.cover.SessionManager; import org.sakaiproject.user.api.Preferences; import org.sakaiproject.user.api.PreferencesService; | import java.util.*; import org.sakaiproject.component.cover.*; import org.sakaiproject.entity.api.*; import org.sakaiproject.tool.cover.*; import org.sakaiproject.user.api.*; | [
"java.util",
"org.sakaiproject.component",
"org.sakaiproject.entity",
"org.sakaiproject.tool",
"org.sakaiproject.user"
] | java.util; org.sakaiproject.component; org.sakaiproject.entity; org.sakaiproject.tool; org.sakaiproject.user; | 1,241,918 |
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
// Compute our stack/task rects
Rect taskStackBounds = new Rect(mTaskStackBounds);
ta... | void function(int widthMeasureSpec, int heightMeasureSpec) { int width = MeasureSpec.getSize(widthMeasureSpec); int height = MeasureSpec.getSize(heightMeasureSpec); Rect taskStackBounds = new Rect(mTaskStackBounds); taskStackBounds.bottom -= mConfig.systemInsets.bottom; computeRects(width, height, taskStackBounds, mCon... | /**
* This is called with the full window width and height to allow stack view children to
* perform the full screen transition down.
*/ | This is called with the full window width and height to allow stack view children to perform the full screen transition down | onMeasure | {
"repo_name": "DSttr/SystemUI",
"path": "SystemUI/src/com/android/systemui/recents/views/TaskStackView.java",
"license": "apache-2.0",
"size": 62973
} | [
"android.graphics.Rect",
"java.util.List"
] | import android.graphics.Rect; import java.util.List; | import android.graphics.*; import java.util.*; | [
"android.graphics",
"java.util"
] | android.graphics; java.util; | 1,933,699 |
private void processPopupTrigger(MouseEvent e, int row) {
int selRow = table.getSelectedRow();
if ((selRow == -1) || !table.isRowSelected(table.rowAtPoint(e.getPoint()))) {
table.setRowSelectionInterval(row, row);
}
RightClickMenu rightClickMenu = new RightClickMenu(JabRe... | void function(MouseEvent e, int row) { int selRow = table.getSelectedRow(); if ((selRow == -1) !table.isRowSelected(table.rowAtPoint(e.getPoint()))) { table.setRowSelectionInterval(row, row); } RightClickMenu rightClickMenu = new RightClickMenu(JabRefGUI.getMainFrame(), panel); rightClickMenu.show(table, e.getX(), e.ge... | /**
* Process general right-click events on the table. Show the table context menu at
* the position where the user right-clicked.
* @param e The mouse event defining the popup trigger.
* @param row The row where the event occurred.
*/ | Process general right-click events on the table. Show the table context menu at the position where the user right-clicked | processPopupTrigger | {
"repo_name": "ambro2/jabref",
"path": "src/main/java/net/sf/jabref/gui/maintable/MainTableSelectionListener.java",
"license": "gpl-2.0",
"size": 23371
} | [
"java.awt.event.MouseEvent",
"net.sf.jabref.JabRefGUI",
"net.sf.jabref.gui.menus.RightClickMenu"
] | import java.awt.event.MouseEvent; import net.sf.jabref.JabRefGUI; import net.sf.jabref.gui.menus.RightClickMenu; | import java.awt.event.*; import net.sf.jabref.*; import net.sf.jabref.gui.menus.*; | [
"java.awt",
"net.sf.jabref"
] | java.awt; net.sf.jabref; | 2,450,622 |
public static final DateFormat getTimeInstance(int style) {
checkTimeStyle(style);
return getTimeInstance(style, Locale.getDefault());
} | static final DateFormat function(int style) { checkTimeStyle(style); return getTimeInstance(style, Locale.getDefault()); } | /**
* Returns a {@code DateFormat} instance for formatting and parsing time
* values in the specified style for the user's default locale.
* See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
* @param style
* one of SHORT, MEDIUM, LONG, FULL, or DEF... | Returns a DateFormat instance for formatting and parsing time values in the specified style for the user's default locale. See "Be wary of the default locale" | getTimeInstance | {
"repo_name": "halfhp/j2objc",
"path": "jre_emul/android/libcore/luni/src/main/java/java/text/DateFormat.java",
"license": "apache-2.0",
"size": 30332
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 746,410 |
public static List<String> normalizeOptionsWithNormalizers(List<String> javacopts,
JavacOptionNormalizer... normalizers) {
List<String> normalized = new ArrayList<>();
for (JavacOptionNormalizer normalizer : normalizers) {
normalizer.start();
}
for (String opt : javacopts) {
bool... | static List<String> function(List<String> javacopts, JavacOptionNormalizer... normalizers) { List<String> normalized = new ArrayList<>(); for (JavacOptionNormalizer normalizer : normalizers) { normalizer.start(); } for (String opt : javacopts) { boolean found = false; for (JavacOptionNormalizer normalizer : normalizers... | /**
* Outputs a reasonably normalized javac option list.
*
* @param javacopts the raw javac option list to cleanup
* @param normalizers the list of normalizers to apply
* @return a new cleaned up javac option list
*/ | Outputs a reasonably normalized javac option list | normalizeOptionsWithNormalizers | {
"repo_name": "Krasnyanskiy/bazel",
"path": "src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac/JavacOptions.java",
"license": "apache-2.0",
"size": 8316
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,453,550 |
public void testXYAutoRange1() {
XYSeries series = new XYSeries("Series 1");
series.add(1.0, 1.0);
series.add(2.0, 2.0);
series.add(3.0, 3.0);
XYSeriesCollection dataset = new XYSeriesCollection();
dataset.addSeries(series);
JFreeChart chart = ChartFactory.cre... | void function() { XYSeries series = new XYSeries(STR); series.add(1.0, 1.0); series.add(2.0, 2.0); series.add(3.0, 3.0); XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(series); JFreeChart chart = ChartFactory.createScatterPlot( "Test", "X", "Y", dataset, PlotOrientation.VERTICAL, false, false,... | /**
* Checks that the auto-range for the domain axis on an XYPlot is
* working as expected.
*/ | Checks that the auto-range for the domain axis on an XYPlot is working as expected | testXYAutoRange1 | {
"repo_name": "JSansalone/JFreeChart",
"path": "tests/org/jfree/chart/axis/junit/LogAxisTests.java",
"license": "lgpl-2.1",
"size": 11711
} | [
"junit.framework.Test",
"org.jfree.chart.ChartFactory",
"org.jfree.chart.JFreeChart",
"org.jfree.chart.axis.LogAxis",
"org.jfree.chart.plot.PlotOrientation",
"org.jfree.chart.plot.XYPlot",
"org.jfree.data.xy.XYSeries",
"org.jfree.data.xy.XYSeriesCollection"
] | import junit.framework.Test; import org.jfree.chart.ChartFactory; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.LogAxis; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; | import junit.framework.*; import org.jfree.chart.*; import org.jfree.chart.axis.*; import org.jfree.chart.plot.*; import org.jfree.data.xy.*; | [
"junit.framework",
"org.jfree.chart",
"org.jfree.data"
] | junit.framework; org.jfree.chart; org.jfree.data; | 1,728,742 |
@Override
protected void onBecameVisible() {
super.onBecameVisible();
presenter.fetchTitleAndDescription(callback.getIndexInViewFlipper(this));
if(showNearbyFound) {
if (UploadActivity.nearbyPopupAnswers.containsKey(nearbyPlace)) {
final boolean response = Upl... | void function() { super.onBecameVisible(); presenter.fetchTitleAndDescription(callback.getIndexInViewFlipper(this)); if(showNearbyFound) { if (UploadActivity.nearbyPopupAnswers.containsKey(nearbyPlace)) { final boolean response = UploadActivity.nearbyPopupAnswers.get(nearbyPlace); if (response) { presenter.onUserConfir... | /**
* This method gets called whenever the next/previous button is pressed
*/ | This method gets called whenever the next/previous button is pressed | onBecameVisible | {
"repo_name": "neslihanturan/apps-android-commons",
"path": "app/src/main/java/fr/free/nrw/commons/upload/mediaDetails/UploadMediaDetailFragment.java",
"license": "apache-2.0",
"size": 22975
} | [
"fr.free.nrw.commons.upload.UploadActivity"
] | import fr.free.nrw.commons.upload.UploadActivity; | import fr.free.nrw.commons.upload.*; | [
"fr.free.nrw"
] | fr.free.nrw; | 385,370 |
public static String hmacSHA1ToBase64(String msg, String key) {
try {
return digestHmacToBase64("HmacSHA1", msg, key.getBytes("UTF-8"));
} catch (NoSuchAlgorithmException | UnsupportedEncodingException | InvalidKeyException ex) {
Logger.getLogger(DigestUtil.class).error(e... | static String function(String msg, String key) { try { return digestHmacToBase64(STR, msg, key.getBytes("UTF-8")); } catch (NoSuchAlgorithmException UnsupportedEncodingException InvalidKeyException ex) { Logger.getLogger(DigestUtil.class).error(ex.getMessage()); } return null; } | /**
* Devuelve la firma sha1 en formato String base 64
* @param msg mensaje
* @param key clave privada
* @return firma en formato String base 64
*/ | Devuelve la firma sha1 en formato String base 64 | hmacSHA1ToBase64 | {
"repo_name": "jencisopy/JavaBeanStack",
"path": "commons/src/main/java/org/javabeanstack/crypto/DigestUtil.java",
"license": "lgpl-3.0",
"size": 11798
} | [
"java.io.UnsupportedEncodingException",
"java.security.InvalidKeyException",
"java.security.NoSuchAlgorithmException",
"org.apache.log4j.Logger"
] | import java.io.UnsupportedEncodingException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import org.apache.log4j.Logger; | import java.io.*; import java.security.*; import org.apache.log4j.*; | [
"java.io",
"java.security",
"org.apache.log4j"
] | java.io; java.security; org.apache.log4j; | 1,035,252 |
public static INDArray convn(INDArray input, INDArray kernel, Type type) {
return Nd4j.getConvolution().convn(input, kernel, type);
} | static INDArray function(INDArray input, INDArray kernel, Type type) { return Nd4j.getConvolution().convn(input, kernel, type); } | /**
* ND Convolution
*
* @param input the input to op
* @param kernel the kernel to op with
* @param type the opType of convolution
* @return the convolution of the given input and kernel
*/ | ND Convolution | convn | {
"repo_name": "deeplearning4j/nd4j",
"path": "nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/Convolution.java",
"license": "apache-2.0",
"size": 13993
} | [
"org.nd4j.linalg.api.ndarray.INDArray",
"org.nd4j.linalg.factory.Nd4j"
] | import org.nd4j.linalg.api.ndarray.INDArray; import org.nd4j.linalg.factory.Nd4j; | import org.nd4j.linalg.api.ndarray.*; import org.nd4j.linalg.factory.*; | [
"org.nd4j.linalg"
] | org.nd4j.linalg; | 648,529 |
private void internalOnControlAcquired(int streamType) {
LogUtils.v(TAG, "Acquired control of stream %d", streamType);
handler.releaseControlDelayed();
} | void function(int streamType) { LogUtils.v(TAG, STR, streamType); handler.releaseControlDelayed(); } | /**
* Called after control of a particular volume stream has been acquired and the audio stream has
* had a chance to quiet down.
*
* @param streamType The stream type over which control has been acquired.
*/ | Called after control of a particular volume stream has been acquired and the audio stream has had a chance to quiet down | internalOnControlAcquired | {
"repo_name": "google/talkback",
"path": "talkback/src/main/java/com/google/android/accessibility/talkback/VolumeMonitor.java",
"license": "apache-2.0",
"size": 17161
} | [
"com.google.android.libraries.accessibility.utils.log.LogUtils"
] | import com.google.android.libraries.accessibility.utils.log.LogUtils; | import com.google.android.libraries.accessibility.utils.log.*; | [
"com.google.android"
] | com.google.android; | 2,769,217 |
public static void deleteDirectoryTree(File directory) throws IOException {
if (!directory.exists()) {
return;
}
File[] files = directory.listFiles();
if (files != null) {
for (int i = 0; i < files.length; ++i) {
File f = files[i];
... | static void function(File directory) throws IOException { if (!directory.exists()) { return; } File[] files = directory.listFiles(); if (files != null) { for (int i = 0; i < files.length; ++i) { File f = files[i]; if (f.isDirectory()) { deleteDirectoryTree(f); } else { deleteFile(f); } } } if (!directory.delete()) { th... | /**
* Yes, this will delete everything under a directory. Use with care!
*/ | Yes, this will delete everything under a directory. Use with care | deleteDirectoryTree | {
"repo_name": "fabioz/Pydev",
"path": "plugins/org.python.pydev.shared_core/src/org/python/pydev/shared_core/io/FileUtils.java",
"license": "epl-1.0",
"size": 44350
} | [
"java.io.File",
"java.io.IOException"
] | import java.io.File; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,531,645 |
Program hivProgram = MetadataUtils.existing(Program.class, HivMetadata._Program.HIV);
Concept tbScreening = Dictionary.getConcept(Dictionary.TB_SCREENING);
Set<Integer> alive = Filters.alive(cohort, context);
Set<Integer> inHivProgram = Filters.inProgram(hivProgram, alive, context);
CalculationRes... | Program hivProgram = MetadataUtils.existing(Program.class, HivMetadata._Program.HIV); Concept tbScreening = Dictionary.getConcept(Dictionary.TB_SCREENING); Set<Integer> alive = Filters.alive(cohort, context); Set<Integer> inHivProgram = Filters.inProgram(hivProgram, alive, context); CalculationResultMap screeningObs = ... | /**
* Evaluates the calculation
* @param cohort the patient cohort
* @param params the calculation parameters
* @param context the calculation context
* @return the result map
* @should calculate null for patients who are not enrolled in the HIV program or not alive
* @should calculate true for pat... | Evaluates the calculation | evaluate | {
"repo_name": "hispindia/his-tb-emr",
"path": "api/src/main/java/org/openmrs/module/kenyaemr/calculation/library/hiv/EnrolledInHivTBStatedLastVist6Month.java",
"license": "gpl-3.0",
"size": 4006
} | [
"java.util.Calendar",
"java.util.Date",
"java.util.List",
"java.util.Set",
"org.openmrs.Concept",
"org.openmrs.Obs",
"org.openmrs.Program",
"org.openmrs.calculation.result.CalculationResultMap",
"org.openmrs.calculation.result.ListResult",
"org.openmrs.module.kenyacore.calculation.BooleanResult",
... | import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Set; import org.openmrs.Concept; import org.openmrs.Obs; import org.openmrs.Program; import org.openmrs.calculation.result.CalculationResultMap; import org.openmrs.calculation.result.ListResult; import org.openmrs.module.kenyacore... | import java.util.*; import org.openmrs.*; import org.openmrs.calculation.result.*; import org.openmrs.module.kenyacore.calculation.*; import org.openmrs.module.kenyaemr.*; import org.openmrs.module.kenyaemr.metadata.*; import org.openmrs.module.metadatadeploy.*; | [
"java.util",
"org.openmrs",
"org.openmrs.calculation",
"org.openmrs.module"
] | java.util; org.openmrs; org.openmrs.calculation; org.openmrs.module; | 1,270,260 |
protected Iterable<VariableDeclarationFragment> getStaticFieldsNeedingInitialization(
AbstractTypeDeclaration node) {
return Iterables.filter(TreeUtil.getAllFields(node), NEEDS_INITIALIZATION_PRED);
} | Iterable<VariableDeclarationFragment> function( AbstractTypeDeclaration node) { return Iterables.filter(TreeUtil.getAllFields(node), NEEDS_INITIALIZATION_PRED); } | /**
* Excludes primitive constants which will not have variables declared for them.
*/ | Excludes primitive constants which will not have variables declared for them | getStaticFieldsNeedingInitialization | {
"repo_name": "xuvw/j2objc",
"path": "translator/src/main/java/com/google/devtools/j2objc/gen/ObjectiveCSourceFileGenerator.java",
"license": "apache-2.0",
"size": 23400
} | [
"com.google.common.collect.Iterables",
"com.google.devtools.j2objc.ast.AbstractTypeDeclaration",
"com.google.devtools.j2objc.ast.TreeUtil",
"com.google.devtools.j2objc.ast.VariableDeclarationFragment"
] | import com.google.common.collect.Iterables; import com.google.devtools.j2objc.ast.AbstractTypeDeclaration; import com.google.devtools.j2objc.ast.TreeUtil; import com.google.devtools.j2objc.ast.VariableDeclarationFragment; | import com.google.common.collect.*; import com.google.devtools.j2objc.ast.*; | [
"com.google.common",
"com.google.devtools"
] | com.google.common; com.google.devtools; | 702,373 |
protected void setFixture(UseCaseRepository fixture) {
this.fixture = fixture;
} | void function(UseCaseRepository fixture) { this.fixture = fixture; } | /**
* Sets the fixture for this Use Case Repository test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | Sets the fixture for this Use Case Repository test case. | setFixture | {
"repo_name": "Wessbas/wessbas.behaviorModelExtractor",
"path": "src-gen/net/sf/markov4jmeter/behavior/tests/UseCaseRepositoryTest.java",
"license": "apache-2.0",
"size": 2665
} | [
"net.sf.markov4jmeter.behavior.UseCaseRepository"
] | import net.sf.markov4jmeter.behavior.UseCaseRepository; | import net.sf.markov4jmeter.behavior.*; | [
"net.sf.markov4jmeter"
] | net.sf.markov4jmeter; | 2,717,643 |
public static void doublePut(final DirectBuffer buffer,
final int index,
final double value,
final ByteOrder byteOrder)
{
buffer.putDouble(index, value, byteOrder);
} | static void function(final DirectBuffer buffer, final int index, final double value, final ByteOrder byteOrder) { buffer.putDouble(index, value, byteOrder); } | /**
* Put a double to a {@link DirectBuffer} at the given index.
*
* @param buffer to which the value should be written.
* @param index from which to begin writing.
* @param value to be be written.
* @param byteOrder for the buffer encoding
*/ | Put a double to a <code>DirectBuffer</code> at the given index | doublePut | {
"repo_name": "AdaptiveConsulting/simple-binary-encoding",
"path": "main/java/uk/co/real_logic/sbe/codec/java/CodecUtil.java",
"license": "apache-2.0",
"size": 20441
} | [
"java.nio.ByteOrder"
] | import java.nio.ByteOrder; | import java.nio.*; | [
"java.nio"
] | java.nio; | 170,954 |
public synchronized void setDriverClassLoader(
ClassLoader driverClassLoader) {
this.driverClassLoader = driverClassLoader;
this.restartNeeded = true;
}
protected int maxActive = GenericObjectPool.DEFAULT_MAX_ACTIVE; | synchronized void function( ClassLoader driverClassLoader) { this.driverClassLoader = driverClassLoader; this.restartNeeded = true; } protected int maxActive = GenericObjectPool.DEFAULT_MAX_ACTIVE; | /**
* <p>Sets the class loader to be used to load the JDBC driver.</p>
* <p>
* Note: this method currently has no effect once the pool has been
* initialized. The pool is initialized the first time one of the
* following methods is invoked: <code>getConnection, setLogwriter,
* setLoginTim... | Sets the class loader to be used to load the JDBC driver. Note: this method currently has no effect once the pool has been initialized. The pool is initialized the first time one of the following methods is invoked: <code>getConnection, setLogwriter, setLoginTimeout, getLoginTimeout, getLogWriter.</code> | setDriverClassLoader | {
"repo_name": "WilliamRen/bbossgroups-3.5",
"path": "bboss-persistent/src-jdk6/com/frameworkset/commons/dbcp/BasicDataSource.java",
"license": "apache-2.0",
"size": 58050
} | [
"com.frameworkset.commons.pool.impl.GenericObjectPool"
] | import com.frameworkset.commons.pool.impl.GenericObjectPool; | import com.frameworkset.commons.pool.impl.*; | [
"com.frameworkset.commons"
] | com.frameworkset.commons; | 2,906,573 |
DateTime getEndTime(); | DateTime getEndTime(); | /**
* Get end time of the transaction
* @return endTime of the transaction
*/ | Get end time of the transaction | getEndTime | {
"repo_name": "AgiSol/checkout-java",
"path": "src/main/java/fi/agisol/checkout/api/persistence/TransactionEntity.java",
"license": "mit",
"size": 3189
} | [
"org.joda.time.DateTime"
] | import org.joda.time.DateTime; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 59,328 |
public UserCustomColumn getGeometryTypeNameColumn() {
return getColumn(COLUMN_GEOMETRY_TYPE_NAME);
} | UserCustomColumn function() { return getColumn(COLUMN_GEOMETRY_TYPE_NAME); } | /**
* Get the geometry type name column
*
* @return geometry type name column
*/ | Get the geometry type name column | getGeometryTypeNameColumn | {
"repo_name": "ngageoint/geopackage-core-java",
"path": "src/main/java/mil/nga/geopackage/extension/nga/style/StyleMappingTable.java",
"license": "mit",
"size": 1663
} | [
"mil.nga.geopackage.user.custom.UserCustomColumn"
] | import mil.nga.geopackage.user.custom.UserCustomColumn; | import mil.nga.geopackage.user.custom.*; | [
"mil.nga.geopackage"
] | mil.nga.geopackage; | 142,949 |
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
}
return itemPropertyDescriptors;
} | List<IItemPropertyDescriptor> function(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); } return itemPropertyDescriptors; } | /**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns the property descriptors for the adapted class. | getPropertyDescriptors | {
"repo_name": "diverse-project/kcvl",
"path": "fr.inria.diverse.kcvl.metamodel.edit/src/main/java/org/omg/CVLMetamodelMaster/cvl/provider/ReplacementBoundaryElementItemProvider.java",
"license": "epl-1.0",
"size": 3044
} | [
"java.util.List",
"org.eclipse.emf.edit.provider.IItemPropertyDescriptor"
] | import java.util.List; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; | import java.util.*; import org.eclipse.emf.edit.provider.*; | [
"java.util",
"org.eclipse.emf"
] | java.util; org.eclipse.emf; | 2,533,792 |
private static String mergePolicies(URL policy1, URL policy2)
throws IOException {
// Create target directory for the merged policy files.
String sytemHome =
BaseTestCase.getSystemProperty("derby.system.home");
File sysDir = new File(sytemHome == null ? "system" :... | static String function(URL policy1, URL policy2) throws IOException { String sytemHome = BaseTestCase.getSystemProperty(STR); File sysDir = new File(sytemHome == null ? STR : sytemHome); File varDir = new File(sysDir, "var"); mkdir(sysDir); mkdir(varDir); final File mergedPF = new File(varDir, new File(policy2.getPath(... | /**
* Merges the two specified policy resources (typically files), and writes
* the combined policy to a new file.
*
* @param policy1 the first policy
* @param policy2 the second policy
* @return The resource location string for a policy file.
* @throws IOException if reading or writi... | Merges the two specified policy resources (typically files), and writes the combined policy to a new file | mergePolicies | {
"repo_name": "apache/derby",
"path": "java/org.apache.derby.tests/org/apache/derbyTesting/junit/SecurityManagerSetup.java",
"license": "apache-2.0",
"size": 24873
} | [
"java.io.File",
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream",
"org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests"
] | import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests; | import java.io.*; import org.apache.*; | [
"java.io",
"org.apache"
] | java.io; org.apache; | 267,202 |
@Test
public void testIsDataCompleteFailForEmissionDate() {
Order order = new Order(10l);
order.emissionDate = null;
assertFalse(order.isDataComplete());
}
| void function() { Order order = new Order(10l); order.emissionDate = null; assertFalse(order.isDataComplete()); } | /**
* Test data should be incomplete
* because emission date is not assigned
*/ | Test data should be incomplete because emission date is not assigned | testIsDataCompleteFailForEmissionDate | {
"repo_name": "Aula13/A-WMS",
"path": "test/org/wms/model/order/OrderUnitTest.java",
"license": "cc0-1.0",
"size": 10463
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,467,845 |
protected String getContentType(String filePath, HttpServletRequest request) {
String requestUri = request.getRequestURI();
// Retrieve the extension
String extension = getExtension(filePath);
if (extension == null) {
LOGGER.error("No extension found for the request URI : " + requestUri);
ret... | String function(String filePath, HttpServletRequest request) { String requestUri = request.getRequestURI(); String extension = getExtension(filePath); if (extension == null) { LOGGER.error(STR + requestUri); return null; } String contentType = (String) imgMimeMap.get(extension); if (contentType == null) { LOGGER.error(... | /**
* Returns the content type for the image
*
* @param request
* the request
* @param filePath
* the image file path
* @return the content type of the image
*/ | Returns the content type for the image | getContentType | {
"repo_name": "berinle/jawr-core",
"path": "src/main/java/net/jawr/web/servlet/JawrImageRequestHandler.java",
"license": "apache-2.0",
"size": 20260
} | [
"javax.servlet.http.HttpServletRequest"
] | import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.*; | [
"javax.servlet"
] | javax.servlet; | 2,302,247 |
EAttribute getTransition_Output(); | EAttribute getTransition_Output(); | /**
* Returns the meta object for the attribute '{@link compositefsm.Transition#getOutput <em>Output</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Output</em>'.
* @see compositefsm.Transition#getOutput()
* @see #getTransition()
* @generated
*/ | Returns the meta object for the attribute '<code>compositefsm.Transition#getOutput Output</code>'. | getTransition_Output | {
"repo_name": "diverse-project/melange",
"path": "examples/fr.inria.diverse.melange.examples.metamodels.compositefsm/src/main/java/compositefsm/CompositefsmPackage.java",
"license": "epl-1.0",
"size": 16296
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 558,873 |
public Service getService() {
return (this.service);
} | Service function() { return (this.service); } | /**
* Return the <code>Service</code> with which we are associated (if any).
*/ | Return the <code>Service</code> with which we are associated (if any) | getService | {
"repo_name": "plumer/codana",
"path": "tomcat_files/6.0.0/StandardEngine.java",
"license": "mit",
"size": 15950
} | [
"org.apache.catalina.Service"
] | import org.apache.catalina.Service; | import org.apache.catalina.*; | [
"org.apache.catalina"
] | org.apache.catalina; | 383,563 |
private List<Event> pullEvents(long since, int evtCnt) throws Exception {
IgnitePredicate<Event> filter = new CustomEventFilter(GridAllEventsTestTask.class.getName(), since);
for (int i = 0; i < 3; i++) {
List<Event> evts = new ArrayList<>(ignite.events().localQuery((filter)));
... | List<Event> function(long since, int evtCnt) throws Exception { IgnitePredicate<Event> filter = new CustomEventFilter(GridAllEventsTestTask.class.getName(), since); for (int i = 0; i < 3; i++) { List<Event> evts = new ArrayList<>(ignite.events().localQuery((filter))); info(STR + evts.size() + STR + evts + ']'); if (evt... | /**
* Pull all test task related events since the given moment.
*
* @param since Earliest time to pulled events.
* @param evtCnt Expected event count
* @return List of events.
* @throws Exception If failed.
*/ | Pull all test task related events since the given moment | pullEvents | {
"repo_name": "tkpanther/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/GridEventStorageCheckAllEventsSelfTest.java",
"license": "apache-2.0",
"size": 18260
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.ignite.events.Event",
"org.apache.ignite.internal.util.typedef.internal.U",
"org.apache.ignite.lang.IgnitePredicate"
] | import java.util.ArrayList; import java.util.List; import org.apache.ignite.events.Event; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgnitePredicate; | import java.util.*; import org.apache.ignite.events.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 337,895 |
public double getSlopeStdErr() {
return FastMath.sqrt(getMeanSquareError() / sumXX);
} | double function() { return FastMath.sqrt(getMeanSquareError() / sumXX); } | /**
* Returns the <a href="http://www.xycoon.com/standerrorb(1).htm">standard
* error of the slope estimate</a>,
* usually denoted s(b1).
* <p>
* If there are fewer that <strong>three</strong> data pairs in the model,
* or if there is no variation in x, this returns <code>Double.NaN</code>... | Returns the standard error of the slope estimate, usually denoted s(b1). If there are fewer that three data pairs in the model, or if there is no variation in x, this returns <code>Double.NaN</code>. | getSlopeStdErr | {
"repo_name": "SpoonLabs/astor",
"path": "examples/math_57/src/main/java/org/apache/commons/math/stat/regression/SimpleRegression.java",
"license": "gpl-2.0",
"size": 21648
} | [
"org.apache.commons.math.util.FastMath"
] | import org.apache.commons.math.util.FastMath; | import org.apache.commons.math.util.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,971,888 |
public void testGetAlgorithm() {
byte[] key = new byte[] {1, 2, 3, 4, 5};
String algorithm = "Algorithm";
SecretKeySpec ks = new SecretKeySpec(key, algorithm);
assertEquals("The returned value does not equal to the "
+ "value specified in the constructor.",
... | void function() { byte[] key = new byte[] {1, 2, 3, 4, 5}; String algorithm = STR; SecretKeySpec ks = new SecretKeySpec(key, algorithm); assertEquals(STR + STR, algorithm, ks.getAlgorithm()); } | /**
* getAlgorithm() method testing. Tests that returned value is
* equal to the value specified in the constructor.
*/ | getAlgorithm() method testing. Tests that returned value is equal to the value specified in the constructor | testGetAlgorithm | {
"repo_name": "skyHALud/codenameone",
"path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/spec/SecretKeySpecTest.java",
"license": "gpl-2.0",
"size": 10372
} | [
"javax.crypto.spec.SecretKeySpec"
] | import javax.crypto.spec.SecretKeySpec; | import javax.crypto.spec.*; | [
"javax.crypto"
] | javax.crypto; | 2,855,288 |
public final Property<HistoricalTimeSeriesMaster> historicalTimeSeriesMaster() {
return metaBean().historicalTimeSeriesMaster().createProperty(this);
} | final Property<HistoricalTimeSeriesMaster> function() { return metaBean().historicalTimeSeriesMaster().createProperty(this); } | /**
* Gets the the {@code historicalTimeSeriesMaster} property.
* @return the property, not null
*/ | Gets the the historicalTimeSeriesMaster property | historicalTimeSeriesMaster | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Component/src/main/java/com/opengamma/component/factory/source/HistoricalTimeSeriesSourceComponentFactory.java",
"license": "apache-2.0",
"size": 20511
} | [
"com.opengamma.master.historicaltimeseries.HistoricalTimeSeriesMaster",
"org.joda.beans.Property"
] | import com.opengamma.master.historicaltimeseries.HistoricalTimeSeriesMaster; import org.joda.beans.Property; | import com.opengamma.master.historicaltimeseries.*; import org.joda.beans.*; | [
"com.opengamma.master",
"org.joda.beans"
] | com.opengamma.master; org.joda.beans; | 1,568,756 |
public void destroy(Connection c) throws BadServerResponse,
XenAPIException, XmlRpcException {
String method_call = "VDI.destroy";
String session = c.getSessionReference();
Object[] method_params = { Marshalling.toXMLRPC(session),
Marshalling.toXMLRPC(this.ref) };
Map response = c.dispatch(method_call... | void function(Connection c) throws BadServerResponse, XenAPIException, XmlRpcException { String method_call = STR; String session = c.getSessionReference(); Object[] method_params = { Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref) }; Map response = c.dispatch(method_call, method_params); return; } | /**
* Destroy the specified VDI instance.
*
*/ | Destroy the specified VDI instance | destroy | {
"repo_name": "guzy/OnceCenter",
"path": "src/com/once/xenapi/VDI.java",
"license": "apache-2.0",
"size": 80204
} | [
"com.once.xenapi.Types",
"java.util.Map",
"org.apache.xmlrpc.XmlRpcException"
] | import com.once.xenapi.Types; import java.util.Map; import org.apache.xmlrpc.XmlRpcException; | import com.once.xenapi.*; import java.util.*; import org.apache.xmlrpc.*; | [
"com.once.xenapi",
"java.util",
"org.apache.xmlrpc"
] | com.once.xenapi; java.util; org.apache.xmlrpc; | 1,091,874 |
public void handleGatewaySenderCreation(GatewaySender sender) throws ManagementException {
if (!isServiceInitialised("handleGatewaySenderCreation")) {
return;
}
GatewaySenderMBeanBridge bridge = new GatewaySenderMBeanBridge(sender);
GatewaySenderMXBean senderMBean = new GatewaySenderMBean(bridg... | void function(GatewaySender sender) throws ManagementException { if (!isServiceInitialised(STR)) { return; } GatewaySenderMBeanBridge bridge = new GatewaySenderMBeanBridge(sender); GatewaySenderMXBean senderMBean = new GatewaySenderMBean(bridge); ObjectName senderObjectName = MBeanJMXAdapter.getGatewaySenderMBeanName( ... | /**
* Handles GatewaySender creation
*
* @param sender the specific gateway sender
* @throws ManagementException
*/ | Handles GatewaySender creation | handleGatewaySenderCreation | {
"repo_name": "shankarh/geode",
"path": "geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementAdapter.java",
"license": "apache-2.0",
"size": 40390
} | [
"javax.management.Notification",
"javax.management.ObjectName",
"org.apache.geode.cache.wan.GatewaySender",
"org.apache.geode.management.GatewaySenderMXBean",
"org.apache.geode.management.JMXNotificationType",
"org.apache.geode.management.ManagementException",
"org.apache.geode.management.internal.MBean... | import javax.management.Notification; import javax.management.ObjectName; import org.apache.geode.cache.wan.GatewaySender; import org.apache.geode.management.GatewaySenderMXBean; import org.apache.geode.management.JMXNotificationType; import org.apache.geode.management.ManagementException; import org.apache.geode.manag... | import javax.management.*; import org.apache.geode.cache.wan.*; import org.apache.geode.management.*; import org.apache.geode.management.internal.*; | [
"javax.management",
"org.apache.geode"
] | javax.management; org.apache.geode; | 1,351,469 |
protected void reportMetricValueForFilteredTokenRegion(double value,
IToken firstToken, IToken lastToken) throws ConQATException {
reportMetricValue(value,
ResourceUtils.createTextRegionLocationForFilteredOffsets(
currentElement, firstToken.getOffset(),
lastToken.getEndOffset()));
} | void function(double value, IToken firstToken, IToken lastToken) throws ConQATException { reportMetricValue(value, ResourceUtils.createTextRegionLocationForFilteredOffsets( currentElement, firstToken.getOffset(), lastToken.getEndOffset())); } | /**
* Reports a metric value. The location is a range of tokens denoted by
* first and last token. The tokens must be from the filtered text, as this
* method also performs conversion to "raw" positions.
*/ | Reports a metric value. The location is a range of tokens denoted by first and last token. The tokens must be from the filtered text, as this method also performs conversion to "raw" positions | reportMetricValueForFilteredTokenRegion | {
"repo_name": "vimaier/conqat",
"path": "org.conqat.engine.sourcecode/src/org/conqat/engine/sourcecode/analysis/TokenMetricAnalyzerBase.java",
"license": "apache-2.0",
"size": 2921
} | [
"org.conqat.engine.core.core.ConQATException",
"org.conqat.engine.resource.util.ResourceUtils",
"org.conqat.lib.scanner.IToken"
] | import org.conqat.engine.core.core.ConQATException; import org.conqat.engine.resource.util.ResourceUtils; import org.conqat.lib.scanner.IToken; | import org.conqat.engine.core.core.*; import org.conqat.engine.resource.util.*; import org.conqat.lib.scanner.*; | [
"org.conqat.engine",
"org.conqat.lib"
] | org.conqat.engine; org.conqat.lib; | 42,295 |
//-----------------------------------------------------------------------
public ImmutableMap<IborCapletFloorletPeriod, CurrencyAmount> getAmounts() {
return amounts;
} | ImmutableMap<IborCapletFloorletPeriod, CurrencyAmount> function() { return amounts; } | /**
* Gets the map of Ibor caplet/floorlet periods to the currency amount.
* @return the value of the property, not null
*/ | Gets the map of Ibor caplet/floorlet periods to the currency amount | getAmounts | {
"repo_name": "OpenGamma/Strata",
"path": "modules/pricer/src/main/java/com/opengamma/strata/pricer/capfloor/IborCapletFloorletPeriodCurrencyAmounts.java",
"license": "apache-2.0",
"size": 10460
} | [
"com.google.common.collect.ImmutableMap",
"com.opengamma.strata.basics.currency.CurrencyAmount",
"com.opengamma.strata.product.capfloor.IborCapletFloorletPeriod"
] | import com.google.common.collect.ImmutableMap; import com.opengamma.strata.basics.currency.CurrencyAmount; import com.opengamma.strata.product.capfloor.IborCapletFloorletPeriod; | import com.google.common.collect.*; import com.opengamma.strata.basics.currency.*; import com.opengamma.strata.product.capfloor.*; | [
"com.google.common",
"com.opengamma.strata"
] | com.google.common; com.opengamma.strata; | 1,641,256 |
public USqlView getView(String accountName, String databaseName, String schemaName, String viewName) {
return getViewWithServiceResponseAsync(accountName, databaseName, schemaName, viewName).toBlocking().single().body();
} | USqlView function(String accountName, String databaseName, String schemaName, String viewName) { return getViewWithServiceResponseAsync(accountName, databaseName, schemaName, viewName).toBlocking().single().body(); } | /**
* Retrieves the specified view from the Data Lake Analytics catalog.
*
* @param accountName The Azure Data Lake Analytics account upon which to execute catalog operations.
* @param databaseName The name of the database containing the view.
* @param schemaName The name of the schema containi... | Retrieves the specified view from the Data Lake Analytics catalog | getView | {
"repo_name": "jianghaolu/azure-sdk-for-java",
"path": "azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/implementation/CatalogsImpl.java",
"license": "mit",
"size": 683869
} | [
"com.microsoft.azure.management.datalake.analytics.models.USqlView"
] | import com.microsoft.azure.management.datalake.analytics.models.USqlView; | import com.microsoft.azure.management.datalake.analytics.models.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,801,247 |
private static boolean isAbsolute(@Nonnull String rel) {
return rel.startsWith("/") || DRIVE_PATTERN.matcher(rel).matches() || UNC_PATTERN.matcher(rel).matches();
}
private static final Pattern DRIVE_PATTERN = Pattern.compile("[A-Za-z]:[\\\\/].*"),
UNC_PATTERN = Pattern.compile("^\\\\\\... | static boolean function(@Nonnull String rel) { return rel.startsWith("/") DRIVE_PATTERN.matcher(rel).matches() UNC_PATTERN.matcher(rel).matches(); } private static final Pattern DRIVE_PATTERN = Pattern.compile(STR), UNC_PATTERN = Pattern.compile(STR), ABSOLUTE_PREFIX_PATTERN = Pattern.compile(STR); | /**
* Is the given path name an absolute path?
*/ | Is the given path name an absolute path | isAbsolute | {
"repo_name": "recena/jenkins",
"path": "core/src/main/java/hudson/FilePath.java",
"license": "mit",
"size": 134702
} | [
"java.util.regex.Pattern",
"javax.annotation.Nonnull"
] | import java.util.regex.Pattern; import javax.annotation.Nonnull; | import java.util.regex.*; import javax.annotation.*; | [
"java.util",
"javax.annotation"
] | java.util; javax.annotation; | 556,300 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.