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
Map<String, ? extends FeatureMetadatum> getMetadata();
Map<String, ? extends FeatureMetadatum> getMetadata();
/** * Return the list of associated metadata, like age of onset or pace of progression. * * @return an unmodifiable map with the {@link FeatureMetadatum#getType() metadatum type} as the key and the actual * {@link FeatureMetadatum metadatum} as the value, or an empty map if no metadata is recorded */
Return the list of associated metadata, like age of onset or pace of progression
getMetadata
{ "repo_name": "veronikaslc/phenotips", "path": "components/patient-data/api/src/main/java/org/phenotips/data/Feature.java", "license": "agpl-3.0", "size": 3271 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,045,541
void startGlobalSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData, Rect sourceBounds) { ComponentName globalSearchActivity = getGlobalSearchActivity(); if (globalSearchActivity == null) { Log.w(TAG, "No global search activity found."); return; } Intent intent = new Intent(INTENT_ACTION_GLOBAL_SEARCH); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setComponent(globalSearchActivity); // Make sure that we have a Bundle to put source in if (appSearchData == null) { appSearchData = new Bundle(); } else { appSearchData = new Bundle(appSearchData); } // Set source to package name of app that starts global search, if not set already. if (!appSearchData.containsKey("source")) { appSearchData.putString("source", mContext.getPackageName()); } intent.putExtra(APP_DATA, appSearchData); if (!TextUtils.isEmpty(initialQuery)) { intent.putExtra(QUERY, initialQuery); } if (selectInitialQuery) { intent.putExtra(EXTRA_SELECT_QUERY, selectInitialQuery); } intent.setSourceBounds(sourceBounds); try { if (DBG) Log.d(TAG, "Starting global search: " + intent.toUri(0)); mContext.startActivity(intent); } catch (ActivityNotFoundException ex) { Log.e(TAG, "Global search activity not found: " + globalSearchActivity); } }
void startGlobalSearch(String initialQuery, boolean selectInitialQuery, Bundle appSearchData, Rect sourceBounds) { ComponentName globalSearchActivity = getGlobalSearchActivity(); if (globalSearchActivity == null) { Log.w(TAG, STR); return; } Intent intent = new Intent(INTENT_ACTION_GLOBAL_SEARCH); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setComponent(globalSearchActivity); if (appSearchData == null) { appSearchData = new Bundle(); } else { appSearchData = new Bundle(appSearchData); } if (!appSearchData.containsKey(STR)) { appSearchData.putString(STR, mContext.getPackageName()); } intent.putExtra(APP_DATA, appSearchData); if (!TextUtils.isEmpty(initialQuery)) { intent.putExtra(QUERY, initialQuery); } if (selectInitialQuery) { intent.putExtra(EXTRA_SELECT_QUERY, selectInitialQuery); } intent.setSourceBounds(sourceBounds); try { if (DBG) Log.d(TAG, STR + intent.toUri(0)); mContext.startActivity(intent); } catch (ActivityNotFoundException ex) { Log.e(TAG, STR + globalSearchActivity); } }
/** * Starts the global search activity. */
Starts the global search activity
startGlobalSearch
{ "repo_name": "rex-xxx/mt6572_x201", "path": "frameworks/base/core/java/android/app/SearchManager.java", "license": "gpl-2.0", "size": 36646 }
[ "android.content.ActivityNotFoundException", "android.content.ComponentName", "android.content.Intent", "android.graphics.Rect", "android.os.Bundle", "android.text.TextUtils", "android.util.Log" ]
import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Intent; import android.graphics.Rect; import android.os.Bundle; import android.text.TextUtils; import android.util.Log;
import android.content.*; import android.graphics.*; import android.os.*; import android.text.*; import android.util.*;
[ "android.content", "android.graphics", "android.os", "android.text", "android.util" ]
android.content; android.graphics; android.os; android.text; android.util;
2,353,819
@Override @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-09-19T03:10:02-06:00", comment = "JAXB RI v2.2.6") public String toString() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE); }
@Generated(value = STR, date = STR, comment = STR) String function() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE); }
/** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin * */
Generates a String representation of the contents of this type. This is an extension method, produced by the 'ts' xjc plugin
toString
{ "repo_name": "angecab10/travelport-uapi-tutorial", "path": "src/com/travelport/schema/air_v29_0/FlightType.java", "license": "gpl-3.0", "size": 14379 }
[ "javax.annotation.Generated", "org.apache.commons.lang.builder.ToStringBuilder", "org.apache.cxf.xjc.runtime.JAXBToStringStyle" ]
import javax.annotation.Generated; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.cxf.xjc.runtime.JAXBToStringStyle;
import javax.annotation.*; import org.apache.commons.lang.builder.*; import org.apache.cxf.xjc.runtime.*;
[ "javax.annotation", "org.apache.commons", "org.apache.cxf" ]
javax.annotation; org.apache.commons; org.apache.cxf;
1,992,137
@Nullable protected <K, V> V peek(IgniteCache<K, V> cache, K key) { return offheapTiered(cache) ? cache.localPeek(key, CachePeekMode.SWAP, CachePeekMode.OFFHEAP) : cache.localPeek(key, CachePeekMode.ONHEAP); }
@Nullable <K, V> V function(IgniteCache<K, V> cache, K key) { return offheapTiered(cache) ? cache.localPeek(key, CachePeekMode.SWAP, CachePeekMode.OFFHEAP) : cache.localPeek(key, CachePeekMode.ONHEAP); }
/** * Executes regular peek or peek from swap. * * @param cache Cache projection. * @param key Key. * @return Value. */
Executes regular peek or peek from swap
peek
{ "repo_name": "f7753/ignite", "path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java", "license": "apache-2.0", "size": 17457 }
[ "org.apache.ignite.IgniteCache", "org.apache.ignite.cache.CachePeekMode", "org.jetbrains.annotations.Nullable" ]
import org.apache.ignite.IgniteCache; import org.apache.ignite.cache.CachePeekMode; import org.jetbrains.annotations.Nullable;
import org.apache.ignite.*; import org.apache.ignite.cache.*; import org.jetbrains.annotations.*;
[ "org.apache.ignite", "org.jetbrains.annotations" ]
org.apache.ignite; org.jetbrains.annotations;
2,573,411
public ContainerProgram getBuilderProgram() { return _program; }
ContainerProgram function() { return _program; }
/** * Returns the program. */
Returns the program
getBuilderProgram
{ "repo_name": "mdaniel/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/server/dispatch/ServletRegexp.java", "license": "gpl-2.0", "size": 4831 }
[ "com.caucho.config.program.ContainerProgram" ]
import com.caucho.config.program.ContainerProgram;
import com.caucho.config.program.*;
[ "com.caucho.config" ]
com.caucho.config;
1,180,382
private static String[] getFileExtensions(final Decoder decoder) { final Class<? extends Decoder> decoderClass = decoder.getClass(); final FileExtensions fileExtensionsAnnotation = decoderClass.getAnnotation(FileExtensions.class); return (fileExtensionsAnnotation == null) ? new String[]{""} : fileExtensionsAnnotation.value(); }
static String[] function(final Decoder decoder) { final Class<? extends Decoder> decoderClass = decoder.getClass(); final FileExtensions fileExtensionsAnnotation = decoderClass.getAnnotation(FileExtensions.class); return (fileExtensionsAnnotation == null) ? new String[]{""} : fileExtensionsAnnotation.value(); }
/** * Retrieves the file extensions to use with the specified decoder. * <p> * If the specified Decoder doesn't have any file extensions explicitly associated with it, then a single empty string is returned. */
Retrieves the file extensions to use with the specified decoder. If the specified Decoder doesn't have any file extensions explicitly associated with it, then a single empty string is returned
getFileExtensions
{ "repo_name": "CAFapi/caf-common", "path": "config-file/src/main/java/com/hpe/caf/config/file/FileConfigurationSource.java", "license": "apache-2.0", "size": 8913 }
[ "com.hpe.caf.api.Decoder", "com.hpe.caf.api.FileExtensions" ]
import com.hpe.caf.api.Decoder; import com.hpe.caf.api.FileExtensions;
import com.hpe.caf.api.*;
[ "com.hpe.caf" ]
com.hpe.caf;
2,894,279
Collection<ScriptObject> getScripts() { if (scripts == null) return null; return scripts.values(); }
Collection<ScriptObject> getScripts() { if (scripts == null) return null; return scripts.values(); }
/** * Returns the collection of scripts. * * @return See above. */
Returns the collection of scripts
getScripts
{ "repo_name": "dpwrussell/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/EditorModel.java", "license": "gpl-2.0", "size": 130987 }
[ "java.util.Collection", "org.openmicroscopy.shoola.env.data.model.ScriptObject" ]
import java.util.Collection; import org.openmicroscopy.shoola.env.data.model.ScriptObject;
import java.util.*; import org.openmicroscopy.shoola.env.data.model.*;
[ "java.util", "org.openmicroscopy.shoola" ]
java.util; org.openmicroscopy.shoola;
2,735,785
@ServiceMethod(returns = ReturnType.SINGLE) public Response<StorageAccountListKeysResultInner> listKeysWithResponse( String resourceGroupName, String accountName, ListKeyExpand expand, Context context) { return listKeysWithResponseAsync(resourceGroupName, accountName, expand, context).block(); }
@ServiceMethod(returns = ReturnType.SINGLE) Response<StorageAccountListKeysResultInner> function( String resourceGroupName, String accountName, ListKeyExpand expand, Context context) { return listKeysWithResponseAsync(resourceGroupName, accountName, expand, context).block(); }
/** * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names * must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param expand Specifies type of the key to be listed. Possible value is kerb. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response from the ListKeys operation. */
Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account
listKeysWithResponse
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountsClientImpl.java", "license": "mit", "size": 168198 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.storage.fluent.models.StorageAccountListKeysResultInner", "com.azure.resourcemanager.storage.models.ListKeyExpand" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.storage.fluent.models.StorageAccountListKeysResultInner; import com.azure.resourcemanager.storage.models.ListKeyExpand;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.storage.fluent.models.*; import com.azure.resourcemanager.storage.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,805,429
public void testAbstractClassAsRenderer() throws Exception { // 1. Renderers which extend Renderer interface DefDescriptor<RendererDef> descriptor = DefDescriptorImpl.getInstance( "java://org.auraframework.impl.renderer.sampleJavaRenderers.TestAbstractRenderer", RendererDef.class); try { descriptor.getDef(); fail("JavaRenderers that extend Renderer interface cannot be abstract."); } catch (Exception e) { checkExceptionFull(e, InvalidDefinitionException.class, "Cannot instantiate org.auraframework.impl.renderer.sampleJavaRenderers.TestAbstractRenderer", "org.auraframework.impl.renderer.sampleJavaRenderers.TestAbstractRenderer"); } }
void function() throws Exception { DefDescriptor<RendererDef> descriptor = DefDescriptorImpl.getInstance( STRJavaRenderers that extend Renderer interface cannot be abstract.STRCannot instantiate org.auraframework.impl.renderer.sampleJavaRenderers.TestAbstractRendererSTRorg.auraframework.impl.renderer.sampleJavaRenderers.TestAbstractRenderer"); } }
/** * Verify that specifying an absrtact java class as renderer throws an Exception. * * @throws Exception */
Verify that specifying an absrtact java class as renderer throws an Exception
testAbstractClassAsRenderer
{ "repo_name": "lhong375/aura", "path": "aura-impl/src/test/java/org/auraframework/impl/renderer/JavaRendererDefFactoryTest.java", "license": "apache-2.0", "size": 6740 }
[ "org.auraframework.def.DefDescriptor", "org.auraframework.def.Renderer", "org.auraframework.def.RendererDef", "org.auraframework.impl.system.DefDescriptorImpl" ]
import org.auraframework.def.DefDescriptor; import org.auraframework.def.Renderer; import org.auraframework.def.RendererDef; import org.auraframework.impl.system.DefDescriptorImpl;
import org.auraframework.def.*; import org.auraframework.impl.system.*;
[ "org.auraframework.def", "org.auraframework.impl" ]
org.auraframework.def; org.auraframework.impl;
1,262,795
public int countByUserIdGroupId(long userId, long groupId) throws SystemException { Object[] finderArgs = new Object[] { userId, groupId }; Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_USERIDGROUPID, finderArgs, this); if (count == null) { StringBundler query = new StringBundler(3); query.append(_SQL_COUNT_MODULE_WHERE); query.append(_FINDER_COLUMN_USERIDGROUPID_USERID_2); query.append(_FINDER_COLUMN_USERIDGROUPID_GROUPID_2); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(userId); qPos.add(groupId); count = (Long)q.uniqueResult(); } catch (Exception e) { throw processException(e); } finally { if (count == null) { count = Long.valueOf(0); } FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_USERIDGROUPID, finderArgs, count); closeSession(session); } } return count.intValue(); }
int function(long userId, long groupId) throws SystemException { Object[] finderArgs = new Object[] { userId, groupId }; Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_USERIDGROUPID, finderArgs, this); if (count == null) { StringBundler query = new StringBundler(3); query.append(_SQL_COUNT_MODULE_WHERE); query.append(_FINDER_COLUMN_USERIDGROUPID_USERID_2); query.append(_FINDER_COLUMN_USERIDGROUPID_GROUPID_2); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(userId); qPos.add(groupId); count = (Long)q.uniqueResult(); } catch (Exception e) { throw processException(e); } finally { if (count == null) { count = Long.valueOf(0); } FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_USERIDGROUPID, finderArgs, count); closeSession(session); } } return count.intValue(); }
/** * Returns the number of modules where userId = &#63; and groupId = &#63;. * * @param userId the user ID * @param groupId the group ID * @return the number of matching modules * @throws SystemException if a system exception occurred */
Returns the number of modules where userId = &#63; and groupId = &#63;
countByUserIdGroupId
{ "repo_name": "TelefonicaED/liferaylms-portlet", "path": "docroot/WEB-INF/src/com/liferay/lms/service/persistence/ModulePersistenceImpl.java", "license": "agpl-3.0", "size": 125928 }
[ "com.liferay.portal.kernel.dao.orm.FinderCacheUtil", "com.liferay.portal.kernel.dao.orm.Query", "com.liferay.portal.kernel.dao.orm.QueryPos", "com.liferay.portal.kernel.dao.orm.Session", "com.liferay.portal.kernel.exception.SystemException", "com.liferay.portal.kernel.util.StringBundler" ]
import com.liferay.portal.kernel.dao.orm.FinderCacheUtil; import com.liferay.portal.kernel.dao.orm.Query; import com.liferay.portal.kernel.dao.orm.QueryPos; import com.liferay.portal.kernel.dao.orm.Session; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.dao.orm.*; import com.liferay.portal.kernel.exception.*; import com.liferay.portal.kernel.util.*;
[ "com.liferay.portal" ]
com.liferay.portal;
2,212,340
return (new GsonBuilder()).serializeNulls().setPrettyPrinting().excludeFieldsWithoutExposeAnnotation().create(); }
return (new GsonBuilder()).serializeNulls().setPrettyPrinting().excludeFieldsWithoutExposeAnnotation().create(); }
/** * Retrieve an instance of {@link Gson} which has some standard configurations * @return An instance of {@link Gson} */
Retrieve an instance of <code>Gson</code> which has some standard configurations
getGson
{ "repo_name": "InfoSec812/JettyJerseyWeldExample", "path": "src/main/java/com/zanclus/example/entities/AbstractDocument.java", "license": "apache-2.0", "size": 1035 }
[ "com.google.gson.GsonBuilder" ]
import com.google.gson.GsonBuilder;
import com.google.gson.*;
[ "com.google.gson" ]
com.google.gson;
1,741,538
public static void main(final String[] args) { final DrawStringDemo demo = new DrawStringDemo("DrawString Demo"); demo.pack(); RefineryUtilities.centerFrameOnScreen(demo); demo.setVisible(true); }
static void function(final String[] args) { final DrawStringDemo demo = new DrawStringDemo(STR); demo.pack(); RefineryUtilities.centerFrameOnScreen(demo); demo.setVisible(true); }
/** * The starting point for the demo. * * @param args ignored. */
The starting point for the demo
main
{ "repo_name": "apetresc/JCommon", "path": "src/main/java/org/jfree/demo/DrawStringDemo.java", "license": "lgpl-2.1", "size": 11761 }
[ "org.jfree.ui.RefineryUtilities" ]
import org.jfree.ui.RefineryUtilities;
import org.jfree.ui.*;
[ "org.jfree.ui" ]
org.jfree.ui;
2,128,530
private PGPEncryptedDataList getPGPEncryptedDataList(InputStream inputStream) throws IOException { if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) { Security.addProvider(new BouncyCastleProvider()); } inputStream = PGPUtil.getDecoderStream(inputStream); JcaPGPObjectFactory pgpF = new JcaPGPObjectFactory(inputStream); PGPEncryptedDataList enc; Object pgpfObject = pgpF.nextObject(); if (pgpfObject instanceof PGPEncryptedDataList) { enc = (PGPEncryptedDataList) pgpfObject; } else { enc = (PGPEncryptedDataList) pgpF.nextObject(); } return enc; }
PGPEncryptedDataList function(InputStream inputStream) throws IOException { if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) { Security.addProvider(new BouncyCastleProvider()); } inputStream = PGPUtil.getDecoderStream(inputStream); JcaPGPObjectFactory pgpF = new JcaPGPObjectFactory(inputStream); PGPEncryptedDataList enc; Object pgpfObject = pgpF.nextObject(); if (pgpfObject instanceof PGPEncryptedDataList) { enc = (PGPEncryptedDataList) pgpfObject; } else { enc = (PGPEncryptedDataList) pgpF.nextObject(); } return enc; }
/** * Generate a PGPEncryptedDataList from an inputstream * @param inputStream file inputstream that needs to be decrypted * @throws IOException */
Generate a PGPEncryptedDataList from an inputstream
getPGPEncryptedDataList
{ "repo_name": "jinhyukchang/gobblin", "path": "gobblin-modules/gobblin-crypto/src/main/java/org/apache/gobblin/crypto/GPGFileDecryptor.java", "license": "apache-2.0", "size": 7843 }
[ "java.io.IOException", "java.io.InputStream", "java.security.Security", "org.bouncycastle.jce.provider.BouncyCastleProvider", "org.bouncycastle.openpgp.PGPEncryptedDataList", "org.bouncycastle.openpgp.PGPUtil", "org.bouncycastle.openpgp.jcajce.JcaPGPObjectFactory" ]
import java.io.IOException; import java.io.InputStream; import java.security.Security; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.openpgp.PGPEncryptedDataList; import org.bouncycastle.openpgp.PGPUtil; import org.bouncycastle.openpgp.jcajce.JcaPGPObjectFactory;
import java.io.*; import java.security.*; import org.bouncycastle.jce.provider.*; import org.bouncycastle.openpgp.*; import org.bouncycastle.openpgp.jcajce.*;
[ "java.io", "java.security", "org.bouncycastle.jce", "org.bouncycastle.openpgp" ]
java.io; java.security; org.bouncycastle.jce; org.bouncycastle.openpgp;
865,220
@Test public void testSerialization() { XYBlockRenderer r1 = new XYBlockRenderer(); XYBlockRenderer r2 = (XYBlockRenderer) TestUtilities.serialised(r1); assertEquals(r1, r2); }
void function() { XYBlockRenderer r1 = new XYBlockRenderer(); XYBlockRenderer r2 = (XYBlockRenderer) TestUtilities.serialised(r1); assertEquals(r1, r2); }
/** * Serialize an instance, restore it, and check for equality. */
Serialize an instance, restore it, and check for equality
testSerialization
{ "repo_name": "simon04/jfreechart", "path": "src/test/java/org/jfree/chart/renderer/xy/XYBlockRendererTest.java", "license": "lgpl-2.1", "size": 6911 }
[ "org.jfree.chart.TestUtilities", "org.junit.Assert" ]
import org.jfree.chart.TestUtilities; import org.junit.Assert;
import org.jfree.chart.*; import org.junit.*;
[ "org.jfree.chart", "org.junit" ]
org.jfree.chart; org.junit;
1,589,134
public static EditInGoogleDocsPage signInGoogleDocs(WebDrone driver, GoogleDocsAuthorisation googleAuth) throws InterruptedException { int i = 0; GoogleSignUpPage signUpPage = googleAuth.submitAuth().render(); signUpPage.signUp(googleUserName, googlePassword); if (isGoogleDocsV3) { switchToGoogleWindow(driver); } while (!(driver.getCurrentPage() instanceof EditInGoogleDocsPage)) { webDriverWait(driver, 10000); i++; if (i == retrySearchCount) { break; } } return FactorySharePage.resolvePage(driver).render(); }
static EditInGoogleDocsPage function(WebDrone driver, GoogleDocsAuthorisation googleAuth) throws InterruptedException { int i = 0; GoogleSignUpPage signUpPage = googleAuth.submitAuth().render(); signUpPage.signUp(googleUserName, googlePassword); if (isGoogleDocsV3) { switchToGoogleWindow(driver); } while (!(driver.getCurrentPage() instanceof EditInGoogleDocsPage)) { webDriverWait(driver, 10000); i++; if (i == retrySearchCount) { break; } } return FactorySharePage.resolvePage(driver).render(); }
/** * This method provides the sign in page to log into google docs. * * @param googleAuth GoogleDocsAuthorisation * @return EditInGoogleDocsPage */
This method provides the sign in page to log into google docs
signInGoogleDocs
{ "repo_name": "daniel-he/community-edition", "path": "projects/qa-share/src/main/java/org/alfresco/share/util/ShareUserGoogleDocs.java", "license": "lgpl-3.0", "size": 16122 }
[ "org.alfresco.po.share.FactorySharePage", "org.alfresco.po.share.site.document.EditInGoogleDocsPage", "org.alfresco.po.share.site.document.GoogleDocsAuthorisation", "org.alfresco.po.share.site.document.GoogleSignUpPage", "org.alfresco.webdrone.WebDrone" ]
import org.alfresco.po.share.FactorySharePage; import org.alfresco.po.share.site.document.EditInGoogleDocsPage; import org.alfresco.po.share.site.document.GoogleDocsAuthorisation; import org.alfresco.po.share.site.document.GoogleSignUpPage; import org.alfresco.webdrone.WebDrone;
import org.alfresco.po.share.*; import org.alfresco.po.share.site.document.*; import org.alfresco.webdrone.*;
[ "org.alfresco.po", "org.alfresco.webdrone" ]
org.alfresco.po; org.alfresco.webdrone;
270,676
public Object getObjectInstance(Object refObj, Name name, Context context, Hashtable env) throws IOException, ClassNotFoundException { // The spec says to return null if we can't create an instance // of the reference Object obj = null; if (refObj instanceof Reference) { Reference ref = (Reference) refObj; if (isCorrectClass(ref.getClassName())) { RefAddr ra = ref.get("instanceKey"); if (ra != null && ra.getContent() != null) { // object was bound to jndi via Referenceable api. obj = instanceMap.get(ra.getContent()); } else { // tomcat jndi creates a Reference out of server.xml // <ResourceParam> configuration and passes it to an // instance of the factory given in server.xml. String key = null; if (name != null) { key = name.toString(); obj = instanceMap.get(key); } if (obj == null) { InstanceKeyDataSource ds = getNewInstance(ref); setCommonProperties(ref, ds); obj = ds; if (key != null) { instanceMap.put(key, ds); } } } } } return obj; }
Object function(Object refObj, Name name, Context context, Hashtable env) throws IOException, ClassNotFoundException { Object obj = null; if (refObj instanceof Reference) { Reference ref = (Reference) refObj; if (isCorrectClass(ref.getClassName())) { RefAddr ra = ref.get(STR); if (ra != null && ra.getContent() != null) { obj = instanceMap.get(ra.getContent()); } else { String key = null; if (name != null) { key = name.toString(); obj = instanceMap.get(key); } if (obj == null) { InstanceKeyDataSource ds = getNewInstance(ref); setCommonProperties(ref, ds); obj = ds; if (key != null) { instanceMap.put(key, ds); } } } } } return obj; }
/** * implements ObjectFactory to create an instance of SharedPoolDataSource * or PerUserPoolDataSource */
implements ObjectFactory to create an instance of SharedPoolDataSource or PerUserPoolDataSource
getObjectInstance
{ "repo_name": "xiaolds/tomcat7", "path": "tomcat-build-libs/tomcat7-deps/dbcp/src/java/org/apache/tomcat/dbcp/dbcp/datasources/InstanceKeyObjectFactory.java", "license": "apache-2.0", "size": 8600 }
[ "java.io.IOException", "java.util.Hashtable", "javax.naming.Context", "javax.naming.Name", "javax.naming.RefAddr", "javax.naming.Reference" ]
import java.io.IOException; import java.util.Hashtable; import javax.naming.Context; import javax.naming.Name; import javax.naming.RefAddr; import javax.naming.Reference;
import java.io.*; import java.util.*; import javax.naming.*;
[ "java.io", "java.util", "javax.naming" ]
java.io; java.util; javax.naming;
1,064,498
private List<RMNode> filterOut(List<RMNode> freeNodes, Criteria criteria, Client client) { NodeSet exclusion = criteria.getBlackList(); Set<String> inclusion = criteria.getAcceptableNodesUrls(); boolean nodeWithTokenRequested = criteria.getNodeAccessToken() != null && criteria.getNodeAccessToken().length() > 0; TokenPrincipal tokenPrincipal = null; if (nodeWithTokenRequested) { logger.debug("Node access token specified " + criteria.getNodeAccessToken()); tokenPrincipal = new TokenPrincipal(criteria.getNodeAccessToken()); client.getSubject().getPrincipals().add(tokenPrincipal); } List<RMNode> filteredList = new ArrayList<>(); HashSet<Permission> clientPermissions = new HashSet<>(); for (RMNode node : freeNodes) { // checking the permission try { if (!clientPermissions.contains(node.getUserPermission())) { client.checkPermission(node.getUserPermission(), client + " is not authorized to get the node " + node.getNodeURL() + " from " + node.getNodeSource().getName()); clientPermissions.add(node.getUserPermission()); } } catch (SecurityException e) { // client does not have an access to this node logger.debug(e.getMessage()); continue; } // if the node access token is specified we filtered out all nodes // with other tokens but must also filter out nodes without tokens if (nodeWithTokenRequested && !node.isProtectedByToken()) { continue; } // if client has AllPermissions he still can get a node with any token // we will avoid it here if (nodeWithTokenRequested) { PrincipalPermission perm = (PrincipalPermission) node.getUserPermission(); // checking explicitly that node has this token identity if (!perm.hasPrincipal(tokenPrincipal)) { if (logger.isDebugEnabled()) { logger.debug(client + " does not have required token to get the node " + node.getNodeURL() + " from " + node.getNodeSource().getName()); } continue; } } if (!contains(exclusion, node) && ((inclusion != null) ? inclusion.contains(node.getNodeURL()) : true)) { filteredList.add(node); } } return filteredList; }
List<RMNode> function(List<RMNode> freeNodes, Criteria criteria, Client client) { NodeSet exclusion = criteria.getBlackList(); Set<String> inclusion = criteria.getAcceptableNodesUrls(); boolean nodeWithTokenRequested = criteria.getNodeAccessToken() != null && criteria.getNodeAccessToken().length() > 0; TokenPrincipal tokenPrincipal = null; if (nodeWithTokenRequested) { logger.debug(STR + criteria.getNodeAccessToken()); tokenPrincipal = new TokenPrincipal(criteria.getNodeAccessToken()); client.getSubject().getPrincipals().add(tokenPrincipal); } List<RMNode> filteredList = new ArrayList<>(); HashSet<Permission> clientPermissions = new HashSet<>(); for (RMNode node : freeNodes) { try { if (!clientPermissions.contains(node.getUserPermission())) { client.checkPermission(node.getUserPermission(), client + STR + node.getNodeURL() + STR + node.getNodeSource().getName()); clientPermissions.add(node.getUserPermission()); } } catch (SecurityException e) { logger.debug(e.getMessage()); continue; } if (nodeWithTokenRequested && !node.isProtectedByToken()) { continue; } if (nodeWithTokenRequested) { PrincipalPermission perm = (PrincipalPermission) node.getUserPermission(); if (!perm.hasPrincipal(tokenPrincipal)) { if (logger.isDebugEnabled()) { logger.debug(client + STR + node.getNodeURL() + STR + node.getNodeSource().getName()); } continue; } } if (!contains(exclusion, node) && ((inclusion != null) ? inclusion.contains(node.getNodeURL()) : true)) { filteredList.add(node); } } return filteredList; }
/** * Removes exclusion nodes and nodes not accessible for the client */
Removes exclusion nodes and nodes not accessible for the client
filterOut
{ "repo_name": "laurianed/scheduling", "path": "rm/rm-server/src/main/java/org/ow2/proactive/resourcemanager/selection/SelectionManager.java", "license": "agpl-3.0", "size": 27373 }
[ "java.security.Permission", "java.util.ArrayList", "java.util.HashSet", "java.util.List", "java.util.Set", "org.ow2.proactive.authentication.principals.TokenPrincipal", "org.ow2.proactive.permissions.PrincipalPermission", "org.ow2.proactive.resourcemanager.authentication.Client", "org.ow2.proactive.resourcemanager.rmnode.RMNode", "org.ow2.proactive.utils.Criteria", "org.ow2.proactive.utils.NodeSet" ]
import java.security.Permission; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.ow2.proactive.authentication.principals.TokenPrincipal; import org.ow2.proactive.permissions.PrincipalPermission; import org.ow2.proactive.resourcemanager.authentication.Client; import org.ow2.proactive.resourcemanager.rmnode.RMNode; import org.ow2.proactive.utils.Criteria; import org.ow2.proactive.utils.NodeSet;
import java.security.*; import java.util.*; import org.ow2.proactive.authentication.principals.*; import org.ow2.proactive.permissions.*; import org.ow2.proactive.resourcemanager.authentication.*; import org.ow2.proactive.resourcemanager.rmnode.*; import org.ow2.proactive.utils.*;
[ "java.security", "java.util", "org.ow2.proactive" ]
java.security; java.util; org.ow2.proactive;
2,103,771
public long getValue(BytesWritable value) throws IOException { DataInputStream dis = getValueStream(); int size = 0; try { int remain; while ((remain = valueBufferInputStream.getRemain()) > 0) { value.setSize(size + remain); dis.readFully(value.get(), size, remain); size += remain; } return value.getSize(); } finally { dis.close(); } }
long function(BytesWritable value) throws IOException { DataInputStream dis = getValueStream(); int size = 0; try { int remain; while ((remain = valueBufferInputStream.getRemain()) > 0) { value.setSize(size + remain); dis.readFully(value.get(), size, remain); size += remain; } return value.getSize(); } finally { dis.close(); } }
/** * Copy the value into BytesWritable. The input BytesWritable will be * automatically resized to the actual value size. The implementation * directly uses the buffer inside BytesWritable for storing the value. * The call does not require the value length to be known. * * @param value * @throws IOException */
Copy the value into BytesWritable. The input BytesWritable will be automatically resized to the actual value size. The implementation directly uses the buffer inside BytesWritable for storing the value. The call does not require the value length to be known
getValue
{ "repo_name": "koichi626/hadoop-gpu", "path": "hadoop-gpu-0.20.1/src/core/org/apache/hadoop/io/file/tfile/TFile.java", "license": "apache-2.0", "size": 74043 }
[ "java.io.DataInputStream", "java.io.IOException", "org.apache.hadoop.io.BytesWritable" ]
import java.io.DataInputStream; import java.io.IOException; import org.apache.hadoop.io.BytesWritable;
import java.io.*; import org.apache.hadoop.io.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
179,442
public void splitFromConference(String callId) { try { mAdapter.splitFromConference(callId); } catch (RemoteException ignored) { } }
void function(String callId) { try { mAdapter.splitFromConference(callId); } catch (RemoteException ignored) { } }
/** * Instructs Telecom to split the specified call from any conference call with which it may be * connected. * * @param callId The unique ID of the call. * @hide */
Instructs Telecom to split the specified call from any conference call with which it may be connected
splitFromConference
{ "repo_name": "Ant-Droid/android_frameworks_base_OLD", "path": "telecomm/java/android/telecom/InCallAdapter.java", "license": "apache-2.0", "size": 9224 }
[ "android.os.RemoteException" ]
import android.os.RemoteException;
import android.os.*;
[ "android.os" ]
android.os;
1,941,281
public Object getSingleData(Class<?> type) { // Ensure that the stream contains a single document and construct it Node node = composer.getSingleNode(); if (node != null) { if (Object.class != type) { node.setTag(new Tag(type)); } else if (rootTag != null) { node.setTag(rootTag); } return constructDocument(node); } return null; }
Object function(Class<?> type) { Node node = composer.getSingleNode(); if (node != null) { if (Object.class != type) { node.setTag(new Tag(type)); } else if (rootTag != null) { node.setTag(rootTag); } return constructDocument(node); } return null; }
/** * Ensure that the stream contains a single document and construct it * * @return constructed instance * @throws ComposerException * in case there are more documents in the stream */
Ensure that the stream contains a single document and construct it
getSingleData
{ "repo_name": "lsst-camera-dh/snakeyaml", "path": "src/main/java/org/yaml/snakeyaml/constructor/BaseConstructor.java", "license": "apache-2.0", "size": 16906 }
[ "org.yaml.snakeyaml.nodes.Node", "org.yaml.snakeyaml.nodes.Tag" ]
import org.yaml.snakeyaml.nodes.Node; import org.yaml.snakeyaml.nodes.Tag;
import org.yaml.snakeyaml.nodes.*;
[ "org.yaml.snakeyaml" ]
org.yaml.snakeyaml;
1,304,108
public ListSetsType listSets() throws IOException, JAXBException, OAIException { String query = builder.buildListSetsQuery(); return unMarshal(query).getListSets(); }
ListSetsType function() throws IOException, JAXBException, OAIException { String query = builder.buildListSetsQuery(); return unMarshal(query).getListSets(); }
/** * List all sets the OAI-PMH server has. * @return a list of sets * @throws JAXBException * @throws OAIException */
List all sets the OAI-PMH server has
listSets
{ "repo_name": "beeldengeluid/zieook", "path": "backend/zieook-backend/zieook-inx/zieook-oaipmh/src/main/java/nl/gridline/zieook/Harvester.java", "license": "apache-2.0", "size": 13771 }
[ "java.io.IOException", "javax.xml.bind.JAXBException", "org.openarchives.oai._2.ListSetsType" ]
import java.io.IOException; import javax.xml.bind.JAXBException; import org.openarchives.oai._2.ListSetsType;
import java.io.*; import javax.xml.bind.*; import org.openarchives.oai.*;
[ "java.io", "javax.xml", "org.openarchives.oai" ]
java.io; javax.xml; org.openarchives.oai;
1,785,983
public static void initScriptEngines(RexsterProperties properties) { final List<EngineConfiguration> configuredScriptEngines = new ArrayList<>(); final List<HierarchicalConfiguration> configs = properties.getScriptEngines(); for (HierarchicalConfiguration config : configs) { configuredScriptEngines.add(new EngineConfiguration(config)); } EngineController.configure(configuredScriptEngines); }
static void function(RexsterProperties properties) { final List<EngineConfiguration> configuredScriptEngines = new ArrayList<>(); final List<HierarchicalConfiguration> configs = properties.getScriptEngines(); for (HierarchicalConfiguration config : configs) { configuredScriptEngines.add(new EngineConfiguration(config)); } EngineController.configure(configuredScriptEngines); }
/** * When we don't start rexster as the standalone app, groovy (or other script engines) don't get initialized. Pass * {@link com.tinkerpop.rexster.server.RexsterProperties} here to configure script engines in those properties. * * @param properties Rexster properties containing script engines to configure */
When we don't start rexster as the standalone app, groovy (or other script engines) don't get initialized. Pass <code>com.tinkerpop.rexster.server.RexsterProperties</code> here to configure script engines in those properties
initScriptEngines
{ "repo_name": "b-long/ezbake-data-access", "path": "ezgraph/rexster-server/src/test/java/ezbake/data/graph/rexster/RexsterTestUtils.java", "license": "apache-2.0", "size": 8578 }
[ "com.tinkerpop.rexster.protocol.EngineConfiguration", "com.tinkerpop.rexster.protocol.EngineController", "com.tinkerpop.rexster.server.RexsterProperties", "java.util.ArrayList", "java.util.List", "org.apache.commons.configuration.HierarchicalConfiguration" ]
import com.tinkerpop.rexster.protocol.EngineConfiguration; import com.tinkerpop.rexster.protocol.EngineController; import com.tinkerpop.rexster.server.RexsterProperties; import java.util.ArrayList; import java.util.List; import org.apache.commons.configuration.HierarchicalConfiguration;
import com.tinkerpop.rexster.protocol.*; import com.tinkerpop.rexster.server.*; import java.util.*; import org.apache.commons.configuration.*;
[ "com.tinkerpop.rexster", "java.util", "org.apache.commons" ]
com.tinkerpop.rexster; java.util; org.apache.commons;
212,659
public void testUnmappedMetricWithIgnoreMalformed() throws Exception { DocumentMapper mapper = createDocumentMapper( fieldMapping( b -> b.field("type", CONTENT_TYPE) .field(METRICS_FIELD, new String[] { "min", "max" }) .field("ignore_malformed", true) .field(DEFAULT_METRIC, "max") ) ); ParsedDocument doc = mapper.parse( source(b -> b.startObject("field").field("min", -10.1).field("max", 50.0).field("sum", 55).endObject()) ); assertNull(doc.rootDoc().getField("metric.min")); }
void function() throws Exception { DocumentMapper mapper = createDocumentMapper( fieldMapping( b -> b.field("type", CONTENT_TYPE) .field(METRICS_FIELD, new String[] { "min", "max" }) .field(STR, true) .field(DEFAULT_METRIC, "max") ) ); ParsedDocument doc = mapper.parse( source(b -> b.startObject("field").field("min", -10.1).field("max", 50.0).field("sum", 55).endObject()) ); assertNull(doc.rootDoc().getField(STR)); }
/** * Test inserting a document containing a metric that has not been defined in the field mapping. * Field will be ignored because config ignore_malformed has been set. */
Test inserting a document containing a metric that has not been defined in the field mapping. Field will be ignored because config ignore_malformed has been set
testUnmappedMetricWithIgnoreMalformed
{ "repo_name": "robin13/elasticsearch", "path": "x-pack/plugin/mapper-aggregate-metric/src/test/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapperTests.java", "license": "apache-2.0", "size": 23370 }
[ "org.elasticsearch.index.mapper.DocumentMapper", "org.elasticsearch.index.mapper.ParsedDocument" ]
import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.ParsedDocument;
import org.elasticsearch.index.mapper.*;
[ "org.elasticsearch.index" ]
org.elasticsearch.index;
2,085,320
public Node getAstNode() { return astNode; }
Node function() { return astNode; }
/** * Returns the underlying AST node for the function. This usually * has type Token.FUNCTION but in the case of the "main" function * will have type Token.BLOCK. */
Returns the underlying AST node for the function. This usually has type Token.FUNCTION but in the case of the "main" function will have type Token.BLOCK
getAstNode
{ "repo_name": "jhiswin/idiil-closure-compiler", "path": "src/com/google/javascript/jscomp/CallGraph.java", "license": "apache-2.0", "size": 23914 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
2,510,289
@Override public void focusLost(FocusEvent e) { if (!this.immediateUpdate) this.applyChanges(); }
void function(FocusEvent e) { if (!this.immediateUpdate) this.applyChanges(); }
/** Invoked when a component loses the keyboard focus. * */
Invoked when a component loses the keyboard focus
focusLost
{ "repo_name": "Taller/sqlworkbench-plus", "path": "src/workbench/gui/components/PasswordPropertyEditor.java", "license": "apache-2.0", "size": 4003 }
[ "java.awt.event.FocusEvent" ]
import java.awt.event.FocusEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
1,101,085
private void processReadRequest(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType responseFormat) throws ODataApplicationException { Object currentWorkingEntity = null; EdmEntityType currentEdmEntityType = null; EdmEntitySet currentEdmEntitySet = null; Collection currentReadCollection = null; List<UriResource> resourcePaths = uriInfo.getUriResourceParts(); CountOption countOption = uriInfo.getCountOption(); // These system query options may affect how collections of entities are returned from business methods. TopOption topOption = uriInfo.getTopOption(); SkipOption skipOption = uriInfo.getSkipOption(); SelectOption selectOption = uriInfo.getSelectOption(); OrderByOption orderingOption = uriInfo.getOrderByOption(); // Expand entities ExpandOption expandOption = uriInfo.getExpandOption(); // Filtering FilterOption filtering = uriInfo.getFilterOption(); int lastIndex = resourcePaths.size()-1; for(int uriIndex = 0; uriIndex < resourcePaths.size(); uriIndex++) { UriResource currentResourcePart = resourcePaths.get(uriIndex); //System.out.println("Processing part "+uriIndex+" of "+lastIndex); // If the resourcePart is an UriResourceEntitySet, we are working on a EntitySet or an Entity directly, // i.e we are not navigating across entities (Products(1)->Category->Products() if(currentResourcePart instanceof UriResourceEntitySet) { UriResourceEntitySet uriEntitySet = (UriResourceEntitySet) currentResourcePart; EdmEntitySet edmEntitySet = uriEntitySet.getEntitySet(); EdmEntityType edmEntityType = edmEntitySet.getEntityType(); Object businessService = instantiateDataService(edmEntityType); Class businessServiceClass = detectDataServiceClass(edmEntitySet.getEntityType()); Class workEntityClass = edmProvider.findActualClass(edmEntityType.getFullQualifiedName()); List<ODataParameter> keys = getKeyPredicates(uriInfo,workEntityClass); addSystemQueryOptions(keys,countOption, topOption, skipOption, orderingOption, filtering); // Is it a collection.... if(uriEntitySet.isCollection()) { EntityCollection entitySet = new EntityCollection(); currentReadCollection = (Collection<Object>) invokeMethod(businessService,businessServiceClass, workEntityClass, ODataReadEntityCollection.class, keys); currentEdmEntitySet = edmEntitySet; currentEdmEntityType = edmEntityType; // If we reached the last segment, we send to the client the read collection serialized. if(uriIndex == lastIndex) { for(Object localEntity : currentReadCollection) { Entity currentEntity = oDataHelper.buildEntity(localEntity); if(expandOption != null) { applyExpansion(currentEdmEntitySet, currentEntity,localEntity, expandOption); } entitySet.getEntities().add(currentEntity); } if(countOption != null && countOption.getValue()) { entitySet.setCount(currentReadCollection.size()); } serializeCollection(request, response, responseFormat, edmEntitySet, entitySet, countOption, selectOption,expandOption, filtering); return; } } // ... or a single entity ? else { currentEdmEntitySet = edmEntitySet; currentEdmEntityType = edmEntityType; currentWorkingEntity = invokeMethod(businessService, businessServiceClass, workEntityClass, ODataReadEntity.class,keys); // If we reached the last segment, we send to the client the serialized entity. if(uriIndex == lastIndex) { Entity actualODataEntity = oDataHelper.buildEntity(currentWorkingEntity); if(expandOption != null) { applyExpansion(currentEdmEntitySet, actualODataEntity,currentWorkingEntity, expandOption); } serializeEntity(response, responseFormat, edmEntitySet, edmEntityType, actualODataEntity,selectOption,expandOption, filtering); } } } if(currentResourcePart instanceof UriResourceNavigation) { UriResourceNavigation uriEntityNavigation = (UriResourceNavigation) currentResourcePart; EdmEntityType edmEntityType = uriEntityNavigation.getProperty().getType(); Object businessService = instantiateDataService(edmEntityType); Class businessServiceClass = detectDataServiceClass(edmEntityType); List<ODataParameter> params = getParametersForNavigation(uriEntityNavigation); addSystemQueryOptions(params,countOption, topOption, skipOption,orderingOption,filtering); if(currentWorkingEntity == null) { throw createException("Required navigation for a NULL Object", HttpStatusCode.INTERNAL_SERVER_ERROR); } // We are navigating from an entity to a collection (relation: one to many). // In our example is http://localhost:8080/DataService/ProductStore/Categories(1)/Products. // if(uriEntityNavigation.isCollection()) { String name = uriEntityNavigation.getProperty().getName(); EdmBindingTarget edmBindingTarget = currentEdmEntitySet.getRelatedBindingTarget(uriEntityNavigation.getProperty().getName()); Class targetEntityClass = edmProvider.findActualClass(edmEntityType.getFullQualifiedName()); String relatedEntitySetName = oDataHelper.getEntitySetName(targetEntityClass); EdmEntitySet edmEntitySet = edmBindingTarget.getEntityContainer().getEntitySet(relatedEntitySetName); currentReadCollection = (Collection) invokeNavigationMethod(businessService,businessServiceClass, currentWorkingEntity.getClass(), targetEntityClass, ODataNavigation.class, currentWorkingEntity,params); currentEdmEntitySet = edmEntitySet; currentEdmEntityType = edmEntityType; // If the query returns a single object, I treat it as an entity request. if(uriIndex == lastIndex) { if(currentReadCollection.size() == 1) { currentWorkingEntity = currentReadCollection.iterator().next(); Entity actualODataEntity = oDataHelper.buildEntity(currentWorkingEntity); if(expandOption != null) { applyExpansion(currentEdmEntitySet, actualODataEntity,currentWorkingEntity, expandOption); } serializeEntity(response, responseFormat, edmEntitySet, edmEntityType, actualODataEntity,selectOption,expandOption,filtering); } else { EntityCollection entityCollection = new EntityCollection(); for(Object localEntity : currentReadCollection) { Entity currentEntity = oDataHelper.buildEntity(localEntity); if(expandOption != null) { applyExpansion(currentEdmEntitySet, currentEntity,localEntity, expandOption); } entityCollection.getEntities().add(currentEntity); } if(countOption != null && countOption.getValue()) { entityCollection.setCount(currentReadCollection.size()); } serializeCollection(request, response, responseFormat, currentEdmEntitySet, entityCollection, countOption,selectOption,expandOption,filtering); } } } else { // We are navigating from an Entity to a RelatedEntity. // This may be the case of a one-to-one relationship as well as a one-to-many relationship where a single item is returned; // it's the case for example of uri In our example is http://localhost:8080/DataService/ProductStore/Categories(1)/Products(1) // Generally speaking, the method for handling a one-to-many relationship is annotated with @ODataNavigation and returns a collection. // To handle properly further navigations (i.e In our example is http://localhost:8080/DataService/ProductStore/Categories(1)/Products(1)/Category) // if the returned collection contains a single element, we set the currentWorkingEntity reference to the only one item in the collection // and we serialize a single entity (not the whole collection). EdmBindingTarget edmBindingTarget = currentEdmEntitySet.getRelatedBindingTarget(uriEntityNavigation.getProperty().getName()); Class targetEntityClass = edmProvider.findActualClass(edmEntityType.getFullQualifiedName()); String relatedEntitySetName = oDataHelper.getEntitySetName(targetEntityClass); EdmEntitySet edmEntitySet = edmBindingTarget.getEntityContainer().getEntitySet(relatedEntitySetName); Object result = invokeNavigationMethod(businessService, businessServiceClass,currentWorkingEntity.getClass(), targetEntityClass, ODataNavigation.class, currentWorkingEntity,params); if(result instanceof Collection) { Collection readCollection = (Collection) result; if(readCollection.size() == 1) { currentWorkingEntity = readCollection.iterator().next(); } if(readCollection.isEmpty()) { throw createException("No data found with required parameters.", HttpStatusCode.NOT_FOUND); } } else { currentWorkingEntity = result; } currentEdmEntitySet = edmEntitySet; currentEdmEntityType = edmEntityType; if(uriIndex == lastIndex) { Entity actualODataEntity = oDataHelper.buildEntity(currentWorkingEntity); if(expandOption != null && currentWorkingEntity != null) { applyExpansion(currentEdmEntitySet, actualODataEntity,currentWorkingEntity, expandOption); } serializeEntity(response, responseFormat, edmEntitySet, edmEntityType, actualODataEntity,selectOption,expandOption,filtering); } } } } }
void function(ODataRequest request, ODataResponse response, UriInfo uriInfo, ContentType responseFormat) throws ODataApplicationException { Object currentWorkingEntity = null; EdmEntityType currentEdmEntityType = null; EdmEntitySet currentEdmEntitySet = null; Collection currentReadCollection = null; List<UriResource> resourcePaths = uriInfo.getUriResourceParts(); CountOption countOption = uriInfo.getCountOption(); TopOption topOption = uriInfo.getTopOption(); SkipOption skipOption = uriInfo.getSkipOption(); SelectOption selectOption = uriInfo.getSelectOption(); OrderByOption orderingOption = uriInfo.getOrderByOption(); ExpandOption expandOption = uriInfo.getExpandOption(); FilterOption filtering = uriInfo.getFilterOption(); int lastIndex = resourcePaths.size()-1; for(int uriIndex = 0; uriIndex < resourcePaths.size(); uriIndex++) { UriResource currentResourcePart = resourcePaths.get(uriIndex); if(currentResourcePart instanceof UriResourceEntitySet) { UriResourceEntitySet uriEntitySet = (UriResourceEntitySet) currentResourcePart; EdmEntitySet edmEntitySet = uriEntitySet.getEntitySet(); EdmEntityType edmEntityType = edmEntitySet.getEntityType(); Object businessService = instantiateDataService(edmEntityType); Class businessServiceClass = detectDataServiceClass(edmEntitySet.getEntityType()); Class workEntityClass = edmProvider.findActualClass(edmEntityType.getFullQualifiedName()); List<ODataParameter> keys = getKeyPredicates(uriInfo,workEntityClass); addSystemQueryOptions(keys,countOption, topOption, skipOption, orderingOption, filtering); if(uriEntitySet.isCollection()) { EntityCollection entitySet = new EntityCollection(); currentReadCollection = (Collection<Object>) invokeMethod(businessService,businessServiceClass, workEntityClass, ODataReadEntityCollection.class, keys); currentEdmEntitySet = edmEntitySet; currentEdmEntityType = edmEntityType; if(uriIndex == lastIndex) { for(Object localEntity : currentReadCollection) { Entity currentEntity = oDataHelper.buildEntity(localEntity); if(expandOption != null) { applyExpansion(currentEdmEntitySet, currentEntity,localEntity, expandOption); } entitySet.getEntities().add(currentEntity); } if(countOption != null && countOption.getValue()) { entitySet.setCount(currentReadCollection.size()); } serializeCollection(request, response, responseFormat, edmEntitySet, entitySet, countOption, selectOption,expandOption, filtering); return; } } else { currentEdmEntitySet = edmEntitySet; currentEdmEntityType = edmEntityType; currentWorkingEntity = invokeMethod(businessService, businessServiceClass, workEntityClass, ODataReadEntity.class,keys); if(uriIndex == lastIndex) { Entity actualODataEntity = oDataHelper.buildEntity(currentWorkingEntity); if(expandOption != null) { applyExpansion(currentEdmEntitySet, actualODataEntity,currentWorkingEntity, expandOption); } serializeEntity(response, responseFormat, edmEntitySet, edmEntityType, actualODataEntity,selectOption,expandOption, filtering); } } } if(currentResourcePart instanceof UriResourceNavigation) { UriResourceNavigation uriEntityNavigation = (UriResourceNavigation) currentResourcePart; EdmEntityType edmEntityType = uriEntityNavigation.getProperty().getType(); Object businessService = instantiateDataService(edmEntityType); Class businessServiceClass = detectDataServiceClass(edmEntityType); List<ODataParameter> params = getParametersForNavigation(uriEntityNavigation); addSystemQueryOptions(params,countOption, topOption, skipOption,orderingOption,filtering); if(currentWorkingEntity == null) { throw createException(STR, HttpStatusCode.INTERNAL_SERVER_ERROR); } if(uriEntityNavigation.isCollection()) { String name = uriEntityNavigation.getProperty().getName(); EdmBindingTarget edmBindingTarget = currentEdmEntitySet.getRelatedBindingTarget(uriEntityNavigation.getProperty().getName()); Class targetEntityClass = edmProvider.findActualClass(edmEntityType.getFullQualifiedName()); String relatedEntitySetName = oDataHelper.getEntitySetName(targetEntityClass); EdmEntitySet edmEntitySet = edmBindingTarget.getEntityContainer().getEntitySet(relatedEntitySetName); currentReadCollection = (Collection) invokeNavigationMethod(businessService,businessServiceClass, currentWorkingEntity.getClass(), targetEntityClass, ODataNavigation.class, currentWorkingEntity,params); currentEdmEntitySet = edmEntitySet; currentEdmEntityType = edmEntityType; if(uriIndex == lastIndex) { if(currentReadCollection.size() == 1) { currentWorkingEntity = currentReadCollection.iterator().next(); Entity actualODataEntity = oDataHelper.buildEntity(currentWorkingEntity); if(expandOption != null) { applyExpansion(currentEdmEntitySet, actualODataEntity,currentWorkingEntity, expandOption); } serializeEntity(response, responseFormat, edmEntitySet, edmEntityType, actualODataEntity,selectOption,expandOption,filtering); } else { EntityCollection entityCollection = new EntityCollection(); for(Object localEntity : currentReadCollection) { Entity currentEntity = oDataHelper.buildEntity(localEntity); if(expandOption != null) { applyExpansion(currentEdmEntitySet, currentEntity,localEntity, expandOption); } entityCollection.getEntities().add(currentEntity); } if(countOption != null && countOption.getValue()) { entityCollection.setCount(currentReadCollection.size()); } serializeCollection(request, response, responseFormat, currentEdmEntitySet, entityCollection, countOption,selectOption,expandOption,filtering); } } } else { EdmBindingTarget edmBindingTarget = currentEdmEntitySet.getRelatedBindingTarget(uriEntityNavigation.getProperty().getName()); Class targetEntityClass = edmProvider.findActualClass(edmEntityType.getFullQualifiedName()); String relatedEntitySetName = oDataHelper.getEntitySetName(targetEntityClass); EdmEntitySet edmEntitySet = edmBindingTarget.getEntityContainer().getEntitySet(relatedEntitySetName); Object result = invokeNavigationMethod(businessService, businessServiceClass,currentWorkingEntity.getClass(), targetEntityClass, ODataNavigation.class, currentWorkingEntity,params); if(result instanceof Collection) { Collection readCollection = (Collection) result; if(readCollection.size() == 1) { currentWorkingEntity = readCollection.iterator().next(); } if(readCollection.isEmpty()) { throw createException(STR, HttpStatusCode.NOT_FOUND); } } else { currentWorkingEntity = result; } currentEdmEntitySet = edmEntitySet; currentEdmEntityType = edmEntityType; if(uriIndex == lastIndex) { Entity actualODataEntity = oDataHelper.buildEntity(currentWorkingEntity); if(expandOption != null && currentWorkingEntity != null) { applyExpansion(currentEdmEntitySet, actualODataEntity,currentWorkingEntity, expandOption); } serializeEntity(response, responseFormat, edmEntitySet, edmEntityType, actualODataEntity,selectOption,expandOption,filtering); } } } } }
/**** * Processes a generic read request. * */
Processes a generic read request
processReadRequest
{ "repo_name": "mclaudio76/odata4-service-framework", "path": "src/main/java/odata4fx/core/ODataServiceHandler.java", "license": "apache-2.0", "size": 36654 }
[ "java.util.Collection", "java.util.List", "org.apache.olingo.commons.api.data.Entity", "org.apache.olingo.commons.api.data.EntityCollection", "org.apache.olingo.commons.api.edm.EdmBindingTarget", "org.apache.olingo.commons.api.edm.EdmEntitySet", "org.apache.olingo.commons.api.edm.EdmEntityType", "org.apache.olingo.commons.api.format.ContentType", "org.apache.olingo.commons.api.http.HttpStatusCode", "org.apache.olingo.server.api.ODataApplicationException", "org.apache.olingo.server.api.ODataRequest", "org.apache.olingo.server.api.ODataResponse", "org.apache.olingo.server.api.uri.UriInfo", "org.apache.olingo.server.api.uri.UriResource", "org.apache.olingo.server.api.uri.UriResourceEntitySet", "org.apache.olingo.server.api.uri.UriResourceNavigation", "org.apache.olingo.server.api.uri.queryoption.CountOption", "org.apache.olingo.server.api.uri.queryoption.ExpandOption", "org.apache.olingo.server.api.uri.queryoption.FilterOption", "org.apache.olingo.server.api.uri.queryoption.OrderByOption", "org.apache.olingo.server.api.uri.queryoption.SelectOption", "org.apache.olingo.server.api.uri.queryoption.SkipOption", "org.apache.olingo.server.api.uri.queryoption.TopOption" ]
import java.util.Collection; import java.util.List; import org.apache.olingo.commons.api.data.Entity; import org.apache.olingo.commons.api.data.EntityCollection; import org.apache.olingo.commons.api.edm.EdmBindingTarget; import org.apache.olingo.commons.api.edm.EdmEntitySet; import org.apache.olingo.commons.api.edm.EdmEntityType; import org.apache.olingo.commons.api.format.ContentType; import org.apache.olingo.commons.api.http.HttpStatusCode; import org.apache.olingo.server.api.ODataApplicationException; import org.apache.olingo.server.api.ODataRequest; import org.apache.olingo.server.api.ODataResponse; import org.apache.olingo.server.api.uri.UriInfo; import org.apache.olingo.server.api.uri.UriResource; import org.apache.olingo.server.api.uri.UriResourceEntitySet; import org.apache.olingo.server.api.uri.UriResourceNavigation; import org.apache.olingo.server.api.uri.queryoption.CountOption; import org.apache.olingo.server.api.uri.queryoption.ExpandOption; import org.apache.olingo.server.api.uri.queryoption.FilterOption; import org.apache.olingo.server.api.uri.queryoption.OrderByOption; import org.apache.olingo.server.api.uri.queryoption.SelectOption; import org.apache.olingo.server.api.uri.queryoption.SkipOption; import org.apache.olingo.server.api.uri.queryoption.TopOption;
import java.util.*; import org.apache.olingo.commons.api.data.*; import org.apache.olingo.commons.api.edm.*; import org.apache.olingo.commons.api.format.*; import org.apache.olingo.commons.api.http.*; import org.apache.olingo.server.api.*; import org.apache.olingo.server.api.uri.*; import org.apache.olingo.server.api.uri.queryoption.*;
[ "java.util", "org.apache.olingo" ]
java.util; org.apache.olingo;
2,378,976
public void getData() { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "DimensionLookupDialog.Log.GettingKeyInfo" ) ); } if ( input.getKeyStream() != null ) { for ( int i = 0; i < input.getKeyStream().length; i++ ) { TableItem item = wKey.table.getItem( i ); if ( input.getKeyLookup()[i] != null ) { item.setText( 1, input.getKeyLookup()[i] ); } if ( input.getKeyStream()[i] != null ) { item.setText( 2, input.getKeyStream()[i] ); } } } if ( input.getFieldStream() != null ) { for ( int i = 0; i < input.getFieldStream().length; i++ ) { TableItem item = wUpIns.table.getItem( i ); if ( input.getFieldLookup()[i] != null ) { item.setText( 1, input.getFieldLookup()[i] ); } if ( input.getFieldStream()[i] != null ) { item.setText( 2, input.getFieldStream()[i] ); } item.setText( 3, DimensionLookupMeta.getUpdateType( input.isUpdate(), input.getFieldUpdate()[i] ) ); } } wUpdate.setSelection( input.isUpdate() ); if ( input.getSchemaName() != null ) { wSchema.setText( input.getSchemaName() ); } if ( input.getTableName() != null ) { wTable.setText( input.getTableName() ); } if ( input.getKeyField() != null ) { wTk.setText( input.getKeyField() ); } if ( input.getKeyRename() != null ) { wTkRename.setText( input.getKeyRename() ); } wAutoinc.setSelection( input.isAutoIncrement() ); if ( input.getVersionField() != null ) { wVersion.setText( input.getVersionField() ); } if ( input.getSequenceName() != null ) { wSeq.setText( input.getSequenceName() ); } if ( input.getDatabaseMeta() != null ) { wConnection.setText( input.getDatabaseMeta().getName() ); } else if ( transMeta.nrDatabases() == 1 ) { wConnection.setText( transMeta.getDatabase( 0 ).getName() ); } if ( input.getDateField() != null ) { wDatefield.setText( input.getDateField() ); } if ( input.getDateFrom() != null ) { wFromdate.setText( input.getDateFrom() ); } if ( input.getDateTo() != null ) { wTodate.setText( input.getDateTo() ); } String techKeyCreation = input.getTechKeyCreation(); if ( techKeyCreation == null ) { // Determine the creation of the technical key for // backwards compatibility. Can probably be removed at // version 3.x or so (Sven Boden). DatabaseMeta database = input.getDatabaseMeta(); if ( database == null || !database.supportsAutoinc() ) { input.setAutoIncrement( false ); } wAutoinc.setSelection( input.isAutoIncrement() ); wSeqButton.setSelection( input.getSequenceName() != null && input.getSequenceName().length() > 0 ); if ( !input.isAutoIncrement() && ( input.getSequenceName() == null || input.getSequenceName().length() <= 0 ) ) { wTableMax.setSelection( true ); } if ( database != null && database.supportsSequences() && input.getSequenceName() != null ) { wSeq.setText( input.getSequenceName() ); input.setAutoIncrement( false ); wTableMax.setSelection( false ); } } else { // KETTLE post 2.2 version: // The "creation" field now determines the behaviour of the // key creation. if ( DimensionLookupMeta.CREATION_METHOD_AUTOINC.equals( techKeyCreation ) ) { wAutoinc.setSelection( true ); wSeqButton.setSelection( false ); wTableMax.setSelection( false ); } else if ( ( DimensionLookupMeta.CREATION_METHOD_SEQUENCE.equals( techKeyCreation ) ) ) { wSeqButton.setSelection( true ); wAutoinc.setSelection( false ); wTableMax.setSelection( false ); } else { // the rest wTableMax.setSelection( true ); wAutoinc.setSelection( false ); wSeqButton.setSelection( false ); input.setTechKeyCreation( DimensionLookupMeta.CREATION_METHOD_TABLEMAX ); } if ( input.getSequenceName() != null ) { wSeq.setText( input.getSequenceName() ); } } wCommit.setText( "" + input.getCommitSize() ); wUseCache.setSelection( input.getCacheSize() >= 0 ); wPreloadCache.setSelection( input.isPreloadingCache() ); if ( input.getCacheSize() >= 0 ) { wCacheSize.setText( "" + input.getCacheSize() ); } wMinyear.setText( "" + input.getMinYear() ); wMaxyear.setText( "" + input.getMaxYear() ); wUpIns.removeEmptyRows(); wUpIns.setRowNums(); wUpIns.optWidth( true ); wKey.removeEmptyRows(); wKey.setRowNums(); wKey.optWidth( true ); ci = transMeta.findDatabase( wConnection.getText() ); // The alternative start date... // wUseAltStartDate.setSelection( input.isUsingStartDateAlternative() ); if ( input.isUsingStartDateAlternative() ) { wAltStartDate.setText( DimensionLookupMeta.getStartDateAlternativeDesc( input.getStartDateAlternative() ) ); } wAltStartDateField.setText( Const.NVL( input.getStartDateFieldName(), "" ) ); setFlags(); wStepname.selectAll(); wStepname.setFocus(); }
void function() { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, STR ) ); } if ( input.getKeyStream() != null ) { for ( int i = 0; i < input.getKeyStream().length; i++ ) { TableItem item = wKey.table.getItem( i ); if ( input.getKeyLookup()[i] != null ) { item.setText( 1, input.getKeyLookup()[i] ); } if ( input.getKeyStream()[i] != null ) { item.setText( 2, input.getKeyStream()[i] ); } } } if ( input.getFieldStream() != null ) { for ( int i = 0; i < input.getFieldStream().length; i++ ) { TableItem item = wUpIns.table.getItem( i ); if ( input.getFieldLookup()[i] != null ) { item.setText( 1, input.getFieldLookup()[i] ); } if ( input.getFieldStream()[i] != null ) { item.setText( 2, input.getFieldStream()[i] ); } item.setText( 3, DimensionLookupMeta.getUpdateType( input.isUpdate(), input.getFieldUpdate()[i] ) ); } } wUpdate.setSelection( input.isUpdate() ); if ( input.getSchemaName() != null ) { wSchema.setText( input.getSchemaName() ); } if ( input.getTableName() != null ) { wTable.setText( input.getTableName() ); } if ( input.getKeyField() != null ) { wTk.setText( input.getKeyField() ); } if ( input.getKeyRename() != null ) { wTkRename.setText( input.getKeyRename() ); } wAutoinc.setSelection( input.isAutoIncrement() ); if ( input.getVersionField() != null ) { wVersion.setText( input.getVersionField() ); } if ( input.getSequenceName() != null ) { wSeq.setText( input.getSequenceName() ); } if ( input.getDatabaseMeta() != null ) { wConnection.setText( input.getDatabaseMeta().getName() ); } else if ( transMeta.nrDatabases() == 1 ) { wConnection.setText( transMeta.getDatabase( 0 ).getName() ); } if ( input.getDateField() != null ) { wDatefield.setText( input.getDateField() ); } if ( input.getDateFrom() != null ) { wFromdate.setText( input.getDateFrom() ); } if ( input.getDateTo() != null ) { wTodate.setText( input.getDateTo() ); } String techKeyCreation = input.getTechKeyCreation(); if ( techKeyCreation == null ) { DatabaseMeta database = input.getDatabaseMeta(); if ( database == null !database.supportsAutoinc() ) { input.setAutoIncrement( false ); } wAutoinc.setSelection( input.isAutoIncrement() ); wSeqButton.setSelection( input.getSequenceName() != null && input.getSequenceName().length() > 0 ); if ( !input.isAutoIncrement() && ( input.getSequenceName() == null input.getSequenceName().length() <= 0 ) ) { wTableMax.setSelection( true ); } if ( database != null && database.supportsSequences() && input.getSequenceName() != null ) { wSeq.setText( input.getSequenceName() ); input.setAutoIncrement( false ); wTableMax.setSelection( false ); } } else { if ( DimensionLookupMeta.CREATION_METHOD_AUTOINC.equals( techKeyCreation ) ) { wAutoinc.setSelection( true ); wSeqButton.setSelection( false ); wTableMax.setSelection( false ); } else if ( ( DimensionLookupMeta.CREATION_METHOD_SEQUENCE.equals( techKeyCreation ) ) ) { wSeqButton.setSelection( true ); wAutoinc.setSelection( false ); wTableMax.setSelection( false ); } else { wTableMax.setSelection( true ); wAutoinc.setSelection( false ); wSeqButton.setSelection( false ); input.setTechKeyCreation( DimensionLookupMeta.CREATION_METHOD_TABLEMAX ); } if ( input.getSequenceName() != null ) { wSeq.setText( input.getSequenceName() ); } } wCommit.setText( STRSTRSTRSTR" ) ); setFlags(); wStepname.selectAll(); wStepname.setFocus(); }
/** * Copy information from the meta-data input to the dialog fields. */
Copy information from the meta-data input to the dialog fields
getData
{ "repo_name": "tkafalas/pentaho-kettle", "path": "ui/src/main/java/org/pentaho/di/ui/trans/steps/dimensionlookup/DimensionLookupDialog.java", "license": "apache-2.0", "size": 72693 }
[ "org.eclipse.swt.widgets.TableItem", "org.pentaho.di.core.database.DatabaseMeta", "org.pentaho.di.i18n.BaseMessages", "org.pentaho.di.trans.steps.dimensionlookup.DimensionLookupMeta" ]
import org.eclipse.swt.widgets.TableItem; import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.trans.steps.dimensionlookup.DimensionLookupMeta;
import org.eclipse.swt.widgets.*; import org.pentaho.di.core.database.*; import org.pentaho.di.i18n.*; import org.pentaho.di.trans.steps.dimensionlookup.*;
[ "org.eclipse.swt", "org.pentaho.di" ]
org.eclipse.swt; org.pentaho.di;
948,224
public static void serializeCQLQueryResults(CQLQueryResults results, Writer writer, InputStream wsddStream) throws Exception { if (results == null || writer == null) { throw new IllegalArgumentException("Null is not a valid argument"); } if (wsddStream == null) { Utils.serializeObject(results, DataServiceConstants.CQL_RESULT_SET_QNAME, writer); } else { Utils.serializeObject(results, DataServiceConstants.CQL_RESULT_SET_QNAME, writer, wsddStream); } }
static void function(CQLQueryResults results, Writer writer, InputStream wsddStream) throws Exception { if (results == null writer == null) { throw new IllegalArgumentException(STR); } if (wsddStream == null) { Utils.serializeObject(results, DataServiceConstants.CQL_RESULT_SET_QNAME, writer); } else { Utils.serializeObject(results, DataServiceConstants.CQL_RESULT_SET_QNAME, writer, wsddStream); } }
/** * Write the XML representation of the specified query results to the specified * writer, using the configuration specified by the WSDD configuration. * If either the results or writer are null, an IllegalArgumentException will be thrown. * * @param results * @param writer * @param wsddStream * @throws Exception */
Write the XML representation of the specified query results to the specified writer, using the configuration specified by the WSDD configuration. If either the results or writer are null, an IllegalArgumentException will be thrown
serializeCQLQueryResults
{ "repo_name": "NCIP/cagrid-core", "path": "caGrid/projects/fqp/src/gov/nih/nci/cagrid/fqp/common/SerializationUtils.java", "license": "bsd-3-clause", "size": 11435 }
[ "gov.nih.nci.cagrid.common.Utils", "gov.nih.nci.cagrid.cqlresultset.CQLQueryResults", "gov.nih.nci.cagrid.data.DataServiceConstants", "java.io.InputStream", "java.io.Writer" ]
import gov.nih.nci.cagrid.common.Utils; import gov.nih.nci.cagrid.cqlresultset.CQLQueryResults; import gov.nih.nci.cagrid.data.DataServiceConstants; import java.io.InputStream; import java.io.Writer;
import gov.nih.nci.cagrid.common.*; import gov.nih.nci.cagrid.cqlresultset.*; import gov.nih.nci.cagrid.data.*; import java.io.*;
[ "gov.nih.nci", "java.io" ]
gov.nih.nci; java.io;
1,377,759
public String getTitle() { return getCOSObject().getString(COSName.TITLE); }
String function() { return getCOSObject().getString(COSName.TITLE); }
/** * This will get the title of the document. This will return null if no title exists. * * @return The title of the document. */
This will get the title of the document. This will return null if no title exists
getTitle
{ "repo_name": "torakiki/sambox", "path": "src/main/java/org/sejda/sambox/pdmodel/PDDocumentInformation.java", "license": "apache-2.0", "size": 8462 }
[ "org.sejda.sambox.cos.COSName" ]
import org.sejda.sambox.cos.COSName;
import org.sejda.sambox.cos.*;
[ "org.sejda.sambox" ]
org.sejda.sambox;
234,502
private RobotPosition moveForward(final RobotPosition rpos) { RobotPosition newpos = new RobotPosition(rpos.getX(), rpos.getY(), rpos.getCardinalPos()); switch (newpos.getCardinalPos()) { case GlobalConstants.NORTH_POS: int y = newpos.getY() + 1; if (y > maxYAxis) { y = maxYAxis; } newpos.setY(y); break; case GlobalConstants.SOUTH_POS: y = newpos.getY() - 1; if (y < 0) { y = 0; } newpos.setY(y); break; case GlobalConstants.EAST_POS: int x = newpos.getX() + 1; if (x > maxXAxis) { x = maxXAxis; } newpos.setX(x); break; case GlobalConstants.WEST_POS: x = newpos.getX() - 1; if (x < 0) { x = 0; } newpos.setX(x); break; } return newpos; }
RobotPosition function(final RobotPosition rpos) { RobotPosition newpos = new RobotPosition(rpos.getX(), rpos.getY(), rpos.getCardinalPos()); switch (newpos.getCardinalPos()) { case GlobalConstants.NORTH_POS: int y = newpos.getY() + 1; if (y > maxYAxis) { y = maxYAxis; } newpos.setY(y); break; case GlobalConstants.SOUTH_POS: y = newpos.getY() - 1; if (y < 0) { y = 0; } newpos.setY(y); break; case GlobalConstants.EAST_POS: int x = newpos.getX() + 1; if (x > maxXAxis) { x = maxXAxis; } newpos.setX(x); break; case GlobalConstants.WEST_POS: x = newpos.getX() - 1; if (x < 0) { x = 0; } newpos.setX(x); break; } return newpos; }
/** * Depending on the given position, it moves one location in the cardinal * direction. * * @param rpos * new position. */
Depending on the given position, it moves one location in the cardinal direction
moveForward
{ "repo_name": "cortizqgithub/csoftz-s4n-robobum-java", "path": "src/main/java/com/csoftz/s4n/robobum/Robot.java", "license": "mit", "size": 7186 }
[ "com.csoftz.s4n.robobum.consts.GlobalConstants", "com.csoftz.s4n.robobum.domain.RobotPosition" ]
import com.csoftz.s4n.robobum.consts.GlobalConstants; import com.csoftz.s4n.robobum.domain.RobotPosition;
import com.csoftz.s4n.robobum.consts.*; import com.csoftz.s4n.robobum.domain.*;
[ "com.csoftz.s4n" ]
com.csoftz.s4n;
475,441
public SystemData systemData() { return this.systemData; }
SystemData function() { return this.systemData; }
/** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */
Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information
systemData
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ClusterPrincipalAssignmentInner.java", "license": "mit", "size": 6095 }
[ "com.azure.core.management.SystemData" ]
import com.azure.core.management.SystemData;
import com.azure.core.management.*;
[ "com.azure.core" ]
com.azure.core;
985,320
public void setDossierFolderPersistence( DossierFolderPersistence dossierFolderPersistence) { this.dossierFolderPersistence = dossierFolderPersistence; }
void function( DossierFolderPersistence dossierFolderPersistence) { this.dossierFolderPersistence = dossierFolderPersistence; }
/** * Sets the dossier folder persistence. * * @param dossierFolderPersistence the dossier folder persistence */
Sets the dossier folder persistence
setDossierFolderPersistence
{ "repo_name": "thongdv/OEPv2", "path": "portlets/oep-core-dossiermgt-portlet/docroot/WEB-INF/src/org/oep/core/dossiermgt/service/base/DossierDoc2TemplateServiceBaseImpl.java", "license": "apache-2.0", "size": 36774 }
[ "org.oep.core.dossiermgt.service.persistence.DossierFolderPersistence" ]
import org.oep.core.dossiermgt.service.persistence.DossierFolderPersistence;
import org.oep.core.dossiermgt.service.persistence.*;
[ "org.oep.core" ]
org.oep.core;
1,618,550
public void append(LoggingEvent le) { if (doc == null) { return; } try { SimpleAttributeSet attr = new SimpleAttributeSet(); StyleConstants.setFontFamily(attr, "SansSerif"); String str = le.getMessage().toString(); ThrowableInformation ti = le.getThrowableInformation(); if (le.getLevel().isGreaterOrEqual(Level.INFO)) { StyleConstants.setFontSize(attr, 12); } else { StyleConstants.setFontSize(attr, 10); } if (le.getLevel().isGreaterOrEqual(Level.ERROR)) { StyleConstants.setForeground(attr, Color.RED); } else if (le.getLevel().isGreaterOrEqual(Level.WARN)) { StyleConstants.setForeground(attr, Color.ORANGE); } else if (new StringBuffer(le.getMessage().toString()).indexOf("R cmd:") == 0) { str = str.substring(7); StyleConstants.setForeground(attr, Color.BLUE); } else if (new StringBuffer(le.getMessage().toString()).indexOf("R Console:") == 0) { StyleConstants.setForeground(attr, new Color(0, 150, 0)); } else { StyleConstants.setForeground(attr, Color.BLACK); } doc.insertString(doc.getLength(), str + "\n", attr); if (ti != null) { for (String s : ti.getThrowableStrRep()) { doc.insertString(doc.getLength(), s + "\n", attr); } } } catch (BadLocationException ble) { } }
void function(LoggingEvent le) { if (doc == null) { return; } try { SimpleAttributeSet attr = new SimpleAttributeSet(); StyleConstants.setFontFamily(attr, STR); String str = le.getMessage().toString(); ThrowableInformation ti = le.getThrowableInformation(); if (le.getLevel().isGreaterOrEqual(Level.INFO)) { StyleConstants.setFontSize(attr, 12); } else { StyleConstants.setFontSize(attr, 10); } if (le.getLevel().isGreaterOrEqual(Level.ERROR)) { StyleConstants.setForeground(attr, Color.RED); } else if (le.getLevel().isGreaterOrEqual(Level.WARN)) { StyleConstants.setForeground(attr, Color.ORANGE); } else if (new StringBuffer(le.getMessage().toString()).indexOf(STR) == 0) { str = str.substring(7); StyleConstants.setForeground(attr, Color.BLUE); } else if (new StringBuffer(le.getMessage().toString()).indexOf(STR) == 0) { StyleConstants.setForeground(attr, new Color(0, 150, 0)); } else { StyleConstants.setForeground(attr, Color.BLACK); } doc.insertString(doc.getLength(), str + "\n", attr); if (ti != null) { for (String s : ti.getThrowableStrRep()) { doc.insertString(doc.getLength(), s + "\n", attr); } } } catch (BadLocationException ble) { } }
/** * Appends messages of LoggingEvents to the TextField. * * @param le The LoggingEvent to append. */
Appends messages of LoggingEvents to the TextField
append
{ "repo_name": "kornl/afcommons", "path": "src/org/af/commons/logging/widgets/SimpleLogPanel.java", "license": "gpl-3.0", "size": 7586 }
[ "java.awt.Color", "javax.swing.text.BadLocationException", "javax.swing.text.SimpleAttributeSet", "javax.swing.text.StyleConstants", "org.apache.log4j.Level", "org.apache.log4j.spi.LoggingEvent", "org.apache.log4j.spi.ThrowableInformation" ]
import java.awt.Color; import javax.swing.text.BadLocationException; import javax.swing.text.SimpleAttributeSet; import javax.swing.text.StyleConstants; import org.apache.log4j.Level; import org.apache.log4j.spi.LoggingEvent; import org.apache.log4j.spi.ThrowableInformation;
import java.awt.*; import javax.swing.text.*; import org.apache.log4j.*; import org.apache.log4j.spi.*;
[ "java.awt", "javax.swing", "org.apache.log4j" ]
java.awt; javax.swing; org.apache.log4j;
317,316
public void setBorderGap(int borderGap) { this.borderGap = borderGap; Border inner = new EmptyBorder(0, borderGap, 0, borderGap); this.setBorder(new CompoundBorder(TextLineNumber.OUTER, inner)); this.lastDigits = 0; this.setPreferredWidth(); }
void function(int borderGap) { this.borderGap = borderGap; Border inner = new EmptyBorder(0, borderGap, 0, borderGap); this.setBorder(new CompoundBorder(TextLineNumber.OUTER, inner)); this.lastDigits = 0; this.setPreferredWidth(); }
/** * The border gap is used in calculating the left and right insets of the border. Default value is 5. * * @param borderGap the gap in pixels */
The border gap is used in calculating the left and right insets of the border. Default value is 5
setBorderGap
{ "repo_name": "jurgendl/swing-easy", "path": "src/main/java/org/swingeasy/TextLineNumber.java", "license": "mit", "size": 15104 }
[ "javax.swing.border.Border", "javax.swing.border.CompoundBorder", "javax.swing.border.EmptyBorder" ]
import javax.swing.border.Border; import javax.swing.border.CompoundBorder; import javax.swing.border.EmptyBorder;
import javax.swing.border.*;
[ "javax.swing" ]
javax.swing;
927,806
private void serializeContext(ObjectOutputStream out) throws IOException { // Step 1. final int len = context.size(); out.writeInt(len); for (Map.Entry<String, Object> entry : context.entrySet()) { // Step 2. out.writeObject(entry.getKey()); final Object value = entry.getValue(); if (value instanceof Serializable) { // Step 3a. out.writeObject(value); } else { // Step 3b. out.writeObject(nonSerializableReplacement(value)); } } }
void function(ObjectOutputStream out) throws IOException { final int len = context.size(); out.writeInt(len); for (Map.Entry<String, Object> entry : context.entrySet()) { out.writeObject(entry.getKey()); final Object value = entry.getValue(); if (value instanceof Serializable) { out.writeObject(value); } else { out.writeObject(nonSerializableReplacement(value)); } } }
/** * Serialize {@link #context}. * * @param out Stream. * @throws IOException This should never happen. */
Serialize <code>#context</code>
serializeContext
{ "repo_name": "jlizier/information-dynamics-toolkit", "path": "java/source/infodynamics/utils/commonsmath3/exception/util/ExceptionContext.java", "license": "gpl-3.0", "size": 11838 }
[ "java.io.IOException", "java.io.ObjectOutputStream", "java.io.Serializable", "java.util.Map" ]
import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.Map;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
737,242
public String retrieveEndpointName(J2EEName j2eeName) { for (Entry<String, J2EEName> entry : endpointNameJ2EENameMap.entrySet()) { if (entry.getValue().equals(j2eeName)) { return entry.getKey(); } } return null; }
String function(J2EEName j2eeName) { for (Entry<String, J2EEName> entry : endpointNameJ2EENameMap.entrySet()) { if (entry.getValue().equals(j2eeName)) { return entry.getKey(); } } return null; }
/** * Get the endpoint name by j2eeName * * @param j2eeName * @return */
Get the endpoint name by j2eeName
retrieveEndpointName
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.jaxws.2.3.common/src/com/ibm/ws/jaxws/metadata/JaxWsServerMetaData.java", "license": "epl-1.0", "size": 2747 }
[ "com.ibm.websphere.csi.J2EEName", "java.util.Map" ]
import com.ibm.websphere.csi.J2EEName; import java.util.Map;
import com.ibm.websphere.csi.*; import java.util.*;
[ "com.ibm.websphere", "java.util" ]
com.ibm.websphere; java.util;
91,078
private void deleteDeadEntities() { ArrayList<Entity> deadFX = new ArrayList<Entity>(); for (Entity effect : effects) { if (effect instanceof Burst) { Burst pop = (Burst) effect; if (pop.isDead()) { deadFX.add((Entity) pop); } } } effects.removeAll(deadFX); }
void function() { ArrayList<Entity> deadFX = new ArrayList<Entity>(); for (Entity effect : effects) { if (effect instanceof Burst) { Burst pop = (Burst) effect; if (pop.isDead()) { deadFX.add((Entity) pop); } } } effects.removeAll(deadFX); }
/** * Removes dead effects and other inactive entities. */
Removes dead effects and other inactive entities
deleteDeadEntities
{ "repo_name": "JoePelz/scroller", "path": "src/core/Engine.java", "license": "mit", "size": 16887 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,750,464
private static void populateSet(Set collection, Class<?> typeClass) throws IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException { if (typeClass.isEnum()) { collection.add(typeClass.getEnumConstants()[0]); collection.add(typeClass.getEnumConstants()[1]); } else if (typeClass == String.class ) { collection.add("VALUE_1"); collection.add("VALUE_2"); } else if (typeClass.getPackage().getName().startsWith("io.apiman.manager.api.beans")) { Object bean1 = createBean(typeClass); Object bean2 = createBean(typeClass); collection.add(bean1); collection.add(bean2); } else { throw new IllegalAccessException("Failed to populate Set of type: " + typeClass.getSimpleName()); } }
static void function(Set collection, Class<?> typeClass) throws IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException { if (typeClass.isEnum()) { collection.add(typeClass.getEnumConstants()[0]); collection.add(typeClass.getEnumConstants()[1]); } else if (typeClass == String.class ) { collection.add(STR); collection.add(STR); } else if (typeClass.getPackage().getName().startsWith(STR)) { Object bean1 = createBean(typeClass); Object bean2 = createBean(typeClass); collection.add(bean1); collection.add(bean2); } else { throw new IllegalAccessException(STR + typeClass.getSimpleName()); } }
/** * Populate the given set with one or two items of the given type. * @param collection * @param typeClass */
Populate the given set with one or two items of the given type
populateSet
{ "repo_name": "cmoulliard/apiman", "path": "manager/api/es/src/test/java/io/apiman/manager/api/es/EsMarshallingTest.java", "license": "apache-2.0", "size": 19931 }
[ "java.lang.reflect.InvocationTargetException", "java.util.Set" ]
import java.lang.reflect.InvocationTargetException; import java.util.Set;
import java.lang.reflect.*; import java.util.*;
[ "java.lang", "java.util" ]
java.lang; java.util;
2,277,209
public static Enum castToEnum(Object object, Class<? extends Enum> type) { if (object==null) return null; if (type.isInstance(object)) return (Enum) object; if (object instanceof String || object instanceof GString) { return Enum.valueOf(type, object.toString()); } throw new GroovyCastException(object, type); }
static Enum function(Object object, Class<? extends Enum> type) { if (object==null) return null; if (type.isInstance(object)) return (Enum) object; if (object instanceof String object instanceof GString) { return Enum.valueOf(type, object.toString()); } throw new GroovyCastException(object, type); }
/** * this class requires that the supplied enum is not fitting a * Collection case for casting */
this class requires that the supplied enum is not fitting a Collection case for casting
castToEnum
{ "repo_name": "OpenBEL/kam-nav", "path": "tools/groovy/src/src/main/org/codehaus/groovy/runtime/typehandling/ShortTypeHandling.java", "license": "apache-2.0", "size": 2723 }
[ "groovy.lang.GString" ]
import groovy.lang.GString;
import groovy.lang.*;
[ "groovy.lang" ]
groovy.lang;
1,321,988
public static Map<String, String> initializeLookupMap(String... args) { Map<String, String> lookupMap = new HashMap<String, String>(); for (int i = 0; i < args.length; i++) { lookupMap.put(args[i], args[i]); } return lookupMap; }
static Map<String, String> function(String... args) { Map<String, String> lookupMap = new HashMap<String, String>(); for (int i = 0; i < args.length; i++) { lookupMap.put(args[i], args[i]); } return lookupMap; }
/** * Initialize a hash map from a list of strings for use in lookups. The performance * of a lookup against a hash map is superior to that of a list, so this approach is * useful for critical-path lookups. */
Initialize a hash map from a list of strings for use in lookups. The performance of a lookup against a hash map is superior to that of a list, so this approach is useful for critical-path lookups
initializeLookupMap
{ "repo_name": "opendatakraken/openbiwiki", "path": "openbiwiki-core/src/main/java/org/jamwiki/utils/Utilities.java", "license": "mit", "size": 17621 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,289,197
static Intent createEmailIntent(Context context, long eventId, String body) { // TODO: Refactor to move query part into Utils.createEmailAttendeeIntent, to // be shared with EventInfoFragment. // Query for the owner account(s). String ownerAccount = null; String syncAccount = null; String eventTitle = null; String eventOrganizer = null; Cursor eventCursor = getEventCursor(context, eventId); try { if (eventCursor != null && eventCursor.moveToFirst()) { ownerAccount = eventCursor.getString(EVENT_INDEX_OWNER_ACCOUNT); syncAccount = eventCursor.getString(EVENT_INDEX_ACCOUNT_NAME); eventTitle = eventCursor.getString(EVENT_INDEX_TITLE); eventOrganizer = eventCursor.getString(EVENT_INDEX_ORGANIZER); } } finally { if (eventCursor != null) { eventCursor.close(); } } if (TextUtils.isEmpty(eventTitle)) { eventTitle = context.getResources().getString(R.string.no_title_label); } // Query for the attendees. List<String> toEmails = new ArrayList<String>(); List<String> ccEmails = new ArrayList<String>(); Cursor attendeesCursor = getAttendeesCursor(context, eventId); try { if (attendeesCursor != null && attendeesCursor.moveToFirst()) { do { int status = attendeesCursor.getInt(ATTENDEES_INDEX_STATUS); String email = attendeesCursor.getString(ATTENDEES_INDEX_EMAIL); switch(status) { case Attendees.ATTENDEE_STATUS_DECLINED: addIfEmailable(ccEmails, email, syncAccount); break; default: addIfEmailable(toEmails, email, syncAccount); } } while (attendeesCursor.moveToNext()); } } finally { if (attendeesCursor != null) { attendeesCursor.close(); } } // Add organizer only if no attendees to email (the case when too many attendees // in the event to sync or show). if (toEmails.size() == 0 && ccEmails.size() == 0 && eventOrganizer != null) { addIfEmailable(toEmails, eventOrganizer, syncAccount); } Intent intent = null; if (ownerAccount != null && (toEmails.size() > 0 || ccEmails.size() > 0)) { intent = Utils.createEmailAttendeesIntent(context.getResources(), eventTitle, body, toEmails, ccEmails, ownerAccount); } if (intent == null) { return null; } else { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); return intent; } }
static Intent createEmailIntent(Context context, long eventId, String body) { String ownerAccount = null; String syncAccount = null; String eventTitle = null; String eventOrganizer = null; Cursor eventCursor = getEventCursor(context, eventId); try { if (eventCursor != null && eventCursor.moveToFirst()) { ownerAccount = eventCursor.getString(EVENT_INDEX_OWNER_ACCOUNT); syncAccount = eventCursor.getString(EVENT_INDEX_ACCOUNT_NAME); eventTitle = eventCursor.getString(EVENT_INDEX_TITLE); eventOrganizer = eventCursor.getString(EVENT_INDEX_ORGANIZER); } } finally { if (eventCursor != null) { eventCursor.close(); } } if (TextUtils.isEmpty(eventTitle)) { eventTitle = context.getResources().getString(R.string.no_title_label); } List<String> toEmails = new ArrayList<String>(); List<String> ccEmails = new ArrayList<String>(); Cursor attendeesCursor = getAttendeesCursor(context, eventId); try { if (attendeesCursor != null && attendeesCursor.moveToFirst()) { do { int status = attendeesCursor.getInt(ATTENDEES_INDEX_STATUS); String email = attendeesCursor.getString(ATTENDEES_INDEX_EMAIL); switch(status) { case Attendees.ATTENDEE_STATUS_DECLINED: addIfEmailable(ccEmails, email, syncAccount); break; default: addIfEmailable(toEmails, email, syncAccount); } } while (attendeesCursor.moveToNext()); } } finally { if (attendeesCursor != null) { attendeesCursor.close(); } } if (toEmails.size() == 0 && ccEmails.size() == 0 && eventOrganizer != null) { addIfEmailable(toEmails, eventOrganizer, syncAccount); } Intent intent = null; if (ownerAccount != null && (toEmails.size() > 0 ccEmails.size() > 0)) { intent = Utils.createEmailAttendeesIntent(context.getResources(), eventTitle, body, toEmails, ccEmails, ownerAccount); } if (intent == null) { return null; } else { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK Intent.FLAG_ACTIVITY_CLEAR_TASK); return intent; } }
/** * Creates an Intent for emailing the attendees of the event. Returns null if there * are no emailable attendees. */
Creates an Intent for emailing the attendees of the event. Returns null if there are no emailable attendees
createEmailIntent
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/apps/Calendar/src/com/android/calendar/alerts/AlertReceiver.java", "license": "gpl-2.0", "size": 31228 }
[ "android.content.Context", "android.content.Intent", "android.database.Cursor", "android.provider.CalendarContract", "android.text.TextUtils", "com.android.calendar.Utils", "java.util.ArrayList", "java.util.List" ]
import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.provider.CalendarContract; import android.text.TextUtils; import com.android.calendar.Utils; import java.util.ArrayList; import java.util.List;
import android.content.*; import android.database.*; import android.provider.*; import android.text.*; import com.android.calendar.*; import java.util.*;
[ "android.content", "android.database", "android.provider", "android.text", "com.android.calendar", "java.util" ]
android.content; android.database; android.provider; android.text; com.android.calendar; java.util;
948,562
private List<File> scanForConfigurationFiles(final File config, final List<String> profiles) { val possibleFiles = getAllPossibleExternalConfigDirFilenames(config, profiles); return possibleFiles.stream().filter(File::exists).filter(File::isFile).collect(Collectors.toList()); }
List<File> function(final File config, final List<String> profiles) { val possibleFiles = getAllPossibleExternalConfigDirFilenames(config, profiles); return possibleFiles.stream().filter(File::exists).filter(File::isFile).collect(Collectors.toList()); }
/** * Get all possible configuration files for config directory that actually exist as files. * @param config Folder in which to look for files * @param profiles Profiles that are active * @return List of files to be processed in order where last one processed overrides others */
Get all possible configuration files for config directory that actually exist as files
scanForConfigurationFiles
{ "repo_name": "frett/cas", "path": "core/cas-server-core-configuration-api/src/main/java/org/apereo/cas/configuration/DefaultCasConfigurationPropertiesSourceLocator.java", "license": "apache-2.0", "size": 9612 }
[ "java.io.File", "java.util.List", "java.util.stream.Collectors" ]
import java.io.File; import java.util.List; import java.util.stream.Collectors;
import java.io.*; import java.util.*; import java.util.stream.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,400,295
public static NotificationCompat.Builder newBuilder(Context context) { NotificationCompat.Builder builder = new NotificationCompat.Builder(context); builder.setSmallIcon(R.drawable.gx_notification_default); Integer customResourceId = Services.Resources.getImageResourceId("gx_notification_icon"); if (PrimitiveUtils.isNonZero(customResourceId)) builder.setSmallIcon(customResourceId); int colorResId = context.getResources().getIdentifier("gx_colorPrimary", "color", context.getPackageName()); if (colorResId != 0) { int color = context.getResources().getColor(colorResId); builder.setColor(color); // Eventually we could also do something like: builder.setLights(color, onMs, offMs); } return builder; }
static NotificationCompat.Builder function(Context context) { NotificationCompat.Builder builder = new NotificationCompat.Builder(context); builder.setSmallIcon(R.drawable.gx_notification_default); Integer customResourceId = Services.Resources.getImageResourceId(STR); if (PrimitiveUtils.isNonZero(customResourceId)) builder.setSmallIcon(customResourceId); int colorResId = context.getResources().getIdentifier(STR, "color", context.getPackageName()); if (colorResId != 0) { int color = context.getResources().getColor(colorResId); builder.setColor(color); } return builder; }
/** * Creates a new {@link android.support.v4.app.NotificationCompat.Builder NotificationCompat.Builder} with * some preset properties, such as the Lollipop color and notification icon (uses the "Android Notification Icon" * as defined in the main object if available, otherwise the gx_notification_default small icon). */
Creates a new <code>android.support.v4.app.NotificationCompat.Builder NotificationCompat.Builder</code> with some preset properties, such as the Lollipop color and notification icon (uses the "Android Notification Icon" as defined in the main object if available, otherwise the gx_notification_default small icon)
newBuilder
{ "repo_name": "pablanco/taskManager", "path": "Android/FlexibleClient/src/com/artech/android/notification/NotificationHelper.java", "license": "gpl-2.0", "size": 3565 }
[ "android.content.Context", "android.support.v4.app.NotificationCompat", "com.artech.base.services.Services", "com.artech.base.utils.PrimitiveUtils" ]
import android.content.Context; import android.support.v4.app.NotificationCompat; import com.artech.base.services.Services; import com.artech.base.utils.PrimitiveUtils;
import android.content.*; import android.support.v4.app.*; import com.artech.base.services.*; import com.artech.base.utils.*;
[ "android.content", "android.support", "com.artech.base" ]
android.content; android.support; com.artech.base;
1,520,534
public List<Inode> checkoutByCondition(String condition, User user, boolean respectFrontendRoles, int offset, int limit) throws DotDataException, DotSecurityException, DotStateException;
List<Inode> function(String condition, User user, boolean respectFrontendRoles, int offset, int limit) throws DotDataException, DotSecurityException, DotStateException;
/** * Allows you to checkout contents based on a lucene query so it can be * altered and checked in, in a paginated fashion * * @param luceneQuery * @param user * @param respectFrontendRoles * @param offset * @param limit * @return * @throws DotDataException * @throws DotSecurityException * @throws DotStateException * @throws ParseException */
Allows you to checkout contents based on a lucene query so it can be altered and checked in, in a paginated fashion
checkoutByCondition
{ "repo_name": "zhiqinghuang/core", "path": "src/com/dotmarketing/business/skeleton/DotCMSAPIPostHook.java", "license": "gpl-3.0", "size": 24644 }
[ "com.dotmarketing.beans.Inode", "com.dotmarketing.business.DotStateException", "com.dotmarketing.exception.DotDataException", "com.dotmarketing.exception.DotSecurityException", "com.liferay.portal.model.User", "java.util.List" ]
import com.dotmarketing.beans.Inode; import com.dotmarketing.business.DotStateException; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; import com.liferay.portal.model.User; import java.util.List;
import com.dotmarketing.beans.*; import com.dotmarketing.business.*; import com.dotmarketing.exception.*; import com.liferay.portal.model.*; import java.util.*;
[ "com.dotmarketing.beans", "com.dotmarketing.business", "com.dotmarketing.exception", "com.liferay.portal", "java.util" ]
com.dotmarketing.beans; com.dotmarketing.business; com.dotmarketing.exception; com.liferay.portal; java.util;
1,967,166
public ArrayList<Sector> getSectorsContainingMineral(Mineral mineral){ return getSectorsContainingMineral(mineral.getMineral()); }
ArrayList<Sector> function(Mineral mineral){ return getSectorsContainingMineral(mineral.getMineral()); }
/** * Takes the given mineral name and returns all sectors with that mineral assigned * @param mineral * @return */
Takes the given mineral name and returns all sectors with that mineral assigned
getSectorsContainingMineral
{ "repo_name": "stevewest/VO-Miner", "path": "src/com/uruwolf/vominer/data/SectorDataSource.java", "license": "gpl-3.0", "size": 7916 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,169,766
@Override public byte[] insideBarrier() throws ForeignException { execute(); return SimpleMasterProcedureManager.SIMPLE_DATA.getBytes(); }
byte[] function() throws ForeignException { execute(); return SimpleMasterProcedureManager.SIMPLE_DATA.getBytes(); }
/** * do a log roll. */
do a log roll
insideBarrier
{ "repo_name": "ZhangXFeng/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/SimpleRSProcedureManager.java", "license": "apache-2.0", "size": 8524 }
[ "org.apache.hadoop.hbase.errorhandling.ForeignException" ]
import org.apache.hadoop.hbase.errorhandling.ForeignException;
import org.apache.hadoop.hbase.errorhandling.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,114,768
public void setYTranslation(NexusObjectProvider<NXpositioner> yPositioner) throws NexusException { final DataNode yTranslation = getDataNode(yPositioner); sample.addDataNode(NX_Y_TRANSLATION, yTranslation); }
void function(NexusObjectProvider<NXpositioner> yPositioner) throws NexusException { final DataNode yTranslation = getDataNode(yPositioner); sample.addDataNode(NX_Y_TRANSLATION, yTranslation); }
/** * Sets the 'y' translation * @param yPositioner y positioner * @throws NexusException */
Sets the 'y' translation
setYTranslation
{ "repo_name": "belkassaby/dawnsci", "path": "org.eclipse.dawnsci.nexus/src/org/eclipse/dawnsci/nexus/builder/appdef/impl/TomoApplicationBuilder.java", "license": "epl-1.0", "size": 10055 }
[ "org.eclipse.dawnsci.analysis.api.tree.DataNode", "org.eclipse.dawnsci.nexus.NXpositioner", "org.eclipse.dawnsci.nexus.NexusException", "org.eclipse.dawnsci.nexus.builder.NexusObjectProvider" ]
import org.eclipse.dawnsci.analysis.api.tree.DataNode; import org.eclipse.dawnsci.nexus.NXpositioner; import org.eclipse.dawnsci.nexus.NexusException; import org.eclipse.dawnsci.nexus.builder.NexusObjectProvider;
import org.eclipse.dawnsci.analysis.api.tree.*; import org.eclipse.dawnsci.nexus.*; import org.eclipse.dawnsci.nexus.builder.*;
[ "org.eclipse.dawnsci" ]
org.eclipse.dawnsci;
2,647,366
public void startRecording(int callId, int way) throws SameThreadException { // Make sure we are in a valid state for recording if (!canRecord(callId)) { return; } // Sanitize call way : if 0 assume all if (way == 0) { way = SipManager.BITMASK_ALL; } try { File recFolder = PreferencesProviderWrapper.getRecordsFolder(service); IRecorderHandler recoder = new SimpleWavRecorderHandler(getCallInfo(callId), recFolder, way); List<IRecorderHandler> recordersList = callRecorders.get(callId, new ArrayList<IRecorderHandler>()); recordersList.add(recoder); callRecorders.put(callId, recordersList); recoder.startRecording(); userAgentReceiver.updateRecordingStatus(callId, false, true); } catch (IOException e) { service.notifyUserOfMessage(R.string.cant_write_file); } catch (RuntimeException e) { Log.e(THIS_FILE, "Impossible to record ", e); } }
void function(int callId, int way) throws SameThreadException { if (!canRecord(callId)) { return; } if (way == 0) { way = SipManager.BITMASK_ALL; } try { File recFolder = PreferencesProviderWrapper.getRecordsFolder(service); IRecorderHandler recoder = new SimpleWavRecorderHandler(getCallInfo(callId), recFolder, way); List<IRecorderHandler> recordersList = callRecorders.get(callId, new ArrayList<IRecorderHandler>()); recordersList.add(recoder); callRecorders.put(callId, recordersList); recoder.startRecording(); userAgentReceiver.updateRecordingStatus(callId, false, true); } catch (IOException e) { service.notifyUserOfMessage(R.string.cant_write_file); } catch (RuntimeException e) { Log.e(THIS_FILE, STR, e); } }
/** * Start recording of a call. * * @param callId the call id of the call to record * @throws SameThreadException virtual exception to be sure we are calling * this from correct thread */
Start recording of a call
startRecording
{ "repo_name": "WonderFannn/EntranceSystem", "path": "src/com/csipsimple/pjsip/PjSipService.java", "license": "lgpl-3.0", "size": 97922 }
[ "com.csipsimple.api.SipManager", "com.csipsimple.pjsip.recorder.IRecorderHandler", "com.csipsimple.pjsip.recorder.impl.SimpleWavRecorderHandler", "com.csipsimple.service.SipService", "com.csipsimple.utils.Log", "com.csipsimple.utils.PreferencesProviderWrapper", "java.io.File", "java.io.IOException", "java.util.ArrayList", "java.util.List" ]
import com.csipsimple.api.SipManager; import com.csipsimple.pjsip.recorder.IRecorderHandler; import com.csipsimple.pjsip.recorder.impl.SimpleWavRecorderHandler; import com.csipsimple.service.SipService; import com.csipsimple.utils.Log; import com.csipsimple.utils.PreferencesProviderWrapper; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List;
import com.csipsimple.api.*; import com.csipsimple.pjsip.recorder.*; import com.csipsimple.pjsip.recorder.impl.*; import com.csipsimple.service.*; import com.csipsimple.utils.*; import java.io.*; import java.util.*;
[ "com.csipsimple.api", "com.csipsimple.pjsip", "com.csipsimple.service", "com.csipsimple.utils", "java.io", "java.util" ]
com.csipsimple.api; com.csipsimple.pjsip; com.csipsimple.service; com.csipsimple.utils; java.io; java.util;
37,704
public FeatureResultSet queryFeatures(boolean distinct, BoundingBox boundingBox, Projection projection, Map<String, Object> fieldValues) { BoundingBox featureBoundingBox = projectBoundingBox(boundingBox, projection); return queryFeatures(distinct, featureBoundingBox, fieldValues); }
FeatureResultSet function(boolean distinct, BoundingBox boundingBox, Projection projection, Map<String, Object> fieldValues) { BoundingBox featureBoundingBox = projectBoundingBox(boundingBox, projection); return queryFeatures(distinct, featureBoundingBox, fieldValues); }
/** * Query for features within the bounding box in the provided projection * * @param distinct * distinct rows * @param boundingBox * bounding box * @param projection * projection * @param fieldValues * field values * @return feature results * @since 4.0.0 */
Query for features within the bounding box in the provided projection
queryFeatures
{ "repo_name": "ngageoint/geopackage-java", "path": "src/main/java/mil/nga/geopackage/extension/rtree/RTreeIndexTableDao.java", "license": "mit", "size": 349361 }
[ "java.util.Map", "mil.nga.geopackage.BoundingBox", "mil.nga.geopackage.features.user.FeatureResultSet", "mil.nga.proj.Projection" ]
import java.util.Map; import mil.nga.geopackage.BoundingBox; import mil.nga.geopackage.features.user.FeatureResultSet; import mil.nga.proj.Projection;
import java.util.*; import mil.nga.geopackage.*; import mil.nga.geopackage.features.user.*; import mil.nga.proj.*;
[ "java.util", "mil.nga.geopackage", "mil.nga.proj" ]
java.util; mil.nga.geopackage; mil.nga.proj;
1,962,330
public static Uri getCanonicalUri(Context context, Uri cast){ return cast; }
static Uri function(Context context, Uri cast){ return cast; }
/** * Gets the preferred full URI of the given cast. If it's a cast that's in a project, * returns that uri. * * Makes a single query. * * @param context * @param cast * @return the canonical URI for the given cast. */
Gets the preferred full URI of the given cast. If it's a cast that's in a project, returns that uri. Makes a single query
getCanonicalUri
{ "repo_name": "mitmel/Locast-Android-UNICEF", "path": "src/edu/mit/mobile/android/locast/data/Cast.java", "license": "gpl-2.0", "size": 4824 }
[ "android.content.Context", "android.net.Uri" ]
import android.content.Context; import android.net.Uri;
import android.content.*; import android.net.*;
[ "android.content", "android.net" ]
android.content; android.net;
279,515
protected void zipFile( ArchiveEntry entry, ZipArchiveOutputStream zOut, String vPath ) throws IOException, ArchiverException { // If the file being added is WEB-INF/web.xml, we warn if it's // not the one specified in the "webxml" attribute - or if // it's being added twice, meaning the same file is specified // by the "webxml" attribute and in a <fileset> element. if ( vPath.equalsIgnoreCase( "WEB-INF/web.xml" ) ) { if ( descriptorAdded || ( expectWebXml && ( deploymentDescriptor == null || !ResourceUtils.isCanonicalizedSame( entry.getResource(), deploymentDescriptor ) ) ) ) { getLogger().warn( "Warning: selected " + archiveType + " files include a WEB-INF/web.xml which will be ignored " + "\n(webxml attribute is missing from " + archiveType + " task, or ignoreWebxml attribute is specified as 'true')" ); } else { super.zipFile( entry, zOut, vPath ); descriptorAdded = true; } } else { super.zipFile( entry, zOut, vPath ); } }
void function( ArchiveEntry entry, ZipArchiveOutputStream zOut, String vPath ) throws IOException, ArchiverException { if ( vPath.equalsIgnoreCase( STR ) ) { if ( descriptorAdded ( expectWebXml && ( deploymentDescriptor == null !ResourceUtils.isCanonicalizedSame( entry.getResource(), deploymentDescriptor ) ) ) ) { getLogger().warn( STR + archiveType + STR + STR + archiveType + STR ); } else { super.zipFile( entry, zOut, vPath ); descriptorAdded = true; } } else { super.zipFile( entry, zOut, vPath ); } }
/** * Overridden from ZipArchiver class to deal with web.xml */
Overridden from ZipArchiver class to deal with web.xml
zipFile
{ "repo_name": "sonatype/plexus-archiver", "path": "src/main/java/org/codehaus/plexus/archiver/war/WarArchiver.java", "license": "apache-2.0", "size": 6679 }
[ "java.io.IOException", "org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream", "org.codehaus.plexus.archiver.ArchiveEntry", "org.codehaus.plexus.archiver.ArchiverException", "org.codehaus.plexus.archiver.util.ResourceUtils" ]
import java.io.IOException; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; import org.codehaus.plexus.archiver.ArchiveEntry; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.util.ResourceUtils;
import java.io.*; import org.apache.commons.compress.archivers.zip.*; import org.codehaus.plexus.archiver.*; import org.codehaus.plexus.archiver.util.*;
[ "java.io", "org.apache.commons", "org.codehaus.plexus" ]
java.io; org.apache.commons; org.codehaus.plexus;
309,799
@Nullable public String getErrorText (@Nonnull final Locale aContentLocale) { return m_eError == null ? null : m_eError.getDisplayTextWithArgs (aContentLocale, (Object []) m_aErrorParams); }
String function (@Nonnull final Locale aContentLocale) { return m_eError == null ? null : m_eError.getDisplayTextWithArgs (aContentLocale, (Object []) m_aErrorParams); }
/** * Get the error text * * @param aContentLocale * The locale to use. May not be <code>null</code>. * @return <code>null</code> if no error occurred, the error text otherwise. */
Get the error text
getErrorText
{ "repo_name": "phax/ph-commons", "path": "ph-security/src/main/java/com/helger/security/keystore/LoadedKey.java", "license": "apache-2.0", "size": 3145 }
[ "java.util.Locale", "javax.annotation.Nonnull" ]
import java.util.Locale; import javax.annotation.Nonnull;
import java.util.*; import javax.annotation.*;
[ "java.util", "javax.annotation" ]
java.util; javax.annotation;
1,702,000
public S3Object putObject(S3Bucket bucket, S3Object object) throws S3ServiceException { assertValidBucket(bucket, "Create Object in bucket"); return putObject(bucket.getName(), object); }
S3Object function(S3Bucket bucket, S3Object object) throws S3ServiceException { assertValidBucket(bucket, STR); return putObject(bucket.getName(), object); }
/** * Puts an object inside an existing bucket in S3, creating a new object or overwriting * an existing one with the same key. * <p> * This method can be performed by anonymous services. Anonymous services * can put objects into a publicly-writable bucket. * * @param bucket * the bucket inside which the object will be put, which must be valid. * @param object * the object containing all information that will be written to S3. At very least this object must * be valid. Beyond that it may contain: an input stream with the object's data content, metadata, * and access control settings.<p> * <b>Note:</b> It is very important to set the object's Content-Length to match the size of the * data input stream when possible, as this can remove the need to read data into memory to * determine its size. * * @return * the object populated with any metadata information made available by S3. * @throws S3ServiceException */
Puts an object inside an existing bucket in S3, creating a new object or overwriting an existing one with the same key. This method can be performed by anonymous services. Anonymous services can put objects into a publicly-writable bucket
putObject
{ "repo_name": "ridvandongelci/jets3t", "path": "src/org/jets3t/service/S3Service.java", "license": "apache-2.0", "size": 110321 }
[ "org.jets3t.service.model.S3Bucket", "org.jets3t.service.model.S3Object" ]
import org.jets3t.service.model.S3Bucket; import org.jets3t.service.model.S3Object;
import org.jets3t.service.model.*;
[ "org.jets3t.service" ]
org.jets3t.service;
2,017,549
public Builder valuationTime(ZonedDateTime valuationTime) { this._valuationTime = valuationTime; return this; }
Builder function(ZonedDateTime valuationTime) { this._valuationTime = valuationTime; return this; }
/** * Sets the {@code valuationTime} property in the builder. * @param valuationTime the new value * @return this, for chaining, not null */
Sets the valuationTime property in the builder
valuationTime
{ "repo_name": "jeorme/OG-Platform", "path": "sesame/sesame-engine/src/main/java/com/opengamma/sesame/server/GlobalCycleOptions.java", "license": "apache-2.0", "size": 21749 }
[ "org.threeten.bp.ZonedDateTime" ]
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.*;
[ "org.threeten.bp" ]
org.threeten.bp;
2,846,462
public CompletableFuture<List<ThreadInfoSample>> requestThreadInfoSamples( final SampleableTask task, final ThreadInfoSamplesRequest requestParams) { checkNotNull(task, "task must not be null"); checkNotNull(requestParams, "requestParams must not be null"); CompletableFuture<List<ThreadInfoSample>> resultFuture = new CompletableFuture<>(); scheduledExecutor.execute( () -> requestThreadInfoSamples( task, requestParams.getNumSamples(), requestParams.getDelayBetweenSamples(), requestParams.getMaxStackTraceDepth(), new ArrayList<>(requestParams.getNumSamples()), resultFuture)); return resultFuture; }
CompletableFuture<List<ThreadInfoSample>> function( final SampleableTask task, final ThreadInfoSamplesRequest requestParams) { checkNotNull(task, STR); checkNotNull(requestParams, STR); CompletableFuture<List<ThreadInfoSample>> resultFuture = new CompletableFuture<>(); scheduledExecutor.execute( () -> requestThreadInfoSamples( task, requestParams.getNumSamples(), requestParams.getDelayBetweenSamples(), requestParams.getMaxStackTraceDepth(), new ArrayList<>(requestParams.getNumSamples()), resultFuture)); return resultFuture; }
/** * Returns a future that completes with a given number of thread info samples of a task thread. * * @param task The task to be sampled from. * @param requestParams Parameters of the sampling request. * @return A future containing the stack trace samples. */
Returns a future that completes with a given number of thread info samples of a task thread
requestThreadInfoSamples
{ "repo_name": "tillrohrmann/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/ThreadInfoSampleService.java", "license": "apache-2.0", "size": 4765 }
[ "java.util.ArrayList", "java.util.List", "java.util.concurrent.CompletableFuture", "org.apache.flink.runtime.messages.ThreadInfoSample", "org.apache.flink.runtime.webmonitor.threadinfo.ThreadInfoSamplesRequest", "org.apache.flink.util.Preconditions" ]
import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; import org.apache.flink.runtime.messages.ThreadInfoSample; import org.apache.flink.runtime.webmonitor.threadinfo.ThreadInfoSamplesRequest; import org.apache.flink.util.Preconditions;
import java.util.*; import java.util.concurrent.*; import org.apache.flink.runtime.messages.*; import org.apache.flink.runtime.webmonitor.threadinfo.*; import org.apache.flink.util.*;
[ "java.util", "org.apache.flink" ]
java.util; org.apache.flink;
744,207
@Override public void exitClassCreatorRest(@NotNull JavaParser.ClassCreatorRestContext ctx) { }
@Override public void exitClassCreatorRest(@NotNull JavaParser.ClassCreatorRestContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
enterClassCreatorRest
{ "repo_name": "martinaguero/deep", "path": "src/org/trimatek/deep/lexer/JavaBaseListener.java", "license": "apache-2.0", "size": 39286 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
1,030,537
public void setRepository( Repository repository ) { this.repository = repository; if ( transMeta != null ) { transMeta.setRepository( repository ); } }
void function( Repository repository ) { this.repository = repository; if ( transMeta != null ) { transMeta.setRepository( repository ); } }
/** * Sets the repository object for the transformation. * * @param repository the repository object to set */
Sets the repository object for the transformation
setRepository
{ "repo_name": "e-cuellar/pentaho-kettle", "path": "engine/src/main/java/org/pentaho/di/trans/Trans.java", "license": "apache-2.0", "size": 199294 }
[ "org.pentaho.di.repository.Repository" ]
import org.pentaho.di.repository.Repository;
import org.pentaho.di.repository.*;
[ "org.pentaho.di" ]
org.pentaho.di;
2,093,297
void ref(String ref) throws IOException;
void ref(String ref) throws IOException;
/** * Notify this parse listener of a ref string. * * @param ref ref string * @throws IOException if an I/O error occurs */
Notify this parse listener of a ref string
ref
{ "repo_name": "heuermh/variation-cytoscape3-app", "path": "variation/src/main/java/org/dishevelled/variation/vcf/VcfParseListener.java", "license": "gpl-3.0", "size": 3907 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,870,166
void onOpened(RewardedAd ad);
void onOpened(RewardedAd ad);
/** * Called when a rewarded ad has been opened. * * @param ad the rewarded ad */
Called when a rewarded ad has been opened
onOpened
{ "repo_name": "deltaDNA/android-smartads-sdk", "path": "library/src/main/java/com/deltadna/android/sdk/ads/listeners/RewardedAdsListener.java", "license": "apache-2.0", "size": 1825 }
[ "com.deltadna.android.sdk.ads.RewardedAd" ]
import com.deltadna.android.sdk.ads.RewardedAd;
import com.deltadna.android.sdk.ads.*;
[ "com.deltadna.android" ]
com.deltadna.android;
2,806,078
public static boolean getUsesSharedLibraries(StructImpl info) throws EvalException { Object v = getValue(info, USES_SHARED_LIBRARIES); if (v instanceof Boolean) { return (Boolean) v; } throw Starlark.errorf( "'%s' provider's '%s' field was %s, want bool", PROVIDER_NAME, USES_SHARED_LIBRARIES, Starlark.type(v)); }
static boolean function(StructImpl info) throws EvalException { Object v = getValue(info, USES_SHARED_LIBRARIES); if (v instanceof Boolean) { return (Boolean) v; } throw Starlark.errorf( STR, PROVIDER_NAME, USES_SHARED_LIBRARIES, Starlark.type(v)); }
/** * Casts and returns the uses-shared-libraries field (or its default value). * * @throws EvalException if the field exists and is not a boolean */
Casts and returns the uses-shared-libraries field (or its default value)
getUsesSharedLibraries
{ "repo_name": "bazelbuild/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/python/PyStructUtils.java", "license": "apache-2.0", "size": 8574 }
[ "com.google.devtools.build.lib.packages.StructImpl", "net.starlark.java.eval.EvalException", "net.starlark.java.eval.Starlark" ]
import com.google.devtools.build.lib.packages.StructImpl; import net.starlark.java.eval.EvalException; import net.starlark.java.eval.Starlark;
import com.google.devtools.build.lib.packages.*; import net.starlark.java.eval.*;
[ "com.google.devtools", "net.starlark.java" ]
com.google.devtools; net.starlark.java;
2,087,147
public static boolean waitUntilTextPresent(EmergyaWebDriver driver, By selector, long seconds, String text) { log.info("[log-Utils] EmergyaWebDriverUtil - Start waitUntilTextPresent method"); WebDriverWait w = new WebDriverWait(driver, seconds); boolean retVal = true; try { w.until(ExpectedConditions.textToBePresentInElementLocated(selector, text)); } catch (TimeoutException e) { retVal = false; log.error("The text: " + text + " in the element: " + selector.toString() + " is missing in the DOM. Waiting time: " + seconds + " seconds"); } log.info("[log-Utils] EmergyaWebDriverUtil - End waitUntilTextPresent method"); return retVal; }
static boolean function(EmergyaWebDriver driver, By selector, long seconds, String text) { log.info(STR); WebDriverWait w = new WebDriverWait(driver, seconds); boolean retVal = true; try { w.until(ExpectedConditions.textToBePresentInElementLocated(selector, text)); } catch (TimeoutException e) { retVal = false; log.error(STR + text + STR + selector.toString() + STR + seconds + STR); } log.info(STR); return retVal; }
/** * It sleeps the driver for X seconds. If the text is present in element, * the execution continue without waiting X seconds * * @param driver * WebDriver element for sleep * @param selector * By element for wait * @param seconds * to be slept * @param text * to be find * @return true If the text is present in element, and false in the opposite * case */
It sleeps the driver for X seconds. If the text is present in element, the execution continue without waiting X seconds
waitUntilTextPresent
{ "repo_name": "IvanGomezDeLeon/qa-selenium-handler", "path": "src/main/java/com/emergya/selenium/drivers/EmergyaWebDriverUtil.java", "license": "mit", "size": 21168 }
[ "org.openqa.selenium.By", "org.openqa.selenium.TimeoutException", "org.openqa.selenium.support.ui.ExpectedConditions", "org.openqa.selenium.support.ui.WebDriverWait" ]
import org.openqa.selenium.By; import org.openqa.selenium.TimeoutException; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.*; import org.openqa.selenium.support.ui.*;
[ "org.openqa.selenium" ]
org.openqa.selenium;
2,478,942
static void assertDefaultDeployment(JsonObject jcos) { JsonObject jco = jobConfigOverlay(jcos); assertTrue(jco.has("deploymentConfig")); assertTrue(jco.get("deploymentConfig").isJsonObject()); // Now parall channel isolation is not set by default JsonObject deployConfig = jco.get("deploymentConfig").getAsJsonObject(); assertEquals(0, deployConfig.entrySet().size()); assertMissing(deployConfig, "fusionScheme"); assertMissing(jco, "operatorConfigs"); }
static void assertDefaultDeployment(JsonObject jcos) { JsonObject jco = jobConfigOverlay(jcos); assertTrue(jco.has(STR)); assertTrue(jco.get(STR).isJsonObject()); JsonObject deployConfig = jco.get(STR).getAsJsonObject(); assertEquals(0, deployConfig.entrySet().size()); assertMissing(deployConfig, STR); assertMissing(jco, STR); }
/** * Vanilla deployment when nothing special in the * topology exists. */
Vanilla deployment when nothing special in the topology exists
assertDefaultDeployment
{ "repo_name": "IBMStreams/streamsx.topology", "path": "test/java/src/com/ibm/streamsx/topology/test/distributed/JobConfigOverlaysFileTest.java", "license": "apache-2.0", "size": 9875 }
[ "com.google.gson.JsonObject", "org.junit.Assert" ]
import com.google.gson.JsonObject; import org.junit.Assert;
import com.google.gson.*; import org.junit.*;
[ "com.google.gson", "org.junit" ]
com.google.gson; org.junit;
106,122
public ArrayList<Clause> getClauses(){ ArrayList<Clause> result = new ArrayList<Clause>(); for(Entry<TreeSet<String>, Integer> newCard : this.newCardinalitiesToAdd.entrySet()){ ArrayList<Literal> lits = new ArrayList<Literal>(); for(String predName:newCard.getKey()){ lits.add(new Literal(predName, true)); } CardinalityClause c = new CardinalityClause(lits, formula.isLessEqual(), newCard.getValue()); result.add(c); } return result; }
ArrayList<Clause> function(){ ArrayList<Clause> result = new ArrayList<Clause>(); for(Entry<TreeSet<String>, Integer> newCard : this.newCardinalitiesToAdd.entrySet()){ ArrayList<Literal> lits = new ArrayList<Literal>(); for(String predName:newCard.getKey()){ lits.add(new Literal(predName, true)); } CardinalityClause c = new CardinalityClause(lits, formula.isLessEqual(), newCard.getValue()); result.add(c); } return result; }
/** * Returns cardinality clauses (needed for MCMC sampling) * * @return */
Returns cardinality clauses (needed for MCMC sampling)
getClauses
{ "repo_name": "mommi84/rockit", "path": "src/main/java/com/googlecode/rockit/app/solver/thread/CardinalityFormulaRestrictionBuilder.java", "license": "mit", "size": 8499 }
[ "com.googlecode.rockit.app.solver.pojo.CardinalityClause", "com.googlecode.rockit.app.solver.pojo.Clause", "com.googlecode.rockit.app.solver.pojo.Literal", "java.util.ArrayList", "java.util.Map", "java.util.TreeSet" ]
import com.googlecode.rockit.app.solver.pojo.CardinalityClause; import com.googlecode.rockit.app.solver.pojo.Clause; import com.googlecode.rockit.app.solver.pojo.Literal; import java.util.ArrayList; import java.util.Map; import java.util.TreeSet;
import com.googlecode.rockit.app.solver.pojo.*; import java.util.*;
[ "com.googlecode.rockit", "java.util" ]
com.googlecode.rockit; java.util;
1,015,440
public String toXML() { XStream xstream = XStreamInitializer.getInstance(); //涉及到服务商模式的两个参数,在为空值时置为null,以免在请求时将空值传给微信服务器 this.setSubAppId(StringUtils.trimToNull(this.getSubAppId())); this.setSubMchId(StringUtils.trimToNull(this.getSubMchId())); xstream.processAnnotations(this.getClass()); return xstream.toXML(this); }
String function() { XStream xstream = XStreamInitializer.getInstance(); this.setSubAppId(StringUtils.trimToNull(this.getSubAppId())); this.setSubMchId(StringUtils.trimToNull(this.getSubMchId())); xstream.processAnnotations(this.getClass()); return xstream.toXML(this); }
/** * To xml string. * * @return the string */
To xml string
toXML
{ "repo_name": "comeonc/weixin-java-tools", "path": "weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/BaseWxPayRequest.java", "license": "apache-2.0", "size": 7228 }
[ "com.thoughtworks.xstream.XStream", "me.chanjar.weixin.common.util.xml.XStreamInitializer", "org.apache.commons.lang3.StringUtils" ]
import com.thoughtworks.xstream.XStream; import me.chanjar.weixin.common.util.xml.XStreamInitializer; import org.apache.commons.lang3.StringUtils;
import com.thoughtworks.xstream.*; import me.chanjar.weixin.common.util.xml.*; import org.apache.commons.lang3.*;
[ "com.thoughtworks.xstream", "me.chanjar.weixin", "org.apache.commons" ]
com.thoughtworks.xstream; me.chanjar.weixin; org.apache.commons;
2,442,411
@SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testKeyValueImporter() throws Throwable { CellImporter importer = new CellImporter(); Configuration configuration = new Configuration(); Context ctx = mock(Context.class); when(ctx.getConfiguration()).thenReturn(configuration); doAnswer(new Answer<Void>() {
@SuppressWarnings({ STR, STR }) void function() throws Throwable { CellImporter importer = new CellImporter(); Configuration configuration = new Configuration(); Context ctx = mock(Context.class); when(ctx.getConfiguration()).thenReturn(configuration); doAnswer(new Answer<Void>() {
/** * Test map method of Importer */
Test map method of Importer
testKeyValueImporter
{ "repo_name": "JingchengDu/hbase", "path": "hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportExport.java", "license": "apache-2.0", "size": 30189 }
[ "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.hbase.mapreduce.Import", "org.apache.hadoop.mapreduce.Mapper", "org.mockito.Mockito", "org.mockito.stubbing.Answer" ]
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.mapreduce.Import; import org.apache.hadoop.mapreduce.Mapper; import org.mockito.Mockito; import org.mockito.stubbing.Answer;
import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.mapreduce.*; import org.apache.hadoop.mapreduce.*; import org.mockito.*; import org.mockito.stubbing.*;
[ "org.apache.hadoop", "org.mockito", "org.mockito.stubbing" ]
org.apache.hadoop; org.mockito; org.mockito.stubbing;
874,829
public Injector createChildInjector(Collection<Module> modules) { Injector childInjector; Collection<Module> localModules = modules; for (ModuleTransformer transformer : transformers) { localModules = transformer.call(localModules); } //noinspection deprecation if ( mode == LifecycleInjectorMode.REAL_CHILD_INJECTORS ) { childInjector = injector.createChildInjector(localModules); } else { childInjector = createSimulatedChildInjector(localModules); } for (PostInjectorAction action : actions) { action.call(childInjector); } return childInjector; }
Injector function(Collection<Module> modules) { Injector childInjector; Collection<Module> localModules = modules; for (ModuleTransformer transformer : transformers) { localModules = transformer.call(localModules); } if ( mode == LifecycleInjectorMode.REAL_CHILD_INJECTORS ) { childInjector = injector.createChildInjector(localModules); } else { childInjector = createSimulatedChildInjector(localModules); } for (PostInjectorAction action : actions) { action.call(childInjector); } return childInjector; }
/** * Create an injector that is a child of the bootstrap bindings only * * @param modules binding modules * @return injector */
Create an injector that is a child of the bootstrap bindings only
createChildInjector
{ "repo_name": "skinzer/governator", "path": "governator-legacy/src/main/java/com/netflix/governator/guice/LifecycleInjector.java", "license": "apache-2.0", "size": 20136 }
[ "com.google.inject.Injector", "com.google.inject.Module", "java.util.Collection" ]
import com.google.inject.Injector; import com.google.inject.Module; import java.util.Collection;
import com.google.inject.*; import java.util.*;
[ "com.google.inject", "java.util" ]
com.google.inject; java.util;
2,374,777
public void apply() { if (this.locals) { Target.this.extendLocalsBy(this.size); } else { Target.this.extendStackBy(this.size); } this.size = 0; } } public final ClassNode classNode; public final MethodNode method; public final InsnList insns; public final boolean isStatic; public final boolean isCtor; public final Type[] arguments; public final Type returnType; private final int maxStack; private final int maxLocals; private final InjectionNodes injectionNodes = new InjectionNodes(); private String callbackInfoClass; private String callbackDescriptor; private int[] argIndices; private List<Integer> argMapVars; private LabelNode start, end; private DelegateInitialiser delegateInitialiser; public Target(ClassNode classNode, MethodNode method) { this.classNode = classNode; this.method = method; this.insns = method.instructions; this.isStatic = Bytecode.isStatic(method); this.isCtor = method.name.equals(Constants.CTOR); this.arguments = Type.getArgumentTypes(method.desc); this.returnType = Type.getReturnType(method.desc); this.maxStack = method.maxStack; this.maxLocals = method.maxLocals; }
void function() { if (this.locals) { Target.this.extendLocalsBy(this.size); } else { Target.this.extendStackBy(this.size); } this.size = 0; } } public final ClassNode classNode; public final MethodNode method; public final InsnList insns; public final boolean isStatic; public final boolean isCtor; public final Type[] arguments; public final Type returnType; private final int maxStack; private final int maxLocals; private final InjectionNodes injectionNodes = new InjectionNodes(); private String callbackInfoClass; private String callbackDescriptor; private int[] argIndices; private List<Integer> argMapVars; private LabelNode start, end; private DelegateInitialiser delegateInitialiser; public Target(ClassNode classNode, MethodNode method) { this.classNode = classNode; this.method = method; this.insns = method.instructions; this.isStatic = Bytecode.isStatic(method); this.isCtor = method.name.equals(Constants.CTOR); this.arguments = Type.getArgumentTypes(method.desc); this.returnType = Type.getReturnType(method.desc); this.maxStack = method.maxStack; this.maxLocals = method.maxLocals; }
/** * Apply this extension to the target. This reduces the current size to * zero so that a new operation can begin if required. */
Apply this extension to the target. This reduces the current size to zero so that a new operation can begin if required
apply
{ "repo_name": "SpongePowered/Mixin", "path": "src/main/java/org/spongepowered/asm/mixin/injection/struct/Target.java", "license": "mit", "size": 26658 }
[ "java.util.List", "org.objectweb.asm.Type", "org.objectweb.asm.tree.ClassNode", "org.objectweb.asm.tree.InsnList", "org.objectweb.asm.tree.LabelNode", "org.objectweb.asm.tree.MethodNode", "org.spongepowered.asm.util.Bytecode", "org.spongepowered.asm.util.Constants" ]
import java.util.List; import org.objectweb.asm.Type; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.InsnList; import org.objectweb.asm.tree.LabelNode; import org.objectweb.asm.tree.MethodNode; import org.spongepowered.asm.util.Bytecode; import org.spongepowered.asm.util.Constants;
import java.util.*; import org.objectweb.asm.*; import org.objectweb.asm.tree.*; import org.spongepowered.asm.util.*;
[ "java.util", "org.objectweb.asm", "org.spongepowered.asm" ]
java.util; org.objectweb.asm; org.spongepowered.asm;
2,443,489
@Override public java.math.BigDecimal getQtyReserved_OnDate () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyReserved_OnDate); if (bd == null) return BigDecimal.ZERO; return bd; }
java.math.BigDecimal function () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyReserved_OnDate); if (bd == null) return BigDecimal.ZERO; return bd; }
/** Get Reservierte Menge Tag. @return Reservierte Menge Tag */
Get Reservierte Menge Tag
getQtyReserved_OnDate
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.fresh/de.metas.fresh.base/src/main/java-gen/de/metas/fresh/model/X_X_MRP_ProductInfo_V.java", "license": "gpl-2.0", "size": 12341 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
489,379
@Test public void testPersistentPRWithGatewaySenderPersistenceEnabled_Restart2() { // create locator on local site Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1)); // create locator on remote site Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort)); // create cache in local site createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); // create senders with disk store String diskStore1 = (String) vm4.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, null, false)); String diskStore2 = (String) vm5.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, null, false)); String diskStore3 = (String) vm6.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, null, false)); String diskStore4 = (String) vm7.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, null, false)); LogWriterUtils.getLogWriter() .info("The DS are: " + diskStore1 + "," + diskStore2 + "," + diskStore3 + "," + diskStore4); // create PR on local site vm4.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); vm5.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); vm6.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); vm7.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); // start the senders on local site startSenderInVMs("ln", vm4, vm5, vm6, vm7); // wait for senders to become running vm4.invoke(waitForSenderRunnable()); vm5.invoke(waitForSenderRunnable()); vm6.invoke(waitForSenderRunnable()); vm7.invoke(waitForSenderRunnable()); // pause the senders vm4.invoke(pauseSenderRunnable()); vm5.invoke(pauseSenderRunnable()); vm6.invoke(pauseSenderRunnable()); vm7.invoke(pauseSenderRunnable()); // start puts in region on local site vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName(), 300)); LogWriterUtils.getLogWriter().info("Completed puts in the region"); // --------------------close and rebuild local site // ------------------------------------------------- // kill the senders vm4.invoke(killSenderRunnable()); vm5.invoke(killSenderRunnable()); vm6.invoke(killSenderRunnable()); vm7.invoke(killSenderRunnable()); LogWriterUtils.getLogWriter().info("Killed all the senders."); // restart the vm createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); LogWriterUtils.getLogWriter().info("Created back the cache"); // create senders with disk store vm4.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, diskStore1, true)); vm5.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, diskStore2, true)); vm6.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, diskStore3, true)); vm7.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, diskStore4, true)); LogWriterUtils.getLogWriter().info("Created the senders back from the disk store."); // create PR on local site AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); try { inv1.join(); inv2.join(); inv3.join(); inv4.join(); } catch (InterruptedException e) { e.printStackTrace(); fail(); } LogWriterUtils.getLogWriter().info("Created back the partitioned regions"); // start the senders in async mode. This will ensure that the // node of shadow PR that went down last will come up first startSenderInVMsAsync("ln", vm4, vm5, vm6, vm7); LogWriterUtils.getLogWriter().info("Waiting for senders running."); // wait for senders running vm4.invoke(waitForSenderRunnable()); vm5.invoke(waitForSenderRunnable()); vm6.invoke(waitForSenderRunnable()); vm7.invoke(waitForSenderRunnable()); LogWriterUtils.getLogWriter().info("Creating the receiver."); // create receiver on remote site createCacheInVMs(nyPort, vm2, vm3); // create PR on remote site LogWriterUtils.getLogWriter().info("Creating the partitioned region at receiver. "); vm2.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), null, 1, 100, isOffHeap())); vm3.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), null, 1, 100, isOffHeap())); createReceiverInVMs(vm2, vm3); vm4.invoke(pauseSenderRunnable()); vm5.invoke(pauseSenderRunnable()); vm6.invoke(pauseSenderRunnable()); vm7.invoke(pauseSenderRunnable()); LogWriterUtils.getLogWriter().info("Doing some extra puts. "); // start puts in region on local site vm4.invoke(() -> WANTestBase.doPutsAfter300(getTestMethodName(), 1000)); // ---------------------------------------------------------------------------------------------------- vm4.invoke(() -> WANTestBase.resumeSender("ln")); vm5.invoke(() -> WANTestBase.resumeSender("ln")); vm6.invoke(() -> WANTestBase.resumeSender("ln")); vm7.invoke(() -> WANTestBase.resumeSender("ln")); LogWriterUtils.getLogWriter().info("Validating the region size at the receiver end. "); vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 1000)); vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 1000)); }
void function() { Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1)); Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort)); createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); String diskStore1 = (String) vm4.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, null, false)); String diskStore2 = (String) vm5.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, null, false)); String diskStore3 = (String) vm6.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, null, false)); String diskStore4 = (String) vm7.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, null, false)); LogWriterUtils.getLogWriter() .info(STR + diskStore1 + "," + diskStore2 + "," + diskStore3 + "," + diskStore4); vm4.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); vm5.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); vm6.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); vm7.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); startSenderInVMs("ln", vm4, vm5, vm6, vm7); vm4.invoke(waitForSenderRunnable()); vm5.invoke(waitForSenderRunnable()); vm6.invoke(waitForSenderRunnable()); vm7.invoke(waitForSenderRunnable()); vm4.invoke(pauseSenderRunnable()); vm5.invoke(pauseSenderRunnable()); vm6.invoke(pauseSenderRunnable()); vm7.invoke(pauseSenderRunnable()); vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName(), 300)); LogWriterUtils.getLogWriter().info(STR); vm4.invoke(killSenderRunnable()); vm5.invoke(killSenderRunnable()); vm6.invoke(killSenderRunnable()); vm7.invoke(killSenderRunnable()); LogWriterUtils.getLogWriter().info(STR); createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); LogWriterUtils.getLogWriter().info(STR); vm4.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, diskStore1, true)); vm5.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, diskStore2, true)); vm6.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, diskStore3, true)); vm7.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, true, 100, 10, false, true, null, diskStore4, true)); LogWriterUtils.getLogWriter().info(STR); AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); try { inv1.join(); inv2.join(); inv3.join(); inv4.join(); } catch (InterruptedException e) { e.printStackTrace(); fail(); } LogWriterUtils.getLogWriter().info(STR); startSenderInVMsAsync("ln", vm4, vm5, vm6, vm7); LogWriterUtils.getLogWriter().info(STR); vm4.invoke(waitForSenderRunnable()); vm5.invoke(waitForSenderRunnable()); vm6.invoke(waitForSenderRunnable()); vm7.invoke(waitForSenderRunnable()); LogWriterUtils.getLogWriter().info(STR); createCacheInVMs(nyPort, vm2, vm3); LogWriterUtils.getLogWriter().info(STR); vm2.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), null, 1, 100, isOffHeap())); vm3.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), null, 1, 100, isOffHeap())); createReceiverInVMs(vm2, vm3); vm4.invoke(pauseSenderRunnable()); vm5.invoke(pauseSenderRunnable()); vm6.invoke(pauseSenderRunnable()); vm7.invoke(pauseSenderRunnable()); LogWriterUtils.getLogWriter().info(STR); vm4.invoke(() -> WANTestBase.doPutsAfter300(getTestMethodName(), 1000)); vm4.invoke(() -> WANTestBase.resumeSender("ln")); vm5.invoke(() -> WANTestBase.resumeSender("ln")); vm6.invoke(() -> WANTestBase.resumeSender("ln")); vm7.invoke(() -> WANTestBase.resumeSender("ln")); LogWriterUtils.getLogWriter().info(STR); vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 1000)); vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 1000)); }
/** * Enable persistence for PR and GatewaySender. Pause the sender and do some puts in local region. * Close the local site and rebuild the region and sender from disk store. Dispatcher should not * start dispatching events recovered from persistent sender. Check if the remote site receives * all the events. */
Enable persistence for PR and GatewaySender. Pause the sender and do some puts in local region. Close the local site and rebuild the region and sender from disk store. Dispatcher should not start dispatching events recovered from persistent sender. Check if the remote site receives all the events
testPersistentPRWithGatewaySenderPersistenceEnabled_Restart2
{ "repo_name": "smgoller/geode", "path": "geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java", "license": "apache-2.0", "size": 97446 }
[ "org.apache.geode.internal.cache.wan.WANTestBase", "org.apache.geode.test.dunit.AsyncInvocation", "org.apache.geode.test.dunit.LogWriterUtils", "org.junit.Assert" ]
import org.apache.geode.internal.cache.wan.WANTestBase; import org.apache.geode.test.dunit.AsyncInvocation; import org.apache.geode.test.dunit.LogWriterUtils; import org.junit.Assert;
import org.apache.geode.internal.cache.wan.*; import org.apache.geode.test.dunit.*; import org.junit.*;
[ "org.apache.geode", "org.junit" ]
org.apache.geode; org.junit;
1,745,063
public List<TextDescription> getTextContentList() { return getTextList(); }
List<TextDescription> function() { return getTextList(); }
/** * Return the List of all the added texts. The returned List is a list of String. */
Return the List of all the added texts. The returned List is a list of String
getTextContentList
{ "repo_name": "ebonnet/Silverpeas-Core", "path": "core-library/src/main/java/org/silverpeas/core/index/indexing/model/FullIndexEntry.java", "license": "agpl-3.0", "size": 7039 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,891,461
T parseObject(String value, ExceptionInterceptor exceptionInterceptor);
T parseObject(String value, ExceptionInterceptor exceptionInterceptor);
/** * Returns the value object parsed from it's string representation and checked against allowable values. * * @param value * value * @param exceptionInterceptor * exception interceptor * * @return the value object */
Returns the value object parsed from it's string representation and checked against allowable values
parseObject
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/mysql-connector/com/mysql/cj/conf/PropertyDefinition.java", "license": "gpl-2.0", "size": 4446 }
[ "com.mysql.cj.exceptions.ExceptionInterceptor" ]
import com.mysql.cj.exceptions.ExceptionInterceptor;
import com.mysql.cj.exceptions.*;
[ "com.mysql.cj" ]
com.mysql.cj;
46,231
public static DataResult <SystemOverview> systemsNotInGroup(User user, ServerGroup sg, PageControl pc) { SelectMode m = ModeFactory.getMode("System_queries", "target_systems_for_group"); Map<String, Object> params = new HashMap<String, Object>(); params.put("user_id", user.getId()); params.put("sgid", sg.getId()); Map<String, Object> elabParams = new HashMap<String, Object>(); return makeDataResult(params, elabParams, pc, m, SystemOverview.class); }
static DataResult <SystemOverview> function(User user, ServerGroup sg, PageControl pc) { SelectMode m = ModeFactory.getMode(STR, STR); Map<String, Object> params = new HashMap<String, Object>(); params.put(STR, user.getId()); params.put("sgid", sg.getId()); Map<String, Object> elabParams = new HashMap<String, Object>(); return makeDataResult(params, elabParams, pc, m, SystemOverview.class); }
/** * Returns list of all systems that are visible to user * but not in the given server group. * @param user Currently logged in user. * @param sg a ServerGroup * @param pc PageControl * @return list of SystemOverviews. */
Returns list of all systems that are visible to user but not in the given server group
systemsNotInGroup
{ "repo_name": "mcalmer/spacewalk", "path": "java/code/src/com/redhat/rhn/manager/system/SystemManager.java", "license": "gpl-2.0", "size": 134651 }
[ "com.redhat.rhn.common.db.datasource.DataResult", "com.redhat.rhn.common.db.datasource.ModeFactory", "com.redhat.rhn.common.db.datasource.SelectMode", "com.redhat.rhn.domain.server.ServerGroup", "com.redhat.rhn.domain.user.User", "com.redhat.rhn.frontend.dto.SystemOverview", "com.redhat.rhn.frontend.listview.PageControl", "java.util.HashMap", "java.util.Map" ]
import com.redhat.rhn.common.db.datasource.DataResult; import com.redhat.rhn.common.db.datasource.ModeFactory; import com.redhat.rhn.common.db.datasource.SelectMode; import com.redhat.rhn.domain.server.ServerGroup; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.dto.SystemOverview; import com.redhat.rhn.frontend.listview.PageControl; import java.util.HashMap; import java.util.Map;
import com.redhat.rhn.common.db.datasource.*; import com.redhat.rhn.domain.server.*; import com.redhat.rhn.domain.user.*; import com.redhat.rhn.frontend.dto.*; import com.redhat.rhn.frontend.listview.*; import java.util.*;
[ "com.redhat.rhn", "java.util" ]
com.redhat.rhn; java.util;
1,043,592
public void removeAllConflict(Map<KeyCacheObject, GridCacheVersion> drMap) throws IgniteCheckedException;
void function(Map<KeyCacheObject, GridCacheVersion> drMap) throws IgniteCheckedException;
/** * Removes DR data. * * @param drMap DR map. * @throws IgniteCheckedException If remove failed. */
Removes DR data
removeAllConflict
{ "repo_name": "chandresh-pancholi/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java", "license": "apache-2.0", "size": 86608 }
[ "java.util.Map", "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.internal.processors.cache.version.GridCacheVersion" ]
import java.util.Map; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.processors.cache.version.GridCacheVersion;
import java.util.*; import org.apache.ignite.*; import org.apache.ignite.internal.processors.cache.version.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
758,360
public List<?> getEntriesByParentId(String parentId) { return db.getEntriesByParentId(parentId); }
List<?> function(String parentId) { return db.getEntriesByParentId(parentId); }
/** * API method. Returns the entries that are children of the parent. If the * `parentId` is null or blank then null is returned. */
API method. Returns the entries that are children of the parent. If the `parentId` is null or blank then null is returned
getEntriesByParentId
{ "repo_name": "ZapBlasterson/crushpaper", "path": "src/main/java/com/crushpaper/DbLogic.java", "license": "agpl-3.0", "size": 86473 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,497,883
public Bundle getExtras() { return mBundle.getBundle(KEY_EXTRAS); }
Bundle function() { return mBundle.getBundle(KEY_EXTRAS); }
/** * Gets a bundle of extras for this status object. * The extras will be ignored by the media router but they may be used * by applications. */
Gets a bundle of extras for this status object. The extras will be ignored by the media router but they may be used by applications
getExtras
{ "repo_name": "aosp-mirror/platform_frameworks_support", "path": "mediarouter/src/main/java/androidx/mediarouter/media/MediaSessionStatus.java", "license": "apache-2.0", "size": 8193 }
[ "android.os.Bundle" ]
import android.os.Bundle;
import android.os.*;
[ "android.os" ]
android.os;
944,910
public void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy) { this.headerFilterStrategy = headerFilterStrategy; if (cxfBinding instanceof HeaderFilterStrategyAware) { ((HeaderFilterStrategyAware) cxfBinding).setHeaderFilterStrategy(headerFilterStrategy); } }
void function(HeaderFilterStrategy headerFilterStrategy) { this.headerFilterStrategy = headerFilterStrategy; if (cxfBinding instanceof HeaderFilterStrategyAware) { ((HeaderFilterStrategyAware) cxfBinding).setHeaderFilterStrategy(headerFilterStrategy); } }
/** * To use a custom HeaderFilterStrategy to filter header to and from Camel message. */
To use a custom HeaderFilterStrategy to filter header to and from Camel message
setHeaderFilterStrategy
{ "repo_name": "erwelch/camel", "path": "components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java", "license": "apache-2.0", "size": 50799 }
[ "org.apache.camel.spi.HeaderFilterStrategy", "org.apache.camel.spi.HeaderFilterStrategyAware" ]
import org.apache.camel.spi.HeaderFilterStrategy; import org.apache.camel.spi.HeaderFilterStrategyAware;
import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
2,350,561
if (transform instanceof AffineTransform) { return new ParameterizedAffine((AffineTransform) transform, parameters, false); } else { return transform; } }
if (transform instanceof AffineTransform) { return new ParameterizedAffine((AffineTransform) transform, parameters, false); } else { return transform; } }
/** * Returns the given transform associated to the same parameters than this {@code ParameterizedAffine}, * if possible. If the given transform is not affine, then it is returned unchanged. * * @param transform the transform to be at least partially described by {@link #parameters}. * @return a copy of the given affine transform associated to the parameter of this object, * or the given transform unchanged if it was not affine. */
Returns the given transform associated to the same parameters than this ParameterizedAffine, if possible. If the given transform is not affine, then it is returned unchanged
newTransform
{ "repo_name": "Geomatys/sis", "path": "core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java", "license": "apache-2.0", "size": 8465 }
[ "java.awt.geom.AffineTransform" ]
import java.awt.geom.AffineTransform;
import java.awt.geom.*;
[ "java.awt" ]
java.awt;
2,610,382
public Element getRow(int row) { if (row < 0) { return null; } return getRows().getItem(row); }
Element function(int row) { if (row < 0) { return null; } return getRows().getItem(row); }
/** * Return the &lt;TR> HtmlElement which represents a Grid row for the * specified index. * * @param row * the row index * @return the &lt;TR> element */
Return the &lt;TR> HtmlElement which represents a Grid row for the specified index
getRow
{ "repo_name": "ezoengine/GKEngine", "path": "main/gxt/src/com/extjs/gxt/ui/client/widget/grid/GridView.java", "license": "gpl-3.0", "size": 62850 }
[ "com.google.gwt.dom.client.Element" ]
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.*;
[ "com.google.gwt" ]
com.google.gwt;
2,138,692
public ClasspathBuilder addJarOf(Class c) throws IOException { return add(Which.jarFile(c)); }
ClasspathBuilder function(Class c) throws IOException { return add(Which.jarFile(c)); }
/** * Adds a jar file that contains the given class. * @since 1.361 */
Adds a jar file that contains the given class
addJarOf
{ "repo_name": "rsandell/jenkins", "path": "core/src/main/java/hudson/util/ClasspathBuilder.java", "license": "mit", "size": 1614 }
[ "hudson.remoting.Which", "java.io.IOException" ]
import hudson.remoting.Which; import java.io.IOException;
import hudson.remoting.*; import java.io.*;
[ "hudson.remoting", "java.io" ]
hudson.remoting; java.io;
1,090,005
private void merge(@Nonnull final Map<String, Object> destination, @Nonnull final Map<String, Object> source, @Nullable final String prefix) { for (final Map.Entry<String, Object> entry : source.entrySet()) { final String key = entry.getKey(); final Object value = entry.getValue(); if (destination.containsKey(key)) { final String newPrefix = (prefix != null) ? prefix + "." + key : key; if (destination.get(key) instanceof Map && value instanceof Map) { //noinspection unchecked merge((Map<String, Object>) destination.get(key), (Map<String, Object>) value, newPrefix); } else if (prefix != null || "!name".equals(key)) { log.info("Ignoring duplicate Spark function key: {}", newPrefix); } } else { destination.put(key, value); } } }
void function(@Nonnull final Map<String, Object> destination, @Nonnull final Map<String, Object> source, @Nullable final String prefix) { for (final Map.Entry<String, Object> entry : source.entrySet()) { final String key = entry.getKey(); final Object value = entry.getValue(); if (destination.containsKey(key)) { final String newPrefix = (prefix != null) ? prefix + "." + key : key; if (destination.get(key) instanceof Map && value instanceof Map) { merge((Map<String, Object>) destination.get(key), (Map<String, Object>) value, newPrefix); } else if (prefix != null "!name".equals(key)) { log.info(STR, newPrefix); } } else { destination.put(key, value); } } }
/** * Merges members of the source map into the destination map. * * @param destination the destination map * @param source the source map * @param prefix a key prefix for reporting errors */
Merges members of the source map into the destination map
merge
{ "repo_name": "claudiu-stanciu/kylo", "path": "ui/ui-controller/src/main/java/com/thinkbiganalytics/ui/service/StandardUiTemplateService.java", "license": "apache-2.0", "size": 8463 }
[ "java.util.Map", "javax.annotation.Nonnull", "javax.annotation.Nullable" ]
import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable;
import java.util.*; import javax.annotation.*;
[ "java.util", "javax.annotation" ]
java.util; javax.annotation;
1,399,274
public void setPassword(final String psw) { if (StringUtils.isNotBlank(psw)) { LOGGER.debug("Configured Jasypt password"); jasyptInstance.setPassword(psw); } }
void function(final String psw) { if (StringUtils.isNotBlank(psw)) { LOGGER.debug(STR); jasyptInstance.setPassword(psw); } }
/** * Sets password. * * @param psw the psw */
Sets password
setPassword
{ "repo_name": "rkorn86/cas", "path": "api/cas-server-core-api-configuration-model/src/main/java/org/apereo/cas/configuration/support/CasConfigurationJasyptCipherExecutor.java", "license": "apache-2.0", "size": 9252 }
[ "org.apache.commons.lang3.StringUtils" ]
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.*;
[ "org.apache.commons" ]
org.apache.commons;
1,523,331
private void parseIncludeAttributes(String layoutFile, AXmlNode rootNode) { for (Entry<String, AXmlAttribute<?>> entry : rootNode.getAttributes().entrySet()) { String attrName = entry.getKey().trim(); AXmlAttribute<?> attr = entry.getValue(); if (attrName.equals("layout")) { if ((attr.getType() == AxmlVisitor.TYPE_REFERENCE || attr.getType() == AxmlVisitor.TYPE_INT_HEX) && attr.getValue() instanceof Integer) { // We need to get the target XML file from the binary manifest AbstractResource targetRes = resParser.findResource((Integer) attr.getValue()); if (targetRes == null) { System.err.println("Target resource " + attr.getValue() + " for layout include not found"); return; } if (!(targetRes instanceof StringResource)) { System.err.println("Invalid target node for include tag in layout XML, was " + targetRes.getClass().getName()); return; } String targetFile = ((StringResource) targetRes).getValue(); // If we have already processed the target file, we can // simply copy the callbacks we have found there if (callbackMethods.containsKey(targetFile)) for (String callback : callbackMethods.get(targetFile)) addCallbackMethod(layoutFile, callback); else { // We need to record a dependency to resolve later addToMapSet(includeDependencies, targetFile, layoutFile); } } } } }
void function(String layoutFile, AXmlNode rootNode) { for (Entry<String, AXmlAttribute<?>> entry : rootNode.getAttributes().entrySet()) { String attrName = entry.getKey().trim(); AXmlAttribute<?> attr = entry.getValue(); if (attrName.equals(STR)) { if ((attr.getType() == AxmlVisitor.TYPE_REFERENCE attr.getType() == AxmlVisitor.TYPE_INT_HEX) && attr.getValue() instanceof Integer) { AbstractResource targetRes = resParser.findResource((Integer) attr.getValue()); if (targetRes == null) { System.err.println(STR + attr.getValue() + STR); return; } if (!(targetRes instanceof StringResource)) { System.err.println(STR + targetRes.getClass().getName()); return; } String targetFile = ((StringResource) targetRes).getValue(); if (callbackMethods.containsKey(targetFile)) for (String callback : callbackMethods.get(targetFile)) addCallbackMethod(layoutFile, callback); else { addToMapSet(includeDependencies, targetFile, layoutFile); } } } } }
/** * Parses the attributes required for a layout file inclusion * @param layoutFile The full path and file name of the file being parsed * @param rootNode The AXml node containing the attributes */
Parses the attributes required for a layout file inclusion
parseIncludeAttributes
{ "repo_name": "lilicoding/soot-infoflow-android", "path": "src/soot/jimple/infoflow/android/resources/LayoutFileParser.java", "license": "lgpl-2.1", "size": 15536 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,210,659
public static void removeSignatureGraphs(Dataset dataset) { for (String name : RdfUtils.getModelNames(dataset)) { if (WonRdfUtils.SignatureUtils.isSignatureGraph(name, dataset.getNamedModel(name))) { dataset.removeNamedModel(name); } } }
static void function(Dataset dataset) { for (String name : RdfUtils.getModelNames(dataset)) { if (WonRdfUtils.SignatureUtils.isSignatureGraph(name, dataset.getNamedModel(name))) { dataset.removeNamedModel(name); } } }
/** * Removes signature graphs from the Dataset. Can be useful to use after * verification is done, when the signatures are no longer required for further * actions on the signed data of the Dataset. * * @param dataset from which graphs representing signatures have to be removed */
Removes signature graphs from the Dataset. Can be useful to use after verification is done, when the signatures are no longer required for further actions on the signed data of the Dataset
removeSignatureGraphs
{ "repo_name": "researchstudio-sat/webofneeds", "path": "webofneeds/won-cryptography/src/main/java/won/cryptography/rdfsign/WonAssembler.java", "license": "apache-2.0", "size": 10000 }
[ "org.apache.jena.query.Dataset" ]
import org.apache.jena.query.Dataset;
import org.apache.jena.query.*;
[ "org.apache.jena" ]
org.apache.jena;
2,717,626
public static <T> T maxWith( @This Iterable<T> thiz, Comparator<T> comparator ) { Iterator<T> iterator = thiz.iterator(); if( !iterator.hasNext() ) { return null; } T max = iterator.next(); while( iterator.hasNext() ) { T e = iterator.next(); if( comparator.compare( max, e ) < 0 ) { max = e; } } return max; }
static <T> T function( @This Iterable<T> thiz, Comparator<T> comparator ) { Iterator<T> iterator = thiz.iterator(); if( !iterator.hasNext() ) { return null; } T max = iterator.next(); while( iterator.hasNext() ) { T e = iterator.next(); if( comparator.compare( max, e ) < 0 ) { max = e; } } return max; }
/** * Returns the first element having the largest value according to the provided {@code comparator} or {@code null} if there are no elements. */
Returns the first element having the largest value according to the provided comparator or null if there are no elements
maxWith
{ "repo_name": "manifold-systems/manifold", "path": "manifold-deps-parent/manifold-collections/src/main/java/manifold/collections/extensions/java/lang/Iterable/ManIterableExt.java", "license": "apache-2.0", "size": 25260 }
[ "java.util.Comparator", "java.util.Iterator" ]
import java.util.Comparator; import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
767,043
public static void drawColoredCube(Vector3Cube vector) { // Top side GL11.glColor3f(1.0F, 0.0F, 0.0F); GL11.glNormal3d(0, 1, 0); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMaxZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMaxZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMinZ()); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMinZ()); // Bottom side GL11.glColor3f(1.0F, 1.0F, 0.0F); GL11.glNormal3d(0, -1, 0); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMaxZ()); addVertex(vector.getMinX(), vector.getMinY(), vector.getMaxZ()); addVertex(vector.getMinX(), vector.getMinY(), vector.getMinZ()); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMinZ()); // Draw west side: GL11.glColor3f(0.0F, 1.0F, 0.0F); GL11.glNormal3d(-1, 0, 0); addVertex(vector.getMinX(), vector.getMinY(), vector.getMaxZ()); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMaxZ()); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMinZ()); addVertex(vector.getMinX(), vector.getMinY(), vector.getMinZ()); // Draw east side: GL11.glColor3f(0.0F, 1.0F, 1.0F); GL11.glNormal3d(1, 0, 0); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMinZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMinZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMaxZ()); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMaxZ()); // Draw north side GL11.glColor3f(0.0F, 0.0F, 1.0F); GL11.glNormal3d(0, 0, -1); addVertex(vector.getMinX(), vector.getMinY(), vector.getMinZ()); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMinZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMinZ()); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMinZ()); // Draw south side GL11.glColor3f(0.0F, 0.0F, 0.0F); GL11.glNormal3d(0, 0, 1); addVertex(vector.getMinX(), vector.getMinY(), vector.getMaxZ()); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMaxZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMaxZ()); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMaxZ()); }
static void function(Vector3Cube vector) { GL11.glColor3f(1.0F, 0.0F, 0.0F); GL11.glNormal3d(0, 1, 0); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMaxZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMaxZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMinZ()); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMinZ()); GL11.glColor3f(1.0F, 1.0F, 0.0F); GL11.glNormal3d(0, -1, 0); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMaxZ()); addVertex(vector.getMinX(), vector.getMinY(), vector.getMaxZ()); addVertex(vector.getMinX(), vector.getMinY(), vector.getMinZ()); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMinZ()); GL11.glColor3f(0.0F, 1.0F, 0.0F); GL11.glNormal3d(-1, 0, 0); addVertex(vector.getMinX(), vector.getMinY(), vector.getMaxZ()); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMaxZ()); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMinZ()); addVertex(vector.getMinX(), vector.getMinY(), vector.getMinZ()); GL11.glColor3f(0.0F, 1.0F, 1.0F); GL11.glNormal3d(1, 0, 0); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMinZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMinZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMaxZ()); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMaxZ()); GL11.glColor3f(0.0F, 0.0F, 1.0F); GL11.glNormal3d(0, 0, -1); addVertex(vector.getMinX(), vector.getMinY(), vector.getMinZ()); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMinZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMinZ()); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMinZ()); GL11.glColor3f(0.0F, 0.0F, 0.0F); GL11.glNormal3d(0, 0, 1); addVertex(vector.getMinX(), vector.getMinY(), vector.getMaxZ()); addVertex(vector.getMaxX(), vector.getMinY(), vector.getMaxZ()); addVertex(vector.getMaxX(), vector.getMaxY(), vector.getMaxZ()); addVertex(vector.getMinX(), vector.getMaxY(), vector.getMaxZ()); }
/** * Draws a colored cube with the size of vector. Every face has a different color This uses OpenGL * * @author Koen Beckers (K4Unl) * @param vector */
Draws a colored cube with the size of vector. Every face has a different color This uses OpenGL
drawColoredCube
{ "repo_name": "raulsmail/GlowPower", "path": "src/main/java/com/bluepowermod/client/renderers/RenderHelper.java", "license": "gpl-3.0", "size": 32210 }
[ "com.bluepowermod.api.vec.Vector3Cube" ]
import com.bluepowermod.api.vec.Vector3Cube;
import com.bluepowermod.api.vec.*;
[ "com.bluepowermod.api" ]
com.bluepowermod.api;
2,287,078
public void testJavascriptHelperDefAreSerializable() throws Exception { HelperDef hlprDef = Aura.getDefinitionService().getDefinition("js://test.test_SimpleHelper", HelperDef.class); assertNotNull("Failed to extract helper def on component.", hlprDef); this.serializeAndGoldFile(hlprDef); }
void function() throws Exception { HelperDef hlprDef = Aura.getDefinitionService().getDefinition(STRFailed to extract helper def on component.", hlprDef); this.serializeAndGoldFile(hlprDef); }
/** * Verify that javascript helper defs are serializable. * * @throws Exception */
Verify that javascript helper defs are serializable
testJavascriptHelperDefAreSerializable
{ "repo_name": "lhong375/aura", "path": "aura-impl/src/test/java/org/auraframework/impl/helper/JavascriptHelperDefTest.java", "license": "apache-2.0", "size": 2290 }
[ "org.auraframework.Aura", "org.auraframework.def.HelperDef" ]
import org.auraframework.Aura; import org.auraframework.def.HelperDef;
import org.auraframework.*; import org.auraframework.def.*;
[ "org.auraframework", "org.auraframework.def" ]
org.auraframework; org.auraframework.def;
521,178
public void setWidgetFieldFlags(int f) { field.setInt(COSName.F, f); }
void function(int f) { field.setInt(COSName.F, f); }
/** * This will get the field flags that are associated with this field. The F entry in the FDF field dictionary. * * @param f The new value for the field flags. */
This will get the field flags that are associated with this field. The F entry in the FDF field dictionary
setWidgetFieldFlags
{ "repo_name": "gavanx/pdflearn", "path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFField.java", "license": "apache-2.0", "size": 20329 }
[ "org.apache.pdfbox.cos.COSName" ]
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.cos.*;
[ "org.apache.pdfbox" ]
org.apache.pdfbox;
652,513
public static long getLong(Field field) { return Reflective.getLong(field); }
static long function(Field field) { return Reflective.getLong(field); }
/** * Gets the value of a static <code>long</code> field. * * @param field Field object whose value is returned. * @return the value of the <code>long</code> field */
Gets the value of a static <code>long</code> field
getLong
{ "repo_name": "haitaoyao/btrace", "path": "src/share/classes/com/sun/btrace/BTraceUtils.java", "license": "gpl-2.0", "size": 234341 }
[ "java.lang.reflect.Field" ]
import java.lang.reflect.Field;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,733,889
@SuppressWarnings("unchecked") private Collection<ValidRates> getValidRatesForFandA(String rateTypeOnOrOff, ScaleTwoDecimal rate){ Map<String, Object> rateValues = new HashMap<String, Object>(); rateValues.put(rateTypeOnOrOff, rate); rateValues.put(RATE_CLASS_TYPE, FANDA_RATE_CLASS_TYPE); return (Collection<ValidRates>) getKraBusinessObjectService().findMatching(ValidRates.class, rateValues); }
@SuppressWarnings(STR) Collection<ValidRates> function(String rateTypeOnOrOff, ScaleTwoDecimal rate){ Map<String, Object> rateValues = new HashMap<String, Object>(); rateValues.put(rateTypeOnOrOff, rate); rateValues.put(RATE_CLASS_TYPE, FANDA_RATE_CLASS_TYPE); return (Collection<ValidRates>) getKraBusinessObjectService().findMatching(ValidRates.class, rateValues); }
/** * This method returns the valid rates from valid rates table that match the rates attached to the award. * @return */
This method returns the valid rates from valid rates table that match the rates attached to the award
getValidRatesForFandA
{ "repo_name": "blackcathacker/kc.preclean", "path": "coeus-code/src/main/java/org/kuali/kra/award/commitments/AwardFandaRateRule.java", "license": "apache-2.0", "size": 19069 }
[ "java.util.Collection", "java.util.HashMap", "java.util.Map", "org.kuali.coeus.sys.api.model.ScaleTwoDecimal", "org.kuali.kra.award.home.ValidRates" ]
import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.kuali.coeus.sys.api.model.ScaleTwoDecimal; import org.kuali.kra.award.home.ValidRates;
import java.util.*; import org.kuali.coeus.sys.api.model.*; import org.kuali.kra.award.home.*;
[ "java.util", "org.kuali.coeus", "org.kuali.kra" ]
java.util; org.kuali.coeus; org.kuali.kra;
2,101,586
public void onShowFlags(CommandSender sender, String name) { if ( name == null) name = sender.getName(); name = name.toLowerCase(); VanishConfig cfg = getVanishConfig(name, false); if (cfg != null){ if (!cfg.needsSave()) { sender.sendMessage(SimplyVanish.msgDefaultFlags); } else { sender.sendMessage(SimplyVanish.msgLabel+ChatColor.GRAY+"Flags("+name+"): " + cfg.toLine()); } } else { sender.sendMessage(SimplyVanish.msgDefaultFlags); } }
void function(CommandSender sender, String name) { if ( name == null) name = sender.getName(); name = name.toLowerCase(); VanishConfig cfg = getVanishConfig(name, false); if (cfg != null){ if (!cfg.needsSave()) { sender.sendMessage(SimplyVanish.msgDefaultFlags); } else { sender.sendMessage(SimplyVanish.msgLabel+ChatColor.GRAY+STR+name+STR + cfg.toLine()); } } else { sender.sendMessage(SimplyVanish.msgDefaultFlags); } }
/** * Show flags for name to sender, or use the senders name, if name is null. * @param sender * @param name */
Show flags for name to sender, or use the senders name, if name is null
onShowFlags
{ "repo_name": "shindouj/SimplyVanish", "path": "src/main/java/me/asofold/bpl/simplyvanish/SimplyVanishCore.java", "license": "lgpl-3.0", "size": 26055 }
[ "me.asofold.bpl.simplyvanish.config.VanishConfig", "org.bukkit.ChatColor", "org.bukkit.command.CommandSender" ]
import me.asofold.bpl.simplyvanish.config.VanishConfig; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender;
import me.asofold.bpl.simplyvanish.config.*; import org.bukkit.*; import org.bukkit.command.*;
[ "me.asofold.bpl", "org.bukkit", "org.bukkit.command" ]
me.asofold.bpl; org.bukkit; org.bukkit.command;
2,640,881
UserTable getRowsWithId(String appName, DbHandle dbHandleName, String tableId, OrderedColumns orderedColumns, String rowId) throws ServicesAvailabilityException;
UserTable getRowsWithId(String appName, DbHandle dbHandleName, String tableId, OrderedColumns orderedColumns, String rowId) throws ServicesAvailabilityException;
/** * Return the row with the most recent changes for the given tableId and rowId. * If the row has conflicts, it throws an exception. Otherwise, it returns the * most recent checkpoint or non-checkpoint value; it will contain a single row. * * @param appName * @param dbHandleName * @param tableId * @param orderedColumns * @param rowId * @return */
Return the row with the most recent changes for the given tableId and rowId. If the row has conflicts, it throws an exception. Otherwise, it returns the most recent checkpoint or non-checkpoint value; it will contain a single row
getRowsWithId
{ "repo_name": "opendatakit/androidlibrary", "path": "androidlibrary_lib/src/main/java/org/opendatakit/database/service/UserDbInterface.java", "license": "apache-2.0", "size": 50250 }
[ "org.opendatakit.database.data.OrderedColumns", "org.opendatakit.database.data.UserTable", "org.opendatakit.exception.ServicesAvailabilityException" ]
import org.opendatakit.database.data.OrderedColumns; import org.opendatakit.database.data.UserTable; import org.opendatakit.exception.ServicesAvailabilityException;
import org.opendatakit.database.data.*; import org.opendatakit.exception.*;
[ "org.opendatakit.database", "org.opendatakit.exception" ]
org.opendatakit.database; org.opendatakit.exception;
2,673,354
protected RectF computeLayout() { return getDisplayRect( mMatrix, mCropRect ); }
RectF function() { return getDisplayRect( mMatrix, mCropRect ); }
/** * Request a layout update. * * @return the rect f */
Request a layout update
computeLayout
{ "repo_name": "photo/mobile-android", "path": "submodules/Android-Feather/src/com/aviary/android/feather/widget/DrawableHighlightView.java", "license": "apache-2.0", "size": 27091 }
[ "android.graphics.RectF" ]
import android.graphics.RectF;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
2,425,793
public final long getAndUpdate(int i, LongUnaryOperator updateFunction) { long prev, next; do { prev = get(i); next = updateFunction.applyAsLong(prev); } while (!compareAndSet(i, prev, next)); return prev; }
final long function(int i, LongUnaryOperator updateFunction) { long prev, next; do { prev = get(i); next = updateFunction.applyAsLong(prev); } while (!compareAndSet(i, prev, next)); return prev; }
/** * Atomically updates the element at index {@code i} with the results * of applying the given function, returning the previous value. The * function should be side-effect-free, since it may be re-applied * when attempted updates fail due to contention among threads. * * @param i the index * @param updateFunction a side-effect-free function * @return the previous value * @since 1.8 */
Atomically updates the element at index i with the results of applying the given function, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads
getAndUpdate
{ "repo_name": "somexotherxguy/ikvm", "path": "classpath/java/util/concurrent/atomic/AtomicLongArray.java", "license": "gpl-2.0", "size": 10455 }
[ "java.util.function.LongUnaryOperator" ]
import java.util.function.LongUnaryOperator;
import java.util.function.*;
[ "java.util" ]
java.util;
1,593,959
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
/** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Handles the HTTP <code>POST</code> method
doPost
{ "repo_name": "SergioAravena/AutomatizacionLibretaMedicamentos", "path": "AutomatizacionLibretaMedicamento/src/java/servlet/ModificarReserva.java", "license": "gpl-3.0", "size": 4824 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
2,292,118
private SharedPreferences getPrefs () { return context.getSharedPreferences(PREF_KEY, Context.MODE_PRIVATE); }
SharedPreferences function () { return context.getSharedPreferences(PREF_KEY, Context.MODE_PRIVATE); }
/** * Shared private preferences for the application. */
Shared private preferences for the application
getPrefs
{ "repo_name": "dansanti/cordova-plugin-local-notifications", "path": "src/android/notification/Notification.java", "license": "apache-2.0", "size": 9225 }
[ "android.content.Context", "android.content.SharedPreferences" ]
import android.content.Context; import android.content.SharedPreferences;
import android.content.*;
[ "android.content" ]
android.content;
2,768,477
private List<User> removeInvisibleUsers(List<User> users){ //if superuser return list unchanged. if(sakaiProxy.isSuperUser()){ return users; } //get list of invisible users as Users List<User> invisibleUsers = sakaiProxy.getUsers(sakaiProxy.getInvisibleUsers()); if(invisibleUsers.isEmpty()) { return users; } //remove users.removeAll(invisibleUsers); return users; }
List<User> function(List<User> users){ if(sakaiProxy.isSuperUser()){ return users; } List<User> invisibleUsers = sakaiProxy.getUsers(sakaiProxy.getInvisibleUsers()); if(invisibleUsers.isEmpty()) { return users; } users.removeAll(invisibleUsers); return users; }
/** * Remove invisible users from the list * @param users * @return cleaned list */
Remove invisible users from the list
removeInvisibleUsers
{ "repo_name": "harfalm/Sakai-10.1", "path": "profile2/impl/src/java/org/sakaiproject/profile2/logic/ProfileSearchLogicImpl.java", "license": "apache-2.0", "size": 9520 }
[ "java.util.List", "org.sakaiproject.user.api.User" ]
import java.util.List; import org.sakaiproject.user.api.User;
import java.util.*; import org.sakaiproject.user.api.*;
[ "java.util", "org.sakaiproject.user" ]
java.util; org.sakaiproject.user;
2,823,956
public okhttp3.Call deleteCollectionNamespacedNetworkPolicyCall( String namespace, String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { Object localVarPostBody = body; // create path and map variables String localVarPath = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" .replaceAll( "\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); if (pretty != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); } if (_continue != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("continue", _continue)); } if (dryRun != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); } if (fieldSelector != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("fieldSelector", fieldSelector)); } if (gracePeriodSeconds != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds)); } if (labelSelector != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("labelSelector", labelSelector)); } if (limit != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); } if (orphanDependents != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("orphanDependents", orphanDependents)); } if (propagationPolicy != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy)); } if (resourceVersion != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("resourceVersion", resourceVersion)); } if (resourceVersionMatch != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("resourceVersionMatch", resourceVersionMatch)); } if (timeoutSeconds != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("timeoutSeconds", timeoutSeconds)); } Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, String> localVarCookieParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] {"BearerToken"}; return localVarApiClient.buildCall( localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); }
okhttp3.Call function( String namespace, String pretty, String _continue, String dryRun, String fieldSelector, Integer gracePeriodSeconds, String labelSelector, Integer limit, Boolean orphanDependents, String propagationPolicy, String resourceVersion, String resourceVersionMatch, Integer timeoutSeconds, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { Object localVarPostBody = body; String localVarPath = STR .replaceAll( "\\{" + STR + "\\}", localVarApiClient.escapeString(namespace.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); if (pretty != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(STR, pretty)); } if (_continue != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(STR, _continue)); } if (dryRun != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(STR, dryRun)); } if (fieldSelector != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(STR, fieldSelector)); } if (gracePeriodSeconds != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, gracePeriodSeconds)); } if (labelSelector != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(STR, labelSelector)); } if (limit != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit)); } if (orphanDependents != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, orphanDependents)); } if (propagationPolicy != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, propagationPolicy)); } if (resourceVersion != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, resourceVersion)); } if (resourceVersionMatch != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, resourceVersionMatch)); } if (timeoutSeconds != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, timeoutSeconds)); } Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, String> localVarCookieParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { STR, STR, STR }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put(STR, localVarAccept); } final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put(STR, localVarContentType); String[] localVarAuthNames = new String[] {STR}; return localVarApiClient.buildCall( localVarPath, STR, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); }
/** * Build call for deleteCollectionNamespacedNetworkPolicy * * @param namespace object name and auth scope, such as for teams and projects (required) * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional) * @param _continue The continue option should be set when retrieving more results from the * server. Since this value is server defined, clients may only use the continue value from a * previous query result with identical query parameters (except for the value of continue) * and the server may reject a continue value it does not recognize. If the specified continue * value is no longer valid whether due to expiration (generally five to fifteen minutes) or a * configuration change on the server, the server will respond with a 410 ResourceExpired * error together with a continue token. If the client needs a consistent list, it must * restart their list without the continue field. Otherwise, the client may send another list * request with the token received with the 410 error, the server will respond with a list * starting from the next key, but from the latest snapshot, which is inconsistent from the * previous list results - objects that are created, modified, or deleted after the first list * request will be included in the response, as long as their keys are after the \&quot;next * key\&quot;. This field is not supported when watch is true. Clients may start a watch from * the last resourceVersion value returned by the server and not miss any modifications. * (optional) * @param dryRun When present, indicates that modifications should not be persisted. An invalid or * unrecognized dryRun directive will result in an error response and no further processing of * the request. Valid values are: - All: all dry run stages will be processed (optional) * @param fieldSelector A selector to restrict the list of returned objects by their fields. * Defaults to everything. (optional) * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value * must be non-negative integer. The value zero indicates delete immediately. If this value is * nil, the default grace period for the specified type will be used. Defaults to a per object * value if not specified. zero means delete immediately. (optional) * @param labelSelector A selector to restrict the list of returned objects by their labels. * Defaults to everything. (optional) * @param limit limit is a maximum number of responses to return for a list call. If more items * exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value * that can be used with the same initial query to retrieve the next set of results. Setting a * limit may return fewer than the requested amount of items (up to zero items) in the event * all requested objects are filtered out and clients should only use the presence of the * continue field to determine whether more results are available. Servers may choose not to * support the limit argument and will return all of the available results. If limit is * specified and the continue field is empty, clients may assume that no more results are * available. This field is not supported if watch is true. The server guarantees that the * objects returned when using continue will be identical to issuing a single list call * without a limit - that is, no objects created, modified, or deleted after the first request * is issued will be included in any subsequent continued requests. This is sometimes referred * to as a consistent snapshot, and ensures that a client that is using limit to receive * smaller chunks of a very large result can ensure they see all possible objects. If objects * are updated during a chunked list the version of the object that was present at the time * the first list result was calculated is returned. (optional) * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be * deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the * \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers * list. Either this field or PropagationPolicy may be set, but not both. (optional) * @param propagationPolicy Whether and how garbage collection will be performed. Either this * field or OrphanDependents may be set, but not both. The default policy is decided by the * existing finalizer set in the metadata.finalizers and the resource-specific default policy. * Acceptable values are: &#39;Orphan&#39; - orphan the dependents; &#39;Background&#39; - * allow the garbage collector to delete the dependents in the background; * &#39;Foreground&#39; - a cascading policy that deletes all dependents in the foreground. * (optional) * @param resourceVersion resourceVersion sets a constraint on what resource versions a request * may be served from. See * https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. * Defaults to unset (optional) * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to * list calls. It is highly recommended that resourceVersionMatch be set for list calls where * resourceVersion is set See * https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. * Defaults to unset (optional) * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, * regardless of any activity or inactivity. (optional) * @param body (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details * <table summary="Response Details" border="1"> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> * <tr><td> 200 </td><td> OK </td><td> - </td></tr> * <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr> * </table> */
Build call for deleteCollectionNamespacedNetworkPolicy
deleteCollectionNamespacedNetworkPolicyCall
{ "repo_name": "kubernetes-client/java", "path": "kubernetes/src/main/java/io/kubernetes/client/openapi/apis/NetworkingV1Api.java", "license": "apache-2.0", "size": 477939 }
[ "io.kubernetes.client.openapi.ApiCallback", "io.kubernetes.client.openapi.ApiException", "io.kubernetes.client.openapi.Pair", "io.kubernetes.client.openapi.models.V1DeleteOptions", "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map" ]
import io.kubernetes.client.openapi.ApiCallback; import io.kubernetes.client.openapi.ApiException; import io.kubernetes.client.openapi.Pair; import io.kubernetes.client.openapi.models.V1DeleteOptions; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
import io.kubernetes.client.openapi.*; import io.kubernetes.client.openapi.models.*; import java.util.*;
[ "io.kubernetes.client", "java.util" ]
io.kubernetes.client; java.util;
852,415
void error(Locator locator, String key); void error(Locator locator, String key, String arg); Locator saveLocator();
void error(Locator locator, String key); void error(Locator locator, String key, String arg); Locator saveLocator();
/** * Returns non-volatile Locator, never-null. */
Returns non-volatile Locator, never-null
saveLocator
{ "repo_name": "vandenoever/jing", "path": "mod/picl/src/main/com/thaiopensource/validate/picl/ErrorContext.java", "license": "bsd-3-clause", "size": 409 }
[ "org.xml.sax.Locator" ]
import org.xml.sax.Locator;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
887,421
@Override public RelationsCommonList getCommonPartList() { return relationList; }
RelationsCommonList function() { return relationList; }
/**get associated Relation (for index/GET_ALL) */
get associated Relation (for index/GET_ALL)
getCommonPartList
{ "repo_name": "cherryhill/collectionspace-services", "path": "services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java", "license": "apache-2.0", "size": 23622 }
[ "org.collectionspace.services.relation.RelationsCommonList" ]
import org.collectionspace.services.relation.RelationsCommonList;
import org.collectionspace.services.relation.*;
[ "org.collectionspace.services" ]
org.collectionspace.services;
208,878
public static Point get_instance(BigInteger p_x, BigInteger p_y, BigInteger p_z) { if (p_z.signum() < 0) { // the dominator z of a RationalPoint is expected to be positive p_x = p_x.negate(); p_y = p_y.negate(); p_z = p_z.negate(); } if ((p_x.mod(p_z)).signum() == 0 && (p_x.mod(p_z)).signum() == 0) { // p_x and p_y can be divided by p_z p_x = p_x.divide(p_z); p_y = p_y.divide(p_z); p_z = BigInteger.ONE; } if (p_z.equals(BigInteger.ONE)) { if ( (p_x.abs()).compareTo(Limits.CRIT_INT_BIG) <= 0 && (p_y.abs()).compareTo(Limits.CRIT_INT_BIG) <= 0 ) { // the Point fits into an IntPoint return new IntPoint(p_x.intValue(), p_y.intValue()); } } return new RationalPoint(p_x, p_y, p_z); }
static Point function(BigInteger p_x, BigInteger p_y, BigInteger p_z) { if (p_z.signum() < 0) { p_x = p_x.negate(); p_y = p_y.negate(); p_z = p_z.negate(); } if ((p_x.mod(p_z)).signum() == 0 && (p_x.mod(p_z)).signum() == 0) { p_x = p_x.divide(p_z); p_y = p_y.divide(p_z); p_z = BigInteger.ONE; } if (p_z.equals(BigInteger.ONE)) { if ( (p_x.abs()).compareTo(Limits.CRIT_INT_BIG) <= 0 && (p_y.abs()).compareTo(Limits.CRIT_INT_BIG) <= 0 ) { return new IntPoint(p_x.intValue(), p_y.intValue()); } } return new RationalPoint(p_x, p_y, p_z); }
/** * factory method for creating a Point from 3 BigIntegers */
factory method for creating a Point from 3 BigIntegers
get_instance
{ "repo_name": "andrasfuchs/BioBalanceDetector", "path": "Tools/KiCad_FreeRouting/FreeRouting-miho-master/freerouting-master/src/main/java/eu/mihosoft/freerouting/geometry/planar/Point.java", "license": "gpl-3.0", "size": 7191 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
992,001