method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
private void logLicenseLevelViolation(LicenseLevelViolation violation) {
LicenseLevel annotation = violation.getLicenseAnnotation();
ActionStatisticsCollector.getInstance().log(ActionStatisticsCollector.TYPE_LICENSE_LEVEL, annotation.productId(),
annotation.comparison() + ":" + String.valueOf(annotation.prec... | void function(LicenseLevelViolation violation) { LicenseLevel annotation = violation.getLicenseAnnotation(); ActionStatisticsCollector.getInstance().log(ActionStatisticsCollector.TYPE_LICENSE_LEVEL, annotation.productId(), annotation.comparison() + ":" + String.valueOf(annotation.precedence())); } | /**
* Logs a license level violation.
*
* @param violation
* the {@link LicenseLevelViolation} to log
*/ | Logs a license level violation | logLicenseLevelViolation | {
"repo_name": "aborg0/rapidminer-studio",
"path": "src/main/java/com/rapidminer/core/license/ActionStatisticsLicenseManagerListener.java",
"license": "agpl-3.0",
"size": 4323
} | [
"com.rapidminer.license.annotation.LicenseLevel",
"com.rapidminer.license.violation.LicenseLevelViolation",
"com.rapidminer.tools.usagestats.ActionStatisticsCollector"
] | import com.rapidminer.license.annotation.LicenseLevel; import com.rapidminer.license.violation.LicenseLevelViolation; import com.rapidminer.tools.usagestats.ActionStatisticsCollector; | import com.rapidminer.license.annotation.*; import com.rapidminer.license.violation.*; import com.rapidminer.tools.usagestats.*; | [
"com.rapidminer.license",
"com.rapidminer.tools"
] | com.rapidminer.license; com.rapidminer.tools; | 1,374,590 |
@Test
public void lockReadAndCheckParent() throws Exception {
InodeFile inode1 = createInodeFile(1);
InodeDirectory dir1 = createInodeDirectory();
inode1.setParentId(dir1.getId());
inode1.lockReadAndCheckParent(dir1);
Assert.assertTrue(inode1.isReadLocked());
inode1.unlockRead();
} | void function() throws Exception { InodeFile inode1 = createInodeFile(1); InodeDirectory dir1 = createInodeDirectory(); inode1.setParentId(dir1.getId()); inode1.lockReadAndCheckParent(dir1); Assert.assertTrue(inode1.isReadLocked()); inode1.unlockRead(); } | /**
* Tests the {@link Inode#lockReadAndCheckParent(Inode)} method.
*/ | Tests the <code>Inode#lockReadAndCheckParent(Inode)</code> method | lockReadAndCheckParent | {
"repo_name": "ShailShah/alluxio",
"path": "core/server/master/src/test/java/alluxio/master/file/meta/InodeFileTest.java",
"license": "apache-2.0",
"size": 12811
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,747,770 |
private static void replaceInvocationsOfDefineClass0(CtClass javaClass) throws CannotCompileException {
CtMethod[] methods = javaClass.getDeclaredMethods();
for (int n = 0; n < methods.length; n++) {
CtMethod method = methods[n];
int modifiers = method.getModifiers();
| static void function(CtClass javaClass) throws CannotCompileException { CtMethod[] methods = javaClass.getDeclaredMethods(); for (int n = 0; n < methods.length; n++) { CtMethod method = methods[n]; int modifiers = method.getModifiers(); | /**
* Adds code which will intercept expressions which invoke defineClass0
*
* @param methods
* the methods to modify
* @throws CannotCompileException
*/ | Adds code which will intercept expressions which invoke defineClass0 | replaceInvocationsOfDefineClass0 | {
"repo_name": "ProfilingLabs/Usemon2",
"path": "usemon-agent-preinstrument-java/src/main/java/com/usemon/installer/ClassLoaderInstrumenter.java",
"license": "mpl-2.0",
"size": 6741
} | [
"com.usemon.lib.javassist.CannotCompileException",
"com.usemon.lib.javassist.CtClass",
"com.usemon.lib.javassist.CtMethod"
] | import com.usemon.lib.javassist.CannotCompileException; import com.usemon.lib.javassist.CtClass; import com.usemon.lib.javassist.CtMethod; | import com.usemon.lib.javassist.*; | [
"com.usemon.lib"
] | com.usemon.lib; | 215,408 |
@Test
public void test_submitForm_elementNotFound() {
try {
final String submitButtonValue = "mySubmitButton";
mockery.checking(new Expectations() {
{
one(form).getInputByValue(submitButtonValue);
will(throwException(new Ele... | void function() { try { final String submitButtonValue = STR; mockery.checking(new Expectations() { { one(form).getInputByValue(submitButtonValue); will(throwException(new ElementNotFoundException(submitButtonValue, STR, STR))); } }); try { Page result = utils.submitForm(form, submitButtonValue); fail(STR + ((result ==... | /**
* Tests:
* - Submit button value: Non-empty
* - Submit button with the specified value does not exist
* Expects:
* - ElementNotFoundException should be thrown as-is
*/ | Tests: - Submit button value: Non-empty - Submit button with the specified value does not exist Expects: - ElementNotFoundException should be thrown as-is | test_submitForm_elementNotFound | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.security.fat.common/test/com/ibm/ws/security/fat/common/web/WebFormUtilsTest.java",
"license": "epl-1.0",
"size": 26481
} | [
"com.gargoylesoftware.htmlunit.ElementNotFoundException",
"com.gargoylesoftware.htmlunit.Page",
"org.jmock.Expectations",
"org.junit.Assert"
] | import com.gargoylesoftware.htmlunit.ElementNotFoundException; import com.gargoylesoftware.htmlunit.Page; import org.jmock.Expectations; import org.junit.Assert; | import com.gargoylesoftware.htmlunit.*; import org.jmock.*; import org.junit.*; | [
"com.gargoylesoftware.htmlunit",
"org.jmock",
"org.junit"
] | com.gargoylesoftware.htmlunit; org.jmock; org.junit; | 933,131 |
public void addStateChangeListener(StateChangeListener<T> stateChangeListener)
{
requireNonNull(stateChangeListener, "stateChangeListener is null");
boolean inTerminalState;
synchronized (lock) {
inTerminalState = isTerminalState(state);
if (!inTerminalState) {
... | void function(StateChangeListener<T> stateChangeListener) { requireNonNull(stateChangeListener, STR); boolean inTerminalState; synchronized (lock) { inTerminalState = isTerminalState(state); if (!inTerminalState) { stateChangeListeners.add(stateChangeListener); } } if (inTerminalState) { stateChangeListener.stateChange... | /**
* Adds a listener to be notified when the state instance changes according to {@code .equals()}.
*/ | Adds a listener to be notified when the state instance changes according to .equals() | addStateChangeListener | {
"repo_name": "svstanev/presto",
"path": "presto-main/src/main/java/com/facebook/presto/execution/StateMachine.java",
"license": "apache-2.0",
"size": 12538
} | [
"java.util.Objects"
] | import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 453,598 |
public static void shutdownModules(ServletContext servletContext) {
String realPath = getRealPath(servletContext);
// clear the module messages
String messagesPath = realPath + "/WEB-INF/";
File folder = new File(messagesPath.replace("/", File.separator));
if (folder.exists()) {
Properties empt... | static void function(ServletContext servletContext) { String realPath = getRealPath(servletContext); String messagesPath = realPath + STR; File folder = new File(messagesPath.replace("/", File.separator)); if (folder.exists()) { Properties emptyProperties = new Properties(); for (File f : folder.listFiles()) { if (f.ge... | /**
* Reverses all activities done by startModule(org.openmrs.module.Module) Normal stop/shutdown
* is done by ModuleFactory
*/ | Reverses all activities done by startModule(org.openmrs.module.Module) Normal stop/shutdown is done by ModuleFactory | shutdownModules | {
"repo_name": "pselle/openmrs-core",
"path": "web/src/main/java/org/openmrs/module/web/WebModuleUtil.java",
"license": "mpl-2.0",
"size": 38092
} | [
"java.io.File",
"java.util.Properties",
"javax.servlet.ServletContext",
"org.openmrs.module.Module",
"org.openmrs.module.ModuleFactory",
"org.openmrs.util.OpenmrsUtil"
] | import java.io.File; import java.util.Properties; import javax.servlet.ServletContext; import org.openmrs.module.Module; import org.openmrs.module.ModuleFactory; import org.openmrs.util.OpenmrsUtil; | import java.io.*; import java.util.*; import javax.servlet.*; import org.openmrs.module.*; import org.openmrs.util.*; | [
"java.io",
"java.util",
"javax.servlet",
"org.openmrs.module",
"org.openmrs.util"
] | java.io; java.util; javax.servlet; org.openmrs.module; org.openmrs.util; | 1,819,670 |
@Test
public void testProxiedAnonymousAccess() throws Exception {
final Response response = super.testCreateProcessor(helper.getBaseUrl(), helper.getAnonymousUser());
// ensure the request is successful
Assert.assertEquals(201, response.getStatus());
// get the entity body
... | void function() throws Exception { final Response response = super.testCreateProcessor(helper.getBaseUrl(), helper.getAnonymousUser()); Assert.assertEquals(201, response.getStatus()); final ProcessorEntity entity = response.readEntity(ProcessorEntity.class); final ProcessorDTO processor = entity.getComponent(); Assert.... | /**
* Attempt to create a processor anonymously.
*
* @throws Exception ex
*/ | Attempt to create a processor anonymously | testProxiedAnonymousAccess | {
"repo_name": "aperepel/nifi",
"path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/integration/accesscontrol/anonymous/ITAllowProxiedAnonymousAccess.java",
"license": "apache-2.0",
"size": 2426
} | [
"javax.ws.rs.core.Response",
"org.apache.nifi.web.api.dto.ProcessorDTO",
"org.apache.nifi.web.api.entity.ProcessorEntity",
"org.junit.Assert"
] | import javax.ws.rs.core.Response; import org.apache.nifi.web.api.dto.ProcessorDTO; import org.apache.nifi.web.api.entity.ProcessorEntity; import org.junit.Assert; | import javax.ws.rs.core.*; import org.apache.nifi.web.api.dto.*; import org.apache.nifi.web.api.entity.*; import org.junit.*; | [
"javax.ws",
"org.apache.nifi",
"org.junit"
] | javax.ws; org.apache.nifi; org.junit; | 754,836 |
public static ZonedDateTimeMatcher sameInstant(ZonedDateTime date) {
return new ZonedDateTimeMatcher(date);
} | static ZonedDateTimeMatcher function(ZonedDateTime date) { return new ZonedDateTimeMatcher(date); } | /**
* Creates a matcher that matches when the examined string reprensents the same instant as the reference datetime
* @param date the reference datetime against which the examined string is checked
*/ | Creates a matcher that matches when the examined string reprensents the same instant as the reference datetime | sameInstant | {
"repo_name": "Niky4000/UsefulUtils",
"path": "projects/tutorials-master/tutorials-master/jhipster/jhipster-microservice/gateway-app/src/test/java/com/gateway/web/rest/TestUtil.java",
"license": "gpl-3.0",
"size": 4378
} | [
"java.time.ZonedDateTime"
] | import java.time.ZonedDateTime; | import java.time.*; | [
"java.time"
] | java.time; | 2,088,046 |
public Self setWaitForActiveShards(ActiveShardCount activeShardCount) {
this.activeShardCount = activeShardCount;
return self();
}
/**
* A shortcut for {@link #setWaitForActiveShards(ActiveShardCount)} where the numerical
* shard count is passed in, instead of having to first call... | Self function(ActiveShardCount activeShardCount) { this.activeShardCount = activeShardCount; return self(); } /** * A shortcut for {@link #setWaitForActiveShards(ActiveShardCount)} where the numerical * shard count is passed in, instead of having to first call {@link ActiveShardCount#from(int)} | /**
* Sets the number of shard copies that must be active before proceeding with the write.
* See {@link ReplicationRequest#waitForActiveShards(ActiveShardCount)} for details.
*/ | Sets the number of shard copies that must be active before proceeding with the write. See <code>ReplicationRequest#waitForActiveShards(ActiveShardCount)</code> for details | setWaitForActiveShards | {
"repo_name": "gmarz/elasticsearch",
"path": "modules/reindex/src/main/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequest.java",
"license": "apache-2.0",
"size": 12499
} | [
"org.elasticsearch.action.support.ActiveShardCount"
] | import org.elasticsearch.action.support.ActiveShardCount; | import org.elasticsearch.action.support.*; | [
"org.elasticsearch.action"
] | org.elasticsearch.action; | 1,728,781 |
public void setLastModifiedAfter(Date lastModifiedAfter) {
this.lastModifiedAfter =
(lastModifiedAfter==null)?null:(Date)lastModifiedAfter.clone();
} | void function(Date lastModifiedAfter) { this.lastModifiedAfter = (lastModifiedAfter==null)?null:(Date)lastModifiedAfter.clone(); } | /**
* Setter for property {@code lastModifiedAfter}.
* @param lastModifiedAfter A file will be selected only if it was
* last modified after {@code lastModifiedAfter}.
* <br>This condition is ignored if {@code lastModifiedAfter} is
* {@code null}.
*/ | Setter for property lastModifiedAfter | setLastModifiedAfter | {
"repo_name": "greghaskins/openjdk-jdk7u-jdk",
"path": "src/share/sample/jmx/jmx-scandir/src/com/sun/jmx/examples/scandir/config/FileMatch.java",
"license": "gpl-2.0",
"size": 11595
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,628,624 |
public void addLabel(SymbolTable table, String symbol) throws MaltChainedException;
public void addLabel(SymbolTable table, int code) throws MaltChainedException;
public void addLabel(LabelSet labelSet) throws MaltChainedException;
public boolean hasLabel(SymbolTable table) throws MaltChainedException;
... | void addLabel(SymbolTable table, String symbol) throws MaltChainedException; public void addLabel(SymbolTable table, int code) throws MaltChainedException; public void addLabel(LabelSet labelSet) throws MaltChainedException; public boolean hasLabel(SymbolTable table) throws MaltChainedException; public String getLabelS... | /**
* Returns the label set.
*
* @return the label set.
*/ | Returns the label set | getLabelSet | {
"repo_name": "VivianLuwenHuangfu/processors",
"path": "src/main/java/org/maltparserx/core/syntaxgraph/Element.java",
"license": "apache-2.0",
"size": 3593
} | [
"java.util.Set",
"org.maltparserx.core.exception.MaltChainedException",
"org.maltparserx.core.symbol.SymbolTable"
] | import java.util.Set; import org.maltparserx.core.exception.MaltChainedException; import org.maltparserx.core.symbol.SymbolTable; | import java.util.*; import org.maltparserx.core.exception.*; import org.maltparserx.core.symbol.*; | [
"java.util",
"org.maltparserx.core"
] | java.util; org.maltparserx.core; | 258,731 |
@Autowired
public void setUtil(Util util) {
this.util = util;
}
| void function(Util util) { this.util = util; } | /**
* Spring use - DI
* @param util
*/ | Spring use - DI | setUtil | {
"repo_name": "IvanSantiago/retopublico",
"path": "MiMappir/src/mx/gob/sct/utic/mimappir/sigtic/services/SOL_A_EXT_Service.java",
"license": "gpl-2.0",
"size": 3138
} | [
"mx.gob.sct.utic.mimappir.util.Util"
] | import mx.gob.sct.utic.mimappir.util.Util; | import mx.gob.sct.utic.mimappir.util.*; | [
"mx.gob.sct"
] | mx.gob.sct; | 2,443,732 |
public String getStartDate(String dateFormat){
DateFormat df = new SimpleDateFormat(dateFormat,Locale.getDefault());
String date = df.format(start);
return date;
}
| String function(String dateFormat){ DateFormat df = new SimpleDateFormat(dateFormat,Locale.getDefault()); String date = df.format(start); return date; } | /**
* Get the start date of the event
*
* @return start date
*/ | Get the start date of the event | getStartDate | {
"repo_name": "marcio0493/Geconp",
"path": "app/src/main/java/br/com/geconp/geconp/calendar/Event.java",
"license": "mit",
"size": 2129
} | [
"java.text.DateFormat",
"java.text.SimpleDateFormat",
"java.util.Locale"
] | import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Locale; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 672,879 |
protected List<UserRemoteConfig> remoteConfigs() throws IOException {
List<UserRemoteConfig> list = new ArrayList<UserRemoteConfig>();
list.add(new UserRemoteConfig(testGitDir.getAbsolutePath(), "origin", "", null));
return list;
} | List<UserRemoteConfig> function() throws IOException { List<UserRemoteConfig> list = new ArrayList<UserRemoteConfig>(); list.add(new UserRemoteConfig(testGitDir.getAbsolutePath(), STR, "", null)); return list; } | /**
* Returns list of UserRemoteConfig for this repository.
*
* @return list of UserRemoteConfig for this repository
* @throws IOException
*/ | Returns list of UserRemoteConfig for this repository | remoteConfigs | {
"repo_name": "Jellyvision/git-plugin",
"path": "src/test/java/hudson/plugins/git/AbstractGitRepository.java",
"license": "mit",
"size": 3354
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.List"
] | import java.io.IOException; import java.util.ArrayList; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,032,196 |
protected Action delayThrowException(long msDelay, Throwable throwable) {
return new DelayedThrowAction(throwable, msDelay);
} | Action function(long msDelay, Throwable throwable) { return new DelayedThrowAction(throwable, msDelay); } | /**
* A JMock action similar to throwException but that only throws the exception AFTER a specified delay
*
* It can provide a neat workaround for testing multiple competing threads
*
* @param msDelay
* The delay in milli seconds to wait
* @param throwable
* ... | A JMock action similar to throwException but that only throws the exception AFTER a specified delay It can provide a neat workaround for testing multiple competing threads | delayThrowException | {
"repo_name": "GeoscienceAustralia/Auscope-portal-core",
"path": "src/main/java/org/auscope/portal/core/test/PortalTestClass.java",
"license": "lgpl-3.0",
"size": 11357
} | [
"org.auscope.portal.core.test.jmock.DelayedThrowAction",
"org.jmock.api.Action"
] | import org.auscope.portal.core.test.jmock.DelayedThrowAction; import org.jmock.api.Action; | import org.auscope.portal.core.test.jmock.*; import org.jmock.api.*; | [
"org.auscope.portal",
"org.jmock.api"
] | org.auscope.portal; org.jmock.api; | 1,969,433 |
private void sendOsgiEvent(final String path,
final Map<String, Object> properties,
final String topic,
final ChangedAttributes changedAttributes) {
if (changedAttributes != null) {
changedAttributes.mergeAttributesInto(properties);
}
// set ... | void function(final String path, final Map<String, Object> properties, final String topic, final ChangedAttributes changedAttributes) { if (changedAttributes != null) { changedAttributes.mergeAttributesInto(properties); } properties.put(SlingConstants.PROPERTY_PATH, path); properties.put(EventConstants.EVENT_TOPIC, top... | /**
* Send an OSGi event based on a JCR Observation Event.
*
* @param path The path too the node where the event occurred.
* @param properties The base properties for this event.
* @param topic The topic that should be used for the OSGi event.
*/ | Send an OSGi event based on a JCR Observation Event | sendOsgiEvent | {
"repo_name": "MRivas-XumaK/slingBuild",
"path": "bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java",
"license": "apache-2.0",
"size": 16708
} | [
"java.util.Map",
"org.apache.sling.api.SlingConstants",
"org.osgi.service.event.EventConstants"
] | import java.util.Map; import org.apache.sling.api.SlingConstants; import org.osgi.service.event.EventConstants; | import java.util.*; import org.apache.sling.api.*; import org.osgi.service.event.*; | [
"java.util",
"org.apache.sling",
"org.osgi.service"
] | java.util; org.apache.sling; org.osgi.service; | 1,860,238 |
public void apply(ApiRequest request, IPolicyContext context, Object config, IPolicyChain<ApiRequest> chain); | void function(ApiRequest request, IPolicyContext context, Object config, IPolicyChain<ApiRequest> chain); | /**
* Applies a policy upon a {@link ApiRequest} based on information
* included in the request itself in addition to its context and configuration.
*
* @param request an inbound request to apply to the policy to
* @param context contextual information
* @param config the policy's configu... | Applies a policy upon a <code>ApiRequest</code> based on information included in the request itself in addition to its context and configuration | apply | {
"repo_name": "cmoulliard/apiman",
"path": "gateway/engine/core/src/main/java/io/apiman/gateway/engine/policy/IPolicy.java",
"license": "apache-2.0",
"size": 2509
} | [
"io.apiman.gateway.engine.beans.ApiRequest"
] | import io.apiman.gateway.engine.beans.ApiRequest; | import io.apiman.gateway.engine.beans.*; | [
"io.apiman.gateway"
] | io.apiman.gateway; | 15,544 |
public void actionExit() throws IOException, JspException, ServletException {
if (getAction() == ACTION_CANCEL) {
// save and exit was canceled
return;
}
// unlock resource, if no modified
actionClear(false);
// close the editor
a... | void function() throws IOException, JspException, ServletException { if (getAction() == ACTION_CANCEL) { return; } actionClear(false); actionClose(); } | /**
* Performs the exit editor action.<p>
*
* @see org.opencms.workplace.editors.CmsEditor#actionExit()
*/ | Performs the exit editor action | actionExit | {
"repo_name": "comundus/opencms-comundus",
"path": "src/main/java/org/opencms/workplace/editors/CmsSimpleEditor.java",
"license": "lgpl-2.1",
"size": 8725
} | [
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.jsp.JspException"
] | import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.jsp.JspException; | import java.io.*; import javax.servlet.*; import javax.servlet.jsp.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 1,121,431 |
public FluentStringsMap add(String key, Collection<String> values) {
if (key != null && isNonEmpty(values)) {
List<String> curValues = this.values.get(key);
if (curValues == null) {
this.values.put(key, new ArrayList<String>(values));
} else {
... | FluentStringsMap function(String key, Collection<String> values) { if (key != null && isNonEmpty(values)) { List<String> curValues = this.values.get(key); if (curValues == null) { this.values.put(key, new ArrayList<String>(values)); } else { curValues.addAll(values); } } return this; } | /**
* Adds the specified values and returns this object.
*
* @param key The key
* @param values The value(s); if the array is null then this method has no effect
* @return This object
*/ | Adds the specified values and returns this object | add | {
"repo_name": "ggeorg/chillverse",
"path": "async-http-client/src/main/java/com/ning/http/client/FluentStringsMap.java",
"license": "apache-2.0",
"size": 12219
} | [
"com.ning.http.util.MiscUtils",
"java.util.ArrayList",
"java.util.Collection",
"java.util.List"
] | import com.ning.http.util.MiscUtils; import java.util.ArrayList; import java.util.Collection; import java.util.List; | import com.ning.http.util.*; import java.util.*; | [
"com.ning.http",
"java.util"
] | com.ning.http; java.util; | 884,330 |
@Test
public void testSetStringMapProperty() {
TestJsonObject testJsonObject = JsonObjectFactory.get().createJsonObject(TestJsonObject.class);
JsonStringMap testStringMapProperty = JsonObjectFactory.get().createJsonObject(JsonStringMap.class);
testJsonObject.setTestStringMapProperty(testStringMapPr... | void function() { TestJsonObject testJsonObject = JsonObjectFactory.get().createJsonObject(TestJsonObject.class); JsonStringMap testStringMapProperty = JsonObjectFactory.get().createJsonObject(JsonStringMap.class); testJsonObject.setTestStringMapProperty(testStringMapProperty); assertEquals(testStringMapProperty, testJ... | /**
* Test the setting of the string map value of a property.
* <p>
* This test asserts that the setting of the string map value of a property
* changes the value of the corresponding property of the underlying JSON
* object.
*/ | Test the setting of the string map value of a property. This test asserts that the setting of the string map value of a property changes the value of the corresponding property of the underlying JSON object | testSetStringMapProperty | {
"repo_name": "kjots/json-toolkit",
"path": "json-object.shared/src/test/java/org/kjots/json/object/shared/JsonObjectGeneratorStringTestBase.java",
"license": "apache-2.0",
"size": 19168
} | [
"junit.framework.Assert"
] | import junit.framework.Assert; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 1,713,682 |
public static List<DetailAST> getTypeParameters(final DetailAST node) {
final DetailAST typeParameters =
node.findFirstToken(TokenTypes.TYPE_PARAMETERS);
final List<DetailAST> typeParams = Lists.newArrayList();
if (typeParameters != null) {
final DetailAST typeParam ... | static List<DetailAST> function(final DetailAST node) { final DetailAST typeParameters = node.findFirstToken(TokenTypes.TYPE_PARAMETERS); final List<DetailAST> typeParams = Lists.newArrayList(); if (typeParameters != null) { final DetailAST typeParam = typeParameters.findFirstToken(TokenTypes.TYPE_PARAMETER); typeParam... | /**
* Retrieves the type parameters to the node.
* @param node the parameterised AST node
* @return a list of type parameter names
*/ | Retrieves the type parameters to the node | getTypeParameters | {
"repo_name": "Godin/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/CheckUtils.java",
"license": "lgpl-2.1",
"size": 11150
} | [
"com.google.common.collect.Lists",
"com.puppycrawl.tools.checkstyle.api.DetailAST",
"com.puppycrawl.tools.checkstyle.api.TokenTypes",
"java.util.List"
] | import com.google.common.collect.Lists; import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import java.util.List; | import com.google.common.collect.*; import com.puppycrawl.tools.checkstyle.api.*; import java.util.*; | [
"com.google.common",
"com.puppycrawl.tools",
"java.util"
] | com.google.common; com.puppycrawl.tools; java.util; | 1,600,519 |
final Star star = new Star(StarType.SUN, 1, 2);
assertEquals("sun age: 1 years mass: 2 tons", star.toString());
star.timePasses();
assertEquals("red giant age: 2 years mass: 16 tons", star.toString());
star.timePasses();
assertEquals("white dwarf age: 4 years mass: 128 tons", star.toString());
... | final Star star = new Star(StarType.SUN, 1, 2); assertEquals(STR, star.toString()); star.timePasses(); assertEquals(STR, star.toString()); star.timePasses(); assertEquals(STR, star.toString()); star.timePasses(); assertEquals(STR, star.toString()); star.timePasses(); assertEquals(STR, star.toString()); star.timePasses(... | /**
* Verify the stages of a dying sun, without going back in time
*/ | Verify the stages of a dying sun, without going back in time | testTimePasses | {
"repo_name": "WeRockStar/java-design-patterns",
"path": "memento/src/test/java/com/iluwatar/memento/StarTest.java",
"license": "mit",
"size": 3346
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,403,858 |
public boolean hasHaltedSteps() {
// not yet 100% sure of this, if there are no steps... or none halted?
if ( steps == null ) {
return false;
}
for ( int i = 0; i < steps.size(); i++ ) {
StepMetaDataCombi sid = steps.get( i );
if ( sid.data.getStatus() == StepExecutionStatus.STATUS_... | boolean function() { if ( steps == null ) { return false; } for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); if ( sid.data.getStatus() == StepExecutionStatus.STATUS_HALTED ) { return true; } } return false; } | /**
* Checks whether the transformation has any steps that are halted.
*
* @return true if one or more steps are halted, false otherwise
*/ | Checks whether the transformation has any steps that are halted | hasHaltedSteps | {
"repo_name": "AndreyBurikhin/pentaho-kettle",
"path": "engine/src/org/pentaho/di/trans/Trans.java",
"license": "apache-2.0",
"size": 190705
} | [
"org.pentaho.di.trans.step.BaseStepData",
"org.pentaho.di.trans.step.StepMetaDataCombi"
] | import org.pentaho.di.trans.step.BaseStepData; import org.pentaho.di.trans.step.StepMetaDataCombi; | import org.pentaho.di.trans.step.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 1,358,892 |
protected synchronized void initLookUp() {
int i;
String name;
String escaped;
List<String> names;
HashMap<String,Integer> indices;
if (m_Names == null) {
names = new ArrayList<String>();
indices = new HashMap<String,Integer>();
if (m_Data != null) {
for (i = ... | synchronized void function() { int i; String name; String escaped; List<String> names; HashMap<String,Integer> indices; if (m_Names == null) { names = new ArrayList<String>(); indices = new HashMap<String,Integer>(); if (m_Data != null) { for (i = 0; i < getNumNames(m_Data); i++) { name = getName(m_Data, i); names.add(... | /**
* Initializes the lookup tables.
*/ | Initializes the lookup tables | initLookUp | {
"repo_name": "waikato-datamining/adams-base",
"path": "adams-core/src/main/java/adams/core/AbstractDataBackedRange.java",
"license": "gpl-3.0",
"size": 8004
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.HashMap",
"java.util.List"
] | import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,178,064 |
private PlaybackEvent createEvent(AudioDevice dev, int id)
{
return new PlaybackEvent(this, id, dev.getPosition());
} | PlaybackEvent function(AudioDevice dev, int id) { return new PlaybackEvent(this, id, dev.getPosition()); } | /**
* Constructs a <code>PlaybackEvent</code>
*/ | Constructs a <code>PlaybackEvent</code> | createEvent | {
"repo_name": "dubenju/javay",
"path": "src/java/javazoom/jl/player/advanced/AdvancedPlayer.java",
"license": "apache-2.0",
"size": 6097
} | [
"javazoom.jl.player.AudioDevice"
] | import javazoom.jl.player.AudioDevice; | import javazoom.jl.player.*; | [
"javazoom.jl.player"
] | javazoom.jl.player; | 792,219 |
public Object[] listSubscribableBaseChannels(User loggedInUser, Integer sid)
throws FaultException {
//Get the logged in user and server
Server server = lookupServer(loggedInUser, sid);
Channel baseChannel = server.getBaseChannel();
List<Map<String, Object>> returnList =... | Object[] function(User loggedInUser, Integer sid) throws FaultException { Server server = lookupServer(loggedInUser, sid); Channel baseChannel = server.getBaseChannel(); List<Map<String, Object>> returnList = new ArrayList<Map<String, Object>>(); List<EssentialChannelDto> list = ChannelManager.listBaseChannelsForSystem... | /**
* Gets a list of base channels subscribable by the logged in user for the server with
* the given id.
* @param loggedInUser The current user
* @param sid The id of the server in question
* @return Returns an array of maps representing the base channels the logged in user
* can subscrib... | Gets a list of base channels subscribable by the logged in user for the server with the given id | listSubscribableBaseChannels | {
"repo_name": "moio/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java",
"license": "gpl-2.0",
"size": 230187
} | [
"com.redhat.rhn.FaultException",
"com.redhat.rhn.domain.channel.Channel",
"com.redhat.rhn.domain.server.Server",
"com.redhat.rhn.domain.user.User",
"com.redhat.rhn.frontend.dto.EssentialChannelDto",
"com.redhat.rhn.manager.channel.ChannelManager",
"java.util.ArrayList",
"java.util.List",
"java.util.... | import com.redhat.rhn.FaultException; import com.redhat.rhn.domain.channel.Channel; import com.redhat.rhn.domain.server.Server; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.dto.EssentialChannelDto; import com.redhat.rhn.manager.channel.ChannelManager; import java.util.ArrayList; import java.ut... | import com.redhat.rhn.*; import com.redhat.rhn.domain.channel.*; import com.redhat.rhn.domain.server.*; import com.redhat.rhn.domain.user.*; import com.redhat.rhn.frontend.dto.*; import com.redhat.rhn.manager.channel.*; import java.util.*; | [
"com.redhat.rhn",
"java.util"
] | com.redhat.rhn; java.util; | 227,592 |
public static <E> Predicate<Collection<E>> contains(E element) {
return new CollectionContainsPredicate<>(element);
}
private enum CollectionIsEmptyPredicate implements Predicate<Collection<?>> {
INSTANCE; | static <E> Predicate<Collection<E>> function(E element) { return new CollectionContainsPredicate<>(element); } private enum CollectionIsEmptyPredicate implements Predicate<Collection<?>> { INSTANCE; | /**
* Returns a {@link Predicate} instance to test a {@link Collection} containing the specified {@code element} .
*
* @param element the element to test
* @param <E> the concrete element type of the collection
* @return the {@link Predicate} instance.
*/ | Returns a <code>Predicate</code> instance to test a <code>Collection</code> containing the specified element | contains | {
"repo_name": "raistlic/raistlic-lib-commons-core",
"path": "src/main/java/org/raistlic/common/predicate/CollectionPredicates.java",
"license": "apache-2.0",
"size": 3070
} | [
"java.util.Collection",
"java.util.function.Predicate"
] | import java.util.Collection; import java.util.function.Predicate; | import java.util.*; import java.util.function.*; | [
"java.util"
] | java.util; | 1,141,617 |
@Test
public void testSerialization() throws IOException, ClassNotFoundException {
MonthDateFormat mf1 = new MonthDateFormat();
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(buffer);
out.writeObject(mf1);
out... | void function() throws IOException, ClassNotFoundException { MonthDateFormat mf1 = new MonthDateFormat(); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(mf1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buf... | /**
* Serialize an instance, restore it, and check for equality.
*/ | Serialize an instance, restore it, and check for equality | testSerialization | {
"repo_name": "oskopek/jfreechart-fse",
"path": "src/test/java/org/jfree/chart/axis/MonthDateFormatTest.java",
"license": "lgpl-2.1",
"size": 6006
} | [
"java.io.ByteArrayInputStream",
"java.io.ByteArrayOutputStream",
"java.io.IOException",
"java.io.ObjectInput",
"java.io.ObjectInputStream",
"java.io.ObjectOutput",
"java.io.ObjectOutputStream",
"org.junit.Assert"
] | import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectInputStream; import java.io.ObjectOutput; import java.io.ObjectOutputStream; import org.junit.Assert; | import java.io.*; import org.junit.*; | [
"java.io",
"org.junit"
] | java.io; org.junit; | 1,575,021 |
public static <T extends Annotation> Class<T> checkBindingAnnotation(Class<T> annotationType) {
Preconditions.checkNotNull(annotationType);
boolean bindingAnnotation = annotationType.isAnnotationPresent(BindingAnnotation.class);
boolean qualifier = annotationType.isAnnotationPresent(Qualifier.class);
... | static <T extends Annotation> Class<T> function(Class<T> annotationType) { Preconditions.checkNotNull(annotationType); boolean bindingAnnotation = annotationType.isAnnotationPresent(BindingAnnotation.class); boolean qualifier = annotationType.isAnnotationPresent(Qualifier.class); Preconditions.checkArgument(bindingAnno... | /**
* Checks that the given annotation type is a {@link BindingAnnotation @BindingAnnotation}.
*
* @param annotationType The annotation type to check.
* @param <T> The type of the binding annotation.
* @return The checked binding annotation type.
* @throws NullPointerException If the given {@code anno... | Checks that the given annotation type is a <code>BindingAnnotation @BindingAnnotation</code> | checkBindingAnnotation | {
"repo_name": "abel-von/commons",
"path": "src/java/com/twitter/common/inject/Bindings.java",
"license": "apache-2.0",
"size": 11136
} | [
"com.google.common.base.Preconditions",
"com.google.inject.BindingAnnotation",
"java.lang.annotation.Annotation",
"javax.inject.Qualifier"
] | import com.google.common.base.Preconditions; import com.google.inject.BindingAnnotation; import java.lang.annotation.Annotation; import javax.inject.Qualifier; | import com.google.common.base.*; import com.google.inject.*; import java.lang.annotation.*; import javax.inject.*; | [
"com.google.common",
"com.google.inject",
"java.lang",
"javax.inject"
] | com.google.common; com.google.inject; java.lang; javax.inject; | 1,426,843 |
public boolean isGrouped(GroupAwareEntity entity) {
return entity.getAccess().equals(AccessMode.GROUPED);
} | boolean function(GroupAwareEntity entity) { return entity.getAccess().equals(AccessMode.GROUPED); } | /**
* Determine if this entity has been restricted to specific group(s)
*/ | Determine if this entity has been restricted to specific group(s) | isGrouped | {
"repo_name": "harfalm/Sakai-10.1",
"path": "podcasts/podcasts-impl/impl/src/java/org/sakaiproject/component/app/podcasts/PodcastPermissionsServiceImpl.java",
"license": "apache-2.0",
"size": 6481
} | [
"org.sakaiproject.content.api.GroupAwareEntity"
] | import org.sakaiproject.content.api.GroupAwareEntity; | import org.sakaiproject.content.api.*; | [
"org.sakaiproject.content"
] | org.sakaiproject.content; | 1,709,011 |
public void actionPerformed(ActionEvent e) {
this.dialogExit();
}
private SystemInfoPane sysPane;
private JPanel buttonPanel;
private UITabbedPane tabbedPane;
private UIButton okButton;
| void function(ActionEvent e) { this.dialogExit(); } private SystemInfoPane sysPane; private JPanel buttonPanel; private UITabbedPane tabbedPane; private UIButton okButton; | /**
* Called when the ok button is clicked.
*/ | Called when the ok button is clicked | actionPerformed | {
"repo_name": "fanruan/finereport-design",
"path": "designer_base/src/com/fr/design/actions/help/AboutDialog.java",
"license": "gpl-3.0",
"size": 3065
} | [
"com.fr.design.gui.frpane.UITabbedPane",
"com.fr.design.gui.ibutton.UIButton",
"java.awt.event.ActionEvent",
"javax.swing.JPanel"
] | import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.ibutton.UIButton; import java.awt.event.ActionEvent; import javax.swing.JPanel; | import com.fr.design.gui.frpane.*; import com.fr.design.gui.ibutton.*; import java.awt.event.*; import javax.swing.*; | [
"com.fr.design",
"java.awt",
"javax.swing"
] | com.fr.design; java.awt; javax.swing; | 2,263,776 |
public List executeQuery(String query, SessionDataBean sessionDataBean, boolean isSecureExecute, Map queryResultObjectDataMap)
throws ClassNotFoundException, DAOException
{
return executeQuery(query, sessionDataBean, isSecureExecute, false, queryResultObjectDataMap, -1, -1).getResult();
}
| List function(String query, SessionDataBean sessionDataBean, boolean isSecureExecute, Map queryResultObjectDataMap) throws ClassNotFoundException, DAOException { return executeQuery(query, sessionDataBean, isSecureExecute, false, queryResultObjectDataMap, -1, -1).getResult(); } | /**
* Executes the query.
* @param query
* @param sessionDataBean TODO
* @param isSecureExecute TODO
* @param columnIdsMap
* @return
* @throws ClassNotFoundException
* @throws SQLException
*/ | Executes the query | executeQuery | {
"repo_name": "NCIP/cab2b",
"path": "software/dependencies/commonpackage/HEAD_TAG_10_Jan_2007_RELEASE_BRANCH_FOR_V11/src/edu/wustl/common/dao/JDBCDAOImpl.java",
"license": "bsd-3-clause",
"size": 26999
} | [
"edu.wustl.common.beans.SessionDataBean",
"edu.wustl.common.util.dbManager.DAOException",
"java.util.List",
"java.util.Map"
] | import edu.wustl.common.beans.SessionDataBean; import edu.wustl.common.util.dbManager.DAOException; import java.util.List; import java.util.Map; | import edu.wustl.common.beans.*; import edu.wustl.common.util.*; import java.util.*; | [
"edu.wustl.common",
"java.util"
] | edu.wustl.common; java.util; | 954,624 |
ProjectRole selectByPrimaryKey(Integer id); | ProjectRole selectByPrimaryKey(Integer id); | /**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table m_prj_role
*
* @mbggenerated Tue Sep 08 09:15:22 ICT 2015
*/ | This method was generated by MyBatis Generator. This method corresponds to the database table m_prj_role | selectByPrimaryKey | {
"repo_name": "onlylin/mycollab",
"path": "mycollab-services/src/main/java/com/esofthead/mycollab/module/project/dao/ProjectRoleMapper.java",
"license": "agpl-3.0",
"size": 5550
} | [
"com.esofthead.mycollab.module.project.domain.ProjectRole"
] | import com.esofthead.mycollab.module.project.domain.ProjectRole; | import com.esofthead.mycollab.module.project.domain.*; | [
"com.esofthead.mycollab"
] | com.esofthead.mycollab; | 1,583,099 |
protected int handleFrame() throws IOException {
if (inFrame.c) {
switch (inFrame.type) {
case TYPE_SETTINGS: {
int cnt = inFrame.readInt();
for (int i = 0; i < cnt; i++) {
inFrame.readByte();
inFrame.read24();
... | int function() throws IOException { if (inFrame.c) { switch (inFrame.type) { case TYPE_SETTINGS: { int cnt = inFrame.readInt(); for (int i = 0; i < cnt; i++) { inFrame.readByte(); inFrame.read24(); inFrame.readInt(); } break; } case TYPE_GOAWAY: { int lastStream = inFrame.readInt(); log.info(STR + lastStream); abort(ST... | /**
* Process a SPDY connection. Called in the input thread, should not
* block.
*
* @throws IOException
*/ | Process a SPDY connection. Called in the input thread, should not block | handleFrame | {
"repo_name": "plumer/codana",
"path": "tomcat_files/8.0.21/SpdyConnection.java",
"license": "mit",
"size": 22525
} | [
"java.io.IOException",
"java.util.logging.Level"
] | import java.io.IOException; import java.util.logging.Level; | import java.io.*; import java.util.logging.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 927,294 |
@Override
public void setPlayerAtXY(Player playerWhoPlaced, int row, int column) {
super.setPlayerAtXY(playerWhoPlaced, row, column);
swapTilesAfterMove(playerWhoPlaced, convertXYToPos(row, column));
} | void function(Player playerWhoPlaced, int row, int column) { super.setPlayerAtXY(playerWhoPlaced, row, column); swapTilesAfterMove(playerWhoPlaced, convertXYToPos(row, column)); } | /**
* Places a player at a certain position 0-63.
* Updates the board afterwards.
* @param playerWhoPlaced The player that placed the move.
* @param row The row the move was placed on. (0-7)
* @param column The column the move was placed on. (0-7)
*/ | Places a player at a certain position 0-63. Updates the board afterwards | setPlayerAtXY | {
"repo_name": "HanzehogeschoolSICT/E4-PROJECT-AI",
"path": "src/nl/hanze2017e4/gameclient/model/games/reversi/ReversiBoard.java",
"license": "mit",
"size": 8686
} | [
"nl.hanze2017e4.gameclient.model.master.Player"
] | import nl.hanze2017e4.gameclient.model.master.Player; | import nl.hanze2017e4.gameclient.model.master.*; | [
"nl.hanze2017e4.gameclient"
] | nl.hanze2017e4.gameclient; | 430,185 |
public TreeNode queryForSingleton(Query query) throws IllegalStateException {
return query(queryBuilder().chain(query).ensureUnique().build()).iterator().next();
} | TreeNode function(Query query) throws IllegalStateException { return query(queryBuilder().chain(query).ensureUnique().build()).iterator().next(); } | /**
* Return the unique node selected by running this query against this
* {@code ContextManager}'s root context.
* <p>
* If this query does not return a single unique result then an
* {@code IllegalStateException} will be thrown. More details on the query
* execution context can be found in {@link #... | Return the unique node selected by running this query against this ContextManager's root context. If this query does not return a single unique result then an IllegalStateException will be thrown. More details on the query execution context can be found in <code>#query(Query)</code> | queryForSingleton | {
"repo_name": "ljacomet/statistics",
"path": "src/main/java/org/terracotta/context/ContextManager.java",
"license": "apache-2.0",
"size": 10248
} | [
"org.terracotta.context.query.Query"
] | import org.terracotta.context.query.Query; | import org.terracotta.context.query.*; | [
"org.terracotta.context"
] | org.terracotta.context; | 1,068,684 |
@ApiModelProperty(example = "null", required = true, value = "Total number of kills against enemy factions since faction warfare began")
public Integer getTotal() {
return total;
} | @ApiModelProperty(example = "null", required = true, value = STR) Integer function() { return total; } | /**
* Total number of kills against enemy factions since faction warfare began
*
* @return total
**/ | Total number of kills against enemy factions since faction warfare began | getTotal | {
"repo_name": "GoldenGnu/eve-esi",
"path": "src/main/java/net/troja/eve/esi/model/FactionWarfareStatsKills.java",
"license": "apache-2.0",
"size": 4013
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 631,584 |
private void initTimeBgRect(float topPaddingSize) {
float mHourLeft;
float mMinuteLeft;
float mSecondLeft;
boolean isInitHasBackgroundTextBaseY = false;
if (isShowDay) {
// initialize day background and border rectF
if (isShowTimeBgBorder) {
... | void function(float topPaddingSize) { float mHourLeft; float mMinuteLeft; float mSecondLeft; boolean isInitHasBackgroundTextBaseY = false; if (isShowDay) { if (isShowTimeBgBorder) { mDayBgBorderRectF = new RectF(mLeftPaddingSize, topPaddingSize, mLeftPaddingSize + mDayTimeBgWidth + (mTimeBgBorderSize * 2), topPaddingSi... | /**
* initialize time initialize rectF
*/ | initialize time initialize rectF | initTimeBgRect | {
"repo_name": "iwgang/CountdownView",
"path": "library/src/main/java/cn/iwgang/countdownview/BackgroundCountdown.java",
"license": "mit",
"size": 23489
} | [
"android.graphics.RectF"
] | import android.graphics.RectF; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 177,836 |
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == RC_READ){
if(resultCode == RESULT_OK){
Credential credential = data.getParcelableExtra(Credential.... | void function(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode == RC_READ){ if(resultCode == RESULT_OK){ Credential credential = data.getParcelableExtra(Credential.EXTRA_KEY); signInWithPassword(credential.getId(), credential.getPassword()); } else { ... | /**
* Result of dialog for the user to select account
* @param requestCode Intent unique request code type
* @param resultCode Whether or not approved
* @param data Intent data
*/ | Result of dialog for the user to select account | onActivityResult | {
"repo_name": "Punpuf/MenuDoCandidato",
"path": "UEM - Menu Do Candidato/app/src/main/java/com/punpuf/uem_menudocandidato/ui/HomeActivity.java",
"license": "mit",
"size": 30029
} | [
"android.content.Intent",
"android.view.View",
"com.google.android.gms.auth.api.credentials.Credential"
] | import android.content.Intent; import android.view.View; import com.google.android.gms.auth.api.credentials.Credential; | import android.content.*; import android.view.*; import com.google.android.gms.auth.api.credentials.*; | [
"android.content",
"android.view",
"com.google.android"
] | android.content; android.view; com.google.android; | 1,998,352 |
public void copyCategoryProps(Configuration fromConfig, String[] ctgys)
{
if (ctgys == null)
ctgys = this.getCategoryNames().toArray(new String[this.getCategoryNames().size()]);
for (String ctgy : ctgys)
if (fromConfig.hasCategory(ctgy) && this.hasCategory(ctgy))
... | void function(Configuration fromConfig, String[] ctgys) { if (ctgys == null) ctgys = this.getCategoryNames().toArray(new String[this.getCategoryNames().size()]); for (String ctgy : ctgys) if (fromConfig.hasCategory(ctgy) && this.hasCategory(ctgy)) { ConfigCategory thiscc = this.getCategory(ctgy); ConfigCategory fromcc ... | /**
* Copies property objects from another Configuration object to this one using the list of category names. Properties that only exist in the
* "from" object are ignored. Pass null for the ctgys array to include all categories.
*/ | Copies property objects from another Configuration object to this one using the list of category names. Properties that only exist in the "from" object are ignored. Pass null for the ctgys array to include all categories | copyCategoryProps | {
"repo_name": "SuperUnitato/UnLonely",
"path": "build/tmp/recompileMc/sources/net/minecraftforge/common/config/Configuration.java",
"license": "lgpl-2.1",
"size": 66254
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,158,090 |
protected void flush () throws java.io.IOException
{
flush(agent.getOutputStream());
} | void function () throws java.io.IOException { flush(agent.getOutputStream()); } | /**
* Flush buffer to outputstream
*
*
* @exception IOException
*/ | Flush buffer to outputstream | flush | {
"repo_name": "kavin256/Derby",
"path": "java/drda/org/apache/derby/impl/drda/DDMWriter.java",
"license": "apache-2.0",
"size": 61268
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,465,613 |
return ImmutableList.of();
}
class StandardMetrics implements MetricSet {
protected final List<ContextAwareMetric> contextAwareMetrics;
protected final Map<String, Metric> rawMetrics;
public StandardMetrics() {
this.contextAwareMetrics = Lists.newArrayList();
this.rawMetrics = Maps.newHash... | return ImmutableList.of(); } class StandardMetrics implements MetricSet { protected final List<ContextAwareMetric> contextAwareMetrics; protected final Map<String, Metric> rawMetrics; public StandardMetrics() { this.contextAwareMetrics = Lists.newArrayList(); this.rawMetrics = Maps.newHashMap(); } | /**
* Get multiple standard metrics.
*/ | Get multiple standard metrics | getStandardMetricsCollection | {
"repo_name": "arjun4084346/gobblin",
"path": "gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/StandardMetricsBridge.java",
"license": "apache-2.0",
"size": 2039
} | [
"com.codahale.metrics.Metric",
"com.codahale.metrics.MetricSet",
"com.google.common.collect.ImmutableList",
"com.google.common.collect.Lists",
"com.google.common.collect.Maps",
"java.util.List",
"java.util.Map",
"org.apache.gobblin.metrics.ContextAwareMetric"
] | import com.codahale.metrics.Metric; import com.codahale.metrics.MetricSet; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import java.util.List; import java.util.Map; import org.apache.gobblin.metrics.ContextAwareMetric; | import com.codahale.metrics.*; import com.google.common.collect.*; import java.util.*; import org.apache.gobblin.metrics.*; | [
"com.codahale.metrics",
"com.google.common",
"java.util",
"org.apache.gobblin"
] | com.codahale.metrics; com.google.common; java.util; org.apache.gobblin; | 219,883 |
public void keyTyped(KeyEvent e) {
} | void function(KeyEvent e) { } | /**
* Does nothing.
*
* @param e
* the KeyEvent
*/ | Does nothing | keyTyped | {
"repo_name": "mibischo/freemind",
"path": "accessories/plugins/time/JDayChooser.java",
"license": "gpl-2.0",
"size": 27143
} | [
"java.awt.event.KeyEvent"
] | import java.awt.event.KeyEvent; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 1,864,508 |
public void setRefreshListener(SwipeRefreshLayout.OnRefreshListener listener) {
mPtrLayout.setEnabled(true);
mPtrLayout.setOnRefreshListener(listener);
} | void function(SwipeRefreshLayout.OnRefreshListener listener) { mPtrLayout.setEnabled(true); mPtrLayout.setOnRefreshListener(listener); } | /**
* Set the listener when refresh is triggered and enable the SwipeRefreshLayout
*
* @param listener
*/ | Set the listener when refresh is triggered and enable the SwipeRefreshLayout | setRefreshListener | {
"repo_name": "vihuela/Lulu",
"path": "SuperRecyclerView/src/main/java/com/malinskiy/superrecyclerview/SuperRecyclerView.java",
"license": "apache-2.0",
"size": 18846
} | [
"android.support.v4.widget.SwipeRefreshLayout"
] | import android.support.v4.widget.SwipeRefreshLayout; | import android.support.v4.widget.*; | [
"android.support"
] | android.support; | 954,095 |
public B validate(final Map<String, Object> map) {
map.forEach(this::validate);
return self;
} | B function(final Map<String, Object> map) { map.forEach(this::validate); return self; } | /**
* Adds the given map of paths with their corresponding control values for validation.
*
* @param map Map of paths with control values
* @return The modified builder
*/ | Adds the given map of paths with their corresponding control values for validation | validate | {
"repo_name": "christophd/citrus",
"path": "vintage/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageActionBuilder.java",
"license": "apache-2.0",
"size": 27963
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,680,452 |
void renewAll() throws LeaseMapException, RemoteException; | void renewAll() throws LeaseMapException, RemoteException; | /**
* Renews all leases in the LeaseMap, using their current values as
* the renewal durations. If all renewals are successful, returns
* normally. Otherwise, removes all leases that failed to renew
* from the LeaseMap, and throws LeaseMapException.
*
* @throws LeaseMapException if one ... | Renews all leases in the LeaseMap, using their current values as the renewal durations. If all renewals are successful, returns normally. Otherwise, removes all leases that failed to renew from the LeaseMap, and throws LeaseMapException | renewAll | {
"repo_name": "pfirmstone/JGDMS",
"path": "JGDMS/jgdms-platform/src/main/java/net/jini/core/lease/LeaseMap.java",
"license": "apache-2.0",
"size": 2803
} | [
"java.rmi.RemoteException"
] | import java.rmi.RemoteException; | import java.rmi.*; | [
"java.rmi"
] | java.rmi; | 561,832 |
private void processGroup(HierarchicalConfiguration cfg,
String namespace, Group parentGroup) {
String name = expand(prefix(cfg.getString(NAME), namespace));
String command = expand(cfg.getString(COMMAND, parentGroup != null ? parentGroup.command() : null));
Str... | void function(HierarchicalConfiguration cfg, String namespace, Group parentGroup) { String name = expand(prefix(cfg.getString(NAME), namespace)); String command = expand(cfg.getString(COMMAND, parentGroup != null ? parentGroup.command() : null)); String env = expand(cfg.getString(ENV, parentGroup != null ? parentGroup.... | /**
* Processes a group directive.
*
* @param cfg hierarchical definition
* @param namespace optional namespace
* @param parentGroup optional parent group
*/ | Processes a group directive | processGroup | {
"repo_name": "kuangrewawa/OnosFw",
"path": "utils/stc/src/main/java/org/onlab/stc/Compiler.java",
"license": "apache-2.0",
"size": 16429
} | [
"org.apache.commons.configuration.HierarchicalConfiguration"
] | import org.apache.commons.configuration.HierarchicalConfiguration; | import org.apache.commons.configuration.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,481,232 |
List<String> errorStrings = new ArrayList<String>();
//Get the error title and main message
String errorTitle = getErrorDataByFieldName("title", response);
if (!errorTitle.isEmpty()) {
errorStrings.add(String.format("%s", errorTitle));
}
//Get the error... | List<String> errorStrings = new ArrayList<String>(); String errorTitle = getErrorDataByFieldName("title", response); if (!errorTitle.isEmpty()) { errorStrings.add(String.format("%s", errorTitle)); } String errorDetailMessage = getErrorDataByFieldName(STR, response); if (!errorDetailMessage.isEmpty()) { errorStrings.add... | /**
* Parse any errors from the returned HTML/javascript from Octopus
* @param response The Octopus html response that may include error data
* @return A list of error strings
*/ | Parse any errors from the returned HTML/javascript from Octopus | getErrorsFromResponse | {
"repo_name": "vistaprint/octopus-jenkins-plugin",
"path": "src/main/java/com/octopusdeploy/api/ErrorParser.java",
"license": "mit",
"size": 3787
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,865,314 |
//@ requires isNominal() || isString() || isRelationValued();
//@ requires 0 <= index && index < m_Values.size();
final void delete(int index) {
if (!isNominal() && !isString() && !isRelationValued())
throw new IllegalArgumentException("Can only remove value of " +
... | final void delete(int index) { if (!isNominal() && !isString() && !isRelationValued()) throw new IllegalArgumentException(STR + STR + STR); else { m_Values = (FastVector)m_Values.copy(); m_Values.removeElementAt(index); if (!isRelationValued()) { Hashtable hash = new Hashtable(m_Hashtable.size()); Enumeration enu = m_H... | /**
* Removes a value of a nominal, string, or relation-valued
* attribute. Creates a fresh list of attribute values before
* removing it.
*
* @param index the value's index
* @throws IllegalArgumentException if the attribute is not
* of the correct type
*/ | Removes a value of a nominal, string, or relation-valued attribute. Creates a fresh list of attribute values before removing it | delete | {
"repo_name": "williamClanton/singularity",
"path": "weka/src/main/java/weka/core/Attribute.java",
"license": "mit",
"size": 51065
} | [
"java.util.Enumeration",
"java.util.Hashtable"
] | import java.util.Enumeration; import java.util.Hashtable; | import java.util.*; | [
"java.util"
] | java.util; | 1,630,181 |
return personParty;
}
/**
* Sets the value of the personParty property.
*
* @param value
* allowed object is
* {@link Person }
| return personParty; } /** * Sets the value of the personParty property. * * @param value * allowed object is * {@link Person } | /**
* Gets the value of the personParty property.
*
* @return
* possible object is
* {@link Person }
*
*/ | Gets the value of the personParty property | getPersonParty | {
"repo_name": "dushmis/Oracle-Cloud",
"path": "PaaS_SaaS_Accelerator_RESTFulFacade/XJC_Beans/src/com/oracle/xmlns/apps/crmcommon/salesparties/salespartiesservice/types/MergePersonParty.java",
"license": "bsd-3-clause",
"size": 2081
} | [
"com.oracle.xmlns.apps.cdm.foundation.parties.personservice.Person"
] | import com.oracle.xmlns.apps.cdm.foundation.parties.personservice.Person; | import com.oracle.xmlns.apps.cdm.foundation.parties.personservice.*; | [
"com.oracle.xmlns"
] | com.oracle.xmlns; | 2,128,444 |
public boolean convertSimpleConfigToPaths() {
SimpleYamlConfiguration simpleConfig = null;
try {
simpleConfig = new SimpleYamlConfiguration(plugin, "SimpleConfig.yml", "SimpleConfig");
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
... | boolean function() { SimpleYamlConfiguration simpleConfig = null; try { simpleConfig = new SimpleYamlConfiguration(plugin, STR, STR); } catch (InvalidConfigurationException e) { e.printStackTrace(); } String newPathsFileName = STR; SimpleYamlConfiguration newPathsFile = null; try { newPathsFile = new SimpleYamlConfigur... | /**
* Convert the SimpleConfig file to the new format of the Paths.yml file.
*
* @return true if correctly converted, false otherwise.
*/ | Convert the SimpleConfig file to the new format of the Paths.yml file | convertSimpleConfigToPaths | {
"repo_name": "Armarr/Autorank-2",
"path": "src/me/armar/plugins/autorank/converter/DataConverter.java",
"license": "gpl-3.0",
"size": 12778
} | [
"java.util.HashMap",
"java.util.Map",
"me.armar.plugins.autorank.config.SimpleYamlConfiguration",
"org.bukkit.configuration.InvalidConfigurationException"
] | import java.util.HashMap; import java.util.Map; import me.armar.plugins.autorank.config.SimpleYamlConfiguration; import org.bukkit.configuration.InvalidConfigurationException; | import java.util.*; import me.armar.plugins.autorank.config.*; import org.bukkit.configuration.*; | [
"java.util",
"me.armar.plugins",
"org.bukkit.configuration"
] | java.util; me.armar.plugins; org.bukkit.configuration; | 941,189 |
protected LinesToCharsResult diff_linesToChars(String text1, String text2) {
List<String> lineArray = new ArrayList<String>();
Map<String, Integer> lineHash = new HashMap<String, Integer>();
// e.g. linearray[4] == "Hello\n"
// e.g. linehash.get("Hello\n") == 4
// "\x00" is a valid character, but... | LinesToCharsResult function(String text1, String text2) { List<String> lineArray = new ArrayList<String>(); Map<String, Integer> lineHash = new HashMap<String, Integer>(); lineArray.add(""); String chars1 = diff_linesToCharsMunge(text1, lineArray, lineHash); String chars2 = diff_linesToCharsMunge(text2, lineArray, line... | /**
* Split two texts into a list of strings. Reduce the texts to a string of
* hashes where each Unicode character represents one line.
* @param text1 First string.
* @param text2 Second string.
* @return An object containing the encoded text1, the encoded text2 and
* the List of unique strings.... | Split two texts into a list of strings. Reduce the texts to a string of hashes where each Unicode character represents one line | diff_linesToChars | {
"repo_name": "visik7/webfilesys",
"path": "src/main/webapp/WEB-INF/source/name/fraser/neil/plaintext/diff_match_patch.java",
"license": "gpl-3.0",
"size": 84995
} | [
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] | import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 224,632 |
public final FileDescriptor getFD() throws IOException {
if (fd != null) {
return fd;
}
throw new IOException();
}
/**
* Returns the unique {@link java.nio.channels.FileChannel FileChannel} | final FileDescriptor function() throws IOException { if (fd != null) { return fd; } throw new IOException(); } /** * Returns the unique {@link java.nio.channels.FileChannel FileChannel} | /**
* Returns the <code>FileDescriptor</code>
* object that represents the connection to
* the actual file in the file system being
* used by this <code>FileInputStream</code>.
*
* @return the file descriptor object associated with this stream.
* @exception IOException if an I/... | Returns the <code>FileDescriptor</code> object that represents the connection to the actual file in the file system being used by this <code>FileInputStream</code> | getFD | {
"repo_name": "rokn/Count_Words_2015",
"path": "testing/openjdk2/jdk/src/share/classes/java/io/FileInputStream.java",
"license": "mit",
"size": 15008
} | [
"java.nio.channels.FileChannel"
] | import java.nio.channels.FileChannel; | import java.nio.channels.*; | [
"java.nio"
] | java.nio; | 1,305,751 |
@Override
public Item addItemAfter(Object previousItemId, Object newItemId)
throws UnsupportedOperationException {
Item item = ((Container.Ordered) items).addItemAfter(previousItemId,
newItemId);
if (!(items instanceof Container.ItemSetChangeNotifier)) {
r... | Item function(Object previousItemId, Object newItemId) throws UnsupportedOperationException { Item item = ((Container.Ordered) items).addItemAfter(previousItemId, newItemId); if (!(items instanceof Container.ItemSetChangeNotifier)) { refreshRowCache(); } return item; } | /**
* Adds new item after the given item.
*
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object,
* java.lang.Object)
*/ | Adds new item after the given item | addItemAfter | {
"repo_name": "oalles/vaadin",
"path": "server/src/com/vaadin/ui/Table.java",
"license": "apache-2.0",
"size": 221060
} | [
"com.vaadin.data.Container",
"com.vaadin.data.Item"
] | import com.vaadin.data.Container; import com.vaadin.data.Item; | import com.vaadin.data.*; | [
"com.vaadin.data"
] | com.vaadin.data; | 1,659,454 |
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
newChildDescriptors.add
(createChildParameter
(CausalityPackage.Literals.TEMPLATE__ELEMENTS,
CausalityFactory.eINSTANCE.createC... | void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add (createChildParameter (CausalityPackage.Literals.TEMPLATE__ELEMENTS, CausalityFactory.eINSTANCE.createConditional())); newChildDescriptors.add (createChildParamet... | /**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object. | collectNewChildDescriptors | {
"repo_name": "Nasdanika/amur-lang",
"path": "org.nasdanika.amur.lang.causality.edit/src/org/nasdanika/amur/lang/causality/provider/TemplateItemProvider.java",
"license": "epl-1.0",
"size": 6151
} | [
"java.util.Collection",
"org.nasdanika.amur.lang.causality.CausalityFactory",
"org.nasdanika.amur.lang.causality.CausalityPackage"
] | import java.util.Collection; import org.nasdanika.amur.lang.causality.CausalityFactory; import org.nasdanika.amur.lang.causality.CausalityPackage; | import java.util.*; import org.nasdanika.amur.lang.causality.*; | [
"java.util",
"org.nasdanika.amur"
] | java.util; org.nasdanika.amur; | 451,439 |
public static boolean findEntityRecursively(final EntityContainer container, final UUID id) {
final AtomicBoolean found = new AtomicBoolean();
walkEntityTree(container, e -> {
if (id.equals(e.getID())) {
found.set(true);
return EntityVisitResult.EXIT;
} else {
return EntityVisitResult.CONTINUE;
... | static boolean function(final EntityContainer container, final UUID id) { final AtomicBoolean found = new AtomicBoolean(); walkEntityTree(container, e -> { if (id.equals(e.getID())) { found.set(true); return EntityVisitResult.EXIT; } else { return EntityVisitResult.CONTINUE; } }); return found.get(); } | /**
* Walks through the entity tree looking for an entity.
*
* @param container
* Entity container.
* @param id
* Entity ID to look for.
* @return Whether the entity was found.
*
* @see #walkEntityTree(EntityContainer, EntityVisitor)
*/ | Walks through the entity tree looking for an entity | findEntityRecursively | {
"repo_name": "Ellzord/JALSE",
"path": "src/main/java/jalse/entities/Entities.java",
"license": "apache-2.0",
"size": 18542
} | [
"java.util.concurrent.atomic.AtomicBoolean"
] | import java.util.concurrent.atomic.AtomicBoolean; | import java.util.concurrent.atomic.*; | [
"java.util"
] | java.util; | 1,555,298 |
public void addUserInterceptor(String username, int index, PacketInterceptor interceptor) {
List<PacketInterceptor> userInterceptors = usersInterceptors.get(username);
if (userInterceptors == null) {
userInterceptors = new CopyOnWriteArrayList<>();
usersInterceptors.put(usern... | void function(String username, int index, PacketInterceptor interceptor) { List<PacketInterceptor> userInterceptors = usersInterceptors.get(username); if (userInterceptors == null) { userInterceptors = new CopyOnWriteArrayList<>(); usersInterceptors.put(username, userInterceptors); } else { if (index < 0 (index > userI... | /**
* Inserts a new interceptor at specified index in the list of currently configured
* interceptors for a specific username. This interceptor will be used only when a packet
* was sent or received by the specified username.
*
* @param username the name of the user.
* @param index the ind... | Inserts a new interceptor at specified index in the list of currently configured interceptors for a specific username. This interceptor will be used only when a packet was sent or received by the specified username | addUserInterceptor | {
"repo_name": "saveendhiman/OpenfirePluginSample",
"path": "openfiresource/src/org/jivesoftware/openfire/interceptor/InterceptorManager.java",
"license": "apache-2.0",
"size": 11727
} | [
"java.util.List",
"java.util.concurrent.CopyOnWriteArrayList"
] | import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; | import java.util.*; import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,873,056 |
public final Map<CAttribute, Double> damage()
{
return m_damage;
} | final Map<CAttribute, Double> function() { return m_damage; } | /**
* damage of the attack
*
* @return attack map
*/ | damage of the attack | damage | {
"repo_name": "flashpixx/RoutingSimulation",
"path": "src/main/java/org/lightjason/examples/pokemon/simulation/agent/pokemon/CAttack.java",
"license": "lgpl-3.0",
"size": 4769
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,143,116 |
private void removeOldLauncherJars() {
final File[] launcherJars = getLauncherJarFiles();
if (launcherJars != null && launcherJars.length > 0) {
// Remove all files except current one
final File current = getLauncherJarFile();
for(File f : launcherJars) {
... | void function() { final File[] launcherJars = getLauncherJarFiles(); if (launcherJars != null && launcherJars.length > 0) { final File current = getLauncherJarFile(); for(File f : launcherJars) { if(f.getAbsolutePath().equals(current.getAbsolutePath())) { continue; } String versionInfo = null; try { FileBundleVersionIn... | /**
* Removes old candidate launcher JAR files leaving the most recent one as
* the launcher JAR file to use on next Sling startup.
*/ | Removes old candidate launcher JAR files leaving the most recent one as the launcher JAR file to use on next Sling startup | removeOldLauncherJars | {
"repo_name": "dulvac/sling",
"path": "launchpad/base/src/main/java/org/apache/sling/launchpad/base/shared/Loader.java",
"license": "apache-2.0",
"size": 17952
} | [
"java.io.File",
"java.io.IOException",
"org.apache.sling.commons.osgi.bundleversion.FileBundleVersionInfo"
] | import java.io.File; import java.io.IOException; import org.apache.sling.commons.osgi.bundleversion.FileBundleVersionInfo; | import java.io.*; import org.apache.sling.commons.osgi.bundleversion.*; | [
"java.io",
"org.apache.sling"
] | java.io; org.apache.sling; | 846,797 |
return AppleScript.execute(
"tell application \"GrowlHelperApp\"\n" +
"\t"+appleScript+"\n" +
"end tell",
null);
}
/////////////////////////////////////
// AbstractNotifier implementation //
///////////////////////////////////// | return AppleScript.execute( STRGrowlHelperApp\"\n" + "\t"+appleScript+"\n" + STR, null); } | /**
* Puts the given AppleScript bit inside a <code>tell application / end tell</code> block, executes the script
* and returns <code>true</code> if it was successfully executed.
*
* @param appleScript the AppleScript bit to execute
* @return true if the script was successfully executed
*/ | Puts the given AppleScript bit inside a <code>tell application / end tell</code> block, executes the script and returns <code>true</code> if it was successfully executed | tellGrowl | {
"repo_name": "raisercostin/mucommander-2",
"path": "src/main/com/mucommander/ui/notifier/GrowlNotifier.java",
"license": "gpl-3.0",
"size": 9764
} | [
"com.mucommander.ui.macosx.AppleScript"
] | import com.mucommander.ui.macosx.AppleScript; | import com.mucommander.ui.macosx.*; | [
"com.mucommander.ui"
] | com.mucommander.ui; | 354,669 |
@SuppressWarnings("unchecked")
public synchronized void removeApplication(RMApp app) {
ApplicationStateData appState =
ApplicationStateData.newInstance(
app.getSubmitTime(), app.getStartTime(),
app.getApplicationSubmissionContext(), app.getUser());
for(RMAppAttempt appAttempt... | @SuppressWarnings(STR) synchronized void function(RMApp app) { ApplicationStateData appState = ApplicationStateData.newInstance( app.getSubmitTime(), app.getStartTime(), app.getApplicationSubmissionContext(), app.getUser()); for(RMAppAttempt appAttempt : app.getAppAttempts().values()) { appState.attempts.put(appAttempt... | /**
* Non-blocking API
* ResourceManager services call this to remove an application from the state
* store
* This does not block the dispatcher threads
* There is no notification of completion for this operation.
*/ | Non-blocking API ResourceManager services call this to remove an application from the state store This does not block the dispatcher threads There is no notification of completion for this operation | removeApplication | {
"repo_name": "cnfire/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/RMStateStore.java",
"license": "apache-2.0",
"size": 41654
} | [
"org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationStateData",
"org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp",
"org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt"
] | import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationStateData; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt; | import org.apache.hadoop.yarn.server.resourcemanager.recovery.records.*; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.*; import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 728,741 |
private void generateProperties(
PrintWriter pw,
File targetFile,
File srcFile,
Locale locale)
{
if (srcFile.exists() && srcFile.canRead() && !targetFile.equals(srcFile)) {
try {
final FileReader reader = new FileReader(srcFile);
... | void function( PrintWriter pw, File targetFile, File srcFile, Locale locale) { if (srcFile.exists() && srcFile.canRead() && !targetFile.equals(srcFile)) { try { final FileReader reader = new FileReader(srcFile); final char[] cbuf = new char[1000]; int charsRead; while ((charsRead = reader.read(cbuf)) > 0) { pw.write(cb... | /**
* Generates a properties file for a given locale. If there is a source
* file for the locale, it is copied. Otherwise generates a file with
* headers but no resources.
*
* @param pw Output file writer
* @param targetFile the locale-specific output file
* @param srcFile The locale-... | Generates a properties file for a given locale. If there is a source file for the locale, it is copied. Otherwise generates a file with headers but no resources | generateProperties | {
"repo_name": "amitkr/power-architect",
"path": "ext-tools-home/resgen/src/org/eigenbase/resgen/XmlFileTask.java",
"license": "gpl-3.0",
"size": 14392
} | [
"java.io.File",
"java.io.FileReader",
"java.io.IOException",
"java.io.PrintWriter",
"java.util.Date",
"java.util.Locale",
"org.apache.tools.ant.BuildException"
] | import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import java.util.Date; import java.util.Locale; import org.apache.tools.ant.BuildException; | import java.io.*; import java.util.*; import org.apache.tools.ant.*; | [
"java.io",
"java.util",
"org.apache.tools"
] | java.io; java.util; org.apache.tools; | 2,500,978 |
public Marker addMarker(double latitude, double longitude, String title, String snippet,
boolean moveCameraToLocation, boolean playAnimation) {
this.moveCameraToLocation = moveCameraToLocation;
return addMarker(latitude, longitude, title, snippet, playAnimation);
} | Marker function(double latitude, double longitude, String title, String snippet, boolean moveCameraToLocation, boolean playAnimation) { this.moveCameraToLocation = moveCameraToLocation; return addMarker(latitude, longitude, title, snippet, playAnimation); } | /**
* Add a marker to the map
*
* @param latitude : Latitude
* @param longitude : Longitude
* @param title : The message to be shown
* @param snippet : The snippet to be shown
* @param moveCameraToLocation : Move the camera to the loc... | Add a marker to the map | addMarker | {
"repo_name": "gfirem/ElRosaCruz",
"path": "branches/development/android/sources/ElRosaCruz/app/src/main/java/com/gfirem/elrosacruz/utils/MapHelper.java",
"license": "apache-2.0",
"size": 23598
} | [
"com.google.android.gms.maps.model.Marker"
] | import com.google.android.gms.maps.model.Marker; | import com.google.android.gms.maps.model.*; | [
"com.google.android"
] | com.google.android; | 1,631,916 |
public boolean waitForNodeManagersToConnect(long timeout)
throws YarnException, InterruptedException {
ResourceManager rm = getResourceManager();
GetClusterMetricsRequest req = GetClusterMetricsRequest.newInstance();
for (int i = 0; i < timeout / 100; i++) {
if (nodeManagers.length == rm.getC... | boolean function(long timeout) throws YarnException, InterruptedException { ResourceManager rm = getResourceManager(); GetClusterMetricsRequest req = GetClusterMetricsRequest.newInstance(); for (int i = 0; i < timeout / 100; i++) { if (nodeManagers.length == rm.getClientRMService().getClusterMetrics(req) .getClusterMet... | /**
* Wait for all the NodeManagers to connect to the ResourceManager.
*
* @param timeout Time to wait (sleeps in 100 ms intervals) in milliseconds.
* @return true if all NodeManagers connect to the (Active)
* ResourceManager, false otherwise.
* @throws YarnException
* @throws InterruptedException
... | Wait for all the NodeManagers to connect to the ResourceManager | waitForNodeManagersToConnect | {
"repo_name": "jsrudani/HadoopHDFSProject",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java",
"license": "apache-2.0",
"size": 24280
} | [
"org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest",
"org.apache.hadoop.yarn.exceptions.YarnException",
"org.apache.hadoop.yarn.server.resourcemanager.ResourceManager"
] | import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager; | import org.apache.hadoop.yarn.api.protocolrecords.*; import org.apache.hadoop.yarn.exceptions.*; import org.apache.hadoop.yarn.server.resourcemanager.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 27,368 |
public void beginImportImage(String resourceGroupName, String registryName, ImportImageParameters parameters) {
beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).toBlocking().single().body();
} | void function(String resourceGroupName, String registryName, ImportImageParameters parameters) { beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).toBlocking().single().body(); } | /**
* Copies an image to this container registry from the specified container registry.
*
* @param resourceGroupName The name of the resource group to which the container registry belongs.
* @param registryName The name of the container registry.
* @param parameters The parameters specifying th... | Copies an image to this container registry from the specified container registry | beginImportImage | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/containerregistry/mgmt-v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java",
"license": "mit",
"size": 122184
} | [
"com.microsoft.azure.management.containerregistry.v2017_10_01.ImportImageParameters"
] | import com.microsoft.azure.management.containerregistry.v2017_10_01.ImportImageParameters; | import com.microsoft.azure.management.containerregistry.v2017_10_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 674,426 |
public FileChecksum getFileChecksum(Path f) throws IOException {
return null;
} | FileChecksum function(Path f) throws IOException { return null; } | /**
* Get the checksum of a file.
*
* @param f The file path
* @return The file checksum. The default return value is null,
* which indicates that no checksum algorithm is implemented
* in the corresponding FileSystem.
*/ | Get the checksum of a file | getFileChecksum | {
"repo_name": "songweijia/fffs",
"path": "sources/hadoop-2.4.1-src/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java",
"license": "apache-2.0",
"size": 102912
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,514,743 |
public void setNewBookMeta(BookMeta newBookMeta) throws IllegalArgumentException {
Validate.notNull(newBookMeta, "New book meta must not be null");
Bukkit.getItemFactory().equals(newBookMeta, null);
this.newBookMeta = newBookMeta.clone();
} | void function(BookMeta newBookMeta) throws IllegalArgumentException { Validate.notNull(newBookMeta, STR); Bukkit.getItemFactory().equals(newBookMeta, null); this.newBookMeta = newBookMeta.clone(); } | /**
* Sets the book meta that will actually be added to the book.
*
* @param newBookMeta new book meta
* @throws IllegalArgumentException if the new book meta is null
*/ | Sets the book meta that will actually be added to the book | setNewBookMeta | {
"repo_name": "SpannaProject/SpannaAPI",
"path": "src/main/java/org/spanna/event/player/PlayerEditBookEvent.java",
"license": "apache-2.0",
"size": 3797
} | [
"org.apache.commons.lang.Validate",
"org.spanna.inventory.meta.BookMeta"
] | import org.apache.commons.lang.Validate; import org.spanna.inventory.meta.BookMeta; | import org.apache.commons.lang.*; import org.spanna.inventory.meta.*; | [
"org.apache.commons",
"org.spanna.inventory"
] | org.apache.commons; org.spanna.inventory; | 1,318,208 |
public static String includeEvent(RuntimeServices rsvc,
InternalContextAdapter context, String includeResourcePath,
String currentResourcePath, String directiveName)
{
// app level cartridges have already been initialized
EventCartridge ev1 = rsvc.getApplicationEvent... | static String function(RuntimeServices rsvc, InternalContextAdapter context, String includeResourcePath, String currentResourcePath, String directiveName) { EventCartridge ev1 = rsvc.getApplicationEventCartridge(); Iterator applicationEventHandlerIterator = (ev1 == null) ? null: ev1.getIncludeEventHandlers(); EventCart... | /**
* Called when an include-type directive is encountered (#include or
* #parse). All the registered event handlers are called unless null is
* returned. The default implementation always processes the included
* resource.
*
* @param includeResourcePath
* the path a... | Called when an include-type directive is encountered (#include or #parse). All the registered event handlers are called unless null is returned. The default implementation always processes the included resource | includeEvent | {
"repo_name": "besom/bbossgroups-mvn",
"path": "bboss_velocity/src/main/java/bboss/org/apache/velocity/app/event/EventHandlerUtil.java",
"license": "apache-2.0",
"size": 18077
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,222,852 |
public static void startShowingAndWaitForLayout(
LayoutManager layoutManager, @LayoutType int type, boolean animate) {
ThreadUtils.runOnUiThreadBlocking(() -> layoutManager.showLayout(type, animate));
waitForLayout(layoutManager, type);
} | static void function( LayoutManager layoutManager, @LayoutType int type, boolean animate) { ThreadUtils.runOnUiThreadBlocking(() -> layoutManager.showLayout(type, animate)); waitForLayout(layoutManager, type); } | /**
* Start showing a layout and wait for it to finish showing.
* @param layoutManager A layout manager to show different layouts.
* @param type The type of layout to show.
* @param animate Whether to animate the transition.
*/ | Start showing a layout and wait for it to finish showing | startShowingAndWaitForLayout | {
"repo_name": "chromium/chromium",
"path": "chrome/browser/ui/android/layouts/test/java/src/org/chromium/chrome/browser/layouts/LayoutTestUtils.java",
"license": "bsd-3-clause",
"size": 2517
} | [
"org.chromium.base.ThreadUtils"
] | import org.chromium.base.ThreadUtils; | import org.chromium.base.*; | [
"org.chromium.base"
] | org.chromium.base; | 1,934,539 |
private void showIconRightClickMenu(MouseEvent e, int row, MainTableColumn column) {
BibEntry entry = tableRows.get(row);
JPopupMenu menu = new JPopupMenu();
boolean showDefaultPopup = true;
// See if this is a simple file link field, or if it is a file-list
// field that ca... | void function(MouseEvent e, int row, MainTableColumn column) { BibEntry entry = tableRows.get(row); JPopupMenu menu = new JPopupMenu(); boolean showDefaultPopup = true; if(!column.getBibtexFields().isEmpty()) { for(String field : column.getBibtexFields()) { if (Globals.FILE_FIELD.equals(field)) { String fileFieldConten... | /**
* Process popup trigger events occurring on an icon cell in the table. Show a menu where the user can choose which
* external resource to open for the entry. If no relevant external resources exist, let the normal popup trigger
* handler do its thing instead.
*
* @param e The mouse event de... | Process popup trigger events occurring on an icon cell in the table. Show a menu where the user can choose which external resource to open for the entry. If no relevant external resources exist, let the normal popup trigger handler do its thing instead | showIconRightClickMenu | {
"repo_name": "RodrigoRubino/DC-UFSCar-ES2-201601-Grupo-Brainstorm",
"path": "src/main/java/net/sf/jabref/gui/maintable/MainTableSelectionListener.java",
"license": "gpl-2.0",
"size": 24106
} | [
"java.awt.event.MouseEvent",
"javax.swing.Icon",
"javax.swing.JLabel",
"javax.swing.JPopupMenu",
"net.sf.jabref.Globals",
"net.sf.jabref.external.ExternalFileMenuItem",
"net.sf.jabref.gui.FileListEntry",
"net.sf.jabref.gui.FileListTableModel",
"net.sf.jabref.gui.GUIGlobals",
"net.sf.jabref.gui.Ico... | import java.awt.event.MouseEvent; import javax.swing.Icon; import javax.swing.JLabel; import javax.swing.JPopupMenu; import net.sf.jabref.Globals; import net.sf.jabref.external.ExternalFileMenuItem; import net.sf.jabref.gui.FileListEntry; import net.sf.jabref.gui.FileListTableModel; import net.sf.jabref.gui.GUIGlobals;... | import java.awt.event.*; import javax.swing.*; import net.sf.jabref.*; import net.sf.jabref.external.*; import net.sf.jabref.gui.*; import net.sf.jabref.model.entry.*; import net.sf.jabref.specialfields.*; | [
"java.awt",
"javax.swing",
"net.sf.jabref"
] | java.awt; javax.swing; net.sf.jabref; | 2,144,572 |
public boolean inPaintedArea(Point2D pt){
if ((paint == null) || (shape == null))
return false;
return shape.contains(pt);
} | boolean function(Point2D pt){ if ((paint == null) (shape == null)) return false; return shape.contains(pt); } | /**
* Returns true if pt is in the area painted by this shape painter
*/ | Returns true if pt is in the area painted by this shape painter | inPaintedArea | {
"repo_name": "Uni-Sol/batik",
"path": "sources/org/apache/batik/gvt/FillShapePainter.java",
"license": "apache-2.0",
"size": 4067
} | [
"java.awt.geom.Point2D"
] | import java.awt.geom.Point2D; | import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 1,337,532 |
@Test
public void executeSingleExecutionJobThatFails() throws Exception {
Trigger trigger = new SingleExecutionTrigger.Builder().withDelay(1, TimeUnit.MINUTES).build();
DateTime timeSlice = new DateTime(trigger.getTriggerTime());
JobDetails jobDetails = createJobDetails(randomUUID(), "Fa... | void function() throws Exception { Trigger trigger = new SingleExecutionTrigger.Builder().withDelay(1, TimeUnit.MINUTES).build(); DateTime timeSlice = new DateTime(trigger.getTriggerTime()); JobDetails jobDetails = createJobDetails(randomUUID(), STR, STR, emptyMap(), trigger); AtomicInteger attempts = new AtomicInteger... | /**
* In this test the single execution job fails its first execution and completes normally on the subsequent
* execution.
*/ | In this test the single execution job fails its first execution and completes normally on the subsequent execution | executeSingleExecutionJobThatFails | {
"repo_name": "burmanm/hawkular-metrics",
"path": "job-scheduler/src/test/java/org/hawkular/metrics/scheduler/impl/JobExecutionTest.java",
"license": "apache-2.0",
"size": 40299
} | [
"com.google.common.collect.ImmutableSet",
"java.util.Collections",
"java.util.concurrent.TimeUnit",
"java.util.concurrent.atomic.AtomicInteger",
"org.hawkular.metrics.scheduler.api.JobDetails",
"org.hawkular.metrics.scheduler.api.SingleExecutionTrigger",
"org.hawkular.metrics.scheduler.api.Trigger",
"... | import com.google.common.collect.ImmutableSet; import java.util.Collections; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.hawkular.metrics.scheduler.api.JobDetails; import org.hawkular.metrics.scheduler.api.SingleExecutionTrigger; import org.hawkular.metrics.schedul... | import com.google.common.collect.*; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.hawkular.metrics.scheduler.api.*; import org.joda.time.*; import org.testng.*; | [
"com.google.common",
"java.util",
"org.hawkular.metrics",
"org.joda.time",
"org.testng"
] | com.google.common; java.util; org.hawkular.metrics; org.joda.time; org.testng; | 839,032 |
void checkFamilies(Collection<byte[]> families)
throws NoSuchColumnFamilyException {
for (byte[] family : families) {
checkFamily(family);
}
} | void checkFamilies(Collection<byte[]> families) throws NoSuchColumnFamilyException { for (byte[] family : families) { checkFamily(family); } } | /**
* Check the collection of families for validity.
* @throws NoSuchColumnFamilyException if a family does not exist.
*/ | Check the collection of families for validity | checkFamilies | {
"repo_name": "ZhangXFeng/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java",
"license": "apache-2.0",
"size": 259731
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 469,432 |
public boolean removeFirst(String name, boolean ignoreCase) {
boolean changed = false;
NamedValue<String> param = null;
for (final Iterator<T> iter = iterator(); iter.hasNext() && !changed;) {
param = iter.next();
if (equals(param.getName(), name, ignoreCase)) {
... | boolean function(String name, boolean ignoreCase) { boolean changed = false; NamedValue<String> param = null; for (final Iterator<T> iter = iterator(); iter.hasNext() && !changed;) { param = iter.next(); if (equals(param.getName(), name, ignoreCase)) { iter.remove(); changed = true; } } return changed; } | /**
* Removes from this list the first entry whose name equals the specified
* name ignoring the case or not.
*
* @param name
* The name of the entries to be removed.
* @param ignoreCase
* Indicates if the name comparison is case insensitive.
* @return fals... | Removes from this list the first entry whose name equals the specified name ignoring the case or not | removeFirst | {
"repo_name": "zhangjunfang/eclipse-dir",
"path": "restlet/src/org/restlet/util/Series.java",
"license": "bsd-2-clause",
"size": 20884
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,402,996 |
@Override
public ClassAssertion createClassAssertion(OClass ce, ObjectConstant object) throws InconsistentOntologyException {
if (ce.isTop())
return null;
if (ce.isBottom())
throw new InconsistentOntologyException();
return new ClassAssertionImpl(ce, object);
}
| ClassAssertion function(OClass ce, ObjectConstant object) throws InconsistentOntologyException { if (ce.isTop()) return null; if (ce.isBottom()) throw new InconsistentOntologyException(); return new ClassAssertionImpl(ce, object); } | /**
* Creates a class assertion
* <p>
* ClassAssertion := 'ClassAssertion' '(' axiomAnnotations Class Individual ')'
* <p>
* Implements rule [C4]:
* - ignore (return null) if the class is top
* - inconsistency if the class is bot
*/ | Creates a class assertion ClassAssertion := 'ClassAssertion' '(' axiomAnnotations Class Individual ')' Implements rule [C4]: - ignore (return null) if the class is top - inconsistency if the class is bot | createClassAssertion | {
"repo_name": "ConstantB/ontop-spatial",
"path": "obdalib-core/src/main/java/it/unibz/krdb/obda/ontology/impl/OntologyFactoryImpl.java",
"license": "apache-2.0",
"size": 4063
} | [
"it.unibz.krdb.obda.model.ObjectConstant",
"it.unibz.krdb.obda.ontology.ClassAssertion",
"it.unibz.krdb.obda.ontology.InconsistentOntologyException",
"it.unibz.krdb.obda.ontology.OClass"
] | import it.unibz.krdb.obda.model.ObjectConstant; import it.unibz.krdb.obda.ontology.ClassAssertion; import it.unibz.krdb.obda.ontology.InconsistentOntologyException; import it.unibz.krdb.obda.ontology.OClass; | import it.unibz.krdb.obda.model.*; import it.unibz.krdb.obda.ontology.*; | [
"it.unibz.krdb"
] | it.unibz.krdb; | 2,343,391 |
@Override
public void fireErrors(String fileName, SortedSet<LocalizedMessage> errors) {
final String stripped = CommonUtils.relativizeAndNormalizePath(basedir, fileName);
for (final LocalizedMessage element : errors) {
final AuditEvent evt = new AuditEvent(this, stripped, element);
... | void function(String fileName, SortedSet<LocalizedMessage> errors) { final String stripped = CommonUtils.relativizeAndNormalizePath(basedir, fileName); for (final LocalizedMessage element : errors) { final AuditEvent evt = new AuditEvent(this, stripped, element); if (filters.accept(evt)) { for (final AuditListener list... | /**
* Notify all listeners about the errors in a file.
*
* @param fileName the audited file
* @param errors the audit errors from the file
*/ | Notify all listeners about the errors in a file | fireErrors | {
"repo_name": "rmswimkktt/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/Checker.java",
"license": "lgpl-2.1",
"size": 16671
} | [
"com.puppycrawl.tools.checkstyle.api.AuditEvent",
"com.puppycrawl.tools.checkstyle.api.AuditListener",
"com.puppycrawl.tools.checkstyle.api.LocalizedMessage",
"com.puppycrawl.tools.checkstyle.utils.CommonUtils",
"java.util.SortedSet"
] | import com.puppycrawl.tools.checkstyle.api.AuditEvent; import com.puppycrawl.tools.checkstyle.api.AuditListener; import com.puppycrawl.tools.checkstyle.api.LocalizedMessage; import com.puppycrawl.tools.checkstyle.utils.CommonUtils; import java.util.SortedSet; | import com.puppycrawl.tools.checkstyle.api.*; import com.puppycrawl.tools.checkstyle.utils.*; import java.util.*; | [
"com.puppycrawl.tools",
"java.util"
] | com.puppycrawl.tools; java.util; | 2,288,827 |
private ImmutableSet<TargetNode<AppleTestDescriptionArg>> getOrderedTestNodes(
Optional<BuildTarget> mainTarget,
TargetGraph targetGraph,
boolean includeProjectTests,
boolean includeDependenciesTests,
ImmutableSet<TargetNode<?>> orderedTargetNodes,
ImmutableSet<TargetNode<AppleTest... | ImmutableSet<TargetNode<AppleTestDescriptionArg>> function( Optional<BuildTarget> mainTarget, TargetGraph targetGraph, boolean includeProjectTests, boolean includeDependenciesTests, ImmutableSet<TargetNode<?>> orderedTargetNodes, ImmutableSet<TargetNode<AppleTestDescriptionArg>> extraTestBundleTargets) { ImmutableSet.B... | /**
* Find tests to run.
*
* @param targetGraph input target graph
* @param includeProjectTests whether to include tests of nodes in the project
* @param orderedTargetNodes target nodes for which to fetch tests for
* @param extraTestBundleTargets extra tests to include
* @return test targets that s... | Find tests to run | getOrderedTestNodes | {
"repo_name": "nguyentruongtho/buck",
"path": "src/com/facebook/buck/features/apple/project/WorkspaceAndProjectGenerator.java",
"license": "apache-2.0",
"size": 57021
} | [
"com.facebook.buck.apple.AppleTestDescriptionArg",
"com.facebook.buck.core.description.arg.HasTests",
"com.facebook.buck.core.exceptions.HumanReadableException",
"com.facebook.buck.core.model.BuildTarget",
"com.facebook.buck.core.model.targetgraph.TargetGraph",
"com.facebook.buck.core.model.targetgraph.Ta... | import com.facebook.buck.apple.AppleTestDescriptionArg; import com.facebook.buck.core.description.arg.HasTests; import com.facebook.buck.core.exceptions.HumanReadableException; import com.facebook.buck.core.model.BuildTarget; import com.facebook.buck.core.model.targetgraph.TargetGraph; import com.facebook.buck.core.mod... | import com.facebook.buck.apple.*; import com.facebook.buck.core.description.arg.*; import com.facebook.buck.core.exceptions.*; import com.facebook.buck.core.model.*; import com.facebook.buck.core.model.targetgraph.*; import com.facebook.buck.core.model.targetgraph.impl.*; import com.facebook.buck.event.*; import com.go... | [
"com.facebook.buck",
"com.google.common",
"java.util"
] | com.facebook.buck; com.google.common; java.util; | 2,565,011 |
private String scanBlockScalarIgnoredLine(Mark startMark) {
// See the specification for details.
int ff = 0;
// Forward past any number of trailing spaces
while (reader.peek(ff) == ' ') {
ff++;
}
if (ff > 0) {
reader.forward(ff);
}
... | String function(Mark startMark) { int ff = 0; while (reader.peek(ff) == ' ') { ff++; } if (ff > 0) { reader.forward(ff); } if (reader.peek() == '#') { ff = 0; while (Constant.NULL_OR_LINEBR.hasNo(reader.peek(ff))) { ff++; } if (ff > 0) { reader.forward(ff); } } char ch = reader.peek(); String lineBreak = scanLineBreak(... | /**
* Scan to the end of the line after a block scalar has been scanned; the
* only things that are permitted at this time are comments and spaces.
*/ | Scan to the end of the line after a block scalar has been scanned; the only things that are permitted at this time are comments and spaces | scanBlockScalarIgnoredLine | {
"repo_name": "ClubObsidian/ObsidianEngine",
"path": "src/com/clubobsidian/obsidianengine/snakeyaml/scanner/ScannerImpl.java",
"license": "mit",
"size": 83726
} | [
"com.clubobsidian.obsidianengine.snakeyaml.error.Mark"
] | import com.clubobsidian.obsidianengine.snakeyaml.error.Mark; | import com.clubobsidian.obsidianengine.snakeyaml.error.*; | [
"com.clubobsidian.obsidianengine"
] | com.clubobsidian.obsidianengine; | 1,487,487 |
public List<I18nItem> findExistingI18nItems(Locale targetLocale, String limitToBundleName, boolean includeBundlesChildren) {
List<String> allBundles = I18nModule.getBundleNamesContainingI18nFiles();
List<I18nItem> foundTranslationItems = new LinkedList<I18nItem>();
for (String bundleName : allBundles) {
if ... | List<I18nItem> function(Locale targetLocale, String limitToBundleName, boolean includeBundlesChildren) { List<String> allBundles = I18nModule.getBundleNamesContainingI18nFiles(); List<I18nItem> foundTranslationItems = new LinkedList<I18nItem>(); for (String bundleName : allBundles) { if (limitToBundleName == null limit... | /**
* Find all i18n items that exist in the target locale
*
* @param targetLocale The locale that must be translated
* @param limitToBundleName
* @param includeBundlesChildren true: also find the keys in the bundles children; false: find only the keys in the exact bundle name. When limitToBundeName is set to... | Find all i18n items that exist in the target locale | findExistingI18nItems | {
"repo_name": "RLDevOps/Demo",
"path": "src/main/java/org/olat/core/util/i18n/I18nManager.java",
"license": "apache-2.0",
"size": 82947
} | [
"java.util.LinkedList",
"java.util.List",
"java.util.Locale",
"java.util.Properties",
"java.util.Set"
] | import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Properties; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,884,534 |
private LinkedList<Short> initializePowerups() {
LinkedList<Short> nextPowerups = new LinkedList<Short>();
if (!spawnPowerups)
return nextPowerups;
for (int i = 0; i < INITIALPOWERUPS; i++) {
nextPowerups.offer(spawnPowerup());
}
return nextPowerups;
... | LinkedList<Short> function() { LinkedList<Short> nextPowerups = new LinkedList<Short>(); if (!spawnPowerups) return nextPowerups; for (int i = 0; i < INITIALPOWERUPS; i++) { nextPowerups.offer(spawnPowerup()); } return nextPowerups; } | /**
* This method initializes the Level's powerup Queue. If spawnPowerups is
* true, the Queue will be filled with INITIALPOWERUPS randomly generated
* powerups. The resulting Queue is returned.
*
* @return The Level's initial powerup Queue.
*/ | This method initializes the Level's powerup Queue. If spawnPowerups is true, the Queue will be filled with INITIALPOWERUPS randomly generated powerups. The resulting Queue is returned | initializePowerups | {
"repo_name": "sparrowprince/BOE",
"path": "src/bm/Level.java",
"license": "gpl-3.0",
"size": 39143
} | [
"java.util.LinkedList"
] | import java.util.LinkedList; | import java.util.*; | [
"java.util"
] | java.util; | 2,638,136 |
void expectSwitchMatchesCase(NodeTraversal t, Node n, JSType switchType,
JSType caseType) {
// ECMA-262, page 68, step 3 of evaluation of CaseBlock,
// but allowing extra autoboxing.
// TODO(user): remove extra conditions when type annotations
// in the code base have adapted to the change in th... | void expectSwitchMatchesCase(NodeTraversal t, Node n, JSType switchType, JSType caseType) { if (!switchType.canTestForShallowEqualityWith(caseType) && (caseType.autoboxesTo() == null !caseType.autoboxesTo().isSubtype(switchType))) { mismatch(t, n.getFirstChild(), STR, caseType, switchType); } } | /**
* Expect that the type of a switch condition matches the type of its
* case condition.
*/ | Expect that the type of a switch condition matches the type of its case condition | expectSwitchMatchesCase | {
"repo_name": "jhiswin/idiil-closure-compiler",
"path": "src/com/google/javascript/jscomp/TypeValidator.java",
"license": "apache-2.0",
"size": 32351
} | [
"com.google.javascript.rhino.Node",
"com.google.javascript.rhino.jstype.JSType"
] | import com.google.javascript.rhino.Node; import com.google.javascript.rhino.jstype.JSType; | import com.google.javascript.rhino.*; import com.google.javascript.rhino.jstype.*; | [
"com.google.javascript"
] | com.google.javascript; | 645,034 |
public void setNode(Node selectedNode); | void function(Node selectedNode); | /**
* Set the root node to display in this viewer. When called with null, must
* clear all references to previous nodes.
*/ | Set the root node to display in this viewer. When called with null, must clear all references to previous nodes | setNode | {
"repo_name": "narfindustries/autopsy",
"path": "Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DataResultViewer.java",
"license": "apache-2.0",
"size": 2615
} | [
"org.openide.nodes.Node"
] | import org.openide.nodes.Node; | import org.openide.nodes.*; | [
"org.openide.nodes"
] | org.openide.nodes; | 2,025,312 |
public static DoubleArrayND createSubArray(
DoubleArrayND parent, IntTuple fromIndices, IntTuple toIndices)
{
return new SubDoubleArrayND(
parent, fromIndices, toIndices);
}
| static DoubleArrayND function( DoubleArrayND parent, IntTuple fromIndices, IntTuple toIndices) { return new SubDoubleArrayND( parent, fromIndices, toIndices); } | /**
* Creates a new array that is a <i>view</i> on the specified portion
* of the given parent. Changes in the parent will be visible in the
* returned array.
*
* @param parent The parent array
* @param fromIndices The start indices in the parent, inclusive
* @param toIndice... | Creates a new array that is a view on the specified portion of the given parent. Changes in the parent will be visible in the returned array | createSubArray | {
"repo_name": "javagl/ND",
"path": "nd-arrays/src/main/java/de/javagl/nd/arrays/d/DoubleArraysND.java",
"license": "mit",
"size": 14100
} | [
"de.javagl.nd.tuples.i.IntTuple"
] | import de.javagl.nd.tuples.i.IntTuple; | import de.javagl.nd.tuples.i.*; | [
"de.javagl.nd"
] | de.javagl.nd; | 543,685 |
// Day time color
public void setDaySkyColor(ColorRGBA dayColor) {
this.dayColor = dayColor;
if (mat_Sky != null) {
mat_Sky.setColor("ColorDay", dayColor);
}
} | void function(ColorRGBA dayColor) { this.dayColor = dayColor; if (mat_Sky != null) { mat_Sky.setColor(STR, dayColor); } } | /**
* Sets the color used for day time sky
*
* @param dayColor Default value is .7f, .7f, 1f, 1f
*/ | Sets the color used for day time sky | setDaySkyColor | {
"repo_name": "rdok/Arcem-Tutari",
"path": "src/project/environment/SkyDomeControl.java",
"license": "mit",
"size": 18727
} | [
"com.jme3.math.ColorRGBA"
] | import com.jme3.math.ColorRGBA; | import com.jme3.math.*; | [
"com.jme3.math"
] | com.jme3.math; | 1,649,419 |
public X509Certificate getX509Certificate() throws KeyResolverException {
// First search using the individual resolvers from the user
X509Certificate cert = this.getX509CertificateFromInternalResolvers();
if (cert != null) {
if (log.isLoggable(java.util.logging.Level.FINE)) {
... | X509Certificate function() throws KeyResolverException { X509Certificate cert = this.getX509CertificateFromInternalResolvers(); if (cert != null) { if (log.isLoggable(java.util.logging.Level.FINE)) { log.log(java.util.logging.Level.FINE, STR); } return cert; } if (log.isLoggable(java.util.logging.Level.FINE)) { log.log... | /**
* Method getX509Certificate
*
* @return The certificate contained in this KeyInfo
* @throws KeyResolverException
*/ | Method getX509Certificate | getX509Certificate | {
"repo_name": "rokn/Count_Words_2015",
"path": "testing/openjdk2/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java",
"license": "mit",
"size": 40787
} | [
"com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolverException",
"java.security.cert.X509Certificate"
] | import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolverException; import java.security.cert.X509Certificate; | import com.sun.org.apache.xml.internal.security.keys.keyresolver.*; import java.security.cert.*; | [
"com.sun.org",
"java.security"
] | com.sun.org; java.security; | 1,392,128 |
private JCExpression makeDefaultValueCall(Parameter defaultedParam, int i){
if (Strategy.hasDefaultParameterValueMethod(defaultedParam)) {
// add the default value
List<JCExpression> defaultMethodArgs = List.nil();
// pass all the previous values
for(int a=i-1... | JCExpression function(Parameter defaultedParam, int i){ if (Strategy.hasDefaultParameterValueMethod(defaultedParam)) { List<JCExpression> defaultMethodArgs = List.nil(); for(int a=i-1;a>=0;a--){ Parameter param = paramLists.getParameters().get(a); JCExpression previousValue = target.getCallableTempVarName(param).makeId... | /**
* Makes an invocation of a default parameter value method (if the
* parameter is defaulted), or empty (if it's *variadic)
*/ | Makes an invocation of a default parameter value method (if the parameter is defaulted), or empty (if it's *variadic) | makeDefaultValueCall | {
"repo_name": "lucaswerkmeister/ceylon-compiler",
"path": "src/com/redhat/ceylon/compiler/java/codegen/CallableBuilder.java",
"license": "gpl-2.0",
"size": 66817
} | [
"com.redhat.ceylon.compiler.typechecker.model.Parameter",
"com.sun.tools.javac.tree.JCTree",
"com.sun.tools.javac.util.List"
] | import com.redhat.ceylon.compiler.typechecker.model.Parameter; import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.util.List; | import com.redhat.ceylon.compiler.typechecker.model.*; import com.sun.tools.javac.tree.*; import com.sun.tools.javac.util.*; | [
"com.redhat.ceylon",
"com.sun.tools"
] | com.redhat.ceylon; com.sun.tools; | 1,460,225 |
public static <T> Set<Set<T>> getAllSubsets(Set<T> data) {
Set<Set<T>> result = new HashSet<>();
result.add(data);
for(T element : data) {
Set<T> subset = new HashSet<>(data);
subset.remove(element);
if(subset.size()>0)
{
result.addAll(g... | static <T> Set<Set<T>> function(Set<T> data) { Set<Set<T>> result = new HashSet<>(); result.add(data); for(T element : data) { Set<T> subset = new HashSet<>(data); subset.remove(element); if(subset.size()>0) { result.addAll(getAllSubsets(subset)); } } return result; } | /**
* Creates all subsets of the given set (including the set itself).
* @param data
* @return The subsets
*/ | Creates all subsets of the given set (including the set itself) | getAllSubsets | {
"repo_name": "olehmberg/winter",
"path": "winter-framework/src/main/java/de/uni_mannheim/informatik/dws/winter/utils/query/Q.java",
"license": "apache-2.0",
"size": 13122
} | [
"java.util.HashSet",
"java.util.Set"
] | import java.util.HashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 829,525 |
@Override()
public java.lang.Class getJavaClass(
) {
return org.chocolate_milk.model.SpecialItemAdd.class;
} | @Override() java.lang.Class function( ) { return org.chocolate_milk.model.SpecialItemAdd.class; } | /**
* Method getJavaClass.
*
* @return the Java class represented by this descriptor.
*/ | Method getJavaClass | getJavaClass | {
"repo_name": "galleon1/chocolate-milk",
"path": "src/org/chocolate_milk/model/descriptors/SpecialItemAddDescriptor.java",
"license": "lgpl-3.0",
"size": 7776
} | [
"org.chocolate_milk.model.SpecialItemAdd"
] | import org.chocolate_milk.model.SpecialItemAdd; | import org.chocolate_milk.model.*; | [
"org.chocolate_milk.model"
] | org.chocolate_milk.model; | 288,568 |
public long getDelay(TimeUnit unit);
} | long function(TimeUnit unit); } | /**
* Return values greater than zero will reschedule the
* watchdog {@link Thread}.
*/ | Return values greater than zero will reschedule the watchdog <code>Thread</code> | getDelay | {
"repo_name": "google-code/async-future",
"path": "core/src/main/java/org/ardverk/concurrent/AsyncProcess.java",
"license": "apache-2.0",
"size": 1480
} | [
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 455,052 |
void onPeriodicNotification(AudioTrack track);
}
//---------------------------------------------------------
// Inner classes
//--------------------
private class NativeEventHandlerDelegate {
private final AudioTrack mAudioTrack;
private final Handler mHandler;
... | void onPeriodicNotification(AudioTrack track); } private class NativeEventHandlerDelegate { private final AudioTrack mAudioTrack; private final Handler mHandler; NativeEventHandlerDelegate(AudioTrack track, Handler handler) { mAudioTrack = track; Looper looper; if (handler != null) { looper = handler.getLooper(); } els... | /**
* Called on the listener to periodically notify it that the playback head has reached
* a multiple of the notification period.
*/ | Called on the listener to periodically notify it that the playback head has reached a multiple of the notification period | onPeriodicNotification | {
"repo_name": "haikuowuya/android_system_code",
"path": "src/android/media/AudioTrack.java",
"license": "apache-2.0",
"size": 49747
} | [
"android.os.Handler",
"android.os.Looper"
] | import android.os.Handler; import android.os.Looper; | import android.os.*; | [
"android.os"
] | android.os; | 609,655 |
@Override protected void visitTemplateNode(TemplateNode node) {
boolean isCodeStyleStringbuilder = goSrcOptions.getCodeStyle() == CodeStyle.STRINGBUILDER;
localVarTranslations = new ArrayDeque<Map<String, GoExpr>>();
genGoExprsVisitor = genGoExprsVisitorFactory.create(localVarTranslations);
Str... | @Override void function(TemplateNode node) { boolean isCodeStyleStringbuilder = goSrcOptions.getCodeStyle() == CodeStyle.STRINGBUILDER; localVarTranslations = new ArrayDeque<Map<String, GoExpr>>(); genGoExprsVisitor = genGoExprsVisitorFactory.create(localVarTranslations); String templateName = node.getTemplateName(); S... | /**
* Example:
* <pre>
* my.func = function(opt_data, opt_sb) {
* var output = opt_sb || new soy.StringBuilder();
* ...
* ...
* if (!opt_sb) return output.toString();
* };
* </pre>
*/ | Example: <code> my.func = function(opt_data, opt_sb) { var output = opt_sb || new soy.StringBuilder(); ... ... if (!opt_sb) return output.toString(); }; </code> | visitTemplateNode | {
"repo_name": "pomack/closure-templates",
"path": "java/src/com/google/template/soy/gosrc/internal/GenGoCodeVisitor.java",
"license": "apache-2.0",
"size": 31462
} | [
"com.google.common.collect.Maps",
"com.google.template.soy.gosrc.SoyGoSrcOptions",
"com.google.template.soy.gosrc.restricted.GoCodeUtils",
"com.google.template.soy.gosrc.restricted.GoExpr",
"com.google.template.soy.gosrc.restricted.GoExprUtils",
"com.google.template.soy.soytree.TemplateNode",
"java.util... | import com.google.common.collect.Maps; import com.google.template.soy.gosrc.SoyGoSrcOptions; import com.google.template.soy.gosrc.restricted.GoCodeUtils; import com.google.template.soy.gosrc.restricted.GoExpr; import com.google.template.soy.gosrc.restricted.GoExprUtils; import com.google.template.soy.soytree.TemplateNo... | import com.google.common.collect.*; import com.google.template.soy.gosrc.*; import com.google.template.soy.gosrc.restricted.*; import com.google.template.soy.soytree.*; import java.util.*; | [
"com.google.common",
"com.google.template",
"java.util"
] | com.google.common; com.google.template; java.util; | 1,023,296 |
@Test(expected = IllegalArgumentException.class)
public void testCheckGreaterThanOrEqualTo_xLessThanY() {
IntChecker.checkGreaterThanOrEqualTo(5, 6);
}
| @Test(expected = IllegalArgumentException.class) void function() { IntChecker.checkGreaterThanOrEqualTo(5, 6); } | /**
* Test to verify that the {@link IntChecker#checkGreaterThanOrEqualTo(int, int)} method
* functions correctly when the {@code x} argument is less than the {@code y} argument. The
* test will only pass if an IllegalArgumentException is thrown.
*/ | Test to verify that the <code>IntChecker#checkGreaterThanOrEqualTo(int, int)</code> method functions correctly when the x argument is less than the y argument. The test will only pass if an IllegalArgumentException is thrown | testCheckGreaterThanOrEqualTo_xLessThanY | {
"repo_name": "MatthewTamlin/JavaUtilities",
"path": "library/src/test/java/com/matthewtamlin/java_utilities/checkers/TestIntChecker.java",
"license": "apache-2.0",
"size": 12867
} | [
"org.junit.Test"
] | import org.junit.Test; | import org.junit.*; | [
"org.junit"
] | org.junit; | 606,627 |
public Collection notAttending() {
return this.<Collection>get("notAttending");
}
// Java Serialization Support | Collection function() { return this.<Collection>get(STR); } | /**
* Get the notAttending Collection or null if not provided
* @return Collection
*/ | Get the notAttending Collection or null if not provided | notAttending | {
"repo_name": "jasnell/activitystreams",
"path": "legacy/src/main/java/com/ibm/common/activitystreams/legacy/Event.java",
"license": "apache-2.0",
"size": 6055
} | [
"com.ibm.common.activitystreams.Collection"
] | import com.ibm.common.activitystreams.Collection; | import com.ibm.common.activitystreams.*; | [
"com.ibm.common"
] | com.ibm.common; | 231,499 |
public boolean isReceivingDocumentRequired(ThresholdCriteria thresholdEnum) {
List<ThresholdSummary> summaryList = getThresholdSummaryCollection(thresholdEnum);
if (summaryList != null){
for (ThresholdSummary summary : summaryList) {
Collection collectio... | boolean function(ThresholdCriteria thresholdEnum) { List<ThresholdSummary> summaryList = getThresholdSummaryCollection(thresholdEnum); if (summaryList != null){ for (ThresholdSummary summary : summaryList) { Collection collection = null; if (thresholdEnum == CHART){ collection = thresholdService.findByChart(summary.get... | /**
* This method is public since it's required in the ThresholdTest class. To know the receiving required doc status for a PO,
* it's always better to call isReceivingDocumentRequired() instead of this method.
*/ | This method is public since it's required in the ThresholdTest class. To know the receiving required doc status for a PO, it's always better to call isReceivingDocumentRequired() instead of this method | isReceivingDocumentRequired | {
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/purap/util/ThresholdHelper.java",
"license": "apache-2.0",
"size": 24976
} | [
"java.util.Collection",
"java.util.List",
"org.kuali.kfs.module.purap.businessobject.ReceivingThreshold"
] | import java.util.Collection; import java.util.List; import org.kuali.kfs.module.purap.businessobject.ReceivingThreshold; | import java.util.*; import org.kuali.kfs.module.purap.businessobject.*; | [
"java.util",
"org.kuali.kfs"
] | java.util; org.kuali.kfs; | 1,715,553 |
public ShardRouting activePrimary(ShardId shardId) {
for (ShardRouting shardRouting : assignedShards(shardId)) {
if (shardRouting.primary() && shardRouting.active()) {
return shardRouting;
}
}
return null;
} | ShardRouting function(ShardId shardId) { for (ShardRouting shardRouting : assignedShards(shardId)) { if (shardRouting.primary() && shardRouting.active()) { return shardRouting; } } return null; } | /**
* Returns the active primary shard for the given shard id or <code>null</code> if
* no primary is found or the primary is not active.
*/ | Returns the active primary shard for the given shard id or <code>null</code> if no primary is found or the primary is not active | activePrimary | {
"repo_name": "gingerwizard/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/cluster/routing/RoutingNodes.java",
"license": "apache-2.0",
"size": 55706
} | [
"org.elasticsearch.index.shard.ShardId"
] | import org.elasticsearch.index.shard.ShardId; | import org.elasticsearch.index.shard.*; | [
"org.elasticsearch.index"
] | org.elasticsearch.index; | 1,608,011 |
public static void generate(ServletWriter out, Compiler compiler,
Node.Nodes page) throws JasperException {
Generator gen = new Generator(out, compiler);
if (gen.isPoolingEnabled) {
gen.compileTagHandlerPoolList(page);
}
gen.generateCommentHeader();
... | static void function(ServletWriter out, Compiler compiler, Node.Nodes page) throws JasperException { Generator gen = new Generator(out, compiler); if (gen.isPoolingEnabled) { gen.compileTagHandlerPoolList(page); } gen.generateCommentHeader(); if (gen.ctxt.isTagFile()) { JasperTagInfo tagInfo = (JasperTagInfo) gen.ctxt.... | /**
* The main entry for Generator.
*
* @param out
* The servlet output writer
* @param compiler
* The compiler
* @param page
* The input page
*
* @throws JasperException If something goes wrong during generation
*/ | The main entry for Generator | generate | {
"repo_name": "Nickname0806/Test_Q4",
"path": "java/org/apache/jasper/compiler/Generator.java",
"license": "apache-2.0",
"size": 175629
} | [
"org.apache.jasper.JasperException"
] | import org.apache.jasper.JasperException; | import org.apache.jasper.*; | [
"org.apache.jasper"
] | org.apache.jasper; | 1,452,094 |
static boolean arePartsConnectable(Gem.PartConnectable from, Gem.PartConnectable to) {
// Not valid if the destination or source are already connected!
if (from.isConnected() || to.isConnected()) {
return false;
}
// Also not valid if either of them is burn... | static boolean arePartsConnectable(Gem.PartConnectable from, Gem.PartConnectable to) { if (from.isConnected() to.isConnected()) { return false; } if (from instanceof Gem.PartInput && ((Gem.PartInput) from).isBurnt()) { return false; } if (to instanceof Gem.PartInput && ((Gem.PartInput) to).isBurnt()) { return false; } ... | /**
* Check two parts for basic connectivity, ignoring their current types.
* This includes seeing if they are already connected, checking for brokenness, and seeing
* if a cyclic tree would result.
* @param from Gem.PartConnectable the part from which the connection is made
* @param to Ge... | Check two parts for basic connectivity, ignoring their current types. This includes seeing if they are already connected, checking for brokenness, and seeing if a cyclic tree would result | arePartsConnectable | {
"repo_name": "levans/Open-Quark",
"path": "src/Quark_Gems/src/org/openquark/gems/client/GemGraph.java",
"license": "bsd-3-clause",
"size": 134737
} | [
"org.openquark.cal.compiler.TypeExpr",
"org.openquark.gems.client.Gem"
] | import org.openquark.cal.compiler.TypeExpr; import org.openquark.gems.client.Gem; | import org.openquark.cal.compiler.*; import org.openquark.gems.client.*; | [
"org.openquark.cal",
"org.openquark.gems"
] | org.openquark.cal; org.openquark.gems; | 1,680,642 |
public static boolean login(String email, String password,
Result.Login callback, Handler handler, Object closure) {
synchronized (sLock) {
if (null == sAPIClient) {
return false;
}
if (DEBUG) {
Log.d(TAG, String.format("authent... | static boolean function(String email, String password, Result.Login callback, Handler handler, Object closure) { synchronized (sLock) { if (null == sAPIClient) { return false; } if (DEBUG) { Log.d(TAG, String.format(STR, email, password)); } return sAPIClient.login(email, password, callback, handler, closure); } } | /**
* Login as user
*
* @param email The email address associated with the user's account, not null
* @param password The password of the user, not null
* @param callback A callback to receive results async. May be null.
* @param handler A handler on which callback should be called. If nul... | Login as user | login | {
"repo_name": "SamsungVR/android_upload_sdk",
"path": "SDKLib/src/main/java/com/samsung/msca/samsungvr/sdk/VR.java",
"license": "mit",
"size": 20898
} | [
"android.os.Handler",
"android.util.Log"
] | import android.os.Handler; import android.util.Log; | import android.os.*; import android.util.*; | [
"android.os",
"android.util"
] | android.os; android.util; | 1,531,412 |
public synchronized I_CmsResourceCollector addContentCollector(String className, String order)
throws CmsConfigurationException {
Class<?> classClazz;
// init class for content collector
try {
classClazz = Class.forName(className);
} catch (ClassNotFoundException e) ... | synchronized I_CmsResourceCollector function(String className, String order) throws CmsConfigurationException { Class<?> classClazz; try { classClazz = Class.forName(className); } catch (ClassNotFoundException e) { LOG.error(Messages.get().getBundle().key(Messages.LOG_CONTENT_COLLECTOR_CLASS_NOT_FOUND_1, className), e)... | /**
* Adds a given content collector class to the type manager.<p>
*
* @param className the name of the class to add
* @param order the order number for this collector
*
* @return the created content collector instance
*
* @throws CmsConfigurationException in case the collect... | Adds a given content collector class to the type manager | addContentCollector | {
"repo_name": "it-tavis/opencms-core",
"path": "src/org/opencms/loader/CmsResourceManager.java",
"license": "lgpl-2.1",
"size": 62006
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.HashMap",
"java.util.Iterator",
"org.opencms.configuration.CmsConfigurationException",
"org.opencms.main.CmsLog"
] | import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import org.opencms.configuration.CmsConfigurationException; import org.opencms.main.CmsLog; | import java.util.*; import org.opencms.configuration.*; import org.opencms.main.*; | [
"java.util",
"org.opencms.configuration",
"org.opencms.main"
] | java.util; org.opencms.configuration; org.opencms.main; | 2,224,637 |
@Override public void exitRange_op(@NotNull LuceneSqlParser.Range_opContext ctx) { } | @Override public void exitRange_op(@NotNull LuceneSqlParser.Range_opContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | enterRange_op | {
"repo_name": "bbejeck/nosql-jdbc-driver",
"path": "src/main/java/bbejeck/nosql/antlr/generated/LuceneSqlBaseListener.java",
"license": "apache-2.0",
"size": 18266
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 2,893,691 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.