signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class ConfigImpl { /** * Initializes and returns the base URI specified by the " baseUrl " property
* in the server - side config JavaScript
* @ param cfg
* the parsed config JavaScript
* @ return the base URI
* @ throws URISyntaxException */
protected Location loadBaseURI ( Scriptable cfg ) throws URISyntaxException { } }
|
Object baseObj = cfg . get ( BASEURL_CONFIGPARAM , cfg ) ; Location result ; if ( baseObj == Scriptable . NOT_FOUND ) { result = new Location ( getConfigUri ( ) . resolve ( "." ) ) ; // $ NON - NLS - 1 $
} else { Location loc = loadLocation ( baseObj , true ) ; Location configLoc = new Location ( getConfigUri ( ) , loc . getOverride ( ) != null ? getConfigUri ( ) : null ) ; result = configLoc . resolve ( loc ) ; } return result ;
|
public class HtmlBaseTag { /** * Sets the onMouseOver javascript event .
* @ param onmouseover the onMouseOver event .
* @ jsptagref . attributedescription The onMouseOver JavaScript event .
* @ jsptagref . databindable false
* @ jsptagref . attributesyntaxvalue < i > string _ onMouseOver < / i >
* @ netui : attribute required = " false " rtexprvalue = " true "
* description = " The onMouseOver JavaScript event . " */
public void setOnMouseOver ( String onmouseover ) { } }
|
AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONMOUSEOVER , onmouseover ) ;
|
public class Import { /** * helper : create a new KeyValue based on CF rename map */
private static Cell convertKv ( Cell kv , Map < byte [ ] , byte [ ] > cfRenameMap ) { } }
|
if ( cfRenameMap != null ) { // If there ' s a rename mapping for this CF , create a new KeyValue
byte [ ] newCfName = cfRenameMap . get ( CellUtil . cloneFamily ( kv ) ) ; if ( newCfName != null ) { kv = new KeyValue ( kv . getRowArray ( ) , // row buffer
kv . getRowOffset ( ) , // row offset
kv . getRowLength ( ) , // row length
newCfName , // CF buffer
0 , // CF offset
newCfName . length , // CF length
kv . getQualifierArray ( ) , // qualifier buffer
kv . getQualifierOffset ( ) , // qualifier offset
kv . getQualifierLength ( ) , // qualifier length
kv . getTimestamp ( ) , // timestamp
KeyValue . Type . codeToType ( kv . getTypeByte ( ) ) , // KV Type
kv . getValueArray ( ) , // value buffer
kv . getValueOffset ( ) , // value offset
kv . getValueLength ( ) ) ; // value length
} } return kv ;
|
public class DublinCoreMetadata { /** * Get the column from the row for the Dublin Core Type term
* @ param row
* user row
* @ param type
* Dublin Core Type
* @ param < T >
* column type
* @ return column */
public static < T extends UserColumn > T getColumn ( UserCoreRow < T , ? > row , DublinCoreType type ) { } }
|
return getColumn ( row . getTable ( ) , type ) ;
|
public class MessageProcessor { /** * @ parm key
* @ parm command handler */
public void registerCommandHandler ( String key , CommandHandler handler ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "registerCommandHandler" , new Object [ ] { key , handler } ) ; // Add handler to table
// Note that if there was already a handler with this key it ' s table
// entry will
// be overwritten
synchronized ( _registeredHandlers ) { _registeredHandlers . put ( key , handler ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerCommandHandler" ) ;
|
public class RegionDiskTypeClient { /** * Retrieves a list of regional disk types available to the specified project .
* < p > Sample code :
* < pre > < code >
* try ( RegionDiskTypeClient regionDiskTypeClient = RegionDiskTypeClient . create ( ) ) {
* ProjectRegionName region = ProjectRegionName . of ( " [ PROJECT ] " , " [ REGION ] " ) ;
* for ( DiskType element : regionDiskTypeClient . listRegionDiskTypes ( region . toString ( ) ) . iterateAll ( ) ) {
* / / doThingsWith ( element ) ;
* < / code > < / pre >
* @ param region The name of the region for this request .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final ListRegionDiskTypesPagedResponse listRegionDiskTypes ( String region ) { } }
|
ListRegionDiskTypesHttpRequest request = ListRegionDiskTypesHttpRequest . newBuilder ( ) . setRegion ( region ) . build ( ) ; return listRegionDiskTypes ( request ) ;
|
public class ByteBufferHashTable { /** * Finds the bucket into which we should insert a key .
* @ param keyBuffer key , must have exactly keySize bytes remaining . Will not be modified .
* @ param targetTableBuffer Need selectable buffer , since when resizing hash table ,
* findBucket ( ) is used on the newly allocated table buffer
* @ return bucket index for this key , or - 1 if no bucket is available due to being full */
protected int findBucket ( final boolean allowNewBucket , final int buckets , final ByteBuffer targetTableBuffer , final ByteBuffer keyBuffer , final int keyHash ) { } }
|
// startBucket will never be negative since keyHash is always positive ( see Groupers . hash )
final int startBucket = keyHash % buckets ; int bucket = startBucket ; outer : while ( true ) { final int bucketOffset = bucket * bucketSizeWithHash ; if ( ( targetTableBuffer . get ( bucketOffset ) & 0x80 ) == 0 ) { // Found unused bucket before finding our key
return allowNewBucket ? bucket : - 1 ; } for ( int i = bucketOffset + HASH_SIZE , j = keyBuffer . position ( ) ; j < keyBuffer . position ( ) + keySize ; i ++ , j ++ ) { if ( targetTableBuffer . get ( i ) != keyBuffer . get ( j ) ) { bucket += 1 ; if ( bucket == buckets ) { bucket = 0 ; } if ( bucket == startBucket ) { // Came back around to the start without finding a free slot , that was a long trip !
// Should never happen unless buckets = = regrowthThreshold .
return - 1 ; } continue outer ; } } // Found our key in a used bucket
return bucket ; }
|
public class ComponentExposedTypeGenerator { /** * Add a method to the ExposedType proto . This allows referencing them as this . _ _ proto _ _ . myMethod
* to pass them to Vue . js . This way of referencing works both in GWT2 and Closure . The method MUST
* have the @ JsMethod annotation for this to work . */
private String addNewMethodToProto ( ) { } }
|
String methodName = METHOD_IN_PROTO_PREFIX + methodsInProtoCount ; addMethodToProto ( methodName ) ; methodsInProtoCount ++ ; return methodName ;
|
public class Canvas { /** * Draws a scaled image at the specified location { @ code ( x , y ) } size { @ code ( w x h ) } . */
public Canvas draw ( Drawable image , float x , float y , float w , float h ) { } }
|
image . draw ( gc ( ) , x , y , w , h ) ; isDirty = true ; return this ;
|
public class Filters { /** * The Channel to use as a filter for the metrics returned . Only VOICE is supported .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setChannels ( java . util . Collection ) } or { @ link # withChannels ( java . util . Collection ) } if you want to override
* the existing values .
* @ param channels
* The Channel to use as a filter for the metrics returned . Only VOICE is supported .
* @ return Returns a reference to this object so that method calls can be chained together .
* @ see Channel */
public Filters withChannels ( String ... channels ) { } }
|
if ( this . channels == null ) { setChannels ( new java . util . ArrayList < String > ( channels . length ) ) ; } for ( String ele : channels ) { this . channels . add ( ele ) ; } return this ;
|
public class Scope { /** * Specifies the parent scope for this scope .
* If a scope cannot resolve a variable , it tries to resolve it using its parent scope . This permits to
* share a certain set of variables .
* @ param parent the parent scope to use . If < tt > null < / tt > , the common root scope is used which defines a bunch of
* constants ( e and pi ) .
* @ return the instance itself for fluent method calls */
public Scope withParent ( Scope parent ) { } }
|
if ( parent == null ) { this . parent = getRootScope ( ) ; } else { this . parent = parent ; } return this ;
|
public class BDBMap { /** * retrieve the value assoicated with keyStr from persistant storage
* @ param keyStr
* @ return String value associated with key , or null if no key is found
* or an error occurs */
public String get ( String keyStr ) { } }
|
String result = null ; try { DatabaseEntry key = new DatabaseEntry ( keyStr . getBytes ( "UTF-8" ) ) ; DatabaseEntry data = new DatabaseEntry ( ) ; if ( db . get ( null , key , data , LockMode . DEFAULT ) == OperationStatus . SUCCESS ) { byte [ ] bytes = data . getData ( ) ; result = new String ( bytes , "UTF-8" ) ; } } catch ( DatabaseException e ) { e . printStackTrace ( ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; } return result ;
|
public class AsyncJob { /** * Executes the provided code immediately on a background thread that will be submitted to the
* provided ExecutorService
* @ param onBackgroundJob Interface that wraps the code to execute
* @ param executor Will queue the provided code */
public static FutureTask doInBackground ( final OnBackgroundJob onBackgroundJob , ExecutorService executor ) { } }
|
FutureTask task = ( FutureTask ) executor . submit ( new Runnable ( ) { @ Override public void run ( ) { onBackgroundJob . doOnBackground ( ) ; } } ) ; return task ;
|
public class LasCellsTable { /** * Insert cell values in the table
* @ throws Exception */
public static void insertLasCell ( ASpatialDb db , int srid , LasCell cell ) throws Exception { } }
|
String sql = "INSERT INTO " + TABLENAME + " (" + COLUMN_GEOM + "," + COLUMN_SOURCE_ID + "," + COLUMN_POINTS_COUNT + "," + COLUMN_AVG_ELEV + "," + COLUMN_MIN_ELEV + "," + COLUMN_MAX_ELEV + "," + COLUMN_POSITION_BLOB + "," + COLUMN_AVG_INTENSITY + "," + COLUMN_MIN_INTENSITY + "," + COLUMN_MAX_INTENSITY + "," + COLUMN_INTENS_CLASS_BLOB + "," + COLUMN_RETURNS_BLOB + "," + COLUMN_MIN_GPSTIME + "," + COLUMN_MAX_GPSTIME + "," + COLUMN_GPSTIME_BLOB + "," + COLUMN_COLORS_BLOB + ") VALUES (ST_GeomFromText(?, " + srid + "),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)" ; db . execOnConnection ( connection -> { try ( IHMPreparedStatement pStmt = connection . prepareStatement ( sql ) ) { int i = 1 ; pStmt . setString ( i ++ , cell . polygon . toText ( ) ) ; pStmt . setLong ( i ++ , cell . sourceId ) ; pStmt . setInt ( i ++ , cell . pointsCount ) ; pStmt . setDouble ( i ++ , cell . avgElev ) ; pStmt . setDouble ( i ++ , cell . minElev ) ; pStmt . setDouble ( i ++ , cell . maxElev ) ; pStmt . setBytes ( i ++ , cell . xyzs ) ; pStmt . setShort ( i ++ , cell . avgIntensity ) ; pStmt . setShort ( i ++ , cell . minIntensity ) ; pStmt . setShort ( i ++ , cell . maxIntensity ) ; pStmt . setBytes ( i ++ , cell . intensitiesClassifications ) ; pStmt . setBytes ( i ++ , cell . returns ) ; pStmt . setDouble ( i ++ , cell . minGpsTime ) ; pStmt . setDouble ( i ++ , cell . maxGpsTime ) ; pStmt . setBytes ( i ++ , cell . gpsTimes ) ; pStmt . setBytes ( i ++ , cell . colors ) ; pStmt . executeUpdate ( ) ; } return null ; } ) ;
|
public class AddressManager { /** * Get the address to which the passed in message should be sent to .
* This can be an address contained in the { @ link RoutingTable } , or a
* multicast address calculated from the header content of the message .
* @ param message the message for which we want to find an address to send it to .
* @ return the address to send the message to . Will not be null , because if an address can ' t be determined an exception is thrown .
* @ throws JoynrMessageNotSentException if no address can be determined / found for the given message . */
public Set < Address > getAddresses ( ImmutableMessage message ) { } }
|
Set < Address > result = new HashSet < > ( ) ; String toParticipantId = message . getRecipient ( ) ; if ( Message . VALUE_MESSAGE_TYPE_MULTICAST . equals ( message . getType ( ) ) ) { handleMulticastMessage ( message , result ) ; } else if ( toParticipantId != null && routingTable . containsKey ( toParticipantId ) ) { Address address = routingTable . get ( toParticipantId ) ; if ( address != null ) { result . add ( address ) ; } } logger . trace ( "Found the following addresses for {}: {}" , new Object [ ] { message , result } ) ; return result ;
|
public class DRL6Expressions { /** * $ ANTLR start synpred2 _ DRL6Expressions */
public final void synpred2_DRL6Expressions_fragment ( ) throws RecognitionException { } }
|
// src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 138:44 : ( LEFT _ SQUARE RIGHT _ SQUARE )
// src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 138:45 : LEFT _ SQUARE RIGHT _ SQUARE
{ match ( input , LEFT_SQUARE , FOLLOW_LEFT_SQUARE_in_synpred2_DRL6Expressions559 ) ; if ( state . failed ) return ; match ( input , RIGHT_SQUARE , FOLLOW_RIGHT_SQUARE_in_synpred2_DRL6Expressions561 ) ; if ( state . failed ) return ; }
|
public class AuditorModuleConfig { /** * Set the hostname and port of the target audit repository from
* a well - formed URI
* @ param uri URI containing the hostname and port to set */
public void setAuditRepositoryUri ( URI uri ) { } }
|
setAuditRepositoryHost ( uri . getHost ( ) ) ; setAuditRepositoryPort ( uri . getPort ( ) ) ; setAuditRepositoryTransport ( uri . getScheme ( ) ) ;
|
public class ManagedInstanceVulnerabilityAssessmentsInner { /** * Creates or updates the managed instance ' s vulnerability assessment .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param managedInstanceName The name of the managed instance for which the vulnerability assessment is defined .
* @ param parameters The requested resource .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the ManagedInstanceVulnerabilityAssessmentInner object if successful . */
public ManagedInstanceVulnerabilityAssessmentInner createOrUpdate ( String resourceGroupName , String managedInstanceName , ManagedInstanceVulnerabilityAssessmentInner parameters ) { } }
|
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , managedInstanceName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class HtmlGroupBaseTag { /** * Sets the default value ( can be an expression ) .
* @ param defaultValue the default value
* @ jsptagref . attributedescription The String literal or expression to be used as the default value .
* @ jsptagref . databindable false
* @ jsptagref . attributesyntaxvalue < i > string _ or _ expression _ default < / i >
* @ netui : attribute required = " false " rtexprvalue = " true "
* description = " The String literal or expression to be used as the default value . " */
public void setDefaultValue ( Object defaultValue ) throws JspException { } }
|
if ( defaultValue == null ) { String s = Bundle . getString ( "Tags_AttrValueRequired" , new Object [ ] { "defaultValue" } ) ; registerTagError ( s , null ) ; return ; } _defaultValue = defaultValue ;
|
public class PropertyObjectResolver { @ Override public Object resolveForObjectAndContext ( Object self , Context context ) { } }
|
return ReflectionUtils . getField ( self , this . propertyName ) ;
|
public class DateTime { /** * Returns the suffix or " units " of the duration as a string . The result will
* be ms , s , m , h , d , w , n or y .
* @ param duration The duration in the format # units , e . g . 1d or 6h
* @ return Just the suffix , e . g . ' d ' or ' h '
* @ throws IllegalArgumentException if the duration is null , empty or if
* the units are invalid .
* @ since 2.4 */
public static final String getDurationUnits ( final String duration ) { } }
|
if ( duration == null || duration . isEmpty ( ) ) { throw new IllegalArgumentException ( "Duration cannot be null or empty" ) ; } int unit = 0 ; while ( unit < duration . length ( ) && Character . isDigit ( duration . charAt ( unit ) ) ) { unit ++ ; } final String units = duration . substring ( unit ) . toLowerCase ( ) ; if ( units . equals ( "ms" ) || units . equals ( "s" ) || units . equals ( "m" ) || units . equals ( "h" ) || units . equals ( "d" ) || units . equals ( "w" ) || units . equals ( "n" ) || units . equals ( "y" ) ) { return units ; } throw new IllegalArgumentException ( "Invalid units in the duration: " + units ) ;
|
public class CommerceAvailabilityEstimateLocalServiceBaseImpl { /** * Returns the number of rows matching the dynamic query .
* @ param dynamicQuery the dynamic query
* @ param projection the projection to apply to the query
* @ return the number of rows matching the dynamic query */
@ Override public long dynamicQueryCount ( DynamicQuery dynamicQuery , Projection projection ) { } }
|
return commerceAvailabilityEstimatePersistence . countWithDynamicQuery ( dynamicQuery , projection ) ;
|
public class StringUtils { /** * Computes the Levenshtein ( edit ) distance of the two given Strings .
* This method doesn ' t allow transposition , so one character transposed between two strings has a cost of 2 ( one insertion , one deletion ) .
* The EditDistance class also implements the Levenshtein distance , but does allow transposition . */
public static int editDistance ( String s , String t ) { } }
|
// Step 1
int n = s . length ( ) ; // length of s
int m = t . length ( ) ; // length of t
if ( n == 0 ) { return m ; } if ( m == 0 ) { return n ; } int [ ] [ ] d = new int [ n + 1 ] [ m + 1 ] ; // matrix
// Step 2
for ( int i = 0 ; i <= n ; i ++ ) { d [ i ] [ 0 ] = i ; } for ( int j = 0 ; j <= m ; j ++ ) { d [ 0 ] [ j ] = j ; } // Step 3
for ( int i = 1 ; i <= n ; i ++ ) { char s_i = s . charAt ( i - 1 ) ; // ith character of s
// Step 4
for ( int j = 1 ; j <= m ; j ++ ) { char t_j = t . charAt ( j - 1 ) ; // jth character of t
// Step 5
int cost ; // cost
if ( s_i == t_j ) { cost = 0 ; } else { cost = 1 ; } // Step 6
d [ i ] [ j ] = SloppyMath . min ( d [ i - 1 ] [ j ] + 1 , d [ i ] [ j - 1 ] + 1 , d [ i - 1 ] [ j - 1 ] + cost ) ; } } // Step 7
return d [ n ] [ m ] ;
|
public class FileUploaderEndpoint { /** * optional - Process uploaded file ( s ) depending on the specified technology . Default value is ' false ' */
protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { } }
|
String tech = request . getParameter ( PARAMETER_TECH ) ; String workspaceId = request . getParameter ( PARAMETER_WORKSPACE ) ; // specify the unique workspace directory to upload the file ( s ) to .
Collection < Part > filePartCollection = request . getParts ( ) ; String serverHostPort = request . getRequestURL ( ) . toString ( ) . replace ( request . getRequestURI ( ) , "" ) ; int schemeLength = request . getScheme ( ) . toString ( ) . length ( ) ; String internalHostPort = "http" + serverHostPort . substring ( schemeLength ) ; log . log ( Level . FINER , "serverHostPort : " + serverHostPort ) ; final ServiceConnector serviceConnector = new ServiceConnector ( serverHostPort , internalHostPort ) ; HashMap < Part , String > fileNames = new HashMap < Part , String > ( ) ; if ( ! isValidRequest ( request , response , tech , workspaceId , filePartCollection , serviceConnector , fileNames ) ) { return ; } Service techService = serviceConnector . getServiceObjectFromId ( tech ) ; String techDirPath = StarterUtil . getWorkspaceDir ( workspaceId ) + "/" + techService . getId ( ) ; File techDir = new File ( techDirPath ) ; if ( techDir . exists ( ) && techDir . isDirectory ( ) && "true" . equalsIgnoreCase ( request . getParameter ( PARAMETER_CLEANUP ) ) ) { FileUtils . cleanDirectory ( techDir ) ; log . log ( Level . FINER , "Cleaned up tech workspace directory : " + techDirPath ) ; } for ( Part filePart : filePartCollection ) { if ( ! techDir . exists ( ) ) { FileUtils . forceMkdir ( techDir ) ; log . log ( Level . FINER , "Created tech directory :" + techDirPath ) ; } String filePath = techDirPath + "/" + fileNames . get ( filePart ) ; log . log ( Level . FINER , "File path : " + filePath ) ; File uploadedFile = new File ( filePath ) ; Files . copy ( filePart . getInputStream ( ) , uploadedFile . toPath ( ) , StandardCopyOption . REPLACE_EXISTING ) ; log . log ( Level . FINE , "Copied file to " + filePath ) ; } if ( "true" . equalsIgnoreCase ( request . getParameter ( PARAMETER_PROCESS ) ) ) { // Process uploaded file ( s )
String processResult = serviceConnector . processUploadedFiles ( techService , techDirPath ) ; if ( ! processResult . equalsIgnoreCase ( "success" ) ) { log . log ( Level . INFO , "Error processing the files uploaded to " + techDirPath + " : Result=" + processResult ) ; response . sendError ( 500 , processResult ) ; return ; } log . log ( Level . FINE , "Processed the files uploaded to " + techDirPath ) ; } response . setContentType ( "text/html" ) ; PrintWriter out = response . getWriter ( ) ; out . println ( "success" ) ; out . close ( ) ;
|
public class DeviceTypesApi { /** * Get manifest properties
* Get a Device Type & # 39 ; s manifest properties for a specific version .
* @ param deviceTypeId Device Type ID . ( required )
* @ param version Manifest Version . ( required )
* @ return ApiResponse & lt ; ManifestPropertiesEnvelope & gt ;
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */
public ApiResponse < ManifestPropertiesEnvelope > getManifestPropertiesWithHttpInfo ( String deviceTypeId , String version ) throws ApiException { } }
|
com . squareup . okhttp . Call call = getManifestPropertiesValidateBeforeCall ( deviceTypeId , version , null , null ) ; Type localVarReturnType = new TypeToken < ManifestPropertiesEnvelope > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
|
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcCurveOrEdgeCurve ( ) { } }
|
if ( ifcCurveOrEdgeCurveEClass == null ) { ifcCurveOrEdgeCurveEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 947 ) ; } return ifcCurveOrEdgeCurveEClass ;
|
public class Stats { /** * Round a double value to a specified number of decimal
* places .
* @ param val the value to be rounded .
* @ param places the number of decimal places to round to .
* @ return val rounded to places decimal places . */
public static double round ( double val , int places ) { } }
|
long factor = ( long ) Math . pow ( 10 , places ) ; // Shift the decimal the correct number of places
// to the right .
val = val * factor ; // Round to the nearest integer .
long tmp = Math . round ( val ) ; // Shift the decimal the correct number of places
// back to the left .
return ( double ) tmp / factor ;
|
public class AdminfacesAutoConfiguration { /** * This { @ link WebServerFactoryCustomizer } adds a { @ link ServletContextInitializer } to the embedded servlet - container
* which is equivalent to adminfaces ' s own { @ code META - INF / web - fragment . xml } .
* @ return adminfaces web server factory customizer */
@ Bean public WebServerFactoryCustomizer < ConfigurableServletWebServerFactory > adminfacesWebServerFactoryCustomizer ( ) { } }
|
return factory -> { factory . addErrorPages ( new ErrorPage ( HttpStatus . FORBIDDEN , "/403.jsf" ) , new ErrorPage ( AccessDeniedException . class , "/403.jsf" ) , new ErrorPage ( AccessLocalException . class , "/403.jsf" ) , new ErrorPage ( HttpStatus . NOT_FOUND , "/404.jsf" ) , new ErrorPage ( HttpStatus . INTERNAL_SERVER_ERROR , "/500.jsf" ) , new ErrorPage ( Throwable . class , "/500.jsf" ) , new ErrorPage ( ViewExpiredException . class , "/expired.jsf" ) , new ErrorPage ( OptimisticLockException . class , "/optimistic.jsf" ) ) ; factory . addInitializers ( servletContext -> { servletContext . addListener ( new AdminServletContextListener ( ) ) ; } ) ; } ;
|
public class PercentageColumn { /** * The group which the variable will be inside ( mostly for reset )
* @ param group ( may be null )
* @ return */
public String getGroupVariableName ( DJGroup group ) { } }
|
String columnToGroupByProperty = group . getColumnToGroupBy ( ) . getColumnProperty ( ) . getProperty ( ) ; return "variable-" + columnToGroupByProperty + "_" + getPercentageColumn ( ) . getColumnProperty ( ) . getProperty ( ) + "_percentage" ;
|
public class BytesArray { /** * Split byte array by a separator byte .
* @ param sep the separator
* @ return a list of byte arrays */
public List < byte [ ] > split ( byte sep ) { } }
|
List < byte [ ] > l = new LinkedList < > ( ) ; int start = 0 ; for ( int i = 0 ; i < bytes . length ; i ++ ) { if ( sep == bytes [ i ] ) { byte [ ] b = Arrays . copyOfRange ( bytes , start , i ) ; if ( b . length > 0 ) { l . add ( b ) ; } start = i + 1 ; i = start ; } } l . add ( Arrays . copyOfRange ( bytes , start , bytes . length ) ) ; return l ;
|
public class Image { /** * Scale the image to an absolute width .
* @ param newWidth
* the new width */
public void scaleAbsoluteWidth ( float newWidth ) { } }
|
plainWidth = newWidth ; float [ ] matrix = matrix ( ) ; scaledWidth = matrix [ DX ] - matrix [ CX ] ; scaledHeight = matrix [ DY ] - matrix [ CY ] ; setWidthPercentage ( 0 ) ;
|
public class Change { /** * Returns change ' s info in string format .
* @ param preText the text before change info .
* @ return change info . */
public String getChangeInfo ( String preText ) { } }
|
StringBuilder s = new StringBuilder ( ) ; s . append ( preText + "\n" ) ; s . append ( "Subject: " + getSubject ( ) + "\n" ) ; s . append ( "Project: " + getProject ( ) + " " + getBranch ( ) + " " + getId ( ) + "\n" ) ; s . append ( "Link: " + getUrl ( ) + "\n" ) ; return s . toString ( ) ;
|
public class MetaDataService { /** * Delete entities from entity group .
* @ param entityGroupName Entity group name .
* @ param entities Entities to replace . @ return { @ code true } if entities added .
* @ return is success
* @ throws AtsdClientException raised if there is any client problem
* @ throws AtsdServerException raised if there is any server problem */
public boolean deleteGroupEntities ( String entityGroupName , Entity ... entities ) { } }
|
checkEntityGroupIsEmpty ( entityGroupName ) ; List < String > entitiesNames = new ArrayList < > ( ) ; for ( Entity entity : entities ) { entitiesNames . add ( entity . getName ( ) ) ; } QueryPart < Entity > query = new Query < Entity > ( "entity-groups" ) . path ( entityGroupName , true ) . path ( "entities/delete" ) ; return httpClientManager . updateMetaData ( query , post ( entitiesNames ) ) ;
|
public class LogBuffer { /** * Return next 40 - bit unsigned int from buffer . ( big - endian )
* @ see mysql - 5.6.10 / include / myisampack . h - mi _ uint5korr */
public final long getBeUlong40 ( ) { } }
|
if ( position + 4 >= origin + limit ) throw new IllegalArgumentException ( "limit excceed: " + ( position - origin + 4 ) ) ; byte [ ] buf = buffer ; return ( ( long ) ( 0xff & buf [ position ++ ] ) << 32 ) | ( ( long ) ( 0xff & buf [ position ++ ] ) << 24 ) | ( ( long ) ( 0xff & buf [ position ++ ] ) << 16 ) | ( ( long ) ( 0xff & buf [ position ++ ] ) << 8 ) | ( ( long ) ( 0xff & buf [ position ++ ] ) ) ;
|
public class JdbcPatternUtil { /** * 得到sql模式串中的原模原样的key */
protected static List < String > getOriginalKeys ( String sqlFragment ) { } }
|
List < String > keys = new ArrayList < String > ( ) ; if ( sqlFragment . contains ( "{" ) ) { String key = sqlFragment . substring ( sqlFragment . indexOf ( '{' ) + 1 , sqlFragment . indexOf ( '}' ) ) . trim ( ) ; keys . add ( key ) ; keys . addAll ( getOriginalKeys ( sqlFragment . substring ( sqlFragment . indexOf ( '}' ) + 1 ) ) ) ; } return keys ;
|
public class AuthorizationImpl { /** * Adds the < code > IPermissionSet < / code > to the entity cache . */
protected void cacheAdd ( IPermissionSet ps ) throws AuthorizationException { } }
|
try { EntityCachingService . getEntityCachingService ( ) . add ( ps ) ; } catch ( CachingException ce ) { throw new AuthorizationException ( "Problem adding permissions for " + ps + " to cache" , ce ) ; }
|
public class AttributeKey { /** * Creates a new { @ link ServletContext } - scoped { @ link AttributeKey } . */
public static < T > AttributeKey < T > appScoped ( ) { } }
|
return new AttributeKey < T > ( ) { public T get ( HttpServletRequest req ) { return ( T ) getContext ( req ) . getAttribute ( name ) ; } public void set ( HttpServletRequest req , T value ) { getContext ( req ) . setAttribute ( name , value ) ; } public void remove ( HttpServletRequest req ) { getContext ( req ) . removeAttribute ( name ) ; } private ServletContext getContext ( HttpServletRequest req ) { return ( ( StaplerRequest ) req ) . getServletContext ( ) ; } } ;
|
public class FastSynchHashTable { /** * This routine returns a snapshot of all the values in the hash table .
* CAUTION : The entries returned may no longer be valid , so code that
* processes
* of the return values should be aware of this . The main reason for
* this function is to provide a way of dumping the table for diagnostic
* purposes .
* @ return an array of all the values in the hash table . */
public Object [ ] getAllEntryValues ( ) { } }
|
List < Object > values = new ArrayList < Object > ( ) ; FastSyncHashBucket hb = null ; FastSyncHashEntry e = null ; for ( int i = 0 ; i < xVar ; i ++ ) { for ( int j = 0 ; j < yVar ; j ++ ) { hb = mainTable [ i ] [ j ] ; synchronized ( hb ) { e = hb . root ; while ( e != null ) { values . add ( e . value ) ; e = e . next ; } } } } return values . toArray ( ) ;
|
public class CmsCategoryTree { /** * Sorts a list of tree items according to the sort parameter . < p >
* @ param items the items to sort
* @ param sort the sort parameter */
protected void sort ( List < CmsTreeItem > items , SortParams sort ) { } }
|
int sortParam = - 1 ; boolean ascending = true ; switch ( sort ) { case tree : m_quickSearch . setFormValueAsString ( "" ) ; m_listView = false ; updateContentTree ( ) ; break ; case title_asc : sortParam = 0 ; break ; case title_desc : sortParam = 0 ; ascending = false ; break ; case path_asc : sortParam = 1 ; break ; case path_desc : sortParam = 1 ; ascending = false ; break ; default : break ; } if ( sortParam != - 1 ) { m_listView = true ; items = getFilteredCategories ( hasQuickFilter ( ) ? m_quickSearch . getFormValueAsString ( ) : null ) ; Collections . sort ( items , new CmsListItemDataComparator ( sortParam , ascending ) ) ; updateContentList ( items ) ; }
|
public class HolidayCalendar { /** * Determine the next time ( in milliseconds ) that is ' included ' by the
* Calendar after the given time .
* Note that this Calendar is only has full - day precision . */
@ Override public long getNextIncludedTime ( final long nTimeStamp ) { } }
|
// Call base calendar implementation first
long timeStamp = nTimeStamp ; final long baseTime = super . getNextIncludedTime ( timeStamp ) ; if ( ( baseTime > 0 ) && ( baseTime > timeStamp ) ) { timeStamp = baseTime ; } // Get timestamp for 00:00:00
final Calendar day = getStartOfDayJavaCalendar ( timeStamp ) ; while ( isTimeIncluded ( day . getTime ( ) . getTime ( ) ) == false ) { day . add ( Calendar . DATE , 1 ) ; } return day . getTime ( ) . getTime ( ) ;
|
public class EhcacheCachingProvider { /** * { @ inheritDoc } */
@ Override public void close ( final URI uri , final ClassLoader classLoader ) { } }
|
if ( uri == null || classLoader == null ) { throw new NullPointerException ( ) ; } synchronized ( cacheManagers ) { final ConcurrentMap < URI , Eh107CacheManager > map = cacheManagers . get ( classLoader ) ; if ( map != null ) { final Eh107CacheManager cacheManager = map . remove ( uri ) ; if ( cacheManager != null ) { cacheManager . closeInternal ( ) ; } } }
|
public class CodeScriptAction { /** * 编辑 */
public String edit ( ) { } }
|
Integer codeScriptId = getInt ( "codeScriptId" ) ; CodeScript codeScript = null ; if ( null == codeScriptId ) { codeScript = ( CodeScript ) populate ( CodeScript . class , "codeScript" ) ; } else { codeScript = ( CodeScript ) entityDao . get ( CodeScript . class , codeScriptId ) ; } put ( "codeScript" , codeScript ) ; return forward ( ) ;
|
public class LocaleFormatter { /** * Format the passed value according to the rules specified by the given
* locale . All fraction digits of the passed value are displayed .
* @ param aValue
* The value to be formatted . May not be < code > null < / code > .
* @ param aDisplayLocale
* The locale to be used . May not be < code > null < / code > .
* @ return The formatted string . */
@ Nonnull public static String getFormattedWithAllFractionDigits ( @ Nonnull final BigDecimal aValue , @ Nonnull final Locale aDisplayLocale ) { } }
|
ValueEnforcer . notNull ( aValue , "Value" ) ; ValueEnforcer . notNull ( aDisplayLocale , "DisplayLocale" ) ; final NumberFormat aNF = NumberFormat . getInstance ( aDisplayLocale ) ; aNF . setMaximumFractionDigits ( aValue . scale ( ) ) ; return aNF . format ( aValue ) ;
|
public class CPMeasurementUnitPersistenceImpl { /** * Removes the cp measurement unit where uuid = & # 63 ; and groupId = & # 63 ; from the database .
* @ param uuid the uuid
* @ param groupId the group ID
* @ return the cp measurement unit that was removed */
@ Override public CPMeasurementUnit removeByUUID_G ( String uuid , long groupId ) throws NoSuchCPMeasurementUnitException { } }
|
CPMeasurementUnit cpMeasurementUnit = findByUUID_G ( uuid , groupId ) ; return remove ( cpMeasurementUnit ) ;
|
public class ServletResponseWrapper { /** * Checks ( recursively ) if this ServletResponseWrapper wraps a
* { @ link ServletResponse } of the given class type .
* @ param wrappedType the ServletResponse class type to
* search for
* @ return true if this ServletResponseWrapper wraps a
* ServletResponse of the given class type , false otherwise
* @ throws IllegalArgumentException if the given class does not
* implement { @ link ServletResponse }
* @ since Servlet 3.0 */
public boolean isWrapperFor ( Class < ? > wrappedType ) { } }
|
if ( ! ServletResponse . class . isAssignableFrom ( wrappedType ) ) { throw new IllegalArgumentException ( "Given class " + wrappedType . getName ( ) + " not a subinterface of " + ServletResponse . class . getName ( ) ) ; } if ( wrappedType . isAssignableFrom ( response . getClass ( ) ) ) { return true ; } else if ( response instanceof ServletResponseWrapper ) { return ( ( ServletResponseWrapper ) response ) . isWrapperFor ( wrappedType ) ; } else { return false ; }
|
public class UnicodeSet { /** * Close this set over the given attribute . For the attribute
* CASE , the result is to modify this set so that :
* 1 . For each character or string ' a ' in this set , all strings
* ' b ' such that foldCase ( a ) = = foldCase ( b ) are added to this set .
* ( For most ' a ' that are single characters , ' b ' will have
* b . length ( ) = = 1 . )
* 2 . For each string ' e ' in the resulting set , if e ! =
* foldCase ( e ) , ' e ' will be removed .
* Example : [ aq \ u00DF { Bc } { bC } { Fi } ] = & gt ; [ aAqQ \ u00DF \ uFB01 { ss } { bc } { fi } ]
* ( Here foldCase ( x ) refers to the operation
* UCharacter . foldCase ( x , true ) , and a = = b actually denotes
* a . equals ( b ) , not pointer comparison . )
* @ param attribute bitmask for attributes to close over .
* Currently only the CASE bit is supported . Any undefined bits
* are ignored .
* @ return a reference to this set . */
public UnicodeSet closeOver ( int attribute ) { } }
|
checkFrozen ( ) ; if ( ( attribute & ( CASE | ADD_CASE_MAPPINGS ) ) != 0 ) { UCaseProps csp = UCaseProps . INSTANCE ; UnicodeSet foldSet = new UnicodeSet ( this ) ; ULocale root = ULocale . ROOT ; // start with input set to guarantee inclusion
// CASE : remove strings because the strings will actually be reduced ( folded ) ;
// therefore , start with no strings and add only those needed
if ( ( attribute & CASE ) != 0 ) { foldSet . strings . clear ( ) ; } int n = getRangeCount ( ) ; int result ; StringBuilder full = new StringBuilder ( ) ; for ( int i = 0 ; i < n ; ++ i ) { int start = getRangeStart ( i ) ; int end = getRangeEnd ( i ) ; if ( ( attribute & CASE ) != 0 ) { // full case closure
for ( int cp = start ; cp <= end ; ++ cp ) { csp . addCaseClosure ( cp , foldSet ) ; } } else { // add case mappings
// ( does not add long s for regular s , or Kelvin for k , for example )
for ( int cp = start ; cp <= end ; ++ cp ) { result = csp . toFullLower ( cp , null , full , UCaseProps . LOC_ROOT ) ; addCaseMapping ( foldSet , result , full ) ; result = csp . toFullTitle ( cp , null , full , UCaseProps . LOC_ROOT ) ; addCaseMapping ( foldSet , result , full ) ; result = csp . toFullUpper ( cp , null , full , UCaseProps . LOC_ROOT ) ; addCaseMapping ( foldSet , result , full ) ; result = csp . toFullFolding ( cp , full , 0 ) ; addCaseMapping ( foldSet , result , full ) ; } } } if ( ! strings . isEmpty ( ) ) { if ( ( attribute & CASE ) != 0 ) { for ( String s : strings ) { String str = UCharacter . foldCase ( s , 0 ) ; if ( ! csp . addStringCaseClosure ( str , foldSet ) ) { foldSet . add ( str ) ; // does not map to code points : add the folded string itself
} } } else { BreakIterator bi = BreakIterator . getWordInstance ( root ) ; for ( String str : strings ) { // TODO : call lower - level functions
foldSet . add ( UCharacter . toLowerCase ( root , str ) ) ; foldSet . add ( UCharacter . toTitleCase ( root , str , bi ) ) ; foldSet . add ( UCharacter . toUpperCase ( root , str ) ) ; foldSet . add ( UCharacter . foldCase ( str , 0 ) ) ; } } } set ( foldSet ) ; } return this ;
|
public class CRC32FileDigester { /** * { @ inheritDoc } */
public String calculate ( File file ) throws DigesterException { } }
|
CheckedInputStream cis ; try { cis = new CheckedInputStream ( new FileInputStream ( file ) , new CRC32 ( ) ) ; } catch ( FileNotFoundException e ) { throw new DigesterException ( "Unable to read " + file . getPath ( ) + ": " + e . getMessage ( ) ) ; } byte [ ] buf = new byte [ STREAMING_BUFFER_SIZE ] ; try { while ( cis . read ( buf ) >= 0 ) { continue ; } } catch ( IOException e ) { throw new DigesterException ( "Unable to calculate the " + getAlgorithm ( ) + " hashcode for " + file . getPath ( ) + ": " + e . getMessage ( ) ) ; } return Long . toString ( cis . getChecksum ( ) . getValue ( ) ) ;
|
public class SnapshotTaskClientImpl { /** * { @ inheritDoc } */
@ Override public GetSnapshotListTaskResult getSnapshots ( ) throws ContentStoreException { } }
|
String taskResult = contentStore . performTask ( SnapshotConstants . GET_SNAPSHOTS_TASK_NAME , "" ) ; return GetSnapshotListTaskResult . deserialize ( taskResult ) ;
|
public class TimerJobEntityManagerImpl { /** * Removes the job ' s execution ' s reference to this job , if the job has an associated execution .
* Subclasses may override to provide custom implementations . */
protected void removeExecutionLink ( TimerJobEntity jobEntity ) { } }
|
if ( jobEntity . getExecutionId ( ) != null ) { ExecutionEntity execution = getExecutionEntityManager ( ) . findById ( jobEntity . getExecutionId ( ) ) ; if ( execution != null ) { execution . getTimerJobs ( ) . remove ( jobEntity ) ; } }
|
public class StringUtils { /** * 根据正则表达式提取字符串
* @ param text 源字符串
* @ param regex 正则表达式
* @ return 所以符合正则表达式的字符串的集合 */
public static List < String > getStringsByRegex ( final String text , final String regex ) { } }
|
Pattern pattern = Pattern . compile ( regex ) ; Matcher matcher = pattern . matcher ( text ) ; List < String > matchedStrings = new ArrayList < String > ( ) ; while ( matcher . find ( ) ) { matchedStrings . add ( matcher . group ( 0 ) ) ; } return matchedStrings ;
|
public class HiveSessionImplwithUGI { /** * If the session has a delegation token obtained from the metastore , then cancel it */
private void cancelDelegationToken ( ) throws HiveSQLException { } }
|
if ( delegationTokenStr != null ) { try { Hive . get ( getHiveConf ( ) ) . cancelDelegationToken ( delegationTokenStr ) ; } catch ( HiveException e ) { throw new HiveSQLException ( "Couldn't cancel delegation token" , e ) ; } // close the metastore connection created with this delegation token
Hive . closeCurrent ( ) ; }
|
public class PrepareStatement { /** * Construct a { @ link PrepareStatement } from a select - like { @ link Statement } and give it a name .
* Note that passing a { @ link PrepareStatement } or a { @ link PreparedPayload } will reuse the
* { @ link PrepareStatement # originalStatement ( ) original statement } but use the given name .
* @ param statement the { @ link Statement } to prepare .
* @ param preparedName the name to give to the prepared statement
* @ return the prepared statement .
* @ throws IllegalArgumentException when statement cannot be prepared . */
public static PrepareStatement prepare ( Statement statement , String preparedName ) { } }
|
Statement original ; if ( statement instanceof PrepareStatement ) { original = ( ( PrepareStatement ) statement ) . originalStatement ( ) ; } else if ( statement instanceof PreparedPayload ) { original = ( ( PreparedPayload ) statement ) . originalStatement ( ) ; } else { original = statement ; } return new PrepareStatement ( original , preparedName ) ;
|
public class NullAway { /** * A safe init method is an instance method that is either private or final ( so no overriding is
* possible )
* @ param stmt the statement
* @ param enclosingClassSymbol symbol for enclosing constructor / initializer
* @ param state visitor state
* @ return element of safe init function if stmt invokes that function ; null otherwise */
@ Nullable private Element getInvokeOfSafeInitMethod ( StatementTree stmt , final Symbol . ClassSymbol enclosingClassSymbol , VisitorState state ) { } }
|
Matcher < ExpressionTree > invokeMatcher = ( expressionTree , s ) -> { if ( ! ( expressionTree instanceof MethodInvocationTree ) ) { return false ; } MethodInvocationTree methodInvocationTree = ( MethodInvocationTree ) expressionTree ; Symbol . MethodSymbol symbol = ASTHelpers . getSymbol ( methodInvocationTree ) ; Set < Modifier > modifiers = symbol . getModifiers ( ) ; if ( ( symbol . isPrivate ( ) || modifiers . contains ( Modifier . FINAL ) ) && ! symbol . isStatic ( ) && ! modifiers . contains ( Modifier . NATIVE ) ) { // check it ' s the same class ( could be an issue with inner classes )
if ( ASTHelpers . enclosingClass ( symbol ) . equals ( enclosingClassSymbol ) ) { // make sure the receiver is ' this '
ExpressionTree receiver = ASTHelpers . getReceiver ( expressionTree ) ; return receiver == null || isThisIdentifier ( receiver ) ; } } return false ; } ; if ( stmt . getKind ( ) . equals ( EXPRESSION_STATEMENT ) ) { ExpressionTree expression = ( ( ExpressionStatementTree ) stmt ) . getExpression ( ) ; if ( invokeMatcher . matches ( expression , state ) ) { return ASTHelpers . getSymbol ( expression ) ; } } return null ;
|
public class ConnectResponse { /** * / * ( non - Javadoc )
* @ see tuwien . auto . calimero . knxnetip . servicetype . ServiceType # toByteArray
* ( java . io . ByteArrayOutputStream ) */
byte [ ] toByteArray ( ByteArrayOutputStream os ) { } }
|
os . write ( channelid ) ; os . write ( status ) ; if ( endpt != null && crd != null ) { byte [ ] buf = endpt . toByteArray ( ) ; os . write ( buf , 0 , buf . length ) ; buf = crd . toByteArray ( ) ; os . write ( buf , 0 , buf . length ) ; } return os . toByteArray ( ) ;
|
public class PredictionsImpl { /** * Predict an image url and saves the result .
* @ param projectId The project id
* @ param predictImageUrlOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the ImagePrediction object if successful . */
public ImagePrediction predictImageUrl ( UUID projectId , PredictImageUrlOptionalParameter predictImageUrlOptionalParameter ) { } }
|
return predictImageUrlWithServiceResponseAsync ( projectId , predictImageUrlOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class CoalescedWriteBehindQueue { /** * Removes the first occurrence of the specified element in this queue
* when searching it by starting from the head of this queue .
* @ param incoming element to be removed .
* @ return < code > true < / code > if removed successfully , < code > false < / code > otherwise */
@ Override public boolean removeFirstOccurrence ( DelayedEntry incoming ) { } }
|
Data incomingKey = ( Data ) incoming . getKey ( ) ; Object incomingValue = incoming . getValue ( ) ; DelayedEntry current = map . get ( incomingKey ) ; if ( current == null ) { return false ; } Object currentValue = current . getValue ( ) ; if ( incomingValue == null && currentValue == null || incomingValue != null && currentValue != null && incomingValue . equals ( currentValue ) ) { map . remove ( incomingKey ) ; return true ; } return false ;
|
public class LssClient { /** * Resume your live session by live session id .
* @ param request The request object containing all parameters for resuming live session .
* @ return the response */
public ResumeSessionResponse resumeSession ( ResumeSessionRequest request ) { } }
|
checkNotNull ( request , "The parameter request should NOT be null." ) ; checkStringNotEmpty ( request . getSessionId ( ) , "The parameter sessionId should NOT be null or empty string." ) ; InternalRequest internalRequest = createRequest ( HttpMethodName . PUT , request , LIVE_SESSION , request . getSessionId ( ) ) ; internalRequest . addParameter ( RESUME , null ) ; return invokeHttpClient ( internalRequest , ResumeSessionResponse . class ) ;
|
public class AbstractHalProcessor { /** * Generates and writes java code in one call .
* @ param template the relative template name ( w / o path or package name )
* @ param packageName the package name
* @ param className the class name
* @ param context a function to create the templates ' context */
protected void code ( String template , String packageName , String className , Supplier < Map < String , Object > > context ) { } }
|
StringBuffer code = generate ( template , context ) ; writeCode ( packageName , className , code ) ;
|
public class AST { /** * Uses reflection to find the given direct child on the given statement , and replace it with a new child . */
protected boolean replaceStatementInNode ( N statement , N oldN , N newN ) { } }
|
for ( FieldAccess fa : fieldsOf ( statement . getClass ( ) ) ) { if ( replaceStatementInField ( fa , statement , oldN , newN ) ) return true ; } return false ;
|
public class JSLocalConsumerPoint { /** * Start this LCP . If there are any synchronous receives waiting , wake them up
* If there is a AsynchConsumerCallback registered look on the QP for messages
* for asynch delivery . If deliverImmediately is set , this Thread is used to deliver
* any initial messages rather than starting up a new Thread . */
@ Override public void start ( boolean deliverImmediately ) throws SISessionUnavailableException { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "start" , new Object [ ] { Boolean . valueOf ( deliverImmediately ) , this } ) ; // Register that LCP has been stopped by a request to stop
_stoppedByRequest = false ; // Run the private method
internalStart ( deliverImmediately ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "start" ) ;
|
public class CircuitsExtractorImpl { /** * Check transitions groups , and create compatible circuit on the fly .
* @ param circuits The circuits collection .
* @ param circuit The circuit found .
* @ param map The map reference .
* @ param ref The tile ref to add . */
private static void checkTransitionGroups ( Map < Circuit , Collection < TileRef > > circuits , Circuit circuit , MapTile map , TileRef ref ) { } }
|
final MapTileGroup mapGroup = map . getFeature ( MapTileGroup . class ) ; final MapTileTransition mapTransition = map . getFeature ( MapTileTransition . class ) ; final String group = mapGroup . getGroup ( ref ) ; for ( final String groupTransition : mapGroup . getGroups ( ) ) { if ( mapTransition . getTransitives ( group , groupTransition ) . size ( ) == 1 ) { final Circuit transitiveCircuit = new Circuit ( circuit . getType ( ) , group , groupTransition ) ; getTiles ( circuits , transitiveCircuit ) . add ( ref ) ; } }
|
public class ExtendedPathView { /** * { @ inheritDoc } */
public String getRelation ( int position ) { } }
|
if ( position < length - 1 ) return original . getRelation ( position ) ; // Check that the request isn ' t for an invalid index
else if ( position >= length ) throw new IllegalArgumentException ( "invalid relation: " + position ) ; else return extension . relation ( ) ;
|
public class JvmMemberImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void unsetDeprecated ( ) { } }
|
boolean oldDeprecated = deprecated ; boolean oldDeprecatedESet = deprecatedESet ; deprecated = DEPRECATED_EDEFAULT ; deprecatedESet = false ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . UNSET , TypesPackage . JVM_MEMBER__DEPRECATED , oldDeprecated , DEPRECATED_EDEFAULT , oldDeprecatedESet ) ) ;
|
public class Validate { /** * Checks if a given value has a specific type .
* @ param value The value to validate .
* @ param type The target type for the given value .
* @ throws ParameterException if the type of the given value is not a valid subclass of the target type . */
public static < T , V extends Object > void type ( V value , Class < T > type ) { } }
|
if ( ! validation ) return ; notNull ( value ) ; notNull ( type ) ; if ( ! type . isAssignableFrom ( value . getClass ( ) ) ) { throw new TypeException ( type . getCanonicalName ( ) ) ; }
|
public class SimplePicker { /** * Override afterPaint in order to paint the UIContext serialization statistics if the profile button has been
* pressed .
* @ param renderContext the renderContext to send output to . */
@ Override protected void afterPaint ( final RenderContext renderContext ) { } }
|
super . afterPaint ( renderContext ) ; if ( profileBtn . isPressed ( ) ) { // UIC serialization stats
UicStats stats = new UicStats ( UIContextHolder . getCurrent ( ) ) ; WComponent currentComp = this . getCurrentComponent ( ) ; if ( currentComp != null ) { stats . analyseWC ( currentComp ) ; } if ( renderContext instanceof WebXmlRenderContext ) { PrintWriter writer = ( ( WebXmlRenderContext ) renderContext ) . getWriter ( ) ; writer . println ( "<hr />" ) ; writer . println ( "<h2>Serialization Profile of UIC</h2>" ) ; UicStatsAsHtml . write ( writer , stats ) ; if ( currentComp != null ) { writer . println ( "<hr />" ) ; writer . println ( "<h2>ObjectProfiler - " + currentComp + "</h2>" ) ; writer . println ( "<pre>" ) ; try { writer . println ( ObjectGraphDump . dump ( currentComp ) . toFlatSummary ( ) ) ; } catch ( Exception e ) { LOG . error ( "Failed to dump component" , e ) ; } writer . println ( "</pre>" ) ; } } }
|
public class Maps { /** * Returns a { @ link UnaryOperator } that maps a { @ link String } to lower case using { @ code locale } . */
public static UnaryOperator < String > toLowerCase ( final Locale locale ) { } }
|
return new UnaryOperator < String > ( ) { @ Override public String apply ( String s ) { return s . toLowerCase ( locale ) ; } @ Override public String toString ( ) { return "toLowerCase" ; } } ;
|
public class LogFileWriter { /** * Read all of the events starting at a specific file offset
* @ return All of the UI events */
public List < Pair < UIEvent , Table > > readEvents ( long startOffset ) throws IOException { } }
|
if ( endStaticInfoOffset >= file . length ( ) ) { return Collections . emptyList ( ) ; } List < Pair < UIEvent , Table > > out = new ArrayList < > ( ) ; try ( RandomAccessFile f = new RandomAccessFile ( file , "r" ) ; FileChannel fc = f . getChannel ( ) ) { f . seek ( startOffset ) ; while ( f . getFilePointer ( ) < f . length ( ) ) { // read 2 header ints
int lengthHeader = f . readInt ( ) ; int lengthContent = f . readInt ( ) ; // Read header
ByteBuffer bb = ByteBuffer . allocate ( lengthHeader ) ; f . getChannel ( ) . read ( bb ) ; bb . flip ( ) ; // Flip for reading
UIEvent e = UIEvent . getRootAsUIEvent ( bb ) ; // Read Content
bb = ByteBuffer . allocate ( lengthContent ) ; f . getChannel ( ) . read ( bb ) ; bb . flip ( ) ; // Flip for reading
byte infoType = e . eventType ( ) ; Table t ; switch ( infoType ) { case UIEventType . ADD_NAME : t = UIAddName . getRootAsUIAddName ( bb ) ; break ; case UIEventType . SCALAR : case UIEventType . ARRAY : t = FlatArray . getRootAsFlatArray ( bb ) ; break ; // TODO
case UIEventType . ARRAY_LIST : case UIEventType . HISTOGRAM : case UIEventType . IMAGE : case UIEventType . SUMMARY_STATISTICS : case UIEventType . OP_TIMING : case UIEventType . HARDWARE_STATE : case UIEventType . GC_EVENT : default : throw new RuntimeException ( "Unknown or not yet implemented event type: " + e . eventType ( ) ) ; } // TODO do we need to close file here ?
out . add ( new Pair < > ( e , t ) ) ; } return out ; }
|
public class JavaLexer { /** * $ ANTLR start " JavaLetter " */
public final void mJavaLetter ( ) throws RecognitionException { } }
|
try { // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1379:2 : ( ( ' a ' . . ' z ' | ' A ' . . ' Z ' | ' $ ' | ' _ ' ) | { . . . } ? ~ ( ' \ \ u0000 ' . . ' \ \ u007F ' | ' \ \ uD800 ' . . ' \ \ uDBFF ' ) | { . . . } ? ( ' \ \ uD800 ' . . ' \ \ uDBFF ' ) ( ' \ \ uDC00 ' . . ' \ \ uDFFF ' ) )
int alt27 = 3 ; int LA27_0 = input . LA ( 1 ) ; if ( ( LA27_0 == '$' || ( LA27_0 >= 'A' && LA27_0 <= 'Z' ) || LA27_0 == '_' || ( LA27_0 >= 'a' && LA27_0 <= 'z' ) ) ) { alt27 = 1 ; } else if ( ( ( LA27_0 >= '\u0080' && LA27_0 <= '\uD7FF' ) || ( LA27_0 >= '\uDC00' && LA27_0 <= '\uFFFF' ) ) ) { alt27 = 2 ; } else if ( ( ( LA27_0 >= '\uD800' && LA27_0 <= '\uDBFF' ) ) ) { alt27 = 3 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 27 , 0 , input ) ; throw nvae ; } switch ( alt27 ) { case 1 : // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1379:4 : ( ' a ' . . ' z ' | ' A ' . . ' Z ' | ' $ ' | ' _ ' )
{ if ( input . LA ( 1 ) == '$' || ( input . LA ( 1 ) >= 'A' && input . LA ( 1 ) <= 'Z' ) || input . LA ( 1 ) == '_' || ( input . LA ( 1 ) >= 'a' && input . LA ( 1 ) <= 'z' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; case 2 : // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1380:6 : { . . . } ? ~ ( ' \ \ u0000 ' . . ' \ \ u007F ' | ' \ \ uD800 ' . . ' \ \ uDBFF ' )
{ if ( ! ( ( Character . isJavaIdentifierStart ( input . LA ( 1 ) ) ) ) ) { throw new FailedPredicateException ( input , "JavaLetter" , "Character.isJavaIdentifierStart(input.LA(1))" ) ; } if ( ( input . LA ( 1 ) >= '\u0080' && input . LA ( 1 ) <= '\uD7FF' ) || ( input . LA ( 1 ) >= '\uDC00' && input . LA ( 1 ) <= '\uFFFF' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; case 3 : // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1382:9 : { . . . } ? ( ' \ \ uD800 ' . . ' \ \ uDBFF ' ) ( ' \ \ uDC00 ' . . ' \ \ uDFFF ' )
{ if ( ! ( ( Character . isJavaIdentifierStart ( Character . toCodePoint ( ( char ) input . LA ( - 1 ) , ( char ) input . LA ( 1 ) ) ) ) ) ) { throw new FailedPredicateException ( input , "JavaLetter" , "Character.isJavaIdentifierStart(Character.toCodePoint((char)input.LA(-1), (char)input.LA(1)))" ) ; } if ( ( input . LA ( 1 ) >= '\uD800' && input . LA ( 1 ) <= '\uDBFF' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } if ( ( input . LA ( 1 ) >= '\uDC00' && input . LA ( 1 ) <= '\uDFFF' ) ) { input . consume ( ) ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; recover ( mse ) ; throw mse ; } } break ; } } finally { // do for sure before leaving
}
|
public class EntityGroupImpl { /** * Sets the service Name of the group service of origin . */
public void setServiceName ( Name newServiceName ) throws GroupsException { } }
|
try { getCompositeEntityIdentifier ( ) . setServiceName ( newServiceName ) ; } catch ( javax . naming . InvalidNameException ine ) { throw new GroupsException ( "Problem setting service name" , ine ) ; }
|
public class SpecifiedIndex { /** * Iterate over a cross product of the
* coordinates
* @ param indexes the coordinates to iterate over .
* Each element of the array should be of opType { @ link SpecifiedIndex }
* otherwise it will end up throwing an exception
* @ return the generator for iterating over all the combinations of the specified indexes . */
public static Generator < List < List < Long > > > iterate ( INDArrayIndex ... indexes ) { } }
|
Generator < List < List < Long > > > gen = Itertools . product ( new SpecifiedIndexesGenerator ( indexes ) ) ; return gen ;
|
public class MCCImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } }
|
switch ( featureID ) { case AfplibPackage . MCC__RG : getRg ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ;
|
public class GaloisField { /** * Compute power n of a field
* @ param x input field
* @ param n power
* @ return x ^ n */
public int power ( int x , int n ) { } }
|
assert ( x >= 0 && x < getFieldSize ( ) ) ; if ( n == 0 ) { return 1 ; } if ( x == 0 ) { return 0 ; } x = logTable [ x ] * n ; if ( x < primitivePeriod ) { return powTable [ x ] ; } x = x % primitivePeriod ; return powTable [ x ] ;
|
public class TargetAssignmentOperations { /** * Create the Assignment Confirmation Tab
* @ param actionTypeOptionGroupLayout
* the action Type Option Group Layout
* @ param maintenanceWindowLayout
* the Maintenance Window Layout
* @ param saveButtonToggle
* The event listener to derimne if save button should be enabled or not
* @ param i18n
* the Vaadin Message Source for multi language
* @ param uiProperties
* the UI Properties
* @ return the Assignment Confirmation tab */
public static ConfirmationTab createAssignmentTab ( final ActionTypeOptionGroupAssignmentLayout actionTypeOptionGroupLayout , final MaintenanceWindowLayout maintenanceWindowLayout , final Consumer < Boolean > saveButtonToggle , final VaadinMessageSource i18n , final UiProperties uiProperties ) { } }
|
final CheckBox maintenanceWindowControl = maintenanceWindowControl ( i18n , maintenanceWindowLayout , saveButtonToggle ) ; final Link maintenanceWindowHelpLink = maintenanceWindowHelpLinkControl ( uiProperties , i18n ) ; final HorizontalLayout layout = createHorizontalLayout ( maintenanceWindowControl , maintenanceWindowHelpLink ) ; actionTypeOptionGroupLayout . selectDefaultOption ( ) ; initMaintenanceWindow ( maintenanceWindowLayout , saveButtonToggle ) ; addValueChangeListener ( actionTypeOptionGroupLayout , maintenanceWindowControl , maintenanceWindowHelpLink ) ; return createAssignmentTab ( actionTypeOptionGroupLayout , layout , maintenanceWindowLayout ) ;
|
public class DataModelSerializer { /** * Convert a POJO into Serialized JSON form .
* @ param o the POJO to serialize
* @ return a String containing the JSON data .
* @ throws IOException when there are problems creating the Json . */
public static String serializeAsString ( Object o ) throws IOException { } }
|
try { JsonStructure builtJsonObject = findFieldsToSerialize ( o ) . mainObject ; return builtJsonObject . toString ( ) ; } catch ( IllegalStateException ise ) { // the reflective attempt to build the object failed .
throw new IOException ( "Unable to build JSON for Object" , ise ) ; } catch ( JsonException e ) { throw new IOException ( "Unable to build JSON for Object" , e ) ; }
|
public class BigMoney { /** * Returns a copy of this monetary value converted into another currency
* using the specified conversion rate .
* The scale of the result will be the sum of the scale of this money and
* the scale of the multiplier . If desired , the scale of the result can be
* adjusted to the scale of the new currency using { @ link # withCurrencyScale ( ) } .
* This instance is immutable and unaffected by this method .
* @ param currency the new currency , not null
* @ param conversionMultipler the conversion factor between the currencies , not null
* @ return the new multiplied instance , never null
* @ throws IllegalArgumentException if the currency is the same as this currency and the
* conversion is not one ; or if the conversion multiplier is negative */
public BigMoney convertedTo ( CurrencyUnit currency , BigDecimal conversionMultipler ) { } }
|
MoneyUtils . checkNotNull ( currency , "CurrencyUnit must not be null" ) ; MoneyUtils . checkNotNull ( conversionMultipler , "Multiplier must not be null" ) ; if ( this . currency == currency ) { if ( conversionMultipler . compareTo ( BigDecimal . ONE ) == 0 ) { return this ; } throw new IllegalArgumentException ( "Cannot convert to the same currency" ) ; } if ( conversionMultipler . compareTo ( BigDecimal . ZERO ) < 0 ) { throw new IllegalArgumentException ( "Cannot convert using a negative conversion multiplier" ) ; } BigDecimal newAmount = amount . multiply ( conversionMultipler ) ; return BigMoney . of ( currency , newAmount ) ;
|
public class NettyChannelFactory { /** * Converts the given negotiation type to netty ' s negotiation type .
* @ param negotiationType The negotiation type to convert .
* @ return The converted negotiation type . */
protected static io . grpc . netty . NegotiationType of ( final NegotiationType negotiationType ) { } }
|
switch ( negotiationType ) { case PLAINTEXT : return io . grpc . netty . NegotiationType . PLAINTEXT ; case PLAINTEXT_UPGRADE : return io . grpc . netty . NegotiationType . PLAINTEXT_UPGRADE ; case TLS : return io . grpc . netty . NegotiationType . TLS ; default : throw new IllegalArgumentException ( "Unsupported NegotiationType: " + negotiationType ) ; }
|
public class SubscriptionAndPublication { /** * this is used for identification in # toString */
public static void main ( String [ ] args ) { } }
|
// Listeners are subscribed by passing them to the # subscribe ( ) method
bus . subscribe ( new ListenerDefinition . SyncAsyncListener ( ) ) ; // # subscribe ( ) is idem - potent = > Multiple calls to subscribe do NOT add the listener more than once ( set semantics )
Object listener = new ListenerDefinition . SyncAsyncListener ( ) ; bus . subscribe ( listener ) ; bus . subscribe ( listener ) ; // Classes without handlers will be silently ignored
bus . subscribe ( new Object ( ) ) ; bus . subscribe ( new String ( ) ) ; bus . publishAsync ( new File ( "/tmp/random.csv" ) ) ; // returns immediately , publication will continue asynchronously
bus . post ( new File ( "/tmp/random.csv" ) ) . asynchronously ( ) ; // same as above
bus . publish ( "some message" ) ; // will return after each handler has been invoked
bus . post ( "some message" ) . now ( ) ; // same as above
|
public class CellConstraints { /** * Decodes an integer string representation and returns the associated Integer or null in case
* of an invalid number format .
* @ param tokenthe encoded integer
* @ return the decoded Integer or null */
private static Integer decodeInt ( String token ) { } }
|
try { return Integer . decode ( token ) ; } catch ( NumberFormatException e ) { return null ; }
|
public class RiakNode { /** * Get a Netty channel from the pool .
* The first thing this method does is attempt to acquire a permit from the
* Semaphore that controls the pool ' s behavior . Depending on whether
* { @ code blockOnMaxConnections } is set , this will either block until one
* becomes available or return null .
* Once a permit has been acquired , a channel from the pool or a newly
* created one will be returned . If an attempt to create a new connection
* fails , null will then be returned .
* @ return a connected channel or { @ code null }
* @ see Builder # withBlockOnMaxConnections ( boolean ) */
private Channel getConnection ( ) { } }
|
stateCheck ( State . RUNNING , State . HEALTH_CHECKING ) ; boolean acquired = false ; if ( blockOnMaxConnections ) { try { logger . debug ( "Attempting to acquire channel permit" ) ; if ( ! permits . tryAcquire ( ) ) { logger . info ( "All connections in use for {}; had to wait for one." , remoteAddress ) ; permits . acquire ( ) ; } acquired = true ; } catch ( InterruptedException ex ) { // no - op , don ' t care
} catch ( BlockingOperationException ex ) { logger . error ( "Netty interrupted waiting for connection permit to be available; {}" , remoteAddress ) ; } } else { logger . debug ( "Attempting to acquire channel permit" ) ; acquired = permits . tryAcquire ( ) ; } Channel channel = null ; if ( acquired ) { try { channel = doGetConnection ( true ) ; channel . closeFuture ( ) . removeListener ( inAvailableCloseListener ) ; } catch ( ConnectionFailedException ex ) { permits . release ( ) ; } catch ( UnknownHostException ex ) { permits . release ( ) ; logger . error ( "Unknown host encountered while trying to open connection; {}" , ex ) ; } } return channel ;
|
public class AddTagsToStreamRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AddTagsToStreamRequest addTagsToStreamRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( addTagsToStreamRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( addTagsToStreamRequest . getStreamName ( ) , STREAMNAME_BINDING ) ; protocolMarshaller . marshall ( addTagsToStreamRequest . getTags ( ) , TAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class DescribeCacheSecurityGroupsResult { /** * A list of cache security groups . Each element in the list contains detailed information about one group .
* @ param cacheSecurityGroups
* A list of cache security groups . Each element in the list contains detailed information about one group . */
public void setCacheSecurityGroups ( java . util . Collection < CacheSecurityGroup > cacheSecurityGroups ) { } }
|
if ( cacheSecurityGroups == null ) { this . cacheSecurityGroups = null ; return ; } this . cacheSecurityGroups = new com . amazonaws . internal . SdkInternalList < CacheSecurityGroup > ( cacheSecurityGroups ) ;
|
public class VirtualWANsInner { /** * Creates a VirtualWAN resource if it doesn ' t exist else updates the existing VirtualWAN .
* @ param resourceGroupName The resource group name of the VirtualWan .
* @ param virtualWANName The name of the VirtualWAN being created or updated .
* @ param wANParameters Parameters supplied to create or update VirtualWAN .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable for the request */
public Observable < ServiceResponse < VirtualWANInner > > createOrUpdateWithServiceResponseAsync ( String resourceGroupName , String virtualWANName , VirtualWANInner wANParameters ) { } }
|
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( virtualWANName == null ) { throw new IllegalArgumentException ( "Parameter virtualWANName is required and cannot be null." ) ; } if ( wANParameters == null ) { throw new IllegalArgumentException ( "Parameter wANParameters is required and cannot be null." ) ; } Validator . validate ( wANParameters ) ; final String apiVersion = "2018-04-01" ; Observable < Response < ResponseBody > > observable = service . createOrUpdate ( this . client . subscriptionId ( ) , resourceGroupName , virtualWANName , apiVersion , wANParameters , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) ; return client . getAzureClient ( ) . getPutOrPatchResultAsync ( observable , new TypeToken < VirtualWANInner > ( ) { } . getType ( ) ) ;
|
public class CPDefinitionLinkUtil { /** * Returns the first cp definition link in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; .
* @ param uuid the uuid
* @ param companyId the company ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching cp definition link , or < code > null < / code > if a matching cp definition link could not be found */
public static CPDefinitionLink fetchByUuid_C_First ( String uuid , long companyId , OrderByComparator < CPDefinitionLink > orderByComparator ) { } }
|
return getPersistence ( ) . fetchByUuid_C_First ( uuid , companyId , orderByComparator ) ;
|
public class SlidingUpPanelLayout { /** * Change panel state to the given state with
* @ param state - new panel state */
public void setPanelState ( PanelState state ) { } }
|
// Abort any running animation , to allow state change
if ( mDragHelper . getViewDragState ( ) == ViewDragHelper . STATE_SETTLING ) { Log . d ( TAG , "View is settling. Aborting animation." ) ; mDragHelper . abort ( ) ; } if ( state == null || state == PanelState . DRAGGING ) { throw new IllegalArgumentException ( "Panel state cannot be null or DRAGGING." ) ; } if ( ! isEnabled ( ) || ( ! mFirstLayout && mSlideableView == null ) || state == mSlideState || mSlideState == PanelState . DRAGGING ) return ; if ( mFirstLayout ) { setPanelStateInternal ( state ) ; } else { if ( mSlideState == PanelState . HIDDEN ) { mSlideableView . setVisibility ( View . VISIBLE ) ; requestLayout ( ) ; } switch ( state ) { case ANCHORED : smoothSlideTo ( mAnchorPoint , 0 ) ; break ; case COLLAPSED : smoothSlideTo ( 0 , 0 ) ; break ; case EXPANDED : smoothSlideTo ( 1.0f , 0 ) ; break ; case HIDDEN : int newTop = computePanelTopPosition ( 0.0f ) + ( mIsSlidingUp ? + mPanelHeight : - mPanelHeight ) ; smoothSlideTo ( computeSlideOffset ( newTop ) , 0 ) ; break ; } }
|
public class FessMessages { /** * Add the created action message for the key ' errors . design _ file _ name _ is _ invalid ' with parameters .
* < pre >
* message : The file name is invalid .
* < / pre >
* @ param property The property name for the message . ( NotNull )
* @ return this . ( NotNull ) */
public FessMessages addErrorsDesignFileNameIsInvalid ( String property ) { } }
|
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_design_file_name_is_invalid ) ) ; return this ;
|
public class AbstractDecoderChannel { /** * Decode Date - Time as sequence of values representing the individual
* components of the Date - Time . */
public DateTimeValue decodeDateTimeValue ( DateTimeType type ) throws IOException { } }
|
int year = 0 , monthDay = 0 , time = 0 , fractionalSecs = 0 ; switch ( type ) { case gYear : // Year , [ Time - Zone ]
year = decodeInteger ( ) + DateTimeValue . YEAR_OFFSET ; break ; case gYearMonth : // Year , MonthDay , [ TimeZone ]
case date : // Year , MonthDay , [ TimeZone ]
year = decodeInteger ( ) + DateTimeValue . YEAR_OFFSET ; monthDay = decodeNBitUnsignedInteger ( DateTimeValue . NUMBER_BITS_MONTHDAY ) ; break ; case dateTime : // Year , MonthDay , Time , [ FractionalSecs ] , [ TimeZone ]
// e . g . " 0001-01-01T00:00:00.111 + 00:33 " ;
year = decodeInteger ( ) + DateTimeValue . YEAR_OFFSET ; monthDay = decodeNBitUnsignedInteger ( DateTimeValue . NUMBER_BITS_MONTHDAY ) ; // Note : * no * break ;
case time : // Time , [ FractionalSecs ] , [ TimeZone ]
// e . g . " 12:34:56.135"
time = decodeNBitUnsignedInteger ( DateTimeValue . NUMBER_BITS_TIME ) ; boolean presenceFractionalSecs = decodeBoolean ( ) ; fractionalSecs = presenceFractionalSecs ? decodeUnsignedInteger ( ) : 0 ; break ; case gMonth : // MonthDay , [ TimeZone ]
// e . g . " - - 12"
case gMonthDay : // MonthDay , [ TimeZone ]
// e . g . " - - 01-28"
case gDay : // MonthDay , [ TimeZone ]
// " - - - 16 " ;
monthDay = decodeNBitUnsignedInteger ( DateTimeValue . NUMBER_BITS_MONTHDAY ) ; break ; default : throw new UnsupportedOperationException ( ) ; } boolean presenceTimezone = decodeBoolean ( ) ; int timeZone = presenceTimezone ? decodeNBitUnsignedInteger ( DateTimeValue . NUMBER_BITS_TIMEZONE ) - DateTimeValue . TIMEZONE_OFFSET_IN_MINUTES : 0 ; return new DateTimeValue ( type , year , monthDay , time , fractionalSecs , presenceTimezone , timeZone ) ;
|
public class AVUser { /** * signUpOrLoginByMobilePhoneInBackground
* @ param mobilePhoneNumber
* @ param smsCode
* @ return */
public static Observable < ? extends AVUser > signUpOrLoginByMobilePhoneInBackground ( String mobilePhoneNumber , String smsCode ) { } }
|
return signUpOrLoginByMobilePhoneInBackground ( mobilePhoneNumber , smsCode , internalUserClazz ( ) ) ;
|
public class InfluxDBResultMapper { /** * InfluxDB client returns any number as Double .
* See https : / / github . com / influxdata / influxdb - java / issues / 153 # issuecomment - 259681987
* for more information .
* @ param object
* @ param field
* @ param value
* @ param precision
* @ throws IllegalArgumentException
* @ throws IllegalAccessException */
< T > void setFieldValue ( final T object , final Field field , final Object value , final TimeUnit precision ) throws IllegalArgumentException , IllegalAccessException { } }
|
if ( value == null ) { return ; } Class < ? > fieldType = field . getType ( ) ; try { if ( ! field . isAccessible ( ) ) { field . setAccessible ( true ) ; } if ( fieldValueModified ( fieldType , field , object , value , precision ) || fieldValueForPrimitivesModified ( fieldType , field , object , value ) || fieldValueForPrimitiveWrappersModified ( fieldType , field , object , value ) ) { return ; } String msg = "Class '%s' field '%s' is from an unsupported type '%s'." ; throw new InfluxDBMapperException ( String . format ( msg , object . getClass ( ) . getName ( ) , field . getName ( ) , field . getType ( ) ) ) ; } catch ( ClassCastException e ) { String msg = "Class '%s' field '%s' was defined with a different field type and caused a ClassCastException. " + "The correct type is '%s' (current field value: '%s')." ; throw new InfluxDBMapperException ( String . format ( msg , object . getClass ( ) . getName ( ) , field . getName ( ) , value . getClass ( ) . getName ( ) , value ) ) ; }
|
public class PersistenceUnitMetadata { /** * ( non - Javadoc )
* @ see javax . persistence . spi . PersistenceUnitInfo # getJarFileUrls ( ) */
@ Override public List < URL > getJarFileUrls ( ) { } }
|
return jarUrls != null ? new ArrayList < URL > ( jarUrls ) : null ;
|
public class JoynrMessageScope { /** * Call this method to activate the { @ link JoynrMessageScope } for the current thread . It is not valid to call this
* method more than once .
* @ throws IllegalStateException
* if you have already activated this scope for the current thread . */
public void activate ( ) { } }
|
if ( entries . get ( ) != null ) { throw new IllegalStateException ( "Scope " + JoynrMessageScope . class . getSimpleName ( ) + " is already active." ) ; } logger . trace ( "Activating {} scope" , JoynrMessageScope . class . getSimpleName ( ) ) ; entries . set ( new HashMap < Key < ? > , Object > ( ) ) ;
|
public class HelpFrame { /** * Creates the layout . */
private void createLayout ( ) { } }
|
jlabelTitle = new JLabel ( newLabelHelpText ( ) ) ; getContentPane ( ) . add ( jlabelTitle , BorderLayout . NORTH ) ; // JTextArea Help :
jtaHelp = new JTextArea ( 10 , 10 ) ; jtpHelp = new JTextPane ( ) ; jtpHelp . replaceSelection ( helptext ) ; jtaHelp . setText ( helptext ) ; jtaHelp . setCaretPosition ( 0 ) ; jtaHelp . setLineWrap ( true ) ; jtaHelp . setWrapStyleWord ( true ) ; jtaHelp . setEditable ( false ) ; jscrollPanejtaHelp = new JScrollPane ( jtpHelp ) ; getContentPane ( ) . add ( jscrollPanejtaHelp , BorderLayout . CENTER ) ; buttonClose = new JButton ( newLabelCloseText ( ) ) ; buttonClose . addActionListener ( new DisposeWindowAction ( this ) ) ; final Panel unten = new Panel ( ) ; unten . add ( buttonClose , BorderLayout . WEST ) ; getContentPane ( ) . add ( unten , BorderLayout . SOUTH ) ;
|
public class ObjectByteExtentImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } }
|
switch ( featureID ) { case AfplibPackage . OBJECT_BYTE_EXTENT__BYTE_EXT : setByteExt ( BYTE_EXT_EDEFAULT ) ; return ; case AfplibPackage . OBJECT_BYTE_EXTENT__BYTE_EXT_HI : setByteExtHi ( BYTE_EXT_HI_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
|
public class PropertyUtils { /** * Get setter name . " setName " - > " name "
* @ param m Method object .
* @ return Property name of this setter . */
private static String getSetterName ( Method m ) { } }
|
String name = m . getName ( ) ; if ( name . startsWith ( "set" ) && ( name . length ( ) >= 4 ) && m . getReturnType ( ) . equals ( void . class ) && ( m . getParameterTypes ( ) . length == 1 ) ) { return Character . toLowerCase ( name . charAt ( 3 ) ) + name . substring ( 4 ) ; } return null ;
|
public class CMStatefulBeanO { /** * Enlist this < code > SessionBeanO < / code > instance in the
* given transaction . < p >
* @ param tx the < code > ContainerTx < / code > this instance is being
* enlisted in < p > */
@ Override public final synchronized boolean enlist ( ContainerTx tx , boolean txEnlist ) // d114677
throws RemoteException { } }
|
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "enlist: " + getStateName ( state ) , new Object [ ] { tx , txEnlist } ) ; switch ( state ) { case METHOD_READY : // A thread is about to invoke a method in the context
// of the given transaction
if ( currentTx != null ) { throw new BeanNotReentrantException ( getStateName ( state ) + ": Tx != null" ) ; // PQ99986
} if ( ivExPcContext != null && tx . isTransactionGlobal ( ) ) { container . getEJBRuntime ( ) . getEJBJPAContainer ( ) . onEnlistCMT ( ivExPcContext ) ; } currentTx = tx ; final boolean result = ! txEnlist || tx . enlist ( this ) ; // F61004.1
// Session Synchronization AfterBegin needs to be called if either
// the annotation ( or XML ) was specified or the bean implemented
// the interface and a global transaction is active . F743-25855
if ( ( ivAfterBegin != null || sessionSync != null ) && tx . isTransactionGlobal ( ) ) { setState ( AFTER_BEGIN ) ; // d159152
if ( ivAfterBegin != null ) { invokeSessionSynchMethod ( ivAfterBegin , null ) ; } else { sessionSync . afterBegin ( ) ; } } setState ( TX_METHOD_READY ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlist: " + result + ": " + getStateName ( state ) ) ; return result ; case TX_METHOD_READY : // A thread is about to invoke a method in the context of
// the given transaction ; it must be the same transaction
// which we ' re already associated with
if ( currentTx != tx ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlist: not re-entrant" ) ; throw new BeanNotReentrantException ( StateStrs [ state ] + ": wrong transaction" ) ; // d116807
} if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlist: false" ) ; return false ; case COMMITTING_OUTSIDE_METHOD : // Either another thread is currently committing this bean ( PQ52534 ) ,
// or current thread is re - enlisting this bean after beforeCompletion
// has been driven on it ( i . e . another bean has called a method
// on this bean during beforeCompletion processing ) ( d115597 ) .
if ( currentTx != tx ) { // PQ52534
if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlist: not re-entrant" ) ; throw new BeanNotReentrantException ( StateStrs [ state ] + ": wrong transaction" ) ; // d116807
} // Although already enlisted , need to call enlist again to make sure
// it gets added to the end of the list , and processed again . d115597
boolean result1 = tx . enlist ( this ) ; setState ( TX_METHOD_READY ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlist: " + result1 + ": " + getStateName ( state ) ) ; return result1 ; case TX_IN_METHOD : case REMOVING : // d159152
case AFTER_BEGIN : // d159152
case AFTER_COMPLETION : // d159152
// This bean is already in a transaction - and any of these states
// could be seen by a different transaction calling a method on it ,
// or they could also be due to a customer coded callback to the same
// bean .
if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "enlist: not re-entrant" ) ; if ( currentTx != tx ) throw new BeanNotReentrantException ( StateStrs [ state ] + ": wrong transaction" ) ; // This isn ' t a different thread / tran , but it is a reentrant call ,
// which must be caught here rather than preInvoke to insure the
// extra cache pins are undone in the activation strategy . d159152
throw new BeanNotReentrantException ( getStateName ( state ) ) ; default : // Any other state is a programming error . . . there should be no
// way to encounter these states even from another thread / transaction .
throw new InvalidBeanOStateException ( getStateName ( state ) , "METHOD_READY | TX_METHOD_READY" ) ; }
|
public class GenericUtils { /** * Helper method to append a byte to a byte array .
* @ param src byte array
* @ param b byte to be appended to the src byte array
* @ return target byte array */
static public byte [ ] expandByteArray ( byte [ ] src , byte b ) { } }
|
int srcLength = ( null != src ) ? src . length : 0 ; int totalLen = srcLength + 1 ; byte [ ] rc = new byte [ totalLen ] ; try { if ( null != src ) { System . arraycopy ( src , 0 , rc , 0 , srcLength ) ; } rc [ srcLength ] = b ; } catch ( Exception e ) { // no FFDC required
// any error from arraycopy , we ' ll just return null
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception " + e + " while copying." ) ; } rc = null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "expandByteArray returning: [" + getEnglishString ( rc ) + "]" ) ; } return rc ;
|
public class CassandraEmbeddedStoreManager { /** * This implementation can ' t handle counter columns .
* The private method internal _ batch _ mutate in CassandraServer as of 1.2.0
* provided most of the following method after transaction handling . */
@ Override public void mutateMany ( Map < String , Map < StaticBuffer , KCVMutation > > mutations , StoreTransaction txh ) throws BackendException { } }
|
Preconditions . checkNotNull ( mutations ) ; final MaskedTimestamp commitTime = new MaskedTimestamp ( txh ) ; int size = 0 ; for ( Map < StaticBuffer , KCVMutation > mutation : mutations . values ( ) ) size += mutation . size ( ) ; Map < StaticBuffer , org . apache . cassandra . db . Mutation > rowMutations = new HashMap < > ( size ) ; for ( Map . Entry < String , Map < StaticBuffer , KCVMutation > > mutEntry : mutations . entrySet ( ) ) { String columnFamily = mutEntry . getKey ( ) ; for ( Map . Entry < StaticBuffer , KCVMutation > titanMutation : mutEntry . getValue ( ) . entrySet ( ) ) { StaticBuffer key = titanMutation . getKey ( ) ; KCVMutation mut = titanMutation . getValue ( ) ; org . apache . cassandra . db . Mutation rm = rowMutations . get ( key ) ; if ( rm == null ) { rm = new org . apache . cassandra . db . Mutation ( keySpaceName , key . asByteBuffer ( ) ) ; rowMutations . put ( key , rm ) ; } if ( mut . hasAdditions ( ) ) { for ( Entry e : mut . getAdditions ( ) ) { Integer ttl = ( Integer ) e . getMetaData ( ) . get ( EntryMetaData . TTL ) ; if ( null != ttl && ttl > 0 ) { rm . add ( columnFamily , CellNames . simpleDense ( e . getColumnAs ( StaticBuffer . BB_FACTORY ) ) , e . getValueAs ( StaticBuffer . BB_FACTORY ) , commitTime . getAdditionTime ( times ) , ttl ) ; } else { rm . add ( columnFamily , CellNames . simpleDense ( e . getColumnAs ( StaticBuffer . BB_FACTORY ) ) , e . getValueAs ( StaticBuffer . BB_FACTORY ) , commitTime . getAdditionTime ( times ) ) ; } } } if ( mut . hasDeletions ( ) ) { for ( StaticBuffer col : mut . getDeletions ( ) ) { rm . delete ( columnFamily , CellNames . simpleDense ( col . as ( StaticBuffer . BB_FACTORY ) ) , commitTime . getDeletionTime ( times ) ) ; } } } } mutate ( new ArrayList < org . apache . cassandra . db . Mutation > ( rowMutations . values ( ) ) , getTx ( txh ) . getWriteConsistencyLevel ( ) . getDB ( ) ) ; sleepAfterWrite ( txh , commitTime ) ;
|
public class Schedulable { /** * Distribute the total share among the list of schedulables according to the
* PRIORITY model . Note that the eventual intent is to determine if
* preemption is necessary . So , we need to assign the most ideal share on
* each schedulable beyond which preemption is necessary .
* Finds a way to distribute the share in such a way that all the
* min and max reservations of the schedulables are satisfied . In
* the PRIORITY scheduling , MINs are always granted to all pools . Therefore ,
* irrespective of the demand of a pool , its share according to the
* algorithm will be at least MIN .
* @ param total the share to be distributed
* @ param schedulables the list of schedulables */
private static void distributeSharePriority ( double total , final Collection < ? extends Schedulable > schedulables ) { } }
|
// 1 ) If share < sum ( min ( demand , min _ alloc ) ) then do fair share and quit .
double residualShare = assignShareIfUnderAllocated ( total , schedulables ) ; if ( residualShare <= 0.0 ) { return ; } // 2 ) Group schedulables according to priorities .
TreeMap < Integer , Vector < Schedulable > > prioritizedSchedulableMap = generatePriorityGroupedSchedulables ( schedulables ) ; // 3 ) Trickle the share across priority groups .
trickleShareDownPriorityGroups ( residualShare , prioritizedSchedulableMap ) ;
|
public class LineItemSummary { /** * Gets the costPerUnit value for this LineItemSummary .
* @ return costPerUnit * The amount of money to spend per impression or click . This
* attribute is
* required for creating a { @ code LineItem } . */
public com . google . api . ads . admanager . axis . v201808 . Money getCostPerUnit ( ) { } }
|
return costPerUnit ;
|
public class ProductSearchClient { /** * Lists the Products in a ProductSet , in an unspecified order . If the ProductSet does not exist ,
* the products field of the response will be empty .
* < p > Possible errors :
* < p > & # 42 ; Returns INVALID _ ARGUMENT if page _ size is greater than 100 or less than 1.
* < p > Sample code :
* < pre > < code >
* try ( ProductSearchClient productSearchClient = ProductSearchClient . create ( ) ) {
* ProductSetName name = ProductSetName . of ( " [ PROJECT ] " , " [ LOCATION ] " , " [ PRODUCT _ SET ] " ) ;
* for ( Product element : productSearchClient . listProductsInProductSet ( name ) . iterateAll ( ) ) {
* / / doThingsWith ( element ) ;
* < / code > < / pre >
* @ param name The ProductSet resource for which to retrieve Products .
* < p > Format is : ` projects / PROJECT _ ID / locations / LOC _ ID / productSets / PRODUCT _ SET _ ID `
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
public final ListProductsInProductSetPagedResponse listProductsInProductSet ( ProductSetName name ) { } }
|
ListProductsInProductSetRequest request = ListProductsInProductSetRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; return listProductsInProductSet ( request ) ;
|
public class GitkitClient { /** * Constructs a Gitkit client from a JSON config file
* @ param configPath Path to JSON configuration file
* @ param proxy the Proxy object to use when using Gitkit client behind a proxy
* @ return Gitkit client */
public static GitkitClient createFromJson ( String configPath , Proxy proxy ) throws GitkitClientException , JSONException , IOException { } }
|
JSONObject configData = new JSONObject ( StandardCharsets . UTF_8 . decode ( ByteBuffer . wrap ( Files . readAllBytes ( Paths . get ( configPath ) ) ) ) . toString ( ) ) ; if ( ! configData . has ( "clientId" ) && ! configData . has ( "projectId" ) ) { throw new GitkitClientException ( "Missing projectId or clientId in server configuration." ) ; } return new GitkitClient . Builder ( ) . setProxy ( proxy ) . setGoogleClientId ( configData . optString ( "clientId" , null ) ) . setProjectId ( configData . optString ( "projectId" , null ) ) . setServiceAccountEmail ( configData . optString ( "serviceAccountEmail" , null ) ) . setKeyStream ( configData . has ( "serviceAccountPrivateKeyFile" ) ? new FileInputStream ( configData . getString ( "serviceAccountPrivateKeyFile" ) ) : null ) . setWidgetUrl ( configData . optString ( "widgetUrl" , null ) ) . setCookieName ( configData . optString ( "cookieName" , "gtoken" ) ) . build ( ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.