signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class SQLiteHelper { /** * Called when the database needs to be upgraded . The implementation
* should use this method to drop tables , add tables , or do anything else it
* needs to upgrade to the new schema version .
* @ param db The database .
* @ param oldVersion The old database version .
* @ para... | try { if ( builder . tableNames == null ) { throw new SQLiteHelperException ( "The array of String tableNames can't be null!!" ) ; } builder . onUpgradeCallback . onUpgrade ( db , oldVersion , newVersion ) ; } catch ( SQLiteHelperException e ) { Log . e ( this . getClass ( ) . toString ( ) , Log . getStackTraceString (... |
public class DescribeWorkingStorageResult { /** * An array of the gateway ' s local disk IDs that are configured as working storage . Each local disk ID is specified
* as a string ( minimum length of 1 and maximum length of 300 ) . If no local disks are configured as working storage ,
* then the DiskIds array is em... | if ( diskIds == null ) { diskIds = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return diskIds ; |
public class MobicentsSipServletsEmbeddedImpl { /** * / * ( non - Javadoc )
* @ see org . jboss . arquillian . container . mobicents . servlet . sip . embedded _ 1 . MobicentsSipServletsEmbedded # createConnector ( java . lang . String , int , java . lang . String ) */
@ Override public Connector createConnector ( St... | Connector connector = null ; if ( address != null ) { /* * InetAddress . toString ( ) returns a string of the form
* " < hostname > / < literal _ IP > " . Get the latter part , so that the
* address can be parsed ( back ) into an InetAddress using
* InetAddress . getByName ( ) . */
int index = address . indexOf (... |
public class ProtoLexer { /** * $ ANTLR start " SFIXED32" */
public final void mSFIXED32 ( ) throws RecognitionException { } } | try { int _type = SFIXED32 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // com / dyuproject / protostuff / parser / ProtoLexer . g : 187:5 : ( ' sfixed32 ' )
// com / dyuproject / protostuff / parser / ProtoLexer . g : 187:9 : ' sfixed32'
{ match ( "sfixed32" ) ; } state . type = _type ; state . channel = _channel ; } fina... |
public class FaultException { /** * Format the exception message using the presenter getText method
* @ param aID the key of the message
* @ param aBindValues the values to plug into the message . */
protected void formatMessage ( String aID , Map < Object , Object > aBindValues ) { } } | Presenter presenter = Presenter . getPresenter ( this . getClass ( ) ) ; message = presenter . getText ( aID , aBindValues ) ; |
public class CmsImageFormatHandler { /** * Execute on height change . < p >
* @ param height the new height */
public void onHeightChange ( String height ) { } } | int value = CmsClientStringUtil . parseInt ( height ) ; if ( ( m_croppingParam . getTargetHeight ( ) == value ) || ( value == 0 ) ) { // the value has not changed , ignore ' 0'
return ; } m_croppingParam . setTargetHeight ( value ) ; if ( m_ratioLocked ) { m_croppingParam . setTargetWidth ( ( value * m_originalWidth ) ... |
public class CacheProviderWrapper { /** * Puts an entry into the cache . If the entry already exists in the
* cache , this method will ALSO update the same .
* Called by DistributedMap
* @ param ei The EntryInfo object
* @ param value The value of the object
* @ param coordinate Indicates that the value shoul... | final String methodName = "invalidateAndSet()" ; Object oldValue = null ; Object id = null ; if ( ei != null && value != null ) { id = ei . getIdObject ( ) ; com . ibm . websphere . cache . CacheEntry oldCacheEntry = this . coreCache . put ( ei , value ) ; if ( oldCacheEntry != null ) { oldValue = oldCacheEntry . getVa... |
public class JSRegistry { /** * to the same schema . */
private boolean isPresent ( JMFSchema schema ) throws JMFSchemaIdException { } } | long id = schema . getID ( ) ; JMFSchema reg = ( JMFSchema ) schemaTable . get ( id ) ; if ( reg != null ) { // We are assuming that collisions on key don ' t happen
if ( ! schema . equals ( reg ) ) { // The schema id is a 64bit SHA - 1 derived hashcode , so we really don ' t expect
// to get random collisions .
throw ... |
public class BigtableTableAdminGrpcClient { /** * { @ inheritDoc } */
@ Override public Table getTable ( GetTableRequest request ) { } } | return createUnaryListener ( request , getTableRpc , request . getName ( ) ) . getBlockingResult ( ) ; |
public class DescribeClientVpnConnectionsResult { /** * Information about the active and terminated client connections .
* @ return Information about the active and terminated client connections . */
public java . util . List < ClientVpnConnection > getConnections ( ) { } } | if ( connections == null ) { connections = new com . amazonaws . internal . SdkInternalList < ClientVpnConnection > ( ) ; } return connections ; |
public class RandomDateUtils { /** * Returns a random { @ link MonthDay } that is after the given { @ link MonthDay } .
* @ param after the value that returned { @ link MonthDay } must be after
* @ param includeLeapDay whether or not to include leap day
* @ return the random { @ link MonthDay }
* @ throws Illeg... | checkArgument ( after != null , "After must be non-null" ) ; checkArgument ( after . isBefore ( MonthDay . of ( DECEMBER , 31 ) ) , "After must be before December 31st" ) ; int year = includeLeapDay ? LEAP_YEAR : LEAP_YEAR - 1 ; LocalDate start = after . atYear ( year ) . plus ( 1 , DAYS ) ; LocalDate end = Year . of (... |
public class CacheSubnetGroup { /** * A list of subnets associated with the cache subnet group .
* @ param subnets
* A list of subnets associated with the cache subnet group . */
public void setSubnets ( java . util . Collection < Subnet > subnets ) { } } | if ( subnets == null ) { this . subnets = null ; return ; } this . subnets = new com . amazonaws . internal . SdkInternalList < Subnet > ( subnets ) ; |
public class CEMIFactory { /** * Creates a new cEMI L - Data message with information provided by < code > original < / code > , and
* adjusts source and destination address to match the supplied addresses .
* @ param src the new KNX source address for the message , use < code > null < / code > to use original
* ... | return ( CEMILData ) create ( 0 , src , dst , null , original , extended , original . isRepetition ( ) ) ; |
public class Form { /** * Retrieves an optional string value corresponding to the name of the form element
* @ param key The name of the form element
* @ return Optional of String */
public Optional < String > getString ( String key ) { } } | Objects . requireNonNull ( key , Required . KEY . toString ( ) ) ; String value = this . values . get ( key ) ; if ( StringUtils . isNotBlank ( value ) ) { return Optional . of ( value ) ; } return Optional . empty ( ) ; |
public class CleaneLingSolver { /** * Pushes and logs a clause and its blocking literal to the extension .
* @ param c the clause
* @ param blit the blocking literal */
private void pushExtension ( final CLClause c , final int blit ) { } } | pushExtension ( 0 ) ; for ( int i = 0 ; i < c . lits ( ) . size ( ) ; i ++ ) { final int lit = c . lits ( ) . get ( i ) ; if ( lit != blit ) { pushExtension ( lit ) ; } } pushExtension ( blit ) ; |
public class SheetColumnResourcesImpl { /** * Update a column .
* It mirrors to the following Smartsheet REST API method : PUT / sheets / { sheetId } / columns / { columnId }
* Exceptions :
* IllegalArgumentException : if any argument is null
* InvalidRequestException : if there is any problem with the REST API... | Util . throwIfNull ( column ) ; return this . updateResource ( "sheets/" + sheetId + "/columns/" + column . getId ( ) , Column . class , column ) ; |
public class CHFWBundle { /** * DS method for setting the scheduled event service reference .
* @ param ref */
@ Reference ( service = ScheduledEventService . class , cardinality = ReferenceCardinality . MANDATORY ) protected void setScheduledEventService ( ScheduledEventService ref ) { } } | this . scheduler = ref ; |
public class ExampleUtil { /** * < p > asList . < / p >
* @ param example a { @ link com . greenpepper . Example } object .
* @ return a { @ link java . util . List } object . */
public static List < Example > asList ( Example example ) { } } | if ( example == null ) return new ArrayList < Example > ( ) ; List < Example > all = new ArrayList < Example > ( ) ; for ( Example each : example ) { all . add ( each ) ; } return all ; |
public class CmsSearchFieldConfiguration { /** * To allow sorting on a field the field must be added to the map given to { @ link org . apache . solr . uninverting . UninvertingReader # wrap ( org . apache . lucene . index . DirectoryReader , Map ) } .
* The method adds the configured fields .
* @ param uninverting... | for ( String fieldName : getFieldNames ( ) ) { uninvertingMap . put ( fieldName , Type . SORTED ) ; } |
public class Versions { /** * Returns the recent minor version for the given major version or null
* if neither major version or no minor version exists .
* @ param major
* @ return */
public String getRecentMinor ( String major ) { } } | if ( major == null ) { return null ; } prepareDetailedVersions ( ) ; if ( majors . containsKey ( major ) && majors . get ( major ) . size ( ) > 0 ) { return majors . get ( major ) . get ( 0 ) ; } return null ; |
public class QueryParameters { /** * Updates direction of specified key
* @ param key Key
* @ param direction Direction
* @ return this instance of QueryParameters */
public QueryParameters updateDirection ( String key , Direction direction ) { } } | this . direction . put ( processKey ( key ) , direction ) ; return this ; |
public class Stream { /** * Combines two streams by applying specified combiner function to each element at same position .
* < p > Example :
* < pre >
* combiner : ( a , b ) - & gt ; a + b
* stream 1 : [ 1 , 2 , 3 , 4]
* stream 2 : [ 5 , 6 , 7 , 8]
* result : [ 6 , 8 , 10 , 12]
* < / pre >
* @ param < ... | Objects . requireNonNull ( stream1 ) ; Objects . requireNonNull ( stream2 ) ; return Stream . < F , S , R > zip ( stream1 . iterator , stream2 . iterator , combiner ) ; |
public class TurfJoins { /** * Takes a { @ link Point } and a { @ link MultiPolygon } and determines if the point resides inside
* the polygon . The polygon can be convex or concave . The function accounts for holes .
* @ param point which you ' d like to check if inside the polygon
* @ param multiPolygon which y... | List < List < List < Point > > > polys = multiPolygon . coordinates ( ) ; boolean insidePoly = false ; for ( int i = 0 ; i < polys . size ( ) && ! insidePoly ; i ++ ) { // check if it is in the outer ring first
if ( inRing ( point , polys . get ( i ) . get ( 0 ) ) ) { boolean inHole = false ; int temp = 1 ; // check fo... |
public class CommerceWishListServiceBaseImpl { /** * Sets the commerce wish list item remote service .
* @ param commerceWishListItemService the commerce wish list item remote service */
public void setCommerceWishListItemService ( com . liferay . commerce . wish . list . service . CommerceWishListItemService commerc... | this . commerceWishListItemService = commerceWishListItemService ; |
public class GenericLinkReferenceParser { /** * Count the number of escape chars before a given character and if that number is odd then that character should be
* escaped .
* @ param content the content in which to check for escapes
* @ param charPosition the position of the char for which to decide if it should... | int counter = 0 ; int pos = charPosition - 1 ; while ( pos > - 1 && content . charAt ( pos ) == ESCAPE_CHAR ) { counter ++ ; pos -- ; } return counter % 2 != 0 ; |
public class Gen { /** * Does given name start with " access $ " and end in an odd digit ? */
private boolean isOddAccessName ( Name name ) { } } | return name . startsWith ( accessDollar ) && ( name . getByteAt ( name . getByteLength ( ) - 1 ) & 1 ) == 1 ; |
public class AwsSecurityFindingFilters { /** * A URL that links to a page about the current finding in the security findings provider ' s solution .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSourceUrl ( java . util . Collection ) } or { @ link # with... | if ( this . sourceUrl == null ) { setSourceUrl ( new java . util . ArrayList < StringFilter > ( sourceUrl . length ) ) ; } for ( StringFilter ele : sourceUrl ) { this . sourceUrl . add ( ele ) ; } return this ; |
public class VoltCompiler { /** * Get textual explain plan info for each plan from the
* catalog to be shoved into the catalog jarfile . */
HashMap < String , byte [ ] > getExplainPlans ( Catalog catalog ) { } } | HashMap < String , byte [ ] > retval = new HashMap < > ( ) ; Database db = getCatalogDatabase ( m_catalog ) ; assert ( db != null ) ; for ( Procedure proc : db . getProcedures ( ) ) { for ( Statement stmt : proc . getStatements ( ) ) { String s = "SQL: " + stmt . getSqltext ( ) + "\n" ; s += "COST: " + Integer . toStri... |
public class ProcessAssert { /** * Asserts the process instance with the provided id is ended and has reached < strong > only < / strong > the end event
* with the provided id .
* < strong > Note : < / strong > this assertion should be used for processes that have exclusive end events and no
* intermediate end ev... | Validate . notNull ( processInstanceId ) ; Validate . notNull ( endEventId ) ; apiCallback . debug ( LogMessage . PROCESS_9 , processInstanceId , endEventId ) ; try { getEndEventAssertable ( ) . processEndedAndInExclusiveEndEvent ( processInstanceId , endEventId ) ; } catch ( final AssertionError ae ) { apiCallback . f... |
public class CachedItem { /** * Change the date of the actual data .
* Override this to change the date .
* Usually , you add flashing icons to show the tasks that are being queued , then
* you add an override to DateChangeTask that changes the remote data in a Separate task .
* The code usually looks something... | |
public class CoherentManagerConnection { /** * Allows the caller to send an action to asterisk without waiting for the
* response . You should only use this if you don ' t care whether the action
* actually succeeds .
* @ param sa */
public static void sendActionNoWait ( final ManagerAction action ) { } } | final Thread background = new Thread ( ) { @ Override public void run ( ) { try { CoherentManagerConnection . sendAction ( action , 5000 ) ; } catch ( final Exception e ) { CoherentManagerConnection . logger . error ( e , e ) ; } } } ; background . setName ( "sendActionNoWait" ) ; // $ NON - NLS - 1 $
background . setD... |
public class SubnetworkId { /** * Returns a subnetwork identity given the region and subnetwork names . The subnetwork name must
* be 1-63 characters long and comply with RFC1035 . Specifically , the name must match the regular
* expression { @ code [ a - z ] ( [ - a - z0-9 ] * [ a - z0-9 ] ) ? } which means the fi... | return new SubnetworkId ( null , region , subnetwork ) ; |
public class TableRow { /** * Write the XML dataStyles for this object . < br >
* This is used while writing the ODS file .
* @ param util a util for XML writing
* @ param appendable where to write the XML
* @ throws IOException If an I / O error occurs */
public void appendXMLToTable ( final XMLUtil util , fin... | this . appendRowOpenTag ( util , appendable ) ; int nullFieldCounter = 0 ; final int size = this . cells . usedSize ( ) ; for ( int c = 0 ; c < size ; c ++ ) { final TableCell cell = this . cells . get ( c ) ; if ( this . hasNoValue ( cell ) ) { nullFieldCounter ++ ; continue ; } this . appendRepeatedCell ( util , appe... |
public class TargetSpecifications { /** * { @ link Specification } for retrieving { @ link Target } s by " has no tag
* names " or " has at least on of the given tag names " .
* @ param tagNames
* to be filtered on
* @ param selectTargetWithNoTag
* flag to get targets with no tag assigned
* @ return the { @... | return ( targetRoot , query , cb ) -> { final Predicate predicate = getPredicate ( targetRoot , cb , selectTargetWithNoTag , tagNames ) ; query . distinct ( true ) ; return predicate ; } ; |
public class StreamingXXHash32 { /** * Returns a { @ link Checksum } view of this instance . Modifications to the view
* will modify this instance too and vice - versa .
* @ return the { @ link Checksum } object representing this instance */
public final Checksum asChecksum ( ) { } } | return new Checksum ( ) { @ Override public long getValue ( ) { return StreamingXXHash32 . this . getValue ( ) & 0xFFFFFFFL ; } @ Override public void reset ( ) { StreamingXXHash32 . this . reset ( ) ; } @ Override public void update ( int b ) { StreamingXXHash32 . this . update ( new byte [ ] { ( byte ) b } , 0 , 1 ) ... |
public class TextFormat { /** * Returns a clone of this text format with the font configured as specified . */
public TextFormat withFont ( String name , Font . Style style , float size ) { } } | return withFont ( new Font ( name , style , size ) ) ; |
public class Version { /** * See ISO 16022:2006 5.5.1 Table 7 */
private static Version [ ] buildVersions ( ) { } } | return new Version [ ] { new Version ( 1 , 10 , 10 , 8 , 8 , new ECBlocks ( 5 , new ECB ( 1 , 3 ) ) ) , new Version ( 2 , 12 , 12 , 10 , 10 , new ECBlocks ( 7 , new ECB ( 1 , 5 ) ) ) , new Version ( 3 , 14 , 14 , 12 , 12 , new ECBlocks ( 10 , new ECB ( 1 , 8 ) ) ) , new Version ( 4 , 16 , 16 , 14 , 14 , new ECBlocks ( ... |
public class StopContinuousExportRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StopContinuousExportRequest stopContinuousExportRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( stopContinuousExportRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stopContinuousExportRequest . getExportId ( ) , EXPORTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to ... |
public class JsonDynamicMBeanImpl { /** * { @ inheritDoc } */
public Object getAttribute ( String pAttribute ) throws AttributeNotFoundException , MBeanException , ReflectionException { } } | try { if ( ! attributeInfoMap . containsKey ( pAttribute ) ) { return jolokiaMBeanServer . getAttribute ( objectName , pAttribute ) ; } else { return toJson ( jolokiaMBeanServer . getAttribute ( objectName , pAttribute ) ) ; } } catch ( InstanceNotFoundException e ) { AttributeNotFoundException exp = new AttributeNotFo... |
public class MajorCompactionTask { /** * Compacts the given segment .
* @ param segment The segment to compact .
* @ param compactSegment The segment to which to write the compacted segment . */
private void compactSegment ( Segment segment , OffsetPredicate predicate , Segment compactSegment ) { } } | for ( long i = segment . firstIndex ( ) ; i <= segment . lastIndex ( ) ; i ++ ) { checkEntry ( i , segment , predicate , compactSegment ) ; } |
public class FindIdentifiers { /** * Finds a variable declaration with the given name that is in scope at the current location . */
public static Symbol findIdent ( String name , VisitorState state ) { } } | return findIdent ( name , state , KindSelector . VAR ) ; |
public class DatabaseURIHelper { /** * Returns URI for { @ code _ changes } endpoint using passed
* { @ code query } . */
public URI changesUri ( Map < String , Object > query ) { } } | // lets find the since parameter
if ( query . containsKey ( "since" ) ) { Object since = query . get ( "since" ) ; if ( ! ( since instanceof String ) ) { // json encode the seq number since it isn ' t a string
Gson gson = new Gson ( ) ; query . put ( "since" , gson . toJson ( since ) ) ; } } return this . path ( "_chan... |
public class BoxesRunTime { /** * arg1 + arg2 */
public static Object add ( Object arg1 , Object arg2 ) throws NoSuchMethodException { } } | int code1 = typeCode ( arg1 ) ; int code2 = typeCode ( arg2 ) ; int maxcode = ( code1 < code2 ) ? code2 : code1 ; if ( maxcode <= INT ) { return boxToInteger ( unboxCharOrInt ( arg1 , code1 ) + unboxCharOrInt ( arg2 , code2 ) ) ; } if ( maxcode <= LONG ) { return boxToLong ( unboxCharOrLong ( arg1 , code1 ) + unboxChar... |
public class Vector4i { /** * / * ( non - Javadoc )
* @ see org . joml . Vector4ic # dot ( org . joml . Vector4ic ) */
public int dot ( Vector4ic v ) { } } | return x * v . x ( ) + y * v . y ( ) + z * v . z ( ) + w * v . w ( ) ; |
public class MigrationModel { /** * < p > readMigrations . < / p > */
protected void readMigrations ( ) { } } | final List < MigrationResource > resources = findMigrationResource ( ) ; // sort into version order before applying
Collections . sort ( resources ) ; for ( MigrationResource migrationResource : resources ) { logger . debug ( "read {}" , migrationResource ) ; model . apply ( migrationResource . read ( ) , migrationReso... |
public class UCaseProps { /** * Accepts both 2 - and 3 - letter language subtags . */
private static final int getCaseLocale ( String language ) { } } | // Check the subtag length to reduce the number of comparisons
// for locales without special behavior .
// Fastpath for English " en " which is often used for default ( = root locale ) case mappings ,
// and for Chinese " zh " : Very common but no special case mapping behavior .
if ( language . length ( ) == 2 ) { if ... |
public class SibRaSingleProcessListener { /** * Indicates whether the resource adapter is using bifurcated consumer
* sessions . If so , the < code > ConsumerSession < / code > created by the
* listener needs to be bifurcatable .
* @ return always returns < code > false < / code > */
boolean isSessionBifurcated (... | if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { final String methodName = "isSessionBifurcated" ; SibTr . entry ( this , TRACE , methodName ) ; SibTr . exit ( this , TRACE , methodName , Boolean . FALSE ) ; } return false ; |
public class CreateAccount { /** * Runs the example .
* @ param adWordsServices the services factory .
* @ param session the session .
* @ throws ApiException if the API request failed with one or more service errors .
* @ throws RemoteException if the API request failed due to other errors . */
public static v... | // Get the CampaignService .
ManagedCustomerServiceInterface managedCustomerService = adWordsServices . get ( session , ManagedCustomerServiceInterface . class ) ; // Create account .
ManagedCustomer customer = new ManagedCustomer ( ) ; customer . setName ( "Customer created with ManagedCustomerService on " + new DateT... |
public class ListServicesResponse { /** * < pre >
* The services belonging to the requested application .
* < / pre >
* < code > repeated . google . appengine . v1 . Service services = 1 ; < / code > */
public com . google . appengine . v1 . ServiceOrBuilder getServicesOrBuilder ( int index ) { } } | return services_ . get ( index ) ; |
public class GenericTypeReflector { /** * Helper method for getUpperBoundClassAndInterfaces , adding the result to the given set . */
private static void buildUpperBoundClassAndInterfaces ( Type type , Set < Class < ? > > result ) { } } | if ( type instanceof ParameterizedType || type instanceof Class < ? > ) { result . add ( erase ( type ) ) ; return ; } for ( Type superType : getExactDirectSuperTypes ( type ) ) { buildUpperBoundClassAndInterfaces ( superType , result ) ; } |
public class HerokuAPI { /** * Gets the info for a running build
* @ param appName See { @ link # listApps } for a list of apps that can be used .
* @ param buildId the unique identifier of the build */
public Build getBuildInfo ( String appName , String buildId ) { } } | return connection . execute ( new BuildInfo ( appName , buildId ) , apiKey ) ; |
public class AbstractDecorator { /** * Notifies the listeners , which have been registered to be notified , when the visibility of the
* dialog ' s areas has been changed , about an area being hidden .
* @ param area
* The area , which has been hidden , as a value of the enum { @ link Area } . The area may
* no... | for ( AreaListener listener : areaListeners ) { listener . onAreaHidden ( area ) ; } |
public class Tuple10 { /** * Skip 5 degrees from this tuple . */
public final Tuple5 < T6 , T7 , T8 , T9 , T10 > skip5 ( ) { } } | return new Tuple5 < > ( v6 , v7 , v8 , v9 , v10 ) ; |
public class Dom { /** * Creates an HTML element with the given id .
* @ param tagName the HTML tag of the element to be created
* @ return the newly - created element */
public static Element createElement ( String tagName , String id ) { } } | return IMPL . createElement ( tagName , id ) ; |
public class IntStream { /** * Lazy evaluation .
* @ param supplier
* @ return */
public static IntStream of ( final Supplier < IntList > supplier ) { } } | final IntIterator iter = new IntIteratorEx ( ) { private IntIterator iterator = null ; @ Override public boolean hasNext ( ) { if ( iterator == null ) { init ( ) ; } return iterator . hasNext ( ) ; } @ Override public int nextInt ( ) { if ( iterator == null ) { init ( ) ; } return iterator . nextInt ( ) ; } private voi... |
public class ExecutionStrategy { /** * Called to discover the field definition give the current parameters and the AST { @ link Field }
* @ param executionContext contains the top level execution parameters
* @ param parameters contains the parameters holding the fields to be executed and source object
* @ param ... | GraphQLObjectType parentType = ( GraphQLObjectType ) parameters . getExecutionStepInfo ( ) . getUnwrappedNonNullType ( ) ; return getFieldDef ( executionContext . getGraphQLSchema ( ) , parentType , field ) ; |
public class GitLabApi { /** * Create a new GitLabApi instance that is logically a duplicate of this instance , with the exception off sudo state .
* @ return a new GitLabApi instance that is logically a duplicate of this instance , with the exception off sudo state . */
public final GitLabApi duplicate ( ) { } } | Integer sudoUserId = this . getSudoAsId ( ) ; GitLabApi gitLabApi = new GitLabApi ( apiVersion , gitLabServerUrl , getTokenType ( ) , getAuthToken ( ) , getSecretToken ( ) , clientConfigProperties ) ; if ( sudoUserId != null ) { gitLabApi . apiClient . setSudoAsId ( sudoUserId ) ; } if ( getIgnoreCertificateErrors ( ) ... |
public class ApiOvhCloud { /** * Get SSH keys
* REST : GET / cloud / project / { serviceName } / sshkey
* @ param region [ required ] Region
* @ param serviceName [ required ] Project name */
public ArrayList < OvhSshKey > project_serviceName_sshkey_GET ( String serviceName , String region ) throws IOException { ... | String qPath = "/cloud/project/{serviceName}/sshkey" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "region" , region ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t17 ) ; |
public class WildcardMatcher { /** * returns true if at least one candidate match at least one pattern
* @ param pattern
* @ param candidate
* @ param ignoreCase
* @ return */
public static boolean matchAny ( final Collection < String > pattern , final String [ ] candidate , boolean ignoreCase ) { } } | for ( String string : pattern ) { if ( matchAny ( string , candidate , ignoreCase ) ) { return true ; } } return false ; |
public class SnapshotRepoManifestReader { /** * / * ( non - Javadoc )
* @ see org . springframework . batch . item . ItemReader # read ( ) */
@ Override public synchronized SnapshotContentItem read ( ) throws Exception , UnexpectedInputException , ParseException , NonTransientResourceException { } } | if ( this . items == null ) { this . items = new StreamingIterator < > ( new JpaIteratorSource < SnapshotContentItemRepo , SnapshotContentItem > ( repo ) { @ Override protected Page < SnapshotContentItem > getNextPage ( Pageable pageable , SnapshotContentItemRepo repo ) { return repo . findBySnapshotName ( snapshotName... |
public class SimpleSplashScreen { /** * Returns a component that displays an image in a canvas . */
protected Component createContentPane ( ) { } } | Image image = getImage ( ) ; if ( image != null ) { return new ImageCanvas ( image ) ; } return null ; |
public class SubscriptionAdjustment { /** * Get the SubscriptionAdjustment with the given ID
* @ param subscriptionId
* The ID of the { @ link Subscription } that owns the
* SubscriptionAdjustment
* @ param adjustmentId
* The ID of the SubscriptionAdjustment
* @ see < a
* href = " https : / / www . apruve... | return ApruveClient . getInstance ( ) . get ( getSubscriptionAdjustmentsPath ( subscriptionId ) + adjustmentId , SubscriptionAdjustment . class ) ; |
public class ServiceFamiliesDIB { /** * Returns the version associated to a given supported service family .
* If the service family is not supported , 0 is returned .
* @ param familyId supported service family ID to lookup
* @ return version as unsigned byte , or 0 */
public final int getVersion ( final int fam... | for ( int i = 0 ; i < ids . length ; i ++ ) { if ( ids [ i ] == familyId ) return versions [ i ] ; } return 0 ; |
public class ThreadMethods { /** * Alternative to parallelStreams ( ) which executes a callable in a separate
* pool .
* @ param < T >
* @ param callable
* @ param concurrencyConfiguration
* @ param parallelStream
* @ return */
public static < T > T forkJoinExecution ( Callable < T > callable , ConcurrencyC... | if ( parallelStream && concurrencyConfiguration . isParallelized ( ) ) { try { ForkJoinPool pool = new ForkJoinPool ( concurrencyConfiguration . getMaxNumberOfThreadsPerTask ( ) ) ; T results = pool . submit ( callable ) . get ( ) ; pool . shutdown ( ) ; return results ; } catch ( InterruptedException | ExecutionExcept... |
public class AttackVectorDescriptionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AttackVectorDescription attackVectorDescription , ProtocolMarshaller protocolMarshaller ) { } } | if ( attackVectorDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( attackVectorDescription . getVectorType ( ) , VECTORTYPE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON... |
public class Router { /** * Returns the number of routes in this router . */
public int size ( ) { } } | int ret = anyMethodRouter . size ( ) ; for ( MethodlessRouter < T > router : routers . values ( ) ) { ret += router . size ( ) ; } return ret ; |
public class Detector { /** * < p > Detects a PDF417 Code in an image . Only checks 0 and 180 degree rotations . < / p >
* @ param image barcode image to decode
* @ param hints optional hints to detector
* @ param multiple if true , then the image is searched for multiple codes . If false , then at most one code ... | // TODO detection improvement , tryHarder could try several different luminance thresholds / blackpoints or even
// different binarizers
// boolean tryHarder = hints ! = null & & hints . containsKey ( DecodeHintType . TRY _ HARDER ) ;
BitMatrix bitMatrix = image . getBlackMatrix ( ) ; List < ResultPoint [ ] > barcodeCo... |
public class LogTemplates { /** * Produces a concrete log template which logs messages into a SLF4J Logger .
* @ param loggerName Logger name
* @ param levelName Level name ( info , debug , warn , etc . )
* @ return Logger */
public static < C > SLF4JLogTemplate < C > toSLF4J ( String loggerName , String levelNam... | return toSLF4J ( loggerName , levelName , null ) ; |
public class DatabaseURIHelper { /** * Returns URI for { @ code documentId } with { @ code query } key and value . */
public URI documentUri ( String documentId , Params params ) { } } | return this . documentId ( documentId ) . query ( params ) . build ( ) ; |
public class Primitives { /** * Converts an array of object Doubles to primitives handling { @ code null } .
* This method returns { @ code null } for a { @ code null } input array .
* @ param a
* a { @ code Double } array , may be { @ code null }
* @ param valueForNull
* the value to insert if { @ code null ... | if ( a == null ) { return null ; } return unbox ( a , 0 , a . length , valueForNull ) ; |
public class StrTokenizer { /** * Checks if tokenization has been done , and if not then do it . */
private void checkTokenized ( ) { } } | if ( tokens == null ) { if ( chars == null ) { // still call tokenize as subclass may do some work
final List < String > split = tokenize ( null , 0 , 0 ) ; tokens = split . toArray ( new String [ split . size ( ) ] ) ; } else { final List < String > split = tokenize ( chars , 0 , chars . length ) ; tokens = split . to... |
public class CPMeasurementUnitPersistenceImpl { /** * Removes the cp measurement unit with the primary key from the database . Also notifies the appropriate model listeners .
* @ param primaryKey the primary key of the cp measurement unit
* @ return the cp measurement unit that was removed
* @ throws NoSuchCPMeas... | Session session = null ; try { session = openSession ( ) ; CPMeasurementUnit cpMeasurementUnit = ( CPMeasurementUnit ) session . get ( CPMeasurementUnitImpl . class , primaryKey ) ; if ( cpMeasurementUnit == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } t... |
public class AbstractRedisStorage { /** * Check if the job identified by the given key exists in storage
* @ param jobKey the key of the desired job
* @ param jedis a thread - safe Redis connection
* @ return true if the job exists ; false otherwise */
public boolean checkExists ( JobKey jobKey , T jedis ) { } } | return jedis . exists ( redisSchema . jobHashKey ( jobKey ) ) ; |
public class EncodingReader { /** * Reads into a character buffer using the correct encoding .
* @ param cbuf character buffer receiving the data .
* @ param off starting offset into the buffer .
* @ param len number of characters to read .
* @ return the number of characters read or - 1 on end of file . */
pub... | for ( int i = 0 ; i < len ; i ++ ) { int ch = read ( ) ; if ( ch < 0 ) return len ; cbuf [ off + i ] = ( char ) ch ; } return len ; |
public class AbstractFileUploadBase { /** * Processes an < a href = " http : / / www . ietf . org / rfc / rfc1867 . txt " > RFC 1867 < / a >
* compliant < code > multipart / form - data < / code > stream .
* @ param aCtx
* The context for the request to be parsed .
* @ return An iterator to instances of < code ... | return new FileItemIterator ( aCtx ) ; |
public class LogFaxClientSpiInterceptor { /** * This function is invoked by the fax client SPI proxy after invoking
* the method in the fax client SPI itself .
* @ param method
* The method invoked
* @ param arguments
* The method arguments
* @ param output
* The method output */
public final void postMet... | this . logEvent ( FaxClientSpiProxyEventType . POST_EVENT_TYPE , method , arguments , output , null ) ; |
public class PathOverrideService { /** * given the groupName , it returns the groupId
* @ param groupName name of group
* @ return ID of group */
public Integer getGroupIdFromName ( String groupName ) { } } | return ( Integer ) sqlService . getFromTable ( Constants . GENERIC_ID , Constants . GROUPS_GROUP_NAME , groupName , Constants . DB_TABLE_GROUPS ) ; |
public class WPBSQLDataStoreDao { /** * Given an instance of an object that has a particular property this method will set the object property with the
* provided value . It assumes that the object has the setter method for the specified interface
* @ param object The object instance on which the property will be s... | try { PropertyDescriptor pd = new PropertyDescriptor ( property , object . getClass ( ) ) ; pd . getWriteMethod ( ) . invoke ( object , propertyValue ) ; } catch ( Exception e ) { log . log ( Level . SEVERE , "cannot setObjectProperty on " + property , e ) ; throw new WPBSerializerException ( "Cannot set property for o... |
public class NettyClient { /** * The function can ' t be synchronized , otherwise it will cause deadlock */
public void doReconnect ( ) { } } | if ( channelRef . get ( ) != null ) { // if ( channelRef . get ( ) . isWritable ( ) ) {
// LOG . info ( " already exist a writable channel , give up reconnect , { } " ,
// channelRef . get ( ) ) ;
// return ;
return ; } if ( isClosed ( ) ) { return ; } if ( isConnecting . getAndSet ( true ) ) { LOG . info ( "Connect tw... |
public class N { /** * < pre >
* < code >
* Seq . repeat ( N . asList ( 1 , 2 , 3 ) , 2 ) = > [ 1 , 2 , 3 , 1 , 2 , 3]
* < / code >
* < / pre >
* @ param c
* @ param n
* @ return */
public static < T > List < T > repeatAll ( final Collection < T > c , final int n ) { } } | N . checkArgNotNegative ( n , "n" ) ; if ( n == 0 || isNullOrEmpty ( c ) ) { return new ArrayList < T > ( ) ; } final List < T > result = new ArrayList < > ( c . size ( ) * n ) ; for ( int i = 0 ; i < n ; i ++ ) { result . addAll ( c ) ; } return result ; |
public class DescribeFleetInstancesRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < DescribeFleetInstancesRequest > getDryRunRequest ( ) { } } | Request < DescribeFleetInstancesRequest > request = new DescribeFleetInstancesRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class HeaderFooterRecyclerAdapter { /** * Notifies that a footer item is inserted .
* @ param position the position of the content item . */
public final void notifyFooterItemInserted ( int position ) { } } | int newHeaderItemCount = getHeaderItemCount ( ) ; int newContentItemCount = getContentItemCount ( ) ; int newFooterItemCount = getFooterItemCount ( ) ; // if ( position < 0 | | position > = newFooterItemCount ) {
// throw new IndexOutOfBoundsException ( " The given position " + position
// + " is not within the positio... |
public class InternalXtextParser { /** * InternalXtext . g : 1170:1 : entryRuleTerminalToken : ruleTerminalToken EOF ; */
public final void entryRuleTerminalToken ( ) throws RecognitionException { } } | try { // InternalXtext . g : 1171:1 : ( ruleTerminalToken EOF )
// InternalXtext . g : 1172:1 : ruleTerminalToken EOF
{ before ( grammarAccess . getTerminalTokenRule ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_1 ) ; ruleTerminalToken ( ) ; state . _fsp -- ; after ( grammarAccess . getTerminalTokenRule ( ) ) ; match ( i... |
public class JMStats { /** * Round with decimal place double .
* @ param doubleNumber the double number
* @ param decimalPlace the decimal place
* @ return the double */
public static double roundWithDecimalPlace ( double doubleNumber , int decimalPlace ) { } } | double pow = pow ( 10 , decimalPlace ) ; return Math . round ( doubleNumber * pow ) / pow ; |
public class Animation { /** * Get the image associated with the current animation frame
* @ return The image associated with the current animation frame */
public Image getCurrentFrame ( ) { } } | Frame frame = ( Frame ) frames . get ( currentFrame ) ; return frame . image ; |
public class SFSUtilities { /** * Merge the bounding box of all geometries inside the provided table .
* @ param connection Active connection ( not closed by this function )
* @ param location Location of the table
* @ param geometryField Geometry field or empty string ( take the first geometry field )
* @ retu... | if ( geometryField == null || geometryField . isEmpty ( ) ) { List < String > geometryFields = getGeometryFields ( connection , location ) ; if ( geometryFields . isEmpty ( ) ) { throw new SQLException ( "The table " + location + " does not contain a Geometry field, then the extent " + "cannot be computed" ) ; } geomet... |
public class BaseBigtableInstanceAdminClient { /** * Updates an app profile within an instance .
* < p > Sample code :
* < pre > < code >
* try ( BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient . create ( ) ) {
* AppProfile appProfile = AppProfile . newBuilder (... | return updateAppProfileOperationCallable ( ) . futureCall ( request ) ; |
public class MinecraftTypeHelper { /** * Select the request variant of the Minecraft block , if applicable
* @ param state The block to be varied
* @ param colour The new variation
* @ return A new blockstate which is the requested variant of the original , if such a variant exists ; otherwise it returns the orig... | // Try the variant property first - if that fails , look for other properties that match the supplied variant .
boolean relaxRequirements = false ; for ( int i = 0 ; i < 2 ; i ++ ) { for ( IProperty prop : state . getProperties ( ) . keySet ( ) ) { if ( ( prop . getName ( ) . equals ( "variant" ) || relaxRequirements )... |
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1141:1 : conditionalOrExpression : conditionalAndExpression ( ' | | ' conditionalAndExpression ) * ; */
public final void conditionalOrExpression ( ) throws RecognitionException { } } | int conditionalOrExpression_StartIndex = input . index ( ) ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 111 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1142:5 : ( conditionalAndExpression ( ' | | ' conditionalAndExpression ) * )
/... |
public class GitFunction { /** * Add the names of the branches as children of the current node .
* @ param git the Git object ; may not be null
* @ param spec the call specification ; may not be null
* @ param writer the document writer for the current node ; may not be null
* @ throws GitAPIException if there ... | Set < String > remoteBranchPrefixes = remoteBranchPrefixes ( ) ; if ( remoteBranchPrefixes . isEmpty ( ) ) { // Generate the child references to the LOCAL branches , which will be sorted by name . . .
ListBranchCommand command = git . branchList ( ) ; List < Ref > branches = command . call ( ) ; // Reverse the sort of ... |
public class EncryptionNegotiateContext { /** * { @ inheritDoc }
* @ see jcifs . Encodable # encode ( byte [ ] , int ) */
@ Override public int encode ( byte [ ] dst , int dstIndex ) { } } | int start = dstIndex ; SMBUtil . writeInt2 ( this . ciphers != null ? this . ciphers . length : 0 , dst , dstIndex ) ; dstIndex += 2 ; if ( this . ciphers != null ) { for ( int cipher : this . ciphers ) { SMBUtil . writeInt2 ( cipher , dst , dstIndex ) ; dstIndex += 2 ; } } return dstIndex - start ; |
public class TraceHelper { /** * Get or build tracing . */
public static Tracing getTracing ( String serviceName , CurrentTraceContext context ) { } } | Tracing tracing = Tracing . current ( ) ; if ( tracing == null ) { // TODO reporter based on prop / config
tracing = getBuilder ( serviceName , context ) . build ( ) ; } return tracing ; |
public class DouglasPeucker { /** * compress list : move points into EMPTY slots */
void compressNew ( PointList points , int removed ) { } } | int freeIndex = - 1 ; for ( int currentIndex = 0 ; currentIndex < points . getSize ( ) ; currentIndex ++ ) { if ( Double . isNaN ( points . getLatitude ( currentIndex ) ) ) { if ( freeIndex < 0 ) freeIndex = currentIndex ; continue ; } else if ( freeIndex < 0 ) { continue ; } points . set ( freeIndex , points . getLati... |
public class AwsSecurityFindingFilters { /** * The state of the malware that was observed .
* @ param malwareState
* The state of the malware that was observed . */
public void setMalwareState ( java . util . Collection < StringFilter > malwareState ) { } } | if ( malwareState == null ) { this . malwareState = null ; return ; } this . malwareState = new java . util . ArrayList < StringFilter > ( malwareState ) ; |
public class DefaultJsonReader { /** * { @ inheritDoc } */
@ Override public void beginObject ( ) { } } | int p = peeked ; if ( p == PEEKED_NONE ) { p = doPeek ( ) ; } if ( p == PEEKED_BEGIN_OBJECT ) { push ( JsonScope . EMPTY_OBJECT ) ; peeked = PEEKED_NONE ; } else { throw new IllegalStateException ( "Expected BEGIN_OBJECT but was " + peek ( ) + " at line " + getLineNumber ( ) + " column " + getColumnNumber ( ) ) ; } |
public class UDPMulticastReceiver { /** * - - - CONNECT - - - */
@ Override protected void connect ( ) throws Exception { } } | // Start multicast receiver
multicastReceiver = new MulticastSocket ( udpPort ) ; multicastReceiver . setReuseAddress ( udpReuseAddr ) ; InetAddress inetAddress = InetAddress . getByName ( udpAddress ) ; if ( netIf == null ) { multicastReceiver . joinGroup ( inetAddress ) ; } else { InetSocketAddress socketAddress = ne... |
public class WsEchoServer { /** * Handle ` GET ` requests .
* @ param event the event
* @ param channel the channel
* @ throws InterruptedException the interrupted exception */
@ RequestHandler ( patterns = "/ws/echo" , priority = 100 ) public void onGet ( Request . In . Get event , IOSubchannel channel ) throws ... | final HttpRequest request = event . httpRequest ( ) ; if ( ! request . findField ( HttpField . UPGRADE , Converters . STRING_LIST ) . map ( f -> f . value ( ) . containsIgnoreCase ( "websocket" ) ) . orElse ( false ) ) { return ; } openChannels . add ( channel ) ; channel . respond ( new ProtocolSwitchAccepted ( event ... |
public class DRemoteTask { /** * Override for local completion */
private final void donCompletion ( CountedCompleter caller ) { } } | // Distributed completion
assert _lo == null || _lo . isDone ( ) ; assert _hi == null || _hi . isDone ( ) ; // Fold up results from left & right subtrees
if ( _lo != null ) reduce2 ( _lo . get ( ) ) ; if ( _hi != null ) reduce2 ( _hi . get ( ) ) ; if ( _local != null ) reduce2 ( _local ) ; // Note : in theory ( valid s... |
public class JsonSurfer { /** * Collect all matched value into a collection
* @ param inputStream Json reader
* @ param paths JsonPath
* @ return All matched value */
public Collection < Object > collectAll ( InputStream inputStream , JsonPath ... paths ) { } } | return collectAll ( inputStream , Object . class , paths ) ; |
public class EventLog { /** * / * ( non - Javadoc )
* @ see com . centurylink . mdw . common . service . Jsonable # getJson ( ) */
@ Override public JSONObject getJson ( ) throws JSONException { } } | JSONObject json = create ( ) ; json . put ( "id" , id ) ; if ( eventName != null ) json . put ( "eventName" , eventName ) ; if ( createDate != null ) { json . put ( "createDate" , createDate ) ; } if ( createUser != null ) { json . put ( "createUser" , createUser ) ; } if ( source != null ) { json . put ( "source" , so... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.