signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
---|---|
public class StyleHelper { /** * Adds enum value style name to UIObject unless style is { @ code null } .
* @ param uiObject Object to add style to
* @ param style Style name */
public static < E extends Style . HasCssName > void addEnumStyleName ( final UIObject uiObject , final E style ) { } } | if ( style != null && style . getCssName ( ) != null && ! style . getCssName ( ) . isEmpty ( ) ) { uiObject . addStyleName ( style . getCssName ( ) ) ; } |
public class ImportSupport { /** * Overall strategy : we have two entry points , acquireString ( ) and
* acquireReader ( ) . The latter passes data through unbuffered if
* possible ( but note that it is not always possible - - specifically
* for cases where we must use the RequestDispatcher . The remaining
* methods handle the common . core logic of loading either a URL or a local
* resource .
* We consider the ' natural ' form of absolute URLs to be Readers and
* relative URLs to be Strings . Thus , to avoid doing extra work ,
* acquireString ( ) and acquireReader ( ) delegate to one another as
* appropriate . ( Perhaps I could have spelled things out more clearly ,
* but I thought this implementation was instructive , not to mention
* somewhat cute . . . ) */
private String acquireString ( ) throws IOException , JspException { } } | if ( isAbsoluteUrl ) { // for absolute URLs , delegate to our peer
BufferedReader r = new BufferedReader ( acquireReader ( ) ) ; StringBuffer sb = new StringBuffer ( ) ; int i ; // under JIT , testing seems to show this simple loop is as fast
// as any of the alternatives
while ( ( i = r . read ( ) ) != - 1 ) { sb . append ( ( char ) i ) ; } return sb . toString ( ) ; } else { // handle relative URLs ourselves
// URL is relative , so we must be an HTTP request
if ( ! ( pageContext . getRequest ( ) instanceof HttpServletRequest && pageContext . getResponse ( ) instanceof HttpServletResponse ) ) { throw new JspTagException ( Resources . getMessage ( "IMPORT_REL_WITHOUT_HTTP" ) ) ; } // retrieve an appropriate ServletContext
ServletContext c = null ; String targetUrl = targetUrl ( ) ; if ( context != null ) { c = pageContext . getServletContext ( ) . getContext ( context ) ; } else { c = pageContext . getServletContext ( ) ; // normalize the URL if we have an HttpServletRequest
if ( ! targetUrl . startsWith ( "/" ) ) { String sp = ( ( HttpServletRequest ) pageContext . getRequest ( ) ) . getServletPath ( ) ; targetUrl = sp . substring ( 0 , sp . lastIndexOf ( '/' ) ) + '/' + targetUrl ; } } if ( c == null ) { throw new JspTagException ( Resources . getMessage ( "IMPORT_REL_WITHOUT_DISPATCHER" , context , targetUrl ) ) ; } // from this context , get a dispatcher
RequestDispatcher rd = c . getRequestDispatcher ( stripSession ( targetUrl ) ) ; if ( rd == null ) { throw new JspTagException ( stripSession ( targetUrl ) ) ; } // Wrap the response so we capture the capture the output .
// This relies on the underlying container to return content even if this is a HEAD
// request . Some containers ( e . g . Tomcat versions without the fix for
// https : / / bz . apache . org / bugzilla / show _ bug . cgi ? id = 57601 ) may not do that .
ImportResponseWrapper irw = new ImportResponseWrapper ( ( HttpServletResponse ) pageContext . getResponse ( ) ) ; // spec mandates specific error handling from include ( )
try { rd . include ( pageContext . getRequest ( ) , irw ) ; } catch ( IOException ex ) { throw new JspException ( ex ) ; } catch ( RuntimeException ex ) { throw new JspException ( ex ) ; } catch ( ServletException ex ) { Throwable rc = ex . getRootCause ( ) ; while ( rc instanceof ServletException ) { rc = ( ( ServletException ) rc ) . getRootCause ( ) ; } if ( rc == null ) { throw new JspException ( ex ) ; } else { throw new JspException ( rc ) ; } } // disallow inappropriate response codes per JSTL spec
if ( irw . getStatus ( ) < 200 || irw . getStatus ( ) > 299 ) { throw new JspTagException ( irw . getStatus ( ) + " " + stripSession ( targetUrl ) ) ; } // recover the response String from our wrapper
return irw . getString ( ) ; } |
public class DSResultIterator { /** * ( non - Javadoc )
* @ see com . impetus . client . cassandra . query . ResultIterator # hasNext ( ) */
@ Override public boolean hasNext ( ) { } } | if ( fetchSize != 0 && ( count % fetchSize ) == 0 ) { try { results = populateEntities ( entityMetadata , client ) ; count = 0 ; } catch ( Exception e ) { throw new PersistenceException ( "Error while scrolling over results, Caused by :." , e ) ; } } if ( results != null && ! results . isEmpty ( ) && count < results . size ( ) ) { return true ; } return false ; |
public class NodeRule { /** * Creates an accessor that returns the unwrapped variable . */
protected final MethodSpec newGetter ( Strength strength , TypeName varType , String varName , Visibility visibility ) { } } | MethodSpec . Builder getter = MethodSpec . methodBuilder ( "get" + capitalize ( varName ) ) . addModifiers ( context . publicFinalModifiers ( ) ) . returns ( varType ) ; String type ; if ( varType . isPrimitive ( ) ) { type = varType . equals ( TypeName . INT ) ? "Int" : "Long" ; } else { type = "Object" ; } if ( strength == Strength . STRONG ) { if ( visibility . isRelaxed ) { if ( varType . isPrimitive ( ) ) { getter . addStatement ( "return $T.UNSAFE.get$N(this, $N)" , UNSAFE_ACCESS , type , offsetName ( varName ) ) ; } else { getter . addStatement ( "return ($T) $T.UNSAFE.get$N(this, $N)" , varType , UNSAFE_ACCESS , type , offsetName ( varName ) ) ; } } else { getter . addStatement ( "return $N" , varName ) ; } } else { if ( visibility . isRelaxed ) { getter . addStatement ( "return (($T<$T>) $T.UNSAFE.get$N(this, $N)).get()" , Reference . class , varType , UNSAFE_ACCESS , type , offsetName ( varName ) ) ; } else { getter . addStatement ( "return $N.get()" , varName ) ; } } return getter . build ( ) ; |
public class Page { /** * Returns the set of pages that are linked from this page . Outlinks in a page might also point
* to non - existing pages . They are not included in the result set . < b > Warning : < / b > Do not use
* this for getting the number of outlinks with { @ link Page # getOutlinks ( ) } . size ( ) . This is too slow . Use
* { @ link Page # getNumberOfOutlinks ( ) } instead .
* @ return The set of pages that are linked from this page . */
public Set < Page > getOutlinks ( ) { } } | Session session = wiki . __getHibernateSession ( ) ; session . beginTransaction ( ) ; // session . lock ( hibernatePage , LockMode . NONE ) ;
session . buildLockRequest ( LockOptions . NONE ) . lock ( hibernatePage ) ; // Have to copy links here since getPage later will close the session .
Set < Integer > tmpSet = new UnmodifiableArraySet < Integer > ( hibernatePage . getOutLinks ( ) ) ; session . getTransaction ( ) . commit ( ) ; Set < Page > pages = new HashSet < Page > ( ) ; for ( int pageID : tmpSet ) { try { pages . add ( wiki . getPage ( pageID ) ) ; } catch ( WikiApiException e ) { // Silently ignore if a page could not be found .
// There may be outlinks pointing to non - existing pages .
} } return pages ; |
public class ArchiveBase { /** * { @ inheritDoc }
* @ see org . jboss . shrinkwrap . api . Archive # move ( org . jboss . shrinkwrap . api . ArchivePath , org . jboss . shrinkwrap . api . ArchivePath ) */
@ Override public T move ( ArchivePath source , ArchivePath target ) throws IllegalArgumentException , IllegalArchivePathException { } } | Validate . notNull ( source , "The source path was not specified" ) ; Validate . notNull ( target , "The target path was not specified" ) ; final Node nodeToMove = get ( source ) ; if ( null == nodeToMove ) { throw new IllegalArchivePathException ( source . get ( ) + " doesn't specify any node in the archive to move" ) ; } final Asset asset = nodeToMove . getAsset ( ) ; // Directory ?
if ( asset == null ) { this . addAsDirectory ( target ) ; } else { add ( asset , target ) ; } // move children
final Set < Node > nodeToMoveChildren = nodeToMove . getChildren ( ) ; for ( final Node child : nodeToMoveChildren ) { final String childName = child . getPath ( ) . get ( ) . replaceFirst ( child . getPath ( ) . getParent ( ) . get ( ) , "" ) ; final ArchivePath childTargetPath = ArchivePaths . create ( target , childName ) ; move ( child . getPath ( ) , childTargetPath ) ; } delete ( source ) ; return covariantReturn ( ) ; |
public class MetricQuery { /** * Returns the TSDB metric name .
* @ return The TSDB metric name . */
@ JsonIgnore public String getTSDBMetricName ( ) { } } | StringBuilder sb = new StringBuilder ( ) ; sb . append ( getMetric ( ) ) . append ( DefaultTSDBService . DELIMITER ) . append ( getScope ( ) ) ; if ( _namespace != null && ! _namespace . isEmpty ( ) ) { sb . append ( DefaultTSDBService . DELIMITER ) . append ( getNamespace ( ) ) ; } return sb . toString ( ) ; |
public class DefaultGroovyMethods { /** * Iterates through this aggregate Object transforming each item into a new value using the
* < code > transform < / code > closure , returning a list of transformed values .
* Example :
* < pre class = " groovyTestCase " > def list = [ 1 , ' a ' , 1.23 , true ]
* def types = list . collect { it . class }
* assert types = = [ Integer , String , BigDecimal , Boolean ] < / pre >
* @ param self an aggregate Object with an Iterator returning its items
* @ param transform the closure used to transform each item of the aggregate object
* @ return a List of the transformed values
* @ since 1.0 */
public static < T > List < T > collect ( Object self , Closure < T > transform ) { } } | return ( List < T > ) collect ( self , new ArrayList < T > ( ) , transform ) ; |
public class ViewpointsAndPerspectivesDocumentationTemplate { /** * Adds an " Architectural Views " section relating to a { @ link SoftwareSystem } from one or more files .
* @ param softwareSystem the { @ link SoftwareSystem } the documentation content relates to
* @ param files one or more File objects that point to the documentation content
* @ return a documentation { @ link Section }
* @ throws IOException if there is an error reading the files */
public Section addArchitecturalViewsSection ( SoftwareSystem softwareSystem , File ... files ) throws IOException { } } | return addSection ( softwareSystem , "Architectural Views" , files ) ; |
public class DistributedObjectCacheAdapter { /** * Returns < tt > true < / tt > if this map contains a mapping for the specified
* key .
* @ param key key whose presence in this map is to be tested .
* @ param includeDiskCache true to check the specified key contained in the memory or disk
* maps ; false to check the specified key contained in the memory map .
* @ return < tt > true < / tt > if this map contains a mapping for the specified
* key .
* @ throws ClassCastException if the key is of an inappropriate type for
* this map .
* @ throws NullPointerException if the key is < tt > null < / tt > and this map
* does not not permit < tt > null < / tt > keys . */
@ Override final public boolean containsKey ( Object key ) { } } | ValidateUtility . objectNotNull ( key , "key" ) ; // return get ( key ) ! = null ;
return cache . containsCacheId ( key ) ; |
public class JCRCommandHelper { /** * traverses incoming node trying to find primary nt : resource node
* @ param node
* @ return nt : resource node
* @ throws ItemNotFoundException
* if no such node found
* @ throws RepositoryException */
public static Node getNtResourceRecursively ( Node node ) throws ItemNotFoundException , RepositoryException { } } | if ( node . isNodeType ( "nt:resource" ) ) return node ; Item pi = node . getPrimaryItem ( ) ; if ( pi . isNode ( ) ) { return getNtResourceRecursively ( ( Node ) pi ) ; } throw new ItemNotFoundException ( "No nt:resource node found for " + node . getPath ( ) ) ; |
public class TimeZone { /** * Return a new String array containing all system TimeZone IDs
* associated with the given country . These IDs may be passed to
* < code > get ( ) < / code > to construct the corresponding TimeZone
* object .
* @ param country a two - letter ISO 3166 country code , or < code > null < / code >
* to return zones not associated with any country
* @ return an array of IDs for system TimeZones in the given
* country . If there are none , return a zero - length array .
* @ see # getAvailableIDs ( SystemTimeZoneType , String , Integer ) */
public static String [ ] getAvailableIDs ( String country ) { } } | Set < String > ids = getAvailableIDs ( SystemTimeZoneType . ANY , country , null ) ; return ids . toArray ( new String [ 0 ] ) ; |
public class XNumberLiteralImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case XbasePackage . XNUMBER_LITERAL__VALUE : setValue ( VALUE_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class MCFImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . MCF__RG : getRG ( ) . clear ( ) ; getRG ( ) . addAll ( ( Collection < ? extends MCFRG > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class SeaGlassTabbedPaneUI { /** * Create a SynthContext for the component , subregion , and state .
* @ param c the component .
* @ param subregion the subregion .
* @ param state the state .
* @ return the newly created SynthContext . */
private SeaGlassContext getContext ( JComponent c , Region subregion , int state ) { } } | SynthStyle style = null ; Class klass = SeaGlassContext . class ; if ( subregion == Region . TABBED_PANE_TAB ) { style = tabStyle ; } else if ( subregion == Region . TABBED_PANE_TAB_AREA ) { style = tabAreaStyle ; } else if ( subregion == Region . TABBED_PANE_CONTENT ) { style = tabContentStyle ; } else if ( subregion == SeaGlassRegion . TABBED_PANE_TAB_CLOSE_BUTTON ) { style = tabCloseStyle ; } return SeaGlassContext . getContext ( klass , c , subregion , style , state ) ; |
public class Profile { /** * 将前后缀去除后 , 中间的 . 替换为 / < br >
* 不以 / 开始 。
* @ param className */
public String getInfix ( String className ) { } } | String postfix = getActionSuffix ( ) ; String simpleName = className . substring ( className . lastIndexOf ( '.' ) + 1 ) ; if ( Strings . contains ( simpleName , postfix ) ) { simpleName = Strings . uncapitalize ( simpleName . substring ( 0 , simpleName . length ( ) - postfix . length ( ) ) ) ; } else { simpleName = Strings . uncapitalize ( simpleName ) ; } MatchInfo match = getCtlMatchInfo ( className ) ; StringBuilder infix = new StringBuilder ( match . getReserved ( ) . toString ( ) ) ; if ( infix . length ( ) > 0 ) infix . append ( '.' ) ; String remainder = Strings . substringBeforeLast ( className , "." ) . substring ( match . getStartIndex ( ) + 1 ) ; if ( remainder . length ( ) > 0 ) { if ( '.' == remainder . charAt ( 0 ) ) remainder = remainder . substring ( 1 ) ; infix . append ( remainder ) . append ( '.' ) ; } if ( infix . length ( ) == 0 ) return simpleName ; infix . append ( simpleName ) ; // 将 . 替换成 /
for ( int i = 0 ; i < infix . length ( ) ; i ++ ) { if ( infix . charAt ( i ) == '.' ) infix . setCharAt ( i , '/' ) ; } return infix . toString ( ) ; |
public class AmazonKinesisClient { /** * To deregister a consumer , provide its ARN . Alternatively , you can provide the ARN of the data stream and the name
* you gave the consumer when you registered it . You may also provide all three parameters , as long as they don ' t
* conflict with each other . If you don ' t know the name or ARN of the consumer that you want to deregister , you can
* use the < a > ListStreamConsumers < / a > operation to get a list of the descriptions of all the consumers that are
* currently registered with a given data stream . The description of a consumer contains its name and ARN .
* This operation has a limit of five transactions per second per account .
* @ param deregisterStreamConsumerRequest
* @ return Result of the DeregisterStreamConsumer operation returned by the service .
* @ throws LimitExceededException
* The requested resource exceeds the maximum number allowed , or the number of concurrent stream requests
* exceeds the maximum number allowed .
* @ throws ResourceNotFoundException
* The requested resource could not be found . The stream might not be specified correctly .
* @ throws InvalidArgumentException
* A specified parameter exceeds its restrictions , is not supported , or can ' t be used . For more information ,
* see the returned message .
* @ sample AmazonKinesis . DeregisterStreamConsumer
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / kinesis - 2013-12-02 / DeregisterStreamConsumer "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DeregisterStreamConsumerResult deregisterStreamConsumer ( DeregisterStreamConsumerRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeDeregisterStreamConsumer ( request ) ; |
public class Join { /** * A replacement for Java 8 ' s String . join ( ) .
* @ param sep
* The separator string .
* @ param iterable
* The { @ link Iterable } to join .
* @ return The string representation of the joined elements . */
public static String join ( final String sep , final Iterable < ? > iterable ) { } } | final StringBuilder buf = new StringBuilder ( ) ; join ( buf , "" , sep , "" , iterable ) ; return buf . toString ( ) ; |
public class AwsSecurityFinding { /** * Threat intel details related to a finding .
* @ param threatIntelIndicators
* Threat intel details related to a finding . */
public void setThreatIntelIndicators ( java . util . Collection < ThreatIntelIndicator > threatIntelIndicators ) { } } | if ( threatIntelIndicators == null ) { this . threatIntelIndicators = null ; return ; } this . threatIntelIndicators = new java . util . ArrayList < ThreatIntelIndicator > ( threatIntelIndicators ) ; |
public class MaskUtil { /** * Return the mask bit for " getMaskPattern " at " x " and " y " . See 8.8 of JISX0510:2004 for mask
* pattern conditions . */
static boolean getDataMaskBit ( int maskPattern , int x , int y ) { } } | int intermediate ; int temp ; switch ( maskPattern ) { case 0 : intermediate = ( y + x ) & 0x1 ; break ; case 1 : intermediate = y & 0x1 ; break ; case 2 : intermediate = x % 3 ; break ; case 3 : intermediate = ( y + x ) % 3 ; break ; case 4 : intermediate = ( ( y / 2 ) + ( x / 3 ) ) & 0x1 ; break ; case 5 : temp = y * x ; intermediate = ( temp & 0x1 ) + ( temp % 3 ) ; break ; case 6 : temp = y * x ; intermediate = ( ( temp & 0x1 ) + ( temp % 3 ) ) & 0x1 ; break ; case 7 : temp = y * x ; intermediate = ( ( temp % 3 ) + ( ( y + x ) & 0x1 ) ) & 0x1 ; break ; default : throw new IllegalArgumentException ( "Invalid mask pattern: " + maskPattern ) ; } return intermediate == 0 ; |
public class HadoopUtils { /** * Utility for doing ctx . getCounter ( groupName ,
* counter . toString ( ) ) . increment ( 1 ) ; */
@ SuppressWarnings ( "rawtypes" ) public static void incCounter ( TaskInputOutputContext ctx , String groupName , Enum counter ) { } } | ctx . getCounter ( groupName , counter . toString ( ) ) . increment ( 1 ) ; |
public class CommerceOrderItemUtil { /** * Returns the last commerce order item in the ordered set where commerceOrderId = & # 63 ; and CPInstanceId = & # 63 ; .
* @ param commerceOrderId the commerce order ID
* @ param CPInstanceId the cp instance ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching commerce order item , or < code > null < / code > if a matching commerce order item could not be found */
public static CommerceOrderItem fetchByC_I_Last ( long commerceOrderId , long CPInstanceId , OrderByComparator < CommerceOrderItem > orderByComparator ) { } } | return getPersistence ( ) . fetchByC_I_Last ( commerceOrderId , CPInstanceId , orderByComparator ) ; |
public class CmsRoleManager { /** * Adds a user to the given role . < p >
* @ param cms the opencms context
* @ param role the role
* @ param username the name of the user that is to be added to the role
* @ throws CmsException if something goes wrong */
public void addUserToRole ( CmsObject cms , CmsRole role , String username ) throws CmsException { } } | m_securityManager . addUserToGroup ( cms . getRequestContext ( ) , username , role . getGroupName ( ) , true ) ; |
public class ConnectionPool { /** * Closes an unumanged connection .
* @ param conn The conneciton .
* @ throws SQLException If close fails . */
public final void closeUnmanagedConnection ( final Connection conn ) throws SQLException { } } | activeUnmanagedConnections . dec ( ) ; if ( ! conn . isClosed ( ) ) { conn . close ( ) ; } |
public class CATProxyConsumer { /** * Send the entire message in one big buffer . If the messageSlices parameter is not null then
* the message has already been encoded and does not need to be done again . This may be in the
* case where the message was destined to be sent in chunks but is so small that it does not
* seem worth it .
* @ param sibMessage The entire message to send .
* @ param messageSlices The already encoded message slices .
* @ return Returns the length of the message sent to the client .
* @ throws MessageCopyFailedException
* @ throws IncorrectMessageTypeException
* @ throws MessageEncodeFailedException
* @ throws UnsupportedEncodingException */
private int sendEntireMessage ( SIBusMessage sibMessage , List < DataSlice > messageSlices ) throws MessageCopyFailedException , IncorrectMessageTypeException , MessageEncodeFailedException , UnsupportedEncodingException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendEntireMessage" , new Object [ ] { sibMessage , messageSlices } ) ; int msgLen = 0 ; try { CommsServerByteBuffer buffer = poolManager . allocate ( ) ; ConversationState convState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; buffer . putShort ( convState . getConnectionObjectId ( ) ) ; buffer . putShort ( mainConsumer . getClientSessionId ( ) ) ; buffer . putShort ( mainConsumer . getMessageBatchNumber ( ) ) ; // BIT16 Message batch
// Put the entire message into the buffer in whatever way is suitable
if ( messageSlices == null ) { msgLen = buffer . putMessage ( ( JsMessage ) sibMessage , convState . getCommsConnection ( ) , getConversation ( ) ) ; } else { msgLen = buffer . putMessgeWithoutEncode ( messageSlices ) ; } short jfapPriority = JFapChannelConstants . getJFAPPriority ( sibMessage . getPriority ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Sending with JFAP priority of " + jfapPriority ) ; getConversation ( ) . send ( buffer , JFapChannelConstants . SEG_PROXY_MESSAGE , 0 , // No request number
jfapPriority , false , ThrottlingPolicy . BLOCK_THREAD , INVALIDATE_CONNECTION_ON_ERROR ) ; messagesSent ++ ; } catch ( SIException e1 ) { FFDCFilter . processException ( e1 , CLASS_NAME + ".sendEntireMessage" , CommsConstants . CATPROXYCONSUMER_SEND_MSG_01 , this ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2014" , e1 ) ; msgLen = 0 ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendEntireMessage" , msgLen ) ; return msgLen ; |
public class AttachmentMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Attachment attachment , ProtocolMarshaller protocolMarshaller ) { } } | if ( attachment == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( attachment . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( attachment . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( attachment . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( attachment . getDetails ( ) , DETAILS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class CustomerNoteUrl { /** * Get Resource Url for GetAccountNotes
* @ param accountId Unique identifier of the customer account .
* @ param filter A set of filter expressions representing the search parameters for a query . This parameter is optional . Refer to [ Sorting and Filtering ] ( . . / . . / . . / . . / Developer / api - guides / sorting - filtering . htm ) for a list of supported filters .
* @ param pageSize When creating paged results from a query , this value indicates the zero - based offset in the complete result set where the returned entities begin . For example , with this parameter set to 25 , to get the 51st through the 75th items , set startIndex to 50.
* @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This parameter should only be used to retrieve data . Attempting to update data using this parameter may cause data loss .
* @ param sortBy The element to sort the results by and the channel in which the results appear . Either ascending ( a - z ) or descending ( z - a ) channel . Optional . Refer to [ Sorting and Filtering ] ( . . / . . / . . / . . / Developer / api - guides / sorting - filtering . htm ) for more information .
* @ param startIndex When creating paged results from a query , this value indicates the zero - based offset in the complete result set where the returned entities begin . For example , with pageSize set to 25 , to get the 51st through the 75th items , set this parameter to 50.
* @ return String Resource Url */
public static MozuUrl getAccountNotesUrl ( Integer accountId , String filter , Integer pageSize , String responseFields , String sortBy , Integer startIndex ) { } } | UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/accounts/{accountId}/notes?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&responseFields={responseFields}" ) ; formatter . formatUrl ( "accountId" , accountId ) ; formatter . formatUrl ( "filter" , filter ) ; formatter . formatUrl ( "pageSize" , pageSize ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "sortBy" , sortBy ) ; formatter . formatUrl ( "startIndex" , startIndex ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; |
public class WrappedRecordReader { /** * Skip key - value pairs with keys less than or equal to the key provided . */
public void skip ( K key ) throws IOException { } } | if ( hasNext ( ) ) { while ( cmp . compare ( khead , key ) <= 0 && next ( ) ) ; } |
public class TarEntry { /** * Parse an entry ' s TarHeader information from a header buffer .
* Old unix - style code contributed by David Mehringer < dmehring @ astro . uiuc . edu > .
* @ param hdr
* The TarHeader to fill in from the buffer information .
* @ param header
* The tar entry header buffer to get information from . */
public void parseTarHeader ( TarHeader hdr , byte [ ] headerBuf ) throws InvalidHeaderException { } } | int offset = 0 ; // NOTE Recognize archive header format .
if ( headerBuf [ 257 ] == 0 && headerBuf [ 258 ] == 0 && headerBuf [ 259 ] == 0 && headerBuf [ 260 ] == 0 && headerBuf [ 261 ] == 0 ) { this . unixFormat = true ; this . ustarFormat = false ; this . gnuFormat = false ; } else if ( headerBuf [ 257 ] == 'u' && headerBuf [ 258 ] == 's' && headerBuf [ 259 ] == 't' && headerBuf [ 260 ] == 'a' && headerBuf [ 261 ] == 'r' && headerBuf [ 262 ] == 0 ) { this . ustarFormat = true ; this . gnuFormat = false ; this . unixFormat = false ; } else if ( headerBuf [ 257 ] == 'u' && headerBuf [ 258 ] == 's' && headerBuf [ 259 ] == 't' && headerBuf [ 260 ] == 'a' && headerBuf [ 261 ] == 'r' && headerBuf [ 262 ] != 0 && headerBuf [ 263 ] != 0 ) { // REVIEW
this . gnuFormat = true ; this . unixFormat = false ; this . ustarFormat = false ; } else { StringBuffer buf = new StringBuffer ( 128 ) ; buf . append ( "header magic is not 'ustar' or unix-style zeros, it is '" ) ; buf . append ( headerBuf [ 257 ] ) ; buf . append ( headerBuf [ 258 ] ) ; buf . append ( headerBuf [ 259 ] ) ; buf . append ( headerBuf [ 260 ] ) ; buf . append ( headerBuf [ 261 ] ) ; buf . append ( headerBuf [ 262 ] ) ; buf . append ( headerBuf [ 263 ] ) ; buf . append ( "', or (dec) " ) ; buf . append ( ( int ) headerBuf [ 257 ] ) ; buf . append ( ", " ) ; buf . append ( ( int ) headerBuf [ 258 ] ) ; buf . append ( ", " ) ; buf . append ( ( int ) headerBuf [ 259 ] ) ; buf . append ( ", " ) ; buf . append ( ( int ) headerBuf [ 260 ] ) ; buf . append ( ", " ) ; buf . append ( ( int ) headerBuf [ 261 ] ) ; buf . append ( ", " ) ; buf . append ( ( int ) headerBuf [ 262 ] ) ; buf . append ( ", " ) ; buf . append ( ( int ) headerBuf [ 263 ] ) ; throw new InvalidHeaderException ( buf . toString ( ) ) ; } hdr . name = TarHeader . parseFileName ( headerBuf ) ; offset = TarHeader . NAMELEN ; hdr . mode = ( int ) TarHeader . parseOctal ( headerBuf , offset , TarHeader . MODELEN ) ; offset += TarHeader . MODELEN ; hdr . userId = ( int ) TarHeader . parseOctal ( headerBuf , offset , TarHeader . UIDLEN ) ; offset += TarHeader . UIDLEN ; hdr . groupId = ( int ) TarHeader . parseOctal ( headerBuf , offset , TarHeader . GIDLEN ) ; offset += TarHeader . GIDLEN ; hdr . size = TarHeader . parseOctal ( headerBuf , offset , TarHeader . SIZELEN ) ; offset += TarHeader . SIZELEN ; hdr . modTime = TarHeader . parseOctal ( headerBuf , offset , TarHeader . MODTIMELEN ) ; offset += TarHeader . MODTIMELEN ; hdr . checkSum = ( int ) TarHeader . parseOctal ( headerBuf , offset , TarHeader . CHKSUMLEN ) ; offset += TarHeader . CHKSUMLEN ; hdr . linkFlag = headerBuf [ offset ++ ] ; hdr . linkName = TarHeader . parseName ( headerBuf , offset , TarHeader . NAMELEN ) ; offset += TarHeader . NAMELEN ; if ( this . ustarFormat ) { hdr . magic = TarHeader . parseName ( headerBuf , offset , TarHeader . MAGICLEN ) ; offset += TarHeader . MAGICLEN ; hdr . userName = TarHeader . parseName ( headerBuf , offset , TarHeader . UNAMELEN ) ; offset += TarHeader . UNAMELEN ; hdr . groupName = TarHeader . parseName ( headerBuf , offset , TarHeader . GNAMELEN ) ; offset += TarHeader . GNAMELEN ; hdr . devMajor = ( int ) TarHeader . parseOctal ( headerBuf , offset , TarHeader . DEVLEN ) ; offset += TarHeader . DEVLEN ; hdr . devMinor = ( int ) TarHeader . parseOctal ( headerBuf , offset , TarHeader . DEVLEN ) ; } else { hdr . devMajor = 0 ; hdr . devMinor = 0 ; hdr . magic = new StringBuffer ( "" ) ; hdr . userName = new StringBuffer ( "" ) ; hdr . groupName = new StringBuffer ( "" ) ; } |
public class PluginContext { /** * { @ inheritDoc } */
@ Override public URL getResource ( String path ) { } } | if ( mResourceFactory == null ) { return null ; } return mResourceFactory . getResource ( path ) ; |
public class XMLProperties { /** * Creates an object from the given class ' single argument constructor .
* @ return The object created from the constructor .
* If the constructor could not be invoked for any reason , null is
* returned . */
private Object createInstance ( Class pClass , Object pParam ) { } } | Object value ; try { // Create param and argument arrays
Class [ ] param = { pParam . getClass ( ) } ; Object [ ] arg = { pParam } ; // Get constructor
Constructor constructor = pClass . getDeclaredConstructor ( param ) ; // Invoke and create instance
value = constructor . newInstance ( arg ) ; } catch ( Exception e ) { return null ; } return value ; |
public class Cache { /** * / / / / / Transactions / / / / / */
public Transaction beginTransaction ( ) { } } | Transaction txn = new Transaction ( rollbackSupported ) ; LOG . debug ( "Starting transaction: {}" , txn ) ; return txn ; |
public class CmsEditableGroup { /** * Moves the given row up .
* @ param row the row to move */
public void moveUp ( I_CmsEditableGroupRow row ) { } } | int index = m_container . getComponentIndex ( row ) ; if ( index > 0 ) { m_container . removeComponent ( row ) ; m_container . addComponent ( row , index - 1 ) ; } updateButtonBars ( ) ; |
public class AbstractTwoPassStream { /** * closes the outputstream and calls { @ link # secondPass ( java . io . OutputStream ) } with the original outputstream . Note
* that the original outputstream may be null when a subclass did not call { @ link # setOut ( java . io . OutputStream ) }
* @ throws IOException */
@ Override public final void close ( ) throws IOException { } } | out . close ( ) ; if ( orig != null ) { secondPass ( new BufferedInputStream ( new FileInputStream ( tempFile ) , bufferSize ) , orig ) ; tempFile . delete ( ) ; } |
public class BootstrapProgressBar { /** * Creates a Bitmap which is a tile of the progress bar background
* @ param h the view height
* @ return a bitmap of the progress bar background */
private static Bitmap createTile ( float h , Paint stripePaint , Paint progressPaint ) { } } | Bitmap bm = Bitmap . createBitmap ( ( int ) h * 2 , ( int ) h , ARGB_8888 ) ; Canvas tile = new Canvas ( bm ) ; float x = 0 ; Path path = new Path ( ) ; path . moveTo ( x , 0 ) ; path . lineTo ( x , h ) ; path . lineTo ( h , h ) ; tile . drawPath ( path , stripePaint ) ; // draw striped triangle
path . reset ( ) ; path . moveTo ( x , 0 ) ; path . lineTo ( x + h , h ) ; path . lineTo ( x + ( h * 2 ) , h ) ; path . lineTo ( x + h , 0 ) ; tile . drawPath ( path , progressPaint ) ; // draw progress parallelogram
x += h ; path . reset ( ) ; path . moveTo ( x , 0 ) ; path . lineTo ( x + h , 0 ) ; path . lineTo ( x + h , h ) ; tile . drawPath ( path , stripePaint ) ; // draw striped triangle ( completing tile )
return bm ; |
public class EntityRecognizerMetadata { /** * Entity types from the metadata of an entity recognizer .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setEntityTypes ( java . util . Collection ) } or { @ link # withEntityTypes ( java . util . Collection ) } if you want to
* override the existing values .
* @ param entityTypes
* Entity types from the metadata of an entity recognizer .
* @ return Returns a reference to this object so that method calls can be chained together . */
public EntityRecognizerMetadata withEntityTypes ( EntityRecognizerMetadataEntityTypesListItem ... entityTypes ) { } } | if ( this . entityTypes == null ) { setEntityTypes ( new java . util . ArrayList < EntityRecognizerMetadataEntityTypesListItem > ( entityTypes . length ) ) ; } for ( EntityRecognizerMetadataEntityTypesListItem ele : entityTypes ) { this . entityTypes . add ( ele ) ; } return this ; |
public class PartialUniqueIndex { /** * Removes all mappings from this map . */
public void clear ( ) { } } | // clear out ref queue . We don ' t need to expunge entries
// since table is getting cleared .
emptySoftQueue ( ) ; Entry tab [ ] = table ; for ( int i = 0 ; i < tab . length ; ++ i ) tab [ i ] = null ; size = 0 ; // Allocation of array may have caused GC , which may have caused
// additional entries to go stale . Removing these entries from the
// reference queue will make them eligible for reclamation .
emptySoftQueue ( ) ; |
public class GhostMe { /** * Apply Proxy
* @ param use Proxy to use */
public static void applyProxy ( Proxy use ) { } } | System . setProperty ( "java.net.useSystemProxies" , "false" ) ; System . setProperty ( "http.proxyHost" , use . getIp ( ) ) ; System . setProperty ( "http.proxyPort" , String . valueOf ( use . getPort ( ) ) ) ; System . setProperty ( "https.proxyHost" , use . getIp ( ) ) ; System . setProperty ( "https.proxyPort" , String . valueOf ( use . getPort ( ) ) ) ; |
public class InMemoryEngine { /** * { @ inheritDoc } */
@ Override public < T extends Serializable > void saveObject ( String name , T serializableObject ) { } } | assertConnectionOpen ( ) ; try { Path rootPath = getRootPath ( storageName ) ; createDirectoryIfNotExists ( rootPath ) ; Path objectPath = new File ( rootPath . toFile ( ) , name ) . toPath ( ) ; Files . write ( objectPath , DeepCopy . serialize ( serializableObject ) ) ; } catch ( IOException ex ) { throw new UncheckedIOException ( ex ) ; } catalog . put ( name , new WeakReference < > ( serializableObject ) ) ; |
public class HelloSignClient { /** * Updates the API app with the given ApiApp object properties .
* @ param app ApiApp
* @ return ApiApp updated ApiApp
* @ throws HelloSignException thrown if there ' s a problem processing the
* HTTP request or the JSON response . */
public ApiApp updateApiApp ( ApiApp app ) throws HelloSignException { } } | if ( ! app . hasClientId ( ) ) { throw new HelloSignException ( "Cannot update an ApiApp without a client ID. Create one first!" ) ; } String url = BASE_URI + API_APP_URI + "/" + app . getClientId ( ) ; return new ApiApp ( httpClient . withAuth ( auth ) . withPostFields ( app . getPostFields ( ) ) . post ( url ) . asJson ( ) ) ; |
public class EventClient { /** * Sends a synchronous get event request to the API .
* @ param eid ID of the event to get
* @ throws ExecutionException indicates an error in the HTTP backend
* @ throws InterruptedException indicates an interruption during the HTTP operation
* @ throws IOException indicates an error from the API response */
public Event getEvent ( String eid ) throws ExecutionException , InterruptedException , IOException { } } | return getEvent ( getEventAsFuture ( eid ) ) ; |
public class ModelsImpl { /** * Gets all custom prebuilt models information of this application .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the List & lt ; CustomPrebuiltModel & gt ; object */
public Observable < ServiceResponse < List < CustomPrebuiltModel > > > listCustomPrebuiltModelsWithServiceResponseAsync ( UUID appId , String versionId ) { } } | if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgumentException ( "Parameter versionId is required and cannot be null." ) ; } String parameterizedHost = Joiner . on ( ", " ) . join ( "{Endpoint}" , this . client . endpoint ( ) ) ; return service . listCustomPrebuiltModels ( appId , versionId , this . client . acceptLanguage ( ) , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < List < CustomPrebuiltModel > > > > ( ) { @ Override public Observable < ServiceResponse < List < CustomPrebuiltModel > > > call ( Response < ResponseBody > response ) { try { ServiceResponse < List < CustomPrebuiltModel > > clientResponse = listCustomPrebuiltModelsDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
public class AbstractRadial { /** * Sets the type of the pointer
* @ param POINTER _ TYPE type of the pointer
* PointerType . TYPE1 ( default )
* PointerType . TYPE2
* PointerType . TYPE3
* PointerType . TYPE4 */
public void setPointerType ( final PointerType POINTER_TYPE ) { } } | getModel ( ) . setPointerType ( POINTER_TYPE ) ; init ( getInnerBounds ( ) . width , getInnerBounds ( ) . height ) ; repaint ( getInnerBounds ( ) ) ; |
public class PyExpressionGenerator { /** * Generate the given object .
* @ param literal the boolean literal .
* @ param it the target for the generated content .
* @ param context the context .
* @ return the literal . */
@ SuppressWarnings ( "static-method" ) protected XExpression _generate ( XBooleanLiteral literal , IAppendable it , IExtraLanguageGeneratorContext context ) { } } | appendReturnIfExpectedReturnedExpression ( it , context ) ; it . append ( literal . isIsTrue ( ) ? "True" : "False" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $
return literal ; |
public class PatternToken { /** * Tests whether the string token element matches a given token .
* @ param token { @ link AnalyzedToken } to match against .
* @ return True if matches . */
private boolean isStringTokenMatched ( AnalyzedToken token ) { } } | String testToken = getTestToken ( token ) ; if ( stringRegExp ) { Matcher m = pattern . matcher ( new InterruptibleCharSequence ( testToken ) ) ; return m . matches ( ) ; } if ( caseSensitive ) { return stringToken . equals ( testToken ) ; } return stringToken . equalsIgnoreCase ( testToken ) ; |
public class Connector { /** * Helper method that creates a { @ link Path } object from a parent path and a child path string . This is equivalent to calling
* " < code > pathFactory ( ) . create ( parentPath , childPath ) < / code > " , and is simply provided for convenience .
* @ param parentPath the parent path
* @ param childPath the child path as a string
* @ return the value , or null if the supplied string is null
* @ throws ValueFormatException if the conversion from a string could not be performed
* @ see PathFactory # create ( String )
* @ see # pathFrom ( String ) */
protected final Path pathFrom ( Path parentPath , String childPath ) { } } | Path parent = pathFactory ( ) . create ( parentPath ) ; return pathFactory ( ) . create ( parent , childPath ) ; |
public class DefaultGroovyMethods { /** * Provide a dynamic method invocation method which can be overloaded in
* classes to implement dynamic proxies easily .
* @ param object any Object
* @ param method the name of the method to call
* @ param arguments the arguments to use
* @ return the result of the method call
* @ since 1.0 */
public static Object invokeMethod ( Object object , String method , Object arguments ) { } } | return InvokerHelper . invokeMethod ( object , method , arguments ) ; |
public class LogSender { /** * Sends a group of log messages to Stackify
* @ param group The log message group
* @ return The HTTP status code returned from the HTTP POST
* @ throws IOException */
public int send ( final LogMsgGroup group ) throws IOException { } } | Preconditions . checkNotNull ( group ) ; executeMask ( group ) ; executeSkipJsonTag ( group ) ; HttpClient httpClient = new HttpClient ( apiConfig ) ; // retransmit any logs on the resend queue
resendQueue . drain ( httpClient , LOG_SAVE_PATH , true ) ; // convert to json bytes
byte [ ] jsonBytes = objectMapper . writer ( ) . writeValueAsBytes ( group ) ; // post to stackify
int statusCode = HttpURLConnection . HTTP_INTERNAL_ERROR ; try { httpClient . post ( LOG_SAVE_PATH , jsonBytes , true ) ; statusCode = HttpURLConnection . HTTP_OK ; } catch ( IOException t ) { LOGGER . info ( "Queueing logs for retransmission due to IOException" ) ; resendQueue . offer ( jsonBytes , t ) ; throw t ; } catch ( HttpException e ) { statusCode = e . getStatusCode ( ) ; LOGGER . info ( "Queueing logs for retransmission due to HttpException" , e ) ; resendQueue . offer ( jsonBytes , e ) ; } return statusCode ; |
public class ClassUtils { /** * Returns given object class primitive class or self class . < br >
* if given object class is 8 wrapper class then return primitive class . < br >
* if given object class is null return null .
* @ param object object to be handle .
* @ return given object class primitive class or self class . */
public static Class < ? > getPrimitiveClass ( final Object object ) { } } | if ( object == null ) { return null ; } return getPrimitiveClass ( object . getClass ( ) ) ; |
public class RemoteCommand { /** * Executes the default action of the command with the information provided
* in the Form . This form must be the answer form of the previous stage . If
* there is a problem executing the command it throws an XMPPException .
* @ param form the form answer of the previous stage .
* @ throws XMPPErrorException if an error occurs .
* @ throws NoResponseException if there was no response from the server .
* @ throws NotConnectedException
* @ throws InterruptedException */
public void execute ( Form form ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } } | executeAction ( Action . execute , form ) ; |
public class ApiOvhEmailmxplan { /** * create new external contact
* REST : POST / email / mxplan / { service } / externalContact
* @ param firstName [ required ] Contact first name
* @ param initials [ required ] Contact initials
* @ param lastName [ required ] Contact last name
* @ param externalEmailAddress [ required ] Contact email address
* @ param hiddenFromGAL [ required ] Hide the contact in Global Address List
* @ param displayName [ required ] Contact display name
* @ param service [ required ] The internal name of your mxplan organization
* API beta */
public OvhTask service_externalContact_POST ( String service , String displayName , String externalEmailAddress , String firstName , Boolean hiddenFromGAL , String initials , String lastName ) throws IOException { } } | String qPath = "/email/mxplan/{service}/externalContact" ; StringBuilder sb = path ( qPath , service ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "displayName" , displayName ) ; addBody ( o , "externalEmailAddress" , externalEmailAddress ) ; addBody ( o , "firstName" , firstName ) ; addBody ( o , "hiddenFromGAL" , hiddenFromGAL ) ; addBody ( o , "initials" , initials ) ; addBody ( o , "lastName" , lastName ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; |
public class nsrpcnode { /** * Use this API to update nsrpcnode resources . */
public static base_responses update ( nitro_service client , nsrpcnode resources [ ] ) throws Exception { } } | base_responses result = null ; if ( resources != null && resources . length > 0 ) { nsrpcnode updateresources [ ] = new nsrpcnode [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new nsrpcnode ( ) ; updateresources [ i ] . ipaddress = resources [ i ] . ipaddress ; updateresources [ i ] . password = resources [ i ] . password ; updateresources [ i ] . srcip = resources [ i ] . srcip ; updateresources [ i ] . secure = resources [ i ] . secure ; } result = update_bulk_request ( client , updateresources ) ; } return result ; |
public class nshttpprofile { /** * Use this API to fetch filtered set of nshttpprofile resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static nshttpprofile [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | nshttpprofile obj = new nshttpprofile ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; nshttpprofile [ ] response = ( nshttpprofile [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class MicronautConsole { /** * Add a shutdown hook . */
public void addShutdownHook ( ) { } } | shutdownHookThread = new Thread ( new Runnable ( ) { @ Override public void run ( ) { beforeShutdown ( ) ; } } ) ; Runtime . getRuntime ( ) . addShutdownHook ( shutdownHookThread ) ; |
public class HtmlPolicyBuilder { /** * Disallows the given elements from appearing without attributes .
* @ see # DEFAULT _ SKIP _ IF _ EMPTY
* @ see # allowWithoutAttributes */
public HtmlPolicyBuilder disallowWithoutAttributes ( String ... elementNames ) { } } | invalidateCompiledState ( ) ; for ( String elementName : elementNames ) { elementName = HtmlLexer . canonicalName ( elementName ) ; skipIfEmpty . add ( elementName ) ; } return this ; |
public class CmsSearchIndexSource { /** * Sets the logical key / name of this search index source . < p >
* @ param name the logical key / name of this search index source
* @ throws CmsIllegalArgumentException if argument name is null , an empty or whitespace - only Strings
* or already used for another indexsource ' s name . */
public void setName ( String name ) throws CmsIllegalArgumentException { } } | if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( name ) ) { throw new CmsIllegalArgumentException ( Messages . get ( ) . container ( Messages . ERR_INDEXSOURCE_CREATE_MISSING_NAME_0 ) ) ; } // already used ? Don ' t test this at xml - configuration time ( no manager )
if ( OpenCms . getRunLevel ( ) > OpenCms . RUNLEVEL_2_INITIALIZING ) { CmsSearchManager mngr = OpenCms . getSearchManager ( ) ; // don ' t test this if the indexsource is not new ( widget invokes setName even if it was not changed )
if ( mngr . getIndexSource ( name ) != this ) { if ( mngr . getSearchIndexSources ( ) . keySet ( ) . contains ( name ) ) { throw new CmsIllegalArgumentException ( Messages . get ( ) . container ( Messages . ERR_INDEXSOURCE_CREATE_INVALID_NAME_1 , name ) ) ; } } } m_name = name ; |
public class Model { /** * Sets the given buffered image as the custom layer of the gauge
* @ param CUSTOM _ LAYER */
public void setCustomLayer ( final BufferedImage CUSTOM_LAYER ) { } } | if ( customLayer != null ) { customLayer . flush ( ) ; } customLayer = CUSTOM_LAYER ; fireStateChanged ( ) ; |
public class AbstractHibernateDao { /** * Get the first element in the list
* @ param list
* @ return null if the list is null or is empty , otherwise the first element of the list */
public static < E > E firstInList ( List < E > list ) { } } | if ( list == null || list . size ( ) == 0 ) { return null ; } else { return list . get ( 0 ) ; } |
public class RuleModelUpgradeHelper2 { /** * Descent into the model */
private void fixConnectiveConstraints ( IPattern p ) { } } | if ( p instanceof FactPattern ) { fixConnectiveConstraints ( ( FactPattern ) p ) ; } else if ( p instanceof CompositeFactPattern ) { fixConnectiveConstraints ( ( CompositeFactPattern ) p ) ; } |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getLocalDateAndTimeStampStampType ( ) { } } | if ( localDateAndTimeStampStampTypeEEnum == null ) { localDateAndTimeStampStampTypeEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 90 ) ; } return localDateAndTimeStampStampTypeEEnum ; |
public class CodeChunkUtils { /** * Outputs a stringified parameter list ( e . g . ` foo , bar , baz ` ) from JsDoc . Used e . g . in function
* and method declarations . */
static String generateParamList ( JsDoc jsDoc ) { } } | ImmutableList < JsDoc . Param > params = jsDoc . params ( ) ; List < String > functionParameters = new ArrayList < > ( ) ; for ( JsDoc . Param param : params ) { if ( "param" . equals ( param . annotationType ( ) ) ) { functionParameters . add ( param . paramTypeName ( ) ) ; } } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < functionParameters . size ( ) ; i ++ ) { sb . append ( functionParameters . get ( i ) ) ; if ( i + 1 < functionParameters . size ( ) ) { sb . append ( ", " ) ; } } return sb . toString ( ) ; |
public class InstanceAdminClient { /** * Lists all instances in the given project .
* < p > Sample code :
* < pre > < code >
* try ( InstanceAdminClient instanceAdminClient = InstanceAdminClient . create ( ) ) {
* ProjectName parent = ProjectName . of ( " [ PROJECT ] " ) ;
* for ( Instance element : instanceAdminClient . listInstances ( parent . toString ( ) ) . iterateAll ( ) ) {
* / / doThingsWith ( element ) ;
* < / code > < / pre >
* @ param parent Required . The name of the project for which a list of instances is requested .
* Values are of the form ` projects / & lt ; project & gt ; ` .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
public final ListInstancesPagedResponse listInstances ( String parent ) { } } | ListInstancesRequest request = ListInstancesRequest . newBuilder ( ) . setParent ( parent ) . build ( ) ; return listInstances ( request ) ; |
public class PoolOperations { /** * Stops a pool resize operation .
* @ param poolId
* The ID of the pool .
* @ param additionalBehaviors
* A collection of { @ link BatchClientBehavior } instances that are
* applied to the Batch service request .
* @ throws BatchErrorException
* Exception thrown when an error response is received from the
* Batch service .
* @ throws IOException
* Exception thrown when there is an error in
* serialization / deserialization of data sent to / received from the
* Batch service . */
public void stopResizePool ( String poolId , Iterable < BatchClientBehavior > additionalBehaviors ) throws BatchErrorException , IOException { } } | PoolStopResizeOptions options = new PoolStopResizeOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; this . parentBatchClient . protocolLayer ( ) . pools ( ) . stopResize ( poolId , options ) ; |
public class CardAPI { /** * 设置自助核销功能
* @ param accessToken accessToken
* @ param cardSet cardSet
* @ return result */
public static BaseResult selfconsumecellSet ( String accessToken , PaySellSet cardSet ) { } } | return selfconsumecellSet ( accessToken , JsonUtil . toJSONString ( cardSet ) ) ; |
public class OpenPgpContact { /** * Mark a key as { @ link OpenPgpStore . Trust # trusted } .
* @ param fingerprint { @ link OpenPgpV4Fingerprint } of the key to mark as trusted .
* @ throws IOException IO error */
public void trust ( OpenPgpV4Fingerprint fingerprint ) throws IOException { } } | store . setTrust ( getJid ( ) , fingerprint , OpenPgpTrustStore . Trust . trusted ) ; |
public class VertxResponseWriter { /** * { @ inheritDoc } */
@ Override public void failure ( Throwable error ) { } } | logger . error ( error . getMessage ( ) , error ) ; HttpServerResponse response = vertxRequest . response ( ) ; // Set error status and end
Response . Status status = Response . Status . INTERNAL_SERVER_ERROR ; response . setStatusCode ( status . getStatusCode ( ) ) ; response . setStatusMessage ( status . getReasonPhrase ( ) ) ; response . end ( ) ; |
public class FileRandomAccessStream { /** * Returns an InputStream for this stream . */
public InputStream getInputStream ( ) throws IOException { } } | if ( _is == null ) _is = new FileInputStream ( _file . getFD ( ) ) ; return _is ; |
public class CommerceCurrencyPersistenceImpl { /** * Returns all the commerce currencies where groupId = & # 63 ; .
* @ param groupId the group ID
* @ return the matching commerce currencies */
@ Override public List < CommerceCurrency > findByGroupId ( long groupId ) { } } | return findByGroupId ( groupId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class Input { /** * Reads count bytes and writes them to the specified byte [ ] , starting at offset . */
public void readBytes ( byte [ ] bytes , int offset , int count ) throws KryoException { } } | if ( bytes == null ) throw new IllegalArgumentException ( "bytes cannot be null." ) ; int copyCount = Math . min ( limit - position , count ) ; while ( true ) { System . arraycopy ( buffer , position , bytes , offset , copyCount ) ; position += copyCount ; count -= copyCount ; if ( count == 0 ) break ; offset += copyCount ; copyCount = Math . min ( count , capacity ) ; require ( copyCount ) ; } |
public class FileView { /** * - - - - - Getters and Setters end */
@ Override public void render ( ) { } } | if ( null == this . file ) { throw new RenderException ( "File param is null !" ) ; } if ( false == file . exists ( ) ) { throw new RenderException ( StrUtil . format ( "File [{}] not exist !" , file ) ) ; } if ( false == file . isFile ( ) ) { throw new RenderException ( StrUtil . format ( "File [{}] not a file !" , file ) ) ; } long fileLength = file . length ( ) ; if ( fileLength > Integer . MAX_VALUE ) { throw new RenderException ( "File [" + file . getName ( ) + "] is too large, file size: [" + fileLength + "]" ) ; } if ( StrUtil . isBlank ( responseFileName ) ) { // 如果未指定文件名 , 使用原文件名
responseFileName = file . getName ( ) ; } responseFileName = HttpUtil . encode ( responseFileName , HuluSetting . charset ) ; final HttpServletResponse response = Response . getServletResponse ( ) ; response . addHeader ( "Content-disposition" , "attachment; filename=" + responseFileName ) ; response . setContentType ( "application/octet-stream" ) ; response . setContentLength ( ( int ) fileLength ) ; try { Response . write ( new FileInputStream ( file ) ) ; } catch ( FileNotFoundException e ) { throw new RenderException ( StrUtil . format ( "File [{}] not exist !" , file ) , e ) ; } |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getFinishingOperationFOpType ( ) { } } | if ( finishingOperationFOpTypeEEnum == null ) { finishingOperationFOpTypeEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 186 ) ; } return finishingOperationFOpTypeEEnum ; |
public class CoronaConf { /** * Get the pool info . In order to support previous behavior , a single pool
* name is accepted .
* @ return Pool info , using a default pool group if the
* explicit pool can not be found */
public PoolInfo getPoolInfo ( ) { } } | String poolNameProperty = get ( IMPLICIT_POOL_PROPERTY , "user.name" ) ; String explicitPool = get ( EXPLICIT_POOL_PROPERTY , get ( poolNameProperty , "" ) ) . trim ( ) ; String [ ] poolInfoSplitString = explicitPool . split ( "[.]" ) ; if ( poolInfoSplitString != null && poolInfoSplitString . length == 2 ) { return new PoolInfo ( poolInfoSplitString [ 0 ] , poolInfoSplitString [ 1 ] ) ; } else if ( ! explicitPool . isEmpty ( ) ) { return new PoolInfo ( PoolGroupManager . DEFAULT_POOL_GROUP , explicitPool ) ; } else { return PoolGroupManager . DEFAULT_POOL_INFO ; } |
public class OpenAPIFilter { /** * { @ inheritDoc } */
@ Override public Operation visitOperation ( Context context , Operation operation ) { } } | return filter . filterOperation ( operation ) ; |
public class ParameterReferenceImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public Parameter getParameter ( ) { } } | if ( parameter != null && parameter . eIsProxy ( ) ) { InternalEObject oldParameter = ( InternalEObject ) parameter ; parameter = ( Parameter ) eResolveProxy ( oldParameter ) ; if ( parameter != oldParameter ) { if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . RESOLVE , XtextPackage . PARAMETER_REFERENCE__PARAMETER , oldParameter , parameter ) ) ; } } return parameter ; |
public class MariaDbDatabaseMetaData { /** * Retrieves a description of the given table ' s primary key columns . They are ordered by
* COLUMN _ NAME .
* < P > Each primary key column description has the following columns : < / p >
* < OL >
* < li > < B > TABLE _ CAT < / B > String { @ code = > } table catalog < / li >
* < li > < B > TABLE _ SCHEM < / B > String { @ code = > } table schema ( may be < code > null < / code > ) < / li >
* < li > < B > TABLE _ NAME < / B > String { @ code = > } table name < / li >
* < li > < B > COLUMN _ NAME < / B > String { @ code = > } column name < / li >
* < li > < B > KEY _ SEQ < / B > short { @ code = > } sequence number within primary key ( a value of 1
* represents the first column of the primary key , a value of 2 would represent the second column
* within the primary key ) . < / li >
* < li > < B > PK _ NAME < / B > String { @ code = > } primary key name < / li >
* < / OL >
* @ param catalog a catalog name ; must match the catalog name as it is stored in the database ; " "
* retrieves those without a catalog ;
* < code > null < / code > means that the catalog name should not be used to narrow the
* search
* @ param schema a schema name ; must match the schema name as it is stored in the database ; " "
* retrieves those without a schema ; < code > null < / code > means that the schema name
* should not be used to narrow the search
* @ param table a table name ; must match the table name as it is stored in the database
* @ return < code > ResultSet < / code > - each row is a primary key column description
* @ throws SQLException if a database access error occurs */
public ResultSet getPrimaryKeys ( String catalog , String schema , String table ) throws SQLException { } } | // MySQL 8 now use ' PRI ' in place of ' pri '
String sql = "SELECT A.TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, A.TABLE_NAME, A.COLUMN_NAME, B.SEQ_IN_INDEX KEY_SEQ, B.INDEX_NAME PK_NAME " + " FROM INFORMATION_SCHEMA.COLUMNS A, INFORMATION_SCHEMA.STATISTICS B" + " WHERE A.COLUMN_KEY in ('PRI','pri') AND B.INDEX_NAME='PRIMARY' " + " AND " + catalogCond ( "A.TABLE_SCHEMA" , catalog ) + " AND " + catalogCond ( "B.TABLE_SCHEMA" , catalog ) + " AND " + patternCond ( "A.TABLE_NAME" , table ) + " AND " + patternCond ( "B.TABLE_NAME" , table ) + " AND A.TABLE_SCHEMA = B.TABLE_SCHEMA AND A.TABLE_NAME = B.TABLE_NAME AND A.COLUMN_NAME = B.COLUMN_NAME " + " ORDER BY A.COLUMN_NAME" ; return executeQuery ( sql ) ; |
public class ImageFlow { /** * Changes the shape to match the specified dimension . Memory will only be created / destroyed if the requested
* size is larger than any previously requested size
* @ param width New image width
* @ param height new image height */
public void reshape ( int width , int height ) { } } | int N = width * height ; if ( data . length < N ) { D tmp [ ] = new D [ N ] ; System . arraycopy ( data , 0 , tmp , 0 , data . length ) ; for ( int i = data . length ; i < N ; i ++ ) tmp [ i ] = new D ( ) ; data = tmp ; } this . width = width ; this . height = height ; |
public class RetryOnFailureXSiteCommand { /** * Invokes remotely the command using the { @ code Transport } passed as parameter .
* @ param rpcManager the { @ link RpcManager } to use .
* @ param waitTimeBetweenRetries the waiting time if the command fails before retrying it .
* @ param unit the { @ link java . util . concurrent . TimeUnit } of the waiting time .
* @ throws Throwable if the maximum retries is reached ( defined by the { @ link org . infinispan . remoting . transport . RetryOnFailureXSiteCommand . RetryPolicy } ,
* the last exception occurred is thrown . */
public void execute ( RpcManager rpcManager , long waitTimeBetweenRetries , TimeUnit unit ) throws Throwable { } } | if ( backups . isEmpty ( ) ) { if ( debug ) { log . debugf ( "Executing '%s' but backup list is empty." , this ) ; } return ; } assertNotNull ( rpcManager , "RpcManager" ) ; assertNotNull ( unit , "TimeUnit" ) ; assertGreaterThanZero ( waitTimeBetweenRetries , "WaitTimeBetweenRetries" ) ; do { if ( trace ) { log . tracef ( "Sending %s to %s" , command , backups ) ; } BackupResponse response = rpcManager . invokeXSite ( backups , command ) ; response . waitForBackupToFinish ( ) ; Throwable throwable = extractThrowable ( response ) ; if ( throwable == null ) { if ( trace ) { log . trace ( "Successfull Response received." ) ; } return ; } else if ( ! retryPolicy . retry ( throwable , rpcManager ) ) { if ( trace ) { log . tracef ( "Exception Response received. Exception is %s" , throwable ) ; } throw throwable ; } unit . sleep ( waitTimeBetweenRetries ) ; } while ( true ) ; |
public class ExternalServiceAlertConditionsDeserializer { /** * Gson invokes this call - back method during deserialization when it encounters a field of the specified type .
* @ param element The Json data being deserialized
* @ param type The type of the Object to deserialize to
* @ param context The JSON deserialization context
* @ return The alert conditions */
@ Override public Collection < ExternalServiceAlertCondition > deserialize ( JsonElement element , Type type , JsonDeserializationContext context ) throws JsonParseException { } } | JsonObject obj = element . getAsJsonObject ( ) ; JsonArray conditions = obj . getAsJsonArray ( "external_service_conditions" ) ; List < ExternalServiceAlertCondition > values = new ArrayList < ExternalServiceAlertCondition > ( ) ; if ( conditions != null && conditions . isJsonArray ( ) ) { for ( JsonElement condition : conditions ) { if ( condition . isJsonObject ( ) ) { JsonElement conditionType = condition . getAsJsonObject ( ) . get ( "type" ) ; if ( conditionType != null ) { switch ( ExternalServiceAlertCondition . ConditionType . fromValue ( conditionType . getAsString ( ) ) ) { case APM : values . add ( gson . fromJson ( condition , ApmExternalServiceAlertCondition . class ) ) ; break ; case MOBILE : values . add ( gson . fromJson ( condition , MobileExternalServiceAlertCondition . class ) ) ; break ; } } } } } return values ; |
public class TopicsInner { /** * List keys for a topic .
* List the two keys used to publish to a topic .
* @ param resourceGroupName The name of the resource group within the user ' s subscription .
* @ param topicName Name of the topic
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the TopicSharedAccessKeysInner object if successful . */
public TopicSharedAccessKeysInner listSharedAccessKeys ( String resourceGroupName , String topicName ) { } } | return listSharedAccessKeysWithServiceResponseAsync ( resourceGroupName , topicName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class RemoteInputChannel { /** * Retriggers a remote subpartition request . */
void retriggerSubpartitionRequest ( int subpartitionIndex ) throws IOException , InterruptedException { } } | checkState ( partitionRequestClient != null , "Missing initial subpartition request." ) ; if ( increaseBackoff ( ) ) { partitionRequestClient . requestSubpartition ( partitionId , subpartitionIndex , this , getCurrentBackoff ( ) ) ; } else { failPartitionRequest ( ) ; } |
public class Messages { /** * Count the number of occurrences of a given wildcard .
* @ param templateMessage
* Input string
* @ param occurrence
* String searched .
* @ return The number of occurrences . */
private static int countWildcardsOccurrences ( String templateMessage , String occurrence ) { } } | if ( templateMessage != null && occurrence != null ) { final Pattern pattern = Pattern . compile ( occurrence ) ; final Matcher matcher = pattern . matcher ( templateMessage ) ; int count = 0 ; while ( matcher . find ( ) ) { count ++ ; } return count ; } else { return 0 ; } |
public class DefaultBeanContext { /** * Get a bean provider .
* @ param resolutionContext The bean resolution context
* @ param beanType The bean type
* @ param qualifier The qualifier
* @ param < T > The bean type parameter
* @ return The bean provider */
protected @ Nonnull < T > Provider < T > getBeanProvider ( @ Nullable BeanResolutionContext resolutionContext , @ Nonnull Class < T > beanType , @ Nullable Qualifier < T > qualifier ) { } } | ArgumentUtils . requireNonNull ( "beanType" , beanType ) ; @ SuppressWarnings ( "unchecked" ) BeanRegistration < T > beanRegistration = singletonObjects . get ( new BeanKey ( beanType , qualifier ) ) ; if ( beanRegistration != null ) { return new ResolvedProvider < > ( beanRegistration . bean ) ; } Optional < BeanDefinition < T > > concreteCandidate = findConcreteCandidate ( beanType , qualifier , true , false ) ; if ( concreteCandidate . isPresent ( ) ) { return new UnresolvedProvider < > ( beanType , qualifier , this ) ; } else { throw new NoSuchBeanException ( beanType ) ; } |
public class HBaseDataHandler { /** * Write values to entity .
* @ param entity
* the entity
* @ param hbaseData
* the hbase data
* @ param m
* the m
* @ param metaModel
* the meta model
* @ param attributes
* the attributes
* @ param relationNames
* the relation names
* @ param relations
* the relations
* @ param count
* the count
* @ param prefix
* the prefix
* @ return the int */
private void writeValuesToEntity ( Object entity , HBaseDataWrapper hbaseData , EntityMetadata m , MetamodelImpl metaModel , Set < Attribute > attributes , List < String > relationNames , Map < String , Object > relations , int count , String prefix ) { } } | for ( Attribute attribute : attributes ) { Class javaType = ( ( AbstractAttribute ) attribute ) . getBindableJavaType ( ) ; if ( metaModel . isEmbeddable ( javaType ) ) { processEmbeddable ( entity , hbaseData , m , metaModel , count , prefix , attribute , javaType ) ; } else if ( ! attribute . isCollection ( ) ) { String columnName = ( ( AbstractAttribute ) attribute ) . getJPAColumnName ( ) ; columnName = count != - 1 ? prefix + columnName + HBaseUtils . DELIM + count : prefix + columnName ; String idColName = ( ( AbstractAttribute ) m . getIdAttribute ( ) ) . getJPAColumnName ( ) ; String colFamily = ( ( AbstractAttribute ) attribute ) . getTableName ( ) != null ? ( ( AbstractAttribute ) attribute ) . getTableName ( ) : m . getTableName ( ) ; byte [ ] columnValue = hbaseData . getColumnValue ( HBaseUtils . getColumnDataKey ( colFamily , columnName ) ) ; if ( relationNames != null && relationNames . contains ( columnName ) && columnValue != null && columnValue . length > 0 ) { EntityType entityType = metaModel . entity ( m . getEntityClazz ( ) ) ; relations . put ( columnName , getObjectFromByteArray ( entityType , columnValue , columnName , m ) ) ; } else if ( ! idColName . equals ( columnName ) && columnValue != null ) { PropertyAccessorHelper . set ( entity , ( Field ) attribute . getJavaMember ( ) , columnValue ) ; } } } |
public class V1Instance { /** * Try to find an asset in the asset cache or create one for this entity .
* @ param entity asset will be found for .
* @ return An asset that will exist in the asset cache . */
private Asset getAsset ( Entity entity ) { } } | return getAsset ( entity . getInstanceKey ( ) , getAssetTypeToken ( entity . getClass ( ) ) ) ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcSurfaceSide createIfcSurfaceSideFromString ( EDataType eDataType , String initialValue ) { } } | IfcSurfaceSide result = IfcSurfaceSide . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class JsJmsTextMessageImpl { /** * Get the body ( payload ) of the message .
* Javadoc description supplied by JsJmsTextMessage interface . */
public String getText ( ) throws UnsupportedEncodingException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getText" ) ; String text = null ; try { text = ( String ) getPayload ( ) . getField ( JmsTextBodyAccess . BODY_DATA_VALUE ) ; } catch ( MFPUnsupportedEncodingRuntimeException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.mfp.impl.JsJmsTextMessageImpl.getText" , "148" ) ; throw ( UnsupportedEncodingException ) e . getCause ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { if ( ( text == null ) || text . length ( ) < 257 ) { SibTr . exit ( this , tc , "getText" , text ) ; } else { SibTr . exit ( this , tc , "getText" , new Object [ ] { text . length ( ) , text . substring ( 0 , 200 ) + "..." } ) ; } } return text ; |
public class SamlIdPObjectSigner { /** * Gets signing private key .
* @ return the signing private key
* @ throws Exception the exception */
protected PrivateKey getSigningPrivateKey ( ) throws Exception { } } | val samlIdp = casProperties . getAuthn ( ) . getSamlIdp ( ) ; val signingKey = samlIdPMetadataLocator . getSigningKey ( ) ; val privateKeyFactoryBean = new PrivateKeyFactoryBean ( ) ; privateKeyFactoryBean . setLocation ( signingKey ) ; privateKeyFactoryBean . setAlgorithm ( samlIdp . getMetadata ( ) . getPrivateKeyAlgName ( ) ) ; privateKeyFactoryBean . setSingleton ( false ) ; LOGGER . debug ( "Locating signature signing key from [{}]" , signingKey ) ; return privateKeyFactoryBean . getObject ( ) ; |
public class CommerceWarehousePersistenceImpl { /** * Returns all the commerce warehouses where groupId = & # 63 ; and active = & # 63 ; and commerceCountryId = & # 63 ; .
* @ param groupId the group ID
* @ param active the active
* @ param commerceCountryId the commerce country ID
* @ return the matching commerce warehouses */
@ Override public List < CommerceWarehouse > findByG_A_C ( long groupId , boolean active , long commerceCountryId ) { } } | return findByG_A_C ( groupId , active , commerceCountryId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class IRSEndpointMonitor { /** * Decorate method
* @ param mfc
* @ return */
@ Override public String getMessageToClient ( String mfc ) { } } | HttpSession httpSession = iRSEndpoint . getHttpSession ( ) ; String httpid = httpSession . getId ( ) ; boolean monitored = monitorSessionManager . isMonitored ( httpid ) ; long t0 = 0 ; if ( monitored ) { t0 = System . currentTimeMillis ( ) ; } String mtc = iRSEndpoint . getMessageToClient ( mfc ) ; if ( monitored ) { long t1 = System . currentTimeMillis ( ) ; publish ( "request-event-" + httpid , mfc , mtc , t1 - t0 ) ; } return mtc ; |
public class MemcachedConnection { /** * Register Metrics for collection .
* Note that these Metrics may or may not take effect , depending on the
* { @ link MetricCollector } implementation . This can be controlled from
* the { @ link DefaultConnectionFactory } . */
protected void registerMetrics ( ) { } } | if ( metricType . equals ( MetricType . DEBUG ) || metricType . equals ( MetricType . PERFORMANCE ) ) { metrics . addHistogram ( OVERALL_AVG_BYTES_READ_METRIC ) ; metrics . addHistogram ( OVERALL_AVG_BYTES_WRITE_METRIC ) ; metrics . addHistogram ( OVERALL_AVG_TIME_ON_WIRE_METRIC ) ; metrics . addMeter ( OVERALL_RESPONSE_METRIC ) ; metrics . addMeter ( OVERALL_REQUEST_METRIC ) ; if ( metricType . equals ( MetricType . DEBUG ) ) { metrics . addCounter ( RECON_QUEUE_METRIC ) ; metrics . addCounter ( SHUTD_QUEUE_METRIC ) ; metrics . addMeter ( OVERALL_RESPONSE_RETRY_METRIC ) ; metrics . addMeter ( OVERALL_RESPONSE_SUCC_METRIC ) ; metrics . addMeter ( OVERALL_RESPONSE_FAIL_METRIC ) ; } } |
public class Iterate { /** * Returns the BigDecimal sum of the result of applying the function to each element of the iterable .
* @ since 6.0 */
public static < T > BigDecimal sumOfBigDecimal ( Iterable < T > iterable , Function < ? super T , BigDecimal > function ) { } } | if ( iterable instanceof List ) { return ListIterate . sumOfBigDecimal ( ( List < T > ) iterable , function ) ; } if ( iterable != null ) { return IterableIterate . sumOfBigDecimal ( iterable , function ) ; } throw new IllegalArgumentException ( "Cannot perform an sumOfBigDecimal on null" ) ; |
public class JvmGenericTypeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case TypesPackage . JVM_GENERIC_TYPE__TYPE_PARAMETERS : getTypeParameters ( ) . clear ( ) ; return ; case TypesPackage . JVM_GENERIC_TYPE__INTERFACE : setInterface ( INTERFACE_EDEFAULT ) ; return ; case TypesPackage . JVM_GENERIC_TYPE__STRICT_FLOATING_POINT : setStrictFloatingPoint ( STRICT_FLOATING_POINT_EDEFAULT ) ; return ; case TypesPackage . JVM_GENERIC_TYPE__ANONYMOUS : setAnonymous ( ANONYMOUS_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class ReceiveMessageActionParser { /** * Construct the XPath message validation context .
* @ param messageElement
* @ param parentContext
* @ return */
private XpathMessageValidationContext getXPathMessageValidationContext ( Element messageElement , XmlMessageValidationContext parentContext ) { } } | XpathMessageValidationContext context = new XpathMessageValidationContext ( ) ; parseXPathValidationElements ( messageElement , context ) ; context . setControlNamespaces ( parentContext . getControlNamespaces ( ) ) ; context . setNamespaces ( parentContext . getNamespaces ( ) ) ; context . setIgnoreExpressions ( parentContext . getIgnoreExpressions ( ) ) ; context . setSchema ( parentContext . getSchema ( ) ) ; context . setSchemaRepository ( parentContext . getSchemaRepository ( ) ) ; context . setSchemaValidation ( parentContext . isSchemaValidationEnabled ( ) ) ; context . setDTDResource ( parentContext . getDTDResource ( ) ) ; return context ; |
public class MessageBean { /** * Set error location in source document .
* @ param locator current location during parsing
* @ return message bean with location set */
public MessageBean setLocation ( final Locator locator ) { } } | if ( locator == null ) { return this ; } final MessageBean ret = new MessageBean ( this ) ; if ( locator . getSystemId ( ) != null ) { try { ret . srcFile = new URI ( locator . getSystemId ( ) ) ; } catch ( final URISyntaxException e ) { throw new RuntimeException ( "Failed to parse URI '" + locator . getSystemId ( ) + "': " + e . getMessage ( ) , e ) ; } } ret . srcLine = locator . getLineNumber ( ) ; ret . srcColumn = locator . getColumnNumber ( ) ; return ret ; |
public class RedHbApi { /** * 发送红包
* @ param params 请求参数
* @ param certPath 证书文件目录
* @ param partnerKey 证书密码
* @ return { String } */
public static String sendRedPack ( Map < String , String > params , String certPath , String partnerKey ) { } } | return HttpUtils . postSSL ( sendRedPackUrl , PaymentKit . toXml ( params ) , certPath , partnerKey ) ; |
public class Interval { /** * Creates a new interval with the specified start instant .
* @ param start the start instant for the new interval , null means now
* @ return an interval with the end from this interval and the specified start
* @ throws IllegalArgumentException if the resulting interval has end before start */
public Interval withStart ( ReadableInstant start ) { } } | long startMillis = DateTimeUtils . getInstantMillis ( start ) ; return withStartMillis ( startMillis ) ; |
public class AbstractMapBasedWALDAO { /** * Mark an item as " no longer deleted " without actually adding it to the map .
* This method only triggers the update action but does not alter the item .
* Must only be invoked inside a write - lock .
* @ param aItem
* The item that was marked as " no longer deleted "
* @ param bInvokeCallbacks
* < code > true < / code > to invoke callbacks , < code > false < / code > to not do
* so .
* @ since 9.2.1 */
@ MustBeLocked ( ELockType . WRITE ) protected final void internalMarkItemUndeleted ( @ Nonnull final IMPLTYPE aItem , final boolean bInvokeCallbacks ) { } } | // Trigger save changes
super . markAsChanged ( aItem , EDAOActionType . UPDATE ) ; if ( bInvokeCallbacks ) { // Invoke callbacks
m_aCallbacks . forEach ( aCB -> aCB . onMarkItemUndeleted ( aItem ) ) ; } |
public class DiskUtils { /** * Returns directory name to save temporary files in the external storage for temporary < p >
* This method always returns path of external storage even if it does not exist . < br >
* As such , make sure to call isExternalStorageMounted method as state - testing method and then call this function only if state - testing method returns true .
* @ param context Context to get external storage information
* @ return String containing temporary directory name */
public static String getExternalTemporaryDirPath ( Context context ) { } } | return Environment . getExternalStorageDirectory ( ) . getAbsolutePath ( ) + DATA_FOLDER + File . separator + context . getPackageName ( ) + TEMPORARY_FOLDER ; |
public class PDPageContentStreamExt { /** * Set the line dash pattern .
* @ param pattern
* The pattern array
* @ param phase
* The phase of the pattern
* @ throws IOException
* If the content stream could not be written .
* @ throws IllegalStateException
* If the method was called within a text block . */
public void setLineDashPattern ( final float [ ] pattern , final float phase ) throws IOException { } } | if ( inTextMode ) { throw new IllegalStateException ( "Error: setLineDashPattern is not allowed within a text block." ) ; } write ( ( byte ) '[' ) ; for ( final float value : pattern ) { writeOperand ( value ) ; } write ( ( byte ) ']' , ( byte ) ' ' ) ; writeOperand ( phase ) ; writeOperator ( ( byte ) 'd' ) ; |
public class KunderaWeb3jClient { /** * Destroy . */
public void destroy ( ) { } } | if ( em != null ) { em . close ( ) ; LOGGER . info ( "Kundera EM closed..." ) ; } if ( emf != null ) { emf . close ( ) ; LOGGER . info ( "Kundera EMF closed..." ) ; } |