signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class VertxResponseWriter { /** * { @ inheritDoc } */ @ Override public void setSuspendTimeout ( long timeOut , TimeUnit timeUnit ) throws IllegalStateException { } }
if ( timeoutHandler == null ) { throw new IllegalStateException ( "The timeoutHandler is null" ) ; } suspend ( timeOut , timeUnit , timeoutHandler ) ;
public class PersistableRawData { /** * Replace the state of this object with the same object in some other state . * Used for to restore the before image if a transaction rolls back . * @ param other is the object this object is to become a clone of . */ public void becomeCloneOf ( ManagedObject clone ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "becomeCloneOf" , "Clone=" + clone ) ; PersistableRawData object = ( PersistableRawData ) clone ; _data = object . _data ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "becomeCloneOf" ) ;
public class AbstractResultSetWrapper { /** * { @ inheritDoc } * @ see java . sql . ResultSet # updateString ( int , java . lang . String ) */ @ Override public void updateString ( final int columnIndex , final String x ) throws SQLException { } }
wrapped . updateString ( columnIndex , x ) ;
public class Decoder { /** * Gets the array of bits from an Aztec Code matrix * @ return the array of bits */ private boolean [ ] extractBits ( BitMatrix matrix ) { } }
boolean compact = ddata . isCompact ( ) ; int layers = ddata . getNbLayers ( ) ; int baseMatrixSize = ( compact ? 11 : 14 ) + layers * 4 ; // not including alignment lines int [ ] alignmentMap = new int [ baseMatrixSize ] ; boolean [ ] rawbits = new boolean [ totalBitsInLayer ( layers , compact ) ] ; if ( compact ) { for ( int i = 0 ; i < alignmentMap . length ; i ++ ) { alignmentMap [ i ] = i ; } } else { int matrixSize = baseMatrixSize + 1 + 2 * ( ( baseMatrixSize / 2 - 1 ) / 15 ) ; int origCenter = baseMatrixSize / 2 ; int center = matrixSize / 2 ; for ( int i = 0 ; i < origCenter ; i ++ ) { int newOffset = i + i / 15 ; alignmentMap [ origCenter - i - 1 ] = center - newOffset - 1 ; alignmentMap [ origCenter + i ] = center + newOffset + 1 ; } } for ( int i = 0 , rowOffset = 0 ; i < layers ; i ++ ) { int rowSize = ( layers - i ) * 4 + ( compact ? 9 : 12 ) ; // The top - left most point of this layer is < low , low > ( not including alignment lines ) int low = i * 2 ; // The bottom - right most point of this layer is < high , high > ( not including alignment lines ) int high = baseMatrixSize - 1 - low ; // We pull bits from the two 2 x rowSize columns and two rowSize x 2 rows for ( int j = 0 ; j < rowSize ; j ++ ) { int columnOffset = j * 2 ; for ( int k = 0 ; k < 2 ; k ++ ) { // left column rawbits [ rowOffset + columnOffset + k ] = matrix . get ( alignmentMap [ low + k ] , alignmentMap [ low + j ] ) ; // bottom row rawbits [ rowOffset + 2 * rowSize + columnOffset + k ] = matrix . get ( alignmentMap [ low + j ] , alignmentMap [ high - k ] ) ; // right column rawbits [ rowOffset + 4 * rowSize + columnOffset + k ] = matrix . get ( alignmentMap [ high - k ] , alignmentMap [ high - j ] ) ; // top row rawbits [ rowOffset + 6 * rowSize + columnOffset + k ] = matrix . get ( alignmentMap [ high - j ] , alignmentMap [ low + k ] ) ; } } rowOffset += rowSize * 8 ; } return rawbits ;
public class SmbFileOutputStream { /** * Closes this output stream and releases any system resources associated * with it . * @ throws IOException * if a network error occurs */ @ Override public void close ( ) throws IOException { } }
try { if ( this . handle . isValid ( ) ) { this . handle . close ( ) ; } } finally { this . file . clearAttributeCache ( ) ; this . tmp = null ; }
public class HtmlTableTemplate { /** * Returns the coordinate of the cell containing the element , given that root is the root of a HtmlTableTemplate * @ param root * @ param element * @ return */ public static Pair < Integer , Integer > getParentCellForElement ( Element root , Element element ) { } }
Element tbody = getTBodyElement ( root ) ; // Is the element in our table ? and what ' s the path from the table to it ? ArrayList < Element > path = TemplateUtils . isDescendant ( tbody , element ) ; if ( path == null ) return null ; // we know that path [ 0 ] is tbody and that path [ 1 ] is a tr template int row = DOM . getChildIndex ( path . get ( 0 ) , path . get ( 1 ) ) ; int col = DOM . getChildIndex ( path . get ( 1 ) , path . get ( 2 ) ) ; return new Pair < Integer , Integer > ( col , row ) ;
public class SimpleIntegerControl { /** * { @ inheritDoc } */ @ Override public void initializeParts ( ) { } }
super . initializeParts ( ) ; getStyleClass ( ) . addAll ( "simple-integer-control" ) ; final SpinnerValueFactory . IntegerSpinnerValueFactory factory = new SpinnerValueFactory . IntegerSpinnerValueFactory ( Integer . MIN_VALUE , Integer . MAX_VALUE , field . getValue ( ) ) ; // override old converter ( IntegerStringConverter ) because it throws // NumberFormatException if value can not be parsed to Integer factory . setConverter ( new NoExceptionStringConverter ( ) ) ; editableSpinner . setValueFactory ( factory ) ; editableSpinner . focusedProperty ( ) . addListener ( ( observable , wasFocused , isFocused ) -> { if ( wasFocused && ! isFocused ) { overrideNonIntegerSpinnerValues ( ) ; } } ) ; editableSpinner . addEventHandler ( KeyEvent . ANY , event -> { if ( event . getCode ( ) == KeyCode . ENTER ) { overrideNonIntegerSpinnerValues ( ) ; } } ) ;
public class ApiOvhDedicatedCloud { /** * Get this object properties * REST : GET / dedicatedCloud / { serviceName } / user / { userId } / objectRight / { objectRightId } * @ param serviceName [ required ] Domain of the service * @ param userId [ required ] * @ param objectRightId [ required ] */ public OvhObjectRight serviceName_user_userId_objectRight_objectRightId_GET ( String serviceName , Long userId , Long objectRightId ) throws IOException { } }
String qPath = "/dedicatedCloud/{serviceName}/user/{userId}/objectRight/{objectRightId}" ; StringBuilder sb = path ( qPath , serviceName , userId , objectRightId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhObjectRight . class ) ;
public class EcodInstallation { /** * Populates allDomains */ public void ensureDomainsFileInstalled ( ) throws IOException { } }
// Quick check for availability domainsFileLock . readLock ( ) . lock ( ) ; logger . trace ( "LOCK readlock" ) ; try { if ( allDomains != null ) { return ; } } finally { logger . trace ( "UNLOCK readlock" ) ; domainsFileLock . readLock ( ) . unlock ( ) ; } // Download domains domainsFileLock . writeLock ( ) . lock ( ) ; logger . trace ( "LOCK writelock" ) ; try { if ( ! domainsAvailable ( ) ) { downloadDomains ( ) ; } parseDomains ( ) ; } finally { logger . trace ( "UNLOCK writelock" ) ; domainsFileLock . writeLock ( ) . unlock ( ) ; }
public class EventMessenger { /** * Send an { @ link EventMessage } to one client that is subscribed to the given * topicURI . If the client with the given WebSocket session id is not subscribed to * the topicURI nothing happens . * @ param topicURI the name of the topic * @ param event the payload of the { @ link EventMessage } * @ param eligibleWebSocketSessionId only the client with the WebSocket session id * listed here will receive the EVENT message */ public void sendTo ( String topicURI , Object event , String eligibleWebSocketSessionId ) { } }
sendTo ( topicURI , event , Collections . singleton ( eligibleWebSocketSessionId ) ) ;
public class FessMessages { /** * Add the created action message for the key ' errors . failed _ to _ upload _ kuromoji _ file ' with parameters . * < pre > * message : Failed to upload the Kuromoji file . * < / pre > * @ param property The property name for the message . ( NotNull ) * @ return this . ( NotNull ) */ public FessMessages addErrorsFailedToUploadKuromojiFile ( String property ) { } }
assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( ERRORS_failed_to_upload_kuromoji_file ) ) ; return this ;
public class LocalizedMessage { /** * Returns the formatted message after looking up the format in the resource bundle . * @ return The formatted message String . */ @ Override public String getFormattedMessage ( ) { } }
if ( formattedMessage != null ) { return formattedMessage ; } ResourceBundle bundle = this . resourceBundle ; if ( bundle == null ) { if ( baseName != null ) { bundle = getResourceBundle ( baseName , locale , false ) ; } else { bundle = getResourceBundle ( loggerName , locale , true ) ; } } final String myKey = getFormat ( ) ; final String msgPattern = ( bundle == null || ! bundle . containsKey ( myKey ) ) ? myKey : bundle . getString ( myKey ) ; final Object [ ] array = argArray == null ? stringArgs : argArray ; final FormattedMessage msg = new FormattedMessage ( msgPattern , array ) ; formattedMessage = msg . getFormattedMessage ( ) ; throwable = msg . getThrowable ( ) ; return formattedMessage ;
public class WebSocketContainerExt { /** * ( non - Javadoc ) * @ see javax . websocket . WebSocketContainer # connectToServer ( java . lang . Class , java . net . URI ) */ @ Override public Session connectToServer ( Class < ? > clazz , URI path ) throws DeploymentException , IOException { } }
if ( clazz == null || path == null ) { throw new IllegalArgumentException ( ) ; } Object theObject = null ; ClientConnector x = new ClientConnector ( ) ; try { theObject = getEndpointInstance ( clazz ) ; } catch ( DeploymentException e ) { String msg = Tr . formatMessage ( tc , "client.connection.error" , clazz . toString ( ) , e . getMessage ( ) ) ; Tr . error ( tc , "client.connection.error" , clazz . toString ( ) , e . getMessage ( ) ) ; throw new DeploymentException ( msg , e ) ; } return x . connectAnnotatedClass ( theObject , path , this ) ;
public class ObjectiveMessageResources { @ Override public boolean isPresent ( Locale locale , String key ) { } }
final String message = getMessage ( locale , key ) ; if ( message == null ) { return false ; } else if ( message . startsWith ( "???" ) && message . endsWith ( "???" ) ) { return false ; } else { return true ; }
public class InitialMatching1 { /** * Sets a { @ link Consumer } to execute if this matches . */ public FluentMatchingC < T > then ( Consumer < A > consumer ) { } }
return then ( new FluentMatchingC < > ( value ) , consumer ) ;
public class TApplicationExceptions { /** * Reads a { @ link TApplicationException } from the specified { @ link TProtocol } . * < p > Note : This has been copied from { @ link TApplicationException # read ( TProtocol ) } due to API differences * between libthrift 0.9 . x and 0.10 . x . */ public static TApplicationException read ( TProtocol iprot ) throws TException { } }
TField field ; iprot . readStructBegin ( ) ; String message = null ; int type = TApplicationException . UNKNOWN ; while ( true ) { field = iprot . readFieldBegin ( ) ; if ( field . type == TType . STOP ) { break ; } switch ( field . id ) { case 1 : if ( field . type == TType . STRING ) { message = iprot . readString ( ) ; } else { TProtocolUtil . skip ( iprot , field . type ) ; } break ; case 2 : if ( field . type == TType . I32 ) { type = iprot . readI32 ( ) ; } else { TProtocolUtil . skip ( iprot , field . type ) ; } break ; default : TProtocolUtil . skip ( iprot , field . type ) ; break ; } iprot . readFieldEnd ( ) ; } iprot . readStructEnd ( ) ; return new TApplicationException ( type , message ) ;
public class DataStoreFactory { /** * Creates a suitable { @ link DataStore } for the specified parameters . * @ param parameters list of GeoTools parameters . * @ return data store , never null * @ throws IOException could not create data store */ public static DataStore create ( Map < String , Object > parameters ) throws IOException { } }
Object url = parameters . get ( ShapefileDataStoreFactory . URLP . key ) ; Logger log = LoggerFactory . getLogger ( DataStoreFactory . class ) ; if ( url instanceof String ) { parameters . put ( ShapefileDataStoreFactory . URLP . key , ResourceUtils . getURL ( ( String ) url ) . toExternalForm ( ) ) ; } if ( DATASTORE_CACHE . containsKey ( parameters ) ) { return DATASTORE_CACHE . get ( parameters ) ; } DataStore store = DataStoreFinder . getDataStore ( parameters ) ; Object typed = parameters . get ( USE_TYPED_FIDS ) ; if ( typed instanceof String ) { Boolean t = Boolean . valueOf ( ( String ) typed ) ; if ( ! t ) { if ( store != null ) { log . warn ( "Non-typed FIDs are only supported by first-generation JDBC datastores, " + "using default fid format for datastore class " + store . getClass ( ) . getName ( ) ) ; } } } if ( null == store ) { StringBuilder availableStr = new StringBuilder ( ) ; StringBuilder missingStr = new StringBuilder ( ) ; Iterator < DataStoreFactorySpi > all = DataStoreFinder . getAllDataStores ( ) ; while ( all . hasNext ( ) ) { DataStoreFactorySpi factory = all . next ( ) ; if ( ! factory . isAvailable ( ) ) { log . warn ( "Datastore factory " + factory . getDisplayName ( ) + "(" + factory . getDescription ( ) + ") is not available" ) ; if ( missingStr . length ( ) != 0 ) { missingStr . append ( "," ) ; } missingStr . append ( factory . getDisplayName ( ) ) ; } else { if ( availableStr . length ( ) != 0 ) { availableStr . append ( "," ) ; } availableStr . append ( factory . getDisplayName ( ) ) ; } } throw new IOException ( "No datastore found. Possible causes are missing factory or missing library for your datastore" + " (e.g. database driver).\nCheck the isAvailable() method of your" + " DataStoreFactory class to find out which libraries are needed.\n" + "Unavailable factories : " + missingStr + "\n" + "Available factories : " + availableStr + "\n" ) ; } DATASTORE_CACHE . put ( parameters , store ) ; return store ;
public class Genotype { /** * Create a new { @ code Genotype } from a given array of { @ code chromosomes } . * @ since 3.0 * @ param < G > the gene type * @ param chromosomes the { @ code Chromosome } s the returned genotype consists * of * @ return a new { @ code Genotype } from the given chromosomes * @ throws NullPointerException if { @ code chromosomes } is { @ code null } or * one of its element . * @ throws IllegalArgumentException if { @ code chromosome . length ( ) < 1 } . */ public static < G extends Gene < ? , G > > Genotype < G > of ( final Iterable < ? extends Chromosome < G > > chromosomes ) { } }
return new Genotype < > ( ISeq . of ( chromosomes ) ) ;
public class CmsNewsletter { /** * Returns the e - mail for the newsletter . < p > * @ param recipient the recipient to whom the newsletter is sent * @ param cms the CmsObject * @ return the e - mail for the newsletter * @ throws CmsException if something goes wrong */ public Email getEmail ( CmsObject cms , I_CmsNewsletterRecipient recipient ) throws CmsException { } }
StringBuffer htmlMsg = new StringBuffer ( 1024 ) ; StringBuffer txtMsg = new StringBuffer ( 1024 ) ; Iterator < I_CmsNewsletterContent > contents = m_contents . iterator ( ) ; while ( contents . hasNext ( ) ) { I_CmsNewsletterContent content = contents . next ( ) ; if ( recipient . isSubscriber ( content ) ) { if ( content . getType ( ) . equals ( CmsNewsletterContentType . TYPE_HTML ) ) { htmlMsg . append ( content . getContent ( ) ) ; } else { txtMsg . append ( content . getContent ( ) ) ; } } } Email email = null ; try { if ( ( htmlMsg . length ( ) > 0 ) || ! m_attachments . isEmpty ( ) ) { // we need to create a HTML mail CmsHtmlMail htmlMail = new CmsHtmlMail ( ) ; htmlMail . setHtmlMsg ( replaceMacros ( htmlMsg . toString ( ) , recipient ) ) ; Iterator < CmsResource > attachments = m_attachments . iterator ( ) ; while ( attachments . hasNext ( ) ) { CmsResource resource = attachments . next ( ) ; // set the description of the attachment either to the // property description , if it is set , or // to the property title String description = "" ; String propertyDescription = cms . readPropertyObject ( cms . getSitePath ( resource ) , CmsPropertyDefinition . PROPERTY_DESCRIPTION , true ) . getValue ( ) ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( propertyDescription ) ) { description = propertyDescription ; } else { String propertyTitle = cms . readPropertyObject ( cms . getSitePath ( resource ) , CmsPropertyDefinition . PROPERTY_TITLE , true ) . getValue ( ) ; description = propertyTitle ; } htmlMail . attach ( new CmsVfsDataSource ( cms , resource ) , resource . getName ( ) , description ) ; } htmlMail . setTextMsg ( replaceMacros ( txtMsg . toString ( ) , recipient ) ) ; email = htmlMail ; } else { // only text content , return text mail CmsSimpleMail textMail = new CmsSimpleMail ( ) ; textMail . setMsg ( replaceMacros ( txtMsg . toString ( ) , recipient ) ) ; email = textMail ; } email . addTo ( recipient . getEmail ( ) ) ; email . setSubject ( m_subject ) ; } catch ( EmailException e ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_COMPOSE_MAIL_ERR_0 ) , e ) ; } return email ;
public class OpMap { /** * Get the namespace of the step . * @ param opPosOfStep The position of the FROM _ XXX step . * @ return The step ' s namespace , NodeTest . WILD , or null for null namespace . */ public String getStepNS ( int opPosOfStep ) { } }
int argLenOfStep = getArgLengthOfStep ( opPosOfStep ) ; // System . out . println ( " getStepNS . argLenOfStep : " + argLenOfStep ) ; if ( argLenOfStep == 3 ) { int index = m_opMap . elementAt ( opPosOfStep + 4 ) ; if ( index >= 0 ) return ( String ) m_tokenQueue . elementAt ( index ) ; else if ( OpCodes . ELEMWILDCARD == index ) return NodeTest . WILD ; else return null ; } else return null ;
public class DFSContentProvider { /** * / * @ inheritDoc */ public Image getImage ( Object element ) { } }
if ( element instanceof DFSLocationsRoot ) return ImageLibrary . getImage ( "dfs.browser.root.entry" ) ; else if ( element instanceof DFSLocation ) return ImageLibrary . getImage ( "dfs.browser.location.entry" ) ; else if ( element instanceof DFSFolder ) return ImageLibrary . getImage ( "dfs.browser.folder.entry" ) ; else if ( element instanceof DFSFile ) return ImageLibrary . getImage ( "dfs.browser.file.entry" ) ; return null ;
public class SARLValidator { /** * Replies the canonical name of the given object . * @ param object the object . * @ return the canonical name or < code > null < / code > if it cannot be computed . */ protected String canonicalName ( EObject object ) { } }
if ( object instanceof JvmIdentifiableElement ) { return ( ( JvmIdentifiableElement ) object ) . getQualifiedName ( ) ; } final EObject jvmElement = this . associations . getPrimaryJvmElement ( object ) ; if ( jvmElement instanceof JvmIdentifiableElement ) { return ( ( JvmIdentifiableElement ) jvmElement ) . getQualifiedName ( ) ; } return null ;
public class BCAImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . BCA__CAT_NAME : setCATName ( ( String ) newValue ) ; return ; case AfplibPackage . BCA__TRIPLETS : getTriplets ( ) . clear ( ) ; getTriplets ( ) . addAll ( ( Collection < ? extends Triplet > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class DBManagerService { /** * Get the information about all active tenants , which are those whose DBService has * been created . The is keyed by tenant name , and its value is a map of parameters * configured for the corresponding DBService . * @ return Map of information for all active tenants . */ public SortedMap < String , SortedMap < String , Object > > getActiveTenantInfo ( ) { } }
SortedMap < String , SortedMap < String , Object > > activeTenantMap = new TreeMap < > ( ) ; synchronized ( m_tenantDBMap ) { for ( String tenantName : m_tenantDBMap . keySet ( ) ) { DBService dbservice = m_tenantDBMap . get ( tenantName ) ; Map < String , Object > dbServiceParams = dbservice . getAllParams ( ) ; activeTenantMap . put ( tenantName , new TreeMap < String , Object > ( dbServiceParams ) ) ; } } return activeTenantMap ;
public class TransactionalSemiUniqueDatedIndex { /** * new to differentiate */ public Object getFromSemiUnique ( Object dataHolder , List extractors ) { } }
Object result = null ; TransactionLocalStorage txStorage = ( TransactionLocalStorage ) perTransactionStorage . get ( MithraManagerProvider . getMithraManager ( ) . zGetCurrentTransactionWithNoCheck ( ) ) ; FullSemiUniqueDatedIndex perThreadAdded = this . getPerThreadAddedIndex ( txStorage ) ; if ( perThreadAdded != null ) { result = perThreadAdded . getFromSemiUnique ( dataHolder , extractors ) ; } if ( result != null ) { int startIndex = this . semiUniqueExtractors . length ; int length = extractors . size ( ) - startIndex ; boolean matchMoreThanOne = false ; for ( int i = 0 ; i < length ; i ++ ) { AsOfExtractor extractor = ( AsOfExtractor ) extractors . get ( startIndex + i ) ; matchMoreThanOne = matchMoreThanOne || extractor . matchesMoreThanOne ( ) ; } if ( matchMoreThanOne ) { Object mainIndexResult = this . mainIndex . getFromSemiUnique ( dataHolder , extractors ) ; result = checkDeleted ( result , txStorage , mainIndexResult ) ; } } else { result = this . mainIndex . getFromSemiUnique ( dataHolder , extractors ) ; result = this . checkDeletedIndex ( result , txStorage ) ; } return result ;
public class InternalSARLParser { /** * InternalSARL . g : 15875:1 : ruleJvmTypeReference returns [ EObject current = null ] : ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) ; */ public final EObject ruleJvmTypeReference ( ) throws RecognitionException { } }
EObject current = null ; EObject this_JvmParameterizedTypeReference_0 = null ; EObject this_XFunctionTypeRef_3 = null ; enterRule ( ) ; try { // InternalSARL . g : 15881:2 : ( ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) ) // InternalSARL . g : 15882:2 : ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) { // InternalSARL . g : 15882:2 : ( ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) | this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef ) int alt366 = 2 ; int LA366_0 = input . LA ( 1 ) ; if ( ( LA366_0 == RULE_ID || LA366_0 == 44 || ( LA366_0 >= 92 && LA366_0 <= 95 ) ) ) { alt366 = 1 ; } else if ( ( LA366_0 == 49 || LA366_0 == 76 ) ) { alt366 = 2 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return current ; } NoViableAltException nvae = new NoViableAltException ( "" , 366 , 0 , input ) ; throw nvae ; } switch ( alt366 ) { case 1 : // InternalSARL . g : 15883:3 : ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) { // InternalSARL . g : 15883:3 : ( this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * ) // InternalSARL . g : 15884:4 : this _ JvmParameterizedTypeReference _ 0 = ruleJvmParameterizedTypeReference ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmTypeReferenceAccess ( ) . getJvmParameterizedTypeReferenceParserRuleCall_0_0 ( ) ) ; } pushFollow ( FOLLOW_89 ) ; this_JvmParameterizedTypeReference_0 = ruleJvmParameterizedTypeReference ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_JvmParameterizedTypeReference_0 ; afterParserOrEnumRuleCall ( ) ; } // InternalSARL . g : 15892:4 : ( ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) ) * loop365 : do { int alt365 = 2 ; int LA365_0 = input . LA ( 1 ) ; if ( ( LA365_0 == 55 ) ) { int LA365_2 = input . LA ( 2 ) ; if ( ( LA365_2 == 56 ) ) { int LA365_3 = input . LA ( 3 ) ; if ( ( synpred61_InternalSARL ( ) ) ) { alt365 = 1 ; } } } switch ( alt365 ) { case 1 : // InternalSARL . g : 15893:5 : ( ( ( ) ruleArrayBrackets ) ) = > ( ( ) ruleArrayBrackets ) { // InternalSARL . g : 15899:5 : ( ( ) ruleArrayBrackets ) // InternalSARL . g : 15900:6 : ( ) ruleArrayBrackets { // InternalSARL . g : 15900:6 : ( ) // InternalSARL . g : 15901:7: { if ( state . backtracking == 0 ) { current = forceCreateModelElementAndSet ( grammarAccess . getJvmTypeReferenceAccess ( ) . getJvmGenericArrayTypeReferenceComponentTypeAction_0_1_0_0 ( ) , current ) ; } } if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmTypeReferenceAccess ( ) . getArrayBracketsParserRuleCall_0_1_0_1 ( ) ) ; } pushFollow ( FOLLOW_89 ) ; ruleArrayBrackets ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { afterParserOrEnumRuleCall ( ) ; } } } break ; default : break loop365 ; } } while ( true ) ; } } break ; case 2 : // InternalSARL . g : 15918:3 : this _ XFunctionTypeRef _ 3 = ruleXFunctionTypeRef { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmTypeReferenceAccess ( ) . getXFunctionTypeRefParserRuleCall_1 ( ) ) ; } pushFollow ( FOLLOW_2 ) ; this_XFunctionTypeRef_3 = ruleXFunctionTypeRef ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_XFunctionTypeRef_3 ; afterParserOrEnumRuleCall ( ) ; } } break ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class Shape { /** * Check if strides are in order suitable for non - strided mmul etc . * Returns true if c order and strides are descending [ 100,10,1 ] etc * Returns true if f order and strides are ascending [ 1,10,100 ] etc * False otherwise . * @ return true if c + descending , f + ascending , false otherwise */ public static boolean strideDescendingCAscendingF ( INDArray array ) { } }
if ( array . rank ( ) <= 1 ) return true ; long [ ] strides = array . stride ( ) ; if ( array . isVector ( ) && strides [ 0 ] == 1 && strides [ 1 ] == 1 ) return true ; char order = array . ordering ( ) ; if ( order == 'c' ) { // Expect descending . [ 100,10,1 ] etc for ( int i = 1 ; i < strides . length ; i ++ ) if ( strides [ i - 1 ] <= strides [ i ] ) return false ; return true ; } else if ( order == 'f' ) { // Expect ascending . [ 1,10,100 ] etc for ( int i = 1 ; i < strides . length ; i ++ ) if ( strides [ i - 1 ] >= strides [ i ] ) return false ; return true ; } else if ( order == 'a' ) { return true ; } else { throw new RuntimeException ( "Invalid order: not c or f (is: " + order + ")" ) ; }
public class Table { /** * Returns list of constraints dependent on more than one column */ OrderedHashSet getContainingConstraints ( int colIndex ) { } }
OrderedHashSet set = new OrderedHashSet ( ) ; for ( int i = 0 , size = constraintList . length ; i < size ; i ++ ) { Constraint c = constraintList [ i ] ; if ( c . hasColumnPlus ( colIndex ) ) { set . add ( c ) ; } } return set ;
public class ApiOvhDedicatedserver { /** * Release a given option * REST : DELETE / dedicated / server / { serviceName } / option / { option } * @ param serviceName [ required ] The internal name of your dedicated server * @ param option [ required ] The option name */ public void serviceName_option_option_DELETE ( String serviceName , net . minidev . ovh . api . dedicated . server . OvhOptionEnum option ) throws IOException { } }
String qPath = "/dedicated/server/{serviceName}/option/{option}" ; StringBuilder sb = path ( qPath , serviceName , option ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ;
public class TimePicker { /** * zEventTextFieldChanged , This is called whenever the text in the time picker text field has * changed , whether programmatically or by the user . * If the current text contains a valid time , it will be stored in the variable lastValidTime . * Otherwise , the lastValidTime will not be changed . * This will also call the function to indicate to the user if the currently text is a valid * time , invalid text , or a vetoed time . These indications are created by using font , color , and * background changes of the text field . */ private void zEventTextFieldChanged ( ) { } }
// Skip this function if it should not be run . if ( skipTextFieldChangedFunctionWhileTrue ) { return ; } // Gather some variables that we will need . String timeText = timeTextField . getText ( ) ; boolean textIsEmpty = timeText . trim ( ) . isEmpty ( ) ; TimeVetoPolicy vetoPolicy = settings . getVetoPolicy ( ) ; boolean nullIsAllowed = settings . getAllowEmptyTimes ( ) ; // If the text is not empty , then try to parse the time . LocalTime parsedTime = null ; if ( ! textIsEmpty ) { parsedTime = InternalUtilities . getParsedTimeOrNull ( timeText , settings . getFormatForDisplayTime ( ) , settings . getFormatForMenuTimes ( ) , settings . formatsForParsing , settings . getLocale ( ) ) ; } // If the time was parsed successfully , then check it against the veto policy . boolean timeIsVetoed = false ; if ( parsedTime != null ) { timeIsVetoed = InternalUtilities . isTimeVetoed ( vetoPolicy , parsedTime ) ; } // If the time is a valid empty time , then set the last valid time to null . if ( textIsEmpty && nullIsAllowed ) { zInternalSetLastValidTimeAndNotifyListeners ( null ) ; } // If the time is a valid parsed time , then store the last valid time . if ( ( ! textIsEmpty ) && ( parsedTime != null ) && ( timeIsVetoed == false ) ) { zInternalSetLastValidTimeAndNotifyListeners ( parsedTime ) ; } // Draw the time status indications for the user . zDrawTextFieldIndicators ( ) ; // Fire the text change event for beans binding . firePropertyChange ( "text" , null , timeTextField . getText ( ) ) ;
public class SelfCalibrationLinearDualQuadratic { /** * Makes sure that the found solution is valid and physically possible * @ return true if valid */ boolean sanityCheck ( Intrinsic calib ) { } }
if ( UtilEjml . isUncountable ( calib . fx ) ) return false ; if ( UtilEjml . isUncountable ( calib . fy ) ) return false ; if ( UtilEjml . isUncountable ( calib . skew ) ) return false ; if ( calib . fx < 0 ) return false ; if ( calib . fy < 0 ) return false ; return true ;
public class ReadableLogRecord { /** * careful with trace in this method as it is called many times from doByteByByteScanning */ private static ReadableLogRecord read ( ByteBuffer viewBuffer , long expectedSequenceNumber , ByteBuffer sourceBuffer ) { } }
ReadableLogRecord logRecord = null ; int absolutePosition = sourceBuffer . position ( ) + viewBuffer . position ( ) ; // Read the record magic number field . final byte [ ] magicNumberBuffer = new byte [ RECORD_MAGIC_NUMBER . length ] ; viewBuffer . get ( magicNumberBuffer ) ; int recordLength = 0 ; if ( Arrays . equals ( magicNumberBuffer , RECORD_MAGIC_NUMBER ) ) { long recordSequenceNumber = viewBuffer . getLong ( ) ; if ( recordSequenceNumber >= expectedSequenceNumber ) { // The record sequence is consistent with the expected sequence number supplied by the // caller . So skip over the actual log record data in this record so that // we can check the tail sequence number . recordLength = viewBuffer . getInt ( ) ; // Preserve the current byte cursor position so that we can reset back to it later . // Move the byte cursor to the first byte after the record data . final int recordDataPosition = viewBuffer . position ( ) ; viewBuffer . position ( recordDataPosition + recordLength ) ; // Read the repeated record sequence number final long tailSequenceNumber = viewBuffer . getLong ( ) ; // Because are are only looking for sequence numbers larger than expected the only assurance that we // have not read garbage following the magic number is that the first and tail sequence numbers are equal . // Note its still possible garbage is in the data but that can ' t be helped without changing the log format . // It will be discovered later no doubt ! if ( tailSequenceNumber == recordSequenceNumber ) { // Return the buffer ' s pointer to the start of // the record ' s data prior to creating a new // ReadableLogRecord to return to the caller . viewBuffer . position ( recordDataPosition ) ; logRecord = new ReadableLogRecord ( viewBuffer , absolutePosition , tailSequenceNumber ) ; // Advance the original buffer ' s position to the end of this record . This ensures that // the next ReadableLogRecord or WritableLogRecord constructed will read or write the // next record in the file . sourceBuffer . position ( absolutePosition + HEADER_SIZE + recordLength ) ; } } } return logRecord ;
public class BaseRegistrationScreen { /** * Process the command . * < br / > Step 1 - Process the command if possible and return true if processed . * < br / > Step 2 - If I can ' t process , pass to all children ( with me as the source ) . * < br / > Step 3 - If children didn ' t process , pass to parent ( with me as the source ) . * < br / > Note : Never pass to a parent or child that matches the source ( to avoid an endless loop ) . * @ param strCommand The command to process . * @ param sourceSField The source screen field ( to avoid echos ) . * @ param iCommandOptions If this command creates a new screen , create in a new window ? * @ return true if success . */ public boolean doCommand ( String strCommand , ScreenField sourceSField , int iCommandOptions ) { } }
boolean bSuccess = super . doCommand ( strCommand , sourceSField , iCommandOptions ) ; if ( MenuConstants . SUBMIT . equalsIgnoreCase ( strCommand ) ) if ( bSuccess ) { // this . setupUserInfo ( ) ; / / Success , set up their databases } return bSuccess ;
public class DateUtil { /** * Get first date from current year * @ param d date * @ return first date from current year */ public static Date getFirstDayFromCurrentYear ( Date d ) { } }
Calendar cal = Calendar . getInstance ( ) ; cal . setTime ( d ) ; cal . set ( Calendar . MONTH , Calendar . JANUARY ) ; cal . set ( Calendar . DAY_OF_MONTH , 1 ) ; cal . set ( Calendar . HOUR_OF_DAY , 0 ) ; cal . set ( Calendar . MINUTE , 0 ) ; cal . set ( Calendar . SECOND , 0 ) ; cal . set ( Calendar . MILLISECOND , 0 ) ; return cal . getTime ( ) ;
public class TemplateAstMatcher { /** * Returns whether two nodes are equivalent , taking into account the template parameters that were * provided to this matcher . If the template comparison node is a parameter node , then only the * types of the node must match . If the template node is a string literal , only match string * literals . Otherwise , the node must be equal and the child nodes must be equivalent according to * the same function . This differs from the built in Node equivalence function with the special * comparison . */ private boolean matchesNode ( Node template , Node ast ) { } }
if ( isTemplateParameterNode ( template ) ) { int paramIndex = ( int ) ( template . getDouble ( ) ) ; Node previousMatch = paramNodeMatches . get ( paramIndex ) ; if ( previousMatch != null ) { // If this named node has already been matched against , make sure all // subsequent usages of the same named node are equivalent . return ast . isEquivalentTo ( previousMatch ) ; } // Only the types need to match for the template parameters , which allows // the template function to express arbitrary expressions . JSType templateType = template . getJSType ( ) ; checkNotNull ( templateType , "null template parameter type." ) ; // TODO ( johnlenz ) : We shouldn ' t spend time checking template whose // types whose definitions aren ' t included ( NoResolvedType ) . Alternately // we should treat them as " unknown " and perform loose matches . if ( isUnresolvedType ( templateType ) ) { return false ; } MatchResult matchResult = typeMatchingStrategy . match ( templateType , ast . getJSType ( ) ) ; isLooseMatch = matchResult . isLooseMatch ( ) ; boolean isMatch = matchResult . isMatch ( ) ; if ( isMatch && previousMatch == null ) { paramNodeMatches . set ( paramIndex , ast ) ; } return isMatch ; } else if ( isTemplateLocalNameNode ( template ) ) { // If this template name node was already matched against , then make sure // all subsequent usages of the same template name node are equivalent in // the matched code . // For example , this code will handle the case : // function template ( ) { // var a = ' str ' ; // fn ( a ) ; // will only match test code : // var b = ' str ' ; // fn ( b ) ; // but it will not match : // var b = ' str ' ; // fn ( ' str ' ) ; int paramIndex = ( int ) ( template . getDouble ( ) ) ; boolean previouslyMatched = this . localVarMatches . get ( paramIndex ) != null ; if ( previouslyMatched ) { // If this named node has already been matched against , make sure all // subsequent usages of the same named node are equivalent . return ast . getString ( ) . equals ( this . localVarMatches . get ( paramIndex ) ) ; } else { String originalName = ast . getOriginalName ( ) ; String name = ( originalName != null ) ? originalName : ast . getString ( ) ; this . localVarMatches . set ( paramIndex , name ) ; } } else if ( isTemplateParameterStringLiteralNode ( template ) ) { int paramIndex = ( int ) ( template . getDouble ( ) ) ; Node previousMatch = paramNodeMatches . get ( paramIndex ) ; if ( previousMatch != null ) { return ast . isEquivalentTo ( previousMatch ) ; } if ( NodeUtil . isSomeCompileTimeConstStringValue ( ast ) ) { paramNodeMatches . set ( paramIndex , ast ) ; return true ; } return false ; } // Template and AST shape has already been checked , but continue look for // other template variables ( parameters and locals ) that must be checked . Node templateChild = template . getFirstChild ( ) ; Node astChild = ast . getFirstChild ( ) ; while ( templateChild != null ) { if ( ! matchesNode ( templateChild , astChild ) ) { return false ; } templateChild = templateChild . getNext ( ) ; astChild = astChild . getNext ( ) ; } return true ;
public class KinesisDataStreamMarshaller { /** * Marshall the given parameter object . */ public void marshall ( KinesisDataStream kinesisDataStream , ProtocolMarshaller protocolMarshaller ) { } }
if ( kinesisDataStream == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( kinesisDataStream . getArn ( ) , ARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class DeviceProxyDAODefaultImpl { public DbDatum [ ] get_property ( final DeviceProxy deviceProxy , final String [ ] propertyNames ) throws DevFailed { } }
if ( deviceProxy . url . protocol == TANGO ) { checkIfUseDb ( deviceProxy , "get_property()" ) ; if ( deviceProxy . getDb_dev ( ) == null ) { deviceProxy . setDb_dev ( new DbDevice ( deviceProxy . devname , deviceProxy . url . host , deviceProxy . url . strPort ) ) ; } return deviceProxy . getDb_dev ( ) . get_property ( propertyNames ) ; } else { if ( deviceProxy . taco_device == null && deviceProxy . devname != null ) { build_connection ( deviceProxy ) ; } return deviceProxy . taco_device . get_property ( propertyNames ) ; }
public class ExtensionLoaderFactory { /** * Get extension loader by extensible class with listener * @ param clazz Extensible class * @ param listener Listener of ExtensionLoader * @ param < T > Class * @ return ExtensionLoader of this class */ public static < T > ExtensionLoader < T > getExtensionLoader ( Class < T > clazz , ExtensionLoaderListener < T > listener ) { } }
ExtensionLoader < T > loader = LOADER_MAP . get ( clazz ) ; if ( loader == null ) { synchronized ( ExtensionLoaderFactory . class ) { loader = LOADER_MAP . get ( clazz ) ; if ( loader == null ) { loader = new ExtensionLoader < T > ( clazz , listener ) ; LOADER_MAP . put ( clazz , loader ) ; } } } return loader ;
public class JndiBinder { /** * Obtain the connection factory * { @ inheritDoc } */ public Object getObjectInstance ( Object obj , Name name , Context nameCtx , Hashtable < ? , ? > environment ) throws Exception { } }
Reference ref = ( Reference ) obj ; String objName = ( String ) ref . get ( "name" ) . getContent ( ) ; return objs . get ( objName ) ;
public class MoreMath { /** * Return partial derivative x * @ param f * @ return */ public static DoubleBinaryOperator dx ( DoubleBinaryOperator f ) { } }
return ( x , y ) -> { double h = x != 0.0 ? SQRT_EPSILON * x : SQRT_EPSILON ; double h2 = 2.0 * h ; double y1 = - f . applyAsDouble ( x + h2 , y ) ; double y2 = 8.0 * f . applyAsDouble ( x + h , y ) ; double y3 = - 8.0 * f . applyAsDouble ( x - h , y ) ; double y4 = f . applyAsDouble ( x - h2 , y ) ; return ( y1 + y2 + y3 + y4 ) / ( 12.0 * h ) ; } ;
public class XsdAsmInterfaces { /** * Obtains the name of the next type of the sequence . * @ param className The name of the class which contains the sequence . * @ param groupName The groupName of this sequence , if any . * @ param sequenceName The sequence name . * @ param isLast Indication if the next type will be the last of the sequence . * @ return The next sequence type name . */ private String getNextTypeName ( String className , String groupName , String sequenceName , boolean isLast ) { } }
if ( isLast ) return groupName == null ? className + "Complete" : className ; else return className + firstToUpper ( sequenceName ) ;
public class BlobSnippets { /** * [ VARIABLE 8] */ public byte [ ] readContentRange ( int start , int end ) throws IOException { } }
// [ START readContentRange ] try ( ReadChannel reader = blob . reader ( ) ) { reader . seek ( start ) ; ByteBuffer bytes = ByteBuffer . allocate ( end - start ) ; reader . read ( bytes ) ; return bytes . array ( ) ; } // [ END readContentRange ]
public class CliState { /** * This method initializes the { @ link # getArguments ( ) arguments } . This means that the { @ link # getArguments ( ) * arguments } are ordered properly . * @ see CliArgument # addCloseTo ( ) * @ see CliArgument # addAfter ( ) */ protected void initializeArguments ( ) { } }
Map < String , BasicDoubleLinkedNode < CliArgumentContainer > > argumentMap = new HashMap < > ( ) ; BasicDoubleLinkedNode < CliArgumentContainer > startHead = null ; BasicDoubleLinkedNode < CliArgumentContainer > startTail = null ; BasicDoubleLinkedNode < CliArgumentContainer > endHead = null ; BasicDoubleLinkedNode < CliArgumentContainer > endTail = null ; for ( CliArgumentContainer argumentContainer : this . arguments ) { String id = argumentContainer . getId ( ) ; if ( ( CliArgument . ID_FIRST . equals ( id ) ) || ( CliArgument . ID_LAST . equals ( id ) ) ) { throw new NlsIllegalArgumentException ( id , argumentContainer . toString ( ) ) ; } if ( argumentMap . containsKey ( id ) ) { throw new DuplicateObjectException ( argumentContainer , id ) ; } BasicDoubleLinkedNode < CliArgumentContainer > node = new BasicDoubleLinkedNode < > ( ) ; node . setValue ( argumentContainer ) ; argumentMap . put ( id , node ) ; CliArgument cliArgument = argumentContainer . getArgument ( ) ; boolean addAfter = cliArgument . addAfter ( ) ; String nextTo = cliArgument . addCloseTo ( ) ; if ( CliArgument . ID_FIRST . equals ( nextTo ) ) { if ( ( startHead == null ) || ( startTail == null ) ) { startHead = node ; startTail = node ; } else { if ( addAfter ) { startTail . insertAsNext ( node ) ; startTail = node ; } else { startHead . insertAsPrevious ( node ) ; startHead = node ; } } argumentContainer . init ( ) ; } else if ( CliArgument . ID_LAST . equals ( nextTo ) ) { if ( ( endTail == null ) || ( endHead == null ) ) { endTail = node ; endHead = node ; } else { if ( addAfter ) { endTail . insertAsNext ( node ) ; endTail = node ; } else { endHead . insertAsPrevious ( node ) ; endHead = node ; } } argumentContainer . init ( ) ; } } if ( ( startTail != null ) && ( endHead != null ) ) { // connect start and end of list . . . startTail . insertAsNext ( endHead ) ; } for ( BasicDoubleLinkedNode < CliArgumentContainer > node : argumentMap . values ( ) ) { List < String > cycle = initializeArgumentRecursive ( node , argumentMap ) ; if ( cycle != null ) { StringBuilder sb = new StringBuilder ( ) ; for ( int i = cycle . size ( ) - 1 ; i >= 0 ; i -- ) { sb . append ( cycle . get ( i ) ) ; if ( i > 0 ) { sb . append ( "-->" ) ; } } throw new IllegalStateException ( "Cyclic dependency of CLI modes: " + sb . toString ( ) ) ; } } // order arguments if ( startHead != null ) { this . arguments . clear ( ) ; startHead . addToList ( this . arguments ) ; } else if ( endHead != null ) { this . arguments . clear ( ) ; BasicDoubleLinkedNode < CliArgumentContainer > node = endHead ; BasicDoubleLinkedNode < CliArgumentContainer > previous = node . getPrevious ( ) ; while ( previous != null ) { node = previous ; previous = node . getPrevious ( ) ; } node . addToList ( this . arguments ) ; }
public class SamlIdPObjectEncrypter { /** * Gets key encryption credential . * @ param peerEntityId the peer entity id * @ param adaptor the adaptor * @ param service the service * @ return the key encryption credential * @ throws Exception the exception */ protected Credential getKeyEncryptionCredential ( final String peerEntityId , final SamlRegisteredServiceServiceProviderMetadataFacade adaptor , final SamlRegisteredService service ) throws Exception { } }
val config = DefaultSecurityConfigurationBootstrap . buildDefaultEncryptionConfiguration ( ) ; val overrideDataEncryptionAlgorithms = samlIdPProperties . getAlgs ( ) . getOverrideDataEncryptionAlgorithms ( ) ; val overrideKeyEncryptionAlgorithms = samlIdPProperties . getAlgs ( ) . getOverrideKeyEncryptionAlgorithms ( ) ; val overrideBlackListedEncryptionAlgorithms = samlIdPProperties . getAlgs ( ) . getOverrideBlackListedEncryptionAlgorithms ( ) ; val overrideWhiteListedAlgorithms = samlIdPProperties . getAlgs ( ) . getOverrideWhiteListedAlgorithms ( ) ; if ( overrideBlackListedEncryptionAlgorithms != null && ! overrideBlackListedEncryptionAlgorithms . isEmpty ( ) ) { config . setBlacklistedAlgorithms ( overrideBlackListedEncryptionAlgorithms ) ; } if ( overrideWhiteListedAlgorithms != null && ! overrideWhiteListedAlgorithms . isEmpty ( ) ) { config . setWhitelistedAlgorithms ( overrideWhiteListedAlgorithms ) ; } if ( overrideDataEncryptionAlgorithms != null && ! overrideDataEncryptionAlgorithms . isEmpty ( ) ) { config . setDataEncryptionAlgorithms ( overrideDataEncryptionAlgorithms ) ; } if ( overrideKeyEncryptionAlgorithms != null && ! overrideKeyEncryptionAlgorithms . isEmpty ( ) ) { config . setKeyTransportEncryptionAlgorithms ( overrideKeyEncryptionAlgorithms ) ; } LOGGER . debug ( "Encryption blacklisted algorithms: [{}]" , config . getBlacklistedAlgorithms ( ) ) ; LOGGER . debug ( "Encryption key algorithms: [{}]" , config . getKeyTransportEncryptionAlgorithms ( ) ) ; LOGGER . debug ( "Signature data algorithms: [{}]" , config . getDataEncryptionAlgorithms ( ) ) ; LOGGER . debug ( "Encryption whitelisted algorithms: [{}]" , config . getWhitelistedAlgorithms ( ) ) ; val kekCredentialResolver = new MetadataCredentialResolver ( ) ; val providers = new ArrayList < KeyInfoProvider > ( ) ; providers . add ( new RSAKeyValueProvider ( ) ) ; providers . add ( new DSAKeyValueProvider ( ) ) ; providers . add ( new InlineX509DataProvider ( ) ) ; providers . add ( new DEREncodedKeyValueProvider ( ) ) ; providers . add ( new KeyInfoReferenceProvider ( ) ) ; val keyInfoResolver = new BasicProviderKeyInfoCredentialResolver ( providers ) ; kekCredentialResolver . setKeyInfoCredentialResolver ( keyInfoResolver ) ; val roleDescriptorResolver = SamlIdPUtils . getRoleDescriptorResolver ( adaptor , samlIdPProperties . getMetadata ( ) . isRequireValidMetadata ( ) ) ; kekCredentialResolver . setRoleDescriptorResolver ( roleDescriptorResolver ) ; kekCredentialResolver . initialize ( ) ; val criteriaSet = new CriteriaSet ( ) ; criteriaSet . add ( new EncryptionConfigurationCriterion ( config ) ) ; criteriaSet . add ( new EntityIdCriterion ( peerEntityId ) ) ; criteriaSet . add ( new EntityRoleCriterion ( SPSSODescriptor . DEFAULT_ELEMENT_NAME ) ) ; criteriaSet . add ( new UsageCriterion ( UsageType . ENCRYPTION ) ) ; LOGGER . debug ( "Attempting to resolve the encryption key for entity id [{}]" , peerEntityId ) ; return kekCredentialResolver . resolveSingle ( criteriaSet ) ;
public class ArrayUtils { /** * 将给定的基本数据类型的数组转换成给定封装数组类型的Set 。 注意 : 相同hashCode的元素将只保留一个 。 Convert primitive array * to given wrapper type set . * @ param array 源数组 。 source array . * @ param wrapperType 将要转换成的封装类型 。 the array element type will convert to given * wrapper type . * @ return 一个新的给定封装类型的Set并包含按给定数组的所有唯一元素 。 a new wrapper type set have all * unique element of array . */ public static < T > Set < T > toSet ( final Object array , final Class < T > wrapperType ) { } }
T [ ] objectArray = toArray ( array , wrapperType ) ; return toSet ( objectArray ) ;
public class JniServerSocketImpl { /** * Accepts a new connection from the socket . * @ param socket the socket connection structure * @ return true if the accept returns a new socket . */ @ Override public boolean accept ( SocketBar socket ) throws IOException { } }
JniSocketImpl jniSocket = ( JniSocketImpl ) socket ; if ( _fd == 0 ) throw new IOException ( "accept from closed socket" ) ; return jniSocket . accept ( this , _fd , _socketTimeout ) ;
public class CreateIntegrationResponseRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateIntegrationResponseRequest createIntegrationResponseRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createIntegrationResponseRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createIntegrationResponseRequest . getApiId ( ) , APIID_BINDING ) ; protocolMarshaller . marshall ( createIntegrationResponseRequest . getContentHandlingStrategy ( ) , CONTENTHANDLINGSTRATEGY_BINDING ) ; protocolMarshaller . marshall ( createIntegrationResponseRequest . getIntegrationId ( ) , INTEGRATIONID_BINDING ) ; protocolMarshaller . marshall ( createIntegrationResponseRequest . getIntegrationResponseKey ( ) , INTEGRATIONRESPONSEKEY_BINDING ) ; protocolMarshaller . marshall ( createIntegrationResponseRequest . getResponseParameters ( ) , RESPONSEPARAMETERS_BINDING ) ; protocolMarshaller . marshall ( createIntegrationResponseRequest . getResponseTemplates ( ) , RESPONSETEMPLATES_BINDING ) ; protocolMarshaller . marshall ( createIntegrationResponseRequest . getTemplateSelectionExpression ( ) , TEMPLATESELECTIONEXPRESSION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class CmsJspStandardContextBean { /** * Gets a bean containing information about the current template . < p > * @ return the template information bean */ public TemplateBean getTemplate ( ) { } }
TemplateBean templateBean = getRequestAttribute ( CmsTemplateContextManager . ATTR_TEMPLATE_BEAN ) ; if ( templateBean == null ) { templateBean = new TemplateBean ( "" , "" ) ; } return templateBean ;
public class Configuration { /** * Set the < code > value < / code > of the < code > name < / code > property . * @ param name property name . * @ param value property value . */ public void set ( String name , String value ) { } }
getOverlay ( ) . setProperty ( name , value ) ; getProps ( ) . setProperty ( name , value ) ;
public class XmlIO { /** * XMLをファイルに保存する 。 * @ since 1.1 * @ param xmlInfo XML情報 。 * @ param file 書き込み先 * @ param encoding ファイルの文字コード 。 * @ throws XmlOperateException XMLの書き込みに失敗した場合 。 * @ throws IllegalArgumentException xmlInfo is null . * @ throws IllegalArgumentException file is null or encoding is empty . */ public static void save ( final AnnotationMappingInfo xmlInfo , final File file , final String encoding ) throws XmlOperateException { } }
ArgUtils . notNull ( xmlInfo , "xmlInfo" ) ; ArgUtils . notNull ( file , "file" ) ; ArgUtils . notEmpty ( encoding , "encoding" ) ; final Marshaller marshaller ; try { JAXBContext context = JAXBContext . newInstance ( xmlInfo . getClass ( ) ) ; marshaller = context . createMarshaller ( ) ; marshaller . setProperty ( Marshaller . JAXB_ENCODING , encoding ) ; marshaller . setProperty ( Marshaller . JAXB_FORMATTED_OUTPUT , true ) ; } catch ( JAXBException e ) { throw new XmlOperateException ( "fail setting JAXB context." , e ) ; } File dir = file . getParentFile ( ) ; if ( dir != null && ! dir . exists ( ) ) { dir . mkdirs ( ) ; } try ( Writer writer = new OutputStreamWriter ( new FileOutputStream ( file ) , encoding ) ) { marshaller . marshal ( xmlInfo , writer ) ; } catch ( JAXBException | IOException e ) { throw new XmlOperateException ( String . format ( "fail save xml file '%s'." , file . getPath ( ) ) , e ) ; }
public class AbstractFlowFactoryBean { /** * Convert supplied object to of action if possible . */ protected Action toAction ( Object item ) { } }
if ( item instanceof Action ) { return ( Action ) item ; } else if ( item instanceof String ) { final String definition = ( String ) item ; return new DefaultAction ( definition + "@" + RANDOM . nextInt ( ) , resolveDataFunction ( ( String ) item ) , getMiddleware ( definition ) ) ; } else { String name ; List < Middleware > middleware ; try { name = ( String ) ClassApi . findMethod ( item . getClass ( ) , "getName" ) . invoke ( item ) ; middleware = getMiddleware ( name ) ; } catch ( Throwable t ) { name = item . getClass ( ) . getName ( ) ; middleware = Collections . emptyList ( ) ; } return new DefaultAction ( name + "@" + RANDOM . nextInt ( ) , getDataFunctionExtractor ( ) . apply ( item , DEFAULT_FUNCTION ) , middleware ) ; }
public class DataSourceService { /** * Declarative Services method for unsetting the JDBC driver service reference * @ param ref reference to the service */ protected void unsetDriver ( ServiceReference < JDBCDriverService > ref ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "unsetDriver" , ref ) ;
public class MediaType { /** * Convenience method that parses the given media type strings and * returns an unmodifiable set that contains all the parsed types . * @ since Apache Tika 1.2 * @ param types media type strings * @ return unmodifiable set of the parsed types */ public static Set < MediaType > set ( String ... types ) { } }
Set < MediaType > set = new HashSet < MediaType > ( ) ; for ( String type : types ) { MediaType mt = parse ( type ) ; if ( mt != null ) { set . add ( mt ) ; } } return Collections . unmodifiableSet ( set ) ;
public class ApplicationResource { /** * ( non - Javadoc ) * @ see net . roboconf . dm . rest . services . internal . resources . IApplicationResource * # getCommandInstructions ( java . lang . String , java . lang . String ) */ @ Override public Response getCommandInstructions ( String appName , String commandName ) { } }
this . logger . fine ( "Request: get instructions from " + commandName + " in the " + appName + " application." ) ; Response response ; try { Application app = this . manager . applicationMngr ( ) . findApplicationByName ( appName ) ; String res ; if ( app == null ) response = Response . status ( Status . NOT_FOUND ) . build ( ) ; else if ( Utils . isEmptyOrWhitespaces ( res = this . manager . commandsMngr ( ) . getCommandInstructions ( app , commandName ) ) ) response = Response . status ( Status . NO_CONTENT ) . build ( ) ; else response = Response . ok ( res ) . build ( ) ; } catch ( IOException e ) { response = RestServicesUtils . handleError ( Status . INTERNAL_SERVER_ERROR , new RestError ( ErrorCode . REST_UNDETAILED_ERROR , e ) , lang ( this . manager ) ) . build ( ) ; } return response ;
public class DocEnv { /** * Check whether this member should be documented . */ public boolean shouldDocument ( VarSymbol sym ) { } }
long mod = sym . flags ( ) ; if ( ( mod & Flags . SYNTHETIC ) != 0 ) { return false ; } return showAccess . checkModifier ( translateModifiers ( mod ) ) ;
public class CreateApplicationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateApplicationRequest createApplicationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createApplicationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createApplicationRequest . getAuthor ( ) , AUTHOR_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getHomePageUrl ( ) , HOMEPAGEURL_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getLabels ( ) , LABELS_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getLicenseBody ( ) , LICENSEBODY_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getLicenseUrl ( ) , LICENSEURL_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getReadmeBody ( ) , READMEBODY_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getReadmeUrl ( ) , READMEURL_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getSemanticVersion ( ) , SEMANTICVERSION_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getSourceCodeArchiveUrl ( ) , SOURCECODEARCHIVEURL_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getSourceCodeUrl ( ) , SOURCECODEURL_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getSpdxLicenseId ( ) , SPDXLICENSEID_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getTemplateBody ( ) , TEMPLATEBODY_BINDING ) ; protocolMarshaller . marshall ( createApplicationRequest . getTemplateUrl ( ) , TEMPLATEURL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class GetUpgradeHistoryResult { /** * A list of < code > < a > UpgradeHistory < / a > < / code > objects corresponding to each Upgrade or Upgrade Eligibility Check * performed on a domain returned as part of < code > < a > GetUpgradeHistoryResponse < / a > < / code > object . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setUpgradeHistories ( java . util . Collection ) } or { @ link # withUpgradeHistories ( java . util . Collection ) } if you * want to override the existing values . * @ param upgradeHistories * A list of < code > < a > UpgradeHistory < / a > < / code > objects corresponding to each Upgrade or Upgrade * Eligibility Check performed on a domain returned as part of * < code > < a > GetUpgradeHistoryResponse < / a > < / code > object . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetUpgradeHistoryResult withUpgradeHistories ( UpgradeHistory ... upgradeHistories ) { } }
if ( this . upgradeHistories == null ) { setUpgradeHistories ( new java . util . ArrayList < UpgradeHistory > ( upgradeHistories . length ) ) ; } for ( UpgradeHistory ele : upgradeHistories ) { this . upgradeHistories . add ( ele ) ; } return this ;
public class CmsJspTagElementSetting { /** * Internal action method . < p > * @ param setting the setting to look up * @ param defaultValue the default value * @ param escape if the result String should be HTML escaped or not * @ param req the current request * @ return the value of the element setting or < code > null < / code > if not found */ public static String elementSettingTagAction ( String setting , String defaultValue , boolean escape , ServletRequest req ) { } }
String value = elementSettingTagAction ( req ) . get ( setting ) ; if ( value == null ) { value = defaultValue ; } if ( escape ) { // HTML escape the value value = CmsEncoder . escapeHtml ( value ) ; } return value ;
public class ResourceBundlesHandlerImpl { /** * Executes the global preprocessing * @ param bundlesToBuild * The list of bundles to rebuild * @ param processBundleFlag * the flag indicating if the bundles needs to be processed * @ param stopWatch * the stopWatch */ private void executeGlobalPreprocessing ( List < JoinableResourceBundle > bundlesToBuild , boolean processBundleFlag , StopWatch stopWatch ) { } }
stopProcessIfNeeded ( ) ; if ( resourceTypePreprocessor != null ) { if ( stopWatch != null ) { stopWatch . start ( "Global preprocessing" ) ; } GlobalPreprocessingContext ctx = new GlobalPreprocessingContext ( config , resourceHandler , processBundleFlag ) ; resourceTypePreprocessor . processBundles ( ctx , bundles ) ; // Update the list of bundle to rebuild if new bundles have been // detected as dirty in the global preprocessing phase List < JoinableResourceBundle > currentBundles = getBundlesToRebuild ( ) ; for ( JoinableResourceBundle b : currentBundles ) { if ( ! bundlesToBuild . contains ( b ) ) { bundlesToBuild . add ( b ) ; } } if ( stopWatch != null ) { stopWatch . stop ( ) ; } }
public class ModelAdapter { /** * sets a complete new list of items onto this adapter , using the new list . Calls notifyDataSetChanged * @ param list the new items to set * @ param retainFilter set to true if you want to keep the filter applied * @ return this */ public ModelAdapter < Model , Item > setNewList ( List < Model > list , boolean retainFilter ) { } }
List < Item > items = intercept ( list ) ; if ( mUseIdDistributor ) { getIdDistributor ( ) . checkIds ( items ) ; } // reset the filter CharSequence filter = null ; if ( getItemFilter ( ) . getConstraint ( ) != null ) { filter = getItemFilter ( ) . getConstraint ( ) ; getItemFilter ( ) . performFiltering ( null ) ; } mapPossibleTypes ( items ) ; boolean publishResults = filter != null && retainFilter ; if ( publishResults ) { getItemFilter ( ) . publishResults ( filter , getItemFilter ( ) . performFiltering ( filter ) ) ; } mItems . setNewList ( items , ! publishResults ) ; return this ;
public class DataCenterFilter { /** * Method allow to filter data centers by references . * @ param dataCenterRefs is list of references to target dataCenter * @ return { @ link DataCenterFilter } */ public DataCenterFilter dataCenters ( DataCenter ... dataCenterRefs ) { } }
allItemsNotNull ( dataCenterRefs , "Datacenter references" ) ; predicate = predicate . and ( Filter . or ( Streams . map ( dataCenterRefs , DataCenter :: asFilter ) ) . getPredicate ( ) ) ; return this ;
public class AbstractExpression { /** * Ferret out the first argument . This can be m _ left or else * the first element of m _ args . */ public AbstractExpression getFirstArgument ( ) { } }
if ( m_left != null ) { assert ( m_args == null ) ; return m_left ; } if ( m_args != null && m_args . size ( ) > 0 ) { assert ( m_left == null && m_right == null ) ; return m_args . get ( 0 ) ; } return null ;
public class BELScriptParser { /** * BELScript . g : 156:1 : function returns [ String r ] : ( fv = ' proteinAbundance ' | fv = ' p ' | fv = ' rnaAbundance ' | fv = ' r ' | fv = ' abundance ' | fv = ' a ' | fv = ' microRNAAbundance ' | fv = ' m ' | fv = ' geneAbundance ' | fv = ' g ' | fv = ' biologicalProcess ' | fv = ' bp ' | fv = ' pathology ' | fv = ' path ' | fv = ' complexAbundance ' | fv = ' complex ' | fv = ' translocation ' | fv = ' tloc ' | fv = ' cellSecretion ' | fv = ' sec ' | fv = ' cellSurfaceExpression ' | fv = ' surf ' | fv = ' reaction ' | fv = ' rxn ' | fv = ' compositeAbundance ' | fv = ' composite ' | fv = ' fusion ' | fv = ' fus ' | fv = ' degradation ' | fv = ' deg ' | fv = ' molecularActivity ' | fv = ' act ' | fv = ' catalyticActivity ' | fv = ' cat ' | fv = ' kinaseActivity ' | fv = ' kin ' | fv = ' phosphataseActivity ' | fv = ' phos ' | fv = ' peptidaseActivity ' | fv = ' pep ' | fv = ' ribosylationActivity ' | fv = ' ribo ' | fv = ' transcriptionalActivity ' | fv = ' tscript ' | fv = ' transportActivity ' | fv = ' tport ' | fv = ' gtpBoundActivity ' | fv = ' gtp ' | fv = ' chaperoneActivity ' | fv = ' chap ' | fv = ' proteinModification ' | fv = ' pmod ' | fv = ' substitution ' | fv = ' sub ' | fv = ' truncation ' | fv = ' trunc ' | fv = ' reactants ' | fv = ' products ' | fv = ' list ' ) ; */ public final BELScriptParser . function_return function ( ) throws RecognitionException { } }
BELScriptParser . function_return retval = new BELScriptParser . function_return ( ) ; retval . start = input . LT ( 1 ) ; Object root_0 = null ; Token fv = null ; Object fv_tree = null ; try { // BELScript . g : 156:28 : ( ( fv = ' proteinAbundance ' | fv = ' p ' | fv = ' rnaAbundance ' | fv = ' r ' | fv = ' abundance ' | fv = ' a ' | fv = ' microRNAAbundance ' | fv = ' m ' | fv = ' geneAbundance ' | fv = ' g ' | fv = ' biologicalProcess ' | fv = ' bp ' | fv = ' pathology ' | fv = ' path ' | fv = ' complexAbundance ' | fv = ' complex ' | fv = ' translocation ' | fv = ' tloc ' | fv = ' cellSecretion ' | fv = ' sec ' | fv = ' cellSurfaceExpression ' | fv = ' surf ' | fv = ' reaction ' | fv = ' rxn ' | fv = ' compositeAbundance ' | fv = ' composite ' | fv = ' fusion ' | fv = ' fus ' | fv = ' degradation ' | fv = ' deg ' | fv = ' molecularActivity ' | fv = ' act ' | fv = ' catalyticActivity ' | fv = ' cat ' | fv = ' kinaseActivity ' | fv = ' kin ' | fv = ' phosphataseActivity ' | fv = ' phos ' | fv = ' peptidaseActivity ' | fv = ' pep ' | fv = ' ribosylationActivity ' | fv = ' ribo ' | fv = ' transcriptionalActivity ' | fv = ' tscript ' | fv = ' transportActivity ' | fv = ' tport ' | fv = ' gtpBoundActivity ' | fv = ' gtp ' | fv = ' chaperoneActivity ' | fv = ' chap ' | fv = ' proteinModification ' | fv = ' pmod ' | fv = ' substitution ' | fv = ' sub ' | fv = ' truncation ' | fv = ' trunc ' | fv = ' reactants ' | fv = ' products ' | fv = ' list ' ) ) // BELScript . g : 157:5 : ( fv = ' proteinAbundance ' | fv = ' p ' | fv = ' rnaAbundance ' | fv = ' r ' | fv = ' abundance ' | fv = ' a ' | fv = ' microRNAAbundance ' | fv = ' m ' | fv = ' geneAbundance ' | fv = ' g ' | fv = ' biologicalProcess ' | fv = ' bp ' | fv = ' pathology ' | fv = ' path ' | fv = ' complexAbundance ' | fv = ' complex ' | fv = ' translocation ' | fv = ' tloc ' | fv = ' cellSecretion ' | fv = ' sec ' | fv = ' cellSurfaceExpression ' | fv = ' surf ' | fv = ' reaction ' | fv = ' rxn ' | fv = ' compositeAbundance ' | fv = ' composite ' | fv = ' fusion ' | fv = ' fus ' | fv = ' degradation ' | fv = ' deg ' | fv = ' molecularActivity ' | fv = ' act ' | fv = ' catalyticActivity ' | fv = ' cat ' | fv = ' kinaseActivity ' | fv = ' kin ' | fv = ' phosphataseActivity ' | fv = ' phos ' | fv = ' peptidaseActivity ' | fv = ' pep ' | fv = ' ribosylationActivity ' | fv = ' ribo ' | fv = ' transcriptionalActivity ' | fv = ' tscript ' | fv = ' transportActivity ' | fv = ' tport ' | fv = ' gtpBoundActivity ' | fv = ' gtp ' | fv = ' chaperoneActivity ' | fv = ' chap ' | fv = ' proteinModification ' | fv = ' pmod ' | fv = ' substitution ' | fv = ' sub ' | fv = ' truncation ' | fv = ' trunc ' | fv = ' reactants ' | fv = ' products ' | fv = ' list ' ) { root_0 = ( Object ) adaptor . nil ( ) ; // BELScript . g : 157:5 : ( fv = ' proteinAbundance ' | fv = ' p ' | fv = ' rnaAbundance ' | fv = ' r ' | fv = ' abundance ' | fv = ' a ' | fv = ' microRNAAbundance ' | fv = ' m ' | fv = ' geneAbundance ' | fv = ' g ' | fv = ' biologicalProcess ' | fv = ' bp ' | fv = ' pathology ' | fv = ' path ' | fv = ' complexAbundance ' | fv = ' complex ' | fv = ' translocation ' | fv = ' tloc ' | fv = ' cellSecretion ' | fv = ' sec ' | fv = ' cellSurfaceExpression ' | fv = ' surf ' | fv = ' reaction ' | fv = ' rxn ' | fv = ' compositeAbundance ' | fv = ' composite ' | fv = ' fusion ' | fv = ' fus ' | fv = ' degradation ' | fv = ' deg ' | fv = ' molecularActivity ' | fv = ' act ' | fv = ' catalyticActivity ' | fv = ' cat ' | fv = ' kinaseActivity ' | fv = ' kin ' | fv = ' phosphataseActivity ' | fv = ' phos ' | fv = ' peptidaseActivity ' | fv = ' pep ' | fv = ' ribosylationActivity ' | fv = ' ribo ' | fv = ' transcriptionalActivity ' | fv = ' tscript ' | fv = ' transportActivity ' | fv = ' tport ' | fv = ' gtpBoundActivity ' | fv = ' gtp ' | fv = ' chaperoneActivity ' | fv = ' chap ' | fv = ' proteinModification ' | fv = ' pmod ' | fv = ' substitution ' | fv = ' sub ' | fv = ' truncation ' | fv = ' trunc ' | fv = ' reactants ' | fv = ' products ' | fv = ' list ' ) int alt19 = 59 ; switch ( input . LA ( 1 ) ) { case 44 : { alt19 = 1 ; } break ; case 45 : { alt19 = 2 ; } break ; case 46 : { alt19 = 3 ; } break ; case 47 : { alt19 = 4 ; } break ; case 48 : { alt19 = 5 ; } break ; case 49 : { alt19 = 6 ; } break ; case 50 : { alt19 = 7 ; } break ; case 51 : { alt19 = 8 ; } break ; case 52 : { alt19 = 9 ; } break ; case 53 : { alt19 = 10 ; } break ; case 54 : { alt19 = 11 ; } break ; case 55 : { alt19 = 12 ; } break ; case 56 : { alt19 = 13 ; } break ; case 57 : { alt19 = 14 ; } break ; case 58 : { alt19 = 15 ; } break ; case 59 : { alt19 = 16 ; } break ; case 60 : { alt19 = 17 ; } break ; case 61 : { alt19 = 18 ; } break ; case 62 : { alt19 = 19 ; } break ; case 63 : { alt19 = 20 ; } break ; case 64 : { alt19 = 21 ; } break ; case 65 : { alt19 = 22 ; } break ; case 66 : { alt19 = 23 ; } break ; case 67 : { alt19 = 24 ; } break ; case 68 : { alt19 = 25 ; } break ; case 69 : { alt19 = 26 ; } break ; case 70 : { alt19 = 27 ; } break ; case 71 : { alt19 = 28 ; } break ; case 72 : { alt19 = 29 ; } break ; case 73 : { alt19 = 30 ; } break ; case 74 : { alt19 = 31 ; } break ; case 75 : { alt19 = 32 ; } break ; case 76 : { alt19 = 33 ; } break ; case 77 : { alt19 = 34 ; } break ; case 78 : { alt19 = 35 ; } break ; case 79 : { alt19 = 36 ; } break ; case 80 : { alt19 = 37 ; } break ; case 81 : { alt19 = 38 ; } break ; case 82 : { alt19 = 39 ; } break ; case 83 : { alt19 = 40 ; } break ; case 84 : { alt19 = 41 ; } break ; case 85 : { alt19 = 42 ; } break ; case 86 : { alt19 = 43 ; } break ; case 87 : { alt19 = 44 ; } break ; case 88 : { alt19 = 45 ; } break ; case 89 : { alt19 = 46 ; } break ; case 90 : { alt19 = 47 ; } break ; case 91 : { alt19 = 48 ; } break ; case 92 : { alt19 = 49 ; } break ; case 93 : { alt19 = 50 ; } break ; case 94 : { alt19 = 51 ; } break ; case 95 : { alt19 = 52 ; } break ; case 96 : { alt19 = 53 ; } break ; case 97 : { alt19 = 54 ; } break ; case 98 : { alt19 = 55 ; } break ; case 99 : { alt19 = 56 ; } break ; case 100 : { alt19 = 57 ; } break ; case 101 : { alt19 = 58 ; } break ; case 102 : { alt19 = 59 ; } break ; default : NoViableAltException nvae = new NoViableAltException ( "" , 19 , 0 , input ) ; throw nvae ; } switch ( alt19 ) { case 1 : // BELScript . g : 158:9 : fv = ' proteinAbundance ' { fv = ( Token ) match ( input , 44 , FOLLOW_44_in_function854 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 2 : // BELScript . g : 159:9 : fv = ' p ' { fv = ( Token ) match ( input , 45 , FOLLOW_45_in_function880 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 3 : // BELScript . g : 160:9 : fv = ' rnaAbundance ' { fv = ( Token ) match ( input , 46 , FOLLOW_46_in_function921 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 4 : // BELScript . g : 161:9 : fv = ' r ' { fv = ( Token ) match ( input , 47 , FOLLOW_47_in_function952 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 5 : // BELScript . g : 162:9 : fv = ' abundance ' { fv = ( Token ) match ( input , 48 , FOLLOW_48_in_function993 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 6 : // BELScript . g : 163:9 : fv = ' a ' { fv = ( Token ) match ( input , 49 , FOLLOW_49_in_function1027 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 7 : // BELScript . g : 164:9 : fv = ' microRNAAbundance ' { fv = ( Token ) match ( input , 50 , FOLLOW_50_in_function1068 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 8 : // BELScript . g : 165:9 : fv = ' m ' { fv = ( Token ) match ( input , 51 , FOLLOW_51_in_function1094 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 9 : // BELScript . g : 166:9 : fv = ' geneAbundance ' { fv = ( Token ) match ( input , 52 , FOLLOW_52_in_function1135 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 10 : // BELScript . g : 167:9 : fv = ' g ' { fv = ( Token ) match ( input , 53 , FOLLOW_53_in_function1164 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 11 : // BELScript . g : 168:9 : fv = ' biologicalProcess ' { fv = ( Token ) match ( input , 54 , FOLLOW_54_in_function1205 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 12 : // BELScript . g : 169:9 : fv = ' bp ' { fv = ( Token ) match ( input , 55 , FOLLOW_55_in_function1231 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 13 : // BELScript . g : 170:9 : fv = ' pathology ' { fv = ( Token ) match ( input , 56 , FOLLOW_56_in_function1271 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 14 : // BELScript . g : 171:9 : fv = ' path ' { fv = ( Token ) match ( input , 57 , FOLLOW_57_in_function1304 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 15 : // BELScript . g : 172:9 : fv = ' complexAbundance ' { fv = ( Token ) match ( input , 58 , FOLLOW_58_in_function1342 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 16 : // BELScript . g : 173:9 : fv = ' complex ' { fv = ( Token ) match ( input , 59 , FOLLOW_59_in_function1369 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 17 : // BELScript . g : 174:9 : fv = ' translocation ' { fv = ( Token ) match ( input , 60 , FOLLOW_60_in_function1404 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 18 : // BELScript . g : 175:9 : fv = ' tloc ' { fv = ( Token ) match ( input , 61 , FOLLOW_61_in_function1434 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 19 : // BELScript . g : 176:9 : fv = ' cellSecretion ' { fv = ( Token ) match ( input , 62 , FOLLOW_62_in_function1472 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 20 : // BELScript . g : 177:9 : fv = ' sec ' { fv = ( Token ) match ( input , 63 , FOLLOW_63_in_function1502 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 21 : // BELScript . g : 178:9 : fv = ' cellSurfaceExpression ' { fv = ( Token ) match ( input , 64 , FOLLOW_64_in_function1541 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 22 : // BELScript . g : 179:9 : fv = ' surf ' { fv = ( Token ) match ( input , 65 , FOLLOW_65_in_function1562 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 23 : // BELScript . g : 180:9 : fv = ' reaction ' { fv = ( Token ) match ( input , 66 , FOLLOW_66_in_function1600 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 24 : // BELScript . g : 181:9 : fv = ' rxn ' { fv = ( Token ) match ( input , 67 , FOLLOW_67_in_function1634 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 25 : // BELScript . g : 182:9 : fv = ' compositeAbundance ' { fv = ( Token ) match ( input , 68 , FOLLOW_68_in_function1673 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 26 : // BELScript . g : 183:9 : fv = ' composite ' { fv = ( Token ) match ( input , 69 , FOLLOW_69_in_function1697 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 27 : // BELScript . g : 184:9 : fv = ' fusion ' { fv = ( Token ) match ( input , 70 , FOLLOW_70_in_function1730 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 28 : // BELScript . g : 185:9 : fv = ' fus ' { fv = ( Token ) match ( input , 71 , FOLLOW_71_in_function1766 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 29 : // BELScript . g : 186:9 : fv = ' degradation ' { fv = ( Token ) match ( input , 72 , FOLLOW_72_in_function1805 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 30 : // BELScript . g : 187:9 : fv = ' deg ' { fv = ( Token ) match ( input , 73 , FOLLOW_73_in_function1836 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 31 : // BELScript . g : 188:9 : fv = ' molecularActivity ' { fv = ( Token ) match ( input , 74 , FOLLOW_74_in_function1875 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 32 : // BELScript . g : 189:9 : fv = ' act ' { fv = ( Token ) match ( input , 75 , FOLLOW_75_in_function1900 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 33 : // BELScript . g : 190:9 : fv = ' catalyticActivity ' { fv = ( Token ) match ( input , 76 , FOLLOW_76_in_function1939 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 34 : // BELScript . g : 191:9 : fv = ' cat ' { fv = ( Token ) match ( input , 77 , FOLLOW_77_in_function1964 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 35 : // BELScript . g : 192:9 : fv = ' kinaseActivity ' { fv = ( Token ) match ( input , 78 , FOLLOW_78_in_function2003 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 36 : // BELScript . g : 193:9 : fv = ' kin ' { fv = ( Token ) match ( input , 79 , FOLLOW_79_in_function2031 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 37 : // BELScript . g : 194:9 : fv = ' phosphataseActivity ' { fv = ( Token ) match ( input , 80 , FOLLOW_80_in_function2070 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 38 : // BELScript . g : 195:9 : fv = ' phos ' { fv = ( Token ) match ( input , 81 , FOLLOW_81_in_function2093 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 39 : // BELScript . g : 196:9 : fv = ' peptidaseActivity ' { fv = ( Token ) match ( input , 82 , FOLLOW_82_in_function2131 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 40 : // BELScript . g : 197:9 : fv = ' pep ' { fv = ( Token ) match ( input , 83 , FOLLOW_83_in_function2156 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 41 : // BELScript . g : 198:9 : fv = ' ribosylationActivity ' { fv = ( Token ) match ( input , 84 , FOLLOW_84_in_function2195 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 42 : // BELScript . g : 199:9 : fv = ' ribo ' { fv = ( Token ) match ( input , 85 , FOLLOW_85_in_function2217 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 43 : // BELScript . g : 200:9 : fv = ' transcriptionalActivity ' { fv = ( Token ) match ( input , 86 , FOLLOW_86_in_function2255 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 44 : // BELScript . g : 201:9 : fv = ' tscript ' { fv = ( Token ) match ( input , 87 , FOLLOW_87_in_function2274 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 45 : // BELScript . g : 202:9 : fv = ' transportActivity ' { fv = ( Token ) match ( input , 88 , FOLLOW_88_in_function2309 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 46 : // BELScript . g : 203:9 : fv = ' tport ' { fv = ( Token ) match ( input , 89 , FOLLOW_89_in_function2334 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 47 : // BELScript . g : 204:9 : fv = ' gtpBoundActivity ' { fv = ( Token ) match ( input , 90 , FOLLOW_90_in_function2371 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 48 : // BELScript . g : 205:9 : fv = ' gtp ' { fv = ( Token ) match ( input , 91 , FOLLOW_91_in_function2397 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 49 : // BELScript . g : 206:9 : fv = ' chaperoneActivity ' { fv = ( Token ) match ( input , 92 , FOLLOW_92_in_function2436 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 50 : // BELScript . g : 207:9 : fv = ' chap ' { fv = ( Token ) match ( input , 93 , FOLLOW_93_in_function2461 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 51 : // BELScript . g : 208:9 : fv = ' proteinModification ' { fv = ( Token ) match ( input , 94 , FOLLOW_94_in_function2499 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 52 : // BELScript . g : 209:9 : fv = ' pmod ' { fv = ( Token ) match ( input , 95 , FOLLOW_95_in_function2522 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 53 : // BELScript . g : 210:9 : fv = ' substitution ' { fv = ( Token ) match ( input , 96 , FOLLOW_96_in_function2560 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 54 : // BELScript . g : 211:9 : fv = ' sub ' { fv = ( Token ) match ( input , 97 , FOLLOW_97_in_function2590 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 55 : // BELScript . g : 212:9 : fv = ' truncation ' { fv = ( Token ) match ( input , 98 , FOLLOW_98_in_function2629 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 56 : // BELScript . g : 213:9 : fv = ' trunc ' { fv = ( Token ) match ( input , 99 , FOLLOW_99_in_function2661 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 57 : // BELScript . g : 214:9 : fv = ' reactants ' { fv = ( Token ) match ( input , 100 , FOLLOW_100_in_function2698 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 58 : // BELScript . g : 215:9 : fv = ' products ' { fv = ( Token ) match ( input , 101 , FOLLOW_101_in_function2731 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; case 59 : // BELScript . g : 216:9 : fv = ' list ' { fv = ( Token ) match ( input , 102 , FOLLOW_102_in_function2765 ) ; fv_tree = ( Object ) adaptor . create ( fv ) ; adaptor . addChild ( root_0 , fv_tree ) ; retval . r = fv . getText ( ) ; } break ; } } retval . stop = input . LT ( - 1 ) ; retval . tree = ( Object ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( Object ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { } return retval ;
public class SgClass { /** * Returns the name of the conversion method to return a primitive type * value from the following types : { @ link java . lang . Boolean } , * { @ link java . lang . Byte } , { @ link java . lang . Character } , * { @ link java . lang . Short } , { @ link java . lang . Integer } , * { @ link java . lang . Long } , { @ link java . lang . Float } or * { @ link java . lang . Double } . If this class is not one of the above types a * { @ link IllegalArgumentException } will be thrown . * @ param clasz * Class to return a conversion method from . * @ return Name of the no argument conversion method ( like " intValue " for * converting an { @ link java . lang . Integer } into an < code > int < / code > */ public static final String getToPrimitiveMethod ( final SgClass clasz ) { } }
final String name = clasz . getName ( ) ; if ( name . equals ( Boolean . class . getName ( ) ) ) { return "booleanValue" ; } if ( name . equals ( Byte . class . getName ( ) ) ) { return "byteValue" ; } if ( name . equals ( Character . class . getName ( ) ) ) { return "charValue" ; } if ( name . equals ( Short . class . getName ( ) ) ) { return "shortValue" ; } if ( name . equals ( Integer . class . getName ( ) ) ) { return "intValue" ; } if ( name . equals ( Long . class . getName ( ) ) ) { return "longValue" ; } if ( name . equals ( Float . class . getName ( ) ) ) { return "floatValue" ; } if ( name . equals ( Double . class . getName ( ) ) ) { return "doubleValue" ; } throw new IllegalArgumentException ( "Cannot convert '" + clasz . getName ( ) + "' to a primitive type!" ) ;
public class QueueSharder { /** * Return one of the managed queues - the selection method cannot be relied on . It should * be considered a random managed queue . * @ return a queue */ public T getQueue ( ) { } }
Preconditions . checkState ( state . get ( ) == State . STARTED , "Not started" ) ; List < String > localPreferredQueues = Lists . newArrayList ( preferredQueues ) ; if ( localPreferredQueues . size ( ) > 0 ) { String key = localPreferredQueues . get ( random . nextInt ( localPreferredQueues . size ( ) ) ) ; return queues . get ( key ) ; } List < String > keys = Lists . newArrayList ( queues . keySet ( ) ) ; String key = keys . get ( random . nextInt ( keys . size ( ) ) ) ; return queues . get ( key ) ;
public class Proposal { /** * Gets the approvalStatus value for this Proposal . * @ return approvalStatus * The approval status of the { @ code Proposal } for the active * user or { @ code null } if the active * user has no action needed . * < span class = " constraint Applicable " > This attribute * is applicable when : < ul > < li > using programmatic guaranteed , using sales * management . < / li > < li > not using programmatic , using sales management . < / li > < / ul > < / span > * < span class = " constraint ReadOnly " > This attribute is read - only when : < ul > < li > using * programmatic guaranteed , using sales management . < / li > < li > not using * programmatic , using sales management . < / li > < / ul > < / span > */ public com . google . api . ads . admanager . axis . v201902 . ProposalApprovalStatus getApprovalStatus ( ) { } }
return approvalStatus ;
public class Configurator { /** * Takes vector of ProtocolConfigurations , iterates through it , creates Protocol for * each ProtocolConfiguration and returns all Protocols in a list . * @ param protocol _ configs List of ProtocolConfigurations * @ param stack The protocol stack * @ return List of Protocols */ public static List < Protocol > createProtocols ( List < ProtocolConfiguration > protocol_configs , final ProtocolStack stack ) throws Exception { } }
List < Protocol > retval = new LinkedList < > ( ) ; for ( int i = 0 ; i < protocol_configs . size ( ) ; i ++ ) { ProtocolConfiguration protocol_config = protocol_configs . get ( i ) ; Protocol layer = createLayer ( stack , protocol_config ) ; if ( layer == null ) return null ; retval . add ( layer ) ; } return retval ;
public class CompensatingTransactionUtils { /** * Perform the specified operation , storing the state prior to the operation * in order to enable commit / rollback later . If no transaction is currently * active , proceed with the original call on the target . * @ param synchronizationKey * the transaction synchronization key we are operating on * ( typically something similar to a DataSource ) . * @ param target * the actual target resource that should be used for invoking * the operation on should no transaction be active . * @ param method * name of the method to be invoked . * @ param args * arguments with which the operation is invoked . */ public static void performOperation ( Object synchronizationKey , Object target , Method method , Object [ ] args ) throws Throwable { } }
CompensatingTransactionHolderSupport transactionResourceHolder = ( CompensatingTransactionHolderSupport ) TransactionSynchronizationManager . getResource ( synchronizationKey ) ; if ( transactionResourceHolder != null ) { CompensatingTransactionOperationManager transactionOperationManager = transactionResourceHolder . getTransactionOperationManager ( ) ; transactionOperationManager . performOperation ( transactionResourceHolder . getTransactedResource ( ) , method . getName ( ) , args ) ; } else { // Perform the target operation try { method . invoke ( target , args ) ; } catch ( InvocationTargetException e ) { throw e . getTargetException ( ) ; } }
public class FilteredRequest { /** * Returns the user defined as parameter " user " if present . */ @ Override public String getRemoteUser ( ) { } }
String user = getHeader ( "X_REMOTE_USER" ) ; if ( user != null ) { return user ; } else { return super . getRemoteUser ( ) ; }
public class Stream { /** * Returns stream of aggregated results based on the given window configuration . * @ param windowConfig window configuration like window length and slide length . * @ param windowStoreFactory intermediary tuple store for storing tuples for windowing * @ param inputFields input fields * @ param aggregator aggregator to run on the window of tuples to compute the result and emit to the stream . * @ param functionFields fields of values to emit with aggregation . * @ return the new stream with this operation . */ public Stream window ( WindowConfig windowConfig , WindowsStoreFactory windowStoreFactory , Fields inputFields , Aggregator aggregator , Fields functionFields ) { } }
return window ( windowConfig , windowStoreFactory , inputFields , aggregator , functionFields , true ) ;
public class CSSParserVisitorImpl { /** * remove terminal node emtpy tokens from input list * @ param inputArrayList original list * @ return list without terminal node type = S ( space ) */ private List < ParseTree > filterSpaceTokens ( List < ParseTree > inputArrayList ) { } }
List < ParseTree > ret = new ArrayList < ParseTree > ( inputArrayList . size ( ) ) ; for ( ParseTree item : inputArrayList ) { if ( ! ( item instanceof TerminalNode ) || ( ( TerminalNodeImpl ) item ) . getSymbol ( ) . getType ( ) != CSSLexer . S ) { ret . add ( item ) ; } } return ret ;
public class Promises { /** * Returns the type of ` await [ expr ] ` . * < p > This is equivalent to the type of ` result ` in ` Promise . resolve ( [ expr ] ) . then ( result = > ` * < p > For example : * < p > { @ code ! Promise < number > } becomes { @ code number } * < p > { @ code ! IThenable < number > } becomes { @ code number } * < p > { @ code string } becomes { @ code string } * < p > { @ code ( ! Promise < number > | string ) } becomes { @ code ( number | string ) } * < p > { @ code ? Promise < number > } becomes { @ code ( null | number ) } */ static final JSType getResolvedType ( JSTypeRegistry registry , JSType type ) { } }
if ( type . isUnknownType ( ) ) { return type ; } if ( type . isUnionType ( ) ) { UnionTypeBuilder unionTypeBuilder = UnionTypeBuilder . create ( registry ) ; for ( JSType alternate : type . toMaybeUnionType ( ) . getAlternates ( ) ) { unionTypeBuilder . addAlternate ( getResolvedType ( registry , alternate ) ) ; } return unionTypeBuilder . build ( ) ; } // If we can find the " IThenable " template key ( which is true for Promise and IThenable ) , return // the resolved value . e . g . for " ! Promise < string > " return " string " . TemplateTypeMap templates = type . getTemplateTypeMap ( ) ; if ( templates . hasTemplateKey ( registry . getIThenableTemplate ( ) ) ) { // Call getResolvedPromiseType again in case someone does something unusual like // ! Promise < ! Promise < number > > // TODO ( lharker ) : we don ' t need to handle this case and should report an error for this in a // type annotation ( not here , maybe in TypeCheck ) . A Promise cannot resolve to another Promise return getResolvedType ( registry , templates . getResolvedTemplateType ( registry . getIThenableTemplate ( ) ) ) ; } // Awaiting anything with a " . then " property ( other than IThenable , handled above ) should return // unknown , rather than the type itself . if ( type . isSubtypeOf ( registry . getNativeType ( JSTypeNative . THENABLE_TYPE ) ) ) { return registry . getNativeType ( JSTypeNative . UNKNOWN_TYPE ) ; } return type ;
public class FileUtil { /** * 递归遍历目录以及子目录中的所有文件 < br > * 如果提供file为文件 , 直接返回过滤结果 * @ param file 当前遍历文件或目录 * @ param fileFilter 文件过滤规则对象 , 选择要保留的文件 , 只对文件有效 , 不过滤目录 * @ return 文件列表 */ public static List < File > loopFiles ( File file , FileFilter fileFilter ) { } }
List < File > fileList = new ArrayList < File > ( ) ; if ( null == file ) { return fileList ; } else if ( false == file . exists ( ) ) { return fileList ; } if ( file . isDirectory ( ) ) { final File [ ] subFiles = file . listFiles ( ) ; if ( ArrayUtil . isNotEmpty ( subFiles ) ) { for ( File tmp : subFiles ) { fileList . addAll ( loopFiles ( tmp , fileFilter ) ) ; } } } else { if ( null == fileFilter || fileFilter . accept ( file ) ) { fileList . add ( file ) ; } } return fileList ;
public class Caster { /** * cast a Object to a Float Object ( reference type ) * @ param o Object to cast * @ param defaultValue * @ return casted Float Object */ public static Float toFloat ( Object o , Float defaultValue ) { } }
if ( o instanceof Float ) return ( Float ) o ; if ( defaultValue != null ) return new Float ( toFloatValue ( o , defaultValue . floatValue ( ) ) ) ; float res = toFloatValue ( o , Float . MIN_VALUE ) ; if ( res == Float . MIN_VALUE ) return defaultValue ; return new Float ( res ) ;
public class SimpleULogger { /** * For parameterized messages , first substitute parameters and then log . * @ param level level * @ param parameterizedMsg message pattern * @ param param1 param1 * @ param param2 param2 */ private void parameterizedLog ( final String level , final Object parameterizedMsg , final Object param1 , final Object param2 ) { } }
if ( parameterizedMsg instanceof String ) { String msgStr = ( String ) parameterizedMsg ; msgStr = MessageFormatter . format ( msgStr , param1 , param2 ) ; log ( level , msgStr , null ) ; } else { // To be failsafe , we handle the case where ' messagePattern ' is not // a String . Unless the user makes a mistake , this should not happen . log ( level , parameterizedMsg . toString ( ) , null ) ; }
public class TransformedInputRow { /** * Constructs a { @ link TransformedInputRow } based on another row , or returns * the row if it is already a { @ link TransformedInputRow } . * @ param row * @ return */ public static TransformedInputRow of ( final InputRow row ) { } }
if ( row instanceof TransformedInputRow ) { // re - use existing transformed input row . return ( TransformedInputRow ) row ; } else { return new TransformedInputRow ( row , row . getId ( ) ) ; }
public class NumberUtils { /** * Requires that an { @ code int } can be represented as an unsigned { @ code byte } . * @ param i the { @ code int } to test * @ return the { @ code int } if it can be represented as an unsigned { @ code byte } * @ throws IllegalArgumentException if { @ code i } cannot be represented as an unsigned { @ code byte } */ public static int requireUnsignedByte ( int i ) { } }
if ( i > UNSIGNED_BYTE_MAX_VALUE ) { throw new IllegalArgumentException ( String . format ( "%d is larger than %d bits" , i , UNSIGNED_BYTE_SIZE ) ) ; } return i ;
public class StmtCommonTableScan { /** * Copy the table schema from the shared part to here . * We have to repair the table aliases . */ private void copyTableSchemaFromShared ( ) { } }
for ( SchemaColumn scol : m_sharedScan . getOutputSchema ( ) ) { SchemaColumn copy = new SchemaColumn ( scol . getTableName ( ) , getTableAlias ( ) , scol . getColumnName ( ) , scol . getColumnAlias ( ) , scol . getExpression ( ) , scol . getDifferentiator ( ) ) ; addOutputColumn ( copy ) ; }
public class ConfigUtil { /** * Like { @ link # loadProperties ( String , ClassLoader ) } but the properties are loaded into the * supplied { @ link Properties } object . */ public static void loadProperties ( String path , ClassLoader loader , Properties target ) throws IOException { } }
InputStream in = getStream ( path , loader ) ; if ( in == null ) { throw new FileNotFoundException ( path ) ; } target . load ( in ) ; in . close ( ) ;
public class Entry { /** * Sets the entry title . * @ param title the entry title , < b > null < / b > if none . */ public void setTitle ( final String title ) { } }
if ( this . title == null ) { this . title = new Content ( ) ; } this . title . setValue ( title ) ;
public class CsvConfigurationDetection { /** * Auto - detect the { @ link CsvConfiguration } of a CSV style data file , * providing the encoding externally . * @ param encoding * @ return a detected CSV configuration * @ throws IllegalStateException if an error occurs during auto - detection */ public CsvConfiguration suggestCsvConfiguration ( final String encoding , final List < String > columnNames ) throws IllegalStateException { } }
final byte [ ] sample = getSampleBuffer ( ) ; return suggestCsvConfiguration ( sample , encoding , columnNames ) ;
public class TypedArrayCompat { /** * Extracts theme attributes from a typed array for later resolution using { @ link * Resources . Theme # resolveAttributes ( int [ ] , int [ ] ) } . Removes the entries from the typed array so * that subsequent calls to typed getters will return the default value without crashing . * @ return an array of length { @ link TypedArray # getIndexCount ( ) } populated with theme * attributes , or null if there are no theme attributes in the typed array */ public static int [ ] extractThemeAttrs ( TypedArray array ) { } }
int [ ] scrap = null ; /* if ( mRecycled ) { throw new RuntimeException ( " Cannot make calls to a recycled instance ! " ) ; */ int [ ] attrs = null ; int [ ] mData = null ; try { Field mDataField = array . getClass ( ) . getDeclaredField ( "mData" ) ; mDataField . setAccessible ( true ) ; mData = ( int [ ] ) mDataField . get ( array ) ; } catch ( NoSuchFieldException e ) { e . printStackTrace ( ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } final int [ ] data = mData ; final int N = array . length ( ) ; for ( int i = 0 ; i < N ; i ++ ) { final int index = i * STYLE_NUM_ENTRIES ; if ( data [ index + STYLE_TYPE ] != TypedValue . TYPE_ATTRIBUTE ) { // Not an attribute , ignore . continue ; } // Null the entry so that we can safely call getZzz ( ) . data [ index + STYLE_TYPE ] = TypedValue . TYPE_NULL ; final int attr = data [ index + STYLE_DATA ] ; if ( attr == 0 ) { // Useless data , ignore . continue ; } // Ensure we have a usable attribute array . if ( attrs == null ) { if ( scrap != null && scrap . length == N ) { attrs = scrap ; Arrays . fill ( attrs , 0 ) ; } else { attrs = new int [ N ] ; } } attrs [ i ] = attr ; } return attrs ;
public class TableModel { /** * Search and return the IdGenerator in this TableModel by its generationType * and name */ public IdGenerator getIdGenerator ( GenerationType generationType , String name ) { } }
return getIdGenerator ( generationType , name , getIdGenerators ( ) ) ;
public class ConsistentHashRing { /** * Returns the appropriate server for the given key . * Running time : O ( 1) * @ param key * @ throws java . util . NoSuchElementException if the ring is empty * @ return */ public ServiceInformation get ( String key ) { } }
ServiceInformation info = null ; long hash = algorithm . hash ( key ) ; // Find the first server with a hash key after this one final SortedMap < Long , ServiceInformation > tailMap = ring . tailMap ( hash ) ; // Wrap around to the beginning of the ring , if we went past the last one hash = tailMap . isEmpty ( ) ? ring . firstKey ( ) : tailMap . firstKey ( ) ; info = ring . get ( hash ) ; return info ;
public class CSVString { /** * forward pos until the end of quote */ StringBuilder fwdQuote ( char q ) { } }
StringBuilder sb = new StringBuilder ( ) ; while ( hasNext ( ) ) { next ( ) ; sb . append ( buffer [ pos ] ) ; if ( isCurr ( q ) ) { if ( isNext ( q ) ) { // consecutive quote sign next ( ) ; } else { break ; } } } if ( sb . length ( ) > 0 ) sb . setLength ( sb . length ( ) - 1 ) ; // remove closing quote sign return sb ;
public class AbstractResourceRegistration { /** * { @ inheritDoc } */ @ Override public final DescriptionProvider getModelDescription ( final PathAddress address ) { } }
if ( parent != null ) { RootInvocation ri = getRootInvocation ( ) ; return ri . root . getModelDescription ( ri . pathAddress . append ( address ) ) ; } // else we are the root return getModelDescription ( address . iterator ( ) ) ;
public class DirectoryBasedOverlayContainerImpl { /** * { @ inheritDoc } */ @ Override public void addToNonPersistentCache ( String path , Class owner , Object data ) { } }
cacheStore . addToCache ( path , owner , data ) ;
public class ModelMapper { /** * Returns the TypeMap for the { @ code sourceType } and { @ code destinationType } , else returns * { @ code null } if none exists . * @ param < S > source type * @ param < D > destination type * @ throws IllegalArgumentException is { @ code sourceType } or { @ code destinationType } are null * @ see # createTypeMap ( Class , Class ) */ public < S , D > TypeMap < S , D > getTypeMap ( Class < S > sourceType , Class < D > destinationType ) { } }
Assert . notNull ( sourceType , "sourceType" ) ; Assert . notNull ( destinationType , "destinationType" ) ; return config . typeMapStore . < S , D > get ( sourceType , destinationType , null ) ;
public class AbcGrammar { /** * ifield - area : : = % 5B . % 41 . % 3A * WSP tex - text - ifield % 5D < p > * < tt > [ A : . . ] < / tt > */ Rule IfieldArea ( ) { } }
return Sequence ( String ( "[A:" ) , ZeroOrMore ( WSP ( ) ) . suppressNode ( ) , TexTextIfield ( ) , String ( "]" ) ) . label ( IfieldArea ) ;
public class DynamicCompositeAgent { /** * { @ inheritDoc } * Note that one agent throwing an exception on close will not prevent other agents from being closed . * @ throws RuntimeException if any sub - agent throws an exception onClose . The agents exceptions are collected as * suppressed exceptions in the thrown exception . */ public void onClose ( ) { } }
status = Status . CLOSED ; RuntimeException ce = null ; for ( final Agent agent : agents ) { try { agent . onClose ( ) ; } catch ( final Exception ex ) { if ( ce == null ) { ce = new RuntimeException ( getClass ( ) . getName ( ) + ": underlying agent error on close" ) ; } ce . addSuppressed ( ex ) ; } } agents = EMPTY_AGENTS ; if ( ce != null ) { throw ce ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcAxis2Placement2D ( ) { } }
if ( ifcAxis2Placement2DEClass == null ) { ifcAxis2Placement2DEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 32 ) ; } return ifcAxis2Placement2DEClass ;
public class HysteresisEdgeTraceMark { /** * Traces along object ' s contour starting at the specified seed . As it does so it will set the intensity of * points which are below the lower threshold to zero and add points to contour . */ protected void trace ( int x , int y , int indexInten ) { } }
int dx , dy ; int indexOut = output . getIndex ( x , y ) ; open . grow ( ) . set ( x , y ) ; output . data [ indexOut ] = 1 ; intensity . data [ indexInten ] = MARK_TRAVERSED ; while ( open . size ( ) > 0 ) { active . set ( open . removeTail ( ) ) ; indexInten = intensity . getIndex ( active . x , active . y ) ; int indexDir = direction . getIndex ( active . x , active . y ) ; boolean first = true ; while ( true ) { // - - - - - First check along the direction of the edge . Only need to check 2 points this way switch ( direction . data [ indexDir ] ) { case 0 : dx = 0 ; dy = 1 ; break ; case 1 : dx = 1 ; dy = - 1 ; break ; case 2 : dx = 1 ; dy = 0 ; break ; case - 1 : dx = 1 ; dy = 1 ; break ; default : throw new RuntimeException ( "Unknown direction: " + direction . data [ indexDir ] ) ; } int indexForward = indexInten + dy * intensity . stride + dx ; int indexBackward = indexInten - dy * intensity . stride - dx ; int prevIndexDir = indexDir ; boolean match = false ; // pixel coordinate of forward and backward point x = active . x ; y = active . y ; int fx = active . x + dx , fy = active . y + dy ; int bx = active . x - dx , by = active . y - dy ; if ( intensity . isInBounds ( fx , fy ) && intensity . data [ indexForward ] >= lower ) { intensity . data [ indexForward ] = MARK_TRAVERSED ; output . unsafe_set ( fx , fy , 1 ) ; active . set ( fx , fy ) ; match = true ; indexInten = indexForward ; indexDir = prevIndexDir + dy * intensity . stride + dx ; } if ( intensity . isInBounds ( bx , by ) && intensity . data [ indexBackward ] >= lower ) { intensity . data [ indexBackward ] = MARK_TRAVERSED ; output . unsafe_set ( bx , by , 1 ) ; if ( match ) { open . grow ( ) . set ( bx , by ) ; } else { active . set ( bx , by ) ; match = true ; indexInten = indexBackward ; indexDir = prevIndexDir - dy * intensity . stride - dx ; } } if ( first || ! match ) { boolean priorMatch = match ; // Check local neighbors if its one of the end points , which would be the first point or // any point for which no matches were found match = checkAllNeighbors ( x , y , match ) ; if ( ! match ) break ; else { // if it was the first it ' s no longer the first first = false ; // the point at the end was just added and is to be searched in the next iteration if ( ! priorMatch ) { indexInten = intensity . getIndex ( active . x , active . y ) ; indexDir = direction . getIndex ( active . x , active . y ) ; } } } } }
public class RestTemplateBuilder { /** * Set the { @ link RestTemplateCustomizer RestTemplateCustomizers } that should be * applied to the { @ link RestTemplate } . Customizers are applied in the order that they * were added after builder configuration has been applied . Setting this value will * replace any previously configured customizers . * @ param restTemplateCustomizers the customizers to set * @ return a new builder instance * @ see # additionalCustomizers ( RestTemplateCustomizer . . . ) */ public RestTemplateBuilder customizers ( Collection < ? extends RestTemplateCustomizer > restTemplateCustomizers ) { } }
Assert . notNull ( restTemplateCustomizers , "RestTemplateCustomizers must not be null" ) ; return new RestTemplateBuilder ( this . detectRequestFactory , this . rootUri , this . messageConverters , this . requestFactorySupplier , this . uriTemplateHandler , this . errorHandler , this . basicAuthentication , Collections . unmodifiableSet ( new LinkedHashSet < RestTemplateCustomizer > ( restTemplateCustomizers ) ) , this . requestFactoryCustomizer , this . interceptors ) ;
public class Sql { /** * A variant of { @ link # eachRow ( String , java . util . List , groovy . lang . Closure , int , int , groovy . lang . Closure ) } * allowing the named parameters to be supplied in a map . * @ param sql the sql statement * @ param map a map containing the named parameters * @ param offset the 1 - based offset for the first row to be processed * @ param maxRows the maximum number of rows to be processed * @ param metaClosure called for meta data ( only once after sql execution ) * @ param rowClosure called for each row with a GroovyResultSet * @ throws SQLException if a database access error occurs * @ since 1.8.7 */ public void eachRow ( String sql , Map map , @ ClosureParams ( value = SimpleType . class , options = "java.sql.ResultSetMetaData" ) Closure metaClosure , int offset , int maxRows , @ ClosureParams ( value = SimpleType . class , options = "groovy.sql.GroovyResultSet" ) Closure rowClosure ) throws SQLException { } }
eachRow ( sql , singletonList ( map ) , metaClosure , offset , maxRows , rowClosure ) ;
public class RasmolCommandListener { /** * takes care of the cursor up / down keys . triggers copying of stored * commands into the current textfield */ @ Override public void keyReleased ( KeyEvent e ) { } }
int code = e . getKeyCode ( ) ; // String s = e . getKeyText ( code ) ; // System . out . println ( s ) ; if ( ( code == KeyEvent . VK_UP ) || ( code == KeyEvent . VK_KP_UP ) ) { // go one back in history ; if ( historyPosition > 0 ) { historyPosition = historyPosition - 1 ; } } else if ( ( code == KeyEvent . VK_DOWN ) || ( code == KeyEvent . VK_KP_DOWN ) ) { if ( historyPosition < ( history . size ( ) - 1 ) ) { historyPosition ++ ; } else { // clear command if at beginning of history textfield . setText ( "" ) ; historyPosition = history . size ( ) ; return ; } } else if ( code == KeyEvent . VK_PAGE_UP ) { if ( historyPosition > 0 ) { historyPosition = 0 ; } } else if ( code == KeyEvent . VK_PAGE_DOWN ) { if ( historyPosition >= 0 ) { historyPosition = history . size ( ) - 1 ; } } else { // some other key has been pressed , do nothing return ; } if ( historyPosition >= 0 ) { String txt = history . get ( historyPosition ) ; textfield . setText ( txt ) ; }
public class Matrix { /** * Scales matrix m by x , y , and z , putting the result in sm * @ param sm returns the result * @ param smOffset index into sm where the result matrix starts * @ param m source matrix * @ param mOffset index into m where the source matrix starts * @ param x scale factor x * @ param y scale factor y * @ param z scale factor z */ public static void scaleM ( float [ ] sm , int smOffset , float [ ] m , int mOffset , float x , float y , float z ) { } }
for ( int i = 0 ; i < 4 ; i ++ ) { int smi = smOffset + i ; int mi = mOffset + i ; sm [ smi ] = m [ mi ] * x ; sm [ 4 + smi ] = m [ 4 + mi ] * y ; sm [ 8 + smi ] = m [ 8 + mi ] * z ; sm [ 12 + smi ] = m [ 12 + mi ] ; }
public class Broker { /** * Sends an event to the default exchange . * @ param channel Name of the channel . * @ param message Message to send . */ public void sendMessage ( String channel , Message message ) { } }
ensureChannel ( channel ) ; admin . getRabbitTemplate ( ) . convertAndSend ( exchange . getName ( ) , channel , message ) ;
public class EndpointBuilder { /** * Builds an proxy for a remote XML - RPC service located at < code > uri < / code > . * Call get ( ) to obtain instance . * @ param uri * URL to a remote XML - RPC service * @ param clazz * declaring remote XML - RPC methods * @ param < T > * proxy interface * @ return proxy to access XML - RPC service */ public static < T > EndpointBuilder < T > client ( URI uri , Class < T > clazz ) { } }
return new EndpointBuilder < T > ( uri , clazz ) ;
public class ListPrincipalsResult { /** * The principals . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPrincipals ( java . util . Collection ) } or { @ link # withPrincipals ( java . util . Collection ) } if you want to * override the existing values . * @ param principals * The principals . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListPrincipalsResult withPrincipals ( Principal ... principals ) { } }
if ( this . principals == null ) { setPrincipals ( new java . util . ArrayList < Principal > ( principals . length ) ) ; } for ( Principal ele : principals ) { this . principals . add ( ele ) ; } return this ;
public class Convert { /** * 替换全角为半角 * @ param text 文本 * @ param notConvertSet 不替换的字符集合 * @ return 替换后的字符 */ public static String toDBC ( String text , Set < Character > notConvertSet ) { } }
char c [ ] = text . toCharArray ( ) ; for ( int i = 0 ; i < c . length ; i ++ ) { if ( null != notConvertSet && notConvertSet . contains ( c [ i ] ) ) { // 跳过不替换的字符 continue ; } if ( c [ i ] == '\u3000' || c [ i ] == '\u00a0' || c [ i ] == '\u2007' || c [ i ] == '\u202F' ) { // \ u3000是中文全角空格 , \ u00a0 、 \ u2007 、 \ u202F是不间断空格 c [ i ] = ' ' ; } else if ( c [ i ] > '\uFF00' && c [ i ] < '\uFF5F' ) { c [ i ] = ( char ) ( c [ i ] - 65248 ) ; } } String returnString = new String ( c ) ; return returnString ;