method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
|---|---|---|---|---|---|---|---|---|---|---|---|
public static String toString(JSONObject jo) throws JSONException {
StringBuffer sb = new StringBuffer();
int i;
JSONArray ja;
String key;
Iterator keys;
int length;
Object object;
String tagName;
String value;
//Emit <tagName
tagName = jo.optString("tagName");
if (tagName == null) {
return XML.escape(jo.toString());
}
XML.noSpace(tagName);
tagName = XML.escape(tagName);
sb.append('<');
sb.append(tagName);
//Emit the attributes
keys = jo.keys();
while (keys.hasNext()) {
key = keys.next().toString();
if (!"tagName".equals(key) && !"childNodes".equals(key)) {
XML.noSpace(key);
value = jo.optString(key);
if (value != null) {
sb.append(' ');
sb.append(XML.escape(key));
sb.append('=');
sb.append('"');
sb.append(XML.escape(value));
sb.append('"');
}
}
}
//Emit content in body
ja = jo.optJSONArray("childNodes");
if (ja == null) {
sb.append('/');
sb.append('>');
} else {
sb.append('>');
length = ja.length();
for (i = 0; i < length; i += 1) {
object = ja.get(i);
if (object != null) {
if (object instanceof String) {
sb.append(XML.escape(object.toString()));
} else if (object instanceof JSONObject) {
sb.append(toString((JSONObject)object));
} else if (object instanceof JSONArray) {
sb.append(toString((JSONArray)object));
} else {
sb.append(object.toString());
}
}
}
sb.append('<');
sb.append('/');
sb.append(tagName);
sb.append('>');
}
return sb.toString();
}
|
static String function(JSONObject jo) throws JSONException { StringBuffer sb = new StringBuffer(); int i; JSONArray ja; String key; Iterator keys; int length; Object object; String tagName; String value; tagName = jo.optString(STR); if (tagName == null) { return XML.escape(jo.toString()); } XML.noSpace(tagName); tagName = XML.escape(tagName); sb.append('<'); sb.append(tagName); keys = jo.keys(); while (keys.hasNext()) { key = keys.next().toString(); if (!STR.equals(key) && !STR.equals(key)) { XML.noSpace(key); value = jo.optString(key); if (value != null) { sb.append(' '); sb.append(XML.escape(key)); sb.append('='); sb.append('STR'); } } } ja = jo.optJSONArray(STR); if (ja == null) { sb.append('/'); sb.append('>'); } else { sb.append('>'); length = ja.length(); for (i = 0; i < length; i += 1) { object = ja.get(i); if (object != null) { if (object instanceof String) { sb.append(XML.escape(object.toString())); } else if (object instanceof JSONObject) { sb.append(toString((JSONObject)object)); } else if (object instanceof JSONArray) { sb.append(toString((JSONArray)object)); } else { sb.append(object.toString()); } } } sb.append('<'); sb.append('/'); sb.append(tagName); sb.append('>'); } return sb.toString(); }
|
/**
* Reverse the JSONML transformation, making an XML text from a JSONObject.
* The JSONObject must contain a "tagName" property. If it has children,
* then it must have a "childNodes" property containing an array of objects.
* The other properties are attributes with string values.
* @param jo A JSONObject.
* @return An XML string.
* @throws JSONException
*/
|
Reverse the JSONML transformation, making an XML text from a JSONObject. The JSONObject must contain a "tagName" property. If it has children, then it must have a "childNodes" property containing an array of objects. The other properties are attributes with string values
|
toString
|
{
"repo_name": "dertroglodyt/ScribeOP",
"path": "src/main/java/de/dertroglodyt/scribeop/json/JSONML.java",
"license": "mit",
"size": 17086
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,819,740
|
public void registerListener (final IObjectProxyListener listener)
{
for (Iterator iter = gagingStationIterator (); iter.hasNext ();)
{
final GagingStation station = (GagingStation) iter.next ();
|
void function (final IObjectProxyListener listener) { for (Iterator iter = gagingStationIterator (); iter.hasNext ();) { final GagingStation station = (GagingStation) iter.next ();
|
/**
* Register a proxy listener for all sensors in all stations.
*
* @param listener The listener to add.
*/
|
Register a proxy listener for all sensors in all stations
|
registerListener
|
{
"repo_name": "grappendorf/openmetix",
"path": "plugin/metix-app/src/java/de/iritgo/openmetix/app/gagingstation/GagingStationRegistry.java",
"license": "gpl-2.0",
"size": 5309
}
|
[
"de.iritgo.openmetix.core.iobject.IObjectProxyListener",
"java.util.Iterator"
] |
import de.iritgo.openmetix.core.iobject.IObjectProxyListener; import java.util.Iterator;
|
import de.iritgo.openmetix.core.iobject.*; import java.util.*;
|
[
"de.iritgo.openmetix",
"java.util"
] |
de.iritgo.openmetix; java.util;
| 1,857,548
|
@Test
public void testFetchAfterPartitionWithFetchedRecordsIsUnassigned() {
Fetcher<byte[], byte[]> fetcher = createFetcher(subscriptions, new Metrics(time), 2);
List<ConsumerRecord<byte[], byte[]>> records;
subscriptions.assignFromUser(singleton(tp1));
subscriptions.seek(tp1, 1);
// Returns 3 records while `max.poll.records` is configured to 2
client.prepareResponse(matchesOffset(tp1, 1), fetchResponse(tp1, this.records, Errors.NONE, 100L, 0));
assertEquals(1, fetcher.sendFetches());
consumerClient.poll(0);
records = fetcher.fetchedRecords().get(tp1);
assertEquals(2, records.size());
assertEquals(3L, subscriptions.position(tp1).longValue());
assertEquals(1, records.get(0).offset());
assertEquals(2, records.get(1).offset());
subscriptions.assignFromUser(singleton(tp2));
client.prepareResponse(matchesOffset(tp2, 4), fetchResponse(tp2, this.nextRecords, Errors.NONE, 100L, 0));
subscriptions.seek(tp2, 4);
assertEquals(1, fetcher.sendFetches());
consumerClient.poll(0);
Map<TopicPartition, List<ConsumerRecord<byte[], byte[]>>> fetchedRecords = fetcher.fetchedRecords();
assertNull(fetchedRecords.get(tp1));
records = fetchedRecords.get(tp2);
assertEquals(2, records.size());
assertEquals(6L, subscriptions.position(tp2).longValue());
assertEquals(4, records.get(0).offset());
assertEquals(5, records.get(1).offset());
}
|
void function() { Fetcher<byte[], byte[]> fetcher = createFetcher(subscriptions, new Metrics(time), 2); List<ConsumerRecord<byte[], byte[]>> records; subscriptions.assignFromUser(singleton(tp1)); subscriptions.seek(tp1, 1); client.prepareResponse(matchesOffset(tp1, 1), fetchResponse(tp1, this.records, Errors.NONE, 100L, 0)); assertEquals(1, fetcher.sendFetches()); consumerClient.poll(0); records = fetcher.fetchedRecords().get(tp1); assertEquals(2, records.size()); assertEquals(3L, subscriptions.position(tp1).longValue()); assertEquals(1, records.get(0).offset()); assertEquals(2, records.get(1).offset()); subscriptions.assignFromUser(singleton(tp2)); client.prepareResponse(matchesOffset(tp2, 4), fetchResponse(tp2, this.nextRecords, Errors.NONE, 100L, 0)); subscriptions.seek(tp2, 4); assertEquals(1, fetcher.sendFetches()); consumerClient.poll(0); Map<TopicPartition, List<ConsumerRecord<byte[], byte[]>>> fetchedRecords = fetcher.fetchedRecords(); assertNull(fetchedRecords.get(tp1)); records = fetchedRecords.get(tp2); assertEquals(2, records.size()); assertEquals(6L, subscriptions.position(tp2).longValue()); assertEquals(4, records.get(0).offset()); assertEquals(5, records.get(1).offset()); }
|
/**
* Test the scenario where a partition with fetched but not consumed records (i.e. max.poll.records is
* less than the number of fetched records) is unassigned and a different partition is assigned. This is a
* pattern used by Streams state restoration and KAFKA-5097 would have been caught by this test.
*/
|
Test the scenario where a partition with fetched but not consumed records (i.e. max.poll.records is less than the number of fetched records) is unassigned and a different partition is assigned. This is a pattern used by Streams state restoration and KAFKA-5097 would have been caught by this test
|
testFetchAfterPartitionWithFetchedRecordsIsUnassigned
|
{
"repo_name": "airbnb/kafka",
"path": "clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetcherTest.java",
"license": "apache-2.0",
"size": 93650
}
|
[
"java.util.List",
"java.util.Map",
"org.apache.kafka.clients.consumer.ConsumerRecord",
"org.apache.kafka.common.TopicPartition",
"org.apache.kafka.common.metrics.Metrics",
"org.apache.kafka.common.protocol.Errors",
"org.junit.Assert"
] |
import java.util.List; import java.util.Map; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.metrics.Metrics; import org.apache.kafka.common.protocol.Errors; import org.junit.Assert;
|
import java.util.*; import org.apache.kafka.clients.consumer.*; import org.apache.kafka.common.*; import org.apache.kafka.common.metrics.*; import org.apache.kafka.common.protocol.*; import org.junit.*;
|
[
"java.util",
"org.apache.kafka",
"org.junit"
] |
java.util; org.apache.kafka; org.junit;
| 1,307,300
|
private boolean readHeader() throws IOException {
if (consecutiveLineBreaks > 1) {
// break a section on an empty line
consecutiveLineBreaks = 0;
return false;
}
readName();
consecutiveLineBreaks = 0;
readValue();
// if the last line break is missed, the line
// is ignored by the reference implementation
return consecutiveLineBreaks > 0;
}
|
boolean function() throws IOException { if (consecutiveLineBreaks > 1) { consecutiveLineBreaks = 0; return false; } readName(); consecutiveLineBreaks = 0; readValue(); return consecutiveLineBreaks > 0; }
|
/**
* Read a single line from the manifest buffer.
*/
|
Read a single line from the manifest buffer
|
readHeader
|
{
"repo_name": "indashnet/InDashNet.Open.UN2000",
"path": "android/libcore/luni/src/main/java/java/util/jar/ManifestReader.java",
"license": "apache-2.0",
"size": 6067
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 674,092
|
public Builder addExpand(String element) {
if (this.expand == null) {
this.expand = new ArrayList<>();
}
this.expand.add(element);
return this;
}
|
Builder function(String element) { if (this.expand == null) { this.expand = new ArrayList<>(); } this.expand.add(element); return this; }
|
/**
* Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
* subsequent calls adds additional elements to the original list. See {@link
* FeeRefundUpdateParams#expand} for the field documentation.
*/
|
Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See <code>FeeRefundUpdateParams#expand</code> for the field documentation
|
addExpand
|
{
"repo_name": "stripe/stripe-java",
"path": "src/main/java/com/stripe/param/FeeRefundUpdateParams.java",
"license": "mit",
"size": 6137
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 670,358
|
protected void showObjects(Transaction tx, String label) {
try {
final ByteArrayOutputStream buf = new ByteArrayOutputStream();
new XMLObjectSerializer(tx).write(buf, true, true);
this.log.info("{}\n{}", label, new String(buf.toByteArray(), Charset.forName("UTF-8")));
} catch (XMLStreamException e) {
throw new RuntimeException(e);
}
}
|
void function(Transaction tx, String label) { try { final ByteArrayOutputStream buf = new ByteArrayOutputStream(); new XMLObjectSerializer(tx).write(buf, true, true); this.log.info(STR, label, new String(buf.toByteArray(), Charset.forName("UTF-8"))); } catch (XMLStreamException e) { throw new RuntimeException(e); } }
|
/**
* Dump object contents to the log.
*/
|
Dump object contents to the log
|
showObjects
|
{
"repo_name": "mmayorivera/jsimpledb",
"path": "src/test/org/jsimpledb/TestSupport.java",
"license": "apache-2.0",
"size": 12786
}
|
[
"java.io.ByteArrayOutputStream",
"java.nio.charset.Charset",
"javax.xml.stream.XMLStreamException",
"org.jsimpledb.core.Transaction",
"org.jsimpledb.util.XMLObjectSerializer"
] |
import java.io.ByteArrayOutputStream; import java.nio.charset.Charset; import javax.xml.stream.XMLStreamException; import org.jsimpledb.core.Transaction; import org.jsimpledb.util.XMLObjectSerializer;
|
import java.io.*; import java.nio.charset.*; import javax.xml.stream.*; import org.jsimpledb.core.*; import org.jsimpledb.util.*;
|
[
"java.io",
"java.nio",
"javax.xml",
"org.jsimpledb.core",
"org.jsimpledb.util"
] |
java.io; java.nio; javax.xml; org.jsimpledb.core; org.jsimpledb.util;
| 995,245
|
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
MCoreF.proxy.postInit();
Bukkit.getPluginManager().initPostEnable();
}
|
void function(FMLPostInitializationEvent event) { MCoreF.proxy.postInit(); Bukkit.getPluginManager().initPostEnable(); }
|
/**
* Renderers, Keybindings
*
* @param event
*/
|
Renderers, Keybindings
|
postInit
|
{
"repo_name": "TiSan/mcorelibforge",
"path": "src/main/java/de/tisan/mcoref/core/MCoreF.java",
"license": "gpl-2.0",
"size": 2957
}
|
[
"de.tisan.mcoref.helpers.Bukkit",
"net.minecraftforge.fml.common.event.FMLPostInitializationEvent"
] |
import de.tisan.mcoref.helpers.Bukkit; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
import de.tisan.mcoref.helpers.*; import net.minecraftforge.fml.common.event.*;
|
[
"de.tisan.mcoref",
"net.minecraftforge.fml"
] |
de.tisan.mcoref; net.minecraftforge.fml;
| 315,418
|
private final synchronized Pair<Class<?>, Class<?>> synchronizedGet(final ForeignEntityProvider.MessageHandler messageHandler) throws UnableToResolveForeignEntityException {
if (pair == null) {
pair = resolveClassPair(messageHandler);
}
return pair;
}
|
final synchronized Pair<Class<?>, Class<?>> function(final ForeignEntityProvider.MessageHandler messageHandler) throws UnableToResolveForeignEntityException { if (pair == null) { pair = resolveClassPair(messageHandler); } return pair; }
|
/**
* Returns the pair of classes, running the resolution logic and caching its result on first invocation.
* @return the pair of classes.
* @throws UnableToResolveForeignEntityException if this exception is thrown by the message handler, it is propagated.
*/
|
Returns the pair of classes, running the resolution logic and caching its result on first invocation
|
synchronizedGet
|
{
"repo_name": "levans/Open-Quark",
"path": "src/CAL_Platform/src/org/openquark/cal/compiler/ForeignFunctionInfo.java",
"license": "bsd-3-clause",
"size": 118533
}
|
[
"org.openquark.util.Pair"
] |
import org.openquark.util.Pair;
|
import org.openquark.util.*;
|
[
"org.openquark.util"
] |
org.openquark.util;
| 1,694,819
|
Object convertDataFromString( String pol, ValueMetaInterface convertMeta, String nullif, String ifNull,
int trim_type ) throws KettleValueException;
|
Object convertDataFromString( String pol, ValueMetaInterface convertMeta, String nullif, String ifNull, int trim_type ) throws KettleValueException;
|
/**
* Convert the specified string to the data type specified in this object.
*
* @param pol
* the string to be converted
* @param convertMeta
* the metadata of the object (only string type) to be converted
* @param nullif
* set the object to null if pos equals nullif (IgnoreCase)
* @param ifNull
* set the object to ifNull when pol is empty or null
* @param trim_type
* the trim type to be used (ValueMetaInterface.TRIM_TYPE_XXX)
* @return the object in the data type of this value metadata object
* @throws KettleValueException
* in case there is a data conversion error
*/
|
Convert the specified string to the data type specified in this object
|
convertDataFromString
|
{
"repo_name": "pavel-sakun/pentaho-kettle",
"path": "core/src/main/java/org/pentaho/di/core/row/ValueMetaInterface.java",
"license": "apache-2.0",
"size": 37973
}
|
[
"org.pentaho.di.core.exception.KettleValueException"
] |
import org.pentaho.di.core.exception.KettleValueException;
|
import org.pentaho.di.core.exception.*;
|
[
"org.pentaho.di"
] |
org.pentaho.di;
| 2,539,961
|
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<DataMaskingPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName);
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<DataMaskingPolicyInner> getAsync(String resourceGroupName, String serverName, String databaseName);
|
/**
* Gets a database data masking policy.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serverName The name of the server.
* @param databaseName The name of the database.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a database data masking policy.
*/
|
Gets a database data masking policy
|
getAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/fluent/DataMaskingPoliciesClient.java",
"license": "mit",
"size": 8322
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.sql.fluent.models.DataMaskingPolicyInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.sql.fluent.models.DataMaskingPolicyInner;
|
import com.azure.core.annotation.*; import com.azure.resourcemanager.sql.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 1,680,675
|
// New resources
final String rgName = Utils.randomResourceName(azureResourceManager, "rgSB01_", 24);
final String namespaceName = Utils.randomResourceName(azureResourceManager, "namespace", 20);
final String queue1Name = Utils.randomResourceName(azureResourceManager, "queue1_", 24);
final String queue2Name = Utils.randomResourceName(azureResourceManager, "queue2_", 24);
try {
//============================================================
// Create a namespace.
System.out.println("Creating name space " + namespaceName + " in resource group " + rgName + "...");
ServiceBusNamespace serviceBusNamespace = azureResourceManager.serviceBusNamespaces()
.define(namespaceName)
.withRegion(Region.US_WEST)
.withNewResourceGroup(rgName)
.withSku(NamespaceSku.BASIC)
.withNewQueue(queue1Name, 1024)
.create();
System.out.println("Created service bus " + serviceBusNamespace.name());
Utils.print(serviceBusNamespace);
Queue firstQueue = serviceBusNamespace.queues().getByName(queue1Name);
Utils.print(firstQueue);
//============================================================
// Create a second queue in same namespace
System.out.println("Creating second queue " + queue2Name + " in namespace " + namespaceName + "...");
Queue secondQueue = serviceBusNamespace.queues().define(queue2Name)
.withExpiredMessageMovedToDeadLetterQueue()
.withSizeInMB(2048)
.withMessageLockDurationInSeconds(20)
.create();
System.out.println("Created second queue in namespace");
Utils.print(secondQueue);
//============================================================
// Get and update second queue.
secondQueue = serviceBusNamespace.queues().getByName(queue2Name);
secondQueue = secondQueue.update().withSizeInMB(3072).apply();
System.out.println("Updated second queue to change its size in MB");
Utils.print(secondQueue);
//=============================================================
// Update namespace
System.out.println("Updating sku of namespace " + serviceBusNamespace.name() + "...");
serviceBusNamespace = serviceBusNamespace
.update()
.withSku(NamespaceSku.STANDARD)
.apply();
System.out.println("Updated sku of namespace " + serviceBusNamespace.name());
//=============================================================
// List namespaces
System.out.println("List of namespaces in resource group " + rgName + "...");
for (ServiceBusNamespace serviceBusNamespace1 : azureResourceManager.serviceBusNamespaces().listByResourceGroup(rgName)) {
Utils.print(serviceBusNamespace1);
}
//=============================================================
// List queues in namespaces
PagedIterable<Queue> queues = serviceBusNamespace.queues().list();
System.out.println("Number of queues in namespace :" + Utils.getSize(queues));
for (Queue queue : queues) {
Utils.print(queue);
}
//=============================================================
// Get connection string for default authorization rule of namespace
PagedIterable<NamespaceAuthorizationRule> namespaceAuthorizationRules = serviceBusNamespace.authorizationRules().list();
System.out.println("Number of authorization rule for namespace :" + Utils.getSize(namespaceAuthorizationRules));
for (NamespaceAuthorizationRule namespaceAuthorizationRule: namespaceAuthorizationRules) {
Utils.print(namespaceAuthorizationRule);
}
System.out.println("Getting keys for authorization rule ...");
AuthorizationKeys keys = namespaceAuthorizationRules.iterator().next().getKeys();
Utils.print(keys);
System.out.println("Regenerating secondary key for authorization rule ...");
keys = namespaceAuthorizationRules.iterator().next().regenerateKey(Policykey.SECONDARY_KEY);
Utils.print(keys);
//=============================================================
// Send a message to queue.
ServiceBusSenderClient sender = new ServiceBusClientBuilder()
.connectionString(keys.primaryConnectionString())
.sender()
.queueName(queue1Name)
.buildClient();
sender.sendMessage(new ServiceBusMessage("Hello World").setSessionId("23424"));
sender.close();
//=============================================================
// Delete a queue and namespace
System.out.println("Deleting queue " + queue1Name + "in namespace " + namespaceName + "...");
serviceBusNamespace.queues().deleteByName(queue1Name);
System.out.println("Deleted queue " + queue1Name + "...");
System.out.println("Deleting namespace " + namespaceName + "...");
// This will delete the namespace and queue within it.
azureResourceManager.serviceBusNamespaces().deleteById(serviceBusNamespace.id());
System.out.println("Deleted namespace " + namespaceName + "...");
return true;
} finally {
try {
System.out.println("Deleting Resource Group: " + rgName);
azureResourceManager.resourceGroups().beginDeleteByName(rgName);
System.out.println("Deleted Resource Group: " + rgName);
} catch (NullPointerException npe) {
System.out.println("Did not create any resources in Azure. No clean up is necessary");
} catch (Exception g) {
g.printStackTrace();
}
}
}
|
final String rgName = Utils.randomResourceName(azureResourceManager, STR, 24); final String namespaceName = Utils.randomResourceName(azureResourceManager, STR, 20); final String queue1Name = Utils.randomResourceName(azureResourceManager, STR, 24); final String queue2Name = Utils.randomResourceName(azureResourceManager, STR, 24); try { System.out.println(STR + namespaceName + STR + rgName + "..."); ServiceBusNamespace serviceBusNamespace = azureResourceManager.serviceBusNamespaces() .define(namespaceName) .withRegion(Region.US_WEST) .withNewResourceGroup(rgName) .withSku(NamespaceSku.BASIC) .withNewQueue(queue1Name, 1024) .create(); System.out.println(STR + serviceBusNamespace.name()); Utils.print(serviceBusNamespace); Queue firstQueue = serviceBusNamespace.queues().getByName(queue1Name); Utils.print(firstQueue); System.out.println(STR + queue2Name + STR + namespaceName + "..."); Queue secondQueue = serviceBusNamespace.queues().define(queue2Name) .withExpiredMessageMovedToDeadLetterQueue() .withSizeInMB(2048) .withMessageLockDurationInSeconds(20) .create(); System.out.println(STR); Utils.print(secondQueue); secondQueue = serviceBusNamespace.queues().getByName(queue2Name); secondQueue = secondQueue.update().withSizeInMB(3072).apply(); System.out.println(STR); Utils.print(secondQueue); System.out.println(STR + serviceBusNamespace.name() + "..."); serviceBusNamespace = serviceBusNamespace .update() .withSku(NamespaceSku.STANDARD) .apply(); System.out.println(STR + serviceBusNamespace.name()); System.out.println(STR + rgName + "..."); for (ServiceBusNamespace serviceBusNamespace1 : azureResourceManager.serviceBusNamespaces().listByResourceGroup(rgName)) { Utils.print(serviceBusNamespace1); } PagedIterable<Queue> queues = serviceBusNamespace.queues().list(); System.out.println(STR + Utils.getSize(queues)); for (Queue queue : queues) { Utils.print(queue); } PagedIterable<NamespaceAuthorizationRule> namespaceAuthorizationRules = serviceBusNamespace.authorizationRules().list(); System.out.println(STR + Utils.getSize(namespaceAuthorizationRules)); for (NamespaceAuthorizationRule namespaceAuthorizationRule: namespaceAuthorizationRules) { Utils.print(namespaceAuthorizationRule); } System.out.println(STR); AuthorizationKeys keys = namespaceAuthorizationRules.iterator().next().getKeys(); Utils.print(keys); System.out.println(STR); keys = namespaceAuthorizationRules.iterator().next().regenerateKey(Policykey.SECONDARY_KEY); Utils.print(keys); ServiceBusSenderClient sender = new ServiceBusClientBuilder() .connectionString(keys.primaryConnectionString()) .sender() .queueName(queue1Name) .buildClient(); sender.sendMessage(new ServiceBusMessage(STR).setSessionId("23424")); sender.close(); System.out.println(STR + queue1Name + STR + namespaceName + "..."); serviceBusNamespace.queues().deleteByName(queue1Name); System.out.println(STR + queue1Name + "..."); System.out.println(STR + namespaceName + "..."); azureResourceManager.serviceBusNamespaces().deleteById(serviceBusNamespace.id()); System.out.println(STR + namespaceName + "..."); return true; } finally { try { System.out.println(STR + rgName); azureResourceManager.resourceGroups().beginDeleteByName(rgName); System.out.println(STR + rgName); } catch (NullPointerException npe) { System.out.println(STR); } catch (Exception g) { g.printStackTrace(); } } }
|
/**
* Main function which runs the actual sample.
* @param azureResourceManager instance of the azure client
* @return true if sample runs successfully
*/
|
Main function which runs the actual sample
|
runSample
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/servicebus/samples/ServiceBusQueueBasic.java",
"license": "mit",
"size": 9195
}
|
[
"com.azure.core.http.rest.PagedIterable",
"com.azure.core.management.Region",
"com.azure.messaging.servicebus.ServiceBusClientBuilder",
"com.azure.messaging.servicebus.ServiceBusMessage",
"com.azure.messaging.servicebus.ServiceBusSenderClient",
"com.azure.resourcemanager.samples.Utils",
"com.azure.resourcemanager.servicebus.models.AuthorizationKeys",
"com.azure.resourcemanager.servicebus.models.NamespaceAuthorizationRule",
"com.azure.resourcemanager.servicebus.models.NamespaceSku",
"com.azure.resourcemanager.servicebus.models.Policykey",
"com.azure.resourcemanager.servicebus.models.Queue",
"com.azure.resourcemanager.servicebus.models.ServiceBusNamespace"
] |
import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.Region; import com.azure.messaging.servicebus.ServiceBusClientBuilder; import com.azure.messaging.servicebus.ServiceBusMessage; import com.azure.messaging.servicebus.ServiceBusSenderClient; import com.azure.resourcemanager.samples.Utils; import com.azure.resourcemanager.servicebus.models.AuthorizationKeys; import com.azure.resourcemanager.servicebus.models.NamespaceAuthorizationRule; import com.azure.resourcemanager.servicebus.models.NamespaceSku; import com.azure.resourcemanager.servicebus.models.Policykey; import com.azure.resourcemanager.servicebus.models.Queue; import com.azure.resourcemanager.servicebus.models.ServiceBusNamespace;
|
import com.azure.core.http.rest.*; import com.azure.core.management.*; import com.azure.messaging.servicebus.*; import com.azure.resourcemanager.samples.*; import com.azure.resourcemanager.servicebus.models.*;
|
[
"com.azure.core",
"com.azure.messaging",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.messaging; com.azure.resourcemanager;
| 326,256
|
public void onDeath(DamageSource cause)
{
super.onDeath(cause);
if (this.worldObj.getGameRules().getBoolean("doMobLoot"))
{
if (cause.getEntity() instanceof EntitySkeleton)
{
int i = Item.getIdFromItem(Items.record_13);
int j = Item.getIdFromItem(Items.record_wait);
int k = i + this.rand.nextInt(j - i + 1);
this.dropItem(Item.getItemById(k), 1);
}
else if (cause.getEntity() instanceof EntityCreeper && cause.getEntity() != this && ((EntityCreeper)cause.getEntity()).getPowered() && ((EntityCreeper)cause.getEntity()).isAIEnabled())
{
((EntityCreeper)cause.getEntity()).func_175493_co();
this.entityDropItem(new ItemStack(Items.skull, 1, 4), 0.0F);
}
}
}
|
void function(DamageSource cause) { super.onDeath(cause); if (this.worldObj.getGameRules().getBoolean(STR)) { if (cause.getEntity() instanceof EntitySkeleton) { int i = Item.getIdFromItem(Items.record_13); int j = Item.getIdFromItem(Items.record_wait); int k = i + this.rand.nextInt(j - i + 1); this.dropItem(Item.getItemById(k), 1); } else if (cause.getEntity() instanceof EntityCreeper && cause.getEntity() != this && ((EntityCreeper)cause.getEntity()).getPowered() && ((EntityCreeper)cause.getEntity()).isAIEnabled()) { ((EntityCreeper)cause.getEntity()).func_175493_co(); this.entityDropItem(new ItemStack(Items.skull, 1, 4), 0.0F); } } }
|
/**
* Called when the mob's health reaches 0.
*/
|
Called when the mob's health reaches 0
|
onDeath
|
{
"repo_name": "seblund/Dissolvable",
"path": "build/tmp/recompileMc/sources/net/minecraft/entity/monster/EntityCreeper.java",
"license": "gpl-3.0",
"size": 10645
}
|
[
"net.minecraft.init.Items",
"net.minecraft.item.Item",
"net.minecraft.item.ItemStack",
"net.minecraft.util.DamageSource"
] |
import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource;
|
import net.minecraft.init.*; import net.minecraft.item.*; import net.minecraft.util.*;
|
[
"net.minecraft.init",
"net.minecraft.item",
"net.minecraft.util"
] |
net.minecraft.init; net.minecraft.item; net.minecraft.util;
| 1,819,291
|
private Map<Integer, Class<?>> getColumnClassMap() {
if (classPerColumn == null) {
classPerColumn = new HashMap<Integer, Class<?>>();
}
return classPerColumn;
}
|
Map<Integer, Class<?>> function() { if (classPerColumn == null) { classPerColumn = new HashMap<Integer, Class<?>>(); } return classPerColumn; }
|
/**
* Returns the Map which stores the per-column Class, lazily
* creates one if null.
*
* @return the per-column storage map of Class
*/
|
Returns the Map which stores the per-column Class, lazily creates one if null
|
getColumnClassMap
|
{
"repo_name": "Mindtoeye/Hoop",
"path": "src/org/jdesktop/swingx/sort/StringValueRegistry.java",
"license": "lgpl-3.0",
"size": 6092
}
|
[
"java.util.HashMap",
"java.util.Map"
] |
import java.util.HashMap; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,215,200
|
public Map<String, byte[]> getXAttrs(Path path) throws IOException {
throw new UnsupportedOperationException(getClass().getSimpleName()
+ " doesn't support getXAttrs");
}
|
Map<String, byte[]> function(Path path) throws IOException { throw new UnsupportedOperationException(getClass().getSimpleName() + STR); }
|
/**
* Get all of the xattrs for a file or directory.
* Only those xattrs for which the logged-in user has permissions to view
* are returned.
* <p>
* Refer to the HDFS extended attributes user documentation for details.
*
* @param path Path to get extended attributes
*
* @return {@literal Map<String, byte[]>} describing the XAttrs of the file
* or directory
* @throws IOException
*/
|
Get all of the xattrs for a file or directory. Only those xattrs for which the logged-in user has permissions to view are returned. Refer to the HDFS extended attributes user documentation for details
|
getXAttrs
|
{
"repo_name": "apurtell/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java",
"license": "apache-2.0",
"size": 52035
}
|
[
"java.io.IOException",
"java.util.Map"
] |
import java.io.IOException; import java.util.Map;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 889,566
|
@Test
public void testOverwriteOpenForWrite() throws Exception {
Configuration conf = new HdfsConfiguration();
SimulatedFSDataset.setFactory(conf);
conf.setBoolean(DFSConfigKeys.DFS_PERMISSIONS_ENABLED_KEY, false);
final MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).build();
FileSystem fs = cluster.getFileSystem();
|
void function() throws Exception { Configuration conf = new HdfsConfiguration(); SimulatedFSDataset.setFactory(conf); conf.setBoolean(DFSConfigKeys.DFS_PERMISSIONS_ENABLED_KEY, false); final MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).build(); FileSystem fs = cluster.getFileSystem();
|
/**
* Test that a file which is open for write is overwritten by another
* client. Regression test for HDFS-3755.
*/
|
Test that a file which is open for write is overwritten by another client. Regression test for HDFS-3755
|
testOverwriteOpenForWrite
|
{
"repo_name": "ZhangXFeng/hadoop",
"path": "src/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestFileCreation.java",
"license": "apache-2.0",
"size": 48915
}
|
[
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.hdfs.server.datanode.SimulatedFSDataset"
] |
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hdfs.server.datanode.SimulatedFSDataset;
|
import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.server.datanode.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 1,587,318
|
public void setContent(Component content) {
if (this.content != null) {
dialog.getContentPane().remove(this.content);
}
this.content = content;
dialog.getContentPane().add(this.content, BorderLayout.CENTER);
dialog.validate();
updateHelpID();
}
|
void function(Component content) { if (this.content != null) { dialog.getContentPane().remove(this.content); } this.content = content; dialog.getContentPane().add(this.content, BorderLayout.CENTER); dialog.validate(); updateHelpID(); }
|
/**
* Sets the dialog's content component.
*
* @param content The dialog's content component.
*/
|
Sets the dialog's content component
|
setContent
|
{
"repo_name": "seadas/beam",
"path": "beam-ui/src/main/java/org/esa/beam/framework/ui/AbstractDialog.java",
"license": "gpl-3.0",
"size": 20707
}
|
[
"java.awt.BorderLayout",
"java.awt.Component"
] |
import java.awt.BorderLayout; import java.awt.Component;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 212,138
|
public static void createStore( String fileName, Map<?,?> config )
{
IdGeneratorFactory idGeneratorFactory = (IdGeneratorFactory) config.get(
IdGeneratorFactory.class );
StoreId storeId = (StoreId) config.get( StoreId.class );
if ( storeId == null ) storeId = new StoreId();
createEmptyStore( fileName, buildTypeDescriptorAndVersion( TYPE_DESCRIPTOR ), idGeneratorFactory );
NodeStore.createStore( fileName + ".nodestore.db", config );
RelationshipStore.createStore( fileName + ".relationshipstore.db", idGeneratorFactory );
PropertyStore.createStore( fileName + ".propertystore.db", config );
RelationshipTypeStore.createStore( fileName
+ ".relationshiptypestore.db", config );
if ( !config.containsKey( "neo_store" ) )
{
// TODO Ugly
Map<Object, Object> newConfig = new HashMap<Object, Object>( config );
newConfig.put( "neo_store", fileName );
config = newConfig;
}
NeoStore neoStore = new NeoStore( config );
// created time | random long | backup version | tx id
neoStore.nextId(); neoStore.nextId(); neoStore.nextId(); neoStore.nextId();
neoStore.setCreationTime( storeId.getCreationTime() );
neoStore.setRandomNumber( storeId.getRandomId() );
neoStore.setVersion( 0 );
neoStore.setLastCommittedTx( 1 );
neoStore.close();
}
|
static void function( String fileName, Map<?,?> config ) { IdGeneratorFactory idGeneratorFactory = (IdGeneratorFactory) config.get( IdGeneratorFactory.class ); StoreId storeId = (StoreId) config.get( StoreId.class ); if ( storeId == null ) storeId = new StoreId(); createEmptyStore( fileName, buildTypeDescriptorAndVersion( TYPE_DESCRIPTOR ), idGeneratorFactory ); NodeStore.createStore( fileName + STR, config ); RelationshipStore.createStore( fileName + STR, idGeneratorFactory ); PropertyStore.createStore( fileName + STR, config ); RelationshipTypeStore.createStore( fileName + STR, config ); if ( !config.containsKey( STR ) ) { Map<Object, Object> newConfig = new HashMap<Object, Object>( config ); newConfig.put( STR, fileName ); config = newConfig; } NeoStore neoStore = new NeoStore( config ); neoStore.nextId(); neoStore.nextId(); neoStore.nextId(); neoStore.nextId(); neoStore.setCreationTime( storeId.getCreationTime() ); neoStore.setRandomNumber( storeId.getRandomId() ); neoStore.setVersion( 0 ); neoStore.setLastCommittedTx( 1 ); neoStore.close(); }
|
/**
* Creates the neo,node,relationship,property and relationship type stores.
*
* @param fileName
* The name of store
* @param config
* Map of configuration parameters
*/
|
Creates the neo,node,relationship,property and relationship type stores
|
createStore
|
{
"repo_name": "neo4j-contrib/neo4j-mobile-android",
"path": "neo4j-android/kernel-src/org/neo4j/kernel/impl/nioneo/store/NeoStore.java",
"license": "gpl-3.0",
"size": 14457
}
|
[
"java.util.HashMap",
"java.util.Map",
"org.neo4j.kernel.IdGeneratorFactory"
] |
import java.util.HashMap; import java.util.Map; import org.neo4j.kernel.IdGeneratorFactory;
|
import java.util.*; import org.neo4j.kernel.*;
|
[
"java.util",
"org.neo4j.kernel"
] |
java.util; org.neo4j.kernel;
| 565,072
|
public void cursor(final int kind) {
setCursor(Cursor.getPredefinedCursor(kind));
cursorVisible = true;
cursorType = kind;
}
|
void function(final int kind) { setCursor(Cursor.getPredefinedCursor(kind)); cursorVisible = true; cursorType = kind; }
|
/**
* Set the cursor type
*
* @param kind
* either ARROW, CROSS, HAND, MOVE, TEXT, or WAIT
*/
|
Set the cursor type
|
cursor
|
{
"repo_name": "aarongolliver/FractalFlameV3",
"path": "src/processing/core/PApplet.java",
"license": "lgpl-2.1",
"size": 507010
}
|
[
"java.awt.Cursor"
] |
import java.awt.Cursor;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 48,800
|
// TODO Include sysoid and sysoidMask on validation process
private boolean contains(List<SystemDef> systemDefs, SystemDef systemDef) {
for (SystemDef sd : systemDefs) {
if (systemDef.getName().equals(sd.getName()))
return true;
}
return false;
}
|
boolean function(List<SystemDef> systemDefs, SystemDef systemDef) { for (SystemDef sd : systemDefs) { if (systemDef.getName().equals(sd.getName())) return true; } return false; }
|
/**
* Verify if the systemDefs list contains a specific system definition.
* <p>One system definition will be considered the same as another one, if they have the same name.</p>
*
* @param globalContainer
* @param systemDef
*
* @return true, if the list contains the system definition
*/
|
Verify if the systemDefs list contains a specific system definition. One system definition will be considered the same as another one, if they have the same name
|
contains
|
{
"repo_name": "bugcy013/opennms-tmp-tools",
"path": "opennms-config/src/main/java/org/opennms/netmgt/config/DataCollectionConfigParser.java",
"license": "gpl-2.0",
"size": 14956
}
|
[
"java.util.List",
"org.opennms.netmgt.config.datacollection.SystemDef"
] |
import java.util.List; import org.opennms.netmgt.config.datacollection.SystemDef;
|
import java.util.*; import org.opennms.netmgt.config.datacollection.*;
|
[
"java.util",
"org.opennms.netmgt"
] |
java.util; org.opennms.netmgt;
| 2,705,750
|
@Endpoint(name = "prepend")
public static Operand<TInt32> prepend(Scope scope, Shape<TInt32> shape, int firstDimension) {
Operand<TInt32> dim = Constant.arrayOf(scope, firstDimension);
return Concat.create(scope, Arrays.asList(dim, shape), Constant.scalarOf(scope, 0));
}
|
@Endpoint(name = STR) static Operand<TInt32> function(Scope scope, Shape<TInt32> shape, int firstDimension) { Operand<TInt32> dim = Constant.arrayOf(scope, firstDimension); return Concat.create(scope, Arrays.asList(dim, shape), Constant.scalarOf(scope, 0)); }
|
/**
* Creates a 1-dimensional operand containing the first dimension followed by the dimensions of
* the shape.
*
* @param scope current scope
* @param shape the TensorFlow shape
* @param firstDimension the dimension to prepend
* @return a 1-dimensional operand containing the first dimension followed by the dimensions of
* the shape
*/
|
Creates a 1-dimensional operand containing the first dimension followed by the dimensions of the shape
|
prepend
|
{
"repo_name": "tensorflow/java",
"path": "tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Shapes.java",
"license": "apache-2.0",
"size": 21305
}
|
[
"java.util.Arrays",
"org.tensorflow.Operand",
"org.tensorflow.op.Scope",
"org.tensorflow.op.annotation.Endpoint",
"org.tensorflow.types.TInt32"
] |
import java.util.Arrays; import org.tensorflow.Operand; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.types.TInt32;
|
import java.util.*; import org.tensorflow.*; import org.tensorflow.op.*; import org.tensorflow.op.annotation.*; import org.tensorflow.types.*;
|
[
"java.util",
"org.tensorflow",
"org.tensorflow.op",
"org.tensorflow.types"
] |
java.util; org.tensorflow; org.tensorflow.op; org.tensorflow.types;
| 1,958,713
|
public Path overwriteFile(String pathName, Charset charset, String... lines) throws IOException {
Path oldFile = resolve(pathName);
long newMTime = oldFile.exists() ? oldFile.getLastModifiedTime() + 1 : -1;
oldFile.delete();
Path newFile = file(pathName, charset, lines);
newFile.setLastModifiedTime(newMTime);
return newFile;
}
|
Path function(String pathName, Charset charset, String... lines) throws IOException { Path oldFile = resolve(pathName); long newMTime = oldFile.exists() ? oldFile.getLastModifiedTime() + 1 : -1; oldFile.delete(); Path newFile = file(pathName, charset, lines); newFile.setLastModifiedTime(newMTime); return newFile; }
|
/**
* Like {@code scratch.file}, but the file is first deleted if it already
* exists.
*/
|
Like scratch.file, but the file is first deleted if it already exists
|
overwriteFile
|
{
"repo_name": "dslomov/bazel",
"path": "src/test/java/com/google/devtools/build/lib/testutil/Scratch.java",
"license": "apache-2.0",
"size": 7834
}
|
[
"com.google.devtools.build.lib.vfs.Path",
"java.io.IOException",
"java.nio.charset.Charset"
] |
import com.google.devtools.build.lib.vfs.Path; import java.io.IOException; import java.nio.charset.Charset;
|
import com.google.devtools.build.lib.vfs.*; import java.io.*; import java.nio.charset.*;
|
[
"com.google.devtools",
"java.io",
"java.nio"
] |
com.google.devtools; java.io; java.nio;
| 1,563,233
|
@Test
public void testInvalidMechanism() throws Exception {
String node = "0";
SecurityProtocol securityProtocol = SecurityProtocol.SASL_SSL;
configureMechanisms("PLAIN", Arrays.asList("PLAIN"));
saslClientConfigs.put(SaslConfigs.SASL_MECHANISM, "INVALID");
server = createEchoServer(securityProtocol);
createAndCheckClientConnectionFailure(securityProtocol, node);
server.verifyAuthenticationMetrics(0, 1);
}
|
void function() throws Exception { String node = "0"; SecurityProtocol securityProtocol = SecurityProtocol.SASL_SSL; configureMechanisms("PLAIN", Arrays.asList("PLAIN")); saslClientConfigs.put(SaslConfigs.SASL_MECHANISM, STR); server = createEchoServer(securityProtocol); createAndCheckClientConnectionFailure(securityProtocol, node); server.verifyAuthenticationMetrics(0, 1); }
|
/**
* Tests that clients using invalid SASL mechanisms fail authentication.
*/
|
Tests that clients using invalid SASL mechanisms fail authentication
|
testInvalidMechanism
|
{
"repo_name": "MyPureCloud/kafka",
"path": "clients/src/test/java/org/apache/kafka/common/security/authenticator/SaslAuthenticatorTest.java",
"license": "apache-2.0",
"size": 64909
}
|
[
"java.util.Arrays",
"org.apache.kafka.common.config.SaslConfigs",
"org.apache.kafka.common.security.auth.SecurityProtocol"
] |
import java.util.Arrays; import org.apache.kafka.common.config.SaslConfigs; import org.apache.kafka.common.security.auth.SecurityProtocol;
|
import java.util.*; import org.apache.kafka.common.config.*; import org.apache.kafka.common.security.auth.*;
|
[
"java.util",
"org.apache.kafka"
] |
java.util; org.apache.kafka;
| 2,392,655
|
@Test
public void testConcurrentOperationsDunitTestOnBlockingQueue() throws Exception {
concurrentOperationsDunitTest(true, Scope.DISTRIBUTED_ACK);
}
|
void function() throws Exception { concurrentOperationsDunitTest(true, Scope.DISTRIBUTED_ACK); }
|
/**
* Tests the Blokcing HARegionQueue by doing concurrent put /remove / take / peek , batch peek
* operations in multiple regions. The test will have take/remove occuring in all the VMs. This
* test is targetted to test for hang or exceptions in blocking queue.
*/
|
Tests the Blokcing HARegionQueue by doing concurrent put /remove / take / peek , batch peek operations in multiple regions. The test will have take/remove occuring in all the VMs. This test is targetted to test for hang or exceptions in blocking queue
|
testConcurrentOperationsDunitTestOnBlockingQueue
|
{
"repo_name": "deepakddixit/incubator-geode",
"path": "geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ha/HARegionQueueDUnitTest.java",
"license": "apache-2.0",
"size": 37074
}
|
[
"org.apache.geode.cache.Scope"
] |
import org.apache.geode.cache.Scope;
|
import org.apache.geode.cache.*;
|
[
"org.apache.geode"
] |
org.apache.geode;
| 554,200
|
@Test
public void testNullTruststorePassword() throws Exception {
String node = "0";
sslClientConfigs.remove(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG);
sslServerConfigs.remove(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG);
server = createEchoServer(SecurityProtocol.SSL);
createSelector(sslClientConfigs);
InetSocketAddress addr = new InetSocketAddress("localhost", server.port());
selector.connect(node, addr, BUFFER_SIZE, BUFFER_SIZE);
NetworkTestUtils.checkClientConnection(selector, node, 100, 10);
}
|
void function() throws Exception { String node = "0"; sslClientConfigs.remove(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG); sslServerConfigs.remove(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG); server = createEchoServer(SecurityProtocol.SSL); createSelector(sslClientConfigs); InetSocketAddress addr = new InetSocketAddress(STR, server.port()); selector.connect(node, addr, BUFFER_SIZE, BUFFER_SIZE); NetworkTestUtils.checkClientConnection(selector, node, 100, 10); }
|
/**
* Tests that client connections can be created to a server
* if null truststore password is used
*/
|
Tests that client connections can be created to a server if null truststore password is used
|
testNullTruststorePassword
|
{
"repo_name": "mihbor/kafka",
"path": "clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java",
"license": "apache-2.0",
"size": 56396
}
|
[
"java.net.InetSocketAddress",
"org.apache.kafka.common.config.SslConfigs",
"org.apache.kafka.common.security.auth.SecurityProtocol"
] |
import java.net.InetSocketAddress; import org.apache.kafka.common.config.SslConfigs; import org.apache.kafka.common.security.auth.SecurityProtocol;
|
import java.net.*; import org.apache.kafka.common.config.*; import org.apache.kafka.common.security.auth.*;
|
[
"java.net",
"org.apache.kafka"
] |
java.net; org.apache.kafka;
| 1,319,156
|
public synchronized IMAPNamespaceResponse getNamespaces() throws MessagingException {
// if no namespace capability, then return an empty
// response, which will trigger the default behavior.
if (!hasCapability("NAMESPACE")) {
return new IMAPNamespaceResponse();
}
// no arguments on this command, so just send an hope it works.
sendCommand("NAMESPACE");
// this should be here, since it's a required response when the
// command worked. Just extract, and return.
return (IMAPNamespaceResponse)extractResponse("NAMESPACE");
}
|
synchronized IMAPNamespaceResponse function() throws MessagingException { if (!hasCapability(STR)) { return new IMAPNamespaceResponse(); } sendCommand(STR); return (IMAPNamespaceResponse)extractResponse(STR); }
|
/**
* Retrieve the user name space info from the server.
*
* @return An IMAPNamespace response item with the information. If the server
* doesn't support the namespace extension, an empty one is returned.
*/
|
Retrieve the user name space info from the server
|
getNamespaces
|
{
"repo_name": "apache/geronimo-javamail",
"path": "geronimo-javamail_1.6/geronimo-javamail_1.6_provider/src/main/java/org/apache/geronimo/javamail/store/imap/connection/IMAPConnection.java",
"license": "apache-2.0",
"size": 75320
}
|
[
"javax.mail.MessagingException"
] |
import javax.mail.MessagingException;
|
import javax.mail.*;
|
[
"javax.mail"
] |
javax.mail;
| 558,023
|
private void sortRegions() {
List<SortKey<Region>> keys = new ArrayList<SortKey<Region>>();
for (Region r : regionList) {
SortKey<Region> key = sort.createSortKey(r, r.getLabel().getText(), r.getCountry().getIndex());
keys.add(key);
}
Collections.sort(keys);
regionList.clear();
int index = 1;
for (SortKey<Region> key : keys) {
Region r = key.getObject();
r.setIndex(index++);
regionList.add(r);
}
}
|
void function() { List<SortKey<Region>> keys = new ArrayList<SortKey<Region>>(); for (Region r : regionList) { SortKey<Region> key = sort.createSortKey(r, r.getLabel().getText(), r.getCountry().getIndex()); keys.add(key); } Collections.sort(keys); regionList.clear(); int index = 1; for (SortKey<Region> key : keys) { Region r = key.getObject(); r.setIndex(index++); regionList.add(r); } }
|
/**
* Sort the regions by the defined sort.
*/
|
Sort the regions by the defined sort
|
sortRegions
|
{
"repo_name": "balp/mkgmap",
"path": "src/uk/me/parabola/imgfmt/app/lbl/PlacesFile.java",
"license": "gpl-2.0",
"size": 11009
}
|
[
"java.util.ArrayList",
"java.util.Collections",
"java.util.List",
"uk.me.parabola.imgfmt.app.srt.SortKey"
] |
import java.util.ArrayList; import java.util.Collections; import java.util.List; import uk.me.parabola.imgfmt.app.srt.SortKey;
|
import java.util.*; import uk.me.parabola.imgfmt.app.srt.*;
|
[
"java.util",
"uk.me.parabola"
] |
java.util; uk.me.parabola;
| 2,112,695
|
private boolean isNotAPublicClass(final Class<?> thisPojoClass) {
return thisPojoClass != null
&& (Modifier.PUBLIC & thisPojoClass.getModifiers()) != Modifier.PUBLIC;
}
/**
* Gets a list of writable methods / mutator methods. <br>
*
* @param thisPojoClass
* for which mutator methods must be found
* @return List of {@link CtMethod}
|
boolean function(final Class<?> thisPojoClass) { return thisPojoClass != null && (Modifier.PUBLIC & thisPojoClass.getModifiers()) != Modifier.PUBLIC; } /** * Gets a list of writable methods / mutator methods. <br> * * @param thisPojoClass * for which mutator methods must be found * @return List of {@link CtMethod}
|
/**
* Return true if class passed is <b>not</b> a public class
*
* @param thisPojoClass
* to be verified if its public
* @return true if thisPojoClass is <b>not</b> public
*/
|
Return true if class passed is not a public class
|
isNotAPublicClass
|
{
"repo_name": "venkateshamurthy/design-patterns",
"path": "builders/src/main/java/com/github/venkateshamurthy/designpatterns/builders/FluentBuilders.java",
"license": "apache-2.0",
"size": 28325
}
|
[
"java.lang.reflect.Modifier",
"java.util.List"
] |
import java.lang.reflect.Modifier; import java.util.List;
|
import java.lang.reflect.*; import java.util.*;
|
[
"java.lang",
"java.util"
] |
java.lang; java.util;
| 2,127,987
|
public static Tailer create(File file, TailerListener listener, long delayMillis, boolean end, boolean reOpen) {
return create(file, listener, delayMillis, end, reOpen, DEFAULT_BUFSIZE);
}
|
static Tailer function(File file, TailerListener listener, long delayMillis, boolean end, boolean reOpen) { return create(file, listener, delayMillis, end, reOpen, DEFAULT_BUFSIZE); }
|
/**
* Creates and starts a Tailer for the given file with default buffer size.
*
* @param file the file to follow.
* @param listener the TailerListener to use.
* @param delayMillis the delay between checks of the file for new content in milliseconds.
* @param end Set to true to tail from the end of the file, false to tail from the beginning of the file.
* @param reOpen whether to close/reopen the file between chunks
* @return The new tailer
*/
|
Creates and starts a Tailer for the given file with default buffer size
|
create
|
{
"repo_name": "Herobrine2Nether/NetherLauncher",
"path": "src/org/apache/commons/io/input/Tailer.java",
"license": "mit",
"size": 17367
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,871,035
|
private static boolean reportProblems(ValidationContext vctx) {
ArrayList probs = vctx.getProblems();
boolean error = false;
if (probs.size() > 0) {
for (int j = 0; j < probs.size(); j++) {
ValidationProblem prob = (ValidationProblem)probs.get(j);
String text;
if (prob.getSeverity() >= ValidationProblem.ERROR_LEVEL) {
error = true;
text = "Error: " + prob.getDescription();
s_logger.error(text);
} else {
text = "Warning: " + prob.getDescription();
s_logger.info(text);
}
System.out.println(text);
}
}
probs.clear();
return error;
}
|
static boolean function(ValidationContext vctx) { ArrayList probs = vctx.getProblems(); boolean error = false; if (probs.size() > 0) { for (int j = 0; j < probs.size(); j++) { ValidationProblem prob = (ValidationProblem)probs.get(j); String text; if (prob.getSeverity() >= ValidationProblem.ERROR_LEVEL) { error = true; text = STR + prob.getDescription(); s_logger.error(text); } else { text = STR + prob.getDescription(); s_logger.info(text); } System.out.println(text); } } probs.clear(); return error; }
|
/**
* Report problems using console output. This clears the problem list after they've been reported, to avoid multiple
* reports of the same problems.
*
* @param vctx
* @return <code>true</code> if one or more errors, <code>false</code> if not
*/
|
Report problems using console output. This clears the problem list after they've been reported, to avoid multiple reports of the same problems
|
reportProblems
|
{
"repo_name": "vkorbut/jibx",
"path": "jibx/build/src/org/jibx/schema/codegen/Refactory.java",
"license": "bsd-3-clause",
"size": 36253
}
|
[
"java.util.ArrayList",
"org.jibx.schema.validation.ValidationContext",
"org.jibx.schema.validation.ValidationProblem"
] |
import java.util.ArrayList; import org.jibx.schema.validation.ValidationContext; import org.jibx.schema.validation.ValidationProblem;
|
import java.util.*; import org.jibx.schema.validation.*;
|
[
"java.util",
"org.jibx.schema"
] |
java.util; org.jibx.schema;
| 18,194
|
@RequestMapping(value = "/find/reg/pendisplayid/contains/{displayId}", method = RequestMethod.GET)
public ModelAndView findRegistrationsByPenDisplayIdContains(@PathVariable String displayId) {
String method = "findRegistrationsByDisplayIdContains(" + displayId + ")";
ServiceResponse response = null;
ModelAndView mv = new ModelAndView();
logger.info("BEFORE - " + method);
long start = System.currentTimeMillis();
// Validate penSerial param
if (displayId == null || displayId.isEmpty()) {
String msg = "Missing 'penSerial' parameter.";
logger.error(method + msg);
response = new ErrorResponse(ResponseCode.MISSING_PARAMETER, msg);
mv.setViewName(VIEW_XML_RESPONSE);
mv.addObject("response", response);
return mv;
}
List<Registration> registrations = null;
try {
registrations = registrationService.findByPartialPenDisplayId(displayId);
response = new RegistrationListResponse(ResponseCode.SUCCESS, registrations);
mv.setViewName(VIEW_XML_RESPONSE);
mv.addObject("response", response);
return mv;
} catch (RegistrationNotFoundException e) {
String msg = "No registration record found for display ID '" + displayId + "'.";
logger.info(method + " - " + msg);
response = new ErrorResponse(ResponseCode.REGISTRATION_NOT_FOUND, msg);
mv.setViewName(VIEW_XML_RESPONSE);
mv.addObject("response", response);
return mv;
} finally {
long end = System.currentTimeMillis();
long duration = end - start;
logger.info("AFTER - " + method + " - Completed after " + duration + " milliseconds.");
}
}
|
@RequestMapping(value = STR, method = RequestMethod.GET) ModelAndView function(@PathVariable String displayId) { String method = STR + displayId + ")"; ServiceResponse response = null; ModelAndView mv = new ModelAndView(); logger.info(STR + method); long start = System.currentTimeMillis(); if (displayId == null displayId.isEmpty()) { String msg = STR; logger.error(method + msg); response = new ErrorResponse(ResponseCode.MISSING_PARAMETER, msg); mv.setViewName(VIEW_XML_RESPONSE); mv.addObject(STR, response); return mv; } List<Registration> registrations = null; try { registrations = registrationService.findByPartialPenDisplayId(displayId); response = new RegistrationListResponse(ResponseCode.SUCCESS, registrations); mv.setViewName(VIEW_XML_RESPONSE); mv.addObject(STR, response); return mv; } catch (RegistrationNotFoundException e) { String msg = STR + displayId + "'."; logger.info(method + STR + msg); response = new ErrorResponse(ResponseCode.REGISTRATION_NOT_FOUND, msg); mv.setViewName(VIEW_XML_RESPONSE); mv.addObject(STR, response); return mv; } finally { long end = System.currentTimeMillis(); long duration = end - start; logger.info(STR + method + STR + duration + STR); } }
|
/**
* <p>Find registrations by penDisplayId</p>
*
* @param displayId
* @return
*/
|
Find registrations by penDisplayId
|
findRegistrationsByPenDisplayIdContains
|
{
"repo_name": "jackstraw66/web",
"path": "livescribe/lsregistration/src/main/java/com/livescribe/web/registration/controller/FindRegistrationController.java",
"license": "bsd-2-clause",
"size": 17278
}
|
[
"com.livescribe.framework.orm.vectordb.Registration",
"com.livescribe.framework.web.response.ErrorResponse",
"com.livescribe.framework.web.response.ResponseCode",
"com.livescribe.framework.web.response.ServiceResponse",
"com.livescribe.web.registration.exception.RegistrationNotFoundException",
"com.livescribe.web.registration.response.RegistrationListResponse",
"java.util.List",
"org.springframework.web.bind.annotation.PathVariable",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod",
"org.springframework.web.servlet.ModelAndView"
] |
import com.livescribe.framework.orm.vectordb.Registration; import com.livescribe.framework.web.response.ErrorResponse; import com.livescribe.framework.web.response.ResponseCode; import com.livescribe.framework.web.response.ServiceResponse; import com.livescribe.web.registration.exception.RegistrationNotFoundException; import com.livescribe.web.registration.response.RegistrationListResponse; import java.util.List; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView;
|
import com.livescribe.framework.orm.vectordb.*; import com.livescribe.framework.web.response.*; import com.livescribe.web.registration.exception.*; import com.livescribe.web.registration.response.*; import java.util.*; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.*;
|
[
"com.livescribe.framework",
"com.livescribe.web",
"java.util",
"org.springframework.web"
] |
com.livescribe.framework; com.livescribe.web; java.util; org.springframework.web;
| 943,190
|
public void testDepartmentsResourceJAXB() throws Exception {
PostMethod postMethod = null;
GetMethod getAllMethod = null;
GetMethod getOneMethod = null;
HeadMethod headMethod = null;
DeleteMethod deleteMethod = null;
try {
// make sure everything is clear before testing
DepartmentDatabase.clearEntries();
// create a new Department
Department newDepartment = new Department();
newDepartment.setDepartmentId("1");
newDepartment.setDepartmentName("Marketing");
JAXBContext context =
JAXBContext.newInstance(new Class<?>[] {Department.class,
DepartmentListWrapper.class});
Marshaller marshaller = context.createMarshaller();
StringWriter sw = new StringWriter();
marshaller.marshal(newDepartment, sw);
HttpClient client = new HttpClient();
postMethod = new PostMethod(getBaseURI());
RequestEntity reqEntity =
new ByteArrayRequestEntity(sw.toString().getBytes(), "text/xml");
postMethod.setRequestEntity(reqEntity);
client.executeMethod(postMethod);
newDepartment = new Department();
newDepartment.setDepartmentId("2");
newDepartment.setDepartmentName("Sales");
sw = new StringWriter();
marshaller.marshal(newDepartment, sw);
client = new HttpClient();
postMethod = new PostMethod(getBaseURI());
reqEntity = new ByteArrayRequestEntity(sw.toString().getBytes(), "text/xml");
postMethod.setRequestEntity(reqEntity);
client.executeMethod(postMethod);
// now let's get the list of Departments that we just created
// (should be 2)
client = new HttpClient();
getAllMethod = new GetMethod(getBaseURI());
client.executeMethod(getAllMethod);
byte[] bytes = getAllMethod.getResponseBody();
assertNotNull(bytes);
InputStream bais = new ByteArrayInputStream(bytes);
Unmarshaller unmarshaller = context.createUnmarshaller();
Object obj = unmarshaller.unmarshal(bais);
assertTrue(obj instanceof DepartmentListWrapper);
DepartmentListWrapper wrapper = (DepartmentListWrapper)obj;
List<Department> dptList = wrapper.getDepartmentList();
assertNotNull(dptList);
assertEquals(2, dptList.size());
// now get a specific Department that was created
client = new HttpClient();
getOneMethod = new GetMethod(getBaseURI() + "/1");
client.executeMethod(getOneMethod);
bytes = getOneMethod.getResponseBody();
assertNotNull(bytes);
bais = new ByteArrayInputStream(bytes);
obj = unmarshaller.unmarshal(bais);
assertTrue(obj instanceof Department);
Department dept = (Department)obj;
assertEquals("1", dept.getDepartmentId());
assertEquals("Marketing", dept.getDepartmentName());
// let's send a Head request for both an existent and non-existent
// resource
// we are testing to see if header values being set in the resource
// implementation
// are sent back appropriately
client = new HttpClient();
headMethod = new HeadMethod(getBaseURI() + "/3");
client.executeMethod(headMethod);
assertNotNull(headMethod.getResponseHeaders());
Header header = headMethod.getResponseHeader("unresolved-id");
assertNotNull(header);
assertEquals("3", header.getValue());
headMethod.releaseConnection();
// now the resource that should exist
headMethod = new HeadMethod(getBaseURI() + "/1");
client.executeMethod(headMethod);
assertNotNull(headMethod.getResponseHeaders());
header = headMethod.getResponseHeader("resolved-id");
assertNotNull(header);
assertEquals("1", header.getValue());
deleteMethod = new DeleteMethod(getBaseURI() + "/1");
client.executeMethod(deleteMethod);
assertEquals(204, deleteMethod.getStatusCode());
deleteMethod = new DeleteMethod(getBaseURI() + "/2");
client.executeMethod(deleteMethod);
assertEquals(204, deleteMethod.getStatusCode());
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
} finally {
if (postMethod != null) {
postMethod.releaseConnection();
}
if (getAllMethod != null) {
getAllMethod.releaseConnection();
}
if (getOneMethod != null) {
getOneMethod.releaseConnection();
}
if (headMethod != null) {
headMethod.releaseConnection();
}
if (deleteMethod != null) {
deleteMethod.releaseConnection();
}
}
}
|
void function() throws Exception { PostMethod postMethod = null; GetMethod getAllMethod = null; GetMethod getOneMethod = null; HeadMethod headMethod = null; DeleteMethod deleteMethod = null; try { DepartmentDatabase.clearEntries(); Department newDepartment = new Department(); newDepartment.setDepartmentId("1"); newDepartment.setDepartmentName(STR); JAXBContext context = JAXBContext.newInstance(new Class<?>[] {Department.class, DepartmentListWrapper.class}); Marshaller marshaller = context.createMarshaller(); StringWriter sw = new StringWriter(); marshaller.marshal(newDepartment, sw); HttpClient client = new HttpClient(); postMethod = new PostMethod(getBaseURI()); RequestEntity reqEntity = new ByteArrayRequestEntity(sw.toString().getBytes(), STR); postMethod.setRequestEntity(reqEntity); client.executeMethod(postMethod); newDepartment = new Department(); newDepartment.setDepartmentId("2"); newDepartment.setDepartmentName("Sales"); sw = new StringWriter(); marshaller.marshal(newDepartment, sw); client = new HttpClient(); postMethod = new PostMethod(getBaseURI()); reqEntity = new ByteArrayRequestEntity(sw.toString().getBytes(), STR); postMethod.setRequestEntity(reqEntity); client.executeMethod(postMethod); client = new HttpClient(); getAllMethod = new GetMethod(getBaseURI()); client.executeMethod(getAllMethod); byte[] bytes = getAllMethod.getResponseBody(); assertNotNull(bytes); InputStream bais = new ByteArrayInputStream(bytes); Unmarshaller unmarshaller = context.createUnmarshaller(); Object obj = unmarshaller.unmarshal(bais); assertTrue(obj instanceof DepartmentListWrapper); DepartmentListWrapper wrapper = (DepartmentListWrapper)obj; List<Department> dptList = wrapper.getDepartmentList(); assertNotNull(dptList); assertEquals(2, dptList.size()); client = new HttpClient(); getOneMethod = new GetMethod(getBaseURI() + "/1"); client.executeMethod(getOneMethod); bytes = getOneMethod.getResponseBody(); assertNotNull(bytes); bais = new ByteArrayInputStream(bytes); obj = unmarshaller.unmarshal(bais); assertTrue(obj instanceof Department); Department dept = (Department)obj; assertEquals("1", dept.getDepartmentId()); assertEquals(STR, dept.getDepartmentName()); client = new HttpClient(); headMethod = new HeadMethod(getBaseURI() + "/3"); client.executeMethod(headMethod); assertNotNull(headMethod.getResponseHeaders()); Header header = headMethod.getResponseHeader(STR); assertNotNull(header); assertEquals("3", header.getValue()); headMethod.releaseConnection(); headMethod = new HeadMethod(getBaseURI() + "/1"); client.executeMethod(headMethod); assertNotNull(headMethod.getResponseHeaders()); header = headMethod.getResponseHeader(STR); assertNotNull(header); assertEquals("1", header.getValue()); deleteMethod = new DeleteMethod(getBaseURI() + "/1"); client.executeMethod(deleteMethod); assertEquals(204, deleteMethod.getStatusCode()); deleteMethod = new DeleteMethod(getBaseURI() + "/2"); client.executeMethod(deleteMethod); assertEquals(204, deleteMethod.getStatusCode()); } catch (Exception e) { e.printStackTrace(); fail(e.getMessage()); } finally { if (postMethod != null) { postMethod.releaseConnection(); } if (getAllMethod != null) { getAllMethod.releaseConnection(); } if (getOneMethod != null) { getOneMethod.releaseConnection(); } if (headMethod != null) { headMethod.releaseConnection(); } if (deleteMethod != null) { deleteMethod.releaseConnection(); } } }
|
/**
* This will drive several different requests that interact with the
* Departments resource class.
*/
|
This will drive several different requests that interact with the Departments resource class
|
testDepartmentsResourceJAXB
|
{
"repo_name": "apache/wink",
"path": "wink-itests/wink-itest/wink-itest-providers/src/test/java/org/apache/wink/itest/contextresolver/DepartmentTest.java",
"license": "apache-2.0",
"size": 7300
}
|
[
"java.io.ByteArrayInputStream",
"java.io.InputStream",
"java.io.StringWriter",
"java.util.List",
"javax.xml.bind.JAXBContext",
"javax.xml.bind.Marshaller",
"javax.xml.bind.Unmarshaller",
"org.apache.commons.httpclient.Header",
"org.apache.commons.httpclient.HttpClient",
"org.apache.commons.httpclient.methods.ByteArrayRequestEntity",
"org.apache.commons.httpclient.methods.DeleteMethod",
"org.apache.commons.httpclient.methods.GetMethod",
"org.apache.commons.httpclient.methods.HeadMethod",
"org.apache.commons.httpclient.methods.PostMethod",
"org.apache.commons.httpclient.methods.RequestEntity"
] |
import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.StringWriter; import java.util.List; import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; import org.apache.commons.httpclient.Header; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.ByteArrayRequestEntity; import org.apache.commons.httpclient.methods.DeleteMethod; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.methods.HeadMethod; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.RequestEntity;
|
import java.io.*; import java.util.*; import javax.xml.bind.*; import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.methods.*;
|
[
"java.io",
"java.util",
"javax.xml",
"org.apache.commons"
] |
java.io; java.util; javax.xml; org.apache.commons;
| 499,733
|
public String getContactServiceProvider(final String userID, final String command) throws IOException, MarshalException, ValidationException {
update();
m_readLock.lock();
try {
final User user = m_users.get(userID);
return _getContactServiceProvider(user, command);
} finally {
m_readLock.unlock();
}
}
|
String function(final String userID, final String command) throws IOException, MarshalException, ValidationException { update(); m_readLock.lock(); try { final User user = m_users.get(userID); return _getContactServiceProvider(user, command); } finally { m_readLock.unlock(); } }
|
/**
* Get the contact service provider, given a command string
*
* @param userID
* the name of the user
* @param command
* the command to look up the contact info for
* @return the contact information
* @throws java.io.IOException if any.
* @throws org.exolab.castor.xml.MarshalException if any.
* @throws org.exolab.castor.xml.ValidationException if any.
*/
|
Get the contact service provider, given a command string
|
getContactServiceProvider
|
{
"repo_name": "tharindum/opennms_dashboard",
"path": "opennms-services/src/main/java/org/opennms/netmgt/config/UserManager.java",
"license": "gpl-2.0",
"size": 45286
}
|
[
"java.io.IOException",
"org.exolab.castor.xml.MarshalException",
"org.exolab.castor.xml.ValidationException",
"org.opennms.netmgt.config.users.User"
] |
import java.io.IOException; import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.ValidationException; import org.opennms.netmgt.config.users.User;
|
import java.io.*; import org.exolab.castor.xml.*; import org.opennms.netmgt.config.users.*;
|
[
"java.io",
"org.exolab.castor",
"org.opennms.netmgt"
] |
java.io; org.exolab.castor; org.opennms.netmgt;
| 1,527,817
|
public void setLogWriter(PrintWriter arg0) throws SQLException {
}
|
void function(PrintWriter arg0) throws SQLException { }
|
/***************************************************************************
* Not implemented
**************************************************************************/
|
Not implemented
|
setLogWriter
|
{
"repo_name": "lbownik/linkset",
"path": "src/main/java/org/linkset/DummyDataSource.java",
"license": "lgpl-3.0",
"size": 4287
}
|
[
"java.io.PrintWriter",
"java.sql.SQLException"
] |
import java.io.PrintWriter; import java.sql.SQLException;
|
import java.io.*; import java.sql.*;
|
[
"java.io",
"java.sql"
] |
java.io; java.sql;
| 2,849,562
|
private void inputOutputFields( StepMeta stepMeta, boolean before ) {
spoon.refreshGraph();
transMeta.setRepository( spoon.rep );
SearchFieldsProgressDialog op = new SearchFieldsProgressDialog( transMeta, stepMeta, before );
boolean alreadyThrownError = false;
try {
final ProgressMonitorDialog pmd = new ProgressMonitorDialog( shell );
|
void function( StepMeta stepMeta, boolean before ) { spoon.refreshGraph(); transMeta.setRepository( spoon.rep ); SearchFieldsProgressDialog op = new SearchFieldsProgressDialog( transMeta, stepMeta, before ); boolean alreadyThrownError = false; try { final ProgressMonitorDialog pmd = new ProgressMonitorDialog( shell );
|
/**
* Display the input- or outputfields for a step.
*
* @param stepMeta The step (it's metadata) to query
* @param before set to true if you want to have the fields going INTO the step, false if you want to see all the
* fields that exit the step.
*/
|
Display the input- or outputfields for a step
|
inputOutputFields
|
{
"repo_name": "Advent51/pentaho-kettle",
"path": "ui/src/main/java/org/pentaho/di/ui/spoon/trans/TransGraph.java",
"license": "apache-2.0",
"size": 174302
}
|
[
"org.eclipse.jface.dialogs.ProgressMonitorDialog",
"org.pentaho.di.trans.step.StepMeta",
"org.pentaho.di.ui.spoon.dialog.SearchFieldsProgressDialog"
] |
import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.pentaho.di.trans.step.StepMeta; import org.pentaho.di.ui.spoon.dialog.SearchFieldsProgressDialog;
|
import org.eclipse.jface.dialogs.*; import org.pentaho.di.trans.step.*; import org.pentaho.di.ui.spoon.dialog.*;
|
[
"org.eclipse.jface",
"org.pentaho.di"
] |
org.eclipse.jface; org.pentaho.di;
| 642,656
|
protected boolean processLine(final CommandLine line) {
if (line.hasOption("version")) {
System.out.println("version " + getVersion());
return false;
}
if (line.hasOption("addPad")) {
_addPad = true;
}
if (line.hasOption("addHang")) {
_addHang = true;
}
if (line.hasOption("input")) {
String input = line.getOptionValue("input").trim();
if (!setInput(input)) {
return false;
}
}
if (line.hasOption("output")) {
String output = line.getOptionValue("output").trim();
if (!setOutput(output)) {
return false;
}
}
return true;
}
|
boolean function(final CommandLine line) { if (line.hasOption(STR)) { System.out.println(STR + getVersion()); return false; } if (line.hasOption(STR)) { _addPad = true; } if (line.hasOption(STR)) { _addHang = true; } if (line.hasOption("input")) { String input = line.getOptionValue("input").trim(); if (!setInput(input)) { return false; } } if (line.hasOption(STR)) { String output = line.getOptionValue(STR).trim(); if (!setOutput(output)) { return false; } } return true; }
|
/**
* Process the command line options selected.
* @param line the parsed command line
* @return false if processing needs to stop, true if its ok to continue
*/
|
Process the command line options selected
|
processLine
|
{
"repo_name": "DengGary/legstar-pli2cob",
"path": "src/main/java/com/legstar/pli2cob/exe/PLIStructureToCobolMain.java",
"license": "lgpl-2.1",
"size": 11217
}
|
[
"org.apache.commons.cli.CommandLine"
] |
import org.apache.commons.cli.CommandLine;
|
import org.apache.commons.cli.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 1,231,062
|
public boolean primitiveMkdir(String src, FsPermission absPermission)
throws IOException {
checkOpen();
if (absPermission == null) {
absPermission =
FsPermission.getDefault().applyUMask(FsPermission.getUMask(conf));
}
if(LOG.isDebugEnabled()) {
LOG.debug(src + ": masked=" + absPermission);
}
try {
return namenode.mkdirs(src, absPermission, true);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
NSQuotaExceededException.class,
DSQuotaExceededException.class,
UnresolvedPathException.class);
}
}
|
boolean function(String src, FsPermission absPermission) throws IOException { checkOpen(); if (absPermission == null) { absPermission = FsPermission.getDefault().applyUMask(FsPermission.getUMask(conf)); } if(LOG.isDebugEnabled()) { LOG.debug(src + STR + absPermission); } try { return namenode.mkdirs(src, absPermission, true); } catch(RemoteException re) { throw re.unwrapRemoteException(AccessControlException.class, NSQuotaExceededException.class, DSQuotaExceededException.class, UnresolvedPathException.class); } }
|
/**
* Same {{@link #mkdirs(String, FsPermission, boolean)} except
* that the permissions has already been masked against umask.
*/
|
Same {<code>#mkdirs(String, FsPermission, boolean)</code> except that the permissions has already been masked against umask
|
primitiveMkdir
|
{
"repo_name": "cumulusyebl/cumulus",
"path": "src/java/org/apache/hadoop/hdfs/DFSClient.java",
"license": "apache-2.0",
"size": 57376
}
|
[
"java.io.IOException",
"org.apache.hadoop.fs.permission.FsPermission",
"org.apache.hadoop.hdfs.protocol.DSQuotaExceededException",
"org.apache.hadoop.hdfs.protocol.NSQuotaExceededException",
"org.apache.hadoop.hdfs.protocol.UnresolvedPathException",
"org.apache.hadoop.ipc.RemoteException",
"org.apache.hadoop.security.AccessControlException"
] |
import java.io.IOException; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hdfs.protocol.DSQuotaExceededException; import org.apache.hadoop.hdfs.protocol.NSQuotaExceededException; import org.apache.hadoop.hdfs.protocol.UnresolvedPathException; import org.apache.hadoop.ipc.RemoteException; import org.apache.hadoop.security.AccessControlException;
|
import java.io.*; import org.apache.hadoop.fs.permission.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.ipc.*; import org.apache.hadoop.security.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,349,798
|
public static interface OnMatrixChangedListener {
void onMatrixChanged(RectF rect);
}
public static interface OnPhotoTapListener {
|
static interface OnMatrixChangedListener { void function(RectF rect); } public static interface OnPhotoTapListener {
|
/**
* Callback for when the Matrix displaying the Drawable has changed.
* This could be because the View's bounds have changed, or the user has
* zoomed.
*
* @param rect
* - Rectangle displaying the Drawable's new bounds.
*/
|
Callback for when the Matrix displaying the Drawable has changed. This could be because the View's bounds have changed, or the user has zoomed
|
onMatrixChanged
|
{
"repo_name": "KouChengjian/EKaxin",
"path": "EKaxin/src/com/chenghui/ekaxin/view/photo/zoom/PhotoViewAttacher.java",
"license": "gpl-2.0",
"size": 26184
}
|
[
"android.graphics.RectF"
] |
import android.graphics.RectF;
|
import android.graphics.*;
|
[
"android.graphics"
] |
android.graphics;
| 1,178,700
|
public void setSubGridArray(NTv2SubGrid[] subGrid) {
this.subGrid = subGrid == null ? null : Arrays.copyOf(subGrid, subGrid.length);
}
|
void function(NTv2SubGrid[] subGrid) { this.subGrid = subGrid == null ? null : Arrays.copyOf(subGrid, subGrid.length); }
|
/**
* Set an array of Sub Grids of this sub grid
* @param subGrid
*/
|
Set an array of Sub Grids of this sub grid
|
setSubGridArray
|
{
"repo_name": "iCarto/siga",
"path": "jGridShift/src/main/java/au/com/objectix/jgridshift/NTv2SubGrid.java",
"license": "gpl-3.0",
"size": 15865
}
|
[
"java.util.Arrays"
] |
import java.util.Arrays;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,497,771
|
private void updateGraphType(final IViewNode<?> node) {
if (m_graphType == GraphType.MIXED_GRAPH) {
if (getNodeCount() == 1) {
if (node instanceof INaviCodeNode) {
setGraphType(GraphType.FLOWGRAPH);
} else if (node instanceof INaviFunctionNode) {
setGraphType(GraphType.CALLGRAPH);
}
}
} else if (m_graphType == GraphType.CALLGRAPH) {
if (node instanceof INaviCodeNode) {
setGraphType(GraphType.MIXED_GRAPH);
}
} else {
if (node instanceof INaviFunctionNode) {
setGraphType(GraphType.MIXED_GRAPH);
}
}
}
|
void function(final IViewNode<?> node) { if (m_graphType == GraphType.MIXED_GRAPH) { if (getNodeCount() == 1) { if (node instanceof INaviCodeNode) { setGraphType(GraphType.FLOWGRAPH); } else if (node instanceof INaviFunctionNode) { setGraphType(GraphType.CALLGRAPH); } } } else if (m_graphType == GraphType.CALLGRAPH) { if (node instanceof INaviCodeNode) { setGraphType(GraphType.MIXED_GRAPH); } } else { if (node instanceof INaviFunctionNode) { setGraphType(GraphType.MIXED_GRAPH); } } }
|
/**
* Updates the graph type after a new node was added to the graph.
*
* @param node The added node.
*/
|
Updates the graph type after a new node was added to the graph
|
updateGraphType
|
{
"repo_name": "AmesianX/binnavi",
"path": "src/main/java/com/google/security/zynamics/binnavi/disassembly/views/CViewContent.java",
"license": "apache-2.0",
"size": 33515
}
|
[
"com.google.security.zynamics.binnavi.disassembly.INaviCodeNode",
"com.google.security.zynamics.binnavi.disassembly.INaviFunctionNode",
"com.google.security.zynamics.zylib.disassembly.GraphType",
"com.google.security.zynamics.zylib.gui.zygraph.nodes.IViewNode"
] |
import com.google.security.zynamics.binnavi.disassembly.INaviCodeNode; import com.google.security.zynamics.binnavi.disassembly.INaviFunctionNode; import com.google.security.zynamics.zylib.disassembly.GraphType; import com.google.security.zynamics.zylib.gui.zygraph.nodes.IViewNode;
|
import com.google.security.zynamics.binnavi.disassembly.*; import com.google.security.zynamics.zylib.disassembly.*; import com.google.security.zynamics.zylib.gui.zygraph.nodes.*;
|
[
"com.google.security"
] |
com.google.security;
| 2,716,457
|
private ReplicationMessage readMessage() throws
ClassNotFoundException, IOException {
checkSocketConnection();
return (ReplicationMessage)socketConn.readMessage();
}
}
|
ReplicationMessage function() throws ClassNotFoundException, IOException { checkSocketConnection(); return (ReplicationMessage)socketConn.readMessage(); } }
|
/**
* Used to read a replication message sent by the slave. Hangs until a
* message is received from the slave
*
* @return the reply message.
*
* @throws ClassNotFoundException Class of a serialized object cannot
* be found.
*
* @throws IOException 1) if an exception occurs while reading from the
* stream.
* 2) if the connection handle is invalid.
*/
|
Used to read a replication message sent by the slave. Hangs until a message is received from the slave
|
readMessage
|
{
"repo_name": "kavin256/Derby",
"path": "java/engine/org/apache/derby/impl/store/replication/net/ReplicationMessageTransmit.java",
"license": "apache-2.0",
"size": 15847
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,232,156
|
public void startReplicationMaster(String dbmaster, String host, int port,
String replicationMode)
throws StandardException;
|
void function(String dbmaster, String host, int port, String replicationMode) throws StandardException;
|
/**
* Start the replication master role for this database
* @param dbmaster The master database that is being replicated.
* @param host The hostname for the slave
* @param port The port the slave is listening on
* @param replicationMode The type of replication contract.
* Currently only asynchronous replication is supported, but
* 1-safe/2-safe/very-safe modes may be added later.
* @exception StandardException Standard Derby exception policy,
* thrown on error.
*/
|
Start the replication master role for this database
|
startReplicationMaster
|
{
"repo_name": "apache/derby",
"path": "java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java",
"license": "apache-2.0",
"size": 41291
}
|
[
"org.apache.derby.shared.common.error.StandardException"
] |
import org.apache.derby.shared.common.error.StandardException;
|
import org.apache.derby.shared.common.error.*;
|
[
"org.apache.derby"
] |
org.apache.derby;
| 2,716,235
|
public final Comparable addGap(Comparable value, String gap) {
try {
return parseAndAddGap(value, gap);
} catch (Exception e) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
"Can't add gap "+gap+" to value " + value +
" for field: " + field.getName(), e);
}
}
|
final Comparable function(Comparable value, String gap) { try { return parseAndAddGap(value, gap); } catch (Exception e) { throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, STR+gap+STR + value + STR + field.getName(), e); } }
|
/**
* Adds the String gap param to a low Range endpoint value to determine
* the corrisponding high Range endpoint value, throwing
* a useful exception if not possible.
*/
|
Adds the String gap param to a low Range endpoint value to determine the corrisponding high Range endpoint value, throwing a useful exception if not possible
|
addGap
|
{
"repo_name": "q474818917/solr-5.2.0",
"path": "solr/core/src/java/org/apache/solr/search/facet/FacetRange.java",
"license": "apache-2.0",
"size": 18218
}
|
[
"org.apache.solr.common.SolrException"
] |
import org.apache.solr.common.SolrException;
|
import org.apache.solr.common.*;
|
[
"org.apache.solr"
] |
org.apache.solr;
| 1,214,934
|
private void appendPolymerElementExterns(final PolymerClassDefinition def) {
if (!nativeExternsAdded.add(def.nativeBaseElement)) {
return;
}
Node block = IR.block();
Node baseExterns = polymerElementExterns.cloneTree();
String polymerElementType = PolymerPassStaticUtils.getPolymerElementType(def);
baseExterns.getFirstChild().setString(polymerElementType);
String elementType = tagNameMap.get(def.nativeBaseElement);
if (elementType == null) {
compiler.report(JSError.make(def.descriptor, POLYMER_INVALID_EXTENDS, def.nativeBaseElement));
return;
}
JSTypeExpression elementBaseType =
new JSTypeExpression(new Node(Token.BANG, IR.string(elementType)), VIRTUAL_FILE);
JSDocInfoBuilder baseDocs = JSDocInfoBuilder.copyFrom(baseExterns.getJSDocInfo());
baseDocs.changeBaseType(elementBaseType);
baseExterns.setJSDocInfo(baseDocs.build());
block.addChildToBack(baseExterns);
for (Node baseProp : polymerElementProps) {
Node newProp = baseProp.cloneTree();
Node newPropRootName =
NodeUtil.getRootOfQualifiedName(newProp.getFirstFirstChild());
newPropRootName.setString(polymerElementType);
block.addChildToBack(newProp);
}
block.useSourceInfoIfMissingFromForTree(polymerElementExterns);
Node parent = polymerElementExterns.getParent();
Node stmts = block.removeChildren();
parent.addChildrenAfter(stmts, polymerElementExterns);
compiler.reportChangeToEnclosingScope(stmts);
}
static class MemberDefinition {
final JSDocInfo info;
final Node name;
final Node value;
MemberDefinition(JSDocInfo info, Node name, Node value) {
this.info = info;
this.name = name;
this.value = value;
}
|
void function(final PolymerClassDefinition def) { if (!nativeExternsAdded.add(def.nativeBaseElement)) { return; } Node block = IR.block(); Node baseExterns = polymerElementExterns.cloneTree(); String polymerElementType = PolymerPassStaticUtils.getPolymerElementType(def); baseExterns.getFirstChild().setString(polymerElementType); String elementType = tagNameMap.get(def.nativeBaseElement); if (elementType == null) { compiler.report(JSError.make(def.descriptor, POLYMER_INVALID_EXTENDS, def.nativeBaseElement)); return; } JSTypeExpression elementBaseType = new JSTypeExpression(new Node(Token.BANG, IR.string(elementType)), VIRTUAL_FILE); JSDocInfoBuilder baseDocs = JSDocInfoBuilder.copyFrom(baseExterns.getJSDocInfo()); baseDocs.changeBaseType(elementBaseType); baseExterns.setJSDocInfo(baseDocs.build()); block.addChildToBack(baseExterns); for (Node baseProp : polymerElementProps) { Node newProp = baseProp.cloneTree(); Node newPropRootName = NodeUtil.getRootOfQualifiedName(newProp.getFirstFirstChild()); newPropRootName.setString(polymerElementType); block.addChildToBack(newProp); } block.useSourceInfoIfMissingFromForTree(polymerElementExterns); Node parent = polymerElementExterns.getParent(); Node stmts = block.removeChildren(); parent.addChildrenAfter(stmts, polymerElementExterns); compiler.reportChangeToEnclosingScope(stmts); } static class MemberDefinition { final JSDocInfo info; final Node name; final Node value; MemberDefinition(JSDocInfo info, Node name, Node value) { this.info = info; this.name = name; this.value = value; }
|
/**
* Duplicates the PolymerElement externs with a different element base class if needed.
* For example, if the base class is HTMLInputElement, then a class PolymerInputElement will be
* added. If the element does not extend a native HTML element, this method is a no-op.
*/
|
Duplicates the PolymerElement externs with a different element base class if needed. For example, if the base class is HTMLInputElement, then a class PolymerInputElement will be added. If the element does not extend a native HTML element, this method is a no-op
|
appendPolymerElementExterns
|
{
"repo_name": "shantanusharma/closure-compiler",
"path": "src/com/google/javascript/jscomp/PolymerPass.java",
"license": "apache-2.0",
"size": 9522
}
|
[
"com.google.javascript.rhino.IR",
"com.google.javascript.rhino.JSDocInfo",
"com.google.javascript.rhino.JSDocInfoBuilder",
"com.google.javascript.rhino.JSTypeExpression",
"com.google.javascript.rhino.Node",
"com.google.javascript.rhino.Token"
] |
import com.google.javascript.rhino.IR; import com.google.javascript.rhino.JSDocInfo; import com.google.javascript.rhino.JSDocInfoBuilder; import com.google.javascript.rhino.JSTypeExpression; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token;
|
import com.google.javascript.rhino.*;
|
[
"com.google.javascript"
] |
com.google.javascript;
| 549,637
|
public OrmDescriptor removeAllSqlResultSetMapping()
{
model.removeChildren("sql-result-set-mapping");
return this;
}
// --------------------------------------------------------------------------------------------------------||
// ClassName: OrmDescriptor ElementName: orm:mapped-superclass ElementType : mapped-superclass
// MaxOccurs: -unbounded isGeneric: false isAttribute: false isEnum: false isDataType: false
// --------------------------------------------------------------------------------------------------------||
|
OrmDescriptor function() { model.removeChildren(STR); return this; }
|
/**
* Removes all <code>sql-result-set-mapping</code> elements
* @return the current instance of <code>SqlResultSetMapping<OrmDescriptor></code>
*/
|
Removes all <code>sql-result-set-mapping</code> elements
|
removeAllSqlResultSetMapping
|
{
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm20/OrmDescriptorImpl.java",
"license": "epl-1.0",
"size": 31598
}
|
[
"org.jboss.shrinkwrap.descriptor.api.orm20.OrmDescriptor"
] |
import org.jboss.shrinkwrap.descriptor.api.orm20.OrmDescriptor;
|
import org.jboss.shrinkwrap.descriptor.api.orm20.*;
|
[
"org.jboss.shrinkwrap"
] |
org.jboss.shrinkwrap;
| 2,028,114
|
public void popupWarningMessage(String caption, String txt) {
popupMessage(caption, txt, MessageType.WARNING);
}
|
void function(String caption, String txt) { popupMessage(caption, txt, MessageType.WARNING); }
|
/**
* Mostra mensagem popup de alerta
* @param caption Título
* @param txt Mensagem
*/
|
Mostra mensagem popup de alerta
|
popupWarningMessage
|
{
"repo_name": "lossurdo/JDF",
"path": "src/main/java/com/jdf/swing/misc/TrayBar.java",
"license": "mit",
"size": 4161
}
|
[
"java.awt.TrayIcon"
] |
import java.awt.TrayIcon;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 1,069,746
|
protected final void writeValue(final Page page, final Value value) throws IOException {
final byte[] data = value.getData();
writeValue(page, data);
}
|
final void function(final Page page, final Value value) throws IOException { final byte[] data = value.getData(); writeValue(page, data); }
|
/**
* Writes the multi-paged value starting at the specified Page.
*
* @param page The starting Page
* @param value The value to write
*
* @throws IOException if an Exception occurs
*/
|
Writes the multi-paged value starting at the specified Page
|
writeValue
|
{
"repo_name": "windauer/exist",
"path": "exist-core/src/main/java/org/exist/storage/btree/Paged.java",
"license": "lgpl-2.1",
"size": 39763
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 322,373
|
public InstructionHandle compile(ClassGenerator classGen,
MethodGenerator methodGen,
InstructionHandle continuation)
{
// Returned cached value if already compiled
if (_start != null) {
return _start;
}
// If not patterns, then return handle for default template
final int count = _patterns.size();
if (count == 0) {
return (_start = getTemplateHandle(_default));
}
// Init handle to jump when all patterns failed
InstructionHandle fail = (_default == null) ? continuation
: getTemplateHandle(_default);
// Compile all patterns in reverse order
for (int n = count - 1; n >= 0; n--) {
final LocationPathPattern pattern = getPattern(n);
final Template template = pattern.getTemplate();
final InstructionList il = new InstructionList();
// Patterns expect current node on top of stack
il.append(methodGen.loadCurrentNode());
// Apply the test-code compiled for the pattern
InstructionList ilist = methodGen.getInstructionList(pattern);
if (ilist == null) {
ilist = pattern.compile(classGen, methodGen);
methodGen.addInstructionList(pattern, ilist);
}
// Make a copy of the instruction list for backpatching
InstructionList copyOfilist = ilist.copy();
FlowList trueList = pattern.getTrueList();
if (trueList != null) {
trueList = trueList.copyAndRedirect(ilist, copyOfilist);
}
FlowList falseList = pattern.getFalseList();
if (falseList != null) {
falseList = falseList.copyAndRedirect(ilist, copyOfilist);
}
il.append(copyOfilist);
// On success branch to the template code
final InstructionHandle gtmpl = getTemplateHandle(template);
final InstructionHandle success = il.append(new GOTO_W(gtmpl));
if (trueList != null) {
trueList.backPatch(success);
}
if (falseList != null) {
falseList.backPatch(fail);
}
// Next pattern's 'fail' target is this pattern's first instruction
fail = il.getStart();
// Append existing instruction list to the end of this one
if (_instructionList != null) {
il.append(_instructionList);
}
// Set current instruction list to be this one
_instructionList = il;
}
return (_start = fail);
}
|
InstructionHandle function(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle continuation) { if (_start != null) { return _start; } final int count = _patterns.size(); if (count == 0) { return (_start = getTemplateHandle(_default)); } InstructionHandle fail = (_default == null) ? continuation : getTemplateHandle(_default); for (int n = count - 1; n >= 0; n--) { final LocationPathPattern pattern = getPattern(n); final Template template = pattern.getTemplate(); final InstructionList il = new InstructionList(); il.append(methodGen.loadCurrentNode()); InstructionList ilist = methodGen.getInstructionList(pattern); if (ilist == null) { ilist = pattern.compile(classGen, methodGen); methodGen.addInstructionList(pattern, ilist); } InstructionList copyOfilist = ilist.copy(); FlowList trueList = pattern.getTrueList(); if (trueList != null) { trueList = trueList.copyAndRedirect(ilist, copyOfilist); } FlowList falseList = pattern.getFalseList(); if (falseList != null) { falseList = falseList.copyAndRedirect(ilist, copyOfilist); } il.append(copyOfilist); final InstructionHandle gtmpl = getTemplateHandle(template); final InstructionHandle success = il.append(new GOTO_W(gtmpl)); if (trueList != null) { trueList.backPatch(success); } if (falseList != null) { falseList.backPatch(fail); } fail = il.getStart(); if (_instructionList != null) { il.append(_instructionList); } _instructionList = il; } return (_start = fail); }
|
/**
* Compile the code for this test sequence. Compile patterns
* from highest to lowest priority. Note that since patterns
* can be share by multiple test sequences, instruction lists
* must be copied before backpatching.
*/
|
Compile the code for this test sequence. Compile patterns from highest to lowest priority. Note that since patterns can be share by multiple test sequences, instruction lists must be copied before backpatching
|
compile
|
{
"repo_name": "md-5/jdk10",
"path": "src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/TestSeq.java",
"license": "gpl-2.0",
"size": 9580
}
|
[
"com.sun.org.apache.bcel.internal.generic.InstructionHandle",
"com.sun.org.apache.bcel.internal.generic.InstructionList",
"com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator",
"com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator"
] |
import com.sun.org.apache.bcel.internal.generic.InstructionHandle; import com.sun.org.apache.bcel.internal.generic.InstructionList; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
|
import com.sun.org.apache.bcel.internal.generic.*; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.*;
|
[
"com.sun.org"
] |
com.sun.org;
| 486,699
|
public Enumeration listOptions() {
Vector newVector = new Vector(5);
newVector.addElement(new Option(
"\tThe class for which threshold is determined. Valid values are:\n" +
"\t1, 2 (for first and second classes, respectively), 3 (for whichever\n" +
"\tclass is least frequent), and 4 (for whichever class value is most\n" +
"\tfrequent), and 5 (for the first class named any of \"yes\",\"pos(itive)\"\n" +
"\t\"1\", or method 3 if no matches). (default 5).",
"C", 1, "-C <integer>"));
newVector.addElement(new Option(
"\tNumber of folds used for cross validation. If just a\n" +
"\thold-out set is used, this determines the size of the hold-out set\n" +
"\t(default 3).",
"X", 1, "-X <number of folds>"));
newVector.addElement(new Option(
"\tSets whether confidence range correction is applied. This\n" +
"\tcan be used to ensure the confidences range from 0 to 1.\n" +
"\tUse 0 for no range correction, 1 for correction based on\n" +
"\tthe min/max values seen during threshold selection\n"+
"\t(default 0).",
"R", 1, "-R <integer>"));
newVector.addElement(new Option(
"\tSets the evaluation mode. Use 0 for\n" +
"\tevaluation using cross-validation,\n" +
"\t1 for evaluation using hold-out set,\n" +
"\tand 2 for evaluation on the\n" +
"\ttraining data (default 1).",
"E", 1, "-E <integer>"));
newVector.addElement(new Option(
"\tMeasure used for evaluation (default is FMEASURE).\n",
"M", 1, "-M [FMEASURE|ACCURACY|TRUE_POS|TRUE_NEG|TP_RATE|PRECISION|RECALL]"));
newVector.addElement(new Option(
"\tSet a manual threshold to use. This option overrides\n"
+ "\tautomatic selection and options pertaining to\n"
+ "\tautomatic selection will be ignored.\n"
+ "\t(default -1, i.e. do not use a manual threshold).",
"manual", 1, "-manual <real>"));
Enumeration enu = super.listOptions();
while (enu.hasMoreElements()) {
newVector.addElement(enu.nextElement());
}
return newVector.elements();
}
|
Enumeration function() { Vector newVector = new Vector(5); newVector.addElement(new Option( STR + STR + STR + STRyes\",\"pos(itive)\"\n" + "\t\"1\STR, "C", 1, STR)); newVector.addElement(new Option( STR + STR + STR, "X", 1, STR)); newVector.addElement(new Option( STR + STR + STR + STR+ STR, "R", 1, STR)); newVector.addElement(new Option( STR + STR + STR + STR + STR, "E", 1, STR)); newVector.addElement(new Option( STR, "M", 1, STR)); newVector.addElement(new Option( STR + STR + STR + STR, STR, 1, STR)); Enumeration enu = super.listOptions(); while (enu.hasMoreElements()) { newVector.addElement(enu.nextElement()); } return newVector.elements(); }
|
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
|
Returns an enumeration describing the available options
|
listOptions
|
{
"repo_name": "williamClanton/jbossBA",
"path": "weka/src/main/java/weka/classifiers/meta/ThresholdSelector.java",
"license": "gpl-2.0",
"size": 36038
}
|
[
"java.util.Enumeration",
"java.util.Vector"
] |
import java.util.Enumeration; import java.util.Vector;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,754,071
|
public Hashtable<String, ShaderVar> getVaryings()
{
return mVaryings;
}
|
Hashtable<String, ShaderVar> function() { return mVaryings; }
|
/**
* Returns all varyings
*
* @return
*/
|
Returns all varyings
|
getVaryings
|
{
"repo_name": "sujitkjha/360-Video-Player-for-Android",
"path": "rajawali/src/main/java/org/rajawali3d/materials/shaders/AShader.java",
"license": "gpl-3.0",
"size": 38138
}
|
[
"java.util.Hashtable"
] |
import java.util.Hashtable;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,440,265
|
public static URI resolve(final URI baseUri, String refUri) {
return resolve(baseUri, URI.create(refUri));
}
|
static URI function(final URI baseUri, String refUri) { return resolve(baseUri, URI.create(refUri)); }
|
/**
* Resolve a relative URI reference against a base URI as defined in
* <a href="http://tools.ietf.org/html/rfc3986#section-5.4">RFC 3986</a>.
*
* @param baseUri base URI to be used for resolution.
* @param refUri reference URI string to be resolved against the base URI.
* @return resolved URI.
*
* @throws IllegalArgumentException If the given string violates the URI specification RFC.
*/
|
Resolve a relative URI reference against a base URI as defined in RFC 3986
|
resolve
|
{
"repo_name": "agentlab/org.glassfish.jersey",
"path": "plugins/org.glassfish.jersey.common/src/main/java/org/glassfish/jersey/uri/UriTemplate.java",
"license": "epl-1.0",
"size": 43199
}
|
[
"java.net.URI"
] |
import java.net.URI;
|
import java.net.*;
|
[
"java.net"
] |
java.net;
| 1,578,308
|
public static Uri getShareableUri(Attachment attachment) {
File attachmentFile = new File(attachment.getUri().getPath());
if (attachmentFile.exists()) {
return FileProviderHelper.getFileProvider(attachmentFile);
} else {
return attachment.getUri();
}
}
|
static Uri function(Attachment attachment) { File attachmentFile = new File(attachment.getUri().getPath()); if (attachmentFile.exists()) { return FileProviderHelper.getFileProvider(attachmentFile); } else { return attachment.getUri(); } }
|
/**
* Generates a shareable URI for a given attachment by evaluating its stored (into DB) path
*/
|
Generates a shareable URI for a given attachment by evaluating its stored (into DB) path
|
getShareableUri
|
{
"repo_name": "federicoiosue/Omni-Notes",
"path": "omniNotes/src/main/java/it/feio/android/omninotes/utils/FileProviderHelper.java",
"license": "gpl-3.0",
"size": 1711
}
|
[
"android.net.Uri",
"it.feio.android.omninotes.models.Attachment",
"java.io.File"
] |
import android.net.Uri; import it.feio.android.omninotes.models.Attachment; import java.io.File;
|
import android.net.*; import it.feio.android.omninotes.models.*; import java.io.*;
|
[
"android.net",
"it.feio.android",
"java.io"
] |
android.net; it.feio.android; java.io;
| 1,829,543
|
@CheckForNull
Severity overriddenSeverity();
|
Severity overriddenSeverity();
|
/**
* Overridden severity.
*/
|
Overridden severity
|
overriddenSeverity
|
{
"repo_name": "lbndev/sonarqube",
"path": "sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/Issue.java",
"license": "lgpl-3.0",
"size": 1971
}
|
[
"org.sonar.api.batch.rule.Severity"
] |
import org.sonar.api.batch.rule.Severity;
|
import org.sonar.api.batch.rule.*;
|
[
"org.sonar.api"
] |
org.sonar.api;
| 1,717,793
|
public Object getCompactionMetric(String metricName)
{
try
{
switch(metricName)
{
case "BytesCompacted":
return JMX.newMBeanProxy(mbeanServerConn,
new ObjectName("org.apache.cassandra.metrics:type=Compaction,name=" + metricName),
CassandraMetricsRegistry.JmxCounterMBean.class);
case "CompletedTasks":
case "PendingTasks":
case "PendingTasksByTableName":
return JMX.newMBeanProxy(mbeanServerConn,
new ObjectName("org.apache.cassandra.metrics:type=Compaction,name=" + metricName),
CassandraMetricsRegistry.JmxGaugeMBean.class).getValue();
case "TotalCompactionsCompleted":
return JMX.newMBeanProxy(mbeanServerConn,
new ObjectName("org.apache.cassandra.metrics:type=Compaction,name=" + metricName),
CassandraMetricsRegistry.JmxMeterMBean.class);
default:
throw new RuntimeException("Unknown compaction metric.");
}
}
catch (MalformedObjectNameException e)
{
throw new RuntimeException(e);
}
}
|
Object function(String metricName) { try { switch(metricName) { case STR: return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(STR + metricName), CassandraMetricsRegistry.JmxCounterMBean.class); case STR: case STR: case STR: return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(STR + metricName), CassandraMetricsRegistry.JmxGaugeMBean.class).getValue(); case STR: return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(STR + metricName), CassandraMetricsRegistry.JmxMeterMBean.class); default: throw new RuntimeException(STR); } } catch (MalformedObjectNameException e) { throw new RuntimeException(e); } }
|
/**
* Retrieve Proxy metrics
* @param metricName CompletedTasks, PendingTasks, BytesCompacted or TotalCompactionsCompleted.
*/
|
Retrieve Proxy metrics
|
getCompactionMetric
|
{
"repo_name": "blerer/cassandra",
"path": "src/java/org/apache/cassandra/tools/NodeProbe.java",
"license": "apache-2.0",
"size": 66036
}
|
[
"javax.management.JMX",
"javax.management.MalformedObjectNameException",
"javax.management.ObjectName",
"org.apache.cassandra.metrics.CassandraMetricsRegistry"
] |
import javax.management.JMX; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; import org.apache.cassandra.metrics.CassandraMetricsRegistry;
|
import javax.management.*; import org.apache.cassandra.metrics.*;
|
[
"javax.management",
"org.apache.cassandra"
] |
javax.management; org.apache.cassandra;
| 2,845,704
|
@Nullable
Chunk loadChunk(World worldIn, int x, int z) throws IOException;
|
Chunk loadChunk(World worldIn, int x, int z) throws IOException;
|
/**
* Loads the specified(XZ) chunk into the specified world.
*/
|
Loads the specified(XZ) chunk into the specified world
|
loadChunk
|
{
"repo_name": "Severed-Infinity/technium",
"path": "build/tmp/recompileMc/sources/net/minecraft/world/chunk/storage/IChunkLoader.java",
"license": "gpl-3.0",
"size": 952
}
|
[
"java.io.IOException",
"net.minecraft.world.World",
"net.minecraft.world.chunk.Chunk"
] |
import java.io.IOException; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk;
|
import java.io.*; import net.minecraft.world.*; import net.minecraft.world.chunk.*;
|
[
"java.io",
"net.minecraft.world"
] |
java.io; net.minecraft.world;
| 1,366,740
|
private void writeDoubleTagPayload(DoubleTag tag) throws IOException {
os.writeDouble(tag.getValue());
}
|
void function(DoubleTag tag) throws IOException { os.writeDouble(tag.getValue()); }
|
/**
* Writes a <code>TAG_Double</code> tag.
*
* @param tag The tag.
* @throws IOException if an I/O error occurs.
*/
|
Writes a <code>TAG_Double</code> tag
|
writeDoubleTagPayload
|
{
"repo_name": "neilwightman/jnbt",
"path": "src/main/java/org/jnbt/NBTOutputStream.java",
"license": "bsd-3-clause",
"size": 9763
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,127,067
|
INpcScriptEvents onNpcClick(IScriptUpdateSubscriber<NpcClickEvent> subscriber);
|
INpcScriptEvents onNpcClick(IScriptUpdateSubscriber<NpcClickEvent> subscriber);
|
/**
* Attach a subscriber to be updated when an {@link INpc} is clicked.
*
* @param subscriber The subscriber.
*
* @return Self for chaining.
*/
|
Attach a subscriber to be updated when an <code>INpc</code> is clicked
|
onNpcClick
|
{
"repo_name": "JCThePants/NucleusFramework",
"path": "src/com/jcwhatever/nucleus/providers/npc/INpcScriptEvents.java",
"license": "mit",
"size": 5285
}
|
[
"com.jcwhatever.nucleus.providers.npc.events.NpcClickEvent",
"com.jcwhatever.nucleus.utils.observer.script.IScriptUpdateSubscriber"
] |
import com.jcwhatever.nucleus.providers.npc.events.NpcClickEvent; import com.jcwhatever.nucleus.utils.observer.script.IScriptUpdateSubscriber;
|
import com.jcwhatever.nucleus.providers.npc.events.*; import com.jcwhatever.nucleus.utils.observer.script.*;
|
[
"com.jcwhatever.nucleus"
] |
com.jcwhatever.nucleus;
| 340,323
|
public static class MethodHookParam extends XCallback.Param {
public Member method;
public Object thisObject;
public Object[] args;
private Object result = null;
private Throwable throwable = null;
boolean returnEarly = false;
|
public static class MethodHookParam extends XCallback.Param { public Member method; public Object thisObject; public Object[] args; private Object result = null; private Throwable throwable = null; boolean returnEarly = false;
|
/**
* Called after the invocation of the method.
* <p>Can use {@link MethodHookParam#setResult(Object)} and {@link MethodHookParam#setThrowable(Throwable)}
* to modify the return value of the original method.
*/
|
Called after the invocation of the method. Can use <code>MethodHookParam#setResult(Object)</code> and <code>MethodHookParam#setThrowable(Throwable)</code> to modify the return value of the original method
|
afterHookedMethod
|
{
"repo_name": "cheyiliu/test4XXX",
"path": "dexposed/dexposedbridge/src/com/taobao/android/dexposed/XC_MethodHook.java",
"license": "apache-2.0",
"size": 4114
}
|
[
"com.taobao.android.dexposed.callbacks.XCallback",
"java.lang.reflect.Member"
] |
import com.taobao.android.dexposed.callbacks.XCallback; import java.lang.reflect.Member;
|
import com.taobao.android.dexposed.callbacks.*; import java.lang.reflect.*;
|
[
"com.taobao.android",
"java.lang"
] |
com.taobao.android; java.lang;
| 2,636,569
|
private void init(char[] pass, byte[] salt, int iterations)
throws SecurityException {
try {
PBEParameterSpec ps = new javax.crypto.spec.PBEParameterSpec(salt,
iterations);
Provider provider = Security.getProvider(PROVIDER);
SecretKeyFactory kf = SecretKeyFactory
.getInstance("PBEWithMD5AndDES", provider);
SecretKey k = kf.generateSecret(new javax.crypto.spec.PBEKeySpec(
pass));
encryptCipher = Cipher
.getInstance("PBEWithMD5AndDES/CBC/PKCS5Padding", provider);
encryptCipher.init(Cipher.ENCRYPT_MODE, k, ps);
decryptCipher = Cipher
.getInstance("PBEWithMD5AndDES/CBC/PKCS5Padding", provider);
decryptCipher.init(Cipher.DECRYPT_MODE, k, ps);
} catch (NoSuchAlgorithmException e) {
throw new SecurityException(
"Could not initialize PBEEncryptionRoutine: "
+ e.getMessage());
} catch (InvalidKeySpecException e) {
throw new SecurityException(
"Could not initialize PBEEncryptionRoutine: "
+ e.getMessage());
} catch (NoSuchPaddingException e) {
throw new SecurityException(
"Could not initialize PBEEncryptionRoutine: "
+ e.getMessage());
} catch (InvalidKeyException e) {
throw new SecurityException(
"Could not initialize PBEEncryptionRoutine: "
+ e.getMessage());
} catch (InvalidAlgorithmParameterException e) {
throw new SecurityException(
"Could not initialize PBEEncryptionRoutine: "
+ e.getMessage());
}
}
|
void function(char[] pass, byte[] salt, int iterations) throws SecurityException { try { PBEParameterSpec ps = new javax.crypto.spec.PBEParameterSpec(salt, iterations); Provider provider = Security.getProvider(PROVIDER); SecretKeyFactory kf = SecretKeyFactory .getInstance(STR, provider); SecretKey k = kf.generateSecret(new javax.crypto.spec.PBEKeySpec( pass)); encryptCipher = Cipher .getInstance(STR, provider); encryptCipher.init(Cipher.ENCRYPT_MODE, k, ps); decryptCipher = Cipher .getInstance(STR, provider); decryptCipher.init(Cipher.DECRYPT_MODE, k, ps); } catch (NoSuchAlgorithmException e) { throw new SecurityException( STR + e.getMessage()); } catch (InvalidKeySpecException e) { throw new SecurityException( STR + e.getMessage()); } catch (NoSuchPaddingException e) { throw new SecurityException( STR + e.getMessage()); } catch (InvalidKeyException e) { throw new SecurityException( STR + e.getMessage()); } catch (InvalidAlgorithmParameterException e) { throw new SecurityException( STR + e.getMessage()); } }
|
/**
* Initializes the Decoder and Encoder ciphers.
*
* @param pass
* @param salt
* @param iterations
* @throws SecurityException
*/
|
Initializes the Decoder and Encoder ciphers
|
init
|
{
"repo_name": "MastekLtd/JBEAM",
"path": "supporting_libraries/stg-commons/src/main/java/com/stg/crypto/PBEEncryptionRoutine.java",
"license": "lgpl-3.0",
"size": 8746
}
|
[
"java.security.InvalidAlgorithmParameterException",
"java.security.InvalidKeyException",
"java.security.NoSuchAlgorithmException",
"java.security.Provider",
"java.security.Security",
"java.security.spec.InvalidKeySpecException",
"javax.crypto.Cipher",
"javax.crypto.NoSuchPaddingException",
"javax.crypto.SecretKey",
"javax.crypto.SecretKeyFactory",
"javax.crypto.spec.PBEParameterSpec"
] |
import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.Provider; import java.security.Security; import java.security.spec.InvalidKeySpecException; import javax.crypto.Cipher; import javax.crypto.NoSuchPaddingException; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEParameterSpec;
|
import java.security.*; import java.security.spec.*; import javax.crypto.*; import javax.crypto.spec.*;
|
[
"java.security",
"javax.crypto"
] |
java.security; javax.crypto;
| 2,090,690
|
public String getContentRenderingUrl(HttpServletRequest request, boolean download)
{
// http://127.0.0.1:8080/oscar/contentRenderingServlet/asdf.jpg?source=oruR01&segmentId=67&download=t
StringBuilder sb=new StringBuilder();
sb.append(request.getContextPath());
sb.append("/contentRenderingServlet/");
sb.append(getBinaryFilenameForDisplay());
sb.append("?source=");
sb.append(ContentRenderingServlet.Source.oruR01.name());
sb.append("&segmentId=");
sb.append(segmentId);
if (download) sb.append("&download=true");
return(sb.toString());
}
|
String function(HttpServletRequest request, boolean download) { StringBuilder sb=new StringBuilder(); sb.append(request.getContextPath()); sb.append(STR); sb.append(getBinaryFilenameForDisplay()); sb.append(STR); sb.append(ContentRenderingServlet.Source.oruR01.name()); sb.append(STR); sb.append(segmentId); if (download) sb.append(STR); return(sb.toString()); }
|
/**
* The context path is prepended in this url
*/
|
The context path is prepended in this url
|
getContentRenderingUrl
|
{
"repo_name": "hexbinary/landing",
"path": "src/main/java/oscar/oscarLab/ca/all/pageUtil/ViewOruR01UIBean.java",
"license": "gpl-2.0",
"size": 6066
}
|
[
"javax.servlet.http.HttpServletRequest",
"org.oscarehr.ui.servlet.ContentRenderingServlet"
] |
import javax.servlet.http.HttpServletRequest; import org.oscarehr.ui.servlet.ContentRenderingServlet;
|
import javax.servlet.http.*; import org.oscarehr.ui.servlet.*;
|
[
"javax.servlet",
"org.oscarehr.ui"
] |
javax.servlet; org.oscarehr.ui;
| 744,013
|
public static void sort(Object[] a, int lo, int hi, Comparator comparator) {
for (int i = lo; i < hi; i++) {
for (int j = i; j > lo && less(a[j], a[j-1], comparator); j--) {
exch(a, j, j-1);
}
}
assert isSorted(a, lo, hi, comparator);
}
|
static void function(Object[] a, int lo, int hi, Comparator comparator) { for (int i = lo; i < hi; i++) { for (int j = i; j > lo && less(a[j], a[j-1], comparator); j--) { exch(a, j, j-1); } } assert isSorted(a, lo, hi, comparator); }
|
/**
* Rearranges the subarray a[lo..hi) in ascending order, using a comparator.
* @param a the array
* @param lo left endpoint (inclusive)
* @param hi right endpoint (exclusive)
* @param comparator the comparator specifying the order
*/
|
Rearranges the subarray a[lo..hi) in ascending order, using a comparator
|
sort
|
{
"repo_name": "Bladefidz/algorithm",
"path": "coursera/Algorithms/elementary-sort/Insertion.java",
"license": "unlicense",
"size": 6956
}
|
[
"java.util.Comparator"
] |
import java.util.Comparator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,699,583
|
@Override
public Collection<Keywords> getDescriptiveKeywords() {
if (keywords != null) {
return Collections.<Keywords>singleton(new DefaultKeywords(keywords.toArray(new String[keywords.size()])));
}
return super.getDescriptiveKeywords();
}
|
Collection<Keywords> function() { if (keywords != null) { return Collections.<Keywords>singleton(new DefaultKeywords(keywords.toArray(new String[keywords.size()]))); } return super.getDescriptiveKeywords(); }
|
/**
* ISO 19115 metadata property determined by the {@link #keywords} field.
* This is part of the information returned by {@link #getIdentificationInfo()}.
*
* @return category keywords, their type, and reference source.
*/
|
ISO 19115 metadata property determined by the <code>#keywords</code> field. This is part of the information returned by <code>#getIdentificationInfo()</code>
|
getDescriptiveKeywords
|
{
"repo_name": "Geomatys/sis",
"path": "storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Metadata.java",
"license": "apache-2.0",
"size": 20648
}
|
[
"java.util.Collection",
"java.util.Collections",
"org.apache.sis.metadata.iso.identification.DefaultKeywords",
"org.opengis.metadata.identification.Keywords"
] |
import java.util.Collection; import java.util.Collections; import org.apache.sis.metadata.iso.identification.DefaultKeywords; import org.opengis.metadata.identification.Keywords;
|
import java.util.*; import org.apache.sis.metadata.iso.identification.*; import org.opengis.metadata.identification.*;
|
[
"java.util",
"org.apache.sis",
"org.opengis.metadata"
] |
java.util; org.apache.sis; org.opengis.metadata;
| 2,083,933
|
public synchronized void write(BluetoothMessageEntity bluetoothMessageEntity) {
if (bluetoothMessageEntity.getMessageContent().length() > 0) {
// Synchronize a copy of the ConnectedThread
Log.d(TAG, "Write");
//perform the write
mConnectedThread.write(bluetoothMessageEntity);
} else {
Log.d(TAG, "Write: Nothing to write");
}
}
|
synchronized void function(BluetoothMessageEntity bluetoothMessageEntity) { if (bluetoothMessageEntity.getMessageContent().length() > 0) { Log.d(TAG, "Write"); mConnectedThread.write(bluetoothMessageEntity); } else { Log.d(TAG, STR); } }
|
/**
* Write to the ConnectedThread in an unsynchronized manner
*/
|
Write to the ConnectedThread in an unsynchronized manner
|
write
|
{
"repo_name": "Paul-K-Szean/MDPGRP17",
"path": "Android/MDPGRP17_AndroidApp/app/src/main/java/com/example/android/mdpgrp17_androidapp/BluetoothConnection.java",
"license": "mit",
"size": 30546
}
|
[
"android.util.Log"
] |
import android.util.Log;
|
import android.util.*;
|
[
"android.util"
] |
android.util;
| 20,980
|
@Override
public Fragment expanded() {
return wrap("UNICODE", charMap.get(text));
}
|
Fragment function() { return wrap(STR, charMap.get(text)); }
|
/**
* Expand the character into unicode text, wrapped in a UNICODE tag.
*
* @return expanded fragment wrapped in a UNICODE tag.
*/
|
Expand the character into unicode text, wrapped in a UNICODE tag
|
expanded
|
{
"repo_name": "emmental/isetools",
"path": "src/main/java/ca/nines/ise/node/chr/UnicodeCharNode.java",
"license": "gpl-2.0",
"size": 2044
}
|
[
"ca.nines.ise.dom.Fragment"
] |
import ca.nines.ise.dom.Fragment;
|
import ca.nines.ise.dom.*;
|
[
"ca.nines.ise"
] |
ca.nines.ise;
| 1,910,280
|
static boolean fragmentReferencesPersistentTable(AbstractPlanNode node) {
if (node == null)
return false;
// these nodes can read/modify persistent tables
if (node instanceof AbstractScanPlanNode)
return true;
if (node instanceof InsertPlanNode)
return true;
if (node instanceof DeletePlanNode)
return true;
if (node instanceof UpdatePlanNode)
return true;
// recursively check out children
for (int i = 0; i < node.getChildCount(); i++) {
AbstractPlanNode child = node.getChild(i);
if (fragmentReferencesPersistentTable(child))
return true;
}
// if nothing found, return false
return false;
}
|
static boolean fragmentReferencesPersistentTable(AbstractPlanNode node) { if (node == null) return false; if (node instanceof AbstractScanPlanNode) return true; if (node instanceof InsertPlanNode) return true; if (node instanceof DeletePlanNode) return true; if (node instanceof UpdatePlanNode) return true; for (int i = 0; i < node.getChildCount(); i++) { AbstractPlanNode child = node.getChild(i); if (fragmentReferencesPersistentTable(child)) return true; } return false; }
|
/**
* Check through a plan graph and return true if it ever touches a persistent table.
*/
|
Check through a plan graph and return true if it ever touches a persistent table
|
fragmentReferencesPersistentTable
|
{
"repo_name": "deerwalk/voltdb",
"path": "src/frontend/org/voltdb/compiler/StatementCompiler.java",
"license": "agpl-3.0",
"size": 23303
}
|
[
"org.voltdb.plannodes.AbstractPlanNode",
"org.voltdb.plannodes.AbstractScanPlanNode",
"org.voltdb.plannodes.DeletePlanNode",
"org.voltdb.plannodes.InsertPlanNode",
"org.voltdb.plannodes.UpdatePlanNode"
] |
import org.voltdb.plannodes.AbstractPlanNode; import org.voltdb.plannodes.AbstractScanPlanNode; import org.voltdb.plannodes.DeletePlanNode; import org.voltdb.plannodes.InsertPlanNode; import org.voltdb.plannodes.UpdatePlanNode;
|
import org.voltdb.plannodes.*;
|
[
"org.voltdb.plannodes"
] |
org.voltdb.plannodes;
| 44,329
|
public void setCreatedtime(Date createdtime) {
this.createdtime = createdtime;
}
|
void function(Date createdtime) { this.createdtime = createdtime; }
|
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column m_crm_product_catalog.createdTime
*
* @param createdtime the value for m_crm_product_catalog.createdTime
*
* @mbggenerated Mon Sep 21 13:52:02 ICT 2015
*/
|
This method was generated by MyBatis Generator. This method sets the value of the database column m_crm_product_catalog.createdTime
|
setCreatedtime
|
{
"repo_name": "maduhu/mycollab",
"path": "mycollab-services/src/main/java/com/esofthead/mycollab/module/crm/domain/ProductCatalog.java",
"license": "agpl-3.0",
"size": 25847
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,404,609
|
if (isInited) return (QOperatingSystemMessageFilePackage)EPackage.Registry.INSTANCE.getEPackage(QOperatingSystemMessageFilePackage.eNS_URI);
// Obtain or create and register package
OperatingSystemMessageFilePackageImpl theOperatingSystemMessageFilePackage = (OperatingSystemMessageFilePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof OperatingSystemMessageFilePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new OperatingSystemMessageFilePackageImpl());
isInited = true;
// Initialize simple dependencies
QOperatingSystemTypePackage.eINSTANCE.eClass();
// Create package meta-data objects
theOperatingSystemMessageFilePackage.createPackageContents();
// Initialize created meta-data
theOperatingSystemMessageFilePackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theOperatingSystemMessageFilePackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(QOperatingSystemMessageFilePackage.eNS_URI, theOperatingSystemMessageFilePackage);
return theOperatingSystemMessageFilePackage;
}
|
if (isInited) return (QOperatingSystemMessageFilePackage)EPackage.Registry.INSTANCE.getEPackage(QOperatingSystemMessageFilePackage.eNS_URI); OperatingSystemMessageFilePackageImpl theOperatingSystemMessageFilePackage = (OperatingSystemMessageFilePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof OperatingSystemMessageFilePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new OperatingSystemMessageFilePackageImpl()); isInited = true; QOperatingSystemTypePackage.eINSTANCE.eClass(); theOperatingSystemMessageFilePackage.createPackageContents(); theOperatingSystemMessageFilePackage.initializePackageContents(); theOperatingSystemMessageFilePackage.freeze(); EPackage.Registry.INSTANCE.put(QOperatingSystemMessageFilePackage.eNS_URI, theOperatingSystemMessageFilePackage); return theOperatingSystemMessageFilePackage; }
|
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link QOperatingSystemMessageFilePackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
|
Creates, registers, and initializes the Package for this model, and for any others upon which it depends. This method is used to initialize <code>QOperatingSystemMessageFilePackage#eINSTANCE</code> when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
|
init
|
{
"repo_name": "asupdev/asup",
"path": "org.asup.os.type.msgf/src/org/asup/os/type/msgf/impl/OperatingSystemMessageFilePackageImpl.java",
"license": "epl-1.0",
"size": 18266
}
|
[
"org.asup.os.type.QOperatingSystemTypePackage",
"org.asup.os.type.msgf.QOperatingSystemMessageFilePackage",
"org.eclipse.emf.ecore.EPackage"
] |
import org.asup.os.type.QOperatingSystemTypePackage; import org.asup.os.type.msgf.QOperatingSystemMessageFilePackage; import org.eclipse.emf.ecore.EPackage;
|
import org.asup.os.type.*; import org.asup.os.type.msgf.*; import org.eclipse.emf.ecore.*;
|
[
"org.asup.os",
"org.eclipse.emf"
] |
org.asup.os; org.eclipse.emf;
| 1,065,503
|
public Map<String, OptionalFailure<Accumulator<?, ?>>> aggregateUserAccumulators() {
Map<String, OptionalFailure<Accumulator<?, ?>>> userAccumulators = new HashMap<>();
for (ExecutionVertex vertex : getAllExecutionVertices()) {
Map<String, Accumulator<?, ?>> next = vertex.getCurrentExecutionAttempt().getUserAccumulators();
if (next != null) {
AccumulatorHelper.mergeInto(userAccumulators, next);
}
}
return userAccumulators;
}
|
Map<String, OptionalFailure<Accumulator<?, ?>>> function() { Map<String, OptionalFailure<Accumulator<?, ?>>> userAccumulators = new HashMap<>(); for (ExecutionVertex vertex : getAllExecutionVertices()) { Map<String, Accumulator<?, ?>> next = vertex.getCurrentExecutionAttempt().getUserAccumulators(); if (next != null) { AccumulatorHelper.mergeInto(userAccumulators, next); } } return userAccumulators; }
|
/**
* Merges all accumulator results from the tasks previously executed in the Executions.
* @return The accumulator map
*/
|
Merges all accumulator results from the tasks previously executed in the Executions
|
aggregateUserAccumulators
|
{
"repo_name": "ueshin/apache-flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionGraph.java",
"license": "apache-2.0",
"size": 67080
}
|
[
"java.util.HashMap",
"java.util.Map",
"org.apache.flink.api.common.accumulators.Accumulator",
"org.apache.flink.api.common.accumulators.AccumulatorHelper",
"org.apache.flink.util.OptionalFailure"
] |
import java.util.HashMap; import java.util.Map; import org.apache.flink.api.common.accumulators.Accumulator; import org.apache.flink.api.common.accumulators.AccumulatorHelper; import org.apache.flink.util.OptionalFailure;
|
import java.util.*; import org.apache.flink.api.common.accumulators.*; import org.apache.flink.util.*;
|
[
"java.util",
"org.apache.flink"
] |
java.util; org.apache.flink;
| 1,790,420
|
@Test
public void testTerminatorLeftE() throws Exception {
ArrayList<GNSSPoint> points = new ArrayList<>();
points = FlightAnalyserTestFacade.loadFromFile(
"src/test/resources/testTerminatorLeftE.igc").igc_points;
GNSSPoint p2 = points.get(1);
GNSSPoint p1 = points.get(0);
p2.resolve(p1);
CircleTestFacade c = null;
p1 = null;
p2 = null;
int circle_count = 0;
for (int i = 1; i < points.size(); i++) {
p2 = points.get(i);
if (p1 != null && p2 != null) {
p2.resolve(p1);
if (c == null) {
c = new CircleTestFacade(p1, p2, FlightMode.TURNING_LEFT);
}
if (c.detectCircleCompleted(p2)) {
circle_count++;
c = new CircleTestFacade(p1, p2, c);
}
}
p1 = p2;
}
assertEquals(1, circle_count);
}
|
void function() throws Exception { ArrayList<GNSSPoint> points = new ArrayList<>(); points = FlightAnalyserTestFacade.loadFromFile( STR).igc_points; GNSSPoint p2 = points.get(1); GNSSPoint p1 = points.get(0); p2.resolve(p1); CircleTestFacade c = null; p1 = null; p2 = null; int circle_count = 0; for (int i = 1; i < points.size(); i++) { p2 = points.get(i); if (p1 != null && p2 != null) { p2.resolve(p1); if (c == null) { c = new CircleTestFacade(p1, p2, FlightMode.TURNING_LEFT); } if (c.detectCircleCompleted(p2)) { circle_count++; c = new CircleTestFacade(p1, p2, c); } } p1 = p2; } assertEquals(1, circle_count); }
|
/**
* Simulates left-handed circling with the circle start heading very close to North, but to the East
*
* @throws Exception
*
*/
|
Simulates left-handed circling with the circle start heading very close to North, but to the East
|
testTerminatorLeftE
|
{
"repo_name": "jpretori/SoaringCoach",
"path": "src/test/java/soaringcoach/TestDetectCircleCompleted.java",
"license": "agpl-3.0",
"size": 5314
}
|
[
"java.util.ArrayList",
"org.junit.Assert"
] |
import java.util.ArrayList; import org.junit.Assert;
|
import java.util.*; import org.junit.*;
|
[
"java.util",
"org.junit"
] |
java.util; org.junit;
| 26,012
|
@Override
void append(String str) {
// For pretty printing: indent at the beginning of the line
if (lineLength == 0) {
for (int i = 0; i < indent; i++) {
code.append(INDENT);
lineLength += INDENT.length();
}
}
code.append(str);
lineLength += str.length();
// Correct lineIndex and lineLength if there were newlines in the string.
int newlines = CharMatcher.is('\n').countIn(str);
if (newlines > 0) {
lineIndex += newlines;
lineLength = str.length() - str.lastIndexOf('\n');
}
}
|
void append(String str) { if (lineLength == 0) { for (int i = 0; i < indent; i++) { code.append(INDENT); lineLength += INDENT.length(); } } code.append(str); lineLength += str.length(); int newlines = CharMatcher.is('\n').countIn(str); if (newlines > 0) { lineIndex += newlines; lineLength = str.length() - str.lastIndexOf('\n'); } }
|
/**
* Appends a string to the code, keeping track of the current line length.
*/
|
Appends a string to the code, keeping track of the current line length
|
append
|
{
"repo_name": "ralic/closure-compiler",
"path": "src/com/google/javascript/jscomp/CodePrinter.java",
"license": "apache-2.0",
"size": 22274
}
|
[
"com.google.common.base.CharMatcher"
] |
import com.google.common.base.CharMatcher;
|
import com.google.common.base.*;
|
[
"com.google.common"
] |
com.google.common;
| 2,355,502
|
public void clearFilters() {
for(JTextField[] inputFields : fieldInputFields.values())
for(JTextField inputField : inputFields)
inputField.setText("");
filterEntered();
}
|
void function() { for(JTextField[] inputFields : fieldInputFields.values()) for(JTextField inputField : inputFields) inputField.setText(""); filterEntered(); }
|
/**
* Clears all filters entered by the user so far and updates the filtered
* data accordingly. Note that an <code>ActionEvent</code> is fired after
* the operation is completed, so whatever you usually do with the data
* should be done automatically.
*/
|
Clears all filters entered by the user so far and updates the filtered data accordingly. Note that an <code>ActionEvent</code> is fired after the operation is completed, so whatever you usually do with the data should be done automatically
|
clearFilters
|
{
"repo_name": "JLimperg/SalSSuite",
"path": "src/salssuite/util/gui/FilterPanel.java",
"license": "gpl-3.0",
"size": 25413
}
|
[
"javax.swing.JTextField"
] |
import javax.swing.JTextField;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 279,560
|
public Map<String, Set<String>> getScopesForAPIS(String apiIdsString) throws APIManagementException {
Map<String, Set<String>> apiScopeSet = new HashMap();
try (Connection conn = APIMgtDBUtil.getConnection()) {
String sqlQuery = SQLConstants.GET_SCOPES_FOR_API_LIST;
if (conn.getMetaData().getDriverName().contains("Oracle")) {
sqlQuery = SQLConstants.GET_SCOPES_FOR_API_LIST_ORACLE;
}
// apids are retrieved from the db so no need to protect for sql injection
sqlQuery = sqlQuery.replace("$paramList", apiIdsString);
try (PreparedStatement ps = conn.prepareStatement(sqlQuery);
ResultSet resultSet = ps.executeQuery()) {
while (resultSet.next()) {
String scopeKey = resultSet.getString(1);
String apiId = resultSet.getString(2);
Set<String> scopeList = apiScopeSet.get(apiId);
if (scopeList == null) {
scopeList = new LinkedHashSet<>();
scopeList.add(scopeKey);
apiScopeSet.put(apiId, scopeList);
} else {
scopeList.add(scopeKey);
apiScopeSet.put(apiId, scopeList);
}
}
}
} catch (SQLException e) {
handleException("Failed to retrieve api scopes ", e);
}
return apiScopeSet;
}
|
Map<String, Set<String>> function(String apiIdsString) throws APIManagementException { Map<String, Set<String>> apiScopeSet = new HashMap(); try (Connection conn = APIMgtDBUtil.getConnection()) { String sqlQuery = SQLConstants.GET_SCOPES_FOR_API_LIST; if (conn.getMetaData().getDriverName().contains(STR)) { sqlQuery = SQLConstants.GET_SCOPES_FOR_API_LIST_ORACLE; } sqlQuery = sqlQuery.replace(STR, apiIdsString); try (PreparedStatement ps = conn.prepareStatement(sqlQuery); ResultSet resultSet = ps.executeQuery()) { while (resultSet.next()) { String scopeKey = resultSet.getString(1); String apiId = resultSet.getString(2); Set<String> scopeList = apiScopeSet.get(apiId); if (scopeList == null) { scopeList = new LinkedHashSet<>(); scopeList.add(scopeKey); apiScopeSet.put(apiId, scopeList); } else { scopeList.add(scopeKey); apiScopeSet.put(apiId, scopeList); } } } } catch (SQLException e) { handleException(STR, e); } return apiScopeSet; }
|
/**
* Returns all the scopes assigned for given apis
*
* @param apiIdsString list of api ids separated by commas
* @return Map<String, Set < String>> set of scope keys for each apiId
* @throws APIManagementException
*/
|
Returns all the scopes assigned for given apis
|
getScopesForAPIS
|
{
"repo_name": "tharikaGitHub/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java",
"license": "apache-2.0",
"size": 805423
}
|
[
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.HashMap",
"java.util.LinkedHashSet",
"java.util.Map",
"java.util.Set",
"org.wso2.carbon.apimgt.api.APIManagementException",
"org.wso2.carbon.apimgt.impl.dao.constants.SQLConstants",
"org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil"
] |
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.impl.dao.constants.SQLConstants; import org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil;
|
import java.sql.*; import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.impl.dao.constants.*; import org.wso2.carbon.apimgt.impl.utils.*;
|
[
"java.sql",
"java.util",
"org.wso2.carbon"
] |
java.sql; java.util; org.wso2.carbon;
| 1,410,293
|
public int indexWorst(Comparator<MOSolutionBase<Type>> comparator) {
if ((solutions == null) || (this.solutions.isEmpty())) {
return -1;
}
int index = 0;
MOSolutionBase<Type> worstKnown = solutions.get(0), candidateSolution;
int flag;
for (int i = 1; i < solutions.size(); i++) {
candidateSolution = solutions.get(i);
flag = comparator.compare(worstKnown, candidateSolution);
if (flag == -1) {
index = i;
worstKnown = candidateSolution;
}
}
return index;
}
|
int function(Comparator<MOSolutionBase<Type>> comparator) { if ((solutions == null) (this.solutions.isEmpty())) { return -1; } int index = 0; MOSolutionBase<Type> worstKnown = solutions.get(0), candidateSolution; int flag; for (int i = 1; i < solutions.size(); i++) { candidateSolution = solutions.get(i); flag = comparator.compare(worstKnown, candidateSolution); if (flag == -1) { index = i; worstKnown = candidateSolution; } } return index; }
|
/**
* Returns the index of the worst Solution using a <code>Comparator</code>.
* If there are more than one occurrences, only the index of the first one is returned
*
* @param comparator <code>Comparator</code> used to compare solutions.
* @return The index of the worst Solution attending to the comparator or
* <code>-1<code> if the SolutionSet is empty
*/
|
Returns the index of the worst Solution using a <code>Comparator</code>. If there are more than one occurrences, only the index of the first one is returned
|
indexWorst
|
{
"repo_name": "UM-LPM/EARS",
"path": "src/org/um/feri/ears/problems/moo/ParetoSolution.java",
"license": "gpl-3.0",
"size": 22150
}
|
[
"java.util.Comparator"
] |
import java.util.Comparator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 416,666
|
public void setExcelOutput(OutputStream excelOutput) {
this.excelOutput = excelOutput;
}
|
void function(OutputStream excelOutput) { this.excelOutput = excelOutput; }
|
/**
* Set the output stream to which the Excel workbook will be persisted at datasource disposal.
*
* @param excelOutput
*/
|
Set the output stream to which the Excel workbook will be persisted at datasource disposal
|
setExcelOutput
|
{
"repo_name": "obiba/magma",
"path": "magma-datasource-excel/src/main/java/org/obiba/magma/datasource/excel/ExcelDatasource.java",
"license": "gpl-3.0",
"size": 25271
}
|
[
"java.io.OutputStream"
] |
import java.io.OutputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,140,730
|
protected void assertLabelsVisited(
Set<String> expectedLabels,
Set<String> startingLabelStrings,
boolean keepGoing)
throws Exception {
Set<Label> startingLabels = asLabelSet(startingLabelStrings);
// Spawn a lot of threads to help uncover concurrency issues
visitor.preloadTransitiveTargets(reporter, startingLabels, keepGoing, 200);
assertExpectedTargets(expectedLabels, startingLabels);
}
|
void function( Set<String> expectedLabels, Set<String> startingLabelStrings, boolean keepGoing) throws Exception { Set<Label> startingLabels = asLabelSet(startingLabelStrings); visitor.preloadTransitiveTargets(reporter, startingLabels, keepGoing, 200); assertExpectedTargets(expectedLabels, startingLabels); }
|
/**
* Asserts all labels in expectedLabels are visited by walking
* the dependency trees starting at startingLabels, and no other labels are visited.
*
* @param expectedLabels The expected set of labels visited.
* @param startingLabelStrings Visit the transitive closure of each of these labels.
* @param keepGoing Whether the visitation continues after encountering
* errors.
*/
|
Asserts all labels in expectedLabels are visited by walking the dependency trees starting at startingLabels, and no other labels are visited
|
assertLabelsVisited
|
{
"repo_name": "cushon/bazel",
"path": "src/test/java/com/google/devtools/build/lib/pkgcache/QueryPreloadingTestCase.java",
"license": "apache-2.0",
"size": 8334
}
|
[
"com.google.devtools.build.lib.cmdline.Label",
"java.util.Set"
] |
import com.google.devtools.build.lib.cmdline.Label; import java.util.Set;
|
import com.google.devtools.build.lib.cmdline.*; import java.util.*;
|
[
"com.google.devtools",
"java.util"
] |
com.google.devtools; java.util;
| 226,572
|
Configuration setDivertConfigurations(final List<DivertConfiguration> configs);
|
Configuration setDivertConfigurations(final List<DivertConfiguration> configs);
|
/**
* Sets the diverts configured for this server.
*/
|
Sets the diverts configured for this server
|
setDivertConfigurations
|
{
"repo_name": "okalmanRH/jboss-activemq-artemis",
"path": "artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java",
"license": "apache-2.0",
"size": 36647
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 805,834
|
public XacmlRequest setXacmlRequestIfNull(String resourceId,
final String messageId) {
final XacmlRequest xacmlRequest = new XacmlRequest();
xacmlRequest.setMessageId(messageId);
xacmlRequest.setPatientId(resourceId);
return xacmlRequest;
}
|
XacmlRequest function(String resourceId, final String messageId) { final XacmlRequest xacmlRequest = new XacmlRequest(); xacmlRequest.setMessageId(messageId); xacmlRequest.setPatientId(resourceId); return xacmlRequest; }
|
/**
* Sets the xacml request if null.
*
* @param resourceId
* the resource id
* @param messageId
* the message id
* @return the xacml request
*/
|
Sets the xacml request if null
|
setXacmlRequestIfNull
|
{
"repo_name": "OBHITA/Consent2Share",
"path": "DS4P/access-control-service/bl/pep-service-bl/src/main/java/gov/samhsa/acs/pep/PolicyEnforcementPointImpl.java",
"license": "bsd-3-clause",
"size": 50416
}
|
[
"gov.samhsa.acs.common.dto.XacmlRequest"
] |
import gov.samhsa.acs.common.dto.XacmlRequest;
|
import gov.samhsa.acs.common.dto.*;
|
[
"gov.samhsa.acs"
] |
gov.samhsa.acs;
| 1,418,152
|
public JSONObject responseDelete(Long responseId, Long plurkId) throws RequestException {
return requestBy("responseDelete")
.with(new Args().add("response_id", responseId).add("plurk_id", plurkId))
.in(HttpMethod.GET).thenJsonObject();
}
|
JSONObject function(Long responseId, Long plurkId) throws RequestException { return requestBy(STR) .with(new Args().add(STR, responseId).add(STR, plurkId)) .in(HttpMethod.GET).thenJsonObject(); }
|
/**
* Deletes a response. A user can delete own responses or responses that are posted to own plurks.
* @param responseId The id of the response to delete.
* @param plurkId The plurk that the response belongs to.
* @return <code>{"success_text": "ok"}</code> if the response has been deleted.
* @throws RequestException
*/
|
Deletes a response. A user can delete own responses or responses that are posted to own plurks
|
responseDelete
|
{
"repo_name": "ricksimon/FilteringPlurk",
"path": "app/src/main/java/com/google/jplurk_oauth/module/Responses.java",
"license": "apache-2.0",
"size": 3442
}
|
[
"com.google.jplurk_oauth.skeleton.Args",
"com.google.jplurk_oauth.skeleton.HttpMethod",
"com.google.jplurk_oauth.skeleton.RequestException",
"org.json.JSONObject"
] |
import com.google.jplurk_oauth.skeleton.Args; import com.google.jplurk_oauth.skeleton.HttpMethod; import com.google.jplurk_oauth.skeleton.RequestException; import org.json.JSONObject;
|
import com.google.jplurk_oauth.skeleton.*; import org.json.*;
|
[
"com.google.jplurk_oauth",
"org.json"
] |
com.google.jplurk_oauth; org.json;
| 155,443
|
private void initViewSubmissionListOption(SessionState state) {
if (state.getAttribute(VIEW_SUBMISSION_LIST_OPTION) == null
&& (state.getAttribute(SUBMISSIONS_SEARCH_ONLY) == null
|| !((Boolean) state.getAttribute(SUBMISSIONS_SEARCH_ONLY)).booleanValue()))
{
state.setAttribute(VIEW_SUBMISSION_LIST_OPTION, AssignmentConstants.ALL);
}
}
|
void function(SessionState state) { if (state.getAttribute(VIEW_SUBMISSION_LIST_OPTION) == null && (state.getAttribute(SUBMISSIONS_SEARCH_ONLY) == null !((Boolean) state.getAttribute(SUBMISSIONS_SEARCH_ONLY)).booleanValue())) { state.setAttribute(VIEW_SUBMISSION_LIST_OPTION, AssignmentConstants.ALL); } }
|
/**
* make sure the state variable VIEW_SUBMISSION_LIST_OPTION is not null
* @param state
*/
|
make sure the state variable VIEW_SUBMISSION_LIST_OPTION is not null
|
initViewSubmissionListOption
|
{
"repo_name": "lorenamgUMU/sakai",
"path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java",
"license": "apache-2.0",
"size": 677150
}
|
[
"org.sakaiproject.assignment.api.AssignmentConstants",
"org.sakaiproject.event.api.SessionState"
] |
import org.sakaiproject.assignment.api.AssignmentConstants; import org.sakaiproject.event.api.SessionState;
|
import org.sakaiproject.assignment.api.*; import org.sakaiproject.event.api.*;
|
[
"org.sakaiproject.assignment",
"org.sakaiproject.event"
] |
org.sakaiproject.assignment; org.sakaiproject.event;
| 868,539
|
public static int getClockSkewInSeconds() {
String clockSkewConfigValue = IdentityUtil.getProperty(IdentityConstants.ServerConfig.CLOCK_SKEW);
if (StringUtils.isBlank(clockSkewConfigValue) || !StringUtils.isNumeric(clockSkewConfigValue)) {
clockSkewConfigValue = IdentityConstants.ServerConfig.CLOCK_SKEW_DEFAULT;
}
return Integer.parseInt(clockSkewConfigValue);
}
|
static int function() { String clockSkewConfigValue = IdentityUtil.getProperty(IdentityConstants.ServerConfig.CLOCK_SKEW); if (StringUtils.isBlank(clockSkewConfigValue) !StringUtils.isNumeric(clockSkewConfigValue)) { clockSkewConfigValue = IdentityConstants.ServerConfig.CLOCK_SKEW_DEFAULT; } return Integer.parseInt(clockSkewConfigValue); }
|
/**
* Get the server synchronization tolerance value in seconds
*
* @return clock skew in seconds
*/
|
Get the server synchronization tolerance value in seconds
|
getClockSkewInSeconds
|
{
"repo_name": "dharshanaw/carbon-identity-framework",
"path": "components/identity-core/org.wso2.carbon.identity.core/src/main/java/org/wso2/carbon/identity/core/util/IdentityUtil.java",
"license": "apache-2.0",
"size": 40688
}
|
[
"org.apache.commons.lang.StringUtils",
"org.wso2.carbon.identity.base.IdentityConstants"
] |
import org.apache.commons.lang.StringUtils; import org.wso2.carbon.identity.base.IdentityConstants;
|
import org.apache.commons.lang.*; import org.wso2.carbon.identity.base.*;
|
[
"org.apache.commons",
"org.wso2.carbon"
] |
org.apache.commons; org.wso2.carbon;
| 552,385
|
public List<FunctionReference> getOverloadedMethods(String classname){
List<FunctionReference> list = new ArrayList<>();
List<FolderHandler> folders = new ArrayList<>(getFolderHandlers());
folders.add(pwdHandler);
for (FolderHandler handler : folders){
for (GenericFile f : handler.getAllSpecialized(classname)){
list.add(new FunctionReference(f,FunctionReference.ReferenceType.OVERLOADED));
}
GenericFile constructor = handler.lookupClasses(classname);
if (constructor != null){
list.add(new FunctionReference(constructor,FunctionReference.ReferenceType.CLASS_CONSTRUCTOR));
}
}
return list;
}
|
List<FunctionReference> function(String classname){ List<FunctionReference> list = new ArrayList<>(); List<FolderHandler> folders = new ArrayList<>(getFolderHandlers()); folders.add(pwdHandler); for (FolderHandler handler : folders){ for (GenericFile f : handler.getAllSpecialized(classname)){ list.add(new FunctionReference(f,FunctionReference.ReferenceType.OVERLOADED)); } GenericFile constructor = handler.lookupClasses(classname); if (constructor != null){ list.add(new FunctionReference(constructor,FunctionReference.ReferenceType.CLASS_CONSTRUCTOR)); } } return list; }
|
/**
* returns all overload methods (via folders) in all the folders in the path
* TODO - there may be builtin functions showing up as overloaded functions on the
* matlab path, which may not actually contain code, but just help files -- although that's unlikely
*/
|
returns all overload methods (via folders) in all the folders in the path TODO - there may be builtin functions showing up as overloaded functions on the matlab path, which may not actually contain code, but just help files -- although that's unlikely
|
getOverloadedMethods
|
{
"repo_name": "Sable/mclab-core",
"path": "languages/Natlab/src/natlab/toolkits/path/FileEnvironment.java",
"license": "apache-2.0",
"size": 6422
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,555,295
|
protected VdcReturnValueBase attemptRollback(VdcActionType commandType,
VdcActionParametersBase params, CommandContext context) {
if (canPerformRollbackUsingCommand(commandType, params)) {
params.setExecutionReason(CommandExecutionReason.ROLLBACK_FLOW);
params.setTransactionScopeOption(TransactionScopeOption.RequiresNew);
return getBackend().runInternalAction(commandType, params, context);
}
return new VdcReturnValueBase();
}
|
VdcReturnValueBase function(VdcActionType commandType, VdcActionParametersBase params, CommandContext context) { if (canPerformRollbackUsingCommand(commandType, params)) { params.setExecutionReason(CommandExecutionReason.ROLLBACK_FLOW); params.setTransactionScopeOption(TransactionScopeOption.RequiresNew); return getBackend().runInternalAction(commandType, params, context); } return new VdcReturnValueBase(); }
|
/**
* Checks if possible to perform rollback using command, and if so performs it
*
* @param commandType
* command type for the rollback
* @param params
* parameters for the rollback
* @param context
* context for the rollback
* @return result of the command execution
*/
|
Checks if possible to perform rollback using command, and if so performs it
|
attemptRollback
|
{
"repo_name": "walteryang47/ovirt-engine",
"path": "backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java",
"license": "apache-2.0",
"size": 103472
}
|
[
"org.ovirt.engine.core.bll.context.CommandContext",
"org.ovirt.engine.core.common.action.VdcActionParametersBase",
"org.ovirt.engine.core.common.action.VdcActionType",
"org.ovirt.engine.core.common.action.VdcReturnValueBase",
"org.ovirt.engine.core.compat.TransactionScopeOption"
] |
import org.ovirt.engine.core.bll.context.CommandContext; import org.ovirt.engine.core.common.action.VdcActionParametersBase; import org.ovirt.engine.core.common.action.VdcActionType; import org.ovirt.engine.core.common.action.VdcReturnValueBase; import org.ovirt.engine.core.compat.TransactionScopeOption;
|
import org.ovirt.engine.core.bll.context.*; import org.ovirt.engine.core.common.action.*; import org.ovirt.engine.core.compat.*;
|
[
"org.ovirt.engine"
] |
org.ovirt.engine;
| 2,904,044
|
@Test(expected = IndexOutOfBoundsException.class)
public void getIndexTooLow() {
SUB_LIST_1_3.get(-1);
}
|
@Test(expected = IndexOutOfBoundsException.class) void function() { SUB_LIST_1_3.get(-1); }
|
/**
* Asserts that {@link SourceLocationList.SubList#get(int)} throws an {@link IndexOutOfBoundsException} when the
* <code>index</code> argument is negative.
*/
|
Asserts that <code>SourceLocationList.SubList#get(int)</code> throws an <code>IndexOutOfBoundsException</code> when the <code>index</code> argument is negative
|
getIndexTooLow
|
{
"repo_name": "reasm/reasm-core",
"path": "src/test/java/org/reasm/source/SourceLocationListSubListTest.java",
"license": "mit",
"size": 11341
}
|
[
"org.junit.Test"
] |
import org.junit.Test;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 27,984
|
public boolean isDBInitialized() {
log.debug(String.format("Check database initialization: driver=%s host=%s port=%s user=%s", driver, host, port, username));
Connection c = null;
try {
Class.forName(driver);
c = DriverManager.getConnection(url, username, password);
log.debug("Database exists");
return true;
} catch (SQLException e) {
log.debug("Database does not exist");
// database doesn't exist
return false;
} catch (ClassNotFoundException e) {
throw new RuntimeException("Database driver not found: " + driver, e);
} finally {
if (c != null) {
try {
c.close();
} catch (SQLException e) {
}
}
}
}
|
boolean function() { log.debug(String.format(STR, driver, host, port, username)); Connection c = null; try { Class.forName(driver); c = DriverManager.getConnection(url, username, password); log.debug(STR); return true; } catch (SQLException e) { log.debug(STR); return false; } catch (ClassNotFoundException e) { throw new RuntimeException(STR + driver, e); } finally { if (c != null) { try { c.close(); } catch (SQLException e) { } } } }
|
/**
* Returns true if it's possible to establish a connection to the database at the specified URL, otherwise returns false
*/
|
Returns true if it's possible to establish a connection to the database at the specified URL, otherwise returns false
|
isDBInitialized
|
{
"repo_name": "openforis/calc",
"path": "calc-core/src/main/java/org/openforis/calc/persistence/DatabaseInitializer.java",
"license": "mit",
"size": 5190
}
|
[
"java.sql.Connection",
"java.sql.DriverManager",
"java.sql.SQLException"
] |
import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 287,901
|
public DelayInfo getDelayInfo() {
return delay;
}
public static class Provider implements PacketExtensionProvider {
DelayInfoProvider dip = new DelayInfoProvider();
|
DelayInfo function() { return delay; } public static class Provider implements PacketExtensionProvider { DelayInfoProvider dip = new DelayInfoProvider();
|
/**
* get the timestamp of the forwarded packet.
*
* @return the {@link DelayInfo} representing the time when the original packet was sent. May be null.
*/
|
get the timestamp of the forwarded packet
|
getDelayInfo
|
{
"repo_name": "luchuangbin/test1",
"path": "src/org/jivesoftware/smackx/forward/Forwarded.java",
"license": "apache-2.0",
"size": 4403
}
|
[
"org.jivesoftware.smack.provider.PacketExtensionProvider",
"org.jivesoftware.smackx.packet.DelayInfo",
"org.jivesoftware.smackx.provider.DelayInfoProvider"
] |
import org.jivesoftware.smack.provider.PacketExtensionProvider; import org.jivesoftware.smackx.packet.DelayInfo; import org.jivesoftware.smackx.provider.DelayInfoProvider;
|
import org.jivesoftware.smack.provider.*; import org.jivesoftware.smackx.packet.*; import org.jivesoftware.smackx.provider.*;
|
[
"org.jivesoftware.smack",
"org.jivesoftware.smackx"
] |
org.jivesoftware.smack; org.jivesoftware.smackx;
| 2,759,267
|
public static String describeCommand(
CommandDescriptionForm form,
boolean prettyPrintArgs,
Collection<String> commandLineElements,
@Nullable Map<String, String> environment,
@Nullable String cwd,
@Nullable String configurationChecksum,
@Nullable String executionPlatformAsLabelString) {
Preconditions.checkNotNull(form);
StringBuilder message = new StringBuilder();
int size = commandLineElements.size();
int numberRemaining = size;
if (form == CommandDescriptionForm.COMPLETE) {
describeCommandImpl.describeCommandBeginIsolate(message);
}
if (form != CommandDescriptionForm.ABBREVIATED) {
if (cwd != null) {
describeCommandImpl.describeCommandCwd(cwd, message);
}
describeCommandImpl.describeCommandExec(message);
if (environment != null) {
describeCommandImpl.describeCommandEnvPrefix(
message, form != CommandDescriptionForm.COMPLETE_UNISOLATED);
// A map can never have two keys with the same value, so we only need to compare the keys.
Comparator<Map.Entry<String, String>> mapEntryComparator = comparingByKey();
for (Map.Entry<String, String> entry :
Ordering.from(mapEntryComparator).sortedCopy(environment.entrySet())) {
message.append(" ");
describeCommandImpl.describeCommandEnvVar(message, entry);
}
}
}
boolean isFirstArgument = true;
for (String commandElement : commandLineElements) {
if (form == CommandDescriptionForm.ABBREVIATED
&& message.length() + commandElement.length() > APPROXIMATE_MAXIMUM_MESSAGE_LENGTH) {
message
.append(" ... (remaining ")
.append(numberRemaining)
.append(numberRemaining == 1 ? " argument" : " arguments")
.append(" skipped)");
break;
} else {
if (numberRemaining < size) {
message.append(prettyPrintArgs ? " \\\n " : " ");
}
describeCommandImpl.describeCommandElement(message, commandElement, isFirstArgument);
numberRemaining--;
}
isFirstArgument = false;
}
if (form == CommandDescriptionForm.COMPLETE) {
describeCommandImpl.describeCommandEndIsolate(message);
}
if (form == CommandDescriptionForm.COMPLETE) {
if (configurationChecksum != null) {
message.append("\n");
message.append("# Configuration: ").append(configurationChecksum);
}
if (executionPlatformAsLabelString != null) {
message.append("\n");
message.append("# Execution platform: ").append(executionPlatformAsLabelString);
}
}
return message.toString();
}
|
static String function( CommandDescriptionForm form, boolean prettyPrintArgs, Collection<String> commandLineElements, @Nullable Map<String, String> environment, @Nullable String cwd, @Nullable String configurationChecksum, @Nullable String executionPlatformAsLabelString) { Preconditions.checkNotNull(form); StringBuilder message = new StringBuilder(); int size = commandLineElements.size(); int numberRemaining = size; if (form == CommandDescriptionForm.COMPLETE) { describeCommandImpl.describeCommandBeginIsolate(message); } if (form != CommandDescriptionForm.ABBREVIATED) { if (cwd != null) { describeCommandImpl.describeCommandCwd(cwd, message); } describeCommandImpl.describeCommandExec(message); if (environment != null) { describeCommandImpl.describeCommandEnvPrefix( message, form != CommandDescriptionForm.COMPLETE_UNISOLATED); Comparator<Map.Entry<String, String>> mapEntryComparator = comparingByKey(); for (Map.Entry<String, String> entry : Ordering.from(mapEntryComparator).sortedCopy(environment.entrySet())) { message.append(" "); describeCommandImpl.describeCommandEnvVar(message, entry); } } } boolean isFirstArgument = true; for (String commandElement : commandLineElements) { if (form == CommandDescriptionForm.ABBREVIATED && message.length() + commandElement.length() > APPROXIMATE_MAXIMUM_MESSAGE_LENGTH) { message .append(STR) .append(numberRemaining) .append(numberRemaining == 1 ? STR : STR) .append(STR); break; } else { if (numberRemaining < size) { message.append(prettyPrintArgs ? STR : " "); } describeCommandImpl.describeCommandElement(message, commandElement, isFirstArgument); numberRemaining--; } isFirstArgument = false; } if (form == CommandDescriptionForm.COMPLETE) { describeCommandImpl.describeCommandEndIsolate(message); } if (form == CommandDescriptionForm.COMPLETE) { if (configurationChecksum != null) { message.append("\n"); message.append(STR).append(configurationChecksum); } if (executionPlatformAsLabelString != null) { message.append("\n"); message.append(STR).append(executionPlatformAsLabelString); } } return message.toString(); }
|
/**
* Construct a string that describes the command. Currently this returns a message of the form
* "foo bar baz", with shell meta-characters appropriately quoted and/or escaped, prefixed (if
* verbose is true) with an "env" command to set the environment.
*
* @param form Form of the command to generate; see the documentation of the {@link
* CommandDescriptionForm} values.
*/
|
Construct a string that describes the command. Currently this returns a message of the form "foo bar baz", with shell meta-characters appropriately quoted and/or escaped, prefixed (if verbose is true) with an "env" command to set the environment
|
describeCommand
|
{
"repo_name": "bazelbuild/bazel",
"path": "src/main/java/com/google/devtools/build/lib/util/CommandFailureUtils.java",
"license": "apache-2.0",
"size": 12141
}
|
[
"com.google.common.base.Preconditions",
"com.google.common.collect.Ordering",
"java.util.Collection",
"java.util.Comparator",
"java.util.Map",
"javax.annotation.Nullable"
] |
import com.google.common.base.Preconditions; import com.google.common.collect.Ordering; import java.util.Collection; import java.util.Comparator; import java.util.Map; import javax.annotation.Nullable;
|
import com.google.common.base.*; import com.google.common.collect.*; import java.util.*; import javax.annotation.*;
|
[
"com.google.common",
"java.util",
"javax.annotation"
] |
com.google.common; java.util; javax.annotation;
| 103,342
|
@Issue("JENKINS-5768")
@Test
public void xmlRoundTrip() {
XStream2 xs = new XStream2();
__Foo_Bar$Class b = new __Foo_Bar$Class();
String xml = xs.toXML(b);
__Foo_Bar$Class b2 = (__Foo_Bar$Class) xs.fromXML(xml);
assertEquals(xml, b.under_1, b2.under_1);
assertEquals(xml, b.under__2, b2.under__2);
assertEquals(xml, b._leadUnder1, b2._leadUnder1);
assertEquals(xml, b.__leadUnder2, b2.__leadUnder2);
assertEquals(xml, b.$dollar, b2.$dollar);
assertEquals(xml, b.dollar$2, b2.dollar$2);
}
private static class Baz {
private Exception myFailure;
}
|
@Issue(STR) void function() { XStream2 xs = new XStream2(); __Foo_Bar$Class b = new __Foo_Bar$Class(); String xml = xs.toXML(b); __Foo_Bar$Class b2 = (__Foo_Bar$Class) xs.fromXML(xml); assertEquals(xml, b.under_1, b2.under_1); assertEquals(xml, b.under__2, b2.under__2); assertEquals(xml, b._leadUnder1, b2._leadUnder1); assertEquals(xml, b.__leadUnder2, b2.__leadUnder2); assertEquals(xml, b.$dollar, b2.$dollar); assertEquals(xml, b.dollar$2, b2.dollar$2); } private static class Baz { private Exception myFailure; }
|
/**
* Test marshal/unmarshal round trip for class/field names with _ and $ characters.
*/
|
Test marshal/unmarshal round trip for class/field names with _ and $ characters
|
xmlRoundTrip
|
{
"repo_name": "v1v/jenkins",
"path": "core/src/test/java/hudson/util/XStream2Test.java",
"license": "mit",
"size": 22318
}
|
[
"org.junit.Assert",
"org.jvnet.hudson.test.Issue"
] |
import org.junit.Assert; import org.jvnet.hudson.test.Issue;
|
import org.junit.*; import org.jvnet.hudson.test.*;
|
[
"org.junit",
"org.jvnet.hudson"
] |
org.junit; org.jvnet.hudson;
| 2,850,786
|
public void loadWorld(World world);
|
void function(World world);
|
/**
* Load all ChunkletStores from all loaded chunks from this world into memory
*
* @param world World to load
*/
|
Load all ChunkletStores from all loaded chunks from this world into memory
|
loadWorld
|
{
"repo_name": "isokissa3/mcMMO",
"path": "src/main/java/com/gmail/nossr50/util/blockmeta/ChunkletManager.java",
"license": "agpl-3.0",
"size": 4584
}
|
[
"org.bukkit.World"
] |
import org.bukkit.World;
|
import org.bukkit.*;
|
[
"org.bukkit"
] |
org.bukkit;
| 1,244,414
|
@Override
public AclStatus getAclStatus(Path path) throws IOException {
Map<String, String> params = new HashMap<String, String>();
params.put(OP_PARAM, Operation.GETACLSTATUS.toString());
HttpURLConnection conn = getConnection(Operation.GETACLSTATUS.getMethod(),
params, path, true);
HttpExceptionUtils.validateResponse(conn, HttpURLConnection.HTTP_OK);
JSONObject json = (JSONObject) HttpFSUtils.jsonParse(conn);
json = (JSONObject) json.get(ACL_STATUS_JSON);
return createAclStatus(json);
}
|
AclStatus function(Path path) throws IOException { Map<String, String> params = new HashMap<String, String>(); params.put(OP_PARAM, Operation.GETACLSTATUS.toString()); HttpURLConnection conn = getConnection(Operation.GETACLSTATUS.getMethod(), params, path, true); HttpExceptionUtils.validateResponse(conn, HttpURLConnection.HTTP_OK); JSONObject json = (JSONObject) HttpFSUtils.jsonParse(conn); json = (JSONObject) json.get(ACL_STATUS_JSON); return createAclStatus(json); }
|
/**
* Get the ACL information for a given file
* @param path Path to acquire ACL info for
* @return the ACL information in JSON format
* @throws IOException
*/
|
Get the ACL information for a given file
|
getAclStatus
|
{
"repo_name": "GeLiXin/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs-httpfs/src/main/java/org/apache/hadoop/fs/http/client/HttpFSFileSystem.java",
"license": "apache-2.0",
"size": 56830
}
|
[
"java.io.IOException",
"java.net.HttpURLConnection",
"java.util.HashMap",
"java.util.Map",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.fs.permission.AclStatus",
"org.apache.hadoop.util.HttpExceptionUtils",
"org.json.simple.JSONObject"
] |
import java.io.IOException; import java.net.HttpURLConnection; import java.util.HashMap; import java.util.Map; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.AclStatus; import org.apache.hadoop.util.HttpExceptionUtils; import org.json.simple.JSONObject;
|
import java.io.*; import java.net.*; import java.util.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.fs.permission.*; import org.apache.hadoop.util.*; import org.json.simple.*;
|
[
"java.io",
"java.net",
"java.util",
"org.apache.hadoop",
"org.json.simple"
] |
java.io; java.net; java.util; org.apache.hadoop; org.json.simple;
| 640,069
|
@ServiceMethod(returns = ReturnType.SINGLE)
SyncPoller<PollResult<PreviewSubscriptionInner>, PreviewSubscriptionInner> beginCreateOrUpdate(
String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters);
|
@ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<PreviewSubscriptionInner>, PreviewSubscriptionInner> beginCreateOrUpdate( String vendorName, String skuName, String previewSubscription, PreviewSubscriptionInner parameters);
|
/**
* Creates or updates preview information of a vendor sku.
*
* @param vendorName The name of the vendor.
* @param skuName The name of the vendor sku.
* @param previewSubscription Preview subscription ID.
* @param parameters Parameters supplied to the create or update vendor preview subscription operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return customer subscription which can use a sku.
*/
|
Creates or updates preview information of a vendor sku
|
beginCreateOrUpdate
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/hybridnetwork/azure-resourcemanager-hybridnetwork/src/main/java/com/azure/resourcemanager/hybridnetwork/fluent/VendorSkuPreviewsClient.java",
"license": "mit",
"size": 10775
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.polling.SyncPoller",
"com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridnetwork.fluent.models.PreviewSubscriptionInner;
|
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.hybridnetwork.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,377,987
|
public boolean isDeletable(File file) {
return new DeleteOperationUtility().areUserCredentialsMatching(file);
}
|
boolean function(File file) { return new DeleteOperationUtility().areUserCredentialsMatching(file); }
|
/**
* Tells whether the file is deletable or not. Deletable only if the user
* credentials are matching.
*
* @param file
* The file under inspection to be deleted of type .result
* @return true if security credentials are matching
*/
|
Tells whether the file is deletable or not. Deletable only if the user credentials are matching
|
isDeletable
|
{
"repo_name": "helicaldev/DataQuality",
"path": "PCNI/src/main/java/com/helicaltech/pcni/rules/io/EFWSavedResultDeleteRule.java",
"license": "mpl-2.0",
"size": 3791
}
|
[
"com.helicaltech.pcni.useractions.DeleteOperationUtility",
"java.io.File"
] |
import com.helicaltech.pcni.useractions.DeleteOperationUtility; import java.io.File;
|
import com.helicaltech.pcni.useractions.*; import java.io.*;
|
[
"com.helicaltech.pcni",
"java.io"
] |
com.helicaltech.pcni; java.io;
| 1,988,839
|
public static void copyStream(InputStream inputStream, OutputStream outputStream) {
if (inputStream != null && outputStream != null) {
try {
int length = -1;
byte[] buffer = new byte[BYTES_PER_MB];
while ((length = inputStream.read(buffer, 0, buffer.length)) != -1) {
outputStream.write(buffer, 0, length);
outputStream.flush();
}
} catch (Exception e) {
throw new FileUtilException(e);
}
}
}
|
static void function(InputStream inputStream, OutputStream outputStream) { if (inputStream != null && outputStream != null) { try { int length = -1; byte[] buffer = new byte[BYTES_PER_MB]; while ((length = inputStream.read(buffer, 0, buffer.length)) != -1) { outputStream.write(buffer, 0, length); outputStream.flush(); } } catch (Exception e) { throw new FileUtilException(e); } } }
|
/**
* copy stream , from input to output,it don't close
*
* @param inputStream
* @param outputStream
*/
|
copy stream , from input to output,it don't close
|
copyStream
|
{
"repo_name": "kiddot/Record",
"path": "app/src/main/java/com/android/record/base/util/FileUtil.java",
"license": "apache-2.0",
"size": 3292
}
|
[
"java.io.InputStream",
"java.io.OutputStream"
] |
import java.io.InputStream; import java.io.OutputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 122,072
|
Decision makeDecision(Multimap<String, Verdict> verdicts);
|
Decision makeDecision(Multimap<String, Verdict> verdicts);
|
/** Returns decision
* @author Dmitry Kotlyarov
* @n
*
* @param verdicts - verdicts of comparison between current test and test from baseline session
*
* @return decision(OK, WARNING, FATAL, ERROR) */
|
Returns decision
|
makeDecision
|
{
"repo_name": "vladimir-bukhtoyarov/jagger",
"path": "chassis/core/src/main/java/com/griddynamics/jagger/engine/e1/sessioncomparation/DecisionMaker.java",
"license": "lgpl-2.1",
"size": 1997
}
|
[
"com.google.common.collect.Multimap",
"com.griddynamics.jagger.util.Decision"
] |
import com.google.common.collect.Multimap; import com.griddynamics.jagger.util.Decision;
|
import com.google.common.collect.*; import com.griddynamics.jagger.util.*;
|
[
"com.google.common",
"com.griddynamics.jagger"
] |
com.google.common; com.griddynamics.jagger;
| 2,665,116
|
public static void checkMinLength(String propertyName, String actualValue, int minLength) {
if (actualValue == null) {
throw new MinSizeExceededException("The property '" + propertyName + "' does not have a minimal length equal to '" + minLength + "' because it is null.");
}
if (actualValue.length() < minLength) {
throw new MinSizeExceededException("Length of '" + propertyName + "' is too short! MinLength=" + minLength + ", ActualLength=" + actualValue.length());
}
}
|
static void function(String propertyName, String actualValue, int minLength) { if (actualValue == null) { throw new MinSizeExceededException(STR + propertyName + STR + minLength + STR); } if (actualValue.length() < minLength) { throw new MinSizeExceededException(STR + propertyName + STR + minLength + STR + actualValue.length()); } }
|
/**
* Throws a MinSizeExceededException if the given value does not specified minLength.
* If the value is null then MinSizeExceededException is thrown as well.
*
* @param propertyName name of checked property
* @param minLength minimal length
* @throws MinSizeExceededException when length of actualValue is lower than minLength or null
*/
|
Throws a MinSizeExceededException if the given value does not specified minLength. If the value is null then MinSizeExceededException is thrown as well
|
checkMinLength
|
{
"repo_name": "CESNET/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/impl/Utils.java",
"license": "bsd-2-clause",
"size": 109042
}
|
[
"cz.metacentrum.perun.core.api.exceptions.MinSizeExceededException"
] |
import cz.metacentrum.perun.core.api.exceptions.MinSizeExceededException;
|
import cz.metacentrum.perun.core.api.exceptions.*;
|
[
"cz.metacentrum.perun"
] |
cz.metacentrum.perun;
| 1,312,306
|
@LargeTest
@Feature({"Browser"})
@RerunWithUpdatedContainerView
public void testReloadWhilePopupShowing() throws InterruptedException, Exception, Throwable {
// The popup should be hidden before the click.
CriteriaHelper.pollInstrumentationThread(new PopupHiddenCriteria());
final ContentViewCore viewCore = getContentViewCore();
final TestCallbackHelperContainer viewClient = new TestCallbackHelperContainer(viewCore);
final OnPageFinishedHelper onPageFinishedHelper = viewClient.getOnPageFinishedHelper();
// Once clicked, the popup should show up.
DOMUtils.clickNode(this, viewCore, "select");
CriteriaHelper.pollInstrumentationThread(new PopupShowingCriteria());
|
@Feature({STR}) void function() throws InterruptedException, Exception, Throwable { CriteriaHelper.pollInstrumentationThread(new PopupHiddenCriteria()); final ContentViewCore viewCore = getContentViewCore(); final TestCallbackHelperContainer viewClient = new TestCallbackHelperContainer(viewCore); final OnPageFinishedHelper onPageFinishedHelper = viewClient.getOnPageFinishedHelper(); DOMUtils.clickNode(this, viewCore, STR); CriteriaHelper.pollInstrumentationThread(new PopupShowingCriteria());
|
/**
* Tests that showing a select popup and having the page reload while the popup is showing does
* not assert.
*/
|
Tests that showing a select popup and having the page reload while the popup is showing does not assert
|
testReloadWhilePopupShowing
|
{
"repo_name": "wuhengzhi/chromium-crosswalk",
"path": "content/public/android/javatests/src/org/chromium/content/browser/input/SelectPopupTest.java",
"license": "bsd-3-clause",
"size": 4475
}
|
[
"org.chromium.base.test.util.Feature",
"org.chromium.content.browser.ContentViewCore",
"org.chromium.content.browser.test.util.CriteriaHelper",
"org.chromium.content.browser.test.util.DOMUtils",
"org.chromium.content.browser.test.util.TestCallbackHelperContainer"
] |
import org.chromium.base.test.util.Feature; import org.chromium.content.browser.ContentViewCore; import org.chromium.content.browser.test.util.CriteriaHelper; import org.chromium.content.browser.test.util.DOMUtils; import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
|
import org.chromium.base.test.util.*; import org.chromium.content.browser.*; import org.chromium.content.browser.test.util.*;
|
[
"org.chromium.base",
"org.chromium.content"
] |
org.chromium.base; org.chromium.content;
| 1,972,699
|
protected void setResponseStream(InputStream responseStream) {
this.responseStream = responseStream;
}
|
void function(InputStream responseStream) { this.responseStream = responseStream; }
|
/**
* Sets the response stream.
* @param responseStream The new response stream.
*/
|
Sets the response stream
|
setResponseStream
|
{
"repo_name": "fmassart/commons-httpclient",
"path": "src/java/org/apache/commons/httpclient/HttpMethodBase.java",
"license": "apache-2.0",
"size": 93729
}
|
[
"java.io.InputStream"
] |
import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 39,025
|
public BudgetConstructionHeader getByCandidateKey(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear);
|
BudgetConstructionHeader function(String chartOfAccountsCode, String accountNumber, String subAccountNumber, Integer fiscalYear);
|
/**
* This gets a BudgetConstructionHeader using the candidate key chart, account, subaccount, fiscalyear
*
* @param chartOfAccountsCode
* @param accountNumber
* @param subAccountNumber
* @param fiscalYear
* @return BudgetConstructionHeader
*/
|
This gets a BudgetConstructionHeader using the candidate key chart, account, subaccount, fiscalyear
|
getByCandidateKey
|
{
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/bc/document/dataaccess/BudgetConstructionDao.java",
"license": "apache-2.0",
"size": 8434
}
|
[
"org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader"
] |
import org.kuali.kfs.module.bc.businessobject.BudgetConstructionHeader;
|
import org.kuali.kfs.module.bc.businessobject.*;
|
[
"org.kuali.kfs"
] |
org.kuali.kfs;
| 1,267,136
|
public static final void setupIosTestData(final ServletContext sc) {
final WebApplicationContext wc = getWebRequest(sc);
final String careActorHsa = "app-test-giver";
final TestDataHelper td = new TestDataHelper(sc);
final PatientRepository bean = wc.getBean(PatientRepository.class);
final CareActorRepository careActorRepo = wc.getBean(CareActorRepository.class);
final CareUnitRepository cuRepo = wc.getBean(CareUnitRepository.class);
final ActivityCategoryRepository catRepo = wc.getBean(ActivityCategoryRepository.class);
final ActivityTypeRepository atRepo = wc.getBean(ActivityTypeRepository.class);
final ActivityDefinitionRepository adRepo = wc.getBean(ActivityDefinitionRepository.class);
final HealthPlanRepository hpRepo = wc.getBean(HealthPlanRepository.class);
final HealthPlanService hps = wc.getBean(HealthPlanService.class);
final CountyCouncilRepository ccRepo = wc.getBean(CountyCouncilRepository.class);
final RoleRepository roleRepo = wc.getBean(RoleRepository.class);
if (careActorRepo.findByHsaId(careActorHsa) != null) {
log.info("Test data already setup. Aborting...");
return;
}
final RoleEntity careActorRole = td.newCareActorRole();
final CountyCouncilEntity jkpg = td.newCountyCouncil(CountyCouncil.JONKOPING);
final MeasureUnitEntity mue = td.newMeasureUnit("m", "Meter");
final ActivityCategoryEntity cat = catRepo.save(ActivityCategoryEntity.newEntity("Fysisk aktivitet"));
final CareUnitEntity cu = CareUnitEntity.newEntity("ap-test-unit", jkpg);
cu.setName("Jönköpings vårdcentral");
cuRepo.save(cu);
cuRepo.flush();
ActivityTypeEntity ate = ActivityTypeEntity.newEntity("Löpning", cat, cu, AccessLevel.CAREUNIT);
MeasurementTypeEntity.newEntity(ate, "Distans", MeasurementValueType.SINGLE_VALUE, mue, false, 0);
EstimationTypeEntity.newEntity(ate, "Känsla", "Lätt", "Tufft", 0, 10, 1);
atRepo.save(ate);
atRepo.flush();
final CareActorEntity ca1 = CareActorEntity.newEntity("Test", "Läkare", careActorHsa, cu);
ca1.addRole(careActorRole);
careActorRepo.save(ca1);
careActorRepo.flush();
final PatientEntity p2 = PatientEntity.newEntity("AppDemo", "Patient", "191112121212");
p2.setPhoneNumber("0700000000");
bean.save(p2);
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -30);
HealthPlanEntity hp = HealthPlanEntity.newEntity(ca1, p2, "Auto", cal.getTime(), 6, DurationUnit.MONTH);
hpRepo.save(hp);
Frequency frequency = Frequency.unmarshal("1;1;2,18:15;6,07:00,19:00");
ActivityDefinitionEntity ad = ActivityDefinitionEntity.newEntity(hp, ate, frequency, ca1);
for (ActivityItemDefinitionEntity aid : ad.getActivityItemDefinitions()) {
MeasurementDefinitionEntity md = (MeasurementDefinitionEntity) aid;
if (md.getMeasurementType().getName().equals("Distans")) {
md.setTarget(1200);
}
}
adRepo.save(ad);
hps.scheduleActivities(ad);
}
|
static final void function(final ServletContext sc) { final WebApplicationContext wc = getWebRequest(sc); final String careActorHsa = STR; final TestDataHelper td = new TestDataHelper(sc); final PatientRepository bean = wc.getBean(PatientRepository.class); final CareActorRepository careActorRepo = wc.getBean(CareActorRepository.class); final CareUnitRepository cuRepo = wc.getBean(CareUnitRepository.class); final ActivityCategoryRepository catRepo = wc.getBean(ActivityCategoryRepository.class); final ActivityTypeRepository atRepo = wc.getBean(ActivityTypeRepository.class); final ActivityDefinitionRepository adRepo = wc.getBean(ActivityDefinitionRepository.class); final HealthPlanRepository hpRepo = wc.getBean(HealthPlanRepository.class); final HealthPlanService hps = wc.getBean(HealthPlanService.class); final CountyCouncilRepository ccRepo = wc.getBean(CountyCouncilRepository.class); final RoleRepository roleRepo = wc.getBean(RoleRepository.class); if (careActorRepo.findByHsaId(careActorHsa) != null) { log.info(STR); return; } final RoleEntity careActorRole = td.newCareActorRole(); final CountyCouncilEntity jkpg = td.newCountyCouncil(CountyCouncil.JONKOPING); final MeasureUnitEntity mue = td.newMeasureUnit("m", "Meter"); final ActivityCategoryEntity cat = catRepo.save(ActivityCategoryEntity.newEntity(STR)); final CareUnitEntity cu = CareUnitEntity.newEntity(STR, jkpg); cu.setName(STR); cuRepo.save(cu); cuRepo.flush(); ActivityTypeEntity ate = ActivityTypeEntity.newEntity(STR, cat, cu, AccessLevel.CAREUNIT); MeasurementTypeEntity.newEntity(ate, STR, MeasurementValueType.SINGLE_VALUE, mue, false, 0); EstimationTypeEntity.newEntity(ate, STR, "Lätt", "Tufft", 0, 10, 1); atRepo.save(ate); atRepo.flush(); final CareActorEntity ca1 = CareActorEntity.newEntity("Test", STR, careActorHsa, cu); ca1.addRole(careActorRole); careActorRepo.save(ca1); careActorRepo.flush(); final PatientEntity p2 = PatientEntity.newEntity(STR, STR, STR); p2.setPhoneNumber(STR); bean.save(p2); Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, -30); HealthPlanEntity hp = HealthPlanEntity.newEntity(ca1, p2, "Auto", cal.getTime(), 6, DurationUnit.MONTH); hpRepo.save(hp); Frequency frequency = Frequency.unmarshal(STR); ActivityDefinitionEntity ad = ActivityDefinitionEntity.newEntity(hp, ate, frequency, ca1); for (ActivityItemDefinitionEntity aid : ad.getActivityItemDefinitions()) { MeasurementDefinitionEntity md = (MeasurementDefinitionEntity) aid; if (md.getMeasurementType().getName().equals(STR)) { md.setTarget(1200); } } adRepo.save(ad); hps.scheduleActivities(ad); }
|
/**
* Creates test data for app.store tests (app. approval process).
*
* @param sc
* the servlet context.
*/
|
Creates test data for app.store tests (app. approval process)
|
setupIosTestData
|
{
"repo_name": "MinHalsoplan/netcare-healthplan",
"path": "netcare-web/src/main/java/org/callistasoftware/netcare/web/util/WebUtil.java",
"license": "agpl-3.0",
"size": 19593
}
|
[
"java.util.Calendar",
"javax.servlet.ServletContext",
"org.callistasoftware.netcare.core.repository.ActivityCategoryRepository",
"org.callistasoftware.netcare.core.repository.ActivityDefinitionRepository",
"org.callistasoftware.netcare.core.repository.ActivityTypeRepository",
"org.callistasoftware.netcare.core.repository.CareActorRepository",
"org.callistasoftware.netcare.core.repository.CareUnitRepository",
"org.callistasoftware.netcare.core.repository.CountyCouncilRepository",
"org.callistasoftware.netcare.core.repository.HealthPlanRepository",
"org.callistasoftware.netcare.core.repository.PatientRepository",
"org.callistasoftware.netcare.core.repository.RoleRepository",
"org.callistasoftware.netcare.core.spi.HealthPlanService",
"org.callistasoftware.netcare.model.entity.AccessLevel",
"org.callistasoftware.netcare.model.entity.ActivityCategoryEntity",
"org.callistasoftware.netcare.model.entity.ActivityDefinitionEntity",
"org.callistasoftware.netcare.model.entity.ActivityItemDefinitionEntity",
"org.callistasoftware.netcare.model.entity.ActivityTypeEntity",
"org.callistasoftware.netcare.model.entity.CareActorEntity",
"org.callistasoftware.netcare.model.entity.CareUnitEntity",
"org.callistasoftware.netcare.model.entity.CountyCouncil",
"org.callistasoftware.netcare.model.entity.CountyCouncilEntity",
"org.callistasoftware.netcare.model.entity.DurationUnit",
"org.callistasoftware.netcare.model.entity.EstimationTypeEntity",
"org.callistasoftware.netcare.model.entity.Frequency",
"org.callistasoftware.netcare.model.entity.HealthPlanEntity",
"org.callistasoftware.netcare.model.entity.MeasureUnitEntity",
"org.callistasoftware.netcare.model.entity.MeasurementDefinitionEntity",
"org.callistasoftware.netcare.model.entity.MeasurementTypeEntity",
"org.callistasoftware.netcare.model.entity.MeasurementValueType",
"org.callistasoftware.netcare.model.entity.PatientEntity",
"org.callistasoftware.netcare.model.entity.RoleEntity",
"org.springframework.web.context.WebApplicationContext"
] |
import java.util.Calendar; import javax.servlet.ServletContext; import org.callistasoftware.netcare.core.repository.ActivityCategoryRepository; import org.callistasoftware.netcare.core.repository.ActivityDefinitionRepository; import org.callistasoftware.netcare.core.repository.ActivityTypeRepository; import org.callistasoftware.netcare.core.repository.CareActorRepository; import org.callistasoftware.netcare.core.repository.CareUnitRepository; import org.callistasoftware.netcare.core.repository.CountyCouncilRepository; import org.callistasoftware.netcare.core.repository.HealthPlanRepository; import org.callistasoftware.netcare.core.repository.PatientRepository; import org.callistasoftware.netcare.core.repository.RoleRepository; import org.callistasoftware.netcare.core.spi.HealthPlanService; import org.callistasoftware.netcare.model.entity.AccessLevel; import org.callistasoftware.netcare.model.entity.ActivityCategoryEntity; import org.callistasoftware.netcare.model.entity.ActivityDefinitionEntity; import org.callistasoftware.netcare.model.entity.ActivityItemDefinitionEntity; import org.callistasoftware.netcare.model.entity.ActivityTypeEntity; import org.callistasoftware.netcare.model.entity.CareActorEntity; import org.callistasoftware.netcare.model.entity.CareUnitEntity; import org.callistasoftware.netcare.model.entity.CountyCouncil; import org.callistasoftware.netcare.model.entity.CountyCouncilEntity; import org.callistasoftware.netcare.model.entity.DurationUnit; import org.callistasoftware.netcare.model.entity.EstimationTypeEntity; import org.callistasoftware.netcare.model.entity.Frequency; import org.callistasoftware.netcare.model.entity.HealthPlanEntity; import org.callistasoftware.netcare.model.entity.MeasureUnitEntity; import org.callistasoftware.netcare.model.entity.MeasurementDefinitionEntity; import org.callistasoftware.netcare.model.entity.MeasurementTypeEntity; import org.callistasoftware.netcare.model.entity.MeasurementValueType; import org.callistasoftware.netcare.model.entity.PatientEntity; import org.callistasoftware.netcare.model.entity.RoleEntity; import org.springframework.web.context.WebApplicationContext;
|
import java.util.*; import javax.servlet.*; import org.callistasoftware.netcare.core.repository.*; import org.callistasoftware.netcare.core.spi.*; import org.callistasoftware.netcare.model.entity.*; import org.springframework.web.context.*;
|
[
"java.util",
"javax.servlet",
"org.callistasoftware.netcare",
"org.springframework.web"
] |
java.util; javax.servlet; org.callistasoftware.netcare; org.springframework.web;
| 2,023,888
|
public void setInsets(RectangleInsets insets) {
ParamChecks.nullNotPermitted(insets, "insets");
this.insets = insets;
notifyListeners(new DialLayerChangeEvent(this));
}
|
void function(RectangleInsets insets) { ParamChecks.nullNotPermitted(insets, STR); this.insets = insets; notifyListeners(new DialLayerChangeEvent(this)); }
|
/**
* Sets the insets and sends a {@link DialLayerChangeEvent} to all
* registered listeners.
*
* @param insets the insets (<code>null</code> not permitted).
*
* @see #getInsets()
*/
|
Sets the insets and sends a <code>DialLayerChangeEvent</code> to all registered listeners
|
setInsets
|
{
"repo_name": "aaronc/jfreechart",
"path": "source/org/jfree/chart/plot/dial/DialValueIndicator.java",
"license": "lgpl-2.1",
"size": 22922
}
|
[
"org.jfree.chart.util.ParamChecks",
"org.jfree.ui.RectangleInsets"
] |
import org.jfree.chart.util.ParamChecks; import org.jfree.ui.RectangleInsets;
|
import org.jfree.chart.util.*; import org.jfree.ui.*;
|
[
"org.jfree.chart",
"org.jfree.ui"
] |
org.jfree.chart; org.jfree.ui;
| 686,678
|
public void setGridFacade(GridFacade gridFacade) {
this.gridFacade = gridFacade;
}
|
void function(GridFacade gridFacade) { this.gridFacade = gridFacade; }
|
/**
* Sets the irods grid connector.
*
* @param gridFacade the new irods grid connector
*/
|
Sets the irods grid connector
|
setGridFacade
|
{
"repo_name": "da-nrw/DNSCore",
"path": "ContentBroker/src/main/java/de/uzk/hki/da/core/IntegrityWorker.java",
"license": "gpl-3.0",
"size": 3588
}
|
[
"de.uzk.hki.da.grid.GridFacade"
] |
import de.uzk.hki.da.grid.GridFacade;
|
import de.uzk.hki.da.grid.*;
|
[
"de.uzk.hki"
] |
de.uzk.hki;
| 1,533,936
|
// Declare our filename filter, later passed to File::listFiles
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(final File dir, final String name) {
return shouldAcceptFile(name, prefix, suffix);
}
};
// Get files matching on prefix and suffix
File dir = new File(getContentPath("."));
File[] files = dir.listFiles(filter);
// Check for a null list
if (files == null) {
return names;
}
// Debugging info. Check if we're logging anything so we don't
// traverse the array without needing to.
if (Logger.getLogLevel() > 0) {
Logger.debug("Found " + Integer.toString(files.length) + " files in "
+ "content with prefix " + prefix + " and suffix " + suffix);
for (File f : files) {
Logger.debug(" File: " + f.getName());
}
}
// Copy the names of the files
for (File f : files) {
names.add(f.getName());
}
// Return the list of filenames
return names;
}
|
FilenameFilter filter = new FilenameFilter() { boolean function(final File dir, final String name) { return shouldAcceptFile(name, prefix, suffix); } }; File dir = new File(getContentPath(".")); File[] files = dir.listFiles(filter); if (files == null) { return names; } if (Logger.getLogLevel() > 0) { Logger.debug(STR + Integer.toString(files.length) + STR + STR + prefix + STR + suffix); for (File f : files) { Logger.debug(STR + f.getName()); } } for (File f : files) { names.add(f.getName()); } return names; }
|
/**
* Return whether to accept the file, based on matching the specified
* prefix and suffix.
*
* @param dir the directory path
* @param name the file name
* @return whether to accept the file
*/
|
Return whether to accept the file, based on matching the specified prefix and suffix
|
accept
|
{
"repo_name": "argonium/beetle-cli",
"path": "src/io/miti/beetle/util/Content.java",
"license": "mit",
"size": 16745
}
|
[
"java.io.File",
"java.io.FilenameFilter"
] |
import java.io.File; import java.io.FilenameFilter;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,622,328
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.