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
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public BigDecimal getBigDecimal(String key) throws JSONException { Object object = this.get(key); BigDecimal ret = objectToBigDecimal(object, null); if (ret != null) { return ret; } throw wrongValueFormatException(key, "BigDecimal", object, null); }
BigDecimal function(String key) throws JSONException { Object object = this.get(key); BigDecimal ret = objectToBigDecimal(object, null); if (ret != null) { return ret; } throw wrongValueFormatException(key, STR, object, null); }
/** * Get the BigDecimal value associated with a key. If the value is float or * double, the the {@link BigDecimal#BigDecimal(double)} constructor will * be used. See notes on the constructor for conversion issues that may * arise. * * @param key * A key string. * @return The numeric value. * @throws JSONException * if the key is not found or if the value * cannot be converted to BigDecimal. */
Get the BigDecimal value associated with a key. If the value is float or double, the the <code>BigDecimal#BigDecimal(double)</code> constructor will be used. See notes on the constructor for conversion issues that may arise
getBigDecimal
{ "repo_name": "xushaomin/appleframework", "path": "apple-commons/src/main/java/com/appleframework/tools/json/JSONObject.java", "license": "apache-2.0", "size": 93667 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
2,067,030
public synchronized void release( String tag, Texture texture ) { if ( enabled && ( tag != null ) && ( texture != null ) ) { ArrayList<WeakReference<Texture>> cacheList = textureMap.get( tag ); if ( cacheList != null ) { // the tag exists, walk through the entries looking for a match for ( int i = cacheList.size( )-1; i >= 0; i-- ) { WeakReference<Texture> ref = cacheList.get( i ); if ( ref == null ) { cacheList.remove( i ); } else { Texture cachedTexture = ref.get( ); if ( cachedTexture == null ) { cacheList.remove( i ); } else if ( isMatch( cachedTexture, texture ) ) { cacheList.remove( i ); break; } } } } } }
synchronized void function( String tag, Texture texture ) { if ( enabled && ( tag != null ) && ( texture != null ) ) { ArrayList<WeakReference<Texture>> cacheList = textureMap.get( tag ); if ( cacheList != null ) { for ( int i = cacheList.size( )-1; i >= 0; i-- ) { WeakReference<Texture> ref = cacheList.get( i ); if ( ref == null ) { cacheList.remove( i ); } else { Texture cachedTexture = ref.get( ); if ( cachedTexture == null ) { cacheList.remove( i ); } else if ( isMatch( cachedTexture, texture ) ) { cacheList.remove( i ); break; } } } } } }
/** * Explicitly remove the Texture from the cache. If the object * has already been freed, this request is silently ignored. * * @param tag The texture id, typically it's URL string * @param texture The Texture to release */
Explicitly remove the Texture from the cache. If the object has already been freed, this request is silently ignored
release
{ "repo_name": "Norkart/NK-VirtualGlobe", "path": "Xj3D/src/java/org/web3d/vrml/renderer/ogl/nodes/TextureCache.java", "license": "gpl-2.0", "size": 8582 }
[ "java.lang.ref.WeakReference", "java.util.ArrayList", "org.j3d.aviatrix3d.Texture" ]
import java.lang.ref.WeakReference; import java.util.ArrayList; import org.j3d.aviatrix3d.Texture;
import java.lang.ref.*; import java.util.*; import org.j3d.aviatrix3d.*;
[ "java.lang", "java.util", "org.j3d.aviatrix3d" ]
java.lang; java.util; org.j3d.aviatrix3d;
231,980
public void sendQuestions() { if (mQuestionCallbacks != null) { for (QuestionCallback aCallBack : mQuestionCallbacks) { aCallBack.onGetSurveyQuestions(getSurveyQuestions()); aCallBack.onGetSurveyResponse(getSurveyResponse()); } } } // //
void function() { if (mQuestionCallbacks != null) { for (QuestionCallback aCallBack : mQuestionCallbacks) { aCallBack.onGetSurveyQuestions(getSurveyQuestions()); aCallBack.onGetSurveyResponse(getSurveyResponse()); } } } //
/** * Sends arraylist of survey questions */
Sends arraylist of survey questions
sendQuestions
{ "repo_name": "getcloudcherry/cloudcherry-android-sdk", "path": "src/main/java/com/getcloudcherry/survey/helper/SurveyCC.java", "license": "mit", "size": 38538 }
[ "com.getcloudcherry.survey.interfaces.QuestionCallback" ]
import com.getcloudcherry.survey.interfaces.QuestionCallback;
import com.getcloudcherry.survey.interfaces.*;
[ "com.getcloudcherry.survey" ]
com.getcloudcherry.survey;
1,477,984
int createNodeSplitting(final ZooKeeperWatcher zkw, final HRegionInfo region, final ServerName serverName) throws KeeperException, IOException { LOG.debug(zkw.prefix("Creating ephemeral node for " + region.getEncodedName() + " in SPLITTING state")); RegionTransition rt = RegionTransition.createRegionTransition(EventType.RS_ZK_REGION_SPLITTING, region.getRegionName(), serverName); String node = ZKAssign.getNodeName(zkw, region.getEncodedName()); if (!ZKUtil.createEphemeralNodeAndWatch(zkw, node, rt.toByteArray())) { throw new IOException("Failed create of ephemeral " + node); } // Transition node from SPLITTING to SPLITTING and pick up version so we // can be sure this znode is ours; version is needed deleting. return transitionNodeSplitting(zkw, region, serverName, -1); }
int createNodeSplitting(final ZooKeeperWatcher zkw, final HRegionInfo region, final ServerName serverName) throws KeeperException, IOException { LOG.debug(zkw.prefix(STR + region.getEncodedName() + STR)); RegionTransition rt = RegionTransition.createRegionTransition(EventType.RS_ZK_REGION_SPLITTING, region.getRegionName(), serverName); String node = ZKAssign.getNodeName(zkw, region.getEncodedName()); if (!ZKUtil.createEphemeralNodeAndWatch(zkw, node, rt.toByteArray())) { throw new IOException(STR + node); } return transitionNodeSplitting(zkw, region, serverName, -1); }
/** * Creates a new ephemeral node in the SPLITTING state for the specified region. * Create it ephemeral in case regionserver dies mid-split. * * <p>Does not transition nodes from other states. If a node already exists * for this region, a {@link NodeExistsException} will be thrown. * * @param zkw zk reference * @param region region to be created as offline * @param serverName server event originates from * @return Version of znode created. * @throws KeeperException * @throws IOException */
Creates a new ephemeral node in the SPLITTING state for the specified region. Create it ephemeral in case regionserver dies mid-split. Does not transition nodes from other states. If a node already exists for this region, a <code>NodeExistsException</code> will be thrown
createNodeSplitting
{ "repo_name": "matteobertozzi/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java", "license": "apache-2.0", "size": 36911 }
[ "java.io.IOException", "org.apache.hadoop.hbase.HRegionInfo", "org.apache.hadoop.hbase.RegionTransition", "org.apache.hadoop.hbase.ServerName", "org.apache.hadoop.hbase.executor.EventHandler", "org.apache.hadoop.hbase.zookeeper.ZKAssign", "org.apache.hadoop.hbase.zookeeper.ZKUtil", "org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher", "org.apache.zookeeper.KeeperException" ]
import java.io.IOException; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.RegionTransition; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.executor.EventHandler; import org.apache.hadoop.hbase.zookeeper.ZKAssign; import org.apache.hadoop.hbase.zookeeper.ZKUtil; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.zookeeper.KeeperException;
import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.executor.*; import org.apache.hadoop.hbase.zookeeper.*; import org.apache.zookeeper.*;
[ "java.io", "org.apache.hadoop", "org.apache.zookeeper" ]
java.io; org.apache.hadoop; org.apache.zookeeper;
1,445,312
protected HttpConnectionManager getSimpleHttpConnectionManager() { return simpleHttpConnectionManager; } private static String defaultUserAgent = "ExchangeServicesClient/" + EwsUtilities.getBuildVersion(); protected ExchangeServiceBase(ExchangeServiceBase service, ExchangeVersion requestedServerVersion) { this(requestedServerVersion); this.useDefaultCredentials = service.getUseDefaultCredentials(); this.credentials = service.getCredentials(); this.traceEnabled = service.isTraceEnabled(); this.traceListener = service.getTraceListener(); this.traceFlags = service.getTraceFlags(); this.timeout = service.getTimeout(); this.preAuthenticate = service.isPreAuthenticate(); this.userAgent = service.getUserAgent(); this.acceptGzipEncoding = service.getAcceptGzipEncoding(); this.timeZone = service.getTimeZone(); this.httpHeaders = service.getHttpHeaders(); }
HttpConnectionManager function() { return simpleHttpConnectionManager; } private static String defaultUserAgent = STR + EwsUtilities.getBuildVersion(); protected ExchangeServiceBase(ExchangeServiceBase service, ExchangeVersion requestedServerVersion) { this(requestedServerVersion); this.useDefaultCredentials = service.getUseDefaultCredentials(); this.credentials = service.getCredentials(); this.traceEnabled = service.isTraceEnabled(); this.traceListener = service.getTraceListener(); this.traceFlags = service.getTraceFlags(); this.timeout = service.getTimeout(); this.preAuthenticate = service.isPreAuthenticate(); this.userAgent = service.getUserAgent(); this.acceptGzipEncoding = service.getAcceptGzipEncoding(); this.timeZone = service.getTimeZone(); this.httpHeaders = service.getHttpHeaders(); }
/** * Static members */
Static members
getSimpleHttpConnectionManager
{ "repo_name": "sheymans/todopl", "path": "src/foreign/ms_exchange/src/main/java/microsoft/exchange/webservices/data/ExchangeServiceBase.java", "license": "gpl-3.0", "size": 32904 }
[ "org.apache.commons.httpclient.HttpConnectionManager" ]
import org.apache.commons.httpclient.HttpConnectionManager;
import org.apache.commons.httpclient.*;
[ "org.apache.commons" ]
org.apache.commons;
1,663,384
private final void setStartingSettlement(Settlement startingSettlement) { this.startingSettlement = startingSettlement; fireMissionUpdate(MissionEventType.STARTING_SETTLEMENT_EVENT); }
final void function(Settlement startingSettlement) { this.startingSettlement = startingSettlement; fireMissionUpdate(MissionEventType.STARTING_SETTLEMENT_EVENT); }
/** * Sets the starting settlement. * * @param startingSettlement the new starting settlement */
Sets the starting settlement
setStartingSettlement
{ "repo_name": "mars-sim/mars-sim", "path": "mars-sim-core/src/main/java/org/mars_sim/msp/core/person/ai/mission/VehicleMission.java", "license": "gpl-3.0", "size": 54214 }
[ "org.mars_sim.msp.core.structure.Settlement" ]
import org.mars_sim.msp.core.structure.Settlement;
import org.mars_sim.msp.core.structure.*;
[ "org.mars_sim.msp" ]
org.mars_sim.msp;
1,631,516
public void centerViewTo(float xValue, float yValue, AxisDependency axis) { float yInView = getAxisRange(axis) / mViewPortHandler.getScaleY(); float xInView = getXAxis().mAxisRange / mViewPortHandler.getScaleX(); Runnable job = MoveViewJob.getInstance(mViewPortHandler, xValue - xInView / 2f, yValue + yInView / 2f, getTransformer(axis), this); addViewportJob(job); }
void function(float xValue, float yValue, AxisDependency axis) { float yInView = getAxisRange(axis) / mViewPortHandler.getScaleY(); float xInView = getXAxis().mAxisRange / mViewPortHandler.getScaleX(); Runnable job = MoveViewJob.getInstance(mViewPortHandler, xValue - xInView / 2f, yValue + yInView / 2f, getTransformer(axis), this); addViewportJob(job); }
/** * This will move the center of the current viewport to the specified * x and y value. * This also refreshes the chart by calling invalidate(). * * @param xValue * @param yValue * @param axis - which axis should be used as a reference for the y axis */
This will move the center of the current viewport to the specified x and y value. This also refreshes the chart by calling invalidate()
centerViewTo
{ "repo_name": "wapalxj/Android_C2_UI", "path": "C2_UI_2/chart/src/main/java/com/github/mikephil/charting/charts/BarLineChartBase.java", "license": "apache-2.0", "size": 50353 }
[ "com.github.mikephil.charting.components.YAxis", "com.github.mikephil.charting.jobs.MoveViewJob" ]
import com.github.mikephil.charting.components.YAxis; import com.github.mikephil.charting.jobs.MoveViewJob;
import com.github.mikephil.charting.components.*; import com.github.mikephil.charting.jobs.*;
[ "com.github.mikephil" ]
com.github.mikephil;
2,691,386
protected Question getEnvFirstQuestion() { return callInterview(iEnvironment, getEnvSuccessorQuestion()); } //-------------------------------------------------------------------------- private EnvironmentInterview iEnvironment;
Question function() { return callInterview(iEnvironment, getEnvSuccessorQuestion()); } private EnvironmentInterview iEnvironment;
/** * Get the first question to be asked concerning the environment to be * set up and used for each test to be run. For legacy test suites, * questions are asked to determine environment files to be read * and the name of an environment to be found in those files. * @return the first question to be asked concerning the environment to be * set up and used for each test to be run. * @see #getEnvSuccessorQuestion */
Get the first question to be asked concerning the environment to be set up and used for each test to be run. For legacy test suites, questions are asked to determine environment files to be read and the name of an environment to be found in those files
getEnvFirstQuestion
{ "repo_name": "Distrotech/icedtea6-1.12", "path": "src/jtreg/com/sun/javatest/interview/LegacyParameters.java", "license": "gpl-2.0", "size": 3191 }
[ "com.sun.interview.Question" ]
import com.sun.interview.Question;
import com.sun.interview.*;
[ "com.sun.interview" ]
com.sun.interview;
2,512,630
public static DeviceDescription descriptionOf(Device device) { checkNotNull(device, "Must supply non-null Device"); return new DefaultDeviceDescription(device.id().uri(), device.type(), device.manufacturer(), device.hwVersion(), device.swVersion(), device.serialNumber(), device.chassisId(), (SparseAnnotations) device.annotations()); }
static DeviceDescription function(Device device) { checkNotNull(device, STR); return new DefaultDeviceDescription(device.id().uri(), device.type(), device.manufacturer(), device.hwVersion(), device.swVersion(), device.serialNumber(), device.chassisId(), (SparseAnnotations) device.annotations()); }
/** * Returns a description of the given device. * * @param device the device * @return a description of the device */
Returns a description of the given device
descriptionOf
{ "repo_name": "kuujo/onos", "path": "core/net/src/main/java/org/onosproject/net/device/impl/BasicDeviceOperator.java", "license": "apache-2.0", "size": 4357 }
[ "com.google.common.base.Preconditions", "org.onosproject.net.Device", "org.onosproject.net.SparseAnnotations", "org.onosproject.net.device.DefaultDeviceDescription", "org.onosproject.net.device.DeviceDescription" ]
import com.google.common.base.Preconditions; import org.onosproject.net.Device; import org.onosproject.net.SparseAnnotations; import org.onosproject.net.device.DefaultDeviceDescription; import org.onosproject.net.device.DeviceDescription;
import com.google.common.base.*; import org.onosproject.net.*; import org.onosproject.net.device.*;
[ "com.google.common", "org.onosproject.net" ]
com.google.common; org.onosproject.net;
1,382,952
private void updateTitle() { // Application name String sAppName = RB.getString("FPortecle.Title"); // No keystore loaded so just display the application name if (m_keyStoreWrap == null) { setTitle(sAppName); } else { File fKeyStore = m_keyStoreWrap.getKeyStoreFile(); if (fKeyStore == null) { // A newly created keystore is loaded - display Untitled string and application name setTitle(MessageFormat.format("[{0}] - {1}", RB.getString("FPortecle.Untitled"), sAppName)); } else { // Keystore loaded - display keystore file path, "modified" indicator, and application name String modInd = m_keyStoreWrap.isChanged() ? RB.getString("FPortecle.Modified") : ""; setTitle(MessageFormat.format("{0}{1} - {2}", fKeyStore, modInd, sAppName)); } } }
void function() { String sAppName = RB.getString(STR); if (m_keyStoreWrap == null) { setTitle(sAppName); } else { File fKeyStore = m_keyStoreWrap.getKeyStoreFile(); if (fKeyStore == null) { setTitle(MessageFormat.format(STR, RB.getString(STR), sAppName)); } else { String modInd = m_keyStoreWrap.isChanged() ? RB.getString(STR) : STR{0}{1} - {2}", fKeyStore, modInd, sAppName)); } } }
/** * Update the application's controls dependent on the state of its keystore. */
Update the application's controls dependent on the state of its keystore
updateTitle
{ "repo_name": "scop/portecle", "path": "src/main/net/sf/portecle/FPortecle.java", "license": "gpl-2.0", "size": 189435 }
[ "java.io.File", "java.text.MessageFormat" ]
import java.io.File; import java.text.MessageFormat;
import java.io.*; import java.text.*;
[ "java.io", "java.text" ]
java.io; java.text;
2,862,678
@Test public void testNotification_fgCallbackAnalytics() throws Exception { mockAppForeground(true); RemoteMessageBuilder builder = new RemoteMessageBuilder(); builder.addData("gcm.n.e", "1"); AnalyticsTestHelper.addAnalyticsExtras(builder); startServiceViaReceiver(builder.buildIntent()); verify(service).onMessageReceived(argThat(builder.buildMatcher())); List<AnalyticsValidator.LoggedEvent> events = analyticsValidator.getLoggedEvents(); assertThat(events).hasSize(2); AnalyticsValidator.LoggedEvent receiveEvent = events.get(0); assertThat(receiveEvent.getOrigin()).isEqualTo(Analytics.ORIGIN_FCM); assertThat(receiveEvent.getName()).isEqualTo(Analytics.EVENT_NOTIFICATION_RECEIVE); assertThat(receiveEvent.getParams()) .string(Analytics.PARAM_MESSAGE_ID) .isEqualTo("composer_key"); assertThat(receiveEvent.getParams()) .string(Analytics.PARAM_MESSAGE_NAME) .isEqualTo("composer_label"); assertThat(receiveEvent.getParams()) .integer(Analytics.PARAM_MESSAGE_TIME) .isEqualTo(1234567890); assertThat(receiveEvent.getParams()).doesNotContainKey(Analytics.PARAM_TOPIC); AnalyticsValidator.LoggedEvent foregroundEvent = events.get(1); assertThat(foregroundEvent.getOrigin()).isEqualTo(Analytics.ORIGIN_FCM); assertThat(foregroundEvent.getName()).isEqualTo(Analytics.EVENT_NOTIFICATION_FOREGROUND); Bundles.assertEquals(foregroundEvent.getParams(), receiveEvent.getParams()); }
void function() throws Exception { mockAppForeground(true); RemoteMessageBuilder builder = new RemoteMessageBuilder(); builder.addData(STR, "1"); AnalyticsTestHelper.addAnalyticsExtras(builder); startServiceViaReceiver(builder.buildIntent()); verify(service).onMessageReceived(argThat(builder.buildMatcher())); List<AnalyticsValidator.LoggedEvent> events = analyticsValidator.getLoggedEvents(); assertThat(events).hasSize(2); AnalyticsValidator.LoggedEvent receiveEvent = events.get(0); assertThat(receiveEvent.getOrigin()).isEqualTo(Analytics.ORIGIN_FCM); assertThat(receiveEvent.getName()).isEqualTo(Analytics.EVENT_NOTIFICATION_RECEIVE); assertThat(receiveEvent.getParams()) .string(Analytics.PARAM_MESSAGE_ID) .isEqualTo(STR); assertThat(receiveEvent.getParams()) .string(Analytics.PARAM_MESSAGE_NAME) .isEqualTo(STR); assertThat(receiveEvent.getParams()) .integer(Analytics.PARAM_MESSAGE_TIME) .isEqualTo(1234567890); assertThat(receiveEvent.getParams()).doesNotContainKey(Analytics.PARAM_TOPIC); AnalyticsValidator.LoggedEvent foregroundEvent = events.get(1); assertThat(foregroundEvent.getOrigin()).isEqualTo(Analytics.ORIGIN_FCM); assertThat(foregroundEvent.getName()).isEqualTo(Analytics.EVENT_NOTIFICATION_FOREGROUND); Bundles.assertEquals(foregroundEvent.getParams(), receiveEvent.getParams()); }
/** * Test a notification message logs a notification foreground event if the app is in the * foreground an onMessageReceived() is invoked. */
Test a notification message logs a notification foreground event if the app is in the foreground an onMessageReceived() is invoked
testNotification_fgCallbackAnalytics
{ "repo_name": "firebase/firebase-android-sdk", "path": "firebase-messaging/src/test/java/com/google/firebase/messaging/FirebaseMessagingServiceRoboTest.java", "license": "apache-2.0", "size": 32380 }
[ "androidx.test.ext.truth.os.BundleSubject", "com.google.common.truth.Truth", "com.google.firebase.messaging.AnalyticsTestHelper", "com.google.firebase.messaging.testing.AnalyticsValidator", "com.google.firebase.messaging.testing.Bundles", "java.util.List", "org.junit.Assert", "org.mockito.Mockito" ]
import androidx.test.ext.truth.os.BundleSubject; import com.google.common.truth.Truth; import com.google.firebase.messaging.AnalyticsTestHelper; import com.google.firebase.messaging.testing.AnalyticsValidator; import com.google.firebase.messaging.testing.Bundles; import java.util.List; import org.junit.Assert; import org.mockito.Mockito;
import androidx.test.ext.truth.os.*; import com.google.common.truth.*; import com.google.firebase.messaging.*; import com.google.firebase.messaging.testing.*; import java.util.*; import org.junit.*; import org.mockito.*;
[ "androidx.test", "com.google.common", "com.google.firebase", "java.util", "org.junit", "org.mockito" ]
androidx.test; com.google.common; com.google.firebase; java.util; org.junit; org.mockito;
608,866
public static void runExample( AdManagerServices adManagerServices, AdManagerSession session, long userId, long teamId) throws RemoteException { // Get the UserTeamAssociationService. UserTeamAssociationServiceInterface userTeamAssociationService = adManagerServices.get(session, UserTeamAssociationServiceInterface.class); // Create a user team association. UserTeamAssociation userTeamAssociation = new UserTeamAssociation(); userTeamAssociation.setUserId(userId); userTeamAssociation.setTeamId(teamId); // Create the user team association on the server. UserTeamAssociation[] userTeamAssociations = userTeamAssociationService.createUserTeamAssociations( new UserTeamAssociation[] {userTeamAssociation}); for (UserTeamAssociation createdUserTeamAssociation : userTeamAssociations) { System.out.printf( "A user team association with user ID %d and team ID %d was created.%n", createdUserTeamAssociation.getUserId(), createdUserTeamAssociation.getTeamId()); } }
static void function( AdManagerServices adManagerServices, AdManagerSession session, long userId, long teamId) throws RemoteException { UserTeamAssociationServiceInterface userTeamAssociationService = adManagerServices.get(session, UserTeamAssociationServiceInterface.class); UserTeamAssociation userTeamAssociation = new UserTeamAssociation(); userTeamAssociation.setUserId(userId); userTeamAssociation.setTeamId(teamId); UserTeamAssociation[] userTeamAssociations = userTeamAssociationService.createUserTeamAssociations( new UserTeamAssociation[] {userTeamAssociation}); for (UserTeamAssociation createdUserTeamAssociation : userTeamAssociations) { System.out.printf( STR, createdUserTeamAssociation.getUserId(), createdUserTeamAssociation.getTeamId()); } }
/** * Runs the example. * * @param adManagerServices the services factory. * @param session the session. * @param userId the user ID of the user team association. * @param teamId the team ID of the user team association (i.e. what team the user will be added * to). * @throws ApiException if the API request failed with one or more service errors. * @throws RemoteException if the API request failed due to other errors. */
Runs the example
runExample
{ "repo_name": "googleads/googleads-java-lib", "path": "examples/admanager_axis/src/main/java/admanager/axis/v202108/userteamassociationservice/CreateUserTeamAssociations.java", "license": "apache-2.0", "size": 6972 }
[ "com.google.api.ads.admanager.axis.factory.AdManagerServices", "com.google.api.ads.admanager.axis.v202108.UserTeamAssociation", "com.google.api.ads.admanager.axis.v202108.UserTeamAssociationServiceInterface", "com.google.api.ads.admanager.lib.client.AdManagerSession", "java.rmi.RemoteException" ]
import com.google.api.ads.admanager.axis.factory.AdManagerServices; import com.google.api.ads.admanager.axis.v202108.UserTeamAssociation; import com.google.api.ads.admanager.axis.v202108.UserTeamAssociationServiceInterface; import com.google.api.ads.admanager.lib.client.AdManagerSession; import java.rmi.RemoteException;
import com.google.api.ads.admanager.axis.factory.*; import com.google.api.ads.admanager.axis.v202108.*; import com.google.api.ads.admanager.lib.client.*; import java.rmi.*;
[ "com.google.api", "java.rmi" ]
com.google.api; java.rmi;
2,660,382
public void testWeekdayName() { Calendar date = Dates.DateValue("04/21/2008 09:29:48"); assertEquals("Monday", Dates.WeekdayName(date)); }
void function() { Calendar date = Dates.DateValue(STR); assertEquals(STR, Dates.WeekdayName(date)); }
/** * Tests {@link Dates#WeekdayName(Calendar)}. */
Tests <code>Dates#WeekdayName(Calendar)</code>
testWeekdayName
{ "repo_name": "bitsecure/appinventor1-sources", "path": "appinventor/components/tests/com/google/appinventor/components/runtime/util/DatesTest.java", "license": "apache-2.0", "size": 9277 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
1,978,023
@WebMethod @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306") @RequestWrapper(localName = "performCustomTargetingValueAction", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306", className = "com.google.api.ads.dfp.jaxws.v201306.CustomTargetingServiceInterfaceperformCustomTargetingValueAction") @ResponseWrapper(localName = "performCustomTargetingValueActionResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306", className = "com.google.api.ads.dfp.jaxws.v201306.CustomTargetingServiceInterfaceperformCustomTargetingValueActionResponse") public UpdateResult performCustomTargetingValueAction( @WebParam(name = "customTargetingValueAction", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306") CustomTargetingValueAction customTargetingValueAction, @WebParam(name = "filterStatement", targetNamespace = "https://www.google.com/apis/ads/publisher/v201306") Statement filterStatement) throws ApiException_Exception ;
@WebResult(name = "rval", targetNamespace = STRperformCustomTargetingValueActionSTRhttps: @ResponseWrapper(localName = "performCustomTargetingValueActionResponseSTRhttps: UpdateResult function( @WebParam(name = "customTargetingValueActionSTRhttps: CustomTargetingValueAction customTargetingValueAction, @WebParam(name = "filterStatementSTRhttps: Statement filterStatement) throws ApiException_Exception ;
/** * * Performs actions on {@link CustomTargetingValue} objects that match the * given {@link Statement#query}. * * @param customTargetingValueAction the action to perform * @param filterStatement a Publisher Query Language statement used to filter * a set of ad units * @return the result of the action performed * * * @param customTargetingValueAction * @param filterStatement * @return * returns com.google.api.ads.dfp.jaxws.v201306.UpdateResult * @throws ApiException_Exception */
Performs actions on <code>CustomTargetingValue</code> objects that match the given <code>Statement#query</code>
performCustomTargetingValueAction
{ "repo_name": "nafae/developer", "path": "modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201306/CustomTargetingServiceInterface.java", "license": "apache-2.0", "size": 15645 }
[ "javax.jws.WebParam", "javax.jws.WebResult", "javax.xml.ws.ResponseWrapper" ]
import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper;
import javax.jws.*; import javax.xml.ws.*;
[ "javax.jws", "javax.xml" ]
javax.jws; javax.xml;
2,299,945
ServicePool<Endpoint, Producer> getProducerServicePool();
ServicePool<Endpoint, Producer> getProducerServicePool();
/** * Gets the service pool for {@link Producer} pooling. * * @return the service pool */
Gets the service pool for <code>Producer</code> pooling
getProducerServicePool
{ "repo_name": "curso007/camel", "path": "camel-core/src/main/java/org/apache/camel/CamelContext.java", "license": "apache-2.0", "size": 79052 }
[ "org.apache.camel.spi.ServicePool" ]
import org.apache.camel.spi.ServicePool;
import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
686,571
List<MigrationInfo> getCompletedMigrations(int partitionId) { partitionServiceLock.lock(); try { List<MigrationInfo> migrations = new LinkedList<>(); for (MigrationInfo migration : completedMigrations) { if (partitionId == migration.getPartitionId()) { migrations.add(migration); } } return migrations; } finally { partitionServiceLock.unlock(); } }
List<MigrationInfo> getCompletedMigrations(int partitionId) { partitionServiceLock.lock(); try { List<MigrationInfo> migrations = new LinkedList<>(); for (MigrationInfo migration : completedMigrations) { if (partitionId == migration.getPartitionId()) { migrations.add(migration); } } return migrations; } finally { partitionServiceLock.unlock(); } }
/** * Returns a copy of the list of completed migrations for the specific partition. * Runs under the partition service lock. */
Returns a copy of the list of completed migrations for the specific partition. Runs under the partition service lock
getCompletedMigrations
{ "repo_name": "jerrinot/hazelcast", "path": "hazelcast/src/main/java/com/hazelcast/internal/partition/impl/MigrationManager.java", "license": "apache-2.0", "size": 97853 }
[ "com.hazelcast.internal.partition.MigrationInfo", "java.util.LinkedList", "java.util.List" ]
import com.hazelcast.internal.partition.MigrationInfo; import java.util.LinkedList; import java.util.List;
import com.hazelcast.internal.partition.*; import java.util.*;
[ "com.hazelcast.internal", "java.util" ]
com.hazelcast.internal; java.util;
2,046,159
public void setLogAbandoned(boolean logAbandoned) { this.logAbandoned = logAbandoned; } private PrintWriter logWriter = new PrintWriter(System.out);
void function(boolean logAbandoned) { this.logAbandoned = logAbandoned; } private PrintWriter logWriter = new PrintWriter(System.out);
/** * Sets the flag to log stack traces for application code which abandoned * an object. * * @param logAbandoned true turns on abandoned stack trace logging * @see #getLogAbandoned() * */
Sets the flag to log stack traces for application code which abandoned an object
setLogAbandoned
{ "repo_name": "lovejinstar/POOL2.LINE", "path": "src/main/java/org/apache/commons/pool2/impl/AbandonedConfig.java", "license": "apache-2.0", "size": 8004 }
[ "java.io.PrintWriter" ]
import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
1,012,487
@Test void testConstructorPrivate() { assertPrivateConstructor(Graphics.class); }
void testConstructorPrivate() { assertPrivateConstructor(Graphics.class); }
/** * Test constructor. */
Test constructor
testConstructorPrivate
{ "repo_name": "b3dgs/lionengine", "path": "lionengine-core/src/test/java/com/b3dgs/lionengine/graphic/GraphicsTest.java", "license": "gpl-3.0", "size": 13898 }
[ "com.b3dgs.lionengine.UtilAssert" ]
import com.b3dgs.lionengine.UtilAssert;
import com.b3dgs.lionengine.*;
[ "com.b3dgs.lionengine" ]
com.b3dgs.lionengine;
1,878,230
public static void setClipboardString(String par0Str) { try { StringSelection var1 = new StringSelection(par0Str); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(var1, (ClipboardOwner)null); } catch (Exception var2) { ; } }
static void function(String par0Str) { try { StringSelection var1 = new StringSelection(par0Str); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(var1, (ClipboardOwner)null); } catch (Exception var2) { ; } }
/** * store a string in the system clipboard */
store a string in the system clipboard
setClipboardString
{ "repo_name": "LolololTrololol/InsertNameHere", "path": "minecraft/net/minecraft/src/GuiScreen.java", "license": "gpl-2.0", "size": 8948 }
[ "java.awt.Toolkit", "java.awt.datatransfer.ClipboardOwner", "java.awt.datatransfer.StringSelection" ]
import java.awt.Toolkit; import java.awt.datatransfer.ClipboardOwner; import java.awt.datatransfer.StringSelection;
import java.awt.*; import java.awt.datatransfer.*;
[ "java.awt" ]
java.awt;
135,467
public AttributeWeights getWeights(ExampleSet exampleSet) throws OperatorException { throw new UserError(this, 916, getName(), "calculation of weights not supported."); }
AttributeWeights function(ExampleSet exampleSet) throws OperatorException { throw new UserError(this, 916, getName(), STR); }
/** * Returns the calculated weight vectors. Subclasses which supports the * capability to calculate feature weights must override this method. The * default implementation throws an exception. */
Returns the calculated weight vectors. Subclasses which supports the capability to calculate feature weights must override this method. The default implementation throws an exception
getWeights
{ "repo_name": "ntj/ComplexRapidMiner", "path": "src/com/rapidminer/operator/learner/weka/GenericWekaMetaLearner.java", "license": "gpl-2.0", "size": 11019 }
[ "com.rapidminer.example.AttributeWeights", "com.rapidminer.example.ExampleSet", "com.rapidminer.operator.OperatorException", "com.rapidminer.operator.UserError" ]
import com.rapidminer.example.AttributeWeights; import com.rapidminer.example.ExampleSet; import com.rapidminer.operator.OperatorException; import com.rapidminer.operator.UserError;
import com.rapidminer.example.*; import com.rapidminer.operator.*;
[ "com.rapidminer.example", "com.rapidminer.operator" ]
com.rapidminer.example; com.rapidminer.operator;
609,463
@Override @SuppressWarnings({ "unchecked", "rawtypes" }) public Advertisement getAdvertisement( PlatformConfig config ){ XMLDocument http = (XMLDocument) config.getServiceParam( getModuleClassID()); HTTPAdv httpAdv = null; boolean httpEnabled = true; if (http != null) { try { httpEnabled = config.isSvcEnabled(getModuleClassID()); XMLElement<?> param = null; Enumeration<?> httpChilds = http.getChildren(TransportAdvertisement.getAdvertisementType()); // get the HTTPAdv from TransportAdv if (httpChilds.hasMoreElements()) { param = (XMLElement<?>) httpChilds.nextElement(); } if (null != param) { httpAdv = (HTTPAdv) AdvertisementFactory.newAdvertisement(param); if (httpEnabled) { // check if the interface address is still valid. String intf = httpAdv.getInterfaceAddress(); if ((null != intf) && !AutomaticConfigurator.isValidInetAddress(intf)) { if (Logging.SHOW_CONFIG && logger.isLoggable(Level.CONFIG)) { logger.config("Reconfig requested - invalid interface address"); } } } } } catch (RuntimeException advTrouble) { if (Logging.SHOW_WARNING && logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, "HTTP advertisement corrupted", advTrouble); } httpAdv = null; } } if (httpAdv == null) { if (Logging.SHOW_CONFIG && logger.isLoggable(Level.CONFIG)) { logger.config("HTTP advertisement missing, making a new one."); } int port = 0; // get the port from a property String httpPort = System.getProperty("jxta.http.port"); if (httpPort != null) { try { int propertyPort = Integer.parseInt(httpPort); if ((propertyPort < 65536) && (propertyPort >= 0)) { port = propertyPort; } else { if (Logging.SHOW_WARNING && logger.isLoggable(Level.WARNING)) { logger.warning("Property \'jxta.http.port\' is not a valid port number : " + propertyPort); } } } catch (NumberFormatException ignored) { if (Logging.SHOW_WARNING && logger.isLoggable(Level.WARNING)) { logger.warning("Property \'jxta.http.port\' was not an integer : " + http); } } } httpAdv = (HTTPAdv) AdvertisementFactory.newAdvertisement(HTTPAdv.getAdvertisementType()); httpAdv.setProtocol("http"); httpAdv.setPort(port); httpAdv.setServerEnabled(false); // Create new param docs that contain the updated adv http = (XMLDocument<?>) StructuredDocumentFactory.newStructuredDocument(MimeMediaType.XMLUTF8, "Parm"); XMLDocument<?> httAdvDoc = (XMLDocument<?>) httpAdv.getDocument(MimeMediaType.XMLUTF8); StructuredDocumentUtils.copyElements(http, http, httAdvDoc); if (!httpEnabled) { http.appendChild(http.createElement("isOff")); } config.putServiceParam( getModuleClassID(), http); } return httpAdv; }
@SuppressWarnings({ STR, STR }) Advertisement function( PlatformConfig config ){ XMLDocument http = (XMLDocument) config.getServiceParam( getModuleClassID()); HTTPAdv httpAdv = null; boolean httpEnabled = true; if (http != null) { try { httpEnabled = config.isSvcEnabled(getModuleClassID()); XMLElement<?> param = null; Enumeration<?> httpChilds = http.getChildren(TransportAdvertisement.getAdvertisementType()); if (httpChilds.hasMoreElements()) { param = (XMLElement<?>) httpChilds.nextElement(); } if (null != param) { httpAdv = (HTTPAdv) AdvertisementFactory.newAdvertisement(param); if (httpEnabled) { String intf = httpAdv.getInterfaceAddress(); if ((null != intf) && !AutomaticConfigurator.isValidInetAddress(intf)) { if (Logging.SHOW_CONFIG && logger.isLoggable(Level.CONFIG)) { logger.config(STR); } } } } } catch (RuntimeException advTrouble) { if (Logging.SHOW_WARNING && logger.isLoggable(Level.WARNING)) { logger.log(Level.WARNING, STR, advTrouble); } httpAdv = null; } } if (httpAdv == null) { if (Logging.SHOW_CONFIG && logger.isLoggable(Level.CONFIG)) { logger.config(STR); } int port = 0; String httpPort = System.getProperty(STR); if (httpPort != null) { try { int propertyPort = Integer.parseInt(httpPort); if ((propertyPort < 65536) && (propertyPort >= 0)) { port = propertyPort; } else { if (Logging.SHOW_WARNING && logger.isLoggable(Level.WARNING)) { logger.warning(STR + propertyPort); } } } catch (NumberFormatException ignored) { if (Logging.SHOW_WARNING && logger.isLoggable(Level.WARNING)) { logger.warning(STR + http); } } } httpAdv = (HTTPAdv) AdvertisementFactory.newAdvertisement(HTTPAdv.getAdvertisementType()); httpAdv.setProtocol("http"); httpAdv.setPort(port); httpAdv.setServerEnabled(false); http = (XMLDocument<?>) StructuredDocumentFactory.newStructuredDocument(MimeMediaType.XMLUTF8, "Parm"); XMLDocument<?> httAdvDoc = (XMLDocument<?>) httpAdv.getDocument(MimeMediaType.XMLUTF8); StructuredDocumentUtils.copyElements(http, http, httAdvDoc); if (!httpEnabled) { http.appendChild(http.createElement("isOff")); } config.putServiceParam( getModuleClassID(), http); } return httpAdv; }
/** * Get the XML document that describes the module * @return */
Get the XML document that describes the module
getAdvertisement
{ "repo_name": "chaupal/jp2p-jxta", "path": "Workspace/net.jp2p.endpoint.servlethttp/src/net/jp2p/endpoint/servlethttp/factory/HttpModule.java", "license": "apache-2.0", "size": 5838 }
[ "java.util.Enumeration", "java.util.logging.Level", "net.jxta.document.Advertisement", "net.jxta.document.AdvertisementFactory", "net.jxta.document.MimeMediaType", "net.jxta.document.StructuredDocumentFactory", "net.jxta.document.StructuredDocumentUtils", "net.jxta.document.XMLDocument", "net.jxta.document.XMLElement", "net.jxta.impl.peergroup.AutomaticConfigurator", "net.jxta.impl.protocol.HTTPAdv", "net.jxta.impl.protocol.PlatformConfig", "net.jxta.logging.Logging", "net.jxta.protocol.TransportAdvertisement" ]
import java.util.Enumeration; import java.util.logging.Level; import net.jxta.document.Advertisement; import net.jxta.document.AdvertisementFactory; import net.jxta.document.MimeMediaType; import net.jxta.document.StructuredDocumentFactory; import net.jxta.document.StructuredDocumentUtils; import net.jxta.document.XMLDocument; import net.jxta.document.XMLElement; import net.jxta.impl.peergroup.AutomaticConfigurator; import net.jxta.impl.protocol.HTTPAdv; import net.jxta.impl.protocol.PlatformConfig; import net.jxta.logging.Logging; import net.jxta.protocol.TransportAdvertisement;
import java.util.*; import java.util.logging.*; import net.jxta.document.*; import net.jxta.impl.peergroup.*; import net.jxta.impl.protocol.*; import net.jxta.logging.*; import net.jxta.protocol.*;
[ "java.util", "net.jxta.document", "net.jxta.impl", "net.jxta.logging", "net.jxta.protocol" ]
java.util; net.jxta.document; net.jxta.impl; net.jxta.logging; net.jxta.protocol;
1,229,142
void setMaxPhenomenonTimeForProcedure(String procedure, DateTime maxTime);
void setMaxPhenomenonTimeForProcedure(String procedure, DateTime maxTime);
/** * Sets the maximal phenomenon time for the specified procedure to the * specified time. * * @param procedure * the procedure * @param maxTime * the max phenomenon time */
Sets the maximal phenomenon time for the specified procedure to the specified time
setMaxPhenomenonTimeForProcedure
{ "repo_name": "shane-axiom/SOS", "path": "core/api/src/main/java/org/n52/sos/cache/WritableContentCache.java", "license": "gpl-2.0", "size": 47509 }
[ "org.joda.time.DateTime" ]
import org.joda.time.DateTime;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
302,830
public void setCallActivation(Activation a) { callActivation = a; }
void function(Activation a) { callActivation = a; }
/** * This activation is created in a dynamic call context, remember * its caller's activation. * * @param a The caller's activation */
This activation is created in a dynamic call context, remember its caller's activation
setCallActivation
{ "repo_name": "lpxz/grail-derby104", "path": "java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java", "license": "apache-2.0", "size": 47381 }
[ "org.apache.derby.iapi.sql.Activation" ]
import org.apache.derby.iapi.sql.Activation;
import org.apache.derby.iapi.sql.*;
[ "org.apache.derby" ]
org.apache.derby;
1,821,259
public void setFunction(AggregateFunction<T> function); } private final AggregateFunction<T> defaultFunction; private final List<AggregateFunction<T>> functions; private final List<String> labels; private final EditorSelection editor1; private final EditorString editor2; private AggregateFunction<T> function = null; private final HierarchyWizardModelGrouping<T> model; private final boolean general; public HierarchyWizardEditorFunction(final IHierarchyFunctionEditorParent<T> parent, final HierarchyWizardModelGrouping<T> model, final Composite composite, final boolean general) { DataType<T> type = model.getDataType(); this.general = general; this.functions = new ArrayList<AggregateFunction<T>>(); this.labels = new ArrayList<String>(); this.model = model; this.defaultFunction = new AggregateFunction<T>(type){ private static final long serialVersionUID = -6444219024682845316L; @Override public String aggregate(String[] values) {return null;}
void function(AggregateFunction<T> function); } private final AggregateFunction<T> defaultFunction; private final List<AggregateFunction<T>> functions; private final List<String> labels; private final EditorSelection editor1; private final EditorString editor2; private AggregateFunction<T> function = null; private final HierarchyWizardModelGrouping<T> model; private final boolean general; public HierarchyWizardEditorFunction(final IHierarchyFunctionEditorParent<T> parent, final HierarchyWizardModelGrouping<T> model, final Composite composite, final boolean general) { DataType<T> type = model.getDataType(); this.general = general; this.functions = new ArrayList<AggregateFunction<T>>(); this.labels = new ArrayList<String>(); this.model = model; this.defaultFunction = new AggregateFunction<T>(type){ private static final long serialVersionUID = -6444219024682845316L; @Override public String aggregate(String[] values) {return null;}
/** * Sets the function * * @param function */
Sets the function
setFunction
{ "repo_name": "arx-deidentifier/arx", "path": "src/gui/org/deidentifier/arx/gui/view/impl/wizard/HierarchyWizardEditorFunction.java", "license": "apache-2.0", "size": 9974 }
[ "java.util.ArrayList", "java.util.List", "org.deidentifier.arx.DataType", "org.deidentifier.arx.aggregates.AggregateFunction", "org.deidentifier.arx.gui.view.impl.menu.EditorSelection", "org.deidentifier.arx.gui.view.impl.menu.EditorString", "org.eclipse.swt.widgets.Composite" ]
import java.util.ArrayList; import java.util.List; import org.deidentifier.arx.DataType; import org.deidentifier.arx.aggregates.AggregateFunction; import org.deidentifier.arx.gui.view.impl.menu.EditorSelection; import org.deidentifier.arx.gui.view.impl.menu.EditorString; import org.eclipse.swt.widgets.Composite;
import java.util.*; import org.deidentifier.arx.*; import org.deidentifier.arx.aggregates.*; import org.deidentifier.arx.gui.view.impl.menu.*; import org.eclipse.swt.widgets.*;
[ "java.util", "org.deidentifier.arx", "org.eclipse.swt" ]
java.util; org.deidentifier.arx; org.eclipse.swt;
1,221,722
private int indexToSlot(ContainerSection section, int index) { if(index == DROP_SLOT) { return DROP_SLOT; } if(hasSection(section)) { Slot slot = slotRefs.get(section).get(index); if(slot != null) { return InvTweaksObfuscation.getSlotNumber(slot); } else { return -1; } } else { return -1; } }
int function(ContainerSection section, int index) { if(index == DROP_SLOT) { return DROP_SLOT; } if(hasSection(section)) { Slot slot = slotRefs.get(section).get(index); if(slot != null) { return InvTweaksObfuscation.getSlotNumber(slot); } else { return -1; } } else { return -1; } }
/** * Converts section/index values to slot ID. * * @param section * @param index * @return -1 if not found */
Converts section/index values to slot ID
indexToSlot
{ "repo_name": "Vexatos/inventory-tweaks", "path": "src/minecraft/invtweaks/InvTweaksContainerManager.java", "license": "mit", "size": 16571 }
[ "net.minecraft.inventory.Slot" ]
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.*;
[ "net.minecraft.inventory" ]
net.minecraft.inventory;
1,937,122
public void setColors(@ColorInt int[] colors) { mColors = colors; }
void function(@ColorInt int[] colors) { mColors = colors; }
/** * Sets the colors that will be shown in the color selection dialog. * * @param colors The colors */
Sets the colors that will be shown in the color selection dialog
setColors
{ "repo_name": "phil-lopreiato/the-blue-alliance-android", "path": "spectrum/src/main/java/com/thebluealliance/spectrum/SpectrumPreferenceCompat.java", "license": "mit", "size": 9259 }
[ "android.support.annotation.ColorInt" ]
import android.support.annotation.ColorInt;
import android.support.annotation.*;
[ "android.support" ]
android.support;
1,345,299
public Observable<ServiceResponse<Page<RegistryInner>>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); }
Observable<ServiceResponse<Page<RegistryInner>>> function() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); }
/** * Lists all the container registries under the specified subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;RegistryInner&gt; object wrapped in {@link ServiceResponse} if successful. */
Lists all the container registries under the specified subscription
listSinglePageAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/containerregistry/mgmt-v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesInner.java", "license": "mit", "size": 76938 }
[ "com.microsoft.azure.Page", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
667,335
public com.tinkerpop.blueprints.Edge getGDBEdge(Object gdbEdgeId) { if (this.graph == null || gdbEdgeId == null) return null; else return this.graph.getEdge(gdbEdgeId); }
com.tinkerpop.blueprints.Edge function(Object gdbEdgeId) { if (this.graph == null gdbEdgeId == null) return null; else return this.graph.getEdge(gdbEdgeId); }
/** * Returns the graph database edge associated with the given id. * * @param gbdEdgeId the graph database edge id * @return the graph database edge */
Returns the graph database edge associated with the given id
getGDBEdge
{ "repo_name": "matjoe/DNA", "path": "src/dna/graph/BlueprintsGraph.java", "license": "gpl-3.0", "size": 33049 }
[ "dna.graph.edges.Edge" ]
import dna.graph.edges.Edge;
import dna.graph.edges.*;
[ "dna.graph.edges" ]
dna.graph.edges;
626,256
public String getItemText(int index) { checkIndex(index); final Element optionElement = (Element)optionsPanel.getElement().getChild(index); final LabelElement labelElement = (LabelElement)optionElement.getElementsByTagName("label").getItem(0); return labelElement.getInnerText(); }
String function(int index) { checkIndex(index); final Element optionElement = (Element)optionsPanel.getElement().getChild(index); final LabelElement labelElement = (LabelElement)optionElement.getElementsByTagName("label").getItem(0); return labelElement.getInnerText(); }
/** * Gets the text associated with the item at the specified index. * * @param index * the index of the item whose text is to be retrieved * @return the text associated with the item * @throws IndexOutOfBoundsException * if the index is out of range */
Gets the text associated with the item at the specified index
getItemText
{ "repo_name": "slemeur/che", "path": "ide/commons-gwt/src/main/java/org/eclipse/che/ide/ui/listbox/CustomListBox.java", "license": "epl-1.0", "size": 16021 }
[ "com.google.gwt.dom.client.Element", "com.google.gwt.dom.client.LabelElement" ]
import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.LabelElement;
import com.google.gwt.dom.client.*;
[ "com.google.gwt" ]
com.google.gwt;
2,567,594
public static PrometheusMeterRegistry newRegistry(CollectorRegistry registry) { return newRegistry(registry, Clock.SYSTEM); }
static PrometheusMeterRegistry function(CollectorRegistry registry) { return newRegistry(registry, Clock.SYSTEM); }
/** * Returns a newly-created {@link PrometheusMeterRegistry} instance with the specified * {@link CollectorRegistry}. */
Returns a newly-created <code>PrometheusMeterRegistry</code> instance with the specified <code>CollectorRegistry</code>
newRegistry
{ "repo_name": "anuraaga/armeria", "path": "core/src/main/java/com/linecorp/armeria/common/metric/PrometheusMeterRegistries.java", "license": "apache-2.0", "size": 3058 }
[ "io.micrometer.core.instrument.Clock", "io.micrometer.prometheus.PrometheusMeterRegistry", "io.prometheus.client.CollectorRegistry" ]
import io.micrometer.core.instrument.Clock; import io.micrometer.prometheus.PrometheusMeterRegistry; import io.prometheus.client.CollectorRegistry;
import io.micrometer.core.instrument.*; import io.micrometer.prometheus.*; import io.prometheus.client.*;
[ "io.micrometer.core", "io.micrometer.prometheus", "io.prometheus.client" ]
io.micrometer.core; io.micrometer.prometheus; io.prometheus.client;
115,049
return new CopyPasteSourceDestinationGlobalsTestsTestSuite(); } public CopyPasteSourceDestinationGlobalsTestsTestSuite() { addTest(new TestSuite(CopyPasteSourceDestinationGlobalsTest.class)); addTest(new TestSuite(CopyPasteSourceDestinationTests_0.class)); }
return new CopyPasteSourceDestinationGlobalsTestsTestSuite(); } public CopyPasteSourceDestinationGlobalsTestsTestSuite() { addTest(new TestSuite(CopyPasteSourceDestinationGlobalsTest.class)); addTest(new TestSuite(CopyPasteSourceDestinationTests_0.class)); }
/** * Returns the suite. This is required to * use the JUnit Launcher. */
Returns the suite. This is required to use the JUnit Launcher
suite
{ "repo_name": "jmvachon/bridgepoint", "path": "src/org.xtuml.bp.core.test/src/org/xtuml/bp/core/test/globals/CopyPasteSourceDestinationGlobalsTestsTestSuite.java", "license": "apache-2.0", "size": 1574 }
[ "junit.framework.TestSuite" ]
import junit.framework.TestSuite;
import junit.framework.*;
[ "junit.framework" ]
junit.framework;
2,889,987
public VCard loadVCard() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return loadVCard(null); }
VCard function() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return loadVCard(null); }
/** * Load the VCard of the current user. * * @throws XMPPErrorException * @throws NoResponseException * @throws NotConnectedException * @throws InterruptedException */
Load the VCard of the current user
loadVCard
{ "repo_name": "annovanvliet/Smack", "path": "smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/VCardManager.java", "license": "apache-2.0", "size": 6102 }
[ "org.jivesoftware.smack.SmackException", "org.jivesoftware.smack.XMPPException", "org.jivesoftware.smackx.vcardtemp.packet.VCard" ]
import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smackx.vcardtemp.packet.VCard;
import org.jivesoftware.smack.*; import org.jivesoftware.smackx.vcardtemp.packet.*;
[ "org.jivesoftware.smack", "org.jivesoftware.smackx" ]
org.jivesoftware.smack; org.jivesoftware.smackx;
1,735,432
public List getMimeBodyPartList() throws AttachDAOException { return getAttachDAO().getMimeBodyPartList(this); }
List function() throws AttachDAOException { return getAttachDAO().getMimeBodyPartList(this); }
/** * Get a list of MimeBodyParts from this List */
Get a list of MimeBodyParts from this List
getMimeBodyPartList
{ "repo_name": "ankon/gatormail", "path": "src/main/java/edu/ufl/osg/webmail/data/AttachList.java", "license": "gpl-2.0", "size": 14458 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,983,126
protected boolean matchRequest(Request request) { // Has a session been created? Session session = request.getSessionInternal(false); if (session == null) return (false); // Is there a saved request? SavedRequest sreq = (SavedRequest) session.getNote(Constants.FORM_REQUEST_NOTE); if (sreq == null) return (false); // Is there a saved principal? if (session.getNote(Constants.FORM_PRINCIPAL_NOTE) == null) return (false); // Does the request URI match? String requestURI = request.getRequestURI(); if (requestURI == null) return (false); return (requestURI.equals(request.getRequestURI())); }
boolean function(Request request) { Session session = request.getSessionInternal(false); if (session == null) return (false); SavedRequest sreq = (SavedRequest) session.getNote(Constants.FORM_REQUEST_NOTE); if (sreq == null) return (false); if (session.getNote(Constants.FORM_PRINCIPAL_NOTE) == null) return (false); String requestURI = request.getRequestURI(); if (requestURI == null) return (false); return (requestURI.equals(request.getRequestURI())); }
/** * Does this request match the saved one (so that it must be the redirect * we signalled after successful authentication? * * @param request The request to be verified */
Does this request match the saved one (so that it must be the redirect we signalled after successful authentication
matchRequest
{ "repo_name": "plumer/codana", "path": "tomcat_files/6.0.0/FormAuthenticator.java", "license": "mit", "size": 19338 }
[ "org.apache.catalina.Session", "org.apache.catalina.connector.Request" ]
import org.apache.catalina.Session; import org.apache.catalina.connector.Request;
import org.apache.catalina.*; import org.apache.catalina.connector.*;
[ "org.apache.catalina" ]
org.apache.catalina;
872,077
public void connect() throws ConnectionException, AccessException, RequestException, ConfigException { this.rpcConnection = new RpcStreamConnection(serverHost, serverPort, props, this.serverStats, this.charset, this.secure); this.dispatcher = new RpcPacketDispatcher(props, this); Log.info("RPC connection to Perforce server " + serverHost + ":" + serverPort + " established"); super.connect(); }
void function() throws ConnectionException, AccessException, RequestException, ConfigException { this.rpcConnection = new RpcStreamConnection(serverHost, serverPort, props, this.serverStats, this.charset, this.secure); this.dispatcher = new RpcPacketDispatcher(props, this); Log.info(STR + serverHost + ":" + serverPort + STR); super.connect(); }
/** * Try to establish an actual RPC connection to the target Perforce server. * Most of the actual setup work is done in the RpcConnection and * RpcPacketDispatcher constructors, but associated gubbins such as * auto login, etc., are done in the superclass. * * @see com.perforce.p4java.impl.mapbased.server.Server#connect() */
Try to establish an actual RPC connection to the target Perforce server. Most of the actual setup work is done in the RpcConnection and RpcPacketDispatcher constructors, but associated gubbins such as auto login, etc., are done in the superclass
connect
{ "repo_name": "paulseawa/p4ic4idea", "path": "p4java/src/com/perforce/p4java/impl/mapbased/rpc/NtsServerImpl.java", "license": "apache-2.0", "size": 25674 }
[ "com.perforce.p4java.Log", "com.perforce.p4java.exception.AccessException", "com.perforce.p4java.exception.ConfigException", "com.perforce.p4java.exception.ConnectionException", "com.perforce.p4java.exception.RequestException", "com.perforce.p4java.impl.mapbased.rpc.packet.RpcPacketDispatcher", "com.perforce.p4java.impl.mapbased.rpc.stream.RpcStreamConnection" ]
import com.perforce.p4java.Log; import com.perforce.p4java.exception.AccessException; import com.perforce.p4java.exception.ConfigException; import com.perforce.p4java.exception.ConnectionException; import com.perforce.p4java.exception.RequestException; import com.perforce.p4java.impl.mapbased.rpc.packet.RpcPacketDispatcher; import com.perforce.p4java.impl.mapbased.rpc.stream.RpcStreamConnection;
import com.perforce.p4java.*; import com.perforce.p4java.exception.*; import com.perforce.p4java.impl.mapbased.rpc.packet.*; import com.perforce.p4java.impl.mapbased.rpc.stream.*;
[ "com.perforce.p4java" ]
com.perforce.p4java;
2,693,032
CompletableFuture<Boolean> put(String id, BsonObject doc);
CompletableFuture<Boolean> put(String id, BsonObject doc);
/** * Put a document at the given id - overwrites any previous document stored under the ID * * @param id the name of the document within the binder * @param doc the document to save * @return a CompleteableFuture with a Boolean set to true */
Put a document at the given id - overwrites any previous document stored under the ID
put
{ "repo_name": "Tesco/mewbase", "path": "mewbase-core/src/main/java/io/mewbase/binders/Binder.java", "license": "mit", "size": 2450 }
[ "io.mewbase.bson.BsonObject", "java.util.concurrent.CompletableFuture" ]
import io.mewbase.bson.BsonObject; import java.util.concurrent.CompletableFuture;
import io.mewbase.bson.*; import java.util.concurrent.*;
[ "io.mewbase.bson", "java.util" ]
io.mewbase.bson; java.util;
2,230,208
@SuppressWarnings("static-method") @Test public final void registerBundleByEnumClassInGerman() { ResourceBundleManager.setLocale(german); ResourceBundleManager.register(BundleDemeterBase.class); Assert.assertTrue(ResourceBundleManager.getLocale().getLanguage() == german.getLanguage()); }
@SuppressWarnings(STR) final void function() { ResourceBundleManager.setLocale(german); ResourceBundleManager.register(BundleDemeterBase.class); Assert.assertTrue(ResourceBundleManager.getLocale().getLanguage() == german.getLanguage()); }
/** * Test the registration of a resource bundle in german using an enumeration * class. */
Test the registration of a resource bundle in german using an enumeration class
registerBundleByEnumClassInGerman
{ "repo_name": "ressec/demeter", "path": "demeter-base/src/test/java/com/heliosphere/demeter/base/resource/bundle/ResourceBundleTest.java", "license": "apache-2.0", "size": 7702 }
[ "com.heliosphere.demeter.base.resource.bundle.BundleDemeterBase", "com.heliosphere.demeter.base.resource.bundle.ResourceBundleManager", "org.junit.Assert" ]
import com.heliosphere.demeter.base.resource.bundle.BundleDemeterBase; import com.heliosphere.demeter.base.resource.bundle.ResourceBundleManager; import org.junit.Assert;
import com.heliosphere.demeter.base.resource.bundle.*; import org.junit.*;
[ "com.heliosphere.demeter", "org.junit" ]
com.heliosphere.demeter; org.junit;
2,881,341
public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { uis.elementAt(i).uninstallUI(a); } }
void function(JComponent a) { for (int i = 0; i < uis.size(); i++) { uis.elementAt(i).uninstallUI(a); } }
/** * Invokes the <code>uninstallUI</code> method on each UI handled by this object. */
Invokes the <code>uninstallUI</code> method on each UI handled by this object
uninstallUI
{ "repo_name": "mirkosertic/Bytecoder", "path": "classlib/java.desktop/src/main/resources/META-INF/modules/java.desktop/classes/javax/swing/plaf/multi/MultiPanelUI.java", "license": "apache-2.0", "size": 7272 }
[ "javax.swing.JComponent" ]
import javax.swing.JComponent;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
491,073
@Override public void shutdown() { try { fileChannel.close(); } catch (IOException ex) { LOG.error("Can't shutdown cleanly", ex); } try { raf.close(); } catch (IOException ex) { LOG.error("Can't shutdown cleanly", ex); } }
void function() { try { fileChannel.close(); } catch (IOException ex) { LOG.error(STR, ex); } try { raf.close(); } catch (IOException ex) { LOG.error(STR, ex); } }
/** * Close the file */
Close the file
shutdown
{ "repo_name": "intel-hadoop/hbase-rhino", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FileIOEngine.java", "license": "apache-2.0", "size": 3898 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,548,779
public SecurityContextConfigurer<HttpSecurity> securityContext() throws Exception { return getOrApply(new SecurityContextConfigurer<HttpSecurity>()); }
SecurityContextConfigurer<HttpSecurity> function() throws Exception { return getOrApply(new SecurityContextConfigurer<HttpSecurity>()); }
/** * Sets up management of the {@link SecurityContext} on the * {@link SecurityContextHolder} between {@link HttpServletRequest}'s. This is * automatically applied when using {@link WebSecurityConfigurerAdapter}. * * @return the {@link SecurityContextConfigurer} for further customizations * @throws Exception */
Sets up management of the <code>SecurityContext</code> on the <code>SecurityContextHolder</code> between <code>HttpServletRequest</code>'s. This is automatically applied when using <code>WebSecurityConfigurerAdapter</code>
securityContext
{ "repo_name": "thomasdarimont/spring-security", "path": "config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java", "license": "apache-2.0", "size": 56922 }
[ "org.springframework.security.config.annotation.web.configurers.SecurityContextConfigurer" ]
import org.springframework.security.config.annotation.web.configurers.SecurityContextConfigurer;
import org.springframework.security.config.annotation.web.configurers.*;
[ "org.springframework.security" ]
org.springframework.security;
696,613
@GET @Path("/edges/{id}") @Produces({MediaType.APPLICATION_JSON}) public Response getEdge(@PathParam("id") final String edgeId) { checkIfMetadataMappingServiceIsEnabled(); LOG.info("Get vertex for edgeId= {}", edgeId); validateInputs("Invalid argument: edge id passed is null or empty.", edgeId); try { Edge edge = getGraph().getEdge(edgeId); if (edge == null) { String message = "Edge with [" + edgeId + "] cannot be found."; LOG.info(message); throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND) .entity(JSONObject.quote(message)).build()); } JSONObject response = new JSONObject(); response.put(RESULTS, GraphSONUtility.jsonFromElement( edge, getEdgeIndexedKeys(), GraphSONMode.NORMAL)); return Response.ok(response).build(); } catch (JSONException e) { throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(JSONObject.quote("An error occurred: " + e.getMessage())).build()); } }
@Path(STR) @Produces({MediaType.APPLICATION_JSON}) Response function(@PathParam("id") final String edgeId) { checkIfMetadataMappingServiceIsEnabled(); LOG.info(STR, edgeId); validateInputs(STR, edgeId); try { Edge edge = getGraph().getEdge(edgeId); if (edge == null) { String message = STR + edgeId + STR; LOG.info(message); throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND) .entity(JSONObject.quote(message)).build()); } JSONObject response = new JSONObject(); response.put(RESULTS, GraphSONUtility.jsonFromElement( edge, getEdgeIndexedKeys(), GraphSONMode.NORMAL)); return Response.ok(response).build(); } catch (JSONException e) { throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(JSONObject.quote(STR + e.getMessage())).build()); } }
/** * Get a single edge with a unique id. * * GET http://host/graphs/lineage/edges/id * graph.getEdge(id); */
Get a single edge with a unique id. GET HREF graph.getEdge(id)
getEdge
{ "repo_name": "InMobi/incubator-falcon", "path": "prism/src/main/java/org/apache/falcon/resource/metadata/LineageMetadataResource.java", "license": "apache-2.0", "size": 22030 }
[ "com.tinkerpop.blueprints.Edge", "com.tinkerpop.blueprints.util.io.graphson.GraphSONMode", "com.tinkerpop.blueprints.util.io.graphson.GraphSONUtility", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.Produces", "javax.ws.rs.WebApplicationException", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response", "org.codehaus.jettison.json.JSONException", "org.codehaus.jettison.json.JSONObject" ]
import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.util.io.graphson.GraphSONMode; import com.tinkerpop.blueprints.util.io.graphson.GraphSONUtility; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject;
import com.tinkerpop.blueprints.*; import com.tinkerpop.blueprints.util.io.graphson.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.codehaus.jettison.json.*;
[ "com.tinkerpop.blueprints", "javax.ws", "org.codehaus.jettison" ]
com.tinkerpop.blueprints; javax.ws; org.codehaus.jettison;
356,122
ReactiveExecutions<Void> punsubscribe(K... patterns);
ReactiveExecutions<Void> punsubscribe(K... patterns);
/** * Stop listening for messages posted to channels matching the given patterns. * * @param patterns the patterns * @return RedisFuture&lt;Void&gt; Future to synchronize {@code punsubscribe} completion */
Stop listening for messages posted to channels matching the given patterns
punsubscribe
{ "repo_name": "lettuce-io/lettuce-core", "path": "src/main/java/io/lettuce/core/cluster/pubsub/api/reactive/NodeSelectionPubSubReactiveCommands.java", "license": "apache-2.0", "size": 2035 }
[ "io.lettuce.core.cluster.api.reactive.ReactiveExecutions" ]
import io.lettuce.core.cluster.api.reactive.ReactiveExecutions;
import io.lettuce.core.cluster.api.reactive.*;
[ "io.lettuce.core" ]
io.lettuce.core;
1,496,007
@Description("The watchdog's restart message") public String getWatchdogStartMessage();
@Description(STR) String function();
/** * Returns the restart message. */
Returns the restart message
getWatchdogStartMessage
{ "repo_name": "mdaniel/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/management/server/ResinMXBean.java", "license": "gpl-2.0", "size": 4380 }
[ "com.caucho.jmx.Description" ]
import com.caucho.jmx.Description;
import com.caucho.jmx.*;
[ "com.caucho.jmx" ]
com.caucho.jmx;
1,088,444
public void deinitialize() { if (isSVG12AccessKey) { NodeEventTarget eventTarget = (NodeEventTarget) owner.getRootEventTarget(); eventTarget.removeEventListenerNS (XMLConstants.XML_EVENTS_NAMESPACE_URI, "keydown", this, false); } else { EventTarget eventTarget = owner.getRootEventTarget(); eventTarget.removeEventListener("keypress", this, false); } } // EventListener /////////////////////////////////////////////////////////
void function() { if (isSVG12AccessKey) { NodeEventTarget eventTarget = (NodeEventTarget) owner.getRootEventTarget(); eventTarget.removeEventListenerNS (XMLConstants.XML_EVENTS_NAMESPACE_URI, STR, this, false); } else { EventTarget eventTarget = owner.getRootEventTarget(); eventTarget.removeEventListener(STR, this, false); } }
/** * Deinitializes this timing specifier by removing any event listeners. */
Deinitializes this timing specifier by removing any event listeners
deinitialize
{ "repo_name": "shyamalschandra/flex-sdk", "path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/anim/timing/AccesskeyTimingSpecifier.java", "license": "apache-2.0", "size": 5075 }
[ "org.apache.flex.forks.batik.dom.events.NodeEventTarget", "org.apache.flex.forks.batik.util.XMLConstants", "org.w3c.dom.events.EventTarget" ]
import org.apache.flex.forks.batik.dom.events.NodeEventTarget; import org.apache.flex.forks.batik.util.XMLConstants; import org.w3c.dom.events.EventTarget;
import org.apache.flex.forks.batik.dom.events.*; import org.apache.flex.forks.batik.util.*; import org.w3c.dom.events.*;
[ "org.apache.flex", "org.w3c.dom" ]
org.apache.flex; org.w3c.dom;
1,081,336
public Label getPortNumberStar() { return portNumberStar; }
Label function() { return portNumberStar; }
/** * To get Port Number Star. * * @return Label */
To get Port Number Star
getPortNumberStar
{ "repo_name": "kuzavas/ephesoft", "path": "dcma-gwt/dcma-gwt-admin/src/main/java/com/ephesoft/dcma/gwt/admin/bm/client/view/email/EditEmailView.java", "license": "agpl-3.0", "size": 15566 }
[ "com.google.gwt.user.client.ui.Label" ]
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.*;
[ "com.google.gwt" ]
com.google.gwt;
1,023,038
@Test public void testReplyDifferentVlan() { Host replyer = new DefaultHost(PID, HID1, MAC1, VLAN2, getLocation(4), Collections.singleton(IP1)); Host requestor = new DefaultHost(PID, HID2, MAC2, VLAN1, getLocation(5), Collections.singleton(IP2)); expect(hostService.getHostsByIp(IP1)) .andReturn(Collections.singleton(replyer)); expect(hostService.getHost(HID2)).andReturn(requestor); replay(hostService); Ethernet arpRequest = buildArp(ARP.OP_REQUEST, MAC2, null, IP2, IP1); proxyArp.reply(arpRequest, getLocation(6)); verifyFlood(arpRequest); }
void function() { Host replyer = new DefaultHost(PID, HID1, MAC1, VLAN2, getLocation(4), Collections.singleton(IP1)); Host requestor = new DefaultHost(PID, HID2, MAC2, VLAN1, getLocation(5), Collections.singleton(IP2)); expect(hostService.getHostsByIp(IP1)) .andReturn(Collections.singleton(replyer)); expect(hostService.getHost(HID2)).andReturn(requestor); replay(hostService); Ethernet arpRequest = buildArp(ARP.OP_REQUEST, MAC2, null, IP2, IP1); proxyArp.reply(arpRequest, getLocation(6)); verifyFlood(arpRequest); }
/** * Tests {@link ProxyArpManager#reply(Ethernet, ConnectPoint)} in the case where the * destination host is known for that IP address, but is not on the same * VLAN as the source host. * Verifies the ARP request is flooded out the correct edge ports. */
Tests <code>ProxyArpManager#reply(Ethernet, ConnectPoint)</code> in the case where the destination host is known for that IP address, but is not on the same VLAN as the source host. Verifies the ARP request is flooded out the correct edge ports
testReplyDifferentVlan
{ "repo_name": "maxkondr/onos-porta", "path": "core/net/src/test/java/org/onosproject/net/proxyarp/impl/ProxyArpManagerTest.java", "license": "apache-2.0", "size": 22418 }
[ "java.util.Collections", "org.easymock.EasyMock", "org.onlab.packet.Ethernet", "org.onosproject.net.DefaultHost", "org.onosproject.net.Host" ]
import java.util.Collections; import org.easymock.EasyMock; import org.onlab.packet.Ethernet; import org.onosproject.net.DefaultHost; import org.onosproject.net.Host;
import java.util.*; import org.easymock.*; import org.onlab.packet.*; import org.onosproject.net.*;
[ "java.util", "org.easymock", "org.onlab.packet", "org.onosproject.net" ]
java.util; org.easymock; org.onlab.packet; org.onosproject.net;
60,966
private int updateTransparency(int alpha, int transparency) { if (alpha != 0xFF) { if (alpha == 0x00 && transparency <= Transparency.BITMASK) { transparency = Transparency.BITMASK; } else if (transparency < Transparency.TRANSLUCENT) { transparency = Transparency.TRANSLUCENT; } } return transparency; }
int function(int alpha, int transparency) { if (alpha != 0xFF) { if (alpha == 0x00 && transparency <= Transparency.BITMASK) { transparency = Transparency.BITMASK; } else if (transparency < Transparency.TRANSLUCENT) { transparency = Transparency.TRANSLUCENT; } } return transparency; }
/** * Updates the transparency information according to the alpha pixel value. * * @param alpha the alpha pixel value * @param transparency the old transparency * * @return the updated transparency */
Updates the transparency information according to the alpha pixel value
updateTransparency
{ "repo_name": "taciano-perez/JamVM-PH", "path": "src/classpath/gnu/java/awt/image/ImageConverter.java", "license": "gpl-2.0", "size": 17900 }
[ "java.awt.Transparency" ]
import java.awt.Transparency;
import java.awt.*;
[ "java.awt" ]
java.awt;
55,118
public ClosableIterator<org.ontoware.rdf2go.model.node.Node> getAllAccessMode_asNode() { return Base.getAll_asNode(this.model, this.getResource(), ACCESSMODE); }
ClosableIterator<org.ontoware.rdf2go.model.node.Node> function() { return Base.getAll_asNode(this.model, this.getResource(), ACCESSMODE); }
/** * Get all values of property AccessMode as an Iterator over RDF2Go nodes * * @return a ClosableIterator of RDF2Go Nodes [Generated from RDFReactor * template rule #get8dynamic] */
Get all values of property AccessMode as an Iterator over RDF2Go nodes
getAllAccessMode_asNode
{ "repo_name": "m0ep/master-thesis", "path": "source/apis/rdf2go/rdf2go-w3-wacl/src/main/java/org/w3/ns/auth/acl/Authorization.java", "license": "mit", "size": 78044 }
[ "org.ontoware.aifbcommons.collection.ClosableIterator", "org.ontoware.rdfreactor.runtime.Base" ]
import org.ontoware.aifbcommons.collection.ClosableIterator; import org.ontoware.rdfreactor.runtime.Base;
import org.ontoware.aifbcommons.collection.*; import org.ontoware.rdfreactor.runtime.*;
[ "org.ontoware.aifbcommons", "org.ontoware.rdfreactor" ]
org.ontoware.aifbcommons; org.ontoware.rdfreactor;
675,081
private void ensureResourceRequestCountInContentProvider(String resource, int expectedCount) { Context context = getInstrumentation().getTargetContext(); int actualCount = TestContentProvider.getResourceRequestCount(context, resource); assertEquals(expectedCount, actualCount); }
void function(String resource, int expectedCount) { Context context = getInstrumentation().getTargetContext(); int actualCount = TestContentProvider.getResourceRequestCount(context, resource); assertEquals(expectedCount, actualCount); }
/** * Verifies the number of resource requests made to the content provider. * @param resource Resource name * @param expectedCount Expected resource requests count */
Verifies the number of resource requests made to the content provider
ensureResourceRequestCountInContentProvider
{ "repo_name": "SaschaMester/delicium", "path": "android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java", "license": "bsd-3-clause", "size": 125737 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
2,016,600
@Incubating void add(Class<? extends AttributeCompatibilityRule<T>> rule, Action<? super ActionConfiguration> configureAction);
void add(Class<? extends AttributeCompatibilityRule<T>> rule, Action<? super ActionConfiguration> configureAction);
/** * <p>Adds an arbitrary compatibility rule to the chain, possibly configuring the rule as well.</p> * * @param rule the rule to add to the chain * @param configureAction the action to use to configure the rule * @since 4.0 */
Adds an arbitrary compatibility rule to the chain, possibly configuring the rule as well
add
{ "repo_name": "lsmaira/gradle", "path": "subprojects/core-api/src/main/java/org/gradle/api/attributes/CompatibilityRuleChain.java", "license": "apache-2.0", "size": 3143 }
[ "org.gradle.api.Action", "org.gradle.api.ActionConfiguration" ]
import org.gradle.api.Action; import org.gradle.api.ActionConfiguration;
import org.gradle.api.*;
[ "org.gradle.api" ]
org.gradle.api;
722,651
IdPIdentity setIdentity(IdPIdentityConfig idPIdentityConfig) throws KeyStoreLoadException;
IdPIdentity setIdentity(IdPIdentityConfig idPIdentityConfig) throws KeyStoreLoadException;
/** * Update/add an eID IdP Identity * * @param idPIdentityConfig * the identity configuration * @return the identity * @throws KeyStoreLoadException * failed to load the identity. */
Update/add an eID IdP Identity
setIdentity
{ "repo_name": "charwliu/eid-idp", "path": "eid-idp-model/src/main/java/be/fedict/eid/idp/model/IdentityService.java", "license": "gpl-3.0", "size": 2948 }
[ "be.fedict.eid.idp.model.exception.KeyStoreLoadException", "be.fedict.eid.idp.spi.IdPIdentity" ]
import be.fedict.eid.idp.model.exception.KeyStoreLoadException; import be.fedict.eid.idp.spi.IdPIdentity;
import be.fedict.eid.idp.model.exception.*; import be.fedict.eid.idp.spi.*;
[ "be.fedict.eid" ]
be.fedict.eid;
2,821,132
@Override public void run() throws Failure { Payload payload = Payload.text("Test message sent from Gitblit"); if (!StringUtils.isEmpty(room)) { payload.room(room); } try { IRuntimeManager runtimeManager = GitblitContext.getManager(IRuntimeManager.class); HipChatter.init(runtimeManager); HipChatter.instance().send(payload); } catch (IOException e) { throw new Failure(1, e.getMessage(), e); } } } @CommandMetaData(name = "send", aliases = { "post" }, description = "Asynchronously post a message") @UsageExamples(examples = { @UsageExample(syntax = "${cmd} -m \"'this is a test'\"", description = "Asynchronously posts a message to the default room"), @UsageExample(syntax = "${cmd} myRoom -m \"'this is a test'\"", description = "Asynchronously posts a message to myRoom") }) public static class MessageCommand extends SshCommand { @Argument(index = 0, metaVar = "ROOM", usage = "Destination Room for message") String room; @Option(name = "--message", aliases = {"-m" }, metaVar = "-|MESSAGE", required = true) String message;
void function() throws Failure { Payload payload = Payload.text(STR); if (!StringUtils.isEmpty(room)) { payload.room(room); } try { IRuntimeManager runtimeManager = GitblitContext.getManager(IRuntimeManager.class); HipChatter.init(runtimeManager); HipChatter.instance().send(payload); } catch (IOException e) { throw new Failure(1, e.getMessage(), e); } } } @CommandMetaData(name = "send", aliases = { "post" }, description = STR) @UsageExamples(examples = { @UsageExample(syntax = STR'this is a test'\STRAsynchronously posts a message to the default roomSTR${cmd} myRoom -m \"'this is a test'\STRAsynchronously posts a message to myRoomSTRROOMSTRDestination Room for messageSTR--messageSTR-mSTR- MESSAGE", required = true) String message;
/** * Post a test message */
Post a test message
run
{ "repo_name": "gitblit/gitblit-hipchat-plugin", "path": "src/main/java/com/gitblit/plugin/hipchat/HipChatDispatcher.java", "license": "apache-2.0", "size": 3489 }
[ "com.gitblit.manager.IRuntimeManager", "com.gitblit.servlet.GitblitContext", "com.gitblit.transport.ssh.commands.CommandMetaData", "com.gitblit.transport.ssh.commands.UsageExample", "com.gitblit.transport.ssh.commands.UsageExamples", "com.gitblit.utils.StringUtils", "java.io.IOException" ]
import com.gitblit.manager.IRuntimeManager; import com.gitblit.servlet.GitblitContext; import com.gitblit.transport.ssh.commands.CommandMetaData; import com.gitblit.transport.ssh.commands.UsageExample; import com.gitblit.transport.ssh.commands.UsageExamples; import com.gitblit.utils.StringUtils; import java.io.IOException;
import com.gitblit.manager.*; import com.gitblit.servlet.*; import com.gitblit.transport.ssh.commands.*; import com.gitblit.utils.*; import java.io.*;
[ "com.gitblit.manager", "com.gitblit.servlet", "com.gitblit.transport", "com.gitblit.utils", "java.io" ]
com.gitblit.manager; com.gitblit.servlet; com.gitblit.transport; com.gitblit.utils; java.io;
2,584,652
@Test public void testCtor() { instance = new RefundTransaction(); assertNull("'transactionKey' should be correct.", TestsHelper.getField(instance, "transactionKey")); assertNull("'amount' should be correct.", TestsHelper.getField(instance, "amount")); assertNull("'claimNumber' should be correct.", TestsHelper.getField(instance, "claimNumber")); assertNull("'refundDate' should be correct.", TestsHelper.getField(instance, "refundDate")); assertNull("'refundUsername' should be correct.", TestsHelper.getField(instance, "refundUsername")); assertNull("'transferType' should be correct.", TestsHelper.getField(instance, "transferType")); }
void function() { instance = new RefundTransaction(); assertNull(STR, TestsHelper.getField(instance, STR)); assertNull(STR, TestsHelper.getField(instance, STR)); assertNull(STR, TestsHelper.getField(instance, STR)); assertNull(STR, TestsHelper.getField(instance, STR)); assertNull(STR, TestsHelper.getField(instance, STR)); assertNull(STR, TestsHelper.getField(instance, STR)); }
/** * <p> * Accuracy test for the constructor <code>RefundTransaction()</code>.<br> * Instance should be correctly created. * </p> */
Accuracy test for the constructor <code>RefundTransaction()</code>. Instance should be correctly created.
testCtor
{ "repo_name": "NASA-Tournament-Lab/CoECI-OPM-Service-Credit-Redeposit-Deposit-Application", "path": "Code/FACES/src/java/tests/gov/opm/scrd/entities/application/RefundTransactionUnitTests.java", "license": "apache-2.0", "size": 7671 }
[ "gov.opm.scrd.TestsHelper", "org.junit.Assert" ]
import gov.opm.scrd.TestsHelper; import org.junit.Assert;
import gov.opm.scrd.*; import org.junit.*;
[ "gov.opm.scrd", "org.junit" ]
gov.opm.scrd; org.junit;
652,354
public Adapter createBodyRepetitionAdapter() { return null; }
Adapter function() { return null; }
/** * Creates a new adapter for an object of class '{@link uk.ac.kcl.inf.robotics.rigidBodies.BodyRepetition <em>Body Repetition</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> * @return the new adapter. * @see uk.ac.kcl.inf.robotics.rigidBodies.BodyRepetition * @generated */
Creates a new adapter for an object of class '<code>uk.ac.kcl.inf.robotics.rigidBodies.BodyRepetition Body Repetition</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
createBodyRepetitionAdapter
{ "repo_name": "szschaler/RigidBodies", "path": "uk.ac.kcl.inf.robotics.rigid_bodies/src-gen/uk/ac/kcl/inf/robotics/rigidBodies/util/RigidBodiesAdapterFactory.java", "license": "mit", "size": 41508 }
[ "org.eclipse.emf.common.notify.Adapter" ]
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,046,464
public static <T> void saveJsonFile(T jsonFile, String filePath) throws IOException { assert jsonFile != null; assert filePath != null; serializeObjectToJsonFile(new File(filePath), jsonFile); }
static <T> void function(T jsonFile, String filePath) throws IOException { assert jsonFile != null; assert filePath != null; serializeObjectToJsonFile(new File(filePath), jsonFile); }
/** * Saves the Json object to the specified file. * Overwrites existing file if it exists, creates a new file if it doesn't. * @param jsonFile cannot be null * @param filePath cannot be null * @throws IOException if there was an error during writing to the file */
Saves the Json object to the specified file. Overwrites existing file if it exists, creates a new file if it doesn't
saveJsonFile
{ "repo_name": "CS2103JAN2017-W14-B1/main", "path": "src/main/java/seedu/tasklist/commons/util/JsonUtil.java", "license": "mit", "size": 5519 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,470,385
public SmtFilter getFilter() { return smtFilter; }
SmtFilter function() { return smtFilter; }
/** * Returns the value of smtFilter * * @return the smtFilter * ***********************************************************/
Returns the value of smtFilter
getFilter
{ "repo_name": "meier/opensm-smt", "path": "src/main/java/gov/llnl/lc/smt/command/SmtCommand.java", "license": "gpl-2.0", "size": 58041 }
[ "gov.llnl.lc.smt.filter.SmtFilter" ]
import gov.llnl.lc.smt.filter.SmtFilter;
import gov.llnl.lc.smt.filter.*;
[ "gov.llnl.lc" ]
gov.llnl.lc;
1,008,709
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (Exception ex) { Logger.getLogger(ServletProdutoCarrinhoController.class.getName()).log(Level.SEVERE, null, ex); } }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (Exception ex) { Logger.getLogger(ServletProdutoCarrinhoController.class.getName()).log(Level.SEVERE, null, ex); } }
/** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Handles the HTTP <code>POST</code> method
doPost
{ "repo_name": "megallanpp/EcommerceAllanUbiraci", "path": "EcommerceAllan_Ubiraci/src/java/controle/ServletProdutoCarrinhoController.java", "license": "mit", "size": 5735 }
[ "java.io.IOException", "java.util.logging.Level", "java.util.logging.Logger", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.util.logging.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "java.util", "javax.servlet" ]
java.io; java.util; javax.servlet;
1,508,898
private Set<IObject> loadObjects(long id, Parameters options) { Parameters param = new Parameters(); param.addId(id); StringBuilder sb = new StringBuilder(); Set result = new HashSet(); //images linked to it. sb.append("select img from Image as img "); sb.append("left outer join fetch " + "img.annotationLinksCountPerOwner img_a_c "); sb.append("left outer join fetch img.annotationLinks ail "); sb.append("left outer join fetch ail.child child "); sb.append("left outer join fetch ail.parent parent "); sb.append("left outer join fetch child.details.owner ownerChild "); sb.append("left outer join fetch parent.details.owner ownerParent "); sb.append("left outer join fetch img.pixels as pix "); sb.append("left outer join fetch pix.pixelsType as pt "); sb.append("where child.id = :id"); List l = iQuery.findAllByQuery(sb.toString(), param); if (l != null) result.addAll(l); sb = new StringBuilder(); sb.append("select d from Dataset as d "); sb.append("left outer join fetch " + "d.annotationLinksCountPerOwner d_a_c "); sb.append("left outer join fetch d.annotationLinks ail "); sb.append("left outer join fetch ail.child child "); sb.append("left outer join fetch ail.parent parent "); sb.append("left outer join fetch child.details.owner ownerChild "); sb.append("left outer join fetch parent.details.owner ownerParent "); sb.append("where child.id = :id"); l = iQuery.findAllByQuery(sb.toString(), param); if (l != null) result.addAll(l); sb = new StringBuilder(); sb.append("select pl from Plate as pl "); sb.append("left outer join fetch " + "pl.annotationLinksCountPerOwner pl_a_c "); sb.append("left outer join fetch pl.annotationLinks ail "); sb.append("left outer join fetch ail.child child "); sb.append("left outer join fetch ail.parent parent "); sb.append("where child.id = :id"); l = iQuery.findAllByQuery(sb.toString(), param); if (l != null) result.addAll(l); sb = new StringBuilder(); sb.append("select p from Project as p "); sb.append("left outer join fetch " + "p.annotationLinksCountPerOwner p_a_c "); sb.append("left outer join fetch p.annotationLinks ail "); sb.append("left outer join fetch ail.child child "); sb.append("left outer join fetch ail.parent parent "); sb.append("left outer join fetch child.details.owner ownerChild "); sb.append("left outer join fetch parent.details.owner ownerParent "); sb.append("where child.id = :id"); l = iQuery.findAllByQuery(sb.toString(), param); if (l != null && l.size() > 0) { Set<Long> ids = new HashSet<Long>(); Iterator i = l.iterator(); while (i.hasNext()) { ids.add(((IObject) i.next()).getId()); } Parameters po = new Parameters(options); po.noLeaves(); po.noOrphan(); Set p = iContainer.loadContainerHierarchy(Project.class, ids, po); result.addAll(p); } sb = new StringBuilder(); sb.append("select s from Screen as s "); sb.append("left outer join fetch " + "s.annotationLinksCountPerOwner s_a_c "); sb.append("left outer join fetch s.annotationLinks ail "); sb.append("left outer join fetch ail.child child "); sb.append("left outer join fetch ail.parent parent "); sb.append("left outer join fetch child.details.owner ownerChild "); sb.append("left outer join fetch parent.details.owner ownerParent "); sb.append("where child.id = :id"); l = iQuery.findAllByQuery(sb.toString(), param); if (l != null && l.size() > 0) { Set<Long> ids = new HashSet<Long>(); Iterator i = l.iterator(); while (i.hasNext()) { ids.add(((IObject) i.next()).getId()); } Parameters po = new Parameters(options); po.noLeaves(); po.noOrphan(); Set p = iContainer.loadContainerHierarchy(Screen.class, ids, po); result.addAll(p); } return result; }
Set<IObject> function(long id, Parameters options) { Parameters param = new Parameters(); param.addId(id); StringBuilder sb = new StringBuilder(); Set result = new HashSet(); sb.append(STR); sb.append(STR + STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); List l = iQuery.findAllByQuery(sb.toString(), param); if (l != null) result.addAll(l); sb = new StringBuilder(); sb.append(STR); sb.append(STR + STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); l = iQuery.findAllByQuery(sb.toString(), param); if (l != null) result.addAll(l); sb = new StringBuilder(); sb.append(STR); sb.append(STR + STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); l = iQuery.findAllByQuery(sb.toString(), param); if (l != null) result.addAll(l); sb = new StringBuilder(); sb.append(STR); sb.append(STR + STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); l = iQuery.findAllByQuery(sb.toString(), param); if (l != null && l.size() > 0) { Set<Long> ids = new HashSet<Long>(); Iterator i = l.iterator(); while (i.hasNext()) { ids.add(((IObject) i.next()).getId()); } Parameters po = new Parameters(options); po.noLeaves(); po.noOrphan(); Set p = iContainer.loadContainerHierarchy(Project.class, ids, po); result.addAll(p); } sb = new StringBuilder(); sb.append(STR); sb.append(STR + STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); l = iQuery.findAllByQuery(sb.toString(), param); if (l != null && l.size() > 0) { Set<Long> ids = new HashSet<Long>(); Iterator i = l.iterator(); while (i.hasNext()) { ids.add(((IObject) i.next()).getId()); } Parameters po = new Parameters(options); po.noLeaves(); po.noOrphan(); Set p = iContainer.loadContainerHierarchy(Screen.class, ids, po); result.addAll(p); } return result; }
/** * Loads the objects linked to a tag. * * @param id The id of the tag. * @param options The options. * @return See above. */
Loads the objects linked to a tag
loadObjects
{ "repo_name": "rleigh-dundee/openmicroscopy", "path": "components/server/src/ome/logic/MetadataImpl.java", "license": "gpl-2.0", "size": 34166 }
[ "java.util.HashSet", "java.util.Iterator", "java.util.List", "java.util.Set" ]
import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,189,815
public static LayoutBranch toModel(LayoutBranchSoap soapModel) { if (soapModel == null) { return null; } LayoutBranch model = new LayoutBranchImpl(); model.setLayoutBranchId(soapModel.getLayoutBranchId()); model.setGroupId(soapModel.getGroupId()); model.setCompanyId(soapModel.getCompanyId()); model.setUserId(soapModel.getUserId()); model.setUserName(soapModel.getUserName()); model.setLayoutSetBranchId(soapModel.getLayoutSetBranchId()); model.setPlid(soapModel.getPlid()); model.setName(soapModel.getName()); model.setDescription(soapModel.getDescription()); model.setMaster(soapModel.getMaster()); return model; }
static LayoutBranch function(LayoutBranchSoap soapModel) { if (soapModel == null) { return null; } LayoutBranch model = new LayoutBranchImpl(); model.setLayoutBranchId(soapModel.getLayoutBranchId()); model.setGroupId(soapModel.getGroupId()); model.setCompanyId(soapModel.getCompanyId()); model.setUserId(soapModel.getUserId()); model.setUserName(soapModel.getUserName()); model.setLayoutSetBranchId(soapModel.getLayoutSetBranchId()); model.setPlid(soapModel.getPlid()); model.setName(soapModel.getName()); model.setDescription(soapModel.getDescription()); model.setMaster(soapModel.getMaster()); return model; }
/** * Converts the soap model instance into a normal model instance. * * @param soapModel the soap model instance to convert * @return the normal model instance */
Converts the soap model instance into a normal model instance
toModel
{ "repo_name": "km-works/portal-rpc", "path": "portal-rpc-client/src/main/java/com/liferay/portal/model/impl/LayoutBranchModelImpl.java", "license": "lgpl-3.0", "size": 18663 }
[ "com.liferay.portal.model.LayoutBranch", "com.liferay.portal.model.LayoutBranchSoap" ]
import com.liferay.portal.model.LayoutBranch; import com.liferay.portal.model.LayoutBranchSoap;
import com.liferay.portal.model.*;
[ "com.liferay.portal" ]
com.liferay.portal;
1,698,933
public void clearWarnings() throws SQLException { checkClosed(); try { this.mc.clearWarnings(); } catch (SQLException sqlException) { checkAndFireConnectionError(sqlException); } }
void function() throws SQLException { checkClosed(); try { this.mc.clearWarnings(); } catch (SQLException sqlException) { checkAndFireConnectionError(sqlException); } }
/** * Passes call to method on physical connection instance. Notifies listeners * of any caught exceptions before re-throwing to client. * * @throws SQLException * if an error occurs */
Passes call to method on physical connection instance. Notifies listeners of any caught exceptions before re-throwing to client
clearWarnings
{ "repo_name": "spullara/mysql-connector-java", "path": "src/main/java/com/mysql/jdbc/jdbc2/optional/ConnectionWrapper.java", "license": "gpl-2.0", "size": 73716 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
874,375
public void removePropertyChangeListener( PropertyChangeListener listener) { propertyChangeSupport.removePropertyChangeListener(listener); }
void function( PropertyChangeListener listener) { propertyChangeSupport.removePropertyChangeListener(listener); }
/** * removes a PropertyChangeListener * @param listener the PropertyChangeListener to remove */
removes a PropertyChangeListener
removePropertyChangeListener
{ "repo_name": "amon-ra/jbackpack", "path": "src/ch/fhnw/util/ProcessExecutor.java", "license": "gpl-3.0", "size": 13909 }
[ "java.beans.PropertyChangeListener" ]
import java.beans.PropertyChangeListener;
import java.beans.*;
[ "java.beans" ]
java.beans;
1,789,932
public Map toMap() { Map map = new HashMap(); map.put("segNo",StringUtils.toString(segNo, eiMetadata.getMeta("segNo").getFieldLength(), eiMetadata.getMeta("segNo").getScaleLength())); map.put("billId",StringUtils.toString(billId, eiMetadata.getMeta("billId").getFieldLength(), eiMetadata.getMeta("billId").getScaleLength())); map.put("accsetNo",StringUtils.toString(accsetNo, eiMetadata.getMeta("accsetNo").getFieldLength(), eiMetadata.getMeta("accsetNo").getScaleLength())); map.put("userSegNo",StringUtils.toString(userSegNo, eiMetadata.getMeta("userSegNo").getFieldLength(), eiMetadata.getMeta("userSegNo").getScaleLength())); map.put("userId",StringUtils.toString(userId, eiMetadata.getMeta("userId").getFieldLength(), eiMetadata.getMeta("userId").getScaleLength())); map.put("internalFlag",StringUtils.toString(internalFlag, eiMetadata.getMeta("internalFlag").getFieldLength(), eiMetadata.getMeta("internalFlag").getScaleLength())); map.put("internalSegNo",StringUtils.toString(internalSegNo, eiMetadata.getMeta("internalSegNo").getFieldLength(), eiMetadata.getMeta("internalSegNo").getScaleLength())); map.put("providerBillNum",StringUtils.toString(providerBillNum, eiMetadata.getMeta("providerBillNum").getFieldLength(), eiMetadata.getMeta("providerBillNum").getScaleLength())); map.put("billStatus",StringUtils.toString(billStatus, eiMetadata.getMeta("billStatus").getFieldLength(), eiMetadata.getMeta("billStatus").getScaleLength())); map.put("billType",StringUtils.toString(billType, eiMetadata.getMeta("billType").getFieldLength(), eiMetadata.getMeta("billType").getScaleLength())); map.put("validStartDate",StringUtils.toString(validStartDate, eiMetadata.getMeta("validStartDate").getFieldLength(), eiMetadata.getMeta("validStartDate").getScaleLength())); map.put("validEndDate",StringUtils.toString(validEndDate, eiMetadata.getMeta("validEndDate").getFieldLength(), eiMetadata.getMeta("validEndDate").getScaleLength())); map.put("planDate",StringUtils.toString(planDate, eiMetadata.getMeta("planDate").getFieldLength(), eiMetadata.getMeta("planDate").getScaleLength())); map.put("wproviderId",StringUtils.toString(wproviderId, eiMetadata.getMeta("wproviderId").getFieldLength(), eiMetadata.getMeta("wproviderId").getScaleLength())); map.put("wproviderName",StringUtils.toString(wproviderName, eiMetadata.getMeta("wproviderName").getFieldLength(), eiMetadata.getMeta("wproviderName").getScaleLength())); map.put("wproviderAddr",StringUtils.toString(wproviderAddr, eiMetadata.getMeta("wproviderAddr").getFieldLength(), eiMetadata.getMeta("wproviderAddr").getScaleLength())); map.put("wproviderContactor",StringUtils.toString(wproviderContactor, eiMetadata.getMeta("wproviderContactor").getFieldLength(), eiMetadata.getMeta("wproviderContactor").getScaleLength())); map.put("wproviderTele",StringUtils.toString(wproviderTele, eiMetadata.getMeta("wproviderTele").getFieldLength(), eiMetadata.getMeta("wproviderTele").getScaleLength())); map.put("wproviderZip",StringUtils.toString(wproviderZip, eiMetadata.getMeta("wproviderZip").getFieldLength(), eiMetadata.getMeta("wproviderZip").getScaleLength())); map.put("wproviderFax",StringUtils.toString(wproviderFax, eiMetadata.getMeta("wproviderFax").getFieldLength(), eiMetadata.getMeta("wproviderFax").getScaleLength())); map.put("customerId",StringUtils.toString(customerId, eiMetadata.getMeta("customerId").getFieldLength(), eiMetadata.getMeta("customerId").getScaleLength())); map.put("contractId",StringUtils.toString(contractId, eiMetadata.getMeta("contractId").getFieldLength(), eiMetadata.getMeta("contractId").getScaleLength())); map.put("deliveryType",StringUtils.toString(deliveryType, eiMetadata.getMeta("deliveryType").getFieldLength(), eiMetadata.getMeta("deliveryType").getScaleLength())); map.put("freightSettleType",StringUtils.toString(freightSettleType, eiMetadata.getMeta("freightSettleType").getFieldLength(), eiMetadata.getMeta("freightSettleType").getScaleLength())); map.put("outSettleType",StringUtils.toString(outSettleType, eiMetadata.getMeta("outSettleType").getFieldLength(), eiMetadata.getMeta("outSettleType").getScaleLength())); map.put("carType",StringUtils.toString(carType, eiMetadata.getMeta("carType").getFieldLength(), eiMetadata.getMeta("carType").getScaleLength())); map.put("specialRequest",StringUtils.toString(specialRequest, eiMetadata.getMeta("specialRequest").getFieldLength(), eiMetadata.getMeta("specialRequest").getScaleLength())); map.put("consigneeId",StringUtils.toString(consigneeId, eiMetadata.getMeta("consigneeId").getFieldLength(), eiMetadata.getMeta("consigneeId").getScaleLength())); map.put("consigneeName",StringUtils.toString(consigneeName, eiMetadata.getMeta("consigneeName").getFieldLength(), eiMetadata.getMeta("consigneeName").getScaleLength())); map.put("consigneeAddr",StringUtils.toString(consigneeAddr, eiMetadata.getMeta("consigneeAddr").getFieldLength(), eiMetadata.getMeta("consigneeAddr").getScaleLength())); map.put("consigneeRespnder",StringUtils.toString(consigneeRespnder, eiMetadata.getMeta("consigneeRespnder").getFieldLength(), eiMetadata.getMeta("consigneeRespnder").getScaleLength())); map.put("consigneeTele",StringUtils.toString(consigneeTele, eiMetadata.getMeta("consigneeTele").getFieldLength(), eiMetadata.getMeta("consigneeTele").getScaleLength())); map.put("consigneeFax",StringUtils.toString(consigneeFax, eiMetadata.getMeta("consigneeFax").getFieldLength(), eiMetadata.getMeta("consigneeFax").getScaleLength())); map.put("consigneeZipcode",StringUtils.toString(consigneeZipcode, eiMetadata.getMeta("consigneeZipcode").getFieldLength(), eiMetadata.getMeta("consigneeZipcode").getScaleLength())); map.put("transFlag",StringUtils.toString(transFlag, eiMetadata.getMeta("transFlag").getFieldLength(), eiMetadata.getMeta("transFlag").getScaleLength())); map.put("tproviderId",StringUtils.toString(tproviderId, eiMetadata.getMeta("tproviderId").getFieldLength(), eiMetadata.getMeta("tproviderId").getScaleLength())); map.put("createPerson",StringUtils.toString(createPerson, eiMetadata.getMeta("createPerson").getFieldLength(), eiMetadata.getMeta("createPerson").getScaleLength())); map.put("createDate",StringUtils.toString(createDate, eiMetadata.getMeta("createDate").getFieldLength(), eiMetadata.getMeta("createDate").getScaleLength())); map.put("returnPerson",StringUtils.toString(returnPerson, eiMetadata.getMeta("returnPerson").getFieldLength(), eiMetadata.getMeta("returnPerson").getScaleLength())); map.put("returnDate",StringUtils.toString(returnDate, eiMetadata.getMeta("returnDate").getFieldLength(), eiMetadata.getMeta("returnDate").getScaleLength())); map.put("billBackPerson",StringUtils.toString(billBackPerson, eiMetadata.getMeta("billBackPerson").getFieldLength(), eiMetadata.getMeta("billBackPerson").getScaleLength())); map.put("billBackDate",StringUtils.toString(billBackDate, eiMetadata.getMeta("billBackDate").getFieldLength(), eiMetadata.getMeta("billBackDate").getScaleLength())); map.put("printed",StringUtils.toString(printed, eiMetadata.getMeta("printed").getFieldLength(), eiMetadata.getMeta("printed").getScaleLength())); map.put("billPrintSite",StringUtils.toString(billPrintSite, eiMetadata.getMeta("billPrintSite").getFieldLength(), eiMetadata.getMeta("billPrintSite").getScaleLength())); map.put("billPrintUserId",StringUtils.toString(billPrintUserId, eiMetadata.getMeta("billPrintUserId").getFieldLength(), eiMetadata.getMeta("billPrintUserId").getScaleLength())); map.put("billPrintDate",StringUtils.toString(billPrintDate, eiMetadata.getMeta("billPrintDate").getFieldLength(), eiMetadata.getMeta("billPrintDate").getScaleLength())); map.put("arrearType",StringUtils.toString(arrearType, eiMetadata.getMeta("arrearType").getFieldLength(), eiMetadata.getMeta("arrearType").getScaleLength())); map.put("settleSeqNum",StringUtils.toString(settleSeqNum, eiMetadata.getMeta("settleSeqNum").getFieldLength(), eiMetadata.getMeta("settleSeqNum").getScaleLength())); map.put("modiPerson",StringUtils.toString(modiPerson, eiMetadata.getMeta("modiPerson").getFieldLength(), eiMetadata.getMeta("modiPerson").getScaleLength())); map.put("modiDate",StringUtils.toString(modiDate, eiMetadata.getMeta("modiDate").getFieldLength(), eiMetadata.getMeta("modiDate").getScaleLength())); map.put("returnConfirmFlag",StringUtils.toString(returnConfirmFlag, eiMetadata.getMeta("returnConfirmFlag").getFieldLength(), eiMetadata.getMeta("returnConfirmFlag").getScaleLength())); map.put("returnConfirmPers",StringUtils.toString(returnConfirmPers, eiMetadata.getMeta("returnConfirmPers").getFieldLength(), eiMetadata.getMeta("returnConfirmPers").getScaleLength())); map.put("returnConfirmDate",StringUtils.toString(returnConfirmDate, eiMetadata.getMeta("returnConfirmDate").getFieldLength(), eiMetadata.getMeta("returnConfirmDate").getScaleLength())); map.put("printBatchId",StringUtils.toString(printBatchId, eiMetadata.getMeta("printBatchId").getFieldLength(), eiMetadata.getMeta("printBatchId").getScaleLength())); map.put("fetchPerson",StringUtils.toString(fetchPerson, eiMetadata.getMeta("fetchPerson").getFieldLength(), eiMetadata.getMeta("fetchPerson").getScaleLength())); map.put("fetchPersonIdCard",StringUtils.toString(fetchPersonIdCard, eiMetadata.getMeta("fetchPersonIdCard").getFieldLength(), eiMetadata.getMeta("fetchPersonIdCard").getScaleLength())); map.put("billDessentType",StringUtils.toString(billDessentType, eiMetadata.getMeta("billDessentType").getFieldLength(), eiMetadata.getMeta("billDessentType").getScaleLength())); map.put("startPrivince",StringUtils.toString(startPrivince, eiMetadata.getMeta("startPrivince").getFieldLength(), eiMetadata.getMeta("startPrivince").getScaleLength())); map.put("deliveryPrivince",StringUtils.toString(deliveryPrivince, eiMetadata.getMeta("deliveryPrivince").getFieldLength(), eiMetadata.getMeta("deliveryPrivince").getScaleLength())); map.put("groupCommissionId",StringUtils.toString(groupCommissionId, eiMetadata.getMeta("groupCommissionId").getFieldLength(), eiMetadata.getMeta("groupCommissionId").getScaleLength())); map.put("approveStatus",StringUtils.toString(approveStatus, eiMetadata.getMeta("approveStatus").getFieldLength(), eiMetadata.getMeta("approveStatus").getScaleLength())); map.put("billBatchId",StringUtils.toString(billBatchId, eiMetadata.getMeta("billBatchId").getFieldLength(), eiMetadata.getMeta("billBatchId").getScaleLength())); map.put("randomId",StringUtils.toString(randomId, eiMetadata.getMeta("randomId").getFieldLength(), eiMetadata.getMeta("randomId").getScaleLength())); map.put("providerName",StringUtils.toString(providerName, eiMetadata.getMeta("providerName").getFieldLength(), eiMetadata.getMeta("providerName").getScaleLength())); map.put("providerId",StringUtils.toString(providerId, eiMetadata.getMeta("providerId").getFieldLength(), eiMetadata.getMeta("providerId").getScaleLength())); map.put("ebsBillType",StringUtils.toString(ebsBillType, eiMetadata.getMeta("ebsBillType").getFieldLength(), eiMetadata.getMeta("ebsBillType").getScaleLength())); map.put("ebsBillPrintUserName",StringUtils.toString(ebsBillPrintUserName, eiMetadata.getMeta("ebsBillPrintUserName").getFieldLength(), eiMetadata.getMeta("ebsBillPrintUserName").getScaleLength())); map.put("ebsBillPrintOrgName",StringUtils.toString(ebsBillPrintOrgName, eiMetadata.getMeta("ebsBillPrintOrgName").getFieldLength(), eiMetadata.getMeta("ebsBillPrintOrgName").getScaleLength())); map.put("remark",StringUtils.toString(remark, eiMetadata.getMeta("remark").getFieldLength(), eiMetadata.getMeta("remark").getScaleLength())); map.put("proxyFlag",StringUtils.toString(proxyFlag, eiMetadata.getMeta("proxyFlag").getFieldLength(), eiMetadata.getMeta("proxyFlag").getScaleLength())); map.put("ebsBillObject",StringUtils.toString(ebsBillObject, eiMetadata.getMeta("ebsBillObject").getFieldLength(), eiMetadata.getMeta("ebsBillObject").getScaleLength())); map.put("ebsBillLock",StringUtils.toString(ebsBillLock, eiMetadata.getMeta("ebsBillLock").getFieldLength(), eiMetadata.getMeta("ebsBillLock").getScaleLength())); map.put("z_planApplyDate",StringUtils.toString(z_planApplyDate, eiMetadata.getMeta("z_planApplyDate").getFieldLength(), eiMetadata.getMeta("z_planApplyDate").getScaleLength())); map.put("transferFlag",StringUtils.toString(transferFlag, eiMetadata.getMeta("transferFlag").getFieldLength(), eiMetadata.getMeta("transferFlag").getScaleLength())); map.put("ebsBillBatchId",StringUtils.toString(ebsBillBatchId, eiMetadata.getMeta("ebsBillBatchId").getFieldLength(), eiMetadata.getMeta("ebsBillBatchId").getScaleLength())); map.put("xhPrinted",StringUtils.toString(xhPrinted, eiMetadata.getMeta("xhPrinted").getFieldLength(), eiMetadata.getMeta("xhPrinted").getScaleLength())); map.put("webBillFrom",StringUtils.toString(webBillFrom, eiMetadata.getMeta("webBillFrom").getFieldLength(), eiMetadata.getMeta("webBillFrom").getScaleLength())); map.put("invoiceReqNum",StringUtils.toString(invoiceReqNum, eiMetadata.getMeta("invoiceReqNum").getFieldLength(), eiMetadata.getMeta("invoiceReqNum").getScaleLength())); map.put("webBillId",StringUtils.toString(webBillId, eiMetadata.getMeta("webBillId").getFieldLength(), eiMetadata.getMeta("webBillId").getScaleLength())); map.put("warehouseOutQty",StringUtils.toString(warehouseOutQty, eiMetadata.getMeta("warehouseOutQty").getFieldLength(), eiMetadata.getMeta("warehouseOutQty").getScaleLength())); map.put("warehouseOutDate",StringUtils.toString(warehouseOutDate, eiMetadata.getMeta("warehouseOutDate").getFieldLength(), eiMetadata.getMeta("warehouseOutDate").getScaleLength())); map.put("billBankBatchId",StringUtils.toString(billBankBatchId, eiMetadata.getMeta("billBankBatchId").getFieldLength(), eiMetadata.getMeta("billBankBatchId").getScaleLength())); map.put("billBankStatus",StringUtils.toString(billBankStatus, eiMetadata.getMeta("billBankStatus").getFieldLength(), eiMetadata.getMeta("billBankStatus").getScaleLength())); map.put("returnRemark",StringUtils.toString(returnRemark, eiMetadata.getMeta("returnRemark").getFieldLength(), eiMetadata.getMeta("returnRemark").getScaleLength())); map.put("printRemark",StringUtils.toString(printRemark, eiMetadata.getMeta("printRemark").getFieldLength(), eiMetadata.getMeta("printRemark").getScaleLength())); map.put("gatheringId",StringUtils.toString(gatheringId, eiMetadata.getMeta("gatheringId").getFieldLength(), eiMetadata.getMeta("gatheringId").getScaleLength())); map.put("settleId",StringUtils.toString(settleId, eiMetadata.getMeta("settleId").getFieldLength(), eiMetadata.getMeta("settleId").getScaleLength())); return map; }
Map function() { Map map = new HashMap(); map.put("segNo",StringUtils.toString(segNo, eiMetadata.getMeta("segNo").getFieldLength(), eiMetadata.getMeta("segNo").getScaleLength())); map.put(STR,StringUtils.toString(billId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(accsetNo, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(userSegNo, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(userId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(internalFlag, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(internalSegNo, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(providerBillNum, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(billStatus, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(billType, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(validStartDate, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(validEndDate, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(planDate, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(wproviderId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(wproviderName, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(wproviderAddr, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(wproviderContactor, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(wproviderTele, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(wproviderZip, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(wproviderFax, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(customerId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(contractId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(deliveryType, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(freightSettleType, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(outSettleType, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(carType, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(specialRequest, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(consigneeId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(consigneeName, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(consigneeAddr, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(consigneeRespnder, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(consigneeTele, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(consigneeFax, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(consigneeZipcode, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(transFlag, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(tproviderId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(createPerson, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(createDate, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(returnPerson, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(returnDate, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(billBackPerson, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(billBackDate, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(printed, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(billPrintSite, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(billPrintUserId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(billPrintDate, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(arrearType, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(settleSeqNum, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(modiPerson, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(modiDate, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(returnConfirmFlag, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(returnConfirmPers, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(returnConfirmDate, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(printBatchId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(fetchPerson, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(fetchPersonIdCard, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(billDessentType, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(startPrivince, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(deliveryPrivince, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(groupCommissionId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(approveStatus, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(billBatchId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(randomId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(providerName, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(providerId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(ebsBillType, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(ebsBillPrintUserName, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(ebsBillPrintOrgName, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(remark, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(proxyFlag, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(ebsBillObject, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(ebsBillLock, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(z_planApplyDate, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(transferFlag, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(ebsBillBatchId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(xhPrinted, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(webBillFrom, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(invoiceReqNum, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(webBillId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(warehouseOutQty, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(warehouseOutDate, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(billBankBatchId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(billBankStatus, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(returnRemark, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(printRemark, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(gatheringId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); map.put(STR,StringUtils.toString(settleId, eiMetadata.getMeta(STR).getFieldLength(), eiMetadata.getMeta(STR).getScaleLength())); return map; }
/** * set the value to Map */
set the value to Map
toMap
{ "repo_name": "stserp/erp1", "path": "source/src/com/baosight/sts/st/xs/domain/STXS0901M.java", "license": "apache-2.0", "size": 71113 }
[ "com.baosight.iplat4j.util.StringUtils", "java.util.HashMap", "java.util.Map" ]
import com.baosight.iplat4j.util.StringUtils; import java.util.HashMap; import java.util.Map;
import com.baosight.iplat4j.util.*; import java.util.*;
[ "com.baosight.iplat4j", "java.util" ]
com.baosight.iplat4j; java.util;
1,313,697
public ToStringHelper toStringHelper(Object self) { return MoreObjects.toStringHelper(self) .add("level", level) .add("loggers", loggers) .add("appenders", appenders); }
ToStringHelper function(Object self) { return MoreObjects.toStringHelper(self) .add("level", level) .add(STR, loggers) .add(STR, appenders); }
/** * Returns a string representation of the object. * * @param self the object to generate the string for (typically this), used only for its class name. */
Returns a string representation of the object
toStringHelper
{ "repo_name": "epam/DLab", "path": "services/billing-azure/src/main/java/com/epam/dlab/billing/azure/config/LoggingConfigurationFactory.java", "license": "apache-2.0", "size": 4523 }
[ "com.google.common.base.MoreObjects" ]
import com.google.common.base.MoreObjects;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,855,836
public String getIdProperty(Properties properties, String propertyId) { if ((properties == null) || (properties.getProperties() == null)) { return null; } PropertyData<?> property = properties.getProperties().get(propertyId); if (!(property instanceof PropertyId)) { return null; } return ((PropertyId) property).getFirstValue(); }
String function(Properties properties, String propertyId) { if ((properties == null) (properties.getProperties() == null)) { return null; } PropertyData<?> property = properties.getProperties().get(propertyId); if (!(property instanceof PropertyId)) { return null; } return ((PropertyId) property).getFirstValue(); }
/** * Returns the value of the given property if it exists and is of the * correct type. */
Returns the value of the given property if it exists and is of the correct type
getIdProperty
{ "repo_name": "loftuxab/alfresco-community-loftux", "path": "projects/repository/source/java/org/alfresco/opencmis/CMISConnector.java", "license": "lgpl-3.0", "size": 153672 }
[ "org.apache.chemistry.opencmis.commons.data.Properties", "org.apache.chemistry.opencmis.commons.data.PropertyData", "org.apache.chemistry.opencmis.commons.data.PropertyId" ]
import org.apache.chemistry.opencmis.commons.data.Properties; import org.apache.chemistry.opencmis.commons.data.PropertyData; import org.apache.chemistry.opencmis.commons.data.PropertyId;
import org.apache.chemistry.opencmis.commons.data.*;
[ "org.apache.chemistry" ]
org.apache.chemistry;
599,270
private void settingsChanged(boolean lambdaStyleChanged) { // check changes and eventually update file tree val lastTreeState = CptPluginSettingsForm.getLastTreeState(); if (lastTreeState != null) { List<File> changedFiles = new ArrayList<>(); for (CptLang cptLang : SupportedLanguages.supportedLanguages) { val cptVirtualFiles = lastTreeState.getOrDefault(cptLang, _List()); for (CptVirtualFile cptVirtualFile : cptVirtualFiles) { try { boolean needsUpdate = false; if (cptVirtualFile.getFile() != null) { createParent(cptVirtualFile.getFile()); } if (cptVirtualFile.isNew() || !cptVirtualFile.getFile().exists() || lambdaStyleChanged) { //noinspection ResultOfMethodCallIgnored cptVirtualFile.getFile().createNewFile(); needsUpdate = cptVirtualFile.getUrl() != null; } if (cptVirtualFile.fileHasChanged()) { cptVirtualFile.getOldFile().renameTo(cptVirtualFile.getFile()); } if (cptVirtualFile.urlHasChanged()) { needsUpdate = true; } if (needsUpdate) { downloadWebTemplateFile(cptVirtualFile); changedFiles.add(cptVirtualFile.getFile()); } } catch (IOException e) { e.printStackTrace(); } } val filesInTree = cptVirtualFiles.stream().map(f -> f.getFile().getAbsolutePath()).collect(Collectors.toSet()); // delete the files that has been removed from the tree Arrays.stream(CptUtil.getTemplateFilesFromLanguageDir(cptLang.getLanguage())) .filter(f -> !filesInTree.contains(f.getAbsolutePath())) .forEach(f -> f.delete()); } LocalFileSystem.getInstance().refreshIoFiles(changedFiles); } ApplicationManager.getApplication().getMessageBus().syncPublisher(SettingsChangedListener.TOPIC).onSettingsChange(this); }
void function(boolean lambdaStyleChanged) { val lastTreeState = CptPluginSettingsForm.getLastTreeState(); if (lastTreeState != null) { List<File> changedFiles = new ArrayList<>(); for (CptLang cptLang : SupportedLanguages.supportedLanguages) { val cptVirtualFiles = lastTreeState.getOrDefault(cptLang, _List()); for (CptVirtualFile cptVirtualFile : cptVirtualFiles) { try { boolean needsUpdate = false; if (cptVirtualFile.getFile() != null) { createParent(cptVirtualFile.getFile()); } if (cptVirtualFile.isNew() !cptVirtualFile.getFile().exists() lambdaStyleChanged) { cptVirtualFile.getFile().createNewFile(); needsUpdate = cptVirtualFile.getUrl() != null; } if (cptVirtualFile.fileHasChanged()) { cptVirtualFile.getOldFile().renameTo(cptVirtualFile.getFile()); } if (cptVirtualFile.urlHasChanged()) { needsUpdate = true; } if (needsUpdate) { downloadWebTemplateFile(cptVirtualFile); changedFiles.add(cptVirtualFile.getFile()); } } catch (IOException e) { e.printStackTrace(); } } val filesInTree = cptVirtualFiles.stream().map(f -> f.getFile().getAbsolutePath()).collect(Collectors.toSet()); Arrays.stream(CptUtil.getTemplateFilesFromLanguageDir(cptLang.getLanguage())) .filter(f -> !filesInTree.contains(f.getAbsolutePath())) .forEach(f -> f.delete()); } LocalFileSystem.getInstance().refreshIoFiles(changedFiles); } ApplicationManager.getApplication().getMessageBus().syncPublisher(SettingsChangedListener.TOPIC).onSettingsChange(this); }
/** * This method is called after the user changed some settings and saved them. * * @param lambdaStyleChanged indicates if lambda style has changed */
This method is called after the user changed some settings and saved them
settingsChanged
{ "repo_name": "xylo/intellij-postfix-templates", "path": "src/de/endrullis/idea/postfixtemplates/settings/CptApplicationSettings.java", "license": "apache-2.0", "size": 4804 }
[ "com.intellij.openapi.application.ApplicationManager", "com.intellij.openapi.vfs.LocalFileSystem", "de.endrullis.idea.postfixtemplates.language.CptLang", "de.endrullis.idea.postfixtemplates.language.CptUtil", "de.endrullis.idea.postfixtemplates.languages.SupportedLanguages", "java.io.File", "java.io.IOException", "java.util.ArrayList", "java.util.Arrays", "java.util.List", "java.util.stream.Collectors" ]
import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.vfs.LocalFileSystem; import de.endrullis.idea.postfixtemplates.language.CptLang; import de.endrullis.idea.postfixtemplates.language.CptUtil; import de.endrullis.idea.postfixtemplates.languages.SupportedLanguages; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors;
import com.intellij.openapi.application.*; import com.intellij.openapi.vfs.*; import de.endrullis.idea.postfixtemplates.language.*; import de.endrullis.idea.postfixtemplates.languages.*; import java.io.*; import java.util.*; import java.util.stream.*;
[ "com.intellij.openapi", "de.endrullis.idea", "java.io", "java.util" ]
com.intellij.openapi; de.endrullis.idea; java.io; java.util;
1,314,037
public void removePolicy(String policyId, boolean dePromote) throws EntitlementException { if (policyId == null) { throw new EntitlementException("Entitlement PolicyId can not be null."); } PAPPolicyStoreManager policyAdmin = EntitlementAdminEngine.getInstance().getPapPolicyStoreManager(); PolicyDTO oldPolicy = null; try { try { oldPolicy = getPolicy(policyId, false); } catch (Exception e) { // exception is ignore. as unwanted details are throws } if (oldPolicy == null) { oldPolicy = new PolicyDTO(); oldPolicy.setPolicyId(policyId); } policyAdmin.removePolicy(policyId); } catch (EntitlementException e) { oldPolicy = new PolicyDTO(); oldPolicy.setPolicyId(policyId); handleStatus(EntitlementConstants.StatusTypes.DELETE_POLICY, oldPolicy, false, e.getMessage()); throw e; } handleStatus(EntitlementConstants.StatusTypes.DELETE_POLICY, oldPolicy, true, null); //remove versions EntitlementAdminEngine.getInstance().getVersionManager().deletePolicy(policyId); // policy remove from PDP. this is done by separate thread if (dePromote) { publishToPDP(new String[]{policyId}, null, EntitlementConstants.PolicyPublish.ACTION_DELETE); } }
void function(String policyId, boolean dePromote) throws EntitlementException { if (policyId == null) { throw new EntitlementException(STR); } PAPPolicyStoreManager policyAdmin = EntitlementAdminEngine.getInstance().getPapPolicyStoreManager(); PolicyDTO oldPolicy = null; try { try { oldPolicy = getPolicy(policyId, false); } catch (Exception e) { } if (oldPolicy == null) { oldPolicy = new PolicyDTO(); oldPolicy.setPolicyId(policyId); } policyAdmin.removePolicy(policyId); } catch (EntitlementException e) { oldPolicy = new PolicyDTO(); oldPolicy.setPolicyId(policyId); handleStatus(EntitlementConstants.StatusTypes.DELETE_POLICY, oldPolicy, false, e.getMessage()); throw e; } handleStatus(EntitlementConstants.StatusTypes.DELETE_POLICY, oldPolicy, true, null); EntitlementAdminEngine.getInstance().getVersionManager().deletePolicy(policyId); if (dePromote) { publishToPDP(new String[]{policyId}, null, EntitlementConstants.PolicyPublish.ACTION_DELETE); } }
/** * Removes policy for given policy object * * @param policyId policyId * @param dePromote whether these policy must be removed from PDP as well * @throws EntitlementException throws */
Removes policy for given policy object
removePolicy
{ "repo_name": "laki88/carbon-identity", "path": "components/entitlement/org.wso2.carbon.identity.entitlement/src/main/java/org/wso2/carbon/identity/entitlement/EntitlementPolicyAdminService.java", "license": "apache-2.0", "size": 36961 }
[ "org.wso2.carbon.identity.entitlement.common.EntitlementConstants", "org.wso2.carbon.identity.entitlement.dto.PolicyDTO", "org.wso2.carbon.identity.entitlement.pap.EntitlementAdminEngine", "org.wso2.carbon.identity.entitlement.pap.store.PAPPolicyStoreManager" ]
import org.wso2.carbon.identity.entitlement.common.EntitlementConstants; import org.wso2.carbon.identity.entitlement.dto.PolicyDTO; import org.wso2.carbon.identity.entitlement.pap.EntitlementAdminEngine; import org.wso2.carbon.identity.entitlement.pap.store.PAPPolicyStoreManager;
import org.wso2.carbon.identity.entitlement.common.*; import org.wso2.carbon.identity.entitlement.dto.*; import org.wso2.carbon.identity.entitlement.pap.*; import org.wso2.carbon.identity.entitlement.pap.store.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
320,481
Arrays.fill(ritems, 0, rsize, null); Arrays.fill(pitems, 0, psize, null); rsize = 0; psize = 0; }
Arrays.fill(ritems, 0, rsize, null); Arrays.fill(pitems, 0, psize, null); rsize = 0; psize = 0; }
/** * Clear both rendering and picking queues. */
Clear both rendering and picking queues
clear
{ "repo_name": "giacomovagni/Prefuse", "path": "src/prefuse/util/display/RenderingQueue.java", "license": "bsd-3-clause", "size": 4006 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
254,168
public int solutionHashCode() { return new HashCodeBuilder() .append(id) .append(course) .append(period) .append(room) .toHashCode(); }
int function() { return new HashCodeBuilder() .append(id) .append(course) .append(period) .append(room) .toHashCode(); }
/** * The normal methods {@link #equals(Object)} and {@link #hashCode()} cannot be used because the rule engine already * requires them (for performance in their original state). * @see #solutionEquals(Object) */
The normal methods <code>#equals(Object)</code> and <code>#hashCode()</code> cannot be used because the rule engine already requires them (for performance in their original state)
solutionHashCode
{ "repo_name": "cyberdrcarr/optaplanner", "path": "drools-planner-examples/src/main/java/org/drools/planner/examples/curriculumcourse/domain/Lecture.java", "license": "apache-2.0", "size": 5168 }
[ "org.apache.commons.lang.builder.HashCodeBuilder" ]
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.*;
[ "org.apache.commons" ]
org.apache.commons;
1,963,683
@SuppressWarnings("unchecked") public static void validate(Map<String, Object> configurationParameters, URI configDescriptionURI) { Preconditions.checkNotNull(configurationParameters, "Configuration parameters must not be null"); Preconditions.checkNotNull(configDescriptionURI, "Config description URI must not be null"); ConfigDescription configDescription = getConfigDescription(configDescriptionURI); if (configDescription == null) { logger.warn("Skipping config description validation because no config description found for URI '{}'", configDescriptionURI); return; } Map<String, ConfigDescriptionParameter> map = configDescription.toParametersMap(); Collection<ConfigValidationMessage> configDescriptionValidationMessages = new ArrayList<>(); for (String key : configurationParameters.keySet()) { ConfigDescriptionParameter configDescriptionParameter = map.get(key); if (configDescriptionParameter != null) { // If the parameter supports multiple selection, then it may be provided as an array if (configDescriptionParameter.isMultiple() && configurationParameters.get(key) instanceof List) { // Perform validation on each value in the list separately for (Object value : (List<Object>) configurationParameters.get(key)) { ConfigValidationMessage message = validateParameter(configDescriptionParameter, value); if (message != null) { configDescriptionValidationMessages.add(message); } } } else { ConfigValidationMessage message = validateParameter(configDescriptionParameter, configurationParameters.get(key)); if (message != null) { configDescriptionValidationMessages.add(message); } } } } if (!configDescriptionValidationMessages.isEmpty()) { throw new ConfigValidationException(Activator.getBundleContext().getBundle(), configDescriptionValidationMessages); } }
@SuppressWarnings(STR) static void function(Map<String, Object> configurationParameters, URI configDescriptionURI) { Preconditions.checkNotNull(configurationParameters, STR); Preconditions.checkNotNull(configDescriptionURI, STR); ConfigDescription configDescription = getConfigDescription(configDescriptionURI); if (configDescription == null) { logger.warn(STR, configDescriptionURI); return; } Map<String, ConfigDescriptionParameter> map = configDescription.toParametersMap(); Collection<ConfigValidationMessage> configDescriptionValidationMessages = new ArrayList<>(); for (String key : configurationParameters.keySet()) { ConfigDescriptionParameter configDescriptionParameter = map.get(key); if (configDescriptionParameter != null) { if (configDescriptionParameter.isMultiple() && configurationParameters.get(key) instanceof List) { for (Object value : (List<Object>) configurationParameters.get(key)) { ConfigValidationMessage message = validateParameter(configDescriptionParameter, value); if (message != null) { configDescriptionValidationMessages.add(message); } } } else { ConfigValidationMessage message = validateParameter(configDescriptionParameter, configurationParameters.get(key)); if (message != null) { configDescriptionValidationMessages.add(message); } } } } if (!configDescriptionValidationMessages.isEmpty()) { throw new ConfigValidationException(Activator.getBundleContext().getBundle(), configDescriptionValidationMessages); } }
/** * Validates the given configuration parameters against the given configuration description having the given URI. * * @param configurationParameters the configuration parameters to be validated * @param configDescriptionURI the URI of the configuration description against which the configuration parameters * are to be validated * * @throws ConfigValidationException if one or more configuration parameters do not match with the configuration * description having the given URI * @throws NullPointerException if given config description URI or configuration parameters are null */
Validates the given configuration parameters against the given configuration description having the given URI
validate
{ "repo_name": "marinmitev/smarthome", "path": "bundles/config/org.eclipse.smarthome.config.core/src/main/java/org/eclipse/smarthome/config/core/validation/ConfigDescriptionValidator.java", "license": "epl-1.0", "size": 7374 }
[ "com.google.common.base.Preconditions", "java.util.ArrayList", "java.util.Collection", "java.util.List", "java.util.Map", "org.eclipse.smarthome.config.core.ConfigDescription", "org.eclipse.smarthome.config.core.ConfigDescriptionParameter", "org.eclipse.smarthome.config.core.internal.Activator" ]
import com.google.common.base.Preconditions; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import org.eclipse.smarthome.config.core.ConfigDescription; import org.eclipse.smarthome.config.core.ConfigDescriptionParameter; import org.eclipse.smarthome.config.core.internal.Activator;
import com.google.common.base.*; import java.util.*; import org.eclipse.smarthome.config.core.*; import org.eclipse.smarthome.config.core.internal.*;
[ "com.google.common", "java.util", "org.eclipse.smarthome" ]
com.google.common; java.util; org.eclipse.smarthome;
1,594,299
@POST @Path("{organizationId}/applications/{applicationId}/versions") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public ApplicationVersionBean createAppVersion(@PathParam("organizationId") String organizationId, @PathParam("applicationId") String applicationId, NewApplicationVersionBean bean) throws ApplicationNotFoundException, NotAuthorizedException, InvalidVersionException, ApplicationVersionAlreadyExistsException;
@Path(STR) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) ApplicationVersionBean function(@PathParam(STR) String organizationId, @PathParam(STR) String applicationId, NewApplicationVersionBean bean) throws ApplicationNotFoundException, NotAuthorizedException, InvalidVersionException, ApplicationVersionAlreadyExistsException;
/** * Use this endpoint to create a new version of the Application. * @summary Create Application Version * @param organizationId The Organization ID. * @param applicationId The Application ID. * @param bean Initial information about the new Application version. * @statuscode 200 If the Application version is created successfully. * @statuscode 404 If the Application does not exist. * @statuscode 409 If the Application version already exists. * @return Full details about the newly created Application version. * @throws ApplicationNotFoundException when trying to get, update, or delete an application that does not exist * @throws NotAuthorizedException when the user attempts to do or see something that they are not authorized (do not have permission) to * @throws InvalidVersionException when the user attempts to use an invalid version value */
Use this endpoint to create a new version of the Application
createAppVersion
{ "repo_name": "kunallimaye/apiman", "path": "manager/api/rest/src/main/java/io/apiman/manager/api/rest/contract/IOrganizationResource.java", "license": "apache-2.0", "size": 111368 }
[ "io.apiman.manager.api.beans.apps.ApplicationVersionBean", "io.apiman.manager.api.beans.apps.NewApplicationVersionBean", "io.apiman.manager.api.rest.contract.exceptions.ApplicationNotFoundException", "io.apiman.manager.api.rest.contract.exceptions.ApplicationVersionAlreadyExistsException", "io.apiman.manager.api.rest.contract.exceptions.InvalidVersionException", "io.apiman.manager.api.rest.contract.exceptions.NotAuthorizedException", "javax.ws.rs.Consumes", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.Produces", "javax.ws.rs.core.MediaType" ]
import io.apiman.manager.api.beans.apps.ApplicationVersionBean; import io.apiman.manager.api.beans.apps.NewApplicationVersionBean; import io.apiman.manager.api.rest.contract.exceptions.ApplicationNotFoundException; import io.apiman.manager.api.rest.contract.exceptions.ApplicationVersionAlreadyExistsException; import io.apiman.manager.api.rest.contract.exceptions.InvalidVersionException; import io.apiman.manager.api.rest.contract.exceptions.NotAuthorizedException; import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType;
import io.apiman.manager.api.beans.apps.*; import io.apiman.manager.api.rest.contract.exceptions.*; import javax.ws.rs.*; import javax.ws.rs.core.*;
[ "io.apiman.manager", "javax.ws" ]
io.apiman.manager; javax.ws;
820,408
protected void sequence_PrimaryExpression(EObject context, PrimaryExpression semanticObject) { if(errorAcceptor != null) { if(transientValues.isValueTransient(semanticObject, FractalIDLPackage.Literals.PRIMARY_EXPRESSION__LITERAL) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, FractalIDLPackage.Literals.PRIMARY_EXPRESSION__LITERAL)); } INodesForEObjectProvider nodes = createNodeProvider(semanticObject); SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes); feeder.accept(grammarAccess.getPrimaryExpressionAccess().getLiteralLiteralParserRuleCall_0_0(), semanticObject.getLiteral()); feeder.finish(); }
void function(EObject context, PrimaryExpression semanticObject) { if(errorAcceptor != null) { if(transientValues.isValueTransient(semanticObject, FractalIDLPackage.Literals.PRIMARY_EXPRESSION__LITERAL) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, FractalIDLPackage.Literals.PRIMARY_EXPRESSION__LITERAL)); } INodesForEObjectProvider nodes = createNodeProvider(semanticObject); SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes); feeder.accept(grammarAccess.getPrimaryExpressionAccess().getLiteralLiteralParserRuleCall_0_0(), semanticObject.getLiteral()); feeder.finish(); }
/** * Constraint: * literal=Literal */
Constraint: literal=Literal
sequence_PrimaryExpression
{ "repo_name": "StephaneSeyvoz/mindEd", "path": "org.ow2.mindEd.itf.editor.textual.model/src-gen/org/ow2/mindEd/itf/editor/textual/serializer/FractalItfSemanticSequencer.java", "license": "lgpl-3.0", "size": 26338 }
[ "org.eclipse.emf.ecore.EObject", "org.eclipse.xtext.serializer.acceptor.SequenceFeeder", "org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider", "org.eclipse.xtext.serializer.sequencer.ITransientValueService", "org.ow2.mindEd.itf.editor.textual.fractalIDL.FractalIDLPackage", "org.ow2.mindEd.itf.editor.textual.fractalIDL.PrimaryExpression" ]
import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.serializer.acceptor.SequenceFeeder; import org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider; import org.eclipse.xtext.serializer.sequencer.ITransientValueService; import org.ow2.mindEd.itf.editor.textual.fractalIDL.FractalIDLPackage; import org.ow2.mindEd.itf.editor.textual.fractalIDL.PrimaryExpression;
import org.eclipse.emf.ecore.*; import org.eclipse.xtext.serializer.acceptor.*; import org.eclipse.xtext.serializer.sequencer.*; import org.ow2.*;
[ "org.eclipse.emf", "org.eclipse.xtext", "org.ow2" ]
org.eclipse.emf; org.eclipse.xtext; org.ow2;
480,655
private static boolean isRunnerClass(Class<?> type) { return Stream.of(type.getDeclaredFields()).anyMatch(field -> TestRunner.class.isAssignableFrom(field.getType())); }
static boolean function(Class<?> type) { return Stream.of(type.getDeclaredFields()).anyMatch(field -> TestRunner.class.isAssignableFrom(field.getType())); }
/** * Searches for field of type test runner. * @param type * @return */
Searches for field of type test runner
isRunnerClass
{ "repo_name": "christophd/citrus", "path": "vintage/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/junit/jupiter/CitrusExtension.java", "license": "apache-2.0", "size": 14101 }
[ "com.consol.citrus.dsl.runner.TestRunner", "java.util.stream.Stream" ]
import com.consol.citrus.dsl.runner.TestRunner; import java.util.stream.Stream;
import com.consol.citrus.dsl.runner.*; import java.util.stream.*;
[ "com.consol.citrus", "java.util" ]
com.consol.citrus; java.util;
461,753
@Override public T visitBasicForStatement(@NotNull Java8Parser.BasicForStatementContext ctx) { return visitChildren(ctx); }
@Override public T visitBasicForStatement(@NotNull Java8Parser.BasicForStatementContext ctx) { return visitChildren(ctx); }
/** * {@inheritDoc} * * <p>The default implementation returns the result of calling * {@link #visitChildren} on {@code ctx}.</p> */
The default implementation returns the result of calling <code>#visitChildren</code> on ctx
visitLeftHandSide
{ "repo_name": "IsThisThePayneResidence/intellidots", "path": "src/main/java/ua/edu/hneu/ast/parsers/Java8BaseVisitor.java", "license": "gpl-3.0", "size": 65479 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
1,462,816
@Test public void testDmlWrongColumnName() throws SQLException { checkSqlErrorMessage("insert into test (id, wrong) values (3, 'val3')", "42000", "Failed to parse query. Column \"WRONG\" not found"); checkSqlErrorMessage("merge into test (id, wrong) values (3, 'val3')", "42000", "Failed to parse query. Column \"WRONG\" not found"); checkSqlErrorMessage("update test set wrong = 'val3' where id = 2", "42000", "Failed to parse query. Column \"WRONG\" not found"); checkSqlErrorMessage("delete from test where wrong = 2", "42000", "Failed to parse query. Column \"WRONG\" not found"); }
void function() throws SQLException { checkSqlErrorMessage(STR, "42000", STRWRONG\STR); checkSqlErrorMessage(STR, "42000", STRWRONG\STR); checkSqlErrorMessage(STR, "42000", STRWRONG\STR); checkSqlErrorMessage(STR, "42000", STRWRONG\STR); }
/** * Checks wrong column name DML error message. * * @throws SQLException If failed. */
Checks wrong column name DML error message
testDmlWrongColumnName
{ "repo_name": "samaitra/ignite", "path": "modules/clients/src/test/java/org/apache/ignite/jdbc/JdbcErrorsAbstractSelfTest.java", "license": "apache-2.0", "size": 33185 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,895,008
@Override public int fill(Buffer buffer) throws IOException { _debug=LOG.isDebugEnabled(); LOG.debug("{} fill",_session); // This end point only works on NIO buffer type (director // or indirect), so extract the NIO buffer that is wrapped // by the passed jetty Buffer. ByteBuffer bbuf=((NIOBuffer)buffer).getByteBuffer(); // remember the original size of the unencrypted buffer int size=buffer.length(); synchronized (bbuf) { bbuf.position(buffer.putIndex()); try { // Call the SSLEngine unwrap method to process data in // the inBuffer. If there is no data in the inBuffer, then // super.fill is called to read encrypted bytes. unwrap(bbuf); process(bbuf,null); } finally { // reset the Buffers buffer.setPutIndex(bbuf.position()); bbuf.position(0); } } // return the number of unencrypted bytes filled. int filled=buffer.length()-size; if (filled==0 && (isInputShutdown() || !isOpen())) return -1; return filled; }
int function(Buffer buffer) throws IOException { _debug=LOG.isDebugEnabled(); LOG.debug(STR,_session); ByteBuffer bbuf=((NIOBuffer)buffer).getByteBuffer(); int size=buffer.length(); synchronized (bbuf) { bbuf.position(buffer.putIndex()); try { unwrap(bbuf); process(bbuf,null); } finally { buffer.setPutIndex(bbuf.position()); bbuf.position(0); } } int filled=buffer.length()-size; if (filled==0 && (isInputShutdown() !isOpen())) return -1; return filled; }
/** Fill the buffer with unencrypted bytes. * Called by a Http Parser when more data is * needed to continue parsing a request or a response. */
Fill the buffer with unencrypted bytes. Called by a Http Parser when more data is needed to continue parsing a request or a response
fill
{ "repo_name": "leoleegit/jetty-8.0.4.v20111024", "path": "jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslSelectChannelEndPoint.java", "license": "apache-2.0", "size": 24314 }
[ "java.io.IOException", "java.nio.ByteBuffer", "org.eclipse.jetty.io.Buffer" ]
import java.io.IOException; import java.nio.ByteBuffer; import org.eclipse.jetty.io.Buffer;
import java.io.*; import java.nio.*; import org.eclipse.jetty.io.*;
[ "java.io", "java.nio", "org.eclipse.jetty" ]
java.io; java.nio; org.eclipse.jetty;
2,101,802
@SuppressWarnings("unchecked") protected JSONObject permissionsToJSON(final NodeRef nodeRef) { final JSONObject permissionsJSON = new JSONObject(); if (AccessStatus.ALLOWED.equals(permissionService.hasPermission(nodeRef, PermissionService.READ_PERMISSIONS)) == true) { permissionsJSON.put("inherited", permissionService.getInheritParentPermissions(nodeRef)); permissionsJSON.put("roles", allSetPermissionsToJSON(nodeRef)); permissionsJSON.put("user", userPermissionsToJSON(nodeRef)); } return permissionsJSON; }
@SuppressWarnings(STR) JSONObject function(final NodeRef nodeRef) { final JSONObject permissionsJSON = new JSONObject(); if (AccessStatus.ALLOWED.equals(permissionService.hasPermission(nodeRef, PermissionService.READ_PERMISSIONS)) == true) { permissionsJSON.put(STR, permissionService.getInheritParentPermissions(nodeRef)); permissionsJSON.put("roles", allSetPermissionsToJSON(nodeRef)); permissionsJSON.put("user", userPermissionsToJSON(nodeRef)); } return permissionsJSON; }
/** * Handles the work of converting node permissions to JSON. * * @param nodeRef NodeRef * @return JSONObject */
Handles the work of converting node permissions to JSON
permissionsToJSON
{ "repo_name": "Tybion/community-edition", "path": "projects/repository/source/java/org/alfresco/repo/jscript/app/JSONConversionComponent.java", "license": "lgpl-3.0", "size": 17817 }
[ "org.alfresco.service.cmr.repository.NodeRef", "org.alfresco.service.cmr.security.AccessStatus", "org.alfresco.service.cmr.security.PermissionService", "org.json.simple.JSONObject" ]
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.security.AccessStatus; import org.alfresco.service.cmr.security.PermissionService; import org.json.simple.JSONObject;
import org.alfresco.service.cmr.repository.*; import org.alfresco.service.cmr.security.*; import org.json.simple.*;
[ "org.alfresco.service", "org.json.simple" ]
org.alfresco.service; org.json.simple;
2,321,551
public FinderReturn findByLogPickupScheduleLikeFR(LogPickupSchedule logPickupSchedule, JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults);
FinderReturn function(LogPickupSchedule logPickupSchedule, JPQLAdvancedQueryCriteria criteria, int firstResult, int maxResults);
/** * findByLogPickupSchedule>LikeFR - finds a list of LogPickupSchedule> Like with a finder return object * * @param logPickupSchedule * @return the list of LogPickupSchedule found */
findByLogPickupSchedule>LikeFR - finds a list of LogPickupSchedule> Like with a finder return object
findByLogPickupScheduleLikeFR
{ "repo_name": "yauritux/venice-legacy", "path": "Venice/Venice-Interface-Model/src/main/java/com/gdn/venice/facade/LogPickupScheduleSessionEJBRemote.java", "license": "apache-2.0", "size": 2718 }
[ "com.djarum.raf.utilities.JPQLAdvancedQueryCriteria", "com.gdn.venice.facade.finder.FinderReturn", "com.gdn.venice.persistence.LogPickupSchedule" ]
import com.djarum.raf.utilities.JPQLAdvancedQueryCriteria; import com.gdn.venice.facade.finder.FinderReturn; import com.gdn.venice.persistence.LogPickupSchedule;
import com.djarum.raf.utilities.*; import com.gdn.venice.facade.finder.*; import com.gdn.venice.persistence.*;
[ "com.djarum.raf", "com.gdn.venice" ]
com.djarum.raf; com.gdn.venice;
2,163,504
protected Set<Event> handleAuthenticationTransactionAndGrantTicketGrantingTicket(final RequestContext context) { try { final Credential credential = getCredentialFromContext(context); AuthenticationResultBuilder builder = WebUtils.getAuthenticationResultBuilder(context); LOGGER.debug("Handling authentication transaction for credential [{}]", credential); builder = this.authenticationSystemSupport.handleAuthenticationTransaction(builder, credential); final Service service = WebUtils.getService(context); LOGGER.debug("Issuing ticket-granting tickets for service [{}]", service); return Collections.singleton(grantTicketGrantingTicketToAuthenticationResult(context, builder, service)); } catch (final Exception e) { LOGGER.error(e.getMessage(), e); final MessageContext messageContext = context.getMessageContext(); messageContext.addMessage(new MessageBuilder().error() .code(DEFAULT_MESSAGE_BUNDLE_PREFIX.concat(e.getClass().getSimpleName())).build()); return Collections.singleton(new Event(this, "error")); } }
Set<Event> function(final RequestContext context) { try { final Credential credential = getCredentialFromContext(context); AuthenticationResultBuilder builder = WebUtils.getAuthenticationResultBuilder(context); LOGGER.debug(STR, credential); builder = this.authenticationSystemSupport.handleAuthenticationTransaction(builder, credential); final Service service = WebUtils.getService(context); LOGGER.debug(STR, service); return Collections.singleton(grantTicketGrantingTicketToAuthenticationResult(context, builder, service)); } catch (final Exception e) { LOGGER.error(e.getMessage(), e); final MessageContext messageContext = context.getMessageContext(); messageContext.addMessage(new MessageBuilder().error() .code(DEFAULT_MESSAGE_BUNDLE_PREFIX.concat(e.getClass().getSimpleName())).build()); return Collections.singleton(new Event(this, "error")); } }
/** * Handle authentication transaction and grant ticket granting ticket set. * * @param context the context * @return the set */
Handle authentication transaction and grant ticket granting ticket set
handleAuthenticationTransactionAndGrantTicketGrantingTicket
{ "repo_name": "gabedwrds/cas", "path": "core/cas-server-core-webflow/src/main/java/org/apereo/cas/web/flow/resolver/impl/AbstractCasWebflowEventResolver.java", "license": "apache-2.0", "size": 26601 }
[ "java.util.Collections", "java.util.Set", "org.apereo.cas.authentication.AuthenticationResultBuilder", "org.apereo.cas.authentication.Credential", "org.apereo.cas.authentication.principal.Service", "org.apereo.cas.web.support.WebUtils", "org.springframework.binding.message.MessageBuilder", "org.springframework.binding.message.MessageContext", "org.springframework.webflow.execution.Event", "org.springframework.webflow.execution.RequestContext" ]
import java.util.Collections; import java.util.Set; import org.apereo.cas.authentication.AuthenticationResultBuilder; import org.apereo.cas.authentication.Credential; import org.apereo.cas.authentication.principal.Service; import org.apereo.cas.web.support.WebUtils; import org.springframework.binding.message.MessageBuilder; import org.springframework.binding.message.MessageContext; import org.springframework.webflow.execution.Event; import org.springframework.webflow.execution.RequestContext;
import java.util.*; import org.apereo.cas.authentication.*; import org.apereo.cas.authentication.principal.*; import org.apereo.cas.web.support.*; import org.springframework.binding.message.*; import org.springframework.webflow.execution.*;
[ "java.util", "org.apereo.cas", "org.springframework.binding", "org.springframework.webflow" ]
java.util; org.apereo.cas; org.springframework.binding; org.springframework.webflow;
1,543,014
public static <E> MutableList<E> concat( MutableList<? extends E> left, MutableList<? extends E> right, Environment env) { if (left.getGlobList() == null && right.getGlobList() == null) { return new MutableList(Iterables.concat(left, right), env); } return new MutableList(GlobList.concat( left.getGlobListOrContentsUnsafe(), right.getGlobListOrContentsUnsafe()), env); }
static <E> MutableList<E> function( MutableList<? extends E> left, MutableList<? extends E> right, Environment env) { if (left.getGlobList() == null && right.getGlobList() == null) { return new MutableList(Iterables.concat(left, right), env); } return new MutableList(GlobList.concat( left.getGlobListOrContentsUnsafe(), right.getGlobListOrContentsUnsafe()), env); }
/** * Concatenate two MutableList * @param left the start of the new list * @param right the end of the new list * @param env the Environment in which to create a new list * @return a new MutableList */
Concatenate two MutableList
concat
{ "repo_name": "mikelalcon/bazel", "path": "src/main/java/com/google/devtools/build/lib/syntax/SkylarkList.java", "license": "apache-2.0", "size": 17249 }
[ "com.google.common.collect.Iterables" ]
import com.google.common.collect.Iterables;
import com.google.common.collect.*;
[ "com.google.common" ]
com.google.common;
766,992
private Class<?>[] resolve(Element e, Class<?> defaultType) { // The class field holding the name of the type holding property. Class<?> typeHoldingTypeField = getTypeRegistry().getTypeHoldingTypeField(defaultType); if (typeHoldingTypeField != null) { // Name of the graph element property holding the type list. String propName = typeHoldingTypeField.getAnnotation(TypeField.class).value(); StandardVertex v = GraphTypeManager.asTitanVertex(e); Iterable<TitanProperty> valuesAll = v.getProperties(propName); if (valuesAll != null) { List<Class<?>> resultClasses = new ArrayList<>(); for (TitanProperty value : valuesAll) { Class<?> type = getTypeRegistry().getType(typeHoldingTypeField, value.getValue().toString()); if (type != null) { // first check that no subclasses have already been added ListIterator<Class<?>> previouslyAddedIterator = resultClasses.listIterator(); boolean shouldAdd = true; while (previouslyAddedIterator.hasNext()) { Class<?> previouslyAdded = previouslyAddedIterator.next(); if (previouslyAdded.isAssignableFrom(type)) { // Remove the previously added superclass previouslyAddedIterator.remove(); } else if (type.isAssignableFrom(previouslyAdded)) { // The current type is a superclass of a previously added type, don't add it shouldAdd = false; } } if (shouldAdd) { resultClasses.add(type); } } } if (!resultClasses.isEmpty()) { resultClasses.add(VertexFrame.class); return resultClasses.toArray(new Class<?>[resultClasses.size()]); } } } return new Class[] { defaultType, VertexFrame.class }; }
Class<?>[] function(Element e, Class<?> defaultType) { Class<?> typeHoldingTypeField = getTypeRegistry().getTypeHoldingTypeField(defaultType); if (typeHoldingTypeField != null) { String propName = typeHoldingTypeField.getAnnotation(TypeField.class).value(); StandardVertex v = GraphTypeManager.asTitanVertex(e); Iterable<TitanProperty> valuesAll = v.getProperties(propName); if (valuesAll != null) { List<Class<?>> resultClasses = new ArrayList<>(); for (TitanProperty value : valuesAll) { Class<?> type = getTypeRegistry().getType(typeHoldingTypeField, value.getValue().toString()); if (type != null) { ListIterator<Class<?>> previouslyAddedIterator = resultClasses.listIterator(); boolean shouldAdd = true; while (previouslyAddedIterator.hasNext()) { Class<?> previouslyAdded = previouslyAddedIterator.next(); if (previouslyAdded.isAssignableFrom(type)) { previouslyAddedIterator.remove(); } else if (type.isAssignableFrom(previouslyAdded)) { shouldAdd = false; } } if (shouldAdd) { resultClasses.add(type); } } } if (!resultClasses.isEmpty()) { resultClasses.add(VertexFrame.class); return resultClasses.toArray(new Class<?>[resultClasses.size()]); } } } return new Class[] { defaultType, VertexFrame.class }; }
/** * Returns the classes which this vertex/edge represents, typically subclasses. This will only return the lowest level subclasses (no superclasses * of types in the type list will be returned). This prevents Annotation resolution issues between superclasses and subclasses (see also: * WINDUP-168). */
Returns the classes which this vertex/edge represents, typically subclasses. This will only return the lowest level subclasses (no superclasses of types in the type list will be returned). This prevents Annotation resolution issues between superclasses and subclasses (see also: WINDUP-168)
resolve
{ "repo_name": "mbriskar/windup", "path": "graph/api/src/main/java/org/jboss/windup/graph/GraphTypeManager.java", "license": "epl-1.0", "size": 11729 }
[ "com.thinkaurelius.titan.core.TitanProperty", "com.thinkaurelius.titan.graphdb.vertices.StandardVertex", "com.tinkerpop.blueprints.Element", "com.tinkerpop.frames.VertexFrame", "com.tinkerpop.frames.modules.typedgraph.TypeField", "java.util.ArrayList", "java.util.List", "java.util.ListIterator" ]
import com.thinkaurelius.titan.core.TitanProperty; import com.thinkaurelius.titan.graphdb.vertices.StandardVertex; import com.tinkerpop.blueprints.Element; import com.tinkerpop.frames.VertexFrame; import com.tinkerpop.frames.modules.typedgraph.TypeField; import java.util.ArrayList; import java.util.List; import java.util.ListIterator;
import com.thinkaurelius.titan.core.*; import com.thinkaurelius.titan.graphdb.vertices.*; import com.tinkerpop.blueprints.*; import com.tinkerpop.frames.*; import com.tinkerpop.frames.modules.typedgraph.*; import java.util.*;
[ "com.thinkaurelius.titan", "com.tinkerpop.blueprints", "com.tinkerpop.frames", "java.util" ]
com.thinkaurelius.titan; com.tinkerpop.blueprints; com.tinkerpop.frames; java.util;
1,857,387
public static void addHttp2ToHttpHeaders(int streamId, Http2Headers inputHeaders, HttpHeaders outputHeaders, HttpVersion httpVersion, boolean isTrailer, boolean isRequest) throws Http2Exception { Http2ToHttpHeaderTranslator translator = new Http2ToHttpHeaderTranslator(streamId, outputHeaders, isRequest); try { for (Entry<ByteString, ByteString> entry : inputHeaders) { translator.translate(entry); } } catch (Http2Exception ex) { throw ex; } catch (Throwable t) { throw streamError(streamId, PROTOCOL_ERROR, t, "HTTP/2 to HTTP/1.x headers conversion error"); } outputHeaders.remove(HttpHeaderNames.TRANSFER_ENCODING); outputHeaders.remove(HttpHeaderNames.TRAILER); if (!isTrailer) { outputHeaders.setInt(ExtensionHeaderNames.STREAM_ID.text(), streamId); HttpUtil.setKeepAlive(outputHeaders, httpVersion, true); } }
static void function(int streamId, Http2Headers inputHeaders, HttpHeaders outputHeaders, HttpVersion httpVersion, boolean isTrailer, boolean isRequest) throws Http2Exception { Http2ToHttpHeaderTranslator translator = new Http2ToHttpHeaderTranslator(streamId, outputHeaders, isRequest); try { for (Entry<ByteString, ByteString> entry : inputHeaders) { translator.translate(entry); } } catch (Http2Exception ex) { throw ex; } catch (Throwable t) { throw streamError(streamId, PROTOCOL_ERROR, t, STR); } outputHeaders.remove(HttpHeaderNames.TRANSFER_ENCODING); outputHeaders.remove(HttpHeaderNames.TRAILER); if (!isTrailer) { outputHeaders.setInt(ExtensionHeaderNames.STREAM_ID.text(), streamId); HttpUtil.setKeepAlive(outputHeaders, httpVersion, true); } }
/** * Translate and add HTTP/2 headers to HTTP/1.x headers. * * @param streamId The stream associated with {@code sourceHeaders}. * @param inputHeaders The HTTP/2 headers to convert. * @param outputHeaders The object which will contain the resulting HTTP/1.x headers.. * @param httpVersion What HTTP/1.x version {@code outputHeaders} should be treated as when doing the conversion. * @param isTrailer {@code true} if {@code outputHeaders} should be treated as trailing headers. * {@code false} otherwise. * @param isReqeust {@code true} if the {@code outputHeaders} will be used in a request message. * {@code false} for response message. * @throws Http2Exception If not all HTTP/2 headers can be translated to HTTP/1.x. */
Translate and add HTTP/2 headers to HTTP/1.x headers
addHttp2ToHttpHeaders
{ "repo_name": "huuthang1993/netty", "path": "codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java", "license": "apache-2.0", "size": 22051 }
[ "io.netty.handler.codec.http.HttpHeaderNames", "io.netty.handler.codec.http.HttpHeaders", "io.netty.handler.codec.http.HttpUtil", "io.netty.handler.codec.http.HttpVersion", "io.netty.handler.codec.http2.Http2Exception", "io.netty.util.ByteString", "java.util.Map" ]
import io.netty.handler.codec.http.HttpHeaderNames; import io.netty.handler.codec.http.HttpHeaders; import io.netty.handler.codec.http.HttpUtil; import io.netty.handler.codec.http.HttpVersion; import io.netty.handler.codec.http2.Http2Exception; import io.netty.util.ByteString; import java.util.Map;
import io.netty.handler.codec.http.*; import io.netty.handler.codec.http2.*; import io.netty.util.*; import java.util.*;
[ "io.netty.handler", "io.netty.util", "java.util" ]
io.netty.handler; io.netty.util; java.util;
783,342
private QueryCursorImpl<List<?>> executeSelectForDml( String schema, SqlFieldsQuery selectQry, MvccQueryTracker mvccTracker, GridQueryCancel cancel, int timeout ) throws IgniteCheckedException { QueryParserResult parseRes = parser.parse(schema, selectQry, false); QueryParserResultSelect select = parseRes.select(); assert select != null; Iterable<List<?>> iter = executeSelect0( parseRes.queryDescriptor(), parseRes.queryParameters(), select, true, mvccTracker, cancel, false, timeout ); QueryCursorImpl<List<?>> cursor = new QueryCursorImpl<>(iter, cancel, true, parseRes.queryParameters().lazy()); cursor.fieldsMeta(select.meta()); cursor.partitionResult(select.twoStepQuery() != null ? select.twoStepQuery().derivedPartitions() : null); return cursor; }
QueryCursorImpl<List<?>> function( String schema, SqlFieldsQuery selectQry, MvccQueryTracker mvccTracker, GridQueryCancel cancel, int timeout ) throws IgniteCheckedException { QueryParserResult parseRes = parser.parse(schema, selectQry, false); QueryParserResultSelect select = parseRes.select(); assert select != null; Iterable<List<?>> iter = executeSelect0( parseRes.queryDescriptor(), parseRes.queryParameters(), select, true, mvccTracker, cancel, false, timeout ); QueryCursorImpl<List<?>> cursor = new QueryCursorImpl<>(iter, cancel, true, parseRes.queryParameters().lazy()); cursor.fieldsMeta(select.meta()); cursor.partitionResult(select.twoStepQuery() != null ? select.twoStepQuery().derivedPartitions() : null); return cursor; }
/** * Execute SELECT statement for DML. * * @param schema Schema. * @param selectQry Select query. * @param mvccTracker MVCC tracker. * @param cancel Cancel. * @param timeout Timeout. * @return Fields query. * @throws IgniteCheckedException On error. */
Execute SELECT statement for DML
executeSelectForDml
{ "repo_name": "nizhikov/ignite", "path": "modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java", "license": "apache-2.0", "size": 112571 }
[ "java.util.List", "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.cache.query.SqlFieldsQuery", "org.apache.ignite.internal.processors.cache.QueryCursorImpl", "org.apache.ignite.internal.processors.cache.mvcc.MvccQueryTracker", "org.apache.ignite.internal.processors.query.GridQueryCancel" ]
import java.util.List; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.processors.cache.QueryCursorImpl; import org.apache.ignite.internal.processors.cache.mvcc.MvccQueryTracker; import org.apache.ignite.internal.processors.query.GridQueryCancel;
import java.util.*; import org.apache.ignite.*; import org.apache.ignite.cache.query.*; import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.processors.cache.mvcc.*; import org.apache.ignite.internal.processors.query.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
582,019
void onCanceled(@NotNull ProgressIndicator indicator);
void onCanceled(@NotNull ProgressIndicator indicator);
/** * Is invoked on the background computation thread whenever the computation is canceled by a write action. * A likely implementation is to restart the computation, maybe based on the new state of the system. */
Is invoked on the background computation thread whenever the computation is canceled by a write action. A likely implementation is to restart the computation, maybe based on the new state of the system
onCanceled
{ "repo_name": "ernestp/consulo", "path": "platform/platform-impl/src/com/intellij/openapi/progress/util/ReadTask.java", "license": "apache-2.0", "size": 1616 }
[ "com.intellij.openapi.progress.ProgressIndicator", "org.jetbrains.annotations.NotNull" ]
import com.intellij.openapi.progress.ProgressIndicator; import org.jetbrains.annotations.NotNull;
import com.intellij.openapi.progress.*; import org.jetbrains.annotations.*;
[ "com.intellij.openapi", "org.jetbrains.annotations" ]
com.intellij.openapi; org.jetbrains.annotations;
1,293,152
public void setEngineProcessManager(final EngineProcessManagerBean injEngineManager) { engineManager = injEngineManager; } private transient ReportManagerBean reportManager;
void function(final EngineProcessManagerBean injEngineManager) { engineManager = injEngineManager; } private transient ReportManagerBean reportManager;
/** * Setter method used by spring to inject a EngineProcessManagerBean bean. * * @param injEngineManager a EngineProcessManagerBean bean. */
Setter method used by spring to inject a EngineProcessManagerBean bean
setEngineProcessManager
{ "repo_name": "EaW1805/www", "path": "src/main/java/com/eaw1805/www/controllers/game/ShowGameInfo.java", "license": "mit", "size": 37246 }
[ "com.eaw1805.data.managers.beans.EngineProcessManagerBean", "com.eaw1805.data.managers.beans.ReportManagerBean" ]
import com.eaw1805.data.managers.beans.EngineProcessManagerBean; import com.eaw1805.data.managers.beans.ReportManagerBean;
import com.eaw1805.data.managers.beans.*;
[ "com.eaw1805.data" ]
com.eaw1805.data;
867,959
public SafetyReportingEnterpriseServiceResource getAddressedResource() throws Exception { SafetyReportingEnterpriseServiceResource thisResource; thisResource = (SafetyReportingEnterpriseServiceResource) ResourceContext.getResourceContext().getResource(); return thisResource; }
SafetyReportingEnterpriseServiceResource function() throws Exception { SafetyReportingEnterpriseServiceResource thisResource; thisResource = (SafetyReportingEnterpriseServiceResource) ResourceContext.getResourceContext().getResource(); return thisResource; }
/** * Get the resouce that is being addressed in this current context */
Get the resouce that is being addressed in this current context
getAddressedResource
{ "repo_name": "CBIIT/caaers", "path": "caAERS/software/grid/introduce/SafetyReportingEnterpriseService/src/gov/nih/nci/ess/safetyreporting/service/globus/resource/SafetyReportingEnterpriseServiceResourceHome.java", "license": "bsd-3-clause", "size": 3722 }
[ "org.globus.wsrf.ResourceContext" ]
import org.globus.wsrf.ResourceContext;
import org.globus.wsrf.*;
[ "org.globus.wsrf" ]
org.globus.wsrf;
862,869
commentMetadata.put("formatting", new FormattedComment(commentMetadata)); } public static class FormattedComment { private final String bodyWithHighlightedText; private final String competingInterestStatement; public FormattedComment(Map<String, ?> comment) { this.bodyWithHighlightedText = buildBodyWithHighlightedText(comment); this.competingInterestStatement = buildCompetingInterestStatement(comment); }
commentMetadata.put(STR, new FormattedComment(commentMetadata)); } public static class FormattedComment { private final String bodyWithHighlightedText; private final String competingInterestStatement; public FormattedComment(Map<String, ?> comment) { this.bodyWithHighlightedText = buildBodyWithHighlightedText(comment); this.competingInterestStatement = buildCompetingInterestStatement(comment); }
/** * Add a new map, keyed {@code "formatting"} and containing a {@link FormattedComment} object, to the comment. */
Add a new map, keyed "formatting" and containing a <code>FormattedComment</code> object, to the comment
addFormattingFields
{ "repo_name": "PLOS/wombat", "path": "src/main/java/org/ambraproject/wombat/service/CommentFormatting.java", "license": "mit", "size": 31087 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,079,158
public void setLastDdPacket(DdPacket lastDdPacket) { this.lastDdPacket = lastDdPacket; }
void function(DdPacket lastDdPacket) { this.lastDdPacket = lastDdPacket; }
/** * Sets the last sent DdPacket. * * @param lastDdPacket DdPacket instance */
Sets the last sent DdPacket
setLastDdPacket
{ "repo_name": "donNewtonAlpha/onos", "path": "protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/impl/OspfNbrImpl.java", "license": "apache-2.0", "size": 75644 }
[ "org.onosproject.ospf.protocol.ospfpacket.types.DdPacket" ]
import org.onosproject.ospf.protocol.ospfpacket.types.DdPacket;
import org.onosproject.ospf.protocol.ospfpacket.types.*;
[ "org.onosproject.ospf" ]
org.onosproject.ospf;
2,302,914
public List<Apprentice> getAllApprentices() { List<Apprentice> apprentices = new ArrayList<Apprentice>(); String query = "SELECT * FROM " + KanjotoDatabaseHelper.TABLE_APPRENTICES; // create database handle SQLiteDatabase db = dbHelper.getWritableDatabase(); // select all notes from database Cursor cursor = db.rawQuery(query, null); Apprentice apprentice = null; if (cursor.moveToFirst()) { do { // create note objects based on note data from database apprentice = new Apprentice(); apprentice.setId(cursor.getLong(0)); apprentice.setName(cursor.getString(1)); apprentice.setLearningStyleId(cursor.getLong(2)); // add note string to list of strings apprentices.add(apprentice); } while (cursor.moveToNext()); } db.close(); return apprentices; }
List<Apprentice> function() { List<Apprentice> apprentices = new ArrayList<Apprentice>(); String query = STR + KanjotoDatabaseHelper.TABLE_APPRENTICES; SQLiteDatabase db = dbHelper.getWritableDatabase(); Cursor cursor = db.rawQuery(query, null); Apprentice apprentice = null; if (cursor.moveToFirst()) { do { apprentice = new Apprentice(); apprentice.setId(cursor.getLong(0)); apprentice.setName(cursor.getString(1)); apprentice.setLearningStyleId(cursor.getLong(2)); apprentices.add(apprentice); } while (cursor.moveToNext()); } db.close(); return apprentices; }
/** * Get all apprentices from database table. * * @return List of Apprentices. */
Get all apprentices from database table
getAllApprentices
{ "repo_name": "datanets/kanjoto", "path": "kanjoto-android/src/summea/kanjoto/data/ApprenticesDataSource.java", "license": "mit", "size": 7603 }
[ "android.database.Cursor", "android.database.sqlite.SQLiteDatabase", "java.util.ArrayList", "java.util.List" ]
import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import java.util.ArrayList; import java.util.List;
import android.database.*; import android.database.sqlite.*; import java.util.*;
[ "android.database", "java.util" ]
android.database; java.util;
1,484,504
public static void stereotypeBusinessSubsystemImport(Package object,BussinesSubsystem krokiObject,ProgressWorker thread){ String stereotypeName=STEREOTYPE_BUSINESS_SUBSYSTEM_NAME; thread.publishText("Checking "+stereotypeName+" stereotype"); thread.addIndentation(); Stereotype stereotypeObject=object.getAppliedStereotype(StereotypeUtil.EUIS_DSL_PROFILE+stereotypeName); if(stereotypeObject!=null) { thread.publishText(stereotypeName+" stereotype applied"); Object value; if((value=getProperty(object, stereotypeObject, "label", thread))!=null) { krokiObject.setLabel((String)value); } if((value=getProperty(object, stereotypeObject, "visible", thread))!=null) { krokiObject.setVisible((boolean)value); }else krokiObject.setVisible(false); } else thread.publishText(stereotypeName+" stereotype not applied"); thread.removeIndentation(1); }
static void function(Package object,BussinesSubsystem krokiObject,ProgressWorker thread){ String stereotypeName=STEREOTYPE_BUSINESS_SUBSYSTEM_NAME; thread.publishText(STR+stereotypeName+STR); thread.addIndentation(); Stereotype stereotypeObject=object.getAppliedStereotype(StereotypeUtil.EUIS_DSL_PROFILE+stereotypeName); if(stereotypeObject!=null) { thread.publishText(stereotypeName+STR); Object value; if((value=getProperty(object, stereotypeObject, "label", thread))!=null) { krokiObject.setLabel((String)value); } if((value=getProperty(object, stereotypeObject, STR, thread))!=null) { krokiObject.setVisible((boolean)value); }else krokiObject.setVisible(false); } else thread.publishText(stereotypeName+STR); thread.removeIndentation(1); }
/** * For a UML Package element retrieves all the property values of the BusinessSubsystem stereotype, if it is applied * to the UML Package element and sets the retrieved values to the corresponding attributes of the * Kroki BussinesSubsystem object. * @param object UML Package element for which to retrieve the property values of the BusinessSubsystem stereotype * @param krokiObject Kroki BussinesSubsystem object for which to set the retrieved values * @param thread background worker thread, implementing the import functionality, used to output messages * of the current progress of the values that are being retrieved */
For a UML Package element retrieves all the property values of the BusinessSubsystem stereotype, if it is applied to the UML Package element and sets the retrieved values to the corresponding attributes of the Kroki BussinesSubsystem object
stereotypeBusinessSubsystemImport
{ "repo_name": "farkas-arpad/KROKI-mockup-tool", "path": "KrokiMockupTool/src/kroki/app/utils/uml/stereotypes/PackageStereotype.java", "license": "mit", "size": 5858 }
[ "org.eclipse.uml2.uml.Package", "org.eclipse.uml2.uml.Stereotype" ]
import org.eclipse.uml2.uml.Package; import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.*;
[ "org.eclipse.uml2" ]
org.eclipse.uml2;
458,314
private VectorClock toVectorClock(List<Entry<String, Long>> replicaLogicalTimestamps) { final VectorClock timestamps = new VectorClock(); for (Entry<String, Long> replicaTimestamp : replicaLogicalTimestamps) { timestamps.setReplicaTimestamp(replicaTimestamp.getKey(), replicaTimestamp.getValue()); } return timestamps; } /** * Adds the {@code delta} and returns the value of the counter before the * update if {@code getBeforeUpdate} is {@code true} or the value after * the update if it is {@code false}. * It will invoke client messages recursively on viable replica addresses * until successful or the list of viable replicas is exhausted. * Replicas with addresses contained in the {@code excludedAddresses} are * skipped. If there are no viable replicas, this method will throw the * {@code lastException} if not {@code null} or a * {@link NoDataMemberInClusterException} if the {@code lastException} is * {@code null}. * * @param delta the delta to add to the counter value, can be negative * @param getBeforeUpdate {@code true} if the operation should return the * counter value before the addition, {@code false} * if it should return the value after the addition * @param excludedAddresses the addresses to exclude when choosing a replica * address, must not be {@code null} * @param lastException the exception thrown from the last invocation of * the {@code request} on a replica, may be {@code null} * @return the result of the request invocation on a replica * @throws NoDataMemberInClusterException if there are no replicas and the * {@code lastException} is {@code null}
VectorClock function(List<Entry<String, Long>> replicaLogicalTimestamps) { final VectorClock timestamps = new VectorClock(); for (Entry<String, Long> replicaTimestamp : replicaLogicalTimestamps) { timestamps.setReplicaTimestamp(replicaTimestamp.getKey(), replicaTimestamp.getValue()); } return timestamps; } /** * Adds the {@code delta} and returns the value of the counter before the * update if {@code getBeforeUpdate} is {@code true} or the value after * the update if it is {@code false}. * It will invoke client messages recursively on viable replica addresses * until successful or the list of viable replicas is exhausted. * Replicas with addresses contained in the {@code excludedAddresses} are * skipped. If there are no viable replicas, this method will throw the * {@code lastException} if not {@code null} or a * {@link NoDataMemberInClusterException} if the {@code lastException} is * {@code null}. * * @param delta the delta to add to the counter value, can be negative * @param getBeforeUpdate {@code true} if the operation should return the * counter value before the addition, {@code false} * if it should return the value after the addition * @param excludedAddresses the addresses to exclude when choosing a replica * address, must not be {@code null} * @param lastException the exception thrown from the last invocation of * the {@code request} on a replica, may be {@code null} * @return the result of the request invocation on a replica * @throws NoDataMemberInClusterException if there are no replicas and the * {@code lastException} is {@code null}
/** * Transforms the list of replica logical timestamps to a vector clock instance. * * @param replicaLogicalTimestamps the logical timestamps * @return a vector clock instance */
Transforms the list of replica logical timestamps to a vector clock instance
toVectorClock
{ "repo_name": "Donnerbart/hazelcast", "path": "hazelcast-client/src/main/java/com/hazelcast/client/proxy/ClientPNCounterProxy.java", "license": "apache-2.0", "size": 20989 }
[ "com.hazelcast.cluster.impl.VectorClock", "com.hazelcast.partition.NoDataMemberInClusterException", "java.util.List", "java.util.Map" ]
import com.hazelcast.cluster.impl.VectorClock; import com.hazelcast.partition.NoDataMemberInClusterException; import java.util.List; import java.util.Map;
import com.hazelcast.cluster.impl.*; import com.hazelcast.partition.*; import java.util.*;
[ "com.hazelcast.cluster", "com.hazelcast.partition", "java.util" ]
com.hazelcast.cluster; com.hazelcast.partition; java.util;
11,042
private void doDrawing(Graphics g) { Graphics2D g2d = (Graphics2D)g; // Enable antialias g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // Draws differend images depending on the drawing mode. switch (drawingMode){ case 0: // No drawing at alltogether. break; // Draw starting image. case 1: drawImage(g2d, imageToEncryptDecrypt); break; // Draw encrypted/decrypted image. case 2: drawImage(g2d, encryptedDecryptedImage); break; // Draw (animation) current frame. case 3: drawImage(g2d, frames[currFrame]); break; } }
void function(Graphics g) { Graphics2D g2d = (Graphics2D)g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); switch (drawingMode){ case 0: break; case 1: drawImage(g2d, imageToEncryptDecrypt); break; case 2: drawImage(g2d, encryptedDecryptedImage); break; case 3: drawImage(g2d, frames[currFrame]); break; } }
/** * Execute drawing. * @param g Graphics */
Execute drawing
doDrawing
{ "repo_name": "asmailov/IMG_Encryption", "path": "src/GUI/DrawPanel.java", "license": "mit", "size": 15549 }
[ "java.awt.Graphics", "java.awt.Graphics2D", "java.awt.RenderingHints" ]
import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints;
import java.awt.*;
[ "java.awt" ]
java.awt;
876,276
private RelDataType fixUpNullability(RelDataTypeFactory typeFactory, RelDataType type, boolean nullable) { if (this.nullable != null) { nullable = this.nullable; } return typeFactory.createTypeWithNullability(type, nullable); }
RelDataType function(RelDataTypeFactory typeFactory, RelDataType type, boolean nullable) { if (this.nullable != null) { nullable = this.nullable; } return typeFactory.createTypeWithNullability(type, nullable); }
/** * Fix up the nullability of the {@code type}. * * @param typeFactory Type factory * @param type The type to coerce nullability * @param nullable Default nullability to use if this type specification does not * specify nullability * @return Type with specified nullability or the default(false) */
Fix up the nullability of the type
fixUpNullability
{ "repo_name": "julianhyde/calcite", "path": "core/src/main/java/org/apache/calcite/sql/SqlDataTypeSpec.java", "license": "apache-2.0", "size": 8741 }
[ "org.apache.calcite.rel.type.RelDataType", "org.apache.calcite.rel.type.RelDataTypeFactory" ]
import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.rel.type.RelDataTypeFactory;
import org.apache.calcite.rel.type.*;
[ "org.apache.calcite" ]
org.apache.calcite;
31,540
@Test public void testGetWorkload_1() throws Exception { TestPlan fixture = new TestPlan(); fixture.setWorkload(new Workload()); fixture.setScriptGroups(new LinkedList()); fixture.setUserPercentage(1); fixture.setName(""); fixture.setPosition(new Integer(1)); Workload result = fixture.getWorkload(); assertNotNull(result); }
void function() throws Exception { TestPlan fixture = new TestPlan(); fixture.setWorkload(new Workload()); fixture.setScriptGroups(new LinkedList()); fixture.setUserPercentage(1); fixture.setName(""); fixture.setPosition(new Integer(1)); Workload result = fixture.getWorkload(); assertNotNull(result); }
/** * Run the Workload getWorkload() method test. * * @throws Exception * * @generatedBy CodePro at 12/15/14 1:34 PM */
Run the Workload getWorkload() method test
testGetWorkload_1
{ "repo_name": "kevinmcgoldrick/Tank", "path": "data_model/src/test/java/com/intuit/tank/project/TestPlanTest.java", "license": "epl-1.0", "size": 13443 }
[ "com.intuit.tank.project.TestPlan", "com.intuit.tank.project.Workload", "java.util.LinkedList", "org.junit.Assert" ]
import com.intuit.tank.project.TestPlan; import com.intuit.tank.project.Workload; import java.util.LinkedList; import org.junit.Assert;
import com.intuit.tank.project.*; import java.util.*; import org.junit.*;
[ "com.intuit.tank", "java.util", "org.junit" ]
com.intuit.tank; java.util; org.junit;
221,741
@TargetApi(Build.VERSION_CODES.LOLLIPOP) public static boolean setElevation(PopupWindow window, float elevationValue) { if (!isElevationSupported()) return false; window.setElevation(elevationValue); return true; }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) static boolean function(PopupWindow window, float elevationValue) { if (!isElevationSupported()) return false; window.setElevation(elevationValue); return true; }
/** * Set elevation if supported. */
Set elevation if supported
setElevation
{ "repo_name": "lizhangqu/chromium-net-for-android", "path": "cronet-native/src/main/java/org/chromium/base/ApiCompatibilityUtils.java", "license": "bsd-3-clause", "size": 31889 }
[ "android.annotation.TargetApi", "android.os.Build", "android.widget.PopupWindow" ]
import android.annotation.TargetApi; import android.os.Build; import android.widget.PopupWindow;
import android.annotation.*; import android.os.*; import android.widget.*;
[ "android.annotation", "android.os", "android.widget" ]
android.annotation; android.os; android.widget;
2,307,264
@SuppressWarnings("unchecked") public T order(SortOrder order) { Objects.requireNonNull(order, "sort order cannot be null."); this.order = order; return (T) this; }
@SuppressWarnings(STR) T function(SortOrder order) { Objects.requireNonNull(order, STR); this.order = order; return (T) this; }
/** * Set the order of sorting. */
Set the order of sorting
order
{ "repo_name": "maddin2016/elasticsearch", "path": "core/src/main/java/org/elasticsearch/search/sort/SortBuilder.java", "license": "apache-2.0", "size": 12254 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
240,435
private List<Line> decompose(Line line) { double[] lons = line.getX(); double[] lats = line.getY(); int offset = 0; ArrayList<Line> parts = new ArrayList<>(); double shift = 0; int i = 1; while (i < lons.length) { // Check where the line is going east (+1), west (-1) or directly north/south (0) int direction = Double.compare(lons[i], lons[i - 1]); double newShift = calculateShift(lons[i - 1], direction < 0); // first point lon + shift is always between -180.0 and +180.0 if (i - offset > 1 && newShift != shift) { // Jumping over anti-meridian - we need to start a new segment double[] partLons = Arrays.copyOfRange(lons, offset, i); double[] partLats = Arrays.copyOfRange(lats, offset, i); performShift(shift, partLons); shift = newShift; offset = i - 1; parts.add(new Line(partLons, partLats)); } else { // Check if new point intersects with anti-meridian shift = newShift; double t = intersection(lons[i - 1] + shift, lons[i] + shift); if (Double.isNaN(t) == false) { // Found intersection, all previous segments are now part of the linestring double[] partLons = Arrays.copyOfRange(lons, offset, i + 1); double[] partLats = Arrays.copyOfRange(lats, offset, i + 1); lons[i - 1] = partLons[partLons.length - 1] = (direction > 0 ? DATELINE : -DATELINE) - shift; lats[i - 1] = partLats[partLats.length - 1] = lats[i - 1] + (lats[i] - lats[i - 1]) * t; performShift(shift, partLons); offset = i - 1; parts.add(new Line(partLons, partLats)); } else { // Didn't find intersection - just continue checking i++; } } } if (offset == 0) { performShift(shift, lons); parts.add(new Line(lons, lats)); } else if (offset < lons.length - 1) { double[] partLons = Arrays.copyOfRange(lons, offset, lons.length); double[] partLats = Arrays.copyOfRange(lats, offset, lats.length); performShift(shift, partLons); parts.add(new Line(partLons, partLats)); } return parts; }
List<Line> function(Line line) { double[] lons = line.getX(); double[] lats = line.getY(); int offset = 0; ArrayList<Line> parts = new ArrayList<>(); double shift = 0; int i = 1; while (i < lons.length) { int direction = Double.compare(lons[i], lons[i - 1]); double newShift = calculateShift(lons[i - 1], direction < 0); if (i - offset > 1 && newShift != shift) { double[] partLons = Arrays.copyOfRange(lons, offset, i); double[] partLats = Arrays.copyOfRange(lats, offset, i); performShift(shift, partLons); shift = newShift; offset = i - 1; parts.add(new Line(partLons, partLats)); } else { shift = newShift; double t = intersection(lons[i - 1] + shift, lons[i] + shift); if (Double.isNaN(t) == false) { double[] partLons = Arrays.copyOfRange(lons, offset, i + 1); double[] partLats = Arrays.copyOfRange(lats, offset, i + 1); lons[i - 1] = partLons[partLons.length - 1] = (direction > 0 ? DATELINE : -DATELINE) - shift; lats[i - 1] = partLats[partLats.length - 1] = lats[i - 1] + (lats[i] - lats[i - 1]) * t; performShift(shift, partLons); offset = i - 1; parts.add(new Line(partLons, partLats)); } else { i++; } } } if (offset == 0) { performShift(shift, lons); parts.add(new Line(lons, lats)); } else if (offset < lons.length - 1) { double[] partLons = Arrays.copyOfRange(lons, offset, lons.length); double[] partLats = Arrays.copyOfRange(lats, offset, lats.length); performShift(shift, partLons); parts.add(new Line(partLons, partLats)); } return parts; }
/** * Decompose a linestring given as array of coordinates by anti-meridian. * * @param line linestring that should be decomposed * @return array of linestrings given as coordinate arrays */
Decompose a linestring given as array of coordinates by anti-meridian
decompose
{ "repo_name": "coding0011/elasticsearch", "path": "server/src/main/java/org/elasticsearch/index/mapper/GeoShapeIndexer.java", "license": "apache-2.0", "size": 45809 }
[ "java.util.ArrayList", "java.util.Arrays", "java.util.List", "org.elasticsearch.geometry.Line" ]
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.elasticsearch.geometry.Line;
import java.util.*; import org.elasticsearch.geometry.*;
[ "java.util", "org.elasticsearch.geometry" ]
java.util; org.elasticsearch.geometry;
874,735
private void bindPreferenceSummaryToValue(Preference preference) { // Set the listener to watch for value changes. preference.setOnPreferenceChangeListener(this); // Trigger the listener immediately with the preference's // current value. onPreferenceChange(preference, PreferenceManager .getDefaultSharedPreferences(preference.getContext()) .getString(preference.getKey(), "")); }
void function(Preference preference) { preference.setOnPreferenceChangeListener(this); onPreferenceChange(preference, PreferenceManager .getDefaultSharedPreferences(preference.getContext()) .getString(preference.getKey(), "")); }
/** * Attaches a listener so the summary is always updated with the preference value. * Also fires the listener once, to initialize the summary (so it shows up before the value * is changed.) */
Attaches a listener so the summary is always updated with the preference value. Also fires the listener once, to initialize the summary (so it shows up before the value is changed.)
bindPreferenceSummaryToValue
{ "repo_name": "george-sp/Sunshine-Udacity", "path": "app/src/main/java/com/example/android/sunshine/SettingsActivity.java", "license": "apache-2.0", "size": 10177 }
[ "android.preference.Preference", "android.preference.PreferenceManager" ]
import android.preference.Preference; import android.preference.PreferenceManager;
import android.preference.*;
[ "android.preference" ]
android.preference;
1,818,593
default PortStatistics getStatisticsForPort(DeviceId deviceId, PortNumber portNumber) { return null; }
default PortStatistics getStatisticsForPort(DeviceId deviceId, PortNumber portNumber) { return null; }
/** * Returns the port statistics of the specified device and port. * * @param deviceId device identifier * @param portNumber port identifier * @return port statistics of specific port of the device */
Returns the port statistics of the specified device and port
getStatisticsForPort
{ "repo_name": "osinstom/onos", "path": "core/api/src/main/java/org/onosproject/net/device/DeviceStore.java", "license": "apache-2.0", "size": 7501 }
[ "org.onosproject.net.DeviceId", "org.onosproject.net.PortNumber" ]
import org.onosproject.net.DeviceId; import org.onosproject.net.PortNumber;
import org.onosproject.net.*;
[ "org.onosproject.net" ]
org.onosproject.net;
1,146,233
private ComplexMatchResult emitBitFieldInsert(JavaKind kind, AArch64BitFieldOp.BitFieldOpCode op, ValueNode value, int lsb, int width) { assert op == BitFieldOpCode.SBFIZ || op == BitFieldOpCode.UBFIZ; return emitBitFieldHelper(kind, op, value, lsb, width); }
ComplexMatchResult function(JavaKind kind, AArch64BitFieldOp.BitFieldOpCode op, ValueNode value, int lsb, int width) { assert op == BitFieldOpCode.SBFIZ op == BitFieldOpCode.UBFIZ; return emitBitFieldHelper(kind, op, value, lsb, width); }
/** * Copy (width) bits from the least significant bits of the source register to bit position lsb * of the destination register. * * @param kind expected final size of the bitfield operation * @param op The type of bitfield operation * @param value The value to extract bits from * @param lsb (least significant bit) the starting index of where the value is moved to * @param width The number of bits to extract from value. */
Copy (width) bits from the least significant bits of the source register to bit position lsb of the destination register
emitBitFieldInsert
{ "repo_name": "smarr/Truffle", "path": "compiler/src/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java", "license": "gpl-2.0", "size": 42516 }
[ "org.graalvm.compiler.core.match.ComplexMatchResult", "org.graalvm.compiler.lir.aarch64.AArch64BitFieldOp", "org.graalvm.compiler.nodes.ValueNode" ]
import org.graalvm.compiler.core.match.ComplexMatchResult; import org.graalvm.compiler.lir.aarch64.AArch64BitFieldOp; import org.graalvm.compiler.nodes.ValueNode;
import org.graalvm.compiler.core.match.*; import org.graalvm.compiler.lir.aarch64.*; import org.graalvm.compiler.nodes.*;
[ "org.graalvm.compiler" ]
org.graalvm.compiler;
2,171,383
public static Value strpbrk(StringValue haystack, StringValue charList) { int len = haystack.length(); int sublen = charList.length(); for (int i = 0; i < len; i++) { for (int j = 0; j < sublen; j++) { if (haystack.charAt(i) == charList.charAt(j)) return haystack.substring(i); } } return BooleanValue.FALSE; }
static Value function(StringValue haystack, StringValue charList) { int len = haystack.length(); int sublen = charList.length(); for (int i = 0; i < len; i++) { for (int j = 0; j < sublen; j++) { if (haystack.charAt(i) == charList.charAt(j)) return haystack.substring(i); } } return BooleanValue.FALSE; }
/** * Returns a substring of <i>haystack</i> starting from the earliest * occurence of any char in <i>charList</i> * * @param haystack the string to search in * @param charList list of chars that would trigger match * @return substring, else FALSE */
Returns a substring of haystack starting from the earliest occurence of any char in charList
strpbrk
{ "repo_name": "smba/oak", "path": "quercus/src/main/java/com/caucho/quercus/lib/string/StringModule.java", "license": "lgpl-3.0", "size": 155187 }
[ "com.caucho.quercus.env.BooleanValue", "com.caucho.quercus.env.StringValue", "com.caucho.quercus.env.Value" ]
import com.caucho.quercus.env.BooleanValue; import com.caucho.quercus.env.StringValue; import com.caucho.quercus.env.Value;
import com.caucho.quercus.env.*;
[ "com.caucho.quercus" ]
com.caucho.quercus;
1,022,264