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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
Collection<String> result = new LinkedList<>();
for (AuthoritySQLSet each : sqlSets) {
result.addAll(each.getCreateUserSQLs(databaseType));
}
return result;
} | Collection<String> result = new LinkedList<>(); for (AuthoritySQLSet each : sqlSets) { result.addAll(each.getCreateUserSQLs(databaseType)); } return result; } | /**
* Get init SQLs of this database type.
*
* @param databaseType database type
* @return init SQLs of this data base type
*/ | Get init SQLs of this database type | getInitSQLs | {
"repo_name": "apache/incubator-shardingsphere",
"path": "shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/env/scenario/authority/AuthorityEnvironment.java",
"license": "apache-2.0",
"size": 2215
} | [
"java.util.Collection",
"java.util.LinkedList"
] | import java.util.Collection; import java.util.LinkedList; | import java.util.*; | [
"java.util"
] | java.util; | 1,986,664 |
void initOnSlave(SlaveState slaveState); | void initOnSlave(SlaveState slaveState); | /**
* After un-marshalling on the slave, this method will be called to setUp the stage with slave's state.
*/ | After un-marshalling on the slave, this method will be called to setUp the stage with slave's state | initOnSlave | {
"repo_name": "cloudtm/ann_old",
"path": "RadargunClientServer/framework/src/main/java/org/radargun/DistStage.java",
"license": "lgpl-3.0",
"size": 1458
} | [
"org.radargun.state.SlaveState"
] | import org.radargun.state.SlaveState; | import org.radargun.state.*; | [
"org.radargun.state"
] | org.radargun.state; | 1,466,480 |
@Test
public void testRoleRemovedAuthorityStays() {
// two roles with same authorities
IdmRoleDto role = getTestRole();
IdmRoleDto role2 = getTestRole();
IdmIdentityDto i = getHelper().createIdentity();
IdmIdentityContractDto c = getTestContract(i);
IdmIdentityRoleDto ir = getTestIdentityRole(role, c);
IdmIdentityRoleDto ir2 = getTestIdentityRole(role2, c);
//
List<IdmTokenDto> tokens = tokenManager.getTokens(i);
//
Assert.assertTrue(tokens.isEmpty());
Assert.assertEquals(2, identityRoleService.findAllByIdentity(i.getId()).size());
checkAssignedAuthorities(i);
//
// login - one token
getHelper().login(i.getUsername(), i.getPassword());
try {
tokens = tokenManager.getTokens(i);
Assert.assertEquals(1, tokens.size());
Assert.assertFalse(tokens.get(0).isDisabled());
identityRoleService.delete(ir2);
tokens = tokenManager.getTokens(i);
Assert.assertEquals(1, tokens.size());
Assert.assertFalse(tokens.get(0).isDisabled());
Assert.assertEquals(1, identityRoleService.findAllByIdentity(i.getId()).size());
Assert.assertEquals(ir.getId(), identityRoleService.findAllByIdentity(i.getId()).get(0).getId());
Assert.assertEquals(1, authoritiesFactory.getGrantedAuthoritiesForIdentity(i.getId()).size());
} finally {
getHelper().logout();
}
} | void function() { IdmRoleDto role = getTestRole(); IdmRoleDto role2 = getTestRole(); IdmIdentityDto i = getHelper().createIdentity(); IdmIdentityContractDto c = getTestContract(i); IdmIdentityRoleDto ir = getTestIdentityRole(role, c); IdmIdentityRoleDto ir2 = getTestIdentityRole(role2, c); Assert.assertEquals(2, identityRoleService.findAllByIdentity(i.getId()).size()); checkAssignedAuthorities(i); getHelper().login(i.getUsername(), i.getPassword()); try { tokens = tokenManager.getTokens(i); Assert.assertEquals(1, tokens.size()); Assert.assertFalse(tokens.get(0).isDisabled()); identityRoleService.delete(ir2); tokens = tokenManager.getTokens(i); Assert.assertEquals(1, tokens.size()); Assert.assertFalse(tokens.get(0).isDisabled()); Assert.assertEquals(1, identityRoleService.findAllByIdentity(i.getId()).size()); Assert.assertEquals(ir.getId(), identityRoleService.findAllByIdentity(i.getId()).get(0).getId()); Assert.assertEquals(1, authoritiesFactory.getGrantedAuthoritiesForIdentity(i.getId()).size()); } finally { getHelper().logout(); } } | /**
* User has to roles with same authorities - removing just one role
* shall not change the authorities modification flag.
*/ | User has to roles with same authorities - removing just one role shall not change the authorities modification flag | testRoleRemovedAuthorityStays | {
"repo_name": "bcvsolutions/CzechIdMng",
"path": "Realization/backend/core/core-impl/src/test/java/eu/bcvsolutions/idm/core/model/event/processor/IdentityRoleDeleteAuthoritiesProcessorTest.java",
"license": "mit",
"size": 5779
} | [
"eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto",
"eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto",
"eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto",
"eu.bcvsolutions.idm.core.api.dto.IdmRoleDto",
"org.junit.Assert"
] | import eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto; import eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto; import eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto; import eu.bcvsolutions.idm.core.api.dto.IdmRoleDto; import org.junit.Assert; | import eu.bcvsolutions.idm.core.api.dto.*; import org.junit.*; | [
"eu.bcvsolutions.idm",
"org.junit"
] | eu.bcvsolutions.idm; org.junit; | 925,367 |
try {
this.address = InetAddress.getByName(addrString);
} catch (UnknownHostException e) {
this.address = null;
logger.warn("could not set address from {}", addrString);
}
} | try { this.address = InetAddress.getByName(addrString); } catch (UnknownHostException e) { this.address = null; logger.warn(STR, addrString); } } | /**
* sets the node address
*
* @param addrString domain name or IP address as string representation
*/ | sets the node address | setInetAddress | {
"repo_name": "theoweiss/openhab2",
"path": "bundles/org.openhab.binding.dmx/src/main/java/org/openhab/binding/dmx/internal/dmxoverethernet/IpNode.java",
"license": "epl-1.0",
"size": 4512
} | [
"java.net.InetAddress",
"java.net.UnknownHostException"
] | import java.net.InetAddress; import java.net.UnknownHostException; | import java.net.*; | [
"java.net"
] | java.net; | 553,331 |
@Override
public void clearCache(Notification notification) {
entityCache.removeResult(NotificationModelImpl.ENTITY_CACHE_ENABLED,
NotificationImpl.class, notification.getPrimaryKey());
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
clearUniqueFindersCache((NotificationModelImpl)notification);
} | void function(Notification notification) { entityCache.removeResult(NotificationModelImpl.ENTITY_CACHE_ENABLED, NotificationImpl.class, notification.getPrimaryKey()); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); clearUniqueFindersCache((NotificationModelImpl)notification); } | /**
* Clears the cache for the notification.
*
* <p>
* The {@link EntityCache} and {@link FinderCache} are both cleared by this method.
* </p>
*/ | Clears the cache for the notification. The <code>EntityCache</code> and <code>FinderCache</code> are both cleared by this method. | clearCache | {
"repo_name": "rivetlogic/liferay-ecommerce-theme",
"path": "e-commerce/modules/ecommerce-service/ecommerce-service-service/src/main/java/com/rivetlogic/ecommerce/service/persistence/impl/NotificationPersistenceImpl.java",
"license": "gpl-3.0",
"size": 89310
} | [
"com.rivetlogic.ecommerce.model.Notification",
"com.rivetlogic.ecommerce.model.impl.NotificationImpl",
"com.rivetlogic.ecommerce.model.impl.NotificationModelImpl"
] | import com.rivetlogic.ecommerce.model.Notification; import com.rivetlogic.ecommerce.model.impl.NotificationImpl; import com.rivetlogic.ecommerce.model.impl.NotificationModelImpl; | import com.rivetlogic.ecommerce.model.*; import com.rivetlogic.ecommerce.model.impl.*; | [
"com.rivetlogic.ecommerce"
] | com.rivetlogic.ecommerce; | 1,663,359 |
return Collections.unmodifiableList(factMappings);
} | return Collections.unmodifiableList(factMappings); } | /**
* Returns an <b>unmodifiable</b> list wrapping the backed one
* @return
*/ | Returns an unmodifiable list wrapping the backed one | getUnmodifiableFactMappings | {
"repo_name": "romartin/drools",
"path": "drools-scenario-simulation/drools-scenario-simulation-api/src/main/java/org/drools/scenariosimulation/api/model/SimulationDescriptor.java",
"license": "apache-2.0",
"size": 8388
} | [
"java.util.Collections"
] | import java.util.Collections; | import java.util.*; | [
"java.util"
] | java.util; | 2,357,430 |
@ManyToOne
@JoinColumn(name = "MATRIX_ID", insertable = false, updatable = false)
// Note: the nullable = false cause the add error code -407, the matrix column is null!
// @JoinColumn(name = "MATRIX_ID", insertable = false, updatable = false, nullable = false)
@Index(name = "ROW_M_IDX")
public CharacterMatrix getMatrix() {
return mMatrix;
}
| @JoinColumn(name = STR, insertable = false, updatable = false) @Index(name = STR) CharacterMatrix function() { return mMatrix; } | /**
* Return the Matrix field.
*
* @return StandardMatrix
*/ | Return the Matrix field | getMatrix | {
"repo_name": "TreeBASE/treebasetest",
"path": "treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixRow.java",
"license": "bsd-3-clause",
"size": 11378
} | [
"javax.persistence.JoinColumn",
"org.hibernate.annotations.Index"
] | import javax.persistence.JoinColumn; import org.hibernate.annotations.Index; | import javax.persistence.*; import org.hibernate.annotations.*; | [
"javax.persistence",
"org.hibernate.annotations"
] | javax.persistence; org.hibernate.annotations; | 2,241,859 |
private void handleError(@NotNull Throwable throwable, @NotNull String remoteUrl, StatusNotification notification,
GitOutputConsole console) {
String errorMessage = throwable.getMessage();
notification.setStatus(FAIL);
if (errorMessage == null) {
console.printError(constant.fetchFail(remoteUrl));
notification.setTitle(constant.fetchFail(remoteUrl));
return;
}
try {
errorMessage = dtoFactory.createDtoFromJson(errorMessage, ServiceError.class).getMessage();
if (errorMessage.equals("Unable get private ssh key")) {
console.printError(constant.messagesUnableGetSshKey());
notification.setTitle(constant.messagesUnableGetSshKey());
return;
}
console.printError(errorMessage);
notification.setTitle(errorMessage);
} catch (Exception e) {
console.printError(errorMessage);
notification.setTitle(errorMessage);
}
} | void function(@NotNull Throwable throwable, @NotNull String remoteUrl, StatusNotification notification, GitOutputConsole console) { String errorMessage = throwable.getMessage(); notification.setStatus(FAIL); if (errorMessage == null) { console.printError(constant.fetchFail(remoteUrl)); notification.setTitle(constant.fetchFail(remoteUrl)); return; } try { errorMessage = dtoFactory.createDtoFromJson(errorMessage, ServiceError.class).getMessage(); if (errorMessage.equals(STR)) { console.printError(constant.messagesUnableGetSshKey()); notification.setTitle(constant.messagesUnableGetSshKey()); return; } console.printError(errorMessage); notification.setTitle(errorMessage); } catch (Exception e) { console.printError(errorMessage); notification.setTitle(errorMessage); } } | /**
* Handler some action whether some exception happened.
*
* @param throwable
* exception what happened
*/ | Handler some action whether some exception happened | handleError | {
"repo_name": "dhuebner/che",
"path": "plugins/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/fetch/FetchPresenter.java",
"license": "epl-1.0",
"size": 12608
} | [
"javax.validation.constraints.NotNull",
"org.eclipse.che.api.core.rest.shared.dto.ServiceError",
"org.eclipse.che.ide.api.notification.StatusNotification",
"org.eclipse.che.ide.ext.git.client.outputconsole.GitOutputConsole"
] | import javax.validation.constraints.NotNull; import org.eclipse.che.api.core.rest.shared.dto.ServiceError; import org.eclipse.che.ide.api.notification.StatusNotification; import org.eclipse.che.ide.ext.git.client.outputconsole.GitOutputConsole; | import javax.validation.constraints.*; import org.eclipse.che.api.core.rest.shared.dto.*; import org.eclipse.che.ide.api.notification.*; import org.eclipse.che.ide.ext.git.client.outputconsole.*; | [
"javax.validation",
"org.eclipse.che"
] | javax.validation; org.eclipse.che; | 2,301,295 |
public void setI18n( ResourceBundle i18n ) {
this.i18n = i18n;
} | void function( ResourceBundle i18n ) { this.i18n = i18n; } | /**
* Set the bundle (used via dependency injection)
*
* @param i18n
* the bundle to use
*/ | Set the bundle (used via dependency injection) | setI18n | {
"repo_name": "PE-INTERNATIONAL/soda4lca",
"path": "Node/src/main/java/de/iai/ilcd/webgui/controller/AbstractHandler.java",
"license": "gpl-3.0",
"size": 4161
} | [
"java.util.ResourceBundle"
] | import java.util.ResourceBundle; | import java.util.*; | [
"java.util"
] | java.util; | 1,606,476 |
CompilationSupport registerCompileAndArchiveActions(
ObjcCommon common,
ExtraCompileArgs extraCompileArgs,
Iterable<PathFragment> priorityHeaders) {
if (common.getCompilationArtifacts().isPresent()) {
registerGenerateModuleMapAction(common.getCompilationArtifacts());
Optional<CppModuleMap> moduleMap;
if (objcConfiguration.moduleMapsEnabled()) {
moduleMap = Optional.of(intermediateArtifacts.moduleMap());
} else {
moduleMap = Optional.absent();
}
registerCompileAndArchiveActions(
common.getCompilationArtifacts().get(),
common.getObjcProvider(),
extraCompileArgs,
priorityHeaders,
moduleMap);
}
return this;
} | CompilationSupport registerCompileAndArchiveActions( ObjcCommon common, ExtraCompileArgs extraCompileArgs, Iterable<PathFragment> priorityHeaders) { if (common.getCompilationArtifacts().isPresent()) { registerGenerateModuleMapAction(common.getCompilationArtifacts()); Optional<CppModuleMap> moduleMap; if (objcConfiguration.moduleMapsEnabled()) { moduleMap = Optional.of(intermediateArtifacts.moduleMap()); } else { moduleMap = Optional.absent(); } registerCompileAndArchiveActions( common.getCompilationArtifacts().get(), common.getObjcProvider(), extraCompileArgs, priorityHeaders, moduleMap); } return this; } | /**
* Registers all actions necessary to compile this rule's sources and archive them.
*
* @param common common information about this rule and its dependencies
* @param extraCompileArgs args to be added to compile actions
* @param priorityHeaders priority headers to be included before the dependency headers
* @return this compilation support
*/ | Registers all actions necessary to compile this rule's sources and archive them | registerCompileAndArchiveActions | {
"repo_name": "UrbanCompass/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java",
"license": "apache-2.0",
"size": 79811
} | [
"com.google.common.base.Optional",
"com.google.devtools.build.lib.rules.cpp.CppModuleMap",
"com.google.devtools.build.lib.vfs.PathFragment"
] | import com.google.common.base.Optional; import com.google.devtools.build.lib.rules.cpp.CppModuleMap; import com.google.devtools.build.lib.vfs.PathFragment; | import com.google.common.base.*; import com.google.devtools.build.lib.rules.cpp.*; import com.google.devtools.build.lib.vfs.*; | [
"com.google.common",
"com.google.devtools"
] | com.google.common; com.google.devtools; | 1,272,086 |
NetatmoMeasureType getMeasureType(String itemName); | NetatmoMeasureType getMeasureType(String itemName); | /**
* Queries the Netatmo measure of the given {@code itemName}.
*
* @param itemName
* the itemName to query
* @return the Netatmo measure of the Item identified by {@code itemName} if
* it has a Netatmo binding, <code>null</code> otherwise
*/ | Queries the Netatmo measure of the given itemName | getMeasureType | {
"repo_name": "vgoldman/openhab",
"path": "bundles/binding/org.openhab.binding.netatmo/src/main/java/org/openhab/binding/netatmo/NetatmoBindingProvider.java",
"license": "epl-1.0",
"size": 4352
} | [
"org.openhab.binding.netatmo.internal.weather.NetatmoMeasureType"
] | import org.openhab.binding.netatmo.internal.weather.NetatmoMeasureType; | import org.openhab.binding.netatmo.internal.weather.*; | [
"org.openhab.binding"
] | org.openhab.binding; | 2,166,880 |
public OutOfOfficeWeb getOOOWebByID(int oooId);
| OutOfOfficeWeb function(int oooId); | /**
* Return an instance of ooo web for the given ID
*
* @author alu
*
* @param oooId
* @return
*/ | Return an instance of ooo web for the given ID | getOOOWebByID | {
"repo_name": "CodeSphere/termitaria",
"path": "TermitariaOM/JavaSource/ro/cs/om/model/dao/IDaoOOO.java",
"license": "agpl-3.0",
"size": 3103
} | [
"ro.cs.om.web.entity.OutOfOfficeWeb"
] | import ro.cs.om.web.entity.OutOfOfficeWeb; | import ro.cs.om.web.entity.*; | [
"ro.cs.om"
] | ro.cs.om; | 2,607,464 |
public static CloseWatcher register(Object o, Closeable closeable,
boolean stackTrace) {
ReferenceQueue<Object> q = queue;
if (q == null) {
q = new ReferenceQueue<Object>();
queue = q;
}
CloseWatcher cw = new CloseWatcher(o, q, closeable);
if (stackTrace) {
Exception e = new Exception("Open Stack Trace");
StringWriter s = new StringWriter();
e.printStackTrace(new PrintWriter(s));
cw.openStackTrace = s.toString();
}
if (refs == null) {
refs = createSet();
}
refs.add(cw);
return cw;
} | static CloseWatcher function(Object o, Closeable closeable, boolean stackTrace) { ReferenceQueue<Object> q = queue; if (q == null) { q = new ReferenceQueue<Object>(); queue = q; } CloseWatcher cw = new CloseWatcher(o, q, closeable); if (stackTrace) { Exception e = new Exception(STR); StringWriter s = new StringWriter(); e.printStackTrace(new PrintWriter(s)); cw.openStackTrace = s.toString(); } if (refs == null) { refs = createSet(); } refs.add(cw); return cw; } | /**
* Register an object. Before calling this method, pollUnclosed() should be
* called in a loop to remove old references.
*
* @param o the object
* @param closeable the object to close
* @param stackTrace whether the stack trace should be registered (this is
* relatively slow)
* @return the close watcher
*/ | Register an object. Before calling this method, pollUnclosed() should be called in a loop to remove old references | register | {
"repo_name": "miloszpiglas/h2mod",
"path": "src/main/org/h2/util/CloseWatcher.java",
"license": "mpl-2.0",
"size": 3809
} | [
"java.io.Closeable",
"java.io.PrintWriter",
"java.io.StringWriter",
"java.lang.ref.ReferenceQueue"
] | import java.io.Closeable; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.ref.ReferenceQueue; | import java.io.*; import java.lang.ref.*; | [
"java.io",
"java.lang"
] | java.io; java.lang; | 1,817,532 |
public void insertDelta(NodeRef usageNodeRef, long deltaSize);
| void function(NodeRef usageNodeRef, long deltaSize); | /**
* Create a usage delta entry.
*
* @param deltaSize the size change
*/ | Create a usage delta entry | insertDelta | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/domain/usage/UsageDAO.java",
"license": "lgpl-3.0",
"size": 4103
} | [
"org.alfresco.service.cmr.repository.NodeRef"
] | import org.alfresco.service.cmr.repository.NodeRef; | import org.alfresco.service.cmr.repository.*; | [
"org.alfresco.service"
] | org.alfresco.service; | 2,413,274 |
Service resolveServiceFrom(Service service); | Service resolveServiceFrom(Service service); | /**
* Resolves the real service from the provided service, if appropriate.
*
* @param service the provided service by the caller
* @return the resolved service
*/ | Resolves the real service from the provided service, if appropriate | resolveServiceFrom | {
"repo_name": "creamer/cas",
"path": "api/cas-server-core-api-validation/src/main/java/org/apereo/cas/validation/AuthenticationRequestServiceSelectionStrategy.java",
"license": "apache-2.0",
"size": 1704
} | [
"org.apereo.cas.authentication.principal.Service"
] | import org.apereo.cas.authentication.principal.Service; | import org.apereo.cas.authentication.principal.*; | [
"org.apereo.cas"
] | org.apereo.cas; | 884,701 |
public BufferedReader bufferedReader() throws HttpRequestException {
return bufferedReader(charset());
} | BufferedReader function() throws HttpRequestException { return bufferedReader(charset()); } | /**
* Get buffered reader to response body using the character set returned from
* {@link #charset()} and the configured buffer size
*
* @see #bufferSize(int)
* @return reader
* @throws HttpRequestException
*/ | Get buffered reader to response body using the character set returned from <code>#charset()</code> and the configured buffer size | bufferedReader | {
"repo_name": "xeon90/Geeksone",
"path": "geeksone/src/main/java/com/cheese/geeksone/lib/HttpRequest.java",
"license": "gpl-3.0",
"size": 86954
} | [
"java.io.BufferedReader"
] | import java.io.BufferedReader; | import java.io.*; | [
"java.io"
] | java.io; | 2,147,695 |
private String findNextTest(BufferedReader br) throws IOException
{
String number = "";
while (br.ready())
{
number = br.readLine();
if (number == null)
{
break;
}
number = number.trim();
if (number.startsWith("#"))
{
break;
}
if (!number.equals(""))
{
say("Script error. Line = " + number);
System.exit(-1);
}
}
return number;
} | String function(BufferedReader br) throws IOException { String number = STR#STRSTRScript error. Line = " + number); System.exit(-1); } } return number; } | /**
* Finds next test description in a given script.
* @param br <code>BufferedReader</code> for a script file
* @return strign tag for next test description
* @exception IOException if some io problems occured
*/ | Finds next test description in a given script | findNextTest | {
"repo_name": "shun634501730/java_source_cn",
"path": "src_en/com/sun/org/apache/regexp/internal/RETest.java",
"license": "apache-2.0",
"size": 27268
} | [
"java.io.BufferedReader",
"java.io.IOException"
] | import java.io.BufferedReader; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 653,284 |
@Override
public String getDefaultMessage(String code)
{
return "#" + code + "#";
}
/**
* Looks up the {@link MessageFormat} for a code.
*
* @param code the code to look up
* @param locale the {@link Locale} for which the code should be looked up
* @return newly created {@link MessageFormat} | String function(String code) { return "#" + code + "#"; } /** * Looks up the {@link MessageFormat} for a code. * * @param code the code to look up * @param locale the {@link Locale} for which the code should be looked up * @return newly created {@link MessageFormat} | /**
* The default message adds # marks around the code so that they stand out as not yet translated.
*
* @param code the untranslated code
* @return the code surrounded by `#` characters.
*/ | The default message adds # marks around the code so that they stand out as not yet translated | getDefaultMessage | {
"repo_name": "ChaoPang/molgenis",
"path": "molgenis-i18n/src/main/java/org/molgenis/i18n/LocalizationMessageSource.java",
"license": "lgpl-3.0",
"size": 3349
} | [
"java.text.MessageFormat",
"java.util.Locale"
] | import java.text.MessageFormat; import java.util.Locale; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 1,379,896 |
@Override
public OperationResponse unregisterResource(String resourceName) throws IOException, ServiceException {
// Validate
if (resourceName == null) {
throw new NullPointerException("resourceName");
}
// Tracing
boolean shouldTrace = CloudTracing.getIsEnabled();
String invocationId = null;
if (shouldTrace) {
invocationId = Long.toString(CloudTracing.getNextInvocationId());
HashMap<String, Object> tracingParameters = new HashMap<String, Object>();
tracingParameters.put("resourceName", resourceName);
CloudTracing.enter(invocationId, this, "unregisterResourceAsync", tracingParameters);
}
// Construct URL
String url = "/" + (this.getClient().getCredentials().getSubscriptionId() != null ? this.getClient().getCredentials().getSubscriptionId().trim() : "") + "/services" + "?";
url = url + "service=" + URLEncoder.encode(resourceName.trim(), "UTF-8");
url = url + "&" + "action=unregister";
String baseUrl = this.getClient().getBaseUri().toString();
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl.charAt(baseUrl.length() - 1) == '/') {
baseUrl = baseUrl.substring(0, (baseUrl.length() - 1) + 0);
}
if (url.charAt(0) == '/') {
url = url.substring(1);
}
url = baseUrl + "/" + url;
url = url.replace(" ", "%20");
// Create HTTP transport objects
HttpPut httpRequest = new HttpPut(url);
// Set Headers
httpRequest.setHeader("Content-Type", "application/xml");
httpRequest.setHeader("x-ms-version", "2014-10-01");
// Send Request
HttpResponse httpResponse = null;
try {
if (shouldTrace) {
CloudTracing.sendRequest(invocationId, httpRequest);
}
httpResponse = this.getClient().getHttpClient().execute(httpRequest);
if (shouldTrace) {
CloudTracing.receiveResponse(invocationId, httpResponse);
}
int statusCode = httpResponse.getStatusLine().getStatusCode();
if (statusCode != HttpStatus.SC_OK && statusCode != HttpStatus.SC_ACCEPTED) {
ServiceException ex = ServiceException.createFromXml(httpRequest, null, httpResponse, httpResponse.getEntity());
if (shouldTrace) {
CloudTracing.error(invocationId, ex);
}
throw ex;
}
// Create Result
OperationResponse result = null;
result = new OperationResponse();
result.setStatusCode(statusCode);
if (httpResponse.getHeaders("x-ms-request-id").length > 0) {
result.setRequestId(httpResponse.getFirstHeader("x-ms-request-id").getValue());
}
if (shouldTrace) {
CloudTracing.exit(invocationId, result);
}
return result;
} finally {
if (httpResponse != null && httpResponse.getEntity() != null) {
httpResponse.getEntity().getContent().close();
}
}
} | OperationResponse function(String resourceName) throws IOException, ServiceException { if (resourceName == null) { throw new NullPointerException(STR); } boolean shouldTrace = CloudTracing.getIsEnabled(); String invocationId = null; if (shouldTrace) { invocationId = Long.toString(CloudTracing.getNextInvocationId()); HashMap<String, Object> tracingParameters = new HashMap<String, Object>(); tracingParameters.put(STR, resourceName); CloudTracing.enter(invocationId, this, STR, tracingParameters); } String url = "/" + (this.getClient().getCredentials().getSubscriptionId() != null ? this.getClient().getCredentials().getSubscriptionId().trim() : STR/servicesSTR?STRservice=STRUTF-8STR&STRaction=unregisterSTR/STR STR%20STRContent-TypeSTRapplication/xmlSTRx-ms-versionSTR2014-10-01STRx-ms-request-idSTRx-ms-request-id").getValue()); } if (shouldTrace) { CloudTracing.exit(invocationId, result); } return result; } finally { if (httpResponse != null && httpResponse.getEntity() != null) { httpResponse.getEntity().getContent().close(); } } } | /**
* Unregister a resource with your subscription.
*
* @param resourceName Required. Name of the resource to unregister.
* @throws IOException Signals that an I/O exception of some sort has
* occurred. This class is the general class of exceptions produced by
* failed or interrupted I/O operations.
* @throws ServiceException Thrown if an unexpected response is found.
* @return A standard service response including an HTTP status code and
* request ID.
*/ | Unregister a resource with your subscription | unregisterResource | {
"repo_name": "manikandan-palaniappan/azure-sdk-for-java",
"path": "management/src/main/java/com/microsoft/windowsazure/management/SubscriptionOperationsImpl.java",
"license": "apache-2.0",
"size": 42813
} | [
"com.microsoft.windowsazure.core.OperationResponse",
"com.microsoft.windowsazure.exception.ServiceException",
"com.microsoft.windowsazure.tracing.CloudTracing",
"java.io.IOException",
"java.util.HashMap"
] | import com.microsoft.windowsazure.core.OperationResponse; import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.tracing.CloudTracing; import java.io.IOException; import java.util.HashMap; | import com.microsoft.windowsazure.core.*; import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.tracing.*; import java.io.*; import java.util.*; | [
"com.microsoft.windowsazure",
"java.io",
"java.util"
] | com.microsoft.windowsazure; java.io; java.util; | 1,413,347 |
private void checkCyclicSubstitution(final String varName, final List<String> priorVariables) {
if (priorVariables.contains(varName) == false) {
return;
}
final StrBuilder buf = new StrBuilder(256);
buf.append("Infinite loop in property interpolation of ");
buf.append(priorVariables.remove(0));
buf.append(": ");
buf.appendWithSeparators(priorVariables, "->");
throw new IllegalStateException(buf.toString());
} | void function(final String varName, final List<String> priorVariables) { if (priorVariables.contains(varName) == false) { return; } final StrBuilder buf = new StrBuilder(256); buf.append(STR); buf.append(priorVariables.remove(0)); buf.append(STR); buf.appendWithSeparators(priorVariables, "->"); throw new IllegalStateException(buf.toString()); } | /**
* Checks if the specified variable is already in the stack (list) of variables.
*
* @param varName the variable name to check
* @param priorVariables the list of prior variables
*/ | Checks if the specified variable is already in the stack (list) of variables | checkCyclicSubstitution | {
"repo_name": "shitalm/jsignpdf2",
"path": "src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java",
"license": "gpl-2.0",
"size": 50539
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,212,010 |
public Vector3 transformNormalWorldToObject(Vector3 n) {
return o2w == null ? new Vector3(n) : o2w.transformTransposeV(n);
}
| Vector3 function(Vector3 n) { return o2w == null ? new Vector3(n) : o2w.transformTransposeV(n); } | /**
* Transform the given normal from world space to object space. A new
* {@link Vector3} object is returned.
*
* @param n world space normal to transform
* @return transformed normal
*/ | Transform the given normal from world space to object space. A new <code>Vector3</code> object is returned | transformNormalWorldToObject | {
"repo_name": "ruby-processing/joonsrenderer",
"path": "src/main/java/org/sunflow/core/ShadingState.java",
"license": "gpl-3.0",
"size": 29075
} | [
"org.sunflow.math.Vector3"
] | import org.sunflow.math.Vector3; | import org.sunflow.math.*; | [
"org.sunflow.math"
] | org.sunflow.math; | 2,862,815 |
public synchronized Country getCountry(InetAddress ipAddress) {
return getCountry(bytesToLong(ipAddress.getAddress()));
} | synchronized Country function(InetAddress ipAddress) { return getCountry(bytesToLong(ipAddress.getAddress())); } | /**
* Returns the country the IP address is in.
*
* @param ipAddress the IP address.
* @return the country the IP address is from.
*/ | Returns the country the IP address is in | getCountry | {
"repo_name": "desces/Essentials",
"path": "EssentialsGeoIP/src/com/maxmind/geoip/LookupService.java",
"license": "gpl-3.0",
"size": 38087
} | [
"java.net.InetAddress"
] | import java.net.InetAddress; | import java.net.*; | [
"java.net"
] | java.net; | 2,162,062 |
public static WildcardType supertypeOf(Type bound) {
return new WildcardTypeImpl(new Type[] { Object.class }, new Type[] { bound });
} | static WildcardType function(Type bound) { return new WildcardTypeImpl(new Type[] { Object.class }, new Type[] { bound }); } | /**
* Returns a type that represents an unknown supertype of {@code bound}. For
* example, if {@code bound} is {@code String.class}, this returns {@code ?
* super String}.
*/ | Returns a type that represents an unknown supertype of bound. For example, if bound is String.class, this returns ? super String | supertypeOf | {
"repo_name": "GlenRSmith/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/common/inject/util/Types.java",
"license": "apache-2.0",
"size": 4597
} | [
"java.lang.reflect.Type",
"java.lang.reflect.WildcardType",
"org.elasticsearch.common.inject.internal.MoreTypes"
] | import java.lang.reflect.Type; import java.lang.reflect.WildcardType; import org.elasticsearch.common.inject.internal.MoreTypes; | import java.lang.reflect.*; import org.elasticsearch.common.inject.internal.*; | [
"java.lang",
"org.elasticsearch.common"
] | java.lang; org.elasticsearch.common; | 887,467 |
protected boolean checkUserNameAssertionEnabled() {
return APIUtil.checkUserNameAssertionEnabled();
} | boolean function() { return APIUtil.checkUserNameAssertionEnabled(); } | /**
* Check whether user name assertion is enabled
* @return true/false
*/ | Check whether user name assertion is enabled | checkUserNameAssertionEnabled | {
"repo_name": "pubudu538/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/AMDefaultKeyManagerImpl.java",
"license": "apache-2.0",
"size": 38504
} | [
"org.wso2.carbon.apimgt.impl.utils.APIUtil"
] | import org.wso2.carbon.apimgt.impl.utils.APIUtil; | import org.wso2.carbon.apimgt.impl.utils.*; | [
"org.wso2.carbon"
] | org.wso2.carbon; | 2,468,602 |
@TruffleBoundary
public static TruffleString fromCharArrayUTF16Uncached(char[] value, int charOffset, int charLength) {
return FromCharArrayUTF16Node.getUncached().execute(value, charOffset, charLength);
}
@ImportStatic(TStringGuards.class)
@GeneratePackagePrivate
@GenerateUncached
public abstract static class FromJavaStringNode extends Node {
FromJavaStringNode() {
} | static TruffleString function(char[] value, int charOffset, int charLength) { return FromCharArrayUTF16Node.getUncached().execute(value, charOffset, charLength); } @ImportStatic(TStringGuards.class) public abstract static class FromJavaStringNode extends Node { FromJavaStringNode() { } | /**
* Shorthand for calling the uncached version of {@link FromCharArrayUTF16Node}.
*
* @since 22.1
*/ | Shorthand for calling the uncached version of <code>FromCharArrayUTF16Node</code> | fromCharArrayUTF16Uncached | {
"repo_name": "smarr/Truffle",
"path": "truffle/src/com.oracle.truffle.api.strings/src/com/oracle/truffle/api/strings/TruffleString.java",
"license": "gpl-2.0",
"size": 210753
} | [
"com.oracle.truffle.api.dsl.ImportStatic",
"com.oracle.truffle.api.nodes.Node"
] | import com.oracle.truffle.api.dsl.ImportStatic; import com.oracle.truffle.api.nodes.Node; | import com.oracle.truffle.api.dsl.*; import com.oracle.truffle.api.nodes.*; | [
"com.oracle.truffle"
] | com.oracle.truffle; | 582,807 |
static String getStringValue(Node n) {
// TODO(user): Convert constant array, object, and regex literals as well.
switch (n.getType()) {
case Token.NAME:
case Token.STRING:
return n.getString();
case Token.NUMBER:
double value = n.getDouble();
long longValue = (long) value;
// Return "1" instead of "1.0"
if (longValue == value) {
return Long.toString(longValue);
} else {
return Double.toString(n.getDouble());
}
case Token.FALSE:
case Token.TRUE:
case Token.NULL:
return Node.tokenToName(n.getType());
case Token.VOID:
return "undefined";
}
return null;
}
/**
* Gets the function's name. This method recognizes five forms:
* <ul>
* <li>{@code function name() ...}</li>
* <li>{@code var name = function() ...}</li>
* <li>{@code qualified.name = function() ...}</li>
* <li>{@code var name2 = function name1() ...}</li>
* <li>{@code qualified.name2 = function name1() ...}</li>
* </ul>
* In two last cases with named function expressions, the second name is
* returned (the variable of qualified name).
*
* @param n a node whose type is {@link Token#FUNCTION} | static String getStringValue(Node n) { switch (n.getType()) { case Token.NAME: case Token.STRING: return n.getString(); case Token.NUMBER: double value = n.getDouble(); long longValue = (long) value; if (longValue == value) { return Long.toString(longValue); } else { return Double.toString(n.getDouble()); } case Token.FALSE: case Token.TRUE: case Token.NULL: return Node.tokenToName(n.getType()); case Token.VOID: return STR; } return null; } /** * Gets the function's name. This method recognizes five forms: * <ul> * <li>{@code function name() ...}</li> * <li>{@code var name = function() ...}</li> * <li>{@code qualified.name = function() ...}</li> * <li>{@code var name2 = function name1() ...}</li> * <li>{@code qualified.name2 = function name1() ...}</li> * </ul> * In two last cases with named function expressions, the second name is * returned (the variable of qualified name). * * @param n a node whose type is {@link Token#FUNCTION} | /**
* Gets the value of a node as a String, or null if it cannot be converted.
* When it returns a non-null String, this method effectively emulates the
* <code>String()</code> JavaScript cast function.
*/ | Gets the value of a node as a String, or null if it cannot be converted. When it returns a non-null String, this method effectively emulates the <code>String()</code> JavaScript cast function | getStringValue | {
"repo_name": "ehsan/js-symbolic-executor",
"path": "closure-compiler/src/com/google/javascript/jscomp/NodeUtil.java",
"license": "apache-2.0",
"size": 63706
} | [
"com.google.javascript.rhino.Node",
"com.google.javascript.rhino.Token"
] | import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token; | import com.google.javascript.rhino.*; | [
"com.google.javascript"
] | com.google.javascript; | 1,183,229 |
boolean isEnabled(BuildConfigurationValue config); | boolean isEnabled(BuildConfigurationValue config); | /**
* Returns false if this build info factory is disabled based on the configuration (usually by
* checking if all required configuration fragments are present).
*/ | Returns false if this build info factory is disabled based on the configuration (usually by checking if all required configuration fragments are present) | isEnabled | {
"repo_name": "perezd/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/buildinfo/BuildInfoFactory.java",
"license": "apache-2.0",
"size": 2519
} | [
"com.google.devtools.build.lib.analysis.config.BuildConfigurationValue"
] | import com.google.devtools.build.lib.analysis.config.BuildConfigurationValue; | import com.google.devtools.build.lib.analysis.config.*; | [
"com.google.devtools"
] | com.google.devtools; | 471,741 |
public StepDataInterface getStepDataInterface( String stepname, int stepcopy ) {
if ( steps == null ) {
return null;
}
for ( int i = 0; i < steps.size(); i++ ) {
StepMetaDataCombi sid = steps.get( i );
if ( sid.stepname.equals( stepname ) && sid.copy == stepcopy ) {
return sid.data;
}
}
return null;
} | StepDataInterface function( String stepname, int stepcopy ) { if ( steps == null ) { return null; } for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); if ( sid.stepname.equals( stepname ) && sid.copy == stepcopy ) { return sid.data; } } return null; } | /**
* Finds the StepDataInterface (currently) associated with the specified step.
*
* @param stepname
* The name of the step to look for
* @param stepcopy
* The copy number (0 based) of the step
* @return The StepDataInterface or null if non found.
*/ | Finds the StepDataInterface (currently) associated with the specified step | getStepDataInterface | {
"repo_name": "mdamour1976/pentaho-kettle",
"path": "engine/src/main/java/org/pentaho/di/trans/Trans.java",
"license": "apache-2.0",
"size": 199226
} | [
"org.pentaho.di.trans.step.StepDataInterface",
"org.pentaho.di.trans.step.StepMetaDataCombi"
] | import org.pentaho.di.trans.step.StepDataInterface; import org.pentaho.di.trans.step.StepMetaDataCombi; | import org.pentaho.di.trans.step.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 384,277 |
InstanceInfoBuilder vipAddress(String vipAddress) {
this.vipAddress = requireNonNull(vipAddress, "vipAddress");
return this;
} | InstanceInfoBuilder vipAddress(String vipAddress) { this.vipAddress = requireNonNull(vipAddress, STR); return this; } | /**
* Sets the VIP address.
*/ | Sets the VIP address | vipAddress | {
"repo_name": "anuraaga/armeria",
"path": "eureka/src/main/java/com/linecorp/armeria/server/eureka/InstanceInfoBuilder.java",
"license": "apache-2.0",
"size": 8130
} | [
"java.util.Objects"
] | import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 1,867,412 |
public Executable getExecutable() {
return this.executable;
} | Executable function() { return this.executable; } | /**
* Get the {@code executable} code block associated with this {@code DynamicTest}.
*/ | Get the executable code block associated with this DynamicTest | getExecutable | {
"repo_name": "sbrannen/junit-lambda",
"path": "junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicTest.java",
"license": "epl-1.0",
"size": 5174
} | [
"org.junit.jupiter.api.function.Executable"
] | import org.junit.jupiter.api.function.Executable; | import org.junit.jupiter.api.function.*; | [
"org.junit.jupiter"
] | org.junit.jupiter; | 27,404 |
private void updateUi() {
if (mRefreshButton != null) {
mRefreshButton.setEnabled(mAccount != null);
}
ArrayAdapter<HostInfo> displayer = new HostListAdapter(this, mHosts);
mHostListView.setAdapter(displayer);
} | void function() { if (mRefreshButton != null) { mRefreshButton.setEnabled(mAccount != null); } ArrayAdapter<HostInfo> displayer = new HostListAdapter(this, mHosts); mHostListView.setAdapter(displayer); } | /**
* Updates the infotext and host list display.
*/ | Updates the infotext and host list display | updateUi | {
"repo_name": "danakj/chromium",
"path": "remoting/android/java/src/org/chromium/chromoting/Chromoting.java",
"license": "bsd-3-clause",
"size": 27866
} | [
"android.widget.ArrayAdapter"
] | import android.widget.ArrayAdapter; | import android.widget.*; | [
"android.widget"
] | android.widget; | 222,333 |
// Test for method java.security.DigestInputStream(java.io.InputStream,
// java.security.MessageDigest)
DigestInputStream dis = new DigestInputStream(inStream, digest);
assertNotNull("Constructor returned null instance", dis);
} | DigestInputStream dis = new DigestInputStream(inStream, digest); assertNotNull(STR, dis); } | /**
* java.security.DigestInputStream#DigestInputStream(java.io.InputStream,
* java.security.MessageDigest)
*/ | java.security.DigestInputStream#DigestInputStream(java.io.InputStream, java.security.MessageDigest) | test_ConstructorLjava_io_InputStreamLjava_security_MessageDigest | {
"repo_name": "openweave/openweave-core",
"path": "third_party/android/platform-libcore/android-platform-libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestInputStream2Test.java",
"license": "apache-2.0",
"size": 8523
} | [
"java.security.DigestInputStream"
] | import java.security.DigestInputStream; | import java.security.*; | [
"java.security"
] | java.security; | 1,693,300 |
protected String getNewVersion() {
return new SimpleDateFormat(versionDateFormat).format(new Date());
} | String function() { return new SimpleDateFormat(versionDateFormat).format(new Date()); } | /**
* Gets a new date based version.
*
* @return a {@link java.lang.String} object.
*/ | Gets a new date based version | getNewVersion | {
"repo_name": "SynthesisProject/server",
"path": "synthesis-api/src/main/java/coza/opencollab/synthesis/service/api/creator/impl/AbstractLoader.java",
"license": "agpl-3.0",
"size": 6678
} | [
"java.text.SimpleDateFormat",
"java.util.Date"
] | import java.text.SimpleDateFormat; import java.util.Date; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 1,601,932 |
String value = "";
try {
XMLConfiguration config = new XMLConfiguration(_moduleConfigFilePath);
value = config.getString(key);
} catch (ConfigurationException e) {
_log.error("A ConfigurationException occured when reading:" + _moduleConfigFilePath);
e.printStackTrace();
}
return value;
}
| String value = STRA ConfigurationException occured when reading:" + _moduleConfigFilePath); e.printStackTrace(); } return value; } | /**
* Returns a string value from the configuration path
* @param key is the configuration key
* @return a String value
*/ | Returns a string value from the configuration path | getStringValue | {
"repo_name": "yauritux/venice-legacy",
"path": "Venice/Venice-Utilities/src/main/java/com/djarum/raf/utilities/ModuleConfigUtility.java",
"license": "apache-2.0",
"size": 2893
} | [
"org.apache.commons.configuration.ConfigurationException"
] | import org.apache.commons.configuration.ConfigurationException; | import org.apache.commons.configuration.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,236,536 |
public void sendMessage( final String sourceID ,
final Message message )
throws Exception
{
if ( sourceID == null || message == null )
{
throw new IllegalArgumentException();
}
if ( LOGGER.isTraceEnabled() )
{
LOGGER.trace( "[" + getClass().getSimpleName() + "] sendMessage : sourceID=" + sourceID + " / message=" + Message.
formatSimple( message ) );
}
final Set<String> subRoutes = routes.get( sourceID );
if ( subRoutes != null )
{
for ( final String destinationID : subRoutes )
{
final A_Node destination = nodes.get( destinationID );
destination.receiveMessage( message );
}
}
} | void function( final String sourceID , final Message message ) throws Exception { if ( sourceID == null message == null ) { throw new IllegalArgumentException(); } if ( LOGGER.isTraceEnabled() ) { LOGGER.trace( "[" + getClass().getSimpleName() + STR + sourceID + STR + Message. formatSimple( message ) ); } final Set<String> subRoutes = routes.get( sourceID ); if ( subRoutes != null ) { for ( final String destinationID : subRoutes ) { final A_Node destination = nodes.get( destinationID ); destination.receiveMessage( message ); } } } | /**
* Send a message, from a node.
*
* @param sourceID source node ID
* @param message message
* @throws java.lang.Exception
*/ | Send a message, from a node | sendMessage | {
"repo_name": "fabienvauchelles/superpipes",
"path": "superpipes/src/main/java/com/vaushell/superpipes/dispatch/Dispatcher.java",
"license": "lgpl-3.0",
"size": 13384
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 338,671 |
protected void assertEqualInstances(T expectedInstance, T newInstance) {
assertNotSame(newInstance, expectedInstance);
assertThat(expectedInstance, Matchers.equalTo(newInstance));
assertEquals(expectedInstance.hashCode(), newInstance.hashCode());
} | void function(T expectedInstance, T newInstance) { assertNotSame(newInstance, expectedInstance); assertThat(expectedInstance, Matchers.equalTo(newInstance)); assertEquals(expectedInstance.hashCode(), newInstance.hashCode()); } | /**
* Assert that two instances are equal. This is intentionally not final so we can override
* how equality is checked.
*/ | Assert that two instances are equal. This is intentionally not final so we can override how equality is checked | assertEqualInstances | {
"repo_name": "nknize/elasticsearch",
"path": "test/framework/src/main/java/org/elasticsearch/test/AbstractWireTestCase.java",
"license": "apache-2.0",
"size": 4935
} | [
"org.hamcrest.Matchers"
] | import org.hamcrest.Matchers; | import org.hamcrest.*; | [
"org.hamcrest"
] | org.hamcrest; | 2,741,837 |
protected void addImageHandler(String imgComponent, String absPath) {
ImageComponent image = (ImageComponent) formPanel.getComponentByName(imgComponent);
if (image != null) {
ImageIcon icon = new ImageIcon(absPath);
image.setIcon(icon);
}
} | void function(String imgComponent, String absPath) { ImageComponent image = (ImageComponent) formPanel.getComponentByName(imgComponent); if (image != null) { ImageIcon icon = new ImageIcon(absPath); image.setIcon(icon); } } | /**
* Instead of create an implementation of ImageHandler that only sets a path
* (FixedImageHandler) this utiliy method sets the image without doing
* anything more
*
* @param imgComponent
* . Name of the abeille widget
* @param absPath
* . Absolute path to the image or relative path from andami.jar
*/ | Instead of create an implementation of ImageHandler that only sets a path (FixedImageHandler) this utiliy method sets the image without doing anything more | addImageHandler | {
"repo_name": "iCarto/siga",
"path": "es.icarto.gvsig.siga/src/es/icarto/gvsig/commons/gui/BasicAbstractWindow.java",
"license": "gpl-3.0",
"size": 1764
} | [
"com.jeta.forms.components.image.ImageComponent",
"javax.swing.ImageIcon"
] | import com.jeta.forms.components.image.ImageComponent; import javax.swing.ImageIcon; | import com.jeta.forms.components.image.*; import javax.swing.*; | [
"com.jeta.forms",
"javax.swing"
] | com.jeta.forms; javax.swing; | 895,476 |
@Override
public boolean isSaveAsAllowed() {
return false;
}
/**
* This method generates the dependency graph and sets an {@link EditorPart} | boolean function() { return false; } /** * This method generates the dependency graph and sets an {@link EditorPart} | /**
* As the save methods are empty this functions returns constant false
*/ | As the save methods are empty this functions returns constant false | isSaveAsAllowed | {
"repo_name": "alovassy/titan.EclipsePlug-ins",
"path": "org.eclipse.titanium/src/org/eclipse/titanium/graph/gui/windows/GraphEditor.java",
"license": "epl-1.0",
"size": 25508
} | [
"org.eclipse.ui.part.EditorPart"
] | import org.eclipse.ui.part.EditorPart; | import org.eclipse.ui.part.*; | [
"org.eclipse.ui"
] | org.eclipse.ui; | 2,438,766 |
protected static native boolean isOpaqueGray(IndexColorModel icm); | static native boolean function(IndexColorModel icm); | /**
* Fetches private field IndexColorModel.allgrayopaque
* which is true when all palette entries in the color
* model are gray and opaque.
*/ | Fetches private field IndexColorModel.allgrayopaque which is true when all palette entries in the color model are gray and opaque | isOpaqueGray | {
"repo_name": "mirkosertic/Bytecoder",
"path": "classlib/java.desktop/src/main/resources/META-INF/modules/java.desktop/classes/sun/java2d/SurfaceData.java",
"license": "apache-2.0",
"size": 45153
} | [
"java.awt.image.IndexColorModel"
] | import java.awt.image.IndexColorModel; | import java.awt.image.*; | [
"java.awt"
] | java.awt; | 2,733,003 |
public void convertTransactionIDs(DoubleIntIndex lookup) {
Session[] sessions = database.sessionManager.getAllSessions();
for (int i = 0; i < sessions.length; i++) {
HsqlArrayList tlist = sessions[i].rowActionList;
for (int j = 0, size = tlist.size(); j < size; j++) {
Transaction tx = (Transaction) tlist.get(j);
if (tx.tTable.getTableType() == Table.CACHED_TABLE) {
int pos = lookup.lookupFirstEqual(tx.row.getPos());
tx.row.setPos(pos);
}
}
}
} | void function(DoubleIntIndex lookup) { Session[] sessions = database.sessionManager.getAllSessions(); for (int i = 0; i < sessions.length; i++) { HsqlArrayList tlist = sessions[i].rowActionList; for (int j = 0, size = tlist.size(); j < size; j++) { Transaction tx = (Transaction) tlist.get(j); if (tx.tTable.getTableType() == Table.CACHED_TABLE) { int pos = lookup.lookupFirstEqual(tx.row.getPos()); tx.row.setPos(pos); } } } } | /**
* Convert row ID's for cached table rows in transactions
*/ | Convert row ID's for cached table rows in transactions | convertTransactionIDs | {
"repo_name": "ckaestne/LEADT",
"path": "workspace/hsqldb/src/org/hsqldb/TransactionManager.java",
"license": "gpl-3.0",
"size": 9304
} | [
"org.hsqldb.lib.DoubleIntIndex",
"org.hsqldb.lib.HsqlArrayList"
] | import org.hsqldb.lib.DoubleIntIndex; import org.hsqldb.lib.HsqlArrayList; | import org.hsqldb.lib.*; | [
"org.hsqldb.lib"
] | org.hsqldb.lib; | 231,644 |
public static Map<String, String> loadProperties(InputStream is)
throws StorageException {
Map<String, String> propertiesMap = null;
if (is != null) {
try {
String properties = readStringFromStream(is);
propertiesMap = deserializeMap(properties);
} catch (Exception e) {
String err = "Could not read properties " +
" due to error: " + e.getMessage();
throw new StorageException(err, e);
}
}
if (propertiesMap == null) {
propertiesMap = new HashMap<String, String>();
}
return propertiesMap;
} | static Map<String, String> function(InputStream is) throws StorageException { Map<String, String> propertiesMap = null; if (is != null) { try { String properties = readStringFromStream(is); propertiesMap = deserializeMap(properties); } catch (Exception e) { String err = STR + STR + e.getMessage(); throw new StorageException(err, e); } } if (propertiesMap == null) { propertiesMap = new HashMap<String, String>(); } return propertiesMap; } | /**
* Loads a stream containing properties and populates a map
* with the properties name/value pairs.
*
* @param is
* @return
* @throws StorageException
*/ | Loads a stream containing properties and populates a map with the properties name/value pairs | loadProperties | {
"repo_name": "duracloud/duracloud",
"path": "storageprovider/src/main/java/org/duracloud/storage/util/StorageProviderUtil.java",
"license": "apache-2.0",
"size": 9838
} | [
"java.io.InputStream",
"java.util.HashMap",
"java.util.Map",
"org.duracloud.common.util.IOUtil",
"org.duracloud.common.util.SerializationUtil",
"org.duracloud.storage.error.StorageException"
] | import java.io.InputStream; import java.util.HashMap; import java.util.Map; import org.duracloud.common.util.IOUtil; import org.duracloud.common.util.SerializationUtil; import org.duracloud.storage.error.StorageException; | import java.io.*; import java.util.*; import org.duracloud.common.util.*; import org.duracloud.storage.error.*; | [
"java.io",
"java.util",
"org.duracloud.common",
"org.duracloud.storage"
] | java.io; java.util; org.duracloud.common; org.duracloud.storage; | 993,181 |
boolean checkResult_Failure6(String source, String destination,
String result) {
boolean Failure6 = false;
Pattern resultPatten = Pattern
.compile(":3:\\d+-\\d*: The rvalue contains an Array Index Out of Bounds.\nline 3:\\d+: expecting Semicolon, found 'null'\n");
java.util.regex.Matcher match = resultPatten.matcher(result);
Failure6 = match.matches();
return Failure6;
}
| boolean checkResult_Failure6(String source, String destination, String result) { boolean Failure6 = false; Pattern resultPatten = Pattern .compile(STR); java.util.regex.Matcher match = resultPatten.matcher(result); Failure6 = match.matches(); return Failure6; } | /**
* This function verifies an expected result.
*
* @param source
* A model element instance aquired through a action taken on a
* column of the matrix.
* @param destination
* A model element instance aquired through a action taken taken
* on a row of the matrix.
* @param result
* TODO
* @return true if the test succeeds, false if it fails
*/ | This function verifies an expected result | checkResult_Failure6 | {
"repo_name": "HebaKhaled/bposs",
"path": "src/com.mentor.nucleus.bp.als.oal.test/src/com/mentor/nucleus/bp/als/oal/test/ArrayBaseTest.java",
"license": "apache-2.0",
"size": 51760
} | [
"java.util.regex.Pattern"
] | import java.util.regex.Pattern; | import java.util.regex.*; | [
"java.util"
] | java.util; | 1,435,372 |
public IfClassAvailable<Exclude<T>> createIfClassAvailable()
{
return new IfClassAvailableImpl<Exclude<T>>(this, "if-class-available", childNode);
} | IfClassAvailable<Exclude<T>> function() { return new IfClassAvailableImpl<Exclude<T>>(this, STR, childNode); } | /**
* Creates a new <code>if-class-available</code> element
* @return the new created instance of <code>IfClassAvailable<Exclude<T>></code>
*/ | Creates a new <code>if-class-available</code> element | createIfClassAvailable | {
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/beans11/ExcludeImpl.java",
"license": "epl-1.0",
"size": 9623
} | [
"org.jboss.shrinkwrap.descriptor.api.beans11.Exclude",
"org.jboss.shrinkwrap.descriptor.api.beans11.IfClassAvailable"
] | import org.jboss.shrinkwrap.descriptor.api.beans11.Exclude; import org.jboss.shrinkwrap.descriptor.api.beans11.IfClassAvailable; | import org.jboss.shrinkwrap.descriptor.api.beans11.*; | [
"org.jboss.shrinkwrap"
] | org.jboss.shrinkwrap; | 2,313,216 |
private CREDENTIAL createHCatalogCredential(Cluster cluster, String credentialName) {
final String metaStoreUrl = ClusterHelper.getRegistryEndPoint(cluster);
CREDENTIAL credential = new CREDENTIAL();
credential.setName(credentialName);
credential.setType("hcat");
credential.getProperty().add(createProperty(HiveUtil.METASTROE_URI, metaStoreUrl));
credential.getProperty().add(createProperty(SecurityUtil.METASTORE_PRINCIPAL,
ClusterHelper.getPropertyValue(cluster, SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL)));
return credential;
} | CREDENTIAL function(Cluster cluster, String credentialName) { final String metaStoreUrl = ClusterHelper.getRegistryEndPoint(cluster); CREDENTIAL credential = new CREDENTIAL(); credential.setName(credentialName); credential.setType("hcat"); credential.getProperty().add(createProperty(HiveUtil.METASTROE_URI, metaStoreUrl)); credential.getProperty().add(createProperty(SecurityUtil.METASTORE_PRINCIPAL, ClusterHelper.getPropertyValue(cluster, SecurityUtil.HIVE_METASTORE_KERBEROS_PRINCIPAL))); return credential; } | /**
* This is only necessary if table is involved and is secure mode.
*
* @param cluster cluster entity
* @param credentialName credential name
* @return CREDENTIALS object
*/ | This is only necessary if table is involved and is secure mode | createHCatalogCredential | {
"repo_name": "pisaychuk/falcon",
"path": "oozie/src/main/java/org/apache/falcon/oozie/OozieOrchestrationWorkflowBuilder.java",
"license": "apache-2.0",
"size": 20473
} | [
"org.apache.falcon.entity.ClusterHelper",
"org.apache.falcon.entity.HiveUtil",
"org.apache.falcon.entity.v0.cluster.Cluster",
"org.apache.falcon.security.SecurityUtil"
] | import org.apache.falcon.entity.ClusterHelper; import org.apache.falcon.entity.HiveUtil; import org.apache.falcon.entity.v0.cluster.Cluster; import org.apache.falcon.security.SecurityUtil; | import org.apache.falcon.entity.*; import org.apache.falcon.entity.v0.cluster.*; import org.apache.falcon.security.*; | [
"org.apache.falcon"
] | org.apache.falcon; | 2,685,385 |
public void setFieldTypes(Record record, int iFieldTypes)
{
m_iFieldTypes = iFieldTypes;
} | void function(Record record, int iFieldTypes) { m_iFieldTypes = iFieldTypes; } | /**
* Return thie field types to select/return used on the last makeFieldList call.
* @param record The record to check the field types selected.
* @return The fieldtypes selected.
*/ | Return thie field types to select/return used on the last makeFieldList call | setFieldTypes | {
"repo_name": "jbundle/jbundle",
"path": "base/remote/src/main/java/org/jbundle/base/remote/db/TableSession.java",
"license": "gpl-3.0",
"size": 49799
} | [
"org.jbundle.base.db.Record"
] | import org.jbundle.base.db.Record; | import org.jbundle.base.db.*; | [
"org.jbundle.base"
] | org.jbundle.base; | 377,121 |
public static boolean isDateTimeType(int jdbcTypeCode)
{
Set typesInCategory = (Set)_typesPerCategory.get(JdbcTypeCategoryEnum.DATETIME);
return typesInCategory == null ? false : typesInCategory.contains(new Integer(jdbcTypeCode));
}
| static boolean function(int jdbcTypeCode) { Set typesInCategory = (Set)_typesPerCategory.get(JdbcTypeCategoryEnum.DATETIME); return typesInCategory == null ? false : typesInCategory.contains(new Integer(jdbcTypeCode)); } | /**
* Determines whether the given jdbc type (one of the {@link java.sql.Types} constants)
* is a date/time type.
*
* @param jdbcTypeCode The type code
* @return <code>true</code> if the type is a numeric one
*/ | Determines whether the given jdbc type (one of the <code>java.sql.Types</code> constants) is a date/time type | isDateTimeType | {
"repo_name": "jpcb/ddlutils",
"path": "src/main/java/org/apache/ddlutils/model/TypeMap.java",
"license": "apache-2.0",
"size": 13824
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 570,363 |
public void deleteGroup(String gid) {
GroupTable groupTable = getGroupTable(gid);
String parentGid = groupTable.getParent();
// delete subgroup ID of the parent group
if (parentGid != null && !parentGid.isEmpty()) {
ArrayList<Object> gidList = new ArrayList<Object>(
Arrays.asList(gid));
deleteProperties(parentGid, Constants.KEYFIELD_GROUP_SUBGROUPS,
gidList);
}
HashMap<String, Object> condition = new HashMap<>();
condition.put(Constants.KEYFIELD_GID, gid);
// delete group from the table
AccountDBManager.getInstance().deleteRecord(Constants.GROUP_TABLE,
condition);
ArrayList<String> subgroups = (ArrayList<String>) groupTable
.getSubgroups();
// delete subgroups
if (subgroups != null) {
for (String subgroup : subgroups) {
deleteGroup(subgroup);
mGroupAclManager.removeAceByGroup(subgroup);
}
}
} | void function(String gid) { GroupTable groupTable = getGroupTable(gid); String parentGid = groupTable.getParent(); if (parentGid != null && !parentGid.isEmpty()) { ArrayList<Object> gidList = new ArrayList<Object>( Arrays.asList(gid)); deleteProperties(parentGid, Constants.KEYFIELD_GROUP_SUBGROUPS, gidList); } HashMap<String, Object> condition = new HashMap<>(); condition.put(Constants.KEYFIELD_GID, gid); AccountDBManager.getInstance().deleteRecord(Constants.GROUP_TABLE, condition); ArrayList<String> subgroups = (ArrayList<String>) groupTable .getSubgroups(); if (subgroups != null) { for (String subgroup : subgroups) { deleteGroup(subgroup); mGroupAclManager.removeAceByGroup(subgroup); } } } | /**
* API to delete a group
*
* @param gmid
* An unique identifier of member who must be a group master.
* Group master can be user or resource client.
* @param gid
* An unique identifier of the group created under user entity
* who requested for group creation.
*/ | API to delete a group | deleteGroup | {
"repo_name": "JunhwanPark/TizenRT",
"path": "external/iotivity/iotivity_1.3-rel/cloud/account/src/main/java/org/iotivity/cloud/accountserver/resources/acl/group/GroupManager.java",
"license": "apache-2.0",
"size": 31726
} | [
"java.util.ArrayList",
"java.util.Arrays",
"java.util.HashMap",
"org.iotivity.cloud.accountserver.Constants",
"org.iotivity.cloud.accountserver.db.AccountDBManager",
"org.iotivity.cloud.accountserver.db.GroupTable"
] | import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import org.iotivity.cloud.accountserver.Constants; import org.iotivity.cloud.accountserver.db.AccountDBManager; import org.iotivity.cloud.accountserver.db.GroupTable; | import java.util.*; import org.iotivity.cloud.accountserver.*; import org.iotivity.cloud.accountserver.db.*; | [
"java.util",
"org.iotivity.cloud"
] | java.util; org.iotivity.cloud; | 536,178 |
public WsGroupsResponse groups(GroupsRequest request) {
return call(
new GetRequest(path("groups"))
.setParam("organization", request.getOrganization())
.setParam("p", request.getP())
.setParam("permission", request.getPermission())
.setParam("projectId", request.getProjectId())
.setParam("projectKey", request.getProjectKey())
.setParam("ps", request.getPs())
.setParam("q", request.getQ()),
WsGroupsResponse.parser());
} | WsGroupsResponse function(GroupsRequest request) { return call( new GetRequest(path(STR)) .setParam(STR, request.getOrganization()) .setParam("p", request.getP()) .setParam(STR, request.getPermission()) .setParam(STR, request.getProjectId()) .setParam(STR, request.getProjectKey()) .setParam("ps", request.getPs()) .setParam("q", request.getQ()), WsGroupsResponse.parser()); } | /**
*
* This is part of the internal API.
* This is a GET request.
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/permissions/groups">Further information about this action online (including a response example)</a>
* @since 5.2
*/ | This is part of the internal API. This is a GET request | groups | {
"repo_name": "Godin/sonar",
"path": "sonar-ws/src/main/java/org/sonarqube/ws/client/permissions/PermissionsService.java",
"license": "lgpl-3.0",
"size": 19611
} | [
"org.sonarqube.ws.Permissions",
"org.sonarqube.ws.client.GetRequest"
] | import org.sonarqube.ws.Permissions; import org.sonarqube.ws.client.GetRequest; | import org.sonarqube.ws.*; import org.sonarqube.ws.client.*; | [
"org.sonarqube.ws"
] | org.sonarqube.ws; | 1,592,975 |
private void handleCompleted(Boolean completed, Search search) {
if (completed != null) {
// if endTime is null then the response is incomplete, if not null then it is complete
search.addRestriction( new Restriction("endTime", "", completed ? Restriction.NOT_NULL : Restriction.NULL) );
}
} | void function(Boolean completed, Search search) { if (completed != null) { search.addRestriction( new Restriction(STR, "", completed ? Restriction.NOT_NULL : Restriction.NULL) ); } } | /**
* Reduce code duplication be breaking out this common code
* @param completed
* @param props
* @param values
* @param comparisons
*/ | Reduce code duplication be breaking out this common code | handleCompleted | {
"repo_name": "payten/nyu-sakai-10.4",
"path": "evaluation/impl/src/java/org/sakaiproject/evaluation/logic/EvalDeliveryServiceImpl.java",
"license": "apache-2.0",
"size": 32441
} | [
"org.sakaiproject.genericdao.api.search.Restriction",
"org.sakaiproject.genericdao.api.search.Search"
] | import org.sakaiproject.genericdao.api.search.Restriction; import org.sakaiproject.genericdao.api.search.Search; | import org.sakaiproject.genericdao.api.search.*; | [
"org.sakaiproject.genericdao"
] | org.sakaiproject.genericdao; | 949,987 |
public File switchClusterRolesToRolesIfNeeded(File oldFile) {
boolean isRbacScope = this.extraEnvVars.stream().anyMatch(it -> it.getName().equals(Environment.STRIMZI_RBAC_SCOPE_ENV) && it.getValue().equals(Environment.STRIMZI_RBAC_SCOPE_NAMESPACE));
if (Environment.isNamespaceRbacScope() || isRbacScope || this.clusterOperatorRBACType == ClusterOperatorRBACType.NAMESPACE) {
try {
final String[] fileNameArr = oldFile.getName().split("-");
// change ClusterRole to Role
fileNameArr[1] = "Role";
final String changeFileName = Arrays.stream(fileNameArr).map(item -> "-" + item).collect(Collectors.joining()).substring(1);
File tmpFile = File.createTempFile(changeFileName.replace(".yaml", ""), ".yaml");
TestUtils.writeFile(tmpFile.getAbsolutePath(), TestUtils.readFile(oldFile).replace("ClusterRole", "Role"));
LOGGER.info("Replaced ClusterRole for Role in {}", oldFile.getAbsolutePath());
return tmpFile;
} catch (IOException e) {
throw new RuntimeException(e);
}
} else {
return oldFile;
}
} | File function(File oldFile) { boolean isRbacScope = this.extraEnvVars.stream().anyMatch(it -> it.getName().equals(Environment.STRIMZI_RBAC_SCOPE_ENV) && it.getValue().equals(Environment.STRIMZI_RBAC_SCOPE_NAMESPACE)); if (Environment.isNamespaceRbacScope() isRbacScope this.clusterOperatorRBACType == ClusterOperatorRBACType.NAMESPACE) { try { final String[] fileNameArr = oldFile.getName().split("-"); fileNameArr[1] = "Role"; final String changeFileName = Arrays.stream(fileNameArr).map(item -> "-" + item).collect(Collectors.joining()).substring(1); File tmpFile = File.createTempFile(changeFileName.replace(".yaml", STR.yamlSTRClusterRoleSTRRoleSTRReplaced ClusterRole for Role in {}", oldFile.getAbsolutePath()); return tmpFile; } catch (IOException e) { throw new RuntimeException(e); } } else { return oldFile; } } | /**
* Replace all references to ClusterRole to Role.
* This includes ClusterRoles themselves as well as RoleBindings that reference them.
*/ | Replace all references to ClusterRole to Role. This includes ClusterRoles themselves as well as RoleBindings that reference them | switchClusterRolesToRolesIfNeeded | {
"repo_name": "ppatierno/kaas",
"path": "systemtest/src/main/java/io/strimzi/systemtest/resources/operator/SetupClusterOperator.java",
"license": "apache-2.0",
"size": 31426
} | [
"io.fabric8.kubernetes.api.model.rbac.ClusterRole",
"io.fabric8.kubernetes.api.model.rbac.Role",
"io.strimzi.systemtest.Environment",
"io.strimzi.systemtest.enums.ClusterOperatorRBACType",
"java.io.File",
"java.io.IOException",
"java.util.Arrays",
"java.util.stream.Collectors"
] | import io.fabric8.kubernetes.api.model.rbac.ClusterRole; import io.fabric8.kubernetes.api.model.rbac.Role; import io.strimzi.systemtest.Environment; import io.strimzi.systemtest.enums.ClusterOperatorRBACType; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.stream.Collectors; | import io.fabric8.kubernetes.api.model.rbac.*; import io.strimzi.systemtest.*; import io.strimzi.systemtest.enums.*; import java.io.*; import java.util.*; import java.util.stream.*; | [
"io.fabric8.kubernetes",
"io.strimzi.systemtest",
"java.io",
"java.util"
] | io.fabric8.kubernetes; io.strimzi.systemtest; java.io; java.util; | 1,214,257 |
public static <T> ReflectSetter<T> getReflectSetter(String fieldName, final Class<?> clazz)
{
final String fieldNameCpy = fieldName;
fieldName = Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
Method m = null;
try
{
m = clazz.getMethod("get" + fieldName);
} catch (final NoSuchMethodException ignored1)
{
try
{
m = clazz.getMethod("is" + fieldName);
} catch (final NoSuchMethodException ignored2)
{
for (final Method cm : clazz.getMethods())
{
if ((cm.getName().equalsIgnoreCase("get" + fieldName) || cm.getName().equalsIgnoreCase("is" + fieldName)) && (cm.getReturnType() != Void.class) && (cm.getReturnType() != void.class) && (cm.getParameterCount() == 0))
{
m = cm;
break;
}
}
}
}
if (m != null)
{
return new ReflectMethodSetter<>(m);
}
else
{
return new ReflectField<>(getField(clazz, fieldNameCpy));
}
} | static <T> ReflectSetter<T> function(String fieldName, final Class<?> clazz) { final String fieldNameCpy = fieldName; fieldName = Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1); Method m = null; try { m = clazz.getMethod("get" + fieldName); } catch (final NoSuchMethodException ignored1) { try { m = clazz.getMethod("is" + fieldName); } catch (final NoSuchMethodException ignored2) { for (final Method cm : clazz.getMethods()) { if ((cm.getName().equalsIgnoreCase("get" + fieldName) cm.getName().equalsIgnoreCase("is" + fieldName)) && (cm.getReturnType() != Void.class) && (cm.getReturnType() != void.class) && (cm.getParameterCount() == 0)) { m = cm; break; } } } } if (m != null) { return new ReflectMethodSetter<>(m); } else { return new ReflectField<>(getField(clazz, fieldNameCpy)); } } | /**
* Method will try find simple method setter for selected field,
* or directly use field if method can't be found.
*
* @param fieldName name of field to find setter.
* @param clazz clazz with this field.
* @param <T> type of field.
*
* @return Setter for field value.
*/ | Method will try find simple method setter for selected field, or directly use field if method can't be found | getReflectSetter | {
"repo_name": "marszczybrew/Diorite",
"path": "DioriteAPI/src/main/java/org/diorite/utils/reflections/DioriteReflectionUtils.java",
"license": "mit",
"size": 31279
} | [
"java.lang.reflect.Method"
] | import java.lang.reflect.Method; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,496,326 |
public void setPaymentInstallments(PaymentInstallment paymentInstallments) { this.paymentInstallments = paymentInstallments; } | public void setPaymentInstallments(PaymentInstallment paymentInstallments) { this.paymentInstallments = paymentInstallments; } | /**
* Gets the payment installments.
*
* @return Details of the payment installments.
*/ | Gets the payment installments | getPaymentInstallments | {
"repo_name": "oded-goldstein/Zooz-Java",
"path": "src/main/java/com/zooz/common/client/ecomm/beans/requests/authorize/requests/AbstractInstallmentsSaleRequest.java",
"license": "apache-2.0",
"size": 2404
} | [
"com.zooz.common.client.ecomm.beans.PaymentInstallment"
] | import com.zooz.common.client.ecomm.beans.PaymentInstallment; | import com.zooz.common.client.ecomm.beans.*; | [
"com.zooz.common"
] | com.zooz.common; | 2,873,199 |
public StoreFileMetaData metadata() {
return metadata;
} | StoreFileMetaData function() { return metadata; } | /**
* Returns the StoreFileMetaData for this file info.
*/ | Returns the StoreFileMetaData for this file info | metadata | {
"repo_name": "qwerty4030/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java",
"license": "apache-2.0",
"size": 20534
} | [
"org.elasticsearch.index.store.StoreFileMetaData"
] | import org.elasticsearch.index.store.StoreFileMetaData; | import org.elasticsearch.index.store.*; | [
"org.elasticsearch.index"
] | org.elasticsearch.index; | 1,730,572 |
public static String newUtf8String(byte[] b) {
return Charsets.UTF_8.decode(ByteBuffer.wrap(b)).toString();
} | static String function(byte[] b) { return Charsets.UTF_8.decode(ByteBuffer.wrap(b)).toString(); } | /**
* A clean version of new String(byte[], "UTF-8")
*
* Replace all callers with new String(b, Charsets.UTF_8) when
* we move to Java 6.
*
* @param b a byte array of UTF-8 bytes
* @return a UTF-8 encoded string
*/ | A clean version of new String(byte[], "UTF-8") Replace all callers with new String(b, Charsets.UTF_8) when we move to Java 6 | newUtf8String | {
"repo_name": "apparentlymart/shindig",
"path": "java/common/src/main/java/org/apache/shindig/common/util/CharsetUtil.java",
"license": "apache-2.0",
"size": 1973
} | [
"com.google.common.base.Charsets",
"java.nio.ByteBuffer"
] | import com.google.common.base.Charsets; import java.nio.ByteBuffer; | import com.google.common.base.*; import java.nio.*; | [
"com.google.common",
"java.nio"
] | com.google.common; java.nio; | 24,261 |
public final native void setLabelFunction( IsFunction labelFunction ) ; | final native void function( IsFunction labelFunction ) ; | /**
* "You can use this function to format Value axis labels. This function is called and these parameters are passed: labelFunction(value, valueText, valueAxis); Where value is numeric value, valueText is formatted string and valueAxis is a reference to valueAxis object. Your function should return this.string."
*/ | "You can use this function to format Value axis labels. This function is called and these parameters are passed: labelFunction(value, valueText, valueAxis); Where value is numeric value, valueText is formatted string and valueAxis is a reference to valueAxis object. Your function should return this.string." | setLabelFunction | {
"repo_name": "sillysachin/gwt-amcharts-project",
"path": "gwt-amcharts/src/main/java/com/amcharts/jso/ValueAxisJSO.java",
"license": "mit",
"size": 14883
} | [
"com.amcharts.api.IsFunction"
] | import com.amcharts.api.IsFunction; | import com.amcharts.api.*; | [
"com.amcharts.api"
] | com.amcharts.api; | 2,162,449 |
public synchronized HashMap<CyNetwork, CyNetworkView> getExistingNetworksForColumn(String selectedColumn)
{
HashMap<CyNetwork, CyNetworkView> existing = new HashMap<CyNetwork, CyNetworkView>();
for(CyNetwork network : NetworkHierarchy.keySet())
{
if(NetworkHierarchy.get(network).containsKey(selectedColumn))
{
//PrintFDebugger.Debugging(this, "Found a Network for Column " + selectedColumn + " with name " + network);
for(NetworkNode node : NetworkHierarchy.get(network).get(selectedColumn).values())
{
if(node.getNetwork() != null)
{
//PrintFDebugger.Debugging(this, "Adding Network " + node.getNetwork() + " with name " + node.getNetworkID());
existing.put(node.getNetwork(),SubNetworks.get(node.getNetwork()));
}
}
}
}
return existing;
}
| synchronized HashMap<CyNetwork, CyNetworkView> function(String selectedColumn) { HashMap<CyNetwork, CyNetworkView> existing = new HashMap<CyNetwork, CyNetworkView>(); for(CyNetwork network : NetworkHierarchy.keySet()) { if(NetworkHierarchy.get(network).containsKey(selectedColumn)) { for(NetworkNode node : NetworkHierarchy.get(network).get(selectedColumn).values()) { if(node.getNetwork() != null) { existing.put(node.getNetwork(),SubNetworks.get(node.getNetwork())); } } } } return existing; } | /**
* Get the subnetworks that currently exist for the provided column present in any parent network
* @param selectedColumn The Column to obtain the Network to View pairs for
* @return A {@link Map} of {@link CyNetwork} to {@link CyNetworkView} pairs. The Views can be null, if there is no existing view for the given network.
*/ | Get the subnetworks that currently exist for the provided column present in any parent network | getExistingNetworksForColumn | {
"repo_name": "sysbiolux/IDARE",
"path": "METANODE-CREATOR/src/main/java/idare/subnetwork/internal/NetworkViewSwitcher.java",
"license": "lgpl-3.0",
"size": 19058
} | [
"java.util.HashMap",
"org.cytoscape.model.CyNetwork",
"org.cytoscape.view.model.CyNetworkView"
] | import java.util.HashMap; import org.cytoscape.model.CyNetwork; import org.cytoscape.view.model.CyNetworkView; | import java.util.*; import org.cytoscape.model.*; import org.cytoscape.view.model.*; | [
"java.util",
"org.cytoscape.model",
"org.cytoscape.view"
] | java.util; org.cytoscape.model; org.cytoscape.view; | 816,558 |
@Nonnull
private DruidConnection getDruidConnection(final String connectionId)
{
final DruidConnection connection = connections.get(connectionId);
if (connection == null) {
throw logFailure(new NoSuchConnectionException(connectionId));
}
return connection.sync(
exec.schedule(
() -> {
LOG.debug("Connection[%s] timed out.", connectionId);
closeConnection(new ConnectionHandle(connectionId));
},
new Interval(DateTimes.nowUtc(), config.getConnectionIdleTimeout()).toDurationMillis(),
TimeUnit.MILLISECONDS
)
);
} | DruidConnection function(final String connectionId) { final DruidConnection connection = connections.get(connectionId); if (connection == null) { throw logFailure(new NoSuchConnectionException(connectionId)); } return connection.sync( exec.schedule( () -> { LOG.debug(STR, connectionId); closeConnection(new ConnectionHandle(connectionId)); }, new Interval(DateTimes.nowUtc(), config.getConnectionIdleTimeout()).toDurationMillis(), TimeUnit.MILLISECONDS ) ); } | /**
* Get a connection, or throw an exception if it doesn't exist. Also refreshes the timeout timer.
*
* @param connectionId connection id
* @return the connection
* @throws NoSuchConnectionException if the connection id doesn't exist
*/ | Get a connection, or throw an exception if it doesn't exist. Also refreshes the timeout timer | getDruidConnection | {
"repo_name": "nishantmonu51/druid",
"path": "sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java",
"license": "apache-2.0",
"size": 29881
} | [
"java.util.concurrent.TimeUnit",
"org.apache.calcite.avatica.NoSuchConnectionException",
"org.apache.druid.java.util.common.DateTimes",
"org.joda.time.Interval"
] | import java.util.concurrent.TimeUnit; import org.apache.calcite.avatica.NoSuchConnectionException; import org.apache.druid.java.util.common.DateTimes; import org.joda.time.Interval; | import java.util.concurrent.*; import org.apache.calcite.avatica.*; import org.apache.druid.java.util.common.*; import org.joda.time.*; | [
"java.util",
"org.apache.calcite",
"org.apache.druid",
"org.joda.time"
] | java.util; org.apache.calcite; org.apache.druid; org.joda.time; | 1,017,540 |
public String toString () {
return Literals.NOT_ISPRINCIPAL;
} | String function () { return Literals.NOT_ISPRINCIPAL; } | /**
* For debugging purpose.
*
* @return This expression as string
*
*/ | For debugging purpose | toString | {
"repo_name": "integrated/jakarta-slide-server",
"path": "maven/jakarta-slide-kernel/src/main/java/org/apache/slide/search/basic/expression/NotIsPrincipalExpression.java",
"license": "apache-2.0",
"size": 2376
} | [
"org.apache.slide.search.basic.Literals"
] | import org.apache.slide.search.basic.Literals; | import org.apache.slide.search.basic.*; | [
"org.apache.slide"
] | org.apache.slide; | 2,219,727 |
public boolean selectNextArticle(ArticleInfo pointer) throws IOException
{
if (!NNTPReply.isPositiveCompletion(next())) {
return false;
}
if (pointer != null) {
__parseArticlePointer(getReplyString(), pointer);
}
return true;
} | boolean function(ArticleInfo pointer) throws IOException { if (!NNTPReply.isPositiveCompletion(next())) { return false; } if (pointer != null) { __parseArticlePointer(getReplyString(), pointer); } return true; } | /***
* Select the article following the currently selected article in the
* currently selected newsgroup and return its number and unique id
* through the pointer parameter. Because of deviating server
* implementations, the articleId information cannot be trusted. To
* obtain the article identifier, issue a
* <code> selectArticle(pointer.articleNumber, pointer) </code> immediately
* afterward.
* <p>
* @param pointer A parameter through which to return the article's
* number and unique id. The articleId field cannot always be trusted
* because of server deviations from RFC 977 reply formats. You may
* set this parameter to null if you do not desire to retrieve the
* returned article information.
* @return True if successful, false if not (e.g., there is no following
* article).
* @exception NNTPConnectionClosedException
* If the NNTP server prematurely closes the connection as a result
* of the client being idle or some other reason causing the server
* to send NNTP reply code 400. This exception may be caught either
* as an IOException or independently as itself.
* @exception IOException If an I/O error occurs while either sending a
* command to the server or receiving a reply from the server.
***/ | Select the article following the currently selected article in the currently selected newsgroup and return its number and unique id through the pointer parameter. Because of deviating server implementations, the articleId information cannot be trusted. To obtain the article identifier, issue a <code> selectArticle(pointer.articleNumber, pointer) </code> immediately afterward. | selectNextArticle | {
"repo_name": "codolutions/commons-net",
"path": "src/main/java/org/apache/commons/net/nntp/NNTPClient.java",
"license": "apache-2.0",
"size": 77301
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,609,083 |
@Override
public void channelClosed(ChannelHandlerContext channelHandlerContext, ChannelStateEvent channelStateEvent) throws Exception {
curr_conns.decrementAndGet();
channelGroup.remove(channelHandlerContext.getChannel());
}
private static final SimpleDateFormat date_format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss,SSS");
| void function(ChannelHandlerContext channelHandlerContext, ChannelStateEvent channelStateEvent) throws Exception { curr_conns.decrementAndGet(); channelGroup.remove(channelHandlerContext.getChannel()); } private static final SimpleDateFormat date_format = new SimpleDateFormat(STR); | /**
* On close we manage some statistics, and remove this connection from the channel group.
* @param channelHandlerContext
* @param channelStateEvent
* @throws Exception
*/ | On close we manage some statistics, and remove this connection from the channel group | channelClosed | {
"repo_name": "hdsdi3g/jmemcache-daemon",
"path": "src/com/thimbleware/jmemcached/protocol/MemcachedCommandHandler.java",
"license": "apache-2.0",
"size": 12767
} | [
"java.text.SimpleDateFormat",
"org.jboss.netty.channel.ChannelHandlerContext",
"org.jboss.netty.channel.ChannelStateEvent"
] | import java.text.SimpleDateFormat; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.ChannelStateEvent; | import java.text.*; import org.jboss.netty.channel.*; | [
"java.text",
"org.jboss.netty"
] | java.text; org.jboss.netty; | 533,105 |
EReference getDependencyObject_HasDependents(); | EReference getDependencyObject_HasDependents(); | /**
* Returns the meta object for the reference list '{@link relations.DependencyObject#getHasDependents <em>Has Dependents</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Has Dependents</em>'.
* @see relations.DependencyObject#getHasDependents()
* @see #getDependencyObject()
* @generated
*/ | Returns the meta object for the reference list '<code>relations.DependencyObject#getHasDependents Has Dependents</code>'. | getDependencyObject_HasDependents | {
"repo_name": "KAMP-Research/KAMP",
"path": "bundles/Toometa/toometa.relations/src/relations/RelationsPackage.java",
"license": "apache-2.0",
"size": 51988
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,806,340 |
public BroadcastReceiver getBroadcastReceiver() {
return mBroadcastReceiver;
} | BroadcastReceiver function() { return mBroadcastReceiver; } | /**
* Get a BroadcastReceiver that can handle profiler intents.
*/ | Get a BroadcastReceiver that can handle profiler intents | getBroadcastReceiver | {
"repo_name": "csabakeszegh/android-chromium-view",
"path": "content/src/org/chromium/content/browser/TracingControllerAndroid.java",
"license": "mit",
"size": 10537
} | [
"android.content.BroadcastReceiver"
] | import android.content.BroadcastReceiver; | import android.content.*; | [
"android.content"
] | android.content; | 2,498,601 |
public void addWhereConstraints(List<DBCompareExpr> constraints)
{
// allocate
if (where == null)
where = new ArrayList<DBCompareExpr>();
// add
this.where.addAll(constraints);
} | void function(List<DBCompareExpr> constraints) { if (where == null) where = new ArrayList<DBCompareExpr>(); this.where.addAll(constraints); } | /**
* Adds a list of constraints to the command.
* @param constraints list of constraints
*/ | Adds a list of constraints to the command | addWhereConstraints | {
"repo_name": "apache/empire-db",
"path": "empire-db/src/main/java/org/apache/empire/db/DBCommand.java",
"license": "apache-2.0",
"size": 61286
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.empire.db.expr.compare.DBCompareExpr"
] | import java.util.ArrayList; import java.util.List; import org.apache.empire.db.expr.compare.DBCompareExpr; | import java.util.*; import org.apache.empire.db.expr.compare.*; | [
"java.util",
"org.apache.empire"
] | java.util; org.apache.empire; | 420,101 |
@Test
public void listValues() throws Exception {
// Add a few items to the list.
final Recipient recipient = new Recipient(new Address(new byte[] { 3 }));
final Boolean issueConfirmedNotifications = Boolean.TRUE;
final EventTransitionBits transitions = new EventTransitionBits(true, true, true);
final Destination dest1 = new Destination(recipient, new UnsignedInteger(1), issueConfirmedNotifications,
transitions);
final Destination dest2 = new Destination(recipient, new UnsignedInteger(2), issueConfirmedNotifications,
transitions);
final Destination dest3 = new Destination(recipient, new UnsignedInteger(3), issueConfirmedNotifications,
transitions);
final Destination dest4 = new Destination(recipient, new UnsignedInteger(4), issueConfirmedNotifications,
transitions);
final Destination dest5 = new Destination(recipient, new UnsignedInteger(5), issueConfirmedNotifications,
transitions);
final AddListElementRequest aler = new AddListElementRequest(nc.getId(), PropertyIdentifier.recipientList, null,
new SequenceOf<>(dest1, dest2, dest3));
d2.send(rd1, aler).get();
// Read the whole list
SequenceOf<Destination> list = RequestUtils.getProperty(d2, rd1, nc.getId(), PropertyIdentifier.recipientList);
assertEquals(list, new SequenceOf<>(dest1, dest2, dest3));
// Write a couple more.
d2.send(rd1, new AddListElementRequest(nc.getId(), PropertyIdentifier.recipientList, null,
new SequenceOf<>(dest2, dest5, dest4))).get();
list = RequestUtils.getProperty(d2, rd1, nc.getId(), PropertyIdentifier.recipientList);
assertEquals(list, new SequenceOf<>(dest1, dest2, dest3, dest5, dest4));
// Remove at an index.
d2.send(rd1, new RemoveListElementRequest(nc.getId(), PropertyIdentifier.recipientList, null,
new SequenceOf<Encodable>(dest2, dest5))).get();
// Read the whole list
list = RequestUtils.getProperty(d2, rd1, nc.getId(), PropertyIdentifier.recipientList);
assertEquals(list, new SequenceOf<>(dest1, dest3, dest4));
} | void function() throws Exception { final Recipient recipient = new Recipient(new Address(new byte[] { 3 })); final Boolean issueConfirmedNotifications = Boolean.TRUE; final EventTransitionBits transitions = new EventTransitionBits(true, true, true); final Destination dest1 = new Destination(recipient, new UnsignedInteger(1), issueConfirmedNotifications, transitions); final Destination dest2 = new Destination(recipient, new UnsignedInteger(2), issueConfirmedNotifications, transitions); final Destination dest3 = new Destination(recipient, new UnsignedInteger(3), issueConfirmedNotifications, transitions); final Destination dest4 = new Destination(recipient, new UnsignedInteger(4), issueConfirmedNotifications, transitions); final Destination dest5 = new Destination(recipient, new UnsignedInteger(5), issueConfirmedNotifications, transitions); final AddListElementRequest aler = new AddListElementRequest(nc.getId(), PropertyIdentifier.recipientList, null, new SequenceOf<>(dest1, dest2, dest3)); d2.send(rd1, aler).get(); SequenceOf<Destination> list = RequestUtils.getProperty(d2, rd1, nc.getId(), PropertyIdentifier.recipientList); assertEquals(list, new SequenceOf<>(dest1, dest2, dest3)); d2.send(rd1, new AddListElementRequest(nc.getId(), PropertyIdentifier.recipientList, null, new SequenceOf<>(dest2, dest5, dest4))).get(); list = RequestUtils.getProperty(d2, rd1, nc.getId(), PropertyIdentifier.recipientList); assertEquals(list, new SequenceOf<>(dest1, dest2, dest3, dest5, dest4)); d2.send(rd1, new RemoveListElementRequest(nc.getId(), PropertyIdentifier.recipientList, null, new SequenceOf<Encodable>(dest2, dest5))).get(); list = RequestUtils.getProperty(d2, rd1, nc.getId(), PropertyIdentifier.recipientList); assertEquals(list, new SequenceOf<>(dest1, dest3, dest4)); } | /**
* Ensures that notificationClass.recipientList can be modified with WriteProperty
*/ | Ensures that notificationClass.recipientList can be modified with WriteProperty | listValues | {
"repo_name": "infiniteautomation/BACnet4J",
"path": "src/test/java/com/serotonin/bacnet4j/obj/NotificationClassObjectTest.java",
"license": "gpl-3.0",
"size": 3524
} | [
"com.serotonin.bacnet4j.service.confirmed.AddListElementRequest",
"com.serotonin.bacnet4j.service.confirmed.RemoveListElementRequest",
"com.serotonin.bacnet4j.type.Encodable",
"com.serotonin.bacnet4j.type.constructed.Address",
"com.serotonin.bacnet4j.type.constructed.Destination",
"com.serotonin.bacnet4j.type.constructed.EventTransitionBits",
"com.serotonin.bacnet4j.type.constructed.Recipient",
"com.serotonin.bacnet4j.type.constructed.SequenceOf",
"com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier",
"com.serotonin.bacnet4j.type.primitive.Boolean",
"com.serotonin.bacnet4j.type.primitive.UnsignedInteger",
"com.serotonin.bacnet4j.util.RequestUtils",
"org.junit.Assert"
] | import com.serotonin.bacnet4j.service.confirmed.AddListElementRequest; import com.serotonin.bacnet4j.service.confirmed.RemoveListElementRequest; import com.serotonin.bacnet4j.type.Encodable; import com.serotonin.bacnet4j.type.constructed.Address; import com.serotonin.bacnet4j.type.constructed.Destination; import com.serotonin.bacnet4j.type.constructed.EventTransitionBits; import com.serotonin.bacnet4j.type.constructed.Recipient; import com.serotonin.bacnet4j.type.constructed.SequenceOf; import com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier; import com.serotonin.bacnet4j.type.primitive.Boolean; import com.serotonin.bacnet4j.type.primitive.UnsignedInteger; import com.serotonin.bacnet4j.util.RequestUtils; import org.junit.Assert; | import com.serotonin.bacnet4j.service.confirmed.*; import com.serotonin.bacnet4j.type.*; import com.serotonin.bacnet4j.type.constructed.*; import com.serotonin.bacnet4j.type.enumerated.*; import com.serotonin.bacnet4j.type.primitive.*; import com.serotonin.bacnet4j.util.*; import org.junit.*; | [
"com.serotonin.bacnet4j",
"org.junit"
] | com.serotonin.bacnet4j; org.junit; | 1,356,133 |
public void bind(final ImageView view, final Organization org) {
bind(view, getAvatarUrl(org));
} | void function(final ImageView view, final Organization org) { bind(view, getAvatarUrl(org)); } | /**
* Bind view to image at URL
*
* @param view The ImageView that is to display the user's avatar.
* @param org A User object that points to the desired user.
*/ | Bind view to image at URL | bind | {
"repo_name": "zhangtianqiu/githubandroid",
"path": "app/src/main/java/com/github/pockethub/util/AvatarLoader.java",
"license": "apache-2.0",
"size": 9783
} | [
"android.widget.ImageView",
"com.alorma.github.sdk.bean.dto.response.Organization"
] | import android.widget.ImageView; import com.alorma.github.sdk.bean.dto.response.Organization; | import android.widget.*; import com.alorma.github.sdk.bean.dto.response.*; | [
"android.widget",
"com.alorma.github"
] | android.widget; com.alorma.github; | 224,454 |
void exitFormalParameterList(@NotNull Java8Parser.FormalParameterListContext ctx); | void exitFormalParameterList(@NotNull Java8Parser.FormalParameterListContext ctx); | /**
* Exit a parse tree produced by {@link Java8Parser#formalParameterList}.
*
* @param ctx the parse tree
*/ | Exit a parse tree produced by <code>Java8Parser#formalParameterList</code> | exitFormalParameterList | {
"repo_name": "BigDaddy-Germany/WHOAMI",
"path": "WHOAMI/src/de/aima13/whoami/modules/syntaxcheck/languages/antlrgen/Java8Listener.java",
"license": "mit",
"size": 97945
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 100,233 |
public final @NotNull T[] getPlayersThatCanCancel()
{
return playersThatCanCancel;
} | final @NotNull T[] function() { return playersThatCanCancel; } | /**
* Gets the players that can cancel the request.
*
* @return All the {@link at.pcgamingfreaks.MarriageMaster.Bukkit.API.MarriagePlayer} for the players that can cancel the request.
*/ | Gets the players that can cancel the request | getPlayersThatCanCancel | {
"repo_name": "GeorgH93/Bukkit_MarriageMaster",
"path": "MarriageMaster-API/src/at/pcgamingfreaks/MarriageMaster/API/AcceptPendingRequest.java",
"license": "gpl-3.0",
"size": 5466
} | [
"org.jetbrains.annotations.NotNull"
] | import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 2,259,368 |
public static List<? extends Element> childElementList(Element element, String childElementName) {
if (element == null) return null;
List<Element> elements = FastList.newInstance();
Node node = element.getFirstChild();
if (node != null) {
do {
if (node.getNodeType() == Node.ELEMENT_NODE && (childElementName == null ||
childElementName.equals(node.getNodeName()))) {
Element childElement = (Element) node;
elements.add(childElement);
}
} while ((node = node.getNextSibling()) != null);
}
return elements;
} | static List<? extends Element> function(Element element, String childElementName) { if (element == null) return null; List<Element> elements = FastList.newInstance(); Node node = element.getFirstChild(); if (node != null) { do { if (node.getNodeType() == Node.ELEMENT_NODE && (childElementName == null childElementName.equals(node.getNodeName()))) { Element childElement = (Element) node; elements.add(childElement); } } while ((node = node.getNextSibling()) != null); } return elements; } | /** Return a List of Element objects that have the given name and are
* immediate children of the given element; if name is null, all child
* elements will be included. */ | Return a List of Element objects that have the given name and are immediate children of the given element; if name is null, all child | childElementList | {
"repo_name": "zamentur/ofbiz_ynh",
"path": "sources/framework/base/src/org/ofbiz/base/util/UtilXml.java",
"license": "apache-2.0",
"size": 49565
} | [
"java.util.List",
"javolution.util.FastList",
"org.w3c.dom.Element",
"org.w3c.dom.Node"
] | import java.util.List; import javolution.util.FastList; import org.w3c.dom.Element; import org.w3c.dom.Node; | import java.util.*; import javolution.util.*; import org.w3c.dom.*; | [
"java.util",
"javolution.util",
"org.w3c.dom"
] | java.util; javolution.util; org.w3c.dom; | 103,924 |
WorkflowData data = workItem.getWorkflowData();
if (StringUtils.equals(data.getPayloadType(), PayloadMap.TYPE_JCR_PATH)) {
return data.getPayload().toString();
}
else {
return null;
}
} | WorkflowData data = workItem.getWorkflowData(); if (StringUtils.equals(data.getPayloadType(), PayloadMap.TYPE_JCR_PATH)) { return data.getPayload().toString(); } else { return null; } } | /**
* Checks if the payload points to a resource path and returns it.
* @param workItem Work item
* @return Payload resource path or null
*/ | Checks if the payload points to a resource path and returns it | getPayloadResourcePath | {
"repo_name": "cnagel/wcm-io-handler",
"path": "media/src/main/java/io/wcm/handler/mediasource/dam/impl/metadata/WorkflowProcessUtil.java",
"license": "apache-2.0",
"size": 4597
} | [
"com.adobe.granite.workflow.PayloadMap",
"com.adobe.granite.workflow.exec.WorkflowData",
"org.apache.commons.lang3.StringUtils"
] | import com.adobe.granite.workflow.PayloadMap; import com.adobe.granite.workflow.exec.WorkflowData; import org.apache.commons.lang3.StringUtils; | import com.adobe.granite.workflow.*; import com.adobe.granite.workflow.exec.*; import org.apache.commons.lang3.*; | [
"com.adobe.granite",
"org.apache.commons"
] | com.adobe.granite; org.apache.commons; | 2,523,966 |
public void enableHibernateStatisticsSupport(SessionFactory sessionFactory); | void function(SessionFactory sessionFactory); | /**
* Enable hibernate statistics in the mbean.
*
* @param sessionFactory the {@link SessionFactory} to enable stats for
*/ | Enable hibernate statistics in the mbean | enableHibernateStatisticsSupport | {
"repo_name": "1fechner/FeatureExtractor",
"path": "sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/project/hibernate-ehcache/src/main/java/org/hibernate/cache/ehcache/management/impl/EhcacheHibernateMBeanRegistration.java",
"license": "lgpl-2.1",
"size": 1458
} | [
"org.hibernate.SessionFactory"
] | import org.hibernate.SessionFactory; | import org.hibernate.*; | [
"org.hibernate"
] | org.hibernate; | 234,387 |
public boolean setPageSource(String pageKey,String pageFormat,String stringSourceMarkup){
try{
if(pageFormat!=null && pageFormat.equals(PAGE_FORMAT_FACELET)||pageFormat.equals(PAGE_FORMAT_IBXML2)){
CachedBuilderPage page = getCachedBuilderPage(pageKey);
BuilderFaceletConverter converter = new BuilderFaceletConverter(page,pageFormat,stringSourceMarkup);
converter.convert();
stringSourceMarkup = converter.getConvertedMarkupString();
}
getPageCacher().storePage(pageKey,pageFormat,stringSourceMarkup);
return true;
}
catch(Exception e){
e.printStackTrace();
return false;
}
} | boolean function(String pageKey,String pageFormat,String stringSourceMarkup){ try{ if(pageFormat!=null && pageFormat.equals(PAGE_FORMAT_FACELET) pageFormat.equals(PAGE_FORMAT_IBXML2)){ CachedBuilderPage page = getCachedBuilderPage(pageKey); BuilderFaceletConverter converter = new BuilderFaceletConverter(page,pageFormat,stringSourceMarkup); converter.convert(); stringSourceMarkup = converter.getConvertedMarkupString(); } getPageCacher().storePage(pageKey,pageFormat,stringSourceMarkup); return true; } catch(Exception e){ e.printStackTrace(); return false; } } | /**
* Sets the source and pageFormat for the page with key pageKey and stores to the datastore
* @param pageKey
* @param pageFormat
* @param stringSourceMarkup
*/ | Sets the source and pageFormat for the page with key pageKey and stores to the datastore | setPageSource | {
"repo_name": "idega/com.idega.builder",
"path": "src/java/com/idega/builder/business/BuilderLogic.java",
"license": "gpl-3.0",
"size": 145872
} | [
"com.idega.builder.facelets.BuilderFaceletConverter"
] | import com.idega.builder.facelets.BuilderFaceletConverter; | import com.idega.builder.facelets.*; | [
"com.idega.builder"
] | com.idega.builder; | 703,956 |
return this.lock.tryLock(ms, TimeUnit.MILLISECONDS);
} | return this.lock.tryLock(ms, TimeUnit.MILLISECONDS); } | /**
* The method try get lock during ms.
*
* @param ms - ms for waiting;
* @return true, if get lock or false;
* @throws InterruptedException - exception method tryLock();
*/ | The method try get lock during ms | tryLock | {
"repo_name": "ArtemFM/JavaJunior",
"path": "lesson07/bomber/src/main/java/apavlov/board/Cell.java",
"license": "apache-2.0",
"size": 4666
} | [
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,863,206 |
public int getRating() {
return Dispatch.get(this, "Rating").toInt();
} | int function() { return Dispatch.get(this, STR).toInt(); } | /**
* Wrapper for calling the ActiveX-Method with input-parameter(s).
*
* @return the result is of type int
*/ | Wrapper for calling the ActiveX-Method with input-parameter(s) | getRating | {
"repo_name": "cpesch/MetaMusic",
"path": "itunes-com-library/src/main/java/slash/metamusic/itunes/com/binding/IITFileOrCDTrack.java",
"license": "gpl-2.0",
"size": 32709
} | [
"com.jacob.com.Dispatch"
] | import com.jacob.com.Dispatch; | import com.jacob.com.*; | [
"com.jacob.com"
] | com.jacob.com; | 1,587,948 |
public CMSContentItem getContentItemOrThrowException(String itemId) throws CmsElementNotFoundException {
CMSContentItem item = null;
try {
item = getBestLanguage().getContentItem(itemId);
} catch (CmsElementNotFoundException e) {
try {
item = getDefaultLanguage().getContentItem(itemId);
} catch (CmsElementNotFoundException e1) {
item = getBestLanguageIncludeUnfinished().getContentItem(itemId);
}
}
return item;
} | CMSContentItem function(String itemId) throws CmsElementNotFoundException { CMSContentItem item = null; try { item = getBestLanguage().getContentItem(itemId); } catch (CmsElementNotFoundException e) { try { item = getDefaultLanguage().getContentItem(itemId); } catch (CmsElementNotFoundException e1) { item = getBestLanguageIncludeUnfinished().getContentItem(itemId); } } return item; } | /**
* Return the content item of the given id for the most suitable language using {@link #getBestLanguage()} and - failing that
* {@link #getBestLanguageIncludeUnfinished()}.
*
* @param itemId a {@link java.lang.String} object.
* @return a {@link io.goobi.viewer.model.cms.CMSContentItem} object.
* @throws io.goobi.viewer.exceptions.CmsElementNotFoundException if no matching element was found
*/ | Return the content item of the given id for the most suitable language using <code>#getBestLanguage()</code> and - failing that <code>#getBestLanguageIncludeUnfinished()</code> | getContentItemOrThrowException | {
"repo_name": "intranda/goobi-viewer-core",
"path": "goobi-viewer-core/src/main/java/io/goobi/viewer/model/cms/CMSPage.java",
"license": "gpl-2.0",
"size": 75972
} | [
"io.goobi.viewer.exceptions.CmsElementNotFoundException"
] | import io.goobi.viewer.exceptions.CmsElementNotFoundException; | import io.goobi.viewer.exceptions.*; | [
"io.goobi.viewer"
] | io.goobi.viewer; | 2,434,647 |
public String getName(Context context) {
return getName(context, false);
} | String function(Context context) { return getName(context, false); } | /**
* Returns name of module if is specified, if not gets name of module type
*
* @param context for getting string
* @return name of module
*/ | Returns name of module if is specified, if not gets name of module type | getName | {
"repo_name": "BeeeOn/android",
"path": "BeeeOn/app/src/main/java/com/rehivetech/beeeon/household/device/Module.java",
"license": "bsd-3-clause",
"size": 9148
} | [
"android.content.Context"
] | import android.content.Context; | import android.content.*; | [
"android.content"
] | android.content; | 1,144,373 |
@Test
public void freeDir() throws Exception {
mNestedFileOptions.setPersisted(true);
long blockId = createFileWithSingleBlock(NESTED_FILE_URI);
Assert.assertEquals(1, mBlockMaster.getBlockInfo(blockId).getLocations().size());
// free the dir
mFileSystemMaster.free(NESTED_FILE_URI.getParent(),
FreeOptions.defaults().setForced(true).setRecursive(true));
// Update the heartbeat of removedBlockId received from worker 1
Command heartbeat3 =
mBlockMaster.workerHeartbeat(mWorkerId1, ImmutableMap.of("MEM", (long) Constants.KB),
ImmutableList.of(blockId), ImmutableMap.<String, List<Long>>of());
// Verify the muted Free command on worker1
Assert.assertEquals(new Command(CommandType.Nothing, ImmutableList.<Long>of()), heartbeat3);
Assert.assertEquals(0, mBlockMaster.getBlockInfo(blockId).getLocations().size());
} | void function() throws Exception { mNestedFileOptions.setPersisted(true); long blockId = createFileWithSingleBlock(NESTED_FILE_URI); Assert.assertEquals(1, mBlockMaster.getBlockInfo(blockId).getLocations().size()); mFileSystemMaster.free(NESTED_FILE_URI.getParent(), FreeOptions.defaults().setForced(true).setRecursive(true)); Command heartbeat3 = mBlockMaster.workerHeartbeat(mWorkerId1, ImmutableMap.of("MEM", (long) Constants.KB), ImmutableList.of(blockId), ImmutableMap.<String, List<Long>>of()); Assert.assertEquals(new Command(CommandType.Nothing, ImmutableList.<Long>of()), heartbeat3); Assert.assertEquals(0, mBlockMaster.getBlockInfo(blockId).getLocations().size()); } | /**
* Tests the {@link FileSystemMaster#free} method with a directory.
*/ | Tests the <code>FileSystemMaster#free</code> method with a directory | freeDir | {
"repo_name": "WilliamZapata/alluxio",
"path": "core/server/master/src/test/java/alluxio/master/file/FileSystemMasterTest.java",
"license": "apache-2.0",
"size": 70132
} | [
"com.google.common.collect.ImmutableList",
"com.google.common.collect.ImmutableMap",
"java.net.URI",
"java.util.List",
"org.junit.Assert"
] | import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.net.URI; import java.util.List; import org.junit.Assert; | import com.google.common.collect.*; import java.net.*; import java.util.*; import org.junit.*; | [
"com.google.common",
"java.net",
"java.util",
"org.junit"
] | com.google.common; java.net; java.util; org.junit; | 1,817,934 |
public boolean canPaste() {
if (isEditable() && ClipboardHelper.canPasteStringFromClipboard())
return true;
else
return false;
} | boolean function() { if (isEditable() && ClipboardHelper.canPasteStringFromClipboard()) return true; else return false; } | /**
* Checks whether text can be pasted at the moment.
*
* @return true if text is available for pasting
*/ | Checks whether text can be pasted at the moment | canPaste | {
"repo_name": "waikato-datamining/adams-base",
"path": "adams-core/src/main/java/adams/gui/core/AbstractTextAreaPanelWithAdvancedSyntaxHighlighting.java",
"license": "gpl-3.0",
"size": 15803
} | [
"com.github.fracpete.jclipboardhelper.ClipboardHelper"
] | import com.github.fracpete.jclipboardhelper.ClipboardHelper; | import com.github.fracpete.jclipboardhelper.*; | [
"com.github.fracpete"
] | com.github.fracpete; | 1,502,541 |
public String getReport(final Game game, final Nation owner, final String key) {
final Report thisReport = ReportManager.getInstance().getByOwnerTurnKey(owner, game, game.getTurn(), key);
if (thisReport == null) {
return "";
} else {
return thisReport.getValue();
}
} | String function(final Game game, final Nation owner, final String key) { final Report thisReport = ReportManager.getInstance().getByOwnerTurnKey(owner, game, game.getTurn(), key); if (thisReport == null) { return ""; } else { return thisReport.getValue(); } } | /**
* Retrieve a report entry for this turn.
*
* @param game the game of the report entry.
* @param owner the owner of the report entry.
* @param key the key of the report entry.
* @return the value of the report entry.
*/ | Retrieve a report entry for this turn | getReport | {
"repo_name": "EaW1805/engine",
"path": "src/main/java/com/eaw1805/map/TilesSelector.java",
"license": "mit",
"size": 50964
} | [
"com.eaw1805.data.managers.ReportManager",
"com.eaw1805.data.model.Game",
"com.eaw1805.data.model.Nation",
"com.eaw1805.data.model.Report"
] | import com.eaw1805.data.managers.ReportManager; import com.eaw1805.data.model.Game; import com.eaw1805.data.model.Nation; import com.eaw1805.data.model.Report; | import com.eaw1805.data.managers.*; import com.eaw1805.data.model.*; | [
"com.eaw1805.data"
] | com.eaw1805.data; | 1,506,769 |
private GregorianCalendar newCalendar() {
// hard code GregorianCalendar
return new GregorianCalendar(mTimeZone, mLocale);
} | GregorianCalendar function() { return new GregorianCalendar(mTimeZone, mLocale); } | /**
* Creation method for ne calender instances.
*
* @return a new Calendar instance.
*/ | Creation method for ne calender instances | newCalendar | {
"repo_name": "SourceStudyNotes/log4j2",
"path": "src/main/java/org/apache/logging/log4j/core/util/datetime/FastDatePrinter.java",
"license": "apache-2.0",
"size": 41597
} | [
"java.util.GregorianCalendar"
] | import java.util.GregorianCalendar; | import java.util.*; | [
"java.util"
] | java.util; | 2,365,273 |
public double getDouble() throws StandardException
{
throw dataTypeConversion("double");
} | double function() throws StandardException { throw dataTypeConversion(STR); } | /**
* Gets the value in the data value descriptor as a double.
* Throws an exception if the data value is not receivable as a double.
*
* @return The data value as a double.
*
* @exception StandardException Thrown on error
*/ | Gets the value in the data value descriptor as a double. Throws an exception if the data value is not receivable as a double | getDouble | {
"repo_name": "lpxz/grail-derby104",
"path": "java/engine/org/apache/derby/iapi/types/DataType.java",
"license": "apache-2.0",
"size": 34458
} | [
"org.apache.derby.iapi.error.StandardException"
] | import org.apache.derby.iapi.error.StandardException; | import org.apache.derby.iapi.error.*; | [
"org.apache.derby"
] | org.apache.derby; | 339,388 |
EReference getScenarioDef_IncludedScenarios(); | EReference getScenarioDef_IncludedScenarios(); | /**
* Returns the meta object for the reference list '{@link ucm.scenario.ScenarioDef#getIncludedScenarios <em>Included Scenarios</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Included Scenarios</em>'.
* @see ucm.scenario.ScenarioDef#getIncludedScenarios()
* @see #getScenarioDef()
* @generated
*/ | Returns the meta object for the reference list '<code>ucm.scenario.ScenarioDef#getIncludedScenarios Included Scenarios</code>'. | getScenarioDef_IncludedScenarios | {
"repo_name": "gmussbacher/seg.jUCMNav",
"path": "src/ucm/scenario/ScenarioPackage.java",
"license": "epl-1.0",
"size": 41212
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 203,754 |
protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException {
if (wide) {
n = bytes.readUnsignedShort();
length = 4;
} else if (((opcode >= Constants.ILOAD) && (opcode <= Constants.ALOAD))
|| ((opcode >= Constants.ISTORE) && (opcode <= Constants.ASTORE))) {
n = bytes.readUnsignedByte();
length = 2;
} else if (opcode <= Constants.ALOAD_3) { // compact load instruction such as ILOAD_2
n = (opcode - Constants.ILOAD_0) % 4;
length = 1;
} else { // Assert ISTORE_0 <= tag <= ASTORE_3
n = (opcode - Constants.ISTORE_0) % 4;
length = 1;
}
} | void function( ByteSequence bytes, boolean wide ) throws IOException { if (wide) { n = bytes.readUnsignedShort(); length = 4; } else if (((opcode >= Constants.ILOAD) && (opcode <= Constants.ALOAD)) ((opcode >= Constants.ISTORE) && (opcode <= Constants.ASTORE))) { n = bytes.readUnsignedByte(); length = 2; } else if (opcode <= Constants.ALOAD_3) { n = (opcode - Constants.ILOAD_0) % 4; length = 1; } else { n = (opcode - Constants.ISTORE_0) % 4; length = 1; } } | /**
* Read needed data (e.g. index) from file.
* PRE: (ILOAD <= tag <= ALOAD_3) || (ISTORE <= tag <= ASTORE_3)
*/ | Read needed data (e.g. index) from file | initFromFile | {
"repo_name": "treejames/JMD",
"path": "src/org/apache/bcel/generic/LocalVariableInstruction.java",
"license": "mit",
"size": 6297
} | [
"java.io.IOException",
"org.apache.bcel.Constants",
"org.apache.bcel.util.ByteSequence"
] | import java.io.IOException; import org.apache.bcel.Constants; import org.apache.bcel.util.ByteSequence; | import java.io.*; import org.apache.bcel.*; import org.apache.bcel.util.*; | [
"java.io",
"org.apache.bcel"
] | java.io; org.apache.bcel; | 540,508 |
public void testApp01()
{
Sidacoja sdcj = new Sidacoja();
sdcj.input("./resources/Names.csv");
sdcj.inputType("CSV");
sdcj.columns(new String[]{
"First Name","Last Name","UserID","Date"
});
sdcj.sequence(new String[] {
"Last Name","First Name"
});
sdcj.addFilter(new String[]{"IF","UserID","EQ","U004454"});
sdcj.addFilter(new String[]{"AND","First Name","LIKE","%Chuck%"});
sdcj.addFilter(new String[]{"OR","First Name","LIKE","%Darius"});
sdcj.addFilter(new String[]{"OR","First Name","LIKE","Chris%"});
sdcj.addFilter(new String[]{"OR","Date","EQ","11/11/2011"});
sdcj.addFilter(new String[]{"IF","Date","EQ","11/14/2015"});
sdcj.output("./sidacoja.csv");
sdcj.outputType("CSV");
RowCache cache = new RowCache();
try {
cache = sdcj.fire();
} catch(Exception e) {
console(e.getMessage());
}
//retrieve first selected row to verify sort sequence
List<Row> rows = cache.getList();
//console("rows: "+rows.size());
for(Row row: rows) {
List<Cell> cells = row.getList();
//console("cells: "+cells.size());
if(row.isSelected()) {
System.out.print("row nbr: "+row.getNumber()+" ");
for(Cell cell: cells) {
System.out.print(cell.getLabel()+", "+cell.getValue()+", ");
}
//}
console("");
//if(row.isSelected()) {
// assertTrue("Darius".equals(cells.get(0).getValue() ));
//break;
}
}
//number of data rows equals number of rows in cache
assertTrue(9 == cache.getList().size() );
//number of data rows written equals number of rows selected
// assertTrue(4 == cache.countSelected() );
//number of columns selected for output
assertTrue(4 == cache.countLabels( sdcj.getColumns()));
//number of columns selected for output
assertTrue(4 == cache.getLabels(sdcj.getColumns()).length);
} | void function() { Sidacoja sdcj = new Sidacoja(); sdcj.input(STR); sdcj.inputType("CSV"); sdcj.columns(new String[]{ STR,STR,STR,"Date" }); sdcj.sequence(new String[] { STR,STR }); sdcj.addFilter(new String[]{"IF",STR,"EQ",STR}); sdcj.addFilter(new String[]{"AND",STR,"LIKE",STR}); sdcj.addFilter(new String[]{"OR",STR,"LIKE",STR}); sdcj.addFilter(new String[]{"OR",STR,"LIKE",STR}); sdcj.addFilter(new String[]{"OR","Date","EQ",STR}); sdcj.addFilter(new String[]{"IF","Date","EQ",STR}); sdcj.output(STR); sdcj.outputType("CSV"); RowCache cache = new RowCache(); try { cache = sdcj.fire(); } catch(Exception e) { console(e.getMessage()); } List<Row> rows = cache.getList(); for(Row row: rows) { List<Cell> cells = row.getList(); if(row.isSelected()) { System.out.print(STR+row.getNumber()+" "); for(Cell cell: cells) { System.out.print(cell.getLabel()+STR+cell.getValue()+STR); } console(""); } } assertTrue(9 == cache.getList().size() ); assertTrue(4 == cache.countLabels( sdcj.getColumns())); assertTrue(4 == cache.getLabels(sdcj.getColumns()).length); } | /**
* test LIKE / NOTLIKE selection against CSV
* and verify sort */ | test LIKE / NOTLIKE selection against CSV | testApp01 | {
"repo_name": "chuckrunge/sidacoja",
"path": "src/test/java/com/sidacoja/utils/AppTest5.java",
"license": "gpl-2.0",
"size": 5135
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 240,877 |
String evaluate( WalkedPath walkedPath ); | String evaluate( WalkedPath walkedPath ); | /**
* Evaluate this key as if it is an write path element.
* @param walkedPath "up the tree" list of LiteralPathElements, that may be used by this key as it is computing
* @return String path element to use for write tree building
*/ | Evaluate this key as if it is an write path element | evaluate | {
"repo_name": "tpanagos/jolt",
"path": "jolt-core/src/main/java/com/bazaarvoice/jolt/common/pathelement/EvaluatablePathElement.java",
"license": "apache-2.0",
"size": 1068
} | [
"com.bazaarvoice.jolt.common.WalkedPath"
] | import com.bazaarvoice.jolt.common.WalkedPath; | import com.bazaarvoice.jolt.common.*; | [
"com.bazaarvoice.jolt"
] | com.bazaarvoice.jolt; | 1,129,300 |
@Test
public void testRSAbortWithUnflushedEdits() throws Exception {
LOG.info("Starting testRSAbortWithUnflushedEdits()");
// When the hbase:meta table can be opened, the region servers are running
TEST_UTIL.getConnection().getTable(TableName.META_TABLE_NAME).close();
// Create the test table and open it
TableName tableName = TableName.valueOf(this.getClass().getSimpleName());
TableDescriptor desc = TableDescriptorBuilder.newBuilder(tableName)
.setColumnFamily(ColumnFamilyDescriptorBuilder.of(HConstants.CATALOG_FAMILY)).build();
admin.createTable(desc);
Table table = TEST_UTIL.getConnection().getTable(tableName);
try {
HRegionServer server = TEST_UTIL.getRSForFirstRegionInTable(tableName);
WAL log = server.getWAL(null);
Put p = new Put(Bytes.toBytes("row2001"));
p.addColumn(HConstants.CATALOG_FAMILY, Bytes.toBytes("col"), Bytes.toBytes(2001));
table.put(p);
log.sync();
p = new Put(Bytes.toBytes("row2002"));
p.addColumn(HConstants.CATALOG_FAMILY, Bytes.toBytes("col"), Bytes.toBytes(2002));
table.put(p);
dfsCluster.restartDataNodes();
LOG.info("Restarted datanodes");
try {
log.rollWriter(true);
} catch (FailedLogCloseException flce) {
// Expected exception. We used to expect that there would be unsynced appends but this
// not reliable now that sync plays a roll in wall rolling. The above puts also now call
// sync.
} catch (Throwable t) {
LOG.error(HBaseMarkers.FATAL, "FAILED TEST: Got wrong exception", t);
}
} finally {
table.close();
}
} | void function() throws Exception { LOG.info(STR); TEST_UTIL.getConnection().getTable(TableName.META_TABLE_NAME).close(); TableName tableName = TableName.valueOf(this.getClass().getSimpleName()); TableDescriptor desc = TableDescriptorBuilder.newBuilder(tableName) .setColumnFamily(ColumnFamilyDescriptorBuilder.of(HConstants.CATALOG_FAMILY)).build(); admin.createTable(desc); Table table = TEST_UTIL.getConnection().getTable(tableName); try { HRegionServer server = TEST_UTIL.getRSForFirstRegionInTable(tableName); WAL log = server.getWAL(null); Put p = new Put(Bytes.toBytes(STR)); p.addColumn(HConstants.CATALOG_FAMILY, Bytes.toBytes("col"), Bytes.toBytes(2001)); table.put(p); log.sync(); p = new Put(Bytes.toBytes(STR)); p.addColumn(HConstants.CATALOG_FAMILY, Bytes.toBytes("col"), Bytes.toBytes(2002)); table.put(p); dfsCluster.restartDataNodes(); LOG.info(STR); try { log.rollWriter(true); } catch (FailedLogCloseException flce) { } catch (Throwable t) { LOG.error(HBaseMarkers.FATAL, STR, t); } } finally { table.close(); } } | /**
* Tests that RegionServer aborts if we hit an error closing the WAL when
* there are unsynced WAL edits. See HBASE-4282.
*/ | Tests that RegionServer aborts if we hit an error closing the WAL when there are unsynced WAL edits. See HBASE-4282 | testRSAbortWithUnflushedEdits | {
"repo_name": "mahak/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRollAbort.java",
"license": "apache-2.0",
"size": 10240
} | [
"org.apache.hadoop.hbase.HConstants",
"org.apache.hadoop.hbase.TableName",
"org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder",
"org.apache.hadoop.hbase.client.Put",
"org.apache.hadoop.hbase.client.Table",
"org.apache.hadoop.hbase.client.TableDescriptor",
"org.apache.hadoop.hbase.client.TableDescriptorBuilder",
"org.apache.hadoop.hbase.log.HBaseMarkers",
"org.apache.hadoop.hbase.regionserver.HRegionServer",
"org.apache.hadoop.hbase.util.Bytes"
] | import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Table; import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.client.TableDescriptorBuilder; import org.apache.hadoop.hbase.log.HBaseMarkers; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.util.Bytes; | import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.log.*; import org.apache.hadoop.hbase.regionserver.*; import org.apache.hadoop.hbase.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,050,116 |
public static Image getFlagImage(Country country) {
Image image = flagCache.get(country);
if (image != null) { return image; }
image = getImageFromCollection("flags", country.toString().toLowerCase(), DEFAULT_16X11_IMAGE);
flagCache.put(country, image);
return image;
}
| static Image function(Country country) { Image image = flagCache.get(country); if (image != null) { return image; } image = getImageFromCollection("flags", country.toString().toLowerCase(), DEFAULT_16X11_IMAGE); flagCache.put(country, image); return image; } | /**
* Gets a flag image of a country from file.
*
* @param country the country
*
* @return the image
*/ | Gets a flag image of a country from file | getFlagImage | {
"repo_name": "credentials/smartcardjs",
"path": "ext/scuba/scuba_util_j2se/src/net/sourceforge/scuba/util/IconUtil.java",
"license": "gpl-3.0",
"size": 5798
} | [
"java.awt.Image",
"net.sourceforge.scuba.data.Country"
] | import java.awt.Image; import net.sourceforge.scuba.data.Country; | import java.awt.*; import net.sourceforge.scuba.data.*; | [
"java.awt",
"net.sourceforge.scuba"
] | java.awt; net.sourceforge.scuba; | 1,633,645 |
public synchronized MBeanServer getMBeanServer() {
return mbeanServer;
} | synchronized MBeanServer function() { return mbeanServer; } | /**
* <p>The <code>MBeanServer</code> to which this connector server
* is attached. This is the last value passed to {@link
* #setMBeanServer} on this object, or null if that method has
* never been called.</p>
*
* @return the <code>MBeanServer</code> to which this connector
* is attached.
*
* @see #setMBeanServer
*/ | The <code>MBeanServer</code> to which this connector server is attached. This is the last value passed to <code>#setMBeanServer</code> on this object, or null if that method has never been called | getMBeanServer | {
"repo_name": "greghaskins/openjdk-jdk7u-jdk",
"path": "src/share/classes/javax/management/remote/rmi/RMIServerImpl.java",
"license": "gpl-2.0",
"size": 20802
} | [
"javax.management.MBeanServer"
] | import javax.management.MBeanServer; | import javax.management.*; | [
"javax.management"
] | javax.management; | 1,642,215 |
public double readDOUBLE(String name) throws IOException {
newDumpLevel(name, "DOUBLE");
long el = readLong();
double ret = Double.longBitsToDouble(el);
endDumpLevel(ret);
return ret;
} | double function(String name) throws IOException { newDumpLevel(name, STR); long el = readLong(); double ret = Double.longBitsToDouble(el); endDumpLevel(ret); return ret; } | /**
* Reads one DOUBLE (double precision floating point value) value from the
* stream
*
* @param name
* @return DOUBLE value
* @throws IOException
*/ | Reads one DOUBLE (double precision floating point value) value from the stream | readDOUBLE | {
"repo_name": "crimefire/jpexs-decompiler",
"path": "libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java",
"license": "gpl-3.0",
"size": 128299
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,365,432 |
public boolean getIsTransitive(OWLObjectProperty c) {
for(OWLOntology ont : getAllOntologies()) {
Set<OWLTransitiveObjectPropertyAxiom> ax = ont.getTransitiveObjectPropertyAxioms(c);
if (ax.isEmpty() == false) {
return true;
}
}
return false;
} | boolean function(OWLObjectProperty c) { for(OWLOntology ont : getAllOntologies()) { Set<OWLTransitiveObjectPropertyAxiom> ax = ont.getTransitiveObjectPropertyAxioms(c); if (ax.isEmpty() == false) { return true; } } return false; } | /**
* true if c is transitive in the graph
*
* @param c
* @return boolean
*/ | true if c is transitive in the graph | getIsTransitive | {
"repo_name": "owlcollab/owltools",
"path": "OWLTools-Core/src/main/java/owltools/graph/OWLGraphWrapperExtended.java",
"license": "bsd-3-clause",
"size": 46577
} | [
"java.util.Set",
"org.semanticweb.owlapi.model.OWLObjectProperty",
"org.semanticweb.owlapi.model.OWLOntology",
"org.semanticweb.owlapi.model.OWLTransitiveObjectPropertyAxiom"
] | import java.util.Set; import org.semanticweb.owlapi.model.OWLObjectProperty; import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.owlapi.model.OWLTransitiveObjectPropertyAxiom; | import java.util.*; import org.semanticweb.owlapi.model.*; | [
"java.util",
"org.semanticweb.owlapi"
] | java.util; org.semanticweb.owlapi; | 2,522,130 |
@Indexable(type = IndexableType.REINDEX)
public Acao updateAcao(Acao acao, boolean merge) throws SystemException {
acao.setNew(false);
return acaoPersistence.update(acao, merge);
} | @Indexable(type = IndexableType.REINDEX) Acao function(Acao acao, boolean merge) throws SystemException { acao.setNew(false); return acaoPersistence.update(acao, merge); } | /**
* Updates the acao in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
*
* @param acao the acao
* @param merge whether to merge the acao with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
* @return the acao that was updated
* @throws SystemException if a system exception occurred
*/ | Updates the acao in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners | updateAcao | {
"repo_name": "camaradosdeputadosoficial/edemocracia",
"path": "cd-guiadiscussao-portlet/src/main/java/br/gov/camara/edemocracia/portlets/guiadiscussao/service/base/AcaoLocalServiceBaseImpl.java",
"license": "lgpl-2.1",
"size": 20601
} | [
"br.gov.camara.edemocracia.portlets.guiadiscussao.model.Acao",
"com.liferay.portal.kernel.exception.SystemException",
"com.liferay.portal.kernel.search.Indexable",
"com.liferay.portal.kernel.search.IndexableType"
] | import br.gov.camara.edemocracia.portlets.guiadiscussao.model.Acao; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.search.Indexable; import com.liferay.portal.kernel.search.IndexableType; | import br.gov.camara.edemocracia.portlets.guiadiscussao.model.*; import com.liferay.portal.kernel.exception.*; import com.liferay.portal.kernel.search.*; | [
"br.gov.camara",
"com.liferay.portal"
] | br.gov.camara; com.liferay.portal; | 2,475,675 |
Collection<Measure> getChildrenMeasures(MeasuresFilter filter); | Collection<Measure> getChildrenMeasures(MeasuresFilter filter); | /**
* Never return null.
*/ | Never return null | getChildrenMeasures | {
"repo_name": "xinghuangxu/xinghuangxu.sonarqube",
"path": "sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorContext.java",
"license": "lgpl-3.0",
"size": 4375
} | [
"java.util.Collection",
"org.sonar.api.measures.Measure",
"org.sonar.api.measures.MeasuresFilter"
] | import java.util.Collection; import org.sonar.api.measures.Measure; import org.sonar.api.measures.MeasuresFilter; | import java.util.*; import org.sonar.api.measures.*; | [
"java.util",
"org.sonar.api"
] | java.util; org.sonar.api; | 1,559,453 |
public static boolean isEnabled(State state) {
return Boolean
.valueOf(state.getProp(ConfigurationKeys.METRICS_ENABLED_KEY, ConfigurationKeys.DEFAULT_METRICS_ENABLED));
}
/**
* Get a list of metric names from a given {@link com.codahale.metrics.Metric}.
*
* <p>
* Metric name suffices will be added for {@link com.codahale.metrics.Histogram}s and
* {@link com.codahale.metrics.Timer}s to distinguish different dimensions (min, max,
* median, mean, etc). No suffix will be added for {@link com.codahale.metrics.Counter}s,
* {@link com.codahale.metrics.Meter}s, and {@link com.codahale.metrics.Gauge}s, for
* which a single dimension is sufficient. Accordingly,
* {@link JobMetrics#getMetricValue(com.codahale.metrics.Metric)}
* will return values of different dimensions for {@link com.codahale.metrics.Histogram}s
* and {@link com.codahale.metrics.Timer}s.
* </p>
*
* @param rootName Root metric name
* @param metric given {@link com.codahale.metrics.Metric}
* @return a list of metric names from the given {@link com.codahale.metrics.Metric} | static boolean function(State state) { return Boolean .valueOf(state.getProp(ConfigurationKeys.METRICS_ENABLED_KEY, ConfigurationKeys.DEFAULT_METRICS_ENABLED)); } /** * Get a list of metric names from a given {@link com.codahale.metrics.Metric}. * * <p> * Metric name suffices will be added for {@link com.codahale.metrics.Histogram}s and * {@link com.codahale.metrics.Timer}s to distinguish different dimensions (min, max, * median, mean, etc). No suffix will be added for {@link com.codahale.metrics.Counter}s, * {@link com.codahale.metrics.Meter}s, and {@link com.codahale.metrics.Gauge}s, for * which a single dimension is sufficient. Accordingly, * {@link JobMetrics#getMetricValue(com.codahale.metrics.Metric)} * will return values of different dimensions for {@link com.codahale.metrics.Histogram}s * and {@link com.codahale.metrics.Timer}s. * </p> * * @param rootName Root metric name * @param metric given {@link com.codahale.metrics.Metric} * @return a list of metric names from the given {@link com.codahale.metrics.Metric} | /**
* Check whether metrics collection and reporting are enabled or not.
*
* @param state a {@link State} object containing configuration properties
* @return whether metrics collection and reporting are enabled
*/ | Check whether metrics collection and reporting are enabled or not | isEnabled | {
"repo_name": "WillCh/cs286A",
"path": "crawler/gobblin/gobblin-metrics/src/main/java/gobblin/metrics/JobMetrics.java",
"license": "bsd-2-clause",
"size": 18223
} | [
"com.codahale.metrics.Counter",
"com.codahale.metrics.Gauge",
"com.codahale.metrics.Histogram",
"com.codahale.metrics.Meter",
"com.codahale.metrics.Metric",
"com.codahale.metrics.Timer"
] | import com.codahale.metrics.Counter; import com.codahale.metrics.Gauge; import com.codahale.metrics.Histogram; import com.codahale.metrics.Meter; import com.codahale.metrics.Metric; import com.codahale.metrics.Timer; | import com.codahale.metrics.*; | [
"com.codahale.metrics"
] | com.codahale.metrics; | 2,870,823 |
@Column(name = "remove_time")
@Override
public Date getRemoveTime() {
return (Date) get(9);
} | @Column(name = STR) Date function() { return (Date) get(9); } | /**
* Getter for <code>cattle.user_preference.remove_time</code>.
*/ | Getter for <code>cattle.user_preference.remove_time</code> | getRemoveTime | {
"repo_name": "vincent99/cattle",
"path": "code/iaas/model/src/main/java/io/cattle/platform/core/model/tables/records/UserPreferenceRecord.java",
"license": "apache-2.0",
"size": 14524
} | [
"java.util.Date",
"javax.persistence.Column"
] | import java.util.Date; import javax.persistence.Column; | import java.util.*; import javax.persistence.*; | [
"java.util",
"javax.persistence"
] | java.util; javax.persistence; | 2,798,556 |
public synchronized void mapOutputLost(TaskAttemptID taskid,
String errorMsg) throws IOException {
TaskInProgress tip = tasks.get(taskid);
if (tip != null) {
tip.mapOutputLost(errorMsg);
} else {
LOG.warn("Unknown child with bad map output: "+taskid+". Ignored.");
}
}
static class RunningJob{
private JobID jobid;
private JobConf jobConf;
// keep this for later use
volatile Set<TaskInProgress> tasks;
boolean localized;
boolean keepJobFiles;
FetchStatus f;
RunningJob(JobID jobid) {
this.jobid = jobid;
localized = false;
tasks = new HashSet<TaskInProgress>();
keepJobFiles = false;
} | synchronized void function(TaskAttemptID taskid, String errorMsg) throws IOException { TaskInProgress tip = tasks.get(taskid); if (tip != null) { tip.mapOutputLost(errorMsg); } else { LOG.warn(STR+taskid+STR); } } static class RunningJob{ private JobID jobid; private JobConf jobConf; volatile Set<TaskInProgress> tasks; boolean localized; boolean keepJobFiles; FetchStatus f; RunningJob(JobID jobid) { this.jobid = jobid; localized = false; tasks = new HashSet<TaskInProgress>(); keepJobFiles = false; } | /**
* A completed map task's output has been lost.
*/ | A completed map task's output has been lost | mapOutputLost | {
"repo_name": "zyguan/HDFS-503-on-0.20.2",
"path": "src/mapred/org/apache/hadoop/mapred/TaskTracker.java",
"license": "apache-2.0",
"size": 112048
} | [
"java.io.IOException",
"java.util.HashSet",
"java.util.Set"
] | import java.io.IOException; import java.util.HashSet; import java.util.Set; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 448,490 |
@Monitor(name = "ResponseTimeMillis90Percentile", type = DataSourceType.INFORMATIONAL,
description = "90th percentile in total time to handle a request, in milliseconds")
public double getResponseTime90thPercentile() {
return getResponseTimePercentile(Percent.NINETY);
} | @Monitor(name = STR, type = DataSourceType.INFORMATIONAL, description = STR) double function() { return getResponseTimePercentile(Percent.NINETY); } | /**
* Gets the 90-th percentile in the total amount of time spent handling a request, in milliseconds.
*/ | Gets the 90-th percentile in the total amount of time spent handling a request, in milliseconds | getResponseTime90thPercentile | {
"repo_name": "Netflix/ribbon",
"path": "ribbon-loadbalancer/src/main/java/com/netflix/loadbalancer/ServerStats.java",
"license": "apache-2.0",
"size": 19668
} | [
"com.netflix.servo.annotations.DataSourceType",
"com.netflix.servo.annotations.Monitor"
] | import com.netflix.servo.annotations.DataSourceType; import com.netflix.servo.annotations.Monitor; | import com.netflix.servo.annotations.*; | [
"com.netflix.servo"
] | com.netflix.servo; | 365,436 |
private DataRecord setErrRecord(DataRecord dbRecord, DataRecord errRecord, int rowNumber, String errMsg) {
errRecord = setErrRecord(errRecord, rowNumber, errMsg);
for (int dbFieldNum = 0; dbFieldNum < dbRecord.getNumFields(); dbFieldNum++) {
errRecord.getField(dbFieldNum).setValue(dbRecord.getField(dbFieldNum));
}
return errRecord;
}
| DataRecord function(DataRecord dbRecord, DataRecord errRecord, int rowNumber, String errMsg) { errRecord = setErrRecord(errRecord, rowNumber, errMsg); for (int dbFieldNum = 0; dbFieldNum < dbRecord.getNumFields(); dbFieldNum++) { errRecord.getField(dbFieldNum).setValue(dbRecord.getField(dbFieldNum)); } return errRecord; } | /**
* Set value in errRecord. In last two field is set row number and error message
* and other fields are copies from dbRecord
* @param dbRecord source record
* @param errRecord destination record
* @param rowNumber number of bad row
* @param errMsg errorMsg
* @return destination record
*/ | Set value in errRecord. In last two field is set row number and error message and other fields are copies from dbRecord | setErrRecord | {
"repo_name": "CloverETL/CloverETL-Engine",
"path": "cloveretl.bulkloader/src/org/jetel/component/InformixDataWriter.java",
"license": "lgpl-2.1",
"size": 45113
} | [
"org.jetel.data.DataRecord"
] | import org.jetel.data.DataRecord; | import org.jetel.data.*; | [
"org.jetel.data"
] | org.jetel.data; | 1,999,097 |
public static <R> Function<Object,R[]> methodForArrayOf(final Type<R> resultType, final String methodName, final Object... optionalParameters) {
return new Call<Object,R[]>(Types.arrayOf(resultType), methodName, VarArgsUtil.asOptionalObjectArray(Object.class,optionalParameters));
}
| static <R> Function<Object,R[]> function(final Type<R> resultType, final String methodName, final Object... optionalParameters) { return new Call<Object,R[]>(Types.arrayOf(resultType), methodName, VarArgsUtil.asOptionalObjectArray(Object.class,optionalParameters)); } | /**
* <p>
* Executes a method on the target object which returns R[], being <tt>R</tt> the
* specified type parameter. Parameters must match those of the method.
* </p>
*
* @param resultType the type of the method's result
* @param methodName the name of the method
* @param optionalParameters the (optional) parameters of the method.
* @return the result of the method execution
*/ | Executes a method on the target object which returns R[], being R the specified type parameter. Parameters must match those of the method. | methodForArrayOf | {
"repo_name": "op4j/op4j",
"path": "src/main/java/org/op4j/functions/Call.java",
"license": "apache-2.0",
"size": 27542
} | [
"org.javaruntype.type.Type",
"org.javaruntype.type.Types",
"org.op4j.util.VarArgsUtil"
] | import org.javaruntype.type.Type; import org.javaruntype.type.Types; import org.op4j.util.VarArgsUtil; | import org.javaruntype.type.*; import org.op4j.util.*; | [
"org.javaruntype.type",
"org.op4j.util"
] | org.javaruntype.type; org.op4j.util; | 2,544,182 |
public void connectDownloadSvc(String address) {
mAddress = address;
mDownloadServiceIntent = new Intent(mContext, BflFwDownloadService.class);
mDownloadServiceIntent.putExtra("MAC_ADDRESS", mAddress);
// BLE FOTA Library uses a daemon(local) background service using startService method to run independently
// & a remote service using bindService method to communicate by AIDL.
mContext.startService(mDownloadServiceIntent);
mContext.bindService(mDownloadServiceIntent, mBflDownloadSvcConnection, mContext.BIND_ADJUST_WITH_ACTIVITY);
} | void function(String address) { mAddress = address; mDownloadServiceIntent = new Intent(mContext, BflFwDownloadService.class); mDownloadServiceIntent.putExtra(STR, mAddress); mContext.startService(mDownloadServiceIntent); mContext.bindService(mDownloadServiceIntent, mBflDownloadSvcConnection, mContext.BIND_ADJUST_WITH_ACTIVITY); } | /**
* BLE FOTA firmware download service connection.
* Create service connection & download firmware from the sever.
*
* @param address is the device MAC address.
* @see kr.co.sevencore.blefotalib.BflFwDownloadService
*/ | BLE FOTA firmware download service connection. Create service connection & download firmware from the sever | connectDownloadSvc | {
"repo_name": "sevencore/BLEFOTA",
"path": "blefotalib/src/main/java/kr/co/sevencore/blefotalib/BflFwDownloader.java",
"license": "gpl-2.0",
"size": 16242
} | [
"android.content.Intent"
] | import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 37,448 |
public List<StatisticalObjectType> getSubTypes( )
{
return Collections.unmodifiableList( this.subTypes );
}
| List<StatisticalObjectType> function( ) { return Collections.unmodifiableList( this.subTypes ); } | /**
* Returns the list of sub types of the StatisticalObjectType.
*
* @return Returns the list of subtypes.
*/ | Returns the list of sub types of the StatisticalObjectType | getSubTypes | {
"repo_name": "jsegura/surveyforge",
"path": "surveyforge-core/src/main/java/org/surveyforge/core/metadata/StatisticalObjectType.java",
"license": "gpl-2.0",
"size": 12142
} | [
"java.util.Collections",
"java.util.List"
] | import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,524,699 |
public void storeServiceNames(String fileName) {
int index = 0; //index in case that several services store data in the same location
for(BackendService service: services.values()){
FileUtil.writeFile(new File(service.getDataDirPath()+"/"+fileName+"#"+index), service.getName());
index++;
}
}
| void function(String fileName) { int index = 0; for(BackendService service: services.values()){ FileUtil.writeFile(new File(service.getDataDirPath()+"/"+fileName+"#"+index), service.getName()); index++; } } | /**
* Store the service name of each service in the service's data directory
* @param fileName the name of the file to store the service name
*/ | Store the service name of each service in the service's data directory | storeServiceNames | {
"repo_name": "joe42/nubisave",
"path": "splitter/src/com/github/joe42/splitter/backend/BackendServices.java",
"license": "gpl-3.0",
"size": 8684
} | [
"com.github.joe42.splitter.util.file.FileUtil",
"java.io.File"
] | import com.github.joe42.splitter.util.file.FileUtil; import java.io.File; | import com.github.joe42.splitter.util.file.*; import java.io.*; | [
"com.github.joe42",
"java.io"
] | com.github.joe42; java.io; | 1,580,639 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.