method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public ChangePasswordError decode( ByteBuffer buf ) throws IOException { ChangePasswordErrorModifier modifier = new ChangePasswordErrorModifier(); short messageLength = buf.getShort(); modifier.setProtocolVersionNumber( buf.getShort() ); // AP_REQ length will be 0 for error messages buf.getShort(); // authHeader length int errorLength = messageLength - HEADER_LENGTH; byte[] errorBytes = new byte[errorLength]; buf.get( errorBytes ); ByteBuffer errorBuffer = ByteBuffer.wrap( errorBytes ); KrbError errorMessage = KerberosDecoder.decodeKrbError( errorBuffer ); modifier.setErrorMessage( errorMessage ); return modifier.getChangePasswordError(); }
ChangePasswordError function( ByteBuffer buf ) throws IOException { ChangePasswordErrorModifier modifier = new ChangePasswordErrorModifier(); short messageLength = buf.getShort(); modifier.setProtocolVersionNumber( buf.getShort() ); buf.getShort(); int errorLength = messageLength - HEADER_LENGTH; byte[] errorBytes = new byte[errorLength]; buf.get( errorBytes ); ByteBuffer errorBuffer = ByteBuffer.wrap( errorBytes ); KrbError errorMessage = KerberosDecoder.decodeKrbError( errorBuffer ); modifier.setErrorMessage( errorMessage ); return modifier.getChangePasswordError(); }
/** * Decodes a {@link ByteBuffer} into a {@link ChangePasswordError}. * * @param buf * @return The {@link ChangePasswordError}. * @throws IOException */
Decodes a <code>ByteBuffer</code> into a <code>ChangePasswordError</code>
decode
{ "repo_name": "drankye/directory-server", "path": "protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorDecoder.java", "license": "apache-2.0", "size": 2287 }
[ "java.io.IOException", "java.nio.ByteBuffer", "org.apache.directory.server.changepw.messages.ChangePasswordError", "org.apache.directory.server.kerberos.protocol.KerberosDecoder", "org.apache.directory.shared.kerberos.messages.KrbError" ]
import java.io.IOException; import java.nio.ByteBuffer; import org.apache.directory.server.changepw.messages.ChangePasswordError; import org.apache.directory.server.kerberos.protocol.KerberosDecoder; import org.apache.directory.shared.kerberos.messages.KrbError;
import java.io.*; import java.nio.*; import org.apache.directory.server.changepw.messages.*; import org.apache.directory.server.kerberos.protocol.*; import org.apache.directory.shared.kerberos.messages.*;
[ "java.io", "java.nio", "org.apache.directory" ]
java.io; java.nio; org.apache.directory;
2,100,265
protected Pair<Connection, PreparedStatement> makeNew() { log.info(".makeNew Obtaining new connection and statement"); Connection connection; try { connection = databaseConnectionFactory.getConnection(); } catch (DatabaseConfigException ex) { throw new EPException("Error obtaining connection", ex); } PreparedStatement preparedStatement; try { preparedStatement = connection.prepareStatement(sql); } catch (SQLException ex) { try { connection.close(); } catch (SQLException e) { log.warn("Error closing connection: " + e.getMessage(), e); } throw new EPException("Error preparing statement '" + sql + '\'', ex); } return new Pair<Connection, PreparedStatement>(connection, preparedStatement); } private static Log log = LogFactory.getLog(ConnectionCache.class);
Pair<Connection, PreparedStatement> function() { log.info(STR); Connection connection; try { connection = databaseConnectionFactory.getConnection(); } catch (DatabaseConfigException ex) { throw new EPException(STR, ex); } PreparedStatement preparedStatement; try { preparedStatement = connection.prepareStatement(sql); } catch (SQLException ex) { try { connection.close(); } catch (SQLException e) { log.warn(STR + e.getMessage(), e); } throw new EPException(STR + sql + '\'', ex); } return new Pair<Connection, PreparedStatement>(connection, preparedStatement); } private static Log log = LogFactory.getLog(ConnectionCache.class);
/** * Make a new pair of resources. * @return pair of resources */
Make a new pair of resources
makeNew
{ "repo_name": "georgenicoll/esper", "path": "esper/src/main/java/com/espertech/esper/epl/db/ConnectionCache.java", "license": "gpl-2.0", "size": 4327 }
[ "com.espertech.esper.client.EPException", "com.espertech.esper.collection.Pair", "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.SQLException", "org.apache.commons.logging.Log", "org.apache.commons.logging.LogFactory" ]
import com.espertech.esper.client.EPException; import com.espertech.esper.collection.Pair; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory;
import com.espertech.esper.client.*; import com.espertech.esper.collection.*; import java.sql.*; import org.apache.commons.logging.*;
[ "com.espertech.esper", "java.sql", "org.apache.commons" ]
com.espertech.esper; java.sql; org.apache.commons;
2,809,101
public void setNotificationOriginator(NotificationOriginator notificationOriginator) { this.notificationOriginator = notificationOriginator; if (agent != null) { agent.setNotificationOriginator(notificationOriginator); } }
void function(NotificationOriginator notificationOriginator) { this.notificationOriginator = notificationOriginator; if (agent != null) { agent.setNotificationOriginator(notificationOriginator); } }
/** * Sets the notification originator of this agent configuration. * * @param notificationOriginator a <code>NotificationOriginator</code> instance. */
Sets the notification originator of this agent configuration
setNotificationOriginator
{ "repo_name": "chao-sun-kaazing/gateway", "path": "management/src/main/java/org/kaazing/gateway/management/snmp/SnmpManagementServiceHandler.java", "license": "apache-2.0", "size": 127855 }
[ "org.snmp4j.agent.NotificationOriginator" ]
import org.snmp4j.agent.NotificationOriginator;
import org.snmp4j.agent.*;
[ "org.snmp4j.agent" ]
org.snmp4j.agent;
1,037,976
public void onCompletion(MediaPlayer player) { LOG.d(LOG_TAG, "on completion is calling stopped"); this.setState(STATE.MEDIA_STOPPED); }
void function(MediaPlayer player) { LOG.d(LOG_TAG, STR); this.setState(STATE.MEDIA_STOPPED); }
/** * Callback to be invoked when playback of a media source has completed. * * @param player The MediaPlayer that reached the end of the file */
Callback to be invoked when playback of a media source has completed
onCompletion
{ "repo_name": "AubreyHewes/cordova-plugin-media", "path": "src/android/AudioPlayer.java", "license": "apache-2.0", "size": 27133 }
[ "android.media.MediaPlayer", "org.apache.cordova.LOG" ]
import android.media.MediaPlayer; import org.apache.cordova.LOG;
import android.media.*; import org.apache.cordova.*;
[ "android.media", "org.apache.cordova" ]
android.media; org.apache.cordova;
1,537,011
protected Channel getProducerChannel() throws IOException, TimeoutException { if (producerChannel == null) { synchronized (this) { if (producerChannel == null) { producerChannel = createChannel(); } } } return producerChannel; } private Channel consumerChannel;
Channel function() throws IOException, TimeoutException { if (producerChannel == null) { synchronized (this) { if (producerChannel == null) { producerChannel = createChannel(); } } } return producerChannel; } private Channel consumerChannel;
/** * Get the {@link Channel} dedicated for sending messages. * * @return * @throws IOException * @throws TimeoutException */
Get the <code>Channel</code> dedicated for sending messages
getProducerChannel
{ "repo_name": "DDTH/ddth-queue", "path": "ddth-queue-core/src/main/java/com/github/ddth/queue/impl/RabbitMqQueue.java", "license": "mit", "size": 8649 }
[ "com.rabbitmq.client.Channel", "java.io.IOException", "java.util.concurrent.TimeoutException" ]
import com.rabbitmq.client.Channel; import java.io.IOException; import java.util.concurrent.TimeoutException;
import com.rabbitmq.client.*; import java.io.*; import java.util.concurrent.*;
[ "com.rabbitmq.client", "java.io", "java.util" ]
com.rabbitmq.client; java.io; java.util;
491,397
private static IOException toIOException(Exception e) { if (e instanceof RemoteException) { return ((RemoteException) e).unwrapRemoteException(); } if (e instanceof IOException) { return (IOException)e; } return new IOException(e); }
static IOException function(Exception e) { if (e instanceof RemoteException) { return ((RemoteException) e).unwrapRemoteException(); } if (e instanceof IOException) { return (IOException)e; } return new IOException(e); }
/** * Convert an exception to an IOException. * * For a non-IOException, wrap it with IOException. For a RemoteException, * unwrap it. For an IOException which is not a RemoteException, return it. * * @param e Exception to convert into an exception. * @return Created IO exception. */
Convert an exception to an IOException. For a non-IOException, wrap it with IOException. For a RemoteException, unwrap it. For an IOException which is not a RemoteException, return it
toIOException
{ "repo_name": "szegedim/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java", "license": "apache-2.0", "size": 44687 }
[ "java.io.IOException", "org.apache.hadoop.ipc.RemoteException" ]
import java.io.IOException; import org.apache.hadoop.ipc.RemoteException;
import java.io.*; import org.apache.hadoop.ipc.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,350,109
public ExpirationPolicy toTicketExpirationPolicy() { val uma = casProperties.getAuthn().getUma(); return new HardTimeoutExpirationPolicy(Beans.newDuration(uma.getPermissionTicket().getMaxTimeToLiveInSeconds()).getSeconds()); }
ExpirationPolicy function() { val uma = casProperties.getAuthn().getUma(); return new HardTimeoutExpirationPolicy(Beans.newDuration(uma.getPermissionTicket().getMaxTimeToLiveInSeconds()).getSeconds()); }
/** * To ticket expiration policy. * * @return the expiration policy */
To ticket expiration policy
toTicketExpirationPolicy
{ "repo_name": "philliprower/cas", "path": "support/cas-server-support-oauth-uma-core/src/main/java/org/apereo/cas/uma/ticket/permission/UmaPermissionTicketExpirationPolicyBuilder.java", "license": "apache-2.0", "size": 1620 }
[ "org.apereo.cas.configuration.support.Beans", "org.apereo.cas.ticket.ExpirationPolicy", "org.apereo.cas.ticket.expiration.HardTimeoutExpirationPolicy" ]
import org.apereo.cas.configuration.support.Beans; import org.apereo.cas.ticket.ExpirationPolicy; import org.apereo.cas.ticket.expiration.HardTimeoutExpirationPolicy;
import org.apereo.cas.configuration.support.*; import org.apereo.cas.ticket.*; import org.apereo.cas.ticket.expiration.*;
[ "org.apereo.cas" ]
org.apereo.cas;
1,014,411
public void addWhiteListEntry(String origin, boolean subdomains) { try { // Unlimited access to network resources if (origin.compareTo("*") == 0) { LOG.d(TAG, "Unlimited access to network resources"); this.whiteList.add(Pattern.compile(".*")); } else { // specific access // check if subdomains should be included // TODO: we should not add more domains if * has already been added if (subdomains) { // XXX making it stupid friendly for people who forget to include protocol/SSL if (origin.startsWith("http")) { this.whiteList.add(Pattern.compile(origin.replaceFirst("https?://", "^https?://(.*\\.)?"))); } else { this.whiteList.add(Pattern.compile("^https?://(.*\\.)?" + origin)); } LOG.d(TAG, "Origin to allow with subdomains: %s", origin); } else { // XXX making it stupid friendly for people who forget to include protocol/SSL if (origin.startsWith("http")) { this.whiteList.add(Pattern.compile(origin.replaceFirst("https?://", "^https?://"))); } else { this.whiteList.add(Pattern.compile("^https?://" + origin)); } LOG.d(TAG, "Origin to allow: %s", origin); } } } catch (Exception e) { LOG.d(TAG, "Failed to add origin %s", origin); } }
void function(String origin, boolean subdomains) { try { if (origin.compareTo("*") == 0) { LOG.d(TAG, STR); this.whiteList.add(Pattern.compile(".*")); } else { if (subdomains) { if (origin.startsWith("http")) { this.whiteList.add(Pattern.compile(origin.replaceFirst(STR^https?: } LOG.d(TAG, STR, origin); } else { if (origin.startsWith("http")) { this.whiteList.add(Pattern.compile(origin.replaceFirst(STR^https?: } LOG.d(TAG, STR, origin); } } } catch (Exception e) { LOG.d(TAG, STR, origin); } }
/** * Add entry to approved list of URLs (whitelist) * * @param origin URL regular expression to allow * @param subdomains T=include all subdomains under origin */
Add entry to approved list of URLs (whitelist)
addWhiteListEntry
{ "repo_name": "askyheller/testgithub", "path": "framework/src/org/apache/cordova/CordovaWebView.java", "license": "apache-2.0", "size": 34998 }
[ "java.util.regex.Pattern", "org.apache.cordova.api.LOG" ]
import java.util.regex.Pattern; import org.apache.cordova.api.LOG;
import java.util.regex.*; import org.apache.cordova.api.*;
[ "java.util", "org.apache.cordova" ]
java.util; org.apache.cordova;
6,185
public synchronized RecordId writeBlock( byte[] bytes, int offset, int length) { checkNotNull(bytes); checkPositionIndexes(offset, offset + length, bytes.length); RecordId blockId = prepare(RecordType.BLOCK, length); System.arraycopy(bytes, offset, buffer, position, length); position += length; return blockId; }
synchronized RecordId function( byte[] bytes, int offset, int length) { checkNotNull(bytes); checkPositionIndexes(offset, offset + length, bytes.length); RecordId blockId = prepare(RecordType.BLOCK, length); System.arraycopy(bytes, offset, buffer, position, length); position += length; return blockId; }
/** * Writes a block record containing the given block of bytes. * * @param bytes source buffer * @param offset offset within the source buffer * @param length number of bytes to write * @return block record identifier */
Writes a block record containing the given block of bytes
writeBlock
{ "repo_name": "afilimonov/jackrabbit-oak", "path": "oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentWriter.java", "license": "apache-2.0", "size": 48153 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,940,290
@Transactional public void onLogout(@Observes UserLogoutEvent event) { auditProcessor.auditUserOperation((User) userStore.wrap(event.getAuthenticatedUser()), AUDIT_CONSTANT_LOGOUT, event); }
void function(@Observes UserLogoutEvent event) { auditProcessor.auditUserOperation((User) userStore.wrap(event.getAuthenticatedUser()), AUDIT_CONSTANT_LOGOUT, event); }
/** * Observes logout events in EMF. * * @param event * - the logout event */
Observes logout events in EMF
onLogout
{ "repo_name": "SirmaITT/conservation-space-1.7.0", "path": "docker/sirma-platform/platform/seip-parent/platform/seip-audit/seip-audit-impl/src/main/java/com/sirma/itt/emf/audit/observer/SecurityAuditObserver.java", "license": "lgpl-3.0", "size": 2725 }
[ "com.sirma.itt.emf.security.event.UserLogoutEvent", "com.sirma.itt.seip.resources.User", "javax.enterprise.event.Observes" ]
import com.sirma.itt.emf.security.event.UserLogoutEvent; import com.sirma.itt.seip.resources.User; import javax.enterprise.event.Observes;
import com.sirma.itt.emf.security.event.*; import com.sirma.itt.seip.resources.*; import javax.enterprise.event.*;
[ "com.sirma.itt", "javax.enterprise" ]
com.sirma.itt; javax.enterprise;
197,504
private List<GraphNode<E,T>> reconstructPath(Map<GraphNode<E,T>, GraphNode<E,T>> cameFrom, GraphNode<E,T> currentNode, List<GraphNode<E,T>> result) { if ( cameFrom.containsKey(currentNode) ) { reconstructPath(cameFrom, cameFrom.get(currentNode), result); result.add(currentNode); return result; } return result; }
List<GraphNode<E,T>> function(Map<GraphNode<E,T>, GraphNode<E,T>> cameFrom, GraphNode<E,T> currentNode, List<GraphNode<E,T>> result) { if ( cameFrom.containsKey(currentNode) ) { reconstructPath(cameFrom, cameFrom.get(currentNode), result); result.add(currentNode); return result; } return result; }
/** * Reconstructs the path from the start to finish nodes. * * @param <E> * @param <T> * @param cameFrom - path traversed * @param currentNode - current node * @param result - list of {@link GraphNode}s needed to reach the goal * @return the result list - for convience */
Reconstructs the path from the start to finish nodes
reconstructPath
{ "repo_name": "tonysparks/franks", "path": "src/franks/graph/AStarGraphSearch.java", "license": "gpl-3.0", "size": 10990 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,895,722
protected static String getSQL(Expression[] list) { StatementBuilder buff = new StatementBuilder(); for (Expression e : list) { buff.appendExceptFirst(", "); if (e != null) { buff.append(e.getSQL()); } } return buff.toString(); }
static String function(Expression[] list) { StatementBuilder buff = new StatementBuilder(); for (Expression e : list) { buff.appendExceptFirst(STR); if (e != null) { buff.append(e.getSQL()); } } return buff.toString(); }
/** * Get the SQL snippet of the expression list. * * @param list the expression list * @return the SQL snippet */
Get the SQL snippet of the expression list
getSQL
{ "repo_name": "titus08/frostwire-desktop", "path": "lib/jars-src/h2-1.3.164/org/h2/command/Prepared.java", "license": "gpl-3.0", "size": 10168 }
[ "org.h2.expression.Expression", "org.h2.util.StatementBuilder" ]
import org.h2.expression.Expression; import org.h2.util.StatementBuilder;
import org.h2.expression.*; import org.h2.util.*;
[ "org.h2.expression", "org.h2.util" ]
org.h2.expression; org.h2.util;
900,477
public FriendsDeleteAllRequestsQuery deleteAllRequests(UserActor actor) { return new FriendsDeleteAllRequestsQuery(getClient(), actor); }
FriendsDeleteAllRequestsQuery function(UserActor actor) { return new FriendsDeleteAllRequestsQuery(getClient(), actor); }
/** * Marks all incoming friend requests as viewed. * * @param actor vk actor * @return query */
Marks all incoming friend requests as viewed
deleteAllRequests
{ "repo_name": "VKCOM/vk-java-sdk", "path": "sdk/src/main/java/com/vk/api/sdk/actions/Friends.java", "license": "mit", "size": 11957 }
[ "com.vk.api.sdk.client.actors.UserActor", "com.vk.api.sdk.queries.friends.FriendsDeleteAllRequestsQuery" ]
import com.vk.api.sdk.client.actors.UserActor; import com.vk.api.sdk.queries.friends.FriendsDeleteAllRequestsQuery;
import com.vk.api.sdk.client.actors.*; import com.vk.api.sdk.queries.friends.*;
[ "com.vk.api" ]
com.vk.api;
1,504,481
public List<SiteNode> getNodesInContextFromSiteTree() { List<SiteNode> nodes = new LinkedList<>(); SiteNode rootNode = session.getSiteTree().getRoot(); fillNodesInContext(rootNode, nodes); return nodes; }
List<SiteNode> function() { List<SiteNode> nodes = new LinkedList<>(); SiteNode rootNode = session.getSiteTree().getRoot(); fillNodesInContext(rootNode, nodes); return nodes; }
/** * Gets the nodes from the site tree which are "In Scope". Searches recursively starting from * the root node. Should be used with care, as it is time-consuming, querying the database for * every node in the Site Tree. * * @return the nodes in scope from site tree * @see #hasNodesInContextFromSiteTree() */
Gets the nodes from the site tree which are "In Scope". Searches recursively starting from the root node. Should be used with care, as it is time-consuming, querying the database for every node in the Site Tree
getNodesInContextFromSiteTree
{ "repo_name": "Ali-Razmjoo/zaproxy", "path": "zap/src/main/java/org/zaproxy/zap/model/Context.java", "license": "apache-2.0", "size": 27423 }
[ "java.util.LinkedList", "java.util.List", "org.parosproxy.paros.model.SiteNode" ]
import java.util.LinkedList; import java.util.List; import org.parosproxy.paros.model.SiteNode;
import java.util.*; import org.parosproxy.paros.model.*;
[ "java.util", "org.parosproxy.paros" ]
java.util; org.parosproxy.paros;
2,076,471
public double evalDouble(QueryContext context) throws SQLException { if (context.isGroupNull(_dataField)) return 0; else return context.getGroupDouble(_dataField); }
double function(QueryContext context) throws SQLException { if (context.isGroupNull(_dataField)) return 0; else return context.getGroupDouble(_dataField); }
/** * Evaluates the expression as a double. * * @param rows the current tuple being evaluated * * @return the double value */
Evaluates the expression as a double
evalDouble
{ "repo_name": "dlitz/resin", "path": "modules/resin/src/com/caucho/db/sql/MaxExpr.java", "license": "gpl-2.0", "size": 3677 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
527,600
@ApiModelProperty(required = true, value = "Description about individual errors occurred ") public String getMessage() { return message; }
@ApiModelProperty(required = true, value = STR) String function() { return message; }
/** * Description about individual errors occurred * @return message **/
Description about individual errors occurred
getMessage
{ "repo_name": "nirmal070125/product-bam", "path": "modules/components/org.wso2.carbon.das.jobmanager.core/src/gen/java/org/wso2/carbon/das/jobmanager/core/dto/ErrorListItemDTO.java", "license": "apache-2.0", "size": 2933 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
2,018,203
return "output.write"; } }; public GroovyClassLoaderTearOff(MetaClassLoader owner) { this.owner = owner; gcl = createGroovyClassLoader(); }
return STR; } }; public GroovyClassLoaderTearOff(MetaClassLoader owner) { this.owner = owner; gcl = createGroovyClassLoader(); }
/** * Sends the output via {@link XMLOutput#write(String)} */
Sends the output via <code>XMLOutput#write(String)</code>
printCommand
{ "repo_name": "christ66/stapler", "path": "groovy/src/main/java/org/kohsuke/stapler/jelly/groovy/GroovyClassLoaderTearOff.java", "license": "bsd-2-clause", "size": 4161 }
[ "org.kohsuke.stapler.MetaClassLoader" ]
import org.kohsuke.stapler.MetaClassLoader;
import org.kohsuke.stapler.*;
[ "org.kohsuke.stapler" ]
org.kohsuke.stapler;
2,337,441
VerbDefinition definition = mapper.readValue(VerbDefinitionFilterTest.class.getResourceAsStream("/post.json"), VerbDefinition.class); VerbDefinitionKeepFilter filter = new VerbDefinitionKeepFilter(Sets.newHashSet(definition)); filter.prepare(null); StreamsDatum datum1 = new StreamsDatum(mapper.readValue("{\"id\":\"1\",\"verb\":\"notpost\"}\n", Activity.class)); List<StreamsDatum> result1 = filter.process(datum1); assert result1.size() == 0; StreamsDatum datum2 = new StreamsDatum(mapper.readValue("{\"id\":\"1\",\"verb\":\"post\"}\n", Activity.class)); List<StreamsDatum> result2 = filter.process(datum2); assert result2.size() == 1; }
VerbDefinition definition = mapper.readValue(VerbDefinitionFilterTest.class.getResourceAsStream(STR), VerbDefinition.class); VerbDefinitionKeepFilter filter = new VerbDefinitionKeepFilter(Sets.newHashSet(definition)); filter.prepare(null); StreamsDatum datum1 = new StreamsDatum(mapper.readValue("{\"id\":\"1\",\"verb\":\"notpost\"}\n", Activity.class)); List<StreamsDatum> result1 = filter.process(datum1); assert result1.size() == 0; StreamsDatum datum2 = new StreamsDatum(mapper.readValue("{\"id\":\"1\",\"verb\":\"post\"}\n", Activity.class)); List<StreamsDatum> result2 = filter.process(datum2); assert result2.size() == 1; }
/** * Test verb match filter alone */
Test verb match filter alone
testVerbMatchFilter
{ "repo_name": "steveblackmon/incubator-streams", "path": "streams-components/streams-filters/src/test/java/org/apache/streams/filters/test/VerbDefinitionFilterTest.java", "license": "apache-2.0", "size": 16052 }
[ "com.google.common.collect.Sets", "java.util.List", "org.apache.streams.core.StreamsDatum", "org.apache.streams.filters.VerbDefinitionKeepFilter", "org.apache.streams.pojo.json.Activity", "org.apache.streams.verbs.VerbDefinition" ]
import com.google.common.collect.Sets; import java.util.List; import org.apache.streams.core.StreamsDatum; import org.apache.streams.filters.VerbDefinitionKeepFilter; import org.apache.streams.pojo.json.Activity; import org.apache.streams.verbs.VerbDefinition;
import com.google.common.collect.*; import java.util.*; import org.apache.streams.core.*; import org.apache.streams.filters.*; import org.apache.streams.pojo.json.*; import org.apache.streams.verbs.*;
[ "com.google.common", "java.util", "org.apache.streams" ]
com.google.common; java.util; org.apache.streams;
1,940,316
static boolean isNumericResult(Node n) { return allResultsMatch(n, NUMBERIC_RESULT_PREDICATE); }
static boolean isNumericResult(Node n) { return allResultsMatch(n, NUMBERIC_RESULT_PREDICATE); }
/** * Returns true if the result of node evaluation is always a number */
Returns true if the result of node evaluation is always a number
isNumericResult
{ "repo_name": "PengXing/closure-compiler", "path": "src/com/google/javascript/jscomp/NodeUtil.java", "license": "apache-2.0", "size": 99223 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
2,825,299
@SuppressWarnings({ "unchecked", "rawtypes" }) public org.grails.datastore.mapping.query.api.Criteria eqAll(String propertyName, Closure<?> propertyValue) { return eqAll(propertyName, new DetachedCriteria(targetClass).build(propertyValue)); }
@SuppressWarnings({ STR, STR }) org.grails.datastore.mapping.query.api.Criteria function(String propertyName, Closure<?> propertyValue) { return eqAll(propertyName, new DetachedCriteria(targetClass).build(propertyValue)); }
/** * Creates a subquery criterion that ensures the given property is equal to all the given returned values * * @param propertyName The property name * @param propertyValue The property value * @return A Criterion instance */
Creates a subquery criterion that ensures the given property is equal to all the given returned values
eqAll
{ "repo_name": "erdi/grails-core", "path": "grails-hibernate/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java", "license": "apache-2.0", "size": 75516 }
[ "groovy.lang.Closure", "org.hibernate.Criteria" ]
import groovy.lang.Closure; import org.hibernate.Criteria;
import groovy.lang.*; import org.hibernate.*;
[ "groovy.lang", "org.hibernate" ]
groovy.lang; org.hibernate;
734,175
public static refSIDType fromPerUnaligned(byte[] encodedBytes) { refSIDType result = new refSIDType(); result.decodePerUnaligned(new BitStreamReader(encodedBytes)); return result; }
static refSIDType function(byte[] encodedBytes) { refSIDType result = new refSIDType(); result.decodePerUnaligned(new BitStreamReader(encodedBytes)); return result; }
/** * Creates a new refSIDType from encoded stream. */
Creates a new refSIDType from encoded stream
fromPerUnaligned
{ "repo_name": "google/supl-client", "path": "src/main/java/com/google/location/suplclient/asn1/supl2/ulp_components/CdmaCellInformation.java", "license": "apache-2.0", "size": 34169 }
[ "com.google.location.suplclient.asn1.base.BitStreamReader" ]
import com.google.location.suplclient.asn1.base.BitStreamReader;
import com.google.location.suplclient.asn1.base.*;
[ "com.google.location" ]
com.google.location;
322,672
public void deleteAccount(Account account, Connection con);
void function(Account account, Connection con);
/** * Overloading method, does the same as deleteAccount(account) but uses specified * connection, useful for using this method as a part of a transaction. * * @param account * Account object with specified id. Passing null reference causes Illegal * Argument Exception. * @param con * Passed sql connection, if using this method as a part of a transaction, * autocommit should be set to false. */
Overloading method, does the same as deleteAccount(account) but uses specified connection, useful for using this method as a part of a transaction
deleteAccount
{ "repo_name": "MarekVan/pv168", "path": "src/main/java/pv168/AccountManager.java", "license": "mit", "size": 4884 }
[ "java.sql.Connection" ]
import java.sql.Connection;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,110,095
ListenableFuture<Boolean> tryInvalidateTransaction(long startTimeStamp); } // ---------------------------------------------------------------------------------------------------------------- // Helper classes // ---------------------------------------------------------------------------------------------------------------- class CommitTimestamp { public enum Location { NOT_PRESENT, CACHE, COMMIT_TABLE, SHADOW_CELL } private final Location location; private final long value; private final boolean isValid; public CommitTimestamp(Location location, long value, boolean isValid) { this.location = location; this.value = value; this.isValid = isValid; }
ListenableFuture<Boolean> tryInvalidateTransaction(long startTimeStamp); } class CommitTimestamp { public enum Location { NOT_PRESENT, CACHE, COMMIT_TABLE, SHADOW_CELL } private final Location location; private final long value; private final boolean isValid; public CommitTimestamp(Location location, long value, boolean isValid) { this.location = location; this.value = value; this.isValid = isValid; }
/** * Atomically tries to invalidate a non-committed transaction launched by a previous TSO server. * * @param startTimeStamp the transaction to invalidate * @return true on success and false on failure */
Atomically tries to invalidate a non-committed transaction launched by a previous TSO server
tryInvalidateTransaction
{ "repo_name": "yonigottesman/incubator-omid", "path": "commit-table/src/main/java/org/apache/omid/committable/CommitTable.java", "license": "apache-2.0", "size": 3979 }
[ "com.google.common.util.concurrent.ListenableFuture" ]
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.*;
[ "com.google.common" ]
com.google.common;
2,684,331
@ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux<PrivateCloudInner> listByResourceGroupAsync(String resourceGroupName, Context context) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); }
@ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<PrivateCloudInner> function(String resourceGroupName, Context context) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listNextSinglePageAsync(nextLink, context)); }
/** * List private clouds in a resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a paged list of private clouds. */
List private clouds in a resource group
listByResourceGroupAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/PrivateCloudsClientImpl.java", "license": "mit", "size": 106842 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedFlux", "com.azure.core.util.Context", "com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.core.util.Context; import com.azure.resourcemanager.avs.fluent.models.PrivateCloudInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.avs.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,926,051
public final Property<Collection<HistoricalTimeSeriesFieldAdjustmentMap>> fieldAdjustmentMaps() { return metaBean().fieldAdjustmentMaps().createProperty(this); }
final Property<Collection<HistoricalTimeSeriesFieldAdjustmentMap>> function() { return metaBean().fieldAdjustmentMaps().createProperty(this); }
/** * Gets the the {@code fieldAdjustmentMaps} property. * @return the property, not null */
Gets the the fieldAdjustmentMaps property
fieldAdjustmentMaps
{ "repo_name": "McLeodMoores/starling", "path": "projects/financial/src/main/java/com/opengamma/financial/spring/FieldMappingHistoricalTimeSeriesResolverFactoryBean.java", "license": "apache-2.0", "size": 12715 }
[ "com.opengamma.master.historicaltimeseries.impl.HistoricalTimeSeriesFieldAdjustmentMap", "java.util.Collection", "org.joda.beans.Property" ]
import com.opengamma.master.historicaltimeseries.impl.HistoricalTimeSeriesFieldAdjustmentMap; import java.util.Collection; import org.joda.beans.Property;
import com.opengamma.master.historicaltimeseries.impl.*; import java.util.*; import org.joda.beans.*;
[ "com.opengamma.master", "java.util", "org.joda.beans" ]
com.opengamma.master; java.util; org.joda.beans;
2,895,960
TransactionPendingAckInternalStats getPendingAckInternalStats(String topic, String subName, boolean metadata) throws PulsarAdminException;
TransactionPendingAckInternalStats getPendingAckInternalStats(String topic, String subName, boolean metadata) throws PulsarAdminException;
/** * Get pending ack internal stats. * * @param topic the topic of get pending ack internal stats * @param subName the subscription name of this pending ack * @param metadata whether to obtain ledger metadata * * @return the internal stats of pending ack */
Get pending ack internal stats
getPendingAckInternalStats
{ "repo_name": "massakam/pulsar", "path": "pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Transactions.java", "license": "apache-2.0", "size": 9907 }
[ "org.apache.pulsar.common.policies.data.TransactionPendingAckInternalStats" ]
import org.apache.pulsar.common.policies.data.TransactionPendingAckInternalStats;
import org.apache.pulsar.common.policies.data.*;
[ "org.apache.pulsar" ]
org.apache.pulsar;
136,836
@RequestMapping(value = "/rest/models/{modelId}", method = RequestMethod.GET, produces = "application/json") public ModelRepresentation getModel(@PathVariable String modelId) { return modelService.getModelRepresentation(modelId); }
@RequestMapping(value = STR, method = RequestMethod.GET, produces = STR) ModelRepresentation function(@PathVariable String modelId) { return modelService.getModelRepresentation(modelId); }
/** * GET /rest/models/{modelId} -> Get process model */
GET /rest/models/{modelId} -> Get process model
getModel
{ "repo_name": "marcus-nl/flowable-engine", "path": "modules/flowable-ui-modeler/flowable-ui-modeler-rest/src/main/java/org/flowable/app/rest/editor/ModelResource.java", "license": "apache-2.0", "size": 13609 }
[ "org.flowable.app.model.editor.ModelRepresentation", "org.springframework.web.bind.annotation.PathVariable", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod" ]
import org.flowable.app.model.editor.ModelRepresentation; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;
import org.flowable.app.model.editor.*; import org.springframework.web.bind.annotation.*;
[ "org.flowable.app", "org.springframework.web" ]
org.flowable.app; org.springframework.web;
1,018,988
@Override synchronized X500PrivateCredential getPrivateCredential(X509Certificate cert) { return getPrivateCredential(cert, getAuthenticationPermission(cert)); }
synchronized X500PrivateCredential getPrivateCredential(X509Certificate cert) { return getPrivateCredential(cert, getAuthenticationPermission(cert)); }
/** * Gets the private credential for the specified X.509 certificate, * checking for AuthenticationPermission to connect with the last server * principal. * * @param cert the certificate for the local principal * @return the associated private credential or null if not found * @throws SecurityException if the access control context does not have * the proper AuthenticationPermission */
Gets the private credential for the specified X.509 certificate, checking for AuthenticationPermission to connect with the last server principal
getPrivateCredential
{ "repo_name": "pfirmstone/JGDMS", "path": "JGDMS/jgdms-rmi-tls/src/main/java/au/net/zeus/rmi/tls/ClientSubjectKeyManager.java", "license": "apache-2.0", "size": 9363 }
[ "java.security.cert.X509Certificate", "javax.security.auth.x500.X500PrivateCredential" ]
import java.security.cert.X509Certificate; import javax.security.auth.x500.X500PrivateCredential;
import java.security.cert.*; import javax.security.auth.x500.*;
[ "java.security", "javax.security" ]
java.security; javax.security;
1,643,969
// TODO: (multi-display) Make sure this works for multiple displays. boolean getAccessibilityFocusClickPointInScreen(Point outPoint) { return getInteractionBridgeLocked() .getAccessibilityFocusClickPointInScreenNotLocked(outPoint); }
boolean getAccessibilityFocusClickPointInScreen(Point outPoint) { return getInteractionBridgeLocked() .getAccessibilityFocusClickPointInScreenNotLocked(outPoint); }
/** * Gets a point within the accessibility focused node where we can send down * and up events to perform a click. * * @param outPoint The click point to populate. * @return Whether accessibility a click point was found and set. */
Gets a point within the accessibility focused node where we can send down and up events to perform a click
getAccessibilityFocusClickPointInScreen
{ "repo_name": "Ant-Droid/android_frameworks_base_OLD", "path": "services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java", "license": "apache-2.0", "size": 177563 }
[ "android.graphics.Point" ]
import android.graphics.Point;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
2,114,419
public void recover() throws IOException;
void function() throws IOException;
/** * Recover data that is not in ERROR state assuming that data transmission has * failed. This is called to recover durable data and retry sends after a * crash. */
Recover data that is not in ERROR state assuming that data transmission has failed. This is called to recover durable data and retry sends after a crash
recover
{ "repo_name": "anuragphadke/Flume-Hive", "path": "src/java/com/cloudera/flume/agent/diskfailover/DiskFailoverManager.java", "license": "apache-2.0", "size": 4970 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
36,308
private boolean Local_Add(Object key, ExpirationHint hint, OperationContext operationContext) throws OperationFailedException, LockingException, GeneralFailureException, CacheException { boolean retVal = false; if (_internalCache != null) { CacheEntry cacheEntry = new CacheEntry(); cacheEntry.setExpirationHint(hint); try { retVal = _internalCache.Add(key, hint, operationContext); } catch (Exception e) { throw new OperationFailedException(e); } } return retVal; }
boolean function(Object key, ExpirationHint hint, OperationContext operationContext) throws OperationFailedException, LockingException, GeneralFailureException, CacheException { boolean retVal = false; if (_internalCache != null) { CacheEntry cacheEntry = new CacheEntry(); cacheEntry.setExpirationHint(hint); try { retVal = _internalCache.Add(key, hint, operationContext); } catch (Exception e) { throw new OperationFailedException(e); } } return retVal; }
/** * Add the ExpirationHint against the given key * * @param key * @param hint * @return */
Add the ExpirationHint against the given key
Local_Add
{ "repo_name": "joseananio/TayzGrid", "path": "src/tgcache/src/com/alachisoft/tayzgrid/caching/topologies/clustered/ReplicatedServerCache.java", "license": "apache-2.0", "size": 207161 }
[ "com.alachisoft.tayzgrid.caching.CacheEntry", "com.alachisoft.tayzgrid.caching.OperationContext", "com.alachisoft.tayzgrid.caching.autoexpiration.ExpirationHint", "com.alachisoft.tayzgrid.runtime.exceptions.CacheException", "com.alachisoft.tayzgrid.runtime.exceptions.GeneralFailureException", "com.alachis...
import com.alachisoft.tayzgrid.caching.CacheEntry; import com.alachisoft.tayzgrid.caching.OperationContext; import com.alachisoft.tayzgrid.caching.autoexpiration.ExpirationHint; import com.alachisoft.tayzgrid.runtime.exceptions.CacheException; import com.alachisoft.tayzgrid.runtime.exceptions.GeneralFailureException; import com.alachisoft.tayzgrid.runtime.exceptions.LockingException; import com.alachisoft.tayzgrid.runtime.exceptions.OperationFailedException;
import com.alachisoft.tayzgrid.caching.*; import com.alachisoft.tayzgrid.caching.autoexpiration.*; import com.alachisoft.tayzgrid.runtime.exceptions.*;
[ "com.alachisoft.tayzgrid" ]
com.alachisoft.tayzgrid;
2,830,461
return new BCryptPasswordEncoder(); }
return new BCryptPasswordEncoder(); }
/** * Password Encoder. * @return Password Encoder */
Password Encoder
passwordEncoder
{ "repo_name": "mathieuaime/computer-database", "path": "computerDatabase-service/src/main/java/com/excilys/computerdatabase/config/spring/ServiceConfig.java", "license": "apache-2.0", "size": 1787 }
[ "org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder" ]
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.bcrypt.*;
[ "org.springframework.security" ]
org.springframework.security;
2,496,805
private static Map<String, LanguageCache> initializeLanguages(ClassLoader loader) { Map<String, LanguageCache> map = createLanguages(loader); for (LanguageCache info : map.values()) { info.createLanguage(loader); } return map; } private LanguageCache(String prefix, Properties info, TruffleLanguage<?> language) { this.className = info.getProperty(prefix + "className"); this.name = info.getProperty(prefix + "name"); this.version = info.getProperty(prefix + "version"); TreeSet<String> ts = new TreeSet<>(); for (int i = 0;; i++) { String mt = info.getProperty(prefix + "mimeType." + i); if (mt == null) { break; } ts.add(mt); } this.mimeTypes = Collections.unmodifiableSet(ts); this.language = language; }
static Map<String, LanguageCache> function(ClassLoader loader) { Map<String, LanguageCache> map = createLanguages(loader); for (LanguageCache info : map.values()) { info.createLanguage(loader); } return map; } private LanguageCache(String prefix, Properties info, TruffleLanguage<?> language) { this.className = info.getProperty(prefix + STR); this.name = info.getProperty(prefix + "name"); this.version = info.getProperty(prefix + STR); TreeSet<String> ts = new TreeSet<>(); for (int i = 0;; i++) { String mt = info.getProperty(prefix + STR + i); if (mt == null) { break; } ts.add(mt); } this.mimeTypes = Collections.unmodifiableSet(ts); this.language = language; }
/** * This method initializes all languages under the provided classloader. * * NOTE: Method's signature should not be changed as it is reflectively invoked from AOT * compilation. * * @param loader The classloader to be used for finding languages. * @return A map of initialized languages. */
This method initializes all languages under the provided classloader. compilation
initializeLanguages
{ "repo_name": "chumer/truffle", "path": "truffle/com.oracle.truffle.api.vm/src/com/oracle/truffle/api/vm/LanguageCache.java", "license": "gpl-2.0", "size": 6216 }
[ "com.oracle.truffle.api.TruffleLanguage", "java.util.Collections", "java.util.Map", "java.util.Properties", "java.util.TreeSet" ]
import com.oracle.truffle.api.TruffleLanguage; import java.util.Collections; import java.util.Map; import java.util.Properties; import java.util.TreeSet;
import com.oracle.truffle.api.*; import java.util.*;
[ "com.oracle.truffle", "java.util" ]
com.oracle.truffle; java.util;
648,144
public static boolean isObjectDeletionSupported() { return SimulatorSystem.instance().isObjectDeletionSupported(); }
static boolean function() { return SimulatorSystem.instance().isObjectDeletionSupported(); }
/** * This method is used to determine if the implementation for the Java Card platform supports * the object deletion mechanism. * @return <CODE>true</CODE> if the object deletion mechanism is supported, <CODE>false</CODE> otherwise */
This method is used to determine if the implementation for the Java Card platform supports the object deletion mechanism
isObjectDeletionSupported
{ "repo_name": "nversbra/SIC", "path": "Resources/misc/jcardsim/src/main/java/com/licel/jcardsim/framework/JCSystemProxy.java", "license": "mit", "size": 21383 }
[ "com.licel.jcardsim.base.SimulatorSystem" ]
import com.licel.jcardsim.base.SimulatorSystem;
import com.licel.jcardsim.base.*;
[ "com.licel.jcardsim" ]
com.licel.jcardsim;
2,616,568
protected Pageable getPageable() { return mDocument; }
Pageable function() { return mDocument; }
/** * Return the Pageable describing the pages to be printed. */
Return the Pageable describing the pages to be printed
getPageable
{ "repo_name": "isaacl/openjdk-jdk", "path": "src/share/classes/sun/print/RasterPrinterJob.java", "license": "gpl-2.0", "size": 89310 }
[ "java.awt.print.Pageable" ]
import java.awt.print.Pageable;
import java.awt.print.*;
[ "java.awt" ]
java.awt;
2,807,565
public String getTaskRole() { return getStringItem(pstFile.getNameToIdMapItem(0x00008127, PSTSource.PSETID_Task)); }
String function() { return getStringItem(pstFile.getNameToIdMapItem(0x00008127, PSTSource.PSETID_Task)); }
/** * Role ASCII or Unicode string */
Role ASCII or Unicode string
getTaskRole
{ "repo_name": "casimirenslip/java-libpst", "path": "com/pff/objects/PSTTask.java", "license": "apache-2.0", "size": 6275 }
[ "com.pff.source.PSTSource" ]
import com.pff.source.PSTSource;
import com.pff.source.*;
[ "com.pff.source" ]
com.pff.source;
3,979
Status getStatus();
Status getStatus();
/** * Returns the status passed to {@link StreamTracer#streamClosed}. */
Returns the status passed to <code>StreamTracer#streamClosed</code>
getStatus
{ "repo_name": "rmichela/grpc-java", "path": "testing/src/main/java/io/grpc/internal/testing/TestStreamTracer.java", "license": "apache-2.0", "size": 5911 }
[ "io.grpc.Status" ]
import io.grpc.Status;
import io.grpc.*;
[ "io.grpc" ]
io.grpc;
1,847,039
private Map<TopicPartition, List<ConsumerRecord<K, V>>> pollOnce(long timeout) { client.maybeTriggerWakeup(); coordinator.poll(time.milliseconds(), timeout); // fetch positions if we have partitions we're subscribed to that we // don't know the offset for if (!subscriptions.hasAllFetchPositions()) updateFetchPositions(this.subscriptions.missingFetchPositions()); // if data is available already, return it immediately Map<TopicPartition, List<ConsumerRecord<K, V>>> records = fetcher.fetchedRecords(); if (!records.isEmpty()) return records; // send any new fetches (won't resend pending fetches) fetcher.sendFetches(); long now = time.milliseconds(); long pollTimeout = Math.min(coordinator.timeToNextPoll(now), timeout);
Map<TopicPartition, List<ConsumerRecord<K, V>>> function(long timeout) { client.maybeTriggerWakeup(); coordinator.poll(time.milliseconds(), timeout); if (!subscriptions.hasAllFetchPositions()) updateFetchPositions(this.subscriptions.missingFetchPositions()); Map<TopicPartition, List<ConsumerRecord<K, V>>> records = fetcher.fetchedRecords(); if (!records.isEmpty()) return records; fetcher.sendFetches(); long now = time.milliseconds(); long pollTimeout = Math.min(coordinator.timeToNextPoll(now), timeout);
/** * Do one round of polling. In addition to checking for new data, this does any needed offset commits * (if auto-commit is enabled), and offset resets (if an offset reset policy is defined). * @param timeout The maximum time to block in the underlying call to {@link ConsumerNetworkClient#poll(long)}. * @return The fetched records (may be empty) */
Do one round of polling. In addition to checking for new data, this does any needed offset commits (if auto-commit is enabled), and offset resets (if an offset reset policy is defined)
pollOnce
{ "repo_name": "MyPureCloud/kafka", "path": "clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java", "license": "apache-2.0", "size": 103038 }
[ "java.util.List", "java.util.Map", "org.apache.kafka.common.TopicPartition" ]
import java.util.List; import java.util.Map; import org.apache.kafka.common.TopicPartition;
import java.util.*; import org.apache.kafka.common.*;
[ "java.util", "org.apache.kafka" ]
java.util; org.apache.kafka;
1,098,706
public void validateTeams(List<StudentAttributes> studentList, String courseId) throws EnrollException { Assumption.assertNotNull(studentList); Assumption.assertNotNull(courseId); studentsLogic.validateTeams(studentList, courseId); }
void function(List<StudentAttributes> studentList, String courseId) throws EnrollException { Assumption.assertNotNull(studentList); Assumption.assertNotNull(courseId); studentsLogic.validateTeams(studentList, courseId); }
/** * Validates teams for any team name violations. * * <p>Preconditions: <br> * * All parameters are non-null. * * @see StudentsLogic#validateTeams(List, String) */
Validates teams for any team name violations. Preconditions: All parameters are non-null
validateTeams
{ "repo_name": "Mynk96/teammates", "path": "src/main/java/teammates/logic/api/Logic.java", "license": "gpl-2.0", "size": 86976 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,721,141
public Collection<Faction> findAll();
Collection<Faction> function();
/** * Returns all exists factions */
Returns all exists factions
findAll
{ "repo_name": "Mararok/EpicWar", "path": "src/main/com/mararok/epicwar/faction/FactionManager.java", "license": "mit", "size": 1374 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,875,571
ResultTO process(OperationTO operation) throws CalculationException;
ResultTO process(OperationTO operation) throws CalculationException;
/** * Process an operation and return the computed result * * @param operation The operation to process * @return The result * @throws CalculationException When processing the operation is not possible */
Process an operation and return the computed result
process
{ "repo_name": "probedock/probedock-demo-arquillian", "path": "src/main/java/io/probedock/demo/arquillian/service/CalculatorService.java", "license": "mit", "size": 624 }
[ "io.probedock.demo.arquillian.to.OperationTO", "io.probedock.demo.arquillian.to.ResultTO" ]
import io.probedock.demo.arquillian.to.OperationTO; import io.probedock.demo.arquillian.to.ResultTO;
import io.probedock.demo.arquillian.to.*;
[ "io.probedock.demo" ]
io.probedock.demo;
2,313,135
private synchronized void sendNotification(Notification notification) { // loop on listener // for(java.util.Enumeration<NotificationListener> k = handbackTable.keys(); k.hasMoreElements(); ) { NotificationListener listener = k.nextElement(); // Get the associated handback list and the associated filter list // java.util.Vector<?> handbackList = handbackTable.get(listener) ; java.util.Vector<NotificationFilter> filterList = filterTable.get(listener) ; // loop on handback // java.util.Enumeration<NotificationFilter> f = filterList.elements(); for(java.util.Enumeration<?> h = handbackList.elements(); h.hasMoreElements(); ) { Object handback = h.nextElement(); NotificationFilter filter = f.nextElement(); if ((filter == null) || (filter.isNotificationEnabled(notification))) { listener.handleNotification(notification,handback) ; } } } }
synchronized void function(Notification notification) { k.hasMoreElements(); ) { NotificationListener listener = k.nextElement(); java.util.Vector<NotificationFilter> filterList = filterTable.get(listener) ; for(java.util.Enumeration<?> h = handbackList.elements(); h.hasMoreElements(); ) { Object handback = h.nextElement(); NotificationFilter filter = f.nextElement(); if ((filter == null) (filter.isNotificationEnabled(notification))) { listener.handleNotification(notification,handback) ; } } } }
/** * Enable this <CODE>SnmpMibTable</CODE> to send a notification. * * <p> * @param notification The notification to send. */
Enable this <code>SnmpMibTable</code> to send a notification.
sendNotification
{ "repo_name": "shun634501730/java_source_cn", "path": "src_en/com/sun/jmx/snmp/agent/SnmpMibTable.java", "license": "apache-2.0", "size": 98621 }
[ "java.util.Enumeration", "java.util.Vector", "javax.management.Notification", "javax.management.NotificationFilter", "javax.management.NotificationListener" ]
import java.util.Enumeration; import java.util.Vector; import javax.management.Notification; import javax.management.NotificationFilter; import javax.management.NotificationListener;
import java.util.*; import javax.management.*;
[ "java.util", "javax.management" ]
java.util; javax.management;
2,716,533
@SuppressWarnings("unchecked") public Map<String, Integer> getCountByAuthor() { if (m_countByAuthor == null) { m_countByAuthor = LazyMap.decorate(new HashMap<String, Integer>(), new Transformer() {
@SuppressWarnings(STR) Map<String, Integer> function() { if (m_countByAuthor == null) { m_countByAuthor = LazyMap.decorate(new HashMap<String, Integer>(), new Transformer() {
/** * Returns the number of comments a given author has written.<p> * * To use this method you have to define a field called {@link CmsCommentFormHandler#FIELD_USERNAME}.<p> * * @return a map where the key is the author name and the value the number of comments */
Returns the number of comments a given author has written. To use this method you have to define a field called <code>CmsCommentFormHandler#FIELD_USERNAME</code>
getCountByAuthor
{ "repo_name": "alkacon/alkacon-oamp", "path": "com.alkacon.opencms.v8.comments/src/com/alkacon/opencms/v8/comments/CmsCommentsAccess.java", "license": "gpl-3.0", "size": 38622 }
[ "java.util.HashMap", "java.util.Map", "org.apache.commons.collections.Transformer", "org.apache.commons.collections.map.LazyMap" ]
import java.util.HashMap; import java.util.Map; import org.apache.commons.collections.Transformer; import org.apache.commons.collections.map.LazyMap;
import java.util.*; import org.apache.commons.collections.*; import org.apache.commons.collections.map.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
2,617,032
public CompletableFuture<Void> clearBacklog() { log.info("[{}] Clearing backlog on all cursors in the topic.", topic); List<CompletableFuture<Void>> futures = Lists.newArrayList(); List<String> cursors = getSubscriptions().keys(); cursors.addAll(getReplicators().keys()); for (String cursor : cursors) { futures.add(clearBacklog(cursor)); } return FutureUtil.waitForAll(futures); }
CompletableFuture<Void> function() { log.info(STR, topic); List<CompletableFuture<Void>> futures = Lists.newArrayList(); List<String> cursors = getSubscriptions().keys(); cursors.addAll(getReplicators().keys()); for (String cursor : cursors) { futures.add(clearBacklog(cursor)); } return FutureUtil.waitForAll(futures); }
/** * Clears backlog for all cursors in the topic * * @return */
Clears backlog for all cursors in the topic
clearBacklog
{ "repo_name": "rdhabalia/pulsar", "path": "pulsar-broker/src/main/java/com/yahoo/pulsar/broker/service/persistent/PersistentTopic.java", "license": "apache-2.0", "size": 50314 }
[ "com.beust.jcommander.internal.Lists", "com.yahoo.pulsar.client.util.FutureUtil", "java.util.List", "java.util.concurrent.CompletableFuture" ]
import com.beust.jcommander.internal.Lists; import com.yahoo.pulsar.client.util.FutureUtil; import java.util.List; import java.util.concurrent.CompletableFuture;
import com.beust.jcommander.internal.*; import com.yahoo.pulsar.client.util.*; import java.util.*; import java.util.concurrent.*;
[ "com.beust.jcommander", "com.yahoo.pulsar", "java.util" ]
com.beust.jcommander; com.yahoo.pulsar; java.util;
1,177,035
protected boolean isLandscape() { return (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE); }
boolean function() { return (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE); }
/** * Returns true if current orientation is LANDSCAPE, false otherwise. * @return */
Returns true if current orientation is LANDSCAPE, false otherwise
isLandscape
{ "repo_name": "KirillMakarov/edx-app-android", "path": "VideoLocker/src/main/java/org/edx/mobile/view/MyRecentVideosFragment.java", "license": "apache-2.0", "size": 28768 }
[ "android.content.res.Configuration" ]
import android.content.res.Configuration;
import android.content.res.*;
[ "android.content" ]
android.content;
731,647
default ConsulEndpointProducerBuilder readTimeout(Duration readTimeout) { doSetProperty("readTimeout", readTimeout); return this; }
default ConsulEndpointProducerBuilder readTimeout(Duration readTimeout) { doSetProperty(STR, readTimeout); return this; }
/** * Read timeout for OkHttpClient. * * The option is a: <code>java.time.Duration</code> type. * * Group: common */
Read timeout for OkHttpClient. The option is a: <code>java.time.Duration</code> type. Group: common
readTimeout
{ "repo_name": "adessaigne/camel", "path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ConsulEndpointBuilderFactory.java", "license": "apache-2.0", "size": 59906 }
[ "java.time.Duration" ]
import java.time.Duration;
import java.time.*;
[ "java.time" ]
java.time;
526,615
@Override public void chart(Variable var, boolean showIt) { chartCreate(var, showIt); }
void function(Variable var, boolean showIt) { chartCreate(var, showIt); }
/** * Create a chart showing each linguistic term * @param showIt : If true, plot is displayed */
Create a chart showing each linguistic term
chart
{ "repo_name": "pcingola/jFuzzyLogic", "path": "src/net/sourceforge/jFuzzyLogic/plot/JFuzzyChartImpl.java", "license": "lgpl-3.0", "size": 11293 }
[ "net.sourceforge.jFuzzyLogic.rule.Variable" ]
import net.sourceforge.jFuzzyLogic.rule.Variable;
import net.sourceforge.*;
[ "net.sourceforge" ]
net.sourceforge;
2,238,455
public void unregisterCache(GridCacheContextInfo cacheInfo, boolean rmvIdx) throws IgniteCheckedException;
void function(GridCacheContextInfo cacheInfo, boolean rmvIdx) throws IgniteCheckedException;
/** * Unregisters cache. * * @param cacheInfo Cache context info. * @param rmvIdx If {@code true}, will remove index. * @throws IgniteCheckedException If failed to drop cache schema. */
Unregisters cache
unregisterCache
{ "repo_name": "ascherbakoff/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java", "license": "apache-2.0", "size": 16897 }
[ "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.internal.processors.cache.GridCacheContextInfo" ]
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.processors.cache.GridCacheContextInfo;
import org.apache.ignite.*; import org.apache.ignite.internal.processors.cache.*;
[ "org.apache.ignite" ]
org.apache.ignite;
783,372
@Authorized( { PrivilegeConstants.ADD_PATIENT_PROGRAMS, PrivilegeConstants.EDIT_PATIENT_PROGRAMS }) public PatientProgram savePatientProgram(PatientProgram patientProgram) throws APIException;
@Authorized( { PrivilegeConstants.ADD_PATIENT_PROGRAMS, PrivilegeConstants.EDIT_PATIENT_PROGRAMS }) PatientProgram function(PatientProgram patientProgram) throws APIException;
/** * Save patientProgram to database (create if new or update if changed) * * @param patientProgram is the PatientProgram to be saved to the database * @return PatientProgram - the saved PatientProgram * @throws APIException * @should update patient program * @should save patient program successfully * @should return patient program with assigned patient program id */
Save patientProgram to database (create if new or update if changed)
savePatientProgram
{ "repo_name": "shiangree/openmrs-core", "path": "api/src/main/java/org/openmrs/api/ProgramWorkflowService.java", "license": "mpl-2.0", "size": 43017 }
[ "org.openmrs.PatientProgram", "org.openmrs.annotation.Authorized", "org.openmrs.util.PrivilegeConstants" ]
import org.openmrs.PatientProgram; import org.openmrs.annotation.Authorized; import org.openmrs.util.PrivilegeConstants;
import org.openmrs.*; import org.openmrs.annotation.*; import org.openmrs.util.*;
[ "org.openmrs", "org.openmrs.annotation", "org.openmrs.util" ]
org.openmrs; org.openmrs.annotation; org.openmrs.util;
1,991,641
public static RegistrationRequest fromJson(String jsonString) throws JsonException { // If we could, we'd just get Json to coerce this for us, but that would lead to endless // recursion as the first thing it would do would be to call this very method. *sigh* Json json = new Json(); Map<String, Object> raw = json.toType(jsonString, MAP_TYPE); RegistrationRequest request = new RegistrationRequest(); if (raw.get("name") instanceof String) { request.name = (String) raw.get("name"); } if (raw.get("description") instanceof String) { request.description = (String) raw.get("description"); } if (raw.get("configuration") instanceof Map) { // This is nasty. Look away now! String converted = json.toJson(raw.get("configuration")); request.configuration = GridConfiguredJson.toType(converted, GridNodeConfiguration.class); } return request; }
static RegistrationRequest function(String jsonString) throws JsonException { Json json = new Json(); Map<String, Object> raw = json.toType(jsonString, MAP_TYPE); RegistrationRequest request = new RegistrationRequest(); if (raw.get("name") instanceof String) { request.name = (String) raw.get("name"); } if (raw.get(STR) instanceof String) { request.description = (String) raw.get(STR); } if (raw.get(STR) instanceof Map) { String converted = json.toJson(raw.get(STR)); request.configuration = GridConfiguredJson.toType(converted, GridNodeConfiguration.class); } return request; }
/** * Create an object from a registration request formatted as a json string. * * @param jsonString JSON String * @return */
Create an object from a registration request formatted as a json string
fromJson
{ "repo_name": "mach6/selenium", "path": "java/server/src/org/openqa/grid/common/RegistrationRequest.java", "license": "apache-2.0", "size": 9853 }
[ "java.util.Map", "org.openqa.grid.internal.utils.configuration.GridNodeConfiguration", "org.openqa.selenium.json.Json", "org.openqa.selenium.json.JsonException" ]
import java.util.Map; import org.openqa.grid.internal.utils.configuration.GridNodeConfiguration; import org.openqa.selenium.json.Json; import org.openqa.selenium.json.JsonException;
import java.util.*; import org.openqa.grid.internal.utils.configuration.*; import org.openqa.selenium.json.*;
[ "java.util", "org.openqa.grid", "org.openqa.selenium" ]
java.util; org.openqa.grid; org.openqa.selenium;
2,727,234
public void setFilter(TimeFilter value) { this.filter = value; java.util.Date von = value.getVon(); java.util.Date bis = value.getBis(); jSpinnerStart.setDate(von); jSpinnerEnd.setDate(bis); }
void function(TimeFilter value) { this.filter = value; java.util.Date von = value.getVon(); java.util.Date bis = value.getBis(); jSpinnerStart.setDate(von); jSpinnerEnd.setDate(bis); }
/** * Setter for property filter. * @param filter New value of property filter. */
Setter for property filter
setFilter
{ "repo_name": "BayCEER/goat", "path": "src/main/java/de/unibayreuth/bayeos/goat/filter/JPanelVonBis.java", "license": "gpl-2.0", "size": 3575 }
[ "de.unibayreuth.bayceer.bayeos.xmlrpc.filter.TimeFilter" ]
import de.unibayreuth.bayceer.bayeos.xmlrpc.filter.TimeFilter;
import de.unibayreuth.bayceer.bayeos.xmlrpc.filter.*;
[ "de.unibayreuth.bayceer" ]
de.unibayreuth.bayceer;
411,830
@SuppressWarnings("unchecked") static <E> Comparator<? super E> orNaturalOrder( @Nullable Comparator<? super E> comparator) { if (comparator != null) { // can't use ? : because of javac bug 5080917 return comparator; } return (Comparator<E>) Ordering.natural(); } /** * Returns an immutable map for which the {@link Map#values} are the given * elements in the given order, and each key is the product of invoking a * supplied function on its corresponding value. * * @param values the values to use when constructing the {@code Map}
@SuppressWarnings(STR) static <E> Comparator<? super E> orNaturalOrder( @Nullable Comparator<? super E> comparator) { if (comparator != null) { return comparator; } return (Comparator<E>) Ordering.natural(); } /** * Returns an immutable map for which the {@link Map#values} are the given * elements in the given order, and each key is the product of invoking a * supplied function on its corresponding value. * * @param values the values to use when constructing the {@code Map}
/** * Returns the specified comparator if not null; otherwise returns {@code * Ordering.natural()}. This method is an abomination of generics; the only * purpose of this method is to contain the ugly type-casting in one place. */
Returns the specified comparator if not null; otherwise returns Ordering.natural(). This method is an abomination of generics; the only purpose of this method is to contain the ugly type-casting in one place
orNaturalOrder
{ "repo_name": "mkeesey/guava-for-small-classpaths", "path": "guava/src/com/google/common/collect/Maps.java", "license": "apache-2.0", "size": 92608 }
[ "java.util.Comparator", "java.util.Map", "javax.annotation.Nullable" ]
import java.util.Comparator; import java.util.Map; import javax.annotation.Nullable;
import java.util.*; import javax.annotation.*;
[ "java.util", "javax.annotation" ]
java.util; javax.annotation;
1,003,415
void checkLocationDeleted(final IProject project) throws CoreException { if (!project.exists()) { return; } final IFileInfo location = IDEResourceInfoUtils.getFileInfo(project.getLocationURI()); if (!location.exists()) { final String message = NLS.bind(IDEWorkbenchMessages.RefreshAction_locationDeletedMessage, project.getName(), location.toString());
void checkLocationDeleted(final IProject project) throws CoreException { if (!project.exists()) { return; } final IFileInfo location = IDEResourceInfoUtils.getFileInfo(project.getLocationURI()); if (!location.exists()) { final String message = NLS.bind(IDEWorkbenchMessages.RefreshAction_locationDeletedMessage, project.getName(), location.toString());
/** * Checks whether the given project's location has been deleted. If so, prompts the user with whether to delete the * project or not. */
Checks whether the given project's location has been deleted. If so, prompts the user with whether to delete the project or not
checkLocationDeleted
{ "repo_name": "hqnghi88/gamaClone", "path": "ummisco.gama.ui.navigator/src/ummisco/gama/ui/navigator/actions/RefreshAction.java", "license": "gpl-3.0", "size": 10062 }
[ "org.eclipse.core.filesystem.IFileInfo", "org.eclipse.core.resources.IProject", "org.eclipse.core.runtime.CoreException", "org.eclipse.osgi.util.NLS", "org.eclipse.ui.internal.ide.IDEWorkbenchMessages", "org.eclipse.ui.internal.ide.dialogs.IDEResourceInfoUtils" ]
import org.eclipse.core.filesystem.IFileInfo; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; import org.eclipse.osgi.util.NLS; import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; import org.eclipse.ui.internal.ide.dialogs.IDEResourceInfoUtils;
import org.eclipse.core.filesystem.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.osgi.util.*; import org.eclipse.ui.internal.ide.*; import org.eclipse.ui.internal.ide.dialogs.*;
[ "org.eclipse.core", "org.eclipse.osgi", "org.eclipse.ui" ]
org.eclipse.core; org.eclipse.osgi; org.eclipse.ui;
504,769
@ServiceMethod(returns = ReturnType.SINGLE) Response<DscpConfigurationInner> getByResourceGroupWithResponse( String resourceGroupName, String dscpConfigurationName, Context context);
@ServiceMethod(returns = ReturnType.SINGLE) Response<DscpConfigurationInner> getByResourceGroupWithResponse( String resourceGroupName, String dscpConfigurationName, Context context);
/** * Gets a DSCP Configuration. * * @param resourceGroupName The name of the resource group. * @param dscpConfigurationName The name of the resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a DSCP Configuration along with {@link Response}. */
Gets a DSCP Configuration
getByResourceGroupWithResponse
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/DscpConfigurationsClient.java", "license": "mit", "size": 19988 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.network.fluent.models.DscpConfigurationInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.network.fluent.models.DscpConfigurationInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.network.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,254,190
void setBatchErrorHandler(BatchErrorHandler batchErrorHandler) { this.batchErrorHandler = batchErrorHandler; }
void setBatchErrorHandler(BatchErrorHandler batchErrorHandler) { this.batchErrorHandler = batchErrorHandler; }
/** * Set the {@link BatchErrorHandler} to use. * @param batchErrorHandler the error handler */
Set the <code>BatchErrorHandler</code> to use
setBatchErrorHandler
{ "repo_name": "lburgazzoli/spring-boot", "path": "spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/ConcurrentKafkaListenerContainerFactoryConfigurer.java", "license": "apache-2.0", "size": 6032 }
[ "org.springframework.kafka.listener.BatchErrorHandler" ]
import org.springframework.kafka.listener.BatchErrorHandler;
import org.springframework.kafka.listener.*;
[ "org.springframework.kafka" ]
org.springframework.kafka;
1,208,250
public String[] getValidPaths() { ArrayList<String> pathList = new ArrayList<String>(); for(int i = 0; i<paths.length; i++) { if(!paths[i].equals("")) {//$NON-NLS-1$ pathList.add(paths[i]); } } return pathList.toArray(new String[0]); }
String[] function() { ArrayList<String> pathList = new ArrayList<String>(); for(int i = 0; i<paths.length; i++) { if(!paths[i].equals("")) { pathList.add(paths[i]); } } return pathList.toArray(new String[0]); }
/** * Returns the valid paths (i.e., those that are not ""). * Invalid paths are associated with pasted images rather than files. * * @return the valid paths */
Returns the valid paths (i.e., those that are not ""). Invalid paths are associated with pasted images rather than files
getValidPaths
{ "repo_name": "fschuett/osp", "path": "src/org/opensourcephysics/media/core/ImageVideo.java", "license": "gpl-3.0", "size": 28750 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,442,582
EClass getInsertType();
EClass getInsertType();
/** * Returns the meta object for class '{@link net.opengis.wfs20.InsertType <em>Insert Type</em>}'. * <!-- begin-user-doc --> <!-- end-user-doc --> * @return the meta object for class '<em>Insert Type</em>'. * @see net.opengis.wfs20.InsertType * @generated */
Returns the meta object for class '<code>net.opengis.wfs20.InsertType Insert Type</code>'.
getInsertType
{ "repo_name": "geotools/geotools", "path": "modules/ogc/net.opengis.wfs/src/net/opengis/wfs20/Wfs20Package.java", "license": "lgpl-2.1", "size": 404067 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,181,519
public static boolean hasKitKat() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; }
static boolean function() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; }
/** * Determines whether or not the user has Android 4.4 KitKat * @return true if version code on device is >= kitkat */
Determines whether or not the user has Android 4.4 KitKat
hasKitKat
{ "repo_name": "danielchristopher1/qksms", "path": "QKSMS/src/main/java/com/moez/QKSMS/mmssms/Utils.java", "license": "gpl-3.0", "size": 16511 }
[ "android.os.Build" ]
import android.os.Build;
import android.os.*;
[ "android.os" ]
android.os;
1,385,314
public boolean equalsIgnoreCase(final String compString) { return (Strings.isBlankString(compString)) ? false : compString.equalsIgnoreCase(source_); }
boolean function(final String compString) { return (Strings.isBlankString(compString)) ? false : compString.equalsIgnoreCase(source_); }
/** * Determines if any portion or form of the name object's internal NamePartsMap values are equal to the passed in string. Performs a * case-insensitive check. * * @param string * String tom compare values against * * @return Flag indicating if any of the values are equal to the string. */
Determines if any portion or form of the name object's internal NamePartsMap values are equal to the passed in string. Performs a case-insensitive check
equalsIgnoreCase
{ "repo_name": "OpenNTF/org.openntf.domino", "path": "domino/core/src/main/java/org/openntf/domino/impl/Name.java", "license": "apache-2.0", "size": 26805 }
[ "org.openntf.domino.utils.Strings" ]
import org.openntf.domino.utils.Strings;
import org.openntf.domino.utils.*;
[ "org.openntf.domino" ]
org.openntf.domino;
1,304,432
synchronized void removePropertyChangeListener(PropertyChangeListener listener) { pcs.removePropertyChangeListener(listener); }
synchronized void removePropertyChangeListener(PropertyChangeListener listener) { pcs.removePropertyChangeListener(listener); }
/** * Remove the specified listener. * * @param listener */
Remove the specified listener
removePropertyChangeListener
{ "repo_name": "BorisDaich/iot-java", "path": "src/com/ibm/iotf/devicemgmt/device/DeviceAction.java", "license": "epl-1.0", "size": 3844 }
[ "java.beans.PropertyChangeListener" ]
import java.beans.PropertyChangeListener;
import java.beans.*;
[ "java.beans" ]
java.beans;
2,404,273
protected static void registerItemBlock(Block blockIn, Item itemIn) { registerItem(Block.getIdFromBlock(blockIn), (ResourceLocation)Block.REGISTRY.getNameForObject(blockIn), itemIn); BLOCK_TO_ITEM.put(blockIn, itemIn); }
static void function(Block blockIn, Item itemIn) { registerItem(Block.getIdFromBlock(blockIn), (ResourceLocation)Block.REGISTRY.getNameForObject(blockIn), itemIn); BLOCK_TO_ITEM.put(blockIn, itemIn); }
/** * Register the given Item as the ItemBlock for the given Block. */
Register the given Item as the ItemBlock for the given Block
registerItemBlock
{ "repo_name": "Im-Jrotica/forge_latest", "path": "build/tmp/recompileMc/sources/net/minecraft/item/Item.java", "license": "lgpl-2.1", "size": 82426 }
[ "net.minecraft.block.Block", "net.minecraft.util.ResourceLocation" ]
import net.minecraft.block.Block; import net.minecraft.util.ResourceLocation;
import net.minecraft.block.*; import net.minecraft.util.*;
[ "net.minecraft.block", "net.minecraft.util" ]
net.minecraft.block; net.minecraft.util;
2,820,106
public List<Double> getAngleArray() { return angleArray; }
List<Double> function() { return angleArray; }
/** * Get the angle array. These are the angles between each segment of the line. * @return see above. */
Get the angle array. These are the angles between each segment of the line
getAngleArray
{ "repo_name": "dominikl/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/util/roi/figures/MeasureLineFigure.java", "license": "gpl-2.0", "size": 27230 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,572,177
public static <T> PhTreeMultiMapF<T> create(int dim) { return new PhTreeMultiMapF<>(dim, new PreProcessorPointF.IEEE()); }
static <T> PhTreeMultiMapF<T> function(int dim) { return new PhTreeMultiMapF<>(dim, new PreProcessorPointF.IEEE()); }
/** * Create a new tree with the specified number of dimensions. * * @param dim number of dimensions * @return PhTreeF * @param <T> value type of the tree */
Create a new tree with the specified number of dimensions
create
{ "repo_name": "tzaeschke/phtree", "path": "src/main/java/ch/ethz/globis/phtree/PhTreeMultiMapF.java", "license": "apache-2.0", "size": 22155 }
[ "ch.ethz.globis.phtree.pre.PreProcessorPointF" ]
import ch.ethz.globis.phtree.pre.PreProcessorPointF;
import ch.ethz.globis.phtree.pre.*;
[ "ch.ethz.globis" ]
ch.ethz.globis;
1,009,794
public void freeSingleExecutor(ExecutorDetails exec, TopologyDetails topo) { Map<String, Collection<ExecutorDetails>> usedSlots = topIdToUsedSlots.get(topo.getId()); if (usedSlots == null) { throw new IllegalArgumentException("Topology " + topo + " is not assigned"); } WorkerSlot ws = null; Set<ExecutorDetails> updatedAssignment = new HashSet<>(); for (Entry<String, Collection<ExecutorDetails>> entry : usedSlots.entrySet()) { if (entry.getValue().contains(exec)) { ws = slots.get(entry.getKey()); updatedAssignment.addAll(entry.getValue()); updatedAssignment.remove(exec); break; } } if (ws == null) { throw new IllegalArgumentException( "Executor " + exec + " is not assinged on this node to " + topo); } free(ws); if (!updatedAssignment.isEmpty()) { assign(ws, topo, updatedAssignment); } }
void function(ExecutorDetails exec, TopologyDetails topo) { Map<String, Collection<ExecutorDetails>> usedSlots = topIdToUsedSlots.get(topo.getId()); if (usedSlots == null) { throw new IllegalArgumentException(STR + topo + STR); } WorkerSlot ws = null; Set<ExecutorDetails> updatedAssignment = new HashSet<>(); for (Entry<String, Collection<ExecutorDetails>> entry : usedSlots.entrySet()) { if (entry.getValue().contains(exec)) { ws = slots.get(entry.getKey()); updatedAssignment.addAll(entry.getValue()); updatedAssignment.remove(exec); break; } } if (ws == null) { throw new IllegalArgumentException( STR + exec + STR + topo); } free(ws); if (!updatedAssignment.isEmpty()) { assign(ws, topo, updatedAssignment); } }
/** * frees a single executor. * * @param exec is the executor to free * @param topo the topology the executor is a part of */
frees a single executor
freeSingleExecutor
{ "repo_name": "hmcl/storm-apache", "path": "storm-server/src/main/java/org/apache/storm/scheduler/resource/RasNode.java", "license": "apache-2.0", "size": 16922 }
[ "java.util.Collection", "java.util.HashSet", "java.util.Map", "java.util.Set", "org.apache.storm.scheduler.ExecutorDetails", "org.apache.storm.scheduler.TopologyDetails", "org.apache.storm.scheduler.WorkerSlot" ]
import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.storm.scheduler.ExecutorDetails; import org.apache.storm.scheduler.TopologyDetails; import org.apache.storm.scheduler.WorkerSlot;
import java.util.*; import org.apache.storm.scheduler.*;
[ "java.util", "org.apache.storm" ]
java.util; org.apache.storm;
1,799,286
public List getMaterials() { return materials; }
List function() { return materials; }
/** * Returns the material. * * @return List */
Returns the material
getMaterials
{ "repo_name": "huihoo/olat", "path": "olat7.8/src/main/java/org/olat/lms/ims/qti/objects/Feedback.java", "license": "apache-2.0", "size": 3303 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
233,155
public void autoshrine(final Marker marker, final String message, final Object p0, final Object p1, final Object p2, final Object p3, final Object p4) { logger.logIfEnabled(FQCN, AUTOSHRINE, marker, message, p0, p1, p2, p3, p4); }
void function(final Marker marker, final String message, final Object p0, final Object p1, final Object p2, final Object p3, final Object p4) { logger.logIfEnabled(FQCN, AUTOSHRINE, marker, message, p0, p1, p2, p3, p4); }
/** * Logs a message with parameters at the {@code AUTOSHRINE} level. * * @param marker the marker data specific to this log statement * @param message the message to log; the format depends on the message factory. * @param p0 parameter to the message. * @param p1 parameter to the message. * @param p2 parameter to the message. * @param p3 parameter to the message. * @param p4 parameter to the message. * @see #getMessageFactory() * @since Log4j-2.6 */
Logs a message with parameters at the AUTOSHRINE level
autoshrine
{ "repo_name": "Betalord/BHBot", "path": "src/main/java/BHBotLogger.java", "license": "gpl-3.0", "size": 177002 }
[ "org.apache.logging.log4j.Marker" ]
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.*;
[ "org.apache.logging" ]
org.apache.logging;
1,153,322
FormatPluginConfig createConfigForTable(TableInstance t) { // Per the constructor, the first param is always "type" TableParamDef typeParamDef = t.sig.params.get(0); Object typeParam = t.params.get(0); if (!typeParamDef.name.equals("type") || typeParamDef.type != String.class || !(typeParam instanceof String) || !typeName.equalsIgnoreCase((String)typeParam)) { // if we reach here, there's a bug as all signatures generated start with a type parameter throw UserException.parseError() .message( "This function signature is not supported: %s\n" + "expecting %s", t.presentParams(), this.presentParams()) .addContext("table", t.sig.name) .build(logger); } FormatPluginConfig config; try { config = pluginConfigClass.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw UserException.parseError(e) .message( "configuration for format of type %s can not be created (class: %s)", this.typeName, pluginConfigClass.getName()) .addContext("table", t.sig.name) .build(logger); } for (int i = 1; i < t.params.size(); i++) { Object param = t.params.get(i); if (param == null) { // when null is passed, we leave the default defined in the config class continue; } if (param instanceof String) { // normalize Java literals, ex: \t, \n, \r param = StringEscapeUtils.unescapeJava((String) param); } TableParamDef paramDef = t.sig.params.get(i); TableParamDef expectedParamDef = this.functionParamsByName.get(paramDef.name); if (expectedParamDef == null || expectedParamDef.type != paramDef.type) { throw UserException.parseError() .message( "The parameters provided are not applicable to the type specified:\n" + "provided: %s\nexpected: %s", t.presentParams(), this.presentParams()) .addContext("table", t.sig.name) .build(logger); } try { Field field = pluginConfigClass.getField(paramDef.name); field.setAccessible(true); if (field.getType() == char.class && param instanceof String) { String stringParam = (String) param; if (stringParam.length() != 1) { throw UserException.parseError() .message("Expected single character but was String: %s", stringParam) .addContext("table", t.sig.name) .addContext("parameter", paramDef.name) .build(logger); } param = stringParam.charAt(0); } field.set(config, param); } catch (IllegalAccessException | NoSuchFieldException | SecurityException e) { throw UserException.parseError(e) .message("can not set value %s to parameter %s: %s", param, paramDef.name, paramDef.type) .addContext("table", t.sig.name) .addContext("parameter", paramDef.name) .build(logger); } } return config; }
FormatPluginConfig createConfigForTable(TableInstance t) { TableParamDef typeParamDef = t.sig.params.get(0); Object typeParam = t.params.get(0); if (!typeParamDef.name.equals("type") typeParamDef.type != String.class !(typeParam instanceof String) !typeName.equalsIgnoreCase((String)typeParam)) { throw UserException.parseError() .message( STR + STR, t.presentParams(), this.presentParams()) .addContext("table", t.sig.name) .build(logger); } FormatPluginConfig config; try { config = pluginConfigClass.newInstance(); } catch (InstantiationException IllegalAccessException e) { throw UserException.parseError(e) .message( STR, this.typeName, pluginConfigClass.getName()) .addContext("table", t.sig.name) .build(logger); } for (int i = 1; i < t.params.size(); i++) { Object param = t.params.get(i); if (param == null) { continue; } if (param instanceof String) { param = StringEscapeUtils.unescapeJava((String) param); } TableParamDef paramDef = t.sig.params.get(i); TableParamDef expectedParamDef = this.functionParamsByName.get(paramDef.name); if (expectedParamDef == null expectedParamDef.type != paramDef.type) { throw UserException.parseError() .message( STR + STR, t.presentParams(), this.presentParams()) .addContext("table", t.sig.name) .build(logger); } try { Field field = pluginConfigClass.getField(paramDef.name); field.setAccessible(true); if (field.getType() == char.class && param instanceof String) { String stringParam = (String) param; if (stringParam.length() != 1) { throw UserException.parseError() .message(STR, stringParam) .addContext("table", t.sig.name) .addContext(STR, paramDef.name) .build(logger); } param = stringParam.charAt(0); } field.set(config, param); } catch (IllegalAccessException NoSuchFieldException SecurityException e) { throw UserException.parseError(e) .message(STR, param, paramDef.name, paramDef.type) .addContext("table", t.sig.name) .addContext(STR, paramDef.name) .build(logger); } } return config; }
/** * creates an instance of the FormatPluginConfig based on the passed parameters * @param t the signature and the parameters passed to the table function * @return the corresponding config */
creates an instance of the FormatPluginConfig based on the passed parameters
createConfigForTable
{ "repo_name": "rchallapalli/drill", "path": "exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FormatPluginOptionsDescriptor.java", "license": "apache-2.0", "size": 8072 }
[ "java.lang.reflect.Field", "org.apache.commons.lang3.StringEscapeUtils", "org.apache.drill.common.exceptions.UserException", "org.apache.drill.common.logical.FormatPluginConfig", "org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory" ]
import java.lang.reflect.Field; import org.apache.commons.lang3.StringEscapeUtils; import org.apache.drill.common.exceptions.UserException; import org.apache.drill.common.logical.FormatPluginConfig; import org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory;
import java.lang.reflect.*; import org.apache.commons.lang3.*; import org.apache.drill.common.exceptions.*; import org.apache.drill.common.logical.*; import org.apache.drill.exec.store.dfs.*;
[ "java.lang", "org.apache.commons", "org.apache.drill" ]
java.lang; org.apache.commons; org.apache.drill;
783,508
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, javax.servlet.ServletException { onAuthenticationSuccess(request, response, authentication.getPrincipal().toString()); }
void function(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, javax.servlet.ServletException { onAuthenticationSuccess(request, response, authentication.getPrincipal().toString()); }
/** * Common code done for SAML and DB authentication on successful login * @param request * @param response * @param authentication * @throws IOException * @throws javax.servlet.ServletException */
Common code done for SAML and DB authentication on successful login
onAuthenticationSuccess
{ "repo_name": "nls-oskari/oskari-server", "path": "servlet-map/src/main/java/fi/nls/oskari/spring/security/OskariUserHelper.java", "license": "mit", "size": 4287 }
[ "java.io.IOException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.springframework.security.core.Authentication" ]
import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.core.Authentication;
import java.io.*; import javax.servlet.http.*; import org.springframework.security.core.*;
[ "java.io", "javax.servlet", "org.springframework.security" ]
java.io; javax.servlet; org.springframework.security;
2,105,621
public boolean checkDescriptors (IndexEntry indexEntry) { return checkDescriptors(indexEntry, new LinkedList()); }
boolean function (IndexEntry indexEntry) { return checkDescriptors(indexEntry, new LinkedList()); }
/** Checks whether all descriptors of a subtree are correct. * * @param indexEntry reference to the root node of the subtree * @return true iff the descrptors are correct */
Checks whether all descriptors of a subtree are correct
checkDescriptors
{ "repo_name": "hannoman/xxl", "path": "src/xxl/core/indexStructures/ORTree.java", "license": "lgpl-3.0", "size": 33161 }
[ "java.util.LinkedList" ]
import java.util.LinkedList;
import java.util.*;
[ "java.util" ]
java.util;
1,820,317
//------------------------------------------------------------------------ public ServletContext getServletContext() { return mContext; } //-----------------------------------------------------------------------------
ServletContext function() { return mContext; }
/** * Get the RollerRequest object that is stored in the requeset. * Creates RollerRequest if one not found in mRequest. */
Get the RollerRequest object that is stored in the requeset. Creates RollerRequest if one not found in mRequest
getServletContext
{ "repo_name": "paulnguyen/cmpe279", "path": "eclipse/Roller/src/org/apache/roller/ui/core/RollerRequest.java", "license": "apache-2.0", "size": 29062 }
[ "javax.servlet.ServletContext" ]
import javax.servlet.ServletContext;
import javax.servlet.*;
[ "javax.servlet" ]
javax.servlet;
1,971,432
@SuppressWarnings("unused") private void setBounds(final JSONArray args, final CallbackContext callbackContext) throws JSONException { String id = args.getString(1); GroundOverlay groundOverlay = (GroundOverlay)this.objects.get(id); JSONArray points = args.getJSONArray(2); LatLngBounds bounds = PluginUtil.JSONArray2LatLngBounds(points); groundOverlay.setPositionFromBounds(bounds); this.sendNoResult(callbackContext); }
@SuppressWarnings(STR) void function(final JSONArray args, final CallbackContext callbackContext) throws JSONException { String id = args.getString(1); GroundOverlay groundOverlay = (GroundOverlay)this.objects.get(id); JSONArray points = args.getJSONArray(2); LatLngBounds bounds = PluginUtil.JSONArray2LatLngBounds(points); groundOverlay.setPositionFromBounds(bounds); this.sendNoResult(callbackContext); }
/** * Set bounds * @param args * @param callbackContext * @throws JSONException */
Set bounds
setBounds
{ "repo_name": "otreva/phonegap-googlemaps-plugin", "path": "src/android/plugin/google/maps/PluginGroundOverlay.java", "license": "apache-2.0", "size": 9922 }
[ "com.google.android.gms.maps.model.GroundOverlay", "com.google.android.gms.maps.model.LatLngBounds", "org.apache.cordova.CallbackContext", "org.json.JSONArray", "org.json.JSONException" ]
import com.google.android.gms.maps.model.GroundOverlay; import com.google.android.gms.maps.model.LatLngBounds; import org.apache.cordova.CallbackContext; import org.json.JSONArray; import org.json.JSONException;
import com.google.android.gms.maps.model.*; import org.apache.cordova.*; import org.json.*;
[ "com.google.android", "org.apache.cordova", "org.json" ]
com.google.android; org.apache.cordova; org.json;
747,575
public boolean checkEntry(String archivePath) throws ZipAbortException; } public SignedJarBuilder(OutputStream out, PrivateKey key, X509Certificate certificate) throws IOException, NoSuchAlgorithmException { mOutputJar = new JarOutputStream(out); mOutputJar.setLevel(9); mKey = key; mCertificate = certificate; if (mKey != null && mCertificate != null) { mManifest = new Manifest(); Attributes main = mManifest.getMainAttributes(); main.putValue("Manifest-Version", "1.0"); main.putValue("Created-By", "1.0 (Android)"); mBase64 = new Base64(); mMessageDigest = MessageDigest.getInstance(DIGEST_ALGORITHM); } }
boolean function(String archivePath) throws ZipAbortException; } public SignedJarBuilder(OutputStream out, PrivateKey key, X509Certificate certificate) throws IOException, NoSuchAlgorithmException { mOutputJar = new JarOutputStream(out); mOutputJar.setLevel(9); mKey = key; mCertificate = certificate; if (mKey != null && mCertificate != null) { mManifest = new Manifest(); Attributes main = mManifest.getMainAttributes(); main.putValue(STR, "1.0"); main.putValue(STR, STR); mBase64 = new Base64(); mMessageDigest = MessageDigest.getInstance(DIGEST_ALGORITHM); } }
/** * Checks a file for inclusion in a Jar archive. * @param archivePath the archive file path of the entry * @return <code>true</code> if the file should be included. * @throws ZipAbortException if writing the file should be aborted. */
Checks a file for inclusion in a Jar archive
checkEntry
{ "repo_name": "Orange-OpenSource/ATK", "path": "gui/src/main/java/com/orange/atk/sign/apk/SignedJarBuilder.java", "license": "apache-2.0", "size": 13003 }
[ "java.io.IOException", "java.io.OutputStream", "java.security.MessageDigest", "java.security.NoSuchAlgorithmException", "java.security.PrivateKey", "java.security.cert.X509Certificate", "java.util.jar.Attributes", "java.util.jar.JarOutputStream", "java.util.jar.Manifest", "org.bouncycastle.util.en...
import java.io.IOException; import java.io.OutputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.cert.X509Certificate; import java.util.jar.Attributes; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; import org.bouncycastle.util.encoders.Base64;
import java.io.*; import java.security.*; import java.security.cert.*; import java.util.jar.*; import org.bouncycastle.util.encoders.*;
[ "java.io", "java.security", "java.util", "org.bouncycastle.util" ]
java.io; java.security; java.util; org.bouncycastle.util;
1,902,023
public static Track createFromResultSet( final ResultSet rs ) throws SQLException { final Artist artist = new Artist.Builder() .id(rs.getInt("artistId")) .name(rs.getString("artistName")) .dateAdded(rs.getDate("artistDateAdded")) .build(); final Album album = new Album.Builder() .artist(artist) .id(rs.getInt("albumId")) .name(rs.getString("albumName")) .year(rs.getString("albumYear")) .dateAdded(rs.getDate("albumDateAdded")) .build(); final Genre genre = new Genre( rs.getInt("genreId"), rs.getString("genreName") ); final Builder builder = new Track.Builder(); builder.artist(artist) .album(album) .genre(genre) .id(rs.getInt("trackId")) .name(rs.getString("trackName")) .path(rs.getString("trackPath")) .number(rs.getInt("trackNo")) .dateAdded(rs.getDate("dateAdded")); return builder.build(); }
static Track function( final ResultSet rs ) throws SQLException { final Artist artist = new Artist.Builder() .id(rs.getInt(STR)) .name(rs.getString(STR)) .dateAdded(rs.getDate(STR)) .build(); final Album album = new Album.Builder() .artist(artist) .id(rs.getInt(STR)) .name(rs.getString(STR)) .year(rs.getString(STR)) .dateAdded(rs.getDate(STR)) .build(); final Genre genre = new Genre( rs.getInt(STR), rs.getString(STR) ); final Builder builder = new Track.Builder(); builder.artist(artist) .album(album) .genre(genre) .id(rs.getInt(STR)) .name(rs.getString(STR)) .path(rs.getString(STR)) .number(rs.getInt(STR)) .dateAdded(rs.getDate(STR)); return builder.build(); }
/** * creates a new track from a result set row * * @param rs the result set * @return Track * * @throws SQLException * */
creates a new track from a result set row
createFromResultSet
{ "repo_name": "rodnaph/sockso", "path": "src/com/pugh/sockso/music/Track.java", "license": "gpl-2.0", "size": 14861 }
[ "java.sql.ResultSet", "java.sql.SQLException" ]
import java.sql.ResultSet; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,394,727
public static final Channel getChannel(String channel, TwitchBot bot) { if (!channel.startsWith("#")) channel = "#" + channel; if (channels.containsKey(channel)) return channels.get(channel); else return new Channel(channel, bot); }
static final Channel function(String channel, TwitchBot bot) { if (!channel.startsWith("#")) channel = "#" + channel; if (channels.containsKey(channel)) return channels.get(channel); else return new Channel(channel, bot); }
/** * Get a channel from an existing variable * * @param channel The channel name * @param bot The bot tha use it * @return The channel */
Get a channel from an existing variable
getChannel
{ "repo_name": "CavariuX/TwitchIRC", "path": "src/com/cavariux/twitchirc/Chat/Channel.java", "license": "mit", "size": 13363 }
[ "com.cavariux.twitchirc.Core" ]
import com.cavariux.twitchirc.Core;
import com.cavariux.twitchirc.*;
[ "com.cavariux.twitchirc" ]
com.cavariux.twitchirc;
1,857,227
public URL getURL() { try { if(inArchive) { return new URL("jar:file:"+archive.toFile().getAbsolutePath()+"!/"+path); } else { return toFile().toURI().toURL(); } } catch (MalformedURLException e) { e.printStackTrace(); } return null; }
URL function() { try { if(inArchive) { return new URL(STR+archive.toFile().getAbsolutePath()+"!/"+path); } else { return toFile().toURI().toURL(); } } catch (MalformedURLException e) { e.printStackTrace(); } return null; }
/** * Liefert die URL zur Datei. */
Liefert die URL zur Datei
getURL
{ "repo_name": "jonnius/RWETippspiel", "path": "src/JonFile.java", "license": "gpl-3.0", "size": 20885 }
[ "java.net.MalformedURLException" ]
import java.net.MalformedURLException;
import java.net.*;
[ "java.net" ]
java.net;
2,223,371
public void onSensorChanged(SensorEvent event) { if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) { double strength = 0; for (int i = 0; i < 3; ++i) { strength += event.values[i] * event.values[i]; } strength = Math.sqrt(strength); this.fieldStrength = strength; return; } // We only care about the orientation as far as it refers to Magnetic North float heading = event.values[0]; // Save heading this.timeStamp = System.currentTimeMillis(); this.heading = heading; this.setStatus(CompassListener.RUNNING); // If heading hasn't been read for TIMEOUT time, then turn off compass sensor to save power if ((this.timeStamp - this.lastAccessTime) > this.TIMEOUT) { this.stop(); } }
void function(SensorEvent event) { if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) { double strength = 0; for (int i = 0; i < 3; ++i) { strength += event.values[i] * event.values[i]; } strength = Math.sqrt(strength); this.fieldStrength = strength; return; } float heading = event.values[0]; this.timeStamp = System.currentTimeMillis(); this.heading = heading; this.setStatus(CompassListener.RUNNING); if ((this.timeStamp - this.lastAccessTime) > this.TIMEOUT) { this.stop(); } }
/** * Sensor listener event. * * @param SensorEvent event */
Sensor listener event
onSensorChanged
{ "repo_name": "tisztamo/cordova-plugin-device-orientation", "path": "src/android/CompassListener.java", "license": "apache-2.0", "size": 11056 }
[ "android.hardware.Sensor", "android.hardware.SensorEvent" ]
import android.hardware.Sensor; import android.hardware.SensorEvent;
import android.hardware.*;
[ "android.hardware" ]
android.hardware;
2,371,978
void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy);
void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy);
/** * Sets the header filter strategy to use. * * @param headerFilterStrategy the custom strategy */
Sets the header filter strategy to use
setHeaderFilterStrategy
{ "repo_name": "nikhilvibhav/camel", "path": "components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpBinding.java", "license": "apache-2.0", "size": 6524 }
[ "org.apache.camel.spi.HeaderFilterStrategy" ]
import org.apache.camel.spi.HeaderFilterStrategy;
import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
873,883
public Sun getSunInfo(Calendar calendar, double latitude, double longitude) { return getSunInfo(calendar, latitude, longitude, false); }
Sun function(Calendar calendar, double latitude, double longitude) { return getSunInfo(calendar, latitude, longitude, false); }
/** * Calculates all sun rise and sets at the specified coordinates. */
Calculates all sun rise and sets at the specified coordinates
getSunInfo
{ "repo_name": "jforge/openhab2", "path": "addons/binding/org.openhab.binding.astro/src/main/java/org/openhab/binding/astro/internal/calc/SunCalc.java", "license": "epl-1.0", "size": 10823 }
[ "java.util.Calendar", "org.openhab.binding.astro.internal.model.Sun" ]
import java.util.Calendar; import org.openhab.binding.astro.internal.model.Sun;
import java.util.*; import org.openhab.binding.astro.internal.model.*;
[ "java.util", "org.openhab.binding" ]
java.util; org.openhab.binding;
1,957,725
protected final void addAction(IMenuManager menu, String group, String actionId) { IAction action= getAction(actionId); if (action != null) { IMenuManager subMenu= menu.findMenuUsingPath(group); if (subMenu != null) subMenu.add(action); else menu.appendToGroup(group, action); } }
final void function(IMenuManager menu, String group, String actionId) { IAction action= getAction(actionId); if (action != null) { IMenuManager subMenu= menu.findMenuUsingPath(group); if (subMenu != null) subMenu.add(action); else menu.appendToGroup(group, action); } }
/** * Convenience method to add the action installed under the given action id to the specified group of the menu. * @param menu the menu to add the action to * @param group the group in the menu * @param actionId the id of the action to add */
Convenience method to add the action installed under the given action id to the specified group of the menu
addAction
{ "repo_name": "gama-platform/gama.cloud", "path": "ummisco.gama.participative/src/ummisco/gama/participative/texteditor/EtherpadBasicTextEditor.java", "license": "agpl-3.0", "size": 26323 }
[ "org.eclipse.jface.action.IAction", "org.eclipse.jface.action.IMenuManager" ]
import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
525,362
@Override public File getGrapesFolder() { return runtimeManager.getFileOrFolder(Keys.groovy.grapeFolder, "${baseFolder}/groovy/grape"); }
File function() { return runtimeManager.getFileOrFolder(Keys.groovy.grapeFolder, STR); }
/** * Returns the path of the Groovy Grape folder. This method checks to see if * Gitblit is running on a cloud service and may return an adjusted path. * * @return the Groovy Grape folder path */
Returns the path of the Groovy Grape folder. This method checks to see if Gitblit is running on a cloud service and may return an adjusted path
getGrapesFolder
{ "repo_name": "cesarmarinhorj/gitblit", "path": "src/main/java/com/gitblit/manager/RepositoryManager.java", "license": "apache-2.0", "size": 69799 }
[ "com.gitblit.Keys", "java.io.File" ]
import com.gitblit.Keys; import java.io.File;
import com.gitblit.*; import java.io.*;
[ "com.gitblit", "java.io" ]
com.gitblit; java.io;
2,276,860
protected void drawItemPass1(Graphics2D x_graphics, Rectangle2D x_dataArea, PlotRenderingInfo x_info, XYPlot x_plot, ValueAxis x_domainAxis, ValueAxis x_rangeAxis, XYDataset x_dataset, int x_series, int x_item, CrosshairState x_crosshairState) { Shape l_entityArea = null; EntityCollection l_entities = null; if (null != x_info) { l_entities = x_info.getOwner().getEntityCollection(); } Paint l_seriesPaint = getItemPaint(x_series, x_item); Stroke l_seriesStroke = getItemStroke(x_series, x_item); x_graphics.setPaint(l_seriesPaint); x_graphics.setStroke(l_seriesStroke); PlotOrientation l_orientation = x_plot.getOrientation(); RectangleEdge l_domainAxisLocation = x_plot.getDomainAxisEdge(); RectangleEdge l_rangeAxisLocation = x_plot.getRangeAxisEdge(); double l_x0 = x_dataset.getXValue(x_series, x_item); double l_y0 = x_dataset.getYValue(x_series, x_item); double l_x1 = x_domainAxis.valueToJava2D(l_x0, x_dataArea, l_domainAxisLocation); double l_y1 = x_rangeAxis.valueToJava2D(l_y0, x_dataArea, l_rangeAxisLocation); if (getShapesVisible()) { Shape l_shape = getItemShape(x_series, x_item); if (l_orientation == PlotOrientation.HORIZONTAL) { l_shape = ShapeUtilities.createTranslatedShape(l_shape, l_y1, l_x1); } else { l_shape = ShapeUtilities.createTranslatedShape(l_shape, l_x1, l_y1); } if (l_shape.intersects(x_dataArea)) { x_graphics.setPaint(getItemPaint(x_series, x_item)); x_graphics.fill(l_shape); } l_entityArea = l_shape; } // add an entity for the item... if (null != l_entities) { if (null == l_entityArea) { l_entityArea = new Rectangle2D.Double((l_x1 - 2), (l_y1 - 2), 4, 4); } String l_tip = null; XYToolTipGenerator l_tipGenerator = getToolTipGenerator(x_series, x_item); if (null != l_tipGenerator) { l_tip = l_tipGenerator.generateToolTip(x_dataset, x_series, x_item); } String l_url = null; XYURLGenerator l_urlGenerator = getURLGenerator(); if (null != l_urlGenerator) { l_url = l_urlGenerator.generateURL(x_dataset, x_series, x_item); } XYItemEntity l_entity = new XYItemEntity(l_entityArea, x_dataset, x_series, x_item, l_tip, l_url); l_entities.add(l_entity); } // draw the item label if there is one... if (isItemLabelVisible(x_series, x_item)) { drawItemLabel(x_graphics, l_orientation, x_dataset, x_series, x_item, l_x1, l_y1, (l_y1 < 0.0)); } int l_domainAxisIndex = x_plot.getDomainAxisIndex(x_domainAxis); int l_rangeAxisIndex = x_plot.getRangeAxisIndex(x_rangeAxis); updateCrosshairValues(x_crosshairState, l_x0, l_y0, l_domainAxisIndex, l_rangeAxisIndex, l_x1, l_y1, l_orientation); if (0 == x_item) { return; } double l_x2 = x_domainAxis.valueToJava2D(x_dataset.getXValue(x_series, (x_item - 1)), x_dataArea, l_domainAxisLocation); double l_y2 = x_rangeAxis.valueToJava2D(x_dataset.getYValue(x_series, (x_item - 1)), x_dataArea, l_rangeAxisLocation); Line2D l_line = null; if (PlotOrientation.HORIZONTAL == l_orientation) { l_line = new Line2D.Double(l_y1, l_x1, l_y2, l_x2); } else if (PlotOrientation.VERTICAL == l_orientation) { l_line = new Line2D.Double(l_x1, l_y1, l_x2, l_y2); } if ((null != l_line) && l_line.intersects(x_dataArea)) { x_graphics.setPaint(getItemPaint(x_series, x_item)); x_graphics.setStroke(getItemStroke(x_series, x_item)); x_graphics.draw(l_line); } }
void function(Graphics2D x_graphics, Rectangle2D x_dataArea, PlotRenderingInfo x_info, XYPlot x_plot, ValueAxis x_domainAxis, ValueAxis x_rangeAxis, XYDataset x_dataset, int x_series, int x_item, CrosshairState x_crosshairState) { Shape l_entityArea = null; EntityCollection l_entities = null; if (null != x_info) { l_entities = x_info.getOwner().getEntityCollection(); } Paint l_seriesPaint = getItemPaint(x_series, x_item); Stroke l_seriesStroke = getItemStroke(x_series, x_item); x_graphics.setPaint(l_seriesPaint); x_graphics.setStroke(l_seriesStroke); PlotOrientation l_orientation = x_plot.getOrientation(); RectangleEdge l_domainAxisLocation = x_plot.getDomainAxisEdge(); RectangleEdge l_rangeAxisLocation = x_plot.getRangeAxisEdge(); double l_x0 = x_dataset.getXValue(x_series, x_item); double l_y0 = x_dataset.getYValue(x_series, x_item); double l_x1 = x_domainAxis.valueToJava2D(l_x0, x_dataArea, l_domainAxisLocation); double l_y1 = x_rangeAxis.valueToJava2D(l_y0, x_dataArea, l_rangeAxisLocation); if (getShapesVisible()) { Shape l_shape = getItemShape(x_series, x_item); if (l_orientation == PlotOrientation.HORIZONTAL) { l_shape = ShapeUtilities.createTranslatedShape(l_shape, l_y1, l_x1); } else { l_shape = ShapeUtilities.createTranslatedShape(l_shape, l_x1, l_y1); } if (l_shape.intersects(x_dataArea)) { x_graphics.setPaint(getItemPaint(x_series, x_item)); x_graphics.fill(l_shape); } l_entityArea = l_shape; } if (null != l_entities) { if (null == l_entityArea) { l_entityArea = new Rectangle2D.Double((l_x1 - 2), (l_y1 - 2), 4, 4); } String l_tip = null; XYToolTipGenerator l_tipGenerator = getToolTipGenerator(x_series, x_item); if (null != l_tipGenerator) { l_tip = l_tipGenerator.generateToolTip(x_dataset, x_series, x_item); } String l_url = null; XYURLGenerator l_urlGenerator = getURLGenerator(); if (null != l_urlGenerator) { l_url = l_urlGenerator.generateURL(x_dataset, x_series, x_item); } XYItemEntity l_entity = new XYItemEntity(l_entityArea, x_dataset, x_series, x_item, l_tip, l_url); l_entities.add(l_entity); } if (isItemLabelVisible(x_series, x_item)) { drawItemLabel(x_graphics, l_orientation, x_dataset, x_series, x_item, l_x1, l_y1, (l_y1 < 0.0)); } int l_domainAxisIndex = x_plot.getDomainAxisIndex(x_domainAxis); int l_rangeAxisIndex = x_plot.getRangeAxisIndex(x_rangeAxis); updateCrosshairValues(x_crosshairState, l_x0, l_y0, l_domainAxisIndex, l_rangeAxisIndex, l_x1, l_y1, l_orientation); if (0 == x_item) { return; } double l_x2 = x_domainAxis.valueToJava2D(x_dataset.getXValue(x_series, (x_item - 1)), x_dataArea, l_domainAxisLocation); double l_y2 = x_rangeAxis.valueToJava2D(x_dataset.getYValue(x_series, (x_item - 1)), x_dataArea, l_rangeAxisLocation); Line2D l_line = null; if (PlotOrientation.HORIZONTAL == l_orientation) { l_line = new Line2D.Double(l_y1, l_x1, l_y2, l_x2); } else if (PlotOrientation.VERTICAL == l_orientation) { l_line = new Line2D.Double(l_x1, l_y1, l_x2, l_y2); } if ((null != l_line) && l_line.intersects(x_dataArea)) { x_graphics.setPaint(getItemPaint(x_series, x_item)); x_graphics.setStroke(getItemStroke(x_series, x_item)); x_graphics.draw(l_line); } }
/** * Draws the visual representation of a single data item, second pass. In * the second pass, the renderer draws the lines and shapes for the * individual points in the two series. * * @param x_graphics the graphics device. * @param x_dataArea the area within which the data is being drawn. * @param x_info collects information about the drawing. * @param x_plot the plot (can be used to obtain standard color * information etc). * @param x_domainAxis the domain (horizontal) axis. * @param x_rangeAxis the range (vertical) axis. * @param x_dataset the dataset. * @param x_series the series index (zero-based). * @param x_item the item index (zero-based). * @param x_crosshairState crosshair information for the plot * (<code>null</code> permitted). */
Draws the visual representation of a single data item, second pass. In the second pass, the renderer draws the lines and shapes for the individual points in the two series
drawItemPass1
{ "repo_name": "greearb/jfreechart-fse-ct", "path": "src/main/java/org/jfree/chart/renderer/xy/XYDifferenceRenderer.java", "license": "lgpl-2.1", "size": 49793 }
[ "java.awt.Graphics2D", "java.awt.Paint", "java.awt.Shape", "java.awt.Stroke", "java.awt.geom.Line2D", "java.awt.geom.Rectangle2D", "org.jfree.chart.axis.ValueAxis", "org.jfree.chart.entity.EntityCollection", "org.jfree.chart.entity.XYItemEntity", "org.jfree.chart.labels.XYToolTipGenerator", "org...
import java.awt.Graphics2D; import java.awt.Paint; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.Line2D; import java.awt.geom.Rectangle2D; import org.jfree.chart.axis.ValueAxis; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.entity.XYItemEntity; import org.jfree.chart.labels.XYToolTipGenerator; import org.jfree.chart.plot.CrosshairState; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.ui.RectangleEdge; import org.jfree.chart.urls.XYURLGenerator; import org.jfree.chart.util.ShapeUtilities; import org.jfree.data.xy.XYDataset;
import java.awt.*; import java.awt.geom.*; import org.jfree.chart.axis.*; import org.jfree.chart.entity.*; import org.jfree.chart.labels.*; import org.jfree.chart.plot.*; import org.jfree.chart.ui.*; import org.jfree.chart.urls.*; import org.jfree.chart.util.*; import org.jfree.data.xy.*;
[ "java.awt", "org.jfree.chart", "org.jfree.data" ]
java.awt; org.jfree.chart; org.jfree.data;
1,686,772
public void removeChangeListener(ChangeListener l) { m_ChangeListeners.remove(l); }
void function(ChangeListener l) { m_ChangeListeners.remove(l); }
/** * Removes a ChangeListener from the panel * * @param l the listener to remove */
Removes a ChangeListener from the panel
removeChangeListener
{ "repo_name": "mydzigear/weka.kmeanspp.silhouette_score", "path": "src/weka/gui/arffviewer/ArffTable.java", "license": "gpl-3.0", "size": 12482 }
[ "javax.swing.event.ChangeListener" ]
import javax.swing.event.ChangeListener;
import javax.swing.event.*;
[ "javax.swing" ]
javax.swing;
937,274
private static void executeJob() { // Provide a random individual List<AbstractIndividual<INeuralNet>> nnind = provider.provide(1); // Evaluate it System.out.println("\n\nGenerated Individual\n--------------------\n" + consoleReporter.renderNeuralNetIndividual(nnind.get(0),evaluator)); // Exponents weights have a reduced step size if(nnind.get(0).getGenotype() instanceof MSEOptimizablePUNeuralNetRegressor) algorithm.setReducedStepSize(obtainReducedStepSize((MSEOptimizablePUNeuralNetRegressor) nnind.get(0).getGenotype())); else algorithm.setReducedStepSize(null); // Apply iRPropAlgorithm nnind.get(0).setGenotype((INeuralNet) algorithm.optimize((IOptimizableFunc) nnind.get(0).getGenotype())); // Evaluate it System.out.println("Optimized Individual\n--------------------\n" + consoleReporter.renderNeuralNetIndividual(nnind.get(0),evaluator)); // Print Results consoleReporter.algorithmFinished(nnind.get(0), (ProblemEvaluator<AbstractIndividual<INeuralNet>>) evaluator); }
static void function() { List<AbstractIndividual<INeuralNet>> nnind = provider.provide(1); System.out.println(STR + consoleReporter.renderNeuralNetIndividual(nnind.get(0),evaluator)); if(nnind.get(0).getGenotype() instanceof MSEOptimizablePUNeuralNetRegressor) algorithm.setReducedStepSize(obtainReducedStepSize((MSEOptimizablePUNeuralNetRegressor) nnind.get(0).getGenotype())); else algorithm.setReducedStepSize(null); nnind.get(0).setGenotype((INeuralNet) algorithm.optimize((IOptimizableFunc) nnind.get(0).getGenotype())); System.out.println(STR + consoleReporter.renderNeuralNetIndividual(nnind.get(0),evaluator)); consoleReporter.algorithmFinished(nnind.get(0), (ProblemEvaluator<AbstractIndividual<INeuralNet>>) evaluator); }
/** * <p> * Executes the algorithm * </p> */
Executes the algorithm
executeJob
{ "repo_name": "SCI2SUGR/KEEL", "path": "src/keel/Algorithms/Neural_Networks/IRPropPlus_Regr/KEELIRPropPlusWrapperRegr.java", "license": "gpl-3.0", "size": 19444 }
[ "java.util.List", "net.sf.jclec.base.AbstractIndividual" ]
import java.util.List; import net.sf.jclec.base.AbstractIndividual;
import java.util.*; import net.sf.jclec.base.*;
[ "java.util", "net.sf.jclec" ]
java.util; net.sf.jclec;
236,714
public HTableDescriptor getTableDescriptor() throws FileNotFoundException, IOException { HTableDescriptor htd = this.masterServices.getTableDescriptors().get(tableName); if (htd == null) { throw new IOException("HTableDescriptor missing for " + tableName); } return htd; }
HTableDescriptor function() throws FileNotFoundException, IOException { HTableDescriptor htd = this.masterServices.getTableDescriptors().get(tableName); if (htd == null) { throw new IOException(STR + tableName); } return htd; }
/** * Gets a TableDescriptor from the masterServices. Can Throw exceptions. * * @return Table descriptor for this table * @throws TableExistsException * @throws FileNotFoundException * @throws IOException */
Gets a TableDescriptor from the masterServices. Can Throw exceptions
getTableDescriptor
{ "repo_name": "ZhangXFeng/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/master/handler/TableEventHandler.java", "license": "apache-2.0", "size": 9471 }
[ "java.io.FileNotFoundException", "java.io.IOException", "org.apache.hadoop.hbase.HTableDescriptor" ]
import java.io.FileNotFoundException; import java.io.IOException; import org.apache.hadoop.hbase.HTableDescriptor;
import java.io.*; import org.apache.hadoop.hbase.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,672,045
// -------------------------------------------------------------------------------------- // Request mapping // -------------------------------------------------------------------------------------- @RequestMapping() public String list(final Model model) { log("Action 'list'"); final List<TbCfcApplicationMst> list = tbCfcApplicationMstService.findAll(); model.addAttribute(MAIN_LIST_NAME, list); return JSP_LIST; }
@RequestMapping() String function(final Model model) { log(STR); final List<TbCfcApplicationMst> list = tbCfcApplicationMstService.findAll(); model.addAttribute(MAIN_LIST_NAME, list); return JSP_LIST; }
/** * Shows a list with all the occurrences of TbCfcApplicationMst found in the database * @param model Spring MVC model * @return */
Shows a list with all the occurrences of TbCfcApplicationMst found in the database
list
{ "repo_name": "abmindiarepomanager/ABMOpenMainet", "path": "Mainet1.1/MainetServiceParent/MainetServiceCommon/src/main/java/com/abm/mainet/common/master/ui/controller/TbCfcApplicationMstController.java", "license": "gpl-3.0", "size": 10145 }
[ "com.abm.mainet.common.master.dto.TbCfcApplicationMst", "java.util.List", "org.springframework.ui.Model", "org.springframework.web.bind.annotation.RequestMapping" ]
import com.abm.mainet.common.master.dto.TbCfcApplicationMst; import java.util.List; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping;
import com.abm.mainet.common.master.dto.*; import java.util.*; import org.springframework.ui.*; import org.springframework.web.bind.annotation.*;
[ "com.abm.mainet", "java.util", "org.springframework.ui", "org.springframework.web" ]
com.abm.mainet; java.util; org.springframework.ui; org.springframework.web;
2,342,469
public static JMenuItem createHyperLinkMenuItem(String text) { if (text == null || text.trim().length() == 0) text = "hyperlink"; JMenuItem b = new JMenuItem(text); //Font f = b.getFont(); //b.setFont(f.deriveFont(f.getStyle(), f.getSize()-2)); b.setOpaque(false); b.setForeground(UIUtilities.HYPERLINK_COLOR); unifiedButtonLookAndFeel(b); return b; }
static JMenuItem function(String text) { if (text == null text.trim().length() == 0) text = STR; JMenuItem b = new JMenuItem(text); b.setOpaque(false); b.setForeground(UIUtilities.HYPERLINK_COLOR); unifiedButtonLookAndFeel(b); return b; }
/** * Creates a button looking like an hyper-link. * * @param text The text to display * @return See above. */
Creates a button looking like an hyper-link
createHyperLinkMenuItem
{ "repo_name": "tp81/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/util/ui/UIUtilities.java", "license": "gpl-2.0", "size": 90682 }
[ "javax.swing.JMenuItem" ]
import javax.swing.JMenuItem;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
389,426
public WindupProgressMonitor overrideWindupProgressMonitor(final WindupProgressMonitor testMonitor) { return testMonitor; }
WindupProgressMonitor function(final WindupProgressMonitor testMonitor) { return testMonitor; }
/** * Override this if you need to intercept the calls to WindupProgressMonitor. * The overriding method must keep the functionality of passed monitor. * See {@link CombinedWindupProgressMonitor}. */
Override this if you need to intercept the calls to WindupProgressMonitor. The overriding method must keep the functionality of passed monitor. See <code>CombinedWindupProgressMonitor</code>
overrideWindupProgressMonitor
{ "repo_name": "johnsteele/windup", "path": "tests/src/test/java/org/jboss/windup/tests/application/WindupArchitectureTest.java", "license": "epl-1.0", "size": 15749 }
[ "org.jboss.windup.exec.WindupProgressMonitor" ]
import org.jboss.windup.exec.WindupProgressMonitor;
import org.jboss.windup.exec.*;
[ "org.jboss.windup" ]
org.jboss.windup;
1,506,812
public Object get(String name) throws IOException { if (name.equalsIgnoreCase(ID)) { return policyIdentifier; } else if (name.equalsIgnoreCase(QUALIFIERS)) { return policyQualifiers; } else { throw new IOException("Attribute name [" + name + "] not recognized by PolicyInformation."); } }
Object function(String name) throws IOException { if (name.equalsIgnoreCase(ID)) { return policyIdentifier; } else if (name.equalsIgnoreCase(QUALIFIERS)) { return policyQualifiers; } else { throw new IOException(STR + name + STR); } }
/** * Get the attribute value. */
Get the attribute value
get
{ "repo_name": "nypgit/alto", "path": "src/alto/sec/x509/PolicyInformation.java", "license": "lgpl-3.0", "size": 10908 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
774,051
default Object getObject(Connection connection, ResultSet resultSet, String columnLabel) { try { Object object = resultSet.getObject(columnLabel); if (Standard.logger.isDebugEnabled()) Standard.logger.debug("Database.getObject: columnLabel: " + columnLabel + ", getted object: " + Utils.toLogString(object)); return object; } catch (SQLException e) { throw new RuntimeSQLException(e); } }
default Object getObject(Connection connection, ResultSet resultSet, String columnLabel) { try { Object object = resultSet.getObject(columnLabel); if (Standard.logger.isDebugEnabled()) Standard.logger.debug(STR + columnLabel + STR + Utils.toLogString(object)); return object; } catch (SQLException e) { throw new RuntimeSQLException(e); } }
/** * Gets the value from the resultSet and returns it. * * @param connection the <b>Connection</b> object * @param resultSet the <b>ResultSet</b> object * @param columnLabel the label for the column * @return the column value * * @throws NullPointerException if <b>connection</b>, <b>resultSet</b> or <b>columnLabel</b> is <b>null</b> * @throws RuntimeSQLException if a <b>SQLException</b> is thrown while accessing the database, replaces it with this exception * * @since 3.0.0 */
Gets the value from the resultSet and returns it
getObject
{ "repo_name": "MasatoKokubo/Lightsleep", "path": "src/main/java/org/lightsleep/database/Database.java", "license": "mit", "size": 7737 }
[ "java.sql.Connection", "java.sql.ResultSet", "java.sql.SQLException", "org.lightsleep.RuntimeSQLException", "org.lightsleep.helper.Utils" ]
import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import org.lightsleep.RuntimeSQLException; import org.lightsleep.helper.Utils;
import java.sql.*; import org.lightsleep.*; import org.lightsleep.helper.*;
[ "java.sql", "org.lightsleep", "org.lightsleep.helper" ]
java.sql; org.lightsleep; org.lightsleep.helper;
2,889,008
public Project getProject() { return project; }
Project function() { return project; }
/** * Gets the project. * * @return the project */
Gets the project
getProject
{ "repo_name": "DigiArea/jse-model", "path": "com.digiarea.jse/src/com/digiarea/jse/io/Input.java", "license": "epl-1.0", "size": 5077 }
[ "com.digiarea.jse.Project" ]
import com.digiarea.jse.Project;
import com.digiarea.jse.*;
[ "com.digiarea.jse" ]
com.digiarea.jse;
1,008,625
public void frintn(int size, Register dst, Register src) { fpDataProcessing1Source(FRINTN, dst, src, floatFromSize(size)); }
void function(int size, Register dst, Register src) { fpDataProcessing1Source(FRINTN, dst, src, floatFromSize(size)); }
/** * Rounds floating-point to integral. Rounds towards nearest with ties to even. * * @param size register size. * @param dst floating point register. May not be null. * @param src floating point register. May not be null. */
Rounds floating-point to integral. Rounds towards nearest with ties to even
frintn
{ "repo_name": "md-5/jdk10", "path": "src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java", "license": "gpl-2.0", "size": 131187 }
[ "org.graalvm.compiler.asm.aarch64.AArch64Assembler" ]
import org.graalvm.compiler.asm.aarch64.AArch64Assembler;
import org.graalvm.compiler.asm.aarch64.*;
[ "org.graalvm.compiler" ]
org.graalvm.compiler;
344,131
protected TimeOperand createTimeFunction(Operand operand, String function, Operand... inputs){ return new TimeFunctionOperand(operand, function, inputs); }
TimeOperand function(Operand operand, String function, Operand... inputs){ return new TimeFunctionOperand(operand, function, inputs); }
/** * Create time function time operand. * * @param operand the operand * @param function the function * @param inputs the inputs * @return the time operand */
Create time function time operand
createTimeFunction
{ "repo_name": "bluebiz/bluelytics-api", "path": "src/main/java/de/bluebiz/bluelytics/api/query/plan/expressions/operands/Operand.java", "license": "apache-2.0", "size": 4164 }
[ "de.bluebiz.bluelytics.api.query.plan.expressions.operands.time.TimeFunctionOperand", "de.bluebiz.bluelytics.api.query.plan.expressions.operands.time.TimeOperand" ]
import de.bluebiz.bluelytics.api.query.plan.expressions.operands.time.TimeFunctionOperand; import de.bluebiz.bluelytics.api.query.plan.expressions.operands.time.TimeOperand;
import de.bluebiz.bluelytics.api.query.plan.expressions.operands.time.*;
[ "de.bluebiz.bluelytics" ]
de.bluebiz.bluelytics;
1,954,623
List<AbstractSubscriptionBean> toSubscriptionBean(final Collection<Subscription> subscriptions, final String language);
List<AbstractSubscriptionBean> toSubscriptionBean(final Collection<Subscription> subscriptions, final String language);
/** * Gets the list of subscription of a user. * @param subscriptions the subscriptions to convert. * @param language the aimed language. * @return a list of {@link AbstractSubscriptionBean}. */
Gets the list of subscription of a user
toSubscriptionBean
{ "repo_name": "SilverDav/Silverpeas-Core", "path": "core-web/src/main/java/org/silverpeas/core/web/subscription/bean/SubscriptionBeanService.java", "license": "agpl-3.0", "size": 2240 }
[ "java.util.Collection", "java.util.List", "org.silverpeas.core.subscription.Subscription" ]
import java.util.Collection; import java.util.List; import org.silverpeas.core.subscription.Subscription;
import java.util.*; import org.silverpeas.core.subscription.*;
[ "java.util", "org.silverpeas.core" ]
java.util; org.silverpeas.core;
518,550
public FtpFileObject[] listObjects() { List<FtpFileObject> result; FTPClient client; m_Stopped = false; if (m_Client == null) client = newClient(); else client = m_Client; try { result = search(client); } catch (Exception e) { LoggingHelper.handleException(this, "Failed to list remote directory!", e); result = new ArrayList<>(); } finally { if (m_Client == null) disconnect(client); } return result.toArray(new FtpFileObject[result.size()]); }
FtpFileObject[] function() { List<FtpFileObject> result; FTPClient client; m_Stopped = false; if (m_Client == null) client = newClient(); else client = m_Client; try { result = search(client); } catch (Exception e) { LoggingHelper.handleException(this, STR, e); result = new ArrayList<>(); } finally { if (m_Client == null) disconnect(client); } return result.toArray(new FtpFileObject[result.size()]); }
/** * Returns the list of files/directories in the watched directory. In case * the execution gets stopped, this method returns a 0-length array. * * @return the list of file/directory wrappers */
Returns the list of files/directories in the watched directory. In case the execution gets stopped, this method returns a 0-length array
listObjects
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-net/src/main/java/adams/core/io/lister/FtpDirectoryLister.java", "license": "gpl-3.0", "size": 12345 }
[ "java.util.ArrayList", "java.util.List", "org.apache.commons.net.ftp.FTPClient" ]
import java.util.ArrayList; import java.util.List; import org.apache.commons.net.ftp.FTPClient;
import java.util.*; import org.apache.commons.net.ftp.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
2,617,106
public static void battery1AR16(String[] argv) throws Exception { long tims = System.currentTimeMillis(); int i = min; int j = max; String fkey = String.format(uniqKeyFmt, i); // with j at max, should get them all since we stored to max -1 String tkey = String.format(uniqKeyFmt, j); Iterator<?> its = RelatrixKV.findSubMapKV(fkey, tkey); System.out.println("KV Battery1AR16"); // with i at max, should catch them all while(its.hasNext()) { Comparable nex = (Comparable) its.next(); Map.Entry<String, Long> nexe = (Map.Entry<String,Long>)nex; if(Integer.parseInt(nexe.getKey()) != i) { // Map.Entry System.out.println("KV RANGE 1AR16 KEY MISMATCH:"+i+" - "+nexe); throw new Exception("KV RANGE 1AR16 KEY MISMATCH:"+i+" - "+nexe); } ++i; } System.out.println("BATTERY1AR16 SUCCESS in "+(System.currentTimeMillis()-tims)+" ms."); }
static void function(String[] argv) throws Exception { long tims = System.currentTimeMillis(); int i = min; int j = max; String fkey = String.format(uniqKeyFmt, i); String tkey = String.format(uniqKeyFmt, j); Iterator<?> its = RelatrixKV.findSubMapKV(fkey, tkey); System.out.println(STR); while(its.hasNext()) { Comparable nex = (Comparable) its.next(); Map.Entry<String, Long> nexe = (Map.Entry<String,Long>)nex; if(Integer.parseInt(nexe.getKey()) != i) { System.out.println(STR+i+STR+nexe); throw new Exception(STR+i+STR+nexe); } ++i; } System.out.println(STR+(System.currentTimeMillis()-tims)+STR); }
/** * findSubMap findSubMapKV - Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive. * @param argv * @throws Exception */
findSubMap findSubMapKV - Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive
battery1AR16
{ "repo_name": "neocoretechs/Relatrix", "path": "src/com/neocoretechs/relatrix/test/kv/BatteryRelatrixKV.java", "license": "apache-2.0", "size": 15796 }
[ "com.neocoretechs.bigsack.iterator.Entry", "com.neocoretechs.relatrix.RelatrixKV", "java.util.Iterator", "java.util.Map" ]
import com.neocoretechs.bigsack.iterator.Entry; import com.neocoretechs.relatrix.RelatrixKV; import java.util.Iterator; import java.util.Map;
import com.neocoretechs.bigsack.iterator.*; import com.neocoretechs.relatrix.*; import java.util.*;
[ "com.neocoretechs.bigsack", "com.neocoretechs.relatrix", "java.util" ]
com.neocoretechs.bigsack; com.neocoretechs.relatrix; java.util;
1,337,455
Connection sslSocketFactory(SSLSocketFactory sslSocketFactory);
Connection sslSocketFactory(SSLSocketFactory sslSocketFactory);
/** * Set custom SSL socket factory * @param sslSocketFactory custom SSL socket factory * @return this Connection, for chaining */
Set custom SSL socket factory
sslSocketFactory
{ "repo_name": "jhy/jsoup", "path": "src/main/java/org/jsoup/Connection.java", "license": "mit", "size": 31086 }
[ "javax.net.ssl.SSLSocketFactory" ]
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.*;
[ "javax.net" ]
javax.net;
2,190,481
public void injectBlocks(int nameNodeIndex, int dataNodeIndex, Iterable<Block> blocksToInject) throws IOException { if (dataNodeIndex < 0 || dataNodeIndex > dataNodes.size()) { throw new IndexOutOfBoundsException(); } FSDatasetInterface dataSet = dataNodes.get(dataNodeIndex).datanode.getFSDataset(); if (!(dataSet instanceof SimulatedFSDataset)) { throw new IOException("injectBlocks is valid only for SimilatedFSDataset"); } String bpid = getNamesystem(nameNodeIndex).getBlockPoolId(); SimulatedFSDataset sdataset = (SimulatedFSDataset) dataSet; sdataset.injectBlocks(bpid, blocksToInject); dataNodes.get(dataNodeIndex).datanode.scheduleAllBlockReport(0); }
void function(int nameNodeIndex, int dataNodeIndex, Iterable<Block> blocksToInject) throws IOException { if (dataNodeIndex < 0 dataNodeIndex > dataNodes.size()) { throw new IndexOutOfBoundsException(); } FSDatasetInterface dataSet = dataNodes.get(dataNodeIndex).datanode.getFSDataset(); if (!(dataSet instanceof SimulatedFSDataset)) { throw new IOException(STR); } String bpid = getNamesystem(nameNodeIndex).getBlockPoolId(); SimulatedFSDataset sdataset = (SimulatedFSDataset) dataSet; sdataset.injectBlocks(bpid, blocksToInject); dataNodes.get(dataNodeIndex).datanode.scheduleAllBlockReport(0); }
/** * Multiple-NameNode version of {@link #injectBlocks(Iterable[])}. */
Multiple-NameNode version of <code>#injectBlocks(Iterable[])</code>
injectBlocks
{ "repo_name": "moreus/hadoop", "path": "hadoop-0.23.10/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java", "license": "apache-2.0", "size": 74425 }
[ "java.io.IOException", "org.apache.hadoop.hdfs.protocol.Block", "org.apache.hadoop.hdfs.server.datanode.FSDatasetInterface", "org.apache.hadoop.hdfs.server.datanode.SimulatedFSDataset" ]
import java.io.IOException; import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.server.datanode.FSDatasetInterface; import org.apache.hadoop.hdfs.server.datanode.SimulatedFSDataset;
import java.io.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.datanode.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
88,308
static void logCurrentThreadTrace() { ThreadTrace trace = getThreadTrace(); // New threads must call Tracer.initCurrentThreadTrace() before Tracer // statistics are gathered. This is a recent change (Jun 2007) that // prevents spurious Third Eye messages when an application uses a class in // a different package that happens to call Tracer without knowledge of the // application authors. if (!trace.isInitialized()) { logger.log(Level.WARNING, "Tracer log requested for this thread but was not " + "initialized using Tracer.initCurrentThreadTrace().", new Throwable()); return; } if (!trace.isEmpty()) { logger.log(Level.WARNING, "timers:\n{0}", getCurrentThreadTraceReport()); } }
static void logCurrentThreadTrace() { ThreadTrace trace = getThreadTrace(); if (!trace.isInitialized()) { logger.log(Level.WARNING, STR + STR, new Throwable()); return; } if (!trace.isEmpty()) { logger.log(Level.WARNING, STR, getCurrentThreadTraceReport()); } }
/** * Logs a timer report similar to the one described in the class comment. */
Logs a timer report similar to the one described in the class comment
logCurrentThreadTrace
{ "repo_name": "selkhateeb/closure-compiler", "path": "src/com/google/javascript/jscomp/Tracer.java", "license": "apache-2.0", "size": 34136 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
2,705,324
public Value getDefaultValue() { return SVGValueConstants.START_VALUE; }
Value function() { return SVGValueConstants.START_VALUE; }
/** * Implements {@link * org.apache.flex.forks.batik.css.engine.value.ValueManager#getDefaultValue()}. */
Implements <code>org.apache.flex.forks.batik.css.engine.value.ValueManager#getDefaultValue()</code>
getDefaultValue
{ "repo_name": "shyamalschandra/flex-sdk", "path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/css/engine/value/svg/TextAnchorManager.java", "license": "apache-2.0", "size": 3184 }
[ "org.apache.flex.forks.batik.css.engine.value.Value" ]
import org.apache.flex.forks.batik.css.engine.value.Value;
import org.apache.flex.forks.batik.css.engine.value.*;
[ "org.apache.flex" ]
org.apache.flex;
385,626
@Override @XmlElement(name = "userDeterminedLimitations") public InternationalString getUserDeterminedLimitations() { return userDeterminedLimitations; }
@XmlElement(name = STR) InternationalString function() { return userDeterminedLimitations; }
/** * Returns applications, determined by the user for which the resource and/or resource series is not suitable. * * @return applications for which the resource and/or resource series is not suitable, or {@code null}. */
Returns applications, determined by the user for which the resource and/or resource series is not suitable
getUserDeterminedLimitations
{ "repo_name": "Geomatys/sis", "path": "core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultUsage.java", "license": "apache-2.0", "size": 13235 }
[ "javax.xml.bind.annotation.XmlElement", "org.opengis.util.InternationalString" ]
import javax.xml.bind.annotation.XmlElement; import org.opengis.util.InternationalString;
import javax.xml.bind.annotation.*; import org.opengis.util.*;
[ "javax.xml", "org.opengis.util" ]
javax.xml; org.opengis.util;
1,543,139