signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DisksInner { /** * Creates or updates a disk . * @ param resourceGroupName The name of the resource group . * @ param diskName The name of the managed disk that is being created . The name can ' t be changed after the disk is created . Supported characters for the name are a - z , A - Z , 0-9 and _ . T...
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , diskName , disk ) . toBlocking ( ) . last ( ) . body ( ) ;
public class Script { /** * Returns a list of the keys required by this script , assuming a multi - sig script . * @ throws ScriptException if the script type is not understood or is pay to address or is P2SH ( run this method on the " Redeem script " instead ) . */ public List < ECKey > getPubKeys ( ) { } }
if ( ! ScriptPattern . isSentToMultisig ( this ) ) throw new ScriptException ( ScriptError . SCRIPT_ERR_UNKNOWN_ERROR , "Only usable for multisig scripts." ) ; ArrayList < ECKey > result = Lists . newArrayList ( ) ; int numKeys = Script . decodeFromOpN ( chunks . get ( chunks . size ( ) - 2 ) . opcode ) ; for ( int i =...
public class WButton { /** * Override preparePaintComponent to register an AJAX operation if this button is AJAX enabled . * @ param request the request being responded to */ @ Override protected void preparePaintComponent ( final Request request ) { } }
super . preparePaintComponent ( request ) ; UIContext uic = UIContextHolder . getCurrent ( ) ; if ( isAjax ( ) && uic . getUI ( ) != null ) { AjaxTarget target = getAjaxTarget ( ) ; AjaxHelper . registerComponent ( target . getId ( ) , getId ( ) ) ; }
public class DoubleStream { /** * Returns the last element wrapped by { @ code OptionalDouble } class . * If stream is empty , returns { @ code OptionalDouble . empty ( ) } . * < p > This is a short - circuiting terminal operation . * @ return an { @ code OptionalDouble } with the last element * or { @ code Opt...
return reduce ( new DoubleBinaryOperator ( ) { @ Override public double applyAsDouble ( double left , double right ) { return right ; } } ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getMPSRGLength ( ) { } }
if ( mpsrgLengthEEnum == null ) { mpsrgLengthEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 52 ) ; } return mpsrgLengthEEnum ;
public class NioServer { /** * Handle a SelectionKey which was selected */ private void handleKey ( Selector selector , SelectionKey key ) throws IOException { } }
if ( key . isValid ( ) && key . isAcceptable ( ) ) { // Accept a new connection , give it a stream connection as an attachment SocketChannel newChannel = sc . accept ( ) ; newChannel . configureBlocking ( false ) ; SelectionKey newKey = newChannel . register ( selector , SelectionKey . OP_READ ) ; try { ConnectionHandl...
public class BasicWritable { /** * { @ inheritDoc } */ @ Override public void readFields ( DataInput in ) throws IOException { } }
try { values . clear ( ) ; int entries = in . readInt ( ) ; for ( int i = 0 ; i < entries ; i ++ ) { ValueWritable vw = new ValueWritable ( ) ; vw . readFields ( in ) ; values . add ( vw ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; throw new RuntimeException ( e ) ; }
public class TokenLoginModule { /** * Gets the required Callback objects needed by this login module . * @ param callbackHandler * @ return * @ throws IOException * @ throws UnsupportedCallbackException */ @ Override public Callback [ ] getRequiredCallbacks ( CallbackHandler callbackHandler ) throws IOException...
Callback [ ] callbacks = new Callback [ 3 ] ; callbacks [ 0 ] = new WSCredTokenCallbackImpl ( "Credential Token" ) ; callbacks [ 1 ] = new WSAuthMechOidCallbackImpl ( "AuthMechOid" ) ; callbacks [ 2 ] = new JwtTokenCallback ( ) ; callbackHandler . handle ( callbacks ) ; return callbacks ;
public class HSBColor { /** * { @ inheritDoc } */ @ Override public void parse ( final String ... parameters ) { } }
// Manage hue composite if ( parameters . length >= 1 ) { hueProperty ( ) . set ( readDouble ( parameters [ 0 ] , 0.0 , 360.0 ) ) ; } // Manage saturation composite if ( parameters . length >= 2 ) { saturationProperty ( ) . set ( readDouble ( parameters [ 1 ] , 0.0 , 1.0 ) ) ; } // Manage brightness composite if ( para...
public class DifficultMatcher { public void get ( Object rootVal , MatchSpaceKey msg , EvalCache cache , Object contextValue , SearchResults result ) throws MatchingException , BadMessageFormatMatchingException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "get" , "msg: " + msg + ", result: " + result ) ; // type never used so removed // int type ; List [ ] v = alwaysMatch . lists ; if ( v . length > 0 ) result . addObjects ( v ) ; if ( msg != null ) { int numExpr = ro...
public class CertificateHelper { /** * Convert the passed byte array to an X . 509 certificate object . * @ param aCertBytes * The original certificate bytes . May be < code > null < / code > or empty . * @ return < code > null < / code > if the passed byte array is < code > null < / code > or * empty * @ thr...
if ( ArrayHelper . isEmpty ( aCertBytes ) ) return null ; // Certificate is always ISO - 8859-1 encoded return convertStringToCertficate ( new String ( aCertBytes , CERT_CHARSET ) ) ;
public class AbstractJsonMapping { /** * Handle unknown properties and print a message * @ param key * @ param value */ @ JsonAnySetter protected void handleUnknown ( String key , Object value ) { } }
StringBuilder unknown = new StringBuilder ( this . getClass ( ) . getSimpleName ( ) ) ; unknown . append ( ": Unknown property='" ) . append ( key ) ; unknown . append ( "' value='" ) . append ( value ) . append ( "'" ) ; LOG . trace ( unknown . toString ( ) ) ;
public class TreeBuilder { /** * Listen to events on selective resources of the tree * @ param listener listener * @ param resourceSelector resource selector * @ return builder */ private TreeBuilder < T > listen ( Listener < T > listener , String resourceSelector ) { } }
return TreeBuilder . < T > builder ( new ListenerTree < T > ( build ( ) , listener , PathUtil . < T > resourceSelector ( resourceSelector ) ) ) ;
public class IpAccessControlList { /** * Create a IpAccessControlListUpdater to execute update . * @ param pathAccountSid The unique sid that identifies this account * @ param pathSid A string that identifies the resource to update * @ param friendlyName A human readable description of this resource * @ return ...
return new IpAccessControlListUpdater ( pathAccountSid , pathSid , friendlyName ) ;
public class LogicManagementClientImpl { /** * Lists all of the available Logic REST API operations . * ServiceResponse < PageImpl < OperationInner > > * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validati...
if ( nextPageLink == null ) { throw new IllegalArgumentException ( "Parameter nextPageLink is required and cannot be null." ) ; } String nextUrl = String . format ( "%s" , nextPageLink ) ; return service . listOperationsNext ( nextUrl , this . acceptLanguage ( ) , this . userAgent ( ) ) . flatMap ( new Func1 < Response...
public class DocumentRootImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public NotificationChain basicSetMetaData ( MetaDataType newMetaData , NotificationChain msgs ) { } }
return ( ( FeatureMap . Internal ) getMixed ( ) ) . basicAdd ( DroolsPackage . Literals . DOCUMENT_ROOT__META_DATA , newMetaData , msgs ) ;
public class CPDefinitionLinkPersistenceImpl { /** * Removes all the cp definition links where CProductId = & # 63 ; and type = & # 63 ; from the database . * @ param CProductId the c product ID * @ param type the type */ @ Override public void removeByCP_T ( long CProductId , String type ) { } }
for ( CPDefinitionLink cpDefinitionLink : findByCP_T ( CProductId , type , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpDefinitionLink ) ; }
public class FieldAccessor { /** * Tries to get the field ' s value . * @ return The field ' s value . * @ throws ReflectionException If the operation fails . */ @ SuppressFBWarnings ( value = "DP_DO_INSIDE_DO_PRIVILEGED" , justification = "Only called in test code, not production." ) public Object get ( ) { } }
field . setAccessible ( true ) ; try { return field . get ( object ) ; } catch ( IllegalAccessException e ) { throw new ReflectionException ( e ) ; }
public class TiffITProfile { /** * Validate Continuous Tone . * @ param ifd the ifd * @ param p the profile ( default = 0 , P1 = 1 , P2 = 2) */ private void validateIfdCT ( IFD ifd , int p ) { } }
IfdTags metadata = ifd . getMetadata ( ) ; boolean rgb = metadata . containsTagId ( TiffTags . getTagId ( "PhotometricInterpretation" ) ) && metadata . get ( TiffTags . getTagId ( "PhotometricInterpretation" ) ) . getFirstNumericValue ( ) == 2 ; boolean lab = metadata . containsTagId ( TiffTags . getTagId ( "Photometri...
public class GvmClusters { /** * Obtains the clusters for the points added . This method may be called * at any time , including between calls to add ( ) . * @ return the result of clustering the points thus far added */ public List < GvmResult < K > > results ( ) { } }
ArrayList < GvmResult < K > > list = new ArrayList < GvmResult < K > > ( count ) ; for ( int i = 0 ; i < count ; i ++ ) { GvmCluster < S , K > cluster = clusters [ i ] ; // TODO exclude massless clusters ? list . add ( new GvmResult < K > ( cluster ) ) ; } return list ;
public class Log4JLogger { /** * Check whether the Log4j Logger used is enabled for < code > ERROR < / code > * priority . */ public boolean isErrorEnabled ( ) { } }
if ( IS12 ) { return getLogger ( ) . isEnabledFor ( Level . ERROR ) ; } return getLogger ( ) . isEnabledFor ( Level . ERROR ) ;
public class Reference { /** * < p > newInstance . < / p > * @ param requirement a { @ link com . greenpepper . server . domain . Requirement } object . * @ param specification a { @ link com . greenpepper . server . domain . Specification } object . * @ param sut a { @ link com . greenpepper . server . domain . ...
return newInstance ( requirement , specification , sut , null ) ;
public class ErrorGroupServiceClient { /** * Get the specified group . * < p > Sample code : * < pre > < code > * try ( ErrorGroupServiceClient errorGroupServiceClient = ErrorGroupServiceClient . create ( ) ) { * GroupName groupName = GroupName . of ( " [ PROJECT ] " , " [ GROUP ] " ) ; * ErrorGroup response ...
GetGroupRequest request = GetGroupRequest . newBuilder ( ) . setGroupName ( groupName == null ? null : groupName . toString ( ) ) . build ( ) ; return getGroup ( request ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcPipeSegmentTypeEnum ( ) { } }
if ( ifcPipeSegmentTypeEnumEEnum == null ) { ifcPipeSegmentTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1033 ) ; } return ifcPipeSegmentTypeEnumEEnum ;
public class HikariCPSessionImpl { /** * { @ inheritDoc } */ public void begin ( ) { } }
if ( logger . isInfoEnabled ( ) ) { logger . info ( "Begin transaction." ) ; } try { Connection conn = dataSource . getConnection ( ) ; conn . setAutoCommit ( false ) ; provider . setConnection ( conn ) ; } catch ( SQLException ex ) { throw new SessionException ( "Failed to begin transaction." , ex ) ; }
public class RemoteCommandsFactory { /** * Creates an un - initialized command . Un - initialized in the sense that parameters will be set , but any components * specific to the cache in question will not be set . * You would typically set these parameters using { @ link CommandsFactory # initializeReplicableComman...
ReplicableCommand command ; if ( type == 0 ) { switch ( id ) { case PutKeyValueCommand . COMMAND_ID : command = new PutKeyValueCommand ( ) ; break ; case PutMapCommand . COMMAND_ID : command = new PutMapCommand ( ) ; break ; case RemoveCommand . COMMAND_ID : command = new RemoveCommand ( ) ; break ; case ReplaceCommand...
public class Task { /** * Retrieve the effective calendar for this task . If the task does not have * a specific calendar associated with it , fall back to using the default calendar * for the project . * @ return ProjectCalendar instance */ public ProjectCalendar getEffectiveCalendar ( ) { } }
ProjectCalendar result = getCalendar ( ) ; if ( result == null ) { result = getParentFile ( ) . getDefaultCalendar ( ) ; } return result ;
public class UnicodeDecompressor { /** * Decompress a byte array into a String . * @ param buffer The byte array to decompress . * @ return A String containing the decompressed characters . * @ see # decompress ( byte [ ] , int , int ) */ public static String decompress ( byte [ ] buffer ) { } }
char [ ] buf = decompress ( buffer , 0 , buffer . length ) ; return new String ( buf ) ;
public class JournalCreator { /** * Create a journal entry , add the arguments , and invoke the method . */ public String addDatastream ( Context context , String pid , String dsID , String [ ] altIDs , String dsLabel , boolean versionable , String MIMEType , String formatURI , String location , String controlGroup , S...
try { CreatorJournalEntry cje = new CreatorJournalEntry ( METHOD_ADD_DATASTREAM , context ) ; cje . addArgument ( ARGUMENT_NAME_PID , pid ) ; cje . addArgument ( ARGUMENT_NAME_DS_ID , dsID ) ; cje . addArgument ( ARGUMENT_NAME_ALT_IDS , altIDs ) ; cje . addArgument ( ARGUMENT_NAME_DS_LABEL , dsLabel ) ; cje . addArgume...
public class RecoveryManager { /** * Marks recovery as completed and signals the recovery director to this effect . */ public void recoveryComplete ( ) /* @ LIDB3187C */ { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "recoveryComplete" ) ; if ( ! _recoveryCompleted ) { _recoveryCompleted = true ; _recoveryInProgress . post ( ) ; } // Check for null currently required as z / OS creates this object with a null agent reference . if ( _agent != null ) { try { RecoveryDirectorFactory . re...
public class YamadaParser { /** * 设置缺省词性 * @ param pos * @ throws UnsupportedDataTypeException */ public void setDefaultPOS ( String pos ) throws UnsupportedDataTypeException { } }
int lpos = postagAlphabet . lookupIndex ( pos ) ; if ( lpos == - 1 ) { throw new UnsupportedDataTypeException ( "不支持词性:" + pos ) ; } defaultPOS = pos ;
public class NotExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public NotificationChain basicSetValue ( Expression newValue , NotificationChain msgs ) { } }
Expression oldValue = value ; value = newValue ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , SimpleAntlrPackage . NOT_EXPRESSION__VALUE , oldValue , newValue ) ; if ( msgs == null ) msgs = notification ; else msgs . add ( notification ) ; } ret...
public class InsertStack { /** * < p > This method is called once for each node during fringe * migration . If the node is not full we have found a home for the * migrating key which will now hold the key . If the node is full we * put the migrating key in its left - most slot and the new migrating * key is the...
boolean done = false ; if ( ! p . isFull ( ) ) /* Node is not full */ { /* We have a home for the migrating key */ _migrating = false ; done = true ; p . addLeftMostKey ( _mkey ) ; } else /* Node is full . Insert new key at left */ { /* and migrate the old right - most key */ Object migrateKey = p . addLeftMostKey ( _m...
public class XmlObjectPull { /** * Moves forward to the start of the next element that matches the given type and path without leaving the current sub - tree . If there is no other element of * that type in the current sub - tree , this mehtod will stop at the closing tab current sub - tree . Calling this methods wit...
return pullInternal ( type , null , path , true , true ) != null || mParser . getDepth ( ) == path . length ( ) + 1 ;
public class InvocableWampHandlerMethod { /** * Get the method argument values for the current request . */ private Object [ ] getMethodArgumentValues ( WampMessage message , Object ... providedArgs ) throws Exception { } }
MethodParameter [ ] parameters = getMethodParameters ( ) ; Object [ ] args = new Object [ parameters . length ] ; int argIndex = 0 ; for ( int i = 0 ; i < parameters . length ; i ++ ) { MethodParameter parameter = parameters [ i ] ; parameter . initParameterNameDiscovery ( this . parameterNameDiscoverer ) ; GenericType...
public class Logger { /** * Logs a message and stack trace if DEBUG logging is enabled * or a formatted message and exception description if ERROR logging is enabled . * @ param cause an exception to print stack trace of if DEBUG logging is enabled * @ param message a message */ public final void errorDebug ( fin...
logDebug ( Level . ERROR , cause , message ) ;
public class EllipticCurveSignatureHelper { /** * Transcodes the JCA ASN . 1 / DER - encoded signature into the concatenated * R + S format expected by ECDSA JWS . * @ param derSignature The ASN . 1 / DER - encoded . Must not be { @ code null } . * @ param outputLength The expected length of the ECDSA JWS signatu...
if ( derSignature . length < 8 || derSignature [ 0 ] != 48 ) { throw new GeneralSecurityException ( "Invalid ECDSA signature format" ) ; } int offset ; if ( derSignature [ 1 ] > 0 ) { offset = 2 ; } else if ( derSignature [ 1 ] == ( byte ) 0x81 ) { offset = 3 ; } else { throw new GeneralSecurityException ( "Invalid ECD...
public class RendererRequestUtils { /** * Returns the context path depending on the request mode ( SSL or not ) * @ param isSslRequest * the flag indicating that the request is an SSL request * @ return the context path depending on the request mode */ private static String getContextPathOverride ( boolean isSslR...
String contextPathOverride = null ; if ( isSslRequest ) { contextPathOverride = config . getContextPathSslOverride ( ) ; } else { contextPathOverride = config . getContextPathOverride ( ) ; } return contextPathOverride ;
public class PropertiesReplacementUtil { /** * Creates an InputStream containing the document resulting from replacing template * parameters in the given file . * @ param file The template file * @ param props The properties file * @ param base Properties that should override those loaded from the file * @ pa...
if ( env ) return replaceProperties ( replaceEnv ( file ) , loadProperties ( base , props ) ) ; else return replaceProperties ( file , loadProperties ( base , props ) ) ;
public class Worker { /** * create worker instance and run it * @ param conf storm conf * @ param topologyId topology id * @ param supervisorId supervisor iid * @ param port worker port * @ param workerId worker id * @ return WorkerShutDown * @ throws Exception */ @ SuppressWarnings ( "rawtypes" ) public ...
StringBuilder sb = new StringBuilder ( ) ; sb . append ( "topologyId:" ) . append ( topologyId ) . append ( ", " ) ; sb . append ( "port:" ) . append ( port ) . append ( ", " ) ; sb . append ( "workerId:" ) . append ( workerId ) . append ( ", " ) ; sb . append ( "jarPath:" ) . append ( jarPath ) . append ( "\n" ) ; LOG...
public class StreamingJsonBuilder { /** * A method call on the JSON builder instance will create a root object with only one key * whose name is the name of the method being called . * This method takes as arguments : * < ul > * < li > a closure < / li > * < li > a map ( ie . named arguments ) < / li > * < ...
boolean notExpectedArgs = false ; if ( args != null && Object [ ] . class . isAssignableFrom ( args . getClass ( ) ) ) { Object [ ] arr = ( Object [ ] ) args ; try { if ( arr . length == 0 ) { writer . write ( JsonOutput . toJson ( Collections . singletonMap ( name , Collections . emptyMap ( ) ) ) ) ; } else if ( arr ....
public class DataMediaPairServiceImpl { /** * / * - - - - - 查询方法 , 整合 - - - - - */ public List < DataMediaPair > listByIds ( Long ... identities ) { } }
List < DataMediaPair > dataMediaPairs = new ArrayList < DataMediaPair > ( ) ; try { List < DataMediaPairDO > dataMediaPairDos = null ; if ( identities . length < 1 ) { dataMediaPairDos = dataMediaPairDao . listAll ( ) ; if ( dataMediaPairDos . isEmpty ( ) ) { logger . debug ( "DEBUG ## couldn't query any dataMediaPair,...
public class CompactDecimalFormat { /** * Gets the currency data for a particular locale . * Currently only short currency format is supported , since that is * the only form in CLDR . * @ param locale The locale . * @ return The data which must not be modified . */ private Data getCurrencyData ( ULocale locale...
CompactDecimalDataCache . DataBundle bundle = cache . get ( locale ) ; return bundle . shortCurrencyData ;
public class EnvelopesApi { /** * Gets the templates associated with a document in an existing envelope . * Retrieves the templates associated with a document in the specified envelope . * @ param accountId The external account number ( int ) or account ID Guid . ( required ) * @ param envelopeId The envelopeId G...
return listTemplatesForDocument ( accountId , envelopeId , documentId , null ) ;
public class CmsEditUserAddInfoDialog { /** * Commits the edited user to the db . < p > */ @ Override public void actionCommit ( ) { } }
List < Throwable > errors = new ArrayList < Throwable > ( ) ; try { if ( ! Boolean . valueOf ( getParamEditall ( ) ) . booleanValue ( ) ) { // fill the values Iterator < CmsUserAddInfoBean > it = m_addInfoList . iterator ( ) ; while ( it . hasNext ( ) ) { CmsUserAddInfoBean infoBean = it . next ( ) ; if ( infoBean . ge...
public class JavacParser { /** * InnerCreator = [ Annotations ] Ident [ TypeArguments ] ClassCreatorRest */ JCExpression innerCreator ( int newpos , List < JCExpression > typeArgs , JCExpression encl ) { } }
List < JCAnnotation > newAnnotations = typeAnnotationsOpt ( ) ; JCExpression t = toP ( F . at ( token . pos ) . Ident ( ident ( ) ) ) ; if ( newAnnotations . nonEmpty ( ) ) { t = toP ( F . at ( newAnnotations . head . pos ) . AnnotatedType ( newAnnotations , t ) ) ; } if ( token . kind == LT ) { int oldmode = mode ; ch...
public class SameDiff { /** * Return a variable of given shape in which all values have a given constant value . * @ param value constant to set for each value * @ param shape shape of the variable as long array * @ return A new SDVariable of provided shape with constant value . */ @ Deprecated public SDVariable ...
return constant ( null , value , shape ) ;
public class BeanComparator { /** * Specifiy a Comparator to use on just the last { @ link # orderBy order - by } * property . This is good for comparing properties that are not * { @ link Comparable } or for applying special ordering rules for a * property . If no order - by properties have been specified , then...
BeanComparator < T > bc = new BeanComparator < T > ( this ) ; bc . mOrderByName = mOrderByName ; bc . mUsingComparator = c ; bc . mFlags = mFlags ; return bc ;
public class DeleteLaunchTemplateVersionsRequest { /** * The version numbers of one or more launch template versions to delete . * @ param versions * The version numbers of one or more launch template versions to delete . */ public void setVersions ( java . util . Collection < String > versions ) { } }
if ( versions == null ) { this . versions = null ; return ; } this . versions = new com . amazonaws . internal . SdkInternalList < String > ( versions ) ;
public class Unidecode { /** * Transliterate Unicode string to a initials . * @ param str Unicode String to initials . * @ return String initials . */ public static String initials ( final String str ) { } }
if ( str == null ) { return "" ; } StringBuilder sb = new StringBuilder ( ) ; Pattern p = Pattern . compile ( "^\\w|\\s+\\w" ) ; Matcher m = p . matcher ( decode ( str ) ) ; while ( m . find ( ) ) { sb . append ( m . group ( ) . replaceAll ( " " , "" ) ) ; } return sb . toString ( ) ;
public class Particle { /** * Update the state of this particle * @ param delta * The time since the last update */ public void update ( int delta ) { } }
emitter . updateParticle ( this , delta ) ; life -= delta ; if ( life > 0 ) { x += delta * velx ; y += delta * vely ; } else { engine . release ( this ) ; }
public class ReverseBinaryEncoder { /** * Copies the current contents of the Ion binary - encoded byte array into a * a given byte array . * The given array must be large enough to contain all the bytes of the * Ion binary - encoded byte array . * This makes an unchecked assumption that { { @ link # serialize (...
int length = myBuffer . length - myOffset ; System . arraycopy ( myBuffer , myOffset , dst , 0 , length ) ; return length ;
public class AgentManager { /** * Set state of agent . * @ param agent */ private void updateAgentState ( AsteriskAgentImpl agent , AgentState newState ) { } }
logger . info ( "Set state of agent " + agent . getAgentId ( ) + " to " + newState ) ; synchronized ( agent ) { agent . updateState ( newState ) ; }
public class GeoMatchSet { /** * An array of < a > GeoMatchConstraint < / a > objects , which contain the country that you want AWS WAF to search for . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setGeoMatchConstraints ( java . util . Collection ) } or { ...
if ( this . geoMatchConstraints == null ) { setGeoMatchConstraints ( new java . util . ArrayList < GeoMatchConstraint > ( geoMatchConstraints . length ) ) ; } for ( GeoMatchConstraint ele : geoMatchConstraints ) { this . geoMatchConstraints . add ( ele ) ; } return this ;
public class LdapHelper { /** * { @ inheritDoc } */ @ Override public Set < Node > findGroups ( QueryBuilder qb ) { } }
Set < Node > groups = new TreeSet < > ( ) ; String query = qb . getQuery ( ) ; try { SearchResult searchResult ; Attributes attributes ; SearchControls controls = new SearchControls ( ) ; controls . setReturningAttributes ( new String [ ] { LdapKeys . ASTERISK , LdapKeys . MODIFY_TIMESTAMP , LdapKeys . MODIFIERS_NAME }...
public class ExpressionsRetinaApiImpl { /** * { @ inheritDoc } */ @ Override public Fingerprint resolve ( Double sparsity , Model model ) throws JsonProcessingException , ApiException { } }
validateRequiredModels ( model ) ; LOG . debug ( "Resolve expression for model: " + model . toJson ( ) ) ; return this . expressionsApi . resolveExpression ( model . toJson ( ) , retinaName , sparsity ) ;
public class FileSystemDirectory { /** * / * ( non - Javadoc ) * @ see org . apache . lucene . store . Directory # createOutput ( java . lang . String ) */ public IndexOutput createOutput ( String name ) throws IOException { } }
Path file = new Path ( directory , name ) ; if ( fs . exists ( file ) && ! fs . delete ( file ) ) { // delete the existing one if applicable throw new IOException ( "Cannot overwrite index file " + file ) ; } return new FileSystemIndexOutput ( file , ioFileBufferSize ) ;
public class ClientHandshaker { /** * Returns the subject alternative name of the specified type in the * subjectAltNames extension of a certificate . */ private static Object getSubjectAltName ( X509Certificate cert , int type ) { } }
Collection < List < ? > > subjectAltNames ; try { subjectAltNames = cert . getSubjectAlternativeNames ( ) ; } catch ( CertificateParsingException cpe ) { if ( debug != null && Debug . isOn ( "handshake" ) ) { System . out . println ( "Attempt to obtain subjectAltNames extension failed!" ) ; } return null ; } if ( subje...
public class Filters { /** * Creates a new { @ link Filter } instance using the given impl class name , constructor arguments and type * @ param filterClassName * @ param ctorTypes * @ param ctorArguments * @ return */ @ SuppressWarnings ( "unchecked" ) private static Filter < ArchivePath > getFilterInstance ( ...
// Precondition checks assert filterClassName != null && filterClassName . length ( ) > 0 : "Filter class name must be specified" ; assert ctorTypes != null : "Construction types must be specified" ; assert ctorArguments != null : "Construction arguments must be specified" ; assert ctorTypes . length == ctorArguments ....
public class Validation { /** * validate * @ param c The spec metadata * @ param root The root directory of the expanded resource adapter archive * @ param report The destination of the report ; < code > null < / code > if an exception should be thrown instead * @ param cl The class loader * @ return The syst...
int exitCode = SUCCESS ; ClassLoader oldTCCL = SecurityActions . getThreadContextClassLoader ( ) ; try { SecurityActions . setThreadContextClassLoader ( cl ) ; List < Validate > validateClasses = new ArrayList < Validate > ( ) ; List < Failure > failures = new ArrayList < Failure > ( ) ; Validator validator = new Valid...
public class BasicFunctionsRuntime { /** * Rounds the given value to the closest integer . */ public static long round ( SoyValue value ) { } }
if ( value instanceof IntegerData ) { return value . longValue ( ) ; } else { return Math . round ( value . numberValue ( ) ) ; }
public class RenderUtils { /** * Returns a shortened version of the supplied RDF { @ code URI } . * @ param uri * the uri to shorten * @ return the shortened URI string */ @ Nullable public static String shortenURI ( @ Nullable final URI uri ) { } }
if ( uri == null ) { return null ; } final String prefix = Data . namespaceToPrefix ( uri . getNamespace ( ) , Data . getNamespaceMap ( ) ) ; if ( prefix != null ) { return prefix + ':' + uri . getLocalName ( ) ; } final String ns = uri . getNamespace ( ) ; return "&lt;.." + uri . stringValue ( ) . substring ( ns . len...
public class DatabaseUtil { /** * Retrieves all class labels within the database . * @ param database the database to be scanned for class labels * @ return a set comprising all class labels that are currently set in the * database */ public static SortedSet < ClassLabel > getClassLabels ( Relation < ? extends Cl...
SortedSet < ClassLabel > labels = new TreeSet < > ( ) ; for ( DBIDIter it = database . iterDBIDs ( ) ; it . valid ( ) ; it . advance ( ) ) { labels . add ( database . get ( it ) ) ; } return labels ;
public class AmazonGameLiftClient { /** * Updates Realtime script metadata and content . * To update script metadata , specify the script ID and provide updated name and / or version values . * To update script content , provide an updated zip file by pointing to either a local file or an Amazon S3 bucket * locat...
request = beforeClientExecution ( request ) ; return executeUpdateScript ( request ) ;
public class ScreenField { /** * Display this control ' s data in print ( view ) format . * @ return true if default params were found for this form . * @ param out The http output stream . * @ exception DBException File exception . */ public boolean printData ( PrintWriter out , int iPrintOptions ) { } }
if ( ! this . isInputField ( ) ) return false ; if ( this . isToolbar ( ) ) return false ; return this . getScreenFieldView ( ) . printData ( out , iPrintOptions ) ;
public class TriggersInner { /** * Creates or updates a trigger . * @ param deviceName Creates or updates a trigger * @ param name The trigger name . * @ param resourceGroupName The resource group name . * @ param trigger The trigger . * @ throws IllegalArgumentException thrown if parameters fail the validati...
return createOrUpdateWithServiceResponseAsync ( deviceName , name , resourceGroupName , trigger ) . toBlocking ( ) . last ( ) . body ( ) ;
public class CertificateOperations { /** * Deletes the certificate from the Batch account . * < p > The delete operation requests that the certificate be deleted . The request puts the certificate in the { @ link com . microsoft . azure . batch . protocol . models . CertificateState # DELETING Deleting } state . * ...
CertificateDeleteOptions options = new CertificateDeleteOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; this . parentBatchClient . protocolLayer ( ) . certificates ( ) . delete ( thumbprintAlgorithm , thumbprint...
public class ResponsiveDisplayAd { /** * Gets the formatSetting value for this ResponsiveDisplayAd . * @ return formatSetting * Specifies which format the ad will be served in . The default * value is ALL _ FORMATS . * < span class = " constraint Selectable " > This field * can be selected using the value " For...
return formatSetting ;
public class FilenameUtils { /** * Remove dots from string when we are on Linux / OS X * @ param fileName A filename string that might start with dots . * @ return Cleanup string with no dots anymore . */ private static String removeStartingDots ( String fileName ) { } }
// machte unter OS X / Linux Probleme , zB . bei dem Titel : " . . . . Paula " while ( ! fileName . isEmpty ( ) && ( fileName . startsWith ( "." ) ) ) { fileName = fileName . substring ( 1 , fileName . length ( ) ) ; } return fileName ;
public class CmsImportExportUserDialog { /** * Returns a map with the users to export added . < p > * @ param cms CmsObject * @ param groups the selected groups * @ param exportUsers the map to add the users * @ return a map with the users to export added * @ throws CmsException if getting groups or users of ...
if ( ( groups != null ) && ( groups . size ( ) > 0 ) ) { Iterator < String > itGroups = groups . iterator ( ) ; while ( itGroups . hasNext ( ) ) { List < CmsUser > groupUsers = cms . getUsersOfGroup ( itGroups . next ( ) ) ; Iterator < CmsUser > itGroupUsers = groupUsers . iterator ( ) ; while ( itGroupUsers . hasNext ...
public class RandSeq { /** * Applies the given < code > randSeq < / code > to rearrange the given sequence in a random order . * If < code > randSeq < / code > is < code > null < / code > , returns the sequence unchanged . */ public static < T > Iterator < T > reorderIf ( RandSeq randSeq , Iterator < T > sequence ) {...
return randSeq == null ? sequence : randSeq . reorder ( sequence ) ;
public class Event { /** * indexed setter for themes _ protein - sets an indexed value - * @ generated * @ param i index in the array to set * @ param v value to set into the array */ public void setThemes_protein ( int i , Protein v ) { } }
if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_protein == null ) jcasType . jcas . throwFeatMissing ( "themes_protein" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_prote...
public class PAbstractObject { /** * Get a property as a string or defaultValue . * @ param key the property name * @ param defaultValue the default value */ @ Override public final String optString ( final String key , final String defaultValue ) { } }
String result = optString ( key ) ; return result == null ? defaultValue : result ;
public class NodeSelectDialog { /** * This method initializes btnStart * @ return javax . swing . JButton */ private JButton getSelectButton ( ) { } }
if ( selectButton == null ) { selectButton = new JButton ( ) ; selectButton . setText ( Constant . messages . getString ( "siteselect.button.select" ) ) ; selectButton . setEnabled ( false ) ; // Enabled when a node is selected selectButton . addActionListener ( new java . awt . event . ActionListener ( ) { @ Override ...
public class ReflectionUtils { /** * Handle the given reflection exception . Should only be called if no checked exception is expected to be thrown by the * target method . * Throws the underlying RuntimeException or Error in case of an InvocationTargetException with such a root cause . Throws an * IllegalStateEx...
if ( ex instanceof NoSuchMethodException ) { throw new IllegalStateException ( "Method not found: " + ex . getMessage ( ) ) ; } if ( ex instanceof IllegalAccessException ) { throw new IllegalStateException ( "Could not access method: " + ex . getMessage ( ) ) ; } if ( ex instanceof InvocationTargetException ) { handleI...
public class DTDAttribute { /** * Note : the default implementation is not optimized , as it does * a potentially unnecessary copy of the contents . It is expected that * this method is seldom called ( Woodstox never directly calls it ; it * only gets called for chained validators when one validator normalizes ...
int len = value . length ( ) ; /* Temporary buffer has to come from the validator itself , since * attribute objects are stateless and shared . . . */ char [ ] cbuf = v . getTempAttrValueBuffer ( value . length ( ) ) ; if ( len > 0 ) { value . getChars ( 0 , len , cbuf , 0 ) ; } return validate ( v , cbuf , 0 , len ,...
public class PortTcpBuilder { /** * public void serverSocket ( ServerSocketBar serverSocket ) * _ serverSocket = serverSocket ; */ public SSLFactory sslFactory ( ) { } }
String opensslKey = _env . get ( portName ( ) + ".openssl.key" ) ; if ( opensslKey != null ) { return opensslFactory ( ) ; } String keyStore = _env . get ( portName ( ) + ".ssl.key-store" ) ; boolean isSsl = _env . get ( portName ( ) + ".ssl.enabled" , boolean . class , false ) ; if ( ! isSsl ) { return null ; } if ( k...
public class CommercePriceEntryUtil { /** * Returns the last commerce price entry in the ordered set where groupId = & # 63 ; . * @ param groupId the group ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching commerce price entry , ...
return getPersistence ( ) . fetchByGroupId_Last ( groupId , orderByComparator ) ;
public class Radial1Square { /** * < editor - fold defaultstate = " collapsed " desc = " Image related " > */ private BufferedImage create_FRAME_Image ( final int WIDTH , BufferedImage image ) { } }
if ( WIDTH <= 0 ) { return null ; } if ( image == null ) { image = UTIL . createImage ( WIDTH , WIDTH , Transparency . TRANSLUCENT ) ; } final Graphics2D G2 = image . createGraphics ( ) ; G2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; G2 . setRenderingHint ( Renderin...
public class WeightRandom { /** * 增加对象 * @ param obj 对象 * @ param weight 权重 * @ return this */ public WeightRandom < T > add ( T obj , double weight ) { } }
return add ( new WeightObj < T > ( obj , weight ) ) ;
public class WTabSet { /** * Returns the active indices ( as seen by the given context / session ) . * @ return the active tab indices ( may be an empty list ) . */ public List < Integer > getActiveIndices ( ) { } }
TabSetModel model = getOrCreateComponentModel ( ) ; // this model may be updated List < Integer > activeTabs = model . activeTabs ; // Remove invisible tabs from the active tab list if ( activeTabs != null ) { for ( Iterator < Integer > i = activeTabs . iterator ( ) ; i . hasNext ( ) ; ) { if ( ! isTabVisible ( i . nex...
public class VideoSelectorMarshaller { /** * Marshall the given parameter object . */ public void marshall ( VideoSelector videoSelector , ProtocolMarshaller protocolMarshaller ) { } }
if ( videoSelector == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( videoSelector . getColorSpace ( ) , COLORSPACE_BINDING ) ; protocolMarshaller . marshall ( videoSelector . getColorSpaceUsage ( ) , COLORSPACEUSAGE_BINDING ) ; protocolMar...
public class Units4JUtils { /** * Unmarshals the given data . A < code > null < / code > XML data argument returns < code > null < / code > . * @ param xmlData * XML data or < code > null < / code > . * @ param classesToBeBound * List of java classes to be recognized by the { @ link JAXBContext } . * @ return...
return JaxbUtils . unmarshal ( xmlData , classesToBeBound ) ;
public class AbstractFileTypeAnalyzer { /** * Utility method to help in the creation of the extensions set . This * constructs a new Set that can be used in a final static declaration . < / p > * This implementation was copied from * http : / / stackoverflow . com / questions / 2041778 / prepare - java - hashset ...
final Set < String > set = new HashSet < > ( strings . length ) ; Collections . addAll ( set , strings ) ; return set ;
public class AdministeredObjectResourceFactoryBuilder { /** * This method looks for existing configurations and removes them unless they came * from server . xml * We can distinguish by checking for the presence of a property named " config . source " * which is set to " file " when the configuration originates f...
final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; ConfigurationAdmin configAdmin = configAdminRef . getService ( ) ; Configuration [ ] existingConfigurations = configAdmin . listConfigurations ( filter ) ; if ( existingConfigurations != null ) for ( Configuration config : existingConfigurations ) { Dicti...
public class TrackerMeanShiftLikelihood { /** * Specifies the initial target location so that it can learn its description * @ param image Image * @ param initial Initial target location and the mean - shift bandwidth */ public void initialize ( T image , RectangleLength2D_I32 initial ) { } }
if ( ! image . isInBounds ( initial . x0 , initial . y0 ) ) throw new IllegalArgumentException ( "Initial rectangle is out of bounds!" ) ; if ( ! image . isInBounds ( initial . x0 + initial . width , initial . y0 + initial . height ) ) throw new IllegalArgumentException ( "Initial rectangle is out of bounds!" ) ; pdf ....
public class MwsConnection { /** * Create a new request . * After first call to this method connection parameters can no longer be * updated . * @ param servicePath * @ param operationName * @ return A new request . */ public MwsCall newCall ( String servicePath , String operationName ) { } }
if ( ! frozen ) { freeze ( ) ; } ServiceEndpoint sep = getServiceEndpoint ( servicePath ) ; // in future use sep + config to determine MwsCall implementation . return new MwsAQCall ( this , sep , operationName ) ;
public class DWRBeanGenerator { /** * Gets the appropriate path replacement string for a DWR container * @ param container * @ return */ private String getPathReplacementString ( Container container ) { } }
String path = JS_PATH_REF ; if ( null != container . getBean ( DWR_OVERRIDEPATH_PARAM ) ) { path = ( String ) container . getBean ( DWR_OVERRIDEPATH_PARAM ) ; } else if ( null != container . getBean ( DWR_MAPPING_PARAM ) ) { path = JS_CTX_PATH + container . getBean ( DWR_MAPPING_PARAM ) ; } return path ;
public class TableWorks { /** * Because of the way indexes and column data are held in memory and on * disk , it is necessary to recreate the table when an index is added to or * removed from a non - empty table . * < p > Originally , this method would break existing foreign keys as the * table order in the DB ...
Index index ; index = table . getIndex ( indexName ) ; if ( table . isIndexingMutable ( ) ) { table . dropIndex ( session , indexName ) ; } else { OrderedHashSet indexSet = new OrderedHashSet ( ) ; indexSet . add ( table . getIndex ( indexName ) . getName ( ) ) ; Table tn = table . moveDefinition ( session , table . ta...
public class UrlTextExample { /** * The domain ( actually authority component ) of an HTML5 URL . * If the input is not hierarchical , then the return value is undefined . */ static String domainOf ( String url ) { } }
int start = - 1 ; if ( url . startsWith ( "//" ) ) { start = 2 ; } else { start = url . indexOf ( "://" ) ; if ( start >= 0 ) { start += 3 ; } } if ( start < 0 ) { return null ; } for ( int i = 0 ; i < start - 3 ; ++ i ) { switch ( url . charAt ( i ) ) { case '/' : case '?' : case '#' : return null ; default : break ; ...
public class IO { /** * ObjectInputStream which doesn ' t care too much about serialVersionUIDs . Horrible : ) */ public static ObjectInputStream gullibleObjectInputStream ( InputStream is ) throws IOException { } }
return new ObjectInputStream ( is ) { @ Override protected ObjectStreamClass readClassDescriptor ( ) throws IOException , ClassNotFoundException { ObjectStreamClass oc = super . readClassDescriptor ( ) ; try { Class < ? > c = Class . forName ( oc . getName ( ) ) ; // interfaces do not have fields if ( ! c . isInterface...
public class QueryEngine { /** * Factory method to create a QueryEngine instance . * @ param manager An OWLOntologyManager instance of OWLAPI v3 * @ param reasoner An OWLReasoner instance . * @ param strictMode If strict mode is enabled the query engine will throw a QueryEngineException if data types withing the ...
return new QueryEngineImpl ( manager , reasoner , strict ) ;
public class Pairs { /** * Return a List of the second items from a list of pairs * @ param list list * @ param < T > first type * @ param < W > second type * @ return list of seconds */ public static < T , W > List < W > listSecond ( List < Pair < T , W > > list ) { } }
ArrayList < W > ts = new ArrayList < W > ( ) ; for ( Pair < T , W > twPair : list ) { ts . add ( twPair . getSecond ( ) ) ; } return ts ;
public class ValidationProcessor { /** * / * package private */ static String generateFieldContextDeclaration ( final String className , final String checkName , final String fieldName ) { } }
return "private static final net.sf.oval.context.OValContext " + checkName + "_CONTEXT" + " = new net.sf.oval.context.FieldContext(" + className + ".class, \"" + fieldName + "\");" ;
public class GenericTransactionManagerLookup { /** * Try to figure out which TransactionManager to use */ private void doLookups ( ClassLoader cl ) { } }
if ( lookupFailed ) return ; InitialContext ctx ; try { ctx = new InitialContext ( ) ; } catch ( NamingException e ) { log . failedToCreateInitialCtx ( e ) ; lookupFailed = true ; return ; } try { // probe jndi lookups first for ( LookupNames . JndiTransactionManager knownJNDIManager : LookupNames . JndiTransactionMana...
public class ObjToIntMap { /** * Get integer value assigned with key . * @ return key integer value or defaultValue if key is absent */ public int get ( Object key , int defaultValue ) { } }
if ( key == null ) { key = UniqueTag . NULL_VALUE ; } int index = findIndex ( key ) ; if ( 0 <= index ) { return values [ index ] ; } return defaultValue ;
public class AbstractMSBuildPluginMojo { /** * Calculate the relative path between the project and it ' s base directory . * For a project ( vcxproj ) file this will be an empty string . * For a solution ( sln ) file this will be the path from the soltuion to the project terminated with a \ * @ param vcProject th...
String relProjectDir = "" ; try { relProjectDir = getRelativeFile ( vcProject . getBaseDirectory ( ) , vcProject . getFile ( ) . getParentFile ( ) ) . getPath ( ) ; if ( "." . equals ( relProjectDir ) ) { relProjectDir = "" ; } else { relProjectDir += "\\" ; } } catch ( IOException ioe ) { throw new MojoExecutionExcept...
public class Schedule { /** * set the value port The port number on the server from which the task is being scheduled . Default * is 80 . When used with resolveURL , the URLs of retrieved documents that specify a port number are * automatically resolved to preserve links in the retrieved document . * @ param port...
if ( StringUtil . isEmpty ( oPort ) ) return ; this . port = Caster . toIntValue ( oPort ) ;
public class Google2445Utils { /** * Creates a recurrence iterator based on the given recurrence rule . * @ param recurrence the recurrence rule * @ param start the start date * @ param timezone the timezone to iterate in . This is needed in order to * account for when the iterator passes over a daylight saving...
DateValue startValue = convert ( start , timezone ) ; return RecurrenceIteratorFactory . createRecurrenceIterator ( recurrence , startValue , timezone ) ;
public class Properties { /** * Loads all of the properties represented by the XML document on the * specified input stream into this properties table . * < p > The XML document must have the following DOCTYPE declaration : * < pre > * & lt ; ! DOCTYPE properties SYSTEM " http : / / java . sun . com / dtd / pro...
XmlLoader loader = XmlLoader . INSTANCE ; if ( loader == null ) { throw new LibraryNotLinkedError ( "XML support" , "jre_xml" , "ComGoogleJ2objcUtilPropertiesXmlLoader" ) ; } loader . load ( this , in ) ;