method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
@Test public void testDontReceiveOnUnregisteredListener() throws Throwable { final MockRosterListener listener = new MockRosterListener(); PrivateAccessor.invoke(roster, "syncedUpdate", new Class[] { String.class, YahooUser.class }, new Object[] { "dummy", USER }); assertEquals(0, listener.getEventCount()); }
void function() throws Throwable { final MockRosterListener listener = new MockRosterListener(); PrivateAccessor.invoke(roster, STR, new Class[] { String.class, YahooUser.class }, new Object[] { "dummy", USER }); assertEquals(0, listener.getEventCount()); }
/** * Checks if a broadcasted event is disregarded by a RosterListener that has not been added to the Roster. * * @throws Throwable */
Checks if a broadcasted event is disregarded by a RosterListener that has not been added to the Roster
testDontReceiveOnUnregisteredListener
{ "repo_name": "OpenYMSG/openymsg", "path": "src/test/java/org/openymsg/legacy/roster/RosterSyncedUpdateMethodTriggersUpdate.java", "license": "gpl-2.0", "size": 3587 }
[ "org.junit.Assert", "org.openymsg.legacy.network.YahooUser" ]
import org.junit.Assert; import org.openymsg.legacy.network.YahooUser;
import org.junit.*; import org.openymsg.legacy.network.*;
[ "org.junit", "org.openymsg.legacy" ]
org.junit; org.openymsg.legacy;
824,208
public ExpressionResult evaluate(EvaluationContext evaluationContext, List<FunctionArgument> arguments);
ExpressionResult function(EvaluationContext evaluationContext, List<FunctionArgument> arguments);
/** * Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of{@link com.att.research.xacmlatt.pdp.policy.FunctionArgument}s. * * @param evaluationContext the {@link com.att.research.xacmlatt.pdp.eval.EvaluationContext} to use in the evaluation * @param arguments the <code>List</code> of <code>FunctionArgument</code>s for the evaluation * @return an {@link com.att.research.xacmlatt.pdp.policy.ExpressionResult} with the results of the call */
Evaluates this <code>FunctionDefinition</code> on the given <code>List</code> of<code>com.att.research.xacmlatt.pdp.policy.FunctionArgument</code>s
evaluate
{ "repo_name": "att/XACML", "path": "XACML-PDP/src/main/java/com/att/research/xacmlatt/pdp/policy/FunctionDefinition.java", "license": "mit", "size": 2001 }
[ "com.att.research.xacmlatt.pdp.eval.EvaluationContext", "java.util.List" ]
import com.att.research.xacmlatt.pdp.eval.EvaluationContext; import java.util.List;
import com.att.research.xacmlatt.pdp.eval.*; import java.util.*;
[ "com.att.research", "java.util" ]
com.att.research; java.util;
1,053,315
public static Cookie getCookieByName(HttpServletRequest request, String name, String defaultValue) { Cookie returnCookie = null; Cookie cookies[] = request.getCookies(); if (cookies != null) { for (Cookie cookie : cookies) { if (cookie.getName().equals(name)) { returnCookie = cookie; } } } if (returnCookie == null) returnCookie = new Cookie(name, defaultValue); return returnCookie; }
static Cookie function(HttpServletRequest request, String name, String defaultValue) { Cookie returnCookie = null; Cookie cookies[] = request.getCookies(); if (cookies != null) { for (Cookie cookie : cookies) { if (cookie.getName().equals(name)) { returnCookie = cookie; } } } if (returnCookie == null) returnCookie = new Cookie(name, defaultValue); return returnCookie; }
/** * This Function loads a Cookie with the given Name ,returning the given * default value if the cookie value is <code>null</code>. * * @param request -> * The HttpServletRequest * @param name -> * Name of the Cookie * @param defaultValue -> * returns this value if the cookie value is <code>null</code> * @return the Cookie with the given Name */
This Function loads a Cookie with the given Name ,returning the given default value if the cookie value is <code>null</code>
getCookieByName
{ "repo_name": "feesa/easyrec-parent", "path": "easyrec-utils/src/main/java/org/easyrec/utils/servlet/ServletUtils.java", "license": "apache-2.0", "size": 13469 }
[ "javax.servlet.http.Cookie", "javax.servlet.http.HttpServletRequest" ]
import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
1,010,232
protected void startMainActivityFromExternalApp(String url, String appId) throws InterruptedException { Intent intent = new Intent(Intent.ACTION_VIEW); if (appId != null) { intent.putExtra(Browser.EXTRA_APPLICATION_ID, appId); } startMainActivityFromIntent(intent, url); }
void function(String url, String appId) throws InterruptedException { Intent intent = new Intent(Intent.ACTION_VIEW); if (appId != null) { intent.putExtra(Browser.EXTRA_APPLICATION_ID, appId); } startMainActivityFromIntent(intent, url); }
/** * Starts the Main activity as if it was started from an external application, on the specified * URL. */
Starts the Main activity as if it was started from an external application, on the specified URL
startMainActivityFromExternalApp
{ "repo_name": "Just-D/chromium-1", "path": "chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestCaseBase.java", "license": "bsd-3-clause", "size": 40833 }
[ "android.content.Intent", "android.provider.Browser" ]
import android.content.Intent; import android.provider.Browser;
import android.content.*; import android.provider.*;
[ "android.content", "android.provider" ]
android.content; android.provider;
2,035,908
@ApiModelProperty(example = "null", value = "") public Integer getLimit() { return limit; }
@ApiModelProperty(example = "null", value = "") Integer function() { return limit; }
/** * Get limit * minimum: 0 * maximum: 100 * @return limit **/
Get limit minimum: 0 maximum: 100
getLimit
{ "repo_name": "ixaris/ope-applicationclients", "path": "java-client/src/main/java/com/ixaris/ope/applications/client/model/Paging.java", "license": "mit", "size": 3235 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
448,983
public OvhItem cart_cartId_exchange_options_POST(String cartId, String duration, Long itemId, String planCode, String pricingMode, Long quantity) throws IOException { String qPath = "/order/cart/{cartId}/exchange/options"; StringBuilder sb = path(qPath, cartId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "duration", duration); addBody(o, "itemId", itemId); addBody(o, "planCode", planCode); addBody(o, "pricingMode", pricingMode); addBody(o, "quantity", quantity); String resp = execN(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhItem.class); }
OvhItem function(String cartId, String duration, Long itemId, String planCode, String pricingMode, Long quantity) throws IOException { String qPath = STR; StringBuilder sb = path(qPath, cartId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, STR, duration); addBody(o, STR, itemId); addBody(o, STR, planCode); addBody(o, STR, pricingMode); addBody(o, STR, quantity); String resp = execN(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhItem.class); }
/** * Post a new Exchange option in your cart * * REST: POST /order/cart/{cartId}/exchange/options * @param cartId [required] Cart identifier * @param itemId [required] Cart item to be linked * @param planCode [required] Identifier of a Exchange option offer * @param duration [required] Duration selected for the purchase of the product * @param pricingMode [required] Pricing mode selected for the purchase of the product * @param quantity [required] Quantity of product desired */
Post a new Exchange option in your cart
cart_cartId_exchange_options_POST
{ "repo_name": "UrielCh/ovh-java-sdk", "path": "ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java", "license": "bsd-3-clause", "size": 511080 }
[ "java.io.IOException", "java.util.HashMap", "net.minidev.ovh.api.order.cart.OvhItem" ]
import java.io.IOException; import java.util.HashMap; import net.minidev.ovh.api.order.cart.OvhItem;
import java.io.*; import java.util.*; import net.minidev.ovh.api.order.cart.*;
[ "java.io", "java.util", "net.minidev.ovh" ]
java.io; java.util; net.minidev.ovh;
1,423,321
public void setReportFormat(ReportFormat reportFormat) { this.reportFormat = reportFormat; }
void function(ReportFormat reportFormat) { this.reportFormat = reportFormat; }
/** * the putput format of the report * * @param reportFormat the ReportFormat. */
the putput format of the report
setReportFormat
{ "repo_name": "NABUCCO/org.nabucco.framework.reporting", "path": "org.nabucco.framework.reporting.facade.datatype/src/main/gen/org/nabucco/framework/reporting/facade/datatype/ReportConfiguration.java", "license": "epl-1.0", "size": 26415 }
[ "org.nabucco.framework.base.facade.datatype.reporting.ReportFormat" ]
import org.nabucco.framework.base.facade.datatype.reporting.ReportFormat;
import org.nabucco.framework.base.facade.datatype.reporting.*;
[ "org.nabucco.framework" ]
org.nabucco.framework;
2,887,079
@CacheEvict(value={ActionDefinition.Cache.NAME, RuleDefinition.Cache.NAME}, allEntries = true) public ActionDefinition createAction(ActionDefinition action);
@CacheEvict(value={ActionDefinition.Cache.NAME, RuleDefinition.Cache.NAME}, allEntries = true) ActionDefinition function(ActionDefinition action);
/** * This will create a {@link ActionDefinition} exactly like the parameter passed in. * * @param action The Action to create * @throws IllegalArgumentException if the action is null * @throws IllegalStateException if the action already exists in the system */
This will create a <code>ActionDefinition</code> exactly like the parameter passed in
createAction
{ "repo_name": "bhutchinson/rice", "path": "rice-middleware/krms/impl/src/main/java/org/kuali/rice/krms/impl/repository/ActionBoService.java", "license": "apache-2.0", "size": 5082 }
[ "org.kuali.rice.krms.api.repository.action.ActionDefinition", "org.kuali.rice.krms.api.repository.rule.RuleDefinition", "org.springframework.cache.annotation.CacheEvict" ]
import org.kuali.rice.krms.api.repository.action.ActionDefinition; import org.kuali.rice.krms.api.repository.rule.RuleDefinition; import org.springframework.cache.annotation.CacheEvict;
import org.kuali.rice.krms.api.repository.action.*; import org.kuali.rice.krms.api.repository.rule.*; import org.springframework.cache.annotation.*;
[ "org.kuali.rice", "org.springframework.cache" ]
org.kuali.rice; org.springframework.cache;
1,743,409
static SnapshotInfo consolidateSnapshotInfos(Collection<SnapshotInfo> lastSnapshot) { SnapshotInfo chosen = null; if (lastSnapshot != null) { Iterator<SnapshotInfo> i = lastSnapshot.iterator(); while (i.hasNext()) { SnapshotInfo next = i.next(); if (chosen == null) { chosen = next; } else if (next.hostId < chosen.hostId) { next.partitionToTxnId.putAll(chosen.partitionToTxnId); chosen = next; } else { // create a full mapping of txn ids to partition ids. chosen.partitionToTxnId.putAll(next.partitionToTxnId); } } } return chosen; }
static SnapshotInfo consolidateSnapshotInfos(Collection<SnapshotInfo> lastSnapshot) { SnapshotInfo chosen = null; if (lastSnapshot != null) { Iterator<SnapshotInfo> i = lastSnapshot.iterator(); while (i.hasNext()) { SnapshotInfo next = i.next(); if (chosen == null) { chosen = next; } else if (next.hostId < chosen.hostId) { next.partitionToTxnId.putAll(chosen.partitionToTxnId); chosen = next; } else { chosen.partitionToTxnId.putAll(next.partitionToTxnId); } } } return chosen; }
/** * Picks a snapshot info for restore. A single snapshot might have different * files scattered across multiple machines. All nodes must pick the same * SnapshotInfo or different nodes will pick different catalogs to restore. * Pick one SnapshotInfo and consolidate the per-node state into it. */
Picks a snapshot info for restore. A single snapshot might have different files scattered across multiple machines. All nodes must pick the same SnapshotInfo or different nodes will pick different catalogs to restore. Pick one SnapshotInfo and consolidate the per-node state into it
consolidateSnapshotInfos
{ "repo_name": "eoneil1942/voltdb-4.7fix", "path": "src/frontend/org/voltdb/RestoreAgent.java", "license": "agpl-3.0", "size": 56936 }
[ "java.util.Collection", "java.util.Iterator" ]
import java.util.Collection; import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
492,918
public String getLabelColor(Widget w);
String function(Widget w);
/** * Gets the label color for the widget. Checks conditional statements to * find the color based on the item value * * @param w * Widget * @return String with the color */
Gets the label color for the widget. Checks conditional statements to find the color based on the item value
getLabelColor
{ "repo_name": "falkena/openhab", "path": "bundles/api/org.openhab.core1/src/main/java/org/openhab/ui/items/ItemUIRegistry.java", "license": "epl-1.0", "size": 5091 }
[ "org.openhab.model.sitemap.Widget" ]
import org.openhab.model.sitemap.Widget;
import org.openhab.model.sitemap.*;
[ "org.openhab.model" ]
org.openhab.model;
1,572,382
private int computePriority(){ return computePriority(getPartialSubstitutions().map(IdPredicate::getVarName).collect(Collectors.toSet())); }
int function(){ return computePriority(getPartialSubstitutions().map(IdPredicate::getVarName).collect(Collectors.toSet())); }
/** * compute base resolution priority of this atom * @return priority value */
compute base resolution priority of this atom
computePriority
{ "repo_name": "pluraliseseverythings/grakn", "path": "grakn-graql/src/main/java/ai/grakn/graql/internal/reasoner/atom/Atom.java", "license": "gpl-3.0", "size": 9818 }
[ "ai.grakn.graql.internal.reasoner.atom.predicate.IdPredicate", "java.util.stream.Collectors" ]
import ai.grakn.graql.internal.reasoner.atom.predicate.IdPredicate; import java.util.stream.Collectors;
import ai.grakn.graql.internal.reasoner.atom.predicate.*; import java.util.stream.*;
[ "ai.grakn.graql", "java.util" ]
ai.grakn.graql; java.util;
1,654,184
// Path is null if not specified by user if (path == null) { path = Paths.get("./minecord"); if (!path.toFile().exists()) { log.debug("No path argument was provided and default folder does not exist, creating..."); try { Files.createDirectory(path); } catch (IOException ex) { log.error("FATAL: There was an error creating the minecord folder", ex); return ExitCodes.COULD_NOT_CREATE_FOLDER; } } } else if (!path.toFile().isDirectory()) { log.error("FATAL: The path argument must be a directory!"); return ExitCodes.INVALID_PATH; } // ensure branding exists, but it's not necessary brandingPath = path.resolve("branding.yml"); if (!brandingPath.toFile().exists()) { log.debug("Branding file does not exist, creating..."); createBranding(brandingPath); } // config, however, is necessary if (configPath == null) { configPath = path.resolve("config.yml"); } if (!configPath.toFile().exists()) { return createConfig(configPath); } ready = true; log.info("Found valid config file"); return ExitCodes.SUCCESS; }
if (path == null) { path = Paths.get(STR); if (!path.toFile().exists()) { log.debug(STR); try { Files.createDirectory(path); } catch (IOException ex) { log.error(STR, ex); return ExitCodes.COULD_NOT_CREATE_FOLDER; } } } else if (!path.toFile().isDirectory()) { log.error(STR); return ExitCodes.INVALID_PATH; } brandingPath = path.resolve(STR); if (!brandingPath.toFile().exists()) { log.debug(STR); createBranding(brandingPath); } if (configPath == null) { configPath = path.resolve(STR); } if (!configPath.toFile().exists()) { return createConfig(configPath); } ready = true; log.info(STR); return ExitCodes.SUCCESS; }
/** * Parses all command-line arguments. * @return {@code 0} for success, {@code 1} for user failure, {@code 2} for fatal exception */
Parses all command-line arguments
call
{ "repo_name": "Tisawesomeness/Minecord", "path": "src/main/java/com/tisawesomeness/minecord/ArgsHandler.java", "license": "agpl-3.0", "size": 4206 }
[ "java.io.IOException", "java.nio.file.Files", "java.nio.file.Paths" ]
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths;
import java.io.*; import java.nio.file.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
1,990,030
ExtSource checkOrCreateExtSource(PerunSession perunSession, String extSourceName, String extSourceType) throws InternalErrorException;
ExtSource checkOrCreateExtSource(PerunSession perunSession, String extSourceName, String extSourceType) throws InternalErrorException;
/** * Checks whether the ExtSource exists, if not, then the ExtSource is created. * * @param perunSession * @param extSourceName * @param extSourceType * * @return existing or newly created extSource is returned * * @throws InternalErrorException */
Checks whether the ExtSource exists, if not, then the ExtSource is created
checkOrCreateExtSource
{ "repo_name": "ondrocks/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/api/ExtSourcesManager.java", "license": "bsd-2-clause", "size": 10176 }
[ "cz.metacentrum.perun.core.api.exceptions.InternalErrorException" ]
import cz.metacentrum.perun.core.api.exceptions.InternalErrorException;
import cz.metacentrum.perun.core.api.exceptions.*;
[ "cz.metacentrum.perun" ]
cz.metacentrum.perun;
1,239,072
public void addCommittedProposal(Request request) { WriteLock wl = logLock.writeLock(); try { wl.lock(); if (committedLog.size() > commitLogCount) { committedLog.removeFirst(); minCommittedLog = committedLog.getFirst().packet.getZxid(); } if (committedLog.size() == 0) { minCommittedLog = request.zxid; maxCommittedLog = request.zxid; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos); try { request.hdr.serialize(boa, "hdr"); if (request.txn != null) { request.txn.serialize(boa, "txn"); } baos.close(); } catch (IOException e) { LOG.error("This really should be impossible", e); } QuorumPacket pp = new QuorumPacket(Leader.PROPOSAL, request.zxid, baos.toByteArray(), null); Proposal p = new Proposal(); p.packet = pp; p.request = request; committedLog.add(p); maxCommittedLog = p.packet.getZxid(); } finally { wl.unlock(); } }
void function(Request request) { WriteLock wl = logLock.writeLock(); try { wl.lock(); if (committedLog.size() > commitLogCount) { committedLog.removeFirst(); minCommittedLog = committedLog.getFirst().packet.getZxid(); } if (committedLog.size() == 0) { minCommittedLog = request.zxid; maxCommittedLog = request.zxid; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos); try { request.hdr.serialize(boa, "hdr"); if (request.txn != null) { request.txn.serialize(boa, "txn"); } baos.close(); } catch (IOException e) { LOG.error(STR, e); } QuorumPacket pp = new QuorumPacket(Leader.PROPOSAL, request.zxid, baos.toByteArray(), null); Proposal p = new Proposal(); p.packet = pp; p.request = request; committedLog.add(p); maxCommittedLog = p.packet.getZxid(); } finally { wl.unlock(); } }
/** * maintains a list of last <i>committedLog</i> * or so committed requests. This is used for * fast follower synchronization. * @param request committed request */
maintains a list of last committedLog or so committed requests. This is used for fast follower synchronization
addCommittedProposal
{ "repo_name": "tenaciousjzh/titan-solr-cloud-test", "path": "zookeeper-3.3.5/src/java/main/org/apache/zookeeper/server/ZKDatabase.java", "license": "apache-2.0", "size": 15873 }
[ "java.io.ByteArrayOutputStream", "java.io.IOException", "java.util.concurrent.locks.ReentrantReadWriteLock", "org.apache.jute.BinaryOutputArchive", "org.apache.zookeeper.server.quorum.Leader", "org.apache.zookeeper.server.quorum.QuorumPacket" ]
import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.concurrent.locks.ReentrantReadWriteLock; import org.apache.jute.BinaryOutputArchive; import org.apache.zookeeper.server.quorum.Leader; import org.apache.zookeeper.server.quorum.QuorumPacket;
import java.io.*; import java.util.concurrent.locks.*; import org.apache.jute.*; import org.apache.zookeeper.server.quorum.*;
[ "java.io", "java.util", "org.apache.jute", "org.apache.zookeeper" ]
java.io; java.util; org.apache.jute; org.apache.zookeeper;
2,315,043
private String writeEmulatorStartScriptUnix() throws MojoExecutionException { String filename = scriptFolder + "/maven-android-plugin-emulator-start.sh"; File sh; sh = new File("/bin/bash"); if (!sh.exists()) { sh = new File("/usr/bin/bash"); } if (!sh.exists()) { sh = new File("/bin/sh"); } File file = new File(filename); PrintWriter writer = null; try { writer = new PrintWriter(new FileWriter(file)); writer.println("#!" + sh.getAbsolutePath()); writer.print(assembleStartCommandLine()); writer.print(" 1>/dev/null 2>&1 &"); // redirect outputs and run as background task writer.println(); writer.println("echo $! > " + pidFileName); // process id from stdout into pid file } catch (IOException e) { getLog().error("Failure writing file " + filename); } finally { if (writer != null) { writer.flush(); writer.close(); } } file.setExecutable(true); return filename; }
String function() throws MojoExecutionException { String filename = scriptFolder + STR; File sh; sh = new File(STR); if (!sh.exists()) { sh = new File(STR); } if (!sh.exists()) { sh = new File(STR); } File file = new File(filename); PrintWriter writer = null; try { writer = new PrintWriter(new FileWriter(file)); writer.println("#!" + sh.getAbsolutePath()); writer.print(assembleStartCommandLine()); writer.print(STR); writer.println(); writer.println(STR + pidFileName); } catch (IOException e) { getLog().error(STR + filename); } finally { if (writer != null) { writer.flush(); writer.close(); } } file.setExecutable(true); return filename; }
/** * Writes the script to start the emulator in the background for unix based environments and write process id into * pidfile. * * @return absolute path name of start script * @throws IOException * @throws MojoExecutionException */
Writes the script to start the emulator in the background for unix based environments and write process id into pidfile
writeEmulatorStartScriptUnix
{ "repo_name": "snooplsm/njtransit", "path": "maven-android-plugin/src/main/java/com/jayway/maven/plugins/android/AbstractEmulatorMojo.java", "license": "gpl-3.0", "size": 15541 }
[ "java.io.File", "java.io.FileWriter", "java.io.IOException", "java.io.PrintWriter", "org.apache.maven.plugin.MojoExecutionException" ]
import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import org.apache.maven.plugin.MojoExecutionException;
import java.io.*; import org.apache.maven.plugin.*;
[ "java.io", "org.apache.maven" ]
java.io; org.apache.maven;
2,306,315
public Map<String, Object> getAttributes() { return attrs; }
Map<String, Object> function() { return attrs; }
/** * Gets node attributes without filtering. * * @return Node attributes without filtering. */
Gets node attributes without filtering
getAttributes
{ "repo_name": "alexzaitzev/ignite", "path": "modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java", "license": "apache-2.0", "size": 18573 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
832,319
private String getPrecursor() throws KeeperException, InterruptedException { final List<String> list = zk.getChildren(lockpath, false); if (list.isEmpty()) { return null; } final long self = nodeToLong(locknode); String holder = null; long max, num; max = 0; for (String node: list) { num = nodeToLong(node); if (num > max && num < self) { max = num; holder = node; } } if (null == holder) { return null; } return lockpath + "/" + holder; }
String function() throws KeeperException, InterruptedException { final List<String> list = zk.getChildren(lockpath, false); if (list.isEmpty()) { return null; } final long self = nodeToLong(locknode); String holder = null; long max, num; max = 0; for (String node: list) { num = nodeToLong(node); if (num > max && num < self) { max = num; holder = node; } } if (null == holder) { return null; } return lockpath + "/" + holder; }
/** * Lock queue is based on node number, the lowest number has the lock. * This method returns a node with the greatest number which is still * lower than ours (i.e. the lock() method should be called beforehand). * * @return Null if we are first in line, otherwise full path of the node ahead. * @throws KeeperException * @throws InterruptedException */
Lock queue is based on node number, the lowest number has the lock. This method returns a node with the greatest number which is still lower than ours (i.e. the lock() method should be called beforehand)
getPrecursor
{ "repo_name": "vytautas/nfdist", "path": "src/nfdist/zookeeper/Lock.java", "license": "bsd-2-clause", "size": 6235 }
[ "java.util.List", "org.apache.zookeeper.KeeperException" ]
import java.util.List; import org.apache.zookeeper.KeeperException;
import java.util.*; import org.apache.zookeeper.*;
[ "java.util", "org.apache.zookeeper" ]
java.util; org.apache.zookeeper;
2,580,977
@POST @Path("{password}/{key}") public Response create(BuiltinUser user, @PathParam("password") String password, @PathParam("key") String key) { return internalSave(user, password, key); }
@Path(STR) Response function(BuiltinUser user, @PathParam(STR) String password, @PathParam("key") String key) { return internalSave(user, password, key); }
/** * Created this new API command because the save method could not be run * from the RestAssured API. RestAssured doesn't allow a Post request to * contain both a body and request parameters. TODO: replace current usage * of save() with create? * * @param user * @param password * @param key * @return */
Created this new API command because the save method could not be run from the RestAssured API. RestAssured doesn't allow a Post request to of save() with create
create
{ "repo_name": "bencomp/dataverse", "path": "src/main/java/edu/harvard/iq/dataverse/api/BuiltinUsers.java", "license": "apache-2.0", "size": 6444 }
[ "edu.harvard.iq.dataverse.authorization.providers.builtin.BuiltinUser", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.core.Response" ]
import edu.harvard.iq.dataverse.authorization.providers.builtin.BuiltinUser; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Response;
import edu.harvard.iq.dataverse.authorization.providers.builtin.*; import javax.ws.rs.*; import javax.ws.rs.core.*;
[ "edu.harvard.iq", "javax.ws" ]
edu.harvard.iq; javax.ws;
946,986
public void init() { if (!initialized) { if (jatkFilePath != null && (flashFile == null || !flashFile.exists())) { String extension = ".tst"; if (jatkFilePath.endsWith(extension)) { flashFile = Configuration.fileResolver.getFile(jatkFilePath, "tmpjatk", extension, login, password, useragent); } } // TODO if .sis extract .swf initialized = true; } }
void function() { if (!initialized) { if (jatkFilePath != null && (flashFile == null !flashFile.exists())) { String extension = ".tst"; if (jatkFilePath.endsWith(extension)) { flashFile = Configuration.fileResolver.getFile(jatkFilePath, STR, extension, login, password, useragent); } } initialized = true; } }
/** * Initialize this FlashStep so that it is ready to analyse. If it has * already been initialysed, nothing is done. */
Initialize this FlashStep so that it is ready to analyse. If it has already been initialysed, nothing is done
init
{ "repo_name": "Orange-OpenSource/ATK", "path": "gui/src/main/java/com/orange/atk/atkUI/anaHopper/HopperStep.java", "license": "apache-2.0", "size": 13530 }
[ "com.orange.atk.atkUI.corecli.Configuration" ]
import com.orange.atk.atkUI.corecli.Configuration;
import com.orange.atk.*;
[ "com.orange.atk" ]
com.orange.atk;
1,954,680
protected ConfigWebImpl getConfigWebImpl(String realpath) { Iterator<String> it = initContextes.keySet().iterator(); while(it.hasNext()) { ConfigWebImpl cw=((CFMLFactoryImpl)initContextes.get(it.next())).getConfigWebImpl(); if(ReqRspUtil.getRootPath(cw.getServletContext()).equals(realpath)) return cw; } return null; }
ConfigWebImpl function(String realpath) { Iterator<String> it = initContextes.keySet().iterator(); while(it.hasNext()) { ConfigWebImpl cw=((CFMLFactoryImpl)initContextes.get(it.next())).getConfigWebImpl(); if(ReqRspUtil.getRootPath(cw.getServletContext()).equals(realpath)) return cw; } return null; }
/** * returns CongigWeb Implementtion * @param realpath * @return ConfigWebImpl */
returns CongigWeb Implementtion
getConfigWebImpl
{ "repo_name": "JordanReiter/railo", "path": "railo-java/railo-core/src/railo/runtime/config/ConfigServerImpl.java", "license": "lgpl-2.1", "size": 19047 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
645,885
public static int getInt(Context context, String key) { return getInt(context, key, -1); }
static int function(Context context, String key) { return getInt(context, key, -1); }
/** * get int preferences * * @param context * @param key The name of the preference to retrieve * @return The preference value if it exists, or -1. Throws ClassCastException if there is a * preference with this * name that is not a int * @see #getInt(Context, String, int) */
get int preferences
getInt
{ "repo_name": "gaolh89/cniao5", "path": "app/src/main/java/com/enjoyshop/utils/PreferencesUtils.java", "license": "apache-2.0", "size": 8868 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
2,517,066
private GridCellRenderer<GSInstanceModel> createInstanceTestConnectionButton() { GridCellRenderer<GSInstanceModel> buttonRendered = new GridCellRenderer<GSInstanceModel>() { private boolean init;
GridCellRenderer<GSInstanceModel> function() { GridCellRenderer<GSInstanceModel> buttonRendered = new GridCellRenderer<GSInstanceModel>() { private boolean init;
/** * Creates the instance delete button. * * @return the grid cell renderer */
Creates the instance delete button
createInstanceTestConnectionButton
{ "repo_name": "geoserver/geofence", "path": "src/gui/core/plugin/userui/src/main/java/org/geoserver/geofence/gui/client/widget/InstanceGridWidget.java", "license": "gpl-2.0", "size": 33619 }
[ "com.extjs.gxt.ui.client.widget.grid.GridCellRenderer", "org.geoserver.geofence.gui.client.model.GSInstanceModel" ]
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer; import org.geoserver.geofence.gui.client.model.GSInstanceModel;
import com.extjs.gxt.ui.client.widget.grid.*; import org.geoserver.geofence.gui.client.model.*;
[ "com.extjs.gxt", "org.geoserver.geofence" ]
com.extjs.gxt; org.geoserver.geofence;
1,314,646
@Override public Request<AuthorizeSecurityGroupEgressRequest> getDryRunRequest() { Request<AuthorizeSecurityGroupEgressRequest> request = new AuthorizeSecurityGroupEgressRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request; }
Request<AuthorizeSecurityGroupEgressRequest> function() { Request<AuthorizeSecurityGroupEgressRequest> request = new AuthorizeSecurityGroupEgressRequestMarshaller().marshall(this); request.addParameter(STR, Boolean.toString(true)); return request; }
/** * This method is intended for internal use only. Returns the marshaled request configured with additional * parameters to enable operation dry-run. */
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run
getDryRunRequest
{ "repo_name": "dagnir/aws-sdk-java", "path": "aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/AuthorizeSecurityGroupEgressRequest.java", "license": "apache-2.0", "size": 21617 }
[ "com.amazonaws.Request", "com.amazonaws.services.ec2.model.transform.AuthorizeSecurityGroupEgressRequestMarshaller" ]
import com.amazonaws.Request; import com.amazonaws.services.ec2.model.transform.AuthorizeSecurityGroupEgressRequestMarshaller;
import com.amazonaws.*; import com.amazonaws.services.ec2.model.transform.*;
[ "com.amazonaws", "com.amazonaws.services" ]
com.amazonaws; com.amazonaws.services;
2,345,443
public PartitionElement getContainerPartitionElement(){ return item.getContainerPartitionElement(); }
PartitionElement function(){ return item.getContainerPartitionElement(); }
/** * Return the encapsulate Low Level API object. */
Return the encapsulate Low Level API object
getContainerPartitionElement
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/strings/hlapi/SubstringHLAPI.java", "license": "epl-1.0", "size": 111893 }
[ "fr.lip6.move.pnml.hlpn.partitions.PartitionElement" ]
import fr.lip6.move.pnml.hlpn.partitions.PartitionElement;
import fr.lip6.move.pnml.hlpn.partitions.*;
[ "fr.lip6.move" ]
fr.lip6.move;
1,719,527
public void testGetMultvalueHeader() { System.out.println("getMultivalueHeader"); ProxymaResponseDataBean instance = new ProxymaResponseDataBean(); instance.addHeader("namE1 ", "value1"); instance.addHeader(" Name1", "value2"); instance.addHeader("nAme3", "value3"); Collection<ProxymaHttpHeader> result = instance.getMultivalueHeader("nAmE1"); //Test size assertEquals(2, result.size()); //Test multi values header Iterator<ProxymaHttpHeader> iter = result.iterator(); if ("namE1: value1".equals(iter.next().toString())) { assertEquals("Name1: value2", iter.next().toString()); } else { assertEquals("name1: value1", iter.next().toString()); } //Test single value header result = instance.getMultivalueHeader("NAME3"); assertEquals(1, result.size()); iter = result.iterator(); assertEquals("nAme3: value3", iter.next().toString()); //Test unexisting header result = instance.getMultivalueHeader("Unexisting"); assertNull(result); }
void function() { System.out.println(STR); ProxymaResponseDataBean instance = new ProxymaResponseDataBean(); instance.addHeader(STR, STR); instance.addHeader(STR, STR); instance.addHeader("nAme3", STR); Collection<ProxymaHttpHeader> result = instance.getMultivalueHeader("nAmE1"); assertEquals(2, result.size()); Iterator<ProxymaHttpHeader> iter = result.iterator(); if (STR.equals(iter.next().toString())) { assertEquals(STR, iter.next().toString()); } else { assertEquals(STR, iter.next().toString()); } result = instance.getMultivalueHeader("NAME3"); assertEquals(1, result.size()); iter = result.iterator(); assertEquals(STR, iter.next().toString()); result = instance.getMultivalueHeader(STR); assertNull(result); }
/** * Test of getMultipleHeaderValues method, of class ProxymaResponseDataBean. */
Test of getMultipleHeaderValues method, of class ProxymaResponseDataBean
testGetMultvalueHeader
{ "repo_name": "marcolinuz/proxyma", "path": "proxyma-core/src/test/java/m/c/m/proxyma/resource/ProxymaResponseDataBeanTest.java", "license": "lgpl-2.1", "size": 12037 }
[ "java.util.Collection", "java.util.Iterator" ]
import java.util.Collection; import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
161,843
Image img = new Image( display, ConstUI.ICON_SIZE, ConstUI.ICON_SIZE ); GC gc = new GC( img ); gc.setForeground( new Color( display, 0, 0, 0 ) ); gc.drawRectangle( 4, 4, ConstUI.ICON_SIZE - 8, ConstUI.ICON_SIZE - 8 ); gc.setForeground( new Color( display, 255, 0, 0 ) ); gc.drawLine( 4, 4, ConstUI.ICON_SIZE - 4, ConstUI.ICON_SIZE - 4 ); gc.drawLine( ConstUI.ICON_SIZE - 4, 4, 4, ConstUI.ICON_SIZE - 4 ); gc.dispose(); return new SwtUniversalImageBitmap( img ); }
Image img = new Image( display, ConstUI.ICON_SIZE, ConstUI.ICON_SIZE ); GC gc = new GC( img ); gc.setForeground( new Color( display, 0, 0, 0 ) ); gc.drawRectangle( 4, 4, ConstUI.ICON_SIZE - 8, ConstUI.ICON_SIZE - 8 ); gc.setForeground( new Color( display, 255, 0, 0 ) ); gc.drawLine( 4, 4, ConstUI.ICON_SIZE - 4, ConstUI.ICON_SIZE - 4 ); gc.drawLine( ConstUI.ICON_SIZE - 4, 4, 4, ConstUI.ICON_SIZE - 4 ); gc.dispose(); return new SwtUniversalImageBitmap( img ); }
/** * Get the image for when all other fallbacks have failed. This is an image * drawn on the canvas, a square with a red X. * * @param display the device to render the image to * @return the missing image */
Get the image for when all other fallbacks have failed. This is an image drawn on the canvas, a square with a red X
getMissingImage
{ "repo_name": "IvanNikolaychuk/pentaho-kettle", "path": "ui/src/org/pentaho/di/ui/util/SwtSvgImageUtil.java", "license": "apache-2.0", "size": 10484 }
[ "org.eclipse.swt.graphics.Color", "org.eclipse.swt.graphics.Image", "org.pentaho.di.core.SwtUniversalImageBitmap", "org.pentaho.di.ui.core.ConstUI" ]
import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Image; import org.pentaho.di.core.SwtUniversalImageBitmap; import org.pentaho.di.ui.core.ConstUI;
import org.eclipse.swt.graphics.*; import org.pentaho.di.core.*; import org.pentaho.di.ui.core.*;
[ "org.eclipse.swt", "org.pentaho.di" ]
org.eclipse.swt; org.pentaho.di;
876,026
public boolean addAll(int index, Collection<? extends E> c) { synchronized (backingList) { checkMod(); checkBoundsInclusive(index); int csize = c.size(); boolean result = backingList.addAll(offset + index, c); this.data = backingList.data; size += csize; return result; } }
boolean function(int index, Collection<? extends E> c) { synchronized (backingList) { checkMod(); checkBoundsInclusive(index); int csize = c.size(); boolean result = backingList.addAll(offset + index, c); this.data = backingList.data; size += csize; return result; } }
/** * Specified by AbstractList.subList to delegate to the backing list. * * @param index the location to insert at * @param c the collection to insert * @return true if this list was modified, in other words, c is non-empty * @throws ConcurrentModificationException if the backing list has been * modified externally to this sublist * @throws IndexOutOfBoundsException if index &lt; 0 || index &gt; size() * @throws UnsupportedOperationException if this list does not support the * addAll operation * @throws ClassCastException if some element of c cannot be added to this * list due to its type * @throws IllegalArgumentException if some element of c cannot be added * to this list for some other reason * @throws NullPointerException if the specified collection is null */
Specified by AbstractList.subList to delegate to the backing list
addAll
{ "repo_name": "cfriedt/classpath", "path": "java/util/concurrent/CopyOnWriteArrayList.java", "license": "gpl-2.0", "size": 45081 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,405,877
public static Object getSelectionData(iListHandler listComponent, boolean multiple, int col) { if (multiple) { // multiple selection return getValues(listComponent, listComponent.getSelectedIndexes(), col, true); } RenderableDataItem di = listComponent.getSelectedItem(); di = ((di == null) || (col == -1)) ? di : di.getItemEx(col); return (di == null) ? null : di.getLinkedData(); }
static Object function(iListHandler listComponent, boolean multiple, int col) { if (multiple) { return getValues(listComponent, listComponent.getSelectedIndexes(), col, true); } RenderableDataItem di = listComponent.getSelectedItem(); di = ((di == null) (col == -1)) ? di : di.getItemEx(col); return (di == null) ? null : di.getLinkedData(); }
/** * Get the data associated with the selection from a component * * @param listComponent * the component to get the selection from * @param multiple * true to delete the selection; false otherwise * @param col * the column to get the selection for * @return the selection form a component */
Get the data associated with the selection from a component
getSelectionData
{ "repo_name": "appnativa/rare", "path": "source/rare/core/com/appnativa/rare/util/DataItemCollection.java", "license": "gpl-3.0", "size": 19828 }
[ "com.appnativa.rare.ui.RenderableDataItem" ]
import com.appnativa.rare.ui.RenderableDataItem;
import com.appnativa.rare.ui.*;
[ "com.appnativa.rare" ]
com.appnativa.rare;
2,173,725
public static InternetFile open(final Internet iNet, final URL url, final HttpHeader... headers) throws FileNotFoundException { return open(iNet, url, DEFAULT_USER_AGENT, headers); }
static InternetFile function(final Internet iNet, final URL url, final HttpHeader... headers) throws FileNotFoundException { return open(iNet, url, DEFAULT_USER_AGENT, headers); }
/** * Open a file using the supplied {@link URL}. * * @param url The {@link URL} identifying the file to open * @param userAgent The user agent to use when sending the request to fetch the file * @param headers Any HTTP headers to be sent with the request * * @return The file or an exception is thrown if the file could not be loaded */
Open a file using the supplied <code>URL</code>
open
{ "repo_name": "eXparity/exparity-data", "path": "src/main/java/org/exparity/io/internet/InternetFile.java", "license": "apache-2.0", "size": 11414 }
[ "java.io.FileNotFoundException" ]
import java.io.FileNotFoundException;
import java.io.*;
[ "java.io" ]
java.io;
986,366
void close() throws IOException; /** * Sets the file-pointer offset, measured from the beginning of this file, at which the next * read or write occurs. The offset may be set beyond the end of the file. Setting the offset * beyond the end of the file does not change the file length. The file length will change only * by writing after the offset has been set beyond the end of the file. * * @param offset the offset position, measured in bytes from the * beginning of the file, at which to set the file * pointer. * @throws IOException if <code>offset</code> is less than * <code>0</code> or if an I/O error occurs. * @throws IllegalAccessException if in this output stream doesn't support this function. * You can return {@code false} in * {@link FileDownloadHelper.OutputStreamCreator#supportSeek()}
void close() throws IOException; /** * Sets the file-pointer offset, measured from the beginning of this file, at which the next * read or write occurs. The offset may be set beyond the end of the file. Setting the offset * beyond the end of the file does not change the file length. The file length will change only * by writing after the offset has been set beyond the end of the file. * * @param offset the offset position, measured in bytes from the * beginning of the file, at which to set the file * pointer. * @throws IOException if <code>offset</code> is less than * <code>0</code> or if an I/O error occurs. * @throws IllegalAccessException if in this output stream doesn't support this function. * You can return {@code false} in * {@link FileDownloadHelper.OutputStreamCreator#supportSeek()}
/** * Closes this output stream and releases any system resources associated with this stream. The * general contract of <code>close</code> is that it closes the output stream. A closed stream * cannot perform output operations and cannot be reopened. * <p> * The <code>close</code> method of <code>OutputStream</code> does nothing. * * @throws IOException if an I/O error occurs. */
Closes this output stream and releases any system resources associated with this stream. The general contract of <code>close</code> is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened. The <code>close</code> method of <code>OutputStream</code> does nothing
close
{ "repo_name": "angcyo/RLibrary", "path": "filedownloader/src/main/java/com/liulishuo/filedownloader/stream/FileDownloadOutputStream.java", "license": "apache-2.0", "size": 4987 }
[ "com.liulishuo.filedownloader.util.FileDownloadHelper", "java.io.IOException" ]
import com.liulishuo.filedownloader.util.FileDownloadHelper; import java.io.IOException;
import com.liulishuo.filedownloader.util.*; import java.io.*;
[ "com.liulishuo.filedownloader", "java.io" ]
com.liulishuo.filedownloader; java.io;
2,531,924
private void isLegal(ArrayList<T> dataSets) { if (dataSets == null) return; for (int i = 0; i < dataSets.size(); i++) { if (dataSets.get(i) .getYVals() .size() > mXVals.size()) { throw new IllegalArgumentException( "One or more of the DataSet Entry arrays are longer than the x-values array of this ChartData object."); } } }
void function(ArrayList<T> dataSets) { if (dataSets == null) return; for (int i = 0; i < dataSets.size(); i++) { if (dataSets.get(i) .getYVals() .size() > mXVals.size()) { throw new IllegalArgumentException( STR); } } }
/** * Checks if the combination of x-values array and DataSet array is legal or * not. * * @param dataSets */
Checks if the combination of x-values array and DataSet array is legal or not
isLegal
{ "repo_name": "PeoceWang/WeatherAPP", "path": "app/src/main/java/com/github/mikephil/chartLibrary/data/ChartData.java", "license": "apache-2.0", "size": 16140 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,183,753
void acceptChildren(Visitor v) throws StandardException { super.acceptChildren(v); if (expression != null) { setExpression((ValueNode)expression.accept(v)); } if (reference != null) { reference = (ColumnReference)reference.accept(v); } }
void acceptChildren(Visitor v) throws StandardException { super.acceptChildren(v); if (expression != null) { setExpression((ValueNode)expression.accept(v)); } if (reference != null) { reference = (ColumnReference)reference.accept(v); } }
/** * Accept the visitor for all visitable children of this node. * * @param v the visitor * * @exception StandardException on error */
Accept the visitor for all visitable children of this node
acceptChildren
{ "repo_name": "xiexingguang/sql-parser", "path": "src/main/java/com/foundationdb/sql/parser/ResultColumn.java", "license": "apache-2.0", "size": 13569 }
[ "com.foundationdb.sql.StandardException" ]
import com.foundationdb.sql.StandardException;
import com.foundationdb.sql.*;
[ "com.foundationdb.sql" ]
com.foundationdb.sql;
655,887
public boolean nodeConnected(DiscoveryNode node) { return isLocalNode(node) || transport.nodeConnected(node); }
boolean function(DiscoveryNode node) { return isLocalNode(node) transport.nodeConnected(node); }
/** * Returns <code>true</code> iff the given node is already connected. */
Returns <code>true</code> iff the given node is already connected
nodeConnected
{ "repo_name": "kalimatas/elasticsearch", "path": "server/src/main/java/org/elasticsearch/transport/TransportService.java", "license": "apache-2.0", "size": 55283 }
[ "org.elasticsearch.cluster.node.DiscoveryNode" ]
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.*;
[ "org.elasticsearch.cluster" ]
org.elasticsearch.cluster;
1,649,092
EClass getTestRunnerMaker();
EClass getTestRunnerMaker();
/** * Returns the meta object for class '{@link org.smeup.sys.dk.test.QTestRunnerMaker <em>Test Runner Maker</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Test Runner Maker</em>'. * @see org.smeup.sys.dk.test.QTestRunnerMaker * @generated */
Returns the meta object for class '<code>org.smeup.sys.dk.test.QTestRunnerMaker Test Runner Maker</code>'.
getTestRunnerMaker
{ "repo_name": "smeup/asup", "path": "org.smeup.sys.dk.test/src/org/smeup/sys/dk/test/QDevelopmentKitTestPackage.java", "license": "epl-1.0", "size": 40251 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
513,924
@Override public FileTime lastModifiedTime() { return FileTime.from(this.properties.getLastModified().toInstant()); }
FileTime function() { return FileTime.from(this.properties.getLastModified().toInstant()); }
/** * Returns the time of last modification. * * @return the time of last modification. */
Returns the time of last modification
lastModifiedTime
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzureBlobFileAttributes.java", "license": "mit", "size": 11640 }
[ "java.nio.file.attribute.FileTime" ]
import java.nio.file.attribute.FileTime;
import java.nio.file.attribute.*;
[ "java.nio" ]
java.nio;
880,645
public static Test setUpTest(Test test) { if (!(test instanceof SuiteOfTestCases)) return test;
static Test function(Test test) { if (!(test instanceof SuiteOfTestCases)) return test;
/** * Decorate an individual test with setUpSuite/tearDownSuite, so that the test can be run standalone. * This method is called by the Eclipse JUnit test runner when a test is re-run from the JUnit view's context menu. */
Decorate an individual test with setUpSuite/tearDownSuite, so that the test can be run standalone. This method is called by the Eclipse JUnit test runner when a test is re-run from the JUnit view's context menu
setUpTest
{ "repo_name": "maxeler/eclipse", "path": "eclipse.jdt.core/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SuiteOfTestCases.java", "license": "epl-1.0", "size": 4655 }
[ "junit.framework.Test" ]
import junit.framework.Test;
import junit.framework.*;
[ "junit.framework" ]
junit.framework;
895,111
public static Iterator<ImageReader> getImageReadersBySuffix(String fileSuffix) { if (fileSuffix == null) throw new IllegalArgumentException("formatName may not be null"); return getReadersByFilter(ImageReaderSpi.class, new ReaderSuffixFilter(fileSuffix), fileSuffix); }
static Iterator<ImageReader> function(String fileSuffix) { if (fileSuffix == null) throw new IllegalArgumentException(STR); return getReadersByFilter(ImageReaderSpi.class, new ReaderSuffixFilter(fileSuffix), fileSuffix); }
/** * Retrieve an iterator over all registered readers for the given * file suffix. * * @param fileSuffix an image file suffix (e.g. "jpg" or "bmp") * * @return an iterator over a collection of image readers * * @exception IllegalArgumentException if fileSuffix is null */
Retrieve an iterator over all registered readers for the given file suffix
getImageReadersBySuffix
{ "repo_name": "nmacs/lm3s-uclinux", "path": "lib/classpath/javax/imageio/ImageIO.java", "license": "gpl-2.0", "size": 36051 }
[ "java.util.Iterator", "javax.imageio.spi.ImageReaderSpi" ]
import java.util.Iterator; import javax.imageio.spi.ImageReaderSpi;
import java.util.*; import javax.imageio.spi.*;
[ "java.util", "javax.imageio" ]
java.util; javax.imageio;
1,939,002
// CSOFF //------------------------------------------------------------------------- @SuppressWarnings("rawtypes") public static IntObjectPair.Meta meta() { return IntObjectPair.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(IntObjectPair.Meta.INSTANCE); }
@SuppressWarnings(STR) static IntObjectPair.Meta function() { return IntObjectPair.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(IntObjectPair.Meta.INSTANCE); }
/** * The meta-bean for {@code IntObjectPair}. * @return the meta-bean, not null */
The meta-bean for IntObjectPair
meta
{ "repo_name": "McLeodMoores/starling", "path": "projects/util/src/main/java/com/opengamma/util/tuple/IntObjectPair.java", "license": "apache-2.0", "size": 8417 }
[ "org.joda.beans.JodaBeanUtils" ]
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
2,086,471
@SuppressWarnings("unchecked") public void testMapTtl() throws Throwable { List<Copycat> copycats = createCopycats(3); Copycat copycat = copycats.get(0); DistributedMap<String, String> map = copycat.create("test", DistributedMap.class).get(); map.put("foo", "Hello world!", Duration.ofSeconds(1)).thenRun(this::resume); await(); map.get("foo").thenAccept(result -> { threadAssertEquals(result, "Hello world!"); resume(); }); await(); Thread.sleep(3000); map.get("foo").thenAccept(result -> { threadAssertNull(result); resume(); }); await(); map.size().thenAccept(size -> { threadAssertEquals(size, 0); resume(); }); await(); }
@SuppressWarnings(STR) void function() throws Throwable { List<Copycat> copycats = createCopycats(3); Copycat copycat = copycats.get(0); DistributedMap<String, String> map = copycat.create("test", DistributedMap.class).get(); map.put("foo", STR, Duration.ofSeconds(1)).thenRun(this::resume); await(); map.get("foo").thenAccept(result -> { threadAssertEquals(result, STR); resume(); }); await(); Thread.sleep(3000); map.get("foo").thenAccept(result -> { threadAssertNull(result); resume(); }); await(); map.size().thenAccept(size -> { threadAssertEquals(size, 0); resume(); }); await(); }
/** * Tests TTL. */
Tests TTL
testMapTtl
{ "repo_name": "tempbottle/copycat", "path": "collections/src/test/java/net/kuujo/copycat/collections/DistributedMapTest.java", "license": "apache-2.0", "size": 5400 }
[ "java.time.Duration", "java.util.List", "net.kuujo.copycat.Copycat" ]
import java.time.Duration; import java.util.List; import net.kuujo.copycat.Copycat;
import java.time.*; import java.util.*; import net.kuujo.copycat.*;
[ "java.time", "java.util", "net.kuujo.copycat" ]
java.time; java.util; net.kuujo.copycat;
2,859,245
ProcessInstance getProcessInstance(CorrelationKey correlationKey);
ProcessInstance getProcessInstance(CorrelationKey correlationKey);
/** * Returns process instance information. Will return null if no * active process with that correlation key is found * * @param correlationKey correlation key assigned to process instance * @return Process instance information * @throws DeploymentNotFoundException in case deployment unit was not found */
Returns process instance information. Will return null if no active process with that correlation key is found
getProcessInstance
{ "repo_name": "etirelli/jbpm", "path": "jbpm-services/jbpm-services-api/src/main/java/org/jbpm/services/api/ProcessService.java", "license": "apache-2.0", "size": 18965 }
[ "org.kie.api.runtime.process.ProcessInstance", "org.kie.internal.process.CorrelationKey" ]
import org.kie.api.runtime.process.ProcessInstance; import org.kie.internal.process.CorrelationKey;
import org.kie.api.runtime.process.*; import org.kie.internal.process.*;
[ "org.kie.api", "org.kie.internal" ]
org.kie.api; org.kie.internal;
2,673,726
public Txn createRepTxn(TransactionConfig config, long mandatedId) { throw EnvironmentFailureException.unexpectedState ("Should not be called on a non replicated environment"); }
Txn function(TransactionConfig config, long mandatedId) { throw EnvironmentFailureException.unexpectedState (STR); }
/** * For replicated environments only; only the overridden method should * ever be called. * @throws DatabaseException from subclasses. */
For replicated environments only; only the overridden method should ever be called
createRepTxn
{ "repo_name": "bjorndm/prebake", "path": "code/third_party/bdb/src/com/sleepycat/je/dbi/EnvironmentImpl.java", "license": "apache-2.0", "size": 87347 }
[ "com.sleepycat.je.EnvironmentFailureException", "com.sleepycat.je.TransactionConfig", "com.sleepycat.je.txn.Txn" ]
import com.sleepycat.je.EnvironmentFailureException; import com.sleepycat.je.TransactionConfig; import com.sleepycat.je.txn.Txn;
import com.sleepycat.je.*; import com.sleepycat.je.txn.*;
[ "com.sleepycat.je" ]
com.sleepycat.je;
1,742,176
public static void login(String keytabLocation, String pricipalName) throws IOException { SecureHadoopUser.login(keytabLocation, pricipalName); }
static void function(String keytabLocation, String pricipalName) throws IOException { SecureHadoopUser.login(keytabLocation, pricipalName); }
/** * Login with the given keytab and principal. * @param keytabLocation path of keytab * @param pricipalName login principal * @throws IOException underlying exception from UserGroupInformation.loginUserFromKeytab */
Login with the given keytab and principal
login
{ "repo_name": "Eshcar/hbase", "path": "hbase-common/src/main/java/org/apache/hadoop/hbase/security/User.java", "license": "apache-2.0", "size": 14042 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,131,131
private void setCurrentImageItem(ImageItem imageItem) { if (imageItem != null) { progressBar.setVisibility(View.VISIBLE); if (foregroundImageView == image1) { setImage(image1, imageItem); } else { setImage(image2, imageItem); } titleTextView.setText(Html.fromHtml(imageItem.getTitle())); footerTextView.setText(Html.fromHtml(getString(R.string.author) + " " + imageItem.getOwner())); } }
void function(ImageItem imageItem) { if (imageItem != null) { progressBar.setVisibility(View.VISIBLE); if (foregroundImageView == image1) { setImage(image1, imageItem); } else { setImage(image2, imageItem); } titleTextView.setText(Html.fromHtml(imageItem.getTitle())); footerTextView.setText(Html.fromHtml(getString(R.string.author) + " " + imageItem.getOwner())); } }
/** * Display new photo in current image. * * @param imageItem */
Display new photo in current image
setCurrentImageItem
{ "repo_name": "entertailion/Slideshow-for-GTV", "path": "src/com/entertailion/android/slideshow/ViewImageActivity.java", "license": "apache-2.0", "size": 21410 }
[ "android.text.Html", "android.view.View", "com.entertailion.android.slideshow.images.ImageItem" ]
import android.text.Html; import android.view.View; import com.entertailion.android.slideshow.images.ImageItem;
import android.text.*; import android.view.*; import com.entertailion.android.slideshow.images.*;
[ "android.text", "android.view", "com.entertailion.android" ]
android.text; android.view; com.entertailion.android;
2,592,382
public void cacheResourceList(String key, List<CmsResource> resourceList) { if (m_disabled.get(CacheType.RESOURCE_LIST) != null) { return; } m_cacheResourceList.put(key, resourceList); }
void function(String key, List<CmsResource> resourceList) { if (m_disabled.get(CacheType.RESOURCE_LIST) != null) { return; } m_cacheResourceList.put(key, resourceList); }
/** * Caches the given resource list under the given cache key.<p> * * @param key the cache key * @param resourceList the resource list to cache */
Caches the given resource list under the given cache key
cacheResourceList
{ "repo_name": "it-tavis/opencms-core", "path": "src/org/opencms/monitor/CmsMemoryMonitor.java", "license": "lgpl-2.1", "size": 86968 }
[ "java.util.List", "org.opencms.file.CmsResource" ]
import java.util.List; import org.opencms.file.CmsResource;
import java.util.*; import org.opencms.file.*;
[ "java.util", "org.opencms.file" ]
java.util; org.opencms.file;
139,584
@POST @Path("/pause") @Produces(MediaType.APPLICATION_JSON) public Response pauseHTTP( @Context final HttpServletRequest req ) throws InterruptedException { authorizationCheck(req, Action.WRITE); return pause(); }
@Path(STR) @Produces(MediaType.APPLICATION_JSON) Response function( @Context final HttpServletRequest req ) throws InterruptedException { authorizationCheck(req, Action.WRITE); return pause(); }
/** * Signals the ingestion loop to pause. * * @return one of the following Responses: 400 Bad Request if the task has started publishing; 202 Accepted if the * method has timed out and returned before the task has paused; 200 OK with a map of the current partition sequences * in the response body if the task successfully paused */
Signals the ingestion loop to pause
pauseHTTP
{ "repo_name": "mghosh4/druid", "path": "indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java", "license": "apache-2.0", "size": 77012 }
[ "javax.servlet.http.HttpServletRequest", "javax.ws.rs.Path", "javax.ws.rs.Produces", "javax.ws.rs.core.Context", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response", "org.apache.druid.server.security.Action" ]
import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.apache.druid.server.security.Action;
import javax.servlet.http.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.apache.druid.server.security.*;
[ "javax.servlet", "javax.ws", "org.apache.druid" ]
javax.servlet; javax.ws; org.apache.druid;
1,747,074
protected final InternalAggregations bucketAggregations(long bucket) throws IOException { final InternalAggregation[] aggregations = new InternalAggregation[subAggregators.length]; for (int i = 0; i < subAggregators.length; i++) { aggregations[i] = subAggregators[i].buildAggregation(bucket); } return new InternalAggregations(Arrays.asList(aggregations)); }
final InternalAggregations function(long bucket) throws IOException { final InternalAggregation[] aggregations = new InternalAggregation[subAggregators.length]; for (int i = 0; i < subAggregators.length; i++) { aggregations[i] = subAggregators[i].buildAggregation(bucket); } return new InternalAggregations(Arrays.asList(aggregations)); }
/** * Required method to build the child aggregations of the given bucket (identified by the bucket ordinal). */
Required method to build the child aggregations of the given bucket (identified by the bucket ordinal)
bucketAggregations
{ "repo_name": "gfyoung/elasticsearch", "path": "server/src/main/java/org/elasticsearch/search/aggregations/bucket/BucketsAggregator.java", "license": "apache-2.0", "size": 6649 }
[ "java.io.IOException", "java.util.Arrays", "org.elasticsearch.search.aggregations.InternalAggregation", "org.elasticsearch.search.aggregations.InternalAggregations" ]
import java.io.IOException; import java.util.Arrays; import org.elasticsearch.search.aggregations.InternalAggregation; import org.elasticsearch.search.aggregations.InternalAggregations;
import java.io.*; import java.util.*; import org.elasticsearch.search.aggregations.*;
[ "java.io", "java.util", "org.elasticsearch.search" ]
java.io; java.util; org.elasticsearch.search;
1,932,627
private static int decodeIntLittleEndian(ByteBuffer encode) { encode.order(ByteOrder.LITTLE_ENDIAN); int value = encode.getInt(); encode.order(ByteOrder.BIG_ENDIAN); return value; }
static int function(ByteBuffer encode) { encode.order(ByteOrder.LITTLE_ENDIAN); int value = encode.getInt(); encode.order(ByteOrder.BIG_ENDIAN); return value; }
/** * Retrieve an encoded int in little endian starting at index in the * string value. * * @param encode string to get int from * @return the decoded integer */
Retrieve an encoded int in little endian starting at index in the string value
decodeIntLittleEndian
{ "repo_name": "google-code/android-scripting", "path": "jruby/src/src/org/jruby/util/Pack.java", "license": "apache-2.0", "size": 86171 }
[ "java.nio.ByteBuffer", "java.nio.ByteOrder" ]
import java.nio.ByteBuffer; import java.nio.ByteOrder;
import java.nio.*;
[ "java.nio" ]
java.nio;
1,595,766
public void loadRulesForSubKeys(String regionCode) { ThreadUtils.assertOnUiThread(); PersonalDataManagerJni.get().loadRulesForSubKeys( mPersonalDataManagerAndroid, PersonalDataManager.this, regionCode); }
void function(String regionCode) { ThreadUtils.assertOnUiThread(); PersonalDataManagerJni.get().loadRulesForSubKeys( mPersonalDataManagerAndroid, PersonalDataManager.this, regionCode); }
/** * Starts loading the sub-key request rules for the specified {@code regionCode}. * * @param regionCode The code of the region for which to load the rules. */
Starts loading the sub-key request rules for the specified regionCode
loadRulesForSubKeys
{ "repo_name": "chromium/chromium", "path": "chrome/android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java", "license": "bsd-3-clause", "size": 61009 }
[ "org.chromium.base.ThreadUtils" ]
import org.chromium.base.ThreadUtils;
import org.chromium.base.*;
[ "org.chromium.base" ]
org.chromium.base;
1,359,974
Future<JobListResponse> listAsync(JobListParameters parameters);
Future<JobListResponse> listAsync(JobListParameters parameters);
/** * Get the list of all jobs in a job collection. * * @param parameters Required. Parameters supplied to the List Jobs * operation. * @return The List Jobs operation response. */
Get the list of all jobs in a job collection
listAsync
{ "repo_name": "flydream2046/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-scheduler/src/main/java/com/microsoft/windowsazure/scheduler/JobOperations.java", "license": "apache-2.0", "size": 13088 }
[ "com.microsoft.windowsazure.scheduler.models.JobListParameters", "com.microsoft.windowsazure.scheduler.models.JobListResponse", "java.util.concurrent.Future" ]
import com.microsoft.windowsazure.scheduler.models.JobListParameters; import com.microsoft.windowsazure.scheduler.models.JobListResponse; import java.util.concurrent.Future;
import com.microsoft.windowsazure.scheduler.models.*; import java.util.concurrent.*;
[ "com.microsoft.windowsazure", "java.util" ]
com.microsoft.windowsazure; java.util;
415,683
public void addUser(String name, String email, String uid, String rank,String created_at) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(KEY_NAME, name); // Name values.put(KEY_EMAIL, email); // Email values.put(KEY_UID, uid); // uid values.put(KEY_RANK,rank); values.put(KEY_CREATED_AT, created_at); // Created At // Inserting Row db.insert(TABLE_LOGIN, null, values); }
void function(String name, String email, String uid, String rank,String created_at) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(KEY_NAME, name); values.put(KEY_EMAIL, email); values.put(KEY_UID, uid); values.put(KEY_RANK,rank); values.put(KEY_CREATED_AT, created_at); db.insert(TABLE_LOGIN, null, values); }
/** * Storing user details in database */
Storing user details in database
addUser
{ "repo_name": "mankwok/BestPriceHK", "path": "app/src/main/java/com/oufyp/bestpricehk/database/DatabaseHandler.java", "license": "mit", "size": 6828 }
[ "android.content.ContentValues", "android.database.sqlite.SQLiteDatabase" ]
import android.content.ContentValues; import android.database.sqlite.SQLiteDatabase;
import android.content.*; import android.database.sqlite.*;
[ "android.content", "android.database" ]
android.content; android.database;
1,558,868
public State removeState(String key) { State state = null; if (states.containsKey(key)) { state = states.get(key); states.remove(key); if (actStateId.equals(key)) { activeState = null; StateMachine.actStateId = ""; } } return state; }
State function(String key) { State state = null; if (states.containsKey(key)) { state = states.get(key); states.remove(key); if (actStateId.equals(key)) { activeState = null; StateMachine.actStateId = ""; } } return state; }
/** * Removes a {@link State} from the list. * * @param key * The key identifier of the {@link State} to be removed. */
Removes a <code>State</code> from the list
removeState
{ "repo_name": "mzinelli/space-Lamsa", "path": "src/com/mpu/spinv/engine/StateMachine.java", "license": "mit", "size": 3258 }
[ "com.mpu.spinv.engine.model.State" ]
import com.mpu.spinv.engine.model.State;
import com.mpu.spinv.engine.model.*;
[ "com.mpu.spinv" ]
com.mpu.spinv;
927,673
@Test public void shouldReturnMinimumVertOffsetB07() { ObjectNode testInput = JsonUtils.newNode().put("offset", -63); BigDecimal expectedValue = BigDecimal.valueOf(-6.3); BigDecimal actualValue = OffsetBuilder.genericVertOffset_B07(testInput.get("offset")); assertEquals(expectedValue, actualValue); }
void function() { ObjectNode testInput = JsonUtils.newNode().put(STR, -63); BigDecimal expectedValue = BigDecimal.valueOf(-6.3); BigDecimal actualValue = OffsetBuilder.genericVertOffset_B07(testInput.get(STR)); assertEquals(expectedValue, actualValue); }
/** * Test that a minimum vertical offset of -63 returns -6.3 */
Test that a minimum vertical offset of -63 returns -6.3
shouldReturnMinimumVertOffsetB07
{ "repo_name": "usdot-jpo-ode/jpo-ode", "path": "jpo-ode-plugins/src/test/java/us/dot/its/jpo/ode/plugin/j2735/builders/OffsetBuilderTest.java", "license": "apache-2.0", "size": 11483 }
[ "com.fasterxml.jackson.databind.node.ObjectNode", "java.math.BigDecimal", "org.junit.Assert", "us.dot.its.jpo.ode.util.JsonUtils" ]
import com.fasterxml.jackson.databind.node.ObjectNode; import java.math.BigDecimal; import org.junit.Assert; import us.dot.its.jpo.ode.util.JsonUtils;
import com.fasterxml.jackson.databind.node.*; import java.math.*; import org.junit.*; import us.dot.its.jpo.ode.util.*;
[ "com.fasterxml.jackson", "java.math", "org.junit", "us.dot.its" ]
com.fasterxml.jackson; java.math; org.junit; us.dot.its;
1,866,811
private void ackSystemProperties() { assert log != null; if (log.isDebugEnabled() && S.INCLUDE_SENSITIVE) for (Map.Entry<Object, Object> entry : snapshot().entrySet()) log.debug("System property [" + entry.getKey() + '=' + entry.getValue() + ']'); }
void function() { assert log != null; if (log.isDebugEnabled() && S.INCLUDE_SENSITIVE) for (Map.Entry<Object, Object> entry : snapshot().entrySet()) log.debug(STR + entry.getKey() + '=' + entry.getValue() + ']'); }
/** * Prints all system properties in debug mode. */
Prints all system properties in debug mode
ackSystemProperties
{ "repo_name": "sk0x50/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java", "license": "apache-2.0", "size": 150674 }
[ "java.util.Map", "org.apache.ignite.IgniteSystemProperties" ]
import java.util.Map; import org.apache.ignite.IgniteSystemProperties;
import java.util.*; import org.apache.ignite.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
1,019,230
public void updateDataPointComponent( String name, EObject eParentObj, DataPointComponent eObj, DataPointComponent eRefObj, DataPointComponent eDefObj, boolean eDefOverride, boolean checkVisible ) { if ( eObj == null ) { if ( eRefObj != null ) { eObj = eRefObj.copyInstance( ); ChartElementUtil.setEObjectAttribute( eParentObj, name, eObj, false ); } else if ( eDefOverride && eDefObj != null ) { eObj = eDefObj.copyInstance( ); ChartElementUtil.setEObjectAttribute( eParentObj, name, eObj, false ); return; } } if ( eObj == null || ( eRefObj == null && eDefObj == null ) ) { return; } // attributes if ( !eObj.isSetType( ) ) { if ( eRefObj != null && eRefObj.isSetType( ) ) { eObj.setType( eRefObj.getType( ) ); } else if ( eDefObj != null && eDefObj.isSetType( ) ) { eObj.setType( eDefObj.getType( ) ); } } if ( !eObj.isSetOrthogonalType( ) ) { if ( eRefObj != null && eRefObj.isSetOrthogonalType( ) ) { eObj.setOrthogonalType( eRefObj.getOrthogonalType( ) ); } else if ( eDefObj != null && eDefObj.isSetOrthogonalType( ) ) { eObj.setOrthogonalType( eDefObj.getOrthogonalType( ) ); } } // list attributes // references updateFormatSpecifier( "formatSpecifier", eObj, eObj.getFormatSpecifier( ), eRefObj == null ? null : eRefObj.getFormatSpecifier( ), eDefObj == null ? null : eDefObj.getFormatSpecifier( ), eDefOverride, checkVisible ); }
void function( String name, EObject eParentObj, DataPointComponent eObj, DataPointComponent eRefObj, DataPointComponent eDefObj, boolean eDefOverride, boolean checkVisible ) { if ( eObj == null ) { if ( eRefObj != null ) { eObj = eRefObj.copyInstance( ); ChartElementUtil.setEObjectAttribute( eParentObj, name, eObj, false ); } else if ( eDefOverride && eDefObj != null ) { eObj = eDefObj.copyInstance( ); ChartElementUtil.setEObjectAttribute( eParentObj, name, eObj, false ); return; } } if ( eObj == null ( eRefObj == null && eDefObj == null ) ) { return; } if ( !eObj.isSetType( ) ) { if ( eRefObj != null && eRefObj.isSetType( ) ) { eObj.setType( eRefObj.getType( ) ); } else if ( eDefObj != null && eDefObj.isSetType( ) ) { eObj.setType( eDefObj.getType( ) ); } } if ( !eObj.isSetOrthogonalType( ) ) { if ( eRefObj != null && eRefObj.isSetOrthogonalType( ) ) { eObj.setOrthogonalType( eRefObj.getOrthogonalType( ) ); } else if ( eDefObj != null && eDefObj.isSetOrthogonalType( ) ) { eObj.setOrthogonalType( eDefObj.getOrthogonalType( ) ); } } updateFormatSpecifier( STR, eObj, eObj.getFormatSpecifier( ), eRefObj == null ? null : eRefObj.getFormatSpecifier( ), eDefObj == null ? null : eDefObj.getFormatSpecifier( ), eDefOverride, checkVisible ); }
/** * Updates chart element DataPointComponent. * * @param eObj * chart element object. * @param eRefObj * reference chart element object. * @param eDefObj * default chart element object. * @param eDefOverride * indicates if using default object to override target object if target is null. * @param checkVisible * indicates if still checking visible of chart element before updating properties of chart element. * * @generated Don't change this method manually. */
Updates chart element DataPointComponent
updateDataPointComponent
{ "repo_name": "sguan-actuate/birt", "path": "chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/model/util/BaseChartValueUpdater.java", "license": "epl-1.0", "size": 274069 }
[ "org.eclipse.birt.chart.model.attribute.DataPointComponent", "org.eclipse.emf.ecore.EObject" ]
import org.eclipse.birt.chart.model.attribute.DataPointComponent; import org.eclipse.emf.ecore.EObject;
import org.eclipse.birt.chart.model.attribute.*; import org.eclipse.emf.ecore.*;
[ "org.eclipse.birt", "org.eclipse.emf" ]
org.eclipse.birt; org.eclipse.emf;
358,815
private List<ExternalIdentifierBean> getExternalIdentiferBeanCollection(Collection<ExternalIdentifier> externalIdentiferColl) { final List<ExternalIdentifierBean> externalIdentiferBeanColl = new ArrayList<ExternalIdentifierBean>(); if (externalIdentiferColl != null) { final Iterator<ExternalIdentifier> externalIdItr = externalIdentiferColl.iterator(); while (externalIdItr.hasNext()) { final ExternalIdentifier externalIdentifer = (ExternalIdentifier) externalIdItr .next(); final ExternalIdentifierBean externalIdBean = new ExternalIdentifierBean(); externalIdBean.setId(externalIdentifer.getId()); externalIdBean.setName(externalIdentifer.getName()); externalIdBean.setValue(externalIdentifer.getValue()); externalIdentiferBeanColl.add(externalIdBean); } } return externalIdentiferBeanColl; }
List<ExternalIdentifierBean> function(Collection<ExternalIdentifier> externalIdentiferColl) { final List<ExternalIdentifierBean> externalIdentiferBeanColl = new ArrayList<ExternalIdentifierBean>(); if (externalIdentiferColl != null) { final Iterator<ExternalIdentifier> externalIdItr = externalIdentiferColl.iterator(); while (externalIdItr.hasNext()) { final ExternalIdentifier externalIdentifer = (ExternalIdentifier) externalIdItr .next(); final ExternalIdentifierBean externalIdBean = new ExternalIdentifierBean(); externalIdBean.setId(externalIdentifer.getId()); externalIdBean.setName(externalIdentifer.getName()); externalIdBean.setValue(externalIdentifer.getValue()); externalIdentiferBeanColl.add(externalIdBean); } } return externalIdentiferBeanColl; }
/** * Gets the external identifer bean collection. * * @param externalIdentiferColl the external identifer coll * * @return list of ExternalIdentiferBeanCollection */
Gets the external identifer bean collection
getExternalIdentiferBeanCollection
{ "repo_name": "NCIP/catissue-core", "path": "software/caTissue/modules/core/src/main/java/edu/wustl/catissuecore/flex/FlexInterface.java", "license": "bsd-3-clause", "size": 66403 }
[ "edu.wustl.catissuecore.domain.ExternalIdentifier", "java.util.ArrayList", "java.util.Collection", "java.util.Iterator", "java.util.List" ]
import edu.wustl.catissuecore.domain.ExternalIdentifier; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List;
import edu.wustl.catissuecore.domain.*; import java.util.*;
[ "edu.wustl.catissuecore", "java.util" ]
edu.wustl.catissuecore; java.util;
1,772,558
public void setSecondaryMenu(View v) { mViewBehind.setSecondaryContent(v); // mViewBehind.invalidate(); }
void function(View v) { mViewBehind.setSecondaryContent(v); }
/** * Set the secondary behind view (right menu) content to the given View. * * @param view The desired content to display. */
Set the secondary behind view (right menu) content to the given View
setSecondaryMenu
{ "repo_name": "yinglovezhuzhu/SlidingMenu", "path": "SliddingMenu/src/com/opensource/slidingmenu/SlidingMenu.java", "license": "apache-2.0", "size": 28051 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
779,470
private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtilities.writePaint(this.errorIndicatorPaint, stream); SerialUtilities.writeStroke(this.errorIndicatorStroke, stream); }
void function(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtilities.writePaint(this.errorIndicatorPaint, stream); SerialUtilities.writeStroke(this.errorIndicatorStroke, stream); }
/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */
Provides serialization support
writeObject
{ "repo_name": "ilyessou/jfreechart", "path": "source/org/jfree/chart/renderer/category/StatisticalBarRenderer.java", "license": "lgpl-2.1", "size": 23815 }
[ "java.io.IOException", "java.io.ObjectOutputStream", "org.jfree.chart.util.SerialUtilities" ]
import java.io.IOException; import java.io.ObjectOutputStream; import org.jfree.chart.util.SerialUtilities;
import java.io.*; import org.jfree.chart.util.*;
[ "java.io", "org.jfree.chart" ]
java.io; org.jfree.chart;
244,887
public Adapter createList1Adapter() { return null; }
Adapter function() { return null; }
/** * Creates a new adapter for an object of class '{@link org.eclipse.xtext.serializer.sequencertest.List1 <em>List1</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> * @return the new adapter. * @see org.eclipse.xtext.serializer.sequencertest.List1 * @generated */
Creates a new adapter for an object of class '<code>org.eclipse.xtext.serializer.sequencertest.List1 List1</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
createList1Adapter
{ "repo_name": "miklossy/xtext-core", "path": "org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/serializer/sequencertest/util/SequencertestAdapterFactory.java", "license": "epl-1.0", "size": 39311 }
[ "org.eclipse.emf.common.notify.Adapter" ]
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
256,684
private void pcepUpdateTunnel(Tunnel tunnel, Path path, PcepClient pc) { try { PcepTunnelData pcepTunnelData = new PcepTunnelData(tunnel, path, UPDATE); pcepTunnelApiMapper.addToCoreTunnelRequestQueue(pcepTunnelData); int srpId = SrpIdGenerators.create(); PcepValueType tlv; LinkedList<PcepValueType> llSubObjects = null; LspType lspSigType = LspType.valueOf(tunnel.annotations().value(LSP_SIG_TYPE)); if (lspSigType == SR_WITHOUT_SIGNALLING) { NetworkResource labelStack = tunnel.resource(); if (labelStack == null || !(labelStack instanceof DefaultLabelStack)) { labelStack = pcepClientController.computeLabelStack(tunnel.path()); if (labelStack == null) { log.error("Unable to create label stack."); return; } } llSubObjects = pcepClientController.createPcepLabelStack((DefaultLabelStack) labelStack, path); } else { llSubObjects = createPcepPath(path); } LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>(); LinkedList<PcepUpdateRequest> llUpdateRequestList = new LinkedList<PcepUpdateRequest>(); // set PathSetupTypeTlv of SRP object tlv = new PathSetupTypeTlv(lspSigType.type()); llOptionalTlv.add(tlv); // build SRP object PcepSrpObject srpobj = pc.factory().buildSrpObject().setSrpID(srpId).setRFlag(false) .setOptionalTlv(llOptionalTlv).build(); llOptionalTlv = new LinkedList<PcepValueType>(); if (lspSigType != WITH_SIGNALLING) { String localLspIdString = tunnel.annotations().value(LOCAL_LSP_ID); String pccTunnelIdString = tunnel.annotations().value(PCC_TUNNEL_ID); short localLspId = 0; short pccTunnelId = 0; if (localLspIdString != null) { localLspId = Short.valueOf(localLspIdString); } if (pccTunnelIdString != null) { pccTunnelId = Short.valueOf(pccTunnelIdString); } tlv = new StatefulIPv4LspIdentifiersTlv((((IpTunnelEndPoint) tunnel.src()) .ip().getIp4Address().toInt()), localLspId, pccTunnelId, ((IpTunnelEndPoint) tunnel.src()).ip().getIp4Address().toInt(), (((IpTunnelEndPoint) tunnel.dst()).ip().getIp4Address().toInt())); llOptionalTlv.add(tlv); } if (tunnel.tunnelName().value() != null) { tlv = new SymbolicPathNameTlv(tunnel.tunnelName().value().getBytes()); llOptionalTlv.add(tlv); } boolean delegated = (tunnel.annotations().value(DELEGATE) == null) ? false : Boolean.valueOf(tunnel.annotations() .value(DELEGATE)); boolean initiated = (tunnel.annotations().value(PCE_INIT) == null) ? false : Boolean.valueOf(tunnel.annotations() .value(PCE_INIT)); // build lsp object PcepLspObject lspobj = pc.factory().buildLspObject().setAFlag(true) .setPlspId(Integer.valueOf(tunnel.annotations().value(PLSP_ID))) .setDFlag(delegated) .setCFlag(initiated) .setOptionalTlv(llOptionalTlv).build(); // build ero object PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build(); float iBandwidth = DEFAULT_BANDWIDTH_VALUE; if (tunnel.annotations().value(BANDWIDTH) != null) { iBandwidth = Float.parseFloat(tunnel.annotations().value(BANDWIDTH)); } // build bandwidth object PcepBandwidthObject bandwidthObject = pc.factory().buildBandwidthObject().setBandwidth(iBandwidth).build(); // build pcep attribute PcepAttribute pcepAttribute = pc.factory().buildPcepAttribute().setBandwidthObject(bandwidthObject).build(); // build pcep msg path PcepMsgPath msgPath = pc.factory().buildPcepMsgPath().setEroObject(eroobj).setPcepAttribute(pcepAttribute) .build(); PcepUpdateRequest updateRequest = pc.factory().buildPcepUpdateRequest().setSrpObject(srpobj) .setLspObject(lspobj).setMsgPath(msgPath).build(); llUpdateRequestList.add(updateRequest); PcepUpdateMsg pcUpdateMsg = pc.factory().buildUpdateMsg().setUpdateRequestList(llUpdateRequestList).build(); pc.sendMessage(Collections.singletonList(pcUpdateMsg)); pcepTunnelApiMapper.addToTunnelRequestQueue(srpId, pcepTunnelData); } catch (PcepParseException e) { log.error("PcepParseException occurred while processing release tunnel {}", e.getMessage()); } } private class InnerTunnelProvider implements PcepTunnelListener, PcepEventListener, PcepClientListener {
void function(Tunnel tunnel, Path path, PcepClient pc) { try { PcepTunnelData pcepTunnelData = new PcepTunnelData(tunnel, path, UPDATE); pcepTunnelApiMapper.addToCoreTunnelRequestQueue(pcepTunnelData); int srpId = SrpIdGenerators.create(); PcepValueType tlv; LinkedList<PcepValueType> llSubObjects = null; LspType lspSigType = LspType.valueOf(tunnel.annotations().value(LSP_SIG_TYPE)); if (lspSigType == SR_WITHOUT_SIGNALLING) { NetworkResource labelStack = tunnel.resource(); if (labelStack == null !(labelStack instanceof DefaultLabelStack)) { labelStack = pcepClientController.computeLabelStack(tunnel.path()); if (labelStack == null) { log.error(STR); return; } } llSubObjects = pcepClientController.createPcepLabelStack((DefaultLabelStack) labelStack, path); } else { llSubObjects = createPcepPath(path); } LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>(); LinkedList<PcepUpdateRequest> llUpdateRequestList = new LinkedList<PcepUpdateRequest>(); tlv = new PathSetupTypeTlv(lspSigType.type()); llOptionalTlv.add(tlv); PcepSrpObject srpobj = pc.factory().buildSrpObject().setSrpID(srpId).setRFlag(false) .setOptionalTlv(llOptionalTlv).build(); llOptionalTlv = new LinkedList<PcepValueType>(); if (lspSigType != WITH_SIGNALLING) { String localLspIdString = tunnel.annotations().value(LOCAL_LSP_ID); String pccTunnelIdString = tunnel.annotations().value(PCC_TUNNEL_ID); short localLspId = 0; short pccTunnelId = 0; if (localLspIdString != null) { localLspId = Short.valueOf(localLspIdString); } if (pccTunnelIdString != null) { pccTunnelId = Short.valueOf(pccTunnelIdString); } tlv = new StatefulIPv4LspIdentifiersTlv((((IpTunnelEndPoint) tunnel.src()) .ip().getIp4Address().toInt()), localLspId, pccTunnelId, ((IpTunnelEndPoint) tunnel.src()).ip().getIp4Address().toInt(), (((IpTunnelEndPoint) tunnel.dst()).ip().getIp4Address().toInt())); llOptionalTlv.add(tlv); } if (tunnel.tunnelName().value() != null) { tlv = new SymbolicPathNameTlv(tunnel.tunnelName().value().getBytes()); llOptionalTlv.add(tlv); } boolean delegated = (tunnel.annotations().value(DELEGATE) == null) ? false : Boolean.valueOf(tunnel.annotations() .value(DELEGATE)); boolean initiated = (tunnel.annotations().value(PCE_INIT) == null) ? false : Boolean.valueOf(tunnel.annotations() .value(PCE_INIT)); PcepLspObject lspobj = pc.factory().buildLspObject().setAFlag(true) .setPlspId(Integer.valueOf(tunnel.annotations().value(PLSP_ID))) .setDFlag(delegated) .setCFlag(initiated) .setOptionalTlv(llOptionalTlv).build(); PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build(); float iBandwidth = DEFAULT_BANDWIDTH_VALUE; if (tunnel.annotations().value(BANDWIDTH) != null) { iBandwidth = Float.parseFloat(tunnel.annotations().value(BANDWIDTH)); } PcepBandwidthObject bandwidthObject = pc.factory().buildBandwidthObject().setBandwidth(iBandwidth).build(); PcepAttribute pcepAttribute = pc.factory().buildPcepAttribute().setBandwidthObject(bandwidthObject).build(); PcepMsgPath msgPath = pc.factory().buildPcepMsgPath().setEroObject(eroobj).setPcepAttribute(pcepAttribute) .build(); PcepUpdateRequest updateRequest = pc.factory().buildPcepUpdateRequest().setSrpObject(srpobj) .setLspObject(lspobj).setMsgPath(msgPath).build(); llUpdateRequestList.add(updateRequest); PcepUpdateMsg pcUpdateMsg = pc.factory().buildUpdateMsg().setUpdateRequestList(llUpdateRequestList).build(); pc.sendMessage(Collections.singletonList(pcUpdateMsg)); pcepTunnelApiMapper.addToTunnelRequestQueue(srpId, pcepTunnelData); } catch (PcepParseException e) { log.error(STR, e.getMessage()); } } private class InnerTunnelProvider implements PcepTunnelListener, PcepEventListener, PcepClientListener {
/** * To send Update tunnel request message to pcc. * * @param tunnel mpls tunnel info * @param path explicit route for the tunnel * @param pc pcep client to send message */
To send Update tunnel request message to pcc
pcepUpdateTunnel
{ "repo_name": "donNewtonAlpha/onos", "path": "providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java", "license": "apache-2.0", "size": 89937 }
[ "java.util.Collections", "java.util.LinkedList", "org.onosproject.incubator.net.tunnel.DefaultLabelStack", "org.onosproject.incubator.net.tunnel.IpTunnelEndPoint", "org.onosproject.incubator.net.tunnel.Tunnel", "org.onosproject.net.NetworkResource", "org.onosproject.net.Path", "org.onosproject.pcep.api.PcepTunnelListener", "org.onosproject.pcep.controller.LspType", "org.onosproject.pcep.controller.PcepClient", "org.onosproject.pcep.controller.PcepClientListener", "org.onosproject.pcep.controller.PcepEventListener", "org.onosproject.pcep.controller.SrpIdGenerators", "org.onosproject.pcepio.exceptions.PcepParseException", "org.onosproject.pcepio.protocol.PcepAttribute", "org.onosproject.pcepio.protocol.PcepBandwidthObject", "org.onosproject.pcepio.protocol.PcepEroObject", "org.onosproject.pcepio.protocol.PcepLspObject", "org.onosproject.pcepio.protocol.PcepMsgPath", "org.onosproject.pcepio.protocol.PcepSrpObject", "org.onosproject.pcepio.protocol.PcepUpdateMsg", "org.onosproject.pcepio.protocol.PcepUpdateRequest", "org.onosproject.pcepio.types.PathSetupTypeTlv", "org.onosproject.pcepio.types.PcepValueType", "org.onosproject.pcepio.types.StatefulIPv4LspIdentifiersTlv", "org.onosproject.pcepio.types.SymbolicPathNameTlv" ]
import java.util.Collections; import java.util.LinkedList; import org.onosproject.incubator.net.tunnel.DefaultLabelStack; import org.onosproject.incubator.net.tunnel.IpTunnelEndPoint; import org.onosproject.incubator.net.tunnel.Tunnel; import org.onosproject.net.NetworkResource; import org.onosproject.net.Path; import org.onosproject.pcep.api.PcepTunnelListener; import org.onosproject.pcep.controller.LspType; import org.onosproject.pcep.controller.PcepClient; import org.onosproject.pcep.controller.PcepClientListener; import org.onosproject.pcep.controller.PcepEventListener; import org.onosproject.pcep.controller.SrpIdGenerators; import org.onosproject.pcepio.exceptions.PcepParseException; import org.onosproject.pcepio.protocol.PcepAttribute; import org.onosproject.pcepio.protocol.PcepBandwidthObject; import org.onosproject.pcepio.protocol.PcepEroObject; import org.onosproject.pcepio.protocol.PcepLspObject; import org.onosproject.pcepio.protocol.PcepMsgPath; import org.onosproject.pcepio.protocol.PcepSrpObject; import org.onosproject.pcepio.protocol.PcepUpdateMsg; import org.onosproject.pcepio.protocol.PcepUpdateRequest; import org.onosproject.pcepio.types.PathSetupTypeTlv; import org.onosproject.pcepio.types.PcepValueType; import org.onosproject.pcepio.types.StatefulIPv4LspIdentifiersTlv; import org.onosproject.pcepio.types.SymbolicPathNameTlv;
import java.util.*; import org.onosproject.incubator.net.tunnel.*; import org.onosproject.net.*; import org.onosproject.pcep.api.*; import org.onosproject.pcep.controller.*; import org.onosproject.pcepio.exceptions.*; import org.onosproject.pcepio.protocol.*; import org.onosproject.pcepio.types.*;
[ "java.util", "org.onosproject.incubator", "org.onosproject.net", "org.onosproject.pcep", "org.onosproject.pcepio" ]
java.util; org.onosproject.incubator; org.onosproject.net; org.onosproject.pcep; org.onosproject.pcepio;
2,417,646
public static String getFolderName(String filePath) { if (TextUtils.isEmpty(filePath)) { return filePath; } int filePosi = filePath.lastIndexOf(File.separator); if (filePosi == -1) { return ""; } return filePath.substring(0, filePosi); }
static String function(String filePath) { if (TextUtils.isEmpty(filePath)) { return filePath; } int filePosi = filePath.lastIndexOf(File.separator); if (filePosi == -1) { return ""; } return filePath.substring(0, filePosi); }
/** * Get folder name from the path * * @param filePath * The path of the file * @return String The folder path * @see <pre> * getFolderName(null) = null * getFolderName("") = "" * getFolderName(" ") = "" * getFolderName("a.mp3") = "" * getFolderName("a.b.rmvb") = "" * getFolderName("abc") = "" * getFolderName("/home/admin") = "/home" * getFolderName("/home/admin/a.txt/b.mp3") = "/home/admin/a.txt" * </pre> */
Get folder name from the path
getFolderName
{ "repo_name": "cowthan/AyoWeibo", "path": "ayosdk/src/main/java/org/ayo/file/FileUtils1.java", "license": "apache-2.0", "size": 20250 }
[ "android.text.TextUtils", "java.io.File" ]
import android.text.TextUtils; import java.io.File;
import android.text.*; import java.io.*;
[ "android.text", "java.io" ]
android.text; java.io;
1,942,632
public String getStringEnvVar(String arg1) throws NamingException { printMsg(BeanName, "----->getStringEnvVar with parameter " + arg1); Context initCtx = new InitialContext(); String value = (String) initCtx.lookup("java:comp/env/" + arg1); printMsg(BeanName, "----->envString = " + value); return value; }
String function(String arg1) throws NamingException { printMsg(BeanName, STR + arg1); Context initCtx = new InitialContext(); String value = (String) initCtx.lookup(STR + arg1); printMsg(BeanName, STR + value); return value; }
/** * get String environment variable using java:comp/env */
get String environment variable using java:comp/env
getStringEnvVar
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.ejbcontainer.legacy_fat/test-applications/EJB2XSLRemoteSpecEJB.jar/src/com/ibm/ejb2x/base/spec/slr/ejb/SLRaBean.java", "license": "epl-1.0", "size": 20584 }
[ "javax.naming.Context", "javax.naming.InitialContext", "javax.naming.NamingException" ]
import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException;
import javax.naming.*;
[ "javax.naming" ]
javax.naming;
2,386,897
public CodeType getType() { return commands.getType(index); }
CodeType function() { return commands.getType(index); }
/** * Get code type of the current opcode / command. */
Get code type of the current opcode / command
getType
{ "repo_name": "markusheiden/c64dt", "path": "reassembler/src/main/java/de/heiden/c64dt/reassembler/command/CommandIterator.java", "license": "gpl-3.0", "size": 5196 }
[ "de.heiden.c64dt.assembler.CodeType" ]
import de.heiden.c64dt.assembler.CodeType;
import de.heiden.c64dt.assembler.*;
[ "de.heiden.c64dt" ]
de.heiden.c64dt;
116,863
public static String readAttribute(Node node, String attribute, String defaultValue) { NamedNodeMap attributes = node.getAttributes(); if (null == attributes) return defaultValue; Node attr = attributes.getNamedItem(attribute); if (null==attr) return defaultValue; return attr.getNodeValue(); }
static String function(Node node, String attribute, String defaultValue) { NamedNodeMap attributes = node.getAttributes(); if (null == attributes) return defaultValue; Node attr = attributes.getNamedItem(attribute); if (null==attr) return defaultValue; return attr.getNodeValue(); }
/** * Reads the value of the specified <code>attribute</code>, returning the * <code>defaultValue</code> string if not present. * * @param node node to read the attribute. * @param attribute attribute name. * @param defaultValue the default value to return if attribute is not found. * @return the attribute value or <code>defaultValue</code> if not found. */
Reads the value of the specified <code>attribute</code>, returning the <code>defaultValue</code> string if not present
readAttribute
{ "repo_name": "kidaa/any23", "path": "core/src/main/java/org/apache/any23/extractor/html/DomUtils.java", "license": "apache-2.0", "size": 21315 }
[ "org.w3c.dom.NamedNodeMap", "org.w3c.dom.Node" ]
import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
2,836,868
public FullyQualifiedName parse(String raw) { String[] typeAndName = raw.split("/"); Preconditions.checkArgument(typeAndName.length == 2, "Invalid type and name: %s", raw); Matcher matcher = PARSING_REGEX.matcher(raw); if (!matcher.matches()) { throw new IllegalArgumentException(String.format(INVALID_QUALIFIED_NAME_MESSAGE, raw)); } String parsedPackage = matcher.group("package"); ResourceType resourceType = ResourceType.getEnum(matcher.group("type")); String resourceName = matcher.group("name"); if (resourceType == null || resourceName == null) { throw new IllegalArgumentException(String.format(INVALID_QUALIFIED_NAME_MESSAGE, raw)); } return FullyQualifiedName.of( parsedPackage == null ? pkg : parsedPackage, qualifiers, resourceType, resourceName); } }
FullyQualifiedName function(String raw) { String[] typeAndName = raw.split("/"); Preconditions.checkArgument(typeAndName.length == 2, STR, raw); Matcher matcher = PARSING_REGEX.matcher(raw); if (!matcher.matches()) { throw new IllegalArgumentException(String.format(INVALID_QUALIFIED_NAME_MESSAGE, raw)); } String parsedPackage = matcher.group(STR); ResourceType resourceType = ResourceType.getEnum(matcher.group("type")); String resourceName = matcher.group("name"); if (resourceType == null resourceName == null) { throw new IllegalArgumentException(String.format(INVALID_QUALIFIED_NAME_MESSAGE, raw)); } return FullyQualifiedName.of( parsedPackage == null ? pkg : parsedPackage, qualifiers, resourceType, resourceName); } }
/** * Parses a FullyQualifiedName from a string. * * @param raw A string in the expected format from * [&lt;package&gt;:]&lt;ResourceType.name&gt;/&lt;resource name&gt;. * @throws IllegalArgumentException when the raw string is not valid qualified name. */
Parses a FullyQualifiedName from a string
parse
{ "repo_name": "anupcshan/bazel", "path": "src/tools/android/java/com/google/devtools/build/android/FullyQualifiedName.java", "license": "apache-2.0", "size": 9009 }
[ "com.android.resources.ResourceType", "com.google.common.base.Preconditions", "java.util.regex.Matcher" ]
import com.android.resources.ResourceType; import com.google.common.base.Preconditions; import java.util.regex.Matcher;
import com.android.resources.*; import com.google.common.base.*; import java.util.regex.*;
[ "com.android.resources", "com.google.common", "java.util" ]
com.android.resources; com.google.common; java.util;
1,052,692
@Override public void createEntityDoi(String entityId) throws SynapseException { createEntityDoi(entityId, null); }
void function(String entityId) throws SynapseException { createEntityDoi(entityId, null); }
/** * Creates a DOI for the specified entity. The DOI will always be associated * with the current version of the entity. */
Creates a DOI for the specified entity. The DOI will always be associated with the current version of the entity
createEntityDoi
{ "repo_name": "hhu94/Synapse-Repository-Services", "path": "client/synapseJavaClient/src/main/java/org/sagebionetworks/client/SynapseClientImpl.java", "license": "apache-2.0", "size": 187988 }
[ "org.sagebionetworks.client.exceptions.SynapseException" ]
import org.sagebionetworks.client.exceptions.SynapseException;
import org.sagebionetworks.client.exceptions.*;
[ "org.sagebionetworks.client" ]
org.sagebionetworks.client;
2,608,189
public String getLastEventLine() { EventLine tmp = previousEventLine; previousEventLine = null; if (tmp != null) { return tmp.getText(); } return null; }
String function() { EventLine tmp = previousEventLine; previousEventLine = null; if (tmp != null) { return tmp.getText(); } return null; }
/** * Get the previous message. Wipes it from memory. * * @return last message */
Get the previous message. Wipes it from memory
getLastEventLine
{ "repo_name": "markuskeunecke/stendhal", "path": "tests/games/stendhal/client/gui/MockUserInterface.java", "license": "gpl-2.0", "size": 2096 }
[ "games.stendhal.client.gui.chatlog.EventLine" ]
import games.stendhal.client.gui.chatlog.EventLine;
import games.stendhal.client.gui.chatlog.*;
[ "games.stendhal.client" ]
games.stendhal.client;
2,685,504
public static TickUnitSource createStandardTickUnits(Locale locale) { TickUnits units = new TickUnits(); NumberFormat numberFormat = NumberFormat.getNumberInstance(locale); // we can add the units in any order, the TickUnits collection will // sort them... units.add(new NumberTickUnit(0.0000001, numberFormat, 2)); units.add(new NumberTickUnit(0.000001, numberFormat, 2)); units.add(new NumberTickUnit(0.00001, numberFormat, 2)); units.add(new NumberTickUnit(0.0001, numberFormat, 2)); units.add(new NumberTickUnit(0.001, numberFormat, 2)); units.add(new NumberTickUnit(0.01, numberFormat, 2)); units.add(new NumberTickUnit(0.1, numberFormat, 2)); units.add(new NumberTickUnit(1, numberFormat, 2)); units.add(new NumberTickUnit(10, numberFormat, 2)); units.add(new NumberTickUnit(100, numberFormat, 2)); units.add(new NumberTickUnit(1000, numberFormat, 2)); units.add(new NumberTickUnit(10000, numberFormat, 2)); units.add(new NumberTickUnit(100000, numberFormat, 2)); units.add(new NumberTickUnit(1000000, numberFormat, 2)); units.add(new NumberTickUnit(10000000, numberFormat, 2)); units.add(new NumberTickUnit(100000000, numberFormat, 2)); units.add(new NumberTickUnit(1000000000, numberFormat, 2)); units.add(new NumberTickUnit(10000000000.0, numberFormat, 2)); units.add(new NumberTickUnit(0.00000025, numberFormat, 5)); units.add(new NumberTickUnit(0.0000025, numberFormat, 5)); units.add(new NumberTickUnit(0.000025, numberFormat, 5)); units.add(new NumberTickUnit(0.00025, numberFormat, 5)); units.add(new NumberTickUnit(0.0025, numberFormat, 5)); units.add(new NumberTickUnit(0.025, numberFormat, 5)); units.add(new NumberTickUnit(0.25, numberFormat, 5)); units.add(new NumberTickUnit(2.5, numberFormat, 5)); units.add(new NumberTickUnit(25, numberFormat, 5)); units.add(new NumberTickUnit(250, numberFormat, 5)); units.add(new NumberTickUnit(2500, numberFormat, 5)); units.add(new NumberTickUnit(25000, numberFormat, 5)); units.add(new NumberTickUnit(250000, numberFormat, 5)); units.add(new NumberTickUnit(2500000, numberFormat, 5)); units.add(new NumberTickUnit(25000000, numberFormat, 5)); units.add(new NumberTickUnit(250000000, numberFormat, 5)); units.add(new NumberTickUnit(2500000000.0, numberFormat, 5)); units.add(new NumberTickUnit(25000000000.0, numberFormat, 5)); units.add(new NumberTickUnit(0.0000005, numberFormat, 5)); units.add(new NumberTickUnit(0.000005, numberFormat, 5)); units.add(new NumberTickUnit(0.00005, numberFormat, 5)); units.add(new NumberTickUnit(0.0005, numberFormat, 5)); units.add(new NumberTickUnit(0.005, numberFormat, 5)); units.add(new NumberTickUnit(0.05, numberFormat, 5)); units.add(new NumberTickUnit(0.5, numberFormat, 5)); units.add(new NumberTickUnit(5L, numberFormat, 5)); units.add(new NumberTickUnit(50L, numberFormat, 5)); units.add(new NumberTickUnit(500L, numberFormat, 5)); units.add(new NumberTickUnit(5000L, numberFormat, 5)); units.add(new NumberTickUnit(50000L, numberFormat, 5)); units.add(new NumberTickUnit(500000L, numberFormat, 5)); units.add(new NumberTickUnit(5000000L, numberFormat, 5)); units.add(new NumberTickUnit(50000000L, numberFormat, 5)); units.add(new NumberTickUnit(500000000L, numberFormat, 5)); units.add(new NumberTickUnit(5000000000L, numberFormat, 5)); units.add(new NumberTickUnit(50000000000L, numberFormat, 5)); return units; }
static TickUnitSource function(Locale locale) { TickUnits units = new TickUnits(); NumberFormat numberFormat = NumberFormat.getNumberInstance(locale); units.add(new NumberTickUnit(0.0000001, numberFormat, 2)); units.add(new NumberTickUnit(0.000001, numberFormat, 2)); units.add(new NumberTickUnit(0.00001, numberFormat, 2)); units.add(new NumberTickUnit(0.0001, numberFormat, 2)); units.add(new NumberTickUnit(0.001, numberFormat, 2)); units.add(new NumberTickUnit(0.01, numberFormat, 2)); units.add(new NumberTickUnit(0.1, numberFormat, 2)); units.add(new NumberTickUnit(1, numberFormat, 2)); units.add(new NumberTickUnit(10, numberFormat, 2)); units.add(new NumberTickUnit(100, numberFormat, 2)); units.add(new NumberTickUnit(1000, numberFormat, 2)); units.add(new NumberTickUnit(10000, numberFormat, 2)); units.add(new NumberTickUnit(100000, numberFormat, 2)); units.add(new NumberTickUnit(1000000, numberFormat, 2)); units.add(new NumberTickUnit(10000000, numberFormat, 2)); units.add(new NumberTickUnit(100000000, numberFormat, 2)); units.add(new NumberTickUnit(1000000000, numberFormat, 2)); units.add(new NumberTickUnit(10000000000.0, numberFormat, 2)); units.add(new NumberTickUnit(0.00000025, numberFormat, 5)); units.add(new NumberTickUnit(0.0000025, numberFormat, 5)); units.add(new NumberTickUnit(0.000025, numberFormat, 5)); units.add(new NumberTickUnit(0.00025, numberFormat, 5)); units.add(new NumberTickUnit(0.0025, numberFormat, 5)); units.add(new NumberTickUnit(0.025, numberFormat, 5)); units.add(new NumberTickUnit(0.25, numberFormat, 5)); units.add(new NumberTickUnit(2.5, numberFormat, 5)); units.add(new NumberTickUnit(25, numberFormat, 5)); units.add(new NumberTickUnit(250, numberFormat, 5)); units.add(new NumberTickUnit(2500, numberFormat, 5)); units.add(new NumberTickUnit(25000, numberFormat, 5)); units.add(new NumberTickUnit(250000, numberFormat, 5)); units.add(new NumberTickUnit(2500000, numberFormat, 5)); units.add(new NumberTickUnit(25000000, numberFormat, 5)); units.add(new NumberTickUnit(250000000, numberFormat, 5)); units.add(new NumberTickUnit(2500000000.0, numberFormat, 5)); units.add(new NumberTickUnit(25000000000.0, numberFormat, 5)); units.add(new NumberTickUnit(0.0000005, numberFormat, 5)); units.add(new NumberTickUnit(0.000005, numberFormat, 5)); units.add(new NumberTickUnit(0.00005, numberFormat, 5)); units.add(new NumberTickUnit(0.0005, numberFormat, 5)); units.add(new NumberTickUnit(0.005, numberFormat, 5)); units.add(new NumberTickUnit(0.05, numberFormat, 5)); units.add(new NumberTickUnit(0.5, numberFormat, 5)); units.add(new NumberTickUnit(5L, numberFormat, 5)); units.add(new NumberTickUnit(50L, numberFormat, 5)); units.add(new NumberTickUnit(500L, numberFormat, 5)); units.add(new NumberTickUnit(5000L, numberFormat, 5)); units.add(new NumberTickUnit(50000L, numberFormat, 5)); units.add(new NumberTickUnit(500000L, numberFormat, 5)); units.add(new NumberTickUnit(5000000L, numberFormat, 5)); units.add(new NumberTickUnit(50000000L, numberFormat, 5)); units.add(new NumberTickUnit(500000000L, numberFormat, 5)); units.add(new NumberTickUnit(5000000000L, numberFormat, 5)); units.add(new NumberTickUnit(50000000000L, numberFormat, 5)); return units; }
/** * Creates a collection of standard tick units. The supplied locale is * used to create the number formatter (a localised instance of * <code>NumberFormat</code>). * <P> * If you don't like these defaults, create your own instance of * {@link TickUnits} and then pass it to the * <code>setStandardTickUnits()</code> method. * * @param locale the locale. * * @return A tick unit collection. * * @see #setStandardTickUnits(TickUnitSource) */
Creates a collection of standard tick units. The supplied locale is used to create the number formatter (a localised instance of <code>NumberFormat</code>). If you don't like these defaults, create your own instance of <code>TickUnits</code> and then pass it to the <code>setStandardTickUnits()</code> method
createStandardTickUnits
{ "repo_name": "ilyessou/jfreechart", "path": "source/org/jfree/chart/axis/NumberAxis.java", "license": "lgpl-2.1", "size": 57325 }
[ "java.text.NumberFormat", "java.util.Locale" ]
import java.text.NumberFormat; import java.util.Locale;
import java.text.*; import java.util.*;
[ "java.text", "java.util" ]
java.text; java.util;
1,448,895
public static void wrapNoteOverflow(final String inputString, final int charWrap, final List<BibliographicNoteOverflow> overflowList) { final List<String> overflows = F.splitString(inputString, charWrap); overflowList.addAll( overflows.stream().map(overString -> { final BibliographicNoteOverflow overflowNote = new BibliographicNoteOverflow(); overflowNote.setStringText(overString); overflowNote.markNew(); return overflowNote; }).collect(Collectors.toList())); }
static void function(final String inputString, final int charWrap, final List<BibliographicNoteOverflow> overflowList) { final List<String> overflows = F.splitString(inputString, charWrap); overflowList.addAll( overflows.stream().map(overString -> { final BibliographicNoteOverflow overflowNote = new BibliographicNoteOverflow(); overflowNote.setStringText(overString); overflowNote.markNew(); return overflowNote; }).collect(Collectors.toList())); }
/** * Split overflow note and sets in overflowList. * * @param inputString -- the overflow string to split. * @param charWrap -- number of chars to split. * @param overflowList -- overflow list to set result. */
Split overflow note and sets in overflowList
wrapNoteOverflow
{ "repo_name": "atcult/mod-cataloging", "path": "src/main/java/org/folio/marccat/dao/persistence/BibliographicNoteTag.java", "license": "apache-2.0", "size": 14316 }
[ "java.util.List", "java.util.stream.Collectors", "org.folio.marccat.util.F" ]
import java.util.List; import java.util.stream.Collectors; import org.folio.marccat.util.F;
import java.util.*; import java.util.stream.*; import org.folio.marccat.util.*;
[ "java.util", "org.folio.marccat" ]
java.util; org.folio.marccat;
1,837,577
public static ObjectMapper config() { final ObjectMapper m = new ObjectMapper(new YAMLFactory()); m.addMixIn(ClusterDiscoveryModule.class, TypeNameMixin.class); m.addMixIn(RpcProtocolModule.class, TypeNameMixin.class); m.addMixIn(ConsumerModule.Builder.class, TypeNameMixin.class); m.addMixIn(MetadataModule.class, TypeNameMixin.class); m.addMixIn(SuggestModule.class, TypeNameMixin.class); m.addMixIn(MetricModule.class, TypeNameMixin.class); m.addMixIn(MetricGeneratorModule.class, TypeNameMixin.class); m.addMixIn(MetadataGenerator.class, TypeNameMixin.class); m.addMixIn(AnalyticsModule.Builder.class, TypeNameMixin.class); m.addMixIn(StatisticsModule.class, TypeNameMixin.class); m.addMixIn(QueryLoggingModule.class, TypeNameMixin.class); m.addMixIn(CacheModule.Builder.class, TypeNameMixin.class); m.addMixIn(RequestCondition.class, TypeNameMixin.class); m.addMixIn(ConditionalFeatures.class, TypeNameMixin.class); m.registerModule(commonSerializers()); m.registerModule(new Jdk8Module()); return m; }
static ObjectMapper function() { final ObjectMapper m = new ObjectMapper(new YAMLFactory()); m.addMixIn(ClusterDiscoveryModule.class, TypeNameMixin.class); m.addMixIn(RpcProtocolModule.class, TypeNameMixin.class); m.addMixIn(ConsumerModule.Builder.class, TypeNameMixin.class); m.addMixIn(MetadataModule.class, TypeNameMixin.class); m.addMixIn(SuggestModule.class, TypeNameMixin.class); m.addMixIn(MetricModule.class, TypeNameMixin.class); m.addMixIn(MetricGeneratorModule.class, TypeNameMixin.class); m.addMixIn(MetadataGenerator.class, TypeNameMixin.class); m.addMixIn(AnalyticsModule.Builder.class, TypeNameMixin.class); m.addMixIn(StatisticsModule.class, TypeNameMixin.class); m.addMixIn(QueryLoggingModule.class, TypeNameMixin.class); m.addMixIn(CacheModule.Builder.class, TypeNameMixin.class); m.addMixIn(RequestCondition.class, TypeNameMixin.class); m.addMixIn(ConditionalFeatures.class, TypeNameMixin.class); m.registerModule(commonSerializers()); m.registerModule(new Jdk8Module()); return m; }
/** * Setup the ObjectMapper used to deserialize configuration files. * * @return */
Setup the ObjectMapper used to deserialize configuration files
config
{ "repo_name": "lucilecoutouly/heroic", "path": "heroic-loading/src/main/java/com/spotify/heroic/HeroicMappers.java", "license": "apache-2.0", "size": 6718 }
[ "com.fasterxml.jackson.databind.ObjectMapper", "com.fasterxml.jackson.dataformat.yaml.YAMLFactory", "com.fasterxml.jackson.datatype.jdk8.Jdk8Module", "com.spotify.heroic.analytics.AnalyticsModule", "com.spotify.heroic.cache.CacheModule", "com.spotify.heroic.cluster.ClusterDiscoveryModule", "com.spotify.heroic.cluster.RpcProtocolModule", "com.spotify.heroic.common.TypeNameMixin", "com.spotify.heroic.conditionalfeatures.ConditionalFeatures", "com.spotify.heroic.consumer.ConsumerModule", "com.spotify.heroic.generator.MetadataGenerator", "com.spotify.heroic.generator.MetricGeneratorModule", "com.spotify.heroic.metadata.MetadataModule", "com.spotify.heroic.metric.MetricModule", "com.spotify.heroic.querylogging.QueryLoggingModule", "com.spotify.heroic.requestcondition.RequestCondition", "com.spotify.heroic.statistics.StatisticsModule", "com.spotify.heroic.suggest.SuggestModule" ]
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.spotify.heroic.analytics.AnalyticsModule; import com.spotify.heroic.cache.CacheModule; import com.spotify.heroic.cluster.ClusterDiscoveryModule; import com.spotify.heroic.cluster.RpcProtocolModule; import com.spotify.heroic.common.TypeNameMixin; import com.spotify.heroic.conditionalfeatures.ConditionalFeatures; import com.spotify.heroic.consumer.ConsumerModule; import com.spotify.heroic.generator.MetadataGenerator; import com.spotify.heroic.generator.MetricGeneratorModule; import com.spotify.heroic.metadata.MetadataModule; import com.spotify.heroic.metric.MetricModule; import com.spotify.heroic.querylogging.QueryLoggingModule; import com.spotify.heroic.requestcondition.RequestCondition; import com.spotify.heroic.statistics.StatisticsModule; import com.spotify.heroic.suggest.SuggestModule;
import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.dataformat.yaml.*; import com.fasterxml.jackson.datatype.jdk8.*; import com.spotify.heroic.analytics.*; import com.spotify.heroic.cache.*; import com.spotify.heroic.cluster.*; import com.spotify.heroic.common.*; import com.spotify.heroic.conditionalfeatures.*; import com.spotify.heroic.consumer.*; import com.spotify.heroic.generator.*; import com.spotify.heroic.metadata.*; import com.spotify.heroic.metric.*; import com.spotify.heroic.querylogging.*; import com.spotify.heroic.requestcondition.*; import com.spotify.heroic.statistics.*; import com.spotify.heroic.suggest.*;
[ "com.fasterxml.jackson", "com.spotify.heroic" ]
com.fasterxml.jackson; com.spotify.heroic;
2,393,662
void cellChanged(Cell cell, int newNumber);
void cellChanged(Cell cell, int newNumber);
/** Cell number changed * @param cell Cell that changed * @param newNumber New number of the cell */
Cell number changed
cellChanged
{ "repo_name": "garnryang/Team8", "path": "src/edu/psu/sweng500/team8/play/CellChangedListener.java", "license": "mit", "size": 535 }
[ "edu.psu.sweng500.team8.coreDataStructures.Cell" ]
import edu.psu.sweng500.team8.coreDataStructures.Cell;
import edu.psu.sweng500.team8.*;
[ "edu.psu.sweng500" ]
edu.psu.sweng500;
205,962
public void build () { synchronized (chunks) { chunks.clear(); } buildReady = true; loadStage = LoadStage.IDLE; for (Player p : getPlayers()) { p.getViewport().flagUpdate();//Informs all players in the region that it is being updated } }
void function () { synchronized (chunks) { chunks.clear(); } buildReady = true; loadStage = LoadStage.IDLE; for (Player p : getPlayers()) { p.getViewport().flagUpdate(); } }
/** * Rebuilds the region, sending the updated region to the players, reloading all locations and the clip map * WARNING: Calling this method will cause all dropped items and temporary locations to be destroyed! */
Rebuilds the region, sending the updated region to the players, reloading all locations and the clip map
build
{ "repo_name": "itsgreco/VirtueRS3", "path": "src/org/virtue/game/world/region/DynamicRegion.java", "license": "mit", "size": 4266 }
[ "org.virtue.game.entity.player.Player" ]
import org.virtue.game.entity.player.Player;
import org.virtue.game.entity.player.*;
[ "org.virtue.game" ]
org.virtue.game;
648,947
public void clickOnSkill(Skill s) { Intent intent = new Intent(this, SkillDescriptionActivity.class); intent.putExtra(SkillDescriptionActivity.ID_PARAM, s.getSkillID()); startActivity(intent); }
void function(Skill s) { Intent intent = new Intent(this, SkillDescriptionActivity.class); intent.putExtra(SkillDescriptionActivity.ID_PARAM, s.getSkillID()); startActivity(intent); }
/** * This method, when invoked by clicking on a skill, will start the new activity for Skills. * @param s Skill Object. */
This method, when invoked by clicking on a skill, will start the new activity for Skills
clickOnSkill
{ "repo_name": "CMPUT301F15T15/Team15Alpha", "path": "Skill/app/src/main/java/com/skilltradiez/skilltraderz/SearchScreenActivity.java", "license": "gpl-3.0", "size": 14964 }
[ "android.content.Intent" ]
import android.content.Intent;
import android.content.*;
[ "android.content" ]
android.content;
1,729,449
protected void renderOutputBuffer(VpxOutputBuffer outputBuffer) { int bufferMode = outputBuffer.mode; boolean renderRgb = bufferMode == VpxDecoder.OUTPUT_MODE_RGB && surface != null; boolean renderYuv = bufferMode == VpxDecoder.OUTPUT_MODE_YUV && outputBufferRenderer != null; lastRenderTimeUs = SystemClock.elapsedRealtime() * 1000; if (!renderRgb && !renderYuv) { dropOutputBuffer(outputBuffer); } else { maybeNotifyVideoSizeChanged(outputBuffer.width, outputBuffer.height); if (renderRgb) { renderRgbFrame(outputBuffer, scaleToFit); outputBuffer.release(); } else { outputBufferRenderer.setOutputBuffer(outputBuffer); // The renderer will release the buffer. } consecutiveDroppedFrameCount = 0; decoderCounters.renderedOutputBufferCount++; maybeNotifyRenderedFirstFrame(); } }
void function(VpxOutputBuffer outputBuffer) { int bufferMode = outputBuffer.mode; boolean renderRgb = bufferMode == VpxDecoder.OUTPUT_MODE_RGB && surface != null; boolean renderYuv = bufferMode == VpxDecoder.OUTPUT_MODE_YUV && outputBufferRenderer != null; lastRenderTimeUs = SystemClock.elapsedRealtime() * 1000; if (!renderRgb && !renderYuv) { dropOutputBuffer(outputBuffer); } else { maybeNotifyVideoSizeChanged(outputBuffer.width, outputBuffer.height); if (renderRgb) { renderRgbFrame(outputBuffer, scaleToFit); outputBuffer.release(); } else { outputBufferRenderer.setOutputBuffer(outputBuffer); } consecutiveDroppedFrameCount = 0; decoderCounters.renderedOutputBufferCount++; maybeNotifyRenderedFirstFrame(); } }
/** * Renders the specified output buffer. * * <p>The implementation of this method takes ownership of the output buffer and is responsible * for calling {@link VpxOutputBuffer#release()} either immediately or in the future. * * @param outputBuffer The buffer to render. */
Renders the specified output buffer. The implementation of this method takes ownership of the output buffer and is responsible for calling <code>VpxOutputBuffer#release()</code> either immediately or in the future
renderOutputBuffer
{ "repo_name": "MaTriXy/ExoPlayer", "path": "extensions/vp9/src/main/java/com/google/android/exoplayer2/ext/vp9/LibvpxVideoRenderer.java", "license": "apache-2.0", "size": 35332 }
[ "android.os.SystemClock" ]
import android.os.SystemClock;
import android.os.*;
[ "android.os" ]
android.os;
2,530,944
public void downloadToFile(final String path, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, IOException { OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(path)); try { this.download(outputStream, accessCondition, options, opContext); outputStream.close(); } catch (StorageException e) { deleteEmptyFileOnException(outputStream, path); throw e; } catch (IOException e) { deleteEmptyFileOnException(outputStream, path); throw e; } }
void function(final String path, final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, IOException { OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(path)); try { this.download(outputStream, accessCondition, options, opContext); outputStream.close(); } catch (StorageException e) { deleteEmptyFileOnException(outputStream, path); throw e; } catch (IOException e) { deleteEmptyFileOnException(outputStream, path); throw e; } }
/** * Downloads a blob, storing the contents in a file. * * @param path * A <code>String</code> which represents the path to the file that will be created with the contents of * the blob. * @param accessCondition * An {@link AccessCondition} object that represents the access conditions for the blob. * @param options * A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying * <code>null</code> will use the default request options from the associated service client ( * {@link CloudBlobClient}). * @param opContext * An {@link OperationContext} object that represents the context for the current operation. This object * is used to track requests to the storage service, and to provide additional runtime information about * the operation. * * @throws StorageException * If a storage service error occurred. * @throws IOException */
Downloads a blob, storing the contents in a file
downloadToFile
{ "repo_name": "emgerner-msft/azure-storage-java", "path": "microsoft-azure-storage/src/com/microsoft/azure/storage/blob/CloudBlob.java", "license": "apache-2.0", "size": 133550 }
[ "com.microsoft.azure.storage.AccessCondition", "com.microsoft.azure.storage.OperationContext", "com.microsoft.azure.storage.StorageException", "java.io.BufferedOutputStream", "java.io.FileOutputStream", "java.io.IOException", "java.io.OutputStream" ]
import com.microsoft.azure.storage.AccessCondition; import com.microsoft.azure.storage.OperationContext; import com.microsoft.azure.storage.StorageException; import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream;
import com.microsoft.azure.storage.*; import java.io.*;
[ "com.microsoft.azure", "java.io" ]
com.microsoft.azure; java.io;
1,124,318
void postPackageMetric(Metric metric, PsiJavaPackage aPackage, double numerator, double denominator);
void postPackageMetric(Metric metric, PsiJavaPackage aPackage, double numerator, double denominator);
/** * Post a ratio value for a package metric. * * @param metric the metric to post the value for. It should have a category of MetricCategory.Package. * @param aPackage the package for which the metric value is calculated. * @param numerator The numerator of the value to post. Should be an integer. * @param denominator The denominator of the value to post. Should be a positive integer. */
Post a ratio value for a package metric
postPackageMetric
{ "repo_name": "consulo/consulo-metrics", "path": "java-metrics/src/consulo/metrics/java/JavaMetricsResultsHolder.java", "license": "apache-2.0", "size": 4444 }
[ "com.intellij.psi.PsiJavaPackage", "com.sixrr.metrics.Metric" ]
import com.intellij.psi.PsiJavaPackage; import com.sixrr.metrics.Metric;
import com.intellij.psi.*; import com.sixrr.metrics.*;
[ "com.intellij.psi", "com.sixrr.metrics" ]
com.intellij.psi; com.sixrr.metrics;
1,306,695
BloomFilter filter(IndexReader reader, String fieldName, boolean asyncLoad);
BloomFilter filter(IndexReader reader, String fieldName, boolean asyncLoad);
/** * *Async* loads a bloom filter for the field name. Note, this one only supports * for fields that have a single term per doc. */
Async* loads a bloom filter for the field name. Note, this one only supports for fields that have a single term per doc
filter
{ "repo_name": "Kreolwolf1/Elastic", "path": "src/main/java/org/elasticsearch/index/cache/bloom/BloomCache.java", "license": "apache-2.0", "size": 1498 }
[ "org.apache.lucene.index.IndexReader", "org.elasticsearch.common.bloom.BloomFilter" ]
import org.apache.lucene.index.IndexReader; import org.elasticsearch.common.bloom.BloomFilter;
import org.apache.lucene.index.*; import org.elasticsearch.common.bloom.*;
[ "org.apache.lucene", "org.elasticsearch.common" ]
org.apache.lucene; org.elasticsearch.common;
1,607,916
//Modified by Rob klein 4/29/07 public void createProcessPage (HttpServletRequest request, HttpServletResponse response, int AD_Process_ID, int AD_Window_ID) { WebSessionCtx wsc = WebSessionCtx.get (request); MProcess process = MProcess.get (wsc.ctx, AD_Process_ID); log.info("PI table id "+process.get_Table_ID()); log.info("PI table name id "+process.get_TableName()); log.info("PI table client id "+process.getAD_Client_ID()); log.info("PI table process id "+process.getAD_Process_ID()); log.info("PI process class name "+process.getClassname()); // need to check if Role can access WebDoc doc = null; if (process == null) { doc = WebDoc.createWindow("Process Not Found"); } else{ doc = WebDoc.createWindow(process.getName()); td center = doc.addWindowCenter(false); if (process.getDescription() != null) center.addElement(new p(new i(process.getDescription()))); if (process.getHelp() != null) center.addElement(new p(process.getHelp(), AlignType.LEFT)); // Create Process Instance MPInstance pInstance = fillParameter (request, process); // int AD_Table_ID = WebUtil.getParameterAsInt(request, "AD_Table_ID"); int AD_Record_ID = WebUtil.getParameterAsInt(request, "AD_Record_ID"); ProcessInfo pi = new ProcessInfo (process.getName(), process.getAD_Process_ID(), AD_Table_ID, AD_Record_ID); pi.setAD_User_ID(Env.getAD_User_ID(wsc.ctx)); pi.setAD_Client_ID(Env.getAD_Client_ID(wsc.ctx)); pi.setClassName(process.getClassname()); log.info("PI client id "+pi.getAD_Client_ID()); pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID()); // Info p p = new p(); p.addElement(Msg.translate(wsc.ctx, "AD_PInstance_ID") + ": " + pInstance.getAD_PInstance_ID()); center.addElement(p); // Start boolean processOK = false; if (process.isWorkflow()) { Trx trx = Trx.get(Trx.createTrxName("WebPrc"), true); try { WProcessCtl.process(this, AD_Window_ID, pi, trx, request); //processOK = process.processIt(pi, trx); trx.commit(); trx.close(); } catch (Throwable t) { trx.rollback(); trx.close(); } if ( pi.isError()) { center.addElement(new p("Error:" + pi.getSummary(), AlignType.LEFT).setClass("Cerror")); processOK = false; } else { center.addElement(new p("OK: Workflow Started", AlignType.LEFT)); processOK = true; } center.addElement(new p().addElement(pi.getSummary())); center.addElement(pi.getLogInfo(true)); } String jasper=process.getJasperReport(); if (process.isJavaProcess()) { if (jasper!=null) { pi.setPrintPreview (false); pi.setIsBatch(true); } Trx trx = Trx.get(Trx.createTrxName("WebPrc"), true); try { processOK = process.processIt(pi, trx); trx.commit(); trx.close(); } catch (Throwable t) { trx.rollback(); trx.close(); } if (!processOK || pi.isError()) { center.addElement(new p("Error:" + pi.getSummary(), AlignType.LEFT).setClass("Cerror")); processOK = false; } else { if(jasper!=null) { String error = WebUtil.streamFile(response, pi.getPDFReport()); //String error = streamResult (request, response, pInstance.getAD_PInstance_ID(), file); if (error == null) return; doc = WebDoc.create(error); wsc.ctx.put("AD_PInstance_ID=" + pInstance.getAD_PInstance_ID(), "ok"); } else { center.addElement(new p().addElement(pi.getSummary())); center.addElement(pi.getLogInfo(true)); } } } // Report if (process.isReport()) //if (processOK && process.isReport()) { //doc = null; if(jasper==null) { log.info(response.toString()); ReportEngine re = ReportEngine.get(wsc.ctx, pi); if (re == null) { center.addElement(new p("Could not start ReportEngine", AlignType.LEFT).setClass("Cerror")); } else { try { File file = File.createTempFile("WProcess", ".pdf"); boolean ok = re.createPDF(file); if (ok) { String error = WebUtil.streamFile(response, file); //String error = streamResult (request, response, pInstance.getAD_PInstance_ID(), file); if (error == null) return; doc = WebDoc.create(error); //Modified by Rob Klein 6/1/07 wsc.ctx.put("AD_PInstance_ID=" + pInstance.getAD_PInstance_ID(), "ok"); } else center.addElement(new p("Could not create Report", AlignType.LEFT).setClass("Cerror")); } catch (Exception e) { center.addElement(new p("Could not create Report:", AlignType.LEFT).setClass("Cerror")); center.addElement(e.toString()); } } } } } doc.addPopupClose(wsc.ctx); try { WebUtil.createResponse(request, response, this, null, doc, false); } catch (IOException e) { log.info(e.toString()); } } // createProcessPage
void function (HttpServletRequest request, HttpServletResponse response, int AD_Process_ID, int AD_Window_ID) { WebSessionCtx wsc = WebSessionCtx.get (request); MProcess process = MProcess.get (wsc.ctx, AD_Process_ID); log.info(STR+process.get_Table_ID()); log.info(STR+process.get_TableName()); log.info(STR+process.getAD_Client_ID()); log.info(STR+process.getAD_Process_ID()); log.info(STR+process.getClassname()); WebDoc doc = null; if (process == null) { doc = WebDoc.createWindow(STR); } else{ doc = WebDoc.createWindow(process.getName()); td center = doc.addWindowCenter(false); if (process.getDescription() != null) center.addElement(new p(new i(process.getDescription()))); if (process.getHelp() != null) center.addElement(new p(process.getHelp(), AlignType.LEFT)); MPInstance pInstance = fillParameter (request, process); int AD_Table_ID = WebUtil.getParameterAsInt(request, STR); int AD_Record_ID = WebUtil.getParameterAsInt(request, STR); ProcessInfo pi = new ProcessInfo (process.getName(), process.getAD_Process_ID(), AD_Table_ID, AD_Record_ID); pi.setAD_User_ID(Env.getAD_User_ID(wsc.ctx)); pi.setAD_Client_ID(Env.getAD_Client_ID(wsc.ctx)); pi.setClassName(process.getClassname()); log.info(STR+pi.getAD_Client_ID()); pi.setAD_PInstance_ID(pInstance.getAD_PInstance_ID()); p p = new p(); p.addElement(Msg.translate(wsc.ctx, STR) + STR + pInstance.getAD_PInstance_ID()); center.addElement(p); boolean processOK = false; if (process.isWorkflow()) { Trx trx = Trx.get(Trx.createTrxName(STR), true); try { WProcessCtl.process(this, AD_Window_ID, pi, trx, request); trx.commit(); trx.close(); } catch (Throwable t) { trx.rollback(); trx.close(); } if ( pi.isError()) { center.addElement(new p(STR + pi.getSummary(), AlignType.LEFT).setClass(STR)); processOK = false; } else { center.addElement(new p(STR, AlignType.LEFT)); processOK = true; } center.addElement(new p().addElement(pi.getSummary())); center.addElement(pi.getLogInfo(true)); } String jasper=process.getJasperReport(); if (process.isJavaProcess()) { if (jasper!=null) { pi.setPrintPreview (false); pi.setIsBatch(true); } Trx trx = Trx.get(Trx.createTrxName(STR), true); try { processOK = process.processIt(pi, trx); trx.commit(); trx.close(); } catch (Throwable t) { trx.rollback(); trx.close(); } if (!processOK pi.isError()) { center.addElement(new p(STR + pi.getSummary(), AlignType.LEFT).setClass(STR)); processOK = false; } else { if(jasper!=null) { String error = WebUtil.streamFile(response, pi.getPDFReport()); if (error == null) return; doc = WebDoc.create(error); wsc.ctx.put(STR + pInstance.getAD_PInstance_ID(), "ok"); } else { center.addElement(new p().addElement(pi.getSummary())); center.addElement(pi.getLogInfo(true)); } } } if (process.isReport()) { if(jasper==null) { log.info(response.toString()); ReportEngine re = ReportEngine.get(wsc.ctx, pi); if (re == null) { center.addElement(new p(STR, AlignType.LEFT).setClass(STR)); } else { try { File file = File.createTempFile(STR, ".pdf"); boolean ok = re.createPDF(file); if (ok) { String error = WebUtil.streamFile(response, file); if (error == null) return; doc = WebDoc.create(error); wsc.ctx.put(STR + pInstance.getAD_PInstance_ID(), "ok"); } else center.addElement(new p(STR, AlignType.LEFT).setClass(STR)); } catch (Exception e) { center.addElement(new p(STR, AlignType.LEFT).setClass(STR)); center.addElement(e.toString()); } } } } } doc.addPopupClose(wsc.ctx); try { WebUtil.createResponse(request, response, this, null, doc, false); } catch (IOException e) { log.info(e.toString()); } }
/************************************************************************** * Create Parocess Page * @param request request * @param AD_Process_ID Process * @return Page */
Create Parocess Page
createProcessPage
{ "repo_name": "armenrz/adempiere", "path": "serverApps/src/main/servlet/org/compiere/www/WProcess.java", "license": "gpl-2.0", "size": 34566 }
[ "java.io.File", "java.io.IOException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.ecs.AlignType", "org.compiere.model.MPInstance", "org.compiere.model.MProcess", "org.compiere.print.ReportEngine", "org.compiere.process.ProcessInfo", "org.compiere.util.Env", "org.compiere.util.Msg", "org.compiere.util.Trx", "org.compiere.util.WebDoc", "org.compiere.util.WebSessionCtx", "org.compiere.util.WebUtil" ]
import java.io.File; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.ecs.AlignType; import org.compiere.model.MPInstance; import org.compiere.model.MProcess; import org.compiere.print.ReportEngine; import org.compiere.process.ProcessInfo; import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Trx; import org.compiere.util.WebDoc; import org.compiere.util.WebSessionCtx; import org.compiere.util.WebUtil;
import java.io.*; import javax.servlet.http.*; import org.apache.ecs.*; import org.compiere.model.*; import org.compiere.print.*; import org.compiere.process.*; import org.compiere.util.*;
[ "java.io", "javax.servlet", "org.apache.ecs", "org.compiere.model", "org.compiere.print", "org.compiere.process", "org.compiere.util" ]
java.io; javax.servlet; org.apache.ecs; org.compiere.model; org.compiere.print; org.compiere.process; org.compiere.util;
1,408,634
public Bundle getFragmentArguments(Bundle extras) { return extras.getBundle(FRAGMENT_ARGUMENTS); }
Bundle function(Bundle extras) { return extras.getBundle(FRAGMENT_ARGUMENTS); }
/** * Override to customize * */
Override to customize
getFragmentArguments
{ "repo_name": "gskbyte/android-gskbyte-utils", "path": "src/org/gskbyte/FragmentWrapperActivity.java", "license": "lgpl-3.0", "size": 3476 }
[ "android.os.Bundle" ]
import android.os.Bundle;
import android.os.*;
[ "android.os" ]
android.os;
641,001
Value calculateValue(EvaluationState state, DeclarationList container);
Value calculateValue(EvaluationState state, DeclarationList container);
/** * Performs the calculation. * In the calculation, the <code>variables</code> parameter will be used to * substitute 'const()' terms, and the <code>parameters</code> parameter will * be used for 'param()' terms. * * @param state The current evaluation state. * @param container The {@link DeclarationList} this expression is contained in. * @return The result of the calculation. */
Performs the calculation. In the calculation, the <code>variables</code> parameter will be used to substitute 'const()' terms, and the <code>parameters</code> parameter will be used for 'param()' terms
calculateValue
{ "repo_name": "silentmatt/dss", "path": "src/com/silentmatt/dss/calc/CalcExpression.java", "license": "mit", "size": 1872 }
[ "com.silentmatt.dss.declaration.DeclarationList", "com.silentmatt.dss.evaluator.EvaluationState" ]
import com.silentmatt.dss.declaration.DeclarationList; import com.silentmatt.dss.evaluator.EvaluationState;
import com.silentmatt.dss.declaration.*; import com.silentmatt.dss.evaluator.*;
[ "com.silentmatt.dss" ]
com.silentmatt.dss;
323,891
public Patch createNewPatch() { // Copy over the Alesis QS header byte [] sysex = new byte[patchSize]; for (int i=0; i<QSConstants.GENERIC_HEADER.length; i++) { sysex[i] = QSConstants.GENERIC_HEADER[i]; } // Set it to be a global sysex[QSConstants.POSITION_OPCODE] = QSConstants.OPCODE_MIDI_GLOBAL_DATA_DUMP; // Create the patch, and set the name return new Patch(sysex, this); }
Patch function() { byte [] sysex = new byte[patchSize]; for (int i=0; i<QSConstants.GENERIC_HEADER.length; i++) { sysex[i] = QSConstants.GENERIC_HEADER[i]; } sysex[QSConstants.POSITION_OPCODE] = QSConstants.OPCODE_MIDI_GLOBAL_DATA_DUMP; return new Patch(sysex, this); }
/** * Create a new global patch * @return the new Patch */
Create a new global patch
createNewPatch
{ "repo_name": "jpcaruana/jsynthlib", "path": "src/main/java/org/jsynthlib/drivers/alesis/qs/AlesisQSGlobalDriver.java", "license": "gpl-2.0", "size": 3314 }
[ "org.jsynthlib.core.Patch" ]
import org.jsynthlib.core.Patch;
import org.jsynthlib.core.*;
[ "org.jsynthlib.core" ]
org.jsynthlib.core;
804,540
public static ValueLobDb createTempClob(Reader in, long length, DataHandler handler) { try { boolean compress = handler.getLobCompressionAlgorithm(Value.CLOB) != null; long remaining = Long.MAX_VALUE; if (length >= 0 && length < remaining) { remaining = length; } int len = getBufferSize(handler, compress, remaining); char[] buff; if (len >= Integer.MAX_VALUE) { String data = IOUtils.readStringAndClose(in, -1); buff = data.toCharArray(); len = buff.length; } else { buff = new char[len]; len = IOUtils.readFully(in, buff, len); len = len < 0 ? 0 : len; } if (len <= handler.getMaxLengthInplaceLob()) { byte[] small = StringUtils.utf8Encode(new String(buff, 0, len)); return ValueLobDb.createSmallLob(Value.CLOB, small, len); } ValueLobDb lob = new ValueLobDb(Value.CLOB, null, 0); lob.createTempFromReader(buff, len, in, remaining, handler); return lob; } catch (IOException e) { throw DbException.convertIOException(e, null); } }
static ValueLobDb function(Reader in, long length, DataHandler handler) { try { boolean compress = handler.getLobCompressionAlgorithm(Value.CLOB) != null; long remaining = Long.MAX_VALUE; if (length >= 0 && length < remaining) { remaining = length; } int len = getBufferSize(handler, compress, remaining); char[] buff; if (len >= Integer.MAX_VALUE) { String data = IOUtils.readStringAndClose(in, -1); buff = data.toCharArray(); len = buff.length; } else { buff = new char[len]; len = IOUtils.readFully(in, buff, len); len = len < 0 ? 0 : len; } if (len <= handler.getMaxLengthInplaceLob()) { byte[] small = StringUtils.utf8Encode(new String(buff, 0, len)); return ValueLobDb.createSmallLob(Value.CLOB, small, len); } ValueLobDb lob = new ValueLobDb(Value.CLOB, null, 0); lob.createTempFromReader(buff, len, in, remaining, handler); return lob; } catch (IOException e) { throw DbException.convertIOException(e, null); } }
/** * Create a temporary CLOB value from a stream. * * @param in the reader * @param length the number of characters to read, or -1 for no limit * @param handler the data handler * @return the lob value */
Create a temporary CLOB value from a stream
createTempClob
{ "repo_name": "titus08/frostwire-desktop", "path": "lib/jars-src/h2-1.3.164/org/h2/value/ValueLobDb.java", "license": "gpl-3.0", "size": 18224 }
[ "java.io.IOException", "java.io.Reader", "org.h2.message.DbException", "org.h2.store.DataHandler", "org.h2.util.IOUtils", "org.h2.util.StringUtils" ]
import java.io.IOException; import java.io.Reader; import org.h2.message.DbException; import org.h2.store.DataHandler; import org.h2.util.IOUtils; import org.h2.util.StringUtils;
import java.io.*; import org.h2.message.*; import org.h2.store.*; import org.h2.util.*;
[ "java.io", "org.h2.message", "org.h2.store", "org.h2.util" ]
java.io; org.h2.message; org.h2.store; org.h2.util;
708,865
void resetElementAttributes( K name, IElementAttributes attributes ) throws CacheException;
void resetElementAttributes( K name, IElementAttributes attributes ) throws CacheException;
/** * Reset the attributes on the object matching this key name. * <p> * @param name * @param attributes * @throws CacheException */
Reset the attributes on the object matching this key name.
resetElementAttributes
{ "repo_name": "tikue/jcs2-snapshot", "path": "src/java/org/apache/commons/jcs/access/behavior/ICacheAccess.java", "license": "apache-2.0", "size": 5563 }
[ "org.apache.commons.jcs.access.exception.CacheException", "org.apache.commons.jcs.engine.behavior.IElementAttributes" ]
import org.apache.commons.jcs.access.exception.CacheException; import org.apache.commons.jcs.engine.behavior.IElementAttributes;
import org.apache.commons.jcs.access.exception.*; import org.apache.commons.jcs.engine.behavior.*;
[ "org.apache.commons" ]
org.apache.commons;
963,667
@Test public void authorizedClientCanGetServersIfSecurityIsEnabled() throws Throwable { ClientProtocol.Message authorization = ClientProtocol.Message.newBuilder() .setHandshakeRequest(ConnectionAPI.HandshakeRequest.newBuilder() .putCredentials("security-username", "cluster").putCredentials("security-password", "cluster")) .build(); ClientProtocol.Message getServerRequestMessage = ClientProtocol.Message.newBuilder() .setGetServerRequest(ProtobufRequestUtilities.createGetServerRequest()).build(); ProtobufProtocolSerializer protobufProtocolSerializer = new ProtobufProtocolSerializer(); try (Socket socket = createSocket()) { protobufProtocolSerializer.serialize(authorization, socket.getOutputStream()); ClientProtocol.Message authorizationResponse = protobufProtocolSerializer.deserialize(socket.getInputStream()); assertTrue(authorizationResponse.getHandshakeResponse().getAuthenticated()); protobufProtocolSerializer.serialize(getServerRequestMessage, socket.getOutputStream()); ClientProtocol.Message GetServerResponseMessage = protobufProtocolSerializer.deserialize(socket.getInputStream()); assertTrue("Got response: " + GetServerResponseMessage, GetServerResponseMessage.getGetServerResponse().hasServer()); } }
void function() throws Throwable { ClientProtocol.Message authorization = ClientProtocol.Message.newBuilder() .setHandshakeRequest(ConnectionAPI.HandshakeRequest.newBuilder() .putCredentials(STR, STR).putCredentials(STR, STR)) .build(); ClientProtocol.Message getServerRequestMessage = ClientProtocol.Message.newBuilder() .setGetServerRequest(ProtobufRequestUtilities.createGetServerRequest()).build(); ProtobufProtocolSerializer protobufProtocolSerializer = new ProtobufProtocolSerializer(); try (Socket socket = createSocket()) { protobufProtocolSerializer.serialize(authorization, socket.getOutputStream()); ClientProtocol.Message authorizationResponse = protobufProtocolSerializer.deserialize(socket.getInputStream()); assertTrue(authorizationResponse.getHandshakeResponse().getAuthenticated()); protobufProtocolSerializer.serialize(getServerRequestMessage, socket.getOutputStream()); ClientProtocol.Message GetServerResponseMessage = protobufProtocolSerializer.deserialize(socket.getInputStream()); assertTrue(STR + GetServerResponseMessage, GetServerResponseMessage.getGetServerResponse().hasServer()); } }
/** * Test that if the locator has a security manager, an authorized client is allowed to get an * available server */
Test that if the locator has a security manager, an authorized client is allowed to get an available server
authorizedClientCanGetServersIfSecurityIsEnabled
{ "repo_name": "PurelyApplied/geode", "path": "geode-protobuf/src/distributedTest/java/org/apache/geode/internal/protocol/protobuf/v1/acceptance/LocatorConnectionAuthenticationDUnitTest.java", "license": "apache-2.0", "size": 6733 }
[ "java.net.Socket", "org.apache.geode.internal.protocol.protobuf.v1.ClientProtocol", "org.apache.geode.internal.protocol.protobuf.v1.ConnectionAPI", "org.apache.geode.internal.protocol.protobuf.v1.ProtobufRequestUtilities", "org.apache.geode.internal.protocol.protobuf.v1.serializer.ProtobufProtocolSerializer", "org.junit.Assert" ]
import java.net.Socket; import org.apache.geode.internal.protocol.protobuf.v1.ClientProtocol; import org.apache.geode.internal.protocol.protobuf.v1.ConnectionAPI; import org.apache.geode.internal.protocol.protobuf.v1.ProtobufRequestUtilities; import org.apache.geode.internal.protocol.protobuf.v1.serializer.ProtobufProtocolSerializer; import org.junit.Assert;
import java.net.*; import org.apache.geode.internal.protocol.protobuf.v1.*; import org.apache.geode.internal.protocol.protobuf.v1.serializer.*; import org.junit.*;
[ "java.net", "org.apache.geode", "org.junit" ]
java.net; org.apache.geode; org.junit;
1,697,926
userApp = ApplicationBuilder.newApplication(session) .client(ClientType.Implicit) .authenticator(AuthenticatorType.Password) .user() .role("foo") .identity("test_identity") .bearerToken() .build(); } }; private SecurityContext mockContext; private AbstractService service;
userApp = ApplicationBuilder.newApplication(session) .client(ClientType.Implicit) .authenticator(AuthenticatorType.Password) .user() .role("foo") .identity(STR) .bearerToken() .build(); } }; private SecurityContext mockContext; private AbstractService service;
/** * Initialize the test data. */
Initialize the test data
loadTestData
{ "repo_name": "kangaroo-server/kangaroo", "path": "kangaroo-server-authz/src/test/java/net/krotscheck/kangaroo/authz/admin/v1/resource/AbstractServiceTest.java", "license": "apache-2.0", "size": 26802 }
[ "javax.ws.rs.core.SecurityContext", "net.krotscheck.kangaroo.authz.common.authenticator.AuthenticatorType", "net.krotscheck.kangaroo.authz.common.database.entity.ClientType", "net.krotscheck.kangaroo.authz.test.ApplicationBuilder" ]
import javax.ws.rs.core.SecurityContext; import net.krotscheck.kangaroo.authz.common.authenticator.AuthenticatorType; import net.krotscheck.kangaroo.authz.common.database.entity.ClientType; import net.krotscheck.kangaroo.authz.test.ApplicationBuilder;
import javax.ws.rs.core.*; import net.krotscheck.kangaroo.authz.common.authenticator.*; import net.krotscheck.kangaroo.authz.common.database.entity.*; import net.krotscheck.kangaroo.authz.test.*;
[ "javax.ws", "net.krotscheck.kangaroo" ]
javax.ws; net.krotscheck.kangaroo;
583,347
public boolean isFocusTraversable(JComboBox c) { boolean result = false; Iterator iterator = uis.iterator(); // first UI delegate provides the return value if (iterator.hasNext()) { ComboBoxUI ui = (ComboBoxUI) iterator.next(); result = ui.isFocusTraversable(c); } // return values from auxiliary UI delegates are ignored while (iterator.hasNext()) { ComboBoxUI ui = (ComboBoxUI) iterator.next(); ui.isFocusTraversable(c); } return result; }
boolean function(JComboBox c) { boolean result = false; Iterator iterator = uis.iterator(); if (iterator.hasNext()) { ComboBoxUI ui = (ComboBoxUI) iterator.next(); result = ui.isFocusTraversable(c); } while (iterator.hasNext()) { ComboBoxUI ui = (ComboBoxUI) iterator.next(); ui.isFocusTraversable(c); } return result; }
/** * Calls the {@link ComboBoxUI#isFocusTraversable(JComboBox)} method for all * the UI delegates managed by this <code>MultiComboBoxUI</code>, * returning the result for the UI delegate from the primary look and * feel. * * @param c the component. * * @return <code>true</code> if the combo box is traversable according to the * UI delegate in the primary look and feel, and <code>false</code> * otherwise. */
Calls the <code>ComboBoxUI#isFocusTraversable(JComboBox)</code> method for all the UI delegates managed by this <code>MultiComboBoxUI</code>, returning the result for the UI delegate from the primary look and feel
isFocusTraversable
{ "repo_name": "shaotuanchen/sunflower_exp", "path": "tools/source/gcc-4.2.4/libjava/classpath/javax/swing/plaf/multi/MultiComboBoxUI.java", "license": "bsd-3-clause", "size": 13670 }
[ "java.util.Iterator", "javax.swing.JComboBox", "javax.swing.plaf.ComboBoxUI" ]
import java.util.Iterator; import javax.swing.JComboBox; import javax.swing.plaf.ComboBoxUI;
import java.util.*; import javax.swing.*; import javax.swing.plaf.*;
[ "java.util", "javax.swing" ]
java.util; javax.swing;
2,461,439
public static Spinner createSpinner(Composite parent, int hspan, int min, int max, int increment, int pageIncrement) { final Spinner spinner = new Spinner(parent, SWT.SINGLE | SWT.BORDER); spinner.setFont(parent.getFont()); spinner.setMinimum(min); spinner.setMaximum(max); spinner.setIncrement(increment); spinner.setPageIncrement(pageIncrement); spinner.setDigits(0); final GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = hspan; spinner.setLayoutData(gd); return spinner; }
static Spinner function(Composite parent, int hspan, int min, int max, int increment, int pageIncrement) { final Spinner spinner = new Spinner(parent, SWT.SINGLE SWT.BORDER); spinner.setFont(parent.getFont()); spinner.setMinimum(min); spinner.setMaximum(max); spinner.setIncrement(increment); spinner.setPageIncrement(pageIncrement); spinner.setDigits(0); final GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = hspan; spinner.setLayoutData(gd); return spinner; }
/** Create a spinner component. * * @param parent the parent component. * @param hspan the horizontal span (number of columns) * @param min the minimum value to be selected into the spinner. * @param max the maximum value to be selected into the spinner. * @param increment the increment for the selected value. * @param pageIncrement the page increment for the selected value. * @return the spinner. */
Create a spinner component
createSpinner
{ "repo_name": "sarl/sarl", "path": "main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SarlSwtFactory.java", "license": "apache-2.0", "size": 5444 }
[ "org.eclipse.swt.layout.GridData", "org.eclipse.swt.widgets.Composite", "org.eclipse.swt.widgets.Spinner" ]
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
2,820,379
public File getDownloadsDir() { return this.downloadsDir; }
File function() { return this.downloadsDir; }
/** * Returns the downloads directory * * @return File object for the downloads directory */
Returns the downloads directory
getDownloadsDir
{ "repo_name": "LexMinecraft/Launcher", "path": "src/main/java/com/atlauncher/data/Settings.java", "license": "gpl-3.0", "size": 101827 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
708,883
public static SubmissionContributor convertDboToDto(SubmissionContributorDBO dbo) throws DatastoreException { SubmissionContributor dto = new SubmissionContributor(); dto.setCreatedOn(dbo.getCreatedOn()); dto.setPrincipalId(dbo.getPrincipalId()==null?null:dbo.getPrincipalId().toString()); return dto; }
static SubmissionContributor function(SubmissionContributorDBO dbo) throws DatastoreException { SubmissionContributor dto = new SubmissionContributor(); dto.setCreatedOn(dbo.getCreatedOn()); dto.setPrincipalId(dbo.getPrincipalId()==null?null:dbo.getPrincipalId().toString()); return dto; }
/** * Convert a SubmissionStatus data transfer object to a SubmissionDBO database object * * @param dbo * @param dto * @throws DatastoreException */
Convert a SubmissionStatus data transfer object to a SubmissionDBO database object
convertDboToDto
{ "repo_name": "zimingd/Synapse-Repository-Services", "path": "lib/jdomodels/src/main/java/org/sagebionetworks/evaluation/dao/SubmissionUtils.java", "license": "apache-2.0", "size": 7563 }
[ "org.sagebionetworks.evaluation.dbo.SubmissionContributorDBO", "org.sagebionetworks.evaluation.model.SubmissionContributor", "org.sagebionetworks.repo.model.DatastoreException" ]
import org.sagebionetworks.evaluation.dbo.SubmissionContributorDBO; import org.sagebionetworks.evaluation.model.SubmissionContributor; import org.sagebionetworks.repo.model.DatastoreException;
import org.sagebionetworks.evaluation.dbo.*; import org.sagebionetworks.evaluation.model.*; import org.sagebionetworks.repo.model.*;
[ "org.sagebionetworks.evaluation", "org.sagebionetworks.repo" ]
org.sagebionetworks.evaluation; org.sagebionetworks.repo;
961,051
public String getLocalizedMessage() { return CmsVaadinUtils.getMessageText(m_message); }
String function() { return CmsVaadinUtils.getMessageText(m_message); }
/** * Gets localized message.<p> * * @return localized message */
Gets localized message
getLocalizedMessage
{ "repo_name": "alkacon/opencms-core", "path": "src/org/opencms/site/CmsSSLMode.java", "license": "lgpl-2.1", "size": 4612 }
[ "org.opencms.ui.CmsVaadinUtils" ]
import org.opencms.ui.CmsVaadinUtils;
import org.opencms.ui.*;
[ "org.opencms.ui" ]
org.opencms.ui;
1,741,177
InputStream istream = classloader.getResourceAsStream(filename); if (istream == null) return null; BufferedReader reader = new BufferedReader(new InputStreamReader(istream)); StringBuilder sb = new StringBuilder(); String line = null; try { while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } } catch (IOException e) { e.printStackTrace(); } finally { try { istream.close(); } catch (IOException e) { e.printStackTrace(); } } return sb.toString(); }
InputStream istream = classloader.getResourceAsStream(filename); if (istream == null) return null; BufferedReader reader = new BufferedReader(new InputStreamReader(istream)); StringBuilder sb = new StringBuilder(); String line = null; try { while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } } catch (IOException e) { e.printStackTrace(); } finally { try { istream.close(); } catch (IOException e) { e.printStackTrace(); } } return sb.toString(); }
/** * Just for reading a damn file from a package using class loader. * * @param classloader a class loader to use for loading the file * @param filename the file name. Package path should be given with slashes. * @return the contents of the file **/
Just for reading a damn file from a package using class loader
readFile
{ "repo_name": "magi42/csvalidation", "path": "csvalidation-demo/src/main/java/org/vaadin/csvalidation/demo/CSValidationUtil.java", "license": "apache-2.0", "size": 1304 }
[ "java.io.BufferedReader", "java.io.IOException", "java.io.InputStream", "java.io.InputStreamReader" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader;
import java.io.*;
[ "java.io" ]
java.io;
2,795,736
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DefaultOHLCDataset)) { return false; } DefaultOHLCDataset that = (DefaultOHLCDataset) obj; if (!this.key.equals(that.key)) { return false; } if (!Arrays.equals(this.data, that.data)) { return false; } return true; }
boolean function(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DefaultOHLCDataset)) { return false; } DefaultOHLCDataset that = (DefaultOHLCDataset) obj; if (!this.key.equals(that.key)) { return false; } if (!Arrays.equals(this.data, that.data)) { return false; } return true; }
/** * Tests this instance for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */
Tests this instance for equality with an arbitrary object
equals
{ "repo_name": "Mr-Steve/LTSpice_Library_Manager", "path": "libs/jfreechart-1.0.16/source/org/jfree/data/xy/DefaultOHLCDataset.java", "license": "gpl-2.0", "size": 9556 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
479,176
public static java.util.Set extractSkinAssessmentSet(ims.domain.ILightweightDomainFactory domainFactory, ims.nursing.vo.SkinAssessmentCollection voCollection) { return extractSkinAssessmentSet(domainFactory, voCollection, null, new HashMap()); }
static java.util.Set function(ims.domain.ILightweightDomainFactory domainFactory, ims.nursing.vo.SkinAssessmentCollection voCollection) { return extractSkinAssessmentSet(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.nursing.assessmenttools.domain.objects.SkinAssessment set from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.nursing.assessmenttools.domain.objects.SkinAssessment set from the value object collection
extractSkinAssessmentSet
{ "repo_name": "open-health-hub/openMAXIMS", "path": "openmaxims_workspace/ValueObjects/src/ims/nursing/vo/domain/SkinAssessmentAssembler.java", "license": "agpl-3.0", "size": 21148 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,835,370
public void createPlayer(Player player) { playerDao.createPlayer(player); List<Transcoding> transcodings = transcodingService.getAllTranscodings(); List<Transcoding> defaultActiveTranscodings = new ArrayList<Transcoding>(); for (Transcoding transcoding : transcodings) { if (transcoding.isDefaultActive()) { defaultActiveTranscodings.add(transcoding); } } transcodingService.setTranscodingsForPlayer(player, defaultActiveTranscodings); }
void function(Player player) { playerDao.createPlayer(player); List<Transcoding> transcodings = transcodingService.getAllTranscodings(); List<Transcoding> defaultActiveTranscodings = new ArrayList<Transcoding>(); for (Transcoding transcoding : transcodings) { if (transcoding.isDefaultActive()) { defaultActiveTranscodings.add(transcoding); } } transcodingService.setTranscodingsForPlayer(player, defaultActiveTranscodings); }
/** * Creates the given player, and activates all transcodings. * * @param player The player to create. */
Creates the given player, and activates all transcodings
createPlayer
{ "repo_name": "MadMarty/madsonic-server-5.1", "path": "madsonic-main/src/main/java/org/madsonic/service/PlayerService.java", "license": "gpl-3.0", "size": 11970 }
[ "java.util.ArrayList", "java.util.List", "org.madsonic.domain.Player", "org.madsonic.domain.Transcoding" ]
import java.util.ArrayList; import java.util.List; import org.madsonic.domain.Player; import org.madsonic.domain.Transcoding;
import java.util.*; import org.madsonic.domain.*;
[ "java.util", "org.madsonic.domain" ]
java.util; org.madsonic.domain;
2,681,668
// TODO: Rename to postClusterDeploy to be consistent void postDeployCluster() throws ExtraServiceException;
void postDeployCluster() throws ExtraServiceException;
/** * Call after a the hadoop cluster has been deployed */
Call after a the hadoop cluster has been deployed
postDeployCluster
{ "repo_name": "brooklyncentral/brooklyn-ambari", "path": "ambari/src/main/java/io/brooklyn/ambari/AmbariCluster.java", "license": "apache-2.0", "size": 12555 }
[ "io.brooklyn.ambari.service.ExtraServiceException" ]
import io.brooklyn.ambari.service.ExtraServiceException;
import io.brooklyn.ambari.service.*;
[ "io.brooklyn.ambari" ]
io.brooklyn.ambari;
280,422
public boolean updateAttributes( Dataset newAttrs, boolean overwriteReqAttrSQ, Dataset modifiedAttrs ) { Dataset oldAttrs = getAttributes(false); updateSeriesRequest(oldAttrs, newAttrs, overwriteReqAttrSQ); if ( oldAttrs == null ) { updateInstitutionCode(null, newAttrs.getItem(Tags.InstitutionCodeSeq)); setAttributes( newAttrs ); } else { updateInstitutionCode(oldAttrs.getItem(Tags.InstitutionCodeSeq), newAttrs.getItem(Tags.InstitutionCodeSeq)); AttributeFilter filter = AttributeFilter.getSeriesAttributeFilter(); if (!AttrUtils.updateAttributes(oldAttrs, filter.filter(newAttrs), modifiedAttrs, log) ) return false; setAttributes(oldAttrs); } return true; }
boolean function( Dataset newAttrs, boolean overwriteReqAttrSQ, Dataset modifiedAttrs ) { Dataset oldAttrs = getAttributes(false); updateSeriesRequest(oldAttrs, newAttrs, overwriteReqAttrSQ); if ( oldAttrs == null ) { updateInstitutionCode(null, newAttrs.getItem(Tags.InstitutionCodeSeq)); setAttributes( newAttrs ); } else { updateInstitutionCode(oldAttrs.getItem(Tags.InstitutionCodeSeq), newAttrs.getItem(Tags.InstitutionCodeSeq)); AttributeFilter filter = AttributeFilter.getSeriesAttributeFilter(); if (!AttrUtils.updateAttributes(oldAttrs, filter.filter(newAttrs), modifiedAttrs, log) ) return false; setAttributes(oldAttrs); } return true; }
/** * Update series attributes and SeriesRequest. * <p> * Deletes SeriesRequest objects if RequestAttributesSeq in newAttrs is empty. * * @param ds Dataset with series attributes. * @throws CreateException * * @ejb.interface-method */
Update series attributes and SeriesRequest. Deletes SeriesRequest objects if RequestAttributesSeq in newAttrs is empty
updateAttributes
{ "repo_name": "medicayun/medicayundicom", "path": "dcm4jboss-all/tags/DCM4CHEE_2_18_4/dcm4jboss-ejb/src/java/org/dcm4chex/archive/ejb/entity/SeriesBean.java", "license": "apache-2.0", "size": 49720 }
[ "org.dcm4che.data.Dataset", "org.dcm4che.dict.Tags", "org.dcm4chex.archive.ejb.conf.AttributeFilter" ]
import org.dcm4che.data.Dataset; import org.dcm4che.dict.Tags; import org.dcm4chex.archive.ejb.conf.AttributeFilter;
import org.dcm4che.data.*; import org.dcm4che.dict.*; import org.dcm4chex.archive.ejb.conf.*;
[ "org.dcm4che.data", "org.dcm4che.dict", "org.dcm4chex.archive" ]
org.dcm4che.data; org.dcm4che.dict; org.dcm4chex.archive;
880,287
@Deprecated public List<ITransformer> getTransformers() { MixinEnvironment.logger.warn("MixinEnvironment::getTransformers is deprecated!"); ITransformerProvider transformers = this.service.getTransformerProvider(); return transformers != null ? (List<ITransformer>)transformers.getTransformers() : Collections.<ITransformer>emptyList(); }
List<ITransformer> function() { MixinEnvironment.logger.warn(STR); ITransformerProvider transformers = this.service.getTransformerProvider(); return transformers != null ? (List<ITransformer>)transformers.getTransformers() : Collections.<ITransformer>emptyList(); }
/** * Returns (and generates if necessary) the transformer delegation list for * this environment. * * @return current transformer delegation list (read-only) * @deprecated Do not use this method */
Returns (and generates if necessary) the transformer delegation list for this environment
getTransformers
{ "repo_name": "SpongePowered/Mixin", "path": "src/main/java/org/spongepowered/asm/mixin/MixinEnvironment.java", "license": "mit", "size": 57429 }
[ "java.util.Collections", "java.util.List", "org.spongepowered.asm.service.ITransformer", "org.spongepowered.asm.service.ITransformerProvider" ]
import java.util.Collections; import java.util.List; import org.spongepowered.asm.service.ITransformer; import org.spongepowered.asm.service.ITransformerProvider;
import java.util.*; import org.spongepowered.asm.service.*;
[ "java.util", "org.spongepowered.asm" ]
java.util; org.spongepowered.asm;
890,437
public ImmutableList<String> list(String attrName) { return list(attrName, ruleContext.attributes().get(attrName, Type.STRING_LIST)); }
ImmutableList<String> function(String attrName) { return list(attrName, ruleContext.attributes().get(attrName, Type.STRING_LIST)); }
/** * Obtains the value of the attribute, expands all values, and returns the resulting list. If the * attribute does not exist or is not of type {@link Type#STRING_LIST}, then this method throws * an error. */
Obtains the value of the attribute, expands all values, and returns the resulting list. If the attribute does not exist or is not of type <code>Type#STRING_LIST</code>, then this method throws an error
list
{ "repo_name": "damienmg/bazel", "path": "src/main/java/com/google/devtools/build/lib/analysis/Expander.java", "license": "apache-2.0", "size": 7984 }
[ "com.google.common.collect.ImmutableList", "com.google.devtools.build.lib.syntax.Type" ]
import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.syntax.Type;
import com.google.common.collect.*; import com.google.devtools.build.lib.syntax.*;
[ "com.google.common", "com.google.devtools" ]
com.google.common; com.google.devtools;
1,683,369
@Override public void encodeUtf8(CharSequence in, ByteBuffer out) { if (out.hasArray()) { int start = out.arrayOffset(); int end = encodeUtf8Array(in, out.array(), start + out.position(), out.remaining()); out.position(end - start); } else { encodeUtf8Buffer(in, out); } } // These UTF-8 handling methods are copied from Guava's Utf8Unsafe class with // a modification to throw a local exception. This exception can be caught // to fallback to more lenient behavior. static class UnpairedSurrogateException extends IllegalArgumentException { UnpairedSurrogateException(int index, int length) { super("Unpaired surrogate at index " + index + " of " + length); } }
void function(CharSequence in, ByteBuffer out) { if (out.hasArray()) { int start = out.arrayOffset(); int end = encodeUtf8Array(in, out.array(), start + out.position(), out.remaining()); out.position(end - start); } else { encodeUtf8Buffer(in, out); } } static class UnpairedSurrogateException extends IllegalArgumentException { UnpairedSurrogateException(int index, int length) { super(STR + index + STR + length); } }
/** * Encodes the given characters to the target {@link ByteBuffer} using UTF-8 encoding. * * <p>Selects an optimal algorithm based on the type of {@link ByteBuffer} (i.e. heap or direct) * and the capabilities of the platform. * * @param in the source string to be encoded * @param out the target buffer to receive the encoded string. */
Encodes the given characters to the target <code>ByteBuffer</code> using UTF-8 encoding. Selects an optimal algorithm based on the type of <code>ByteBuffer</code> (i.e. heap or direct) and the capabilities of the platform
encodeUtf8
{ "repo_name": "google/flatbuffers", "path": "java/com/google/flatbuffers/Utf8Safe.java", "license": "apache-2.0", "size": 16245 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
445,094
private static void setServerConfiguration(String serverXML) throws Exception { // Update server.xml Log.info(c, "setServerConfiguration", "setServerConfigurationFile to : " + serverXML); // set a new mark server.setMarkToEndOfLog(server.getDefaultLogFile()); // Update the server xml server.setServerConfigurationFile("/" + serverXML); // Wait for CWWKG0017I and CWWKF0008I to appear in logs after we started the config update Log.info(c, "setServerConfiguration", "waitForStringInLogUsingMark: CWWKG0017I: The server configuration was successfully updated."); server.waitForStringInLogUsingMark("CWWKG0017I"); //CWWKG0017I: The server configuration was successfully updated in 0.2 seconds. }
static void function(String serverXML) throws Exception { Log.info(c, STR, STR + serverXML); server.setMarkToEndOfLog(server.getDefaultLogFile()); server.setServerConfigurationFile("/" + serverXML); Log.info(c, STR, STR); server.waitForStringInLogUsingMark(STR); }
/** * This is an internal method used to set the server.xml */
This is an internal method used to set the server.xml
setServerConfiguration
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.security.wim.core_fat/fat/src/com/ibm/ws/security/wim/core/fat/ConfigManagerFeatureTest.java", "license": "epl-1.0", "size": 4196 }
[ "com.ibm.websphere.simplicity.log.Log" ]
import com.ibm.websphere.simplicity.log.Log;
import com.ibm.websphere.simplicity.log.*;
[ "com.ibm.websphere" ]
com.ibm.websphere;
2,660,647
public static Map<VIF, VIF.Record> getAllRecords(Connection c) throws Types.BadServerResponse, XmlRpcException { String method_call = "VIF.get_all_records"; String session = c.getSessionReference(); Object[] method_params = {Marshalling.toXMLRPC(session)}; Map response = c.dispatch(method_call, method_params); if(response.get("Status").equals("Success")) { Object result = response.get("Value"); return Types.toMapOfVIFVIFRecord(result); } throw new Types.BadServerResponse(response); }
static Map<VIF, VIF.Record> function(Connection c) throws Types.BadServerResponse, XmlRpcException { String method_call = STR; String session = c.getSessionReference(); Object[] method_params = {Marshalling.toXMLRPC(session)}; Map response = c.dispatch(method_call, method_params); if(response.get(STR).equals(STR)) { Object result = response.get("Value"); return Types.toMapOfVIFVIFRecord(result); } throw new Types.BadServerResponse(response); }
/** * Return a map of VIF references to VIF records for all VIFs known to the system. * * @return records of all objects */
Return a map of VIF references to VIF records for all VIFs known to the system
getAllRecords
{ "repo_name": "cc14514/hq6", "path": "hq-plugin/xen-plugin/src/main/java/com/xensource/xenapi/VIF.java", "license": "unlicense", "size": 34400 }
[ "java.util.Map", "org.apache.xmlrpc.XmlRpcException" ]
import java.util.Map; import org.apache.xmlrpc.XmlRpcException;
import java.util.*; import org.apache.xmlrpc.*;
[ "java.util", "org.apache.xmlrpc" ]
java.util; org.apache.xmlrpc;
2,764,927