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
CuratorFramework getClient() { return client; }
CuratorFramework getClient() { return client; }
/** * just for unit test * * @return */
just for unit test
getClient
{ "repo_name": "lovepoem/dubbo", "path": "dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java", "license": "apache-2.0", "size": 15887 }
[ "org.apache.curator.framework.CuratorFramework" ]
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.*;
[ "org.apache.curator" ]
org.apache.curator;
764,278
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYLineAndShapeRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYLineAndShapeRenderer that = (XYLineAndShapeRenderer) obj; if (!ObjectUtilities.equal(this.linesVisible, that.linesVisible)) { return false; } if (!ObjectUtilities.equal( this.seriesLinesVisible, that.seriesLinesVisible) ) { return false; } if (this.baseLinesVisible != that.baseLinesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (!ObjectUtilities.equal(this.shapesVisible, that.shapesVisible)) { return false; } if (!ObjectUtilities.equal( this.seriesShapesVisible, that.seriesShapesVisible) ) { return false; } if (this.baseShapesVisible != that.baseShapesVisible) { return false; } if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled)) { return false; } if (!ObjectUtilities.equal( this.seriesShapesFilled, that.seriesShapesFilled) ) { return false; } if (this.baseShapesFilled != that.baseShapesFilled) { return false; } if (this.drawOutlines != that.drawOutlines) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (this.useFillPaint != that.useFillPaint) { return false; } if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath) { return false; } return true; }
boolean function(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYLineAndShapeRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYLineAndShapeRenderer that = (XYLineAndShapeRenderer) obj; if (!ObjectUtilities.equal(this.linesVisible, that.linesVisible)) { return false; } if (!ObjectUtilities.equal( this.seriesLinesVisible, that.seriesLinesVisible) ) { return false; } if (this.baseLinesVisible != that.baseLinesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (!ObjectUtilities.equal(this.shapesVisible, that.shapesVisible)) { return false; } if (!ObjectUtilities.equal( this.seriesShapesVisible, that.seriesShapesVisible) ) { return false; } if (this.baseShapesVisible != that.baseShapesVisible) { return false; } if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled)) { return false; } if (!ObjectUtilities.equal( this.seriesShapesFilled, that.seriesShapesFilled) ) { return false; } if (this.baseShapesFilled != that.baseShapesFilled) { return false; } if (this.drawOutlines != that.drawOutlines) { return false; } if (this.useOutlinePaint != that.useOutlinePaint) { return false; } if (this.useFillPaint != that.useFillPaint) { return false; } if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath) { return false; } return true; }
/** * Tests this renderer for equality with an arbitrary object. * * @param obj the object ({@code null} permitted). * * @return {@code true} or {@code false}. */
Tests this renderer for equality with an arbitrary object
equals
{ "repo_name": "simon04/jfreechart", "path": "src/main/java/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java", "license": "lgpl-2.1", "size": 47113 }
[ "org.jfree.util.ObjectUtilities", "org.jfree.util.ShapeUtilities" ]
import org.jfree.util.ObjectUtilities; import org.jfree.util.ShapeUtilities;
import org.jfree.util.*;
[ "org.jfree.util" ]
org.jfree.util;
2,501,844
@SuppressWarnings("unchecked") public Calendar getCalendarByOrganisation(Integer organisationId) { logger.debug("getCalendarByOrganisation - START"); DetachedCriteria dc = DetachedCriteria.forEntityName(IModelConstant.calendarEntity); dc.add(Restrictions.eq("organisationId", organisationId)); List<Calendar> calendar = getHibernateTemplate().findByCriteria(dc); logger.debug("getCalendarByOrganisation - END "); return calendar.get(0); }
@SuppressWarnings(STR) Calendar function(Integer organisationId) { logger.debug(STR); DetachedCriteria dc = DetachedCriteria.forEntityName(IModelConstant.calendarEntity); dc.add(Restrictions.eq(STR, organisationId)); List<Calendar> calendar = getHibernateTemplate().findByCriteria(dc); logger.debug(STR); return calendar.get(0); }
/** * Get the calendar for an organisation, by the organisation's id * * @author Adelina * @param organisationId * @return the Calendar for the organisation */
Get the calendar for an organisation, by the organisation's id
getCalendarByOrganisation
{ "repo_name": "CodeSphere/termitaria", "path": "TermitariaOM/JavaSource/ro/cs/om/model/dao/impl/DaoCalendarImpl.java", "license": "agpl-3.0", "size": 3598 }
[ "java.util.List", "org.hibernate.criterion.DetachedCriteria", "org.hibernate.criterion.Restrictions", "ro.cs.om.common.IModelConstant", "ro.cs.om.entity.Calendar" ]
import java.util.List; import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.Restrictions; import ro.cs.om.common.IModelConstant; import ro.cs.om.entity.Calendar;
import java.util.*; import org.hibernate.criterion.*; import ro.cs.om.common.*; import ro.cs.om.entity.*;
[ "java.util", "org.hibernate.criterion", "ro.cs.om" ]
java.util; org.hibernate.criterion; ro.cs.om;
940,364
private void startFridgeClient() { PlatformConfig cfg = new PlatformConfig( this, // context ServiceType.IN_PROC, ModeType.CLIENT, "0.0.0.0", // bind to all available interfaces 0, QualityOfService.LOW); logMessage("Configuring platform"); OcPlatform.Configure(cfg); logMessage("Initiating fridge discovery"); try { OcPlatform.findResource("", OcPlatform.WELL_KNOWN_QUERY + "?rt=" + "intel.fridge", EnumSet.of(OcConnectivityType.CT_DEFAULT), this); } catch (OcException e) { logMessage(" Failed to discover resource"); Log.e(TAG, e.getMessage()); } logMessage("-----------------------------------------------------"); }
void function() { PlatformConfig cfg = new PlatformConfig( this, ServiceType.IN_PROC, ModeType.CLIENT, STR, 0, QualityOfService.LOW); logMessage(STR); OcPlatform.Configure(cfg); logMessage(STR); try { OcPlatform.findResource(STR?rt=STRintel.fridgeSTR Failed to discover resourceSTR-----------------------------------------------------"); }
/** * configure OIC platform and call findResource */
configure OIC platform and call findResource
startFridgeClient
{ "repo_name": "gerald-yang/ubuntu-iotivity-demo", "path": "iotivity-1.0.1/android/examples/fridgeclient/src/main/java/org/iotivity/base/examples/FridgeClient.java", "license": "apache-2.0", "size": 9696 }
[ "org.iotivity.base.ModeType", "org.iotivity.base.OcPlatform", "org.iotivity.base.PlatformConfig", "org.iotivity.base.QualityOfService", "org.iotivity.base.ServiceType" ]
import org.iotivity.base.ModeType; import org.iotivity.base.OcPlatform; import org.iotivity.base.PlatformConfig; import org.iotivity.base.QualityOfService; import org.iotivity.base.ServiceType;
import org.iotivity.base.*;
[ "org.iotivity.base" ]
org.iotivity.base;
2,009,435
public static HttpURLConnection getBlob(final URI uri, final BlobRequestOptions blobOptions, final OperationContext opContext, final AccessCondition accessCondition, final String snapshotVersion, final Long offset, final Long count, boolean requestRangeContentMD5) throws IOException, URISyntaxException, StorageException { if (offset != null && requestRangeContentMD5) { Utility.assertNotNull("count", count); Utility.assertInBounds("count", count, 1, Constants.MAX_BLOCK_SIZE); } final UriQueryBuilder builder = new UriQueryBuilder(); BlobRequest.addSnapshot(builder, snapshotVersion); final HttpURLConnection request = BaseRequest.createURLConnection(uri, blobOptions, builder, opContext); request.setRequestMethod(Constants.HTTP_GET); if (accessCondition != null) { accessCondition.applyConditionToRequest(request); } if (offset != null) { long rangeStart = offset; long rangeEnd; if (count != null) { rangeEnd = offset + count - 1; request.setRequestProperty(Constants.HeaderConstants.STORAGE_RANGE_HEADER, String.format( Utility.LOCALE_US, Constants.HeaderConstants.RANGE_HEADER_FORMAT, rangeStart, rangeEnd)); } else { request.setRequestProperty(Constants.HeaderConstants.STORAGE_RANGE_HEADER, String.format( Utility.LOCALE_US, Constants.HeaderConstants.BEGIN_RANGE_HEADER_FORMAT, rangeStart)); } } if (offset != null && requestRangeContentMD5) { request.setRequestProperty(Constants.HeaderConstants.RANGE_GET_CONTENT_MD5, Constants.TRUE); } return request; }
static HttpURLConnection function(final URI uri, final BlobRequestOptions blobOptions, final OperationContext opContext, final AccessCondition accessCondition, final String snapshotVersion, final Long offset, final Long count, boolean requestRangeContentMD5) throws IOException, URISyntaxException, StorageException { if (offset != null && requestRangeContentMD5) { Utility.assertNotNull("count", count); Utility.assertInBounds("count", count, 1, Constants.MAX_BLOCK_SIZE); } final UriQueryBuilder builder = new UriQueryBuilder(); BlobRequest.addSnapshot(builder, snapshotVersion); final HttpURLConnection request = BaseRequest.createURLConnection(uri, blobOptions, builder, opContext); request.setRequestMethod(Constants.HTTP_GET); if (accessCondition != null) { accessCondition.applyConditionToRequest(request); } if (offset != null) { long rangeStart = offset; long rangeEnd; if (count != null) { rangeEnd = offset + count - 1; request.setRequestProperty(Constants.HeaderConstants.STORAGE_RANGE_HEADER, String.format( Utility.LOCALE_US, Constants.HeaderConstants.RANGE_HEADER_FORMAT, rangeStart, rangeEnd)); } else { request.setRequestProperty(Constants.HeaderConstants.STORAGE_RANGE_HEADER, String.format( Utility.LOCALE_US, Constants.HeaderConstants.BEGIN_RANGE_HEADER_FORMAT, rangeStart)); } } if (offset != null && requestRangeContentMD5) { request.setRequestProperty(Constants.HeaderConstants.RANGE_GET_CONTENT_MD5, Constants.TRUE); } return request; }
/** * Constructs a HttpURLConnection to download the blob, Sign with no length specified. * * @param uri * A <code>java.net.URI</code> object that specifies the absolute URI. * @param blobOptions * A {@link BlobRequestOptions} object that specifies execution options such as retry policy and timeout * settings for the operation. Specify <code>null</code> to use the request options specified on the * {@link CloudBlobClient}. * @param opContext * An {@link OperationContext} object that represents the context for the current operation. This object * is used to track requests to the storage service, and to provide additional runtime information about * the operation. * @param accessCondition * An {@link AccessCondition} object that represents the access conditions for the blob. * @param snapshotVersion * The snapshot version, if the blob is a snapshot. * @param offset * The offset at which to begin returning content. * @param count * The number of bytes to return. * @param requestRangeContentMD5 * If set to true, request an MD5 header for the specified range. * @return a HttpURLConnection to use to perform the operation. * @throws IOException * if there is an error opening the connection * @throws URISyntaxException * if the resource URI is invalid * @throws StorageException * an exception representing any error which occurred during the operation. * @throws IllegalArgumentException */
Constructs a HttpURLConnection to download the blob, Sign with no length specified
getBlob
{ "repo_name": "dominicjprice/runspotrun-android-client", "path": "src/com/microsoft/azure/storage/blob/BlobRequest.java", "license": "agpl-3.0", "size": 73213 }
[ "com.microsoft.azure.storage.AccessCondition", "com.microsoft.azure.storage.Constants", "com.microsoft.azure.storage.OperationContext", "com.microsoft.azure.storage.StorageException", "com.microsoft.azure.storage.core.BaseRequest", "com.microsoft.azure.storage.core.UriQueryBuilder", "com.microsoft.azure.storage.core.Utility", "java.io.IOException", "java.net.HttpURLConnection", "java.net.URISyntaxException" ]
import com.microsoft.azure.storage.AccessCondition; import com.microsoft.azure.storage.Constants; import com.microsoft.azure.storage.OperationContext; import com.microsoft.azure.storage.StorageException; import com.microsoft.azure.storage.core.BaseRequest; import com.microsoft.azure.storage.core.UriQueryBuilder; import com.microsoft.azure.storage.core.Utility; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URISyntaxException;
import com.microsoft.azure.storage.*; import com.microsoft.azure.storage.core.*; import java.io.*; import java.net.*;
[ "com.microsoft.azure", "java.io", "java.net" ]
com.microsoft.azure; java.io; java.net;
1,849,776
public List<InjectionTargetType<PersistenceUnitRefType<T>>> getAllInjectionTarget() { List<InjectionTargetType<PersistenceUnitRefType<T>>> list = new ArrayList<InjectionTargetType<PersistenceUnitRefType<T>>>(); List<Node> nodeList = childNode.get("injection-target"); for(Node node: nodeList) { InjectionTargetType<PersistenceUnitRefType<T>> type = new InjectionTargetTypeImpl<PersistenceUnitRefType<T>>(this, "injection-target", childNode, node); list.add(type); } return list; }
List<InjectionTargetType<PersistenceUnitRefType<T>>> function() { List<InjectionTargetType<PersistenceUnitRefType<T>>> list = new ArrayList<InjectionTargetType<PersistenceUnitRefType<T>>>(); List<Node> nodeList = childNode.get(STR); for(Node node: nodeList) { InjectionTargetType<PersistenceUnitRefType<T>> type = new InjectionTargetTypeImpl<PersistenceUnitRefType<T>>(this, STR, childNode, node); list.add(type); } return list; }
/** * Returns all <code>injection-target</code> elements * @return list of <code>injection-target</code> */
Returns all <code>injection-target</code> elements
getAllInjectionTarget
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/javaee7/PersistenceUnitRefTypeImpl.java", "license": "epl-1.0", "size": 11000 }
[ "java.util.ArrayList", "java.util.List", "org.jboss.shrinkwrap.descriptor.api.javaee7.InjectionTargetType", "org.jboss.shrinkwrap.descriptor.api.javaee7.PersistenceUnitRefType", "org.jboss.shrinkwrap.descriptor.spi.node.Node" ]
import java.util.ArrayList; import java.util.List; import org.jboss.shrinkwrap.descriptor.api.javaee7.InjectionTargetType; import org.jboss.shrinkwrap.descriptor.api.javaee7.PersistenceUnitRefType; import org.jboss.shrinkwrap.descriptor.spi.node.Node;
import java.util.*; import org.jboss.shrinkwrap.descriptor.api.javaee7.*; import org.jboss.shrinkwrap.descriptor.spi.node.*;
[ "java.util", "org.jboss.shrinkwrap" ]
java.util; org.jboss.shrinkwrap;
2,272,867
@Test public void testUTCInstanceList() throws Exception { Calendar calendar = getCalendar("floating_recurr_event.ics"); TimeZone tz = TIMEZONE_REGISTRY.getTimeZone("America/New_York"); InstanceList instances = new InstanceList(); instances.setUTC(true); instances.setTimezone(tz); DateTime start = new DateTime("20060101T190000Z"); DateTime end = new DateTime("20060108T190000Z"); addToInstanceList(calendar, instances, start, end); Assert.assertEquals(5, instances.size()); @SuppressWarnings("unchecked") Iterator<String> keys = instances.keySet().iterator(); String key = null; Instance instance = null; key = keys.next(); instance = (Instance) instances.get(key); Assert.assertEquals("20060102T190000Z", key); Assert.assertEquals("20060102T190000Z", instance.getStart().toString()); Assert.assertEquals("20060102T200000Z", instance.getEnd().toString()); key = keys.next(); instance = (Instance) instances.get(key); Assert.assertEquals("20060103T190000Z", key); Assert.assertEquals("20060103T190000Z", instance.getStart().toString()); Assert.assertEquals("20060103T200000Z", instance.getEnd().toString()); key = keys.next(); instance = (Instance) instances.get(key); Assert.assertEquals("20060104T190000Z", key); Assert.assertEquals("20060104T210000Z", instance.getStart().toString()); Assert.assertEquals("20060104T220000Z", instance.getEnd().toString()); key = keys.next(); instance = (Instance) instances.get(key); Assert.assertEquals("20060105T190000Z", key); Assert.assertEquals("20060105T210000Z", instance.getStart().toString()); Assert.assertEquals("20060105T220000Z", instance.getEnd().toString()); key = keys.next(); instance = (Instance) instances.get(key); Assert.assertEquals("20060106T190000Z", key); Assert.assertEquals("20060106T190000Z", instance.getStart().toString()); Assert.assertEquals("20060106T200000Z", instance.getEnd().toString()); }
void function() throws Exception { Calendar calendar = getCalendar(STR); TimeZone tz = TIMEZONE_REGISTRY.getTimeZone(STR); InstanceList instances = new InstanceList(); instances.setUTC(true); instances.setTimezone(tz); DateTime start = new DateTime(STR); DateTime end = new DateTime(STR); addToInstanceList(calendar, instances, start, end); Assert.assertEquals(5, instances.size()); @SuppressWarnings(STR) Iterator<String> keys = instances.keySet().iterator(); String key = null; Instance instance = null; key = keys.next(); instance = (Instance) instances.get(key); Assert.assertEquals(STR, key); Assert.assertEquals(STR, instance.getStart().toString()); Assert.assertEquals(STR, instance.getEnd().toString()); key = keys.next(); instance = (Instance) instances.get(key); Assert.assertEquals(STR, key); Assert.assertEquals(STR, instance.getStart().toString()); Assert.assertEquals(STR, instance.getEnd().toString()); key = keys.next(); instance = (Instance) instances.get(key); Assert.assertEquals(STR, key); Assert.assertEquals(STR, instance.getStart().toString()); Assert.assertEquals(STR, instance.getEnd().toString()); key = keys.next(); instance = (Instance) instances.get(key); Assert.assertEquals(STR, key); Assert.assertEquals(STR, instance.getStart().toString()); Assert.assertEquals(STR, instance.getEnd().toString()); key = keys.next(); instance = (Instance) instances.get(key); Assert.assertEquals(STR, key); Assert.assertEquals(STR, instance.getStart().toString()); Assert.assertEquals(STR, instance.getEnd().toString()); }
/** * Tests UTC Instance list. * * @throws Exception - if something is wrong this exception is thrown. */
Tests UTC Instance list
testUTCInstanceList
{ "repo_name": "Eisler/cosmo", "path": "cosmo-core/src/test/unit/java/org/unitedinternet/cosmo/calendar/InstanceListTest.java", "license": "apache-2.0", "size": 42929 }
[ "java.util.Iterator", "net.fortuna.ical4j.model.Calendar", "net.fortuna.ical4j.model.DateTime", "net.fortuna.ical4j.model.TimeZone", "org.junit.Assert" ]
import java.util.Iterator; import net.fortuna.ical4j.model.Calendar; import net.fortuna.ical4j.model.DateTime; import net.fortuna.ical4j.model.TimeZone; import org.junit.Assert;
import java.util.*; import net.fortuna.ical4j.model.*; import org.junit.*;
[ "java.util", "net.fortuna.ical4j", "org.junit" ]
java.util; net.fortuna.ical4j; org.junit;
2,915,429
public Connection getConnection() { return connection; }
Connection function() { return connection; }
/** * Returns the connection to the DBMS. The user is responsible for closing it. * * @return * a connection * @see Connection */
Returns the connection to the DBMS. The user is responsible for closing it
getConnection
{ "repo_name": "dbgroup-at-ucsc/dbtune", "path": "src/edu/ucsc/dbtune/DatabaseSystem.java", "license": "bsd-3-clause", "size": 14370 }
[ "java.sql.Connection" ]
import java.sql.Connection;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,335,044
@VisibleForTesting public static void overrideNotificationManagerForTesting( NotificationManagerProxy notificationManager) { sNotificationManagerOverride = notificationManager; } private NotificationUIManager(long nativeNotificationManager, Context context) { mNativeNotificationManager = nativeNotificationManager; mAppContext = context.getApplicationContext(); if (sNotificationManagerOverride != null) { mNotificationManager = sNotificationManagerOverride; } else { mNotificationManager = new NotificationManagerProxyImpl( (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)); } }
static void function( NotificationManagerProxy notificationManager) { sNotificationManagerOverride = notificationManager; } private NotificationUIManager(long nativeNotificationManager, Context context) { mNativeNotificationManager = nativeNotificationManager; mAppContext = context.getApplicationContext(); if (sNotificationManagerOverride != null) { mNotificationManager = sNotificationManagerOverride; } else { mNotificationManager = new NotificationManagerProxyImpl( (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)); } }
/** * Overrides the notification manager which is to be used for displaying Notifications on the * Android framework. Should only be used for testing. Tests are expected to clean up after * themselves by setting this to NULL again. * * @param proxy The notification manager instance to use instead of the system's. */
Overrides the notification manager which is to be used for displaying Notifications on the Android framework. Should only be used for testing. Tests are expected to clean up after themselves by setting this to NULL again
overrideNotificationManagerForTesting
{ "repo_name": "Pluto-tv/chromium-crosswalk", "path": "chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUIManager.java", "license": "bsd-3-clause", "size": 24405 }
[ "android.app.NotificationManager", "android.content.Context" ]
import android.app.NotificationManager; import android.content.Context;
import android.app.*; import android.content.*;
[ "android.app", "android.content" ]
android.app; android.content;
2,863,596
public ActionListener[] getActionListeners() { return (ActionListener[]) listenerList.getListeners(ActionListener.class); }
ActionListener[] function() { return (ActionListener[]) listenerList.getListeners(ActionListener.class); }
/** * Returns all added <code>ActionListener</code> objects. * * @return an array of listeners * * @since 1.4 */
Returns all added <code>ActionListener</code> objects
getActionListeners
{ "repo_name": "taciano-perez/JamVM-PH", "path": "src/classpath/javax/swing/AbstractButton.java", "license": "gpl-2.0", "size": 82806 }
[ "java.awt.event.ActionListener" ]
import java.awt.event.ActionListener;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
524,480
private void createSeparator(Composite root, String text, int span) { ComponentTitledSeparator separator = new ComponentTitledSeparator(root, SWT.NONE); GridData data = SWTUtil.createFillHorizontallyGridData(true, span); data.horizontalIndent = 0; data.verticalIndent = 0; separator.setLayoutData(data); separator.setText(text); }
void function(Composite root, String text, int span) { ComponentTitledSeparator separator = new ComponentTitledSeparator(root, SWT.NONE); GridData data = SWTUtil.createFillHorizontallyGridData(true, span); data.horizontalIndent = 0; data.verticalIndent = 0; separator.setLayoutData(data); separator.setText(text); }
/** * Creates a separator * @param root * @param text * @param span */
Creates a separator
createSeparator
{ "repo_name": "RaffaelBild/arx", "path": "src/gui/org/deidentifier/arx/gui/view/impl/common/ComponentRiskThresholds.java", "license": "apache-2.0", "size": 9482 }
[ "org.deidentifier.arx.gui.view.SWTUtil", "org.eclipse.swt.layout.GridData", "org.eclipse.swt.widgets.Composite" ]
import org.deidentifier.arx.gui.view.SWTUtil; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite;
import org.deidentifier.arx.gui.view.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*;
[ "org.deidentifier.arx", "org.eclipse.swt" ]
org.deidentifier.arx; org.eclipse.swt;
2,814,174
public void start(BundleContext context) throws Exception { m_connectorService = new ConnectorServiceImpl(context); context.registerService(ConnectorService.class.getName(), m_connectorService, null); }
void function(BundleContext context) throws Exception { m_connectorService = new ConnectorServiceImpl(context); context.registerService(ConnectorService.class.getName(), m_connectorService, null); }
/** * Called when IO Connector bundle is started. Creates and registers IO Connector Service. * * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) */
Called when IO Connector bundle is started. Creates and registers IO Connector Service
start
{ "repo_name": "boneman1231/org.apache.felix", "path": "trunk/io/src/main/java/org/apache/felix/io/Activator.java", "license": "apache-2.0", "size": 2291 }
[ "org.osgi.framework.BundleContext", "org.osgi.service.io.ConnectorService" ]
import org.osgi.framework.BundleContext; import org.osgi.service.io.ConnectorService;
import org.osgi.framework.*; import org.osgi.service.io.*;
[ "org.osgi.framework", "org.osgi.service" ]
org.osgi.framework; org.osgi.service;
569,664
EClass getAnyValueType();
EClass getAnyValueType();
/** * Returns the meta object for class '{@link net.opengis.ows11.AnyValueType <em>Any Value Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Any Value Type</em>'. * @see net.opengis.ows11.AnyValueType * @generated */
Returns the meta object for class '<code>net.opengis.ows11.AnyValueType Any Value Type</code>'.
getAnyValueType
{ "repo_name": "geotools/geotools", "path": "modules/ogc/net.opengis.ows/src/net/opengis/ows11/Ows11Package.java", "license": "lgpl-2.1", "size": 292282 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,256,791
private void updateAwayInPrivChats(final boolean away) { final UserList list = controller.getUserList(); for (int i = 0; i < list.size(); i++) { final User user = list.get(i); if (user.getPrivchat() != null) { user.getPrivchat().updateAwayState(); if (away) { msgController.showPrivateSystemMessage(user, swingMessages.getMessage( "swing.privateChat.systemMessage.wentAway", me.getAwayMsg())); } else { msgController.showPrivateSystemMessage(user, swingMessages.getMessage( "swing.privateChat.systemMessage.cameBack")); } } } }
void function(final boolean away) { final UserList list = controller.getUserList(); for (int i = 0; i < list.size(); i++) { final User user = list.get(i); if (user.getPrivchat() != null) { user.getPrivchat().updateAwayState(); if (away) { msgController.showPrivateSystemMessage(user, swingMessages.getMessage( STR, me.getAwayMsg())); } else { msgController.showPrivateSystemMessage(user, swingMessages.getMessage( STR)); } } } }
/** * Notifies the open private chat windows that the away state has changed. * * @param away If the user is away. */
Notifies the open private chat windows that the away state has changed
updateAwayInPrivChats
{ "repo_name": "yuchaosydney/kouchat", "path": "src/main/java/net/usikkert/kouchat/ui/swing/SwingMediator.java", "license": "gpl-3.0", "size": 31412 }
[ "net.usikkert.kouchat.misc.User", "net.usikkert.kouchat.misc.UserList" ]
import net.usikkert.kouchat.misc.User; import net.usikkert.kouchat.misc.UserList;
import net.usikkert.kouchat.misc.*;
[ "net.usikkert.kouchat" ]
net.usikkert.kouchat;
1,677,415
@Override public Property getItemProperty(Object id) { final Field<?> field = fields.get(id); if (field == null) { // field does not exist or it is not (yet) created for this property return ownProperties.get(id); } final Property<?> property = field.getPropertyDataSource(); if (property != null) { return property; } else { return field; } }
Property function(Object id) { final Field<?> field = fields.get(id); if (field == null) { return ownProperties.get(id); } final Property<?> property = field.getPropertyDataSource(); if (property != null) { return property; } else { return field; } }
/** * The property identified by the property id. * * <p> * The property data source of the field specified with property id is * returned. If there is a (with specified property id) having no data * source, the field is returned instead of the data source. * </p> * * @see Item#getItemProperty(Object) */
The property identified by the property id. The property data source of the field specified with property id is returned. If there is a (with specified property id) having no data source, the field is returned instead of the data source.
getItemProperty
{ "repo_name": "peterl1084/framework", "path": "compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java", "license": "apache-2.0", "size": 44414 }
[ "com.vaadin.v7.data.Property" ]
import com.vaadin.v7.data.Property;
import com.vaadin.v7.data.*;
[ "com.vaadin.v7" ]
com.vaadin.v7;
149,483
public void updateRef(String ref, ReceiveCommand.Type type, String oldId, String newId) { if (!refUpdates.containsKey(ref)) { refUpdates.put(ref, type); refIdChanges.put(ref, oldId + "-" + newId); } }
void function(String ref, ReceiveCommand.Type type, String oldId, String newId) { if (!refUpdates.containsKey(ref)) { refUpdates.put(ref, type); refIdChanges.put(ref, oldId + "-" + newId); } }
/** * Tracks the change type for the specified ref. * * @param ref * @param type * @param oldId * @param newId */
Tracks the change type for the specified ref
updateRef
{ "repo_name": "heavenlyhash/gitblit", "path": "src/main/java/com/gitblit/models/PushLogEntry.java", "license": "apache-2.0", "size": 8790 }
[ "org.eclipse.jgit.transport.ReceiveCommand" ]
import org.eclipse.jgit.transport.ReceiveCommand;
import org.eclipse.jgit.transport.*;
[ "org.eclipse.jgit" ]
org.eclipse.jgit;
671,260
public LearningActivityTry[] findByact_PrevAndNext(long latId, long actId, OrderByComparator orderByComparator) throws NoSuchLearningActivityTryException, SystemException { LearningActivityTry learningActivityTry = findByPrimaryKey(latId); Session session = null; try { session = openSession(); LearningActivityTry[] array = new LearningActivityTryImpl[3]; array[0] = getByact_PrevAndNext(session, learningActivityTry, actId, orderByComparator, true); array[1] = learningActivityTry; array[2] = getByact_PrevAndNext(session, learningActivityTry, actId, orderByComparator, false); return array; } catch (Exception e) { throw processException(e); } finally { closeSession(session); } }
LearningActivityTry[] function(long latId, long actId, OrderByComparator orderByComparator) throws NoSuchLearningActivityTryException, SystemException { LearningActivityTry learningActivityTry = findByPrimaryKey(latId); Session session = null; try { session = openSession(); LearningActivityTry[] array = new LearningActivityTryImpl[3]; array[0] = getByact_PrevAndNext(session, learningActivityTry, actId, orderByComparator, true); array[1] = learningActivityTry; array[2] = getByact_PrevAndNext(session, learningActivityTry, actId, orderByComparator, false); return array; } catch (Exception e) { throw processException(e); } finally { closeSession(session); } }
/** * Returns the learning activity tries before and after the current learning activity try in the ordered set where actId = &#63;. * * @param latId the primary key of the current learning activity try * @param actId the act ID * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the previous, current, and next learning activity try * @throws com.liferay.lms.NoSuchLearningActivityTryException if a learning activity try with the primary key could not be found * @throws SystemException if a system exception occurred */
Returns the learning activity tries before and after the current learning activity try in the ordered set where actId = &#63;
findByact_PrevAndNext
{ "repo_name": "TelefonicaED/liferaylms-portlet", "path": "docroot/WEB-INF/src/com/liferay/lms/service/persistence/LearningActivityTryPersistenceImpl.java", "license": "agpl-3.0", "size": 155464 }
[ "com.liferay.lms.NoSuchLearningActivityTryException", "com.liferay.lms.model.LearningActivityTry", "com.liferay.lms.model.impl.LearningActivityTryImpl", "com.liferay.portal.kernel.dao.orm.Session", "com.liferay.portal.kernel.exception.SystemException", "com.liferay.portal.kernel.util.OrderByComparator" ]
import com.liferay.lms.NoSuchLearningActivityTryException; import com.liferay.lms.model.LearningActivityTry; import com.liferay.lms.model.impl.LearningActivityTryImpl; import com.liferay.portal.kernel.dao.orm.Session; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.lms.*; import com.liferay.lms.model.*; import com.liferay.lms.model.impl.*; import com.liferay.portal.kernel.dao.orm.*; import com.liferay.portal.kernel.exception.*; import com.liferay.portal.kernel.util.*;
[ "com.liferay.lms", "com.liferay.portal" ]
com.liferay.lms; com.liferay.portal;
544,685
protected void actionPerformed(GuiButton button) throws IOException { if (button.id == 0) { this.cancel = true; if (this.networkManager != null) { this.networkManager.closeChannel(new TextComponentString("Aborted")); } this.mc.displayGuiScreen(this.previousGuiScreen); } }
void function(GuiButton button) throws IOException { if (button.id == 0) { this.cancel = true; if (this.networkManager != null) { this.networkManager.closeChannel(new TextComponentString(STR)); } this.mc.displayGuiScreen(this.previousGuiScreen); } }
/** * Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */
Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
actionPerformed
{ "repo_name": "SuperUnitato/UnLonely", "path": "build/tmp/recompileMc/sources/net/minecraft/client/multiplayer/GuiConnecting.java", "license": "lgpl-2.1", "size": 6885 }
[ "java.io.IOException", "net.minecraft.client.gui.GuiButton", "net.minecraft.util.text.TextComponentString" ]
import java.io.IOException; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.text.TextComponentString;
import java.io.*; import net.minecraft.client.gui.*; import net.minecraft.util.text.*;
[ "java.io", "net.minecraft.client", "net.minecraft.util" ]
java.io; net.minecraft.client; net.minecraft.util;
2,295,344
private boolean forwardMatch(String match, boolean ignoreCase, boolean skipLeadingWhitespace, boolean resetOnTrue) throws IOException { Mark mark = reader.mark(); List<Integer> cbuf = Lists.newArrayList(); StringBuilder builder = new StringBuilder(); boolean result = true; boolean seenChar = false; while (true) { cbuf.add(reader.next()); char ch = (char) reader.curChar; if (reader.curChar == -1) { result = false; break; } else if (WHITESPACE.matches(ch)) { if (seenChar) { builder.append(ch); } } else { if (builder.length() == 0) { seenChar = true; } builder.append(ch); int index = builder.length() - 1; if (!ignoreCase && (builder.charAt(index) == match.charAt(index))) { result = false; break; } if (ignoreCase && (Ascii.toLowerCase(builder.charAt(index)) != Ascii .toLowerCase(match.charAt(index)))) { result = false; break; } } if (builder.length() == match.length()) { if (!match.equalsIgnoreCase(builder.toString())) { result = false; } break; } } if (!result || resetOnTrue) { reader.unread(cbuf, mark); } return result; }
boolean function(String match, boolean ignoreCase, boolean skipLeadingWhitespace, boolean resetOnTrue) throws IOException { Mark mark = reader.mark(); List<Integer> cbuf = Lists.newArrayList(); StringBuilder builder = new StringBuilder(); boolean result = true; boolean seenChar = false; while (true) { cbuf.add(reader.next()); char ch = (char) reader.curChar; if (reader.curChar == -1) { result = false; break; } else if (WHITESPACE.matches(ch)) { if (seenChar) { builder.append(ch); } } else { if (builder.length() == 0) { seenChar = true; } builder.append(ch); int index = builder.length() - 1; if (!ignoreCase && (builder.charAt(index) == match.charAt(index))) { result = false; break; } if (ignoreCase && (Ascii.toLowerCase(builder.charAt(index)) != Ascii .toLowerCase(match.charAt(index)))) { result = false; break; } } if (builder.length() == match.length()) { if (!match.equalsIgnoreCase(builder.toString())) { result = false; } break; } } if (!result resetOnTrue) { reader.unread(cbuf, mark); } return result; }
/** * Check if a forward scan will equal given match string * * @param match * The string to match * @param ignoreCase * Whether case should be ignored * @param skipLeadingWhitespace * Whether initial whitespace should be ignored in the stream * that match is compared to * @param resetOnTrue * Whether the reader should be reset on found match * @throws IOException */
Check if a forward scan will equal given match string
forwardMatch
{ "repo_name": "tectronics/epubcheck", "path": "src/main/java/org/idpf/epubcheck/util/css/CssScanner.java", "license": "mit", "size": 31370 }
[ "com.google.common.base.Ascii", "com.google.common.collect.Lists", "java.io.IOException", "java.util.List", "org.idpf.epubcheck.util.css.CssReader" ]
import com.google.common.base.Ascii; import com.google.common.collect.Lists; import java.io.IOException; import java.util.List; import org.idpf.epubcheck.util.css.CssReader;
import com.google.common.base.*; import com.google.common.collect.*; import java.io.*; import java.util.*; import org.idpf.epubcheck.util.css.*;
[ "com.google.common", "java.io", "java.util", "org.idpf.epubcheck" ]
com.google.common; java.io; java.util; org.idpf.epubcheck;
2,833,232
public static java.util.List extractPatientMeetingList(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.PatientMeetingVoCollection voCollection) { return extractPatientMeetingList(domainFactory, voCollection, null, new HashMap()); }
static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.PatientMeetingVoCollection voCollection) { return extractPatientMeetingList(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.clinical.domain.objects.PatientMeeting list from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.clinical.domain.objects.PatientMeeting list from the value object collection
extractPatientMeetingList
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/clinical/vo/domain/PatientMeetingVoAssembler.java", "license": "agpl-3.0", "size": 23503 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,194,378
private UploadResultView handlePreviousVersionUploadResult(String input) { UploadResultView uploadResult = null; try { uploadResult = gson.fromJson(input, UploadResultView.class); if (uploadResult != null) { return uploadResult; } } catch (JsonSyntaxException e) { e.printStackTrace(); } return emptyUploadResult(); }
UploadResultView function(String input) { UploadResultView uploadResult = null; try { uploadResult = gson.fromJson(input, UploadResultView.class); if (uploadResult != null) { return uploadResult; } } catch (JsonSyntaxException e) { e.printStackTrace(); } return emptyUploadResult(); }
/** * Temporarily handle the Upload result to make it compatible * with older interfaces. * @param input json string with older format * @return uploadresultview */
Temporarily handle the Upload result to make it compatible with older interfaces
handlePreviousVersionUploadResult
{ "repo_name": "hrohmer/vorto", "path": "bundles/org.eclipse.vorto.repository/src/org/eclipse/vorto/repository/function/StringToUploadResult.java", "license": "epl-1.0", "size": 2505 }
[ "com.google.gson.JsonSyntaxException", "org.eclipse.vorto.repository.model.UploadResultView" ]
import com.google.gson.JsonSyntaxException; import org.eclipse.vorto.repository.model.UploadResultView;
import com.google.gson.*; import org.eclipse.vorto.repository.model.*;
[ "com.google.gson", "org.eclipse.vorto" ]
com.google.gson; org.eclipse.vorto;
2,659,676
@Test public void whenClientDisconnectionDetectedThenTestIsInterrupted() throws InterruptedException, IOException { // Sub process interruption not supported on Windows. assumeTrue(Platform.detect() != Platform.WINDOWS); final long timeoutMillis = 2000; // Stream timeout > test timeout. final long disconnectMillis = 100; // Disconnect before test timeout. final ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario( this, "exclusive_execution", tmp); workspace.setUp(); // Start with an input stream that sends heartbeats at a regular rate. final DelegatingInputStream inputStream = new DelegatingInputStream( TestContext.createHeartBeatStream(timeoutMillis / 10));
void function() throws InterruptedException, IOException { assumeTrue(Platform.detect() != Platform.WINDOWS); final long timeoutMillis = 2000; final long disconnectMillis = 100; final ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario( this, STR, tmp); workspace.setUp(); final DelegatingInputStream inputStream = new DelegatingInputStream( TestContext.createHeartBeatStream(timeoutMillis / 10));
/** * This verifies that a client disconnection will be detected by a Nailgun * NGInputStream reading from an empty heartbeat stream and that the generated * InterruptedException will interrupt command execution causing it to fail. */
This verifies that a client disconnection will be detected by a Nailgun NGInputStream reading from an empty heartbeat stream and that the generated InterruptedException will interrupt command execution causing it to fail
whenClientDisconnectionDetectedThenTestIsInterrupted
{ "repo_name": "mikekap/buck", "path": "test/com/facebook/buck/cli/DaemonIntegrationTest.java", "license": "apache-2.0", "size": 22609 }
[ "com.facebook.buck.testutil.integration.DelegatingInputStream", "com.facebook.buck.testutil.integration.ProjectWorkspace", "com.facebook.buck.testutil.integration.TestContext", "com.facebook.buck.testutil.integration.TestDataHelper", "com.facebook.buck.util.environment.Platform", "java.io.IOException", "org.junit.Assume" ]
import com.facebook.buck.testutil.integration.DelegatingInputStream; import com.facebook.buck.testutil.integration.ProjectWorkspace; import com.facebook.buck.testutil.integration.TestContext; import com.facebook.buck.testutil.integration.TestDataHelper; import com.facebook.buck.util.environment.Platform; import java.io.IOException; import org.junit.Assume;
import com.facebook.buck.testutil.integration.*; import com.facebook.buck.util.environment.*; import java.io.*; import org.junit.*;
[ "com.facebook.buck", "java.io", "org.junit" ]
com.facebook.buck; java.io; org.junit;
922,083
public void encode(OutputStream output) { encode(output, new Indenter(0)); }
void function(OutputStream output) { encode(output, new Indenter(0)); }
/** * Encodes this <code>Policy</code> into its XML representation and writes * this encoding to the given <code>OutputStream</code> with no * indentation. * * @param output a stream into which the XML-encoded data is written */
Encodes this <code>Policy</code> into its XML representation and writes this encoding to the given <code>OutputStream</code> with no indentation
encode
{ "repo_name": "townbull/mtaaas", "path": "src/sunxacml/com/sun/xacml/Policy.java", "license": "apache-2.0", "size": 11611 }
[ "java.io.OutputStream" ]
import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,301,952
private CourseRegistration findExistingCourseReservation(CourseRegistration courseReg) { // lookup the list of stored reservation for the duplicate one List<CourseRegistration> allCourseRegistration; allCourseRegistration = this.getAllCourseRegistrations(); if (allCourseRegistration == null) { // Not found return null; } Iterator<CourseRegistration> it = allCourseRegistration.iterator(); while (it.hasNext()) { CourseRegistration currCR = it.next(); if ((currCR.getCourseId().toString()+ currCR.getGplusId()) .equalsIgnoreCase(courseReg.getCourseId().toString()+ courseReg.getGplusId())) { return currCR; } } return null; }
CourseRegistration function(CourseRegistration courseReg) { List<CourseRegistration> allCourseRegistration; allCourseRegistration = this.getAllCourseRegistrations(); if (allCourseRegistration == null) { return null; } Iterator<CourseRegistration> it = allCourseRegistration.iterator(); while (it.hasNext()) { CourseRegistration currCR = it.next(); if ((currCR.getCourseId().toString()+ currCR.getGplusId()) .equalsIgnoreCase(courseReg.getCourseId().toString()+ courseReg.getGplusId())) { return currCR; } } return null; }
/** * Helper method to identify of CourseRegistration is already exists * * @param courseReg object * @return courseReg if already exists, or null if not found */
Helper method to identify of CourseRegistration is already exists
findExistingCourseReservation
{ "repo_name": "lingolearn/lingolearn", "path": "src/cscie99/team2/lingolearn/server/datastore/CourseRegistrationDAO.java", "license": "mit", "size": 5827 }
[ "java.util.Iterator", "java.util.List" ]
import java.util.Iterator; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
39,338
protected Logger getLogger() { return this.log; }
Logger function() { return this.log; }
/** * Returns {@link Logger}. * * @return the logger */
Returns <code>Logger</code>
getLogger
{ "repo_name": "dobrakmato/pexel-platform", "path": "commons/src/main/java/eu/matejkormuth/pexel/network/MasterServer.java", "license": "gpl-3.0", "size": 6756 }
[ "org.slf4j.Logger" ]
import org.slf4j.Logger;
import org.slf4j.*;
[ "org.slf4j" ]
org.slf4j;
304,419
boolean result = lineDepartment != null && lineDepartment.length() > 0; if (result) { String[] heads = lineDepartment.split(prefix); TreeSet<Department> linkTree = this.department.subDepartments; while (heads.length > 0) { Department department = new Department(heads[0]); if (!linkTree.contains(department)) { linkTree.add(department); } linkTree = linkTree.floor(department).subDepartments; heads = Arrays.copyOfRange(heads, 1, heads.length); } } return result; }
boolean result = lineDepartment != null && lineDepartment.length() > 0; if (result) { String[] heads = lineDepartment.split(prefix); TreeSet<Department> linkTree = this.department.subDepartments; while (heads.length > 0) { Department department = new Department(heads[0]); if (!linkTree.contains(department)) { linkTree.add(department); } linkTree = linkTree.floor(department).subDepartments; heads = Arrays.copyOfRange(heads, 1, heads.length); } } return result; }
/** * The method add new department to book (base). * * @param lineDepartment - full way departments; * @return true - is add; false - is no add; */
The method add new department to book (base)
addDepartment
{ "repo_name": "ArtemFM/JavaJunior", "path": "lesson03/test_task_lesson03/src/main/java/apavlov/BookDepartments.java", "license": "apache-2.0", "size": 4631 }
[ "java.util.Arrays", "java.util.TreeSet" ]
import java.util.Arrays; import java.util.TreeSet;
import java.util.*;
[ "java.util" ]
java.util;
716,133
public Set<String> getCustom() { return custom; }
Set<String> function() { return custom; }
/** * Returns Ids of the custom widgets. * * @return Set of IDs of the custom widgets */
Returns Ids of the custom widgets
getCustom
{ "repo_name": "wso2/carbon-dashboards", "path": "components/dashboards/org.wso2.carbon.dashboards.core/src/main/java/org/wso2/carbon/dashboards/core/bean/importer/WidgetCollection.java", "license": "apache-2.0", "size": 1858 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,793,437
public ObjectValue getIterator();
ObjectValue function();
/** * Returns the iterator. */
Returns the iterator
getIterator
{ "repo_name": "christianchristensen/resin", "path": "modules/quercus/src/com/caucho/quercus/lib/spl/IteratorAggregate.java", "license": "gpl-2.0", "size": 1332 }
[ "com.caucho.quercus.env.ObjectValue" ]
import com.caucho.quercus.env.ObjectValue;
import com.caucho.quercus.env.*;
[ "com.caucho.quercus" ]
com.caucho.quercus;
1,743,816
public void removeAndReconnect(E node) throws PlanException { List<E> preds = getPredecessors(node); E pred = null; if (preds != null) { if (preds.size() > 1) { int errCode = 1095; String msg = "Attempt to remove " + " and reconnect for node with multiple predecessors."; PlanException pe = new PlanException(msg, errCode, PigException.INPUT); throw pe; } pred = preds.get(0); disconnect(pred, node); } int oldPos = -1; int newPos = -1; List<E> succs = getSuccessors(node); E succ = null; if (succs != null) { if (succs.size() > 1) { int errCode = 1095; String msg = "Attempt to remove " + " and reconnect for node with multiple successors."; PlanException pe = new PlanException(msg, errCode, PigException.INPUT); throw pe; } succ = succs.get(0); List<E> plst = getPredecessors(succ); for (int i=0; i<plst.size(); i++) { if (plst.get(i).equals(node)) { oldPos = i; } } disconnect(node, succ); } remove(node); if (pred != null && succ != null) { connect(pred, succ); List<E> plst = getPredecessors(succ); for (int i=0; i<plst.size(); i++) { if (plst.get(i).equals(pred)) { newPos = i; } } if (oldPos < 0 || newPos < 0) { throw new PlanException("Invalid position index: " + oldPos + " : " + newPos); } if (oldPos != newPos) { List<E> nlst = new ArrayList<E>(); for (int i=0; i<plst.size(); i++) { E nod = plst.get(i); if (i == oldPos) { nlst.add(pred); } if (i == newPos) continue; nlst.add(nod); } if (nlst.size() != plst.size()) { throw new PlanException("Invalid list size: " + nlst.size() + " : " + plst.size()); } mToEdges.removeKey(succ); mToEdges.put(succ, nlst); } succ.rewire(node, oldPos, pred, true); } }
void function(E node) throws PlanException { List<E> preds = getPredecessors(node); E pred = null; if (preds != null) { if (preds.size() > 1) { int errCode = 1095; String msg = STR + STR; PlanException pe = new PlanException(msg, errCode, PigException.INPUT); throw pe; } pred = preds.get(0); disconnect(pred, node); } int oldPos = -1; int newPos = -1; List<E> succs = getSuccessors(node); E succ = null; if (succs != null) { if (succs.size() > 1) { int errCode = 1095; String msg = STR + STR; PlanException pe = new PlanException(msg, errCode, PigException.INPUT); throw pe; } succ = succs.get(0); List<E> plst = getPredecessors(succ); for (int i=0; i<plst.size(); i++) { if (plst.get(i).equals(node)) { oldPos = i; } } disconnect(node, succ); } remove(node); if (pred != null && succ != null) { connect(pred, succ); List<E> plst = getPredecessors(succ); for (int i=0; i<plst.size(); i++) { if (plst.get(i).equals(pred)) { newPos = i; } } if (oldPos < 0 newPos < 0) { throw new PlanException(STR + oldPos + STR + newPos); } if (oldPos != newPos) { List<E> nlst = new ArrayList<E>(); for (int i=0; i<plst.size(); i++) { E nod = plst.get(i); if (i == oldPos) { nlst.add(pred); } if (i == newPos) continue; nlst.add(nod); } if (nlst.size() != plst.size()) { throw new PlanException(STR + nlst.size() + STR + plst.size()); } mToEdges.removeKey(succ); mToEdges.put(succ, nlst); } succ.rewire(node, oldPos, pred, true); } }
/** * Remove a node in a way that connects the node's predecessor (if any) * with the node's successor (if any). This function does not handle the * case where the node has multiple predecessors or successors. * @param node Node to be removed * @throws PlanException if the node has more than one predecessor or * successor. */
Remove a node in a way that connects the node's predecessor (if any) with the node's successor (if any). This function does not handle the case where the node has multiple predecessors or successors
removeAndReconnect
{ "repo_name": "daijyc/pig", "path": "src/org/apache/pig/impl/plan/OperatorPlan.java", "license": "apache-2.0", "size": 59864 }
[ "java.util.ArrayList", "java.util.List", "org.apache.pig.PigException" ]
import java.util.ArrayList; import java.util.List; import org.apache.pig.PigException;
import java.util.*; import org.apache.pig.*;
[ "java.util", "org.apache.pig" ]
java.util; org.apache.pig;
771,512
public Component getExecutionFeedback() throws SchedulingException;
Component function() throws SchedulingException;
/** * Vraca panel za custom prikaz tijeka izvodenja. */
Vraca panel za custom prikaz tijeka izvodenja
getExecutionFeedback
{ "repo_name": "KarloKnezevic/Ferko", "path": "src/java/hr/fer/zemris/util/scheduling/support/ISchedulingAlgorithm.java", "license": "apache-2.0", "size": 1552 }
[ "java.awt.Component" ]
import java.awt.Component;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,783,897
EClass getPoint();
EClass getPoint();
/** * Returns the meta object for class '{@link gluemodel.substationStandard.Dataclasses.Point <em>Point</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Point</em>'. * @see gluemodel.substationStandard.Dataclasses.Point * @generated */
Returns the meta object for class '<code>gluemodel.substationStandard.Dataclasses.Point Point</code>'.
getPoint
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/eMoflon/rgse.ttc17.metamodels.src/src/gluemodel/substationStandard/Dataclasses/DataclassesPackage.java", "license": "mit", "size": 381891 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,297,546
private static void setLookAndFeel() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException ex) { Logger.getLogger(Editor.class.getName()).log(Level.SEVERE, null, ex); } catch (InstantiationException ex) { Logger.getLogger(Editor.class.getName()).log(Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { Logger.getLogger(Editor.class.getName()).log(Level.SEVERE, null, ex); } catch (UnsupportedLookAndFeelException ex) { Logger.getLogger(Editor.class.getName()).log(Level.SEVERE, null, ex); } } // private static JMenuBar createMenuBar() // { // JMenuBar menuBar = new JMenuBar(); // // menuBar.add(createFileMenu()); // menuBar.add(createHelpMenu()); // // return menuBar; // } // private static JMenu createFileMenu() // { // JMenu fileMenu = new JMenu("File"); // // fileMenu.add(createOpenMenuItem()); // fileMenu.add(createSaveMenuItem()); // fileMenu.add(createSaveAsMenuItem()); // // fileMenu.add(new JPopupMenu.Separator()); // fileMenu.add(createExportMenuItem()); // fileMenu.add(createImportMenuItem()); // // fileMenu.add(new JPopupMenu.Separator()); // fileMenu.add(createClearMenuItem()); // // fileMenu.add(new JPopupMenu.Separator()); // fileMenu.add(createExitMenuItem()); // // return fileMenu; // }
static void function() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException ex) { Logger.getLogger(Editor.class.getName()).log(Level.SEVERE, null, ex); } catch (InstantiationException ex) { Logger.getLogger(Editor.class.getName()).log(Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { Logger.getLogger(Editor.class.getName()).log(Level.SEVERE, null, ex); } catch (UnsupportedLookAndFeelException ex) { Logger.getLogger(Editor.class.getName()).log(Level.SEVERE, null, ex); } }
/** * Attempts to set the Look and Feel of the application to the native * platform. */
Attempts to set the Look and Feel of the application to the native platform
setLookAndFeel
{ "repo_name": "underworlddemon/stronghold-kingdoms-castle-designer", "path": "src/main/java/castledesigner/Editor.java", "license": "mit", "size": 20049 }
[ "java.util.logging.Level", "java.util.logging.Logger", "javax.swing.UIManager", "javax.swing.UnsupportedLookAndFeelException" ]
import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException;
import java.util.logging.*; import javax.swing.*;
[ "java.util", "javax.swing" ]
java.util; javax.swing;
1,254,265
public void getServerConfig(com.google.container.v1.GetServerConfigRequest request, io.grpc.stub.StreamObserver<com.google.container.v1.ServerConfig> responseObserver) { asyncUnimplementedUnaryCall(getGetServerConfigMethodHelper(), responseObserver); }
void function(com.google.container.v1.GetServerConfigRequest request, io.grpc.stub.StreamObserver<com.google.container.v1.ServerConfig> responseObserver) { asyncUnimplementedUnaryCall(getGetServerConfigMethodHelper(), responseObserver); }
/** * <pre> * Returns configuration info about the Container Engine service. * </pre> */
<code> Returns configuration info about the Container Engine service. </code>
getServerConfig
{ "repo_name": "pongad/api-client-staging", "path": "generated/java/grpc-google-cloud-container-v1/src/main/java/com/google/container/v1/ClusterManagerGrpc.java", "license": "bsd-3-clause", "size": 147597 }
[ "io.grpc.stub.ServerCalls" ]
import io.grpc.stub.ServerCalls;
import io.grpc.stub.*;
[ "io.grpc.stub" ]
io.grpc.stub;
2,509,884
List<Result> createUpdate(List<Owner> owners);
List<Result> createUpdate(List<Owner> owners);
/** * Add or update a list of owners. * If an owner doesn't exist, it will be created, otherwise it will be updated. * * @param owners, list of Owners bean to be created or updated. * * @return the list of result for all the owners with corresponding id, status and * message. */
Add or update a list of owners. If an owner doesn't exist, it will be created, otherwise it will be updated
createUpdate
{ "repo_name": "mnubo/mnubo-java-sdk", "path": "src/main/java/com/mnubo/java/sdk/client/spi/OwnersSDK.java", "license": "mit", "size": 2298 }
[ "com.mnubo.java.sdk.client.models.Owner", "com.mnubo.java.sdk.client.models.result.Result", "java.util.List" ]
import com.mnubo.java.sdk.client.models.Owner; import com.mnubo.java.sdk.client.models.result.Result; import java.util.List;
import com.mnubo.java.sdk.client.models.*; import com.mnubo.java.sdk.client.models.result.*; import java.util.*;
[ "com.mnubo.java", "java.util" ]
com.mnubo.java; java.util;
870,127
@Test public void modIPv6FlowLabelInstructionTest() { final int flowLabel = 0xfffff; final L3ModificationInstruction.ModIPv6FlowLabelInstruction instruction = (L3ModificationInstruction.ModIPv6FlowLabelInstruction) Instructions.modL3IPv6FlowLabel(flowLabel); final ObjectNode instructionJson = instructionCodec.encode(instruction, context); assertThat(instructionJson, matchesInstruction(instruction)); }
void function() { final int flowLabel = 0xfffff; final L3ModificationInstruction.ModIPv6FlowLabelInstruction instruction = (L3ModificationInstruction.ModIPv6FlowLabelInstruction) Instructions.modL3IPv6FlowLabel(flowLabel); final ObjectNode instructionJson = instructionCodec.encode(instruction, context); assertThat(instructionJson, matchesInstruction(instruction)); }
/** * Tests the encoding of mod IPv6 flow label instructions. */
Tests the encoding of mod IPv6 flow label instructions
modIPv6FlowLabelInstructionTest
{ "repo_name": "shlee89/athena", "path": "core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java", "license": "apache-2.0", "size": 9279 }
[ "com.fasterxml.jackson.databind.node.ObjectNode", "org.hamcrest.MatcherAssert", "org.onosproject.codec.impl.InstructionJsonMatcher", "org.onosproject.net.flow.instructions.Instructions", "org.onosproject.net.flow.instructions.L3ModificationInstruction" ]
import com.fasterxml.jackson.databind.node.ObjectNode; import org.hamcrest.MatcherAssert; import org.onosproject.codec.impl.InstructionJsonMatcher; import org.onosproject.net.flow.instructions.Instructions; import org.onosproject.net.flow.instructions.L3ModificationInstruction;
import com.fasterxml.jackson.databind.node.*; import org.hamcrest.*; import org.onosproject.codec.impl.*; import org.onosproject.net.flow.instructions.*;
[ "com.fasterxml.jackson", "org.hamcrest", "org.onosproject.codec", "org.onosproject.net" ]
com.fasterxml.jackson; org.hamcrest; org.onosproject.codec; org.onosproject.net;
2,513,235
private void showHelp(Config cfg) { HelpFormatter hf = new HelpFormatter(); hf.printHelp("imapfilter.sh [OPTIONS]", cfg.getOptions()); }
void function(Config cfg) { HelpFormatter hf = new HelpFormatter(); hf.printHelp(STR, cfg.getOptions()); }
/** * Shows the help. * * @param cfg * The config */
Shows the help
showHelp
{ "repo_name": "fbernitt/imapfilter", "path": "src/main/java/org/bernitt/imapfilter/ImapFilter.java", "license": "gpl-3.0", "size": 4749 }
[ "org.apache.commons.cli.HelpFormatter", "org.bernitt.imapfilter.config.Config" ]
import org.apache.commons.cli.HelpFormatter; import org.bernitt.imapfilter.config.Config;
import org.apache.commons.cli.*; import org.bernitt.imapfilter.config.*;
[ "org.apache.commons", "org.bernitt.imapfilter" ]
org.apache.commons; org.bernitt.imapfilter;
838,429
String example = "TYPE2SET"; CharacterSet enumType2Set = CharacterSet.valueForString(example); example = "TYPE5SET"; CharacterSet enumType5Set = CharacterSet.valueForString(example); example = "CID1SET"; CharacterSet enumCid1Set = CharacterSet.valueForString(example); example = "CID2SET"; CharacterSet enumCid2Set = CharacterSet.valueForString(example); assertNotNull("TYPE2SET returned null", enumType2Set); assertNotNull("TYPE5SET returned null", enumType5Set); assertNotNull("CID1SET returned null", enumCid1Set); assertNotNull("CID2SET returned null", enumCid2Set); }
String example = STR; CharacterSet enumType2Set = CharacterSet.valueForString(example); example = STR; CharacterSet enumType5Set = CharacterSet.valueForString(example); example = STR; CharacterSet enumCid1Set = CharacterSet.valueForString(example); example = STR; CharacterSet enumCid2Set = CharacterSet.valueForString(example); assertNotNull(STR, enumType2Set); assertNotNull(STR, enumType5Set); assertNotNull(STR, enumCid1Set); assertNotNull(STR, enumCid2Set); }
/** * Verifies that the enum values are not null upon valid assignment. */
Verifies that the enum values are not null upon valid assignment
testValidEnums
{ "repo_name": "anildahiya/sdl_android", "path": "android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CharacterSetTests.java", "license": "bsd-3-clause", "size": 2463 }
[ "com.smartdevicelink.proxy.rpc.enums.CharacterSet" ]
import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
import com.smartdevicelink.proxy.rpc.enums.*;
[ "com.smartdevicelink.proxy" ]
com.smartdevicelink.proxy;
540,867
public void test_java_util_Arrays_sort_object_array_NPE() { Object[] object_array_null = null; try { java.util.Arrays.sort(object_array_null); fail("Should throw java.lang.NullPointerException"); } catch (NullPointerException e) { // Expected } try { // Regression for HARMONY-378 java.util.Arrays.sort(object_array_null, (int) -1, (int) 1); fail("Should throw java.lang.NullPointerException"); } catch (NullPointerException e) { // Expected } try { // Regression for HARMONY-378 java.util.Arrays.sort(object_array_null, (int) -1, (int) 1, null); fail("Should throw java.lang.NullPointerException"); } catch (NullPointerException e) { // Expected } }
void function() { Object[] object_array_null = null; try { java.util.Arrays.sort(object_array_null); fail(STR); } catch (NullPointerException e) { } try { java.util.Arrays.sort(object_array_null, (int) -1, (int) 1); fail(STR); } catch (NullPointerException e) { } try { java.util.Arrays.sort(object_array_null, (int) -1, (int) 1, null); fail(STR); } catch (NullPointerException e) { } }
/** * java.util.Arrays#sort(Object[], int, int) */
java.util.Arrays#sort(Object[], int, int)
test_java_util_Arrays_sort_object_array_NPE
{ "repo_name": "mirego/j2objc", "path": "jre_emul/android/platform/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ArraysTest.java", "license": "apache-2.0", "size": 207868 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,183,360
public void addAll(List<Noticias> noticias) { if (noticias == null) { return; } for (int i = 0; i < noticias.size(); i++) { add(noticias.get(i)); } }
void function(List<Noticias> noticias) { if (noticias == null) { return; } for (int i = 0; i < noticias.size(); i++) { add(noticias.get(i)); } }
/** * carga en el adaptador * * @param noticias */
carga en el adaptador
addAll
{ "repo_name": "alberapps/tiempobus", "path": "TiempoBus/src/alberapps/android/tiempobus/noticias/NoticiasAdapter.java", "license": "gpl-3.0", "size": 5166 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
824,309
@Authorized( { PrivilegeConstants.PURGE_RELATIONSHIPS }) public void purgeRelationship(Relationship relationship) throws APIException;
@Authorized( { PrivilegeConstants.PURGE_RELATIONSHIPS }) void function(Relationship relationship) throws APIException;
/** * Purges a relationship from the database (cannot be undone) * * @param relationship relationship to be purged from the database * @throws APIException * @should delete relationship from the database */
Purges a relationship from the database (cannot be undone)
purgeRelationship
{ "repo_name": "sintjuri/openmrs-core", "path": "api/src/main/java/org/openmrs/api/PersonService.java", "license": "mpl-2.0", "size": 41926 }
[ "org.openmrs.Relationship", "org.openmrs.annotation.Authorized", "org.openmrs.util.PrivilegeConstants" ]
import org.openmrs.Relationship; import org.openmrs.annotation.Authorized; import org.openmrs.util.PrivilegeConstants;
import org.openmrs.*; import org.openmrs.annotation.*; import org.openmrs.util.*;
[ "org.openmrs", "org.openmrs.annotation", "org.openmrs.util" ]
org.openmrs; org.openmrs.annotation; org.openmrs.util;
420,680
public ImmutableList<ImmutableList<RexLiteral>> getTuples() { return tuples; }
ImmutableList<ImmutableList<RexLiteral>> function() { return tuples; }
/** Returns the rows of literals represented by this Values relational * expression. */
Returns the rows of literals represented by this Values relational
getTuples
{ "repo_name": "xhoong/incubator-calcite", "path": "core/src/main/java/org/apache/calcite/rel/core/Values.java", "license": "apache-2.0", "size": 7175 }
[ "com.google.common.collect.ImmutableList", "org.apache.calcite.rex.RexLiteral" ]
import com.google.common.collect.ImmutableList; import org.apache.calcite.rex.RexLiteral;
import com.google.common.collect.*; import org.apache.calcite.rex.*;
[ "com.google.common", "org.apache.calcite" ]
com.google.common; org.apache.calcite;
1,988,207
static String isOnline(Context context) { try { ConnectivityManager conMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); if (conMgr != null && conMgr.getActiveNetworkInfo() != null && conMgr.getActiveNetworkInfo().isAvailable() && conMgr.getActiveNetworkInfo().isConnected()) { return "true"; } return "false"; } catch(Exception e){ if (Seeds.sharedInstance().isLoggingEnabled()) { Log.w(Seeds.TAG, "Got exception determining connectivity", e); } } return null; }
static String isOnline(Context context) { try { ConnectivityManager conMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); if (conMgr != null && conMgr.getActiveNetworkInfo() != null && conMgr.getActiveNetworkInfo().isAvailable() && conMgr.getActiveNetworkInfo().isConnected()) { return "true"; } return "false"; } catch(Exception e){ if (Seeds.sharedInstance().isLoggingEnabled()) { Log.w(Seeds.TAG, STR, e); } } return null; }
/** * Checks if device is online. */
Checks if device is online
isOnline
{ "repo_name": "brainbeanapps/seeds-sdk-android", "path": "sdk/src/main/java/com/playseeds/android/sdk/CrashDetails.java", "license": "mit", "size": 13921 }
[ "android.content.Context", "android.net.ConnectivityManager", "android.util.Log" ]
import android.content.Context; import android.net.ConnectivityManager; import android.util.Log;
import android.content.*; import android.net.*; import android.util.*;
[ "android.content", "android.net", "android.util" ]
android.content; android.net; android.util;
284,786
@Test public void testIndexWithDifferentFldsReqPartialFldsInIdx() throws Exception { inlineSize = 10; IgniteEx ig0 = startGrid(0); GridQueryProcessor qryProc = ig0.context().query(); populateTable(qryProc, TEST_TBL_NAME, 2, "FIRST_NAME", "LAST_NAME", "ADDRESS", "LANG", "GENDER"); String sqlIdx1 = String.format("create index \"idx1\" on %s(LANG, LAST_NAME, ADDRESS, FIRST_NAME)", TEST_TBL_NAME); qryProc.querySqlFields(new SqlFieldsQuery(sqlIdx1), true).getAll(); assertTrue(checkIdxUsed(qryProc, null, TEST_TBL_NAME, "FIRST_NAME", "LAST_NAME", "LANG")); assertTrue(checkIdxUsed(qryProc, null, TEST_TBL_NAME, "FIRST_NAME", "LAST_NAME", "ADDRESS")); assertFalse(checkIdxUsed(qryProc, null, TEST_TBL_NAME, "LAST_NAME", "ADDRESS")); }
void function() throws Exception { inlineSize = 10; IgniteEx ig0 = startGrid(0); GridQueryProcessor qryProc = ig0.context().query(); populateTable(qryProc, TEST_TBL_NAME, 2, STR, STR, STR, "LANG", STR); String sqlIdx1 = String.format(STRidx1\STR, TEST_TBL_NAME); qryProc.querySqlFields(new SqlFieldsQuery(sqlIdx1), true).getAll(); assertTrue(checkIdxUsed(qryProc, null, TEST_TBL_NAME, STR, STR, "LANG")); assertTrue(checkIdxUsed(qryProc, null, TEST_TBL_NAME, STR, STR, STR)); assertFalse(checkIdxUsed(qryProc, null, TEST_TBL_NAME, STR, STR)); }
/** * Tests different fields sequence in indexes. * Last field not participate in any index. */
Tests different fields sequence in indexes. Last field not participate in any index
testIndexWithDifferentFldsReqPartialFldsInIdx
{ "repo_name": "ascherbakoff/ignite", "path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/BasicIndexTest.java", "license": "apache-2.0", "size": 54323 }
[ "org.apache.ignite.cache.query.SqlFieldsQuery", "org.apache.ignite.internal.IgniteEx", "org.apache.ignite.internal.processors.query.GridQueryProcessor" ]
import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.processors.query.GridQueryProcessor;
import org.apache.ignite.cache.query.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.query.*;
[ "org.apache.ignite" ]
org.apache.ignite;
226,546
protected void applyPropertyValue( ConfigurableListableBeanFactory factory, String beanName, String property, String value) { BeanDefinition bd = factory.getBeanDefinition(beanName); BeanDefinition bdToUse = bd; while (bd != null) { bdToUse = bd; bd = bd.getOriginatingBeanDefinition(); } PropertyValue pv = new PropertyValue(property, value); pv.setOptional(this.ignoreInvalidKeys); bdToUse.getPropertyValues().addPropertyValue(pv); }
void function( ConfigurableListableBeanFactory factory, String beanName, String property, String value) { BeanDefinition bd = factory.getBeanDefinition(beanName); BeanDefinition bdToUse = bd; while (bd != null) { bdToUse = bd; bd = bd.getOriginatingBeanDefinition(); } PropertyValue pv = new PropertyValue(property, value); pv.setOptional(this.ignoreInvalidKeys); bdToUse.getPropertyValues().addPropertyValue(pv); }
/** * Apply the given property value to the corresponding bean. */
Apply the given property value to the corresponding bean
applyPropertyValue
{ "repo_name": "spring-projects/spring-framework", "path": "spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyOverrideConfigurer.java", "license": "apache-2.0", "size": 6035 }
[ "org.springframework.beans.PropertyValue" ]
import org.springframework.beans.PropertyValue;
import org.springframework.beans.*;
[ "org.springframework.beans" ]
org.springframework.beans;
260,347
public void onActionBarVisibilityChanged(boolean visible) { ActionBar actionBar = mActionBarDelegate.getSupportActionBar(); if (!visible && actionBar != null) actionBar.hide(); if (mActivity.isTablet()) { if (visible) { mActionModeController.startShowAnimation(); } else { mActionModeController.startHideAnimation(); } } }
void function(boolean visible) { ActionBar actionBar = mActionBarDelegate.getSupportActionBar(); if (!visible && actionBar != null) actionBar.hide(); if (mActivity.isTablet()) { if (visible) { mActionModeController.startShowAnimation(); } else { mActionModeController.startHideAnimation(); } } }
/** * Called when the contextual action bar's visibility has changed (i.e. the widget shown * when you can copy/paste text after long press). * @param visible Whether the contextual action bar is now visible. */
Called when the contextual action bar's visibility has changed (i.e. the widget shown when you can copy/paste text after long press)
onActionBarVisibilityChanged
{ "repo_name": "endlessm/chromium-browser", "path": "chrome/android/java/src/org/chromium/chrome/browser/toolbar/ToolbarManager.java", "license": "bsd-3-clause", "size": 71970 }
[ "androidx.appcompat.app.ActionBar" ]
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.*;
[ "androidx.appcompat" ]
androidx.appcompat;
1,245,964
public void setLabelStyle(AttributeSet style) { Preconditions.checkNotNull(style); setLabelStyleDelegate(s -> style); }
void function(AttributeSet style) { Preconditions.checkNotNull(style); setLabelStyleDelegate(s -> style); }
/** * Sets a single label style for all objects. * @param style style to use for all objects */
Sets a single label style for all objects
setLabelStyle
{ "repo_name": "triathematician/blaisemath", "path": "blaise-common/src/main/java/com/googlecode/blaisemath/style/ObjectStyler.java", "license": "apache-2.0", "size": 10811 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
2,483,440
public DiscoCache discoCache(AffinityTopologyVersion topVer) { return discoCacheHist.get(topVer); }
DiscoCache function(AffinityTopologyVersion topVer) { return discoCacheHist.get(topVer); }
/** * Gets discovery collection cache from SPI safely guarding against "floating" collections. * * @return Discovery collection cache. */
Gets discovery collection cache from SPI safely guarding against "floating" collections
discoCache
{ "repo_name": "dmagda/incubator-ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java", "license": "apache-2.0", "size": 103840 }
[ "org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion" ]
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.internal.processors.affinity.*;
[ "org.apache.ignite" ]
org.apache.ignite;
143,874
java.io.Reader getCharacterStream(String parameterName) throws SQLException;
java.io.Reader getCharacterStream(String parameterName) throws SQLException;
/** * Retrieves the value of the designated parameter as a * <code>java.io.Reader</code> object in the Java programming language. * * @param parameterName the name of the parameter * @return a <code>java.io.Reader</code> object that contains the parameter * value; if the value is SQL <code>NULL</code>, the value returned is * <code>null</code> in the Java programming language * @exception SQLException if parameterName does not correspond to a named * parameter; if a database access error occurs or * this method is called on a closed <code>CallableStatement</code> * @exception SQLFeatureNotSupportedException if the JDBC driver does not support * this method * @since 1.6 */
Retrieves the value of the designated parameter as a <code>java.io.Reader</code> object in the Java programming language
getCharacterStream
{ "repo_name": "karianna/jdk8_tl", "path": "jdk/src/share/classes/java/sql/CallableStatement.java", "license": "gpl-2.0", "size": 134963 }
[ "java.io.Reader" ]
import java.io.Reader;
import java.io.*;
[ "java.io" ]
java.io;
1,218,536
public void test_1() { WicketTester tester = new WicketTester(); tester.startPage(FormInput.class); tester.assertContains("Wicket Examples - forminput"); }
void function() { WicketTester tester = new WicketTester(); tester.startPage(FormInput.class); tester.assertContains(STR); }
/** * Test page. */
Test page
test_1
{ "repo_name": "Servoy/wicket", "path": "wicket-examples/src/test/java/org/apache/wicket/examples/forminput/FormInputTest.java", "license": "apache-2.0", "size": 1217 }
[ "org.apache.wicket.util.tester.WicketTester" ]
import org.apache.wicket.util.tester.WicketTester;
import org.apache.wicket.util.tester.*;
[ "org.apache.wicket" ]
org.apache.wicket;
1,811,380
public SessionExpiresHeader createSessionExpiresHeader(int expires) throws InvalidArgumentException ;
SessionExpiresHeader function(int expires) throws InvalidArgumentException ;
/** * Creates a new SessionExpiresHeader based on the newly supplied expires value. * * @param expires - the new integer value of the expires. * @throws InvalidArgumentException if supplied expires is less * than zero. * @return the newly created SessionExpiresHeader object. * */
Creates a new SessionExpiresHeader based on the newly supplied expires value
createSessionExpiresHeader
{ "repo_name": "fhg-fokus-nubomedia/ims-connector", "path": "src/main/java/gov/nist/javax/sip/header/HeaderFactoryExt.java", "license": "apache-2.0", "size": 8607 }
[ "gov.nist.javax.sip.header.extensions.SessionExpiresHeader", "javax.sip.InvalidArgumentException" ]
import gov.nist.javax.sip.header.extensions.SessionExpiresHeader; import javax.sip.InvalidArgumentException;
import gov.nist.javax.sip.header.extensions.*; import javax.sip.*;
[ "gov.nist.javax", "javax.sip" ]
gov.nist.javax; javax.sip;
2,882,513
public static ims.scheduling.domain.objects.Session_Slot extractSession_Slot(ims.domain.ILightweightDomainFactory domainFactory, ims.scheduling.vo.SessionSlotClinicListListVo valueObject) { return extractSession_Slot(domainFactory, valueObject, new HashMap()); }
static ims.scheduling.domain.objects.Session_Slot function(ims.domain.ILightweightDomainFactory domainFactory, ims.scheduling.vo.SessionSlotClinicListListVo valueObject) { return extractSession_Slot(domainFactory, valueObject, new HashMap()); }
/** * Create the domain object from the value object. * @param domainFactory - used to create existing (persistent) domain objects. * @param valueObject - extract the domain object fields from this. */
Create the domain object from the value object
extractSession_Slot
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/scheduling/vo/domain/SessionSlotClinicListListVoAssembler.java", "license": "agpl-3.0", "size": 23688 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
300,622
@Override public void unwrapSSLv2(byte[] bytes) { io_stream.append(bytes); io_stream.mark(); try { clientHello = new ClientHello(io_stream); } catch (IOException e) { io_stream.reset(); return; }
void function(byte[] bytes) { io_stream.append(bytes); io_stream.mark(); try { clientHello = new ClientHello(io_stream); } catch (IOException e) { io_stream.reset(); return; }
/** * Processes SSLv2 Hello message * @ see TLS 1.0 spec., E.1. Version 2 client hello * @param bytes */
Processes SSLv2 Hello message
unwrapSSLv2
{ "repo_name": "skyHALud/codenameone", "path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java", "license": "gpl-2.0", "size": 31521 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,651,706
@Generated @CFunction public static native int acl_maximal_permset_mask_np(LongPtr mask_p);
static native int function(LongPtr mask_p);
/** * nonstandard - manipulate permissions within an ACL entry using bitmasks */
nonstandard - manipulate permissions within an ACL entry using bitmasks
acl_maximal_permset_mask_np
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/c/Globals.java", "license": "apache-2.0", "size": 390376 }
[ "org.moe.natj.general.ptr.LongPtr" ]
import org.moe.natj.general.ptr.LongPtr;
import org.moe.natj.general.ptr.*;
[ "org.moe.natj" ]
org.moe.natj;
1,108,862
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<AuthorizationRuleInner>> listAuthorizationRulesNextSinglePageAsync( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<AuthorizationRuleInner>> function( String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); }
/** * Get the next page of items. * * @param nextLink The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response from the List namespace operation. */
Get the next page of items
listAuthorizationRulesNextSinglePageAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-eventhubs/src/main/java/com/azure/resourcemanager/eventhubs/implementation/EventHubsClientImpl.java", "license": "mit", "size": 114749 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedResponse", "com.azure.core.http.rest.PagedResponseBase", "com.azure.core.util.Context", "com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.Context; import com.azure.resourcemanager.eventhubs.fluent.models.AuthorizationRuleInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.eventhubs.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,998,457
private UserDTO createUserDTO(CreateUserRequestDTO newUserDTO, boolean creatorIsAdmin) throws Exception { UserDTO nDTO = new UserDTO(); // Set the role. // Only an ADMIN can make another ADMIN if(creatorIsAdmin) { nDTO.setRole(newUserDTO.getRole()); if (SecurityRoleEnum.valueOf(newUserDTO.getRole()) == SecurityRoleEnum.ADMIN) { nDTO.setAdmin(true); } else { nDTO.setAdmin(true); } } else { nDTO.setRole(newUserDTO.getRole()); nDTO.setAdmin(true); } // Creating a new user sets the password to a random generated one String pWd = RandomPasswordGenerator.generateApplicationDefaultPwd(); // Set the UserDTO // New account must reset password // New account is active by default // New account has fake password nDTO.setResetPwd(true); nDTO.setActive(true); nDTO.setCreateDt(new Date()); nDTO.setEmail(newUserDTO.getEmail()); nDTO.setFirstName(newUserDTO.getFirstName()); nDTO.setLastName(newUserDTO.getLastName()); nDTO.setOrganizationId(newUserDTO.getOrganizationId()); nDTO.setId(newUserDTO.getId()); nDTO.setPassword(pWd); return nDTO; }
UserDTO function(CreateUserRequestDTO newUserDTO, boolean creatorIsAdmin) throws Exception { UserDTO nDTO = new UserDTO(); if(creatorIsAdmin) { nDTO.setRole(newUserDTO.getRole()); if (SecurityRoleEnum.valueOf(newUserDTO.getRole()) == SecurityRoleEnum.ADMIN) { nDTO.setAdmin(true); } else { nDTO.setAdmin(true); } } else { nDTO.setRole(newUserDTO.getRole()); nDTO.setAdmin(true); } String pWd = RandomPasswordGenerator.generateApplicationDefaultPwd(); nDTO.setResetPwd(true); nDTO.setActive(true); nDTO.setCreateDt(new Date()); nDTO.setEmail(newUserDTO.getEmail()); nDTO.setFirstName(newUserDTO.getFirstName()); nDTO.setLastName(newUserDTO.getLastName()); nDTO.setOrganizationId(newUserDTO.getOrganizationId()); nDTO.setId(newUserDTO.getId()); nDTO.setPassword(pWd); return nDTO; }
/** * Creates a UserDTO from the CreateUserRequestDTO. Applies the following rules:<br/> * 1. Only and ADMIN (creatorIsAdmin == true) can create an ADMIN<br/> * 2. The initial password will be randomly generated<br/> * * @param newUserDTO * @param creatorIsAdmin * @return * @throws Exception */
Creates a UserDTO from the CreateUserRequestDTO. Applies the following rules: 1. Only and ADMIN (creatorIsAdmin == true) can create an ADMIN 2. The initial password will be randomly generated
createUserDTO
{ "repo_name": "SMCPartners/shape-server", "path": "src/main/java/com/smcpartners/shape/usecases/create_user_account/AuthCreateUserAccountServiceAdapter.java", "license": "mit", "size": 7299 }
[ "com.smcpartners.shape.shared.constants.SecurityRoleEnum", "com.smcpartners.shape.shared.dto.shape.UserDTO", "com.smcpartners.shape.shared.dto.shape.request.CreateUserRequestDTO", "com.smcpartners.shape.shared.utils.RandomPasswordGenerator", "java.util.Date" ]
import com.smcpartners.shape.shared.constants.SecurityRoleEnum; import com.smcpartners.shape.shared.dto.shape.UserDTO; import com.smcpartners.shape.shared.dto.shape.request.CreateUserRequestDTO; import com.smcpartners.shape.shared.utils.RandomPasswordGenerator; import java.util.Date;
import com.smcpartners.shape.shared.constants.*; import com.smcpartners.shape.shared.dto.shape.*; import com.smcpartners.shape.shared.dto.shape.request.*; import com.smcpartners.shape.shared.utils.*; import java.util.*;
[ "com.smcpartners.shape", "java.util" ]
com.smcpartners.shape; java.util;
809,254
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<ManagedInstanceLongTermRetentionBackupInner>> listByResourceGroupInstanceSinglePageAsync( String resourceGroupName, String locationName, String managedInstanceName, Boolean onlyLatestPerDatabase, DatabaseState databaseState) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (locationName == null) { return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); } if (managedInstanceName == null) { return Mono .error(new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2018-06-01-preview"; return FluxUtil .withContext( context -> service .listByResourceGroupInstance( this.client.getEndpoint(), resourceGroupName, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, this.client.getSubscriptionId(), apiVersion, context)) .<PagedResponse<ManagedInstanceLongTermRetentionBackupInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<ManagedInstanceLongTermRetentionBackupInner>> function( String resourceGroupName, String locationName, String managedInstanceName, Boolean onlyLatestPerDatabase, DatabaseState databaseState) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (locationName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (managedInstanceName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String apiVersion = STR; return FluxUtil .withContext( context -> service .listByResourceGroupInstance( this.client.getEndpoint(), resourceGroupName, locationName, managedInstanceName, onlyLatestPerDatabase, databaseState, this.client.getSubscriptionId(), apiVersion, context)) .<PagedResponse<ManagedInstanceLongTermRetentionBackupInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); }
/** * Lists the long term retention backups for a given managed instance. * * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value * from the Azure Resource Manager API or the portal. * @param locationName The location of the database. * @param managedInstanceName The name of the managed instance. * @param onlyLatestPerDatabase Whether or not to only get the latest backup for each database. * @param databaseState Whether to query against just live databases, just deleted databases, or all databases. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of long term retention backups for managed database(s). */
Lists the long term retention backups for a given managed instance
listByResourceGroupInstanceSinglePageAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/implementation/LongTermRetentionManagedInstanceBackupsClientImpl.java", "license": "mit", "size": 162168 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedResponse", "com.azure.core.http.rest.PagedResponseBase", "com.azure.core.util.FluxUtil", "com.azure.resourcemanager.sql.fluent.models.ManagedInstanceLongTermRetentionBackupInner", "com.azure.resourcemanager.sql.models.DatabaseState" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.sql.fluent.models.ManagedInstanceLongTermRetentionBackupInner; import com.azure.resourcemanager.sql.models.DatabaseState;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.sql.fluent.models.*; import com.azure.resourcemanager.sql.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,812,911
public void add(Results results) { if (seriesCount == 0) { // Bit pointless but may as well handle it. data = results.data; labels = results.labels; itemCount = results.itemCount; seriesCount = results.seriesCount; } else { if (itemCount != results.itemCount) { throw new IllegalArgumentException("Item counts must be the same when adding Results objects."); } labels = ArrayUtils.addAll(labels, results.labels); data = ArrayUtils.addAll(data, results.data); seriesCount += results.seriesCount; } }
void function(Results results) { if (seriesCount == 0) { data = results.data; labels = results.labels; itemCount = results.itemCount; seriesCount = results.seriesCount; } else { if (itemCount != results.itemCount) { throw new IllegalArgumentException(STR); } labels = ArrayUtils.addAll(labels, results.labels); data = ArrayUtils.addAll(data, results.data); seriesCount += results.seriesCount; } }
/** * Adds (concatenates) the data series from the given Results to this Results. * The total number of series in this Results will be increased by the number of series in the given Results. * @param results The data to add. The internal data is copied by reference, if independent changes need to be * made to either Results object then the Results passed by this parameter should be a copy, e.g. via * the copy constructor {@link #Results(Results)}. */
Adds (concatenates) the data series from the given Results to this Results. The total number of series in this Results will be increased by the number of series in the given Results
add
{ "repo_name": "jbrant/ahni", "path": "src/com/ojcoleman/ahni/util/Results.java", "license": "gpl-3.0", "size": 5866 }
[ "org.apache.commons.lang3.ArrayUtils" ]
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.*;
[ "org.apache.commons" ]
org.apache.commons;
1,891,194
void Retrieve(@NonNull String entitySchemaName, @NonNull UUID id, @NonNull ColumnSet columnSet, @NonNull Callback<Entity> callback);
void Retrieve(@NonNull String entitySchemaName, @NonNull UUID id, @NonNull ColumnSet columnSet, @NonNull Callback<Entity> callback);
/** * Retrieves a record. * @param entitySchemaName property_schemaname that is specified in the entityId parameter. * @param id property_entityid that you want to retrieve. * @param columnSet A query that specifies the set of columns, or attributes, to retrieve. * @param callback The callback interface that will be call on complete (use if you don't want to use RXJava) */
Retrieves a record
Retrieve
{ "repo_name": "DynamicsCRM/crm-mobilesdk-library-for-android", "path": "crmsdk2015/src/main/java/com/microsoft/xrm/sdk/OrganizationService.java", "license": "mit", "size": 5414 }
[ "android.support.annotation.NonNull" ]
import android.support.annotation.NonNull;
import android.support.annotation.*;
[ "android.support" ]
android.support;
2,760,452
public static String getExtraModsFolder() { return FilenameUtils.concat(getInstallerModsFolder(), "extra/"); }
static String function() { return FilenameUtils.concat(getInstallerModsFolder(), STR); }
/** * The folder of optional mods for this installer. * * @return */
The folder of optional mods for this installer
getExtraModsFolder
{ "repo_name": "EnderVille/EnderInstaller", "path": "src/main/java/com/enderville/enderinstaller/util/InstallerConfig.java", "license": "gpl-3.0", "size": 6544 }
[ "org.apache.commons.io.FilenameUtils" ]
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.*;
[ "org.apache.commons" ]
org.apache.commons;
2,869,383
public synchronized String toStringTable() { // Create table int rowNum = 0; String table[][] = new String[tasksToRun.size() + tasksRunning.size()][5]; // Pending for (Task t : tasksToRun) { table[rowNum][0] = t.getPid() != null ? t.getPid() : ""; table[rowNum][1] = "pending (" + t.getTaskState() + ")"; table[rowNum][2] = t.getName(); // Show dependent tasks StringBuilder sb = new StringBuilder(); if (t.getDependencies() != null) { for (Task td : t.getDependencies()) sb.append(td.getName() + " "); } table[rowNum][3] = sb.toString(); table[rowNum][4] = t.getProgramHint(); rowNum++; } // Running for (Task t : tasksRunning.values()) { table[rowNum][0] = t.getPid() != null ? t.getPid() : ""; table[rowNum][1] = "running (" + t.getTaskState() + ")"; table[rowNum][2] = t.getName(); table[rowNum][3] = ""; table[rowNum][4] = t.getProgramHint(); rowNum++; } // Show table String columnNames[] = { "PID", "Task state", "Task name", "Dependencies", "Task definition" }; TextTable tt = new TextTable(columnNames, table, "\t\t"); return tt.toString(); }
synchronized String function() { int rowNum = 0; String table[][] = new String[tasksToRun.size() + tasksRunning.size()][5]; for (Task t : tasksToRun) { table[rowNum][0] = t.getPid() != null ? t.getPid() : STRpending (STR)STR "); } table[rowNum][3] = sb.toString(); table[rowNum][4] = t.getProgramHint(); rowNum++; } for (Task t : tasksRunning.values()) { table[rowNum][0] = t.getPid() != null ? t.getPid() : STRrunning (STR)STRSTRPIDSTRTask stateSTRTask nameSTRDependenciesSTRTask definitionSTR\t\t"); return tt.toString(); }
/** * Create a table of tasks */
Create a table of tasks
toStringTable
{ "repo_name": "leepc12/BigDataScript", "path": "src/org/bds/executioner/Executioner.java", "license": "apache-2.0", "size": 21991 }
[ "org.bds.task.Task" ]
import org.bds.task.Task;
import org.bds.task.*;
[ "org.bds.task" ]
org.bds.task;
580,941
private void drawResultPoints(Bitmap barcode, float scaleFactor, Result rawResult) { ResultPoint[] points = rawResult.getResultPoints(); if (points != null && points.length > 0) { Canvas canvas = new Canvas(barcode); Paint paint = new Paint(); paint.setColor(getResources().getColor(R.color.result_points)); if (points.length == 2) { paint.setStrokeWidth(4.0f); drawLine(canvas, paint, points[0], points[1], scaleFactor); } else if (points.length == 4 && (rawResult.getBarcodeFormat() == BarcodeFormat.UPC_A || rawResult .getBarcodeFormat() == BarcodeFormat.EAN_13)) { // Hacky special case -- draw two lines, for the barcode and // metadata drawLine(canvas, paint, points[0], points[1], scaleFactor); drawLine(canvas, paint, points[2], points[3], scaleFactor); } else { paint.setStrokeWidth(10.0f); for (ResultPoint point : points) { if (point != null) { canvas.drawPoint(scaleFactor * point.getX(), scaleFactor * point.getY(), paint); } } } } }
void function(Bitmap barcode, float scaleFactor, Result rawResult) { ResultPoint[] points = rawResult.getResultPoints(); if (points != null && points.length > 0) { Canvas canvas = new Canvas(barcode); Paint paint = new Paint(); paint.setColor(getResources().getColor(R.color.result_points)); if (points.length == 2) { paint.setStrokeWidth(4.0f); drawLine(canvas, paint, points[0], points[1], scaleFactor); } else if (points.length == 4 && (rawResult.getBarcodeFormat() == BarcodeFormat.UPC_A rawResult .getBarcodeFormat() == BarcodeFormat.EAN_13)) { drawLine(canvas, paint, points[0], points[1], scaleFactor); drawLine(canvas, paint, points[2], points[3], scaleFactor); } else { paint.setStrokeWidth(10.0f); for (ResultPoint point : points) { if (point != null) { canvas.drawPoint(scaleFactor * point.getX(), scaleFactor * point.getY(), paint); } } } } }
/** * Superimpose a line for 1D or dots for 2D to highlight the key features of * the barcode. * * @param barcode * A bitmap of the captured image. * @param scaleFactor * amount by which thumbnail was scaled * @param rawResult * The decoded results which contains the points to draw. */
Superimpose a line for 1D or dots for 2D to highlight the key features of the barcode
drawResultPoints
{ "repo_name": "Hanks10100/incubator-weex", "path": "android/playground/app/src/main/java_zxing/com/google/zxing/client/android/CaptureActivity.java", "license": "apache-2.0", "size": 24593 }
[ "android.graphics.Bitmap", "android.graphics.Canvas", "android.graphics.Paint", "com.google.zxing.BarcodeFormat", "com.google.zxing.Result", "com.google.zxing.ResultPoint" ]
import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import com.google.zxing.BarcodeFormat; import com.google.zxing.Result; import com.google.zxing.ResultPoint;
import android.graphics.*; import com.google.zxing.*;
[ "android.graphics", "com.google.zxing" ]
android.graphics; com.google.zxing;
488,916
private List<TypeLiteral<?>> resolveAll(Type[] types) { TypeLiteral<?>[] result = new TypeLiteral<?>[types.length]; for (int t = 0; t < types.length; t++) { result[t] = resolve(types[t]); } return Arrays.asList(result); }
List<TypeLiteral<?>> function(Type[] types) { TypeLiteral<?>[] result = new TypeLiteral<?>[types.length]; for (int t = 0; t < types.length; t++) { result[t] = resolve(types[t]); } return Arrays.asList(result); }
/** * Returns an immutable list of the resolved types. */
Returns an immutable list of the resolved types
resolveAll
{ "repo_name": "strahanjen/strahanjen.github.io", "path": "elasticsearch-master/core/src/main/java/org/elasticsearch/common/inject/TypeLiteral.java", "license": "bsd-3-clause", "size": 13388 }
[ "java.lang.reflect.Type", "java.util.Arrays", "java.util.List" ]
import java.lang.reflect.Type; import java.util.Arrays; import java.util.List;
import java.lang.reflect.*; import java.util.*;
[ "java.lang", "java.util" ]
java.lang; java.util;
2,312,991
public void disconnect() { if (disconnected.compareAndSet(false, true)) { log.debug("Disconnect - id: {}", id); if (connections != null && !connections.isEmpty()) { log.debug("Closing {} scope connections", connections.size()); // close all connections held to Red5 by client for (IConnection con : getConnections()) { try { con.close(); } catch (Exception e) { // closing a connection calls into application code, so exception possible log.error("Unexpected exception closing connection {}", e); } } } else { log.debug("Connection map is empty or null"); } // unregister client removeInstance(); } }
void function() { if (disconnected.compareAndSet(false, true)) { log.debug(STR, id); if (connections != null && !connections.isEmpty()) { log.debug(STR, connections.size()); for (IConnection con : getConnections()) { try { con.close(); } catch (Exception e) { log.error(STR, e); } } } else { log.debug(STR); } removeInstance(); } }
/** * Disconnects client from Red5 application */
Disconnects client from Red5 application
disconnect
{ "repo_name": "ant-media/Ant-Media-Server", "path": "src/main/java/org/red5/server/Client.java", "license": "apache-2.0", "size": 13323 }
[ "org.red5.server.api.IConnection" ]
import org.red5.server.api.IConnection;
import org.red5.server.api.*;
[ "org.red5.server" ]
org.red5.server;
756,140
return getServiceDetailsResult; } /** * Sets the value of the getServiceDetailsResult property. * * @param value * allowed object is * {@link ServiceDetails }
return getServiceDetailsResult; } /** * Sets the value of the getServiceDetailsResult property. * * @param value * allowed object is * {@link ServiceDetails }
/** * Gets the value of the getServiceDetailsResult property. * * @return * possible object is * {@link ServiceDetails } * */
Gets the value of the getServiceDetailsResult property
getGetServiceDetailsResult
{ "repo_name": "robevansuk/delay-repay-bot", "path": "src/main/java/com/thalesgroup/rtti/_2016_02_16/ldb/ServiceDetailsResponseType.java", "license": "mit", "size": 1782 }
[ "com.thalesgroup.rtti._2016_02_16.ldb.types.ServiceDetails" ]
import com.thalesgroup.rtti._2016_02_16.ldb.types.ServiceDetails;
import com.thalesgroup.rtti.*;
[ "com.thalesgroup.rtti" ]
com.thalesgroup.rtti;
2,797,245
public OneResponse clone(String name) { return clone(client, id, name); }
OneResponse function(String name) { return clone(client, id, name); }
/** * Clones this security group into a new one * * @param name Name for the new security group. * @return If successful the message contains the new security group ID. */
Clones this security group into a new one
clone
{ "repo_name": "fasrc/one", "path": "src/oca/java/src/org/opennebula/client/secgroup/SecurityGroup.java", "license": "apache-2.0", "size": 11992 }
[ "org.opennebula.client.OneResponse" ]
import org.opennebula.client.OneResponse;
import org.opennebula.client.*;
[ "org.opennebula.client" ]
org.opennebula.client;
2,765,477
protected void load(String srvRecord) throws DnsException { super.load(null); StringTokenizer strTokens = new StringTokenizer(srvRecord); try { while (strTokens.hasMoreTokens()) { String priority = strTokens.nextToken(); this.priority = Integer.parseInt(priority); String weight = strTokens.nextToken(); this.weight = Integer.parseInt(weight); String port = strTokens.nextToken(); this.port = Integer.parseInt(port); String target = strTokens.nextToken(); this.target = target; } } catch (NumberFormatException ne) { throw new DnsException("NumberFormatException " + ne.getMessage()); } catch (NoSuchElementException ne) { throw new DnsException("NoSuchElementException " + ne.getMessage()); } }
void function(String srvRecord) throws DnsException { super.load(null); StringTokenizer strTokens = new StringTokenizer(srvRecord); try { while (strTokens.hasMoreTokens()) { String priority = strTokens.nextToken(); this.priority = Integer.parseInt(priority); String weight = strTokens.nextToken(); this.weight = Integer.parseInt(weight); String port = strTokens.nextToken(); this.port = Integer.parseInt(port); String target = strTokens.nextToken(); this.target = target; } } catch (NumberFormatException ne) { throw new DnsException(STR + ne.getMessage()); } catch (NoSuchElementException ne) { throw new DnsException(STR + ne.getMessage()); } }
/** * Initializes a new instance of the DnsSrvRecord class. * * @param srvRecord srvRecord that is fetched from JNDI * @throws microsoft.exchange.webservices.data.DnsException the dns exception */
Initializes a new instance of the DnsSrvRecord class
load
{ "repo_name": "evpaassen/ews-java-api", "path": "src/main/java/microsoft/exchange/webservices/data/DnsSrvRecord.java", "license": "mit", "size": 3534 }
[ "java.util.NoSuchElementException", "java.util.StringTokenizer" ]
import java.util.NoSuchElementException; import java.util.StringTokenizer;
import java.util.*;
[ "java.util" ]
java.util;
2,892,247
return HttpClientBuilder.create() .setConnectionManager(createConnectionManager(recorder)) .build(); }
return HttpClientBuilder.create() .setConnectionManager(createConnectionManager(recorder)) .build(); }
/** * Creates a new HttpClient with default settings that will be recorded by the given recorder. */
Creates a new HttpClient with default settings that will be recorded by the given recorder
create
{ "repo_name": "nla/butterflynet", "path": "src/butterflynet/RecordingHttpClient.java", "license": "apache-2.0", "size": 3835 }
[ "org.apache.http.impl.client.HttpClientBuilder" ]
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.*;
[ "org.apache.http" ]
org.apache.http;
850,341
public static void main(String[] argv) throws Exception { StringUtils.startupShutdownMessage(SecondaryNameNode.class, argv, LOG); Configuration tconf = new Configuration(); if (argv.length >= 1) { SecondaryNameNode secondary = new SecondaryNameNode(tconf); int ret = secondary.processArgs(argv); System.exit(ret); } // Create a never ending deamon Daemon checkpointThread = new Daemon(new SecondaryNameNode(tconf)); checkpointThread.start(); } static class CheckpointStorage extends FSImage { CheckpointStorage() throws IOException { super(); }
static void function(String[] argv) throws Exception { StringUtils.startupShutdownMessage(SecondaryNameNode.class, argv, LOG); Configuration tconf = new Configuration(); if (argv.length >= 1) { SecondaryNameNode secondary = new SecondaryNameNode(tconf); int ret = secondary.processArgs(argv); System.exit(ret); } Daemon checkpointThread = new Daemon(new SecondaryNameNode(tconf)); checkpointThread.start(); } static class CheckpointStorage extends FSImage { CheckpointStorage() throws IOException { super(); }
/** * main() has some simple utility methods. * @param argv Command line parameters. * @exception Exception if the filesystem does not exist. */
main() has some simple utility methods
main
{ "repo_name": "gndpig/hadoop", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java", "license": "apache-2.0", "size": 27475 }
[ "java.io.IOException", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.util.Daemon", "org.apache.hadoop.util.StringUtils" ]
import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.util.Daemon; import org.apache.hadoop.util.StringUtils;
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.util.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,567,706
@ApiModelProperty(example = "null", required = true, value = "type_id integer") public Integer getTypeId() { return typeId; }
@ApiModelProperty(example = "null", required = true, value = STR) Integer function() { return typeId; }
/** * type_id integer * * @return typeId **/
type_id integer
getTypeId
{ "repo_name": "GoldenGnu/eve-esi", "path": "src/main/java/net/troja/eve/esi/model/CharacterWalletTransactionsResponse.java", "license": "apache-2.0", "size": 8975 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
1,330,553
ICreate create();
ICreate create();
/** * Fluent method for the "create" operation, which creates a new resource instance on the server */
Fluent method for the "create" operation, which creates a new resource instance on the server
create
{ "repo_name": "dhf0820/hapi-fhir-1.2", "path": "hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java", "license": "apache-2.0", "size": 14036 }
[ "ca.uhn.fhir.rest.gclient.ICreate" ]
import ca.uhn.fhir.rest.gclient.ICreate;
import ca.uhn.fhir.rest.gclient.*;
[ "ca.uhn.fhir" ]
ca.uhn.fhir;
2,637,285
public void run() { LOG.info(dnRegistration + "In DataNode.run, data = " + data); // start dataXceiveServer dataXceiverServer.start(); while (shouldRun) { try { startDistributedUpgradeIfNeeded(); offerService(); } catch (Exception ex) { LOG.error("Exception: " + StringUtils.stringifyException(ex)); if (shouldRun) { try { Thread.sleep(5000); } catch (InterruptedException ie) { } } } } LOG.info(dnRegistration + ":Finishing DataNode in: "+data); shutdown(); }
void function() { LOG.info(dnRegistration + STR + data); dataXceiverServer.start(); while (shouldRun) { try { startDistributedUpgradeIfNeeded(); offerService(); } catch (Exception ex) { LOG.error(STR + StringUtils.stringifyException(ex)); if (shouldRun) { try { Thread.sleep(5000); } catch (InterruptedException ie) { } } } } LOG.info(dnRegistration + STR+data); shutdown(); }
/** * No matter what kind of exception we get, keep retrying to offerService(). * That's the loop that connects to the NameNode and provides basic DataNode * functionality. * * Only stop when "shouldRun" is turned off (which can only happen at shutdown). */
No matter what kind of exception we get, keep retrying to offerService(). That's the loop that connects to the NameNode and provides basic DataNode functionality. Only stop when "shouldRun" is turned off (which can only happen at shutdown)
run
{ "repo_name": "leonhong/hadoop-20-warehouse", "path": "src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java", "license": "apache-2.0", "size": 64965 }
[ "org.apache.hadoop.util.StringUtils" ]
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
297,958
public static List<Constraint> filter(List<Constraint> list, FromElement fromElement, boolean related) { List<Constraint> filtered = new ArrayList<Constraint>(); if (related) { for (Constraint c : list) { if (fromElement != null) { if (isRelatedTo(c, fromElement)) { filtered.add(c); } } else if (isRelatedToNothing(c)) { filtered.add(c); } } } else { for (Constraint c : list) { if (fromElement != null) { if (isAssociatedWith(c, fromElement)) { filtered.add(c); } } else if (isAssociatedWithNothing(c)) { filtered.add(c); } } } return filtered; }
static List<Constraint> function(List<Constraint> list, FromElement fromElement, boolean related) { List<Constraint> filtered = new ArrayList<Constraint>(); if (related) { for (Constraint c : list) { if (fromElement != null) { if (isRelatedTo(c, fromElement)) { filtered.add(c); } } else if (isRelatedToNothing(c)) { filtered.add(c); } } } else { for (Constraint c : list) { if (fromElement != null) { if (isAssociatedWith(c, fromElement)) { filtered.add(c); } } else if (isAssociatedWithNothing(c)) { filtered.add(c); } } } return filtered; }
/** * Return a subset of the given List that contains only Constraints * that relate to the given FromElement or constraints associated * with nothing if fromElement is null. * * @param list a list of Constraints to filter * @param fromElement a fromElement that returned constraints relate to * @param related if tru list all releted constraints, otherwise just associated * @return a List of Constraint objects */
Return a subset of the given List that contains only Constraints that relate to the given FromElement or constraints associated with nothing if fromElement is null
filter
{ "repo_name": "julie-sullivan/phytomine", "path": "intermine/objectstore/main/src/org/intermine/objectstore/query/ConstraintHelper.java", "license": "lgpl-2.1", "size": 15940 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,614,901
Calendar getCreateDate();
Calendar getCreateDate();
/** * Method for get create date of product. * * @return create date if product. */
Method for get create date of product
getCreateDate
{ "repo_name": "AlexanderZf44/APermyakov", "path": "chapter_004/src/main/java/ru/apermyakov/lsp/food/Products.java", "license": "apache-2.0", "size": 1851 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
2,485,996
private static void excludeProjectsWithoutLocation(WorkspaceImpl usersWorkspace, String projectPath) throws BadRequestException { final boolean notEmptyPath = projectPath != null; //Condition for sifting valid project in user's workspace Predicate<ProjectConfig> predicate = projectConfig -> { // if project is a sub project (it's path contains another project) , then location can be null final boolean isSubProject = projectConfig.getPath().indexOf('/', 1) != -1; final boolean hasNotEmptySource = projectConfig.getSource() != null && projectConfig.getSource().getType() != null && projectConfig.getSource().getLocation() != null; return !(notEmptyPath && !projectPath.equals(projectConfig.getPath())) && (isSubProject || hasNotEmptySource); }; // Filtered out projects by path and source storage presence final List<ProjectConfigImpl> filtered = usersWorkspace.getConfig() .getProjects() .stream() .filter(predicate) .collect(toList()); checkArgument(!filtered.isEmpty(), "Unable to create factory from this workspace, " + "because it does not contains projects with source storage"); usersWorkspace.getConfig().setProjects(filtered); }
static void function(WorkspaceImpl usersWorkspace, String projectPath) throws BadRequestException { final boolean notEmptyPath = projectPath != null; Predicate<ProjectConfig> predicate = projectConfig -> { final boolean isSubProject = projectConfig.getPath().indexOf('/', 1) != -1; final boolean hasNotEmptySource = projectConfig.getSource() != null && projectConfig.getSource().getType() != null && projectConfig.getSource().getLocation() != null; return !(notEmptyPath && !projectPath.equals(projectConfig.getPath())) && (isSubProject hasNotEmptySource); }; final List<ProjectConfigImpl> filtered = usersWorkspace.getConfig() .getProjects() .stream() .filter(predicate) .collect(toList()); checkArgument(!filtered.isEmpty(), STR + STR); usersWorkspace.getConfig().setProjects(filtered); }
/** * Filters workspace projects and removes projects without source location. * If there is no at least one project with source location then {@link BadRequestException} will be thrown */
Filters workspace projects and removes projects without source location. If there is no at least one project with source location then <code>BadRequestException</code> will be thrown
excludeProjectsWithoutLocation
{ "repo_name": "Mirage20/che", "path": "wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/FactoryService.java", "license": "epl-1.0", "size": 32416 }
[ "java.util.List", "java.util.function.Predicate", "org.eclipse.che.api.core.BadRequestException", "org.eclipse.che.api.core.model.project.ProjectConfig", "org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl", "org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl" ]
import java.util.List; import java.util.function.Predicate; import org.eclipse.che.api.core.BadRequestException; import org.eclipse.che.api.core.model.project.ProjectConfig; import org.eclipse.che.api.workspace.server.model.impl.ProjectConfigImpl; import org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl;
import java.util.*; import java.util.function.*; import org.eclipse.che.api.core.*; import org.eclipse.che.api.core.model.project.*; import org.eclipse.che.api.workspace.server.model.impl.*;
[ "java.util", "org.eclipse.che" ]
java.util; org.eclipse.che;
2,641,875
static boolean safePutBinder(Bundle bundle, String key, IBinder binder) { try { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { bundle.putBinder(key, binder); } else { Method putBinderMethod = Bundle.class.getMethod("putIBinder", String.class, IBinder.class); putBinderMethod.invoke(bundle, key, binder); } } catch (InvocationTargetException | IllegalAccessException | IllegalArgumentException | NoSuchMethodException e) { return false; } return true; }
static boolean safePutBinder(Bundle bundle, String key, IBinder binder) { try { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { bundle.putBinder(key, binder); } else { Method putBinderMethod = Bundle.class.getMethod(STR, String.class, IBinder.class); putBinderMethod.invoke(bundle, key, binder); } } catch (InvocationTargetException IllegalAccessException IllegalArgumentException NoSuchMethodException e) { return false; } return true; }
/** * A convenience method to handle putting an {@link IBinder} inside a {@link Bundle} for all * Android version. * @param bundle The bundle to insert the {@link IBinder}. * @param key The key to use while putting the {@link IBinder}. * @param binder The {@link IBinder} to put. * @return Whether the operation was successful. */
A convenience method to handle putting an <code>IBinder</code> inside a <code>Bundle</code> for all Android version
safePutBinder
{ "repo_name": "highweb-project/highweb-webcl-html5spec", "path": "chrome/android/java/src/android/support/customtabs/CustomTabsIntent.java", "license": "bsd-3-clause", "size": 8744 }
[ "android.os.Build", "android.os.Bundle", "android.os.IBinder", "java.lang.reflect.InvocationTargetException", "java.lang.reflect.Method" ]
import android.os.Build; import android.os.Bundle; import android.os.IBinder; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method;
import android.os.*; import java.lang.reflect.*;
[ "android.os", "java.lang" ]
android.os; java.lang;
1,007,411
@Test public void testRemoveAllCommandsForCluster() throws GenieException { Assert.assertEquals(3, this.service.getCommandsForCluster(CLUSTER_1_ID, null).size()); this.service.removeAllCommandsForCluster(CLUSTER_1_ID); Assert.assertEquals(0, this.service.getCommandsForCluster(CLUSTER_1_ID, null).size()); }
void function() throws GenieException { Assert.assertEquals(3, this.service.getCommandsForCluster(CLUSTER_1_ID, null).size()); this.service.removeAllCommandsForCluster(CLUSTER_1_ID); Assert.assertEquals(0, this.service.getCommandsForCluster(CLUSTER_1_ID, null).size()); }
/** * Test removing all commands for the cluster. * * @throws GenieException For any problem */
Test removing all commands for the cluster
testRemoveAllCommandsForCluster
{ "repo_name": "ajoymajumdar/genie", "path": "genie-core/src/test/java/com/netflix/genie/core/jpa/services/JpaClusterServiceImplIntegrationTests.java", "license": "apache-2.0", "size": 42407 }
[ "com.netflix.genie.common.exceptions.GenieException", "org.junit.Assert" ]
import com.netflix.genie.common.exceptions.GenieException; import org.junit.Assert;
import com.netflix.genie.common.exceptions.*; import org.junit.*;
[ "com.netflix.genie", "org.junit" ]
com.netflix.genie; org.junit;
1,170,407
private static native long create() throws IOException;
static native long function() throws IOException;
/** * Creates the native socket object * @return Handle to the native object * @throws IOException */
Creates the native socket object
create
{ "repo_name": "tarotanaka0/avian", "path": "classpath/java/net/Socket.java", "license": "isc", "size": 4998 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
865,713
void endOfStream(ReadableCoordinator coordinator); /** * Indicates whether {@link #window} should be invoked on this task. If true, {@link RunLoop}
void endOfStream(ReadableCoordinator coordinator); /** * Indicates whether {@link #window} should be invoked on this task. If true, {@link RunLoop}
/** * Called when all {@link SystemStreamPartition} processed by a task have reached end of stream. This is called only * once per task. {@link RunLoop} will issue a shutdown request to the coordinator immediately following the * invocation of this method. * * @param coordinator manages execution of tasks. */
Called when all <code>SystemStreamPartition</code> processed by a task have reached end of stream. This is called only once per task. <code>RunLoop</code> will issue a shutdown request to the coordinator immediately following the invocation of this method
endOfStream
{ "repo_name": "prateekm/samza", "path": "samza-core/src/main/java/org/apache/samza/container/RunLoopTask.java", "license": "apache-2.0", "size": 5698 }
[ "org.apache.samza.task.ReadableCoordinator" ]
import org.apache.samza.task.ReadableCoordinator;
import org.apache.samza.task.*;
[ "org.apache.samza" ]
org.apache.samza;
1,553,493
@Nonnull public Matrix minusEquals (@Nonnull final Matrix aMatrix) { _checkMatrixDimensions (aMatrix); for (int nRow = 0; nRow < m_nRows; nRow++) { final double [] aSrcRow = aMatrix.m_aData[nRow]; final double [] aDstRow = m_aData[nRow]; for (int nCol = 0; nCol < m_nCols; nCol++) aDstRow[nCol] -= aSrcRow[nCol]; } return this; }
Matrix function (@Nonnull final Matrix aMatrix) { _checkMatrixDimensions (aMatrix); for (int nRow = 0; nRow < m_nRows; nRow++) { final double [] aSrcRow = aMatrix.m_aData[nRow]; final double [] aDstRow = m_aData[nRow]; for (int nCol = 0; nCol < m_nCols; nCol++) aDstRow[nCol] -= aSrcRow[nCol]; } return this; }
/** * A = A - B * * @param aMatrix * another matrix * @return this */
A = A - B
minusEquals
{ "repo_name": "phax/ph-commons", "path": "ph-matrix/src/main/java/com/helger/matrix/Matrix.java", "license": "apache-2.0", "size": 40182 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
2,118,730
//----------------------------------------------------------------------- public ExternalId getOvernightIndexConvention() { return _overnightIndexConvention; }
ExternalId function() { return _overnightIndexConvention; }
/** * Gets the overnight index convention. * @return the value of the property, not null */
Gets the overnight index convention
getOvernightIndexConvention
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-FinancialTypes/src/main/java/com/opengamma/financial/convention/OISLegConvention.java", "license": "apache-2.0", "size": 22332 }
[ "com.opengamma.id.ExternalId" ]
import com.opengamma.id.ExternalId;
import com.opengamma.id.*;
[ "com.opengamma.id" ]
com.opengamma.id;
1,129,535
public Builder assembledMessageCallback(final BiConsumer<Object, ActorRef> newAssembledMessageCallback) { this.assembledMessageCallback = newAssembledMessageCallback; return this; }
Builder function(final BiConsumer<Object, ActorRef> newAssembledMessageCallback) { this.assembledMessageCallback = newAssembledMessageCallback; return this; }
/** * Sets the Consumer callback for assembled messages. The callback takes the assembled message and the * original sender ActorRef as arguments. * * @param newAssembledMessageCallback the Consumer callback * @return this Builder */
Sets the Consumer callback for assembled messages. The callback takes the assembled message and the original sender ActorRef as arguments
assembledMessageCallback
{ "repo_name": "opendaylight/controller", "path": "opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/messaging/MessageAssembler.java", "license": "epl-1.0", "size": 12049 }
[ "java.util.function.BiConsumer" ]
import java.util.function.BiConsumer;
import java.util.function.*;
[ "java.util" ]
java.util;
150,116
private static void joinLinks(Cluster[][] grid, int nxbins, int nybins, ArrayList<Cluster> candidates) { candidates.clear(); for (int ybin = 0; ybin < nybins; ybin++) { for (int xbin = 0; xbin < nxbins; xbin++) { for (Cluster c1 = grid[xbin][ybin]; c1 != null; c1 = c1.next) { if (c1.validLink()) { c1.add(c1.closest); } // Reset the link candidates c1.closest = null; // Store all remaining clusters if (c1.size != 0) { candidates.add(c1); } } // Reset the grid grid[xbin][ybin] = null; } } }
static void function(Cluster[][] grid, int nxbins, int nybins, ArrayList<Cluster> candidates) { candidates.clear(); for (int ybin = 0; ybin < nybins; ybin++) { for (int xbin = 0; xbin < nxbins; xbin++) { for (Cluster c1 = grid[xbin][ybin]; c1 != null; c1 = c1.next) { if (c1.validLink()) { c1.add(c1.closest); } c1.closest = null; if (c1.size != 0) { candidates.add(c1); } } grid[xbin][ybin] = null; } } }
/** * Join valid links between clusters. Resets the link candidates. * * @param grid the grid * @param nxbins the number of X bins * @param nybins the number of Y bins * @param candidates Re-populate will all the remaining clusters */
Join valid links between clusters. Resets the link candidates
joinLinks
{ "repo_name": "aherbert/GDSC", "path": "src/main/java/uk/ac/sussex/gdsc/foci/SpotPairs_PlugIn.java", "license": "gpl-3.0", "size": 16986 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,200,828
public void setSerializer(Serializer serializer) { this.serializer = serializer; }
void function(Serializer serializer) { this.serializer = serializer; }
/** * Setter for serializer. * * @param serializer New serializer */
Setter for serializer
setSerializer
{ "repo_name": "cwpenhale/red5-mobileconsole", "path": "red5_server/src/main/java/org/red5/server/net/remoting/codec/RemotingProtocolEncoder.java", "license": "apache-2.0", "size": 6515 }
[ "org.red5.io.object.Serializer" ]
import org.red5.io.object.Serializer;
import org.red5.io.object.*;
[ "org.red5.io" ]
org.red5.io;
2,587,060
public void setRectDifferences(float differenceLeft, float differenceTop, float differenceRight, float differenceBottom) { COSArray margins = new COSArray(); margins.add(new COSFloat(differenceLeft)); margins.add(new COSFloat(differenceTop)); margins.add(new COSFloat(differenceRight)); margins.add(new COSFloat(differenceBottom)); getCOSObject().setItem(COSName.RD, margins); }
void function(float differenceLeft, float differenceTop, float differenceRight, float differenceBottom) { COSArray margins = new COSArray(); margins.add(new COSFloat(differenceLeft)); margins.add(new COSFloat(differenceTop)); margins.add(new COSFloat(differenceRight)); margins.add(new COSFloat(differenceBottom)); getCOSObject().setItem(COSName.RD, margins); }
/** * This will set the difference between the annotations "outer" rectangle defined by * /Rect and the border. * * @param differenceLeft left difference from the annotations /Rect entry * @param differenceTop top difference from the annotations /Rect entry * @param differenceRight right difference from the annotations /Rect entry * @param differenceBottom bottom difference from the annotations /Rect entry * */
This will set the difference between the annotations "outer" rectangle defined by Rect and the border
setRectDifferences
{ "repo_name": "TomRoush/PdfBox-Android", "path": "library/src/main/java/com/tom_roush/pdfbox/pdmodel/interactive/annotation/PDAnnotationSquareCircle.java", "license": "apache-2.0", "size": 9475 }
[ "com.tom_roush.pdfbox.cos.COSArray", "com.tom_roush.pdfbox.cos.COSFloat", "com.tom_roush.pdfbox.cos.COSName" ]
import com.tom_roush.pdfbox.cos.COSArray; import com.tom_roush.pdfbox.cos.COSFloat; import com.tom_roush.pdfbox.cos.COSName;
import com.tom_roush.pdfbox.cos.*;
[ "com.tom_roush.pdfbox" ]
com.tom_roush.pdfbox;
2,620,322
final Configuration initialConfiguration = new Configuration(); final Configuration configuration = loadConfiguration(initialConfiguration); // having not specified the ports should set the rest bind port to 0 assertThat(configuration.getString(RestOptions.BIND_PORT), is(equalTo("0"))); }
final Configuration initialConfiguration = new Configuration(); final Configuration configuration = loadConfiguration(initialConfiguration); assertThat(configuration.getString(RestOptions.BIND_PORT), is(equalTo("0"))); }
/** * Tests that the REST ports are correctly set when loading a {@link Configuration} * with unspecified REST options. */
Tests that the REST ports are correctly set when loading a <code>Configuration</code> with unspecified REST options
testRestPortOptionsUnspecified
{ "repo_name": "fhueske/flink", "path": "flink-yarn/src/test/java/org/apache/flink/yarn/entrypoint/YarnEntrypointUtilsTest.java", "license": "apache-2.0", "size": 4071 }
[ "org.apache.flink.configuration.Configuration", "org.apache.flink.configuration.RestOptions", "org.hamcrest.Matchers", "org.junit.Assert" ]
import org.apache.flink.configuration.Configuration; import org.apache.flink.configuration.RestOptions; import org.hamcrest.Matchers; import org.junit.Assert;
import org.apache.flink.configuration.*; import org.hamcrest.*; import org.junit.*;
[ "org.apache.flink", "org.hamcrest", "org.junit" ]
org.apache.flink; org.hamcrest; org.junit;
2,848,566
protected void assertIsExecutable(String scriptName, String methodName) throws SecurityException { Policy policy = (Policy) policyMap.get(scriptName); if (policy == null) { return; } // Find a match for this method in the policy rules String match = null; for (Iterator it = policy.rules.iterator(); it.hasNext() && match == null;) { String test = (String) it.next(); // If at some point we wish to do regex matching on rules, here is // the place to do it. if (methodName.equals(test)) { match = test; } } if (policy.defaultAllow && match != null) { // We are in default allow mode so the rules are exclusions and we // have a match, so this method is excluded. //log.debug("method excluded for creator " + type + " due to defaultAllow=" + policy.defaultAllow + " and rule: " + match); throw new SecurityException(Messages.getString("DefaultAccessControl.DeniedByAccessRules")); } // There may be a more optimized if statement here, but I value code // clarity over performance. //noinspection RedundantIfStatement if (!policy.defaultAllow && match == null) { // We are in default deny mode so the rules are inclusions and we // do not have a match, so this method is excluded. //log.debug("method excluded for creator " + type + " due to defaultAllow=" + policy.defaultAllow + " and rule: " + match); throw new SecurityException(Messages.getString("DefaultAccessControl.DeniedByAccessRules")); } }
void function(String scriptName, String methodName) throws SecurityException { Policy policy = (Policy) policyMap.get(scriptName); if (policy == null) { return; } String match = null; for (Iterator it = policy.rules.iterator(); it.hasNext() && match == null;) { String test = (String) it.next(); if (methodName.equals(test)) { match = test; } } if (policy.defaultAllow && match != null) { throw new SecurityException(Messages.getString(STR)); } if (!policy.defaultAllow && match == null) { throw new SecurityException(Messages.getString(STR)); } }
/** * Test to see if a method is excluded or included. * @param scriptName The name of the creator to Javascript * @param methodName The name of the method (without brackets) * @throws SecurityException if the method is allowed by the rules in addIncludeRule() * @see AccessControl#addIncludeRule(String, String) */
Test to see if a method is excluded or included
assertIsExecutable
{ "repo_name": "simeshev/parabuild-ci", "path": "3rdparty/dwr-2.0.1/src/java/org/directwebremoting/impl/DefaultAccessControl.java", "license": "lgpl-3.0", "size": 12250 }
[ "java.util.Iterator", "org.directwebremoting.util.Messages" ]
import java.util.Iterator; import org.directwebremoting.util.Messages;
import java.util.*; import org.directwebremoting.util.*;
[ "java.util", "org.directwebremoting.util" ]
java.util; org.directwebremoting.util;
2,267,170
public List<TestNode> nodes() { return nodes; }
List<TestNode> function() { return nodes; }
/** * Returns a list of test nodes. * * @return A list of test nodes. */
Returns a list of test nodes
nodes
{ "repo_name": "quantiply-fork/copycat", "path": "core/src/test/java/net/kuujo/copycat/test/TestCluster.java", "license": "apache-2.0", "size": 1979 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,874,674
public Wireable createWireable(final int type) { try { final WireableBuilder builder = builders.get(type); Assert.assertNotNull(builder, "Unregistered type: {0}", type); return builder.create(); } catch (final RuntimeException e) { throw e; } catch (final Exception e) { throw new IllegalStateException(e); } }
Wireable function(final int type) { try { final WireableBuilder builder = builders.get(type); Assert.assertNotNull(builder, STR, type); return builder.create(); } catch (final RuntimeException e) { throw e; } catch (final Exception e) { throw new IllegalStateException(e); } }
/** * Creates a <code>Wireable</code> associated with the given unique <code>type</code>. * * @param type unique type * @return the <code>Wireable</code> associated with the given unique <code>type</code>. * @throws IllegalStateException if error occurred while creating a <code>Wireable</code> * @see #getInstance() */
Creates a <code>Wireable</code> associated with the given unique <code>type</code>
createWireable
{ "repo_name": "cacheonix/cacheonix-core", "path": "src/org/cacheonix/impl/net/serializer/WireableFactory.java", "license": "lgpl-2.1", "size": 19948 }
[ "org.cacheonix.impl.util.Assert" ]
import org.cacheonix.impl.util.Assert;
import org.cacheonix.impl.util.*;
[ "org.cacheonix.impl" ]
org.cacheonix.impl;
121,485
protected RuntimeServices getRuntimeServices() { return rs; }
RuntimeServices function() { return rs; }
/** * Retrieve a reference to RuntimeServices. Use this for checking additional * configuration properties. * * @return The current runtime services object. */
Retrieve a reference to RuntimeServices. Use this for checking additional configuration properties
getRuntimeServices
{ "repo_name": "gogamoga/velocity-engine-1.6.4", "path": "src/java/org/apache/velocity/app/event/implement/EscapeReference.java", "license": "apache-2.0", "size": 5219 }
[ "org.apache.velocity.runtime.RuntimeServices" ]
import org.apache.velocity.runtime.RuntimeServices;
import org.apache.velocity.runtime.*;
[ "org.apache.velocity" ]
org.apache.velocity;
2,414,923
public IPet getPet(){ return this.pet; }
IPet function(){ return this.pet; }
/** * Gets the {@link com.dsh105.echopet.api.pet.Pet} involved in this event * * @return the {@link com.dsh105.echopet.api.pet.Pet} involved */
Gets the <code>com.dsh105.echopet.api.pet.Pet</code> involved in this event
getPet
{ "repo_name": "Borlea/EchoPet", "path": "modules/API/src/com/dsh105/echopet/compat/api/event/PetDamageEvent.java", "license": "gpl-3.0", "size": 2765 }
[ "com.dsh105.echopet.compat.api.entity.IPet" ]
import com.dsh105.echopet.compat.api.entity.IPet;
import com.dsh105.echopet.compat.api.entity.*;
[ "com.dsh105.echopet" ]
com.dsh105.echopet;
2,740,361
@Nullable public static PsiPrimitiveType getUnboxedType(PsiType type) { if (!(type instanceof PsiClassType)) return null; LanguageLevel languageLevel = ((PsiClassType)type).getLanguageLevel(); if (!languageLevel.isAtLeast(LanguageLevel.JDK_1_5)) return null; assert type.isValid() : type; PsiClass psiClass = ((PsiClassType)type).resolve(); if (psiClass == null) return null; PsiPrimitiveType unboxed = ourQNameToUnboxed.get(psiClass.getQualifiedName()); PsiAnnotation[] annotations = type.getAnnotations(); if (unboxed != null && annotations.length > 0) { unboxed = new PsiPrimitiveType(unboxed.myName, annotations); } return unboxed; }
static PsiPrimitiveType function(PsiType type) { if (!(type instanceof PsiClassType)) return null; LanguageLevel languageLevel = ((PsiClassType)type).getLanguageLevel(); if (!languageLevel.isAtLeast(LanguageLevel.JDK_1_5)) return null; assert type.isValid() : type; PsiClass psiClass = ((PsiClassType)type).resolve(); if (psiClass == null) return null; PsiPrimitiveType unboxed = ourQNameToUnboxed.get(psiClass.getQualifiedName()); PsiAnnotation[] annotations = type.getAnnotations(); if (unboxed != null && annotations.length > 0) { unboxed = new PsiPrimitiveType(unboxed.myName, annotations); } return unboxed; }
/** * Returns the primitive type corresponding to a boxed class type. * * @param type the type to get the unboxed primitive type for. * @return the primitive type, or null if the type does not represent a boxed primitive type. */
Returns the primitive type corresponding to a boxed class type
getUnboxedType
{ "repo_name": "ivan-fedorov/intellij-community", "path": "java/java-psi-api/src/com/intellij/psi/PsiPrimitiveType.java", "license": "apache-2.0", "size": 5881 }
[ "com.intellij.pom.java.LanguageLevel" ]
import com.intellij.pom.java.LanguageLevel;
import com.intellij.pom.java.*;
[ "com.intellij.pom" ]
com.intellij.pom;
1,814,414
public View getMenu() { return mViewBehind.getContent(); }
View function() { return mViewBehind.getContent(); }
/** * Retrieves the main menu. * @return the main menu */
Retrieves the main menu
getMenu
{ "repo_name": "danoulis/booking-app-android", "path": "src/com/slidingmenu/lib/SlidingMenu.java", "license": "gpl-3.0", "size": 28227 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
2,338,031
protected void addPrimaryKeyPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ConstraintsType_primaryKey_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ConstraintsType_primaryKey_feature", "_UI_ConstraintsType_type"), DbchangelogPackage.eINSTANCE.getConstraintsType_PrimaryKey(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), DbchangelogPackage.eINSTANCE.getConstraintsType_PrimaryKey(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
/** * This adds a property descriptor for the Primary Key feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Primary Key feature.
addPrimaryKeyPropertyDescriptor
{ "repo_name": "Treehopper/EclipseAugments", "path": "liquibase-editor/eu.hohenegger.xsd.liquibase.ui/src-gen/org/liquibase/xml/ns/dbchangelog/provider/ConstraintsTypeItemProvider.java", "license": "epl-1.0", "size": 19375 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor", "org.liquibase.xml.ns.dbchangelog.DbchangelogPackage" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.liquibase.xml.ns.dbchangelog.DbchangelogPackage;
import org.eclipse.emf.edit.provider.*; import org.liquibase.xml.ns.dbchangelog.*;
[ "org.eclipse.emf", "org.liquibase.xml" ]
org.eclipse.emf; org.liquibase.xml;
1,165,047
public void setHaves(String haves) { String[] havesArray = COMMA_SEPARATOR.split(haves); mHaves = Arrays.asList(havesArray); }
void function(String haves) { String[] havesArray = COMMA_SEPARATOR.split(haves); mHaves = Arrays.asList(havesArray); }
/** * Replace the current haves with the ones from the param. * * @param haves String with haves with the format have1, have2, have3, have4 */
Replace the current haves with the ones from the param
setHaves
{ "repo_name": "CiprianU/xing-android-sdk", "path": "sdk/src/main/java/com/xing/android/sdk/model/user/XingUser.java", "license": "mit", "size": 25896 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
196,963
@Override() public java.lang.Class getJavaClass( ) { return org.chocolate_milk.model.ItemReceiptRet.class; }
@Override() java.lang.Class function( ) { return org.chocolate_milk.model.ItemReceiptRet.class; }
/** * Method getJavaClass. * * @return the Java class represented by this descriptor. */
Method getJavaClass
getJavaClass
{ "repo_name": "galleon1/chocolate-milk", "path": "src/org/chocolate_milk/model/descriptors/ItemReceiptRetDescriptor.java", "license": "lgpl-3.0", "size": 34377 }
[ "org.chocolate_milk.model.ItemReceiptRet" ]
import org.chocolate_milk.model.ItemReceiptRet;
import org.chocolate_milk.model.*;
[ "org.chocolate_milk.model" ]
org.chocolate_milk.model;
297,568
@Override public Connection getConnection() throws SQLException { try { return this.dataSourceToUse.getConnection(); } catch (SQLException ex) { JDBCExceptionReporter.logExceptions(ex); throw ex; } }
Connection function() throws SQLException { try { return this.dataSourceToUse.getConnection(); } catch (SQLException ex) { JDBCExceptionReporter.logExceptions(ex); throw ex; } }
/** * This implementation delegates to the underlying DataSource. * @see javax.sql.DataSource#getConnection() */
This implementation delegates to the underlying DataSource
getConnection
{ "repo_name": "leogoing/spring_jeesite", "path": "spring-orm-4.0/org/springframework/orm/hibernate3/LocalDataSourceConnectionProvider.java", "license": "apache-2.0", "size": 3721 }
[ "java.sql.Connection", "java.sql.SQLException", "org.hibernate.util.JDBCExceptionReporter" ]
import java.sql.Connection; import java.sql.SQLException; import org.hibernate.util.JDBCExceptionReporter;
import java.sql.*; import org.hibernate.util.*;
[ "java.sql", "org.hibernate.util" ]
java.sql; org.hibernate.util;
2,387,395
public static Runner GetRunner(String pRunnerCode, Connection pSqlConnection) throws SQLException, RunnerNotFoundException { Runner runner = null; Statement runnerStatement = pSqlConnection.createStatement(); ResultSet runnerResult = runnerStatement .executeQuery("SELECT * FROM database.Runner WHERE code='" + pRunnerCode + "'"); if (runnerResult.next()) { runner = new Runner(runnerResult.getInt("idRunner"), runnerResult.getString("name"), runnerResult.getString("status"), Split.ParseSplits(runnerResult.getString("splits"))); } else { throw new RunnerNotFoundException(pRunnerCode); } return runner; }
static Runner function(String pRunnerCode, Connection pSqlConnection) throws SQLException, RunnerNotFoundException { Runner runner = null; Statement runnerStatement = pSqlConnection.createStatement(); ResultSet runnerResult = runnerStatement .executeQuery(STR + pRunnerCode + "'"); if (runnerResult.next()) { runner = new Runner(runnerResult.getInt(STR), runnerResult.getString("name"), runnerResult.getString(STR), Split.ParseSplits(runnerResult.getString(STR))); } else { throw new RunnerNotFoundException(pRunnerCode); } return runner; }
/** * Returns the runner with the given code. * * @param pRunnerCode * The code of the runner. * @param pSqlConnection * The sqlConnection to be used. * @return The runner with the given code. * @throws SQLException * @throws RunnerNotFoundException * Is thrown if there is no runner with the given code. */
Returns the runner with the given code
GetRunner
{ "repo_name": "ToxicJojo/ToxicTimerOld", "path": "src/org/jojo/toxictimer/api/Runner.java", "license": "mit", "size": 5466 }
[ "java.sql.Connection", "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Statement", "org.jojo.toxictimer.api.exceptions.RunnerNotFoundException" ]
import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import org.jojo.toxictimer.api.exceptions.RunnerNotFoundException;
import java.sql.*; import org.jojo.toxictimer.api.exceptions.*;
[ "java.sql", "org.jojo.toxictimer" ]
java.sql; org.jojo.toxictimer;
1,683,700
public static List<Point> getLinearMotionPath ( Point start, Point end, double step) throws Exception { List<Point> motionPath = new ArrayList<>(); LinearMotionType motionType = getLinearMotionType(start, end); Point currPoint; currPoint = start; motionPath.add(currPoint); if (motionType == LinearMotionType.SAME_POINT) { return motionPath; } else if (motionType == LinearMotionType.HORIZONTAL) { if (getMotionDicrection(start.getX(), end.getX() ) == MotionDirection.INCREMENTAL) { while (currPoint.getX() < end.getX() ) { if ((currPoint.getX() + step) <= end.getX() ) { currPoint = (Point)new Point.Double( (currPoint.getX() ) + step, currPoint.getY() ); } else { currPoint = (Point)new Point.Double(end.getX(), currPoint.getY() ); } motionPath.add(currPoint); } } else { if ((currPoint.getX() + step) >= end.getX() ) { currPoint = (Point)new Point.Double( (currPoint.getX() ) - step, currPoint.getY() ); } else { currPoint = (Point)new Point.Double(end.getX(), currPoint.getY() ); } motionPath.add(currPoint); } } else if (motionType == LinearMotionType.VERTICAL) { if (getMotionDicrection(start.getY(), end.getY() ) == MotionDirection.INCREMENTAL) { while (currPoint.getY() < end.getY() ) { if ((currPoint.getY() + step) <= end.getY() ) { currPoint = (Point)new Point.Double( currPoint.getX(), (currPoint.getY() ) + step); } else { currPoint = (Point)new Point.Double(currPoint.getX(), end.getY() ); } motionPath.add(currPoint); } } else { if ((currPoint.getY() + step) >= end.getY() ) { currPoint = (Point)new Point.Double( currPoint.getX(), (currPoint.getY() ) - step); } else { currPoint = (Point)new Point.Double(currPoint.getX(), end.getY() ); } motionPath.add(currPoint); } } else if (motionType == LinearMotionType.OTHER) { double slope = (((double)(start.getY() ) ) - ((double)(end.getY() ) ) ) / (((double)(start.getX() ) ) - ((double)(end.getX() ) ) ); double c = (((double)start.getY() ) - ((double)start.getX() ) ) * slope; if (Math.abs(Math.abs(end.getX() ) - Math.abs(end.getX() ) ) > Math.abs(Math.abs(end.getY() ) - Math.abs(start.getY() ) ) ) { if (getMotionDicrection(start.getX(), end.getX() ) == MotionDirection.INCREMENTAL) { while (end.getX() > currPoint.getX() ) { currPoint = (Point)new Point.Double( currPoint.getX() + step, (slope * (currPoint.getX() + step) ) + c); if (currPoint.getX() > end.getX() ) { currPoint = (Point)new Point.Double( end.getX(), (slope * end.getX() ) + c); } motionPath.add(currPoint); } } else { while (end.getX() < currPoint.getX() ) { currPoint = (Point)new Point.Double( currPoint.getX() - step, (slope * (currPoint.getX() - step) ) + c); if (currPoint.getX() < end.getX() ) { currPoint = (Point)new Point.Double( end.getX(), (slope * end.getX() ) + c); } motionPath.add(currPoint); } } } else { if (getMotionDicrection(start.getY(), end.getY() ) == MotionDirection.INCREMENTAL) { while (end.getY() > currPoint.getY() ) { currPoint = (Point)new Point.Double( (currPoint.getY() + step - c) / slope, currPoint.getY() + step); if (currPoint.getY() > end.getY() ) { currPoint = (Point)new Point.Double( (end.getY() - c) / slope, end.getY() ); } motionPath.add(currPoint); } } else { while (end.getY() < currPoint.getY() ) { currPoint = (Point)new Point.Double( (currPoint.getY() - step - c) / slope, currPoint.getY() - step); if (currPoint.getY() < end.getY() ) { currPoint = (Point)new Point.Double( (end.getY() - c) / slope, end.getY() ); } motionPath.add(currPoint); } } } } return motionPath; }
static List<Point> function ( Point start, Point end, double step) throws Exception { List<Point> motionPath = new ArrayList<>(); LinearMotionType motionType = getLinearMotionType(start, end); Point currPoint; currPoint = start; motionPath.add(currPoint); if (motionType == LinearMotionType.SAME_POINT) { return motionPath; } else if (motionType == LinearMotionType.HORIZONTAL) { if (getMotionDicrection(start.getX(), end.getX() ) == MotionDirection.INCREMENTAL) { while (currPoint.getX() < end.getX() ) { if ((currPoint.getX() + step) <= end.getX() ) { currPoint = (Point)new Point.Double( (currPoint.getX() ) + step, currPoint.getY() ); } else { currPoint = (Point)new Point.Double(end.getX(), currPoint.getY() ); } motionPath.add(currPoint); } } else { if ((currPoint.getX() + step) >= end.getX() ) { currPoint = (Point)new Point.Double( (currPoint.getX() ) - step, currPoint.getY() ); } else { currPoint = (Point)new Point.Double(end.getX(), currPoint.getY() ); } motionPath.add(currPoint); } } else if (motionType == LinearMotionType.VERTICAL) { if (getMotionDicrection(start.getY(), end.getY() ) == MotionDirection.INCREMENTAL) { while (currPoint.getY() < end.getY() ) { if ((currPoint.getY() + step) <= end.getY() ) { currPoint = (Point)new Point.Double( currPoint.getX(), (currPoint.getY() ) + step); } else { currPoint = (Point)new Point.Double(currPoint.getX(), end.getY() ); } motionPath.add(currPoint); } } else { if ((currPoint.getY() + step) >= end.getY() ) { currPoint = (Point)new Point.Double( currPoint.getX(), (currPoint.getY() ) - step); } else { currPoint = (Point)new Point.Double(currPoint.getX(), end.getY() ); } motionPath.add(currPoint); } } else if (motionType == LinearMotionType.OTHER) { double slope = (((double)(start.getY() ) ) - ((double)(end.getY() ) ) ) / (((double)(start.getX() ) ) - ((double)(end.getX() ) ) ); double c = (((double)start.getY() ) - ((double)start.getX() ) ) * slope; if (Math.abs(Math.abs(end.getX() ) - Math.abs(end.getX() ) ) > Math.abs(Math.abs(end.getY() ) - Math.abs(start.getY() ) ) ) { if (getMotionDicrection(start.getX(), end.getX() ) == MotionDirection.INCREMENTAL) { while (end.getX() > currPoint.getX() ) { currPoint = (Point)new Point.Double( currPoint.getX() + step, (slope * (currPoint.getX() + step) ) + c); if (currPoint.getX() > end.getX() ) { currPoint = (Point)new Point.Double( end.getX(), (slope * end.getX() ) + c); } motionPath.add(currPoint); } } else { while (end.getX() < currPoint.getX() ) { currPoint = (Point)new Point.Double( currPoint.getX() - step, (slope * (currPoint.getX() - step) ) + c); if (currPoint.getX() < end.getX() ) { currPoint = (Point)new Point.Double( end.getX(), (slope * end.getX() ) + c); } motionPath.add(currPoint); } } } else { if (getMotionDicrection(start.getY(), end.getY() ) == MotionDirection.INCREMENTAL) { while (end.getY() > currPoint.getY() ) { currPoint = (Point)new Point.Double( (currPoint.getY() + step - c) / slope, currPoint.getY() + step); if (currPoint.getY() > end.getY() ) { currPoint = (Point)new Point.Double( (end.getY() - c) / slope, end.getY() ); } motionPath.add(currPoint); } } else { while (end.getY() < currPoint.getY() ) { currPoint = (Point)new Point.Double( (currPoint.getY() - step - c) / slope, currPoint.getY() - step); if (currPoint.getY() < end.getY() ) { currPoint = (Point)new Point.Double( (end.getY() - c) / slope, end.getY() ); } motionPath.add(currPoint); } } } } return motionPath; }
/** * getLinearMotionPath * finds a list of points that linearly starts with start point and ends with * end point * @param start * @param end * @param step: distance between each two points on the path * @return list of points representing the path from start to end * @throws Exception */
getLinearMotionPath finds a list of points that linearly starts with start point and ends with end point
getLinearMotionPath
{ "repo_name": "vangav/vos_backend", "path": "src/com/vangav/backend/math/geometry/Motion2DInl.java", "license": "mit", "size": 8559 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,710,013
public void property(String name, LexicalUnit value, boolean important) throws CSSException { int i = getPropertyIndex(name); if (i == -1) { i = getShorthandIndex(name); if (i == -1) { // Unknown property return; } shorthandManagers[i].setValues(CSSEngine.this, this, value, important); } else { if (styleMap.isImportant(i)) { // The previous value is important, and a value // from a style attribute cannot be important... return; } updatedProperties[i] = true; Value v = valueManagers[i].createValue(value, CSSEngine.this); styleMap.putMask(i, (short)0); styleMap.putValue(i, v); styleMap.putOrigin(i, StyleMap.INLINE_AUTHOR_ORIGIN); } } }
void function(String name, LexicalUnit value, boolean important) throws CSSException { int i = getPropertyIndex(name); if (i == -1) { i = getShorthandIndex(name); if (i == -1) { return; } shorthandManagers[i].setValues(CSSEngine.this, this, value, important); } else { if (styleMap.isImportant(i)) { return; } updatedProperties[i] = true; Value v = valueManagers[i].createValue(value, CSSEngine.this); styleMap.putMask(i, (short)0); styleMap.putValue(i, v); styleMap.putOrigin(i, StyleMap.INLINE_AUTHOR_ORIGIN); } } }
/** * <b>SAC</b>: Implements {@link * DocumentHandler#property(String,LexicalUnit,boolean)}. */
SAC: Implements <code>DocumentHandler#property(String,LexicalUnit,boolean)</code>
property
{ "repo_name": "apache/batik", "path": "batik-css/src/main/java/org/apache/batik/css/engine/CSSEngine.java", "license": "apache-2.0", "size": 90735 }
[ "org.apache.batik.css.engine.value.Value", "org.w3c.css.sac.CSSException", "org.w3c.css.sac.LexicalUnit" ]
import org.apache.batik.css.engine.value.Value; import org.w3c.css.sac.CSSException; import org.w3c.css.sac.LexicalUnit;
import org.apache.batik.css.engine.value.*; import org.w3c.css.sac.*;
[ "org.apache.batik", "org.w3c.css" ]
org.apache.batik; org.w3c.css;
1,934,161
Vo getMemberVo(PerunSession sess, Member member) throws MemberNotExistsException;
Vo getMemberVo(PerunSession sess, Member member) throws MemberNotExistsException;
/** * Get the member VO. * * @param sess * @param member * @return member's VO * @throws InternalErrorException * @throws MemberNotExistsException */
Get the member VO
getMemberVo
{ "repo_name": "balcirakpeter/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/api/MembersManager.java", "license": "bsd-2-clause", "size": 64459 }
[ "cz.metacentrum.perun.core.api.exceptions.MemberNotExistsException" ]
import cz.metacentrum.perun.core.api.exceptions.MemberNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.*;
[ "cz.metacentrum.perun" ]
cz.metacentrum.perun;
2,691,064