signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class GlobusGSSContextImpl { /** * Currently not implemented . */
public void unwrap ( InputStream inStream , OutputStream outStream , MessageProp msgProp ) throws GSSException { } } | throw new GSSException ( GSSException . UNAVAILABLE ) ; |
public class Table { /** * Select records from database table using < I > obj < / I > object as template
* for selection .
* @ param obj example object for search .
* @ param mask field mask indicating which fields in the example object
* should be used when building the query . */
public final Cursor < T > queryByExample ( Connection conn , T obj , FieldMask mask ) { } } | return new Cursor < T > ( this , conn , obj , mask , false ) ; |
public class Props { /** * Creating mailbox for actor
* @ param queue queue of mailboxes
* @ return mailbox */
public Mailbox createMailbox ( MailboxesQueue queue ) { } } | if ( mailboxCreator != null ) { return mailboxCreator . createMailbox ( queue ) ; } else { return new Mailbox ( queue ) ; } |
public class SCannedBox { /** * Initialize .
* @ param itsLocation The location of this component within the parent .
* @ param parentScreen The parent screen .
* @ param fieldConverter The field this screen field is linked to .
* @ param iDisplayFieldDesc Do I display the field desc ?
* @ param strValue The value to set the field on button press .
* @ param strDesc The description of this button .
* @ param strImage The image filename for this button .
* @ param strCommand The command to send on button press .
* @ param strToolTip The tooltip for this button .
* @ param record The ( optional ) record .
* @ param field The ( optional ) field . */
public void init ( ScreenLocation itsLocation , BasePanel parentScreen , Converter fieldConverter , int iDisplayFieldDesc , String strValue , String strDesc , String strImage , String strCommand , String strToolTip , Record record , BaseField field ) { } } | m_record = record ; m_field = field ; m_strValue = strValue ; m_iDisplayFieldDesc = iDisplayFieldDesc ; if ( record != null ) if ( fieldConverter == null ) if ( this . getDisplayFieldDesc ( this ) ) { // Use the record name as the desc
fieldConverter = new FieldDescConverter ( null , record . getRecordName ( ) ) ; record . addListener ( new RemoveConverterOnCloseHandler ( fieldConverter ) ) ; // Remove on close
} super . init ( itsLocation , parentScreen , fieldConverter , iDisplayFieldDesc , strValue , strDesc , strImage , strCommand , strToolTip ) ; |
public class HashUtil { /** * ELF算法
* @ param str 字符串
* @ return hash值 */
public static int elfHash ( String str ) { } } | int hash = 0 ; int x = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { hash = ( hash << 4 ) + str . charAt ( i ) ; if ( ( x = ( int ) ( hash & 0xF0000000L ) ) != 0 ) { hash ^= ( x >> 24 ) ; hash &= ~ x ; } } return hash & 0x7FFFFFFF ; |
public class Compiler { /** * Compiles a list of modules .
* < p > This is a convenience method to wrap up all the work of compilation , including
* generating the error and warning report .
* < p > NOTE : All methods called here must be public , because client code must be able to replicate
* and customize this . */
public < T extends SourceFile > Result compileModules ( List < T > externs , List < JSModule > modules , CompilerOptions options ) { } } | // The compile method should only be called once .
checkState ( jsRoot == null ) ; try { initModules ( externs , modules , options ) ; if ( options . printConfig ) { printConfig ( System . err ) ; } if ( ! hasErrors ( ) ) { parseForCompilation ( ) ; } if ( ! hasErrors ( ) ) { // TODO ( bradfordcsmith ) : The option to instrument for coverage only should belong to the
// runner , not the compiler .
if ( options . getInstrumentForCoverageOnly ( ) ) { instrumentForCoverage ( ) ; } else { stage1Passes ( ) ; if ( ! hasErrors ( ) ) { stage2Passes ( ) ; } } performPostCompilationTasks ( ) ; } } finally { generateReport ( ) ; } return getResult ( ) ; |
public class Dispatching { /** * Partial application of the first parameter to a ternary function .
* @ param < T1 > the function first parameter type
* @ param < T2 > the function second parameter type
* @ param < T3 > the function third parameter type
* @ param < R > the function return type
* @ param function the function to be curried
* @ param first the value to be curried as first parameter
* @ return the curried binary function */
public static < T1 , T2 , T3 , R > BiFunction < T2 , T3 , R > curry ( TriFunction < T1 , T2 , T3 , R > function , T1 first ) { } } | dbc . precondition ( function != null , "cannot bind parameter of a null function" ) ; return ( second , third ) -> function . apply ( first , second , third ) ; |
public class CodecCipher { /** * Encrypt or decrypt . */
private byte [ ] cipher ( byte [ ] input , int mode ) { } } | try { return doCipher ( input , mode ) ; } catch ( Exception e ) { throw new IllegalStateException ( e ) ; } |
public class GraphL3 { /** * This method creates a wrapper for every wrappable L3 element .
* @ param obj Object to wrap
* @ return The wrapper */
@ Override public Node wrap ( Object obj ) { } } | // Check if the object is level3
if ( ! ( obj instanceof Level3Element ) ) throw new IllegalArgumentException ( "An object other than a Level3Element is trying to be wrapped: " + obj ) ; // Check if the object passes the filter
if ( ! passesFilters ( ( Level3Element ) obj ) ) return null ; // Wrap if traversible
if ( obj instanceof PhysicalEntity ) { return new PhysicalEntityWrapper ( ( PhysicalEntity ) obj , this ) ; } else if ( obj instanceof Conversion ) { return new ConversionWrapper ( ( Conversion ) obj , this ) ; } else if ( obj instanceof TemplateReaction ) { return new TemplateReactionWrapper ( ( TemplateReaction ) obj , this ) ; } else if ( obj instanceof Control ) { return new ControlWrapper ( ( Control ) obj , this ) ; } else { if ( log . isWarnEnabled ( ) ) { log . warn ( "Invalid BioPAX object to wrap as node. Ignoring: " + obj ) ; } return null ; } |
public class EntityFactory { public Entity buildEntity ( EntityConfig entityConfig ) { } } | Entity entity = applicationContext . getBean ( Entity . class ) ; entityConfigFactory . applyFallBacks ( entityConfig ) ; entity . setEntityConfig ( entityConfig ) ; Table table = getTableStrict ( entityConfig ) ; if ( table . getType ( ) == TableType . VIEW ) { entity . setView ( true ) ; } entity . setTable ( table ) ; namerDefault ( entity ) ; namerExtension ( entity , config . getCelerio ( ) . getConfiguration ( ) ) ; if ( entityConfig . hasInheritance ( ) ) { if ( entityConfig . is ( JOINED ) ) { buildEntityInvolvedWithJoinedInheritance ( entityConfig , entity ) ; } else if ( entityConfig . is ( SINGLE_TABLE ) ) { buildEntityInvolvedWithSingleTableInheritance ( entityConfig , entity ) ; } else if ( entityConfig . is ( TABLE_PER_CLASS ) ) { buildEntityInvolvedWithTablePerClassInheritance ( entityConfig , entity ) ; } else { throw new IllegalStateException ( "An inheritance strategy should have been found in entity (or its ancestor) " + entityConfig . getEntityName ( ) ) ; } } else { buildSimpleEntity ( entityConfig , entity ) ; } return entity ; |
public class UserType { /** * Note : the only reason we override this is to provide nicer error message , but since that ' s not that much code . . . */
@ Override public void validate ( ByteBuffer bytes ) throws MarshalException { } } | ByteBuffer input = bytes . duplicate ( ) ; for ( int i = 0 ; i < size ( ) ; i ++ ) { // we allow the input to have less fields than declared so as to support field addition .
if ( ! input . hasRemaining ( ) ) return ; if ( input . remaining ( ) < 4 ) throw new MarshalException ( String . format ( "Not enough bytes to read size of %dth field %s" , i , fieldName ( i ) ) ) ; int size = input . getInt ( ) ; // size < 0 means null value
if ( size < 0 ) continue ; if ( input . remaining ( ) < size ) throw new MarshalException ( String . format ( "Not enough bytes to read %dth field %s" , i , fieldName ( i ) ) ) ; ByteBuffer field = ByteBufferUtil . readBytes ( input , size ) ; types . get ( i ) . validate ( field ) ; } // We ' re allowed to get less fields than declared , but not more
if ( input . hasRemaining ( ) ) throw new MarshalException ( "Invalid remaining data after end of UDT value" ) ; |
public class GroupByBuilder { /** * Get the results as a map
* @ param expression projection
* @ return new result transformer */
@ SuppressWarnings ( "unchecked" ) public < V > ResultTransformer < Map < K , V > > as ( Expression < V > expression ) { } } | final Expression < V > lookup = getLookup ( expression ) ; return new GroupByMap < K , V > ( key , expression ) { @ Override protected Map < K , V > transform ( Map < K , Group > groups ) { Map < K , V > results = new LinkedHashMap < K , V > ( ( int ) Math . ceil ( groups . size ( ) / 0.75 ) , 0.75f ) ; for ( Map . Entry < K , Group > entry : groups . entrySet ( ) ) { results . put ( entry . getKey ( ) , entry . getValue ( ) . getOne ( lookup ) ) ; } return results ; } } ; |
public class Launcher { /** * Returns a decorated { @ link Launcher } for the given node .
* @ param node Node for which this launcher is created .
* @ return Decorated instance of the Launcher . */
@ Nonnull public final Launcher decorateFor ( @ Nonnull Node node ) { } } | Launcher l = this ; for ( LauncherDecorator d : LauncherDecorator . all ( ) ) l = d . decorate ( l , node ) ; return l ; |
public class LObjBoolFunctionBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */
@ Nonnull public static < T , R > LObjBoolFunctionBuilder < T , R > objBoolFunction ( Consumer < LObjBoolFunction < T , R > > consumer ) { } } | return new LObjBoolFunctionBuilder ( consumer ) ; |
public class DDF { /** * for backward compatibility */
public List < HistogramBin > getVectorHistogram_Hive ( String columnName , int numBins ) throws DDFException { } } | return getVectorApproxHistogram ( columnName , numBins ) ; |
public class TransientUserLayoutManagerWrapper { /** * / * ( non - Javadoc )
* @ see org . apereo . portal . layout . IUserLayoutManager # getSubscribeId ( java . lang . String , java . lang . String ) */
@ Override public String getSubscribeId ( String parentFolderId , String fname ) { } } | return this . man . getSubscribeId ( parentFolderId , fname ) ; |
public class TextCommandFactory { /** * ( non - Javadoc )
* @ see net . rubyeye . xmemcached . CommandFactory # createFlushAllCommand ( java . util
* . concurrent . CountDownLatch ) */
public final Command createFlushAllCommand ( CountDownLatch latch , int exptime , boolean noreply ) { } } | return new TextFlushAllCommand ( latch , exptime , noreply ) ; |
public class Version { /** * Checks if this version satisfies the specified SemVer Expression .
* This method is a part of the SemVer Expressions API .
* @ param expr
* the SemVer Expression
* @ return { @ code true } if this version satisfies the specified SemVer Expression or { @ code false }
* otherwise
* @ throws ParseException
* in case of a general parse error
* @ throws com . github . zafarkhaja . semver . expr . LexerException
* when encounters an illegal character
* @ throws com . github . zafarkhaja . semver . expr . UnexpectedTokenException
* when comes across an unexpected token
* @ since 0.7.0 */
public boolean satisfies ( String expr ) { } } | Parser < Expression > parser = ExpressionParser . newInstance ( ) ; return parser . parse ( expr ) . interpret ( this ) ; |
public class SortedSetRelation { /** * Utility that could be on SortedSet . Allows faster implementation than
* what is in Java for doing addAll , removeAll , retainAll , ( complementAll ) .
* @ param a first set
* @ param relation the relation filter , using ANY , CONTAINS , etc .
* @ param b second set
* @ return the new set */
public static < T extends Object & Comparable < ? super T > > SortedSet < ? extends T > doOperation ( SortedSet < T > a , int relation , SortedSet < T > b ) { } } | // TODO : optimize this as above
TreeSet < ? extends T > temp ; switch ( relation ) { case ADDALL : a . addAll ( b ) ; return a ; case A : return a ; // no action
case B : a . clear ( ) ; a . addAll ( b ) ; return a ; case REMOVEALL : a . removeAll ( b ) ; return a ; case RETAINALL : a . retainAll ( b ) ; return a ; // the following is the only case not really supported by Java
// although all could be optimized
case COMPLEMENTALL : temp = new TreeSet < T > ( b ) ; temp . removeAll ( a ) ; a . removeAll ( b ) ; a . addAll ( temp ) ; return a ; case B_REMOVEALL : temp = new TreeSet < T > ( b ) ; temp . removeAll ( a ) ; a . clear ( ) ; a . addAll ( temp ) ; return a ; case NONE : a . clear ( ) ; return a ; default : throw new IllegalArgumentException ( "Relation " + relation + " out of range" ) ; } |
public class PdfStamper { /** * Sets the thumbnail image for a page .
* @ param image the image
* @ param page the page
* @ throws PdfException on error
* @ throws DocumentException on error */
public void setThumbnail ( Image image , int page ) throws PdfException , DocumentException { } } | stamper . setThumbnail ( image , page ) ; |
public class EnvironmentsInner { /** * Starts an environment by starting all resources inside the environment . This operation can take a while to complete .
* @ param resourceGroupName The name of the resource group .
* @ param labAccountName The name of the lab Account .
* @ param labName The name of the lab .
* @ param environmentSettingName The name of the environment Setting .
* @ param environmentName The name of the environment .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < Void > beginStartAsync ( String resourceGroupName , String labAccountName , String labName , String environmentSettingName , String environmentName , final ServiceCallback < Void > serviceCallback ) { } } | return ServiceFuture . fromResponse ( beginStartWithServiceResponseAsync ( resourceGroupName , labAccountName , labName , environmentSettingName , environmentName ) , serviceCallback ) ; |
public class CmsSitemapActionElement { /** * Returns the needed server data for client - side usage . < p >
* @ return the needed server data for client - side usage */
public CmsSitemapData getSitemapData ( ) { } } | if ( m_sitemapData == null ) { try { m_sitemapData = CmsVfsSitemapService . prefetch ( getRequest ( ) , getCmsObject ( ) . getRequestContext ( ) . getUri ( ) ) ; } catch ( CmsRpcException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } return m_sitemapData ; |
public class AccountsEndpoint { /** * The { accountSid } could be the email address of the account we need to update . Later we check if this is SID or EMAIL */
@ Path ( "/{accountSid}" ) @ Consumes ( APPLICATION_FORM_URLENCODED ) @ POST @ Produces ( { } } | MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) public Response updateAccountAsXmlPost ( @ PathParam ( "accountSid" ) final String accountSid , final MultivaluedMap < String , String > data , @ HeaderParam ( "Accept" ) String accept , @ Context SecurityContext sec ) { return updateAccount ( accountSid , data , retrieveMediaType ( accept ) , ContextUtil . convert ( sec ) ) ; |
public class BTCTurkAdapters { /** * Adapts a BTCTurkTrade to a Trade Object
* @ param btcTurkTrade The BTCTurkTrade trade
* @ param currencyPair ( e . g . BTC / TRY )
* @ return The XChange Trade */
public static Trade adaptTrade ( BTCTurkTrades btcTurkTrade , CurrencyPair currencyPair ) { } } | return new Trade ( null , btcTurkTrade . getAmount ( ) , currencyPair , btcTurkTrade . getPrice ( ) , btcTurkTrade . getDate ( ) , btcTurkTrade . getTid ( ) . toString ( ) ) ; |
public class HostControllerBootstrap { /** * Start the host controller services .
* @ throws Exception */
public void bootstrap ( ) throws Exception { } } | final HostRunningModeControl runningModeControl = environment . getRunningModeControl ( ) ; final ControlledProcessState processState = new ControlledProcessState ( true ) ; shutdownHook . setControlledProcessState ( processState ) ; ServiceTarget target = serviceContainer . subTarget ( ) ; ControlledProcessStateService controlledProcessStateService = ControlledProcessStateService . addService ( target , processState ) . getValue ( ) ; RunningStateJmx . registerMBean ( controlledProcessStateService , null , runningModeControl , false ) ; final HostControllerService hcs = new HostControllerService ( environment , runningModeControl , authCode , processState ) ; target . addService ( HostControllerService . HC_SERVICE_NAME , hcs ) . install ( ) ; |
public class IdTokenImpl { /** * returns Authentication Methods References
* This is optional
* ( claim amr )
* @ return Authentication Methods References */
@ SuppressWarnings ( "unchecked" ) public List < String > getMethodsReferences ( ) { } } | return ( List < String > ) mapAll . get ( PayloadConstants . METHODS_REFERENCE ) ; |
public class DeleteWorkerBlockRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteWorkerBlockRequest deleteWorkerBlockRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteWorkerBlockRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteWorkerBlockRequest . getWorkerId ( ) , WORKERID_BINDING ) ; protocolMarshaller . marshall ( deleteWorkerBlockRequest . getReason ( ) , REASON_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Token { /** * Retrieve the { @ link TokenAttributes } object associated with this
* { @ linkplain Token } . The attributes include the user ' s username , first name ,
* last name , and email address .
* @ return A valid { @ linkplain TokenAttributes } object or null if not decrypted . */
public TokenAttributes getAttributes ( ) { } } | TokenAttributes attrs = null ; if ( this . isDecoded ) { attrs = this . attributes ; } else { try { this . decryptData ( ) ; } catch ( Exception e ) { log . error ( "No TokenAttributes available!" ) ; } attrs = this . attributes ; } return attrs ; |
public class ConfigObjectRecord { /** * Retreive matching config object records from the directory .
* @ param ldapEntry The ldapEntry object to examine . Must be a valid entry .
* @ param attr The attribute used to store COR ' s
* @ param recordType the record recordType to use , can not be null .
* @ param guid1 GUID1 value to match on , may be null if no guid1 match is desired .
* @ param guid2 GUID2 value to match on , may be null if no guid2 match is desired .
* @ return A List containing matching ConfigObjectRecords
* @ throws ChaiOperationException If there is an error during the operation
* @ throws ChaiUnavailableException If the directory server ( s ) are unavailable */
public static List < ConfigObjectRecord > readRecordFromLDAP ( final ChaiEntry ldapEntry , final String attr , final String recordType , final Set guid1 , final Set guid2 ) throws ChaiOperationException , ChaiUnavailableException { } } | if ( ldapEntry == null ) { throw new NullPointerException ( "ldapEntry can not be null" ) ; } if ( attr == null ) { throw new NullPointerException ( "attr can not be null" ) ; } if ( recordType == null ) { throw new NullPointerException ( "recordType can not be null" ) ; } // Read the attribute
final Set < String > values = ldapEntry . readMultiStringAttribute ( attr ) ; final List < ConfigObjectRecord > cors = new ArrayList < ConfigObjectRecord > ( ) ; for ( final String value : values ) { final ConfigObjectRecord loopRec = parseString ( value ) ; loopRec . objectEntry = ldapEntry ; loopRec . attr = attr ; cors . add ( loopRec ) ; // If it doesnt match any of the tests , then remove the record .
if ( ! loopRec . getRecordType ( ) . equalsIgnoreCase ( recordType ) ) { cors . remove ( loopRec ) ; } else if ( guid1 != null && ! guid1 . contains ( loopRec . getGuid1 ( ) ) ) { cors . remove ( loopRec ) ; } else if ( guid2 != null && ! guid2 . contains ( loopRec . getGuid2 ( ) ) ) { cors . remove ( loopRec ) ; } } return cors ; |
public class Multiset { /** * Returns the number of elements , i . e . the sum of all multiplicities .
* @ return The number of all elements . */
public int size ( ) { } } | int result = 0 ; for ( O o : multiplicities . keySet ( ) ) { result += multiplicity ( o ) ; } return result ; |
public class DescribeAccountAttributesResult { /** * The attributes that are currently set for the account .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAttributes ( java . util . Collection ) } or { @ link # withAttributes ( java . util . Collection ) } if you want to
* override the existing values .
* @ param attributes
* The attributes that are currently set for the account .
* @ return Returns a reference to this object so that method calls can be chained together . */
public DescribeAccountAttributesResult withAttributes ( AccountAttribute ... attributes ) { } } | if ( this . attributes == null ) { setAttributes ( new java . util . ArrayList < AccountAttribute > ( attributes . length ) ) ; } for ( AccountAttribute ele : attributes ) { this . attributes . add ( ele ) ; } return this ; |
public class DaoImages { /** * Get the current data envelope .
* @ param connection the db connection .
* @ return the envelope .
* @ throws Exception */
public static ReferencedEnvelope getEnvelope ( IHMConnection connection ) throws Exception { } } | String query = "SELECT min(" + ImageTableFields . COLUMN_LON . getFieldName ( ) + "), max(" + ImageTableFields . COLUMN_LON . getFieldName ( ) + "), min(" + ImageTableFields . COLUMN_LAT . getFieldName ( ) + "), max(" + ImageTableFields . COLUMN_LAT . getFieldName ( ) + ") " + " FROM " + TABLE_IMAGES ; try ( IHMStatement statement = connection . createStatement ( ) ; IHMResultSet rs = statement . executeQuery ( query ) ; ) { if ( rs . next ( ) ) { double minX = rs . getDouble ( 1 ) ; double maxX = rs . getDouble ( 2 ) ; double minY = rs . getDouble ( 3 ) ; double maxY = rs . getDouble ( 4 ) ; ReferencedEnvelope env = new ReferencedEnvelope ( minX , maxX , minY , maxY , DefaultGeographicCRS . WGS84 ) ; return env ; } } return null ; |
public class WTabSetRenderer { /** * Paints the given WTabSet .
* @ param component the WTabSet to paint .
* @ param renderContext the RenderContext to paint to . */
@ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } } | WTabSet tabSet = ( WTabSet ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; xml . appendTagOpen ( "ui:tabset" ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , component . getHtmlClass ( ) ) ; xml . appendOptionalAttribute ( "track" , component . isTracking ( ) , "true" ) ; xml . appendAttribute ( "type" , getTypeAsString ( tabSet . getType ( ) ) ) ; xml . appendOptionalAttribute ( "disabled" , tabSet . isDisabled ( ) , "true" ) ; xml . appendOptionalAttribute ( "hidden" , tabSet . isHidden ( ) , "true" ) ; xml . appendOptionalAttribute ( "contentHeight" , tabSet . getContentHeight ( ) ) ; xml . appendOptionalAttribute ( "showHeadOnly" , tabSet . isShowHeadOnly ( ) , "true" ) ; xml . appendOptionalAttribute ( "single" , TabSetType . ACCORDION . equals ( tabSet . getType ( ) ) && tabSet . isSingle ( ) , "true" ) ; if ( WTabSet . TabSetType . ACCORDION . equals ( tabSet . getType ( ) ) ) { xml . appendOptionalAttribute ( "groupName" , tabSet . getGroupName ( ) ) ; } xml . appendClose ( ) ; // Render margin
MarginRendererUtil . renderMargin ( tabSet , renderContext ) ; paintChildren ( tabSet , renderContext ) ; xml . appendEndTag ( "ui:tabset" ) ; |
public class BoxCollaboration { /** * Deletes this collaboration . */
public void delete ( ) { } } | BoxAPIConnection api = this . getAPI ( ) ; URL url = COLLABORATION_URL_TEMPLATE . build ( api . getBaseURL ( ) , this . getID ( ) ) ; BoxAPIRequest request = new BoxAPIRequest ( api , url , "DELETE" ) ; BoxAPIResponse response = request . send ( ) ; response . disconnect ( ) ; |
public class PlaceObject { /** * Requests that the < code > occupantInfo < / code > field be set to the
* specified value . Generally one only adds , updates and removes
* entries of a distributed set , but certain situations call for a
* complete replacement of the set value . The local value will be
* updated immediately and an event will be propagated through the
* system to notify all listeners that the attribute did
* change . Proxied copies of this object ( on clients ) will apply the
* value change when they received the attribute changed notification . */
@ Generated ( value = { } } | "com.threerings.presents.tools.GenDObjectTask" } ) public void setOccupantInfo ( DSet < OccupantInfo > value ) { requestAttributeChange ( OCCUPANT_INFO , value , this . occupantInfo ) ; DSet < OccupantInfo > clone = ( value == null ) ? null : value . clone ( ) ; this . occupantInfo = clone ; |
public class ElementsExceptionsFactory { /** * Constructs and initializes a new { @ link NoAvailablePortException } with the given { @ link String message }
* formatted with the given { @ link Object [ ] arguments } .
* @ param message { @ link String } describing the { @ link NoAvailablePortException exception } .
* @ param args { @ link Object [ ] arguments } used to replace format placeholders in the { @ link String message } .
* @ return a new { @ link NoAvailablePortException } with the given { @ link String message } .
* @ see # newNoAvailablePortException ( Throwable , String , Object . . . )
* @ see org . cp . elements . net . NoAvailablePortException */
public static NoAvailablePortException newNoAvailablePortException ( String message , Object ... args ) { } } | return newNoAvailablePortException ( null , message , args ) ; |
public class ControllerService { /** * Controller Service API to delete scope .
* @ param scope Name of scope to be deleted .
* @ return Status of delete scope . */
public CompletableFuture < DeleteScopeStatus > deleteScope ( final String scope ) { } } | Exceptions . checkNotNullOrEmpty ( scope , "scope" ) ; return streamStore . deleteScope ( scope ) ; |
public class BinaryNumberIncrementor { /** * Deserialize this object from a POF stream .
* @ param reader POF reader to use
* @ throws IOException if an error occurs during deserialization */
public void readExternal ( PofReader reader ) throws IOException { } } | super . readExternal ( reader ) ; numInc = ( Number ) reader . readObject ( 10 ) ; fPostInc = reader . readBoolean ( 11 ) ; |
public class SplitData { /** * Retrieves the list of incoming transitions for the respective label .
* This method will always return a non - { @ code null } value .
* @ param label
* the label
* @ return the ( possibly empty ) list associated with the given state label */
public T getIncoming ( O label ) { } } | return incomingTransitions . computeIfAbsent ( label , k -> listSuppllier . get ( ) ) ; |
public class Mail { /** * Sends the email asynchronously .
* This method returns immediately , sending the request to the Mailgun
* service in the background . It is a < strong > non - blocking < / strong >
* method .
* @ param callback the callback to be invoked upon completion or failure */
public void sendAsync ( final MailRequestCallback callback ) { } } | if ( ! configuration . mailSendFilter ( ) . filter ( this ) ) return ; prepareSend ( ) ; request ( ) . async ( ) . post ( entity ( ) , new InvocationCallback < javax . ws . rs . core . Response > ( ) { @ Override public void completed ( javax . ws . rs . core . Response o ) { callback . completed ( new Response ( o ) ) ; } @ Override public void failed ( Throwable throwable ) { callback . failed ( throwable ) ; } } ) ; |
public class ConformanceConfig { /** * < code > repeated . jscomp . Requirement requirement = 1 ; < / code > */
public java . util . List < ? extends com . google . javascript . jscomp . RequirementOrBuilder > getRequirementOrBuilderList ( ) { } } | return requirement_ ; |
public class MultiMEProxyHandler { /** * Recovers the Neighbours from the MessageStore .
* @ exception WsException Thrown if there was a problem
* recovering the Neighbours . */
public void recoverNeighbours ( ) throws SIResourceException , MessageStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "recoverNeighbours" ) ; try { // Lock the manager exclusively
_lockManager . lockExclusive ( ) ; // Indicate that we are now reconciling
_reconciling = true ; _neighbours . recoverNeighbours ( ) ; } finally { _lockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "recoverNeighbours" ) ; |
public class Settings { /** * Change a property value in a restricted scope only , depending on execution context . New value
* is < b > never < / b > persisted . New value is ephemeral and kept in memory only :
* < ul >
* < li > during current analysis in the case of scanner stack < / li >
* < li > during processing of current HTTP request in the case of web server stack < / li >
* < li > during execution of current task in the case of Compute Engine stack < / li >
* < / ul >
* Property is temporarily removed if the parameter { @ code value } is { @ code null } */
public Settings setProperty ( String key , @ Nullable String value ) { } } | String validKey = definitions . validKey ( key ) ; if ( value == null ) { removeProperty ( validKey ) ; } else { set ( validKey , trim ( value ) ) ; } return this ; |
public class hqlParser { /** * hql . g : 220:1 : intoClause : INTO ^ path insertablePropertySpec ; */
public final hqlParser . intoClause_return intoClause ( ) throws RecognitionException { } } | hqlParser . intoClause_return retval = new hqlParser . intoClause_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token INTO30 = null ; ParserRuleReturnScope path31 = null ; ParserRuleReturnScope insertablePropertySpec32 = null ; CommonTree INTO30_tree = null ; try { // hql . g : 221:2 : ( INTO ^ path insertablePropertySpec )
// hql . g : 221:4 : INTO ^ path insertablePropertySpec
{ root_0 = ( CommonTree ) adaptor . nil ( ) ; INTO30 = ( Token ) match ( input , INTO , FOLLOW_INTO_in_intoClause847 ) ; INTO30_tree = ( CommonTree ) adaptor . create ( INTO30 ) ; root_0 = ( CommonTree ) adaptor . becomeRoot ( INTO30_tree , root_0 ) ; pushFollow ( FOLLOW_path_in_intoClause850 ) ; path31 = path ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , path31 . getTree ( ) ) ; WeakKeywords ( ) ; pushFollow ( FOLLOW_insertablePropertySpec_in_intoClause854 ) ; insertablePropertySpec32 = insertablePropertySpec ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , insertablePropertySpec32 . getTree ( ) ) ; } retval . stop = input . LT ( - 1 ) ; retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( CommonTree ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { // do for sure before leaving
} return retval ; |
public class DependencyFinder { /** * Returns the location to archive map ; or NOT _ FOUND .
* Location represents a parsed class . */
Archive locationToArchive ( Location location ) { } } | return parsedClasses . containsKey ( location ) ? parsedClasses . get ( location ) : configuration . findClass ( location ) . orElse ( NOT_FOUND ) ; |
public class BeadledomClientConfiguration { /** * Default client config builder . */
public static Builder builder ( ) { } } | return new AutoValue_BeadledomClientConfiguration . Builder ( ) . connectionPoolSize ( DEFAULT_CONNECTION_POOL_SIZE ) . maxPooledPerRouteSize ( DEFAULT_MAX_POOLED_PER_ROUTE ) . socketTimeoutMillis ( DEFAULT_SOCKET_TIMEOUT_MILLIS ) . connectionTimeoutMillis ( DEFAULT_CONNECTION_TIMEOUT_MILLIS ) . ttlMillis ( DEFAULT_TTL_MILLIS ) ; |
public class CommerceNotificationQueueEntryPersistenceImpl { /** * Returns all the commerce notification queue entries .
* @ return the commerce notification queue entries */
@ Override public List < CommerceNotificationQueueEntry > findAll ( ) { } } | return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class DownloadManager { /** * Tasks */
public void requestState ( long fileId , final FileCallback callback ) { } } | if ( LOG ) { Log . d ( TAG , "Requesting state file #" + fileId ) ; } Downloaded downloaded1 = downloaded . getValue ( fileId ) ; if ( downloaded1 != null ) { FileSystemReference reference = Storage . fileFromDescriptor ( downloaded1 . getDescriptor ( ) ) ; boolean isExist = reference . isExist ( ) ; int fileSize = reference . getSize ( ) ; if ( isExist && fileSize == downloaded1 . getFileSize ( ) ) { if ( LOG ) { Log . d ( TAG , "- Downloaded" ) ; } final FileSystemReference fileSystemReference = Storage . fileFromDescriptor ( downloaded1 . getDescriptor ( ) ) ; im . actor . runtime . Runtime . dispatch ( ( ) -> callback . onDownloaded ( fileSystemReference ) ) ; return ; } else { if ( LOG ) { Log . d ( TAG , "- File is corrupted" ) ; if ( ! isExist ) { Log . d ( TAG , "- File not found" ) ; } if ( fileSize != downloaded1 . getFileSize ( ) ) { Log . d ( TAG , "- Incorrect file size. Expected: " + downloaded1 . getFileSize ( ) + ", got: " + fileSize ) ; } } downloaded . removeItem ( downloaded1 . getFileId ( ) ) ; } } final QueueItem queueItem = findItem ( fileId ) ; if ( queueItem == null ) { im . actor . runtime . Runtime . dispatch ( ( ) -> callback . onNotDownloaded ( ) ) ; } else { if ( queueItem . isStarted ) { final float progress = queueItem . progress ; im . actor . runtime . Runtime . dispatch ( ( ) -> callback . onDownloading ( progress ) ) ; } else if ( queueItem . isStopped ) { im . actor . runtime . Runtime . dispatch ( ( ) -> callback . onNotDownloaded ( ) ) ; } else { im . actor . runtime . Runtime . dispatch ( ( ) -> callback . onDownloading ( 0 ) ) ; } } |
public class OR { /** * Checks the inner mapping of the wrapped constraints and figures the size .
* @ return the size */
@ Override public int getVariableSize ( ) { } } | int size = 0 ; for ( MappedConst mc : con ) { int m = max ( mc . getInds ( ) ) ; if ( m > size ) size = m ; } return size + 1 ; |
public class SSLContextBuilder { /** * Workaround for keystores containing multiple keys . Java will take the first key that matches
* and this way we can still offer configuration for a keystore with multiple keys and a selection
* based on alias . Also much easier than making a subclass of a KeyManagerFactory */
private KeyStore getKeyStoreWithSingleKey ( KeyStore keyStore , String keyStorePassword , String keyAlias ) throws KeyStoreException , IOException , NoSuchAlgorithmException , CertificateException , UnrecoverableKeyException { } } | KeyStore singleKeyKeyStore = KeyStore . getInstance ( keyStore . getType ( ) , keyStore . getProvider ( ) ) ; final char [ ] password = keyStorePassword . toCharArray ( ) ; singleKeyKeyStore . load ( null , password ) ; Key key = keyStore . getKey ( keyAlias , password ) ; Certificate [ ] chain = keyStore . getCertificateChain ( keyAlias ) ; singleKeyKeyStore . setKeyEntry ( keyAlias , key , password , chain ) ; return singleKeyKeyStore ; |
public class CountryTileSkin { /** * * * * * * Initialization * * * * * */
@ Override protected void initGraphics ( ) { } } | super . initGraphics ( ) ; // poiLocations = FXCollections . observableHashMap ( ) ;
// chartDataLocations = FXCollections . observableHashMap ( ) ;
// circleHandlerMap = new HashMap < > ( ) ;
country = tile . getCountry ( ) ; if ( null == country ) { country = Country . DE ; } clickHandler = event -> tile . fireTileEvent ( new TileEvent ( EventType . SELECTED_CHART_DATA , new ChartData ( country . getName ( ) , country . getValue ( ) , country . getColor ( ) ) ) ) ; countryPaths = Helper . getHiresCountryPaths ( ) . get ( country . name ( ) ) ; countryMinX = Helper . MAP_WIDTH ; countryMinY = Helper . MAP_HEIGHT ; countryMaxX = 0 ; countryMaxY = 0 ; countryPaths . forEach ( path -> { path . setFill ( tile . getBarColor ( ) ) ; countryMinX = Math . min ( countryMinX , path . getBoundsInParent ( ) . getMinX ( ) ) ; countryMinY = Math . min ( countryMinY , path . getBoundsInParent ( ) . getMinY ( ) ) ; countryMaxX = Math . max ( countryMaxX , path . getBoundsInParent ( ) . getMaxX ( ) ) ; countryMaxY = Math . max ( countryMaxY , path . getBoundsInParent ( ) . getMaxY ( ) ) ; } ) ; /* tile . getPoiList ( )
. forEach ( poi - > {
String tooltipText = new StringBuilder ( poi . getName ( ) ) . append ( " \ n " )
. append ( poi . getInfo ( ) )
. toString ( ) ;
Circle circle = new Circle ( 3 , poi . getColor ( ) ) ;
circle . setOnMousePressed ( e - > poi . fireLocationEvent ( new LocationEvent ( poi ) ) ) ;
Tooltip . install ( circle , new Tooltip ( tooltipText ) ) ;
poiLocations . put ( poi , circle ) ; */
titleText = new Text ( ) ; titleText . setFill ( tile . getTitleColor ( ) ) ; Helper . enableNode ( titleText , ! tile . getTitle ( ) . isEmpty ( ) ) ; text = new Text ( tile . getCountry ( ) . getDisplayName ( ) ) ; text . setFill ( tile . getTextColor ( ) ) ; Helper . enableNode ( text , tile . isTextVisible ( ) ) ; countryGroup = new Group ( ) ; countryGroup . getChildren ( ) . setAll ( countryPaths ) ; countryContainer = new StackPane ( ) ; countryContainer . setMinSize ( size * 0.9 , tile . isTextVisible ( ) ? size * 0.72 : size * 0.795 ) ; countryContainer . setMaxSize ( size * 0.9 , tile . isTextVisible ( ) ? size * 0.72 : size * 0.795 ) ; countryContainer . setPrefSize ( size * 0.9 , tile . isTextVisible ( ) ? size * 0.72 : size * 0.795 ) ; countryContainer . getChildren ( ) . setAll ( countryGroup ) ; valueText = new Text ( String . format ( locale , formatString , ( ( tile . getValue ( ) - minValue ) / range * 100 ) ) ) ; valueText . setFill ( tile . getValueColor ( ) ) ; valueText . setTextOrigin ( VPos . BASELINE ) ; Helper . enableNode ( valueText , tile . isValueVisible ( ) ) ; unitText = new Text ( " " + tile . getUnit ( ) ) ; unitText . setFill ( tile . getUnitColor ( ) ) ; unitText . setTextOrigin ( VPos . BASELINE ) ; Helper . enableNode ( unitText , ! tile . getUnit ( ) . isEmpty ( ) ) ; valueUnitFlow = new TextFlow ( valueText , unitText ) ; valueUnitFlow . setTextAlignment ( TextAlignment . RIGHT ) ; valueUnitFlow . setMouseTransparent ( true ) ; getPane ( ) . getChildren ( ) . addAll ( titleText , countryContainer , valueUnitFlow , text ) ; // getPane ( ) . getChildren ( ) . addAll ( poiLocations . values ( ) ) ; |
public class IOUtils { /** * Check whether provided url string is a valid java { @ link java . net . URL }
* @ param url URL to be validated
* @ return TRUE if URL is valid */
public static boolean isValidUrl ( String url ) { } } | try { if ( Strings . isNullOrEmpty ( url ) ) { return false ; } new URL ( url ) ; return true ; } catch ( MalformedURLException e ) { return false ; } |
public class BootstrapContextImpl { /** * Shutdown */
public void shutdown ( ) { } } | if ( timers != null ) { for ( Timer t : timers ) { t . cancel ( ) ; t . purge ( ) ; } } |
public class VisitorHelper { /** * Return the field descriptor for the given type and field signature .
* @ param name
* The variable name .
* @ param signature
* The variable signature .
* @ return The field descriptor . */
VariableDescriptor getVariableDescriptor ( String name , String signature ) { } } | VariableDescriptor variableDescriptor = scannerContext . getStore ( ) . create ( VariableDescriptor . class ) ; variableDescriptor . setName ( name ) ; variableDescriptor . setSignature ( signature ) ; return variableDescriptor ; |
public class UpdateDocumentVersionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateDocumentVersionRequest updateDocumentVersionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateDocumentVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateDocumentVersionRequest . getAuthenticationToken ( ) , AUTHENTICATIONTOKEN_BINDING ) ; protocolMarshaller . marshall ( updateDocumentVersionRequest . getDocumentId ( ) , DOCUMENTID_BINDING ) ; protocolMarshaller . marshall ( updateDocumentVersionRequest . getVersionId ( ) , VERSIONID_BINDING ) ; protocolMarshaller . marshall ( updateDocumentVersionRequest . getVersionStatus ( ) , VERSIONSTATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class MethodFinder { /** * Recursively search the class hierarchy of the class which declares { @ code originalMethod } to find a method named { @ code methodName } with the same signature as
* { @ code originalMethod }
* @ return The matching method , or { @ code null } if one could not be found */
public static Method findMatchingMethod ( Method originalMethod , String methodName ) { } } | Class < ? > originalClass = originalMethod . getDeclaringClass ( ) ; return AccessController . doPrivileged ( new PrivilegedAction < Method > ( ) { @ Override public Method run ( ) { return findMatchingMethod ( originalMethod , methodName , originalClass , new ResolutionContext ( ) , originalClass ) ; } } ) ; |
public class PropertiesReplacementUtil { /** * Creates an InputStream containing the document resulting from replacing template
* parameters in the given InputStream source .
* @ param source The source stream
* @ param props The properties
* @ return An InputStream containing the resulting document . */
static public InputStream replaceProperties ( InputStream source , Properties props ) throws IOException , SubstitutionException { } } | return replaceProperties ( source , props , "${" , "}" ) ; |
public class KafkaNotification { /** * - - - - - Service - - - - - */
@ Override public void start ( ) throws AtlasException { } } | if ( isHAEnabled ( ) ) { LOG . info ( "Not starting embedded instances when HA is enabled." ) ; return ; } if ( isEmbedded ( ) ) { try { startZk ( ) ; startKafka ( ) ; } catch ( Exception e ) { throw new AtlasException ( "Failed to start embedded kafka" , e ) ; } } |
public class JobResource { /** * The Amazon Machine Images ( AMIs ) associated with this job .
* @ param ec2AmiResources
* The Amazon Machine Images ( AMIs ) associated with this job . */
public void setEc2AmiResources ( java . util . Collection < Ec2AmiResource > ec2AmiResources ) { } } | if ( ec2AmiResources == null ) { this . ec2AmiResources = null ; return ; } this . ec2AmiResources = new java . util . ArrayList < Ec2AmiResource > ( ec2AmiResources ) ; |
public class UtilizationCollector { /** * main program to run on the Collector server */
public static void main ( String argv [ ] ) throws Exception { } } | StringUtils . startupShutdownMessage ( UtilizationCollector . class , argv , LOG ) ; try { Configuration conf = new Configuration ( ) ; UtilizationCollector collector = new UtilizationCollector ( conf ) ; if ( collector != null ) { collector . join ( ) ; } } catch ( Throwable e ) { LOG . error ( StringUtils . stringifyException ( e ) ) ; System . exit ( - 1 ) ; } |
public class GetApiToken { /** * Generates the next MediaWiki API urlEncodedToken and adds it to < code > msgs < / code > .
* @ param intoken type to get the urlEncodedToken for
* @ param title title of the article to generate the urlEncodedToken for */
private static Get generateTokenRequest ( Intoken intoken , String title ) { } } | return new ApiRequestBuilder ( ) . action ( "query" ) . formatXml ( ) . param ( "prop" , "info" ) . param ( "intoken" , intoken . toString ( ) . toLowerCase ( ) ) . param ( "titles" , MediaWiki . urlEncode ( title ) ) . buildGet ( ) ; |
public class Router { /** * Pops all { @ link Controller } s until the Controller with the passed tag is at the top
* @ param tag The tag being popped to
* @ return Whether or not any { @ link Controller } s were popped in order to get to the transaction with the passed tag */
@ UiThread public boolean popToTag ( @ NonNull String tag ) { } } | ThreadUtils . ensureMainThread ( ) ; return popToTag ( tag , null ) ; |
public class Humanize { /** * Same as { @ link # decamelize ( String String ) } defaulting to SPACE for
* replacement
* @ param words
* String to be converted
* @ return words converted to human - readable name */
@ Expose public static String decamelize ( final String words ) { } } | return SPLIT_CAMEL . matcher ( words ) . replaceAll ( SPACE ) ; |
public class JMSManager { /** * Stops a durable message consumer . Note that this is not
* the same as unsubscribing . When a durable message consumer is
* restarted all messages received since it was stopped will be
* delivered .
* @ param subscriptionName - the name of the subscription
* @ throws MessagingException */
public void stopDurable ( String subscriptionName ) throws MessagingException { } } | try { MessageConsumer durableSubscriber = durableSubscriptions . get ( subscriptionName ) ; if ( durableSubscriber != null ) { durableSubscriber . close ( ) ; } } catch ( JMSException jmse ) { throw new MessagingException ( "Exception encountered attempting to " + "stop durable subscription with name: " + subscriptionName + ". Exception message: " + jmse . getMessage ( ) , jmse ) ; } |
public class ArtifactoryServer { /** * Decides what are the preferred credentials to use for resolving the repo keys of the server
* @ return Preferred credentials for repo resolving . Never null . */
public CredentialsConfig getResolvingCredentialsConfig ( ) { } } | if ( resolverCredentialsConfig != null && resolverCredentialsConfig . isCredentialsProvided ( ) ) { return getResolverCredentialsConfig ( ) ; } if ( deployerCredentialsConfig != null ) { return getDeployerCredentialsConfig ( ) ; } return CredentialsConfig . EMPTY_CREDENTIALS_CONFIG ; |
public class AmazonIdentityManagementClient { /** * Removes the specified IAM role from the specified EC2 instance profile .
* < important >
* Make sure that you do not have any Amazon EC2 instances running with the role you are about to remove from the
* instance profile . Removing a role from an instance profile that is associated with a running instance might break
* any applications running on the instance .
* < / important >
* For more information about IAM roles , go to < a
* href = " https : / / docs . aws . amazon . com / IAM / latest / UserGuide / WorkingWithRoles . html " > Working with Roles < / a > . For more
* information about instance profiles , go to < a
* href = " https : / / docs . aws . amazon . com / IAM / latest / UserGuide / AboutInstanceProfiles . html " > About Instance Profiles < / a > .
* @ param removeRoleFromInstanceProfileRequest
* @ return Result of the RemoveRoleFromInstanceProfile operation returned by the service .
* @ throws NoSuchEntityException
* The request was rejected because it referenced a resource entity that does not exist . The error message
* describes the resource .
* @ throws LimitExceededException
* The request was rejected because it attempted to create resources beyond the current AWS account limits .
* The error message describes the limit exceeded .
* @ throws UnmodifiableEntityException
* The request was rejected because only the service that depends on the service - linked role can modify or
* delete the role on your behalf . The error message includes the name of the service that depends on this
* service - linked role . You must request the change through that service .
* @ throws ServiceFailureException
* The request processing has failed because of an unknown error , exception or failure .
* @ sample AmazonIdentityManagement . RemoveRoleFromInstanceProfile
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / iam - 2010-05-08 / RemoveRoleFromInstanceProfile "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public RemoveRoleFromInstanceProfileResult removeRoleFromInstanceProfile ( RemoveRoleFromInstanceProfileRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeRemoveRoleFromInstanceProfile ( request ) ; |
public class Command { /** * Dispose unbindService stopService */
public static void dispose ( ) { } } | synchronized ( Command . class ) { if ( IS_BIND ) { Context context = Cmd . getContext ( ) ; if ( context != null ) { try { context . unbindService ( I_CONN ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } I_COMMAND = null ; IS_BIND = false ; } } |
public class DelegateEbeanServer { /** * Construct with a EbeanServer to delegate and using ImmediateBackgroundExecutor .
* This delegate will be used on all method calls that are not overwritten . */
public DelegateEbeanServer withDelegate ( EbeanServer delegate ) { } } | this . delegate = delegate ; this . delegateQuery = new DelegateQuery ( delegate , this ) ; this . save = new DelegateSave ( delegate ) ; this . delete = new DelegateDelete ( delegate ) ; this . bulkUpdate = new DelegateBulkUpdate ( delegate ) ; this . find = new DelegateFind ( delegate ) ; this . findSqlQuery = new DelegateFindSqlQuery ( delegate ) ; this . publish = new DelegatePublish ( delegate ) ; return this ; |
public class ClassInfoCache { /** * The class info is last , or the class info is somewhere in the middle . */
public void makeFirst ( NonDelayedClassInfo classInfo ) { } } | String methodName = "makeFirst" ; boolean doLog = tc . isDebugEnabled ( ) ; String useHashText = ( doLog ? getHashText ( ) : null ) ; String useClassHashText = ( doLog ? classInfo . getHashText ( ) : null ) ; if ( doLog ) { logLinks ( methodName , classInfo ) ; } if ( classInfo == firstClassInfo ) { if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Already first [ {1} ]" , new Object [ ] { useHashText , useClassHashText } ) ) ; } return ; } else if ( classInfo == lastClassInfo ) { if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Moving from last [ {1} ]" , new Object [ ] { useHashText , useClassHashText } ) ) ; Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Old first [ {1} ]" , new Object [ ] { useHashText , firstClassInfo . getHashText ( ) } ) ) ; } lastClassInfo = classInfo . getPriorClassInfo ( ) ; lastClassInfo . setNextClassInfo ( null ) ; if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] New last [ {1} ]" , new Object [ ] { useHashText , lastClassInfo . getHashText ( ) } ) ) ; } firstClassInfo . setPriorClassInfo ( classInfo ) ; classInfo . setPriorClassInfo ( null ) ; classInfo . setNextClassInfo ( firstClassInfo ) ; firstClassInfo = classInfo ; } else { if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Moving from middle [ {1} ]" , new Object [ ] { useHashText , useClassHashText } ) ) ; Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Old first [ {1} ]" , new Object [ ] { useHashText , firstClassInfo . getHashText ( ) } ) ) ; } NonDelayedClassInfo currentPrior = classInfo . getPriorClassInfo ( ) ; NonDelayedClassInfo currentNext = classInfo . getNextClassInfo ( ) ; currentPrior . setNextClassInfo ( currentNext ) ; currentNext . setPriorClassInfo ( currentPrior ) ; firstClassInfo . setPriorClassInfo ( classInfo ) ; classInfo . setNextClassInfo ( firstClassInfo ) ; classInfo . setPriorClassInfo ( null ) ; firstClassInfo = classInfo ; } |
public class ServerControllerImpl { /** * < p > Scans for file used to configure Undertow : < ul >
* < li > Always consider < code > org . ops4j . pax . web < / code > PID < / li >
* < li > If this PID contains < code > org . ops4j . pax . web . config . url < / code > or < code > org . ops4j . pax . web . config . file < / code >
* check such resource < / li >
* < li > If such resource exists and has < code > properties < / code > extension < strong > or < / strong >
* is a directory and there ' s < code > undertow . properties < / code > inside , load some properties from there
* ( identity manager configuration ) and merge with other properties from < code > org . ops4j . pax . web < / code > PID < / li >
* < li > If such resource exists and has < code > xml < / code > extension < strong > or < / strong >
* is a directory and there ' s < code > undertow . xml < / code > inside , use this configuration and
* < strong > do not < / strong > consider other properties from the PID < strong > except < / strong >
* for property placeholder resolution inside XML file . < / li >
* < / ul >
* @ return */
private URL detectUndertowConfiguration ( ) { } } | URL undertowResource = configuration . getConfigurationURL ( ) ; // even if it ' s " dir " it may point to " file "
// ( same as in o . o . p . w . s . jetty . internal . JettyFactoryImpl . getHttpConfiguration ( ) )
File serverConfigDir = configuration . getConfigurationDir ( ) ; try { if ( undertowResource == null && serverConfigDir != null ) { // org . ops4j . pax . web . config . file
if ( serverConfigDir . isFile ( ) && serverConfigDir . canRead ( ) ) { undertowResource = serverConfigDir . toURI ( ) . toURL ( ) ; } else if ( serverConfigDir . isDirectory ( ) ) { for ( String name : new String [ ] { "undertow.xml" , "undertow.properties" } ) { File configuration = new File ( serverConfigDir , name ) ; if ( configuration . isFile ( ) && configuration . canRead ( ) ) { undertowResource = configuration . toURI ( ) . toURL ( ) ; break ; } } } } } catch ( MalformedURLException ignored ) { } if ( undertowResource == null ) { undertowResource = getClass ( ) . getResource ( "/undertow.xml" ) ; } if ( undertowResource == null ) { undertowResource = getClass ( ) . getResource ( "/undertow.properties" ) ; } return undertowResource ; |
public class PlaceManager { /** * Adds the supplied delegate to the list for this manager . */
public void addDelegate ( PlaceManagerDelegate delegate ) { } } | if ( _delegates == null ) { _delegates = Lists . newArrayList ( ) ; } if ( _omgr != null ) { delegate . init ( this , _omgr , _invmgr ) ; delegate . didInit ( _config ) ; } _delegates . add ( delegate ) ; |
public class ZeroCodeExternalFileProcessorImpl { /** * Digs deep into the nested map and looks for external file reference , if found , replaces the place holder with
* the file content . This is handy when the engineers wants to drive the common contents from a central place .
* @ param map A map representing the key - value pairs , can be nested */
void digReplaceContent ( Map < String , Object > map ) { } } | map . entrySet ( ) . stream ( ) . forEach ( entry -> { Object value = entry . getValue ( ) ; if ( value instanceof Map ) { digReplaceContent ( ( Map < String , Object > ) value ) ; } else { LOGGER . debug ( "Leaf node found = {}, checking for any external json file..." , value ) ; if ( value != null && value . toString ( ) . contains ( JSON_PAYLOAD_FILE ) ) { LOGGER . info ( "Found external JSON file place holder = {}. Replacing with content" , value ) ; String valueString = value . toString ( ) ; String token = getJsonFilePhToken ( valueString ) ; if ( token != null && token . startsWith ( JSON_PAYLOAD_FILE ) ) { String resourceJsonFile = token . substring ( JSON_PAYLOAD_FILE . length ( ) ) ; try { Object jsonFileContent = objectMapper . readTree ( readJsonAsString ( resourceJsonFile ) ) ; entry . setValue ( jsonFileContent ) ; } catch ( Exception exx ) { LOGGER . error ( "External file reference exception - {}" , exx . getMessage ( ) ) ; throw new RuntimeException ( exx ) ; } } // Extension - for XML file type in case a ticket raised
/* else if ( token ! = null & & token . startsWith ( XML _ FILE ) ) { */
// Extension - for Other types in case a ticket raised
/* else if ( token ! = null & & token . startsWith ( OTHER _ FILE ) ) { */
} } } ) ; |
public class ScheduledInstancesNetworkInterface { /** * The specific IPv6 addresses from the subnet range .
* @ return The specific IPv6 addresses from the subnet range . */
public java . util . List < ScheduledInstancesIpv6Address > getIpv6Addresses ( ) { } } | if ( ipv6Addresses == null ) { ipv6Addresses = new com . amazonaws . internal . SdkInternalList < ScheduledInstancesIpv6Address > ( ) ; } return ipv6Addresses ; |
public class FuncId { /** * Execute the function . The function must return
* a valid object .
* @ param xctxt The current execution context .
* @ return A valid XObject .
* @ throws javax . xml . transform . TransformerException */
public XObject execute ( XPathContext xctxt ) throws javax . xml . transform . TransformerException { } } | int context = xctxt . getCurrentNode ( ) ; DTM dtm = xctxt . getDTM ( context ) ; int docContext = dtm . getDocument ( ) ; if ( DTM . NULL == docContext ) error ( xctxt , XPATHErrorResources . ER_CONTEXT_HAS_NO_OWNERDOC , null ) ; XObject arg = m_arg0 . execute ( xctxt ) ; int argType = arg . getType ( ) ; XNodeSet nodes = new XNodeSet ( xctxt . getDTMManager ( ) ) ; NodeSetDTM nodeSet = nodes . mutableNodeset ( ) ; if ( XObject . CLASS_NODESET == argType ) { DTMIterator ni = arg . iter ( ) ; StringVector usedrefs = null ; int pos = ni . nextNode ( ) ; while ( DTM . NULL != pos ) { DTM ndtm = ni . getDTM ( pos ) ; String refval = ndtm . getStringValue ( pos ) . toString ( ) ; pos = ni . nextNode ( ) ; usedrefs = getNodesByID ( xctxt , docContext , refval , usedrefs , nodeSet , DTM . NULL != pos ) ; } // ni . detach ( ) ;
} else if ( XObject . CLASS_NULL == argType ) { return nodes ; } else { String refval = arg . str ( ) ; getNodesByID ( xctxt , docContext , refval , null , nodeSet , false ) ; } return nodes ; |
public class DnsProtocol { /** * / * atomic 16 - bit xorshift LSFR , cycling through all 16 - bit values except zero */
public static short generateTransactionId ( ) { } } | return ( short ) xorshiftState . updateAndGet ( old -> { short x = ( short ) old ; x ^= ( x & 0xffff ) << 7 ; x ^= ( x & 0xffff ) >>> 9 ; x ^= ( x & 0xffff ) << 8 ; assert x != 0 : "Xorshift LFSR can never produce zero" ; return x ; } ) ; |
public class SpringQueryInputProcessor { /** * Parse the SQL statement and locate any placeholders or named parameters .
* Named parameters are substituted for a JDBC placeholder .
* @ param sql the SQL statement
* @ return the parsed statement , represented as ParsedSql instance */
private static ProcessedInput processSqlStatement ( final String sql ) { } } | Map < String , String > parsedSqlResult = new HashMap < String , String > ( ) ; Set < String > namedParameters = new HashSet < String > ( ) ; String sqlToUse = sql ; List < ParameterHolder > parameterList = new ArrayList < ParameterHolder > ( ) ; char [ ] statement = sql . toCharArray ( ) ; int namedParameterCount = 0 ; int unnamedParameterCount = 0 ; int totalParameterCount = 0 ; int escapes = 0 ; int i = 0 ; while ( i < statement . length ) { int skipToPosition = i ; while ( i < statement . length ) { skipToPosition = skipCommentsAndQuotes ( statement , i ) ; if ( i == skipToPosition ) { break ; } else { i = skipToPosition ; } } if ( i >= statement . length ) { break ; } char c = statement [ i ] ; if ( c == ':' || c == '&' ) { int j = i + 1 ; if ( j < statement . length && statement [ j ] == ':' && c == ':' ) { // Postgres - style " : : " casting operator - to be skipped .
i = i + 2 ; continue ; } String parameter = null ; if ( j < statement . length && c == ':' && statement [ j ] == '{' ) { // : { x } style parameter
while ( j < statement . length && ! ( '}' == statement [ j ] ) ) { j ++ ; if ( ':' == statement [ j ] || '{' == statement [ j ] ) { throw new IllegalArgumentException ( "Parameter name contains invalid character '" + statement [ j ] + "' at position " + i + " in statement " + sql ) ; } } if ( j >= statement . length ) { throw new IllegalArgumentException ( "Non-terminated named parameter declaration at position " + i + " in statement " + sql ) ; } if ( j - i > 3 ) { parameter = sql . substring ( i + 2 , j ) ; namedParameterCount = addNewNamedParameter ( namedParameters , namedParameterCount , parameter ) ; totalParameterCount = addNamedParameter ( parameterList , totalParameterCount , escapes , i , j + 1 , parameter ) ; } j ++ ; } else { while ( j < statement . length && ! isParameterSeparator ( statement [ j ] ) ) { j ++ ; } if ( j - i > 1 ) { parameter = sql . substring ( i + 1 , j ) ; namedParameterCount = addNewNamedParameter ( namedParameters , namedParameterCount , parameter ) ; totalParameterCount = addNamedParameter ( parameterList , totalParameterCount , escapes , i , j , parameter ) ; } } i = j - 1 ; } else { if ( c == '\\' ) { int j = i + 1 ; if ( j < statement . length && statement [ j ] == ':' ) { // this is an escaped : and should be skipped
sqlToUse = sqlToUse . substring ( 0 , i - escapes ) + sqlToUse . substring ( i - escapes + 1 ) ; escapes ++ ; i = i + 2 ; continue ; } } if ( c == '?' ) { unnamedParameterCount ++ ; totalParameterCount ++ ; } } i ++ ; } ProcessedInput processedInput = new ProcessedInput ( sql ) ; for ( ParameterHolder ph : parameterList ) { processedInput . addParameter ( ph . getParameterName ( ) , ph . getStartIndex ( ) , ph . getEndIndex ( ) ) ; } return processedInput ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } } */
@ XmlElementDecl ( namespace = "http://belframework.org/schema/1.0/xbel" , name = "license" ) public JAXBElement < String > createLicense ( String value ) { } } | return new JAXBElement < String > ( _License_QNAME , String . class , null , value ) ; |
public class SingleEvaluatedMoveCache { /** * Retrieve a cached validation , if still available . If the validation of any other move has
* been cached at a later point in time , the value for this move will have been overwritten .
* @ param move move applied to the current solution
* @ return cached validation of the obtained neighbour , if available , < code > null < / code > if not */
@ Override public final Validation getCachedMoveValidation ( Move < ? > move ) { } } | if ( validatedMove == null || ! validatedMove . equals ( move ) ) { // cache miss
return null ; } else { // cache hit
return validation ; } |
public class UserApi { /** * Get an impersonation token of a user . Available only for admin users .
* < pre > < code > GitLab Endpoint : GET / users / : user _ id / impersonation _ tokens / : impersonation _ token _ id < / code > < / pre >
* @ param userIdOrUsername the user in the form of an Integer ( ID ) , String ( username ) , or User instance
* @ param tokenId the impersonation token ID to get
* @ return the specified impersonation token
* @ throws GitLabApiException if any exception occurs */
public ImpersonationToken getImpersonationToken ( Object userIdOrUsername , Integer tokenId ) throws GitLabApiException { } } | if ( tokenId == null ) { throw new RuntimeException ( "tokenId cannot be null" ) ; } Response response = get ( Response . Status . OK , null , "users" , getUserIdOrUsername ( userIdOrUsername ) , "impersonation_tokens" , tokenId ) ; return ( response . readEntity ( ImpersonationToken . class ) ) ; |
public class SavedAuthenticationImpl { /** * Get array of authorizations which apply for the user . In many cases there is one object for each role .
* A union is used to combine these authorizations ( and any other which may apply for the authentication token ) .
* @ return array of { @ link org . geomajas . security . BaseAuthorization } objects */
public BaseAuthorization [ ] getAuthorizations ( ) { } } | BaseAuthorization [ ] res = new BaseAuthorization [ authorizations . length ] ; try { for ( int i = 0 ; i < authorizations . length ; i ++ ) { ByteArrayInputStream bais = new ByteArrayInputStream ( authorizations [ i ] ) ; JBossObjectInputStream deserialize = new JBossObjectInputStream ( bais ) ; Object obj = deserialize . readObject ( ) ; res [ i ] = ( BaseAuthorization ) obj ; } } catch ( ClassNotFoundException cnfe ) { Logger log = LoggerFactory . getLogger ( SavedAuthenticationImpl . class ) ; log . error ( "Can not deserialize object, may cause rights to be lost." , cnfe ) ; res = new BaseAuthorization [ 0 ] ; // assure empty list , otherwise risk of NPE
} catch ( IOException ioe ) { Logger log = LoggerFactory . getLogger ( SavedAuthenticationImpl . class ) ; log . error ( "Can not deserialize object, may cause rights to be lost." , ioe ) ; res = new BaseAuthorization [ 0 ] ; // assure empty list , otherwise risk of NPE
} return res ; |
public class NotificationManager { /** * This synchronized method will assign an unique ID to a new notification client */
private synchronized int getNewClientID ( ) { } } | if ( ( clientIDGenerator + 1 ) >= Integer . MAX_VALUE ) { // if we can ' t find a reusable ID within the first 100 slots , then fail .
// Revisit : I don ' t want to loop through all 2 + billion entries to find that they are all taken , as this
// could be seem as a DoS , but maybe some better heuristics for finding an empty ID ? not sure if we will ever be
// in this situation . . .
final int limit = Integer . MIN_VALUE + 100 ; for ( int i = Integer . MIN_VALUE ; i < limit ; i ++ ) { if ( inboxes . get ( i ) == null ) { return i ; } } // Emit the warning
Tr . warning ( tc , "jmx.connector.server.rest.notification.limit.warning" ) ; throw ErrorHelper . createRESTHandlerJsonException ( new RuntimeException ( "The server has reached its limit of new client notifications." ) , JSONConverter . getConverter ( ) , APIConstants . STATUS_SERVICE_UNAVAILABLE ) ; } return clientIDGenerator ++ ; |
public class MonitorService { /** * Returns the script for the given monitor id .
* @ param monitorId The id for the monitor to return
* @ return The script */
public Optional < Script > showScript ( String monitorId ) { } } | return HTTP . GET ( String . format ( "/v3/monitors/%s/script" , monitorId ) , SCRIPT ) ; |
public class ServiceRegistry { /** * If a system property is found with key equal to :
* A . B
* where A is the current classname and B is some constant
* String defined in ServicePropertyNames , then the value V
* of this system property will be included in a new property
* added to the return value Properties object . The return
* value will include a property with key B and value V .
* E . g . a system property ( key = value ) of :
* ( com . ibm . jbatch . spi . ServiceRegistry . TRANSACTION _ SERVICE = XXXX )
* will result in the return value including a property of :
* ( TRANSACTION _ SERVICE = XXXX )
* @ return Properties object as defined above . */
public static Properties getSystemPropertyOverrides ( ) { } } | final String PROP_PREFIX = sourceClass ; Properties props = new Properties ( ) ; for ( String propName : getAllServicePropertyNames ( ) ) { final String key = PROP_PREFIX + "." + propName ; final String val = System . getProperty ( key ) ; if ( val != null ) { logger . fine ( "Found override property from system properties (key,value) = (" + propName + "," + val + ")" ) ; props . setProperty ( propName , val ) ; } } return props ; |
public class RestfulMgrImpl { /** * Retry封装 RemoteUrl 支持多Server的下载
* @ param remoteUrl
* @ param localTmpFile
* @ param retryTimes
* @ param sleepSeconds
* @ return */
private Object retry4ConfDownload ( RemoteUrl remoteUrl , File localTmpFile , int retryTimes , int sleepSeconds ) throws Exception { } } | Exception ex = null ; for ( URL url : remoteUrl . getUrls ( ) ) { // 可重试的下载
UnreliableInterface unreliableImpl = new FetchConfFile ( url , localTmpFile ) ; try { return retryStrategy . retry ( unreliableImpl , retryTimes , sleepSeconds ) ; } catch ( Exception e ) { ex = e ; try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException e1 ) { LOGGER . info ( "pass" ) ; } } } throw new Exception ( "download failed." , ex ) ; |
public class CollectionUtil { /** * Converts a { @ link Collection < Long > } to a primitive { @ code long [ ] } array .
* @ param collection the given collection
* @ return a primitive long [ ] array
* @ throws NullPointerException if collection is { @ code null } */
public static long [ ] toLongArray ( Collection < Long > collection ) { } } | long [ ] collectionArray = new long [ collection . size ( ) ] ; int index = 0 ; for ( Long item : collection ) { collectionArray [ index ++ ] = item ; } return collectionArray ; |
public class ObjectComparatorFactory { /** * Create a new instance of a the specified factory class .
* @ param objectComparatorFactoryClassName the factory class
* @ return a new instance of a the specified factory
* @ throws InstantiationException if creation of the factory fails
* @ throws IllegalAccessException if creation of the factory fails
* @ throws ClassNotFoundException if creation of the factory fails */
public static ObjectComparatorFactory newInstance ( final String objectComparatorFactoryClassName ) throws InstantiationException , IllegalAccessException , ClassNotFoundException { } } | return ( ObjectComparatorFactory ) Class . forName ( objectComparatorFactoryClassName ) . newInstance ( ) ; |
public class SVGPlot { /** * Convert screen coordinates to element coordinates .
* @ param tag Element to convert the coordinates for
* @ param evt Event object
* @ return Coordinates */
public SVGPoint elementCoordinatesFromEvent ( Element tag , Event evt ) { } } | return SVGUtil . elementCoordinatesFromEvent ( document , tag , evt ) ; |
public class DataNode { /** * stores an object for the given key
* @ param < T >
* @ param key
* @ param object */
public < T > void setObject ( DataKey < T > key , T object ) { } } | if ( key == null ) { throw new IllegalArgumentException ( "key must not be null" ) ; } if ( object == null && ! key . allowNull ( ) ) { throw new IllegalArgumentException ( "key \"" + key . getName ( ) + "\" disallows null values but object was null" ) ; } data . put ( key . getName ( ) , object ) ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcAirToAirHeatRecoveryTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class HandlerUtil { /** * Sets a JSON encoded response . The response ' s { @ code Content - Type } header will be set to { @ code application / json }
* @ param response The response object
* @ param encoded The JSON - encoded string */
public static void makeJsonResponse ( HttpResponse response , String encoded ) { } } | StringEntity ent = new StringEntity ( encoded , ContentType . APPLICATION_JSON ) ; response . setEntity ( ent ) ; |
public class BrokerHelper { /** * Detect if the given object has a PK field represents a ' null ' value . */
public boolean hasNullPKField ( ClassDescriptor cld , Object obj ) { } } | FieldDescriptor [ ] fields = cld . getPkFields ( ) ; boolean hasNull = false ; // an unmaterialized proxy object can never have nullified PK ' s
IndirectionHandler handler = ProxyHelper . getIndirectionHandler ( obj ) ; if ( handler == null || handler . alreadyMaterialized ( ) ) { if ( handler != null ) obj = handler . getRealSubject ( ) ; FieldDescriptor fld ; for ( int i = 0 ; i < fields . length ; i ++ ) { fld = fields [ i ] ; hasNull = representsNull ( fld , fld . getPersistentField ( ) . get ( obj ) ) ; if ( hasNull ) break ; } } return hasNull ; |
public class WikiUpdate { /** * Read the file .
* @ param _ installFile the install file
* @ return JavaScriptUpdate */
public static WikiUpdate readFile ( final InstallFile _installFile ) { } } | final WikiUpdate ret = new WikiUpdate ( _installFile ) ; final WikiDefinition definition = ret . new WikiDefinition ( _installFile ) ; ret . addDefinition ( definition ) ; return ret ; |
public class ServletUtil { /** * / * getContextAttribute ( ServletConfig . . . ) */
public static final < T > T getContextAttribute ( ServletConfig conf , String name , Class < T > cls , Set < GetOpts > opts , T defaultValue ) { } } | return getContextAttribute ( conf . getServletContext ( ) , name , cls , opts , defaultValue ) ; |
public class PlainTime { /** * also called by ZonalDateTime */
static void printNanos ( StringBuilder sb , int nano ) { } } | sb . append ( PlainTime . ISO_DECIMAL_SEPARATOR ) ; String num = Integer . toString ( nano ) ; int len ; if ( ( nano % MIO ) == 0 ) { len = 3 ; } else if ( ( nano % KILO ) == 0 ) { len = 6 ; } else { len = 9 ; } for ( int i = num . length ( ) ; i < 9 ; i ++ ) { sb . append ( '0' ) ; } for ( int i = 0 , n = len + num . length ( ) - 9 ; i < n ; i ++ ) { sb . append ( num . charAt ( i ) ) ; } |
public class MemoryAddressHash { /** * Returns a stream of longs that are all of the various memory locations
* @ return stream of the various memory locations */
public LongStream toStream ( ) { } } | return LongStream . iterate ( memory , l -> l + 8 ) . limit ( pointerCount ) . map ( UNSAFE :: getLong ) . filter ( l -> l != 0 ) ; |
public class AnalysisJobBuilder { /** * Gets all available { @ link InputColumn } s of a particular type to map to a
* particular { @ link ComponentBuilder }
* @ param componentBuilder
* @ param dataType
* @ return */
public List < InputColumn < ? > > getAvailableInputColumns ( final ComponentBuilder componentBuilder , final Class < ? > dataType ) { } } | List < InputColumn < ? > > result = getAvailableInputColumns ( dataType ) ; final SourceColumnFinder finder = new SourceColumnFinder ( ) ; finder . addSources ( this ) ; result = CollectionUtils . filter ( result , new Predicate < InputColumn < ? > > ( ) { @ Override public Boolean eval ( InputColumn < ? > inputColumn ) { if ( inputColumn . isPhysicalColumn ( ) ) { return true ; } final InputColumnSourceJob origin = finder . findInputColumnSource ( inputColumn ) ; if ( origin == null ) { return true ; } if ( origin == componentBuilder ) { // exclude columns from the component itself
return false ; } final Set < Object > sourceComponents = finder . findAllSourceJobs ( origin ) ; if ( sourceComponents . contains ( componentBuilder ) ) { // exclude columns that depend
return false ; } return true ; } } ) ; return result ; |
public class ModuleNameReader { /** * ensureCapacity will increase the buffer as needed , taking note that
* the new buffer will always be greater than the needed and never
* exactly equal to the needed size or bp . If equal then the read ( above )
* will infinitely loop as buf . length - bp = = 0. */
private static byte [ ] ensureCapacity ( byte [ ] buf , int needed ) { } } | if ( buf . length <= needed ) { byte [ ] old = buf ; buf = new byte [ Integer . highestOneBit ( needed ) << 1 ] ; System . arraycopy ( old , 0 , buf , 0 , old . length ) ; } return buf ; |
public class Generators { /** * Returns the appropriate folder for a given artifact .
* @ param generatorName
* Unique name of the generator to return a target folder for .
* @ param artifactName
* Unique name of the artifact to return a target folder for .
* @ return Target folder . */
@ Nullable public final Folder findTargetFolder ( @ NotEmpty final String generatorName , @ NotEmpty final String artifactName ) { } } | Contract . requireArgNotEmpty ( "generatorName" , generatorName ) ; Contract . requireArgNotEmpty ( "artifactName" , artifactName ) ; if ( parent == null ) { throw new IllegalStateException ( "Parent for generators is not set" ) ; } try { return parent . findTargetFolder ( generatorName , artifactName ) ; } catch ( final ProjectNameNotDefinedException ex ) { throw new RuntimeException ( "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'" , ex ) ; } catch ( final ArtifactNotFoundException ex ) { throw new RuntimeException ( "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'" , ex ) ; } catch ( final FolderNameNotDefinedException ex ) { throw new RuntimeException ( "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'" , ex ) ; } catch ( final GeneratorNotFoundException ex ) { throw new RuntimeException ( "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'" , ex ) ; } catch ( final ProjectNotFoundException ex ) { throw new RuntimeException ( "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'" , ex ) ; } catch ( final FolderNotFoundException ex ) { throw new RuntimeException ( "Couldn't determine target folder for generator '" + generatorName + "' and artifact '" + artifactName + "'" , ex ) ; } |
public class DateTimeUtils { /** * / * long - > ISO8601 */
public String toISO8601Date ( long utcEpochMillis , @ Nullable DateTimeZone dtz ) { } } | return toISO8601Date ( new DateTime ( utcEpochMillis , dtz ) , dtz ) ; |
public class SessionBeanO { /** * SessionBeanO */
@ Override public void setEnterpriseBean ( Object bean ) { } } | super . setEnterpriseBean ( bean ) ; if ( bean instanceof SessionBean ) { sessionBean = ( SessionBean ) bean ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.