method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public XStringBufBase append (double val)
{
try
{
getBufferAsAppendable().append (String.valueOf (val));
}
catch (IOException ex)
{
// Shouldn't happen here.
}
return this;
} | XStringBufBase function (double val) { try { getBufferAsAppendable().append (String.valueOf (val)); } catch (IOException ex) { } return this; } | /**
* Append the string representation of a <tt>double</tt> value to
* the buffer.
*
* @param val The double value.
*
* @return a reference to this object
*/ | Append the string representation of a double value to the buffer | append | {
"repo_name": "accesstest3/cfunambol",
"path": "modules/email/email-core/src/main/java/org/clapper/util/text/XStringBufBase.java",
"license": "agpl-3.0",
"size": 49152
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,758,419 |
public List<String> getAncestors(String nodePath) throws Exception {
String parentPath = null;
String nodeName = nodePath;
if (nodeName.contains(".")) {
nodeName = nodePath.substring(nodePath.lastIndexOf("."), nodePath.length()-1);
parentPath = nodePath.substring(0 , nodePath.lastIndexOf("."));
}... | List<String> function(String nodePath) throws Exception { String parentPath = null; String nodeName = nodePath; if (nodeName.contains(".")) { nodeName = nodePath.substring(nodePath.lastIndexOf("."), nodePath.length()-1); parentPath = nodePath.substring(0 , nodePath.lastIndexOf(".")); } if (parentPath != null && parentP... | /**
* Gets the ancestor elements from a schema representation.
*
* The returned vector will contain all the XSElementDeclaration ancestors of the target element.
*
* @return List - a vector of XSElementDeclarations
* @throws Exception
*/ | Gets the ancestor elements from a schema representation. The returned vector will contain all the XSElementDeclaration ancestors of the target element | getAncestors | {
"repo_name": "mqsysadmin/dpdirect",
"path": "src/main/java/org/dpdirect/schema/SchemaHelper.java",
"license": "apache-2.0",
"size": 16293
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 444,087 |
Date getExpiration(); | Date getExpiration(); | /**
* This method is used to retrieve the expiration time for the cookie.
*
* @return The expiration time for the cookie, or
* <code>null</code> if none is set (i.e., for non-persistent session
* cookies).
*/ | This method is used to retrieve the expiration time for the cookie | getExpiration | {
"repo_name": "Burp-BReWSki/BReWSki",
"path": "src/burp/ICookie.java",
"license": "mit",
"size": 1501
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,183,463 |
@RequestMapping(value="/createPass", method= RequestMethod.POST)
public String postVerificationPage(Model model, @RequestParam(defaultValue="1") Integer contextId
, @RequestParam String email, @RequestParam String password) {
Identity identity = identityRepository.findByPrincipal(email);
model.addAttribut... | @RequestMapping(value=STR, method= RequestMethod.POST) String function(Model model, @RequestParam(defaultValue="1") Integer contextId , @RequestParam String email, @RequestParam String password) { Identity identity = identityRepository.findByPrincipal(email); model.addAttribute(STR, true); logger.debug(STR,identity.get... | /**
* Create user and password.
*
* @param model
* @param email
* @param password
*/ | Create user and password | postVerificationPage | {
"repo_name": "raphaelutfpr/helianto-seed",
"path": "src/main/java/org/helianto/security/controller/VerifyController.java",
"license": "apache-2.0",
"size": 9394
} | [
"java.util.List",
"org.helianto.core.domain.Entity",
"org.helianto.core.domain.Identity",
"org.helianto.core.domain.Operator",
"org.helianto.core.domain.Signup",
"org.helianto.security.domain.IdentitySecret",
"org.springframework.ui.Model",
"org.springframework.web.bind.annotation.RequestMapping",
"... | import java.util.List; import org.helianto.core.domain.Entity; import org.helianto.core.domain.Identity; import org.helianto.core.domain.Operator; import org.helianto.core.domain.Signup; import org.helianto.security.domain.IdentitySecret; import org.springframework.ui.Model; import org.springframework.web.bind.annotati... | import java.util.*; import org.helianto.core.domain.*; import org.helianto.security.domain.*; import org.springframework.ui.*; import org.springframework.web.bind.annotation.*; | [
"java.util",
"org.helianto.core",
"org.helianto.security",
"org.springframework.ui",
"org.springframework.web"
] | java.util; org.helianto.core; org.helianto.security; org.springframework.ui; org.springframework.web; | 239,594 |
public ActionForward addProtocolPerson(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
ProtocolForm protocolForm = (ProtocolForm) form;
ProtocolPerson newProtocolPerson = (ProtocolPerson) protocolForm.getPersonnelHelper... | ActionForward function(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ProtocolForm protocolForm = (ProtocolForm) form; ProtocolPerson newProtocolPerson = (ProtocolPerson) protocolForm.getPersonnelHelper().getNewProtocolPerson(); Protocol protocol = (... | /**
* This method is linked to ProtocolPersonnelService to perform the action - Add Protocol Person.
* Method is called in protocolAddPersonnelSection.tag
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/ | This method is linked to ProtocolPersonnelService to perform the action - Add Protocol Person. Method is called in protocolAddPersonnelSection.tag | addProtocolPerson | {
"repo_name": "kuali/kc",
"path": "coeus-impl/src/main/java/org/kuali/kra/irb/personnel/ProtocolPersonnelAction.java",
"license": "agpl-3.0",
"size": 21153
} | [
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.apache.commons.lang3.StringUtils",
"org.apache.struts.action.ActionForm",
"org.apache.struts.action.ActionForward",
"org.apache.struts.action.ActionMapping",
"org.kuali.kra.infrastructure.Constants",
"org.kuali.kra... | import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.kuali.kra.infrastructure.Constant... | import javax.servlet.http.*; import org.apache.commons.lang3.*; import org.apache.struts.action.*; import org.kuali.kra.infrastructure.*; import org.kuali.kra.irb.*; | [
"javax.servlet",
"org.apache.commons",
"org.apache.struts",
"org.kuali.kra"
] | javax.servlet; org.apache.commons; org.apache.struts; org.kuali.kra; | 455,517 |
public JsonObject toJson() {
JsonArray jsonResults = new JsonArray();
results.forEach(op -> {
if (op instanceof KeyValue) {
jsonResults.add(new JsonObject().put("KV", ((KeyValue) op).toJson()));
}
});
JsonArray jsonErrors = new JsonArray();
errors.forEach(err -> jsonErrors.add(... | JsonObject function() { JsonArray jsonResults = new JsonArray(); results.forEach(op -> { if (op instanceof KeyValue) { jsonResults.add(new JsonObject().put("KV", ((KeyValue) op).toJson())); } }); JsonArray jsonErrors = new JsonArray(); errors.forEach(err -> jsonErrors.add(err.toJson())); return new JsonObject().put(STR... | /**
* Convert to JSON
*
* @return the JSON
*/ | Convert to JSON | toJson | {
"repo_name": "ruslansennov/vertx-consul-client",
"path": "src/main/java/io/vertx/ext/consul/TxnResponse.java",
"license": "apache-2.0",
"size": 3806
} | [
"io.vertx.core.json.JsonArray",
"io.vertx.core.json.JsonObject"
] | import io.vertx.core.json.JsonArray; import io.vertx.core.json.JsonObject; | import io.vertx.core.json.*; | [
"io.vertx.core"
] | io.vertx.core; | 275,905 |
@Test
public void testRightSideCountercheck() {
try {
Plan plan = getTestPlanRightStatic(Optimizer.HINT_LOCAL_STRATEGY_HASH_BUILD_FIRST);
OptimizedPlan oPlan = compileNoStats(plan);
OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(oPlan);
DualInputPlanNode innerJoin = resolv... | void function() { try { Plan plan = getTestPlanRightStatic(Optimizer.HINT_LOCAL_STRATEGY_HASH_BUILD_FIRST); OptimizedPlan oPlan = compileNoStats(plan); OptimizerPlanNodeResolver resolver = getOptimizerPlanNodeResolver(oPlan); DualInputPlanNode innerJoin = resolver.getNode(STR); assertEquals(DriverStrategy.HYBRIDHASH_BU... | /**
* This test makes sure that only a HYBRIDHASH on the static path is transformed to the cached variant
*/ | This test makes sure that only a HYBRIDHASH on the static path is transformed to the cached variant | testRightSideCountercheck | {
"repo_name": "yew1eb/flink",
"path": "flink-optimizer/src/test/java/org/apache/flink/optimizer/CachedMatchStrategyCompilerTest.java",
"license": "apache-2.0",
"size": 9919
} | [
"org.apache.flink.api.common.Plan",
"org.apache.flink.optimizer.dag.TempMode",
"org.apache.flink.optimizer.plan.DualInputPlanNode",
"org.apache.flink.optimizer.plan.OptimizedPlan",
"org.apache.flink.optimizer.plantranslate.JobGraphGenerator",
"org.apache.flink.runtime.operators.DriverStrategy",
"org.jun... | import org.apache.flink.api.common.Plan; import org.apache.flink.optimizer.dag.TempMode; import org.apache.flink.optimizer.plan.DualInputPlanNode; import org.apache.flink.optimizer.plan.OptimizedPlan; import org.apache.flink.optimizer.plantranslate.JobGraphGenerator; import org.apache.flink.runtime.operators.DriverStra... | import org.apache.flink.api.common.*; import org.apache.flink.optimizer.dag.*; import org.apache.flink.optimizer.plan.*; import org.apache.flink.optimizer.plantranslate.*; import org.apache.flink.runtime.operators.*; import org.junit.*; | [
"org.apache.flink",
"org.junit"
] | org.apache.flink; org.junit; | 199,113 |
public Integer getPage()
{
Integer retval = null;
COSNumber page = (COSNumber)annot.getDictionaryObject( "Page" );
if( page != null )
{
retval = new Integer( page.intValue() );
}
return retval;
} | Integer function() { Integer retval = null; COSNumber page = (COSNumber)annot.getDictionaryObject( "Page" ); if( page != null ) { retval = new Integer( page.intValue() ); } return retval; } | /**
* This will get the page number or null if it does not exist.
*
* @return The page number.
*/ | This will get the page number or null if it does not exist | getPage | {
"repo_name": "myrridin/qz-print",
"path": "pdfbox_1.8.4_qz/src/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java",
"license": "lgpl-2.1",
"size": 15414
} | [
"org.apache.pdfbox.cos.COSNumber"
] | import org.apache.pdfbox.cos.COSNumber; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 992,196 |
private static String parseTextNode(Node node) {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < node.getChildNodes().getLength(); i++) {
Node childNode = node.getChildNodes().item(i);
if (childNode.getNodeType() == Node.CDATA_SECTION_NODE || childNode.getNodeType() == Node.TEXT_NODE) {
b... | static String function(Node node) { StringBuffer buffer = new StringBuffer(); for (int i = 0; i < node.getChildNodes().getLength(); i++) { Node childNode = node.getChildNodes().item(i); if (childNode.getNodeType() == Node.CDATA_SECTION_NODE childNode.getNodeType() == Node.TEXT_NODE) { buffer.append(childNode.getNodeVal... | /**
* Parse a String from a textually type node.
*
* @param node The node.
* @return The String.
*/ | Parse a String from a textually type node | parseTextNode | {
"repo_name": "bolav/pmd-src-4.2.6-perl",
"path": "src/net/sourceforge/pmd/RuleSetFactory.java",
"license": "bsd-3-clause",
"size": 17712
} | [
"org.w3c.dom.Node"
] | import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 2,341,330 |
protected Transaction txnBegin(Transaction parentTxn,
TransactionConfig config)
throws DatabaseException {
if (txnType == TXN_USER ||
(isReplicatedTest(getClass()) && txnType == TXN_AUTO)) {
return env.beginTransaction(parentTxn, c... | Transaction function(Transaction parentTxn, TransactionConfig config) throws DatabaseException { if (txnType == TXN_USER (isReplicatedTest(getClass()) && txnType == TXN_AUTO)) { return env.beginTransaction(parentTxn, config); } else { return null; } } | /**
* Begin a txn if in TXN_USER mode; otherwise return null;
*/ | Begin a txn if in TXN_USER mode; otherwise return null | txnBegin | {
"repo_name": "bjorndm/prebake",
"path": "code/third_party/bdb/test/com/sleepycat/util/test/TxnTestCase.java",
"license": "apache-2.0",
"size": 6599
} | [
"com.sleepycat.je.DatabaseException",
"com.sleepycat.je.Transaction",
"com.sleepycat.je.TransactionConfig"
] | import com.sleepycat.je.DatabaseException; import com.sleepycat.je.Transaction; import com.sleepycat.je.TransactionConfig; | import com.sleepycat.je.*; | [
"com.sleepycat.je"
] | com.sleepycat.je; | 1,276,431 |
public Map<String, IScalingDescriptor> getScalingDescriptors() {
return descriptors;
}
| Map<String, IScalingDescriptor> function() { return descriptors; } | /**
* Returns the scaling descriptors.
*
* @return the scaling descriptors (may be <b>null</b> or contain mapping to <b>null</b>)
*/ | Returns the scaling descriptors | getScalingDescriptors | {
"repo_name": "QualiMaster/Infrastructure",
"path": "QualiMaster.Events/src/eu/qualimaster/monitoring/events/SubTopologyMonitoringEvent.java",
"license": "apache-2.0",
"size": 2488
} | [
"eu.qualimaster.infrastructure.IScalingDescriptor",
"java.util.Map"
] | import eu.qualimaster.infrastructure.IScalingDescriptor; import java.util.Map; | import eu.qualimaster.infrastructure.*; import java.util.*; | [
"eu.qualimaster.infrastructure",
"java.util"
] | eu.qualimaster.infrastructure; java.util; | 1,262,591 |
long getRawDataSizeOfColumns(List<String> colNames); | long getRawDataSizeOfColumns(List<String> colNames); | /**
* Get the deserialized data size of the specified columns
* @param colNames
* @return raw data size of columns
*/ | Get the deserialized data size of the specified columns | getRawDataSizeOfColumns | {
"repo_name": "chunyang-wen/orc",
"path": "java/core/src/java/org/apache/orc/Reader.java",
"license": "apache-2.0",
"size": 11289
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 410,460 |
public int uninstallSilent(Context context, String packageName) {
return uninstallSilent(context, packageName, false);
} | int function(Context context, String packageName) { return uninstallSilent(context, packageName, false); } | /**
* uninstall package and clear data of app silent by root
*
* @param context
* @param packageName package name of app
* @return
* @see #uninstallSilent(Context, String, boolean)
*/ | uninstall package and clear data of app silent by root | uninstallSilent | {
"repo_name": "Yumore/YuanYuan",
"path": "Basekit/src/main/java/xyz/zimuju/basekit/system/SilentInstaller.java",
"license": "apache-2.0",
"size": 21434
} | [
"android.content.Context"
] | import android.content.Context; | import android.content.*; | [
"android.content"
] | android.content; | 1,678,299 |
private final String getName(final BigInteger value) {
logger.warn("ROSpecEventType must convert BigInteger " + value +
" to Integer value " + value.intValue());
return getName(value.intValue());
} | final String function(final BigInteger value) { logger.warn(STR + value + STR + value.intValue()); return getName(value.intValue()); } | /**
* wrapper method for UnsignedIntegers that use BigIntegers to store value
*
*/ | wrapper method for UnsignedIntegers that use BigIntegers to store value | getName | {
"repo_name": "kyle0311/oliot-fc",
"path": "fc-server/src/main/java/kr/ac/kaist/resl/ltk/generated/enumerations/ROSpecEventType.java",
"license": "lgpl-2.1",
"size": 7232
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 2,305,351 |
protected List<String> getErrorSubscriptionIds() {
return this.errorSubscriptionIds;
} | List<String> function() { return this.errorSubscriptionIds; } | /**
* Gets the error subscription ids.
*/ | Gets the error subscription ids | getErrorSubscriptionIds | {
"repo_name": "kaaaaang/ews-java-api",
"path": "src/main/java/microsoft/exchange/webservices/data/GetStreamingEventsResponse.java",
"license": "mit",
"size": 3660
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,628,846 |
public DataBean setTargetDocDate(final DateTime _targetDocDate)
{
this.targetDocDate = _targetDocDate;
return this;
}
/**
* Getter method for the instance variable {@link #rate}.
*
* @return value of instance variable {@link #rate} | DataBean function(final DateTime _targetDocDate) { this.targetDocDate = _targetDocDate; return this; } /** * Getter method for the instance variable {@link #rate}. * * @return value of instance variable {@link #rate} | /**
* Sets the target doc date.
*
* @param _targetDocDate the target doc date
* @return the data bean
*/ | Sets the target doc date | setTargetDocDate | {
"repo_name": "eFaps/eFapsApp-Sales",
"path": "src/main/efaps/ESJP/org/efaps/esjp/sales/report/PaymentReport_Base.java",
"license": "apache-2.0",
"size": 37836
} | [
"org.joda.time.DateTime"
] | import org.joda.time.DateTime; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 698,601 |
boolean dispatchValueChanged(Object data, Object originalSource, Property prop,
Object oldValue, Object newValue);
boolean dispatchValueApplied(Object data, Object originalSource, Property prop, Object value); | boolean dispatchValueChanged(Object data, Object originalSource, Property prop, Object oldValue, Object newValue); boolean dispatchValueApplied(Object data, Object originalSource, Property prop, Object value); | /**
* dispatch value apply event.
* @param data the data
* @param originalSource the original source
* @param prop the property
* @param value the old value
* @return true if dispatch success. false otherwise.
*/ | dispatch value apply event | dispatchValueApplied | {
"repo_name": "LightSun/data-mediator",
"path": "data-mediator/src/main/java/com/heaven7/java/data/mediator/collector/CollectorManager.java",
"license": "apache-2.0",
"size": 5281
} | [
"com.heaven7.java.data.mediator.Property"
] | import com.heaven7.java.data.mediator.Property; | import com.heaven7.java.data.mediator.*; | [
"com.heaven7.java"
] | com.heaven7.java; | 329,542 |
@Override
public boolean getParameterAsBoolean(String key) {
try {
return Boolean.valueOf(getParameter(key));
} catch (UndefinedParameterError e) {
}
return false; // cannot happen
} | boolean function(String key) { try { return Boolean.valueOf(getParameter(key)); } catch (UndefinedParameterError e) { } return false; } | /**
* Returns a single named parameter and casts it to boolean. This method never throws an
* exception since there are no non-optional boolean parameters.
*/ | Returns a single named parameter and casts it to boolean. This method never throws an exception since there are no non-optional boolean parameters | getParameterAsBoolean | {
"repo_name": "rapidminer/rapidminer-studio",
"path": "src/main/java/com/rapidminer/operator/Operator.java",
"license": "agpl-3.0",
"size": 89124
} | [
"com.rapidminer.parameter.UndefinedParameterError"
] | import com.rapidminer.parameter.UndefinedParameterError; | import com.rapidminer.parameter.*; | [
"com.rapidminer.parameter"
] | com.rapidminer.parameter; | 2,604,753 |
public void toContainKey(final K key) {
expectNotNull(this.getValue(), "Expected null to contain the key '%s'", key);
expectTrue(this.getValue().containsKey(key), "Expected '%s' to contain key '%s'", this.getValue(), key);
} | void function(final K key) { expectNotNull(this.getValue(), STR, key); expectTrue(this.getValue().containsKey(key), STR, this.getValue(), key); } | /**
* Checks if the stored {@code Map} contains the given {@code key}.
* <p>This method throws an {@code AssertionError} if
* <ul>
* <li>the stored {@code Map} does not contain the given {@code key}</li>
* <li>the stored {@code Map} is {@code null}</li>
* </ul>
* @param key the e... | Checks if the stored Map contains the given key. This method throws an AssertionError if the stored Map does not contain the given key the stored Map is null | toContainKey | {
"repo_name": "mscharhag/oleaster",
"path": "oleaster-matcher/src/main/java/com/mscharhag/oleaster/matcher/matchers/MapMatcher.java",
"license": "apache-2.0",
"size": 4407
} | [
"com.mscharhag.oleaster.matcher.util.Expectations"
] | import com.mscharhag.oleaster.matcher.util.Expectations; | import com.mscharhag.oleaster.matcher.util.*; | [
"com.mscharhag.oleaster"
] | com.mscharhag.oleaster; | 1,321,061 |
public static IpNetAddress getSourceIpNetAddress(NetLayer netLayer,
TcpipNetAddress testAppNetAddress, String testAppUrlPath)
throws IOException
{
// create connection
NetSocket netSocket = null;
try
{
// create connection
netSocket = netLayer.createNetSocket(null, null, testAppNetAddress);
... | static IpNetAddress function(NetLayer netLayer, TcpipNetAddress testAppNetAddress, String testAppUrlPath) throws IOException { NetSocket netSocket = null; try { netSocket = netLayer.createNetSocket(null, null, testAppNetAddress); HttpUtil.getInstance(); final byte[] httpResponse = HttpUtil.get(netSocket, testAppNetAddr... | /**
* Determine the source IP address visible to a public HTTP test server.
*
* A HTTP connection will be established to a public test server that
* responses with something like
* "...<client_host_or_ip>1.2.3.4</client_host_or_ip>...".
*
* @param netLayer
* used to create the connection
... | Determine the source IP address visible to a public HTTP test server. A HTTP connection will be established to a public test server that responses with something like "...1.2.3.4..." | getSourceIpNetAddress | {
"repo_name": "B4dT0bi/silvertunnel-ng-android-test",
"path": "app/src/androidTest/java/org/silvertunnel_ng/netlib/api/HttpTestUtil.java",
"license": "gpl-3.0",
"size": 5539
} | [
"java.io.IOException",
"java.util.regex.Matcher",
"org.silvertunnel_ng.netlib.api.util.IpNetAddress",
"org.silvertunnel_ng.netlib.api.util.TcpipNetAddress",
"org.silvertunnel_ng.netlib.util.ByteArrayUtil",
"org.silvertunnel_ng.netlib.util.HttpUtil"
] | import java.io.IOException; import java.util.regex.Matcher; import org.silvertunnel_ng.netlib.api.util.IpNetAddress; import org.silvertunnel_ng.netlib.api.util.TcpipNetAddress; import org.silvertunnel_ng.netlib.util.ByteArrayUtil; import org.silvertunnel_ng.netlib.util.HttpUtil; | import java.io.*; import java.util.regex.*; import org.silvertunnel_ng.netlib.api.util.*; import org.silvertunnel_ng.netlib.util.*; | [
"java.io",
"java.util",
"org.silvertunnel_ng.netlib"
] | java.io; java.util; org.silvertunnel_ng.netlib; | 1,465,252 |
public void testEvaluate1()
{
System.out.println("evaluate1");
FourierTransform fft = new FourierTransform();
ArrayList<Double> x1 = new ArrayList<Double>( Arrays.asList(
1.0, 0.0, 1.0, 0.0 ) );
List<ComplexNumber> y1 = fft.evaluate(x1);
assertEquals( x1.size... | void function() { System.out.println(STR); FourierTransform fft = new FourierTransform(); ArrayList<Double> x1 = new ArrayList<Double>( Arrays.asList( 1.0, 0.0, 1.0, 0.0 ) ); List<ComplexNumber> y1 = fft.evaluate(x1); assertEquals( x1.size(), y1.size() ); assertEquals( new ComplexNumber( 2.0, 0.0 ), y1.get(0) ); assert... | /**
* Test of evaluate method, of class FourierTransform.
*/ | Test of evaluate method, of class FourierTransform | testEvaluate1 | {
"repo_name": "codeaudit/Foundry",
"path": "Components/CommonCore/Test/gov/sandia/cognition/math/signals/FourierTransformTest.java",
"license": "bsd-3-clause",
"size": 8924
} | [
"gov.sandia.cognition.math.ComplexNumber",
"java.util.ArrayList",
"java.util.Arrays",
"java.util.List"
] | import gov.sandia.cognition.math.ComplexNumber; import java.util.ArrayList; import java.util.Arrays; import java.util.List; | import gov.sandia.cognition.math.*; import java.util.*; | [
"gov.sandia.cognition",
"java.util"
] | gov.sandia.cognition; java.util; | 531,507 |
public static int compareStreams(InputStream is1, InputStream is2,
boolean skipws) {
byte[] data1 = new byte[100];
byte[] data2 = new byte[100];
int off1 = 0;
int off2 = 0;
int idx = 0;
try {
while (true) {
in... | static int function(InputStream is1, InputStream is2, boolean skipws) { byte[] data1 = new byte[100]; byte[] data2 = new byte[100]; int off1 = 0; int off2 = 0; int idx = 0; try { while (true) { int len1 = is1.read(data1, off1, data1.length - off1); int len2 = is2.read(data2, off2, data2.length - off2); if (off1 != 0) {... | /**
* Returns true if the contents of <tt>is1</tt> match the
* contents of <tt>is2</tt>
*/ | Returns true if the contents of is1 match the contents of is2 | compareStreams | {
"repo_name": "apache/xml-graphics-commons",
"path": "src/test/java/org/apache/xmlgraphics/util/io/Base64TestCase.java",
"license": "apache-2.0",
"size": 8541
} | [
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream"
] | import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,932,303 |
protected void setSimpleValue(Field field, Object currentObject,
String name, String value) throws Exception
{
LOGGER.trace("Setting {} to {}", value, name);
// Value should be a single element array
ReflectionUtils.transformAndSet(currentObject, name, value);
} | void function(Field field, Object currentObject, String name, String value) throws Exception { LOGGER.trace(STR, value, name); ReflectionUtils.transformAndSet(currentObject, name, value); } | /**
* Set the value in a simple property.
*
* @param field The field to set.
* @param currentObject The object being processed.
* @param name The name of the property.
* @param value The value to set.
* @throws Exception If the value cannot be set in the property.
*/ | Set the value in a simple property | setSimpleValue | {
"repo_name": "nacx/sjmvc",
"path": "src/main/java/org/sjmvc/binding/AbstractBinder.java",
"license": "mit",
"size": 8383
} | [
"java.lang.reflect.Field",
"org.sjmvc.util.ReflectionUtils"
] | import java.lang.reflect.Field; import org.sjmvc.util.ReflectionUtils; | import java.lang.reflect.*; import org.sjmvc.util.*; | [
"java.lang",
"org.sjmvc.util"
] | java.lang; org.sjmvc.util; | 1,100,286 |
@Override
public JSONObject getJSON() {
JSONObject json = new JSONObject();
for (HashMap.Entry<E, Object> entry : data.entrySet()) {
if (entry.getValue() == null)
continue;
if (children.containsKey(entry.getKey()))
json.put(entry.getKey().n... | JSONObject function() { JSONObject json = new JSONObject(); for (HashMap.Entry<E, Object> entry : data.entrySet()) { if (entry.getValue() == null) continue; if (children.containsKey(entry.getKey())) json.put(entry.getKey().name(), ((Base) entry.getValue()).getJSON()); else json.put(entry.getKey().name(), entry.getValue... | /**
* Get object's data as JSON.
*
* @return JSON of data.
*/ | Get object's data as JSON | getJSON | {
"repo_name": "DrPrykhodko/Marro",
"path": "src/com/weffle/object/BaseObject.java",
"license": "gpl-3.0",
"size": 15320
} | [
"java.util.HashMap",
"org.json.JSONObject"
] | import java.util.HashMap; import org.json.JSONObject; | import java.util.*; import org.json.*; | [
"java.util",
"org.json"
] | java.util; org.json; | 2,401,982 |
// priority elements are rather rare and short-lived, so most of there are none
if (numPriorityElements == 0) {
deque.addFirst(element);
} else if (numPriorityElements == deque.size()) {
// no non-priority elements
deque.add(element);
} else {
// remove all priority elements
final ArrayDeque<T> p... | if (numPriorityElements == 0) { deque.addFirst(element); } else if (numPriorityElements == deque.size()) { deque.add(element); } else { final ArrayDeque<T> priorPriority = new ArrayDeque<>(numPriorityElements); for (int index = 0; index < numPriorityElements; index++) { priorPriority.addFirst(deque.poll()); } deque.add... | /**
* Adds a priority element to this deque, such that it will be polled after all existing priority elements but
* before any non-priority element.
*
* @param element the element to add
*/ | Adds a priority element to this deque, such that it will be polled after all existing priority elements but before any non-priority element | addPriorityElement | {
"repo_name": "greghogan/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/PrioritizedDeque.java",
"license": "apache-2.0",
"size": 7556
} | [
"java.util.ArrayDeque"
] | import java.util.ArrayDeque; | import java.util.*; | [
"java.util"
] | java.util; | 2,715,597 |
public String getSwitchValue(String switchString, String defaultValue) {
String value = getSwitchValue(switchString);
return TextUtils.isEmpty(value) ? defaultValue : value;
} | String function(String switchString, String defaultValue) { String value = getSwitchValue(switchString); return TextUtils.isEmpty(value) ? defaultValue : value; } | /**
* Return the value associated with the given switch, or {@code defaultValue} if the switch
* was not specified.
* @param switchString The switch key to lookup. It should NOT start with '--' !
* @param defaultValue The default value to return if the switch isn't set.
* @return Switch value, ... | Return the value associated with the given switch, or defaultValue if the switch was not specified | getSwitchValue | {
"repo_name": "imesong/chromium_webview",
"path": "java/src/org/chromium/base/CommandLine.java",
"license": "bsd-3-clause",
"size": 14786
} | [
"android.text.TextUtils"
] | import android.text.TextUtils; | import android.text.*; | [
"android.text"
] | android.text; | 283,510 |
@NotNull
ColumnMetadata getColumnMetadata(TableHandle tableHandle, ColumnHandle columnHandle); | ColumnMetadata getColumnMetadata(TableHandle tableHandle, ColumnHandle columnHandle); | /**
* Gets the metadata for the specified table column.
*
* @throws RuntimeException if table or column handles are no longer valid
*/ | Gets the metadata for the specified table column | getColumnMetadata | {
"repo_name": "vishalsan/presto",
"path": "presto-main/src/main/java/com/facebook/presto/metadata/Metadata.java",
"license": "apache-2.0",
"size": 3843
} | [
"com.facebook.presto.spi.ColumnHandle",
"com.facebook.presto.spi.ColumnMetadata",
"com.facebook.presto.spi.TableHandle"
] | import com.facebook.presto.spi.ColumnHandle; import com.facebook.presto.spi.ColumnMetadata; import com.facebook.presto.spi.TableHandle; | import com.facebook.presto.spi.*; | [
"com.facebook.presto"
] | com.facebook.presto; | 970,477 |
public void setComposite(Composite comp) {
if (composite == comp) {
return;
}
int newCompState;
CompositeType newCompType;
if (comp instanceof AlphaComposite) {
AlphaComposite alphacomp = (AlphaComposite) comp;
newCompType = CompositeType.f... | void function(Composite comp) { if (composite == comp) { return; } int newCompState; CompositeType newCompType; if (comp instanceof AlphaComposite) { AlphaComposite alphacomp = (AlphaComposite) comp; newCompType = CompositeType.forAlphaComposite(alphacomp); if (newCompType == CompositeType.SrcOverNoEa) { if (paintState... | /**
* Sets the Composite in the current graphics state. Composite is used
* in all drawing methods such as drawImage, drawString, drawPath,
* and fillPath. It specifies how new pixels are to be combined with
* the existing pixels on the graphics device in the rendering process.
* @param comp T... | Sets the Composite in the current graphics state. Composite is used in all drawing methods such as drawImage, drawString, drawPath, and fillPath. It specifies how new pixels are to be combined with the existing pixels on the graphics device in the rendering process | setComposite | {
"repo_name": "universsky/openjdk",
"path": "jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java",
"license": "gpl-2.0",
"size": 134380
} | [
"java.awt.AlphaComposite",
"java.awt.Composite",
"java.awt.Transparency"
] | import java.awt.AlphaComposite; import java.awt.Composite; import java.awt.Transparency; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,589,042 |
public boolean equals(Object obj)
{
if (obj == this)
{
return true;
}
if (!(obj instanceof X500Name || obj instanceof ASN1Sequence))
{
return false;
}
DERObject derO = ((DEREncodable)obj).getDERObject();
if (this.... | boolean function(Object obj) { if (obj == this) { return true; } if (!(obj instanceof X500Name obj instanceof ASN1Sequence)) { return false; } DERObject derO = ((DEREncodable)obj).getDERObject(); if (this.getDERObject().equals(derO)) { return true; } try { return style.areEqual(this, new X500Name(ASN1Sequence.getInstan... | /**
* test for equality - note: case is ignored.
*/ | test for equality - note: case is ignored | equals | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "mediatek/frameworks/base/tests/net/tests/src/mediatek/net/libcore/external/bouncycastle/asn1/x500/X500Name.java",
"license": "gpl-2.0",
"size": 8658
} | [
"org.bouncycastle.asn1.ASN1Sequence",
"org.bouncycastle.asn1.DEREncodable",
"org.bouncycastle.asn1.DERObject"
] | import org.bouncycastle.asn1.ASN1Sequence; import org.bouncycastle.asn1.DEREncodable; import org.bouncycastle.asn1.DERObject; | import org.bouncycastle.asn1.*; | [
"org.bouncycastle.asn1"
] | org.bouncycastle.asn1; | 1,233,098 |
@Test
public void testWeatherBaroTempMin() {
String message = " PKT:SID=11;PC=68029;MT=8;MGID=10;MID=3;MD=000040000000;30bd729d";
SHCMessage shcMessage = new SHCMessage(message, packet);
List<Type> values = shcMessage.getData().getOpenHABTypes();
assertEquals(0, ((DecimalTyp... | void function() { String message = STR; SHCMessage shcMessage = new SHCMessage(message, packet); List<Type> values = shcMessage.getData().getOpenHABTypes(); assertEquals(0, ((DecimalType) values.get(0)).intValue()); assertEquals(-32768, ((DecimalType) values.get(1)).intValue()); } | /**
* test data is: weather barometric pressure: 0 temp: -32768
*/ | test data is: weather barometric pressure: 0 temp: -32768 | testWeatherBaroTempMin | {
"repo_name": "vgoldman/openhab",
"path": "bundles/binding/org.openhab.binding.smarthomatic/src/test/java/org/openhab/binding/smarthomatic/TestSHCMessage.java",
"license": "epl-1.0",
"size": 24829
} | [
"java.util.List",
"org.junit.Assert",
"org.openhab.binding.smarthomatic.internal.SHCMessage",
"org.openhab.core.library.types.DecimalType",
"org.openhab.core.types.Type"
] | import java.util.List; import org.junit.Assert; import org.openhab.binding.smarthomatic.internal.SHCMessage; import org.openhab.core.library.types.DecimalType; import org.openhab.core.types.Type; | import java.util.*; import org.junit.*; import org.openhab.binding.smarthomatic.internal.*; import org.openhab.core.library.types.*; import org.openhab.core.types.*; | [
"java.util",
"org.junit",
"org.openhab.binding",
"org.openhab.core"
] | java.util; org.junit; org.openhab.binding; org.openhab.core; | 2,526,933 |
@FIXVersion(introduced="4.4")
@TagNumRef(tagNum=TagNum.TargetStrategy)
public Integer getTargetStrategy() {
return targetStrategy;
} | @FIXVersion(introduced="4.4") @TagNumRef(tagNum=TagNum.TargetStrategy) Integer function() { return targetStrategy; } | /**
* Message field getter.
* @return field value
*/ | Message field getter | getTargetStrategy | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/NewOrderCrossMsg.java",
"license": "gpl-3.0",
"size": 84522
} | [
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.TagNum"
] | import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum; | import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*; | [
"net.hades.fix"
] | net.hades.fix; | 2,468,170 |
@NonNull
private static String getNEWS_AUTHOR_NAME(@NonNull Context context) {
if (newsAuthorName == null) {
newsAuthorName = context.getResources().getString(R.string.ca_sto_news_author_name);
}
return newsAuthorName;
}
@Nullable
private static String newsColor = null; | static String function(@NonNull Context context) { if (newsAuthorName == null) { newsAuthorName = context.getResources().getString(R.string.ca_sto_news_author_name); } return newsAuthorName; } private static String newsColor = null; | /**
* Override if multiple {@link CaSTOProvider} implementations in same app.
*/ | Override if multiple <code>CaSTOProvider</code> implementations in same app | getNEWS_AUTHOR_NAME | {
"repo_name": "mtransitapps/commons-android",
"path": "src/main/java/org/mtransit/android/commons/provider/CaSTOProvider.java",
"license": "apache-2.0",
"size": 27866
} | [
"android.content.Context",
"androidx.annotation.NonNull"
] | import android.content.Context; import androidx.annotation.NonNull; | import android.content.*; import androidx.annotation.*; | [
"android.content",
"androidx.annotation"
] | android.content; androidx.annotation; | 157,740 |
@Deployment
public void testBoundaryEvent() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("boundaryEventProcess");
// Complete the task with the boundary-event on it
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).single... | void function() { ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(STR); Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); assertNotNull(task); taskService.complete(task.getId()); assertEquals(0L, runtimeService.createProcessInstanceQuery().pr... | /**
* Test to validate fix for ACT-1399: Boundary-event and event-based auditing
*/ | Test to validate fix for ACT-1399: Boundary-event and event-based auditing | testBoundaryEvent | {
"repo_name": "stephraleigh/flowable-engine",
"path": "modules/flowable-engine/src/test/java/org/flowable/engine/test/history/HistoricActivityInstanceTest.java",
"license": "apache-2.0",
"size": 23597
} | [
"org.flowable.engine.history.HistoricActivityInstance",
"org.flowable.engine.runtime.Execution",
"org.flowable.engine.runtime.ProcessInstance",
"org.flowable.engine.task.Task"
] | import org.flowable.engine.history.HistoricActivityInstance; import org.flowable.engine.runtime.Execution; import org.flowable.engine.runtime.ProcessInstance; import org.flowable.engine.task.Task; | import org.flowable.engine.history.*; import org.flowable.engine.runtime.*; import org.flowable.engine.task.*; | [
"org.flowable.engine"
] | org.flowable.engine; | 2,802,319 |
private EncryptionZoneInt getEncryptionZoneForPath(INodesInPath iip)
throws IOException{
assert dir.hasReadLock();
Preconditions.checkNotNull(iip);
if (!hasCreatedEncryptionZone()) {
return null;
}
int snapshotID = iip.getPathSnapshotId();
for (int i = iip.length() - 1; i >= 0; i... | EncryptionZoneInt function(INodesInPath iip) throws IOException{ assert dir.hasReadLock(); Preconditions.checkNotNull(iip); if (!hasCreatedEncryptionZone()) { return null; } int snapshotID = iip.getPathSnapshotId(); for (int i = iip.length() - 1; i >= 0; i--) { final INode inode = iip.getINode(i); if (inode == null !in... | /**
* Looks up the EncryptionZoneInt for a path within an encryption zone.
* Returns null if path is not within an EZ.
* <p/>
* Called while holding the FSDirectory lock.
*/ | Looks up the EncryptionZoneInt for a path within an encryption zone. Returns null if path is not within an EZ. Called while holding the FSDirectory lock | getEncryptionZoneForPath | {
"repo_name": "GeLiXin/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/EncryptionZoneManager.java",
"license": "apache-2.0",
"size": 27131
} | [
"com.google.common.base.Preconditions",
"com.google.protobuf.InvalidProtocolBufferException",
"java.io.IOException",
"org.apache.hadoop.fs.XAttr",
"org.apache.hadoop.hdfs.protocol.proto.HdfsProtos",
"org.apache.hadoop.hdfs.protocolPB.PBHelperClient",
"org.apache.hadoop.hdfs.server.namenode.snapshot.Snap... | import com.google.common.base.Preconditions; import com.google.protobuf.InvalidProtocolBufferException; import java.io.IOException; import org.apache.hadoop.fs.XAttr; import org.apache.hadoop.hdfs.protocol.proto.HdfsProtos; import org.apache.hadoop.hdfs.protocolPB.PBHelperClient; import org.apache.hadoop.hdfs.server.na... | import com.google.common.base.*; import com.google.protobuf.*; import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.*; import org.apache.hadoop.hdfs.protocol.proto.*; import org.apache.hadoop.hdfs.server.namenode.snapshot.*; | [
"com.google.common",
"com.google.protobuf",
"java.io",
"org.apache.hadoop"
] | com.google.common; com.google.protobuf; java.io; org.apache.hadoop; | 746,083 |
public Date getSuppressedUntil() {
return m_delegate.getSuppressedUntil();
} | Date function() { return m_delegate.getSuppressedUntil(); } | /**
* <p>Getter for the field <code>suppressedUntil</code>.</p>
*
* @return a {@link java.util.Date} object.
*/ | Getter for the field <code>suppressedUntil</code> | getSuppressedUntil | {
"repo_name": "peternixon/opennms-mirror",
"path": "opennms-webapp/src/main/java/org/opennms/web/alarm/Alarm.java",
"license": "gpl-2.0",
"size": 9542
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,998,696 |
@Override
protected String handleActionSolve(String program, String options, List<String> filesPath) {
Log.i("DlvSevice", "Launch service");
File file = new File(this.getFilesDir(), FILENAME);
FileOutputStream outputStream;
try {
outputStream = new FileOutputStr... | String function(String program, String options, List<String> filesPath) { Log.i(STR, STR); File file = new File(this.getFilesDir(), FILENAME); FileOutputStream outputStream; try { outputStream = new FileOutputStream(file); outputStream.write(program.getBytes()); outputStream.close(); } catch (Exception e) { e.printStac... | /** Call dlvMain native function in separate worker thread
* @param program appropriate String containing a DLV program
* @param options appropriate String containing the options for DLV program
* @return String result computed
*/ | Call dlvMain native function in separate worker thread | handleActionSolve | {
"repo_name": "Tiglas/pickup-planner",
"path": "vehicle_app/embasp/src/main/java/it/unical/mat/embasp/dlv/DLVService.java",
"license": "mit",
"size": 2759
} | [
"android.util.Log",
"java.io.File",
"java.io.FileOutputStream",
"java.util.List",
"java.util.concurrent.TimeUnit"
] | import android.util.Log; import java.io.File; import java.io.FileOutputStream; import java.util.List; import java.util.concurrent.TimeUnit; | import android.util.*; import java.io.*; import java.util.*; import java.util.concurrent.*; | [
"android.util",
"java.io",
"java.util"
] | android.util; java.io; java.util; | 628,299 |
public static String[] getSupportedOutputFormats( ) throws ChartException
{
String[][] outputFormatArray = PluginSettings.instance( )
.getRegisteredOutputFormats( );
String[] formats = new String[outputFormatArray.length];
for ( int i = 0; i < formats.length; i++ )
{
formats[i] = outputFormatArray[i... | static String[] function( ) throws ChartException { String[][] outputFormatArray = PluginSettings.instance( ) .getRegisteredOutputFormats( ); String[] formats = new String[outputFormatArray.length]; for ( int i = 0; i < formats.length; i++ ) { formats[i] = outputFormatArray[i][0]; } return formats; } | /**
* Gets all supported output formats.
*
* @return string array of output formats
* @since 2.2
*/ | Gets all supported output formats | getSupportedOutputFormats | {
"repo_name": "Charling-Huang/birt",
"path": "chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/util/ChartUtil.java",
"license": "epl-1.0",
"size": 73736
} | [
"org.eclipse.birt.chart.exception.ChartException"
] | import org.eclipse.birt.chart.exception.ChartException; | import org.eclipse.birt.chart.exception.*; | [
"org.eclipse.birt"
] | org.eclipse.birt; | 815,994 |
private void checkOverloadMethodsGrouping(DetailAST objectBlock) {
final int allowedDistance = 1;
DetailAST currentToken = objectBlock.getFirstChild();
final Map<String, Integer> methodIndexMap = new HashMap<>();
final Map<String, Integer> methodLineNumberMap = new HashMap<>();
... | void function(DetailAST objectBlock) { final int allowedDistance = 1; DetailAST currentToken = objectBlock.getFirstChild(); final Map<String, Integer> methodIndexMap = new HashMap<>(); final Map<String, Integer> methodLineNumberMap = new HashMap<>(); int currentIndex = 0; while (currentToken != null) { if (currentToken... | /**
* Checks that if overload methods are grouped together they should not be
* separated from each other.
* @param objectBlock
* is a class, interface or enum object block.
*/ | Checks that if overload methods are grouped together they should not be separated from each other | checkOverloadMethodsGrouping | {
"repo_name": "attatrol/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheck.java",
"license": "lgpl-2.1",
"size": 4293
} | [
"com.puppycrawl.tools.checkstyle.api.DetailAST",
"com.puppycrawl.tools.checkstyle.api.TokenTypes",
"java.util.HashMap",
"java.util.Map"
] | import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import java.util.HashMap; import java.util.Map; | import com.puppycrawl.tools.checkstyle.api.*; import java.util.*; | [
"com.puppycrawl.tools",
"java.util"
] | com.puppycrawl.tools; java.util; | 2,683,386 |
public static void deleteDirectory(IProgressMonitor monitor, File directory, File base, int step)
throws IOException {
if (!directory.exists()) {
return;
}
cleanDirectory(monitor, directory, base, step);
if (!directory.delete()) {
String message = "Unable to delete directory " + directory +... | static void function(IProgressMonitor monitor, File directory, File base, int step) throws IOException { if (!directory.exists()) { return; } cleanDirectory(monitor, directory, base, step); if (!directory.delete()) { String message = STR + directory + "."; throw new IOException(message); } } | /**
* Recursively delete a directory.
*
* @param directory directory to delete
* @throws IOException in case deletion is unsuccessful
*/ | Recursively delete a directory | deleteDirectory | {
"repo_name": "ecd-plugin/ecd",
"path": "org.sf.feeling.decompiler/src/org/sf/feeling/decompiler/util/FileUtil.java",
"license": "epl-1.0",
"size": 15547
} | [
"java.io.File",
"java.io.IOException",
"org.eclipse.core.runtime.IProgressMonitor"
] | import java.io.File; import java.io.IOException; import org.eclipse.core.runtime.IProgressMonitor; | import java.io.*; import org.eclipse.core.runtime.*; | [
"java.io",
"org.eclipse.core"
] | java.io; org.eclipse.core; | 1,836,615 |
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn("billid");
eiColumn.setFieldLength(32);
eiColumn.setDescName("提单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("billsubid");
eiColumn.setFieldLength(32);
eiColumn.setDescName("提单子项号");
eiMetadata.addMeta(e... | void function() { EiColumn eiColumn; eiColumn = new EiColumn(STR); eiColumn.setFieldLength(32); eiColumn.setDescName("提单号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFieldLength(32); eiColumn.setDescName("提单子项号"); eiMetadata.addMeta(eiColumn); eiColumn = new EiColumn(STR); eiColumn.setFie... | /**
* initialize the metadata
*/ | initialize the metadata | initMetaData | {
"repo_name": "stserp/erp1",
"path": "source/src/com/quartz/sql/TJkBillInfoD.java",
"license": "apache-2.0",
"size": 13988
} | [
"com.baosight.iplat4j.core.ei.EiColumn"
] | import com.baosight.iplat4j.core.ei.EiColumn; | import com.baosight.iplat4j.core.ei.*; | [
"com.baosight.iplat4j"
] | com.baosight.iplat4j; | 2,592,171 |
public static void shuffle(final long[] array) {
shuffle(array, new Random());
} | static void function(final long[] array) { shuffle(array, new Random()); } | /**
* Randomly permutes the elements of the specified array using the Fisher-Yates algorithm.
*
* @param array the array to shuffle
* @see <a href="https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle algorithm</a>
* @since 3.6
*/ | Randomly permutes the elements of the specified array using the Fisher-Yates algorithm | shuffle | {
"repo_name": "ManfredTremmel/gwt-commons-lang3",
"path": "src/main/java/org/apache/commons/lang3/ArrayUtils.java",
"license": "apache-2.0",
"size": 350834
} | [
"java.util.Random"
] | import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 433,163 |
public static void setAmasStepNumber(int stepNumber) {
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
lc.putProperty("amasStepNumber", Integer.toString(stepNumber));
} | static void function(int stepNumber) { LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); lc.putProperty(STR, Integer.toString(stepNumber)); } | /**
* Sets the amasStepNumber
*
* @param stepNumber
*/ | Sets the amasStepNumber | setAmasStepNumber | {
"repo_name": "IRIT-SMAC/agent-tooling",
"path": "agent-logging/src/main/java/fr/irit/smac/libs/tooling/logging/AgentLog.java",
"license": "lgpl-3.0",
"size": 25596
} | [
"ch.qos.logback.classic.LoggerContext",
"org.slf4j.LoggerFactory"
] | import ch.qos.logback.classic.LoggerContext; import org.slf4j.LoggerFactory; | import ch.qos.logback.classic.*; import org.slf4j.*; | [
"ch.qos.logback",
"org.slf4j"
] | ch.qos.logback; org.slf4j; | 2,668,533 |
ClassificationQuery orderByCustomAttribute(String num, SortDirection sortDirection)
throws InvalidArgumentException; | ClassificationQuery orderByCustomAttribute(String num, SortDirection sortDirection) throws InvalidArgumentException; | /**
* Sort the query result by a custom.
*
* @param num the number of the custom as String (eg "4")
* @param sortDirection Determines whether the result is sorted in ascending or descending order.
* If sortDirection is null, the result is sorted in ascending order
* @return the query
* @throws ... | Sort the query result by a custom | orderByCustomAttribute | {
"repo_name": "BVier/Taskana",
"path": "lib/taskana-core/src/main/java/pro/taskana/ClassificationQuery.java",
"license": "apache-2.0",
"size": 8254
} | [
"pro.taskana.exceptions.InvalidArgumentException"
] | import pro.taskana.exceptions.InvalidArgumentException; | import pro.taskana.exceptions.*; | [
"pro.taskana.exceptions"
] | pro.taskana.exceptions; | 1,844,705 |
private void checkBlockForShadow() {
Vec3d or = this.quadList[1].vertexPositions[0].vector3D;
double x = this.quadList[0].vertexPositions[1].vector3D.x, y = this.quadList[1].vertexPositions[3].vector3D.y,
z = this.quadList[1].vertexPositions[1].vector3D.z;
if (x - or.x < 0)
... | void function() { Vec3d or = this.quadList[1].vertexPositions[0].vector3D; double x = this.quadList[0].vertexPositions[1].vector3D.x, y = this.quadList[1].vertexPositions[3].vector3D.y, z = this.quadList[1].vertexPositions[1].vector3D.z; if (x - or.x < 0) this.flipFaces(); if (y - or.y > 0) this.flipFaces(); if (z - or... | /**
* Check and correct the problem of dark texture.
*/ | Check and correct the problem of dark texture | checkBlockForShadow | {
"repo_name": "Leviathan-Studio/CraftStudioAPI",
"path": "src/main/java/com/leviathanstudio/craftstudio/client/model/CSModelBox.java",
"license": "apache-2.0",
"size": 13540
} | [
"net.minecraft.util.math.Vec3d"
] | import net.minecraft.util.math.Vec3d; | import net.minecraft.util.math.*; | [
"net.minecraft.util"
] | net.minecraft.util; | 694,185 |
@Nonnull
HttpClient getInternalService(@Nonnull String name); | HttpClient getInternalService(@Nonnull String name); | /**
* Get an internal Spinnaker service {@link HttpClient}.
*
* @param name The name of the Spinnaker service you want to talk to
* @return The internal service client
*/ | Get an internal Spinnaker service <code>HttpClient</code> | getInternalService | {
"repo_name": "spinnaker/kork",
"path": "kork-plugins-api/src/main/java/com/netflix/spinnaker/kork/plugins/api/httpclient/HttpClientRegistry.java",
"license": "apache-2.0",
"size": 1996
} | [
"javax.annotation.Nonnull"
] | import javax.annotation.Nonnull; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 1,898,020 |
public List<Alert> getAlertsMeta(boolean includeSharedAlerts) throws IOException, TokenExpiredException {
String requestUrl = RESOURCE + "/meta?shared=" + includeSharedAlerts;
ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null);
assertVali... | List<Alert> function(boolean includeSharedAlerts) throws IOException, TokenExpiredException { String requestUrl = RESOURCE + STR + includeSharedAlerts; ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null); assertValidResponse(response, requestUrl); return fromJson(r... | /**
* Returns all alerts via the meta endpoint.
*
* @param includeSharedAlerts flag for shared alerts
*
* @return The list of alerts. Will never be null, but may be empty.
*
* @throws IOException If the server cannot be reached.
* @throws TokenExpiredException If the tok... | Returns all alerts via the meta endpoint | getAlertsMeta | {
"repo_name": "SalesforceEng/Argus",
"path": "ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/AlertService.java",
"license": "bsd-3-clause",
"size": 23177
} | [
"com.fasterxml.jackson.core.type.TypeReference",
"com.salesforce.dva.argus.sdk.ArgusHttpClient",
"com.salesforce.dva.argus.sdk.entity.Alert",
"com.salesforce.dva.argus.sdk.exceptions.TokenExpiredException",
"java.io.IOException",
"java.util.List"
] | import com.fasterxml.jackson.core.type.TypeReference; import com.salesforce.dva.argus.sdk.ArgusHttpClient; import com.salesforce.dva.argus.sdk.entity.Alert; import com.salesforce.dva.argus.sdk.exceptions.TokenExpiredException; import java.io.IOException; import java.util.List; | import com.fasterxml.jackson.core.type.*; import com.salesforce.dva.argus.sdk.*; import com.salesforce.dva.argus.sdk.entity.*; import com.salesforce.dva.argus.sdk.exceptions.*; import java.io.*; import java.util.*; | [
"com.fasterxml.jackson",
"com.salesforce.dva",
"java.io",
"java.util"
] | com.fasterxml.jackson; com.salesforce.dva; java.io; java.util; | 1,489,344 |
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
mFirstCall = true;
}
| void function(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); mFirstCall = true; } | /**
* Pseudo-constructor for custom serialization support.
*/ | Pseudo-constructor for custom serialization support | readObject | {
"repo_name": "Imkal/Book-Catalogue",
"path": "src/com/eleybourn/bookcatalogue/goodreads/ImportAllTask.java",
"license": "gpl-3.0",
"size": 21245
} | [
"java.io.IOException",
"java.io.ObjectInputStream"
] | import java.io.IOException; import java.io.ObjectInputStream; | import java.io.*; | [
"java.io"
] | java.io; | 2,472,841 |
public void createTrainingInstancesThreaded() throws Exception {
//create dataset from attributes and numDocs
trainingInstances = new Instances("Instances", attributes,
eventList.size());
//initialize/fetch data
List<Instance> generatedInstances = new ArrayList<Instance>();
int threadsToUse... | void function() throws Exception { trainingInstances = new Instances(STR, attributes, eventList.size()); List<Instance> generatedInstances = new ArrayList<Instance>(); int threadsToUse = numThreads; int numInstances = eventList.size(); if (numThreads > numInstances) { threadsToUse = numInstances; } int div = numInstanc... | /**
* Threaded creation of training instances from gathered data
* @throws Exception
*/ | Threaded creation of training instances from gathered data | createTrainingInstancesThreaded | {
"repo_name": "jbdatko/pes",
"path": "anonymouth/src/edu/drexel/psal/jstylo/generics/InstancesBuilder.java",
"license": "gpl-3.0",
"size": 25475
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 33,033 |
public CcLibraryHelper addPicStaticLibraries(Iterable<LibraryToLink> libraries) {
Iterables.addAll(picStaticLibraries, libraries);
return this;
} | CcLibraryHelper function(Iterable<LibraryToLink> libraries) { Iterables.addAll(picStaticLibraries, libraries); return this; } | /**
* Add the corresponding files as static libraries into the linker outputs (i.e., after the linker
* action) - this makes them available for linking to binary rules that depend on this rule.
*/ | Add the corresponding files as static libraries into the linker outputs (i.e., after the linker action) - this makes them available for linking to binary rules that depend on this rule | addPicStaticLibraries | {
"repo_name": "bitemyapp/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibraryHelper.java",
"license": "apache-2.0",
"size": 40525
} | [
"com.google.common.collect.Iterables",
"com.google.devtools.build.lib.rules.cpp.LinkerInputs"
] | import com.google.common.collect.Iterables; import com.google.devtools.build.lib.rules.cpp.LinkerInputs; | import com.google.common.collect.*; import com.google.devtools.build.lib.rules.cpp.*; | [
"com.google.common",
"com.google.devtools"
] | com.google.common; com.google.devtools; | 749,290 |
private void setupDestinationFile(State state, InnerState innerState)
throws StopRequest {
if (state.mFilename != null) { // only true if we've already run a
// thread for this download
if (!Helpers.isFilenameValid(state.mFilename)) {
... | void function(State state, InnerState innerState) throws StopRequest { if (state.mFilename != null) { if (!Helpers.isFilenameValid(state.mFilename)) { throw new StopRequest(DownloaderService.STATUS_FILE_ERROR, STR); } File f = new File(state.mFilename); if (f.exists()) { long fileLength = f.length(); if (fileLength == ... | /**
* Prepare the destination file to receive data. If the file already exists,
* we'll set up appropriately for resumption.
*/ | Prepare the destination file to receive data. If the file already exists, we'll set up appropriately for resumption | setupDestinationFile | {
"repo_name": "reven86/dfg-gameplay",
"path": "client/source/_android/extras/market_apk_expansion/downloader_library/src/com/google/android/vending/expansion/downloader/impl/DownloadThread.java",
"license": "apache-2.0",
"size": 38480
} | [
"com.google.android.vending.expansion.downloader.Helpers",
"java.io.File",
"java.io.FileNotFoundException",
"java.io.FileOutputStream"
] | import com.google.android.vending.expansion.downloader.Helpers; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; | import com.google.android.vending.expansion.downloader.*; import java.io.*; | [
"com.google.android",
"java.io"
] | com.google.android; java.io; | 160,227 |
@ColorInt public int getLineColor() {
return lineColor;
} | @ColorInt int function() { return lineColor; } | /**
* Get the color of the sparkline
*/ | Get the color of the sparkline | getLineColor | {
"repo_name": "robinhood/spark",
"path": "spark/src/main/java/com/robinhood/spark/SparkView.java",
"license": "apache-2.0",
"size": 30460
} | [
"android.support.annotation.ColorInt"
] | import android.support.annotation.ColorInt; | import android.support.annotation.*; | [
"android.support"
] | android.support; | 1,388,537 |
public boolean contains(Point2D p) {
Coordinate coord = new Coordinate(p.getX(), p.getY());
Geometry point = geometry.getFactory().createPoint(coord);
return geometry.contains(point);
} | boolean function(Point2D p) { Coordinate coord = new Coordinate(p.getX(), p.getY()); Geometry point = geometry.getFactory().createPoint(coord); return geometry.contains(point); } | /**
* Tests if a specified {@link Point2D} is inside the boundary of the
* <code>Shape</code>.
*
* @param p a specified <code>Point2D</code>
*
* @return <code>true</code> if the specified <code>Point2D</code> is
* inside the boundary of the <code>Shape</code>;
* <... | Tests if a specified <code>Point2D</code> is inside the boundary of the <code>Shape</code> | contains | {
"repo_name": "iCarto/siga",
"path": "libFMap/src/com/iver/cit/gvsig/fmap/core/gt2/FLiteShape.java",
"license": "gpl-3.0",
"size": 32847
} | [
"com.vividsolutions.jts.geom.Coordinate",
"com.vividsolutions.jts.geom.Geometry",
"java.awt.geom.Point2D"
] | import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Geometry; import java.awt.geom.Point2D; | import com.vividsolutions.jts.geom.*; import java.awt.geom.*; | [
"com.vividsolutions.jts",
"java.awt"
] | com.vividsolutions.jts; java.awt; | 109,816 |
ExecRow setBeforeFirstRow() throws StandardException; | ExecRow setBeforeFirstRow() throws StandardException; | /**
* Sets the current position to before the first row and returns NULL
* because there is no current row.
*
* @return NULL.
*
* @exception StandardException Thrown on failure
* @see Row
*/ | Sets the current position to before the first row and returns NULL because there is no current row | setBeforeFirstRow | {
"repo_name": "lpxz/grail-derby104",
"path": "java/engine/org/apache/derby/iapi/sql/ResultSet.java",
"license": "apache-2.0",
"size": 10329
} | [
"org.apache.derby.iapi.error.StandardException",
"org.apache.derby.iapi.sql.execute.ExecRow"
] | import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.sql.execute.ExecRow; | import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.sql.execute.*; | [
"org.apache.derby"
] | org.apache.derby; | 510,413 |
private static <T> void testExhaustively(
Ordering<? super T> ordering, T... strictlyOrderedElements) {
checkArgument(strictlyOrderedElements.length >= 3, "strictlyOrderedElements "
+ "requires at least 3 elements");
List<T> list = Arrays.asList(strictlyOrderedElements);
// for use calling ... | static <T> void function( Ordering<? super T> ordering, T... strictlyOrderedElements) { checkArgument(strictlyOrderedElements.length >= 3, STR + STR); List<T> list = Arrays.asList(strictlyOrderedElements); T[] emptyArray = Platform.newArray(strictlyOrderedElements, 0); @SuppressWarnings(STR) Scenario<T> starter = new S... | /**
* Requires at least 3 elements in {@code strictlyOrderedElements} in order to
* test the varargs version of min/max.
*/ | Requires at least 3 elements in strictlyOrderedElements in order to test the varargs version of min/max | testExhaustively | {
"repo_name": "sensui/guava-libraries",
"path": "guava-tests/test/com/google/common/collect/OrderingTest.java",
"license": "apache-2.0",
"size": 40157
} | [
"com.google.common.base.Preconditions",
"java.util.Arrays",
"java.util.List"
] | import com.google.common.base.Preconditions; import java.util.Arrays; import java.util.List; | import com.google.common.base.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 418,061 |
private ArrayList<FileSummary.Section> getSubSectionsOfName(
ArrayList<FileSummary.Section> sections, SectionName name) {
ArrayList<FileSummary.Section> subSec = new ArrayList<>();
for (FileSummary.Section s : sections) {
String n = s.getName();
SectionName sectionName = SectionN... | ArrayList<FileSummary.Section> function( ArrayList<FileSummary.Section> sections, SectionName name) { ArrayList<FileSummary.Section> subSec = new ArrayList<>(); for (FileSummary.Section s : sections) { String n = s.getName(); SectionName sectionName = SectionName.fromString(n); if (sectionName == name) { subSec.add(s);... | /**
* Given an ArrayList of Section's, return all Section's with the given
* name, or an empty list if none are found.
* @param sections ArrayList of the Section's to search though
* @param name The name of the Sections to search for
* @return ArrayList of the sections matching the given name
... | Given an ArrayList of Section's, return all Section's with the given name, or an empty list if none are found | getSubSectionsOfName | {
"repo_name": "steveloughran/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImageFormatProtobuf.java",
"license": "apache-2.0",
"size": 38765
} | [
"java.util.ArrayList",
"org.apache.hadoop.hdfs.server.namenode.FsImageProto"
] | import java.util.ArrayList; import org.apache.hadoop.hdfs.server.namenode.FsImageProto; | import java.util.*; import org.apache.hadoop.hdfs.server.namenode.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 146,233 |
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayLi... | void function() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } | /**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTBVA
*
* @mbggenerated Tue Dec 14 16:34:04 CST 2010
*/ | This method was generated by MyBatis Generator. This method corresponds to the database table ACTBVA | clear | {
"repo_name": "rongshang/fbi-cbs2",
"path": "common/main/java/cbs/repository/account/maininfo/model/ActbvaExample.java",
"license": "unlicense",
"size": 36010
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 3,635 |
public ResultSet executeSyncSelectTime (
Object postid) throws Exception {
return
this.getQuery(kSelectTimeName).executeSync(
postid);
}
// Query: SelectUserId
// Description:
// selects a post's owner user_id
// Parepared Statement:
// SELECT user_id FROM ig_app_data.posts WH... | ResultSet function ( Object postid) throws Exception { return this.getQuery(kSelectTimeName).executeSync( postid); } | /**
* executeSyncSelectTime
* BLOCKING-METHOD: blocks till the ResultSet is ready
* executes SelectTime Query synchronously
* @param postid
* @return ResultSet
* @throws Exception
*/ | executeSyncSelectTime executes SelectTime Query synchronously | executeSyncSelectTime | {
"repo_name": "vangav/vos_instagram",
"path": "app/com/vangav/vos_instagram/cassandra_keyspaces/ig_app_data/Posts.java",
"license": "mit",
"size": 24387
} | [
"com.datastax.driver.core.ResultSet"
] | import com.datastax.driver.core.ResultSet; | import com.datastax.driver.core.*; | [
"com.datastax.driver"
] | com.datastax.driver; | 2,420,928 |
void enqueueMessage(Collection<String> recipients, String subject, String mailGroupId, String message, String from,
MailAttachment... attachments); | void enqueueMessage(Collection<String> recipients, String subject, String mailGroupId, String message, String from, MailAttachment... attachments); | /**
* Enqueues a mail message to multiple recipients.
*
* @param recipients
* mail recipients.
* @param subject
* mail subject.
* @param mailGroupId
* the id of the mails which are with the same {@link MailMessage}. Used for querying more mails at once
* @param message... | Enqueues a mail message to multiple recipients | enqueueMessage | {
"repo_name": "SirmaITT/conservation-space-1.7.0",
"path": "docker/sirma-platform/platform/seip-parent/extensions/mail-sender/src/main/java/com/sirma/itt/seip/mail/MailService.java",
"license": "lgpl-3.0",
"size": 4830
} | [
"com.sirma.itt.seip.mail.attachments.MailAttachment",
"java.util.Collection"
] | import com.sirma.itt.seip.mail.attachments.MailAttachment; import java.util.Collection; | import com.sirma.itt.seip.mail.attachments.*; import java.util.*; | [
"com.sirma.itt",
"java.util"
] | com.sirma.itt; java.util; | 1,549,190 |
protected void sequence_IntegerVariable(ISerializationContext context, IntegerVariable semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
| void function(ISerializationContext context, IntegerVariable semanticObject) { genericSequencer.createSequence(context, semanticObject); } | /**
* Contexts:
* Variable returns IntegerVariable
* IntegerVariable returns IntegerVariable
*
* Constraint:
* (name=EString initialValue=Value?)
*/ | Contexts: Variable returns IntegerVariable IntegerVariable returns IntegerVariable Constraint: (name=EString initialValue=Value?) | sequence_IntegerVariable | {
"repo_name": "gemoc/activitydiagram",
"path": "dev/gemoc_concurrent/language_workbench/org.gemoc.activitydiagram.concurrent.xactivitydiagram.grammar/src-gen/org/gemoc/activitydiagram/concurrent/xactivitydiagram/serializer/AbstractActivityDiagramSemanticSequencer.java",
"license": "epl-1.0",
"size": 20512
} | [
"org.eclipse.xtext.serializer.ISerializationContext",
"org.gemoc.activitydiagram.concurrent.xactivitydiagram.activitydiagram.IntegerVariable"
] | import org.eclipse.xtext.serializer.ISerializationContext; import org.gemoc.activitydiagram.concurrent.xactivitydiagram.activitydiagram.IntegerVariable; | import org.eclipse.xtext.serializer.*; import org.gemoc.activitydiagram.concurrent.xactivitydiagram.activitydiagram.*; | [
"org.eclipse.xtext",
"org.gemoc.activitydiagram"
] | org.eclipse.xtext; org.gemoc.activitydiagram; | 1,050,639 |
@Override
public boolean updateView()
{
boolean result = super.updateView();
Field f = getField();
String value = f.getInitialValue();
if (value != null)
{
replaceValue(value);
result = true;
}
else
{
// Set... | boolean function() { boolean result = super.updateView(); Field f = getField(); String value = f.getInitialValue(); if (value != null) { replaceValue(value); result = true; } else { String defaultValue = f.getDefaultValue(); if (defaultValue != null) { replaceValue(defaultValue); } } return result; } | /**
* Updates the view from the field.
*
* @return {@code true} if the view was updated
*/ | Updates the view from the field | updateView | {
"repo_name": "Murdock01/izpack",
"path": "izpack-panel/src/main/java/com/izforge/izpack/panels/userinput/gui/text/GUITextArea.java",
"license": "apache-2.0",
"size": 5692
} | [
"com.izforge.izpack.panels.userinput.field.Field"
] | import com.izforge.izpack.panels.userinput.field.Field; | import com.izforge.izpack.panels.userinput.field.*; | [
"com.izforge.izpack"
] | com.izforge.izpack; | 1,464,264 |
protected final NamespaceService getNamespaceService()
{
return m_namespaceService;
} | final NamespaceService function() { return m_namespaceService; } | /**
* Return the namespace service
*
* @return NamespaceService
*/ | Return the namespace service | getNamespaceService | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/filesys/AbstractServerConfigurationBean.java",
"license": "lgpl-3.0",
"size": 25938
} | [
"org.alfresco.service.namespace.NamespaceService"
] | import org.alfresco.service.namespace.NamespaceService; | import org.alfresco.service.namespace.*; | [
"org.alfresco.service"
] | org.alfresco.service; | 312,484 |
private void createNormalLayout()
{
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
createLabel("PacksPanel.info", "preferences", null, null);
add(Box.createRigidArea(new Dimension(0, 3)));
createLabel("PacksPanel.tip", "tip", null, null);
add(Box.createRigidArea(new Di... | void function() { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); createLabel(STR, STR, null, null); add(Box.createRigidArea(new Dimension(0, 3))); createLabel(STR, "tip", null, null); add(Box.createRigidArea(new Dimension(0, 5))); tableScroller = new JScrollPane(); tableScroller.setColumnHeaderView(null); tableScrol... | /**
* The Implementation of this method should create the layout for the current class.
*/ | The Implementation of this method should create the layout for the current class | createNormalLayout | {
"repo_name": "izpack/izpack",
"path": "izpack-panel/src/main/java/com/izforge/izpack/panels/treepacks/TreePacksPanel.java",
"license": "apache-2.0",
"size": 26101
} | [
"com.izforge.izpack.util.IoHelper",
"java.awt.Dimension",
"javax.swing.Box",
"javax.swing.BoxLayout",
"javax.swing.JScrollPane"
] | import com.izforge.izpack.util.IoHelper; import java.awt.Dimension; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JScrollPane; | import com.izforge.izpack.util.*; import java.awt.*; import javax.swing.*; | [
"com.izforge.izpack",
"java.awt",
"javax.swing"
] | com.izforge.izpack; java.awt; javax.swing; | 2,271,947 |
void getSnapshots(GetSnapshotsRequest request, ActionListener<GetSnapshotsResponse> listener); | void getSnapshots(GetSnapshotsRequest request, ActionListener<GetSnapshotsResponse> listener); | /**
* Get snapshot.
*/ | Get snapshot | getSnapshots | {
"repo_name": "strapdata/elassandra",
"path": "server/src/main/java/org/elasticsearch/client/ClusterAdminClient.java",
"license": "apache-2.0",
"size": 26657
} | [
"org.elasticsearch.action.ActionListener",
"org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest",
"org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse"
] | import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse; | import org.elasticsearch.action.*; import org.elasticsearch.action.admin.cluster.snapshots.get.*; | [
"org.elasticsearch.action"
] | org.elasticsearch.action; | 463,188 |
public static LaunchConfiguration named( final OwnerFullName ownerFullName,
final String name ) {
return new LaunchConfiguration( ownerFullName, name );
} | static LaunchConfiguration function( final OwnerFullName ownerFullName, final String name ) { return new LaunchConfiguration( ownerFullName, name ); } | /**
* Create an example LaunchConfiguration for the given owner and name.
*
* @param ownerFullName The owner
* @param name The name
* @return The example
*/ | Create an example LaunchConfiguration for the given owner and name | named | {
"repo_name": "grze/parentheses",
"path": "clc/modules/autoscaling/src/main/java/com/eucalyptus/autoscaling/configurations/LaunchConfiguration.java",
"license": "gpl-3.0",
"size": 10735
} | [
"com.eucalyptus.util.OwnerFullName"
] | import com.eucalyptus.util.OwnerFullName; | import com.eucalyptus.util.*; | [
"com.eucalyptus.util"
] | com.eucalyptus.util; | 1,134,763 |
private ProxyTrustIterator getProxyTrustIterator() {
return new SingletonProxyTrustIterator(server);
}//end getProxyTrustIterator | ProxyTrustIterator function() { return new SingletonProxyTrustIterator(server); } | /** Returns a proxy trust iterator that is used in
* <code>ProxyTrustVerifier</code> to retrieve this object's
* trust verifier.
*/ | Returns a proxy trust iterator that is used in <code>ProxyTrustVerifier</code> to retrieve this object's trust verifier | getProxyTrustIterator | {
"repo_name": "apache/river",
"path": "src/com/sun/jini/fiddler/FiddlerLease.java",
"license": "apache-2.0",
"size": 31051
} | [
"net.jini.security.proxytrust.ProxyTrustIterator",
"net.jini.security.proxytrust.SingletonProxyTrustIterator"
] | import net.jini.security.proxytrust.ProxyTrustIterator; import net.jini.security.proxytrust.SingletonProxyTrustIterator; | import net.jini.security.proxytrust.*; | [
"net.jini.security"
] | net.jini.security; | 1,276,726 |
public boolean afterExchange(GridDhtPartitionsExchangeFuture exchFut) throws IgniteCheckedException; | boolean function(GridDhtPartitionsExchangeFuture exchFut) throws IgniteCheckedException; | /**
* Post-initializes this topology.
*
* @param exchFut Exchange future.
* @return {@code True} if mapping was changed.
* @throws IgniteCheckedException If failed.
*/ | Post-initializes this topology | afterExchange | {
"repo_name": "psadusumilli/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopology.java",
"license": "apache-2.0",
"size": 13900
} | [
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture"
] | import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture; | import org.apache.ignite.*; import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,599,422 |
public static List<Date> getInstanceTimes(Date startTime, Frequency frequency, TimeZone timeZone,
Date startRange, Date endRange) {
List<Date> result = new LinkedList<>();
if (timeZone == null) {
timeZone = TimeZone.getTimeZone("UTC");
... | static List<Date> function(Date startTime, Frequency frequency, TimeZone timeZone, Date startRange, Date endRange) { List<Date> result = new LinkedList<>(); if (timeZone == null) { timeZone = TimeZone.getTimeZone("UTC"); } Date current = getPreviousInstanceTime(startTime, frequency, timeZone, startRange); while (true) ... | /**
* Find instance times given first instance start time and frequency till a given end time.
*
* It finds the first valid instance time for the given time range, it then uses frequency to find next instances
* in the given time range.
*
* @param startTime startTime of the entity (time of... | Find instance times given first instance start time and frequency till a given end time. It finds the first valid instance time for the given time range, it then uses frequency to find next instances in the given time range | getInstanceTimes | {
"repo_name": "OpenPOWER-BigData/HDP-falcon",
"path": "common/src/main/java/org/apache/falcon/entity/EntityUtil.java",
"license": "apache-2.0",
"size": 36701
} | [
"java.util.Date",
"java.util.LinkedList",
"java.util.List",
"java.util.TimeZone",
"org.apache.falcon.entity.v0.Frequency"
] | import java.util.Date; import java.util.LinkedList; import java.util.List; import java.util.TimeZone; import org.apache.falcon.entity.v0.Frequency; | import java.util.*; import org.apache.falcon.entity.v0.*; | [
"java.util",
"org.apache.falcon"
] | java.util; org.apache.falcon; | 1,400,274 |
public static QDataSet randomn(long seed, int len0, int len1) {
double[] back = randomnBack(seed, len0 * len1 );
return DDataSet.wrap(back, 2, len0, len1, 1);
} | static QDataSet function(long seed, int len0, int len1) { double[] back = randomnBack(seed, len0 * len1 ); return DDataSet.wrap(back, 2, len0, len1, 1); } | /**
* returns a rank 2 dataset of random numbers of a Gaussian (normal) distribution.
* @param seed basis for the random number (which will not be modified).
* @param len0 number of elements in the first index
* @param len1 number of elements in the second index
* @return rank 2 dataset of norm... | returns a rank 2 dataset of random numbers of a Gaussian (normal) distribution | randomn | {
"repo_name": "autoplot/app",
"path": "QDataSet/src/org/das2/qds/ops/Ops.java",
"license": "gpl-2.0",
"size": 492716
} | [
"org.das2.qds.DDataSet",
"org.das2.qds.QDataSet"
] | import org.das2.qds.DDataSet; import org.das2.qds.QDataSet; | import org.das2.qds.*; | [
"org.das2.qds"
] | org.das2.qds; | 524,945 |
public void snapshotHorizontalGoal() {
try {
ColorImage image;
if(useCameraImage){
image = camera.getImage(); // comment if using stored images
}else{
image = new RGBImage(testImage); // get the sample image from the cRIO flash
... | void function() { try { ColorImage image; if(useCameraImage){ image = camera.getImage(); }else{ image = new RGBImage(testImage); } X_IMAGE_RES = image.getWidth(); MIN_CENTER_X = (int)(X_IMAGE_RES * MIN_CENTER_X_FACTOR); MAX_CENTER_X = (int)(X_IMAGE_RES * MAX_CENTER_X_FACTOR); BinaryImage thresholdImage = image.threshol... | /**
* takes a picture looking for hori goals
*/ | takes a picture looking for hori goals | snapshotHorizontalGoal | {
"repo_name": "1684Chimeras/2014Robot",
"path": "2014CompetitionRobot/src/org/chimeras1684/year2014/iterative/aaroot/Targeting.java",
"license": "mit",
"size": 18091
} | [
"edu.wpi.first.wpilibj.image.BinaryImage",
"edu.wpi.first.wpilibj.image.ColorImage",
"edu.wpi.first.wpilibj.image.ParticleAnalysisReport",
"edu.wpi.first.wpilibj.image.RGBImage"
] | import edu.wpi.first.wpilibj.image.BinaryImage; import edu.wpi.first.wpilibj.image.ColorImage; import edu.wpi.first.wpilibj.image.ParticleAnalysisReport; import edu.wpi.first.wpilibj.image.RGBImage; | import edu.wpi.first.wpilibj.image.*; | [
"edu.wpi.first"
] | edu.wpi.first; | 385,861 |
private List<IObject> getAllMasks(PlaneDef pd) {
long pid = pixelsObj.getId();
final long width = pixelsObj.getSizeX();
final long height = pixelsObj.getSizeY();
final long z = pd.getZ();
final long t = pd.getT();
List<Long> channelIds = new ArrayList<Long>();
... | List<IObject> function(PlaneDef pd) { long pid = pixelsObj.getId(); final long width = pixelsObj.getSizeX(); final long height = pixelsObj.getSizeY(); final long z = pd.getZ(); final long t = pd.getT(); List<Long> channelIds = new ArrayList<Long>(); for (int c = 0; c < pixelsObj.getSizeC(); c++) { if (rendDefObj.getCha... | /**
* Get all the Masks attached to the image for rendering.
*/ | Get all the Masks attached to the image for rendering | getAllMasks | {
"repo_name": "simleo/openmicroscopy",
"path": "components/server/src/ome/services/RenderingBean.java",
"license": "gpl-2.0",
"size": 76383
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 807,206 |
TextAttributes getTextAttributes(); | TextAttributes getTextAttributes(); | /**
* Returns visual representation of caret (e.g. background color).
*
* @return Caret attributes.
*/ | Returns visual representation of caret (e.g. background color) | getTextAttributes | {
"repo_name": "siosio/intellij-community",
"path": "platform/editor-ui-api/src/com/intellij/openapi/editor/CaretModel.java",
"license": "apache-2.0",
"size": 14850
} | [
"com.intellij.openapi.editor.markup.TextAttributes"
] | import com.intellij.openapi.editor.markup.TextAttributes; | import com.intellij.openapi.editor.markup.*; | [
"com.intellij.openapi"
] | com.intellij.openapi; | 607,797 |
public StepDataInterface findDataInterface( String name ) {
if ( steps == null ) {
return null;
}
for ( int i = 0; i < steps.size(); i++ ) {
StepMetaDataCombi sid = steps.get( i );
StepInterface rt = sid.step;
if ( rt.getStepname().equalsIgnoreCase( name ) ) {
return sid.d... | StepDataInterface function( String name ) { if ( steps == null ) { return null; } for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); StepInterface rt = sid.step; if ( rt.getStepname().equalsIgnoreCase( name ) ) { return sid.data; } } return null; } | /**
* Find the data interface for the step with the specified name.
*
* @param name
* the step name
* @return the step data interface
*/ | Find the data interface for the step with the specified name | findDataInterface | {
"repo_name": "gretchiemoran/pentaho-kettle",
"path": "engine/src/org/pentaho/di/trans/Trans.java",
"license": "apache-2.0",
"size": 194677
} | [
"org.pentaho.di.trans.step.StepDataInterface",
"org.pentaho.di.trans.step.StepInterface",
"org.pentaho.di.trans.step.StepMetaDataCombi"
] | import org.pentaho.di.trans.step.StepDataInterface; import org.pentaho.di.trans.step.StepInterface; import org.pentaho.di.trans.step.StepMetaDataCombi; | import org.pentaho.di.trans.step.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 602,809 |
private void makeScreenShot(EmbeddedBrowser browser, String id, String dir)
throws CrawljaxException {
String filename = "screenshot_" + id + ".png";
File screenShot = new File(dir, filename);
try {
browser.saveScreenShot(screenShot);
} catch (Exception e) {
throw new CrawljaxException(... | void function(EmbeddedBrowser browser, String id, String dir) throws CrawljaxException { String filename = STR + id + ".png"; File screenShot = new File(dir, filename); try { browser.saveScreenShot(screenShot); } catch (Exception e) { throw new CrawljaxException(e); } } | /**
* Take a screenshot.
*
* @param browser
* the browser at which in the current state the screenshot must be taken.
* @param id
* the id of the file.
* @param dir
* the directory where the screenshot must be stored.
* @throws CrawljaxException
* ... | Take a screenshot | makeScreenShot | {
"repo_name": "pombredanne/errorreport-plugin",
"path": "src/main/java/com/crawljax/plugins/errorreport/ErrorReport.java",
"license": "gpl-3.0",
"size": 26050
} | [
"com.crawljax.browser.EmbeddedBrowser",
"com.crawljax.core.CrawljaxException",
"java.io.File"
] | import com.crawljax.browser.EmbeddedBrowser; import com.crawljax.core.CrawljaxException; import java.io.File; | import com.crawljax.browser.*; import com.crawljax.core.*; import java.io.*; | [
"com.crawljax.browser",
"com.crawljax.core",
"java.io"
] | com.crawljax.browser; com.crawljax.core; java.io; | 615,341 |
public DateFormat getDateFormat() {
return this.dateFormat;
}
| DateFormat function() { return this.dateFormat; } | /**
* Returns the date formatter.
*
* @return The date formatter (possibly {@code null}).
*/ | Returns the date formatter | getDateFormat | {
"repo_name": "jfree/jfreechart",
"path": "src/main/java/org/jfree/chart/labels/AbstractCategoryItemLabelGenerator.java",
"license": "lgpl-2.1",
"size": 10759
} | [
"java.text.DateFormat"
] | import java.text.DateFormat; | import java.text.*; | [
"java.text"
] | java.text; | 2,017,371 |
private void populateCopyBuffer(IStatus buildingStatus,
StringBuffer buffer, int nesting) {
if (!buildingStatus.matches(displayMask)) {
return;
}
for (int i = 0; i < nesting; i++) {
buffer.append(NESTING_INDENT);
}
buffer.append(buildingSta... | void function(IStatus buildingStatus, StringBuffer buffer, int nesting) { if (!buildingStatus.matches(displayMask)) { return; } for (int i = 0; i < nesting; i++) { buffer.append(NESTING_INDENT); } buffer.append(buildingStatus.getMessage()); buffer.append("\n"); Throwable t = buildingStatus.getException(); if (t instanc... | /**
* Put the details of the status of the error onto the stream.
*
* @param buildingStatus
* @param buffer
* @param nesting
*/ | Put the details of the status of the error onto the stream | populateCopyBuffer | {
"repo_name": "ESSICS/cs-studio",
"path": "core/ui/ui-plugins/org.csstudio.ui.util/src/org/csstudio/ui/util/dialogs/ExceptionDetailsErrorDialog.java",
"license": "epl-1.0",
"size": 24102
} | [
"org.eclipse.core.runtime.CoreException",
"org.eclipse.core.runtime.IStatus"
] | import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; | import org.eclipse.core.runtime.*; | [
"org.eclipse.core"
] | org.eclipse.core; | 1,879,689 |
public void setFormData(FormData formData) {
this.formData = formData;
} | void function(FormData formData) { this.formData = formData; } | /**
* Set PowerAuth operation form data.
* @param formData PowerAuth operation form data.
*/ | Set PowerAuth operation form data | setFormData | {
"repo_name": "lime-company/powerauth-webflow",
"path": "powerauth-data-adapter-model/src/main/java/io/getlime/security/powerauth/lib/dataadapter/model/response/GetPAOperationMappingResponse.java",
"license": "apache-2.0",
"size": 3443
} | [
"io.getlime.security.powerauth.lib.dataadapter.model.entity.FormData"
] | import io.getlime.security.powerauth.lib.dataadapter.model.entity.FormData; | import io.getlime.security.powerauth.lib.dataadapter.model.entity.*; | [
"io.getlime.security"
] | io.getlime.security; | 2,678,183 |
private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContext ctx) {
int len = in.readInt();
Object[] arr = (Object[])Array.newInstance(BinaryObject.class, len);
for (int i = 0; i < len; i++) {
byte flag = in.readByte();
if (flag == GridBinaryMa... | static Object[] function(BinaryInputStream in, BinaryContext ctx) { int len = in.readInt(); Object[] arr = (Object[])Array.newInstance(BinaryObject.class, len); for (int i = 0; i < len; i++) { byte flag = in.readByte(); if (flag == GridBinaryMarshaller.NULL) arr[i] = null; else arr[i] = doReadBinaryEnum(in, ctx, doRead... | /**
* Read binary enum array.
*
* @param in Input stream.
* @param ctx Binary context.
* @return Enum array.
*/ | Read binary enum array | doReadBinaryEnumArray | {
"repo_name": "ilantukh/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java",
"license": "apache-2.0",
"size": 84066
} | [
"java.lang.reflect.Array",
"org.apache.ignite.binary.BinaryObject",
"org.apache.ignite.internal.binary.streams.BinaryInputStream"
] | import java.lang.reflect.Array; import org.apache.ignite.binary.BinaryObject; import org.apache.ignite.internal.binary.streams.BinaryInputStream; | import java.lang.reflect.*; import org.apache.ignite.binary.*; import org.apache.ignite.internal.binary.streams.*; | [
"java.lang",
"org.apache.ignite"
] | java.lang; org.apache.ignite; | 433,615 |
static Object evaluate(String expression, Activity activity) {
return evaluate(expression, activity, null);
} | static Object evaluate(String expression, Activity activity) { return evaluate(expression, activity, null); } | /**
* Evaluates an expression.
* @param expression the expression to be evaluated
* @param activity the aspectran activity
* @return the result of the expression evaluation
* @throws ExpressionEvaluationException thrown when an error occurs during expression evaluation
*/ | Evaluates an expression | evaluate | {
"repo_name": "aspectran/aspectran",
"path": "core/src/main/java/com/aspectran/core/context/expr/ExpressionEvaluator.java",
"license": "apache-2.0",
"size": 3870
} | [
"com.aspectran.core.activity.Activity"
] | import com.aspectran.core.activity.Activity; | import com.aspectran.core.activity.*; | [
"com.aspectran.core"
] | com.aspectran.core; | 1,543,154 |
public RoomsRestClient getRoomsApiClient() {
checkIfActive();
return mRoomsRestClient;
} | RoomsRestClient function() { checkIfActive(); return mRoomsRestClient; } | /**
* Get the API client for requests to the rooms API.
* @return the rooms API client
*/ | Get the API client for requests to the rooms API | getRoomsApiClient | {
"repo_name": "Nehasing/Nehachat",
"path": "matrix-sdk/src/main/java/org/matrix/androidsdk/MXSession.java",
"license": "apache-2.0",
"size": 19977
} | [
"org.matrix.androidsdk.rest.client.RoomsRestClient"
] | import org.matrix.androidsdk.rest.client.RoomsRestClient; | import org.matrix.androidsdk.rest.client.*; | [
"org.matrix.androidsdk"
] | org.matrix.androidsdk; | 372,615 |
void resumeJobs(String sessionId, List<Integer> list, AsyncCallback<Integer> asyncCallback); | void resumeJobs(String sessionId, List<Integer> list, AsyncCallback<Integer> asyncCallback); | /**
* By making an asynchronous call to the server, several jobs are resumed.
* @param sessionId the session id of the user which is logged in
* @param list the list of jobs which are to be resumed
* @param asyncCallback the result retrieved from the server which shows if the jobs were resumed succe... | By making an asynchronous call to the server, several jobs are resumed | resumeJobs | {
"repo_name": "sandrineBeauche/scheduling-portal",
"path": "scheduler-portal/src/main/java/org/ow2/proactive_grid_cloud_portal/scheduler/client/SchedulerServiceAsync.java",
"license": "agpl-3.0",
"size": 13955
} | [
"com.google.gwt.user.client.rpc.AsyncCallback",
"java.util.List"
] | import com.google.gwt.user.client.rpc.AsyncCallback; import java.util.List; | import com.google.gwt.user.client.rpc.*; import java.util.*; | [
"com.google.gwt",
"java.util"
] | com.google.gwt; java.util; | 1,188,964 |
public void moveAllChildrenTo(T target, int targetIndex) {
while (getNumberOfChildren() > 0) {
getLastChild().get().moveTo(target, targetIndex);
}
}
/**
* Sorts the list of children according to the order induced by the specified {@link Comparator}.
* <p>
* All ch... | void function(T target, int targetIndex) { while (getNumberOfChildren() > 0) { getLastChild().get().moveTo(target, targetIndex); } } /** * Sorts the list of children according to the order induced by the specified {@link Comparator}. * <p> * All children must be mutually comparable using the specified comparator * (tha... | /**
* Removes all children from this node and makes them a child of the specified node
* by adding it to the specified position in the children list.
*
* @param target the new parent
* @param targetIndex the position where the children should be inserted
* @throws NullPointerException... | Removes all children from this node and makes them a child of the specified node by adding it to the specified position in the children list | moveAllChildrenTo | {
"repo_name": "shitikanth/jabref",
"path": "src/main/java/org/jabref/model/TreeNode.java",
"license": "mit",
"size": 21573
} | [
"java.util.Comparator"
] | import java.util.Comparator; | import java.util.*; | [
"java.util"
] | java.util; | 790,819 |
@Test
public void testEvaluateGenericTour() {
mRnd = new Random(0);
System.out.println("testEvaluateGenericTour");
for (int i = 0; i < sRep; i++) {
InsertionMove mve = insertRequest(true);
while (mve != null) {
double checkWT = TRSPSolutionCheckerB... | void function() { mRnd = new Random(0); System.out.println(STR); for (int i = 0; i < sRep; i++) { InsertionMove mve = insertRequest(true); while (mve != null) { double checkWT = TRSPSolutionCheckerBase.evaluateTotalDuration(mTour, -1); double cdWT = mTour.getCostDelegate().evaluateTour(mTour, true); assertEquals(checkW... | /**
* Test method for
* {@link vroom.trsp.datamodel.costDelegates.TRSPWorkingTime#evaluateGenericTour(vroom.trsp.datamodel.ITRSPTour)}.
*/ | Test method for <code>vroom.trsp.datamodel.costDelegates.TRSPWorkingTime#evaluateGenericTour(vroom.trsp.datamodel.ITRSPTour)</code> | testEvaluateGenericTour | {
"repo_name": "vpillac/vroom",
"path": "Technicians/test/vroom/trsp/datamodel/costDelegates/TRSPWorkingTimeTest.java",
"license": "gpl-3.0",
"size": 9175
} | [
"java.util.Random",
"org.junit.Assert",
"org.junit.Test"
] | import java.util.Random; import org.junit.Assert; import org.junit.Test; | import java.util.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 1,701,194 |
private void findSegmentsInside (int x0, int y0, int x1, int y1,
List segments)
{
// Don't scan any furher if the region doesn't intersect
if (!region_.isIntersecting (new Rect (x0, y0, x1-x0+1, y1-y0+1)))
return;
// The region intersects, but we need to conside... | void function (int x0, int y0, int x1, int y1, List segments) { if (!region_.isIntersecting (new Rect (x0, y0, x1-x0+1, y1-y0+1))) return; if (segments_ != null) { for (Iterator i = segments_.iterator(); i.hasNext(); ) { GSegment segment = (GSegment) i.next(); if (segment.isInsideRectangle (x0, y0, x1, y1)) segments.ad... | /**
* Find all segments of the subtree rooted at this GObject that are
* inside the specified rectangle.
*
* @param x0 X coordinate of upper left corner of rectangle.
* @param y0 Y coordinate of upper left corner of rectangle.
* @param x1 X coordinate of lower right corner of rec... | Find all segments of the subtree rooted at this GObject that are inside the specified rectangle | findSegmentsInside | {
"repo_name": "ys880526/Test",
"path": "Simulators/GateBar/src/main/java/no/geosoft/cc/graphics/GObject.java",
"license": "lgpl-3.0",
"size": 50218
} | [
"java.util.Iterator",
"java.util.List",
"no.geosoft.cc.geometry.Rect"
] | import java.util.Iterator; import java.util.List; import no.geosoft.cc.geometry.Rect; | import java.util.*; import no.geosoft.cc.geometry.*; | [
"java.util",
"no.geosoft.cc"
] | java.util; no.geosoft.cc; | 830,033 |
public Calendar getCreatedTime() {
return this.createdTime;
} | Calendar function() { return this.createdTime; } | /**
* Optional. The date when the virtual machine image was created.
* @return The CreatedTime value.
*/ | Optional. The date when the virtual machine image was created | getCreatedTime | {
"repo_name": "manikandan-palaniappan/azure-sdk-for-java",
"path": "management-compute/src/main/java/com/microsoft/windowsazure/management/compute/models/VirtualMachineVMImageGetDetailsResponse.java",
"license": "apache-2.0",
"size": 18085
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 1,934,372 |
public ArrayList<String> extractTopicsFromFile(String filePath, int numberOfTopics) throws Exception {
File documentTextFile = new File(filePath);
String documentText = FileUtils.readFileToString(documentTextFile);
return extractTopicsFromText(documentText, numberOfTopics);
}
| ArrayList<String> function(String filePath, int numberOfTopics) throws Exception { File documentTextFile = new File(filePath); String documentText = FileUtils.readFileToString(documentTextFile); return extractTopicsFromText(documentText, numberOfTopics); } | /**
* Triggers topic extraction from a text file
* @param filePath
* @param numberOfTopics
* @return
* @throws Exception
*/ | Triggers topic extraction from a text file | extractTopicsFromFile | {
"repo_name": "HIIT/maui-2",
"path": "src/maui/main/MauiWrapper.java",
"license": "gpl-3.0",
"size": 5749
} | [
"java.io.File",
"java.util.ArrayList",
"org.apache.commons.io.FileUtils"
] | import java.io.File; import java.util.ArrayList; import org.apache.commons.io.FileUtils; | import java.io.*; import java.util.*; import org.apache.commons.io.*; | [
"java.io",
"java.util",
"org.apache.commons"
] | java.io; java.util; org.apache.commons; | 1,399,984 |
//Erstellen eines Prepared Statements
crud = con.prepareStmnt("INSERT INTO Produkt VALUES(?,?,?)");
try{
crud.setInt(1, num);
crud.setString(2,bez);
crud.setInt(3, gewicht);
crud.execute();
} catch(SQLException e) {
System.out.println("Fehler aufgetreten!");
System.out.println(e.getMessage());... | crud = con.prepareStmnt(STR); try{ crud.setInt(1, num); crud.setString(2,bez); crud.setInt(3, gewicht); crud.execute(); } catch(SQLException e) { System.out.println(STR); System.out.println(e.getMessage()); } } | /**
* CREATE - Eine Methode, dass ein Produkt in die mysql datenbank(schokofabrik) in die Tabelle Produkt einfuegt.
* @param num die nummer des Produktes
* @param bez die bezeichnung des Produktes
* @param gewicht das gewicht des Produktes
*/ | CREATE - Eine Methode, dass ein Produkt in die mysql datenbank(schokofabrik) in die Tabelle Produkt einfuegt | insertProdukt | {
"repo_name": "stiryaki-tgm/PreparedStatements",
"path": "src/CRUD.java",
"license": "apache-2.0",
"size": 2977
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 579,166 |
@Deprecated
public Iterator<Key> iterator() {
return st.keySet().iterator();
} | Iterator<Key> function() { return st.keySet().iterator(); } | /**
* Returns all of the keys in the symbol table as an iterator.
* To iterate over all of the keys in a symbol table named <tt>st</tt>, use the
* foreach notation: <tt>for (Key key : st)</tt>.
* @deprecated Use {@link #keys} instead.
* This method is provided for backward compatibility with th... | Returns all of the keys in the symbol table as an iterator. To iterate over all of the keys in a symbol table named st, use the foreach notation: for (Key key : st) | iterator | {
"repo_name": "fracpete/princeton-java-algorithms",
"path": "src/main/java/edu/princeton/cs/algorithms/ST.java",
"license": "gpl-3.0",
"size": 8089
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 654,152 |
@Test
public void testUnwrittenNewStructureDefinition() {
String name = "asdt_1";
Toolkit toolkit = mToolkit;
Scope scope = mScope;
Assert.assertNotNull(toolkit);
Assert.assertNotNull(scope);
StructureDefinition def = checkAndCreate(name);
Assert.assertNotNull(def);
Structur... | void function() { String name = STR; Toolkit toolkit = mToolkit; Scope scope = mScope; Assert.assertNotNull(toolkit); Assert.assertNotNull(scope); StructureDefinition def = checkAndCreate(name); Assert.assertNotNull(def); StructureDefinition testDef = toolkit.lookupStructureDefinitionByName(scope, name); Assert.assertN... | /**
* Make sure that a new StructureDefinition isn't automatically written upon creation
*/ | Make sure that a new StructureDefinition isn't automatically written upon creation | testUnwrittenNewStructureDefinition | {
"repo_name": "diamondq/dq-common-java",
"path": "model/common-model.standard/src/test/java/com/diamondq/adventuretools/model/AbstractStructureDefinitionTests.java",
"license": "apache-2.0",
"size": 11899
} | [
"com.diamondq.common.model.interfaces.Scope",
"com.diamondq.common.model.interfaces.StructureDefinition",
"com.diamondq.common.model.interfaces.Toolkit",
"org.junit.Assert"
] | import com.diamondq.common.model.interfaces.Scope; import com.diamondq.common.model.interfaces.StructureDefinition; import com.diamondq.common.model.interfaces.Toolkit; import org.junit.Assert; | import com.diamondq.common.model.interfaces.*; import org.junit.*; | [
"com.diamondq.common",
"org.junit"
] | com.diamondq.common; org.junit; | 246,404 |
public boolean addNodeRow(ProxyNode node,Object attrs[])
{
//debug("New proxynode row:"+node);
// Use VAttributeSet as factory
int rownr=0;
synchronized(this.rowObjects)
{
RowObject row = this.getRowByVRL(node.getVRL());
if (row!=null)
{
... | boolean function(ProxyNode node,Object attrs[]) { int rownr=0; synchronized(this.rowObjects) { RowObject row = this.getRowByVRL(node.getVRL()); if (row!=null) { return false; } row=new RowObject(node); row.setData(attrs); rowObjects.add(row); } fireTableRowsInserted(rownr, rownr); return true; } | /**
* Add new row with specfied data.
* If node alread exist new row isn't added
* @param rowNode
* @param attrs
*/ | Add new row with specfied data. If node alread exist new row isn't added | addNodeRow | {
"repo_name": "NLeSC/vbrowser",
"path": "source/nl.esciencecenter.vlet.gui.vbrowser/src/nl/esciencecenter/vlet/gui/table/VRSTableModel.java",
"license": "apache-2.0",
"size": 15624
} | [
"nl.esciencecenter.vlet.gui.proxyvrs.ProxyNode"
] | import nl.esciencecenter.vlet.gui.proxyvrs.ProxyNode; | import nl.esciencecenter.vlet.gui.proxyvrs.*; | [
"nl.esciencecenter.vlet"
] | nl.esciencecenter.vlet; | 2,308,962 |
@Test()
public void setLengthZero()
throws Exception
{
ByteStringBuffer buffer = new ByteStringBuffer();
buffer.append("foo");
assertEquals(buffer.toString(), "foo");
buffer.setLength(0);
assertEquals(buffer.toString(), "");
} | @Test() void function() throws Exception { ByteStringBuffer buffer = new ByteStringBuffer(); buffer.append("foo"); assertEquals(buffer.toString(), "foo"); buffer.setLength(0); assertEquals(buffer.toString(), ""); } | /**
* Tests the {@code setLength} method with a length of zero.
*
* @throws Exception If an unexpected problem occurs.
*/ | Tests the setLength method with a length of zero | setLengthZero | {
"repo_name": "UnboundID/ldapsdk",
"path": "tests/unit/src/com/unboundid/util/ByteStringBufferTestCase.java",
"license": "gpl-2.0",
"size": 141047
} | [
"org.testng.annotations.Test"
] | import org.testng.annotations.Test; | import org.testng.annotations.*; | [
"org.testng.annotations"
] | org.testng.annotations; | 2,813,268 |
@Override public T visitTypeVariable(@NotNull Java8Parser.TypeVariableContext ctx) { return visitChildren(ctx); } | @Override public T visitTypeVariable(@NotNull Java8Parser.TypeVariableContext ctx) { return visitChildren(ctx); } | /**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/ | The default implementation returns the result of calling <code>#visitChildren</code> on ctx | visitSwitchBlockStatementGroup | {
"repo_name": "IsThisThePayneResidence/intellidots",
"path": "src/main/java/ua/edu/hneu/ast/parsers/Java8BaseVisitor.java",
"license": "gpl-3.0",
"size": 65479
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 1,462,787 |
public final Multimap<Container, TaskAttemptInfo> getContainersToTaskAttemptMapping() {
List<VertexInfo> VertexInfoList = getVertices();
Multimap<Container, TaskAttemptInfo> containerMapping = LinkedHashMultimap.create();
for (VertexInfo vertexInfo : VertexInfoList) {
containerMapping.putAll(vertex... | final Multimap<Container, TaskAttemptInfo> function() { List<VertexInfo> VertexInfoList = getVertices(); Multimap<Container, TaskAttemptInfo> containerMapping = LinkedHashMultimap.create(); for (VertexInfo vertexInfo : VertexInfoList) { containerMapping.putAll(vertexInfo.getContainersMapping()); } return Multimaps.unmo... | /**
* Get containers used for this DAG
*
* @return Multimap<Container, TaskAttemptInfo> task attempt details at every container
*/ | Get containers used for this DAG | getContainersToTaskAttemptMapping | {
"repo_name": "ueshin/apache-tez",
"path": "tez-plugins/tez-history-parser/src/main/java/org/apache/tez/history/parser/datamodel/DagInfo.java",
"license": "apache-2.0",
"size": 20934
} | [
"com.google.common.collect.LinkedHashMultimap",
"com.google.common.collect.Multimap",
"com.google.common.collect.Multimaps",
"java.util.List"
] | import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.Multimap; import com.google.common.collect.Multimaps; import java.util.List; | import com.google.common.collect.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 1,676,402 |
public static byte[] parseHex(String hex) throws IOException {
if (hex.length() % 2 != 0) {
throw new IOException(String.format("Invalid byte sequence '%s'.", hex));
}
final int nbytes = hex.length() / 2;
final byte[] bytes = new byte[nbytes];
int pos = 0;
int index = 0;
while (pos ... | static byte[] function(String hex) throws IOException { if (hex.length() % 2 != 0) { throw new IOException(String.format(STR, hex)); } final int nbytes = hex.length() / 2; final byte[] bytes = new byte[nbytes]; int pos = 0; int index = 0; while (pos < hex.length()) { final int hiDigit = Character.digit(hex.charAt(pos),... | /**
* Parses a string hexadecimal representation of a byte array.
*
* @param hex String hexadecimal representation of the byte array to parse.
* @return the parsed byte array.
* @throws IOException on parse error.
*/ | Parses a string hexadecimal representation of a byte array | parseHex | {
"repo_name": "zenoss/kiji-schema",
"path": "kiji-schema/src/main/java/org/kiji/schema/util/ByteArrayFormatter.java",
"license": "apache-2.0",
"size": 4853
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,321,671 |
private void connectAtomsAndAttributes(String[] fields,
Map<String, Atom> ndcAtoms, Map<String, String> mthsplNdcCodeMap,
Map<String, String> mthsplNdc9Map, Map<String, String> mthsplNdc10Map,
Map<String, Set<Attribute>> attributeMap, Map<String, String> splSetIdMap,
Set<Concept> modifiedConcepts) thr... | void function(String[] fields, Map<String, Atom> ndcAtoms, Map<String, String> mthsplNdcCodeMap, Map<String, String> mthsplNdc9Map, Map<String, String> mthsplNdc10Map, Map<String, Set<Attribute>> attributeMap, Map<String, String> splSetIdMap, Set<Concept> modifiedConcepts) throws Exception { for (final Map.Entry<String... | /**
* Connect atoms and attributes.
*
* @param fields the fields
* @param ndcAtoms the ndc atoms
* @param mthsplNdcCodeMap the mthspl ndc code map
* @param attributeMap the attribute map
* @param splSetIdMap the spl set id map
* @param modifiedConcepts the modified concepts
* @throws Exceptio... | Connect atoms and attributes | connectAtomsAndAttributes | {
"repo_name": "WestCoastInformatics/Terminology-Transformer",
"path": "jpa-services/src/main/java/com/wci/tt/jpa/services/algo/NdcLoaderAlgorithm.java",
"license": "apache-2.0",
"size": 21117
} | [
"com.wci.umls.server.jpa.content.AttributeJpa",
"com.wci.umls.server.model.content.Atom",
"com.wci.umls.server.model.content.Attribute",
"com.wci.umls.server.model.content.Concept",
"java.util.Map",
"java.util.Set"
] | import com.wci.umls.server.jpa.content.AttributeJpa; import com.wci.umls.server.model.content.Atom; import com.wci.umls.server.model.content.Attribute; import com.wci.umls.server.model.content.Concept; import java.util.Map; import java.util.Set; | import com.wci.umls.server.jpa.content.*; import com.wci.umls.server.model.content.*; import java.util.*; | [
"com.wci.umls",
"java.util"
] | com.wci.umls; java.util; | 2,236,165 |
public boolean GetSettings(SharedPreferences prefs)
{
Log.v(TAG, "GetSettings() -----------------------------------------------");
try
{
// OCR.mConfig.m_iMinOveralConfidence = Integer.parseInt(prefs.getString(PreferencesActivity.KEY_MIN_OVERALL_CONFIDENCE, "60"));
// OCR.mConfig.m_iMinWordConfid... | boolean function(SharedPreferences prefs) { Log.v(TAG, STR); try { } catch (Exception ex) { Log.v(TAG, STR + ex.toString()); return false; } Log.v(TAG, STR + OCR.mConfig.m_iMinOveralConfidence +","+ OCR.mConfig.m_iMinWordConfidence +","+ OCR.mConfig.GetImgDivisor() +","+ OCR.mConfig.m_bUseBWFilter +","+ OCR.mConfig.m_s... | /**
* get setings from the shared preferences
* @param prefs the shared preferences
* @return success/fail
*/ | get setings from the shared preferences | GetSettings | {
"repo_name": "sodapop/BioNlpOcr",
"path": "src/com/itwizard/mezzofanti/OCR.java",
"license": "apache-2.0",
"size": 28885
} | [
"android.content.SharedPreferences",
"android.util.Log"
] | import android.content.SharedPreferences; import android.util.Log; | import android.content.*; import android.util.*; | [
"android.content",
"android.util"
] | android.content; android.util; | 533,236 |
public static Method getAtMostOneMethodWithoutArgs(Class classType, Class<? extends Annotation> annotationType,
Class returnType) {
return getAtMostOneMethod(classType, annotationType, ALWAYS_FILTER, returnType, false);
} | static Method function(Class classType, Class<? extends Annotation> annotationType, Class returnType) { return getAtMostOneMethod(classType, annotationType, ALWAYS_FILTER, returnType, false); } | /**
* Searches for an optional method without arguments of the given annotation type with a custom return type.
*
* @param classType Class to scan
* @param annotationType Type of the annotation
* @param returnType Assert the return type of the method, use <tt>null</tt> for void methods... | Searches for an optional method without arguments of the given annotation type with a custom return type | getAtMostOneMethodWithoutArgs | {
"repo_name": "hasancelik/hazelcast-stabilizer",
"path": "simulator/src/main/java/com/hazelcast/simulator/utils/AnnotationReflectionUtils.java",
"license": "apache-2.0",
"size": 8408
} | [
"java.lang.annotation.Annotation",
"java.lang.reflect.Method"
] | import java.lang.annotation.Annotation; import java.lang.reflect.Method; | import java.lang.annotation.*; import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 417,242 |
public RowLocation getRowLocation() throws StandardException
{
if (SanityManager.DEBUG)
SanityManager.ASSERT(source instanceof CursorResultSet, "source not CursorResultSet");
return ( (CursorResultSet)source ).getRowLocation();
} | RowLocation function() throws StandardException { if (SanityManager.DEBUG) SanityManager.ASSERT(source instanceof CursorResultSet, STR); return ( (CursorResultSet)source ).getRowLocation(); } | /**
* Gets information from its source. We might want
* to have this take a CursorResultSet in its constructor some day,
* instead of doing a cast here?
*
* @see CursorResultSet
*
* @return the row location of the current cursor row.
*
* @exception StandardException thrown on failure
*/ | Gets information from its source. We might want to have this take a CursorResultSet in its constructor some day, instead of doing a cast here | getRowLocation | {
"repo_name": "scnakandala/derby",
"path": "java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java",
"license": "apache-2.0",
"size": 33262
} | [
"org.apache.derby.iapi.error.StandardException",
"org.apache.derby.iapi.sql.execute.CursorResultSet",
"org.apache.derby.iapi.types.RowLocation",
"org.apache.derby.shared.common.sanity.SanityManager"
] | import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.sql.execute.CursorResultSet; import org.apache.derby.iapi.types.RowLocation; import org.apache.derby.shared.common.sanity.SanityManager; | import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.sql.execute.*; import org.apache.derby.iapi.types.*; import org.apache.derby.shared.common.sanity.*; | [
"org.apache.derby"
] | org.apache.derby; | 12,984 |
public void testNotify(Button b, Context context)
{
final NotificationAction notify = new NotificationAction(context);
| void function(Button b, Context context) { final NotificationAction notify = new NotificationAction(context); | /**
* Create Test Notification Action
* @param b
* @param context
*/ | Create Test Notification Action | testNotify | {
"repo_name": "ashish-kalbhor/AndroidActionKit",
"path": "AndroidActionKit/src/api/ashish/androidactionkit/MainActivity.java",
"license": "apache-2.0",
"size": 2031
} | [
"android.content.Context",
"android.widget.Button"
] | import android.content.Context; import android.widget.Button; | import android.content.*; import android.widget.*; | [
"android.content",
"android.widget"
] | android.content; android.widget; | 173,928 |
public UnitType getGapThresholdType() {
return this.gapThresholdType;
} | UnitType function() { return this.gapThresholdType; } | /**
* Returns the gap threshold type (relative or absolute).
*
* @return The type.
*
* @see #setGapThresholdType(UnitType)
*/ | Returns the gap threshold type (relative or absolute) | getGapThresholdType | {
"repo_name": "ibestvina/multithread-centiscape",
"path": "CentiScaPe2.1/src/main/java/org/jfree/chart/renderer/xy/StandardXYItemRenderer.java",
"license": "mit",
"size": 40508
} | [
"org.jfree.util.UnitType"
] | import org.jfree.util.UnitType; | import org.jfree.util.*; | [
"org.jfree.util"
] | org.jfree.util; | 2,716,003 |
public void replaceAll(BitSet otherIntent)
{
BitSet toAdd = (BitSet) this.intent.clone(); // add := this.intent
toAdd.or(otherIntent); // add := this.intent union other.intent
toAdd.xor(this.intent); // add -= this.intent
this.addRecursively(toAdd);
}
| void function(BitSet otherIntent) { BitSet toAdd = (BitSet) this.intent.clone(); toAdd.or(otherIntent); toAdd.xor(this.intent); this.addRecursively(toAdd); } | /**
* Adds a set to the intent part recursively (modifies the whole subtree of the node).
*
* @param otherIntent The intent part of the other node.
*/ | Adds a set to the intent part recursively (modifies the whole subtree of the node) | replaceAll | {
"repo_name": "jabbalaci/Talky-G",
"path": "src/main/java/fr/loria/coronsys/coron/datastructure/charm/ITnode.java",
"license": "gpl-3.0",
"size": 14690
} | [
"java.util.BitSet"
] | import java.util.BitSet; | import java.util.*; | [
"java.util"
] | java.util; | 2,189,689 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.