signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class NodeTraversal { /** * Traverses a parse tree recursively . */ public void traverse ( Node root ) { } }
try { initTraversal ( root ) ; curNode = root ; pushScope ( root ) ; // null parent ensures that the shallow callbacks will traverse root traverseBranch ( root , null ) ; popScope ( ) ; } catch ( Error | Exception unexpectedException ) { throwUnexpectedException ( unexpectedException ) ; }
import java . util . ArrayList ; import java . util . regex . Matcher ; import java . util . regex . Pattern ; public class FindAeWords { /** * Function to find all words in the input string that start with ' a ' or ' e ' . * Example usage : * find _ ae _ words ( ' python program ' ) - > [ ' am ' ] * find _ ae _ ...
ArrayList < String > wordsList = new ArrayList < > ( ) ; Pattern p = Pattern . compile ( "[ae]\\w+" ) ; Matcher m = p . matcher ( inputString ) ; while ( m . find ( ) ) { wordsList . add ( m . group ( ) ) ; } return wordsList ;
public class KeyAgreementPeer { /** * < p > Computes the shared secret using the other peer ' s public key . < / p > * @ param key * @ return * @ throws InvalidKeyException */ public byte [ ] computeSharedSecret ( Key key ) throws InvalidKeyException { } }
keyAgreement . doPhase ( key , true ) ; return keyAgreement . generateSecret ( ) ;
public class AWSAppSyncClient { /** * Retrieves a < code > Type < / code > object . * @ param getTypeRequest * @ return Result of the GetType operation returned by the service . * @ throws BadRequestException * The request is not well formed . For example , a value is invalid or a required field is missing . Ch...
request = beforeClientExecution ( request ) ; return executeGetType ( request ) ;
public class TerminateWorkspacesRequest { /** * The WorkSpaces to terminate . You can specify up to 25 WorkSpaces . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setTerminateWorkspaceRequests ( java . util . Collection ) } or * { @ link # withTerminateWor...
if ( this . terminateWorkspaceRequests == null ) { setTerminateWorkspaceRequests ( new com . amazonaws . internal . SdkInternalList < TerminateRequest > ( terminateWorkspaceRequests . length ) ) ; } for ( TerminateRequest ele : terminateWorkspaceRequests ) { this . terminateWorkspaceRequests . add ( ele ) ; } return th...
public class NodeBuilder { /** * checks if we can add the requested keys + children to the builder , and if not we spill - over into our parent */ private void ensureRoom ( int nextBuildKeyPosition ) { } }
if ( nextBuildKeyPosition < MAX_KEYS ) return ; // flush even number of items so we don ' t waste leaf space repeatedly Object [ ] flushUp = buildFromRange ( 0 , FAN_FACTOR , isLeaf ( copyFrom ) , true ) ; ensureParent ( ) . addExtraChild ( flushUp , buildKeys [ FAN_FACTOR ] ) ; int size = FAN_FACTOR + 1 ; assert size ...
public class StructureIO { /** * Returns all biological assemblies for the given PDB id . * The output Structure will be different depending on the multiModel parameter : * < li > * the symmetry - expanded chains are added as new models , one per transformId . All original models but * the first one are discard...
checkInitAtomCache ( ) ; pdbId = pdbId . toLowerCase ( ) ; List < Structure > s = cache . getBiologicalAssemblies ( pdbId , multiModel ) ; return s ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcPropertyBoundedValue ( ) { } }
if ( ifcPropertyBoundedValueEClass == null ) { ifcPropertyBoundedValueEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 398 ) ; } return ifcPropertyBoundedValueEClass ;
public class PoiWorkbookConverters { /** * Returns { @ link EvaluationCell } of given { @ link EvaluationWorkbook } . * { @ link EvaluationWorkbook } should be created with { @ link # toEvaluationWorkbook ( Workbook ) } method . */ public static EvaluationCell getEvaluationCell ( EvaluationWorkbook evaluationWorkbook...
return ( ( PoiProxyWorkbook ) evaluationWorkbook ) . getSheet ( 0 ) . getCell ( addr . row ( ) , addr . column ( ) ) ;
public class CloseDownServiceImp { /** * ( non - Javadoc ) * @ see com . popbill . api . CloseDownService # CheckCorpNum */ @ Override public CorpState CheckCorpNum ( String MemberCorpNum , String CheckCorpNum ) throws PopbillException { } }
return httpget ( "/CloseDown?CN=" + CheckCorpNum , MemberCorpNum , null , CorpState . class ) ;
public class DBConn { /** * configured maximum number of retries . */ private void commitMutations ( DBTransaction dbTran , long timestamp ) { } }
Map < ByteBuffer , Map < String , List < Mutation > > > colMutMap = CassandraTransaction . getUpdateMap ( dbTran , timestamp ) ; if ( colMutMap . size ( ) == 0 ) { return ; } m_logger . debug ( "Committing {} mutations" , CassandraTransaction . totalColumnMutations ( dbTran ) ) ; // The batch _ mutate will be retried u...
public class TraceComponent { /** * Process a full trace specification of the form * = info : loggerX = fine and * set the corresponding trace flags for this trace component . */ private boolean updateTraceSpec ( TraceSpecification ts ) { } }
List < TraceElement > traceSpecs = ts . getSpecs ( ) ; Integer minimumLevel = null ; if ( ts . isSensitiveTraceSuppressed ( ) ) { minimumLevel = findMinimumSafeLevel ( ts . getSafeLevelsIndex ( ) ) ; } int newFineLevel = fineLevel ; int newFineLevelsEnabled = 0 ; int newSpecTraceLevel = TrLevelConstants . SPEC_TRACE_LE...
public class Channel { /** * Query approval status for all organizations . * @ param lifecycleQueryApprovalStatusRequest The request see { @ link LifecycleQueryApprovalStatusRequest } * @ param peers Peers to send the request . Usually only need one . * @ return A { @ link LifecycleQueryApprovalStatusProposalResp...
if ( null == lifecycleQueryApprovalStatusRequest ) { throw new InvalidArgumentException ( "The lifecycleQueryApprovalStatusRequest parameter can not be null." ) ; } checkChannelState ( ) ; checkPeers ( peers ) ; try { if ( IS_TRACE_LEVEL ) { String collectionData = "null" ; final org . hyperledger . fabric . protos . c...
public class IntDoubleHashVector { /** * Gets a NEW array containing all the elements in this vector . */ public double [ ] toNativeArray ( ) { } }
final double [ ] arr = new double [ getNumImplicitEntries ( ) ] ; iterate ( new FnIntDoubleToVoid ( ) { @ Override public void call ( int idx , double val ) { arr [ idx ] = val ; } } ) ; return arr ;
public class Threads { /** * Returns a CheckedFuture for the given CheckedAsync object */ public static < T , X extends Exception > CheckedFuture < T , X > checkedFuture ( final CheckedAsync < T , X > async ) { } }
return Futures . makeChecked ( future ( async ) , async ) ;
public class JinjavaListELResolver { /** * Convert the given property to an index . Inspired by * ListELResolver . toIndex , but without the base param since we only use it for * getValue where base is null . * @ param property * The name of the property to analyze . Will be coerced to a String . * @ return T...
int index = 0 ; if ( property instanceof Number ) { index = ( ( Number ) property ) . intValue ( ) ; } else if ( property instanceof String ) { try { // ListELResolver uses valueOf , but findbugs complains . index = Integer . parseInt ( ( String ) property ) ; } catch ( NumberFormatException e ) { throw new IllegalArgu...
public class ProcessorGraphNode { /** * Return input mapper from processor . */ @ Nonnull public BiMap < String , String > getInputMapper ( ) { } }
final BiMap < String , String > inputMapper = this . processor . getInputMapperBiMap ( ) ; if ( inputMapper == null ) { return HashBiMap . create ( ) ; } return inputMapper ;
public class SharedPreferenceUtils { /** * Inflate menu item for debug . * @ param inflater : * MenuInflater to inflate the menu . * @ param menu * : Menu object to inflate debug menu . */ public void inflateDebugMenu ( MenuInflater inflater , Menu menu ) { } }
inflater . inflate ( R . menu . debug , menu ) ;
public class ModelConstraints { /** * Gathers the pk fields from the hierarchy of the given class , and copies them into the class . * @ param classDef The root of the hierarchy * @ throws ConstraintException If there is a conflict between the pk fields */ private void ensurePKsFromHierarchy ( ClassDescriptorDef cl...
SequencedHashMap pks = new SequencedHashMap ( ) ; for ( Iterator it = classDef . getAllExtentClasses ( ) ; it . hasNext ( ) ; ) { ClassDescriptorDef subTypeDef = ( ClassDescriptorDef ) it . next ( ) ; ArrayList subPKs = subTypeDef . getPrimaryKeys ( ) ; // check against already present PKs for ( Iterator pkIt = subPKs ...
public class IntegerBestFitAllocator { /** * Unlink steps : * 1 . If x is a chained node , unlink it from its same - sized fd / bk links * and choose its bk node as its replacement . * 2 . If x was the last node of its size , but not a leaf node , it must * be replaced with a leaf node ( not merely one with an ...
int xp = parent ( x ) ; int r ; if ( backward ( x ) != x ) { int f = forward ( x ) ; r = backward ( x ) ; if ( okAddress ( f ) ) { backward ( f , r ) ; forward ( r , f ) ; } else { throw new AssertionError ( ) ; } } else { int rpIndex ; if ( ( ( r = child ( x , rpIndex = 1 ) ) != - 1 ) || ( ( r = child ( x , rpIndex = ...
public class AmazonRDSClient { /** * Promotes a Read Replica DB instance to a standalone DB instance . * < note > * < ul > * < li > * Backup duration is a function of the amount of changes to the database since the previous backup . If you plan to * promote a Read Replica to a standalone instance , we recomme...
request = beforeClientExecution ( request ) ; return executePromoteReadReplica ( request ) ;
public class SourceParams { /** * Create parameters necessary to create a 3D Secure source . * @ param amount A positive integer in the smallest currency unit representing the amount to * charge the customer ( e . g . , 1099 for a € 10.99 payment ) . * @ param currency The currency the payment is being created in...
return new SourceParams ( ) . setType ( Source . THREE_D_SECURE ) . setCurrency ( currency ) . setAmount ( amount ) . setRedirect ( createSimpleMap ( FIELD_RETURN_URL , returnUrl ) ) . setApiParameterMap ( createSimpleMap ( FIELD_CARD , cardID ) ) ;
public class ConfirmPinActivity { /** * Implementation of BasePinActivity method * @ param pin PIN value entered by user */ @ Override public final void onCompleted ( String pin ) { } }
resetStatus ( ) ; if ( isPinCorrect ( pin ) ) { setResult ( SUCCESS ) ; finish ( ) ; } else { setLabel ( getString ( R . string . message_invalid_pin ) ) ; }
public class RBBIDataWrapper { /** * / CLOVER : OFF */ private void dumpCharCategories ( java . io . PrintStream out ) { } }
int n = fHeader . fCatCount ; String catStrings [ ] = new String [ n + 1 ] ; int rangeStart = 0 ; int rangeEnd = 0 ; int lastCat = - 1 ; int char32 ; int category ; int lastNewline [ ] = new int [ n + 1 ] ; for ( category = 0 ; category <= fHeader . fCatCount ; category ++ ) { catStrings [ category ] = "" ; } out . pri...
public class CmsReplaceDialog { /** * Initializes the dialog content . < p > * @ param structureId the structure id of the file to replace */ protected void initContent ( final CmsUUID structureId ) { } }
CmsRpcAction < CmsReplaceInfo > action = new CmsRpcAction < CmsReplaceInfo > ( ) { @ Override public void execute ( ) { start ( 0 , true ) ; CmsCoreProvider . getVfsService ( ) . getFileReplaceInfo ( structureId , this ) ; } @ Override protected void onResponse ( CmsReplaceInfo result ) { initContent ( result ) ; stop ...
public class FunctionBodyAnalyzer { /** * Record information about the side effects caused by assigning a value to a given LHS . * < p > If the operation modifies this or taints global state , mark the enclosing function as * having those side effects . * @ param sideEffectInfo Function side effect record to be u...
for ( Node lhs : lhsNodes ) { if ( NodeUtil . isGet ( lhs ) ) { if ( lhs . getFirstChild ( ) . isThis ( ) ) { sideEffectInfo . setMutatesThis ( ) ; } else { Node objectNode = lhs . getFirstChild ( ) ; if ( objectNode . isName ( ) ) { Var var = scope . getVar ( objectNode . getString ( ) ) ; if ( isVarDeclaredInSameCont...
public class Collectors { /** * Returns a { @ code Collector } that accumulates the input elements into a * new { @ code List } . There are no guarantees on the type , mutability , * serializability , or thread - safety of the { @ code List } returned ; if more * control over the returned { @ code List } is requi...
return new CollectorImpl < > ( ( Supplier < List < T > > ) ArrayList :: new , List :: add , ( left , right ) -> { left . addAll ( right ) ; return left ; } , CH_ID ) ;
public class ThemeManager { /** * Set the current theme . Should be called in main thread ( UI thread ) . * @ param theme The current theme . * @ return True if set theme successfully , False if method ' s called on main thread or theme already set . */ public boolean setCurrentTheme ( int theme ) { } }
if ( Looper . getMainLooper ( ) . getThread ( ) != Thread . currentThread ( ) ) return false ; if ( mCurrentTheme != theme ) { mCurrentTheme = theme ; SharedPreferences pref = getSharedPreferences ( mContext ) ; if ( pref != null ) pref . edit ( ) . putInt ( KEY_THEME , mCurrentTheme ) . apply ( ) ; dispatchThemeChange...
public class PriorityQueue { /** * Purges the content of the priority queue . This closes the queue and * wakes up any blocked threads */ public void purge ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "purge" ) ; synchronized ( queueMonitor ) { state = CLOSED ; for ( int i = 0 ; i < JFapChannelConstants . MAX_PRIORITY_LEVELS - 1 ; ++ i ) { queueArray [ i ] . monitor . setActive ( false ) ; } closeWaitersMonitor . s...
public class FactoredSequenceListener { /** * Informs this sequence model that the value of the element at position pos has changed . * This allows this sequence model to update its internal model if desired . */ public void updateSequenceElement ( int [ ] sequence , int pos , int oldVal ) { } }
if ( models != null ) { for ( int i = 0 ; i < models . length ; i ++ ) models [ i ] . updateSequenceElement ( sequence , pos , oldVal ) ; return ; } model1 . updateSequenceElement ( sequence , pos , 0 ) ; model2 . updateSequenceElement ( sequence , pos , 0 ) ;
public class LazyCsvAnnotationBeanReader { /** * 1行目のレコードをヘッダー情報として読み込んで 、 カラム情報を初期化を行います 。 * @ return 読み込んだヘッダー情報 * @ throws SuperCsvNoMatchColumnSizeException ヘッダーのサイズ ( カラム数 ) がBean定義と一致しない場合 。 * @ throws SuperCsvNoMatchHeaderException ヘッダーの値がBean定義と一致しない場合 。 * @ throws SuperCsvException 引数firstLin...
// ヘッダーを元に 、 カラム情報の番号を補完する final String [ ] headers = getHeader ( true ) ; init ( headers ) ; return headers ;
public class NodeModelUtils { /** * / * @ Nullable */ public static EObject findActualSemanticObjectFor ( /* @ Nullable */ INode node ) { } }
if ( node == null ) return null ; if ( node . hasDirectSemanticElement ( ) ) return node . getSemanticElement ( ) ; EObject grammarElement = node . getGrammarElement ( ) ; ICompositeNode parent = node . getParent ( ) ; if ( grammarElement == null ) return findActualSemanticObjectFor ( parent ) ; Assignment assignment =...
public class AWSOpsWorksCMClient { /** * Describes backups . The results are ordered by time , with newest backups first . If you do not specify a BackupId * or ServerName , the command returns all backups . * This operation is synchronous . * A < code > ResourceNotFoundException < / code > is thrown when the bac...
request = beforeClientExecution ( request ) ; return executeDescribeBackups ( request ) ;
public class LogBuffer { /** * Return 24 - bit signed int from buffer . ( big - endian ) * @ see mysql - 5.6.10 / include / myisampack . h - mi _ usint3korr */ public final int getBeInt24 ( final int pos ) { } }
final int position = origin + pos ; if ( pos + 2 >= limit || pos < 0 ) throw new IllegalArgumentException ( "limit excceed: " + ( pos < 0 ? pos : ( pos + 2 ) ) ) ; byte [ ] buf = buffer ; return ( 0xff & buf [ position + 2 ] ) | ( ( 0xff & buf [ position + 1 ] ) << 8 ) | ( ( buf [ position ] ) << 16 ) ;
public class KeyRange { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case START_KEY : return isSetStart_key ( ) ; case END_KEY : return isSetEnd_key ( ) ; case START_TOKEN : return isSetStart_token ( ) ; case END_TOKEN : return isSetEnd_token ( ) ; case ROW_FILTER : return isSetRow_filter ( ) ; case COU...
public class EntityManagerImpl { /** * Make an instance managed and persistent . * @ param entity * @ throws EntityExistsException * if the entity already exists . ( If the entity already exists , * the EntityExistsException may be thrown when the persist * operation is invoked , or the EntityExistsException ...
checkClosed ( ) ; checkTransactionNeeded ( ) ; try { getPersistenceDelegator ( ) . persist ( e ) ; } catch ( Exception ex ) { // onRollBack . doRollback ( ) ; throw new KunderaException ( ex ) ; }
public class OAHashSet { /** * Removes the specified element from this set if it is present with * the hash provided in parameter . * This variant of { @ link # remove ( Object ) } acts as an optimisation to * enable avoiding { @ link # hashCode ( ) } calls if the hash is already * known on the caller side . ...
checkNotNull ( objectToRemove ) ; int index = hash & mask ; // using the hashes array for looping and comparison if possible , hence we ' re cache friendly while ( hashes [ index ] != 0 || table [ index ] != null ) { if ( hash == hashes [ index ] && objectToRemove . equals ( table [ index ] ) ) { removeFromIndex ( inde...
public class MergeRequestApi { /** * Get all merge requests matching the filter . * < pre > < code > GitLab Endpoint : GET / merge _ requests < / code > < / pre > * @ param filter a MergeRequestFilter instance with the filter settings * @ param itemsPerPage the number of MergeRequest instances that will be fetche...
MultivaluedMap < String , String > queryParams = ( filter != null ? filter . getQueryParams ( ) . asMap ( ) : null ) ; if ( filter != null && ( filter . getProjectId ( ) != null && filter . getProjectId ( ) . intValue ( ) > 0 ) || ( filter . getIids ( ) != null && filter . getIids ( ) . size ( ) > 0 ) ) { if ( filter ....
public class AbstractMetadataPopupLayout { /** * Returns metadata popup . * @ param entity * entity for which metadata data is displayed * @ param metaDatakey * metadata key to be selected * @ return { @ link CommonDialogWindow } */ public CommonDialogWindow getWindow ( final E entity , final String metaDatak...
selectedEntity = entity ; metadataWindow = new WindowBuilder ( SPUIDefinitions . CREATE_UPDATE_WINDOW ) . caption ( getMetadataCaption ( ) ) . content ( this ) . cancelButtonClickListener ( event -> onCancel ( ) ) . id ( UIComponentIdProvider . METADATA_POPUP_ID ) . layout ( mainLayout ) . i18n ( i18n ) . saveDialogClo...
public class AutoFormManualTaskActivity { /** * This method is used to extract data from the message received from the task manager . * The method updates all variables specified as non - readonly * @ param datadoc * @ return completion code ; when it returns null , the completion * code is taken from the compl...
String varstring = this . getAttributeValue ( TaskActivity . ATTRIBUTE_TASK_VARIABLES ) ; List < String [ ] > parsed = StringHelper . parseTable ( varstring , ',' , ';' , 5 ) ; for ( String [ ] one : parsed ) { String varname = one [ 0 ] ; String displayOption = one [ 2 ] ; if ( displayOption . equals ( TaskActivity . ...
public class KinesisDataFetcher { /** * Registers a metric group associated with the shard id of the provided { @ link KinesisStreamShardState shardState } . * @ return a { @ link ShardMetricsReporter } that can be used to update metric values */ private static ShardMetricsReporter registerShardMetrics ( MetricGroup ...
ShardMetricsReporter shardMetrics = new ShardMetricsReporter ( ) ; MetricGroup streamShardMetricGroup = metricGroup . addGroup ( KinesisConsumerMetricConstants . STREAM_METRICS_GROUP , shardState . getStreamShardHandle ( ) . getStreamName ( ) ) . addGroup ( KinesisConsumerMetricConstants . SHARD_METRICS_GROUP , shardSt...
public class ImgUtil { /** * 将一个image信息复制到另一个image中 * @ param src 源 * @ param dest 目标 * @ return dest */ public static BufferedImage copy ( BufferedImage src , BufferedImage dest ) { } }
dest . getGraphics ( ) . drawImage ( src , 0 , 0 , null ) ; return dest ;
public class RepositoryConfigurationFactory { /** * Create a new default repository configuration . * @ return the newly - created default repository configuration */ public static List < RepositoryConfiguration > createDefaultRepositoryConfiguration ( ) { } }
MavenSettings mavenSettings = new MavenSettingsReader ( ) . readSettings ( ) ; List < RepositoryConfiguration > repositoryConfiguration = new ArrayList < > ( ) ; repositoryConfiguration . add ( MAVEN_CENTRAL ) ; if ( ! Boolean . getBoolean ( "disableSpringSnapshotRepos" ) ) { repositoryConfiguration . add ( SPRING_MILE...
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 1121:1 : entryRuleXAndExpression returns [ EObject current = null ] : iv _ ruleXAndExpression = ruleXAndExpression EOF ; */ public final EObject entryRuleXAndExpression ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleXAndExpression = null ; try { // InternalPureXbase . g : 1121:55 : ( iv _ ruleXAndExpression = ruleXAndExpression EOF ) // InternalPureXbase . g : 1122:2 : iv _ ruleXAndExpression = ruleXAndExpression EOF { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . get...
public class FileUtils { /** * Reads the content of the file between the specific line numbers . * @ param filePath * the path to the file * @ param lineToStart * the line number to start with * @ param lineToEnd * the line number to end with * @ param encoding * the file encoding . Examples : " UTF - 8...
if ( lineToStart > lineToEnd ) { throw new IllegalArgumentException ( "Line to start must be lower than line to end" ) ; } LOG . info ( "Reading from file: " + filePath ) ; List < String > result = new ArrayList < String > ( ) ; BufferedReader reader = null ; int i = 0 ; try { reader = new BufferedReader ( new InputStr...
public class GenericDraweeHierarchyBuilder { /** * Sets the progress bar image and its scale type . * @ param progressBarDrawable drawable to be used as progress bar image * @ param progressBarImageScaleType scale type for the progress bar image * @ return modified instance of this builder */ public GenericDrawee...
mProgressBarImage = progressBarDrawable ; mProgressBarImageScaleType = progressBarImageScaleType ; return this ;
public class Thin { /** * Applies the hitmiss operation to a set of pixels * stored in a hash table . * @ param b the BinaryFast input image * @ param input the set of pixels requiring matching * @ param kernel the kernel to match them with * @ return A hash table containing all the successful matches . */ pr...
HashSet < Point > output = new HashSet < Point > ( ) ; Iterator < Point > it = input . iterator ( ) ; while ( it . hasNext ( ) ) { Point p = it . next ( ) ; if ( kernelMatch ( p , b . getPixels ( ) , b . getWidth ( ) , b . getHeight ( ) , kernel ) ) { // System . out . println ( " Match " + p . x + " " + p . y ) ; outp...
public class Cache2kBuilder { /** * Time duration after insert or updated an cache entry expires . * To switch off time based expiry use { @ link # eternal ( boolean ) } . * < p > If an { @ link ExpiryPolicy } is specified , the maximum expiry duration * is capped to the value specified here . * < p > A value o...
config ( ) . setExpireAfterWrite ( u . toMillis ( v ) ) ; return this ;
public class SerializationUtils { /** * Deserializes a byte array into an object . When the bytes are null , returns null . * @ param bytes the byte array to deserialize * @ return the deserialized object * @ throws IOException if the deserialization fails * @ throws ClassNotFoundException if no class found to ...
if ( bytes == null ) { return null ; } try ( ByteArrayInputStream b = new ByteArrayInputStream ( bytes ) ) { try ( ObjectInputStream o = new ObjectInputStream ( b ) ) { return ( Serializable ) o . readObject ( ) ; } }
public class StorePackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getArrayType ( ) { } }
if ( arrayTypeEClass == null ) { arrayTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 80 ) ; } return arrayTypeEClass ;
public class PeerGroup { /** * See { @ link Peer # addOnTransactionBroadcastListener ( OnTransactionBroadcastListener ) } */ public void addOnTransactionBroadcastListener ( Executor executor , OnTransactionBroadcastListener listener ) { } }
peersTransactionBroadastEventListeners . add ( new ListenerRegistration < > ( checkNotNull ( listener ) , executor ) ) ; for ( Peer peer : getConnectedPeers ( ) ) peer . addOnTransactionBroadcastListener ( executor , listener ) ; for ( Peer peer : getPendingPeers ( ) ) peer . addOnTransactionBroadcastListener ( executo...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link GraphStyleType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link GraphStyleType } { @ code > } */ ...
return new JAXBElement < GraphStyleType > ( _GraphStyle_QNAME , GraphStyleType . class , null , value ) ;
public class ServiceBuilderImpl { /** * Used by journal builder . */ ServiceRefAmp service ( QueueServiceFactoryInbox serviceFactory , ServiceConfig config ) { } }
QueueDeliverBuilderImpl < MessageAmp > queueBuilder = new QueueDeliverBuilderImpl < > ( ) ; // queueBuilder . setOutboxFactory ( OutboxAmpFactory . newFactory ( ) ) ; queueBuilder . setClassLoader ( _services . classLoader ( ) ) ; queueBuilder . sizeMax ( config . queueSizeMax ( ) ) ; queueBuilder . size ( config . que...
public class KiteConnect { /** * Get a new access token using refresh token . * @ param refreshToken is the refresh token obtained after generateSession . * @ param apiSecret is unique for each app . * @ return TokenSet contains user id , refresh token , api secret . * @ throws IOException is thrown when there ...
String hashableText = this . apiKey + refreshToken + apiSecret ; String sha256hex = sha256Hex ( hashableText ) ; Map < String , Object > params = new HashMap < > ( ) ; params . put ( "api_key" , apiKey ) ; params . put ( "refresh_token" , refreshToken ) ; params . put ( "checksum" , sha256hex ) ; JSONObject response = ...
public class TreeInfo { /** * Is tree a constructor declaration ? */ public static boolean isConstructor ( JCTree tree ) { } }
if ( tree . hasTag ( METHODDEF ) ) { Name name = ( ( JCMethodDecl ) tree ) . name ; return name == name . table . names . init ; } else { return false ; }
public class CalendarAstronomer { /** * Returns the current Greenwich sidereal time , measured in hours * @ hide draft / provisional / internal are hidden on Android */ public double getGreenwichSidereal ( ) { } }
if ( siderealTime == INVALID ) { // See page 86 of " Practial Astronomy with your Calculator " , // by Peter Duffet - Smith , for details on the algorithm . double UT = normalize ( ( double ) time / HOUR_MS , 24 ) ; siderealTime = normalize ( getSiderealOffset ( ) + UT * 1.002737909 , 24 ) ; } return siderealTime ;
public class AmbiguityLibrary { /** * 插入到树种 * @ param key * @ param value */ public static void insert ( String key , Value value ) { } }
Forest forest = get ( key ) ; Library . insertWord ( forest , value ) ;
public class StaticTypeCheckingSupport { /** * Checks that arguments and parameter types match , expecting that the number of parameters is strictly greater * than the number of arguments , allowing possible inclusion of default parameters . * @ param params method parameters * @ param args type arguments * @ r...
int dist = 0 ; ClassNode ptype = null ; // we already know the lengths are equal for ( int i = 0 , j = 0 ; i < params . length ; i ++ ) { Parameter param = params [ i ] ; ClassNode paramType = param . getType ( ) ; ClassNode arg = j >= args . length ? null : args [ j ] ; if ( arg == null || ! isAssignableTo ( arg , par...
public class ArtFinder { /** * We have obtained album art for a device , so store it and alert any listeners . * @ param update the update which caused us to retrieve this art * @ param art the album art which we retrieved */ private void updateArt ( TrackMetadataUpdate update , AlbumArt art ) { } }
hotCache . put ( DeckReference . getDeckReference ( update . player , 0 ) , art ) ; // Main deck if ( update . metadata . getCueList ( ) != null ) { // Update the cache with any hot cues in this track as well for ( CueList . Entry entry : update . metadata . getCueList ( ) . entries ) { if ( entry . hotCueNumber != 0 )...
public class SARLValidator { /** * Replies the member feature call that is the root of a sequence of member feature calls . * < p > While the current feature call is the actual receiver of a member feature call , and not an argument , * the sequence is still active . Otherwise , the sequence is stopped . * @ para...
EObject call = leaf ; EObject obj = EcoreUtil2 . getContainerOfType ( leaf . eContainer ( ) , XExpression . class ) ; while ( obj != null && ( container == null || obj != container ) ) { if ( ! ( obj instanceof XMemberFeatureCall ) ) { obj = null ; } else { final EObject previous = call ; final XMemberFeatureCall fcall...
public class DMNResourceDependenciesSorter { /** * Performs a depth first visit , but keeping a separate reference of visited / visiting nodes , _ also _ to avoid potential issues of circularities . */ private static void dfVisit ( DMNResource node , List < DMNResource > allNodes , Collection < DMNResource > visited , ...
if ( visited . contains ( node ) ) { throw new RuntimeException ( "Circular dependency detected: " + visited + " , and again to: " + node ) ; } visited . add ( node ) ; List < DMNResource > neighbours = node . getDependencies ( ) . stream ( ) . flatMap ( dep -> allNodes . stream ( ) . filter ( r -> r . getModelID ( ) ....
public class vpath { /** * Use this API to fetch vpath resource of given name . */ public static vpath get ( nitro_service service , String name ) throws Exception { } }
vpath obj = new vpath ( ) ; obj . set_name ( name ) ; vpath response = ( vpath ) obj . get_resource ( service ) ; return response ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ModeType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "mode" ) public JAXBElement < ModeType > createMode ( ModeType value ) { } }
return new JAXBElement < ModeType > ( _Mode_QNAME , ModeType . class , null , value ) ;
public class FailoverGroupsInner { /** * Fails over from the current primary server to this server . * @ 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 serverName The name of the server conta...
return failoverWithServiceResponseAsync ( resourceGroupName , serverName , failoverGroupName ) . map ( new Func1 < ServiceResponse < FailoverGroupInner > , FailoverGroupInner > ( ) { @ Override public FailoverGroupInner call ( ServiceResponse < FailoverGroupInner > response ) { return response . body ( ) ; } } ) ;
public class QueryFactory { /** * Creates a new TypedQuery that queries the amount of entities of the entity class of this QueryFactory , that a * query for the given Filter would return . * @ param filter the filter * @ return a query */ public TypedQuery < Long > count ( Filter filter ) { } }
CriteriaQuery < Long > query = cb . createQuery ( Long . class ) ; Root < T > from = query . from ( getEntityClass ( ) ) ; if ( filter != null ) { Predicate where = new CriteriaMapper ( from , cb ) . create ( filter ) ; query . where ( where ) ; } return getEntityManager ( ) . createQuery ( query . select ( cb . count ...
public class BitmapUtils { /** * Store the bitmap on the application private directory path . * @ param context the context . * @ param bitmap to store . * @ param filename file name . * @ param format bitmap format . * @ param quality the quality of the compressed bitmap . * @ return the compressed bitmap ...
OutputStream out = null ; try { out = new BufferedOutputStream ( context . openFileOutput ( filename , Context . MODE_PRIVATE ) ) ; return bitmap . compress ( format , quality , out ) ; } catch ( FileNotFoundException e ) { Log . e ( TAG , "no such file for saving bitmap: " , e ) ; return false ; } finally { CloseableU...
public class AbstractParser { /** * Fetch a JSONObject from the provided string . * @ param jsonString json string * @ return json object representing the string or null if there is an exception */ protected JSONObject getJSONObject ( final String jsonString ) { } }
JSONObject json = new JSONObject ( ) ; try { json = new JSONObject ( jsonString ) ; } catch ( NullPointerException e ) { LOGGER . error ( "JSON string cannot be null." , e ) ; } catch ( JSONException e ) { LOGGER . error ( "Could not parse string into JSONObject." , e ) ; } return json ;
public class AbcGrammar { /** * field - userdef - print : : = % x55.3A * WSP userdef header - eol < p > * < tt > U : < / tt > */ Rule FieldUserdefPrint ( ) { } }
return Sequence ( String ( "U:" ) , ZeroOrMore ( WSP ( ) ) . suppressNode ( ) , Userdef ( ) , HeaderEol ( ) ) . label ( FieldUserdefPrint ) ;
public class ExtensionsInner { /** * Enables the Operations Management Suite ( OMS ) on the HDInsight cluster . * @ param resourceGroupName The name of the resource group . * @ param clusterName The name of the cluster . * @ param parameters The Operations Management Suite ( OMS ) workspace parameters . * @ thr...
return beginEnableMonitoringWithServiceResponseAsync ( resourceGroupName , clusterName , parameters ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class appqoecustomresp { /** * Use this API to fetch all the appqoecustomresp resources that are configured on netscaler . */ public static appqoecustomresp [ ] get ( nitro_service service , options option ) throws Exception { } }
appqoecustomresp obj = new appqoecustomresp ( ) ; appqoecustomresp [ ] response = ( appqoecustomresp [ ] ) obj . get_resources ( service , option ) ; return response ;
public class StringHelper { /** * Trim the passed lead and tail from the source value . If the source value does * not start with the passed trimmed value , nothing happens . * @ param sSrc * The input source string * @ param cValueToTrim * The char to be trimmed of the beginning and the end * @ return The ...
return trimStartAndEnd ( sSrc , cValueToTrim , cValueToTrim ) ;
public class ClassUtilImpl { /** * FUTURE add to loader */ public BIF loadBIF ( PageContext pc , String name , String bundleName , Version bundleVersion ) throws InstantiationException , IllegalAccessException , ClassException , BundleException { } }
// first of all we chek if itis a class Class < ? > res = lucee . commons . lang . ClassUtil . loadClassByBundle ( name , bundleName , bundleVersion , pc . getConfig ( ) . getIdentification ( ) ) ; if ( res != null ) { if ( Reflector . isInstaneOf ( res , BIF . class ) ) { return ( BIF ) res . newInstance ( ) ; } retur...
public class BaseDrawerItem { /** * helper method to decide for the correct color * @ param ctx * @ return */ protected int getSelectedIconColor ( Context ctx ) { } }
return ColorHolder . color ( getSelectedIconColor ( ) , ctx , R . attr . material_drawer_selected_text , R . color . material_drawer_selected_text ) ;
public class StorageUtil { /** * reads a XML Element Attribute ans cast it to a DateTime * @ param el XML Element to read Attribute from it * @ param attributeName Name of the Attribute to read * @ param defaultValue if attribute doesn ' t exist return default value * @ return Attribute Value */ public DateTime...
String value = el . getAttribute ( attributeName ) ; if ( value == null ) return defaultValue ; DateTime dtValue = Caster . toDate ( value , false , null , null ) ; if ( dtValue == null ) return defaultValue ; return dtValue ;
public class AnnotationUtils { /** * Helper method for generating a hash code for an array . * @ param componentType the component type of the array * @ param o the array * @ return a hash code for the specified array */ private static int arrayMemberHash ( final Class < ? > componentType , final Object o ) { } }
if ( componentType . equals ( Byte . TYPE ) ) { return Arrays . hashCode ( ( byte [ ] ) o ) ; } if ( componentType . equals ( Short . TYPE ) ) { return Arrays . hashCode ( ( short [ ] ) o ) ; } if ( componentType . equals ( Integer . TYPE ) ) { return Arrays . hashCode ( ( int [ ] ) o ) ; } if ( componentType . equals ...
public class ComputationGraph { /** * Set the states for all RNN layers , for use in { @ link # rnnTimeStep ( INDArray . . . ) } * @ param previousStates The previous time step states for all layers ( key : layer name . Value : layer states ) * @ see # rnnGetPreviousStates ( ) */ public void rnnSetPreviousStates ( ...
for ( Map . Entry < String , Map < String , INDArray > > entry : previousStates . entrySet ( ) ) { rnnSetPreviousState ( entry . getKey ( ) , entry . getValue ( ) ) ; }
import java . lang . Math ; public class Main { /** * A Java function to convert a decimal number to a binary number . * Args : * decimal _ number : An integer to be converted into binary . * Returns : * A binary number corresponding to the given decimal number . * Examples : * > > > convertDecimalToBinary ...
int binaryNumber = 0 ; int multiplier = 0 ; while ( decimalNumber != 0 ) { int remainder = decimalNumber % 2 ; binaryNumber += remainder * Math . pow ( 10 , multiplier ) ; decimalNumber /= 2 ; multiplier += 1 ; } return binaryNumber ;
public class FileUtils { /** * Write a Memento to a particular resource directory . * @ param resourceDir the resource directory * @ param resource the resource * @ param time the time for the memento */ public static void writeMemento ( final File resourceDir , final Resource resource , final Instant time ) { } ...
try ( final BufferedWriter writer = newBufferedWriter ( getNquadsFile ( resourceDir , time ) . toPath ( ) , UTF_8 , CREATE , WRITE , TRUNCATE_EXISTING ) ) { try ( final Stream < String > quads = generateServerManaged ( resource ) . map ( FileUtils :: serializeQuad ) ) { final Iterator < String > lineIter = quads . iter...
public class ECSTarget { /** * The < code > ECSTaskSet < / code > objects associated with the ECS target . * @ return The < code > ECSTaskSet < / code > objects associated with the ECS target . */ public java . util . List < ECSTaskSet > getTaskSetsInfo ( ) { } }
if ( taskSetsInfo == null ) { taskSetsInfo = new com . amazonaws . internal . SdkInternalList < ECSTaskSet > ( ) ; } return taskSetsInfo ;
public class QueueReader { /** * Make the request to the Twilio API to perform the read . * @ param client TwilioRestClient with which to make the request * @ return Queue ResourceSet */ @ Override public ResourceSet < Queue > read ( final TwilioRestClient client ) { } }
return new ResourceSet < > ( this , client , firstPage ( client ) ) ;
public class BufferedWriter { /** * Finishes the current response . */ public void finish ( ) throws IOException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { // 306998.15 Tr . debug ( tc , "finish" ) ; } if ( length == - 1 && total != 0 ) length = total ; // PM71666 - DBCS and application calls out . close ( ) , the length set here is not correct ( depending on # of bytes for each character ) // It...
public class AnnotatedGenericRowMapper { /** * { @ inheritDoc } * @ since 0.8.1 */ @ Override public String [ ] getAllColumns ( ) { } }
if ( cachedAllColumns == null ) { List < String > colList = new ArrayList < > ( ) ; ColumnAttribute [ ] annoMappings = getClass ( ) . getAnnotationsByType ( ColumnAttribute . class ) ; for ( ColumnAttribute colAttr : annoMappings ) { colList . add ( colAttr . column ( ) ) ; } cachedAllColumns = colList . toArray ( Arra...
public class TarHeader { /** * Creates a new header for a file / directory entry . * @ param entryName * File name * @ param size * File size in bytes * @ param modTime * Last modification time in numeric Unix time format * @ param dir * Is directory */ public static TarHeader createHeader ( String entr...
String name = entryName ; name = TarUtils . trim ( name . replace ( File . separatorChar , '/' ) , '/' ) ; TarHeader header = new TarHeader ( ) ; header . linkName = new StringBuffer ( "" ) ; header . mode = permissions ; if ( name . length ( ) > 100 ) { header . namePrefix = new StringBuffer ( name . substring ( 0 , n...
public class keyListener { /** * Called when a key is dispatched to a dialog . This allows listeners to * get a chance to respond before the dialog . * @ param dialog the dialog the key has been dispatched to * @ param keyCode the code for the physical key that was pressed * @ param event the KeyEvent object co...
if ( event . getAction ( ) != KeyEvent . ACTION_DOWN ) return false ; if ( keyCode == KeyEvent . KEYCODE_BACK || keyCode == KeyEvent . KEYCODE_ESCAPE ) { if ( _c . get ( ) . _newFolderView != null && _c . get ( ) . _newFolderView . getVisibility ( ) == VISIBLE ) { _c . get ( ) . _newFolderView . setVisibility ( GONE ) ...
public class BasicFileServlet { /** * Parses the Range Header of the request and sets the appropriate ranges list on the { @ link FileRequestContext } Object . * @ param context * @ return false if the range pattern contains no satisfiable ranges . */ public static boolean parseRanges ( FileRequestContext context )...
if ( ! StringUtils . isBlank ( context . range ) ) { Matcher rangeMatcher = rangePattern . matcher ( context . range ) ; if ( rangeMatcher . matches ( ) ) { String ranges [ ] = rangeMatcher . group ( 1 ) . split ( "," ) ; for ( String range : ranges ) { long startBound = - 1 ; int hyphenIndex = range . indexOf ( '-' ) ...
public class ShanksSimulation2DGUI { /** * Add a Histogram to the simulation * @ param histogramID * - The name of the Histogram * @ param xAxisLabel * - The label for the x axis * @ param yAxisLabel * - The label fot the y axis * @ throws DuplicatedChartIDException * @ throws DuplicatedPortrayalIDExcep...
Scenario2DPortrayal scenarioPortrayal = ( Scenario2DPortrayal ) this . getSimulation ( ) . getScenarioPortrayal ( ) ; scenarioPortrayal . addHistogram ( histogramID , xAxisLabel , yAxisLabel ) ;
public class BytecodeUtils { /** * Returns an expression that returns a new { @ link ArrayList } containing all the given items . */ public static Expression asList ( Iterable < ? extends Expression > items ) { } }
final ImmutableList < Expression > copy = ImmutableList . copyOf ( items ) ; if ( copy . isEmpty ( ) ) { return MethodRef . IMMUTABLE_LIST_OF . get ( 0 ) . invoke ( ) ; } // Note , we cannot necessarily use ImmutableList for anything besides the empty list because // we may need to put a null in it . final Expression c...
public class IconProviderBuilder { /** * Gets the { @ link IStatesIconProvider } from this { @ link IconProviderBuilder } . * @ return the state icon provider */ private IStatesIconProvider getStateIconProvider ( ) { } }
return state -> { return state . getProperties ( ) . keySet ( ) . stream ( ) . map ( prop -> stateIcons . get ( prop , state . getValue ( prop ) ) ) . filter ( Objects :: nonNull ) . findFirst ( ) . orElse ( defaultIcon ) ; } ;
public class ProcessExtensionService { /** * Json variables need to be represented as JsonNode for engine to handle as Json * Do this for any var marked as json or whose type is not recognised from the extension file */ private ProcessExtensionModel convertJsonVariables ( ProcessExtensionModel processExtensionModel )...
if ( processExtensionModel != null && processExtensionModel . getExtensions ( ) != null && processExtensionModel . getExtensions ( ) . getProperties ( ) != null ) { for ( VariableDefinition variableDefinition : processExtensionModel . getExtensions ( ) . getProperties ( ) . values ( ) ) { if ( ! variableTypeMap . keySe...
public class ThriftInvertedIndexHandler { /** * / * ( non - Javadoc ) * @ see com . impetus . client . cassandra . index . InvertedIndexHandlerBase # search ( com . impetus . kundera . metadata . model . EntityMetadata , java . lang . String , org . apache . cassandra . thrift . ConsistencyLevel , java . util . Map )...
return super . search ( m , persistenceUnit , consistencyLevel , indexClauseMap ) ;
public class JumboCyclicVertexSearch { /** * XOR the to bit sets together and return the result . Neither input is * modified . * @ param x first bit set * @ param y second bit set * @ return the XOR of the two bit sets */ static BitSet xor ( BitSet x , BitSet y ) { } }
BitSet z = copy ( x ) ; z . xor ( y ) ; return z ;
public class EventUtilities { /** * Send data so ZMQ Socket . < br > * Warning . See http : / / zeromq . org / area : faq . " ZeroMQ sockets are not thread - safe . < br > * The short version is that sockets should not be shared between threads . We recommend creating a dedicated socket for each thread . < br > *...
XLOGGER . entry ( ) ; sendContextData ( eventSocket , fullName , counter , isException ) ; eventSocket . send ( data ) ; LOGGER . debug ( "event {} sent" , fullName ) ; XLOGGER . exit ( ) ;
public class LuceneGazetteer { /** * Executes a query against the Lucene index , processing the results and returning * at most maxResults ResolvedLocations with ancestry resolved . * @ param location the location occurrence * @ param sanitizedName the sanitized name of the search location * @ param filter the ...
Query query = new AnalyzingQueryParser ( Version . LUCENE_4_9 , INDEX_NAME . key ( ) , INDEX_ANALYZER ) . parse ( String . format ( fuzzy ? FUZZY_FMT : EXACT_MATCH_FMT , sanitizedName ) ) ; List < ResolvedLocation > matches = new ArrayList < ResolvedLocation > ( maxResults ) ; Map < Integer , Set < GeoName > > parentMa...
public class CollectionUtils { /** * Counts the number of elements in the { @ link Iterable } collection accepted by the { @ link Filter } . * @ param < T > Class type of the elements in the { @ link Iterable } collection . * @ param iterable { @ link Iterable } collection of elements being evaluated . * @ param ...
Assert . notNull ( filter , "Filter is required" ) ; return StreamSupport . stream ( nullSafeIterable ( iterable ) . spliterator ( ) , false ) . filter ( filter :: accept ) . count ( ) ;
public class DownloadSerialQueue { /** * Enqueues the given task sometime in the serial queue . If the { @ code task } is in the head of * the serial queue , the { @ code task } will be started automatically . */ public synchronized void enqueue ( DownloadTask task ) { } }
taskList . add ( task ) ; Collections . sort ( taskList ) ; if ( ! paused && ! looping ) { looping = true ; startNewLooper ( ) ; }
public class EnumVocab { /** * Returns the { @ link Property } for the given enum item contained in this * vocabulary . * @ param property * the property to look up , must not be < code > null < / code > * @ return the result of looking up < code > property < / code > in this vocabulary . */ public Property get...
Preconditions . checkNotNull ( property ) ; return lookup ( converter . convert ( property ) ) . get ( ) ;
public class JacksonSingleton { /** * Un - registers a JSON Module . * @ param module the module */ @ Override public void unregister ( Module module ) { } }
if ( module == null ) { // May happen on departure . return ; } LOGGER . info ( "Removing Jackson module {}" , module . getModuleName ( ) ) ; synchronized ( lock ) { if ( modules . remove ( module ) ) { rebuildMappers ( ) ; } }
public class Ssh2DsaPublicKey { /** * Verify the signature . * @ param signature * byte [ ] * @ param data * byte [ ] * @ return < code > true < / code > if the signature was produced by the * corresponding private key that owns this public key , otherwise * < code > false < / code > . * @ throws SshExc...
ByteArrayReader bar = new ByteArrayReader ( signature ) ; try { if ( signature . length != 40 // 160 bits && signature . length != 56 // 224 bits && signature . length != 64 ) { // 256 bits byte [ ] sig = bar . readBinaryString ( ) ; // log . debug ( " Signature blob is " + new String ( sig ) ) ; String header = new St...
public class AuthenticationService { /** * Invalidates a specific authentication token and its corresponding * Guacamole session , effectively logging out the associated user . If the * authentication token is not valid , this function has no effect . * @ param authToken * The token being invalidated . * @ re...
// Remove corresponding GuacamoleSession if the token is valid GuacamoleSession session = tokenSessionMap . remove ( authToken ) ; if ( session == null ) return false ; // Invalidate the removed session session . invalidate ( ) ; return true ;
public class Request { /** * sets the user agent header for the request , if exists then appends * @ param userAgentValue : header field value to add * @ return : Request Object with userAgent header value set */ public Request userAgent ( String userAgentValue ) { } }
final String userAgent = RequestHeaderFields . USER_AGENT . getName ( ) ; String agent = headers . get ( userAgent ) ; if ( agent == null ) { agent = userAgentValue ; } else { agent = agent + " " + userAgentValue ; } return this . setHeader ( userAgent , agent ) ;