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 . * @ param newVersion The new database version . */ @ Override public void onUpgrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { } }
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 ( e ) , e ) ; }
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 empty . * @ return 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 empty . */ public java . util . List < String > getDiskIds ( ) { } }
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 ( String address , int port , String protocol ) { } }
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 ( '/' ) ; if ( index != - 1 ) { address = address . substring ( index + 1 ) ; } } if ( log . isDebugEnabled ( ) ) { log . debug ( "Creating connector for address='" + ( ( address == null ) ? "ALL" : address ) + "' port='" + port + "' protocol='" + protocol + "'" ) ; } try { if ( protocol . equals ( "ajp" ) ) { connector = new Connector ( "org.apache.jk.server.JkCoyoteHandler" ) ; } else if ( protocol . equals ( "memory" ) ) { connector = new Connector ( "org.apache.coyote.memory.MemoryProtocolHandler" ) ; } else if ( protocol . equals ( "http" ) ) { connector = new Connector ( ) ; } else if ( protocol . equals ( "https" ) ) { connector = new Connector ( ) ; connector . setScheme ( "https" ) ; connector . setSecure ( true ) ; connector . setProperty ( "SSLEnabled" , "true" ) ; } else { connector = new Connector ( protocol ) ; } if ( address != null ) { IntrospectionUtils . setProperty ( connector , "address" , "" + address ) ; } IntrospectionUtils . setProperty ( connector , "port" , "" + port ) ; } catch ( Exception e ) { log . error ( "Couldn't create connector." ) ; } return ( connector ) ;
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 ; } finally { }
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 ) / m_originalHeight ) ; m_formatForm . setWidthInput ( m_croppingParam . getTargetWidth ( ) ) ; } // in case the width and height parameter don ' t match the current format any longer , switch to user defined format if ( ( ! m_currentFormat . isHeightEditable ( ) || ( m_ratioLocked && ! m_currentFormat . isWidthEditable ( ) ) ) && hasUserFormatRestriction ( ) ) { m_formatForm . setFormatSelectValue ( m_userFormatKey ) ; } else { fireValueChangedEvent ( ) ; }
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 should be set in other caches caching this value . ( No effect on CoreCache ) */ @ Override public Object invalidateAndSet ( com . ibm . ws . cache . EntryInfo ei , Object value , boolean coordinate ) { } }
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 . getValue ( ) ; } } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " id=" + id + " value=" + value ) ; } return oldValue ;
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 new JMFSchemaIdException ( "Schema id clash: id=" + id ) ; } Object newAssoc = schema . getJMFType ( ) . getAssociation ( ) ; Object oldAssoc = reg . getJMFType ( ) . getAssociation ( ) ; if ( newAssoc != oldAssoc && newAssoc != null ) { if ( oldAssoc != null ) associations . remove ( oldAssoc ) ; reg . getJMFType ( ) . updateAssociations ( schema . getJMFType ( ) ) ; associations . put ( newAssoc , reg ) ; } return true ; } else return false ;
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 IllegalArgumentException if after is null or if after is last day of year ( December * 31st ) */ public static MonthDay randomMonthDayAfter ( MonthDay after , boolean includeLeapDay ) { } }
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 ( year + 1 ) . atDay ( 1 ) ; LocalDate localDate = randomLocalDate ( start , end ) ; return MonthDay . of ( localDate . getMonth ( ) , localDate . getDayOfMonth ( ) ) ;
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 * address * @ param dst the new KNX destination address for the message , use < code > null < / code > to use * original address * @ param original the original frame providing all missing information for the adjusted message * @ param extended < code > true < / code > to always created an extended frame , < code > false < / code > to * create type according to < code > original < / code > * @ return the new cEMI L - Data message adjusted with KNX addresses */ public static CEMILData create ( final IndividualAddress src , final KNXAddress dst , final CEMILData original , final boolean extended ) { } }
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 request * AuthorizationException : if there is any problem with the REST API authorization ( access token ) * ResourceNotFoundException : if the resource can not be found * ServiceUnavailableException : if the REST API service is not available ( possibly due to rate limiting ) * SmartsheetRestException : if there is any other REST API related error occurred during the operation * SmartsheetException : if there is any other error occurred during the operation * @ param sheetId the sheetId * @ param column the column to update limited to the following attributes : index ( column ' s new index in the sheet ) , * title , sheetId , type , options ( optional ) , symbol ( optional ) , systemColumnType ( optional ) , * autoNumberFormat ( optional ) * @ return the updated sheet ( note that if there is no such resource , this method will throw * ResourceNotFoundException rather than returning null ) . * @ throws SmartsheetException the smartsheet exception */ public Column updateColumn ( long sheetId , Column column ) throws SmartsheetException { } }
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 uninvertingMap the map to which the fields are added . */ @ Override public void addUninvertingMappings ( Map < String , Type > uninvertingMap ) { } }
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 < F > the type of first stream elements * @ param < S > the type of second stream elements * @ param < R > the type of elements in resulting stream * @ param stream1 the first stream * @ param stream2 the second stream * @ param combiner the combiner function used to apply to each element * @ return the new stream * @ throws NullPointerException if { @ code stream1 } or { @ code stream2 } is null */ @ NotNull public static < F , S , R > Stream < R > zip ( @ NotNull Stream < ? extends F > stream1 , @ NotNull Stream < ? extends S > stream2 , @ NotNull final BiFunction < ? super F , ? super S , ? extends R > combiner ) { } }
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 you ' d like to check if the points inside * @ return true if the Point is inside the MultiPolygon ; false if the Point is not inside the * MultiPolygon * @ see < a href = " http : / / turfjs . org / docs / # inside " > Turf Inside documentation < / a > * @ since 1.3.0 */ public static boolean inside ( Point point , MultiPolygon multiPolygon ) { } }
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 for the point in any of the holes while ( temp < polys . get ( i ) . size ( ) && ! inHole ) { if ( inRing ( point , polys . get ( i ) . get ( temp ) ) ) { inHole = true ; } temp ++ ; } if ( ! inHole ) { insidePoly = true ; } } } return insidePoly ;
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 commerceWishListItemService ) { } }
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 be escaped or not * @ return true if the character should be escaped */ private boolean shouldEscape ( StringBuilder content , int charPosition ) { } }
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 # withSourceUrl ( java . util . Collection ) } if you want to * override the existing values . * @ param sourceUrl * A URL that links to a page about the current finding in the security findings provider ' s solution . * @ return Returns a reference to this object so that method calls can be chained together . */ public AwsSecurityFindingFilters withSourceUrl ( StringFilter ... sourceUrl ) { } }
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 . toString ( stmt . getCost ( ) ) + "\n" ; s += "PLAN:\n\n" ; s += Encoder . hexDecodeToString ( stmt . getExplainplan ( ) ) + "\n" ; byte [ ] b = s . getBytes ( Constants . UTF8ENCODING ) ; retval . put ( proc . getTypeName ( ) + "_" + stmt . getTypeName ( ) + ".txt" , b ) ; } } return retval ;
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 events . This generally only applies to simple processes . If the process definition branches into * non - exclusive branches with distinct end events or the process potentially has multiple end events that are * reached , this method should not be used . * To test that a process ended in an end event and that particular end event was the final event reached , use * { @ link # assertProcessEndedAndReachedEndStateLast ( String , String ) } instead . * To assert that a process ended in an exact set of end events , use * { @ link # assertProcessEndedAndInEndEvents ( String , String . . . ) } instead . * @ see # assertProcessEndedAndReachedEndStateLast ( String , String ) * @ see # assertProcessEndedAndInEndEvents ( String , String . . . ) * @ param processInstanceId * the process instance ' s id to check for . May not be < code > null < / code > * @ param endEventId * the end event ' s id to check for . May not be < code > null < / code > */ public static void assertProcessEndedAndInExclusiveEndEvent ( final String processInstanceId , final String endEventId ) { } }
Validate . notNull ( processInstanceId ) ; Validate . notNull ( endEventId ) ; apiCallback . debug ( LogMessage . PROCESS_9 , processInstanceId , endEventId ) ; try { getEndEventAssertable ( ) . processEndedAndInExclusiveEndEvent ( processInstanceId , endEventId ) ; } catch ( final AssertionError ae ) { apiCallback . fail ( ae , LogMessage . ERROR_PROCESS_3 , processInstanceId , endEventId ) ; }
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 like this : * < pre > * Sample code : * this . setIcon ( BaseApplet . getSharedInstance ( ) . loadImageIcon ( " tour / buttons / Lookup . gif " , " Lookup " ) , CalendarConstants . START _ ICON + 1 ) ; * this . setIcon ( BaseApplet . getSharedInstance ( ) . loadImageIcon ( " tour / buttons / Price . gif " , " Price " ) , CalendarConstants . START _ ICON + 2 ) ; * this . setIcon ( BaseApplet . getSharedInstance ( ) . loadImageIcon ( " tour / buttons / Inventory . gif " , " Inventory " ) , CalendarConstants . START _ ICON + 3 ) ; * if ( application = = null ) * application = BaseApplet . getSharedInstance ( ) . getApplication ( ) ; * application . getTaskScheduler ( ) . addTask ( new DateChangeTask ( application , strParams , productItem , dateStart , dateEnd ) ) ; * < / pre > */ public void changeRemoteDate ( Application application , String strParams , CachedItem productItem , Date dateStart , Date dateEnd ) { } }
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 . setDaemon ( true ) ; background . start ( ) ;
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 first character must be a * lowercase letter , and all following characters must be a dash , lowercase letter , or digit , * except the last character , which cannot be a dash . * @ see < a href = " https : / / www . ietf . org / rfc / rfc1035 . txt " > RFC1035 < / a > */ public static SubnetworkId of ( String region , String subnetwork ) { } }
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 , final Appendable appendable ) throws IOException { } }
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 , appendable , nullFieldCounter ) ; nullFieldCounter = 0 ; cell . appendXMLToTableRow ( util , appendable ) ; } appendable . append ( "</table:table-row>" ) ;
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 { @ link Target } { @ link Specification } */ public static Specification < JpaTarget > hasTags ( final String [ ] tagNames , final Boolean selectTargetWithNoTag ) { } }
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 ) ; } @ Override public void update ( byte [ ] b , int off , int len ) { StreamingXXHash32 . this . update ( b , off , len ) ; } @ Override public String toString ( ) { return StreamingXXHash32 . this . toString ( ) ; } } ;
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 ( 12 , new ECB ( 1 , 12 ) ) ) , new Version ( 5 , 18 , 18 , 16 , 16 , new ECBlocks ( 14 , new ECB ( 1 , 18 ) ) ) , new Version ( 6 , 20 , 20 , 18 , 18 , new ECBlocks ( 18 , new ECB ( 1 , 22 ) ) ) , new Version ( 7 , 22 , 22 , 20 , 20 , new ECBlocks ( 20 , new ECB ( 1 , 30 ) ) ) , new Version ( 8 , 24 , 24 , 22 , 22 , new ECBlocks ( 24 , new ECB ( 1 , 36 ) ) ) , new Version ( 9 , 26 , 26 , 24 , 24 , new ECBlocks ( 28 , new ECB ( 1 , 44 ) ) ) , new Version ( 10 , 32 , 32 , 14 , 14 , new ECBlocks ( 36 , new ECB ( 1 , 62 ) ) ) , new Version ( 11 , 36 , 36 , 16 , 16 , new ECBlocks ( 42 , new ECB ( 1 , 86 ) ) ) , new Version ( 12 , 40 , 40 , 18 , 18 , new ECBlocks ( 48 , new ECB ( 1 , 114 ) ) ) , new Version ( 13 , 44 , 44 , 20 , 20 , new ECBlocks ( 56 , new ECB ( 1 , 144 ) ) ) , new Version ( 14 , 48 , 48 , 22 , 22 , new ECBlocks ( 68 , new ECB ( 1 , 174 ) ) ) , new Version ( 15 , 52 , 52 , 24 , 24 , new ECBlocks ( 42 , new ECB ( 2 , 102 ) ) ) , new Version ( 16 , 64 , 64 , 14 , 14 , new ECBlocks ( 56 , new ECB ( 2 , 140 ) ) ) , new Version ( 17 , 72 , 72 , 16 , 16 , new ECBlocks ( 36 , new ECB ( 4 , 92 ) ) ) , new Version ( 18 , 80 , 80 , 18 , 18 , new ECBlocks ( 48 , new ECB ( 4 , 114 ) ) ) , new Version ( 19 , 88 , 88 , 20 , 20 , new ECBlocks ( 56 , new ECB ( 4 , 144 ) ) ) , new Version ( 20 , 96 , 96 , 22 , 22 , new ECBlocks ( 68 , new ECB ( 4 , 174 ) ) ) , new Version ( 21 , 104 , 104 , 24 , 24 , new ECBlocks ( 56 , new ECB ( 6 , 136 ) ) ) , new Version ( 22 , 120 , 120 , 18 , 18 , new ECBlocks ( 68 , new ECB ( 6 , 175 ) ) ) , new Version ( 23 , 132 , 132 , 20 , 20 , new ECBlocks ( 62 , new ECB ( 8 , 163 ) ) ) , new Version ( 24 , 144 , 144 , 22 , 22 , new ECBlocks ( 62 , new ECB ( 8 , 156 ) , new ECB ( 2 , 155 ) ) ) , new Version ( 25 , 8 , 18 , 6 , 16 , new ECBlocks ( 7 , new ECB ( 1 , 5 ) ) ) , new Version ( 26 , 8 , 32 , 6 , 14 , new ECBlocks ( 11 , new ECB ( 1 , 10 ) ) ) , new Version ( 27 , 12 , 26 , 10 , 24 , new ECBlocks ( 14 , new ECB ( 1 , 16 ) ) ) , new Version ( 28 , 12 , 36 , 10 , 16 , new ECBlocks ( 18 , new ECB ( 1 , 22 ) ) ) , new Version ( 29 , 16 , 36 , 14 , 16 , new ECBlocks ( 24 , new ECB ( 1 , 32 ) ) ) , new Version ( 30 , 16 , 48 , 14 , 22 , new ECBlocks ( 28 , new ECB ( 1 , 49 ) ) ) } ;
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 JSON: " + e . getMessage ( ) , e ) ; }
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 AttributeNotFoundException ( "MBean " + objectName + " not found for attribute " + pAttribute ) ; exp . initCause ( e ) ; throw exp ; }
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 ( "_changes" ) . query ( query ) . build ( ) ;
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 ) + unboxCharOrLong ( arg2 , code2 ) ) ; } if ( maxcode <= FLOAT ) { return boxToFloat ( unboxCharOrFloat ( arg1 , code1 ) + unboxCharOrFloat ( arg2 , code2 ) ) ; } if ( maxcode <= DOUBLE ) { return boxToDouble ( unboxCharOrDouble ( arg1 , code1 ) + unboxCharOrDouble ( arg2 , code2 ) ) ; } throw new NoSuchMethodException ( ) ;
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 ( ) , migrationResource . getVersion ( ) ) ; } // remember the last version if ( ! resources . isEmpty ( ) ) { lastVersion = resources . get ( resources . size ( ) - 1 ) . getVersion ( ) ; }
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 ( language . equals ( "en" ) || language . charAt ( 0 ) > 't' ) { return LOC_ROOT ; } else if ( language . equals ( "tr" ) || language . equals ( "az" ) ) { return LOC_TURKISH ; } else if ( language . equals ( "el" ) ) { return LOC_GREEK ; } else if ( language . equals ( "lt" ) ) { return LOC_LITHUANIAN ; } else if ( language . equals ( "nl" ) ) { return LOC_DUTCH ; } } else if ( language . length ( ) == 3 ) { if ( language . equals ( "tur" ) || language . equals ( "aze" ) ) { return LOC_TURKISH ; } else if ( language . equals ( "ell" ) ) { return LOC_GREEK ; } else if ( language . equals ( "lit" ) ) { return LOC_LITHUANIAN ; } else if ( language . equals ( "nld" ) ) { return LOC_DUTCH ; } } return LOC_ROOT ;
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 void runExample ( AdWordsServicesInterface adWordsServices , AdWordsSession session ) throws RemoteException { } }
// Get the CampaignService . ManagedCustomerServiceInterface managedCustomerService = adWordsServices . get ( session , ManagedCustomerServiceInterface . class ) ; // Create account . ManagedCustomer customer = new ManagedCustomer ( ) ; customer . setName ( "Customer created with ManagedCustomerService on " + new DateTime ( ) ) ; customer . setCurrencyCode ( "EUR" ) ; customer . setDateTimeZone ( "Europe/London" ) ; // Create operations . ManagedCustomerOperation operation = new ManagedCustomerOperation ( ) ; operation . setOperand ( customer ) ; operation . setOperator ( Operator . ADD ) ; ManagedCustomerOperation [ ] operations = new ManagedCustomerOperation [ ] { operation } ; // Add account . ManagedCustomerReturnValue result = managedCustomerService . mutate ( operations ) ; // Display accounts . for ( ManagedCustomer customerResult : result . getValue ( ) ) { System . out . printf ( "Account with customer ID %d was created.%n" , customerResult . getCustomerId ( ) ) ; }
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 * not be null */ protected final void notifyOnAreaHidden ( @ NonNull final Area area ) { } }
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 void init ( ) { final IntList c = supplier . get ( ) ; if ( N . isNullOrEmpty ( c ) ) { iterator = IntIterator . empty ( ) ; } else { iterator = c . iterator ( ) ; } } } ; return of ( iter ) ;
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 field the field to find the definition of * @ return a { @ link GraphQLFieldDefinition } */ protected GraphQLFieldDefinition getFieldDef ( ExecutionContext executionContext , ExecutionStrategyParameters parameters , Field field ) { } }
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 ( ) ) { gitLabApi . setIgnoreCertificateErrors ( true ) ; } gitLabApi . defaultPerPage = this . defaultPerPage ; return ( gitLabApi ) ;
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 , pageable ) ; } } ) ; skipLinesAlreadyRead ( this . items ) ; } return this . items . hasNext ( ) ? this . items . next ( ) : null ;
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 . com / doc / developers / rest - api / " > https : / / www . apruve . com / doc / developers / rest - api / < / a > * @ return Subscription , or null if not found */ public static ApruveResponse < SubscriptionAdjustment > get ( String subscriptionId , String adjustmentId ) { } }
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 familyId ) { } }
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 , ConcurrencyConfiguration concurrencyConfiguration , boolean parallelStream ) { } }
if ( parallelStream && concurrencyConfiguration . isParallelized ( ) ) { try { ForkJoinPool pool = new ForkJoinPool ( concurrencyConfiguration . getMaxNumberOfThreadsPerTask ( ) ) ; T results = pool . submit ( callable ) . get ( ) ; pool . shutdown ( ) ; return results ; } catch ( InterruptedException | ExecutionException ex ) { throw new RuntimeException ( ex ) ; } } else { try { return callable . call ( ) ; } catch ( Exception ex ) { throw new RuntimeException ( ex ) ; } }
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: " + e . getMessage ( ) , e ) ; }
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 will * be found and returned * @ return { @ link PDF417DetectorResult } encapsulating results of detecting a PDF417 code * @ throws NotFoundException if no PDF417 Code can be found */ public static PDF417DetectorResult detect ( BinaryBitmap image , Map < DecodeHintType , ? > hints , boolean multiple ) throws NotFoundException { } }
// 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 [ ] > barcodeCoordinates = detect ( multiple , bitMatrix ) ; if ( barcodeCoordinates . isEmpty ( ) ) { bitMatrix = bitMatrix . clone ( ) ; bitMatrix . rotate180 ( ) ; barcodeCoordinates = detect ( multiple , bitMatrix ) ; } return new PDF417DetectorResult ( bitMatrix , barcodeCoordinates ) ;
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 levelName ) { } }
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 } found * @ return a { @ code double } array , { @ code null } if null array input */ public static double [ ] unbox ( final Double [ ] a , final double valueForNull ) { } }
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 . toArray ( new String [ split . size ( ) ] ) ; } }
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 NoSuchCPMeasurementUnitException if a cp measurement unit with the primary key could not be found */ @ Override public CPMeasurementUnit remove ( Serializable primaryKey ) throws NoSuchCPMeasurementUnitException { } }
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 ) ; } throw new NoSuchCPMeasurementUnitException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } return remove ( cpMeasurementUnit ) ; } catch ( NoSuchCPMeasurementUnitException nsee ) { throw nsee ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; }
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 . */ public int read ( char [ ] cbuf , int off , int len ) throws IOException { } }
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 > FileItemStream < / code > parsed from * the request , in the order that they were transmitted . * @ throws FileUploadException * if there are problems reading / parsing the request or storing files . * @ throws IOException * An I / O error occurred . This may be a network error while * communicating with the client or a problem while storing the * uploaded content . */ @ Nonnull public IFileItemIterator getItemIterator ( @ Nonnull final IRequestContext aCtx ) throws FileUploadException , IOException { } }
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 postMethodInvocation ( Method method , Object [ ] arguments , Object output ) { } }
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 set * @ param property The property name that will be set . This means that there is a setter public method defined for the * object instance * @ param propertyValue The new value for the property that will be set * @ throws WBSerializerException If the object property was not set with success */ public void setObjectProperty ( Object object , String property , Object propertyValue ) throws WPBSerializerException { } }
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 object" , e ) ; }
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 twice {}" , name ( ) ) ; return ; } long sleepMs = getSleepTimeMs ( ) ; LOG . info ( "Reconnect ... [{}], {}, sleep {}ms" , retries . get ( ) , name , sleepMs ) ; ChannelFuture future = bootstrap . connect ( remoteAddr ) ; future . addListener ( new ChannelFutureListener ( ) { public void operationComplete ( ChannelFuture future ) throws Exception { isConnecting . set ( false ) ; Channel channel = future . getChannel ( ) ; if ( future . isSuccess ( ) ) { // do something else LOG . info ( "Connection established, channel = :{}" , channel ) ; setChannel ( channel ) ; // handleResponse ( ) ; BATCH_THRESHOLD_WARN = ConfigExtension . getNettyBufferThresholdSize ( stormConf ) ; // Check if any pending message /* synchronized ( writeLock ) { if ( channel ! = null & & messageBuffer . size ( ) > 0 ) { MessageBatch messageBatch = messageBuffer . drain ( ) ; flushRequest ( channel , messageBatch ) ; } else { LOG . warn ( " Failed to flush pending message after reconnecting , channel = { } , messageBuffer . size = { } " , channel , messageBuffer . size ( ) ) ; */ } else { if ( ! isClosed ( ) ) { LOG . info ( "Failed to reconnect ... [{}], {}, channel = {}, cause = {}" , retries . get ( ) , name , channel , future . getCause ( ) ) ; reconnect ( ) ; } } } } ) ; JStormUtils . sleepMs ( sleepMs ) ;
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 position bounds for footer items [ 0 - " // + ( newFooterItemCount - 1 ) + " ] . " ) ; notifyItemInserted ( position + newHeaderItemCount + newContentItemCount ) ;
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 ( input , EOF , FollowSets000 . FOLLOW_2 ) ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return ;
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 ) * @ return Envelope of the table * @ throws SQLException If the table not exists , empty or does not contain a geometry field . */ public static Envelope getTableEnvelope ( Connection connection , TableLocation location , String geometryField ) throws SQLException { } }
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" ) ; } geometryField = geometryFields . get ( 0 ) ; } ResultSet rs = connection . createStatement ( ) . executeQuery ( "SELECT ST_Extent(" + TableLocation . quoteIdentifier ( geometryField ) + ") ext FROM " + location ) ; if ( rs . next ( ) ) { // Todo under postgis it is a BOX type return ( ( Geometry ) rs . getObject ( 1 ) ) . getEnvelopeInternal ( ) ; } throw new SQLException ( "Unable to get the table extent it may be empty" ) ;
public class BaseBigtableInstanceAdminClient { /** * Updates an app profile within an instance . * < p > Sample code : * < pre > < code > * try ( BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient = BaseBigtableInstanceAdminClient . create ( ) ) { * AppProfile appProfile = AppProfile . newBuilder ( ) . build ( ) ; * FieldMask updateMask = FieldMask . newBuilder ( ) . build ( ) ; * UpdateAppProfileRequest request = UpdateAppProfileRequest . newBuilder ( ) * . setAppProfile ( appProfile ) * . setUpdateMask ( updateMask ) * . build ( ) ; * AppProfile response = baseBigtableInstanceAdminClient . updateAppProfileAsync ( request ) . get ( ) ; * < / code > < / pre > * @ param request The request object containing all of the parameters for the API call . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi ( "The surface for long-running operations is not stable yet and may change in the future." ) public final OperationFuture < AppProfile , UpdateAppProfileMetadata > updateAppProfileAsync ( UpdateAppProfileRequest request ) { } }
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 original block . */ static IBlockState applyVariant ( IBlockState state , Variation variant ) { } }
// 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 ) && prop . getValueClass ( ) . isEnum ( ) ) { Object [ ] values = prop . getValueClass ( ) . getEnumConstants ( ) ; for ( Object obj : values ) { if ( obj != null && obj . toString ( ) . equalsIgnoreCase ( variant . getValue ( ) ) ) { return state . withProperty ( prop , ( Comparable ) obj ) ; } } } } relaxRequirements = true ; // Failed to set the variant , so try again with other properties . } return state ;
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 ) * ) // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1142:9 : conditionalAndExpression ( ' | | ' conditionalAndExpression ) * { pushFollow ( FOLLOW_conditionalAndExpression_in_conditionalOrExpression5074 ) ; conditionalAndExpression ( ) ; state . _fsp -- ; if ( state . failed ) return ; // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1142:34 : ( ' | | ' conditionalAndExpression ) * loop143 : while ( true ) { int alt143 = 2 ; int LA143_0 = input . LA ( 1 ) ; if ( ( LA143_0 == 124 ) ) { alt143 = 1 ; } switch ( alt143 ) { case 1 : // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1142:36 : ' | | ' conditionalAndExpression { match ( input , 124 , FOLLOW_124_in_conditionalOrExpression5078 ) ; if ( state . failed ) return ; pushFollow ( FOLLOW_conditionalAndExpression_in_conditionalOrExpression5080 ) ; conditionalAndExpression ( ) ; state . _fsp -- ; if ( state . failed ) return ; } break ; default : break loop143 ; } } } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { // do for sure before leaving if ( state . backtracking > 0 ) { memoize ( input , 111 , conditionalOrExpression_StartIndex ) ; } }
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 is a problem accessing the Git repository */ protected void addBranchesAsChildren ( Git git , CallSpecification spec , DocumentWriter writer ) throws GitAPIException { } }
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 the branch names , since they might be version numbers . . . Collections . sort ( branches , REVERSE_REF_COMPARATOR ) ; for ( Ref ref : branches ) { String name = ref . getName ( ) ; name = name . replace ( GitFunction . LOCAL_BRANCH_PREFIX , "" ) ; writer . addChild ( spec . childId ( name ) , name ) ; } return ; } // There is at least one REMOTE branch , so generate the child references to the REMOTE branches , // which will be sorted by name ( by the command ) . . . ListBranchCommand command = git . branchList ( ) ; command . setListMode ( ListMode . REMOTE ) ; List < Ref > branches = command . call ( ) ; // Reverse the sort of the branch names , since they might be version numbers . . . Collections . sort ( branches , REVERSE_REF_COMPARATOR ) ; Set < String > uniqueNames = new HashSet < String > ( ) ; for ( Ref ref : branches ) { String name = ref . getName ( ) ; if ( uniqueNames . contains ( name ) ) continue ; // We only want the branch if it matches one of the listed remotes . . . boolean skip = false ; for ( String remoteBranchPrefix : remoteBranchPrefixes ) { if ( name . startsWith ( remoteBranchPrefix ) ) { // Remove the prefix . . . name = name . replaceFirst ( remoteBranchPrefix , "" ) ; break ; } // Otherwise , it ' s a remote branch from a different remote that we don ' t want . . . skip = true ; } if ( skip ) continue ; if ( uniqueNames . add ( name ) ) writer . addChild ( spec . childId ( name ) , name ) ; }
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 . getLatitude ( currentIndex ) , points . getLongitude ( currentIndex ) , points . getElevation ( currentIndex ) ) ; points . set ( currentIndex , Double . NaN , Double . NaN , Double . NaN ) ; // find next free index int max = currentIndex ; int searchIndex = freeIndex + 1 ; freeIndex = currentIndex ; for ( ; searchIndex < max ; searchIndex ++ ) { if ( Double . isNaN ( points . getLatitude ( searchIndex ) ) ) { freeIndex = searchIndex ; break ; } } } points . trimToSize ( points . getSize ( ) - removed ) ;
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 = new InetSocketAddress ( inetAddress , udpPort ) ; try { multicastReceiver . joinGroup ( socketAddress , netIf ) ; } catch ( Exception unsupportedAddress ) { disconnect ( ) ; return ; } } // Start thread super . connect ( ) ; // Log String msg = "Multicast discovery service started on udp://" + udpAddress + ':' + udpPort ; if ( netIf == null ) { logger . info ( msg + '.' ) ; } else { logger . info ( msg + " (" + netIf . getDisplayName ( ) + ")." ) ; }
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 InterruptedException { } }
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 , "websocket" ) ) ; event . stop ( ) ;
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 semantics ) we could push these " over the wire " // and block for them as we ' re blocking for the top - level initial split . // However , that would require sending " isDone " flags over the wire also . // MUCH simpler to just block for them all now , and send over the empty set // of not - yet - blocked things . if ( _local != null && _local . _fs != null ) _local . _fs . blockForPending ( ) ; // Block on all other pending tasks , also _keys = null ; // Do not return _ keys over wire if ( _top_level ) postGlobal ( ) ;
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" , source ) ; } if ( category != null ) { json . put ( "category" , category ) ; } if ( subCategory != null ) { json . put ( "subCategory" , subCategory ) ; } if ( ownerType != null ) { json . put ( "ownerType" , ownerType ) ; } if ( ownerId != null ) { json . put ( "ownerId" , ownerId ) ; } if ( comment != null ) { json . put ( "comment" , comment ) ; } return json ;