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 void setClaimMetadataManagementService(ClaimMetadataManagementService claimMetadataManagementService) { this.claimMetadataManagementService = claimMetadataManagementService; }
void function(ClaimMetadataManagementService claimMetadataManagementService) { this.claimMetadataManagementService = claimMetadataManagementService; }
/** * Set {@link ClaimMetadataManagementService}. * * @param claimMetadataManagementService Instance of {@link ClaimMetadataManagementService}. */
Set <code>ClaimMetadataManagementService</code>
setClaimMetadataManagementService
{ "repo_name": "wso2-extensions/identity-governance", "path": "components/org.wso2.carbon.identity.recovery/src/main/java/org/wso2/carbon/identity/recovery/internal/IdentityRecoveryServiceDataHolder.java", "license": "apache-2.0", "size": 6875 }
[ "org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementService" ]
import org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementService;
import org.wso2.carbon.identity.claim.metadata.mgt.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
915,363
public List<Object> toList() { List<Object> results = new ArrayList<Object>(this.myArrayList.size()); for (Object element : this.myArrayList) { if (element == null || LOGJObject.NULL.equals(element)) { results.add(null); } else if (element instanceof LOGJArray) { results.add(((LOGJArray) element).toList()); } else if (element instanceof LOGJObject) { results.add(((LOGJObject) element).toMap()); } else { results.add(element); } } return results; }
List<Object> function() { List<Object> results = new ArrayList<Object>(this.myArrayList.size()); for (Object element : this.myArrayList) { if (element == null LOGJObject.NULL.equals(element)) { results.add(null); } else if (element instanceof LOGJArray) { results.add(((LOGJArray) element).toList()); } else if (element instanceof LOGJObject) { results.add(((LOGJObject) element).toMap()); } else { results.add(element); } } return results; }
/** * Returns a java.util.List containing all of the elements in this array. * If an element in the array is a JSONArray or JSONObject it will also * be converted. * <p> * Warning: This method assumes that the data structure is acyclical. * * @return a java.util.List containing the elements of this array */
Returns a java.util.List containing all of the elements in this array. If an element in the array is a JSONArray or JSONObject it will also be converted. Warning: This method assumes that the data structure is acyclical
toList
{ "repo_name": "tiscover/logger", "path": "src/main/java/com/tiscover/logging/logstash/messages/json/LOGJArray.java", "license": "gpl-3.0", "size": 41058 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,518,959
CollaborationMember user = null; for (CollaborationMember member: ((SharedCollaboration) collaboration).getAllMembers()) { if(member.getUsername().equals(username)) user = member; } return user; }
CollaborationMember user = null; for (CollaborationMember member: ((SharedCollaboration) collaboration).getAllMembers()) { if(member.getUsername().equals(username)) user = member; } return user; }
/** * Method that take the CollaborationMember object of the user that is logged in the application * @param collaboration the collaboration in which you are * @param username the username of the logged user * @return return the CollaborationMember */
Method that take the CollaborationMember object of the user that is logged in the application
checkMemberAccess
{ "repo_name": "manuelperuzzi/Collabora-android-app", "path": "app/src/main/java/org/gammf/collabora_android/utils/model/AccessRightUtils.java", "license": "gpl-3.0", "size": 1406 }
[ "org.gammf.collabora_android.model.collaborations.shared_collaborations.SharedCollaboration", "org.gammf.collabora_android.model.users.CollaborationMember" ]
import org.gammf.collabora_android.model.collaborations.shared_collaborations.SharedCollaboration; import org.gammf.collabora_android.model.users.CollaborationMember;
import org.gammf.collabora_android.model.collaborations.shared_collaborations.*; import org.gammf.collabora_android.model.users.*;
[ "org.gammf.collabora_android" ]
org.gammf.collabora_android;
1,800,822
public JceKEKRecipient setProvider(Provider provider) { this.helper = new EnvelopedDataHelper(new ProviderJcaJceExtHelper(provider)); this.contentHelper = helper; return this; }
JceKEKRecipient function(Provider provider) { this.helper = new EnvelopedDataHelper(new ProviderJcaJceExtHelper(provider)); this.contentHelper = helper; return this; }
/** * Set the provider to use for key recovery and content processing. * * @param provider provider to use. * @return this recipient. */
Set the provider to use for key recovery and content processing
setProvider
{ "repo_name": "thedrummeraki/Aki-SSL", "path": "src/org/bouncycastle/cms/jcajce/JceKEKRecipient.java", "license": "apache-2.0", "size": 3807 }
[ "java.security.Provider" ]
import java.security.Provider;
import java.security.*;
[ "java.security" ]
java.security;
2,249,021
int[] executeBatchByArrayMaps(final String sql, Map<String, Object>... mapParameters) throws Exception;
int[] executeBatchByArrayMaps(final String sql, Map<String, Object>... mapParameters) throws Exception;
/** * execute batch of methods which is <tt>INSERT</tt> or <tt>UPDATE</tt> or <tt>DELETE</tt> * * @param sql statement of database * @param mapParameters params in map way,a map refer a statement * @return {@link Integer[]} the affect count of statements * @throws Exception the exception message of execution */
execute batch of methods which is INSERT or UPDATE or DELETE
executeBatchByArrayMaps
{ "repo_name": "miyakowork/template-modules-dao", "path": "src/main/java/org/templateproject/dao/ancestor/AncestorDao.java", "license": "apache-2.0", "size": 20700 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,196,564
@Test public void testInitSettingsFromOtherDir(TestContext context) { context.assertNotNull(vertx); FileSystem fs = vertx.fileSystem(); Settings setting = new NetRelayExt_FileBasedSettings().createDefaultSettings(); LOGGER.info("handling in " + localSettingsFileNameTmpDir); deleteFileInDir(context, fs, localSettingsFileNameTmpDir); Async async = context.async(); DeploymentOptions options = new DeploymentOptions(); options.setConfig(new JsonObject().put(Settings.SETTINGS_LOCATION_PROPERTY, localSettingsFileNameTmpDir)); vertx.deployVerticle(NetRelayExt_FileBasedSettings.class.getName(), options, result -> { try { if (result.failed()) { context.assertTrue(fs.existsBlocking(localSettingsFileNameUserDir), "does not exist: " + localSettingsFileNameUserDir); } else { context.fail("This test expects to fail, cause the settings were created new on disc"); } } finally { async.complete(); } }); async.await(); final Async async2 = context.async(); vertx.deployVerticle(NetRelayExt_FileBasedSettings.class.getName(), options, result -> { try { if (result.failed()) { context.assertEquals(InitException.class, result.cause().getClass()); context.assertTrue(result.cause().getMessage().contains("The settings are not yet edited."), "Expected errormessage which contains 'The settings are not yet edited.'"); context.assertTrue(fs.existsBlocking(localSettingsFileNameUserDir)); } else { context.fail("This test expects to fail, cause the settings were not edited yet"); } } finally { async2.complete(); } }); async2.await(); }
void function(TestContext context) { context.assertNotNull(vertx); FileSystem fs = vertx.fileSystem(); Settings setting = new NetRelayExt_FileBasedSettings().createDefaultSettings(); LOGGER.info(STR + localSettingsFileNameTmpDir); deleteFileInDir(context, fs, localSettingsFileNameTmpDir); Async async = context.async(); DeploymentOptions options = new DeploymentOptions(); options.setConfig(new JsonObject().put(Settings.SETTINGS_LOCATION_PROPERTY, localSettingsFileNameTmpDir)); vertx.deployVerticle(NetRelayExt_FileBasedSettings.class.getName(), options, result -> { try { if (result.failed()) { context.assertTrue(fs.existsBlocking(localSettingsFileNameUserDir), STR + localSettingsFileNameUserDir); } else { context.fail(STR); } } finally { async.complete(); } }); async.await(); final Async async2 = context.async(); vertx.deployVerticle(NetRelayExt_FileBasedSettings.class.getName(), options, result -> { try { if (result.failed()) { context.assertEquals(InitException.class, result.cause().getClass()); context.assertTrue(result.cause().getMessage().contains(STR), STR); context.assertTrue(fs.existsBlocking(localSettingsFileNameUserDir)); } else { context.fail(STR); } } finally { async2.complete(); } }); async2.await(); }
/** * Check for a file inside another location. * */
Check for a file inside another location
testInitSettingsFromOtherDir
{ "repo_name": "BraintagsGmbH/netrelay", "path": "src/test/java/de/braintags/netrelay/unit/TSettings.java", "license": "epl-1.0", "size": 6852 }
[ "de.braintags.netrelay.init.Settings", "de.braintags.vertx.util.exception.InitException", "io.vertx.core.DeploymentOptions", "io.vertx.core.file.FileSystem", "io.vertx.core.json.JsonObject", "io.vertx.ext.unit.Async", "io.vertx.ext.unit.TestContext" ]
import de.braintags.netrelay.init.Settings; import de.braintags.vertx.util.exception.InitException; import io.vertx.core.DeploymentOptions; import io.vertx.core.file.FileSystem; import io.vertx.core.json.JsonObject; import io.vertx.ext.unit.Async; import io.vertx.ext.unit.TestContext;
import de.braintags.netrelay.init.*; import de.braintags.vertx.util.exception.*; import io.vertx.core.*; import io.vertx.core.file.*; import io.vertx.core.json.*; import io.vertx.ext.unit.*;
[ "de.braintags.netrelay", "de.braintags.vertx", "io.vertx.core", "io.vertx.ext" ]
de.braintags.netrelay; de.braintags.vertx; io.vertx.core; io.vertx.ext;
194,899
public PactDslResponse headers(Map<String, String> headers) { this.responseHeaders.putAll(headers); return this; }
PactDslResponse function(Map<String, String> headers) { this.responseHeaders.putAll(headers); return this; }
/** * Response headers to return * @param headers key-value pairs of headers */
Response headers to return
headers
{ "repo_name": "caoquendo/pact-jvm", "path": "pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/ConsumerPactBuilder.java", "license": "apache-2.0", "size": 22737 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
650,987
private int canUseListViewForHighLighting(String key) { if (!hasListView()) { return -1; } ListView listView = getListView(); ListAdapter adapter = listView.getAdapter(); if (adapter != null && adapter instanceof PreferenceGroupAdapter) { return findListPositionFromKey(adapter, key); } return -1; }
int function(String key) { if (!hasListView()) { return -1; } ListView listView = getListView(); ListAdapter adapter = listView.getAdapter(); if (adapter != null && adapter instanceof PreferenceGroupAdapter) { return findListPositionFromKey(adapter, key); } return -1; }
/** * Return a valid ListView position or -1 if none is found */
Return a valid ListView position or -1 if none is found
canUseListViewForHighLighting
{ "repo_name": "Ant-Droid/android_packages_apps_Settings_OLD", "path": "src/com/android/settings/SettingsPreferenceFragment.java", "license": "apache-2.0", "size": 18430 }
[ "android.preference.PreferenceGroupAdapter", "android.widget.ListAdapter", "android.widget.ListView" ]
import android.preference.PreferenceGroupAdapter; import android.widget.ListAdapter; import android.widget.ListView;
import android.preference.*; import android.widget.*;
[ "android.preference", "android.widget" ]
android.preference; android.widget;
521,022
public Source resolve(String uriPath) throws IOException, URISyntaxException { if ("".equals(uriPath)) { return this; // Or the parent directory. } String[] parts = uriPath.split("/+"); File relFile; // Relative path to the resolved file. if ("".equals(parts[0])) { // uriPath.startsWith("/") relFile = null; } else { relFile = relativePath.getParentFile(); } File absFile; // Absolute path to the resolved file. if (relFile != null) { absFile = new File(FilenameUtils.concat( this.root.f.getPath(), relFile.getPath())); } else { absFile = this.root.f; } boolean sawPathParts = false; for (String part : parts) { if ("".equals(part)) { continue; } relFile = new File(relFile, part); absFile = new File(absFile, part); sawPathParts = true; } if (relFile == null || !sawPathParts) { throw new URISyntaxException(uriPath, "No path parts"); } // We need to normalize to get rid of .. and . path segments. absFile = absFile.getCanonicalFile(); relFile = new File(FilenameUtils.normalizeNoEndSeparator( relFile.getPath())); return new Source(absFile, root, relFile); } }
Source function(String uriPath) throws IOException, URISyntaxException { if (STR/+STRSTRSTRNo path parts"); } absFile = absFile.getCanonicalFile(); relFile = new File(FilenameUtils.normalizeNoEndSeparator( relFile.getPath())); return new Source(absFile, root, relFile); } }
/** * Resolves the given path against this source file. */
Resolves the given path against this source file
resolve
{ "repo_name": "mikesamuel/closure-maven-plugin", "path": "plugin/src/main/java/com/google/closure/plugin/common/Sources.java", "license": "apache-2.0", "size": 6819 }
[ "java.io.File", "java.io.IOException", "java.net.URISyntaxException", "org.apache.commons.io.FilenameUtils" ]
import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import org.apache.commons.io.FilenameUtils;
import java.io.*; import java.net.*; import org.apache.commons.io.*;
[ "java.io", "java.net", "org.apache.commons" ]
java.io; java.net; org.apache.commons;
720,952
int id = Util.getRandomId(); String detail = Jsoup.connect(Util.BASE_URL + id).get().select(Util.SELECTOR).first().text(); return new Fact(id, detail); }
int id = Util.getRandomId(); String detail = Jsoup.connect(Util.BASE_URL + id).get().select(Util.SELECTOR).first().text(); return new Fact(id, detail); }
/** * Parses a fact from the Snapple website. * @return the fact object * @throws IOException */
Parses a fact from the Snapple website
getFact
{ "repo_name": "masriamir/snapple-facts", "path": "src/main/java/com/akm/snapplefacts/dao/FactDAOImpl.java", "license": "mit", "size": 708 }
[ "com.akm.snapplefacts.model.Fact", "com.akm.snapplefacts.util.Util", "org.jsoup.Jsoup" ]
import com.akm.snapplefacts.model.Fact; import com.akm.snapplefacts.util.Util; import org.jsoup.Jsoup;
import com.akm.snapplefacts.model.*; import com.akm.snapplefacts.util.*; import org.jsoup.*;
[ "com.akm.snapplefacts", "org.jsoup" ]
com.akm.snapplefacts; org.jsoup;
2,754,341
CallInvokerHolder getNativeCallInvokerHolder();
CallInvokerHolder getNativeCallInvokerHolder();
/** * Returns a hybrid object that contains a pointer to a Native CallInvoker, which is used to * schedule work on the NativeModules thread. Required for TurboModuleManager initialization. */
Returns a hybrid object that contains a pointer to a Native CallInvoker, which is used to schedule work on the NativeModules thread. Required for TurboModuleManager initialization
getNativeCallInvokerHolder
{ "repo_name": "pandiaraj44/react-native", "path": "ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java", "license": "bsd-3-clause", "size": 5001 }
[ "com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder" ]
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder;
import com.facebook.react.turbomodule.core.interfaces.*;
[ "com.facebook.react" ]
com.facebook.react;
562,390
public static Test suite() { return (new TestSuite(BeanComparatorTestCase.class)); }
static Test function() { return (new TestSuite(BeanComparatorTestCase.class)); }
/** * Return the tests included in this test suite. */
Return the tests included in this test suite
suite
{ "repo_name": "vorburger/apache-commons-beanutils", "path": "src/test/java/org/apache/commons/beanutils/BeanComparatorTestCase.java", "license": "apache-2.0", "size": 7424 }
[ "junit.framework.Test", "junit.framework.TestSuite" ]
import junit.framework.Test; import junit.framework.TestSuite;
import junit.framework.*;
[ "junit.framework" ]
junit.framework;
1,933,788
public OffsetDateTime getLockExpirationTime() { return lockExpirationTime; }
OffsetDateTime function() { return lockExpirationTime; }
/** * The date that the task&#39;s most recent lock expires or has expired. * @return lockExpirationTime **/
The date that the task&#39;s most recent lock expires or has expired
getLockExpirationTime
{ "repo_name": "camunda/camunda-consulting", "path": "snippets/camunda-openapi-client/camunda-openapi-client/src/gen/java/main/com/camunda/consulting/openapi/client/model/ExternalTaskDto.java", "license": "apache-2.0", "size": 16749 }
[ "org.threeten.bp.OffsetDateTime" ]
import org.threeten.bp.OffsetDateTime;
import org.threeten.bp.*;
[ "org.threeten.bp" ]
org.threeten.bp;
1,929,287
@Test public void testIterator() { assertThat(new EmptyDocument().iterator().hasNext(), is(false)); }
void function() { assertThat(new EmptyDocument().iterator().hasNext(), is(false)); }
/** * Test method for {@link EmptyDocument#iterator()}. */
Test method for <code>EmptyDocument#iterator()</code>
testIterator
{ "repo_name": "allanbank/mongodb-async-driver", "path": "src/test/java/com/allanbank/mongodb/bson/impl/EmptyDocumentTest.java", "license": "apache-2.0", "size": 6338 }
[ "org.hamcrest.CoreMatchers", "org.junit.Assert" ]
import org.hamcrest.CoreMatchers; import org.junit.Assert;
import org.hamcrest.*; import org.junit.*;
[ "org.hamcrest", "org.junit" ]
org.hamcrest; org.junit;
2,660,399
public PostingsFormat getPostingsFormatForField(String field) { return defaultFormat; }
PostingsFormat function(String field) { return defaultFormat; }
/** Returns the postings format that should be used for writing * new segments of <code>field</code>. * * The default implementation always returns "Lucene50". * <p> * <b>WARNING:</b> if you subclass, you are responsible for index * backwards compatibility: future version of Lucene are only * guaranteed to be able to read the default implementation. */
Returns the postings format that should be used for writing new segments of <code>field</code>. The default implementation always returns "Lucene50". backwards compatibility: future version of Lucene are only guaranteed to be able to read the default implementation
getPostingsFormatForField
{ "repo_name": "PATRIC3/p3_solr", "path": "lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene50/Lucene50Codec.java", "license": "apache-2.0", "size": 5557 }
[ "org.apache.lucene.codecs.PostingsFormat" ]
import org.apache.lucene.codecs.PostingsFormat;
import org.apache.lucene.codecs.*;
[ "org.apache.lucene" ]
org.apache.lucene;
1,316,864
@Override public void mouseEntered(MouseEvent me) { mouseIsOverPopupButton = true; }
void function(MouseEvent me) { mouseIsOverPopupButton = true; }
/** * Keeps track of mouseover status. */
Keeps track of mouseover status
mouseEntered
{ "repo_name": "ckaestne/LEADT", "path": "workspace/argouml_diagrams/argouml-app/src/org/argouml/ui/ZoomSliderButton.java", "license": "gpl-3.0", "size": 11803 }
[ "java.awt.event.MouseEvent" ]
import java.awt.event.MouseEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
1,522,744
boolean validChannel(DeviceId deviceId, PortNumber portNumber, OchSignal ochSignal);
boolean validChannel(DeviceId deviceId, PortNumber portNumber, OchSignal ochSignal);
/** * Returns true if the channel is supported by the port. The port can be either * an input or output port. * * @param deviceId DeviceId of the device to check * @param portNumber PortNumber of the port to check * @param ochSignal channel to check * @return true if the channel is supported by the port, false otherwise */
Returns true if the channel is supported by the port. The port can be either an input or output port
validChannel
{ "repo_name": "donNewtonAlpha/onos", "path": "apps/roadm/src/main/java/org/onosproject/roadm/RoadmService.java", "license": "apache-2.0", "size": 11386 }
[ "org.onosproject.net.DeviceId", "org.onosproject.net.OchSignal", "org.onosproject.net.PortNumber" ]
import org.onosproject.net.DeviceId; import org.onosproject.net.OchSignal; import org.onosproject.net.PortNumber;
import org.onosproject.net.*;
[ "org.onosproject.net" ]
org.onosproject.net;
558,089
public Searcher[] createSearchers(String indexDirs) throws Exception { String[] dirs = StringUtils.split(indexDirs, ","); List<IndexSearcher> searchersList = new ArrayList<IndexSearcher>(); for (int i = 0; i < dirs.length; i++) { try { if (!IndexReader.indexExists(dirs[i])) { // If there's no index there, create an empty one; otherwise the reader // constructor will throw an exception and fail to initialize new IndexWriter(dirs[i], analyzer).close(); } searchersList.add(new IndexSearcher(dirs[i], true)); } catch (IOException e) { LOG.error("cannot open index " + dirs[i], e); } } return searchersList.toArray(new Searcher[searchersList.size()]); }
Searcher[] function(String indexDirs) throws Exception { String[] dirs = StringUtils.split(indexDirs, ","); List<IndexSearcher> searchersList = new ArrayList<IndexSearcher>(); for (int i = 0; i < dirs.length; i++) { try { if (!IndexReader.indexExists(dirs[i])) { new IndexWriter(dirs[i], analyzer).close(); } searchersList.add(new IndexSearcher(dirs[i], true)); } catch (IOException e) { LOG.error(STR + dirs[i], e); } } return searchersList.toArray(new Searcher[searchersList.size()]); }
/** * Creates an array of Searchers for a number of lucene indexes. * * @param indexDirs Comma separated list of Lucene index directories to create searchers for. * @return Array of searchers */
Creates an array of Searchers for a number of lucene indexes
createSearchers
{ "repo_name": "i2geo/i2gCurrikiFork", "path": "plugins/lucene/src/main/java/com/xpn/xwiki/plugin/lucene/LucenePlugin.java", "license": "lgpl-2.1", "size": 27679 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.List", "org.apache.commons.lang.StringUtils", "org.apache.lucene.index.IndexReader", "org.apache.lucene.index.IndexWriter", "org.apache.lucene.search.IndexSearcher", "org.apache.lucene.search.Searcher" ]
import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang.StringUtils; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Searcher;
import java.io.*; import java.util.*; import org.apache.commons.lang.*; import org.apache.lucene.index.*; import org.apache.lucene.search.*;
[ "java.io", "java.util", "org.apache.commons", "org.apache.lucene" ]
java.io; java.util; org.apache.commons; org.apache.lucene;
2,020,648
@Override public boolean equals(Object object) { if (object == this) return true; if ((object == null) || !(object instanceof RouterAddress)) return false; RouterAddress addr = (RouterAddress) object; return getPort() == addr.getPort() && DataHelper.eq(getHost(), addr.getHost()) && DataHelper.eq(_transportStyle, addr._transportStyle); //DataHelper.eq(_options, addr._options) && //DataHelper.eq(_expiration, addr._expiration); }
boolean function(Object object) { if (object == this) return true; if ((object == null) !(object instanceof RouterAddress)) return false; RouterAddress addr = (RouterAddress) object; return getPort() == addr.getPort() && DataHelper.eq(getHost(), addr.getHost()) && DataHelper.eq(_transportStyle, addr._transportStyle); }
/** * Transport, host, and port only. * Never look at cost or other properties. */
Transport, host, and port only. Never look at cost or other properties
equals
{ "repo_name": "NoYouShutup/CryptMeme", "path": "CryptMeme/router/java/src/net/i2p/data/router/RouterAddress.java", "license": "mit", "size": 11420 }
[ "net.i2p.data.DataHelper" ]
import net.i2p.data.DataHelper;
import net.i2p.data.*;
[ "net.i2p.data" ]
net.i2p.data;
1,013,331
public boolean evalGroovyExpression(AxisList axes, String expression) { return evalGroovyExpression(axes, expression, new Binding()); } /** * @see #evalGroovyExpression(AxisList, String) * @since 1.515 * @deprecated as of 1.528 * Use {@link FilterScript#apply(MatrixBuildExecution, Combination)}
boolean function(AxisList axes, String expression) { return evalGroovyExpression(axes, expression, new Binding()); } /** * @see #evalGroovyExpression(AxisList, String) * @since 1.515 * @deprecated as of 1.528 * Use {@link FilterScript#apply(MatrixBuildExecution, Combination)}
/** * Evaluates the given Groovy expression with values bound from this combination. * * <p> * For example, if this combination is a=X,b=Y, then expressions like <tt>a=="X"</tt> would evaluate to * true. */
Evaluates the given Groovy expression with values bound from this combination. For example, if this combination is a=X,b=Y, then expressions like a=="X" would evaluate to true
evalGroovyExpression
{ "repo_name": "jspotanski/jenkins-master", "path": "core/src/main/java/hudson/matrix/Combination.java", "license": "mit", "size": 8696 }
[ "groovy.lang.Binding", "hudson.matrix.MatrixBuild" ]
import groovy.lang.Binding; import hudson.matrix.MatrixBuild;
import groovy.lang.*; import hudson.matrix.*;
[ "groovy.lang", "hudson.matrix" ]
groovy.lang; hudson.matrix;
706,012
private void processProvideCall(NodeTraversal t, Node n, Node parent) { Node left = n.getFirstChild(); Node arg = left.getNext(); if (verifyProvide(t, left, arg)) { String ns = arg.getString(); maybeAddToSymbolTable(left); maybeAddStringNodeToSymbolTable(arg); if (providedNames.containsKey(ns)) { ProvidedName previouslyProvided = providedNames.get(ns); if (!previouslyProvided.isExplicitlyProvided()) { previouslyProvided.addProvide(parent, t.getModule(), true); } else { compiler.report( t.makeError(n, DUPLICATE_NAMESPACE_ERROR, ns)); } } else { registerAnyProvidedPrefixes(ns, parent, t.getModule()); providedNames.put( ns, new ProvidedName(ns, parent, t.getModule(), true)); } } }
void function(NodeTraversal t, Node n, Node parent) { Node left = n.getFirstChild(); Node arg = left.getNext(); if (verifyProvide(t, left, arg)) { String ns = arg.getString(); maybeAddToSymbolTable(left); maybeAddStringNodeToSymbolTable(arg); if (providedNames.containsKey(ns)) { ProvidedName previouslyProvided = providedNames.get(ns); if (!previouslyProvided.isExplicitlyProvided()) { previouslyProvided.addProvide(parent, t.getModule(), true); } else { compiler.report( t.makeError(n, DUPLICATE_NAMESPACE_ERROR, ns)); } } else { registerAnyProvidedPrefixes(ns, parent, t.getModule()); providedNames.put( ns, new ProvidedName(ns, parent, t.getModule(), true)); } } }
/** * Handles a goog.provide call. */
Handles a goog.provide call
processProvideCall
{ "repo_name": "pauldraper/closure-compiler", "path": "src/com/google/javascript/jscomp/ProcessClosurePrimitives.java", "license": "apache-2.0", "size": 54586 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
2,010,788
public static DenseMatrix64F calibrationMatrix(CameraPinholeRadial param , DenseMatrix64F K ) { if( K == null ) { K = new DenseMatrix64F(3,3); } CommonOps.fill(K, 0); K.data[0] = param.fx; K.data[1] = param.skew; K.data[2] = param.cx; K.data[4] = param.fy; K.data[5] = param.cy; K.data[8] = 1; return K; }
static DenseMatrix64F function(CameraPinholeRadial param , DenseMatrix64F K ) { if( K == null ) { K = new DenseMatrix64F(3,3); } CommonOps.fill(K, 0); K.data[0] = param.fx; K.data[1] = param.skew; K.data[2] = param.cx; K.data[4] = param.fy; K.data[5] = param.cy; K.data[8] = 1; return K; }
/** * Given the intrinsic parameters create a calibration matrix * * @param param Intrinsic parameters structure that is to be converted into a matrix * @param K Storage for calibration matrix, must be 3x3. If null then a new matrix is declared * @return Calibration matrix 3x3 */
Given the intrinsic parameters create a calibration matrix
calibrationMatrix
{ "repo_name": "bladestery/Sapphire", "path": "example_apps/AndroidStudioMinnie/sapphire/src/main/java/boofcv/alg/geo/PerspectiveOps.java", "license": "mit", "size": 17312 }
[ "org.ejml.data.DenseMatrix64F", "org.ejml.ops.CommonOps" ]
import org.ejml.data.DenseMatrix64F; import org.ejml.ops.CommonOps;
import org.ejml.data.*; import org.ejml.ops.*;
[ "org.ejml.data", "org.ejml.ops" ]
org.ejml.data; org.ejml.ops;
1,531,526
public Integer startRegisteredCollators(CollatorKey collatorKey){ int iCollatorCount = 0; for(Iterator<String> iter = registeredCollators.keySet().iterator(); iter.hasNext(); ){ String key = iter.next(); Class<? extends Collator> clazz = registeredCollators.get(key); try{ add(collatorKey, key, clazz); iCollatorCount++; }catch(Throwable t){ } } return iCollatorCount; }
Integer function(CollatorKey collatorKey){ int iCollatorCount = 0; for(Iterator<String> iter = registeredCollators.keySet().iterator(); iter.hasNext(); ){ String key = iter.next(); Class<? extends Collator> clazz = registeredCollators.get(key); try{ add(collatorKey, key, clazz); iCollatorCount++; }catch(Throwable t){ } } return iCollatorCount; }
/** * Public method to start all the collators registered within the system * * @param collatorKey * The collator key * @return the no of Collators started */
Public method to start all the collators registered within the system
startRegisteredCollators
{ "repo_name": "MastekLtd/JBEAM", "path": "jbeam-core-components/jbeam-monitor-comm/src/main/java/com/stgmastek/monitor/comm/util/Collators.java", "license": "lgpl-3.0", "size": 6356 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
83,440
@Override public void visitCode(Code obj) { Method m = getMethod(); if ((!m.isStatic() || !Values.STATIC_INITIALIZER.equals(m.getName())) && (!m.getName().contains("enum constant"))) { // a findbugs thing!! byte[] code = obj.getCode(); if (code.length >= UNJITABLE_CODE_LENGTH) { bugReporter.reportBug(new BugInstance(this, BugType.UJM_UNJITABLE_METHOD.name(), NORMAL_PRIORITY).addClass(this).addMethod(this) .addString("Code Bytes: " + code.length)); } } }
void function(Code obj) { Method m = getMethod(); if ((!m.isStatic() !Values.STATIC_INITIALIZER.equals(m.getName())) && (!m.getName().contains(STR))) { byte[] code = obj.getCode(); if (code.length >= UNJITABLE_CODE_LENGTH) { bugReporter.reportBug(new BugInstance(this, BugType.UJM_UNJITABLE_METHOD.name(), NORMAL_PRIORITY).addClass(this).addMethod(this) .addString(STR + code.length)); } } }
/** * implements the visitor to look at the size of the method. static initializer are ignored as these will only be executed once anyway. * * @param obj * the context object of the currently parsed method */
implements the visitor to look at the size of the method. static initializer are ignored as these will only be executed once anyway
visitCode
{ "repo_name": "rblasch/fb-contrib", "path": "src/main/java/com/mebigfatguy/fbcontrib/detect/Unjitable.java", "license": "lgpl-2.1", "size": 3057 }
[ "com.mebigfatguy.fbcontrib.utils.BugType", "com.mebigfatguy.fbcontrib.utils.Values", "edu.umd.cs.findbugs.BugInstance", "org.apache.bcel.classfile.Code", "org.apache.bcel.classfile.Method" ]
import com.mebigfatguy.fbcontrib.utils.BugType; import com.mebigfatguy.fbcontrib.utils.Values; import edu.umd.cs.findbugs.BugInstance; import org.apache.bcel.classfile.Code; import org.apache.bcel.classfile.Method;
import com.mebigfatguy.fbcontrib.utils.*; import edu.umd.cs.findbugs.*; import org.apache.bcel.classfile.*;
[ "com.mebigfatguy.fbcontrib", "edu.umd.cs", "org.apache.bcel" ]
com.mebigfatguy.fbcontrib; edu.umd.cs; org.apache.bcel;
2,084,878
void addToInvalidates(Block b, DatanodeInfo dn, boolean log) { Collection<Block> invalidateSet = recentInvalidateSets .get(dn.getStorageID()); if (invalidateSet == null) { invalidateSet = new HashSet<Block>(); recentInvalidateSets.put(dn.getStorageID(), invalidateSet); } if (invalidateSet.add(b)) { pendingDeletionBlocksCount++; if (log) { NameNode.stateChangeLog.info("BLOCK* NameSystem.addToInvalidates: " + b + " to " + dn.getName()); } } }
void addToInvalidates(Block b, DatanodeInfo dn, boolean log) { Collection<Block> invalidateSet = recentInvalidateSets .get(dn.getStorageID()); if (invalidateSet == null) { invalidateSet = new HashSet<Block>(); recentInvalidateSets.put(dn.getStorageID(), invalidateSet); } if (invalidateSet.add(b)) { pendingDeletionBlocksCount++; if (log) { NameNode.stateChangeLog.info(STR + b + STR + dn.getName()); } } }
/** * Adds block to list of blocks which will be invalidated on specified * datanode * * @param b block * @param dn datanode * @param log true to create an entry in the log */
Adds block to list of blocks which will be invalidated on specified datanode
addToInvalidates
{ "repo_name": "cumulusyebl/cumulus", "path": "src/java/org/apache/hadoop/hdfs/server/namenode/BlockManager.java", "license": "apache-2.0", "size": 79073 }
[ "java.util.Collection", "java.util.HashSet", "org.apache.hadoop.hdfs.protocol.Block", "org.apache.hadoop.hdfs.protocol.DatanodeInfo" ]
import java.util.Collection; import java.util.HashSet; import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
import java.util.*; import org.apache.hadoop.hdfs.protocol.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
77,295
void recordHeartbeat(QueryId queryId);
void recordHeartbeat(QueryId queryId);
/** * Updates the client heartbeat time, to prevent the query from be automatically purged. * If the query does not exist, the call is ignored. */
Updates the client heartbeat time, to prevent the query from be automatically purged. If the query does not exist, the call is ignored
recordHeartbeat
{ "repo_name": "miniway/presto", "path": "presto-main/src/main/java/io/prestosql/execution/QueryManager.java", "license": "apache-2.0", "size": 4125 }
[ "io.prestosql.spi.QueryId" ]
import io.prestosql.spi.QueryId;
import io.prestosql.spi.*;
[ "io.prestosql.spi" ]
io.prestosql.spi;
2,654,735
public java.sql.Array getArray(String colName) throws SQLException { return getArray(findColumn(colName)); }
java.sql.Array function(String colName) throws SQLException { return getArray(findColumn(colName)); }
/** * JDBC 2.0 Get an array column. * * @param colName * the column name * * @return an object representing an SQL array * * @throws SQLException * if a database error occurs * @throws NotImplemented */
JDBC 2.0 Get an array column
getArray
{ "repo_name": "mwaylabs/mysql-connector-j", "path": "src/com/mysql/jdbc/ResultSetImpl.java", "license": "gpl-2.0", "size": 288724 }
[ "java.sql.Array", "java.sql.SQLException" ]
import java.sql.Array; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,180,153
@Override public void handleEvent(ResourceEvent event, Object resource) { if (!shouldProceed(event)) { return; } try { if (event == ResourceEvent.CACHE_CREATE || event == ResourceEvent.CACHE_REMOVE) { readWriteLock.writeLock().lockInterruptibly(); } else if (event != ResourceEvent.SYSTEM_ALERT) { readWriteLock.readLock().lockInterruptibly(); } } catch (InterruptedException e) { // prefer CancelException if shutting down cancelCriterion.checkCancelInProgress(e); throw new RuntimeException(e); } try { switch (event) { case CACHE_CREATE: InternalCache createdCache = (InternalCache) resource; adapter.handleCacheCreation(createdCache); break; case CACHE_REMOVE: InternalCache removedCache = (InternalCache) resource; adapter.handleCacheRemoval(); break; case REGION_CREATE: Region createdRegion = (Region) resource; adapter.handleRegionCreation(createdRegion); break; case REGION_REMOVE: Region removedRegion = (Region) resource; adapter.handleRegionRemoval(removedRegion); break; case DISKSTORE_CREATE: DiskStore createdDisk = (DiskStore) resource; adapter.handleDiskCreation(createdDisk); break; case DISKSTORE_REMOVE: DiskStore removedDisk = (DiskStore) resource; adapter.handleDiskRemoval(removedDisk); break; case GATEWAYRECEIVER_CREATE: GatewayReceiver createdRecv = (GatewayReceiver) resource; adapter.handleGatewayReceiverCreate(createdRecv); break; case GATEWAYRECEIVER_DESTROY: GatewayReceiver destroyedRecv = (GatewayReceiver) resource; adapter.handleGatewayReceiverDestroy(); break; case GATEWAYRECEIVER_START: GatewayReceiver startedRecv = (GatewayReceiver) resource; adapter.handleGatewayReceiverStart(startedRecv); break; case GATEWAYRECEIVER_STOP: GatewayReceiver stoppededRecv = (GatewayReceiver) resource; adapter.handleGatewayReceiverStop(); break; case GATEWAYSENDER_CREATE: GatewaySender sender = (GatewaySender) resource; adapter.handleGatewaySenderCreation(sender); break; case GATEWAYSENDER_START: GatewaySender startedSender = (GatewaySender) resource; adapter.handleGatewaySenderStart(startedSender); break; case GATEWAYSENDER_STOP: GatewaySender stoppedSender = (GatewaySender) resource; adapter.handleGatewaySenderStop(stoppedSender); break; case GATEWAYSENDER_PAUSE: GatewaySender pausedSender = (GatewaySender) resource; adapter.handleGatewaySenderPaused(pausedSender); break; case GATEWAYSENDER_RESUME: GatewaySender resumedSender = (GatewaySender) resource; adapter.handleGatewaySenderResumed(resumedSender); break; case GATEWAYSENDER_REMOVE: GatewaySender removedSender = (GatewaySender) resource; adapter.handleGatewaySenderRemoved(removedSender); break; case LOCKSERVICE_CREATE: DLockService createdLockService = (DLockService) resource; adapter.handleLockServiceCreation(createdLockService); break; case LOCKSERVICE_REMOVE: DLockService removedLockService = (DLockService) resource; adapter.handleLockServiceRemoval(removedLockService); break; case MANAGER_CREATE: adapter.handleManagerCreation(); break; case MANAGER_START: adapter.handleManagerStart(); break; case MANAGER_STOP: adapter.handleManagerStop(); break; case ASYNCEVENTQUEUE_CREATE: AsyncEventQueue queue = (AsyncEventQueue) resource; adapter.handleAsyncEventQueueCreation(queue); break; case ASYNCEVENTQUEUE_REMOVE: AsyncEventQueue removedQueue = (AsyncEventQueue) resource; adapter.handleAsyncEventQueueRemoval(removedQueue); break; case SYSTEM_ALERT: AlertDetails details = (AlertDetails) resource; adapter.handleSystemNotification(details); break; case CACHE_SERVER_START: CacheServer startedServer = (CacheServer) resource; adapter.handleCacheServerStart(startedServer); break; case CACHE_SERVER_STOP: CacheServer stoppedServer = (CacheServer) resource; adapter.handleCacheServerStop(stoppedServer); break; case LOCATOR_START: Locator loc = (Locator) resource; adapter.handleLocatorStart(loc); break; case CACHE_SERVICE_CREATE: CacheService service = (CacheService) resource; adapter.handleCacheServiceCreation(service); break; default: break; } } finally { if (event == ResourceEvent.CACHE_CREATE || event == ResourceEvent.CACHE_REMOVE) { readWriteLock.writeLock().unlock(); } else if (event != ResourceEvent.SYSTEM_ALERT) { readWriteLock.readLock().unlock(); } } }
void function(ResourceEvent event, Object resource) { if (!shouldProceed(event)) { return; } try { if (event == ResourceEvent.CACHE_CREATE event == ResourceEvent.CACHE_REMOVE) { readWriteLock.writeLock().lockInterruptibly(); } else if (event != ResourceEvent.SYSTEM_ALERT) { readWriteLock.readLock().lockInterruptibly(); } } catch (InterruptedException e) { cancelCriterion.checkCancelInProgress(e); throw new RuntimeException(e); } try { switch (event) { case CACHE_CREATE: InternalCache createdCache = (InternalCache) resource; adapter.handleCacheCreation(createdCache); break; case CACHE_REMOVE: InternalCache removedCache = (InternalCache) resource; adapter.handleCacheRemoval(); break; case REGION_CREATE: Region createdRegion = (Region) resource; adapter.handleRegionCreation(createdRegion); break; case REGION_REMOVE: Region removedRegion = (Region) resource; adapter.handleRegionRemoval(removedRegion); break; case DISKSTORE_CREATE: DiskStore createdDisk = (DiskStore) resource; adapter.handleDiskCreation(createdDisk); break; case DISKSTORE_REMOVE: DiskStore removedDisk = (DiskStore) resource; adapter.handleDiskRemoval(removedDisk); break; case GATEWAYRECEIVER_CREATE: GatewayReceiver createdRecv = (GatewayReceiver) resource; adapter.handleGatewayReceiverCreate(createdRecv); break; case GATEWAYRECEIVER_DESTROY: GatewayReceiver destroyedRecv = (GatewayReceiver) resource; adapter.handleGatewayReceiverDestroy(); break; case GATEWAYRECEIVER_START: GatewayReceiver startedRecv = (GatewayReceiver) resource; adapter.handleGatewayReceiverStart(startedRecv); break; case GATEWAYRECEIVER_STOP: GatewayReceiver stoppededRecv = (GatewayReceiver) resource; adapter.handleGatewayReceiverStop(); break; case GATEWAYSENDER_CREATE: GatewaySender sender = (GatewaySender) resource; adapter.handleGatewaySenderCreation(sender); break; case GATEWAYSENDER_START: GatewaySender startedSender = (GatewaySender) resource; adapter.handleGatewaySenderStart(startedSender); break; case GATEWAYSENDER_STOP: GatewaySender stoppedSender = (GatewaySender) resource; adapter.handleGatewaySenderStop(stoppedSender); break; case GATEWAYSENDER_PAUSE: GatewaySender pausedSender = (GatewaySender) resource; adapter.handleGatewaySenderPaused(pausedSender); break; case GATEWAYSENDER_RESUME: GatewaySender resumedSender = (GatewaySender) resource; adapter.handleGatewaySenderResumed(resumedSender); break; case GATEWAYSENDER_REMOVE: GatewaySender removedSender = (GatewaySender) resource; adapter.handleGatewaySenderRemoved(removedSender); break; case LOCKSERVICE_CREATE: DLockService createdLockService = (DLockService) resource; adapter.handleLockServiceCreation(createdLockService); break; case LOCKSERVICE_REMOVE: DLockService removedLockService = (DLockService) resource; adapter.handleLockServiceRemoval(removedLockService); break; case MANAGER_CREATE: adapter.handleManagerCreation(); break; case MANAGER_START: adapter.handleManagerStart(); break; case MANAGER_STOP: adapter.handleManagerStop(); break; case ASYNCEVENTQUEUE_CREATE: AsyncEventQueue queue = (AsyncEventQueue) resource; adapter.handleAsyncEventQueueCreation(queue); break; case ASYNCEVENTQUEUE_REMOVE: AsyncEventQueue removedQueue = (AsyncEventQueue) resource; adapter.handleAsyncEventQueueRemoval(removedQueue); break; case SYSTEM_ALERT: AlertDetails details = (AlertDetails) resource; adapter.handleSystemNotification(details); break; case CACHE_SERVER_START: CacheServer startedServer = (CacheServer) resource; adapter.handleCacheServerStart(startedServer); break; case CACHE_SERVER_STOP: CacheServer stoppedServer = (CacheServer) resource; adapter.handleCacheServerStop(stoppedServer); break; case LOCATOR_START: Locator loc = (Locator) resource; adapter.handleLocatorStart(loc); break; case CACHE_SERVICE_CREATE: CacheService service = (CacheService) resource; adapter.handleCacheServiceCreation(service); break; default: break; } } finally { if (event == ResourceEvent.CACHE_CREATE event == ResourceEvent.CACHE_REMOVE) { readWriteLock.writeLock().unlock(); } else if (event != ResourceEvent.SYSTEM_ALERT) { readWriteLock.readLock().unlock(); } } }
/** * Handles various GFE resource life-cycle methods vis-a-vis Management and Monitoring * * It checks for race conditions cases by calling shouldProceed(); * * @param event Management event for which invocation has happened * @param resource the GFE resource type */
Handles various GFE resource life-cycle methods vis-a-vis Management and Monitoring It checks for race conditions cases by calling shouldProceed()
handleEvent
{ "repo_name": "smgoller/geode", "path": "geode-core/src/main/java/org/apache/geode/management/internal/beans/ManagementListener.java", "license": "apache-2.0", "size": 9557 }
[ "org.apache.geode.cache.DiskStore", "org.apache.geode.cache.Region", "org.apache.geode.cache.asyncqueue.AsyncEventQueue", "org.apache.geode.cache.server.CacheServer", "org.apache.geode.cache.wan.GatewayReceiver", "org.apache.geode.cache.wan.GatewaySender", "org.apache.geode.distributed.Locator", "org.apache.geode.distributed.internal.ResourceEvent", "org.apache.geode.distributed.internal.locks.DLockService", "org.apache.geode.internal.cache.CacheService", "org.apache.geode.internal.cache.InternalCache", "org.apache.geode.management.internal.AlertDetails" ]
import org.apache.geode.cache.DiskStore; import org.apache.geode.cache.Region; import org.apache.geode.cache.asyncqueue.AsyncEventQueue; import org.apache.geode.cache.server.CacheServer; import org.apache.geode.cache.wan.GatewayReceiver; import org.apache.geode.cache.wan.GatewaySender; import org.apache.geode.distributed.Locator; import org.apache.geode.distributed.internal.ResourceEvent; import org.apache.geode.distributed.internal.locks.DLockService; import org.apache.geode.internal.cache.CacheService; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.management.internal.AlertDetails;
import org.apache.geode.cache.*; import org.apache.geode.cache.asyncqueue.*; import org.apache.geode.cache.server.*; import org.apache.geode.cache.wan.*; import org.apache.geode.distributed.*; import org.apache.geode.distributed.internal.*; import org.apache.geode.distributed.internal.locks.*; import org.apache.geode.internal.cache.*; import org.apache.geode.management.internal.*;
[ "org.apache.geode" ]
org.apache.geode;
420,576
@SuppressWarnings("unchecked") public void insert(Record record) throws DBPrimaryKeyException, DBConstraintException, DBException { // This method cannot be used on schemata with auto-incrementing PKs: if(autoIncrementKeySapColumn != null) throw new UnsupportedOperationException("Default SQLRecordStore.SQLTable#insert(Record) implementation does not support setting auto-incrementing key values."); //else... executeSQL(new RecordInsertHelper((STable) this, record).getQuery()); }
@SuppressWarnings(STR) void function(Record record) throws DBPrimaryKeyException, DBConstraintException, DBException { if(autoIncrementKeySapColumn != null) throw new UnsupportedOperationException(STR); executeSQL(new RecordInsertHelper((STable) this, record).getQuery()); }
/** * Insert new record in database table. * Assumes the table exists in the database! * * *Must* be overridden in order to support auto incrementing keys. * * @throws DBPrimaryKeyException * @throws DBConstraintException * @throws DBException */
Insert new record in database table. Assumes the table exists in the database! Must* be overridden in order to support auto incrementing keys
insert
{ "repo_name": "dave-cassettari/sapelli", "path": "Library/src/uk/ac/ucl/excites/sapelli/storage/db/sql/SQLRecordStore.java", "license": "unlicense", "size": 62149 }
[ "uk.ac.ucl.excites.sapelli.shared.db.exceptions.DBConstraintException", "uk.ac.ucl.excites.sapelli.shared.db.exceptions.DBException", "uk.ac.ucl.excites.sapelli.shared.db.exceptions.DBPrimaryKeyException", "uk.ac.ucl.excites.sapelli.storage.model.Record" ]
import uk.ac.ucl.excites.sapelli.shared.db.exceptions.DBConstraintException; import uk.ac.ucl.excites.sapelli.shared.db.exceptions.DBException; import uk.ac.ucl.excites.sapelli.shared.db.exceptions.DBPrimaryKeyException; import uk.ac.ucl.excites.sapelli.storage.model.Record;
import uk.ac.ucl.excites.sapelli.shared.db.exceptions.*; import uk.ac.ucl.excites.sapelli.storage.model.*;
[ "uk.ac.ucl" ]
uk.ac.ucl;
1,077,332
@ApiModelProperty(value = "Name of the report") public String getReportName() { return reportName; }
@ApiModelProperty(value = STR) String function() { return reportName; }
/** * Name of the report * * @return reportName */
Name of the report
getReportName
{ "repo_name": "SidneyAllen/Xero-Java", "path": "src/main/java/com/xero/models/accounting/ReportWithRow.java", "license": "mit", "size": 8022 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
775,800
@Override public void readFrom(int startPos, int numElems, ImageInputStream source) throws IOException { source.readFully(_array, startPos, numElems); }
void function(int startPos, int numElems, ImageInputStream source) throws IOException { source.readFully(_array, startPos, numElems); }
/** * Please refer to {@link ProductData#readFrom(int, int, ImageInputStream)}. */
Please refer to <code>ProductData#readFrom(int, int, ImageInputStream)</code>
readFrom
{ "repo_name": "seadas/beam", "path": "beam-core/src/main/java/org/esa/beam/framework/datamodel/ProductData.java", "license": "gpl-3.0", "size": 100346 }
[ "java.io.IOException", "javax.imageio.stream.ImageInputStream" ]
import java.io.IOException; import javax.imageio.stream.ImageInputStream;
import java.io.*; import javax.imageio.stream.*;
[ "java.io", "javax.imageio" ]
java.io; javax.imageio;
2,682,740
public String generateToken() throws OpenTokException { // NOTE: maybe there should be a static object for the defaultTokenOptions? return this.generateToken(new TokenOptions.Builder().build()); }
String function() throws OpenTokException { return this.generateToken(new TokenOptions.Builder().build()); }
/** * Generates the token for the session. The role is set to publisher, the token expires in * 24 hours, and there is no connection data. * * @return The token string. * * @see #generateToken(TokenOptions tokenOptions) */
Generates the token for the session. The role is set to publisher, the token expires in 24 hours, and there is no connection data
generateToken
{ "repo_name": "Kwasniewski/Opentok-Java-SDK", "path": "src/main/java/com/opentok/Session.java", "license": "mit", "size": 7524 }
[ "com.opentok.exception.OpenTokException" ]
import com.opentok.exception.OpenTokException;
import com.opentok.exception.*;
[ "com.opentok.exception" ]
com.opentok.exception;
427,864
public void setChartOfAccounts(Chart chartOfAccounts) { this.chartOfAccounts = chartOfAccounts; }
void function(Chart chartOfAccounts) { this.chartOfAccounts = chartOfAccounts; }
/** * Sets the chartOfAccounts attribute. * * @param chartOfAccounts The chartOfAccounts to set. * @deprecated */
Sets the chartOfAccounts attribute
setChartOfAccounts
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/module/bc/businessobject/BudgetConstructionAppointmentFundingReason.java", "license": "apache-2.0", "size": 10384 }
[ "org.kuali.kfs.coa.businessobject.Chart" ]
import org.kuali.kfs.coa.businessobject.Chart;
import org.kuali.kfs.coa.businessobject.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
1,257,574
protected String getAcePrincipalName(CmsObject cms, CmsUUID principalId) { if (CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID.equals(principalId)) { return CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_NAME; } if (CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID.equals(principalId)) { return CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_NAME; } CmsRole role = CmsRole.valueOfId(principalId); if (role != null) { return role.getRoleName(); } try { return CmsPrincipal.readPrincipalIncludingHistory(cms, principalId).getName(); } catch (CmsException e) { return "" + principalId; } }
String function(CmsObject cms, CmsUUID principalId) { if (CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID.equals(principalId)) { return CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_NAME; } if (CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID.equals(principalId)) { return CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_NAME; } CmsRole role = CmsRole.valueOfId(principalId); if (role != null) { return role.getRoleName(); } try { return CmsPrincipal.readPrincipalIncludingHistory(cms, principalId).getName(); } catch (CmsException e) { return "" + principalId; } }
/** * Gets a user-readable name for a principal id read from an ACE.<p> * * @param cms the current CMS context * @param principalId the principal id from the ACE * @return the name of the principle */
Gets a user-readable name for a principal id read from an ACE
getAcePrincipalName
{ "repo_name": "ggiudetti/opencms-core", "path": "src/org/opencms/cmis/A_CmsCmisRepository.java", "license": "lgpl-2.1", "size": 13594 }
[ "org.opencms.file.CmsObject", "org.opencms.main.CmsException", "org.opencms.security.CmsAccessControlEntry", "org.opencms.security.CmsPrincipal", "org.opencms.security.CmsRole", "org.opencms.util.CmsUUID" ]
import org.opencms.file.CmsObject; import org.opencms.main.CmsException; import org.opencms.security.CmsAccessControlEntry; import org.opencms.security.CmsPrincipal; import org.opencms.security.CmsRole; import org.opencms.util.CmsUUID;
import org.opencms.file.*; import org.opencms.main.*; import org.opencms.security.*; import org.opencms.util.*;
[ "org.opencms.file", "org.opencms.main", "org.opencms.security", "org.opencms.util" ]
org.opencms.file; org.opencms.main; org.opencms.security; org.opencms.util;
1,821,326
final MavenSession session = this.createSimpleSession("mojos-phar/unpack-phar"); final File phar = new File(session.getCurrentProject().getBasedir(), "phar-with-dep1-folders-0.0.1.phar"); final File fileA = new File(session.getCurrentProject().getBasedir(), "target/folderA/MyClassA.php"); final File fileB = new File(session.getCurrentProject().getBasedir(), "target/folderB/MyClassB.php"); assertTrue(phar.exists()); assertFalse(fileA.exists()); assertFalse(fileB.exists()); Xpp3Dom config = Xpp3DomBuilder.build(new StringReader( "<configuration>" + "<phar>"+phar.getAbsolutePath()+"</phar>" + "<target>"+new File(session.getCurrentProject().getBasedir(), "target").getAbsolutePath()+"</target>" + "</configuration>")); UnpackPharMojo unpackMojo = this.createConfiguredMojo( UnpackPharMojo.class, session, "org.phpmaven", "maven-php-plugin", "2.0.3-SNAPSHOT", "extract-phar", config); unpackMojo.execute(); assertTrue(fileA.exists()); assertTrue(fileB.exists()); }
final MavenSession session = this.createSimpleSession(STR); final File phar = new File(session.getCurrentProject().getBasedir(), STR); final File fileA = new File(session.getCurrentProject().getBasedir(), STR); final File fileB = new File(session.getCurrentProject().getBasedir(), STR); assertTrue(phar.exists()); assertFalse(fileA.exists()); assertFalse(fileB.exists()); Xpp3Dom config = Xpp3DomBuilder.build(new StringReader( STR + STR+phar.getAbsolutePath()+STR + STR+new File(session.getCurrentProject().getBasedir(), STR).getAbsolutePath()+STR + STR)); UnpackPharMojo unpackMojo = this.createConfiguredMojo( UnpackPharMojo.class, session, STR, STR, STR, STR, config); unpackMojo.execute(); assertTrue(fileA.exists()); assertTrue(fileB.exists()); }
/** * tests the goal "unpack-phar" * * @throws Exception */
tests the goal "unpack-phar"
testGoal
{ "repo_name": "teosoft123/maven-php-plugin", "path": "maven-plugins/maven-php-plugin/src/test/java/org/phpmaven/mojos/test/UnpackPharTest.java", "license": "apache-2.0", "size": 2378 }
[ "java.io.File", "java.io.StringReader", "org.apache.maven.execution.MavenSession", "org.codehaus.plexus.util.xml.Xpp3Dom", "org.codehaus.plexus.util.xml.Xpp3DomBuilder", "org.phpmaven.plugin.phar.UnpackPharMojo" ]
import java.io.File; import java.io.StringReader; import org.apache.maven.execution.MavenSession; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.codehaus.plexus.util.xml.Xpp3DomBuilder; import org.phpmaven.plugin.phar.UnpackPharMojo;
import java.io.*; import org.apache.maven.execution.*; import org.codehaus.plexus.util.xml.*; import org.phpmaven.plugin.phar.*;
[ "java.io", "org.apache.maven", "org.codehaus.plexus", "org.phpmaven.plugin" ]
java.io; org.apache.maven; org.codehaus.plexus; org.phpmaven.plugin;
1,628,283
private String getContextHandlerAppName(ContextHandler context) { String appName = context.getDisplayName(); if (appName == null || appName.length() == 0 || getDeployedApps().containsKey(appName)) { if (context instanceof WebAppContext) { appName = ((WebAppContext)context).getContextPath(); if (getDeployedApps().containsKey(appName)) { appName = "noDisplayName"+context.getClass().getSimpleName()+context.hashCode(); } } else { appName = "noDisplayName"+context.getClass().getSimpleName()+context.hashCode(); } } return appName; } public OSGiAppProvider() { super(new Filter()); ((Filter)super._filenameFilter)._enclosedInstance = this; } public OSGiAppProvider(File contextsDir) throws IOException { this(); setMonitoredDirResource(Resource.newResource(contextsDir.toURI())); }
String function(ContextHandler context) { String appName = context.getDisplayName(); if (appName == null appName.length() == 0 getDeployedApps().containsKey(appName)) { if (context instanceof WebAppContext) { appName = ((WebAppContext)context).getContextPath(); if (getDeployedApps().containsKey(appName)) { appName = STR+context.getClass().getSimpleName()+context.hashCode(); } } else { appName = STR+context.getClass().getSimpleName()+context.hashCode(); } } return appName; } public OSGiAppProvider() { super(new Filter()); ((Filter)super._filenameFilter)._enclosedInstance = this; } public OSGiAppProvider(File contextsDir) throws IOException { this(); setMonitoredDirResource(Resource.newResource(contextsDir.toURI())); }
/** * Reading the display name of a webapp is really not sufficient for indexing the various * deployed ContextHandlers. * * @param context * @return */
Reading the display name of a webapp is really not sufficient for indexing the various deployed ContextHandlers
getContextHandlerAppName
{ "repo_name": "jetty-project/jetty-plugin-support", "path": "jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiAppProvider.java", "license": "apache-2.0", "size": 22654 }
[ "java.io.File", "java.io.IOException", "org.eclipse.jetty.server.handler.ContextHandler", "org.eclipse.jetty.util.resource.Resource", "org.eclipse.jetty.webapp.WebAppContext" ]
import java.io.File; import java.io.IOException; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.webapp.WebAppContext;
import java.io.*; import org.eclipse.jetty.server.handler.*; import org.eclipse.jetty.util.resource.*; import org.eclipse.jetty.webapp.*;
[ "java.io", "org.eclipse.jetty" ]
java.io; org.eclipse.jetty;
496,771
private void generateVarargs ( ExpressionClassBuilder acb, MethodBuilder mb ) throws StandardException { // the vararg is the last declared arg of the Java method. it is always // an array type. right now we only support vararg static methods. // if we have to support vararg constructors in the future, then this code // will need adjustment. int firstVarargIdx = getFirstVarargIdx(); String arrayType = methodParameterTypes[ firstVarargIdx ]; String cellType = stripOneArrayLevel( arrayType ); String varargType = cellType; // must strip another array level off of out and in/out parameters if ( routineInfo != null ) { if ( routineInfo.getParameterModes()[ firstVarargIdx ] != (ParameterMetaData.parameterModeIn) ) { varargType = stripOneArrayLevel( varargType ); } } int varargCount = methodParms.length - firstVarargIdx; if ( varargCount < 0 ) { varargCount = 0; } // allocate an array to hold the varargs LocalField arrayField = acb.newFieldDeclaration( Modifier.PRIVATE, arrayType ); MethodBuilder cb = acb.getConstructor(); cb.pushNewArray( cellType, varargCount ); cb.setField( arrayField ); // now put the arguments into the array for ( int i = 0; i < varargCount; i++ ) { mb.getField( arrayField ); // push the array onto the stack // evaluate the parameter and push it onto the stack generateAndCastOneParameter( acb, mb, i + firstVarargIdx, cellType ); mb.setArrayElement( i ); // move the parameter into the array, pop the stack } // push the array onto the stack. it is the last parameter to the varargs routine. mb.getField( arrayField ); }
void function ( ExpressionClassBuilder acb, MethodBuilder mb ) throws StandardException { int firstVarargIdx = getFirstVarargIdx(); String arrayType = methodParameterTypes[ firstVarargIdx ]; String cellType = stripOneArrayLevel( arrayType ); String varargType = cellType; if ( routineInfo != null ) { if ( routineInfo.getParameterModes()[ firstVarargIdx ] != (ParameterMetaData.parameterModeIn) ) { varargType = stripOneArrayLevel( varargType ); } } int varargCount = methodParms.length - firstVarargIdx; if ( varargCount < 0 ) { varargCount = 0; } LocalField arrayField = acb.newFieldDeclaration( Modifier.PRIVATE, arrayType ); MethodBuilder cb = acb.getConstructor(); cb.pushNewArray( cellType, varargCount ); cb.setField( arrayField ); for ( int i = 0; i < varargCount; i++ ) { mb.getField( arrayField ); generateAndCastOneParameter( acb, mb, i + firstVarargIdx, cellType ); mb.setArrayElement( i ); } mb.getField( arrayField ); }
/** * <p> * Generate the trailing routine arguments into a varargs array and * push that array onto the stack. * </p> */
Generate the trailing routine arguments into a varargs array and push that array onto the stack.
generateVarargs
{ "repo_name": "scnakandala/derby", "path": "java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java", "license": "apache-2.0", "size": 47051 }
[ "java.lang.reflect.Modifier", "java.sql.ParameterMetaData", "org.apache.derby.iapi.error.StandardException", "org.apache.derby.iapi.services.compiler.LocalField", "org.apache.derby.iapi.services.compiler.MethodBuilder" ]
import java.lang.reflect.Modifier; import java.sql.ParameterMetaData; import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.services.compiler.LocalField; import org.apache.derby.iapi.services.compiler.MethodBuilder;
import java.lang.reflect.*; import java.sql.*; import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.services.compiler.*;
[ "java.lang", "java.sql", "org.apache.derby" ]
java.lang; java.sql; org.apache.derby;
631,373
private void registerCallbacks(Manager manager) { if (callbacks != null) { for (Callback callback : callbacks) { manager.callback().addCallback(callback); } } }
void function(Manager manager) { if (callbacks != null) { for (Callback callback : callbacks) { manager.callback().addCallback(callback); } } }
/** * Register callbacks in given manager * * @param manager Manager */
Register callbacks in given manager
registerCallbacks
{ "repo_name": "ferstl/javasimon", "path": "spring/src/main/java/org/javasimon/spring/ManagerFactoryBean.java", "license": "bsd-3-clause", "size": 3266 }
[ "org.javasimon.Manager", "org.javasimon.callback.Callback" ]
import org.javasimon.Manager; import org.javasimon.callback.Callback;
import org.javasimon.*; import org.javasimon.callback.*;
[ "org.javasimon", "org.javasimon.callback" ]
org.javasimon; org.javasimon.callback;
1,071,681
public KeyNamePair getKeyNamePair() { return new KeyNamePair(get_ID(), getName()); }
KeyNamePair function() { return new KeyNamePair(get_ID(), getName()); }
/** Get Record ID/ColumnName @return ID/ColumnName pair */
Get Record ID/ColumnName
getKeyNamePair
{ "repo_name": "arthurmelo88/palmetalADP", "path": "adempiere_360/base/src/org/compiere/model/X_K_Topic.java", "license": "gpl-2.0", "size": 5885 }
[ "org.compiere.util.KeyNamePair" ]
import org.compiere.util.KeyNamePair;
import org.compiere.util.*;
[ "org.compiere.util" ]
org.compiere.util;
113,166
public static void main(String[] args) throws UnknownHostException, IOException, InterruptedException { TalismaneClient talismane_client = new TalismaneClient(); boolean isAlive = talismane_client.pingServer(); talismane_client.analyse("John a poussé Marie."); String text = talismane_client .readFile("./samples/stendhal_sample_1.txt"); CoNLL_Structure stendhal_conll = talismane_client.analyse(text); for(CoNLL_Sentence currSentence : stendhal_conll){ CoNLL_Token currToken = currSentence.get(0); System.out.println(currToken.getLemma()); } CoNLL_Structure struct_connll = talismane_client.analyse("Marie est tombée.",false); CoNLL_Sentence sentence = struct_connll.get(0); sentence.print(); talismane_client.closeServer(); }
static void function(String[] args) throws UnknownHostException, IOException, InterruptedException { TalismaneClient talismane_client = new TalismaneClient(); boolean isAlive = talismane_client.pingServer(); talismane_client.analyse(STR); String text = talismane_client .readFile(STR); CoNLL_Structure stendhal_conll = talismane_client.analyse(text); for(CoNLL_Sentence currSentence : stendhal_conll){ CoNLL_Token currToken = currSentence.get(0); System.out.println(currToken.getLemma()); } CoNLL_Structure struct_connll = talismane_client.analyse(STR,false); CoNLL_Sentence sentence = struct_connll.get(0); sentence.print(); talismane_client.closeServer(); }
/** * Example in a java environment. * * @param args * @throws UnknownHostException * @throws IOException * @throws InterruptedException * @author Jean-Philippe Fauconnier */
Example in a java environment
main
{ "repo_name": "fauconnier/talismane-client", "path": "src/talismane_client/main/Main_Example.java", "license": "agpl-3.0", "size": 2464 }
[ "java.io.IOException", "java.net.UnknownHostException" ]
import java.io.IOException; import java.net.UnknownHostException;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
2,427,850
public ConnectionHandle createConnection(InetAddress address) throws FileNotFoundException, IOException { return asyncConnector.createConnection(address); }
ConnectionHandle function(InetAddress address) throws FileNotFoundException, IOException { return asyncConnector.createConnection(address); }
/** * Creates connection to the remote host. * @param address * - {@link InetAddress} of the remote host * @return handle to the connection to the remote host * @throws IOException * when properties file was not found * @throws FileNotFoundException * when properties file was not found */
Creates connection to the remote host
createConnection
{ "repo_name": "fbacchella/ipmilib", "path": "src/main/java/com/veraxsystems/vxipmi/api/sync/IpmiConnector.java", "license": "gpl-3.0", "size": 11748 }
[ "com.veraxsystems.vxipmi.api.async.ConnectionHandle", "java.io.FileNotFoundException", "java.io.IOException", "java.net.InetAddress" ]
import com.veraxsystems.vxipmi.api.async.ConnectionHandle; import java.io.FileNotFoundException; import java.io.IOException; import java.net.InetAddress;
import com.veraxsystems.vxipmi.api.async.*; import java.io.*; import java.net.*;
[ "com.veraxsystems.vxipmi", "java.io", "java.net" ]
com.veraxsystems.vxipmi; java.io; java.net;
1,176,487
protected final void cacheClear(Session session) { int i = sysTables.length; while (i-- > 0) { Table t = sysTables[i]; if (t != null) { t.clearAllData(session); } } }
final void function(Session session) { int i = sysTables.length; while (i-- > 0) { Table t = sysTables[i]; if (t != null) { t.clearAllData(session); } } }
/** * Clears the contents of cached system tables and resets user slots * to null. <p> * */
Clears the contents of cached system tables and resets user slots to null.
cacheClear
{ "repo_name": "ferquies/2dam", "path": "AD/Tema 2/hsqldb-2.3.1/hsqldb/src/org/hsqldb/dbinfo/DatabaseInformationMain.java", "license": "gpl-3.0", "size": 147237 }
[ "org.hsqldb.Session", "org.hsqldb.Table" ]
import org.hsqldb.Session; import org.hsqldb.Table;
import org.hsqldb.*;
[ "org.hsqldb" ]
org.hsqldb;
2,395,386
@Deprecated public static Chgrp2 chgrp(Map<String, List<Long>> targetObjects, ChildOption childOption, boolean dryRun, long groupId) { return chgrp().target(targetObjects).option(childOption).dryRun(dryRun).toGroup(groupId).build(); }
static Chgrp2 function(Map<String, List<Long>> targetObjects, ChildOption childOption, boolean dryRun, long groupId) { return chgrp().target(targetObjects).option(childOption).dryRun(dryRun).toGroup(groupId).build(); }
/** * Create a new {@link Chgrp2} request. * @param targetObjects the target objects * @param childOption how to process child objects * @param dryRun if this request is a dry run * @param groupId the destination group ID * @return the new request * @deprecated use {@link Requests.Chgrp2Builder} from {@link #chgrp()}, see this method for an example */
Create a new <code>Chgrp2</code> request
chgrp
{ "repo_name": "dpwrussell/openmicroscopy", "path": "components/blitz/src/omero/gateway/util/Requests.java", "license": "gpl-2.0", "size": 113616 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
532,192
public static RunningJob runJob(JobConf conf) throws IOException { setupPipesJob(conf); return JobClient.runJob(conf); }
static RunningJob function(JobConf conf) throws IOException { setupPipesJob(conf); return JobClient.runJob(conf); }
/** * Submit a job to the map/reduce cluster. All of the necessary modifications * to the job to run under pipes are made to the configuration. * @param conf the job to submit to the cluster (MODIFIED) * @throws IOException */
Submit a job to the map/reduce cluster. All of the necessary modifications to the job to run under pipes are made to the configuration
runJob
{ "repo_name": "JingchengDu/hadoop", "path": "hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/pipes/Submitter.java", "license": "apache-2.0", "size": 19625 }
[ "java.io.IOException", "org.apache.hadoop.mapred.JobClient", "org.apache.hadoop.mapred.JobConf", "org.apache.hadoop.mapred.RunningJob" ]
import java.io.IOException; import org.apache.hadoop.mapred.JobClient; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.RunningJob;
import java.io.*; import org.apache.hadoop.mapred.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,476,466
VEvent getExistingAppointment(AvailableBlock targetBlock, IScheduleOwner owner, IScheduleVisitor visitor);
VEvent getExistingAppointment(AvailableBlock targetBlock, IScheduleOwner owner, IScheduleVisitor visitor);
/** * Return the {@link VEvent} for an existing Scheduling Assistant Appointment at the times * specified by the targetBlock in the {@link IScheduleOwner}'s schedule with the specified * {@link IScheduleVisitor} in attendance. * * @param targetBlock * @param owner * @param visitor * @return the existing scheduling assistant appointment, or null if no appointment exists, or the visitor is not in attendance */
Return the <code>VEvent</code> for an existing Scheduling Assistant Appointment at the times specified by the targetBlock in the <code>IScheduleOwner</code>'s schedule with the specified <code>IScheduleVisitor</code> in attendance
getExistingAppointment
{ "repo_name": "nblair/sometime", "path": "sometime-api/src/main/java/org/jasig/schedassist/SchedulingAssistantService.java", "license": "apache-2.0", "size": 5424 }
[ "net.fortuna.ical4j.model.component.VEvent", "org.jasig.schedassist.model.AvailableBlock", "org.jasig.schedassist.model.IScheduleOwner", "org.jasig.schedassist.model.IScheduleVisitor" ]
import net.fortuna.ical4j.model.component.VEvent; import org.jasig.schedassist.model.AvailableBlock; import org.jasig.schedassist.model.IScheduleOwner; import org.jasig.schedassist.model.IScheduleVisitor;
import net.fortuna.ical4j.model.component.*; import org.jasig.schedassist.model.*;
[ "net.fortuna.ical4j", "org.jasig.schedassist" ]
net.fortuna.ical4j; org.jasig.schedassist;
844,234
@Test public void testJobDelete() throws P4JavaException { when(server.execMapCmdList(eq(JOB.toString()), argThat(DELETE_MATCHER), eq(null))) .thenReturn(buildValidDeleteResultMap()); String result = jobDelegator.deleteJob(TEST_JOB); verify(server).execMapCmdList(eq(JOB.toString()), argThat(DELETE_MATCHER), eq(null)); assertTrue(result.startsWith("Job " + TEST_JOB + " deleted")); }
void function() throws P4JavaException { when(server.execMapCmdList(eq(JOB.toString()), argThat(DELETE_MATCHER), eq(null))) .thenReturn(buildValidDeleteResultMap()); String result = jobDelegator.deleteJob(TEST_JOB); verify(server).execMapCmdList(eq(JOB.toString()), argThat(DELETE_MATCHER), eq(null)); assertTrue(result.startsWith(STR + TEST_JOB + STR)); }
/** * Test job delete. * * @throws P4JavaException the p4 java exception */
Test job delete
testJobDelete
{ "repo_name": "groboclown/p4ic4idea", "path": "p4java/src/test/java/com/perforce/p4java/impl/mapbased/server/cmd/JobDelegatorTest.java", "license": "apache-2.0", "size": 18331 }
[ "com.perforce.p4java.exception.P4JavaException", "com.perforce.p4java.server.CmdSpec", "org.junit.Assert", "org.mockito.ArgumentMatchers", "org.mockito.Mockito" ]
import com.perforce.p4java.exception.P4JavaException; import com.perforce.p4java.server.CmdSpec; import org.junit.Assert; import org.mockito.ArgumentMatchers; import org.mockito.Mockito;
import com.perforce.p4java.exception.*; import com.perforce.p4java.server.*; import org.junit.*; import org.mockito.*;
[ "com.perforce.p4java", "org.junit", "org.mockito" ]
com.perforce.p4java; org.junit; org.mockito;
2,517,156
@Override public void stop() throws Exception { BackgroundThreads.stop(); super.stop(); }
void function() throws Exception { BackgroundThreads.stop(); super.stop(); }
/** * Stops background threads for allowing JVM to exit. * * @throws Exception if an error occurred while stopping the threads. */
Stops background threads for allowing JVM to exit
stop
{ "repo_name": "apache/sis", "path": "application/sis-javafx/src/test/java/org/apache/sis/gui/coverage/GridViewApp.java", "license": "apache-2.0", "size": 3614 }
[ "org.apache.sis.internal.gui.BackgroundThreads" ]
import org.apache.sis.internal.gui.BackgroundThreads;
import org.apache.sis.internal.gui.*;
[ "org.apache.sis" ]
org.apache.sis;
2,157,747
public synchronized boolean isActiveRecently() { return Time.monotonicNow() - this.lastActiveTs <= ACTIVE_WINDOW_TIME; }
synchronized boolean function() { return Time.monotonicNow() - this.lastActiveTs <= ACTIVE_WINDOW_TIME; }
/** * Check if the connection is/was active recently. * * @return True if the connection is active or * was active in the past period of time. */
Check if the connection is/was active recently
isActiveRecently
{ "repo_name": "apurtell/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/ConnectionContext.java", "license": "apache-2.0", "size": 4862 }
[ "org.apache.hadoop.util.Time" ]
import org.apache.hadoop.util.Time;
import org.apache.hadoop.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,459,164
public void resume() { Log.d(TAG, "resume()"); if (!this.mTimerActive) { this.mTimer = new InternalTimer(mTimeRemaining, TICK); this.mTimer.start(); this.mTimerActive = true; } }
void function() { Log.d(TAG, STR); if (!this.mTimerActive) { this.mTimer = new InternalTimer(mTimeRemaining, TICK); this.mTimer.start(); this.mTimerActive = true; } }
/** * Resume the timer from the time when last paused. */
Resume the timer from the time when last paused
resume
{ "repo_name": "siramix/buzzwords", "path": "src/com/buzzwords/PauseTimer.java", "license": "gpl-3.0", "size": 3609 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
2,268,303
if (!configFile.exists()) { try { plugin.saveResource(fileName, false); // Normal files } catch (IllegalArgumentException ex) { plugin.saveResource(configFile.getParentFile().getName() + File.separator + fileName, false); // Mod // files } } config = YamlConfiguration.loadConfiguration(configFile); } /** * loadKeys, method to overwrite from abstract.<br> * {@link Config#loadKeys()}
if (!configFile.exists()) { try { plugin.saveResource(fileName, false); } catch (IllegalArgumentException ex) { plugin.saveResource(configFile.getParentFile().getName() + File.separator + fileName, false); } } config = YamlConfiguration.loadConfiguration(configFile); } /** * loadKeys, method to overwrite from abstract.<br> * {@link Config#loadKeys()}
/** * Try load config file for this instance. If not try create it from a resource. */
Try load config file for this instance. If not try create it from a resource
loadFile
{ "repo_name": "theLastHero/special-octo-palm-tree", "path": "src/PlayerWarpGUI/config/ConfigLoader.java", "license": "mit", "size": 3207 }
[ "java.io.File", "org.bukkit.configuration.file.YamlConfiguration" ]
import java.io.File; import org.bukkit.configuration.file.YamlConfiguration;
import java.io.*; import org.bukkit.configuration.file.*;
[ "java.io", "org.bukkit.configuration" ]
java.io; org.bukkit.configuration;
2,047,687
private Properties getMailPropertiesFromFlowFile(final ProcessContext context, final FlowFile flowFile) { final Properties properties = new Properties(); final ComponentLog logger = this.getLogger(); for (Entry<String, PropertyDescriptor> entry : propertyToContext.entrySet()) { // Evaluate the property descriptor against the flow file String flowFileValue = context.getProperty(entry.getValue()).evaluateAttributeExpressions(flowFile).getValue(); String property = entry.getKey(); logger.debug("Evaluated Mail Property: {} with Value: {}", new Object[]{property, flowFileValue}); // Nullable values are not allowed, so filter out if (null != flowFileValue) { properties.setProperty(property, flowFileValue); } } return properties; } public static final String BODY_SEPARATOR = "\n\n--------------------------------------------------\n";
Properties function(final ProcessContext context, final FlowFile flowFile) { final Properties properties = new Properties(); final ComponentLog logger = this.getLogger(); for (Entry<String, PropertyDescriptor> entry : propertyToContext.entrySet()) { String flowFileValue = context.getProperty(entry.getValue()).evaluateAttributeExpressions(flowFile).getValue(); String property = entry.getKey(); logger.debug(STR, new Object[]{property, flowFileValue}); if (null != flowFileValue) { properties.setProperty(property, flowFileValue); } } return properties; } public static final String BODY_SEPARATOR = STR;
/** * Uses the mapping of javax.mail properties to NiFi PropertyDescriptors to build the required Properties object to be used for sending this email * * @param context context * @param flowFile flowFile * @return mail properties */
Uses the mapping of javax.mail properties to NiFi PropertyDescriptors to build the required Properties object to be used for sending this email
getMailPropertiesFromFlowFile
{ "repo_name": "Wesley-Lawrence/nifi", "path": "nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java", "license": "apache-2.0", "size": 23908 }
[ "java.util.Map", "java.util.Properties", "org.apache.nifi.components.PropertyDescriptor", "org.apache.nifi.flowfile.FlowFile", "org.apache.nifi.logging.ComponentLog", "org.apache.nifi.processor.ProcessContext" ]
import java.util.Map; import java.util.Properties; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext;
import java.util.*; import org.apache.nifi.components.*; import org.apache.nifi.flowfile.*; import org.apache.nifi.logging.*; import org.apache.nifi.processor.*;
[ "java.util", "org.apache.nifi" ]
java.util; org.apache.nifi;
1,921,056
private void setSelectionToCenterChild() { View selView = mSelectedChild; if (mSelectedChild == null) return; int galleryCenter = getCenterOfGallery(); // Common case where the current selected position is correct if (selView.getLeft() <= galleryCenter && selView.getRight() >= galleryCenter) { return; } // TODO better search int closestEdgeDistance = Integer.MAX_VALUE; int newSelectedChildIndex = 0; for (int i = getChildCount() - 1; i >= 0; i--) { View child = getChildAt(i); if (child.getLeft() <= galleryCenter && child.getRight() >= galleryCenter) { // This child is in the center newSelectedChildIndex = i; break; } int childClosestEdgeDistance = Math.min(Math.abs(child.getLeft() - galleryCenter), Math.abs(child.getRight() - galleryCenter)); if (childClosestEdgeDistance < closestEdgeDistance) { closestEdgeDistance = childClosestEdgeDistance; newSelectedChildIndex = i; } } int newPos = mFirstPosition + newSelectedChildIndex; if (newPos != mSelectedPosition) { setSelectedPositionInt(newPos); setNextSelectedPositionInt(newPos); checkSelectionChanged(); } }
void function() { View selView = mSelectedChild; if (mSelectedChild == null) return; int galleryCenter = getCenterOfGallery(); if (selView.getLeft() <= galleryCenter && selView.getRight() >= galleryCenter) { return; } int closestEdgeDistance = Integer.MAX_VALUE; int newSelectedChildIndex = 0; for (int i = getChildCount() - 1; i >= 0; i--) { View child = getChildAt(i); if (child.getLeft() <= galleryCenter && child.getRight() >= galleryCenter) { newSelectedChildIndex = i; break; } int childClosestEdgeDistance = Math.min(Math.abs(child.getLeft() - galleryCenter), Math.abs(child.getRight() - galleryCenter)); if (childClosestEdgeDistance < closestEdgeDistance) { closestEdgeDistance = childClosestEdgeDistance; newSelectedChildIndex = i; } } int newPos = mFirstPosition + newSelectedChildIndex; if (newPos != mSelectedPosition) { setSelectedPositionInt(newPos); setNextSelectedPositionInt(newPos); checkSelectionChanged(); } }
/** * Looks for the child that is closest to the center and sets it as the * selected child. */
Looks for the child that is closest to the center and sets it as the selected child
setSelectionToCenterChild
{ "repo_name": "entertailion/Open-Launcher-for-GTV", "path": "src/com/entertailion/android/launcher/widget/EcoGallery.java", "license": "apache-2.0", "size": 38543 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
2,800,776
UserModel getUserModel(char[] cookie);
UserModel getUserModel(char[] cookie);
/** * Retrieve a user object for the specified cookie. * * @param cookie * @return a user object or null * @since 0.5.0 */
Retrieve a user object for the specified cookie
getUserModel
{ "repo_name": "gitblit/gitblit", "path": "src/main/java/com/gitblit/IUserService.java", "license": "apache-2.0", "size": 6533 }
[ "com.gitblit.models.UserModel" ]
import com.gitblit.models.UserModel;
import com.gitblit.models.*;
[ "com.gitblit.models" ]
com.gitblit.models;
1,821,734
@Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Role.class)) { case KAMP4aPSFieldofactivityannotationsPackage.ROLE__DESCRIPTION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Role.class)) { case KAMP4aPSFieldofactivityannotationsPackage.ROLE__DESCRIPTION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); }
/** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "KAMP-Research/KAMP4APS", "path": "edu.kit.ipd.sdq.kamp4aps.model.fieldofactivityannotations.edit/src/edu/kit/ipd/sdq/kamp4aps/model/fieldofactivityannotations/provider/RoleItemProvider.java", "license": "apache-2.0", "size": 5386 }
[ "edu.kit.ipd.sdq.kamp4aps.model.fieldofactivityannotations.KAMP4aPSFieldofactivityannotationsPackage", "edu.kit.ipd.sdq.kamp4aps.model.fieldofactivityannotations.Role", "org.eclipse.emf.common.notify.Notification", "org.eclipse.emf.edit.provider.ViewerNotification" ]
import edu.kit.ipd.sdq.kamp4aps.model.fieldofactivityannotations.KAMP4aPSFieldofactivityannotationsPackage; import edu.kit.ipd.sdq.kamp4aps.model.fieldofactivityannotations.Role; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification;
import edu.kit.ipd.sdq.kamp4aps.model.fieldofactivityannotations.*; import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*;
[ "edu.kit.ipd", "org.eclipse.emf" ]
edu.kit.ipd; org.eclipse.emf;
1,255,206
private SimpleSink.SimpleWriteOperation buildWriteOperationForFinalize( boolean retainTemporaryFiles) throws Exception { TemporaryFileRetention retentionPolicy = retainTemporaryFiles ? TemporaryFileRetention.KEEP : TemporaryFileRetention.REMOVE; return buildWriteOperation(retentionPolicy); }
SimpleSink.SimpleWriteOperation function( boolean retainTemporaryFiles) throws Exception { TemporaryFileRetention retentionPolicy = retainTemporaryFiles ? TemporaryFileRetention.KEEP : TemporaryFileRetention.REMOVE; return buildWriteOperation(retentionPolicy); }
/** * Build a SimpleWriteOperation with default values and the specified retention policy. */
Build a SimpleWriteOperation with default values and the specified retention policy
buildWriteOperationForFinalize
{ "repo_name": "shakamunyi/beam", "path": "sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/io/FileBasedSinkTest.java", "license": "apache-2.0", "size": 18193 }
[ "com.google.cloud.dataflow.sdk.io.FileBasedSink" ]
import com.google.cloud.dataflow.sdk.io.FileBasedSink;
import com.google.cloud.dataflow.sdk.io.*;
[ "com.google.cloud" ]
com.google.cloud;
2,651,520
public Collection<Gap> findGapsOverlappingRange(String organismCommonName, String chromosomeUniqueName, long locMin, long locMax);
Collection<Gap> function(String organismCommonName, String chromosomeUniqueName, long locMin, long locMax);
/** * Find all gaps either end of which is in the range [<code>locMin</code>, <code>locMax</code>) * specified in interbase co-ordinates. This amounts to finding all gaps any part of which * lies between the specified interbase locations, as well as any gap whose right-hand end lies * precisely at <code>locMin</code>. * * @param organismCommonName * @param chromosomeUniqueName * @param locMin * @param locMax * @return */
Find all gaps either end of which is in the range [<code>locMin</code>, <code>locMax</code>) specified in interbase co-ordinates. This amounts to finding all gaps any part of which lies between the specified interbase locations, as well as any gap whose right-hand end lies precisely at <code>locMin</code>
findGapsOverlappingRange
{ "repo_name": "sanger-pathogens/GeneDB", "path": "ng/src/org/genedb/db/domain/services/BasicGeneService.java", "license": "gpl-3.0", "size": 2782 }
[ "java.util.Collection", "org.genedb.db.domain.objects.Gap" ]
import java.util.Collection; import org.genedb.db.domain.objects.Gap;
import java.util.*; import org.genedb.db.domain.objects.*;
[ "java.util", "org.genedb.db" ]
java.util; org.genedb.db;
1,140,086
Optional<ResolvedIndex> resolveIndex(Session session, TableHandle tableHandle, Set<ColumnHandle> indexableColumns, Set<ColumnHandle> outputColumns, TupleDomain<ColumnHandle> tupleDomain);
Optional<ResolvedIndex> resolveIndex(Session session, TableHandle tableHandle, Set<ColumnHandle> indexableColumns, Set<ColumnHandle> outputColumns, TupleDomain<ColumnHandle> tupleDomain);
/** * Try to locate a table index that can lookup results by indexableColumns and provide the requested outputColumns. */
Try to locate a table index that can lookup results by indexableColumns and provide the requested outputColumns
resolveIndex
{ "repo_name": "ptkool/presto", "path": "presto-main/src/main/java/com/facebook/presto/metadata/Metadata.java", "license": "apache-2.0", "size": 17661 }
[ "com.facebook.presto.Session", "com.facebook.presto.spi.ColumnHandle", "com.facebook.presto.spi.TableHandle", "com.facebook.presto.spi.predicate.TupleDomain", "java.util.Optional", "java.util.Set" ]
import com.facebook.presto.Session; import com.facebook.presto.spi.ColumnHandle; import com.facebook.presto.spi.TableHandle; import com.facebook.presto.spi.predicate.TupleDomain; import java.util.Optional; import java.util.Set;
import com.facebook.presto.*; import com.facebook.presto.spi.*; import com.facebook.presto.spi.predicate.*; import java.util.*;
[ "com.facebook.presto", "java.util" ]
com.facebook.presto; java.util;
2,099,362
void setInvalid(AriaInvalid invalid);
void setInvalid(AriaInvalid invalid);
/** * This method sets the {@link #getInvalid() invalid} state of this object. * * @param invalid is the new value of {@link #getInvalid()}. */
This method sets the <code>#getInvalid() invalid</code> state of this object
setInvalid
{ "repo_name": "m-m-m/client", "path": "ui/core/api/src/main/java/net/sf/mmm/client/ui/api/aria/attribute/AttributeWriteAriaInvalid.java", "license": "apache-2.0", "size": 727 }
[ "net.sf.mmm.client.ui.api.aria.datatype.AriaInvalid" ]
import net.sf.mmm.client.ui.api.aria.datatype.AriaInvalid;
import net.sf.mmm.client.ui.api.aria.datatype.*;
[ "net.sf.mmm" ]
net.sf.mmm;
627,121
public static <K> Matcher<java.util.Map<? extends K, ?>> hasKey(final K key) { return org.hamcrest.collection.IsMapContaining.<K>hasKey(key); }
static <K> Matcher<java.util.Map<? extends K, ?>> function(final K key) { return org.hamcrest.collection.IsMapContaining.<K>hasKey(key); }
/** * Creates a matcher for {@link java.util.Map}s matching when the examined {@link java.util.Map} contains * at least one key that is equal to the specified key. * <p/> * For example: * <pre>assertThat(myMap, hasKey("bar"))</pre> * * @param key * the key that satisfying maps must contain */
Creates a matcher for <code>java.util.Map</code>s matching when the examined <code>java.util.Map</code> contains at least one key that is equal to the specified key. For example: <code>assertThat(myMap, hasKey("bar"))</code>
hasKey
{ "repo_name": "gv2011/util", "path": "testutil/src/main/java/com/github/gv2011/testutil/Matchers.java", "license": "mit", "size": 65674 }
[ "java.util.Map", "org.hamcrest.Matcher" ]
import java.util.Map; import org.hamcrest.Matcher;
import java.util.*; import org.hamcrest.*;
[ "java.util", "org.hamcrest" ]
java.util; org.hamcrest;
1,123,440
public boolean pressDPadDown() { Tracer.trace(); return pressKeyCode(KeyEvent.KEYCODE_DPAD_DOWN); }
boolean function() { Tracer.trace(); return pressKeyCode(KeyEvent.KEYCODE_DPAD_DOWN); }
/** * Simulates a short press on the DOWN button. * @return true if successful, else return false * @since API Level 16 */
Simulates a short press on the DOWN button
pressDPadDown
{ "repo_name": "indashnet/InDashNet.Open.UN2000", "path": "android/frameworks/uiautomator/core/com/android/uiautomator/core/UiDevice.java", "license": "apache-2.0", "size": 29568 }
[ "android.view.KeyEvent" ]
import android.view.KeyEvent;
import android.view.*;
[ "android.view" ]
android.view;
477,172
public int getIndex() { Node firstNode = listItemElement.getParentNode().getFirstChild(); int i = 0; while (firstNode != null) { if (firstNode instanceof TextListItemElement) { if (firstNode == listItemElement) { break; } else { i++; } } firstNode = firstNode.getNextSibling(); } return i; }
int function() { Node firstNode = listItemElement.getParentNode().getFirstChild(); int i = 0; while (firstNode != null) { if (firstNode instanceof TextListItemElement) { if (firstNode == listItemElement) { break; } else { i++; } } firstNode = firstNode.getNextSibling(); } return i; }
/** * Answers the index of the item in its owner list. * * @return index of the item. */
Answers the index of the item in its owner list
getIndex
{ "repo_name": "jbjonesjr/geoproponis", "path": "external/simple-odf-0.8.1-incubating-sources/org/odftoolkit/simple/text/list/ListItem.java", "license": "gpl-2.0", "size": 10461 }
[ "org.odftoolkit.odfdom.dom.element.text.TextListItemElement", "org.w3c.dom.Node" ]
import org.odftoolkit.odfdom.dom.element.text.TextListItemElement; import org.w3c.dom.Node;
import org.odftoolkit.odfdom.dom.element.text.*; import org.w3c.dom.*;
[ "org.odftoolkit.odfdom", "org.w3c.dom" ]
org.odftoolkit.odfdom; org.w3c.dom;
860,207
public boolean keyExist(String key) throws NativeLibException { return (keyExist(currentRoot, key)); }
boolean function(String key) throws NativeLibException { return (keyExist(currentRoot, key)); }
/** * Returns whether the given key under the current root exist or not. * * @param key key to be tested * @return true if thekey exist, else false * @throws NativeLibException */
Returns whether the given key under the current root exist or not
keyExist
{ "repo_name": "codehaus/izpack", "path": "izpack-core/src/main/java/com/coi/tools/os/win/RegistryImpl.java", "license": "apache-2.0", "size": 25011 }
[ "com.izforge.izpack.api.exception.NativeLibException" ]
import com.izforge.izpack.api.exception.NativeLibException;
import com.izforge.izpack.api.exception.*;
[ "com.izforge.izpack" ]
com.izforge.izpack;
1,615,207
@TargetApi(VERSION_CODES.GINGERBREAD) public static boolean isExternalStorageRemovable() { if (Utils.hasGingerbread()) { return Environment.isExternalStorageRemovable(); } return true; }
@TargetApi(VERSION_CODES.GINGERBREAD) static boolean function() { if (Utils.hasGingerbread()) { return Environment.isExternalStorageRemovable(); } return true; }
/** * Check if external storage is built-in or removable. * * @return True if external storage is removable (like an SD card), false * otherwise. */
Check if external storage is built-in or removable
isExternalStorageRemovable
{ "repo_name": "captain-miao/EaseMobChatAndroidDemo", "path": "easechat/src/com/easemob/chatuidemo/video/util/ImageCache.java", "license": "gpl-2.0", "size": 17563 }
[ "android.annotation.TargetApi", "android.os.Environment" ]
import android.annotation.TargetApi; import android.os.Environment;
import android.annotation.*; import android.os.*;
[ "android.annotation", "android.os" ]
android.annotation; android.os;
321,069
protected final ArrayList runAndThenRender( String input, String output, String pageRange, String format ) throws Exception { String tempDoc = "temp_123aaabbbccc789.rptdocument"; //$NON-NLS-1$ ArrayList errors = run( input, tempDoc ); if ( errors.size( ) > 0 ) { return errors; } String from = genOutputFile( tempDoc ); try { copyFile( from, this.getFullQualifiedClassName( ) + "/" + INPUT_FOLDER + "/" + tempDoc ); if ( FORMAT_PDF.equals( format ) ) //$NON-NLS-1$ return render_PDF( tempDoc, output, pageRange ); else return render_HTML( tempDoc, output, pageRange ); } catch ( Exception e ) { throw e; } finally { // remove the temp file on exit. removeFile( tempDoc ); } }
final ArrayList function( String input, String output, String pageRange, String format ) throws Exception { String tempDoc = STR; ArrayList errors = run( input, tempDoc ); if ( errors.size( ) > 0 ) { return errors; } String from = genOutputFile( tempDoc ); try { copyFile( from, this.getFullQualifiedClassName( ) + "/" + INPUT_FOLDER + "/" + tempDoc ); if ( FORMAT_PDF.equals( format ) ) return render_PDF( tempDoc, output, pageRange ); else return render_HTML( tempDoc, output, pageRange ); } catch ( Exception e ) { throw e; } finally { removeFile( tempDoc ); } }
/** * Run the input design, generate a report document, and then render the * report document into a html file, <code>pageRange</code> specified the * page(s) to render. * * @throws IOException * @throws EngineException */
Run the input design, generate a report document, and then render the report document into a html file, <code>pageRange</code> specified the page(s) to render
runAndThenRender
{ "repo_name": "Charling-Huang/birt", "path": "testsuites/org.eclipse.birt.tests.core/src/utility/EngineCase.java", "license": "epl-1.0", "size": 27946 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
395,477
protected final boolean checkValueSetForLastValue(Set valueSet) { return valueSet != null && valueSet.contains(_lastValue); }
final boolean function(Set valueSet) { return valueSet != null && valueSet.contains(_lastValue); }
/** * Checks the set to see if it contains the {@link #getLastValue() last value}. * * @param valueSet * the set to check, which may be null * @return true if the last value is in the set (if non-null) */
Checks the set to see if it contains the <code>#getLastValue() last value</code>
checkValueSetForLastValue
{ "repo_name": "apache/tapestry4", "path": "framework/src/java/org/apache/tapestry/util/DefaultPrimaryKeyConverter.java", "license": "apache-2.0", "size": 10168 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
855,178
public void testIsLocallyRenderableWithClientsideController() throws QuickFixException { T baseComponentDef = define(baseTag, "", "Body: Includes a component with a client controller. " + " <test:testJSController/>"); assertEquals("Rendering detection logic is not on.", RenderType.AUTO, baseComponentDef.getRender()); assertFalse("When a component has dependency on a controller, the rendering should be done clientside.", baseComponentDef.isLocallyRenderable()); }
void function() throws QuickFixException { T baseComponentDef = define(baseTag, STRBody: Includes a component with a client controller. STR <test:testJSController/>STRRendering detection logic is not on.STRWhen a component has dependency on a controller, the rendering should be done clientside.", baseComponentDef.isLocallyRenderable()); }
/** * isLocallyRenderable is false when component includes a Javascript controller. Test method for * {@link BaseComponentDef#isLocallyRenderable()}. */
isLocallyRenderable is false when component includes a Javascript controller. Test method for <code>BaseComponentDef#isLocallyRenderable()</code>
testIsLocallyRenderableWithClientsideController
{ "repo_name": "igor-sfdc/aura", "path": "aura-impl/src/test/java/org/auraframework/def/BaseComponentDefTest.java", "license": "apache-2.0", "size": 93773 }
[ "org.auraframework.throwable.quickfix.QuickFixException" ]
import org.auraframework.throwable.quickfix.QuickFixException;
import org.auraframework.throwable.quickfix.*;
[ "org.auraframework.throwable" ]
org.auraframework.throwable;
2,024,227
public CheckBox getIsHidden() { return hidden; }
CheckBox function() { return hidden; }
/** * To get Is Hidden. * * @return CheckBox */
To get Is Hidden
getIsHidden
{ "repo_name": "kuzavas/ephesoft", "path": "dcma-gwt/dcma-gwt-admin/src/main/java/com/ephesoft/dcma/gwt/admin/bm/client/view/fieldtype/EditFieldTypeView.java", "license": "agpl-3.0", "size": 20768 }
[ "com.google.gwt.user.client.ui.CheckBox" ]
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.*;
[ "com.google.gwt" ]
com.google.gwt;
1,105,533
public Builder applyToAllUnaryMethods( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; }
Builder function( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; }
/** * Applies the given settings updater function to all of the unary API methods in this service. * * <p>Note: This method does not support applying settings to streaming methods. */
Applies the given settings updater function to all of the unary API methods in this service. Note: This method does not support applying settings to streaming methods
applyToAllUnaryMethods
{ "repo_name": "googleapis/java-dialogflow-cx", "path": "google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java", "license": "apache-2.0", "size": 18019 }
[ "com.google.api.core.ApiFunction", "com.google.api.gax.rpc.UnaryCallSettings" ]
import com.google.api.core.ApiFunction; import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.api.core.*; import com.google.api.gax.rpc.*;
[ "com.google.api" ]
com.google.api;
2,767,162
public byte[] remove() throws NoSuchElementException, KeeperException, InterruptedException { TreeMap<Long,String> orderedChildren; // Same as for element. Should refactor this. while(true){ try{ orderedChildren = orderedChildren(null); }catch(KeeperException.NoNodeException e){ throw new NoSuchElementException(); } if(orderedChildren.size() == 0) throw new NoSuchElementException(); for(String headNode : orderedChildren.values()){ String path = dir +"/"+headNode; try{ byte[] data = zookeeper.getData(path, false, null); zookeeper.delete(path, -1); return data; }catch(KeeperException.NoNodeException e){ // Another client deleted the node first. } } } } private class LatchChildWatcher implements Watcher { CountDownLatch latch; public LatchChildWatcher(){ latch = new CountDownLatch(1); }
byte[] function() throws NoSuchElementException, KeeperException, InterruptedException { TreeMap<Long,String> orderedChildren; while(true){ try{ orderedChildren = orderedChildren(null); }catch(KeeperException.NoNodeException e){ throw new NoSuchElementException(); } if(orderedChildren.size() == 0) throw new NoSuchElementException(); for(String headNode : orderedChildren.values()){ String path = dir +"/"+headNode; try{ byte[] data = zookeeper.getData(path, false, null); zookeeper.delete(path, -1); return data; }catch(KeeperException.NoNodeException e){ } } } } private class LatchChildWatcher implements Watcher { CountDownLatch latch; public LatchChildWatcher(){ latch = new CountDownLatch(1); }
/** * Attempts to remove the head of the queue and return it. * @return The former head of the queue * @throws NoSuchElementException * @throws KeeperException * @throws InterruptedException */
Attempts to remove the head of the queue and return it
remove
{ "repo_name": "zhushuchen/Ocean", "path": "组件/zookeeper-3.3.6/src/recipes/queue/src/java/org/apache/zookeeper/recipes/queue/DistributedQueue.java", "license": "agpl-3.0", "size": 10480 }
[ "java.util.NoSuchElementException", "java.util.TreeMap", "java.util.concurrent.CountDownLatch", "org.apache.zookeeper.KeeperException", "org.apache.zookeeper.Watcher" ]
import java.util.NoSuchElementException; import java.util.TreeMap; import java.util.concurrent.CountDownLatch; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.Watcher;
import java.util.*; import java.util.concurrent.*; import org.apache.zookeeper.*;
[ "java.util", "org.apache.zookeeper" ]
java.util; org.apache.zookeeper;
2,049,798
public static String getDefaultSchemaName(Properties properties, DataStore<?,?> store) { return findProperty(properties, store, SCHEMA_NAME, null); }
static String function(Properties properties, DataStore<?,?> store) { return findProperty(properties, store, SCHEMA_NAME, null); }
/** * Gets the default schema name of a given store class */
Gets the default schema name of a given store class
getDefaultSchemaName
{ "repo_name": "cguzel/gora", "path": "gora-core/src/main/java/org/apache/gora/store/DataStoreFactory.java", "license": "apache-2.0", "size": 18590 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
1,289,769
public InstitutionalProposalCreditSplitBean getInstitutionalProposalCreditSplitBean() { return institutionalProposalCreditSplitBean; }
InstitutionalProposalCreditSplitBean function() { return institutionalProposalCreditSplitBean; }
/** * Gets the institutionalProposalCreditSplitBean attribute. * @return Returns the institutionalProposalCreditSplitBean. */
Gets the institutionalProposalCreditSplitBean attribute
getInstitutionalProposalCreditSplitBean
{ "repo_name": "blackcathacker/kc.preclean", "path": "coeus-code/src/main/java/org/kuali/kra/institutionalproposal/web/struts/form/InstitutionalProposalForm.java", "license": "apache-2.0", "size": 18882 }
[ "org.kuali.kra.institutionalproposal.contacts.InstitutionalProposalCreditSplitBean" ]
import org.kuali.kra.institutionalproposal.contacts.InstitutionalProposalCreditSplitBean;
import org.kuali.kra.institutionalproposal.contacts.*;
[ "org.kuali.kra" ]
org.kuali.kra;
539,768
protected void collectBindingItems(Set<String> allRawBRefsWoRel, String wrqAlias, boolean selectAll, BindingSet bs) throws BindingException { // We either are looking for a specific list allRawBRefsWoRel or we want to select all being made available from the underlying (maybe virtual) BindingSet Collection<String> bRefsToRetrieve; if( selectAll ) { bRefsToRetrieve = new LinkedList<String>( bs.getBindingItemNames() ); for(Relation rel: bs.getRelations() ) bRefsToRetrieve.addAll( rel.getAllImportItemNames() ); } else { bRefsToRetrieve = allRawBRefsWoRel; } for( String bRef: bRefsToRetrieve ) { BindingItem bi = bs.get(bRef); if( bi== null ) throw new BindingException("BindingItem '"+bRef+"' not found for (virtual) BindingSet '"+wrqAlias+"'"); if( bs.getBindingItemNames().contains(bi.getId()) ) bindingItems.put(wrqAlias+"."+bRef, bi); else importedBindingItems.put(wrqAlias+"."+bRef, bi); } }
void function(Set<String> allRawBRefsWoRel, String wrqAlias, boolean selectAll, BindingSet bs) throws BindingException { Collection<String> bRefsToRetrieve; if( selectAll ) { bRefsToRetrieve = new LinkedList<String>( bs.getBindingItemNames() ); for(Relation rel: bs.getRelations() ) bRefsToRetrieve.addAll( rel.getAllImportItemNames() ); } else { bRefsToRetrieve = allRawBRefsWoRel; } for( String bRef: bRefsToRetrieve ) { BindingItem bi = bs.get(bRef); if( bi== null ) throw new BindingException(STR+bRef+STR+wrqAlias+"'"); if( bs.getBindingItemNames().contains(bi.getId()) ) bindingItems.put(wrqAlias+"."+bRef, bi); else importedBindingItems.put(wrqAlias+"."+bRef, bi); } }
/** * Collect all BindingItems requested from the underlying (maybe virtual) BindingSet * @param allRawBRefsWoRel * @param wrqAlias * @param selectAll * @param bs * @throws BindingException */
Collect all BindingItems requested from the underlying (maybe virtual) BindingSet
collectBindingItems
{ "repo_name": "businesscode/BCD-UI", "path": "Server/src/main/java/de/businesscode/bcdui/wrs/load/WrqBindingSetFromTableReference.java", "license": "apache-2.0", "size": 15620 }
[ "de.businesscode.bcdui.binding.BindingItem", "de.businesscode.bcdui.binding.BindingSet", "de.businesscode.bcdui.binding.exc.BindingException", "de.businesscode.bcdui.binding.rel.Relation", "java.util.Collection", "java.util.LinkedList", "java.util.Set" ]
import de.businesscode.bcdui.binding.BindingItem; import de.businesscode.bcdui.binding.BindingSet; import de.businesscode.bcdui.binding.exc.BindingException; import de.businesscode.bcdui.binding.rel.Relation; import java.util.Collection; import java.util.LinkedList; import java.util.Set;
import de.businesscode.bcdui.binding.*; import de.businesscode.bcdui.binding.exc.*; import de.businesscode.bcdui.binding.rel.*; import java.util.*;
[ "de.businesscode.bcdui", "java.util" ]
de.businesscode.bcdui; java.util;
1,924,752
public void copyRndSettings(ImageData image) { if (image == null) { Browser browser = model.getSelectedBrowser(); if (browser == null) return; TreeImageDisplay node = browser.getLastSelectedDisplay(); if (node == null) return; Object o = node.getUserObject(); if (!(o instanceof ImageData)) return; image = (ImageData) o; } EventBus bus = TreeViewerAgent.getRegistry().getEventBus(); bus.post(new CopyRndSettings(image)); }
void function(ImageData image) { if (image == null) { Browser browser = model.getSelectedBrowser(); if (browser == null) return; TreeImageDisplay node = browser.getLastSelectedDisplay(); if (node == null) return; Object o = node.getUserObject(); if (!(o instanceof ImageData)) return; image = (ImageData) o; } EventBus bus = TreeViewerAgent.getRegistry().getEventBus(); bus.post(new CopyRndSettings(image)); }
/** * Implemented as specified by the {@link TreeViewer} interface. * @see TreeViewer#copyRndSettings(ImageData) */
Implemented as specified by the <code>TreeViewer</code> interface
copyRndSettings
{ "repo_name": "dpwrussell/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java", "license": "gpl-2.0", "size": 162421 }
[ "org.openmicroscopy.shoola.agents.events.iviewer.CopyRndSettings", "org.openmicroscopy.shoola.agents.treeviewer.TreeViewerAgent", "org.openmicroscopy.shoola.agents.treeviewer.browser.Browser", "org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay", "org.openmicroscopy.shoola.env.event.EventBus" ]
import org.openmicroscopy.shoola.agents.events.iviewer.CopyRndSettings; import org.openmicroscopy.shoola.agents.treeviewer.TreeViewerAgent; import org.openmicroscopy.shoola.agents.treeviewer.browser.Browser; import org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay; import org.openmicroscopy.shoola.env.event.EventBus;
import org.openmicroscopy.shoola.agents.events.iviewer.*; import org.openmicroscopy.shoola.agents.treeviewer.*; import org.openmicroscopy.shoola.agents.treeviewer.browser.*; import org.openmicroscopy.shoola.agents.util.browser.*; import org.openmicroscopy.shoola.env.event.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
2,650,538
List<Element> getElementsAnnotatedOrMetaAnnotatedWith(Element element, TypeElement annotationType) { LinkedList<Element> stack = new LinkedList<>(); stack.push(element); collectElementsAnnotatedOrMetaAnnotatedWith(annotationType, stack); stack.removeFirst(); return Collections.unmodifiableList(stack); }
List<Element> getElementsAnnotatedOrMetaAnnotatedWith(Element element, TypeElement annotationType) { LinkedList<Element> stack = new LinkedList<>(); stack.push(element); collectElementsAnnotatedOrMetaAnnotatedWith(annotationType, stack); stack.removeFirst(); return Collections.unmodifiableList(stack); }
/** * Collect the annotations that are annotated or meta-annotated with the specified * {@link TypeElement annotation}. * @param element the element to inspect * @param annotationType the annotation to discover * @return the annotations that are annotated or meta-annotated with this annotation */
Collect the annotations that are annotated or meta-annotated with the specified <code>TypeElement annotation</code>
getElementsAnnotatedOrMetaAnnotatedWith
{ "repo_name": "royclarkson/spring-boot", "path": "spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/MetadataGenerationEnvironment.java", "license": "apache-2.0", "size": 11156 }
[ "java.util.Collections", "java.util.LinkedList", "java.util.List", "javax.lang.model.element.Element", "javax.lang.model.element.TypeElement" ]
import java.util.Collections; import java.util.LinkedList; import java.util.List; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement;
import java.util.*; import javax.lang.model.element.*;
[ "java.util", "javax.lang" ]
java.util; javax.lang;
1,588,834
EClass getOclFeatureDefinition();
EClass getOclFeatureDefinition();
/** * Returns the meta object for class '{@link anatlyzer.atlext.OCL.OclFeatureDefinition <em>Ocl Feature Definition</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Ocl Feature Definition</em>'. * @see anatlyzer.atlext.OCL.OclFeatureDefinition * @generated */
Returns the meta object for class '<code>anatlyzer.atlext.OCL.OclFeatureDefinition Ocl Feature Definition</code>'.
getOclFeatureDefinition
{ "repo_name": "jesusc/anatlyzer", "path": "plugins/anatlyzer.atl.typing/src-gen/anatlyzer/atlext/OCL/OCLPackage.java", "license": "epl-1.0", "size": 484377 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,621,646
public boolean isMetaDataField(Version indexCreatedVersion, String field) { return getMetadataMapperParsers(indexCreatedVersion).containsKey(field); }
boolean function(Version indexCreatedVersion, String field) { return getMetadataMapperParsers(indexCreatedVersion).containsKey(field); }
/** * Returns true if the provided field is a registered metadata field, false otherwise */
Returns true if the provided field is a registered metadata field, false otherwise
isMetaDataField
{ "repo_name": "coding0011/elasticsearch", "path": "server/src/main/java/org/elasticsearch/indices/mapper/MapperRegistry.java", "license": "apache-2.0", "size": 4005 }
[ "org.elasticsearch.Version" ]
import org.elasticsearch.Version;
import org.elasticsearch.*;
[ "org.elasticsearch" ]
org.elasticsearch;
2,770,576
private void handleStepOptions(StepConfig stepConfig, Map<String, String> stepOptions) { stepConfig.setForced(Boolean.parseBoolean(stepOptions.get(FrameworkConstants.JSAttributes.FORCE_AUTH_PARAM))); }
void function(StepConfig stepConfig, Map<String, String> stepOptions) { stepConfig.setForced(Boolean.parseBoolean(stepOptions.get(FrameworkConstants.JSAttributes.FORCE_AUTH_PARAM))); }
/** * Handle step options provided for the step from the authentication script. * * @param stepConfig config of the step * @param stepOptions options provided from the script for the step */
Handle step options provided for the step from the authentication script
handleStepOptions
{ "repo_name": "omindu/carbon-identity-framework", "path": "components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/config/model/graph/JsGraphBuilder.java", "license": "apache-2.0", "size": 44341 }
[ "java.util.Map", "org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig", "org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants" ]
import java.util.Map; import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig; import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants;
import java.util.*; import org.wso2.carbon.identity.application.authentication.framework.config.model.*; import org.wso2.carbon.identity.application.authentication.framework.util.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
1,002,528
@Nullable public OsStats getOs() { return this.os; }
OsStats function() { return this.os; }
/** * Operating System level statistics. */
Operating System level statistics
getOs
{ "repo_name": "ern/elasticsearch", "path": "server/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java", "license": "apache-2.0", "size": 9977 }
[ "org.elasticsearch.monitor.os.OsStats" ]
import org.elasticsearch.monitor.os.OsStats;
import org.elasticsearch.monitor.os.*;
[ "org.elasticsearch.monitor" ]
org.elasticsearch.monitor;
1,194,825
public RouteDefinition getOriginalRoute() { return originalRoute; }
RouteDefinition function() { return originalRoute; }
/** * Gets the original route to be adviced. * * @return the original route. */
Gets the original route to be adviced
getOriginalRoute
{ "repo_name": "Fabryprog/camel", "path": "core/camel-core/src/main/java/org/apache/camel/builder/AdviceWithRouteBuilder.java", "license": "apache-2.0", "size": 10700 }
[ "org.apache.camel.model.RouteDefinition" ]
import org.apache.camel.model.RouteDefinition;
import org.apache.camel.model.*;
[ "org.apache.camel" ]
org.apache.camel;
2,848,268
@Test public void test6ContentInstanceCreate() { LOGGER.info("\t***************** begin test *****************"); // parent container of the future contentInstance Container container = new Container("MyContainerId2"); // Parent application of the container Application myApp = new Application("MyApp" + APP_ID_TEST); container.setApplication(myApp); ContentInstanceManager contentInstanceManager = Om2mManagersFactorty.getManager(Om2mManagersFactorty.CONTENT_INSTANCE_MANAGER); for (int i = 0; i < 10; i++) { ContentInstance contentInstance = new ContentInstance("contentInstanceId" + i); contentInstance.setContainer(container); Base64Binary base64Binary = new Base64Binary(); base64Binary.setContentType("String"); base64Binary.setValue(("dataInstance_" + container.getId() + "_" + myApp.getAppId() + "-" + i).toString().getBytes()); contentInstance.setContent(base64Binary); int httpCodeResp = contentInstanceManager.create(contentInstance); LOGGER.info("httpCodeResp : " + httpCodeResp); // LOGGER.info("exist(container) : " + contentInstanceManager.exist(contentInstance)); Assert.assertEquals(201, httpCodeResp); // Assert.assertTrue("should be true", (contentInstanceManager.exist(contentInstance) == true)); } }
void function() { LOGGER.info(STR); Container container = new Container(STR); Application myApp = new Application("MyApp" + APP_ID_TEST); container.setApplication(myApp); ContentInstanceManager contentInstanceManager = Om2mManagersFactorty.getManager(Om2mManagersFactorty.CONTENT_INSTANCE_MANAGER); for (int i = 0; i < 10; i++) { ContentInstance contentInstance = new ContentInstance(STR + i); contentInstance.setContainer(container); Base64Binary base64Binary = new Base64Binary(); base64Binary.setContentType(STR); base64Binary.setValue((STR + container.getId() + "_" + myApp.getAppId() + "-" + i).toString().getBytes()); contentInstance.setContent(base64Binary); int httpCodeResp = contentInstanceManager.create(contentInstance); LOGGER.info(STR + httpCodeResp); Assert.assertEquals(201, httpCodeResp); } }
/** * Test4 content instance create. */
Test4 content instance create
test6ContentInstanceCreate
{ "repo_name": "BeliliFahem/om2m-java-client-api", "path": "src/test/java/fr/lissi/belilif/om2m/test/Om2mManagerTest.java", "license": "epl-1.0", "size": 10614 }
[ "fr.lissi.belilif.om2m.oao.ContentInstanceManager", "fr.lissi.belilif.om2m.oao.Om2mManagersFactorty", "org.eclipse.om2m.commons.resource.Application", "org.eclipse.om2m.commons.resource.Base64Binary", "org.eclipse.om2m.commons.resource.Container", "org.eclipse.om2m.commons.resource.ContentInstance", "org.junit.Assert" ]
import fr.lissi.belilif.om2m.oao.ContentInstanceManager; import fr.lissi.belilif.om2m.oao.Om2mManagersFactorty; import org.eclipse.om2m.commons.resource.Application; import org.eclipse.om2m.commons.resource.Base64Binary; import org.eclipse.om2m.commons.resource.Container; import org.eclipse.om2m.commons.resource.ContentInstance; import org.junit.Assert;
import fr.lissi.belilif.om2m.oao.*; import org.eclipse.om2m.commons.resource.*; import org.junit.*;
[ "fr.lissi.belilif", "org.eclipse.om2m", "org.junit" ]
fr.lissi.belilif; org.eclipse.om2m; org.junit;
1,746,262
public void setDirectTunnelValue(YangEnumeration directTunnelValue) throws JNCException { setLeafValue(Epc.NAMESPACE, "direct-tunnel", directTunnelValue, childrenNames()); }
void function(YangEnumeration directTunnelValue) throws JNCException { setLeafValue(Epc.NAMESPACE, STR, directTunnelValue, childrenNames()); }
/** * Sets the value for child leaf "direct-tunnel", * using instance of generated typedef class. * @param directTunnelValue The value to set. * @param directTunnelValue used during instantiation. */
Sets the value for child leaf "direct-tunnel", using instance of generated typedef class
setDirectTunnelValue
{ "repo_name": "jnpr-shinma/yangfile", "path": "hitel/src/hctaEpc/mmeSgsn/interface_/iu/MmeRnc.java", "license": "apache-2.0", "size": 16207 }
[ "com.tailf.jnc.YangEnumeration" ]
import com.tailf.jnc.YangEnumeration;
import com.tailf.jnc.*;
[ "com.tailf.jnc" ]
com.tailf.jnc;
2,071,867
@Override public boolean propertyExists(final String name) throws JMSException { if (ActiveMQRAMessage.trace) { ActiveMQRALogger.LOGGER.trace("propertyExists(" + name + ")"); } return message.propertyExists(name); }
boolean function(final String name) throws JMSException { if (ActiveMQRAMessage.trace) { ActiveMQRALogger.LOGGER.trace(STR + name + ")"); } return message.propertyExists(name); }
/** * Do property exist * * @param name The name * @return The value * @throws JMSException Thrown if an error occurs */
Do property exist
propertyExists
{ "repo_name": "l-dobrev/activemq-artemis", "path": "artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRAMessage.java", "license": "apache-2.0", "size": 21214 }
[ "javax.jms.JMSException" ]
import javax.jms.JMSException;
import javax.jms.*;
[ "javax.jms" ]
javax.jms;
2,066,795
protected static String checkJVMPath (String vmhome, boolean windebug) { String vmbase = vmhome + File.separator + "bin" + File.separator; String vmpath = vmbase + "java"; if (new File(vmpath).exists()) { return vmpath; } if (!windebug) { vmpath = vmbase + "javaw.exe"; if (new File(vmpath).exists()) { return vmpath; } } vmpath = vmbase + "java.exe"; if (new File(vmpath).exists()) { return vmpath; } return null; }
static String function (String vmhome, boolean windebug) { String vmbase = vmhome + File.separator + "bin" + File.separator; String vmpath = vmbase + "java"; if (new File(vmpath).exists()) { return vmpath; } if (!windebug) { vmpath = vmbase + STR; if (new File(vmpath).exists()) { return vmpath; } } vmpath = vmbase + STR; if (new File(vmpath).exists()) { return vmpath; } return null; }
/** * Checks whether a Java Virtual Machine can be located in the supplied path. */
Checks whether a Java Virtual Machine can be located in the supplied path
checkJVMPath
{ "repo_name": "makkus/getdown", "path": "src/main/java/com/threerings/getdown/util/LaunchUtil.java", "license": "bsd-2-clause", "size": 9816 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
643,030
public void appendNameShorthandLookup(IndexBuilder builder, String name, int fullNameStyle) { Iterator<String> it = ContactLocaleUtils.getInstance().getNameLookupKeys(name, fullNameStyle); if (it != null) { while (it.hasNext()) { builder.appendName(it.next()); } } }
void function(IndexBuilder builder, String name, int fullNameStyle) { Iterator<String> it = ContactLocaleUtils.getInstance().getNameLookupKeys(name, fullNameStyle); if (it != null) { while (it.hasNext()) { builder.appendName(it.next()); } } }
/** * Insert more name indexes according to locale specifies for those locales * for which we have alternative shorthand name methods (eg, Pinyin for * Chinese, Romaji for Japanese). */
Insert more name indexes according to locale specifies for those locales for which we have alternative shorthand name methods (eg, Pinyin for Chinese, Romaji for Japanese)
appendNameShorthandLookup
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "packages/providers/ContactsProvider/src/com/android/providers/contacts/NameLookupBuilder.java", "license": "gpl-3.0", "size": 13210 }
[ "com.android.providers.contacts.SearchIndexManager", "java.util.Iterator" ]
import com.android.providers.contacts.SearchIndexManager; import java.util.Iterator;
import com.android.providers.contacts.*; import java.util.*;
[ "com.android.providers", "java.util" ]
com.android.providers; java.util;
1,619,356
void callUserDataHandlers(Node n, Node c, short operation,Hashtable userData) { if (userData == null || userData.isEmpty()) { return; } Enumeration keys = userData.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); UserDataRecord r = (UserDataRecord) userData.get(key); if (r.fHandler != null) { r.fHandler.handle(operation, key, r.fData, n, c); } } } // Temporarily comment out this method, because // 1. It seems that finalizers are not guaranteed to be called, so the // functionality is not implemented. // 2. It affects the performance greatly in multi-thread environment. // -SG /*public void finalize() { if (userData == null) { return; } Enumeration nodes = userData.keys(); while (nodes.hasMoreElements()) { Object node = nodes.nextElement(); Hashtable t = (Hashtable) userData.get(node); if (t != null && !t.isEmpty()) { Enumeration keys = t.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); UserDataRecord r = (UserDataRecord) t.get(key); if (r.fHandler != null) { r.fHandler.handle(UserDataHandler.NODE_DELETED, key, r.fData, null, null); } } } }
void callUserDataHandlers(Node n, Node c, short operation,Hashtable userData) { if (userData == null userData.isEmpty()) { return; } Enumeration keys = userData.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); UserDataRecord r = (UserDataRecord) userData.get(key); if (r.fHandler != null) { r.fHandler.handle(operation, key, r.fData, n, c); } } } /*public void finalize() { if (userData == null) { return; } Enumeration nodes = userData.keys(); while (nodes.hasMoreElements()) { Object node = nodes.nextElement(); Hashtable t = (Hashtable) userData.get(node); if (t != null && !t.isEmpty()) { Enumeration keys = t.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); UserDataRecord r = (UserDataRecord) t.get(key); if (r.fHandler != null) { r.fHandler.handle(UserDataHandler.NODE_DELETED, key, r.fData, null, null); } } } }
/** * Call user data handlers when a node is deleted (finalized) * @param n The node this operation applies to. * @param c The copy node or null. * @param operation The operation - import, clone, or delete. * @param handlers Data associated with n. */
Call user data handlers when a node is deleted (finalized)
callUserDataHandlers
{ "repo_name": "TheTypoMaster/Scaper", "path": "openjdk/jaxp/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java", "license": "gpl-2.0", "size": 98511 }
[ "java.util.Enumeration", "java.util.Hashtable", "org.w3c.dom.Node", "org.w3c.dom.UserDataHandler" ]
import java.util.Enumeration; import java.util.Hashtable; import org.w3c.dom.Node; import org.w3c.dom.UserDataHandler;
import java.util.*; import org.w3c.dom.*;
[ "java.util", "org.w3c.dom" ]
java.util; org.w3c.dom;
251,583
@SuppressWarnings("unchecked") public void displayTable(final List<IssueTrackerLogin> issueTrackerList) { Form listForm = new Form("listFormIssueTrackerLogin"); tm = new TableModelIssueTrackerLogin(issueTrackerList); table = new Table("userIssueTrackerLoginTable", tm); table.setWidths(EffortUtils.WIDTHS); ButtonEditRenderer editRenderer = new ButtonEditRenderer(this); table.setDefaultRenderer(ButtonEdit.class, editRenderer); table.setDefaultEditor(ButtonEdit.class, editRenderer); ButtonDeleteRenderer deleteRenderer = new ButtonDeleteRenderer(this); table.setDefaultRenderer(ButtonDelete.class, deleteRenderer); table.setDefaultEditor(ButtonDelete.class, deleteRenderer); // add components to the container listForm.addOrReplace(table); container.addOrReplace(listForm); }
@SuppressWarnings(STR) void function(final List<IssueTrackerLogin> issueTrackerList) { Form listForm = new Form(STR); tm = new TableModelIssueTrackerLogin(issueTrackerList); table = new Table(STR, tm); table.setWidths(EffortUtils.WIDTHS); ButtonEditRenderer editRenderer = new ButtonEditRenderer(this); table.setDefaultRenderer(ButtonEdit.class, editRenderer); table.setDefaultEditor(ButtonEdit.class, editRenderer); ButtonDeleteRenderer deleteRenderer = new ButtonDeleteRenderer(this); table.setDefaultRenderer(ButtonDelete.class, deleteRenderer); table.setDefaultEditor(ButtonDelete.class, deleteRenderer); listForm.addOrReplace(table); container.addOrReplace(listForm); }
/** * displays the table of IssueTrackerLogins. * * @param issueTrackerList the list of IssueTracker. */
displays the table of IssueTrackerLogins
displayTable
{ "repo_name": "tita/tita", "path": "tita-wicket/src/main/java/at/ac/tuwien/ifs/tita/ui/administration/user/UserIssueTrackerLoginPanel.java", "license": "apache-2.0", "size": 8106 }
[ "at.ac.tuwien.ifs.tita.entity.IssueTrackerLogin", "at.ac.tuwien.ifs.tita.ui.models.TableModelIssueTrackerLogin", "at.ac.tuwien.ifs.tita.ui.uihelper.ButtonDelete", "at.ac.tuwien.ifs.tita.ui.uihelper.ButtonDeleteRenderer", "at.ac.tuwien.ifs.tita.ui.uihelper.ButtonEdit", "at.ac.tuwien.ifs.tita.ui.uihelper.ButtonEditRenderer", "at.ac.tuwien.ifs.tita.ui.utils.EffortUtils", "java.util.List", "org.apache.wicket.markup.html.form.Form", "org.wicketstuff.table.Table" ]
import at.ac.tuwien.ifs.tita.entity.IssueTrackerLogin; import at.ac.tuwien.ifs.tita.ui.models.TableModelIssueTrackerLogin; import at.ac.tuwien.ifs.tita.ui.uihelper.ButtonDelete; import at.ac.tuwien.ifs.tita.ui.uihelper.ButtonDeleteRenderer; import at.ac.tuwien.ifs.tita.ui.uihelper.ButtonEdit; import at.ac.tuwien.ifs.tita.ui.uihelper.ButtonEditRenderer; import at.ac.tuwien.ifs.tita.ui.utils.EffortUtils; import java.util.List; import org.apache.wicket.markup.html.form.Form; import org.wicketstuff.table.Table;
import at.ac.tuwien.ifs.tita.entity.*; import at.ac.tuwien.ifs.tita.ui.models.*; import at.ac.tuwien.ifs.tita.ui.uihelper.*; import at.ac.tuwien.ifs.tita.ui.utils.*; import java.util.*; import org.apache.wicket.markup.html.form.*; import org.wicketstuff.table.*;
[ "at.ac.tuwien", "java.util", "org.apache.wicket", "org.wicketstuff.table" ]
at.ac.tuwien; java.util; org.apache.wicket; org.wicketstuff.table;
975,029
Integer getElapseTime() { return (Integer) registry.lookup(LookupNames.ELAPSE_TIME); }
Integer getElapseTime() { return (Integer) registry.lookup(LookupNames.ELAPSE_TIME); }
/** * Returns the time before each network check. * * @return See above. */
Returns the time before each network check
getElapseTime
{ "repo_name": "lucalianas/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/DataServicesFactory.java", "license": "gpl-2.0", "size": 28558 }
[ "org.openmicroscopy.shoola.env.LookupNames" ]
import org.openmicroscopy.shoola.env.LookupNames;
import org.openmicroscopy.shoola.env.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
2,366,318
Logger.v(TAG, "HttpWebRequest setupConnection thread:" + android.os.Process.myTid()); if (mUrl == null) { throw new IllegalArgumentException("requestURL"); } if (!mUrl.getProtocol().equalsIgnoreCase("http") && !mUrl.getProtocol().equalsIgnoreCase("https")) { throw new IllegalArgumentException("requestURL"); } HttpURLConnection.setFollowRedirects(true); final HttpURLConnection connection = HttpUrlConnectionFactory.createHttpUrlConnection(mUrl); connection.setConnectTimeout(CONNECT_TIME_OUT); // To prevent EOF exception. if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB_MR2) { connection.setRequestProperty("Connection", "close"); } // Apply the request headers final Set<Map.Entry<String, String>> headerEntries = mRequestHeaders.entrySet(); for (final Map.Entry<String, String> entry : headerEntries) { Logger.v(TAG, "Setting header: " + entry.getKey()); connection.setRequestProperty(entry.getKey(), entry.getValue()); } connection.setReadTimeout(READ_TIME_OUT); connection.setInstanceFollowRedirects(true); connection.setUseCaches(false); connection.setRequestMethod(mRequestMethod); connection.setDoInput(true); // it will at least read status // code. Default is true. setRequestBody(connection, mRequestContent, mRequestContentType); return connection; }
Logger.v(TAG, STR + android.os.Process.myTid()); if (mUrl == null) { throw new IllegalArgumentException(STR); } if (!mUrl.getProtocol().equalsIgnoreCase("http") && !mUrl.getProtocol().equalsIgnoreCase("https")) { throw new IllegalArgumentException(STR); } HttpURLConnection.setFollowRedirects(true); final HttpURLConnection connection = HttpUrlConnectionFactory.createHttpUrlConnection(mUrl); connection.setConnectTimeout(CONNECT_TIME_OUT); if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB_MR2) { connection.setRequestProperty(STR, "close"); } final Set<Map.Entry<String, String>> headerEntries = mRequestHeaders.entrySet(); for (final Map.Entry<String, String> entry : headerEntries) { Logger.v(TAG, STR + entry.getKey()); connection.setRequestProperty(entry.getKey(), entry.getValue()); } connection.setReadTimeout(READ_TIME_OUT); connection.setInstanceFollowRedirects(true); connection.setUseCaches(false); connection.setRequestMethod(mRequestMethod); connection.setDoInput(true); setRequestBody(connection, mRequestContent, mRequestContentType); return connection; }
/** * setupConnection before sending the request. */
setupConnection before sending the request
setupConnection
{ "repo_name": "iambmelt/azure-activedirectory-library-for-android", "path": "adal/src/main/java/com/microsoft/aad/adal/HttpWebRequest.java", "license": "apache-2.0", "size": 10984 }
[ "android.os.Build", "android.os.Process", "java.net.HttpURLConnection", "java.util.Map", "java.util.Set" ]
import android.os.Build; import android.os.Process; import java.net.HttpURLConnection; import java.util.Map; import java.util.Set;
import android.os.*; import java.net.*; import java.util.*;
[ "android.os", "java.net", "java.util" ]
android.os; java.net; java.util;
103,054
ResolvedJavaMethod ifaceMethod = getMetaAccess().lookupJavaMethod(Person.class.getDeclaredMethod("getName")); PersonImpl person = new PersonImpl("maya"); TenantImpl tenant = new TenantImpl(0xdeadbeef); // Ensure the relevant methods are linked person.getName(); tenant.getName(); for (int i = 0; i < ITERATIONS; i++) { getLabelLength(person); getLabelLength(tenant); } // Until HotSpotResolvedObjectTypeImpl.findUniqueConcreteMethod is fixed, // this causes a VM crash as getLabelLength() directly invokes PersonImpl.getName(). test("getLabelLength", tenant); ResolvedJavaMethod expected = null; AssumptionResult<ResolvedJavaMethod> actual = getMetaAccess().lookupJavaType(AbstractPerson.class).findUniqueConcreteMethod(ifaceMethod); Assert.assertEquals(expected, actual.getResult()); }
ResolvedJavaMethod ifaceMethod = getMetaAccess().lookupJavaMethod(Person.class.getDeclaredMethod(STR)); PersonImpl person = new PersonImpl("maya"); TenantImpl tenant = new TenantImpl(0xdeadbeef); person.getName(); tenant.getName(); for (int i = 0; i < ITERATIONS; i++) { getLabelLength(person); getLabelLength(tenant); } test(STR, tenant); ResolvedJavaMethod expected = null; AssumptionResult<ResolvedJavaMethod> actual = getMetaAccess().lookupJavaType(AbstractPerson.class).findUniqueConcreteMethod(ifaceMethod); Assert.assertEquals(expected, actual.getResult()); }
/** * Executing {@link ResolvedJavaType#findUniqueConcreteMethod(ResolvedJavaMethod)} for the * method {@link Person#getName()} on the type {@link AbstractPerson} should return null as both * {@link PersonImpl} and {@link TenantImpl} provide implementations (namely * {@link PersonImpl#getName()} and {@link Tenant#getName()}). */
Executing <code>ResolvedJavaType#findUniqueConcreteMethod(ResolvedJavaMethod)</code> for the method <code>Person#getName()</code> on the type <code>AbstractPerson</code> should return null as both <code>PersonImpl</code> and <code>TenantImpl</code> provide implementations (namely <code>PersonImpl#getName()</code> and <code>Tenant#getName()</code>)
test
{ "repo_name": "smarr/GraalCompiler", "path": "graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FindUniqueConcreteMethodBugTest.java", "license": "gpl-2.0", "size": 3980 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,585,354
if (!isFinished()) { ClientContact contact = node.getStorage().getClientContact(id); List<ClientNodeInfo> nodeInfos = node.getStorage() .findNeighbors(id); UpdatePositionClientMessage msg = new UpdatePositionClientMessage( nodeInfos); node.getTransLayer().send(msg, contact.getTransInfo(), node.getPort(), CSConfiguration.TRANSPORT_PROTOCOL); this.operationFinished(true); } this.operationFinished(false); }
if (!isFinished()) { ClientContact contact = node.getStorage().getClientContact(id); List<ClientNodeInfo> nodeInfos = node.getStorage() .findNeighbors(id); UpdatePositionClientMessage msg = new UpdatePositionClientMessage( nodeInfos); node.getTransLayer().send(msg, contact.getTransInfo(), node.getPort(), CSConfiguration.TRANSPORT_PROTOCOL); this.operationFinished(true); } this.operationFinished(false); }
/** * Derive all neighbors for the stored clientID, and send this list to the * client. */
Derive all neighbors for the stored clientID, and send this list to the client
execute
{ "repo_name": "flyroom/PeerfactSimKOM_Clone", "path": "src/org/peerfact/impl/overlay/informationdissemination/cs/operations/ServerDisseminationOperation.java", "license": "gpl-2.0", "size": 3417 }
[ "java.util.List", "org.peerfact.impl.overlay.informationdissemination.cs.ClientContact", "org.peerfact.impl.overlay.informationdissemination.cs.ClientNodeInfo", "org.peerfact.impl.overlay.informationdissemination.cs.messages.UpdatePositionClientMessage", "org.peerfact.impl.overlay.informationdissemination.cs.util.CSConfiguration" ]
import java.util.List; import org.peerfact.impl.overlay.informationdissemination.cs.ClientContact; import org.peerfact.impl.overlay.informationdissemination.cs.ClientNodeInfo; import org.peerfact.impl.overlay.informationdissemination.cs.messages.UpdatePositionClientMessage; import org.peerfact.impl.overlay.informationdissemination.cs.util.CSConfiguration;
import java.util.*; import org.peerfact.impl.overlay.informationdissemination.cs.*; import org.peerfact.impl.overlay.informationdissemination.cs.messages.*; import org.peerfact.impl.overlay.informationdissemination.cs.util.*;
[ "java.util", "org.peerfact.impl" ]
java.util; org.peerfact.impl;
1,074,188
protected List<Double> getCorrelationCoefficients(double[][] data) { int n = data.length; int m = data[0].length; List<Double> correlationCoefficients = new LinkedList<Double>(); for (int i = 0; i < n; i++) { double[][] x = new double[n - 1][m]; int k = 0; for (int j = 0; j < n; j++) { if (j != i) { x[k++] = data[j]; } } Regression reg = new Regression(x, data[i]); reg.linear(); correlationCoefficients.add(reg.getCoefficientOfDetermination()); } return correlationCoefficients; }
List<Double> function(double[][] data) { int n = data.length; int m = data[0].length; List<Double> correlationCoefficients = new LinkedList<Double>(); for (int i = 0; i < n; i++) { double[][] x = new double[n - 1][m]; int k = 0; for (int j = 0; j < n; j++) { if (j != i) { x[k++] = data[j]; } } Regression reg = new Regression(x, data[i]); reg.linear(); correlationCoefficients.add(reg.getCoefficientOfDetermination()); } return correlationCoefficients; }
/** * Gets the correlation coefficients. * * @param data the data * @return the correlation coefficients */
Gets the correlation coefficients
getCorrelationCoefficients
{ "repo_name": "jgera/dynamiccloudsim", "path": "src/org/cloudbus/cloudsim/power/PowerVmSelectionPolicyMaximumCorrelation.java", "license": "lgpl-3.0", "size": 4442 }
[ "java.util.LinkedList", "java.util.List" ]
import java.util.LinkedList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,853
public static void setUpdateInterval(Context context, long newValue) { instanceAvailable(); SharedPreferences.Editor editor = PreferenceManager .getDefaultSharedPreferences(context.getApplicationContext()) .edit(); editor.putString(PREF_UPDATE_INTERVAL, String.valueOf(newValue)); editor.commit(); instance.updateInterval = newValue; }
static void function(Context context, long newValue) { instanceAvailable(); SharedPreferences.Editor editor = PreferenceManager .getDefaultSharedPreferences(context.getApplicationContext()) .edit(); editor.putString(PREF_UPDATE_INTERVAL, String.valueOf(newValue)); editor.commit(); instance.updateInterval = newValue; }
/** * Sets the update interval value. Should only be used for testing purposes! */
Sets the update interval value. Should only be used for testing purposes
setUpdateInterval
{ "repo_name": "cdysthe/AntennaPod", "path": "core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java", "license": "mit", "size": 25472 }
[ "android.content.Context", "android.content.SharedPreferences", "android.preference.PreferenceManager" ]
import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager;
import android.content.*; import android.preference.*;
[ "android.content", "android.preference" ]
android.content; android.preference;
1,544,408
public void checkMBoardSize(PathwayObject e) { // TODO was protected final int BORDER_SIZE = 30; double mw = getPathway().getBoardWidth(); double mh = getPathway().getBoardHeight(); if (e instanceof LineElement) { // TODO mw = Math.max(mw, BORDER_SIZE + Math.max(((LineElement) e).getStartLinePointX(), ((LineElement) e).getEndLinePointX())); mh = Math.max(mh, BORDER_SIZE + Math.max(((LineElement) e).getStartLinePointY(), ((LineElement) e).getEndLinePointY())); } else if (e instanceof ShapedElement) { // TODO mw = Math.max(mw, BORDER_SIZE + ((ShapedElement) e).getLeft() + ((ShapedElement) e).getWidth()); mh = Math.max(mh, BORDER_SIZE + ((ShapedElement) e).getTop() + ((ShapedElement) e).getHeight()); } if (Math.abs(getPathway().getBoardWidth() - mw) + Math.abs(getPathway().getBoardHeight() - mh) > 0.01) { getPathway().setBoardWidth(mw); getPathway().setBoardHeight(mh); fireObjectModifiedEvent(new PathwayModelEvent(getPathway(), PathwayModelEvent.RESIZED)); } }
void function(PathwayObject e) { final int BORDER_SIZE = 30; double mw = getPathway().getBoardWidth(); double mh = getPathway().getBoardHeight(); if (e instanceof LineElement) { mw = Math.max(mw, BORDER_SIZE + Math.max(((LineElement) e).getStartLinePointX(), ((LineElement) e).getEndLinePointX())); mh = Math.max(mh, BORDER_SIZE + Math.max(((LineElement) e).getStartLinePointY(), ((LineElement) e).getEndLinePointY())); } else if (e instanceof ShapedElement) { mw = Math.max(mw, BORDER_SIZE + ((ShapedElement) e).getLeft() + ((ShapedElement) e).getWidth()); mh = Math.max(mh, BORDER_SIZE + ((ShapedElement) e).getTop() + ((ShapedElement) e).getHeight()); } if (Math.abs(getPathway().getBoardWidth() - mw) + Math.abs(getPathway().getBoardHeight() - mh) > 0.01) { getPathway().setBoardWidth(mw); getPathway().setBoardHeight(mh); fireObjectModifiedEvent(new PathwayModelEvent(getPathway(), PathwayModelEvent.RESIZED)); } }
/** * Checks whether the board size is still large enough for the given * {@link PathwayElement} and increases the size if not * * @param e The element to check the board size for */
Checks whether the board size is still large enough for the given <code>PathwayElement</code> and increases the size if not
checkMBoardSize
{ "repo_name": "PathVisio/libGPML", "path": "org.pathvisio.lib/src/main/java/org/pathvisio/model/PathwayModel.java", "license": "apache-2.0", "size": 39949 }
[ "org.pathvisio.event.PathwayModelEvent" ]
import org.pathvisio.event.PathwayModelEvent;
import org.pathvisio.event.*;
[ "org.pathvisio.event" ]
org.pathvisio.event;
1,185,035
public DeleteWarmerRequest names(@Nullable String... names) { this.names = names; return this; }
DeleteWarmerRequest function(@Nullable String... names) { this.names = names; return this; }
/** * The name (or wildcard expression) of the index warmer to delete, or null * to delete all warmers. */
The name (or wildcard expression) of the index warmer to delete, or null to delete all warmers
names
{ "repo_name": "weipinghe/elasticsearch", "path": "core/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerRequest.java", "license": "apache-2.0", "size": 4997 }
[ "org.elasticsearch.common.Nullable" ]
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
2,277,531
public Builder addConfigurationOptions(Class<? extends FragmentOptions> configurationOptions) { this.configurationOptions.add(configurationOptions); return this; }
Builder function(Class<? extends FragmentOptions> configurationOptions) { this.configurationOptions.add(configurationOptions); return this; }
/** * Adds configuration options that aren't required by configuration fragments. * * <p>If {@link #addConfigurationFragment(ConfigurationFragmentFactory)} adds a fragment factory * that also requires these options, this method is redundant. */
Adds configuration options that aren't required by configuration fragments. If <code>#addConfigurationFragment(ConfigurationFragmentFactory)</code> adds a fragment factory that also requires these options, this method is redundant
addConfigurationOptions
{ "repo_name": "akira-baruah/bazel", "path": "src/main/java/com/google/devtools/build/lib/analysis/ConfiguredRuleClassProvider.java", "license": "apache-2.0", "size": 34995 }
[ "com.google.devtools.build.lib.analysis.config.FragmentOptions" ]
import com.google.devtools.build.lib.analysis.config.FragmentOptions;
import com.google.devtools.build.lib.analysis.config.*;
[ "com.google.devtools" ]
com.google.devtools;
228,536
EAttribute getGConnector_X();
EAttribute getGConnector_X();
/** * Returns the meta object for the attribute '{@link de.tesis.dynaware.grapheditor.model.GConnector#getX <em>X</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>X</em>'. * @see de.tesis.dynaware.grapheditor.model.GConnector#getX() * @see #getGConnector() * @generated */
Returns the meta object for the attribute '<code>de.tesis.dynaware.grapheditor.model.GConnector#getX X</code>'.
getGConnector_X
{ "repo_name": "eckig/graph-editor", "path": "model/src/main/java/de/tesis/dynaware/grapheditor/model/GraphPackage.java", "license": "epl-1.0", "size": 33067 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,817,570
private void initialiseLogger() { if (System.getProperty(LOG_FILE_CONFIG_SYSTEM_PROPERTY) == null) { System.setProperty(LOG_FILE_CONFIG_SYSTEM_PROPERTY, getProjectPath() + DEFAULT_LOG_CONFIG_FILE); } System.setProperty(LOG_FILE_OUTPUT_SYSTEM_PROPERTY_MAIN, getPath(LOGGING_FILE_PATH_MAIN)); System.setProperty(LOG_FILE_OUTPUT_SYSTEM_PROPERTY_POST_PROCESSING, getPath(LOGGING_FILE_PATH_POST_PROCESSING)); System.setProperty(LOG_NAME_POSTPROCESSING_PROPERTY, LOG_NAME_POSTPROCESSING_DEFAULT); setLogLevel(); if (!(new File(System.getProperty(LOG_FILE_CONFIG_SYSTEM_PROPERTY))).exists()) { LoggerFactory.getLogger(GraknEngineConfig.class).error(ErrorMessage.NO_LOG_CONFIG_FILE.getMessage(System.getProperty(LOG_FILE_CONFIG_SYSTEM_PROPERTY))); } else { LOG = LoggerFactory.getLogger(GraknEngineConfig.class); LOG.info("Logging configuration file in use:[" + System.getProperty(LOG_FILE_CONFIG_SYSTEM_PROPERTY) + "]"); } }
void function() { if (System.getProperty(LOG_FILE_CONFIG_SYSTEM_PROPERTY) == null) { System.setProperty(LOG_FILE_CONFIG_SYSTEM_PROPERTY, getProjectPath() + DEFAULT_LOG_CONFIG_FILE); } System.setProperty(LOG_FILE_OUTPUT_SYSTEM_PROPERTY_MAIN, getPath(LOGGING_FILE_PATH_MAIN)); System.setProperty(LOG_FILE_OUTPUT_SYSTEM_PROPERTY_POST_PROCESSING, getPath(LOGGING_FILE_PATH_POST_PROCESSING)); System.setProperty(LOG_NAME_POSTPROCESSING_PROPERTY, LOG_NAME_POSTPROCESSING_DEFAULT); setLogLevel(); if (!(new File(System.getProperty(LOG_FILE_CONFIG_SYSTEM_PROPERTY))).exists()) { LoggerFactory.getLogger(GraknEngineConfig.class).error(ErrorMessage.NO_LOG_CONFIG_FILE.getMessage(System.getProperty(LOG_FILE_CONFIG_SYSTEM_PROPERTY))); } else { LOG = LoggerFactory.getLogger(GraknEngineConfig.class); LOG.info(STR + System.getProperty(LOG_FILE_CONFIG_SYSTEM_PROPERTY) + "]"); } }
/** * Check if the JVM argument "-Dlogback.configurationFile" is set. * If it is not set, it sets it to the default one. * It also sets the -Dgrakn.log.file system property equal to the one specified in grakn.properties. * The grakn.log.file property will be used by logback.xml */
Check if the JVM argument "-Dlogback.configurationFile" is set. If it is not set, it sets it to the default one. It also sets the -Dgrakn.log.file system property equal to the one specified in grakn.properties. The grakn.log.file property will be used by logback.xml
initialiseLogger
{ "repo_name": "sklarman/grakn", "path": "grakn-engine/src/main/java/ai/grakn/engine/GraknEngineConfig.java", "license": "gpl-3.0", "size": 10918 }
[ "ai.grakn.util.ErrorMessage", "java.io.File", "org.slf4j.LoggerFactory" ]
import ai.grakn.util.ErrorMessage; import java.io.File; import org.slf4j.LoggerFactory;
import ai.grakn.util.*; import java.io.*; import org.slf4j.*;
[ "ai.grakn.util", "java.io", "org.slf4j" ]
ai.grakn.util; java.io; org.slf4j;
1,873,988
public JSONWriter key(String s) throws JSONException { if (s == null) { throw new JSONException("Null key."); } if (this.mode == 'k') { try { if (this.comma) { this.writer.write(','); } stack[top - 1].putOnce(s, Boolean.TRUE); this.writer.write(JSONObject.quote(s)); this.writer.write(':'); this.comma = false; this.mode = 'o'; return this; } catch (IOException e) { throw new JSONException(e); } } throw new JSONException("Misplaced key."); }
JSONWriter function(String s) throws JSONException { if (s == null) { throw new JSONException(STR); } if (this.mode == 'k') { try { if (this.comma) { this.writer.write(','); } stack[top - 1].putOnce(s, Boolean.TRUE); this.writer.write(JSONObject.quote(s)); this.writer.write(':'); this.comma = false; this.mode = 'o'; return this; } catch (IOException e) { throw new JSONException(e); } } throw new JSONException(STR); }
/** * Append a key. The key will be associated with the next value. In an * object, every value must be preceded by a key. * @param s A key string. * @return this * @throws JSONException If the key is out of place. For example, keys * do not belong in arrays or if the key is null. */
Append a key. The key will be associated with the next value. In an object, every value must be preceded by a key
key
{ "repo_name": "VysakhV/eeplat-social-api", "path": "source/weibo/weibo4j/org/json/JSONWriter.java", "license": "mit", "size": 10325 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,593,484
public void logSummary( StepInterface si ) { log.logBasic( si.getStepname(), BaseMessages.getString( PKG, "Trans.Log.FinishedProcessing", String.valueOf( si .getLinesInput() ), String.valueOf( si.getLinesOutput() ), String.valueOf( si.getLinesRead() ) ) + BaseMessages .getString( PKG, "Trans.Log.FinishedProcessing2", String.valueOf( si.getLinesWritten() ), String.valueOf( si .getLinesUpdated() ), String.valueOf( si.getErrors() ) ) ); }
void function( StepInterface si ) { log.logBasic( si.getStepname(), BaseMessages.getString( PKG, STR, String.valueOf( si .getLinesInput() ), String.valueOf( si.getLinesOutput() ), String.valueOf( si.getLinesRead() ) ) + BaseMessages .getString( PKG, STR, String.valueOf( si.getLinesWritten() ), String.valueOf( si .getLinesUpdated() ), String.valueOf( si.getErrors() ) ) ); }
/** * Logs a summary message for the specified step. * * @param si the step interface */
Logs a summary message for the specified step
logSummary
{ "repo_name": "tmcsantos/pentaho-kettle", "path": "engine/src/main/java/org/pentaho/di/trans/Trans.java", "license": "apache-2.0", "size": 199612 }
[ "org.pentaho.di.i18n.BaseMessages", "org.pentaho.di.trans.step.StepInterface" ]
import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.trans.step.StepInterface;
import org.pentaho.di.i18n.*; import org.pentaho.di.trans.step.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,157,851
public void setHistogramMap( Map<Integer, NumericAttributeBinData> initializedHistData) { m_numericHistogramData = initializedHistData; }
void function( Map<Integer, NumericAttributeBinData> initializedHistData) { m_numericHistogramData = initializedHistData; }
/** * Set a map of initialized numeric histogram data to be updated for each * incoming row/instance * * @param initializedHistData a map of NumericAttributeBinData that has been * initialized. Keyed by attribute index */
Set a map of initialized numeric histogram data to be updated for each incoming row/instance
setHistogramMap
{ "repo_name": "mydzigear/weka.kmeanspp.silhouette_score", "path": "wekafiles/packages/distributedWekaBase/src/main/java/weka/core/stats/QuantileCalculator.java", "license": "gpl-3.0", "size": 6817 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,134,779