signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TokenPropagationHelper { /** * Gets the username from the principal of the subject .
* @ return
* @ throws WSSecurityException */
public static String getUserName ( ) throws Exception { } } | Subject subject = getRunAsSubjectInternal ( ) ; if ( subject == null ) { return null ; } Set < Principal > principals = subject . getPrincipals ( ) ; Iterator < Principal > principalsIterator = principals . iterator ( ) ; if ( principalsIterator . hasNext ( ) ) { Principal principal = principalsIterator . next ( ) ; return principal . getName ( ) ; } return null ; |
public class DescribeFindingsRequest { /** * The ARN that specifies the finding that you want to describe .
* @ param findingArns
* The ARN that specifies the finding that you want to describe . */
public void setFindingArns ( java . util . Collection < String > findingArns ) { } } | if ( findingArns == null ) { this . findingArns = null ; return ; } this . findingArns = new java . util . ArrayList < String > ( findingArns ) ; |
public class UnImplNode { /** * Unimplemented . See org . w3c . dom . Element
* @ param namespaceURI Namespace URI of the element
* @ param localName Local part of qualified name of the element
* @ return null */
public NodeList getElementsByTagNameNS ( String namespaceURI , String localName ) { } } | error ( XMLErrorResources . ER_FUNCTION_NOT_SUPPORTED ) ; // " getElementsByTagNameNS not supported ! " ) ;
return null ; |
public class BinaryInMemorySortBuffer { /** * Writes a given record to this sort buffer . The written record will be appended and take
* the last logical position .
* @ param record The record to be written .
* @ return True , if the record was successfully written , false , if the sort buffer was full .
* @ throws IOException Thrown , if an error occurred while serializing the record into the buffers . */
public boolean write ( BaseRow record ) throws IOException { } } | // check whether we need a new memory segment for the sort index
if ( ! checkNextIndexOffset ( ) ) { return false ; } // serialize the record into the data buffers
int skip ; try { skip = this . inputSerializer . serializeToPages ( record , this . recordCollector ) ; } catch ( EOFException e ) { return false ; } final long newOffset = this . recordCollector . getCurrentOffset ( ) ; long currOffset = currentDataBufferOffset + skip ; writeIndexAndNormalizedKey ( record , currOffset ) ; this . currentDataBufferOffset = newOffset ; return true ; |
public class Configuration { /** * Checks for the presence of the property < code > name < / code > in the
* deprecation map . Returns the first of the list of new keys if present
* in the deprecation map or the < code > name < / code > itself . If the property
* is not presently set but the property map contains an entry for the
* deprecated key , the value of the deprecated key is set as the value for
* the provided property name .
* @ param name the property name
* @ return the first property in the list of properties mapping
* the < code > name < / code > or the < code > name < / code > itself . */
private String [ ] handleDeprecation ( DeprecationContext deprecations , String name ) { } } | if ( null != name ) { name = name . trim ( ) ; } ArrayList < String > names = new ArrayList < String > ( ) ; if ( isDeprecated ( name ) ) { DeprecatedKeyInfo keyInfo = deprecations . getDeprecatedKeyMap ( ) . get ( name ) ; warnOnceIfDeprecated ( deprecations , name ) ; for ( String newKey : keyInfo . newKeys ) { if ( newKey != null ) { names . add ( newKey ) ; } } } if ( names . size ( ) == 0 ) { names . add ( name ) ; } for ( String n : names ) { String deprecatedKey = deprecations . getReverseDeprecatedKeyMap ( ) . get ( n ) ; if ( deprecatedKey != null && ! getOverlay ( ) . containsKey ( n ) && getOverlay ( ) . containsKey ( deprecatedKey ) ) { getProps ( ) . setProperty ( n , getOverlay ( ) . getProperty ( deprecatedKey ) ) ; getOverlay ( ) . setProperty ( n , getOverlay ( ) . getProperty ( deprecatedKey ) ) ; } } return names . toArray ( new String [ names . size ( ) ] ) ; |
public class PinViewBaseHelper { /** * Keyboard back button */
@ Override public boolean dispatchKeyEventPreIme ( KeyEvent event ) { } } | if ( mKeyboardMandatory ) { if ( getContext ( ) != null ) { InputMethodManager imm = ( InputMethodManager ) getContext ( ) . getSystemService ( Context . INPUT_METHOD_SERVICE ) ; if ( imm . isActive ( ) && event . getKeyCode ( ) == KeyEvent . KEYCODE_BACK ) { setImeVisibility ( true ) ; return true ; } } } return super . dispatchKeyEventPreIme ( event ) ; |
public class DefaultComparisonFormatter { /** * Provides a display text for the constant values of the { @ link Node } class that represent node types .
* @ param type the node type
* @ return the display text
* @ since XMLUnit 2.4.0 */
protected String nodeType ( short type ) { } } | switch ( type ) { case Node . ELEMENT_NODE : return "Element" ; case Node . DOCUMENT_TYPE_NODE : return "Document Type" ; case Node . ENTITY_NODE : return "Entity" ; case Node . ENTITY_REFERENCE_NODE : return "Entity Reference" ; case Node . NOTATION_NODE : return "Notation" ; case Node . TEXT_NODE : return "Text" ; case Node . COMMENT_NODE : return "Comment" ; case Node . CDATA_SECTION_NODE : return "CDATA Section" ; case Node . ATTRIBUTE_NODE : return "Attribute" ; case Node . PROCESSING_INSTRUCTION_NODE : return "Processing Instruction" ; default : break ; } return Short . toString ( type ) ; |
public class CommerceOrderPersistenceImpl { /** * Returns all the commerce orders .
* @ return the commerce orders */
@ Override public List < CommerceOrder > findAll ( ) { } } | return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class RowBasedGrouperHelper { /** * If isInputRaw is true , transformations such as timestamp truncation and extraction functions have not
* been applied to the input rows yet , for example , in a nested query , if an extraction function is being
* applied in the outer query to a field of the inner query . This method must apply those transformations . */
public static Pair < Grouper < RowBasedKey > , Accumulator < AggregateResult , Row > > createGrouperAccumulatorPair ( final GroupByQuery query , final boolean isInputRaw , final Map < String , ValueType > rawInputRowSignature , final GroupByQueryConfig config , final Supplier < ByteBuffer > bufferSupplier , @ Nullable final ReferenceCountingResourceHolder < ByteBuffer > combineBufferHolder , final int concurrencyHint , final LimitedTemporaryStorage temporaryStorage , final ObjectMapper spillMapper , final AggregatorFactory [ ] aggregatorFactories , @ Nullable final ListeningExecutorService grouperSorter , final int priority , final boolean hasQueryTimeout , final long queryTimeoutAt , final int mergeBufferSize ) { } } | // concurrencyHint > = 1 for concurrent groupers , - 1 for single - threaded
Preconditions . checkArgument ( concurrencyHint >= 1 || concurrencyHint == - 1 , "invalid concurrencyHint" ) ; final List < ValueType > valueTypes = DimensionHandlerUtils . getValueTypesFromDimensionSpecs ( query . getDimensions ( ) ) ; final GroupByQueryConfig querySpecificConfig = config . withOverrides ( query ) ; final boolean includeTimestamp = GroupByStrategyV2 . getUniversalTimestamp ( query ) == null ; final ThreadLocal < Row > columnSelectorRow = new ThreadLocal < > ( ) ; final ColumnSelectorFactory columnSelectorFactory = query . getVirtualColumns ( ) . wrap ( RowBasedColumnSelectorFactory . create ( columnSelectorRow , rawInputRowSignature ) ) ; final boolean willApplyLimitPushDown = query . isApplyLimitPushDown ( ) ; final DefaultLimitSpec limitSpec = willApplyLimitPushDown ? ( DefaultLimitSpec ) query . getLimitSpec ( ) : null ; boolean sortHasNonGroupingFields = false ; if ( willApplyLimitPushDown ) { sortHasNonGroupingFields = DefaultLimitSpec . sortingOrderHasNonGroupingFields ( limitSpec , query . getDimensions ( ) ) ; } final Grouper . KeySerdeFactory < RowBasedKey > keySerdeFactory = new RowBasedKeySerdeFactory ( includeTimestamp , query . getContextSortByDimsFirst ( ) , query . getDimensions ( ) , querySpecificConfig . getMaxMergingDictionarySize ( ) / ( concurrencyHint == - 1 ? 1 : concurrencyHint ) , valueTypes , aggregatorFactories , limitSpec ) ; final Grouper < RowBasedKey > grouper ; if ( concurrencyHint == - 1 ) { grouper = new SpillingGrouper < > ( bufferSupplier , keySerdeFactory , columnSelectorFactory , aggregatorFactories , querySpecificConfig . getBufferGrouperMaxSize ( ) , querySpecificConfig . getBufferGrouperMaxLoadFactor ( ) , querySpecificConfig . getBufferGrouperInitialBuckets ( ) , temporaryStorage , spillMapper , true , limitSpec , sortHasNonGroupingFields , mergeBufferSize ) ; } else { final Grouper . KeySerdeFactory < RowBasedKey > combineKeySerdeFactory = new RowBasedKeySerdeFactory ( includeTimestamp , query . getContextSortByDimsFirst ( ) , query . getDimensions ( ) , querySpecificConfig . getMaxMergingDictionarySize ( ) , // use entire dictionary space for combining key serde
valueTypes , aggregatorFactories , limitSpec ) ; grouper = new ConcurrentGrouper < > ( querySpecificConfig , bufferSupplier , combineBufferHolder , keySerdeFactory , combineKeySerdeFactory , columnSelectorFactory , aggregatorFactories , temporaryStorage , spillMapper , concurrencyHint , limitSpec , sortHasNonGroupingFields , grouperSorter , priority , hasQueryTimeout , queryTimeoutAt ) ; } final int keySize = includeTimestamp ? query . getDimensions ( ) . size ( ) + 1 : query . getDimensions ( ) . size ( ) ; final ValueExtractFunction valueExtractFn = makeValueExtractFunction ( query , isInputRaw , includeTimestamp , columnSelectorFactory , valueTypes ) ; final Accumulator < AggregateResult , Row > accumulator = new Accumulator < AggregateResult , Row > ( ) { @ Override public AggregateResult accumulate ( final AggregateResult priorResult , final Row row ) { BaseQuery . checkInterrupted ( ) ; if ( priorResult != null && ! priorResult . isOk ( ) ) { // Pass - through error returns without doing more work .
return priorResult ; } if ( ! grouper . isInitialized ( ) ) { grouper . init ( ) ; } columnSelectorRow . set ( row ) ; final Comparable [ ] key = new Comparable [ keySize ] ; valueExtractFn . apply ( row , key ) ; final AggregateResult aggregateResult = grouper . aggregate ( new RowBasedKey ( key ) ) ; columnSelectorRow . set ( null ) ; return aggregateResult ; } } ; return new Pair < > ( grouper , accumulator ) ; |
public class WrappedByteBuffer { /** * Returns the index of the specified byte in the buffer .
* @ param b
* the byte to find
* @ return the index of the byte in the buffer , or - 1 if not found */
public int indexOf ( byte b ) { } } | if ( _buf . hasArray ( ) ) { byte [ ] array = _buf . array ( ) ; int arrayOffset = _buf . arrayOffset ( ) ; int startAt = arrayOffset + position ( ) ; int endAt = arrayOffset + limit ( ) ; for ( int i = startAt ; i < endAt ; i ++ ) { if ( array [ i ] == b ) { return i - arrayOffset ; } } return - 1 ; } else { int startAt = _buf . position ( ) ; int endAt = _buf . limit ( ) ; for ( int i = startAt ; i < endAt ; i ++ ) { if ( _buf . get ( i ) == b ) { return i ; } } return - 1 ; } |
public class GridTable { /** * Use this record update notification to update this gridtable .
* @ param message A RecordMessage detailing an update to this gridtable .
* @ param bAddIfNotFound Add the record to the end if not found
* @ return The row that was updated , or - 1 if none . */
public int updateGridToMessage ( BaseMessage message , boolean bReReadMessage , boolean bAddIfNotFound ) { } } | Record record = this . getRecord ( ) ; // Record changed
int iHandleType = DBConstants . BOOKMARK_HANDLE ; // OBJECT _ ID _ HANDLE ;
if ( this . getNextTable ( ) instanceof org . jbundle . base . db . shared . MultiTable ) iHandleType = DBConstants . FULL_OBJECT_HANDLE ; Object bookmark = ( ( RecordMessageHeader ) message . getMessageHeader ( ) ) . getBookmark ( iHandleType ) ; int iRecordMessageType = ( ( RecordMessageHeader ) message . getMessageHeader ( ) ) . getRecordMessageType ( ) ; // See if this record is currently displayed or buffered , if so , refresh and display .
GridTable table = ( GridTable ) record . getTable ( ) ; int iIndex = - 1 ; if ( iRecordMessageType == - 1 ) { iIndex = table . bookmarkToIndex ( bookmark , iHandleType ) ; // Find this bookmark in the table
} else if ( iRecordMessageType == DBConstants . CACHE_UPDATE_TYPE ) { // No need to update anything as this is just a notification that the cache has been updaed already .
iIndex = table . bookmarkToIndex ( bookmark , iHandleType ) ; // Find this bookmark in the table
} else if ( iRecordMessageType == DBConstants . SELECT_TYPE ) { // A secondary record was selected , update the secondary field to the new value .
// Don ' t need to update the table for a select
} else if ( iRecordMessageType == DBConstants . AFTER_ADD_TYPE ) { iIndex = table . refreshBookmark ( bookmark , iHandleType , false ) ; // Double - check to see if it has already been added
if ( iIndex == - 1 ) { if ( bAddIfNotFound ) { // Note : It might be nice to check this filter in the message on the server , then I don ' t change to read and check it .
try { record = record . setHandle ( bookmark , iHandleType ) ; // Fake the handleCriteria to think this is a slave . NOTE : This is not cool in a multitasked environment .
int iDBMasterSlave = record . getTable ( ) . getCurrentTable ( ) . getDatabase ( ) . getMasterSlave ( ) ; record . getTable ( ) . getCurrentTable ( ) . getDatabase ( ) . setMasterSlave ( RecordOwner . MASTER | RecordOwner . SLAVE ) ; boolean bMatch = record . handleRemoteCriteria ( null , false , null ) ; record . getTable ( ) . getCurrentTable ( ) . getDatabase ( ) . setMasterSlave ( iDBMasterSlave ) ; if ( bMatch ) { iHandleType = DBConstants . DATA_SOURCE_HANDLE ; bookmark = this . getDataRecord ( m_bCacheRecordData , BaseBuffer . SELECTED_FIELDS ) ; } else bookmark = null ; } catch ( DBException e ) { e . printStackTrace ( ) ; } if ( bookmark != null ) iIndex = table . addNewBookmark ( bookmark , iHandleType ) ; // Add this new record to the table
} } } else { iIndex = table . refreshBookmark ( bookmark , iHandleType , bReReadMessage ) ; // Refresh the data for this bookmark
} return iIndex ; |
public class JTrees { /** * Returns the user object from the last path component of the given tree
* path . If the given path is < code > null < / code > , then < code > null < / code >
* is returned . If the last path component is not a DefaultMutableTreeNode ,
* then < code > null < / code > is returned .
* @ param treePath The tree path
* @ return The user object */
public static Object getUserObjectFromTreePath ( TreePath treePath ) { } } | if ( treePath == null ) { return null ; } Object lastPathComponent = treePath . getLastPathComponent ( ) ; return getUserObjectFromTreeNode ( lastPathComponent ) ; |
public class CssUtils { /** * get int value of string
* @ param strValue string value
* @ return int value */
public static int getInt ( String strValue ) { } } | int value = 0 ; if ( StringUtils . isNotBlank ( strValue ) ) { Matcher m = Pattern . compile ( "^(\\d+)(?:\\w+|%)?$" ) . matcher ( strValue ) ; if ( m . find ( ) ) { value = Integer . parseInt ( m . group ( 1 ) ) ; } } return value ; |
public class HelpFormatter { /** * Render the specified text width a maximum width . This method differs
* from renderWrappedText by not removing leading spaces after a new line .
* @ param sb the StringBuilder to place the rendered text into
* @ param nextLineTabStop the position on the next line for the first tab
* @ param text the text to be rendered */
private void renderWrappedTextBlock ( StringBuilder sb , int nextLineTabStop , String text ) { } } | try { BufferedReader in = new BufferedReader ( new StringReader ( text ) ) ; String line ; boolean firstLine = true ; while ( ( line = in . readLine ( ) ) != null ) { if ( ! firstLine ) { sb . append ( NEW_LINE ) ; } else { firstLine = false ; } renderWrappedText ( sb , getWidth ( ) , nextLineTabStop , line ) ; } } catch ( IOException e ) { // ignore
} |
public class Entity { /** * Looks for the weak entity corresponding to the given field in this string
* entity
* @ param field
* @ return the weak entity */
public Entity getWeak ( Field field ) { } } | for ( Entity entity : getWeaks ( ) ) { if ( entity . getOwner ( ) . getEntityProperty ( ) . equals ( field . getProperty ( ) ) ) { return entity ; } } return null ; |
public class ServletRESTRequestWithParams { /** * ( non - Javadoc )
* @ see com . ibm . wsspi . rest . handler . RESTRequest # getUserPrincipal ( ) */
@ Override public Principal getUserPrincipal ( ) { } } | ServletRESTRequestImpl ret = castRequest ( ) ; if ( ret != null ) return ret . getUserPrincipal ( ) ; return null ; |
public class RequestDeserializer { /** * / * ( non - Javadoc )
* @ see com . fasterxml . jackson . databind . JsonDeserializer # deserialize ( com . fasterxml . jackson . core . JsonParser ,
* com . fasterxml . jackson . databind . DeserializationContext ) */
@ Override public Request deserialize ( JsonParser jp , DeserializationContext ctxt ) throws IOException , JsonProcessingException { } } | JsonNode node = jp . getCodec ( ) . readTree ( jp ) ; String methodName = node . get ( "methodName" ) . asText ( ) ; String requestReplyId = node . get ( "requestReplyId" ) . asText ( ) ; ParamsAndParamDatatypesHolder paramsAndParamDatatypes = DeserializerUtils . deserializeParams ( objectMapper , node , logger ) ; return new Request ( methodName , paramsAndParamDatatypes . params , paramsAndParamDatatypes . paramDatatypes , requestReplyId ) ; |
public class Predicate { /** * Return a predicate that is always satisfied .
* @ return the predicate ; never null */
public static < T > Predicate < T > always ( ) { } } | return new Predicate < T > ( ) { @ Override public boolean test ( T input ) { return true ; } } ; |
public class ZmqEventConsumer { @ Override protected boolean reSubscribe ( EventChannelStruct channelStruct , EventCallBackStruct eventCallBackStruct ) { } } | // ToDo
boolean done = false ; try { ApiUtil . printTrace ( "====================================================\n" + " Try to resubscribe " + eventCallBackStruct . channel_name ) ; DevVarLongStringArray lsa = ZMQutils . getEventSubscriptionInfoFromAdmDevice ( channelStruct . adm_device_proxy , eventCallBackStruct . device . name ( ) , eventCallBackStruct . attr_name , eventCallBackStruct . event_name ) ; // Update the heartbeat time
String admDeviceName = channelStruct . adm_device_proxy . name ( ) ; // . toLowerCase ( ) ;
// Since Tango 8.1 , heartbeat is sent in lower case .
if ( channelStruct . getTangoRelease ( ) >= 810 ) admDeviceName = admDeviceName . toLowerCase ( ) ; push_structured_event_heartbeat ( admDeviceName ) ; channelStruct . heartbeat_skipped = false ; channelStruct . last_subscribed = System . currentTimeMillis ( ) ; channelStruct . setTangoRelease ( lsa . lvalue [ 0 ] ) ; channelStruct . setIdlVersion ( lsa . lvalue [ 1 ] ) ; eventCallBackStruct . last_subscribed = channelStruct . last_subscribed ; done = true ; } catch ( DevFailed e ) { } return done ; |
public class GrailsHibernateUtil { /** * Get hold of the GrailsDomainClassProperty represented by the targetClass ' propertyName ,
* assuming targetClass corresponds to a GrailsDomainClass . */
private static PersistentProperty getGrailsDomainClassProperty ( AbstractHibernateDatastore datastore , Class < ? > targetClass , String propertyName ) { } } | PersistentEntity grailsClass = datastore != null ? datastore . getMappingContext ( ) . getPersistentEntity ( targetClass . getName ( ) ) : null ; if ( grailsClass == null ) { throw new IllegalArgumentException ( "Unexpected: class is not a domain class:" + targetClass . getName ( ) ) ; } return grailsClass . getPropertyByName ( propertyName ) ; |
public class ContentCryptoMaterial { /** * Returns a new instance of < code > ContentCryptoMaterial < / code > for the
* given input parameters by using the specified content crypto scheme , and
* S3 crypto scheme .
* Note network calls are involved if the CEK is to be protected by KMS .
* @ param cek
* content encrypting key
* @ param iv
* initialization vector
* @ param kekMaterials
* kek encryption material used to secure the CEK ; can be KMS
* enabled .
* @ param contentCryptoScheme
* content crypto scheme to be used , which can differ from the
* one of < code > targetS3CryptoScheme < / code >
* @ param targetS3CryptoScheme
* the target s3 crypto scheme to be used for providing the key
* wrapping scheme and mechanism for secure randomness
* @ param provider
* security provider
* @ param kms
* reference to the KMS client
* @ param req
* the originating AWS service request */
private static ContentCryptoMaterial doCreate ( SecretKey cek , byte [ ] iv , EncryptionMaterials kekMaterials , ContentCryptoScheme contentCryptoScheme , S3CryptoScheme targetS3CryptoScheme , Provider provider , AWSKMS kms , AmazonWebServiceRequest req ) { } } | // Secure the envelope symmetric key either by encryption , key wrapping
// or KMS .
SecuredCEK cekSecured = secureCEK ( cek , kekMaterials , targetS3CryptoScheme . getKeyWrapScheme ( ) , targetS3CryptoScheme . getSecureRandom ( ) , provider , kms , req ) ; return wrap ( cek , iv , contentCryptoScheme , provider , cekSecured ) ; |
public class GlobalFactory { /** * エンティティ記述のファクトリを作成します 。
* @ param packageName パッケージ名
* @ param superclass スーパークラス
* @ param entityPropertyDescFactory エンティティプロパティ記述のファクトリ
* @ param namingType ネーミング規約
* @ param originalStatesPropertyName オリジナルの状態を表すプロパティの名前
* @ param showCatalogName カタログ名を表示する場合 { @ code true }
* @ param showSchemaName スキーマ名を表示する場合 { @ code true }
* @ param showTableName テーブル名を表示する場合 { @ code true }
* @ param showDbComment データベースのコメントを表示する場合 { @ code true }
* @ param useAccessor アクセッサーを使用する場合 { @ code true }
* @ param useListener エンティティリスナーを使用する場合 { @ code true }
* @ return エンティティ記述のファクトリ */
public EntityDescFactory createEntityDescFactory ( String packageName , Class < ? > superclass , EntityPropertyDescFactory entityPropertyDescFactory , NamingType namingType , String originalStatesPropertyName , boolean showCatalogName , boolean showSchemaName , boolean showTableName , boolean showDbComment , boolean useAccessor , boolean useListener ) { } } | return new EntityDescFactory ( packageName , superclass , entityPropertyDescFactory , namingType , originalStatesPropertyName , showCatalogName , showSchemaName , showTableName , showDbComment , useAccessor , useListener ) ; |
public class CalibrateMonoPlanar { /** * Adds the observations from a calibration target detector
* @ param observation Detected calibration points */
public void addImage ( CalibrationObservation observation ) { } } | if ( imageWidth == 0 ) { this . imageWidth = observation . getWidth ( ) ; this . imageHeight = observation . getHeight ( ) ; } else if ( observation . getWidth ( ) != this . imageWidth || observation . getHeight ( ) != this . imageHeight ) { throw new IllegalArgumentException ( "Image shape miss match" ) ; } observations . add ( observation ) ; |
public class ClassInfo { /** * Returns information on all visible fields declared by this class , but not by its superclasses . See also :
* < ul >
* < li > { @ link # getFieldInfo ( String ) }
* < li > { @ link # getDeclaredFieldInfo ( String ) }
* < li > { @ link # getFieldInfo ( ) }
* < / ul >
* Requires that { @ link ClassGraph # enableFieldInfo ( ) } be called before scanning , otherwise throws
* { @ link IllegalArgumentException } .
* By default only returns information for public methods , unless { @ link ClassGraph # ignoreFieldVisibility ( ) } was
* called before the scan .
* @ return the list of FieldInfo objects for visible fields declared by this class , or the empty list if no
* fields were found or visible .
* @ throws IllegalArgumentException
* if { @ link ClassGraph # enableFieldInfo ( ) } was not called prior to initiating the scan . */
public FieldInfoList getDeclaredFieldInfo ( ) { } } | if ( ! scanResult . scanSpec . enableFieldInfo ) { throw new IllegalArgumentException ( "Please call ClassGraph#enableFieldInfo() before #scan()" ) ; } return fieldInfo == null ? FieldInfoList . EMPTY_LIST : fieldInfo ; |
public class KiekerTraceEntry { /** * Returns a description for the Super CSV parser , how to map a column of the csv to this type .
* @ return array with field names representing the order in the csv */
public static String [ ] getFieldDescription ( ) { } } | if ( FIELDS == null ) { ArrayList < String > fields = new ArrayList < String > ( ) ; for ( Field field : KiekerTraceEntry . class . getDeclaredFields ( ) ) { if ( ! Modifier . isStatic ( field . getModifiers ( ) ) ) { fields . add ( field . getName ( ) ) ; } } FIELDS = fields . toArray ( new String [ fields . size ( ) ] ) ; } return FIELDS ; |
public class RowRenderer { /** * This methods generates the HTML code of the current b : row .
* < code > encodeBegin < / code > generates the start of the component . After the ,
* the JSF framework calls < code > encodeChildren ( ) < / code > to generate the
* HTML code between the beginning and the end of the component . For
* instance , in the case of a panel component the content of the panel is
* generated by < code > encodeChildren ( ) < / code > . After that ,
* < code > encodeEnd ( ) < / code > is called to generate the rest of the HTML code .
* @ param context
* the FacesContext .
* @ param component
* the current b : row .
* @ throws IOException
* thrown if something goes wrong when writing the HTML code . */
@ Override public void encodeBegin ( FacesContext context , UIComponent component ) throws IOException { } } | if ( ! component . isRendered ( ) ) { return ; } Row row = ( Row ) component ; ResponseWriter rw = context . getResponseWriter ( ) ; String clientId = row . getClientId ( ) ; rw . startElement ( "div" , row ) ; Tooltip . generateTooltip ( context , row , rw ) ; String dir = row . getDir ( ) ; if ( null != dir ) rw . writeAttribute ( "dir" , dir , "dir" ) ; String s = "row" ; String sclass = row . getStyleClass ( ) ; if ( sclass != null ) { s += " " + sclass ; } rw . writeAttribute ( "id" , clientId , "id" ) ; String style = row . getStyle ( ) ; if ( style != null ) { rw . writeAttribute ( "style" , style , "style" ) ; } rw . writeAttribute ( "class" , s , "class" ) ; Tooltip . activateTooltips ( context , row ) ; beginDisabledFieldset ( row , rw ) ; |
public class BridgeMethodResolver { /** * Compare the signatures of the bridge method and the method which it bridges . If
* the parameter and return types are the same , it is a ' visibility ' bridge method
* introduced in Java 6 to fix http : / / bugs . sun . com / view _ bug . do ? bug _ id = 6342411.
* See also http : / / stas - blogspot . blogspot . com / 2010/03 / java - bridge - methods - explained . html
* @ return whether signatures match as described */
public static boolean isVisibilityBridgeMethodPair ( Method bridgeMethod , Method bridgedMethod ) { } } | if ( bridgeMethod == bridgedMethod ) { return true ; } return ( Arrays . equals ( bridgeMethod . getParameterTypes ( ) , bridgedMethod . getParameterTypes ( ) ) && bridgeMethod . getReturnType ( ) . equals ( bridgedMethod . getReturnType ( ) ) ) ; |
public class PutParameterRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( PutParameterRequest putParameterRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( putParameterRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putParameterRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( putParameterRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( putParameterRequest . getValue ( ) , VALUE_BINDING ) ; protocolMarshaller . marshall ( putParameterRequest . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( putParameterRequest . getKeyId ( ) , KEYID_BINDING ) ; protocolMarshaller . marshall ( putParameterRequest . getOverwrite ( ) , OVERWRITE_BINDING ) ; protocolMarshaller . marshall ( putParameterRequest . getAllowedPattern ( ) , ALLOWEDPATTERN_BINDING ) ; protocolMarshaller . marshall ( putParameterRequest . getTags ( ) , TAGS_BINDING ) ; protocolMarshaller . marshall ( putParameterRequest . getTier ( ) , TIER_BINDING ) ; protocolMarshaller . marshall ( putParameterRequest . getPolicies ( ) , POLICIES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class NOPImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setUndfData ( byte [ ] newUndfData ) { } } | byte [ ] oldUndfData = undfData ; undfData = newUndfData ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . NOP__UNDF_DATA , oldUndfData , undfData ) ) ; |
public class Query { /** * Wraps the protobuf { @ link ReadRowsRequest } .
* < p > WARNING : Please note that the project id & instance id in the table name will be overwritten
* by the configuration in the BigtableDataClient . */
public static Query fromProto ( @ Nonnull ReadRowsRequest request ) { } } | Preconditions . checkArgument ( request != null , "ReadRowsRequest must not be null" ) ; Query query = new Query ( NameUtil . extractTableIdFromTableName ( request . getTableName ( ) ) ) ; query . builder = request . toBuilder ( ) ; return query ; |
public class DES { /** * DES算法 , 加密
* @ param data 待加密字符串
* @ param key 加密私钥 , 长度不能够小于8位
* @ return 加密后的字节数组 , 一般结合Base64编码使用
* @ throws InvalidAlgorithmParameterException
* @ throws Exception */
public static String encrypt ( String key , String data ) { } } | if ( data == null ) return null ; try { DESKeySpec dks = new DESKeySpec ( key . getBytes ( ) ) ; SecretKeyFactory keyFactory = SecretKeyFactory . getInstance ( "DES" ) ; // key的长度不能够小于8位字节
Key secretKey = keyFactory . generateSecret ( dks ) ; Cipher cipher = Cipher . getInstance ( ALGORITHM_DES ) ; AlgorithmParameterSpec paramSpec = new IvParameterSpec ( IV_PARAMS_BYTES ) ; ; cipher . init ( Cipher . ENCRYPT_MODE , secretKey , paramSpec ) ; byte [ ] bytes = cipher . doFinal ( data . getBytes ( ) ) ; return byte2hex ( bytes ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return data ; } |
public class MolaDbClient { /** * Get instance detail from Moladb
* @ param request Container for the necessary parameters to
* execute the Get instance service method on Moladb .
* @ return The responseContent from the Get instance service method , as returned by
* Moladb .
* @ throws BceClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the responseContent . For example
* if a network connection is not available .
* @ throws BceServiceException
* If an error responseContent is returned by Moladb indicating
* either a problem with the data in the request , or a server side issue . */
public GetInstanceResponse getInstance ( GetInstanceRequest request ) { } } | checkNotNull ( request , "request should not be null." ) ; InternalRequest httpRequest = createRequest ( HttpMethodName . GET , MolaDbConstants . URI_INSTANCE , request . getInstanceName ( ) ) ; GetInstanceResponse ret = this . invokeHttpClient ( httpRequest , GetInstanceResponse . class ) ; return ret ; |
public class PoiUtil { /** * 修正图表中对于表单名字的引用 。
* @ param sheet EXCEL表单 。
* @ param oldSheetName 旧的表单名字 。
* @ param newSheetName 新的表单名字 。 */
public static void fixChartSheetNameRef ( Sheet sheet , String oldSheetName , String newSheetName ) { } } | val drawing = sheet . getDrawingPatriarch ( ) ; if ( ! ( drawing instanceof XSSFDrawing ) ) return ; for ( val chart : ( ( XSSFDrawing ) drawing ) . getCharts ( ) ) { for ( val barChart : chart . getCTChart ( ) . getPlotArea ( ) . getBarChartList ( ) ) { for ( val ser : barChart . getSerList ( ) ) { val val = ser . getVal ( ) ; if ( val == null ) continue ; val numRef = val . getNumRef ( ) ; if ( numRef == null ) continue ; val f = numRef . getF ( ) ; if ( f == null ) continue ; if ( f . contains ( oldSheetName ) ) { numRef . setF ( f . replace ( oldSheetName , newSheetName ) ) ; } } } } |
public class BaseWorkflowExecutor { /** * Creates a copy of the given data context with the secure option values obfuscated .
* This does not modify the original data context .
* " secureOption " map values will always be obfuscated . " option " entries that are also in " secureOption "
* will have their values obfuscated . All other maps within the data context will be added
* directly to the copy .
* @ param optionKey key
* @ param secureOptionKey secure key
* @ param secureOptionValue secure value
* @ param dataContext data
* @ return printable data */
protected Map < String , Map < String , String > > createPrintableDataContext ( String optionKey , String secureOptionKey , String secureOptionValue , Map < String , Map < String , String > > dataContext ) { } } | Map < String , Map < String , String > > printableContext = new HashMap < > ( ) ; if ( dataContext != null ) { printableContext . putAll ( dataContext ) ; Set < String > secureValues = new HashSet < > ( ) ; if ( dataContext . containsKey ( secureOptionKey ) ) { Map < String , String > secureOptions = new HashMap < > ( ) ; secureOptions . putAll ( dataContext . get ( secureOptionKey ) ) ; secureValues . addAll ( secureOptions . values ( ) ) ; for ( Map . Entry < String , String > entry : secureOptions . entrySet ( ) ) { entry . setValue ( secureOptionValue ) ; } printableContext . put ( secureOptionKey , secureOptions ) ; } if ( dataContext . containsKey ( optionKey ) ) { Map < String , String > options = new HashMap < > ( ) ; options . putAll ( dataContext . get ( optionKey ) ) ; for ( Map . Entry < String , String > entry : options . entrySet ( ) ) { if ( secureValues . contains ( entry . getValue ( ) ) ) { entry . setValue ( secureOptionValue ) ; } } printableContext . put ( optionKey , options ) ; } } return printableContext ; |
public class XFactory { /** * Get an XField object exactly matching given class , name , and signature .
* May return an unresolved object ( if the class can ' t be found , or does not
* directly declare named field ) .
* @ param className
* name of class containing the field
* @ param name
* name of field
* @ param signature
* field signature
* @ param isStatic
* field access flags
* @ return XField exactly matching class name , field name , and field
* signature */
public static XField getExactXField ( @ SlashedClassName String className , String name , String signature , boolean isStatic ) { } } | FieldDescriptor fieldDesc = DescriptorFactory . instance ( ) . getFieldDescriptor ( ClassName . toSlashedClassName ( className ) , name , signature , isStatic ) ; return getExactXField ( fieldDesc ) ; |
public class UCharacterIterator { /** * Moves the current position by the number of code units specified , either forward or backward depending on the
* sign of delta ( positive or negative respectively ) . If the resulting index would be less than zero , the index is
* set to zero , and if the resulting index would be greater than limit , the index is set to limit .
* @ param delta
* the number of code units to move the current index .
* @ return the new index .
* @ exception IndexOutOfBoundsException
* is thrown if an invalid index is supplied */
public int moveIndex ( int delta ) { } } | int x = Math . max ( 0 , Math . min ( getIndex ( ) + delta , getLength ( ) ) ) ; setIndex ( x ) ; return x ; |
public class FunctionLibraryParser { /** * Parses all variable definitions and adds those to the bean definition
* builder as property value .
* @ param builder the target bean definition builder .
* @ param element the source element . */
private void parseFunctionDefinitions ( BeanDefinitionBuilder builder , Element element ) { } } | ManagedMap < String , Object > functions = new ManagedMap < String , Object > ( ) ; for ( Element function : DomUtils . getChildElementsByTagName ( element , "function" ) ) { if ( function . hasAttribute ( "ref" ) ) { functions . put ( function . getAttribute ( "name" ) , new RuntimeBeanReference ( function . getAttribute ( "ref" ) ) ) ; } else { functions . put ( function . getAttribute ( "name" ) , BeanDefinitionBuilder . rootBeanDefinition ( function . getAttribute ( "class" ) ) . getBeanDefinition ( ) ) ; } } if ( ! functions . isEmpty ( ) ) { builder . addPropertyValue ( "members" , functions ) ; } |
public class DescribeDirectoryConfigsRequest { /** * The directory names .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setDirectoryNames ( java . util . Collection ) } or { @ link # withDirectoryNames ( java . util . Collection ) } if you want
* to override the existing values .
* @ param directoryNames
* The directory names .
* @ return Returns a reference to this object so that method calls can be chained together . */
public DescribeDirectoryConfigsRequest withDirectoryNames ( String ... directoryNames ) { } } | if ( this . directoryNames == null ) { setDirectoryNames ( new java . util . ArrayList < String > ( directoryNames . length ) ) ; } for ( String ele : directoryNames ) { this . directoryNames . add ( ele ) ; } return this ; |
public class DocumentSession { /** * Refreshes the specified entity from Raven server . */
public < T > void refresh ( T entity ) { } } | DocumentInfo documentInfo = documentsByEntity . get ( entity ) ; if ( documentInfo == null ) { throw new IllegalStateException ( "Cannot refresh a transient instance" ) ; } incrementRequestCount ( ) ; GetDocumentsCommand command = new GetDocumentsCommand ( new String [ ] { documentInfo . getId ( ) } , null , false ) ; _requestExecutor . execute ( command , sessionInfo ) ; refreshInternal ( entity , command , documentInfo ) ; |
public class FpgaImageAttribute { /** * The product codes .
* @ param productCodes
* The product codes . */
public void setProductCodes ( java . util . Collection < ProductCode > productCodes ) { } } | if ( productCodes == null ) { this . productCodes = null ; return ; } this . productCodes = new com . amazonaws . internal . SdkInternalList < ProductCode > ( productCodes ) ; |
public class CmsPermissionView { /** * Generates a check box label . < p >
* @ param value the value to display
* @ return the label */
private Label getCheckBoxLabel ( Boolean value ) { } } | String content ; if ( value . booleanValue ( ) ) { content = "<input type='checkbox' disabled='true' checked='true' />" ; } else { content = "<input type='checkbox' disabled='true' />" ; } return new Label ( content , ContentMode . HTML ) ; |
public class PhysicalDatabaseParent { /** * Set the value of this property ( passed in on initialization ) .
* @ param key The parameter key value .
* @ param objValue The key ' s value . */
public void setProperty ( String strKey , Object objValue ) { } } | if ( m_mapParams == null ) m_mapParams = new HashMap < String , Object > ( ) ; m_mapParams . put ( strKey , objValue ) ; |
public class Effects { /** * The animate ( ) method allows you to create animation effects on any numeric
* Attribute , CSS property , or color CSS property .
* Concerning to numeric properties , values are treated as a number of pixels
* unless otherwise specified . The units em and % can be specified where
* applicable .
* By default animate considers css properties , if you wanted to animate element
* attributes you should to prepend the symbol dollar to the attribute name .
* Example :
* < pre class = " code " >
* / / move the element from its original position to the position top : 500px and left : 500px for 400ms .
* / / use a swing easing function for the transition
* $ ( " # foo " ) . animate ( Properties . create ( " { top : ' 500px ' , left : ' 500px ' } " ) , 400 , EasingCurve . swing ) ;
* / / Change the width and border attributes of a table
* $ ( " table " ) . animate ( Properties . create ( " { $ width : ' 500 ' , $ border : ' 10 ' } " ) , 400 , EasingCurve . linear ) ;
* < / pre >
* In addition to numeric values , each property can take the strings ' show ' ,
* ' hide ' , and ' toggle ' . These shortcuts allow for custom hiding and showing
* animations that take into account the display type of the element . Animated
* properties can also be relative . If a value is supplied with a leading + =
* or - = sequence of characters , then the target value is computed by adding
* or subtracting the given number from the current value of the property .
* Example :
* < pre class = " code " >
* / / move the element from its original position to 500px to the left and 5OOpx down for 400ms .
* / / use a swing easing function for the transition
* $ ( " # foo " ) . animate ( Properties . create ( " { top : ' + = 500px ' , left : ' + = 500px ' } " ) , 400 , Easing . SWING ) ;
* < / pre >
* For color css properties , values can be specified via hexadecimal or rgb or
* literal values .
* Example :
* < pre class = " code " >
* $ ( " # foo " ) . animate ( " backgroundColor : ' red ' , color : ' # fffff ' , borderColor : ' rgb ( 129 , 0 , 70 ) ' " , 400 , EasingCurve . swing ) ;
* $ ( " # foo " ) . animate ( $ $ ( " { backgroundColor : ' red ' , color : ' # fffff ' , borderColor : ' rgb ( 129 , 0 , 70 ) ' } " ) , 400 , EasingCurve . swing ) ;
* < / pre >
* @ param stringOrProperties object containing css properties to animate .
* @ param funcs an array of { @ link Function } called once the animation is
* complete
* @ param duration the duration in milliseconds of the animation
* @ param easing the easing function to use for the transition */
public Effects animate ( Object stringOrProperties , int duration , Easing easing , Function ... funcs ) { } } | final Properties p = ( stringOrProperties instanceof String ) ? ( Properties ) $$ ( ( String ) stringOrProperties ) : ( Properties ) stringOrProperties ; if ( p . getStr ( "duration" ) != null ) { duration = p . getInt ( "duration" ) ; } duration = Math . abs ( duration ) ; for ( Element e : elements ( ) ) { GQAnimation a = createAnimation ( ) ; a . setEasing ( easing ) . setProperties ( p ) . setElement ( e ) . setCallback ( funcs ) ; queueAnimation ( a , duration ) ; } return this ; |
public class IntegerValueComparator { /** * / * ( non - Javadoc )
* @ see java . util . Comparator # compare ( java . lang . Object , java . lang . Object ) */
@ Override public int compare ( Object a , Object b ) { } } | if ( base . get ( a ) >= base . get ( b ) ) { return - 1 ; } return 1 ; |
public class Evaluator { /** * Gets the data list .
* @ return the data list
* @ throws EFapsException */
public DataList getDataList ( ) throws EFapsException { } } | final DataList ret = new DataList ( ) ; while ( next ( ) ) { final ObjectData data = new ObjectData ( ) ; int idx = 1 ; for ( final Select select : this . selection . getSelects ( ) ) { final String key = select . getAlias ( ) == null ? String . valueOf ( idx ) : select . getAlias ( ) ; data . getValues ( ) . add ( JSONData . getValue ( key , get ( select ) ) ) ; idx ++ ; } ret . add ( data ) ; } return ret ; |
public class CheckArg { /** * Asserts that the specified first object is not the same as ( = = ) the specified second object .
* @ param < T >
* @ param argument The argument to assert as not the same as < code > object < / code > .
* @ param argumentName The name that will be used within the exception message for the argument should an exception be thrown
* @ param object The object to assert as not the same as < code > argument < / code > .
* @ param objectName The name that will be used within the exception message for < code > object < / code > should an exception be
* thrown ; if < code > null < / code > and < code > object < / code > is not < code > null < / code > , < code > object . toString ( ) < / code > will
* be used .
* @ throws IllegalArgumentException If the specified objects are the same . */
public static < T > void isNotSame ( final T argument , String argumentName , final T object , String objectName ) { } } | if ( argument == object ) { if ( objectName == null ) objectName = getObjectName ( object ) ; throw new IllegalArgumentException ( CommonI18n . argumentMustNotBeSameAs . text ( argumentName , objectName ) ) ; } |
public class VdmEvaluationContextManager { /** * Returns the evaluation context for the given window , or < code > null < / code > if none . The evaluation context
* corresponds to the selected stack frame in the following priority order :
* < ol >
* < li > stack frame in active page of the window < / li >
* < li > stack frame in another page of the window < / li >
* < li > stack frame in active page of another window < / li >
* < li > stack frame in a page of another window < / li >
* < / ol >
* @ param window
* the window that the evaluation action was invoked from , or < code > null < / code > if the current window
* should be consulted
* @ return the stack frame that supplies an evaluation context , or < code > null < / code > if none
* @ return IJavaStackFrame */
public static IVdmStackFrame getEvaluationContext ( IWorkbenchWindow window ) { } } | List < IWorkbenchWindow > alreadyVisited = new ArrayList < IWorkbenchWindow > ( ) ; if ( window == null ) { window = fgManager . fActiveWindow ; } return getEvaluationContext ( window , alreadyVisited ) ; |
public class WebServiceAccessorImp { /** * 1 . create a SessionContext object in httpsession 2 . save the principle
* name in the session context .
* the principle name the request . getPrincipleNme you can save more
* attribute in the SessionContext object by replcaing this class in
* container . xml
* SessionContextInterceptor will get the SessionContext into targetObject
* implements SessionAcceptable */
public Object getService ( RequestWrapper request ) { } } | ContainerWrapper cw = containerCallback . getContainerWrapper ( ) ; SessionContextSetup sessionContextSetup = ( SessionContextSetup ) cw . lookup ( ComponentKeys . SESSIONCONTEXT_SETUP ) ; TargetMetaRequest targetMetaRequest = targetMetaRequestsHolder . getTargetMetaRequest ( ) ; targetMetaRequest . setVisitableName ( ComponentKeys . SESSIONCONTEXT_FACTORY ) ; ComponentVisitor componentVisitor = targetMetaRequest . getComponentVisitor ( ) ; SessionContext sessionContext = ( SessionContext ) componentVisitor . createSessionContext ( ) ; targetMetaRequest . setSessionContext ( sessionContext ) ; sessionContextSetup . setup ( sessionContext , request ) ; return serviceAccessor . getService ( ) ; |
public class MtasSolrCollectionResult { /** * Sets the list .
* @ param now the now
* @ param list the list
* @ throws IOException Signals that an I / O exception has occurred . */
public void setList ( long now , List < SimpleOrderedMap < Object > > list ) throws IOException { } } | if ( action . equals ( ComponentCollection . ACTION_LIST ) ) { this . now = now ; this . list = list ; } else { throw new IOException ( "not allowed with action '" + action + "'" ) ; } |
public class VariableNumMap { /** * Returns a copy of this map with every variable in
* { @ code variableNums } removed .
* @ param variableNums
* @ return */
public final VariableNumMap removeAll ( int ... variableNums ) { } } | if ( variableNums . length == 0 ) { return this ; } int [ ] newNums = new int [ nums . length ] ; String [ ] newNames = new String [ nums . length ] ; Variable [ ] newVars = new Variable [ nums . length ] ; int numFilled = 0 ; for ( int i = 0 ; i < newNums . length ; i ++ ) { if ( ! Ints . contains ( variableNums , nums [ i ] ) ) { newNums [ numFilled ] = nums [ i ] ; newNames [ numFilled ] = names [ i ] ; newVars [ numFilled ] = vars [ i ] ; numFilled ++ ; } } return VariableNumMap . fromSortedArrays ( newNums , newNames , newVars , numFilled ) ; |
public class Balancer { /** * Retrieves an Ortc Server url from the Ortc Balancer
* @ param balancerUrl
* The Ortc Balancer url
* @ throws java . net . MalformedURLException */
public static void getServerFromBalancerAsync ( String balancerUrl , String applicationKey , final OnRestWebserviceResponse onCompleted ) throws MalformedURLException { } } | Matcher protocolMatcher = urlProtocolPattern . matcher ( balancerUrl ) ; String protocol = protocolMatcher . matches ( ) ? "" : protocolMatcher . group ( 1 ) ; String parsedUrl = String . format ( "%s%s" , protocol , balancerUrl ) ; if ( ! Strings . isNullOrEmpty ( applicationKey ) ) { // CAUSE : Prefer String . format to +
parsedUrl += String . format ( "?appkey=%s" , applicationKey ) ; } URL url = new URL ( parsedUrl ) ; RestWebservice . getAsync ( url , new OnRestWebserviceResponse ( ) { @ Override public void run ( Exception error , String response ) { if ( error != null ) { onCompleted . run ( error , null ) ; } else { String clusterServer = null ; Matcher matcher = balancerServerPattern . matcher ( response ) ; if ( matcher . matches ( ) ) { clusterServer = matcher . group ( 1 ) ; } if ( Strings . isNullOrEmpty ( clusterServer ) ) { onCompleted . run ( new InvalidBalancerServerException ( response ) , null ) ; } else { onCompleted . run ( null , clusterServer ) ; } } } } ) ; |
public class GelfMessageBuilder { /** * Add an additional field .
* @ param key the key
* @ param value the value
* @ return GelfMessageBuilder */
public GelfMessageBuilder withField ( String key , String value ) { } } | this . additionalFields . put ( key , value ) ; return this ; |
public class ClientSocketFactory { /** * Close the client */
public void close ( ) { } } | synchronized ( this ) { if ( _state == State . CLOSED ) return ; _state = State . CLOSED ; } synchronized ( this ) { _idleHead = _idleTail = 0 ; } for ( int i = 0 ; i < _idle . length ; i ++ ) { ClientSocket stream ; synchronized ( this ) { stream = _idle [ i ] ; _idle [ i ] = null ; } if ( stream != null ) stream . closeImpl ( ) ; } |
public class HmacSignatureBuilder { /** * 判断期望摘要是否与已构建的摘要相等 .
* @ param expectedSignature
* 传入的期望摘要
* @ param builderMode
* 采用的构建模式
* @ return < code > true < / code > - 期望摘要与已构建的摘要相等 ; < code > false < / code > -
* 期望摘要与已构建的摘要不相等
* @ author zhd
* @ since 1.0.0 */
public boolean isHashEquals ( byte [ ] expectedSignature , BuilderMode builderMode ) { } } | final byte [ ] signature = build ( builderMode ) ; return MessageDigest . isEqual ( signature , expectedSignature ) ; |
public class GrapesClient { /** * Post a module to the server
* @ param module
* @ param user
* @ param password
* @ throws GrapesCommunicationException
* @ throws javax . naming . AuthenticationException */
public void postModule ( final Module module , final String user , final String password ) throws GrapesCommunicationException , AuthenticationException { } } | final Client client = getClient ( user , password ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . moduleResourcePath ( ) ) ; final ClientResponse response = resource . type ( MediaType . APPLICATION_JSON ) . post ( ClientResponse . class , module ) ; client . destroy ( ) ; if ( ClientResponse . Status . CREATED . getStatusCode ( ) != response . getStatus ( ) ) { final String message = "Failed to POST module" ; if ( LOG . isErrorEnabled ( ) ) { LOG . error ( String . format ( HTTP_STATUS_TEMPLATE_MSG , message , response . getStatus ( ) ) ) ; } throw new GrapesCommunicationException ( message , response . getStatus ( ) ) ; } |
public class ReflectUtils { /** * Strip enhancer class .
* @ param c
* the c
* @ return the class */
public static Class < ? > stripEnhancerClass ( Class < ? > c ) { } } | String className = c . getName ( ) ; // strip CGLIB from name
int enhancedIndex = className . indexOf ( "$$EnhancerByCGLIB" ) ; if ( enhancedIndex != - 1 ) { className = className . substring ( 0 , enhancedIndex ) ; } if ( className . equals ( c . getName ( ) ) ) { return c ; } else { c = classForName ( className , c . getClassLoader ( ) ) ; } return c ; |
public class StatementDMQL { /** * Returns true if the specified exprColumn index is in the list of column indices specified by groupIndex
* @ return true / false */
static boolean isGroupByColumn ( QuerySpecification select , int index ) { } } | if ( ! select . isGrouped ) { return false ; } for ( int ii = 0 ; ii < select . groupIndex . getColumnCount ( ) ; ii ++ ) { if ( index == select . groupIndex . getColumns ( ) [ ii ] ) { return true ; } } return false ; |
public class RelationalOperationsMatrix { /** * with the interior of Line B . */
private void exteriorAreaInteriorLine_ ( int half_edge , int id_a ) { } } | if ( m_matrix [ MatrixPredicate . ExteriorInterior ] == 1 ) return ; int faceParentage = m_topo_graph . getHalfEdgeFaceParentage ( half_edge ) ; int twinFaceParentage = m_topo_graph . getHalfEdgeFaceParentage ( m_topo_graph . getHalfEdgeTwin ( half_edge ) ) ; if ( ( faceParentage & id_a ) == 0 && ( twinFaceParentage & id_a ) == 0 ) m_matrix [ MatrixPredicate . ExteriorInterior ] = 1 ; |
public class SimpleDateFormat { /** * Formats a single field , given its pattern character . Subclasses may
* override this method in order to modify or add formatting
* capabilities .
* @ param ch the pattern character
* @ param count the number of times ch is repeated in the pattern
* @ param beginOffset the offset of the output string at the start of
* this field ; used to set pos when appropriate
* @ param pos receives the position of a field , when appropriate
* @ param fmtData the symbols for this formatter */
protected String subFormat ( char ch , int count , int beginOffset , FieldPosition pos , DateFormatSymbols fmtData , Calendar cal ) throws IllegalArgumentException { } } | // Note : formatData is ignored
return subFormat ( ch , count , beginOffset , 0 , DisplayContext . CAPITALIZATION_NONE , pos , cal ) ; |
public class AmazonApiGatewayClient { /** * Adds a < a > MethodResponse < / a > to an existing < a > Method < / a > resource .
* @ param putMethodResponseRequest
* Request to add a < a > MethodResponse < / a > to an existing < a > Method < / a > resource .
* @ return Result of the PutMethodResponse operation returned by the service .
* @ throws UnauthorizedException
* The request is denied because the caller has insufficient permissions .
* @ throws NotFoundException
* The requested resource is not found . Make sure that the request URI is correct .
* @ throws ConflictException
* The request configuration has conflicts . For details , see the accompanying error message .
* @ throws LimitExceededException
* The request exceeded the rate limit . Retry after the specified time period .
* @ throws BadRequestException
* The submitted request is not valid , for example , the input is incomplete or incorrect . See the
* accompanying error message for details .
* @ throws TooManyRequestsException
* The request has reached its throttling limit . Retry after the specified time period .
* @ sample AmazonApiGateway . PutMethodResponse */
@ Override public PutMethodResponseResult putMethodResponse ( PutMethodResponseRequest request ) { } } | request = beforeClientExecution ( request ) ; return executePutMethodResponse ( request ) ; |
public class CronEntry { /** * - - - - - static methods - - - - - */
public static CronEntry parse ( String task , String expression ) { } } | String [ ] fields = expression . split ( "[ \\t]+" ) ; if ( fields . length == CronService . NUM_FIELDS ) { CronEntry cronEntry = new CronEntry ( task ) ; String secondsField = fields [ 0 ] ; String minutesField = fields [ 1 ] ; String hoursField = fields [ 2 ] ; String daysField = fields [ 3 ] ; String monthsField = fields [ 4 ] ; String weeksField = fields [ 5 ] ; try { CronField seconds = parseField ( secondsField , 0 , 59 ) ; cronEntry . setSeconds ( seconds ) ; } catch ( Throwable t ) { logger . warn ( "Invalid cron expression for task {}, field 'seconds': {}" , new Object [ ] { task , t . getMessage ( ) } ) ; } try { CronField minutes = parseField ( minutesField , 0 , 59 ) ; cronEntry . setMinutes ( minutes ) ; } catch ( Throwable t ) { logger . warn ( "Invalid cron expression for task {}, field 'minutes': {}" , new Object [ ] { task , t . getMessage ( ) } ) ; } try { CronField hours = parseField ( hoursField , 0 , 23 ) ; cronEntry . setHours ( hours ) ; } catch ( Throwable t ) { logger . warn ( "Invalid cron expression for task {}, field 'hours': {}" , new Object [ ] { task , t . getMessage ( ) } ) ; } try { CronField days = parseField ( daysField , 1 , 31 ) ; cronEntry . setDays ( days ) ; } catch ( Throwable t ) { logger . warn ( "Invalid cron expression for task {}, field 'days': {}" , new Object [ ] { task , t . getMessage ( ) } ) ; } try { CronField weeks = parseField ( weeksField , 0 , 6 ) ; cronEntry . setWeeks ( weeks ) ; } catch ( Throwable t ) { logger . warn ( "Invalid cron expression for task {}, field 'weeks': {}" , new Object [ ] { task , t . getMessage ( ) } ) ; } try { CronField months = parseField ( monthsField , 1 , 12 ) ; cronEntry . setMonths ( months ) ; } catch ( Throwable t ) { logger . warn ( "Invalid cron expression for task {}, field 'months': {}" , new Object [ ] { task , t . getMessage ( ) } ) ; } return cronEntry ; } else { logger . warn ( "Invalid cron expression for task {}: invalid number of fields (must be {})." , new Object [ ] { task , CronService . NUM_FIELDS } ) ; } return null ; |
public class AbstractProject { /** * Gets the directory where the module is checked out .
* @ return
* null if the workspace is on an agent that ' s not connected .
* @ deprecated as of 1.319
* To support concurrent builds of the same project , this method is moved to { @ link AbstractBuild } .
* For backward compatibility , this method returns the right { @ link AbstractBuild # getWorkspace ( ) } if called
* from { @ link Executor } , and otherwise the workspace of the last build .
* If you are calling this method during a build from an executor , switch it to { @ link AbstractBuild # getWorkspace ( ) } .
* If you are calling this method to serve a file from the workspace , doing a form validation , etc . , then
* use { @ link # getSomeWorkspace ( ) } */
@ Deprecated public final FilePath getWorkspace ( ) { } } | AbstractBuild b = getBuildForDeprecatedMethods ( ) ; return b != null ? b . getWorkspace ( ) : null ; |
public class ProcessGroovyMethods { /** * Executes the command specified by < code > self < / code > with environment defined by < code > envp < / code >
* and under the working directory < code > dir < / code > .
* < p > For more control over Process construction you can use
* < code > java . lang . ProcessBuilder < / code > .
* @ param self a command line String to be executed .
* @ param envp an array of Strings , each element of which
* has environment variable settings in the format
* < i > name < / i > = < i > value < / i > , or
* < tt > null < / tt > if the subprocess should inherit
* the environment of the current process .
* @ param dir the working directory of the subprocess , or
* < tt > null < / tt > if the subprocess should inherit
* the working directory of the current process .
* @ return the Process which has just started for this command line representation .
* @ throws IOException if an IOException occurs .
* @ since 1.0 */
public static Process execute ( final String self , final String [ ] envp , final File dir ) throws IOException { } } | return Runtime . getRuntime ( ) . exec ( self , envp , dir ) ; |
public class Tuple3i { /** * { @ inheritDoc } */
@ Override public void negate ( T t1 ) { } } | this . x = - t1 . ix ( ) ; this . y = - t1 . iy ( ) ; this . z = - t1 . iz ( ) ; |
public class tmglobal_binding { /** * Use this API to fetch a tmglobal _ binding resource . */
public static tmglobal_binding get ( nitro_service service ) throws Exception { } } | tmglobal_binding obj = new tmglobal_binding ( ) ; tmglobal_binding response = ( tmglobal_binding ) obj . get_resource ( service ) ; return response ; |
public class SmartBinder { /** * Cast the incoming arguments to the types in the given signature . The
* argument count must match , but the names in the target signature are
* ignored .
* @ param target the Signature to which arguments should be cast
* @ return a new SmartBinder with the cast applied */
public SmartBinder cast ( Signature target ) { } } | return new SmartBinder ( target , binder . cast ( target . type ( ) ) ) ; |
public class UpdateIntegrationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateIntegrationRequest updateIntegrationRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateIntegrationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateIntegrationRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( updateIntegrationRequest . getResourceId ( ) , RESOURCEID_BINDING ) ; protocolMarshaller . marshall ( updateIntegrationRequest . getHttpMethod ( ) , HTTPMETHOD_BINDING ) ; protocolMarshaller . marshall ( updateIntegrationRequest . getPatchOperations ( ) , PATCHOPERATIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class StoreConfig { /** * Creates a new instance of StoreConfig .
* @ param filePath - the < code > config . properties < / code > file or the directory containing < code > config . properties < / code >
* @ return a new instance of StoreConfig
* @ throws IOException
* @ throws InvalidStoreConfigException */
public static StoreConfig newInstance ( File filePath ) throws IOException { } } | File homeDir ; Properties p = new Properties ( ) ; if ( filePath . exists ( ) ) { if ( filePath . isDirectory ( ) ) { homeDir = filePath ; File propertiesFile = new File ( filePath , CONFIG_PROPERTIES_FILE ) ; if ( propertiesFile . exists ( ) ) { FileReader reader = new FileReader ( propertiesFile ) ; p . load ( reader ) ; reader . close ( ) ; } else { throw new FileNotFoundException ( propertiesFile . toString ( ) ) ; } } else { homeDir = filePath . getParentFile ( ) ; FileReader reader = new FileReader ( filePath ) ; p . load ( reader ) ; reader . close ( ) ; } } else { throw new FileNotFoundException ( filePath . toString ( ) ) ; } int initialCapacity = - 1 ; String initialCapacityStr = p . getProperty ( StoreParams . PARAM_INITIAL_CAPACITY ) ; if ( initialCapacityStr == null ) { throw new InvalidStoreConfigException ( StoreParams . PARAM_INITIAL_CAPACITY + " not found" ) ; } else if ( ( initialCapacity = parseInt ( StoreParams . PARAM_INITIAL_CAPACITY , initialCapacityStr , - 1 ) ) < 1 ) { throw new InvalidStoreConfigException ( StoreParams . PARAM_INITIAL_CAPACITY + "=" + initialCapacityStr ) ; } int partitionStart = - 1 ; int partitionCount = - 1 ; String partitionStartStr = p . getProperty ( StoreParams . PARAM_PARTITION_START ) ; String partitionCountStr = p . getProperty ( StoreParams . PARAM_PARTITION_COUNT ) ; if ( partitionStartStr != null && partitionCountStr != null ) { if ( ( partitionStart = parseInt ( StoreParams . PARAM_PARTITION_START , partitionStartStr , - 1 ) ) < 0 ) { throw new InvalidStoreConfigException ( StoreParams . PARAM_PARTITION_START + "=" + partitionStartStr ) ; } if ( ( partitionCount = parseInt ( StoreParams . PARAM_PARTITION_COUNT , partitionCountStr , - 1 ) ) < 1 ) { throw new InvalidStoreConfigException ( StoreParams . PARAM_PARTITION_COUNT + "=" + partitionCountStr ) ; } } else { return new StoreConfig ( homeDir , initialCapacity ) ; } return new StorePartitionConfig ( homeDir , partitionStart , partitionCount ) ; |
public class CompressedWritable { /** * Must be called by all methods which access fields to ensure that the data
* has been uncompressed . */
protected void ensureInflated ( ) { } } | if ( compressed != null ) { try { ByteArrayInputStream deflated = new ByteArrayInputStream ( compressed ) ; DataInput inflater = new DataInputStream ( new InflaterInputStream ( deflated ) ) ; readFieldsCompressed ( inflater ) ; compressed = null ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } |
public class ElementBox { /** * Loads background images from style . Considers their positions , repetition , etc . Currently , only a single background
* image is supported ( CSS2 ) .
* @ param style the style containing the image specifiations
* @ return a list of images */
protected Vector < BackgroundImage > loadBackgroundImages ( NodeData style ) { } } | CSSProperty . BackgroundImage img = style . getProperty ( "background-image" ) ; if ( img == CSSProperty . BackgroundImage . uri ) { try { Vector < BackgroundImage > bgimages = new Vector < BackgroundImage > ( 1 ) ; TermURI urlstring = style . getValue ( TermURI . class , "background-image" ) ; URL url = DataURLHandler . createURL ( urlstring . getBase ( ) , urlstring . getValue ( ) ) ; CSSProperty . BackgroundPosition position = style . getProperty ( "background-position" ) ; TermList positionValues = style . getValue ( TermList . class , "background-position" ) ; CSSProperty . BackgroundRepeat repeat = style . getProperty ( "background-repeat" ) ; if ( repeat == null ) repeat = BackgroundRepeat . REPEAT ; CSSProperty . BackgroundAttachment attachment = style . getProperty ( "background-attachment" ) ; if ( attachment == null ) attachment = BackgroundAttachment . SCROLL ; CSSProperty . BackgroundSize size = style . getProperty ( "background-size" ) ; TermList sizeValues = null ; if ( size == null ) size = BackgroundSize . list_values ; else if ( size == BackgroundSize . list_values ) sizeValues = style . getValue ( TermList . class , "background-size" ) ; BackgroundImage bgimg = new BackgroundImage ( this , url , position , positionValues , repeat , attachment , size , sizeValues ) ; bgimages . add ( bgimg ) ; return bgimages ; } catch ( MalformedURLException e ) { log . warn ( e . getMessage ( ) ) ; return null ; } } else return null ; |
public class AbstractJpaStorage { /** * Gets a count of the number of rows that would be returned by the search .
* @ param criteria
* @ param entityManager
* @ param type */
protected < T > int executeCountQuery ( SearchCriteriaBean criteria , EntityManager entityManager , Class < T > type ) { } } | CriteriaBuilder builder = entityManager . getCriteriaBuilder ( ) ; CriteriaQuery < Long > countQuery = builder . createQuery ( Long . class ) ; Root < T > from = countQuery . from ( type ) ; countQuery . select ( builder . count ( from ) ) ; applySearchCriteriaToQuery ( criteria , builder , countQuery , from , true ) ; TypedQuery < Long > query = entityManager . createQuery ( countQuery ) ; return query . getSingleResult ( ) . intValue ( ) ; |
public class AbstractMetric { /** * { @ inheritDoc } */
@ Override public double getValue ( final U u ) { } } | if ( metricPerUser . containsKey ( u ) ) { return metricPerUser . get ( u ) ; } return Double . NaN ; |
public class CollectionUtils { /** * Returns a { @ link Map } mapping each unique element in the given
* { @ link Collection } to an { @ link Integer } representing the number
* of occurrences of that element in the { @ link Collection } .
* Only those elements present in the collection will appear as
* keys in the map .
* @ param coll the collection to get the cardinality map for , must not be null
* @ return the populated cardinality map */
public static Map getCardinalityMap ( final Collection coll ) { } } | Map count = new HashMap ( ) ; for ( Iterator it = coll . iterator ( ) ; it . hasNext ( ) ; ) { Object obj = it . next ( ) ; Integer c = ( Integer ) ( count . get ( obj ) ) ; if ( c == null ) { count . put ( obj , INTEGER_ONE ) ; } else { count . put ( obj , new Integer ( c . intValue ( ) + 1 ) ) ; } } return count ; |
public class MapUtil { /** * 新建一个HashMap
* @ param < K > Key类型
* @ param < V > Value类型
* @ param size 初始大小 , 由于默认负载因子0.75 , 传入的size会实际初始大小为size / 0.75
* @ return HashMap对象 */
public static < K , V > HashMap < K , V > newHashMap ( int size ) { } } | return newHashMap ( size , false ) ; |
public class CommercePriceEntryUtil { /** * Returns a range of all the commerce price entries where companyId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommercePriceEntryModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order .
* @ param companyId the company ID
* @ param start the lower bound of the range of commerce price entries
* @ param end the upper bound of the range of commerce price entries ( not inclusive )
* @ return the range of matching commerce price entries */
public static List < CommercePriceEntry > findByCompanyId ( long companyId , int start , int end ) { } } | return getPersistence ( ) . findByCompanyId ( companyId , start , end ) ; |
public class ZKStoreHelper { /** * region curator client store access */
CompletableFuture < Void > deletePath ( final String path , final boolean deleteEmptyContainer ) { } } | final CompletableFuture < Void > result = new CompletableFuture < > ( ) ; final CompletableFuture < Void > deleteNode = new CompletableFuture < > ( ) ; try { client . delete ( ) . inBackground ( callback ( event -> deleteNode . complete ( null ) , e -> { if ( e instanceof StoreException . DataNotFoundException ) { // deleted already
deleteNode . complete ( null ) ; } else { deleteNode . completeExceptionally ( e ) ; } } , path ) , executor ) . forPath ( path ) ; } catch ( Exception e ) { deleteNode . completeExceptionally ( StoreException . create ( StoreException . Type . UNKNOWN , e , path ) ) ; } deleteNode . whenComplete ( ( res , ex ) -> { if ( ex != null ) { result . completeExceptionally ( ex ) ; } else if ( deleteEmptyContainer ) { final String container = ZKPaths . getPathAndNode ( path ) . getPath ( ) ; try { client . delete ( ) . inBackground ( callback ( event -> result . complete ( null ) , e -> { if ( e instanceof StoreException . DataNotFoundException ) { // deleted already
result . complete ( null ) ; } else if ( e instanceof StoreException . DataNotEmptyException ) { // non empty dir
result . complete ( null ) ; } else { result . completeExceptionally ( e ) ; } } , path ) , executor ) . forPath ( container ) ; } catch ( Exception e ) { result . completeExceptionally ( StoreException . create ( StoreException . Type . UNKNOWN , e , path ) ) ; } } else { result . complete ( null ) ; } } ) ; return result ; |
public class PreferencesFxPresenter { /** * { @ inheritDoc } */
@ Override public void setupEventHandlers ( ) { } } | // As the scene is null here , listen to scene changes and make sure
// that when the window is closed , the settings are saved beforehand .
preferencesFxView . sceneProperty ( ) . addListener ( ( observable , oldScene , newScene ) -> { LOGGER . trace ( "new Scene: " + newScene ) ; if ( newScene != null ) { LOGGER . trace ( "addEventHandler on Window close request to save settings" ) ; newScene . getWindow ( ) . addEventHandler ( WindowEvent . WINDOW_CLOSE_REQUEST , event -> { LOGGER . trace ( "saveSettings" ) ; model . saveSettings ( ) ; } ) ; } } ) ; |
public class LoggerWrapper { /** * Form a DOM node textual representation recursively
* @ param node
* @ param tablevel
* @ return */
private String domNodeDescription ( Node node , int tablevel ) { } } | String domNodeDescription = null ; String nodeName = node . getNodeName ( ) ; String nodeValue = node . getNodeValue ( ) ; if ( ! ( nodeName . equals ( "#text" ) && nodeValue . replaceAll ( "\n" , "" ) . trim ( ) . equals ( "" ) ) ) { domNodeDescription = tabs ( tablevel ) + node . getNodeName ( ) + "\n" ; NamedNodeMap attributes = node . getAttributes ( ) ; if ( attributes != null ) { for ( int i = 0 ; i < attributes . getLength ( ) ; i ++ ) { Node attribute = attributes . item ( i ) ; domNodeDescription += tabs ( tablevel ) + "-" + attribute . getNodeName ( ) + "=" + attribute . getNodeValue ( ) + "\n" ; } } domNodeDescription += tabs ( tablevel ) + "=" + node . getNodeValue ( ) + "\n" ; NodeList children = node . getChildNodes ( ) ; if ( children != null ) { for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { String childDescription = domNodeDescription ( children . item ( i ) , tablevel + 1 ) ; if ( childDescription != null ) { domNodeDescription += childDescription ; } } } } return domNodeDescription ; |
public class KerasAtrousConvolution1D { /** * Get layer output type .
* @ param inputType Array of InputTypes
* @ return output type as InputType
* @ throws InvalidKerasConfigurationException Invalid Keras config */
@ Override public InputType getOutputType ( InputType ... inputType ) throws InvalidKerasConfigurationException { } } | if ( inputType . length > 1 ) throw new InvalidKerasConfigurationException ( "Keras Convolution layer accepts only one input (received " + inputType . length + ")" ) ; return this . getAtrousConvolution1D ( ) . getOutputType ( - 1 , inputType [ 0 ] ) ; |
public class AdminDictStopwordsAction { @ Execute public HtmlResponse index ( final SearchForm form ) { } } | validate ( form , messages -> { } , ( ) -> asDictIndexHtml ( ) ) ; stopwordsPager . clear ( ) ; return asHtml ( path_AdminDictStopwords_AdminDictStopwordsJsp ) . renderWith ( data -> { searchPaging ( data , form ) ; } ) ; |
public class DefaultSourceValidatableBindingBuilder { /** * { @ inheritDoc } */
public ConvertableBindingBuilder < S , S , V > checking ( Validator < ? super S , ? extends V > sourceValidator ) { } } | return new DefaultConvertableBindingBuilder < S , S , V > ( getSource ( ) , sourceValidator , getConverter ( ) , getCallback ( ) ) ; |
public class ImageModerationsImpl { /** * Fuzzily match an image against one of your custom Image Lists . You can create and manage your custom image lists using & lt ; a href = " / docs / services / 578ff44d2703741568569ab9 / operations / 578ff7b12703741568569abe " & gt ; this & lt ; / a & gt ; API .
* Returns ID and tags of matching image . & lt ; br / & gt ;
* & lt ; br / & gt ;
* Note : Refresh Index must be run on the corresponding Image List before additions and removals are reflected in the response .
* @ param listId The list Id .
* @ param cacheImage Whether to retain the submitted image for future use ; defaults to false if omitted .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the MatchResponse object */
public Observable < ServiceResponse < MatchResponse > > matchMethodWithServiceResponseAsync ( String listId , Boolean cacheImage ) { } } | if ( this . client . baseUrl ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.baseUrl() is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{baseUrl}" , this . client . baseUrl ( ) ) ; return service . matchMethod ( listId , cacheImage , this . client . acceptLanguage ( ) , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < MatchResponse > > > ( ) { @ Override public Observable < ServiceResponse < MatchResponse > > call ( Response < ResponseBody > response ) { try { ServiceResponse < MatchResponse > clientResponse = matchMethodDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
public class vpnsessionpolicy { /** * Use this API to update vpnsessionpolicy . */
public static base_response update ( nitro_service client , vpnsessionpolicy resource ) throws Exception { } } | vpnsessionpolicy updateresource = new vpnsessionpolicy ( ) ; updateresource . name = resource . name ; updateresource . rule = resource . rule ; updateresource . action = resource . action ; return updateresource . update_resource ( client ) ; |
public class JcrSession { /** * Obtain the { @ link Node JCR Node } object for the cached node and cache instance
* @ param cachedNode the cached node ; may not be null
* @ param cache the cache where { @ code cachedNode } resides ; may not be null
* @ param expectedType the expected implementation type for the node , or null if it is not known
* @ param parentKey the node key for the parent node , or null if the parent is not known
* @ return the JCR node ; never null */
AbstractJcrNode node ( CachedNode cachedNode , SessionCache cache , AbstractJcrNode . Type expectedType , NodeKey parentKey ) { } } | assert cachedNode != null ; NodeKey nodeKey = cachedNode . getKey ( ) ; AbstractJcrNode node = jcrNodes . get ( nodeKey ) ; boolean mightBeShared = true ; if ( node == null ) { if ( expectedType == null ) { Name primaryType = cachedNode . getPrimaryType ( cache ) ; expectedType = Type . typeForPrimaryType ( primaryType ) ; if ( expectedType == null ) { // If this node from the system workspace , then the default is Type . SYSTEM rather than Type . NODE . . .
if ( repository ( ) . systemWorkspaceKey ( ) . equals ( nodeKey . getWorkspaceKey ( ) ) ) { expectedType = Type . SYSTEM ; } else { expectedType = Type . NODE ; } assert expectedType != null ; } } // Check if the new node is in the system area . . .
if ( expectedType == Type . SYSTEM || expectedType == Type . VERSION || expectedType == Type . VERSION_HISTORY ) { Path path = cachedNode . getPath ( cache ) ; assert path . size ( ) > 0 ; if ( ! path . getSegment ( 0 ) . getName ( ) . equals ( JcrLexicon . SYSTEM ) ) { // It is NOT below " / jcr : system " ; someone must be using a node type normally used in the system area . . .
expectedType = Type . NODE ; } } switch ( expectedType ) { case NODE : node = new JcrNode ( this , nodeKey ) ; break ; case VERSION : node = new JcrVersionNode ( this , nodeKey ) ; mightBeShared = false ; break ; case VERSION_HISTORY : node = new JcrVersionHistoryNode ( this , nodeKey ) ; mightBeShared = false ; break ; case SYSTEM : node = new JcrSystemNode ( this , nodeKey ) ; mightBeShared = false ; break ; case ROOT : try { return getRootNode ( ) ; } catch ( RepositoryException e ) { assert false : "Should never happen: " + e . getMessage ( ) ; } } assert node != null ; AbstractJcrNode newNode = jcrNodes . putIfAbsent ( nodeKey , node ) ; if ( newNode != null ) { // Another thread snuck in and created the node object . . .
node = newNode ; } } if ( mightBeShared && parentKey != null && cachedNode . getMixinTypes ( cache ) . contains ( JcrMixLexicon . SHAREABLE ) ) { // This is a shareable node , so we have to get the proper Node instance for the given parent . . .
node = node . sharedSet ( ) . getSharedNode ( cachedNode , parentKey ) ; } return node ; |
public class DataStorage { /** * recoverTransitionRead for a specific Name Space
* @ param datanode DataNode
* @ param namespaceId name space Id
* @ param nsInfo Namespace info of namenode corresponding to the Name Space
* @ param dataDirs Storage directories
* @ param startOpt startup option
* @ throws IOException on error */
void recoverTransitionRead ( DataNode datanode , int namespaceId , NamespaceInfo nsInfo , Collection < File > dataDirs , StartupOption startOpt , String nameserviceId ) throws IOException { } } | // First ensure datanode level format / snapshot / rollback is completed
// recoverTransitionRead ( datanode , nsInfo , dataDirs , startOpt ) ;
// Create list of storage directories for the Name Space
Collection < File > nsDataDirs = new ArrayList < File > ( ) ; for ( Iterator < File > it = dataDirs . iterator ( ) ; it . hasNext ( ) ; ) { File dnRoot = it . next ( ) ; File nsRoot = NameSpaceSliceStorage . getNsRoot ( namespaceId , new File ( dnRoot , STORAGE_DIR_CURRENT ) ) ; nsDataDirs . add ( nsRoot ) ; } boolean merged = false ; String [ ] mergeDataDirs = nameserviceId == null ? null : datanode . getConf ( ) . getStrings ( "dfs.merge.data.dir." + nameserviceId ) ; if ( startOpt . equals ( StartupOption . REGULAR ) && mergeDataDirs != null && mergeDataDirs . length > 0 ) { assert mergeDataDirs . length == dataDirs . size ( ) ; merged = doMerge ( mergeDataDirs , nsDataDirs , namespaceId , nsInfo , startOpt ) ; } if ( ! merged ) { // mkdir for the list of NameSpaceStorage
makeNameSpaceDataDir ( nsDataDirs ) ; } NameSpaceSliceStorage nsStorage = new NameSpaceSliceStorage ( namespaceId , this . getCTime ( ) , layoutMap ) ; nsStorage . recoverTransitionRead ( datanode , nsInfo , nsDataDirs , startOpt ) ; addNameSpaceStorage ( namespaceId , nsStorage ) ; |
public class ListPoliciesGrantingServiceAccessResult { /** * A < code > ListPoliciesGrantingServiceAccess < / code > object that contains details about the permissions policies
* attached to the specified identity ( user , group , or role ) .
* @ param policiesGrantingServiceAccess
* A < code > ListPoliciesGrantingServiceAccess < / code > object that contains details about the permissions
* policies attached to the specified identity ( user , group , or role ) . */
public void setPoliciesGrantingServiceAccess ( java . util . Collection < ListPoliciesGrantingServiceAccessEntry > policiesGrantingServiceAccess ) { } } | if ( policiesGrantingServiceAccess == null ) { this . policiesGrantingServiceAccess = null ; return ; } this . policiesGrantingServiceAccess = new com . amazonaws . internal . SdkInternalList < ListPoliciesGrantingServiceAccessEntry > ( policiesGrantingServiceAccess ) ; |
public class PyOutputConfigurationProvider { /** * $ NON - NLS - 1 $ */
@ Override public Set < OutputConfiguration > getOutputConfigurations ( ) { } } | final OutputConfiguration pythonOutput = new OutputConfiguration ( OUTPUT_CONFIGURATION_NAME ) ; pythonOutput . setDescription ( Messages . PyOutputConfigurationProvider_0 ) ; pythonOutput . setOutputDirectory ( OUTPUT_FOLDER ) ; pythonOutput . setOverrideExistingResources ( true ) ; pythonOutput . setCreateOutputDirectory ( true ) ; pythonOutput . setCanClearOutputDirectory ( true ) ; pythonOutput . setCleanUpDerivedResources ( true ) ; pythonOutput . setSetDerivedProperty ( true ) ; pythonOutput . setKeepLocalHistory ( false ) ; return newHashSet ( pythonOutput ) ; |
public class BasicBinder { /** * Register a particular binding configuration entry .
* @ param theBinding The entry to be registered
* @ param < S > The Source type for the binding
* @ param < T > The Target type for the binding */
protected < S , T > void registerBindingConfigurationEntry ( BindingConfigurationEntry theBinding ) { } } | /* * BindingConfigurationEntry has two possible configurations :
* bindingClass with an optional qualifier ( this defaults to DefaultBinding )
* OR
* sourceClass and
* targetClass and
* optional qualifier ( defaults to DefaultBinding )
* with at least one of either
* toMethod and / or
* fromMethod and / or
* fromConstructor
* Depending on which components are populated the entry is interpreted differently . */
if ( Binding . class . isAssignableFrom ( theBinding . getBindingClass ( ) ) ) { /* * If the binding class is an instance of the Binding interface then register it .
* When the binding class is an interface , you must define source and target class if they cannot be
* determined from introspecting the interface .
* You can optionally supply a qualifier so that the binding is associated with a qualifier */
try { @ SuppressWarnings ( "unchecked" ) Binding < S , T > binding = ( Binding < S , T > ) theBinding . getBindingClass ( ) . newInstance ( ) ; registerBinding ( binding . getBoundClass ( ) , binding . getTargetClass ( ) , binding , theBinding . getQualifier ( ) ) ; } catch ( InstantiationException e ) { throw new IllegalStateException ( "Cannot instantiate binding class: " + theBinding . getBindingClass ( ) . getName ( ) ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( "Cannot access binding class: " + theBinding . getBindingClass ( ) . getName ( ) ) ; } } else if ( FromUnmarshaller . class . isAssignableFrom ( theBinding . getBindingClass ( ) ) ) { /* * If the binding class is an instance of the FromUnmarshaller interface then register it .
* When the class is an interface , you must define source and target class if they cannot be
* determined from introspecting the interface .
* You can optionally supply a qualifier so that the binding is associated with a qualifier */
try { @ SuppressWarnings ( "unchecked" ) FromUnmarshaller < S , T > fromUnmarshaller = ( FromUnmarshaller < S , T > ) theBinding . getBindingClass ( ) . newInstance ( ) ; registerUnmarshaller ( fromUnmarshaller . getBoundClass ( ) , fromUnmarshaller . getTargetClass ( ) , fromUnmarshaller , theBinding . getQualifier ( ) ) ; } catch ( InstantiationException e ) { throw new IllegalStateException ( "Cannot instantiate binding class: " + theBinding . getBindingClass ( ) . getName ( ) ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( "Cannot access binding class: " + theBinding . getBindingClass ( ) . getName ( ) ) ; } } else if ( ToMarshaller . class . isAssignableFrom ( theBinding . getBindingClass ( ) ) ) { /* * If the binding class is an instance of the ToMarshaller interface then register it .
* When the class is an interface , you must define source and target class if they cannot be
* determined from introspecting the interface .
* You can optionally supply a qualifier so that the binding is associated with a qualifier */
try { @ SuppressWarnings ( "unchecked" ) ToMarshaller < S , T > toMarshaller = ( ToMarshaller < S , T > ) theBinding . getBindingClass ( ) . newInstance ( ) ; registerMarshaller ( toMarshaller . getBoundClass ( ) , toMarshaller . getTargetClass ( ) , toMarshaller , theBinding . getQualifier ( ) ) ; } catch ( InstantiationException e ) { throw new IllegalStateException ( "Cannot instantiate binding class: " + theBinding . getBindingClass ( ) . getName ( ) ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( "Cannot access binding class: " + theBinding . getBindingClass ( ) . getName ( ) ) ; } } else if ( Converter . class . isAssignableFrom ( theBinding . getBindingClass ( ) ) ) { /* * If the binding class is an instance of the Converter interface then register it .
* When the class is an interface , you must define source and target class if they cannot be
* determined from introspecting the interface .
* You can optionally supply a qualifier so that the binding is associated with a qualifier */
try { @ SuppressWarnings ( "unchecked" ) Converter < S , T > converter = ( Converter < S , T > ) theBinding . getBindingClass ( ) . newInstance ( ) ; registerConverter ( converter . getInputClass ( ) , converter . getOutputClass ( ) , converter , theBinding . getQualifier ( ) ) ; } catch ( InstantiationException e ) { throw new IllegalStateException ( "Cannot instantiate binding class: " + theBinding . getBindingClass ( ) . getName ( ) ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( "Cannot access binding class: " + theBinding . getBindingClass ( ) . getName ( ) ) ; } } else if ( theBinding . getBindingClass ( ) != null ) { /* * If only the binding class is supplied , then inspect it for bindings , gathering all bindings identified */
registerAnnotatedClasses ( theBinding . getBindingClass ( ) ) ; } else { /* * Register the binding using the explicit method details provided */
@ SuppressWarnings ( "unchecked" ) ConverterKey < S , T > converterKey = new ConverterKey < S , T > ( ( Class < S > ) theBinding . getSourceClass ( ) , ( Class < T > ) theBinding . getTargetClass ( ) , theBinding . getQualifier ( ) ) ; @ SuppressWarnings ( "unchecked" ) Constructor < S > fromConstructor = ( Constructor < S > ) theBinding . getFromConstructor ( ) ; registerForMethods ( converterKey , theBinding . getToMethod ( ) , theBinding . getFromMethod ( ) , fromConstructor ) ; } |
public class Totp { /** * Verifier - To be used only on the server side
* Taken from Google Authenticator with small modifications from
* < a href = " http : / / code . google . com / p / google - authenticator / source / browse / src / com / google / android / apps / authenticator / PasscodeGenerator . java ? repo = android # 212 " > PasscodeGenerator . java < / a >
* Verify a timeout code . The timeout code will be valid for a time
* determined by the interval period and the number of adjacent intervals
* checked .
* @ param otp Timeout code
* @ return True if the timeout code is valid
* Author : sweis @ google . com ( Steve Weis ) */
public boolean verify ( String otp ) { } } | long code = Long . parseLong ( otp ) ; long currentInterval = clock . getCurrentInterval ( ) ; int pastResponse = Math . max ( DELAY_WINDOW , 0 ) ; for ( int i = pastResponse ; i >= 0 ; -- i ) { int candidate = generate ( this . secret , currentInterval - i ) ; if ( candidate == code ) { return true ; } } return false ; |
public class Gild { /** * Adds a service proxy to this harness . @ param serviceName the name of the
* service @ param proxy the service proxy @ return this harness */
public Gild with ( final String serviceName , final ServiceProxy proxy ) { } } | proxies . put ( serviceName , proxy ) ; return this ; |
public class HttpClient { /** * Makes an OPTIONS request to the given URL
* @ param url String URL
* @ return HttpClient
* @ throws HelloSignException thrown if the URL is invalid */
public HttpClient options ( String url ) throws HelloSignException { } } | request = new HttpOptionsRequest ( url ) ; request . execute ( ) ; return this ; |
public class Compiler { /** * Compile an extension function .
* @ param opPos The current position in the m _ opMap array .
* @ return reference to { @ link org . apache . xpath . functions . FuncExtFunction } instance .
* @ throws TransformerException if a error occurs creating the Expression . */
private Expression compileExtension ( int opPos ) throws TransformerException { } } | int endExtFunc = opPos + getOp ( opPos + 1 ) - 1 ; opPos = getFirstChildPos ( opPos ) ; java . lang . String ns = ( java . lang . String ) getTokenQueue ( ) . elementAt ( getOp ( opPos ) ) ; opPos ++ ; java . lang . String funcName = ( java . lang . String ) getTokenQueue ( ) . elementAt ( getOp ( opPos ) ) ; opPos ++ ; // We create a method key to uniquely identify this function so that we
// can cache the object needed to invoke it . This way , we only pay the
// reflection overhead on the first call .
Function extension = new FuncExtFunction ( ns , funcName , String . valueOf ( getNextMethodId ( ) ) ) ; try { int i = 0 ; while ( opPos < endExtFunc ) { int nextOpPos = getNextOpPos ( opPos ) ; extension . setArg ( this . compile ( opPos ) , i ) ; opPos = nextOpPos ; i ++ ; } } catch ( WrongNumberArgsException wnae ) { ; // should never happen
} return extension ; |
public class JavaButton { /** * Initialize class fields . */
public void init ( ScreenLocation itsLocation , BasePanel parentScreen , Converter fieldConverter , int sDisplayFieldDesc ) { } } | m_classInfo = null ; super . init ( itsLocation , parentScreen , fieldConverter , sDisplayFieldDesc , "" , "Print Java" , MenuConstants . PRINT , null , null ) ; |
public class WarningSystem { /** * Sends a warning to the current service . */
public static void sendCurrentWarning ( Object source , Throwable e ) { } } | WarningSystem warning = getCurrent ( ) ; if ( warning != null ) warning . sendWarning ( source , e ) ; else { e . printStackTrace ( ) ; log . log ( Level . WARNING , e . toString ( ) , e ) ; } |
public class Util { /** * Forward commands from the input to the specified { @ link ExecutionControl }
* instance , then responses back on the output .
* @ param ec the direct instance of { @ link ExecutionControl } to process commands
* @ param in the command input
* @ param out the command response output */
public static void forwardExecutionControl ( ExecutionControl ec , ObjectInput in , ObjectOutput out ) { } } | new ExecutionControlForwarder ( ec , in , out ) . commandLoop ( ) ; |
public class RegionBackendServiceClient { /** * Retrieves the list of regional BackendService resources available to the specified project in
* the given region .
* < p > Sample code :
* < pre > < code >
* try ( RegionBackendServiceClient regionBackendServiceClient = RegionBackendServiceClient . create ( ) ) {
* ProjectRegionName region = ProjectRegionName . of ( " [ PROJECT ] " , " [ REGION ] " ) ;
* for ( BackendService element : regionBackendServiceClient . listRegionBackendServices ( region ) . iterateAll ( ) ) {
* / / doThingsWith ( element ) ;
* < / code > < / pre >
* @ param region Name of the region scoping this request .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final ListRegionBackendServicesPagedResponse listRegionBackendServices ( ProjectRegionName region ) { } } | ListRegionBackendServicesHttpRequest request = ListRegionBackendServicesHttpRequest . newBuilder ( ) . setRegion ( region == null ? null : region . toString ( ) ) . build ( ) ; return listRegionBackendServices ( request ) ; |
public class MatrixFeatures_DDRM { /** * Checks to see if a matrix is skew symmetric with in tolerance : < br >
* < br >
* - A = A < sup > T < / sup > < br >
* or < br >
* | a < sub > ij < / sub > + a < sub > ji < / sub > | & le ; tol
* @ param A The matrix being tested .
* @ param tol Tolerance for being skew symmetric .
* @ return True if it is skew symmetric and false if it is not . */
public static boolean isSkewSymmetric ( DMatrixRMaj A , double tol ) { } } | if ( A . numCols != A . numRows ) return false ; for ( int i = 0 ; i < A . numRows ; i ++ ) { for ( int j = 0 ; j < i ; j ++ ) { double a = A . get ( i , j ) ; double b = A . get ( j , i ) ; double diff = Math . abs ( a + b ) ; if ( ! ( diff <= tol ) ) { return false ; } } } return true ; |
public class AbstractTerminal { /** * Call this method when the terminal has been resized or the initial size of the terminal has been discovered . It
* will trigger all resize listeners , but only if the size has changed from before .
* @ param newSize Last discovered terminal size */
protected synchronized void onResized ( TerminalSize newSize ) { } } | if ( lastKnownSize == null || ! lastKnownSize . equals ( newSize ) ) { lastKnownSize = newSize ; for ( TerminalResizeListener resizeListener : resizeListeners ) { resizeListener . onResized ( this , lastKnownSize ) ; } } |
public class Metric { /** * Creates a { @ link Metric } .
* @ param metricDescriptor the { @ link MetricDescriptor } .
* @ param timeSeries the single { @ link TimeSeries } for this metric .
* @ return a { @ code Metric } .
* @ since 0.17 */
public static Metric createWithOneTimeSeries ( MetricDescriptor metricDescriptor , TimeSeries timeSeries ) { } } | return createInternal ( metricDescriptor , Collections . singletonList ( Utils . checkNotNull ( timeSeries , "timeSeries" ) ) ) ; |
public class ScenarioImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case BpsimPackage . SCENARIO__SCENARIO_PARAMETERS : setScenarioParameters ( ( ScenarioParameters ) newValue ) ; return ; case BpsimPackage . SCENARIO__ELEMENT_PARAMETERS : getElementParameters ( ) . clear ( ) ; getElementParameters ( ) . addAll ( ( Collection < ? extends ElementParameters > ) newValue ) ; return ; case BpsimPackage . SCENARIO__CALENDAR : getCalendar ( ) . clear ( ) ; getCalendar ( ) . addAll ( ( Collection < ? extends Calendar > ) newValue ) ; return ; case BpsimPackage . SCENARIO__VENDOR_EXTENSION : getVendorExtension ( ) . clear ( ) ; getVendorExtension ( ) . addAll ( ( Collection < ? extends VendorExtension > ) newValue ) ; return ; case BpsimPackage . SCENARIO__AUTHOR : setAuthor ( ( String ) newValue ) ; return ; case BpsimPackage . SCENARIO__CREATED : setCreated ( newValue ) ; return ; case BpsimPackage . SCENARIO__DESCRIPTION : setDescription ( ( String ) newValue ) ; return ; case BpsimPackage . SCENARIO__ID : setId ( ( String ) newValue ) ; return ; case BpsimPackage . SCENARIO__INHERITS : setInherits ( ( String ) newValue ) ; return ; case BpsimPackage . SCENARIO__MODIFIED : setModified ( newValue ) ; return ; case BpsimPackage . SCENARIO__NAME : setName ( ( String ) newValue ) ; return ; case BpsimPackage . SCENARIO__RESULT : setResult ( ( String ) newValue ) ; return ; case BpsimPackage . SCENARIO__VENDOR : setVendor ( ( String ) newValue ) ; return ; case BpsimPackage . SCENARIO__VERSION : setVersion ( ( String ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.