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
protected KafkaServer getKafkaServer(int brokerId, File tmpFolder) throws Exception { Properties kafkaProperties = new Properties(); // properties have to be Strings kafkaProperties.put("advertised.host.name", KAFKA_HOST); kafkaProperties.put("broker.id", Integer.toString(brokerId)); kafkaProperties.put("log.dir", tmpFolder.toString()); kafkaProperties.put("zookeeper.connect", zookeeperConnectionString); kafkaProperties.put("message.max.bytes", String.valueOf(50 * 1024 * 1024)); kafkaProperties.put("replica.fetch.max.bytes", String.valueOf(50 * 1024 * 1024)); // for CI stability, increase zookeeper session timeout kafkaProperties.put("zookeeper.session.timeout.ms", zkTimeout); kafkaProperties.put("zookeeper.connection.timeout.ms", zkTimeout); if (config.getKafkaServerProperties() != null) { kafkaProperties.putAll(config.getKafkaServerProperties()); } final int numTries = 5; for (int i = 1; i <= numTries; i++) { int kafkaPort = NetUtils.getAvailablePort(); kafkaProperties.put("port", Integer.toString(kafkaPort)); if (config.isHideKafkaBehindProxy()) { NetworkFailuresProxy proxy = createProxy(KAFKA_HOST, kafkaPort); kafkaProperties.put("advertised.port", proxy.getLocalPort()); } //to support secure kafka cluster if (config.isSecureMode()) { LOG.info("Adding Kafka secure configurations"); kafkaProperties.put("listeners", "SASL_PLAINTEXT://" + KAFKA_HOST + ":" + kafkaPort); kafkaProperties.put("advertised.listeners", "SASL_PLAINTEXT://" + KAFKA_HOST + ":" + kafkaPort); kafkaProperties.putAll(getSecureProperties()); } KafkaConfig kafkaConfig = new KafkaConfig(kafkaProperties); try { scala.Option<String> stringNone = scala.Option.apply(null); KafkaServer server = new KafkaServer(kafkaConfig, Time.SYSTEM, stringNone, new ArraySeq<KafkaMetricsReporter>(0)); server.startup(); return server; } catch (KafkaException e) { if (e.getCause() instanceof BindException) { // port conflict, retry... LOG.info("Port conflict when starting Kafka Broker. Retrying..."); } else { throw e; } } } throw new Exception("Could not start Kafka after " + numTries + " retries due to port conflicts."); } private class KafkaOffsetHandlerImpl implements KafkaOffsetHandler { private final KafkaConsumer<byte[], byte[]> offsetClient; public KafkaOffsetHandlerImpl() { Properties props = new Properties(); props.putAll(standardProps); props.setProperty("key.deserializer", "org.apache.kafka.common.serialization.ByteArrayDeserializer"); props.setProperty("value.deserializer", "org.apache.kafka.common.serialization.ByteArrayDeserializer"); offsetClient = new KafkaConsumer<>(props); }
KafkaServer function(int brokerId, File tmpFolder) throws Exception { Properties kafkaProperties = new Properties(); kafkaProperties.put(STR, KAFKA_HOST); kafkaProperties.put(STR, Integer.toString(brokerId)); kafkaProperties.put(STR, tmpFolder.toString()); kafkaProperties.put(STR, zookeeperConnectionString); kafkaProperties.put(STR, String.valueOf(50 * 1024 * 1024)); kafkaProperties.put(STR, String.valueOf(50 * 1024 * 1024)); kafkaProperties.put(STR, zkTimeout); kafkaProperties.put(STR, zkTimeout); if (config.getKafkaServerProperties() != null) { kafkaProperties.putAll(config.getKafkaServerProperties()); } final int numTries = 5; for (int i = 1; i <= numTries; i++) { int kafkaPort = NetUtils.getAvailablePort(); kafkaProperties.put("port", Integer.toString(kafkaPort)); if (config.isHideKafkaBehindProxy()) { NetworkFailuresProxy proxy = createProxy(KAFKA_HOST, kafkaPort); kafkaProperties.put(STR, proxy.getLocalPort()); } if (config.isSecureMode()) { LOG.info(STR); kafkaProperties.put(STR, STRadvertised.listenersSTRSASL_PLAINTEXT: kafkaProperties.putAll(getSecureProperties()); } KafkaConfig kafkaConfig = new KafkaConfig(kafkaProperties); try { scala.Option<String> stringNone = scala.Option.apply(null); KafkaServer server = new KafkaServer(kafkaConfig, Time.SYSTEM, stringNone, new ArraySeq<KafkaMetricsReporter>(0)); server.startup(); return server; } catch (KafkaException e) { if (e.getCause() instanceof BindException) { LOG.info(STR); } else { throw e; } } } throw new Exception(STR + numTries + STR); } private class KafkaOffsetHandlerImpl implements KafkaOffsetHandler { private final KafkaConsumer<byte[], byte[]> offsetClient; public KafkaOffsetHandlerImpl() { Properties props = new Properties(); props.putAll(standardProps); props.setProperty("key.deserializerSTRorg.apache.kafka.common.serialization.ByteArrayDeserializer"); props.setProperty("value.deserializerSTRorg.apache.kafka.common.serialization.ByteArrayDeserializer"); offsetClient = new KafkaConsumer<>(props); }
/** * Copied from com.github.sakserv.minicluster.KafkaLocalBrokerIntegrationTest (ASL licensed). */
Copied from com.github.sakserv.minicluster.KafkaLocalBrokerIntegrationTest (ASL licensed)
getKafkaServer
{ "repo_name": "mylog00/flink", "path": "flink-connectors/flink-connector-kafka-0.10/src/test/java/org/apache/flink/streaming/connectors/kafka/KafkaTestEnvironmentImpl.java", "license": "apache-2.0", "size": 16691 }
[ "java.io.File", "java.net.BindException", "java.util.Properties", "org.apache.flink.networking.NetworkFailuresProxy", "org.apache.flink.util.NetUtils", "org.apache.kafka.clients.consumer.KafkaConsumer", "org.apache.kafka.common.utils.Time" ]
import java.io.File; import java.net.BindException; import java.util.Properties; import org.apache.flink.networking.NetworkFailuresProxy; import org.apache.flink.util.NetUtils; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.common.utils.Time;
import java.io.*; import java.net.*; import java.util.*; import org.apache.flink.networking.*; import org.apache.flink.util.*; import org.apache.kafka.clients.consumer.*; import org.apache.kafka.common.utils.*;
[ "java.io", "java.net", "java.util", "org.apache.flink", "org.apache.kafka" ]
java.io; java.net; java.util; org.apache.flink; org.apache.kafka;
2,126,654
JSModule getModule(); } private static enum SymbolType { PROPERTY, VAR; } class GlobalFunction implements Symbol { private final Node nameNode; private final Var var; private final JSModule module; GlobalFunction(Node nameNode, Var var, JSModule module) { Node parent = nameNode.getParent(); Preconditions.checkState( parent.isVar() || NodeUtil.isFunctionDeclaration(parent)); this.nameNode = nameNode; this.var = var; this.module = module; }
JSModule getModule(); } private static enum SymbolType { PROPERTY, VAR; } class GlobalFunction implements Symbol { private final Node nameNode; private final Var var; private final JSModule module; GlobalFunction(Node nameNode, Var var, JSModule module) { Node parent = nameNode.getParent(); Preconditions.checkState( parent.isVar() NodeUtil.isFunctionDeclaration(parent)); this.nameNode = nameNode; this.var = var; this.module = module; }
/** * Returns the module where this appears. */
Returns the module where this appears
getModule
{ "repo_name": "wenzowski/closure-compiler", "path": "src/com/google/javascript/jscomp/AnalyzePrototypeProperties.java", "license": "apache-2.0", "size": 26846 }
[ "com.google.common.base.Preconditions", "com.google.javascript.jscomp.Scope", "com.google.javascript.rhino.Node" ]
import com.google.common.base.Preconditions; import com.google.javascript.jscomp.Scope; import com.google.javascript.rhino.Node;
import com.google.common.base.*; import com.google.javascript.jscomp.*; import com.google.javascript.rhino.*;
[ "com.google.common", "com.google.javascript" ]
com.google.common; com.google.javascript;
1,045,343
public List<PluginShellCmdContainer> createPluginCmds(Vector<IPluginShellCmdDescriptor> cmds, Session session, Shell shell) { List<PluginShellCmdContainer> cmdList = new ArrayList<PluginShellCmdContainer>(cmds.size()); for (IPluginShellCmdDescriptor currentCmdDescriptor : cmds) { PluginShellCmdModel currentCmdModel = currentCmdDescriptor.getPluginCmdModel(); cmdList.add(new PluginShellCmdContainer(currentCmdModel.getShellCmd(), currentCmdModel.getAlias(), currentCmdModel.getCmdHelp(), new PluginShellCmdProxy(currentCmdDescriptor, session, shell))); }
List<PluginShellCmdContainer> function(Vector<IPluginShellCmdDescriptor> cmds, Session session, Shell shell) { List<PluginShellCmdContainer> cmdList = new ArrayList<PluginShellCmdContainer>(cmds.size()); for (IPluginShellCmdDescriptor currentCmdDescriptor : cmds) { PluginShellCmdModel currentCmdModel = currentCmdDescriptor.getPluginCmdModel(); cmdList.add(new PluginShellCmdContainer(currentCmdModel.getShellCmd(), currentCmdModel.getAlias(), currentCmdModel.getCmdHelp(), new PluginShellCmdProxy(currentCmdDescriptor, session, shell))); }
/** * Method to create the Plugin Shell Command Proxies. * * @param cmds * The Plugin Shell Command Descriptors * @param session * The application's Session object * @param shell * The application's Shell object * @return A sorted list of Plugin Shell Command Containers */
Method to create the Plugin Shell Command Proxies
createPluginCmds
{ "repo_name": "classicwuhao/maxuse", "path": "src/runtime/org/tzi/use/runtime/shell/impl/PluginShellCmdFactory.java", "license": "gpl-2.0", "size": 2914 }
[ "java.util.ArrayList", "java.util.List", "java.util.Vector", "org.tzi.use.main.Session", "org.tzi.use.main.shell.Shell", "org.tzi.use.runtime.model.PluginShellCmdModel", "org.tzi.use.runtime.shell.IPluginShellCmdDescriptor" ]
import java.util.ArrayList; import java.util.List; import java.util.Vector; import org.tzi.use.main.Session; import org.tzi.use.main.shell.Shell; import org.tzi.use.runtime.model.PluginShellCmdModel; import org.tzi.use.runtime.shell.IPluginShellCmdDescriptor;
import java.util.*; import org.tzi.use.main.*; import org.tzi.use.main.shell.*; import org.tzi.use.runtime.model.*; import org.tzi.use.runtime.shell.*;
[ "java.util", "org.tzi.use" ]
java.util; org.tzi.use;
2,824,355
public static boolean isMatchingTail(final Path pathToSearch, final Path pathTail) { if (pathToSearch.depth() != pathTail.depth()) return false; Path tailPath = pathTail; String tailName; Path toSearch = pathToSearch; String toSearchName; boolean result = false; do { tailName = tailPath.getName(); if (tailName == null || tailName.length() <= 0) { result = true; break; } toSearchName = toSearch.getName(); if (toSearchName == null || toSearchName.length() <= 0) break; // Move up a parent on each path for next go around. Path doesn't let us go off the end. tailPath = tailPath.getParent(); toSearch = toSearch.getParent(); } while(tailName.equals(toSearchName)); return result; }
static boolean function(final Path pathToSearch, final Path pathTail) { if (pathToSearch.depth() != pathTail.depth()) return false; Path tailPath = pathTail; String tailName; Path toSearch = pathToSearch; String toSearchName; boolean result = false; do { tailName = tailPath.getName(); if (tailName == null tailName.length() <= 0) { result = true; break; } toSearchName = toSearch.getName(); if (toSearchName == null toSearchName.length() <= 0) break; tailPath = tailPath.getParent(); toSearch = toSearch.getParent(); } while(tailName.equals(toSearchName)); return result; }
/** * Compare path component of the Path URI; e.g. if hdfs://a/b/c and /a/b/c, it will compare the * '/a/b/c' part. If you passed in 'hdfs://a/b/c and b/c, it would return true. Does not consider * schema; i.e. if schemas different but path or subpath matches, the two will equate. * @param pathToSearch Path we will be trying to match. * @param pathTail * @return True if <code>pathTail</code> is tail on the path of <code>pathToSearch</code> */
Compare path component of the Path URI; e.g. if hdfs://a/b/c and /a/b/c, it will compare the '/a/b/c' part. If you passed in 'hdfs://a/b/c and b/c, it would return true. Does not consider schema; i.e. if schemas different but path or subpath matches, the two will equate
isMatchingTail
{ "repo_name": "cloud-software-foundation/c5", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java", "license": "apache-2.0", "size": 67483 }
[ "org.apache.hadoop.fs.Path" ]
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
124,545
try { synchronized (lock) { if(dataSource == null){ Context ctx = new InitialContext(); dataSource = (DataSource) ctx.lookup(DATA_SOURCE_NAME); } } } catch (NamingException e) { handleException("Error while looking up the data source: " + DATA_SOURCE_NAME, e); } }
try { synchronized (lock) { if(dataSource == null){ Context ctx = new InitialContext(); dataSource = (DataSource) ctx.lookup(DATA_SOURCE_NAME); } } } catch (NamingException e) { handleException(STR + DATA_SOURCE_NAME, e); } }
/** * This method Initialised the datasource * @throws APIMgtUsageQueryServiceClientException throws if error occurred */
This method Initialised the datasource
initializeDataSource
{ "repo_name": "pubudu538/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.usage/org.wso2.carbon.apimgt.usage.client/src/main/java/org/wso2/carbon/apimgt/usage/client/impl/APIUsageStatisticsRdbmsClientImpl.java", "license": "apache-2.0", "size": 165547 }
[ "javax.naming.Context", "javax.naming.InitialContext", "javax.naming.NamingException", "javax.sql.DataSource" ]
import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource;
import javax.naming.*; import javax.sql.*;
[ "javax.naming", "javax.sql" ]
javax.naming; javax.sql;
769,092
public boolean containsKey(Coord3D coord) { return coordMap.containsKey(coord); }
boolean function(Coord3D coord) { return coordMap.containsKey(coord); }
/** * Return true if the map contains the key coord. * @param coord See above. * @return See above. */
Return true if the map contains the key coord
containsKey
{ "repo_name": "rleigh-dundee/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/util/roi/model/ROICoordMap.java", "license": "gpl-2.0", "size": 6039 }
[ "org.openmicroscopy.shoola.util.roi.model.util.Coord3D" ]
import org.openmicroscopy.shoola.util.roi.model.util.Coord3D;
import org.openmicroscopy.shoola.util.roi.model.util.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
1,305,796
public void writeToXmlFile( JRReport report, String destFileName ) throws JRException { new JRXmlWriter(jasperReportsContext).write( report, destFileName, "UTF-8" ); }
void function( JRReport report, String destFileName ) throws JRException { new JRXmlWriter(jasperReportsContext).write( report, destFileName, "UTF-8" ); }
/** * Generates the XML representation of the report design supplied as the first parameter * and place it in the file specified by the second parameter. The result is "UTF-8" encoded. * * @param report source report design object * @param destFileName output file name to write the XML report design representation to * @see net.sf.jasperreports.engine.xml.JRXmlWriter */
Generates the XML representation of the report design supplied as the first parameter and place it in the file specified by the second parameter. The result is "UTF-8" encoded
writeToXmlFile
{ "repo_name": "MHTaleb/Encologim", "path": "lib/JasperReport/src/net/sf/jasperreports/engine/JasperCompileManager.java", "license": "gpl-3.0", "size": 29544 }
[ "net.sf.jasperreports.engine.xml.JRXmlWriter" ]
import net.sf.jasperreports.engine.xml.JRXmlWriter;
import net.sf.jasperreports.engine.xml.*;
[ "net.sf.jasperreports" ]
net.sf.jasperreports;
1,542,678
public long readHex(final int numberOfBytes) throws IOException { int hex = 0; for (int i = 0; i < numberOfBytes; i++) { hex = (hex << 8) + (readByte() & 0xFF); } return hex; }
long function(final int numberOfBytes) throws IOException { int hex = 0; for (int i = 0; i < numberOfBytes; i++) { hex = (hex << 8) + (readByte() & 0xFF); } return hex; }
/** * Method to read the next provided number of hex bytes from the input stream. * * @return hex value. * @throws IOException Unable to read the next hex values from the stream. */
Method to read the next provided number of hex bytes from the input stream
readHex
{ "repo_name": "acampbell3000/java-mp4-reader", "path": "src/main/java/uk/co/anthonycampbell/java/mp4reader/reader/MP4InputStream.java", "license": "apache-2.0", "size": 13680 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
696,666
public UserLocalService getUserLocalService() { return userLocalService; }
UserLocalService function() { return userLocalService; }
/** * Returns the user local service. * * @return the user local service */
Returns the user local service
getUserLocalService
{ "repo_name": "p-gebhard/QuickAnswer", "path": "docroot/WEB-INF/src/it/gebhard/qa/service/base/AnswerLocalServiceBaseImpl.java", "license": "gpl-3.0", "size": 23736 }
[ "com.liferay.portal.service.UserLocalService" ]
import com.liferay.portal.service.UserLocalService;
import com.liferay.portal.service.*;
[ "com.liferay.portal" ]
com.liferay.portal;
2,752,636
public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException { // Servers before 3.22 could not do this return this.conn.versionMeetsMinimum(3, 22, 0); }
boolean function() throws SQLException { return this.conn.versionMeetsMinimum(3, 22, 0); }
/** * Can a catalog name be used in a privilege definition statement? * * @return true if so * @throws SQLException * DOCUMENT ME! */
Can a catalog name be used in a privilege definition statement
supportsCatalogsInPrivilegeDefinitions
{ "repo_name": "shubhanshu-gupta/Apache-Solr", "path": "example/solr/collection1/lib/mysql-connector-java-5.1.32/src/com/mysql/jdbc/DatabaseMetaData.java", "license": "apache-2.0", "size": 287958 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
371,072
public TechSet getTechSet() { return techSet; }
TechSet function() { return techSet; }
/** * Returns the {@code TechSet} associated with the Context of the message being passively * scanned. * * @return the {@code TechSet} if the message has been matched to a Context, {@code * TechSet.AllTech} otherwise. */
Returns the TechSet associated with the Context of the message being passively scanned
getTechSet
{ "repo_name": "meitar/zaproxy", "path": "zap/src/main/java/org/zaproxy/zap/extension/pscan/PassiveScanData.java", "license": "apache-2.0", "size": 4626 }
[ "org.zaproxy.zap.model.TechSet" ]
import org.zaproxy.zap.model.TechSet;
import org.zaproxy.zap.model.*;
[ "org.zaproxy.zap" ]
org.zaproxy.zap;
1,695,088
public static final void reset() { properties = PropFile.getProperties(SRC_FILE, INTERNAL); } public static final String ID = getProperty("id"); public static final String KEY = getProperty("key"); // If true you can use: mvn clean test -P jdbc,h2 public static final boolean DEMO = Boolean.parseBoolean(getProperty("demo"));
static final void function() { properties = PropFile.getProperties(SRC_FILE, INTERNAL); } public static final String ID = getProperty("id"); public static final String KEY = getProperty("key"); public static final boolean DEMO = Boolean.parseBoolean(getProperty("demo"));
/** * Reset the properties. */
Reset the properties
reset
{ "repo_name": "TCU-MI/ctakes", "path": "ctakes-ytex/src/test/java/org/apache/ctakes/jdl/test/PropFileMaps.java", "license": "apache-2.0", "size": 1779 }
[ "org.apache.ctakes.jdl.common.PropFile" ]
import org.apache.ctakes.jdl.common.PropFile;
import org.apache.ctakes.jdl.common.*;
[ "org.apache.ctakes" ]
org.apache.ctakes;
419,444
public List<SSOCookieCredential> getSSOCookieCredentials(final String cookieValue) throws InvalidSignedTokenException { List<SSOCookieCredential> cookieList = new ArrayList<>(); SignedToken cookieToken = SignedToken.parse(cookieValue); for (String domain : cookieToken.getDomains()) { SSOCookieCredential nextCookie = new SSOCookieCredential(cookieValue, domain, cookieToken.getExpiryTime()); cookieList.add(nextCookie); } return cookieList; }
List<SSOCookieCredential> function(final String cookieValue) throws InvalidSignedTokenException { List<SSOCookieCredential> cookieList = new ArrayList<>(); SignedToken cookieToken = SignedToken.parse(cookieValue); for (String domain : cookieToken.getDomains()) { SSOCookieCredential nextCookie = new SSOCookieCredential(cookieValue, domain, cookieToken.getExpiryTime()); cookieList.add(nextCookie); } return cookieList; }
/** * Generate a list of cookies based on the original credentials passed in, one * for each of the supported domains. * * @param cookieValue * @return cookieList */
Generate a list of cookies based on the original credentials passed in, one for each of the supported domains
getSSOCookieCredentials
{ "repo_name": "opencadc/core", "path": "cadc-util/src/main/java/ca/nrc/cadc/auth/SSOCookieManager.java", "license": "agpl-3.0", "size": 10567 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,423,491
public ServerBootstrap group(EventLoopGroup parentGroup, EventLoopGroup childGroup) { super.group(parentGroup); ObjectUtil.checkNotNull(childGroup, "childGroup"); if (this.childGroup != null) { throw new IllegalStateException("childGroup set already"); } this.childGroup = childGroup; return this; }
ServerBootstrap function(EventLoopGroup parentGroup, EventLoopGroup childGroup) { super.group(parentGroup); ObjectUtil.checkNotNull(childGroup, STR); if (this.childGroup != null) { throw new IllegalStateException(STR); } this.childGroup = childGroup; return this; }
/** * Set the {@link EventLoopGroup} for the parent (acceptor) and the child (client). These * {@link EventLoopGroup}'s are used to handle all the events and IO for {@link ServerChannel} and * {@link Channel}'s. */
Set the <code>EventLoopGroup</code> for the parent (acceptor) and the child (client). These <code>EventLoopGroup</code>'s are used to handle all the events and IO for <code>ServerChannel</code> and <code>Channel</code>'s
group
{ "repo_name": "fengjiachun/netty", "path": "transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java", "license": "apache-2.0", "size": 10494 }
[ "io.netty.channel.EventLoopGroup", "io.netty.util.internal.ObjectUtil" ]
import io.netty.channel.EventLoopGroup; import io.netty.util.internal.ObjectUtil;
import io.netty.channel.*; import io.netty.util.internal.*;
[ "io.netty.channel", "io.netty.util" ]
io.netty.channel; io.netty.util;
375,187
public static List getPossibleIncludedStrategies(EvaluationStrategy parent) { List list = getPossibleIncludedStrategiesNonRecursive(parent); ArrayList toRemove = new ArrayList(); for (Iterator iter = list.iterator(); iter.hasNext();) { EvaluationStrategy child = (EvaluationStrategy) iter.next(); if (!getPossibleIncludedStrategiesNonRecursive(child).contains(parent)) toRemove.add(child); } for (Iterator iter = toRemove.iterator(); iter.hasNext();) { EvaluationStrategy element = (EvaluationStrategy) iter.next(); if (list.contains(element)) list.remove(element); } return list; } /** * Gets the list of strategy that it would be possible to include, without recursing. Used in a context where recursion would cause an infinite loop. * * @param parent * the strategy * @return the list of possible {@link EvaluationStrategy}
static List function(EvaluationStrategy parent) { List list = getPossibleIncludedStrategiesNonRecursive(parent); ArrayList toRemove = new ArrayList(); for (Iterator iter = list.iterator(); iter.hasNext();) { EvaluationStrategy child = (EvaluationStrategy) iter.next(); if (!getPossibleIncludedStrategiesNonRecursive(child).contains(parent)) toRemove.add(child); } for (Iterator iter = toRemove.iterator(); iter.hasNext();) { EvaluationStrategy element = (EvaluationStrategy) iter.next(); if (list.contains(element)) list.remove(element); } return list; } /** * Gets the list of strategy that it would be possible to include, without recursing. Used in a context where recursion would cause an infinite loop. * * @param parent * the strategy * @return the list of possible {@link EvaluationStrategy}
/** * Returns all strategies that we may include into the given parent. Will not cause any circular references. * * @param parent * the parent strategy * @return the list of possible children. */
Returns all strategies that we may include into the given parent. Will not cause any circular references
getPossibleIncludedStrategies
{ "repo_name": "McGill-DP-Group/seg.jUCMNav", "path": "src/seg/jUCMNav/strategies/EvaluationStrategyManager.java", "license": "epl-1.0", "size": 79551 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,156,335
public void forgetFlock(FlockInfo info) { throw new SubclassResponsibilityException(); }
void function(FlockInfo info) { throw new SubclassResponsibilityException(); }
/** * Remember that there are no more persistent pointers to the shepherd * described by info. If it gets garbage collected, remember to dismantle it * when it comes back in from the disk. */
Remember that there are no more persistent pointers to the shepherd described by info. If it gets garbage collected, remember to dismantle it when it comes back in from the disk
forgetFlock
{ "repo_name": "jonesd/udanax-gold2java", "path": "abora-gold/src/generated-sources/translator/info/dgjones/abora/gold/snarf/DiskManager.java", "license": "mit", "size": 23713 }
[ "info.dgjones.abora.gold.java.exception.SubclassResponsibilityException", "info.dgjones.abora.gold.snarf.FlockInfo" ]
import info.dgjones.abora.gold.java.exception.SubclassResponsibilityException; import info.dgjones.abora.gold.snarf.FlockInfo;
import info.dgjones.abora.gold.java.exception.*; import info.dgjones.abora.gold.snarf.*;
[ "info.dgjones.abora" ]
info.dgjones.abora;
2,766,362
HashCode hashString(CharSequence input, Charset charset);
HashCode hashString(CharSequence input, Charset charset);
/** * Shortcut for {@code newHasher().putString(input, charset).hash()}. Characters are encoded * using the given {@link Charset}. The implementation <i>might</i> perform better than its * longhand equivalent, but should not perform worse. */
Shortcut for newHasher().putString(input, charset).hash(). Characters are encoded using the given <code>Charset</code>. The implementation might perform better than its longhand equivalent, but should not perform worse
hashString
{ "repo_name": "npvincent/guava", "path": "guava/src/com/google/common/hash/HashFunction.java", "license": "apache-2.0", "size": 10719 }
[ "java.nio.charset.Charset" ]
import java.nio.charset.Charset;
import java.nio.charset.*;
[ "java.nio" ]
java.nio;
475,303
public static Test suite() { return new TestSuite(TimeseriesToArrayTest.class); }
static Test function() { return new TestSuite(TimeseriesToArrayTest.class); }
/** * Returns the test suite. * * @return the suite */
Returns the test suite
suite
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-timeseries/src/test/java/adams/data/conversion/TimeseriesToArrayTest.java", "license": "gpl-3.0", "size": 3900 }
[ "junit.framework.Test", "junit.framework.TestSuite" ]
import junit.framework.Test; import junit.framework.TestSuite;
import junit.framework.*;
[ "junit.framework" ]
junit.framework;
2,278,100
super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.authentication); nickservCheckbox = (CheckBox) findViewById(R.id.nickserv_checkbox); nickservPasswordLabel = (TextView) findViewById(R.id.nickserv_label_password); nickservPasswordEditText = (EditText) findViewById(R.id.nickserv_password); saslCheckbox = (CheckBox) findViewById(R.id.sasl_checkbox); saslUsernameLabel = (TextView) findViewById(R.id.sasl_label_username); saslUsernameEditText = (EditText) findViewById(R.id.sasl_username); saslPasswordLabel = (TextView) findViewById(R.id.sasl_label_password); saslPasswordEditText = (EditText) findViewById(R.id.sasl_password); nickservCheckbox.setOnCheckedChangeListener(this); saslCheckbox.setOnCheckedChangeListener(this); Bundle extras = getIntent().getExtras(); if (extras != null) { String nickservPassword = extras.getString(Extra.NICKSERV_PASSWORD); if (nickservPassword != null && nickservPassword.length() > 0) { nickservCheckbox.setChecked(true); nickservPasswordEditText.setText(nickservPassword); } String saslUsername = extras.getString(Extra.SASL_USER); String saslPassword = extras.getString(Extra.SASL_PASSWORD); if (saslUsername != null && saslUsername.length() > 0) { saslCheckbox.setChecked(true); saslUsernameEditText.setText(saslUsername); saslPasswordEditText.setText(saslPassword); } } ((Button) findViewById(R.id.ok)).setOnClickListener(this); ((Button) findViewById(R.id.cancel)).setOnClickListener(this); }
super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.authentication); nickservCheckbox = (CheckBox) findViewById(R.id.nickserv_checkbox); nickservPasswordLabel = (TextView) findViewById(R.id.nickserv_label_password); nickservPasswordEditText = (EditText) findViewById(R.id.nickserv_password); saslCheckbox = (CheckBox) findViewById(R.id.sasl_checkbox); saslUsernameLabel = (TextView) findViewById(R.id.sasl_label_username); saslUsernameEditText = (EditText) findViewById(R.id.sasl_username); saslPasswordLabel = (TextView) findViewById(R.id.sasl_label_password); saslPasswordEditText = (EditText) findViewById(R.id.sasl_password); nickservCheckbox.setOnCheckedChangeListener(this); saslCheckbox.setOnCheckedChangeListener(this); Bundle extras = getIntent().getExtras(); if (extras != null) { String nickservPassword = extras.getString(Extra.NICKSERV_PASSWORD); if (nickservPassword != null && nickservPassword.length() > 0) { nickservCheckbox.setChecked(true); nickservPasswordEditText.setText(nickservPassword); } String saslUsername = extras.getString(Extra.SASL_USER); String saslPassword = extras.getString(Extra.SASL_PASSWORD); if (saslUsername != null && saslUsername.length() > 0) { saslCheckbox.setChecked(true); saslUsernameEditText.setText(saslUsername); saslPasswordEditText.setText(saslPassword); } } ((Button) findViewById(R.id.ok)).setOnClickListener(this); ((Button) findViewById(R.id.cancel)).setOnClickListener(this); }
/** * On create */
On create
onCreate
{ "repo_name": "mbullington/dialogue", "path": "yaaic/src/main/java/mbullington/dialogue/activity/AuthenticationActivity.java", "license": "gpl-2.0", "size": 5421 }
[ "android.os.Bundle", "android.view.Window", "android.widget.Button", "android.widget.CheckBox", "android.widget.EditText", "android.widget.TextView" ]
import android.os.Bundle; import android.view.Window; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.TextView;
import android.os.*; import android.view.*; import android.widget.*;
[ "android.os", "android.view", "android.widget" ]
android.os; android.view; android.widget;
1,590,528
public ThreadingService getThreadingService() { return threadingService; }
ThreadingService function() { return threadingService; }
/** * Returns engine-level threading settings. * @return threading service */
Returns engine-level threading settings
getThreadingService
{ "repo_name": "b-cuts/esper", "path": "esper/src/main/java/com/espertech/esper/core/service/EPServicesContext.java", "license": "gpl-2.0", "size": 26818 }
[ "com.espertech.esper.core.thread.ThreadingService" ]
import com.espertech.esper.core.thread.ThreadingService;
import com.espertech.esper.core.thread.*;
[ "com.espertech.esper" ]
com.espertech.esper;
850,607
public static int addGeneAliases(CanonicalGene gene) throws DaoException { if (MySQLbulkLoader.isBulkLoad()) { // write to the temp file maintained by the MySQLbulkLoader Set<String> aliases = gene.getAliases(); for (String alias : aliases) { MySQLbulkLoader.getMySQLbulkLoader("gene_alias").insertRecord( Long.toString(gene.getEntrezGeneId()), alias); } // return 1 because normal insert will return 1 if no error occurs return 1; } Connection con = null; PreparedStatement pstmt = null; ResultSet rs = null; try { con = JdbcUtil.getDbConnection(DaoGene.class); Set<String> aliases = gene.getAliases(); Set<String> existingAliases = getAliases(gene.getEntrezGeneId()); int rows = 0; for (String alias : aliases) { if (!existingAliases.contains(alias)) { pstmt = con.prepareStatement("INSERT INTO gene_alias " + "(`ENTREZ_GENE_ID`,`GENE_ALIAS`) VALUES (?,?)"); pstmt.setLong(1, gene.getEntrezGeneId()); pstmt.setString(2, alias); rows += pstmt.executeUpdate(); } } return rows; } catch (SQLException e) { throw new DaoException(e); } finally { JdbcUtil.closeAll(DaoGene.class, con, pstmt, rs); } }
static int function(CanonicalGene gene) throws DaoException { if (MySQLbulkLoader.isBulkLoad()) { Set<String> aliases = gene.getAliases(); for (String alias : aliases) { MySQLbulkLoader.getMySQLbulkLoader(STR).insertRecord( Long.toString(gene.getEntrezGeneId()), alias); } return 1; } Connection con = null; PreparedStatement pstmt = null; ResultSet rs = null; try { con = JdbcUtil.getDbConnection(DaoGene.class); Set<String> aliases = gene.getAliases(); Set<String> existingAliases = getAliases(gene.getEntrezGeneId()); int rows = 0; for (String alias : aliases) { if (!existingAliases.contains(alias)) { pstmt = con.prepareStatement(STR + STR); pstmt.setLong(1, gene.getEntrezGeneId()); pstmt.setString(2, alias); rows += pstmt.executeUpdate(); } } return rows; } catch (SQLException e) { throw new DaoException(e); } finally { JdbcUtil.closeAll(DaoGene.class, con, pstmt, rs); } }
/** * Add gene_alias records. * @param gene Canonical Gene Object. * @return number of records successfully added. * @throws DaoException Database Error. */
Add gene_alias records
addGeneAliases
{ "repo_name": "shrumit/cbioportal-gsoc-final", "path": "core/src/main/java/org/mskcc/cbio/portal/dao/DaoGene.java", "license": "agpl-3.0", "size": 15716 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException", "java.util.Set", "org.mskcc.cbio.portal.model.CanonicalGene" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Set; import org.mskcc.cbio.portal.model.CanonicalGene;
import java.sql.*; import java.util.*; import org.mskcc.cbio.portal.model.*;
[ "java.sql", "java.util", "org.mskcc.cbio" ]
java.sql; java.util; org.mskcc.cbio;
2,164,188
private static FrozenWorld loadInternalWorld(Component parent, InternalWorld chosenWorld) { // Can skip WorldIO and just jump to Encoded since we have a stream. try (InputStream is = SelectAWorld.class.getResourceAsStream(chosenWorld.internalPath); InputStream rsrcIs = SelectAWorld.class.getResourceAsStream(chosenWorld.internalResourcePath) ) { EncodedWorld world = EncodedWorld.fromStream(is); // Bit of a hack, since right now a valid File object is needed to use the entire resource loading // code which uses the ZipFile class. Extract .jar'ed zip into temporary filesystem. Path tempRsrcDir = Files.createTempDirectory("monkeyshines_temp_resources"); Path tempRsrc = tempRsrcDir.resolve("rsrc.zip"); Files.copy(rsrcIs, tempRsrc); // TODO use Slick based graphics. However, for time being, AWT is standin // until Slick infrastructure is ready. // WorldResource rsrc = PackReader.fromPackAwt(tempRsrc); // Clean up temporary files return new FrozenWorld(world, tempRsrc, true); } catch (Exception e) { LOGGER.severe(CLASS_NAME + ": Missing world " + chosenWorld.internalPath + " from .jar file. Possible .jar corruption."); handleWorldLoadException(parent, e); } return null; }
static FrozenWorld function(Component parent, InternalWorld chosenWorld) { try (InputStream is = SelectAWorld.class.getResourceAsStream(chosenWorld.internalPath); InputStream rsrcIs = SelectAWorld.class.getResourceAsStream(chosenWorld.internalResourcePath) ) { EncodedWorld world = EncodedWorld.fromStream(is); Path tempRsrcDir = Files.createTempDirectory(STR); Path tempRsrc = tempRsrcDir.resolve(STR); Files.copy(rsrcIs, tempRsrc); return new FrozenWorld(world, tempRsrc, true); } catch (Exception e) { LOGGER.severe(CLASS_NAME + STR + chosenWorld.internalPath + STR); handleWorldLoadException(parent, e); } return null; }
/** * Returns an unloaded world from the stock ones in this .jar. If this fails, the .jar is bad, * and a dialog will appear * with the exception info and an exception stacktrace will be logged. Otherwise, the returned object * can be used with {@code SlickMonkeyShines} to load the world. */
Returns an unloaded world from the stock ones in this .jar. If this fails, the .jar is bad, and a dialog will appear with the exception info and an exception stacktrace will be logged. Otherwise, the returned object can be used with SlickMonkeyShines to load the world
loadInternalWorld
{ "repo_name": "ErikaRedmark/monkey-shines-java-port", "path": "Monkey Shines/src/org/erikaredmark/monkeyshines/menu/SelectAWorld.java", "license": "gpl-3.0", "size": 15072 }
[ "java.awt.Component", "java.io.InputStream", "java.nio.file.Files", "java.nio.file.Path", "org.erikaredmark.monkeyshines.encoder.EncodedWorld", "org.erikaredmark.monkeyshines.play.FrozenWorld" ]
import java.awt.Component; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import org.erikaredmark.monkeyshines.encoder.EncodedWorld; import org.erikaredmark.monkeyshines.play.FrozenWorld;
import java.awt.*; import java.io.*; import java.nio.file.*; import org.erikaredmark.monkeyshines.encoder.*; import org.erikaredmark.monkeyshines.play.*;
[ "java.awt", "java.io", "java.nio", "org.erikaredmark.monkeyshines" ]
java.awt; java.io; java.nio; org.erikaredmark.monkeyshines;
1,960,534
public static AggregationStrategy bean(Class<?> type, String methodName) { return new AggregationStrategyBeanAdapter(type, methodName); }
static AggregationStrategy function(Class<?> type, String methodName) { return new AggregationStrategyBeanAdapter(type, methodName); }
/** * Creates a {@link AggregationStrategyBeanAdapter} for using a POJO as the aggregation strategy. */
Creates a <code>AggregationStrategyBeanAdapter</code> for using a POJO as the aggregation strategy
bean
{ "repo_name": "gautric/camel", "path": "camel-core/src/main/java/org/apache/camel/util/toolbox/AggregationStrategies.java", "license": "apache-2.0", "size": 5417 }
[ "org.apache.camel.processor.aggregate.AggregationStrategy", "org.apache.camel.processor.aggregate.AggregationStrategyBeanAdapter" ]
import org.apache.camel.processor.aggregate.AggregationStrategy; import org.apache.camel.processor.aggregate.AggregationStrategyBeanAdapter;
import org.apache.camel.processor.aggregate.*;
[ "org.apache.camel" ]
org.apache.camel;
1,471,534
public void clear(ArrayList<Intersection> points) { for (Intersection point : points) { clear(point); } }
void function(ArrayList<Intersection> points) { for (Intersection point : points) { clear(point); } }
/** * Clear all points from a list. * * @param points List of points. */
Clear all points from a list
clear
{ "repo_name": "RageGo/RageGo", "path": "core/main/java/com/ragego/engine/Marker.java", "license": "gpl-3.0", "size": 2560 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,143,358
public boolean forOneArbitraryMatch(final Operation pOp, final IMatchProcessor<? super UnmarkedDestructorMatch> processor) { return rawForOneArbitraryMatch(new Object[]{pOp}, processor); }
boolean function(final Operation pOp, final IMatchProcessor<? super UnmarkedDestructorMatch> processor) { return rawForOneArbitraryMatch(new Object[]{pOp}, processor); }
/** * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. * Neither determinism nor randomness of selection is guaranteed. * @param pOp the fixed value of pattern parameter op, or null if not bound. * @param processor the action that will process the selected match. * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked * */
Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. Neither determinism nor randomness of selection is guaranteed
forOneArbitraryMatch
{ "repo_name": "ELTE-Soft/xUML-RT-Executor", "path": "plugins/hu.eltesoft.modelexecution.validation/src-gen/hu/eltesoft/modelexecution/validation/UnmarkedDestructorMatcher.java", "license": "epl-1.0", "size": 10286 }
[ "hu.eltesoft.modelexecution.validation.UnmarkedDestructorMatch", "org.eclipse.incquery.runtime.api.IMatchProcessor", "org.eclipse.uml2.uml.Operation" ]
import hu.eltesoft.modelexecution.validation.UnmarkedDestructorMatch; import org.eclipse.incquery.runtime.api.IMatchProcessor; import org.eclipse.uml2.uml.Operation;
import hu.eltesoft.modelexecution.validation.*; import org.eclipse.incquery.runtime.api.*; import org.eclipse.uml2.uml.*;
[ "hu.eltesoft.modelexecution", "org.eclipse.incquery", "org.eclipse.uml2" ]
hu.eltesoft.modelexecution; org.eclipse.incquery; org.eclipse.uml2;
1,958,028
@Override public void process(KeyValPair<K, V> tuple) { K key = tuple.getKey(); MutableInt count = counts.get(key); if (count == null) { count = new MutableInt(0); counts.put(cloneKey(key), count); } count.increment(); }
void function(KeyValPair<K, V> tuple) { K key = tuple.getKey(); MutableInt count = counts.get(key); if (count == null) { count = new MutableInt(0); counts.put(cloneKey(key), count); } count.increment(); }
/** * For each tuple (a key value pair): Adds the values for each key, Counts * the number of occurrence of each key */
For each tuple (a key value pair): Adds the values for each key, Counts the number of occurrence of each key
process
{ "repo_name": "skekre98/apex-mlhr", "path": "library/src/main/java/com/datatorrent/lib/math/CountKeyVal.java", "license": "apache-2.0", "size": 3513 }
[ "com.datatorrent.lib.util.KeyValPair", "org.apache.commons.lang.mutable.MutableInt" ]
import com.datatorrent.lib.util.KeyValPair; import org.apache.commons.lang.mutable.MutableInt;
import com.datatorrent.lib.util.*; import org.apache.commons.lang.mutable.*;
[ "com.datatorrent.lib", "org.apache.commons" ]
com.datatorrent.lib; org.apache.commons;
2,769,628
public boolean awaitCompletion(int timeout, TimeUnit unit) throws Exception { return latch.await(timeout, unit); }
boolean function(int timeout, TimeUnit unit) throws Exception { return latch.await(timeout, unit); }
/** * Waits a fixed timeout for the stream to terminate. */
Waits a fixed timeout for the stream to terminate
awaitCompletion
{ "repo_name": "pieterjanpintens/grpc-java", "path": "testing/src/main/java/io/grpc/testing/StreamRecorder.java", "license": "apache-2.0", "size": 3064 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,125,074
public boolean flush() throws IOException { return false; } } class LogRecoveredEditsOutputSink extends OutputSink { public LogRecoveredEditsOutputSink(PipelineController controller, EntryBuffers entryBuffers, int numWriters) { // More threads could potentially write faster at the expense // of causing more disk seeks as the logs are split. // 3. After a certain setting (probably around 3) the // process will be bound on the reader in the current // implementation anyway. super(controller, entryBuffers, numWriters); }
boolean function() throws IOException { return false; } } class LogRecoveredEditsOutputSink extends OutputSink { public LogRecoveredEditsOutputSink(PipelineController controller, EntryBuffers entryBuffers, int numWriters) { super(controller, entryBuffers, numWriters); }
/** * WriterThread call this function to help flush internal remaining edits in buffer before close * @return true when underlying sink has something to flush */
WriterThread call this function to help flush internal remaining edits in buffer before close
flush
{ "repo_name": "toshimasa-nasu/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java", "license": "apache-2.0", "size": 82681 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,953,171
final Collection<VerwaltungsbereicheEintragCustomBean> eintraege = fsBean.getVerwaltungsbereicheHistorie(); int gridY = 0; for (final VerwaltungsbereicheEintragCustomBean eintrag : eintraege) { java.awt.GridBagConstraints gridBagConstraints; if (gridY > 0) { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.gridx = 0; gridBagConstraints.gridy = gridY++; panItems.add(new JSeparator(JSeparator.HORIZONTAL), gridBagConstraints); } gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.gridx = 0; gridBagConstraints.gridy = gridY++; panItems.add(new VerwaltungsbereicheHistorieEintragPanel(eintrag), gridBagConstraints); } }
final Collection<VerwaltungsbereicheEintragCustomBean> eintraege = fsBean.getVerwaltungsbereicheHistorie(); int gridY = 0; for (final VerwaltungsbereicheEintragCustomBean eintrag : eintraege) { java.awt.GridBagConstraints gridBagConstraints; if (gridY > 0) { gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.gridx = 0; gridBagConstraints.gridy = gridY++; panItems.add(new JSeparator(JSeparator.HORIZONTAL), gridBagConstraints); } gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1.0; gridBagConstraints.gridx = 0; gridBagConstraints.gridy = gridY++; panItems.add(new VerwaltungsbereicheHistorieEintragPanel(eintrag), gridBagConstraints); } }
/** * DOCUMENT ME! * * @param fsBean DOCUMENT ME! */
DOCUMENT ME
setFlurstueck
{ "repo_name": "cismet/lagis-client", "path": "src/main/java/de/cismet/lagis/gui/panels/VerwaltungsbereicheHistoriePanel.java", "license": "gpl-3.0", "size": 3986 }
[ "de.cismet.cids.custom.beans.lagis.VerwaltungsbereicheEintragCustomBean", "java.util.Collection", "javax.swing.JSeparator" ]
import de.cismet.cids.custom.beans.lagis.VerwaltungsbereicheEintragCustomBean; import java.util.Collection; import javax.swing.JSeparator;
import de.cismet.cids.custom.beans.lagis.*; import java.util.*; import javax.swing.*;
[ "de.cismet.cids", "java.util", "javax.swing" ]
de.cismet.cids; java.util; javax.swing;
9,730
@Test public void testResetDefaults() throws Exception { File f = File.createTempFile("testResetDefaults", "."+OME_FORMAT); XMLMockObjects xml = new XMLMockObjects(); XMLWriter writer = new XMLWriter(); writer.writeFile(f, xml.createImage(), true); List<Pixels> pixels = null; try { pixels = importFile(f, OME_FORMAT); } catch (Throwable e) { throw new Exception("cannot import image", e); } Pixels p = pixels.get(0); long id = p.getId().getValue(); factory.getRenderingSettingsService().setOriginalSettingsInSet( Pixels.class.getName(), Arrays.asList(id)); RenderingDef def = factory.getPixelsService().retrieveRndSettings(id); int t = def.getDefaultT().getValue(); int v = t+1; def.setDefaultT(omero.rtypes.rint(v)); //update def = (RenderingDef) iUpdate.saveAndReturnObject(def); RenderingEnginePrx re = factory.createRenderingEngine(); re.lookupPixels(id); if (!re.lookupRenderingDef(id)) { re.resetDefaults(); re.lookupRenderingDef(id); } re.load(); assertEquals(re.getDefaultT(), def.getDefaultT().getValue()); re.resetDefaults(); assertEquals(re.getDefaultT(), t); }
void function() throws Exception { File f = File.createTempFile(STR, "."+OME_FORMAT); XMLMockObjects xml = new XMLMockObjects(); XMLWriter writer = new XMLWriter(); writer.writeFile(f, xml.createImage(), true); List<Pixels> pixels = null; try { pixels = importFile(f, OME_FORMAT); } catch (Throwable e) { throw new Exception(STR, e); } Pixels p = pixels.get(0); long id = p.getId().getValue(); factory.getRenderingSettingsService().setOriginalSettingsInSet( Pixels.class.getName(), Arrays.asList(id)); RenderingDef def = factory.getPixelsService().retrieveRndSettings(id); int t = def.getDefaultT().getValue(); int v = t+1; def.setDefaultT(omero.rtypes.rint(v)); def = (RenderingDef) iUpdate.saveAndReturnObject(def); RenderingEnginePrx re = factory.createRenderingEngine(); re.lookupPixels(id); if (!re.lookupRenderingDef(id)) { re.resetDefaults(); re.lookupRenderingDef(id); } re.load(); assertEquals(re.getDefaultT(), def.getDefaultT().getValue()); re.resetDefaults(); assertEquals(re.getDefaultT(), t); }
/** * Tests to reset the default settings and save them back to the database * using the <code>resetDefaults</code> method. * @throws Exception Thrown if an error occurred. */
Tests to reset the default settings and save them back to the database using the <code>resetDefaults</code> method
testResetDefaults
{ "repo_name": "rleigh-dundee/openmicroscopy", "path": "components/tools/OmeroJava/test/integration/RenderingEngineTest.java", "license": "gpl-2.0", "size": 52865 }
[ "java.io.File", "java.util.Arrays", "java.util.List" ]
import java.io.File; import java.util.Arrays; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,428,654
public void run() { List selectedResources = getSelectedResources(); IResource[] resources = (IResource[]) selectedResources.toArray(new IResource[selectedResources.size()]); // Get the file names and a string representation final int length = resources.length; int actualLength = 0; String[] fileNames = new String[length]; StringBuffer buf = new StringBuffer(); for (int i = 0; i < length; i++) { IPath location = resources[i].getLocation(); // location may be null. See bug 29491. if (location != null) { fileNames[actualLength++] = location.toOSString(); } if (i > 0) { buf.append("\n"); //$NON-NLS-1$ } buf.append(resources[i].getName()); } // was one or more of the locations null? if (actualLength < length) { String[] tempFileNames = fileNames; fileNames = new String[actualLength]; for (int i = 0; i < actualLength; i++) { fileNames[i] = tempFileNames[i]; } } setClipboard(resources, fileNames, buf.toString()); // update the enablement of the paste action // workaround since the clipboard does not suppot callbacks if (pasteAction != null && pasteAction.getStructuredSelection() != null) { pasteAction.selectionChanged(pasteAction.getStructuredSelection()); } }
void function() { List selectedResources = getSelectedResources(); IResource[] resources = (IResource[]) selectedResources.toArray(new IResource[selectedResources.size()]); final int length = resources.length; int actualLength = 0; String[] fileNames = new String[length]; StringBuffer buf = new StringBuffer(); for (int i = 0; i < length; i++) { IPath location = resources[i].getLocation(); if (location != null) { fileNames[actualLength++] = location.toOSString(); } if (i > 0) { buf.append("\n"); } buf.append(resources[i].getName()); } if (actualLength < length) { String[] tempFileNames = fileNames; fileNames = new String[actualLength]; for (int i = 0; i < actualLength; i++) { fileNames[i] = tempFileNames[i]; } } setClipboard(resources, fileNames, buf.toString()); if (pasteAction != null && pasteAction.getStructuredSelection() != null) { pasteAction.selectionChanged(pasteAction.getStructuredSelection()); } }
/** * The <code>CopyAction</code> implementation of this method defined * on <code>IAction</code> copies the selected resources to the * clipboard. */
The <code>CopyAction</code> implementation of this method defined on <code>IAction</code> copies the selected resources to the clipboard
run
{ "repo_name": "smkr/pyclipse", "path": "plugins/org.python.pydev/src_navigator/org/python/pydev/navigator/actions/copied/CopyAction.java", "license": "epl-1.0", "size": 7393 }
[ "java.util.List", "org.eclipse.core.resources.IResource", "org.eclipse.core.runtime.IPath" ]
import java.util.List; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IPath;
import java.util.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*;
[ "java.util", "org.eclipse.core" ]
java.util; org.eclipse.core;
1,705,749
@Test public void testConnectedImport_RepByRef() throws Exception { JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) ); jej.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE ); jej.setJobObjectId( JOB_ENTRY_JOB_OBJECT_ID ); jej.loadXML( getNode( jej ), databases, servers, repository, store ); jej.getJobMeta( repository, store, space ); assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE, jej.getSpecificationMethod() ); verify( repository, times( 1 ) ).loadJob( JOB_ENTRY_JOB_OBJECT_ID, null ); }
void function() throws Exception { JobEntryJob jej = spy( new JobEntryJob( JOB_ENTRY_JOB_NAME ) ); jej.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE ); jej.setJobObjectId( JOB_ENTRY_JOB_OBJECT_ID ); jej.loadXML( getNode( jej ), databases, servers, repository, store ); jej.getJobMeta( repository, store, space ); assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_REFERENCE, jej.getSpecificationMethod() ); verify( repository, times( 1 ) ).loadJob( JOB_ENTRY_JOB_OBJECT_ID, null ); }
/** * When connected to the repository and {@link JobEntryJob} references a child job by {@link ObjectId}, * keep {@link ObjectLocationSpecificationMethod} as {@code REPOSITORY_BY_REFERENCE}. * Load the job from the repository using the specified {@link ObjectId}. */
When connected to the repository and <code>JobEntryJob</code> references a child job by <code>ObjectId</code>, keep <code>ObjectLocationSpecificationMethod</code> as REPOSITORY_BY_REFERENCE. Load the job from the repository using the specified <code>ObjectId</code>
testConnectedImport_RepByRef
{ "repo_name": "emartin-pentaho/pentaho-kettle", "path": "engine/src/test/java/org/pentaho/di/job/entries/job/JobEntryJobTest.java", "license": "apache-2.0", "size": 27102 }
[ "org.junit.Assert", "org.mockito.Mockito", "org.pentaho.di.core.ObjectLocationSpecificationMethod" ]
import org.junit.Assert; import org.mockito.Mockito; import org.pentaho.di.core.ObjectLocationSpecificationMethod;
import org.junit.*; import org.mockito.*; import org.pentaho.di.core.*;
[ "org.junit", "org.mockito", "org.pentaho.di" ]
org.junit; org.mockito; org.pentaho.di;
2,463,506
@Test public void testSerialization() throws IOException, ClassNotFoundException { CategoryTextAnnotation a1 = new CategoryTextAnnotation("Test", "Category", 1.0); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(a1); out.close(); ObjectInput in = new ObjectInputStream(new ByteArrayInputStream( buffer.toByteArray())); CategoryTextAnnotation a2 = (CategoryTextAnnotation) in.readObject(); in.close(); assertEquals(a1, a2); }
void function() throws IOException, ClassNotFoundException { CategoryTextAnnotation a1 = new CategoryTextAnnotation("Test", STR, 1.0); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(a1); out.close(); ObjectInput in = new ObjectInputStream(new ByteArrayInputStream( buffer.toByteArray())); CategoryTextAnnotation a2 = (CategoryTextAnnotation) in.readObject(); in.close(); assertEquals(a1, a2); }
/** * Serialize an instance, restore it, and check for equality. */
Serialize an instance, restore it, and check for equality
testSerialization
{ "repo_name": "akardapolov/ASH-Viewer", "path": "jfreechart-fse/src/test/java/org/jfree/chart/annotations/CategoryTextAnnotationTest.java", "license": "gpl-3.0", "size": 5157 }
[ "java.io.ByteArrayInputStream", "java.io.ByteArrayOutputStream", "java.io.IOException", "java.io.ObjectInput", "java.io.ObjectInputStream", "java.io.ObjectOutput", "java.io.ObjectOutputStream", "org.junit.Assert", "org.junit.Test" ]
import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectInputStream; import java.io.ObjectOutput; import java.io.ObjectOutputStream; import org.junit.Assert; import org.junit.Test;
import java.io.*; import org.junit.*;
[ "java.io", "org.junit" ]
java.io; org.junit;
96,851
public static String quote(byte[] auth) { int escapeChars = 0; for (int i = 0; i < auth.length; i++) if (auth[i] == '"' || auth[i] == '\\') escapeChars++; byte[] escapedAuth = new byte[auth.length + escapeChars + 2]; int index = 1; for (int i = 0; i < auth.length; i++) { if (auth[i] == '"' || auth[i] == '\\') { escapedAuth[index++] = '\\'; } escapedAuth[index++] = auth[i]; } escapedAuth[0] = '"'; escapedAuth[escapedAuth.length - 1] = '"'; return Bytes.toString(escapedAuth); }
static String function(byte[] auth) { int escapeChars = 0; for (int i = 0; i < auth.length; i++) if (auth[i] == 'STR' auth[i] == '\\') { escapedAuth[index++] = '\\'; } escapedAuth[index++] = auth[i]; } escapedAuth[0] = 'STR'; return Bytes.toString(escapedAuth); }
/** * Helps in quoting authentication Strings. Use this if unicode characters to * be used in expression or special characters like '(', ')', * '"','\','&amp;','|','!' */
Helps in quoting authentication Strings. Use this if unicode characters to be used in expression or special characters like '(', ')', '"','\','&amp;','|','!'
quote
{ "repo_name": "juwi/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/security/visibility/CellVisibility.java", "license": "apache-2.0", "size": 2768 }
[ "org.apache.hadoop.hbase.util.Bytes" ]
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,875,134
static Builder generateCookie(ServerConfiguration conf) throws UnknownHostException { StringBuilder b = new StringBuilder(); String[] dirs = conf.getLedgerDirNames(); b.append(dirs.length); for (String d : dirs) { b.append("\t").append(d); } Builder builder = Cookie.newBuilder(); builder.setLayoutVersion(CURRENT_COOKIE_LAYOUT_VERSION); builder.setBookieHost(Bookie.getBookieAddress(conf).toString()); builder.setJournalDir(conf.getJournalDirName()); builder.setLedgerDirs(b.toString()); return builder; }
static Builder generateCookie(ServerConfiguration conf) throws UnknownHostException { StringBuilder b = new StringBuilder(); String[] dirs = conf.getLedgerDirNames(); b.append(dirs.length); for (String d : dirs) { b.append("\t").append(d); } Builder builder = Cookie.newBuilder(); builder.setLayoutVersion(CURRENT_COOKIE_LAYOUT_VERSION); builder.setBookieHost(Bookie.getBookieAddress(conf).toString()); builder.setJournalDir(conf.getJournalDirName()); builder.setLedgerDirs(b.toString()); return builder; }
/** * Generate cookie from the given configuration * * @param conf * configuration * * @return cookie builder object * * @throws UnknownHostException */
Generate cookie from the given configuration
generateCookie
{ "repo_name": "robindh/bookkeeper", "path": "bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java", "license": "apache-2.0", "size": 17734 }
[ "java.net.UnknownHostException", "org.apache.bookkeeper.conf.ServerConfiguration" ]
import java.net.UnknownHostException; import org.apache.bookkeeper.conf.ServerConfiguration;
import java.net.*; import org.apache.bookkeeper.conf.*;
[ "java.net", "org.apache.bookkeeper" ]
java.net; org.apache.bookkeeper;
974,743
public MinecraftServer getServer() { return server; } } public static class ArmorUpdate extends UpdateEvent { private final EntityPlayer player; private final ItemStack stack; private ArmorUpdate(EntityPlayer player, ItemStack stack) { this.player = player; this.stack = stack; }
MinecraftServer function() { return server; } } public static class ArmorUpdate extends UpdateEvent { private final EntityPlayer player; private final ItemStack stack; private ArmorUpdate(EntityPlayer player, ItemStack stack) { this.player = player; this.stack = stack; }
/** * Gets the server instance * * @return The server instance */
Gets the server instance
getServer
{ "repo_name": "Strikingwolf/OpenModLoader", "path": "src/main/java/xyz/openmodloader/event/impl/UpdateEvent.java", "license": "mit", "size": 5155 }
[ "net.minecraft.entity.player.EntityPlayer", "net.minecraft.item.ItemStack", "net.minecraft.server.MinecraftServer" ]
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer;
import net.minecraft.entity.player.*; import net.minecraft.item.*; import net.minecraft.server.*;
[ "net.minecraft.entity", "net.minecraft.item", "net.minecraft.server" ]
net.minecraft.entity; net.minecraft.item; net.minecraft.server;
1,114,847
public String getElApConsumptionLimit() throws AgentException{ // Fill up the stub with required processing return elApConsumptionLimit; }
String function() throws AgentException{ return elApConsumptionLimit; }
/** * Handles the SNMP Get Request for elApConsumptionLimit */
Handles the SNMP Get Request for elApConsumptionLimit
getElApConsumptionLimit
{ "repo_name": "mqgmaster/ufrgs-inf-gerencia-project", "path": "WebNMS - Condominium Agent/src/com/ufrgs/gerencia/agent/ElectricityInstrument.java", "license": "apache-2.0", "size": 9633 }
[ "com.adventnet.utilities.common.AgentException" ]
import com.adventnet.utilities.common.AgentException;
import com.adventnet.utilities.common.*;
[ "com.adventnet.utilities" ]
com.adventnet.utilities;
88,270
public static void setPrompt(String promptText, JTextComponent textComponent) { TextUIWrapper.getDefaultWrapper().install(textComponent, true); // display prompt as tooltip by default if (textComponent.getToolTipText() == null || textComponent.getToolTipText().equals(getPrompt(textComponent))) { textComponent.setToolTipText(promptText); } textComponent.putClientProperty(PROMPT, promptText); textComponent.repaint(); }
static void function(String promptText, JTextComponent textComponent) { TextUIWrapper.getDefaultWrapper().install(textComponent, true); if (textComponent.getToolTipText() == null textComponent.getToolTipText().equals(getPrompt(textComponent))) { textComponent.setToolTipText(promptText); } textComponent.putClientProperty(PROMPT, promptText); textComponent.repaint(); }
/** * <p> * Sets the prompt text on <code>textComponent</code>. Also sets the * tooltip text to the prompt text if <code>textComponent</code> has no * tooltip text or the current tooltip text is the same as the current * prompt text. * </p> * <p> * Calls {@link #install(JTextComponent)} to ensure that the * <code>textComponent</code>s UI is wrapped by the appropriate * {@link PromptTextUI}. * </p> * * @param promptText * @param textComponent */
Sets the prompt text on <code>textComponent</code>. Also sets the tooltip text to the prompt text if <code>textComponent</code> has no tooltip text or the current tooltip text is the same as the current prompt text. Calls <code>#install(JTextComponent)</code> to ensure that the <code>textComponent</code>s UI is wrapped by the appropriate <code>PromptTextUI</code>.
setPrompt
{ "repo_name": "gubatron/frostwire-desktop", "path": "src/com/frostwire/gui/searchfield/PromptSupport.java", "license": "gpl-3.0", "size": 7966 }
[ "javax.swing.text.JTextComponent" ]
import javax.swing.text.JTextComponent;
import javax.swing.text.*;
[ "javax.swing" ]
javax.swing;
1,303,074
String saveFile(String fileId, String fileName, InputStream file) throws StudioException;
String saveFile(String fileId, String fileName, InputStream file) throws StudioException;
/** * Save file in the GridFS. * * @param fileId File identifier * @param fileName File name * @param file File * @return New file identifier * @throws org.craftercms.studio.commons.exception.StudioException */
Save file in the GridFS
saveFile
{ "repo_name": "craftercms/studio3", "path": "repo-mongodb/src/main/java/org/craftercms/studio/impl/repository/mongodb/services/GridFSService.java", "license": "gpl-3.0", "size": 2665 }
[ "java.io.InputStream", "org.craftercms.studio.commons.exception.StudioException" ]
import java.io.InputStream; import org.craftercms.studio.commons.exception.StudioException;
import java.io.*; import org.craftercms.studio.commons.exception.*;
[ "java.io", "org.craftercms.studio" ]
java.io; org.craftercms.studio;
1,771,674
@Override public void overrideClass(String className, byte[] bytes) { if (get(className)!=null) { LOG.info("overrideClass() overriding {}", className); byteCodes.put(className, bytes); classLoader = new GroovyClassLoader(); for (String name : byteCodes.keySet()) { LOG.debug("overrideClass() re-defining {}", name); @SuppressWarnings("unchecked") Class<? extends Object> clazz = classLoader.defineClass(name, byteCodes.get(name)); LOG.debug("overrideClass() re-defining {}", clazz.getName()); classes.put(clazz.getName(), clazz); } // for } // if } // overrideClass()
void function(String className, byte[] bytes) { if (get(className)!=null) { LOG.info(STR, className); byteCodes.put(className, bytes); classLoader = new GroovyClassLoader(); for (String name : byteCodes.keySet()) { LOG.debug(STR, name); @SuppressWarnings(STR) Class<? extends Object> clazz = classLoader.defineClass(name, byteCodes.get(name)); LOG.debug(STR, clazz.getName()); classes.put(clazz.getName(), clazz); } } }
/** * overriding one class means in this case defining all classes anew with one changed definition. * * @param className name of the class * @param bytes redefined byte code for the class */
overriding one class means in this case defining all classes anew with one changed definition
overrideClass
{ "repo_name": "mgoellnitz/tangram", "path": "core/src/org/tangram/components/GroovyClassRepository.java", "license": "lgpl-3.0", "size": 9380 }
[ "groovy.lang.GroovyClassLoader" ]
import groovy.lang.GroovyClassLoader;
import groovy.lang.*;
[ "groovy.lang" ]
groovy.lang;
1,051,104
public LiveData<BoxResponse<BoxVoid>> getUpdateOwner() { return mUpdateOwner; }
LiveData<BoxResponse<BoxVoid>> function() { return mUpdateOwner; }
/** * Returns a LiveData which holds information about a updated owner collaboration. * @return a LiveData which holds information about a updated owner collaboration */
Returns a LiveData which holds information about a updated owner collaboration
getUpdateOwner
{ "repo_name": "box/box-android-share-sdk", "path": "box-share-sdk/src/main/java/com/box/androidsdk/share/sharerepo/ShareRepo.java", "license": "apache-2.0", "size": 13267 }
[ "androidx.lifecycle.LiveData", "com.box.androidsdk.content.models.BoxVoid", "com.box.androidsdk.content.requests.BoxResponse" ]
import androidx.lifecycle.LiveData; import com.box.androidsdk.content.models.BoxVoid; import com.box.androidsdk.content.requests.BoxResponse;
import androidx.lifecycle.*; import com.box.androidsdk.content.models.*; import com.box.androidsdk.content.requests.*;
[ "androidx.lifecycle", "com.box.androidsdk" ]
androidx.lifecycle; com.box.androidsdk;
2,174,617
private void start() { String hostname = m_options.getOptionValue(OPT_HOSTNAME); int port = Integer.parseInt(m_options.getOptionValue(OPT_PORT)); // No authentication data used at the moment ServerInfo listenerInfo = new ServerInfo("SPELL",hostname,port,ServerRole.COMMANDING,null); // Login into listener m_listener.login(listenerInfo); System.out.println("Connected to " + m_listener.getConnectionString()); // Attach to the given context String contextName = m_options.getOptionValue(OPT_CONTEXT); ContextInfo contextInfo = m_listener.contextStartup(contextName); m_context.login(contextInfo); System.out.println("Connected to context " + contextName); }
void function() { String hostname = m_options.getOptionValue(OPT_HOSTNAME); int port = Integer.parseInt(m_options.getOptionValue(OPT_PORT)); ServerInfo listenerInfo = new ServerInfo("SPELL",hostname,port,ServerRole.COMMANDING,null); m_listener.login(listenerInfo); System.out.println(STR + m_listener.getConnectionString()); String contextName = m_options.getOptionValue(OPT_CONTEXT); ContextInfo contextInfo = m_listener.contextStartup(contextName); m_context.login(contextInfo); System.out.println(STR + contextName); }
/*************************************************************************** * Main start method **************************************************************************/
Main start method
start
{ "repo_name": "Spacecraft-Code/SPELL", "path": "src/client-stubj/src/com/engineering/ses/spell/clientstubj/cmdclient/CommandClient.java", "license": "lgpl-3.0", "size": 9132 }
[ "com.astra.ses.spell.gui.core.model.server.ContextInfo", "com.astra.ses.spell.gui.core.model.server.ServerInfo" ]
import com.astra.ses.spell.gui.core.model.server.ContextInfo; import com.astra.ses.spell.gui.core.model.server.ServerInfo;
import com.astra.ses.spell.gui.core.model.server.*;
[ "com.astra.ses" ]
com.astra.ses;
1,935,248
private boolean isRuntimeVariable(Configuration config, DecisionVariableDeclaration declaration) { boolean isRuntimeVar = false; if (null != config) { IDecisionVariable var = config.getDecision(declaration); IDecisionVariable annotationVar = null; for (int i = 0, end = var.getAttributesCount(); i < end && null == annotationVar; i++) { IDecisionVariable tmpVar = var.getAttribute(i); if (QmConstants.ANNOTATION_BINDING_TIME.equals(tmpVar.getDeclaration().getName())) { annotationVar = tmpVar; } } if (null != annotationVar && null != annotationVar.getValue() && annotationVar.getValue() instanceof EnumValue) { EnumLiteral selectedLiteral = ((EnumValue) annotationVar.getValue()).getValue(); isRuntimeVar = selectedLiteral.getOrdinal() >= RUNTIME_LEVEL; } } return isRuntimeVar; }
boolean function(Configuration config, DecisionVariableDeclaration declaration) { boolean isRuntimeVar = false; if (null != config) { IDecisionVariable var = config.getDecision(declaration); IDecisionVariable annotationVar = null; for (int i = 0, end = var.getAttributesCount(); i < end && null == annotationVar; i++) { IDecisionVariable tmpVar = var.getAttribute(i); if (QmConstants.ANNOTATION_BINDING_TIME.equals(tmpVar.getDeclaration().getName())) { annotationVar = tmpVar; } } if (null != annotationVar && null != annotationVar.getValue() && annotationVar.getValue() instanceof EnumValue) { EnumLiteral selectedLiteral = ((EnumValue) annotationVar.getValue()).getValue(); isRuntimeVar = selectedLiteral.getOrdinal() >= RUNTIME_LEVEL; } } return isRuntimeVar; }
/** * Checks whether the given declaration is a runtime variable. * @param config The configuration where the declaration belongs to. * @param declaration The declaration to test. * @return <tt>true</tt> if the variable is a runtime variable and should not be frozen, <tt>false</tt> else. */
Checks whether the given declaration is a runtime variable
isRuntimeVariable
{ "repo_name": "QualiMaster/QM-EASyProducer", "path": "QualiMaster.Extension/src/eu/qualimaster/easy/extension/ProjectFreezeModifier.java", "license": "apache-2.0", "size": 10033 }
[ "net.ssehub.easy.varModel.confModel.Configuration", "net.ssehub.easy.varModel.confModel.IDecisionVariable", "net.ssehub.easy.varModel.model.DecisionVariableDeclaration", "net.ssehub.easy.varModel.model.datatypes.EnumLiteral", "net.ssehub.easy.varModel.model.values.EnumValue" ]
import net.ssehub.easy.varModel.confModel.Configuration; import net.ssehub.easy.varModel.confModel.IDecisionVariable; import net.ssehub.easy.varModel.model.DecisionVariableDeclaration; import net.ssehub.easy.varModel.model.datatypes.EnumLiteral; import net.ssehub.easy.varModel.model.values.EnumValue;
import net.ssehub.easy.*;
[ "net.ssehub.easy" ]
net.ssehub.easy;
349,761
@ApiModelProperty(value = "") public Integer getVendorId() { return vendorId; }
@ApiModelProperty(value = "") Integer function() { return vendorId; }
/** * Get vendorId * @return vendorId **/
Get vendorId
getVendorId
{ "repo_name": "knetikmedia/knetikcloud-java-client", "path": "src/main/java/com/knetikcloud/model/CartShippingOption.java", "license": "apache-2.0", "size": 7460 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
590,399
public void generate(JavaWriter out) throws Exception { out.print(_text); }
void function(JavaWriter out) throws Exception { out.print(_text); }
/** * Generates the code for the tag * * @param out the output writer for the generated java. */
Generates the code for the tag
generate
{ "repo_name": "mdaniel/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/xsl/java/XtpScriptlet.java", "license": "gpl-2.0", "size": 2087 }
[ "com.caucho.java.JavaWriter" ]
import com.caucho.java.JavaWriter;
import com.caucho.java.*;
[ "com.caucho.java" ]
com.caucho.java;
122,896
public static ValueBuilder header(String name) { return Builder.header(name); } /** * Returns a value builder for the given exchange property * * @deprecated use {@link #exchangeProperty(String)}
static ValueBuilder function(String name) { return Builder.header(name); } /** * Returns a value builder for the given exchange property * * @deprecated use {@link #exchangeProperty(String)}
/** * Returns a value builder for the given header */
Returns a value builder for the given header
header
{ "repo_name": "lburgazzoli/apache-camel", "path": "camel-core/src/test/java/org/apache/camel/TestSupport.java", "license": "apache-2.0", "size": 19524 }
[ "org.apache.camel.builder.Builder", "org.apache.camel.builder.ValueBuilder" ]
import org.apache.camel.builder.Builder; import org.apache.camel.builder.ValueBuilder;
import org.apache.camel.builder.*;
[ "org.apache.camel" ]
org.apache.camel;
36,869
public SnapshotRequest indicesOptions(IndicesOptions indicesOptions) { this.indicesOptions = indicesOptions; return this; }
SnapshotRequest function(IndicesOptions indicesOptions) { this.indicesOptions = indicesOptions; return this; }
/** * Sets the indices options * * @param indicesOptions indices options * @return this request */
Sets the indices options
indicesOptions
{ "repo_name": "nazarewk/elasticsearch", "path": "core/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java", "license": "apache-2.0", "size": 83340 }
[ "org.elasticsearch.action.support.IndicesOptions" ]
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.action.support.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
648,357
private Type parseSequenceType(Type elementType) { lexer.eat(TypeLexer.OPEN_SQ); Type result; if (lexer.lookingAt(TypeLexer.WORD)) { int length = lexer.eatDigits(); result = unit.getEmptyType(); while (length > 0) { result = unit.getTupleDeclaration().appliedType(null, Arrays.asList(elementType, elementType, result)); length--; } } else { result = unit.getSequentialType(elementType); } lexer.eat(TypeLexer.CLOSE_SQ); return result; }
Type function(Type elementType) { lexer.eat(TypeLexer.OPEN_SQ); Type result; if (lexer.lookingAt(TypeLexer.WORD)) { int length = lexer.eatDigits(); result = unit.getEmptyType(); while (length > 0) { result = unit.getTupleDeclaration().appliedType(null, Arrays.asList(elementType, elementType, result)); length--; } } else { result = unit.getSequentialType(elementType); } lexer.eat(TypeLexer.CLOSE_SQ); return result; }
/** * Spec says: * <blockquote><pre> * SequenceType: PrimaryType "[" "]" * </pre></blockquote> * This method also handles the right hand variant of: * <blockquote><pre> * TupleType: "[" TypeList "]" | PrimaryType "[" DecimalLiteral "]" * </blockquote></pre> * because it's more easily done here. */
Spec says: <code> SequenceType: PrimaryType "[" "]" </code> This method also handles the right hand variant of: <code> TupleType: "[" TypeList "]" | PrimaryType "[" DecimalLiteral "]" </code> because it's more easily done here
parseSequenceType
{ "repo_name": "ceylon/ceylon", "path": "model/src/org/eclipse/ceylon/model/loader/TypeParser.java", "license": "apache-2.0", "size": 28883 }
[ "java.util.Arrays", "org.eclipse.ceylon.model.typechecker.model.Type" ]
import java.util.Arrays; import org.eclipse.ceylon.model.typechecker.model.Type;
import java.util.*; import org.eclipse.ceylon.model.typechecker.model.*;
[ "java.util", "org.eclipse.ceylon" ]
java.util; org.eclipse.ceylon;
592,978
//----------// // setModel // //----------// public void setModel (SpinnerModel model) { spinner.setModel(model); }
void function (SpinnerModel model) { spinner.setModel(model); }
/** * Set the data model for the spinner * * @param model the new data model */
Set the data model for the spinner
setModel
{ "repo_name": "jlpoolen/libreveris", "path": "src/main/omr/ui/field/LSpinner.java", "license": "lgpl-3.0", "size": 3281 }
[ "javax.swing.SpinnerModel" ]
import javax.swing.SpinnerModel;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
640,998
void registerKeySwap(KeySwapHandler handler);
void registerKeySwap(KeySwapHandler handler);
/** * Registers a key-swap click callback. Unregisters previously registered handler of the same type. * <p>Return false in the handler to prevent changes.</p> * * @param handler the handler */
Registers a key-swap click callback. Unregisters previously registered handler of the same type. Return false in the handler to prevent changes
registerKeySwap
{ "repo_name": "SpongePowered/SpongeAPI", "path": "src/main/java/org/spongepowered/api/item/inventory/menu/InventoryMenu.java", "license": "mit", "size": 5716 }
[ "org.spongepowered.api.item.inventory.menu.handler.KeySwapHandler" ]
import org.spongepowered.api.item.inventory.menu.handler.KeySwapHandler;
import org.spongepowered.api.item.inventory.menu.handler.*;
[ "org.spongepowered.api" ]
org.spongepowered.api;
460,925
public boolean includeROI() { if (layers == null) return false; if (ImViewerAgent.hasOpenGLSupport()) return false; Iterator<JComponent> i = layers.iterator(); while (i.hasNext()) { if (i.next() instanceof DrawingCanvasView) return true; } return false; }
boolean function() { if (layers == null) return false; if (ImViewerAgent.hasOpenGLSupport()) return false; Iterator<JComponent> i = layers.iterator(); while (i.hasNext()) { if (i.next() instanceof DrawingCanvasView) return true; } return false; }
/** * Implemented as specified by the {@link ImViewer} interface. * @see ImViewer#includeROI() */
Implemented as specified by the <code>ImViewer</code> interface
includeROI
{ "repo_name": "emilroz/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java", "license": "gpl-2.0", "size": 99557 }
[ "java.util.Iterator", "javax.swing.JComponent", "org.openmicroscopy.shoola.agents.imviewer.ImViewerAgent", "org.openmicroscopy.shoola.util.ui.drawingtools.canvas.DrawingCanvasView" ]
import java.util.Iterator; import javax.swing.JComponent; import org.openmicroscopy.shoola.agents.imviewer.ImViewerAgent; import org.openmicroscopy.shoola.util.ui.drawingtools.canvas.DrawingCanvasView;
import java.util.*; import javax.swing.*; import org.openmicroscopy.shoola.agents.imviewer.*; import org.openmicroscopy.shoola.util.ui.drawingtools.canvas.*;
[ "java.util", "javax.swing", "org.openmicroscopy.shoola" ]
java.util; javax.swing; org.openmicroscopy.shoola;
1,472,600
@Test public void testMultiInstanceListenersCalled() throws Exception { // start pooled review and approve workflow WorkflowDefinition workflowDef = deployDefinition(getParallelReviewDefinitionPath()); assertNotNull(workflowDef); // Create workflow parameters Map<QName, Serializable> params = new HashMap<QName, Serializable>(); Serializable wfPackage = workflowService.createPackage(null); params.put(WorkflowModel.ASSOC_PACKAGE, wfPackage); Date dueDate = new Date(); params.put(WorkflowModel.PROP_WORKFLOW_DUE_DATE, dueDate); params.put(WorkflowModel.PROP_WORKFLOW_PRIORITY, 1); params.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, "This is the description"); NodeRef group = groupManager.get(GROUP); assertNotNull(group); List<NodeRef> assignees = Arrays.asList(personManager.get(USER2), personManager.get(USER3)); params.put(WorkflowModel.ASSOC_ASSIGNEES, (Serializable) assignees); // Start a workflow instance WorkflowPath path = workflowService.startWorkflow(workflowDef.getId(), params); assertNotNull(path); assertTrue(path.isActive()); String instnaceId = path.getInstance().getId(); WorkflowTask startTask = workflowService.getStartTask(instnaceId); workflowService.endTask(startTask.getId(), null); personManager.setUser(USER2); List<WorkflowTask> tasks = workflowService.getAssignedTasks(USER2, WorkflowTaskState.IN_PROGRESS); assertEquals(1, tasks.size()); //Assert task description assertEquals("Documents for review and approval", tasks.get(0).getDescription()); //Assert workflow link name assertEquals("This is the description", tasks.get(0).getProperties().get(WorkflowModel.PROP_DESCRIPTION)); }
void function() throws Exception { WorkflowDefinition workflowDef = deployDefinition(getParallelReviewDefinitionPath()); assertNotNull(workflowDef); Map<QName, Serializable> params = new HashMap<QName, Serializable>(); Serializable wfPackage = workflowService.createPackage(null); params.put(WorkflowModel.ASSOC_PACKAGE, wfPackage); Date dueDate = new Date(); params.put(WorkflowModel.PROP_WORKFLOW_DUE_DATE, dueDate); params.put(WorkflowModel.PROP_WORKFLOW_PRIORITY, 1); params.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, STR); NodeRef group = groupManager.get(GROUP); assertNotNull(group); List<NodeRef> assignees = Arrays.asList(personManager.get(USER2), personManager.get(USER3)); params.put(WorkflowModel.ASSOC_ASSIGNEES, (Serializable) assignees); WorkflowPath path = workflowService.startWorkflow(workflowDef.getId(), params); assertNotNull(path); assertTrue(path.isActive()); String instnaceId = path.getInstance().getId(); WorkflowTask startTask = workflowService.getStartTask(instnaceId); workflowService.endTask(startTask.getId(), null); personManager.setUser(USER2); List<WorkflowTask> tasks = workflowService.getAssignedTasks(USER2, WorkflowTaskState.IN_PROGRESS); assertEquals(1, tasks.size()); assertEquals(STR, tasks.get(0).getDescription()); assertEquals(STR, tasks.get(0).getProperties().get(WorkflowModel.PROP_DESCRIPTION)); }
/** * Test to validate fix for ALF-19822 */
Test to validate fix for ALF-19822
testMultiInstanceListenersCalled
{ "repo_name": "Alfresco/alfresco-repository", "path": "src/test/java/org/alfresco/repo/workflow/activiti/ActivitiWorkflowServiceIntegrationTest.java", "license": "lgpl-3.0", "size": 39913 }
[ "java.io.Serializable", "java.util.Arrays", "java.util.Date", "java.util.HashMap", "java.util.List", "java.util.Map", "org.alfresco.repo.workflow.WorkflowModel", "org.alfresco.service.cmr.repository.NodeRef", "org.alfresco.service.cmr.workflow.WorkflowDefinition", "org.alfresco.service.cmr.workflow.WorkflowPath", "org.alfresco.service.cmr.workflow.WorkflowTask", "org.alfresco.service.cmr.workflow.WorkflowTaskState", "org.alfresco.service.namespace.QName" ]
import java.io.Serializable; import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import org.alfresco.repo.workflow.WorkflowModel; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.workflow.WorkflowDefinition; import org.alfresco.service.cmr.workflow.WorkflowPath; import org.alfresco.service.cmr.workflow.WorkflowTask; import org.alfresco.service.cmr.workflow.WorkflowTaskState; import org.alfresco.service.namespace.QName;
import java.io.*; import java.util.*; import org.alfresco.repo.workflow.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.cmr.workflow.*; import org.alfresco.service.namespace.*;
[ "java.io", "java.util", "org.alfresco.repo", "org.alfresco.service" ]
java.io; java.util; org.alfresco.repo; org.alfresco.service;
2,627,450
private synchronized void populateData() { activity = new ArrayList<ActivityShareLink>(); try { List<WebElement> links = drone.findAll(By.cssSelector(DIV_CLASS_DASHLET_PLACEHOLDER + " > div.activity")); for (WebElement div : links) { WebElement userLink = div.findElement(By.cssSelector("div.activity>div.content>span.detail>a[class^='theme-color']")); ShareLink user = new ShareLink(userLink, drone); WebElement siteLink = div.findElement(By.cssSelector("div.activity>div.content>span.detail>a[class^='site-link']")); ShareLink site = new ShareLink(siteLink, drone); String description = div.findElement(By.cssSelector("div.content>span.detail")).getText(); if (div.findElements(By.cssSelector("div.activity>div.content>span.detail>a")).size() > 2) { WebElement documentLink = div.findElement(By.cssSelector("div.activity>div.content>span.detail>a[class*='item-link']")); ShareLink document = new ShareLink(documentLink, drone); activity.add(new ActivityShareLink(user, document, site, description)); } else { activity.add(new ActivityShareLink(user, site, description)); } } } catch (NoSuchElementException nse) { throw new PageException("Unable to access dashlet data", nse); } }
synchronized void function() { activity = new ArrayList<ActivityShareLink>(); try { List<WebElement> links = drone.findAll(By.cssSelector(DIV_CLASS_DASHLET_PLACEHOLDER + STR)); for (WebElement div : links) { WebElement userLink = div.findElement(By.cssSelector(STR)); ShareLink user = new ShareLink(userLink, drone); WebElement siteLink = div.findElement(By.cssSelector(STR)); ShareLink site = new ShareLink(siteLink, drone); String description = div.findElement(By.cssSelector(STR)).getText(); if (div.findElements(By.cssSelector(STR)).size() > 2) { WebElement documentLink = div.findElement(By.cssSelector(STR)); ShareLink document = new ShareLink(documentLink, drone); activity.add(new ActivityShareLink(user, document, site, description)); } else { activity.add(new ActivityShareLink(user, site, description)); } } } catch (NoSuchElementException nse) { throw new PageException(STR, nse); } }
/** * Populates all the possible links that appear on the dashlet * data view, the links are of user, document or site. * * @param selector css placeholder for the dashlet data */
Populates all the possible links that appear on the dashlet data view, the links are of user, document or site
populateData
{ "repo_name": "loftuxab/community-edition-old", "path": "projects/share-po/src/main/java/org/alfresco/po/share/dashlet/MyActivitiesDashlet.java", "license": "lgpl-3.0", "size": 8637 }
[ "java.util.ArrayList", "java.util.List", "org.alfresco.po.share.ShareLink", "org.alfresco.webdrone.exception.PageException", "org.openqa.selenium.By", "org.openqa.selenium.NoSuchElementException", "org.openqa.selenium.WebElement" ]
import java.util.ArrayList; import java.util.List; import org.alfresco.po.share.ShareLink; import org.alfresco.webdrone.exception.PageException; import org.openqa.selenium.By; import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement;
import java.util.*; import org.alfresco.po.share.*; import org.alfresco.webdrone.exception.*; import org.openqa.selenium.*;
[ "java.util", "org.alfresco.po", "org.alfresco.webdrone", "org.openqa.selenium" ]
java.util; org.alfresco.po; org.alfresco.webdrone; org.openqa.selenium;
2,081,173
public InetSocketAddress getXferAddress() { return streamingAddr; }
InetSocketAddress function() { return streamingAddr; }
/** * NB: The datanode can perform data transfer on the streaming * address however clients are given the IPC IP address for data * transfer, and that may be a different address. * * @return socket address for data transfer */
address however clients are given the IPC IP address for data transfer, and that may be a different address
getXferAddress
{ "repo_name": "VicoWu/hadoop-2.7.3", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java", "license": "apache-2.0", "size": 119126 }
[ "java.net.InetSocketAddress" ]
import java.net.InetSocketAddress;
import java.net.*;
[ "java.net" ]
java.net;
202,054
public Kernel getKernel() { return kernel; }
Kernel function() { return kernel; }
/** * Get the convolution kernel. * @return the kernel * @see #setKernel */
Get the convolution kernel
getKernel
{ "repo_name": "andrew-dixon/Lucee4", "path": "lucee-java/lucee-core/src/lucee/runtime/img/filter/ConvolveFilter.java", "license": "lgpl-2.1", "size": 14915 }
[ "java.awt.image.Kernel" ]
import java.awt.image.Kernel;
import java.awt.image.*;
[ "java.awt" ]
java.awt;
2,890,858
public static boolean isTopicCached(Topic topic) { if (!SystemGlobals.getBoolValue(ConfigKeys.TOPIC_CACHE_ENABLED)) { return false; } String forumId = Integer.toString(topic.getForumId()); List<Topic> list = (List<Topic>) cache.get(FQN_FORUM, forumId); return list == null ? false : list.contains(topic); }
static boolean function(Topic topic) { if (!SystemGlobals.getBoolValue(ConfigKeys.TOPIC_CACHE_ENABLED)) { return false; } String forumId = Integer.toString(topic.getForumId()); List<Topic> list = (List<Topic>) cache.get(FQN_FORUM, forumId); return list == null ? false : list.contains(topic); }
/** * Checks if a topic is cached * * @param topic * The topic to verify * @return <code>true</code> if the topic is cached, or <code>false</code> * if not. */
Checks if a topic is cached
isTopicCached
{ "repo_name": "3mtee/jforum", "path": "target/jforum/src/main/java/net/jforum/repository/TopicRepository.java", "license": "bsd-3-clause", "size": 13040 }
[ "java.util.List", "net.jforum.entities.Topic", "net.jforum.util.preferences.ConfigKeys", "net.jforum.util.preferences.SystemGlobals" ]
import java.util.List; import net.jforum.entities.Topic; import net.jforum.util.preferences.ConfigKeys; import net.jforum.util.preferences.SystemGlobals;
import java.util.*; import net.jforum.entities.*; import net.jforum.util.preferences.*;
[ "java.util", "net.jforum.entities", "net.jforum.util" ]
java.util; net.jforum.entities; net.jforum.util;
127,480
public static List<Org> lookupAllOrgs() { Map<String, Object> params = new HashMap<String, Object>(); return singleton.listObjectsByNamedQuery( "Org.findAll", params); }
static List<Org> function() { Map<String, Object> params = new HashMap<String, Object>(); return singleton.listObjectsByNamedQuery( STR, params); }
/** * Lookup all orgs on the satellite. * @return List of orgs. */
Lookup all orgs on the satellite
lookupAllOrgs
{ "repo_name": "ogajduse/spacewalk", "path": "java/code/src/com/redhat/rhn/domain/org/OrgFactory.java", "license": "gpl-2.0", "size": 13718 }
[ "java.util.HashMap", "java.util.List", "java.util.Map" ]
import java.util.HashMap; import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,604,055
OptionalValue<Living> lastAttacker();
OptionalValue<Living> lastAttacker();
/** * Gets the {@link OptionalValue} for the last attacker. * * @return The last attacker as an optional value * @see Keys#LAST_ATTACKER */
Gets the <code>OptionalValue</code> for the last attacker
lastAttacker
{ "repo_name": "JBYoshi/SpongeAPI", "path": "src/main/java/org/spongepowered/api/data/manipulator/mutable/entity/DamageableData.java", "license": "mit", "size": 2545 }
[ "org.spongepowered.api.data.value.mutable.OptionalValue", "org.spongepowered.api.entity.living.Living" ]
import org.spongepowered.api.data.value.mutable.OptionalValue; import org.spongepowered.api.entity.living.Living;
import org.spongepowered.api.data.value.mutable.*; import org.spongepowered.api.entity.living.*;
[ "org.spongepowered.api" ]
org.spongepowered.api;
347,504
public List<ApplicationGatewayHttpListener> httpListeners() { return this.httpListeners; }
List<ApplicationGatewayHttpListener> function() { return this.httpListeners; }
/** * Get the httpListeners property: Http listeners of the application gateway resource. For default limits, see * [Application Gateway * limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @return the httpListeners value. */
Get the httpListeners property: Http listeners of the application gateway resource. For default limits, see [Application Gateway limits](HREF)
httpListeners
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/ApplicationGatewayPropertiesFormat.java", "license": "mit", "size": 40780 }
[ "com.azure.resourcemanager.network.models.ApplicationGatewayHttpListener", "java.util.List" ]
import com.azure.resourcemanager.network.models.ApplicationGatewayHttpListener; import java.util.List;
import com.azure.resourcemanager.network.models.*; import java.util.*;
[ "com.azure.resourcemanager", "java.util" ]
com.azure.resourcemanager; java.util;
121,017
@Component public static Action getLastAction(CommandExecutor executor) { HistoryContainer container = executor.getSessions().getSession(HistoryContainer.class); return container.getLastAction(); }
static Action function(CommandExecutor executor) { HistoryContainer container = executor.getSessions().getSession(HistoryContainer.class); return container.getLastAction(); }
/** * The last executed action that has not been undone. * * @param executor The executor to query. * @return The last action. */
The last executed action that has not been undone
getLastAction
{ "repo_name": "StuxSoftware/SimpleDev", "path": "Commands/src/main/java/net/stuxcrystal/simpledev/commands/contrib/history/HistoryComponent.java", "license": "apache-2.0", "size": 2774 }
[ "net.stuxcrystal.simpledev.commands.CommandExecutor" ]
import net.stuxcrystal.simpledev.commands.CommandExecutor;
import net.stuxcrystal.simpledev.commands.*;
[ "net.stuxcrystal.simpledev" ]
net.stuxcrystal.simpledev;
2,507,004
public static ZoneListOption dnsName(String dnsName) { return new ZoneListOption(DnsRpc.Option.DNS_NAME, dnsName); }
static ZoneListOption function(String dnsName) { return new ZoneListOption(DnsRpc.Option.DNS_NAME, dnsName); }
/** * Restricts the list to only zone with this fully qualified domain name. */
Restricts the list to only zone with this fully qualified domain name
dnsName
{ "repo_name": "mbrukman/gcloud-java", "path": "google-cloud-dns/src/main/java/com/google/cloud/dns/Dns.java", "license": "apache-2.0", "size": 18116 }
[ "com.google.cloud.dns.spi.v1.DnsRpc" ]
import com.google.cloud.dns.spi.v1.DnsRpc;
import com.google.cloud.dns.spi.v1.*;
[ "com.google.cloud" ]
com.google.cloud;
2,669,926
public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { super.init(rs, context, node); }
void function(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException { super.init(rs, context, node); }
/** * simple init - init the tree and get the elementKey from * the AST * @param rs * @param context * @param node * @throws TemplateInitException */
simple init - init the tree and get the elementKey from the AST
init
{ "repo_name": "gogamoga/velocity-engine-1.6.4", "path": "src/java/org/apache/velocity/runtime/directive/Break.java", "license": "apache-2.0", "size": 3651 }
[ "org.apache.velocity.context.InternalContextAdapter", "org.apache.velocity.exception.TemplateInitException", "org.apache.velocity.runtime.RuntimeServices", "org.apache.velocity.runtime.parser.node.Node" ]
import org.apache.velocity.context.InternalContextAdapter; import org.apache.velocity.exception.TemplateInitException; import org.apache.velocity.runtime.RuntimeServices; import org.apache.velocity.runtime.parser.node.Node;
import org.apache.velocity.context.*; import org.apache.velocity.exception.*; import org.apache.velocity.runtime.*; import org.apache.velocity.runtime.parser.node.*;
[ "org.apache.velocity" ]
org.apache.velocity;
2,237,393
public boolean isInProgressCommand(CommandReport report) { HostRoleCommand command = db.getTask(report.getTaskId()); if (command == null) { LOG.warn("The task " + report.getTaskId() + " is invalid"); return false; } return command.getStatus().equals(HostRoleStatus.IN_PROGRESS) || command.getStatus().equals(HostRoleStatus.QUEUED); }
boolean function(CommandReport report) { HostRoleCommand command = db.getTask(report.getTaskId()); if (command == null) { LOG.warn(STR + report.getTaskId() + STR); return false; } return command.getStatus().equals(HostRoleStatus.IN_PROGRESS) command.getStatus().equals(HostRoleStatus.QUEUED); }
/** * Find if the command report is for an in progress command * @param report * @return */
Find if the command report is for an in progress command
isInProgressCommand
{ "repo_name": "alexryndin/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java", "license": "apache-2.0", "size": 8688 }
[ "org.apache.ambari.server.agent.CommandReport" ]
import org.apache.ambari.server.agent.CommandReport;
import org.apache.ambari.server.agent.*;
[ "org.apache.ambari" ]
org.apache.ambari;
769,394
@Override public void setGradientVector(Vector gradientVector) { this.gradientVector = gradientVector; }
void function(Vector gradientVector) { this.gradientVector = gradientVector; }
/** * set gradient vector. */
set gradient vector
setGradientVector
{ "repo_name": "buralin/Yoinkchange", "path": "yoink-core-density/src/main/java/org/wallerlab/yoink/density/domain/SimpleDensityPoint.java", "license": "apache-2.0", "size": 2445 }
[ "org.wallerlab.yoink.api.service.math.Vector" ]
import org.wallerlab.yoink.api.service.math.Vector;
import org.wallerlab.yoink.api.service.math.*;
[ "org.wallerlab.yoink" ]
org.wallerlab.yoink;
1,328,982
public static FastDateFormat getInstance(final String pattern, final TimeZone timeZone) { return cache.getInstance(pattern, timeZone, null); }
static FastDateFormat function(final String pattern, final TimeZone timeZone) { return cache.getInstance(pattern, timeZone, null); }
/** * <p>Gets a formatter instance using the specified pattern and * time zone.</p> * * @param pattern {@link java.text.SimpleDateFormat} compatible * pattern * @param timeZone optional time zone, overrides time zone of * formatted date * @return a pattern based date/time formatter * @throws IllegalArgumentException if pattern is invalid */
Gets a formatter instance using the specified pattern and time zone
getInstance
{ "repo_name": "amirlotfi/Nikagram", "path": "app/src/main/java/ir/nikagram/messenger/time/FastDateFormat.java", "license": "gpl-2.0", "size": 22297 }
[ "java.util.TimeZone" ]
import java.util.TimeZone;
import java.util.*;
[ "java.util" ]
java.util;
2,225,578
if (Controller.options.cgCBS()) { numberOfBufferTriples = Controller.options.DCG_SAMPLE_SIZE * VM.CBSCallSamplesPerTick; } else { numberOfBufferTriples = Controller.options.DCG_SAMPLE_SIZE; } numberOfBufferTriples *= RVMThread.availableProcessors; bufferSize = numberOfBufferTriples * 3; buffer = new int[bufferSize]; ((EdgeListener) listener).setBuffer(buffer); thresholdReachedCount = (int)Math.ceil(1.0 /(numberOfBufferTriples * Controller.options.INLINE_AI_HOT_CALLSITE_THRESHOLD));; // Install the edge listener if (Controller.options.cgTimer()) { RuntimeMeasurements.installTimerContextListener((EdgeListener) listener); } else if (Controller.options.cgCBS()) { RuntimeMeasurements.installCBSContextListener((EdgeListener) listener); } else { if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED, "Unexpected value of call_graph_listener_trigger"); } }
if (Controller.options.cgCBS()) { numberOfBufferTriples = Controller.options.DCG_SAMPLE_SIZE * VM.CBSCallSamplesPerTick; } else { numberOfBufferTriples = Controller.options.DCG_SAMPLE_SIZE; } numberOfBufferTriples *= RVMThread.availableProcessors; bufferSize = numberOfBufferTriples * 3; buffer = new int[bufferSize]; ((EdgeListener) listener).setBuffer(buffer); thresholdReachedCount = (int)Math.ceil(1.0 /(numberOfBufferTriples * Controller.options.INLINE_AI_HOT_CALLSITE_THRESHOLD));; if (Controller.options.cgTimer()) { RuntimeMeasurements.installTimerContextListener((EdgeListener) listener); } else if (Controller.options.cgCBS()) { RuntimeMeasurements.installCBSContextListener((EdgeListener) listener); } else { if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED, STR); } }
/** * Initialization: set up data structures and sampling objects. * <p> * Uses either timer based sampling or counter based sampling, * depending on {@link Controller#options}. */
Initialization: set up data structures and sampling objects. Uses either timer based sampling or counter based sampling, depending on <code>Controller#options</code>
initialize
{ "repo_name": "CodeOffloading/JikesRVM-CCO", "path": "jikesrvm-3.1.3/rvm/src/org/jikesrvm/adaptive/measurements/organizers/DynamicCallGraphOrganizer.java", "license": "epl-1.0", "size": 10691 }
[ "org.jikesrvm.adaptive.controller.Controller", "org.jikesrvm.adaptive.measurements.RuntimeMeasurements", "org.jikesrvm.adaptive.measurements.listeners.EdgeListener", "org.jikesrvm.scheduler.RVMThread" ]
import org.jikesrvm.adaptive.controller.Controller; import org.jikesrvm.adaptive.measurements.RuntimeMeasurements; import org.jikesrvm.adaptive.measurements.listeners.EdgeListener; import org.jikesrvm.scheduler.RVMThread;
import org.jikesrvm.adaptive.controller.*; import org.jikesrvm.adaptive.measurements.*; import org.jikesrvm.adaptive.measurements.listeners.*; import org.jikesrvm.scheduler.*;
[ "org.jikesrvm.adaptive", "org.jikesrvm.scheduler" ]
org.jikesrvm.adaptive; org.jikesrvm.scheduler;
2,454,750
protected void runWildCardCmd(AlluxioURI wildCardPath, CommandLine cl) throws IOException { List<AlluxioURI> paths = FileSystemShellUtils.getAlluxioURIs(mFileSystem, wildCardPath); if (paths.size() == 0) { // A unified sanity check on the paths throw new IOException(wildCardPath + " does not exist."); } paths.sort(Comparator.comparing(AlluxioURI::getPath)); // TODO(lu) if errors occur in runPlainPath, we may not want to print header processHeader(cl); List<String> errorMessages = new ArrayList<>(); for (AlluxioURI path : paths) { try { runPlainPath(path, cl); } catch (AlluxioException | IOException e) { errorMessages.add(e.getMessage() != null ? e.getMessage() : e.toString()); } } if (errorMessages.size() != 0) { throw new IOException(Joiner.on('\n').join(errorMessages)); } }
void function(AlluxioURI wildCardPath, CommandLine cl) throws IOException { List<AlluxioURI> paths = FileSystemShellUtils.getAlluxioURIs(mFileSystem, wildCardPath); if (paths.size() == 0) { throw new IOException(wildCardPath + STR); } paths.sort(Comparator.comparing(AlluxioURI::getPath)); processHeader(cl); List<String> errorMessages = new ArrayList<>(); for (AlluxioURI path : paths) { try { runPlainPath(path, cl); } catch (AlluxioException IOException e) { errorMessages.add(e.getMessage() != null ? e.getMessage() : e.toString()); } } if (errorMessages.size() != 0) { throw new IOException(Joiner.on('\n').join(errorMessages)); } }
/** * Runs the command for a particular URI that may contain wildcard in its path. * * @param wildCardPath an AlluxioURI that may or may not contain a wildcard * @param cl object containing the original commandLine */
Runs the command for a particular URI that may contain wildcard in its path
runWildCardCmd
{ "repo_name": "apc999/alluxio", "path": "shell/src/main/java/alluxio/cli/fs/command/AbstractFileSystemCommand.java", "license": "apache-2.0", "size": 3062 }
[ "com.google.common.base.Joiner", "java.io.IOException", "java.util.ArrayList", "java.util.Comparator", "java.util.List", "org.apache.commons.cli.CommandLine" ]
import com.google.common.base.Joiner; import java.io.IOException; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import org.apache.commons.cli.CommandLine;
import com.google.common.base.*; import java.io.*; import java.util.*; import org.apache.commons.cli.*;
[ "com.google.common", "java.io", "java.util", "org.apache.commons" ]
com.google.common; java.io; java.util; org.apache.commons;
490,892
void setTypeRoot(ITypeRoot typeRoot) { this.typeRoot = typeRoot; }
void setTypeRoot(ITypeRoot typeRoot) { this.typeRoot = typeRoot; }
/** * Sets the JavaScript type root (a {@link org.eclipse.wst.jsdt.core.IJavaScriptUnit javaScript unit} or a {@link org.eclipse.wst.jsdt.core.IClassFile class file}) * this javaScript unit was created from, or <code>null</code> if it was not created from a JavaScript type root. * * @param typeRoot the JavaScript type root this javaScript unit was created from */
Sets the JavaScript type root (a <code>org.eclipse.wst.jsdt.core.IJavaScriptUnit javaScript unit</code> or a <code>org.eclipse.wst.jsdt.core.IClassFile class file</code>) this javaScript unit was created from, or <code>null</code> if it was not created from a JavaScript type root
setTypeRoot
{ "repo_name": "boniatillo-com/PhaserEditor", "path": "source/thirdparty/jsdt/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/dom/JavaScriptUnit.java", "license": "epl-1.0", "size": 37724 }
[ "org.eclipse.wst.jsdt.core.ITypeRoot" ]
import org.eclipse.wst.jsdt.core.ITypeRoot;
import org.eclipse.wst.jsdt.core.*;
[ "org.eclipse.wst" ]
org.eclipse.wst;
1,989,177
public boolean hasColumn(String table, String column) { if (table == null || column == null) { return false; } else { Set<String> columnNames = tableColumnNames.get().get(table.toLowerCase(Locale.ENGLISH)); return columnNames != null && columnNames.contains(column.toLowerCase(Locale.ENGLISH)); } } private transient volatile boolean hasInRowIndex; private transient volatile boolean comparesIgnoreCase; private final transient PeriodicValue<Map<String, Set<String>>> tableColumnNames = new PeriodicValue<Map<String, Set<String>>>(0.0, 60.0) {
boolean function(String table, String column) { if (table == null column == null) { return false; } else { Set<String> columnNames = tableColumnNames.get().get(table.toLowerCase(Locale.ENGLISH)); return columnNames != null && columnNames.contains(column.toLowerCase(Locale.ENGLISH)); } } private transient volatile boolean hasInRowIndex; private transient volatile boolean comparesIgnoreCase; private final transient PeriodicValue<Map<String, Set<String>>> tableColumnNames = new PeriodicValue<Map<String, Set<String>>>(0.0, 60.0) {
/** * Returns {@code true} if the given {@code table} in this database * contains the given {@code column}. * * @param table If {@code null}, always returns {@code false}. * @param column If {@code null}, always returns {@code false}. */
Returns true if the given table in this database contains the given column
hasColumn
{ "repo_name": "iamedu/dari", "path": "db/src/main/java/com/psddev/dari/db/SqlDatabase.java", "license": "bsd-3-clause", "size": 131821 }
[ "com.psddev.dari.util.PeriodicValue", "java.util.Locale", "java.util.Map", "java.util.Set" ]
import com.psddev.dari.util.PeriodicValue; import java.util.Locale; import java.util.Map; import java.util.Set;
import com.psddev.dari.util.*; import java.util.*;
[ "com.psddev.dari", "java.util" ]
com.psddev.dari; java.util;
2,163,608
byte[] getContents(); /** * Gets the claimed signing time * * @return {@link Date}
byte[] getContents(); /** * Gets the claimed signing time * * @return {@link Date}
/** * Gets /Contents binaries (CMSSignedData) * * @return /Contents binaries */
Gets /Contents binaries (CMSSignedData)
getContents
{ "repo_name": "esig/dss", "path": "dss-pades/src/main/java/eu/europa/esig/dss/pades/validation/PdfSignatureDictionary.java", "license": "lgpl-2.1", "size": 2675 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
343,197
void setAutoScroll(@Nonnull AutoScroll auto);
void setAutoScroll(@Nonnull AutoScroll auto);
/** * Set auto scroll mode. * * @param auto auto scroll mode */
Set auto scroll mode
setAutoScroll
{ "repo_name": "void256/nifty-gui", "path": "nifty-controls/src/main/java/de/lessvoid/nifty/controls/ScrollPanel.java", "license": "bsd-2-clause", "size": 2271 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,156,896
@SuppressWarnings("unchecked") public Object getFieldValue(Object obj, String name) { if (obj == null) { throw new IllegalArgumentException("obj cannot be null"); } if (name == null || "".equals(name)) { throw new IllegalArgumentException("field name cannot be null or blank"); } // Resolve nested references Holder holder = unpackNestedName(name, obj, false); name = holder.getName(); obj = holder.getObject(); Object value; if (Map.class.isAssignableFrom(obj.getClass())) { value = getValueOfMap((Map) obj, name); } else if (getResolver().isMapped(name)) { value = getMappedValue(obj, name); } else if (getResolver().isIndexed(name)) { value = getIndexedValue(obj, name); } else { value = getSimpleValue(obj, name); } return value; }
@SuppressWarnings(STR) Object function(Object obj, String name) { if (obj == null) { throw new IllegalArgumentException(STR); } if (name == null STRfield name cannot be null or blank"); } Holder holder = unpackNestedName(name, obj, false); name = holder.getName(); obj = holder.getObject(); Object value; if (Map.class.isAssignableFrom(obj.getClass())) { value = getValueOfMap((Map) obj, name); } else if (getResolver().isMapped(name)) { value = getMappedValue(obj, name); } else if (getResolver().isIndexed(name)) { value = getIndexedValue(obj, name); } else { value = getSimpleValue(obj, name); } return value; }
/** * Get the value of a field on an object, * name can be nested, indexed, or mapped * @param obj any object * @param name the name of a field on this object * @return the value of the field * @throws FieldnameNotFoundException if this field name is invalid for this object * @throws FieldGetValueException if the field is not readable or not visible * @throws IllegalArgumentException if there is a failure getting the value */
Get the value of a field on an object, name can be nested, indexed, or mapped
getFieldValue
{ "repo_name": "azeckoski/reflectutils", "path": "src/main/java/org/azeckoski/reflectutils/FieldUtils.java", "license": "apache-2.0", "size": 60622 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,853,634
public void setDecodeParms(List<?> decodeParams) { stream.setItem(COSName.DECODE_PARMS, COSArrayList.converterToCOSArray(decodeParams)); }
void function(List<?> decodeParams) { stream.setItem(COSName.DECODE_PARMS, COSArrayList.converterToCOSArray(decodeParams)); }
/** * This will set the list of decode parameterss. * * @param decodeParams The list of decode parameterss. */
This will set the list of decode parameterss
setDecodeParms
{ "repo_name": "sencko/NALB", "path": "nalb2013/src/org/apache/pdfbox/pdmodel/common/PDStream.java", "license": "gpl-2.0", "size": 15155 }
[ "java.util.List", "org.apache.pdfbox.cos.COSName" ]
import java.util.List; import org.apache.pdfbox.cos.COSName;
import java.util.*; import org.apache.pdfbox.cos.*;
[ "java.util", "org.apache.pdfbox" ]
java.util; org.apache.pdfbox;
1,537,809
private void ensureDataExists() throws NoDataException, DatabaseException { final CveDB cve = new CveDB(); try { cve.open(); if (!cve.dataExists()) { throw new NoDataException("No documents exist"); } } catch (DatabaseException ex) { throw new NoDataException(ex.getMessage(), ex); } finally { cve.close(); } }
void function() throws NoDataException, DatabaseException { final CveDB cve = new CveDB(); try { cve.open(); if (!cve.dataExists()) { throw new NoDataException(STR); } } catch (DatabaseException ex) { throw new NoDataException(ex.getMessage(), ex); } finally { cve.close(); } }
/** * Checks the CPE Index to ensure documents exists. If none exist a NoDataException is thrown. * * @throws NoDataException thrown if no data exists in the CPE Index * @throws DatabaseException thrown if there is an exception opening the database */
Checks the CPE Index to ensure documents exists. If none exist a NoDataException is thrown
ensureDataExists
{ "repo_name": "wmaintw/DependencyCheck", "path": "dependency-check-core/src/main/java/org/owasp/dependencycheck/Engine.java", "license": "apache-2.0", "size": 18726 }
[ "org.owasp.dependencycheck.data.nvdcve.CveDB", "org.owasp.dependencycheck.data.nvdcve.DatabaseException", "org.owasp.dependencycheck.exception.NoDataException" ]
import org.owasp.dependencycheck.data.nvdcve.CveDB; import org.owasp.dependencycheck.data.nvdcve.DatabaseException; import org.owasp.dependencycheck.exception.NoDataException;
import org.owasp.dependencycheck.data.nvdcve.*; import org.owasp.dependencycheck.exception.*;
[ "org.owasp.dependencycheck" ]
org.owasp.dependencycheck;
2,560,848
public static nl.b3p.kaartenbalie.reporting.castor.ResponseTime unmarshal(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (nl.b3p.kaartenbalie.reporting.castor.ResponseTime) Unmarshaller.unmarshal(nl.b3p.kaartenbalie.reporting.castor.ResponseTime.class, reader); } //-- nl.b3p.kaartenbalie.reporting.castor.ResponseTime unmarshal(java.io.Reader)
static nl.b3p.kaartenbalie.reporting.castor.ResponseTime function(java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (nl.b3p.kaartenbalie.reporting.castor.ResponseTime) Unmarshaller.unmarshal(nl.b3p.kaartenbalie.reporting.castor.ResponseTime.class, reader); }
/** * Method unmarshal * * * * @param reader * @return ResponseTime */
Method unmarshal
unmarshal
{ "repo_name": "B3Partners/kaartenbalie", "path": "src/main/java/nl/b3p/kaartenbalie/reporting/castor/ResponseTime.java", "license": "lgpl-3.0", "size": 6505 }
[ "org.exolab.castor.xml.Unmarshaller" ]
import org.exolab.castor.xml.Unmarshaller;
import org.exolab.castor.xml.*;
[ "org.exolab.castor" ]
org.exolab.castor;
2,511,255
public IJarDescriptionWriter createJarDescriptionWriter(OutputStream outputStream) { return new JarPackageWriter(outputStream, "UTF-8"); //$NON-NLS-1$ }
IJarDescriptionWriter function(OutputStream outputStream) { return new JarPackageWriter(outputStream, "UTF-8"); }
/** * Creates and returns a JAR package data description writer * for this JAR package data object. * <p> * It is the client's responsibility to close this writer. * </p> * @param outputStream the output stream to write to * @return a JarWriter * @deprecated Use {@link #createJarDescriptionWriter(OutputStream, String)} instead */
Creates and returns a JAR package data description writer for this JAR package data object. It is the client's responsibility to close this writer.
createJarDescriptionWriter
{ "repo_name": "brunyuriy/quick-fix-scout", "path": "org.eclipse.jdt.ui_3.7.1.r371_v20110824-0800/src/org/eclipse/jdt/ui/jarpackager/JarPackageData.java", "license": "mit", "size": 33486 }
[ "java.io.OutputStream", "org.eclipse.jdt.internal.ui.jarpackager.JarPackageWriter" ]
import java.io.OutputStream; import org.eclipse.jdt.internal.ui.jarpackager.JarPackageWriter;
import java.io.*; import org.eclipse.jdt.internal.ui.jarpackager.*;
[ "java.io", "org.eclipse.jdt" ]
java.io; org.eclipse.jdt;
1,333,786
//------------------------- AUTOGENERATED START ------------------------- ///CLOVER:OFF public static CapFloorCMSSpreadSecurity.Meta meta() { return CapFloorCMSSpreadSecurity.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(CapFloorCMSSpreadSecurity.Meta.INSTANCE); }
static CapFloorCMSSpreadSecurity.Meta function() { return CapFloorCMSSpreadSecurity.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(CapFloorCMSSpreadSecurity.Meta.INSTANCE); }
/** * The meta-bean for {@code CapFloorCMSSpreadSecurity}. * @return the meta-bean, not null */
The meta-bean for CapFloorCMSSpreadSecurity
meta
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-FinancialTypes/src/main/java/com/opengamma/financial/security/capfloor/CapFloorCMSSpreadSecurity.java", "license": "apache-2.0", "size": 25415 }
[ "org.joda.beans.JodaBeanUtils" ]
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
185,285
private void toggleBottomSheetVisibility(boolean collapse, boolean animate) { if (MusicUtils.getQueue().isEmpty()) { multiSheetView.hide(collapse, false); } else if (MiniPlayerLockManager.getInstance().canShowMiniPlayer()) { multiSheetView.unhide(animate); } }
void function(boolean collapse, boolean animate) { if (MusicUtils.getQueue().isEmpty()) { multiSheetView.hide(collapse, false); } else if (MiniPlayerLockManager.getInstance().canShowMiniPlayer()) { multiSheetView.unhide(animate); } }
/** * Hide/show the bottom sheet, depending on whether the queue is empty. */
Hide/show the bottom sheet, depending on whether the queue is empty
toggleBottomSheetVisibility
{ "repo_name": "willcoughlin/Shuttle", "path": "app/src/main/java/com/simplecity/amp_library/ui/fragments/MainController.java", "license": "gpl-3.0", "size": 11770 }
[ "com.simplecity.amp_library.ui.drawer.MiniPlayerLockManager", "com.simplecity.amp_library.utils.MusicUtils" ]
import com.simplecity.amp_library.ui.drawer.MiniPlayerLockManager; import com.simplecity.amp_library.utils.MusicUtils;
import com.simplecity.amp_library.ui.drawer.*; import com.simplecity.amp_library.utils.*;
[ "com.simplecity.amp_library" ]
com.simplecity.amp_library;
55,583
public static int getRecordLength(ExternalRecord externalRecord, int fileStructure) { int recordByteLength = 0; for (ExternalField field : externalRecord.getRecordFields()) { recordByteLength += field.getLen(); } return recordByteLength; }
static int function(ExternalRecord externalRecord, int fileStructure) { int recordByteLength = 0; for (ExternalField field : externalRecord.getRecordFields()) { recordByteLength += field.getLen(); } return recordByteLength; }
/** * Get record length for each line * * @param externalRecord ExternalRecord object defining the schema fields and their properties * @param fileStructure File structure of the data file * @return the record length of each line */
Get record length for each line
getRecordLength
{ "repo_name": "romy-khetan/hydrator-plugins", "path": "copybookreader-plugins/src/main/java/co/cask/hydrator/plugin/batch/CopybookIOUtils.java", "license": "apache-2.0", "size": 2986 }
[ "net.sf.JRecord" ]
import net.sf.JRecord;
import net.sf.*;
[ "net.sf" ]
net.sf;
270,960
public interface ImageListener extends ErrorListener { public void onResponse(ImageContainer response, boolean isImmediate); }
interface ImageListener extends ErrorListener { public void function(ImageContainer response, boolean isImmediate); }
/** * Listens for non-error changes to the loading of the image request. * * @param response * Holds all information pertaining to the request, as well * as the bitmap (if it is loaded). * @param isImmediate * True if this was called during ImageLoader.get() variants. * This can be used to differentiate between a cached image * loading and a network image loading in order to, for * example, run an animation to fade in network loaded * images. */
Listens for non-error changes to the loading of the image request
onResponse
{ "repo_name": "dim1989/zhangzhoujun.github.io", "path": "MyVolley/app/src/main/java/com/android/myvolley/volley/toolbox/ImageLoader.java", "license": "epl-1.0", "size": 20161 }
[ "com.android.myvolley.volley.Response" ]
import com.android.myvolley.volley.Response;
import com.android.myvolley.volley.*;
[ "com.android.myvolley" ]
com.android.myvolley;
393,369
public Object[] prepareParams(WebSocketHandler wHandler, ParameterDescriptor[] descriptors, Object request);
Object[] function(WebSocketHandler wHandler, ParameterDescriptor[] descriptors, Object request);
/** * Prepares parameters for method invocation. * * @see RequestData * @param wHandler Handler for current connection * @param descriptors Parameter type definitions in order of their placing in method signature * @param request Request data from which parameter values will be taken. This is "request" field of <code>RequestData</code> */
Prepares parameters for method invocation
prepareParams
{ "repo_name": "estliberitas/websocket-service", "path": "src/main/java/info/liberitas/wss/messaging/MessageParser.java", "license": "mit", "size": 1390 }
[ "info.liberitas.wss.api.WebSocketHandler", "info.liberitas.wss.routing.ParameterDescriptor" ]
import info.liberitas.wss.api.WebSocketHandler; import info.liberitas.wss.routing.ParameterDescriptor;
import info.liberitas.wss.api.*; import info.liberitas.wss.routing.*;
[ "info.liberitas.wss" ]
info.liberitas.wss;
1,199,800
public static List<byte[]> readBytesList(DataInput in) throws IOException { int size = in.readInt(); if (size < 0) return null; List<byte[]> res = new ArrayList<>(size); for (int i = 0; i < size; i++) res.add(readByteArray(in)); return res; }
static List<byte[]> function(DataInput in) throws IOException { int size = in.readInt(); if (size < 0) return null; List<byte[]> res = new ArrayList<>(size); for (int i = 0; i < size; i++) res.add(readByteArray(in)); return res; }
/** * Reads collection of byte arrays from data input. * * @param in Data input to read from. * @return List of byte arrays. * @throws java.io.IOException If read failed. */
Reads collection of byte arrays from data input
readBytesList
{ "repo_name": "kromulan/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 298812 }
[ "java.io.DataInput", "java.io.IOException", "java.util.ArrayList", "java.util.List" ]
import java.io.DataInput; import java.io.IOException; import java.util.ArrayList; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,316,214
public String getType() { return getLocalAttribute(Constants._ATT_TYPE); }
String function() { return getLocalAttribute(Constants._ATT_TYPE); }
/** * Return the <code>type</code> atttibute of the Reference indicate whether an * <code>ds:Object</code>, <code>ds:SignatureProperty</code>, or <code>ds:Manifest</code> * element * * @return the <code>type</code> attribute of the Reference */
Return the <code>type</code> atttibute of the Reference indicate whether an <code>ds:Object</code>, <code>ds:SignatureProperty</code>, or <code>ds:Manifest</code> element
getType
{ "repo_name": "Legostaev/xmlsec-gost", "path": "src/main/java/org/apache/xml/security/signature/Reference.java", "license": "apache-2.0", "size": 29792 }
[ "org.apache.xml.security.utils.Constants" ]
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.*;
[ "org.apache.xml" ]
org.apache.xml;
1,033,310
@Test public void testGetSubtitles() { DefaultPieDataset dataset = new DefaultPieDataset(); JFreeChart chart = ChartFactory.createPieChart("title", dataset); List<Title> subtitles = chart.getSubtitles(); assertEquals(1, chart.getSubtitleCount()); // adding something to the returned list should NOT change the chart subtitles.add(new TextTitle("T")); assertEquals(1, chart.getSubtitleCount()); }
void function() { DefaultPieDataset dataset = new DefaultPieDataset(); JFreeChart chart = ChartFactory.createPieChart("title", dataset); List<Title> subtitles = chart.getSubtitles(); assertEquals(1, chart.getSubtitleCount()); subtitles.add(new TextTitle("T")); assertEquals(1, chart.getSubtitleCount()); }
/** * Some checks for the getSubtitles() method. */
Some checks for the getSubtitles() method
testGetSubtitles
{ "repo_name": "akardapolov/ASH-Viewer", "path": "jfreechart-fse/src/test/java/org/jfree/chart/JFreeChartTest.java", "license": "gpl-3.0", "size": 19223 }
[ "java.util.List", "org.jfree.chart.title.TextTitle", "org.jfree.chart.title.Title", "org.jfree.data.general.DefaultPieDataset", "org.junit.Assert" ]
import java.util.List; import org.jfree.chart.title.TextTitle; import org.jfree.chart.title.Title; import org.jfree.data.general.DefaultPieDataset; import org.junit.Assert;
import java.util.*; import org.jfree.chart.title.*; import org.jfree.data.general.*; import org.junit.*;
[ "java.util", "org.jfree.chart", "org.jfree.data", "org.junit" ]
java.util; org.jfree.chart; org.jfree.data; org.junit;
1,358,200
public static boolean isAuthorizedToAdd(HttpServletRequest req, Statement stmt, OntModel modelToBeModified) { if ((req == null) || (stmt == null) || (modelToBeModified == null)) { return false; } Resource subject = stmt.getSubject(); org.apache.jena.rdf.model.Property predicate = stmt.getPredicate(); RDFNode objectNode = stmt.getObject(); if ((subject == null) || (predicate == null) || (objectNode == null)) { return false; } RequestedAction action; if (objectNode.isResource()) { Property property = new Property(predicate.getURI()); property.setDomainVClassURI(SOME_URI); property.setRangeVClassURI(SOME_URI); action = new AddObjectPropertyStatement(modelToBeModified, subject.getURI(), property, objectNode.asResource() .getURI()); } else { action = new AddDataPropertyStatement(modelToBeModified, subject.getURI(), predicate.getURI(), objectNode .asLiteral().getString()); } return isAuthorizedForActions(req, action); }
static boolean function(HttpServletRequest req, Statement stmt, OntModel modelToBeModified) { if ((req == null) (stmt == null) (modelToBeModified == null)) { return false; } Resource subject = stmt.getSubject(); org.apache.jena.rdf.model.Property predicate = stmt.getPredicate(); RDFNode objectNode = stmt.getObject(); if ((subject == null) (predicate == null) (objectNode == null)) { return false; } RequestedAction action; if (objectNode.isResource()) { Property property = new Property(predicate.getURI()); property.setDomainVClassURI(SOME_URI); property.setRangeVClassURI(SOME_URI); action = new AddObjectPropertyStatement(modelToBeModified, subject.getURI(), property, objectNode.asResource() .getURI()); } else { action = new AddDataPropertyStatement(modelToBeModified, subject.getURI(), predicate.getURI(), objectNode .asLiteral().getString()); } return isAuthorizedForActions(req, action); }
/** * Do the current policies authorize the current user to add this statement * to this model? * * The statement is expected to be fully-populated, with no null fields. */
Do the current policies authorize the current user to add this statement to this model? The statement is expected to be fully-populated, with no null fields
isAuthorizedToAdd
{ "repo_name": "vivo-project/Vitro", "path": "api/src/main/java/edu/cornell/mannlib/vitro/webapp/auth/policy/PolicyHelper.java", "license": "bsd-3-clause", "size": 12236 }
[ "edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction", "edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddDataPropertyStatement", "edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddObjectPropertyStatement", "edu.cornell.mannlib.vitro.webapp.beans.Property", "javax.servlet.http.HttpServletRequest", "org.apache.jena.ontology.OntModel", "org.apache.jena.rdf.model.RDFNode", "org.apache.jena.rdf.model.Resource", "org.apache.jena.rdf.model.Statement" ]
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddDataPropertyStatement; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.propstmt.AddObjectPropertyStatement; import edu.cornell.mannlib.vitro.webapp.beans.Property; import javax.servlet.http.HttpServletRequest; import org.apache.jena.ontology.OntModel; import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement;
import edu.cornell.mannlib.vitro.webapp.auth.*; import edu.cornell.mannlib.vitro.webapp.beans.*; import javax.servlet.http.*; import org.apache.jena.ontology.*; import org.apache.jena.rdf.model.*;
[ "edu.cornell.mannlib", "javax.servlet", "org.apache.jena" ]
edu.cornell.mannlib; javax.servlet; org.apache.jena;
2,307,283
private void classifySingleRecord( SAMRecord record, int readPairId, int mateStart, String mateRef ) { record.setMateReferenceName( mateRef ); record.setMateAlignmentStart( mateStart ); record.setMateUnmappedFlag( mateStart == 0 ); record.setNotPrimaryAlignmentFlag( mateStart != 0 ); record.setAttribute( SAMRecordTag.ReadPairType.toString(), ReadPairType.UNPAIRED_PAIR.getType() ); record.setAttribute( SAMRecordTag.ReadPairId.toString(), readPairId ); this.statsContainer.incReadPairStats( ReadPairType.UNPAIRED_PAIR, 1 ); }
void function( SAMRecord record, int readPairId, int mateStart, String mateRef ) { record.setMateReferenceName( mateRef ); record.setMateAlignmentStart( mateStart ); record.setMateUnmappedFlag( mateStart == 0 ); record.setNotPrimaryAlignmentFlag( mateStart != 0 ); record.setAttribute( SAMRecordTag.ReadPairType.toString(), ReadPairType.UNPAIRED_PAIR.getType() ); record.setAttribute( SAMRecordTag.ReadPairId.toString(), readPairId ); this.statsContainer.incReadPairStats( ReadPairType.UNPAIRED_PAIR, 1 ); }
/** * Adds a single mapping (sam record) to the file writer and sets its read * pair and classification attributes. Remember, that a single mapping can * still belong to a valid read pair (second mapping of one of the two * reads). * <p> * @param record the unpaired record to write * @param readPairId the read pair id of this single mapping * @param mateStart Start position of the mate. 0 for unmapped mates. * @param mateRef Reference name of the mate */
Adds a single mapping (sam record) to the file writer and sets its read pair and classification attributes. Remember, that a single mapping can still belong to a valid read pair (second mapping of one of the two reads).
classifySingleRecord
{ "repo_name": "rhilker/ReadXplorer", "path": "readxplorer-tools-readpairclassifier/src/main/java/de/cebitec/readxplorer/readpairclassifier/SamBamReadPairClassifier.java", "license": "gpl-3.0", "size": 40027 }
[ "de.cebitec.readxplorer.api.enums.ReadPairType", "de.cebitec.readxplorer.api.enums.SAMRecordTag" ]
import de.cebitec.readxplorer.api.enums.ReadPairType; import de.cebitec.readxplorer.api.enums.SAMRecordTag;
import de.cebitec.readxplorer.api.enums.*;
[ "de.cebitec.readxplorer" ]
de.cebitec.readxplorer;
1,663,412
public List<RafPermissionType> findByRafPermissionTypeLike(RafPermissionType rafPermissionType, JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults);
List<RafPermissionType> function(RafPermissionType rafPermissionType, JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults);
/** * findByRafPermissionTypeLike - finds a list of RafPermissionType Like * * @param rafPermissionType * @return the list of RafPermissionType found */
findByRafPermissionTypeLike - finds a list of RafPermissionType Like
findByRafPermissionTypeLike
{ "repo_name": "yauritux/venice-legacy", "path": "Venice/Venice-Interface-Model/src/main/java/com/gdn/venice/facade/RafPermissionTypeSessionEJBRemote.java", "license": "apache-2.0", "size": 2718 }
[ "com.djarum.raf.utilities.JPQLAdvancedQueryCriteria", "com.gdn.venice.persistence.RafPermissionType", "java.util.List" ]
import com.djarum.raf.utilities.JPQLAdvancedQueryCriteria; import com.gdn.venice.persistence.RafPermissionType; import java.util.List;
import com.djarum.raf.utilities.*; import com.gdn.venice.persistence.*; import java.util.*;
[ "com.djarum.raf", "com.gdn.venice", "java.util" ]
com.djarum.raf; com.gdn.venice; java.util;
1,094,264
public HashMap getFields() { return fields; }
HashMap function() { return fields; }
/** * Gets all the fields. The fields are keyed by the fully qualified field name and * the value is an instance of <CODE>AcroFields.Item</CODE>. * * @return all the fields */
Gets all the fields. The fields are keyed by the fully qualified field name and the value is an instance of <code>AcroFields.Item</code>
getFields
{ "repo_name": "joshovi/fossology", "path": "src/nomos/agent_tests/testdata/NomosTestfiles/LGPL/AcroFields.java", "license": "gpl-2.0", "size": 103695 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,209,524
public ArrayList<String> getArrStr() { return arrStr; }
ArrayList<String> function() { return arrStr; }
/** * Get and Set Functions. * @return */
Get and Set Functions
getArrStr
{ "repo_name": "YinYanfei/CadalWorkspace", "path": "Analyzers/src/com/search/analysis/analyze/initial/Paragraph.java", "license": "gpl-3.0", "size": 2473 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,256,917
public List<SqlParameter> getCallParameters() { return this.callParameters; }
List<SqlParameter> function() { return this.callParameters; }
/** * Get the List of SqlParameter objects to be used in call execution. */
Get the List of SqlParameter objects to be used in call execution
getCallParameters
{ "repo_name": "deathspeeder/class-guard", "path": "spring-framework-3.2.x/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java", "license": "gpl-2.0", "size": 22142 }
[ "java.util.List", "org.springframework.jdbc.core.SqlParameter" ]
import java.util.List; import org.springframework.jdbc.core.SqlParameter;
import java.util.*; import org.springframework.jdbc.core.*;
[ "java.util", "org.springframework.jdbc" ]
java.util; org.springframework.jdbc;
290,393
void setVolume(FSVolume vol) { this.volume = vol; }
void setVolume(FSVolume vol) { this.volume = vol; }
/** * Set the volume where this replica is located on disk */
Set the volume where this replica is located on disk
setVolume
{ "repo_name": "steveloughran/hadoop-hdfs", "path": "src/java/org/apache/hadoop/hdfs/server/datanode/ReplicaInfo.java", "license": "apache-2.0", "size": 7832 }
[ "org.apache.hadoop.hdfs.server.datanode.FSDataset" ]
import org.apache.hadoop.hdfs.server.datanode.FSDataset;
import org.apache.hadoop.hdfs.server.datanode.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,329,032
public List<String> column(final int column) { return new ColumnView(column); }
List<String> function(final int column) { return new ColumnView(column); }
/** * Returns a single column. * * @param column column index the column * @return a single column * @throws IndexOutOfBoundsException when {@code column} is outside the * table. */
Returns a single column
column
{ "repo_name": "cucumber/cucumber-jvm", "path": "datatable/src/main/java/io/cucumber/datatable/DataTable.java", "license": "mit", "size": 37412 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
941,900
boolean isHistoryEnabledForPlanItemInstance(PlanItemInstanceEntity planItemInstanceEntity);
boolean isHistoryEnabledForPlanItemInstance(PlanItemInstanceEntity planItemInstanceEntity);
/** * Returns whether history is enabled for the provided plan item instance. */
Returns whether history is enabled for the provided plan item instance
isHistoryEnabledForPlanItemInstance
{ "repo_name": "dbmalkovsky/flowable-engine", "path": "modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/history/CmmnHistoryConfigurationSettings.java", "license": "apache-2.0", "size": 3160 }
[ "org.flowable.cmmn.engine.impl.persistence.entity.PlanItemInstanceEntity" ]
import org.flowable.cmmn.engine.impl.persistence.entity.PlanItemInstanceEntity;
import org.flowable.cmmn.engine.impl.persistence.entity.*;
[ "org.flowable.cmmn" ]
org.flowable.cmmn;
669,589
public List<String> suggestMetrics(final String search) { return metrics.suggest(search); }
List<String> function(final String search) { return metrics.suggest(search); }
/** * Given a prefix search, returns a few matching metric names. * @param search A prefix to search. */
Given a prefix search, returns a few matching metric names
suggestMetrics
{ "repo_name": "rmarshasatx/opentsdb", "path": "src/core/TSDB.java", "license": "gpl-3.0", "size": 15545 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
142,081
public Object execute(final Map<Object, Object> iArgs) { if (attribute == null) throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet"); final OCluster cluster = getCluster(); if (cluster == null) throw new OCommandExecutionException("Cluster '" + clusterName + "' not found"); if (clusterId > -1 && clusterName.equals(String.valueOf(clusterId))) { clusterName = cluster.getName(); } else { clusterId = cluster.getId(); } Object result; try { result = cluster.set(attribute, value); final OStorage storage = getDatabase().getStorage(); if (storage instanceof OLocalPaginatedStorage) ((OLocalPaginatedStorage) storage).synch(); } catch (IOException ioe) { throw new OCommandExecutionException("Error altering cluster '" + clusterName + "'", ioe); } return result; }
Object function(final Map<Object, Object> iArgs) { if (attribute == null) throw new OCommandExecutionException(STR); final OCluster cluster = getCluster(); if (cluster == null) throw new OCommandExecutionException(STR + clusterName + STR); if (clusterId > -1 && clusterName.equals(String.valueOf(clusterId))) { clusterName = cluster.getName(); } else { clusterId = cluster.getId(); } Object result; try { result = cluster.set(attribute, value); final OStorage storage = getDatabase().getStorage(); if (storage instanceof OLocalPaginatedStorage) ((OLocalPaginatedStorage) storage).synch(); } catch (IOException ioe) { throw new OCommandExecutionException(STR + clusterName + "'", ioe); } return result; }
/** * Execute the ALTER CLASS. */
Execute the ALTER CLASS
execute
{ "repo_name": "jdillon/orientdb", "path": "core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLAlterCluster.java", "license": "apache-2.0", "size": 6050 }
[ "com.orientechnologies.orient.core.exception.OCommandExecutionException", "com.orientechnologies.orient.core.storage.OCluster", "com.orientechnologies.orient.core.storage.OStorage", "com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage", "java.io.IOException", "java.util.Map" ]
import com.orientechnologies.orient.core.exception.OCommandExecutionException; import com.orientechnologies.orient.core.storage.OCluster; import com.orientechnologies.orient.core.storage.OStorage; import com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage; import java.io.IOException; import java.util.Map;
import com.orientechnologies.orient.core.exception.*; import com.orientechnologies.orient.core.storage.*; import com.orientechnologies.orient.core.storage.impl.local.paginated.*; import java.io.*; import java.util.*;
[ "com.orientechnologies.orient", "java.io", "java.util" ]
com.orientechnologies.orient; java.io; java.util;
1,752,990
public CountDownLatch getViewEntityContainersAsync(String entityListFullName, String viewName, AsyncCallback<com.mozu.api.contracts.mzdb.EntityContainerCollection> callback) throws Exception { return getViewEntityContainersAsync( entityListFullName, viewName, null, null, null, null, callback); }
CountDownLatch function(String entityListFullName, String viewName, AsyncCallback<com.mozu.api.contracts.mzdb.EntityContainerCollection> callback) throws Exception { return getViewEntityContainersAsync( entityListFullName, viewName, null, null, null, null, callback); }
/** * * <p><pre><code> * ListView listview = new ListView(); * CountDownLatch latch = listview.getViewEntityContainers( entityListFullName, viewName, callback ); * latch.await() * </code></pre></p> * @param entityListFullName The full name of the EntityList including namespace in name@nameSpace format * @param viewName The name for a view. Views are used to render data in , such as document and entity lists. Each view includes a schema, format, name, ID, and associated data types to render. * @param callback callback handler for asynchronous operations * @return com.mozu.api.contracts.mzdb.EntityContainerCollection * @see com.mozu.api.contracts.mzdb.EntityContainerCollection */
<code><code> ListView listview = new ListView(); CountDownLatch latch = listview.getViewEntityContainers( entityListFullName, viewName, callback ); latch.await() * </code></code>
getViewEntityContainersAsync
{ "repo_name": "Mozu/mozu-java", "path": "mozu-javaasync-core/src/main/java/com/mozu/api/resources/platform/entitylists/ListViewResource.java", "license": "mit", "size": 44274 }
[ "com.mozu.api.AsyncCallback", "java.util.concurrent.CountDownLatch" ]
import com.mozu.api.AsyncCallback; import java.util.concurrent.CountDownLatch;
import com.mozu.api.*; import java.util.concurrent.*;
[ "com.mozu.api", "java.util" ]
com.mozu.api; java.util;
409,469
public boolean isCurrentDay() { Calendar cal = Calendar.getInstance(); cal.clear(Calendar.HOUR); cal.clear(Calendar.HOUR_OF_DAY); cal.clear(Calendar.MINUTE); cal.clear(Calendar.SECOND); cal.clear(Calendar.MILLISECOND); return date.equals(cal.getTime()); }
boolean function() { Calendar cal = Calendar.getInstance(); cal.clear(Calendar.HOUR); cal.clear(Calendar.HOUR_OF_DAY); cal.clear(Calendar.MINUTE); cal.clear(Calendar.SECOND); cal.clear(Calendar.MILLISECOND); return date.equals(cal.getTime()); }
/** * Method declaration * @return * @see */
Method declaration
isCurrentDay
{ "repo_name": "CecileBONIN/Silverpeas-Core", "path": "web-core/src/main/java/com/stratelia/webactiv/util/viewGenerator/html/monthCalendar/Day.java", "license": "agpl-3.0", "size": 3730 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
2,813,565
public static void assertXpathsEqual(String controlXpath, String testXpath, Document document) throws XpathException { assertXpathsEqual(controlXpath, document, testXpath, document); }
static void function(String controlXpath, String testXpath, Document document) throws XpathException { assertXpathsEqual(controlXpath, document, testXpath, document); }
/** * Assert that the node lists of two Xpaths in the same document are equal * @param controlXpath * @param testXpath * @param document * @see XpathEngine */
Assert that the node lists of two Xpaths in the same document are equal
assertXpathsEqual
{ "repo_name": "xmlunit/xmlunit", "path": "xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java", "license": "apache-2.0", "size": 47140 }
[ "org.custommonkey.xmlunit.exceptions.XpathException", "org.w3c.dom.Document" ]
import org.custommonkey.xmlunit.exceptions.XpathException; import org.w3c.dom.Document;
import org.custommonkey.xmlunit.exceptions.*; import org.w3c.dom.*;
[ "org.custommonkey.xmlunit", "org.w3c.dom" ]
org.custommonkey.xmlunit; org.w3c.dom;
314,440
public static void setCompoundDrawablesRelativeWithIntrinsicBounds(Button button, Drawable left, Drawable top, Drawable right, Drawable bottom) { if (left != null) { left.setBounds(0, 0, left.getIntrinsicWidth(), left.getIntrinsicHeight()); } if (right != null) { right.setBounds(0, 0, right.getIntrinsicWidth(), right.getIntrinsicHeight()); } if (top != null) { top.setBounds(0, 0, top.getIntrinsicWidth(), top.getIntrinsicHeight()); } if (bottom != null) { bottom.setBounds(0, 0, bottom.getIntrinsicWidth(), bottom.getIntrinsicHeight()); } button.setCompoundDrawables(left, top, right, bottom); }
static void function(Button button, Drawable left, Drawable top, Drawable right, Drawable bottom) { if (left != null) { left.setBounds(0, 0, left.getIntrinsicWidth(), left.getIntrinsicHeight()); } if (right != null) { right.setBounds(0, 0, right.getIntrinsicWidth(), right.getIntrinsicHeight()); } if (top != null) { top.setBounds(0, 0, top.getIntrinsicWidth(), top.getIntrinsicHeight()); } if (bottom != null) { bottom.setBounds(0, 0, bottom.getIntrinsicWidth(), bottom.getIntrinsicHeight()); } button.setCompoundDrawables(left, top, right, bottom); }
/** * Sets the Drawables (if any) to appear to the start of, above, to the end of, and below the * text. Use null if you do not want a Drawable there. The Drawables' bounds will be set to * their intrinsic bounds. */
Sets the Drawables (if any) to appear to the start of, above, to the end of, and below the text. Use null if you do not want a Drawable there. The Drawables' bounds will be set to their intrinsic bounds
setCompoundDrawablesRelativeWithIntrinsicBounds
{ "repo_name": "artemnikitin/SeriesGuide", "path": "SeriesGuide/src/main/java/com/battlelancer/seriesguide/util/Utils.java", "license": "apache-2.0", "size": 23657 }
[ "android.graphics.drawable.Drawable", "android.widget.Button" ]
import android.graphics.drawable.Drawable; import android.widget.Button;
import android.graphics.drawable.*; import android.widget.*;
[ "android.graphics", "android.widget" ]
android.graphics; android.widget;
2,283,650
public void onCick_checkBoxR(View v) { returned = (CheckBox) v; if (returned.isChecked()) { isReturned = true; } else { isReturned = false; } }
void function(View v) { returned = (CheckBox) v; if (returned.isChecked()) { isReturned = true; } else { isReturned = false; } }
/** * changes boolean if isRetuned is clicked * @param v View */
changes boolean if isRetuned is clicked
onCick_checkBoxR
{ "repo_name": "CMPUT301W15T14/ExpenseExpress", "path": "src/team14/expenseexpress/activity/ReturnClaimActivity.java", "license": "gpl-3.0", "size": 3051 }
[ "android.view.View", "android.widget.CheckBox" ]
import android.view.View; import android.widget.CheckBox;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
458,763