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
@Override @SuppressWarnings("unchecked") public ChronoZonedDateTime<PaxDate> zonedDateTime(Instant instant, ZoneId zone) { return (ChronoZonedDateTime<PaxDate>) super.zonedDateTime(instant, zone); }
@SuppressWarnings(STR) ChronoZonedDateTime<PaxDate> function(Instant instant, ZoneId zone) { return (ChronoZonedDateTime<PaxDate>) super.zonedDateTime(instant, zone); }
/** * Obtains a Pax zoned date-time in this chronology from an {@code Instant}. * * @param instant the instant to create the date-time from, not null * @param zone the time-zone, not null * @return the Pax zoned date-time, not null * @throws DateTimeException if the result exceeds the supported range */
Obtains a Pax zoned date-time in this chronology from an Instant
zonedDateTime
{ "repo_name": "catull/threeten-extra", "path": "src/main/java/org/threeten/extra/chrono/PaxChronology.java", "license": "bsd-3-clause", "size": 16622 }
[ "java.time.Instant", "java.time.ZoneId", "java.time.chrono.ChronoZonedDateTime" ]
import java.time.Instant; import java.time.ZoneId; import java.time.chrono.ChronoZonedDateTime;
import java.time.*; import java.time.chrono.*;
[ "java.time" ]
java.time;
164,863
@Override public boolean urlExists(String URL) { try { HttpURLConnection.setFollowRedirects(false); HttpURLConnection con = (HttpURLConnection) new URL(URL).openConnection(); con.setRequestMethod("HEAD"); return (con.getResponseCode() == HttpURLConnection.HTTP_OK); } catch (IOException e) { return false; } }
boolean function(String URL) { try { HttpURLConnection.setFollowRedirects(false); HttpURLConnection con = (HttpURLConnection) new URL(URL).openConnection(); con.setRequestMethod("HEAD"); return (con.getResponseCode() == HttpURLConnection.HTTP_OK); } catch (IOException e) { return false; } }
/** * Performs an external HTTP request to see if a file is present at the * specified URL. The HTTP status in the returned header HTTP is used to * determine if the resource is present. * * @param URL * @return true if the resource exists, otherwise false. * <b>Important</b> * The request is made by an anonymous actor. If the resource is present but * the access rights refuse access by an anonymous actor the response will * be false even though the resource may in fact be present. */
Performs an external HTTP request to see if a file is present at the specified URL. The HTTP status in the returned header HTTP is used to determine if the resource is present
urlExists
{ "repo_name": "ff36/jnoc", "path": "src/main/java/co/ff36/jnoc/app/service/internal/DefaultURI.java", "license": "gpl-3.0", "size": 16947 }
[ "java.io.IOException", "java.net.HttpURLConnection" ]
import java.io.IOException; import java.net.HttpURLConnection;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
1,672,656
public Method getMethod(final Class c, final String name, final Object[] params) throws IllegalArgumentException,MethodMap.AmbiguousException { if (c == null) { throw new IllegalArgumentException ("class object is null!"); } if (params == null) { throw new IllegalArgumentException("params object is null!"); } IntrospectorCache ic = getIntrospectorCache(); ClassMap classMap = ic.get(c); if (classMap == null) { classMap = ic.put(c); } return classMap.findMethod(name, params); }
Method function(final Class c, final String name, final Object[] params) throws IllegalArgumentException,MethodMap.AmbiguousException { if (c == null) { throw new IllegalArgumentException (STR); } if (params == null) { throw new IllegalArgumentException(STR); } IntrospectorCache ic = getIntrospectorCache(); ClassMap classMap = ic.get(c); if (classMap == null) { classMap = ic.put(c); } return classMap.findMethod(name, params); }
/** * Gets the method defined by <code>name</code> and * <code>params</code> for the Class <code>c</code>. * * @param c Class in which the method search is taking place * @param name Name of the method being searched for * @param params An array of Objects (not Classes) that describe the * the parameters * * @return The desired Method object. * @throws IllegalArgumentException When the parameters passed in can not be used for introspection. * @throws MethodMap.AmbiguousException When the method map contains more than one match for the requested signature. */
Gets the method defined by <code>name</code> and <code>params</code> for the Class <code>c</code>
getMethod
{ "repo_name": "diydyq/velocity-engine", "path": "velocity-engine-core/src/main/java/org/apache/velocity/util/introspection/IntrospectorBase.java", "license": "apache-2.0", "size": 4896 }
[ "java.lang.reflect.Method" ]
import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
54,565
public ConnectionFactoryBuilder setWriteOpQueueFactory(OperationQueueFactory q) { writeQueueFactory = q; return this; }
ConnectionFactoryBuilder function(OperationQueueFactory q) { writeQueueFactory = q; return this; }
/** * Set the write queue factory. */
Set the write queue factory
setWriteOpQueueFactory
{ "repo_name": "tootedom/spymemcached", "path": "src/main/java/net/spy/memcached/ConnectionFactoryBuilder.java", "license": "mit", "size": 13410 }
[ "net.spy.memcached.ops.OperationQueueFactory" ]
import net.spy.memcached.ops.OperationQueueFactory;
import net.spy.memcached.ops.*;
[ "net.spy.memcached" ]
net.spy.memcached;
45,557
@Test public void testRetrieveAllAssetsEmptyParams(final @Mocked DBCollection collection) { new Expectations() { { collection.find(); } }; createTestBean().retrieveAllAssets(new HashMap<String, List<Condition>>(), null, null, null); }
void function(final @Mocked DBCollection collection) { new Expectations() { { collection.find(); } }; createTestBean().retrieveAllAssets(new HashMap<String, List<Condition>>(), null, null, null); }
/** * Test that an empty list + null search string results in a call to retrieve everything */
Test that an empty list + null search string results in a call to retrieve everything
testRetrieveAllAssetsEmptyParams
{ "repo_name": "antelder/tool.lars", "path": "server/src/test/java/com/ibm/ws/lars/rest/PersistenceBeanBasicSearchTest.java", "license": "apache-2.0", "size": 9504 }
[ "com.mongodb.DBCollection", "java.util.HashMap", "java.util.List" ]
import com.mongodb.DBCollection; import java.util.HashMap; import java.util.List;
import com.mongodb.*; import java.util.*;
[ "com.mongodb", "java.util" ]
com.mongodb; java.util;
2,763,524
GemFireXDQueryObserverHolder.putInstance(observer); }
GemFireXDQueryObserverHolder.putInstance(observer); }
/** * Add a new {@link QueryObserver} to the list of observers for the VM. Note * that any number of observers of a given Class can be present at a time. * Restriction of only one observer of a give Class is removed. */
Add a new <code>QueryObserver</code> to the list of observers for the VM. Note that any number of observers of a given Class can be present at a time. Restriction of only one observer of a give Class is removed
putInstance
{ "repo_name": "papicella/snappy-store", "path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/execute/QueryObserverHolder.java", "license": "apache-2.0", "size": 3196 }
[ "com.pivotal.gemfirexd.internal.engine.GemFireXDQueryObserverHolder" ]
import com.pivotal.gemfirexd.internal.engine.GemFireXDQueryObserverHolder;
import com.pivotal.gemfirexd.internal.engine.*;
[ "com.pivotal.gemfirexd" ]
com.pivotal.gemfirexd;
765,286
public InetSocketAddress localAddress() { return locAddr; }
InetSocketAddress function() { return locAddr; }
/** * Gets the address server is bound to. * * @return Address server is bound to. */
Gets the address server is bound to
localAddress
{ "repo_name": "NSAmelchev/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java", "license": "apache-2.0", "size": 145769 }
[ "java.net.InetSocketAddress" ]
import java.net.InetSocketAddress;
import java.net.*;
[ "java.net" ]
java.net;
2,866,364
return wrap(Collections.<T>emptyList()); } /** * Poorman's {@link Pageable} implementation that does * skipping by simply fast-forwarding {@link Iterator}
return wrap(Collections.<T>emptyList()); } /** * Poorman's {@link Pageable} implementation that does * skipping by simply fast-forwarding {@link Iterator}
/** * Returns an empty {@link Pageable} * @param <T> type of Pageable item * @return empty pageable collection */
Returns an empty <code>Pageable</code>
empty
{ "repo_name": "tfennelly/blueocean-plugin", "path": "blueocean-rest/src/main/java/io/jenkins/blueocean/rest/pageable/Pageables.java", "license": "mit", "size": 1740 }
[ "java.util.Collections", "java.util.Iterator" ]
import java.util.Collections; import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,499,933
public void changePassword() { final User principal = this.userSessionBean.getPrincipal(); this.userAccountService.changePassword(this.passwordChangeDTO, principal); this.passwordChangeDTO = new PasswordChangeDTO(); this.addInfo(true, "profile.password-changed"); }
void function() { final User principal = this.userSessionBean.getPrincipal(); this.userAccountService.changePassword(this.passwordChangeDTO, principal); this.passwordChangeDTO = new PasswordChangeDTO(); this.addInfo(true, STR); }
/** * Start the password changing process */
Start the password changing process
changePassword
{ "repo_name": "arthurgregorio/web-budget", "path": "src/main/java/br/com/webbudget/application/controller/configuration/ProfileBean.java", "license": "gpl-3.0", "size": 4497 }
[ "br.com.webbudget.domain.entities.configuration.User" ]
import br.com.webbudget.domain.entities.configuration.User;
import br.com.webbudget.domain.entities.configuration.*;
[ "br.com.webbudget" ]
br.com.webbudget;
2,710,411
@Override public Object getValue(ELContext context) { return converter.convert(object, type); }
Object function(ELContext context) { return converter.convert(object, type); }
/** * Answer the wrapped object, coerced to the expected type. */
Answer the wrapped object, coerced to the expected type
getValue
{ "repo_name": "robsoncardosoti/flowable-engine", "path": "modules/flowable5-engine/src/main/java/org/activiti/engine/impl/juel/ObjectValueExpression.java", "license": "apache-2.0", "size": 3638 }
[ "org.activiti.engine.impl.javax.el.ELContext" ]
import org.activiti.engine.impl.javax.el.ELContext;
import org.activiti.engine.impl.javax.el.*;
[ "org.activiti.engine" ]
org.activiti.engine;
2,331,445
long length() throws IOException;
long length() throws IOException;
/** * Returns the total length of the stream, if known. Otherwise, * <code>-1</code> is returned. * * @return a <code>long</code> containing the length of the * stream, if known, or else <code>-1</code>. * * @exception IOException if an I/O error occurs. */
Returns the total length of the stream, if known. Otherwise, <code>-1</code> is returned
length
{ "repo_name": "haikuowuya/android_system_code", "path": "src/javax/imageio/stream/ImageInputStream.java", "license": "apache-2.0", "size": 38898 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,368,112
public Future<CommandResult> setDoorClosedEvents(final Integer value) { return write(attributes.get(ATTR_DOORCLOSEDEVENTS), value); }
Future<CommandResult> function(final Integer value) { return write(attributes.get(ATTR_DOORCLOSEDEVENTS), value); }
/** * Set the <i>Door Closed Events</i> attribute [attribute ID <b>0x0005</b>]. * <p> * This attribute holds the number of door closed events that have occurred since it was * last zeroed. * <p> * The attribute is of type {@link Integer}. * <p> * The implementation of this attribute by a device is OPTIONAL * * @param doorClosedEvents the {@link Integer} attribute value to be set * @return the {@link Future<CommandResult>} command result future */
Set the Door Closed Events attribute [attribute ID 0x0005]. This attribute holds the number of door closed events that have occurred since it was last zeroed. The attribute is of type <code>Integer</code>. The implementation of this attribute by a device is OPTIONAL
setDoorClosedEvents
{ "repo_name": "cschwer/com.zsmartsystems.zigbee", "path": "com.zsmartsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/zcl/clusters/ZclDoorLockCluster.java", "license": "epl-1.0", "size": 162296 }
[ "com.zsmartsystems.zigbee.CommandResult", "java.util.concurrent.Future" ]
import com.zsmartsystems.zigbee.CommandResult; import java.util.concurrent.Future;
import com.zsmartsystems.zigbee.*; import java.util.concurrent.*;
[ "com.zsmartsystems.zigbee", "java.util" ]
com.zsmartsystems.zigbee; java.util;
997,913
public Builder<T> returning(ResolvableType returnType) { String expected = returnType.toString(); String message = "returnType=" + expected; addFilter(message, m -> expected.equals(ResolvableType.forMethodReturnType(m).toString())); return this; }
Builder<T> function(ResolvableType returnType) { String expected = returnType.toString(); String message = STR + expected; addFilter(message, m -> expected.equals(ResolvableType.forMethodReturnType(m).toString())); return this; }
/** * Filter on methods returning the given type. * @param returnType the return type */
Filter on methods returning the given type
returning
{ "repo_name": "pwheel/spring-security", "path": "webflux/src/test/java/org/springframework/security/web/method/ResolvableMethod.java", "license": "apache-2.0", "size": 21021 }
[ "org.springframework.core.ResolvableType" ]
import org.springframework.core.ResolvableType;
import org.springframework.core.*;
[ "org.springframework.core" ]
org.springframework.core;
1,127,256
@MediumTest public void testRelaunchLatestTabWithInvalidViewIntent() throws Exception { launchThreeTabs(); final DocumentTabModelSelector selector = ChromeApplication.getDocumentTabModelSelector(); final int lastTabId = selector.getCurrentTabId(); final Activity lastTrackedActivity = ApplicationStatus.getLastTrackedFocusedActivity(); // Send Chrome to the background, then bring it back. ApplicationTestUtils.fireHomeScreenIntent(mContext); Intent intent = new Intent(Intent.ACTION_VIEW, null); intent.setClassName(mContext, ChromeLauncherActivity.class.getName()); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); mContext.startActivity(intent); ApplicationTestUtils.waitUntilChromeInForeground();
void function() throws Exception { launchThreeTabs(); final DocumentTabModelSelector selector = ChromeApplication.getDocumentTabModelSelector(); final int lastTabId = selector.getCurrentTabId(); final Activity lastTrackedActivity = ApplicationStatus.getLastTrackedFocusedActivity(); ApplicationTestUtils.fireHomeScreenIntent(mContext); Intent intent = new Intent(Intent.ACTION_VIEW, null); intent.setClassName(mContext, ChromeLauncherActivity.class.getName()); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); mContext.startActivity(intent); ApplicationTestUtils.waitUntilChromeInForeground();
/** * Confirm that firing a View Intent with a null URL acts like a Main Intent. */
Confirm that firing a View Intent with a null URL acts like a Main Intent
testRelaunchLatestTabWithInvalidViewIntent
{ "repo_name": "lihui7115/ChromiumGStreamerBackend", "path": "chrome/android/javatests/src/org/chromium/chrome/browser/document/DocumentModeTest.java", "license": "bsd-3-clause", "size": 33290 }
[ "android.app.Activity", "android.content.Intent", "org.chromium.base.ApplicationStatus", "org.chromium.chrome.browser.ChromeApplication", "org.chromium.chrome.browser.tabmodel.document.DocumentTabModelSelector", "org.chromium.chrome.test.util.ApplicationTestUtils" ]
import android.app.Activity; import android.content.Intent; import org.chromium.base.ApplicationStatus; import org.chromium.chrome.browser.ChromeApplication; import org.chromium.chrome.browser.tabmodel.document.DocumentTabModelSelector; import org.chromium.chrome.test.util.ApplicationTestUtils;
import android.app.*; import android.content.*; import org.chromium.base.*; import org.chromium.chrome.browser.*; import org.chromium.chrome.browser.tabmodel.document.*; import org.chromium.chrome.test.util.*;
[ "android.app", "android.content", "org.chromium.base", "org.chromium.chrome" ]
android.app; android.content; org.chromium.base; org.chromium.chrome;
1,616,834
public Name addAll(int posn, List<Rdn> suffixRdns) { unparsed = null; for (int i = 0; i < suffixRdns.size(); i++) { Object obj = suffixRdns.get(i); if (!(obj instanceof Rdn)) { throw new IllegalArgumentException("Entry:" + obj + " not a valid type;suffix list entries must be of type Rdn"); } rdns.add(i + posn, obj); } return this; }
Name function(int posn, List<Rdn> suffixRdns) { unparsed = null; for (int i = 0; i < suffixRdns.size(); i++) { Object obj = suffixRdns.get(i); if (!(obj instanceof Rdn)) { throw new IllegalArgumentException(STR + obj + STR); } rdns.add(i + posn, obj); } return this; }
/** * Adds the RDNs of a name -- in order -- at a specified position * within this name. RDNs of this LDAP name at or after the * index (if any) of the first new RDN are shifted up (away from index 0) to * accomodate the new RDNs. * * @param suffixRdns The non-null suffix <tt>Rdn</tt>s to add. * @param posn The index at which to add the suffix RDNs. * Must be in the range [0,size()]. * * @return The updated name (not a new instance). * @throws IndexOutOfBoundsException. * If posn is outside the specified range. */
Adds the RDNs of a name -- in order -- at a specified position within this name. RDNs of this LDAP name at or after the index (if any) of the first new RDN are shifted up (away from index 0) to accomodate the new RDNs
addAll
{ "repo_name": "andreagenso/java2scala", "path": "test/J2s/java/openjdk-6-src-b27/jdk/src/share/classes/javax/naming/ldap/LdapName.java", "license": "apache-2.0", "size": 29197 }
[ "java.util.List", "javax.naming.Name" ]
import java.util.List; import javax.naming.Name;
import java.util.*; import javax.naming.*;
[ "java.util", "javax.naming" ]
java.util; javax.naming;
460,165
@Test(expected = YarnException.class) public void testConstructorOff() throws YarnException { new CGroupElasticMemoryController( conf, null, null, false, false, 10000 ); }
@Test(expected = YarnException.class) void function() throws YarnException { new CGroupElasticMemoryController( conf, null, null, false, false, 10000 ); }
/** * Test that at least one memory type is requested. * @throws YarnException on exception */
Test that at least one memory type is requested
testConstructorOff
{ "repo_name": "xiao-chen/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/linux/resources/TestCGroupElasticMemoryController.java", "license": "apache-2.0", "size": 10550 }
[ "org.apache.hadoop.yarn.exceptions.YarnException", "org.junit.Test" ]
import org.apache.hadoop.yarn.exceptions.YarnException; import org.junit.Test;
import org.apache.hadoop.yarn.exceptions.*; import org.junit.*;
[ "org.apache.hadoop", "org.junit" ]
org.apache.hadoop; org.junit;
2,768,433
protected Element getElement() { return element; }
Element function() { return element; }
/** * Returns the element owning the attribute with which this length * list is associated. */
Returns the element owning the attribute with which this length list is associated
getElement
{ "repo_name": "git-moss/Push2Display", "path": "lib/batik-1.8/sources/org/apache/batik/anim/dom/SVGOMAnimatedLengthList.java", "license": "lgpl-3.0", "size": 16673 }
[ "org.w3c.dom.Element" ]
import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,938,849
@SuppressWarnings("unchecked") @Override public Object getAdapter(Class key) { if (key.equals(IContentOutlinePage.class)) { return showOutlineView() ? getContentOutlinePage() : null; } else if (key.equals(IPropertySheetPage.class)) { return getPropertySheetPage(); } else if (key.equals(IGotoMarker.class)) { return this; } else { return super.getAdapter(key); } }
@SuppressWarnings(STR) Object function(Class key) { if (key.equals(IContentOutlinePage.class)) { return showOutlineView() ? getContentOutlinePage() : null; } else if (key.equals(IPropertySheetPage.class)) { return getPropertySheetPage(); } else if (key.equals(IGotoMarker.class)) { return this; } else { return super.getAdapter(key); } }
/** * This is how the framework determines which interfaces we implement. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This is how the framework determines which interfaces we implement.
getAdapter
{ "repo_name": "hosny1993/vogella", "path": "de.vogella.emf.webpage.model.editor/src/de/vogella/emf/webpage/model/webpage/presentation/WebpageEditor.java", "license": "epl-1.0", "size": 55492 }
[ "org.eclipse.ui.ide.IGotoMarker", "org.eclipse.ui.views.contentoutline.IContentOutlinePage", "org.eclipse.ui.views.properties.IPropertySheetPage" ]
import org.eclipse.ui.ide.IGotoMarker; import org.eclipse.ui.views.contentoutline.IContentOutlinePage; import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.ide.*; import org.eclipse.ui.views.contentoutline.*; import org.eclipse.ui.views.properties.*;
[ "org.eclipse.ui" ]
org.eclipse.ui;
1,188,299
@Override public List<Travel> searchByOriginDestination(String origin, String destination) { List<Travel> lista = new ArrayList(); List<Travel> viaggi = travelFacade.findAll(); origin = origin.toLowerCase(); destination = destination.toLowerCase(); for (Travel temp : viaggi) { if (temp.getDestination().equals(destination) && temp.getOrigin().equals(origin) && temp.getFreeSeats() > 0) { if (isCreatorTravel(temp.getClient_id(), temp.getDriver_id())) { lista.add(temp); } } } return sortListByDate(lista); }
List<Travel> function(String origin, String destination) { List<Travel> lista = new ArrayList(); List<Travel> viaggi = travelFacade.findAll(); origin = origin.toLowerCase(); destination = destination.toLowerCase(); for (Travel temp : viaggi) { if (temp.getDestination().equals(destination) && temp.getOrigin().equals(origin) && temp.getFreeSeats() > 0) { if (isCreatorTravel(temp.getClient_id(), temp.getDriver_id())) { lista.add(temp); } } } return sortListByDate(lista); }
/** * Ricerca e restituisce i vaggi per destinazione e punto di partenza. * * @param origin punto di partenza del viaggio. * @param destination punto di arrivo. * @return List di Travel che rispettano i criteri di ricerca. */
Ricerca e restituisce i vaggi per destinazione e punto di partenza
searchByOriginDestination
{ "repo_name": "grzegorzbrze/Conpartir0.2", "path": "Conpartir-ejb/src/java/org/conpartir/sessionBean/TravelManager.java", "license": "gpl-3.0", "size": 24656 }
[ "java.util.ArrayList", "java.util.List", "org.conpartir.entity.Travel" ]
import java.util.ArrayList; import java.util.List; import org.conpartir.entity.Travel;
import java.util.*; import org.conpartir.entity.*;
[ "java.util", "org.conpartir.entity" ]
java.util; org.conpartir.entity;
2,457,416
@Feature({"AndroidWebView"}) @SmallTest @CommandLineFlags.Add({ AwSwitches.WEBVIEW_SANDBOXED_RENDERER, ContentSwitches.IPC_SYNC_COMPOSITING}) @ParameterizedTest.Set public void testSandboxedRendererWorks() throws Throwable { MockBindingManager bindingManager = new MockBindingManager(); ChildProcessLauncher.setBindingManagerForTesting(bindingManager); assertFalse(bindingManager.isChildProcessCreated()); AwTestContainerView testView = createAwTestContainerViewOnMainSync(mContentsClient); AwContents awContents = testView.getAwContents(); final String pageTitle = "I am sandboxed"; loadDataSync(awContents, mContentsClient.getOnPageFinishedHelper(), "<html><head><title>" + pageTitle + "</title></head></html>", "text/html", false); assertEquals(pageTitle, getTitleOnUiThread(awContents)); assertTrue(bindingManager.isChildProcessCreated()); // Test end-to-end interaction with the renderer. AwSettings awSettings = getAwSettingsOnUiThread(awContents); awSettings.setJavaScriptEnabled(true); assertEquals("42", JSUtils.executeJavaScriptAndWaitForResult(this, awContents, mContentsClient.getOnEvaluateJavaScriptResultHelper(), "21 + 21")); } private static class AccessibilityCallbackHelper extends CallbackHelper { private AccessibilitySnapshotNode mRoot;
@Feature({STR}) @CommandLineFlags.Add({ AwSwitches.WEBVIEW_SANDBOXED_RENDERER, ContentSwitches.IPC_SYNC_COMPOSITING}) @ParameterizedTest.Set void function() throws Throwable { MockBindingManager bindingManager = new MockBindingManager(); ChildProcessLauncher.setBindingManagerForTesting(bindingManager); assertFalse(bindingManager.isChildProcessCreated()); AwTestContainerView testView = createAwTestContainerViewOnMainSync(mContentsClient); AwContents awContents = testView.getAwContents(); final String pageTitle = STR; loadDataSync(awContents, mContentsClient.getOnPageFinishedHelper(), STR + pageTitle + STR, STR, false); assertEquals(pageTitle, getTitleOnUiThread(awContents)); assertTrue(bindingManager.isChildProcessCreated()); AwSettings awSettings = getAwSettingsOnUiThread(awContents); awSettings.setJavaScriptEnabled(true); assertEquals("42", JSUtils.executeJavaScriptAndWaitForResult(this, awContents, mContentsClient.getOnEvaluateJavaScriptResultHelper(), STR)); } private static class AccessibilityCallbackHelper extends CallbackHelper { private AccessibilitySnapshotNode mRoot;
/** * Verifies that a child process is actually gets created with WEBVIEW_SANDBOXED_RENDERER flag. */
Verifies that a child process is actually gets created with WEBVIEW_SANDBOXED_RENDERER flag
testSandboxedRendererWorks
{ "repo_name": "Workday/OpenFrame", "path": "android_webview/javatests/src/org/chromium/android_webview/test/AwContentsTest.java", "license": "bsd-3-clause", "size": 39672 }
[ "org.chromium.android_webview.AwContents", "org.chromium.android_webview.AwSettings", "org.chromium.android_webview.AwSwitches", "org.chromium.android_webview.test.util.JSUtils", "org.chromium.base.test.util.CommandLineFlags", "org.chromium.base.test.util.Feature", "org.chromium.base.test.util.parameter.ParameterizedTest", "org.chromium.content.browser.ChildProcessLauncher", "org.chromium.content.browser.test.util.CallbackHelper", "org.chromium.content.common.ContentSwitches", "org.chromium.content_public.browser.AccessibilitySnapshotNode" ]
import org.chromium.android_webview.AwContents; import org.chromium.android_webview.AwSettings; import org.chromium.android_webview.AwSwitches; import org.chromium.android_webview.test.util.JSUtils; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.parameter.ParameterizedTest; import org.chromium.content.browser.ChildProcessLauncher; import org.chromium.content.browser.test.util.CallbackHelper; import org.chromium.content.common.ContentSwitches; import org.chromium.content_public.browser.AccessibilitySnapshotNode;
import org.chromium.android_webview.*; import org.chromium.android_webview.test.util.*; import org.chromium.base.test.util.*; import org.chromium.base.test.util.parameter.*; import org.chromium.content.browser.*; import org.chromium.content.browser.test.util.*; import org.chromium.content.common.*; import org.chromium.content_public.browser.*;
[ "org.chromium.android_webview", "org.chromium.base", "org.chromium.content", "org.chromium.content_public" ]
org.chromium.android_webview; org.chromium.base; org.chromium.content; org.chromium.content_public;
2,346,433
public List<FieldAndFormat> fieldDataFields() { return docValueFields; }
List<FieldAndFormat> function() { return docValueFields; }
/** * Gets the field-data fields. */
Gets the field-data fields
fieldDataFields
{ "repo_name": "gingerwizard/elasticsearch", "path": "server/src/main/java/org/elasticsearch/search/aggregations/metrics/TopHitsAggregationBuilder.java", "license": "apache-2.0", "size": 34389 }
[ "java.util.List", "org.elasticsearch.search.fetch.subphase.FieldAndFormat" ]
import java.util.List; import org.elasticsearch.search.fetch.subphase.FieldAndFormat;
import java.util.*; import org.elasticsearch.search.fetch.subphase.*;
[ "java.util", "org.elasticsearch.search" ]
java.util; org.elasticsearch.search;
1,037,748
public static NotifyNeighborBlockEvent createNotifyNeighborBlockEvent(Cause cause, Map<Direction, BlockState> originalNeighbors, Map<Direction, BlockState> neighbors) { HashMap<String, Object> values = new HashMap<>(); values.put("cause", cause); values.put("originalNeighbors", originalNeighbors); values.put("neighbors", neighbors); return SpongeEventFactoryUtils.createEventImpl(NotifyNeighborBlockEvent.class, values); }
static NotifyNeighborBlockEvent function(Cause cause, Map<Direction, BlockState> originalNeighbors, Map<Direction, BlockState> neighbors) { HashMap<String, Object> values = new HashMap<>(); values.put("cause", cause); values.put(STR, originalNeighbors); values.put(STR, neighbors); return SpongeEventFactoryUtils.createEventImpl(NotifyNeighborBlockEvent.class, values); }
/** * AUTOMATICALLY GENERATED, DO NOT EDIT. * Creates a new instance of * {@link org.spongepowered.api.event.block.NotifyNeighborBlockEvent}. * * @param cause The cause * @param originalNeighbors The original neighbors * @param neighbors The neighbors * @return A new notify neighbor block event */
AUTOMATICALLY GENERATED, DO NOT EDIT. Creates a new instance of <code>org.spongepowered.api.event.block.NotifyNeighborBlockEvent</code>
createNotifyNeighborBlockEvent
{ "repo_name": "kashike/SpongeAPI", "path": "src/main/java/org/spongepowered/api/event/SpongeEventFactory.java", "license": "mit", "size": 215110 }
[ "java.util.HashMap", "java.util.Map", "org.spongepowered.api.block.BlockState", "org.spongepowered.api.event.block.NotifyNeighborBlockEvent", "org.spongepowered.api.event.cause.Cause", "org.spongepowered.api.util.Direction" ]
import java.util.HashMap; import java.util.Map; import org.spongepowered.api.block.BlockState; import org.spongepowered.api.event.block.NotifyNeighborBlockEvent; import org.spongepowered.api.event.cause.Cause; import org.spongepowered.api.util.Direction;
import java.util.*; import org.spongepowered.api.block.*; import org.spongepowered.api.event.block.*; import org.spongepowered.api.event.cause.*; import org.spongepowered.api.util.*;
[ "java.util", "org.spongepowered.api" ]
java.util; org.spongepowered.api;
1,946,652
public void buildInitialTargets() { int numSteelDb = numTargetsDb(ScoreContract.TargetEntry.TARGET_TYPE_STEEL); int numPaperDb = numTargetsDb(ScoreContract.TargetEntry.TARGET_TYPE_PAPER); int numSteelPrefs = numTargetsPrefs(ScoreContract.TargetEntry.TARGET_TYPE_STEEL); int numPaperPRefs = numTargetsPrefs(ScoreContract.TargetEntry.TARGET_TYPE_PAPER); if (numSteelDb == 0 && numSteelPrefs > 0 || numPaperDb == 0 && numPaperPRefs > 0) { buildTargets(); } else if (numSteelDb != numSteelPrefs || numPaperDb != numPaperPRefs) Log.w(LOG_TAG, "Your number of targets does not match your settings"); }
void function() { int numSteelDb = numTargetsDb(ScoreContract.TargetEntry.TARGET_TYPE_STEEL); int numPaperDb = numTargetsDb(ScoreContract.TargetEntry.TARGET_TYPE_PAPER); int numSteelPrefs = numTargetsPrefs(ScoreContract.TargetEntry.TARGET_TYPE_STEEL); int numPaperPRefs = numTargetsPrefs(ScoreContract.TargetEntry.TARGET_TYPE_PAPER); if (numSteelDb == 0 && numSteelPrefs > 0 numPaperDb == 0 && numPaperPRefs > 0) { buildTargets(); } else if (numSteelDb != numSteelPrefs numPaperDb != numPaperPRefs) Log.w(LOG_TAG, STR); }
/** * Builds targets when there are none in the database. This helps showing some targets when * the application is run for the first time. */
Builds targets when there are none in the database. This helps showing some targets when the application is run for the first time
buildInitialTargets
{ "repo_name": "kherb64/IPSCScorer", "path": "app/src/main/java/kherb64/android/ipscscorer/MainActivity.java", "license": "mit", "size": 14291 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
679,515
@RequiredScope({view}) @ResponseStatus(HttpStatus.OK) @RequestMapping(value = UrlHelpers.MESSAGE_OUTBOX, method = RequestMethod.GET) public @ResponseBody PaginatedResults<MessageToUser> getOutbox( @RequestParam(value = AuthorizationConstants.USER_ID_PARAM) Long userId, @RequestParam(value = UrlHelpers.MESSAGE_ORDER_BY_PARAM, defaultValue = defaultSortOrder) String orderBy, @RequestParam(value = UrlHelpers.MESSAGE_DESCENDING_PARAM, defaultValue = defaultSortDescending) boolean descending, @RequestParam(value = ServiceConstants.PAGINATION_LIMIT_PARAM, defaultValue = ServiceConstants.DEFAULT_PAGINATION_LIMIT_PARAM) long limit, @RequestParam(value = ServiceConstants.PAGINATION_OFFSET_PARAM, defaultValue = ServiceConstants.DEFAULT_PAGINATION_OFFSET_PARAM) long offset, HttpServletRequest request) throws NotFoundException { MessageSortBy sortBy = MessageSortBy.valueOf(orderBy.toUpperCase()); return serviceProvider.getMessageService().getOutbox(userId, sortBy, descending, limit, offset, request.getServletPath() + UrlHelpers.MESSAGE_OUTBOX); }
@RequiredScope({view}) @ResponseStatus(HttpStatus.OK) @RequestMapping(value = UrlHelpers.MESSAGE_OUTBOX, method = RequestMethod.GET) PaginatedResults<MessageToUser> function( @RequestParam(value = AuthorizationConstants.USER_ID_PARAM) Long userId, @RequestParam(value = UrlHelpers.MESSAGE_ORDER_BY_PARAM, defaultValue = defaultSortOrder) String orderBy, @RequestParam(value = UrlHelpers.MESSAGE_DESCENDING_PARAM, defaultValue = defaultSortDescending) boolean descending, @RequestParam(value = ServiceConstants.PAGINATION_LIMIT_PARAM, defaultValue = ServiceConstants.DEFAULT_PAGINATION_LIMIT_PARAM) long limit, @RequestParam(value = ServiceConstants.PAGINATION_OFFSET_PARAM, defaultValue = ServiceConstants.DEFAULT_PAGINATION_OFFSET_PARAM) long offset, HttpServletRequest request) throws NotFoundException { MessageSortBy sortBy = MessageSortBy.valueOf(orderBy.toUpperCase()); return serviceProvider.getMessageService().getOutbox(userId, sortBy, descending, limit, offset, request.getServletPath() + UrlHelpers.MESSAGE_OUTBOX); }
/** * Retrieves the current authenticated user's outbox. * </br> * By default, the most recent messages are returned first. * To flip the ordering, set the "descending" parameter to "false". * To change the way the messages are ordered, set the "orderBy" parameter to * either "SEND_DATE" or "SUBJECT". */
Retrieves the current authenticated user's outbox. By default, the most recent messages are returned first. To flip the ordering, set the "descending" parameter to "false". To change the way the messages are ordered, set the "orderBy" parameter to either "SEND_DATE" or "SUBJECT"
getOutbox
{ "repo_name": "xschildw/Synapse-Repository-Services", "path": "services/repository/src/main/java/org/sagebionetworks/repo/web/controller/MessageController.java", "license": "apache-2.0", "size": 15514 }
[ "javax.servlet.http.HttpServletRequest", "org.sagebionetworks.reflection.model.PaginatedResults", "org.sagebionetworks.repo.model.AuthorizationConstants", "org.sagebionetworks.repo.model.ServiceConstants", "org.sagebionetworks.repo.model.message.MessageSortBy", "org.sagebionetworks.repo.model.message.MessageToUser", "org.sagebionetworks.repo.web.NotFoundException", "org.sagebionetworks.repo.web.RequiredScope", "org.sagebionetworks.repo.web.UrlHelpers", "org.springframework.http.HttpStatus", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod", "org.springframework.web.bind.annotation.RequestParam", "org.springframework.web.bind.annotation.ResponseStatus" ]
import javax.servlet.http.HttpServletRequest; import org.sagebionetworks.reflection.model.PaginatedResults; import org.sagebionetworks.repo.model.AuthorizationConstants; import org.sagebionetworks.repo.model.ServiceConstants; import org.sagebionetworks.repo.model.message.MessageSortBy; import org.sagebionetworks.repo.model.message.MessageToUser; import org.sagebionetworks.repo.web.NotFoundException; import org.sagebionetworks.repo.web.RequiredScope; import org.sagebionetworks.repo.web.UrlHelpers; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseStatus;
import javax.servlet.http.*; import org.sagebionetworks.reflection.model.*; import org.sagebionetworks.repo.model.*; import org.sagebionetworks.repo.model.message.*; import org.sagebionetworks.repo.web.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*;
[ "javax.servlet", "org.sagebionetworks.reflection", "org.sagebionetworks.repo", "org.springframework.http", "org.springframework.web" ]
javax.servlet; org.sagebionetworks.reflection; org.sagebionetworks.repo; org.springframework.http; org.springframework.web;
887,215
void enterAsm(@NotNull mylParser.AsmContext ctx); void exitAsm(@NotNull mylParser.AsmContext ctx);
void enterAsm(@NotNull mylParser.AsmContext ctx); void exitAsm(@NotNull mylParser.AsmContext ctx);
/** * Exit a parse tree produced by {@link mylParser#asm}. * @param ctx the parse tree */
Exit a parse tree produced by <code>mylParser#asm</code>
exitAsm
{ "repo_name": "twd2/WDC", "path": "WDC/antlr_gen/mylListener.java", "license": "gpl-2.0", "size": 16186 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
1,303,682
Object value = null; if (isValid(element)) { TreeProperty property = (TreeProperty) element; // For the "type" property, return the containing tree's type. if (property.isAdaptiveType()) { value = ((AdaptiveTreeComposite) property.getTree()).getType(); } // Otherwise, return the property's value (discrete or not!). else { value = super.getValue(element); } } return value; }
Object value = null; if (isValid(element)) { TreeProperty property = (TreeProperty) element; if (property.isAdaptiveType()) { value = ((AdaptiveTreeComposite) property.getTree()).getType(); } else { value = super.getValue(element); } } return value; }
/** * Gets the value of a {@link TreeProperty}. * <p> * The default behavior is acceptable for most <code>Entry</code>s, but for * those that correspond to the type of {@link AdaptiveTreeComposite}, this * method gets the type of the property's tree. * </p> */
Gets the value of a <code>TreeProperty</code>. The default behavior is acceptable for most <code>Entry</code>s, but for those that correspond to the type of <code>AdaptiveTreeComposite</code>, this method gets the type of the property's tree.
getValue
{ "repo_name": "wo-amlangwang/ice", "path": "org.eclipse.ice.client/src/org/eclipse/ice/client/common/properties/ValueCellContentProvider.java", "license": "epl-1.0", "size": 5245 }
[ "org.eclipse.ice.datastructures.form.AdaptiveTreeComposite" ]
import org.eclipse.ice.datastructures.form.AdaptiveTreeComposite;
import org.eclipse.ice.datastructures.form.*;
[ "org.eclipse.ice" ]
org.eclipse.ice;
964,444
private void handleCancel(Intent intent) { assert(intent.hasExtra(EXTRA_CANCEL)); assert(intent.getStringExtra(EXTRA_JOB_ID) != null); String jobId = intent.getStringExtra(EXTRA_JOB_ID); if (DEBUG) Log.d(TAG, "handleCancel: " + jobId); synchronized (mRunning) { // Do nothing if the cancelled ID doesn't match the current job ID. This prevents racey // cancellation requests from affecting unrelated copy jobs. However, if the current job ID // is null, the service most likely crashed and was revived by the incoming cancel intent. // In that case, always allow the cancellation to proceed. JobRecord record = mRunning.get(jobId); if (record != null) { record.job.cancel(); // If the job hasn't been started, cancel it and explicitly clean up. // If it *has* been started, we wait for it to recognize this, then // allow it stop working in an orderly fashion. if (record.future.getDelay(TimeUnit.MILLISECONDS) > 0) { record.future.cancel(false); onFinished(record.job); } } } // Dismiss the progress notification here rather than in the copy loop. This preserves // interactivity for the user in case the copy loop is stalled. // Try to cancel it even if we don't have a job id...in case there is some sad // orphan notification. mNotificationManager.cancel(jobId, NOTIFICATION_ID_PROGRESS); // TODO: Guarantee the job is being finalized }
void function(Intent intent) { assert(intent.hasExtra(EXTRA_CANCEL)); assert(intent.getStringExtra(EXTRA_JOB_ID) != null); String jobId = intent.getStringExtra(EXTRA_JOB_ID); if (DEBUG) Log.d(TAG, STR + jobId); synchronized (mRunning) { JobRecord record = mRunning.get(jobId); if (record != null) { record.job.cancel(); if (record.future.getDelay(TimeUnit.MILLISECONDS) > 0) { record.future.cancel(false); onFinished(record.job); } } } mNotificationManager.cancel(jobId, NOTIFICATION_ID_PROGRESS); }
/** * Cancels the operation corresponding to job id, identified in "EXTRA_JOB_ID". * * @param intent The cancellation intent. */
Cancels the operation corresponding to job id, identified in "EXTRA_JOB_ID"
handleCancel
{ "repo_name": "xorware/android_frameworks_base", "path": "packages/DocumentsUI/src/com/android/documentsui/services/FileOperationService.java", "license": "apache-2.0", "size": 13041 }
[ "android.content.Intent", "android.util.Log", "java.util.concurrent.TimeUnit" ]
import android.content.Intent; import android.util.Log; import java.util.concurrent.TimeUnit;
import android.content.*; import android.util.*; import java.util.concurrent.*;
[ "android.content", "android.util", "java.util" ]
android.content; android.util; java.util;
284,944
public MVDeconInput init( final PSFTYPE iterationType ) throws IncompatibleTypeException { for ( final MVDeconFFT view : views ) view.init( iterationType, views ); return this; } public ArrayList< MVDeconFFT > getViews() { return views; }
MVDeconInput function( final PSFTYPE iterationType ) throws IncompatibleTypeException { for ( final MVDeconFFT view : views ) view.init( iterationType, views ); return this; } public ArrayList< MVDeconFFT > getViews() { return views; }
/** * init all views * * @return the same instance again for convenience * @throws IncompatibleTypeException */
init all views
init
{ "repo_name": "bigdataviewer/SPIM_Registration", "path": "src/main/java/spim/process/fusion/deconvolution/MVDeconInput.java", "license": "gpl-2.0", "size": 2227 }
[ "java.util.ArrayList", "net.imglib2.exception.IncompatibleTypeException" ]
import java.util.ArrayList; import net.imglib2.exception.IncompatibleTypeException;
import java.util.*; import net.imglib2.exception.*;
[ "java.util", "net.imglib2.exception" ]
java.util; net.imglib2.exception;
1,482,744
public static OrderSpec ascending(CoordinateSpace cs) { throw new PasseException(); }
static OrderSpec function(CoordinateSpace cs) { throw new PasseException(); }
/** * Use CoordinateSpace::fetch/getAscending * @deprecated */
Use CoordinateSpace::fetch/getAscending
ascending
{ "repo_name": "jonesd/udanax-gold2java", "path": "abora-gold/src/generated-sources/translator/info/dgjones/abora/gold/spaces/basic/OrderSpec.java", "license": "mit", "size": 11044 }
[ "info.dgjones.abora.gold.java.exception.PasseException", "info.dgjones.abora.gold.spaces.basic.CoordinateSpace", "info.dgjones.abora.gold.spaces.basic.OrderSpec" ]
import info.dgjones.abora.gold.java.exception.PasseException; import info.dgjones.abora.gold.spaces.basic.CoordinateSpace; import info.dgjones.abora.gold.spaces.basic.OrderSpec;
import info.dgjones.abora.gold.java.exception.*; import info.dgjones.abora.gold.spaces.basic.*;
[ "info.dgjones.abora" ]
info.dgjones.abora;
1,740,546
protected TripleElement tripleElementFromTriplePattern(TriplePattern tp) { TripleElement te = new TripleElement(); te.setSubject(graphNodeToSadlNode(tp.asTriple().getSubject())); te.setPredicate(graphNodeToSadlNode(tp.asTriple().getPredicate())); te.setObject(graphNodeToSadlNode(tp.asTriple().getObject())); return te; }
TripleElement function(TriplePattern tp) { TripleElement te = new TripleElement(); te.setSubject(graphNodeToSadlNode(tp.asTriple().getSubject())); te.setPredicate(graphNodeToSadlNode(tp.asTriple().getPredicate())); te.setObject(graphNodeToSadlNode(tp.asTriple().getObject())); return te; }
/** * Convert a Jena graph TriplePattern to a SADL model TripleElement * @param tp * @return */
Convert a Jena graph TriplePattern to a SADL model TripleElement
tripleElementFromTriplePattern
{ "repo_name": "crapo/sadlos2", "path": "sadl3/com.ge.research.sadl.parent/com.ge.research.sadl.jena-wrapper-for-sadl/src/main/java/com/ge/research/sadl/jena/reasoner/JenaReasonerPlugin.java", "license": "epl-1.0", "size": 124808 }
[ "com.ge.research.sadl.model.gp.TripleElement", "org.apache.jena.reasoner.TriplePattern" ]
import com.ge.research.sadl.model.gp.TripleElement; import org.apache.jena.reasoner.TriplePattern;
import com.ge.research.sadl.model.gp.*; import org.apache.jena.reasoner.*;
[ "com.ge.research", "org.apache.jena" ]
com.ge.research; org.apache.jena;
2,750,218
@Override public void onInstrumentsReady(PaymentApp app, List<PaymentInstrument> instruments) { if (mClient == null) return; mPendingApps.remove(app); // Place the instruments into either "autofill" or "non-autofill" list to be displayed when // all apps have responded. if (instruments != null) { for (int i = 0; i < instruments.size(); i++) { PaymentInstrument instrument = instruments.get(i); if (mMethodData.containsKey(instrument.getMethodName())) { addPendingInstrument(instrument); } else { instrument.dismiss(); } } } // Some payment apps still have not responded. Continue waiting for them. if (!mPendingApps.isEmpty()) return; if (mPendingInstruments.isEmpty() && !mMerchantSupportsAutofillPaymentInstruments) { // All payment apps have responded, but none of them have instruments. It's possible to // add credit cards, but the merchant does not support them either. The payment request // must be rejected. disconnectFromClientWithDebugMessage("Requested payment methods have no instruments", PaymentErrorReason.NOT_SUPPORTED); if (sObserverForTest != null) sObserverForTest.onPaymentRequestServiceShowFailed(); recordAbortReasonHistogram( PaymentRequestMetrics.ABORT_REASON_NO_MATCHING_PAYMENT_METHOD); return; } // List order: // > Non-autofill instruments. // > Complete autofill instruments. // > Incomplete autofill instruments. Collections.sort(mPendingAutofillInstruments, COMPLETENESS_COMPARATOR); mPendingInstruments.addAll(mPendingAutofillInstruments); mPendingAutofillInstruments.clear(); mPendingAutofillInstruments = null; // Pre-select the first instrument on the list, if it is complete. int selection = SectionInformation.NO_SELECTION; if (!mPendingInstruments.isEmpty()) { PaymentInstrument first = mPendingInstruments.get(0); if (!(first instanceof AutofillPaymentInstrument) || ((AutofillPaymentInstrument) first).isComplete()) { selection = 0; } } // The list of payment instruments is ready to display. mPaymentMethodsSection = new SectionInformation(PaymentRequestUI.TYPE_PAYMENT_METHODS, selection, mPendingInstruments); mPendingInstruments.clear(); mPendingInstruments = null; // UI has requested the full list of payment instruments. Provide it now. if (mPaymentInformationCallback != null) providePaymentInformation(); }
void function(PaymentApp app, List<PaymentInstrument> instruments) { if (mClient == null) return; mPendingApps.remove(app); if (instruments != null) { for (int i = 0; i < instruments.size(); i++) { PaymentInstrument instrument = instruments.get(i); if (mMethodData.containsKey(instrument.getMethodName())) { addPendingInstrument(instrument); } else { instrument.dismiss(); } } } if (!mPendingApps.isEmpty()) return; if (mPendingInstruments.isEmpty() && !mMerchantSupportsAutofillPaymentInstruments) { disconnectFromClientWithDebugMessage(STR, PaymentErrorReason.NOT_SUPPORTED); if (sObserverForTest != null) sObserverForTest.onPaymentRequestServiceShowFailed(); recordAbortReasonHistogram( PaymentRequestMetrics.ABORT_REASON_NO_MATCHING_PAYMENT_METHOD); return; } Collections.sort(mPendingAutofillInstruments, COMPLETENESS_COMPARATOR); mPendingInstruments.addAll(mPendingAutofillInstruments); mPendingAutofillInstruments.clear(); mPendingAutofillInstruments = null; int selection = SectionInformation.NO_SELECTION; if (!mPendingInstruments.isEmpty()) { PaymentInstrument first = mPendingInstruments.get(0); if (!(first instanceof AutofillPaymentInstrument) ((AutofillPaymentInstrument) first).isComplete()) { selection = 0; } } mPaymentMethodsSection = new SectionInformation(PaymentRequestUI.TYPE_PAYMENT_METHODS, selection, mPendingInstruments); mPendingInstruments.clear(); mPendingInstruments = null; if (mPaymentInformationCallback != null) providePaymentInformation(); }
/** * Called after retrieving the list of payment instruments in an app. */
Called after retrieving the list of payment instruments in an app
onInstrumentsReady
{ "repo_name": "danakj/chromium", "path": "chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java", "license": "bsd-3-clause", "size": 47497 }
[ "java.util.Collections", "java.util.List", "org.chromium.chrome.browser.payments.ui.PaymentRequestUI", "org.chromium.chrome.browser.payments.ui.SectionInformation", "org.chromium.mojom.payments.PaymentErrorReason" ]
import java.util.Collections; import java.util.List; import org.chromium.chrome.browser.payments.ui.PaymentRequestUI; import org.chromium.chrome.browser.payments.ui.SectionInformation; import org.chromium.mojom.payments.PaymentErrorReason;
import java.util.*; import org.chromium.chrome.browser.payments.ui.*; import org.chromium.mojom.payments.*;
[ "java.util", "org.chromium.chrome", "org.chromium.mojom" ]
java.util; org.chromium.chrome; org.chromium.mojom;
1,457,411
@Override public void generateBeanPrologue(JavaWriter out, HashMap<String,Object> map) throws IOException { super.generateBeanPrologue(out, map); if (! isEnhanced()) { return; } if (map.get("__caucho_interceptor_objects") == null) { map.put("__caucho_interceptor_objects", true); out.println(); out.print("private transient Object []"); out.println("__caucho_interceptor_objects;"); } generateBeanInterceptorChain(out, map); getBusinessMethod().generateInterceptorTarget(out); }
void function(JavaWriter out, HashMap<String,Object> map) throws IOException { super.generateBeanPrologue(out, map); if (! isEnhanced()) { return; } if (map.get(STR) == null) { map.put(STR, true); out.println(); out.print(STR); out.println(STR); } generateBeanInterceptorChain(out, map); getBusinessMethod().generateInterceptorTarget(out); }
/** * Generates the prologue for the bean instance. */
Generates the prologue for the bean instance
generateBeanPrologue
{ "repo_name": "christianchristensen/resin", "path": "modules/kernel/src/com/caucho/config/gen/InterceptorCallChain.java", "license": "gpl-2.0", "size": 44896 }
[ "com.caucho.java.JavaWriter", "java.io.IOException", "java.util.HashMap" ]
import com.caucho.java.JavaWriter; import java.io.IOException; import java.util.HashMap;
import com.caucho.java.*; import java.io.*; import java.util.*;
[ "com.caucho.java", "java.io", "java.util" ]
com.caucho.java; java.io; java.util;
998,075
public void endScriptDecl() throws SAVException, VRMLException;
void function() throws SAVException, VRMLException;
/** * Notification of the end of a script declaration. This is guaranteed to * be called before the ContentHandler <CODE>endNode()</CODE> callback. * * @throws SAVException This call is taken at the wrong time in the * structure of the document. * @throws VRMLException This call is taken at the wrong time in the * structure of the document. */
Notification of the end of a script declaration. This is guaranteed to be called before the ContentHandler <code>endNode()</code> callback
endScriptDecl
{ "repo_name": "Norkart/NK-VirtualGlobe", "path": "Xj3D/src/java/org/web3d/vrml/sav/ScriptHandler.java", "license": "gpl-2.0", "size": 3426 }
[ "org.web3d.vrml.lang.VRMLException" ]
import org.web3d.vrml.lang.VRMLException;
import org.web3d.vrml.lang.*;
[ "org.web3d.vrml" ]
org.web3d.vrml;
1,603,932
public long processQueue(final lotus.domino.Base current, final Collection<lotus.domino.Base> prevent_recycling) { long result = 0; if (current instanceof lotus.domino.Item) { // do not count items, as we have many of them } else if (current instanceof lotus.domino.MIMEEntity) { // Mimeentities are recycled on closeMimeEntities } else if (current instanceof lotus.domino.MIMEHeader) { // same for header } else { // count only "heavy" objects (list above not yet complete) int counter = cache_counter.incrementAndGet(); if (counter % GARBAGE_INTERVAL == 0) { // We have to run GC from time to time, otherwise objects will die very late :( System.gc(); } } DominoReference ref = null; while ((ref = (DominoReference) queue.poll()) != null) { lotus.domino.Base unrefLotus = ref.getDelegate(); map.remove(unrefLotus); if (unrefLotus == null) { // should never happen } else if (unrefLotus == current) { ref.setNoRecycle(true); } else if (prevent_recycling != null) { for (lotus.domino.Base curKey : prevent_recycling) { if (curKey == unrefLotus) { // TODO: This case does not handle the counters correctly // System.out.println("Parent object dropped out of the queue ---"); // RPr: This happens definitely, if you access the same document in series // Was reproduceable by iterating over several NoteIds and doing this in the loop (odd number required) // doc1 = d.getDocumentByID(id); // doc1 = null; // doc2 = d.getDocumentByID(id); // doc2 = null; // doc3 = d.getDocumentByID(id); // doc3 = null; // ref is not used any more, but this object must be protected from recycling, because it will be reused in the next step // Q RPr: Who sets this back to False? // A RPr: That is not needed, because this "ref" is not used any more and the lotus object gets wrapped in a new DominoReference. ref.setNoRecycle(true); break; } } } if (ref.recycle()) result++; } return result; }
long function(final lotus.domino.Base current, final Collection<lotus.domino.Base> prevent_recycling) { long result = 0; if (current instanceof lotus.domino.Item) { } else if (current instanceof lotus.domino.MIMEEntity) { } else if (current instanceof lotus.domino.MIMEHeader) { } else { int counter = cache_counter.incrementAndGet(); if (counter % GARBAGE_INTERVAL == 0) { System.gc(); } } DominoReference ref = null; while ((ref = (DominoReference) queue.poll()) != null) { lotus.domino.Base unrefLotus = ref.getDelegate(); map.remove(unrefLotus); if (unrefLotus == null) { } else if (unrefLotus == current) { ref.setNoRecycle(true); } else if (prevent_recycling != null) { for (lotus.domino.Base curKey : prevent_recycling) { if (curKey == unrefLotus) { ref.setNoRecycle(true); break; } } } if (ref.recycle()) result++; } return result; }
/** * Removes all garbage collected values with their keys from the map. * */
Removes all garbage collected values with their keys from the map
processQueue
{ "repo_name": "rPraml/org.openntf.domino", "path": "domino/core-impl/src/main/java/org/openntf/domino/impl/DominoReferenceCache.java", "license": "apache-2.0", "size": 9558 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,564,082
Loan findById(Long id);
Loan findById(Long id);
/** * Finds a loan with the given id in the database * * @param id of searched loan * @return found loan */
Finds a loan with the given id in the database
findById
{ "repo_name": "DavidLuptak/pa165-library-system", "path": "library-system-persistence/src/main/java/cz/muni/fi/pa165/library/dao/LoanDao.java", "license": "gpl-3.0", "size": 1167 }
[ "cz.muni.fi.pa165.library.entity.Loan" ]
import cz.muni.fi.pa165.library.entity.Loan;
import cz.muni.fi.pa165.library.entity.*;
[ "cz.muni.fi" ]
cz.muni.fi;
1,136,802
@Override public boolean execute(final String[] params, final String remainder) { if ((params == null) || (params.length < getMinimumParameters())) { return false; } final RPAction alter = new RPAction(); alter.put("type", "altercreature"); alter.put("target", params[0]); alter.put("text", params[1]); ClientSingletonRepository.getClientFramework().send(alter); return true; }
boolean function(final String[] params, final String remainder) { if ((params == null) (params.length < getMinimumParameters())) { return false; } final RPAction alter = new RPAction(); alter.put("type", STR); alter.put(STR, params[0]); alter.put("text", params[1]); ClientSingletonRepository.getClientFramework().send(alter); return true; }
/** * Alters an entity's attributes. * * @param params * The formal parameters. * @param remainder * Line content after parameters. * * @return <code>true</code> if was handled. */
Alters an entity's attributes
execute
{ "repo_name": "acsid/stendhal", "path": "src/games/stendhal/client/actions/AlterCreatureAction.java", "license": "gpl-2.0", "size": 2037 }
[ "games.stendhal.client.ClientSingletonRepository" ]
import games.stendhal.client.ClientSingletonRepository;
import games.stendhal.client.*;
[ "games.stendhal.client" ]
games.stendhal.client;
1,650,763
EList<PowerSystemResource> getPowerSystemResources();
EList<PowerSystemResource> getPowerSystemResources();
/** * Returns the value of the '<em><b>Power System Resources</b></em>' reference list. * The list contents are of type {@link CIM.IEC61970.Core.PowerSystemResource}. * It is bidirectional and its opposite is '{@link CIM.IEC61970.Core.PowerSystemResource#getAssets <em>Assets</em>}'. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Power System Resources</em>' reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Power System Resources</em>' reference list. * @see CIM.IEC61968.Assets.AssetsPackage#getAsset_PowerSystemResources() * @see CIM.IEC61970.Core.PowerSystemResource#getAssets * @model opposite="Assets" * annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='All power system resources used to electrically model this asset. For example, transformer asset is electrically modelled with a transformer and its windings and tap changer.'" * annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='All power system resources used to electrically model this asset. For example, transformer asset is electrically modelled with a transformer and its windings and tap changer.'" * @generated */
Returns the value of the 'Power System Resources' reference list. The list contents are of type <code>CIM.IEC61970.Core.PowerSystemResource</code>. It is bidirectional and its opposite is '<code>CIM.IEC61970.Core.PowerSystemResource#getAssets Assets</code>'. If the meaning of the 'Power System Resources' reference list isn't clear, there really should be more of a description here...
getPowerSystemResources
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/ModelJoin/src/main/java/CIM/IEC61968/Assets/Asset.java", "license": "mit", "size": 47966 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,846,448
@Override public void addHashes(Content content) throws TskCoreException { addHashes(content, null); }
void function(Content content) throws TskCoreException { addHashes(content, null); }
/** * Adds hashes of content (if calculated) to the hash database. * * @param content The content for which the calculated hashes, if any, * are to be added to the hash database. * * @throws TskCoreException */
Adds hashes of content (if calculated) to the hash database
addHashes
{ "repo_name": "eugene7646/autopsy", "path": "Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbManager.java", "license": "apache-2.0", "size": 72013 }
[ "org.sleuthkit.datamodel.Content", "org.sleuthkit.datamodel.TskCoreException" ]
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.*;
[ "org.sleuthkit.datamodel" ]
org.sleuthkit.datamodel;
627,083
public Object setProperty(String name, String value) { return put(name, value); } /** * Stores the mappings in this {@code Properties} object to {@code out}, * putting the specified comment at the beginning. The encoding is * ISO-8859-1. * * @param out * the {@code OutputStream}
Object function(String name, String value) { return put(name, value); } /** * Stores the mappings in this {@code Properties} object to {@code out}, * putting the specified comment at the beginning. The encoding is * ISO-8859-1. * * @param out * the {@code OutputStream}
/** * Maps the specified key to the specified value. If the key already exists, * the old value is replaced. The key and value cannot be {@code null}. * * @param name * the key. * @param value * the value. * @return the old value mapped to the key, or {@code null}. */
Maps the specified key to the specified value. If the key already exists, the old value is replaced. The key and value cannot be null
setProperty
{ "repo_name": "webos21/xi", "path": "java/jcl/src/java/java/util/Properties.java", "license": "apache-2.0", "size": 24387 }
[ "java.io.OutputStream" ]
import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,579,144
protected void initialize(ConfigurableEnvironment environment, ClassLoader classLoader) { new LoggingSystemProperties(environment).apply(); LogFile logFile = LogFile.get(environment); if (logFile != null) { logFile.applyToSystemProperties(); } initializeEarlyLoggingLevel(environment); initializeSystem(environment, this.loggingSystem, logFile); initializeFinalLoggingLevels(environment, this.loggingSystem); registerShutdownHookIfNecessary(environment, this.loggingSystem); }
void function(ConfigurableEnvironment environment, ClassLoader classLoader) { new LoggingSystemProperties(environment).apply(); LogFile logFile = LogFile.get(environment); if (logFile != null) { logFile.applyToSystemProperties(); } initializeEarlyLoggingLevel(environment); initializeSystem(environment, this.loggingSystem, logFile); initializeFinalLoggingLevels(environment, this.loggingSystem); registerShutdownHookIfNecessary(environment, this.loggingSystem); }
/** * Initialize the logging system according to preferences expressed through the * {@link Environment} and the classpath. * @param environment the environment * @param classLoader the classloader */
Initialize the logging system according to preferences expressed through the <code>Environment</code> and the classpath
initialize
{ "repo_name": "jbovet/spring-boot", "path": "spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java", "license": "apache-2.0", "size": 14369 }
[ "org.springframework.core.env.ConfigurableEnvironment" ]
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.*;
[ "org.springframework.core" ]
org.springframework.core;
2,303,103
protected void runInAllDataModes(TestRunnable call, DataMode... dataModes) throws Exception { if (F.isEmpty(dataModes)) dataModes = DataMode.values(); for (int i = 0; i < dataModes.length; i++) { dataMode = dataModes[i]; if (!isCompatible()) { info("Skipping test in data mode: " + dataMode); continue; } info("Running test in data mode: " + dataMode); if (i != 0) beforeTest(); try { call.run(); } catch (Throwable e) { e.printStackTrace(); throw e; } finally { if (i + 1 != DataMode.values().length) afterTest(); } } }
void function(TestRunnable call, DataMode... dataModes) throws Exception { if (F.isEmpty(dataModes)) dataModes = DataMode.values(); for (int i = 0; i < dataModes.length; i++) { dataMode = dataModes[i]; if (!isCompatible()) { info(STR + dataMode); continue; } info(STR + dataMode); if (i != 0) beforeTest(); try { call.run(); } catch (Throwable e) { e.printStackTrace(); throw e; } finally { if (i + 1 != DataMode.values().length) afterTest(); } } }
/** * Runs in all data modes. * * @throws Exception If failed. */
Runs in all data modes
runInAllDataModes
{ "repo_name": "irudyak/ignite", "path": "modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java", "license": "apache-2.0", "size": 18370 }
[ "org.apache.ignite.internal.util.typedef.F" ]
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.*;
[ "org.apache.ignite" ]
org.apache.ignite;
1,791,419
public static void updateExistingNodeData(ZooKeeperWatcher zkw, String znode, byte [] data, int expectedVersion) throws KeeperException { try { zkw.getRecoverableZooKeeper().setData(znode, data, expectedVersion); } catch(InterruptedException ie) { zkw.interruptedException(ie); } } // // Data setting //
static void function(ZooKeeperWatcher zkw, String znode, byte [] data, int expectedVersion) throws KeeperException { try { zkw.getRecoverableZooKeeper().setData(znode, data, expectedVersion); } catch(InterruptedException ie) { zkw.interruptedException(ie); } } //
/** * Update the data of an existing node with the expected version to have the * specified data. * * Throws an exception if there is a version mismatch or some other problem. * * Sets no watches under any conditions. * * @param zkw zk reference * @param znode * @param data * @param expectedVersion * @throws KeeperException if unexpected zookeeper exception * @throws KeeperException.BadVersionException if version mismatch */
Update the data of an existing node with the expected version to have the specified data. Throws an exception if there is a version mismatch or some other problem. Sets no watches under any conditions
updateExistingNodeData
{ "repo_name": "ay65535/hbase-0.94.0", "path": "src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java", "license": "apache-2.0", "size": 41402 }
[ "org.apache.zookeeper.KeeperException" ]
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.*;
[ "org.apache.zookeeper" ]
org.apache.zookeeper;
498,979
public void findAllKdContainers(int kindOfDistance, Operator operator) throws ProcessStoppedException { for (int i = 0; i < this.getNumberOfObjects(); i++) { if (operator != null) { operator.checkForStop(); } this.findKdistanceContainers(this.listOfObjects.elementAt(i), kindOfDistance); } }
void function(int kindOfDistance, Operator operator) throws ProcessStoppedException { for (int i = 0; i < this.getNumberOfObjects(); i++) { if (operator != null) { operator.checkForStop(); } this.findKdistanceContainers(this.listOfObjects.elementAt(i), kindOfDistance); } }
/** * Finds and fills all K distance containers for all objects in the Search Room by invoking the * process of finding all k distance containers for one Search Object. * * @param kindOfDistance * @param operator * if this is NOT <code>null</code>, will call {@link Operator#checkForStop()}. * @throws ProcessStoppedException * only if the the operator parameter was not <code>null</code> and a stop request * was issued */
Finds and fills all K distance containers for all objects in the Search Room by invoking the process of finding all k distance containers for one Search Object
findAllKdContainers
{ "repo_name": "boob-sbcm/3838438", "path": "src/main/java/com/rapidminer/operator/preprocessing/outlier/SearchSpace.java", "license": "agpl-3.0", "size": 43218 }
[ "com.rapidminer.operator.Operator", "com.rapidminer.operator.ProcessStoppedException" ]
import com.rapidminer.operator.Operator; import com.rapidminer.operator.ProcessStoppedException;
import com.rapidminer.operator.*;
[ "com.rapidminer.operator" ]
com.rapidminer.operator;
190,553
public Object ptihInvoke(ProxyTrustInvocationHandler ptih, Object proxy, Method method, Object[] args) throws Exception { if (ptih == null) { throw new NullPointerException( "ProxyTrustInvocationHandler specified is null."); } logger.fine("Call 'invoke(): Proxy" + ProxyTrustUtil.interfacesToString(proxy) + ", Method: " + method + ", Args: " + ProxyTrustUtil.arrayToString(args) + "'."); try { return ptih.invoke(proxy, method, args); } catch (Throwable t) { if (t instanceof Exception) { throw ((Exception) t); } else { throw new Error(t); } } }
Object function(ProxyTrustInvocationHandler ptih, Object proxy, Method method, Object[] args) throws Exception { if (ptih == null) { throw new NullPointerException( STR); } logger.fine(STR + ProxyTrustUtil.interfacesToString(proxy) + STR + method + STR + ProxyTrustUtil.arrayToString(args) + "'."); try { return ptih.invoke(proxy, method, args); } catch (Throwable t) { if (t instanceof Exception) { throw ((Exception) t); } else { throw new Error(t); } } }
/** * Print arguments specified and then call 'invoke' method of * ProxyTrustInvocationHandler specified. * * @param ptih ProxyTrustInvocationHandler * @param proxy the proxy object * @param method the method being invoked * @param args the arguments to the specified method * @return result of 'invoke' method call * @throws NullPointerException if ptih is null * @throws rethrow any exception thrown by invoke method */
Print arguments specified and then call 'invoke' method of ProxyTrustInvocationHandler specified
ptihInvoke
{ "repo_name": "pfirmstone/JGDMS", "path": "qa/src/org/apache/river/test/spec/security/proxytrust/util/AbstractTestBase.java", "license": "apache-2.0", "size": 26594 }
[ "java.lang.reflect.Method", "net.jini.security.proxytrust.ProxyTrustInvocationHandler" ]
import java.lang.reflect.Method; import net.jini.security.proxytrust.ProxyTrustInvocationHandler;
import java.lang.reflect.*; import net.jini.security.proxytrust.*;
[ "java.lang", "net.jini.security" ]
java.lang; net.jini.security;
579,137
private byte[] loadFileBuffer(File f) throws IOException { FileInputStream fin = null; try { fin = new FileInputStream(f); byte[] buffer = new byte[(int) f.length()]; int pos = 0; int remaining = buffer.length; int nr = fin.read(buffer, pos, remaining); while (nr > 0) { pos = pos + nr; remaining = remaining - nr; nr = fin.read(buffer, pos, remaining); } return buffer; } finally { try { fin.close(); } catch (Exception ex) { } } }
byte[] function(File f) throws IOException { FileInputStream fin = null; try { fin = new FileInputStream(f); byte[] buffer = new byte[(int) f.length()]; int pos = 0; int remaining = buffer.length; int nr = fin.read(buffer, pos, remaining); while (nr > 0) { pos = pos + nr; remaining = remaining - nr; nr = fin.read(buffer, pos, remaining); } return buffer; } finally { try { fin.close(); } catch (Exception ex) { } } }
/** * load a file into a byte[] * * @param f * @return * @throws IOException */
load a file into a byte[]
loadFileBuffer
{ "repo_name": "marktriggs/nyu-sakai-10.4", "path": "portal/portal-impl/impl/src/java/org/sakaiproject/portal/charon/handlers/StaticHandler.java", "license": "apache-2.0", "size": 7140 }
[ "java.io.File", "java.io.FileInputStream", "java.io.IOException" ]
import java.io.File; import java.io.FileInputStream; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,569,414
private static QueryPlanNode getQueryPlanNodeOfField(Path field,List<Conjunct> clauses) { for(Conjunct c:clauses) { QueryPlanNode fieldNode=c.getFieldNode(field); if(fieldNode!=null) return fieldNode; } return null; }
static QueryPlanNode function(Path field,List<Conjunct> clauses) { for(Conjunct c:clauses) { QueryPlanNode fieldNode=c.getFieldNode(field); if(fieldNode!=null) return fieldNode; } return null; }
/** * Returns the query plan node of the field. The query plan node is extracted from the clauses */
Returns the query plan node of the field. The query plan node is extracted from the clauses
getQueryPlanNodeOfField
{ "repo_name": "paterczm/lightblue-core", "path": "crud/src/main/java/com/redhat/lightblue/assoc/ResolvedFieldBinding.java", "license": "gpl-3.0", "size": 11534 }
[ "com.redhat.lightblue.util.Path", "java.util.List" ]
import com.redhat.lightblue.util.Path; import java.util.List;
import com.redhat.lightblue.util.*; import java.util.*;
[ "com.redhat.lightblue", "java.util" ]
com.redhat.lightblue; java.util;
907,912
public double yieldFromPrice(double price, LocalDate settlementDate) { double accrualFactor = dayCount.relativeYearFraction(settlementDate, notional.getDate()); return yieldConvention.yieldFromPrice(price, accrualFactor); }
double function(double price, LocalDate settlementDate) { double accrualFactor = dayCount.relativeYearFraction(settlementDate, notional.getDate()); return yieldConvention.yieldFromPrice(price, accrualFactor); }
/** * Computes the yield from the price at a given settlement date. * * @param price the price * @param settlementDate the settlement date * @return the yield */
Computes the yield from the price at a given settlement date
yieldFromPrice
{ "repo_name": "OpenGamma/Strata", "path": "modules/product/src/main/java/com/opengamma/strata/product/bond/ResolvedBill.java", "license": "apache-2.0", "size": 22213 }
[ "java.time.LocalDate" ]
import java.time.LocalDate;
import java.time.*;
[ "java.time" ]
java.time;
375,369
private Bitmap decodeBitmap(Uri uri, int width, int height) { Log.i(TAG, "width = " + width + " , " + "height = " + height); InputStream is = null; Bitmap bitmap = null; try { // TODO: Take max pixels allowed into account for calculation to avoid possible OOM. Rect bounds = getBitmapBounds(uri); int sampleSize = Math.max(bounds.width() / width, bounds.height() / height); sampleSize = Math.min(sampleSize, Math.max(bounds.width() / height, bounds.height() / width)); BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = Math.max(sampleSize, 1); options.inPreferredConfig = Bitmap.Config.ARGB_8888; is = context.getContentResolver().openInputStream(uri); Log.i(TAG, "sampleSize = " + sampleSize + " , " + "options.inSampleSize = " + options.inSampleSize); bitmap = BitmapFactory.decodeStream(is, null, options);//!!!!溢出 } catch (Exception e) { } finally { closeStream(is); } // Ensure bitmap in 8888 format, good for editing as well as GL compatible. if ((bitmap != null) && (bitmap.getConfig() != Bitmap.Config.ARGB_8888)) { Bitmap copy = bitmap.copy(Bitmap.Config.ARGB_8888, true); bitmap.recycle(); bitmap = copy; } if (bitmap != null) { // Scale down the sampled bitmap if it's still larger than the desired dimension. float scale = Math.min((float) width / bitmap.getWidth(), (float) height / bitmap.getHeight()); scale = Math.max(scale, Math.min((float) height / bitmap.getWidth(), (float) width / bitmap.getHeight())); if (scale < 1) { Matrix m = new Matrix(); m.setScale(scale, scale); Bitmap transformed = createBitmap( bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), m); bitmap.recycle(); return transformed; } } return bitmap; }
Bitmap function(Uri uri, int width, int height) { Log.i(TAG, STR + width + STR + STR + height); InputStream is = null; Bitmap bitmap = null; try { Rect bounds = getBitmapBounds(uri); int sampleSize = Math.max(bounds.width() / width, bounds.height() / height); sampleSize = Math.min(sampleSize, Math.max(bounds.width() / height, bounds.height() / width)); BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = Math.max(sampleSize, 1); options.inPreferredConfig = Bitmap.Config.ARGB_8888; is = context.getContentResolver().openInputStream(uri); Log.i(TAG, STR + sampleSize + STR + STR + options.inSampleSize); bitmap = BitmapFactory.decodeStream(is, null, options); } catch (Exception e) { } finally { closeStream(is); } if ((bitmap != null) && (bitmap.getConfig() != Bitmap.Config.ARGB_8888)) { Bitmap copy = bitmap.copy(Bitmap.Config.ARGB_8888, true); bitmap.recycle(); bitmap = copy; } if (bitmap != null) { float scale = Math.min((float) width / bitmap.getWidth(), (float) height / bitmap.getHeight()); scale = Math.max(scale, Math.min((float) height / bitmap.getWidth(), (float) width / bitmap.getHeight())); if (scale < 1) { Matrix m = new Matrix(); m.setScale(scale, scale); Bitmap transformed = createBitmap( bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), m); bitmap.recycle(); return transformed; } } return bitmap; }
/** * Decodes bitmap (maybe immutable) that keeps aspect-ratio and spans most within the bounds. */
Decodes bitmap (maybe immutable) that keeps aspect-ratio and spans most within the bounds
decodeBitmap
{ "repo_name": "januslo/react-native-sunmi-inner-printer", "path": "android/src/main/java/com/sunmi/innerprinter/BitmapUtils.java", "license": "mit", "size": 17812 }
[ "android.graphics.Bitmap", "android.graphics.BitmapFactory", "android.graphics.Matrix", "android.graphics.Rect", "android.net.Uri", "android.util.Log", "java.io.InputStream" ]
import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.graphics.Rect; import android.net.Uri; import android.util.Log; import java.io.InputStream;
import android.graphics.*; import android.net.*; import android.util.*; import java.io.*;
[ "android.graphics", "android.net", "android.util", "java.io" ]
android.graphics; android.net; android.util; java.io;
717,361
public void setInil(boolean value) { this.inil = value; } } @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class BTitle { @XmlAttribute(name = "inil", required = true) protected boolean inil;
void function(boolean value) { this.inil = value; } } @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = STRinil", required = true) protected boolean inil;
/** * Sets the value of the inil property. * */
Sets the value of the inil property
setInil
{ "repo_name": "NNemanjaMM/TAS", "path": "Converter-Solution/src/main/java/com/eds/Converter_Solution/model/input/ThreatModel.java", "license": "mit", "size": 314978 }
[ "javax.xml.bind.annotation.XmlAccessType", "javax.xml.bind.annotation.XmlAccessorType", "javax.xml.bind.annotation.XmlType" ]
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.*;
[ "javax.xml" ]
javax.xml;
574,978
broker = new StateBroker(); }
broker = new StateBroker(); }
/** * Initializes the shared StateBroker. */
Initializes the shared StateBroker
before
{ "repo_name": "gorindn/ice", "path": "tests/org.eclipse.ice.client.widgets.reactoreditor.test/src/org/eclipse/ice/client/widgets/reactoreditor/test/StateBrokerTester.java", "license": "epl-1.0", "size": 14101 }
[ "org.eclipse.ice.client.widgets.reactoreditor.StateBroker" ]
import org.eclipse.ice.client.widgets.reactoreditor.StateBroker;
import org.eclipse.ice.client.widgets.reactoreditor.*;
[ "org.eclipse.ice" ]
org.eclipse.ice;
2,121,698
protected boolean checkIfAnyMoveIsPossible(IPlayer currentPlayer, IDices dices) { SE.info("game.check_for_possible_move"); // use clones, so the originals will not be changed IBoard testBoard = board.clone(); IDices testDices = dices.clone(); IPositions checkPositions; IPosition checkPosition = getMandatoryPosition(currentPlayer, testBoard); if(checkPosition == null) { checkPositions = testBoard.createPlayerView(currentPlayer); } else { checkPositions = new Positions().add(checkPosition); } IPositions playerPositions = testBoard.createPlayerView(currentPlayer); for(IPosition pos : checkPositions.get()) { if((pos.hasCheckers() == false) || (pos.readTopChecker().getOwner().equals(currentPlayer.getID()) == false)) { continue; // minimum condition not satisfied } for(IDice dice : testDices.get()) { int currentPos = pos.getIndexIn(playerPositions); SE.trace("game.test_move", currentPos, dice); if(moveChecker(currentPlayer, testBoard, currentPos, dice).isSuccess()) { return true; } } } dices.get().forEach(dice -> dice.setStatus(IDice.Status.BLOCKED)); SE.info("game.no_moves", dices.toString()); return false; } /** * The {@link IPlayer} may not be able to use all {@link IDices} to move his {@link IChecker}
boolean function(IPlayer currentPlayer, IDices dices) { SE.info(STR); IBoard testBoard = board.clone(); IDices testDices = dices.clone(); IPositions checkPositions; IPosition checkPosition = getMandatoryPosition(currentPlayer, testBoard); if(checkPosition == null) { checkPositions = testBoard.createPlayerView(currentPlayer); } else { checkPositions = new Positions().add(checkPosition); } IPositions playerPositions = testBoard.createPlayerView(currentPlayer); for(IPosition pos : checkPositions.get()) { if((pos.hasCheckers() == false) (pos.readTopChecker().getOwner().equals(currentPlayer.getID()) == false)) { continue; } for(IDice dice : testDices.get()) { int currentPos = pos.getIndexIn(playerPositions); SE.trace(STR, currentPos, dice); if(moveChecker(currentPlayer, testBoard, currentPos, dice).isSuccess()) { return true; } } } dices.get().forEach(dice -> dice.setStatus(IDice.Status.BLOCKED)); SE.info(STR, dices.toString()); return false; } /** * The {@link IPlayer} may not be able to use all {@link IDices} to move his {@link IChecker}
/** * Check if the {@link IPlayer} can make any move with any {@link IDice}. * * @param currentPlayer the {@link IPlayer} whose {@link IChecker} will be analyzed. * @param dices the {@link IDices} to evaluate. * @return {@code true} if the {@link IPlayer} can use a {@link IDice} to move a {@link IChecker}. */
Check if the <code>IPlayer</code> can make any move with any <code>IDice</code>
checkIfAnyMoveIsPossible
{ "repo_name": "apatrikis/imn-backgammon-engine-impl", "path": "src/main/java/net/ichmags/backgammon/game/impl/Game.java", "license": "mit", "size": 32465 }
[ "net.ichmags.backgammon.setup.IBoard", "net.ichmags.backgammon.setup.IChecker", "net.ichmags.backgammon.setup.IDice", "net.ichmags.backgammon.setup.IDices", "net.ichmags.backgammon.setup.IPlayer", "net.ichmags.backgammon.setup.IPosition", "net.ichmags.backgammon.setup.IPositions", "net.ichmags.backgammon.setup.impl.Positions" ]
import net.ichmags.backgammon.setup.IBoard; import net.ichmags.backgammon.setup.IChecker; import net.ichmags.backgammon.setup.IDice; import net.ichmags.backgammon.setup.IDices; import net.ichmags.backgammon.setup.IPlayer; import net.ichmags.backgammon.setup.IPosition; import net.ichmags.backgammon.setup.IPositions; import net.ichmags.backgammon.setup.impl.Positions;
import net.ichmags.backgammon.setup.*; import net.ichmags.backgammon.setup.impl.*;
[ "net.ichmags.backgammon" ]
net.ichmags.backgammon;
1,029,566
public void setFormat( final NumberFormat format ) { this.format = format; }
void function( final NumberFormat format ) { this.format = format; }
/** * Defines the number format used for all generated text elements. The number format is shared among all generated * elements. * * @param format * the number format used in this factory. */
Defines the number format used for all generated text elements. The number format is shared among all generated elements
setFormat
{ "repo_name": "mbatchelor/pentaho-reporting", "path": "engine/core/src/main/java/org/pentaho/reporting/engine/classic/core/elementfactory/NumberFieldElementFactory.java", "license": "lgpl-2.1", "size": 15173 }
[ "java.text.NumberFormat" ]
import java.text.NumberFormat;
import java.text.*;
[ "java.text" ]
java.text;
1,706,500
private List<JavaScriptFile> determineUsedFiles( Map<String, JavaScriptFile> files) throws ConQATException { Set<String> requiredNamespaces = new HashSet<String>(); Set<String> providedNamespaces = new HashSet<String>(); List<JavaScriptFile> usedFiles = new ArrayList<JavaScriptFile>(); for (JavaScriptFile file : new ArrayList<JavaScriptFile>(files.values())) { if (file.getType() == EType.CODE_REQUIRED) { updateFilesAndNamespaces(file, files, requiredNamespaces, providedNamespaces, usedFiles); } } requiredNamespaces.removeAll(providedNamespaces); while (!requiredNamespaces.isEmpty()) { boolean hadProgress = false; for (JavaScriptFile file : new ArrayList<JavaScriptFile>( files.values())) { if (providesRequirement(file, requiredNamespaces)) { hadProgress = true; updateFilesAndNamespaces(file, files, requiredNamespaces, providedNamespaces, usedFiles); } } requiredNamespaces.removeAll(providedNamespaces); if (!hadProgress) { throw new ConQATException("Could not locate " + requiredNamespaces.size() + " namespaces: " + StringUtils.concat(requiredNamespaces, ", ")); } } return usedFiles; }
List<JavaScriptFile> function( Map<String, JavaScriptFile> files) throws ConQATException { Set<String> requiredNamespaces = new HashSet<String>(); Set<String> providedNamespaces = new HashSet<String>(); List<JavaScriptFile> usedFiles = new ArrayList<JavaScriptFile>(); for (JavaScriptFile file : new ArrayList<JavaScriptFile>(files.values())) { if (file.getType() == EType.CODE_REQUIRED) { updateFilesAndNamespaces(file, files, requiredNamespaces, providedNamespaces, usedFiles); } } requiredNamespaces.removeAll(providedNamespaces); while (!requiredNamespaces.isEmpty()) { boolean hadProgress = false; for (JavaScriptFile file : new ArrayList<JavaScriptFile>( files.values())) { if (providesRequirement(file, requiredNamespaces)) { hadProgress = true; updateFilesAndNamespaces(file, files, requiredNamespaces, providedNamespaces, usedFiles); } } requiredNamespaces.removeAll(providedNamespaces); if (!hadProgress) { throw new ConQATException(STR + requiredNamespaces.size() + STR + StringUtils.concat(requiredNamespaces, STR)); } } return usedFiles; }
/** * Determines the file to be actually used for the compiled script. These * include all files of type {@link JavaScriptFile.EType#CODE_REQUIRED} plus * all trasitive dependencies determined via required/provided namespaces. */
Determines the file to be actually used for the compiled script. These include all files of type <code>JavaScriptFile.EType#CODE_REQUIRED</code> plus all trasitive dependencies determined via required/provided namespaces
determineUsedFiles
{ "repo_name": "vimaier/conqat", "path": "org.conqat.engine.html_presentation/src/org/conqat/engine/html_presentation/javascript/JavaScriptManager.java", "license": "apache-2.0", "size": 18543 }
[ "java.util.ArrayList", "java.util.HashSet", "java.util.List", "java.util.Map", "java.util.Set", "org.conqat.engine.core.core.ConQATException", "org.conqat.engine.html_presentation.javascript.JavaScriptFile", "org.conqat.lib.commons.string.StringUtils" ]
import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.conqat.engine.core.core.ConQATException; import org.conqat.engine.html_presentation.javascript.JavaScriptFile; import org.conqat.lib.commons.string.StringUtils;
import java.util.*; import org.conqat.engine.core.core.*; import org.conqat.engine.html_presentation.javascript.*; import org.conqat.lib.commons.string.*;
[ "java.util", "org.conqat.engine", "org.conqat.lib" ]
java.util; org.conqat.engine; org.conqat.lib;
1,196,285
public static <T> T get(Future<? extends T> future) { try { return future.get(); } catch (ExecutionException | InterruptedException ex) { throw new RuntimeException(ex); } }
static <T> T function(Future<? extends T> future) { try { return future.get(); } catch (ExecutionException InterruptedException ex) { throw new RuntimeException(ex); } }
/** * Retrieve the result of the future and convert any exception * to runtime exception. * @param <T> the value type * @param future the future for the computation * @return the value */
Retrieve the result of the future and convert any exception to runtime exception
get
{ "repo_name": "akarnokd/open-ig", "path": "src/hu/openig/screen/CommonResources.java", "license": "lgpl-3.0", "size": 46061 }
[ "java.util.concurrent.ExecutionException", "java.util.concurrent.Future" ]
import java.util.concurrent.ExecutionException; import java.util.concurrent.Future;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
727,235
public int readI32() throws TException { return zigzagToInt(readVarint32()); }
int function() throws TException { return zigzagToInt(readVarint32()); }
/** * Read an i32 from the wire as a zigzag varint. */
Read an i32 from the wire as a zigzag varint
readI32
{ "repo_name": "SergeyMakarenko/fbthrift", "path": "thrift/lib/java/thrift/src/main/java/com/facebook/thrift/protocol/TCompactProtocol.java", "license": "apache-2.0", "size": 25925 }
[ "com.facebook.thrift.TException" ]
import com.facebook.thrift.TException;
import com.facebook.thrift.*;
[ "com.facebook.thrift" ]
com.facebook.thrift;
2,811,438
public void setRelationSet(Set<WiktionaryRelation> newRelations) throws LexicalResourceException { if (newRelations == null) throw new LexicalResourceException("Got null relation set"); if (newRelations.isEmpty()) throw new LexicalResourceException("The relations set cannot be empty"); this.relations = new HashSet<WiktionaryRelation>(newRelations); }
void function(Set<WiktionaryRelation> newRelations) throws LexicalResourceException { if (newRelations == null) throw new LexicalResourceException(STR); if (newRelations.isEmpty()) throw new LexicalResourceException(STR); this.relations = new HashSet<WiktionaryRelation>(newRelations); }
/** * set the new set of relations, to be used in all queries that don't specify it explicitly * @param newRelations the new set of relations, to be used in all queries that don't specify it explicitly * @throws LexicalResourceException */
set the new set of relations, to be used in all queries that don't specify it explicitly
setRelationSet
{ "repo_name": "madhumita-git/Excitement-Open-Platform", "path": "core/src/main/java/eu/excitementproject/eop/core/component/lexicalknowledge/wiktionary/WiktionaryLexicalResource.java", "license": "gpl-3.0", "size": 14625 }
[ "eu.excitementproject.eop.common.component.lexicalknowledge.LexicalResourceException", "eu.excitementproject.eop.core.utilities.dictionary.wiktionary.WiktionaryRelation", "java.util.HashSet", "java.util.Set" ]
import eu.excitementproject.eop.common.component.lexicalknowledge.LexicalResourceException; import eu.excitementproject.eop.core.utilities.dictionary.wiktionary.WiktionaryRelation; import java.util.HashSet; import java.util.Set;
import eu.excitementproject.eop.common.component.lexicalknowledge.*; import eu.excitementproject.eop.core.utilities.dictionary.wiktionary.*; import java.util.*;
[ "eu.excitementproject.eop", "java.util" ]
eu.excitementproject.eop; java.util;
1,401,598
@Override public boolean equals(Object object) { if (object == this ) { return true; } if (object instanceof AbstractStorelessUnivariateStatistic == false) { return false; } AbstractStorelessUnivariateStatistic stat = (AbstractStorelessUnivariateStatistic) object; return MathUtils.equalsIncludingNaN(stat.getResult(), this.getResult()) && MathUtils.equalsIncludingNaN(stat.getN(), this.getN()); }
boolean function(Object object) { if (object == this ) { return true; } if (object instanceof AbstractStorelessUnivariateStatistic == false) { return false; } AbstractStorelessUnivariateStatistic stat = (AbstractStorelessUnivariateStatistic) object; return MathUtils.equalsIncludingNaN(stat.getResult(), this.getResult()) && MathUtils.equalsIncludingNaN(stat.getN(), this.getN()); }
/** * Returns true iff <code>object</code> is an * <code>AbstractStorelessUnivariateStatistic</code> returning the same * values as this for <code>getResult()</code> and <code>getN()</code> * @param object object to test equality against. * @return true if object returns the same value as this */
Returns true iff <code>object</code> is an <code>AbstractStorelessUnivariateStatistic</code> returning the same values as this for <code>getResult()</code> and <code>getN()</code>
equals
{ "repo_name": "haisamido/SFDaaS", "path": "src/org/apache/commons/math/stat/descriptive/AbstractStorelessUnivariateStatistic.java", "license": "lgpl-3.0", "size": 6942 }
[ "org.apache.commons.math.util.MathUtils" ]
import org.apache.commons.math.util.MathUtils;
import org.apache.commons.math.util.*;
[ "org.apache.commons" ]
org.apache.commons;
867,105
public ExecutorType getExecutorServiceType(final EventHandler.EventType type) { switch(type) { // Master executor services case RS_ZK_REGION_CLOSED: return ExecutorType.MASTER_CLOSE_REGION; case RS_ZK_REGION_OPENED: return ExecutorType.MASTER_OPEN_REGION; case M_SERVER_SHUTDOWN: return ExecutorType.MASTER_SERVER_OPERATIONS; case M_META_SERVER_SHUTDOWN: return ExecutorType.MASTER_META_SERVER_OPERATIONS; case C_M_DELETE_TABLE: case C_M_DISABLE_TABLE: case C_M_ENABLE_TABLE: case C_M_MODIFY_TABLE: return ExecutorType.MASTER_TABLE_OPERATIONS; // RegionServer executor services case M_RS_OPEN_REGION: return ExecutorType.RS_OPEN_REGION; case M_RS_OPEN_ROOT: return ExecutorType.RS_OPEN_ROOT; case M_RS_OPEN_META: return ExecutorType.RS_OPEN_META; case M_RS_CLOSE_REGION: return ExecutorType.RS_CLOSE_REGION; case M_RS_CLOSE_ROOT: return ExecutorType.RS_CLOSE_ROOT; case M_RS_CLOSE_META: return ExecutorType.RS_CLOSE_META; default: throw new RuntimeException("Unhandled event type " + type); } } public ExecutorService(final String servername) { super(); this.servername = servername; }
ExecutorType function(final EventHandler.EventType type) { switch(type) { case RS_ZK_REGION_CLOSED: return ExecutorType.MASTER_CLOSE_REGION; case RS_ZK_REGION_OPENED: return ExecutorType.MASTER_OPEN_REGION; case M_SERVER_SHUTDOWN: return ExecutorType.MASTER_SERVER_OPERATIONS; case M_META_SERVER_SHUTDOWN: return ExecutorType.MASTER_META_SERVER_OPERATIONS; case C_M_DELETE_TABLE: case C_M_DISABLE_TABLE: case C_M_ENABLE_TABLE: case C_M_MODIFY_TABLE: return ExecutorType.MASTER_TABLE_OPERATIONS; case M_RS_OPEN_REGION: return ExecutorType.RS_OPEN_REGION; case M_RS_OPEN_ROOT: return ExecutorType.RS_OPEN_ROOT; case M_RS_OPEN_META: return ExecutorType.RS_OPEN_META; case M_RS_CLOSE_REGION: return ExecutorType.RS_CLOSE_REGION; case M_RS_CLOSE_ROOT: return ExecutorType.RS_CLOSE_ROOT; case M_RS_CLOSE_META: return ExecutorType.RS_CLOSE_META; default: throw new RuntimeException(STR + type); } } public ExecutorService(final String servername) { super(); this.servername = servername; }
/** * Returns the executor service type (the thread pool instance) for the * passed event handler type. * @param type EventHandler type. */
Returns the executor service type (the thread pool instance) for the passed event handler type
getExecutorServiceType
{ "repo_name": "NotBadPad/hadoop-hbase", "path": "src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java", "license": "apache-2.0", "size": 10075 }
[ "org.apache.hadoop.hbase.executor.EventHandler" ]
import org.apache.hadoop.hbase.executor.EventHandler;
import org.apache.hadoop.hbase.executor.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,015,263
@Generated @Selector("contentInset") @ByValue public native UIEdgeInsets contentInset();
@Selector(STR) native UIEdgeInsets function();
/** * The Sticker Browser View content inset. */
The Sticker Browser View content inset
contentInset
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/messages/MSStickerBrowserView.java", "license": "apache-2.0", "size": 20820 }
[ "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;
2,203,339
try { if (MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) { return endpointAdmin.addEndpoint(endpointData); } else { return endpointAdmin.addEndpointForTenant(endpointData, tenantDomain); } } catch (Exception e) { log.error("Error adding endpoint file to the gateway", e); throw new AxisFault("Error while adding the endpoint file" + e.getMessage(), e); } }
try { if (MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) { return endpointAdmin.addEndpoint(endpointData); } else { return endpointAdmin.addEndpointForTenant(endpointData, tenantDomain); } } catch (Exception e) { log.error(STR, e); throw new AxisFault(STR + e.getMessage(), e); } }
/** * Add endpoint to the gateway * * @param endpointData Content of the endpoint file * @return True if the endpoint file is added * @throws AxisFault Thrown if an error occurred */
Add endpoint to the gateway
addEndpoint
{ "repo_name": "jaadds/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/utils/EndpointAdminServiceProxy.java", "license": "apache-2.0", "size": 6572 }
[ "org.apache.axis2.AxisFault", "org.wso2.carbon.utils.multitenancy.MultitenantConstants" ]
import org.apache.axis2.AxisFault; import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import org.apache.axis2.*; import org.wso2.carbon.utils.multitenancy.*;
[ "org.apache.axis2", "org.wso2.carbon" ]
org.apache.axis2; org.wso2.carbon;
923,904
static int epollWait(FileDescriptor epollFd, EpollEventArray events, int timeoutMillis) throws IOException { int ready = epollWait(epollFd.intValue(), events.memoryAddress(), events.length(), timeoutMillis); if (ready < 0) { throw newIOException("epoll_wait", ready); } return ready; } /** * Non-blocking variant of * {@link #epollWait(FileDescriptor, EpollEventArray, FileDescriptor, int, int)}
static int epollWait(FileDescriptor epollFd, EpollEventArray events, int timeoutMillis) throws IOException { int ready = epollWait(epollFd.intValue(), events.memoryAddress(), events.length(), timeoutMillis); if (ready < 0) { throw newIOException(STR, ready); } return ready; } /** * Non-blocking variant of * {@link #epollWait(FileDescriptor, EpollEventArray, FileDescriptor, int, int)}
/** * This uses epoll's own timeout and does not reset/re-arm any timerfd */
This uses epoll's own timeout and does not reset/re-arm any timerfd
epollWait
{ "repo_name": "artgon/netty", "path": "transport-native-epoll/src/main/java/io/netty/channel/epoll/Native.java", "license": "apache-2.0", "size": 10880 }
[ "io.netty.channel.unix.Errors", "io.netty.channel.unix.FileDescriptor", "java.io.IOException" ]
import io.netty.channel.unix.Errors; import io.netty.channel.unix.FileDescriptor; import java.io.IOException;
import io.netty.channel.unix.*; import java.io.*;
[ "io.netty.channel", "java.io" ]
io.netty.channel; java.io;
38,665
@Override public CharSequence convertToString(Cursor cursor) { if (cursor == null) { return null; } String query = getColumnString(cursor, SearchManager.SUGGEST_COLUMN_QUERY); if (query != null) { return query; } return null; }
CharSequence function(Cursor cursor) { if (cursor == null) { return null; } String query = getColumnString(cursor, SearchManager.SUGGEST_COLUMN_QUERY); if (query != null) { return query; } return null; }
/** * Gets the text to show in the query field when a suggestion is selected. * * @param cursor The Cursor to read the suggestion data from. The Cursor should already * be moved to the suggestion that is to be read from. * @return The text to show, or <code>null</code> if the query should not be * changed when selecting this suggestion. */
Gets the text to show in the query field when a suggestion is selected
convertToString
{ "repo_name": "rde8026/TwitterClient", "path": "libraries/actionbarsherlock/src/com/actionbarsherlock/widget/SuggestionsAdapter.java", "license": "apache-2.0", "size": 28508 }
[ "android.app.SearchManager", "android.database.Cursor" ]
import android.app.SearchManager; import android.database.Cursor;
import android.app.*; import android.database.*;
[ "android.app", "android.database" ]
android.app; android.database;
380,112
@RequestMapping("/aggregate-non-blocking-lambda") public DeferredResult<String> nonBlockingAggregator( @RequestParam(value = "dbLookupMs", required = false, defaultValue = "0") int dbLookupMs, @RequestParam(value = "dbHits", required = false, defaultValue = "3") int dbHits, @RequestParam(value = "minMs", required = false, defaultValue = "0") int minMs, @RequestParam(value = "maxMs", required = false, defaultValue = "0") int maxMs) throws IOException { // Delegate the whole processing to a executor-instance to avoid concurrency problems with other concurrent requests Executor exec = new Executor(LOG, SP_NON_BLOCKING_URL, TIMEOUT_MS, dbThreadPoolExecutor, dbLookupMs, dbHits, minMs, maxMs); DeferredResult<String> deferredResult = exec.startNonBlockingExecution(); // Return to let go of the precious thread we are holding on to... return deferredResult; }
@RequestMapping(STR) DeferredResult<String> function( @RequestParam(value = STR, required = false, defaultValue = "0") int dbLookupMs, @RequestParam(value = STR, required = false, defaultValue = "3") int dbHits, @RequestParam(value = "minMs", required = false, defaultValue = "0") int minMs, @RequestParam(value = "maxMs", required = false, defaultValue = "0") int maxMs) throws IOException { Executor exec = new Executor(LOG, SP_NON_BLOCKING_URL, TIMEOUT_MS, dbThreadPoolExecutor, dbLookupMs, dbHits, minMs, maxMs); DeferredResult<String> deferredResult = exec.startNonBlockingExecution(); return deferredResult; }
/** * Sample usage: curl "http://localhost:9080/aggregate-non-blocking-lambda?minMs=1000&maxMs=2000" * * @param dbLookupMs * @param dbHits * @param minMs * @param maxMs * @return * @throws java.io.IOException */
Sample usage: curl "HREF"
nonBlockingAggregator
{ "repo_name": "callistaenterprise/blog-non-blocking-rest-service-with-spring-mvc", "path": "spring-mvc-asynch/src/main/java/se/callista/springmvc/asynch/pattern/aggregator/nonblocking/lambda/AggregatorNonBlockingLambdaController.java", "license": "apache-2.0", "size": 2562 }
[ "java.io.IOException", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestParam", "org.springframework.web.context.request.async.DeferredResult" ]
import java.io.IOException; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.context.request.async.DeferredResult;
import java.io.*; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.async.*;
[ "java.io", "org.springframework.web" ]
java.io; org.springframework.web;
1,072,957
private void attemptLogin() { if (mAuthTask != null) { return; } // Reset errors. mEmailView.setError(null); mPasswordView.setError(null); // Store values at the time of the login attempt. String email = mEmailView.getText().toString(); String password = mPasswordView.getText().toString(); boolean cancel = false; View focusView = null; // Check for a valid password, if the user entered one. if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) { mPasswordView.setError(getString(R.string.error_invalid_password)); focusView = mPasswordView; cancel = true; } // Check for a valid email address. if (TextUtils.isEmpty(email)) { mEmailView.setError(getString(R.string.error_field_required)); focusView = mEmailView; cancel = true; } else if (!isEmailValid(email)) { mEmailView.setError(getString(R.string.error_invalid_email)); focusView = mEmailView; cancel = true; } if (cancel) { // There was an error; don't attempt login and focus the first // form field with an error. focusView.requestFocus(); } else { // Show a progress spinner, and kick off a background task to // perform the user login attempt. showProgress(true); mAuthTask = new UserLoginTask(email, password); mAuthTask.execute((Void) null); Intent userEmail = new Intent(); userEmail.putExtra("EMAIL", email); setResult(RESULT_OK, userEmail); finish(); } }
void function() { if (mAuthTask != null) { return; } mEmailView.setError(null); mPasswordView.setError(null); String email = mEmailView.getText().toString(); String password = mPasswordView.getText().toString(); boolean cancel = false; View focusView = null; if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) { mPasswordView.setError(getString(R.string.error_invalid_password)); focusView = mPasswordView; cancel = true; } if (TextUtils.isEmpty(email)) { mEmailView.setError(getString(R.string.error_field_required)); focusView = mEmailView; cancel = true; } else if (!isEmailValid(email)) { mEmailView.setError(getString(R.string.error_invalid_email)); focusView = mEmailView; cancel = true; } if (cancel) { focusView.requestFocus(); } else { showProgress(true); mAuthTask = new UserLoginTask(email, password); mAuthTask.execute((Void) null); Intent userEmail = new Intent(); userEmail.putExtra("EMAIL", email); setResult(RESULT_OK, userEmail); finish(); } }
/** * Attempts to sign in or register the account specified by the login form. * If there are form errors (invalid email, missing fields, etc.), the * errors are presented and no actual login attempt is made. */
Attempts to sign in or register the account specified by the login form. If there are form errors (invalid email, missing fields, etc.), the errors are presented and no actual login attempt is made
attemptLogin
{ "repo_name": "alki22/RedditReader-alki22", "path": "app/src/main/java/famaf/unc/edu/ar/activitiesassignment/LoginActivity.java", "license": "apache-2.0", "size": 8033 }
[ "android.content.Intent", "android.text.TextUtils", "android.view.View" ]
import android.content.Intent; import android.text.TextUtils; import android.view.View;
import android.content.*; import android.text.*; import android.view.*;
[ "android.content", "android.text", "android.view" ]
android.content; android.text; android.view;
1,465,755
public GridRegistry getRegistry() { return registry; } public Hub(GridHubConfiguration gridHubConfiguration) { config = gridHubConfiguration; try { registry = (GridRegistry) Class.forName(config.registry).newInstance(); registry.setHub(this); } catch (Throwable e) { throw new GridConfigurationException("Error creating class with " + config.registry + " : " + e.getMessage(), e); } if (config.host == null) { NetworkUtils utils = new NetworkUtils(); config.host = utils.getIp4NonLoopbackAddressOfThisMachine().getHostAddress(); } if (config.port == null) { config.port = 4444; } if (config.servlets != null) { for (String s : config.servlets) { Class<? extends Servlet> servletClass = ExtraServletUtil.createServlet(s); if (servletClass != null) { String path = "/grid/admin/" + servletClass.getSimpleName() + "/*"; log.info("binding " + servletClass.getCanonicalName() + " to " + path); addServlet(path, servletClass); } } } // start the registry, now that 'config' is all setup registry.start(); new JMXHelper().register(this); }
GridRegistry function() { return registry; } public Hub(GridHubConfiguration gridHubConfiguration) { config = gridHubConfiguration; try { registry = (GridRegistry) Class.forName(config.registry).newInstance(); registry.setHub(this); } catch (Throwable e) { throw new GridConfigurationException(STR + config.registry + STR + e.getMessage(), e); } if (config.host == null) { NetworkUtils utils = new NetworkUtils(); config.host = utils.getIp4NonLoopbackAddressOfThisMachine().getHostAddress(); } if (config.port == null) { config.port = 4444; } if (config.servlets != null) { for (String s : config.servlets) { Class<? extends Servlet> servletClass = ExtraServletUtil.createServlet(s); if (servletClass != null) { String path = STR + servletClass.getSimpleName() + "/*"; log.info(STR + servletClass.getCanonicalName() + STR + path); addServlet(path, servletClass); } } } registry.start(); new JMXHelper().register(this); }
/** * get the registry backing up the hub state. * * @return The registry */
get the registry backing up the hub state
getRegistry
{ "repo_name": "juangj/selenium", "path": "java/server/src/org/openqa/grid/web/Hub.java", "license": "apache-2.0", "size": 8694 }
[ "javax.servlet.Servlet", "org.openqa.grid.common.exception.GridConfigurationException", "org.openqa.grid.internal.GridRegistry", "org.openqa.grid.internal.utils.configuration.GridHubConfiguration", "org.openqa.grid.web.utils.ExtraServletUtil", "org.openqa.selenium.net.NetworkUtils", "org.openqa.selenium.remote.server.jmx.JMXHelper" ]
import javax.servlet.Servlet; import org.openqa.grid.common.exception.GridConfigurationException; import org.openqa.grid.internal.GridRegistry; import org.openqa.grid.internal.utils.configuration.GridHubConfiguration; import org.openqa.grid.web.utils.ExtraServletUtil; import org.openqa.selenium.net.NetworkUtils; import org.openqa.selenium.remote.server.jmx.JMXHelper;
import javax.servlet.*; import org.openqa.grid.common.exception.*; import org.openqa.grid.internal.*; import org.openqa.grid.internal.utils.configuration.*; import org.openqa.grid.web.utils.*; import org.openqa.selenium.net.*; import org.openqa.selenium.remote.server.jmx.*;
[ "javax.servlet", "org.openqa.grid", "org.openqa.selenium" ]
javax.servlet; org.openqa.grid; org.openqa.selenium;
2,241,169
public static String appendQueryParams(HttpServletRequest request, String targetUri) { String ret = targetUri; String urlEncodedQueryString = getURLEncodedQueryString(request); if (urlEncodedQueryString != null) { ret += "?" + urlEncodedQueryString; } return ret; }
static String function(HttpServletRequest request, String targetUri) { String ret = targetUri; String urlEncodedQueryString = getURLEncodedQueryString(request); if (urlEncodedQueryString != null) { ret += "?" + urlEncodedQueryString; } return ret; }
/** * Add the query params from a HttpServletRequest to the target uri passed. * @param request HttpServletRequest with the request details * @param targetUri the uri to which the query params must be added * @return URL encoded string containing the targetUri + "?" + query string */
Add the query params from a HttpServletRequest to the target uri passed
appendQueryParams
{ "repo_name": "robzor92/hops", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java", "license": "apache-2.0", "size": 18162 }
[ "javax.servlet.http.HttpServletRequest" ]
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
579,885
public Set<T> merge(T winner, T loser) { T winnerCanon = lookup(winner); T loserCanon = lookup(loser); // Already same set, do nothing if (loserCanon.equals(winnerCanon)) { return Collections.emptySet(); } // Notify before change notifyChanged(true, winnerCanon, loserCanon); Set<T> affectedMembers = members(loserCanon); for (T affectedMember: affectedMembers) { canonical.put(affectedMember, winnerCanon); } subscribeToParentUpdates(winnerCanon); subscribeToParentUpdates(loserCanon); // Notify after change notifyChanged(false, winnerCanon, loserCanon); return Collections.unmodifiableSet(affectedMembers); }
Set<T> function(T winner, T loser) { T winnerCanon = lookup(winner); T loserCanon = lookup(loser); if (loserCanon.equals(winnerCanon)) { return Collections.emptySet(); } notifyChanged(true, winnerCanon, loserCanon); Set<T> affectedMembers = members(loserCanon); for (T affectedMember: affectedMembers) { canonical.put(affectedMember, winnerCanon); } subscribeToParentUpdates(winnerCanon); subscribeToParentUpdates(loserCanon); notifyChanged(false, winnerCanon, loserCanon); return Collections.unmodifiableSet(affectedMembers); }
/** * Merge loser into winner. * Note: if they are already in same set, no changes, even if loser * is canonical * @param winner * @param loser * @return unmodifiable collection of values that changed their canonical member */
Merge loser into winner. Note: if they are already in same set, no changes, even if loser is canonical
merge
{ "repo_name": "basheersubei/swift-t", "path": "stc/code/src/exm/stc/common/util/ScopedUnionFind.java", "license": "apache-2.0", "size": 5270 }
[ "java.util.Collections", "java.util.Set" ]
import java.util.Collections; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,164,207
private Map<String, String> parseParams(SqlLexer lex) { SqlLexerToken nextTok = lex.lookAhead(); if (nextTok.token() == null || nextTok.tokenType() == SqlLexerTokenType.SEMICOLON || nextTok.tokenType() == SqlLexerTokenType.COMMA) return null; skipIfMatchesKeyword(lex, SqlKeyword.WITH); lex.shift(); String paramsStr = lex.token(); String[] params = paramsStr.split(","); Map<String, String> res = new HashMap<>(params.length); for (String param : params) { int p = param.indexOf("="); res.put(param.substring(0, p), param.substring(p + 1)); } return res; }
Map<String, String> function(SqlLexer lex) { SqlLexerToken nextTok = lex.lookAhead(); if (nextTok.token() == null nextTok.tokenType() == SqlLexerTokenType.SEMICOLON nextTok.tokenType() == SqlLexerTokenType.COMMA) return null; skipIfMatchesKeyword(lex, SqlKeyword.WITH); lex.shift(); String paramsStr = lex.token(); String[] params = paramsStr.split(","); Map<String, String> res = new HashMap<>(params.length); for (String param : params) { int p = param.indexOf("="); res.put(param.substring(0, p), param.substring(p + 1)); } return res; }
/** * Pars param including WITH keyword. * * @param lex Lexer to use. * @return Map of parameters. */
Pars param including WITH keyword
parseParams
{ "repo_name": "ascherbakoff/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/sql/command/SqlAnalyzeCommand.java", "license": "apache-2.0", "size": 6948 }
[ "java.util.HashMap", "java.util.Map", "org.apache.ignite.internal.sql.SqlKeyword", "org.apache.ignite.internal.sql.SqlLexer", "org.apache.ignite.internal.sql.SqlLexerToken", "org.apache.ignite.internal.sql.SqlLexerTokenType", "org.apache.ignite.internal.sql.SqlParserUtils" ]
import java.util.HashMap; import java.util.Map; import org.apache.ignite.internal.sql.SqlKeyword; import org.apache.ignite.internal.sql.SqlLexer; import org.apache.ignite.internal.sql.SqlLexerToken; import org.apache.ignite.internal.sql.SqlLexerTokenType; import org.apache.ignite.internal.sql.SqlParserUtils;
import java.util.*; import org.apache.ignite.internal.sql.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
103,335
@Message(id = 132, value = "Must include one of the following elements: %s") XMLStreamException missingOneOf(StringBuilder sb, @Param Location location);
@Message(id = 132, value = STR) XMLStreamException missingOneOf(StringBuilder sb, @Param Location location);
/** * Creates an exception indicating there must be one of the elements, represented by the {@code sb} parameter, * included. * * @param sb the acceptable elements. * @param location the location of the error. * * @return a {@link XMLStreamException} for the error. */
Creates an exception indicating there must be one of the elements, represented by the sb parameter, included
missingOneOf
{ "repo_name": "aloubyansky/wildfly-core", "path": "controller/src/main/java/org/jboss/as/controller/logging/ControllerLogger.java", "license": "lgpl-2.1", "size": 164970 }
[ "javax.xml.stream.Location", "javax.xml.stream.XMLStreamException", "org.jboss.logging.annotations.Message", "org.jboss.logging.annotations.Param" ]
import javax.xml.stream.Location; import javax.xml.stream.XMLStreamException; import org.jboss.logging.annotations.Message; import org.jboss.logging.annotations.Param;
import javax.xml.stream.*; import org.jboss.logging.annotations.*;
[ "javax.xml", "org.jboss.logging" ]
javax.xml; org.jboss.logging;
79,122
public void capturePage(ScreenshotTaker screenshotTaker, String description) { FluentLogger flogger = pageObject.getLogger().with() .message(description) .screenshot(screenshotTaker) .marker(StoryboardMarkerFactory.addCard(pageObject.getSimpleName())); if (logLocation != null) { flogger.locationAwareParent(logLocation); } flogger.debug(); }
void function(ScreenshotTaker screenshotTaker, String description) { FluentLogger flogger = pageObject.getLogger().with() .message(description) .screenshot(screenshotTaker) .marker(StoryboardMarkerFactory.addCard(pageObject.getSimpleName())); if (logLocation != null) { flogger.locationAwareParent(logLocation); } flogger.debug(); }
/** * Capture a screenshot of the current page and add it to the log and story board. * * @param screenshotTaker A custom screenshot taker * @param description Description to include with screenshot */
Capture a screenshot of the current page and add it to the log and story board
capturePage
{ "repo_name": "andrew-sumner/cubano", "path": "src/main/java/org/concordion/cubano/driver/web/PageHelper.java", "license": "apache-2.0", "size": 13922 }
[ "org.concordion.ext.ScreenshotTaker", "org.concordion.ext.StoryboardMarkerFactory", "org.concordion.slf4j.ext.FluentLogger" ]
import org.concordion.ext.ScreenshotTaker; import org.concordion.ext.StoryboardMarkerFactory; import org.concordion.slf4j.ext.FluentLogger;
import org.concordion.ext.*; import org.concordion.slf4j.ext.*;
[ "org.concordion.ext", "org.concordion.slf4j" ]
org.concordion.ext; org.concordion.slf4j;
2,740,769
@Override public boolean equals(final Object aThat) { Object proxyThat = aThat; if ( this == aThat ) { return true; } if (aThat instanceof HibernateProxy) { // narrow down the proxy to the class we are dealing with. try { proxyThat = ((HibernateProxy) aThat).getHibernateLazyInitializer().getImplementation(); } catch (org.hibernate.ObjectNotFoundException e) { return false; } } if (aThat == null) { return false; } final Exitrhy that; try { that = (Exitrhy) proxyThat; if ( !(that.getClassType().equals(this.getClassType()))){ return false; } } catch (org.hibernate.ObjectNotFoundException e) { return false; } catch (ClassCastException e) { return false; } boolean result = true; result = result && (((this.getId() == null) && ( that.getId() == null)) || (this.getId() != null && this.getId().equals(that.getId()))); result = result && (((getDateCreated() == null) && (that.getDateCreated() == null)) || (getDateCreated() != null && getDateCreated().equals(that.getDateCreated()))); result = result && (((getDateCreatedFromSource() == null) && (that.getDateCreatedFromSource() == null)) || (getDateCreatedFromSource() != null && getDateCreatedFromSource().equals(that.getDateCreatedFromSource()))); result = result && (((getDateUpdated() == null) && (that.getDateUpdated() == null)) || (getDateUpdated() != null && getDateUpdated().equals(that.getDateUpdated()))); result = result && (((getDateUpdatedFromSource() == null) && (that.getDateUpdatedFromSource() == null)) || (getDateUpdatedFromSource() != null && getDateUpdatedFromSource().equals(that.getDateUpdatedFromSource()))); result = result && (((getEarlyExitReason() == null) && (that.getEarlyExitReason() == null)) || (getEarlyExitReason() != null && getEarlyExitReason().equals(that.getEarlyExitReason()))); result = result && (((getExitid() == null) && (that.getExitid() == null)) || (getExitid() != null && getExitid().getId().equals(that.getExitid().getId()))); result = result && (((getExport() == null) && (that.getExport() == null)) || (getExport() != null && getExport().getId().equals(that.getExport().getId()))); result = result && (((getParentId() == null) && (that.getParentId() == null)) || (getParentId() != null && getParentId().equals(that.getParentId()))); result = result && (((getProjectCompletionStatus() == null) && (that.getProjectCompletionStatus() == null)) || (getProjectCompletionStatus() != null && getProjectCompletionStatus().equals(that.getProjectCompletionStatus()))); result = result && (((getProjectGroupCode() == null) && (that.getProjectGroupCode() == null)) || (getProjectGroupCode() != null && getProjectGroupCode().equals(that.getProjectGroupCode()))); result = result && (((getUserId() == null) && (that.getUserId() == null)) || (getUserId() != null && getUserId().equals(that.getUserId()))); result = result && (((getVersion() == null) && (that.getVersion() == null)) || (getVersion() != null && getVersion().equals(that.getVersion()))); return result; }
boolean function(final Object aThat) { Object proxyThat = aThat; if ( this == aThat ) { return true; } if (aThat instanceof HibernateProxy) { try { proxyThat = ((HibernateProxy) aThat).getHibernateLazyInitializer().getImplementation(); } catch (org.hibernate.ObjectNotFoundException e) { return false; } } if (aThat == null) { return false; } final Exitrhy that; try { that = (Exitrhy) proxyThat; if ( !(that.getClassType().equals(this.getClassType()))){ return false; } } catch (org.hibernate.ObjectNotFoundException e) { return false; } catch (ClassCastException e) { return false; } boolean result = true; result = result && (((this.getId() == null) && ( that.getId() == null)) (this.getId() != null && this.getId().equals(that.getId()))); result = result && (((getDateCreated() == null) && (that.getDateCreated() == null)) (getDateCreated() != null && getDateCreated().equals(that.getDateCreated()))); result = result && (((getDateCreatedFromSource() == null) && (that.getDateCreatedFromSource() == null)) (getDateCreatedFromSource() != null && getDateCreatedFromSource().equals(that.getDateCreatedFromSource()))); result = result && (((getDateUpdated() == null) && (that.getDateUpdated() == null)) (getDateUpdated() != null && getDateUpdated().equals(that.getDateUpdated()))); result = result && (((getDateUpdatedFromSource() == null) && (that.getDateUpdatedFromSource() == null)) (getDateUpdatedFromSource() != null && getDateUpdatedFromSource().equals(that.getDateUpdatedFromSource()))); result = result && (((getEarlyExitReason() == null) && (that.getEarlyExitReason() == null)) (getEarlyExitReason() != null && getEarlyExitReason().equals(that.getEarlyExitReason()))); result = result && (((getExitid() == null) && (that.getExitid() == null)) (getExitid() != null && getExitid().getId().equals(that.getExitid().getId()))); result = result && (((getExport() == null) && (that.getExport() == null)) (getExport() != null && getExport().getId().equals(that.getExport().getId()))); result = result && (((getParentId() == null) && (that.getParentId() == null)) (getParentId() != null && getParentId().equals(that.getParentId()))); result = result && (((getProjectCompletionStatus() == null) && (that.getProjectCompletionStatus() == null)) (getProjectCompletionStatus() != null && getProjectCompletionStatus().equals(that.getProjectCompletionStatus()))); result = result && (((getProjectGroupCode() == null) && (that.getProjectGroupCode() == null)) (getProjectGroupCode() != null && getProjectGroupCode().equals(that.getProjectGroupCode()))); result = result && (((getUserId() == null) && (that.getUserId() == null)) (getUserId() != null && getUserId().equals(that.getUserId()))); result = result && (((getVersion() == null) && (that.getVersion() == null)) (getVersion() != null && getVersion().equals(that.getVersion()))); return result; }
/** Equals implementation. * @see java.lang.Object#equals(java.lang.Object) * @param aThat Object to compare with * @return true/false */
Equals implementation
equals
{ "repo_name": "servinglynk/servinglynk-hmis", "path": "hmis-model-v2020/src/main/java/com/servinglynk/hmis/warehouse/model/v2020/Exitrhy.java", "license": "mpl-2.0", "size": 20181 }
[ "org.hibernate.proxy.HibernateProxy" ]
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.*;
[ "org.hibernate.proxy" ]
org.hibernate.proxy;
796,076
@Test @SmallTest @Feature({"Preferences"}) public void testExportWarningTimeoutOnResume() { setPasswordSource(new SavedPasswordEntry("https://example.com", "test user", "password")); ReauthenticationManager.setApiOverride(ReauthenticationManager.OverrideState.AVAILABLE); ReauthenticationManager.setScreenLockSetUpOverride( ReauthenticationManager.OverrideState.AVAILABLE); final SettingsActivity settingsActivity = mSettingsActivityTestRule.startSettingsActivity(); openActionBarOverflowOrOptionsMenu( InstrumentationRegistry.getInstrumentation().getTargetContext()); // Before exporting, pretend that the last successful reauthentication happend too long ago. ReauthenticationManager.recordLastReauth(System.currentTimeMillis() - ReauthenticationManager.VALID_REAUTHENTICATION_TIME_INTERVAL_MILLIS - 1, ReauthenticationManager.ReauthScope.BULK); Espresso.onView(withText(R.string.password_settings_export_action_title)).perform(click()); // Call onResume to simulate that the user put Chrome into background by opening "recent // apps" and then restored Chrome by choosing it from the list. TestThreadUtils.runOnUiThreadBlocking( () -> { settingsActivity.getMainFragment().onResume(); }); // Check that export warning is not visible again. Espresso.onView(withText(R.string.cancel)).check(doesNotExist()); // Check that the export flow was cancelled automatically by checking that the export menu // is available and enabled. checkExportMenuItemState(MenuItemState.ENABLED); }
@Feature({STR}) void function() { setPasswordSource(new SavedPasswordEntry("https: ReauthenticationManager.setApiOverride(ReauthenticationManager.OverrideState.AVAILABLE); ReauthenticationManager.setScreenLockSetUpOverride( ReauthenticationManager.OverrideState.AVAILABLE); final SettingsActivity settingsActivity = mSettingsActivityTestRule.startSettingsActivity(); openActionBarOverflowOrOptionsMenu( InstrumentationRegistry.getInstrumentation().getTargetContext()); ReauthenticationManager.recordLastReauth(System.currentTimeMillis() - ReauthenticationManager.VALID_REAUTHENTICATION_TIME_INTERVAL_MILLIS - 1, ReauthenticationManager.ReauthScope.BULK); Espresso.onView(withText(R.string.password_settings_export_action_title)).perform(click()); TestThreadUtils.runOnUiThreadBlocking( () -> { settingsActivity.getMainFragment().onResume(); }); Espresso.onView(withText(R.string.cancel)).check(doesNotExist()); checkExportMenuItemState(MenuItemState.ENABLED); }
/** * Check that the export warning is dismissed after onResume if the last reauthentication * happened too long ago. */
Check that the export warning is dismissed after onResume if the last reauthentication happened too long ago
testExportWarningTimeoutOnResume
{ "repo_name": "endlessm/chromium-browser", "path": "chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettingsTest.java", "license": "bsd-3-clause", "size": 94005 }
[ "android.support.test.InstrumentationRegistry", "android.support.test.espresso.Espresso", "org.chromium.base.test.util.Feature", "org.chromium.chrome.browser.settings.SettingsActivity", "org.chromium.content_public.browser.test.util.TestThreadUtils" ]
import android.support.test.InstrumentationRegistry; import android.support.test.espresso.Espresso; import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.settings.SettingsActivity; import org.chromium.content_public.browser.test.util.TestThreadUtils;
import android.support.test.*; import android.support.test.espresso.*; import org.chromium.base.test.util.*; import org.chromium.chrome.browser.settings.*; import org.chromium.content_public.browser.test.util.*;
[ "android.support", "org.chromium.base", "org.chromium.chrome", "org.chromium.content_public" ]
android.support; org.chromium.base; org.chromium.chrome; org.chromium.content_public;
2,031,415
protected MemoryEntry entry(SimpleFeatureType schema) throws IOException { Name typeName = schema.getName(); synchronized (entries) { if (entries.containsKey(typeName)) { MemoryEntry entry = (MemoryEntry) entries.get(typeName); if (FeatureTypes.equals(entry.schema, schema)) { return entry; } else { throw new IOException( "Entry " + typeName + " schema " + entry.schema + " incompatible with provided " + schema); } } else { MemoryEntry entry = new MemoryEntry(this, schema); entries.put(typeName, entry); return entry; } } }
MemoryEntry function(SimpleFeatureType schema) throws IOException { Name typeName = schema.getName(); synchronized (entries) { if (entries.containsKey(typeName)) { MemoryEntry entry = (MemoryEntry) entries.get(typeName); if (FeatureTypes.equals(entry.schema, schema)) { return entry; } else { throw new IOException( STR + typeName + STR + entry.schema + STR + schema); } } else { MemoryEntry entry = new MemoryEntry(this, schema); entries.put(typeName, entry); return entry; } } }
/** * Access to entry to store content of the provided schema, will create new entry if needed. * * <p> * * @return MemoryState used for content storage * @throws IOException If new entry could not be created due to typeName conflict */
Access to entry to store content of the provided schema, will create new entry if needed.
entry
{ "repo_name": "geotools/geotools", "path": "modules/library/main/src/main/java/org/geotools/data/memory/MemoryDataStore.java", "license": "lgpl-2.1", "size": 12225 }
[ "java.io.IOException", "org.geotools.feature.FeatureTypes", "org.opengis.feature.simple.SimpleFeatureType", "org.opengis.feature.type.Name" ]
import java.io.IOException; import org.geotools.feature.FeatureTypes; import org.opengis.feature.simple.SimpleFeatureType; import org.opengis.feature.type.Name;
import java.io.*; import org.geotools.feature.*; import org.opengis.feature.simple.*; import org.opengis.feature.type.*;
[ "java.io", "org.geotools.feature", "org.opengis.feature" ]
java.io; org.geotools.feature; org.opengis.feature;
698,186
private void buildLocationSettingsRequest() { LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder(); builder.addLocationRequest(mLocationRequest); mLocationSettingsRequest = builder.build(); }
void function() { LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder(); builder.addLocationRequest(mLocationRequest); mLocationSettingsRequest = builder.build(); }
/** * Uses a {@link com.google.android.gms.location.LocationSettingsRequest.Builder} to build * a {@link com.google.android.gms.location.LocationSettingsRequest} that is used for checking * if a device has the needed location settings. */
Uses a <code>com.google.android.gms.location.LocationSettingsRequest.Builder</code> to build a <code>com.google.android.gms.location.LocationSettingsRequest</code> that is used for checking if a device has the needed location settings
buildLocationSettingsRequest
{ "repo_name": "googlesamples/android-play-location", "path": "LocationUpdates/app/src/main/java/com/google/android/gms/location/sample/locationupdates/MainActivity.java", "license": "apache-2.0", "size": 24598 }
[ "com.google.android.gms.location.LocationSettingsRequest" ]
import com.google.android.gms.location.LocationSettingsRequest;
import com.google.android.gms.location.*;
[ "com.google.android" ]
com.google.android;
1,877,058
public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Create a RequestDispatcher the corresponding resource String path = mapping.getParameter(); if (path == null) { throw new ServletException(messages.getMessage("include.path")); } RequestDispatcher rd = servlet.getServletContext().getRequestDispatcher(path); if (rd == null) { throw new ServletException(messages.getMessage("include.rd", path)); } // Unwrap the multipart request, if there is one. if (request instanceof MultipartRequestWrapper) { request = ((MultipartRequestWrapper) request).getRequest(); } // Forward control to the specified resource rd.include(request, response); // Tell the controller servlet that the response has been created return (null); }
ActionForward function( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String path = mapping.getParameter(); if (path == null) { throw new ServletException(messages.getMessage(STR)); } RequestDispatcher rd = servlet.getServletContext().getRequestDispatcher(path); if (rd == null) { throw new ServletException(messages.getMessage(STR, path)); } if (request instanceof MultipartRequestWrapper) { request = ((MultipartRequestWrapper) request).getRequest(); } rd.include(request, response); return (null); }
/** * Process the specified HTTP request, and create the corresponding HTTP * response (or forward to another web component that will create it). * Return an <code>ActionForward</code> instance describing where and how * control should be forwarded, or <code>null</code> if the response has * already been completed. * * @param mapping The ActionMapping used to select this instance * @param form The optional ActionForm bean for this request (if any) * @param request The HTTP request we are processing * @param response The HTTP response we are creating * * @exception Exception if an error occurs */
Process the specified HTTP request, and create the corresponding HTTP response (or forward to another web component that will create it). Return an <code>ActionForward</code> instance describing where and how control should be forwarded, or <code>null</code> if the response has already been completed
execute
{ "repo_name": "kawasima/struts-taglib-compatible", "path": "src/share/org/apache/struts/actions/IncludeAction.java", "license": "apache-2.0", "size": 4230 }
[ "javax.servlet.RequestDispatcher", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.struts.action.ActionForm", "org.apache.struts.action.ActionForward", "org.apache.struts.action.ActionMapping", "org.apache.struts.upload.MultipartRequestWrapper" ]
import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.upload.MultipartRequestWrapper;
import javax.servlet.*; import javax.servlet.http.*; import org.apache.struts.action.*; import org.apache.struts.upload.*;
[ "javax.servlet", "org.apache.struts" ]
javax.servlet; org.apache.struts;
1,466,570
@SuppressLint("SimpleDateFormat") private String _getDateTextFormat(String datetime) throws ParseException { String newdate = datetime; SimpleDateFormat dateformat2 = new SimpleDateFormat("yyyy-MM-dd hh:mm"); Date newdate1 = dateformat2.parse(newdate); Format formatter1 = new SimpleDateFormat("EEEE dd MMMM yyyy hh:mm a"); String date1 = formatter1.format(newdate1); return date1; }
@SuppressLint(STR) String function(String datetime) throws ParseException { String newdate = datetime; SimpleDateFormat dateformat2 = new SimpleDateFormat(STR); Date newdate1 = dateformat2.parse(newdate); Format formatter1 = new SimpleDateFormat(STR); String date1 = formatter1.format(newdate1); return date1; }
/** * Function used to format the date like Friday 31 July 2015 01:30 PM * * @param datetime * @return formated date string * @throws ParseException */
Function used to format the date like Friday 31 July 2015 01:30 PM
_getDateTextFormat
{ "repo_name": "egovernments/MeGov", "path": "android/src/org/egov/android/view/activity/StatusSummaryActivity.java", "license": "gpl-3.0", "size": 9220 }
[ "android.annotation.SuppressLint", "java.text.Format", "java.text.ParseException", "java.text.SimpleDateFormat", "java.util.Date" ]
import android.annotation.SuppressLint; import java.text.Format; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date;
import android.annotation.*; import java.text.*; import java.util.*;
[ "android.annotation", "java.text", "java.util" ]
android.annotation; java.text; java.util;
1,462,962
public NestedSet<PathFragment> getDeclaredIncludeDirs() { return context.getDeclaredIncludeDirs(); }
NestedSet<PathFragment> function() { return context.getDeclaredIncludeDirs(); }
/** * Return the directories in which to look for headers (pertains to headers * not specifically listed in {@code declaredIncludeSrcs}). The return value * may contain duplicate elements. */
Return the directories in which to look for headers (pertains to headers not specifically listed in declaredIncludeSrcs). The return value may contain duplicate elements
getDeclaredIncludeDirs
{ "repo_name": "kamalmarhubi/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java", "license": "apache-2.0", "size": 58095 }
[ "com.google.devtools.build.lib.collect.nestedset.NestedSet", "com.google.devtools.build.lib.vfs.PathFragment" ]
import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.build.lib.collect.nestedset.*; import com.google.devtools.build.lib.vfs.*;
[ "com.google.devtools" ]
com.google.devtools;
2,359,275
public Set<Contact> searchContacts(String search) { Set<Contact> contacts = null; try { String[] words = search.split(" "); List<String> setKeyWords = new ArrayList<String>(Arrays.asList(words)); Session session = HibernateUtil.getSessionFactory().openSession(); // Build query StringBuilder sb = new StringBuilder(); sb.append("select c from Contact as c join c.groups as g where c.nom in (:keyWords) or c.prenom in (:keyWords) or c.adress.country in (:keyWords)"); sb.append(" or g.groupName in (:keyWords)"); // Execute query Query query = session.createQuery(sb.toString()); query.setParameterList("keyWords", setKeyWords); @SuppressWarnings("unchecked") List<Contact> list = (List<Contact>) query.list(); contacts = new HashSet<>(list); session.close(); } catch (HibernateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return contacts; } // ****************************** Update ********************************
Set<Contact> function(String search) { Set<Contact> contacts = null; try { String[] words = search.split(" "); List<String> setKeyWords = new ArrayList<String>(Arrays.asList(words)); Session session = HibernateUtil.getSessionFactory().openSession(); StringBuilder sb = new StringBuilder(); sb.append(STR); sb.append(STR); Query query = session.createQuery(sb.toString()); query.setParameterList(STR, setKeyWords); @SuppressWarnings(STR) List<Contact> list = (List<Contact>) query.list(); contacts = new HashSet<>(list); session.close(); } catch (HibernateException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return contacts; }
/** * Seach a Contact by : firstname, lastname, country, group name * * @param keywords * @return contacts : a set of Contact */
Seach a Contact by : firstname, lastname, country, group name
searchContacts
{ "repo_name": "ooussem/Gestionnaire-de-contacts", "path": "src/DAO/ContactDAO.java", "license": "apache-2.0", "size": 10239 }
[ "java.util.ArrayList", "java.util.Arrays", "java.util.HashSet", "java.util.List", "java.util.Set", "org.hibernate.HibernateException", "org.hibernate.Query", "org.hibernate.Session" ]
import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import org.hibernate.HibernateException; import org.hibernate.Query; import org.hibernate.Session;
import java.util.*; import org.hibernate.*;
[ "java.util", "org.hibernate" ]
java.util; org.hibernate;
1,098,954
protected void sendRedirect( HttpServletRequest request, HttpServletResponse response, String targetUrl, boolean http10Compatible) throws IOException { if (http10Compatible) { // Always send status code 302. response.sendRedirect(response.encodeRedirectURL(targetUrl)); } else { // Correct HTTP status code is 303, in particular for POST requests. response.setStatus(303); response.setHeader("Location", response.encodeRedirectURL(targetUrl)); } }
void function( HttpServletRequest request, HttpServletResponse response, String targetUrl, boolean http10Compatible) throws IOException { if (http10Compatible) { response.sendRedirect(response.encodeRedirectURL(targetUrl)); } else { response.setStatus(303); response.setHeader(STR, response.encodeRedirectURL(targetUrl)); } }
/** * Send a redirect back to the HTTP client * @param request current HTTP request (allows for reacting to request method) * @param response current HTTP response (for sending response headers) * @param targetUrl the target URL to redirect to * @param http10Compatible whether to stay compatible with HTTP 1.0 clients * @throws IOException if thrown by response methods */
Send a redirect back to the HTTP client
sendRedirect
{ "repo_name": "raedle/univis", "path": "lib/springframework-1.2.8/src/org/springframework/web/servlet/view/RedirectView.java", "license": "lgpl-2.1", "size": 10005 }
[ "java.io.IOException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
626,538
public void openMarketplace() { try { if ( marketplaceMethod != null ) { marketplaceMethod.invoke( marketplaceMethod.getDeclaringClass().newInstance() ); } } catch ( Exception ex ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "Spoon.ErrorShowingMarketplaceDialog.Title" ), BaseMessages .getString( PKG, "Spoon.ErrorShowingMarketplaceDialog.Message" ), ex ); } }
void function() { try { if ( marketplaceMethod != null ) { marketplaceMethod.invoke( marketplaceMethod.getDeclaringClass().newInstance() ); } } catch ( Exception ex ) { new ErrorDialog( shell, BaseMessages.getString( PKG, STR ), BaseMessages .getString( PKG, STR ), ex ); } }
/** * If available, this method will open the marketplace. */
If available, this method will open the marketplace
openMarketplace
{ "repo_name": "emartin-pentaho/pentaho-kettle", "path": "ui/src/main/java/org/pentaho/di/ui/spoon/Spoon.java", "license": "apache-2.0", "size": 342268 }
[ "org.pentaho.di.i18n.BaseMessages", "org.pentaho.di.ui.core.dialog.ErrorDialog" ]
import org.pentaho.di.i18n.BaseMessages; import org.pentaho.di.ui.core.dialog.ErrorDialog;
import org.pentaho.di.i18n.*; import org.pentaho.di.ui.core.dialog.*;
[ "org.pentaho.di" ]
org.pentaho.di;
591,009
public Observable<ServiceResponse<Page<AvailabilitySetInner>>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); }
Observable<ServiceResponse<Page<AvailabilitySetInner>>> function() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); }
/** * Lists all availability sets in a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;AvailabilitySetInner&gt; object wrapped in {@link ServiceResponse} if successful. */
Lists all availability sets in a subscription
listSinglePageAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/compute/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/compute/v2019_03_01/implementation/AvailabilitySetsInner.java", "license": "mit", "size": 63110 }
[ "com.microsoft.azure.Page", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
540,554
NamingEnumeration<? extends Attribute> getAll();
NamingEnumeration<? extends Attribute> getAll();
/** * Retrieves an enumeration of the attributes in the attribute set. * The effects of updates to this attribute set on this enumeration * are undefined. * * @return A non-null enumeration of the attributes in this attribute set. * Each element of the enumeration is of class <tt>Attribute</tt>. * If attribute set has zero attributes, an empty enumeration * is returned. */
Retrieves an enumeration of the attributes in the attribute set. The effects of updates to this attribute set on this enumeration are undefined
getAll
{ "repo_name": "mobile-event-processing/Asper", "path": "source/src/com/asper/sources/javax/naming/Attributes.java", "license": "gpl-2.0", "size": 7213 }
[ "com.asper.sources.javax.naming.NamingEnumeration" ]
import com.asper.sources.javax.naming.NamingEnumeration;
import com.asper.sources.javax.naming.*;
[ "com.asper.sources" ]
com.asper.sources;
2,313,339
public void addTrackingRecord(TrackingRecord TrackingRecord);
void function(TrackingRecord TrackingRecord);
/** * Adds the tracking record * * @param TrackingRecord the tracking record */
Adds the tracking record
addTrackingRecord
{ "repo_name": "IHTSDO/OTF-Mapping-Service", "path": "model/src/main/java/org/ihtsdo/otf/mapping/helpers/TrackingRecordList.java", "license": "apache-2.0", "size": 902 }
[ "org.ihtsdo.otf.mapping.workflow.TrackingRecord" ]
import org.ihtsdo.otf.mapping.workflow.TrackingRecord;
import org.ihtsdo.otf.mapping.workflow.*;
[ "org.ihtsdo.otf" ]
org.ihtsdo.otf;
2,211,116
private JTextField getNamespaceTextField() { if (namespaceTextField == null) { namespaceTextField = new JTextField(); if (!isNew) { namespaceTextField.setEditable(false); namespaceTextField.setEnabled(false); } namespaceTextField.getDocument().addDocumentListener(new TextBoxListener()); } return namespaceTextField; }
JTextField function() { if (namespaceTextField == null) { namespaceTextField = new JTextField(); if (!isNew) { namespaceTextField.setEditable(false); namespaceTextField.setEnabled(false); } namespaceTextField.getDocument().addDocumentListener(new TextBoxListener()); } return namespaceTextField; }
/** * This method initializes namespaceTextField * * @return javax.swing.JTextField */
This method initializes namespaceTextField
getNamespaceTextField
{ "repo_name": "NCIP/cagrid-core", "path": "caGrid/projects/introduce/src/java/Portal/gov/nih/nci/cagrid/introduce/portal/modification/services/ModifyService.java", "license": "bsd-3-clause", "size": 28432 }
[ "javax.swing.JTextField" ]
import javax.swing.JTextField;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,904,702
public void loading() { mHintView.setVisibility(View.GONE); mProgressBar.setVisibility(View.VISIBLE); }
void function() { mHintView.setVisibility(View.GONE); mProgressBar.setVisibility(View.VISIBLE); }
/** * loading status */
loading status
loading
{ "repo_name": "wsds/chitchat", "path": "ChitChat/src/com/open/chitchat/view/MyListView.java", "license": "apache-2.0", "size": 15873 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
410,136
public static Field<Object> cube3(Double __1) { Cube3 f = new Cube3(); f.set__1(__1); return f.asField(); }
static Field<Object> function(Double __1) { Cube3 f = new Cube3(); f.set__1(__1); return f.asField(); }
/** * Get <code>public.cube</code> as a field. */
Get <code>public.cube</code> as a field
cube3
{ "repo_name": "Remper/sociallink", "path": "alignments/src/main/java/eu/fbk/fm/alignments/index/db/Routines.java", "license": "apache-2.0", "size": 37686 }
[ "eu.fbk.fm.alignments.index.db.routines.Cube3", "org.jooq.Field" ]
import eu.fbk.fm.alignments.index.db.routines.Cube3; import org.jooq.Field;
import eu.fbk.fm.alignments.index.db.routines.*; import org.jooq.*;
[ "eu.fbk.fm", "org.jooq" ]
eu.fbk.fm; org.jooq;
2,219,456
public final void prependJavaScript(CharSequence javascript) { Args.notNull(javascript, "javascript"); prependJavaScripts.add(javascript); }
final void function(CharSequence javascript) { Args.notNull(javascript, STR); prependJavaScripts.add(javascript); }
/** * Adds script to the ones which are executed before the component replacement. * * @param javascript * the javascript to execute */
Adds script to the ones which are executed before the component replacement
prependJavaScript
{ "repo_name": "astrapi69/wicket", "path": "wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxResponse.java", "license": "apache-2.0", "size": 22124 }
[ "org.apache.wicket.util.lang.Args" ]
import org.apache.wicket.util.lang.Args;
import org.apache.wicket.util.lang.*;
[ "org.apache.wicket" ]
org.apache.wicket;
461,790
private void populateNode(Node root, Path path, Object value) { // Build basic nodes up to last level Node bottom = createNesting(root, path.getPrevious()); if (value instanceof Collection) { @SuppressWarnings("unchecked") Collection<Object> coll = (Collection<Object>)value; Node list = bottom.path(path.getSegment()); for (Object obj: coll) { Node map = list.addToList(); map.setPropertyValue(obj); } } else { Node map = bottom.path(path.getSegment()); map.setPropertyValue(value); } }
void function(Node root, Path path, Object value) { Node bottom = createNesting(root, path.getPrevious()); if (value instanceof Collection) { @SuppressWarnings(STR) Collection<Object> coll = (Collection<Object>)value; Node list = bottom.path(path.getSegment()); for (Object obj: coll) { Node map = list.addToList(); map.setPropertyValue(obj); } } else { Node map = bottom.path(path.getSegment()); map.setPropertyValue(value); } }
/** * Recursive method that places the value at the path, building node structures along the way. */
Recursive method that places the value at the path, building node structures along the way
populateNode
{ "repo_name": "gvaish/objectify-appengine", "path": "src/com/googlecode/objectify/impl/Transmog.java", "license": "mit", "size": 14826 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,109,439
public void expandSubActions(GuidedAction action) { if (!action.hasSubActions()) { return; } expandAction(action, true); }
void function(GuidedAction action) { if (!action.hasSubActions()) { return; } expandAction(action, true); }
/** * Expand a given action's sub actions list. * @param action GuidedAction to expand. * @see #expandAction(GuidedAction, boolean) */
Expand a given action's sub actions list
expandSubActions
{ "repo_name": "aosp-mirror/platform_frameworks_support", "path": "leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java", "license": "apache-2.0", "size": 63362 }
[ "androidx.leanback.widget.GuidedAction" ]
import androidx.leanback.widget.GuidedAction;
import androidx.leanback.widget.*;
[ "androidx.leanback" ]
androidx.leanback;
1,126,753
private static Map writeFontDict(PSGenerator gen, FontInfo fontInfo, Map<String, Typeface> fonts, boolean encodeAllCharacters, PSEventProducer eventProducer) throws IOException { gen.commentln("%FOPBeginFontDict"); Map fontResources = new HashMap(); for (String key : fonts.keySet()) { Typeface tf = getTypeFace(fontInfo, fonts, key); PSResource fontRes = new PSResource(PSResource.TYPE_FONT, tf.getEmbedFontName()); PSFontResource fontResource = embedFont(gen, tf, fontRes, eventProducer); fontResources.put(key, fontResource); if (tf instanceof SingleByteFont) { SingleByteFont sbf = (SingleByteFont)tf; if (encodeAllCharacters) { sbf.encodeAllUnencodedCharacters(); } for (int i = 0, c = sbf.getAdditionalEncodingCount(); i < c; i++) { SingleByteEncoding encoding = sbf.getAdditionalEncoding(i); defineEncoding(gen, encoding); String postFix = "_" + (i + 1); PSResource derivedFontRes; if (tf.getFontType() == FontType.TRUETYPE && sbf.getTrueTypePostScriptVersion() != PostScriptVersion.V2) { derivedFontRes = defineDerivedTrueTypeFont(gen, eventProducer, tf.getEmbedFontName(), tf.getEmbedFontName() + postFix, encoding, sbf.getCMap()); } else { derivedFontRes = defineDerivedFont(gen, tf.getEmbedFontName(), tf.getEmbedFontName() + postFix, encoding.getName()); } fontResources.put(key + postFix, PSFontResource.createFontResource(derivedFontRes)); } } } gen.commentln("%FOPEndFontDict"); reencodeFonts(gen, fonts); return fontResources; }
static Map function(PSGenerator gen, FontInfo fontInfo, Map<String, Typeface> fonts, boolean encodeAllCharacters, PSEventProducer eventProducer) throws IOException { gen.commentln(STR); Map fontResources = new HashMap(); for (String key : fonts.keySet()) { Typeface tf = getTypeFace(fontInfo, fonts, key); PSResource fontRes = new PSResource(PSResource.TYPE_FONT, tf.getEmbedFontName()); PSFontResource fontResource = embedFont(gen, tf, fontRes, eventProducer); fontResources.put(key, fontResource); if (tf instanceof SingleByteFont) { SingleByteFont sbf = (SingleByteFont)tf; if (encodeAllCharacters) { sbf.encodeAllUnencodedCharacters(); } for (int i = 0, c = sbf.getAdditionalEncodingCount(); i < c; i++) { SingleByteEncoding encoding = sbf.getAdditionalEncoding(i); defineEncoding(gen, encoding); String postFix = "_" + (i + 1); PSResource derivedFontRes; if (tf.getFontType() == FontType.TRUETYPE && sbf.getTrueTypePostScriptVersion() != PostScriptVersion.V2) { derivedFontRes = defineDerivedTrueTypeFont(gen, eventProducer, tf.getEmbedFontName(), tf.getEmbedFontName() + postFix, encoding, sbf.getCMap()); } else { derivedFontRes = defineDerivedFont(gen, tf.getEmbedFontName(), tf.getEmbedFontName() + postFix, encoding.getName()); } fontResources.put(key + postFix, PSFontResource.createFontResource(derivedFontRes)); } } } gen.commentln(STR); reencodeFonts(gen, fonts); return fontResources; }
/** * Generates the PostScript code for the font dictionary. * @param gen PostScript generator to use for output * @param fontInfo available fonts * @param fonts the set of fonts to work with * @param encodeAllCharacters true if all characters shall be encoded using additional, * generated encodings. * @return a Map of PSResource instances representing all defined fonts (key: font key) * @throws IOException in case of an I/O problem */
Generates the PostScript code for the font dictionary
writeFontDict
{ "repo_name": "pellcorp/fop", "path": "src/java/org/apache/fop/render/ps/PSFontUtils.java", "license": "apache-2.0", "size": 30958 }
[ "java.io.IOException", "java.util.HashMap", "java.util.Map", "org.apache.fop.fonts.FontInfo", "org.apache.fop.fonts.FontType", "org.apache.fop.fonts.SingleByteEncoding", "org.apache.fop.fonts.SingleByteFont", "org.apache.fop.fonts.Typeface", "org.apache.fop.fonts.truetype.TTFFile", "org.apache.xmlgraphics.ps.PSGenerator", "org.apache.xmlgraphics.ps.PSResource" ]
import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.apache.fop.fonts.FontInfo; import org.apache.fop.fonts.FontType; import org.apache.fop.fonts.SingleByteEncoding; import org.apache.fop.fonts.SingleByteFont; import org.apache.fop.fonts.Typeface; import org.apache.fop.fonts.truetype.TTFFile; import org.apache.xmlgraphics.ps.PSGenerator; import org.apache.xmlgraphics.ps.PSResource;
import java.io.*; import java.util.*; import org.apache.fop.fonts.*; import org.apache.fop.fonts.truetype.*; import org.apache.xmlgraphics.ps.*;
[ "java.io", "java.util", "org.apache.fop", "org.apache.xmlgraphics" ]
java.io; java.util; org.apache.fop; org.apache.xmlgraphics;
42,152
public static ByteBuffer roomJoined(long id, int color, List<PlayerInfo> players) { byte[] data = Protocol.encode(players); ByteBuffer buff = ByteBuffer.allocate(16 + data.length); buff.putInt(Commands.encode(Command.ROOM_JOINED)); buff.putLong(id); buff.putInt(color); buff.put(data); buff.rewind(); return buff; }
static ByteBuffer function(long id, int color, List<PlayerInfo> players) { byte[] data = Protocol.encode(players); ByteBuffer buff = ByteBuffer.allocate(16 + data.length); buff.putInt(Commands.encode(Command.ROOM_JOINED)); buff.putLong(id); buff.putInt(color); buff.put(data); buff.rewind(); return buff; }
/** * Message to a user that he has joined a room * * @param id * room id * @param color * the color assigned to the player * @param players * the current players in the room */
Message to a user that he has joined a room
roomJoined
{ "repo_name": "tulsidas/darkstris", "path": "src/server/Protocol.java", "license": "gpl-3.0", "size": 10473 }
[ "java.nio.ByteBuffer", "java.util.List" ]
import java.nio.ByteBuffer; import java.util.List;
import java.nio.*; import java.util.*;
[ "java.nio", "java.util" ]
java.nio; java.util;
2,675,361
@Test public void testDefaultProperties() { Properties props = new Properties(); // a loner is all this test needs props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, ""); DistributionConfig config = createSystem(props).getConfig(); assertEquals(DistributionConfig.DEFAULT_NAME, config.getName()); assertEquals(0, config.getMcastPort()); assertEquals(DistributionConfig.DEFAULT_MEMBERSHIP_PORT_RANGE[0], config.getMembershipPortRange()[0]); assertEquals(DistributionConfig.DEFAULT_MEMBERSHIP_PORT_RANGE[1], config.getMembershipPortRange()[1]); if (System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "mcast-address") == null) { assertEquals(DistributionConfig.DEFAULT_MCAST_ADDRESS, config.getMcastAddress()); } if (System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "bind-address") == null) { assertEquals(DistributionConfig.DEFAULT_BIND_ADDRESS, config.getBindAddress()); } assertEquals(DistributionConfig.DEFAULT_LOG_FILE, config.getLogFile()); // default log level gets overrided by the gemfire.properties created for unit tests. // assertIndexDetailsEquals(DistributionConfig.DEFAULT_LOG_LEVEL, config.getLogLevel()); assertEquals(DistributionConfig.DEFAULT_STATISTIC_SAMPLING_ENABLED, config.getStatisticSamplingEnabled()); assertEquals(DistributionConfig.DEFAULT_STATISTIC_SAMPLE_RATE, config.getStatisticSampleRate()); assertEquals(DistributionConfig.DEFAULT_STATISTIC_ARCHIVE_FILE, config.getStatisticArchiveFile()); // ack-wait-threadshold is overridden on VM's command line using a // system property. This is not a valid test. Hrm. // assertIndexDetailsEquals(DistributionConfig.DEFAULT_ACK_WAIT_THRESHOLD, // config.getAckWaitThreshold()); assertEquals(DistributionConfig.DEFAULT_ACK_SEVERE_ALERT_THRESHOLD, config.getAckSevereAlertThreshold()); assertEquals(DistributionConfig.DEFAULT_CACHE_XML_FILE, config.getCacheXmlFile()); assertEquals(DistributionConfig.DEFAULT_ARCHIVE_DISK_SPACE_LIMIT, config.getArchiveDiskSpaceLimit()); assertEquals(DistributionConfig.DEFAULT_ARCHIVE_FILE_SIZE_LIMIT, config.getArchiveFileSizeLimit()); assertEquals(DistributionConfig.DEFAULT_LOG_DISK_SPACE_LIMIT, config.getLogDiskSpaceLimit()); assertEquals(DistributionConfig.DEFAULT_LOG_FILE_SIZE_LIMIT, config.getLogFileSizeLimit()); assertEquals(DistributionConfig.DEFAULT_ENABLE_NETWORK_PARTITION_DETECTION, config.getEnableNetworkPartitionDetection()); }
void function() { Properties props = new Properties(); props.setProperty(MCAST_PORT, "0"); props.setProperty(LOCATORS, STRmcast-addressSTRbind-address") == null) { assertEquals(DistributionConfig.DEFAULT_BIND_ADDRESS, config.getBindAddress()); } assertEquals(DistributionConfig.DEFAULT_LOG_FILE, config.getLogFile()); assertEquals(DistributionConfig.DEFAULT_STATISTIC_SAMPLING_ENABLED, config.getStatisticSamplingEnabled()); assertEquals(DistributionConfig.DEFAULT_STATISTIC_SAMPLE_RATE, config.getStatisticSampleRate()); assertEquals(DistributionConfig.DEFAULT_STATISTIC_ARCHIVE_FILE, config.getStatisticArchiveFile()); assertEquals(DistributionConfig.DEFAULT_ACK_SEVERE_ALERT_THRESHOLD, config.getAckSevereAlertThreshold()); assertEquals(DistributionConfig.DEFAULT_CACHE_XML_FILE, config.getCacheXmlFile()); assertEquals(DistributionConfig.DEFAULT_ARCHIVE_DISK_SPACE_LIMIT, config.getArchiveDiskSpaceLimit()); assertEquals(DistributionConfig.DEFAULT_ARCHIVE_FILE_SIZE_LIMIT, config.getArchiveFileSizeLimit()); assertEquals(DistributionConfig.DEFAULT_LOG_DISK_SPACE_LIMIT, config.getLogDiskSpaceLimit()); assertEquals(DistributionConfig.DEFAULT_LOG_FILE_SIZE_LIMIT, config.getLogFileSizeLimit()); assertEquals(DistributionConfig.DEFAULT_ENABLE_NETWORK_PARTITION_DETECTION, config.getEnableNetworkPartitionDetection()); }
/** * Tests that the default values of properties are what we expect */
Tests that the default values of properties are what we expect
testDefaultProperties
{ "repo_name": "PurelyApplied/geode", "path": "geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/InternalDistributedSystemJUnitTest.java", "license": "apache-2.0", "size": 30192 }
[ "java.util.Properties", "org.junit.Assert" ]
import java.util.Properties; import org.junit.Assert;
import java.util.*; import org.junit.*;
[ "java.util", "org.junit" ]
java.util; org.junit;
2,287,405
private void startSetvice() { Intent intent = new Intent(this, MusicPlayService.class); Bundle bundle = new Bundle(); curSong = mSongsWrap.getModels().get(0); bundle.putSerializable("songs", mSongsWrap); bundle.putInt("index", index); bundle.putInt("time", time); intent.putExtras(bundle); startService(intent); }
void function() { Intent intent = new Intent(this, MusicPlayService.class); Bundle bundle = new Bundle(); curSong = mSongsWrap.getModels().get(0); bundle.putSerializable("songs", mSongsWrap); bundle.putInt("index", index); bundle.putInt("time", time); intent.putExtras(bundle); startService(intent); }
/** * start play service */
start play service
startSetvice
{ "repo_name": "zhanglei920802/MyMusic", "path": "src/com/tcl/lzhang1/mymusic/ui/MusicPlayActivity.java", "license": "apache-2.0", "size": 28176 }
[ "android.content.Intent", "android.os.Bundle", "com.tcl.lzhang1.mymusic.service.MusicPlayService" ]
import android.content.Intent; import android.os.Bundle; import com.tcl.lzhang1.mymusic.service.MusicPlayService;
import android.content.*; import android.os.*; import com.tcl.lzhang1.mymusic.service.*;
[ "android.content", "android.os", "com.tcl.lzhang1" ]
android.content; android.os; com.tcl.lzhang1;
1,320,531
public static C1<IgniteCheckedException, IgniteException> getExceptionConverter(Class<? extends IgniteCheckedException> clazz) { return exceptionConverters.get(clazz); }
static C1<IgniteCheckedException, IgniteException> function(Class<? extends IgniteCheckedException> clazz) { return exceptionConverters.get(clazz); }
/** * Gets IgniteClosure for an IgniteCheckedException class. * * @param clazz Class. * @return The IgniteClosure mapped to this exception class, or null if none. */
Gets IgniteClosure for an IgniteCheckedException class
getExceptionConverter
{ "repo_name": "ascherbakoff/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 385578 }
[ "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.IgniteException" ]
import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException;
import org.apache.ignite.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,273,472
private AtomarMove makeAtomarMove(Element doc) { NodeList probability = doc.getElementsByTagName(PROBABILITY_TAG); NodeList effectId = doc.getElementsByTagName(EFFECT_ID_TAG); NodeList subelements = doc.getElementsByTagName(SUBELEMENT_TAG); if (probability.getLength() != 1) { throw new RuntimeException("Malformed XML: " + probability.getLength() + " probabilities"); } if (effectId.getLength() != 1) { throw new RuntimeException("Malformed XML: " + effectId.getLength() + " effectIds"); } if (subelements.getLength() > 2) { throw new RuntimeException("Malformed XML: " + subelements.getLength() + " atomars"); } AtomarMove am = new AtomarMove(); am.setEffectId(Integer.parseInt(effectId.item(0).getTextContent())); am.setProbability(Integer .parseInt(probability.item(0).getTextContent())); for (int i = 0; i < subelements.getLength(); i++) { Element subelement = (Element) subelements.item(i); String occasion = subelement.getAttribute(OCCASION_ATTRIBUTE_NAME); if (occasion.equals(SUCCESS_VALUE)) { am.setSuccessElement(makeAtomarMove(subelement)); } else if (occasion.equals(FAILURE_VALUE)) { am.setFailureElement(makeAtomarMove(subelement)); } else { throw new RuntimeException("Malformed XML: " + occasion + " is not a valid occasion"); } } return am; }
AtomarMove function(Element doc) { NodeList probability = doc.getElementsByTagName(PROBABILITY_TAG); NodeList effectId = doc.getElementsByTagName(EFFECT_ID_TAG); NodeList subelements = doc.getElementsByTagName(SUBELEMENT_TAG); if (probability.getLength() != 1) { throw new RuntimeException(STR + probability.getLength() + STR); } if (effectId.getLength() != 1) { throw new RuntimeException(STR + effectId.getLength() + STR); } if (subelements.getLength() > 2) { throw new RuntimeException(STR + subelements.getLength() + STR); } AtomarMove am = new AtomarMove(); am.setEffectId(Integer.parseInt(effectId.item(0).getTextContent())); am.setProbability(Integer .parseInt(probability.item(0).getTextContent())); for (int i = 0; i < subelements.getLength(); i++) { Element subelement = (Element) subelements.item(i); String occasion = subelement.getAttribute(OCCASION_ATTRIBUTE_NAME); if (occasion.equals(SUCCESS_VALUE)) { am.setSuccessElement(makeAtomarMove(subelement)); } else if (occasion.equals(FAILURE_VALUE)) { am.setFailureElement(makeAtomarMove(subelement)); } else { throw new RuntimeException(STR + occasion + STR); } } return am; }
/** * Turn the {@link Element} representation of an AtomarMove recursively into * an actual {@link AtomarMove} object. * * @param doc * the {@link Element} representing the AtomarMove * @return the AtomarMove */
Turn the <code>Element</code> representation of an AtomarMove recursively into an actual <code>AtomarMove</code> object
makeAtomarMove
{ "repo_name": "DarthPumpkin/pokemon-library", "path": "src/main/java/de/darthpumpkin/pkmnlib/DummyXMLMoveTreeProvider.java", "license": "mit", "size": 4213 }
[ "org.w3c.dom.Element", "org.w3c.dom.NodeList" ]
import org.w3c.dom.Element; import org.w3c.dom.NodeList;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
752,700
@Override public void detectAndSendChanges() { super.detectAndSendChanges(); for (int i = 0; i < this.listeners.size(); ++i) { IContainerListener icontainerlistener = (IContainerListener)this.listeners.get(i); if (this.airshipBurnTime != this.airship.getField(0)) { icontainerlistener.sendProgressBarUpdate(this, 0, this.airship.getField(0)); } } this.airshipBurnTime = this.airship.getField(0); }
void function() { super.detectAndSendChanges(); for (int i = 0; i < this.listeners.size(); ++i) { IContainerListener icontainerlistener = (IContainerListener)this.listeners.get(i); if (this.airshipBurnTime != this.airship.getField(0)) { icontainerlistener.sendProgressBarUpdate(this, 0, this.airship.getField(0)); } } this.airshipBurnTime = this.airship.getField(0); }
/** * Looks for changes made in the container, sends them to every listener. */
Looks for changes made in the container, sends them to every listener
detectAndSendChanges
{ "repo_name": "Weisses/Ebonheart-Mods", "path": "ViesCraft/Archived/zzz - PreCapabilities - src/main/java/com/viesis/viescraft/common/entity/airshipcolors/containers/v1/ContainerAirshipV1Default.java", "license": "mit", "size": 3624 }
[ "net.minecraft.inventory.IContainerListener" ]
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.*;
[ "net.minecraft.inventory" ]
net.minecraft.inventory;
300,486
private NanoHTTPD.Response getDeviceAltitude() { Log.d(TAG, "altitude is " + altitude); return NanoHTTPD.newFixedLengthResponse( NanoHTTPD.Response.Status.OK, MIME_PLAINTEXT, Double.toString(altitude)); }
NanoHTTPD.Response function() { Log.d(TAG, STR + altitude); return NanoHTTPD.newFixedLengthResponse( NanoHTTPD.Response.Status.OK, MIME_PLAINTEXT, Double.toString(altitude)); }
/** * Gets the altitude of the device * * @return Altitute of device from gps */
Gets the altitude of the device
getDeviceAltitude
{ "repo_name": "BirdBrainTechnologies/BirdBlox-Android-Support", "path": "app/src/main/java/com/birdbraintechnologies/birdblox/httpservice/RequestHandlers/HostDeviceHandler.java", "license": "mit", "size": 22483 }
[ "android.util.Log", "fi.iki.elonen.NanoHTTPD" ]
import android.util.Log; import fi.iki.elonen.NanoHTTPD;
import android.util.*; import fi.iki.elonen.*;
[ "android.util", "fi.iki.elonen" ]
android.util; fi.iki.elonen;
516,020
for(Entry<String, WorkerState> entry : workers.entrySet()) { if( entry.getValue().status.isBusy()){ return false; } } return true; }
for(Entry<String, WorkerState> entry : workers.entrySet()) { if( entry.getValue().status.isBusy()){ return false; } } return true; }
/** * Verify that all workers has finished their work * @return boolean */
Verify that all workers has finished their work
noWorkerIsBusy
{ "repo_name": "awltech/karajan", "path": "karajan-parent/karajan-core/src/main/java/com/wordline/awltech/karajan/orchestrator/masterslavepullpattern/WorkManager.java", "license": "lgpl-3.0", "size": 6375 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
348,104
public void setImporting(boolean importing, List<DataObject> containers, boolean refreshTree, Object importResult) { if (model.getState() == DISCARDED) return; model.setImporting(importing, importResult); view.onImport(); if (!importing) indicateToRefresh(containers, refreshTree); firePropertyChange(IMPORT_PROPERTY, importing, !importing); }
void function(boolean importing, List<DataObject> containers, boolean refreshTree, Object importResult) { if (model.getState() == DISCARDED) return; model.setImporting(importing, importResult); view.onImport(); if (!importing) indicateToRefresh(containers, refreshTree); firePropertyChange(IMPORT_PROPERTY, importing, !importing); }
/** * Implemented as specified by the {@link TreeViewer} interface. * @see TreeViewer#setImporting(boolean, List, boolean, Object) */
Implemented as specified by the <code>TreeViewer</code> interface
setImporting
{ "repo_name": "stelfrich/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java", "license": "gpl-2.0", "size": 160473 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,584,290
public GenericResponse delete(String address) throws BlueviaException, IOException;
GenericResponse function(String address) throws BlueviaException, IOException;
/** * Creates a request using REST to the gSDP server in order to retrieve an entity from the server * * @param address the uri to create the entity remotely via REST * @return the response of the operation * @throws BlueviaException * @throws IOException */
Creates a request using REST to the gSDP server in order to retrieve an entity from the server
delete
{ "repo_name": "BlueVia/Official-Library-Android", "path": "library/src/com/bluevia/android/commons/connector/IConnector.java", "license": "lgpl-3.0", "size": 4977 }
[ "com.bluevia.android.commons.exception.BlueviaException", "java.io.IOException" ]
import com.bluevia.android.commons.exception.BlueviaException; import java.io.IOException;
import com.bluevia.android.commons.exception.*; import java.io.*;
[ "com.bluevia.android", "java.io" ]
com.bluevia.android; java.io;
94,843