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
|
---|---|---|---|---|---|---|---|---|---|---|---|
private void adjustCrcFilePosition() throws IOException {
if (out != null) {
out.flush();
}
if (checksumOut != null) {
checksumOut.flush();
}
// rollback the position of the meta file
datanode.data.adjustCrcChannelPosition(block, streams, checksumSize);
} | void function() throws IOException { if (out != null) { out.flush(); } if (checksumOut != null) { checksumOut.flush(); } datanode.data.adjustCrcChannelPosition(block, streams, checksumSize); } | /**
* Adjust the file pointer in the local meta file so that the last checksum
* will be overwritten.
*/ | Adjust the file pointer in the local meta file so that the last checksum will be overwritten | adjustCrcFilePosition | {
"repo_name": "tseen/Federated-HDFS",
"path": "tseenliu/FedHDFS-hadoop-src/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java",
"license": "apache-2.0",
"size": 52959
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,163,183 |
public OvhSnapshot project_serviceName_volume_volumeId_snapshot_POST(String serviceName, String volumeId, String description, String name) throws IOException {
String qPath = "/cloud/project/{serviceName}/volume/{volumeId}/snapshot";
StringBuilder sb = path(qPath, serviceName, volumeId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "description", description);
addBody(o, "name", name);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhSnapshot.class);
} | OvhSnapshot function(String serviceName, String volumeId, String description, String name) throws IOException { String qPath = STR; StringBuilder sb = path(qPath, serviceName, volumeId); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, STR, description); addBody(o, "name", name); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhSnapshot.class); } | /**
* Snapshot a volume
*
* REST: POST /cloud/project/{serviceName}/volume/{volumeId}/snapshot
* @param description [required] Snapshot description
* @param name [required] Snapshot name
* @param serviceName [required] Service name
* @param volumeId [required] Volume id
*/ | Snapshot a volume | project_serviceName_volume_volumeId_snapshot_POST | {
"repo_name": "UrielCh/ovh-java-sdk",
"path": "ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java",
"license": "bsd-3-clause",
"size": 111796
} | [
"java.io.IOException",
"java.util.HashMap",
"net.minidev.ovh.api.cloud.volume.OvhSnapshot"
] | import java.io.IOException; import java.util.HashMap; import net.minidev.ovh.api.cloud.volume.OvhSnapshot; | import java.io.*; import java.util.*; import net.minidev.ovh.api.cloud.volume.*; | [
"java.io",
"java.util",
"net.minidev.ovh"
] | java.io; java.util; net.minidev.ovh; | 1,370,433 |
protected void emit_aAirStat_WSTerminalRuleCall_15_12_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
acceptNodes(transition, nodes);
}
| void function(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { acceptNodes(transition, nodes); } | /**
* Syntax:
* WS?
*/ | Syntax: WS | emit_aAirStat_WSTerminalRuleCall_15_12_q | {
"repo_name": "cooked/NDT",
"path": "sc.ndt.editor.fast.adn/src-gen/sc/ndt/editor/fast/serializer/FastadnSyntacticSequencer.java",
"license": "gpl-3.0",
"size": 49272
} | [
"java.util.List",
"org.eclipse.emf.ecore.EObject",
"org.eclipse.xtext.nodemodel.INode",
"org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider"
] | import java.util.List; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.nodemodel.INode; import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider; | import java.util.*; import org.eclipse.emf.ecore.*; import org.eclipse.xtext.nodemodel.*; import org.eclipse.xtext.serializer.analysis.*; | [
"java.util",
"org.eclipse.emf",
"org.eclipse.xtext"
] | java.util; org.eclipse.emf; org.eclipse.xtext; | 290,650 |
public static String parseUrl(String urlStr, String partToExtract, String key) {
if (!"QUERY".equals(partToExtract)) {
return null;
}
String query = parseUrl(urlStr, partToExtract);
if (query == null) {
return null;
}
Pattern p = Pattern.compile("(&|^)" + Pattern.quote(key) + "=([^&]*)");
Matcher m = p.matcher(query);
if (m.find()) {
return m.group(2);
}
return null;
} | static String function(String urlStr, String partToExtract, String key) { if (!"QUERY".equals(partToExtract)) { return null; } String query = parseUrl(urlStr, partToExtract); if (query == null) { return null; } Pattern p = Pattern.compile(STR + Pattern.quote(key) + STR); Matcher m = p.matcher(query); if (m.find()) { return m.group(2); } return null; } | /**
* Parse url and return various parameter of the URL. If accept any null arguments, return null.
*
* @param urlStr URL string.
* @param partToExtract must be QUERY, or return null.
* @param key parameter name.
* @return target value.
*/ | Parse url and return various parameter of the URL. If accept any null arguments, return null | parseUrl | {
"repo_name": "tillrohrmann/flink",
"path": "flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java",
"license": "apache-2.0",
"size": 35195
} | [
"java.util.regex.Matcher",
"java.util.regex.Pattern"
] | import java.util.regex.Matcher; import java.util.regex.Pattern; | import java.util.regex.*; | [
"java.util"
] | java.util; | 224,670 |
public static Component findComponent(Connector connector) {
if (connector instanceof Component) {
return (Component) connector;
}
if (connector.getParent() != null) {
return findComponent(connector.getParent());
}
return null;
} | static Component function(Connector connector) { if (connector instanceof Component) { return (Component) connector; } if (connector.getParent() != null) { return findComponent(connector.getParent()); } return null; } | /**
* Finds the nearest component by traversing upwards in the hierarchy. If
* connector is a Component, that Component is returned. Otherwise, looks
* upwards in the hierarchy until it finds a {@link Component}.
*
* @return A Component or null if no component was found
*/ | Finds the nearest component by traversing upwards in the hierarchy. If connector is a Component, that Component is returned. Otherwise, looks upwards in the hierarchy until it finds a <code>Component</code> | findComponent | {
"repo_name": "peterl1084/framework",
"path": "server/src/main/java/com/vaadin/server/DefaultErrorHandler.java",
"license": "apache-2.0",
"size": 4967
} | [
"com.vaadin.shared.Connector",
"com.vaadin.ui.Component"
] | import com.vaadin.shared.Connector; import com.vaadin.ui.Component; | import com.vaadin.shared.*; import com.vaadin.ui.*; | [
"com.vaadin.shared",
"com.vaadin.ui"
] | com.vaadin.shared; com.vaadin.ui; | 2,593,105 |
public Path getOutputFile() {
return outputLibrary.getArtifact().getPath();
} | Path function() { return outputLibrary.getArtifact().getPath(); } | /**
* Returns the path to the output artifact produced by the linker.
*/ | Returns the path to the output artifact produced by the linker | getOutputFile | {
"repo_name": "mikelalcon/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java",
"license": "apache-2.0",
"size": 24831
} | [
"com.google.devtools.build.lib.vfs.Path"
] | import com.google.devtools.build.lib.vfs.Path; | import com.google.devtools.build.lib.vfs.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,678,572 |
public void setInterceptSendToEndpoints(List<InterceptSendToEndpointDefinition> interceptSendToEndpoints) {
this.interceptSendToEndpoints = interceptSendToEndpoints;
} | void function(List<InterceptSendToEndpointDefinition> interceptSendToEndpoints) { this.interceptSendToEndpoints = interceptSendToEndpoints; } | /**
* Configuration of interceptors that triggers sending messages to endpoints.
*/ | Configuration of interceptors that triggers sending messages to endpoints | setInterceptSendToEndpoints | {
"repo_name": "tadayosi/camel",
"path": "components/camel-spring-xml/src/main/java/org/apache/camel/spring/xml/CamelContextFactoryBean.java",
"license": "apache-2.0",
"size": 53508
} | [
"java.util.List",
"org.apache.camel.model.InterceptSendToEndpointDefinition"
] | import java.util.List; import org.apache.camel.model.InterceptSendToEndpointDefinition; | import java.util.*; import org.apache.camel.model.*; | [
"java.util",
"org.apache.camel"
] | java.util; org.apache.camel; | 307,647 |
public Map<String, Serializable> getValues() {
return model.getValues();
}
| Map<String, Serializable> function() { return model.getValues(); } | /**
* Getter for the Values.
*
* @return the Map<String, Serializable>.
*/ | Getter for the Values | getValues | {
"repo_name": "NABUCCO/org.nabucco.testautomation.script",
"path": "org.nabucco.testautomation.script.ui.rcp/src/main/gen/org/nabucco/testautomation/script/ui/rcp/list/script/view/TestScriptListView.java",
"license": "epl-1.0",
"size": 2935
} | [
"java.io.Serializable",
"java.util.Map"
] | import java.io.Serializable; import java.util.Map; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 876,461 |
public PhraseSuggestionBuilder collateParams(Map<String, Object> collateParams) {
Objects.requireNonNull(collateParams, "collate parameters cannot be null.");
this.collateParams = new HashMap<>(collateParams);
return this;
} | PhraseSuggestionBuilder function(Map<String, Object> collateParams) { Objects.requireNonNull(collateParams, STR); this.collateParams = new HashMap<>(collateParams); return this; } | /**
* Adds additional parameters for collate scripts. Previously added parameters on the
* same builder will be overwritten.
*/ | Adds additional parameters for collate scripts. Previously added parameters on the same builder will be overwritten | collateParams | {
"repo_name": "zkidkid/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/search/suggest/phrase/PhraseSuggestionBuilder.java",
"license": "apache-2.0",
"size": 33267
} | [
"java.util.HashMap",
"java.util.Map",
"java.util.Objects"
] | import java.util.HashMap; import java.util.Map; import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 2,111,852 |
public Coin getBalance() {
return getBalance(BalanceType.AVAILABLE);
} | Coin function() { return getBalance(BalanceType.AVAILABLE); } | /**
* Returns the AVAILABLE balance of this wallet. See {@link BalanceType#AVAILABLE} for details on what this
* means.
*/ | Returns the AVAILABLE balance of this wallet. See <code>BalanceType#AVAILABLE</code> for details on what this means | getBalance | {
"repo_name": "bitcoinj/bitcoinj",
"path": "core/src/main/java/org/bitcoinj/wallet/Wallet.java",
"license": "apache-2.0",
"size": 267304
} | [
"org.bitcoinj.core.Coin"
] | import org.bitcoinj.core.Coin; | import org.bitcoinj.core.*; | [
"org.bitcoinj.core"
] | org.bitcoinj.core; | 2,791,188 |
public String getPasswordValue(Object o) {
if (o==null) return null;
if (o instanceof Secret) return ((Secret)o).getEncryptedValue();
if (getIsUnitTest()) {
throw new SecurityException("attempted to render plaintext ‘" + o + "’ in password field; use a getter of type Secret instead");
}
return o.toString();
} | String function(Object o) { if (o==null) return null; if (o instanceof Secret) return ((Secret)o).getEncryptedValue(); if (getIsUnitTest()) { throw new SecurityException(STR + o + STR); } return o.toString(); } | /**
* Used by <f:password/> so that we send an encrypted value to the client.
*/ | Used by <f:password/> so that we send an encrypted value to the client | getPasswordValue | {
"repo_name": "msrb/jenkins",
"path": "core/src/main/java/hudson/Functions.java",
"license": "mit",
"size": 70132
} | [
"hudson.util.Secret"
] | import hudson.util.Secret; | import hudson.util.*; | [
"hudson.util"
] | hudson.util; | 1,380,517 |
public String testTemplate(SimpleEntry template, boolean isWrongTempl,
Transaction txn, long timeout, int curIter, int iterNum,
boolean ifExistsMethod) throws TestException {
SimpleEntry result;
SimpleEntry takenEntry;
Entry snapshot;
long curTime1;
long curTime2;
String iterStr;
String txnStr;
String methodStr;
String tmplStr;
String timeoutStr;
// fill iteration number string
switch (curIter) {
case 0:
{
iterStr = " ";
break;
}
case 1:
{
iterStr = "1-st ";
break;
}
case 2:
{
iterStr = "2-nd ";
break;
}
case 3:
{
iterStr = "3-rd ";
break;
}
default:
{
iterStr = "" + curIter + "-th ";
break;
}
}
// fill transaction string
if (txn == null) {
txnStr = "";
} else {
txnStr = " within the non null transaction";
}
// fill method string
if (ifExistsMethod) {
methodStr = "takeIfExists";
} else {
methodStr = "take";
}
// fill template string
if (template == null) {
tmplStr = "snapshot of null template";
} else {
tmplStr = "snapshot of template " + template.toString();
}
// fill timeout string
if (timeout == JavaSpace.NO_WAIT) {
timeoutStr = "JavaSpace.NO_WAIT value for";
} else {
timeoutStr = "" + timeout + " ms";
}
try {
snapshot = space.snapshot(template);
curTime1 = System.currentTimeMillis();
if (ifExistsMethod) {
result = (SimpleEntry) space.takeIfExists(snapshot, txn,
timeout);
} else {
result = (SimpleEntry) space.take(snapshot, txn, timeout);
}
curTime2 = System.currentTimeMillis();
takenEntry = result;
// check that it has returned required entry
if (isWrongTempl) {
if (result != null) {
return "performed " + iterStr + methodStr + " with "
+ tmplStr + txnStr + " and " + timeoutStr
+ " timeout, expected null but read " + result;
}
} else {
if (result == null) {
return "performed " + iterStr + methodStr + " with "
+ tmplStr + txnStr + " and " + timeoutStr
+ " timeout, expected non null but took null"
+ " result.";
} else if (template != null && !template.implies(result)) {
return "performed " + iterStr + methodStr + " with "
+ tmplStr + txnStr + " and " + timeoutStr
+ " timeout, expected matching entry, but took "
+ result;
}
}
if (ifExistsMethod || (timeout == JavaSpace.NO_WAIT)) {
// check that operation has returned immediately
if ((curTime2 - curTime1) > instantTime) {
return iterStr + methodStr + " with " + tmplStr + txnStr
+ " and " + timeoutStr + " timeout has returned in "
+ (curTime2 - curTime1) + " but expected in "
+ instantTime;
}
} else if (isWrongTempl) {
if ((curTime2 - curTime1) < timeout) {
return iterStr + methodStr + " with " + tmplStr + txnStr
+ " and " + timeoutStr + " timeout has returned in "
+ (curTime2 - curTime1)
+ " but expected at least in" + timeout;
}
}
// if we test wrong template then test passed
if (isWrongTempl) {
logDebugText(iterStr + methodStr + " with " + tmplStr + txnStr
+ " and " + timeoutStr + " timeout works as expected.");
return null;
}
if (iterNum == 0) {
result = (SimpleEntry) space.read(takenEntry, txn, checkTime);
if (result != null) {
return "performed " + iterStr + methodStr + " with "
+ tmplStr + txnStr + " and " + timeoutStr
+ " timeout did not remove taken entry"
+ " from the space.";
}
} else if ((iterNum - curIter) == 0) {
result = (SimpleEntry) space.read(template, txn, checkTime);
if (result != null) {
return "performed " + iterStr + methodStr + " with "
+ tmplStr + txnStr + " and " + timeoutStr
+ " timeout,"
+ " expected, that there are no entries available"
+ " in the space but at least 1 " + result
+ " is still there.";
}
} else {
result = (SimpleEntry) space.read(template, txn, checkTime);
if (result == null) {
return "performed " + iterStr + methodStr + " with "
+ tmplStr + txnStr + " and " + timeoutStr
+ " timeout,"
+ " there are no entries in the space after"
+ " tested method invocation but at least 1"
+ " is expected to remain.";
}
}
} catch (Exception ex) {
throw new TestException("The following exception has been thrown"
+ " while trying to test " + iterStr + methodStr + " with "
+ tmplStr + txnStr + " and " + timeoutStr + " timeout: "
+ ex);
}
logDebugText(iterStr + methodStr + " with " + tmplStr + txnStr + " and "
+ timeoutStr + " timeout works as expected.");
return null;
} | String function(SimpleEntry template, boolean isWrongTempl, Transaction txn, long timeout, int curIter, int iterNum, boolean ifExistsMethod) throws TestException { SimpleEntry result; SimpleEntry takenEntry; Entry snapshot; long curTime1; long curTime2; String iterStr; String txnStr; String methodStr; String tmplStr; String timeoutStr; switch (curIter) { case 0: { iterStr = " "; break; } case 1: { iterStr = STR; break; } case 2: { iterStr = STR; break; } case 3: { iterStr = STR; break; } default: { iterStr = STR-th STRSTR within the non null transactionSTRtakeIfExistsSTRtakeSTRsnapshot of null templateSTRsnapshot of template STRJavaSpace.NO_WAIT value forSTRSTR msSTRperformed STR with STR and STR timeout, expected null but read STRperformed STR with STR and STR timeout, expected non null but took nullSTR result.STRperformed STR with STR and STR timeout, expected matching entry, but took STR with STR and STR timeout has returned in STR but expected in STR with STR and STR timeout has returned in STR but expected at least inSTR with STR and STR timeout works as expected.STRperformed STR with STR and STR timeout did not remove taken entrySTR from the space.STRperformed STR with STR and STR timeout,STR expected, that there are no entries availableSTR in the space but at least 1 STR is still there.STRperformed STR with STR and STR timeout,STR there are no entries in the space afterSTR tested method invocation but at least 1STR is expected to remain.STRThe following exception has been thrownSTR while trying to test STR with STR and STR timeout: STR with STR and STR timeout works as expected."); return null; } | /**
* Main testing method which tests take/takeIfExists method
* with or without transactions, measure time of invocation
* and check that result entry match specified template.
*
* @param template Template to be tested.
* @param isWrongTempl
* true if we tests wrong template, expects no matching
* or false if not.
* @param txn Transaction under wich we test method (may be null).
* @param timeout Timeout for take/takeIfExists operations.
* @param curIter Iteration number for correct output strings creation.
* @param iterNum
* Whole number of tests:
* if current iteration number is equal to this parameter,
* then we expected that there will be no matching
* entries in the space after tested method invocation,
* if no - then at lease one matching entry must remain
* in the space.
* @param ifExistsMethod
* Which method to test:
* true - means "takeIfExists" method,
* false - means "take" one.
*
* @return
* Null if test passes successfully or string with error
* if test fails.
*
* @exception TestException
* Thrown if any exception is catched during testing.
*/ | Main testing method which tests take/takeIfExists method with or without transactions, measure time of invocation and check that result entry match specified template | testTemplate | {
"repo_name": "cdegroot/river",
"path": "qa/src/com/sun/jini/test/spec/javaspace/conformance/snapshot/SnapshotAbstractTakeTestBase.java",
"license": "apache-2.0",
"size": 12753
} | [
"com.sun.jini.qa.harness.TestException",
"com.sun.jini.test.spec.javaspace.conformance.SimpleEntry",
"net.jini.core.entry.Entry",
"net.jini.core.transaction.Transaction"
] | import com.sun.jini.qa.harness.TestException; import com.sun.jini.test.spec.javaspace.conformance.SimpleEntry; import net.jini.core.entry.Entry; import net.jini.core.transaction.Transaction; | import com.sun.jini.qa.harness.*; import com.sun.jini.test.spec.javaspace.conformance.*; import net.jini.core.entry.*; import net.jini.core.transaction.*; | [
"com.sun.jini",
"net.jini.core"
] | com.sun.jini; net.jini.core; | 1,209,712 |
@SuppressWarnings("unchecked")
private static <T> T createCustomComponent(Class<T> componentType, Class<?> componentClass,
Map<String, String> configProperties) throws Exception {
if (componentClass == null) {
throw new IllegalArgumentException("Invalid component spec (class not found)."); //$NON-NLS-1$
}
try {
Constructor<?> constructor = componentClass.getConstructor(Map.class);
return (T) constructor.newInstance(configProperties);
} catch (Exception e) {
}
return (T) componentClass.getConstructor().newInstance();
} | @SuppressWarnings(STR) static <T> T function(Class<T> componentType, Class<?> componentClass, Map<String, String> configProperties) throws Exception { if (componentClass == null) { throw new IllegalArgumentException(STR); } try { Constructor<?> constructor = componentClass.getConstructor(Map.class); return (T) constructor.newInstance(configProperties); } catch (Exception e) { } return (T) componentClass.getConstructor().newInstance(); } | /**
* Creates a custom component from a loaded class.
* @param componentType
* @param componentClass
* @param configProperties
*/ | Creates a custom component from a loaded class | createCustomComponent | {
"repo_name": "kahboom/apiman",
"path": "manager/api/war/src/main/java/io/apiman/manager/api/war/WarCdiFactory.java",
"license": "apache-2.0",
"size": 18635
} | [
"java.lang.reflect.Constructor",
"java.util.Map"
] | import java.lang.reflect.Constructor; import java.util.Map; | import java.lang.reflect.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 481,929 |
public static void removeTranslations(Connection con, int nodeId) throws SQLException {
SilverTrace.info("node", "NodeI18NDAO.removeTranslations()", "root.MSG_GEN_ENTER_METHOD");
PreparedStatement prepStmt = null;
try {
prepStmt = con.prepareStatement(REMOVE_TRANSLATIONS);
prepStmt.setInt(1, nodeId);
prepStmt.executeUpdate();
} finally {
DBUtil.close(prepStmt);
}
SilverTrace.info("node", "NodeI18NDAO.removeTranslations()", "root.MSG_GEN_EXIT_METHOD");
} | static void function(Connection con, int nodeId) throws SQLException { SilverTrace.info("node", STR, STR); PreparedStatement prepStmt = null; try { prepStmt = con.prepareStatement(REMOVE_TRANSLATIONS); prepStmt.setInt(1, nodeId); prepStmt.executeUpdate(); } finally { DBUtil.close(prepStmt); } SilverTrace.info("node", STR, STR); } | /**
* Delete all translations of a node
* @param nodeId id of the node to delete
* @param con the JDBC Connection
* @exception java.sql.SQLException
* @since 1.0
*/ | Delete all translations of a node | removeTranslations | {
"repo_name": "NicolasEYSSERIC/Silverpeas-Core",
"path": "ejb-core/node/src/main/java/com/stratelia/webactiv/util/node/ejb/NodeI18NDAO.java",
"license": "agpl-3.0",
"size": 8414
} | [
"com.stratelia.silverpeas.silvertrace.SilverTrace",
"com.stratelia.webactiv.util.DBUtil",
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.SQLException"
] | import com.stratelia.silverpeas.silvertrace.SilverTrace; import com.stratelia.webactiv.util.DBUtil; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; | import com.stratelia.silverpeas.silvertrace.*; import com.stratelia.webactiv.util.*; import java.sql.*; | [
"com.stratelia.silverpeas",
"com.stratelia.webactiv",
"java.sql"
] | com.stratelia.silverpeas; com.stratelia.webactiv; java.sql; | 2,769,072 |
protected void updateRelocation(Relocation value, String xmlTag, Counter counter, Element element)
{
boolean shouldExist = value != null;
Element root = updateElement(counter, element, xmlTag, shouldExist);
if (shouldExist)
{
Counter innerCount = new Counter(counter.getDepth() + 1);
findAndReplaceSimpleElement(innerCount, root, "groupId", value.getGroupId(), null);
findAndReplaceSimpleElement(innerCount, root, "artifactId", value.getArtifactId(), null);
findAndReplaceSimpleElement(innerCount, root, "version", value.getVersion(), null);
findAndReplaceSimpleElement(innerCount, root, "message", value.getMessage(), null);
}
} // -- void updateRelocation(Relocation, String, Counter, Element) | void function(Relocation value, String xmlTag, Counter counter, Element element) { boolean shouldExist = value != null; Element root = updateElement(counter, element, xmlTag, shouldExist); if (shouldExist) { Counter innerCount = new Counter(counter.getDepth() + 1); findAndReplaceSimpleElement(innerCount, root, STR, value.getGroupId(), null); findAndReplaceSimpleElement(innerCount, root, STR, value.getArtifactId(), null); findAndReplaceSimpleElement(innerCount, root, STR, value.getVersion(), null); findAndReplaceSimpleElement(innerCount, root, STR, value.getMessage(), null); } } | /**
* Method updateRelocation.
*
* @param value
* @param element
* @param counter
* @param xmlTag
*/ | Method updateRelocation | updateRelocation | {
"repo_name": "jerr/jbossforge-core",
"path": "maven/impl/src/main/java/org/jboss/forge/addon/maven/util/MavenJDOMWriter.java",
"license": "epl-1.0",
"size": 84577
} | [
"org.apache.maven.model.Relocation",
"org.jdom.Element"
] | import org.apache.maven.model.Relocation; import org.jdom.Element; | import org.apache.maven.model.*; import org.jdom.*; | [
"org.apache.maven",
"org.jdom"
] | org.apache.maven; org.jdom; | 1,669,350 |
interface WithProperties {
WithCreate withProperties(InputProperties properties);
}
interface WithCreate extends Creatable<Input>, DefinitionStages.WithName, DefinitionStages.WithProperties {
}
}
interface Update extends Appliable<Input>, UpdateStages.WithName, UpdateStages.WithProperties {
} | interface WithProperties { WithCreate withProperties(InputProperties properties); } interface WithCreate extends Creatable<Input>, DefinitionStages.WithName, DefinitionStages.WithProperties { } } interface Update extends Appliable<Input>, UpdateStages.WithName, UpdateStages.WithProperties { } | /**
* Specifies properties.
*/ | Specifies properties | withProperties | {
"repo_name": "hovsepm/azure-sdk-for-java",
"path": "streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/Input.java",
"license": "mit",
"size": 3808
} | [
"com.microsoft.azure.arm.model.Appliable",
"com.microsoft.azure.arm.model.Creatable"
] | import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; | import com.microsoft.azure.arm.model.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 1,129,331 |
@PreAuthorize(SecurityConstants.MANAGE_MESSAGES)
void saveNotificationRules(List<NotificationRule> notificationRules); | @PreAuthorize(SecurityConstants.MANAGE_MESSAGES) void saveNotificationRules(List<NotificationRule> notificationRules); | /**
* Creates or updates notification rules. Rule is updated when it has the id field set.
*
* @param notificationRules the list of notification rules to create/update
*/ | Creates or updates notification rules. Rule is updated when it has the id field set | saveNotificationRules | {
"repo_name": "adamkalmus/motech",
"path": "modules/admin/src/main/java/org/motechproject/admin/service/StatusMessageService.java",
"license": "bsd-3-clause",
"size": 8881
} | [
"java.util.List",
"org.motechproject.admin.domain.NotificationRule",
"org.motechproject.admin.security.SecurityConstants",
"org.springframework.security.access.prepost.PreAuthorize"
] | import java.util.List; import org.motechproject.admin.domain.NotificationRule; import org.motechproject.admin.security.SecurityConstants; import org.springframework.security.access.prepost.PreAuthorize; | import java.util.*; import org.motechproject.admin.domain.*; import org.motechproject.admin.security.*; import org.springframework.security.access.prepost.*; | [
"java.util",
"org.motechproject.admin",
"org.springframework.security"
] | java.util; org.motechproject.admin; org.springframework.security; | 995,649 |
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11")
public long getIdx() {
return idx;
} | @Generated(value = STR, date = STR, comments = STR) long function() { return idx; } | /**
* Gets the value of the idx property.
*
*/ | Gets the value of the idx property | getIdx | {
"repo_name": "kanonirov/lanb-client",
"path": "src/main/java/ru/lanbilling/webservice/wsdl/SoapAddressBuilding.java",
"license": "mit",
"size": 10468
} | [
"javax.annotation.Generated"
] | import javax.annotation.Generated; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,789,988 |
public StructObjectInspector getSourceInspector() {
return sourceInspector;
} | StructObjectInspector function() { return sourceInspector; } | /**
* Returns the source object inspector.
* @return the source object inspector
*/ | Returns the source object inspector | getSourceInspector | {
"repo_name": "cocoatomo/asakusafw",
"path": "hive-project/asakusa-hive-core/src/main/java/com/asakusafw/directio/hive/serde/DataModelDriver.java",
"license": "apache-2.0",
"size": 10722
} | [
"org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector"
] | import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; | import org.apache.hadoop.hive.serde2.objectinspector.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,010,340 |
public FindAndUpdateOperation<T> filter(final BsonDocument filter) {
this.filter = filter;
return this;
} | FindAndUpdateOperation<T> function(final BsonDocument filter) { this.filter = filter; return this; } | /**
* Sets the filter to apply to the query.
*
* @param filter the filter, which may be null.
* @return this
* @mongodb.driver.manual reference/method/db.collection.find/ Filter
*/ | Sets the filter to apply to the query | filter | {
"repo_name": "rozza/mongo-java-driver",
"path": "driver-core/src/main/com/mongodb/internal/operation/FindAndUpdateOperation.java",
"license": "apache-2.0",
"size": 16321
} | [
"org.bson.BsonDocument"
] | import org.bson.BsonDocument; | import org.bson.*; | [
"org.bson"
] | org.bson; | 151,376 |
public static int hashCode(List<byte[]> list) {
int hash = 1;
for (byte[] bytes : list) {
hash = 31 * hash + hashCode(bytes);
}
return hash;
} | static int function(List<byte[]> list) { int hash = 1; for (byte[] bytes : list) { hash = 31 * hash + hashCode(bytes); } return hash; } | /**
* Helper method for implementing {@link Message#hashCode()} for bytes field.
*/ | Helper method for implementing <code>Message#hashCode()</code> for bytes field | hashCode | {
"repo_name": "legrosbuffle/kythe",
"path": "third_party/proto/java/core/src/main/java/com/google/protobuf/Internal.java",
"license": "apache-2.0",
"size": 24135
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,413,417 |
oi = new OI();
chooser.addDefault("Default Auto", new ExampleCommand());
// chooser.addObject("My Auto", new MyAutoCommand());
SmartDashboard.putData("Auto mode", chooser);
} | oi = new OI(); chooser.addDefault(STR, new ExampleCommand()); SmartDashboard.putData(STR, chooser); } | /**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/ | This function is run when the robot is first started up and should be used for any initialization code | robotInit | {
"repo_name": "FRC-4121/2017-Robot",
"path": "src/org/usfirst/frc/team4121/robot/Robot.java",
"license": "gpl-3.0",
"size": 3556
} | [
"edu.wpi.first.wpilibj.smartdashboard.SmartDashboard",
"org.usfirst.frc.team4121.robot.commands.ExampleCommand"
] | import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import org.usfirst.frc.team4121.robot.commands.ExampleCommand; | import edu.wpi.first.wpilibj.smartdashboard.*; import org.usfirst.frc.team4121.robot.commands.*; | [
"edu.wpi.first",
"org.usfirst.frc"
] | edu.wpi.first; org.usfirst.frc; | 1,782,986 |
public void forEach(Consumer<? super IExpr> action, int startOffset); | void function(Consumer<? super IExpr> action, int startOffset); | /**
* Iterate over all elements from index <code>startOffset</code> to <code>size()-1</code> and call
* the method <code>Consumer.accept()</code> for these elements. <b>Note:</b> the 0-th element
* (i.e. the head of the AST) will not be selected.
*
* @param action
* @param startOffset the start offset from which the action.accept() method should be executed
*/ | Iterate over all elements from index <code>startOffset</code> to <code>size()-1</code> and call the method <code>Consumer.accept()</code> for these elements. Note: the 0-th element (i.e. the head of the AST) will not be selected | forEach | {
"repo_name": "axkr/symja_android_library",
"path": "symja_android_library/matheclipse-core/src/main/java/org/matheclipse/core/interfaces/IAST.java",
"license": "gpl-3.0",
"size": 60090
} | [
"java.util.function.Consumer"
] | import java.util.function.Consumer; | import java.util.function.*; | [
"java.util"
] | java.util; | 1,548,979 |
@Override
public synchronized WatermarkUpdate refresh() {
Instant oldWatermark = currentWatermark.get();
Instant minInputWatermark = BoundedWindow.TIMESTAMP_MAX_VALUE;
for (Watermark inputWatermark : inputWatermarks) {
minInputWatermark = INSTANT_ORDERING.min(minInputWatermark, inputWatermark.get());
}
if (!pendingElements.isEmpty()) {
minInputWatermark =
INSTANT_ORDERING.min(
minInputWatermark, pendingElements.firstEntry().getElement().getMinimumTimestamp());
}
Instant newWatermark = INSTANT_ORDERING.max(oldWatermark, minInputWatermark);
currentWatermark.set(newWatermark);
return updateAndTrace(getName(), oldWatermark, newWatermark);
} | synchronized WatermarkUpdate function() { Instant oldWatermark = currentWatermark.get(); Instant minInputWatermark = BoundedWindow.TIMESTAMP_MAX_VALUE; for (Watermark inputWatermark : inputWatermarks) { minInputWatermark = INSTANT_ORDERING.min(minInputWatermark, inputWatermark.get()); } if (!pendingElements.isEmpty()) { minInputWatermark = INSTANT_ORDERING.min( minInputWatermark, pendingElements.firstEntry().getElement().getMinimumTimestamp()); } Instant newWatermark = INSTANT_ORDERING.max(oldWatermark, minInputWatermark); currentWatermark.set(newWatermark); return updateAndTrace(getName(), oldWatermark, newWatermark); } | /**
* {@inheritDoc}.
*
* <p>When refresh is called, the value of the {@link AppliedPTransformInputWatermark} becomes
* equal to the maximum value of
*
* <ul>
* <li>the previous input watermark
* <li>the minimum of
* <ul>
* <li>the timestamps of all currently pending elements
* <li>all input {@link PCollection} watermarks
* </ul>
* </ul>
*/ | . When refresh is called, the value of the <code>AppliedPTransformInputWatermark</code> becomes equal to the maximum value of the previous input watermark the minimum of the timestamps of all currently pending elements all input <code>PCollection</code> watermarks | refresh | {
"repo_name": "iemejia/incubator-beam",
"path": "runners/direct-java/src/main/java/org/apache/beam/runners/direct/WatermarkManager.java",
"license": "apache-2.0",
"size": 70536
} | [
"org.apache.beam.sdk.transforms.windowing.BoundedWindow",
"org.joda.time.Instant"
] | import org.apache.beam.sdk.transforms.windowing.BoundedWindow; import org.joda.time.Instant; | import org.apache.beam.sdk.transforms.windowing.*; import org.joda.time.*; | [
"org.apache.beam",
"org.joda.time"
] | org.apache.beam; org.joda.time; | 2,471,020 |
private void updateViews() {
Piece values[][] = board.getPieces();
for (int i = 0; i < pieces.length; i++) {
for (int j = 0; j < pieces[i].length; j++) {
pieces[i][j].setAlpha(1F);
switch (values[i][j]) {
case PLAYER1:
pieces[i][j].setImageResource(R.drawable.blue);
break;
case PLAYER2:
pieces[i][j].setImageResource(R.drawable.green);
break;
case PLAYER3:
pieces[i][j].setImageResource(R.drawable.orange);
break;
case PLAYER4:
pieces[i][j].setImageResource(R.drawable.fuchsia);
break;
case EMPTY:
pieces[i][j].setImageResource(R.drawable.white);
break;
}
}
}
if (board.isGameOver() == true || board.hasWinner() == true) {
board.setGameOver();
storeTrainingExamples(board.getWinnerSession());
Toast.makeText(this, getResources().getString(R.string.game_over_message), Toast.LENGTH_LONG).show();
sounds.play(finishId, 0.99f, 0.99f, 0, 0, 1);
}
int winners[][] = board.winners();
for (int i = 0; i < pieces.length; i++) {
for (int j = 0; j < pieces[i].length; j++) {
if (board.isGameOver() == true && values[i][j] == Piece.EMPTY) {
pieces[i][j].setImageBitmap(null);
}
if (board.isGameOver() == true && winners[i][j] == 0) {
pieces[i][j].setAlpha(0.4F);
}
}
}
}
/**
* {@inheritDoc} | void function() { Piece values[][] = board.getPieces(); for (int i = 0; i < pieces.length; i++) { for (int j = 0; j < pieces[i].length; j++) { pieces[i][j].setAlpha(1F); switch (values[i][j]) { case PLAYER1: pieces[i][j].setImageResource(R.drawable.blue); break; case PLAYER2: pieces[i][j].setImageResource(R.drawable.green); break; case PLAYER3: pieces[i][j].setImageResource(R.drawable.orange); break; case PLAYER4: pieces[i][j].setImageResource(R.drawable.fuchsia); break; case EMPTY: pieces[i][j].setImageResource(R.drawable.white); break; } } } if (board.isGameOver() == true board.hasWinner() == true) { board.setGameOver(); storeTrainingExamples(board.getWinnerSession()); Toast.makeText(this, getResources().getString(R.string.game_over_message), Toast.LENGTH_LONG).show(); sounds.play(finishId, 0.99f, 0.99f, 0, 0, 1); } int winners[][] = board.winners(); for (int i = 0; i < pieces.length; i++) { for (int j = 0; j < pieces[i].length; j++) { if (board.isGameOver() == true && values[i][j] == Piece.EMPTY) { pieces[i][j].setImageBitmap(null); } if (board.isGameOver() == true && winners[i][j] == 0) { pieces[i][j].setAlpha(0.4F); } } } } /** * {@inheritDoc} | /**
* Update UI helper function.
*/ | Update UI helper function | updateViews | {
"repo_name": "TodorBalabanov/Complica4",
"path": "client/src/eu/veldsoft/complica4/GameActivity.java",
"license": "gpl-3.0",
"size": 10135
} | [
"android.widget.Toast",
"eu.veldsoft.complica4.model.Piece"
] | import android.widget.Toast; import eu.veldsoft.complica4.model.Piece; | import android.widget.*; import eu.veldsoft.complica4.model.*; | [
"android.widget",
"eu.veldsoft.complica4"
] | android.widget; eu.veldsoft.complica4; | 2,502,675 |
public ListTreeNode<MultiGroupHaplotypeAssociationTest> getMultiGroupHaplotypeAssociationTestsTreeNode()
{
return this.multiGroupHaplotypeAssociationTestsTreeNode;
}
/**
* {@inheritDoc} | ListTreeNode<MultiGroupHaplotypeAssociationTest> function() { return this.multiGroupHaplotypeAssociationTestsTreeNode; } /** * {@inheritDoc} | /**
* Getter for the sliding window tests node
* @return the tree node for sliding window tests
*/ | Getter for the sliding window tests node | getMultiGroupHaplotypeAssociationTestsTreeNode | {
"repo_name": "cgd/bham",
"path": "modules/main/src/java/org/jax/bham/project/BhamProjectTreeNode.java",
"license": "gpl-3.0",
"size": 6981
} | [
"org.jax.haplotype.analysis.MultiGroupHaplotypeAssociationTest",
"org.jax.util.gui.ListTreeNode"
] | import org.jax.haplotype.analysis.MultiGroupHaplotypeAssociationTest; import org.jax.util.gui.ListTreeNode; | import org.jax.haplotype.analysis.*; import org.jax.util.gui.*; | [
"org.jax.haplotype",
"org.jax.util"
] | org.jax.haplotype; org.jax.util; | 1,878,281 |
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.firstBarPaint = SerialUtilities.readPaint(stream);
this.lastBarPaint = SerialUtilities.readPaint(stream);
this.positiveBarPaint = SerialUtilities.readPaint(stream);
this.negativeBarPaint = SerialUtilities.readPaint(stream);
}
| void function(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.firstBarPaint = SerialUtilities.readPaint(stream); this.lastBarPaint = SerialUtilities.readPaint(stream); this.positiveBarPaint = SerialUtilities.readPaint(stream); this.negativeBarPaint = SerialUtilities.readPaint(stream); } | /**
* Provides serialization support.
*
* @param stream the input stream.
*
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/ | Provides serialization support | readObject | {
"repo_name": "apetresc/JFreeChart",
"path": "src/main/java/org/jfree/chart/renderer/category/WaterfallBarRenderer.java",
"license": "lgpl-2.1",
"size": 19343
} | [
"java.io.IOException",
"java.io.ObjectInputStream",
"org.jfree.io.SerialUtilities"
] | import java.io.IOException; import java.io.ObjectInputStream; import org.jfree.io.SerialUtilities; | import java.io.*; import org.jfree.io.*; | [
"java.io",
"org.jfree.io"
] | java.io; org.jfree.io; | 2,046,626 |
public Set<WorkflowStatusCombination> getWorkflowStatusCombinations() {
Set<WorkflowStatusCombination> combinations = new HashSet<>();
for (WorkflowPathState state : this.trackingRecordStateToActionMap
.keySet()) {
combinations.addAll(state.getWorkflowCombinations());
}
return combinations;
} | Set<WorkflowStatusCombination> function() { Set<WorkflowStatusCombination> combinations = new HashSet<>(); for (WorkflowPathState state : this.trackingRecordStateToActionMap .keySet()) { combinations.addAll(state.getWorkflowCombinations()); } return combinations; } | /**
* Helper function to return all combinations legal for this workflow.
*
* @return the workflow status combinations
*/ | Helper function to return all combinations legal for this workflow | getWorkflowStatusCombinations | {
"repo_name": "IHTSDO/OTF-Mapping-Service",
"path": "jpa-services/src/main/java/org/ihtsdo/otf/mapping/jpa/handlers/AbstractWorkflowPathHandler.java",
"license": "apache-2.0",
"size": 20718
} | [
"java.util.HashSet",
"java.util.Set",
"org.ihtsdo.otf.mapping.helpers.WorkflowPathState",
"org.ihtsdo.otf.mapping.helpers.WorkflowStatusCombination"
] | import java.util.HashSet; import java.util.Set; import org.ihtsdo.otf.mapping.helpers.WorkflowPathState; import org.ihtsdo.otf.mapping.helpers.WorkflowStatusCombination; | import java.util.*; import org.ihtsdo.otf.mapping.helpers.*; | [
"java.util",
"org.ihtsdo.otf"
] | java.util; org.ihtsdo.otf; | 2,906,201 |
public final SimpleFeatureCollection treatStringAsGeoJson(final String geoJsonString) throws IOException {
return readFeatureCollection(geoJsonString);
} | final SimpleFeatureCollection function(final String geoJsonString) throws IOException { return readFeatureCollection(geoJsonString); } | /**
* Get the features collection from a GeoJson inline string.
*
* @param geoJsonString what to parse
* @return the feature collection
* @throws IOException
*/ | Get the features collection from a GeoJson inline string | treatStringAsGeoJson | {
"repo_name": "tsauerwein/mapfish-print",
"path": "core/src/main/java/org/mapfish/print/map/geotools/FeaturesParser.java",
"license": "mit",
"size": 11155
} | [
"java.io.IOException",
"org.geotools.data.simple.SimpleFeatureCollection"
] | import java.io.IOException; import org.geotools.data.simple.SimpleFeatureCollection; | import java.io.*; import org.geotools.data.simple.*; | [
"java.io",
"org.geotools.data"
] | java.io; org.geotools.data; | 1,961,466 |
private void connectionLost() {
setState(STATE_LISTEN);
}
private class AcceptThread extends Thread {
// The local server socket
private final BluetoothServerSocket mmServerSocket;
public AcceptThread() {
BluetoothServerSocket tmp = null;
// Create a new listening server socket
try {
tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID);
} catch (IOException e) {
Log.e(TAG, "listen() failed", e);
}
mmServerSocket = tmp;
}
| void function() { setState(STATE_LISTEN); } private class AcceptThread extends Thread { private final BluetoothServerSocket mmServerSocket; public AcceptThread() { BluetoothServerSocket tmp = null; try { tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID); } catch (IOException e) { Log.e(TAG, STR, e); } mmServerSocket = tmp; } | /**
* Indicate that the connection was lost and notify the UI Activity.
*/ | Indicate that the connection was lost and notify the UI Activity | connectionLost | {
"repo_name": "cheehieu/rc-car-collision",
"path": "sw/EE554_Controller/src/ee554/BluetoothService.java",
"license": "gpl-2.0",
"size": 19152
} | [
"android.bluetooth.BluetoothServerSocket",
"android.util.Log",
"java.io.IOException"
] | import android.bluetooth.BluetoothServerSocket; import android.util.Log; import java.io.IOException; | import android.bluetooth.*; import android.util.*; import java.io.*; | [
"android.bluetooth",
"android.util",
"java.io"
] | android.bluetooth; android.util; java.io; | 2,129,487 |
public void addResults(Map<String, Object> response) {
response.put(AnalyticsResponseHeadings.RESULTS, getResults());
} | void function(Map<String, Object> response) { response.put(AnalyticsResponseHeadings.RESULTS, getResults()); } | /**
* Calculate results for the list of {@link AnalyticsExpression}s and add them to the given
* response.
*
* <p>NOTE: This method can, and is, called multiple times to generate different responses. <br>
* The results are determined by which {@link ReductionDataCollection} is passed to the {@link
* ReductionCollectionManager#setData} method of the {@link ReductionCollectionManager} managing
* the reduction for the list of {@link AnalyticsExpression}s.
*
* @param response the response to add the results map to.
*/ | Calculate results for the list of <code>AnalyticsExpression</code>s and add them to the given response. The results are determined by which <code>ReductionDataCollection</code> is passed to the <code>ReductionCollectionManager#setData</code> method of the <code>ReductionCollectionManager</code> managing the reduction for the list of <code>AnalyticsExpression</code>s | addResults | {
"repo_name": "apache/solr",
"path": "solr/modules/analytics/src/java/org/apache/solr/analytics/function/ExpressionCalculator.java",
"license": "apache-2.0",
"size": 2947
} | [
"java.util.Map",
"org.apache.solr.analytics.util.AnalyticsResponseHeadings"
] | import java.util.Map; import org.apache.solr.analytics.util.AnalyticsResponseHeadings; | import java.util.*; import org.apache.solr.analytics.util.*; | [
"java.util",
"org.apache.solr"
] | java.util; org.apache.solr; | 2,492,970 |
public char get_char()
throws TypeMismatch, InvalidValue
{
throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE);
} | char function() throws TypeMismatch, InvalidValue { throw new MARSHAL(_DynAnyStub.NOT_APPLICABLE); } | /**
* The remote call of DynAny methods is not possible.
*
* @throws MARSHAL, always.
*/ | The remote call of DynAny methods is not possible | get_char | {
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/org/omg/DynamicAny/_DynFixedStub.java",
"license": "gpl-2.0",
"size": 15179
} | [
"org.omg.DynamicAny"
] | import org.omg.DynamicAny; | import org.omg.*; | [
"org.omg"
] | org.omg; | 30,044 |
public void flingCapturedView(int minLeft, int minTop, int maxLeft, int maxTop) {
if (!mReleaseInProgress) {
throw new IllegalStateException("Cannot flingCapturedView outside of a call to "
+ "Callback#onViewReleased");
}
mScroller.fling(mCapturedView.getLeft(), mCapturedView.getTop(),
(int) VelocityTrackerCompat.getXVelocity(mVelocityTracker, mActivePointerId),
(int) VelocityTrackerCompat.getYVelocity(mVelocityTracker, mActivePointerId),
minLeft, maxLeft, minTop, maxTop);
setDragState(STATE_SETTLING);
} | void function(int minLeft, int minTop, int maxLeft, int maxTop) { if (!mReleaseInProgress) { throw new IllegalStateException(STR + STR); } mScroller.fling(mCapturedView.getLeft(), mCapturedView.getTop(), (int) VelocityTrackerCompat.getXVelocity(mVelocityTracker, mActivePointerId), (int) VelocityTrackerCompat.getYVelocity(mVelocityTracker, mActivePointerId), minLeft, maxLeft, minTop, maxTop); setDragState(STATE_SETTLING); } | /**
* Settle the captured view based on standard free-moving fling behavior.
* The caller should invoke {@link #continueSettling(boolean)} on each
* subsequent frame to continue the motion until it returns false.
*
* @param minLeft Minimum X position for the view's left edge
* @param minTop Minimum Y position for the view's top edge
* @param maxLeft Maximum X position for the view's left edge
* @param maxTop Maximum Y position for the view's top edge
*/ | Settle the captured view based on standard free-moving fling behavior. The caller should invoke <code>#continueSettling(boolean)</code> on each subsequent frame to continue the motion until it returns false | flingCapturedView | {
"repo_name": "HarryXR/SimpleNews",
"path": "swipeback/src/main/java/me/imid/swipebacklayout/lib/ViewDragHelper.java",
"license": "apache-2.0",
"size": 62159
} | [
"android.support.v4.view.VelocityTrackerCompat"
] | import android.support.v4.view.VelocityTrackerCompat; | import android.support.v4.view.*; | [
"android.support"
] | android.support; | 2,828,351 |
@OnScheduled
public void onScheduled(final ProcessContext context) {
final String regex = context.getProperty(GROUPING_REGEX).getValue();
if (regex != null) {
groupingRegex = Pattern.compile(regex);
}
final Map<Relationship, PropertyValue> newPropertyMap = new HashMap<>();
for (final PropertyDescriptor descriptor : context.getProperties().keySet()) {
if (!descriptor.isDynamic()) {
continue;
}
getLogger().debug("Adding new dynamic property: {}", new Object[] {descriptor});
newPropertyMap.put(new Relationship.Builder().name(descriptor.getName()).build(), context.getProperty(descriptor));
}
this.propertyMap = newPropertyMap;
} | void function(final ProcessContext context) { final String regex = context.getProperty(GROUPING_REGEX).getValue(); if (regex != null) { groupingRegex = Pattern.compile(regex); } final Map<Relationship, PropertyValue> newPropertyMap = new HashMap<>(); for (final PropertyDescriptor descriptor : context.getProperties().keySet()) { if (!descriptor.isDynamic()) { continue; } getLogger().debug(STR, new Object[] {descriptor}); newPropertyMap.put(new Relationship.Builder().name(descriptor.getName()).build(), context.getProperty(descriptor)); } this.propertyMap = newPropertyMap; } | /**
* When this processor is scheduled, update the dynamic properties into the map
* for quick access during each onTrigger call
*
* @param context ProcessContext used to retrieve dynamic properties
*/ | When this processor is scheduled, update the dynamic properties into the map for quick access during each onTrigger call | onScheduled | {
"repo_name": "mcgilman/nifi",
"path": "nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteText.java",
"license": "apache-2.0",
"size": 33763
} | [
"java.util.HashMap",
"java.util.Map",
"java.util.regex.Pattern",
"org.apache.nifi.components.PropertyDescriptor",
"org.apache.nifi.components.PropertyValue",
"org.apache.nifi.processor.ProcessContext",
"org.apache.nifi.processor.Relationship"
] | import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.PropertyValue; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.Relationship; | import java.util.*; import java.util.regex.*; import org.apache.nifi.components.*; import org.apache.nifi.processor.*; | [
"java.util",
"org.apache.nifi"
] | java.util; org.apache.nifi; | 1,442,215 |
default void setIntersection(Prism3ai<?, ?, ?, ?, ?, ?> prism) {
assert prism != null : AssertMessages.notNullParameter();
final int x1 = Math.max(getMinX(), prism.getMinX());
final int y1 = Math.max(getMinY(), prism.getMinY());
final int z1 = Math.max(getMinZ(), prism.getMinZ());
final int x2 = Math.min(getMaxX(), prism.getMaxX());
final int y2 = Math.min(getMaxY(), prism.getMaxY());
final int z2 = Math.min(getMaxZ(), prism.getMaxZ());
if (x1 <= x2 && y1 <= y2 && z1 <= z2) {
setFromCorners(x1, y1, z1, x2, y2, z2);
} else {
clear();
}
}
enum Side {
TOP,
RIGHT,
BOTTOM,
LEFT,
FRONT,
BACK;
}
class RectangleSideIterator<P extends Point3D<? super P, ? super V>,
V extends Vector3D<? super V, ? super P>> implements Iterator<P> {
private final GeomFactory3ai<?, P, V, ?> factory;
private final int x0;
private final int y0;
private final int z0;
private final int x1;
private final int y1;
private final int z1;
private final Side firstSide;
private Side currentSide;
private int index;
public RectangleSideIterator(RectangularPrism3ai<?, ?, ?, P, V, ?> rectangle, Side firstSide) {
assert rectangle != null : AssertMessages.notNullParameter(0);
assert firstSide != null : AssertMessages.notNullParameter(1);
this.factory = rectangle.getGeomFactory();
this.firstSide = firstSide;
this.x0 = rectangle.getMinX();
this.y0 = rectangle.getMinY();
this.z0 = rectangle.getMinZ();
this.x1 = rectangle.getMaxX();
this.y1 = rectangle.getMaxY();
this.z1 = rectangle.getMaxZ();
this.currentSide = (this.x1 > this.x0 && this.y1 > this.y0 && this.z1 > this.z0) ? this.firstSide : null;
this.index = 0;
} | default void setIntersection(Prism3ai<?, ?, ?, ?, ?, ?> prism) { assert prism != null : AssertMessages.notNullParameter(); final int x1 = Math.max(getMinX(), prism.getMinX()); final int y1 = Math.max(getMinY(), prism.getMinY()); final int z1 = Math.max(getMinZ(), prism.getMinZ()); final int x2 = Math.min(getMaxX(), prism.getMaxX()); final int y2 = Math.min(getMaxY(), prism.getMaxY()); final int z2 = Math.min(getMaxZ(), prism.getMaxZ()); if (x1 <= x2 && y1 <= y2 && z1 <= z2) { setFromCorners(x1, y1, z1, x2, y2, z2); } else { clear(); } } enum Side { TOP, RIGHT, BOTTOM, LEFT, FRONT, BACK; } class RectangleSideIterator<P extends Point3D<? super P, ? super V>, V extends Vector3D<? super V, ? super P>> implements Iterator<P> { private final GeomFactory3ai<?, P, V, ?> factory; private final int x0; private final int y0; private final int z0; private final int x1; private final int y1; private final int z1; private final Side firstSide; private Side currentSide; private int index; public RectangleSideIterator(RectangularPrism3ai<?, ?, ?, P, V, ?> rectangle, Side firstSide) { assert rectangle != null : AssertMessages.notNullParameter(0); assert firstSide != null : AssertMessages.notNullParameter(1); this.factory = rectangle.getGeomFactory(); this.firstSide = firstSide; this.x0 = rectangle.getMinX(); this.y0 = rectangle.getMinY(); this.z0 = rectangle.getMinZ(); this.x1 = rectangle.getMaxX(); this.y1 = rectangle.getMaxY(); this.z1 = rectangle.getMaxZ(); this.currentSide = (this.x1 > this.x0 && this.y1 > this.y0 && this.z1 > this.z0) ? this.firstSide : null; this.index = 0; } | /** Compute the intersection of this rectangular prism and the given prism.
* This function changes this rectangular prism.
*
* <p>If there is no intersection, this rectangular Prism is cleared.
*
* @param prism the prism
* @see #createIntersection(Prism3ai)
* @see #clear()
*/ | Compute the intersection of this rectangular prism and the given prism. This function changes this rectangular prism. If there is no intersection, this rectangular Prism is cleared | setIntersection | {
"repo_name": "tpiotrow/afc",
"path": "core/math/src/main/java/org/arakhne/afc/math/geometry/d3/ai/RectangularPrism3ai.java",
"license": "apache-2.0",
"size": 41779
} | [
"java.util.Iterator",
"org.arakhne.afc.math.geometry.d3.Point3D",
"org.arakhne.afc.math.geometry.d3.Vector3D",
"org.arakhne.afc.vmutil.asserts.AssertMessages"
] | import java.util.Iterator; import org.arakhne.afc.math.geometry.d3.Point3D; import org.arakhne.afc.math.geometry.d3.Vector3D; import org.arakhne.afc.vmutil.asserts.AssertMessages; | import java.util.*; import org.arakhne.afc.math.geometry.d3.*; import org.arakhne.afc.vmutil.asserts.*; | [
"java.util",
"org.arakhne.afc"
] | java.util; org.arakhne.afc; | 839,653 |
public static SequenceAnnotation createSequenceAnnotation() {
return new SequenceAnnotationImpl();
} | static SequenceAnnotation function() { return new SequenceAnnotationImpl(); } | /**
* Creates a new empty {@link SequenceAnnotation} instance.
*/ | Creates a new empty <code>SequenceAnnotation</code> instance | createSequenceAnnotation | {
"repo_name": "mgaldzic/libSBOLj",
"path": "src/main/java/org/sbolstandard/core/SBOLFactory.java",
"license": "apache-2.0",
"size": 5138
} | [
"org.sbolstandard.core.impl.SequenceAnnotationImpl"
] | import org.sbolstandard.core.impl.SequenceAnnotationImpl; | import org.sbolstandard.core.impl.*; | [
"org.sbolstandard.core"
] | org.sbolstandard.core; | 936,798 |
protected void updateTask(NotificationData<TaskInfo> notification) {
// am I interested in this task?
TaskInfo taskInfoData = notification.getData();
JobId id = taskInfoData.getJobId();
TaskId tid = taskInfoData.getTaskId();
String tname = tid.getReadableName();
TaskStatus status = taskInfoData.getStatus();
AwaitedJob aj = jobTracker.getAwaitedJob(id.toString());
if (aj == null)
return;
AwaitedTask at = aj.getAwaitedTask(tname);
if (at == null)
return;
at.setTaskId(tid.toString());
jobTracker.putAwaitedJob(id.toString(), aj);
switch (status) {
case ABORTED:
case NOT_RESTARTED:
case NOT_STARTED:
case SKIPPED: {
log.debug("The task " + tname + " from job " + id + " couldn't start. No data will be transfered");
jobTracker.removeAwaitedTask(id.toString(), tname);
break;
}
case FINISHED: {
log.debug("The task " + tname + " from job " + id + " is finished.");
if (aj.isAutomaticTransfer()) {
log.debug("Transferring data for finished task " + tname + " from job " + id);
try {
downloadTaskOutputFiles(aj, id.toString(), tname, aj.getLocalOutputFolder());
} catch (Throwable t) {
log.error("Error while handling data for finished task " + tname + " for job " + id +
", task will be removed");
jobTracker.removeAwaitedTask(id.toString(), tname);
}
}
break;
}
case FAILED:
case FAULTY: {
log.debug("The task " + tname + " from job " + id + " is faulty.");
jobTracker.removeAwaitedTask(id.toString(), tname);
break;
}
}
} | void function(NotificationData<TaskInfo> notification) { TaskInfo taskInfoData = notification.getData(); JobId id = taskInfoData.getJobId(); TaskId tid = taskInfoData.getTaskId(); String tname = tid.getReadableName(); TaskStatus status = taskInfoData.getStatus(); AwaitedJob aj = jobTracker.getAwaitedJob(id.toString()); if (aj == null) return; AwaitedTask at = aj.getAwaitedTask(tname); if (at == null) return; at.setTaskId(tid.toString()); jobTracker.putAwaitedJob(id.toString(), aj); switch (status) { case ABORTED: case NOT_RESTARTED: case NOT_STARTED: case SKIPPED: { log.debug(STR + tname + STR + id + STR); jobTracker.removeAwaitedTask(id.toString(), tname); break; } case FINISHED: { log.debug(STR + tname + STR + id + STR); if (aj.isAutomaticTransfer()) { log.debug(STR + tname + STR + id); try { downloadTaskOutputFiles(aj, id.toString(), tname, aj.getLocalOutputFolder()); } catch (Throwable t) { log.error(STR + tname + STR + id + STR); jobTracker.removeAwaitedTask(id.toString(), tname); } } break; } case FAILED: case FAULTY: { log.debug(STR + tname + STR + id + STR); jobTracker.removeAwaitedTask(id.toString(), tname); break; } } } | /**
* Check if the task concerned by this notification is awaited. Retrieve
* corresponding data if needed
*
* @param notification
*/ | Check if the task concerned by this notification is awaited. Retrieve corresponding data if needed | updateTask | {
"repo_name": "marcocast/scheduling",
"path": "scheduler/scheduler-smartproxy-common/src/main/java/org/ow2/proactive/scheduler/smartproxy/common/AbstractSmartProxy.java",
"license": "agpl-3.0",
"size": 49761
} | [
"org.ow2.proactive.scheduler.common.NotificationData",
"org.ow2.proactive.scheduler.common.job.JobId",
"org.ow2.proactive.scheduler.common.task.TaskId",
"org.ow2.proactive.scheduler.common.task.TaskInfo",
"org.ow2.proactive.scheduler.common.task.TaskStatus"
] | import org.ow2.proactive.scheduler.common.NotificationData; import org.ow2.proactive.scheduler.common.job.JobId; import org.ow2.proactive.scheduler.common.task.TaskId; import org.ow2.proactive.scheduler.common.task.TaskInfo; import org.ow2.proactive.scheduler.common.task.TaskStatus; | import org.ow2.proactive.scheduler.common.*; import org.ow2.proactive.scheduler.common.job.*; import org.ow2.proactive.scheduler.common.task.*; | [
"org.ow2.proactive"
] | org.ow2.proactive; | 1,182,559 |
//-----------------------------------------------------------------------
public DbConnector getDbConnector() {
return _dbConnector;
} | DbConnector function() { return _dbConnector; } | /**
* Gets the database connector.
* @return the value of the property
*/ | Gets the database connector | getDbConnector | {
"repo_name": "McLeodMoores/starling",
"path": "projects/component/src/main/java/com/opengamma/component/factory/master/AbstractDbMasterComponentFactory.java",
"license": "apache-2.0",
"size": 26707
} | [
"com.opengamma.util.db.DbConnector"
] | import com.opengamma.util.db.DbConnector; | import com.opengamma.util.db.*; | [
"com.opengamma.util"
] | com.opengamma.util; | 2,673,499 |
public boolean isConstantMetadata() {
return false;
}
static enum SpecialArtifactType {
FILESET,
CONSTANT_METADATA,
}
@Immutable
@VisibleForTesting
public static final class SpecialArtifact extends Artifact {
private final SpecialArtifactType type;
SpecialArtifact(Path path, Root root, PathFragment execPath, ArtifactOwner owner,
SpecialArtifactType type) {
super(path, root, execPath, owner);
this.type = type;
} | boolean function() { return false; } static enum SpecialArtifactType { FILESET, CONSTANT_METADATA, } public static final class SpecialArtifact extends Artifact { private final SpecialArtifactType type; SpecialArtifact(Path path, Root root, PathFragment execPath, ArtifactOwner owner, SpecialArtifactType type) { super(path, root, execPath, owner); this.type = type; } | /**
* Returns true iff metadata cache must return constant metadata for the
* given artifact.
*/ | Returns true iff metadata cache must return constant metadata for the given artifact | isConstantMetadata | {
"repo_name": "rohitsaboo/bazel",
"path": "src/main/java/com/google/devtools/build/lib/actions/Artifact.java",
"license": "apache-2.0",
"size": 27602
} | [
"com.google.devtools.build.lib.vfs.Path",
"com.google.devtools.build.lib.vfs.PathFragment"
] | import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; | import com.google.devtools.build.lib.vfs.*; | [
"com.google.devtools"
] | com.google.devtools; | 1,661,921 |
private static ResultPoint[] findVertices(BitMatrix matrix, int startRow, int startColumn) {
int height = matrix.getHeight();
int width = matrix.getWidth();
ResultPoint[] result = new ResultPoint[8];
copyToResult(result, findRowsWithPattern(matrix, height, width, startRow, startColumn, START_PATTERN),
INDEXES_START_PATTERN);
if (result[4] != null) {
startColumn = (int) result[4].getX();
startRow = (int) result[4].getY();
}
copyToResult(result, findRowsWithPattern(matrix, height, width, startRow, startColumn, STOP_PATTERN),
INDEXES_STOP_PATTERN);
return result;
} | static ResultPoint[] function(BitMatrix matrix, int startRow, int startColumn) { int height = matrix.getHeight(); int width = matrix.getWidth(); ResultPoint[] result = new ResultPoint[8]; copyToResult(result, findRowsWithPattern(matrix, height, width, startRow, startColumn, START_PATTERN), INDEXES_START_PATTERN); if (result[4] != null) { startColumn = (int) result[4].getX(); startRow = (int) result[4].getY(); } copyToResult(result, findRowsWithPattern(matrix, height, width, startRow, startColumn, STOP_PATTERN), INDEXES_STOP_PATTERN); return result; } | /**
* Locate the vertices and the codewords area of a black blob using the Start
* and Stop patterns as locators.
*
* @param matrix the scanned barcode image.
* @return an array containing the vertices:
* vertices[0] x, y top left barcode
* vertices[1] x, y bottom left barcode
* vertices[2] x, y top right barcode
* vertices[3] x, y bottom right barcode
* vertices[4] x, y top left codeword area
* vertices[5] x, y bottom left codeword area
* vertices[6] x, y top right codeword area
* vertices[7] x, y bottom right codeword area
*/ | Locate the vertices and the codewords area of a black blob using the Start and Stop patterns as locators | findVertices | {
"repo_name": "bushidowallet/bushido-android-app",
"path": "app/src/main/java/com/google/zxing/pdf417/detector/Detector.java",
"license": "gpl-3.0",
"size": 14086
} | [
"com.google.zxing.ResultPoint",
"com.google.zxing.common.BitMatrix"
] | import com.google.zxing.ResultPoint; import com.google.zxing.common.BitMatrix; | import com.google.zxing.*; import com.google.zxing.common.*; | [
"com.google.zxing"
] | com.google.zxing; | 2,914,179 |
protected void triggerSync() {
Activity a = getActivity();
if (a != null) {
Intent i = new Intent(a, NBSyncService.class);
a.startService(i);
}
} | void function() { Activity a = getActivity(); if (a != null) { Intent i = new Intent(a, NBSyncService.class); a.startService(i); } } | /**
* Pokes the sync service to perform any pending sync actions.
*/ | Pokes the sync service to perform any pending sync actions | triggerSync | {
"repo_name": "bruceyou/NewsBlur",
"path": "clients/android/NewsBlur/src/com/newsblur/fragment/NbFragment.java",
"license": "mit",
"size": 1064
} | [
"android.app.Activity",
"android.content.Intent",
"com.newsblur.service.NBSyncService"
] | import android.app.Activity; import android.content.Intent; import com.newsblur.service.NBSyncService; | import android.app.*; import android.content.*; import com.newsblur.service.*; | [
"android.app",
"android.content",
"com.newsblur.service"
] | android.app; android.content; com.newsblur.service; | 215,101 |
protected void normalizeDocument(CoreDocumentImpl document, DOMConfigurationImpl config) {
fDocument = document;
fConfiguration = config;
// intialize and reset DOMNormalizer component
//
fSymbolTable = (SymbolTable) fConfiguration.getProperty(DOMConfigurationImpl.SYMBOL_TABLE);
// reset namespace context
fNamespaceContext.reset();
fNamespaceContext.declarePrefix(XMLSymbols.EMPTY_STRING, XMLSymbols.EMPTY_STRING);
if ((fConfiguration.features & DOMConfigurationImpl.VALIDATE) != 0) {
String schemaLang = (String)fConfiguration.getProperty(DOMConfigurationImpl.JAXP_SCHEMA_LANGUAGE);
if(schemaLang != null && schemaLang.equals(Constants.NS_XMLSCHEMA)) {
fValidationHandler =
CoreDOMImplementationImpl.singleton.getValidator(XMLGrammarDescription.XML_SCHEMA);
fConfiguration.setFeature(DOMConfigurationImpl.SCHEMA, true);
fConfiguration.setFeature(DOMConfigurationImpl.SCHEMA_FULL_CHECKING, true);
// report fatal error on DOM Level 1 nodes
fNamespaceValidation = true;
// check if we need to fill in PSVI
fPSVI = ((fConfiguration.features & DOMConfigurationImpl.PSVI) !=0)?true:false;
}
fConfiguration.setFeature(DOMConfigurationImpl.XERCES_VALIDATION, true);
// reset ID table
fDocument.clearIdentifiers();
if(fValidationHandler != null)
// reset schema validator
((XMLComponent) fValidationHandler).reset(fConfiguration);
}
fErrorHandler = (DOMErrorHandler) fConfiguration.getParameter(Constants.DOM_ERROR_HANDLER);
if (fValidationHandler != null) {
fValidationHandler.setDocumentHandler(this);
fValidationHandler.startDocument(
new SimpleLocator(fDocument.fDocumentURI, fDocument.fDocumentURI,
-1, -1 ), fDocument.encoding, fNamespaceContext, null);
}
try {
Node kid, next;
for (kid = fDocument.getFirstChild(); kid != null; kid = next) {
next = kid.getNextSibling();
kid = normalizeNode(kid);
if (kid != null) { // don't advance
next = kid;
}
}
// release resources
if (fValidationHandler != null) {
fValidationHandler.endDocument(null);
CoreDOMImplementationImpl.singleton.releaseValidator(
XMLGrammarDescription.XML_SCHEMA, fValidationHandler);
fValidationHandler = null;
}
}
catch (RuntimeException e) {
if( e==abort )
return; // processing aborted by the user
throw e; // otherwise re-throw.
}
} | void function(CoreDocumentImpl document, DOMConfigurationImpl config) { fDocument = document; fConfiguration = config; fNamespaceContext.reset(); fNamespaceContext.declarePrefix(XMLSymbols.EMPTY_STRING, XMLSymbols.EMPTY_STRING); if ((fConfiguration.features & DOMConfigurationImpl.VALIDATE) != 0) { String schemaLang = (String)fConfiguration.getProperty(DOMConfigurationImpl.JAXP_SCHEMA_LANGUAGE); if(schemaLang != null && schemaLang.equals(Constants.NS_XMLSCHEMA)) { fValidationHandler = CoreDOMImplementationImpl.singleton.getValidator(XMLGrammarDescription.XML_SCHEMA); fConfiguration.setFeature(DOMConfigurationImpl.SCHEMA, true); fConfiguration.setFeature(DOMConfigurationImpl.SCHEMA_FULL_CHECKING, true); fNamespaceValidation = true; fPSVI = ((fConfiguration.features & DOMConfigurationImpl.PSVI) !=0)?true:false; } fConfiguration.setFeature(DOMConfigurationImpl.XERCES_VALIDATION, true); fDocument.clearIdentifiers(); if(fValidationHandler != null) ((XMLComponent) fValidationHandler).reset(fConfiguration); } fErrorHandler = (DOMErrorHandler) fConfiguration.getParameter(Constants.DOM_ERROR_HANDLER); if (fValidationHandler != null) { fValidationHandler.setDocumentHandler(this); fValidationHandler.startDocument( new SimpleLocator(fDocument.fDocumentURI, fDocument.fDocumentURI, -1, -1 ), fDocument.encoding, fNamespaceContext, null); } try { Node kid, next; for (kid = fDocument.getFirstChild(); kid != null; kid = next) { next = kid.getNextSibling(); kid = normalizeNode(kid); if (kid != null) { next = kid; } } if (fValidationHandler != null) { fValidationHandler.endDocument(null); CoreDOMImplementationImpl.singleton.releaseValidator( XMLGrammarDescription.XML_SCHEMA, fValidationHandler); fValidationHandler = null; } } catch (RuntimeException e) { if( e==abort ) return; throw e; } } | /**
* Normalizes document.
* Note: reset() must be called before this method.
*/ | Normalizes document. Note: reset() must be called before this method | normalizeDocument | {
"repo_name": "haikuowuya/android_system_code",
"path": "src/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java",
"license": "apache-2.0",
"size": 92168
} | [
"com.sun.org.apache.xerces.internal.impl.Constants",
"com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator",
"com.sun.org.apache.xerces.internal.util.XMLSymbols",
"com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription",
"com.sun.org.apache.xerces.internal.xni.parser.XMLComponent",
"org.w3c.dom.DOMErrorHandler",
"org.w3c.dom.Node"
] | import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.xs.util.SimpleLocator; import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription; import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent; import org.w3c.dom.DOMErrorHandler; import org.w3c.dom.Node; | import com.sun.org.apache.xerces.internal.impl.*; import com.sun.org.apache.xerces.internal.impl.xs.util.*; import com.sun.org.apache.xerces.internal.util.*; import com.sun.org.apache.xerces.internal.xni.grammars.*; import com.sun.org.apache.xerces.internal.xni.parser.*; import org.w3c.dom.*; | [
"com.sun.org",
"org.w3c.dom"
] | com.sun.org; org.w3c.dom; | 1,837,835 |
public default GraphTraversal<S, Edge> outE(final String... edgeLabels) {
return this.toE(Direction.OUT, edgeLabels);
} | default GraphTraversal<S, Edge> function(final String... edgeLabels) { return this.toE(Direction.OUT, edgeLabels); } | /**
* Map the {@link Vertex} to its outgoing incident edges given the edge labels.
*
* @param edgeLabels the edge labels to traverse
* @return the traversal with an appended {@link VertexStep}.
*/ | Map the <code>Vertex</code> to its outgoing incident edges given the edge labels | outE | {
"repo_name": "gdelafosse/incubator-tinkerpop",
"path": "gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java",
"license": "apache-2.0",
"size": 58503
} | [
"org.apache.tinkerpop.gremlin.structure.Direction",
"org.apache.tinkerpop.gremlin.structure.Edge"
] | import org.apache.tinkerpop.gremlin.structure.Direction; import org.apache.tinkerpop.gremlin.structure.Edge; | import org.apache.tinkerpop.gremlin.structure.*; | [
"org.apache.tinkerpop"
] | org.apache.tinkerpop; | 1,909,354 |
// first get the top results ids from the internal database
Cursor songs = SongPlayCount.getInstance(context).getTopPlayedResults(NUMBER_OF_SONGS);
try {
return makeSortedCursor(context, songs,
songs.getColumnIndex(SongPlayCountColumns.ID));
} finally {
if (songs != null) {
songs.close();
songs = null;
}
}
} | Cursor songs = SongPlayCount.getInstance(context).getTopPlayedResults(NUMBER_OF_SONGS); try { return makeSortedCursor(context, songs, songs.getColumnIndex(SongPlayCountColumns.ID)); } finally { if (songs != null) { songs.close(); songs = null; } } } | /**
* This creates a sorted cursor based on the top played results
*
* @param context Android context
* @return sorted cursor
*/ | This creates a sorted cursor based on the top played results | makeTopTracksCursor | {
"repo_name": "YouKim/ExoPlayer",
"path": "twelve/src/main/java/com/dolzzo/twelve/loaders/TopTracksLoader.java",
"license": "apache-2.0",
"size": 5688
} | [
"android.database.Cursor",
"com.dolzzo.twelve.provider.SongPlayCount"
] | import android.database.Cursor; import com.dolzzo.twelve.provider.SongPlayCount; | import android.database.*; import com.dolzzo.twelve.provider.*; | [
"android.database",
"com.dolzzo.twelve"
] | android.database; com.dolzzo.twelve; | 2,815,965 |
public TriggerWrapper addNowTrigger(String scheduleId, NowTrigger nowTrigger,
SimpleRESTContext securityContext) {
if (scheduleId == null) {
throw new IllegalArgumentException("Argument scheduleId can't be null.");
}
if (nowTrigger == null) {
throw new IllegalArgumentException("Argument nowTrigger can't be null.");
}
TriggerWrapper retVal;
MultivaluedMap<String, String> queryParams = null;
MultivaluedMap<String, String> formParams = new MultivaluedMapImpl();
this.setFilterFromContext(securityContext);
this.addNonNull(formParams, FORM_PARAMETER_NAME, nowTrigger.getName());
this.addNonNull(formParams, FORM_PARAMETER_GROUP, nowTrigger.getTriggerGroup());
if (nowTrigger.getPriority() != null) {
this.addNonNull(formParams, FORM_PARAMETER_PRIORITY, nowTrigger.getPriority().toString());
}
this.addNonNull(formParams, FORM_PARAMETER_DESCRIPTION, nowTrigger.getDescription());
retVal = this.performTriggerPost(RestClientUtils.encodeUrl(NOW_TRIGGERS_BY_SCHEDULER_ID, scheduleId), queryParams, formParams);
return retVal;
} | TriggerWrapper function(String scheduleId, NowTrigger nowTrigger, SimpleRESTContext securityContext) { if (scheduleId == null) { throw new IllegalArgumentException(STR); } if (nowTrigger == null) { throw new IllegalArgumentException(STR); } TriggerWrapper retVal; MultivaluedMap<String, String> queryParams = null; MultivaluedMap<String, String> formParams = new MultivaluedMapImpl(); this.setFilterFromContext(securityContext); this.addNonNull(formParams, FORM_PARAMETER_NAME, nowTrigger.getName()); this.addNonNull(formParams, FORM_PARAMETER_GROUP, nowTrigger.getTriggerGroup()); if (nowTrigger.getPriority() != null) { this.addNonNull(formParams, FORM_PARAMETER_PRIORITY, nowTrigger.getPriority().toString()); } this.addNonNull(formParams, FORM_PARAMETER_DESCRIPTION, nowTrigger.getDescription()); retVal = this.performTriggerPost(RestClientUtils.encodeUrl(NOW_TRIGGERS_BY_SCHEDULER_ID, scheduleId), queryParams, formParams); return retVal; } | /**
* Add now-trigger.
*
* @param scheduleId the id of the schedule.
* @param nowTrigger new now-trigger instance to add.
* @param securityContext security context.
*
* @return StudyWrapper
*/ | Add now-trigger | addNowTrigger | {
"repo_name": "kit-data-manager/base",
"path": "RestInterfaces/SchedulerRestInterface/src/main/java/edu/kit/dama/rest/scheduler/service/client/impl/SchedulerRestClient.java",
"license": "apache-2.0",
"size": 25096
} | [
"com.sun.jersey.core.util.MultivaluedMapImpl",
"edu.kit.dama.rest.SimpleRESTContext",
"edu.kit.dama.rest.scheduler.types.TriggerWrapper",
"edu.kit.dama.rest.util.RestClientUtils",
"edu.kit.dama.scheduler.api.trigger.NowTrigger",
"javax.ws.rs.core.MultivaluedMap"
] | import com.sun.jersey.core.util.MultivaluedMapImpl; import edu.kit.dama.rest.SimpleRESTContext; import edu.kit.dama.rest.scheduler.types.TriggerWrapper; import edu.kit.dama.rest.util.RestClientUtils; import edu.kit.dama.scheduler.api.trigger.NowTrigger; import javax.ws.rs.core.MultivaluedMap; | import com.sun.jersey.core.util.*; import edu.kit.dama.rest.*; import edu.kit.dama.rest.scheduler.types.*; import edu.kit.dama.rest.util.*; import edu.kit.dama.scheduler.api.trigger.*; import javax.ws.rs.core.*; | [
"com.sun.jersey",
"edu.kit.dama",
"javax.ws"
] | com.sun.jersey; edu.kit.dama; javax.ws; | 692,220 |
public static double TDistStopCriterion(List<ClusterAndGMM> GMMList, GMM ubm, AudioFeatureSet featureSet, boolean useTop, boolean usedSpeech, int delay) throws DiarizationException, IOException {
DiagGaussian accScoreInner = new DiagGaussian(1);
DiagGaussian accScoreOuter = new DiagGaussian(1);
accScoreInner.statistic_initialize();
accScoreOuter.statistic_initialize();
for (ClusterAndGMM clusterAndGMM : GMMList) {
GMM gmm = clusterAndGMM.getGmm();
for (ClusterAndGMM clusterAndGMM2 : GMMList) {
Cluster cluster = clusterAndGMM2.getCluster();
if (clusterAndGMM2 == clusterAndGMM) {
getAccumulatorOfLogLikelihoodRatio(accScoreInner, gmm, ubm, cluster.iterator(), featureSet, useTop, usedSpeech, delay);
} else {
getAccumulatorOfLogLikelihoodRatio(accScoreOuter, gmm, ubm, cluster.iterator(), featureSet, useTop, usedSpeech, delay);
}
}
}
accScoreInner.setModel();
accScoreOuter.setModel();
return (-1.0 * (Math.abs(accScoreInner.getMean(0) - accScoreOuter.getMean(0))))
/ (Math.sqrt((accScoreInner.getCovariance(0, 0) / accScoreInner.getCount())
+ (accScoreOuter.getCovariance(0, 0) / accScoreOuter.getCount())));
} | static double function(List<ClusterAndGMM> GMMList, GMM ubm, AudioFeatureSet featureSet, boolean useTop, boolean usedSpeech, int delay) throws DiarizationException, IOException { DiagGaussian accScoreInner = new DiagGaussian(1); DiagGaussian accScoreOuter = new DiagGaussian(1); accScoreInner.statistic_initialize(); accScoreOuter.statistic_initialize(); for (ClusterAndGMM clusterAndGMM : GMMList) { GMM gmm = clusterAndGMM.getGmm(); for (ClusterAndGMM clusterAndGMM2 : GMMList) { Cluster cluster = clusterAndGMM2.getCluster(); if (clusterAndGMM2 == clusterAndGMM) { getAccumulatorOfLogLikelihoodRatio(accScoreInner, gmm, ubm, cluster.iterator(), featureSet, useTop, usedSpeech, delay); } else { getAccumulatorOfLogLikelihoodRatio(accScoreOuter, gmm, ubm, cluster.iterator(), featureSet, useTop, usedSpeech, delay); } } } accScoreInner.setModel(); accScoreOuter.setModel(); return (-1.0 * (Math.abs(accScoreInner.getMean(0) - accScoreOuter.getMean(0)))) / (Math.sqrt((accScoreInner.getCovariance(0, 0) / accScoreInner.getCount()) + (accScoreOuter.getCovariance(0, 0) / accScoreOuter.getCount()))); } | /**
* T dist stop criterion.
*
* @param GMMList the GMM list
* @param ubm the ubm model
* @param featureSet the feature set
* @param useTop the use top
* @param usedSpeech the used speech
* @param delay the delay
* @return the double
* @throws DiarizationException the diarization exception
* @throws IOException Signals that an I/O exception has occurred.
*/ | T dist stop criterion | TDistStopCriterion | {
"repo_name": "Adirockzz95/GenderDetect",
"path": "src/src/fr/lium/spkDiarization/libModel/Distance.java",
"license": "gpl-3.0",
"size": 39968
} | [
"fr.lium.spkDiarization.lib.DiarizationException",
"fr.lium.spkDiarization.libClusteringData.Cluster",
"fr.lium.spkDiarization.libClusteringMethod.ClusterAndGMM",
"fr.lium.spkDiarization.libFeature.AudioFeatureSet",
"fr.lium.spkDiarization.libModel.gaussian.DiagGaussian",
"java.io.IOException",
"java.util.List"
] | import fr.lium.spkDiarization.lib.DiarizationException; import fr.lium.spkDiarization.libClusteringData.Cluster; import fr.lium.spkDiarization.libClusteringMethod.ClusterAndGMM; import fr.lium.spkDiarization.libFeature.AudioFeatureSet; import fr.lium.spkDiarization.libModel.gaussian.DiagGaussian; import java.io.IOException; import java.util.List; | import fr.lium.*; import java.io.*; import java.util.*; | [
"fr.lium",
"java.io",
"java.util"
] | fr.lium; java.io; java.util; | 1,374,510 |
@Override
public int read() throws IOException {
if (closed) {
throw new FormItem.ItemSkippedException();
}
if (available() == 0 && makeAvailable() == 0) {
return -1;
}
++total;
int b = buffer[head++];
if (b >= 0) {
return b;
}
return b + BYTE_POSITIVE_OFFSET;
} | int function() throws IOException { if (closed) { throw new FormItem.ItemSkippedException(); } if (available() == 0 && makeAvailable() == 0) { return -1; } ++total; int b = buffer[head++]; if (b >= 0) { return b; } return b + BYTE_POSITIVE_OFFSET; } | /**
* Returns the next byte in the stream.
*
* @return The next byte in the stream, as a non-negative
* integer, or -1 for EOF.
* @throws IOException An I/O error occurred.
*/ | Returns the next byte in the stream | read | {
"repo_name": "chrishantha/msf4j",
"path": "core/src/main/java/org/wso2/msf4j/formparam/MultipartStream.java",
"license": "apache-2.0",
"size": 27444
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 462,806 |
public static AnnotationsList getParameterAnnotations(Method method) {
AttributeList attribs = method.getAttributes();
AttRuntimeVisibleParameterAnnotations visible =
(AttRuntimeVisibleParameterAnnotations)
attribs.findFirst(
AttRuntimeVisibleParameterAnnotations.ATTRIBUTE_NAME);
AttRuntimeInvisibleParameterAnnotations invisible =
(AttRuntimeInvisibleParameterAnnotations)
attribs.findFirst(
AttRuntimeInvisibleParameterAnnotations.ATTRIBUTE_NAME);
if (visible == null) {
if (invisible == null) {
return AnnotationsList.EMPTY;
}
return invisible.getParameterAnnotations();
}
if (invisible == null) {
return visible.getParameterAnnotations();
}
// Both are non-null, so combine them.
return AnnotationsList.combine(visible.getParameterAnnotations(),
invisible.getParameterAnnotations());
} | static AnnotationsList function(Method method) { AttributeList attribs = method.getAttributes(); AttRuntimeVisibleParameterAnnotations visible = (AttRuntimeVisibleParameterAnnotations) attribs.findFirst( AttRuntimeVisibleParameterAnnotations.ATTRIBUTE_NAME); AttRuntimeInvisibleParameterAnnotations invisible = (AttRuntimeInvisibleParameterAnnotations) attribs.findFirst( AttRuntimeInvisibleParameterAnnotations.ATTRIBUTE_NAME); if (visible == null) { if (invisible == null) { return AnnotationsList.EMPTY; } return invisible.getParameterAnnotations(); } if (invisible == null) { return visible.getParameterAnnotations(); } return AnnotationsList.combine(visible.getParameterAnnotations(), invisible.getParameterAnnotations()); } | /**
* Gets the parameter annotations out of a given method. This
* combines both visible and invisible annotations into a single
* result set.
*
* @param method {@code non-null;} the method in question
* @return {@code non-null;} the list of annotation sets, which may be
* empty
*/ | Gets the parameter annotations out of a given method. This combines both visible and invisible annotations into a single result set | getParameterAnnotations | {
"repo_name": "nikita36078/J2ME-Loader",
"path": "dexlib/src/main/java/com/android/dx/dex/cf/AttributeTranslator.java",
"license": "apache-2.0",
"size": 17010
} | [
"com.android.dx.cf.attrib.AttRuntimeInvisibleParameterAnnotations",
"com.android.dx.cf.attrib.AttRuntimeVisibleParameterAnnotations",
"com.android.dx.cf.iface.AttributeList",
"com.android.dx.cf.iface.Method",
"com.android.dx.rop.annotation.AnnotationsList"
] | import com.android.dx.cf.attrib.AttRuntimeInvisibleParameterAnnotations; import com.android.dx.cf.attrib.AttRuntimeVisibleParameterAnnotations; import com.android.dx.cf.iface.AttributeList; import com.android.dx.cf.iface.Method; import com.android.dx.rop.annotation.AnnotationsList; | import com.android.dx.cf.attrib.*; import com.android.dx.cf.iface.*; import com.android.dx.rop.annotation.*; | [
"com.android.dx"
] | com.android.dx; | 2,246,251 |
public File convertFromFile(String serviceTargetURL, File f, OutputFormat outputFormat, String outputSize, String crop)throws IOException, URISyntaxException {
File cFile = File.createTempFile("mediaConverter_", "." + outputFormat);
serviceTargetURL = getServiceTargetURL(serviceTargetURL) + addParameterstoURL(null, outputFormat.toString(), outputSize, crop);
Part[] parts = { new FilePart(f.getName(), f) };
doPost(serviceTargetURL, parts, cFile);
return cFile;
} | File function(String serviceTargetURL, File f, OutputFormat outputFormat, String outputSize, String crop)throws IOException, URISyntaxException { File cFile = File.createTempFile(STR, "." + outputFormat); serviceTargetURL = getServiceTargetURL(serviceTargetURL) + addParameterstoURL(null, outputFormat.toString(), outputSize, crop); Part[] parts = { new FilePart(f.getName(), f) }; doPost(serviceTargetURL, parts, cFile); return cFile; } | /**
* Converts media.
*
* @param serviceTargetURL URL of your Service. "" for using MPDL media conversion service.
* @param mediaFile media(png/tiff/jpqg...) file.
* @param outputFormat eg. png/jpeg..., "" for default format png.
* @param outputSize "" for original size.
* @param crop eg. "40x30-10-10"
* @return screenshot file
* @throws IOException
* @throws URISyntaxException
*/ | Converts media | convertFromFile | {
"repo_name": "MPDL/java-connector",
"path": "src/main/java/de/mpg/mpdl/service/connector/MediaConverterService.java",
"license": "mit",
"size": 2499
} | [
"de.mpg.mpdl.service.connector.util.OutputFormat",
"java.io.File",
"java.io.IOException",
"java.net.URISyntaxException",
"org.apache.commons.httpclient.methods.multipart.FilePart",
"org.apache.commons.httpclient.methods.multipart.Part"
] | import de.mpg.mpdl.service.connector.util.OutputFormat; import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import org.apache.commons.httpclient.methods.multipart.FilePart; import org.apache.commons.httpclient.methods.multipart.Part; | import de.mpg.mpdl.service.connector.util.*; import java.io.*; import java.net.*; import org.apache.commons.httpclient.methods.multipart.*; | [
"de.mpg.mpdl",
"java.io",
"java.net",
"org.apache.commons"
] | de.mpg.mpdl; java.io; java.net; org.apache.commons; | 1,385,628 |
public void onPullEvent(final PullToRefreshBase<V> refreshView, State state, Mode direction);
}
public static interface OnRefreshListener<V extends View> { | void function(final PullToRefreshBase<V> refreshView, State state, Mode direction); } public static interface OnRefreshListener<V extends View> { | /**
* Called when the internal state has been changed, usually by the user
* pulling.
*
* @param refreshView - View which has had it's state change.
* @param state - The new state of View.
* @param direction - One of {@link Mode#PULL_FROM_START} or
* {@link Mode#PULL_FROM_END} depending on which direction
* the user is pulling. Only useful when <var>state</var> is
* {@link State#PULL_TO_REFRESH} or
* {@link State#RELEASE_TO_REFRESH}.
*/ | Called when the internal state has been changed, usually by the user pulling | onPullEvent | {
"repo_name": "chandantiatros/RefreshLibrary",
"path": "src/com/handmark/pulltorefresh/library/PullToRefreshBase.java",
"license": "apache-2.0",
"size": 46442
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 1,876,331 |
TestRunner.run(suite());
} | TestRunner.run(suite()); } | /**
* Command-line interface.
*/ | Command-line interface | main | {
"repo_name": "SpoonLabs/astor",
"path": "examples/lang_55/src/test/org/apache/commons/lang/LangTestSuite.java",
"license": "gpl-2.0",
"size": 3344
} | [
"junit.textui.TestRunner"
] | import junit.textui.TestRunner; | import junit.textui.*; | [
"junit.textui"
] | junit.textui; | 823,318 |
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} | void function(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { super.looseMarshal(wireFormat, o, dataOut); } | /**
* Write the booleans that this object uses to a BooleanStream
*/ | Write the booleans that this object uses to a BooleanStream | looseMarshal | {
"repo_name": "Mark-Booth/daq-eclipse",
"path": "uk.ac.diamond.org.apache.activemq/org/apache/activemq/openwire/v3/ActiveMQTempQueueMarshaller.java",
"license": "epl-1.0",
"size": 3686
} | [
"java.io.DataOutput",
"java.io.IOException",
"org.apache.activemq.openwire.OpenWireFormat"
] | import java.io.DataOutput; import java.io.IOException; import org.apache.activemq.openwire.OpenWireFormat; | import java.io.*; import org.apache.activemq.openwire.*; | [
"java.io",
"org.apache.activemq"
] | java.io; org.apache.activemq; | 1,911,590 |
public XMLString xstr()
{
int node = item(0);
return (node != DTM.NULL) ? getStringFromNode(node) : XString.EMPTYSTRING;
}
| XMLString function() { int node = item(0); return (node != DTM.NULL) ? getStringFromNode(node) : XString.EMPTYSTRING; } | /**
* Cast result object to an XMLString.
*
* @return The document fragment node data or the empty string.
*/ | Cast result object to an XMLString | xstr | {
"repo_name": "dmgerman/joa",
"path": "test-pairs/XNodeSet.java",
"license": "gpl-2.0",
"size": 24170
} | [
"org.apache.xml.utils.XMLString"
] | import org.apache.xml.utils.XMLString; | import org.apache.xml.utils.*; | [
"org.apache.xml"
] | org.apache.xml; | 65,738 |
private VisitScheduleItem loadVisitScheduleItemFromVisitScheduleItemInVO(VisitScheduleItemInVO visitScheduleItemInVO) {
VisitScheduleItem visitScheduleItem = null;
Long id = visitScheduleItemInVO.getId();
if (id != null) {
visitScheduleItem = this.load(id);
}
if (visitScheduleItem == null) {
visitScheduleItem = VisitScheduleItem.Factory.newInstance();
}
return visitScheduleItem;
} | VisitScheduleItem function(VisitScheduleItemInVO visitScheduleItemInVO) { VisitScheduleItem visitScheduleItem = null; Long id = visitScheduleItemInVO.getId(); if (id != null) { visitScheduleItem = this.load(id); } if (visitScheduleItem == null) { visitScheduleItem = VisitScheduleItem.Factory.newInstance(); } return visitScheduleItem; } | /**
* Retrieves the entity object that is associated with the specified value object
* from the object store. If no such entity object exists in the object store,
* a new, blank entity is created
*/ | Retrieves the entity object that is associated with the specified value object from the object store. If no such entity object exists in the object store, a new, blank entity is created | loadVisitScheduleItemFromVisitScheduleItemInVO | {
"repo_name": "phoenixctms/ctsms",
"path": "core/src/main/java/org/phoenixctms/ctsms/domain/VisitScheduleItemDaoImpl.java",
"license": "lgpl-2.1",
"size": 51461
} | [
"org.phoenixctms.ctsms.vo.VisitScheduleItemInVO"
] | import org.phoenixctms.ctsms.vo.VisitScheduleItemInVO; | import org.phoenixctms.ctsms.vo.*; | [
"org.phoenixctms.ctsms"
] | org.phoenixctms.ctsms; | 1,574,040 |
public void setAccumulators(Map<String, Accumulator<?, ?>> userAccumulators) {
synchronized (accumulatorLock) {
if (!state.isTerminal()) {
this.userAccumulators = userAccumulators;
}
}
}
| void function(Map<String, Accumulator<?, ?>> userAccumulators) { synchronized (accumulatorLock) { if (!state.isTerminal()) { this.userAccumulators = userAccumulators; } } } | /**
* Update accumulators (discarded when the Execution has already been terminated).
* @param userAccumulators the user accumulators
*/ | Update accumulators (discarded when the Execution has already been terminated) | setAccumulators | {
"repo_name": "zhangminglei/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java",
"license": "apache-2.0",
"size": 51713
} | [
"java.util.Map",
"org.apache.flink.api.common.accumulators.Accumulator"
] | import java.util.Map; import org.apache.flink.api.common.accumulators.Accumulator; | import java.util.*; import org.apache.flink.api.common.accumulators.*; | [
"java.util",
"org.apache.flink"
] | java.util; org.apache.flink; | 566,968 |
public void setTarget(Object target) {
setTargetSource(new SingletonTargetSource(target));
} | void function(Object target) { setTargetSource(new SingletonTargetSource(target)); } | /**
* Set the given object as target.
* Will create a SingletonTargetSource for the object.
* @see #setTargetSource
* @see org.springframework.aop.target.SingletonTargetSource
*/ | Set the given object as target. Will create a SingletonTargetSource for the object | setTarget | {
"repo_name": "kingtang/spring-learn",
"path": "spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java",
"license": "gpl-3.0",
"size": 18270
} | [
"org.springframework.aop.target.SingletonTargetSource"
] | import org.springframework.aop.target.SingletonTargetSource; | import org.springframework.aop.target.*; | [
"org.springframework.aop"
] | org.springframework.aop; | 2,043,180 |
public List<List<T>> findSubSets(List<T> items) {
criteria.reset();
matches.clear();
Combinations.visitCombinations(items, accumulator);
return matches;
} | List<List<T>> function(List<T> items) { criteria.reset(); matches.clear(); Combinations.visitCombinations(items, accumulator); return matches; } | /**
* Perform the search for subsets matching the criteria.
* @return the matching subsets
*/ | Perform the search for subsets matching the criteria | findSubSets | {
"repo_name": "jonestimd/subsets",
"path": "src/main/java/io/github/jonestimd/subset/SubsetSearch.java",
"license": "unlicense",
"size": 4137
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,290,709 |
public ContextTypeRegistry getCodeTemplateContextRegistry() {
if (fCodeTemplateContextTypeRegistry == null) {
fCodeTemplateContextTypeRegistry = new ContributionContextTypeRegistry();
CodeTemplateContextType.registerContextTypes(fCodeTemplateContextTypeRegistry);
}
return fCodeTemplateContextTypeRegistry;
} | ContextTypeRegistry function() { if (fCodeTemplateContextTypeRegistry == null) { fCodeTemplateContextTypeRegistry = new ContributionContextTypeRegistry(); CodeTemplateContextType.registerContextTypes(fCodeTemplateContextTypeRegistry); } return fCodeTemplateContextTypeRegistry; } | /**
* Returns the template context type registry for the code generation templates.
*
* @return the template context type registry for the code generation templates
* @since 3.0
*/ | Returns the template context type registry for the code generation templates | getCodeTemplateContextRegistry | {
"repo_name": "TypeFox/che",
"path": "plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-jdt-ui/src/main/java/org/eclipse/jdt/internal/ui/JavaPlugin.java",
"license": "epl-1.0",
"size": 16817
} | [
"org.eclipse.che.jface.text.templates.ContextTypeRegistry",
"org.eclipse.jdt.internal.corext.template.java.CodeTemplateContextType",
"org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry"
] | import org.eclipse.che.jface.text.templates.ContextTypeRegistry; import org.eclipse.jdt.internal.corext.template.java.CodeTemplateContextType; import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; | import org.eclipse.che.jface.text.templates.*; import org.eclipse.jdt.internal.corext.template.java.*; import org.eclipse.ui.editors.text.templates.*; | [
"org.eclipse.che",
"org.eclipse.jdt",
"org.eclipse.ui"
] | org.eclipse.che; org.eclipse.jdt; org.eclipse.ui; | 1,371,122 |
public String getCodeName()
{
String codeName = I18NUtil.getMessage("webscript.code." + code + ".name");
return codeName == null ? "" : codeName;
} | String function() { String codeName = I18NUtil.getMessage(STR + code + ".name"); return codeName == null ? "" : codeName; } | /**
* Gets the short name of the status code
*
* @return status code name
*/ | Gets the short name of the status code | getCodeName | {
"repo_name": "daniel-he/community-edition",
"path": "projects/solr-client/source/java/org/alfresco/solr/client/Status.java",
"license": "lgpl-3.0",
"size": 7478
} | [
"org.springframework.extensions.surf.util.I18NUtil"
] | import org.springframework.extensions.surf.util.I18NUtil; | import org.springframework.extensions.surf.util.*; | [
"org.springframework.extensions"
] | org.springframework.extensions; | 497,230 |
Expression generateComparator(
RelCollation collation); | Expression generateComparator( RelCollation collation); | /** Returns a comparator. Unlike the comparator returned by
* {@link #generateCollationKey(java.util.List)}, this comparator acts on the
* whole element. */ | Returns a comparator. Unlike the comparator returned by <code>#generateCollationKey(java.util.List)</code>, this comparator acts on the | generateComparator | {
"repo_name": "minji-kim/calcite",
"path": "core/src/main/java/org/apache/calcite/adapter/enumerable/PhysType.java",
"license": "apache-2.0",
"size": 7448
} | [
"org.apache.calcite.linq4j.tree.Expression",
"org.apache.calcite.rel.RelCollation"
] | import org.apache.calcite.linq4j.tree.Expression; import org.apache.calcite.rel.RelCollation; | import org.apache.calcite.linq4j.tree.*; import org.apache.calcite.rel.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 2,105,238 |
protected void computeRect(Raster[] sources,
WritableRaster dest,
Rectangle destRect) {
// Retrieve format tags.
RasterFormatTag[] formatTags = getFormatTags();
Raster source = sources[0];
Rectangle srcRect = mapDestRect(destRect, 0);
RasterAccessor srcAccessor =
new RasterAccessor(source, srcRect, formatTags[0],
getSource(0).getColorModel());
RasterAccessor dstAccessor =
new RasterAccessor(dest, destRect, formatTags[1],
this.getColorModel());
switch (dstAccessor.getDataType()) {
case DataBuffer.TYPE_BYTE:
byteLoop(srcAccessor, dstAccessor);
break;
case DataBuffer.TYPE_INT:
intLoop(srcAccessor, dstAccessor);
break;
case DataBuffer.TYPE_SHORT:
shortLoop(srcAccessor, dstAccessor);
break;
case DataBuffer.TYPE_USHORT:
ushortLoop(srcAccessor, dstAccessor);
break;
case DataBuffer.TYPE_FLOAT:
floatLoop(srcAccessor, dstAccessor);
break;
case DataBuffer.TYPE_DOUBLE:
doubleLoop(srcAccessor, dstAccessor);
break;
default:
}
// If the RasterAccessor object set up a temporary buffer for the
// op to write to, tell the RasterAccessor to write that data
// to the raster no that we're done with it.
if (dstAccessor.isDataCopy()) {
dstAccessor.clampDataArrays();
dstAccessor.copyDataToRaster();
}
}
| void function(Raster[] sources, WritableRaster dest, Rectangle destRect) { RasterFormatTag[] formatTags = getFormatTags(); Raster source = sources[0]; Rectangle srcRect = mapDestRect(destRect, 0); RasterAccessor srcAccessor = new RasterAccessor(source, srcRect, formatTags[0], getSource(0).getColorModel()); RasterAccessor dstAccessor = new RasterAccessor(dest, destRect, formatTags[1], this.getColorModel()); switch (dstAccessor.getDataType()) { case DataBuffer.TYPE_BYTE: byteLoop(srcAccessor, dstAccessor); break; case DataBuffer.TYPE_INT: intLoop(srcAccessor, dstAccessor); break; case DataBuffer.TYPE_SHORT: shortLoop(srcAccessor, dstAccessor); break; case DataBuffer.TYPE_USHORT: ushortLoop(srcAccessor, dstAccessor); break; case DataBuffer.TYPE_FLOAT: floatLoop(srcAccessor, dstAccessor); break; case DataBuffer.TYPE_DOUBLE: doubleLoop(srcAccessor, dstAccessor); break; default: } if (dstAccessor.isDataCopy()) { dstAccessor.clampDataArrays(); dstAccessor.copyDataToRaster(); } } | /**
* Performs convolution on a specified rectangle. The sources are
* cobbled.
*
* @param sources an array of source Rasters, guaranteed to provide all
* necessary source data for computing the output.
* @param dest a WritableRaster tile containing the area to be computed.
* @param destRect the rectangle within dest to be processed.
*/ | Performs convolution on a specified rectangle. The sources are cobbled | computeRect | {
"repo_name": "RoProducts/rastertheque",
"path": "JAILibrary/src/com/sun/media/jai/opimage/SeparableConvolveOpImage.java",
"license": "gpl-2.0",
"size": 27150
} | [
"java.awt.Rectangle",
"java.awt.image.DataBuffer",
"java.awt.image.Raster",
"java.awt.image.WritableRaster",
"javax.media.jai.RasterAccessor",
"javax.media.jai.RasterFormatTag"
] | import java.awt.Rectangle; import java.awt.image.DataBuffer; import java.awt.image.Raster; import java.awt.image.WritableRaster; import javax.media.jai.RasterAccessor; import javax.media.jai.RasterFormatTag; | import java.awt.*; import java.awt.image.*; import javax.media.jai.*; | [
"java.awt",
"javax.media"
] | java.awt; javax.media; | 731,093 |
public boolean match(double[] exp, double[] measured) {
return Arrays.equals(exp, measured);
} | boolean function(double[] exp, double[] measured) { return Arrays.equals(exp, measured); } | /**
* Match sensor reading with actual robot reading.
*
* @param exp
* Expected measurements
* @param measured
* Measurement at particular cell
* @return True if reading exacly matched
*/ | Match sensor reading with actual robot reading | match | {
"repo_name": "habsoft/robosim",
"path": "src/main/java/pk/com/habsoft/robosim/filters/sensors/SonarRangeModule.java",
"license": "apache-2.0",
"size": 6277
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 439,931 |
EReference getSteamTurbine_SteamSupplys(); | EReference getSteamTurbine_SteamSupplys(); | /**
* Returns the meta object for the reference list '{@link CIM.IEC61970.Generation.GenerationDynamics.SteamTurbine#getSteamSupplys <em>Steam Supplys</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Steam Supplys</em>'.
* @see CIM.IEC61970.Generation.GenerationDynamics.SteamTurbine#getSteamSupplys()
* @see #getSteamTurbine()
* @generated
*/ | Returns the meta object for the reference list '<code>CIM.IEC61970.Generation.GenerationDynamics.SteamTurbine#getSteamSupplys Steam Supplys</code>'. | getSteamTurbine_SteamSupplys | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/ModelJoin/src/main/java/CIM/IEC61970/Generation/GenerationDynamics/GenerationDynamicsPackage.java",
"license": "mit",
"size": 239957
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,752,025 |
private static String[] getFieldNames() {
CanonicalDataModel dataModel = new CanonicalDataModel();
Collection<com.jctal.buzzard.cerif.datamodel.schema.Field> fields = dataModel.getFields();
String[] fieldNames = new String[fields.size()];
int i = 0;
for (Iterator<com.jctal.buzzard.cerif.datamodel.schema.Field> it = fields.iterator(); it.hasNext();) {
com.jctal.buzzard.cerif.datamodel.schema.Field field = it.next();
fieldNames[i++] = field.getName();
}
return fieldNames;
} | static String[] function() { CanonicalDataModel dataModel = new CanonicalDataModel(); Collection<com.jctal.buzzard.cerif.datamodel.schema.Field> fields = dataModel.getFields(); String[] fieldNames = new String[fields.size()]; int i = 0; for (Iterator<com.jctal.buzzard.cerif.datamodel.schema.Field> it = fields.iterator(); it.hasNext();) { com.jctal.buzzard.cerif.datamodel.schema.Field field = it.next(); fieldNames[i++] = field.getName(); } return fieldNames; } | /**
* Get the CDM field names from the common data model.
*
* @return Array of field names.
*/ | Get the CDM field names from the common data model | getFieldNames | {
"repo_name": "certus-tech/crosswalk-connector-src",
"path": "code/CDMSelectValues/src/com/jctal/buzzard/cerif/kettle/steps/selectvalues/CDMSelectValuesDialog.java",
"license": "gpl-3.0",
"size": 7233
} | [
"com.jctal.buzzard.cerif.datamodel.CanonicalDataModel",
"java.lang.reflect.Field",
"java.util.Collection",
"java.util.Iterator"
] | import com.jctal.buzzard.cerif.datamodel.CanonicalDataModel; import java.lang.reflect.Field; import java.util.Collection; import java.util.Iterator; | import com.jctal.buzzard.cerif.datamodel.*; import java.lang.reflect.*; import java.util.*; | [
"com.jctal.buzzard",
"java.lang",
"java.util"
] | com.jctal.buzzard; java.lang; java.util; | 2,844,896 |
public ModifierKeyword getVisibilityThreshold(final IJavaElement referencing, final IMember referenced, final IProgressMonitor monitor) throws JavaModelException {
Assert.isTrue(!(referencing instanceof IInitializer));
Assert.isTrue(!(referenced instanceof IInitializer));
ModifierKeyword keyword= ModifierKeyword.PUBLIC_KEYWORD;
try {
monitor.beginTask("", 1); //$NON-NLS-1$
monitor.setTaskName(RefactoringCoreMessages.MemberVisibilityAdjustor_checking);
final int referencingType= referencing.getElementType();
final int referencedType= referenced.getElementType();
switch (referencedType) {
case IJavaElement.TYPE: {
final IType typeReferenced= (IType) referenced;
final ICompilationUnit referencedUnit= typeReferenced.getCompilationUnit();
switch (referencingType) {
case IJavaElement.TYPE: {
keyword= thresholdTypeToType((IType) referencing, typeReferenced, monitor);
break;
}
case IJavaElement.FIELD:
case IJavaElement.METHOD: {
final IMember member= (IMember) referencing;
if (typeReferenced.equals(member.getDeclaringType()))
keyword= ModifierKeyword.PRIVATE_KEYWORD;
else if (referencedUnit != null && referencedUnit.equals(member.getCompilationUnit()))
keyword= ModifierKeyword.PRIVATE_KEYWORD;
else if (typeReferenced.getPackageFragment().equals(member.getDeclaringType().getPackageFragment()))
keyword= null;
break;
}
case IJavaElement.PACKAGE_FRAGMENT: {
final IPackageFragment fragment= (IPackageFragment) referencing;
if (typeReferenced.getPackageFragment().equals(fragment))
keyword= null;
break;
}
default:
Assert.isTrue(false);
}
break;
}
case IJavaElement.FIELD: {
final IField fieldReferenced= (IField) referenced;
final ICompilationUnit referencedUnit= fieldReferenced.getCompilationUnit();
switch (referencingType) {
case IJavaElement.TYPE: {
keyword= thresholdTypeToField((IType) referencing, fieldReferenced, monitor);
break;
}
case IJavaElement.FIELD:
case IJavaElement.METHOD: {
final IMember member= (IMember) referencing;
if (fieldReferenced.getDeclaringType().equals(member.getDeclaringType()))
keyword= ModifierKeyword.PRIVATE_KEYWORD;
else if (referencedUnit != null && referencedUnit.equals(member.getCompilationUnit()))
keyword= ModifierKeyword.PRIVATE_KEYWORD;
else if (fieldReferenced.getDeclaringType().getPackageFragment().equals(member.getDeclaringType().getPackageFragment()))
keyword= null;
break;
}
case IJavaElement.PACKAGE_FRAGMENT: {
final IPackageFragment fragment= (IPackageFragment) referencing;
if (fieldReferenced.getDeclaringType().getPackageFragment().equals(fragment))
keyword= null;
break;
}
default:
Assert.isTrue(false);
}
break;
}
case IJavaElement.METHOD: {
final IMethod methodReferenced= (IMethod) referenced;
final ICompilationUnit referencedUnit= methodReferenced.getCompilationUnit();
switch (referencingType) {
case IJavaElement.TYPE: {
keyword= thresholdTypeToMethod((IType) referencing, methodReferenced, monitor);
break;
}
case IJavaElement.FIELD:
case IJavaElement.METHOD: {
final IMember member= (IMember) referencing;
if (methodReferenced.getDeclaringType().equals(member.getDeclaringType()))
keyword= ModifierKeyword.PRIVATE_KEYWORD;
else if (referencedUnit != null && referencedUnit.equals(member.getCompilationUnit()))
keyword= ModifierKeyword.PRIVATE_KEYWORD;
else if (methodReferenced.getDeclaringType().getPackageFragment().equals(member.getDeclaringType().getPackageFragment()))
keyword= null;
break;
}
case IJavaElement.PACKAGE_FRAGMENT: {
final IPackageFragment fragment= (IPackageFragment) referencing;
if (methodReferenced.getDeclaringType().getPackageFragment().equals(fragment))
keyword= null;
break;
}
default:
Assert.isTrue(false);
}
break;
}
default:
Assert.isTrue(false);
}
} finally {
monitor.done();
}
return keyword;
} | ModifierKeyword function(final IJavaElement referencing, final IMember referenced, final IProgressMonitor monitor) throws JavaModelException { Assert.isTrue(!(referencing instanceof IInitializer)); Assert.isTrue(!(referenced instanceof IInitializer)); ModifierKeyword keyword= ModifierKeyword.PUBLIC_KEYWORD; try { monitor.beginTask("", 1); monitor.setTaskName(RefactoringCoreMessages.MemberVisibilityAdjustor_checking); final int referencingType= referencing.getElementType(); final int referencedType= referenced.getElementType(); switch (referencedType) { case IJavaElement.TYPE: { final IType typeReferenced= (IType) referenced; final ICompilationUnit referencedUnit= typeReferenced.getCompilationUnit(); switch (referencingType) { case IJavaElement.TYPE: { keyword= thresholdTypeToType((IType) referencing, typeReferenced, monitor); break; } case IJavaElement.FIELD: case IJavaElement.METHOD: { final IMember member= (IMember) referencing; if (typeReferenced.equals(member.getDeclaringType())) keyword= ModifierKeyword.PRIVATE_KEYWORD; else if (referencedUnit != null && referencedUnit.equals(member.getCompilationUnit())) keyword= ModifierKeyword.PRIVATE_KEYWORD; else if (typeReferenced.getPackageFragment().equals(member.getDeclaringType().getPackageFragment())) keyword= null; break; } case IJavaElement.PACKAGE_FRAGMENT: { final IPackageFragment fragment= (IPackageFragment) referencing; if (typeReferenced.getPackageFragment().equals(fragment)) keyword= null; break; } default: Assert.isTrue(false); } break; } case IJavaElement.FIELD: { final IField fieldReferenced= (IField) referenced; final ICompilationUnit referencedUnit= fieldReferenced.getCompilationUnit(); switch (referencingType) { case IJavaElement.TYPE: { keyword= thresholdTypeToField((IType) referencing, fieldReferenced, monitor); break; } case IJavaElement.FIELD: case IJavaElement.METHOD: { final IMember member= (IMember) referencing; if (fieldReferenced.getDeclaringType().equals(member.getDeclaringType())) keyword= ModifierKeyword.PRIVATE_KEYWORD; else if (referencedUnit != null && referencedUnit.equals(member.getCompilationUnit())) keyword= ModifierKeyword.PRIVATE_KEYWORD; else if (fieldReferenced.getDeclaringType().getPackageFragment().equals(member.getDeclaringType().getPackageFragment())) keyword= null; break; } case IJavaElement.PACKAGE_FRAGMENT: { final IPackageFragment fragment= (IPackageFragment) referencing; if (fieldReferenced.getDeclaringType().getPackageFragment().equals(fragment)) keyword= null; break; } default: Assert.isTrue(false); } break; } case IJavaElement.METHOD: { final IMethod methodReferenced= (IMethod) referenced; final ICompilationUnit referencedUnit= methodReferenced.getCompilationUnit(); switch (referencingType) { case IJavaElement.TYPE: { keyword= thresholdTypeToMethod((IType) referencing, methodReferenced, monitor); break; } case IJavaElement.FIELD: case IJavaElement.METHOD: { final IMember member= (IMember) referencing; if (methodReferenced.getDeclaringType().equals(member.getDeclaringType())) keyword= ModifierKeyword.PRIVATE_KEYWORD; else if (referencedUnit != null && referencedUnit.equals(member.getCompilationUnit())) keyword= ModifierKeyword.PRIVATE_KEYWORD; else if (methodReferenced.getDeclaringType().getPackageFragment().equals(member.getDeclaringType().getPackageFragment())) keyword= null; break; } case IJavaElement.PACKAGE_FRAGMENT: { final IPackageFragment fragment= (IPackageFragment) referencing; if (methodReferenced.getDeclaringType().getPackageFragment().equals(fragment)) keyword= null; break; } default: Assert.isTrue(false); } break; } default: Assert.isTrue(false); } } finally { monitor.done(); } return keyword; } | /**
* Computes the visibility threshold for the referenced element.
*
* @param referencing the referencing element
* @param referenced the referenced element
* @param monitor the progress monitor to use
* @return the visibility keyword corresponding to the threshold, or <code>null</code> for default visibility
* @throws JavaModelException if the java elements could not be accessed
*/ | Computes the visibility threshold for the referenced element | getVisibilityThreshold | {
"repo_name": "elucash/eclipse-oxygen",
"path": "org.eclipse.jdt.ui/src/org/eclipse/jdt/internal/corext/refactoring/structure/MemberVisibilityAdjustor.java",
"license": "epl-1.0",
"size": 56703
} | [
"org.eclipse.core.runtime.Assert",
"org.eclipse.core.runtime.IProgressMonitor",
"org.eclipse.jdt.core.ICompilationUnit",
"org.eclipse.jdt.core.IField",
"org.eclipse.jdt.core.IInitializer",
"org.eclipse.jdt.core.IJavaElement",
"org.eclipse.jdt.core.IMember",
"org.eclipse.jdt.core.IMethod",
"org.eclipse.jdt.core.IPackageFragment",
"org.eclipse.jdt.core.IType",
"org.eclipse.jdt.core.JavaModelException",
"org.eclipse.jdt.core.dom.Modifier",
"org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages"
] | import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IField; import org.eclipse.jdt.core.IInitializer; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMember; import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.Modifier; import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; | import org.eclipse.core.runtime.*; import org.eclipse.jdt.core.*; import org.eclipse.jdt.core.dom.*; import org.eclipse.jdt.internal.corext.refactoring.*; | [
"org.eclipse.core",
"org.eclipse.jdt"
] | org.eclipse.core; org.eclipse.jdt; | 1,683,918 |
@DoesServiceRequest
public final void renewLease(final AccessCondition accessCondition, BlobRequestOptions options,
OperationContext opContext) throws StorageException {
Utility.assertNotNull("accessCondition", accessCondition);
Utility.assertNotNullOrEmpty("leaseID", accessCondition.getLeaseID());
if (opContext == null) {
opContext = new OperationContext();
}
opContext.initialize();
options = BlobRequestOptions.populateAndApplyDefaults(options, BlobType.UNSPECIFIED, this.blobServiceClient);
ExecutionEngine.executeWithRetry(this.blobServiceClient, this, this.renewLeaseImpl(accessCondition, options),
options.getRetryPolicyFactory(), opContext);
} | final void function(final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException { Utility.assertNotNull(STR, accessCondition); Utility.assertNotNullOrEmpty(STR, accessCondition.getLeaseID()); if (opContext == null) { opContext = new OperationContext(); } opContext.initialize(); options = BlobRequestOptions.populateAndApplyDefaults(options, BlobType.UNSPECIFIED, this.blobServiceClient); ExecutionEngine.executeWithRetry(this.blobServiceClient, this, this.renewLeaseImpl(accessCondition, options), options.getRetryPolicyFactory(), opContext); } | /**
* Renews an existing lease with the specified access conditions, request options, and operation context.
*
* @param accessCondition
* An {@link AccessCondition} object that represents the access conditions for the blob. The lease ID is
* required to be set with an access condition.
*
* @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. The context
* 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.
*/ | Renews an existing lease with the specified access conditions, request options, and operation context | renewLease | {
"repo_name": "risezhang/azure-storage-cli",
"path": "src/main/java/com/microsoft/azure/storage/blob/CloudBlobContainer.java",
"license": "mit",
"size": 103627
} | [
"com.microsoft.azure.storage.AccessCondition",
"com.microsoft.azure.storage.OperationContext",
"com.microsoft.azure.storage.StorageException",
"com.microsoft.azure.storage.core.ExecutionEngine",
"com.microsoft.azure.storage.core.Utility"
] | import com.microsoft.azure.storage.AccessCondition; import com.microsoft.azure.storage.OperationContext; import com.microsoft.azure.storage.StorageException; import com.microsoft.azure.storage.core.ExecutionEngine; import com.microsoft.azure.storage.core.Utility; | import com.microsoft.azure.storage.*; import com.microsoft.azure.storage.core.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,870,339 |
@Override
@SuppressWarnings("unchecked") // Actually not 100% safe, but we have done our best.
public Collection<V> getValues() {
final Object values = feature.getPropertyValue(name);
if (values instanceof Collection<?>) {
if (values instanceof CheckedContainer<?>) {
final Class<?> expected = getValueClass();
final Class<?> actual = ((CheckedContainer<?>) values).getElementType();
if (expected != actual) { // Really exact match, not Class.isAssignableFrom(Class).
throw new ClassCastException(Errors.format(Errors.Keys.UnexpectedTypeForReference_3, name, expected, actual));
}
}
return (Collection<V>) values;
} else {
return singletonOrEmpty(getValueClass().cast(values));
}
} | @SuppressWarnings(STR) Collection<V> function() { final Object values = feature.getPropertyValue(name); if (values instanceof Collection<?>) { if (values instanceof CheckedContainer<?>) { final Class<?> expected = getValueClass(); final Class<?> actual = ((CheckedContainer<?>) values).getElementType(); if (expected != actual) { throw new ClassCastException(Errors.format(Errors.Keys.UnexpectedTypeForReference_3, name, expected, actual)); } } return (Collection<V>) values; } else { return singletonOrEmpty(getValueClass().cast(values)); } } | /**
* Returns the values as a collection. This method tries to verify that the collection
* contains elements of the expected type, but this verification is not always possible.
* Consequently this method may, sometime, be actually unsafe.
*/ | Returns the values as a collection. This method tries to verify that the collection contains elements of the expected type, but this verification is not always possible. Consequently this method may, sometime, be actually unsafe | getValues | {
"repo_name": "desruisseaux/sis",
"path": "core/sis-feature/src/main/java/org/apache/sis/feature/PropertyView.java",
"license": "apache-2.0",
"size": 8628
} | [
"java.util.Collection",
"org.apache.sis.util.collection.CheckedContainer",
"org.apache.sis.util.resources.Errors"
] | import java.util.Collection; import org.apache.sis.util.collection.CheckedContainer; import org.apache.sis.util.resources.Errors; | import java.util.*; import org.apache.sis.util.collection.*; import org.apache.sis.util.resources.*; | [
"java.util",
"org.apache.sis"
] | java.util; org.apache.sis; | 2,268,690 |
public ConditionHLAPI getContainerConditionHLAPI(); | ConditionHLAPI function(); | /**
* This accessor automaticaly encapsulate an element of the current object.
* WARNING : this creates a new object in memory.
*/ | This accessor automaticaly encapsulate an element of the current object. WARNING : this creates a new object in memory | getContainerConditionHLAPI | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-PT-HLPNG/src/fr/lip6/move/pnml/pthlpng/terms/hlapi/TermHLAPI.java",
"license": "epl-1.0",
"size": 4764
} | [
"fr.lip6.move.pnml.pthlpng.hlcorestructure.hlapi.ConditionHLAPI"
] | import fr.lip6.move.pnml.pthlpng.hlcorestructure.hlapi.ConditionHLAPI; | import fr.lip6.move.pnml.pthlpng.hlcorestructure.hlapi.*; | [
"fr.lip6.move"
] | fr.lip6.move; | 2,817,639 |
private void checkConstructorDeprecation(NodeTraversal t, Node n,
Node parent) {
JSType type = n.getJSType();
if (type != null) {
String deprecationInfo = getTypeDeprecationInfo(type);
if (deprecationInfo != null &&
shouldEmitDeprecationWarning(t, n, parent)) {
if (!deprecationInfo.isEmpty()) {
compiler.report(
t.makeError(n, DEPRECATED_CLASS_REASON,
type.toString(), deprecationInfo));
} else {
compiler.report(
t.makeError(n, DEPRECATED_CLASS, type.toString()));
}
}
}
} | void function(NodeTraversal t, Node n, Node parent) { JSType type = n.getJSType(); if (type != null) { String deprecationInfo = getTypeDeprecationInfo(type); if (deprecationInfo != null && shouldEmitDeprecationWarning(t, n, parent)) { if (!deprecationInfo.isEmpty()) { compiler.report( t.makeError(n, DEPRECATED_CLASS_REASON, type.toString(), deprecationInfo)); } else { compiler.report( t.makeError(n, DEPRECATED_CLASS, type.toString())); } } } } | /**
* Checks the given NEW node to ensure that access restrictions are obeyed.
*/ | Checks the given NEW node to ensure that access restrictions are obeyed | checkConstructorDeprecation | {
"repo_name": "nicks/closure-compiler-old",
"path": "src/com/google/javascript/jscomp/CheckAccessControls.java",
"license": "apache-2.0",
"size": 25022
} | [
"com.google.javascript.rhino.Node",
"com.google.javascript.rhino.jstype.JSType"
] | import com.google.javascript.rhino.Node; import com.google.javascript.rhino.jstype.JSType; | import com.google.javascript.rhino.*; import com.google.javascript.rhino.jstype.*; | [
"com.google.javascript"
] | com.google.javascript; | 1,619,431 |
public void remake(){
//clears out the list and the model, and then repopulates them both.
dailyList.removeAll();
dailyModel.clear();
for(Event ev: manager.getCurrentDayEvents()){
dailyModel.addElement(ev);
}
weeklyList.removeAll();
weeklyModel.clear();
for(Event ev: manager.getCurrentWeekEvents()){
weeklyModel.addElement(ev);
}
monthlyList.removeAll();
monthlyModel.clear();
for(Event ev: manager.getCurrentMonthEvents()){
monthlyModel.addElement(ev);
}
yearlyList.removeAll();
yearlyModel.clear();
for(Event ev: manager.getCurrentYearEvents()){
yearlyModel.addElement(ev);
}
}
| void function(){ dailyList.removeAll(); dailyModel.clear(); for(Event ev: manager.getCurrentDayEvents()){ dailyModel.addElement(ev); } weeklyList.removeAll(); weeklyModel.clear(); for(Event ev: manager.getCurrentWeekEvents()){ weeklyModel.addElement(ev); } monthlyList.removeAll(); monthlyModel.clear(); for(Event ev: manager.getCurrentMonthEvents()){ monthlyModel.addElement(ev); } yearlyList.removeAll(); yearlyModel.clear(); for(Event ev: manager.getCurrentYearEvents()){ yearlyModel.addElement(ev); } } | /**
* remakes the calendars
*/ | remakes the calendars | remake | {
"repo_name": "btaidm/CS3141-Calender",
"path": "src/com/cs3141/gui/CalenderGui.java",
"license": "mit",
"size": 6538
} | [
"com.cs3141.calender.Event"
] | import com.cs3141.calender.Event; | import com.cs3141.calender.*; | [
"com.cs3141.calender"
] | com.cs3141.calender; | 2,536,016 |
public InterfaceSet getInterfaceSet() {
return interfaceSet;
} | InterfaceSet function() { return interfaceSet; } | /**
* Gets this player's interface set.
*
* @return The interface set for this player.
*/ | Gets this player's interface set | getInterfaceSet | {
"repo_name": "DealerNextDoor/ApolloDev",
"path": "src/org/apollo/game/model/Player.java",
"license": "isc",
"size": 18236
} | [
"org.apollo.game.model.inter.InterfaceSet"
] | import org.apollo.game.model.inter.InterfaceSet; | import org.apollo.game.model.inter.*; | [
"org.apollo.game"
] | org.apollo.game; | 863,580 |
default AdvancedTwitterDirectMessageEndpointConsumerBuilder exchangePattern(
ExchangePattern exchangePattern) {
doSetProperty("exchangePattern", exchangePattern);
return this;
} | default AdvancedTwitterDirectMessageEndpointConsumerBuilder exchangePattern( ExchangePattern exchangePattern) { doSetProperty(STR, exchangePattern); return this; } | /**
* Sets the exchange pattern when the consumer creates an exchange.
*
* The option is a: <code>org.apache.camel.ExchangePattern</code> type.
*
* Group: consumer (advanced)
*/ | Sets the exchange pattern when the consumer creates an exchange. The option is a: <code>org.apache.camel.ExchangePattern</code> type. Group: consumer (advanced) | exchangePattern | {
"repo_name": "DariusX/camel",
"path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/TwitterDirectMessageEndpointBuilderFactory.java",
"license": "apache-2.0",
"size": 60609
} | [
"org.apache.camel.ExchangePattern"
] | import org.apache.camel.ExchangePattern; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 380,382 |
public boolean isUsingSlaveServer( SlaveServer slaveServer ) throws KettleException {
// Loop over all steps and see if the slave server is used.
for ( int i = 0; i < nrSteps(); i++ ) {
ClusterSchema clusterSchema = getStep( i ).getClusterSchema();
if ( clusterSchema != null ) {
for ( SlaveServer check : clusterSchema.getSlaveServers() ) {
if ( check.equals( slaveServer ) ) {
return true;
}
}
return true;
}
}
return false;
} | boolean function( SlaveServer slaveServer ) throws KettleException { for ( int i = 0; i < nrSteps(); i++ ) { ClusterSchema clusterSchema = getStep( i ).getClusterSchema(); if ( clusterSchema != null ) { for ( SlaveServer check : clusterSchema.getSlaveServers() ) { if ( check.equals( slaveServer ) ) { return true; } } return true; } } return false; } | /**
* Checks if the transformation is using the specified slave server.
*
* @param slaveServer
* the slave server
* @return true if the transformation is using the slave server, false otherwise
* @throws KettleException
* if any errors occur while checking for the slave server
*/ | Checks if the transformation is using the specified slave server | isUsingSlaveServer | {
"repo_name": "airy-ict/pentaho-kettle",
"path": "engine/src/org/pentaho/di/trans/TransMeta.java",
"license": "apache-2.0",
"size": 219546
} | [
"org.pentaho.di.cluster.ClusterSchema",
"org.pentaho.di.cluster.SlaveServer",
"org.pentaho.di.core.exception.KettleException"
] | import org.pentaho.di.cluster.ClusterSchema; import org.pentaho.di.cluster.SlaveServer; import org.pentaho.di.core.exception.KettleException; | import org.pentaho.di.cluster.*; import org.pentaho.di.core.exception.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 457,660 |
public Map<URI, Resource> getURIResourceMap()
{
return uriResourceMap;
} | Map<URI, Resource> function() { return uriResourceMap; } | /**
* Returns the map used to cache the resource {@link #getResource(URI, boolean) associated} with a specific URI.
* @return the map used to cache the resource associated with a specific URI.
* @see #setURIResourceMap
*/ | Returns the map used to cache the resource <code>#getResource(URI, boolean) associated</code> with a specific URI | getURIResourceMap | {
"repo_name": "LangleyStudios/eclipse-avro",
"path": "test/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/resource/impl/ResourceSetImpl.java",
"license": "epl-1.0",
"size": 32810
} | [
"java.util.Map",
"org.eclipse.emf.ecore.resource.Resource"
] | import java.util.Map; import org.eclipse.emf.ecore.resource.Resource; | import java.util.*; import org.eclipse.emf.ecore.resource.*; | [
"java.util",
"org.eclipse.emf"
] | java.util; org.eclipse.emf; | 456,249 |
public void setMsuTxValue(long msuTxValue) throws JNCException {
setMsuTxValue(new YangUInt32(msuTxValue));
} | void function(long msuTxValue) throws JNCException { setMsuTxValue(new YangUInt32(msuTxValue)); } | /**
* Sets the value for child leaf "msu-tx",
* using Java primitive values.
* @param msuTxValue used during instantiation.
*/ | Sets the value for child leaf "msu-tx", using Java primitive values | setMsuTxValue | {
"repo_name": "jnpr-shinma/yangfile",
"path": "hitel/src/hctaEpc/mmeSgsn/interface_/ss7/RemoteDest.java",
"license": "apache-2.0",
"size": 57002
} | [
"com.tailf.jnc.YangUInt32"
] | import com.tailf.jnc.YangUInt32; | import com.tailf.jnc.*; | [
"com.tailf.jnc"
] | com.tailf.jnc; | 2,492,242 |
public static DataResult<PackageListItem> listExtraPackages(Long serverId) {
SelectMode m = ModeFactory.getMode("Package_queries",
"extra_packages_for_system");
Map<String, Object> params = new HashMap<String, Object>();
params.put("serverid", serverId);
Map<String, Object> elabParams = new HashMap<String, Object>();
return makeDataResult(params, elabParams, null, m, PackageListItem.class);
} | static DataResult<PackageListItem> function(Long serverId) { SelectMode m = ModeFactory.getMode(STR, STR); Map<String, Object> params = new HashMap<String, Object>(); params.put(STR, serverId); Map<String, Object> elabParams = new HashMap<String, Object>(); return makeDataResult(params, elabParams, null, m, PackageListItem.class); } | /**
* Returns the list of extra packages for a system.
* @param serverId Server ID in question
* @return List of extra packages
*/ | Returns the list of extra packages for a system | listExtraPackages | {
"repo_name": "mcalmer/spacewalk",
"path": "java/code/src/com/redhat/rhn/manager/system/SystemManager.java",
"license": "gpl-2.0",
"size": 134651
} | [
"com.redhat.rhn.common.db.datasource.DataResult",
"com.redhat.rhn.common.db.datasource.ModeFactory",
"com.redhat.rhn.common.db.datasource.SelectMode",
"com.redhat.rhn.frontend.dto.PackageListItem",
"java.util.HashMap",
"java.util.Map"
] | import com.redhat.rhn.common.db.datasource.DataResult; import com.redhat.rhn.common.db.datasource.ModeFactory; import com.redhat.rhn.common.db.datasource.SelectMode; import com.redhat.rhn.frontend.dto.PackageListItem; import java.util.HashMap; import java.util.Map; | import com.redhat.rhn.common.db.datasource.*; import com.redhat.rhn.frontend.dto.*; import java.util.*; | [
"com.redhat.rhn",
"java.util"
] | com.redhat.rhn; java.util; | 1,043,573 |
@Override public MeasureRawColumnChunk[] readRawMeasureChunks(FileHolder fileReader,
int[][] blockIndexes) throws IOException {
MeasureRawColumnChunk[] datChunk = new MeasureRawColumnChunk[measureColumnChunks.size()];
for (int i = 0; i < blockIndexes.length; i++) {
for (int j = blockIndexes[i][0]; j <= blockIndexes[i][1]; j++) {
datChunk[j] = readRawMeasureChunk(fileReader, j);
}
}
return datChunk;
} | @Override MeasureRawColumnChunk[] function(FileHolder fileReader, int[][] blockIndexes) throws IOException { MeasureRawColumnChunk[] datChunk = new MeasureRawColumnChunk[measureColumnChunks.size()]; for (int i = 0; i < blockIndexes.length; i++) { for (int j = blockIndexes[i][0]; j <= blockIndexes[i][1]; j++) { datChunk[j] = readRawMeasureChunk(fileReader, j); } } return datChunk; } | /**
* Method to read the blocks data based on block indexes
*
* @param fileReader file reader to read the blocks
* @param blockIndexes blocks to be read
* @return measure data chunks
*/ | Method to read the blocks data based on block indexes | readRawMeasureChunks | {
"repo_name": "ksimar/incubator-carbondata",
"path": "core/src/main/java/org/apache/carbondata/core/datastore/chunk/reader/measure/v1/CompressedMeasureChunkFileBasedReaderV1.java",
"license": "apache-2.0",
"size": 5172
} | [
"java.io.IOException",
"org.apache.carbondata.core.datastore.FileHolder",
"org.apache.carbondata.core.datastore.chunk.impl.MeasureRawColumnChunk"
] | import java.io.IOException; import org.apache.carbondata.core.datastore.FileHolder; import org.apache.carbondata.core.datastore.chunk.impl.MeasureRawColumnChunk; | import java.io.*; import org.apache.carbondata.core.datastore.*; import org.apache.carbondata.core.datastore.chunk.impl.*; | [
"java.io",
"org.apache.carbondata"
] | java.io; org.apache.carbondata; | 2,621,410 |
private static byte[] appendByteArrays(byte[] arrayOne, byte[] arrayTwo, int length)
{
byte[] newArray;
if(arrayOne == null && arrayTwo == null)
{
// no data, just return
return null;
} else if(arrayOne == null)
{
// create the new array, same length as arrayTwo:
newArray = new byte[length];
// fill the new array with the contents of arrayTwo:
System.arraycopy(arrayTwo, 0, newArray, 0, length);
arrayTwo = null;
} else if(arrayTwo == null)
{
// create the new array, same length as arrayOne:
newArray = new byte[arrayOne.length];
// fill the new array with the contents of arrayOne:
System.arraycopy(arrayOne, 0, newArray, 0, arrayOne.length);
arrayOne = null;
} else
{
// create the new array large enough to hold both arrays:
newArray = new byte[arrayOne.length + length];
System.arraycopy(arrayOne, 0, newArray, 0, arrayOne.length);
// fill the new array with the contents of both arrays:
System.arraycopy(arrayTwo, 0, newArray, arrayOne.length, length);
arrayOne = null;
arrayTwo = null;
}
return newArray;
}
private static class DMAISObuffer extends Obuffer
{
private int m_nChannels;
private byte[] m_abBuffer;
private int[] m_anBufferPointers;
private boolean m_bIsBigEndian;
public DMAISObuffer(int nChannels)
{
m_nChannels = nChannels;
m_abBuffer = new byte[OBUFFERSIZE * nChannels];
m_anBufferPointers = new int[nChannels];
reset();
} | static byte[] function(byte[] arrayOne, byte[] arrayTwo, int length) { byte[] newArray; if(arrayOne == null && arrayTwo == null) { return null; } else if(arrayOne == null) { newArray = new byte[length]; System.arraycopy(arrayTwo, 0, newArray, 0, length); arrayTwo = null; } else if(arrayTwo == null) { newArray = new byte[arrayOne.length]; System.arraycopy(arrayOne, 0, newArray, 0, arrayOne.length); arrayOne = null; } else { newArray = new byte[arrayOne.length + length]; System.arraycopy(arrayOne, 0, newArray, 0, arrayOne.length); System.arraycopy(arrayTwo, 0, newArray, arrayOne.length, length); arrayOne = null; arrayTwo = null; } return newArray; } private static class DMAISObuffer extends Obuffer { private int m_nChannels; private byte[] m_abBuffer; private int[] m_anBufferPointers; private boolean m_bIsBigEndian; public DMAISObuffer(int nChannels) { m_nChannels = nChannels; m_abBuffer = new byte[OBUFFERSIZE * nChannels]; m_anBufferPointers = new int[nChannels]; reset(); } | /**
* Creates a new array with the second array appended to the end of the
* first array.
*
* @param arrayOne
* The first array.
* @param arrayTwo
* The second array.
* @param length
* How many bytes to append from the second array.
* @return Byte array containing information from both arrays.
*/ | Creates a new array with the second array appended to the end of the first array | appendByteArrays | {
"repo_name": "fireandfuel/CodecJLayerMP3",
"path": "src/de/cuina/fireandfuel/CodecJLayerMP3.java",
"license": "lgpl-3.0",
"size": 14432
} | [
"javazoom.jl.decoder.Obuffer"
] | import javazoom.jl.decoder.Obuffer; | import javazoom.jl.decoder.*; | [
"javazoom.jl.decoder"
] | javazoom.jl.decoder; | 250,363 |
public BcPBESecretKeyEncryptorBuilder setSecureRandom(SecureRandom random)
{
this.random = random;
return this;
} | BcPBESecretKeyEncryptorBuilder function(SecureRandom random) { this.random = random; return this; } | /**
* Provide a user defined source of randomness.
*
* @param random the secure random to be used.
* @return the current builder.
*/ | Provide a user defined source of randomness | setSecureRandom | {
"repo_name": "sake/bouncycastle-java",
"path": "src/org/bouncycastle/openpgp/operator/bc/BcPBESecretKeyEncryptorBuilder.java",
"license": "mit",
"size": 4719
} | [
"java.security.SecureRandom"
] | import java.security.SecureRandom; | import java.security.*; | [
"java.security"
] | java.security; | 2,611,896 |
public ApiResponse<V1RoleList> listNamespacedRoleWithHttpInfo(
String namespace,
String pretty,
Boolean allowWatchBookmarks,
String _continue,
String fieldSelector,
String labelSelector,
Integer limit,
String resourceVersion,
String resourceVersionMatch,
Integer timeoutSeconds,
Boolean watch)
throws ApiException {
okhttp3.Call localVarCall =
listNamespacedRoleValidateBeforeCall(
namespace,
pretty,
allowWatchBookmarks,
_continue,
fieldSelector,
labelSelector,
limit,
resourceVersion,
resourceVersionMatch,
timeoutSeconds,
watch,
null);
Type localVarReturnType = new TypeToken<V1RoleList>() {}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
} | ApiResponse<V1RoleList> function( String namespace, String pretty, Boolean allowWatchBookmarks, String _continue, String fieldSelector, String labelSelector, Integer limit, String resourceVersion, String resourceVersionMatch, Integer timeoutSeconds, Boolean watch) throws ApiException { okhttp3.Call localVarCall = listNamespacedRoleValidateBeforeCall( namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, null); Type localVarReturnType = new TypeToken<V1RoleList>() {}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } | /**
* list or watch objects of kind Role
*
* @param namespace object name and auth scope, such as for teams and projects (required)
* @param pretty If 'true', then the output is pretty printed. (optional)
* @param allowWatchBookmarks allowWatchBookmarks requests watch events with type
* \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and
* bookmarks are sent at the server's discretion. Clients should not assume bookmarks are
* returned at any specific interval, nor may they assume the server will send any BOOKMARK
* event during a session. If this is not a watch, this field is ignored. (optional)
* @param _continue The continue option should be set when retrieving more results from the
* server. Since this value is server defined, clients may only use the continue value from a
* previous query result with identical query parameters (except for the value of continue)
* and the server may reject a continue value it does not recognize. If the specified continue
* value is no longer valid whether due to expiration (generally five to fifteen minutes) or a
* configuration change on the server, the server will respond with a 410 ResourceExpired
* error together with a continue token. If the client needs a consistent list, it must
* restart their list without the continue field. Otherwise, the client may send another list
* request with the token received with the 410 error, the server will respond with a list
* starting from the next key, but from the latest snapshot, which is inconsistent from the
* previous list results - objects that are created, modified, or deleted after the first list
* request will be included in the response, as long as their keys are after the \"next
* key\". This field is not supported when watch is true. Clients may start a watch from
* the last resourceVersion value returned by the server and not miss any modifications.
* (optional)
* @param fieldSelector A selector to restrict the list of returned objects by their fields.
* Defaults to everything. (optional)
* @param labelSelector A selector to restrict the list of returned objects by their labels.
* Defaults to everything. (optional)
* @param limit limit is a maximum number of responses to return for a list call. If more items
* exist, the server will set the `continue` field on the list metadata to a value
* that can be used with the same initial query to retrieve the next set of results. Setting a
* limit may return fewer than the requested amount of items (up to zero items) in the event
* all requested objects are filtered out and clients should only use the presence of the
* continue field to determine whether more results are available. Servers may choose not to
* support the limit argument and will return all of the available results. If limit is
* specified and the continue field is empty, clients may assume that no more results are
* available. This field is not supported if watch is true. The server guarantees that the
* objects returned when using continue will be identical to issuing a single list call
* without a limit - that is, no objects created, modified, or deleted after the first request
* is issued will be included in any subsequent continued requests. This is sometimes referred
* to as a consistent snapshot, and ensures that a client that is using limit to receive
* smaller chunks of a very large result can ensure they see all possible objects. If objects
* are updated during a chunked list the version of the object that was present at the time
* the first list result was calculated is returned. (optional)
* @param resourceVersion resourceVersion sets a constraint on what resource versions a request
* may be served from. See
* https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.
* Defaults to unset (optional)
* @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to
* list calls. It is highly recommended that resourceVersionMatch be set for list calls where
* resourceVersion is set See
* https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.
* Defaults to unset (optional)
* @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call,
* regardless of any activity or inactivity. (optional)
* @param watch Watch for changes to the described resources and return them as a stream of add,
* update, and remove notifications. Specify resourceVersion. (optional)
* @return ApiResponse<V1RoleList>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
* @http.response.details
* <table summary="Response Details" border="1">
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
* </table>
*/ | list or watch objects of kind Role | listNamespacedRoleWithHttpInfo | {
"repo_name": "kubernetes-client/java",
"path": "kubernetes/src/main/java/io/kubernetes/client/openapi/apis/RbacAuthorizationV1Api.java",
"license": "apache-2.0",
"size": 563123
} | [
"com.google.gson.reflect.TypeToken",
"io.kubernetes.client.openapi.ApiException",
"io.kubernetes.client.openapi.ApiResponse",
"io.kubernetes.client.openapi.models.V1RoleList",
"java.lang.reflect.Type"
] | import com.google.gson.reflect.TypeToken; import io.kubernetes.client.openapi.ApiException; import io.kubernetes.client.openapi.ApiResponse; import io.kubernetes.client.openapi.models.V1RoleList; import java.lang.reflect.Type; | import com.google.gson.reflect.*; import io.kubernetes.client.openapi.*; import io.kubernetes.client.openapi.models.*; import java.lang.reflect.*; | [
"com.google.gson",
"io.kubernetes.client",
"java.lang"
] | com.google.gson; io.kubernetes.client; java.lang; | 2,509,478 |
private static XContentBuilder buildBucketResource(final String name) throws IOException {
return jsonBuilder().startObject()
.field("kind", "storage#bucket")
.field("name", name)
.field("id", name)
.endObject();
} | static XContentBuilder function(final String name) throws IOException { return jsonBuilder().startObject() .field("kind", STR) .field("name", name) .field("id", name) .endObject(); } | /**
* Storage Bucket JSON representation as defined in
* https://cloud.google.com/storage/docs/json_api/v1/bucket#resource
*/ | Storage Bucket JSON representation as defined in HREF | buildBucketResource | {
"repo_name": "coding0011/elasticsearch",
"path": "plugins/repository-gcs/qa/google-cloud-storage/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageFixture.java",
"license": "apache-2.0",
"size": 31314
} | [
"java.io.IOException",
"org.elasticsearch.common.xcontent.XContentBuilder",
"org.elasticsearch.common.xcontent.XContentFactory"
] | import java.io.IOException; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; | import java.io.*; import org.elasticsearch.common.xcontent.*; | [
"java.io",
"org.elasticsearch.common"
] | java.io; org.elasticsearch.common; | 2,656,443 |
public static <T extends MessageDispatcher> T s_makeHandler(String name, HashMap<String, String> params,
DeviceFeature f) {
String cname = MessageDispatcher.class.getName() + "$" + name;
try {
Class<?> c = Class.forName(cname);
@SuppressWarnings("unchecked")
Class<? extends T> dc = (Class<? extends T>) c;
T ch = dc.getDeclaredConstructor(DeviceFeature.class).newInstance(f);
ch.setParameters(params);
return ch;
} catch (Exception e) {
logger.error("error trying to create dispatcher: {}", name, e);
}
return null;
} | static <T extends MessageDispatcher> T function(String name, HashMap<String, String> params, DeviceFeature f) { String cname = MessageDispatcher.class.getName() + "$" + name; try { Class<?> c = Class.forName(cname); @SuppressWarnings(STR) Class<? extends T> dc = (Class<? extends T>) c; T ch = dc.getDeclaredConstructor(DeviceFeature.class).newInstance(f); ch.setParameters(params); return ch; } catch (Exception e) { logger.error(STR, name, e); } return null; } | /**
* Factory method for creating a dispatcher of a given name using java reflection
*
* @param name the name of the dispatcher to create
* @param params
* @param f the feature for which to create the dispatcher
* @return the handler which was created
*/ | Factory method for creating a dispatcher of a given name using java reflection | s_makeHandler | {
"repo_name": "idserda/openhab",
"path": "bundles/binding/org.openhab.binding.insteonplm/src/main/java/org/openhab/binding/insteonplm/internal/device/MessageDispatcher.java",
"license": "epl-1.0",
"size": 15409
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,766,081 |
public ActionListener getDeleteActionListener() {
return this.deleteActionListener;
}
| ActionListener function() { return this.deleteActionListener; } | /**
* Return deleteActionListener.
*/ | Return deleteActionListener | getDeleteActionListener | {
"repo_name": "fanruan/finereport-design",
"path": "designer/src/com/fr/design/headerfooter/HFComponent.java",
"license": "gpl-3.0",
"size": 10166
} | [
"java.awt.event.ActionListener"
] | import java.awt.event.ActionListener; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 2,151,822 |
private void validateCommon(IgniteConfiguration cfg) {
A.notNull(cfg.getNodeId(), "cfg.getNodeId()");
A.notNull(cfg.getMBeanServer(), "cfg.getMBeanServer()");
A.notNull(cfg.getGridLogger(), "cfg.getGridLogger()");
A.notNull(cfg.getMarshaller(), "cfg.getMarshaller()");
A.notNull(cfg.getUserAttributes(), "cfg.getUserAttributes()");
// All SPIs should be non-null.
A.notNull(cfg.getSwapSpaceSpi(), "cfg.getSwapSpaceSpi()");
A.notNull(cfg.getCheckpointSpi(), "cfg.getCheckpointSpi()");
A.notNull(cfg.getCommunicationSpi(), "cfg.getCommunicationSpi()");
A.notNull(cfg.getDeploymentSpi(), "cfg.getDeploymentSpi()");
A.notNull(cfg.getDiscoverySpi(), "cfg.getDiscoverySpi()");
A.notNull(cfg.getEventStorageSpi(), "cfg.getEventStorageSpi()");
A.notNull(cfg.getCollisionSpi(), "cfg.getCollisionSpi()");
A.notNull(cfg.getFailoverSpi(), "cfg.getFailoverSpi()");
A.notNull(cfg.getLoadBalancingSpi(), "cfg.getLoadBalancingSpi()");
A.notNull(cfg.getIndexingSpi(), "cfg.getIndexingSpi()");
A.ensure(cfg.getNetworkTimeout() > 0, "cfg.getNetworkTimeout() > 0");
A.ensure(cfg.getNetworkSendRetryDelay() > 0, "cfg.getNetworkSendRetryDelay() > 0");
A.ensure(cfg.getNetworkSendRetryCount() > 0, "cfg.getNetworkSendRetryCount() > 0");
} | void function(IgniteConfiguration cfg) { A.notNull(cfg.getNodeId(), STR); A.notNull(cfg.getMBeanServer(), STR); A.notNull(cfg.getGridLogger(), STR); A.notNull(cfg.getMarshaller(), STR); A.notNull(cfg.getUserAttributes(), STR); A.notNull(cfg.getSwapSpaceSpi(), STR); A.notNull(cfg.getCheckpointSpi(), STR); A.notNull(cfg.getCommunicationSpi(), STR); A.notNull(cfg.getDeploymentSpi(), STR); A.notNull(cfg.getDiscoverySpi(), STR); A.notNull(cfg.getEventStorageSpi(), STR); A.notNull(cfg.getCollisionSpi(), STR); A.notNull(cfg.getFailoverSpi(), STR); A.notNull(cfg.getLoadBalancingSpi(), STR); A.notNull(cfg.getIndexingSpi(), STR); A.ensure(cfg.getNetworkTimeout() > 0, STR); A.ensure(cfg.getNetworkSendRetryDelay() > 0, STR); A.ensure(cfg.getNetworkSendRetryCount() > 0, STR); } | /**
* Validates common configuration parameters.
*
* @param cfg Configuration.
*/ | Validates common configuration parameters | validateCommon | {
"repo_name": "ryanzz/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java",
"license": "apache-2.0",
"size": 112826
} | [
"org.apache.ignite.configuration.IgniteConfiguration",
"org.apache.ignite.internal.util.typedef.internal.A"
] | import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.util.typedef.internal.A; | import org.apache.ignite.configuration.*; import org.apache.ignite.internal.util.typedef.internal.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,757,684 |
public static Map<Good, Integer> determineLoad(Settlement buyingSettlement, Settlement sellingSettlement,
Rover rover, double maxBuyValue) {
Map<Good, Integer> tradeList = new HashMap<Good, Integer>();
boolean hasRover = false;
GoodsManager buyerGoodsManager = buyingSettlement.getGoodsManager();
buyerGoodsManager.prepareForLoadCalculation();
GoodsManager sellerGoodsManager = sellingSettlement.getGoodsManager();
sellerGoodsManager.prepareForLoadCalculation();
double massCapacity = rover.getCargoCapacity();
// Subtract mission base mass (estimated).
double missionPartsMass = MISSION_BASE_MASS;
if (massCapacity < missionPartsMass)
missionPartsMass = massCapacity;
massCapacity -= missionPartsMass;
// Determine repair parts for trip.
Set<Integer> repairParts = rover.getMalfunctionManager().getRepairPartProbabilities().keySet();
// Determine the load.
boolean done = false;
double buyerLoadValue = 0D;
Good previousGood = null;
Set<Good> nonTradeGoods = Collections.emptySet();
while (!done) {
double remainingBuyValue = maxBuyValue - buyerLoadValue;
Good good = findBestTradeGood(sellingSettlement, buyingSettlement, tradeList, nonTradeGoods, massCapacity,
hasRover, rover, previousGood, false, repairParts, remainingBuyValue);
if (good != null) {
try {
boolean isAmountResource = good.getCategory() == GoodCategory.AMOUNT_RESOURCE;
boolean isItemResource = good.getCategory() == GoodCategory.ITEM_RESOURCE;
AmountResource resource = null;
// Add resource container if needed.
if (isAmountResource) {
resource = ResourceUtil.findAmountResource(good.getID());
Container container = getAvailableContainerForResource(resource,
sellingSettlement, tradeList);
if (container != null) {
Good containerGood = GoodsUtil.getEquipmentGood(container.getEquipmentType());
massCapacity -= container.getBaseMass();
int containerNum = 0;
if (tradeList.containsKey(containerGood))
containerNum = tradeList.get(containerGood);
double containerSupply = buyerGoodsManager.getNumberOfGoodForSettlement(containerGood);
double totalContainerNum = containerNum + containerSupply;
buyerLoadValue += buyerGoodsManager.determineGoodValueWithSupply(containerGood, totalContainerNum);
tradeList.put(containerGood, (containerNum + 1));
} else
logger.warning("container for " + resource.getName() + " not available.");
}
int itemResourceNum = 0;
if (isItemResource) {
itemResourceNum = getNumItemResourcesToTrade(good, sellingSettlement, buyingSettlement,
tradeList, massCapacity, remainingBuyValue);
}
// Add good.
if (good.getCategory() == GoodCategory.VEHICLE)
hasRover = true;
else {
int number = 1;
if (isAmountResource)
number = (int) getResourceTradeAmount(resource);
else if (isItemResource)
number = itemResourceNum;
massCapacity -= (GoodsUtil.getGoodMassPerItem(good) * number);
}
int currentNum = 0;
if (tradeList.containsKey(good))
currentNum = tradeList.get(good);
double supply = buyerGoodsManager.getNumberOfGoodForSettlement(good);
double goodNum = 1D;
if (isAmountResource)
goodNum = getResourceTradeAmount(resource);
if (isItemResource)
goodNum = itemResourceNum;
double buyGoodValue = buyerGoodsManager.determineGoodValueWithSupply(good, (supply + currentNum + goodNum));
if (isAmountResource) {
double tradeAmount = getResourceTradeAmount(resource);
buyGoodValue *= tradeAmount;
}
if (isItemResource) {
buyGoodValue *= itemResourceNum;
}
buyerLoadValue += buyGoodValue;
int newNumber = currentNum + (int) goodNum;
tradeList.put(good, newNumber);
} catch (Exception e) {
done = true;
}
} else
done = true;
previousGood = good;
}
return tradeList;
}
| static Map<Good, Integer> function(Settlement buyingSettlement, Settlement sellingSettlement, Rover rover, double maxBuyValue) { Map<Good, Integer> tradeList = new HashMap<Good, Integer>(); boolean hasRover = false; GoodsManager buyerGoodsManager = buyingSettlement.getGoodsManager(); buyerGoodsManager.prepareForLoadCalculation(); GoodsManager sellerGoodsManager = sellingSettlement.getGoodsManager(); sellerGoodsManager.prepareForLoadCalculation(); double massCapacity = rover.getCargoCapacity(); double missionPartsMass = MISSION_BASE_MASS; if (massCapacity < missionPartsMass) missionPartsMass = massCapacity; massCapacity -= missionPartsMass; Set<Integer> repairParts = rover.getMalfunctionManager().getRepairPartProbabilities().keySet(); boolean done = false; double buyerLoadValue = 0D; Good previousGood = null; Set<Good> nonTradeGoods = Collections.emptySet(); while (!done) { double remainingBuyValue = maxBuyValue - buyerLoadValue; Good good = findBestTradeGood(sellingSettlement, buyingSettlement, tradeList, nonTradeGoods, massCapacity, hasRover, rover, previousGood, false, repairParts, remainingBuyValue); if (good != null) { try { boolean isAmountResource = good.getCategory() == GoodCategory.AMOUNT_RESOURCE; boolean isItemResource = good.getCategory() == GoodCategory.ITEM_RESOURCE; AmountResource resource = null; if (isAmountResource) { resource = ResourceUtil.findAmountResource(good.getID()); Container container = getAvailableContainerForResource(resource, sellingSettlement, tradeList); if (container != null) { Good containerGood = GoodsUtil.getEquipmentGood(container.getEquipmentType()); massCapacity -= container.getBaseMass(); int containerNum = 0; if (tradeList.containsKey(containerGood)) containerNum = tradeList.get(containerGood); double containerSupply = buyerGoodsManager.getNumberOfGoodForSettlement(containerGood); double totalContainerNum = containerNum + containerSupply; buyerLoadValue += buyerGoodsManager.determineGoodValueWithSupply(containerGood, totalContainerNum); tradeList.put(containerGood, (containerNum + 1)); } else logger.warning(STR + resource.getName() + STR); } int itemResourceNum = 0; if (isItemResource) { itemResourceNum = getNumItemResourcesToTrade(good, sellingSettlement, buyingSettlement, tradeList, massCapacity, remainingBuyValue); } if (good.getCategory() == GoodCategory.VEHICLE) hasRover = true; else { int number = 1; if (isAmountResource) number = (int) getResourceTradeAmount(resource); else if (isItemResource) number = itemResourceNum; massCapacity -= (GoodsUtil.getGoodMassPerItem(good) * number); } int currentNum = 0; if (tradeList.containsKey(good)) currentNum = tradeList.get(good); double supply = buyerGoodsManager.getNumberOfGoodForSettlement(good); double goodNum = 1D; if (isAmountResource) goodNum = getResourceTradeAmount(resource); if (isItemResource) goodNum = itemResourceNum; double buyGoodValue = buyerGoodsManager.determineGoodValueWithSupply(good, (supply + currentNum + goodNum)); if (isAmountResource) { double tradeAmount = getResourceTradeAmount(resource); buyGoodValue *= tradeAmount; } if (isItemResource) { buyGoodValue *= itemResourceNum; } buyerLoadValue += buyGoodValue; int newNumber = currentNum + (int) goodNum; tradeList.put(good, newNumber); } catch (Exception e) { done = true; } } else done = true; previousGood = good; } return tradeList; } | /**
* Determines the load between a buying settlement and a selling settlement.
*
* @param buyingSettlement the settlement buying the goods.
* @param sellingSettlement the settlement selling the goods.
* @param rover the rover to carry the goods.
* @param maxBuyValue the maximum value the selling settlement will
* permit.
* @return map of goods and their number.
* @throws Exception if error determining the load.
*/ | Determines the load between a buying settlement and a selling settlement | determineLoad | {
"repo_name": "mars-sim/mars-sim",
"path": "mars-sim-core/src/main/java/org/mars_sim/msp/core/person/ai/mission/TradeUtil.java",
"license": "gpl-3.0",
"size": 31612
} | [
"java.util.Collections",
"java.util.HashMap",
"java.util.Map",
"java.util.Set",
"org.mars_sim.msp.core.equipment.Container",
"org.mars_sim.msp.core.resource.AmountResource",
"org.mars_sim.msp.core.resource.ResourceUtil",
"org.mars_sim.msp.core.structure.Settlement",
"org.mars_sim.msp.core.structure.goods.Good",
"org.mars_sim.msp.core.structure.goods.GoodCategory",
"org.mars_sim.msp.core.structure.goods.GoodsManager",
"org.mars_sim.msp.core.structure.goods.GoodsUtil",
"org.mars_sim.msp.core.vehicle.Rover"
] | import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Set; import org.mars_sim.msp.core.equipment.Container; import org.mars_sim.msp.core.resource.AmountResource; import org.mars_sim.msp.core.resource.ResourceUtil; import org.mars_sim.msp.core.structure.Settlement; import org.mars_sim.msp.core.structure.goods.Good; import org.mars_sim.msp.core.structure.goods.GoodCategory; import org.mars_sim.msp.core.structure.goods.GoodsManager; import org.mars_sim.msp.core.structure.goods.GoodsUtil; import org.mars_sim.msp.core.vehicle.Rover; | import java.util.*; import org.mars_sim.msp.core.equipment.*; import org.mars_sim.msp.core.resource.*; import org.mars_sim.msp.core.structure.*; import org.mars_sim.msp.core.structure.goods.*; import org.mars_sim.msp.core.vehicle.*; | [
"java.util",
"org.mars_sim.msp"
] | java.util; org.mars_sim.msp; | 2,423,397 |
private void populateHadoopClasspath(Map<String, String> envs) {
List<String> yarnClassPath = Lists.newArrayList(getYarnAppClasspath());
List<String> mrClassPath = Lists.newArrayList(getMRAppClasspath());
yarnClassPath.addAll(mrClassPath);
LOGGER.info("Adding hadoop classpath: " + org.apache.commons.lang3.StringUtils.join(yarnClassPath, ":"));
for (String path : yarnClassPath) {
String newValue = path;
if (envs.containsKey(ApplicationConstants.Environment.CLASSPATH.name())) {
newValue = envs.get(ApplicationConstants.Environment.CLASSPATH.name()) +
ApplicationConstants.CLASS_PATH_SEPARATOR + newValue;
}
envs.put(ApplicationConstants.Environment.CLASSPATH.name(), newValue);
}
// set HADOOP_MAPRED_HOME explicitly, otherwise it won't work for hadoop3
// see https://stackoverflow.com/questions/50719585/unable-to-run-mapreduce-wordcount
this.envs.put("HADOOP_MAPRED_HOME", "${HADOOP_HOME}");
} | void function(Map<String, String> envs) { List<String> yarnClassPath = Lists.newArrayList(getYarnAppClasspath()); List<String> mrClassPath = Lists.newArrayList(getMRAppClasspath()); yarnClassPath.addAll(mrClassPath); LOGGER.info(STR + org.apache.commons.lang3.StringUtils.join(yarnClassPath, ":")); for (String path : yarnClassPath) { String newValue = path; if (envs.containsKey(ApplicationConstants.Environment.CLASSPATH.name())) { newValue = envs.get(ApplicationConstants.Environment.CLASSPATH.name()) + ApplicationConstants.CLASS_PATH_SEPARATOR + newValue; } envs.put(ApplicationConstants.Environment.CLASSPATH.name(), newValue); } this.envs.put(STR, STR); } | /**
* Populate the classpath entry in the given environment map with any application
* classpath specified through the Hadoop and Yarn configurations.
*/ | Populate the classpath entry in the given environment map with any application classpath specified through the Hadoop and Yarn configurations | populateHadoopClasspath | {
"repo_name": "joroKr21/incubator-zeppelin",
"path": "zeppelin-plugins/launcher/yarn/src/main/java/org/apache/zeppelin/interpreter/launcher/YarnRemoteInterpreterProcess.java",
"license": "apache-2.0",
"size": 23593
} | [
"com.google.common.collect.Lists",
"java.util.List",
"java.util.Map",
"org.apache.hadoop.util.StringUtils",
"org.apache.hadoop.yarn.api.ApplicationConstants"
] | import com.google.common.collect.Lists; import java.util.List; import java.util.Map; import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.yarn.api.ApplicationConstants; | import com.google.common.collect.*; import java.util.*; import org.apache.hadoop.util.*; import org.apache.hadoop.yarn.api.*; | [
"com.google.common",
"java.util",
"org.apache.hadoop"
] | com.google.common; java.util; org.apache.hadoop; | 397,053 |
@Test
public void getterSetterTest() {
Node n1 = new Node(Type.BLOCKADE);
n.setNorth(n1);
assertTrue(n.getNorth() == n1);
n.setEast(n1);
assertTrue(n.getEast() == n1);
n.setSouth(n1);
assertTrue(n.getSouth() == n1);
n.setWest(n1);
assertTrue(n.getWest() == n1);
n.setType(Type.ROOM);
assertTrue(n.getType() == Type.ROOM);
n.setDir(DoorDirection.NORTH);
assertTrue(n.getDir() == DoorDirection.NORTH);
} | void function() { Node n1 = new Node(Type.BLOCKADE); n.setNorth(n1); assertTrue(n.getNorth() == n1); n.setEast(n1); assertTrue(n.getEast() == n1); n.setSouth(n1); assertTrue(n.getSouth() == n1); n.setWest(n1); assertTrue(n.getWest() == n1); n.setType(Type.ROOM); assertTrue(n.getType() == Type.ROOM); n.setDir(DoorDirection.NORTH); assertTrue(n.getDir() == DoorDirection.NORTH); } | /**
* General test for getters and setters.
*/ | General test for getters and setters | getterSetterTest | {
"repo_name": "eishub/BW4T",
"path": "bw4t-environment-store/src/test/java/nl/tudelft/bw4t/environmentstore/editor/model/NodeTest.java",
"license": "gpl-3.0",
"size": 2036
} | [
"nl.tudelft.bw4t.environmentstore.editor.model.Node",
"nl.tudelft.bw4t.map.Zone",
"org.junit.Assert"
] | import nl.tudelft.bw4t.environmentstore.editor.model.Node; import nl.tudelft.bw4t.map.Zone; import org.junit.Assert; | import nl.tudelft.bw4t.environmentstore.editor.model.*; import nl.tudelft.bw4t.map.*; import org.junit.*; | [
"nl.tudelft.bw4t",
"org.junit"
] | nl.tudelft.bw4t; org.junit; | 1,520,578 |
private String getNewName() {
IFileStore fileStore = snapshot.getFileStore();
List<String> oldNames = new ArrayList<String>();
try {
for (String oldName : fileStore.getParent().childNames(EFS.NONE,
null)) {
oldNames.add(removeSuffix(oldName));
}
} catch (CoreException e) {
Activator
.log(IStatus.ERROR,
NLS.bind(Messages.accessFileFailedMsg,
fileStore.getName()), e);
return null;
}
String oldName = fileStore.getName();
IInputValidator validator = new InputValidator(oldNames, oldName);
InputDialog dialog = new InputDialog(
treeViewer.getControl().getShell(), Messages.renameTitle,
Messages.newNameLabel, removeSuffix(oldName), validator);
if (dialog.open() == Window.OK) {
return oldName.replace(removeSuffix(oldName), dialog.getValue());
}
return null;
} | String function() { IFileStore fileStore = snapshot.getFileStore(); List<String> oldNames = new ArrayList<String>(); try { for (String oldName : fileStore.getParent().childNames(EFS.NONE, null)) { oldNames.add(removeSuffix(oldName)); } } catch (CoreException e) { Activator .log(IStatus.ERROR, NLS.bind(Messages.accessFileFailedMsg, fileStore.getName()), e); return null; } String oldName = fileStore.getName(); IInputValidator validator = new InputValidator(oldNames, oldName); InputDialog dialog = new InputDialog( treeViewer.getControl().getShell(), Messages.renameTitle, Messages.newNameLabel, removeSuffix(oldName), validator); if (dialog.open() == Window.OK) { return oldName.replace(removeSuffix(oldName), dialog.getValue()); } return null; } | /**
* Gets the new file name.
*
* @return The new file name
*/ | Gets the new file name | getNewName | {
"repo_name": "TANGO-Project/code-optimiser-plugin",
"path": "bundles/org.jvmmonitor.ui/src/org/jvmmonitor/internal/ui/views/RenameAction.java",
"license": "apache-2.0",
"size": 7445
} | [
"java.util.ArrayList",
"java.util.List",
"org.eclipse.core.filesystem.IFileStore",
"org.eclipse.core.runtime.CoreException",
"org.eclipse.core.runtime.IStatus",
"org.eclipse.jface.dialogs.IInputValidator",
"org.eclipse.jface.dialogs.InputDialog",
"org.eclipse.jface.window.Window",
"org.eclipse.osgi.util.NLS",
"org.jvmmonitor.ui.Activator"
] | import java.util.ArrayList; import java.util.List; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.jface.dialogs.IInputValidator; import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.jface.window.Window; import org.eclipse.osgi.util.NLS; import org.jvmmonitor.ui.Activator; | import java.util.*; import org.eclipse.core.filesystem.*; import org.eclipse.core.runtime.*; import org.eclipse.jface.dialogs.*; import org.eclipse.jface.window.*; import org.eclipse.osgi.util.*; import org.jvmmonitor.ui.*; | [
"java.util",
"org.eclipse.core",
"org.eclipse.jface",
"org.eclipse.osgi",
"org.jvmmonitor.ui"
] | java.util; org.eclipse.core; org.eclipse.jface; org.eclipse.osgi; org.jvmmonitor.ui; | 2,328,027 |
@Nullable
public InputFile findOnClassPath(String qualifiedName) throws IOException {
return findOnPaths(qualifiedName, classPathEntries, ".class");
} | InputFile function(String qualifiedName) throws IOException { return findOnPaths(qualifiedName, classPathEntries, STR); } | /**
* Find a {@link com.google.devtools.j2objc.file.InputFile} on the class path,
* either in a directory or a jar.
* Returns a file guaranteed to exist, or null.
*/ | Find a <code>com.google.devtools.j2objc.file.InputFile</code> on the class path, either in a directory or a jar. Returns a file guaranteed to exist, or null | findOnClassPath | {
"repo_name": "doppllib/j2objc",
"path": "translator/src/main/java/com/google/devtools/j2objc/util/FileUtil.java",
"license": "apache-2.0",
"size": 9118
} | [
"com.google.devtools.j2objc.file.InputFile",
"java.io.IOException"
] | import com.google.devtools.j2objc.file.InputFile; import java.io.IOException; | import com.google.devtools.j2objc.file.*; import java.io.*; | [
"com.google.devtools",
"java.io"
] | com.google.devtools; java.io; | 1,840,887 |
public void setStartDate(Date startDate)
{
this.startDate = startDate;
} | void function(Date startDate) { this.startDate = startDate; } | /**
* Sets startDate.
*
* @param startDate a Date.
*/ | Sets startDate | setStartDate | {
"repo_name": "dsyrstad/wicket-web-beans",
"path": "wicketwebbeans/src/test/java/com/googlecode/wicketwebbeans/model/annotations/AnnotationTestBean.java",
"license": "apache-2.0",
"size": 11113
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 697,245 |
private void socksSendRequest(int command, InetAddress address, int port)
throws IOException {
Socks4Message request = new Socks4Message();
request.setCommandOrResult(command);
request.setPort(port);
request.setIP(address.getAddress());
request.setUserId("default"); //$NON-NLS-1$
getOutputStream().write(request.getBytes(), 0, request.getLength());
}
| void function(int command, InetAddress address, int port) throws IOException { Socks4Message request = new Socks4Message(); request.setCommandOrResult(command); request.setPort(port); request.setIP(address.getAddress()); request.setUserId(STR); getOutputStream().write(request.getBytes(), 0, request.getLength()); } | /**
* Send a SOCKS V4 request.
*/ | Send a SOCKS V4 request | socksSendRequest | {
"repo_name": "skyHALud/codenameone",
"path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java",
"license": "gpl-2.0",
"size": 20038
} | [
"java.io.IOException",
"java.net.InetAddress"
] | import java.io.IOException; import java.net.InetAddress; | import java.io.*; import java.net.*; | [
"java.io",
"java.net"
] | java.io; java.net; | 1,384,741 |
public void clearCurrentTopology() {
this.clear();
linksUpdated = true;
dtLinksUpdated = true;
createNewInstance();
lastUpdateTime = new Date();
} | void function() { this.clear(); linksUpdated = true; dtLinksUpdated = true; createNewInstance(); lastUpdateTime = new Date(); } | /**
* Clears the current topology. Note that this does NOT
* send out updates.
*/ | Clears the current topology. Note that this does NOT send out updates | clearCurrentTopology | {
"repo_name": "riajkhu/floodlight",
"path": "src/main/java/net/floodlightcontroller/topology/TopologyManager.java",
"license": "apache-2.0",
"size": 40859
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,562,939 |
protected void assertSelectedCardChanged(Index expectedSelectedCardIndex) {
String selectedCardName = getPersonListPanel().getHandleToSelectedCard().getName();
URL expectedUrl;
try {
expectedUrl = new URL(GOOGLE_SEARCH_URL_PREFIX + selectedCardName.replaceAll(" ", "+")
+ GOOGLE_SEARCH_URL_SUFFIX);
} catch (MalformedURLException mue) {
throw new AssertionError("URL expected to be valid.");
}
assertEquals(expectedUrl, getBrowserPanel().getLoadedUrl());
assertEquals(expectedSelectedCardIndex.getZeroBased(), getPersonListPanel().getSelectedCardIndex());
} | void function(Index expectedSelectedCardIndex) { String selectedCardName = getPersonListPanel().getHandleToSelectedCard().getName(); URL expectedUrl; try { expectedUrl = new URL(GOOGLE_SEARCH_URL_PREFIX + selectedCardName.replaceAll(" ", "+") + GOOGLE_SEARCH_URL_SUFFIX); } catch (MalformedURLException mue) { throw new AssertionError(STR); } assertEquals(expectedUrl, getBrowserPanel().getLoadedUrl()); assertEquals(expectedSelectedCardIndex.getZeroBased(), getPersonListPanel().getSelectedCardIndex()); } | /**
* Asserts that the browser's url is changed to display the details of the person in the person list panel at
* {@code expectedSelectedCardIndex}, and only the card at {@code expectedSelectedCardIndex} is selected.
* @see BrowserPanelHandle#isUrlChanged()
* @see PersonListPanelHandle#isSelectedPersonCardChanged()
*/ | Asserts that the browser's url is changed to display the details of the person in the person list panel at expectedSelectedCardIndex, and only the card at expectedSelectedCardIndex is selected | assertSelectedCardChanged | {
"repo_name": "CS2103R-Eugene-Peh/addressbook-level4",
"path": "src/test/java/systemtests/AddressBookSystemTest.java",
"license": "mit",
"size": 10455
} | [
"java.net.MalformedURLException",
"org.junit.Assert"
] | import java.net.MalformedURLException; import org.junit.Assert; | import java.net.*; import org.junit.*; | [
"java.net",
"org.junit"
] | java.net; org.junit; | 2,399,658 |
Date getCurrentDate() {
return new Date();
} | Date getCurrentDate() { return new Date(); } | /**
* Returns the current date. Externalized for better test support.
*
* @return the current date
*/ | Returns the current date. Externalized for better test support | getCurrentDate | {
"repo_name": "curso007/camel",
"path": "components/camel-smpp/src/main/java/org/apache/camel/component/smpp/SmppBinding.java",
"license": "apache-2.0",
"size": 14334
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,169,272 |
@Test
@Tag("slow")
public void testMODSZK1() {
CuteNetlibCase.doTest("MODSZK1.SIF", "320.6197293824883", null, NumberContext.of(7, 4));
} | @Tag("slow") void function() { CuteNetlibCase.doTest(STR, STR, null, NumberContext.of(7, 4)); } | /**
* <pre>
* 2019-02-15: Tagged as slow since too large for promotional/community version of CPLEX
* 2019-02-15: Objective defined by ojAlgo's current result
* </pre>
*/ | <code> 2019-02-15: Tagged as slow since too large for promotional/community version of CPLEX 2019-02-15: Objective defined by ojAlgo's current result </code> | testMODSZK1 | {
"repo_name": "optimatika/ojAlgo",
"path": "src/test/java/org/ojalgo/optimisation/linear/CuteNetlibCase.java",
"license": "mit",
"size": 42381
} | [
"org.junit.jupiter.api.Tag",
"org.ojalgo.type.context.NumberContext"
] | import org.junit.jupiter.api.Tag; import org.ojalgo.type.context.NumberContext; | import org.junit.jupiter.api.*; import org.ojalgo.type.context.*; | [
"org.junit.jupiter",
"org.ojalgo.type"
] | org.junit.jupiter; org.ojalgo.type; | 1,383,501 |
public void setAgent(Agent agent) {
this.agent = agent;
} | void function(Agent agent) { this.agent = agent; } | /**
* Set the agent.
*
* @param agent the agent.
*/ | Set the agent | setAgent | {
"repo_name": "lazydog-org/jprefer-parent",
"path": "jprefer-web/src/main/java/org/lazydog/jprefer/web/managedbean/AgentMB.java",
"license": "gpl-3.0",
"size": 6322
} | [
"org.lazydog.jprefer.model.Agent"
] | import org.lazydog.jprefer.model.Agent; | import org.lazydog.jprefer.model.*; | [
"org.lazydog.jprefer"
] | org.lazydog.jprefer; | 1,787,680 |
public void silentPrint() throws PrinterException
{
silentPrint(printerJob);
} | void function() throws PrinterException { silentPrint(printerJob); } | /**
* Prints the given document using the default printer without prompting the user.
* @throws PrinterException if the document cannot be printed
*/ | Prints the given document using the default printer without prompting the user | silentPrint | {
"repo_name": "ZhenyaM/veraPDF-pdfbox",
"path": "pdfbox/src/main/java/org/apache/pdfbox/printing/PDFPrinter.java",
"license": "apache-2.0",
"size": 17282
} | [
"java.awt.print.PrinterException"
] | import java.awt.print.PrinterException; | import java.awt.print.*; | [
"java.awt"
] | java.awt; | 2,782,071 |
public static TestPropertyValues of(String... pairs) {
return of(Stream.of(pairs));
} | static TestPropertyValues function(String... pairs) { return of(Stream.of(pairs)); } | /**
* Return a new {@link TestPropertyValues} with the underlying map populated with the
* given property pairs. Name-value pairs can be specified with colon (":") or equals
* ("=") separators.
* @param pairs The key value pairs for properties that need to be added to the
* environment
* @return the new instance
*/ | Return a new <code>TestPropertyValues</code> with the underlying map populated with the given property pairs. Name-value pairs can be specified with colon (":") or equals ("=") separators | of | {
"repo_name": "pvorb/spring-boot",
"path": "spring-boot-test/src/main/java/org/springframework/boot/test/util/TestPropertyValues.java",
"license": "apache-2.0",
"size": 9849
} | [
"java.util.stream.Stream"
] | import java.util.stream.Stream; | import java.util.stream.*; | [
"java.util"
] | java.util; | 2,076,645 |
public static void main(String[] args) {
if (args.length != 1) {
System.err.println("usage: java " + Builder.class.getName() + " <expression string>");
System.exit(1);
}
PrintWriter out = new PrintWriter(System.out);
Tree tree = null;
try {
tree = new Builder(Feature.METHOD_INVOCATIONS).build(args[0]);
} catch (TreeBuilderException e) {
System.out.println(e.getMessage());
System.exit(0);
} | static void function(String[] args) { if (args.length != 1) { System.err.println(STR + Builder.class.getName() + STR); System.exit(1); } PrintWriter out = new PrintWriter(System.out); Tree tree = null; try { tree = new Builder(Feature.METHOD_INVOCATIONS).build(args[0]); } catch (TreeBuilderException e) { System.out.println(e.getMessage()); System.exit(0); } | /**
* Dump out abstract syntax tree for a given expression
*
* @param args array with one element, containing the expression string
*/ | Dump out abstract syntax tree for a given expression | main | {
"repo_name": "paulstapleton/flowable-engine",
"path": "modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/de/odysseus/el/tree/impl/Builder.java",
"license": "apache-2.0",
"size": 5594
} | [
"java.io.PrintWriter",
"org.flowable.common.engine.impl.de.odysseus.el.tree.Tree",
"org.flowable.common.engine.impl.de.odysseus.el.tree.TreeBuilderException"
] | import java.io.PrintWriter; import org.flowable.common.engine.impl.de.odysseus.el.tree.Tree; import org.flowable.common.engine.impl.de.odysseus.el.tree.TreeBuilderException; | import java.io.*; import org.flowable.common.engine.impl.de.odysseus.el.tree.*; | [
"java.io",
"org.flowable.common"
] | java.io; org.flowable.common; | 2,439,652 |
public Statement getStatement()
{
return this.state;
}
| Statement function() { return this.state; } | /**
* Return the current database state
* @return
*/ | Return the current database state | getStatement | {
"repo_name": "gottron/SchemEx",
"path": "SchemEX-GitHub/src/de/uni_koblenz/schemex/util/DBConnect.java",
"license": "apache-2.0",
"size": 2173
} | [
"java.sql.Statement"
] | import java.sql.Statement; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,475,169 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.