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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
@Override
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {
MessageAck info = (MessageAck) o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut);
looseMarshalCachedObject(wireFormat, info.getTransactionId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getConsumerId(), dataOut);
dataOut.writeByte(info.getAckType());
looseMarshalNestedObject(wireFormat, info.getFirstMessageId(), dataOut);
looseMarshalNestedObject(wireFormat, info.getLastMessageId(), dataOut);
dataOut.writeInt(info.getMessageCount());
}
|
void function(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { MessageAck info = (MessageAck) o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut); looseMarshalCachedObject(wireFormat, info.getTransactionId(), dataOut); looseMarshalCachedObject(wireFormat, info.getConsumerId(), dataOut); dataOut.writeByte(info.getAckType()); looseMarshalNestedObject(wireFormat, info.getFirstMessageId(), dataOut); looseMarshalNestedObject(wireFormat, info.getLastMessageId(), dataOut); dataOut.writeInt(info.getMessageCount()); }
|
/**
* Write the booleans that this object uses to a BooleanStream
*/
|
Write the booleans that this object uses to a BooleanStream
|
looseMarshal
|
{
"repo_name": "tabish121/OpenWire",
"path": "openwire-legacy/src/main/java/io/openwire/codec/v4/MessageAckMarshaller.java",
"license": "apache-2.0",
"size": 6372
}
|
[
"io.openwire.codec.OpenWireFormat",
"io.openwire.commands.MessageAck",
"java.io.DataOutput",
"java.io.IOException"
] |
import io.openwire.codec.OpenWireFormat; import io.openwire.commands.MessageAck; import java.io.DataOutput; import java.io.IOException;
|
import io.openwire.codec.*; import io.openwire.commands.*; import java.io.*;
|
[
"io.openwire.codec",
"io.openwire.commands",
"java.io"
] |
io.openwire.codec; io.openwire.commands; java.io;
| 2,278,303
|
public void setChartEngine(JFreeChartPlotEngine engine) {
if (engine == null) {
throw new IllegalArgumentException("engine must not be null!");
}
this.engine = engine;
setPlotConfiguration(engine.getPlotInstance().getMasterPlotConfiguration());
}
|
void function(JFreeChartPlotEngine engine) { if (engine == null) { throw new IllegalArgumentException(STR); } this.engine = engine; setPlotConfiguration(engine.getPlotInstance().getMasterPlotConfiguration()); }
|
/**
* Sets the current {@link JFreeChartPlotEngine} for this dialog.
*
* @param engine
*/
|
Sets the current <code>JFreeChartPlotEngine</code> for this dialog
|
setChartEngine
|
{
"repo_name": "boob-sbcm/3838438",
"path": "src/main/java/com/rapidminer/gui/new_plotter/gui/dialog/ManageParallelLinesDialog.java",
"license": "agpl-3.0",
"size": 17022
}
|
[
"com.rapidminer.gui.new_plotter.engine.jfreechart.JFreeChartPlotEngine"
] |
import com.rapidminer.gui.new_plotter.engine.jfreechart.JFreeChartPlotEngine;
|
import com.rapidminer.gui.new_plotter.engine.jfreechart.*;
|
[
"com.rapidminer.gui"
] |
com.rapidminer.gui;
| 179,141
|
public Calendar getCalendar(String calName) throws SchedulerException {
throw new SchedulerException("Operation not supported for remote schedulers.");
}
|
Calendar function(String calName) throws SchedulerException { throw new SchedulerException(STR); }
|
/**
* <p>
* Calls th0e equivalent method on the 'proxied' <code>QuartzScheduler</code>,
* passing the <code>SchedulingContext</code> associated with this
* instance.
* </p>
*/
|
Calls th0e equivalent method on the 'proxied' <code>QuartzScheduler</code>, passing the <code>SchedulingContext</code> associated with this instance.
|
getCalendar
|
{
"repo_name": "xqiang26/quartz-source-node",
"path": "src/main/java/org/quartz/impl/RemoteMBeanScheduler.java",
"license": "apache-2.0",
"size": 31863
}
|
[
"org.quartz.Calendar",
"org.quartz.SchedulerException"
] |
import org.quartz.Calendar; import org.quartz.SchedulerException;
|
import org.quartz.*;
|
[
"org.quartz"
] |
org.quartz;
| 2,290,763
|
void addRestDefinitions(Collection<RestDefinition> restDefinitions) throws Exception;
/**
* Sets a custom {@link org.apache.camel.spi.RestConfiguration}
|
void addRestDefinitions(Collection<RestDefinition> restDefinitions) throws Exception; /** * Sets a custom {@link org.apache.camel.spi.RestConfiguration}
|
/**
* Adds a collection of rest definitions to the context
*
* @param restDefinitions the rest(s) definition to add
*/
|
Adds a collection of rest definitions to the context
|
addRestDefinitions
|
{
"repo_name": "tlehoux/camel",
"path": "camel-core/src/main/java/org/apache/camel/CamelContext.java",
"license": "apache-2.0",
"size": 77596
}
|
[
"java.util.Collection",
"org.apache.camel.model.rest.RestDefinition",
"org.apache.camel.spi.RestConfiguration"
] |
import java.util.Collection; import org.apache.camel.model.rest.RestDefinition; import org.apache.camel.spi.RestConfiguration;
|
import java.util.*; import org.apache.camel.model.rest.*; import org.apache.camel.spi.*;
|
[
"java.util",
"org.apache.camel"
] |
java.util; org.apache.camel;
| 1,646,495
|
public Iterator<Variable> getReferencedClassVariablesIterator() {
return getReferencedClassVariables().values().iterator();
}
|
Iterator<Variable> function() { return getReferencedClassVariables().values().iterator(); }
|
/**
* Gets an iterator for the referenced class variables. The
* remove operation is not supported.
* @return an iterator for the referenced class variables
*/
|
Gets an iterator for the referenced class variables. The remove operation is not supported
|
getReferencedClassVariablesIterator
|
{
"repo_name": "Selventa/model-builder",
"path": "tools/groovy/src/src/main/org/codehaus/groovy/ast/VariableScope.java",
"license": "apache-2.0",
"size": 6080
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,324,413
|
public static void setLogLevel(String logLevel) {
if ("VERBOSE".equals(logLevel)) LOGLEVEL = VERBOSE;
else if ("DEBUG".equals(logLevel)) LOGLEVEL = DEBUG;
else if ("INFO".equals(logLevel)) LOGLEVEL = INFO;
else if ("WARN".equals(logLevel)) LOGLEVEL = WARN;
else if ("ERROR".equals(logLevel)) LOGLEVEL = ERROR;
Log.i("CordovaLog", "Changing log level to " + logLevel + "(" + LOGLEVEL + ")");
}
|
static void function(String logLevel) { if (STR.equals(logLevel)) LOGLEVEL = VERBOSE; else if ("DEBUG".equals(logLevel)) LOGLEVEL = DEBUG; else if ("INFO".equals(logLevel)) LOGLEVEL = INFO; else if ("WARN".equals(logLevel)) LOGLEVEL = WARN; else if ("ERROR".equals(logLevel)) LOGLEVEL = ERROR; Log.i(STR, STR + logLevel + "(" + LOGLEVEL + ")"); }
|
/**
* Set the current log level.
*
* @param logLevel
*/
|
Set the current log level
|
setLogLevel
|
{
"repo_name": "wufan123/cordova-plugin-push",
"path": "src/android/LOG.java",
"license": "apache-2.0",
"size": 5891
}
|
[
"android.util.Log"
] |
import android.util.Log;
|
import android.util.*;
|
[
"android.util"
] |
android.util;
| 181,889
|
private static int calculateHeadersSize(HttpMethodBase httpMethod) {
int headerSize = httpMethod.getStatusLine().toString().length()+2; // add a \r\n
Header[] rh = httpMethod.getResponseHeaders();
for (int i = 0; i < rh.length; i++) {
headerSize += rh[i].toString().length(); // already include the \r\n
}
headerSize += 2; // last \r\n before response data
return headerSize;
}
|
static int function(HttpMethodBase httpMethod) { int headerSize = httpMethod.getStatusLine().toString().length()+2; Header[] rh = httpMethod.getResponseHeaders(); for (int i = 0; i < rh.length; i++) { headerSize += rh[i].toString().length(); } headerSize += 2; return headerSize; }
|
/**
* Calculate response headers size
*
* @return the size response headers (in bytes)
*/
|
Calculate response headers size
|
calculateHeadersSize
|
{
"repo_name": "ThiagoGarciaAlves/jmeter",
"path": "src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC3Impl.java",
"license": "apache-2.0",
"size": 52270
}
|
[
"org.apache.commons.httpclient.Header",
"org.apache.commons.httpclient.HttpMethodBase"
] |
import org.apache.commons.httpclient.Header; import org.apache.commons.httpclient.HttpMethodBase;
|
import org.apache.commons.httpclient.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 2,642,099
|
public static ItemFolder[] mergeArray(ItemFolder[] i,
ItemFolder[] o,
ItemFolder[] d,
ItemFolder[] s,
ItemFolder[] t) {
ItemFolder[] itemFolder;
int length = 0;
int ilength = 0;
int olength = 0;
int dlength = 0;
int slength = 0;
int tlength = 0;
if (i != null) {
ilength = i.length;
length = ilength;
}
if (o != null) {
olength = o.length;
length = length + olength;
}
if (d != null) {
dlength = d.length;
length = length + dlength;
}
if (s != null) {
slength = s.length;
length = length + slength;
}
if (t != null) {
tlength = t.length;
length = length + tlength;
}
itemFolder = new ItemFolder[length];
int yi, yo, yd, ys, yt;
for (yi = 0; yi < ilength; yi++) {
itemFolder[yi] = i[yi];
}
for (yo = 0; yo < olength; yo++) {
itemFolder[yi + yo] = o[yo];
}
for (yd = 0; yd < dlength; yd++) {
itemFolder[yi + yo + yd] = d[yd];
}
for (ys = 0; ys < slength; ys++) {
itemFolder[yi + yo + yd + ys] = s[ys];
}
for (yt = 0; yt < tlength; yt++) {
itemFolder[yi + yo + yd + ys + yt] = t[yt];
}
return itemFolder;
}
|
static ItemFolder[] function(ItemFolder[] i, ItemFolder[] o, ItemFolder[] d, ItemFolder[] s, ItemFolder[] t) { ItemFolder[] itemFolder; int length = 0; int ilength = 0; int olength = 0; int dlength = 0; int slength = 0; int tlength = 0; if (i != null) { ilength = i.length; length = ilength; } if (o != null) { olength = o.length; length = length + olength; } if (d != null) { dlength = d.length; length = length + dlength; } if (s != null) { slength = s.length; length = length + slength; } if (t != null) { tlength = t.length; length = length + tlength; } itemFolder = new ItemFolder[length]; int yi, yo, yd, ys, yt; for (yi = 0; yi < ilength; yi++) { itemFolder[yi] = i[yi]; } for (yo = 0; yo < olength; yo++) { itemFolder[yi + yo] = o[yo]; } for (yd = 0; yd < dlength; yd++) { itemFolder[yi + yo + yd] = d[yd]; } for (ys = 0; ys < slength; ys++) { itemFolder[yi + yo + yd + ys] = s[ys]; } for (yt = 0; yt < tlength; yt++) { itemFolder[yi + yo + yd + ys + yt] = t[yt]; } return itemFolder; }
|
/**
* merge arrays
*
* @param i CrcSyncItemInfo[]
* @param o CrcSyncItemInfo[]
* @param d CrcSyncItemInfo[]
* @param s CrcSyncItemInfo[]
* @param t CrcSyncItemInfo[]
* @return CrcSyncItemInfo[]
*/
|
merge arrays
|
mergeArray
|
{
"repo_name": "accesstest3/cfunambol",
"path": "modules/email/email-core/src/main/java/com/funambol/email/util/Utility.java",
"license": "agpl-3.0",
"size": 53607
}
|
[
"com.funambol.email.model.ItemFolder"
] |
import com.funambol.email.model.ItemFolder;
|
import com.funambol.email.model.*;
|
[
"com.funambol.email"
] |
com.funambol.email;
| 1,496,447
|
static int hashCodeAsciiSafe(byte[] bytes, int startPos, int length) {
int hash = HASH_CODE_ASCII_SEED;
final int remainingBytes = length & 7;
final int end = startPos + remainingBytes;
for (int i = startPos - 8 + length; i >= end; i -= 8) {
hash = PlatformDependent0.hashCodeAsciiCompute(getLongSafe(bytes, i), hash);
}
switch(remainingBytes) {
case 7:
return ((hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1)))
* HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 3));
case 6:
return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos)))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 2));
case 5:
return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 1));
case 4:
return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos));
case 3:
return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]))
* HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1));
case 2:
return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos));
case 1:
return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]);
default:
return hash;
}
}
|
static int hashCodeAsciiSafe(byte[] bytes, int startPos, int length) { int hash = HASH_CODE_ASCII_SEED; final int remainingBytes = length & 7; final int end = startPos + remainingBytes; for (int i = startPos - 8 + length; i >= end; i -= 8) { hash = PlatformDependent0.hashCodeAsciiCompute(getLongSafe(bytes, i), hash); } switch(remainingBytes) { case 7: return ((hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos])) * HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1))) * HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 3)); case 6: return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos))) * HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 2)); case 5: return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos])) * HASH_CODE_C2 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos + 1)); case 4: return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getIntSafe(bytes, startPos)); case 3: return (hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos])) * HASH_CODE_C2 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos + 1)); case 2: return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(getShortSafe(bytes, startPos)); case 1: return hash * HASH_CODE_C1 + hashCodeAsciiSanitize(bytes[startPos]); default: return hash; } }
|
/**
* Package private for testing purposes only!
*/
|
Package private for testing purposes only
|
hashCodeAsciiSafe
|
{
"repo_name": "artgon/netty",
"path": "common/src/main/java/io/netty/util/internal/PlatformDependent.java",
"license": "apache-2.0",
"size": 59109
}
|
[
"io.netty.util.internal.PlatformDependent0"
] |
import io.netty.util.internal.PlatformDependent0;
|
import io.netty.util.internal.*;
|
[
"io.netty.util"
] |
io.netty.util;
| 2,811,890
|
protected void iterateProxy( final IndentationCounter counter, final Element parent, final Collection list )
{
final boolean shouldExist = ( list != null ) && ( list.size() > 0 );
final Element element = updateElement( counter, parent, "proxies", shouldExist );
if ( shouldExist )
{
final Iterator it = list.iterator();
Iterator elIt = element.getChildren( "proxy", element.getNamespace() ).iterator();
if ( !elIt.hasNext() )
{
elIt = null;
}
final IndentationCounter innerCount = new IndentationCounter( counter.getDepth() + 1 );
while ( it.hasNext() )
{
final Proxy value = (Proxy) it.next();
Element el;
if ( elIt != null && elIt.hasNext() )
{
el = (Element) elIt.next();
if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
el = factory.element( "proxy", element.getNamespace() );
insertAtPreferredLocation( element, el, innerCount );
}
updateProxy( value, innerCount, el );
innerCount.increaseCount();
}
if ( elIt != null )
{
while ( elIt.hasNext() )
{
elIt.next();
elIt.remove();
}
}
}
} // -- void iterateProxy( Counter, Element, java.util.Collection, java.lang.String, java.lang.String )
|
void function( final IndentationCounter counter, final Element parent, final Collection list ) { final boolean shouldExist = ( list != null ) && ( list.size() > 0 ); final Element element = updateElement( counter, parent, STR, shouldExist ); if ( shouldExist ) { final Iterator it = list.iterator(); Iterator elIt = element.getChildren( "proxy", element.getNamespace() ).iterator(); if ( !elIt.hasNext() ) { elIt = null; } final IndentationCounter innerCount = new IndentationCounter( counter.getDepth() + 1 ); while ( it.hasNext() ) { final Proxy value = (Proxy) it.next(); Element el; if ( elIt != null && elIt.hasNext() ) { el = (Element) elIt.next(); if ( !elIt.hasNext() ) { elIt = null; } } else { el = factory.element( "proxy", element.getNamespace() ); insertAtPreferredLocation( element, el, innerCount ); } updateProxy( value, innerCount, el ); innerCount.increaseCount(); } if ( elIt != null ) { while ( elIt.hasNext() ) { elIt.next(); elIt.remove(); } } } }
|
/**
* Method iterateProxy.
* @param counter
* @param parent
* @param list
*/
|
Method iterateProxy
|
iterateProxy
|
{
"repo_name": "release-engineering/pom-manipulation-ext",
"path": "common/src/main/java/org/commonjava/maven/ext/common/jdom/JDOMSettingsConverter.java",
"license": "apache-2.0",
"size": 27626
}
|
[
"java.util.Collection",
"java.util.Iterator",
"org.apache.maven.settings.Proxy",
"org.commonjava.maven.ext.common.jdom.Utils",
"org.jdom2.Element"
] |
import java.util.Collection; import java.util.Iterator; import org.apache.maven.settings.Proxy; import org.commonjava.maven.ext.common.jdom.Utils; import org.jdom2.Element;
|
import java.util.*; import org.apache.maven.settings.*; import org.commonjava.maven.ext.common.jdom.*; import org.jdom2.*;
|
[
"java.util",
"org.apache.maven",
"org.commonjava.maven",
"org.jdom2"
] |
java.util; org.apache.maven; org.commonjava.maven; org.jdom2;
| 235,543
|
static ContentResponse executeHttpPost(HttpClient httpClient, String url, String resource, JsonElement parameters,
@Nullable String sessionId) throws InterruptedException, TimeoutException, ExecutionException {
Request response = httpClient.newRequest(String.format("%s/%s%s", url, WEB_API, resource), 80).scheme("http")
.agent("Jetty HTTP client").version(HttpVersion.HTTP_1_1).method(HttpMethod.POST)
.header(HttpHeader.ACCEPT, "application/json").header(HttpHeader.CONTENT_TYPE, "application/json")
.timeout(5, TimeUnit.SECONDS);
response.content(new StringContentProvider(parameters.toString()));
if (sessionId != null) {
response.header(HttpHeader.AUTHORIZATION, String.format("Session %s", sessionId));
}
return response.send();
}
|
static ContentResponse executeHttpPost(HttpClient httpClient, String url, String resource, JsonElement parameters, @Nullable String sessionId) throws InterruptedException, TimeoutException, ExecutionException { Request response = httpClient.newRequest(String.format(STR, url, WEB_API, resource), 80).scheme("http") .agent(STR).version(HttpVersion.HTTP_1_1).method(HttpMethod.POST) .header(HttpHeader.ACCEPT, STR).header(HttpHeader.CONTENT_TYPE, STR) .timeout(5, TimeUnit.SECONDS); response.content(new StringContentProvider(parameters.toString())); if (sessionId != null) { response.header(HttpHeader.AUTHORIZATION, String.format(STR, sessionId)); } return response.send(); }
|
/**
* Helper function to execute a HTTP post request
*
* @param httpClient httpClient to use for communication
* @param url IP or hostname or the device
* @param resource web API resource to post to
* @param sessionId optional session ID
* @param parameters the JSON content to post
* @return the HTTP response for the created post request
* @throws ExecutionException Error during the execution of the http request
* @throws TimeoutException Connection timed out
* @throws InterruptedException Connection interrupted
*/
|
Helper function to execute a HTTP post request
|
executeHttpPost
|
{
"repo_name": "openhab/openhab2",
"path": "bundles/org.openhab.binding.kostalinverter/src/main/java/org/openhab/binding/internal/kostal/inverter/thirdgeneration/ThirdGenerationHttpHelper.java",
"license": "epl-1.0",
"size": 6865
}
|
[
"com.google.gson.JsonElement",
"java.util.concurrent.ExecutionException",
"java.util.concurrent.TimeUnit",
"java.util.concurrent.TimeoutException",
"org.eclipse.jdt.annotation.Nullable",
"org.eclipse.jetty.client.HttpClient",
"org.eclipse.jetty.client.api.ContentResponse",
"org.eclipse.jetty.client.api.Request",
"org.eclipse.jetty.client.util.StringContentProvider",
"org.eclipse.jetty.http.HttpHeader",
"org.eclipse.jetty.http.HttpMethod",
"org.eclipse.jetty.http.HttpVersion"
] |
import com.google.gson.JsonElement; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.client.util.StringContentProvider; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpVersion;
|
import com.google.gson.*; import java.util.concurrent.*; import org.eclipse.jdt.annotation.*; import org.eclipse.jetty.client.*; import org.eclipse.jetty.client.api.*; import org.eclipse.jetty.client.util.*; import org.eclipse.jetty.http.*;
|
[
"com.google.gson",
"java.util",
"org.eclipse.jdt",
"org.eclipse.jetty"
] |
com.google.gson; java.util; org.eclipse.jdt; org.eclipse.jetty;
| 10,871
|
public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) {
return false;
}
|
boolean function(TWSDLParserContext context, TWSDLExtensible parent, Element e) { return false; }
|
/**
* Callback for <code>wsdl:service</code>
*
* @param context Parser context that will be passed on by the wsdl parser
* @param parent The Parent element within which the extensibility element is defined
* @param e The extensibility elemenet
* @return false if there was some error during the extension handling otherwise returns true. If returned false
* then the WSDL parser can abort if the wsdl extensibility element had <code>required</code> attribute set to true
*/
|
Callback for <code>wsdl:service</code>
|
handleServiceExtension
|
{
"repo_name": "axDev-JDK/jaxws",
"path": "src/share/jaxws_classes/com/sun/tools/internal/ws/api/wsdl/TWSDLExtensionHandler.java",
"license": "gpl-2.0",
"size": 10984
}
|
[
"org.w3c.dom.Element"
] |
import org.w3c.dom.Element;
|
import org.w3c.dom.*;
|
[
"org.w3c.dom"
] |
org.w3c.dom;
| 1,563,294
|
public final Provider getProvider() {
return provider;
}
|
final Provider function() { return provider; }
|
/**
* Returns the {@code Provider} of the certificate factory represented by
* the certificate.
*
* @return the provider of this certificate factory.
*/
|
Returns the Provider of the certificate factory represented by the certificate
|
getProvider
|
{
"repo_name": "JSDemos/android-sdk-20",
"path": "src/java/security/cert/CertificateFactory.java",
"license": "apache-2.0",
"size": 11321
}
|
[
"java.security.Provider"
] |
import java.security.Provider;
|
import java.security.*;
|
[
"java.security"
] |
java.security;
| 2,792,523
|
public DateTime creationTime() {
return this.creationTime;
}
|
DateTime function() { return this.creationTime; }
|
/**
* Get the creationTime value.
*
* @return the creationTime value
*/
|
Get the creationTime value
|
creationTime
|
{
"repo_name": "hovsepm/azure-sdk-for-java",
"path": "batchai/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/batchai/v2018_03_01/implementation/FileServerInner.java",
"license": "mit",
"size": 5881
}
|
[
"org.joda.time.DateTime"
] |
import org.joda.time.DateTime;
|
import org.joda.time.*;
|
[
"org.joda.time"
] |
org.joda.time;
| 876,099
|
@SuppressWarnings("unchecked")
public static <T> ProxyAndInfo<T> createNonHAProxy(
Configuration conf, InetSocketAddress nnAddr, Class<T> xface,
UserGroupInformation ugi, boolean withRetries,
AtomicBoolean fallbackToSimpleAuth) throws IOException {
Text dtService = SecurityUtil.buildTokenService(nnAddr);
T proxy;
if (xface == ClientProtocol.class) {
proxy = (T) createNNProxyWithClientProtocol(nnAddr, conf, ugi,
withRetries, fallbackToSimpleAuth);
} else if (xface == JournalProtocol.class) {
proxy = (T) createNNProxyWithJournalProtocol(nnAddr, conf, ugi);
} else if (xface == NamenodeProtocol.class) {
proxy = (T) createNNProxyWithNamenodeProtocol(nnAddr, conf, ugi,
withRetries);
} else if (xface == GetUserMappingsProtocol.class) {
proxy = (T) createNNProxyWithGetUserMappingsProtocol(nnAddr, conf, ugi);
} else if (xface == RefreshUserMappingsProtocol.class) {
proxy = (T) createNNProxyWithRefreshUserMappingsProtocol(nnAddr, conf, ugi);
} else if (xface == RefreshAuthorizationPolicyProtocol.class) {
proxy = (T) createNNProxyWithRefreshAuthorizationPolicyProtocol(nnAddr,
conf, ugi);
} else if (xface == RefreshCallQueueProtocol.class) {
proxy = (T) createNNProxyWithRefreshCallQueueProtocol(nnAddr, conf, ugi);
} else {
String message = "Unsupported protocol found when creating the proxy " +
"connection to NameNode: " +
((xface != null) ? xface.getClass().getName() : "null");
LOG.error(message);
throw new IllegalStateException(message);
}
return new ProxyAndInfo<T>(proxy, dtService, nnAddr);
}
|
@SuppressWarnings(STR) static <T> ProxyAndInfo<T> function( Configuration conf, InetSocketAddress nnAddr, Class<T> xface, UserGroupInformation ugi, boolean withRetries, AtomicBoolean fallbackToSimpleAuth) throws IOException { Text dtService = SecurityUtil.buildTokenService(nnAddr); T proxy; if (xface == ClientProtocol.class) { proxy = (T) createNNProxyWithClientProtocol(nnAddr, conf, ugi, withRetries, fallbackToSimpleAuth); } else if (xface == JournalProtocol.class) { proxy = (T) createNNProxyWithJournalProtocol(nnAddr, conf, ugi); } else if (xface == NamenodeProtocol.class) { proxy = (T) createNNProxyWithNamenodeProtocol(nnAddr, conf, ugi, withRetries); } else if (xface == GetUserMappingsProtocol.class) { proxy = (T) createNNProxyWithGetUserMappingsProtocol(nnAddr, conf, ugi); } else if (xface == RefreshUserMappingsProtocol.class) { proxy = (T) createNNProxyWithRefreshUserMappingsProtocol(nnAddr, conf, ugi); } else if (xface == RefreshAuthorizationPolicyProtocol.class) { proxy = (T) createNNProxyWithRefreshAuthorizationPolicyProtocol(nnAddr, conf, ugi); } else if (xface == RefreshCallQueueProtocol.class) { proxy = (T) createNNProxyWithRefreshCallQueueProtocol(nnAddr, conf, ugi); } else { String message = STR + STR + ((xface != null) ? xface.getClass().getName() : "null"); LOG.error(message); throw new IllegalStateException(message); } return new ProxyAndInfo<T>(proxy, dtService, nnAddr); }
|
/**
* Creates an explicitly non-HA-enabled proxy object. Most of the time you
* don't want to use this, and should instead use {@link NameNodeProxies#createProxy}.
*
* @param conf the configuration object
* @param nnAddr address of the remote NN to connect to
* @param xface the IPC interface which should be created
* @param ugi the user who is making the calls on the proxy object
* @param withRetries certain interfaces have a non-standard retry policy
* @param fallbackToSimpleAuth - set to true or false during this method to
* indicate if a secure client falls back to simple auth
* @return an object containing both the proxy and the associated
* delegation token service it corresponds to
* @throws IOException
*/
|
Creates an explicitly non-HA-enabled proxy object. Most of the time you don't want to use this, and should instead use <code>NameNodeProxies#createProxy</code>
|
createNonHAProxy
|
{
"repo_name": "DislabNJU/Hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/NameNodeProxies.java",
"license": "apache-2.0",
"size": 25945
}
|
[
"java.io.IOException",
"java.net.InetSocketAddress",
"java.util.concurrent.atomic.AtomicBoolean",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hdfs.protocol.ClientProtocol",
"org.apache.hadoop.hdfs.server.protocol.JournalProtocol",
"org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol",
"org.apache.hadoop.io.Text",
"org.apache.hadoop.ipc.RefreshCallQueueProtocol",
"org.apache.hadoop.security.RefreshUserMappingsProtocol",
"org.apache.hadoop.security.SecurityUtil",
"org.apache.hadoop.security.UserGroupInformation",
"org.apache.hadoop.security.authorize.RefreshAuthorizationPolicyProtocol",
"org.apache.hadoop.tools.GetUserMappingsProtocol"
] |
import java.io.IOException; import java.net.InetSocketAddress; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.protocol.ClientProtocol; import org.apache.hadoop.hdfs.server.protocol.JournalProtocol; import org.apache.hadoop.hdfs.server.protocol.NamenodeProtocol; import org.apache.hadoop.io.Text; import org.apache.hadoop.ipc.RefreshCallQueueProtocol; import org.apache.hadoop.security.RefreshUserMappingsProtocol; import org.apache.hadoop.security.SecurityUtil; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.security.authorize.RefreshAuthorizationPolicyProtocol; import org.apache.hadoop.tools.GetUserMappingsProtocol;
|
import java.io.*; import java.net.*; import java.util.concurrent.atomic.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.protocol.*; import org.apache.hadoop.io.*; import org.apache.hadoop.ipc.*; import org.apache.hadoop.security.*; import org.apache.hadoop.security.authorize.*; import org.apache.hadoop.tools.*;
|
[
"java.io",
"java.net",
"java.util",
"org.apache.hadoop"
] |
java.io; java.net; java.util; org.apache.hadoop;
| 2,731,719
|
@Test
public final void testRenderListHead()
{
ListHead head = new ListHead();
Object header;
m_renderer.renderListHead(head);
assertEquals(2, head.getChildren().size());
header = head.getChildren().get(1);
assertTrue(header instanceof ListHeader);
assertEquals("Age", ((ListHeader)header).getLabel());
}
|
final void function() { ListHead head = new ListHead(); Object header; m_renderer.renderListHead(head); assertEquals(2, head.getChildren().size()); header = head.getChildren().get(1); assertTrue(header instanceof ListHeader); assertEquals("Age", ((ListHeader)header).getLabel()); }
|
/**
* Test method for {@link org.adempiere.webui.component.WListItemRenderer#renderListHead(org.adempiere.webui.component.ListHead)}.
*/
|
Test method for <code>org.adempiere.webui.component.WListItemRenderer#renderListHead(org.adempiere.webui.component.ListHead)</code>
|
testRenderListHead
|
{
"repo_name": "erpcya/adempierePOS",
"path": "zkwebui/WEB-INF/src/org/adempiere/webui/component/test/WListItemRendererTest.java",
"license": "gpl-2.0",
"size": 6510
}
|
[
"org.adempiere.webui.component.ListHead",
"org.adempiere.webui.component.ListHeader",
"org.junit.Assert"
] |
import org.adempiere.webui.component.ListHead; import org.adempiere.webui.component.ListHeader; import org.junit.Assert;
|
import org.adempiere.webui.component.*; import org.junit.*;
|
[
"org.adempiere.webui",
"org.junit"
] |
org.adempiere.webui; org.junit;
| 242,846
|
public String[] queryNodeStatAssignUsers(UUID templateId, UUID statId){
Set<UUID> roleIdSet = new HashSet<UUID>();
Action[] actionArray = this.queryStatActions(statId);
for(Action action : actionArray){
Role[] roleArray = this.queryActionRoles(action.getId());
for(Role role : roleArray){
roleIdSet.add(role.getId());
}
}
Set<String> userSet = new HashSet<String>();
for(Right right : this.rightSet){
if(right.templateId.equals(templateId) && roleIdSet.contains(right.roleId)){
userSet.add(right.username);
}
}
String[] allUser = userSet.toArray(new String[userSet.size()]);
Arrays.sort(allUser);
return allUser;
}
|
String[] function(UUID templateId, UUID statId){ Set<UUID> roleIdSet = new HashSet<UUID>(); Action[] actionArray = this.queryStatActions(statId); for(Action action : actionArray){ Role[] roleArray = this.queryActionRoles(action.getId()); for(Role role : roleArray){ roleIdSet.add(role.getId()); } } Set<String> userSet = new HashSet<String>(); for(Right right : this.rightSet){ if(right.templateId.equals(templateId) && roleIdSet.contains(right.roleId)){ userSet.add(right.username); } } String[] allUser = userSet.toArray(new String[userSet.size()]); Arrays.sort(allUser); return allUser; }
|
/**
* (non-Javadoc)
* <p> Title:queryNodeStatAssignUsers</p>
* <p> Description:TODO</p>
* @param templateId
* @param statId
* @return
* @see com.sogou.qadev.service.cynthia.bean.Flow#queryNodeStatAssignUsers(com.sogou.qadev.service.cynthia.bean.UUID, com.sogou.qadev.service.cynthia.bean.UUID)
*/
|
(non-Javadoc) Title:queryNodeStatAssignUsers Description:TODO
|
queryNodeStatAssignUsers
|
{
"repo_name": "yioye/Cynthia",
"path": "src/main/java/com/sogou/qadev/service/cynthia/bean/impl/FlowImpl.java",
"license": "gpl-2.0",
"size": 46682
}
|
[
"com.sogou.qadev.service.cynthia.bean.Action",
"com.sogou.qadev.service.cynthia.bean.Right",
"com.sogou.qadev.service.cynthia.bean.Role",
"java.util.Arrays",
"java.util.HashSet",
"java.util.Set"
] |
import com.sogou.qadev.service.cynthia.bean.Action; import com.sogou.qadev.service.cynthia.bean.Right; import com.sogou.qadev.service.cynthia.bean.Role; import java.util.Arrays; import java.util.HashSet; import java.util.Set;
|
import com.sogou.qadev.service.cynthia.bean.*; import java.util.*;
|
[
"com.sogou.qadev",
"java.util"
] |
com.sogou.qadev; java.util;
| 142,545
|
@Override
public Map<K, ICacheElement<K, V>> processGetMultiple( String cacheName, Set<K> keys, long requesterId )
throws IOException
{
CompositeCache<K, V> cache = getCacheManager().getCache( cacheName );
boolean keepLocal = !remoteHttpCacheServerAttributes.isAllowClusterGet();
if ( keepLocal )
{
return cache.localGetMultiple( keys );
}
else
{
return cache.getMultiple( keys );
}
}
|
Map<K, ICacheElement<K, V>> function( String cacheName, Set<K> keys, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isAllowClusterGet(); if ( keepLocal ) { return cache.localGetMultiple( keys ); } else { return cache.getMultiple( keys ); } }
|
/**
* Processes a get request.
* <p>
* If isAllowClusterGet is enabled we will treat this as a normal request of non-remote
* origination.
* <p>
* @param cacheName
* @param keys
* @param requesterId
* @return Map
* @throws IOException
*/
|
Processes a get request. If isAllowClusterGet is enabled we will treat this as a normal request of non-remote origination.
|
processGetMultiple
|
{
"repo_name": "tikue/jcs2-snapshot",
"path": "src/java/org/apache/commons/jcs/auxiliary/remote/http/server/RemoteHttpCacheService.java",
"license": "apache-2.0",
"size": 8106
}
|
[
"java.io.IOException",
"java.util.Map",
"java.util.Set",
"org.apache.commons.jcs.engine.behavior.ICacheElement",
"org.apache.commons.jcs.engine.control.CompositeCache"
] |
import java.io.IOException; import java.util.Map; import java.util.Set; import org.apache.commons.jcs.engine.behavior.ICacheElement; import org.apache.commons.jcs.engine.control.CompositeCache;
|
import java.io.*; import java.util.*; import org.apache.commons.jcs.engine.behavior.*; import org.apache.commons.jcs.engine.control.*;
|
[
"java.io",
"java.util",
"org.apache.commons"
] |
java.io; java.util; org.apache.commons;
| 2,319,604
|
public void installUI(JComponent a) {
for (int i = 0; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).installUI(a);
}
}
|
void function(JComponent a) { for (int i = 0; i < uis.size(); i++) { ((ComponentUI) (uis.elementAt(i))).installUI(a); } }
|
/**
* Invokes the <code>installUI</code> method on each UI handled by this object.
*/
|
Invokes the <code>installUI</code> method on each UI handled by this object
|
installUI
|
{
"repo_name": "rokn/Count_Words_2015",
"path": "testing/openjdk2/jdk/src/share/classes/javax/swing/plaf/multi/MultiFileChooserUI.java",
"license": "mit",
"size": 10478
}
|
[
"javax.swing.JComponent",
"javax.swing.plaf.ComponentUI"
] |
import javax.swing.JComponent; import javax.swing.plaf.ComponentUI;
|
import javax.swing.*; import javax.swing.plaf.*;
|
[
"javax.swing"
] |
javax.swing;
| 2,263,270
|
public void addBootstrapViews(List<Properties> bootstrapViews)
{
if (this.extensionBootstrapViews == null)
{
this.extensionBootstrapViews = new ArrayList<Properties>();
}
this.extensionBootstrapViews.addAll(bootstrapViews);
}
|
void function(List<Properties> bootstrapViews) { if (this.extensionBootstrapViews == null) { this.extensionBootstrapViews = new ArrayList<Properties>(); } this.extensionBootstrapViews.addAll(bootstrapViews); }
|
/**
* Sets the bootstrap views
*
*/
|
Sets the bootstrap views
|
addBootstrapViews
|
{
"repo_name": "Alfresco/alfresco-repository",
"path": "src/main/java/org/alfresco/repo/importer/ImporterBootstrap.java",
"license": "lgpl-3.0",
"size": 24087
}
|
[
"java.util.ArrayList",
"java.util.List",
"java.util.Properties"
] |
import java.util.ArrayList; import java.util.List; import java.util.Properties;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,816,677
|
public void addWaypoints(List<Coord2D> points){
final Altitude alt = mMission.getLastAltitude();
final List<MissionItem> missionItemsToAdd = new ArrayList<MissionItem>(points.size());
for(Coord2D point: points){
Waypoint waypoint = new Waypoint(mMission, new Coord3D(point, alt));
mMissionItems.add(new MissionItemRender(this, waypoint));
missionItemsToAdd.add(waypoint);
}
mMission.addWaypoints(missionItemsToAdd);
}
|
void function(List<Coord2D> points){ final Altitude alt = mMission.getLastAltitude(); final List<MissionItem> missionItemsToAdd = new ArrayList<MissionItem>(points.size()); for(Coord2D point: points){ Waypoint waypoint = new Waypoint(mMission, new Coord3D(point, alt)); mMissionItems.add(new MissionItemRender(this, waypoint)); missionItemsToAdd.add(waypoint); } mMission.addWaypoints(missionItemsToAdd); }
|
/**
* Add a set of waypoints generated around the passed 2D points.
* TODO: replace Coord2D with library's classes such as android.graphics.Point
* @param points list of points used to generate the mission waypoints
*/
|
Add a set of waypoints generated around the passed 2D points
|
addWaypoints
|
{
"repo_name": "0359xiaodong/droidplanner",
"path": "Android/src/org/droidplanner/android/mission/MissionRender.java",
"license": "gpl-3.0",
"size": 11513
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.droidplanner.android.mission.item.MissionItemRender",
"org.droidplanner.core.helpers.coordinates.Coord2D",
"org.droidplanner.core.helpers.coordinates.Coord3D",
"org.droidplanner.core.helpers.units.Altitude",
"org.droidplanner.core.mission.MissionItem",
"org.droidplanner.core.mission.waypoints.Waypoint"
] |
import java.util.ArrayList; import java.util.List; import org.droidplanner.android.mission.item.MissionItemRender; import org.droidplanner.core.helpers.coordinates.Coord2D; import org.droidplanner.core.helpers.coordinates.Coord3D; import org.droidplanner.core.helpers.units.Altitude; import org.droidplanner.core.mission.MissionItem; import org.droidplanner.core.mission.waypoints.Waypoint;
|
import java.util.*; import org.droidplanner.android.mission.item.*; import org.droidplanner.core.helpers.coordinates.*; import org.droidplanner.core.helpers.units.*; import org.droidplanner.core.mission.*; import org.droidplanner.core.mission.waypoints.*;
|
[
"java.util",
"org.droidplanner.android",
"org.droidplanner.core"
] |
java.util; org.droidplanner.android; org.droidplanner.core;
| 2,140,799
|
EAttribute getConstructor_Json();
|
EAttribute getConstructor_Json();
|
/**
* Returns the meta object for the attribute '{@link net.blimster.gwt.threejs.wdl.threeJsWrapperDescriptionLanguage.Constructor#isJson <em>Json</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Json</em>'.
* @see net.blimster.gwt.threejs.wdl.threeJsWrapperDescriptionLanguage.Constructor#isJson()
* @see #getConstructor()
* @generated
*/
|
Returns the meta object for the attribute '<code>net.blimster.gwt.threejs.wdl.threeJsWrapperDescriptionLanguage.Constructor#isJson Json</code>'.
|
getConstructor_Json
|
{
"repo_name": "Blimster/three4g",
"path": "net.blimster.gwt.threejs.wdl/src-gen/net/blimster/gwt/threejs/wdl/threeJsWrapperDescriptionLanguage/ThreeJsWrapperDescriptionLanguagePackage.java",
"license": "lgpl-3.0",
"size": 48992
}
|
[
"org.eclipse.emf.ecore.EAttribute"
] |
import org.eclipse.emf.ecore.EAttribute;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,479,088
|
public synchronized HorizontalHeaderTable getHorizontalHeader() throws IOException
{
HorizontalHeaderTable horizontalHeader = (HorizontalHeaderTable)tables.get( HorizontalHeaderTable.TAG );
if (horizontalHeader != null && !horizontalHeader.getInitialized())
{
readTable(horizontalHeader);
}
return horizontalHeader;
}
|
synchronized HorizontalHeaderTable function() throws IOException { HorizontalHeaderTable horizontalHeader = (HorizontalHeaderTable)tables.get( HorizontalHeaderTable.TAG ); if (horizontalHeader != null && !horizontalHeader.getInitialized()) { readTable(horizontalHeader); } return horizontalHeader; }
|
/**
* Get the hhea table for this TTF.
*
* @return The hhea table.
*/
|
Get the hhea table for this TTF
|
getHorizontalHeader
|
{
"repo_name": "BezrukovM/veraPDF-pdfbox",
"path": "fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java",
"license": "apache-2.0",
"size": 18927
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,606,333
|
private String kekMaterialDescAsJson() {
Map<String, String> kekMaterialDesc = getKEKMaterialsDescription();
if (kekMaterialDesc == null)
kekMaterialDesc = Collections.emptyMap();
return Jackson.toJsonString(kekMaterialDesc);
}
|
String function() { Map<String, String> kekMaterialDesc = getKEKMaterialsDescription(); if (kekMaterialDesc == null) kekMaterialDesc = Collections.emptyMap(); return Jackson.toJsonString(kekMaterialDesc); }
|
/**
* Returns the key-encrypting-key material description as a non-null json
* string;
*/
|
Returns the key-encrypting-key material description as a non-null json string
|
kekMaterialDescAsJson
|
{
"repo_name": "aws/aws-sdk-java",
"path": "aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/v1/ContentCryptoMaterial.java",
"license": "apache-2.0",
"size": 47199
}
|
[
"com.amazonaws.util.json.Jackson",
"java.util.Collections",
"java.util.Map"
] |
import com.amazonaws.util.json.Jackson; import java.util.Collections; import java.util.Map;
|
import com.amazonaws.util.json.*; import java.util.*;
|
[
"com.amazonaws.util",
"java.util"
] |
com.amazonaws.util; java.util;
| 2,236,451
|
ItemStatisticBuilder item(ItemType item);
|
ItemStatisticBuilder item(ItemType item);
|
/**
* Sets the {@link ItemType} of this {@link ItemStatistic}.
*
* @param item The item
* @return This builder, for chaining
*/
|
Sets the <code>ItemType</code> of this <code>ItemStatistic</code>
|
item
|
{
"repo_name": "Kiskae/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/statistic/StatisticBuilder.java",
"license": "mit",
"size": 6349
}
|
[
"org.spongepowered.api.item.ItemType"
] |
import org.spongepowered.api.item.ItemType;
|
import org.spongepowered.api.item.*;
|
[
"org.spongepowered.api"
] |
org.spongepowered.api;
| 2,801,875
|
public Observable<ServiceResponse<Void>> cancelAtTenantScopeWithServiceResponseAsync(String deploymentName) {
if (deploymentName == null) {
throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
|
Observable<ServiceResponse<Void>> function(String deploymentName) { if (deploymentName == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); }
|
/**
* Cancels a currently running template deployment.
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running template deployment and leaves the resources partially deployed.
*
* @param deploymentName The name of the deployment.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
|
Cancels a currently running template deployment. You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running template deployment and leaves the resources partially deployed
|
cancelAtTenantScopeWithServiceResponseAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resources/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/resources/v2020_06_01/implementation/DeploymentsInner.java",
"license": "mit",
"size": 445517
}
|
[
"com.microsoft.rest.ServiceResponse"
] |
import com.microsoft.rest.ServiceResponse;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 1,455,941
|
public static void serialize(final Map propertyList,
final List comments,
final File file)
throws IOException, SAXException,
TransformerConfigurationException {
SAXTransformerFactory sf = (SAXTransformerFactory)
SAXTransformerFactory.newInstance();
TransformerHandler handler = sf.newTransformerHandler();
FileOutputStream os = new FileOutputStream(file);
StreamResult result = new StreamResult(os);
handler.setResult(result);
handler.startDocument();
for(Iterator iter = comments.iterator(); iter.hasNext();) {
char[] comment = String.valueOf(iter.next()).toCharArray();
handler.comment(comment, 0, comment.length);
}
AttributesImpl attributes = new AttributesImpl();
handler.startElement(null, "plist", "plist", attributes);
serializeMap(propertyList, handler);
handler.endElement(null, "plist", "plist");
handler.endDocument();
}
|
static void function(final Map propertyList, final List comments, final File file) throws IOException, SAXException, TransformerConfigurationException { SAXTransformerFactory sf = (SAXTransformerFactory) SAXTransformerFactory.newInstance(); TransformerHandler handler = sf.newTransformerHandler(); FileOutputStream os = new FileOutputStream(file); StreamResult result = new StreamResult(os); handler.setResult(result); handler.startDocument(); for(Iterator iter = comments.iterator(); iter.hasNext();) { char[] comment = String.valueOf(iter.next()).toCharArray(); handler.comment(comment, 0, comment.length); } AttributesImpl attributes = new AttributesImpl(); handler.startElement(null, "plist", "plist", attributes); serializeMap(propertyList, handler); handler.endElement(null, "plist", "plist"); handler.endDocument(); }
|
/**
* Serializes a property list into a Cocoa XML Property List document.
* @param propertyList property list.
* @param file destination.
* @param comments comments to insert into document.
* @throws SAXException if exception during serialization.
* @throws TransformerConfigurationException if exception creating serializer.
*/
|
Serializes a property list into a Cocoa XML Property List document
|
serialize
|
{
"repo_name": "dscho/cpptasks",
"path": "src/main/java/net/sf/antcontrib/cpptasks/apple/PropertyListSerialization.java",
"license": "apache-2.0",
"size": 8881
}
|
[
"java.io.File",
"java.io.FileOutputStream",
"java.io.IOException",
"java.util.Iterator",
"java.util.List",
"java.util.Map",
"javax.xml.transform.TransformerConfigurationException",
"javax.xml.transform.sax.SAXTransformerFactory",
"javax.xml.transform.sax.TransformerHandler",
"javax.xml.transform.stream.StreamResult",
"org.xml.sax.SAXException",
"org.xml.sax.helpers.AttributesImpl"
] |
import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.sax.SAXTransformerFactory; import javax.xml.transform.sax.TransformerHandler; import javax.xml.transform.stream.StreamResult; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl;
|
import java.io.*; import java.util.*; import javax.xml.transform.*; import javax.xml.transform.sax.*; import javax.xml.transform.stream.*; import org.xml.sax.*; import org.xml.sax.helpers.*;
|
[
"java.io",
"java.util",
"javax.xml",
"org.xml.sax"
] |
java.io; java.util; javax.xml; org.xml.sax;
| 1,964,359
|
public void setReceiver(SocketAddress receiver) {
this.receiver = receiver;
}
|
void function(SocketAddress receiver) { this.receiver = receiver; }
|
/**
* Sets the intended receiver address. This must be set when writing to the
* channel.
*
* @param receiver
* the receiver address.
*/
|
Sets the intended receiver address. This must be set when writing to the channel
|
setReceiver
|
{
"repo_name": "jasonwee/videoOnCloud",
"path": "src/java/play/learn/java/design/reactor/NioDatagramChannel.java",
"license": "apache-2.0",
"size": 4415
}
|
[
"java.net.SocketAddress"
] |
import java.net.SocketAddress;
|
import java.net.*;
|
[
"java.net"
] |
java.net;
| 1,788,391
|
public NBTTagCompound getNBTCompound()
{
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setString("name", this.serverName);
nbttagcompound.setString("ip", this.serverIP);
if (this.serverIcon != null)
{
nbttagcompound.setString("icon", this.serverIcon);
}
if (this.resourceMode == ServerData.ServerResourceMode.ENABLED)
{
nbttagcompound.setBoolean("acceptTextures", true);
}
else if (this.resourceMode == ServerData.ServerResourceMode.DISABLED)
{
nbttagcompound.setBoolean("acceptTextures", false);
}
return nbttagcompound;
}
|
NBTTagCompound function() { NBTTagCompound nbttagcompound = new NBTTagCompound(); nbttagcompound.setString("name", this.serverName); nbttagcompound.setString("ip", this.serverIP); if (this.serverIcon != null) { nbttagcompound.setString("icon", this.serverIcon); } if (this.resourceMode == ServerData.ServerResourceMode.ENABLED) { nbttagcompound.setBoolean(STR, true); } else if (this.resourceMode == ServerData.ServerResourceMode.DISABLED) { nbttagcompound.setBoolean(STR, false); } return nbttagcompound; }
|
/**
* Returns an NBTTagCompound with the server's name, IP and maybe acceptTextures.
*/
|
Returns an NBTTagCompound with the server's name, IP and maybe acceptTextures
|
getNBTCompound
|
{
"repo_name": "tomtomtom09/CampCraft",
"path": "build/tmp/recompileMc/sources/net/minecraft/client/multiplayer/ServerData.java",
"license": "gpl-3.0",
"size": 4639
}
|
[
"net.minecraft.nbt.NBTTagCompound"
] |
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.*;
|
[
"net.minecraft.nbt"
] |
net.minecraft.nbt;
| 151,270
|
@Legacy(style = "sky-cellList-widget")
String cellListWidget();
}
|
@Legacy(style = STR) String cellListWidget(); }
|
/**
* Applied to the widget.
*/
|
Applied to the widget
|
cellListWidget
|
{
"repo_name": "SkyRocketGWT/skyrocketgwt",
"path": "skyrocket-core/src/main/java/com/skyrocketgwt/core/client/cellview/appearance/DefaultSkyCellListAppearance.java",
"license": "apache-2.0",
"size": 6486
}
|
[
"com.skyrocketgwt.core.client.resource.Legacy"
] |
import com.skyrocketgwt.core.client.resource.Legacy;
|
import com.skyrocketgwt.core.client.resource.*;
|
[
"com.skyrocketgwt.core"
] |
com.skyrocketgwt.core;
| 1,397,768
|
public static void createSAML11TimedConditions(SAML11AssertionType assertion, long durationInMilis, long clockSkew)
throws ConfigurationException, IssueInstantMissingException {
XMLGregorianCalendar issueInstant = assertion.getIssueInstant();
if (issueInstant == null)
throw new IssueInstantMissingException(ErrorCodes.NULL_ISSUE_INSTANT);
XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis + clockSkew);
SAML11ConditionsType conditionsType = new SAML11ConditionsType();
XMLGregorianCalendar beforeInstant = XMLTimeUtil.subtract(issueInstant, clockSkew);
conditionsType.setNotBefore(beforeInstant);
conditionsType.setNotOnOrAfter(assertionValidityLength);
assertion.setConditions(conditionsType);
}
/**
* Given an assertion element, validate the signature
*
* @param assertionElement
* @param publicKey the {@link PublicKey}
|
static void function(SAML11AssertionType assertion, long durationInMilis, long clockSkew) throws ConfigurationException, IssueInstantMissingException { XMLGregorianCalendar issueInstant = assertion.getIssueInstant(); if (issueInstant == null) throw new IssueInstantMissingException(ErrorCodes.NULL_ISSUE_INSTANT); XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis + clockSkew); SAML11ConditionsType conditionsType = new SAML11ConditionsType(); XMLGregorianCalendar beforeInstant = XMLTimeUtil.subtract(issueInstant, clockSkew); conditionsType.setNotBefore(beforeInstant); conditionsType.setNotOnOrAfter(assertionValidityLength); assertion.setConditions(conditionsType); } /** * Given an assertion element, validate the signature * * @param assertionElement * @param publicKey the {@link PublicKey}
|
/**
* Add validity conditions to the SAML2 Assertion
*
* @param assertion
* @param durationInMilis
*
* @throws ConfigurationException
* @throws IssueInstantMissingException
*/
|
Add validity conditions to the SAML2 Assertion
|
createSAML11TimedConditions
|
{
"repo_name": "chameleon82/keycloak",
"path": "saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/AssertionUtil.java",
"license": "apache-2.0",
"size": 22336
}
|
[
"java.security.PublicKey",
"javax.xml.datatype.XMLGregorianCalendar",
"org.keycloak.dom.saml.v1.assertion.SAML11AssertionType",
"org.keycloak.dom.saml.v1.assertion.SAML11ConditionsType",
"org.keycloak.saml.common.ErrorCodes",
"org.keycloak.saml.common.exceptions.ConfigurationException",
"org.keycloak.saml.common.exceptions.fed.IssueInstantMissingException"
] |
import java.security.PublicKey; import javax.xml.datatype.XMLGregorianCalendar; import org.keycloak.dom.saml.v1.assertion.SAML11AssertionType; import org.keycloak.dom.saml.v1.assertion.SAML11ConditionsType; import org.keycloak.saml.common.ErrorCodes; import org.keycloak.saml.common.exceptions.ConfigurationException; import org.keycloak.saml.common.exceptions.fed.IssueInstantMissingException;
|
import java.security.*; import javax.xml.datatype.*; import org.keycloak.dom.saml.v1.assertion.*; import org.keycloak.saml.common.*; import org.keycloak.saml.common.exceptions.*; import org.keycloak.saml.common.exceptions.fed.*;
|
[
"java.security",
"javax.xml",
"org.keycloak.dom",
"org.keycloak.saml"
] |
java.security; javax.xml; org.keycloak.dom; org.keycloak.saml;
| 1,842,666
|
public static int read(InputStream input, byte[] buffer) throws IOException {
return read(input, buffer, 0, buffer.length);
}
|
static int function(InputStream input, byte[] buffer) throws IOException { return read(input, buffer, 0, buffer.length); }
|
/**
* Read bytes from an input stream.
* This implementation guarantees that it will read as many bytes
* as possible before giving up; this may not always be the case for
* subclasses of {@link InputStream}.
*
* @param input where to read input from
* @param buffer destination
* @return actual length read; may be less than requested if EOF was reached
* @throws IOException if a read error occurs
* @since 2.2
*/
|
Read bytes from an input stream. This implementation guarantees that it will read as many bytes as possible before giving up; this may not always be the case for subclasses of <code>InputStream</code>
|
read
|
{
"repo_name": "trivium-io/trivium-core",
"path": "src/io/trivium/dep/org/apache/commons/io/IOUtils.java",
"license": "apache-2.0",
"size": 97969
}
|
[
"java.io.IOException",
"java.io.InputStream"
] |
import java.io.IOException; import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,665,252
|
if (metadata == null) {
final ReferenceResolver resolver = Context.resolver(context);
if ((uuid == null || (metadata = resolver.resolve(context, type, uuid )) == null) &&
(xlink == null || (metadata = resolver.resolve(context, type, xlink)) == null))
{
int count = 0;
SpecializedIdentifier<?>[] identifiers = new SpecializedIdentifier<?>[2];
if (uuid != null) identifiers[count++] = new SpecializedIdentifier<>(IdentifierSpace.UUID, uuid);
if (xlink != null) identifiers[count++] = new SpecializedIdentifier<>(IdentifierSpace.XLINK, xlink);
identifiers = ArraysExt.resize(identifiers, count);
metadata = resolver.newIdentifiedObject(context, type, identifiers);
}
} else {
if (metadata instanceof IdentifiedObject) {
final IdentifierMap map = ((IdentifiedObject) metadata).getIdentifierMap();
putInto(context, map, IdentifierSpace.UUID, uuid);
putInto(context, map, IdentifierSpace.XLINK, xlink);
}
}
return metadata;
}
/**
* Adds a new identifier into the given map, if non null. No previous value should exist in normal situation.
* However a previous value may exit in unusual (probably not very valid) XML, as in the following example:
*
* {@preformat xml
* <cit:CI_Citation>
* <cit:series uuidref="f8f5fcb1-d57b-4013-b3a4-4eaa40df6dcf">
* <cit:CI_Series uuid="f8f5fcb1-d57b-4013-b3a4-4eaa40df6dcf">
* ...
* </cit:CI_Series>
* </cit:series>
* </cit:CI_Citation>
* }
|
if (metadata == null) { final ReferenceResolver resolver = Context.resolver(context); if ((uuid == null (metadata = resolver.resolve(context, type, uuid )) == null) && (xlink == null (metadata = resolver.resolve(context, type, xlink)) == null)) { int count = 0; SpecializedIdentifier<?>[] identifiers = new SpecializedIdentifier<?>[2]; if (uuid != null) identifiers[count++] = new SpecializedIdentifier<>(IdentifierSpace.UUID, uuid); if (xlink != null) identifiers[count++] = new SpecializedIdentifier<>(IdentifierSpace.XLINK, xlink); identifiers = ArraysExt.resize(identifiers, count); metadata = resolver.newIdentifiedObject(context, type, identifiers); } } else { if (metadata instanceof IdentifiedObject) { final IdentifierMap map = ((IdentifiedObject) metadata).getIdentifierMap(); putInto(context, map, IdentifierSpace.UUID, uuid); putInto(context, map, IdentifierSpace.XLINK, xlink); } } return metadata; } /** * Adds a new identifier into the given map, if non null. No previous value should exist in normal situation. * However a previous value may exit in unusual (probably not very valid) XML, as in the following example: * * {@preformat xml * <cit:CI_Citation> * <cit:series uuidref=STR> * <cit:CI_Series uuid=STR> * ... * </cit:CI_Series> * </cit:series> * </cit:CI_Citation> * }
|
/**
* If the given metadata object is null, tries to get an instance from the identifiers
* declared in this {@code ObjectReference}. If the given metadata object is non-null,
* assigns to that object the identifiers declared in this {@code ObjectReference}.
*
* <p>This method is invoked at unmarshalling time by {@link PropertyType#resolve(Context)}.</p>
*
* @param <T> the compile-time type of the {@code type} argument.
* @param context the marshalling context, or {@code null} if none.
* @param type the expected type of the metadata object.
* @param metadata the metadata object, or {@code null}.
* @return a metadata object for the identifiers, or {@code null}
*/
|
If the given metadata object is null, tries to get an instance from the identifiers declared in this ObjectReference. If the given metadata object is non-null, assigns to that object the identifiers declared in this ObjectReference. This method is invoked at unmarshalling time by <code>PropertyType#resolve(Context)</code>
|
resolve
|
{
"repo_name": "apache/sis",
"path": "core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/gco/ObjectReference.java",
"license": "apache-2.0",
"size": 7272
}
|
[
"org.apache.sis.internal.jaxb.Context",
"org.apache.sis.internal.jaxb.SpecializedIdentifier",
"org.apache.sis.util.ArraysExt",
"org.apache.sis.xml.IdentifiedObject",
"org.apache.sis.xml.IdentifierMap",
"org.apache.sis.xml.IdentifierSpace",
"org.apache.sis.xml.ReferenceResolver"
] |
import org.apache.sis.internal.jaxb.Context; import org.apache.sis.internal.jaxb.SpecializedIdentifier; import org.apache.sis.util.ArraysExt; import org.apache.sis.xml.IdentifiedObject; import org.apache.sis.xml.IdentifierMap; import org.apache.sis.xml.IdentifierSpace; import org.apache.sis.xml.ReferenceResolver;
|
import org.apache.sis.internal.jaxb.*; import org.apache.sis.util.*; import org.apache.sis.xml.*;
|
[
"org.apache.sis"
] |
org.apache.sis;
| 341,865
|
public void testLogInitTrimsToLength() {
final int numExtraEntries = 205;
// Manually write to the log file to create the situation where there are too many lines
// in the file
boolean successfullyWroteFile;
try {
// Manually open the file and append a bunch of lines to it
// Don't call Log.getBufferedWriter here because there shouldn't be a Context since
// Log is uninitialized at this point
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(
mMockContext.openFileOutput(Log.FILENAME, Context.MODE_APPEND)));
// Write more than CIRCULAR_BUFFER_SIZE lines to the buffer
for (int i = 0; i < Log.CIRCULAR_BUFFER_SIZE + numExtraEntries; i++) {
// Append a whole bunch of near-empty lines to the file
bufferedWriter.write(" " + System.getProperty("line.separator"));
}
bufferedWriter.close();
successfullyWroteFile = true;
} catch (IOException ioException) {
successfullyWroteFile = false;
}
assertTrue("Could not write to the log file", successfullyWroteFile);
// Init because we want to test that the initialization trims the log properly
Log.init(mMockContext);
String log = Log.readLog();
// Find the number of occurrences of '\n' in the current entries
int numLines = 0;
for (int i = 0; i < log.length(); i++) {
if (log.charAt(i) == '\n') {
numLines++;
}
}
assertTrue("Log.init did not trim the log. numLines: " + numLines, numLines <= Log.CIRCULAR_BUFFER_SIZE);
}
|
void function() { final int numExtraEntries = 205; boolean successfullyWroteFile; try { BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter( mMockContext.openFileOutput(Log.FILENAME, Context.MODE_APPEND))); for (int i = 0; i < Log.CIRCULAR_BUFFER_SIZE + numExtraEntries; i++) { bufferedWriter.write(" " + System.getProperty(STR)); } bufferedWriter.close(); successfullyWroteFile = true; } catch (IOException ioException) { successfullyWroteFile = false; } assertTrue(STR, successfullyWroteFile); Log.init(mMockContext); String log = Log.readLog(); int numLines = 0; for (int i = 0; i < log.length(); i++) { if (log.charAt(i) == '\n') { numLines++; } } assertTrue(STR + numLines, numLines <= Log.CIRCULAR_BUFFER_SIZE); }
|
/**
* Scenario:
* Given Log is uninitialized and I have an overfull log file
* When I call init
* Then the log file is trimmed
*/
|
Scenario: Given Log is uninitialized and I have an overfull log file When I call init Then the log file is trimmed
|
testLogInitTrimsToLength
|
{
"repo_name": "oanda/android-logging-library",
"path": "lib/src/androidTest/java/com/oanda/logging/LogTests.java",
"license": "apache-2.0",
"size": 22243
}
|
[
"android.content.Context",
"java.io.BufferedWriter",
"java.io.IOException",
"java.io.OutputStreamWriter"
] |
import android.content.Context; import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter;
|
import android.content.*; import java.io.*;
|
[
"android.content",
"java.io"
] |
android.content; java.io;
| 1,880,895
|
public Map<String, String> getPseudoOperationParameters() {
return m_pseudoOpParams;
}
|
Map<String, String> function() { return m_pseudoOpParams; }
|
/**
* Returns a map of the pseudo-operation parameters; these are query or header parameters.
* used to indicate pseudo-operations, such as ?wsdl
* @return the pseudo-operation parameter map
*/
|
Returns a map of the pseudo-operation parameters; these are query or header parameters. used to indicate pseudo-operations, such as ?wsdl
|
getPseudoOperationParameters
|
{
"repo_name": "vthangathurai/SOA-Runtime",
"path": "soa-server/src/main/java/org/ebayopensource/turmeric/runtime/spf/pipeline/RequestMetaContext.java",
"license": "apache-2.0",
"size": 4324
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 936,121
|
public void updateCommonJsp() {
// List of pages to update
List<String> pageList = new ArrayList<String>();
Collections.addAll(pageList, "dataAccessFailure", "resourceNotFound",
"uncaughtException", "index", "login");
// 3rd party add-ons could customize default Roo tags as gvNIX does,
// to avoid to overwrite them with jQuery namespaces we will update
// default Roo namespaces only
Map<String, String> rooUriMap = new HashMap<String, String>();
rooUriMap.put(XMLNS_FIELD, FORM_FIELDS_PATH);
rooUriMap.put(XMLNS_FORM, "urn:jsptagdir:/WEB-INF/tags/form");
rooUriMap.put(XMLNS_TABLE, FORM_FIELDS_PATH);
rooUriMap.put(XMLNS_PAGE, "urn:jsptagdir:/WEB-INF/tags/form");
rooUriMap.put(XMLNS_UTIL, "urn:jsptagdir:/WEB-INF/tags/util");
// new jQuery namespaces
Map<String, String> uriMap = new HashMap<String, String>();
uriMap.put(XMLNS_FIELD,
"urn:jsptagdir:/WEB-INF/tags/jquery/form/fields");
uriMap.put(XMLNS_FORM, JQUERY_FORM_PATH);
uriMap.put(XMLNS_TABLE,
"urn:jsptagdir:/WEB-INF/tags/jquery/form/fields");
uriMap.put(XMLNS_PAGE, JQUERY_FORM_PATH);
uriMap.put(XMLNS_UTIL, "urn:jsptagdir:/WEB-INF/tags/jquery/util");
// do the update
for (String jspxName : pageList) {
getWebProjectUtils().updateTagxUriInJspx(
"WEB-INF/views/".concat(jspxName).concat(".jspx"),
rooUriMap, uriMap, getProjectOperations(), fileManager);
}
}
|
void function() { List<String> pageList = new ArrayList<String>(); Collections.addAll(pageList, STR, STR, STR, "index", "login"); Map<String, String> rooUriMap = new HashMap<String, String>(); rooUriMap.put(XMLNS_FIELD, FORM_FIELDS_PATH); rooUriMap.put(XMLNS_FORM, STR); rooUriMap.put(XMLNS_TABLE, FORM_FIELDS_PATH); rooUriMap.put(XMLNS_PAGE, STR); rooUriMap.put(XMLNS_UTIL, STR); Map<String, String> uriMap = new HashMap<String, String>(); uriMap.put(XMLNS_FIELD, STR); uriMap.put(XMLNS_FORM, JQUERY_FORM_PATH); uriMap.put(XMLNS_TABLE, STR); uriMap.put(XMLNS_PAGE, JQUERY_FORM_PATH); uriMap.put(XMLNS_UTIL, STR); for (String jspxName : pageList) { getWebProjectUtils().updateTagxUriInJspx( STR.concat(jspxName).concat(".jspx"), rooUriMap, uriMap, getProjectOperations(), fileManager); } }
|
/**
* Updates all JSP pages of target controller to use JQuery
*
* @param controller
* @param controllerAnnotation
*/
|
Updates all JSP pages of target controller to use JQuery
|
updateCommonJsp
|
{
"repo_name": "gvSIGAssociation/gvnix",
"path": "addon-web-mvc/addon/src/main/java/org/gvnix/addon/web/mvc/addon/jquery/JQueryOperationsImpl.java",
"license": "gpl-3.0",
"size": 34045
}
|
[
"java.util.ArrayList",
"java.util.Collections",
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] |
import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 388,301
|
@Override
int receiveEnergy(EnumFacing facing, int maxReceive, boolean simulate);
|
int receiveEnergy(EnumFacing facing, int maxReceive, boolean simulate);
|
/**
* Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver.
*
* @param from
* Orientation the energy is received from.
* @param maxReceive
* Maximum amount of energy to receive.
* @param simulate
* If TRUE, the charge will only be simulated.
* @return Amount of energy that was (or would have been, if simulated) received.
*/
|
Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver
|
receiveEnergy
|
{
"repo_name": "Lomeli12/PowerTools",
"path": "src/main/java/cofh/api/energy/IEnergyHandler.java",
"license": "lgpl-3.0",
"size": 1800
}
|
[
"net.minecraft.util.EnumFacing"
] |
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.*;
|
[
"net.minecraft.util"
] |
net.minecraft.util;
| 1,343,092
|
public EMLComposer session(Session session) {
this.session = session;
return this;
}
|
EMLComposer function(Session session) { this.session = session; return this; }
|
/**
* Assigns custom session. Any property will be ignored.
*/
|
Assigns custom session. Any property will be ignored
|
session
|
{
"repo_name": "vilmospapp/jodd",
"path": "jodd-mail/src/main/java/jodd/mail/EMLComposer.java",
"license": "bsd-2-clause",
"size": 4152
}
|
[
"javax.mail.Session"
] |
import javax.mail.Session;
|
import javax.mail.*;
|
[
"javax.mail"
] |
javax.mail;
| 911,680
|
public void exportService(JavaType className, String serviceName,
String portTypeName, String targetNamespace, String addressName);
|
void function(JavaType className, String serviceName, String portTypeName, String targetNamespace, String addressName);
|
/**
* <p>
* Exports a class to Web Service.
* </p>
* <p>
* If the class to export as web service doesn't exist it will be created
* automatically in 'src/main/java' directory inside the package defined.
* </p>
*
* @param className class to export.
* @param serviceName Name to publish the Web Service.
* @param portTypeName Name to define the portType.
* @param targetNamespace Namespace name for the service.
* @param addressName Address to access the service.
*/
|
Exports a class to Web Service. If the class to export as web service doesn't exist it will be created automatically in 'src/main/java' directory inside the package defined.
|
exportService
|
{
"repo_name": "osroca/gvnix",
"path": "addon-service/addon/src/main/java/org/gvnix/service/roo/addon/addon/ws/export/WSExportOperations.java",
"license": "gpl-3.0",
"size": 4450
}
|
[
"org.springframework.roo.model.JavaType"
] |
import org.springframework.roo.model.JavaType;
|
import org.springframework.roo.model.*;
|
[
"org.springframework.roo"
] |
org.springframework.roo;
| 1,189,843
|
@Override
protected ConvertedDocument conversionImplementation(InputStream input, java.io.File doc)
throws IOException {
Metadata metadata = new Metadata();
BodyContentHandler handler = new BodyContentHandler(maxBuffer);
try {
parser.parse(input, handler, metadata, ctx);
} catch (Exception xerr) {
throw new IOException("Unable to parse content", xerr);
} finally {
input.close();
}
ConvertedDocument textdoc = new ConvertedDocument(doc);
textdoc.addTitle(metadata.get(TikaCoreProperties.TITLE));
textdoc.setEncoding(metadata.get(Metadata.CONTENT_ENCODING));
textdoc.addCreateDate(metadata.getDate(TikaCoreProperties.CREATED));
textdoc.addAuthor(metadata.get(TikaCoreProperties.CREATOR));
// v1.5: until this version this blank line reducer was in place.
// Using Java6 it appeared to cause StackOverflow when it encountered a document hundreds of \n in a row.
// Eg.., a Spreadsheet doc converted to text may have thousands of empty lines following the last data row.
// TextUtils.reduce_line_breaks(txt)
String t = handler.toString();
if (t != null) {
if (textdoc.filename!= null && FileUtility.isSpreadsheet(textdoc.filename)) {
textdoc.setText(t.trim());
} else {
textdoc.setText(TextUtils.reduce_line_breaks(t));
}
}
return textdoc;
}
|
ConvertedDocument function(InputStream input, java.io.File doc) throws IOException { Metadata metadata = new Metadata(); BodyContentHandler handler = new BodyContentHandler(maxBuffer); try { parser.parse(input, handler, metadata, ctx); } catch (Exception xerr) { throw new IOException(STR, xerr); } finally { input.close(); } ConvertedDocument textdoc = new ConvertedDocument(doc); textdoc.addTitle(metadata.get(TikaCoreProperties.TITLE)); textdoc.setEncoding(metadata.get(Metadata.CONTENT_ENCODING)); textdoc.addCreateDate(metadata.getDate(TikaCoreProperties.CREATED)); textdoc.addAuthor(metadata.get(TikaCoreProperties.CREATOR)); String t = handler.toString(); if (t != null) { if (textdoc.filename!= null && FileUtility.isSpreadsheet(textdoc.filename)) { textdoc.setText(t.trim()); } else { textdoc.setText(TextUtils.reduce_line_breaks(t)); } } return textdoc; }
|
/**
* Common implementation -- take an input stream and return a ConvertedDoc;
*
* @param input
* @param doc
* @return
* @throws IOException
* if underlying Tika parser/writer had an IO problem, an parser
* problem, or MAX_TEXT_SIZE is reached.
*/
|
Common implementation -- take an input stream and return a ConvertedDoc
|
conversionImplementation
|
{
"repo_name": "voyagersearch/Xponents",
"path": "XText/src/main/java/org/opensextant/xtext/converters/DefaultConverter.java",
"license": "apache-2.0",
"size": 4361
}
|
[
"java.io.IOException",
"java.io.InputStream",
"org.apache.tika.metadata.Metadata",
"org.apache.tika.metadata.TikaCoreProperties",
"org.apache.tika.sax.BodyContentHandler",
"org.opensextant.util.FileUtility",
"org.opensextant.util.TextUtils",
"org.opensextant.xtext.ConvertedDocument"
] |
import java.io.IOException; import java.io.InputStream; import org.apache.tika.metadata.Metadata; import org.apache.tika.metadata.TikaCoreProperties; import org.apache.tika.sax.BodyContentHandler; import org.opensextant.util.FileUtility; import org.opensextant.util.TextUtils; import org.opensextant.xtext.ConvertedDocument;
|
import java.io.*; import org.apache.tika.metadata.*; import org.apache.tika.sax.*; import org.opensextant.util.*; import org.opensextant.xtext.*;
|
[
"java.io",
"org.apache.tika",
"org.opensextant.util",
"org.opensextant.xtext"
] |
java.io; org.apache.tika; org.opensextant.util; org.opensextant.xtext;
| 466,378
|
protected Paint getPaint(PDColor color) throws IOException
{
PDColorSpace colorSpace = color.getColorSpace();
if (!(colorSpace instanceof PDPattern))
{
float[] rgb = colorSpace.toRGB(color.getComponents());
return new Color(rgb[0], rgb[1], rgb[2]);
}
else
{
PDPattern patternSpace = (PDPattern)colorSpace;
PDAbstractPattern pattern = patternSpace.getPattern(color);
if (pattern instanceof PDTilingPattern)
{
PDTilingPattern tilingPattern = (PDTilingPattern) pattern;
if (tilingPattern.getPaintType() == PDTilingPattern.PAINT_COLORED)
{
// colored tiling pattern
return new TilingPaint(this, tilingPattern, xform);
}
else
{
// uncolored tiling pattern
return new TilingPaint(this, tilingPattern,
patternSpace.getUnderlyingColorSpace(), color, xform);
}
}
else
{
PDShadingPattern shadingPattern = (PDShadingPattern)pattern;
PDShading shading = shadingPattern.getShading();
if (shading == null)
{
LOG.error("shadingPattern is null, will be filled with transparency");
return new Color(0,0,0,0);
}
return shading.toPaint(Matrix.concatenate(getInitialMatrix(),
shadingPattern.getMatrix()));
}
}
}
|
Paint function(PDColor color) throws IOException { PDColorSpace colorSpace = color.getColorSpace(); if (!(colorSpace instanceof PDPattern)) { float[] rgb = colorSpace.toRGB(color.getComponents()); return new Color(rgb[0], rgb[1], rgb[2]); } else { PDPattern patternSpace = (PDPattern)colorSpace; PDAbstractPattern pattern = patternSpace.getPattern(color); if (pattern instanceof PDTilingPattern) { PDTilingPattern tilingPattern = (PDTilingPattern) pattern; if (tilingPattern.getPaintType() == PDTilingPattern.PAINT_COLORED) { return new TilingPaint(this, tilingPattern, xform); } else { return new TilingPaint(this, tilingPattern, patternSpace.getUnderlyingColorSpace(), color, xform); } } else { PDShadingPattern shadingPattern = (PDShadingPattern)pattern; PDShading shading = shadingPattern.getShading(); if (shading == null) { LOG.error(STR); return new Color(0,0,0,0); } return shading.toPaint(Matrix.concatenate(getInitialMatrix(), shadingPattern.getMatrix())); } } }
|
/**
* Returns an AWT paint for the given PDColor.
*/
|
Returns an AWT paint for the given PDColor
|
getPaint
|
{
"repo_name": "mdamt/pdfbox",
"path": "pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java",
"license": "apache-2.0",
"size": 34519
}
|
[
"java.awt.Color",
"java.awt.Paint",
"java.io.IOException",
"org.apache.pdfbox.pdmodel.graphics.color.PDColor",
"org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace",
"org.apache.pdfbox.pdmodel.graphics.color.PDPattern",
"org.apache.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern",
"org.apache.pdfbox.pdmodel.graphics.pattern.PDShadingPattern",
"org.apache.pdfbox.pdmodel.graphics.pattern.PDTilingPattern",
"org.apache.pdfbox.pdmodel.graphics.shading.PDShading",
"org.apache.pdfbox.util.Matrix"
] |
import java.awt.Color; import java.awt.Paint; import java.io.IOException; import org.apache.pdfbox.pdmodel.graphics.color.PDColor; import org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace; import org.apache.pdfbox.pdmodel.graphics.color.PDPattern; import org.apache.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern; import org.apache.pdfbox.pdmodel.graphics.pattern.PDShadingPattern; import org.apache.pdfbox.pdmodel.graphics.pattern.PDTilingPattern; import org.apache.pdfbox.pdmodel.graphics.shading.PDShading; import org.apache.pdfbox.util.Matrix;
|
import java.awt.*; import java.io.*; import org.apache.pdfbox.pdmodel.graphics.color.*; import org.apache.pdfbox.pdmodel.graphics.pattern.*; import org.apache.pdfbox.pdmodel.graphics.shading.*; import org.apache.pdfbox.util.*;
|
[
"java.awt",
"java.io",
"org.apache.pdfbox"
] |
java.awt; java.io; org.apache.pdfbox;
| 891,587
|
public void testCloning() {
Vector v1 = new Vector(1.0, 2.0);
assertFalse(v1 instanceof Cloneable);
}
|
void function() { Vector v1 = new Vector(1.0, 2.0); assertFalse(v1 instanceof Cloneable); }
|
/**
* Immutable class is not cloneable.
*/
|
Immutable class is not cloneable
|
testCloning
|
{
"repo_name": "linuxuser586/jfreechart",
"path": "tests/org/jfree/data/xy/junit/VectorTests.java",
"license": "lgpl-2.1",
"size": 4128
}
|
[
"org.jfree.data.xy.Vector"
] |
import org.jfree.data.xy.Vector;
|
import org.jfree.data.xy.*;
|
[
"org.jfree.data"
] |
org.jfree.data;
| 1,537,275
|
public final Vec2 getLocalCenter() {
return m_sweep.localCenter;
}
|
final Vec2 function() { return m_sweep.localCenter; }
|
/**
* Get the local position of the center of mass. Do not modify.
*/
|
Get the local position of the center of mass. Do not modify
|
getLocalCenter
|
{
"repo_name": "jbox2d/jbox2d",
"path": "jbox2d-library/src/main/java/org/jbox2d/dynamics/Body.java",
"license": "bsd-2-clause",
"size": 33153
}
|
[
"org.jbox2d.common.Vec2"
] |
import org.jbox2d.common.Vec2;
|
import org.jbox2d.common.*;
|
[
"org.jbox2d.common"
] |
org.jbox2d.common;
| 1,730,333
|
public static MetaData addAliasToMetaData(MetaData metaData, String indexName) {
AliasMetaData aliasMetaData = AliasMetaData.newAliasMetaDataBuilder(SECURITY_MAIN_ALIAS).build();
MetaData.Builder metaDataBuilder = new MetaData.Builder(metaData);
IndexMetaData indexMetaData = metaData.index(indexName);
metaDataBuilder.put(IndexMetaData.builder(indexMetaData).putAlias(aliasMetaData));
return metaDataBuilder.build();
}
|
static MetaData function(MetaData metaData, String indexName) { AliasMetaData aliasMetaData = AliasMetaData.newAliasMetaDataBuilder(SECURITY_MAIN_ALIAS).build(); MetaData.Builder metaDataBuilder = new MetaData.Builder(metaData); IndexMetaData indexMetaData = metaData.index(indexName); metaDataBuilder.put(IndexMetaData.builder(indexMetaData).putAlias(aliasMetaData)); return metaDataBuilder.build(); }
|
/**
* Adds the index alias {@code .security} to the underlying concrete index.
*/
|
Adds the index alias .security to the underlying concrete index
|
addAliasToMetaData
|
{
"repo_name": "coding0011/elasticsearch",
"path": "x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/test/SecurityTestUtils.java",
"license": "apache-2.0",
"size": 4448
}
|
[
"org.elasticsearch.cluster.metadata.AliasMetaData",
"org.elasticsearch.cluster.metadata.IndexMetaData",
"org.elasticsearch.cluster.metadata.MetaData"
] |
import org.elasticsearch.cluster.metadata.AliasMetaData; import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.cluster.metadata.MetaData;
|
import org.elasticsearch.cluster.metadata.*;
|
[
"org.elasticsearch.cluster"
] |
org.elasticsearch.cluster;
| 1,520,072
|
@Test
public void testNonEmptyOFAgentSet() throws IOException {
expect(mockOFAgentService.agents()).andReturn(agents).anyTimes();
replay(mockOFAgentService);
final WebTarget wt = target();
assertNotNull("WebTarget is null", wt);
assertNotNull("WebTarget request is null", wt.request());
final String response = wt.path("service/ofagents").request().get(String.class);
final JsonObject result = Json.parse(response).asObject();
assertThat(result, notNullValue());
assertThat(result.names(), hasSize(1));
assertThat(result.names().get(0), is("ofAgents"));
mockOFAgentService.agents().forEach(ofAgent -> {
String expectedJsonStringNetworkId = "\"networkId\":\"" + ofAgent.networkId().id() + "\"";
assertThat(response, containsString(expectedJsonStringNetworkId));
String expectedJsonStringTenantId = "\"tenantId\":\"" + ofAgent.tenantId().id() + "\"";
assertThat(response, containsString(expectedJsonStringTenantId));
String expectedJsonStringState = "\"state\":\"" + ofAgent.state() + "\"";
assertThat(response, containsString(expectedJsonStringState));
ofAgent.controllers().forEach(ofController -> {
String expectedJsonStringIP = "\"ip\":\"" + ofController.ip() + "\"";
assertThat(response, containsString(expectedJsonStringIP));
String expectedJsonStringPort = "\"port\":\"" + ofController.port() + "\"";
assertThat(response, containsString(expectedJsonStringPort));
});
});
verify(mockOFAgentService);
}
|
void function() throws IOException { expect(mockOFAgentService.agents()).andReturn(agents).anyTimes(); replay(mockOFAgentService); final WebTarget wt = target(); assertNotNull(STR, wt); assertNotNull(STR, wt.request()); final String response = wt.path(STR).request().get(String.class); final JsonObject result = Json.parse(response).asObject(); assertThat(result, notNullValue()); assertThat(result.names(), hasSize(1)); assertThat(result.names().get(0), is(STR)); mockOFAgentService.agents().forEach(ofAgent -> { String expectedJsonStringNetworkId = "\"networkId\":\"STR\STR\STR:\STR\STR\STR:\STR\STR\"ip\":\STR\STR\"port\":\STR\""; assertThat(response, containsString(expectedJsonStringPort)); }); }); verify(mockOFAgentService); }
|
/**
* Tests the result of the rest api GET when there are OFAgents.
*
* @throws IOException IO exception
*/
|
Tests the result of the rest api GET when there are OFAgents
|
testNonEmptyOFAgentSet
|
{
"repo_name": "gkatsikas/onos",
"path": "apps/ofagent/src/test/java/org/onosproject/ofagent/rest/OFAgentWebResourceTest.java",
"license": "apache-2.0",
"size": 20970
}
|
[
"com.eclipsesource.json.Json",
"com.eclipsesource.json.JsonObject",
"java.io.IOException",
"javax.ws.rs.client.WebTarget",
"org.easymock.EasyMock",
"org.hamcrest.Matchers",
"org.junit.Assert"
] |
import com.eclipsesource.json.Json; import com.eclipsesource.json.JsonObject; import java.io.IOException; import javax.ws.rs.client.WebTarget; import org.easymock.EasyMock; import org.hamcrest.Matchers; import org.junit.Assert;
|
import com.eclipsesource.json.*; import java.io.*; import javax.ws.rs.client.*; import org.easymock.*; import org.hamcrest.*; import org.junit.*;
|
[
"com.eclipsesource.json",
"java.io",
"javax.ws",
"org.easymock",
"org.hamcrest",
"org.junit"
] |
com.eclipsesource.json; java.io; javax.ws; org.easymock; org.hamcrest; org.junit;
| 1,305,585
|
public GridCommunicationClient reserveClient(ClusterNode node, int connIdx) throws IgniteCheckedException {
assert node != null;
assert (connIdx >= 0 && connIdx < cfg.connectionsPerNode()) || !(cfg.usePairedConnections() && usePairedConnections(node, attrs.pairedConnection())) : connIdx;
if (locNodeSupplier.get().isClient()) {
if (node.isClient()) {
if (DISABLED_CLIENT_PORT.equals(node.attribute(attrs.port())))
throw new IgniteSpiException("Cannot send message to the client node with no server socket opened.");
}
}
UUID nodeId = node.id();
if (log.isDebugEnabled())
log.debug("The node client is going to reserve a connection [nodeId=" + node.id() + ", connIdx=" + connIdx + "]");
while (true) {
GridCommunicationClient[] curClients = clients.get(nodeId);
GridCommunicationClient client = curClients != null && connIdx < curClients.length ?
curClients[connIdx] : null;
if (client == null) {
if (stopping)
throw new IgniteSpiException("Node is stopping.");
// Do not allow concurrent connects.
GridFutureAdapter<GridCommunicationClient> fut = new ConnectFuture();
ConnectionKey connKey = new ConnectionKey(nodeId, connIdx, -1);
GridFutureAdapter<GridCommunicationClient> oldFut = clientFuts.putIfAbsent(connKey, fut);
if (oldFut == null) {
try {
GridCommunicationClient[] curClients0 = clients.get(nodeId);
GridCommunicationClient client0 = curClients0 != null && connIdx < curClients0.length ?
curClients0[connIdx] : null;
if (client0 == null) {
client0 = createCommunicationClient(node, connIdx);
if (client0 != null) {
addNodeClient(node, connIdx, client0);
if (client0 instanceof GridTcpNioCommunicationClient) {
GridTcpNioCommunicationClient tcpClient = ((GridTcpNioCommunicationClient)client0);
if (tcpClient.session().closeTime() > 0 && removeNodeClient(nodeId, client0)) {
if (log.isDebugEnabled()) {
log.debug("Session was closed after client creation, will retry " +
"[node=" + node + ", client=" + client0 + ']');
}
client0 = null;
}
}
}
else {
U.sleep(200);
if (nodeGetter.apply(node.id()) == null)
throw new ClusterTopologyCheckedException("Failed to send message " +
"(node left topology): " + node);
}
}
fut.onDone(client0);
}
catch (NodeUnreachableException e) {
log.warning(e.getMessage());
fut = handleUnreachableNodeException(node, connIdx, fut, e);
}
catch (Throwable e) {
if (e instanceof NodeUnreachableException)
throw e;
fut.onDone(e);
if (e instanceof IgniteTooManyOpenFilesException)
throw e;
if (e instanceof Error)
throw (Error)e;
}
finally {
clientFuts.remove(connKey, fut);
}
}
else
fut = oldFut;
long clientReserveWaitTimeout = registry != null ? registry.getSystemWorkerBlockedTimeout() / 3
: cfg.connectionTimeout() / 3;
long currTimeout = System.currentTimeMillis();
// This cycle will eventually quit when future is completed by concurrent thread reserving client.
while (true) {
try {
client = fut.get(clientReserveWaitTimeout, TimeUnit.MILLISECONDS);
break;
}
catch (IgniteFutureTimeoutCheckedException ignored) {
currTimeout += clientReserveWaitTimeout;
if (log.isDebugEnabled())
log.debug("Still waiting for reestablishing connection to node [nodeId=" + node.id() + ", waitingTime=" + currTimeout + "ms]");
if (registry != null) {
GridWorker wrkr = registry.worker(Thread.currentThread().getName());
if (wrkr != null)
wrkr.updateHeartbeat();
}
}
}
if (client == null) {
if (clusterStateProvider.isLocalNodeDisconnected())
throw new IgniteCheckedException("Unable to create TCP client due to local node disconnecting.");
else
continue;
}
if (nodeGetter.apply(nodeId) == null) {
if (removeNodeClient(nodeId, client))
client.forceClose();
throw new IgniteSpiException("Destination node is not in topology: " + node.id());
}
}
assert connIdx == client.connectionIndex() : client;
if (client.reserve())
return client;
else
// Client has just been closed by idle worker. Help it and try again.
removeNodeClient(nodeId, client);
}
}
|
GridCommunicationClient function(ClusterNode node, int connIdx) throws IgniteCheckedException { assert node != null; assert (connIdx >= 0 && connIdx < cfg.connectionsPerNode()) !(cfg.usePairedConnections() && usePairedConnections(node, attrs.pairedConnection())) : connIdx; if (locNodeSupplier.get().isClient()) { if (node.isClient()) { if (DISABLED_CLIENT_PORT.equals(node.attribute(attrs.port()))) throw new IgniteSpiException(STR); } } UUID nodeId = node.id(); if (log.isDebugEnabled()) log.debug(STR + node.id() + STR + connIdx + "]"); while (true) { GridCommunicationClient[] curClients = clients.get(nodeId); GridCommunicationClient client = curClients != null && connIdx < curClients.length ? curClients[connIdx] : null; if (client == null) { if (stopping) throw new IgniteSpiException(STR); GridFutureAdapter<GridCommunicationClient> fut = new ConnectFuture(); ConnectionKey connKey = new ConnectionKey(nodeId, connIdx, -1); GridFutureAdapter<GridCommunicationClient> oldFut = clientFuts.putIfAbsent(connKey, fut); if (oldFut == null) { try { GridCommunicationClient[] curClients0 = clients.get(nodeId); GridCommunicationClient client0 = curClients0 != null && connIdx < curClients0.length ? curClients0[connIdx] : null; if (client0 == null) { client0 = createCommunicationClient(node, connIdx); if (client0 != null) { addNodeClient(node, connIdx, client0); if (client0 instanceof GridTcpNioCommunicationClient) { GridTcpNioCommunicationClient tcpClient = ((GridTcpNioCommunicationClient)client0); if (tcpClient.session().closeTime() > 0 && removeNodeClient(nodeId, client0)) { if (log.isDebugEnabled()) { log.debug(STR + STR + node + STR + client0 + ']'); } client0 = null; } } } else { U.sleep(200); if (nodeGetter.apply(node.id()) == null) throw new ClusterTopologyCheckedException(STR + STR + node); } } fut.onDone(client0); } catch (NodeUnreachableException e) { log.warning(e.getMessage()); fut = handleUnreachableNodeException(node, connIdx, fut, e); } catch (Throwable e) { if (e instanceof NodeUnreachableException) throw e; fut.onDone(e); if (e instanceof IgniteTooManyOpenFilesException) throw e; if (e instanceof Error) throw (Error)e; } finally { clientFuts.remove(connKey, fut); } } else fut = oldFut; long clientReserveWaitTimeout = registry != null ? registry.getSystemWorkerBlockedTimeout() / 3 : cfg.connectionTimeout() / 3; long currTimeout = System.currentTimeMillis(); while (true) { try { client = fut.get(clientReserveWaitTimeout, TimeUnit.MILLISECONDS); break; } catch (IgniteFutureTimeoutCheckedException ignored) { currTimeout += clientReserveWaitTimeout; if (log.isDebugEnabled()) log.debug(STR + node.id() + STR + currTimeout + "ms]"); if (registry != null) { GridWorker wrkr = registry.worker(Thread.currentThread().getName()); if (wrkr != null) wrkr.updateHeartbeat(); } } } if (client == null) { if (clusterStateProvider.isLocalNodeDisconnected()) throw new IgniteCheckedException(STR); else continue; } if (nodeGetter.apply(nodeId) == null) { if (removeNodeClient(nodeId, client)) client.forceClose(); throw new IgniteSpiException(STR + node.id()); } } assert connIdx == client.connectionIndex() : client; if (client.reserve()) return client; else removeNodeClient(nodeId, client); } }
|
/**
* Returns existing or just created client to node.
*
* @param node Node to which client should be open.
* @param connIdx Connection index.
* @return The existing or just created client.
* @throws IgniteCheckedException Thrown if any exception occurs.
*/
|
Returns existing or just created client to node
|
reserveClient
|
{
"repo_name": "samaitra/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/ConnectionClientPool.java",
"license": "apache-2.0",
"size": 31202
}
|
[
"java.util.concurrent.TimeUnit",
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.cluster.ClusterNode",
"org.apache.ignite.internal.IgniteFutureTimeoutCheckedException",
"org.apache.ignite.internal.IgniteTooManyOpenFilesException",
"org.apache.ignite.internal.cluster.ClusterTopologyCheckedException",
"org.apache.ignite.internal.util.future.GridFutureAdapter",
"org.apache.ignite.internal.util.nio.GridCommunicationClient",
"org.apache.ignite.internal.util.nio.GridTcpNioCommunicationClient",
"org.apache.ignite.internal.util.typedef.internal.U",
"org.apache.ignite.internal.util.worker.GridWorker",
"org.apache.ignite.spi.IgniteSpiException",
"org.apache.ignite.spi.communication.tcp.internal.CommunicationTcpUtils"
] |
import java.util.concurrent.TimeUnit; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.IgniteFutureTimeoutCheckedException; import org.apache.ignite.internal.IgniteTooManyOpenFilesException; import org.apache.ignite.internal.cluster.ClusterTopologyCheckedException; import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.nio.GridCommunicationClient; import org.apache.ignite.internal.util.nio.GridTcpNioCommunicationClient; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.internal.util.worker.GridWorker; import org.apache.ignite.spi.IgniteSpiException; import org.apache.ignite.spi.communication.tcp.internal.CommunicationTcpUtils;
|
import java.util.concurrent.*; import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.cluster.*; import org.apache.ignite.internal.util.future.*; import org.apache.ignite.internal.util.nio.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.internal.util.worker.*; import org.apache.ignite.spi.*; import org.apache.ignite.spi.communication.tcp.internal.*;
|
[
"java.util",
"org.apache.ignite"
] |
java.util; org.apache.ignite;
| 2,837,581
|
void removeViewInstance(ViewInstanceEntity viewInstanceDefinition);
|
void removeViewInstance(ViewInstanceEntity viewInstanceDefinition);
|
/**
* Remove the handler for the given view instance.
*
* @param viewInstanceDefinition the view instance
*/
|
Remove the handler for the given view instance
|
removeViewInstance
|
{
"repo_name": "radicalbit/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/view/ViewInstanceHandlerList.java",
"license": "apache-2.0",
"size": 1548
}
|
[
"org.apache.ambari.server.orm.entities.ViewInstanceEntity"
] |
import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
|
import org.apache.ambari.server.orm.entities.*;
|
[
"org.apache.ambari"
] |
org.apache.ambari;
| 1,908,621
|
private Type parseIterableAbbreviatedType() {
lexer.eat(TypeLexer.OPEN_BR);
Type iterated = parseUnionType();
Type result = null;
if (lexer.lookingAt(TypeLexer.PLUS)) {
lexer.eat(TypeLexer.PLUS);
result = unit.getNonemptyIterableType(iterated);
} else if (lexer.lookingAt(TypeLexer.STAR)) {
lexer.eat(TypeLexer.STAR);
result = unit.getIterableType(iterated);
} else {
throw new TypeParserException("Expected multiplicity in abbreviated Iterable type: "+lexer.index);
}
lexer.eat(TypeLexer.CLOSE_BR);
return result;
}
|
Type function() { lexer.eat(TypeLexer.OPEN_BR); Type iterated = parseUnionType(); Type result = null; if (lexer.lookingAt(TypeLexer.PLUS)) { lexer.eat(TypeLexer.PLUS); result = unit.getNonemptyIterableType(iterated); } else if (lexer.lookingAt(TypeLexer.STAR)) { lexer.eat(TypeLexer.STAR); result = unit.getIterableType(iterated); } else { throw new TypeParserException(STR+lexer.index); } lexer.eat(TypeLexer.CLOSE_BR); return result; }
|
/**
* Spec says:
* <blockquote><pre>
* IterableType: "{" UnionType ("*"|"+") "}"
* </blockquote></pre>
*/
|
Spec says: <code> IterableType: "{" UnionType ("*"|"+") "}" </code>
|
parseIterableAbbreviatedType
|
{
"repo_name": "ceylon/ceylon-model",
"path": "src/com/redhat/ceylon/model/loader/TypeParser.java",
"license": "apache-2.0",
"size": 27925
}
|
[
"com.redhat.ceylon.model.typechecker.model.Type"
] |
import com.redhat.ceylon.model.typechecker.model.Type;
|
import com.redhat.ceylon.model.typechecker.model.*;
|
[
"com.redhat.ceylon"
] |
com.redhat.ceylon;
| 258,251
|
private static void attachModelToResource(RentalAgency model, Resource resource)
{
resource.getContents().add(model);
}
|
static void function(RentalAgency model, Resource resource) { resource.getContents().add(model); }
|
/**
* Store model element in the resource.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
Store model element in the resource.
|
attachModelToResource
|
{
"repo_name": "opcoach/training",
"path": "Old/GMF/com.opcoach.training.rental.diagram/src/com/opcoach/training/rental/diagram/part/RentalDiagramEditorUtil.java",
"license": "epl-1.0",
"size": 13404
}
|
[
"com.opcoach.training.rental.RentalAgency",
"org.eclipse.emf.ecore.resource.Resource"
] |
import com.opcoach.training.rental.RentalAgency; import org.eclipse.emf.ecore.resource.Resource;
|
import com.opcoach.training.rental.*; import org.eclipse.emf.ecore.resource.*;
|
[
"com.opcoach.training",
"org.eclipse.emf"
] |
com.opcoach.training; org.eclipse.emf;
| 605,893
|
public void onClickListGreetings(View unused) {
|
void function(View unused) {
|
/**
* This method is invoked when the "List Greetings" button is clicked. See activity_main.xml for
* the dynamic reference to this method.
*/
|
This method is invoked when the "List Greetings" button is clicked. See activity_main.xml for the dynamic reference to this method
|
onClickListGreetings
|
{
"repo_name": "googlearchive/appengine-endpoints-helloendpoints-android",
"path": "HelloEndpointsProject/HelloEndpoints/src/main/java/com/google/devrel/samples/helloendpoints/MainActivity.java",
"license": "apache-2.0",
"size": 20092
}
|
[
"android.view.View"
] |
import android.view.View;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 2,793,630
|
return createSingleTextPreference(
name, "attribute.displayName." + name, TextDisplay.TEXT, null);
}
|
return createSingleTextPreference( name, STR + name, TextDisplay.TEXT, null); }
|
/**
* Define a single-valued text input preferences. This method is a convenient wrapper for the
* most common expected use case and assumes null values for the default value and a predictable
* label.
*
* @param name
* @param label
* @return
*/
|
Define a single-valued text input preferences. This method is a convenient wrapper for the most common expected use case and assumes null values for the default value and a predictable label
|
createSingleTextPreference
|
{
"repo_name": "jl1955/uPortal5",
"path": "uPortal-portlets/src/main/java/org/apereo/portal/portlets/account/PreferenceInputFactory.java",
"license": "apache-2.0",
"size": 6030
}
|
[
"org.apereo.portal.portletpublishing.xml.TextDisplay"
] |
import org.apereo.portal.portletpublishing.xml.TextDisplay;
|
import org.apereo.portal.portletpublishing.xml.*;
|
[
"org.apereo.portal"
] |
org.apereo.portal;
| 339,178
|
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<PipelineJobOperationStatusInner>> getWithResponseAsync(
String resourceGroupName, String accountName, String pipelineJobName, String operationId, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (pipelineJobName == null) {
return Mono
.error(new IllegalArgumentException("Parameter pipelineJobName is required and cannot be null."));
}
if (operationId == null) {
return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.get(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
pipelineJobName,
operationId,
this.client.getApiVersion(),
accept,
context);
}
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<PipelineJobOperationStatusInner>> function( String resourceGroupName, String accountName, String pipelineJobName, String operationId, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (accountName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (pipelineJobName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (operationId == null) { return Mono.error(new IllegalArgumentException(STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, pipelineJobName, operationId, this.client.getApiVersion(), accept, context); }
|
/**
* Get the operation status of a pipeline job with the given operationId.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The Azure Video Analyzer account name.
* @param pipelineJobName The pipeline job name.
* @param operationId The operation ID.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the operation status of a pipeline job with the given operationId.
*/
|
Get the operation status of a pipeline job with the given operationId
|
getWithResponseAsync
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/videoanalyzer/azure-resourcemanager-videoanalyzer/src/main/java/com/azure/resourcemanager/videoanalyzer/implementation/PipelineJobOperationStatusesClientImpl.java",
"license": "mit",
"size": 12691
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.videoanalyzer.fluent.models.PipelineJobOperationStatusInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.videoanalyzer.fluent.models.PipelineJobOperationStatusInner;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.videoanalyzer.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,467,766
|
static public String printView(NetView v) {
if (v == null)
return "null";
StringBuffer sb = new StringBuffer();
Object leadObj = v.getLeadMember();
InternalDistributedMember lead = leadObj==null? null
: new InternalDistributedMember(v.getLeadMember());
sb.append("[");
Iterator it = v.iterator();
while (it.hasNext()) {
InternalDistributedMember m = (InternalDistributedMember)it.next();
sb.append(m.toString());
if (lead != null && lead.equals(m)) {
sb.append("{lead}");
}
if (it.hasNext())
sb.append(", ");
}
sb.append("]");
return sb.toString();
}
|
static String function(NetView v) { if (v == null) return "null"; StringBuffer sb = new StringBuffer(); Object leadObj = v.getLeadMember(); InternalDistributedMember lead = leadObj==null? null : new InternalDistributedMember(v.getLeadMember()); sb.append("["); Iterator it = v.iterator(); while (it.hasNext()) { InternalDistributedMember m = (InternalDistributedMember)it.next(); sb.append(m.toString()); if (lead != null && lead.equals(m)) { sb.append(STR); } if (it.hasNext()) sb.append(STR); } sb.append("]"); return sb.toString(); }
|
/**
* Print a membership view (list of {@link InternalDistributedMember}s)
*
* @param v the list
* @return String
*/
|
Print a membership view (list of <code>InternalDistributedMember</code>s)
|
printView
|
{
"repo_name": "fengshao0907/incubator-geode",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionManager.java",
"license": "apache-2.0",
"size": 176212
}
|
[
"com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember",
"com.gemstone.gemfire.distributed.internal.membership.NetView",
"java.util.Iterator"
] |
import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; import com.gemstone.gemfire.distributed.internal.membership.NetView; import java.util.Iterator;
|
import com.gemstone.gemfire.distributed.internal.membership.*; import java.util.*;
|
[
"com.gemstone.gemfire",
"java.util"
] |
com.gemstone.gemfire; java.util;
| 2,507,988
|
public static boolean seekForV1OrV11Tag(ByteBuffer byteBuffer)
{
byte[] buffer = new byte[FIELD_TAGID_LENGTH];
// read the TAG value
byteBuffer.get(buffer, 0, FIELD_TAGID_LENGTH);
return (Arrays.equals(buffer, TAG_ID));
}
|
static boolean function(ByteBuffer byteBuffer) { byte[] buffer = new byte[FIELD_TAGID_LENGTH]; byteBuffer.get(buffer, 0, FIELD_TAGID_LENGTH); return (Arrays.equals(buffer, TAG_ID)); }
|
/**
* Does a v1tag or a v11tag exist
*
* @return whether tag exists within the byteBuffer
*/
|
Does a v1tag or a v11tag exist
|
seekForV1OrV11Tag
|
{
"repo_name": "thawee/musixmate",
"path": "library/jaudiotagger226/src/main/java/org/jaudiotagger/tag/id3/AbstractID3v1Tag.java",
"license": "apache-2.0",
"size": 5166
}
|
[
"java.nio.ByteBuffer",
"java.util.Arrays"
] |
import java.nio.ByteBuffer; import java.util.Arrays;
|
import java.nio.*; import java.util.*;
|
[
"java.nio",
"java.util"
] |
java.nio; java.util;
| 1,515,575
|
public static void writeData(Tag tag, SodfWrapper data, SodfCallback callback) throws CompressionAlgorithmNotFoundException{
if (data.compressionAlgorithm == null) SodfFramework.writeData(tag, data.data, data.app, callback, null);
else SodfFramework.writeData(tag, data.data, data.app, callback, Compressor.alogrithmSelector(data.compressionAlgorithm));
}
|
static void function(Tag tag, SodfWrapper data, SodfCallback callback) throws CompressionAlgorithmNotFoundException{ if (data.compressionAlgorithm == null) SodfFramework.writeData(tag, data.data, data.app, callback, null); else SodfFramework.writeData(tag, data.data, data.app, callback, Compressor.alogrithmSelector(data.compressionAlgorithm)); }
|
/**
* Write data on a NFC tag.
* @param tag The tag where the data is written on
* @param data The data set, which is written on the tag
* @throws CompressionAlgorithmNotFoundException If the specified compression in the data was not found and is not null
*/
|
Write data on a NFC tag
|
writeData
|
{
"repo_name": "LAL-Apps/sodf",
"path": "SmartFoodEnvironment/src/lal/sodf/framework/SodfFramework.java",
"license": "mit",
"size": 5553
}
|
[
"android.nfc.Tag"
] |
import android.nfc.Tag;
|
import android.nfc.*;
|
[
"android.nfc"
] |
android.nfc;
| 2,307,740
|
String submac = macAddress.substring(0, 8).toLowerCase(Locale.UK);
try {
ArrayList<Vendor> vendorList = Vendor.getByMac(submac);
if (vendorList.size() > 0) {
return Vendor.getByMac(submac).get(0);
}
} catch (EvercamException e) {
if (Constants.ENABLE_LOGGING) {
e.printStackTrace();
}
return null;
}
return null;
}
|
String submac = macAddress.substring(0, 8).toLowerCase(Locale.UK); try { ArrayList<Vendor> vendorList = Vendor.getByMac(submac); if (vendorList.size() > 0) { return Vendor.getByMac(submac).get(0); } } catch (EvercamException e) { if (Constants.ENABLE_LOGGING) { e.printStackTrace(); } return null; } return null; }
|
/**
* Query Evercam API to get camera vendor by MAC address.
*
* @param macAddress
* Full MAC address read from device.
*/
|
Query Evercam API to get camera vendor by MAC address
|
getCameraVendorByMac
|
{
"repo_name": "evercam/evercam-discovery-java",
"path": "src/io/evercam/network/query/EvercamQuery.java",
"license": "apache-2.0",
"size": 6861
}
|
[
"io.evercam.EvercamException",
"io.evercam.Vendor",
"io.evercam.network.Constants",
"java.util.ArrayList",
"java.util.Locale"
] |
import io.evercam.EvercamException; import io.evercam.Vendor; import io.evercam.network.Constants; import java.util.ArrayList; import java.util.Locale;
|
import io.evercam.*; import io.evercam.network.*; import java.util.*;
|
[
"io.evercam",
"io.evercam.network",
"java.util"
] |
io.evercam; io.evercam.network; java.util;
| 168,534
|
public CloudObject asCloudObject();
/**
* Returns true if the coding is deterministic.
*
* <p> In order for a {@code Coder} to be considered deterministic,
* the following must be true:
* <ul>
* <li>two values that compare as equal (via {@code Object.equals()}
|
CloudObject function(); /** * Returns true if the coding is deterministic. * * <p> In order for a {@code Coder} to be considered deterministic, * the following must be true: * <ul> * <li>two values that compare as equal (via {@code Object.equals()}
|
/**
* Returns the {@link CloudObject} that represents this {@code Coder}.
*/
|
Returns the <code>CloudObject</code> that represents this Coder
|
asCloudObject
|
{
"repo_name": "haocafes/DataflowJavaSDK",
"path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/coders/Coder.java",
"license": "apache-2.0",
"size": 9037
}
|
[
"com.google.cloud.dataflow.sdk.util.CloudObject"
] |
import com.google.cloud.dataflow.sdk.util.CloudObject;
|
import com.google.cloud.dataflow.sdk.util.*;
|
[
"com.google.cloud"
] |
com.google.cloud;
| 2,396,903
|
static double[] calculatePrecessionCorrection(double rightAscensionRad, double declinationRad, ZonedDateTime observationTime) {
double deltaT = observationTime.until(j2000Reference, ChronoUnit.SECONDS) / 365.0 / 86400.0;
double deltaRightAscension = (precessionFactorM + precessionFactorN * Math.sin(rightAscensionRad) * Math.tan(declinationRad)) * deltaT;
double deltaDeclination = precessionFactorN * Math.cos(rightAscensionRad) * deltaT;
return new double[]{deltaRightAscension, deltaDeclination};
}
|
static double[] calculatePrecessionCorrection(double rightAscensionRad, double declinationRad, ZonedDateTime observationTime) { double deltaT = observationTime.until(j2000Reference, ChronoUnit.SECONDS) / 365.0 / 86400.0; double deltaRightAscension = (precessionFactorM + precessionFactorN * Math.sin(rightAscensionRad) * Math.tan(declinationRad)) * deltaT; double deltaDeclination = precessionFactorN * Math.cos(rightAscensionRad) * deltaT; return new double[]{deltaRightAscension, deltaDeclination}; }
|
/**
* Calculate the corrections for right ascension in declination
* that are needed because of Earth's precession.
* <p>
* The formulas are approximations found here
* http://www.cv.nrao.edu/~rfisher/Ephemerides/earth_rot.html
* <p>
* TODO Check with the "Explanatory Supplements for the Astronomical Almanac"
*
* @param rightAscensionRad
* @param declinationRad
* @param observationTime
* @return correction for right ascension, declination in radians
*/
|
Calculate the corrections for right ascension in declination that are needed because of Earth's precession. The formulas are approximations found here HREF TODO Check with the "Explanatory Supplements for the Astronomical Almanac"
|
calculatePrecessionCorrection
|
{
"repo_name": "fact-project/fact-tools",
"path": "src/main/java/fact/coordinates/EquatorialCoordinate.java",
"license": "gpl-3.0",
"size": 6154
}
|
[
"java.time.ZonedDateTime",
"java.time.temporal.ChronoUnit"
] |
import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit;
|
import java.time.*; import java.time.temporal.*;
|
[
"java.time"
] |
java.time;
| 218,113
|
@Override
protected Connection chooseConnection(final RequestMessage msg) throws TimeoutException, ConnectionException {
final Iterator<Host> possibleHosts = this.cluster.loadBalancingStrategy().select(msg);
if (!possibleHosts.hasNext()) throw new TimeoutException("Timed out waiting for an available host.");
final Host bestHost = this.cluster.loadBalancingStrategy().select(msg).next();
final ConnectionPool pool = hostConnectionPools.get(bestHost);
return pool.borrowConnection(cluster.connectionPoolSettings().maxWaitForConnection, TimeUnit.MILLISECONDS);
}
|
Connection function(final RequestMessage msg) throws TimeoutException, ConnectionException { final Iterator<Host> possibleHosts = this.cluster.loadBalancingStrategy().select(msg); if (!possibleHosts.hasNext()) throw new TimeoutException(STR); final Host bestHost = this.cluster.loadBalancingStrategy().select(msg).next(); final ConnectionPool pool = hostConnectionPools.get(bestHost); return pool.borrowConnection(cluster.connectionPoolSettings().maxWaitForConnection, TimeUnit.MILLISECONDS); }
|
/**
* Uses a {@link LoadBalancingStrategy} to choose the best {@link Host} and then selects the best connection
* from that host's connection pool.
*/
|
Uses a <code>LoadBalancingStrategy</code> to choose the best <code>Host</code> and then selects the best connection from that host's connection pool
|
chooseConnection
|
{
"repo_name": "dalaro/incubator-tinkerpop",
"path": "gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Client.java",
"license": "apache-2.0",
"size": 23065
}
|
[
"java.util.Iterator",
"java.util.concurrent.TimeUnit",
"java.util.concurrent.TimeoutException",
"org.apache.tinkerpop.gremlin.driver.exception.ConnectionException",
"org.apache.tinkerpop.gremlin.driver.message.RequestMessage"
] |
import java.util.Iterator; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.apache.tinkerpop.gremlin.driver.exception.ConnectionException; import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
|
import java.util.*; import java.util.concurrent.*; import org.apache.tinkerpop.gremlin.driver.exception.*; import org.apache.tinkerpop.gremlin.driver.message.*;
|
[
"java.util",
"org.apache.tinkerpop"
] |
java.util; org.apache.tinkerpop;
| 1,171,429
|
public ServiceResponse listMethods(final ServiceRequest request) throws SOAPException;
|
ServiceResponse function(final ServiceRequest request) throws SOAPException;
|
/**
* Calls listMethods meta service that lists all the services offered by a
* service provider. Returns a list of ProducerMember objects wrapped in
* ServiceResponse object's responseData variable.
*
* @param request the ServiceRequest object to be sent
* @return ServiceResponse that holds a list of ProducerMember objects
* @throws SOAPException if there's a SOAP error
*/
|
Calls listMethods meta service that lists all the services offered by a service provider. Returns a list of ProducerMember objects wrapped in ServiceResponse object's responseData variable
|
listMethods
|
{
"repo_name": "petkivim/xrd4j",
"path": "src/client/src/main/java/com/pkrete/xrd4j/client/LoadBalancedSOAPClient.java",
"license": "mit",
"size": 4429
}
|
[
"com.pkrete.xrd4j.common.message.ServiceRequest",
"com.pkrete.xrd4j.common.message.ServiceResponse",
"javax.xml.soap.SOAPException"
] |
import com.pkrete.xrd4j.common.message.ServiceRequest; import com.pkrete.xrd4j.common.message.ServiceResponse; import javax.xml.soap.SOAPException;
|
import com.pkrete.xrd4j.common.message.*; import javax.xml.soap.*;
|
[
"com.pkrete.xrd4j",
"javax.xml"
] |
com.pkrete.xrd4j; javax.xml;
| 2,153,876
|
VariableDeclaration getVarDecl();
|
VariableDeclaration getVarDecl();
|
/**
* Returns the value of the '<em><b>Var Decl</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Var Decl</em>' containment reference.
* @see #setVarDecl(VariableDeclaration)
* @see de.uni_hildesheim.sse.vil.rt.rtVil.RtVilPackage#getBreakdownElement_VarDecl()
* @model containment="true"
* @generated
*/
|
Returns the value of the 'Var Decl' containment reference.
|
getVarDecl
|
{
"repo_name": "SSEHUB/EASyProducer",
"path": "Plugins/Instantiation/de.uni_hildesheim.sse.vil.rt/src-gen/de/uni_hildesheim/sse/vil/rt/rtVil/BreakdownElement.java",
"license": "apache-2.0",
"size": 3562
}
|
[
"de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration"
] |
import de.uni_hildesheim.sse.vil.expressions.expressionDsl.VariableDeclaration;
|
import de.uni_hildesheim.sse.vil.expressions.*;
|
[
"de.uni_hildesheim.sse"
] |
de.uni_hildesheim.sse;
| 474,054
|
public ComponentDetailView getComponentDetails(String componentId);
|
ComponentDetailView function(String componentId);
|
/**
* Return the details object of the component attached to the given id. (the
* full view)
*
* @param componentId
* @return
*/
|
Return the details object of the component attached to the given id. (the full view)
|
getComponentDetails
|
{
"repo_name": "tyler-travis/openstorefront",
"path": "server/openstorefront/openstorefront-core/model/src/main/java/edu/usu/sdl/openstorefront/core/api/ComponentService.java",
"license": "apache-2.0",
"size": 14837
}
|
[
"edu.usu.sdl.openstorefront.core.view.ComponentDetailView"
] |
import edu.usu.sdl.openstorefront.core.view.ComponentDetailView;
|
import edu.usu.sdl.openstorefront.core.view.*;
|
[
"edu.usu.sdl"
] |
edu.usu.sdl;
| 1,173,240
|
private void addTrip() {
// Show a dialog box
dialog = new MaterialDialog.Builder(AddNewTrip.this)
.title(R.string.app_name)
.content("Please wait...")
.progress(true, 0)
.show();
String uri = Constants.apilink + "trip/add-trip.php?user=" + userid +
"&title=" + tripname +
"&start_time=" + startdate +
"&city=" + cityid;
Log.e("CALLING : ", uri);
|
void function() { dialog = new MaterialDialog.Builder(AddNewTrip.this) .title(R.string.app_name) .content(STR) .progress(true, 0) .show(); String uri = Constants.apilink + STR + userid + STR + tripname + STR + startdate + STR + cityid; Log.e(STR, uri);
|
/**
* Calls API to add new trip
*/
|
Calls API to add new trip
|
addTrip
|
{
"repo_name": "gugakatsi/Travel-Mate",
"path": "Android/app/src/main/java/tie/hackathon/travelguide/AddNewTrip.java",
"license": "mit",
"size": 9982
}
|
[
"android.util.Log",
"com.afollestad.materialdialogs.MaterialDialog"
] |
import android.util.Log; import com.afollestad.materialdialogs.MaterialDialog;
|
import android.util.*; import com.afollestad.materialdialogs.*;
|
[
"android.util",
"com.afollestad.materialdialogs"
] |
android.util; com.afollestad.materialdialogs;
| 1,341,045
|
private DatagramSocket openNetworkSocket () throws SQLException {
// Use a MulticastSocket (rather than a DatagramSocket) to allow multiple nodes on the same machine to bind to the same port.
// Configure the Multicast socket to send/receive using any local address, or bind the multicast socket to a specific address..
// Note that binding to a specific address can prevent multicast from finding other nodes.
MulticastSocket skt = null;
try {
discoveryPort = GaianDBConfig.getDiscoveryPort(); // set port which we will send messages to...
skt = new MulticastSocket(); // ... but create a socket based on a dynamically allocated free port (this is where we will receive ACK responses)
String defaultIP = getDefaultLocalIP();
defaultInterface = InetAddress.getByName(defaultIP); // don't use skt.getInterface() as it picks "0.0.0.0" on linux
// This parameter allows the packet to traverse multiple routers.
skt.setTimeToLive(50);
// Hard coded multicast address that all GaianDB nodes will join
joinMulticastGroupPerInterface( skt, DEFAULT_MULTICAST_GROUP_ADDRESS );
skt.setSoTimeout(DISCOVERY_TIMEOUT);
} catch ( Exception e ) {
String msg = "Failed to open Discovery Socket. POSSIBLE LACK OF NETWORK CONNECTIVITY: "+e;
logger.logWarning(GDBMessages.DISCOVERY_NETWORK_SOCKET_OPEN_ERROR, msg);
throw new SQLException(msg);
}
return skt;
// try {
// return new DatagramSocket();
// } catch (SocketException e) {
// String msg = "Failed to open Discovery Socket. POSSIBLE LACK OF NETWORK CONNECTIVITY: "+e;
// logger.logWarning(GDBMessages.DISCOVERY_NETWORK_SOCKET_OPEN_ERROR, msg);
// throw new SQLException(msg);
// }
}
|
DatagramSocket function () throws SQLException { MulticastSocket skt = null; try { discoveryPort = GaianDBConfig.getDiscoveryPort(); skt = new MulticastSocket(); String defaultIP = getDefaultLocalIP(); defaultInterface = InetAddress.getByName(defaultIP); skt.setTimeToLive(50); joinMulticastGroupPerInterface( skt, DEFAULT_MULTICAST_GROUP_ADDRESS ); skt.setSoTimeout(DISCOVERY_TIMEOUT); } catch ( Exception e ) { String msg = STR+e; logger.logWarning(GDBMessages.DISCOVERY_NETWORK_SOCKET_OPEN_ERROR, msg); throw new SQLException(msg); } return skt; }
|
/**
* This method prepares the necessary socket for network discovery of gaian nodes
*/
|
This method prepares the necessary socket for network discovery of gaian nodes
|
openNetworkSocket
|
{
"repo_name": "gaiandb/gaiandb",
"path": "java/Prototype/Connectors/com/ibm/gaiandb/jdbc/discoveryclient/GaianConnectionSeeker.java",
"license": "epl-1.0",
"size": 26244
}
|
[
"com.ibm.gaiandb.GaianDBConfig",
"com.ibm.gaiandb.diags.GDBMessages",
"java.net.DatagramSocket",
"java.net.InetAddress",
"java.net.MulticastSocket",
"java.sql.SQLException"
] |
import com.ibm.gaiandb.GaianDBConfig; import com.ibm.gaiandb.diags.GDBMessages; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.MulticastSocket; import java.sql.SQLException;
|
import com.ibm.gaiandb.*; import com.ibm.gaiandb.diags.*; import java.net.*; import java.sql.*;
|
[
"com.ibm.gaiandb",
"java.net",
"java.sql"
] |
com.ibm.gaiandb; java.net; java.sql;
| 2,023,476
|
private Node generateCritRefElementRef(Node outboundRelElem, Node elementRefNode, XmlProcessor hqmfXmlProcessor)
throws XPathExpressionException {
String ext = getElementRefExt(elementRefNode, measureExport.getSimpleXMLProcessor());
String root = elementRefNode.getAttributes().getNamedItem(ID).getNodeValue();
Node idNodeQDM = hqmfXmlProcessor.findNode(hqmfXmlProcessor.getOriginalDoc(),
"//entry/*/id[@root=\"" + root + "\"][@extension=\"" + ext + "\"]");
if (idNodeQDM != null) {
Node parent = idNodeQDM.getParentNode();
if (parent != null) {
NamedNodeMap attribMap = parent.getAttributes();
String classCode = attribMap.getNamedItem(CLASS_CODE).getNodeValue();
String moodCode = attribMap.getNamedItem(MOOD_CODE).getNodeValue();
// create criteriaRef
Element criteriaReference = hqmfXmlProcessor.getOriginalDoc().createElement(CRITERIA_REFERENCE);
criteriaReference.setAttribute(CLASS_CODE, classCode);
criteriaReference.setAttribute(MOOD_CODE, moodCode);
Element id = hqmfXmlProcessor.getOriginalDoc().createElement(ID);
id.setAttribute(ROOT, root);
id.setAttribute(EXTENSION, ext);
criteriaReference.appendChild(id);
outboundRelElem.appendChild(criteriaReference);
// return <entry> element
return parent.getParentNode();
}
} else {
// check if this is a measurement period
String displayName = elementRefNode.getAttributes().getNamedItem(DISPLAY_NAME).getNodeValue();
if ("Measurement Period : Timing Element".equals(displayName)) {
// create criteriaRef
Element criteriaReference = hqmfXmlProcessor.getOriginalDoc().createElement(CRITERIA_REFERENCE);
criteriaReference.setAttribute(CLASS_CODE, "OBS");
criteriaReference.setAttribute(MOOD_CODE, "EVN");
Element id = hqmfXmlProcessor.getOriginalDoc().createElement(ID);
id.setAttribute(ROOT, elementRefNode.getAttributes().getNamedItem(ID).getNodeValue());
id.setAttribute(EXTENSION, "measureperiod");
criteriaReference.appendChild(id);
outboundRelElem.appendChild(criteriaReference);
}
}
return null;
}
|
Node function(Node outboundRelElem, Node elementRefNode, XmlProcessor hqmfXmlProcessor) throws XPathExpressionException { String ext = getElementRefExt(elementRefNode, measureExport.getSimpleXMLProcessor()); String root = elementRefNode.getAttributes().getNamedItem(ID).getNodeValue(); Node idNodeQDM = hqmfXmlProcessor.findNode(hqmfXmlProcessor.getOriginalDoc(), STRMeasurement Period : Timing ElementSTROBSSTREVNSTRmeasureperiod"); criteriaReference.appendChild(id); outboundRelElem.appendChild(criteriaReference); } } return null; }
|
/**
* Generate crit ref element ref.
*
* @param outboundRelElem
* the outbound rel elem
* @param elementRefNode
* the element ref node
* @param hqmfXmlProcessor
* the hqmf xml processor
* @return the node
* @throws XPathExpressionException
* the x path expression exception
*/
|
Generate crit ref element ref
|
generateCritRefElementRef
|
{
"repo_name": "MeasureAuthoringTool/MeasureAuthoringTool_LatestSprint",
"path": "mat/src/main/java/mat/server/hqmf/qdm_5_4/HQMFClauseLogicGenerator.java",
"license": "cc0-1.0",
"size": 134287
}
|
[
"javax.xml.xpath.XPathExpressionException",
"org.w3c.dom.Node"
] |
import javax.xml.xpath.XPathExpressionException; import org.w3c.dom.Node;
|
import javax.xml.xpath.*; import org.w3c.dom.*;
|
[
"javax.xml",
"org.w3c.dom"
] |
javax.xml; org.w3c.dom;
| 1,109,488
|
protected String getColumnList(List<String> columns) {
StringBuilder b=new StringBuilder();
boolean first=true;
for (String column:columns) {
if (!first) {
b.append(",");
} else {
first =false;
}
b.append(column);
}
return b.toString();
}
|
String function(List<String> columns) { StringBuilder b=new StringBuilder(); boolean first=true; for (String column:columns) { if (!first) { b.append(","); } else { first =false; } b.append(column); } return b.toString(); }
|
/**
* Takes a list of columns as <code>String</code> values and returns them as
* a <code>String</code> of comma-separated values.
*
* @param columns
* - The list of columns to process.
* @return A <code>String</code> of comma-separated values.
*/
|
Takes a list of columns as <code>String</code> values and returns them as a <code>String</code> of comma-separated values
|
getColumnList
|
{
"repo_name": "dotCMS/core",
"path": "dotCMS/src/main/java/com/dotmarketing/startup/AbstractJDBCStartupTask.java",
"license": "gpl-3.0",
"size": 55065
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,912,037
|
public static Task getTask( String grassXml ) throws Exception {
String featureNamespaces = "http://xml.org/sax/features/namespaces";
String featureNamespacePrefixes = "http://xml.org/sax/features/namespace-prefixes";
JAXBContext jaxbContext = JAXBContext.newInstance(GrassInterface.class);
|
static Task function( String grassXml ) throws Exception { String featureNamespaces = STRhttp: JAXBContext jaxbContext = JAXBContext.newInstance(GrassInterface.class);
|
/**
* Get the jaxb grass {@link Task} for a given xml string.
*
* @param grassXml te xml string to parse.
* @return the grass task.
* @throws Exception
*/
|
Get the jaxb grass <code>Task</code> for a given xml string
|
getTask
|
{
"repo_name": "silviafranceschi/jgrasstools",
"path": "grass/src/main/java/org/jgrasstools/grass/utils/GrassUtils.java",
"license": "gpl-3.0",
"size": 23336
}
|
[
"javax.xml.bind.JAXBContext",
"org.jgrasstools.grass.dtd64.GrassInterface",
"org.jgrasstools.grass.dtd64.Task"
] |
import javax.xml.bind.JAXBContext; import org.jgrasstools.grass.dtd64.GrassInterface; import org.jgrasstools.grass.dtd64.Task;
|
import javax.xml.bind.*; import org.jgrasstools.grass.dtd64.*;
|
[
"javax.xml",
"org.jgrasstools.grass"
] |
javax.xml; org.jgrasstools.grass;
| 1,195,684
|
public PlayQueueInfo getPlayQueue() throws Exception {
HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
HttpServletResponse response = WebContextFactory.get().getHttpServletResponse();
Player player = getCurrentPlayer(request, response);
return convert(request, player, false);
}
|
PlayQueueInfo function() throws Exception { HttpServletRequest request = WebContextFactory.get().getHttpServletRequest(); HttpServletResponse response = WebContextFactory.get().getHttpServletResponse(); Player player = getCurrentPlayer(request, response); return convert(request, player, false); }
|
/**
* Returns the play queue for the player of the current user.
*
* @return The play queue.
*/
|
Returns the play queue for the player of the current user
|
getPlayQueue
|
{
"repo_name": "langera/libresonic",
"path": "libresonic-main/src/main/java/org/libresonic/player/ajax/PlayQueueService.java",
"license": "gpl-3.0",
"size": 34299
}
|
[
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.directwebremoting.WebContextFactory",
"org.libresonic.player.domain.Player"
] |
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.directwebremoting.WebContextFactory; import org.libresonic.player.domain.Player;
|
import javax.servlet.http.*; import org.directwebremoting.*; import org.libresonic.player.domain.*;
|
[
"javax.servlet",
"org.directwebremoting",
"org.libresonic.player"
] |
javax.servlet; org.directwebremoting; org.libresonic.player;
| 437,292
|
@Override
public void writeMappings(Collection<IMappingConsumer> consumers) {
MappingSet<MappingField> fields = new MappingSet<MappingField>();
MappingSet<MappingMethod> methods = new MappingSet<MappingMethod>();
for (IMappingConsumer mappings : consumers) {
fields.addAll(mappings.getFieldMappings(this.type));
methods.addAll(mappings.getMethodMappings(this.type));
}
this.mappingWriter.write(this.outFileName, this.type, fields, methods);
}
|
void function(Collection<IMappingConsumer> consumers) { MappingSet<MappingField> fields = new MappingSet<MappingField>(); MappingSet<MappingMethod> methods = new MappingSet<MappingMethod>(); for (IMappingConsumer mappings : consumers) { fields.addAll(mappings.getFieldMappings(this.type)); methods.addAll(mappings.getMethodMappings(this.type)); } this.mappingWriter.write(this.outFileName, this.type, fields, methods); }
|
/**
* Write out generated mappings
*/
|
Write out generated mappings
|
writeMappings
|
{
"repo_name": "SpongePowered/Mixin",
"path": "src/ap/java/org/spongepowered/tools/obfuscation/ObfuscationEnvironment.java",
"license": "mit",
"size": 13111
}
|
[
"java.util.Collection",
"org.spongepowered.asm.obfuscation.mapping.common.MappingField",
"org.spongepowered.asm.obfuscation.mapping.common.MappingMethod",
"org.spongepowered.tools.obfuscation.mapping.IMappingConsumer"
] |
import java.util.Collection; import org.spongepowered.asm.obfuscation.mapping.common.MappingField; import org.spongepowered.asm.obfuscation.mapping.common.MappingMethod; import org.spongepowered.tools.obfuscation.mapping.IMappingConsumer;
|
import java.util.*; import org.spongepowered.asm.obfuscation.mapping.common.*; import org.spongepowered.tools.obfuscation.mapping.*;
|
[
"java.util",
"org.spongepowered.asm",
"org.spongepowered.tools"
] |
java.util; org.spongepowered.asm; org.spongepowered.tools;
| 982,949
|
private static ContextMenuCoordinator openContextMenuByJs(Tab tab, String jsCode)
throws TimeoutException {
final OnContextMenuShownHelper helper = new OnContextMenuShownHelper();
ContextMenuHelper.setMenuShownCallbackForTests((coordinator) -> {
helper.notifyCalled(coordinator);
ContextMenuHelper.setMenuShownCallbackForTests(null);
});
int callCount = helper.getCallCount();
DOMUtils.longPressNodeByJs(tab.getWebContents(), jsCode);
helper.waitForCallback(callCount);
return helper.getContextMenuCoordinator();
}
|
static ContextMenuCoordinator function(Tab tab, String jsCode) throws TimeoutException { final OnContextMenuShownHelper helper = new OnContextMenuShownHelper(); ContextMenuHelper.setMenuShownCallbackForTests((coordinator) -> { helper.notifyCalled(coordinator); ContextMenuHelper.setMenuShownCallbackForTests(null); }); int callCount = helper.getCallCount(); DOMUtils.longPressNodeByJs(tab.getWebContents(), jsCode); helper.waitForCallback(callCount); return helper.getContextMenuCoordinator(); }
|
/**
* Opens a context menu.
* @param tab The tab to open a context menu for.
* @param jsCode The javascript to get the DOM node to long press to
* open the context menu for.
* @return The {@link ContextMenuCoordinator} of the context menu.
* @throws TimeoutException
*/
|
Opens a context menu
|
openContextMenuByJs
|
{
"repo_name": "ric2b/Vivaldi-browser",
"path": "chromium/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java",
"license": "bsd-3-clause",
"size": 10840
}
|
[
"java.util.concurrent.TimeoutException",
"org.chromium.chrome.browser.contextmenu.ContextMenuCoordinator",
"org.chromium.chrome.browser.contextmenu.ContextMenuHelper",
"org.chromium.chrome.browser.tab.Tab",
"org.chromium.content_public.browser.test.util.DOMUtils"
] |
import java.util.concurrent.TimeoutException; import org.chromium.chrome.browser.contextmenu.ContextMenuCoordinator; import org.chromium.chrome.browser.contextmenu.ContextMenuHelper; import org.chromium.chrome.browser.tab.Tab; import org.chromium.content_public.browser.test.util.DOMUtils;
|
import java.util.concurrent.*; import org.chromium.chrome.browser.contextmenu.*; import org.chromium.chrome.browser.tab.*; import org.chromium.content_public.browser.test.util.*;
|
[
"java.util",
"org.chromium.chrome",
"org.chromium.content_public"
] |
java.util; org.chromium.chrome; org.chromium.content_public;
| 2,588,214
|
void pathTailNotFound(TreePath tp, Object source);
|
void pathTailNotFound(TreePath tp, Object source);
|
/**
* reached end of branch in source before end of specified path -
* the specified path does not exist in the source
*
* @param tp TODO
* @param source TODO
*/
|
reached end of branch in source before end of specified path - the specified path does not exist in the source
|
pathTailNotFound
|
{
"repo_name": "netplex/json-smart-v2",
"path": "json-smart-action/src/main/java/net/minidev/json/actions/navigate/NavigateAction.java",
"license": "apache-2.0",
"size": 3567
}
|
[
"net.minidev.json.actions.path.TreePath"
] |
import net.minidev.json.actions.path.TreePath;
|
import net.minidev.json.actions.path.*;
|
[
"net.minidev.json"
] |
net.minidev.json;
| 1,516,897
|
public String getOriginatingServletPath(HttpServletRequest request) {
String servletPath = (String) request.getAttribute(WebUtils.FORWARD_SERVLET_PATH_ATTRIBUTE);
if (servletPath == null) {
servletPath = request.getServletPath();
}
return servletPath;
}
|
String function(HttpServletRequest request) { String servletPath = (String) request.getAttribute(WebUtils.FORWARD_SERVLET_PATH_ATTRIBUTE); if (servletPath == null) { servletPath = request.getServletPath(); } return servletPath; }
|
/**
* Return the servlet path for the given request, detecting an include request
* URL if called within a RequestDispatcher include.
* @param request current HTTP request
* @return the servlet path
*/
|
Return the servlet path for the given request, detecting an include request URL if called within a RequestDispatcher include
|
getOriginatingServletPath
|
{
"repo_name": "leogoing/spring_jeesite",
"path": "spring-web-4.0/org/springframework/web/util/UrlPathHelper.java",
"license": "apache-2.0",
"size": 20664
}
|
[
"javax.servlet.http.HttpServletRequest"
] |
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.*;
|
[
"javax.servlet"
] |
javax.servlet;
| 1,244,063
|
public static String flavor(int flavor) {
// flavors = { DISABLEOVERRIDE, RESTRICTED, TRANSLATE }
// !DISABLEOVERRIDE = ENABLEOVERRIDE
// !RESTRICTED = TOSUBCLASS
// !TRANSLATE = ?
StringBuffer buf = new StringBuffer();
buf.append(((flavor & CIMFlavor.DISABLEOVERRIDE) > 0 ? DISABLEOVERRIDE : ENABLEOVERRIDE));
buf.append(' ' + ((flavor & CIMFlavor.RESTRICTED) > 0 ? RESTRICTED : TOSUBCLASS));
if ((flavor & CIMFlavor.TRANSLATE) > 0) buf.append(' ' + TRANSLATABLE);
return buf.toString();
}
|
static String function(int flavor) { StringBuffer buf = new StringBuffer(); buf.append(((flavor & CIMFlavor.DISABLEOVERRIDE) > 0 ? DISABLEOVERRIDE : ENABLEOVERRIDE)); buf.append(' ' + ((flavor & CIMFlavor.RESTRICTED) > 0 ? RESTRICTED : TOSUBCLASS)); if ((flavor & CIMFlavor.TRANSLATE) > 0) buf.append(' ' + TRANSLATABLE); return buf.toString(); }
|
/**
* <pre>
* flavor = ENABLEOVERRIDE | DISABLEOVERRIDE | RESTRICTED | TOSUBCLASS | TRANSLATABLE
* </pre>
*
* @param flavor
* @return the MOF string
*/
|
<code> flavor = ENABLEOVERRIDE | DISABLEOVERRIDE | RESTRICTED | TOSUBCLASS | TRANSLATABLE </code>
|
flavor
|
{
"repo_name": "acleasby/sblim2",
"path": "src/main/java/org/sblim/cimclient/internal/util/MOF.java",
"license": "epl-1.0",
"size": 25698
}
|
[
"javax.cim.CIMFlavor"
] |
import javax.cim.CIMFlavor;
|
import javax.cim.*;
|
[
"javax.cim"
] |
javax.cim;
| 729,098
|
@Override
public void write(byte b[], int off, int len) throws IOException
{
checkThreshold(len);
getStream().write(b, off, len);
written += len;
}
|
void function(byte b[], int off, int len) throws IOException { checkThreshold(len); getStream().write(b, off, len); written += len; }
|
/**
* Writes <code>len</code> bytes from the specified byte array starting at
* offset <code>off</code> to this output stream.
*
* @param b The byte array from which the data will be written.
* @param off The start offset in the byte array.
* @param len The number of bytes to write.
*
* @exception IOException if an error occurs.
*/
|
Writes <code>len</code> bytes from the specified byte array starting at offset <code>off</code> to this output stream
|
write
|
{
"repo_name": "plumer/codana",
"path": "tomcat_files/7.0.0/ThresholdingOutputStream.java",
"license": "mit",
"size": 7316
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,605,320
|
protected void doPaintObjects(PaintPanel panel, Graphics g, List<Polygon> locations) {
String label;
Rectangle rect;
Color labelColor;
labelColor = getColor();
g.setFont(getLabelFont());
for (Polygon poly : locations) {
if (poly == null)
continue;
if (getUseColorsPerType()) {
if (m_Overlays.hasColor(poly))
labelColor = m_Overlays.getColor(poly);
}
rect = poly.getBounds();
g.setColor(labelColor);
if (m_Diameter < 1)
g.fillOval((int) rect.getX(), (int) rect.getY(), (int) rect.getWidth(), (int) rect.getHeight());
else
g.fillOval((int) (rect.getCenterX() - m_Diameter), (int) (rect.getCenterY() - m_Diameter), m_Diameter*2, m_Diameter*2);
if (m_Overlays.hasLabel(poly)) {
g.setColor(labelColor);
label = m_Overlays.getLabel(poly);
if ((label != null) && !label.isEmpty())
m_Overlays.drawString(g, rect, label);
}
}
}
|
void function(PaintPanel panel, Graphics g, List<Polygon> locations) { String label; Rectangle rect; Color labelColor; labelColor = getColor(); g.setFont(getLabelFont()); for (Polygon poly : locations) { if (poly == null) continue; if (getUseColorsPerType()) { if (m_Overlays.hasColor(poly)) labelColor = m_Overlays.getColor(poly); } rect = poly.getBounds(); g.setColor(labelColor); if (m_Diameter < 1) g.fillOval((int) rect.getX(), (int) rect.getY(), (int) rect.getWidth(), (int) rect.getHeight()); else g.fillOval((int) (rect.getCenterX() - m_Diameter), (int) (rect.getCenterY() - m_Diameter), m_Diameter*2, m_Diameter*2); if (m_Overlays.hasLabel(poly)) { g.setColor(labelColor); label = m_Overlays.getLabel(poly); if ((label != null) && !label.isEmpty()) m_Overlays.drawString(g, rect, label); } } }
|
/**
* Performs the actual painting of the objects.
*
* @param panel the panel this overlay is for
* @param g the graphics context
* @param locations the locations to paint
*/
|
Performs the actual painting of the objects
|
doPaintObjects
|
{
"repo_name": "waikato-datamining/adams-base",
"path": "adams-imaging/src/main/java/adams/gui/visualization/image/SimplePointOverlayFromReport.java",
"license": "gpl-3.0",
"size": 4393
}
|
[
"java.awt.Color",
"java.awt.Graphics",
"java.awt.Polygon",
"java.awt.Rectangle",
"java.util.List"
] |
import java.awt.Color; import java.awt.Graphics; import java.awt.Polygon; import java.awt.Rectangle; import java.util.List;
|
import java.awt.*; import java.util.*;
|
[
"java.awt",
"java.util"
] |
java.awt; java.util;
| 1,571,375
|
public void handleGET(CoapExchange exchange) {
exchange.respond(ResponseCode.METHOD_NOT_ALLOWED);
}
|
void function(CoapExchange exchange) { exchange.respond(ResponseCode.METHOD_NOT_ALLOWED); }
|
/**
* Handles the GET request in the given CoAPExchange. By default it responds
* with a 4.05 (Method Not Allowed). Override this method to respond
* differently to GET requests. Possible response codes for GET requests are
* Content (2.05) and Valid (2.03).
*
* @param exchange the CoapExchange for the simple API
*/
|
Handles the GET request in the given CoAPExchange. By default it responds with a 4.05 (Method Not Allowed). Override this method to respond differently to GET requests. Possible response codes for GET requests are Content (2.05) and Valid (2.03)
|
handleGET
|
{
"repo_name": "iotoasis/SI",
"path": "si-onem2m-src/IITP_IoT_2_7/src/extlib/java/org/eclipse/californium/core/CoapResource.java",
"license": "bsd-2-clause",
"size": 28416
}
|
[
"org.eclipse.californium.core.coap.CoAP",
"org.eclipse.californium.core.server.resources.CoapExchange"
] |
import org.eclipse.californium.core.coap.CoAP; import org.eclipse.californium.core.server.resources.CoapExchange;
|
import org.eclipse.californium.core.coap.*; import org.eclipse.californium.core.server.resources.*;
|
[
"org.eclipse.californium"
] |
org.eclipse.californium;
| 1,913,233
|
@Test
public void missingLocationPolicy() {
try {
mTestStream = new FileInStream(mStatus,
InStreamOptions.defaults().setReadType(ReadType.CACHE).setLocationPolicy(null), mContext);
} catch (NullPointerException e) {
Assert.assertEquals(PreconditionMessage.FILE_WRITE_LOCATION_POLICY_UNSPECIFIED.toString(),
e.getMessage());
}
}
|
void function() { try { mTestStream = new FileInStream(mStatus, InStreamOptions.defaults().setReadType(ReadType.CACHE).setLocationPolicy(null), mContext); } catch (NullPointerException e) { Assert.assertEquals(PreconditionMessage.FILE_WRITE_LOCATION_POLICY_UNSPECIFIED.toString(), e.getMessage()); } }
|
/**
* Tests that the correct exception message is produced when the location policy is not specified.
*/
|
Tests that the correct exception message is produced when the location policy is not specified
|
missingLocationPolicy
|
{
"repo_name": "WilliamZapata/alluxio",
"path": "core/client/fs/src/test/java/alluxio/client/file/FileInStreamTest.java",
"license": "apache-2.0",
"size": 21305
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 535,557
|
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<Flux<ByteBuffer>>> createOrUpdateAtSubscriptionScopeWithResponseAsync(
String deploymentName, DeploymentInner parameters);
|
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Flux<ByteBuffer>>> createOrUpdateAtSubscriptionScopeWithResponseAsync( String deploymentName, DeploymentInner parameters);
|
/**
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param deploymentName The name of the deployment.
* @param parameters Deployment operation parameters.
* @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 deployment information.
*/
|
You can provide the template and parameters directly in the request or link to JSON files
|
createOrUpdateAtSubscriptionScopeWithResponseAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/DeploymentsClient.java",
"license": "mit",
"size": 209954
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.resourcemanager.resources.fluent.models.DeploymentInner",
"java.nio.ByteBuffer"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.resourcemanager.resources.fluent.models.DeploymentInner; import java.nio.ByteBuffer;
|
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.resources.fluent.models.*; import java.nio.*;
|
[
"com.azure.core",
"com.azure.resourcemanager",
"java.nio"
] |
com.azure.core; com.azure.resourcemanager; java.nio;
| 2,429,629
|
protected static ResultSet getAztRegimens(Connection conn, Long patientId) {
ResultSet rs = null;
try {
String sql = "SELECT regimen_visit_date AS regimen_visit_date\n" +
"FROM zeprs.encounter, zeprs.arvregimen\n" +
"WHERE encounter.id = arvregimen.id\n" +
"AND encounter.patient_id = ?\n" +
"AND arvregimen.regimen = 3221\n" +
"ORDER BY regimen_visit_date DESC\n";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setLong(1, patientId);
rs = ps.executeQuery();
} catch (Exception ex) {
log.error(ex);
}
return rs;
}
|
static ResultSet function(Connection conn, Long patientId) { ResultSet rs = null; try { String sql = STR + STR + STR + STR + STR + STR; PreparedStatement ps = conn.prepareStatement(sql); ps.setLong(1, patientId); rs = ps.executeQuery(); } catch (Exception ex) { log.error(ex); } return rs; }
|
/**
* Fetch a list of AZT ARV regimen_visit_dates. Get the first one.
* @param conn
* @param patientId
* @return
*/
|
Fetch a list of AZT ARV regimen_visit_dates. Get the first one
|
getAztRegimens
|
{
"repo_name": "chrisekelley/zeprs",
"path": "src/zeprs/org/cidrz/project/zeprs/report/ZEPRSUtils.java",
"license": "apache-2.0",
"size": 79024
}
|
[
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.ResultSet"
] |
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,582,709
|
public void removeApplicationParameter(String name) {
synchronized (applicationParameters) {
// Make sure this parameter is currently present
int n = -1;
for (int i = 0; i < applicationParameters.length; i++) {
if (name.equals(applicationParameters[i].getName())) {
n = i;
break;
}
}
if (n < 0)
return;
// Remove the specified parameter
int j = 0;
ApplicationParameter results[] =
new ApplicationParameter[applicationParameters.length - 1];
for (int i = 0; i < applicationParameters.length; i++) {
if (i != n)
results[j++] = applicationParameters[i];
}
applicationParameters = results;
}
}
|
void function(String name) { synchronized (applicationParameters) { int n = -1; for (int i = 0; i < applicationParameters.length; i++) { if (name.equals(applicationParameters[i].getName())) { n = i; break; } } if (n < 0) return; int j = 0; ApplicationParameter results[] = new ApplicationParameter[applicationParameters.length - 1]; for (int i = 0; i < applicationParameters.length; i++) { if (i != n) results[j++] = applicationParameters[i]; } applicationParameters = results; } }
|
/**
* Remove the application parameter with the specified name from
* the set for this application.
*
* @param name Name of the application parameter to remove
*/
|
Remove the application parameter with the specified name from the set for this application
|
removeApplicationParameter
|
{
"repo_name": "c-rainstorm/jerrydog",
"path": "src/main/java/org/apache/catalina/core/StandardDefaultContext.java",
"license": "gpl-3.0",
"size": 40782
}
|
[
"org.apache.catalina.deploy.ApplicationParameter"
] |
import org.apache.catalina.deploy.ApplicationParameter;
|
import org.apache.catalina.deploy.*;
|
[
"org.apache.catalina"
] |
org.apache.catalina;
| 974,370
|
if((path == null) || (path.length() == 0)) {
throw new IOException("No configuration for (" + name + ")");
}
File dir = new File(path);
if(dir.exists()) {
if(!dir.isDirectory()) {
throw new IOException("Dir(" + name + ") at (" + path +
") exists but is not a directory!");
}
} else {
if(!dir.mkdirs()) {
throw new IOException("Unable to create dir(" + name +") at ("
+ path + ")");
}
}
return dir;
}
|
if((path == null) (path.length() == 0)) { throw new IOException(STR + name + ")"); } File dir = new File(path); if(dir.exists()) { if(!dir.isDirectory()) { throw new IOException("Dir(" + name + STR + path + STR); } } else { if(!dir.mkdirs()) { throw new IOException(STR + name +STR + path + ")"); } } return dir; }
|
/**
* Ensure that the path pointed to by 'path' is a directory, if possible
* @param path
* @param name
* @return File that is a created directory
* @throws IOException
*/
|
Ensure that the path pointed to by 'path' is a directory, if possible
|
ensureDir
|
{
"repo_name": "ato/wayback",
"path": "wayback-core/src/main/java/org/archive/wayback/util/DirMaker.java",
"license": "lgpl-2.1",
"size": 2085
}
|
[
"java.io.File",
"java.io.IOException"
] |
import java.io.File; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 504,934
|
public StaticSitesClient getStaticSites() {
return this.staticSites;
}
private final WebAppsClient webApps;
|
StaticSitesClient function() { return this.staticSites; } private final WebAppsClient webApps;
|
/**
* Gets the StaticSitesClient object to access its operations.
*
* @return the StaticSitesClient object.
*/
|
Gets the StaticSitesClient object to access its operations
|
getStaticSites
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebSiteManagementClientImpl.java",
"license": "mit",
"size": 15159
}
|
[
"com.azure.resourcemanager.appservice.fluent.StaticSitesClient",
"com.azure.resourcemanager.appservice.fluent.WebAppsClient"
] |
import com.azure.resourcemanager.appservice.fluent.StaticSitesClient; import com.azure.resourcemanager.appservice.fluent.WebAppsClient;
|
import com.azure.resourcemanager.appservice.fluent.*;
|
[
"com.azure.resourcemanager"
] |
com.azure.resourcemanager;
| 697,710
|
EAttribute getVirtualAttribute_Name();
|
EAttribute getVirtualAttribute_Name();
|
/**
* Returns the meta object for the attribute '{@link fta_bdsl.VirtualAttribute#getName <em>Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Name</em>'.
* @see fta_bdsl.VirtualAttribute#getName()
* @see #getVirtualAttribute()
* @generated
*/
|
Returns the meta object for the attribute '<code>fta_bdsl.VirtualAttribute#getName Name</code>'.
|
getVirtualAttribute_Name
|
{
"repo_name": "jesusc/bento",
"path": "tests/test-outputs/bento.sirius.tests.metamodels.output/src/fta_bdsl/Fta_bdslPackage.java",
"license": "epl-1.0",
"size": 88357
}
|
[
"org.eclipse.emf.ecore.EAttribute"
] |
import org.eclipse.emf.ecore.EAttribute;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,414,057
|
private JPanel getFilterSettingsPanel() {
if (filterSettingsPanel == null) {
GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
gridBagConstraints6.gridx = 0;
gridBagConstraints6.fill = GridBagConstraints.HORIZONTAL;
gridBagConstraints6.gridy = 0;
GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
gridBagConstraints5.insets = new Insets(12, 0, 0, 0);
gridBagConstraints5.gridy = 2;
gridBagConstraints5.ipadx = -10;
gridBagConstraints5.anchor = GridBagConstraints.SOUTH;
gridBagConstraints5.fill = GridBagConstraints.HORIZONTAL;
gridBagConstraints5.gridx = 0;
GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
gridBagConstraints4.fill = GridBagConstraints.BOTH;
gridBagConstraints4.gridx = 0;
gridBagConstraints4.gridy = 1;
gridBagConstraints4.ipadx = -15;
gridBagConstraints4.weightx = 1.0;
gridBagConstraints4.weighty = 1.0;
gridBagConstraints4.anchor = GridBagConstraints.NORTH;
gridBagConstraints4.insets = new Insets(0, 0, 12, 0);
filterSettingsPanel = new JPanel();
filterSettingsPanel.setLayout(new GridBagLayout());
filterSettingsPanel.add(getJTabbedPane(), gridBagConstraints4);
filterSettingsPanel.add(getButtonPanel(), gridBagConstraints5);
if (contentFrame != null)
filterSettingsPanel.add(getWindowPanel(), gridBagConstraints6);
}
return filterSettingsPanel;
}
|
JPanel function() { if (filterSettingsPanel == null) { GridBagConstraints gridBagConstraints6 = new GridBagConstraints(); gridBagConstraints6.gridx = 0; gridBagConstraints6.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints6.gridy = 0; GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); gridBagConstraints5.insets = new Insets(12, 0, 0, 0); gridBagConstraints5.gridy = 2; gridBagConstraints5.ipadx = -10; gridBagConstraints5.anchor = GridBagConstraints.SOUTH; gridBagConstraints5.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints5.gridx = 0; GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); gridBagConstraints4.fill = GridBagConstraints.BOTH; gridBagConstraints4.gridx = 0; gridBagConstraints4.gridy = 1; gridBagConstraints4.ipadx = -15; gridBagConstraints4.weightx = 1.0; gridBagConstraints4.weighty = 1.0; gridBagConstraints4.anchor = GridBagConstraints.NORTH; gridBagConstraints4.insets = new Insets(0, 0, 12, 0); filterSettingsPanel = new JPanel(); filterSettingsPanel.setLayout(new GridBagLayout()); filterSettingsPanel.add(getJTabbedPane(), gridBagConstraints4); filterSettingsPanel.add(getButtonPanel(), gridBagConstraints5); if (contentFrame != null) filterSettingsPanel.add(getWindowPanel(), gridBagConstraints6); } return filterSettingsPanel; }
|
/**
* This method initializes filterSettingsPanel
*
* @return javax.swing.JPanel
*/
|
This method initializes filterSettingsPanel
|
getFilterSettingsPanel
|
{
"repo_name": "gilles-fabre/ezRPC",
"path": "LogReporter/LogReporterTool/com/reporter/WindowSettingsDialog.java",
"license": "lgpl-3.0",
"size": 15643
}
|
[
"java.awt.GridBagConstraints",
"java.awt.GridBagLayout",
"java.awt.Insets",
"javax.swing.JPanel"
] |
import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import javax.swing.JPanel;
|
import java.awt.*; import javax.swing.*;
|
[
"java.awt",
"javax.swing"
] |
java.awt; javax.swing;
| 1,864,855
|
public void dropIndex(
Policy policy,
String namespace,
String setName,
String indexName
) throws AerospikeException;
//-------------------------------------------------------
// User administration
//-------------------------------------------------------
|
void function( Policy policy, String namespace, String setName, String indexName ) throws AerospikeException;
|
/**
* Delete secondary index.
* This method is only supported by Aerospike 3 servers.
*
* @param policy generic configuration parameters, pass in null for defaults
* @param namespace namespace - equivalent to database name
* @param setName optional set name - equivalent to database table
* @param indexName name of secondary index
* @throws AerospikeException if index create fails
*/
|
Delete secondary index. This method is only supported by Aerospike 3 servers
|
dropIndex
|
{
"repo_name": "wgpshashank/aerospike-client-java",
"path": "client/src/com/aerospike/client/IAerospikeClient.java",
"license": "apache-2.0",
"size": 41552
}
|
[
"com.aerospike.client.policy.Policy"
] |
import com.aerospike.client.policy.Policy;
|
import com.aerospike.client.policy.*;
|
[
"com.aerospike.client"
] |
com.aerospike.client;
| 1,984,760
|
public Iterator iterator() {
return new Iterator() {
private int index = start;
private int lastReturnedIndex = -1;
private boolean isFirst = full;
|
Iterator function() { return new Iterator() { private int index = start; private int lastReturnedIndex = -1; private boolean isFirst = full;
|
/**
* Returns an iterator over this buffer's elements.
*
* @return an iterator over this buffer's elements
*/
|
Returns an iterator over this buffer's elements
|
iterator
|
{
"repo_name": "ProfilingLabs/Usemon2",
"path": "usemon-agent-commons-java/src/main/java/com/usemon/lib/org/apache/commons/collections/buffer/BoundedFifoBuffer.java",
"license": "mpl-2.0",
"size": 11914
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,373,709
|
public int getStepIndexFromFile(BatchStepFileDescriptor batchStepFile) {
File runFile = batchStepFile.getStepFile();
if (runFile != null) {
List<String> contents = getFileContents(runFile);
if (contents.size() > 0) {
return Integer.parseInt(contents.get(0));
}
}
return -1;
}
|
int function(BatchStepFileDescriptor batchStepFile) { File runFile = batchStepFile.getStepFile(); if (runFile != null) { List<String> contents = getFileContents(runFile); if (contents.size() > 0) { return Integer.parseInt(contents.get(0)); } } return -1; }
|
/**
* Returns the index of the step contained in the file
*
* @param batchStepFile the file from which to retrieve the step index
* @return the step index, or -1 if there was no content in the file
*/
|
Returns the index of the step contained in the file
|
getStepIndexFromFile
|
{
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-core/src/main/java/org/kuali/kfs/sys/context/BatchContainerDirectory.java",
"license": "agpl-3.0",
"size": 19504
}
|
[
"java.io.File",
"java.util.List"
] |
import java.io.File; import java.util.List;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 766,257
|
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
processRequest(request, response);
} catch (Exception ex) {
// if (EstadoHelper.getTipo_estado() == Tipo_estado.Debug) {
// PrintWriter out = response.getWriter();
// out.println("<html><body><h1>Application error</h1><strong>Message:</strong> " + ex + "<body></html>");
//
// } else {
// Logger.getLogger(JspControl.class
// .getName()).log(Level.SEVERE, null, ex);
// }
}
}
|
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (Exception ex) { } }
|
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
|
Handles the HTTP <code>GET</code> method
|
doGet
|
{
"repo_name": "AngelAlpanez/ausiasYield2014",
"path": "src/main/java/net/daw/control/JspControl.java",
"license": "gpl-2.0",
"size": 10058
}
|
[
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] |
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
|
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
|
[
"java.io",
"javax.servlet"
] |
java.io; javax.servlet;
| 1,626,861
|
public static boolean isExpression(RowExpression rowExpression)
{
return (rowExpression instanceof OriginalExpression);
}
private static final class OriginalExpression
extends RowExpression
{
private final Expression expression;
OriginalExpression(Expression expression)
{
this.expression = requireNonNull(expression, "expression is null");
}
|
static boolean function(RowExpression rowExpression) { return (rowExpression instanceof OriginalExpression); } private static final class OriginalExpression extends RowExpression { private final Expression expression; OriginalExpression(Expression expression) { this.expression = requireNonNull(expression, STR); }
|
/**
* Check if the given {@param rowExpression} is an Expression.
*/
|
Check if the given rowExpression is an Expression
|
isExpression
|
{
"repo_name": "mvp/presto",
"path": "presto-main/src/main/java/com/facebook/presto/sql/relational/OriginalExpressionUtils.java",
"license": "apache-2.0",
"size": 4170
}
|
[
"com.facebook.presto.spi.relation.RowExpression",
"com.facebook.presto.sql.tree.Expression",
"java.util.Objects"
] |
import com.facebook.presto.spi.relation.RowExpression; import com.facebook.presto.sql.tree.Expression; import java.util.Objects;
|
import com.facebook.presto.spi.relation.*; import com.facebook.presto.sql.tree.*; import java.util.*;
|
[
"com.facebook.presto",
"java.util"
] |
com.facebook.presto; java.util;
| 719,367
|
SQLiteLoaderObserver registerLoader(final SQLiteLoader loader,
final String table) {
Logger.d(TAG, "Add Loader Observer: %s", table);
final SQLiteLoaderObserver entry = new SQLiteLoaderObserver(loader, table);
mActiveLoaders.add(entry);
return entry;
}
|
SQLiteLoaderObserver registerLoader(final SQLiteLoader loader, final String table) { Logger.d(TAG, STR, table); final SQLiteLoaderObserver entry = new SQLiteLoaderObserver(loader, table); mActiveLoaders.add(entry); return entry; }
|
/**
* Register a loader for maintaining notify changes
*
* @param loader The {@link SQLiteLoader} loader to register
* @param table The table name
* @return The {@link SQLiteLoaderObserver} that was created. Use this to
* unregister the loader entry
*/
|
Register a loader for maintaining notify changes
|
registerLoader
|
{
"repo_name": "ashokslsk/yelo-android",
"path": "app/src/main/java/red/yelo/data/YeloSQLiteOpenHelper.java",
"license": "apache-2.0",
"size": 11151
}
|
[
"red.yelo.utils.Logger"
] |
import red.yelo.utils.Logger;
|
import red.yelo.utils.*;
|
[
"red.yelo.utils"
] |
red.yelo.utils;
| 2,676,839
|
public void test_fill$IIII() {
// Test for method void java.util.Arrays.fill(int [], int, int, int)
int val = Integer.MAX_VALUE;
int d[] = new int[1000];
Arrays.fill(d, 400, d.length, val);
for (int i = 0; i < 400; i++)
assertTrue("Filled elements not in range", !(d[i] == val));
for (int i = 400; i < d.length; i++)
assertTrue("Failed to fill int array correctly", d[i] == val);
try {
Arrays.fill(d, 10, 0, val);
fail("IllegalArgumentException expected");
} catch (IllegalArgumentException e) {
//expected
}
try {
Arrays.fill(d, -10, 0, val);
fail("ArrayIndexOutOfBoundsException expected");
} catch (ArrayIndexOutOfBoundsException e) {
//expected
}
try {
Arrays.fill(d, 10, d.length+1, val);
fail("ArrayIndexOutOfBoundsException expected");
} catch (ArrayIndexOutOfBoundsException e) {
//expected
}
}
|
public void test_fill$IIII() { int val = Integer.MAX_VALUE; int d[] = new int[1000]; Arrays.fill(d, 400, d.length, val); for (int i = 0; i < 400; i++) assertTrue(STR, !(d[i] == val)); for (int i = 400; i < d.length; i++) assertTrue(STR, d[i] == val); try { Arrays.fill(d, 10, 0, val); fail(STR); } catch (IllegalArgumentException e) { } try { Arrays.fill(d, -10, 0, val); fail(STR); } catch (ArrayIndexOutOfBoundsException e) { } try { Arrays.fill(d, 10, d.length+1, val); fail(STR); } catch (ArrayIndexOutOfBoundsException e) { } }
|
/**
* java.util.Arrays#fill(int[], int, int, int)
*/
|
java.util.Arrays#fill(int[], int, int, int)
|
test_fill$IIII
|
{
"repo_name": "mirego/j2objc",
"path": "jre_emul/android/platform/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ArraysTest.java",
"license": "apache-2.0",
"size": 207868
}
|
[
"java.util.Arrays"
] |
import java.util.Arrays;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,183,325
|
public boolean checkModuleEventRegistered(String eventName,WXModule module) {
if (module != null) {
List<String> events = module.getEventCallbacks(eventName);
if (events != null && events.size() > 0) {
return true;
}
}
return false;
}
|
boolean function(String eventName,WXModule module) { if (module != null) { List<String> events = module.getEventCallbacks(eventName); if (events != null && events.size() > 0) { return true; } } return false; }
|
/**
* Check whether the current module registered the event
* @param eventName EventName register in weex
* @param module Events occur in this Module
* @return register->true
*/
|
Check whether the current module registered the event
|
checkModuleEventRegistered
|
{
"repo_name": "cxfeng1/weex",
"path": "android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java",
"license": "apache-2.0",
"size": 56425
}
|
[
"com.taobao.weex.common.WXModule",
"java.util.List"
] |
import com.taobao.weex.common.WXModule; import java.util.List;
|
import com.taobao.weex.common.*; import java.util.*;
|
[
"com.taobao.weex",
"java.util"
] |
com.taobao.weex; java.util;
| 2,639,782
|
@Test(expectedExceptions = IllegalArgumentException.class)
public void testNullDataSource3() {
HistoricalTimeSeriesProviderGetRequest.createGetLatest(IDS.iterator().next(), null, DATA_PROVIDER, DATA_FIELD);
}
|
@Test(expectedExceptions = IllegalArgumentException.class) void function() { HistoricalTimeSeriesProviderGetRequest.createGetLatest(IDS.iterator().next(), null, DATA_PROVIDER, DATA_FIELD); }
|
/**
* Tests that the data source cannot be null.
*/
|
Tests that the data source cannot be null
|
testNullDataSource3
|
{
"repo_name": "McLeodMoores/starling",
"path": "projects/provider/src/test/java/com/opengamma/provider/historicaltimeseries/HistoricalTimeSeriesProviderGetRequestTest.java",
"license": "apache-2.0",
"size": 10932
}
|
[
"com.opengamma.provider.historicaltimeseries.HistoricalTimeSeriesProviderGetRequest",
"org.testng.annotations.Test"
] |
import com.opengamma.provider.historicaltimeseries.HistoricalTimeSeriesProviderGetRequest; import org.testng.annotations.Test;
|
import com.opengamma.provider.historicaltimeseries.*; import org.testng.annotations.*;
|
[
"com.opengamma.provider",
"org.testng.annotations"
] |
com.opengamma.provider; org.testng.annotations;
| 2,264,646
|
public void save(File file, FileConfiguration config) {
this.file = file;
// Location settings
config.set("sign.location.world", block.getLocation().getWorld().getName());
config.set("sign.location.x", block.getLocation().getBlockX());
config.set("sign.location.y", block.getLocation().getBlockY());
config.set("sign.location.z", block.getLocation().getBlockZ());
// Racecourse settings
config.set("sign.course", course.getName());
}
|
void function(File file, FileConfiguration config) { this.file = file; config.set(STR, block.getLocation().getWorld().getName()); config.set(STR, block.getLocation().getBlockX()); config.set(STR, block.getLocation().getBlockY()); config.set(STR, block.getLocation().getBlockZ()); config.set(STR, course.getName()); }
|
/**
* Save the information for the sign.
*
* @param config the config file for the sign
*/
|
Save the information for the sign
|
save
|
{
"repo_name": "CodingBadgers/MineKart",
"path": "minekart/src/main/java/uk/thecodingbadgers/minekart/lobby/LobbySign.java",
"license": "gpl-2.0",
"size": 6116
}
|
[
"java.io.File",
"org.bukkit.configuration.file.FileConfiguration"
] |
import java.io.File; import org.bukkit.configuration.file.FileConfiguration;
|
import java.io.*; import org.bukkit.configuration.file.*;
|
[
"java.io",
"org.bukkit.configuration"
] |
java.io; org.bukkit.configuration;
| 930,145
|
public static SynergyNetPosition getLocalDeviceLocationPosOnly()
{
PositionConfigPrefsItem prefs = new PositionConfigPrefsItem();
float tableLocationX = prefs.getXPos();
float tableLocationY = prefs.getYPos();
int currentConnectionsCount = AppSystemControlComms.get().getNumberOfTablesOnline() - 1;
if (prefs.getDeveloperMode())
{
if (prefs.getHorizontalPlacement())
{
if (prefs.getGridLimitX() != 0)
{
int xPos = currentConnectionsCount % prefs.getGridLimitX();
tableLocationX = xPos * prefs.getGridDistanceX();
int yPos = currentConnectionsCount / prefs.getGridLimitX();
tableLocationY = yPos * prefs.getGridDistanceY();
}
else
{
tableLocationX = currentConnectionsCount * prefs.getGridDistanceX();
tableLocationY = 0;
}
}
else
{
if (prefs.getGridLimitY() != 0)
{
int yPos = currentConnectionsCount % prefs.getGridLimitY();
tableLocationY = yPos * prefs.getGridDistanceY();
int xPos = currentConnectionsCount / prefs.getGridLimitY();
tableLocationX = xPos * prefs.getGridDistanceX();
}
else
{
tableLocationY = currentConnectionsCount * prefs.getGridDistanceY();
tableLocationX = 0;
}
}
}
float orientation = FastMath.DEG_TO_RAD * prefs.getAngle();
float heightFromFloor = prefs.getTableHeight();
return new SynergyNetPosition("", tableLocationX, tableLocationY, orientation, 0, 0, heightFromFloor, 0);
}
|
static SynergyNetPosition function() { PositionConfigPrefsItem prefs = new PositionConfigPrefsItem(); float tableLocationX = prefs.getXPos(); float tableLocationY = prefs.getYPos(); int currentConnectionsCount = AppSystemControlComms.get().getNumberOfTablesOnline() - 1; if (prefs.getDeveloperMode()) { if (prefs.getHorizontalPlacement()) { if (prefs.getGridLimitX() != 0) { int xPos = currentConnectionsCount % prefs.getGridLimitX(); tableLocationX = xPos * prefs.getGridDistanceX(); int yPos = currentConnectionsCount / prefs.getGridLimitX(); tableLocationY = yPos * prefs.getGridDistanceY(); } else { tableLocationX = currentConnectionsCount * prefs.getGridDistanceX(); tableLocationY = 0; } } else { if (prefs.getGridLimitY() != 0) { int yPos = currentConnectionsCount % prefs.getGridLimitY(); tableLocationY = yPos * prefs.getGridDistanceY(); int xPos = currentConnectionsCount / prefs.getGridLimitY(); tableLocationX = xPos * prefs.getGridDistanceX(); } else { tableLocationY = currentConnectionsCount * prefs.getGridDistanceY(); tableLocationX = 0; } } } float orientation = FastMath.DEG_TO_RAD * prefs.getAngle(); float heightFromFloor = prefs.getTableHeight(); return new SynergyNetPosition("", tableLocationX, tableLocationY, orientation, 0, 0, heightFromFloor, 0); }
|
/**
* Gets the local device location pos only.
*
* @return the local device location pos only
*/
|
Gets the local device location pos only
|
getLocalDeviceLocationPosOnly
|
{
"repo_name": "synergynet/synergynet3.1",
"path": "synergynet3.1-parent/synergynet3-appsystem-core/src/main/java/synergynet3/positioning/SynergyNetPositioning.java",
"license": "bsd-3-clause",
"size": 4907
}
|
[
"com.jme3.math.FastMath"
] |
import com.jme3.math.FastMath;
|
import com.jme3.math.*;
|
[
"com.jme3.math"
] |
com.jme3.math;
| 557,781
|
public SwitchNode setCases(final LexicalContext lc, final List<CaseNode> cases, final CaseNode defaultCase) {
return setCases(lc, cases, defaultCase == null ? -1 : cases.indexOf(defaultCase));
}
|
SwitchNode function(final LexicalContext lc, final List<CaseNode> cases, final CaseNode defaultCase) { return setCases(lc, cases, defaultCase == null ? -1 : cases.indexOf(defaultCase)); }
|
/**
* Set or reset the list of cases in this switch
* @param lc lexical context
* @param cases a list of cases, case nodes
* @param defaultCase a case in the list that is the default - must be in the list or class will assert
* @return new switch node or same if no state was changed
*/
|
Set or reset the list of cases in this switch
|
setCases
|
{
"repo_name": "malaporte/kaziranga",
"path": "src/jdk/nashorn/internal/ir/SwitchNode.java",
"license": "gpl-2.0",
"size": 9222
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 369,037
|
public void addBatch() throws SQLException {
synchronized (checkClosed().getConnectionMutex()) {
if (this.batchedArgs == null) {
this.batchedArgs = new ArrayList<Object>();
}
for (int i = 0; i < this.parameterValues.length; i++) {
checkAllParametersSet(this.parameterValues[i], this.parameterStreams[i], i);
}
this.batchedArgs.add(new BatchParams(this.parameterValues, this.parameterStreams, this.isStream, this.streamLengths, this.isNull));
}
}
|
void function() throws SQLException { synchronized (checkClosed().getConnectionMutex()) { if (this.batchedArgs == null) { this.batchedArgs = new ArrayList<Object>(); } for (int i = 0; i < this.parameterValues.length; i++) { checkAllParametersSet(this.parameterValues[i], this.parameterStreams[i], i); } this.batchedArgs.add(new BatchParams(this.parameterValues, this.parameterStreams, this.isStream, this.streamLengths, this.isNull)); } }
|
/**
* JDBC 2.0 Add a set of parameters to the batch.
*
* @exception SQLException
* if a database-access error occurs.
*
* @see StatementImpl#addBatch
*/
|
JDBC 2.0 Add a set of parameters to the batch
|
addBatch
|
{
"repo_name": "swankjesse/mysql-connector-j",
"path": "src/com/mysql/jdbc/PreparedStatement.java",
"license": "gpl-2.0",
"size": 198268
}
|
[
"java.sql.SQLException",
"java.util.ArrayList"
] |
import java.sql.SQLException; import java.util.ArrayList;
|
import java.sql.*; import java.util.*;
|
[
"java.sql",
"java.util"
] |
java.sql; java.util;
| 2,904,639
|
public KeyStore getTrustKeyStore() {
return getKeyStore();
}
|
KeyStore function() { return getKeyStore(); }
|
/**
* Abstraction for getting Trusted KeyStore
*
* @return KeyStore instance
*/
|
Abstraction for getting Trusted KeyStore
|
getTrustKeyStore
|
{
"repo_name": "maheshika/wso2-synapse",
"path": "modules/securevault/src/main/java/org/apache/synapse/securevault/keystore/TrustKeyStoreWrapper.java",
"license": "apache-2.0",
"size": 1409
}
|
[
"java.security.KeyStore"
] |
import java.security.KeyStore;
|
import java.security.*;
|
[
"java.security"
] |
java.security;
| 662,847
|
@SuppressWarnings("unchecked")
T[] array = (T[]) Array.newInstance(clazz, values.length);
for (int i = 0; i < values.length; i++) {
array[i] = values[i];
}
return array;
}
|
@SuppressWarnings(STR) T[] array = (T[]) Array.newInstance(clazz, values.length); for (int i = 0; i < values.length; i++) { array[i] = values[i]; } return array; }
|
/**
* Returns an array
*
* @deprecated do not use this method, the implementation doesn't make a lot
* of sense and furthermore, the whole method is somewhat
* pointless.
* @param <T>
* generic type of the items to place into an array
* @param clazz
* the class of generic type <T>
* @param values
* an arbitrary number of values
* @return an array containing all values passed to this method
*/
|
Returns an array
|
asArray
|
{
"repo_name": "SphericalElephant/android-http",
"path": "app/src/main/java/at/diamonddogs/util/Utils.java",
"license": "apache-2.0",
"size": 14973
}
|
[
"java.lang.reflect.Array"
] |
import java.lang.reflect.Array;
|
import java.lang.reflect.*;
|
[
"java.lang"
] |
java.lang;
| 2,152,172
|
public void setContent(Collection<CmsListItem> listItems) {
if (m_metadata.isSelfManaged()) {
m_filteredItems = new ArrayList<CmsListItem>(listItems);
m_originalItems = null;
} else {
m_filteredItems = null;
m_originalItems = new ArrayList<CmsListItem>(listItems);
}
}
|
void function(Collection<CmsListItem> listItems) { if (m_metadata.isSelfManaged()) { m_filteredItems = new ArrayList<CmsListItem>(listItems); m_originalItems = null; } else { m_filteredItems = null; m_originalItems = new ArrayList<CmsListItem>(listItems); } }
|
/**
* Sets the list item to display in the list.<p>
*
* @param listItems a collection of {@link CmsListItem} objects
*/
|
Sets the list item to display in the list
|
setContent
|
{
"repo_name": "ggiudetti/opencms-core",
"path": "src-modules/org/opencms/workplace/list/CmsHtmlList.java",
"license": "lgpl-2.1",
"size": 37966
}
|
[
"java.util.ArrayList",
"java.util.Collection"
] |
import java.util.ArrayList; import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,248,747
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.