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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
@Test
public void excludedBasedOnCustomExpressionSyntax()
{
CustomExpressionBasedNoBean noBean =
BeanProvider.getContextualReference(CustomExpressionBasedNoBean.class, true);
Assert.assertNull(noBean);
}
|
void function() { CustomExpressionBasedNoBean noBean = BeanProvider.getContextualReference(CustomExpressionBasedNoBean.class, true); Assert.assertNull(noBean); }
|
/**
* bean excluded based on a custom expression syntax
*/
|
bean excluded based on a custom expression syntax
|
excludedBasedOnCustomExpressionSyntax
|
{
"repo_name": "Danny02/deltaspike",
"path": "deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/exclude/ExcludeTest.java",
"license": "apache-2.0",
"size": 3183
}
|
[
"org.apache.deltaspike.core.api.provider.BeanProvider",
"org.junit.Assert"
] |
import org.apache.deltaspike.core.api.provider.BeanProvider; import org.junit.Assert;
|
import org.apache.deltaspike.core.api.provider.*; import org.junit.*;
|
[
"org.apache.deltaspike",
"org.junit"
] |
org.apache.deltaspike; org.junit;
| 1,903,105
|
public DocTemplateFinder getDocTemplateFinder() {
return docTemplateFinder;
}
|
DocTemplateFinder function() { return docTemplateFinder; }
|
/**
* Returns the doc template finder.
*
* @return the doc template finder
*/
|
Returns the doc template finder
|
getDocTemplateFinder
|
{
"repo_name": "openegovplatform/OEPv2",
"path": "oep-dossier-portlet/docroot/WEB-INF/src/org/oep/dossiermgt/service/base/DossierProcBookmarkServiceBaseImpl.java",
"license": "apache-2.0",
"size": 49450
}
|
[
"org.oep.dossiermgt.service.persistence.DocTemplateFinder"
] |
import org.oep.dossiermgt.service.persistence.DocTemplateFinder;
|
import org.oep.dossiermgt.service.persistence.*;
|
[
"org.oep.dossiermgt"
] |
org.oep.dossiermgt;
| 2,400,416
|
public Builder id(Integer id) {
this.id = id;
return this;
}
|
Builder function(Integer id) { this.id = id; return this; }
|
/**
* The customer's ID number.
*/
|
The customer's ID number
|
id
|
{
"repo_name": "pforhan/wire",
"path": "wire-runtime/src/test/proto-java/com/squareup/wire/protos/person/Person.java",
"license": "apache-2.0",
"size": 12892
}
|
[
"java.lang.Integer"
] |
import java.lang.Integer;
|
import java.lang.*;
|
[
"java.lang"
] |
java.lang;
| 2,435,300
|
private boolean verifyValidSignature(String signedData, String signature) {
try {
return Security.verifyPurchase(BASE_64_ENCODED_PUBLIC_KEY, signedData, signature);
} catch (IOException e) {
Log.e(TAG, "Got an exception trying to validate a purchase: " + e);
return false;
}
}
|
boolean function(String signedData, String signature) { try { return Security.verifyPurchase(BASE_64_ENCODED_PUBLIC_KEY, signedData, signature); } catch (IOException e) { Log.e(TAG, STR + e); return false; } }
|
/**
* Verifies that the purchase was signed correctly for this developer's public key.
* <p>Note: It's strongly recommended to perform such check on your backend since hackers can
* replace this method with "constant true" if they decompile/rebuild your app.
* </p>
*/
|
Verifies that the purchase was signed correctly for this developer's public key. Note: It's strongly recommended to perform such check on your backend since hackers can replace this method with "constant true" if they decompile/rebuild your app.
|
verifyValidSignature
|
{
"repo_name": "openfl/extension-iap",
"path": "dependencies/android/src/org/haxe/extension/iap/util/BillingManager.java",
"license": "mit",
"size": 17401
}
|
[
"android.util.Log",
"java.io.IOException"
] |
import android.util.Log; import java.io.IOException;
|
import android.util.*; import java.io.*;
|
[
"android.util",
"java.io"
] |
android.util; java.io;
| 80,868
|
public SSLSession getSslSession() {
return null;
}
|
SSLSession function() { return null; }
|
/**
*
* Gets the SSLSession of the underlying connection, or null if SSL is not in use.
*
* Note that for client cert auth {@link #getSslSessionInfo()} should be used instead, as it
* takes into account other information potentially provided by load balancers that terminate SSL
*
* @return The SSLSession of the connection
*/
|
Gets the SSLSession of the underlying connection, or null if SSL is not in use. Note that for client cert auth <code>#getSslSessionInfo()</code> should be used instead, as it takes into account other information potentially provided by load balancers that terminate SSL
|
getSslSession
|
{
"repo_name": "rhusar/undertow",
"path": "core/src/main/java/io/undertow/server/ServerConnection.java",
"license": "apache-2.0",
"size": 9680
}
|
[
"javax.net.ssl.SSLSession"
] |
import javax.net.ssl.SSLSession;
|
import javax.net.ssl.*;
|
[
"javax.net"
] |
javax.net;
| 1,440,135
|
private void validate( Element bindings ) {
NamedNodeMap atts = bindings.getAttributes();
for( int i=0; i<atts.getLength(); i++ ) {
Attr a = (Attr)atts.item(i);
if( a.getNamespaceURI()!=null )
continue; // all foreign namespace OK.
if( a.getLocalName().equals("node") )
continue;
if( a.getLocalName().equals("schemaLocation"))
continue;
if( a.getLocalName().equals("scd") )
continue;
// TODO: flag error for this undefined attribute
}
}
|
void function( Element bindings ) { NamedNodeMap atts = bindings.getAttributes(); for( int i=0; i<atts.getLength(); i++ ) { Attr a = (Attr)atts.item(i); if( a.getNamespaceURI()!=null ) continue; if( a.getLocalName().equals("node") ) continue; if( a.getLocalName().equals(STR)) continue; if( a.getLocalName().equals("scd") ) continue; } }
|
/**
* Validates attributes of a <jaxb:bindings> element.
*/
|
Validates attributes of a <jaxb:bindings> element
|
validate
|
{
"repo_name": "samskivert/ikvm-openjdk",
"path": "build/linux-amd64/impsrc/com/sun/tools/internal/xjc/reader/internalizer/Internalizer.java",
"license": "gpl-2.0",
"size": 18555
}
|
[
"org.w3c.dom.Attr",
"org.w3c.dom.Element",
"org.w3c.dom.NamedNodeMap"
] |
import org.w3c.dom.Attr; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap;
|
import org.w3c.dom.*;
|
[
"org.w3c.dom"
] |
org.w3c.dom;
| 2,631,162
|
public List<Account> search(SortCriteria crit) throws DataAccException {
return super.list(Account.class, crit);
}
|
List<Account> function(SortCriteria crit) throws DataAccException { return super.list(Account.class, crit); }
|
/**
* Get all Account objects from database sorted by the given criteria
*
* @param crit the sorting criteria
* @return a list with all existing Account objects
* @throws DataAccException on error
*/
|
Get all Account objects from database sorted by the given criteria
|
search
|
{
"repo_name": "terrex/tntconcept-materials-testing",
"path": "src/main/java/com/autentia/intra/dao/hibernate/AccountDAO.java",
"license": "gpl-2.0",
"size": 4209
}
|
[
"com.autentia.intra.businessobject.Account",
"com.autentia.intra.dao.DataAccException",
"com.autentia.intra.dao.SortCriteria",
"java.util.List"
] |
import com.autentia.intra.businessobject.Account; import com.autentia.intra.dao.DataAccException; import com.autentia.intra.dao.SortCriteria; import java.util.List;
|
import com.autentia.intra.businessobject.*; import com.autentia.intra.dao.*; import java.util.*;
|
[
"com.autentia.intra",
"java.util"
] |
com.autentia.intra; java.util;
| 446,052
|
scanClasses(EnumerationType.class);
store.beginTransaction();
assertThat(query("MATCH (e:Type:Enum) RETURN e").getColumn("e"), hasItem(typeDescriptor(EnumerationType.class)));
assertThat(query("MATCH (e:Type:Enum)-[:EXTENDS]->(s) RETURN s").getColumn("s"), hasItem(typeDescriptor(Enum.class)));
assertThat(query("MATCH (e:Type:Enum)-[:DECLARES]->(f:Field) RETURN f").getColumn("f"), CoreMatchers.allOf(
hasItem(fieldDescriptor(EnumerationType.class, "A")), hasItem(fieldDescriptor(EnumerationType.class, "B")),
hasItem(fieldDescriptor(EnumerationType.class, "value"))));
assertThat(query("MATCH (e:Type:Enum)-[:DECLARES]->(c:Constructor) RETURN c").getColumn("c"),
hasItem(MethodDescriptorMatcher.constructorDescriptor(EnumerationType.class, String.class, int.class, boolean.class)));
store.commitTransaction();
}
|
scanClasses(EnumerationType.class); store.beginTransaction(); assertThat(query(STR).getColumn("e"), hasItem(typeDescriptor(EnumerationType.class))); assertThat(query(STR).getColumn("s"), hasItem(typeDescriptor(Enum.class))); assertThat(query(STR).getColumn("f"), CoreMatchers.allOf( hasItem(fieldDescriptor(EnumerationType.class, "A")), hasItem(fieldDescriptor(EnumerationType.class, "B")), hasItem(fieldDescriptor(EnumerationType.class, "value")))); assertThat(query(STR).getColumn("c"), hasItem(MethodDescriptorMatcher.constructorDescriptor(EnumerationType.class, String.class, int.class, boolean.class))); store.commitTransaction(); }
|
/**
* Verifies scanning of {@link EnumerationType}.
*
* @throws java.io.IOException
* If the test fails.
* @throws NoSuchMethodException
* If the test fails.
*/
|
Verifies scanning of <code>EnumerationType</code>
|
implicitDefaultConstructor
|
{
"repo_name": "khmarbaise/jqassistant",
"path": "plugin/java/src/test/java/com/buschmais/jqassistant/plugin/java/test/scanner/EnumerationIT.java",
"license": "gpl-3.0",
"size": 2097
}
|
[
"com.buschmais.jqassistant.plugin.java.test.matcher.MethodDescriptorMatcher",
"com.buschmais.jqassistant.plugin.java.test.set.scanner.enumeration.EnumerationType",
"org.hamcrest.CoreMatchers",
"org.junit.Assert"
] |
import com.buschmais.jqassistant.plugin.java.test.matcher.MethodDescriptorMatcher; import com.buschmais.jqassistant.plugin.java.test.set.scanner.enumeration.EnumerationType; import org.hamcrest.CoreMatchers; import org.junit.Assert;
|
import com.buschmais.jqassistant.plugin.java.test.matcher.*; import com.buschmais.jqassistant.plugin.java.test.set.scanner.enumeration.*; import org.hamcrest.*; import org.junit.*;
|
[
"com.buschmais.jqassistant",
"org.hamcrest",
"org.junit"
] |
com.buschmais.jqassistant; org.hamcrest; org.junit;
| 880,297
|
public ArrayList<Path> getResources()
{
return getWrappedPath().getResources();
}
|
ArrayList<Path> function() { return getWrappedPath().getResources(); }
|
/**
* Looks up all the existing resources. (Generally only useful
* with MergePath.
*/
|
Looks up all the existing resources. (Generally only useful with MergePath
|
getResources
|
{
"repo_name": "dwango/quercus",
"path": "src/main/java/com/caucho/vfs/PathWrapper.java",
"license": "gpl-2.0",
"size": 16137
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 877,728
|
public List<XmlDom> tags(String tag, String attr, String value)
{
NodeList nl = root.getElementsByTagName(tag);
return convert(nl, null, attr, value);
}
|
List<XmlDom> function(String tag, String attr, String value) { NodeList nl = root.getElementsByTagName(tag); return convert(nl, null, attr, value); }
|
/**
* Return a list of nodes that represents the matched tags that has attribute attr=value.
* If attr == null, any tag with specified name matches.
* If value == null, any nodes that has the attr matches.
*
* @param tag tag name
* @param attr attr name to match
* @param value attr value to match
* @return the list of xml dom
* @see testTags2
*/
|
Return a list of nodes that represents the matched tags that has attribute attr=value. If attr == null, any tag with specified name matches. If value == null, any nodes that has the attr matches
|
tags
|
{
"repo_name": "libit/lr_dialer",
"path": "app/src/main/java/com/androidquery/util/XmlDom.java",
"license": "gpl-3.0",
"size": 10479
}
|
[
"java.util.List",
"org.w3c.dom.NodeList"
] |
import java.util.List; import org.w3c.dom.NodeList;
|
import java.util.*; import org.w3c.dom.*;
|
[
"java.util",
"org.w3c.dom"
] |
java.util; org.w3c.dom;
| 2,662,063
|
@Override
public IPermissionManager newPermissionManager(String owner) {
return new PermissionManagerImpl(owner, this);
}
|
IPermissionManager function(String owner) { return new PermissionManagerImpl(owner, this); }
|
/**
* Factory method for IPermissionManager.
*
* @return org.apereo.portal.security.IPermissionManager
* @param owner java.lang.String
*/
|
Factory method for IPermissionManager
|
newPermissionManager
|
{
"repo_name": "stalele/uPortal",
"path": "uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java",
"license": "apache-2.0",
"size": 48081
}
|
[
"org.apereo.portal.security.IPermissionManager"
] |
import org.apereo.portal.security.IPermissionManager;
|
import org.apereo.portal.security.*;
|
[
"org.apereo.portal"
] |
org.apereo.portal;
| 2,638,632
|
AuditMessagesManager getAuditMessagesManager();
|
AuditMessagesManager getAuditMessagesManager();
|
/**
* Gets a AuditMessages manager.
* @return AuditMessages manager
*/
|
Gets a AuditMessages manager
|
getAuditMessagesManager
|
{
"repo_name": "licehammer/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/PerunBl.java",
"license": "bsd-2-clause",
"size": 5201
}
|
[
"cz.metacentrum.perun.core.api.AuditMessagesManager"
] |
import cz.metacentrum.perun.core.api.AuditMessagesManager;
|
import cz.metacentrum.perun.core.api.*;
|
[
"cz.metacentrum.perun"
] |
cz.metacentrum.perun;
| 2,040,950
|
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final ImageAnnotatorClient create(ImageAnnotatorStub stub) {
return new ImageAnnotatorClient(stub);
}
protected ImageAnnotatorClient(ImageAnnotatorSettings settings) throws IOException {
this.settings = settings;
this.stub = ((ImageAnnotatorStubSettings) settings.getStubSettings()).createStub();
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected ImageAnnotatorClient(ImageAnnotatorStub stub) {
this.settings = null;
this.stub = stub;
this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
}
|
@BetaApi(STR) static final ImageAnnotatorClient function(ImageAnnotatorStub stub) { return new ImageAnnotatorClient(stub); } protected ImageAnnotatorClient(ImageAnnotatorSettings settings) throws IOException { this.settings = settings; this.stub = ((ImageAnnotatorStubSettings) settings.getStubSettings()).createStub(); this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); } @BetaApi(STR) protected ImageAnnotatorClient(ImageAnnotatorStub stub) { this.settings = null; this.stub = stub; this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); }
|
/**
* Constructs an instance of ImageAnnotatorClient, using the given stub for making calls. This is
* for advanced usage - prefer to use ImageAnnotatorSettings}.
*/
|
Constructs an instance of ImageAnnotatorClient, using the given stub for making calls. This is for advanced usage - prefer to use ImageAnnotatorSettings}
|
create
|
{
"repo_name": "vam-google/google-cloud-java",
"path": "google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ImageAnnotatorClient.java",
"license": "apache-2.0",
"size": 15576
}
|
[
"com.google.api.core.BetaApi",
"com.google.cloud.vision.v1.stub.ImageAnnotatorStub",
"com.google.cloud.vision.v1.stub.ImageAnnotatorStubSettings",
"com.google.longrunning.OperationsClient",
"java.io.IOException"
] |
import com.google.api.core.BetaApi; import com.google.cloud.vision.v1.stub.ImageAnnotatorStub; import com.google.cloud.vision.v1.stub.ImageAnnotatorStubSettings; import com.google.longrunning.OperationsClient; import java.io.IOException;
|
import com.google.api.core.*; import com.google.cloud.vision.v1.stub.*; import com.google.longrunning.*; import java.io.*;
|
[
"com.google.api",
"com.google.cloud",
"com.google.longrunning",
"java.io"
] |
com.google.api; com.google.cloud; com.google.longrunning; java.io;
| 1,769,775
|
public int[] getDistinctValues(final int level) {
final IntOpenHashSet vals = new IntOpenHashSet();
for (int k = 0; k < map.length; k++) {
vals.add(map[k][level]);
}
final int[] result = new int[vals.size()];
final int[] keys = vals.keys;
final boolean[] allocated = vals.allocated;
int index = 0;
for (int i = 0; i < allocated.length; i++) {
if (allocated[i]) {
result[index++] = keys[i];
}
}
return result;
}
|
int[] function(final int level) { final IntOpenHashSet vals = new IntOpenHashSet(); for (int k = 0; k < map.length; k++) { vals.add(map[k][level]); } final int[] result = new int[vals.size()]; final int[] keys = vals.keys; final boolean[] allocated = vals.allocated; int index = 0; for (int i = 0; i < allocated.length; i++) { if (allocated[i]) { result[index++] = keys[i]; } } return result; }
|
/**
* Returns the distinct values.
*
* @param level
* @return
*/
|
Returns the distinct values
|
getDistinctValues
|
{
"repo_name": "RaffaelBild/arx",
"path": "src/main/org/deidentifier/arx/framework/data/GeneralizationHierarchy.java",
"license": "apache-2.0",
"size": 8045
}
|
[
"com.carrotsearch.hppc.IntOpenHashSet"
] |
import com.carrotsearch.hppc.IntOpenHashSet;
|
import com.carrotsearch.hppc.*;
|
[
"com.carrotsearch.hppc"
] |
com.carrotsearch.hppc;
| 1,471,041
|
@Generated
@Selector("isSupportedForHome:")
public static native boolean isSupportedForHome(HMHome home);
|
@Selector(STR) static native boolean function(HMHome home);
|
/**
* Specifies whether the HMEvent can be added to HMEventTrigger on the given home.
*/
|
Specifies whether the HMEvent can be added to HMEventTrigger on the given home
|
isSupportedForHome
|
{
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/homekit/HMEvent.java",
"license": "apache-2.0",
"size": 5200
}
|
[
"org.moe.natj.objc.ann.Selector"
] |
import org.moe.natj.objc.ann.Selector;
|
import org.moe.natj.objc.ann.*;
|
[
"org.moe.natj"
] |
org.moe.natj;
| 1,368,153
|
@SuppressWarnings("unchecked")
private <S,T> void put(ClassPair<S,T> key, final ObjectConverter<? super S, ? extends T> converter) {
assert key.getClass() == ClassPair.class; // See SystemConverter.equals(Object)
assert key.cast(converter) != null : converter;
assert Thread.holdsLock(converters);
if (converter instanceof SystemConverter<?,?> &&
converter.getSourceClass() == key.sourceClass &&
converter.getTargetClass() == key.targetClass)
{
converters.remove(key);
key = (SystemConverter<S,T>) converter;
}
converters.put(key, converter);
}
|
@SuppressWarnings(STR) <S,T> void function(ClassPair<S,T> key, final ObjectConverter<? super S, ? extends T> converter) { assert key.getClass() == ClassPair.class; assert key.cast(converter) != null : converter; assert Thread.holdsLock(converters); if (converter instanceof SystemConverter<?,?> && converter.getSourceClass() == key.sourceClass && converter.getTargetClass() == key.targetClass) { converters.remove(key); key = (SystemConverter<S,T>) converter; } converters.put(key, converter); }
|
/**
* Puts the given value in the {@linkplain #converters} map for the given key.
*/
|
Puts the given value in the #converters map for the given key
|
put
|
{
"repo_name": "Geomatys/sis",
"path": "core/sis-utility/src/main/java/org/apache/sis/internal/converter/ConverterRegistry.java",
"license": "apache-2.0",
"size": 29318
}
|
[
"org.apache.sis.util.ObjectConverter"
] |
import org.apache.sis.util.ObjectConverter;
|
import org.apache.sis.util.*;
|
[
"org.apache.sis"
] |
org.apache.sis;
| 173,483
|
private static boolean installOnExternalAsec(int installFlags) {
if ((installFlags & PackageManager.INSTALL_INTERNAL) != 0) {
return false;
}
if ((installFlags & PackageManager.INSTALL_EXTERNAL) != 0) {
return true;
}
return false;
}
|
static boolean function(int installFlags) { if ((installFlags & PackageManager.INSTALL_INTERNAL) != 0) { return false; } if ((installFlags & PackageManager.INSTALL_EXTERNAL) != 0) { return true; } return false; }
|
/**
* Used during creation of InstallArgs
*
* @param installFlags package installation flags
* @return true if should be installed on external storage
*/
|
Used during creation of InstallArgs
|
installOnExternalAsec
|
{
"repo_name": "syslover33/ctank",
"path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/com/android/server/pm/PackageManagerService.java",
"license": "gpl-3.0",
"size": 736676
}
|
[
"android.content.pm.PackageManager"
] |
import android.content.pm.PackageManager;
|
import android.content.pm.*;
|
[
"android.content"
] |
android.content;
| 2,404,414
|
public void logout() throws IOException, SettingsException {
logout(null, new LogoutRequestParams(), false);
}
|
void function() throws IOException, SettingsException { logout(null, new LogoutRequestParams(), false); }
|
/**
* Initiates the SLO process.
*
* @throws IOException
* @throws SettingsException
*/
|
Initiates the SLO process
|
logout
|
{
"repo_name": "onelogin/java-saml",
"path": "toolkit/src/main/java/com/onelogin/saml2/Auth.java",
"license": "mit",
"size": 63952
}
|
[
"com.onelogin.saml2.exception.SettingsException",
"com.onelogin.saml2.logout.LogoutRequestParams",
"java.io.IOException"
] |
import com.onelogin.saml2.exception.SettingsException; import com.onelogin.saml2.logout.LogoutRequestParams; import java.io.IOException;
|
import com.onelogin.saml2.exception.*; import com.onelogin.saml2.logout.*; import java.io.*;
|
[
"com.onelogin.saml2",
"java.io"
] |
com.onelogin.saml2; java.io;
| 1,944,349
|
public Iterator<FB_Post> iteratorFeed( final String forcedTarget ,
final Integer limit )
{
if ( LOGGER.isTraceEnabled() )
{
LOGGER.trace(
"[" + getClass().getSimpleName() + "] iteratorFeed() : forcedTarget=" + forcedTarget + " / limit=" + limit );
}
|
Iterator<FB_Post> function( final String forcedTarget , final Integer limit ) { if ( LOGGER.isTraceEnabled() ) { LOGGER.trace( "[" + getClass().getSimpleName() + STR + forcedTarget + STR + limit ); }
|
/**
* Iterate a Facebook Feed.
*
* @param forcedTarget Target's ID (user or page). Could be null to use login target.
* @param limit Maximum number of results by call. Could be null to use default.
* @return a posts iterator
*/
|
Iterate a Facebook Feed
|
iteratorFeed
|
{
"repo_name": "fabienvauchelles/superpipes",
"path": "superpipes/src/main/java/com/vaushell/superpipes/tools/scribe/fb/FacebookClient.java",
"license": "lgpl-3.0",
"size": 26083
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,842,946
|
public static boolean join(@Nullable GridWorker w, @Nullable IgniteLogger log) {
if (w != null)
try {
w.join();
}
catch (InterruptedException ignore) {
warn(log, "Got interrupted while waiting for completion of runnable: " + w);
Thread.currentThread().interrupt();
return false;
}
return true;
}
|
static boolean function(@Nullable GridWorker w, @Nullable IgniteLogger log) { if (w != null) try { w.join(); } catch (InterruptedException ignore) { warn(log, STR + w); Thread.currentThread().interrupt(); return false; } return true; }
|
/**
* Joins runnable.
*
* @param w Worker to join.
* @param log The logger to possible exception.
* @return {@code true} if worker has not been interrupted, {@code false} if it was interrupted.
*/
|
Joins runnable
|
join
|
{
"repo_name": "NSAmelchev/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java",
"license": "apache-2.0",
"size": 388551
}
|
[
"org.apache.ignite.IgniteLogger",
"org.apache.ignite.internal.util.worker.GridWorker",
"org.jetbrains.annotations.Nullable"
] |
import org.apache.ignite.IgniteLogger; import org.apache.ignite.internal.util.worker.GridWorker; import org.jetbrains.annotations.Nullable;
|
import org.apache.ignite.*; import org.apache.ignite.internal.util.worker.*; import org.jetbrains.annotations.*;
|
[
"org.apache.ignite",
"org.jetbrains.annotations"
] |
org.apache.ignite; org.jetbrains.annotations;
| 1,549,667
|
public void writeTo(OutputStream out, Writer humanOut, boolean verbose)
throws IOException {
boolean annotate = (humanOut != null);
ByteArrayAnnotatedOutput result = toDex0(annotate, verbose);
if (out != null) {
out.write(result.getArray());
}
if (annotate) {
result.writeAnnotationsTo(humanOut);
}
}
|
void function(OutputStream out, Writer humanOut, boolean verbose) throws IOException { boolean annotate = (humanOut != null); ByteArrayAnnotatedOutput result = toDex0(annotate, verbose); if (out != null) { out.write(result.getArray()); } if (annotate) { result.writeAnnotationsTo(humanOut); } }
|
/**
* Writes the contents of this instance as either a binary or a
* human-readable form, or both.
*
* @param out {@code null-ok;} where to write to
* @param humanOut {@code null-ok;} where to write human-oriented output to
* @param verbose whether to be verbose when writing human-oriented output
*/
|
Writes the contents of this instance as either a binary or a human-readable form, or both
|
writeTo
|
{
"repo_name": "saleeh93/buck-cutom",
"path": "third-party/java/dx-from-kitkat/src/com/android/dx/dex/file/DexFile.java",
"license": "apache-2.0",
"size": 20665
}
|
[
"com.android.dx.util.ByteArrayAnnotatedOutput",
"java.io.IOException",
"java.io.OutputStream",
"java.io.Writer"
] |
import com.android.dx.util.ByteArrayAnnotatedOutput; import java.io.IOException; import java.io.OutputStream; import java.io.Writer;
|
import com.android.dx.util.*; import java.io.*;
|
[
"com.android.dx",
"java.io"
] |
com.android.dx; java.io;
| 1,610,550
|
public Item getSelfRezStone() {
Item item = null;
item = getReviveStone(161001001);
if (item == null) {
item = getReviveStone(161000003);
}
if (item == null) {
item = getReviveStone(161000004);
}
if (item == null) {
item = getReviveStone(161000001);
}
return item;
}
|
Item function() { Item item = null; item = getReviveStone(161001001); if (item == null) { item = getReviveStone(161000003); } if (item == null) { item = getReviveStone(161000004); } if (item == null) { item = getReviveStone(161000001); } return item; }
|
/**
* Stone Use Order determined by highest inventory slot. :( If player has
* two types, wrong one might be used.
*
* @param player
* @return selfRezItem
*/
|
Stone Use Order determined by highest inventory slot. :( If player has two types, wrong one might be used
|
getSelfRezStone
|
{
"repo_name": "f14shm4n/aion-event-engine",
"path": "EventEngine/src/com/aionemu/gameserver/model/gameobjects/player/Player.java",
"license": "gpl-2.0",
"size": 68792
}
|
[
"com.aionemu.gameserver.model.gameobjects.Item"
] |
import com.aionemu.gameserver.model.gameobjects.Item;
|
import com.aionemu.gameserver.model.gameobjects.*;
|
[
"com.aionemu.gameserver"
] |
com.aionemu.gameserver;
| 147,993
|
public void severe(String msg, Object... params) {
log(Level.SEVERE, msg, params);
}
|
void function(String msg, Object... params) { log(Level.SEVERE, msg, params); }
|
/**
* Log a SEVERE message, with an array of object arguments.
* <p>
* If the logger is currently enabled for the SEVERE message
* level then the given message is forwarded to all the
* registered output Handler objects.
*
* @param msg The string message (or a key in the message catalog)
* @param params array of parameters to the message
*/
|
Log a SEVERE message, with an array of object arguments. If the logger is currently enabled for the SEVERE message level then the given message is forwarded to all the registered output Handler objects
|
severe
|
{
"repo_name": "simonrrr/gdata-java-client",
"path": "java/src/com/google/gdata/util/common/logging/FormattingLogger.java",
"license": "apache-2.0",
"size": 37949
}
|
[
"java.util.logging.Level"
] |
import java.util.logging.Level;
|
import java.util.logging.*;
|
[
"java.util"
] |
java.util;
| 1,380,612
|
public static void playClip(String filename)
{
try
{
Clip clip = AudioSystem.getClip();
clip.open(AudioSystem.getAudioInputStream(GameWorld.class.getResource(filename)));
clip.loop(0);
}
catch (Exception exc)
{
exc.printStackTrace(System.out);
}
}
|
static void function(String filename) { try { Clip clip = AudioSystem.getClip(); clip.open(AudioSystem.getAudioInputStream(GameWorld.class.getResource(filename))); clip.loop(0); } catch (Exception exc) { exc.printStackTrace(System.out); } }
|
/**
* Play the sound clip.
* @param filename The sound clip name
*/
|
Play the sound clip
|
playClip
|
{
"repo_name": "haichuand/TankGame",
"path": "Game2D/GameSounds.java",
"license": "apache-2.0",
"size": 3851
}
|
[
"javax.sound.sampled.AudioSystem",
"javax.sound.sampled.Clip"
] |
import javax.sound.sampled.AudioSystem; import javax.sound.sampled.Clip;
|
import javax.sound.sampled.*;
|
[
"javax.sound"
] |
javax.sound;
| 1,755,603
|
public static void executedAndThenSendIndividualToMaster(TestSuiteChromosome testSuite) throws IllegalArgumentException{
if(testSuite == null){
throw new IllegalArgumentException("No defined test suite to send");
}
if(!Properties.NEW_STATISTICS)
return;
for (TestChromosome test : testSuite.getTestChromosomes()) {
if (test.getLastExecutionResult() == null) {
ExecutionResult result = TestCaseExecutor.runTest(test.getTestCase());
test.setLastExecutionResult(result);
}
}
sendCoveredInfo(testSuite);
sendExceptionInfo(testSuite);
sendIndividualToMaster(testSuite);
}
// -------- private methods ------------------------
|
static void function(TestSuiteChromosome testSuite) throws IllegalArgumentException{ if(testSuite == null){ throw new IllegalArgumentException(STR); } if(!Properties.NEW_STATISTICS) return; for (TestChromosome test : testSuite.getTestChromosomes()) { if (test.getLastExecutionResult() == null) { ExecutionResult result = TestCaseExecutor.runTest(test.getTestCase()); test.setLastExecutionResult(result); } } sendCoveredInfo(testSuite); sendExceptionInfo(testSuite); sendIndividualToMaster(testSuite); }
|
/**
* First execute (if needed) the test cases to be sure to have latest correct data,
* and then send it to Master
*/
|
First execute (if needed) the test cases to be sure to have latest correct data, and then send it to Master
|
executedAndThenSendIndividualToMaster
|
{
"repo_name": "sefaakca/EvoSuite-Sefa",
"path": "client/src/main/java/org/evosuite/statistics/StatisticsSender.java",
"license": "lgpl-3.0",
"size": 7604
}
|
[
"org.evosuite.Properties",
"org.evosuite.testcase.TestChromosome",
"org.evosuite.testcase.execution.ExecutionResult",
"org.evosuite.testcase.execution.TestCaseExecutor",
"org.evosuite.testsuite.TestSuiteChromosome"
] |
import org.evosuite.Properties; import org.evosuite.testcase.TestChromosome; import org.evosuite.testcase.execution.ExecutionResult; import org.evosuite.testcase.execution.TestCaseExecutor; import org.evosuite.testsuite.TestSuiteChromosome;
|
import org.evosuite.*; import org.evosuite.testcase.*; import org.evosuite.testcase.execution.*; import org.evosuite.testsuite.*;
|
[
"org.evosuite",
"org.evosuite.testcase",
"org.evosuite.testsuite"
] |
org.evosuite; org.evosuite.testcase; org.evosuite.testsuite;
| 1,734,371
|
@Test
public void testSelectAllJavaTypes() {
final QueryApi query = session.createQueryApi();
query.select().type(JavaType.class.getName()).subTypes().selectEnd();
final QueryResult result = query.execute(sortMode, printInfo);
final List<Node> nodes = result.getNodes();
final NodeWrapper[] wrappers = wrapNodes(nodes);
|
void function() { final QueryApi query = session.createQueryApi(); query.select().type(JavaType.class.getName()).subTypes().selectEnd(); final QueryResult result = query.execute(sortMode, printInfo); final List<Node> nodes = result.getNodes(); final NodeWrapper[] wrappers = wrapNodes(nodes);
|
/**
* Test select all java types.
*/
|
Test select all java types
|
testSelectAllJavaTypes
|
{
"repo_name": "porcelli/OpenSpotLight",
"path": "osl-graph/osl-graph-core/src/test/java/org/openspotlight/graph/query/SLGraphQueryTest.java",
"license": "lgpl-3.0",
"size": 227396
}
|
[
"java.util.List",
"org.openspotlight.graph.Node",
"org.openspotlight.graph.test.domain.node.JavaType"
] |
import java.util.List; import org.openspotlight.graph.Node; import org.openspotlight.graph.test.domain.node.JavaType;
|
import java.util.*; import org.openspotlight.graph.*; import org.openspotlight.graph.test.domain.node.*;
|
[
"java.util",
"org.openspotlight.graph"
] |
java.util; org.openspotlight.graph;
| 2,769,133
|
public boolean markAsAbsent(String avNum, String sender) {
Connection connection = connectDb(dbName);
try {
Statement statement = connection.createStatement();
statement.setQueryTimeout(60); // set timeout to 30 sec.
statement.execute("UPDATE " + DB_MESSAGE_TABLE + " SET "
+ DB_MESSAGE_TYPE + "="
+ AttributeManager.MessageType.ATTENDANCE.getCode()
+ " WHERE " + DB_MESSAGE_SENDER + "='" + sender + "' AND "
+ DB_MESSAGE_AV_NUM + "= '" + avNum + "'");
} catch (SQLException e) {
// if the error message is "out of memory",
// it probably means no database file is found
log(e.getMessage());
return false;
}
return true;
}
|
boolean function(String avNum, String sender) { Connection connection = connectDb(dbName); try { Statement statement = connection.createStatement(); statement.setQueryTimeout(60); statement.execute(STR + DB_MESSAGE_TABLE + STR + DB_MESSAGE_TYPE + "=" + AttributeManager.MessageType.ATTENDANCE.getCode() + STR + DB_MESSAGE_SENDER + "='" + sender + STR + DB_MESSAGE_AV_NUM + STR + avNum + "'"); } catch (SQLException e) { log(e.getMessage()); return false; } return true; }
|
/**
* Change the DB_MESSAGE_ACKED field in the database to -1 to indicate that
* this message came in as part of a bulk message.
*
* @param avNum
* the AV number of the entry to ack
* @param sender
* the sender
*/
|
Change the DB_MESSAGE_ACKED field in the database to -1 to indicate that this message came in as part of a bulk message
|
markAsAbsent
|
{
"repo_name": "everdefiant/posit-mobile.haiti-server",
"path": "src/haiti/server/modem/DbWriter.java",
"license": "gpl-3.0",
"size": 18276
}
|
[
"java.sql.Connection",
"java.sql.SQLException",
"java.sql.Statement"
] |
import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,498,310
|
private Result pImplementation(final int yyStart) throws IOException {
JavaFiveParserColumn yyColumn = (JavaFiveParserColumn)column(yyStart);
if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1();
if (null == yyColumn.chunk1.fImplementation)
yyColumn.chunk1.fImplementation = pImplementation$1(yyStart);
return yyColumn.chunk1.fImplementation;
}
|
Result function(final int yyStart) throws IOException { JavaFiveParserColumn yyColumn = (JavaFiveParserColumn)column(yyStart); if (null == yyColumn.chunk1) yyColumn.chunk1 = new Chunk1(); if (null == yyColumn.chunk1.fImplementation) yyColumn.chunk1.fImplementation = pImplementation$1(yyStart); return yyColumn.chunk1.fImplementation; }
|
/**
* Parse nonterminal xtc.lang.JavaFive.Implementation.
*
* @param yyStart The index.
* @return The result.
* @throws IOException Signals an I/O error.
*/
|
Parse nonterminal xtc.lang.JavaFive.Implementation
|
pImplementation
|
{
"repo_name": "wandoulabs/xtc-rats",
"path": "xtc-core/src/main/java/xtc/lang/JavaFiveParser.java",
"license": "lgpl-2.1",
"size": 313913
}
|
[
"java.io.IOException",
"xtc.parser.Result"
] |
import java.io.IOException; import xtc.parser.Result;
|
import java.io.*; import xtc.parser.*;
|
[
"java.io",
"xtc.parser"
] |
java.io; xtc.parser;
| 2,746,240
|
@SuppressWarnings("unchecked")
public List<Object> getList(String path) {
Object o = getProperty(path);
if (o == null) {
return null;
} else if (o instanceof List) {
return (List<Object>) o;
} else {
return null;
}
}
|
@SuppressWarnings(STR) List<Object> function(String path) { Object o = getProperty(path); if (o == null) { return null; } else if (o instanceof List) { return (List<Object>) o; } else { return null; } }
|
/**
* Gets a list of objects at a location. If the list is not defined,
* null will be returned. The node must be an actual list.
*
* @param path path to node (dot notation)
* @return boolean or default
*/
|
Gets a list of objects at a location. If the list is not defined, null will be returned. The node must be an actual list
|
getList
|
{
"repo_name": "sazert103/sazert103-studios",
"path": "Sazcraft-Launcher/src/main/java/org/spoutcraft/launcher/yml/YAMLNode.java",
"license": "gpl-3.0",
"size": 16253
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,748,108
|
@GET
@Path("/clusters/{clusterid}/users/{userid}/flows/{flowname}/apps/")
@Produces(MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8)
public Set<TimelineEntity> getFlowApps(
@Context HttpServletRequest req,
@Context HttpServletResponse res,
@PathParam("clusterid") String clusterId,
@PathParam("userid") String userId,
@PathParam("flowname") String flowName,
@QueryParam("limit") String limit,
@QueryParam("createdtimestart") String createdTimeStart,
@QueryParam("createdtimeend") String createdTimeEnd,
@QueryParam("relatesto") String relatesTo,
@QueryParam("isrelatedto") String isRelatedTo,
@QueryParam("infofilters") String infofilters,
@QueryParam("conffilters") String conffilters,
@QueryParam("metricfilters") String metricfilters,
@QueryParam("eventfilters") String eventfilters,
@QueryParam("confstoretrieve") String confsToRetrieve,
@QueryParam("metricstoretrieve") String metricsToRetrieve,
@QueryParam("fields") String fields,
@QueryParam("metricslimit") String metricsLimit,
@QueryParam("metricstimestart") String metricsTimeStart,
@QueryParam("metricstimeend") String metricsTimeEnd,
@QueryParam("fromid") String fromId) {
return getEntities(req, res, clusterId, null,
TimelineEntityType.YARN_APPLICATION.toString(), userId, flowName,
null, limit, createdTimeStart, createdTimeEnd, relatesTo, isRelatedTo,
infofilters, conffilters, metricfilters, eventfilters,
confsToRetrieve, metricsToRetrieve, fields, metricsLimit,
metricsTimeStart, metricsTimeEnd, fromId);
}
|
@Path(STR) @Produces(MediaType.APPLICATION_JSON + STR + JettyUtils.UTF_8) Set<TimelineEntity> function( @Context HttpServletRequest req, @Context HttpServletResponse res, @PathParam(STR) String clusterId, @PathParam(STR) String userId, @PathParam(STR) String flowName, @QueryParam("limit") String limit, @QueryParam(STR) String createdTimeStart, @QueryParam(STR) String createdTimeEnd, @QueryParam(STR) String relatesTo, @QueryParam(STR) String isRelatedTo, @QueryParam(STR) String infofilters, @QueryParam(STR) String conffilters, @QueryParam(STR) String metricfilters, @QueryParam(STR) String eventfilters, @QueryParam(STR) String confsToRetrieve, @QueryParam(STR) String metricsToRetrieve, @QueryParam(STR) String fields, @QueryParam(STR) String metricsLimit, @QueryParam(STR) String metricsTimeStart, @QueryParam(STR) String metricsTimeEnd, @QueryParam(STR) String fromId) { return getEntities(req, res, clusterId, null, TimelineEntityType.YARN_APPLICATION.toString(), userId, flowName, null, limit, createdTimeStart, createdTimeEnd, relatesTo, isRelatedTo, infofilters, conffilters, metricfilters, eventfilters, confsToRetrieve, metricsToRetrieve, fields, metricsLimit, metricsTimeStart, metricsTimeEnd, fromId); }
|
/**
* Return a list of apps for a given user, cluster id and flow name. If number
* of matching apps are more than the limit, most recent apps till the limit
* is reached, will be returned.
*
* @param req Servlet request.
* @param res Servlet response.
* @param clusterId Cluster id to which the apps to be queried belong to
* (Mandatory path param).
* @param userId User id which should match for the apps(Mandatory path param)
* @param flowName Flow name which should match for the apps(Mandatory path
* param).
* @param limit If specified, defines the number of apps to return. The
* maximum possible value for limit can be {@link Long#MAX_VALUE}. If it
* is not specified or has a value less than 0, then limit will be
* considered as 100. (Optional query param).
* @param createdTimeStart If specified, matched apps should not be created
* before this timestamp(Optional query param).
* @param createdTimeEnd If specified, matched apps should not be created
* after this timestamp(Optional query param).
* @param relatesTo If specified, matched apps should relate to given
* entities associated with a entity type. relatesto is a comma separated
* list in the format [entitytype]:[entityid1]:[entityid2]... (Optional
* query param).
* @param isRelatedTo If specified, matched apps should be related to given
* entities associated with a entity type. relatesto is a comma separated
* list in the format [entitytype]:[entityid1]:[entityid2]... (Optional
* query param).
* @param infofilters If specified, matched apps should have exact matches
* to the given info represented as key-value pairs. This is represented
* as infofilters=info1:value1,info2:value2... (Optional query param).
* @param conffilters If specified, matched apps should have exact matches
* to the given configs represented as key-value pairs. This is
* represented as conffilters=conf1:value1,conf2:value2... (Optional query
* param).
* @param metricfilters If specified, matched apps should contain the given
* metrics. This is represented as metricfilters=metricid1, metricid2...
* (Optional query param).
* @param eventfilters If specified, matched apps should contain the given
* events. This is represented as eventfilters=eventid1, eventid2...
* @param confsToRetrieve If specified, defines which configurations to
* retrieve and send back in response. These configs will be retrieved
* irrespective of whether configs are specified in fields to retrieve or
* not.
* @param metricsToRetrieve If specified, defines which metrics to retrieve
* and send back in response. These metrics will be retrieved
* irrespective of whether metrics are specified in fields to retrieve or
* not.
* @param fields Specifies which fields of the app entity object to retrieve,
* see {@link Field}. All fields will be retrieved if fields=ALL. If not
* specified, 3 fields i.e. entity type(equivalent to YARN_APPLICATION),
* app id and app created time is returned(Optional query param).
* @param metricsLimit If specified, defines the number of metrics to return.
* Considered only if fields contains METRICS/ALL or metricsToRetrieve is
* specified. Ignored otherwise. The maximum possible value for
* metricsLimit can be {@link Integer#MAX_VALUE}. If it is not specified
* or has a value less than 1, and metrics have to be retrieved, then
* metricsLimit will be considered as 1 i.e. latest single value of
* metric(s) will be returned. (Optional query param).
* @param metricsTimeStart If specified, returned metrics for the apps would
* not contain metric values before this timestamp(Optional query param).
* @param metricsTimeEnd If specified, returned metrics for the apps would
* not contain metric values after this timestamp(Optional query param).
* @param fromId If specified, retrieve the next set of applications
* from the given fromId. The set of applications retrieved is inclusive
* of specified fromId. fromId should be taken from the value associated
* with FROM_ID info key in entity response which was sent earlier.
*
* @return If successful, a HTTP 200(OK) response having a JSON representing
* a set of <cite>TimelineEntity</cite> instances representing apps is
* returned.<br>
* On failures,<br>
* If any problem occurs in parsing request, HTTP 400(Bad Request) is
* returned.<br>
* For all other errors while retrieving data, HTTP 500(Internal Server
* Error) is returned.
*/
|
Return a list of apps for a given user, cluster id and flow name. If number of matching apps are more than the limit, most recent apps till the limit is reached, will be returned
|
getFlowApps
|
{
"repo_name": "JingchengDu/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderWebServices.java",
"license": "apache-2.0",
"size": 191681
}
|
[
"java.util.Set",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.Produces",
"javax.ws.rs.QueryParam",
"javax.ws.rs.core.Context",
"javax.ws.rs.core.MediaType",
"org.apache.hadoop.http.JettyUtils",
"org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity",
"org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntityType"
] |
import java.util.Set; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import org.apache.hadoop.http.JettyUtils; import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity; import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntityType;
|
import java.util.*; import javax.servlet.http.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.apache.hadoop.http.*; import org.apache.hadoop.yarn.api.records.timelineservice.*;
|
[
"java.util",
"javax.servlet",
"javax.ws",
"org.apache.hadoop"
] |
java.util; javax.servlet; javax.ws; org.apache.hadoop;
| 1,877,477
|
private void drawEvents(Calendar date, float startFromPixel, Canvas canvas) {
if (mEventRects != null && mEventRects.size() > 0) {
for (int i = 0; i < mEventRects.size(); i++) {
if (isSameDay(mEventRects.get(i).event.getStartTime(), date)) {
// Calculate top.
float top = mHourHeight * 24 * mEventRects.get(i).top / 1440 + mCurrentOrigin.y + mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2 + mEventMarginVertical;
float originalTop = top;
if (top < mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2)
top = mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2;
// Calculate bottom.
float bottom = mEventRects.get(i).bottom;
bottom = mHourHeight * 24 * bottom / 1440 + mCurrentOrigin.y + mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2 - mEventMarginVertical;
// Calculate left and right.
float left = startFromPixel + mEventRects.get(i).left * mWidthPerDay;
if (left < startFromPixel)
left += mOverlappingEventGap;
float originalLeft = left;
float right = left + mEventRects.get(i).width * mWidthPerDay;
if (right < startFromPixel + mWidthPerDay)
right -= mOverlappingEventGap;
if (left < mHeaderColumnWidth) left = mHeaderColumnWidth;
// Draw the event and the event name on top of it.
RectF eventRectF = new RectF(left, top, right, bottom);
if (bottom > mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2 && left < right &&
eventRectF.right > mHeaderColumnWidth &&
eventRectF.left < getWidth() &&
eventRectF.bottom > mHeaderTextHeight + mHeaderRowPadding * 2 + mTimeTextHeight / 2 + mHeaderMarginBottom &&
eventRectF.top < getHeight() &&
left < right
) {
mEventRects.get(i).rectF = eventRectF;
mEventBackgroundPaint.setColor(mEventRects.get(i).event.getColor() == 0 ? mDefaultEventColor : mEventRects.get(i).event.getColor());
canvas.drawRect(mEventRects.get(i).rectF, mEventBackgroundPaint);
drawText(mEventRects.get(i).event.getName(), mEventRects.get(i).rectF, canvas, originalTop, originalLeft);
}
else
mEventRects.get(i).rectF = null;
}
}
}
}
|
void function(Calendar date, float startFromPixel, Canvas canvas) { if (mEventRects != null && mEventRects.size() > 0) { for (int i = 0; i < mEventRects.size(); i++) { if (isSameDay(mEventRects.get(i).event.getStartTime(), date)) { float top = mHourHeight * 24 * mEventRects.get(i).top / 1440 + mCurrentOrigin.y + mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2 + mEventMarginVertical; float originalTop = top; if (top < mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2) top = mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2; float bottom = mEventRects.get(i).bottom; bottom = mHourHeight * 24 * bottom / 1440 + mCurrentOrigin.y + mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2 - mEventMarginVertical; float left = startFromPixel + mEventRects.get(i).left * mWidthPerDay; if (left < startFromPixel) left += mOverlappingEventGap; float originalLeft = left; float right = left + mEventRects.get(i).width * mWidthPerDay; if (right < startFromPixel + mWidthPerDay) right -= mOverlappingEventGap; if (left < mHeaderColumnWidth) left = mHeaderColumnWidth; RectF eventRectF = new RectF(left, top, right, bottom); if (bottom > mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom + mTimeTextHeight/2 && left < right && eventRectF.right > mHeaderColumnWidth && eventRectF.left < getWidth() && eventRectF.bottom > mHeaderTextHeight + mHeaderRowPadding * 2 + mTimeTextHeight / 2 + mHeaderMarginBottom && eventRectF.top < getHeight() && left < right ) { mEventRects.get(i).rectF = eventRectF; mEventBackgroundPaint.setColor(mEventRects.get(i).event.getColor() == 0 ? mDefaultEventColor : mEventRects.get(i).event.getColor()); canvas.drawRect(mEventRects.get(i).rectF, mEventBackgroundPaint); drawText(mEventRects.get(i).event.getName(), mEventRects.get(i).rectF, canvas, originalTop, originalLeft); } else mEventRects.get(i).rectF = null; } } } }
|
/**
* Draw all the events of a particular day.
* @param date The day.
* @param startFromPixel The left position of the day area. The events will never go any left from this value.
* @param canvas The canvas to draw upon.
*/
|
Draw all the events of a particular day
|
drawEvents
|
{
"repo_name": "siavash-sajjad/Persian-Week-View",
"path": "library/src/main/java/com/alamkanak/weekview/WeekView.java",
"license": "apache-2.0",
"size": 65086
}
|
[
"android.graphics.Canvas",
"android.graphics.RectF",
"java.util.Calendar"
] |
import android.graphics.Canvas; import android.graphics.RectF; import java.util.Calendar;
|
import android.graphics.*; import java.util.*;
|
[
"android.graphics",
"java.util"
] |
android.graphics; java.util;
| 1,966,306
|
public static int getNbUnreadFor(String userId) {
return (int) countNotReadMessagesOfFolder(userId, "INBOX");
}
|
static int function(String userId) { return (int) countNotReadMessagesOfFolder(userId, "INBOX"); }
|
/**
* Gets the number of unread message of user represented by the given identifier.
* @param userId the identifier of a user.
* @return a number of unread message.
*/
|
Gets the number of unread message of user represented by the given identifier
|
getNbUnreadFor
|
{
"repo_name": "SilverDav/Silverpeas-Core",
"path": "core-library/src/main/java/org/silverpeas/core/notification/user/UserNotificationServerEvent.java",
"license": "agpl-3.0",
"size": 5689
}
|
[
"org.silverpeas.core.notification.user.server.channel.silvermail.SILVERMAILPersistence"
] |
import org.silverpeas.core.notification.user.server.channel.silvermail.SILVERMAILPersistence;
|
import org.silverpeas.core.notification.user.server.channel.silvermail.*;
|
[
"org.silverpeas.core"
] |
org.silverpeas.core;
| 1,472,780
|
public HttpStatusCode statusCode() {
return this.statusCode;
}
|
HttpStatusCode function() { return this.statusCode; }
|
/**
* Get the statusCode value.
*
* @return the statusCode value
*/
|
Get the statusCode value
|
statusCode
|
{
"repo_name": "jianghaolu/azure-sdk-for-java",
"path": "azure-mgmt-dns/src/main/java/com/microsoft/azure/management/dns/implementation/ZoneDeleteResultInner.java",
"license": "mit",
"size": 4010
}
|
[
"com.microsoft.azure.management.dns.HttpStatusCode"
] |
import com.microsoft.azure.management.dns.HttpStatusCode;
|
import com.microsoft.azure.management.dns.*;
|
[
"com.microsoft.azure"
] |
com.microsoft.azure;
| 811,254
|
private List<String> loadSparqlQueries(List<String> fileNames) {
List<File> fileList = new ArrayList<File>();
List<String> queries = new ArrayList<String>();
for (String fileName : fileNames) {
File file = new File(fileName);
if (!file.canRead()) {
LOGGER.warn("cannot read file: " + file);
continue;
}
// handle directory: list all files
if (file.isDirectory()) {
for (File f : file.listFiles()) {
if (f.isFile() && f.canRead()) {
fileList.add(f);
} else {
LOGGER.warn("cannot read file: " + f);
}
}
}
if (file.isFile()) {
fileList.add(file);
}
}
// read query string from files
Collections.sort(fileList);
for (File query : fileList) {
StringBuffer buffer;
try {
buffer = new StringBuffer();
BufferedReader r = new BufferedReader(new FileReader(query));
String input;
while((input = r.readLine()) != null) {
buffer.append(input).append("\n");
}
queries.add(buffer.toString());
} catch (FileNotFoundException e) {
LOGGER.warn("cannot find query file: " + query);
} catch (IOException e) {
LOGGER.warn("cannot read query file: " + query);
}
}
return queries;
}
|
List<String> function(List<String> fileNames) { List<File> fileList = new ArrayList<File>(); List<String> queries = new ArrayList<String>(); for (String fileName : fileNames) { File file = new File(fileName); if (!file.canRead()) { LOGGER.warn(STR + file); continue; } if (file.isDirectory()) { for (File f : file.listFiles()) { if (f.isFile() && f.canRead()) { fileList.add(f); } else { LOGGER.warn(STR + f); } } } if (file.isFile()) { fileList.add(file); } } Collections.sort(fileList); for (File query : fileList) { StringBuffer buffer; try { buffer = new StringBuffer(); BufferedReader r = new BufferedReader(new FileReader(query)); String input; while((input = r.readLine()) != null) { buffer.append(input).append("\n"); } queries.add(buffer.toString()); } catch (FileNotFoundException e) { LOGGER.warn(STR + query); } catch (IOException e) { LOGGER.warn(STR + query); } } return queries; }
|
/**
* Loads SPARQL queries from the supplied files.
*
* @param fileNames The names of the query files.
* @return The list of SPARQL queries.
*/
|
Loads SPARQL queries from the supplied files
|
loadSparqlQueries
|
{
"repo_name": "goerlitz/rdffederator",
"path": "src/de/uni_koblenz/west/splendid/SPLENDID.java",
"license": "lgpl-3.0",
"size": 9498
}
|
[
"java.io.BufferedReader",
"java.io.File",
"java.io.FileNotFoundException",
"java.io.FileReader",
"java.io.IOException",
"java.util.ArrayList",
"java.util.Collections",
"java.util.List"
] |
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 551,840
|
public SparkThriftTransportProtocol thriftTransportProtocol() {
return this.thriftTransportProtocol;
}
|
SparkThriftTransportProtocol function() { return this.thriftTransportProtocol; }
|
/**
* Get the thriftTransportProtocol property: The transport protocol to use in the Thrift layer.
*
* @return the thriftTransportProtocol value.
*/
|
Get the thriftTransportProtocol property: The transport protocol to use in the Thrift layer
|
thriftTransportProtocol
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/SparkLinkedServiceTypeProperties.java",
"license": "mit",
"size": 15323
}
|
[
"com.azure.resourcemanager.datafactory.models.SparkThriftTransportProtocol"
] |
import com.azure.resourcemanager.datafactory.models.SparkThriftTransportProtocol;
|
import com.azure.resourcemanager.datafactory.models.*;
|
[
"com.azure.resourcemanager"
] |
com.azure.resourcemanager;
| 635,349
|
public void setEnvironmentProperties(Map<String, Object> environmentProperties) {
this.environmentProperties = environmentProperties;
}
|
void function(Map<String, Object> environmentProperties) { this.environmentProperties = environmentProperties; }
|
/**
* Sets the environmentProperties property.
*
* @param environmentProperties
*/
|
Sets the environmentProperties property
|
setEnvironmentProperties
|
{
"repo_name": "christophd/citrus",
"path": "endpoints/citrus-jmx/src/main/java/com/consol/citrus/jmx/endpoint/JmxEndpointConfiguration.java",
"license": "apache-2.0",
"size": 8794
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,187,133
|
public Command[] getEndCommands() {
return endCommands;
}
|
Command[] function() { return endCommands; }
|
/**
* Internal use only
**/
|
Internal use only
|
getEndCommands
|
{
"repo_name": "oliverlietz/bd-j",
"path": "AuthoringTools/com.hdcookbook.grin/com.hdcookbook.grin-se/src/main/java/com/hdcookbook/grin/features/SEFade.java",
"license": "bsd-3-clause",
"size": 6688
}
|
[
"com.hdcookbook.grin.commands.Command"
] |
import com.hdcookbook.grin.commands.Command;
|
import com.hdcookbook.grin.commands.*;
|
[
"com.hdcookbook.grin"
] |
com.hdcookbook.grin;
| 505,590
|
public void cancel() {
findElement(By.className("v-grid-editor-cancel")).click();
}
|
void function() { findElement(By.className(STR)).click(); }
|
/**
* Cancels this editor.
* <p>
* <em>Note:</em> that this closes the editor making this element
* useless.
*/
|
Cancels this editor. Note: that this closes the editor making this element useless
|
cancel
|
{
"repo_name": "Darsstar/framework",
"path": "testbench-api/src/main/java/com/vaadin/testbench/elements/GridElement.java",
"license": "apache-2.0",
"size": 16529
}
|
[
"com.vaadin.testbench.By"
] |
import com.vaadin.testbench.By;
|
import com.vaadin.testbench.*;
|
[
"com.vaadin.testbench"
] |
com.vaadin.testbench;
| 191,686
|
public Object deepCopy(final Object value) throws HibernateException {
if (value == null) {
return null;
} else if (value instanceof StatusType) {
return value;
} else {
throw new IllegalArgumentException("Unexpected type that is mapped with " + this.getClass().getSimpleName() + ": " + value.getClass().getName());
}
}
|
Object function(final Object value) throws HibernateException { if (value == null) { return null; } else if (value instanceof StatusType) { return value; } else { throw new IllegalArgumentException(STR + this.getClass().getSimpleName() + STR + value.getClass().getName()); } }
|
/**
* Since {@link java.net.InetAddress} is immutable, we just return the original
* value without copying it.
*/
|
Since <code>java.net.InetAddress</code> is immutable, we just return the original value without copying it
|
deepCopy
|
{
"repo_name": "RangerRick/opennms",
"path": "opennms-model/src/main/java/org/opennms/netmgt/model/StatusTypeUserType.java",
"license": "gpl-2.0",
"size": 4346
}
|
[
"org.hibernate.HibernateException",
"org.opennms.netmgt.model.OnmsArpInterface"
] |
import org.hibernate.HibernateException; import org.opennms.netmgt.model.OnmsArpInterface;
|
import org.hibernate.*; import org.opennms.netmgt.model.*;
|
[
"org.hibernate",
"org.opennms.netmgt"
] |
org.hibernate; org.opennms.netmgt;
| 741,179
|
void preAction(
HttpServletRequest request,
Element[] requestSoapParts,
Map<String, Object> context) throws Exception;
|
void preAction( HttpServletRequest request, Element[] requestSoapParts, Map<String, Object> context) throws Exception;
|
/**
* This is called after the headers have been process but before the
* body (DISCOVER/EXECUTE) has been processed.
*
*/
|
This is called after the headers have been process but before the body (DISCOVER/EXECUTE) has been processed
|
preAction
|
{
"repo_name": "Twixer/mondrian-3.1.5",
"path": "src/main/mondrian/xmla/XmlaRequestCallback.java",
"license": "epl-1.0",
"size": 4350
}
|
[
"java.util.Map",
"javax.servlet.http.HttpServletRequest",
"org.w3c.dom.Element"
] |
import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.w3c.dom.Element;
|
import java.util.*; import javax.servlet.http.*; import org.w3c.dom.*;
|
[
"java.util",
"javax.servlet",
"org.w3c.dom"
] |
java.util; javax.servlet; org.w3c.dom;
| 222,893
|
public void setRouteRefs(List<RouteContextRefDefinition> routeRefs) {
this.routeRefs = routeRefs;
}
|
void function(List<RouteContextRefDefinition> routeRefs) { this.routeRefs = routeRefs; }
|
/**
* Refers to XML routes to include as routes in this CamelContext.
*/
|
Refers to XML routes to include as routes in this CamelContext
|
setRouteRefs
|
{
"repo_name": "mcollovati/camel",
"path": "components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java",
"license": "apache-2.0",
"size": 50811
}
|
[
"java.util.List",
"org.apache.camel.model.RouteContextRefDefinition"
] |
import java.util.List; import org.apache.camel.model.RouteContextRefDefinition;
|
import java.util.*; import org.apache.camel.model.*;
|
[
"java.util",
"org.apache.camel"
] |
java.util; org.apache.camel;
| 549,717
|
public void setRenderer(final Component renderer) {
this.renderer = renderer;
}
|
void function(final Component renderer) { this.renderer = renderer; }
|
/**
* DOCUMENT ME!
*
* @param renderer DOCUMENT ME!
*/
|
DOCUMENT ME
|
setRenderer
|
{
"repo_name": "cismet/cids-navigator",
"path": "src/main/java/Sirius/navigator/ui/CidsMetaObjectBreadCrumb.java",
"license": "gpl-3.0",
"size": 2057
}
|
[
"java.awt.Component"
] |
import java.awt.Component;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 2,858,597
|
public void clearParameters() throws SQLException
{
if (statement_ != null)
statement_.clearParameters();
}
|
void function() throws SQLException { if (statement_ != null) statement_.clearParameters(); }
|
/**
* Clears the columns for the current row and releases all associated resources.
* @exception SQLException If a database error occurs.
**/
|
Clears the columns for the current row and releases all associated resources
|
clearParameters
|
{
"repo_name": "piguangming/jt400",
"path": "cvsroot/src/com/ibm/as400/access/AS400JDBCRowSet.java",
"license": "epl-1.0",
"size": 311708
}
|
[
"java.sql.SQLException"
] |
import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,810,321
|
@Test
public void shouldMarshalSingleLine() throws Exception {
template.sendBody("direct:default", asMap("A", "1", "B", "2", "C", "3"));
result.expectedMessageCount(1);
result.assertIsSatisfied();
String body = assertIsInstanceOf(String.class, result.getExchanges().get(0).getIn().getBody());
assertEquals(join("1\t2\t3"), body);
}
|
void function() throws Exception { template.sendBody(STR, asMap("A", "1", "B", "2", "C", "3")); result.expectedMessageCount(1); result.assertIsSatisfied(); String body = assertIsInstanceOf(String.class, result.getExchanges().get(0).getIn().getBody()); assertEquals(join(STR), body); }
|
/**
* Tests that we can marshal a single line with TSV.
*/
|
Tests that we can marshal a single line with TSV
|
shouldMarshalSingleLine
|
{
"repo_name": "ullgren/camel",
"path": "components/camel-univocity-parsers/src/test/java/org/apache/camel/dataformat/univocity/UniVocityTsvDataFormatMarshalTest.java",
"license": "apache-2.0",
"size": 5609
}
|
[
"org.apache.camel.dataformat.univocity.UniVocityTestHelper",
"org.apache.camel.test.junit5.TestSupport",
"org.junit.jupiter.api.Assertions"
] |
import org.apache.camel.dataformat.univocity.UniVocityTestHelper; import org.apache.camel.test.junit5.TestSupport; import org.junit.jupiter.api.Assertions;
|
import org.apache.camel.dataformat.univocity.*; import org.apache.camel.test.junit5.*; import org.junit.jupiter.api.*;
|
[
"org.apache.camel",
"org.junit.jupiter"
] |
org.apache.camel; org.junit.jupiter;
| 2,474,659
|
protected void enterDefval(Token node) throws ParseException {
}
|
void function(Token node) throws ParseException { }
|
/**
* Called when entering a parse tree node.
*
* @param node the node being entered
*
* @throws ParseException if the node analysis discovered errors
*/
|
Called when entering a parse tree node
|
enterDefval
|
{
"repo_name": "richb-hanover/mibble-2.9.2",
"path": "src/java/net/percederberg/mibble/asn1/Asn1Analyzer.java",
"license": "gpl-2.0",
"size": 275483
}
|
[
"net.percederberg.grammatica.parser.ParseException",
"net.percederberg.grammatica.parser.Token"
] |
import net.percederberg.grammatica.parser.ParseException; import net.percederberg.grammatica.parser.Token;
|
import net.percederberg.grammatica.parser.*;
|
[
"net.percederberg.grammatica"
] |
net.percederberg.grammatica;
| 447,475
|
public List<OrderGroup> getOrderGroups() {
Map<String, OrderGroup> orderGroups = new HashMap<String, OrderGroup>();
for (Order order : orders) {
if (order.getOrderGroup() != null) {
if (null == orderGroups.get(order.getOrderGroup().getUuid())) {
orderGroups.put(order.getOrderGroup().getUuid(), order.getOrderGroup());
}
order.getOrderGroup().addOrder(order, null);
}
}
List<OrderGroup> orderGroupList = new ArrayList<OrderGroup>();
orderGroupList.addAll(orderGroups.values());
return orderGroupList;
}
|
List<OrderGroup> function() { Map<String, OrderGroup> orderGroups = new HashMap<String, OrderGroup>(); for (Order order : orders) { if (order.getOrderGroup() != null) { if (null == orderGroups.get(order.getOrderGroup().getUuid())) { orderGroups.put(order.getOrderGroup().getUuid(), order.getOrderGroup()); } order.getOrderGroup().addOrder(order, null); } } List<OrderGroup> orderGroupList = new ArrayList<OrderGroup>(); orderGroupList.addAll(orderGroups.values()); return orderGroupList; }
|
/**
* Takes in a list of orders and pulls out the orderGroups within them
*
* @since 1.12
* @return list of orderGroups
*/
|
Takes in a list of orders and pulls out the orderGroups within them
|
getOrderGroups
|
{
"repo_name": "preethi29/openmrs-core",
"path": "api/src/main/java/org/openmrs/Encounter.java",
"license": "mpl-2.0",
"size": 21436
}
|
[
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] |
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,638,161
|
static public Object loadFile(String in, Object inFileEnc, Env env) {
if (Logger.debuglevelp(env)) {
Logger.debug("[loadFile] in: ~S",
Lists.list(in), env);
Logger.debug("[loadFile] inFileEnc: ~S",
Lists.list(inFileEnc), env);
}
String inLisp, inFasl;
if (in.endsWith(".lisp")) {
inLisp = in;
inFasl = null;
}
else if (in.endsWith(".fasl")) {
inLisp = null;
inFasl = in;
}
else {
inLisp = in+".lisp";
inFasl = in+".fasl";
}
File dir = IO.dir(Symbols.LOAD_DIR, env);
File inFile;
if (inLisp != null && inFasl == null)
inFile = new File(dir, inLisp);
else if (inLisp == null && inFasl != null)
inFile = new File(dir, inFasl);
else {
File inLispFile = new File(dir, inLisp);
File inFaslFile = new File(dir, inFasl);
boolean inLispFileExists = inLispFile.exists();
boolean inFaslFileExists = inFaslFile.exists();
long inLispLastMod = inLispFileExists
? inLispFile.lastModified() : Long.MIN_VALUE;
long inFaslLastMod = inFaslFileExists
? inFaslFile.lastModified() : Long.MIN_VALUE;
if (inLispLastMod < inFaslLastMod) {
inFile = inFaslFile;
}
else {
if (inLispFileExists && inFaslFileExists)
Logger.warn("[loadFile] ~S is older than ~S.~%"+
"Loading LISP file...~%",
Lists.list(inFasl, inLisp), env);
inFile = inLispFile;
}
}
if (Logger.debuglevelp(env))
Logger.debug("[loadFile] inFile=~S",
Lists.list(inFile), env);
Package currpkg = Package.get(env);
{
Env newenv = env.child();
// bind Loader.MyClassLoader
bindInternalClassLoader(newenv);
// preserve current package
newenv.bind(Symbols.PACKAGE, currpkg);
InputStream inputStream = null;
try {
inputStream = IO.openInputStream(inFile);
java.io.Reader r;
r = IO.toReader(inputStream, inFileEnc);
r = IO.wrapReader(r, Symbols.T);
Object exp;
while (true) {
exp = Reader.read(r, Symbols.NIL, IO.EOF,
Symbols.NIL, newenv);
if (exp == IO.EOF) {
return Symbols.T;
}
Evaluator.eval(exp, newenv);
}
}
finally {
IO.close(inputStream);
}
}
}
|
static Object function(String in, Object inFileEnc, Env env) { if (Logger.debuglevelp(env)) { Logger.debug(STR, Lists.list(in), env); Logger.debug(STR, Lists.list(inFileEnc), env); } String inLisp, inFasl; if (in.endsWith(".lisp")) { inLisp = in; inFasl = null; } else if (in.endsWith(".fasl")) { inLisp = null; inFasl = in; } else { inLisp = in+".lisp"; inFasl = in+".fasl"; } File dir = IO.dir(Symbols.LOAD_DIR, env); File inFile; if (inLisp != null && inFasl == null) inFile = new File(dir, inLisp); else if (inLisp == null && inFasl != null) inFile = new File(dir, inFasl); else { File inLispFile = new File(dir, inLisp); File inFaslFile = new File(dir, inFasl); boolean inLispFileExists = inLispFile.exists(); boolean inFaslFileExists = inFaslFile.exists(); long inLispLastMod = inLispFileExists ? inLispFile.lastModified() : Long.MIN_VALUE; long inFaslLastMod = inFaslFileExists ? inFaslFile.lastModified() : Long.MIN_VALUE; if (inLispLastMod < inFaslLastMod) { inFile = inFaslFile; } else { if (inLispFileExists && inFaslFileExists) Logger.warn(STR+ STR, Lists.list(inFasl, inLisp), env); inFile = inLispFile; } } if (Logger.debuglevelp(env)) Logger.debug(STR, Lists.list(inFile), env); Package currpkg = Package.get(env); { Env newenv = env.child(); bindInternalClassLoader(newenv); newenv.bind(Symbols.PACKAGE, currpkg); InputStream inputStream = null; try { inputStream = IO.openInputStream(inFile); java.io.Reader r; r = IO.toReader(inputStream, inFileEnc); r = IO.wrapReader(r, Symbols.T); Object exp; while (true) { exp = Reader.read(r, Symbols.NIL, IO.EOF, Symbols.NIL, newenv); if (exp == IO.EOF) { return Symbols.T; } Evaluator.eval(exp, newenv); } } finally { IO.close(inputStream); } } }
|
/**
* Loads a file denoted by <code>in</code> onto the lisp environment.
* @param in Name of the input file.
* If a file extension is either ".lisp" or ".fasl", then this
* method loads a file specified by <code>in</code>.
* Else, the method creates two pathname
* <code>in + ".fasl"</code>, <code>in + ".lisp"</code>
* and for each pathname tests whether a file denoted by the
* pathname exists. If none of these files exist, then the method
* throws {@link lapin.io.FileException}. Else if either of these
* files exists (but not both), then the method loads the existing
* one. Else, by comparing a timestamp of these files, this method
* loads the newer one.
* @param inFileEnc Character encoding for the input file.
* If NIL is specified, then the platform's default
* character encoding is used.
* @param env
* @return T
* @throws lapin.io.FileException
* @throws lapin.io.StreamException
* @throws lapin.eval.Evaluator.Exception
*/
|
Loads a file denoted by <code>in</code> onto the lisp environment
|
loadFile
|
{
"repo_name": "hz7k-nzw/lapin",
"path": "src/lapin/load/Loader.java",
"license": "gpl-2.0",
"size": 21404
}
|
[
"java.io.File",
"java.io.InputStream"
] |
import java.io.File; import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,259,498
|
public Transition generateNextTransition(RectF drawableBounds, RectF viewport);
|
Transition function(RectF drawableBounds, RectF viewport);
|
/**
* Generates the next transition to be played by the {@link KenBurnsView}.
* @param drawableBounds the bounds of the drawable to be shown in the {@link KenBurnsView}.
* @param viewport the rect that represents the viewport where
* the transition will be played in. This is usually the bounds of the
* {@link KenBurnsView}.
* @return a {@link Transition} object to be played by the {@link KenBurnsView}.
*/
|
Generates the next transition to be played by the <code>KenBurnsView</code>
|
generateNextTransition
|
{
"repo_name": "topicosdcc/App-QUIZ-STAR-WARS-Sqlite",
"path": "app/src/main/java/com/ufrr/quizvestibularufrr/libraryKenburnsView/TransitionGenerator.java",
"license": "apache-2.0",
"size": 1293
}
|
[
"android.graphics.RectF"
] |
import android.graphics.RectF;
|
import android.graphics.*;
|
[
"android.graphics"
] |
android.graphics;
| 2,824,919
|
@Test
public void test() {
double expected = Math.log(3 * 2 * 1); //T(4) = 3!
double actual = (new LogGamma(4)).get();
assertEquals(expected, actual, 0.00001d);
expected = Math.log(9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1); //T(10) = 9!
actual = (new LogGamma(10)).get();
assertEquals(expected, actual, 0.00001d);
}
|
void function() { double expected = Math.log(3 * 2 * 1); double actual = (new LogGamma(4)).get(); assertEquals(expected, actual, 0.00001d); expected = Math.log(9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1); actual = (new LogGamma(10)).get(); assertEquals(expected, actual, 0.00001d); }
|
/**
* Tests log gamma computation.
*/
|
Tests log gamma computation
|
test
|
{
"repo_name": "vangj/multdir-core",
"path": "src/test/java/net/multdir/log/LogGammaTests.java",
"license": "apache-2.0",
"size": 596
}
|
[
"net.multdir.log.LogGamma",
"org.junit.Assert"
] |
import net.multdir.log.LogGamma; import org.junit.Assert;
|
import net.multdir.log.*; import org.junit.*;
|
[
"net.multdir.log",
"org.junit"
] |
net.multdir.log; org.junit;
| 2,729,825
|
private JComponent getTopLevelRightPanel(boolean functionPaneRequired)
{
JSplitPane topBottomSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
DefaultSettings.setDefaultFeatureForJSplitPane(topBottomSplitPane);
topBottomSplitPane.setDividerLocation(0.5);
functionPane = new FunctionLibraryPane();
functionPane.setBorder(BorderFactory.createTitledBorder("Functions"));
if(functionPaneRequired)
{
topBottomSplitPane.setTopComponent(functionPane);
}
propertiesPane = new DefaultPropertiesPage(this.getMappingDataManager().getPropertiesSwitchController());
topBottomSplitPane.setBottomComponent(propertiesPane);
double topCenterFactor = 0.3;
Dimension rightMostDim = new Dimension((int) (Config.FRAME_DEFAULT_WIDTH / 11), (int) (Config.FRAME_DEFAULT_HEIGHT * topCenterFactor));
propertiesPane.setPreferredSize(rightMostDim);
functionPane.setPreferredSize(rightMostDim);
functionPane.getFunctionTree().getSelectionModel().addTreeSelectionListener((TreeSelectionListener) (getMappingDataManager().getPropertiesSwitchController()));
topCenterFactor = 1.5;
rightMostDim = new Dimension((int) (Config.FRAME_DEFAULT_WIDTH / 10), (int) (Config.FRAME_DEFAULT_HEIGHT / topCenterFactor));
topBottomSplitPane.setSize(rightMostDim);
return topBottomSplitPane;
}
|
JComponent function(boolean functionPaneRequired) { JSplitPane topBottomSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); DefaultSettings.setDefaultFeatureForJSplitPane(topBottomSplitPane); topBottomSplitPane.setDividerLocation(0.5); functionPane = new FunctionLibraryPane(); functionPane.setBorder(BorderFactory.createTitledBorder(STR)); if(functionPaneRequired) { topBottomSplitPane.setTopComponent(functionPane); } propertiesPane = new DefaultPropertiesPage(this.getMappingDataManager().getPropertiesSwitchController()); topBottomSplitPane.setBottomComponent(propertiesPane); double topCenterFactor = 0.3; Dimension rightMostDim = new Dimension((int) (Config.FRAME_DEFAULT_WIDTH / 11), (int) (Config.FRAME_DEFAULT_HEIGHT * topCenterFactor)); propertiesPane.setPreferredSize(rightMostDim); functionPane.setPreferredSize(rightMostDim); functionPane.getFunctionTree().getSelectionModel().addTreeSelectionListener((TreeSelectionListener) (getMappingDataManager().getPropertiesSwitchController())); topCenterFactor = 1.5; rightMostDim = new Dimension((int) (Config.FRAME_DEFAULT_WIDTH / 10), (int) (Config.FRAME_DEFAULT_HEIGHT / topCenterFactor)); topBottomSplitPane.setSize(rightMostDim); return topBottomSplitPane; }
|
/**
* This constructs function and properties panels.
*
* @return the top level right pane.
*/
|
This constructs function and properties panels
|
getTopLevelRightPanel
|
{
"repo_name": "NCIP/caadapter",
"path": "software/caadapter/src/java/gov/nih/nci/caadapter/ui/mapping/AbstractMappingPanel.java",
"license": "bsd-3-clause",
"size": 15412
}
|
[
"gov.nih.nci.caadapter.common.util.Config",
"gov.nih.nci.caadapter.ui.common.DefaultSettings",
"gov.nih.nci.caadapter.ui.common.functions.FunctionLibraryPane",
"gov.nih.nci.caadapter.ui.common.properties.DefaultPropertiesPage",
"java.awt.Dimension",
"javax.swing.BorderFactory",
"javax.swing.JComponent",
"javax.swing.JSplitPane",
"javax.swing.event.TreeSelectionListener"
] |
import gov.nih.nci.caadapter.common.util.Config; import gov.nih.nci.caadapter.ui.common.DefaultSettings; import gov.nih.nci.caadapter.ui.common.functions.FunctionLibraryPane; import gov.nih.nci.caadapter.ui.common.properties.DefaultPropertiesPage; import java.awt.Dimension; import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JSplitPane; import javax.swing.event.TreeSelectionListener;
|
import gov.nih.nci.caadapter.common.util.*; import gov.nih.nci.caadapter.ui.common.*; import gov.nih.nci.caadapter.ui.common.functions.*; import gov.nih.nci.caadapter.ui.common.properties.*; import java.awt.*; import javax.swing.*; import javax.swing.event.*;
|
[
"gov.nih.nci",
"java.awt",
"javax.swing"
] |
gov.nih.nci; java.awt; javax.swing;
| 2,680,368
|
@Test
public void testToADNodeConnector() throws ConstructionException {
NodeId nodeId = new NodeId("openflow:1");
TpId source = new TpId("foo:2");
NodeConnector observedNodeConnector = TopologyMapping.toADNodeConnector(source, nodeId);
Assert.assertEquals("OF|2@OF|00:00:00:00:00:00:00:01", observedNodeConnector.toString());
}
|
void function() throws ConstructionException { NodeId nodeId = new NodeId(STR); TpId source = new TpId("foo:2"); NodeConnector observedNodeConnector = TopologyMapping.toADNodeConnector(source, nodeId); Assert.assertEquals(STR, observedNodeConnector.toString()); }
|
/**
* Test method for {@link org.opendaylight.controller.sal.compatibility.topology.TopologyMapping#toADNodeConnector(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)}.
* @throws ConstructionException
*/
|
Test method for <code>org.opendaylight.controller.sal.compatibility.topology.TopologyMapping#toADNodeConnector(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)</code>
|
testToADNodeConnector
|
{
"repo_name": "aryantaheri/controller",
"path": "opendaylight/md-sal/compatibility/sal-compatibility/src/test/java/org/opendaylight/controller/sal/compatibility/topology/test/TopologyMappingTest.java",
"license": "epl-1.0",
"size": 3145
}
|
[
"junit.framework.Assert",
"org.opendaylight.controller.sal.compatibility.topology.TopologyMapping",
"org.opendaylight.controller.sal.core.ConstructionException",
"org.opendaylight.controller.sal.core.NodeConnector",
"org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId",
"org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId"
] |
import junit.framework.Assert; import org.opendaylight.controller.sal.compatibility.topology.TopologyMapping; import org.opendaylight.controller.sal.core.ConstructionException; import org.opendaylight.controller.sal.core.NodeConnector; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId;
|
import junit.framework.*; import org.opendaylight.controller.sal.compatibility.topology.*; import org.opendaylight.controller.sal.core.*; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.*;
|
[
"junit.framework",
"org.opendaylight.controller",
"org.opendaylight.yang"
] |
junit.framework; org.opendaylight.controller; org.opendaylight.yang;
| 2,477,641
|
public Value getBlue() throws DOMException {
throw createDOMException();
}
|
Value function() throws DOMException { throw createDOMException(); }
|
/**
* Implements {@link Value#getBlue()}.
*/
|
Implements <code>Value#getBlue()</code>
|
getBlue
|
{
"repo_name": "apache/batik",
"path": "batik-css/src/main/java/org/apache/batik/css/engine/value/AbstractValue.java",
"license": "apache-2.0",
"size": 3958
}
|
[
"org.w3c.dom.DOMException"
] |
import org.w3c.dom.DOMException;
|
import org.w3c.dom.*;
|
[
"org.w3c.dom"
] |
org.w3c.dom;
| 697,096
|
@SuppressWarnings("all")
protected void addEmptyNewAwardReportTerms(
Map<String, Object> hashMap, List<KeyValue> reportClasses){
List<AwardReportTerm> newAwardReportTerms = new ArrayList<AwardReportTerm>();
for(KeyValue KeyValue : reportClasses){
newAwardReportTerms.add(new AwardReportTerm());
}
hashMap.put(
Constants.NEW_AWARD_REPORT_TERMS_LIST_KEY_FOR_INITIALIZE_OBJECTS, newAwardReportTerms);
}
|
@SuppressWarnings("all") void function( Map<String, Object> hashMap, List<KeyValue> reportClasses){ List<AwardReportTerm> newAwardReportTerms = new ArrayList<AwardReportTerm>(); for(KeyValue KeyValue : reportClasses){ newAwardReportTerms.add(new AwardReportTerm()); } hashMap.put( Constants.NEW_AWARD_REPORT_TERMS_LIST_KEY_FOR_INITIALIZE_OBJECTS, newAwardReportTerms); }
|
/**
*
* This method is a helper method for assignReportClassesForPanelHeaderDisplay
*
* @param hashMap
* @param reportClasses
* @return
*/
|
This method is a helper method for assignReportClassesForPanelHeaderDisplay
|
addEmptyNewAwardReportTerms
|
{
"repo_name": "blackcathacker/kc.preclean",
"path": "coeus-code/src/main/java/org/kuali/kra/award/service/impl/AwardReportsServiceImpl.java",
"license": "apache-2.0",
"size": 8402
}
|
[
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"org.kuali.kra.award.paymentreports.awardreports.AwardReportTerm",
"org.kuali.kra.infrastructure.Constants",
"org.kuali.rice.core.api.util.KeyValue"
] |
import java.util.ArrayList; import java.util.List; import java.util.Map; import org.kuali.kra.award.paymentreports.awardreports.AwardReportTerm; import org.kuali.kra.infrastructure.Constants; import org.kuali.rice.core.api.util.KeyValue;
|
import java.util.*; import org.kuali.kra.award.paymentreports.awardreports.*; import org.kuali.kra.infrastructure.*; import org.kuali.rice.core.api.util.*;
|
[
"java.util",
"org.kuali.kra",
"org.kuali.rice"
] |
java.util; org.kuali.kra; org.kuali.rice;
| 2,240,856
|
private static HashMap<String, String> createLookupMap(ResourceBundle baseBundle) {
final ArrayList<String> baseKeys = Collections.list(baseBundle.getKeys());
return new HashMap<>(baseKeys.stream().collect(
Collectors.toMap(
key -> new LocalizationKey(key).getTranslationValue(),
key -> new LocalizationKey(baseBundle.getString(key)).getTranslationValue())
));
}
/**
* This looks up a key in the bundle and replaces parameters %0, ..., %9 with the respective params given. Note that
* the keys are the "unescaped" strings from the bundle property files.
*
* @param bundle The {@link LocalizationBundle} which means either {@link Localization#localizedMenuTitles}
|
static HashMap<String, String> function(ResourceBundle baseBundle) { final ArrayList<String> baseKeys = Collections.list(baseBundle.getKeys()); return new HashMap<>(baseKeys.stream().collect( Collectors.toMap( key -> new LocalizationKey(key).getTranslationValue(), key -> new LocalizationKey(baseBundle.getString(key)).getTranslationValue()) )); } /** * This looks up a key in the bundle and replaces parameters %0, ..., %9 with the respective params given. Note that * the keys are the STR strings from the bundle property files. * * @param bundle The {@link LocalizationBundle} which means either {@link Localization#localizedMenuTitles}
|
/**
* Helper function to create a HashMap from the key/value pairs of a bundle.
*
* @param baseBundle JabRef language bundle with keys and values for translations.
* @return Lookup map for the baseBundle.
*/
|
Helper function to create a HashMap from the key/value pairs of a bundle
|
createLookupMap
|
{
"repo_name": "oscargus/jabref",
"path": "src/main/java/org/jabref/logic/l10n/Localization.java",
"license": "mit",
"size": 8856
}
|
[
"java.util.ArrayList",
"java.util.Collections",
"java.util.HashMap",
"java.util.ResourceBundle",
"java.util.stream.Collectors"
] |
import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.ResourceBundle; import java.util.stream.Collectors;
|
import java.util.*; import java.util.stream.*;
|
[
"java.util"
] |
java.util;
| 168,016
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
boolean flag = true;
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, flag);
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
{
return par1ItemStack;
}
if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
{
return par1ItemStack;
}
if (par2World.getBlockMaterial(i, j, k) == Material.water && par2World.getBlockMetadata(i, j, k) == 0)
{
par2World.setBlockToAir(i, j, k);
if (--par1ItemStack.stackSize <= 0)
{
return new ItemStack(ItemObjectCPU.WaterCell);
}
if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ItemObjectCPU.WaterCell)))
{
par3EntityPlayer.dropPlayerItem(new ItemStack(Ids.actualWaterCell, 1, 0));
}
return par1ItemStack;
}
if (par2World.getBlockMaterial(i, j, k) == Material.lava && par2World.getBlockMetadata(i, j, k) == 0)
{
par2World.setBlockToAir(i, j, k);
if (--par1ItemStack.stackSize <= 0)
{
return new ItemStack(ItemObjectCPU.LavaCell);
}
if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ItemObjectCPU.LavaCell)))
{
par3EntityPlayer.dropPlayerItem(new ItemStack(Ids.actualLavaCell, 1, 0));
}
return par1ItemStack;
}
}
return par1ItemStack;
}
|
ItemStack function(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { boolean flag = true; MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, flag); if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE) { int i = movingobjectposition.blockX; int j = movingobjectposition.blockY; int k = movingobjectposition.blockZ; if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) { return par1ItemStack; } if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) { return par1ItemStack; } if (par2World.getBlockMaterial(i, j, k) == Material.water && par2World.getBlockMetadata(i, j, k) == 0) { par2World.setBlockToAir(i, j, k); if (--par1ItemStack.stackSize <= 0) { return new ItemStack(ItemObjectCPU.WaterCell); } if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ItemObjectCPU.WaterCell))) { par3EntityPlayer.dropPlayerItem(new ItemStack(Ids.actualWaterCell, 1, 0)); } return par1ItemStack; } if (par2World.getBlockMaterial(i, j, k) == Material.lava && par2World.getBlockMetadata(i, j, k) == 0) { par2World.setBlockToAir(i, j, k); if (--par1ItemStack.stackSize <= 0) { return new ItemStack(ItemObjectCPU.LavaCell); } if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ItemObjectCPU.LavaCell))) { par3EntityPlayer.dropPlayerItem(new ItemStack(Ids.actualLavaCell, 1, 0)); } return par1ItemStack; } } return par1ItemStack; }
|
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
|
Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
onItemRightClick
|
{
"repo_name": "theflogat/Theflogats-Mods",
"path": "fr/theflogat/chemicalPhysics/items/cells/EmptyCell.java",
"license": "lgpl-3.0",
"size": 3887
}
|
[
"fr.theflogat.chemicalPhysics.api.ItemObjectCPU",
"fr.theflogat.chemicalPhysics.lib.config.Ids",
"net.minecraft.block.material.Material",
"net.minecraft.entity.player.EntityPlayer",
"net.minecraft.item.ItemStack",
"net.minecraft.util.EnumMovingObjectType",
"net.minecraft.util.MovingObjectPosition",
"net.minecraft.world.World"
] |
import fr.theflogat.chemicalPhysics.api.ItemObjectCPU; import fr.theflogat.chemicalPhysics.lib.config.Ids; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumMovingObjectType; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World;
|
import fr.theflogat.*; import net.minecraft.block.material.*; import net.minecraft.entity.player.*; import net.minecraft.item.*; import net.minecraft.util.*; import net.minecraft.world.*;
|
[
"fr.theflogat",
"net.minecraft.block",
"net.minecraft.entity",
"net.minecraft.item",
"net.minecraft.util",
"net.minecraft.world"
] |
fr.theflogat; net.minecraft.block; net.minecraft.entity; net.minecraft.item; net.minecraft.util; net.minecraft.world;
| 2,356,845
|
public List<ExitCodeRangeMapping> exitCodeRanges() {
return this.exitCodeRanges;
}
|
List<ExitCodeRangeMapping> function() { return this.exitCodeRanges; }
|
/**
* Get the exitCodeRanges value.
*
* @return the exitCodeRanges value
*/
|
Get the exitCodeRanges value
|
exitCodeRanges
|
{
"repo_name": "anudeepsharma/azure-sdk-for-java",
"path": "azure-batch/src/main/java/com/microsoft/azure/batch/protocol/models/ExitConditions.java",
"license": "mit",
"size": 3408
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 305,860
|
public void unfreeze() throws StandardException;
|
void function() throws StandardException;
|
/**
* Unfreeze the database after a backup has been taken.
* <P>Please see Derby on line documentation on backup and restore.
*
* @exception StandardException Thrown on error
*/
|
Unfreeze the database after a backup has been taken. Please see Derby on line documentation on backup and restore
|
unfreeze
|
{
"repo_name": "apache/derby",
"path": "java/org.apache.derby.engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java",
"license": "apache-2.0",
"size": 41291
}
|
[
"org.apache.derby.shared.common.error.StandardException"
] |
import org.apache.derby.shared.common.error.StandardException;
|
import org.apache.derby.shared.common.error.*;
|
[
"org.apache.derby"
] |
org.apache.derby;
| 2,716,239
|
protected SSLEngineResult.HandshakeStatus tasks() {
Runnable r = null;
while ( (r = sslEngine.getDelegatedTask()) != null) {
r.run();
}
return sslEngine.getHandshakeStatus();
}
|
SSLEngineResult.HandshakeStatus function() { Runnable r = null; while ( (r = sslEngine.getDelegatedTask()) != null) { r.run(); } return sslEngine.getHandshakeStatus(); }
|
/**
* Executes all the tasks needed on the same thread.
* @return HandshakeStatus
*/
|
Executes all the tasks needed on the same thread
|
tasks
|
{
"repo_name": "WhiteBearSolutions/WBSAirback",
"path": "packages/wbsairback-tomcat/wbsairback-tomcat-7.0.22/java/org/apache/tomcat/util/net/SecureNioChannel.java",
"license": "apache-2.0",
"size": 22952
}
|
[
"javax.net.ssl.SSLEngineResult"
] |
import javax.net.ssl.SSLEngineResult;
|
import javax.net.ssl.*;
|
[
"javax.net"
] |
javax.net;
| 2,047,009
|
static ImmutableSet<String> incrementalDexopts(RuleContext ruleContext,
Iterable<String> tokenizedDexopts) {
if (ruleContext.getConfiguration().isCodeCoverageEnabled()) {
// TODO(bazel-team): Still needed? No longer done in AndroidCommon.createDexAction
tokenizedDexopts = Iterables.concat(tokenizedDexopts, ImmutableList.of("--no-locals"));
}
return normalizeDexopts(
Iterables.filter(
tokenizedDexopts,
// dexopts have to match exactly since aspect only creates archives for listed ones
Predicates.in(getAndroidConfig(ruleContext).getDexoptsSupportedInIncrementalDexing())));
}
|
static ImmutableSet<String> incrementalDexopts(RuleContext ruleContext, Iterable<String> tokenizedDexopts) { if (ruleContext.getConfiguration().isCodeCoverageEnabled()) { tokenizedDexopts = Iterables.concat(tokenizedDexopts, ImmutableList.of(STR)); } return normalizeDexopts( Iterables.filter( tokenizedDexopts, Predicates.in(getAndroidConfig(ruleContext).getDexoptsSupportedInIncrementalDexing()))); }
|
/**
* Derives options to use in incremental dexing actions from the given context and dx flags, where
* the latter typically come from a {@code dexopts} attribute on a top-level target. This method
* only works reliably if the given dexopts were tokenized, e.g., using
* {@link RuleContext#getTokenizedStringListAttr}.
*/
|
Derives options to use in incremental dexing actions from the given context and dx flags, where the latter typically come from a dexopts attribute on a top-level target. This method only works reliably if the given dexopts were tokenized, e.g., using <code>RuleContext#getTokenizedStringListAttr</code>
|
incrementalDexopts
|
{
"repo_name": "damienmg/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/android/DexArchiveAspect.java",
"license": "apache-2.0",
"size": 25755
}
|
[
"com.google.common.base.Predicates",
"com.google.common.collect.ImmutableList",
"com.google.common.collect.ImmutableSet",
"com.google.common.collect.Iterables",
"com.google.devtools.build.lib.analysis.RuleContext"
] |
import com.google.common.base.Predicates; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.devtools.build.lib.analysis.RuleContext;
|
import com.google.common.base.*; import com.google.common.collect.*; import com.google.devtools.build.lib.analysis.*;
|
[
"com.google.common",
"com.google.devtools"
] |
com.google.common; com.google.devtools;
| 728,357
|
public List<CmsRelation> getRelationsForResource(CmsDbContext dbc, CmsResource resource, CmsRelationFilter filter)
throws CmsException {
CmsUUID projectId = getProjectIdForContext(dbc);
return getVfsDriver(dbc).readRelations(dbc, projectId, resource, filter);
}
|
List<CmsRelation> function(CmsDbContext dbc, CmsResource resource, CmsRelationFilter filter) throws CmsException { CmsUUID projectId = getProjectIdForContext(dbc); return getVfsDriver(dbc).readRelations(dbc, projectId, resource, filter); }
|
/**
* Returns all relations for the given resource matching the given filter.<p>
*
* @param dbc the current db context
* @param resource the resource to retrieve the relations for
* @param filter the filter to match the relation
*
* @return all relations for the given resource matching the given filter
*
* @throws CmsException if something goes wrong
*
* @see CmsSecurityManager#getRelationsForResource(CmsRequestContext, CmsResource, CmsRelationFilter)
*/
|
Returns all relations for the given resource matching the given filter
|
getRelationsForResource
|
{
"repo_name": "ggiudetti/opencms-core",
"path": "src/org/opencms/db/CmsDriverManager.java",
"license": "lgpl-2.1",
"size": 494693
}
|
[
"java.util.List",
"org.opencms.file.CmsResource",
"org.opencms.main.CmsException",
"org.opencms.relations.CmsRelation",
"org.opencms.relations.CmsRelationFilter",
"org.opencms.util.CmsUUID"
] |
import java.util.List; import org.opencms.file.CmsResource; import org.opencms.main.CmsException; import org.opencms.relations.CmsRelation; import org.opencms.relations.CmsRelationFilter; import org.opencms.util.CmsUUID;
|
import java.util.*; import org.opencms.file.*; import org.opencms.main.*; import org.opencms.relations.*; import org.opencms.util.*;
|
[
"java.util",
"org.opencms.file",
"org.opencms.main",
"org.opencms.relations",
"org.opencms.util"
] |
java.util; org.opencms.file; org.opencms.main; org.opencms.relations; org.opencms.util;
| 2,877,381
|
ReservationInterval computeExecutionInterval(Plan plan,
ReservationDefinition reservation,
ReservationRequest currentReservationStage, boolean allocateLeft,
RLESparseResourceAllocation allocations);
|
ReservationInterval computeExecutionInterval(Plan plan, ReservationDefinition reservation, ReservationRequest currentReservationStage, boolean allocateLeft, RLESparseResourceAllocation allocations);
|
/**
* Computes the earliest allowed starting time for a given stage.
*
* @param plan the Plan to which the reservation must be fitted
* @param reservation the job contract
* @param currentReservationStage the stage
* @param allocateLeft is the job allocated from left to right
* @param allocations Existing resource assignments for the job
* @return the time interval in which the stage can get resources.
*/
|
Computes the earliest allowed starting time for a given stage
|
computeExecutionInterval
|
{
"repo_name": "legend-hua/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/planning/StageExecutionInterval.java",
"license": "apache-2.0",
"size": 2108
}
|
[
"org.apache.hadoop.yarn.api.records.ReservationDefinition",
"org.apache.hadoop.yarn.api.records.ReservationRequest",
"org.apache.hadoop.yarn.server.resourcemanager.reservation.Plan",
"org.apache.hadoop.yarn.server.resourcemanager.reservation.RLESparseResourceAllocation",
"org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationInterval"
] |
import org.apache.hadoop.yarn.api.records.ReservationDefinition; import org.apache.hadoop.yarn.api.records.ReservationRequest; import org.apache.hadoop.yarn.server.resourcemanager.reservation.Plan; import org.apache.hadoop.yarn.server.resourcemanager.reservation.RLESparseResourceAllocation; import org.apache.hadoop.yarn.server.resourcemanager.reservation.ReservationInterval;
|
import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.server.resourcemanager.reservation.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 1,474,445
|
@Test
public void matchIcmpCodeTest() {
Criterion criterion = Criteria.matchIcmpCode((byte) 250);
ObjectNode result = criterionCodec.encode(criterion, context);
assertThat(result, matchesCriterion(criterion));
}
|
void function() { Criterion criterion = Criteria.matchIcmpCode((byte) 250); ObjectNode result = criterionCodec.encode(criterion, context); assertThat(result, matchesCriterion(criterion)); }
|
/**
* Tests ICMP code criterion.
*/
|
Tests ICMP code criterion
|
matchIcmpCodeTest
|
{
"repo_name": "sonu283304/onos",
"path": "core/common/src/test/java/org/onosproject/codec/impl/CriterionCodecTest.java",
"license": "apache-2.0",
"size": 14736
}
|
[
"com.fasterxml.jackson.databind.node.ObjectNode",
"org.hamcrest.MatcherAssert",
"org.onosproject.codec.impl.CriterionJsonMatcher",
"org.onosproject.net.flow.criteria.Criteria",
"org.onosproject.net.flow.criteria.Criterion"
] |
import com.fasterxml.jackson.databind.node.ObjectNode; import org.hamcrest.MatcherAssert; import org.onosproject.codec.impl.CriterionJsonMatcher; import org.onosproject.net.flow.criteria.Criteria; import org.onosproject.net.flow.criteria.Criterion;
|
import com.fasterxml.jackson.databind.node.*; import org.hamcrest.*; import org.onosproject.codec.impl.*; import org.onosproject.net.flow.criteria.*;
|
[
"com.fasterxml.jackson",
"org.hamcrest",
"org.onosproject.codec",
"org.onosproject.net"
] |
com.fasterxml.jackson; org.hamcrest; org.onosproject.codec; org.onosproject.net;
| 844,331
|
public JToolTip showToolTip() {
enterMouse();
moveMouse(getCenterXForClick(),
getCenterYForClick());
return waitToolTip();
}
|
JToolTip function() { enterMouse(); moveMouse(getCenterXForClick(), getCenterYForClick()); return waitToolTip(); }
|
/**
* Showes tool tip.
*
* @return JToolTip component.
* @throws TimeoutExpiredException
*/
|
Showes tool tip
|
showToolTip
|
{
"repo_name": "FauxFaux/jdk9-jdk",
"path": "test/sanity/client/lib/jemmy/src/org/netbeans/jemmy/operators/JComponentOperator.java",
"license": "gpl-2.0",
"size": 41148
}
|
[
"javax.swing.JToolTip"
] |
import javax.swing.JToolTip;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 1,064,861
|
public void setLocation( final int x, final int y )
{
Display defaultDisplay = Display.getDefault( );
if ( defaultDisplay == Display.getCurrent( ) )
{
uiSetLocation( x, y );
}
else
{
defaultDisplay.syncExec( new Runnable( ) {
|
void function( final int x, final int y ) { Display defaultDisplay = Display.getDefault( ); if ( defaultDisplay == Display.getCurrent( ) ) { uiSetLocation( x, y ); } else { defaultDisplay.syncExec( new Runnable( ) {
|
/**
* Set browser window location.
*
* @param x X coordinate of browser window's top-left corner
* @param y Y coordinate of browser window's top-left corner
*/
|
Set browser window location
|
setLocation
|
{
"repo_name": "sguan-actuate/birt",
"path": "viewer/org.eclipse.birt.report.viewer/src/org/eclipse/birt/report/viewer/browsers/embedded/EmbeddedBrowserAdapter.java",
"license": "epl-1.0",
"size": 3948
}
|
[
"org.eclipse.swt.widgets.Display"
] |
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.*;
|
[
"org.eclipse.swt"
] |
org.eclipse.swt;
| 2,870,630
|
private void addNorthAndSouthWalls(float mapWidth, float mapHeight) {
GameCanvasFx canvas = super.getCanvas();
ObstacleUiFx northWallUi = new ObstacleBuilder(canvas, world)
.x(mapWidth / 2).y(mapHeight - (WALL_WIDTH / 2)).degree(0)
.width(mapWidth).height(WALL_WIDTH)
.type(ObstacleType.WALL).build();
ObstacleUiFx southWallUi = new ObstacleBuilder(canvas, world)
.x(mapWidth / 2).y(WALL_WIDTH / 2).degree(0)
.width(mapWidth).height(WALL_WIDTH)
.type(ObstacleType.WALL).build();
canvas.addDrawable(northWallUi);
canvas.addDrawable(southWallUi);
}
|
void function(float mapWidth, float mapHeight) { GameCanvasFx canvas = super.getCanvas(); ObstacleUiFx northWallUi = new ObstacleBuilder(canvas, world) .x(mapWidth / 2).y(mapHeight - (WALL_WIDTH / 2)).degree(0) .width(mapWidth).height(WALL_WIDTH) .type(ObstacleType.WALL).build(); ObstacleUiFx southWallUi = new ObstacleBuilder(canvas, world) .x(mapWidth / 2).y(WALL_WIDTH / 2).degree(0) .width(mapWidth).height(WALL_WIDTH) .type(ObstacleType.WALL).build(); canvas.addDrawable(northWallUi); canvas.addDrawable(southWallUi); }
|
/**
* Method that adds the obstacle drawables to the map that represent the
* north and south walls.
*
* @param mapWidth The width of the map.
* @param mapHeight The height of the map.
*/
|
Method that adds the obstacle drawables to the map that represent the north and south walls
|
addNorthAndSouthWalls
|
{
"repo_name": "PTS3-S34A/Soccar",
"path": "Soccar [Client]/src/nl/soccar/ui/fx/models/MapUiFx.java",
"license": "mit",
"size": 12803
}
|
[
"nl.soccar.library.enumeration.ObstacleType",
"nl.soccar.ui.fx.GameCanvasFx",
"nl.soccar.ui.fx.models.ObstacleUiFx"
] |
import nl.soccar.library.enumeration.ObstacleType; import nl.soccar.ui.fx.GameCanvasFx; import nl.soccar.ui.fx.models.ObstacleUiFx;
|
import nl.soccar.library.enumeration.*; import nl.soccar.ui.fx.*; import nl.soccar.ui.fx.models.*;
|
[
"nl.soccar.library",
"nl.soccar.ui"
] |
nl.soccar.library; nl.soccar.ui;
| 1,352,838
|
public AggregateDefinition aggregate(Expression correlationExpression) {
AggregateDefinition answer = new AggregateDefinition(correlationExpression);
addOutput(answer);
return answer;
}
|
AggregateDefinition function(Expression correlationExpression) { AggregateDefinition answer = new AggregateDefinition(correlationExpression); addOutput(answer); return answer; }
|
/**
* <a href="http://camel.apache.org/aggregator.html">Aggregator EIP:</a>
* Creates an aggregator allowing you to combine a number of messages together into a single message.
*
* @param correlationExpression the expression used to calculate the
* correlation key. For a JMS message this could be the
* expression <code>header("JMSDestination")</code> or
* <code>header("JMSCorrelationID")</code>
* @return the builder
*/
|
Creates an aggregator allowing you to combine a number of messages together into a single message
|
aggregate
|
{
"repo_name": "chicagozer/rheosoft",
"path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java",
"license": "apache-2.0",
"size": 125020
}
|
[
"org.apache.camel.Expression"
] |
import org.apache.camel.Expression;
|
import org.apache.camel.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 576,593
|
public void addTracker(ResourceTracker tracker) {
synchronized (trackers) {
// prevent GC between contains and add
List<ResourceTracker> t = trackers.hardList();
if (!t.contains(tracker))
trackers.add(tracker);
trackers.trimToSize();
}
}
|
void function(ResourceTracker tracker) { synchronized (trackers) { List<ResourceTracker> t = trackers.hardList(); if (!t.contains(tracker)) trackers.add(tracker); trackers.trimToSize(); } }
|
/**
* Adds the tracker to the list of trackers monitoring this
* resource.
* @param tracker to observing resource
*/
|
Adds the tracker to the list of trackers monitoring this resource
|
addTracker
|
{
"repo_name": "GITNE/icedtea-web",
"path": "netx/net/sourceforge/jnlp/cache/Resource.java",
"license": "gpl-2.0",
"size": 13291
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 46,223
|
@SideOnly(Side.CLIENT)
public boolean canBeHovered()
{
return horse.getType().isHorse();
}
});
if (horse.isChested())
{
for (int k = 0; k < i; ++k)
{
for (int l = 0; l < 5; ++l)
{
this.addSlotToContainer(new Slot(horseInventoryIn, 2 + l + k * 5, 80 + l * 18, 18 + k * 18));
}
}
}
for (int i1 = 0; i1 < 3; ++i1)
{
for (int k1 = 0; k1 < 9; ++k1)
{
this.addSlotToContainer(new Slot(playerInventory, k1 + i1 * 9 + 9, 8 + k1 * 18, 102 + i1 * 18 + j));
}
}
for (int j1 = 0; j1 < 9; ++j1)
{
this.addSlotToContainer(new Slot(playerInventory, j1, 8 + j1 * 18, 160 + j));
}
}
|
@SideOnly(Side.CLIENT) boolean function() { return horse.getType().isHorse(); } }); if (horse.isChested()) { for (int k = 0; k < i; ++k) { for (int l = 0; l < 5; ++l) { this.addSlotToContainer(new Slot(horseInventoryIn, 2 + l + k * 5, 80 + l * 18, 18 + k * 18)); } } } for (int i1 = 0; i1 < 3; ++i1) { for (int k1 = 0; k1 < 9; ++k1) { this.addSlotToContainer(new Slot(playerInventory, k1 + i1 * 9 + 9, 8 + k1 * 18, 102 + i1 * 18 + j)); } } for (int j1 = 0; j1 < 9; ++j1) { this.addSlotToContainer(new Slot(playerInventory, j1, 8 + j1 * 18, 160 + j)); } }
|
/**
* Actualy only call when we want to render the white square effect over the slots. Return always True,
* except for the armor slot of the Donkey/Mule (we can't interact with the Undead and Skeleton horses)
*/
|
Actualy only call when we want to render the white square effect over the slots. Return always True, except for the armor slot of the Donkey/Mule (we can't interact with the Undead and Skeleton horses)
|
canBeHovered
|
{
"repo_name": "danielyc/test-1.9.4",
"path": "build/tmp/recompileMc/sources/net/minecraft/inventory/ContainerHorseInventory.java",
"license": "gpl-3.0",
"size": 4954
}
|
[
"net.minecraftforge.fml.relauncher.Side",
"net.minecraftforge.fml.relauncher.SideOnly"
] |
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.*;
|
[
"net.minecraftforge.fml"
] |
net.minecraftforge.fml;
| 1,116,436
|
private boolean isDefaultGiven(String swaggerContent) throws APIManagementException {
Swagger swagger = getSwagger(swaggerContent);
Map<String, SecuritySchemeDefinition> securityDefinitions = swagger.getSecurityDefinitions();
if (securityDefinitions == null) {
return false;
}
OAuth2Definition checkDefault = (OAuth2Definition) securityDefinitions.get(SWAGGER_SECURITY_SCHEMA_KEY);
if (checkDefault == null) {
return false;
}
return true;
}
|
boolean function(String swaggerContent) throws APIManagementException { Swagger swagger = getSwagger(swaggerContent); Map<String, SecuritySchemeDefinition> securityDefinitions = swagger.getSecurityDefinitions(); if (securityDefinitions == null) { return false; } OAuth2Definition checkDefault = (OAuth2Definition) securityDefinitions.get(SWAGGER_SECURITY_SCHEMA_KEY); if (checkDefault == null) { return false; } return true; }
|
/**
* This method returns the boolean value which checks whether the swagger is included default security scheme or not
*
* @param swaggerContent resource json
* @return boolean
* @throws APIManagementException
*/
|
This method returns the boolean value which checks whether the swagger is included default security scheme or not
|
isDefaultGiven
|
{
"repo_name": "Rajith90/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/definitions/OAS2Parser.java",
"license": "apache-2.0",
"size": 84878
}
|
[
"io.swagger.models.Swagger",
"io.swagger.models.auth.OAuth2Definition",
"io.swagger.models.auth.SecuritySchemeDefinition",
"java.util.Map",
"org.wso2.carbon.apimgt.api.APIManagementException"
] |
import io.swagger.models.Swagger; import io.swagger.models.auth.OAuth2Definition; import io.swagger.models.auth.SecuritySchemeDefinition; import java.util.Map; import org.wso2.carbon.apimgt.api.APIManagementException;
|
import io.swagger.models.*; import io.swagger.models.auth.*; import java.util.*; import org.wso2.carbon.apimgt.api.*;
|
[
"io.swagger.models",
"java.util",
"org.wso2.carbon"
] |
io.swagger.models; java.util; org.wso2.carbon;
| 328,045
|
public Observable<ServiceResponse<String>> beginStopPacketCaptureWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (virtualNetworkGatewayName == null) {
throw new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
|
Observable<ServiceResponse<String>> function(String resourceGroupName, String virtualNetworkGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (virtualNetworkGatewayName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); }
|
/**
* Stops packet capture on virtual network gateway in the specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkGatewayName The name of the virtual network gateway.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the String object
*/
|
Stops packet capture on virtual network gateway in the specified resource group
|
beginStopPacketCaptureWithServiceResponseAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/network/v2020_03_01/implementation/VirtualNetworkGatewaysInner.java",
"license": "mit",
"size": 304865
}
|
[
"com.microsoft.rest.ServiceResponse"
] |
import com.microsoft.rest.ServiceResponse;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 2,790,227
|
public NumericOperand milliseconds(TimeOperand operand) {
return createNumericFunction(this, "milliseconds", operand);
}
|
NumericOperand function(TimeOperand operand) { return createNumericFunction(this, STR, operand); }
|
/**
* Milliseconds numeric operand.
*
* @param operand the operand
* @return the numeric operand
*/
|
Milliseconds numeric operand
|
milliseconds
|
{
"repo_name": "bluebiz/bluelytics-api",
"path": "src/main/java/de/bluebiz/bluelytics/api/query/plan/expressions/operands/time/TimeOperand.java",
"license": "apache-2.0",
"size": 21683
}
|
[
"de.bluebiz.bluelytics.api.query.plan.expressions.operands.numeric.NumericOperand"
] |
import de.bluebiz.bluelytics.api.query.plan.expressions.operands.numeric.NumericOperand;
|
import de.bluebiz.bluelytics.api.query.plan.expressions.operands.numeric.*;
|
[
"de.bluebiz.bluelytics"
] |
de.bluebiz.bluelytics;
| 581,161
|
public static void copy(ByteString src, int srcIdx, ByteBuf dst, int dstIdx, int length) {
final int thisLen = src.length();
if (srcIdx < 0 || length > thisLen - srcIdx) {
throw new IndexOutOfBoundsException("expected: " + "0 <= srcIdx(" + srcIdx + ") <= srcIdx + length("
+ length + ") <= srcLen(" + thisLen + ')');
}
checkNotNull(dst, "dst").setBytes(dstIdx, src.array(), srcIdx + src.arrayOffset(), length);
}
|
static void function(ByteString src, int srcIdx, ByteBuf dst, int dstIdx, int length) { final int thisLen = src.length(); if (srcIdx < 0 length > thisLen - srcIdx) { throw new IndexOutOfBoundsException(STR + STR + srcIdx + STR + length + STR + thisLen + ')'); } checkNotNull(dst, "dst").setBytes(dstIdx, src.array(), srcIdx + src.arrayOffset(), length); }
|
/**
* Copies the content of {@code src} to a {@link ByteBuf} using {@link ByteBuf#writeBytes(byte[], int, int)}.
* @param src The source of the data to copy.
* @param srcIdx the starting offset of characters to copy.
* @param dst the destination byte array.
* @param dstIdx the starting offset in the destination byte array.
* @param length the number of characters to copy.
*/
|
Copies the content of src to a <code>ByteBuf</code> using <code>ByteBuf#writeBytes(byte[], int, int)</code>
|
copy
|
{
"repo_name": "liuciuse/netty",
"path": "buffer/src/main/java/io/netty/buffer/ByteBufUtil.java",
"license": "apache-2.0",
"size": 32258
}
|
[
"io.netty.util.ByteString",
"io.netty.util.internal.ObjectUtil"
] |
import io.netty.util.ByteString; import io.netty.util.internal.ObjectUtil;
|
import io.netty.util.*; import io.netty.util.internal.*;
|
[
"io.netty.util"
] |
io.netty.util;
| 87,209
|
private void closeUniqueDatabaseConnections( Result result ) {
// Don't close any connections if the parent job is using the same transaction
//
if ( parentJob != null && transactionId != null && parentJob.getTransactionId() != null && transactionId.equals(
parentJob.getTransactionId() ) ) {
return;
}
// Don't close any connections if the parent transformation is using the same transaction
//
if ( parentTrans != null && parentTrans.getTransMeta().isUsingUniqueConnections() && transactionId != null
&& parentTrans.getTransactionId() != null && transactionId.equals( parentTrans.getTransactionId() ) ) {
return;
}
// First we get all the database connections ...
//
DatabaseConnectionMap map = DatabaseConnectionMap.getInstance();
synchronized ( map ) {
List<Database> databaseList = new ArrayList<>( map.getMap().values() );
for ( Database database : databaseList ) {
if ( database.getConnectionGroup().equals( getTransactionId() ) ) {
try {
// This database connection belongs to this transformation.
// Let's roll it back if there is an error...
//
if ( result.getNrErrors() > 0 ) {
try {
database.rollback( true );
log.logBasic( BaseMessages.getString( PKG, "Trans.Exception.TransactionsRolledBackOnConnection",
database.toString() ) );
} catch ( Exception e ) {
throw new KettleDatabaseException( BaseMessages.getString( PKG,
"Trans.Exception.ErrorRollingBackUniqueConnection", database.toString() ), e );
}
} else {
try {
database.commit( true );
log.logBasic( BaseMessages.getString( PKG, "Trans.Exception.TransactionsCommittedOnConnection", database
.toString() ) );
} catch ( Exception e ) {
throw new KettleDatabaseException( BaseMessages.getString( PKG,
"Trans.Exception.ErrorCommittingUniqueConnection", database.toString() ), e );
}
}
} catch ( Exception e ) {
log.logError( BaseMessages.getString( PKG, "Trans.Exception.ErrorHandlingTransformationTransaction",
database.toString() ), e );
result.setNrErrors( result.getNrErrors() + 1 );
} finally {
try {
// This database connection belongs to this transformation.
database.closeConnectionOnly();
} catch ( Exception e ) {
log.logError( BaseMessages.getString( PKG, "Trans.Exception.ErrorHandlingTransformationTransaction",
database.toString() ), e );
result.setNrErrors( result.getNrErrors() + 1 );
} finally {
// Remove the database from the list...
//
map.removeConnection( database.getConnectionGroup(), database.getPartitionId(), database );
}
}
}
}
// Who else needs to be informed of the rollback or commit?
//
List<DatabaseTransactionListener> transactionListeners = map.getTransactionListeners( getTransactionId() );
if ( result.getNrErrors() > 0 ) {
for ( DatabaseTransactionListener listener : transactionListeners ) {
try {
listener.rollback();
} catch ( Exception e ) {
log.logError( BaseMessages.getString( PKG, "Trans.Exception.ErrorHandlingTransactionListenerRollback" ),
e );
result.setNrErrors( result.getNrErrors() + 1 );
}
}
} else {
for ( DatabaseTransactionListener listener : transactionListeners ) {
try {
listener.commit();
} catch ( Exception e ) {
log.logError( BaseMessages.getString( PKG, "Trans.Exception.ErrorHandlingTransactionListenerCommit" ), e );
result.setNrErrors( result.getNrErrors() + 1 );
}
}
}
}
}
|
void function( Result result ) { parentJob.getTransactionId() ) ) { return; } && parentTrans.getTransactionId() != null && transactionId.equals( parentTrans.getTransactionId() ) ) { return; } synchronized ( map ) { List<Database> databaseList = new ArrayList<>( map.getMap().values() ); for ( Database database : databaseList ) { if ( database.getConnectionGroup().equals( getTransactionId() ) ) { try { try { database.rollback( true ); log.logBasic( BaseMessages.getString( PKG, STR, database.toString() ) ); } catch ( Exception e ) { throw new KettleDatabaseException( BaseMessages.getString( PKG, STR, database.toString() ), e ); } } else { try { database.commit( true ); log.logBasic( BaseMessages.getString( PKG, STR, database .toString() ) ); } catch ( Exception e ) { throw new KettleDatabaseException( BaseMessages.getString( PKG, STR, database.toString() ), e ); } } } catch ( Exception e ) { log.logError( BaseMessages.getString( PKG, STR, database.toString() ), e ); result.setNrErrors( result.getNrErrors() + 1 ); } finally { try { database.closeConnectionOnly(); } catch ( Exception e ) { log.logError( BaseMessages.getString( PKG, STR, database.toString() ), e ); result.setNrErrors( result.getNrErrors() + 1 ); } finally { } } } } if ( result.getNrErrors() > 0 ) { for ( DatabaseTransactionListener listener : transactionListeners ) { try { listener.rollback(); } catch ( Exception e ) { log.logError( BaseMessages.getString( PKG, STR ), e ); result.setNrErrors( result.getNrErrors() + 1 ); } } } else { for ( DatabaseTransactionListener listener : transactionListeners ) { try { listener.commit(); } catch ( Exception e ) { log.logError( BaseMessages.getString( PKG, STR ), e ); result.setNrErrors( result.getNrErrors() + 1 ); } } } } }
|
/**
* Close unique database connections. If there are errors in the Result, perform a rollback
*
* @param result
* the result of the transformation execution
*/
|
Close unique database connections. If there are errors in the Result, perform a rollback
|
closeUniqueDatabaseConnections
|
{
"repo_name": "mdamour1976/pentaho-kettle",
"path": "engine/src/main/java/org/pentaho/di/trans/Trans.java",
"license": "apache-2.0",
"size": 199226
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.pentaho.di.core.Result",
"org.pentaho.di.core.database.Database",
"org.pentaho.di.core.database.DatabaseTransactionListener",
"org.pentaho.di.core.exception.KettleDatabaseException",
"org.pentaho.di.i18n.BaseMessages"
] |
import java.util.ArrayList; import java.util.List; import org.pentaho.di.core.Result; import org.pentaho.di.core.database.Database; import org.pentaho.di.core.database.DatabaseTransactionListener; import org.pentaho.di.core.exception.KettleDatabaseException; import org.pentaho.di.i18n.BaseMessages;
|
import java.util.*; import org.pentaho.di.core.*; import org.pentaho.di.core.database.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.i18n.*;
|
[
"java.util",
"org.pentaho.di"
] |
java.util; org.pentaho.di;
| 384,259
|
public T caseElement(Element object)
{
return null;
}
|
T function(Element object) { return null; }
|
/**
* Returns the result of interpreting the object as an instance of '<em>Element</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>Element</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
|
Returns the result of interpreting the object as an instance of 'Element'. This implementation returns null; returning a non-null result will terminate the switch.
|
caseElement
|
{
"repo_name": "rkkoszewski/JavaQuickUIDSL",
"path": "com.robertkoszewski.dsl.quickui/src-gen/com/robertkoszewski/dsl/quickUI/util/QuickUISwitch.java",
"license": "mit",
"size": 19270
}
|
[
"com.robertkoszewski.dsl.quickUI.Element"
] |
import com.robertkoszewski.dsl.quickUI.Element;
|
import com.robertkoszewski.dsl.*;
|
[
"com.robertkoszewski.dsl"
] |
com.robertkoszewski.dsl;
| 856,288
|
File file = new File(path + filename);
StringBuffer contents = new StringBuffer();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(file));
String text = null;
while ((text = reader.readLine()) != null) {
contents.append(text).append(System.getProperty("line.separator"));
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return contents.toString();
}
|
File file = new File(path + filename); StringBuffer contents = new StringBuffer(); BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(file)); String text = null; while ((text = reader.readLine()) != null) { contents.append(text).append(System.getProperty(STR)); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { e.printStackTrace(); } } return contents.toString(); }
|
/** Reads a file and returns its contents as String.
* @param path Path to the file, without its name.
* @param filename The file's name.
* @return The file's content.
*/
|
Reads a file and returns its contents as String
|
Read
|
{
"repo_name": "dfki-iui/oms",
"path": "src/de/dfki/adom/client/Tools.java",
"license": "gpl-3.0",
"size": 1228
}
|
[
"java.io.BufferedReader",
"java.io.File",
"java.io.FileNotFoundException",
"java.io.FileReader",
"java.io.IOException"
] |
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,014,848
|
public boolean allowRemoveResource(String id)
{
// check security
boolean isAllowed = allowRemove(id);
if(isAllowed)
{
try
{
checkExplicitLock(id);
}
catch(PermissionException e)
{
isAllowed = false;
}
}
return isAllowed;
} // allowRemoveResource
|
boolean function(String id) { boolean isAllowed = allowRemove(id); if(isAllowed) { try { checkExplicitLock(id); } catch(PermissionException e) { isAllowed = false; } } return isAllowed; }
|
/**
* check permissions for removeResource().
*
* @param id
* The id of the new resource.
* @return true if the user is allowed to removeResource(id), false if not.
*/
|
check permissions for removeResource()
|
allowRemoveResource
|
{
"repo_name": "marktriggs/nyu-sakai-10.4",
"path": "kernel/kernel-impl/src/main/java/org/sakaiproject/content/impl/BaseContentService.java",
"license": "apache-2.0",
"size": 426240
}
|
[
"org.sakaiproject.exception.PermissionException"
] |
import org.sakaiproject.exception.PermissionException;
|
import org.sakaiproject.exception.*;
|
[
"org.sakaiproject.exception"
] |
org.sakaiproject.exception;
| 2,109,268
|
@Column(name = "environment_id", precision = 19)
@Override
public Long getStackId() {
return (Long) get(12);
}
|
@Column(name = STR, precision = 19) Long function() { return (Long) get(12); }
|
/**
* Getter for <code>cattle.volume_template.environment_id</code>.
*/
|
Getter for <code>cattle.volume_template.environment_id</code>
|
getStackId
|
{
"repo_name": "vincent99/cattle",
"path": "code/iaas/model/src/main/java/io/cattle/platform/core/model/tables/records/VolumeTemplateRecord.java",
"license": "apache-2.0",
"size": 17532
}
|
[
"javax.persistence.Column"
] |
import javax.persistence.Column;
|
import javax.persistence.*;
|
[
"javax.persistence"
] |
javax.persistence;
| 182,154
|
if (findRecord(regId) != null) {
log.info("Device " + regId + " already registered, skipping register");
return;
}
RegistrationRecord record = new RegistrationRecord();
record.setRegId(regId);
ofy().save().entity(record).now();
}
|
if (findRecord(regId) != null) { log.info(STR + regId + STR); return; } RegistrationRecord record = new RegistrationRecord(); record.setRegId(regId); ofy().save().entity(record).now(); }
|
/**
* Register a device to the backend
*
* @param regId The Google Cloud Messaging registration Id to add
*/
|
Register a device to the backend
|
registerDevice
|
{
"repo_name": "jokkolabs/Culture-droid",
"path": "backend/src/main/java/com/yeleman/culure_droid/backend/RegistrationEndpoint.java",
"license": "apache-2.0",
"size": 3139
}
|
[
"com.yeleman.culure_droid.backend.OfyService"
] |
import com.yeleman.culure_droid.backend.OfyService;
|
import com.yeleman.culure_droid.backend.*;
|
[
"com.yeleman.culure_droid"
] |
com.yeleman.culure_droid;
| 1,023,181
|
public static Message setupMessage(String name, long accountId,
long mailboxId, boolean addBody, boolean saveIt, Context context,
boolean starred, boolean read) {
Message message = new Message();
message.mDisplayName = name;
message.mMailboxKey = mailboxId;
message.mAccountKey = accountId;
message.mFlagRead = read;
message.mFlagLoaded = Message.FLAG_LOADED_UNLOADED;
message.mFlagFavorite = starred;
message.mServerId = "serverid " + name;
if (addBody) {
message.mText = "body text " + name;
message.mHtml = "body html " + name;
}
if (saveIt) {
message.save(context);
}
return message;
}
|
static Message function(String name, long accountId, long mailboxId, boolean addBody, boolean saveIt, Context context, boolean starred, boolean read) { Message message = new Message(); message.mDisplayName = name; message.mMailboxKey = mailboxId; message.mAccountKey = accountId; message.mFlagRead = read; message.mFlagLoaded = Message.FLAG_LOADED_UNLOADED; message.mFlagFavorite = starred; message.mServerId = STR + name; if (addBody) { message.mText = STR + name; message.mHtml = STR + name; } if (saveIt) { message.save(context); } return message; }
|
/**
* Create a message for test purposes
*/
|
Create a message for test purposes
|
setupMessage
|
{
"repo_name": "rex-xxx/mt6572_x201",
"path": "packages/apps/Exchange/exchange2/tests/src/com/android/exchange/provider/EmailContentSetupUtils.java",
"license": "gpl-2.0",
"size": 7893
}
|
[
"android.content.Context",
"com.android.emailcommon.provider.EmailContent"
] |
import android.content.Context; import com.android.emailcommon.provider.EmailContent;
|
import android.content.*; import com.android.emailcommon.provider.*;
|
[
"android.content",
"com.android.emailcommon"
] |
android.content; com.android.emailcommon;
| 2,327,384
|
public static boolean isLicenseExpiredException(ElasticsearchSecurityException exception) {
return (exception != null) && (exception.getMetadata(EXPIRED_FEATURE_METADATA) != null);
}
|
static boolean function(ElasticsearchSecurityException exception) { return (exception != null) && (exception.getMetadata(EXPIRED_FEATURE_METADATA) != null); }
|
/**
* Checks if a given {@link ElasticsearchSecurityException} refers to a feature that
* requires a valid license, but the license has expired.
*/
|
Checks if a given <code>ElasticsearchSecurityException</code> refers to a feature that requires a valid license, but the license has expired
|
isLicenseExpiredException
|
{
"repo_name": "GlenRSmith/elasticsearch",
"path": "x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseUtils.java",
"license": "apache-2.0",
"size": 3141
}
|
[
"org.elasticsearch.ElasticsearchSecurityException"
] |
import org.elasticsearch.ElasticsearchSecurityException;
|
import org.elasticsearch.*;
|
[
"org.elasticsearch"
] |
org.elasticsearch;
| 1,639,876
|
@Override
public void clear() {
for (Entry<K,V> entry : heap) {
entry.setKey(null);
entry.setValue(null);
}
heap.clear();
}
|
void function() { for (Entry<K,V> entry : heap) { entry.setKey(null); entry.setValue(null); } heap.clear(); }
|
/**
* Empty the priority queue
*/
|
Empty the priority queue
|
clear
|
{
"repo_name": "pdoro/data-structures-and-algorithms",
"path": "src/main/java/com/pdomingo/data_structures/implementations/priority_queue/BinaryHeap.java",
"license": "mit",
"size": 5562
}
|
[
"com.pdomingo.data_structures.interfaces.Entry"
] |
import com.pdomingo.data_structures.interfaces.Entry;
|
import com.pdomingo.data_structures.interfaces.*;
|
[
"com.pdomingo.data_structures"
] |
com.pdomingo.data_structures;
| 98,884
|
public List<Contentlet> find(Category category, long languageId, boolean live, String orderBy, User user, boolean respectFrontendRoles) throws DotDataException, DotContentletStateException, DotSecurityException;
|
List<Contentlet> function(Category category, long languageId, boolean live, String orderBy, User user, boolean respectFrontendRoles) throws DotDataException, DotContentletStateException, DotSecurityException;
|
/**
* Will return all content assigned to a specified Category
* @param category Category to look for
* @param languageId language to pull content for. If 0 will return all languages
* @param live should return live or working content
* @param orderBy indexName(previously known as dbColumnName) to order by. Can be null or empty string
* @param user
* @param respectFrontendRoles
* @return
* @throws DotDataException
* @throws DotContentletStateException
* @throws DotSecurityException
*/
|
Will return all content assigned to a specified Category
|
find
|
{
"repo_name": "guhb/core",
"path": "src/com/dotmarketing/portlets/contentlet/business/ContentletAPI.java",
"license": "gpl-3.0",
"size": 64730
}
|
[
"com.dotmarketing.exception.DotDataException",
"com.dotmarketing.exception.DotSecurityException",
"com.dotmarketing.portlets.categories.model.Category",
"com.dotmarketing.portlets.contentlet.model.Contentlet",
"com.liferay.portal.model.User",
"java.util.List"
] |
import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; import com.dotmarketing.portlets.categories.model.Category; import com.dotmarketing.portlets.contentlet.model.Contentlet; import com.liferay.portal.model.User; import java.util.List;
|
import com.dotmarketing.exception.*; import com.dotmarketing.portlets.categories.model.*; import com.dotmarketing.portlets.contentlet.model.*; import com.liferay.portal.model.*; import java.util.*;
|
[
"com.dotmarketing.exception",
"com.dotmarketing.portlets",
"com.liferay.portal",
"java.util"
] |
com.dotmarketing.exception; com.dotmarketing.portlets; com.liferay.portal; java.util;
| 290,514
|
// Tests for plain creation of RangeJunction ( single or within a Group or CompositeGroup or
// AllGroup )
// which is agnostic of whether the RangeJunction is of type AND or OR
//////////////////////////////////////////////////////////////////////////////////////
@Test
public void testOrganizedOperandsSingleRangeJunctionCreationWithNoIterOperandForAND() {
LogWriter logger = CacheUtils.getLogger();
try {
ExecutionContext context = new QueryExecutionContext(null, CacheUtils.getCache());
bindIteratorsAndCreateIndex(context);
CompiledComparison[] cv = null;
cv = new CompiledComparison[12];
cv[0] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(2), OQLLexerTokenTypes.TOK_EQ);
cv[1] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(5), OQLLexerTokenTypes.TOK_LE);
cv[2] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(7), OQLLexerTokenTypes.TOK_LT);
cv[3] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(7), OQLLexerTokenTypes.TOK_GT);
cv[4] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(7), OQLLexerTokenTypes.TOK_GE);
cv[5] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(7), OQLLexerTokenTypes.TOK_NE);
cv[6] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(2), OQLLexerTokenTypes.TOK_EQ);
cv[7] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(5), OQLLexerTokenTypes.TOK_LE);
cv[8] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(7), OQLLexerTokenTypes.TOK_LT);
cv[9] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(7), OQLLexerTokenTypes.TOK_GT);
cv[10] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(7), OQLLexerTokenTypes.TOK_GE);
cv[11] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"),
new CompiledLiteral(7), OQLLexerTokenTypes.TOK_NE);
OrganizedOperands oo =
oganizedOperandsSingleRangeJunctionCreation(OQLLexerTokenTypes.LITERAL_and, cv, context);
assertNotNull("OrganizedOperand object is null", oo);
assertTrue("Filter Openad of OrganizedOperand is not of type RangeJunction",
oo.filterOperand instanceof RangeJunction);
RangeJunction rj = (RangeJunction) oo.filterOperand;
assertEquals(cv.length, rj.getOperands().size());
} catch (Exception e) {
logger.error(e);
fail(e.toString());
}
}
|
void function() { LogWriter logger = CacheUtils.getLogger(); try { ExecutionContext context = new QueryExecutionContext(null, CacheUtils.getCache()); bindIteratorsAndCreateIndex(context); CompiledComparison[] cv = null; cv = new CompiledComparison[12]; cv[0] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(2), OQLLexerTokenTypes.TOK_EQ); cv[1] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(5), OQLLexerTokenTypes.TOK_LE); cv[2] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(7), OQLLexerTokenTypes.TOK_LT); cv[3] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(7), OQLLexerTokenTypes.TOK_GT); cv[4] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(7), OQLLexerTokenTypes.TOK_GE); cv[5] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(7), OQLLexerTokenTypes.TOK_NE); cv[6] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(2), OQLLexerTokenTypes.TOK_EQ); cv[7] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(5), OQLLexerTokenTypes.TOK_LE); cv[8] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(7), OQLLexerTokenTypes.TOK_LT); cv[9] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(7), OQLLexerTokenTypes.TOK_GT); cv[10] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(7), OQLLexerTokenTypes.TOK_GE); cv[11] = new CompiledComparison(new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(7), OQLLexerTokenTypes.TOK_NE); OrganizedOperands oo = oganizedOperandsSingleRangeJunctionCreation(OQLLexerTokenTypes.LITERAL_and, cv, context); assertNotNull(STR, oo); assertTrue(STR, oo.filterOperand instanceof RangeJunction); RangeJunction rj = (RangeJunction) oo.filterOperand; assertEquals(cv.length, rj.getOperands().size()); } catch (Exception e) { logger.error(e); fail(e.toString()); } }
|
/**
* Tests the creation of a single RangeJunction if the CompiledJunction only contains same index
* condition without iter operand for AND
*/
|
Tests the creation of a single RangeJunction if the CompiledJunction only contains same index condition without iter operand for AND
|
testOrganizedOperandsSingleRangeJunctionCreationWithNoIterOperandForAND
|
{
"repo_name": "jdeppe-pivotal/geode",
"path": "geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/CompiledJunctionInternalsJUnitTest.java",
"license": "apache-2.0",
"size": 157169
}
|
[
"org.apache.geode.LogWriter",
"org.apache.geode.cache.query.CacheUtils",
"org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes",
"org.junit.Assert"
] |
import org.apache.geode.LogWriter; import org.apache.geode.cache.query.CacheUtils; import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes; import org.junit.Assert;
|
import org.apache.geode.*; import org.apache.geode.cache.query.*; import org.apache.geode.cache.query.internal.parse.*; import org.junit.*;
|
[
"org.apache.geode",
"org.junit"
] |
org.apache.geode; org.junit;
| 708,003
|
private void checkValues(List<RowMetaAndData> transResults, List<RowMetaAndData> expectedResults)
throws TestFailedException {
TestUtilities.checkRows(transResults, expectedResults, 0);
Iterator<RowMetaAndData> itrRows1 = transResults.iterator();
Iterator<RowMetaAndData> itrRows2 = expectedResults.iterator();
while ( itrRows1.hasNext() && itrRows2.hasNext() ) {
RowMetaAndData rowMetaAndData1 = itrRows1.next();
RowMetaAndData rowMetaAndData2 = itrRows2.next();
Object[] rowObject1 = rowMetaAndData1.getData();
Object[] rowObject2 = rowMetaAndData2.getData();
for (int i = 0; i < rowObject2.length; i++) {
Object s1 = rowObject1[i];
Object s2 = rowObject2[i];
ValueMetaInterface vm = rowMetaAndData2.getValueMeta(i);
try {
if (vm.compare(s1, s2) != 0) {
throw new TestFailedException("");
}
} catch (Exception e) {
throw new TestFailedException(String.format("Values don't match. Found: %s Expected: %s", s1, s2));
}
}
}
}
|
void function(List<RowMetaAndData> transResults, List<RowMetaAndData> expectedResults) throws TestFailedException { TestUtilities.checkRows(transResults, expectedResults, 0); Iterator<RowMetaAndData> itrRows1 = transResults.iterator(); Iterator<RowMetaAndData> itrRows2 = expectedResults.iterator(); while ( itrRows1.hasNext() && itrRows2.hasNext() ) { RowMetaAndData rowMetaAndData1 = itrRows1.next(); RowMetaAndData rowMetaAndData2 = itrRows2.next(); Object[] rowObject1 = rowMetaAndData1.getData(); Object[] rowObject2 = rowMetaAndData2.getData(); for (int i = 0; i < rowObject2.length; i++) { Object s1 = rowObject1[i]; Object s2 = rowObject2[i]; ValueMetaInterface vm = rowMetaAndData2.getValueMeta(i); try { if (vm.compare(s1, s2) != 0) { throw new TestFailedException(STRValues don't match. Found: %s Expected: %s", s1, s2)); } } } }
|
/**
* Helper method to check that the values of the fields match
* @param transResults output from transformation
* @param expectedResults expected output
* @throws TestFailedException If values don't match
*/
|
Helper method to check that the values of the fields match
|
checkValues
|
{
"repo_name": "graphiq-data/pdi-uniquelist-plugin",
"path": "test-src/com/graphiq/kettle/steps/uniquelist/UniqueListStepTest.java",
"license": "mit",
"size": 10087
}
|
[
"java.util.Iterator",
"java.util.List",
"org.pentaho.di.core.RowMetaAndData",
"org.pentaho.di.core.row.ValueMetaInterface"
] |
import java.util.Iterator; import java.util.List; import org.pentaho.di.core.RowMetaAndData; import org.pentaho.di.core.row.ValueMetaInterface;
|
import java.util.*; import org.pentaho.di.core.*; import org.pentaho.di.core.row.*;
|
[
"java.util",
"org.pentaho.di"
] |
java.util; org.pentaho.di;
| 1,743,504
|
private void detachOffScreenChildren(boolean toLeft) {
int numChildren = getChildCount();
int firstPosition = mFirstPosition;
int start = 0;
int count = 0;
if (toLeft) {
final int galleryLeft = mPaddingLeft;
for (int i = 0; i < numChildren; i++) {
int n = mIsRtl ? (numChildren - 1 - i) : i;
final View child = getChildAt(n);
if (child.getRight() >= galleryLeft) {
break;
} else {
start = n;
count++;
mRecycler.put(firstPosition + n, child);
}
}
if (!mIsRtl) {
start = 0;
}
} else {
final int galleryRight = getWidth() - mPaddingRight;
for (int i = numChildren - 1; i >= 0; i--) {
int n = mIsRtl ? numChildren - 1 - i : i;
final View child = getChildAt(n);
if (child.getLeft() <= galleryRight) {
break;
} else {
start = n;
count++;
mRecycler.put(firstPosition + n, child);
}
}
if (mIsRtl) {
start = 0;
}
}
detachViewsFromParent(start, count);
if (toLeft != mIsRtl) {
mFirstPosition += count;
}
}
|
void function(boolean toLeft) { int numChildren = getChildCount(); int firstPosition = mFirstPosition; int start = 0; int count = 0; if (toLeft) { final int galleryLeft = mPaddingLeft; for (int i = 0; i < numChildren; i++) { int n = mIsRtl ? (numChildren - 1 - i) : i; final View child = getChildAt(n); if (child.getRight() >= galleryLeft) { break; } else { start = n; count++; mRecycler.put(firstPosition + n, child); } } if (!mIsRtl) { start = 0; } } else { final int galleryRight = getWidth() - mPaddingRight; for (int i = numChildren - 1; i >= 0; i--) { int n = mIsRtl ? numChildren - 1 - i : i; final View child = getChildAt(n); if (child.getLeft() <= galleryRight) { break; } else { start = n; count++; mRecycler.put(firstPosition + n, child); } } if (mIsRtl) { start = 0; } } detachViewsFromParent(start, count); if (toLeft != mIsRtl) { mFirstPosition += count; } }
|
/**
* Detaches children that are off the screen (i.e.: Gallery bounds).
*
* @param toLeft Whether to detach children to the left of the Gallery, or
* to the right.
*/
|
Detaches children that are off the screen (i.e.: Gallery bounds)
|
detachOffScreenChildren
|
{
"repo_name": "xorware/android_frameworks_base",
"path": "core/java/android/widget/Gallery.java",
"license": "apache-2.0",
"size": 51121
}
|
[
"android.view.View"
] |
import android.view.View;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 130,004
|
public void register(Router router) {
router.route(this.route).handler(this);
}
|
void function(Router router) { router.route(this.route).handler(this); }
|
/**
* Registers this handler with the given router.
*
* @param router the router to register with.
*/
|
Registers this handler with the given router
|
register
|
{
"repo_name": "mooman219/PokemonGoTool",
"path": "src/main/java/com/gmail/mooman219/pokemongo/handler/RouteHandler.java",
"license": "mit",
"size": 1184
}
|
[
"io.vertx.ext.web.Router"
] |
import io.vertx.ext.web.Router;
|
import io.vertx.ext.web.*;
|
[
"io.vertx.ext"
] |
io.vertx.ext;
| 1,424,390
|
void undelete(final List<ObjectId> ids) throws KettleException;
|
void undelete(final List<ObjectId> ids) throws KettleException;
|
/**
* Un deletes the list of files matching the ids
* @param ids
* @throws KettleException
*/
|
Un deletes the list of files matching the ids
|
undelete
|
{
"repo_name": "codek/pentaho-kettle",
"path": "plugins/pdi-pur-plugin/src/org/pentaho/di/ui/repository/pur/services/ITrashService.java",
"license": "apache-2.0",
"size": 1837
}
|
[
"java.util.List",
"org.pentaho.di.core.exception.KettleException",
"org.pentaho.di.repository.ObjectId"
] |
import java.util.List; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.repository.ObjectId;
|
import java.util.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.repository.*;
|
[
"java.util",
"org.pentaho.di"
] |
java.util; org.pentaho.di;
| 2,533,358
|
@Test
public void testAsyncSchedulerSkipNoHeartbeatNMs() throws Exception {
int heartbeatInterval = 100;
conf.setInt(
CapacitySchedulerConfiguration.SCHEDULE_ASYNCHRONOUSLY_MAXIMUM_THREAD,
1);
conf.setInt(CapacitySchedulerConfiguration.SCHEDULE_ASYNCHRONOUSLY_PREFIX
+ ".scheduling-interval-ms", 100);
// Heartbeat interval is 100 ms.
conf.setInt(YarnConfiguration.RM_NM_HEARTBEAT_INTERVAL_MS, heartbeatInterval);
mgr.init(conf);
|
void function() throws Exception { int heartbeatInterval = 100; conf.setInt( CapacitySchedulerConfiguration.SCHEDULE_ASYNCHRONOUSLY_MAXIMUM_THREAD, 1); conf.setInt(CapacitySchedulerConfiguration.SCHEDULE_ASYNCHRONOUSLY_PREFIX + STR, 100); conf.setInt(YarnConfiguration.RM_NM_HEARTBEAT_INTERVAL_MS, heartbeatInterval); mgr.init(conf);
|
/**
* Make sure scheduler skips NMs which haven't heartbeat for a while.
* @throws Exception
*/
|
Make sure scheduler skips NMs which haven't heartbeat for a while
|
testAsyncSchedulerSkipNoHeartbeatNMs
|
{
"repo_name": "JingchengDu/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacitySchedulerAsyncScheduling.java",
"license": "apache-2.0",
"size": 50314
}
|
[
"org.apache.hadoop.yarn.conf.YarnConfiguration"
] |
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
import org.apache.hadoop.yarn.conf.*;
|
[
"org.apache.hadoop"
] |
org.apache.hadoop;
| 1,628,403
|
public String toJSON() {
StringWriter sw = new StringWriter();
JSONWriter jw = new JSONWriter(sw);
jw.object();
writeJSONValue(jw);
jw.endObject();
return sw.toString();
}
|
String function() { StringWriter sw = new StringWriter(); JSONWriter jw = new JSONWriter(sw); jw.object(); writeJSONValue(jw); jw.endObject(); return sw.toString(); }
|
/**
* Returns the widgets contents as a JSON encoded string
*
* @return the widgets contents as a JSON encoded string
*/
|
Returns the widgets contents as a JSON encoded string
|
toJSON
|
{
"repo_name": "appnativa/rare",
"path": "source/rare/core/com/appnativa/rare/widget/aWidget.java",
"license": "gpl-3.0",
"size": 150848
}
|
[
"com.appnativa.util.json.JSONWriter",
"java.io.StringWriter"
] |
import com.appnativa.util.json.JSONWriter; import java.io.StringWriter;
|
import com.appnativa.util.json.*; import java.io.*;
|
[
"com.appnativa.util",
"java.io"
] |
com.appnativa.util; java.io;
| 1,640,437
|
void onCheckedChanged(FloatingActionButton fabView, boolean isChecked);
}
private static final int[] CHECKED_STATE_SET = {
android.R.attr.state_checked
};
private static final String TAG = "FloatingActionButton";
// A boolean that tells if the FAB is checked or not.
private boolean mChecked;
// A listener to communicate that the FAB has changed it's state
private OnCheckedChangeListener mOnCheckedChangeListener;
public FloatingActionButton(Context context) {
this(context, null, 0, 0);
}
public FloatingActionButton(Context context, AttributeSet attrs) {
this(context, attrs, 0, 0);
}
public FloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
public FloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr);
setClickable(true);
|
void onCheckedChanged(FloatingActionButton fabView, boolean isChecked); } private static final int[] CHECKED_STATE_SET = { android.R.attr.state_checked }; private static final String TAG = STR; private boolean mChecked; private OnCheckedChangeListener mOnCheckedChangeListener; public FloatingActionButton(Context context) { this(context, null, 0, 0); } public FloatingActionButton(Context context, AttributeSet attrs) { this(context, attrs, 0, 0); } public FloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr) { this(context, attrs, defStyleAttr, 0); } public FloatingActionButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr); setClickable(true);
|
/**
* Called when the checked state of a FAB has changed.
*
* @param fabView The FAB view whose state has changed.
* @param isChecked The new checked state of buttonView.
*/
|
Called when the checked state of a FAB has changed
|
onCheckedChanged
|
{
"repo_name": "chenpusn/FluxyAndroidTodo",
"path": "app/src/main/java/com/armueller/fluxytodo/google/FloatingActionButton.java",
"license": "mit",
"size": 5003
}
|
[
"android.content.Context",
"android.util.AttributeSet"
] |
import android.content.Context; import android.util.AttributeSet;
|
import android.content.*; import android.util.*;
|
[
"android.content",
"android.util"
] |
android.content; android.util;
| 349,114
|
private HttpConnection getConnection(long timeout) throws IOException
{
HttpConnection connection = null;
while ((connection == null) && (connection = getIdleConnection()) == null && timeout > 0)
{
boolean startConnection = false;
synchronized (this)
{
int totalConnections = _connections.size() + _pendingConnections;
if (totalConnections < _maxConnections)
{
_newConnection++;
startConnection = true;
}
}
if (startConnection)
{
startNewConnection();
try
{
Object o = _newQueue.take();
if (o instanceof HttpConnection)
{
connection = (HttpConnection)o;
}
else
throw (IOException)o;
}
catch (InterruptedException e)
{
Log.ignore(e);
}
}
else
{
try
{
Thread.currentThread();
Thread.sleep(200);
timeout -= 200;
}
catch (InterruptedException e)
{
Log.ignore(e);
}
}
}
return connection;
}
|
HttpConnection function(long timeout) throws IOException { HttpConnection connection = null; while ((connection == null) && (connection = getIdleConnection()) == null && timeout > 0) { boolean startConnection = false; synchronized (this) { int totalConnections = _connections.size() + _pendingConnections; if (totalConnections < _maxConnections) { _newConnection++; startConnection = true; } } if (startConnection) { startNewConnection(); try { Object o = _newQueue.take(); if (o instanceof HttpConnection) { connection = (HttpConnection)o; } else throw (IOException)o; } catch (InterruptedException e) { Log.ignore(e); } } else { try { Thread.currentThread(); Thread.sleep(200); timeout -= 200; } catch (InterruptedException e) { Log.ignore(e); } } } return connection; }
|
/**
* Get a connection. We either get an idle connection if one is available, or
* we make a new connection, if we have not yet reached maxConnections. If we
* have reached maxConnections, we wait until the number reduces.
*
* @param timeout max time prepared to block waiting to be able to get a connection
* @return a HttpConnection for this destination
* @throws IOException if an I/O error occurs
*/
|
Get a connection. We either get an idle connection if one is available, or we make a new connection, if we have not yet reached maxConnections. If we have reached maxConnections, we wait until the number reduces
|
getConnection
|
{
"repo_name": "wang88/jetty",
"path": "jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java",
"license": "apache-2.0",
"size": 21496
}
|
[
"java.io.IOException",
"org.eclipse.jetty.util.log.Log"
] |
import java.io.IOException; import org.eclipse.jetty.util.log.Log;
|
import java.io.*; import org.eclipse.jetty.util.log.*;
|
[
"java.io",
"org.eclipse.jetty"
] |
java.io; org.eclipse.jetty;
| 1,844,908
|
public void receive(Message msg) {
Object o = msg.getObject();
if (o instanceof UserMessage) {
UserMessage message = (UserMessage) o;
if (message.to == null) {
if (message.clear) {
String userId = message.from;
synchronized (messageMap) {
messageMap.remove(userId);
}
} else {
logger.debug("Received heartbeat from cluster ...");
heartbeatMap.put(message.from, message);
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("Received " + (message.video ? "video" : "") + "message from cluster ...");
}
addMessageToMap(message);
}
}
}
|
void function(Message msg) { Object o = msg.getObject(); if (o instanceof UserMessage) { UserMessage message = (UserMessage) o; if (message.to == null) { if (message.clear) { String userId = message.from; synchronized (messageMap) { messageMap.remove(userId); } } else { logger.debug(STR); heartbeatMap.put(message.from, message); } } else { if (logger.isDebugEnabled()) { logger.debug(STR + (message.video ? "video" : STRmessage from cluster ..."); } addMessageToMap(message); } } }
|
/**
* JGroups message listener.
*/
|
JGroups message listener
|
receive
|
{
"repo_name": "hackbuteer59/sakai",
"path": "portal/portal-chat/tool/src/java/org/sakaiproject/portal/chat/entity/PCServiceEntityProvider.java",
"license": "apache-2.0",
"size": 28757
}
|
[
"org.jgroups.Message"
] |
import org.jgroups.Message;
|
import org.jgroups.*;
|
[
"org.jgroups"
] |
org.jgroups;
| 2,049,777
|
EClass getPipelineElement();
|
EClass getPipelineElement();
|
/**
* Returns the meta object for class '{@link pipeline.PipelineElement <em>Element</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Element</em>'.
* @see pipeline.PipelineElement
* @generated
*/
|
Returns the meta object for class '<code>pipeline.PipelineElement Element</code>'.
|
getPipelineElement
|
{
"repo_name": "QualiMaster/QM-IConf",
"path": "pipelineGEditor/src/pipeline/PipelinePackage.java",
"license": "apache-2.0",
"size": 43163
}
|
[
"org.eclipse.emf.ecore.EClass"
] |
import org.eclipse.emf.ecore.EClass;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,178,480
|
@SuppressWarnings( "unchecked" )
private <T> T getRealObject( T object )
throws Exception
{
if ( AopUtils.isAopProxy( object ) )
{
return (T) ((Advised) object).getTargetSource().getTarget();
}
return object;
}
// -------------------------------------------------------------------------
// Create object methods
// -------------------------------------------------------------------------
|
@SuppressWarnings( STR ) <T> T function( T object ) throws Exception { if ( AopUtils.isAopProxy( object ) ) { return (T) ((Advised) object).getTargetSource().getTarget(); } return object; }
|
/**
* If the given class is advised by Spring AOP it will return the target
* class, i.e. the advised class. If not the given class is returned
* unchanged.
*
* @param object the object.
*/
|
If the given class is advised by Spring AOP it will return the target class, i.e. the advised class. If not the given class is returned unchanged
|
getRealObject
|
{
"repo_name": "vmluan/dhis2-core",
"path": "dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java",
"license": "bsd-3-clause",
"size": 76838
}
|
[
"org.springframework.aop.framework.Advised",
"org.springframework.aop.support.AopUtils"
] |
import org.springframework.aop.framework.Advised; import org.springframework.aop.support.AopUtils;
|
import org.springframework.aop.framework.*; import org.springframework.aop.support.*;
|
[
"org.springframework.aop"
] |
org.springframework.aop;
| 2,730,171
|
public void setValues( RowMetaInterface rowMeta, Object[] data, PreparedStatement ps, int ignoreThisValueIndex )
throws KettleDatabaseException {
// now set the values in the row!
int index = 0;
for ( int i = 0; i < rowMeta.size(); i++ ) {
if ( i != ignoreThisValueIndex ) {
ValueMetaInterface v = rowMeta.getValueMeta( i );
Object object = data[ i ];
try {
setValue( ps, v, object, index + 1 );
index++;
} catch ( KettleDatabaseException e ) {
throw new KettleDatabaseException( "offending row : " + rowMeta, e );
}
}
}
}
|
void function( RowMetaInterface rowMeta, Object[] data, PreparedStatement ps, int ignoreThisValueIndex ) throws KettleDatabaseException { int index = 0; for ( int i = 0; i < rowMeta.size(); i++ ) { if ( i != ignoreThisValueIndex ) { ValueMetaInterface v = rowMeta.getValueMeta( i ); Object object = data[ i ]; try { setValue( ps, v, object, index + 1 ); index++; } catch ( KettleDatabaseException e ) { throw new KettleDatabaseException( STR + rowMeta, e ); } } } }
|
/**
* Sets the values of the preparedStatement pstmt.
*
* @param rowMeta
* @param data
*/
|
Sets the values of the preparedStatement pstmt
|
setValues
|
{
"repo_name": "pedrofvteixeira/pentaho-kettle",
"path": "core/src/main/java/org/pentaho/di/core/database/Database.java",
"license": "apache-2.0",
"size": 180346
}
|
[
"java.sql.PreparedStatement",
"org.pentaho.di.core.exception.KettleDatabaseException",
"org.pentaho.di.core.row.RowMetaInterface",
"org.pentaho.di.core.row.ValueMetaInterface"
] |
import java.sql.PreparedStatement; import org.pentaho.di.core.exception.KettleDatabaseException; import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.ValueMetaInterface;
|
import java.sql.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.core.row.*;
|
[
"java.sql",
"org.pentaho.di"
] |
java.sql; org.pentaho.di;
| 2,648,530
|
protected JSONObject createActivityJSON(
String tenantDomain,
String path,
NodeRef parentNodeRef,
NodeRef nodeRef,
String fileName) throws JSONException
{
JSONObject json = new JSONObject();
json.put("nodeRef", nodeRef);
if (parentNodeRef != null)
{
// Used for deleted files.
json.put("parentNodeRef", parentNodeRef);
}
if (path != null)
{
// Used for deleted files and folders (added or deleted)
json.put("page", "documentlibrary?path=" + path);
}
else
{
// Used for added or modified files.
json.put("page", "document-details?nodeRef=" + nodeRef);
}
json.put("title", fileName);
if (tenantDomain!= null && !tenantDomain.equals(TenantService.DEFAULT_DOMAIN))
{
// Only used in multi-tenant setups.
json.put("tenantDomain", tenantDomain);
}
return json;
}
|
JSONObject function( String tenantDomain, String path, NodeRef parentNodeRef, NodeRef nodeRef, String fileName) throws JSONException { JSONObject json = new JSONObject(); json.put(STR, nodeRef); if (parentNodeRef != null) { json.put(STR, parentNodeRef); } if (path != null) { json.put("page", STR + path); } else { json.put("page", STR + nodeRef); } json.put("title", fileName); if (tenantDomain!= null && !tenantDomain.equals(TenantService.DEFAULT_DOMAIN)) { json.put(STR, tenantDomain); } return json; }
|
/**
* Create JSON suitable for create, modify or delete activity posts.
*
* @param tenantDomain
* @param path
* @param parentNodeRef
* @param nodeRef
* @param fileName
* @throws JSONException
* @return JSONObject
*/
|
Create JSON suitable for create, modify or delete activity posts
|
createActivityJSON
|
{
"repo_name": "daniel-he/community-edition",
"path": "projects/repository/source/java/org/alfresco/service/cmr/activities/FileFolderActivityPosterImpl.java",
"license": "lgpl-3.0",
"size": 3316
}
|
[
"org.alfresco.repo.tenant.TenantService",
"org.alfresco.service.cmr.repository.NodeRef",
"org.json.JSONException",
"org.json.JSONObject"
] |
import org.alfresco.repo.tenant.TenantService; import org.alfresco.service.cmr.repository.NodeRef; import org.json.JSONException; import org.json.JSONObject;
|
import org.alfresco.repo.tenant.*; import org.alfresco.service.cmr.repository.*; import org.json.*;
|
[
"org.alfresco.repo",
"org.alfresco.service",
"org.json"
] |
org.alfresco.repo; org.alfresco.service; org.json;
| 177,163
|
public void flush() {
if (getBoolean(MEMORY_STICK_MODE)) {
try {
exportPreferences("jabref.xml");
} catch (JabRefException e) {
LOGGER.warn("Could not export preferences for memory stick mode: " + e.getMessage(), e);
}
}
try {
prefs.flush();
} catch (BackingStoreException ex) {
LOGGER.warn("Can not communicate with backing store", ex);
}
}
|
void function() { if (getBoolean(MEMORY_STICK_MODE)) { try { exportPreferences(STR); } catch (JabRefException e) { LOGGER.warn(STR + e.getMessage(), e); } } try { prefs.flush(); } catch (BackingStoreException ex) { LOGGER.warn(STR, ex); } }
|
/**
* Calling this method will write all preferences into the preference store.
*/
|
Calling this method will write all preferences into the preference store
|
flush
|
{
"repo_name": "mredaelli/jabref",
"path": "src/main/java/net/sf/jabref/preferences/JabRefPreferences.java",
"license": "mit",
"size": 74079
}
|
[
"java.util.prefs.BackingStoreException",
"net.sf.jabref.JabRefException"
] |
import java.util.prefs.BackingStoreException; import net.sf.jabref.JabRefException;
|
import java.util.prefs.*; import net.sf.jabref.*;
|
[
"java.util",
"net.sf.jabref"
] |
java.util; net.sf.jabref;
| 227,303
|
private void showDialog(final Intent intent, final int requestCode, String message) {
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
alertDialog.setMessage(message);
alertDialog.setPositiveButton(getString(R.string.open_location_options), new DialogInterface.OnClickListener() {
|
void function(final Intent intent, final int requestCode, String message) { final AlertDialog.Builder alertDialog = new AlertDialog.Builder(this); alertDialog.setMessage(message); alertDialog.setPositiveButton(getString(R.string.open_location_options), new DialogInterface.OnClickListener() {
|
/**
* Prompt user to enable location tracking
*/
|
Prompt user to enable location tracking
|
showDialog
|
{
"repo_name": "shellygill/maps-app-android",
"path": "maps-app/src/main/java/com/esri/android/mapsapp/MapsAppActivity.java",
"license": "apache-2.0",
"size": 17192
}
|
[
"android.content.DialogInterface",
"android.content.Intent",
"android.support.v7.app.AlertDialog"
] |
import android.content.DialogInterface; import android.content.Intent; import android.support.v7.app.AlertDialog;
|
import android.content.*; import android.support.v7.app.*;
|
[
"android.content",
"android.support"
] |
android.content; android.support;
| 843,575
|
public static <T> Transformer<T, T> cloneTransformer() {
return CloneTransformer.cloneTransformer();
}
|
static <T> Transformer<T, T> function() { return CloneTransformer.cloneTransformer(); }
|
/**
* Gets a transformer that returns a clone of the input object.
* The input object will be cloned using one of these techniques (in order):
* <ul>
* <li>public clone method
* <li>public copy constructor
* <li>serialization clone
* <ul>
*
* @param <T> the input/output type
* @return the transformer
* @see CloneTransformer
*/
|
Gets a transformer that returns a clone of the input object. The input object will be cloned using one of these techniques (in order): public clone method public copy constructor serialization clone
|
cloneTransformer
|
{
"repo_name": "MuShiiii/commons-collections",
"path": "src/main/java/org/apache/commons/collections4/TransformerUtils.java",
"license": "apache-2.0",
"size": 20863
}
|
[
"org.apache.commons.collections4.functors.CloneTransformer"
] |
import org.apache.commons.collections4.functors.CloneTransformer;
|
import org.apache.commons.collections4.functors.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 2,567,484
|
public static <N, E extends N, T extends N> String getTextForElement(
ReadableDocument<N, E, T> doc, LocationMapper<N> mapper, String tagName) {
E element = getElementWithTagName(doc, tagName);
if (element != null) {
return getText(doc, mapper, element);
}
return null;
}
|
static <N, E extends N, T extends N> String function( ReadableDocument<N, E, T> doc, LocationMapper<N> mapper, String tagName) { E element = getElementWithTagName(doc, tagName); if (element != null) { return getText(doc, mapper, element); } return null; }
|
/**
* Shortcut to get the text for an element with a specific tag name.
* @see DocHelper#getElementWithTagName(ReadableDocument, String)
* @see DocHelper#getText(ReadableDocument, LocationMapper, Object)
*/
|
Shortcut to get the text for an element with a specific tag name
|
getTextForElement
|
{
"repo_name": "processone/google-wave-api",
"path": "wave-model/src/main/java/org/waveprotocol/wave/model/document/util/DocHelper.java",
"license": "apache-2.0",
"size": 34765
}
|
[
"org.waveprotocol.wave.model.document.ReadableDocument",
"org.waveprotocol.wave.model.document.indexed.LocationMapper"
] |
import org.waveprotocol.wave.model.document.ReadableDocument; import org.waveprotocol.wave.model.document.indexed.LocationMapper;
|
import org.waveprotocol.wave.model.document.*; import org.waveprotocol.wave.model.document.indexed.*;
|
[
"org.waveprotocol.wave"
] |
org.waveprotocol.wave;
| 1,788,833
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.