signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class AvatarShell { /** * main ( ) has some simple utility methods */
public static void main ( String argv [ ] ) throws Exception { } }
|
DnsMonitorSecurityManager . setTheManager ( ) ; AvatarShell shell = null ; try { shell = new AvatarShell ( ) ; } catch ( RPC . VersionMismatch v ) { System . err . println ( "Version Mismatch between client and server" + "... command aborted." ) ; System . exit ( - 1 ) ; } catch ( IOException e ) { System . err . println ( "Bad connection to AvatarNode. command aborted." ) ; System . exit ( - 1 ) ; } int res ; try { res = ToolRunner . run ( shell , argv ) ; } finally { shell . close ( ) ; } System . exit ( res ) ;
|
public class EncodingUtilsImpl { /** * @ see com . ibm . websphere . http . EncodingUtils # getCharsetFromContentType ( java . lang . String ) */
@ Override public String getCharsetFromContentType ( String type ) { } }
|
if ( null != type ) { int index = type . indexOf ( ';' ) ; if ( - 1 != index ) { index = type . indexOf ( "charset=" , ( index + 1 ) ) ; if ( - 1 != index ) { String charset = type . substring ( index + 8 ) . trim ( ) ; int end = charset . length ( ) - 1 ; if ( - 1 == end ) { // empty value following charset =
return null ; } if ( end > 0 && '"' == charset . charAt ( 0 ) && '"' == charset . charAt ( end ) ) { // strip off quotes if both exist
charset = charset . substring ( 1 , end ) ; } return charset ; } } } return null ;
|
public class ConfigurationReader { /** * Parses the input parameter section .
* @ param node
* Reference to the current used xml node
* @ param config
* Reference to the ConfigSettings */
private void parseInputConfig ( final Node node , final ConfigSettings config ) { } }
|
String name , value ; Node nnode ; NodeList list = node . getChildNodes ( ) ; int length = list . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nnode = list . item ( i ) ; name = nnode . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( KEY_WIKIPEDIA_ENCODING ) ) { value = nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; config . setConfigParameter ( ConfigurationKeys . WIKIPEDIA_ENCODING , value ) ; } else if ( name . equals ( KEY_MODE_SURROGATES ) ) { SurrogateModes oValue = SurrogateModes . parse ( nnode . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; config . setConfigParameter ( ConfigurationKeys . MODE_SURROGATES , oValue ) ; } else if ( name . equals ( SUBSECTION_ARCHIVE ) ) { parseInputArchive ( nnode , config ) ; } }
|
public class Curve25519 { /** * / * Signature generation primitive , calculates ( x - h ) s mod q
* v [ out ] signature value
* h [ in ] signature hash ( of message , signature pub key , and context data )
* x [ in ] signature private key
* s [ in ] private key for signing
* returns true on success , false on failure ( use different x or h ) */
public static final boolean sign ( byte [ ] v , byte [ ] h , byte [ ] x , byte [ ] s ) { } }
|
/* v = ( x - h ) s mod q */
byte [ ] tmp1 = new byte [ 65 ] ; byte [ ] tmp2 = new byte [ 33 ] ; int w ; int i ; for ( i = 0 ; i < 32 ; i ++ ) v [ i ] = 0 ; i = mula_small ( v , x , 0 , h , 32 , - 1 ) ; mula_small ( v , v , 0 , ORDER , 32 , ( 15 - v [ 31 ] ) / 16 ) ; mula32 ( tmp1 , v , s , 32 , 1 ) ; divmod ( tmp2 , tmp1 , 64 , ORDER , 32 ) ; for ( w = 0 , i = 0 ; i < 32 ; i ++ ) w |= v [ i ] = tmp1 [ i ] ; return w != 0 ;
|
public class PublicIPAddressesInner { /** * Get the specified public IP address in a virtual machine scale set .
* @ param resourceGroupName The name of the resource group .
* @ param virtualMachineScaleSetName The name of the virtual machine scale set .
* @ param virtualmachineIndex The virtual machine index .
* @ param networkInterfaceName The name of the network interface .
* @ param ipConfigurationName The name of the IP configuration .
* @ param publicIpAddressName The name of the public IP Address .
* @ param expand Expands referenced resources .
* @ 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 PublicIPAddressInner object if successful . */
public PublicIPAddressInner getVirtualMachineScaleSetPublicIPAddress ( String resourceGroupName , String virtualMachineScaleSetName , String virtualmachineIndex , String networkInterfaceName , String ipConfigurationName , String publicIpAddressName , String expand ) { } }
|
return getVirtualMachineScaleSetPublicIPAddressWithServiceResponseAsync ( resourceGroupName , virtualMachineScaleSetName , virtualmachineIndex , networkInterfaceName , ipConfigurationName , publicIpAddressName , expand ) . toBlocking ( ) . single ( ) . body ( ) ;
|
public class OrmLiteConfigUtil { /** * Write a configuration file to an output stream with the configuration for classes . */
public static void writeConfigFile ( OutputStream outputStream , Class < ? > [ ] classes ) throws SQLException , IOException { } }
|
writeConfigFile ( outputStream , classes , false ) ;
|
public class CHAlgoFactoryDecorator { /** * This method changes the number of threads used for preparation on import . Default is 1 . Make
* sure that you have enough memory when increasing this number ! */
public void setPreparationThreads ( int preparationThreads ) { } }
|
this . preparationThreads = preparationThreads ; this . threadPool = java . util . concurrent . Executors . newFixedThreadPool ( preparationThreads ) ;
|
public class HttpSender { /** * Sets whether or not circular redirects are allowed .
* Circular redirects happen when a request redirects to itself , or when a same request was already accessed in a chain of
* redirects .
* Since 2.5.0 , the default is to allow circular redirects .
* @ param allow { @ code true } if circular redirects should be allowed , { @ code false } otherwise
* @ since 2.4.0 */
public void setAllowCircularRedirects ( boolean allow ) { } }
|
client . getParams ( ) . setBooleanParameter ( HttpClientParams . ALLOW_CIRCULAR_REDIRECTS , allow ) ; clientViaProxy . getParams ( ) . setBooleanParameter ( HttpClientParams . ALLOW_CIRCULAR_REDIRECTS , allow ) ;
|
public class MDict { /** * / * Public methods */
public boolean clear ( ) { } }
|
if ( ! isMutable ( ) ) { throw new IllegalStateException ( "Cannot clear a non-mutable MDict" ) ; } if ( valCount == 0 ) { return true ; } mutate ( ) ; valueMap . clear ( ) ; if ( flDict != null ) { final FLDictIterator itr = new FLDictIterator ( ) ; try { itr . begin ( flDict ) ; String key ; while ( ( key = itr . getKeyString ( ) ) != null ) { valueMap . put ( key , MValue . EMPTY ) ; if ( ! itr . next ( ) ) { break ; } } } finally { itr . free ( ) ; } } valCount = 0 ; return true ;
|
public class ImageUtils { /** * Calculate coordinates in an image , assuming the image has been scaled from ( oH x oW ) pixels to ( nH x nW ) pixels
* @ param x X position ( pixels ) to translate
* @ param y Y position ( pixels ) to translate
* @ param origImageW Original image width ( pixels )
* @ param origImageH Original image height ( pixels )
* @ param newImageW New image width ( pixels )
* @ param newImageH New image height ( pixels )
* @ return New X and Y coordinates ( pixels , in new image ) */
public static double [ ] translateCoordsScaleImage ( double x , double y , double origImageW , double origImageH , double newImageW , double newImageH ) { } }
|
double newX = x * newImageW / origImageW ; double newY = y * newImageH / origImageH ; return new double [ ] { newX , newY } ;
|
public class DateTimeFormatter { /** * Prints a ReadablePartial to a new String .
* Neither the override chronology nor the override zone are used
* by this method .
* @ param partial partial to format
* @ return the printed result */
public String print ( ReadablePartial partial ) { } }
|
StringBuilder buf = new StringBuilder ( requirePrinter ( ) . estimatePrintedLength ( ) ) ; try { printTo ( ( Appendable ) buf , partial ) ; } catch ( IOException ex ) { // StringBuilder does not throw IOException
} return buf . toString ( ) ;
|
public class TransactionToDispatchableMap { /** * In the event that the connection is going down , we need to ensure that the dispatchable
* table is cleared of all references to transactions that were created by that connection .
* @ param clientId */
public void removeAllDispatchablesForTransaction ( int clientId ) { } }
|
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeAllDispatchablesForTransaction" , clientId ) ; idToFirstLevelEntryMap . remove ( clientId ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeAllDispatchablesForTransaction" ) ;
|
public class TableToReloadMarshaller { /** * Marshall the given parameter object . */
public void marshall ( TableToReload tableToReload , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( tableToReload == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( tableToReload . getSchemaName ( ) , SCHEMANAME_BINDING ) ; protocolMarshaller . marshall ( tableToReload . getTableName ( ) , TABLENAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class RuleCallImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public AbstractRule getRule ( ) { } }
|
if ( rule != null && rule . eIsProxy ( ) ) { InternalEObject oldRule = ( InternalEObject ) rule ; rule = ( AbstractRule ) eResolveProxy ( oldRule ) ; if ( rule != oldRule ) { if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . RESOLVE , XtextPackage . RULE_CALL__RULE , oldRule , rule ) ) ; } } return rule ;
|
public class ConstantsSummaryBuilder { /** * Parse the package name . We only want to display package name up to
* 2 levels . */
private String parsePackageName ( String pkgname ) { } }
|
int index = - 1 ; for ( int j = 0 ; j < MAX_CONSTANT_VALUE_INDEX_LENGTH ; j ++ ) { index = pkgname . indexOf ( "." , index + 1 ) ; } if ( index != - 1 ) { pkgname = pkgname . substring ( 0 , index ) ; } return pkgname ;
|
public class WaveformDetailComponent { /** * Figure out the starting waveform segment that corresponds to the specified coordinate in the window .
* @ param x the column being drawn
* @ return the offset into the waveform at the current scale and playback time that should be drawn there */
private int getSegmentForX ( int x ) { } }
|
if ( autoScroll . get ( ) ) { int playHead = ( x - ( getWidth ( ) / 2 ) ) ; int offset = Util . timeToHalfFrame ( getFurthestPlaybackPosition ( ) ) / scale . get ( ) ; return ( playHead + offset ) * scale . get ( ) ; } return x * scale . get ( ) ;
|
public class Project { /** * Set Repositories
* @ param urls List
* @ throws ProjectException exception */
public void setRepositories ( List < String > urls ) throws ProjectException { } }
|
List < Repository > repositories = new ArrayList < Repository > ( ) ; for ( String url : urls ) { try { Repository repository = RepoBuilder . repositoryFromUrl ( url ) ; repositories . add ( repository ) ; } catch ( MalformedURLException e ) { throw new ProjectException ( e ) ; } } getMavenModel ( ) . setRepositories ( repositories ) ;
|
public class AkkaInvocationHandler { /** * Checks whether any of the annotations is of type { @ link RpcTimeout } .
* @ param annotations Array of annotations
* @ return True if { @ link RpcTimeout } was found ; otherwise false */
private static boolean isRpcTimeout ( Annotation [ ] annotations ) { } }
|
for ( Annotation annotation : annotations ) { if ( annotation . annotationType ( ) . equals ( RpcTimeout . class ) ) { return true ; } } return false ;
|
public class MessageUtil { /** * Compose a message with String args . This is just a convenience so callers do not have to
* cast their String [ ] to an Object [ ] . */
public static String compose ( String key , String ... args ) { } }
|
return compose ( key , ( Object [ ] ) args ) ;
|
public class FlakeView { /** * Add the specified number of droidflakes . */
void addFlakes ( int quantity ) { } }
|
for ( int i = 0 ; i < quantity ; ++ i ) { flakes . add ( Flake . createFlake ( getWidth ( ) , droid ) ) ; } setNumFlakes ( numFlakes + quantity ) ;
|
public class LssClient { /** * List all your live security policys .
* @ return The list of all your live security policys */
public ListSecurityPoliciesResponse listSecurityPolicies ( ) { } }
|
ListSecurityPoliciesRequest request = new ListSecurityPoliciesRequest ( ) ; InternalRequest internalRequest = createRequest ( HttpMethodName . GET , request , LIVE_SECURITY_POLICY ) ; return invokeHttpClient ( internalRequest , ListSecurityPoliciesResponse . class ) ;
|
public class Engine { /** * Checks if all given variables are there and if so , that they evaluate to true inside an if . */
public boolean variablesAvailable ( Map < String , Object > model , String ... vars ) { } }
|
final TemplateContext context = new TemplateContext ( null , null , null , new ScopedMap ( model ) , modelAdaptor , this , new SilentErrorHandler ( ) , null ) ; for ( String var : vars ) { final IfToken token = new IfToken ( var , false ) ; if ( ! ( Boolean ) token . evaluate ( context ) ) { return false ; } } return true ;
|
public class JavaWriter { /** * Prints a string */
public void print ( String s ) throws IOException { } }
|
if ( _startLine ) printIndent ( ) ; if ( s == null ) { _lastCr = false ; _os . print ( "null" ) ; return ; } int len = s . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { int ch = s . charAt ( i ) ; if ( ch == '\n' && ! _lastCr ) _destLine ++ ; else if ( ch == '\r' ) _destLine ++ ; _lastCr = ch == '\r' ; _os . print ( ( char ) ch ) ; }
|
public class NamedRootsMap { /** * Have to be performed after the " normal " objects be written
* to DB and before method { @ link # performInsert ( ) } . */
public void performDeletion ( ) { } }
|
if ( deletionMap == null ) return ; else { PersistenceBroker broker = tx . getBroker ( ) ; Iterator it = deletionMap . values ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { NamedEntry namedEntry = ( NamedEntry ) it . next ( ) ; broker . delete ( namedEntry ) ; } }
|
public class ConcurrentSoftCache { /** * { @ inheritDoc } */
@ Override public Object convertValue ( SoftReference < V > value ) { } }
|
if ( null == value ) { return null ; } return value . get ( ) ;
|
public class VorbisFile { /** * additional data to offer since last call ( or at beginning of stream ) */
public int bitrate_instant ( ) { } }
|
int _link = ( seekable ? current_link : 0 ) ; if ( samptrack == 0 ) return ( - 1 ) ; int ret = ( int ) ( bittrack / samptrack * vi [ _link ] . rate + .5 ) ; bittrack = 0.f ; samptrack = 0.f ; return ( ret ) ;
|
public class HsqlDbms { /** * Return a quick datasource for the given hsqldatabase . */
DataSource getFastDataSource ( HsqlDatabaseDescriptor hsqlDatabase ) { } }
|
BasicDataSource bds = new BasicDataSource ( ) ; bds . setDriverClassName ( hsqlDatabase . getDriverClassName ( ) ) ; bds . setUsername ( hsqlDatabase . getUsername ( ) ) ; bds . setPassword ( hsqlDatabase . getPassword ( ) ) ; bds . setUrl ( hsqlDatabase . getUrl ( ) ) ; return bds ;
|
public class HttpClientResponseBuilder { /** * Adds action which returns provided response in UTF - 8 with status code .
* @ param statusCode status to return
* @ param response response to return
* @ return response builder */
public HttpClientResponseBuilder doReturn ( int statusCode , String response ) { } }
|
return doReturn ( statusCode , response , Charset . forName ( "UTF-8" ) ) ;
|
public class ByteUtils { /** * Converts a short into a byte array .
* @ param s
* a short
* @ param bo
* a ByteOrder
* @ return byte array */
public static byte [ ] toByteArray ( short s , ByteOrder bo ) { } }
|
return ByteBuffer . allocate ( 2 ) . order ( bo ) . putShort ( s ) . array ( ) ;
|
public class DexterInstance { /** * Method called whenever the inner activity has been created or restarted and is ready to be
* used . */
void onActivityReady ( Activity activity ) { } }
|
this . activity = activity ; PermissionStates permissionStates = null ; synchronized ( pendingPermissionsMutex ) { if ( activity != null ) { permissionStates = getPermissionStates ( pendingPermissions ) ; } } if ( permissionStates != null ) { handleDeniedPermissions ( permissionStates . getDeniedPermissions ( ) ) ; updatePermissionsAsDenied ( permissionStates . getImpossibleToGrantPermissions ( ) ) ; updatePermissionsAsGranted ( permissionStates . getGrantedPermissions ( ) ) ; }
|
public class ComputerVisionImpl { /** * This operation generates a description of an image in human readable language with complete sentences . The description is based on a collection of content tags , which are also returned by the operation . More than one description can be generated for each image . Descriptions are ordered by their confidence score . All descriptions are in English . Two input methods are supported - - ( 1 ) Uploading an image or ( 2 ) specifying an image URL . A successful response will be returned in JSON . If the request failed , the response will contain an error code and a message to help understand what went wrong .
* @ param url Publicly reachable URL of an image
* @ param maxCandidates Maximum number of candidate descriptions to be returned . The default is 1.
* @ param language The desired language for output generation . If this parameter is not specified , the default value is & amp ; quot ; en & amp ; quot ; . Supported languages : en - English , Default . es - Spanish , ja - Japanese , pt - Portuguese , zh - Simplified Chinese . Possible values include : ' en ' , ' es ' , ' ja ' , ' pt ' , ' zh '
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the ImageDescription object */
public Observable < ServiceResponse < ImageDescription > > describeImageWithServiceResponseAsync ( String url , String maxCandidates , String language ) { } }
|
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( url == null ) { throw new IllegalArgumentException ( "Parameter url is required and cannot be null." ) ; } ImageUrl imageUrl = new ImageUrl ( ) ; imageUrl . withUrl ( url ) ; String parameterizedHost = Joiner . on ( ", " ) . join ( "{Endpoint}" , this . client . endpoint ( ) ) ; return service . describeImage ( maxCandidates , language , this . client . acceptLanguage ( ) , imageUrl , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < ImageDescription > > > ( ) { @ Override public Observable < ServiceResponse < ImageDescription > > call ( Response < ResponseBody > response ) { try { ServiceResponse < ImageDescription > clientResponse = describeImageDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
|
public class CassandraJavaRDD { /** * Forces the rows within a selected Cassandra partition to be returned in descending order ( if
* possible ) . */
public CassandraJavaRDD < R > withDescOrder ( ) { } }
|
CassandraRDD < R > newRDD = rdd ( ) . withDescOrder ( ) ; return wrap ( newRDD ) ;
|
public class POIProxy { /** * This method is used to get the pois from a service and return a GeoJSON
* document with the data retrieved given a longitude , latitude and a radius
* in meters .
* @ param id
* The id of the service
* @ param lon
* The longitude
* @ param lat
* The latitude
* @ param distanceInMeters
* The distance in meters from the lon , lat
* @ return The GeoJSON response from the original service response */
public String getPOIs ( String id , double lon , double lat , double distanceInMeters , List < Param > optionalParams ) throws Exception { } }
|
DescribeService describeService = getDescribeServiceByID ( id ) ; double [ ] bbox = Calculator . boundingCoordinates ( lon , lat , distanceInMeters ) ; POIProxyEvent beforeEvent = new POIProxyEvent ( POIProxyEventEnum . BeforeBrowseLonLat , describeService , new Extent ( bbox [ 0 ] , bbox [ 1 ] , bbox [ 2 ] , bbox [ 3 ] ) , null , null , null , lon , lat , distanceInMeters , null , null , null ) ; notifyListenersBeforeRequest ( beforeEvent ) ; String geoJSON = getCacheData ( beforeEvent ) ; boolean fromCache = true ; if ( geoJSON == null ) { fromCache = false ; geoJSON = getResponseAsGeoJSON ( id , optionalParams , describeService , bbox [ 0 ] , bbox [ 1 ] , bbox [ 2 ] , bbox [ 3 ] , lon , lat , beforeEvent ) ; } POIProxyEvent afterEvent = new POIProxyEvent ( POIProxyEventEnum . AfterBrowseLonLat , describeService , new Extent ( bbox [ 0 ] , bbox [ 1 ] , bbox [ 2 ] , bbox [ 3 ] ) , null , null , null , lon , lat , distanceInMeters , null , geoJSON , null ) ; if ( ! fromCache ) { storeData ( afterEvent ) ; } notifyListenersBeforeRequest ( afterEvent ) ; return geoJSON ;
|
public class RendererModel { /** * Adds a change listener to the list of listeners .
* @ param listener
* The listener added to the list */
public void addCDKChangeListener ( ICDKChangeListener listener ) { } }
|
if ( listeners == null ) { listeners = new ArrayList < ICDKChangeListener > ( ) ; } if ( ! listeners . contains ( listener ) ) { listeners . add ( listener ) ; }
|
public class HeapWalker { /** * / * TBD
* < li > { @ link Arrays # asList ( Object . . . ) } < / li >
* < li > { @ link ArrayList } ( subclasses would be reduced to { @ link ArrayList } ) < / li >
* < li > { @ link HashMap } ( subclasses including { @ link LinkedHashMap } would be reduced to { @ link ArrayList } ) < / li >
* < li > { @ link HashSet } ( subclasses including { @ link LinkedHashSet } would be reduced to { @ link ArrayList } ) < / li > */
@ SuppressWarnings ( "unchecked" ) public static < T > T valueOf ( Instance obj ) { } }
|
if ( obj == null ) { return null ; } JavaClass t = obj . getJavaClass ( ) ; InstanceConverter c = CONVERTERS . get ( obj . getJavaClass ( ) . getName ( ) ) ; while ( c == null && t . getSuperClass ( ) != null ) { t = t . getSuperClass ( ) ; c = CONVERTERS . get ( obj . getJavaClass ( ) . getName ( ) ) ; } if ( c == null ) { // return instance as is
return ( T ) obj ; } else { return ( T ) c . convert ( obj ) ; }
|
public class DefaultFactHandle { /** * format _ version : id : identity : hashcode : recency
* @ see FactHandle */
public final String toExternalForm ( ) { } }
|
return getFormatVersion ( ) + ":" + this . id + ":" + getIdentityHashCode ( ) + ":" + getObjectHashCode ( ) + ":" + getRecency ( ) + ":" + ( ( this . entryPoint != null ) ? this . entryPoint . getEntryPointId ( ) : "null" ) + ":" + this . traitType . name ( ) + ":" + this . objectClassName ;
|
public class IDNA { /** * IDNA2003 : Compare two IDN strings for equivalence .
* This function splits the domain names into labels and compares them .
* According to IDN RFC , whenever two labels are compared , they are
* considered equal if and only if their ASCII forms ( obtained by
* applying toASCII ) match using an case - insensitive ASCII comparison .
* Two domain names are considered a match if and only if all labels
* match regardless of whether label separators match .
* @ param s1 First IDN string
* @ param s2 Second IDN string
* @ param options A bit set of options :
* - IDNA . DEFAULT Use default options , i . e . , do not process unassigned code points
* and do not use STD3 ASCII rules
* If unassigned code points are found the operation fails with
* ParseException .
* - IDNA . ALLOW _ UNASSIGNED Unassigned values can be converted to ASCII for query operations
* If this option is set , the unassigned code points are in the input
* are treated as normal Unicode code points .
* - IDNA . USE _ STD3 _ RULES Use STD3 ASCII rules for host name syntax restrictions
* If this option is set and the input does not satisfy STD3 rules ,
* the operation will fail with ParseException
* @ return 0 if the strings are equal , & gt ; 0 if s1 & gt ; s2 and & lt ; 0 if s1 & lt ; s2
* @ deprecated ICU 55 Use UTS 46 instead via { @ link # getUTS46Instance ( int ) } .
* @ hide original deprecated declaration */
@ Deprecated public static int compare ( String s1 , String s2 , int options ) throws StringPrepParseException { } }
|
if ( s1 == null || s2 == null ) { throw new IllegalArgumentException ( "One of the source buffers is null" ) ; } return IDNA2003 . compare ( s1 , s2 , options ) ;
|
public class Async { /** * Invokes the specified function asynchronously on the specified Scheduler and returns an Observable that
* emits the result .
* Note : The function is called immediately and once , not whenever an observer subscribes to the resulting
* Observable . Multiple subscriptions to this Observable observe the same return value .
* < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / start . s . png " alt = " " >
* @ param < T > the result value type
* @ param func function to run asynchronously
* @ param scheduler Scheduler to run the function on
* @ return an Observable that emits the function ' s result value , or notifies observers of an exception
* @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / Async - Operators # wiki - start " > RxJava Wiki : start ( ) < / a >
* @ see < a href = " http : / / msdn . microsoft . com / en - us / library / hh211721 . aspx " > MSDN : Observable . Start < / a > */
public static < T > Observable < T > start ( Func0 < T > func , Scheduler scheduler ) { } }
|
return startCallable ( func , scheduler ) ;
|
public class ModelsImpl { /** * Get one entity role for a given entity .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param cEntityId The composite entity extractor ID .
* @ param roleId entity role ID .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the EntityRole object */
public Observable < ServiceResponse < EntityRole > > getCompositeEntityRoleWithServiceResponseAsync ( UUID appId , String versionId , UUID cEntityId , UUID roleId ) { } }
|
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgumentException ( "Parameter versionId is required and cannot be null." ) ; } if ( cEntityId == null ) { throw new IllegalArgumentException ( "Parameter cEntityId is required and cannot be null." ) ; } if ( roleId == null ) { throw new IllegalArgumentException ( "Parameter roleId is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{Endpoint}" , this . client . endpoint ( ) ) ; return service . getCompositeEntityRole ( appId , versionId , cEntityId , roleId , this . client . acceptLanguage ( ) , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < EntityRole > > > ( ) { @ Override public Observable < ServiceResponse < EntityRole > > call ( Response < ResponseBody > response ) { try { ServiceResponse < EntityRole > clientResponse = getCompositeEntityRoleDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
|
public class IndexVectorUtil { /** * Saves the mapping from word to { @ link TernaryVector } to the specified
* file . */
public static void save ( Map < String , TernaryVector > wordToIndexVector , File output ) { } }
|
try { FileOutputStream fos = new FileOutputStream ( output ) ; ObjectOutputStream outStream = new ObjectOutputStream ( fos ) ; outStream . writeObject ( wordToIndexVector ) ; outStream . close ( ) ; } catch ( IOException ioe ) { throw new IOError ( ioe ) ; }
|
public class CrystalGeometryTools { /** * Calculates Cartesian vectors for unit cell axes from axes lengths and angles
* between axes .
* < p > To calculate Cartesian coordinates , it places the a axis on the x axes ,
* the b axis in the xy plane , making an angle gamma with the a axis , and places
* the c axis to fulfill the remaining constraints . ( See also
* < a href = " http : / / server . ccl . net / cca / documents / molecular - modeling / node4 . html " > the
* CCL archive < / a > . )
* @ param alength length of the a axis
* @ param blength length of the b axis
* @ param clength length of the c axis
* @ param alpha angle between b and c axes in degrees
* @ param beta angle between a and c axes in degrees
* @ param gamma angle between a and b axes in degrees
* @ return an array of Vector3d objects with the three Cartesian vectors representing
* the unit cell axes .
* @ cdk . keyword notional coordinates
* @ cdk . dictref blue - obelisk : convertNotionalIntoCartesianCoordinates */
public static Vector3d [ ] notionalToCartesian ( double alength , double blength , double clength , double alpha , double beta , double gamma ) { } }
|
Vector3d [ ] axes = new Vector3d [ 3 ] ; /* 1 . align the a axis with x axis */
axes [ 0 ] = new Vector3d ( ) ; axes [ 0 ] . x = alength ; axes [ 0 ] . y = 0.0 ; axes [ 0 ] . z = 0.0 ; double toRadians = Math . PI / 180.0 ; /* some intermediate variables */
double cosalpha = Math . cos ( toRadians * alpha ) ; double cosbeta = Math . cos ( toRadians * beta ) ; double cosgamma = Math . cos ( toRadians * gamma ) ; double singamma = Math . sin ( toRadians * gamma ) ; /* 2 . place the b is in xy plane making a angle gamma with a */
axes [ 1 ] = new Vector3d ( ) ; axes [ 1 ] . x = blength * cosgamma ; axes [ 1 ] . y = blength * singamma ; axes [ 1 ] . z = 0.0 ; /* 3 . now the c axis , with more complex maths */
axes [ 2 ] = new Vector3d ( ) ; double volume = alength * blength * clength * Math . sqrt ( 1.0 - cosalpha * cosalpha - cosbeta * cosbeta - cosgamma * cosgamma + 2.0 * cosalpha * cosbeta * cosgamma ) ; axes [ 2 ] . x = clength * cosbeta ; axes [ 2 ] . y = clength * ( cosalpha - cosbeta * cosgamma ) / singamma ; axes [ 2 ] . z = volume / ( alength * blength * singamma ) ; return axes ;
|
public class GSPCOLImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
|
switch ( featureID ) { case AfplibPackage . GSPCOL__RES1 : return getRES1 ( ) ; case AfplibPackage . GSPCOL__COLSPCE : return getCOLSPCE ( ) ; case AfplibPackage . GSPCOL__RES2 : return getRES2 ( ) ; case AfplibPackage . GSPCOL__COLSIZE1 : return getCOLSIZE1 ( ) ; case AfplibPackage . GSPCOL__COLSIZE2 : return getCOLSIZE2 ( ) ; case AfplibPackage . GSPCOL__COLSIZE3 : return getCOLSIZE3 ( ) ; case AfplibPackage . GSPCOL__COLSIZE4 : return getCOLSIZE4 ( ) ; case AfplibPackage . GSPCOL__COLVALUE : return getCOLVALUE ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
|
public class system_settings { /** * < pre >
* Converts API response of bulk operation into object and returns the object array in case of get request .
* < / pre > */
protected base_resource [ ] get_nitro_bulk_response ( nitro_service service , String response ) throws Exception { } }
|
system_settings_responses result = ( system_settings_responses ) service . get_payload_formatter ( ) . string_to_resource ( system_settings_responses . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == SESSION_NOT_EXISTS ) service . clear_session ( ) ; throw new nitro_exception ( result . message , result . errorcode , ( base_response [ ] ) result . system_settings_response_array ) ; } system_settings [ ] result_system_settings = new system_settings [ result . system_settings_response_array . length ] ; for ( int i = 0 ; i < result . system_settings_response_array . length ; i ++ ) { result_system_settings [ i ] = result . system_settings_response_array [ i ] . system_settings [ 0 ] ; } return result_system_settings ;
|
public class TimeSpanFormatter { /** * / * [ deutsch ]
* < p > Interpretiert den angegebenen Text entsprechend dem
* voreingestellten Formatmuster als Dauer . < / p >
* @ param textcustom textual representation to be parsed
* @ param offset start position for the parser
* @ return parsed duration
* @ throwsParseException ( for example in case of mixed signs or if trailing unparsed characters exist ) */
public S parse ( CharSequence text , int offset ) throws ParseException { } }
|
int pos = offset ; Map < Object , Long > unitsToValues = new HashMap < > ( ) ; for ( int i = 0 , n = this . items . size ( ) ; i < n ; i ++ ) { FormatItem < U > item = this . items . get ( i ) ; if ( item == OrItem . INSTANCE ) { break ; } int reply = item . parse ( unitsToValues , text , pos ) ; if ( reply < 0 ) { int found = - 1 ; for ( int j = i + 1 ; j < n ; j ++ ) { if ( this . items . get ( j ) == OrItem . INSTANCE ) { found = j ; break ; } } if ( found == - 1 ) { throw new ParseException ( "Cannot parse: " + text , ~ reply ) ; } else { unitsToValues . clear ( ) ; i = found ; } } else { pos = reply ; } } int len = text . length ( ) ; if ( pos < len ) { throw new ParseException ( "Unparsed trailing characters found: \"" + text . subSequence ( pos , len ) + "\" in \"" + text , pos ) ; } Long sign = unitsToValues . remove ( SIGN_KEY ) ; boolean negative = ( ( sign != null ) && ( sign . longValue ( ) < 0 ) ) ; Map < U , Long > map = new HashMap < > ( ) ; for ( Object key : unitsToValues . keySet ( ) ) { if ( this . type . isInstance ( key ) ) { map . put ( this . type . cast ( key ) , unitsToValues . get ( key ) ) ; } else { throw new ParseException ( "Duration type mismatched: " + unitsToValues , pos ) ; } } return this . convert ( map , negative ) ;
|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link BigInteger }
* { @ code > } */
@ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "skipCount" , scope = GetChildren . class ) public JAXBElement < BigInteger > createGetChildrenSkipCount ( BigInteger value ) { } }
|
return new JAXBElement < BigInteger > ( _GetTypeChildrenSkipCount_QNAME , BigInteger . class , GetChildren . class , value ) ;
|
public class Instance { /** * < pre >
* Name of the virtual machine where this instance lives . Only applicable
* for instances in App Engine flexible environment .
* & # 64 ; OutputOnly
* < / pre >
* < code > string vm _ name = 5 ; < / code > */
public java . lang . String getVmName ( ) { } }
|
java . lang . Object ref = vmName_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; vmName_ = s ; return s ; }
|
public class ParsedSelectStmt { /** * Concat elements to the XXXColumns list */
private static void insertToColumnList ( List < ParsedColInfo > columnList , List < ParsedColInfo > newCols ) { } }
|
for ( ParsedColInfo col : newCols ) { if ( ! columnList . contains ( col ) ) { columnList . add ( col ) ; } }
|
public class BigRational { /** * private , because we want to hide that we use BigDecimal internally */
private BigRational multiply ( BigDecimal value ) { } }
|
BigDecimal n = numerator . multiply ( value ) ; BigDecimal d = denominator ; return of ( n , d ) ;
|
public class CollUtil { /** * 新建LinkedList
* @ param values 数组
* @ param < T > 类型
* @ return LinkedList
* @ since 4.1.2 */
@ SafeVarargs public static < T > LinkedList < T > newLinkedList ( T ... values ) { } }
|
return ( LinkedList < T > ) list ( true , values ) ;
|
public class StructureTools { /** * Check to see if an Deuterated atom has a non deuterated brother in the group .
* @ param atom the input atom that is putatively deuterium
* @ param currentGroup the group the atom is in
* @ return true if the atom is deuterated and it ' s hydrogen equive exists . */
public static boolean hasNonDeuteratedEquiv ( Atom atom , Group currentGroup ) { } }
|
if ( atom . getElement ( ) == Element . D && currentGroup . hasAtom ( replaceFirstChar ( atom . getName ( ) , 'D' , 'H' ) ) ) { // If it ' s deuterated and has a non - deuterated brother
return true ; } return false ;
|
public class OffHeapConcurrentMap { /** * Performs the actual put operation putting the new address into the memory lookups . The write lock for the given
* key < b > must < / b > be held before calling this method .
* @ param bucketHeadAddress the entry address of the first element in the lookup
* @ param actualAddress the actual address if it is known or 0 . By passing this ! = 0 equality checks can be bypassed .
* If a value of 0 is provided this will use key equality .
* @ param newAddress the address of the new entry
* @ param key the key of the entry
* @ param requireReturn whether the return value is required
* @ return { @ code true } if the entry doesn ' t exists in memory and was newly create , { @ code false } otherwise */
private InternalCacheEntry < WrappedBytes , WrappedBytes > performPut ( long bucketHeadAddress , long actualAddress , long newAddress , WrappedBytes key , boolean requireReturn ) { } }
|
// Have to start new linked node list
if ( bucketHeadAddress == 0 ) { memoryLookup . putMemoryAddress ( key , newAddress ) ; entryCreated ( newAddress ) ; size . incrementAndGet ( ) ; return null ; } else { boolean replaceHead = false ; boolean foundPrevious = false ; // Whether the key was found or not - short circuit equality checks
InternalCacheEntry < WrappedBytes , WrappedBytes > previousValue = null ; long address = bucketHeadAddress ; // Holds the previous linked list address
long prevAddress = 0 ; // Keep looping until we get the tail end - we always append the put to the end
while ( address != 0 ) { long nextAddress = offHeapEntryFactory . getNext ( address ) ; if ( ! foundPrevious ) { // If the actualAddress was not known check key equality otherwise just compare with the address
if ( actualAddress == 0 ? offHeapEntryFactory . equalsKey ( address , key ) : actualAddress == address ) { foundPrevious = true ; if ( requireReturn ) { previousValue = offHeapEntryFactory . fromMemory ( address ) ; } entryReplaced ( newAddress , address ) ; // If this is true it means this was the first node in the linked list
if ( prevAddress == 0 ) { if ( nextAddress == 0 ) { // This branch is the case where our key is the only one in the linked list
replaceHead = true ; } else { // This branch is the case where our key is the first with another after
memoryLookup . putMemoryAddress ( key , nextAddress ) ; } } else { // This branch means our node was not the first , so we have to update the address before ours
// to the one we previously referenced
offHeapEntryFactory . setNext ( prevAddress , nextAddress ) ; // We purposely don ' t update prevAddress , because we have to keep it as the current pointer
// since we removed ours
address = nextAddress ; continue ; } } } prevAddress = address ; address = nextAddress ; } // If we didn ' t find the key previous , it means we are a new entry
if ( ! foundPrevious ) { entryCreated ( newAddress ) ; size . incrementAndGet ( ) ; } if ( replaceHead ) { memoryLookup . putMemoryAddress ( key , newAddress ) ; } else { // Now prevAddress should be the last link so we fix our link
offHeapEntryFactory . setNext ( prevAddress , newAddress ) ; } return previousValue ; }
|
public class VisualStudioParser { /** * { @ inheritDoc } */
@ Override public void processReport ( File report , final Map < String , CoverageMeasures > coverageData ) throws XMLStreamException { } }
|
LOG . debug ( "Parsing 'Visual Studio' format" ) ; StaxParser parser = new StaxParser ( ( SMHierarchicCursor rootCursor ) -> { rootCursor . advance ( ) ; collectModuleMeasures ( rootCursor . descendantElementCursor ( "module" ) , coverageData ) ; } ) ; parser . parse ( report ) ;
|
public class RecordSetsInner { /** * Lists all record sets in a DNS zone .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; RecordSetInner & gt ; object */
public Observable < ServiceResponse < Page < RecordSetInner > > > listByDnsZoneNextWithServiceResponseAsync ( final String nextPageLink ) { } }
|
return listByDnsZoneNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < RecordSetInner > > , Observable < ServiceResponse < Page < RecordSetInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < RecordSetInner > > > call ( ServiceResponse < Page < RecordSetInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listByDnsZoneNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ;
|
public class StubRunnerConfiguration { /** * Bean that initializes stub runners , runs them and on shutdown closes them . Upon its
* instantiation JAR with stubs is downloaded and unpacked to a temporary folder and
* WireMock server are started for each of those stubs
* @ return the batch stub runner bean */
@ Bean public BatchStubRunner batchStubRunner ( ) { } }
|
StubRunnerOptionsBuilder builder = builder ( ) ; if ( this . props . getProxyHost ( ) != null ) { builder . withProxy ( this . props . getProxyHost ( ) , this . props . getProxyPort ( ) ) ; } StubRunnerOptions stubRunnerOptions = builder . build ( ) ; BatchStubRunner batchStubRunner = new BatchStubRunnerFactory ( stubRunnerOptions , this . provider . get ( stubRunnerOptions ) , this . contractVerifierMessaging != null ? this . contractVerifierMessaging : new NoOpStubMessages ( ) ) . buildBatchStubRunner ( ) ; // TODO : Consider running it in a separate thread
RunningStubs runningStubs = batchStubRunner . runStubs ( ) ; registerPort ( runningStubs ) ; return batchStubRunner ;
|
public class MicrochipPotentiometerDeviceController { /** * Receives the current wiper ' s value from the device .
* @ param channel Which wiper
* @ param nonVolatile volatile or non - volatile value
* @ return The wiper ' s value
* @ throws IOException Thrown if communication fails or device returned a malformed result */
public int getValue ( final DeviceControllerChannel channel , final boolean nonVolatile ) throws IOException { } }
|
if ( channel == null ) { throw new RuntimeException ( "null-channel is not allowed. For devices " + "knowing just one wiper Channel.A is mandatory for " + "parameter 'channel'" ) ; } // choose proper memory address ( see TABLE 4-1)
byte memAddr = nonVolatile ? channel . getNonVolatileMemoryAddress ( ) : channel . getVolatileMemoryAddress ( ) ; // read current value
int currentValue = read ( memAddr ) ; return currentValue ;
|
public class Interceptors { /** * Get a chained interceptor which passes the invocation through the given interceptors .
* @ param instances the interceptors to pass through
* @ return the chained interceptor */
public static Interceptor getChainedInterceptor ( Collection < Interceptor > instances ) { } }
|
final int size = instances . size ( ) ; return size == 1 ? instances . iterator ( ) . next ( ) : new ChainedInterceptor ( instances . toArray ( Interceptor . EMPTY_ARRAY ) ) ;
|
public class Schema { /** * Compute the difference in { @ link ColumnMetaData }
* between this schema and the passed in schema .
* This is useful during the { @ link org . datavec . api . transform . TransformProcess }
* to identify what a process will do to a given { @ link Schema } .
* @ param schema the schema to compute the difference for
* @ return the metadata that is different ( in order )
* between this schema and the other schema */
public List < ColumnMetaData > differences ( Schema schema ) { } }
|
List < ColumnMetaData > ret = new ArrayList < > ( ) ; for ( int i = 0 ; i < schema . numColumns ( ) ; i ++ ) { if ( ! columnMetaData . contains ( schema . getMetaData ( i ) ) ) ret . add ( schema . getMetaData ( i ) ) ; } return ret ;
|
public class ListDominantLanguageDetectionJobsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListDominantLanguageDetectionJobsRequest listDominantLanguageDetectionJobsRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( listDominantLanguageDetectionJobsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listDominantLanguageDetectionJobsRequest . getFilter ( ) , FILTER_BINDING ) ; protocolMarshaller . marshall ( listDominantLanguageDetectionJobsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listDominantLanguageDetectionJobsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class DateOffsetScanListener { /** * Init Method . */
public void init ( RecordOwnerParent parent , String strSourcePrefix ) { } }
|
super . init ( parent , strSourcePrefix ) ; if ( this . getProperty ( "dayOffset" ) != null ) dayOffset = Integer . parseInt ( this . getProperty ( "dayOffset" ) ) ; if ( this . getProperty ( "monthOffset" ) != null ) monthOffset = Integer . parseInt ( this . getProperty ( "monthOffset" ) ) ; if ( this . getProperty ( "yearOffset" ) != null ) yearOffset = Integer . parseInt ( this . getProperty ( "yearOffset" ) ) ; if ( this . getProperty ( "endOfMonthFields" ) != null ) { String fields = this . getProperty ( "endOfMonthFields" ) ; eomFields = fields . split ( "," ) ; }
|
public class RoundRobin { /** * Return whether this { @ link RoundRobin } is still consistent and contains all items from the master { @ link Collection } and
* vice versa .
* @ param master the master collection containing source elements for this { @ link RoundRobin } .
* @ return { @ literal true } if this { @ link RoundRobin } is consistent with the master { @ link Collection } . */
public boolean isConsistent ( Collection < ? extends V > master ) { } }
|
Collection < ? extends V > collection = this . collection ; return collection . containsAll ( master ) && master . containsAll ( collection ) ;
|
public class Configuration { /** * Returns the configuration setting corresponding to the specified key .
* @ param key The key to the configuration setting .
* @ return The configuration setting corresponding to the specified key . */
@ SuppressWarnings ( "unchecked" ) public < T > T get ( String key ) { } }
|
Preconditions . checkArgument ( key != null && ! key . isEmpty ( ) , "Parameter 'key' must not be [" + key + "]" ) ; Context context = factory . enterContext ( ) ; try { if ( values . containsKey ( key ) ) { Object value = values . get ( key ) ; return ( T ) ( ( value instanceof Function ) ? ( ( Function ) value ) . call ( context , scope , ( Scriptable ) value , null ) : value ) ; } synchronized ( values ) { if ( values . containsKey ( key ) ) { Object value = values . get ( key ) ; return ( T ) ( ( value instanceof Function ) ? ( ( Function ) value ) . call ( context , scope , ( Scriptable ) value , null ) : value ) ; } else if ( key . equals ( ENDPOINTS ) ) { Object endpoints = scope . get ( ENDPOINTS ) ; if ( endpoints == null && configuration != null ) { endpoints = Collections2 . filter ( ( Collection < Class < ? > > ) get ( COMPONENTS ) , new Predicate < Class < ? > > ( ) { @ Override public boolean apply ( Class < ? > clazz ) { return clazz . isAnnotationPresent ( Endpoint . class ) ; } } ) ; } values . put ( ENDPOINTS , endpoints ) ; return ( T ) ( ( endpoints instanceof Function ) ? ( ( Function ) endpoints ) . call ( context , scope , ( Scriptable ) endpoints , null ) : endpoints ) ; } else if ( key . equals ( PIPELINE ) ) { Object pipeline = scope . get ( PIPELINE ) ; if ( pipeline == null && configuration != null ) { Pipeline < WebContext > p = configuration . pipeline ( ) ; p . remove ( 2 ) ; p . set ( 2 , "JaguarInvoke" , new Invoke ( ) { @ Override protected < E > E instantiate ( Class < E > endpoint ) throws Exception { return component ( endpoint ) ; } } ) ; pipeline = p ; } values . put ( PIPELINE , pipeline ) ; return ( T ) ( ( pipeline instanceof Function ) ? ( ( Function ) pipeline ) . call ( context , scope , ( Scriptable ) pipeline , null ) : pipeline ) ; } else if ( key . equals ( REQUEST_TYPES ) ) { Object requestTypes = scope . get ( REQUEST_TYPES ) ; if ( requestTypes == null && configuration != null ) { requestTypes = configuration . requestTypes ( ) ; } values . put ( REQUEST_TYPES , requestTypes ) ; return ( T ) ( ( requestTypes instanceof Function ) ? ( ( Function ) requestTypes ) . call ( context , scope , ( Scriptable ) requestTypes , null ) : requestTypes ) ; } else if ( key . equals ( RESPONSE_TYPES ) ) { Object responseTypes = scope . get ( RESPONSE_TYPES ) ; if ( responseTypes == null && configuration != null ) { responseTypes = configuration . responseTypes ( ) ; } values . put ( RESPONSE_TYPES , responseTypes ) ; return ( T ) ( ( responseTypes instanceof Function ) ? ( ( Function ) responseTypes ) . call ( context , scope , ( Scriptable ) responseTypes , null ) : responseTypes ) ; } else if ( key . equals ( ROUTING ) ) { Object routing = scope . get ( ROUTING ) ; if ( routing == null && configuration != null ) { routing = configuration . routing ( ) ; } values . put ( ROUTING , routing ) ; return ( T ) ( ( routing instanceof Function ) ? ( ( Function ) routing ) . call ( context , scope , ( Scriptable ) routing , null ) : routing ) ; } else if ( key . equals ( DEPLOYMENT ) ) { Object deployment = scope . get ( DEPLOYMENT ) ; values . put ( DEPLOYMENT , deployment ) ; return ( T ) ( ( deployment instanceof Function ) ? ( ( Function ) deployment ) . call ( context , scope , ( Scriptable ) deployment , null ) : deployment ) ; } else if ( key . equals ( COMPONENTS ) ) { Object components = scope . get ( COMPONENTS ) ; if ( components == null ) { components = components ( ) ; } values . put ( COMPONENTS , components ) ; return ( T ) ( ( components instanceof Function ) ? ( ( Function ) components ) . call ( context , scope , ( Scriptable ) components , null ) : components ) ; } else { Object value = scope . get ( key ) ; if ( value == null ) { return null ; } values . put ( key , value ) ; return ( T ) ( ( value instanceof Function ) ? ( ( Function ) value ) . call ( context , scope , ( Scriptable ) value , null ) : value ) ; } } } finally { Context . exit ( ) ; }
|
public class DummyRPCServiceImpl { /** * { @ inheritDoc } */
public List < Object > executeCommandOnAllNodes ( RemoteCommand command , boolean synchronous , Serializable ... args ) throws RPCException , SecurityException { } }
|
List < Object > result = new ArrayList < Object > ( 1 ) ; result . add ( executeCommand ( command , args ) ) ; return result ;
|
public class ClientSharedObject { /** * Broadcast send event to listeners
* @ param method
* Method name
* @ param params
* Params */
protected void notifySendMessage ( String method , List < ? > params ) { } }
|
for ( ISharedObjectListener listener : listeners ) { listener . onSharedObjectSend ( this , method , params ) ; }
|
public class BlurBuilder { /** * Sets the blur algorithm .
* NOTE : this probably never is necessary to do except for testing purpose , the default
* algorithm , which uses Android ' s { @ link android . support . v8 . renderscript . ScriptIntrinsicBlur }
* which is the best and fastest you getFromDiskCache on Android suffices in nearly every situation
* @ param algorithm */
public BlurBuilder algorithm ( EBlurAlgorithm algorithm ) { } }
|
data . blurAlgorithm = BuilderUtil . getIBlurAlgorithm ( algorithm , data . contextWrapper ) ; return this ;
|
public class SamoaToWekaInstanceConverter { /** * Weka attribute .
* @ param index the index
* @ param attribute the attribute
* @ return the weka . core . attribute */
protected weka . core . Attribute wekaAttribute ( int index , Attribute attribute ) { } }
|
weka . core . Attribute wekaAttribute ; if ( attribute . isNominal ( ) ) { wekaAttribute = new weka . core . Attribute ( attribute . name ( ) , attribute . getAttributeValues ( ) , index ) ; } else { wekaAttribute = new weka . core . Attribute ( attribute . name ( ) , index ) ; } // System . out . println ( wekaAttribute . name ( ) ) ;
// System . out . println ( wekaAttribute . isNominal ( ) ) ;
return wekaAttribute ;
|
public class FileIO { /** * Writes from an InputStream to a temporary file */
public static File writeToTempFile ( InputStream inputStream , String prefix , String suffix ) throws IOException { } }
|
File file = File . createTempFile ( prefix , "." + suffix ) ; writeToFile ( inputStream , file ) ; return file ;
|
public class GZipServletResponseWrapper { /** * Flushes all the streams for this response .
* @ throws IOException maybe */
public void flush ( ) throws IOException { } }
|
if ( printWriter != null ) { printWriter . flush ( ) ; } if ( gzipOutputStream != null ) { gzipOutputStream . flush ( ) ; }
|
public class JDBCInputFormat { /** * Closes all resources used .
* @ throws IOException Indicates that a resource could not be closed . */
@ Override public void close ( ) throws IOException { } }
|
try { resultSet . close ( ) ; } catch ( SQLException se ) { LOG . info ( "Inputformat couldn't be closed - " + se . getMessage ( ) ) ; } catch ( NullPointerException npe ) { } try { statement . close ( ) ; } catch ( SQLException se ) { LOG . info ( "Inputformat couldn't be closed - " + se . getMessage ( ) ) ; } catch ( NullPointerException npe ) { } try { dbConn . close ( ) ; } catch ( SQLException se ) { LOG . info ( "Inputformat couldn't be closed - " + se . getMessage ( ) ) ; } catch ( NullPointerException npe ) { }
|
public class MpMessages { /** * 群发视频消息给特定分组的人
* @ param group
* @ param mediaId
* @ param title
* @ param desc
* @ return */
public long video ( int group , String mediaId , String title , String desc ) { } }
|
return video ( new Filter ( false , String . valueOf ( group ) ) , null , mediaId , title , desc ) ;
|
public class AmqpChannel { /** * Fired when channel is Closed
* @ param e */
private void fireOnError ( ChannelEvent e ) { } }
|
List < EventListener > listeners = changes . getListenerList ( AMQP ) ; for ( EventListener listener : listeners ) { ChannelListener amqpListener = ( ChannelListener ) listener ; amqpListener . onError ( e ) ; }
|
public class ScrollableArea { /** * Creates and returns a new scrollable area .
* @ param top
* The top - most area , which should be scrollable , as a value of the enum { @ link Area } or
* null , if no area should be scrollable
* @ param bottom
* The bottom - most area , which should be scrollable , as a value of the enum { @ link
* Area } . If the top - most area is null , the bottom - most are must be null as well . The
* index of the bottom - most area must be at least the index of the top - most area */
public static ScrollableArea create ( @ Nullable final Area top , @ Nullable final Area bottom ) { } }
|
return new ScrollableArea ( top , bottom ) ;
|
public class RowCell { /** * A comparator that compares the cells by Bigtable native ordering :
* < ul >
* < li > Family lexicographically ascending
* < li > Qualifier lexicographically ascending
* < li > Timestamp in reverse chronological order
* < / ul >
* < p > Labels and values are not included in the comparison . */
public static Comparator < RowCell > compareByNative ( ) { } }
|
return new Comparator < RowCell > ( ) { @ Override public int compare ( RowCell c1 , RowCell c2 ) { return ComparisonChain . start ( ) . compare ( c1 . getFamily ( ) , c2 . getFamily ( ) ) . compare ( c1 . getQualifier ( ) , c2 . getQualifier ( ) , ByteStringComparator . INSTANCE ) . compare ( c2 . getTimestamp ( ) , c1 . getTimestamp ( ) ) . result ( ) ; } } ;
|
public class SecurityServletConfiguratorHelper { /** * Creates a list of zero or more security constraint objects that represent the
* security - constraint elements in web . xml and / or web - fragment . xml files .
* @ param securityConstraints a list of security constraints */
private void processSecurityConstraints ( List < com . ibm . ws . javaee . dd . web . common . SecurityConstraint > archiveSecurityConstraints , boolean denyUncoveredHttpMethods ) { } }
|
List < SecurityConstraint > securityConstraints = new ArrayList < SecurityConstraint > ( ) ; for ( com . ibm . ws . javaee . dd . web . common . SecurityConstraint archiveSecurityConstraint : archiveSecurityConstraints ) { SecurityConstraint securityConstraint = createSecurityConstraint ( archiveSecurityConstraint , denyUncoveredHttpMethods ) ; securityConstraints . add ( securityConstraint ) ; } if ( securityConstraintCollection == null ) { securityConstraintCollection = new SecurityConstraintCollectionImpl ( securityConstraints ) ; } else { securityConstraintCollection . addSecurityConstraints ( securityConstraints ) ; }
|
public class HttpHeaders { /** * Returns { @ code value } as a positive integer , or 0 if it is negative , or { @ code defaultValue } if
* it cannot be parsed . */
public static int parseSeconds ( String value , int defaultValue ) { } }
|
try { long seconds = Long . parseLong ( value ) ; if ( seconds > Integer . MAX_VALUE ) { return Integer . MAX_VALUE ; } else if ( seconds < 0 ) { return 0 ; } else { return ( int ) seconds ; } } catch ( NumberFormatException e ) { return defaultValue ; }
|
public class CommerceOrderItemLocalServiceBaseImpl { /** * Performs a dynamic query on the database and returns the matching rows .
* @ param dynamicQuery the dynamic query
* @ return the matching rows */
@ Override public < T > List < T > dynamicQuery ( DynamicQuery dynamicQuery ) { } }
|
return commerceOrderItemPersistence . findWithDynamicQuery ( dynamicQuery ) ;
|
public class CharsTrie { /** * pos is already after the leadUnit , and the lead unit has bit 15 reset . */
private static int readValue ( CharSequence chars , int pos , int leadUnit ) { } }
|
int value ; if ( leadUnit < kMinTwoUnitValueLead ) { value = leadUnit ; } else if ( leadUnit < kThreeUnitValueLead ) { value = ( ( leadUnit - kMinTwoUnitValueLead ) << 16 ) | chars . charAt ( pos ) ; } else { value = ( chars . charAt ( pos ) << 16 ) | chars . charAt ( pos + 1 ) ; } return value ;
|
public class TmdbTV { /** * Get the cast & crew information about a TV series .
* @ param tvID
* @ param language
* @ return
* @ throws com . omertron . themoviedbapi . MovieDbException */
public MediaCreditList getTVCredits ( int tvID , String language ) throws MovieDbException { } }
|
TmdbParameters parameters = new TmdbParameters ( ) ; parameters . add ( Param . ID , tvID ) ; parameters . add ( Param . LANGUAGE , language ) ; URL url = new ApiUrl ( apiKey , MethodBase . TV ) . subMethod ( MethodSub . CREDITS ) . buildUrl ( parameters ) ; String webpage = httpTools . getRequest ( url ) ; try { return MAPPER . readValue ( webpage , MediaCreditList . class ) ; } catch ( IOException ex ) { throw new MovieDbException ( ApiExceptionType . MAPPING_FAILED , "Failed to get credits" , url , ex ) ; }
|
public class WhiteboxImpl { /** * Throw exception when multiple constructor matches found .
* @ param constructors the constructors */
static void throwExceptionWhenMultipleConstructorMatchesFound ( Constructor < ? > [ ] constructors ) { } }
|
if ( constructors == null || constructors . length < 2 ) { throw new IllegalArgumentException ( "Internal error: throwExceptionWhenMultipleConstructorMatchesFound needs at least two constructors." ) ; } StringBuilder sb = new StringBuilder ( ) ; sb . append ( "Several matching constructors found, please specify the argument parameter types so that PowerMock can determine which method you're referring to.\n" ) ; sb . append ( "Matching constructors in class " ) . append ( constructors [ 0 ] . getDeclaringClass ( ) . getName ( ) ) . append ( " were:\n" ) ; for ( Constructor < ? > constructor : constructors ) { sb . append ( constructor . getName ( ) ) . append ( "( " ) ; final Class < ? > [ ] parameterTypes = constructor . getParameterTypes ( ) ; for ( Class < ? > paramType : parameterTypes ) { sb . append ( paramType . getName ( ) ) . append ( ".class " ) ; } sb . append ( ")\n" ) ; } throw new TooManyConstructorsFoundException ( sb . toString ( ) ) ;
|
public class DFSUtil { /** * Given the InetSocketAddress for any configured communication with a
* namenode , this method determines whether it is the configured
* communication channel for the " default " namenode .
* It does a reverse lookup on the list of default communication parameters
* to see if the given address matches any of them .
* Since the process of resolving URIs to Addresses is slightly expensive ,
* this utility method should not be used in performance - critical routines .
* @ param conf - configuration
* @ param address - InetSocketAddress for configured communication with NN .
* Configured addresses are typically given as URIs , but we may have to
* compare against a URI typed in by a human , or the server name may be
* aliased , so we compare unambiguous InetSocketAddresses instead of just
* comparing URI substrings .
* @ param keys - list of configured communication parameters that should
* be checked for matches . For example , to compare against RPC addresses ,
* provide the list DFS _ NAMENODE _ SERVICE _ RPC _ ADDRESS _ KEY ,
* DFS _ NAMENODE _ RPC _ ADDRESS _ KEY
* @ return - boolean confirmation if matched generic parameter */
public static boolean isDefaultNamenodeAddress ( Configuration conf , InetSocketAddress address , String ... keys ) { } }
|
for ( String key : keys ) { String candidateAddress = conf . get ( key ) ; if ( candidateAddress != null && address . equals ( NetUtils . createSocketAddr ( candidateAddress ) ) ) return true ; } return false ;
|
public class KUrl { /** * removes www , protocol and country
* @ return */
public KUrl unified ( ) { } }
|
KUrl res = new KUrl ( toUrlString ( false ) ) ; res . elements [ 0 ] = normalizeDomain ( elements [ 0 ] ) ; return res ;
|
public class RtfChapter { /** * Writes the RtfChapter and its contents */
public void writeContent ( final OutputStream result ) throws IOException { } }
|
if ( this . document . getLastElementWritten ( ) != null && ! ( this . document . getLastElementWritten ( ) instanceof RtfChapter ) ) { result . write ( DocWriter . getISOBytes ( "\\page" ) ) ; } result . write ( DocWriter . getISOBytes ( "\\sectd" ) ) ; document . getDocumentHeader ( ) . writeSectionDefinition ( result ) ; if ( this . title != null ) { this . title . writeContent ( result ) ; } for ( int i = 0 ; i < items . size ( ) ; i ++ ) { RtfBasicElement rbe = ( RtfBasicElement ) items . get ( i ) ; rbe . writeContent ( result ) ; } result . write ( DocWriter . getISOBytes ( "\\sect" ) ) ;
|
public class NDCG { /** * Computes the ideal < a
* href = " http : / / recsyswiki . com / wiki / Discounted _ Cumulative _ Gain "
* target = " _ blank " > discounted cumulative gain < / a > ( IDCG ) given the test set
* ( groundtruth items ) for a user .
* @ param user the user
* @ param userTestItems the groundtruth items of a user .
* @ return the IDCG */
private double computeIDCG ( final U user , final Map < I , Double > userTestItems ) { } }
|
double idcg = 0.0 ; // sort the items according to their relevance level
List < Double > sortedList = rankScores ( userTestItems ) ; int rank = 1 ; for ( double itemRel : sortedList ) { idcg += computeDCG ( itemRel , rank ) ; // compute at a particular cutoff
for ( int at : getCutoffs ( ) ) { if ( rank == at ) { Map < U , Double > m = userIdcgAtCutoff . get ( at ) ; if ( m == null ) { m = new HashMap < U , Double > ( ) ; userIdcgAtCutoff . put ( at , m ) ; } m . put ( user , idcg ) ; } } rank ++ ; } // assign the ndcg of the whole list to those cutoffs larger than the list ' s size
for ( int at : getCutoffs ( ) ) { if ( rank <= at ) { Map < U , Double > m = userIdcgAtCutoff . get ( at ) ; if ( m == null ) { m = new HashMap < U , Double > ( ) ; userIdcgAtCutoff . put ( at , m ) ; } m . put ( user , idcg ) ; } } return idcg ;
|
public class DrawerActivity { /** * Initializes the list that controls which fragment will be shown . */
private void initializeList ( ) { } }
|
mListView = ( ListView ) findViewById ( R . id . drawer_list ) ; mListAdapter = new ArrayAdapter < String > ( this , android . R . layout . simple_list_item_1 ) ; mListView . setAdapter ( mListAdapter ) ; mListView . setOnItemClickListener ( new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > adapterView , View view , int position , long id ) { mFragmentSwitcher . setCurrentItem ( position ) ; mDrawerLayout . closeDrawer ( Gravity . START ) ; } } ) ;
|
public class SourceFile { /** * Reads the code from the supplied source file . */
public void readFrom ( File source ) throws IOException { } }
|
// slurp our source file into newline separated strings
_lines = Lists . newArrayList ( ) ; BufferedReader bin = new BufferedReader ( new FileReader ( source ) ) ; String line = null ; while ( ( line = bin . readLine ( ) ) != null ) { _lines . add ( line ) ; } bin . close ( ) ; // now determine where to insert our static field declarations and our generated methods
int bstart = - 1 , bend = - 1 ; for ( int ii = 0 , nn = _lines . size ( ) ; ii < nn ; ii ++ ) { line = _lines . get ( ii ) . trim ( ) ; // look for the start of the class body
if ( GenUtil . NAME_PATTERN . matcher ( line ) . find ( ) ) { if ( line . endsWith ( "{" ) ) { bstart = ii + 1 ; } else { // search down a few lines for the open brace
for ( int oo = 1 ; oo < 10 ; oo ++ ) { if ( safeGetLine ( ii + oo ) . trim ( ) . endsWith ( "{" ) ) { bstart = ii + oo + 1 ; break ; } } } // track the last } on a line by itself and we ' ll call that the end of the class body
} else if ( line . equals ( "}" ) ) { bend = ii ; // look for our field and method markers
} else if ( line . equals ( FIELDS_START ) ) { _nstart = ii ; } else if ( line . equals ( FIELDS_END ) ) { _nend = ii + 1 ; } else if ( line . equals ( METHODS_START ) ) { _mstart = ii ; } else if ( line . equals ( METHODS_END ) ) { _mend = ii + 1 ; } } // sanity check the markers
check ( source , "fields start" , _nstart , "fields end" , _nend ) ; check ( source , "fields end" , _nend , "fields start" , _nstart ) ; check ( source , "methods start" , _mstart , "methods end" , _mend ) ; check ( source , "methods end" , _mend , "methods start" , _mstart ) ; // we have no previous markers then stuff the fields at the top of the class body and the
// methods at the bottom
if ( _nstart == - 1 ) { _nstart = bstart ; _nend = bstart ; } if ( _mstart == - 1 ) { _mstart = bend ; _mend = bend ; }
|
public class RepositoryManager { /** * Returns the { @ link Repository } instance with the given name .
* @ param repositoryName a { @ code non - null } string
* @ return a { @ link Repository } instance , never { @ code null }
* @ throws NoSuchRepositoryException if no repository with the given name exists . */
public static Repository getRepository ( String repositoryName ) throws NoSuchRepositoryException { } }
|
Repository repository = null ; try { repository = repositoriesContainer . getRepository ( repositoryName , Collections . unmodifiableMap ( factoryParams ) ) ; } catch ( RepositoryException e ) { throw new NoSuchRepositoryException ( WebJcrI18n . cannotInitializeRepository . text ( repositoryName ) , e ) ; } if ( repository == null ) { throw new NoSuchRepositoryException ( WebJcrI18n . repositoryNotFound . text ( repositoryName ) ) ; } return repository ;
|
public class FolderJob { /** * Create a folder on the server ( as a subfolder of this folder )
* @ param folderName name of the folder to be created .
* @ param crumbFlag true / false .
* @ return
* @ throws IOException in case of an error . */
public FolderJob createFolder ( String folderName , Boolean crumbFlag ) throws IOException { } }
|
// https : / / gist . github . com / stuart - warren / 7786892 was slightly helpful
// here
// TODO : JDK9 + : Map . of ( . . . )
Map < String , String > params = new HashMap < > ( ) ; params . put ( "mode" , "com.cloudbees.hudson.plugins.folder.Folder" ) ; params . put ( "name" , folderName ) ; params . put ( "from" , "" ) ; params . put ( "Submit" , "OK" ) ; client . post_form ( this . getUrl ( ) + "/createItem?" , params , crumbFlag ) ; return this ;
|
public class FunctionsInner { /** * Retrieves the default definition of a function based on the parameters specified .
* @ 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 jobName The name of the streaming job .
* @ param functionName The name of the function .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < FunctionInner > retrieveDefaultDefinitionAsync ( String resourceGroupName , String jobName , String functionName , final ServiceCallback < FunctionInner > serviceCallback ) { } }
|
return ServiceFuture . fromResponse ( retrieveDefaultDefinitionWithServiceResponseAsync ( resourceGroupName , jobName , functionName ) , serviceCallback ) ;
|
public class WebPage { /** * Constructs shortName from dir and extension ( if available ) , used in RssGenerator
* @ return Name */
public String constructShortName ( ) { } }
|
String result = shortName ; if ( dir != null ) { result = dir + "/" + result ; } if ( extension != null ) { result = result + "." + extension ; } return result ;
|
public class GuiUtilities { /** * Adds to a textfield and button the necessary to browse for a file .
* @ param pathTextField
* @ param browseButton
* @ param allowedExtensions */
public static void setFileBrowsingOnWidgets ( JTextField pathTextField , JButton browseButton , String [ ] allowedExtensions , Runnable postRunnable ) { } }
|
FileFilter filter = null ; if ( allowedExtensions != null ) { filter = new FileFilter ( ) { @ Override public String getDescription ( ) { return Arrays . toString ( allowedExtensions ) ; } @ Override public boolean accept ( File f ) { if ( f . isDirectory ( ) ) { return true ; } String name = f . getName ( ) ; for ( String ext : allowedExtensions ) { if ( name . toLowerCase ( ) . endsWith ( ext . toLowerCase ( ) ) ) { return true ; } } return false ; } } ; } FileFilter _filter = filter ; browseButton . addActionListener ( e -> { File lastFile = GuiUtilities . getLastFile ( ) ; File [ ] res = showOpenFilesDialog ( browseButton , "Select file" , false , lastFile , _filter ) ; if ( res != null && res . length == 1 ) { String absolutePath = res [ 0 ] . getAbsolutePath ( ) ; pathTextField . setText ( absolutePath ) ; setLastPath ( absolutePath ) ; if ( postRunnable != null ) { postRunnable . run ( ) ; } } } ) ;
|
public class StandardPacketOutputStream { /** * Flush the internal buffer .
* @ param commandEnd command end
* @ throws IOException id connection error occur . */
protected void flushBuffer ( boolean commandEnd ) throws IOException { } }
|
if ( pos > 4 ) { buf [ 0 ] = ( byte ) ( pos - 4 ) ; buf [ 1 ] = ( byte ) ( ( pos - 4 ) >>> 8 ) ; buf [ 2 ] = ( byte ) ( ( pos - 4 ) >>> 16 ) ; buf [ 3 ] = ( byte ) this . seqNo ++ ; checkMaxAllowedLength ( pos - 4 ) ; out . write ( buf , 0 , pos ) ; cmdLength += pos - 4 ; if ( traceCache != null && permitTrace ) { // trace last packets
traceCache . put ( new TraceObject ( true , NOT_COMPRESSED , Arrays . copyOfRange ( buf , 0 , pos > 1000 ? 1000 : pos ) ) ) ; } if ( logger . isTraceEnabled ( ) ) { if ( permitTrace ) { logger . trace ( "send: {}{}" , serverThreadLog , Utils . hexdump ( maxQuerySizeToLog , 0 , pos , buf ) ) ; } else { logger . trace ( "send: content length={} {} com=<hidden>" , pos - 4 , serverThreadLog ) ; } } // if last com fill the max size , must send an empty com to indicate command end .
if ( commandEnd && pos == MAX_PACKET_LENGTH ) { writeEmptyPacket ( ) ; } pos = 4 ; }
|
public class CmsSiteManagerImpl { /** * Set webserver script configuration . < p >
* @ param webserverscript path
* @ param targetpath path
* @ param configtemplate path
* @ param securetemplate path
* @ param filenameprefix to add to files
* @ param loggingdir path */
public void setWebServerScripting ( String webserverscript , String targetpath , String configtemplate , String securetemplate , String filenameprefix , String loggingdir ) { } }
|
m_apacheConfig = new HashMap < String , String > ( ) ; m_apacheConfig . put ( WEB_SERVER_CONFIG_WEBSERVERSCRIPT , webserverscript ) ; m_apacheConfig . put ( WEB_SERVER_CONFIG_TARGETPATH , targetpath ) ; m_apacheConfig . put ( WEB_SERVER_CONFIG_CONFIGTEMPLATE , configtemplate ) ; m_apacheConfig . put ( WEB_SERVER_CONFIG_SECURETEMPLATE , securetemplate ) ; m_apacheConfig . put ( WEB_SERVER_CONFIG_FILENAMEPREFIX , filenameprefix ) ; m_apacheConfig . put ( WEB_SERVER_CONFIG_LOGGINGDIR , loggingdir ) ;
|
public class TimedMapImpl { /** * 移除缓存对象并通知事件
* @ param key
* @ param expire 是否超时才执行的移除
* @ return */
protected TimedEntry < K , V > removeAndListener ( Object key , final boolean expire ) { } }
|
final TimedEntry < K , V > entry = entryMap . remove ( key ) ; try { if ( entry != null ) { // 通知被移除
final EventListener < K , V > listener = entry . listener ; entry . setListener ( null ) ; if ( listener != null ) { lisenterExecutor . execute ( new Runnable ( ) { @ Override public void run ( ) { try { listener . removed ( entry . getKey ( ) , entry . getValue ( ) , expire ) ; } catch ( Throwable e ) { log . error ( e . getMessage ( ) , e ) ; } } } ) ; } } } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } return entry ;
|
public class SampleExceptionHandler { /** * Exception handler that simply log progress state and progress information . */
@ Override public void handleException ( ProcessingLibraryException exception ) { } }
|
ProgressStatus status = exception . getStatus ( ) ; ProgressState state = status . getProgressState ( ) ; ProgressInfo info = status . getProgressInfo ( ) ; logger . error ( String . format ( "Exception. Progress State: %s. Progress Information: %s." , state , info ) ) ;
|
public class Widgets { /** * Retrieve the text from the TextBox , unless it is the specified default , in which case
* we return " " . */
public static String getText ( TextBoxBase box , String defaultAsBlank ) { } }
|
String s = box . getText ( ) . trim ( ) ; return s . equals ( defaultAsBlank ) ? "" : s ;
|
public class ResourceAdapterImpl { /** * Force adminobjects with new content .
* This method is thread safe
* @ param newContent the list of new properties */
public synchronized void forceAdminObjects ( List < AdminObject > newContent ) { } }
|
if ( newContent != null ) { this . adminobjects = new ArrayList < AdminObject > ( newContent ) ; } else { this . adminobjects = new ArrayList < AdminObject > ( 0 ) ; }
|
public class FileUtil { /** * 创建 { @ link RandomAccessFile }
* @ param path 文件Path
* @ param mode 模式 , 见 { @ link FileMode }
* @ return { @ link RandomAccessFile }
* @ since 4.5.2 */
public static RandomAccessFile createRandomAccessFile ( Path path , FileMode mode ) { } }
|
return createRandomAccessFile ( path . toFile ( ) , mode ) ;
|
public class AbstractCommand { /** * / * ( non - Javadoc )
* @ see ca . eandb . util . args . Command # process ( java . util . Queue , java . lang . Object ) */
public final void process ( Queue < String > argq , T state ) { } }
|
String [ ] args = argq . toArray ( new String [ argq . size ( ) ] ) ; argq . clear ( ) ; run ( args , state ) ;
|
public class AuthTokens { /** * The basic authentication scheme , using a username and a password .
* @ param username this is the " principal " , identifying who this token represents
* @ param password this is the " credential " , proving the identity of the user
* @ param realm this is the " realm " , specifies the authentication provider
* @ return an authentication token that can be used to connect to Neo4j
* @ see GraphDatabase # driver ( String , AuthToken )
* @ throws NullPointerException when either username or password is { @ code null } */
public static AuthToken basic ( String username , String password , String realm ) { } }
|
Objects . requireNonNull ( username , "Username can't be null" ) ; Objects . requireNonNull ( password , "Password can't be null" ) ; Map < String , Value > map = newHashMapWithSize ( 4 ) ; map . put ( SCHEME_KEY , value ( "basic" ) ) ; map . put ( PRINCIPAL_KEY , value ( username ) ) ; map . put ( CREDENTIALS_KEY , value ( password ) ) ; if ( realm != null ) { map . put ( REALM_KEY , value ( realm ) ) ; } return new InternalAuthToken ( map ) ;
|
public class ListVocabulariesResult { /** * A list of objects that describe the vocabularies that match the search criteria in the request .
* @ param vocabularies
* A list of objects that describe the vocabularies that match the search criteria in the request . */
public void setVocabularies ( java . util . Collection < VocabularyInfo > vocabularies ) { } }
|
if ( vocabularies == null ) { this . vocabularies = null ; return ; } this . vocabularies = new java . util . ArrayList < VocabularyInfo > ( vocabularies ) ;
|
public class WorkspaceQuotaManager { /** * { @ inheritDoc } */
public void start ( ) { } }
|
boolean isCoordinator ; try { isCoordinator = rpcService . isCoordinator ( ) ; } catch ( RPCException e ) { throw new IllegalStateException ( e . getMessage ( ) , e ) ; } if ( isCoordinator ) { try { quotaPersister . getWorkspaceDataSize ( rName , wsName ) ; } catch ( UnknownDataSizeException e ) { calculateWorkspaceDataSize ( ) ; } }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.