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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
protected BindStatus getBindStatus() throws JspException {
if (this.bindStatus == null) {
// HTML escaping in tags is performed by the ValueFormatter class.
String nestedPath = getNestedPath();
String pathToUse = (nestedPath != null ? nestedPath + getPath() : getPath());
if (pathToUse.endsWith(PropertyAccessor.NESTED_PROPERTY_SEPARATOR)) {
pathToUse = pathToUse.substring(0, pathToUse.length() - 1);
}
this.bindStatus = new BindStatus(getRequestContext(), pathToUse, false);
}
return this.bindStatus;
} | BindStatus function() throws JspException { if (this.bindStatus == null) { String nestedPath = getNestedPath(); String pathToUse = (nestedPath != null ? nestedPath + getPath() : getPath()); if (pathToUse.endsWith(PropertyAccessor.NESTED_PROPERTY_SEPARATOR)) { pathToUse = pathToUse.substring(0, pathToUse.length() - 1); } this.bindStatus = new BindStatus(getRequestContext(), pathToUse, false); } return this.bindStatus; } | /**
* Get the {@link BindStatus} for this tag.
*/ | Get the <code>BindStatus</code> for this tag | getBindStatus | {
"repo_name": "QBNemo/spring-mvc-showcase",
"path": "src/main/java/org/springframework/web/servlet/tags/form/AbstractDataBoundFormElementTag.java",
"license": "apache-2.0",
"size": 8049
} | [
"javax.servlet.jsp.JspException",
"org.springframework.beans.PropertyAccessor",
"org.springframework.web.servlet.support.BindStatus"
] | import javax.servlet.jsp.JspException; import org.springframework.beans.PropertyAccessor; import org.springframework.web.servlet.support.BindStatus; | import javax.servlet.jsp.*; import org.springframework.beans.*; import org.springframework.web.servlet.support.*; | [
"javax.servlet",
"org.springframework.beans",
"org.springframework.web"
] | javax.servlet; org.springframework.beans; org.springframework.web; | 2,214,244 |
public Connection getConnection()
{
Connection connection;
try
{
if (getLogger().isDebugEnabled())
{
getLogger().debug("before: active : " + connectionPool.getNumActive() + " idle: " + connectionPool.getNumIdle());
}
connection = dataSource.getConnection();
if (getLogger().isDebugEnabled())
{
getLogger().debug("after: active : " + connectionPool.getNumActive() + " idle: " + connectionPool.getNumIdle() + " giving " + connection);
}
}
catch (Exception e)
{
getLogger().error("Unable to get connection " + this, e);
throw new MithraDatabaseException("could not get connection", e);
}
if (connection == null)
{
throw new MithraDatabaseException("could not get connection"+this);
}
return connection;
}
| Connection function() { Connection connection; try { if (getLogger().isDebugEnabled()) { getLogger().debug(STR + connectionPool.getNumActive() + STR + connectionPool.getNumIdle()); } connection = dataSource.getConnection(); if (getLogger().isDebugEnabled()) { getLogger().debug(STR + connectionPool.getNumActive() + STR + connectionPool.getNumIdle() + STR + connection); } } catch (Exception e) { getLogger().error(STR + this, e); throw new MithraDatabaseException(STR, e); } if (connection == null) { throw new MithraDatabaseException(STR+this); } return connection; } | /**
* gets a connection from the pool. initializePool() must've been called before calling this method.
* If all connections are in use, this method will block, unless maxWait has been set.
* @return a connection.
*/ | gets a connection from the pool. initializePool() must've been called before calling this method. If all connections are in use, this method will block, unless maxWait has been set | getConnection | {
"repo_name": "goldmansachs/reladomo",
"path": "reladomo/src/main/java/com/gs/fw/common/mithra/connectionmanager/AbstractConnectionManager.java",
"license": "apache-2.0",
"size": 22570
} | [
"com.gs.fw.common.mithra.MithraDatabaseException",
"java.sql.Connection"
] | import com.gs.fw.common.mithra.MithraDatabaseException; import java.sql.Connection; | import com.gs.fw.common.mithra.*; import java.sql.*; | [
"com.gs.fw",
"java.sql"
] | com.gs.fw; java.sql; | 859,336 |
private void setupResponseOldVersionFatal(ByteArrayOutputStream response,
Call call,
Writable rv, String errorClass, String error)
throws IOException {
final int OLD_VERSION_FATAL_STATUS = -1;
response.reset();
DataOutputStream out = new DataOutputStream(response);
out.writeInt(call.callId); // write call id
out.writeInt(OLD_VERSION_FATAL_STATUS); // write FATAL_STATUS
WritableUtils.writeString(out, errorClass);
WritableUtils.writeString(out, error);
if (call.connection.useWrap) {
wrapWithSasl(response, call);
}
call.setResponse(ByteBuffer.wrap(response.toByteArray()));
}
| void function(ByteArrayOutputStream response, Call call, Writable rv, String errorClass, String error) throws IOException { final int OLD_VERSION_FATAL_STATUS = -1; response.reset(); DataOutputStream out = new DataOutputStream(response); out.writeInt(call.callId); out.writeInt(OLD_VERSION_FATAL_STATUS); WritableUtils.writeString(out, errorClass); WritableUtils.writeString(out, error); if (call.connection.useWrap) { wrapWithSasl(response, call); } call.setResponse(ByteBuffer.wrap(response.toByteArray())); } | /**
* Setup response for the IPC Call on Fatal Error from a
* client that is using old version of Hadoop.
* The response is serialized using the previous protocol's response
* layout.
*
* @param response buffer to serialize the response into
* @param call {@link Call} to which we are setting up the response
* @param rv return value for the IPC Call, if the call was successful
* @param errorClass error class, if the the call failed
* @param error error message, if the call failed
* @throws IOException
*/ | Setup response for the IPC Call on Fatal Error from a client that is using old version of Hadoop. The response is serialized using the previous protocol's response layout | setupResponseOldVersionFatal | {
"repo_name": "satishpatil2k13/ODPI-Hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java",
"license": "apache-2.0",
"size": 106429
} | [
"java.io.ByteArrayOutputStream",
"java.io.DataOutputStream",
"java.io.IOException",
"java.nio.ByteBuffer",
"org.apache.hadoop.io.Writable",
"org.apache.hadoop.io.WritableUtils"
] | import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.WritableUtils; | import java.io.*; import java.nio.*; import org.apache.hadoop.io.*; | [
"java.io",
"java.nio",
"org.apache.hadoop"
] | java.io; java.nio; org.apache.hadoop; | 1,943,921 |
private Class parseClass(final GroovyCodeSource codeSource) throws CompilationFailedException {
// Don't cache scripts
return loader.parseClass(codeSource, false);
} | Class function(final GroovyCodeSource codeSource) throws CompilationFailedException { return loader.parseClass(codeSource, false); } | /**
* Parses the groovy code contained in codeSource and returns a java class.
*/ | Parses the groovy code contained in codeSource and returns a java class | parseClass | {
"repo_name": "joetopshot/freeplane",
"path": "freeplane_plugin_script/src/main/java/org/freeplane/plugin/script/GroovyShell.java",
"license": "gpl-2.0",
"size": 10051
} | [
"groovy.lang.GroovyCodeSource",
"org.codehaus.groovy.control.CompilationFailedException"
] | import groovy.lang.GroovyCodeSource; import org.codehaus.groovy.control.CompilationFailedException; | import groovy.lang.*; import org.codehaus.groovy.control.*; | [
"groovy.lang",
"org.codehaus.groovy"
] | groovy.lang; org.codehaus.groovy; | 461,075 |
public void setLabelState(RemoteValueState labelState) {
this.labelState = labelState;
} | void function(RemoteValueState labelState) { this.labelState = labelState; } | /**
* Sets label state.
*
* @param labelState the label state
*/ | Sets label state | setLabelState | {
"repo_name": "maximehamm/jspresso-ce",
"path": "remote/components/src/main/java/org/jspresso/framework/gui/remote/RComponent.java",
"license": "lgpl-3.0",
"size": 9005
} | [
"org.jspresso.framework.state.remote.RemoteValueState"
] | import org.jspresso.framework.state.remote.RemoteValueState; | import org.jspresso.framework.state.remote.*; | [
"org.jspresso.framework"
] | org.jspresso.framework; | 1,313,582 |
public static WebElement waitForElement(WebDriver driver, String elementNameOrID, long timeout) {
long start = System.currentTimeMillis();
WebElement webElement = null;
while (null == webElement) {
webElement = getByNameOrID(driver, elementNameOrID);
if (null != webElement)
break;
Assert.assertTrue("Timeout (>"+timeout+"ms) while waiting for web element "+elementNameOrID+" in page '"+driver.getTitle()+"'", System.currentTimeMillis() - start < timeout);
waitForASecond();
}
return webElement;
} | static WebElement function(WebDriver driver, String elementNameOrID, long timeout) { long start = System.currentTimeMillis(); WebElement webElement = null; while (null == webElement) { webElement = getByNameOrID(driver, elementNameOrID); if (null != webElement) break; Assert.assertTrue(STR+timeout+STR+elementNameOrID+STR+driver.getTitle()+"'", System.currentTimeMillis() - start < timeout); waitForASecond(); } return webElement; } | /***
* Waits the till element is displayed
*
* @param driver
* @param elementNameOrID
*/ | Waits the till element is displayed | waitForElement | {
"repo_name": "Orange-OpenSource/elpaaso-core",
"path": "cloud-paas/cloud-paas-webapp/cloud-paas-webapp-int/src/test/java/com/francetelecom/clara/cloud/webapp/acceptancetest/utils/SeleniumUtils.java",
"license": "apache-2.0",
"size": 9552
} | [
"org.junit.Assert",
"org.openqa.selenium.WebDriver",
"org.openqa.selenium.WebElement"
] | import org.junit.Assert; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; | import org.junit.*; import org.openqa.selenium.*; | [
"org.junit",
"org.openqa.selenium"
] | org.junit; org.openqa.selenium; | 2,388,792 |
protected Durability getEffectiveDurability(Durability d) {
return d == Durability.USE_DEFAULT ? this.durability : d;
} | Durability function(Durability d) { return d == Durability.USE_DEFAULT ? this.durability : d; } | /**
* Returns effective durability from the passed durability and
* the table descriptor.
*/ | Returns effective durability from the passed durability and the table descriptor | getEffectiveDurability | {
"repo_name": "intel-hadoop/hbase-rhino",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java",
"license": "apache-2.0",
"size": 236546
} | [
"org.apache.hadoop.hbase.client.Durability"
] | import org.apache.hadoop.hbase.client.Durability; | import org.apache.hadoop.hbase.client.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 903,430 |
PreferenceId getControlGroupId(); | PreferenceId getControlGroupId(); | /**
* Returns the unique {@link PreferenceId} of this preference control group.
*
* @return The unique {@link PreferenceId} of this preference control group.
*/ | Returns the unique <code>PreferenceId</code> of this preference control group | getControlGroupId | {
"repo_name": "mariusoe/inspectIT",
"path": "inspectit.ui.rcp/src/main/java/rocks/inspectit/ui/rcp/editor/preferences/control/IPreferenceControl.java",
"license": "agpl-3.0",
"size": 1385
} | [
"rocks.inspectit.ui.rcp.editor.preferences.PreferenceId"
] | import rocks.inspectit.ui.rcp.editor.preferences.PreferenceId; | import rocks.inspectit.ui.rcp.editor.preferences.*; | [
"rocks.inspectit.ui"
] | rocks.inspectit.ui; | 2,875,224 |
@Test
public void testReadFuture() throws Exception {
SalPort sport = new SalPort(10L, 20L);
VtnPort vport = createVtnPortBuilder(sport).build();
// In case of successful completion.
CheckedFuture<Optional<VtnPort>, ReadFailedException> f =
doRead(vport);
Optional<VtnPort> res = DataStoreUtils.read(f);
assertTrue(res.isPresent());
assertEquals(vport, res.orNull());
verifyFutureMock(f);
f = doRead((VtnPort)null);
res = DataStoreUtils.read(f);
assertFalse(res.isPresent());
assertEquals(null, res.orNull());
verifyFutureMock(f);
// In case of read failure.
ReadFailedException rfe = new ReadFailedException("Read failed");
f = doRead(rfe);
try {
DataStoreUtils.read(f);
unexpected();
} catch (VTNException e) {
assertEquals(VtnErrorTag.INTERNALERROR, e.getVtnErrorTag());
assertEquals(rfe, e.getCause());
}
verifyFutureMock(f);
// In case of timeout.
TimeoutException te = new TimeoutException("Timed out");
f = doRead(te);
try {
DataStoreUtils.read(f);
unexpected();
} catch (VTNException e) {
assertEquals(VtnErrorTag.TIMEOUT, e.getVtnErrorTag());
assertEquals(te, e.getCause());
}
verifyFutureMock(f);
} | void function() throws Exception { SalPort sport = new SalPort(10L, 20L); VtnPort vport = createVtnPortBuilder(sport).build(); CheckedFuture<Optional<VtnPort>, ReadFailedException> f = doRead(vport); Optional<VtnPort> res = DataStoreUtils.read(f); assertTrue(res.isPresent()); assertEquals(vport, res.orNull()); verifyFutureMock(f); f = doRead((VtnPort)null); res = DataStoreUtils.read(f); assertFalse(res.isPresent()); assertEquals(null, res.orNull()); verifyFutureMock(f); ReadFailedException rfe = new ReadFailedException(STR); f = doRead(rfe); try { DataStoreUtils.read(f); unexpected(); } catch (VTNException e) { assertEquals(VtnErrorTag.INTERNALERROR, e.getVtnErrorTag()); assertEquals(rfe, e.getCause()); } verifyFutureMock(f); TimeoutException te = new TimeoutException(STR); f = doRead(te); try { DataStoreUtils.read(f); unexpected(); } catch (VTNException e) { assertEquals(VtnErrorTag.TIMEOUT, e.getVtnErrorTag()); assertEquals(te, e.getCause()); } verifyFutureMock(f); } | /**
* Test case for {@link DataStoreUtils#read(CheckedFuture)}.
*
* @throws Exception An error occurred.
*/ | Test case for <code>DataStoreUtils#read(CheckedFuture)</code> | testReadFuture | {
"repo_name": "opendaylight/vtn",
"path": "manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/util/DataStoreUtilsTest.java",
"license": "epl-1.0",
"size": 16876
} | [
"com.google.common.base.Optional",
"com.google.common.util.concurrent.CheckedFuture",
"java.util.concurrent.TimeoutException",
"org.opendaylight.controller.md.sal.common.api.data.ReadFailedException",
"org.opendaylight.vtn.manager.VTNException",
"org.opendaylight.vtn.manager.internal.util.inventory.SalPor... | import com.google.common.base.Optional; import com.google.common.util.concurrent.CheckedFuture; import java.util.concurrent.TimeoutException; import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException; import org.opendaylight.vtn.manager.VTNException; import org.opendaylight.vtn.manager.internal.util.inventory.SalPort; import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.impl.inventory.rev150209.vtn.node.info.VtnPort; import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.types.rev150209.VtnErrorTag; | import com.google.common.base.*; import com.google.common.util.concurrent.*; import java.util.concurrent.*; import org.opendaylight.controller.md.sal.common.api.data.*; import org.opendaylight.vtn.manager.*; import org.opendaylight.vtn.manager.internal.util.inventory.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.impl.inventory.rev150209.vtn.node.info.*; import org.opendaylight.yang.gen.v1.urn.opendaylight.vtn.types.rev150209.*; | [
"com.google.common",
"java.util",
"org.opendaylight.controller",
"org.opendaylight.vtn",
"org.opendaylight.yang"
] | com.google.common; java.util; org.opendaylight.controller; org.opendaylight.vtn; org.opendaylight.yang; | 2,838,217 |
protected static Integer[] computeYearsToSimulate(String[] args) {
Integer[] ret = null;
//
// Only care about the last argument.
String yearsToSimulate = args[args.length - 1];
StringTokenizer strtok = new StringTokenizer(yearsToSimulate, ",");
List<Integer> yts = new ArrayList<>();
while (strtok.hasMoreTokens()) {
Integer year = Integer.valueOf(strtok.nextToken());
// Validate year
NetworkUtils.validateYear(year);
yts.add(year);
}
ret = yts.toArray(new Integer[yts.size()]);
return ret;
}
/**
* Creates and returns the MultiLayerPerceptron network having an inner layer
* structure as specified by <code>neuronLayerDescriptor</code> and properties
* as specified by <code>neuronProperties</code>.
*
* @param neuronLayerDescriptor
* The complete layer structure (includes both the
* input layer and output layers)
*
* @param neuronProperties
* {@link NeuronProperties} | static Integer[] function(String[] args) { Integer[] ret = null; String yearsToSimulate = args[args.length - 1]; StringTokenizer strtok = new StringTokenizer(yearsToSimulate, ","); List<Integer> yts = new ArrayList<>(); while (strtok.hasMoreTokens()) { Integer year = Integer.valueOf(strtok.nextToken()); NetworkUtils.validateYear(year); yts.add(year); } ret = yts.toArray(new Integer[yts.size()]); return ret; } /** * Creates and returns the MultiLayerPerceptron network having an inner layer * structure as specified by <code>neuronLayerDescriptor</code> and properties * as specified by <code>neuronProperties</code>. * * @param neuronLayerDescriptor * The complete layer structure (includes both the * input layer and output layers) * * @param neuronProperties * {@link NeuronProperties} | /**
* Takes the last argument in a String[], which should be a comma-delimited
* list of years to simulate, tokenizes it and computes the years it contains.
* <p>
* <em>If the command line argument format changes for this program this method
* will most likely break!</em>
*
* @param args
* The input String array, the last element of which is a comma-delimited
* list of years to simulate when validating the network.
* Assumes only the last argument in the array is used.
* @return
*/ | Takes the last argument in a String[], which should be a comma-delimited list of years to simulate, tokenizes it and computes the years it contains. If the command line argument format changes for this program this method will most likely break | computeYearsToSimulate | {
"repo_name": "makotogo/developerWorks",
"path": "NcaaMarchMadness/src/main/java/com/makotojava/ncaabb/generation/MlpNetworkTrainer.java",
"license": "apache-2.0",
"size": 51487
} | [
"com.makotojava.ncaabb.util.NetworkUtils",
"java.util.ArrayList",
"java.util.List",
"java.util.StringTokenizer",
"org.neuroph.nnet.MultiLayerPerceptron",
"org.neuroph.util.NeuronProperties"
] | import com.makotojava.ncaabb.util.NetworkUtils; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import org.neuroph.nnet.MultiLayerPerceptron; import org.neuroph.util.NeuronProperties; | import com.makotojava.ncaabb.util.*; import java.util.*; import org.neuroph.nnet.*; import org.neuroph.util.*; | [
"com.makotojava.ncaabb",
"java.util",
"org.neuroph.nnet",
"org.neuroph.util"
] | com.makotojava.ncaabb; java.util; org.neuroph.nnet; org.neuroph.util; | 576,772 |
public LinkValue firstMatchingTag(Predicate<? super LinkValue> test) {
return firstMatchingLink("tags", test);
} | LinkValue function(Predicate<? super LinkValue> test) { return firstMatchingLink("tags", test); } | /**
* Return this first matching tag for this object
* @param test
* @return LinkValue
*/ | Return this first matching tag for this object | firstMatchingTag | {
"repo_name": "worldline-messaging/activitystreams",
"path": "core/src/main/java/com/ibm/common/activitystreams/ASObject.java",
"license": "apache-2.0",
"size": 65559
} | [
"com.google.common.base.Predicate"
] | import com.google.common.base.Predicate; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 2,266,834 |
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<Void> updateKeyCredentialsWithResponse(
String objectId, List<KeyCredentialInner> value, Context context) {
return updateKeyCredentialsWithResponseAsync(objectId, value, context).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) Response<Void> function( String objectId, List<KeyCredentialInner> value, Context context) { return updateKeyCredentialsWithResponseAsync(objectId, value, context).block(); } | /**
* Update the keyCredentials associated with a service principal.
*
* @param objectId The object ID for which to get service principal information.
* @param value A collection of KeyCredentials.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws GraphErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response.
*/ | Update the keyCredentials associated with a service principal | updateKeyCredentialsWithResponse | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/ServicePrincipalsClientImpl.java",
"license": "mit",
"size": 83566
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.authorization.fluent.models.KeyCredentialInner",
"java.util.List"
] | 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.authorization.fluent.models.KeyCredentialInner; import java.util.List; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.authorization.fluent.models.*; import java.util.*; | [
"com.azure.core",
"com.azure.resourcemanager",
"java.util"
] | com.azure.core; com.azure.resourcemanager; java.util; | 163,344 |
boolean checkUnionEquivalenceHelper(
UnionType that, EquivalenceMethod eqMethod, EqCache eqCache) {
Collection<JSType> thatAlternates = that.getAlternatesWithoutStructuralTyping();
if (eqMethod == EquivalenceMethod.IDENTITY
&& getAlternatesWithoutStructuralTyping().size() != thatAlternates.size()) {
return false;
}
for (JSType alternate : thatAlternates) {
if (!hasAlternate(alternate, eqMethod, eqCache)) {
return false;
}
}
return true;
} | boolean checkUnionEquivalenceHelper( UnionType that, EquivalenceMethod eqMethod, EqCache eqCache) { Collection<JSType> thatAlternates = that.getAlternatesWithoutStructuralTyping(); if (eqMethod == EquivalenceMethod.IDENTITY && getAlternatesWithoutStructuralTyping().size() != thatAlternates.size()) { return false; } for (JSType alternate : thatAlternates) { if (!hasAlternate(alternate, eqMethod, eqCache)) { return false; } } return true; } | /**
* Two union types are equal if, after flattening nested union types,
* they have the same number of alternates and all alternates are equal.
*/ | Two union types are equal if, after flattening nested union types, they have the same number of alternates and all alternates are equal | checkUnionEquivalenceHelper | {
"repo_name": "selkhateeb/closure-compiler",
"path": "src/com/google/javascript/rhino/jstype/UnionType.java",
"license": "apache-2.0",
"size": 20791
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,830,762 |
public void newAlbumTracksRequest(long albumId, final RequestCallback callback){
DeezerRequest request = DeezerRequestFactory.requestAlbumTracks(albumId);
makeRequest(request, callback);
} | void function(long albumId, final RequestCallback callback){ DeezerRequest request = DeezerRequestFactory.requestAlbumTracks(albumId); makeRequest(request, callback); } | /**
* Search the Deezer Api for all Tracks associated to an Albums with albumId
* @param albumId Album id to to search for
* @param callback RequestCallback to forwarding the request
*/ | Search the Deezer Api for all Tracks associated to an Albums with albumId | newAlbumTracksRequest | {
"repo_name": "ernestkamara/deezer-demo",
"path": "app/src/main/java/com/ernestkamara/deezersample/ApiRequestFactory.java",
"license": "apache-2.0",
"size": 3025
} | [
"com.deezer.sdk.network.request.DeezerRequest",
"com.deezer.sdk.network.request.DeezerRequestFactory"
] | import com.deezer.sdk.network.request.DeezerRequest; import com.deezer.sdk.network.request.DeezerRequestFactory; | import com.deezer.sdk.network.request.*; | [
"com.deezer.sdk"
] | com.deezer.sdk; | 2,763,150 |
public static java.util.List extractReferralRejectList(ims.domain.ILightweightDomainFactory domainFactory, ims.RefMan.vo.RejectReferralVoCollection voCollection)
{
return extractReferralRejectList(domainFactory, voCollection, null, new HashMap());
}
| static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.RefMan.vo.RejectReferralVoCollection voCollection) { return extractReferralRejectList(domainFactory, voCollection, null, new HashMap()); } | /**
* Create the ims.RefMan.domain.objects.ReferralReject list from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/ | Create the ims.RefMan.domain.objects.ReferralReject list from the value object collection | extractReferralRejectList | {
"repo_name": "open-health-hub/openMAXIMS",
"path": "openmaxims_workspace/ValueObjects/src/ims/RefMan/vo/domain/RejectReferralVoAssembler.java",
"license": "agpl-3.0",
"size": 16414
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 1,555,976 |
@Override
public final HandlerExecutionChain getHandler(HttpServletRequest request) throws Exception {
Object handler = getHandlerInternal(request);
if (handler == null) {
handler = getDefaultHandler();
}
if (handler == null) {
return null;
}
// Bean name or resolved handler?
if (handler instanceof String) {
String handlerName = (String) handler;
handler = getApplicationContext().getBean(handlerName);
}
HandlerExecutionChain executionChain = getHandlerExecutionChain(handler, request);
if (CorsUtils.isCorsRequest(request)) {
CorsConfiguration globalConfig = this.globalCorsConfigSource.getCorsConfiguration(request);
CorsConfiguration handlerConfig = getCorsConfiguration(handler, request);
CorsConfiguration config = (globalConfig != null ? globalConfig.combine(handlerConfig) : handlerConfig);
executionChain = getCorsHandlerExecutionChain(request, executionChain, config);
}
return executionChain;
} | final HandlerExecutionChain function(HttpServletRequest request) throws Exception { Object handler = getHandlerInternal(request); if (handler == null) { handler = getDefaultHandler(); } if (handler == null) { return null; } if (handler instanceof String) { String handlerName = (String) handler; handler = getApplicationContext().getBean(handlerName); } HandlerExecutionChain executionChain = getHandlerExecutionChain(handler, request); if (CorsUtils.isCorsRequest(request)) { CorsConfiguration globalConfig = this.globalCorsConfigSource.getCorsConfiguration(request); CorsConfiguration handlerConfig = getCorsConfiguration(handler, request); CorsConfiguration config = (globalConfig != null ? globalConfig.combine(handlerConfig) : handlerConfig); executionChain = getCorsHandlerExecutionChain(request, executionChain, config); } return executionChain; } | /**
* Look up a handler for the given request, falling back to the default
* handler if no specific one is found.
* @param request current HTTP request
* @return the corresponding handler instance, or the default handler
* @see #getHandlerInternal
*/ | Look up a handler for the given request, falling back to the default handler if no specific one is found | getHandler | {
"repo_name": "boggad/jdk9-sample",
"path": "sample-catalog/spring-jdk9/src/spring.webmvc/org/springframework/web/servlet/handler/AbstractHandlerMapping.java",
"license": "mit",
"size": 20043
} | [
"javax.servlet.http.HttpServletRequest",
"org.springframework.web.cors.CorsConfiguration",
"org.springframework.web.cors.CorsUtils",
"org.springframework.web.servlet.HandlerExecutionChain"
] | import javax.servlet.http.HttpServletRequest; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsUtils; import org.springframework.web.servlet.HandlerExecutionChain; | import javax.servlet.http.*; import org.springframework.web.cors.*; import org.springframework.web.servlet.*; | [
"javax.servlet",
"org.springframework.web"
] | javax.servlet; org.springframework.web; | 2,333,640 |
private void run() {
ProActiveRuntimeImpl impl = ProActiveRuntimeImpl.getProActiveRuntime();
impl.setVMName(this.vmName);
if (this.defaultRuntimeURL != null) {
ProActiveRuntime PART;
try {
PART = RuntimeFactory.getRuntime(this.defaultRuntimeURL);
register(PART);
impl.setParent(PART);
Object o = new Object();
synchronized (o) {
try {
o.wait();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} catch (ProActiveException e) {
e.printStackTrace();
// if we cannot get the parent, this jvm is useless
System.exit(0);
}
}
} | void function() { ProActiveRuntimeImpl impl = ProActiveRuntimeImpl.getProActiveRuntime(); impl.setVMName(this.vmName); if (this.defaultRuntimeURL != null) { ProActiveRuntime PART; try { PART = RuntimeFactory.getRuntime(this.defaultRuntimeURL); register(PART); impl.setParent(PART); Object o = new Object(); synchronized (o) { try { o.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } catch (ProActiveException e) { e.printStackTrace(); System.exit(0); } } } | /**
* <i><font size="-1" color="#FF0000">**For internal use only** </font></i>
* Runs the complete creation and registration of a ProActiveRuntime and creates a
* node once the creation is completed.
*/ | **For internal use only** Runs the complete creation and registration of a ProActiveRuntime and creates a node once the creation is completed | run | {
"repo_name": "paraita/programming",
"path": "programming-core/src/main/java/org/objectweb/proactive/core/runtime/StartRuntime.java",
"license": "agpl-3.0",
"size": 6376
} | [
"org.objectweb.proactive.core.ProActiveException"
] | import org.objectweb.proactive.core.ProActiveException; | import org.objectweb.proactive.core.*; | [
"org.objectweb.proactive"
] | org.objectweb.proactive; | 118,796 |
public boolean canDropFromExplosion(Explosion explosionIn)
{
return true;
} | boolean function(Explosion explosionIn) { return true; } | /**
* Return whether this block can drop from an explosion.
*/ | Return whether this block can drop from an explosion | canDropFromExplosion | {
"repo_name": "TorchPowered/Thallium",
"path": "src/main/java/net/minecraft/block/Block.java",
"license": "mit",
"size": 66867
} | [
"net.minecraft.world.Explosion"
] | import net.minecraft.world.Explosion; | import net.minecraft.world.*; | [
"net.minecraft.world"
] | net.minecraft.world; | 340,419 |
@Deprecated(since = "9")
@Override
public int viewToModel(JTextComponent a, Point b, Position.Bias[] c) {
int returnValue =
((TextUI) (uis.elementAt(0))).viewToModel(a,b,c);
for (int i = 1; i < uis.size(); i++) {
((TextUI) (uis.elementAt(i))).viewToModel(a,b,c);
}
return returnValue;
} | @Deprecated(since = "9") int function(JTextComponent a, Point b, Position.Bias[] c) { int returnValue = ((TextUI) (uis.elementAt(0))).viewToModel(a,b,c); for (int i = 1; i < uis.size(); i++) { ((TextUI) (uis.elementAt(i))).viewToModel(a,b,c); } return returnValue; } | /**
* Invokes the <code>viewToModel</code> method on each UI handled by this object.
*
* @return the value obtained from the first UI, which is
* the UI obtained from the default <code>LookAndFeel</code>
*/ | Invokes the <code>viewToModel</code> method on each UI handled by this object | viewToModel | {
"repo_name": "md-5/jdk10",
"path": "src/java.desktop/share/classes/javax/swing/plaf/multi/MultiTextUI.java",
"license": "gpl-2.0",
"size": 13807
} | [
"java.awt.Point",
"javax.swing.plaf.TextUI",
"javax.swing.text.JTextComponent",
"javax.swing.text.Position"
] | import java.awt.Point; import javax.swing.plaf.TextUI; import javax.swing.text.JTextComponent; import javax.swing.text.Position; | import java.awt.*; import javax.swing.plaf.*; import javax.swing.text.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 1,587,297 |
void shutdown() throws IOException; | void shutdown() throws IOException; | /**
* Destroy any resources associated with this builder. Call this once only, when all
* buildLocallyAndReturnExitCode calls have finished.
*
* @throws IOException
*/ | Destroy any resources associated with this builder. Call this once only, when all buildLocallyAndReturnExitCode calls have finished | shutdown | {
"repo_name": "ilya-klyuchnikov/buck",
"path": "src/com/facebook/buck/command/BuildExecutor.java",
"license": "apache-2.0",
"size": 2407
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,264,183 |
private String getReadableDateString(long time) {
//OWM API returns a unix timestamp in seconds
// convert it to milliseconds to convert to valid date
SimpleDateFormat shortenedDateFormat = new SimpleDateFormat("EEE MM dd");
return shortenedDateFormat.format(time);
} | String function(long time) { SimpleDateFormat shortenedDateFormat = new SimpleDateFormat(STR); return shortenedDateFormat.format(time); } | /**
* date time conversion method
*/ | date time conversion method | getReadableDateString | {
"repo_name": "acl4surf/Sunshine-Version-2-3.0",
"path": "app/src/main/java/com/example/android/sunshine/app/ForecastFragment.java",
"license": "apache-2.0",
"size": 11672
} | [
"java.text.SimpleDateFormat"
] | import java.text.SimpleDateFormat; | import java.text.*; | [
"java.text"
] | java.text; | 1,074,879 |
public static Object getOrThrow(CommandContext args, Text key) throws CommandException {
return args.getOne(key)
.orElseThrow(
() ->
new CommandException(
Text.of(
TextColors.DARK_RED,
"Argument not found",
": ",
TextColors.BLUE,
key)));
} | static Object function(CommandContext args, Text key) throws CommandException { return args.getOne(key) .orElseThrow( () -> new CommandException( Text.of( TextColors.DARK_RED, STR, STR, TextColors.BLUE, key))); } | /**
* Throws a {@link CommandException} if a argument is missing.
*
* @param args The command arguments.
* @param key The key of the argument to return
* @return The argument if it exists.
* @throws CommandException If the argument doesn't exist.
*/ | Throws a <code>CommandException</code> if a argument is missing | getOrThrow | {
"repo_name": "m0pt0pmatt/SpongeSurvivalGames",
"path": "src/main/java/io/github/m0pt0pmatt/survivalgames/Util.java",
"license": "mit",
"size": 7173
} | [
"org.spongepowered.api.command.CommandException",
"org.spongepowered.api.command.args.CommandContext",
"org.spongepowered.api.text.Text",
"org.spongepowered.api.text.format.TextColors"
] | import org.spongepowered.api.command.CommandException; import org.spongepowered.api.command.args.CommandContext; import org.spongepowered.api.text.Text; import org.spongepowered.api.text.format.TextColors; | import org.spongepowered.api.command.*; import org.spongepowered.api.command.args.*; import org.spongepowered.api.text.*; import org.spongepowered.api.text.format.*; | [
"org.spongepowered.api"
] | org.spongepowered.api; | 2,669,277 |
private boolean isLoggable() {
return Log.isLoggable(tag, level);
} | boolean function() { return Log.isLoggable(tag, level); } | /**
* Returns true if logging is turned on for this configuration.
*/ | Returns true if logging is turned on for this configuration | isLoggable | {
"repo_name": "Xlythe/AndroidTextManager",
"path": "android-text-manager/src/main/java/com/xlythe/textmanager/text/util/AndroidHttpClient.java",
"license": "apache-2.0",
"size": 19351
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 341,464 |
public static void writeExternal
(BasicStroke theStroke,
ObjectOutput out)
throws IOException
{
out.writeObject
(theStroke == null ? null : new StrokeWrapper (theStroke));
} | static void function (BasicStroke theStroke, ObjectOutput out) throws IOException { out.writeObject (theStroke == null ? null : new StrokeWrapper (theStroke)); } | /**
* Write the given BasicStroke object to the given object output stream.
*
* @param theStroke Stroke.
* @param out Object output stream.
*
* @exception IOException
* Thrown if an I/O error occurred.
*/ | Write the given BasicStroke object to the given object output stream | writeExternal | {
"repo_name": "JimiHFord/pj2",
"path": "lib/edu/rit/numeric/plot/Strokes.java",
"license": "lgpl-3.0",
"size": 7293
} | [
"java.awt.BasicStroke",
"java.io.IOException",
"java.io.ObjectOutput"
] | import java.awt.BasicStroke; import java.io.IOException; import java.io.ObjectOutput; | import java.awt.*; import java.io.*; | [
"java.awt",
"java.io"
] | java.awt; java.io; | 1,608,978 |
public synchronized void doCreateView(final StaplerRequest req,
final StaplerResponse rsp) throws IOException, ServletException,
ParseException, Descriptor.FormException {
checkPermission(CONFIGURE);
viewGroupMixIn.addView(View.create(req, rsp, this));
} | synchronized void function(final StaplerRequest req, final StaplerResponse rsp) throws IOException, ServletException, ParseException, Descriptor.FormException { checkPermission(CONFIGURE); viewGroupMixIn.addView(View.create(req, rsp, this)); } | /**
* Stapler URL binding for creating views for our branch projects. Unlike
* normal views, this only requires permission to configure the project,
* not
* create view permission.
*
* @param req - Stapler request
* @param rsp - Stapler response
* @throws IOException - if problems
* @throws ServletException - if problems
* @throws java.text.ParseException - if problems
* @throws Descriptor.FormException - if problems
*/ | Stapler URL binding for creating views for our branch projects. Unlike normal views, this only requires permission to configure the project, not create view permission | doCreateView | {
"repo_name": "gv2011/multi-branch-project-plugin",
"path": "src/main/java/org/zalando/jenkins/multibranch/AbstractMultiBranchProject.java",
"license": "mit",
"size": 37929
} | [
"hudson.model.Descriptor",
"hudson.model.View",
"java.io.IOException",
"java.text.ParseException",
"javax.servlet.ServletException",
"org.kohsuke.stapler.StaplerRequest",
"org.kohsuke.stapler.StaplerResponse"
] | import hudson.model.Descriptor; import hudson.model.View; import java.io.IOException; import java.text.ParseException; import javax.servlet.ServletException; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; | import hudson.model.*; import java.io.*; import java.text.*; import javax.servlet.*; import org.kohsuke.stapler.*; | [
"hudson.model",
"java.io",
"java.text",
"javax.servlet",
"org.kohsuke.stapler"
] | hudson.model; java.io; java.text; javax.servlet; org.kohsuke.stapler; | 2,202,636 |
protected ObjectInputStream createObjectInputStream(InputStream is) throws IOException {
return new CodebaseAwareObjectInputStream(is, getBeanClassLoader(), null);
} | ObjectInputStream function(InputStream is) throws IOException { return new CodebaseAwareObjectInputStream(is, getBeanClassLoader(), null); } | /**
* Create an ObjectInputStream for the given InputStream.
* <p>The default implementation creates a Spring {@link CodebaseAwareObjectInputStream}.
* @param is the InputStream to read from
* @return the new ObjectInputStream instance to use
* @throws java.io.IOException if creation of the ObjectInputStream failed
*/ | Create an ObjectInputStream for the given InputStream. The default implementation creates a Spring <code>CodebaseAwareObjectInputStream</code> | createObjectInputStream | {
"repo_name": "cbeams-archive/spring-framework-2.5.x",
"path": "src/org/springframework/remoting/rmi/RemoteInvocationSerializingExporter.java",
"license": "apache-2.0",
"size": 5624
} | [
"java.io.IOException",
"java.io.InputStream",
"java.io.ObjectInputStream"
] | import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; | import java.io.*; | [
"java.io"
] | java.io; | 518,792 |
@GET
@Path("{id: \\d+}")
public CompanyDetailDTO getCompany(@PathParam("id") Long id) {
return new CompanyDetailDTO(companyLogic.getCompany(id));
} | @Path(STR) CompanyDetailDTO function(@PathParam("id") Long id) { return new CompanyDetailDTO(companyLogic.getCompany(id)); } | /**
* Obtiene los datos de una instancia de Company a partir de su ID
*
* @param id Identificador de la instancia a consultar
* @return Instancia de CompanyDetailDTO con los datos del Company
* consultado
*
*/ | Obtiene los datos de una instancia de Company a partir de su ID | getCompany | {
"repo_name": "Uniandes-isis2603/company_back",
"path": "company-api/src/main/java/co/edu/uniandes/csw/company/resources/CompanyResource.java",
"license": "mit",
"size": 5261
} | [
"co.edu.uniandes.csw.company.dtos.CompanyDetailDTO",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam"
] | import co.edu.uniandes.csw.company.dtos.CompanyDetailDTO; import javax.ws.rs.Path; import javax.ws.rs.PathParam; | import co.edu.uniandes.csw.company.dtos.*; import javax.ws.rs.*; | [
"co.edu.uniandes",
"javax.ws"
] | co.edu.uniandes; javax.ws; | 1,620,055 |
private void validateServiceComponentHost(ServiceComponent serviceComponent,
ServiceComponentHost serviceComponentHost,
UpgradeCheckResult result,
List<String> errorMessages) {
if (serviceComponentHost.getUpgradeState().equals(UpgradeState.VERSION_MISMATCH)) {
String hostName = serviceComponentHost.getHostName();
String serviceComponentName = serviceComponentHost.getServiceComponentName();
String desiredVersion = serviceComponent.getDesiredVersion();
String actualVersion = serviceComponentHost.getVersion();
String message = hostName + "/" + serviceComponentName
+ " desired version: " + desiredVersion
+ ", actual version: " + actualVersion;
result.getFailedOn().add(hostName);
errorMessages.add(message);
}
} | void function(ServiceComponent serviceComponent, ServiceComponentHost serviceComponentHost, UpgradeCheckResult result, List<String> errorMessages) { if (serviceComponentHost.getUpgradeState().equals(UpgradeState.VERSION_MISMATCH)) { String hostName = serviceComponentHost.getHostName(); String serviceComponentName = serviceComponentHost.getServiceComponentName(); String desiredVersion = serviceComponent.getDesiredVersion(); String actualVersion = serviceComponentHost.getVersion(); String message = hostName + "/" + serviceComponentName + STR + desiredVersion + STR + actualVersion; result.getFailedOn().add(hostName); errorMessages.add(message); } } | /**
* Validates host component. If upgrade state of host component is VERSION_MISMATCH,
* adds hostname to a Failed On map of prerequisite check, and adds all other
* host component version details to errorMessages
* @param serviceComponent
* @param serviceComponentHost
* @param result
* @param errorMessages
*/ | Validates host component. If upgrade state of host component is VERSION_MISMATCH, adds hostname to a Failed On map of prerequisite check, and adds all other host component version details to errorMessages | validateServiceComponentHost | {
"repo_name": "sekikn/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java",
"license": "apache-2.0",
"size": 6084
} | [
"java.util.List",
"org.apache.ambari.server.state.ServiceComponent",
"org.apache.ambari.server.state.ServiceComponentHost",
"org.apache.ambari.server.state.UpgradeState",
"org.apache.ambari.spi.upgrade.UpgradeCheckResult"
] | import java.util.List; import org.apache.ambari.server.state.ServiceComponent; import org.apache.ambari.server.state.ServiceComponentHost; import org.apache.ambari.server.state.UpgradeState; import org.apache.ambari.spi.upgrade.UpgradeCheckResult; | import java.util.*; import org.apache.ambari.server.state.*; import org.apache.ambari.spi.upgrade.*; | [
"java.util",
"org.apache.ambari"
] | java.util; org.apache.ambari; | 762,719 |
ObjectInspector result = cachedStandardObjectInspector.get(typeInfo);
if (result == null) {
switch(typeInfo.getCategory()) {
case PRIMITIVE: {
result = ObjectInspectorFactory.getStandardPrimitiveObjectInspector(typeInfo.getPrimitiveClass());
break;
}
case LIST: {
ObjectInspector elementObjectInspector = getStandardObjectInspectorFromTypeInfo(typeInfo.getListElementTypeInfo());
result = ObjectInspectorFactory.getStandardListObjectInspector(elementObjectInspector);
break;
}
case MAP: {
ObjectInspector keyObjectInspector = getStandardObjectInspectorFromTypeInfo(typeInfo.getMapKeyTypeInfo());
ObjectInspector valueObjectInspector = getStandardObjectInspectorFromTypeInfo(typeInfo.getMapValueTypeInfo());
result = ObjectInspectorFactory.getStandardMapObjectInspector(keyObjectInspector, valueObjectInspector);
break;
}
case STRUCT: {
List<String> fieldNames = typeInfo.getAllStructFieldNames();
List<TypeInfo> fieldTypeInfos = typeInfo.getAllStructFieldTypeInfos();
List<ObjectInspector> fieldObjectInspectors = new ArrayList<ObjectInspector>(fieldTypeInfos.size());
for(int i=0; i<fieldTypeInfos.size(); i++) {
fieldObjectInspectors.add(getStandardObjectInspectorFromTypeInfo(fieldTypeInfos.get(i)));
}
result = ObjectInspectorFactory.getStandardStructObjectInspector(fieldNames, fieldObjectInspectors);
break;
}
default: {
result = null;
}
}
cachedStandardObjectInspector.put(typeInfo, result);
}
return result;
}
| ObjectInspector result = cachedStandardObjectInspector.get(typeInfo); if (result == null) { switch(typeInfo.getCategory()) { case PRIMITIVE: { result = ObjectInspectorFactory.getStandardPrimitiveObjectInspector(typeInfo.getPrimitiveClass()); break; } case LIST: { ObjectInspector elementObjectInspector = getStandardObjectInspectorFromTypeInfo(typeInfo.getListElementTypeInfo()); result = ObjectInspectorFactory.getStandardListObjectInspector(elementObjectInspector); break; } case MAP: { ObjectInspector keyObjectInspector = getStandardObjectInspectorFromTypeInfo(typeInfo.getMapKeyTypeInfo()); ObjectInspector valueObjectInspector = getStandardObjectInspectorFromTypeInfo(typeInfo.getMapValueTypeInfo()); result = ObjectInspectorFactory.getStandardMapObjectInspector(keyObjectInspector, valueObjectInspector); break; } case STRUCT: { List<String> fieldNames = typeInfo.getAllStructFieldNames(); List<TypeInfo> fieldTypeInfos = typeInfo.getAllStructFieldTypeInfos(); List<ObjectInspector> fieldObjectInspectors = new ArrayList<ObjectInspector>(fieldTypeInfos.size()); for(int i=0; i<fieldTypeInfos.size(); i++) { fieldObjectInspectors.add(getStandardObjectInspectorFromTypeInfo(fieldTypeInfos.get(i))); } result = ObjectInspectorFactory.getStandardStructObjectInspector(fieldNames, fieldObjectInspectors); break; } default: { result = null; } } cachedStandardObjectInspector.put(typeInfo, result); } return result; } | /**
* Returns the standard object inspector that can be used to translate an object of that typeInfo
* to a standard object type.
*/ | Returns the standard object inspector that can be used to translate an object of that typeInfo to a standard object type | getStandardObjectInspectorFromTypeInfo | {
"repo_name": "sbyoun/i-mapreduce",
"path": "src/contrib/hive/ql/src/java/org/apache/hadoop/hive/ql/typeinfo/TypeInfoUtils.java",
"license": "apache-2.0",
"size": 4895
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector",
"org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory"
] | import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory; | import java.util.*; import org.apache.hadoop.hive.serde2.objectinspector.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 2,258,444 |
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.store = new HashMap();
int keyCount = stream.readInt();
for (int i = 0; i < keyCount; i++) {
Comparable key = (Comparable) stream.readObject();
Paint paint = SerialUtilities.readPaint(stream);
this.store.put(key, paint);
}
} | void function(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.store = new HashMap(); int keyCount = stream.readInt(); for (int i = 0; i < keyCount; i++) { Comparable key = (Comparable) stream.readObject(); Paint paint = SerialUtilities.readPaint(stream); this.store.put(key, paint); } } | /**
* Provides serialization support.
*
* @param stream the input stream.
*
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/ | Provides serialization support | readObject | {
"repo_name": "opensim-org/opensim-gui",
"path": "Gui/opensim/jfreechart/src/org/jfree/chart/PaintMap.java",
"license": "apache-2.0",
"size": 6900
} | [
"java.awt.Paint",
"java.io.IOException",
"java.io.ObjectInputStream",
"java.util.HashMap",
"org.jfree.io.SerialUtilities"
] | import java.awt.Paint; import java.io.IOException; import java.io.ObjectInputStream; import java.util.HashMap; import org.jfree.io.SerialUtilities; | import java.awt.*; import java.io.*; import java.util.*; import org.jfree.io.*; | [
"java.awt",
"java.io",
"java.util",
"org.jfree.io"
] | java.awt; java.io; java.util; org.jfree.io; | 2,616,029 |
void permissionRoles()
{
Permission pe;
try
{
Permission permission = new Permission();
ReaderUtil.clearScreen();
System.out.println( "Enter perm object name:" );
String name = ReaderUtil.readLn();
permission.setObjName( name );
System.out.println( "Enter perm object id or null for none:" );
String oid = ReaderUtil.readLn();
permission.setObjId( oid );
System.out.println( "Enter perm operation name:" );
String op = ReaderUtil.readLn();
permission.setOpName( op );
pe = rm.readPermission( permission );
if ( pe != null )
{
//System.out.println("perm operation [" + pe.operation + "]");
System.out.println( "object name [" + pe.getObjName() + "]" );
System.out.println( "object id [" + pe.getObjId() + "]" );
System.out.println( "operation name [" + pe.getOpName() + "]" );
System.out.println( "abstract perm name [" + pe.getAbstractName() + "]" );
System.out.println( "internalId [" + pe.getInternalId() + "]" );
if ( pe.getRoles() != null && pe.getRoles().size() > 0 )
{
int ctr = 0;
for ( String role : pe.getRoles() )
{
System.out.println( "name[" + ctr++ + "]=" + role );
}
}
System.out.println( "**" );
System.out.println( "read operation complete" );
System.out.println( "ENTER to continue" );
}
}
catch ( SecurityException e )
{
LOG.error( "permissionRoles caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e );
}
ReaderUtil.readChar();
} | void permissionRoles() { Permission pe; try { Permission permission = new Permission(); ReaderUtil.clearScreen(); System.out.println( STR ); String name = ReaderUtil.readLn(); permission.setObjName( name ); System.out.println( STR ); String oid = ReaderUtil.readLn(); permission.setObjId( oid ); System.out.println( STR ); String op = ReaderUtil.readLn(); permission.setOpName( op ); pe = rm.readPermission( permission ); if ( pe != null ) { System.out.println( STR + pe.getObjName() + "]" ); System.out.println( STR + pe.getObjId() + "]" ); System.out.println( STR + pe.getOpName() + "]" ); System.out.println( STR + pe.getAbstractName() + "]" ); System.out.println( STR + pe.getInternalId() + "]" ); if ( pe.getRoles() != null && pe.getRoles().size() > 0 ) { int ctr = 0; for ( String role : pe.getRoles() ) { System.out.println( "name[" + ctr++ + "]=" + role ); } } System.out.println( "**" ); System.out.println( STR ); System.out.println( STR ); } } catch ( SecurityException e ) { LOG.error( STR + e.getErrorId() + STR + e.getMessage(), e ); } ReaderUtil.readChar(); } | /**
* Description of the Method
*/ | Description of the Method | permissionRoles | {
"repo_name": "PennState/directory-fortress-core-1",
"path": "src/test/java/org/apache/directory/fortress/core/ReviewMgrConsole.java",
"license": "apache-2.0",
"size": 42212
} | [
"org.apache.directory.fortress.core.model.Permission"
] | import org.apache.directory.fortress.core.model.Permission; | import org.apache.directory.fortress.core.model.*; | [
"org.apache.directory"
] | org.apache.directory; | 509,378 |
if (definition instanceof AssignDefinition) {
AssignDefinition d = (AssignDefinition) definition;
if (d.target.indexOf('.') != -1) {
if (d.target.startsWith("self.")) {
//ok, it is a member and not a local
return new PyRenameSelfAttributeProcess(definition, d.target);
} else {
return new PyRenameAttributeProcess(definition, d.target);
}
} else {
if (definition.scope != null) {
//classvar
if (definition.scope.isLastClassDef()) {
return new PyRenameAttributeProcess(definition, d.target);
}
FastStack scopeStack = definition.scope.getScopeStack();
if (request.moduleName.equals(definition.module.getName())) {
if (!scopeStack.empty()) {
Object peek = scopeStack.peek();
if (peek instanceof FunctionDef) {
return new PyRenameLocalProcess(definition);
}
}
}
}
return new PyRenameGlobalProcess(definition);
}
}
if (isModuleRename(definition)) {
return new PyRenameImportProcess(definition);
}
if (definition.ast != null) {
if (definition.ast instanceof ClassDef) {
return new PyRenameClassProcess(definition);
}
if (definition.ast instanceof Name) {
Name n = (Name) definition.ast;
if (n.ctx == Name.Param || n.ctx == Attribute.KwOnlyParam) {
return new PyRenameParameterProcess(definition);
}
}
if (definition instanceof KeywordParameterDefinition) {
return new PyRenameParameterProcess((KeywordParameterDefinition) definition, request.nature);
}
if (definition.ast instanceof FunctionDef) {
return new PyRenameFunctionProcess(definition);
}
}
if (definition.scope != null) {
//classvar
if (definition.scope.isLastClassDef()) {
return new PyRenameAttributeProcess(definition, definition.value);
}
FastStack scopeStack = definition.scope.getScopeStack();
if (request.moduleName.equals(definition.module.getName())) {
if (!scopeStack.empty()) {
Object peek = scopeStack.peek();
if (peek instanceof FunctionDef) {
return new PyRenameLocalProcess(definition);
}
}
}
}
return new PyRenameAnyLocalProcess();
// return new PyRenameGlobalProcess(definition);
} | if (definition instanceof AssignDefinition) { AssignDefinition d = (AssignDefinition) definition; if (d.target.indexOf('.') != -1) { if (d.target.startsWith("self.")) { return new PyRenameSelfAttributeProcess(definition, d.target); } else { return new PyRenameAttributeProcess(definition, d.target); } } else { if (definition.scope != null) { if (definition.scope.isLastClassDef()) { return new PyRenameAttributeProcess(definition, d.target); } FastStack scopeStack = definition.scope.getScopeStack(); if (request.moduleName.equals(definition.module.getName())) { if (!scopeStack.empty()) { Object peek = scopeStack.peek(); if (peek instanceof FunctionDef) { return new PyRenameLocalProcess(definition); } } } } return new PyRenameGlobalProcess(definition); } } if (isModuleRename(definition)) { return new PyRenameImportProcess(definition); } if (definition.ast != null) { if (definition.ast instanceof ClassDef) { return new PyRenameClassProcess(definition); } if (definition.ast instanceof Name) { Name n = (Name) definition.ast; if (n.ctx == Name.Param n.ctx == Attribute.KwOnlyParam) { return new PyRenameParameterProcess(definition); } } if (definition instanceof KeywordParameterDefinition) { return new PyRenameParameterProcess((KeywordParameterDefinition) definition, request.nature); } if (definition.ast instanceof FunctionDef) { return new PyRenameFunctionProcess(definition); } } if (definition.scope != null) { if (definition.scope.isLastClassDef()) { return new PyRenameAttributeProcess(definition, definition.value); } FastStack scopeStack = definition.scope.getScopeStack(); if (request.moduleName.equals(definition.module.getName())) { if (!scopeStack.empty()) { Object peek = scopeStack.peek(); if (peek instanceof FunctionDef) { return new PyRenameLocalProcess(definition); } } } } return new PyRenameAnyLocalProcess(); } | /**
* Decides which process should take care of the request.
* @param request
*/ | Decides which process should take care of the request | getProcess | {
"repo_name": "akurtakov/Pydev",
"path": "plugins/com.python.pydev.analysis/src/com/python/pydev/analysis/refactoring/wizards/RefactorProcessFactory.java",
"license": "epl-1.0",
"size": 5703
} | [
"com.python.pydev.analysis.refactoring.wizards.rename.PyRenameAnyLocalProcess",
"com.python.pydev.analysis.refactoring.wizards.rename.PyRenameAttributeProcess",
"com.python.pydev.analysis.refactoring.wizards.rename.PyRenameClassProcess",
"com.python.pydev.analysis.refactoring.wizards.rename.PyRenameFunctionPr... | import com.python.pydev.analysis.refactoring.wizards.rename.PyRenameAnyLocalProcess; import com.python.pydev.analysis.refactoring.wizards.rename.PyRenameAttributeProcess; import com.python.pydev.analysis.refactoring.wizards.rename.PyRenameClassProcess; import com.python.pydev.analysis.refactoring.wizards.rename.PyRenameFunctionProcess; import com.python.pydev.analysis.refactoring.wizards.rename.PyRenameGlobalProcess; import com.python.pydev.analysis.refactoring.wizards.rename.PyRenameImportProcess; import com.python.pydev.analysis.refactoring.wizards.rename.PyRenameLocalProcess; import com.python.pydev.analysis.refactoring.wizards.rename.PyRenameParameterProcess; import com.python.pydev.analysis.refactoring.wizards.rename.PyRenameSelfAttributeProcess; import org.python.pydev.ast.codecompletion.revisited.visitors.AssignDefinition; import org.python.pydev.ast.codecompletion.revisited.visitors.KeywordParameterDefinition; import org.python.pydev.parser.jython.ast.Attribute; import org.python.pydev.parser.jython.ast.ClassDef; import org.python.pydev.parser.jython.ast.FunctionDef; import org.python.pydev.parser.jython.ast.Name; import org.python.pydev.shared_core.structure.FastStack; | import com.python.pydev.analysis.refactoring.wizards.rename.*; import org.python.pydev.ast.codecompletion.revisited.visitors.*; import org.python.pydev.parser.jython.ast.*; import org.python.pydev.shared_core.structure.*; | [
"com.python.pydev",
"org.python.pydev"
] | com.python.pydev; org.python.pydev; | 42,757 |
@Test
public void testBuildAttributeStatementWithPartialAttributes() throws Exception {
if (SAMLBuilder.isInitailized()) {
// re-initialize the requested attributes
requestAttributes = new ArrayList<Attribute>();
requestAttributes.add( builder.getAttribute(SAMLParameters.FIRST_NAME, SAMLParameters.FIRST_NAME_FRIENDLY, null) );
requestAttributes.add( builder.getAttribute(SAMLParameters.LAST_NAME, SAMLParameters.LAST_NAME_FRIENDLY, null) );
// execute service invocation
final Assertion assertion = samlAttributeStatementHandler.buildAttributeStatement(testAttributes, requestAttributes);
// compare to expected test XML
final Element assertionElement = builder.marshall(assertion);
final String xml = Serializer.DOMtoString((Node)assertionElement);
if (LOG.isDebugEnabled()) LOG.debug(xml);
XmlChecker.compare(xml, SAMLTestParameters.ATTRIBUTES_FILE_PARTIAL);
}
}
| void function() throws Exception { if (SAMLBuilder.isInitailized()) { requestAttributes = new ArrayList<Attribute>(); requestAttributes.add( builder.getAttribute(SAMLParameters.FIRST_NAME, SAMLParameters.FIRST_NAME_FRIENDLY, null) ); requestAttributes.add( builder.getAttribute(SAMLParameters.LAST_NAME, SAMLParameters.LAST_NAME_FRIENDLY, null) ); final Assertion assertion = samlAttributeStatementHandler.buildAttributeStatement(testAttributes, requestAttributes); final Element assertionElement = builder.marshall(assertion); final String xml = Serializer.DOMtoString((Node)assertionElement); if (LOG.isDebugEnabled()) LOG.debug(xml); XmlChecker.compare(xml, SAMLTestParameters.ATTRIBUTES_FILE_PARTIAL); } } | /**
* Tests that only requested attributes are included into attribute statement.
* @throws Exception
*/ | Tests that only requested attributes are included into attribute statement | testBuildAttributeStatementWithPartialAttributes | {
"repo_name": "ncaripsl/esgf-security",
"path": "src/java/test/esg/security/attr/service/impl/SAMLAttributeStatementHandlerImplTest.java",
"license": "bsd-3-clause",
"size": 12029
} | [
"java.util.ArrayList",
"org.opensaml.saml2.core.Assertion",
"org.opensaml.saml2.core.Attribute",
"org.w3c.dom.Element",
"org.w3c.dom.Node"
] | import java.util.ArrayList; import org.opensaml.saml2.core.Assertion; import org.opensaml.saml2.core.Attribute; import org.w3c.dom.Element; import org.w3c.dom.Node; | import java.util.*; import org.opensaml.saml2.core.*; import org.w3c.dom.*; | [
"java.util",
"org.opensaml.saml2",
"org.w3c.dom"
] | java.util; org.opensaml.saml2; org.w3c.dom; | 1,646,654 |
public void exitQuery_specification(SQLParser.Query_specificationContext ctx) { } | public void exitQuery_specification(SQLParser.Query_specificationContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | enterQuery_specification | {
"repo_name": "HEIG-GAPS/slasher",
"path": "slasher.corrector/src/main/java/ch/gaps/slasher/corrector/SQLParserBaseListener.java",
"license": "mit",
"size": 73849
} | [
"ch.gaps.slasher.corrector.SQLParser"
] | import ch.gaps.slasher.corrector.SQLParser; | import ch.gaps.slasher.corrector.*; | [
"ch.gaps.slasher"
] | ch.gaps.slasher; | 761,309 |
public void revert(final ResourceResolverContext context) {
for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllUsedModifiable()) {
p.revert();
}
} | void function(final ResourceResolverContext context) { for (final AuthenticatedResourceProvider p : context.getProviderManager().getAllUsedModifiable()) { p.revert(); } } | /**
* Revert changes on all modifiable ResourceProviders.
*/ | Revert changes on all modifiable ResourceProviders | revert | {
"repo_name": "Nimco/sling",
"path": "bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverControl.java",
"license": "apache-2.0",
"size": 33916
} | [
"org.apache.sling.resourceresolver.impl.providers.stateful.AuthenticatedResourceProvider"
] | import org.apache.sling.resourceresolver.impl.providers.stateful.AuthenticatedResourceProvider; | import org.apache.sling.resourceresolver.impl.providers.stateful.*; | [
"org.apache.sling"
] | org.apache.sling; | 1,802,384 |
public Builder<K, V> put(Entry<? extends K, ? extends V> entry) {
return put(entry.getKey(), entry.getValue());
} | Builder<K, V> function(Entry<? extends K, ? extends V> entry) { return put(entry.getKey(), entry.getValue()); } | /**
* Adds an entry to the built multimap.
*
* @since 11.0
*/ | Adds an entry to the built multimap | put | {
"repo_name": "aiyanbo/guava",
"path": "guava/src/com/google/common/collect/ImmutableMultimap.java",
"license": "apache-2.0",
"size": 21494
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,752,884 |
public native MagickImage borderImage(Rectangle borderInfo)
throws MagickException; | native MagickImage function(Rectangle borderInfo) throws MagickException; | /**
* Surrounds the image with a border of the color defined by
* the border color member of the image structure. The width
* and height of the border are defined by the corresponding
* members of the Rectangle.
*
* @param borderInfo the rectangle for which border is drawn
* @return an Image with a border around it
* @exception MagickException on error
* @see #setBorderColor
* @see #getBorderColor
*/ | Surrounds the image with a border of the color defined by the border color member of the image structure. The width and height of the border are defined by the corresponding members of the Rectangle | borderImage | {
"repo_name": "marianvandzura/jmagick",
"path": "src/magick/MagickImage.java",
"license": "lgpl-2.1",
"size": 66515
} | [
"java.awt.Rectangle"
] | import java.awt.Rectangle; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,461,586 |
public void setShippingAddress(ShippingAddressInfo shippingAddress) {
this.shippingAddress = shippingAddress;
}
| void function(ShippingAddressInfo shippingAddress) { this.shippingAddress = shippingAddress; } | /**
* Setter for shippingAddress
*/ | Setter for shippingAddress | setShippingAddress | {
"repo_name": "DAC-2014-Equipe-3/sujet-2",
"path": "sujet2/src/main/java/com/paypal/svcs/types/ap/SenderOptions.java",
"license": "mit",
"size": 4454
} | [
"com.paypal.svcs.types.ap.ShippingAddressInfo"
] | import com.paypal.svcs.types.ap.ShippingAddressInfo; | import com.paypal.svcs.types.ap.*; | [
"com.paypal.svcs"
] | com.paypal.svcs; | 1,504,655 |
private File getLatestBuildDirectory(File targetDirectory) throws IOException {
if (targetDirectory != null && targetDirectory.listFiles() != null) {
List<File> fud = Arrays.asList(targetDirectory.listFiles());
// Remove symlinks, which are just numbered. We want to be able to use the date.
List<File> contents = new ArrayList<>();
for (File f : fud) {
if (!FileUtils.isSymlink(f)) {
contents.add(f);
}
}
Collections.sort(contents, new BuildDirectoryComparator());
Collections.reverse(contents);
if (!contents.isEmpty()) {
File lastBuildDirectory = contents.get(0);
String latestBuildFileName = lastBuildDirectory.getAbsolutePath() + "/build.xml";
File lastBuildFile = new File(latestBuildFileName);
if (lastBuildFile.exists()) {
return lastBuildDirectory;
} else if (contents.size() > 1) {
System.out.println(">>>> Couldn't find [" + latestBuildFileName + "] using " + contents.get(2));
return contents.get(1);
}
}
}
return null;
} | File function(File targetDirectory) throws IOException { if (targetDirectory != null && targetDirectory.listFiles() != null) { List<File> fud = Arrays.asList(targetDirectory.listFiles()); List<File> contents = new ArrayList<>(); for (File f : fud) { if (!FileUtils.isSymlink(f)) { contents.add(f); } } Collections.sort(contents, new BuildDirectoryComparator()); Collections.reverse(contents); if (!contents.isEmpty()) { File lastBuildDirectory = contents.get(0); String latestBuildFileName = lastBuildDirectory.getAbsolutePath() + STR; File lastBuildFile = new File(latestBuildFileName); if (lastBuildFile.exists()) { return lastBuildDirectory; } else if (contents.size() > 1) { System.out.println(STR + latestBuildFileName + STR + contents.get(2)); return contents.get(1); } } } return null; } | /**
* Return the latest build in a given build directory
*
* @param targetDirectory Something like: cxf-2.6.0.fuse-7-1-x-stable-platform/configurations/axis-jdk/jdk6/axis-label/ubuntu/builds/
* @return cxf-2.6.0.fuse-7-1-x-stable-platform/configurations/axis-jdk/jdk6/axis-label/ubuntu/builds/2012-11-02_21-09-35
*/ | Return the latest build in a given build directory | getLatestBuildDirectory | {
"repo_name": "fusesource/hudson-results",
"path": "src/main/java/org/fusesource/hudsonresults/SummarizeBuildResults.java",
"license": "apache-2.0",
"size": 15613
} | [
"java.io.File",
"java.io.IOException",
"java.util.ArrayList",
"java.util.Arrays",
"java.util.Collections",
"java.util.List",
"org.apache.commons.io.FileUtils"
] | import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.apache.commons.io.FileUtils; | import java.io.*; import java.util.*; import org.apache.commons.io.*; | [
"java.io",
"java.util",
"org.apache.commons"
] | java.io; java.util; org.apache.commons; | 680,558 |
public void setSelectedTvShowSeason(TvShowSeason tvShowSeason) {
TvShowSeason oldValue = this.selectedTvShowSeason;
if (tvShowSeason != null) {
this.selectedTvShowSeason = tvShowSeason;
}
else {
this.selectedTvShowSeason = null;
}
if (oldValue != null) {
oldValue.removePropertyChangeListener(propertyChangeListener);
}
if (this.selectedTvShowSeason != null) {
this.selectedTvShowSeason.addPropertyChangeListener(propertyChangeListener);
}
firePropertyChange(SELECTED_TV_SHOW_SEASON, oldValue, this.selectedTvShowSeason);
} | void function(TvShowSeason tvShowSeason) { TvShowSeason oldValue = this.selectedTvShowSeason; if (tvShowSeason != null) { this.selectedTvShowSeason = tvShowSeason; } else { this.selectedTvShowSeason = null; } if (oldValue != null) { oldValue.removePropertyChangeListener(propertyChangeListener); } if (this.selectedTvShowSeason != null) { this.selectedTvShowSeason.addPropertyChangeListener(propertyChangeListener); } firePropertyChange(SELECTED_TV_SHOW_SEASON, oldValue, this.selectedTvShowSeason); } | /**
* Sets the selected tv show season.
*
* @param tvShowSeason
* the new selected tv show season
*/ | Sets the selected tv show season | setSelectedTvShowSeason | {
"repo_name": "mlaggner/tinyMediaManager",
"path": "src/org/tinymediamanager/ui/tvshows/TvShowSeasonSelectionModel.java",
"license": "apache-2.0",
"size": 2423
} | [
"org.tinymediamanager.core.tvshow.entities.TvShowSeason"
] | import org.tinymediamanager.core.tvshow.entities.TvShowSeason; | import org.tinymediamanager.core.tvshow.entities.*; | [
"org.tinymediamanager.core"
] | org.tinymediamanager.core; | 1,576,282 |
public Builder setCustomImageRequestBuilder(ImageRequestBuilder customImageRequestBuilder) {
this.customImageRequestBuilder = customImageRequestBuilder;
return this;
} | Builder function(ImageRequestBuilder customImageRequestBuilder) { this.customImageRequestBuilder = customImageRequestBuilder; return this; } | /**
* Set @{@code ImageRequestBuilder} for drawees. Use it for post-processing, custom resize options etc.
* Use {@link ImageViewer#createImageRequestBuilder()} to create its new instance.
*
* @return This Builder object to allow for chaining of calls to set methods
*/ | Set @ImageRequestBuilder for drawees. Use it for post-processing, custom resize options etc. Use <code>ImageViewer#createImageRequestBuilder()</code> to create its new instance | setCustomImageRequestBuilder | {
"repo_name": "merryjs/photo-viewer",
"path": "android/src/main/java/com/stfalcon/frescoimageviewer/ImageViewer.java",
"license": "apache-2.0",
"size": 15415
} | [
"com.facebook.imagepipeline.request.ImageRequestBuilder"
] | import com.facebook.imagepipeline.request.ImageRequestBuilder; | import com.facebook.imagepipeline.request.*; | [
"com.facebook.imagepipeline"
] | com.facebook.imagepipeline; | 367,508 |
T visitDdlStatement(@NotNull CQLParser.DdlStatementContext ctx); | T visitDdlStatement(@NotNull CQLParser.DdlStatementContext ctx); | /**
* Visit a parse tree produced by {@link CQLParser#ddlStatement}.
*/ | Visit a parse tree produced by <code>CQLParser#ddlStatement</code> | visitDdlStatement | {
"repo_name": "HuaweiBigData/StreamCQL",
"path": "cql/src/main/java/com/huawei/streaming/cql/semanticanalyzer/parser/CQLParserVisitor.java",
"license": "apache-2.0",
"size": 29279
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 2,160,990 |
public int evaluate(AnimationState as) {
if(programKeys != null) {
return evaluateProgram(as);
}
return evaluateExpr(as);
} | int function(AnimationState as) { if(programKeys != null) { return evaluateProgram(as); } return evaluateExpr(as); } | /**
* Evaluates the expression list.
*
* @param as the animation stateor null
* @return the index of the first matching expression or
* {@link #getNumExpressions()} when no expression matches
*/ | Evaluates the expression list | evaluate | {
"repo_name": "ColaMachine/MyBlock",
"path": "src/main/java/de/matthiasmann/twl/utils/StateSelect.java",
"license": "bsd-2-clause",
"size": 4706
} | [
"de.matthiasmann.twl.renderer.AnimationState"
] | import de.matthiasmann.twl.renderer.AnimationState; | import de.matthiasmann.twl.renderer.*; | [
"de.matthiasmann.twl"
] | de.matthiasmann.twl; | 1,168,427 |
public void registerStore(String storeName, Scope scope)
throws SyncException; | void function(String storeName, Scope scope) throws SyncException; | /**
* Create a store with the given store name and scope
* @param storeName the name of the store
* @param scope the distribution scope for the data
* @throws SyncException
*/ | Create a store with the given store name and scope | registerStore | {
"repo_name": "Syn-Flow/Controller",
"path": "src/main/java/org/sdnplatform/sync/ISyncService.java",
"license": "apache-2.0",
"size": 5513
} | [
"org.sdnplatform.sync.error.SyncException"
] | import org.sdnplatform.sync.error.SyncException; | import org.sdnplatform.sync.error.*; | [
"org.sdnplatform.sync"
] | org.sdnplatform.sync; | 917,750 |
public String StrSelectShieldWhere(String _tabla, String _campo, String _condicion){
String strRetorno = null;
abrir();
try{
Cursor c = nBD.rawQuery("SELECT " + _campo + " FROM " + _tabla + " WHERE " + _condicion, null);
for(c.moveToFirst();!c.isAfterLast();c.moveToNext()){
strRetorno = c.getString(0);
}
}
catch(Exception e){
e.toString();
strRetorno = null;
}
cerrar();
return strRetorno;
}
| String function(String _tabla, String _campo, String _condicion){ String strRetorno = null; abrir(); try{ Cursor c = nBD.rawQuery(STR + _campo + STR + _tabla + STR + _condicion, null); for(c.moveToFirst();!c.isAfterLast();c.moveToNext()){ strRetorno = c.getString(0); } } catch(Exception e){ e.toString(); strRetorno = null; } cerrar(); return strRetorno; } | /**Funcion que consulta un campo de una tabla segun la condicion recibida y retorna el resultado como un String
* @param _tabla ->Tabla sobre la cual se va a trabajar
* @param _campo ->Campo que se quiere consultar
* @param _condicion ->Condicion para filtro de la consulta
* @return
*/ | Funcion que consulta un campo de una tabla segun la condicion recibida y retorna el resultado como un String | StrSelectShieldWhere | {
"repo_name": "JulianPoveda/movil_acrene",
"path": "src/miscelanea/SQLite.java",
"license": "gpl-2.0",
"size": 21650
} | [
"android.database.Cursor"
] | import android.database.Cursor; | import android.database.*; | [
"android.database"
] | android.database; | 1,367,636 |
@Resource(name = "STSClientConfig")
public void setConfigFile(final String configFile)
{
if (configFile != null)
{
this.configFile = configFile;
}
} | @Resource(name = STR) void function(final String configFile) { if (configFile != null) { this.configFile = configFile; } } | /**
* This setter enables the injection of the jboss-sts-client.properties file
* path.
*
* @param configFile
*/ | This setter enables the injection of the jboss-sts-client.properties file path | setConfigFile | {
"repo_name": "taylor-project/taylor-picketlink-2.0.3",
"path": "federation/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/handlers/STSSecurityHandler.java",
"license": "gpl-2.0",
"size": 13010
} | [
"javax.annotation.Resource"
] | import javax.annotation.Resource; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 1,942,162 |
private void contarNodosDesde(Node nodo)
{
if( nodo.isEqualNode(this.obtenerNodoRaiz()) )
{
cantidadtotalnodos++;
cantidadtotalnodos += contarNodosHijos(nodo);
}
NodeList listanodoshijos = nodo.getChildNodes();
for(int i = 0; i < listanodoshijos.getLength(); i++)
{
Node nodoaux = listanodoshijos.item(i);
if (nodoaux instanceof Element)
{
cantidadtotalnodos += contarNodosHijos(nodoaux);
contarNodosDesde(nodoaux);
}
}
} | void function(Node nodo) { if( nodo.isEqualNode(this.obtenerNodoRaiz()) ) { cantidadtotalnodos++; cantidadtotalnodos += contarNodosHijos(nodo); } NodeList listanodoshijos = nodo.getChildNodes(); for(int i = 0; i < listanodoshijos.getLength(); i++) { Node nodoaux = listanodoshijos.item(i); if (nodoaux instanceof Element) { cantidadtotalnodos += contarNodosHijos(nodoaux); contarNodosDesde(nodoaux); } } } | /**
* Cuenta el total de nodos hijos que cuelgan de un nodo
* @param nodo Nodo para contar sus hijos colgantes
*/ | Cuenta el total de nodos hijos que cuelgan de un nodo | contarNodosDesde | {
"repo_name": "galleta/-java-_Nodos_XML",
"path": "src/FicheroXML.java",
"license": "gpl-2.0",
"size": 11353
} | [
"org.w3c.dom.Element",
"org.w3c.dom.Node",
"org.w3c.dom.NodeList"
] | import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 381,628 |
public static final int getSSLModeFromString(String s)
throws SqlException
{
if (s != null){
if (s.equalsIgnoreCase(SSL_OFF_STR)) {
return SSL_OFF;
} else if (s.equalsIgnoreCase(SSL_BASIC_STR)) {
return SSL_BASIC;
} else if (s.equalsIgnoreCase(SSL_PEER_AUTHENTICATION_STR)) {
return SSL_PEER_AUTHENTICATION;
} else {
throw new SqlException(null,
new ClientMessageId(SQLState.INVALID_ATTRIBUTE),
Attribute.SSL_ATTR, s, SSL_OFF_STR + ", " +
SSL_BASIC_STR + ", " + SSL_PEER_AUTHENTICATION_STR);
}
} else {
// Default
return SSL_OFF;
}
} | static final int function(String s) throws SqlException { if (s != null){ if (s.equalsIgnoreCase(SSL_OFF_STR)) { return SSL_OFF; } else if (s.equalsIgnoreCase(SSL_BASIC_STR)) { return SSL_BASIC; } else if (s.equalsIgnoreCase(SSL_PEER_AUTHENTICATION_STR)) { return SSL_PEER_AUTHENTICATION; } else { throw new SqlException(null, new ClientMessageId(SQLState.INVALID_ATTRIBUTE), Attribute.SSL_ATTR, s, SSL_OFF_STR + STR + SSL_BASIC_STR + STR + SSL_PEER_AUTHENTICATION_STR); } } else { return SSL_OFF; } } | /**
* Parses the string and returns the corresponding constant for the SSL
* mode denoted.
* <p>
* Valid values are <tt>off</tt>, <tt>basic</tt> and
* <tt>peerAuthentication</tt>.
*
* @param s string denoting the SSL mode
* @return A constant indicating the SSL mode denoted by the string. If the
* string is {@code null}, {@link #SSL_OFF} is returned.
* @throws SqlException if the string has an invalid value
*/ | Parses the string and returns the corresponding constant for the SSL mode denoted. Valid values are off, basic and peerAuthentication | getSSLModeFromString | {
"repo_name": "kavin256/Derby",
"path": "java/client/org/apache/derby/jdbc/ClientBaseDataSource.java",
"license": "apache-2.0",
"size": 48253
} | [
"org.apache.derby.client.am.ClientMessageId",
"org.apache.derby.client.am.SqlException",
"org.apache.derby.shared.common.reference.Attribute",
"org.apache.derby.shared.common.reference.SQLState"
] | import org.apache.derby.client.am.ClientMessageId; import org.apache.derby.client.am.SqlException; import org.apache.derby.shared.common.reference.Attribute; import org.apache.derby.shared.common.reference.SQLState; | import org.apache.derby.client.am.*; import org.apache.derby.shared.common.reference.*; | [
"org.apache.derby"
] | org.apache.derby; | 1,529,834 |
public Request head() {
return this.head("/");
} | Request function() { return this.head("/"); } | /**
* Returns a new http head request.
*
* @return Returns a new http head request.
*/ | Returns a new http head request | head | {
"repo_name": "PantherCode/arctic-core",
"path": "src/main/java/org/panthercode/arctic/core/http/HttpClientOptions.java",
"license": "apache-2.0",
"size": 19892
} | [
"org.apache.http.client.fluent.Request"
] | import org.apache.http.client.fluent.Request; | import org.apache.http.client.fluent.*; | [
"org.apache.http"
] | org.apache.http; | 1,950,447 |
public String toString() {
return PeakUtils.peakToString(this);
} | String function() { return PeakUtils.peakToString(this); } | /**
* This method returns a string with the basic information that defines this
* peak
*
* @return String information
*/ | This method returns a string with the basic information that defines this peak | toString | {
"repo_name": "DrewG/mzmine2",
"path": "src/main/java/net/sf/mzmine/modules/peaklistmethods/peakpicking/deconvolution/ResolvedPeak.java",
"license": "gpl-2.0",
"size": 10598
} | [
"net.sf.mzmine.util.PeakUtils"
] | import net.sf.mzmine.util.PeakUtils; | import net.sf.mzmine.util.*; | [
"net.sf.mzmine"
] | net.sf.mzmine; | 2,690,226 |
@Test
public void testScanner() throws IOException {
List<Put> puts = new ArrayList<>(4);
Put put = new Put(ROW_1);
put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1);
puts.add(put);
put = new Put(ROW_2);
put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1);
puts.add(put);
put = new Put(ROW_3);
put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1);
puts.add(put);
put = new Put(ROW_4);
put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1);
puts.add(put);
remoteTable.put(puts);
ResultScanner scanner = remoteTable.getScanner(new Scan());
Result[] results = scanner.next(1);
assertNotNull(results);
assertEquals(1, results.length);
assertTrue(Bytes.equals(ROW_1, results[0].getRow()));
Result result = scanner.next();
assertNotNull(result);
assertTrue(Bytes.equals(ROW_2, result.getRow()));
results = scanner.next(2);
assertNotNull(results);
assertEquals(2, results.length);
assertTrue(Bytes.equals(ROW_3, results[0].getRow()));
assertTrue(Bytes.equals(ROW_4, results[1].getRow()));
results = scanner.next(1);
assertNull(results);
scanner.close();
scanner = remoteTable.getScanner(COLUMN_1);
results = scanner.next(4);
assertNotNull(results);
assertEquals(4, results.length);
assertTrue(Bytes.equals(ROW_1, results[0].getRow()));
assertTrue(Bytes.equals(ROW_2, results[1].getRow()));
assertTrue(Bytes.equals(ROW_3, results[2].getRow()));
assertTrue(Bytes.equals(ROW_4, results[3].getRow()));
scanner.close();
scanner = remoteTable.getScanner(COLUMN_1,QUALIFIER_1);
results = scanner.next(4);
assertNotNull(results);
assertEquals(4, results.length);
assertTrue(Bytes.equals(ROW_1, results[0].getRow()));
assertTrue(Bytes.equals(ROW_2, results[1].getRow()));
assertTrue(Bytes.equals(ROW_3, results[2].getRow()));
assertTrue(Bytes.equals(ROW_4, results[3].getRow()));
scanner.close();
assertTrue(remoteTable.isAutoFlush());
} | void function() throws IOException { List<Put> puts = new ArrayList<>(4); Put put = new Put(ROW_1); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); puts.add(put); put = new Put(ROW_2); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); puts.add(put); put = new Put(ROW_3); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); puts.add(put); put = new Put(ROW_4); put.addColumn(COLUMN_1, QUALIFIER_1, VALUE_1); puts.add(put); remoteTable.put(puts); ResultScanner scanner = remoteTable.getScanner(new Scan()); Result[] results = scanner.next(1); assertNotNull(results); assertEquals(1, results.length); assertTrue(Bytes.equals(ROW_1, results[0].getRow())); Result result = scanner.next(); assertNotNull(result); assertTrue(Bytes.equals(ROW_2, result.getRow())); results = scanner.next(2); assertNotNull(results); assertEquals(2, results.length); assertTrue(Bytes.equals(ROW_3, results[0].getRow())); assertTrue(Bytes.equals(ROW_4, results[1].getRow())); results = scanner.next(1); assertNull(results); scanner.close(); scanner = remoteTable.getScanner(COLUMN_1); results = scanner.next(4); assertNotNull(results); assertEquals(4, results.length); assertTrue(Bytes.equals(ROW_1, results[0].getRow())); assertTrue(Bytes.equals(ROW_2, results[1].getRow())); assertTrue(Bytes.equals(ROW_3, results[2].getRow())); assertTrue(Bytes.equals(ROW_4, results[3].getRow())); scanner.close(); scanner = remoteTable.getScanner(COLUMN_1,QUALIFIER_1); results = scanner.next(4); assertNotNull(results); assertEquals(4, results.length); assertTrue(Bytes.equals(ROW_1, results[0].getRow())); assertTrue(Bytes.equals(ROW_2, results[1].getRow())); assertTrue(Bytes.equals(ROW_3, results[2].getRow())); assertTrue(Bytes.equals(ROW_4, results[3].getRow())); scanner.close(); assertTrue(remoteTable.isAutoFlush()); } | /**
* Test RemoteHTable.Scanner
*/ | Test RemoteHTable.Scanner | testScanner | {
"repo_name": "francisliu/hbase",
"path": "hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java",
"license": "apache-2.0",
"size": 22492
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.hbase.client.Put",
"org.apache.hadoop.hbase.client.Result",
"org.apache.hadoop.hbase.client.ResultScanner",
"org.apache.hadoop.hbase.client.Scan",
"org.apache.hadoop.hbase.util.Bytes",
"org.junit.Assert"
] | import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.util.Bytes; import org.junit.Assert; | import java.io.*; import java.util.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*; import org.junit.*; | [
"java.io",
"java.util",
"org.apache.hadoop",
"org.junit"
] | java.io; java.util; org.apache.hadoop; org.junit; | 2,099,670 |
public PDBorderEffectDictionary getBorderEffect()
{
COSDictionary be = (COSDictionary) getDictionary().getDictionaryObject( "BE" );
if (be != null)
{
return new PDBorderEffectDictionary( be );
}
else
{
return null;
}
}
| PDBorderEffectDictionary function() { COSDictionary be = (COSDictionary) getDictionary().getDictionaryObject( "BE" ); if (be != null) { return new PDBorderEffectDictionary( be ); } else { return null; } } | /**
* This will retrieve the border effect dictionary, specifying effects to be
* applied used in drawing the line.
*
* @return The border effect dictionary
*/ | This will retrieve the border effect dictionary, specifying effects to be applied used in drawing the line | getBorderEffect | {
"repo_name": "kzganesan/PdfBox-Android",
"path": "library/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationSquareCircle.java",
"license": "apache-2.0",
"size": 5515
} | [
"org.apache.pdfbox.cos.COSDictionary"
] | import org.apache.pdfbox.cos.COSDictionary; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 1,455,124 |
public void updateAbrufbestellpositionSichtRahmen(
BestellpositionDto abrufbestellpositionDtoI) throws ExceptionLP {
try {
bestellpositionFac.updateAbrufbestellpositionSichtRahmen(
abrufbestellpositionDtoI, LPMain.getTheClient());
} catch (Throwable t) {
handleThrowable(t);
}
}
| void function( BestellpositionDto abrufbestellpositionDtoI) throws ExceptionLP { try { bestellpositionFac.updateAbrufbestellpositionSichtRahmen( abrufbestellpositionDtoI, LPMain.getTheClient()); } catch (Throwable t) { handleThrowable(t); } } | /**
* Ein Teil einer Rahmenposition oder die gesamte wird in der
* Abrufbestellung als Abrufposition erfasst. <br>
* Die erfasste Menge muss dabei > 0 sein.
*
* @param abrufbestellpositionDtoI
* die bestehenden Abrufposition
* @throws ExceptionLP
* Ausnahme
*/ | Ein Teil einer Rahmenposition oder die gesamte wird in der Abrufbestellung als Abrufposition erfasst. Die erfasste Menge muss dabei > 0 sein | updateAbrufbestellpositionSichtRahmen | {
"repo_name": "erdincay/lpclientpc",
"path": "src/com/lp/client/frame/delegate/BestellungDelegate.java",
"license": "agpl-3.0",
"size": 43582
} | [
"com.lp.client.frame.ExceptionLP",
"com.lp.client.pc.LPMain",
"com.lp.server.bestellung.service.BestellpositionDto"
] | import com.lp.client.frame.ExceptionLP; import com.lp.client.pc.LPMain; import com.lp.server.bestellung.service.BestellpositionDto; | import com.lp.client.frame.*; import com.lp.client.pc.*; import com.lp.server.bestellung.service.*; | [
"com.lp.client",
"com.lp.server"
] | com.lp.client; com.lp.server; | 2,583,390 |
public void setBlob(int parameterIndex, Blob x) throws SQLException {
if (JdbcDebugCfg.entryActive)
debug[methodId_setBlob].methodEntry();
if (JdbcDebugCfg.traceActive)
debug[methodId_setBlob].methodParameters(Integer
.toString(parameterIndex)
+ ",?");
try {
validateSetInvocation(parameterIndex);
int dataType = inputDesc_[parameterIndex - 1].dataType_;
dataType = inputDesc_[parameterIndex - 1].dataType_;
switch (dataType) {
case Types.BLOB:
SQLMXBlob blob = null;
isAnyLob_ = true;
if (x == null)
setNull(parameterIndex, Types.BLOB);
else {
byte[] b = null;
if ((x instanceof SQLMXBlob) &&
((b = ((SQLMXBlob)x).getBytes(connection_.getInlineLobChunkSize())) != null)) {
paramContainer_.setBytes(parameterIndex, b);
} else {
isAnyLob_ = true;
blob = new SQLMXBlob(connection_, null, x);
inputDesc_[parameterIndex - 1].paramValue_ = "";
paramContainer_.setBytes(parameterIndex, new byte[0]);
}
}
addLobObjects(parameterIndex, blob);
break;
default:
throw Messages.createSQLException(connection_.locale_,
"invalid_datatype_for_column", null);
}
inputDesc_[parameterIndex - 1].isValueSet_ = true;
} finally {
if (JdbcDebugCfg.entryActive)
debug[methodId_setBlob].methodExit();
}
} | void function(int parameterIndex, Blob x) throws SQLException { if (JdbcDebugCfg.entryActive) debug[methodId_setBlob].methodEntry(); if (JdbcDebugCfg.traceActive) debug[methodId_setBlob].methodParameters(Integer .toString(parameterIndex) + ",?"); try { validateSetInvocation(parameterIndex); int dataType = inputDesc_[parameterIndex - 1].dataType_; dataType = inputDesc_[parameterIndex - 1].dataType_; switch (dataType) { case Types.BLOB: SQLMXBlob blob = null; isAnyLob_ = true; if (x == null) setNull(parameterIndex, Types.BLOB); else { byte[] b = null; if ((x instanceof SQLMXBlob) && ((b = ((SQLMXBlob)x).getBytes(connection_.getInlineLobChunkSize())) != null)) { paramContainer_.setBytes(parameterIndex, b); } else { isAnyLob_ = true; blob = new SQLMXBlob(connection_, null, x); inputDesc_[parameterIndex - 1].paramValue_ = STRinvalid_datatype_for_column", null); } inputDesc_[parameterIndex - 1].isValueSet_ = true; } finally { if (JdbcDebugCfg.entryActive) debug[methodId_setBlob].methodExit(); } } | /**
* Sets the designated parameter to the given <tt>Blob</tt> object. The
* driver converts this to an SQL <tt>BLOB</tt> value when it sends it to
* the database.
*
* @param i
* the first parameter is 1, the second is 2, ...
* @param x
* a <tt>Blob</tt> object that maps an SQL <tt>BLOB</tt> value
*
* @throws SQLException
* invalid data type for column
*/ | Sets the designated parameter to the given Blob object. The driver converts this to an SQL BLOB value when it sends it to the database | setBlob | {
"repo_name": "apache/incubator-trafodion",
"path": "core/conn/jdbc_type2/src/main/java/org/apache/trafodion/jdbc/t2/SQLMXPreparedStatement.java",
"license": "apache-2.0",
"size": 183561
} | [
"java.sql.Blob",
"java.sql.SQLException",
"java.sql.Types"
] | import java.sql.Blob; import java.sql.SQLException; import java.sql.Types; | import java.sql.*; | [
"java.sql"
] | java.sql; | 828,235 |
public void createFileSystemTree() {
String root2Search = properties.get("root2.search");
String root3Search = properties.get("root3.search");
String root4Search = properties.get("root4.search");
tree.setAnimationEnabled(true);
TreeItem tItem = new TreeItem(new OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(properties.get("root.folder.name")));
tItem.addItem(new OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml("Loading..."));
tree.addItem(tItem);
if(root2Search != null && !root2Search.equals("")) {
// add info root
TreeItem tItem2 = new TreeItem(new OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(properties.get("root2.folder.name")));
tree.addItem(tItem2);
// load the 2nd directory in tree structure
path = findPath(tItem2);
GWT.log("updated path = " + path);
fetchTreeItems(tItem2, path);
}
if(root3Search != null && !root3Search.equals("")) {
TreeItem tItem3 = new TreeItem(new OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(properties.get("root3.folder.name")));
tree.addItem(tItem3);
// load the 2nd directory in tree structure
path = findPath(tItem3);
GWT.log("updated path = " + path);
fetchTreeItems(tItem3, path);
}
if(root4Search != null && !root4Search.equals("")) {
TreeItem tItem4 = new TreeItem(new OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(properties.get("root4.folder.name")));
tree.addItem(tItem4);
// load the 2nd directory in tree structure
path = findPath(tItem4);
GWT.log("updated path = " + path);
fetchTreeItems(tItem4, path);
}
tree.addOpenHandler(getOpenHandler());
tree.addSelectionHandler(getSelectionHandler());
tree.setSelectedItem(tItem, true);
}
| void function() { String root2Search = properties.get(STR); String root3Search = properties.get(STR); String root4Search = properties.get(STR); tree.setAnimationEnabled(true); TreeItem tItem = new TreeItem(new OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(properties.get(STR))); tItem.addItem(new OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(STR)); tree.addItem(tItem); if(root2Search != null && !root2Search.equals(STRroot2.folder.nameSTRupdated path = STRSTRroot3.folder.nameSTRupdated path = STRSTRroot4.folder.nameSTRupdated path = " + path); fetchTreeItems(tItem4, path); } tree.addOpenHandler(getOpenHandler()); tree.addSelectionHandler(getSelectionHandler()); tree.setSelectedItem(tItem, true); } | /**
* Creates a tree based on the the root.folder.names in the properties.file
* The tree has the ability to have four root folders: root.folder.name, root2.folder.name,
* root3.folder.name, and root4.folder.name
* Tree is created after the properties are read from the server
*/ | Creates a tree based on the the root.folder.names in the properties.file The tree has the ability to have four root folders: root.folder.name, root2.folder.name, root3.folder.name, and root4.folder.name Tree is created after the properties are read from the server | createFileSystemTree | {
"repo_name": "brippe/GWT-FileManager",
"path": "src/edu/nocccd/filemanager/client/FileSystemTreeWidget.java",
"license": "apache-2.0",
"size": 13033
} | [
"com.google.gwt.safehtml.shared.OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml",
"com.google.gwt.user.client.ui.TreeItem"
] | import com.google.gwt.safehtml.shared.OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml; import com.google.gwt.user.client.ui.TreeItem; | import com.google.gwt.safehtml.shared.*; import com.google.gwt.user.client.ui.*; | [
"com.google.gwt"
] | com.google.gwt; | 2,798,478 |
public synchronized void close() throws IOException {
//
// Kill running tasks. Do this in a 2nd vector, called 'tasksToClose',
// because calling jobHasFinished() may result in an edit to 'tasks'.
//
TreeMap<TaskAttemptID, TaskInProgress> tasksToClose = new TreeMap<TaskAttemptID, TaskInProgress>();
tasksToClose.putAll(tasks);
for (TaskInProgress tip : tasksToClose.values()) {
tip.jobHasFinished(false);
}
this.running = false;
// Clear local storage
cleanupStorage();
// Shutdown the fetcher thread
this.mapEventsFetcher.interrupt();
// stop the launchers
this.mapLauncher.interrupt();
this.reduceLauncher.interrupt();
jvmManager.stop();
// shutdown RPC connections
RPC.stopProxy(jobClient);
// wait for the fetcher thread to exit
for (boolean done = false; !done;) {
try {
this.mapEventsFetcher.join();
done = true;
} catch (InterruptedException e) {
}
}
if (taskReportServer != null) {
taskReportServer.stop();
taskReportServer = null;
}
}
public TaskTracker(JobConf conf) throws IOException {
originalConf = conf;
maxCurrentMapTasks = conf.getInt("mapred.tasktracker.map.tasks.maximum", 2);
maxCurrentReduceTasks = conf.getInt("mapred.tasktracker.reduce.tasks.maximum", 2);
this.jobTrackAddr = JobTracker.getAddress(conf);
String infoAddr = NetUtils.getServerAddress(conf, "tasktracker.http.bindAddress", "tasktracker.http.port",
"mapred.task.tracker.http.address");
InetSocketAddress infoSocAddr = NetUtils.createSocketAddr(infoAddr);
String httpBindAddress = infoSocAddr.getHostName();
int httpPort = infoSocAddr.getPort();
this.server = new StatusHttpServer("task", httpBindAddress, httpPort, httpPort == 0, conf);
workerThreads = conf.getInt("tasktracker.http.threads", 40);
this.shuffleServerMetrics = new ShuffleServerMetrics(conf);
server.setThreads(1, workerThreads);
// let the jsp pages get to the task tracker, config, and other relevant
// objects
FileSystem local = FileSystem.getLocal(conf);
this.localDirAllocator = new LocalDirAllocator("mapred.local.dir");
server.setAttribute("task.tracker", this);
server.setAttribute("local.file.system", local);
server.setAttribute("conf", conf);
server.setAttribute("log", LOG);
server.setAttribute("localDirAllocator", localDirAllocator);
server.setAttribute("shuffleServerMetrics", shuffleServerMetrics);
server.addInternalServlet("mapOutput", "/mapOutput", MapOutputServlet.class);
server.addInternalServlet("taskLog", "/tasklog", TaskLogServlet.class);
server.start();
this.httpPort = server.getPort();
initialize();
} | synchronized void function() throws IOException { tasksToClose.putAll(tasks); for (TaskInProgress tip : tasksToClose.values()) { tip.jobHasFinished(false); } this.running = false; cleanupStorage(); this.mapEventsFetcher.interrupt(); this.mapLauncher.interrupt(); this.reduceLauncher.interrupt(); jvmManager.stop(); RPC.stopProxy(jobClient); for (boolean done = false; !done;) { try { this.mapEventsFetcher.join(); done = true; } catch (InterruptedException e) { } } if (taskReportServer != null) { taskReportServer.stop(); taskReportServer = null; } } public TaskTracker(JobConf conf) throws IOException { originalConf = conf; maxCurrentMapTasks = conf.getInt(STR, 2); maxCurrentReduceTasks = conf.getInt(STR, 2); this.jobTrackAddr = JobTracker.getAddress(conf); String infoAddr = NetUtils.getServerAddress(conf, STR, STR, STR); InetSocketAddress infoSocAddr = NetUtils.createSocketAddr(infoAddr); String httpBindAddress = infoSocAddr.getHostName(); int httpPort = infoSocAddr.getPort(); this.server = new StatusHttpServer("task", httpBindAddress, httpPort, httpPort == 0, conf); workerThreads = conf.getInt(STR, 40); this.shuffleServerMetrics = new ShuffleServerMetrics(conf); server.setThreads(1, workerThreads); FileSystem local = FileSystem.getLocal(conf); this.localDirAllocator = new LocalDirAllocator(STR); server.setAttribute(STR, this); server.setAttribute(STR, local); server.setAttribute("conf", conf); server.setAttribute("log", LOG); server.setAttribute(STR, localDirAllocator); server.setAttribute(STR, shuffleServerMetrics); server.addInternalServlet(STR, STR, MapOutputServlet.class); server.addInternalServlet(STR, STR, TaskLogServlet.class); server.start(); this.httpPort = server.getPort(); initialize(); } | /**
* Close down the TaskTracker and all its components. We must also shutdown
* any running tasks or threads, and cleanup disk space. A new TaskTracker
* within the same process space might be restarted, so everything must be
* clean.
*/ | Close down the TaskTracker and all its components. We must also shutdown any running tasks or threads, and cleanup disk space. A new TaskTracker within the same process space might be restarted, so everything must be clean | close | {
"repo_name": "dongpf/hadoop-0.19.1",
"path": "src/mapred/org/apache/hadoop/mapred/TaskTracker.java",
"license": "apache-2.0",
"size": 119239
} | [
"java.io.IOException",
"java.net.InetSocketAddress",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.LocalDirAllocator",
"org.apache.hadoop.ipc.RPC",
"org.apache.hadoop.net.NetUtils"
] | import java.io.IOException; import java.net.InetSocketAddress; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalDirAllocator; import org.apache.hadoop.ipc.RPC; import org.apache.hadoop.net.NetUtils; | import java.io.*; import java.net.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.ipc.*; import org.apache.hadoop.net.*; | [
"java.io",
"java.net",
"org.apache.hadoop"
] | java.io; java.net; org.apache.hadoop; | 1,098,595 |
public void waitForJoiningHostsToBeReady(int expectedHosts, int localHostId) {
try {
//register this host as joining. The host registration will be deleted after joining is completed.
m_zk.create(ZKUtil.joinZKPath(CoreZK.readyjoininghosts, Integer.toString(localHostId)) , null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
while (true) {
ZKUtil.FutureWatcher fw = new ZKUtil.FutureWatcher();
int readyHosts = m_zk.getChildren(CoreZK.readyjoininghosts, fw).size();
if ( readyHosts == expectedHosts) {
break;
}
fw.get();
}
} catch (KeeperException | InterruptedException e) {
org.voltdb.VoltDB.crashLocalVoltDB("Error waiting for hosts to be ready", false, e);
}
} | void function(int expectedHosts, int localHostId) { try { m_zk.create(ZKUtil.joinZKPath(CoreZK.readyjoininghosts, Integer.toString(localHostId)) , null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); while (true) { ZKUtil.FutureWatcher fw = new ZKUtil.FutureWatcher(); int readyHosts = m_zk.getChildren(CoreZK.readyjoininghosts, fw).size(); if ( readyHosts == expectedHosts) { break; } fw.get(); } } catch (KeeperException InterruptedException e) { org.voltdb.VoltDB.crashLocalVoltDB(STR, false, e); } } | /**
* For elastic join. Block on this call until the number of ready hosts is
* equal to the number of expected joining hosts.
*/ | For elastic join. Block on this call until the number of ready hosts is equal to the number of expected joining hosts | waitForJoiningHostsToBeReady | {
"repo_name": "deerwalk/voltdb",
"path": "src/frontend/org/voltcore/messaging/HostMessenger.java",
"license": "agpl-3.0",
"size": 74905
} | [
"org.apache.zookeeper_voltpatches.CreateMode",
"org.apache.zookeeper_voltpatches.KeeperException",
"org.apache.zookeeper_voltpatches.ZooDefs",
"org.voltcore.zk.CoreZK",
"org.voltcore.zk.ZKUtil"
] | import org.apache.zookeeper_voltpatches.CreateMode; import org.apache.zookeeper_voltpatches.KeeperException; import org.apache.zookeeper_voltpatches.ZooDefs; import org.voltcore.zk.CoreZK; import org.voltcore.zk.ZKUtil; | import org.apache.zookeeper_voltpatches.*; import org.voltcore.zk.*; | [
"org.apache.zookeeper_voltpatches",
"org.voltcore.zk"
] | org.apache.zookeeper_voltpatches; org.voltcore.zk; | 2,845,073 |
public static HtmlEmail getHtmlEmail() throws EmailException
{
String smtpHost = OscarProperties.getInstance().getProperty(CATEGORY+SMTP_HOST_KEY);
String smtpSslPort = OscarProperties.getInstance().getProperty(CATEGORY+SMTP_SSL_PORT_KEY);
String smtpUser = OscarProperties.getInstance().getProperty(CATEGORY+SMTP_USER_KEY);
String smtpPassword = OscarProperties.getInstance().getProperty(CATEGORY+SMTP_PASSWORD_KEY);
String smtpConnectionSecurity = OscarProperties.getInstance().getProperty(CATEGORY+SMTP_CONNECTION_SECURITY);
return(getHtmlEmail(smtpHost, smtpSslPort, smtpUser, smtpPassword, smtpConnectionSecurity));
} | static HtmlEmail function() throws EmailException { String smtpHost = OscarProperties.getInstance().getProperty(CATEGORY+SMTP_HOST_KEY); String smtpSslPort = OscarProperties.getInstance().getProperty(CATEGORY+SMTP_SSL_PORT_KEY); String smtpUser = OscarProperties.getInstance().getProperty(CATEGORY+SMTP_USER_KEY); String smtpPassword = OscarProperties.getInstance().getProperty(CATEGORY+SMTP_PASSWORD_KEY); String smtpConnectionSecurity = OscarProperties.getInstance().getProperty(CATEGORY+SMTP_CONNECTION_SECURITY); return(getHtmlEmail(smtpHost, smtpSslPort, smtpUser, smtpPassword, smtpConnectionSecurity)); } | /**
* This method will return an HtmlEmail object populated with
* the smtpServer/smtpUser/smtpPassword from the config xml file.
* @throws EmailException
*/ | This method will return an HtmlEmail object populated with the smtpServer/smtpUser/smtpPassword from the config xml file | getHtmlEmail | {
"repo_name": "scoophealth/oscar",
"path": "src/main/java/org/oscarehr/util/EmailUtilsOld.java",
"license": "gpl-2.0",
"size": 9314
} | [
"org.apache.commons.mail.EmailException",
"org.apache.commons.mail.HtmlEmail"
] | import org.apache.commons.mail.EmailException; import org.apache.commons.mail.HtmlEmail; | import org.apache.commons.mail.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,903,507 |
public void incrementValue(double value,
Comparable rowKey,
Comparable columnKey) {
double existing = 0.0;
Number n = getValue(rowKey, columnKey);
if (n != null) {
existing = n.doubleValue();
}
setValue(existing + value, rowKey, columnKey);
}
/**
* Removes a value from the dataset and sends a {@link DatasetChangeEvent}
| void function(double value, Comparable rowKey, Comparable columnKey) { double existing = 0.0; Number n = getValue(rowKey, columnKey); if (n != null) { existing = n.doubleValue(); } setValue(existing + value, rowKey, columnKey); } /** * Removes a value from the dataset and sends a {@link DatasetChangeEvent} | /**
* Adds the specified value to an existing value in the dataset (if the
* existing value is <code>null</code>, it is treated as if it were 0.0).
*
* @param value the value.
* @param rowKey the row key (<code>null</code> not permitted).
* @param columnKey the column key (<code>null</code> not permitted).
*
* @throws UnknownKeyException if either key is not defined in the dataset.
*/ | Adds the specified value to an existing value in the dataset (if the existing value is <code>null</code>, it is treated as if it were 0.0) | incrementValue | {
"repo_name": "linuxuser586/jfreechart",
"path": "source/org/jfree/data/category/DefaultCategoryDataset.java",
"license": "lgpl-2.1",
"size": 15730
} | [
"org.jfree.data.event.DatasetChangeEvent"
] | import org.jfree.data.event.DatasetChangeEvent; | import org.jfree.data.event.*; | [
"org.jfree.data"
] | org.jfree.data; | 2,659,274 |
public static Path walkFileTree(Path start, FileVisitor<? super Path> visitor)
throws IOException
{
return walkFileTree(start,
EnumSet.noneOf(FileVisitOption.class),
Integer.MAX_VALUE,
visitor);
}
// -- Utility methods for simple usages --
// buffer size used for reading and writing
private static final int BUFFER_SIZE = 8192;
/**
* Opens a file for reading, returning a {@code BufferedReader} that may be
* used to read text from the file in an efficient manner. Bytes from the
* file are decoded into characters using the specified charset. Reading
* commences at the beginning of the file.
*
* <p> The {@code Reader} methods that read from the file throw {@code
* IOException} if a malformed or unmappable byte sequence is read.
*
* @param path
* the path to the file
* @param cs
* the charset to use for decoding
*
* @return a new buffered reader, with default buffer size, to read text
* from the file
*
* @throws IOException
* if an I/O error occurs opening the file
* @throws SecurityException
* In the case of the default provider, and a security manager is
* installed, the {@link SecurityManager#checkRead(String) checkRead} | static Path function(Path start, FileVisitor<? super Path> visitor) throws IOException { return walkFileTree(start, EnumSet.noneOf(FileVisitOption.class), Integer.MAX_VALUE, visitor); } private static final int BUFFER_SIZE = 8192; /** * Opens a file for reading, returning a {@code BufferedReader} that may be * used to read text from the file in an efficient manner. Bytes from the * file are decoded into characters using the specified charset. Reading * commences at the beginning of the file. * * <p> The {@code Reader} methods that read from the file throw { * IOException} if a malformed or unmappable byte sequence is read. * * @param path * the path to the file * @param cs * the charset to use for decoding * * @return a new buffered reader, with default buffer size, to read text * from the file * * @throws IOException * if an I/O error occurs opening the file * @throws SecurityException * In the case of the default provider, and a security manager is * installed, the {@link SecurityManager#checkRead(String) checkRead} | /**
* Walks a file tree.
*
* <p> This method works as if invoking it were equivalent to evaluating the
* expression:
* <blockquote><pre>
* walkFileTree(start, EnumSet.noneOf(FileVisitOption.class), Integer.MAX_VALUE, visitor)
* </pre></blockquote>
* In other words, it does not follow symbolic links, and visits all levels
* of the file tree.
*
* @param start
* the starting file
* @param visitor
* the file visitor to invoke for each file
*
* @return the starting file
*
* @throws SecurityException
* If the security manager denies access to the starting file.
* In the case of the default provider, the {@link
* SecurityManager#checkRead(String) checkRead} method is invoked
* to check read access to the directory.
* @throws IOException
* if an I/O error is thrown by a visitor method
*/ | Walks a file tree. This method works as if invoking it were equivalent to evaluating the expression: <code> walkFileTree(start, EnumSet.noneOf(FileVisitOption.class), Integer.MAX_VALUE, visitor) </code> In other words, it does not follow symbolic links, and visits all levels of the file tree | walkFileTree | {
"repo_name": "Taichi-SHINDO/jdk9-jdk",
"path": "src/java.base/share/classes/java/nio/file/Files.java",
"license": "gpl-2.0",
"size": 171296
} | [
"java.io.BufferedReader",
"java.io.IOException",
"java.io.Reader",
"java.util.EnumSet"
] | import java.io.BufferedReader; import java.io.IOException; import java.io.Reader; import java.util.EnumSet; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 693,647 |
public DateHistogramInterval getInterval() {
return interval;
} | DateHistogramInterval function() { return interval; } | /**
* Get the date interval
*/ | Get the date interval | getInterval | {
"repo_name": "ern/elasticsearch",
"path": "x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rollup/job/DateHistogramGroupConfig.java",
"license": "apache-2.0",
"size": 16002
} | [
"org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval"
] | import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; | import org.elasticsearch.search.aggregations.bucket.histogram.*; | [
"org.elasticsearch.search"
] | org.elasticsearch.search; | 529,340 |
File resolve( String matrixId, long x, long y ); | File resolve( String matrixId, long x, long y ); | /**
* Returns the image file for the specified {@link org.deegree.tile.TileDataLevel} and tile indexes.
*
* @param matrixId
* identifier of the matrix in the matrix set, must not be <code>null</code>
* @param x
* column index of the tile (starting at 0)
* @param y
* row index of the tile (starting at 0)
* @return tile file or <code>null</code> if the tile matrix does not exist (or indexes are out of range)
*/ | Returns the image file for the specified <code>org.deegree.tile.TileDataLevel</code> and tile indexes | resolve | {
"repo_name": "deegree/deegree3",
"path": "deegree-datastores/deegree-tilestores/deegree-tilestore-filesystem/src/main/java/org/deegree/tile/persistence/filesystem/DiskLayout.java",
"license": "lgpl-2.1",
"size": 2726
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,160,269 |
private Set<String> lookupGroup(SearchResult result, DirContext c,
int goUpHierarchy)
throws NamingException {
Set<String> groups = new LinkedHashSet<>();
Set<String> groupDNs = new HashSet<>();
NamingEnumeration<SearchResult> groupResults;
// perform the second LDAP query
if (isPosix) {
groupResults = lookupPosixGroup(result, c);
} else {
String userDn = result.getNameInNamespace();
groupResults =
c.search(groupbaseDN,
"(&" + groupSearchFilter + "(" + groupMemberAttr + "={0}))",
new Object[]{userDn},
SEARCH_CONTROLS);
}
// if the second query is successful, group objects of the user will be
// returned. Get group names from the returned objects.
if (groupResults != null) {
while (groupResults.hasMoreElements()) {
SearchResult groupResult = groupResults.nextElement();
getGroupNames(groupResult, groups, groupDNs, goUpHierarchy > 0);
}
if (goUpHierarchy > 0 && !isPosix) {
goUpGroupHierarchy(groupDNs, goUpHierarchy, groups);
}
}
return groups;
} | Set<String> function(SearchResult result, DirContext c, int goUpHierarchy) throws NamingException { Set<String> groups = new LinkedHashSet<>(); Set<String> groupDNs = new HashSet<>(); NamingEnumeration<SearchResult> groupResults; if (isPosix) { groupResults = lookupPosixGroup(result, c); } else { String userDn = result.getNameInNamespace(); groupResults = c.search(groupbaseDN, "(&" + groupSearchFilter + "(" + groupMemberAttr + STR, new Object[]{userDn}, SEARCH_CONTROLS); } if (groupResults != null) { while (groupResults.hasMoreElements()) { SearchResult groupResult = groupResults.nextElement(); getGroupNames(groupResult, groups, groupDNs, goUpHierarchy > 0); } if (goUpHierarchy > 0 && !isPosix) { goUpGroupHierarchy(groupDNs, goUpHierarchy, groups); } } return groups; } | /**
* Perform the second query to get the groups of the user.
*
* If posixGroups is enabled, use use posix gid/uid to find.
* Otherwise, use the general group member attribute to find it.
*
* @param result the result object returned from the prior user lookup.
* @param c the context object of the LDAP connection.
* @return a list of strings representing group names of the user.
* @throws NamingException if unable to find group names
*/ | Perform the second query to get the groups of the user. If posixGroups is enabled, use use posix gid/uid to find. Otherwise, use the general group member attribute to find it | lookupGroup | {
"repo_name": "steveloughran/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/LdapGroupsMapping.java",
"license": "apache-2.0",
"size": 40082
} | [
"java.util.HashSet",
"java.util.LinkedHashSet",
"java.util.Set",
"javax.naming.NamingEnumeration",
"javax.naming.NamingException",
"javax.naming.directory.DirContext",
"javax.naming.directory.SearchResult"
] | import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Set; import javax.naming.NamingEnumeration; import javax.naming.NamingException; import javax.naming.directory.DirContext; import javax.naming.directory.SearchResult; | import java.util.*; import javax.naming.*; import javax.naming.directory.*; | [
"java.util",
"javax.naming"
] | java.util; javax.naming; | 2,827,424 |
public List<FrdParameterRule31> findByFrdParameterRule31Like(FrdParameterRule31 frdParameterRule31,
JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults);
| List<FrdParameterRule31> function(FrdParameterRule31 frdParameterRule31, JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults); | /**
* findByFrdParameterRule31Like - finds a list of FrdParameterRule31 Like
*
* @param frdParameterRule31
* @return the list of FrdParameterRule31 found
*/ | findByFrdParameterRule31Like - finds a list of FrdParameterRule31 Like | findByFrdParameterRule31Like | {
"repo_name": "yauritux/venice-legacy",
"path": "Venice/Venice-Interface-Model/src/main/java/com/gdn/venice/facade/FrdParameterRule31SessionEJBRemote.java",
"license": "apache-2.0",
"size": 2780
} | [
"com.djarum.raf.utilities.JPQLAdvancedQueryCriteria",
"com.gdn.venice.persistence.FrdParameterRule31",
"java.util.List"
] | import com.djarum.raf.utilities.JPQLAdvancedQueryCriteria; import com.gdn.venice.persistence.FrdParameterRule31; import java.util.List; | import com.djarum.raf.utilities.*; import com.gdn.venice.persistence.*; import java.util.*; | [
"com.djarum.raf",
"com.gdn.venice",
"java.util"
] | com.djarum.raf; com.gdn.venice; java.util; | 86,190 |
List<ClusterTask> getClusterTasks(ClusterTaskFilter filter) throws IOException; | List<ClusterTask> getClusterTasks(ClusterTaskFilter filter) throws IOException; | /**
* Retrieves tasks according to the {@code query} filters.
*
* @param query the object wrapper around filters
* @return list of cluster tasks according to the {@code query} filters
* @throws IOException if there was a problem getting the cluster task.
*/ | Retrieves tasks according to the query filters | getClusterTasks | {
"repo_name": "quantiply-fork/coopr",
"path": "coopr-server/src/main/java/co/cask/coopr/store/cluster/ClusterStore.java",
"license": "apache-2.0",
"size": 3814
} | [
"co.cask.coopr.scheduler.task.ClusterTask",
"java.io.IOException",
"java.util.List"
] | import co.cask.coopr.scheduler.task.ClusterTask; import java.io.IOException; import java.util.List; | import co.cask.coopr.scheduler.task.*; import java.io.*; import java.util.*; | [
"co.cask.coopr",
"java.io",
"java.util"
] | co.cask.coopr; java.io; java.util; | 2,020,121 |
//==========================
// BufferedReader Interface
//==========================
public void close() throws IOException {
try {
if (this.charReader != null) {
this.charReader.close();
}
if (this.byteStream != null) {
this.byteStream.close();
}
} catch (IOException exc) {
throw exc;
}
} // close | void function() throws IOException { try { if (this.charReader != null) { this.charReader.close(); } if (this.byteStream != null) { this.byteStream.close(); } } catch (IOException exc) { throw exc; } } | /** Closes the stream and releases any system resources associated with it.
* @throws IOException if an IO error occurs
*/ | Closes the stream and releases any system resources associated with it | close | {
"repo_name": "gfis/common",
"path": "src/main/java/org/teherba/common/URIReader.java",
"license": "apache-2.0",
"size": 35578
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,359,339 |
@BeforeClass
public static void initKdc() throws Exception {
Properties kdcConf = MiniKdc.createConf();
kdc = new MiniKdc(kdcConf, ROOT_TEST_DIR);
kdc.start();
File sinkKeytabFile = new File(ROOT_TEST_DIR, "sink.keytab");
sinkKeytab = sinkKeytabFile.getAbsolutePath();
kdc.createPrincipal(sinkKeytabFile, "sink/localhost");
sinkPrincipal = "sink/localhost@" + kdc.getRealm();
File hdfsKeytabFile = new File(ROOT_TEST_DIR, "hdfs.keytab");
hdfsKeytab = hdfsKeytabFile.getAbsolutePath();
kdc.createPrincipal(hdfsKeytabFile, "hdfs/localhost",
"HTTP/localhost");
hdfsPrincipal = "hdfs/localhost@" + kdc.getRealm();
spnegoPrincipal = "HTTP/localhost@" + kdc.getRealm();
} | static void function() throws Exception { Properties kdcConf = MiniKdc.createConf(); kdc = new MiniKdc(kdcConf, ROOT_TEST_DIR); kdc.start(); File sinkKeytabFile = new File(ROOT_TEST_DIR, STR); sinkKeytab = sinkKeytabFile.getAbsolutePath(); kdc.createPrincipal(sinkKeytabFile, STR); sinkPrincipal = STR + kdc.getRealm(); File hdfsKeytabFile = new File(ROOT_TEST_DIR, STR); hdfsKeytab = hdfsKeytabFile.getAbsolutePath(); kdc.createPrincipal(hdfsKeytabFile, STR, STR); hdfsPrincipal = STR + kdc.getRealm(); spnegoPrincipal = STR + kdc.getRealm(); } | /**
* Setup the KDC for testing a secure HDFS cluster.
*
* @throws Exception thrown if the KDC setup fails
*/ | Setup the KDC for testing a secure HDFS cluster | initKdc | {
"repo_name": "legend-hua/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/metrics2/sink/TestRollingFileSystemSinkWithSecureHdfs.java",
"license": "apache-2.0",
"size": 9923
} | [
"java.io.File",
"java.util.Properties",
"org.apache.hadoop.minikdc.MiniKdc"
] | import java.io.File; import java.util.Properties; import org.apache.hadoop.minikdc.MiniKdc; | import java.io.*; import java.util.*; import org.apache.hadoop.minikdc.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 2,159,489 |
@Test
public void testAddInventory_2()
throws Exception {
CoffeeMaker fixture = new CoffeeMaker();
int amtCoffee = -1;
int amtMilk = 1;
boolean result = fixture.addInventory(amtCoffee, amtMilk);
// add additional test code here
assertEquals(false, result);
}
| void function() throws Exception { CoffeeMaker fixture = new CoffeeMaker(); int amtCoffee = -1; int amtMilk = 1; boolean result = fixture.addInventory(amtCoffee, amtMilk); assertEquals(false, result); } | /**
* Run the boolean addInventory(int,int) method test.
*
* @throws Exception
*
* @generatedBy CodePro at 4/27/16 6:34 PM
*/ | Run the boolean addInventory(int,int) method test | testAddInventory_2 | {
"repo_name": "Nahom30/cosc603-Negash-project5",
"path": "CoffeeMaker/src/edu/towson/cis/cosc603/project5/coffeemaker/CoffeeMakerTest.java",
"license": "gpl-3.0",
"size": 15836
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,682,178 |
public static long modifyCacheDirective(Long id, HdfsPartition part, String poolName,
short replication) throws ImpalaRuntimeException {
Preconditions.checkNotNull(id);
HdfsCachingUtil.modifyCacheDirective(id, new Path(part.getLocation()),
poolName, replication);
part.putToParameters(CACHE_DIR_ID_PROP_NAME, Long.toString(id));
part.putToParameters(CACHE_DIR_REPLICATION_PROP_NAME, Long.toString(replication));
return id;
} | static long function(Long id, HdfsPartition part, String poolName, short replication) throws ImpalaRuntimeException { Preconditions.checkNotNull(id); HdfsCachingUtil.modifyCacheDirective(id, new Path(part.getLocation()), poolName, replication); part.putToParameters(CACHE_DIR_ID_PROP_NAME, Long.toString(id)); part.putToParameters(CACHE_DIR_REPLICATION_PROP_NAME, Long.toString(replication)); return id; } | /**
* Update cache directive for a partition and update the metastore parameters.
* Returns the cache directive ID
*/ | Update cache directive for a partition and update the metastore parameters. Returns the cache directive ID | modifyCacheDirective | {
"repo_name": "ImpalaToGo/ImpalaToGo",
"path": "fe/src/main/java/com/cloudera/impala/util/HdfsCachingUtil.java",
"license": "apache-2.0",
"size": 21253
} | [
"com.cloudera.impala.catalog.HdfsPartition",
"com.cloudera.impala.common.ImpalaRuntimeException",
"com.google.common.base.Preconditions",
"org.apache.hadoop.fs.Path"
] | import com.cloudera.impala.catalog.HdfsPartition; import com.cloudera.impala.common.ImpalaRuntimeException; import com.google.common.base.Preconditions; import org.apache.hadoop.fs.Path; | import com.cloudera.impala.catalog.*; import com.cloudera.impala.common.*; import com.google.common.base.*; import org.apache.hadoop.fs.*; | [
"com.cloudera.impala",
"com.google.common",
"org.apache.hadoop"
] | com.cloudera.impala; com.google.common; org.apache.hadoop; | 2,868,335 |
CmsDecorationDefintion getDecorationDefinition(CmsXmlContent configuration, int i); | CmsDecorationDefintion getDecorationDefinition(CmsXmlContent configuration, int i); | /**
* Builds a CmsDecorationDefintion from a given configuration file.<p>
*
* @param configuration the configuration file
* @param i the number of the decoration definition to create
* @return CmsDecorationDefintion created form configuration file
*/ | Builds a CmsDecorationDefintion from a given configuration file | getDecorationDefinition | {
"repo_name": "ggiudetti/opencms-core",
"path": "src/org/opencms/jsp/decorator/I_CmsDecoratorConfiguration.java",
"license": "lgpl-2.1",
"size": 3208
} | [
"org.opencms.xml.content.CmsXmlContent"
] | import org.opencms.xml.content.CmsXmlContent; | import org.opencms.xml.content.*; | [
"org.opencms.xml"
] | org.opencms.xml; | 2,512,677 |
@Test
public void sendEventsWithKeyAndPartition() {
// Arrange
final List<EventData> events = Arrays.asList(
new EventData("Event 1".getBytes(UTF_8)),
new EventData("Event 2".getBytes(UTF_8)),
new EventData("Event 3".getBytes(UTF_8)));
// Act
final Mono<Void> onComplete = Mono.when(producer.send(events),
producer.send(Flux.just(events.get(0))),
producer.send(Flux.fromIterable(events), new SendOptions().setPartitionId("1")),
producer.send(Flux.fromIterable(events), new SendOptions().setPartitionId("0")),
producer.send(Flux.fromIterable(events), new SendOptions().setPartitionKey("sandwiches")));
// Assert
StepVerifier.create(onComplete)
.verifyComplete();
} | void function() { final List<EventData> events = Arrays.asList( new EventData(STR.getBytes(UTF_8)), new EventData(STR.getBytes(UTF_8)), new EventData(STR.getBytes(UTF_8))); final Mono<Void> onComplete = Mono.when(producer.send(events), producer.send(Flux.just(events.get(0))), producer.send(Flux.fromIterable(events), new SendOptions().setPartitionId("1")), producer.send(Flux.fromIterable(events), new SendOptions().setPartitionId("0")), producer.send(Flux.fromIterable(events), new SendOptions().setPartitionKey(STR))); StepVerifier.create(onComplete) .verifyComplete(); } | /**
* Verify that we can send to multiple partitions, round-robin, and with a partition key, using the same producer.
*/ | Verify that we can send to multiple partitions, round-robin, and with a partition key, using the same producer | sendEventsWithKeyAndPartition | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientIntegrationTest.java",
"license": "mit",
"size": 6854
} | [
"com.azure.messaging.eventhubs.models.SendOptions",
"java.util.Arrays",
"java.util.List"
] | import com.azure.messaging.eventhubs.models.SendOptions; import java.util.Arrays; import java.util.List; | import com.azure.messaging.eventhubs.models.*; import java.util.*; | [
"com.azure.messaging",
"java.util"
] | com.azure.messaging; java.util; | 165,376 |
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
} | void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } | /**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object. | collectNewChildDescriptors | {
"repo_name": "netuh/DecodePlatformPlugin",
"path": "br.ufpe.ines.decode/bundles/br.ufpe.ines.decode.model.edit/src/br/ufpe/ines/decode/decode/artifacts/questionnaire/provider/ContentItemProvider.java",
"license": "gpl-3.0",
"size": 5479
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,767,739 |
public Identifier getIdentifier() {
return identifier;
} | Identifier function() { return identifier; } | /**
* The identifier of the object or member that is being identified with.
*
* <p>
* If the {@link #getInteractionType() type} is
* {@link InteractionContextType#OBJECT_VALIDATE}, will be the identifier of
* the {@link #getTarget() target} object's specification. Otherwise will be
* the identifier of the member.
*/ | The identifier of the object or member that is being identified with. If the <code>#getInteractionType() type</code> is <code>InteractionContextType#OBJECT_VALIDATE</code>, will be the identifier of the <code>#getTarget() target</code> object's specification. Otherwise will be the identifier of the member | getIdentifier | {
"repo_name": "kidaa/isis",
"path": "core/metamodel/src/main/java/org/apache/isis/core/metamodel/interactions/InteractionContext.java",
"license": "apache-2.0",
"size": 6043
} | [
"org.apache.isis.applib.Identifier"
] | import org.apache.isis.applib.Identifier; | import org.apache.isis.applib.*; | [
"org.apache.isis"
] | org.apache.isis; | 1,499,164 |
public final void initializeGoogleBilling() {
try {
GoogleBillingHelper.getInstance(getActivity()).querySkuDetails(mOnInventoryFinishedListener);
}
catch (Exception e) {
android.util.Log.e(Application.TAG, "Failed to call Google Billing Helper", e);
}
} | final void function() { try { GoogleBillingHelper.getInstance(getActivity()).querySkuDetails(mOnInventoryFinishedListener); } catch (Exception e) { android.util.Log.e(Application.TAG, STR, e); } } | /**
* Initialize Google Billing (after having permission).
*/ | Initialize Google Billing (after having permission) | initializeGoogleBilling | {
"repo_name": "jeisfeld/Augendiagnose",
"path": "AugendiagnoseIdea/augendiagnoseLib/src/main/java/de/jeisfeld/augendiagnoselib/fragments/SettingsFragment.java",
"license": "gpl-2.0",
"size": 33394
} | [
"android.util.Log",
"de.jeisfeld.augendiagnoselib.Application",
"de.jeisfeld.augendiagnoselib.util.GoogleBillingHelper"
] | import android.util.Log; import de.jeisfeld.augendiagnoselib.Application; import de.jeisfeld.augendiagnoselib.util.GoogleBillingHelper; | import android.util.*; import de.jeisfeld.augendiagnoselib.*; import de.jeisfeld.augendiagnoselib.util.*; | [
"android.util",
"de.jeisfeld.augendiagnoselib"
] | android.util; de.jeisfeld.augendiagnoselib; | 2,068,646 |
public AnalysisModule.AnalysisProvider<TokenizerFactory> getTokenizerProvider(String tokenizer) {
return tokenizers.getOrDefault(tokenizer, this.prebuiltAnalysis.getTokenizerFactory(tokenizer));
} | AnalysisModule.AnalysisProvider<TokenizerFactory> function(String tokenizer) { return tokenizers.getOrDefault(tokenizer, this.prebuiltAnalysis.getTokenizerFactory(tokenizer)); } | /**
* Returns a registered {@link TokenizerFactory} provider by name or <code>null</code> if the tokenizer was not registered
*/ | Returns a registered <code>TokenizerFactory</code> provider by name or <code>null</code> if the tokenizer was not registered | getTokenizerProvider | {
"repo_name": "maddin2016/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/index/analysis/AnalysisRegistry.java",
"license": "apache-2.0",
"size": 30429
} | [
"org.elasticsearch.indices.analysis.AnalysisModule"
] | import org.elasticsearch.indices.analysis.AnalysisModule; | import org.elasticsearch.indices.analysis.*; | [
"org.elasticsearch.indices"
] | org.elasticsearch.indices; | 173,757 |
public void setProperty(String name, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException
{
throw new SAXNotRecognizedException(name);
}
private ErrorHandler _ErrorHandler; | void function(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { throw new SAXNotRecognizedException(name); } private ErrorHandler _ErrorHandler; | /** A no-op at this time.
@see javax.xml.sax.XMLReader
*/ | A no-op at this time | setProperty | {
"repo_name": "medicayun/medicayundicom",
"path": "dcm4jboss-all/tags/DCM4JBOSS_2_7_6/dcm4jboss-hl7/src/java/org/regenstrief/xhl7/HL7XMLReader.java",
"license": "apache-2.0",
"size": 21585
} | [
"org.xml.sax.ErrorHandler",
"org.xml.sax.SAXNotRecognizedException",
"org.xml.sax.SAXNotSupportedException"
] | import org.xml.sax.ErrorHandler; import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; | import org.xml.sax.*; | [
"org.xml.sax"
] | org.xml.sax; | 1,936,920 |
private void _putAll(final Map<? extends K, ? extends V> map) {
final int mapSize = map.size();
if (mapSize == 0) {
return;
}
final int newSize = (int) ((size + mapSize) / loadFactor + 1);
ensureCapacity(calculateNewCapacity(newSize));
for (final Map.Entry<? extends K, ? extends V> entry: map.entrySet()) {
put(entry.getKey(), entry.getValue());
}
} | void function(final Map<? extends K, ? extends V> map) { final int mapSize = map.size(); if (mapSize == 0) { return; } final int newSize = (int) ((size + mapSize) / loadFactor + 1); ensureCapacity(calculateNewCapacity(newSize)); for (final Map.Entry<? extends K, ? extends V> entry: map.entrySet()) { put(entry.getKey(), entry.getValue()); } } | /**
* Puts all the values from the specified map into this map.
* <p>
* This implementation iterates around the specified map and
* uses {@link #put(Object, Object)}.
* <p>
* It is private to allow the constructor to still call it
* even when putAll is overriden.
*
* @param map the map to addOrUpdate
* @throws NullPointerException if the map is null
*/ | Puts all the values from the specified map into this map. This implementation iterates around the specified map and uses <code>#put(Object, Object)</code>. It is private to allow the constructor to still call it even when putAll is overriden | _putAll | {
"repo_name": "lizubing1992/RxCache",
"path": "core/src/main/java/io/rx_cache/internal/cache/memory/apache/AbstractHashedMap.java",
"license": "apache-2.0",
"size": 46806
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,194 |
public Builder setTitle(@Nullable CharSequence title) {
mTitle = title;
return this;
} | Builder function(@Nullable CharSequence title) { mTitle = title; return this; } | /**
* Sets the title.
*
* @param title A title suitable for display to the user or null.
* @return this
*/ | Sets the title | setTitle | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "frameworks/base/media/java/android/media/MediaDescription.java",
"license": "gpl-3.0",
"size": 7501
} | [
"android.annotation.Nullable"
] | import android.annotation.Nullable; | import android.annotation.*; | [
"android.annotation"
] | android.annotation; | 188,396 |
public DateTimeZone readOptionalTimeZone() throws IOException {
if (readBoolean()) {
return DateTimeZone.forID(readString());
}
return null;
} | DateTimeZone function() throws IOException { if (readBoolean()) { return DateTimeZone.forID(readString()); } return null; } | /**
* Read an optional {@linkplain DateTimeZone}.
*/ | Read an optional DateTimeZone | readOptionalTimeZone | {
"repo_name": "yynil/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java",
"license": "apache-2.0",
"size": 29024
} | [
"java.io.IOException",
"org.joda.time.DateTimeZone"
] | import java.io.IOException; import org.joda.time.DateTimeZone; | import java.io.*; import org.joda.time.*; | [
"java.io",
"org.joda.time"
] | java.io; org.joda.time; | 262,060 |
public void setParameters(Map<String, Object> parameters) {
this.parameters = parameters;
} | void function(Map<String, Object> parameters) { this.parameters = parameters; } | /**
* the variables that should be set for various operations
*/ | the variables that should be set for various operations | setParameters | {
"repo_name": "brreitme/camel",
"path": "components/camel-jbpm/src/main/java/org/apache/camel/component/jbpm/JBPMConfiguration.java",
"license": "apache-2.0",
"size": 8231
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,484,494 |
private void addBreakpoints(final Set<BreakpointAddress> addresses,
final BreakpointStatus status, final BreakpointStorage storage, final BreakpointType type) {
Preconditions.checkNotNull(addresses, "IE00718: addresses argument can not be null");
Preconditions.checkNotNull(status, "IE00719: status argument can not be null");
Preconditions.checkNotNull(storage, "IE00720: storage argument can not be null");
Preconditions.checkNotNull(type, "IE00721: type argument can not be null");
if (addresses.size() == 0) {
return;
}
final List<Breakpoint> breakpoints = new ArrayList<>();
for (final BreakpointAddress address : addresses) {
final Breakpoint breakpoint = new Breakpoint(type, address);
storage.add(breakpoint, status);
breakpoints.add(breakpoint);
}
for (final BreakpointManagerListener listener : listeners) {
try {
listener.breakpointsAdded(breakpoints);
} catch (final Exception e) {
CUtilityFunctions.logException(e);
}
}
} | void function(final Set<BreakpointAddress> addresses, final BreakpointStatus status, final BreakpointStorage storage, final BreakpointType type) { Preconditions.checkNotNull(addresses, STR); Preconditions.checkNotNull(status, STR); Preconditions.checkNotNull(storage, STR); Preconditions.checkNotNull(type, STR); if (addresses.size() == 0) { return; } final List<Breakpoint> breakpoints = new ArrayList<>(); for (final BreakpointAddress address : addresses) { final Breakpoint breakpoint = new Breakpoint(type, address); storage.add(breakpoint, status); breakpoints.add(breakpoint); } for (final BreakpointManagerListener listener : listeners) { try { listener.breakpointsAdded(breakpoints); } catch (final Exception e) { CUtilityFunctions.logException(e); } } } | /**
* Adds a list of breakpoints to the breakpoint manager.
*
* @param addresses Addresses of the breakpoints to add.
* @param status Initial status of the new breakpoints.
*/ | Adds a list of breakpoints to the breakpoint manager | addBreakpoints | {
"repo_name": "guiquanz/binnavi",
"path": "src/main/java/com/google/security/zynamics/binnavi/debug/models/breakpoints/BreakpointManager.java",
"license": "apache-2.0",
"size": 23668
} | [
"com.google.common.base.Preconditions",
"com.google.security.zynamics.binnavi.CUtilityFunctions",
"com.google.security.zynamics.binnavi.debug.models.breakpoints.enums.BreakpointStatus",
"com.google.security.zynamics.binnavi.debug.models.breakpoints.enums.BreakpointType",
"com.google.security.zynamics.binnav... | import com.google.common.base.Preconditions; import com.google.security.zynamics.binnavi.CUtilityFunctions; import com.google.security.zynamics.binnavi.debug.models.breakpoints.enums.BreakpointStatus; import com.google.security.zynamics.binnavi.debug.models.breakpoints.enums.BreakpointType; import com.google.security.zynamics.binnavi.debug.models.breakpoints.interfaces.BreakpointManagerListener; import com.google.security.zynamics.binnavi.debug.models.breakpoints.interfaces.BreakpointStorage; import java.util.ArrayList; import java.util.List; import java.util.Set; | import com.google.common.base.*; import com.google.security.zynamics.binnavi.*; import com.google.security.zynamics.binnavi.debug.models.breakpoints.enums.*; import com.google.security.zynamics.binnavi.debug.models.breakpoints.interfaces.*; import java.util.*; | [
"com.google.common",
"com.google.security",
"java.util"
] | com.google.common; com.google.security; java.util; | 1,246,767 |
public Paint getPaint() {
return this.paint;
} | Paint function() { return this.paint; } | /**
* Returns the paint.
*
* @return The paint (never <code>null</code>).
*
* @see #setPaint(Paint)
*/ | Returns the paint | getPaint | {
"repo_name": "integrated/jfreechart",
"path": "source/org/jfree/chart/plot/dial/DialValueIndicator.java",
"license": "lgpl-2.1",
"size": 20412
} | [
"java.awt.Paint"
] | import java.awt.Paint; | import java.awt.*; | [
"java.awt"
] | java.awt; | 921,713 |
public void onParentViewChanged(int tabId, ViewGroup parentView) {
mTabId = tabId;
mParentView = parentView;
removeFromParentView();
addToParentView();
} | void function(int tabId, ViewGroup parentView) { mTabId = tabId; mParentView = parentView; removeFromParentView(); addToParentView(); } | /**
* Called when the parent {@link android.view.ViewGroup} has changed for
* this container.
*/ | Called when the parent <code>android.view.ViewGroup</code> has changed for this container | onParentViewChanged | {
"repo_name": "mohamed--abdel-maksoud/chromium.src",
"path": "chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java",
"license": "bsd-3-clause",
"size": 21246
} | [
"android.view.ViewGroup"
] | import android.view.ViewGroup; | import android.view.*; | [
"android.view"
] | android.view; | 465,258 |
public IDeclaration lookupIdentifier(String identifier) {
return fIdentifiers.get(identifier);
} | IDeclaration function(String identifier) { return fIdentifiers.get(identifier); } | /**
* Lookup query for an identifier in this scope.
*
* @param identifier
* the name of the identifier to search for. In the case of int
* x; it would be "x"
* @return the declaration of the type associated to that identifier
*/ | Lookup query for an identifier in this scope | lookupIdentifier | {
"repo_name": "soctrace-inria/framesoc.importers",
"path": "fr.inria.soctrace.tools.importer.ctf/fr.inria.linuxtools.ctf.core/src/fr/inria/linuxtools/internal/ctf/core/event/metadata/DeclarationScope.java",
"license": "epl-1.0",
"size": 13416
} | [
"fr.inria.linuxtools.ctf.core.event.types.IDeclaration"
] | import fr.inria.linuxtools.ctf.core.event.types.IDeclaration; | import fr.inria.linuxtools.ctf.core.event.types.*; | [
"fr.inria.linuxtools"
] | fr.inria.linuxtools; | 781,016 |
Runnable get(Callback<Drawable> consumer, int widthPx, int heightPx);
} | Runnable get(Callback<Drawable> consumer, int widthPx, int heightPx); } | /**
* Called by {@link AsyncImageView} to start the process of asynchronously loading a
* {@link Drawable}.
*
* @param consumer The {@link Callback} to notify with the result.
* @param widthPx The desired width of the {@link Drawable} if applicable (not required to
* match).
* @param heightPx The desired height of the {@link Drawable} if applicable (not required to
* match).
* @return A {@link Runnable} that can be triggered to cancel the outstanding
* request.
*/ | Called by <code>AsyncImageView</code> to start the process of asynchronously loading a <code>Drawable</code> | get | {
"repo_name": "endlessm/chromium-browser",
"path": "chrome/android/java/src/org/chromium/chrome/browser/download/home/list/view/AsyncImageView.java",
"license": "bsd-3-clause",
"size": 8193
} | [
"android.graphics.drawable.Drawable",
"org.chromium.base.Callback"
] | import android.graphics.drawable.Drawable; import org.chromium.base.Callback; | import android.graphics.drawable.*; import org.chromium.base.*; | [
"android.graphics",
"org.chromium.base"
] | android.graphics; org.chromium.base; | 1,986,298 |
void areSettingsValid(DeviceSetting[] settings, boolean onlyAbsolute) throws SettingException
{
for(DeviceSetting setting : settings)
{
isSettingValid(setting, onlyAbsolute);
}
}
| void areSettingsValid(DeviceSetting[] settings, boolean onlyAbsolute) throws SettingException { for(DeviceSetting setting : settings) { isSettingValid(setting, onlyAbsolute); } } | /**
* Calls isSettingValid() for all settings.
* @param settings Settings to check if they are valid.
* @param onlyAbsolute True if an exception should be thrown if the setting corresponds to relative values.
* @throws SettingException
*/ | Calls isSettingValid() for all settings | areSettingsValid | {
"repo_name": "langmo/youscope",
"path": "plugins/microscopeaccess/src/main/java/org/youscope/plugin/microscopeaccess/MicroscopeImpl.java",
"license": "gpl-2.0",
"size": 35220
} | [
"org.youscope.common.microscope.DeviceSetting",
"org.youscope.common.microscope.SettingException"
] | import org.youscope.common.microscope.DeviceSetting; import org.youscope.common.microscope.SettingException; | import org.youscope.common.microscope.*; | [
"org.youscope.common"
] | org.youscope.common; | 1,100,478 |
public static synchronized <T> ConstructorExpectationSetup<T> whenNew(Class<T> type) {
return new DefaultConstructorExpectationSetup<T>(type);
}
| static synchronized <T> ConstructorExpectationSetup<T> function(Class<T> type) { return new DefaultConstructorExpectationSetup<T>(type); } | /**
* Allows specifying expectations on new invocations. For example you might
* want to throw an exception or return a mock.
*/ | Allows specifying expectations on new invocations. For example you might want to throw an exception or return a mock | whenNew | {
"repo_name": "gauee/powermock",
"path": "api/mockito/src/main/java/org/powermock/api/mockito/PowerMockito.java",
"license": "apache-2.0",
"size": 30823
} | [
"org.powermock.api.mockito.expectation.ConstructorExpectationSetup",
"org.powermock.api.mockito.internal.expectation.DefaultConstructorExpectationSetup"
] | import org.powermock.api.mockito.expectation.ConstructorExpectationSetup; import org.powermock.api.mockito.internal.expectation.DefaultConstructorExpectationSetup; | import org.powermock.api.mockito.expectation.*; import org.powermock.api.mockito.internal.expectation.*; | [
"org.powermock.api"
] | org.powermock.api; | 1,525,870 |
@Override
public final byte readByte() throws IOException {
int temp = in.read();
if (temp < 0) {
throw new EOFException();
}
return (byte) temp;
} | final byte function() throws IOException { int temp = in.read(); if (temp < 0) { throw new EOFException(); } return (byte) temp; } | /**
* Reads an 8-bit byte value from this stream.
*
* @return the next byte value from the source stream.
*
* @throws IOException
* If a problem occurs reading from this DataInputStream.
*
*/ | Reads an 8-bit byte value from this stream | readByte | {
"repo_name": "ty1er/incubator-asterixdb",
"path": "asterixdb/asterix-hivecompat/src/main/java/org/apache/asterix/hivecompat/io/NonSyncDataInputBuffer.java",
"license": "apache-2.0",
"size": 14867
} | [
"java.io.EOFException",
"java.io.IOException"
] | import java.io.EOFException; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 203,324 |
public static CoderProvider getCoderProvider() {
return new ProtoCoderProvider();
}
static final TypeDescriptor<Message> MESSAGE_TYPE = new TypeDescriptor<Message>() {};
private static class ProtoCoderProvider extends CoderProvider { | static CoderProvider function() { return new ProtoCoderProvider(); } static final TypeDescriptor<Message> MESSAGE_TYPE = new TypeDescriptor<Message>() {}; private static class ProtoCoderProvider extends CoderProvider { | /**
* Returns a {@link CoderProvider} which uses the {@link DynamicProtoCoder} for {@link Message
* proto messages}.
*
* <p>This method is invoked reflectively from {@link DefaultCoder}.
*/ | Returns a <code>CoderProvider</code> which uses the <code>DynamicProtoCoder</code> for <code>Message proto messages</code>. This method is invoked reflectively from <code>DefaultCoder</code> | getCoderProvider | {
"repo_name": "lukecwik/incubator-beam",
"path": "sdks/java/extensions/protobuf/src/main/java/org/apache/beam/sdk/extensions/protobuf/DynamicProtoCoder.java",
"license": "apache-2.0",
"size": 8013
} | [
"com.google.protobuf.Message",
"org.apache.beam.sdk.coders.CoderProvider",
"org.apache.beam.sdk.values.TypeDescriptor"
] | import com.google.protobuf.Message; import org.apache.beam.sdk.coders.CoderProvider; import org.apache.beam.sdk.values.TypeDescriptor; | import com.google.protobuf.*; import org.apache.beam.sdk.coders.*; import org.apache.beam.sdk.values.*; | [
"com.google.protobuf",
"org.apache.beam"
] | com.google.protobuf; org.apache.beam; | 462,834 |
public static Message buildSnapshotDone(String filePath) {
ZabMessage.SnapshotDone done =
ZabMessage.SnapshotDone.newBuilder().setFilePath(filePath).build();
return Message.newBuilder().setType(MessageType.SNAPSHOT_DONE)
.setSnapshotDone(done).build();
} | static Message function(String filePath) { ZabMessage.SnapshotDone done = ZabMessage.SnapshotDone.newBuilder().setFilePath(filePath).build(); return Message.newBuilder().setType(MessageType.SNAPSHOT_DONE) .setSnapshotDone(done).build(); } | /**
* Creates the SNAPSHOT_DONE message.
*
* @param filePath the file path for the snapshot.
* @return a protobuf message.
*/ | Creates the SNAPSHOT_DONE message | buildSnapshotDone | {
"repo_name": "fpj/jzab",
"path": "src/main/java/com/github/zk1931/jzab/MessageBuilder.java",
"license": "apache-2.0",
"size": 23166
} | [
"com.github.zk1931.jzab.proto.ZabMessage"
] | import com.github.zk1931.jzab.proto.ZabMessage; | import com.github.zk1931.jzab.proto.*; | [
"com.github.zk1931"
] | com.github.zk1931; | 1,950,885 |
public void setOnItemViewClickedListener(BaseOnItemViewClickedListener listener) {
mOnItemViewClickedListener = listener;
if (mViewsCreated) {
throw new IllegalStateException(
"Item clicked listener must be set before views are created");
}
} | void function(BaseOnItemViewClickedListener listener) { mOnItemViewClickedListener = listener; if (mViewsCreated) { throw new IllegalStateException( STR); } } | /**
* Sets an item clicked listener on the fragment.
* OnItemViewClickedListener will override {@link View.OnClickListener} that
* item presenter sets during {@link Presenter#onCreateViewHolder(ViewGroup)}.
* So in general, developer should choose one of the listeners but not both.
*/ | Sets an item clicked listener on the fragment. OnItemViewClickedListener will override <code>View.OnClickListener</code> that item presenter sets during <code>Presenter#onCreateViewHolder(ViewGroup)</code>. So in general, developer should choose one of the listeners but not both | setOnItemViewClickedListener | {
"repo_name": "aosp-mirror/platform_frameworks_support",
"path": "leanback/src/main/java/androidx/leanback/app/RowsSupportFragment.java",
"license": "apache-2.0",
"size": 26441
} | [
"androidx.leanback.widget.BaseOnItemViewClickedListener"
] | import androidx.leanback.widget.BaseOnItemViewClickedListener; | import androidx.leanback.widget.*; | [
"androidx.leanback"
] | androidx.leanback; | 1,047,711 |
public static MozuClient<com.mozu.api.contracts.productadmin.MasterCatalogCollection> getMasterCatalogsClient(String responseFields) throws Exception
{
MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.MasterCatalogUrl.getMasterCatalogsUrl(responseFields);
String verb = "GET";
Class<?> clz = com.mozu.api.contracts.productadmin.MasterCatalogCollection.class;
MozuClient<com.mozu.api.contracts.productadmin.MasterCatalogCollection> mozuClient = (MozuClient<com.mozu.api.contracts.productadmin.MasterCatalogCollection>) MozuClientFactory.getInstance(clz);
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
return mozuClient;
}
| static MozuClient<com.mozu.api.contracts.productadmin.MasterCatalogCollection> function(String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.MasterCatalogUrl.getMasterCatalogsUrl(responseFields); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.productadmin.MasterCatalogCollection.class; MozuClient<com.mozu.api.contracts.productadmin.MasterCatalogCollection> mozuClient = (MozuClient<com.mozu.api.contracts.productadmin.MasterCatalogCollection>) MozuClientFactory.getInstance(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); return mozuClient; } | /**
*
* <p><pre><code>
* MozuClient<com.mozu.api.contracts.productadmin.MasterCatalogCollection> mozuClient=GetMasterCatalogsClient( responseFields);
* client.setBaseAddress(url);
* client.executeRequest();
* MasterCatalogCollection masterCatalogCollection = client.Result();
* </code></pre></p>
* @param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
* @return Mozu.Api.MozuClient <com.mozu.api.contracts.productadmin.MasterCatalogCollection>
* @see com.mozu.api.contracts.productadmin.MasterCatalogCollection
*/ | <code><code> MozuClient mozuClient=GetMasterCatalogsClient( responseFields); client.setBaseAddress(url); client.executeRequest(); MasterCatalogCollection masterCatalogCollection = client.Result(); </code></code> | getMasterCatalogsClient | {
"repo_name": "Mozu/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/clients/commerce/catalog/admin/MasterCatalogClient.java",
"license": "mit",
"size": 8363
} | [
"com.mozu.api.MozuClient",
"com.mozu.api.MozuClientFactory",
"com.mozu.api.MozuUrl"
] | import com.mozu.api.MozuClient; import com.mozu.api.MozuClientFactory; import com.mozu.api.MozuUrl; | import com.mozu.api.*; | [
"com.mozu.api"
] | com.mozu.api; | 1,355,102 |
public static Collection<File> createThumbnailsAsCollection(
Collection<? extends File> files,
Rename rename,
int width,
int height
)
throws IOException
{
validateDimensions(width, height);
if (files == null)
{
throw new NullPointerException("Collection of Files is null.");
}
if (rename == null)
{
throw new NullPointerException("Rename is null.");
}
ArrayList<File> resultFiles = new ArrayList<File>();
ThumbnailParameter param =
new ThumbnailParameterBuilder()
.size(width, height)
.build();
for (File inFile : files)
{
File outFile =
new File(inFile.getParent(), rename.apply(inFile.getName(), param));
createThumbnail(inFile, outFile, width, height);
resultFiles.add(outFile);
}
return Collections.unmodifiableList(resultFiles);
} | static Collection<File> function( Collection<? extends File> files, Rename rename, int width, int height ) throws IOException { validateDimensions(width, height); if (files == null) { throw new NullPointerException(STR); } if (rename == null) { throw new NullPointerException(STR); } ArrayList<File> resultFiles = new ArrayList<File>(); ThumbnailParameter param = new ThumbnailParameterBuilder() .size(width, height) .build(); for (File inFile : files) { File outFile = new File(inFile.getParent(), rename.apply(inFile.getName(), param)); createThumbnail(inFile, outFile, width, height); resultFiles.add(outFile); } return Collections.unmodifiableList(resultFiles); } | /**
* Creates thumbnails from a specified {@link Collection} of {@link File}s.
* The filenames of the resulting thumbnails are determined by applying
* the specified {@link Rename}.
* <p>
* The order of the thumbnail {@code File}s in the returned
* {@code Collection} will be the same as the order as the source list.
*
* @param files A {@code Collection} containing {@code File} objects
* of image files.
* @param rename The renaming function to use.
* @param width The width of the thumbnail.
* @param height The height of the thumbnail.
* @throws IOException Thrown when a problem occurs when reading from
* {@code File} representing an image file.
*
* @deprecated This method has been deprecated in favor of using the
* {@link Thumbnails#fromFiles(Iterable)} interface.
* This method will be removed in 0.5.0, and will not be
* further maintained.
*/ | Creates thumbnails from a specified <code>Collection</code> of <code>File</code>s. The filenames of the resulting thumbnails are determined by applying the specified <code>Rename</code>. The order of the thumbnail Files in the returned Collection will be the same as the order as the source list | createThumbnailsAsCollection | {
"repo_name": "mshams/appiconizer",
"path": "src/net/coobird/thumbnailator/Thumbnailator.java",
"license": "mpl-2.0",
"size": 14325
} | [
"java.io.File",
"java.io.IOException",
"java.util.ArrayList",
"java.util.Collection",
"java.util.Collections",
"net.coobird.thumbnailator.builders.ThumbnailParameterBuilder",
"net.coobird.thumbnailator.name.Rename"
] | import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import net.coobird.thumbnailator.builders.ThumbnailParameterBuilder; import net.coobird.thumbnailator.name.Rename; | import java.io.*; import java.util.*; import net.coobird.thumbnailator.builders.*; import net.coobird.thumbnailator.name.*; | [
"java.io",
"java.util",
"net.coobird.thumbnailator"
] | java.io; java.util; net.coobird.thumbnailator; | 2,703,619 |
@Override
public String transformCommand(Command command) throws TransformationException {
throw new TransformationException("Room attributes don't support Command Transformations");
} | String function(Command command) throws TransformationException { throw new TransformationException(STR); } | /**
* This method throws a {@link TransformationException}, as MiOS Room attributes don't support being called.
*
* @throws TransformationException
*/ | This method throws a <code>TransformationException</code>, as MiOS Room attributes don't support being called | transformCommand | {
"repo_name": "lewie/openhab",
"path": "bundles/binding/org.openhab.binding.mios/src/main/java/org/openhab/binding/mios/internal/config/RoomBindingConfig.java",
"license": "epl-1.0",
"size": 2195
} | [
"org.openhab.core.transform.TransformationException",
"org.openhab.core.types.Command"
] | import org.openhab.core.transform.TransformationException; import org.openhab.core.types.Command; | import org.openhab.core.transform.*; import org.openhab.core.types.*; | [
"org.openhab.core"
] | org.openhab.core; | 210,347 |
public static List<Object> buildSingleColumnResults(Result result,
int column, GeoPackageDataType dataType, Integer limit) {
List<Object> results = new ArrayList<>();
try {
while (result.moveToNext()) {
Object value = result.getValue(column, dataType);
results.add(value);
if (limit != null && results.size() >= limit) {
break;
}
}
} finally {
result.close();
}
return results;
} | static List<Object> function(Result result, int column, GeoPackageDataType dataType, Integer limit) { List<Object> results = new ArrayList<>(); try { while (result.moveToNext()) { Object value = result.getValue(column, dataType); results.add(value); if (limit != null && results.size() >= limit) { break; } } } finally { result.close(); } return results; } | /**
* Build single column result rows from the result and the optional limit
*
* @param result
* result
* @param column
* column index
* @param dataType
* GeoPackage data type
* @param limit
* result row limit
* @return single column results
* @since 3.1.0
*/ | Build single column result rows from the result and the optional limit | buildSingleColumnResults | {
"repo_name": "ngageoint/geopackage-core-java",
"path": "src/main/java/mil/nga/geopackage/db/ResultUtils.java",
"license": "mit",
"size": 9033
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,587,486 |
public static CompactRegionRequest buildCompactRegionRequest(
final byte[] regionName, final boolean major, final byte [] family) {
CompactRegionRequest.Builder builder = CompactRegionRequest.newBuilder();
RegionSpecifier region = buildRegionSpecifier(
RegionSpecifierType.REGION_NAME, regionName);
builder.setRegion(region);
builder.setMajor(major);
if (family != null) {
builder.setFamily(ByteStringer.wrap(family));
}
return builder.build();
}
private static RollWALWriterRequest ROLL_WAL_WRITER_REQUEST =
RollWALWriterRequest.newBuilder().build(); | static CompactRegionRequest function( final byte[] regionName, final boolean major, final byte [] family) { CompactRegionRequest.Builder builder = CompactRegionRequest.newBuilder(); RegionSpecifier region = buildRegionSpecifier( RegionSpecifierType.REGION_NAME, regionName); builder.setRegion(region); builder.setMajor(major); if (family != null) { builder.setFamily(ByteStringer.wrap(family)); } return builder.build(); } private static RollWALWriterRequest ROLL_WAL_WRITER_REQUEST = RollWALWriterRequest.newBuilder().build(); | /**
* Create a CompactRegionRequest for a given region name
*
* @param regionName the name of the region to get info
* @param major indicator if it is a major compaction
* @return a CompactRegionRequest
*/ | Create a CompactRegionRequest for a given region name | buildCompactRegionRequest | {
"repo_name": "lshmouse/hbase",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/RequestConverter.java",
"license": "apache-2.0",
"size": 65486
} | [
"org.apache.hadoop.hbase.protobuf.generated.AdminProtos",
"org.apache.hadoop.hbase.protobuf.generated.HBaseProtos",
"org.apache.hadoop.hbase.util.ByteStringer"
] | import org.apache.hadoop.hbase.protobuf.generated.AdminProtos; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.util.ByteStringer; | import org.apache.hadoop.hbase.protobuf.generated.*; import org.apache.hadoop.hbase.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 83,637 |
public VirtualNetworkGatewayConnectionType connectionType() {
return this.connectionType;
} | VirtualNetworkGatewayConnectionType function() { return this.connectionType; } | /**
* Get the connectionType value.
*
* @return the connectionType value
*/ | Get the connectionType value | connectionType | {
"repo_name": "anudeepsharma/azure-sdk-for-java",
"path": "azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewayConnectionInner.java",
"license": "mit",
"size": 11280
} | [
"com.microsoft.azure.management.network.VirtualNetworkGatewayConnectionType"
] | import com.microsoft.azure.management.network.VirtualNetworkGatewayConnectionType; | import com.microsoft.azure.management.network.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,490,837 |
public InputStream newInputStream(int index) throws IOException {
synchronized (DiskLruCache.this) {
if (entry.currentEditor != this) {
throw new IllegalStateException();
}
if (!entry.readable) {
return null;
}
try {
return new FileInputStream(entry.getCleanFile(index));
} catch (FileNotFoundException e) {
return null;
}
}
} | InputStream function(int index) throws IOException { synchronized (DiskLruCache.this) { if (entry.currentEditor != this) { throw new IllegalStateException(); } if (!entry.readable) { return null; } try { return new FileInputStream(entry.getCleanFile(index)); } catch (FileNotFoundException e) { return null; } } } | /**
* Returns an unbuffered input stream to read the last committed value,
* or null if no value has been committed.
*/ | Returns an unbuffered input stream to read the last committed value, or null if no value has been committed | newInputStream | {
"repo_name": "xdien/Sua-anh",
"path": "app/src/main/java/com/crazy/xdien/imageedit/sliding/ImageCache/DiskLruCache.java",
"license": "mit",
"size": 31067
} | [
"java.io.FileInputStream",
"java.io.FileNotFoundException",
"java.io.IOException",
"java.io.InputStream"
] | import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,748,182 |
protected void setBoardBoundaries() {
int maxX = 0;
int maxY = 0;
for (Board b : boards) {
Point relPos = b.relativePosition();
maxX = Math.max(maxX, relPos.x);
maxY = Math.max(maxY, relPos.y);
}
boardWidths = new int[maxX + 1][maxY + 1];
boardHeights = new int[maxX + 1][maxY + 1];
for (Board b : boards) {
Point relPos = b.relativePosition();
boardWidths[relPos.x][relPos.y] = b.bounds().width;
boardHeights[relPos.x][relPos.y] = b.bounds().height;
}
Point offset = new Point(edgeBuffer.width, edgeBuffer.height);
for (Board b : boards) {
Point relPos = b.relativePosition();
Point location = getLocation(relPos.x, relPos.y, 1.0);
b.setLocation(location.x, location.y);
b.translate(offset.x, offset.y);
}
theMap.revalidate();
} | void function() { int maxX = 0; int maxY = 0; for (Board b : boards) { Point relPos = b.relativePosition(); maxX = Math.max(maxX, relPos.x); maxY = Math.max(maxY, relPos.y); } boardWidths = new int[maxX + 1][maxY + 1]; boardHeights = new int[maxX + 1][maxY + 1]; for (Board b : boards) { Point relPos = b.relativePosition(); boardWidths[relPos.x][relPos.y] = b.bounds().width; boardHeights[relPos.x][relPos.y] = b.bounds().height; } Point offset = new Point(edgeBuffer.width, edgeBuffer.height); for (Board b : boards) { Point relPos = b.relativePosition(); Point location = getLocation(relPos.x, relPos.y, 1.0); b.setLocation(location.x, location.y); b.translate(offset.x, offset.y); } theMap.revalidate(); } | /**
* Adjusts the bounds() rectangle to account for the Board's relative
* position to other boards. In other words, if Board A is N pixels wide
* and Board B is to the right of Board A, then the origin of Board B
* will be adjusted N pixels to the right.
*/ | Adjusts the bounds() rectangle to account for the Board's relative position to other boards. In other words, if Board A is N pixels wide and Board B is to the right of Board A, then the origin of Board B will be adjusted N pixels to the right | setBoardBoundaries | {
"repo_name": "rzymek/vassal-src",
"path": "src/VASSAL/build/module/Map.java",
"license": "lgpl-2.1",
"size": 81192
} | [
"java.awt.Point"
] | import java.awt.Point; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,269,335 |
@Deprecated
public void renderByUrl(String pageName, final String url, Map<String, Object> options, final String jsonInitData, final int width, final int height, final WXRenderStrategy flag){
renderByUrl(pageName,url,options,jsonInitData,flag);
} | void function(String pageName, final String url, Map<String, Object> options, final String jsonInitData, final int width, final int height, final WXRenderStrategy flag){ renderByUrl(pageName,url,options,jsonInitData,flag); } | /**
* Use {@link #renderByUrl(String, String, Map, String, WXRenderStrategy)} instead.
* @param pageName
* @param url
* @param options
* @param jsonInitData
* @param width
* @param height
* @param flag
*/ | Use <code>#renderByUrl(String, String, Map, String, WXRenderStrategy)</code> instead | renderByUrl | {
"repo_name": "Neeeo/incubator-weex",
"path": "android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java",
"license": "apache-2.0",
"size": 56610
} | [
"com.taobao.weex.common.WXRenderStrategy",
"java.util.Map"
] | import com.taobao.weex.common.WXRenderStrategy; import java.util.Map; | import com.taobao.weex.common.*; import java.util.*; | [
"com.taobao.weex",
"java.util"
] | com.taobao.weex; java.util; | 63,611 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.