method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public Object eval(Node node, ExprEnvironment env,
AbstractPattern pattern, ArrayList args)
throws XPathException
{
return new Boolean(false);
} | Object function(Node node, ExprEnvironment env, AbstractPattern pattern, ArrayList args) throws XPathException { return new Boolean(false); } | /**
* Evaluate the function.
*
* @param pattern The context pattern.
* @param args The evaluated arguments
*/ | Evaluate the function | eval | {
"repo_name": "WelcomeHUME/svn-caucho-com-resin",
"path": "modules/resin/src/com/caucho/xsl/fun/ExtensionFunctionFun.java",
"license": "gpl-2.0",
"size": 1642
} | [
"com.caucho.xpath.ExprEnvironment",
"com.caucho.xpath.XPathException",
"com.caucho.xpath.pattern.AbstractPattern",
"java.util.ArrayList",
"org.w3c.dom.Node"
] | import com.caucho.xpath.ExprEnvironment; import com.caucho.xpath.XPathException; import com.caucho.xpath.pattern.AbstractPattern; import java.util.ArrayList; import org.w3c.dom.Node; | import com.caucho.xpath.*; import com.caucho.xpath.pattern.*; import java.util.*; import org.w3c.dom.*; | [
"com.caucho.xpath",
"java.util",
"org.w3c.dom"
] | com.caucho.xpath; java.util; org.w3c.dom; | 1,399,353 |
JsonHashMap params = new JsonHashMap();
try {
params.putAll(ReflectionUtils.getParameters(this));
} catch (Throwable e) {
throw new MercadoBitcoinException("Internal error: Unable to transform the parameters in a request.");
}
return params;
}
| JsonHashMap params = new JsonHashMap(); try { params.putAll(ReflectionUtils.getParameters(this)); } catch (Throwable e) { throw new MercadoBitcoinException(STR); } return params; } | /**
* Get the Parameters of the Object and return them as a list with the name and the value of each parameter.
*
* @throws MercadoBitcoinException Generic exception to point any error with the execution.
*/ | Get the Parameters of the Object and return them as a list with the name and the value of each parameter | toParams | {
"repo_name": "MercadoBitcoin/mb-api-client-java",
"path": "src/main/java/net/mercadobitcoin/tradeapi/to/TapiBase.java",
"license": "mit",
"size": 1044
} | [
"net.mercadobitcoin.common.exception.MercadoBitcoinException",
"net.mercadobitcoin.util.JsonHashMap",
"net.mercadobitcoin.util.ReflectionUtils"
] | import net.mercadobitcoin.common.exception.MercadoBitcoinException; import net.mercadobitcoin.util.JsonHashMap; import net.mercadobitcoin.util.ReflectionUtils; | import net.mercadobitcoin.common.exception.*; import net.mercadobitcoin.util.*; | [
"net.mercadobitcoin.common",
"net.mercadobitcoin.util"
] | net.mercadobitcoin.common; net.mercadobitcoin.util; | 407,278 |
@Test(expectedExceptions = { DirectMessageWrongRecipientForAnswerException.class })
public void testFailureOnAnswerWithWrongRecipient()
throws DirectMessageWrongRecipientForAnswerException, Exception {
AuthenticationTestUtils.setSecurityContext(user1);
NoteStoringTO noteStoringTO... | @Test(expectedExceptions = { DirectMessageWrongRecipientForAnswerException.class }) void function() throws DirectMessageWrongRecipientForAnswerException, Exception { AuthenticationTestUtils.setSecurityContext(user1); NoteStoringTO noteStoringTO = TestUtils.createCommonNote(blog1, user1.getId(), STR + user1.getAlias() +... | /**
* Test that it is not possible to mention users in a direct message, which is created as a
* reply to another direct message, that are not recipients or the author of the parent note.
*
* @throws DirectMessageWrongRecipientForAnswerException
* in case the test succeeded
... | Test that it is not possible to mention users in a direct message, which is created as a reply to another direct message, that are not recipients or the author of the parent note | testFailureOnAnswerWithWrongRecipient | {
"repo_name": "Communote/communote-server",
"path": "communote/tests/all-versions/integration/src/test/java/com/communote/server/core/note/DirectMessageTest.java",
"license": "apache-2.0",
"size": 28354
} | [
"com.communote.server.api.core.note.NoteStoringTO",
"com.communote.server.core.blog.notes.processors.exceptions.DirectMessageWrongRecipientForAnswerException",
"com.communote.server.test.util.AuthenticationTestUtils",
"com.communote.server.test.util.TestUtils",
"org.testng.Assert",
"org.testng.annotations... | import com.communote.server.api.core.note.NoteStoringTO; import com.communote.server.core.blog.notes.processors.exceptions.DirectMessageWrongRecipientForAnswerException; import com.communote.server.test.util.AuthenticationTestUtils; import com.communote.server.test.util.TestUtils; import org.testng.Assert; import org.t... | import com.communote.server.api.core.note.*; import com.communote.server.core.blog.notes.processors.exceptions.*; import com.communote.server.test.util.*; import org.testng.*; import org.testng.annotations.*; | [
"com.communote.server",
"org.testng",
"org.testng.annotations"
] | com.communote.server; org.testng; org.testng.annotations; | 320,425 |
@Test
public void testTemplateSheetStylesUniqueness() throws Exception {
tr.copyTemplateIntoFile(TEMPLATE_NAME, workingFile);
Map<String, TemplateSheet> sheetMap = tr.getSheetMap();
// First Sheet
TemplateSheet sheet = sheetMap.get(TEST_SHEET_NAME);
Map<String, TemplateC... | void function() throws Exception { tr.copyTemplateIntoFile(TEMPLATE_NAME, workingFile); Map<String, TemplateSheet> sheetMap = tr.getSheetMap(); TemplateSheet sheet = sheetMap.get(TEST_SHEET_NAME); Map<String, TemplateColumn> columns = sheet.getColumnMap(); TemplateColumn columnA = columns.get(COLUMN_A); TemplateSheet s... | /**
* Make sure that each sheet and each column have unique cell styles.
*
* @throws Exception
* the exception
*/ | Make sure that each sheet and each column have unique cell styles | testTemplateSheetStylesUniqueness | {
"repo_name": "blackducksoftware/common-framework",
"path": "src/test/java/com/blackducksoftware/tools/commonframework/standard/protex/report/template/TemplateReaderTest.java",
"license": "apache-2.0",
"size": 12355
} | [
"com.blackducksoftware.tools.commonframework.standard.protex.report.model.TemplateColumn",
"com.blackducksoftware.tools.commonframework.standard.protex.report.model.TemplateSheet",
"java.util.Map",
"org.apache.poi.ss.usermodel.CellStyle",
"org.junit.Assert"
] | import com.blackducksoftware.tools.commonframework.standard.protex.report.model.TemplateColumn; import com.blackducksoftware.tools.commonframework.standard.protex.report.model.TemplateSheet; import java.util.Map; import org.apache.poi.ss.usermodel.CellStyle; import org.junit.Assert; | import com.blackducksoftware.tools.commonframework.standard.protex.report.model.*; import java.util.*; import org.apache.poi.ss.usermodel.*; import org.junit.*; | [
"com.blackducksoftware.tools",
"java.util",
"org.apache.poi",
"org.junit"
] | com.blackducksoftware.tools; java.util; org.apache.poi; org.junit; | 2,241,190 |
public List<RepoDescriptor> getDescriptors() {
return super.getDescriptors();
} | List<RepoDescriptor> function() { return super.getDescriptors(); } | /**
* Gets a sorted list of descriptors for all extended variable sets
* @return A sorted list of RepoDescriptors (String pairs - name, description)
*/ | Gets a sorted list of descriptors for all extended variable sets | getDescriptors | {
"repo_name": "yawlfoundation/editor",
"path": "source/org/yawlfoundation/yawl/editor/core/repository/DataDefinitionRepository.java",
"license": "lgpl-3.0",
"size": 2710
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 689,516 |
public static <T> SelectableDecorator<T> toDecorator(Bean<T> bean) {
if (bean instanceof SelectableDecorator) {
return (SelectableDecorator<T>) bean;
}
if (!(bean instanceof Decorator)) {
throw new CreationException("a decorator must be a decorator bean");
}
return new SelectableDecora... | static <T> SelectableDecorator<T> function(Bean<T> bean) { if (bean instanceof SelectableDecorator) { return (SelectableDecorator<T>) bean; } if (!(bean instanceof Decorator)) { throw new CreationException(STR); } return new SelectableDecoratorWrapper<>((Decorator<T>) bean); } | /**
* Convert a Bean to SelectableDecorator.
*
* @param <T> the type of bean
* @param bean a Bean
* @return a SelectableDecorator
*/ | Convert a Bean to SelectableDecorator | toDecorator | {
"repo_name": "gcolin/juikito",
"path": "cdi/src/main/java/net/gcolin/di/cdi/internal/bean/BeanFormat.java",
"license": "apache-2.0",
"size": 2672
} | [
"javax.enterprise.inject.CreationException",
"javax.enterprise.inject.spi.Bean",
"javax.enterprise.inject.spi.Decorator"
] | import javax.enterprise.inject.CreationException; import javax.enterprise.inject.spi.Bean; import javax.enterprise.inject.spi.Decorator; | import javax.enterprise.inject.*; import javax.enterprise.inject.spi.*; | [
"javax.enterprise"
] | javax.enterprise; | 2,521,808 |
private void paint(int brushObject, int penObject, Shape shape, Graphics2D g2d) {
if ( brushObject >= 0 ) {
Paint paint = getStoredPaint(currentStore, brushObject);
if (!((firstEffectivePaint) && (paint.equals(Color.white)))) {
setBrushPaint( currentStore, g2d, brushO... | void function(int brushObject, int penObject, Shape shape, Graphics2D g2d) { if ( brushObject >= 0 ) { Paint paint = getStoredPaint(currentStore, brushObject); if (!((firstEffectivePaint) && (paint.equals(Color.white)))) { setBrushPaint( currentStore, g2d, brushObject ); g2d.fill(shape); firstEffectivePaint = false; } ... | /** Draw or / and fill the Shape, depending on the pen or brush Objects selected.
*/ | Draw or / and fill the Shape, depending on the pen or brush Objects selected | paint | {
"repo_name": "Uni-Sol/batik",
"path": "sources/org/apache/batik/transcoder/wmf/tosvg/WMFPainter.java",
"license": "apache-2.0",
"size": 52591
} | [
"java.awt.Color",
"java.awt.Graphics2D",
"java.awt.Paint",
"java.awt.Shape"
] | import java.awt.Color; import java.awt.Graphics2D; import java.awt.Paint; import java.awt.Shape; | import java.awt.*; | [
"java.awt"
] | java.awt; | 417,378 |
public java.util.List<fr.lip6.move.pnml.symmetricnet.integers.hlapi.LessThanHLAPI> getSubterm_integers_LessThanHLAPI(){
java.util.List<fr.lip6.move.pnml.symmetricnet.integers.hlapi.LessThanHLAPI> retour = new ArrayList<fr.lip6.move.pnml.symmetricnet.integers.hlapi.LessThanHLAPI>();
for (Term elemnt : getSubt... | java.util.List<fr.lip6.move.pnml.symmetricnet.integers.hlapi.LessThanHLAPI> function(){ java.util.List<fr.lip6.move.pnml.symmetricnet.integers.hlapi.LessThanHLAPI> retour = new ArrayList<fr.lip6.move.pnml.symmetricnet.integers.hlapi.LessThanHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip... | /**
* This accessor return a list of encapsulated subelement, only of LessThanHLAPI kind.
* WARNING : this method can creates a lot of new object in memory.
*/ | This accessor return a list of encapsulated subelement, only of LessThanHLAPI kind. WARNING : this method can creates a lot of new object in memory | getSubterm_integers_LessThanHLAPI | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-SNNet/src/fr/lip6/move/pnml/symmetricnet/finiteIntRanges/hlapi/FiniteIntRangeConstantHLAPI.java",
"license": "epl-1.0",
"size": 94739
} | [
"fr.lip6.move.pnml.symmetricnet.terms.Term",
"java.util.ArrayList",
"java.util.List"
] | import fr.lip6.move.pnml.symmetricnet.terms.Term; import java.util.ArrayList; import java.util.List; | import fr.lip6.move.pnml.symmetricnet.terms.*; import java.util.*; | [
"fr.lip6.move",
"java.util"
] | fr.lip6.move; java.util; | 192,513 |
public void visitBlock(List<Statement> statements) {
visitAll(statements);
}
// node-specific visit methods | void function(List<Statement> statements) { visitAll(statements); } | /**
* Visit a sequence ("block") of statements (e.g. an if branch, for block, function block etc.)
*
* This method allows subclasses to handle statement blocks more easily, like doing an action
* after every statement in a block without having to override visit(...) for all statements.
*
* @param stat... | Visit a sequence ("block") of statements (e.g. an if branch, for block, function block etc.) This method allows subclasses to handle statement blocks more easily, like doing an action after every statement in a block without having to override visit(...) for all statements | visitBlock | {
"repo_name": "aehlig/bazel",
"path": "src/main/java/com/google/devtools/build/lib/syntax/NodeVisitor.java",
"license": "apache-2.0",
"size": 5027
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,617,573 |
@WebMethod(operationName = "isServiceEnabled")
public boolean isServiceEnabled(
@WebParam(name = "serviceId") final ManagedServiceIdentifier serviceId) {
String serviceStatus = getServiceStatus(serviceId);
boolean enabled = ManagedServiceStatus.ENABLED.name().equals(serviceStatus);
ret... | @WebMethod(operationName = STR) boolean function( @WebParam(name = STR) final ManagedServiceIdentifier serviceId) { String serviceStatus = getServiceStatus(serviceId); boolean enabled = ManagedServiceStatus.ENABLED.name().equals(serviceStatus); return enabled; } | /**
* A convenience method to check whether a given service has the enabled
* status set.
*
* @param serviceId identifies the service
* @return <code>true</code> if the ENABLED status is current set for the
* service
*/ | A convenience method to check whether a given service has the enabled status set | isServiceEnabled | {
"repo_name": "OpenWIS/openwis",
"path": "openwis-management/openwis-management-service/openwis-management-service-ejb/src/main/java/org/openwis/management/service/ControlServiceImpl.java",
"license": "gpl-3.0",
"size": 22213
} | [
"javax.jws.WebMethod",
"javax.jws.WebParam"
] | import javax.jws.WebMethod; import javax.jws.WebParam; | import javax.jws.*; | [
"javax.jws"
] | javax.jws; | 2,630,015 |
public static String trimTags (String input, NodeFilter filter)
throws ParserException, UnsupportedEncodingException
{
return trimTags (input, filter, true, true);
}
| static String function (String input, NodeFilter filter) throws ParserException, UnsupportedEncodingException { return trimTags (input, filter, true, true); } | /**
* Trim all tags in the input string and
* return a string like the input one
* without the tags and their content.
* <BR>Use NodeFilter class as input parameter
* instead of tags[] string array.
* @see ParserUtils#trimTags (String input, String[] tags, boolean recursive, boolean ... | Trim all tags in the input string and return a string like the input one without the tags and their content. Use NodeFilter class as input parameter instead of tags[] string array | trimTags | {
"repo_name": "socialwareinc/html-parser",
"path": "parser/src/main/java/org/htmlparser/util/ParserUtils.java",
"license": "lgpl-3.0",
"size": 53255
} | [
"java.io.UnsupportedEncodingException",
"org.htmlparser.NodeFilter",
"org.htmlparser.util.ParserException"
] | import java.io.UnsupportedEncodingException; import org.htmlparser.NodeFilter; import org.htmlparser.util.ParserException; | import java.io.*; import org.htmlparser.*; import org.htmlparser.util.*; | [
"java.io",
"org.htmlparser",
"org.htmlparser.util"
] | java.io; org.htmlparser; org.htmlparser.util; | 166,191 |
public List<Field> removePageTokenFromFields(Iterable<Field> fields, MethodConfig methodConfig) {
List<Field> newFields = new ArrayList<>();
for (Field field : fields) {
if (methodConfig.isPageStreaming()
&& field.equals(methodConfig.getPageStreaming().getRequestTokenField())) {
contin... | List<Field> function(Iterable<Field> fields, MethodConfig methodConfig) { List<Field> newFields = new ArrayList<>(); for (Field field : fields) { if (methodConfig.isPageStreaming() && field.equals(methodConfig.getPageStreaming().getRequestTokenField())) { continue; } newFields.add(field); } return newFields; } | /**
* Returns the list of optional fields from the given MethodConfig, excluding the Page Token field
*/ | Returns the list of optional fields from the given MethodConfig, excluding the Page Token field | removePageTokenFromFields | {
"repo_name": "jmuk/toolkit",
"path": "src/main/java/com/google/api/codegen/GapicContext.java",
"license": "apache-2.0",
"size": 4736
} | [
"com.google.api.tools.framework.model.Field",
"java.util.ArrayList",
"java.util.List"
] | import com.google.api.tools.framework.model.Field; import java.util.ArrayList; import java.util.List; | import com.google.api.tools.framework.model.*; import java.util.*; | [
"com.google.api",
"java.util"
] | com.google.api; java.util; | 1,331,004 |
public static Map<String, String> getMetaStoreSaslProperties(HiveConf conf) {
// As of now Hive Meta Store uses the same configuration as Hadoop SASL configuration
return ShimLoader.getHadoopThriftAuthBridge().getHadoopSaslProperties(conf);
} | static Map<String, String> function(HiveConf conf) { return ShimLoader.getHadoopThriftAuthBridge().getHadoopSaslProperties(conf); } | /**
* Read and return the meta store Sasl configuration. Currently it uses the default
* Hadoop SASL configuration and can be configured using "hadoop.rpc.protection"
* HADOOP-10211, made a backward incompatible change due to which this call doesn't
* work with Hadoop 2.4.0 and later.
* @param conf
* ... | Read and return the meta store Sasl configuration. Currently it uses the default Hadoop SASL configuration and can be configured using "hadoop.rpc.protection" HADOOP-10211, made a backward incompatible change due to which this call doesn't work with Hadoop 2.4.0 and later | getMetaStoreSaslProperties | {
"repo_name": "scalingdata/Impala",
"path": "thirdparty/hive-1.2.1.2.3.0.0-2557/src/metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreUtils.java",
"license": "apache-2.0",
"size": 62064
} | [
"java.util.Map",
"org.apache.hadoop.hive.conf.HiveConf",
"org.apache.hadoop.hive.shims.ShimLoader"
] | import java.util.Map; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.shims.ShimLoader; | import java.util.*; import org.apache.hadoop.hive.conf.*; import org.apache.hadoop.hive.shims.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 666,452 |
public boolean inBounds(Rectangle bounds)
{
return bounds.contains(mX, mY);
}
| boolean function(Rectangle bounds) { return bounds.contains(mX, mY); } | /**
* Returns whether a Location is within the given rectangle.
*
* @param bounds a rectangle
* @return <CODE>true</CODE> if the Location is inside the rectangle, <CODE>false</CODE> otherwise
*/ | Returns whether a Location is within the given rectangle | inBounds | {
"repo_name": "wfwalker/jcavern",
"path": "sources/jcavern/Location.java",
"license": "mit",
"size": 7326
} | [
"java.awt.Rectangle"
] | import java.awt.Rectangle; | import java.awt.*; | [
"java.awt"
] | java.awt; | 400,230 |
public static void checkAttributeMismatch(IgniteLogger log, CacheConfiguration locCfg,
CacheConfiguration rmtCfg, UUID rmtNodeId, T2<String, String> attr, boolean fail) throws IgniteCheckedException {
assert rmtNodeId != null;
assert attr != null;
assert attr.get1() != null;
... | static void function(IgniteLogger log, CacheConfiguration locCfg, CacheConfiguration rmtCfg, UUID rmtNodeId, T2<String, String> attr, boolean fail) throws IgniteCheckedException { assert rmtNodeId != null; assert attr != null; assert attr.get1() != null; assert attr.get2() != null; Object locVal = U.property(locCfg, at... | /**
* Checks that local and remove configurations have the same value of given attribute.
*
* @param log Logger used to log warning message (used only if fail flag is not set).
* @param locCfg Local configuration.
* @param rmtCfg Remote configuration.
* @param rmtNodeId Remote node.
*... | Checks that local and remove configurations have the same value of given attribute | checkAttributeMismatch | {
"repo_name": "xtern/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java",
"license": "apache-2.0",
"size": 79169
} | [
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.IgniteLogger",
"org.apache.ignite.configuration.CacheConfiguration",
"org.apache.ignite.internal.util.typedef.internal.U"
] | import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteLogger; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.util.typedef.internal.U; | import org.apache.ignite.*; import org.apache.ignite.configuration.*; import org.apache.ignite.internal.util.typedef.internal.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 734,861 |
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<WorkerPoolResourceInner> getMultiRolePoolAsync(String resourceGroupName, String name) {
return getMultiRolePoolWithResponseAsync(resourceGroupName, name)
.flatMap(
(Response<WorkerPoolResourceInner> res) -> {
... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<WorkerPoolResourceInner> function(String resourceGroupName, String name) { return getMultiRolePoolWithResponseAsync(resourceGroupName, name) .flatMap( (Response<WorkerPoolResourceInner> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { re... | /**
* Get properties of a multi-role pool.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service Environment.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseEr... | Get properties of a multi-role pool | getMultiRolePoolAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/AppServiceEnvironmentsClientImpl.java",
"license": "mit",
"size": 563770
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.resourcemanager.appservice.fluent.models.WorkerPoolResourceInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.resourcemanager.appservice.fluent.models.WorkerPoolResourceInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.appservice.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,642,906 |
@Test(expected = P4JavaException.class)
public void testJobGetP4JavaException() throws P4JavaException {
when(server.execMapCmdList(eq(JOB.toString()), argThat(GET_MATCHER), eq((Map<String, Object>)null)))
.thenThrow(P4JavaException.class);
jobDelegator.getJob(TEST_JOB);
} | @Test(expected = P4JavaException.class) void function() throws P4JavaException { when(server.execMapCmdList(eq(JOB.toString()), argThat(GET_MATCHER), eq((Map<String, Object>)null))) .thenThrow(P4JavaException.class); jobDelegator.getJob(TEST_JOB); } | /**
* Test get job P4Java exception.
*
* @throws P4JavaException
* the p4 java exception
*/ | Test get job P4Java exception | testJobGetP4JavaException | {
"repo_name": "groboclown/p4ic4idea",
"path": "p4java/r19-1/src/test/java/com/perforce/p4java/impl/mapbased/server/cmd/JobDelegatorTest.java",
"license": "apache-2.0",
"size": 18238
} | [
"com.perforce.p4java.exception.P4JavaException",
"com.perforce.p4java.server.CmdSpec",
"java.util.Map",
"org.junit.Test",
"org.mockito.ArgumentMatchers",
"org.mockito.Mockito"
] | import com.perforce.p4java.exception.P4JavaException; import com.perforce.p4java.server.CmdSpec; import java.util.Map; import org.junit.Test; import org.mockito.ArgumentMatchers; import org.mockito.Mockito; | import com.perforce.p4java.exception.*; import com.perforce.p4java.server.*; import java.util.*; import org.junit.*; import org.mockito.*; | [
"com.perforce.p4java",
"java.util",
"org.junit",
"org.mockito"
] | com.perforce.p4java; java.util; org.junit; org.mockito; | 193,807 |
public void consumeAsync(Purchase purchase, OnConsumeFinishedListener listener) {
checkNotDisposed();
checkSetupDone("consume");
List<Purchase> purchases = new ArrayList<Purchase>();
purchases.add(purchase);
consumeAsyncInternal(purchases, listener, null);
} | void function(Purchase purchase, OnConsumeFinishedListener listener) { checkNotDisposed(); checkSetupDone(STR); List<Purchase> purchases = new ArrayList<Purchase>(); purchases.add(purchase); consumeAsyncInternal(purchases, listener, null); } | /**
* Asynchronous wrapper to item consumption. Works like {@link #consume}, but
* performs the consumption in the background and notifies completion through
* the provided listener. This method is safe to call from a UI thread.
*
* @param purchase The purchase to be consumed.
* @param lis... | Asynchronous wrapper to item consumption. Works like <code>#consume</code>, but performs the consumption in the background and notifies completion through the provided listener. This method is safe to call from a UI thread | consumeAsync | {
"repo_name": "lvillani/droidkit",
"path": "src/main/java/com/google/android/vending/billing/IabHelper.java",
"license": "apache-2.0",
"size": 44303
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,371,461 |
int updateByExample(@Param("record") BrMemberGroupNavTabDbObjKey record, @Param("example") BrMemberGroupNavTabDbObjExample example); | int updateByExample(@Param(STR) BrMemberGroupNavTabDbObjKey record, @Param(STR) BrMemberGroupNavTabDbObjExample example); | /**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table BR_MEMBER_GROUP_NAV_TAB
*
* @mbggenerated Thu Jan 26 21:57:27 EST 2017
*/ | This method was generated by MyBatis Generator. This method corresponds to the database table BR_MEMBER_GROUP_NAV_TAB | updateByExample | {
"repo_name": "ZFGCCP/ZFGC3",
"path": "src/main/java/com/zfgc/mappers/BrMemberGroupNavTabDbObjMapper.java",
"license": "mit",
"size": 2583
} | [
"com.zfgc.dbobj.BrMemberGroupNavTabDbObjExample",
"com.zfgc.dbobj.BrMemberGroupNavTabDbObjKey",
"org.apache.ibatis.annotations.Param"
] | import com.zfgc.dbobj.BrMemberGroupNavTabDbObjExample; import com.zfgc.dbobj.BrMemberGroupNavTabDbObjKey; import org.apache.ibatis.annotations.Param; | import com.zfgc.dbobj.*; import org.apache.ibatis.annotations.*; | [
"com.zfgc.dbobj",
"org.apache.ibatis"
] | com.zfgc.dbobj; org.apache.ibatis; | 1,331,895 |
public void getKeyValue(float[] val) {
if ( keyValue == null ) {
keyValue = (MFVec3f)getField( "keyValue" );
}
keyValue.getValue( val );
} | void function(float[] val) { if ( keyValue == null ) { keyValue = (MFVec3f)getField( STR ); } keyValue.getValue( val ); } | /** Return the keyValue value in the argument float[]
* @param val The float[] to initialize. */ | Return the keyValue value in the argument float[] | getKeyValue | {
"repo_name": "Norkart/NK-VirtualGlobe",
"path": "Xj3D/src/java/org/xj3d/sai/internal/node/interpolation/SAIPositionInterpolator.java",
"license": "gpl-2.0",
"size": 3808
} | [
"org.web3d.x3d.sai.MFVec3f"
] | import org.web3d.x3d.sai.MFVec3f; | import org.web3d.x3d.sai.*; | [
"org.web3d.x3d"
] | org.web3d.x3d; | 145,821 |
public static void checkForNullDbt(DatabaseEntry entry,
String name,
boolean checkData) {
if (entry == null) {
throw new IllegalArgumentException
("DatabaseEntry " + name + " cannot be null");
}... | static void function(DatabaseEntry entry, String name, boolean checkData) { if (entry == null) { throw new IllegalArgumentException (STR + name + STR); } if (checkData) { if (entry.getData() == null) { throw new IllegalArgumentException (STR + name + STR); } } } | /**
* Throw an exception if the entry is null or the data field is not set.
*
* @throws IllegalArgumentException via any API method that takes a
* required DatabaseEntry param
*/ | Throw an exception if the entry is null or the data field is not set | checkForNullDbt | {
"repo_name": "bjorndm/prebake",
"path": "code/third_party/bdb/src/com/sleepycat/je/utilint/DatabaseUtil.java",
"license": "apache-2.0",
"size": 1886
} | [
"com.sleepycat.je.DatabaseEntry"
] | import com.sleepycat.je.DatabaseEntry; | import com.sleepycat.je.*; | [
"com.sleepycat.je"
] | com.sleepycat.je; | 2,304,824 |
private boolean pruned(Type type) {
return pruned(TypeToken.of(type).getRawType());
} | boolean function(Type type) { return pruned(TypeToken.of(type).getRawType()); } | /**
* Whether a type and all that it references should be pruned from the graph.
*/ | Whether a type and all that it references should be pruned from the graph | pruned | {
"repo_name": "Test-Betta-Inc/musical-umbrella",
"path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/util/ApiSurface.java",
"license": "apache-2.0",
"size": 18500
} | [
"com.google.common.reflect.TypeToken",
"java.lang.reflect.Type"
] | import com.google.common.reflect.TypeToken; import java.lang.reflect.Type; | import com.google.common.reflect.*; import java.lang.reflect.*; | [
"com.google.common",
"java.lang"
] | com.google.common; java.lang; | 2,615,802 |
List<Scored<SemanticEntity>> search(Term keyword, IndexField.Searchable field, Collection<String> conceptSchemes, Collection<String> collections, int offset, int limit); | List<Scored<SemanticEntity>> search(Term keyword, IndexField.Searchable field, Collection<String> conceptSchemes, Collection<String> collections, int offset, int limit); | /**
* Lists the semantic entities whose values for the provided field
* match the provided keyword and which belong to at least one of the
* concept schemes and at least one of the collections identified by the
* provided URIs
* @param keyword A {@link ie.cmrc.util.Term} consisting of a string ... | Lists the semantic entities whose values for the provided field match the provided keyword and which belong to at least one of the concept schemes and at least one of the collections identified by the provided URIs | search | {
"repo_name": "beaufort/semantix",
"path": "semantix-skos-index/src/main/java/ie/cmrc/smtx/skos/index/SKOSIndex.java",
"license": "apache-2.0",
"size": 17515
} | [
"ie.cmrc.smtx.base.SemanticEntity",
"ie.cmrc.util.Term",
"java.util.Collection",
"java.util.List"
] | import ie.cmrc.smtx.base.SemanticEntity; import ie.cmrc.util.Term; import java.util.Collection; import java.util.List; | import ie.cmrc.smtx.base.*; import ie.cmrc.util.*; import java.util.*; | [
"ie.cmrc.smtx",
"ie.cmrc.util",
"java.util"
] | ie.cmrc.smtx; ie.cmrc.util; java.util; | 707,000 |
public static <E extends Comparable<? super E>> ImmutableSortedMultiset<E> copyOf(E[] elements) {
return copyOf(Ordering.natural(), Arrays.asList(elements));
}
/**
* Returns an immutable sorted multiset containing the given elements sorted by their natural
* ordering. To create a copy of a {@code Sorte... | static <E extends Comparable<? super E>> ImmutableSortedMultiset<E> function(E[] elements) { return copyOf(Ordering.natural(), Arrays.asList(elements)); } /** * Returns an immutable sorted multiset containing the given elements sorted by their natural * ordering. To create a copy of a {@code SortedMultiset} that preser... | /**
* Returns an immutable sorted multiset containing the given elements sorted by their natural
* ordering.
*
* @throws NullPointerException if any of {@code elements} is null
*/ | Returns an immutable sorted multiset containing the given elements sorted by their natural ordering | copyOf | {
"repo_name": "ben-manes/guava",
"path": "guava/src/com/google/common/collect/ImmutableSortedMultiset.java",
"license": "apache-2.0",
"size": 20544
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 2,557,984 |
G initGraphHead(GradoopId id, String label); | G initGraphHead(GradoopId id, String label); | /**
* Initializes a graph head based on the given parameters.
*
* @param id graph identifier
* @param label graph label
* @return graph data
*/ | Initializes a graph head based on the given parameters | initGraphHead | {
"repo_name": "p3et/gradoop",
"path": "gradoop-common/src/main/java/org/gradoop/common/model/api/entities/EPGMGraphHeadFactory.java",
"license": "apache-2.0",
"size": 2183
} | [
"org.gradoop.common.model.impl.id.GradoopId"
] | import org.gradoop.common.model.impl.id.GradoopId; | import org.gradoop.common.model.impl.id.*; | [
"org.gradoop.common"
] | org.gradoop.common; | 882,352 |
private int getTimeout(final Ticket t) {
if (t instanceof TicketGrantingTicket) {
return this.tgtTimeout;
} else if (t instanceof ServiceTicket) {
return this.stTimeout;
}
throw new IllegalArgumentException("Invalid ticket type");
}
| int function(final Ticket t) { if (t instanceof TicketGrantingTicket) { return this.tgtTimeout; } else if (t instanceof ServiceTicket) { return this.stTimeout; } throw new IllegalArgumentException(STR); } | /**
* Gets the timeout value for the ticket.
*
* @param t the t
* @return the timeout
*/ | Gets the timeout value for the ticket | getTimeout | {
"repo_name": "fengbaicanhe/cas",
"path": "cas-server-integration-memcached/src/main/java/org/jasig/cas/ticket/registry/MemCacheTicketRegistry.java",
"license": "apache-2.0",
"size": 8280
} | [
"org.jasig.cas.ticket.ServiceTicket",
"org.jasig.cas.ticket.Ticket",
"org.jasig.cas.ticket.TicketGrantingTicket"
] | import org.jasig.cas.ticket.ServiceTicket; import org.jasig.cas.ticket.Ticket; import org.jasig.cas.ticket.TicketGrantingTicket; | import org.jasig.cas.ticket.*; | [
"org.jasig.cas"
] | org.jasig.cas; | 47,576 |
public CppModel addCopts(Collection<String> copts) {
this.copts.addAll(copts);
return this;
} | CppModel function(Collection<String> copts) { this.copts.addAll(copts); return this; } | /**
* Adds the given copts.
*/ | Adds the given copts | addCopts | {
"repo_name": "kamalmarhubi/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CppModel.java",
"license": "apache-2.0",
"size": 35086
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,929,789 |
public void doUnbind() {
if (mIsBound) {
Log.i(TAG, "unbind " + mConn);
unbindService(getServiceConnection0());
}
} | void function() { if (mIsBound) { Log.i(TAG, STR + mConn); unbindService(getServiceConnection0()); } } | /**
* Already called in onDestroy to prevent ServiceConnection leaked
*/ | Already called in onDestroy to prevent ServiceConnection leaked | doUnbind | {
"repo_name": "410063005/BtDemo",
"path": "src/cn/edu/hust/cm/bt/demo/BaseBinderActivity.java",
"license": "apache-2.0",
"size": 2414
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 938,475 |
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_)
{
if (p_70299_1_ >= this.upperChest.getSizeInventory())
{
this.lowerChest.setInventorySlotContents(p_70299_1_ - this.upperChest.getSizeInventory(), p_70299_2_);
}
else
{
thi... | void function(int p_70299_1_, ItemStack p_70299_2_) { if (p_70299_1_ >= this.upperChest.getSizeInventory()) { this.lowerChest.setInventorySlotContents(p_70299_1_ - this.upperChest.getSizeInventory(), p_70299_2_); } else { this.upperChest.setInventorySlotContents(p_70299_1_, p_70299_2_); } } | /**
* Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
*/ | Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections) | setInventorySlotContents | {
"repo_name": "mviitanen/marsmod",
"path": "mcp/src/minecraft/net/minecraft/inventory/InventoryLargeChest.java",
"license": "gpl-2.0",
"size": 4819
} | [
"net.minecraft.item.ItemStack"
] | import net.minecraft.item.ItemStack; | import net.minecraft.item.*; | [
"net.minecraft.item"
] | net.minecraft.item; | 1,129,973 |
private ArrayList<Deferred<Object>> getInflightRpcs() {
final ArrayList<Deferred<Object>> inflight =
new ArrayList<Deferred<Object>>();
for (final HBaseRpc rpc : rpcs_inflight.values()) {
inflight.add(rpc.getDeferred());
}
return inflight;
} | ArrayList<Deferred<Object>> function() { final ArrayList<Deferred<Object>> inflight = new ArrayList<Deferred<Object>>(); for (final HBaseRpc rpc : rpcs_inflight.values()) { inflight.add(rpc.getDeferred()); } return inflight; } | /**
* Returns a possibly empty list of all the RPCs that are in-flight.
*/ | Returns a possibly empty list of all the RPCs that are in-flight | getInflightRpcs | {
"repo_name": "manolama/asynchbase",
"path": "src/RegionClient.java",
"license": "bsd-3-clause",
"size": 93271
} | [
"com.stumbleupon.async.Deferred",
"java.util.ArrayList"
] | import com.stumbleupon.async.Deferred; import java.util.ArrayList; | import com.stumbleupon.async.*; import java.util.*; | [
"com.stumbleupon.async",
"java.util"
] | com.stumbleupon.async; java.util; | 1,103,886 |
private long getMaxVideoSize() {
return mCameraModule.getMaxVideoSize();
}
/**
* Sets the maximum video size in bytes before {@link OnVideoSavedListener#onVideoSaved(File)} | long function() { return mCameraModule.getMaxVideoSize(); } /** * Sets the maximum video size in bytes before {@link OnVideoSavedListener#onVideoSaved(File)} | /**
* Returns the maximum size of videos in bytes, or {@link #INDEFINITE_VIDEO_SIZE} if there is no
* timeout.
*/ | Returns the maximum size of videos in bytes, or <code>#INDEFINITE_VIDEO_SIZE</code> if there is no timeout | getMaxVideoSize | {
"repo_name": "jtracey/Signal-Android",
"path": "src/org/thoughtcrime/securesms/mediasend/camerax/CameraXView.java",
"license": "gpl-3.0",
"size": 34552
} | [
"androidx.camera.core.VideoCapture",
"java.io.File"
] | import androidx.camera.core.VideoCapture; import java.io.File; | import androidx.camera.core.*; import java.io.*; | [
"androidx.camera",
"java.io"
] | androidx.camera; java.io; | 2,860,684 |
QoolFactory getQoolFactory();
interface Literals {
EClass QOOL_TRANSFORMATION = eINSTANCE.getQoolTransformation();
EReference QOOL_TRANSFORMATION__SEGMENTS = eINSTANCE.getQoolTransformation_Segments();
EReference QOOL_TRANSFORMATION__QUEUES = eINSTANCE.getQoolTransformation_Queues();
ERefe... | QoolFactory getQoolFactory(); interface Literals { EClass QOOL_TRANSFORMATION = eINSTANCE.getQoolTransformation(); EReference QOOL_TRANSFORMATION__SEGMENTS = eINSTANCE.getQoolTransformation_Segments(); EReference QOOL_TRANSFORMATION__QUEUES = eINSTANCE.getQoolTransformation_Queues(); EReference QOOL_TRANSFORMATION__PRO... | /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the factory that creates the instances of the model.
* @generated
*/ | Returns the factory that creates the instances of the model. | getQoolFactory | {
"repo_name": "jesusc/eclectic",
"path": "plugins/org.eclectic.idc/src-gen/org/eclectic/idc/qool/QoolPackage.java",
"license": "gpl-3.0",
"size": 60729
} | [
"org.eclipse.emf.ecore.EAttribute",
"org.eclipse.emf.ecore.EClass",
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 644,485 |
@Override
public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) {
Object childFeature = feature;
Object childObject = child;
if (childFeature instanceof EStructuralFeature && FeatureMapUtil.isFeatureMap((EStructuralFeature)childFeature)) {
FeatureMap.Entry e... | String function(Object owner, Object feature, Object child, Collection<?> selection) { Object childFeature = feature; Object childObject = child; if (childFeature instanceof EStructuralFeature && FeatureMapUtil.isFeatureMap((EStructuralFeature)childFeature)) { FeatureMap.Entry entry = (FeatureMap.Entry)childObject; chi... | /**
* This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns the label text for <code>org.eclipse.emf.edit.command.CreateChildCommand</code>. | getCreateChildText | {
"repo_name": "markus1978/citygml4emf",
"path": "de.hub.citygml.emf.ecore.edit/src/org/w3/_2001/smil20/language/provider/SetTypeItemProvider.java",
"license": "apache-2.0",
"size": 255549
} | [
"java.util.Collection",
"net.opengis.citygml.CitygmlPackage",
"net.opengis.citygml.appearance.AppearancePackage",
"net.opengis.citygml.building.BuildingPackage",
"net.opengis.citygml.cityfurniture.CityfurniturePackage",
"net.opengis.citygml.cityobjectgroup.CityobjectgroupPackage",
"net.opengis.citygml.g... | import java.util.Collection; import net.opengis.citygml.CitygmlPackage; import net.opengis.citygml.appearance.AppearancePackage; import net.opengis.citygml.building.BuildingPackage; import net.opengis.citygml.cityfurniture.CityfurniturePackage; import net.opengis.citygml.cityobjectgroup.CityobjectgroupPackage; import n... | import java.util.*; import net.opengis.citygml.*; import net.opengis.citygml.appearance.*; import net.opengis.citygml.building.*; import net.opengis.citygml.cityfurniture.*; import net.opengis.citygml.cityobjectgroup.*; import net.opengis.citygml.generics.*; import net.opengis.citygml.landuse.*; import net.opengis.city... | [
"java.util",
"net.opengis.citygml",
"net.opengis.gml",
"org.eclipse.emf",
"org.oasis",
"org.w3"
] | java.util; net.opengis.citygml; net.opengis.gml; org.eclipse.emf; org.oasis; org.w3; | 2,134,453 |
public MessageProtocol protocol() {
return protocol;
} | MessageProtocol function() { return protocol; } | /**
* The protocol.
*
* @return The protocol.
*/ | The protocol | protocol | {
"repo_name": "lagom/lagom",
"path": "service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/deser/RawExceptionMessage.java",
"license": "apache-2.0",
"size": 3064
} | [
"com.lightbend.lagom.javadsl.api.transport.MessageProtocol"
] | import com.lightbend.lagom.javadsl.api.transport.MessageProtocol; | import com.lightbend.lagom.javadsl.api.transport.*; | [
"com.lightbend.lagom"
] | com.lightbend.lagom; | 2,564,261 |
public static void inject(BroadcastReceiver broadcastReceiver, Context context) {
checkNotNull(broadcastReceiver, "broadcastReceiver");
checkNotNull(context, "context");
Application application = (Application) context.getApplicationContext();
if (!(application instanceof HasAndroidInjector)) {
t... | static void function(BroadcastReceiver broadcastReceiver, Context context) { checkNotNull(broadcastReceiver, STR); checkNotNull(context, STR); Application application = (Application) context.getApplicationContext(); if (!(application instanceof HasAndroidInjector)) { throw new RuntimeException( String.format( STR, appl... | /**
* Injects {@code broadcastReceiver} if an associated {@link AndroidInjector} implementation can
* be found, otherwise throws an {@link IllegalArgumentException}.
*
* @throws RuntimeException if the {@link Application} from {@link
* Context#getApplicationContext()} doesn't implement {@link HasAndr... | Injects broadcastReceiver if an associated <code>AndroidInjector</code> implementation can be found, otherwise throws an <code>IllegalArgumentException</code> | inject | {
"repo_name": "cgruber/dagger",
"path": "java/dagger/android/AndroidInjection.java",
"license": "apache-2.0",
"size": 7086
} | [
"android.app.Application",
"android.content.BroadcastReceiver",
"android.content.Context"
] | import android.app.Application; import android.content.BroadcastReceiver; import android.content.Context; | import android.app.*; import android.content.*; | [
"android.app",
"android.content"
] | android.app; android.content; | 531,653 |
private void load(final Uri uri, final HybridFileParcelable mFile) {
setProgress(true);
this.mFile = mFile;
mInput.setHint(R.string.loading);
new Thread(() -> {
try {
inputStream = getInputStream(uri, mFile);
String str;
S... | void function(final Uri uri, final HybridFileParcelable mFile) { setProgress(true); this.mFile = mFile; mInput.setHint(R.string.loading); new Thread(() -> { try { inputStream = getInputStream(uri, mFile); String str; StringBuilder stringBuilder = new StringBuilder(); BufferedReader bufferedReader = new BufferedReader(n... | /**
* Initiates loading of file/uri by getting an input stream associated with it
* on a worker thread
*
* @param uri
* @param mFile
*/ | Initiates loading of file/uri by getting an input stream associated with it on a worker thread | load | {
"repo_name": "AmazengProject/AmazeFileManager",
"path": "app/src/main/java/com/amaze/filemanager/activities/TextEditorActivity.java",
"license": "gpl-3.0",
"size": 34800
} | [
"android.net.Uri",
"com.amaze.filemanager.exceptions.StreamNotFoundException",
"com.amaze.filemanager.filesystem.HybridFileParcelable",
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStreamReader"
] | import android.net.Uri; import com.amaze.filemanager.exceptions.StreamNotFoundException; import com.amaze.filemanager.filesystem.HybridFileParcelable; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; | import android.net.*; import com.amaze.filemanager.exceptions.*; import com.amaze.filemanager.filesystem.*; import java.io.*; | [
"android.net",
"com.amaze.filemanager",
"java.io"
] | android.net; com.amaze.filemanager; java.io; | 504,835 |
public static String getEndElementName(EndElement endElement) {
return trim(endElement.getName().getLocalPart());
} | static String function(EndElement endElement) { return trim(endElement.getName().getLocalPart()); } | /**
* Return the name of the end element
*
* @param endElement
*
* @return
*/ | Return the name of the end element | getEndElementName | {
"repo_name": "mbaluch/keycloak",
"path": "saml-core/src/main/java/org/keycloak/saml/common/util/StaxParserUtil.java",
"license": "apache-2.0",
"size": 17929
} | [
"javax.xml.stream.events.EndElement"
] | import javax.xml.stream.events.EndElement; | import javax.xml.stream.events.*; | [
"javax.xml"
] | javax.xml; | 1,446,654 |
for (GridService g : gridServiceDao.getAll()) {
if (gridServiceEndPointCatalogEntryDao.isAbout(g) == null) {
if (!baseServiceFilter.willBeFiltered(g)) {
logger
.debug("GridService Endpoint catalog not found. Will create for id "
... | for (GridService g : gridServiceDao.getAll()) { if (gridServiceEndPointCatalogEntryDao.isAbout(g) == null) { if (!baseServiceFilter.willBeFiltered(g)) { logger .debug(STR + g.getId()); serviceMetadataCatalogEntryBuilder.build(g); } } } } | /**
* Will make sure catalog items exist for all services Run on container
* startup
*
* @throws Exception
*/ | Will make sure catalog items exist for all services Run on container startup | loadCatalogItems | {
"repo_name": "NCIP/cagrid-portal",
"path": "cagrid-portal/aggr/src/java/gov/nih/nci/cagrid/portal/aggr/catalog/GridServiceEndPointCatalogCreatorDelegate.java",
"license": "bsd-3-clause",
"size": 3228
} | [
"gov.nih.nci.cagrid.portal.domain.GridService"
] | import gov.nih.nci.cagrid.portal.domain.GridService; | import gov.nih.nci.cagrid.portal.domain.*; | [
"gov.nih.nci"
] | gov.nih.nci; | 2,328,420 |
@SuppressWarnings("unchecked")
public Type to(ExchangePattern pattern, String uri) {
addOutput(new ToDefinition(uri, pattern));
return (Type) this;
}
| @SuppressWarnings(STR) Type function(ExchangePattern pattern, String uri) { addOutput(new ToDefinition(uri, pattern)); return (Type) this; } | /**
* Sends the exchange with certain exchange pattern to the given endpoint
*
* @param pattern the pattern to use for the message exchange
* @param uri the endpoint to send to
* @return the builder
*/ | Sends the exchange with certain exchange pattern to the given endpoint | to | {
"repo_name": "everttigchelaar/camel-svn",
"path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java",
"license": "apache-2.0",
"size": 120346
} | [
"org.apache.camel.ExchangePattern"
] | import org.apache.camel.ExchangePattern; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 711,484 |
public static DisplaceEntityEvent.Teleport createDisplaceEntityEventTeleport(Cause cause, Transform<World> fromTransform, Transform<World> toTransform, Entity targetEntity, TeleporterAgent teleporterAgent, boolean keepsVelocity) {
HashMap<String, Object> values = new HashMap<>();
values.put("cause",... | static DisplaceEntityEvent.Teleport function(Cause cause, Transform<World> fromTransform, Transform<World> toTransform, Entity targetEntity, TeleporterAgent teleporterAgent, boolean keepsVelocity) { HashMap<String, Object> values = new HashMap<>(); values.put("cause", cause); values.put(STR, fromTransform); values.put(... | /**
* AUTOMATICALLY GENERATED, DO NOT EDIT.
* Creates a new instance of
* {@link org.spongepowered.api.event.entity.DisplaceEntityEvent.Teleport}.
*
* @param cause The cause
* @param fromTransform The from transform
* @param toTransform The to transform
* @param targetEntity The ... | AUTOMATICALLY GENERATED, DO NOT EDIT. Creates a new instance of <code>org.spongepowered.api.event.entity.DisplaceEntityEvent.Teleport</code> | createDisplaceEntityEventTeleport | {
"repo_name": "kashike/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/event/SpongeEventFactory.java",
"license": "mit",
"size": 215110
} | [
"java.util.HashMap",
"org.spongepowered.api.entity.Entity",
"org.spongepowered.api.entity.Transform",
"org.spongepowered.api.event.cause.Cause",
"org.spongepowered.api.event.entity.DisplaceEntityEvent",
"org.spongepowered.api.world.TeleporterAgent",
"org.spongepowered.api.world.World"
] | import java.util.HashMap; import org.spongepowered.api.entity.Entity; import org.spongepowered.api.entity.Transform; import org.spongepowered.api.event.cause.Cause; import org.spongepowered.api.event.entity.DisplaceEntityEvent; import org.spongepowered.api.world.TeleporterAgent; import org.spongepowered.api.world.World... | import java.util.*; import org.spongepowered.api.entity.*; import org.spongepowered.api.event.cause.*; import org.spongepowered.api.event.entity.*; import org.spongepowered.api.world.*; | [
"java.util",
"org.spongepowered.api"
] | java.util; org.spongepowered.api; | 1,946,704 |
public static void main(String[] args) throws UnknownHostException {
SpringApplication app = new SpringApplication(Application.class);
SimpleCommandLinePropertySource source = new SimpleCommandLinePropertySource(args);
addDefaultProfile(app, source);
Environment env = app.run(args).g... | static void function(String[] args) throws UnknownHostException { SpringApplication app = new SpringApplication(Application.class); SimpleCommandLinePropertySource source = new SimpleCommandLinePropertySource(args); addDefaultProfile(app, source); Environment env = app.run(args).getEnvironment(); log.info(STR + STRExte... | /**
* Main method, used to run the application.
*/ | Main method, used to run the application | main | {
"repo_name": "lazcatluc/agileim",
"path": "src/main/java/com/meetup/agileim/Application.java",
"license": "gpl-2.0",
"size": 4452
} | [
"java.net.InetAddress",
"java.net.UnknownHostException",
"org.springframework.boot.SpringApplication",
"org.springframework.core.env.Environment",
"org.springframework.core.env.SimpleCommandLinePropertySource"
] | import java.net.InetAddress; import java.net.UnknownHostException; import org.springframework.boot.SpringApplication; import org.springframework.core.env.Environment; import org.springframework.core.env.SimpleCommandLinePropertySource; | import java.net.*; import org.springframework.boot.*; import org.springframework.core.env.*; | [
"java.net",
"org.springframework.boot",
"org.springframework.core"
] | java.net; org.springframework.boot; org.springframework.core; | 2,523,224 |
public static File getLogFile() {
return new File(ResourceLoader.appdata, logFileName + ".log");
} | static File function() { return new File(ResourceLoader.appdata, logFileName + ".log"); } | /**
* Retrieve the current log file (will be created on first log entry,
* if nonexistent
* @return the active log file
*/ | Retrieve the current log file (will be created on first log entry, if nonexistent | getLogFile | {
"repo_name": "Klamann/maps4cim",
"path": "maps4cim-core/src/main/java/de/nx42/maps4cim/LoggerConfig.java",
"license": "apache-2.0",
"size": 6820
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,006,403 |
static byte getByteVolatile(ByteBuffer buffer, int index) {
checkIndexAndAccess(buffer, index, Byte.BYTES);
if (!buffer.hasArray()) {
return buffer.get(index);
}
return (byte) vhByteArray.getVolatile(buffer.array(), index);
} | static byte getByteVolatile(ByteBuffer buffer, int index) { checkIndexAndAccess(buffer, index, Byte.BYTES); if (!buffer.hasArray()) { return buffer.get(index); } return (byte) vhByteArray.getVolatile(buffer.array(), index); } | /**
* Gets the value with {@code volatile} semantics.
*
* @param buffer
* the byte buffer
* @param index
* the byte buffer index
* @return the value
* @see VarHandle#getVolatile(Object...)
*/ | Gets the value with volatile semantics | getByteVolatile | {
"repo_name": "anba/es6draft",
"path": "src/main/java9/com/github/anba/es6draft/runtime/objects/atomics/Atomics.java",
"license": "mit",
"size": 26888
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 1,793,902 |
private int nextIterationMarkSpanSize() throws IOException {
int spanSize = 0;
for (int i = bufferPosition; buffer.get(i) != -1 && isIterationMark((char) (buffer.get(i))); i++) {
spanSize++;
}
// Restrict span size so that we don't go past the previous end position
if (bufferPosition - spanS... | int function() throws IOException { int spanSize = 0; for (int i = bufferPosition; buffer.get(i) != -1 && isIterationMark((char) (buffer.get(i))); i++) { spanSize++; } if (bufferPosition - spanSize < iterationMarkSpanEndPosition) { spanSize = bufferPosition - iterationMarkSpanEndPosition; } return spanSize; } | /**
* Finds the number of subsequent next iteration marks
*
* @return number of iteration marks starting at the current buffer position
* @throws IOException If there is a low-level I/O error.
*/ | Finds the number of subsequent next iteration marks | nextIterationMarkSpanSize | {
"repo_name": "smartan/lucene",
"path": "src/main/java/org/apache/lucene/analysis/ja/JapaneseIterationMarkCharFilter.java",
"license": "apache-2.0",
"size": 14445
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,179,669 |
String getSimpleExtension(QName qname); | String getSimpleExtension(QName qname); | /**
* Gets the value of a simple extension
*
* @param qname An XML QName
* @return The string value of the extension
*/ | Gets the value of a simple extension | getSimpleExtension | {
"repo_name": "mfranklin/abdera",
"path": "core/src/main/java/org/apache/abdera/model/ExtensibleElement.java",
"license": "apache-2.0",
"size": 4564
} | [
"javax.xml.namespace.QName"
] | import javax.xml.namespace.QName; | import javax.xml.namespace.*; | [
"javax.xml"
] | javax.xml; | 1,166,580 |
@Test
public void createsFromStatusCode() {
// Arrange
AmqpResponseCode responseCode = AmqpResponseCode.FORBIDDEN;
AmqpErrorCondition actualCondition = AmqpErrorCondition.RESOURCE_LIMIT_EXCEEDED;
// Act
Exception exception = ExceptionUtil.amqpResponseCodeToException(resp... | void function() { AmqpResponseCode responseCode = AmqpResponseCode.FORBIDDEN; AmqpErrorCondition actualCondition = AmqpErrorCondition.RESOURCE_LIMIT_EXCEEDED; Exception exception = ExceptionUtil.amqpResponseCodeToException(responseCode.getValue(), message, context); Assertions.assertTrue(exception instanceof AmqpExcept... | /**
* Verifies AmqpException created from an integer.
*/ | Verifies AmqpException created from an integer | createsFromStatusCode | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/core/azure-core-amqp/src/test/java/com/azure/core/amqp/implementation/ExceptionUtilTest.java",
"license": "mit",
"size": 5003
} | [
"com.azure.core.amqp.exception.AmqpErrorCondition",
"com.azure.core.amqp.exception.AmqpException",
"com.azure.core.amqp.exception.AmqpResponseCode",
"org.junit.jupiter.api.Assertions"
] | import com.azure.core.amqp.exception.AmqpErrorCondition; import com.azure.core.amqp.exception.AmqpException; import com.azure.core.amqp.exception.AmqpResponseCode; import org.junit.jupiter.api.Assertions; | import com.azure.core.amqp.exception.*; import org.junit.jupiter.api.*; | [
"com.azure.core",
"org.junit.jupiter"
] | com.azure.core; org.junit.jupiter; | 265,343 |
@SuppressWarnings("unchecked")
@org.junit.Test
public void
testRequestNotSavedSignature() throws Exception {
final RequestData reqData = new RequestData();
java.util.Map<String, Object> msgContext = new java.util.TreeMap<String, Object>();
msgContext.put(WSHandlerConstants.ENABLE... | @SuppressWarnings(STR) @org.junit.Test void function() throws Exception { final RequestData reqData = new RequestData(); java.util.Map<String, Object> msgContext = new java.util.TreeMap<String, Object>(); msgContext.put(WSHandlerConstants.ENABLE_SIGNATURE_CONFIRMATION, "false"); msgContext.put(WSHandlerConstants.SIG_PR... | /**
* Test to see that a signature is not saved on the outbound request if
* enable signature confirmation is false.
*/ | Test to see that a signature is not saved on the outbound request if enable signature confirmation is false | testRequestNotSavedSignature | {
"repo_name": "asoldano/wss4j",
"path": "ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureConfirmationTest.java",
"license": "apache-2.0",
"size": 12961
} | [
"java.util.Collections",
"java.util.Set",
"org.apache.wss4j.common.util.XMLUtils",
"org.apache.wss4j.dom.WSConstants",
"org.apache.wss4j.dom.common.CustomHandler",
"org.apache.wss4j.dom.common.SOAPUtil",
"org.w3c.dom.Document"
] | import java.util.Collections; import java.util.Set; import org.apache.wss4j.common.util.XMLUtils; import org.apache.wss4j.dom.WSConstants; import org.apache.wss4j.dom.common.CustomHandler; import org.apache.wss4j.dom.common.SOAPUtil; import org.w3c.dom.Document; | import java.util.*; import org.apache.wss4j.common.util.*; import org.apache.wss4j.dom.*; import org.apache.wss4j.dom.common.*; import org.w3c.dom.*; | [
"java.util",
"org.apache.wss4j",
"org.w3c.dom"
] | java.util; org.apache.wss4j; org.w3c.dom; | 1,981,906 |
private RemoteParam getRenameDestinations(
final List<RemoteLocation> srcLocations, final String dst)
throws IOException {
final List<RemoteLocation> dstLocations = getLocationsForPath(dst, true);
final Map<RemoteLocation, String> dstMap = new HashMap<>();
Iterator<RemoteLocation> iterat... | RemoteParam function( final List<RemoteLocation> srcLocations, final String dst) throws IOException { final List<RemoteLocation> dstLocations = getLocationsForPath(dst, true); final Map<RemoteLocation, String> dstMap = new HashMap<>(); Iterator<RemoteLocation> iterator = srcLocations.iterator(); while (iterator.hasNext... | /**
* Determines combinations of eligible src/dst locations for a rename. A
* rename cannot change the namespace. Renames are only allowed if there is an
* eligible dst location in the same namespace as the source.
*
* @param srcLocations List of all potential source destinations where the
* ... | Determines combinations of eligible src/dst locations for a rename. A rename cannot change the namespace. Renames are only allowed if there is an eligible dst location in the same namespace as the source | getRenameDestinations | {
"repo_name": "dennishuo/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java",
"license": "apache-2.0",
"size": 89622
} | [
"java.io.IOException",
"java.util.HashMap",
"java.util.Iterator",
"java.util.List",
"java.util.Map",
"org.apache.hadoop.hdfs.server.federation.resolver.RemoteLocation"
] | import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.hadoop.hdfs.server.federation.resolver.RemoteLocation; | import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.server.federation.resolver.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 2,596,876 |
@Override
@Generated(value = "com.sun.tools.xjc.Driver", date = "2014-09-19T03:09:21-06:00", comment = "JAXB RI v2.2.6")
public String toString() {
return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE);
} | @Generated(value = STR, date = STR, comment = STR) String function() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE); } | /**
* Generates a String representation of the contents of this type.
* This is an extension method, produced by the 'ts' xjc plugin
*
*/ | Generates a String representation of the contents of this type. This is an extension method, produced by the 'ts' xjc plugin | toString | {
"repo_name": "angecab10/travelport-uapi-tutorial",
"path": "src/com/travelport/schema/common_v28_0/BookingTravelerRef.java",
"license": "gpl-3.0",
"size": 7142
} | [
"javax.annotation.Generated",
"org.apache.commons.lang.builder.ToStringBuilder",
"org.apache.cxf.xjc.runtime.JAXBToStringStyle"
] | import javax.annotation.Generated; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.cxf.xjc.runtime.JAXBToStringStyle; | import javax.annotation.*; import org.apache.commons.lang.builder.*; import org.apache.cxf.xjc.runtime.*; | [
"javax.annotation",
"org.apache.commons",
"org.apache.cxf"
] | javax.annotation; org.apache.commons; org.apache.cxf; | 2,394,401 |
public static ResourceDescriptor newResourceDescriptor(String type) {
ResourceDescriptor resourceDescriptor = new ResourceDescriptor();
Map<String, String> properties = new HashMap<String, String>();
List<CapabilityDescriptor> capabilityDescriptors = new ArrayList<CapabilityDescriptor>();
capabilityDescrip... | static ResourceDescriptor function(String type) { ResourceDescriptor resourceDescriptor = new ResourceDescriptor(); Map<String, String> properties = new HashMap<String, String>(); List<CapabilityDescriptor> capabilityDescriptors = new ArrayList<CapabilityDescriptor>(); capabilityDescriptors.add(newChassisCapabilityDesc... | /**
* It creates a new resource descriptor
*
* @param type
* resource descriptor type
* @return
*/ | It creates a new resource descriptor | newResourceDescriptor | {
"repo_name": "dana-i2cat/opennaas-routing-nfv",
"path": "core/resources/src/main/java/org/opennaas/core/resources/helpers/ResourceHelper.java",
"license": "lgpl-3.0",
"size": 10707
} | [
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"org.opennaas.core.resources.descriptor.CapabilityDescriptor",
"org.opennaas.core.resources.descriptor.Information",
"org.opennaas.core.resources.descriptor.ResourceDescriptor",
"org.opennaas.core.resources.descriptor.Resou... | import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.opennaas.core.resources.descriptor.CapabilityDescriptor; import org.opennaas.core.resources.descriptor.Information; import org.opennaas.core.resources.descriptor.ResourceDescriptor; import org.opennaas.core.res... | import java.util.*; import org.opennaas.core.resources.descriptor.*; | [
"java.util",
"org.opennaas.core"
] | java.util; org.opennaas.core; | 1,328,959 |
private String[] getRecordTypes(Action action)
{
String recordTypes = (String) action.getParameterValue(PARAM_ADD_RECORD_TYPES);
return recordTypes.split(DELIMITER);
}
| String[] function(Action action) { String recordTypes = (String) action.getParameterValue(PARAM_ADD_RECORD_TYPES); return recordTypes.split(DELIMITER); } | /**
* Helper method to get the record types from the action
*
* @param action The action
* @return An array of record types
*/ | Helper method to get the record types from the action | getRecordTypes | {
"repo_name": "dnacreative/records-management",
"path": "rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/action/impl/AddRecordTypeAction.java",
"license": "lgpl-3.0",
"size": 4581
} | [
"org.alfresco.service.cmr.action.Action"
] | import org.alfresco.service.cmr.action.Action; | import org.alfresco.service.cmr.action.*; | [
"org.alfresco.service"
] | org.alfresco.service; | 250,366 |
public List<String> getParameterTypes(); | List<String> function(); | /**
* Get the list of parameters type for this annotation
* @return list of parameters types
*/ | Get the list of parameters type for this annotation | getParameterTypes | {
"repo_name": "ironjacamar/ironjacamar",
"path": "common/spi/src/main/java/org/jboss/jca/common/spi/annotations/repository/Annotation.java",
"license": "lgpl-2.1",
"size": 2071
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,606,604 |
private void insertModelessPopups(HTMLSerialiser pSerialiser, SerialisationContext pSerialisationContext) {
List<ModelessPopup> lPopups = pSerialisationContext.getModelessPopups();
for(ModelessPopup lPopup : lPopups) {
pSerialiser.append(HTMLSerialiser.buildFOXjsOpenWinJSON(lPopup.getEntryURI(pSerialis... | void function(HTMLSerialiser pSerialiser, SerialisationContext pSerialisationContext) { List<ModelessPopup> lPopups = pSerialisationContext.getModelessPopups(); for(ModelessPopup lPopup : lPopups) { pSerialiser.append(HTMLSerialiser.buildFOXjsOpenWinJSON(lPopup.getEntryURI(pSerialisationContext.createURIBuilder()), lPo... | /**
* Get modeless popup window requests from the EvaluatedParseTree and serialise them for FOXjs to open
*
* @param pSerialiser
* @param pSerialisationContext
*/ | Get modeless popup window requests from the EvaluatedParseTree and serialise them for FOXjs to open | insertModelessPopups | {
"repo_name": "Fivium/FOXopen",
"path": "src/main/java/net/foxopen/fox/module/serialiser/components/html/HTMLComponentBuilder.java",
"license": "gpl-3.0",
"size": 17895
} | [
"java.util.List",
"net.foxopen.fox.module.serialiser.SerialisationContext",
"net.foxopen.fox.module.serialiser.html.HTMLSerialiser",
"net.foxopen.fox.thread.stack.transform.ModelessCall"
] | import java.util.List; import net.foxopen.fox.module.serialiser.SerialisationContext; import net.foxopen.fox.module.serialiser.html.HTMLSerialiser; import net.foxopen.fox.thread.stack.transform.ModelessCall; | import java.util.*; import net.foxopen.fox.module.serialiser.*; import net.foxopen.fox.module.serialiser.html.*; import net.foxopen.fox.thread.stack.transform.*; | [
"java.util",
"net.foxopen.fox"
] | java.util; net.foxopen.fox; | 475,968 |
public NodeFilter getChildFilter ()
{
return (mChildFilter);
} | NodeFilter function () { return (mChildFilter); } | /**
* Get the filter used by this HasParentFilter.
* @return The filter to apply to parents.
*/ | Get the filter used by this HasParentFilter | getChildFilter | {
"repo_name": "asmh1989/mReader",
"path": "HtmlParese/src/org/htmlparser/filters/HasChildFilter.java",
"license": "gpl-2.0",
"size": 5117
} | [
"org.htmlparser.NodeFilter"
] | import org.htmlparser.NodeFilter; | import org.htmlparser.*; | [
"org.htmlparser"
] | org.htmlparser; | 1,875,821 |
private static boolean isGrayProfile(ProfileHeader header, Hashtable tags)
{
if (header.getColorSpace() != ColorSpace.TYPE_GRAY)
return false;
if (tags.get(TagEntry.tagHashKey(icSigGrayTRCTag)) == null)
return false;
return (tags.get(TagEntry.tagHashKey(icSigMediaWhitePointTag)) != null);
... | static boolean function(ProfileHeader header, Hashtable tags) { if (header.getColorSpace() != ColorSpace.TYPE_GRAY) return false; if (tags.get(TagEntry.tagHashKey(icSigGrayTRCTag)) == null) return false; return (tags.get(TagEntry.tagHashKey(icSigMediaWhitePointTag)) != null); } | /**
* Returns if the criteria for an ICC_ProfileGray are met.
* This means:
* Colorspace is TYPE_GRAY
* grayTRCTag included
* mediaWhitePointTag included
*/ | Returns if the criteria for an ICC_ProfileGray are met. This means: Colorspace is TYPE_GRAY grayTRCTag included mediaWhitePointTag included | isGrayProfile | {
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/java/awt/color/ICC_Profile.java",
"license": "gpl-2.0",
"size": 40997
} | [
"gnu.java.awt.color.ProfileHeader",
"gnu.java.awt.color.TagEntry",
"java.util.Hashtable"
] | import gnu.java.awt.color.ProfileHeader; import gnu.java.awt.color.TagEntry; import java.util.Hashtable; | import gnu.java.awt.color.*; import java.util.*; | [
"gnu.java.awt",
"java.util"
] | gnu.java.awt; java.util; | 628,187 |
public static <T> T getRandomElement(final Multiset<T> set) {
final int randPos = RandomUtils.nextInt(checkNotNull(set).size());
T selected = null;
int i = 0;
for (final Multiset.Entry<T> entry : set.entrySet()) {
i += entry.getCount();
if (i > randPos) {
selected = entry.getElement();
break;
... | static <T> T function(final Multiset<T> set) { final int randPos = RandomUtils.nextInt(checkNotNull(set).size()); T selected = null; int i = 0; for (final Multiset.Entry<T> entry : set.entrySet()) { i += entry.getCount(); if (i > randPos) { selected = entry.getElement(); break; } } return selected; } | /**
* Get a uniformly random element from a Multiset.
*
* @param set
* @return
*/ | Get a uniformly random element from a Multiset | getRandomElement | {
"repo_name": "mast-group/codemining-utils",
"path": "src/main/java/codemining/math/random/SampleUtils.java",
"license": "bsd-3-clause",
"size": 6036
} | [
"com.google.common.collect.Multiset",
"java.util.Map",
"org.apache.commons.lang.math.RandomUtils"
] | import com.google.common.collect.Multiset; import java.util.Map; import org.apache.commons.lang.math.RandomUtils; | import com.google.common.collect.*; import java.util.*; import org.apache.commons.lang.math.*; | [
"com.google.common",
"java.util",
"org.apache.commons"
] | com.google.common; java.util; org.apache.commons; | 1,057,735 |
public void testRemotableRequestsAllowRemoteIndices() {
IndicesOptions options = IndicesOptions.fromOptions(true, false, false, false);
Tuple<TransportRequest, String> tuple = randomFrom(
new Tuple<TransportRequest, String>(new SearchRequest("remote:foo").indicesOptions(options), SearchA... | void function() { IndicesOptions options = IndicesOptions.fromOptions(true, false, false, false); Tuple<TransportRequest, String> tuple = randomFrom( new Tuple<TransportRequest, String>(new SearchRequest(STR).indicesOptions(options), SearchAction.NAME), new Tuple<TransportRequest, String>( new FieldCapabilitiesRequest(... | /**
* Tests that all the request types that are known to support remote indices successfully pass them through
* the resolver
*/ | Tests that all the request types that are known to support remote indices successfully pass them through the resolver | testRemotableRequestsAllowRemoteIndices | {
"repo_name": "GlenRSmith/elasticsearch",
"path": "x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolverTests.java",
"license": "apache-2.0",
"size": 130200
} | [
"org.elasticsearch.action.IndicesRequest",
"org.elasticsearch.action.fieldcaps.FieldCapabilitiesAction",
"org.elasticsearch.action.fieldcaps.FieldCapabilitiesRequest",
"org.elasticsearch.action.search.SearchAction",
"org.elasticsearch.action.search.SearchRequest",
"org.elasticsearch.action.support.Indices... | import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.fieldcaps.FieldCapabilitiesAction; import org.elasticsearch.action.fieldcaps.FieldCapabilitiesRequest; import org.elasticsearch.action.search.SearchAction; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.actio... | import org.elasticsearch.action.*; import org.elasticsearch.action.fieldcaps.*; import org.elasticsearch.action.search.*; import org.elasticsearch.action.support.*; import org.elasticsearch.core.*; import org.elasticsearch.protocol.xpack.graph.*; import org.elasticsearch.transport.*; import org.elasticsearch.xpack.core... | [
"org.elasticsearch.action",
"org.elasticsearch.core",
"org.elasticsearch.protocol",
"org.elasticsearch.transport",
"org.elasticsearch.xpack",
"org.hamcrest"
] | org.elasticsearch.action; org.elasticsearch.core; org.elasticsearch.protocol; org.elasticsearch.transport; org.elasticsearch.xpack; org.hamcrest; | 34,444 |
public void setHighlightLineWidth(float width) {
mHighlightLineWidth = Utils.convertDpToPixel(width);
} | void function(float width) { mHighlightLineWidth = Utils.convertDpToPixel(width); } | /**
* Sets the width of the highlight line in dp.
* @param width
*/ | Sets the width of the highlight line in dp | setHighlightLineWidth | {
"repo_name": "wpy2016/TimeContrloller",
"path": "app/src/main/java/com/jn/chart/data/LineScatterCandleRadarDataSet.java",
"license": "gpl-2.0",
"size": 3431
} | [
"com.jn.chart.utils.Utils"
] | import com.jn.chart.utils.Utils; | import com.jn.chart.utils.*; | [
"com.jn.chart"
] | com.jn.chart; | 1,447,001 |
NumberDataValue getDataValue(Float value, NumberDataValue previous)
throws StandardException; | NumberDataValue getDataValue(Float value, NumberDataValue previous) throws StandardException; | /**
* Get a SQL real with the given value. A null argument means get
* a SQL null value. The second arg uses the previous value (if non-null)
* to hold the return value.
*
*/ | Get a SQL real with the given value. A null argument means get a SQL null value. The second arg uses the previous value (if non-null) to hold the return value | getDataValue | {
"repo_name": "trejkaz/derby",
"path": "java/engine/org/apache/derby/iapi/types/DataValueFactory.java",
"license": "apache-2.0",
"size": 33006
} | [
"org.apache.derby.iapi.error.StandardException"
] | import org.apache.derby.iapi.error.StandardException; | import org.apache.derby.iapi.error.*; | [
"org.apache.derby"
] | org.apache.derby; | 884,585 |
@Test
public void testEntityListings() {
// CREATE
final EntityType type = new EntityType();
type.setName(DATA_TYPE_NAME);
type.setDescription(DATA_TYPE_DESC);
final Entity entity = new Entity(type, DATA_ENTITY_NAME);
DAO.save(type);
DAO.save(entity);
final Collection<Entity> entities1 = DAO.ENT... | void function() { final EntityType type = new EntityType(); type.setName(DATA_TYPE_NAME); type.setDescription(DATA_TYPE_DESC); final Entity entity = new Entity(type, DATA_ENTITY_NAME); DAO.save(type); DAO.save(entity); final Collection<Entity> entities1 = DAO.ENTITY.listWithType( type.getId(), 0, 100); Assert.assertTru... | /**
* Testing entity listing methods.
*/ | Testing entity listing methods | testEntityListings | {
"repo_name": "openpreserve/scout",
"path": "model/src/test/java/eu/scape_project/watch/model/KBTest.java",
"license": "apache-2.0",
"size": 46603
} | [
"eu.scape_project.watch.dao.DAO",
"eu.scape_project.watch.domain.Entity",
"eu.scape_project.watch.domain.EntityType",
"java.util.Collection",
"junit.framework.Assert"
] | import eu.scape_project.watch.dao.DAO; import eu.scape_project.watch.domain.Entity; import eu.scape_project.watch.domain.EntityType; import java.util.Collection; import junit.framework.Assert; | import eu.scape_project.watch.dao.*; import eu.scape_project.watch.domain.*; import java.util.*; import junit.framework.*; | [
"eu.scape_project.watch",
"java.util",
"junit.framework"
] | eu.scape_project.watch; java.util; junit.framework; | 2,894,134 |
@Deprecated
void copyResource(String resourcePath, String destinationPath, String newName) throws XMLDBException; | void copyResource(String resourcePath, String destinationPath, String newName) throws XMLDBException; | /**
* Copy a Resource.
*
* @param resourcePath the source resource.
* @param destinationPath the destination collection.
* @param newName the new name in the destination collection.
*
* @deprecated Use XmldbURI version instead.
*
* @throws XMLDBException if an error occurs w... | Copy a Resource | copyResource | {
"repo_name": "lcahlander/exist",
"path": "exist-core/src/main/java/org/exist/xmldb/EXistCollectionManagementService.java",
"license": "lgpl-2.1",
"size": 7765
} | [
"org.xmldb.api.base.XMLDBException"
] | import org.xmldb.api.base.XMLDBException; | import org.xmldb.api.base.*; | [
"org.xmldb.api"
] | org.xmldb.api; | 495,320 |
private void writeFile(Path outfile, List<String> lines)
throws IOException {
FSDataOutputStream dataOut = fileSystem.create(outfile);
Text newline = new Text("\n");
Text textLine = new Text();
for (String line : lines) {
textLine.set(line);
dataOut.write(textLine.getBytes(), 0, text... | void function(Path outfile, List<String> lines) throws IOException { FSDataOutputStream dataOut = fileSystem.create(outfile); Text newline = new Text("\n"); Text textLine = new Text(); for (String line : lines) { textLine.set(line); dataOut.write(textLine.getBytes(), 0, textLine.getLength()); dataOut.write(newline.getB... | /**
* Creates file {@code outfile} adding a newline between each element of {@code lines}.
*/ | Creates file outfile adding a newline between each element of lines | writeFile | {
"repo_name": "ravwojdyla/bigdata-interop",
"path": "bigquery/src/test/java/com/google/cloud/hadoop/io/bigquery/DynamicFileListRecordReaderTest.java",
"license": "apache-2.0",
"size": 14750
} | [
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.fs.FSDataOutputStream",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.io.Text"
] | import java.io.IOException; import java.util.List; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.Text; | import java.io.*; import java.util.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.io.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 2,834,274 |
protected static String readOutput(URL url) throws IOException {
StringBuilder out = new StringBuilder();
InputStream in = url.openConnection().getInputStream();
byte[] buffer = new byte[64 * 1024];
int len = in.read(buffer);
while (len > 0) {
out.append(new String(buffer, 0, len));
le... | static String function(URL url) throws IOException { StringBuilder out = new StringBuilder(); InputStream in = url.openConnection().getInputStream(); byte[] buffer = new byte[64 * 1024]; int len = in.read(buffer); while (len > 0) { out.append(new String(buffer, 0, len)); len = in.read(buffer); } return out.toString(); ... | /**
* Read in the content from a URL
* @param url URL To read
* @return the text from the output
* @throws IOException if something went wrong
*/ | Read in the content from a URL | readOutput | {
"repo_name": "linpawslitap/mds_scaling",
"path": "hadoop/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/HttpServerFunctionalTest.java",
"license": "bsd-3-clause",
"size": 6707
} | [
"java.io.IOException",
"java.io.InputStream"
] | import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,368,510 |
public void ValidatePasswordCreation() throws IOException{
loginService.validatePasswordCreationDate(MatContext.get().getLoggedinLoginId(), new AsyncCallback<HashMap<String,String>>(){ | void function() throws IOException{ loginService.validatePasswordCreationDate(MatContext.get().getLoggedinLoginId(), new AsyncCallback<HashMap<String,String>>(){ | /** for validating Password Creation with current date and restricting
* user to change password on the same day of new password creation.
* Validate password creation Dates.
*
* @throws IOException Signals that an I/O exception has occurred.
*/ | for validating Password Creation with current date and restricting user to change password on the same day of new password creation. Validate password creation Dates | ValidatePasswordCreation | {
"repo_name": "JaLandry/MeasureAuthoringTool_LatestSprint",
"path": "mat/src/mat/client/myAccount/ChangePasswordPresenter.java",
"license": "apache-2.0",
"size": 10343
} | [
"com.google.gwt.user.client.rpc.AsyncCallback",
"java.io.IOException",
"java.util.HashMap"
] | import com.google.gwt.user.client.rpc.AsyncCallback; import java.io.IOException; import java.util.HashMap; | import com.google.gwt.user.client.rpc.*; import java.io.*; import java.util.*; | [
"com.google.gwt",
"java.io",
"java.util"
] | com.google.gwt; java.io; java.util; | 1,148,707 |
public static <T> Function<byte[], T> fromByteFunction(final Coder<T> coder) {
return bytes -> fromByteArray(bytes, coder);
} | static <T> Function<byte[], T> function(final Coder<T> coder) { return bytes -> fromByteArray(bytes, coder); } | /**
* A function wrapper for converting a byte array to an object.
*
* @param coder Coder to deserialize with.
* @param <T> The type of the object being deserialized.
* @return A function that accepts a byte array and returns its corresponding object.
*/ | A function wrapper for converting a byte array to an object | fromByteFunction | {
"repo_name": "tgroh/incubator-beam",
"path": "runners/spark/src/main/java/org/apache/beam/runners/spark/coders/CoderHelpers.java",
"license": "apache-2.0",
"size": 6953
} | [
"org.apache.beam.sdk.coders.Coder",
"org.apache.spark.api.java.function.Function"
] | import org.apache.beam.sdk.coders.Coder; import org.apache.spark.api.java.function.Function; | import org.apache.beam.sdk.coders.*; import org.apache.spark.api.java.function.*; | [
"org.apache.beam",
"org.apache.spark"
] | org.apache.beam; org.apache.spark; | 1,600,591 |
public static ExtensionDescription getDefaultDescription(boolean required,
boolean repeatable) {
ExtensionDescription desc =
ExtensionDescription.getDefaultDescription(ImportFormat.class);
desc.setRequired(required);
desc.setRepeatable(repeatable);
return desc;
} | static ExtensionDescription function(boolean required, boolean repeatable) { ExtensionDescription desc = ExtensionDescription.getDefaultDescription(ImportFormat.class); desc.setRequired(required); desc.setRepeatable(repeatable); return desc; } | /**
* Returns the extension description, specifying whether it is required, and
* whether it is repeatable.
*
* @param required whether it is required
* @param repeatable whether it is repeatable
* @return extension description
*/ | Returns the extension description, specifying whether it is required, and whether it is repeatable | getDefaultDescription | {
"repo_name": "simonrrr/gdata-java-client",
"path": "java/src/com/google/gdata/data/docs/ImportFormat.java",
"license": "apache-2.0",
"size": 5376
} | [
"com.google.gdata.data.ExtensionDescription"
] | import com.google.gdata.data.ExtensionDescription; | import com.google.gdata.data.*; | [
"com.google.gdata"
] | com.google.gdata; | 1,310,389 |
public List<Region> list(final Game game) {
final Session session = getSessionFactory().getCurrentSession();
final Criteria criteria = session.createCriteria(Region.class);
criteria.add(Restrictions.eq("game", game));
return criteria.addOrder(Order.asc("id")).list();
} | List<Region> function(final Game game) { final Session session = getSessionFactory().getCurrentSession(); final Criteria criteria = session.createCriteria(Region.class); criteria.add(Restrictions.eq("game", game)); return criteria.addOrder(Order.asc("id")).list(); } | /**
* Listing all the Regions from the database for a game.
*
* @return a list of all the Regions that exist inside the table Avatar.
*/ | Listing all the Regions from the database for a game | list | {
"repo_name": "EaW1805/data",
"path": "src/main/java/com/eaw1805/data/managers/map/RegionManager.java",
"license": "mit",
"size": 5412
} | [
"com.eaw1805.data.model.Game",
"com.eaw1805.data.model.map.Region",
"java.util.List",
"org.hibernate.Criteria",
"org.hibernate.Session",
"org.hibernate.criterion.Order",
"org.hibernate.criterion.Restrictions"
] | import com.eaw1805.data.model.Game; import com.eaw1805.data.model.map.Region; import java.util.List; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.criterion.Order; import org.hibernate.criterion.Restrictions; | import com.eaw1805.data.model.*; import com.eaw1805.data.model.map.*; import java.util.*; import org.hibernate.*; import org.hibernate.criterion.*; | [
"com.eaw1805.data",
"java.util",
"org.hibernate",
"org.hibernate.criterion"
] | com.eaw1805.data; java.util; org.hibernate; org.hibernate.criterion; | 1,371,461 |
@Test(groups = "ticket:5755")
public void testResetMinMaxForSetForScreen() throws Exception {
Screen screen = (Screen) iUpdate.saveAndReturnObject(mmFactory
.simpleScreenData().asIObject());
Plate plate = createBinaryPlate(1, 1, 1, 0);
plate = (Plate) iUpdate.saveAndRetur... | @Test(groups = STR) void function() throws Exception { Screen screen = (Screen) iUpdate.saveAndReturnObject(mmFactory .simpleScreenData().asIObject()); Plate plate = createBinaryPlate(1, 1, 1, 0); plate = (Plate) iUpdate.saveAndReturnObject(plate); ScreenPlateLink link = new ScreenPlateLinkI(); link.setChild(plate); li... | /**
* Tests to apply reset the min/max values for a screen.s Tests the
* <code>ResetMinMaxForSet</code> method.
*
* @throws Exception
* Thrown if an error occurred.
*/ | Tests to apply reset the min/max values for a screen.s Tests the <code>ResetMinMaxForSet</code> method | testResetMinMaxForSetForScreen | {
"repo_name": "dpwrussell/openmicroscopy",
"path": "components/tools/OmeroJava/test/integration/RenderingSettingsServiceTest.java",
"license": "gpl-2.0",
"size": 67096
} | [
"java.awt.Point",
"java.util.ArrayList",
"java.util.Arrays",
"java.util.List",
"org.testng.Assert",
"org.testng.annotations.Test"
] | import java.awt.Point; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.testng.Assert; import org.testng.annotations.Test; | import java.awt.*; import java.util.*; import org.testng.*; import org.testng.annotations.*; | [
"java.awt",
"java.util",
"org.testng",
"org.testng.annotations"
] | java.awt; java.util; org.testng; org.testng.annotations; | 2,878,694 |
public HTableDescriptor[] listTables() throws IOException {
return this.connection.listTables();
} | HTableDescriptor[] function() throws IOException { return this.connection.listTables(); } | /**
* List all the userspace tables. In other words, scan the META table.
*
* If we wanted this to be really fast, we could implement a special
* catalog table that just contains table names and their descriptors.
* Right now, it only exists as part of the META table's region info.
*
* @return - r... | List all the userspace tables. In other words, scan the META table. If we wanted this to be really fast, we could implement a special catalog table that just contains table names and their descriptors. Right now, it only exists as part of the META table's region info | listTables | {
"repo_name": "zqxjjj/NobidaBase",
"path": "target/hbase-0.94.9/hbase-0.94.9/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java",
"license": "apache-2.0",
"size": 89778
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.HTableDescriptor"
] | import java.io.IOException; import org.apache.hadoop.hbase.HTableDescriptor; | import java.io.*; import org.apache.hadoop.hbase.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,007,198 |
@Test
public void testCase2_1() throws Exception
{
WebSocketFrame send = new PingFrame();
WebSocketFrame expect = new PongFrame();
try (Fuzzer fuzzer = new Fuzzer(this))
{
fuzzer.connect();
fuzzer.setSendMode(Fuzzer.SendMode.BULK);
fuzzer... | void function() throws Exception { WebSocketFrame send = new PingFrame(); WebSocketFrame expect = new PongFrame(); try (Fuzzer fuzzer = new Fuzzer(this)) { fuzzer.connect(); fuzzer.setSendMode(Fuzzer.SendMode.BULK); fuzzer.send(send); fuzzer.expect(expect); } } | /**
* Ping without payload
*/ | Ping without payload | testCase2_1 | {
"repo_name": "sdw2330976/Research-jetty-9.2.5",
"path": "jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/ab/TestABCase2.java",
"license": "apache-2.0",
"size": 10575
} | [
"org.eclipse.jetty.websocket.common.WebSocketFrame",
"org.eclipse.jetty.websocket.common.frames.PingFrame",
"org.eclipse.jetty.websocket.common.frames.PongFrame",
"org.eclipse.jetty.websocket.common.test.Fuzzer"
] | import org.eclipse.jetty.websocket.common.WebSocketFrame; import org.eclipse.jetty.websocket.common.frames.PingFrame; import org.eclipse.jetty.websocket.common.frames.PongFrame; import org.eclipse.jetty.websocket.common.test.Fuzzer; | import org.eclipse.jetty.websocket.common.*; import org.eclipse.jetty.websocket.common.frames.*; import org.eclipse.jetty.websocket.common.test.*; | [
"org.eclipse.jetty"
] | org.eclipse.jetty; | 419,130 |
protected void addAttributes(HierarchicalStreamWriter writer, UniqueObject source) {
writer.addAttribute("id", source.getIdLink());
} | void function(HierarchicalStreamWriter writer, UniqueObject source) { writer.addAttribute("id", source.getIdLink()); } | /**
* Overwrite to add custom attributes. Always call super!
*/ | Overwrite to add custom attributes. Always call super | addAttributes | {
"repo_name": "Katharsas/GMM",
"path": "src/main/java/gmm/service/data/xstream/IdReferenceConverter.java",
"license": "gpl-3.0",
"size": 1221
} | [
"com.thoughtworks.xstream.io.HierarchicalStreamWriter"
] | import com.thoughtworks.xstream.io.HierarchicalStreamWriter; | import com.thoughtworks.xstream.io.*; | [
"com.thoughtworks.xstream"
] | com.thoughtworks.xstream; | 1,292,701 |
@POST
@Consumes(MediaType.APPLICATION_JSON)
public Response createClientTemplate(final @Context UriInfo uriInfo, final ClientTemplateRepresentation rep) {
auth.requireManage();
try {
ClientTemplateModel clientModel = RepresentationToModel.createClientTemplate(session, realm, rep... | @Consumes(MediaType.APPLICATION_JSON) Response function(final @Context UriInfo uriInfo, final ClientTemplateRepresentation rep) { auth.requireManage(); try { ClientTemplateModel clientModel = RepresentationToModel.createClientTemplate(session, realm, rep); adminEvent.operation(OperationType.CREATE).resourcePath(uriInfo... | /**
* Create a new client template
*
* Client Template's name must be unique!
*
* @param uriInfo
* @param rep
* @return
*/ | Create a new client template Client Template's name must be unique | createClientTemplate | {
"repo_name": "manuel-palacio/keycloak",
"path": "services/src/main/java/org/keycloak/services/resources/admin/ClientTemplatesResource.java",
"license": "apache-2.0",
"size": 4998
} | [
"javax.ws.rs.Consumes",
"javax.ws.rs.core.Context",
"javax.ws.rs.core.MediaType",
"javax.ws.rs.core.Response",
"javax.ws.rs.core.UriInfo",
"org.keycloak.events.admin.OperationType",
"org.keycloak.models.ClientTemplateModel",
"org.keycloak.models.ModelDuplicateException",
"org.keycloak.models.utils.R... | import javax.ws.rs.Consumes; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import org.keycloak.events.admin.OperationType; import org.keycloak.models.ClientTemplateModel; import org.keycloak.models.ModelDuplicateException; import o... | import javax.ws.rs.*; import javax.ws.rs.core.*; import org.keycloak.events.admin.*; import org.keycloak.models.*; import org.keycloak.models.utils.*; import org.keycloak.representations.idm.*; import org.keycloak.services.*; | [
"javax.ws",
"org.keycloak.events",
"org.keycloak.models",
"org.keycloak.representations",
"org.keycloak.services"
] | javax.ws; org.keycloak.events; org.keycloak.models; org.keycloak.representations; org.keycloak.services; | 1,989,293 |
private Map<Integer, Collection<KeyCacheObject>> checkNeedRebalanceKeys(
IgniteTxEntry e,
Map<Integer, Collection<KeyCacheObject>> map
) {
if (retVal ||
!F.isEmpty(e.entryProcessors()) ||
!F.isEmpty(e.filters()) ||
e.entryReadVersion() != null) {
... | Map<Integer, Collection<KeyCacheObject>> function( IgniteTxEntry e, Map<Integer, Collection<KeyCacheObject>> map ) { if (retVal !F.isEmpty(e.entryProcessors()) !F.isEmpty(e.filters()) e.entryReadVersion() != null) { if (map == null) map = new HashMap<>(); Collection<KeyCacheObject> keys = map.get(e.cacheId()); if (keys... | /**
* Checks if this transaction needs previous value for the given tx entry. Will use passed in map to store
* required key or will create new map if passed in map is {@code null}.
*
* @param e TX entry.
* @param map Map with needed preload keys.
* @return Map if it was created.
*/ | Checks if this transaction needs previous value for the given tx entry. Will use passed in map to store required key or will create new map if passed in map is null | checkNeedRebalanceKeys | {
"repo_name": "ptupitsyn/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxPrepareFuture.java",
"license": "apache-2.0",
"size": 71257
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.HashMap",
"java.util.Map",
"org.apache.ignite.internal.processors.cache.KeyCacheObject",
"org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry",
"org.apache.ignite.internal.util.lang.GridFunc",
"org.apache.ignite.internal.util... | import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.apache.ignite.internal.processors.cache.KeyCacheObject; import org.apache.ignite.internal.processors.cache.transactions.IgniteTxEntry; import org.apache.ignite.internal.util.lang.GridFunc; import org.apac... | import java.util.*; import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.transactions.*; import org.apache.ignite.internal.util.lang.*; import org.apache.ignite.internal.util.typedef.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 233,196 |
double[] transform(UnivariateFunction f,
double min, double max, int n,
TransformType type); | double[] transform(UnivariateFunction f, double min, double max, int n, TransformType type); | /**
* Returns the (forward, inverse) transform of the specified real function,
* sampled on the specified interval.
*
* @param f the function to be sampled and transformed
* @param min the (inclusive) lower bound for the interval
* @param max the (exclusive) upper bound for the interval
... | Returns the (forward, inverse) transform of the specified real function, sampled on the specified interval | transform | {
"repo_name": "SpoonLabs/astor",
"path": "examples/math_32/src/main/java/org/apache/commons/math3/transform/RealTransformer.java",
"license": "gpl-2.0",
"size": 2731
} | [
"org.apache.commons.math3.analysis.UnivariateFunction"
] | import org.apache.commons.math3.analysis.UnivariateFunction; | import org.apache.commons.math3.analysis.*; | [
"org.apache.commons"
] | org.apache.commons; | 684,150 |
public IgniteInternalFuture<V> getForcePrimaryAsync(K key); | IgniteInternalFuture<V> function(K key); | /**
* Asynchronously gets value from cache. Will go to primary node even if this is a backup.
*
* @param key Key to get value for.
* @return Future with result.
*/ | Asynchronously gets value from cache. Will go to primary node even if this is a backup | getForcePrimaryAsync | {
"repo_name": "alexzaitzev/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java",
"license": "apache-2.0",
"size": 86832
} | [
"org.apache.ignite.internal.IgniteInternalFuture"
] | import org.apache.ignite.internal.IgniteInternalFuture; | import org.apache.ignite.internal.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,794,060 |
protected String readFile(String path) throws IOException {
FileInputStream stream = new FileInputStream(new File(path));
try {
FileChannel fc = stream.getChannel();
MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
// Instead of using default, pass i... | String function(String path) throws IOException { FileInputStream stream = new FileInputStream(new File(path)); try { FileChannel fc = stream.getChannel(); MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); return Charset.defaultCharset().decode(bb).toString(); } finally { stream.close(); } } | /**
* This should be in a Utils class
* @param path
* @return
* @throws IOException
*/ | This should be in a Utils class | readFile | {
"repo_name": "Ticlla/tastymonster",
"path": "src/main/java/com/tastymonster/automation/codegen/ParseVelocity.java",
"license": "mit",
"size": 9042
} | [
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.nio.MappedByteBuffer",
"java.nio.channels.FileChannel",
"java.nio.charset.Charset"
] | import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; import java.nio.charset.Charset; | import java.io.*; import java.nio.*; import java.nio.channels.*; import java.nio.charset.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 1,779,414 |
protected void callChannelAwayStateOther(final LocalDateTime time, final ChannelInfo channel,
final ChannelClientInfo channelClient, final AwayState oldState, final AwayState state) {
getCallbackManager().publish(
new ChannelOtherAwayStateEvent(parser, time, channel, channelClien... | void function(final LocalDateTime time, final ChannelInfo channel, final ChannelClientInfo channelClient, final AwayState oldState, final AwayState state) { getCallbackManager().publish( new ChannelOtherAwayStateEvent(parser, time, channel, channelClient, oldState, state)); } | /**
* Callback to all objects implementing the onChannelAwayStateOther Callback.
*
* @param channel Channel this is for
* @param channelClient ChannelClient this is for
* @param oldState Old Away State
* @param state Current Away State
*/ | Callback to all objects implementing the onChannelAwayStateOther Callback | callChannelAwayStateOther | {
"repo_name": "ShaneMcC/DMDirc-Parser",
"path": "irc/src/main/java/com/dmdirc/parser/irc/processors/ProcessWho.java",
"license": "mit",
"size": 6370
} | [
"com.dmdirc.parser.common.AwayState",
"com.dmdirc.parser.events.ChannelOtherAwayStateEvent",
"com.dmdirc.parser.interfaces.ChannelClientInfo",
"com.dmdirc.parser.interfaces.ChannelInfo",
"java.time.LocalDateTime"
] | import com.dmdirc.parser.common.AwayState; import com.dmdirc.parser.events.ChannelOtherAwayStateEvent; import com.dmdirc.parser.interfaces.ChannelClientInfo; import com.dmdirc.parser.interfaces.ChannelInfo; import java.time.LocalDateTime; | import com.dmdirc.parser.common.*; import com.dmdirc.parser.events.*; import com.dmdirc.parser.interfaces.*; import java.time.*; | [
"com.dmdirc.parser",
"java.time"
] | com.dmdirc.parser; java.time; | 672,260 |
ArrayList<SearchRequestResult> getLastPollResult(); | ArrayList<SearchRequestResult> getLastPollResult(); | /**
* get last polling result
*
* @return last polling result
*/ | get last polling result | getLastPollResult | {
"repo_name": "decoit/decomap",
"path": "src/main/java/de/simu/decomap/messaging/sender/MessageSender.java",
"license": "apache-2.0",
"size": 3390
} | [
"de.simu.decomap.messaging.SearchRequestResult",
"java.util.ArrayList"
] | import de.simu.decomap.messaging.SearchRequestResult; import java.util.ArrayList; | import de.simu.decomap.messaging.*; import java.util.*; | [
"de.simu.decomap",
"java.util"
] | de.simu.decomap; java.util; | 509,904 |
public void setScriptParameters( HashMap<String, String> params ) {
m_params = params;
} | void function( HashMap<String, String> params ) { m_params = params; } | /**
* Set the values of parameters to replace in the script
*
* @param params a HashMap mapping parameter names to values
*/ | Set the values of parameters to replace in the script | setScriptParameters | {
"repo_name": "bmorrise/big-data-plugin",
"path": "kettle-plugins/pig/src/main/java/org/pentaho/big/data/kettle/plugins/pig/JobEntryPigScriptExecutor.java",
"license": "apache-2.0",
"size": 20780
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 485,765 |
@Override
public Connection apply(final Connection connection)
{
return (Connection) Proxy.newProxyInstance(connection.getClass().getClassLoader(),
connection.getClass().getInterfaces(),
new C3P0Con... | Connection function(final Connection connection) { return (Connection) Proxy.newProxyInstance(connection.getClass().getClassLoader(), connection.getClass().getInterfaces(), new C3P0ConnectionInvocationHandler(connection)); } class C3P0ConnectionInvocationHandler extends AbstractProxyInvocationHandler { private C3P0Conn... | /**
* Returns a proxy for a C3P0 connection. Intercepts {@link java.sql.Connection#createArrayOf(String, Object[])}.
*/ | Returns a proxy for a C3P0 connection. Intercepts <code>java.sql.Connection#createArrayOf(String, Object[])</code> | apply | {
"repo_name": "NessComputing/components-ness-jdbc",
"path": "src/main/java/com/nesscomputing/jdbc/wrappers/AbstractC3P0ConnectionWrapper.java",
"license": "apache-2.0",
"size": 3715
} | [
"java.lang.reflect.Proxy",
"java.sql.Connection"
] | import java.lang.reflect.Proxy; import java.sql.Connection; | import java.lang.reflect.*; import java.sql.*; | [
"java.lang",
"java.sql"
] | java.lang; java.sql; | 1,579,145 |
public static void setLossyness(IteratorSetting is, boolean lossy) {
is.addOption(LOSSY, Boolean.toString(lossy));
} | static void function(IteratorSetting is, boolean lossy) { is.addOption(LOSSY, Boolean.toString(lossy)); } | /**
* A convenience method to set the "lossy" option on a TypedValueCombiner. If true, the combiner
* will ignore any values which fail to decode. Otherwise, the combiner will throw an error which
* will interrupt the action (and prevent potential data loss). False is the default behavior.
*
* @param is
... | A convenience method to set the "lossy" option on a TypedValueCombiner. If true, the combiner will ignore any values which fail to decode. Otherwise, the combiner will throw an error which will interrupt the action (and prevent potential data loss). False is the default behavior | setLossyness | {
"repo_name": "apache/accumulo",
"path": "core/src/main/java/org/apache/accumulo/core/iterators/TypedValueCombiner.java",
"license": "apache-2.0",
"size": 7755
} | [
"org.apache.accumulo.core.client.IteratorSetting"
] | import org.apache.accumulo.core.client.IteratorSetting; | import org.apache.accumulo.core.client.*; | [
"org.apache.accumulo"
] | org.apache.accumulo; | 2,197,709 |
final Transaction theTrans = HibernateUtil.getInstance().getSessionFactory(getParent().getGame().getScenarioId()).getCurrentSession().beginTransaction();
// Royalists are revolting. France loses 5 VPs
final Nation france = NationManager.getInstance().getByID(NATION_FRANCE);
// This event can o... | final Transaction theTrans = HibernateUtil.getInstance().getSessionFactory(getParent().getGame().getScenarioId()).getCurrentSession().beginTransaction(); final Nation france = NationManager.getInstance().getByID(NATION_FRANCE); final List<Report> lstReport = ReportManager.getInstance().listByOwnerKey(france, getParent(... | /**
* Processes the random event.
*/ | Processes the random event | realiseEvent | {
"repo_name": "EaW1805/engine",
"path": "src/main/java/com/eaw1805/events/random/RevoltRandomEvent.java",
"license": "mit",
"size": 2740
} | [
"com.eaw1805.data.HibernateUtil",
"com.eaw1805.data.managers.NationManager",
"com.eaw1805.data.managers.ReportManager",
"com.eaw1805.data.model.Nation",
"com.eaw1805.data.model.Report",
"java.util.List",
"org.hibernate.Transaction"
] | import com.eaw1805.data.HibernateUtil; import com.eaw1805.data.managers.NationManager; import com.eaw1805.data.managers.ReportManager; import com.eaw1805.data.model.Nation; import com.eaw1805.data.model.Report; import java.util.List; import org.hibernate.Transaction; | import com.eaw1805.data.*; import com.eaw1805.data.managers.*; import com.eaw1805.data.model.*; import java.util.*; import org.hibernate.*; | [
"com.eaw1805.data",
"java.util",
"org.hibernate"
] | com.eaw1805.data; java.util; org.hibernate; | 2,293,861 |
@Test
public void testEmptyBatchStreamingPrepared() throws SQLException {
try (Statement statement = conn.createStatement()) {
statement.executeUpdate("SET STREAMING ON");
}
int[] updates = pstmt.executeBatch();
assertEquals("Returned update counts array should have... | void function() throws SQLException { try (Statement statement = conn.createStatement()) { statement.executeUpdate(STR); } int[] updates = pstmt.executeBatch(); assertEquals(STR, 0, updates.length); try (Statement statement = conn.createStatement()) { statement.executeUpdate(STR); } assertEquals(STR, 0L, personsCount()... | /**
* Same as {@link #testEmptyBatchStreaming()} but for PreparedStatement.
*
* @throws SQLException on error.
*/ | Same as <code>#testEmptyBatchStreaming()</code> but for PreparedStatement | testEmptyBatchStreamingPrepared | {
"repo_name": "nizhikov/ignite",
"path": "modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinBatchSelfTest.java",
"license": "apache-2.0",
"size": 30629
} | [
"java.sql.SQLException",
"java.sql.Statement"
] | import java.sql.SQLException; import java.sql.Statement; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,380,282 |
super.setUp();
MockConnection.clear();
connection = CobblerXMLRPCHelper.getConnection(user.getLogin());
image = Image.create(connection, EXPECTED_NAME, EXPECTED_TYPE, EXPECTED_FILE);
assertNotNull(image);
} | super.setUp(); MockConnection.clear(); connection = CobblerXMLRPCHelper.getConnection(user.getLogin()); image = Image.create(connection, EXPECTED_NAME, EXPECTED_TYPE, EXPECTED_FILE); assertNotNull(image); } | /**
* Sets up a connection and image.
* @throws Exception in case anything goes wrong
*/ | Sets up a connection and image | setUp | {
"repo_name": "mcalmer/spacewalk",
"path": "java/code/src/org/cobbler/test/ImageTest.java",
"license": "gpl-2.0",
"size": 4039
} | [
"com.redhat.rhn.manager.kickstart.cobbler.CobblerXMLRPCHelper",
"org.cobbler.Image"
] | import com.redhat.rhn.manager.kickstart.cobbler.CobblerXMLRPCHelper; import org.cobbler.Image; | import com.redhat.rhn.manager.kickstart.cobbler.*; import org.cobbler.*; | [
"com.redhat.rhn",
"org.cobbler"
] | com.redhat.rhn; org.cobbler; | 140,101 |
@Override
public DescriptorFilter getDependency() {
return this.dependency;
} | DescriptorFilter function() { return this.dependency; } | /**
* Gets the dependency for this instance.
*
* @return The dependency.
*/ | Gets the dependency for this instance | getDependency | {
"repo_name": "TribeMedia/aura",
"path": "aura-impl/src/main/java/org/auraframework/impl/root/DependencyDefImpl.java",
"license": "apache-2.0",
"size": 5762
} | [
"org.auraframework.def.DescriptorFilter"
] | import org.auraframework.def.DescriptorFilter; | import org.auraframework.def.*; | [
"org.auraframework.def"
] | org.auraframework.def; | 985,120 |
final int subindex(Tree tree, int l)
{
MathVector xp = new MathVector();
double xsc = (pos.value(0) - tree.rmin.value(0)) / tree.rsize;
xp.value(0, Math.floor(IMAX * xsc));
xsc = (pos.value(1) - tree.rmin.value(1)) / tree.rsize;
xp.value(1, Math.floor(IMAX * xsc));
xsc = (pos.value(2) - t... | final int subindex(Tree tree, int l) { MathVector xp = new MathVector(); double xsc = (pos.value(0) - tree.rmin.value(0)) / tree.rsize; xp.value(0, Math.floor(IMAX * xsc)); xsc = (pos.value(1) - tree.rmin.value(1)) / tree.rsize; xp.value(1, Math.floor(IMAX * xsc)); xsc = (pos.value(2) - tree.rmin.value(2)) / tree.rsize... | /**
* Determine which subcell to select.
* Combination of intcoord and oldSubindex.
* @param t the root of the tree
**/ | Determine which subcell to select. Combination of intcoord and oldSubindex | subindex | {
"repo_name": "ivoanjo/phd-jaspexmls",
"path": "jaspex-mls/benchmarks/jolden/bh/Body.java",
"license": "gpl-3.0",
"size": 5937
} | [
"java.lang.Math"
] | import java.lang.Math; | import java.lang.*; | [
"java.lang"
] | java.lang; | 99,035 |
protected void generateCaveNode(long seed, int chunkX, int chunkZ, Block[] blocks, double i, double j, double k, float sizeMod, float headingXZ, float headingY, int currentSection, int length, double sizeModY)
{
double d4 = (double)(chunkX * 16 + 8);
double d5 = (double)(chunkZ * 16 + 8);
... | void function(long seed, int chunkX, int chunkZ, Block[] blocks, double i, double j, double k, float sizeMod, float headingXZ, float headingY, int currentSection, int length, double sizeModY) { double d4 = (double)(chunkX * 16 + 8); double d5 = (double)(chunkZ * 16 + 8); float f3 = 0.0F; float f4 = 0.0F; Random random ... | /**
* Generates a node in the current cave system recursion tree.
*/ | Generates a node in the current cave system recursion tree | generateCaveNode | {
"repo_name": "cbaakman/Tropicraft",
"path": "src/main/java/net/tropicraft/world/mapgen/MapGenTropicsCaves.java",
"license": "mpl-2.0",
"size": 12456
} | [
"java.util.Random",
"net.minecraft.block.Block",
"net.minecraft.util.MathHelper"
] | import java.util.Random; import net.minecraft.block.Block; import net.minecraft.util.MathHelper; | import java.util.*; import net.minecraft.block.*; import net.minecraft.util.*; | [
"java.util",
"net.minecraft.block",
"net.minecraft.util"
] | java.util; net.minecraft.block; net.minecraft.util; | 2,051,436 |
// ///////////////////////////////////////NOTIFICATION ACTION - copied from NotificationprefsAction.java////////
// TODO - clean up method call. These are basically copied from legacy legacy implementations.
public String processActionNotiSave()
{
log.debug("processActionNotiSave()");
// get an edit
setUse... | String function() { log.debug(STR); setUserEditingOn(); if (m_edit != null) { List<DecoratedNotificationPreference> items = getRegisteredNotificationItems(); for(UserNotificationPreferencesRegistration upr : userNotificationPreferencesRegistrationService.getRegisteredItems()) { readTypePrefs(upr.getType(), upr.getPrefi... | /**
* Process the save command from the edit view.
*
* @return navigation outcome to notification page
*/ | Process the save command from the edit view | processActionNotiSave | {
"repo_name": "OpenCollabZA/sakai",
"path": "user/user-tool-prefs/tool/src/java/org/sakaiproject/user/tool/UserPrefsTool.java",
"license": "apache-2.0",
"size": 69122
} | [
"java.util.List",
"org.sakaiproject.event.cover.NotificationService",
"org.sakaiproject.user.api.UserNotificationPreferencesRegistration"
] | import java.util.List; import org.sakaiproject.event.cover.NotificationService; import org.sakaiproject.user.api.UserNotificationPreferencesRegistration; | import java.util.*; import org.sakaiproject.event.cover.*; import org.sakaiproject.user.api.*; | [
"java.util",
"org.sakaiproject.event",
"org.sakaiproject.user"
] | java.util; org.sakaiproject.event; org.sakaiproject.user; | 828,204 |
public static Long assertCurrentUserId() {
Long userId = getCurrentUserId();
if (userId == null) {
throw new AccessDeniedException("No current user available!");
}
return userId;
}
| static Long function() { Long userId = getCurrentUserId(); if (userId == null) { throw new AccessDeniedException(STR); } return userId; } | /**
* Get the current user id. Throw an exception if there is no current user.
*
* @return The user id
*/ | Get the current user id. Throw an exception if there is no current user | assertCurrentUserId | {
"repo_name": "Communote/communote-server",
"path": "communote/persistence/src/main/java/com/communote/server/core/security/SecurityHelper.java",
"license": "apache-2.0",
"size": 10443
} | [
"org.springframework.security.access.AccessDeniedException"
] | import org.springframework.security.access.AccessDeniedException; | import org.springframework.security.access.*; | [
"org.springframework.security"
] | org.springframework.security; | 2,078,955 |
public void executeAfter(long delay, TimeUnit unit, Runnable runnable); | void function(long delay, TimeUnit unit, Runnable runnable); | /**
* <p>
* Schedule a runnable for execution on a given queue at a specified time.
* </p>
*
* @param delay
* the amount of time to delay before executing the runnable
* @param unit the unit of time that the delay value is specified in
* @param runnable
*/ | Schedule a runnable for execution on a given queue at a specified time. | executeAfter | {
"repo_name": "fusesource/hawtdispatch",
"path": "hawtdispatch/src/main/java/org/fusesource/hawtdispatch/DispatchQueue.java",
"license": "apache-2.0",
"size": 7863
} | [
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 454,904 |
@Override
public void realWriteBytes(byte buf[], int off, int cnt)
throws IOException {
if (closed) {
return;
}
if (coyoteResponse == null) {
return;
}
// If we really have something to write
if (cnt > 0) {
... | void function(byte buf[], int off, int cnt) throws IOException { if (closed) { return; } if (coyoteResponse == null) { return; } if (cnt > 0) { outputChunk.setBytes(buf, off, cnt); try { coyoteResponse.doWrite(outputChunk); } catch (IOException e) { throw new ClientAbortException(e); } } } | /**
* Sends the buffer data to the client output, checking the
* state of Response and calling the right interceptors.
*
* @param buf Byte buffer to be written to the response
* @param off Offset
* @param cnt Length
*
* @throws IOException An underlying IOException occurr... | Sends the buffer data to the client output, checking the state of Response and calling the right interceptors | realWriteBytes | {
"repo_name": "pistolove/sourcecode4junit",
"path": "Source4Tomcat/src/org/apache/catalina/connector/OutputBuffer.java",
"license": "apache-2.0",
"size": 14395
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 569,908 |
static void handleIcon(int event, int oldValue, int newValue, AccessibleContext context)
{
if(event == AccessibleContext.ACCESSIBLE_STATE_CHANGED)
{
if(Util.hasTransitionedToState( oldValue, newValue, AccessibleState.FOCUSED))
{
String ap... | static void handleIcon(int event, int oldValue, int newValue, AccessibleContext context) { if(event == AccessibleContext.ACCESSIBLE_STATE_CHANGED) { if(Util.hasTransitionedToState( oldValue, newValue, AccessibleState.FOCUSED)) { String appName = context.getAccessibleName(); Util.speak(appName + STR); } } } | /**
* Handles event generated by accessible component with role AccessibleRole.ICON
* @param event Accessible event that occured
* @param oldValue Depends on event type
* @param newValue Depends on event type
* @param context Field on which event occured
*/ | Handles event generated by accessible component with role AccessibleRole.ICON | handleIcon | {
"repo_name": "petegerhat/blackberrymessenger",
"path": "src/lib/accessibility/reader/ScreenReaderHandler.java",
"license": "apache-2.0",
"size": 40954
} | [
"net.rim.device.api.ui.accessibility.AccessibleContext",
"net.rim.device.api.ui.accessibility.AccessibleState"
] | import net.rim.device.api.ui.accessibility.AccessibleContext; import net.rim.device.api.ui.accessibility.AccessibleState; | import net.rim.device.api.ui.accessibility.*; | [
"net.rim.device"
] | net.rim.device; | 961,153 |
public List<XmlElement> getElementsByName(String tagName) {
return childrenByElement.getOrDefault(tagName, Collections.emptyList());
} | List<XmlElement> function(String tagName) { return childrenByElement.getOrDefault(tagName, Collections.emptyList()); } | /**
* Get all child elements by the given tag name. This only returns direct children elements.
*
* @param tagName Tag name of elements to retrieve.
* @return List of elements or empty list of no elements found with given name.
*/ | Get all child elements by the given tag name. This only returns direct children elements | getElementsByName | {
"repo_name": "aws/aws-sdk-java-v2",
"path": "core/protocols/aws-query-protocol/src/main/java/software/amazon/awssdk/protocols/query/unmarshall/XmlElement.java",
"license": "apache-2.0",
"size": 6160
} | [
"java.util.Collections",
"java.util.List"
] | import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,400,644 |
public void updateFocusedRowStyle(Row row) {
if (rowWithFocus == row.getRow()
&& containerWithFocus == escalator.getBody()) {
if (row.getElement() != rowWithFocusStyle) {
// Row should have focus style but does not have it.
... | void function(Row row) { if (rowWithFocus == row.getRow() && containerWithFocus == escalator.getBody()) { if (row.getElement() != rowWithFocusStyle) { if (rowWithFocusStyle != null) { setStyleName(rowWithFocusStyle, rowFocusStyleName, false); } rowWithFocusStyle = row.getElement(); setStyleName(rowWithFocusStyle, rowFo... | /**
* Sets focus style for the given row if needed.
*
* @param row
* a row object
*/ | Sets focus style for the given row if needed | updateFocusedRowStyle | {
"repo_name": "shahrzadmn/vaadin",
"path": "client/src/com/vaadin/client/widgets/Grid.java",
"license": "apache-2.0",
"size": 302957
} | [
"com.vaadin.client.widget.escalator.Row"
] | import com.vaadin.client.widget.escalator.Row; | import com.vaadin.client.widget.escalator.*; | [
"com.vaadin.client"
] | com.vaadin.client; | 1,526,937 |
public static Object load(String packageName, InputStream in) throws IOException, JAXBException {
final Unmarshaller u = getUnmarshaller(packageName);
Object retVal = u.unmarshal(in);
return retVal;
}
| static Object function(String packageName, InputStream in) throws IOException, JAXBException { final Unmarshaller u = getUnmarshaller(packageName); Object retVal = u.unmarshal(in); return retVal; } | /**
* deserialize from an InputStream to a JaxB object, without validation
* @param packageName
* @param in
* @return
* @throws java.io.IOException
* @throws javax.xml.bind.JAXBException
*/ | deserialize from an InputStream to a JaxB object, without validation | load | {
"repo_name": "thedarknet/daemon4",
"path": "tools/DBSetup/src/main/java/org/dcdarknet/tools/dbsetup/util/JaxbUtil.java",
"license": "bsd-2-clause",
"size": 12104
} | [
"java.io.IOException",
"java.io.InputStream",
"javax.xml.bind.JAXBException",
"javax.xml.bind.Unmarshaller"
] | import java.io.IOException; import java.io.InputStream; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; | import java.io.*; import javax.xml.bind.*; | [
"java.io",
"javax.xml"
] | java.io; javax.xml; | 1,521,355 |
@Deprecated
public static TableSchema deriveTableSinkSchema(DescriptorProperties properties) {
TableSchema.Builder builder = TableSchema.builder();
TableSchema tableSchema = properties.getTableSchema(SCHEMA);
for (int i = 0; i < tableSchema.getFieldCount(); i++) {
final TableColumn tableColumn = tableSchem... | static TableSchema function(DescriptorProperties properties) { TableSchema.Builder builder = TableSchema.builder(); TableSchema tableSchema = properties.getTableSchema(SCHEMA); for (int i = 0; i < tableSchema.getFieldCount(); i++) { final TableColumn tableColumn = tableSchema.getTableColumns().get(i); final String fiel... | /**
* Derives the table schema for a table sink. A sink ignores a proctime attribute and
* needs to track the origin of a rowtime field.
*
* @deprecated This method combines two separate concepts of table schema and field mapping.
* This should be split into two methods once we have support for
... | Derives the table schema for a table sink. A sink ignores a proctime attribute and needs to track the origin of a rowtime field | deriveTableSinkSchema | {
"repo_name": "tzulitai/flink",
"path": "flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/descriptors/SchemaValidator.java",
"license": "apache-2.0",
"size": 13156
} | [
"org.apache.flink.table.api.TableColumn",
"org.apache.flink.table.api.TableException",
"org.apache.flink.table.api.TableSchema",
"org.apache.flink.table.types.DataType"
] | import org.apache.flink.table.api.TableColumn; import org.apache.flink.table.api.TableException; import org.apache.flink.table.api.TableSchema; import org.apache.flink.table.types.DataType; | import org.apache.flink.table.api.*; import org.apache.flink.table.types.*; | [
"org.apache.flink"
] | org.apache.flink; | 2,094,151 |
public static void encode(InputStream in, OutputStream out) throws IOException
{
process(in, out);
} | static void function(InputStream in, OutputStream out) throws IOException { process(in, out); } | /**
* Encodes data from supplied input to output.
* @param in The input stream to be encoded.
* @param out The output stream, to write encoded data to.
*/ | Encodes data from supplied input to output | encode | {
"repo_name": "picketbox/picketbox",
"path": "security-jboss-sx/jbosssx/src/main/java/org/jboss/security/Base64Encoder.java",
"license": "lgpl-2.1",
"size": 8751
} | [
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream"
] | import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 644,823 |
EList<Machines> getAllMachines(); | EList<Machines> getAllMachines(); | /**
* Returns the value of the '<em><b>All Machines</b></em>' containment reference list.
* The list contents are of type {@link ServerPark.Machines}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>All Machines</em>' containment reference list isn't clear,
* there really should be more of a de... | Returns the value of the 'All Machines' containment reference list. The list contents are of type <code>ServerPark.Machines</code>. If the meaning of the 'All Machines' containment reference list isn't clear, there really should be more of a description here... | getAllMachines | {
"repo_name": "FTSRG/viatra-dse-swarm",
"path": "plugins/hu.bme.mit.incqueryd.dsehelpermodel/src/ServerPark/UsedMachines.java",
"license": "epl-1.0",
"size": 3973
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,197,840 |
public TimeValue getTimeout() {
return timeout;
} | TimeValue function() { return timeout; } | /**
* Timeout to wait for the shards on to be available for each bulk request?
*/ | Timeout to wait for the shards on to be available for each bulk request | getTimeout | {
"repo_name": "gingerwizard/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequest.java",
"license": "apache-2.0",
"size": 16619
} | [
"org.elasticsearch.common.unit.TimeValue"
] | import org.elasticsearch.common.unit.TimeValue; | import org.elasticsearch.common.unit.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 2,796,737 |
@SuppressWarnings("unchecked")
private static JSONObject createCredentials() {
JSONObject result = new JSONObject();
result.put("UserName", userName);
result.put("Password", password);
return result;
} | @SuppressWarnings(STR) static JSONObject function() { JSONObject result = new JSONObject(); result.put(STR, userName); result.put(STR, password); return result; } | /**
* Creates the credentials JSON to use to authenticate with the web service.
* @return A JSON object containing the user's credentials.
*/ | Creates the credentials JSON to use to authenticate with the web service | createCredentials | {
"repo_name": "martincostello/electronicupdates",
"path": "src/Java/MetadataWebApi/src/com/experian/qas/updates/metadata/webapi/v1/Program.java",
"license": "apache-2.0",
"size": 14260
} | [
"org.json.simple.JSONObject"
] | import org.json.simple.JSONObject; | import org.json.simple.*; | [
"org.json.simple"
] | org.json.simple; | 2,643,871 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.