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
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public DecJurPag getPagoOsirisDeclarado(){
return GdeDAOFactory.getDecJurPagDAO().getByDecJurAndTipPagDecJur(getId(), TipPagDecJur.ID_PAGO_OSIRIS);
}
| DecJurPag function(){ return GdeDAOFactory.getDecJurPagDAO().getByDecJurAndTipPagDecJur(getId(), TipPagDecJur.ID_PAGO_OSIRIS); } | /**
* Obtiene Pago declarado Afip (hecho por Osiris) asociado a la Declaracion Jurada
* @return
*/ | Obtiene Pago declarado Afip (hecho por Osiris) asociado a la Declaracion Jurada | getPagoOsirisDeclarado | {
"repo_name": "avdata99/SIAT",
"path": "siat-1.0-SOURCE/src/buss/src/ar/gov/rosario/siat/gde/buss/bean/DecJur.java",
"license": "gpl-3.0",
"size": 30651
} | [
"ar.gov.rosario.siat.gde.buss.dao.GdeDAOFactory"
] | import ar.gov.rosario.siat.gde.buss.dao.GdeDAOFactory; | import ar.gov.rosario.siat.gde.buss.dao.*; | [
"ar.gov.rosario"
] | ar.gov.rosario; | 2,466,229 |
protected ParamSaxBuffer getMessage(String catalogueID, String key) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Getting key " + key + " from catalogue " + catalogueID);
}
CatalogueInfo catalogue = this.catalogue;
if (catalogueID != null) {
catalogue = (CatalogueInfo)catalogues.get(catalogueID);
if (catalogue == null) {
if (getLogger().isWarnEnabled()) {
getLogger().warn("Catalogue not found: " + catalogueID +
", will not translate key " + key);
}
return null;
}
}
Bundle bundle = catalogue.getCatalogue();
if (bundle == null) {
// Can't translate
getLogger().debug("Untranslated key: '" + key + "'");
return null;
}
try {
return (ParamSaxBuffer) bundle.getObject(key);
} catch (MissingResourceException e) {
getLogger().debug("Untranslated key: '" + key + "'");
}
return null;
} | ParamSaxBuffer function(String catalogueID, String key) { if (getLogger().isDebugEnabled()) { getLogger().debug(STR + key + STR + catalogueID); } CatalogueInfo catalogue = this.catalogue; if (catalogueID != null) { catalogue = (CatalogueInfo)catalogues.get(catalogueID); if (catalogue == null) { if (getLogger().isWarnEnabled()) { getLogger().warn(STR + catalogueID + STR + key); } return null; } } Bundle bundle = catalogue.getCatalogue(); if (bundle == null) { getLogger().debug(STR + key + "'"); return null; } try { return (ParamSaxBuffer) bundle.getObject(key); } catch (MissingResourceException e) { getLogger().debug(STR + key + "'"); } return null; } | /**
* Helper method to retrieve a message from the dictionary.
*
* @param catalogueID if not null, this catalogue will be used instead of the default one.
* @return SaxBuffer containing message, or null if not found.
*/ | Helper method to retrieve a message from the dictionary | getMessage | {
"repo_name": "apache/cocoon",
"path": "core/cocoon-core/src/main/java/org/apache/cocoon/transformation/I18nTransformer.java",
"license": "apache-2.0",
"size": 86223
} | [
"java.util.MissingResourceException",
"org.apache.cocoon.i18n.Bundle",
"org.apache.cocoon.xml.ParamSaxBuffer"
] | import java.util.MissingResourceException; import org.apache.cocoon.i18n.Bundle; import org.apache.cocoon.xml.ParamSaxBuffer; | import java.util.*; import org.apache.cocoon.i18n.*; import org.apache.cocoon.xml.*; | [
"java.util",
"org.apache.cocoon"
] | java.util; org.apache.cocoon; | 1,545,915 |
public void test_DELETE_accessPath_delete_o_URI() throws Exception {
doInsertbyURL("POST", packagePath + "test_delete_by_access_path.ttl");
final long mutationResult = doDeleteWithAccessPath(//
// requestPath,//
null,// s
null,// p
new URIImpl("http://xmlns.com/foaf/0.1/Person")// o
);
assertEquals(3, mutationResult);
} | void function() throws Exception { doInsertbyURL("POST", packagePath + STR); final long mutationResult = doDeleteWithAccessPath( null, null, new URIImpl("http: ); assertEquals(3, mutationResult); } | /**
* Delete everything with a specific object (a URI).
*/ | Delete everything with a specific object (a URI) | test_DELETE_accessPath_delete_o_URI | {
"repo_name": "blazegraph/database",
"path": "bigdata-sails-test/src/test/java/com/bigdata/rdf/sail/webapp/Test_REST_DELETE_BY_ACCESS_PATH.java",
"license": "gpl-2.0",
"size": 10957
} | [
"org.openrdf.model.impl.URIImpl"
] | import org.openrdf.model.impl.URIImpl; | import org.openrdf.model.impl.*; | [
"org.openrdf.model"
] | org.openrdf.model; | 604,859 |
@Test
public void includeInCaseOfProjectStageDevelopment()
{
DevBean devBean = BeanProvider.getContextualReference(DevBean.class, true);
Assert.assertNotNull(devBean);
} | void function() { DevBean devBean = BeanProvider.getContextualReference(DevBean.class, true); Assert.assertNotNull(devBean); } | /**
* bean included in case of project-stage development
*/ | bean included in case of project-stage development | includeInCaseOfProjectStageDevelopment | {
"repo_name": "kenfinnigan/DeltaSpike",
"path": "deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTestProjectStageDevelopment.java",
"license": "apache-2.0",
"size": 3223
} | [
"org.apache.deltaspike.core.api.provider.BeanProvider",
"org.junit.Assert"
] | import org.apache.deltaspike.core.api.provider.BeanProvider; import org.junit.Assert; | import org.apache.deltaspike.core.api.provider.*; import org.junit.*; | [
"org.apache.deltaspike",
"org.junit"
] | org.apache.deltaspike; org.junit; | 1,335,121 |
@Beta protected boolean standardEquals(@Nullable Object object) {
return Sets.equalsImpl(this, object);
}
/**
* A sensible definition of {@link #hashCode} in terms of {@link #iterator}.
* If you override {@link #iterator}, you may wish to override {@link #equals} | @Beta boolean function(@Nullable Object object) { return Sets.equalsImpl(this, object); } /** * A sensible definition of {@link #hashCode} in terms of {@link #iterator}. * If you override {@link #iterator}, you may wish to override {@link #equals} | /**
* A sensible definition of {@link #equals} in terms of {@link #size} and
* {@link #containsAll}. If you override either of those methods, you may wish
* to override {@link #equals} to forward to this implementation.
*
* @since 7.0
*/ | A sensible definition of <code>#equals</code> in terms of <code>#size</code> and <code>#containsAll</code>. If you override either of those methods, you may wish to override <code>#equals</code> to forward to this implementation | standardEquals | {
"repo_name": "hceylan/guava",
"path": "guava/src/com/google/common/collect/ForwardingSet.java",
"license": "apache-2.0",
"size": 3490
} | [
"com.google.common.annotations.Beta",
"javax.annotation.Nullable"
] | import com.google.common.annotations.Beta; import javax.annotation.Nullable; | import com.google.common.annotations.*; import javax.annotation.*; | [
"com.google.common",
"javax.annotation"
] | com.google.common; javax.annotation; | 1,463,742 |
public boolean enoughToFilter() {
if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE)
return false;
return ((AutoCompleteTextView)mInputView).enoughToFilter();
} | boolean function() { if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE) return false; return ((AutoCompleteTextView)mInputView).enoughToFilter(); } | /**
* Returns <code>true</code> if the amount of text in the field meets
* or exceeds the {@link #getThreshold} requirement. You can override
* this to impose a different standard for when filtering will be
* triggered.
* <p>Only work when autoComplete mode is {@link #AUTOCOMPLETE_MODE_SINGLE} or {@link #AUTOCOMPLETE_MODE_MULTI}</p>
*/ | Returns <code>true</code> if the amount of text in the field meets or exceeds the <code>#getThreshold</code> requirement. You can override this to impose a different standard for when filtering will be triggered. Only work when autoComplete mode is <code>#AUTOCOMPLETE_MODE_SINGLE</code> or <code>#AUTOCOMPLETE_MODE_MULTI</code> | enoughToFilter | {
"repo_name": "android9527/AndroidDemo",
"path": "material/src/main/java/com/rey/material/widget/EditText.java",
"license": "apache-2.0",
"size": 149798
} | [
"android.widget.AutoCompleteTextView"
] | import android.widget.AutoCompleteTextView; | import android.widget.*; | [
"android.widget"
] | android.widget; | 2,832,259 |
String format(RoutingContext routingContext, long ms); | String format(RoutingContext routingContext, long ms); | /**
* Formats and returns the log statement
*
* @param routingContext The routing context
* @param ms The number of milliseconds since first receiving the request
* @return The formatted string to log
*/ | Formats and returns the log statement | format | {
"repo_name": "vert-x3/vertx-web",
"path": "vertx-web/src/main/java/io/vertx/ext/web/handler/LoggerFormatter.java",
"license": "apache-2.0",
"size": 1200
} | [
"io.vertx.ext.web.RoutingContext"
] | import io.vertx.ext.web.RoutingContext; | import io.vertx.ext.web.*; | [
"io.vertx.ext"
] | io.vertx.ext; | 385,110 |
@Path("list")
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN})
@RolesAllowed("workspace/developer")
public ListResponse list(final ListRequest request) throws ServerException, IOException {
request.withProjectPath(getRealPath(request.getProjectPath()));
return this.subversionApi.list(request);
} | @Path("list") @Consumes(MediaType.APPLICATION_JSON) @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) @RolesAllowed(STR) ListResponse function(final ListRequest request) throws ServerException, IOException { request.withProjectPath(getRealPath(request.getProjectPath())); return this.subversionApi.list(request); } | /**
* List remote directory.
*
* @param request
* a list request
* @return children of requested target
*
* @throws IOException
* if there is a problem executing the command
* @throws SubversionException
* if there is a Subversion issue
*/ | List remote directory | list | {
"repo_name": "riuvshin/che-plugins",
"path": "plugin-svn/che-plugin-svn-ext-subversion/src/main/java/org/eclipse/che/ide/ext/svn/server/rest/SubversionService.java",
"license": "epl-1.0",
"size": 21075
} | [
"java.io.IOException",
"javax.annotation.security.RolesAllowed",
"javax.ws.rs.Consumes",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.core.MediaType",
"org.eclipse.che.api.core.ServerException",
"org.eclipse.che.ide.ext.svn.shared.ListRequest",
"org.eclipse.che.ide.ext.svn.shared.ListResponse"
] | import java.io.IOException; import javax.annotation.security.RolesAllowed; import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.eclipse.che.api.core.ServerException; import org.eclipse.che.ide.ext.svn.shared.ListRequest; import org.eclipse.che.ide.ext.svn.shared.ListResponse; | import java.io.*; import javax.annotation.security.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.eclipse.che.api.core.*; import org.eclipse.che.ide.ext.svn.shared.*; | [
"java.io",
"javax.annotation",
"javax.ws",
"org.eclipse.che"
] | java.io; javax.annotation; javax.ws; org.eclipse.che; | 2,799,264 |
//{{{ compareStrings() method
public static int compareStrings(String str1, String str2, boolean ignoreCase)
{
char[] char1 = str1.toCharArray();
char[] char2 = str2.toCharArray();
int len = Math.min(char1.length,char2.length);
for(int i = 0, j = 0; i < len && j < len; i++, j++)
{
char ch1 = char1[i];
char ch2 = char2[j];
if(Character.isDigit(ch1) && Character.isDigit(ch2)
&& ch1 != '0' && ch2 != '0')
{
int _i = i + 1;
int _j = j + 1;
for(; _i < char1.length; _i++)
{
if(!Character.isDigit(char1[_i]))
{
//_i--;
break;
}
}
for(; _j < char2.length; _j++)
{
if(!Character.isDigit(char2[_j]))
{
//_j--;
break;
}
}
int len1 = _i - i;
int len2 = _j - j;
if(len1 > len2)
return 1;
else if(len1 < len2)
return -1;
else
{
for(int k = 0; k < len1; k++)
{
ch1 = char1[i + k];
ch2 = char2[j + k];
if(ch1 != ch2)
return ch1 - ch2;
}
}
i = _i - 1;
j = _j - 1;
}
else
{
if(ignoreCase)
{
ch1 = Character.toLowerCase(ch1);
ch2 = Character.toLowerCase(ch2);
}
if(ch1 != ch2)
return ch1 - ch2;
}
}
return char1.length - char2.length;
} //}}}
//{{{ StringCompare class
public static class StringCompare<E> implements Comparator<E>
{
private boolean icase;
public StringCompare(boolean icase)
{
this.icase = icase;
}
public StringCompare()
{
} | static int function(String str1, String str2, boolean ignoreCase) { char[] char1 = str1.toCharArray(); char[] char2 = str2.toCharArray(); int len = Math.min(char1.length,char2.length); for(int i = 0, j = 0; i < len && j < len; i++, j++) { char ch1 = char1[i]; char ch2 = char2[j]; if(Character.isDigit(ch1) && Character.isDigit(ch2) && ch1 != '0' && ch2 != '0') { int _i = i + 1; int _j = j + 1; for(; _i < char1.length; _i++) { if(!Character.isDigit(char1[_i])) { break; } } for(; _j < char2.length; _j++) { if(!Character.isDigit(char2[_j])) { break; } } int len1 = _i - i; int len2 = _j - j; if(len1 > len2) return 1; else if(len1 < len2) return -1; else { for(int k = 0; k < len1; k++) { ch1 = char1[i + k]; ch2 = char2[j + k]; if(ch1 != ch2) return ch1 - ch2; } } i = _i - 1; j = _j - 1; } else { if(ignoreCase) { ch1 = Character.toLowerCase(ch1); ch2 = Character.toLowerCase(ch2); } if(ch1 != ch2) return ch1 - ch2; } } return char1.length - char2.length; } public static class StringCompare<E> implements Comparator<E> { private boolean icase; public StringCompare(boolean icase) { this.icase = icase; } public StringCompare() { } | /**
* Compares two strings.<p>
*
* Unlike <function>String.compareTo()</function>,
* this method correctly recognizes and handles embedded numbers.
* For example, it places "My file 2" before "My file 10".<p>
*
* @param str1 The first string
* @param str2 The second string
* @param ignoreCase If true, case will be ignored
* @return negative If str1 < str2, 0 if both are the same,
* positive if str1 > str2
* @since jEdit 4.3pre5
*/ | Compares two strings. Unlike String.compareTo(), this method correctly recognizes and handles embedded numbers. For example, it places "My file 2" before "My file 10" | compareStrings | {
"repo_name": "arestivo/jEditSyntax",
"path": "src/util/StandardUtilities.java",
"license": "gpl-2.0",
"size": 16722
} | [
"java.util.Comparator"
] | import java.util.Comparator; | import java.util.*; | [
"java.util"
] | java.util; | 514,076 |
public final double getAndSet(int i, double newValue) {
long next = doubleToRawLongBits(newValue);
return longBitsToDouble(longs.getAndSet(i, next));
} | final double function(int i, double newValue) { long next = doubleToRawLongBits(newValue); return longBitsToDouble(longs.getAndSet(i, next)); } | /**
* Atomically sets the element at position {@code i} to the given value
* and returns the old value.
*
* @param i the index
* @param newValue the new value
* @return the previous value
*/ | Atomically sets the element at position i to the given value and returns the old value | getAndSet | {
"repo_name": "geekboxzone/lollipop_external_guava",
"path": "guava/src/com/google/common/util/concurrent/AtomicDoubleArray.java",
"license": "apache-2.0",
"size": 8134
} | [
"java.lang.Double"
] | import java.lang.Double; | import java.lang.*; | [
"java.lang"
] | java.lang; | 1,560,995 |
@Test
public void load_application_with_cluster_types ()
throws JsonProcessingException, IOException {
File csapApplicationDefinition = new File(
getClass().getResource( "/org/csap/test/data/test_application_model.json" ).getPath() );
assertThat( csapApplication.loadDefinitionForJunits( false, csapApplicationDefinition ) )
.as( "No Errors or warnings" )
.isTrue();
assertThat( csapApplication.getName() )
.as( "Capability Name parsed" )
.isEqualTo( "TestDefinitionForAutomatedTesting" );
assertThat( csapApplication.getRootModel().getHostToConfigMap().keySet() )
.as( "All Hosts found" )
.hasSize( 9 )
.contains( "csap-dev01",
"csap-dev02",
"csapdb-dev01", "localhost",
"peter-dev01", "xcssp-qa01",
"xcssp-qa02",
"xfactory-qa01",
"xfactory-qa02" );
assertThat( csapApplication.getAllHostsInAllPackagesInCurrentLifecycle() )
.as( "Lifecycles Hosts found" )
.hasSize( 5 )
.contains( "localhost",
"csapdb-dev01" );
assertThat( csapApplication.getLifecycleList() )
.as( "Lifecycles found" )
.hasSize( 10 )
.contains( "dev", "dev-WebServer-1", "stage" );
assertThat( csapApplication.getSvcToConfigMap().get( "CsAgent" ) )
.as( "CsAgents instances found" )
.hasSize( 9 );
assertThat( csapApplication.getSvcToConfigMap().keySet() )
.as( "Service instances found" )
.hasSize( 15 )
.contains( "AuditService", "CsAgent", "CsspSample",
"Factory2Sample",
"FactorySample", "SampleDataLoader",
"ServletSample", "activemq",
"admin", "denodo", "httpd", "oracle",
"sampleOsWrapper",
"springmvc-showcase", "vmmemctl" );
// New instance meta data
ServiceInstance csAgentInstance = csapApplication
.getServiceInstanceAnyPackage( Application.AGENT_NAME_PORT );
assertThat( csAgentInstance.getOsProcessPriority() )
.as( "CsAgent OS Priority" )
.isEqualTo( "-12" );
// logger.info("Workers file: " +
// getHttpdConfig().getHttpdWorkersFile().getAbsolutePath());
assertThat( getHttpdConfig().getHttpdWorkersFile() )
.as( "Web Servers Worker file created" )
.exists();
assertThat( contentOf( getHttpdConfig().getHttpdWorkersFile() ) )
.contains( "worker.FactorySample-dev01_LB" )
.contains( "worker.AuditService_LB" );
assertThat( getHttpdConfig().getHttpdModjkFile() )
.as( "Web Servers ModJK file created" )
.exists();
assertThat( contentOf( getHttpdConfig().getHttpdModjkFile() ) )
.as( "Mounts include both singleVm partion suffix and non suffix for enterpise" )
.contains( "springmvc-showcase" )
.contains( "Factory2Sample-dev01" );
} | void function () throws JsonProcessingException, IOException { File csapApplicationDefinition = new File( getClass().getResource( STR ).getPath() ); assertThat( csapApplication.loadDefinitionForJunits( false, csapApplicationDefinition ) ) .as( STR ) .isTrue(); assertThat( csapApplication.getName() ) .as( STR ) .isEqualTo( STR ); assertThat( csapApplication.getRootModel().getHostToConfigMap().keySet() ) .as( STR ) .hasSize( 9 ) .contains( STR, STR, STR, STR, STR, STR, STR, STR, STR ); assertThat( csapApplication.getAllHostsInAllPackagesInCurrentLifecycle() ) .as( STR ) .hasSize( 5 ) .contains( STR, STR ); assertThat( csapApplication.getLifecycleList() ) .as( STR ) .hasSize( 10 ) .contains( "dev", STR, "stage" ); assertThat( csapApplication.getSvcToConfigMap().get( STR ) ) .as( STR ) .hasSize( 9 ); assertThat( csapApplication.getSvcToConfigMap().keySet() ) .as( STR ) .hasSize( 15 ) .contains( STR, STR, STR, STR, STR, STR, STR, STR, "admin", STR, "httpd", STR, STR, STR, STR ); ServiceInstance csAgentInstance = csapApplication .getServiceInstanceAnyPackage( Application.AGENT_NAME_PORT ); assertThat( csAgentInstance.getOsProcessPriority() ) .as( STR ) .isEqualTo( "-12" ); assertThat( getHttpdConfig().getHttpdWorkersFile() ) .as( STR ) .exists(); assertThat( contentOf( getHttpdConfig().getHttpdWorkersFile() ) ) .contains( STR ) .contains( STR ); assertThat( getHttpdConfig().getHttpdModjkFile() ) .as( STR ) .exists(); assertThat( contentOf( getHttpdConfig().getHttpdModjkFile() ) ) .as( STR ) .contains( STR ) .contains( STR ); } | /**
*
* Scenario: - load a config file with multiple services, some shared
* nothing, some standard - httpd instance has generateWorkerProperties
* metadata in cluster.js - verify that mount points get generated
*
*/ | Scenario: - load a config file with multiple services, some shared nothing, some standard - httpd instance has generateWorkerProperties metadata in cluster.js - verify that mount points get generated | load_application_with_cluster_types | {
"repo_name": "peterdnight/csap-core",
"path": "csap-core-service/src/test/java/org/csap/test/t3/models/using_spring/Load_Working_Models_Test.java",
"license": "mit",
"size": 33916
} | [
"com.fasterxml.jackson.core.JsonProcessingException",
"java.io.File",
"java.io.IOException",
"org.assertj.core.api.Assertions",
"org.csap.agent.model.Application",
"org.csap.agent.model.ServiceInstance"
] | import com.fasterxml.jackson.core.JsonProcessingException; import java.io.File; import java.io.IOException; import org.assertj.core.api.Assertions; import org.csap.agent.model.Application; import org.csap.agent.model.ServiceInstance; | import com.fasterxml.jackson.core.*; import java.io.*; import org.assertj.core.api.*; import org.csap.agent.model.*; | [
"com.fasterxml.jackson",
"java.io",
"org.assertj.core",
"org.csap.agent"
] | com.fasterxml.jackson; java.io; org.assertj.core; org.csap.agent; | 13,543 |
public final void pushPair(Node v1, Node v2)
{
if (null == m_map)
{
m_map = new Node[m_blocksize];
m_mapSize = m_blocksize;
}
else
{
if ((m_firstFree + 2) >= m_mapSize)
{
m_mapSize += m_blocksize;
Node newMap[] = new Node[m_mapSize];
System.arraycopy(m_map, 0, newMap, 0, m_firstFree);
m_map = newMap;
}
}
m_map[m_firstFree] = v1;
m_map[m_firstFree + 1] = v2;
m_firstFree += 2;
} | final void function(Node v1, Node v2) { if (null == m_map) { m_map = new Node[m_blocksize]; m_mapSize = m_blocksize; } else { if ((m_firstFree + 2) >= m_mapSize) { m_mapSize += m_blocksize; Node newMap[] = new Node[m_mapSize]; System.arraycopy(m_map, 0, newMap, 0, m_firstFree); m_map = newMap; } } m_map[m_firstFree] = v1; m_map[m_firstFree + 1] = v2; m_firstFree += 2; } | /**
* Push a pair of nodes into the stack.
* Special purpose method for TransformerImpl, pushElemTemplateElement.
* Performance critical.
*
* @param v1 First node to add to vector
* @param v2 Second node to add to vector
*/ | Push a pair of nodes into the stack. Special purpose method for TransformerImpl, pushElemTemplateElement. Performance critical | pushPair | {
"repo_name": "YouDiSN/OpenJDK-Research",
"path": "jdk9/jaxp/src/java.xml/share/classes/com/sun/org/apache/xpath/internal/NodeSet.java",
"license": "gpl-2.0",
"size": 35779
} | [
"org.w3c.dom.Node"
] | import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,360,154 |
public void stopReplicationMaster() throws StandardException; | void function() throws StandardException; | /**
* Stop the replication master role for this database.
*
* @exception StandardException Standard Derby exception policy,
* thrown on error.
*/ | Stop the replication master role for this database | stopReplicationMaster | {
"repo_name": "papicella/snappy-store",
"path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/iapi/store/access/AccessFactory.java",
"license": "apache-2.0",
"size": 12371
} | [
"com.pivotal.gemfirexd.internal.iapi.error.StandardException"
] | import com.pivotal.gemfirexd.internal.iapi.error.StandardException; | import com.pivotal.gemfirexd.internal.iapi.error.*; | [
"com.pivotal.gemfirexd"
] | com.pivotal.gemfirexd; | 233,382 |
private static boolean deleteNativeLibrary() {
String path = nativeLibraryPath;
if (path == null || !unpacked) return true;
File flib = new File(path);
if (flib.delete()) {
nativeLibraryPath = null;
unpacked = false;
return true;
}
// Reach into the bowels of ClassLoader to force the native
// library to unload
try {
ClassLoader cl = Native.class.getClassLoader();
Field f = ClassLoader.class.getDeclaredField("nativeLibraries");
f.setAccessible(true);
List libs = (List)f.get(cl);
for (Iterator i = libs.iterator();i.hasNext();) {
Object lib = i.next();
f = lib.getClass().getDeclaredField("name");
f.setAccessible(true);
String name = (String)f.get(lib);
if (name.equals(path) || name.indexOf(path) != -1
|| name.equals(flib.getCanonicalPath())) {
Method m = lib.getClass().getDeclaredMethod("finalize", new Class[0]);
m.setAccessible(true);
m.invoke(lib, new Object[0]);
nativeLibraryPath = null;
if (unpacked) {
if (flib.exists()) {
if (flib.delete()) {
unpacked = false;
return true;
}
return false;
}
}
return true;
}
}
}
catch(Exception e) {
}
return false;
}
private Native() { } | static boolean function() { String path = nativeLibraryPath; if (path == null !unpacked) return true; File flib = new File(path); if (flib.delete()) { nativeLibraryPath = null; unpacked = false; return true; } try { ClassLoader cl = Native.class.getClassLoader(); Field f = ClassLoader.class.getDeclaredField(STR); f.setAccessible(true); List libs = (List)f.get(cl); for (Iterator i = libs.iterator();i.hasNext();) { Object lib = i.next(); f = lib.getClass().getDeclaredField("name"); f.setAccessible(true); String name = (String)f.get(lib); if (name.equals(path) name.indexOf(path) != -1 name.equals(flib.getCanonicalPath())) { Method m = lib.getClass().getDeclaredMethod(STR, new Class[0]); m.setAccessible(true); m.invoke(lib, new Object[0]); nativeLibraryPath = null; if (unpacked) { if (flib.exists()) { if (flib.delete()) { unpacked = false; return true; } return false; } } return true; } } } catch(Exception e) { } return false; } private Native() { } | /** Remove any automatically unpacked native library. Forcing the class
loader to unload it first is only required on Windows, since the
temporary native library is still "in use" and can't be deleted until
the native library is removed from its class loader. Any deferred
execution we might install at this point would prevent the Native
class and its class loader from being GC'd, so we instead force
the native library unload just a little bit prematurely.
*/ | Remove any automatically unpacked native library. Forcing the class | deleteNativeLibrary | {
"repo_name": "notnoop/jna",
"path": "jnalib/src/com/sun/jna/Native.java",
"license": "lgpl-2.1",
"size": 69605
} | [
"java.io.File",
"java.lang.reflect.Field",
"java.lang.reflect.Method",
"java.util.Iterator",
"java.util.List"
] | import java.io.File; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.Iterator; import java.util.List; | import java.io.*; import java.lang.reflect.*; import java.util.*; | [
"java.io",
"java.lang",
"java.util"
] | java.io; java.lang; java.util; | 2,201,127 |
@Test(expected = IllegalArgumentException.class)
public void defaultConstructorNonStaticMemberClass() {
reflectiveFactoryFor(MemberViewHolder.class);
} | @Test(expected = IllegalArgumentException.class) void function() { reflectiveFactoryFor(MemberViewHolder.class); } | /**
* Create holder for non-static member class
*/ | Create holder for non-static member class | defaultConstructorNonStaticMemberClass | {
"repo_name": "rtyley/android-viewholder-listviews",
"path": "src/test/java/com/madgag/android/listviews/ReflectiveHolderFactoryTest.java",
"license": "apache-2.0",
"size": 5199
} | [
"com.madgag.android.listviews.ReflectiveHolderFactory",
"org.junit.Test"
] | import com.madgag.android.listviews.ReflectiveHolderFactory; import org.junit.Test; | import com.madgag.android.listviews.*; import org.junit.*; | [
"com.madgag.android",
"org.junit"
] | com.madgag.android; org.junit; | 2,016,150 |
public List<String> getHeader(String name) {
getHeaders();
assert headers != null;
return headers.getHeader(name);
} | List<String> function(String name) { getHeaders(); assert headers != null; return headers.getHeader(name); } | /**
* Return all the values for the specified header.
* Returns <code>null</code> if no headers with the
* specified name exist.
*
* @param name header name
* @return list of header values, or null if none
*/ | Return all the values for the specified header. Returns <code>null</code> if no headers with the specified name exist | getHeader | {
"repo_name": "TheTypoMaster/Scaper",
"path": "openjdk/jaxws/drop_included/jaxws_src/src/com/sun/xml/internal/org/jvnet/mimepull/MIMEPart.java",
"license": "gpl-2.0",
"size": 6283
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,392,453 |
WorldPosition createPosition(int mapId, float x, float y, float z, int heading); | WorldPosition createPosition(int mapId, float x, float y, float z, int heading); | /**
* <p>
* Create position object from coordinates. Default instance id that will be
* used is 1
* </p>
*
* @param mapId
* @param x
* @param y
* @param z
* @param heading
* @return
*/ | Create position object from coordinates. Default instance id that will be used is 1 | createPosition | {
"repo_name": "xGamers665/tera-emu",
"path": "com.tera.gapi.world/src/main/java/com/tera/gapi/world/service/WorldPositionService.java",
"license": "gpl-3.0",
"size": 2395
} | [
"com.tera.gapi.world.model.WorldPosition"
] | import com.tera.gapi.world.model.WorldPosition; | import com.tera.gapi.world.model.*; | [
"com.tera.gapi"
] | com.tera.gapi; | 535,116 |
@Test // serial, ReplicateRegion, RegressionTest, MOVE
public void testConcurrentSerialAsyncEventQueueSize() {
vm0.invoke(() -> createCache());
vm1.invoke(() -> createCache());
vm0.invoke(() -> createConcurrentAsyncEventQueue(asyncEventQueueId, new SpyAsyncEventListener(),
true, 150, 2, 100, OrderPolicy.KEY, false));
vm1.invoke(() -> createConcurrentAsyncEventQueue(asyncEventQueueId, new SpyAsyncEventListener(),
true, 150, 2, 100, OrderPolicy.KEY, false));
vm0.invoke(() -> createReplicateRegion(replicateRegionName, asyncEventQueueId));
vm1.invoke(() -> createReplicateRegion(replicateRegionName, asyncEventQueueId));
vm0.invoke(() -> getInternalGatewaySender().pause());
vm1.invoke(() -> getInternalGatewaySender().pause());
vm0.invoke(() -> waitForDispatcherToPause());
vm1.invoke(() -> waitForDispatcherToPause());
vm0.invoke(() -> doPuts(replicateRegionName, 1000));
assertThat(vm0.invoke(() -> getAsyncEventQueue().size())).isEqualTo(1000);
assertThat(vm1.invoke(() -> getAsyncEventQueue().size())).isEqualTo(1000);
} | @Test void function() { vm0.invoke(() -> createCache()); vm1.invoke(() -> createCache()); vm0.invoke(() -> createConcurrentAsyncEventQueue(asyncEventQueueId, new SpyAsyncEventListener(), true, 150, 2, 100, OrderPolicy.KEY, false)); vm1.invoke(() -> createConcurrentAsyncEventQueue(asyncEventQueueId, new SpyAsyncEventListener(), true, 150, 2, 100, OrderPolicy.KEY, false)); vm0.invoke(() -> createReplicateRegion(replicateRegionName, asyncEventQueueId)); vm1.invoke(() -> createReplicateRegion(replicateRegionName, asyncEventQueueId)); vm0.invoke(() -> getInternalGatewaySender().pause()); vm1.invoke(() -> getInternalGatewaySender().pause()); vm0.invoke(() -> waitForDispatcherToPause()); vm1.invoke(() -> waitForDispatcherToPause()); vm0.invoke(() -> doPuts(replicateRegionName, 1000)); assertThat(vm0.invoke(() -> getAsyncEventQueue().size())).isEqualTo(1000); assertThat(vm1.invoke(() -> getAsyncEventQueue().size())).isEqualTo(1000); } | /**
* Regression test for TRAC #50366: NullPointerException with AsyncEventQueue#size() when number
* of dispatchers is more than 1
*/ | Regression test for TRAC #50366: NullPointerException with AsyncEventQueue#size() when number of dispatchers is more than 1 | testConcurrentSerialAsyncEventQueueSize | {
"repo_name": "deepakddixit/incubator-geode",
"path": "geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/ConcurrentAsyncEventListenerDistributedTest.java",
"license": "apache-2.0",
"size": 17098
} | [
"org.apache.geode.cache.wan.GatewaySender",
"org.assertj.core.api.Assertions",
"org.junit.Test"
] | import org.apache.geode.cache.wan.GatewaySender; import org.assertj.core.api.Assertions; import org.junit.Test; | import org.apache.geode.cache.wan.*; import org.assertj.core.api.*; import org.junit.*; | [
"org.apache.geode",
"org.assertj.core",
"org.junit"
] | org.apache.geode; org.assertj.core; org.junit; | 994,650 |
public void modifyAclEntries(Path path, List<AclEntry> aclSpec)
throws IOException {
throw new UnsupportedOperationException(getClass().getSimpleName()
+ " doesn't support modifyAclEntries");
} | void function(Path path, List<AclEntry> aclSpec) throws IOException { throw new UnsupportedOperationException(getClass().getSimpleName() + STR); } | /**
* Modifies ACL entries of files and directories. This method can add new ACL
* entries or modify the permissions on existing ACL entries. All existing
* ACL entries that are not specified in this call are retained without
* changes. (Modifications are merged into the current ACL.)
*
* @param path Path to modify
* @param aclSpec List<AclEntry> describing modifications
* @throws IOException if an ACL could not be modified
*/ | Modifies ACL entries of files and directories. This method can add new ACL entries or modify the permissions on existing ACL entries. All existing ACL entries that are not specified in this call are retained without changes. (Modifications are merged into the current ACL.) | modifyAclEntries | {
"repo_name": "zhe-thoughts/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java",
"license": "apache-2.0",
"size": 43880
} | [
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.fs.permission.AclEntry"
] | import java.io.IOException; import java.util.List; import org.apache.hadoop.fs.permission.AclEntry; | import java.io.*; import java.util.*; import org.apache.hadoop.fs.permission.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 2,145,643 |
public Quat4f getOrientation() {
return new Quat4f(viewingDirection,viewingAngle);
} | Quat4f function() { return new Quat4f(viewingDirection,viewingAngle); } | /**
* Get the orientation of the camera.
* @return the orientation direction, a quaternion.
*/ | Get the orientation of the camera | getOrientation | {
"repo_name": "Vizaxo/Terasology",
"path": "engine/src/main/java/org/terasology/rendering/cameras/Camera.java",
"license": "apache-2.0",
"size": 7330
} | [
"org.terasology.math.geom.Quat4f"
] | import org.terasology.math.geom.Quat4f; | import org.terasology.math.geom.*; | [
"org.terasology.math"
] | org.terasology.math; | 1,666,747 |
Map<String, AccountingLineViewAction> actionMap = super.getActionMap(accountingLineRenderingContext, accountingLinePropertyName, accountingLineIndex, groupTitle);
if (accountingLineIndex != null) {
AccountingLineViewAction refreshAction = this.getRefreshAction(accountingLineRenderingContext.getAccountingLine(), accountingLinePropertyName, accountingLineIndex, groupTitle);
actionMap.put(KFSConstants.RETURN_METHOD_TO_CALL, refreshAction);
}
return actionMap;
} | Map<String, AccountingLineViewAction> actionMap = super.getActionMap(accountingLineRenderingContext, accountingLinePropertyName, accountingLineIndex, groupTitle); if (accountingLineIndex != null) { AccountingLineViewAction refreshAction = this.getRefreshAction(accountingLineRenderingContext.getAccountingLine(), accountingLinePropertyName, accountingLineIndex, groupTitle); actionMap.put(KFSConstants.RETURN_METHOD_TO_CALL, refreshAction); } return actionMap; } | /**
* adds refresh method to the action map.
* @see org.kuali.kfs.sys.document.authorization.AccountingLineAuthorizerBase#getActionMap(org.kuali.kfs.sys.document.web.AccountingLineRenderingContext, java.lang.String, java.lang.Integer, java.lang.String)
*/ | adds refresh method to the action map | getActionMap | {
"repo_name": "bhutchinson/kfs",
"path": "kfs-core/src/main/java/org/kuali/kfs/fp/document/authorization/FinancialTransactionalDocumentAccountingLineAuthorizerBase.java",
"license": "agpl-3.0",
"size": 3859
} | [
"java.util.Map",
"org.kuali.kfs.sys.KFSConstants",
"org.kuali.kfs.sys.document.web.AccountingLineViewAction"
] | import java.util.Map; import org.kuali.kfs.sys.KFSConstants; import org.kuali.kfs.sys.document.web.AccountingLineViewAction; | import java.util.*; import org.kuali.kfs.sys.*; import org.kuali.kfs.sys.document.web.*; | [
"java.util",
"org.kuali.kfs"
] | java.util; org.kuali.kfs; | 1,396,689 |
public TriggerCondition[] getConditionFilters( )
{
return null;
} | TriggerCondition[] function( ) { return null; } | /**
* Returns supported trigger conditions for specified type of interactivity
* triggers.
*
* @return supported trigger conditions. Null means no filter.
*/ | Returns supported trigger conditions for specified type of interactivity triggers | getConditionFilters | {
"repo_name": "sguan-actuate/birt",
"path": "chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/util/TriggerSupportMatrix.java",
"license": "epl-1.0",
"size": 8919
} | [
"org.eclipse.birt.chart.model.attribute.TriggerCondition"
] | import org.eclipse.birt.chart.model.attribute.TriggerCondition; | import org.eclipse.birt.chart.model.attribute.*; | [
"org.eclipse.birt"
] | org.eclipse.birt; | 2,515,306 |
@PUT
@NoCache
@Path("mappers/{id}")
@Consumes(MediaType.APPLICATION_JSON)
public void update(@PathParam("id") String id, IdentityProviderMapperRepresentation rep) {
auth.requireManage();
if (identityProviderModel == null) {
throw new javax.ws.rs.NotFoundException();
}
IdentityProviderMapperModel model = realm.getIdentityProviderMapperById(id);
if (model == null) throw new NotFoundException("Model not found");
model = RepresentationToModel.toModel(rep);
realm.updateIdentityProviderMapper(model);
adminEvent.operation(OperationType.UPDATE).resource(ResourceType.IDENTITY_PROVIDER_MAPPER).resourcePath(uriInfo).representation(rep).success();
} | @Path(STR) @Consumes(MediaType.APPLICATION_JSON) void function(@PathParam("id") String id, IdentityProviderMapperRepresentation rep) { auth.requireManage(); if (identityProviderModel == null) { throw new javax.ws.rs.NotFoundException(); } IdentityProviderMapperModel model = realm.getIdentityProviderMapperById(id); if (model == null) throw new NotFoundException(STR); model = RepresentationToModel.toModel(rep); realm.updateIdentityProviderMapper(model); adminEvent.operation(OperationType.UPDATE).resource(ResourceType.IDENTITY_PROVIDER_MAPPER).resourcePath(uriInfo).representation(rep).success(); } | /**
* Update a mapper for the identity provider
*
* @param id Mapper id
* @param rep
*/ | Update a mapper for the identity provider | update | {
"repo_name": "manuel-palacio/keycloak",
"path": "services/src/main/java/org/keycloak/services/resources/admin/IdentityProviderResource.java",
"license": "apache-2.0",
"size": 15039
} | [
"javax.ws.rs.Consumes",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.core.MediaType",
"org.jboss.resteasy.spi.NotFoundException",
"org.keycloak.events.admin.OperationType",
"org.keycloak.events.admin.ResourceType",
"org.keycloak.models.IdentityProviderMapperModel",
"org.keycloak.models.utils.RepresentationToModel",
"org.keycloak.representations.idm.IdentityProviderMapperRepresentation"
] | import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.MediaType; import org.jboss.resteasy.spi.NotFoundException; import org.keycloak.events.admin.OperationType; import org.keycloak.events.admin.ResourceType; import org.keycloak.models.IdentityProviderMapperModel; import org.keycloak.models.utils.RepresentationToModel; import org.keycloak.representations.idm.IdentityProviderMapperRepresentation; | import javax.ws.rs.*; import javax.ws.rs.core.*; import org.jboss.resteasy.spi.*; import org.keycloak.events.admin.*; import org.keycloak.models.*; import org.keycloak.models.utils.*; import org.keycloak.representations.idm.*; | [
"javax.ws",
"org.jboss.resteasy",
"org.keycloak.events",
"org.keycloak.models",
"org.keycloak.representations"
] | javax.ws; org.jboss.resteasy; org.keycloak.events; org.keycloak.models; org.keycloak.representations; | 2,181,766 |
public static byte [] removeQuotesFromByteArray (byte [] quotedByteArray) {
if (quotedByteArray == null ||
quotedByteArray.length < 2 ||
quotedByteArray[0] != ParseConstants.SINGLE_QUOTE ||
quotedByteArray[quotedByteArray.length - 1] != ParseConstants.SINGLE_QUOTE) {
throw new IllegalArgumentException("removeQuotesFromByteArray needs a quoted byte array");
} else {
byte [] targetString = new byte [quotedByteArray.length - 2];
Bytes.putBytes(targetString, 0, quotedByteArray, 1, quotedByteArray.length - 2);
return targetString;
}
} | static byte [] function (byte [] quotedByteArray) { if (quotedByteArray == null quotedByteArray.length < 2 quotedByteArray[0] != ParseConstants.SINGLE_QUOTE quotedByteArray[quotedByteArray.length - 1] != ParseConstants.SINGLE_QUOTE) { throw new IllegalArgumentException(STR); } else { byte [] targetString = new byte [quotedByteArray.length - 2]; Bytes.putBytes(targetString, 0, quotedByteArray, 1, quotedByteArray.length - 2); return targetString; } } | /**
* Takes a quoted byte array and converts it into an unquoted byte array
* For example: given a byte array representing 'abc', it returns a
* byte array representing abc
* <p>
* @param quotedByteArray the quoted byte array
* @return Unquoted byte array
*/ | Takes a quoted byte array and converts it into an unquoted byte array For example: given a byte array representing 'abc', it returns a byte array representing abc | removeQuotesFromByteArray | {
"repo_name": "gustavoanatoly/hbase",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java",
"license": "apache-2.0",
"size": 35238
} | [
"org.apache.hadoop.hbase.util.Bytes"
] | import org.apache.hadoop.hbase.util.Bytes; | import org.apache.hadoop.hbase.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,795,900 |
ArtifactVersion getNewestUpdate( ArtifactVersion currentVersion, VersionRange versionRange,
boolean includeSnapshots ); | ArtifactVersion getNewestUpdate( ArtifactVersion currentVersion, VersionRange versionRange, boolean includeSnapshots ); | /**
* Returns the newest version newer than the specified current version, but within the the specified update scope or
* <code>null</code> if no such version exists.
*
* @param currentVersion the lower bound or <code>null</code> if the lower limit is unbounded.
* @param versionRange the version range to include.
* @param includeSnapshots <code>true</code> if snapshots are to be included.
* @return the newest version after currentVersion within the specified update scope or <code>null</code> if no
* version is available.
* @since 1.0-beta-1
*/ | Returns the newest version newer than the specified current version, but within the the specified update scope or <code>null</code> if no such version exists | getNewestUpdate | {
"repo_name": "prostagma/versions-maven-plugin",
"path": "src/main/java/org/codehaus/mojo/versions/api/VersionDetails.java",
"license": "apache-2.0",
"size": 28383
} | [
"org.apache.maven.artifact.versioning.ArtifactVersion",
"org.apache.maven.artifact.versioning.VersionRange"
] | import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.VersionRange; | import org.apache.maven.artifact.versioning.*; | [
"org.apache.maven"
] | org.apache.maven; | 878,187 |
public DrillSidewaysResult search(DrillDownQuery query, int topN) throws IOException {
return search(null, query, topN);
} | DrillSidewaysResult function(DrillDownQuery query, int topN) throws IOException { return search(null, query, topN); } | /**
* Search, sorting by score, and computing
* drill down and sideways counts.
*/ | Search, sorting by score, and computing drill down and sideways counts | search | {
"repo_name": "yintaoxue/read-open-source-code",
"path": "solr-4.7.2/src/org/apache/lucene/facet/DrillSideways.java",
"license": "apache-2.0",
"size": 10392
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 34,373 |
Builder addDynamicFrameworkImports(Iterable<Artifact> frameworkImports) {
this.dynamicFrameworkImports =
Iterables.concat(this.dynamicFrameworkImports, frameworkImports);
return this;
} | Builder addDynamicFrameworkImports(Iterable<Artifact> frameworkImports) { this.dynamicFrameworkImports = Iterables.concat(this.dynamicFrameworkImports, frameworkImports); return this; } | /**
* Adds all given artifacts as members of dynamic frameworks. They must be contained in
* {@code .frameworks} directories and the binary in that framework should be dynamically
* linked.
*/ | Adds all given artifacts as members of dynamic frameworks. They must be contained in .frameworks directories and the binary in that framework should be dynamically linked | addDynamicFrameworkImports | {
"repo_name": "zhexuany/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java",
"license": "apache-2.0",
"size": 33879
} | [
"com.google.common.collect.Iterables",
"com.google.devtools.build.lib.actions.Artifact"
] | import com.google.common.collect.Iterables; import com.google.devtools.build.lib.actions.Artifact; | import com.google.common.collect.*; import com.google.devtools.build.lib.actions.*; | [
"com.google.common",
"com.google.devtools"
] | com.google.common; com.google.devtools; | 2,391,086 |
public Element getChannelElement() {
return mChannelElement;
} | Element function() { return mChannelElement; } | /**
* Returns the {@link Element} for the {@code channel} tag.
*/ | Returns the <code>Element</code> for the channel tag | getChannelElement | {
"repo_name": "mrmook/libs-for-android",
"path": "demos/rss/src/com/google/android/demos/rss/content/RssContentHandler.java",
"license": "apache-2.0",
"size": 16353
} | [
"android.sax.Element"
] | import android.sax.Element; | import android.sax.*; | [
"android.sax"
] | android.sax; | 361,422 |
protected void createArtifactSerializers(
Map<String, ArtifactSerializer> serializers) {
if(this.toolFactory != null)
serializers.putAll(this.toolFactory.createArtifactSerializersMap());
} | void function( Map<String, ArtifactSerializer> serializers) { if(this.toolFactory != null) serializers.putAll(this.toolFactory.createArtifactSerializersMap()); } | /**
* Registers all {@link ArtifactSerializer} for their artifact file name extensions.
* The registered {@link ArtifactSerializer} are used to create and serialize
* resources in the model package.
*
* Override this method to register custom {@link ArtifactSerializer}s.
*
* Note:
* Subclasses should generally invoke super.createArtifactSerializers at the beginning
* of this method.
*
* This method is called during construction.
*
* @param serializers the key of the map is the file extension used to lookup
* the {@link ArtifactSerializer}.
*/ | Registers all <code>ArtifactSerializer</code> for their artifact file name extensions. The registered <code>ArtifactSerializer</code> are used to create and serialize resources in the model package. Override this method to register custom <code>ArtifactSerializer</code>s. Note: Subclasses should generally invoke super.createArtifactSerializers at the beginning of this method. This method is called during construction | createArtifactSerializers | {
"repo_name": "Eagles2F/opennlp",
"path": "opennlp-tools/src/main/java/opennlp/tools/util/model/BaseModel.java",
"license": "apache-2.0",
"size": 21277
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 499,596 |
public void setTagQueryTable(Hashtable<String, ArrayList<String>> tagQueryTable) {
this.mTagQueryTable = tagQueryTable;
} | void function(Hashtable<String, ArrayList<String>> tagQueryTable) { this.mTagQueryTable = tagQueryTable; } | /**
* Changes the hash table.
* @param tagQueryTable the substitute hash table.
*/ | Changes the hash table | setTagQueryTable | {
"repo_name": "yaa110/RestorableSQLiteDatabase",
"path": "library/src/main/java/com/github/yaa110/db/RestorableSQLiteDatabase.java",
"license": "mit",
"size": 29666
} | [
"java.util.ArrayList",
"java.util.Hashtable"
] | import java.util.ArrayList; import java.util.Hashtable; | import java.util.*; | [
"java.util"
] | java.util; | 844,997 |
public Future<V> getAsync(K key); | Future<V> function(K key); | /**
* look up a value asynchronously
*
* @param key
* key corresponding to value
* @return Future for value corresponding to key, future value null if key is not present
*
* */ | look up a value asynchronously | getAsync | {
"repo_name": "aruniyengar/storage-manager",
"path": "src/main/java/com/ibm/storage/storagemanager/interfaces/KeyValueAsync.java",
"license": "apache-2.0",
"size": 2764
} | [
"java.util.concurrent.Future"
] | import java.util.concurrent.Future; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 1,330,773 |
public synchronized void startPreview() {
Camera theCamera = camera;
if (theCamera != null && !previewing) {
theCamera.startPreview();
previewing = true;
autoFocusManager = new AutoFocusManager(context, camera);
}
} | synchronized void function() { Camera theCamera = camera; if (theCamera != null && !previewing) { theCamera.startPreview(); previewing = true; autoFocusManager = new AutoFocusManager(context, camera); } } | /**
* Asks the camera hardware to begin drawing preview frames to the screen.
*/ | Asks the camera hardware to begin drawing preview frames to the screen | startPreview | {
"repo_name": "jpush/jchat-android",
"path": "chatapp/src/main/java/jiguang/chat/utils/zxing/camera/CameraManager.java",
"license": "mit",
"size": 6437
} | [
"android.hardware.Camera"
] | import android.hardware.Camera; | import android.hardware.*; | [
"android.hardware"
] | android.hardware; | 2,423,045 |
public Observable<ServiceResponse<Page<BastionHostInner>>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
} | Observable<ServiceResponse<Page<BastionHostInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } | /**
* Lists all Bastion Hosts in a resource group.
*
ServiceResponse<PageImpl<BastionHostInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<BastionHostInner> object wrapped in {@link ServiceResponse} if successful.
*/ | Lists all Bastion Hosts in a resource group | listByResourceGroupNextSinglePageAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/BastionHostsInner.java",
"license": "mit",
"size": 53514
} | [
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 922,487 |
@Generated
@Selector("setTextureOrder:")
public native void setTextureOrder(NSArray<? extends GLKEffectPropertyTexture> value); | @Selector(STR) native void function(NSArray<? extends GLKEffectPropertyTexture> value); | /**
* texture2d0, texture2d1
*/ | texture2d0, texture2d1 | setTextureOrder | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/glkit/GLKBaseEffect.java",
"license": "apache-2.0",
"size": 8403
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 245,923 |
public static Object selectReminder(Connection conn, String eid)
throws ServiceException {
Object jobj = null;
PreparedStatement calPS = null;
try {
String query = null;
ResultSet rs = null;
KWLJsonConverter KWL = new KWLJsonConverter();
query = "select rtype,rtime from eventreminder where eid=?";
calPS = conn.prepareStatement(query);
calPS.setString(1, eid);
rs = calPS.executeQuery();
jobj = KWL.GetJsonForGrid(rs);
return jobj;
} catch (SQLException e) {
KrawlerLog.calendar.warn("calEvent.selectReminder:" + e);
throw ServiceException.FAILURE("calEvent.selectReminder:", e);
} finally {
DbPool.closeStatement(calPS);
}
} | static Object function(Connection conn, String eid) throws ServiceException { Object jobj = null; PreparedStatement calPS = null; try { String query = null; ResultSet rs = null; KWLJsonConverter KWL = new KWLJsonConverter(); query = STR; calPS = conn.prepareStatement(query); calPS.setString(1, eid); rs = calPS.executeQuery(); jobj = KWL.GetJsonForGrid(rs); return jobj; } catch (SQLException e) { KrawlerLog.calendar.warn(STR + e); throw ServiceException.FAILURE(STR, e); } finally { DbPool.closeStatement(calPS); } } | /**
* To fetch the reminder details
* @param conn connection object used for performing database operations
* @param eid id of the event of which the reminder is to be fetched
* @return object containing the rtype and the rtime of the reminder
* @throws ServiceException is used to handle all the exceptions thrown internally.
*/ | To fetch the reminder details | selectReminder | {
"repo_name": "agilee/Deskera-Project-Management",
"path": "src/java/com/krawler/esp/handlers/calEvent.java",
"license": "gpl-3.0",
"size": 57726
} | [
"com.krawler.common.service.ServiceException",
"com.krawler.common.util.KrawlerLog",
"com.krawler.database.DbPool",
"com.krawler.utils.json.KWLJsonConverter",
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException"
] | import com.krawler.common.service.ServiceException; import com.krawler.common.util.KrawlerLog; import com.krawler.database.DbPool; import com.krawler.utils.json.KWLJsonConverter; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; | import com.krawler.common.service.*; import com.krawler.common.util.*; import com.krawler.database.*; import com.krawler.utils.json.*; import java.sql.*; | [
"com.krawler.common",
"com.krawler.database",
"com.krawler.utils",
"java.sql"
] | com.krawler.common; com.krawler.database; com.krawler.utils; java.sql; | 593,597 |
public static void computeTypeEnvironmentBottomUp(ILogicalOperator op, IOptimizationContext context)
throws AlgebricksException {
for (Mutable<ILogicalOperator> children : op.getInputs()) {
computeTypeEnvironmentBottomUp(children.getValue(), context);
}
context.computeAndSetTypeEnvironmentForOperator(op);
} | static void function(ILogicalOperator op, IOptimizationContext context) throws AlgebricksException { for (Mutable<ILogicalOperator> children : op.getInputs()) { computeTypeEnvironmentBottomUp(children.getValue(), context); } context.computeAndSetTypeEnvironmentForOperator(op); } | /**
* Compute type environment of a newly generated operator {@code op} and its input.
*
* @param op,
* the logical operator.
* @param context,the
* optimization context.
* @throws AlgebricksException
*/ | Compute type environment of a newly generated operator op and its input | computeTypeEnvironmentBottomUp | {
"repo_name": "waans11/incubator-asterixdb-hyracks",
"path": "algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/util/OperatorManipulationUtil.java",
"license": "apache-2.0",
"size": 11990
} | [
"org.apache.commons.lang3.mutable.Mutable",
"org.apache.hyracks.algebricks.common.exceptions.AlgebricksException",
"org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator",
"org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext"
] | import org.apache.commons.lang3.mutable.Mutable; import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException; import org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator; import org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext; | import org.apache.commons.lang3.mutable.*; import org.apache.hyracks.algebricks.common.exceptions.*; import org.apache.hyracks.algebricks.core.algebra.base.*; | [
"org.apache.commons",
"org.apache.hyracks"
] | org.apache.commons; org.apache.hyracks; | 1,832,888 |
public static Iterator nonReferenceWrapperClasses() {
return wrapperClasses(nonReferencePrimitiveWrapperPairs());
}
// ********** member classes **********
private static class PrimitiveWrapperPair {
private Class primitiveClass;
private Class wrapperClass;
PrimitiveWrapperPair(Class primitiveClass, Class wrapperClass) {
super();
this.primitiveClass = primitiveClass;
this.wrapperClass = wrapperClass;
} | static Iterator function() { return wrapperClasses(nonReferencePrimitiveWrapperPairs()); } private static class PrimitiveWrapperPair { private Class primitiveClass; private Class wrapperClass; PrimitiveWrapperPair(Class primitiveClass, Class wrapperClass) { super(); this.primitiveClass = primitiveClass; this.wrapperClass = wrapperClass; } | /**
* return the Java non-reference wrapper classes;
* this includes the primitive wrappers and the void "wrapper"
* (e.g. java.lang.Integer, java.lang.Character, java.lang.Void)
*/ | return the Java non-reference wrapper classes; this includes the primitive wrappers and the void "wrapper" (e.g. java.lang.Integer, java.lang.Character, java.lang.Void) | nonReferenceWrapperClasses | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "utils/eclipselink.utils.workbench/mappingsmodel/source/org/eclipse/persistence/tools/workbench/mappingsmodel/meta/MWClass.java",
"license": "epl-1.0",
"size": 121989
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 122 |
@Override
public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5){
return 0;
} | int function(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5){ return 0; } | /**
* Returns true if the block is emitting direct/strong redstone power on the
* specified side. Args: World, X, Y, Z, side. Note that the side is
* reversed - eg it is 1 (up) when checking the bottom of the block.
*/ | Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block | isProvidingStrongPower | {
"repo_name": "Mazdallier/PneumaticCraft",
"path": "src/pneumaticCraft/common/block/BlockChargingStation.java",
"license": "gpl-3.0",
"size": 3033
} | [
"net.minecraft.world.IBlockAccess"
] | import net.minecraft.world.IBlockAccess; | import net.minecraft.world.*; | [
"net.minecraft.world"
] | net.minecraft.world; | 1,980,666 |
List<Member> getMembersByUsers(PerunSession sess, List<User> users, Vo vo); | List<Member> getMembersByUsers(PerunSession sess, List<User> users, Vo vo); | /**
* Convert list of users into the list of members.
*
* @param sess
* @param users
* @param vo
* @return list of members
* @throws InternalErrorException
*/ | Convert list of users into the list of members | getMembersByUsers | {
"repo_name": "balcirakpeter/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/MembersManagerBl.java",
"license": "bsd-2-clause",
"size": 74930
} | [
"cz.metacentrum.perun.core.api.Member",
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.User",
"cz.metacentrum.perun.core.api.Vo",
"java.util.List"
] | import cz.metacentrum.perun.core.api.Member; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.User; import cz.metacentrum.perun.core.api.Vo; import java.util.List; | import cz.metacentrum.perun.core.api.*; import java.util.*; | [
"cz.metacentrum.perun",
"java.util"
] | cz.metacentrum.perun; java.util; | 1,151,317 |
public static void openShareDialog(Context context, String title, @SuppressWarnings("SameParameterValue") String uri, String shareText, String shareSubject) {
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("text/plain");
share.putExtra(Intent.EXTRA_TEXT, shareText);
share.putExtra(Intent.EXTRA_SUBJECT, shareSubject);
if (!TextUtils.isEmpty(uri)) {
share.setType("image/*");
share.putExtra(Intent.EXTRA_STREAM, Uri.parse(uri));
}
context.startActivity(Intent.createChooser(share, title));
} | static void function(Context context, String title, @SuppressWarnings(STR) String uri, String shareText, String shareSubject) { Intent share = new Intent(Intent.ACTION_SEND); share.setType(STR); share.putExtra(Intent.EXTRA_TEXT, shareText); share.putExtra(Intent.EXTRA_SUBJECT, shareSubject); if (!TextUtils.isEmpty(uri)) { share.setType(STR); share.putExtra(Intent.EXTRA_STREAM, Uri.parse(uri)); } context.startActivity(Intent.createChooser(share, title)); } | /**
* Opens android share dialog pass one of uri or shareText
*
* @param context
* @param title
* @param uri
* @param shareText
*/ | Opens android share dialog pass one of uri or shareText | openShareDialog | {
"repo_name": "CommonUtils/android",
"path": "common-task/src/main/java/com/common/utils/Common.java",
"license": "mit",
"size": 71901
} | [
"android.content.Context",
"android.content.Intent",
"android.net.Uri",
"android.text.TextUtils"
] | import android.content.Context; import android.content.Intent; import android.net.Uri; import android.text.TextUtils; | import android.content.*; import android.net.*; import android.text.*; | [
"android.content",
"android.net",
"android.text"
] | android.content; android.net; android.text; | 447,265 |
default Slice getSlice(int position, int offset, int length)
{
throw new UnsupportedOperationException(getClass().getName());
} | default Slice getSlice(int position, int offset, int length) { throw new UnsupportedOperationException(getClass().getName()); } | /**
* Gets a slice at {@code offset} in the value at {@code position}.
*/ | Gets a slice at offset in the value at position | getSlice | {
"repo_name": "bloomberg/presto",
"path": "presto-spi/src/main/java/com/facebook/presto/spi/block/Block.java",
"license": "apache-2.0",
"size": 7826
} | [
"io.airlift.slice.Slice"
] | import io.airlift.slice.Slice; | import io.airlift.slice.*; | [
"io.airlift.slice"
] | io.airlift.slice; | 154,435 |
public void setRegistrationAmount(KualiDecimal registrationAmount) {
this.registrationAmount = registrationAmount;
} | void function(KualiDecimal registrationAmount) { this.registrationAmount = registrationAmount; } | /**
* Sets the registrationAmount attribute value.
* @param registrationAmount The registrationAmount to set.
*/ | Sets the registrationAmount attribute value | setRegistrationAmount | {
"repo_name": "bhutchinson/kfs",
"path": "kfs-tem/src/main/java/org/kuali/kfs/module/tem/businessobject/AgencyStagingData.java",
"license": "agpl-3.0",
"size": 52782
} | [
"org.kuali.rice.core.api.util.type.KualiDecimal"
] | import org.kuali.rice.core.api.util.type.KualiDecimal; | import org.kuali.rice.core.api.util.type.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 2,056,285 |
@Test
public void testSLRemoteCMTBusinessMethod() throws Exception {
String testStr = "Test string.";
String buf = fejb2.method1(testStr);
assertEquals("Method call (method1) test returned unexpected value.", buf, testStr);
} | void function() throws Exception { String testStr = STR; String buf = fejb2.method1(testStr); assertEquals(STR, buf, testStr); } | /**
* (iia09) Test Stateless CMT business method.
*/ | (iia09) Test Stateless CMT business method | testSLRemoteCMTBusinessMethod | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.ejbcontainer.legacy_fat/test-applications/EJB2XRemoteSpecWeb.war/src/com/ibm/ejb2x/base/spec/slr/web/SLRemoteImplLifecycleMethodServlet.java",
"license": "epl-1.0",
"size": 10786
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,235,793 |
@Override
public ArtifactContainer createContainer(File cacheDir, Object containerData) {
if ( !(containerData instanceof File) ) {
return null;
}
File fileContainerData = (File) containerData;
if ( !isFile(fileContainerData) ) {
return null;
}
if ( !isCustomContainer( fileContainerData.getName() ) ) {
return null;
}
Properties properties = load(fileContainerData);
if ( properties == null ) {
return null;
}
return new CustomContainer(properties);
} | ArtifactContainer function(File cacheDir, Object containerData) { if ( !(containerData instanceof File) ) { return null; } File fileContainerData = (File) containerData; if ( !isFile(fileContainerData) ) { return null; } if ( !isCustomContainer( fileContainerData.getName() ) ) { return null; } Properties properties = load(fileContainerData); if ( properties == null ) { return null; } return new CustomContainer(properties); } | /**
* Attempt to create a custom container.
*
* The container data must be a file, which must exist, which must
* have the custom file extension, and must load as a properties file.
*/ | Attempt to create a custom container. The container data must be a file, which must exist, which must have the custom file extension, and must load as a properties file | createContainer | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.artifact_fat_bvt/test-bundles/FATArtifactBVT/src/com/ibm/ws/artifact/fat_bvt/bundle/custom/CustomContainerFactory.java",
"license": "epl-1.0",
"size": 4335
} | [
"com.ibm.wsspi.artifact.ArtifactContainer",
"java.io.File",
"java.util.Properties"
] | import com.ibm.wsspi.artifact.ArtifactContainer; import java.io.File; import java.util.Properties; | import com.ibm.wsspi.artifact.*; import java.io.*; import java.util.*; | [
"com.ibm.wsspi",
"java.io",
"java.util"
] | com.ibm.wsspi; java.io; java.util; | 144,552 |
private void checkForListItems(CommonModel defModel, String text, IRegion region)
{
try
{
SegmentObject segment = textContainslistKeyWord(text);
if (segment != null)
{
int offset = region.getOffset();
int length = -1;
SegmentObject tempSegment = segment;
while ((tempSegment != null) && fLine < fLineCount)
{
int lengthTemp = -1;
region = fDocument.getLineInformation(fLine);
text = fDocument.get(region.getOffset(), region.getLength());
if (text.trim().length() > 0 && !text.startsWith("#")) lengthTemp = text.trim().length();
if (tempSegment.getType().toLowerCase().startsWith("define")) defines
.addSegment(new ListSegment(defModel, tempSegment.getName(), region.getOffset(),
lengthTemp, ListSegment.DEFINE));
else if (tempSegment.getType().toLowerCase().startsWith("file")) files
.addSegment(new ListSegment(defModel, tempSegment.getName(), region.getOffset(),
lengthTemp, ListSegment.FILE));
else if (tempSegment.getType().toLowerCase().endsWith("include")) files
.addSegment(new ListSegment(defModel, tempSegment.getName(), region.getOffset(),
lengthTemp, ListSegment.INCLUDE));
fLine++;
region = fDocument.getLineInformation(fLine);
text = fDocument.get(region.getOffset(), region.getLength());
if (text.trim().length() > 0 && !text.startsWith("#")) length = region.getOffset()
+ region.getLength() - offset;
tempSegment = textContainslistKeyWord(text);
}
defModel
.addIgnoreOutlinePageElement(new de.tudresden.ias.eclipse.dlabpro.editors.def.model.ListItem(
defModel, segment.getType(), offset, length));
}
}
catch (BadLocationException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
| void function(CommonModel defModel, String text, IRegion region) { try { SegmentObject segment = textContainslistKeyWord(text); if (segment != null) { int offset = region.getOffset(); int length = -1; SegmentObject tempSegment = segment; while ((tempSegment != null) && fLine < fLineCount) { int lengthTemp = -1; region = fDocument.getLineInformation(fLine); text = fDocument.get(region.getOffset(), region.getLength()); if (text.trim().length() > 0 && !text.startsWith("#")) lengthTemp = text.trim().length(); if (tempSegment.getType().toLowerCase().startsWith(STR)) defines .addSegment(new ListSegment(defModel, tempSegment.getName(), region.getOffset(), lengthTemp, ListSegment.DEFINE)); else if (tempSegment.getType().toLowerCase().startsWith("file")) files .addSegment(new ListSegment(defModel, tempSegment.getName(), region.getOffset(), lengthTemp, ListSegment.FILE)); else if (tempSegment.getType().toLowerCase().endsWith(STR)) files .addSegment(new ListSegment(defModel, tempSegment.getName(), region.getOffset(), lengthTemp, ListSegment.INCLUDE)); fLine++; region = fDocument.getLineInformation(fLine); text = fDocument.get(region.getOffset(), region.getLength()); if (text.trim().length() > 0 && !text.startsWith("#")) length = region.getOffset() + region.getLength() - offset; tempSegment = textContainslistKeyWord(text); } defModel .addIgnoreOutlinePageElement(new de.tudresden.ias.eclipse.dlabpro.editors.def.model.ListItem( defModel, segment.getType(), offset, length)); } } catch (BadLocationException e) { e.printStackTrace(); } } | /**
* is called to parse the given text for list items
*
* @param defModel -
* the model to add elements to
* @param text -
* the text to parse
* @param region -
* the current line region
*/ | is called to parse the given text for list items | checkForListItems | {
"repo_name": "matthias-wolff/dLabPro-Plugin",
"path": "Plugin/src/de/tudresden/ias/eclipse/dlabpro/editors/def/model/DefParser.java",
"license": "lgpl-3.0",
"size": 20902
} | [
"de.tudresden.ias.eclipse.dlabpro.editors.CommonModel",
"org.eclipse.jface.text.BadLocationException",
"org.eclipse.jface.text.IRegion"
] | import de.tudresden.ias.eclipse.dlabpro.editors.CommonModel; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IRegion; | import de.tudresden.ias.eclipse.dlabpro.editors.*; import org.eclipse.jface.text.*; | [
"de.tudresden.ias",
"org.eclipse.jface"
] | de.tudresden.ias; org.eclipse.jface; | 170,507 |
@Override
public final ContentChannel handleRequest(Request request, ResponseHandler responseHandler) {
HandlerMetricContextUtil.onHandle(request, metric, getClass());
if (request.getTimeout(TimeUnit.SECONDS) == null) {
Duration timeout = getTimeout();
if (timeout != null) {
request.setTimeout(timeout.getSeconds(), TimeUnit.SECONDS);
}
}
BufferedContentChannel content = new BufferedContentChannel();
RequestTask command = new RequestTask(request, content, responseHandler);
try {
executor.execute(command);
} catch (RejectedExecutionException e) {
command.failOnOverload();
throw new OverloadException("No available threads for " + getClass().getSimpleName(), e);
} finally {
logRejectedRequests();
}
return content;
}
protected Optional<Request.RequestType> getRequestType() { return Optional.empty(); } | final ContentChannel function(Request request, ResponseHandler responseHandler) { HandlerMetricContextUtil.onHandle(request, metric, getClass()); if (request.getTimeout(TimeUnit.SECONDS) == null) { Duration timeout = getTimeout(); if (timeout != null) { request.setTimeout(timeout.getSeconds(), TimeUnit.SECONDS); } } BufferedContentChannel content = new BufferedContentChannel(); RequestTask command = new RequestTask(request, content, responseHandler); try { executor.execute(command); } catch (RejectedExecutionException e) { command.failOnOverload(); throw new OverloadException(STR + getClass().getSimpleName(), e); } finally { logRejectedRequests(); } return content; } protected Optional<Request.RequestType> getRequestType() { return Optional.empty(); } | /**
* Handles a request by assigning a worker thread to it.
*
* @throws OverloadException if thread pool has no available thread
*/ | Handles a request by assigning a worker thread to it | handleRequest | {
"repo_name": "vespa-engine/vespa",
"path": "container-core/src/main/java/com/yahoo/container/jdisc/ThreadedRequestHandler.java",
"license": "apache-2.0",
"size": 10939
} | [
"com.yahoo.container.core.HandlerMetricContextUtil",
"com.yahoo.jdisc.Request",
"com.yahoo.jdisc.handler.BufferedContentChannel",
"com.yahoo.jdisc.handler.ContentChannel",
"com.yahoo.jdisc.handler.OverloadException",
"com.yahoo.jdisc.handler.ResponseHandler",
"java.time.Duration",
"java.util.Optional",
"java.util.concurrent.RejectedExecutionException",
"java.util.concurrent.TimeUnit"
] | import com.yahoo.container.core.HandlerMetricContextUtil; import com.yahoo.jdisc.Request; import com.yahoo.jdisc.handler.BufferedContentChannel; import com.yahoo.jdisc.handler.ContentChannel; import com.yahoo.jdisc.handler.OverloadException; import com.yahoo.jdisc.handler.ResponseHandler; import java.time.Duration; import java.util.Optional; import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.TimeUnit; | import com.yahoo.container.core.*; import com.yahoo.jdisc.*; import com.yahoo.jdisc.handler.*; import java.time.*; import java.util.*; import java.util.concurrent.*; | [
"com.yahoo.container",
"com.yahoo.jdisc",
"java.time",
"java.util"
] | com.yahoo.container; com.yahoo.jdisc; java.time; java.util; | 2,499,490 |
public Vector<String> getSetNames()
{
Vector<String> names = new Vector<String>();
names.addAll(SheetNames);
return names;
} | Vector<String> function() { Vector<String> names = new Vector<String>(); names.addAll(SheetNames); return names; } | /**
* Get the names of the Sheets represented in this DataSet
* @return a {@link Vector} of Strings with the names of the Sheets in this DataSet
*/ | Get the names of the Sheets represented in this DataSet | getSetNames | {
"repo_name": "sysbiolux/IDARE",
"path": "METANODE-CREATOR/src/main/java/idare/imagenode/Data/BasicDataTypes/MultiArrayData/MultiArrayDataSet.java",
"license": "lgpl-3.0",
"size": 19611
} | [
"java.util.Vector"
] | import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 2,645,947 |
public void testCode() throws Exception {
// look up the component factory
final IComponentFactory factory = lookup(IComponentFactory.class);
// create the execution config
final MavenSession session = this.createSimpleSession("exec/empty-pom");
final IPhpExecutableConfiguration execConfig = factory.lookup(
IPhpExecutableConfiguration.class,
IComponentFactory.EMPTY_CONFIG,
session);
// assert that the environment variable is mapped correctly
final IPhpExecutable exec = execConfig.getPhpExecutable();
final String output = exec.executeCode("", "echo 'FOO';");
assertEquals("FOO\n", output);
} | void function() throws Exception { final IComponentFactory factory = lookup(IComponentFactory.class); final MavenSession session = this.createSimpleSession(STR); final IPhpExecutableConfiguration execConfig = factory.lookup( IPhpExecutableConfiguration.class, IComponentFactory.EMPTY_CONFIG, session); final IPhpExecutable exec = execConfig.getPhpExecutable(); final String output = exec.executeCode(STRecho 'FOO';STRFOO\n", output); } | /**
* Tests if the execution configuration can be created.
*
* @throws Exception thrown on errors
*/ | Tests if the execution configuration can be created | testCode | {
"repo_name": "teosoft123/maven-php-plugin",
"path": "maven-plugins/maven-php-exec/src/test/java/org/phpmaven/php/test/ExecTest.java",
"license": "apache-2.0",
"size": 5439
} | [
"org.apache.maven.execution.MavenSession",
"org.phpmaven.core.IComponentFactory",
"org.phpmaven.exec.IPhpExecutableConfiguration",
"org.phpmaven.phpexec.library.IPhpExecutable"
] | import org.apache.maven.execution.MavenSession; import org.phpmaven.core.IComponentFactory; import org.phpmaven.exec.IPhpExecutableConfiguration; import org.phpmaven.phpexec.library.IPhpExecutable; | import org.apache.maven.execution.*; import org.phpmaven.core.*; import org.phpmaven.exec.*; import org.phpmaven.phpexec.library.*; | [
"org.apache.maven",
"org.phpmaven.core",
"org.phpmaven.exec",
"org.phpmaven.phpexec"
] | org.apache.maven; org.phpmaven.core; org.phpmaven.exec; org.phpmaven.phpexec; | 174,949 |
try {
return load(new ConfigFile(path));
}
catch (IOException e) {
throw new LoaderException("Error reading file", e);
}
} | try { return load(new ConfigFile(path)); } catch (IOException e) { throw new LoaderException(STR, e); } } | /**
* Loads map from given path.
*
* @param path map file's path.
* @return 2D boolean array representing map - free cells are
* donated by <tt>false</tt> values, and walls by
* <tt>true</tt>.
* @throws LoaderException if file could not be read or it has
* invalid format.
*/ | Loads map from given path | load | {
"repo_name": "mina86/snake",
"path": "com/mina86/snake/MapLoader.java",
"license": "gpl-3.0",
"size": 5778
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 735,657 |
public Paint getDefaultPaint() {
return this.defaultPaint;
}
| Paint function() { return this.defaultPaint; } | /**
* Returns the default paint (never <code>null</code>).
*
* @return The default paint.
*/ | Returns the default paint (never <code>null</code>) | getDefaultPaint | {
"repo_name": "fluidware/Eastwood-Charts",
"path": "source/org/jfree/chart/renderer/LookupPaintScale.java",
"license": "lgpl-2.1",
"size": 11956
} | [
"java.awt.Paint"
] | import java.awt.Paint; | import java.awt.*; | [
"java.awt"
] | java.awt; | 427,374 |
public static String extractTableIdFromSql(String sql){
ValidateArgument.required(sql, "SQL string");
try {
return new TableQueryParser(sql).querySpecification().getSingleTableName().orElseThrow(TableConstants.JOIN_NOT_SUPPORTED_IN_THIS_CONTEXT);
} catch (TokenMgrError e) {
throw new IllegalArgumentException("The provided SQL query could not be parsed.",e);
}catch (ParseException e) {
throw new IllegalArgumentException(e.getMessage() + TableExceptionTranslator.UNQUOTED_KEYWORDS_ERROR_MESSAGE, e);
}
}
| static String function(String sql){ ValidateArgument.required(sql, STR); try { return new TableQueryParser(sql).querySpecification().getSingleTableName().orElseThrow(TableConstants.JOIN_NOT_SUPPORTED_IN_THIS_CONTEXT); } catch (TokenMgrError e) { throw new IllegalArgumentException(STR,e); }catch (ParseException e) { throw new IllegalArgumentException(e.getMessage() + TableExceptionTranslator.UNQUOTED_KEYWORDS_ERROR_MESSAGE, e); } } | /**
* Helper to determine the tableId from the SQL.
* @param sql
* @return
*/ | Helper to determine the tableId from the SQL | extractTableIdFromSql | {
"repo_name": "Sage-Bionetworks/Synapse-Repository-Services",
"path": "services/repository-managers/src/main/java/org/sagebionetworks/repo/manager/table/TableQueryUtils.java",
"license": "apache-2.0",
"size": 4767
} | [
"org.sagebionetworks.repo.model.dbo.dao.table.TableExceptionTranslator",
"org.sagebionetworks.repo.model.table.TableConstants",
"org.sagebionetworks.table.query.ParseException",
"org.sagebionetworks.table.query.TableQueryParser",
"org.sagebionetworks.table.query.TokenMgrError",
"org.sagebionetworks.util.ValidateArgument"
] | import org.sagebionetworks.repo.model.dbo.dao.table.TableExceptionTranslator; import org.sagebionetworks.repo.model.table.TableConstants; import org.sagebionetworks.table.query.ParseException; import org.sagebionetworks.table.query.TableQueryParser; import org.sagebionetworks.table.query.TokenMgrError; import org.sagebionetworks.util.ValidateArgument; | import org.sagebionetworks.repo.model.dbo.dao.table.*; import org.sagebionetworks.repo.model.table.*; import org.sagebionetworks.table.query.*; import org.sagebionetworks.util.*; | [
"org.sagebionetworks.repo",
"org.sagebionetworks.table",
"org.sagebionetworks.util"
] | org.sagebionetworks.repo; org.sagebionetworks.table; org.sagebionetworks.util; | 530,555 |
@Restricted(NoExternalUse.class)
public final String getLongDescription() {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try (PrintStream ps = new PrintStream(out)) {
printUsageSummary(ps);
}
return out.toString();
} | @Restricted(NoExternalUse.class) final String function() { ByteArrayOutputStream out = new ByteArrayOutputStream(); try (PrintStream ps = new PrintStream(out)) { printUsageSummary(ps); } return out.toString(); } | /**
* Get long description as a string.
*/ | Get long description as a string | getLongDescription | {
"repo_name": "ErikVerheul/jenkins",
"path": "core/src/main/java/hudson/cli/CLICommand.java",
"license": "mit",
"size": 26170
} | [
"java.io.ByteArrayOutputStream",
"java.io.PrintStream",
"org.kohsuke.accmod.Restricted",
"org.kohsuke.accmod.restrictions.NoExternalUse"
] | import java.io.ByteArrayOutputStream; import java.io.PrintStream; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; | import java.io.*; import org.kohsuke.accmod.*; import org.kohsuke.accmod.restrictions.*; | [
"java.io",
"org.kohsuke.accmod"
] | java.io; org.kohsuke.accmod; | 2,117,595 |
String getCookieRememberMeTaskticketKey();
public static class SimpleImpl extends TaskticketEnv.SimpleImpl implements TaskticketConfig {
private static final long serialVersionUID = 1L; | String getCookieRememberMeTaskticketKey(); public static class SimpleImpl extends TaskticketEnv.SimpleImpl implements TaskticketConfig { private static final long serialVersionUID = 1L; | /**
* Get the value for the key 'cookie.remember.me.taskticket.key'. <br>
* The value is, e.g. TASKKEY <br>
* comment: The cookie key of remember-me for Taskticket
* @return The value of found property. (NotNull: if not found, exception but basically no way)
*/ | Get the value for the key 'cookie.remember.me.taskticket.key'. The value is, e.g. TASKKEY comment: The cookie key of remember-me for Taskticket | getCookieRememberMeTaskticketKey | {
"repo_name": "EgumaYuto/taskticket",
"path": "src/main/java/io/github/yutoeguma/mylasta/direction/TaskticketConfig.java",
"license": "apache-2.0",
"size": 8366
} | [
"io.github.yutoeguma.mylasta.direction.TaskticketEnv"
] | import io.github.yutoeguma.mylasta.direction.TaskticketEnv; | import io.github.yutoeguma.mylasta.direction.*; | [
"io.github.yutoeguma"
] | io.github.yutoeguma; | 2,392,755 |
void exitWhileStatementNoShortIf(@NotNull Java8Parser.WhileStatementNoShortIfContext ctx); | void exitWhileStatementNoShortIf(@NotNull Java8Parser.WhileStatementNoShortIfContext ctx); | /**
* Exit a parse tree produced by {@link Java8Parser#whileStatementNoShortIf}.
*
* @param ctx the parse tree
*/ | Exit a parse tree produced by <code>Java8Parser#whileStatementNoShortIf</code> | exitWhileStatementNoShortIf | {
"repo_name": "BigDaddy-Germany/WHOAMI",
"path": "WHOAMI/src/de/aima13/whoami/modules/syntaxcheck/languages/antlrgen/Java8Listener.java",
"license": "mit",
"size": 97945
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 100,349 |
public static Vector3f inverse(Vector3f value) {
return new Vector3f(
1 / (value.x != 0 ? value.x : 1),
1 / (value.y != 0 ? value.y : 1),
1 / (value.z != 0 ? value.z : 1)
);
}
| static Vector3f function(Vector3f value) { return new Vector3f( 1 / (value.x != 0 ? value.x : 1), 1 / (value.y != 0 ? value.y : 1), 1 / (value.z != 0 ? value.z : 1) ); } | /**
* Multiplicative Inverse of a Vector.
* @param value
* @return
*/ | Multiplicative Inverse of a Vector | inverse | {
"repo_name": "AscariaQuynn/ZoneOfUprising",
"path": "src/cz/ascaria/zoneofuprising/utils/Vector3fHelper.java",
"license": "bsd-3-clause",
"size": 3526
} | [
"com.jme3.math.Vector3f"
] | import com.jme3.math.Vector3f; | import com.jme3.math.*; | [
"com.jme3.math"
] | com.jme3.math; | 462,395 |
@Nonnull
Collection<Visibility> listAllVisibilityOptions(); | Collection<Visibility> listAllVisibilityOptions(); | /**
* Get all visibility options available in the platform, including {@link Visibility#isDisabled() disabled} ones.
*
* @return a collection of visibilities, may be empty if none are available
*/ | Get all visibility options available in the platform, including <code>Visibility#isDisabled() disabled</code> ones | listAllVisibilityOptions | {
"repo_name": "teyden/phenotips",
"path": "components/entity-access-rules/api/src/main/java/org/phenotips/data/permissions/EntityPermissionsManager.java",
"license": "agpl-3.0",
"size": 5951
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 756,500 |
public ServiceCorsConfigurationInfo withOrigins(List<String> origins) {
this.origins = origins;
return this;
} | ServiceCorsConfigurationInfo function(List<String> origins) { this.origins = origins; return this; } | /**
* Set the origins property: The origins to be allowed via CORS.
*
* @param origins the origins value to set.
* @return the ServiceCorsConfigurationInfo object itself.
*/ | Set the origins property: The origins to be allowed via CORS | withOrigins | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/models/ServiceCorsConfigurationInfo.java",
"license": "mit",
"size": 4252
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,423,027 |
protected String jmxInvoke(MBeanServerConnection jmxServerConnection, String name) throws Exception {
Object result ;
if (args == null) {
result = jmxServerConnection.invoke(new ObjectName(name),
operation, null, null);
} else {
Object argsA[]=new Object[ args.size()];
String sigA[]=new String[args.size()];
for( int i=0; i<args.size(); i++ ) {
Arg arg=args.get(i);
if (arg.getType() == null) {
arg.setType("java.lang.String");
sigA[i]=arg.getType();
argsA[i]=arg.getValue();
} else {
sigA[i]=arg.getType();
argsA[i]=convertStringToType(arg.getValue(),arg.getType());
}
}
result = jmxServerConnection.invoke(new ObjectName(name), operation, argsA, sigA);
}
if(result != null) {
echoResult(operation,result);
createProperty(result);
}
return null;
} | String function(MBeanServerConnection jmxServerConnection, String name) throws Exception { Object result ; if (args == null) { result = jmxServerConnection.invoke(new ObjectName(name), operation, null, null); } else { Object argsA[]=new Object[ args.size()]; String sigA[]=new String[args.size()]; for( int i=0; i<args.size(); i++ ) { Arg arg=args.get(i); if (arg.getType() == null) { arg.setType(STR); sigA[i]=arg.getType(); argsA[i]=arg.getValue(); } else { sigA[i]=arg.getType(); argsA[i]=convertStringToType(arg.getValue(),arg.getType()); } } result = jmxServerConnection.invoke(new ObjectName(name), operation, argsA, sigA); } if(result != null) { echoResult(operation,result); createProperty(result); } return null; } | /**
* Invoke specified operation.
*
* @param jmxServerConnection Connection to the JMX server
* @param name The MBean name
* @return null (no error message to report other than exception)
* @throws Exception An error occurred
*/ | Invoke specified operation | jmxInvoke | {
"repo_name": "apache/tomcat",
"path": "java/org/apache/catalina/ant/jmx/JMXAccessorInvokeTask.java",
"license": "apache-2.0",
"size": 5647
} | [
"javax.management.MBeanServerConnection",
"javax.management.ObjectName"
] | import javax.management.MBeanServerConnection; import javax.management.ObjectName; | import javax.management.*; | [
"javax.management"
] | javax.management; | 176,994 |
public static MozuClient<com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult> addValidationResultClient(com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult validationResult, String orderId) throws Exception
{
return addValidationResultClient( validationResult, orderId, null);
} | static MozuClient<com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult> function(com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult validationResult, String orderId) throws Exception { return addValidationResultClient( validationResult, orderId, null); } | /**
* Add a new order validation result to a submitted order.
* <p><pre><code>
* MozuClient<com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult> mozuClient=AddValidationResultClient( validationResult, orderId);
* client.setBaseAddress(url);
* client.executeRequest();
* OrderValidationResult orderValidationResult = client.Result();
* </code></pre></p>
* @param orderId Unique identifier of the order.
* @param validationResult Properties of the resulting order validation performed by an order validation capability.
* @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult>
* @see com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult
* @see com.mozu.api.contracts.commerceruntime.orders.OrderValidationResult
*/ | Add a new order validation result to a submitted order. <code><code> MozuClient mozuClient=AddValidationResultClient( validationResult, orderId); client.setBaseAddress(url); client.executeRequest(); OrderValidationResult orderValidationResult = client.Result(); </code></code> | addValidationResultClient | {
"repo_name": "sanjaymandadi/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/clients/commerce/orders/OrderValidationResultClient.java",
"license": "mit",
"size": 4956
} | [
"com.mozu.api.MozuClient"
] | import com.mozu.api.MozuClient; | import com.mozu.api.*; | [
"com.mozu.api"
] | com.mozu.api; | 2,380,420 |
@Override
public void evaluate(RDFHandler resultHandler) throws QueryEvaluationException, RDFHandlerException {
GraphQueryResult queryResult = evaluate();
if(queryResult.hasNext())
{
QueryResults.report(queryResult, resultHandler);
}
} | void function(RDFHandler resultHandler) throws QueryEvaluationException, RDFHandlerException { GraphQueryResult queryResult = evaluate(); if(queryResult.hasNext()) { QueryResults.report(queryResult, resultHandler); } } | /**
* evaluate graph query with RDFHandler
*
* @param resultHandler
* @throws QueryEvaluationException
* @throws RDFHandlerException
*/ | evaluate graph query with RDFHandler | evaluate | {
"repo_name": "akshaysonvane/marklogic-rdf4j",
"path": "marklogic-rdf4j/src/main/java/com/marklogic/semantics/rdf4j/query/MarkLogicGraphQuery.java",
"license": "apache-2.0",
"size": 3402
} | [
"org.eclipse.rdf4j.query.GraphQueryResult",
"org.eclipse.rdf4j.query.QueryEvaluationException",
"org.eclipse.rdf4j.query.QueryResults",
"org.eclipse.rdf4j.rio.RDFHandler",
"org.eclipse.rdf4j.rio.RDFHandlerException"
] | import org.eclipse.rdf4j.query.GraphQueryResult; import org.eclipse.rdf4j.query.QueryEvaluationException; import org.eclipse.rdf4j.query.QueryResults; import org.eclipse.rdf4j.rio.RDFHandler; import org.eclipse.rdf4j.rio.RDFHandlerException; | import org.eclipse.rdf4j.query.*; import org.eclipse.rdf4j.rio.*; | [
"org.eclipse.rdf4j"
] | org.eclipse.rdf4j; | 471,938 |
public List<Group> getGroups(Long userId) throws ObjectNotFoundException; | List<Group> function(Long userId) throws ObjectNotFoundException; | /**
* Retrieve the list of groups for a particular user.
*
* @param userId the ID of the User
* @return a List of Groups that belong to the specified User
* @throws ObjectNotFoundException if the user was not found
*/ | Retrieve the list of groups for a particular user | getGroups | {
"repo_name": "andrewbissada/gss",
"path": "src/org/gss_project/gss/server/ejb/ExternalAPI.java",
"license": "gpl-3.0",
"size": 50977
} | [
"java.util.List",
"org.gss_project.gss.common.exceptions.ObjectNotFoundException",
"org.gss_project.gss.server.domain.Group"
] | import java.util.List; import org.gss_project.gss.common.exceptions.ObjectNotFoundException; import org.gss_project.gss.server.domain.Group; | import java.util.*; import org.gss_project.gss.common.exceptions.*; import org.gss_project.gss.server.domain.*; | [
"java.util",
"org.gss_project.gss"
] | java.util; org.gss_project.gss; | 2,343,969 |
private void writeObject(ObjectOutputStream stream) throws IOException {
stream.defaultWriteObject();
SerialUtilities.writePaint(this.labelPaint, stream);
SerialUtilities.writeStroke(this.dividerStroke, stream);
SerialUtilities.writePaint(this.dividerPaint, stream);
} | void function(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtilities.writePaint(this.labelPaint, stream); SerialUtilities.writeStroke(this.dividerStroke, stream); SerialUtilities.writePaint(this.dividerPaint, stream); } | /**
* Provides serialization support.
*
* @param stream the output stream.
*
* @throws IOException if there is an I/O error.
*/ | Provides serialization support | writeObject | {
"repo_name": "ceabie/jfreechart",
"path": "source/org/jfree/chart/axis/PeriodAxisLabelInfo.java",
"license": "lgpl-2.1",
"size": 12293
} | [
"java.io.IOException",
"java.io.ObjectOutputStream",
"org.jfree.io.SerialUtilities"
] | import java.io.IOException; import java.io.ObjectOutputStream; import org.jfree.io.SerialUtilities; | import java.io.*; import org.jfree.io.*; | [
"java.io",
"org.jfree.io"
] | java.io; org.jfree.io; | 1,442,140 |
public ImmutableList<byte[]> getAllOutputBytes() {
return ImmutableList.copyOf(decoderOutput);
} | ImmutableList<byte[]> function() { return ImmutableList.copyOf(decoderOutput); } | /**
* Returns all arrays of bytes output from the decoder.
*
* @return a list of byte arrays (for each MP3 frame input) that were previously output from the
* decoder.
*/ | Returns all arrays of bytes output from the decoder | getAllOutputBytes | {
"repo_name": "androidx/media",
"path": "libraries/test_utils_robolectric/src/main/java/androidx/media3/test/utils/robolectric/RandomizedMp3Decoder.java",
"license": "apache-2.0",
"size": 3670
} | [
"com.google.common.collect.ImmutableList"
] | import com.google.common.collect.ImmutableList; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 1,799,647 |
@Override
public void setDocumentLocator(Locator locator) {
_locator = locator;
if (_handler != null) {
_handler.setDocumentLocator(locator);
}
} | void function(Locator locator) { _locator = locator; if (_handler != null) { _handler.setDocumentLocator(locator); } } | /**
* Implements org.xml.sax.ContentHandler.setDocumentLocator()
* Receive an object for locating the origin of SAX document events.
*/ | Implements org.xml.sax.ContentHandler.setDocumentLocator() Receive an object for locating the origin of SAX document events | setDocumentLocator | {
"repo_name": "md-5/jdk10",
"path": "src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java",
"license": "gpl-2.0",
"size": 15833
} | [
"org.xml.sax.Locator"
] | import org.xml.sax.Locator; | import org.xml.sax.*; | [
"org.xml.sax"
] | org.xml.sax; | 64,324 |
public JsStatement toggleClass(String className) {
chain(AttributesHelper.toggleClass(className));
return this;
} | JsStatement function(String className) { chain(AttributesHelper.toggleClass(className)); return this; } | /**
* Binds the <code>toggleClass</code> statement.
*/ | Binds the <code>toggleClass</code> statement | toggleClass | {
"repo_name": "openengsb-attic/forks-org.odlabs.wiquery",
"path": "src/main/java/org/odlabs/wiquery/core/javascript/JsStatement.java",
"license": "mit",
"size": 9772
} | [
"org.odlabs.wiquery.core.javascript.helper.AttributesHelper"
] | import org.odlabs.wiquery.core.javascript.helper.AttributesHelper; | import org.odlabs.wiquery.core.javascript.helper.*; | [
"org.odlabs.wiquery"
] | org.odlabs.wiquery; | 279,258 |
public void addMaxLengthField(Field field){
List<Field> fields = notValidFields.get(VALIDATION_FAILED_MAXLENGTH);
if(fields == null)
fields = new ArrayList<Field>();
fields.add(field);
notValidFields.put(VALIDATION_FAILED_MAXLENGTH, fields);
} | void function(Field field){ List<Field> fields = notValidFields.get(VALIDATION_FAILED_MAXLENGTH); if(fields == null) fields = new ArrayList<Field>(); fields.add(field); notValidFields.put(VALIDATION_FAILED_MAXLENGTH, fields); } | /**
* Use to add a field that failed length validation
* @param field
*/ | Use to add a field that failed length validation | addMaxLengthField | {
"repo_name": "wisdom-garden/dotcms",
"path": "src/com/dotmarketing/portlets/contentlet/business/DotContentletValidationException.java",
"license": "gpl-3.0",
"size": 8264
} | [
"com.dotmarketing.portlets.structure.model.Field",
"java.util.ArrayList",
"java.util.List"
] | import com.dotmarketing.portlets.structure.model.Field; import java.util.ArrayList; import java.util.List; | import com.dotmarketing.portlets.structure.model.*; import java.util.*; | [
"com.dotmarketing.portlets",
"java.util"
] | com.dotmarketing.portlets; java.util; | 1,836,122 |
public static void setWordWrap(IEditorPart editor, boolean state) {
if (editor == null) {
return;
}
// editor (IEditorPart) adapter returns StyledText
Object text = editor.getAdapter(Control.class);
if (text instanceof StyledText) {
StyledText styledText = (StyledText) text;
// set wrapping
styledText.setWordWrap(state);
}
} | static void function(IEditorPart editor, boolean state) { if (editor == null) { return; } Object text = editor.getAdapter(Control.class); if (text instanceof StyledText) { StyledText styledText = (StyledText) text; styledText.setWordWrap(state); } } | /**
* Sets the word wrap property of a given editor.
*
* @param editor
* Editor in which the word wrap will be toggled
* @param state
* The desired state of the word wrap
* @author Florian Weßling <[email protected]>
*/ | Sets the word wrap property of a given editor | setWordWrap | {
"repo_name": "ColdDevil/de.cdhq.eclipse.wordwrap",
"path": "src/de/cdhq/eclipse/wordwrap/plugin/WordWrapUtils.java",
"license": "epl-1.0",
"size": 3043
} | [
"org.eclipse.swt.custom.StyledText",
"org.eclipse.swt.widgets.Control",
"org.eclipse.ui.IEditorPart"
] | import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.widgets.Control; import org.eclipse.ui.IEditorPart; | import org.eclipse.swt.custom.*; import org.eclipse.swt.widgets.*; import org.eclipse.ui.*; | [
"org.eclipse.swt",
"org.eclipse.ui"
] | org.eclipse.swt; org.eclipse.ui; | 1,120,157 |
public void spinRight(int user) {
rotateScene(user, new Vec(0, 0, Math.PI / 4));
} | void function(int user) { rotateScene(user, new Vec(0, 0, Math.PI / 4)); } | /**
* Spins clockwise
*
* @param user number of the user requesting this rotation; this
* value used for the synchronization and notification of several
* users
*/ | Spins clockwise | spinRight | {
"repo_name": "moliva/proactive",
"path": "src/Examples/org/objectweb/proactive/examples/webservices/c3dWS/C3DDispatcher.java",
"license": "agpl-3.0",
"size": 39495
} | [
"org.objectweb.proactive.examples.webservices.c3dWS.geom.Vec"
] | import org.objectweb.proactive.examples.webservices.c3dWS.geom.Vec; | import org.objectweb.proactive.examples.webservices.*; | [
"org.objectweb.proactive"
] | org.objectweb.proactive; | 1,895,965 |
Xid getCurrentXid () {
return currentXid;
} | Xid getCurrentXid () { return currentXid; } | /**
* Resturns currently active xid
* @return Xid
*/ | Resturns currently active xid | getCurrentXid | {
"repo_name": "apache/derby",
"path": "java/org.apache.derby.engine/org/apache/derby/impl/jdbc/EmbedXAResource.java",
"license": "apache-2.0",
"size": 40575
} | [
"javax.transaction.xa.Xid"
] | import javax.transaction.xa.Xid; | import javax.transaction.xa.*; | [
"javax.transaction"
] | javax.transaction; | 2,049,247 |
public void deleteAllObjectsColumn(TableDefinition tableDef, String objID, int shardNo) {
String rowKey = ALL_OBJECTS_ROW_KEY;
if (shardNo > 0) {
rowKey = shardNo + "/" + ALL_OBJECTS_ROW_KEY;
}
deleteColumn(SpiderService.termsStoreName(tableDef), rowKey, objID);
} // deleteAllObjectsColumn
| void function(TableDefinition tableDef, String objID, int shardNo) { String rowKey = ALL_OBJECTS_ROW_KEY; if (shardNo > 0) { rowKey = shardNo + "/" + ALL_OBJECTS_ROW_KEY; } deleteColumn(SpiderService.termsStoreName(tableDef), rowKey, objID); } | /**
* Delete the "all objects" column with the given object ID from the given table.
*
* @param tableDef {@link TableDefinition} of object's owning table.
* @param objID ID of object being deleted.
* @param shardNo Shard number of object being deleted.
* @see #addAllObjectsColumn(TableDefinition, String, int)
*/ | Delete the "all objects" column with the given object ID from the given table | deleteAllObjectsColumn | {
"repo_name": "shaunstanislaus/Doradus",
"path": "doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java",
"license": "apache-2.0",
"size": 23697
} | [
"com.dell.doradus.common.TableDefinition"
] | import com.dell.doradus.common.TableDefinition; | import com.dell.doradus.common.*; | [
"com.dell.doradus"
] | com.dell.doradus; | 2,396,684 |
@Override
public Adapter createRecipientListEndPointWestOutputConnectorAdapter() {
if (recipientListEndPointWestOutputConnectorItemProvider == null) {
recipientListEndPointWestOutputConnectorItemProvider = new RecipientListEndPointWestOutputConnectorItemProvider(this);
}
return recipientListEndPointWestOutputConnectorItemProvider;
}
protected MessageStoreParameterItemProvider messageStoreParameterItemProvider; | Adapter function() { if (recipientListEndPointWestOutputConnectorItemProvider == null) { recipientListEndPointWestOutputConnectorItemProvider = new RecipientListEndPointWestOutputConnectorItemProvider(this); } return recipientListEndPointWestOutputConnectorItemProvider; } protected MessageStoreParameterItemProvider messageStoreParameterItemProvider; | /**
* This creates an adapter for a {@link org.wso2.developerstudio.eclipse.gmf.esb.RecipientListEndPointWestOutputConnector}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This creates an adapter for a <code>org.wso2.developerstudio.eclipse.gmf.esb.RecipientListEndPointWestOutputConnector</code>. | createRecipientListEndPointWestOutputConnectorAdapter | {
"repo_name": "rajeevanv89/developer-studio",
"path": "esb/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/EsbItemProviderAdapterFactory.java",
"license": "apache-2.0",
"size": 286852
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,344,749 |
public boolean start(@NonNull Context context) {
scanner = fitbitGatt.getPeripheralScanner();
if (scanner == null) {
Timber.w("The scanner isn't set up yet, did you call FitbitGatt#start(...)?");
return false;
}
if (scanner.isScanning() || scanner.isPeriodicalScanEnabled() || scanner.isPendingIntentScanning()) {
Timber.w("You can not start an always connected scanner while using the regular scanner");
return false;
}
if (scanFilters.isEmpty()) {
Timber.w("You can not start a scanner with no filters");
return false;
}
if (isScannerEnabled.get()) {
Timber.w("The scanner was already enabled, no need to call this again");
return false;
}
fitbitGatt.registerGattEventListener(this);
return startBackgroundScanning(context);
} | boolean function(@NonNull Context context) { scanner = fitbitGatt.getPeripheralScanner(); if (scanner == null) { Timber.w(STR); return false; } if (scanner.isScanning() scanner.isPeriodicalScanEnabled() scanner.isPendingIntentScanning()) { Timber.w(STR); return false; } if (scanFilters.isEmpty()) { Timber.w(STR); return false; } if (isScannerEnabled.get()) { Timber.w(STR); return false; } fitbitGatt.registerGattEventListener(this); return startBackgroundScanning(context); } | /**
* Will start finding and connecting to devices that match the filters. Will not deal with matching
* presently connected devices at the time of the start call.
*
* @param context The android application context
* @return true if the scanner can start searching, false if the raw scanner is in use or the filters are insufficient
*/ | Will start finding and connecting to devices that match the filters. Will not deal with matching presently connected devices at the time of the start call | start | {
"repo_name": "Fitbit/bitgatt",
"path": "src/main/java/com/fitbit/bluetooth/fbgatt/AlwaysConnectedScanner.java",
"license": "mpl-2.0",
"size": 29302
} | [
"android.content.Context",
"androidx.annotation.NonNull"
] | import android.content.Context; import androidx.annotation.NonNull; | import android.content.*; import androidx.annotation.*; | [
"android.content",
"androidx.annotation"
] | android.content; androidx.annotation; | 2,117,911 |
public void closeEditor() {
if (m_saveButton != null) {
if (m_saveButton.isEnabled()) {
CmsConfirmDialog dialog = new CmsConfirmDialog(
org.opencms.gwt.client.Messages.get().key(org.opencms.gwt.client.Messages.GUI_DIALOG_RESET_TITLE_0),
Messages.get().key(Messages.GUI_CONFIRM_LEAVING_EDITOR_0));
dialog.setHandler(new I_CmsConfirmDialogHandler() {
| void function() { if (m_saveButton != null) { if (m_saveButton.isEnabled()) { CmsConfirmDialog dialog = new CmsConfirmDialog( org.opencms.gwt.client.Messages.get().key(org.opencms.gwt.client.Messages.GUI_DIALOG_RESET_TITLE_0), Messages.get().key(Messages.GUI_CONFIRM_LEAVING_EDITOR_0)); dialog.setHandler(new I_CmsConfirmDialogHandler() { | /**
* Closes the editor.<p>
* May be used from outside the editor module.<p>
*/ | Closes the editor. May be used from outside the editor module | closeEditor | {
"repo_name": "mediaworx/opencms-core",
"path": "src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java",
"license": "lgpl-2.1",
"size": 85854
} | [
"org.opencms.gwt.client.ui.CmsConfirmDialog"
] | import org.opencms.gwt.client.ui.CmsConfirmDialog; | import org.opencms.gwt.client.ui.*; | [
"org.opencms.gwt"
] | org.opencms.gwt; | 1,493,033 |
@Retryable(value = AccepttoUserDeviceRegistrationException.class,
maxAttempts = 2, backoff = @Backoff(delay = 1000, maxDelay = 3000))
public boolean verifyUserDeviceIsPaired() {
val acceptto = casProperties.getAuthn().getMfa().getAcceptto();
val authentication = WebUtils.getInProgressAuthentication();
if (!AccepttoApiUtils.isUserDevicePaired(authentication, acceptto)) {
val email = AccepttoApiUtils.getUserEmail(authentication, acceptto);
throw new AccepttoUserDeviceRegistrationException("Could not locate registered device for " + email);
}
return true;
} | @Retryable(value = AccepttoUserDeviceRegistrationException.class, maxAttempts = 2, backoff = @Backoff(delay = 1000, maxDelay = 3000)) boolean function() { val acceptto = casProperties.getAuthn().getMfa().getAcceptto(); val authentication = WebUtils.getInProgressAuthentication(); if (!AccepttoApiUtils.isUserDevicePaired(authentication, acceptto)) { val email = AccepttoApiUtils.getUserEmail(authentication, acceptto); throw new AccepttoUserDeviceRegistrationException(STR + email); } return true; } | /**
* Verify user device is paired.
*
* @return the boolean
*/ | Verify user device is paired | verifyUserDeviceIsPaired | {
"repo_name": "leleuj/cas",
"path": "support/cas-server-support-acceptto-mfa/src/main/java/org/apereo/cas/mfa/accepto/web/flow/AccepttoMultifactorValidateUserDeviceRegistrationAction.java",
"license": "apache-2.0",
"size": 3189
} | [
"org.apereo.cas.mfa.accepto.AccepttoApiUtils",
"org.apereo.cas.web.support.WebUtils",
"org.springframework.retry.annotation.Backoff",
"org.springframework.retry.annotation.Retryable"
] | import org.apereo.cas.mfa.accepto.AccepttoApiUtils; import org.apereo.cas.web.support.WebUtils; import org.springframework.retry.annotation.Backoff; import org.springframework.retry.annotation.Retryable; | import org.apereo.cas.mfa.accepto.*; import org.apereo.cas.web.support.*; import org.springframework.retry.annotation.*; | [
"org.apereo.cas",
"org.springframework.retry"
] | org.apereo.cas; org.springframework.retry; | 1,335,293 |
public static void openAboutJAlgoFrame(JFrame parent) {
openAboutFrame(parent, Messages.getString("main", "ui.About"), //$NON-NLS-1$ //$NON-NLS-2$
Messages.getJAlgoInfoAsHTML());
}
| static void function(JFrame parent) { openAboutFrame(parent, Messages.getString("main", STR), Messages.getJAlgoInfoAsHTML()); } | /**
* Opens an "About" - frame for general informations about j-Algo.
*
* @param parent the <code>JAlgoWindow</code> instance
*/ | Opens an "About" - frame for general informations about j-Algo | openAboutJAlgoFrame | {
"repo_name": "jurkov/j-algo-mod",
"path": "src/org/jalgo/main/gui/components/AboutFrame.java",
"license": "gpl-2.0",
"size": 3352
} | [
"javax.swing.JFrame",
"org.jalgo.main.util.Messages"
] | import javax.swing.JFrame; import org.jalgo.main.util.Messages; | import javax.swing.*; import org.jalgo.main.util.*; | [
"javax.swing",
"org.jalgo.main"
] | javax.swing; org.jalgo.main; | 2,399,780 |
public PreparedStatement getStatement( )
{
return _statement;
} | PreparedStatement function( ) { return _statement; } | /**
* The current prepared statement
*
* @return The current statement
*/ | The current prepared statement | getStatement | {
"repo_name": "rzara/lutece-core",
"path": "src/java/fr/paris/lutece/util/sql/Transaction.java",
"license": "bsd-3-clause",
"size": 11191
} | [
"java.sql.PreparedStatement"
] | import java.sql.PreparedStatement; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,148,517 |
public static boolean deletePathIfEmpty(FileSystem fileSystem, Path path) throws IOException {
final FileStatus[] fileStatuses;
try {
fileStatuses = fileSystem.listStatus(path);
}
catch (FileNotFoundException e) {
// path already deleted
return true;
}
catch (Exception e) {
// could not access directory, cannot delete
return false;
}
// if there are no more files or if we couldn't list the file status try to delete the path
if (fileStatuses == null) {
// another indicator of "file not found"
return true;
}
else if (fileStatuses.length == 0) {
// attempt to delete the path (will fail and be ignored if the path now contains
// some files (possibly added concurrently))
return fileSystem.delete(path, false);
}
else {
return false;
}
}
// ------------------------------------------------------------------------
private FileUtils() {} | static boolean function(FileSystem fileSystem, Path path) throws IOException { final FileStatus[] fileStatuses; try { fileStatuses = fileSystem.listStatus(path); } catch (FileNotFoundException e) { return true; } catch (Exception e) { return false; } if (fileStatuses == null) { return true; } else if (fileStatuses.length == 0) { return fileSystem.delete(path, false); } else { return false; } } private FileUtils() {} | /**
* Deletes the path if it is empty. A path can only be empty if it is a directory which does
* not contain any other directories/files.
*
* @param fileSystem to use
* @param path to be deleted if empty
* @return true if the path could be deleted; otherwise false
* @throws IOException if the delete operation fails
*/ | Deletes the path if it is empty. A path can only be empty if it is a directory which does not contain any other directories/files | deletePathIfEmpty | {
"repo_name": "zimmermatt/flink",
"path": "flink-core/src/main/java/org/apache/flink/util/FileUtils.java",
"license": "apache-2.0",
"size": 9490
} | [
"java.io.FileNotFoundException",
"java.io.IOException",
"org.apache.flink.core.fs.FileStatus",
"org.apache.flink.core.fs.FileSystem",
"org.apache.flink.core.fs.Path"
] | import java.io.FileNotFoundException; import java.io.IOException; import org.apache.flink.core.fs.FileStatus; import org.apache.flink.core.fs.FileSystem; import org.apache.flink.core.fs.Path; | import java.io.*; import org.apache.flink.core.fs.*; | [
"java.io",
"org.apache.flink"
] | java.io; org.apache.flink; | 1,547,836 |
@Test
public void testEquals() {
DefaultStatisticalCategoryDataset d1
= new DefaultStatisticalCategoryDataset();
DefaultStatisticalCategoryDataset d2
= new DefaultStatisticalCategoryDataset();
assertTrue(d1.equals(d2));
assertTrue(d2.equals(d1));
} | void function() { DefaultStatisticalCategoryDataset d1 = new DefaultStatisticalCategoryDataset(); DefaultStatisticalCategoryDataset d2 = new DefaultStatisticalCategoryDataset(); assertTrue(d1.equals(d2)); assertTrue(d2.equals(d1)); } | /**
* Confirm that the equals method can distinguish all the required fields.
*/ | Confirm that the equals method can distinguish all the required fields | testEquals | {
"repo_name": "raincs13/phd",
"path": "tests/org/jfree/data/statistics/DefaultStatisticalCategoryDatasetTest.java",
"license": "lgpl-2.1",
"size": 10005
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,209,586 |
T visitAssignInt(@NotNull jazzikParser.AssignIntContext ctx); | T visitAssignInt(@NotNull jazzikParser.AssignIntContext ctx); | /**
* Visit a parse tree produced by {@link jazzikParser#AssignInt}.
* @param ctx the parse tree
* @return the visitor result
*/ | Visit a parse tree produced by <code>jazzikParser#AssignInt</code> | visitAssignInt | {
"repo_name": "petersch/jazzik",
"path": "src/parser/jazzikVisitor.java",
"license": "gpl-3.0",
"size": 10234
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 1,726,756 |
public static void init(BlueprintFactory factory, BlueprintDAO dao, SecurityConfigurationFactory
securityFactory, Gson gson, AmbariMetaInfo metaInfo) {
blueprintFactory = factory;
blueprintDAO = dao;
securityConfigurationFactory = securityFactory;
jsonSerializer = gson;
ambariMetaInfo = metaInfo;
}
// ----- ResourceProvider ------------------------------------------------ | static void function(BlueprintFactory factory, BlueprintDAO dao, SecurityConfigurationFactory securityFactory, Gson gson, AmbariMetaInfo metaInfo) { blueprintFactory = factory; blueprintDAO = dao; securityConfigurationFactory = securityFactory; jsonSerializer = gson; ambariMetaInfo = metaInfo; } | /**
* Static initialization.
*
* @param factory blueprint factory
* @param dao blueprint data access object
* @param gson json serializer
*/ | Static initialization | init | {
"repo_name": "arenadata/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java",
"license": "apache-2.0",
"size": 26107
} | [
"com.google.gson.Gson",
"org.apache.ambari.server.api.services.AmbariMetaInfo",
"org.apache.ambari.server.orm.dao.BlueprintDAO",
"org.apache.ambari.server.topology.BlueprintFactory",
"org.apache.ambari.server.topology.SecurityConfigurationFactory"
] | import com.google.gson.Gson; import org.apache.ambari.server.api.services.AmbariMetaInfo; import org.apache.ambari.server.orm.dao.BlueprintDAO; import org.apache.ambari.server.topology.BlueprintFactory; import org.apache.ambari.server.topology.SecurityConfigurationFactory; | import com.google.gson.*; import org.apache.ambari.server.api.services.*; import org.apache.ambari.server.orm.dao.*; import org.apache.ambari.server.topology.*; | [
"com.google.gson",
"org.apache.ambari"
] | com.google.gson; org.apache.ambari; | 1,278,151 |
private static Hashtable<String,Vector<EObject>> targetsByClass(EObject owner, EReference ref)
{
Hashtable<String,Vector<EObject>> res = new Hashtable<String,Vector<EObject>>();
Object feature = owner.eGet(ref);
if (feature instanceof EList<?>)
{
EList<?> lf = (EList<?>)feature;
for (Iterator<?> it = lf.iterator();it.hasNext();)
{
Object next = it.next();
if (next instanceof EObject)
{
EObject eo = (EObject)next;
String className = eo.eClass().getName();
Vector<EObject> soFar = res.get(className);
if (soFar == null) soFar = new Vector<EObject>();
soFar.add(eo);
res.put(className, soFar);
}
}
}
return res;
}
| static Hashtable<String,Vector<EObject>> function(EObject owner, EReference ref) { Hashtable<String,Vector<EObject>> res = new Hashtable<String,Vector<EObject>>(); Object feature = owner.eGet(ref); if (feature instanceof EList<?>) { EList<?> lf = (EList<?>)feature; for (Iterator<?> it = lf.iterator();it.hasNext();) { Object next = it.next(); if (next instanceof EObject) { EObject eo = (EObject)next; String className = eo.eClass().getName(); Vector<EObject> soFar = res.get(className); if (soFar == null) soFar = new Vector<EObject>(); soFar.add(eo); res.put(className, soFar); } } } return res; } | /**
* sort the target objects of a multi-valued feature into objects of the same class
* @param owner the owning object
* @param ref the feature
* @return key = class name; value = Vector of target objects of that class
*/ | sort the target objects of a multi-valued feature into objects of the same class | targetsByClass | {
"repo_name": "openmapsoftware/mappingtools",
"path": "openmap-mapper-lib/src/main/java/com/openMap1/mapper/util/ModelMatcher.java",
"license": "epl-1.0",
"size": 5741
} | [
"java.util.Hashtable",
"java.util.Iterator",
"java.util.Vector",
"org.eclipse.emf.common.util.EList",
"org.eclipse.emf.ecore.EObject",
"org.eclipse.emf.ecore.EReference"
] | import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; | import java.util.*; import org.eclipse.emf.common.util.*; import org.eclipse.emf.ecore.*; | [
"java.util",
"org.eclipse.emf"
] | java.util; org.eclipse.emf; | 2,624,666 |
protected void removeMessageJobDeclarationWithJobConfiguration(ActivityImpl activity, String jobConfiguration) {
List<MessageJobDeclaration> messageJobDeclarations = (List<MessageJobDeclaration>) activity.getProperty(PROPERTYNAME_MESSAGE_JOB_DECLARATION);
if (messageJobDeclarations != null) {
Iterator<MessageJobDeclaration> iter = messageJobDeclarations.iterator();
while (iter.hasNext()) {
MessageJobDeclaration msgDecl = iter.next();
if (msgDecl.getJobConfiguration().equalsIgnoreCase(jobConfiguration)
&& msgDecl.getActivityId().equalsIgnoreCase(activity.getActivityId())) {
iter.remove();
}
}
}
ProcessDefinition procDef = (ProcessDefinition) activity.getProcessDefinition();
List<JobDeclaration<?, ?>> declarations = jobDeclarations.get(procDef.getKey());
if (declarations != null) {
Iterator<JobDeclaration<?, ?>> iter = declarations.iterator();
while (iter.hasNext()) {
JobDeclaration<?, ?> jobDcl = iter.next();
if (jobDcl.getJobConfiguration().equalsIgnoreCase(jobConfiguration)
&& jobDcl.getActivityId().equalsIgnoreCase(activity.getActivityId())) {
iter.remove();
}
}
}
} | void function(ActivityImpl activity, String jobConfiguration) { List<MessageJobDeclaration> messageJobDeclarations = (List<MessageJobDeclaration>) activity.getProperty(PROPERTYNAME_MESSAGE_JOB_DECLARATION); if (messageJobDeclarations != null) { Iterator<MessageJobDeclaration> iter = messageJobDeclarations.iterator(); while (iter.hasNext()) { MessageJobDeclaration msgDecl = iter.next(); if (msgDecl.getJobConfiguration().equalsIgnoreCase(jobConfiguration) && msgDecl.getActivityId().equalsIgnoreCase(activity.getActivityId())) { iter.remove(); } } } ProcessDefinition procDef = (ProcessDefinition) activity.getProcessDefinition(); List<JobDeclaration<?, ?>> declarations = jobDeclarations.get(procDef.getKey()); if (declarations != null) { Iterator<JobDeclaration<?, ?>> iter = declarations.iterator(); while (iter.hasNext()) { JobDeclaration<?, ?> jobDcl = iter.next(); if (jobDcl.getJobConfiguration().equalsIgnoreCase(jobConfiguration) && jobDcl.getActivityId().equalsIgnoreCase(activity.getActivityId())) { iter.remove(); } } } } | /**
* Removes a job declaration which belongs to the given activity and has the given job configuration.
*
* @param activity the activity of the job declaration
* @param jobConfiguration the job configuration of the declaration
*/ | Removes a job declaration which belongs to the given activity and has the given job configuration | removeMessageJobDeclarationWithJobConfiguration | {
"repo_name": "camunda/camunda-bpm-platform",
"path": "engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java",
"license": "apache-2.0",
"size": 230001
} | [
"java.util.Iterator",
"java.util.List",
"org.camunda.bpm.engine.impl.jobexecutor.JobDeclaration",
"org.camunda.bpm.engine.impl.jobexecutor.MessageJobDeclaration",
"org.camunda.bpm.engine.impl.pvm.process.ActivityImpl",
"org.camunda.bpm.engine.repository.ProcessDefinition"
] | import java.util.Iterator; import java.util.List; import org.camunda.bpm.engine.impl.jobexecutor.JobDeclaration; import org.camunda.bpm.engine.impl.jobexecutor.MessageJobDeclaration; import org.camunda.bpm.engine.impl.pvm.process.ActivityImpl; import org.camunda.bpm.engine.repository.ProcessDefinition; | import java.util.*; import org.camunda.bpm.engine.impl.jobexecutor.*; import org.camunda.bpm.engine.impl.pvm.process.*; import org.camunda.bpm.engine.repository.*; | [
"java.util",
"org.camunda.bpm"
] | java.util; org.camunda.bpm; | 1,501,413 |
public ConfigDescriptionParameterBuilder withMinimum(BigDecimal min) {
this.min = min;
return this;
} | ConfigDescriptionParameterBuilder function(BigDecimal min) { this.min = min; return this; } | /**
* Set the minimum value of the configuration parameter
*
* @param min
*/ | Set the minimum value of the configuration parameter | withMinimum | {
"repo_name": "msiegele/smarthome",
"path": "bundles/config/org.eclipse.smarthome.config.core/src/main/java/org/eclipse/smarthome/config/core/ConfigDescriptionParameterBuilder.java",
"license": "epl-1.0",
"size": 6635
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 2,853,761 |
static Application create(Type type, ElementAttributes attr) {
switch (type) {
case Generic:
return new ApplicationGeneric();
case GHDL:
return new ApplicationGHDL(attr);
case IVERILOG:
return new ApplicationIVerilog(attr);
default:
return null;
}
} | static Application create(Type type, ElementAttributes attr) { switch (type) { case Generic: return new ApplicationGeneric(); case GHDL: return new ApplicationGHDL(attr); case IVERILOG: return new ApplicationIVerilog(attr); default: return null; } } | /**
* Creates a new application instance
*
* @param type the type of the process
* @param attr the elements attributes
* @return the created process handler
*/ | Creates a new application instance | create | {
"repo_name": "hneemann/Digital",
"path": "src/main/java/de/neemann/digital/core/extern/Application.java",
"license": "gpl-3.0",
"size": 4154
} | [
"de.neemann.digital.core.element.ElementAttributes"
] | import de.neemann.digital.core.element.ElementAttributes; | import de.neemann.digital.core.element.*; | [
"de.neemann.digital"
] | de.neemann.digital; | 1,266,700 |
protected IFigure setupContentPane(IFigure nodeShape) {
if (nodeShape.getLayoutManager() == null) {
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
layout.setSpacing(5);
nodeShape.setLayoutManager(layout);
}
return nodeShape; // use nodeShape itself as contentPane
} | IFigure function(IFigure nodeShape) { if (nodeShape.getLayoutManager() == null) { ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); layout.setSpacing(5); nodeShape.setLayoutManager(layout); } return nodeShape; } | /**
* Default implementation treats passed figure as content pane.
* Respects layout one may have set for generated figure.
*
* @param nodeShape instance of generated figure class
* @generated
*/ | Default implementation treats passed figure as content pane. Respects layout one may have set for generated figure | setupContentPane | {
"repo_name": "prabushi/devstudio-tooling-esb",
"path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/edit/parts/HTTPEndpoint2EditPart.java",
"license": "apache-2.0",
"size": 13587
} | [
"org.eclipse.draw2d.IFigure",
"org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout"
] | import org.eclipse.draw2d.IFigure; import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; | import org.eclipse.draw2d.*; import org.eclipse.gmf.runtime.draw2d.ui.figures.*; | [
"org.eclipse.draw2d",
"org.eclipse.gmf"
] | org.eclipse.draw2d; org.eclipse.gmf; | 1,319,206 |
public static String resolveRestHostName(String host, RestConfiguration config) throws UnknownHostException {
if (config.getHostNameResolver() == RestConfiguration.RestHostNameResolver.allLocalIp) {
host = "0.0.0.0";
} else if (config.getHostNameResolver() == RestConfiguration.RestHostNameResolver.localHostName) {
host = HostUtils.getLocalHostName();
} else if (config.getHostNameResolver() == RestConfiguration.RestHostNameResolver.localIp) {
host = HostUtils.getLocalIp();
}
return host;
}
| static String function(String host, RestConfiguration config) throws UnknownHostException { if (config.getHostNameResolver() == RestConfiguration.RestHostNameResolver.allLocalIp) { host = STR; } else if (config.getHostNameResolver() == RestConfiguration.RestHostNameResolver.localHostName) { host = HostUtils.getLocalHostName(); } else if (config.getHostNameResolver() == RestConfiguration.RestHostNameResolver.localIp) { host = HostUtils.getLocalIp(); } return host; } | /**
*
* Sets the Rest consumer host based on RestConfiguration
*
* @param host the existing host configuration
* @param config the RestConfiguration
* @return the host based on RestConfiguration
* @throws UnknownHostException thrown when local host or local ip can't be resolved via network interfaces.
*/ | Sets the Rest consumer host based on RestConfiguration | resolveRestHostName | {
"repo_name": "CodeSmell/camel",
"path": "core/camel-support/src/main/java/org/apache/camel/support/RestComponentHelper.java",
"license": "apache-2.0",
"size": 6590
} | [
"java.net.UnknownHostException",
"org.apache.camel.spi.RestConfiguration",
"org.apache.camel.util.HostUtils"
] | import java.net.UnknownHostException; import org.apache.camel.spi.RestConfiguration; import org.apache.camel.util.HostUtils; | import java.net.*; import org.apache.camel.spi.*; import org.apache.camel.util.*; | [
"java.net",
"org.apache.camel"
] | java.net; org.apache.camel; | 917,537 |
void changedAttributeHook(PerunSession sess, Vo vo, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException; | void changedAttributeHook(PerunSession sess, Vo vo, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException; | /**
* If you need to do some further work with other modules, this method do that
*
* @param sess
* @param vo
* @param attribute
* @throws InternalErrorException
* @throws WrongReferenceAttributeValueException
* @throws WrongAttributeValueException
*/ | If you need to do some further work with other modules, this method do that | changedAttributeHook | {
"repo_name": "Simcsa/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/implApi/AttributesManagerImplApi.java",
"license": "bsd-2-clause",
"size": 98325
} | [
"cz.metacentrum.perun.core.api.Attribute",
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.Vo",
"cz.metacentrum.perun.core.api.exceptions.InternalErrorException",
"cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException",
"cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException"
] | import cz.metacentrum.perun.core.api.Attribute; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.Vo; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException; import cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException; | import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; | [
"cz.metacentrum.perun"
] | cz.metacentrum.perun; | 2,424,662 |
void persistState() throws IOException; | void persistState() throws IOException; | /**
* Ask the process to persist its state in the background
* @throws IOException If writing the request fails
*/ | Ask the process to persist its state in the background | persistState | {
"repo_name": "robin13/elasticsearch",
"path": "x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/process/NativeProcess.java",
"license": "apache-2.0",
"size": 3389
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 710,478 |
public void broadcast()
{
for (Player player : Bukkit.getServer().getOnlinePlayers())
{
play(player);
}
} | void function() { for (Player player : Bukkit.getServer().getOnlinePlayers()) { play(player); } } | /**
* Plays this sound for all players, at the current location of the players.
*/ | Plays this sound for all players, at the current location of the players | broadcast | {
"repo_name": "AmauryCarrade/UHPlugin",
"path": "src/main/java/eu/carrade/amaury/UHCReloaded/utils/UHSound.java",
"license": "gpl-3.0",
"size": 7465
} | [
"org.bukkit.Bukkit",
"org.bukkit.entity.Player"
] | import org.bukkit.Bukkit; import org.bukkit.entity.Player; | import org.bukkit.*; import org.bukkit.entity.*; | [
"org.bukkit",
"org.bukkit.entity"
] | org.bukkit; org.bukkit.entity; | 2,164,989 |
@Function(name = "getUint16", arity = 2)
public static Object getUint16(ExecutionContext cx, Object thisValue, Object byteOffset,
Object littleEndian) {
return GetViewValue(cx, thisValue, byteOffset, littleEndian, ElementType.Uint16);
} | @Function(name = STR, arity = 2) static Object function(ExecutionContext cx, Object thisValue, Object byteOffset, Object littleEndian) { return GetViewValue(cx, thisValue, byteOffset, littleEndian, ElementType.Uint16); } | /**
* 24.2.4.11 DataView.prototype.getUint16(byteOffset, littleEndian=false)
*/ | 24.2.4.11 DataView.prototype.getUint16(byteOffset, littleEndian=false) | getUint16 | {
"repo_name": "rwaldron/es6draft",
"path": "src/main/java/com/github/anba/es6draft/runtime/objects/binary/DataViewPrototype.java",
"license": "mit",
"size": 10244
} | [
"com.github.anba.es6draft.runtime.ExecutionContext",
"com.github.anba.es6draft.runtime.internal.Properties",
"com.github.anba.es6draft.runtime.objects.binary.DataViewConstructor"
] | import com.github.anba.es6draft.runtime.ExecutionContext; import com.github.anba.es6draft.runtime.internal.Properties; import com.github.anba.es6draft.runtime.objects.binary.DataViewConstructor; | import com.github.anba.es6draft.runtime.*; import com.github.anba.es6draft.runtime.internal.*; import com.github.anba.es6draft.runtime.objects.binary.*; | [
"com.github.anba"
] | com.github.anba; | 2,902,350 |
public static com.iucn.whp.dbservice.model.whp_sites_dsocr remove(
long whp_sites_dsocr_id)
throws com.iucn.whp.dbservice.NoSuch_sites_dsocrException,
com.liferay.portal.kernel.exception.SystemException {
return getPersistence().remove(whp_sites_dsocr_id);
} | static com.iucn.whp.dbservice.model.whp_sites_dsocr function( long whp_sites_dsocr_id) throws com.iucn.whp.dbservice.NoSuch_sites_dsocrException, com.liferay.portal.kernel.exception.SystemException { return getPersistence().remove(whp_sites_dsocr_id); } | /**
* Removes the whp_sites_dsocr with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param whp_sites_dsocr_id the primary key of the whp_sites_dsocr
* @return the whp_sites_dsocr that was removed
* @throws com.iucn.whp.dbservice.NoSuch_sites_dsocrException if a whp_sites_dsocr with the primary key could not be found
* @throws SystemException if a system exception occurred
*/ | Removes the whp_sites_dsocr with the primary key from the database. Also notifies the appropriate model listeners | remove | {
"repo_name": "iucn-whp/world-heritage-outlook",
"path": "portlets/iucn-dbservice-portlet/docroot/WEB-INF/service/com/iucn/whp/dbservice/service/persistence/whp_sites_dsocrUtil.java",
"license": "gpl-2.0",
"size": 10996
} | [
"com.liferay.portal.kernel.exception.SystemException"
] | import com.liferay.portal.kernel.exception.SystemException; | import com.liferay.portal.kernel.exception.*; | [
"com.liferay.portal"
] | com.liferay.portal; | 2,125,130 |
public List<org.objectweb.asm.commons.Method> getNeedsMethods() {
return needsMethods;
} | List<org.objectweb.asm.commons.Method> function() { return needsMethods; } | /**
* The {@code uses$varName} methods that must be implemented by Painless to complete implementing the interface.
*/ | The uses$varName methods that must be implemented by Painless to complete implementing the interface | getNeedsMethods | {
"repo_name": "pozhidaevak/elasticsearch",
"path": "modules/lang-painless/src/main/java/org/elasticsearch/painless/ScriptClassInfo.java",
"license": "apache-2.0",
"size": 9737
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,568,903 |
@Test
@Transactional
@JUnitHttpServer(port=7081,basicAuth=true)
public void testDelete() throws Exception {
OnmsNode n = m_nodeDao.findByForeignId("rancid", "1");
m_adapter.deleteNode(n.getId());
m_adapter.processPendingOperationForNode(m_deleteOperation);
Thread.sleep(3000);
} | @JUnitHttpServer(port=7081,basicAuth=true) void function() throws Exception { OnmsNode n = m_nodeDao.findByForeignId(STR, "1"); m_adapter.deleteNode(n.getId()); m_adapter.processPendingOperationForNode(m_deleteOperation); Thread.sleep(3000); } | /**
* TODO: This test needs to be updated so that it properly connects to the JUnitHttpServer
* for simulated RANCID REST operations.
* TODO: This test seems to pass even though it fails to connect with a mock RANCID server
*/ | for simulated RANCID REST operations | testDelete | {
"repo_name": "vishwaAbhinav/OpenNMS",
"path": "integrations/opennms-rancid-provisioning-adapter/src/test/java/org/opennms/netmgt/provision/RancidProvisioningAdapterTest.java",
"license": "gpl-2.0",
"size": 4790
} | [
"org.opennms.core.test.annotations.JUnitHttpServer",
"org.opennms.netmgt.model.OnmsNode"
] | import org.opennms.core.test.annotations.JUnitHttpServer; import org.opennms.netmgt.model.OnmsNode; | import org.opennms.core.test.annotations.*; import org.opennms.netmgt.model.*; | [
"org.opennms.core",
"org.opennms.netmgt"
] | org.opennms.core; org.opennms.netmgt; | 594,438 |
@Test
public void testSelectKeyIn() throws Throwable
{
createTable("CREATE TABLE %s (userid uuid PRIMARY KEY, firstname text, lastname text, age int)");
UUID id1 = UUID.fromString("550e8400-e29b-41d4-a716-446655440000");
UUID id2 = UUID.fromString("f47ac10b-58cc-4372-a567-0e02b2c3d479");
execute("INSERT INTO %s (userid, firstname, lastname, age) VALUES (?, 'Frodo', 'Baggins', 32)", id1);
execute("INSERT INTO %s (userid, firstname, lastname, age) VALUES (?, 'Samwise', 'Gamgee', 33)", id2);
assertRowCount(execute("SELECT firstname, lastname FROM %s WHERE userid IN (?, ?)", id1, id2), 2);
} | void function() throws Throwable { createTable(STR); UUID id1 = UUID.fromString(STR); UUID id2 = UUID.fromString(STR); execute(STR, id1); execute(STR, id2); assertRowCount(execute(STR, id1, id2), 2); } | /**
* Check query with KEY IN clause
* migrated from cql_tests.py:TestCQL.select_key_in_test()
*/ | Check query with KEY IN clause migrated from cql_tests.py:TestCQL.select_key_in_test() | testSelectKeyIn | {
"repo_name": "mourao666/cassandra-sim",
"path": "test/unit/org/apache/cassandra/cql3/validation/operations/SelectTest.java",
"license": "apache-2.0",
"size": 57348
} | [
"java.util.UUID"
] | import java.util.UUID; | import java.util.*; | [
"java.util"
] | java.util; | 475,246 |
public static PDAttributeObject create(COSDictionary dictionary)
{
String owner = dictionary.getNameAsString(COSName.O);
if (PDUserAttributeObject.OWNER_USER_PROPERTIES.equals(owner))
{
return new PDUserAttributeObject(dictionary);
}
else if (PDListAttributeObject.OWNER_LIST.equals(owner))
{
return new PDListAttributeObject(dictionary);
}
else if (PDPrintFieldAttributeObject.OWNER_PRINT_FIELD.equals(owner))
{
return new PDPrintFieldAttributeObject(dictionary);
}
else if (PDTableAttributeObject.OWNER_TABLE.equals(owner))
{
return new PDTableAttributeObject(dictionary);
}
else if (PDLayoutAttributeObject.OWNER_LAYOUT.equals(owner))
{
return new PDLayoutAttributeObject(dictionary);
}
else if (PDExportFormatAttributeObject.OWNER_XML_1_00.equals(owner)
|| PDExportFormatAttributeObject.OWNER_HTML_3_20.equals(owner)
|| PDExportFormatAttributeObject.OWNER_HTML_4_01.equals(owner)
|| PDExportFormatAttributeObject.OWNER_OEB_1_00.equals(owner)
|| PDExportFormatAttributeObject.OWNER_RTF_1_05.equals(owner)
|| PDExportFormatAttributeObject.OWNER_CSS_1_00.equals(owner)
|| PDExportFormatAttributeObject.OWNER_CSS_2_00.equals(owner))
{
return new PDExportFormatAttributeObject(dictionary);
}
return new PDDefaultAttributeObject(dictionary);
}
private PDStructureElement structureElement; | static PDAttributeObject function(COSDictionary dictionary) { String owner = dictionary.getNameAsString(COSName.O); if (PDUserAttributeObject.OWNER_USER_PROPERTIES.equals(owner)) { return new PDUserAttributeObject(dictionary); } else if (PDListAttributeObject.OWNER_LIST.equals(owner)) { return new PDListAttributeObject(dictionary); } else if (PDPrintFieldAttributeObject.OWNER_PRINT_FIELD.equals(owner)) { return new PDPrintFieldAttributeObject(dictionary); } else if (PDTableAttributeObject.OWNER_TABLE.equals(owner)) { return new PDTableAttributeObject(dictionary); } else if (PDLayoutAttributeObject.OWNER_LAYOUT.equals(owner)) { return new PDLayoutAttributeObject(dictionary); } else if (PDExportFormatAttributeObject.OWNER_XML_1_00.equals(owner) PDExportFormatAttributeObject.OWNER_HTML_3_20.equals(owner) PDExportFormatAttributeObject.OWNER_HTML_4_01.equals(owner) PDExportFormatAttributeObject.OWNER_OEB_1_00.equals(owner) PDExportFormatAttributeObject.OWNER_RTF_1_05.equals(owner) PDExportFormatAttributeObject.OWNER_CSS_1_00.equals(owner) PDExportFormatAttributeObject.OWNER_CSS_2_00.equals(owner)) { return new PDExportFormatAttributeObject(dictionary); } return new PDDefaultAttributeObject(dictionary); } private PDStructureElement structureElement; | /**
* Creates an attribute object.
*
* @param dictionary the dictionary
* @return the attribute object
*/ | Creates an attribute object | create | {
"repo_name": "TomRoush/PdfBox-Android",
"path": "library/src/main/java/com/tom_roush/pdfbox/pdmodel/documentinterchange/logicalstructure/PDAttributeObject.java",
"license": "apache-2.0",
"size": 7163
} | [
"com.tom_roush.pdfbox.cos.COSDictionary",
"com.tom_roush.pdfbox.cos.COSName",
"com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.PDExportFormatAttributeObject",
"com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.PDLayoutAttributeObject",
"com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.PDListAttributeObject",
"com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.PDPrintFieldAttributeObject",
"com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.PDTableAttributeObject"
] | import com.tom_roush.pdfbox.cos.COSDictionary; import com.tom_roush.pdfbox.cos.COSName; import com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.PDExportFormatAttributeObject; import com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.PDLayoutAttributeObject; import com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.PDListAttributeObject; import com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.PDPrintFieldAttributeObject; import com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.PDTableAttributeObject; | import com.tom_roush.pdfbox.cos.*; import com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.*; | [
"com.tom_roush.pdfbox"
] | com.tom_roush.pdfbox; | 2,600,728 |
public void setCrawlConfig(XmlConfiguration crawlConfig) {
this.crawlConfig = crawlConfig;
}
| void function(XmlConfiguration crawlConfig) { this.crawlConfig = crawlConfig; } | /**
* setter method
*
* @see CrawlConfigReader#crawlConfig
* @param crawlConfig
* the crawlConfig to set
*/ | setter method | setCrawlConfig | {
"repo_name": "owen-chen/crawl-center",
"path": "cc-crawl/src/main/java/org/archmage/cc/crawl/reader/CrawlConfigReader.java",
"license": "gpl-2.0",
"size": 2863
} | [
"org.archmage.cc.configuration.XmlConfiguration"
] | import org.archmage.cc.configuration.XmlConfiguration; | import org.archmage.cc.configuration.*; | [
"org.archmage.cc"
] | org.archmage.cc; | 355,386 |
private static void solveAll() {
File projectDirectory = new File("");
File problemsDirectory = new File(
projectDirectory.getAbsolutePath() +
File.separator + "src" + File.separator + "main" +
File.separator + "euler");
File[] files = problemsDirectory.listFiles();
Arrays.sort(files);
for (File problem: files) {
try {
System.out.println(
Class.forName(
"main.euler." + problem.getName()
.replace(".java", "")
.replace(".class","")
).getMethod("solve")
.invoke(null, null)
);
} catch (Exception e) {
System.out.println(
Constants.exceptionMessageSolver4
);
System.exit(1);
}
}
} | static void function() { File projectDirectory = new File(STRsrcSTRmainSTReulerSTRmain.euler.STR.javaSTRSTR.class","STRsolve") .invoke(null, null) ); } catch (Exception e) { System.out.println( Constants.exceptionMessageSolver4 ); System.exit(1); } } } | /**
* The {@code solveAll} method solves all the problems that have been
* implemented in this Java project.
*
* @since 1.0.1
*
* @see main.euler
*/ | The solveAll method solves all the problems that have been implemented in this Java project | solveAll | {
"repo_name": "StevyK/Project-Euler",
"path": "src/main/Solver.java",
"license": "gpl-3.0",
"size": 9643
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,228,337 |
public Map<String, ? extends Object> toMap() {
Map<String, Object> map = new HashMap<String, Object>();
map.putAll(overflow);
map.put("id", getId());
map.putAll(super.toMap());
return map;
} | Map<String, ? extends Object> function() { Map<String, Object> map = new HashMap<String, Object>(); map.putAll(overflow); map.put("id", getId()); map.putAll(super.toMap()); return map; } | /**
* Converts the Model (and all of its Java Bean properties) into a
* {@link java.util.Map}.
*/ | Converts the Model (and all of its Java Bean properties) into a <code>java.util.Map</code> | toMap | {
"repo_name": "snaphy/generator-snaphy",
"path": "generators/androidSdk/templates/snaphyandroidsdk/src/main/java/com/androidsdk/snaphy/snaphyandroidsdk/models/Model.java",
"license": "mit",
"size": 6306
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,634,475 |
File downloadAttachment(String applicationId, String filename,
String targetDirPath) throws CommonFrameworkException; | File downloadAttachment(String applicationId, String filename, String targetDirPath) throws CommonFrameworkException; | /**
* Download an Application attachment to the given directory.
*
* @param attachmentId
* @param targetDirPath
* @return
* @throws CommonFrameworkException
*/ | Download an Application attachment to the given directory | downloadAttachment | {
"repo_name": "blackducksoftware/cf-7x-connector",
"path": "src/main/java/com/blackducksoftware/tools/connector/codecenter/application/IApplicationManager.java",
"license": "apache-2.0",
"size": 9694
} | [
"com.blackducksoftware.tools.commonframework.core.exception.CommonFrameworkException",
"java.io.File"
] | import com.blackducksoftware.tools.commonframework.core.exception.CommonFrameworkException; import java.io.File; | import com.blackducksoftware.tools.commonframework.core.exception.*; import java.io.*; | [
"com.blackducksoftware.tools",
"java.io"
] | com.blackducksoftware.tools; java.io; | 2,623,452 |
private void cmdQuery(String line, boolean verboseEval)
throws NoSystemException {
Log.trace(this, line);
if (line.length() == 0) {
Log.error("Expression expected after `?'. Try `help'.");
return;
}
// compile query
MSystem system = system();
InputStream stream = new ByteArrayInputStream(line.getBytes());
Expression expr = OCLCompiler.compileExpression(
system.model(),
system.state(),
stream,
"<input>",
new PrintWriter(System.err),
system.varBindings());
// compile errors?
if (expr == null)
return;
// evaluate it with current system state
PrintWriter output = null;
Evaluator evaluator = new Evaluator(verboseEval);
if (verboseEval) {
Log.println("Detailed results of subexpressions:");
output = new PrintWriter(Log.out());
}
try {
Value val = evaluator.eval(expr, system.state(), system
.varBindings(), output);
// print result
System.out.println("-> " + val.toStringWithType());
if (verboseEval && Options.doGUI) {
Class<?> exprEvalBrowserClass = null;
try {
exprEvalBrowserClass = Class
.forName("org.tzi.use.gui.views.ExprEvalBrowser");
} catch (ClassNotFoundException e) {
Log
.error(
"Could not load GUI. Probably use-gui-...jar is missing.",
e);
System.exit(1);
}
try {
Method create = exprEvalBrowserClass.getMethod("create",
new Class[] { EvalNode.class, MSystem.class });
create.invoke(null, new Object[] {
evaluator.getEvalNodeRoot(), system() });
} catch (Exception e) {
Log.error("FATAL ERROR.", e);
System.exit(1);
}
}
} catch (MultiplicityViolationException e) {
System.out.println("-> " + "Could not evaluate. " + e.getMessage());
}
} | void function(String line, boolean verboseEval) throws NoSystemException { Log.trace(this, line); if (line.length() == 0) { Log.error(STR); return; } MSystem system = system(); InputStream stream = new ByteArrayInputStream(line.getBytes()); Expression expr = OCLCompiler.compileExpression( system.model(), system.state(), stream, STR, new PrintWriter(System.err), system.varBindings()); if (expr == null) return; PrintWriter output = null; Evaluator evaluator = new Evaluator(verboseEval); if (verboseEval) { Log.println(STR); output = new PrintWriter(Log.out()); } try { Value val = evaluator.eval(expr, system.state(), system .varBindings(), output); System.out.println(STR + val.toStringWithType()); if (verboseEval && Options.doGUI) { Class<?> exprEvalBrowserClass = null; try { exprEvalBrowserClass = Class .forName(STR); } catch (ClassNotFoundException e) { Log .error( STR, e); System.exit(1); } try { Method create = exprEvalBrowserClass.getMethod(STR, new Class[] { EvalNode.class, MSystem.class }); create.invoke(null, new Object[] { evaluator.getEvalNodeRoot(), system() }); } catch (Exception e) { Log.error(STR, e); System.exit(1); } } } catch (MultiplicityViolationException e) { System.out.println(STR + STR + e.getMessage()); } } | /**
* Performs a query.
*/ | Performs a query | cmdQuery | {
"repo_name": "vnu-dse/rtl",
"path": "src/main/org/tzi/use/main/shell/Shell.java",
"license": "gpl-2.0",
"size": 58992
} | [
"java.io.ByteArrayInputStream",
"java.io.InputStream",
"java.io.PrintWriter",
"java.lang.reflect.Method",
"org.tzi.use.config.Options",
"org.tzi.use.parser.ocl.OCLCompiler",
"org.tzi.use.uml.ocl.expr.EvalNode",
"org.tzi.use.uml.ocl.expr.Evaluator",
"org.tzi.use.uml.ocl.expr.Expression",
"org.tzi.use.uml.ocl.expr.MultiplicityViolationException",
"org.tzi.use.uml.ocl.value.Value",
"org.tzi.use.uml.sys.MSystem",
"org.tzi.use.util.Log"
] | import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.PrintWriter; import java.lang.reflect.Method; import org.tzi.use.config.Options; import org.tzi.use.parser.ocl.OCLCompiler; import org.tzi.use.uml.ocl.expr.EvalNode; import org.tzi.use.uml.ocl.expr.Evaluator; import org.tzi.use.uml.ocl.expr.Expression; import org.tzi.use.uml.ocl.expr.MultiplicityViolationException; import org.tzi.use.uml.ocl.value.Value; import org.tzi.use.uml.sys.MSystem; import org.tzi.use.util.Log; | import java.io.*; import java.lang.reflect.*; import org.tzi.use.config.*; import org.tzi.use.parser.ocl.*; import org.tzi.use.uml.ocl.expr.*; import org.tzi.use.uml.ocl.value.*; import org.tzi.use.uml.sys.*; import org.tzi.use.util.*; | [
"java.io",
"java.lang",
"org.tzi.use"
] | java.io; java.lang; org.tzi.use; | 247,759 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.