signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TiffReader { /** * Gets the result of the validation .
* @ param profile the TiffIT profile ( 0 : default , 1 : P1 , 2 : P2)
* @ return the validation result */
public ValidationResult getTiffITValidation ( int profile ) { } } | TiffITProfile bpit = new TiffITProfile ( tiffModel , profile ) ; bpit . validate ( ) ; return bpit . getValidation ( ) ; |
public class _ClassUtils { /** * Gets the ClassLoader associated with the current thread . Returns the class loader associated with the specified
* default object if no context loader is associated with the current thread .
* @ return ClassLoader */
protected static ClassLoader getContextClassLoader ( ) { } } | if ( System . getSecurityManager ( ) != null ) { try { Object cl = AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { public Object run ( ) throws PrivilegedActionException { return Thread . currentThread ( ) . getContextClassLoader ( ) ; } } ) ; return ( ClassLoader ) cl ; } catch ( PrivilegedActionException pae ) { throw new FacesException ( pae ) ; } } else { return Thread . currentThread ( ) . getContextClassLoader ( ) ; } |
public class ListSkillsStoreCategoriesResult { /** * The list of categories .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setCategoryList ( java . util . Collection ) } or { @ link # withCategoryList ( java . util . Collection ) } if you want to
* override the existing values .
* @ param categoryList
* The list of categories .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListSkillsStoreCategoriesResult withCategoryList ( Category ... categoryList ) { } } | if ( this . categoryList == null ) { setCategoryList ( new java . util . ArrayList < Category > ( categoryList . length ) ) ; } for ( Category ele : categoryList ) { this . categoryList . add ( ele ) ; } return this ; |
public class AstyanaxEventReaderDAO { /** * Reads the ordered manifest for a channel . The read can either be weak or strong . A weak read will use CL1
* and may use the cached oldest slab from a previous strong call to improve performance . A strong read will use
* CL local _ quorum and will always read the entire manifest row . This makes a weak read significantly faster than a
* strong read but also means the call is not guaranteed to return the entire manifest . Because of this at least
* every 10 seconds a weak read for a channel is automatically promoted to a strong read .
* The vast majority of calls to this method are performed during a " peek " or " poll " operation . Since these are
* typically called repeatedly a weak call provides improved performance while guaranteeing that at least every
* 10 seconds the manifest is strongly read so no slabs are missed over time . Calls which must guarantee
* the full manifest should explicitly request strong consistency . */
private Iterator < Column < ByteBuffer > > readManifestForChannel ( final String channel , final boolean weak ) { } } | final ByteBuffer oldestSlab = weak ? _oldestSlab . getIfPresent ( channel ) : null ; final ConsistencyLevel consistency ; RangeBuilder range = new RangeBuilder ( ) . setLimit ( 50 ) ; if ( oldestSlab != null ) { range . setStart ( oldestSlab ) ; consistency = ConsistencyLevel . CL_LOCAL_ONE ; } else { consistency = ConsistencyLevel . CL_LOCAL_QUORUM ; } final Iterator < Column < ByteBuffer > > manifestColumns = executePaginated ( _keyspace . prepareQuery ( ColumnFamilies . MANIFEST , consistency ) . getKey ( channel ) . withColumnRange ( range . build ( ) ) . autoPaginate ( true ) ) ; if ( oldestSlab != null ) { // Query was executed weakly using the cached oldest slab , so don ' t update the cache with an unreliable oldest value
return manifestColumns ; } else { PeekingIterator < Column < ByteBuffer > > peekingManifestColumns = Iterators . peekingIterator ( manifestColumns ) ; if ( peekingManifestColumns . hasNext ( ) ) { // Cache the first slab returned from querying the full manifest column family since it is the oldest .
cacheOldestSlabForChannel ( channel , TimeUUIDSerializer . get ( ) . fromByteBuffer ( peekingManifestColumns . peek ( ) . getName ( ) ) ) ; return peekingManifestColumns ; } else { // Channel was completely empty . Cache a TimeUUID for the current time . This will cause future calls
// to read at most 1 minute of tombstones until the cache expires 10 seconds later .
cacheOldestSlabForChannel ( channel , TimeUUIDs . newUUID ( ) ) ; return Iterators . emptyIterator ( ) ; } } |
public class SibRaConnectionFactory { /** * Creates a connection to a messaging engine . The creation is delegated to
* the JCA connection manager . This either creates a new managed connection
* or finds an existing one that matches this request . The connection
* manager obtains a connection handle to the managed connection which is
* what is returned by this method .
* @ param subject
* the subject to authenticate to the messaging engine with
* @ param connectionProperties
* the connection properties that identify the messaging engine
* to connect to
* @ throws SIResourceException
* if an exception relating to the JCA processing occurs
* @ throws SIAuthenticationException
* if an exception occurs when delegating to the underlying core
* SPI implementation
* @ throws SIIncorrectCallException
* if an exception occurs when delegating to the underlying core
* SPI implementation
* @ throws SINotPossibleInCurrentConfigurationException
* if an exception occurs when delegating to the underlying core
* SPI implementation */
public SICoreConnection createConnection ( final Subject subject , final Map connectionProperties ) throws SIResourceException , SINotPossibleInCurrentConfigurationException , SIIncorrectCallException , SIAuthenticationException { } } | if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "createConnection" , new Object [ ] { SibRaUtils . subjectToString ( subject ) , connectionProperties } ) ; } final ConnectionRequestInfo connectionRequestInfo = new SibRaConnectionRequestInfo ( subject , connectionProperties ) ; final SibRaConnection result = createConnection ( connectionRequestInfo ) ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "createConnection" , result ) ; } return result ; |
public class DeviceImpl { /** * Get device black box .
* It ' s the master method executed when the device black box is requested .
* It reads the device black box , update it and return black - box data to the
* client
* @ param n
* The number of actions description which must be returned to
* the client . The number of returned element is limited to the
* number of elements stored in the black - box or to the complete
* black - box depth if it is full .
* @ return The device black box with one String for each action requested on
* the device
* @ exception DevFailed
* If it is not possible to read the device black box . Click
* href = " . . / . . / tango _ basic / idl _ html / Tango . html # DevFailed " > here
* < / a > to read < b > DevFailed < / b > exception specification */
public String [ ] black_box ( final int n ) throws DevFailed { } } | Util . out4 . println ( "DeviceImpl.black_box() arrived" ) ; final String [ ] ret = blackbox . read ( n ) ; // Record operation request in black box
blackbox . insert_op ( Op_BlackBox ) ; Util . out4 . println ( "Leaving DeviceImpl.black_box()" ) ; return ret ; |
public class JxnetAutoConfiguration { /** * Thread pool .
* @ return returns { @ link ExecutorService } object . */
@ Bean ( EXECUTOR_SERVICE_BEAN_NAME ) public ExecutorService executorService ( ) { } } | if ( this . properties . getNumberOfThread ( ) == 0 ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Use cached thread pool." ) ; } return Executors . newCachedThreadPool ( ) ; } if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Use {} fixed thread pool." , this . properties . getNumberOfThread ( ) ) ; } return Executors . newFixedThreadPool ( this . properties . getNumberOfThread ( ) ) ; |
public class SystemClock { /** * Waits a given number of milliseconds ( of uptimeMillis ) before returning .
* Similar to { @ link java . lang . Thread # sleep ( long ) } , but does not throw
* { @ link InterruptedException } ; { @ link Thread # interrupt ( ) } events are
* deferred until the next interruptible operation . Does not return until
* at least the specified number of milliseconds has elapsed .
* @ param ms to sleep before returning , in milliseconds of uptime . */
public static void sleep ( long ms ) { } } | long start = uptimeMillis ( ) ; long duration = ms ; boolean interrupted = false ; do { try { Thread . sleep ( duration ) ; } catch ( InterruptedException e ) { interrupted = true ; } duration = start + ms - uptimeMillis ( ) ; } while ( duration > 0 ) ; if ( interrupted ) { // Important : we don ' t want to quietly eat an interrupt ( ) event ,
// so we make sure to re - interrupt the thread so that the next
// call to Thread . sleep ( ) or Object . wait ( ) will be interrupted .
Thread . currentThread ( ) . interrupt ( ) ; } |
public class ExceptionSwallower { /** * Transform a Runnable to log and then swallow any thrown exceptions . However , { @ link Error } s are still re - thrown .
* @ param in the runnable to wrap
* @ return a runnable that will swallow exceptions */
@ SuppressWarnings ( { } } | "PMD.AvoidCatchingThrowable" , "PMD.AvoidInstanceofChecksInCatchClause" } ) public static Runnable swallowExceptions ( Runnable in ) { return ( ) -> { try { in . run ( ) ; } catch ( Error tt ) { LOGGER . error ( "Error (will be rethrown)" , tt ) ; throw tt ; } catch ( Throwable t ) { LOGGER . error ( "Uncaught exception swallowed" , t ) ; // Ignore the IDE warning - consider Lombok ' s SneakyThrows , which is an abomination but heavily used by heathens , whom I pray for .
if ( t instanceof InterruptedException ) { Thread . currentThread ( ) . interrupt ( ) ; } } } ; |
public class ICalParameters { /** * Gets the FBTYPE ( free busy type ) parameter value .
* This parameter is used by the { @ link FreeBusy } property . It defines
* whether the person is " free " or " busy " over the time periods that are
* specified in the property value . If this parameter is not set , the user
* should be considered " busy " during these times .
* @ return the free busy type or null if not set
* @ see < a href = " http : / / tools . ietf . org / html / rfc5545 # page - 20 " > RFC 5545
* p . 20 < / a > */
public FreeBusyType getFreeBusyType ( ) { } } | String value = first ( FBTYPE ) ; return ( value == null ) ? null : FreeBusyType . get ( value ) ; |
public class JGTProcessingRegion { /** * Transforms the GRASS bounds strings in metric or degree to decimal .
* @ param north the north string .
* @ param south the south string .
* @ param east the east string .
* @ param west the west string .
* @ return the array of the bounds in doubles . */
@ SuppressWarnings ( "nls" ) private double [ ] nsewStringsToNumbers ( String north , String south , String east , String west ) { } } | double no = - 1.0 ; double so = - 1.0 ; double ea = - 1.0 ; double we = - 1.0 ; if ( north . indexOf ( "N" ) != - 1 || north . indexOf ( "n" ) != - 1 ) { north = north . substring ( 0 , north . length ( ) - 1 ) ; no = degreeToNumber ( north ) ; } else if ( north . indexOf ( "S" ) != - 1 || north . indexOf ( "s" ) != - 1 ) { north = north . substring ( 0 , north . length ( ) - 1 ) ; no = - degreeToNumber ( north ) ; } else { no = Double . parseDouble ( north ) ; } if ( south . indexOf ( "N" ) != - 1 || south . indexOf ( "n" ) != - 1 ) { south = south . substring ( 0 , south . length ( ) - 1 ) ; so = degreeToNumber ( south ) ; } else if ( south . indexOf ( "S" ) != - 1 || south . indexOf ( "s" ) != - 1 ) { south = south . substring ( 0 , south . length ( ) - 1 ) ; so = - degreeToNumber ( south ) ; } else { so = Double . parseDouble ( south ) ; } if ( west . indexOf ( "E" ) != - 1 || west . indexOf ( "e" ) != - 1 ) { west = west . substring ( 0 , west . length ( ) - 1 ) ; we = degreeToNumber ( west ) ; } else if ( west . indexOf ( "W" ) != - 1 || west . indexOf ( "w" ) != - 1 ) { west = west . substring ( 0 , west . length ( ) - 1 ) ; we = - degreeToNumber ( west ) ; } else { we = Double . parseDouble ( west ) ; } if ( east . indexOf ( "E" ) != - 1 || east . indexOf ( "e" ) != - 1 ) { east = east . substring ( 0 , east . length ( ) - 1 ) ; ea = degreeToNumber ( east ) ; } else if ( east . indexOf ( "W" ) != - 1 || east . indexOf ( "w" ) != - 1 ) { east = east . substring ( 0 , east . length ( ) - 1 ) ; ea = - degreeToNumber ( east ) ; } else { ea = Double . parseDouble ( east ) ; } return new double [ ] { no , so , ea , we } ; |
public class XpathQuery { /** * Selects from an XML document using an XPATH query .
* @ param xmlDocument XML string or path to xml file
* @ param xmlDocumentSource The source type of the xml document .
* Valid values : xmlString , xmlPath
* Default value : xmlString
* @ param xPathQuery XPATH query
* @ param queryType type of selection result from query attribute value
* @ param delimiter optional - string to use as delimiter in case query _ type is nodelist
* @ param secureProcessing optional - whether to use secure processing
* @ return map of results containing success or failure text , a result message , and the value selected */
@ Action ( name = "XpathQuery" , outputs = { } } | @ Output ( RETURN_CODE ) , @ Output ( RETURN_RESULT ) , @ Output ( SELECTED_VALUE ) , @ Output ( ERROR_MESSAGE ) } , responses = { @ Response ( text = ResponseNames . SUCCESS , field = RETURN_CODE , value = SUCCESS , matchType = COMPARE_EQUAL ) , @ Response ( text = ResponseNames . FAILURE , field = RETURN_CODE , value = FAILURE , matchType = COMPARE_EQUAL , isDefault = true , isOnFail = true ) } ) public Map < String , String > execute ( @ Param ( value = Constants . Inputs . XML_DOCUMENT , required = true ) String xmlDocument , @ Param ( Constants . Inputs . XML_DOCUMENT_SOURCE ) String xmlDocumentSource , @ Param ( value = Constants . Inputs . XPATH_QUERY , required = true ) String xPathQuery , @ Param ( value = Constants . Inputs . QUERY_TYPE , required = true ) String queryType , @ Param ( Constants . Inputs . DELIMITER ) String delimiter , @ Param ( Constants . Inputs . SECURE_PROCESSING ) String secureProcessing ) { final CommonInputs commonInputs = new CommonInputs . CommonInputsBuilder ( ) . withXmlDocument ( xmlDocument ) . withXmlDocumentSource ( xmlDocumentSource ) . withXpathQuery ( xPathQuery ) . withSecureProcessing ( secureProcessing ) . build ( ) ; final CustomInputs customInputs = new CustomInputs . CustomInputsBuilder ( ) . withQueryType ( queryType ) . withDelimiter ( delimiter ) . build ( ) ; return new XpathQueryService ( ) . execute ( commonInputs , customInputs ) ; |
public class ZkDeployMgrImpl { /** * 获取每个配置级别的Map数据 , Key是配置 , Value是ZK配置数据
* @ return */
public Map < String , ZkDisconfData > getZkDisconfDataMap ( String app , String env , String version ) { } } | return zooKeeperDriver . getDisconfData ( app , env , version ) ; |
public class KPipeline { /** * Helper method that creates a pipeline with a set of { @ link KProcedure } .
* @ param program
* the program that contains the pipelines
* @ param procedures
* the list of procedures to chain in the sampe pipeline */
public static void pipeline ( KProgram program , KProcedure ... procedures ) { } } | if ( procedures . length < 2 ) { throw new IllegalArgumentException ( MessageKind . E0003 . format ( ) ) ; } KProcedure kLastProcedure = procedures [ procedures . length - 1 ] ; KProcedure previous = null ; boolean isLastPipeline = false ; for ( KProcedure procedure : procedures ) { if ( procedure . equals ( kLastProcedure ) ) { isLastPipeline = true ; } if ( previous != null ) { new KPipeline ( program , previous , procedure , isLastPipeline ) ; } previous = procedure ; } |
public class SGDFobos { /** * Initializes all the parameters for optimization . */
@ Override protected void init ( DifferentiableBatchFunction function , IntDoubleVector point ) { } } | super . init ( function , point ) ; this . accumLr = new DoubleArrayList ( ) ; this . iterOfLastStep = new int [ function . getNumDimensions ( ) ] ; Arrays . fill ( iterOfLastStep , - 1 ) ; |
public class MagicMimeEntry { /** * Match short .
* @ param bbuf the bbuf
* @ param bo the bo
* @ param needMask the need mask
* @ param sMask the s mask
* @ return true , if successful
* @ throws IOException Signals that an I / O exception has occurred . */
private boolean matchShort ( final ByteBuffer bbuf , final ByteOrder bo , final boolean needMask , final short sMask ) throws IOException { } } | bbuf . order ( bo ) ; short got ; final String testContent = getContent ( ) ; if ( testContent . startsWith ( "0x" ) ) { got = ( short ) Integer . parseInt ( testContent . substring ( 2 ) , 16 ) ; } else if ( testContent . startsWith ( "&" ) ) { got = ( short ) Integer . parseInt ( testContent . substring ( 3 ) , 16 ) ; } else { got = ( short ) Integer . parseInt ( testContent ) ; } short found = bbuf . getShort ( ) ; if ( needMask ) { found = ( short ) ( found & sMask ) ; } if ( got != found ) { return false ; } return true ; |
public class DumpHelper { /** * A help method to log result pojo
* @ param result the map contains info that needs to be logged */
static void logResult ( Map < String , Object > result , DumpConfig config ) { } } | Consumer < String > loggerFunc = getLoggerFuncBasedOnLevel ( config . getLogLevel ( ) ) ; if ( config . isUseJson ( ) ) { logResultUsingJson ( result , loggerFunc ) ; } else { int startLevel = - 1 ; StringBuilder sb = new StringBuilder ( "Http request/response information:" ) ; _logResult ( result , startLevel , config . getIndentSize ( ) , sb ) ; loggerFunc . accept ( sb . toString ( ) ) ; } |
public class MethodBase { /** * Get the decoded and fixed resource URI . This calls getServletPath ( ) to
* obtain the path information . The description of that method is a little
* obscure in it ' s meaning . In a request of this form : < br / > < br / >
* " GET / ucaldav / user / douglm / calendar / 1302064354993 - g . ics HTTP / 1.1 [ \ r ] [ \ n ] " < br / > < br / >
* getServletPath ( ) will return < br / > < br / >
* / user / douglm / calendar / 1302064354993 - g . ics < br / > < br / >
* that is the context has been removed . In addition this method will URL
* decode the path . getRequestUrl ( ) does neither .
* @ param req Servlet request object
* @ return List Path elements of fixed up uri
* @ throws ServletException */
public List < String > getResourceUri ( final HttpServletRequest req ) throws ServletException { } } | String uri = req . getServletPath ( ) ; if ( ( uri == null ) || ( uri . length ( ) == 0 ) ) { /* No path specified - set it to root . */
uri = "/" ; } return fixPath ( uri ) ; |
public class A_CmsUploadDialog { /** * Shows the overwrite dialog . < p >
* @ param infoBean the info bean containing the existing and invalid file names */
private void showOverwriteDialog ( CmsUploadFileBean infoBean ) { } } | // update the dialog
m_selectionDone = true ; m_okButton . enable ( ) ; if ( infoBean . getInvalidFileNames ( ) . isEmpty ( ) && infoBean . getExistingDeletedFileNames ( ) . isEmpty ( ) ) { displayDialogInfo ( Messages . get ( ) . key ( Messages . GUI_UPLOAD_INFO_OVERWRITE_0 ) , true ) ; } else { displayDialogInfo ( Messages . get ( ) . key ( Messages . GUI_UPLOAD_INFO_INVALID_0 ) , true ) ; } if ( m_uploadButton instanceof UIObject ) { ( ( UIObject ) m_uploadButton ) . getElement ( ) . getStyle ( ) . setDisplay ( Display . NONE ) ; } // clear the list
m_fileList . clearList ( ) ; // handle existing files
List < String > existings = new ArrayList < String > ( infoBean . getExistingResourceNames ( ) ) ; Collections . sort ( existings , String . CASE_INSENSITIVE_ORDER ) ; for ( String filename : existings ) { addFileToList ( m_filesToUpload . get ( filename ) , false , false , false ) ; } // handle the invalid files
List < String > invalids = new ArrayList < String > ( infoBean . getInvalidFileNames ( ) ) ; Collections . sort ( invalids , String . CASE_INSENSITIVE_ORDER ) ; for ( String filename : invalids ) { addFileToList ( m_filesToUpload . get ( filename ) , true , false , false ) ; m_filesToUpload . remove ( filename ) ; } // handle the invalid files
List < String > existingDeleted = new ArrayList < String > ( infoBean . getExistingDeletedFileNames ( ) ) ; Collections . sort ( existingDeleted , String . CASE_INSENSITIVE_ORDER ) ; for ( String filename : existingDeleted ) { addFileToList ( m_filesToUpload . get ( filename ) , false , true , false ) ; m_filesToUpload . remove ( filename ) ; } // set the height of the content
setHeight ( ) ; |
public class ScoreSettingsService { /** * Initialize build score settings
* If build widget settings are present merge it with default score settings
* Initialize settings for children scores in build widget */
private void initBuildScoreSettings ( ) { } } | BuildScoreSettings buildScoreSettings = this . scoreSettings . getBuildWidget ( ) ; if ( null != buildScoreSettings ) { buildScoreSettings . setCriteria ( Utils . mergeCriteria ( this . scoreSettings . getCriteria ( ) , buildScoreSettings . getCriteria ( ) ) ) ; initBuildScoreChildrenSettings ( buildScoreSettings ) ; } |
public class DateTimeStaticExtensions { /** * Parse text into a { @ link java . time . ZonedDateTime } using the provided pattern .
* @ param type placeholder variable used by Groovy categories ; ignored for default static methods
* @ param text String to be parsed to create the date instance
* @ param pattern pattern used to parse the text
* @ return a ZonedDateTime representing the parsed text
* @ throws java . lang . IllegalArgumentException if the pattern is invalid
* @ throws java . time . format . DateTimeParseException if the text cannot be parsed
* @ see java . time . format . DateTimeFormatter
* @ see java . time . ZonedDateTime # parse ( java . lang . CharSequence , java . time . format . DateTimeFormatter )
* @ since 2.5.0 */
public static ZonedDateTime parse ( final ZonedDateTime type , CharSequence text , String pattern ) { } } | return ZonedDateTime . parse ( text , DateTimeFormatter . ofPattern ( pattern ) ) ; |
public class DefaultIncrementalAttributesMapper { /** * Lookup all values for the specified attribute , looping through the results incrementally if necessary .
* @ param ldapOperations The instance to use for performing the actual lookup .
* @ param dn The distinguished name of the object to find .
* @ param attribute name of the attribute to request .
* @ return an Attributes instance , populated with all found values for the requested attribute .
* Never < code > null < / code > , though the actual attribute may not be set if it was not
* set on the requested object . */
public static Attributes lookupAttributes ( LdapOperations ldapOperations , String dn , String attribute ) { } } | return lookupAttributes ( ldapOperations , LdapUtils . newLdapName ( dn ) , attribute ) ; |
public class PtoPInputHandler { /** * Creates an AREYOUFLUSHED message for sending
* @ return the new AREYOUFLUSHED message
* @ throws SIResourceException if the message can ' t be created . */
protected ControlAreYouFlushed createControlAreYouFlushed ( ) throws SIResourceException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createControlAreYouFlushed" ) ; ControlAreYouFlushed flushedqMsg = null ; // Create new message
try { flushedqMsg = _cmf . createNewControlAreYouFlushed ( ) ; } catch ( MessageCreateFailedException e ) { // FFDC
FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PtoPInputHandler.createControlAreYouFlushed" , "1:1661:1.323" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "createControlAreYouFlushed" , e ) ; } SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PtoPInputHandler" , "1:1672:1.323" , e } ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PtoPInputHandler" , "1:1680:1.323" , e } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createControlAreYouFlushed" ) ; return flushedqMsg ; |
public class ServerService { /** * Restore a given archived server to a specified group
* @ param server server reference
* @ param group group reference
* @ return OperationFuture wrapper for BaseServerResponse */
public OperationFuture < Link > restore ( Server server , Group group ) { } } | return baseServerResponse ( restore ( server , groupService . findByRef ( group ) . getId ( ) ) ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcConstraint ( ) { } } | if ( ifcConstraintEClass == null ) { ifcConstraintEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 107 ) ; } return ifcConstraintEClass ; |
public class JobsInner { /** * Adds a Job that gets executed on a cluster .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param jobName The name of the job within the specified resource group . Job names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name must be from 1 through 64 characters long .
* @ param parameters The parameters to provide for job creation .
* @ 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 JobInner object if successful . */
public JobInner create ( String resourceGroupName , String jobName , JobCreateParameters parameters ) { } } | return createWithServiceResponseAsync ( resourceGroupName , jobName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class BasePool { /** * Can we allocate a value of size ' sizeInBytes ' without exceeding the hard cap on the pool size ?
* If allocating this value will take the pool over the hard cap , we will first trim the pool down
* to its soft cap , and then check again .
* If the current used bytes + this new value will take us above the hard cap , then we return
* false immediately - there is no point freeing up anything .
* @ param sizeInBytes the size ( in bytes ) of the value to allocate
* @ return true , if we can allocate this ; false otherwise */
@ VisibleForTesting synchronized boolean canAllocate ( int sizeInBytes ) { } } | int hardCap = mPoolParams . maxSizeHardCap ; // even with our best effort we cannot ensure hard cap limit .
// Return immediately - no point in trimming any space
if ( sizeInBytes > hardCap - mUsed . mNumBytes ) { mPoolStatsTracker . onHardCapReached ( ) ; return false ; } // trim if we need to
int softCap = mPoolParams . maxSizeSoftCap ; if ( sizeInBytes > softCap - ( mUsed . mNumBytes + mFree . mNumBytes ) ) { trimToSize ( softCap - sizeInBytes ) ; } // check again to see if we ' re below the hard cap
if ( sizeInBytes > hardCap - ( mUsed . mNumBytes + mFree . mNumBytes ) ) { mPoolStatsTracker . onHardCapReached ( ) ; return false ; } return true ; |
public class ArrayUtils { /** * Append an Object at end of array */
public static Object [ ] appendArray ( Object [ ] arr , Object obj ) { } } | Object [ ] newArr = new Object [ arr . length + 1 ] ; System . arraycopy ( arr , 0 , newArr , 0 , arr . length ) ; newArr [ arr . length ] = obj ; return newArr ; |
public class PooledServerConnectedObjectManager { /** * Terminates all subscriptions to a given heap from a single session */
private void terminateSubscriptions ( IoSession session , String heapUri , Subscription . CloseReason reason ) { } } | terminateSubscriptions ( session , heapStates . get ( heapUri ) , heapUri , reason ) ; |
public class LibraryBuilder { /** * Record any errors while parsing in both the list of errors but also in the library
* itself so they can be processed easily by a remote client
* @ param e the exception to record */
public void recordParsingException ( CqlTranslatorException e ) { } } | addException ( e ) ; if ( shouldReport ( e . getSeverity ( ) ) ) { CqlToElmError err = af . createCqlToElmError ( ) ; err . setMessage ( e . getMessage ( ) ) ; err . setErrorType ( e instanceof CqlSyntaxException ? ErrorType . SYNTAX : ( e instanceof CqlSemanticException ? ErrorType . SEMANTIC : ErrorType . INTERNAL ) ) ; err . setErrorSeverity ( toErrorSeverity ( e . getSeverity ( ) ) ) ; if ( e . getLocator ( ) != null ) { err . setStartLine ( e . getLocator ( ) . getStartLine ( ) ) ; err . setEndLine ( e . getLocator ( ) . getEndLine ( ) ) ; err . setStartChar ( e . getLocator ( ) . getStartChar ( ) ) ; err . setEndChar ( e . getLocator ( ) . getEndChar ( ) ) ; } if ( e . getCause ( ) != null && e . getCause ( ) instanceof CqlTranslatorIncludeException ) { CqlTranslatorIncludeException incEx = ( CqlTranslatorIncludeException ) e . getCause ( ) ; err . setTargetIncludeLibraryId ( incEx . getLibraryId ( ) ) ; err . setTargetIncludeLibraryVersionId ( incEx . getVersionId ( ) ) ; err . setErrorType ( ErrorType . INCLUDE ) ; } library . getAnnotation ( ) . add ( err ) ; } |
public class HashCodeBuilder { /** * Append a < code > hashCode < / code > for a < code > byte < / code > array .
* @ param array
* the array to add to the < code > hashCode < / code >
* @ return this */
public HashCodeBuilder append ( final byte [ ] array ) { } } | if ( array == null ) { iTotal = iTotal * iConstant ; } else { for ( final byte element : array ) { append ( element ) ; } } return this ; |
public class DummyInternalTransaction { /** * ( non - Javadoc )
* @ see com . ibm . ws . objectManager . InternalTransaction # requestCallback ( com . ibm . ws . objectManager . Token ) */
protected synchronized void requestCallback ( Token tokenToPrePrepare ) throws ObjectManagerException { } } | throw new InvalidStateException ( this , InternalTransaction . stateTerminated , InternalTransaction . stateNames [ InternalTransaction . stateTerminated ] ) ; |
public class ArchiveBase { /** * { @ inheritDoc }
* @ see org . jboss . shrinkwrap . api . Archive # merge ( org . jboss . shrinkwrap . api . Archive , java . lang . String ,
* org . jboss . shrinkwrap . api . Filter ) */
@ Override public T merge ( final Archive < ? > source , final String path , final Filter < ArchivePath > filter ) throws IllegalArgumentException { } } | Validate . notNull ( path , "path must be specified" ) ; return this . merge ( source , ArchivePaths . create ( path ) , filter ) ; |
public class UIComponentTag { /** * Create a UIComponent . Abstract method getComponentType is invoked to determine the actual type name for the
* component to be created .
* If this tag has a " binding " attribute , then that is immediately evaluated to store the created component in the
* specified property . */
@ Override protected UIComponent createComponent ( FacesContext context , String id ) { } } | String componentType = getComponentType ( ) ; if ( componentType == null ) { throw new NullPointerException ( "componentType" ) ; } if ( _binding != null ) { Application application = context . getApplication ( ) ; ValueBinding componentBinding = application . createValueBinding ( _binding ) ; UIComponent component = application . createComponent ( componentBinding , context , componentType ) ; component . setId ( id ) ; component . setValueBinding ( "binding" , componentBinding ) ; setProperties ( component ) ; return component ; } UIComponent component = context . getApplication ( ) . createComponent ( componentType ) ; component . setId ( id ) ; setProperties ( component ) ; return component ; |
public class CreateWSDL20 { /** * AddBindingOperationType Method . */
public void addBindingOperationType ( String strVersion , BindingType bindingType , MessageProcessInfo recMessageProcessInfo ) { } } | String interfacens ; String interfacename ; QName qname ; String value ; BindingOperationType bindingOperationType = wsdlFactory . createBindingOperationType ( ) ; bindingType . getOperationOrFaultOrFeature ( ) . add ( wsdlFactory . createBindingTypeOperation ( bindingOperationType ) ) ; interfacens = this . getNamespace ( ) ; interfacename = this . fixName ( recMessageProcessInfo . getField ( MessageProcessInfo . DESCRIPTION ) . toString ( ) ) ; qname = new QName ( interfacens , interfacename ) ; bindingOperationType . setRef ( qname ) ; interfacens = this . getURIProperty ( WSOAP_BINDING_URI ) ; interfacename = "code" ; qname = new QName ( interfacens , interfacename ) ; value = this . getURIProperty ( SOAP_RESPONSE_URI ) ; bindingOperationType . getOtherAttributes ( ) . put ( qname , value ) ; BindingOperationFaultType bindingOperationFaultType = wsdlFactory . createBindingOperationFaultType ( ) ; bindingOperationFaultType . setRef ( qname ) ; interfacens = this . getURIProperty ( SOAP_SENDING_URI ) ; interfacename = "mep" ; qname = new QName ( interfacens , interfacename ) ; value = this . getURIProperty ( SOAP_RESPONSE_URI ) ; bindingOperationType . getOtherAttributes ( ) . put ( qname , value ) ; |
public class Util { /** * Deletes the given directory and contents recursively using a filter .
* @ param dir a directory to delete
* @ param pathChecker a security check to validate a path before deleting
* @ throws IOException if the operation fails */
@ Restricted ( NoExternalUse . class ) public static void deleteRecursive ( @ Nonnull Path dir , @ Nonnull PathRemover . PathChecker pathChecker ) throws IOException { } } | newPathRemover ( pathChecker ) . forceRemoveRecursive ( dir ) ; |
public class DfuBaseService { /** * This method allows you to update the notification showing the upload progress .
* @ param builder notification builder . */
protected void updateProgressNotification ( @ NonNull final NotificationCompat . Builder builder , final int progress ) { } } | // Add Abort action to the notification
if ( progress != PROGRESS_ABORTED && progress != PROGRESS_COMPLETED ) { final Intent abortIntent = new Intent ( BROADCAST_ACTION ) ; abortIntent . putExtra ( EXTRA_ACTION , ACTION_ABORT ) ; final PendingIntent pendingAbortIntent = PendingIntent . getBroadcast ( this , 1 , abortIntent , PendingIntent . FLAG_UPDATE_CURRENT ) ; builder . addAction ( R . drawable . ic_action_notify_cancel , getString ( R . string . dfu_action_abort ) , pendingAbortIntent ) ; } |
public class HttpMessage { /** * Adds new cookie to this http message .
* @ param cookie The Cookie to set
* @ return The altered HttpMessage */
public HttpMessage cookie ( final Cookie cookie ) { } } | this . cookies . put ( cookie . getName ( ) , cookie ) ; setHeader ( HttpMessageHeaders . HTTP_COOKIE_PREFIX + cookie . getName ( ) , cookieConverter . getCookieString ( cookie ) ) ; return this ; |
public class SDBaseOps { /** * Get a subset of the specified input , by specifying the first element and the size of the array . < br >
* For example , if input is : < br >
* [ a , b , c ] < br >
* [ d , e , f ] < br >
* then slice ( input , begin = [ 0,1 ] , size = [ 2,1 ] will return : < br >
* [ b ] < br >
* [ e ] < br >
* < br >
* Note that for each dimension i , begin [ i ] + size [ i ] < = input . size ( i )
* @ param name Output variable name
* @ param input Variable to get subset of
* @ param begin Beginning index . Must be same length as rank of input array
* @ param size Size of the output array . Must be same length as rank of input array
* @ return Subset of the input */
public SDVariable slice ( String name , SDVariable input , int [ ] begin , int [ ] size ) { } } | SDVariable ret = f ( ) . slice ( input , begin , size ) ; return updateVariableNameAndReference ( ret , name ) ; |
public class Proposal { /** * Sets the offlineErrors value for this Proposal .
* @ param offlineErrors * Errors that occurred during offline processes . If any errors
* occur during an offline process ,
* such as reserving inventory , this field will be populated
* with those errors , otherwise this
* field will be null .
* This attribute is read - only . */
public void setOfflineErrors ( com . google . api . ads . admanager . axis . v201808 . OfflineError [ ] offlineErrors ) { } } | this . offlineErrors = offlineErrors ; |
public class BaseMessageQueue { /** * Initializes this message queue .
* Adds this queue to the message manager .
* @ param manager My parent message manager .
* @ param strQueueName This queue ' s name .
* @ param strQueueType This queue ' s type ( LOCAL / JMS ) . */
public void init ( BaseMessageManager manager , String strQueueName , String strQueueType ) { } } | m_manager = manager ; m_strQueueName = strQueueName ; m_strQueueType = strQueueType ; if ( m_manager != null ) m_manager . addMessageQueue ( this ) ; |
public class Errors { /** * Provides a message from the resource bundle < code > activejdbc _ messages < / code > which is merged
* with parameters . This methods expects the message in the resource bundle to be parametrized .
* This message is configured for a validator using a Fluent Interface when declaring a validator :
* < pre >
* public class Temperature extends Model {
* static {
* validateRange ( " temp " , 0 , 100 ) . message ( " temperature cannot be less than { 0 } or more than { 1 } " ) ;
* < / pre >
* @ param attributeName name of attribute in error .
* @ param params list of parameters for a message . The order of parameters in this list will correspond to the
* numeric order in the parameters listed in the message and has nothing to do with a physical order . This means
* that the 0th parameter in the list will correspond to < code > { 0 } < / code > , 1st to < code > { 1 } < / code > and so on .
* @ return a message from the resource bundle < code > activejdbc _ messages < / code > with default locale , which is merged
* with parameters . */
public String get ( String attributeName , Object ... params ) { } } | if ( attributeName == null ) throw new NullPointerException ( "attributeName cannot be null" ) ; return validators . get ( attributeName ) . formatMessage ( locale , params ) ; |
public class MBooleanTableCellRenderer { /** * { @ inheritDoc } */
@ Override public Component getTableCellRendererComponent ( final JTable table , final Object value , final boolean isSelected , final boolean hasFocus , final int row , final int column ) { } } | if ( isSelected ) { super . setForeground ( table . getSelectionForeground ( ) ) ; super . setBackground ( table . getSelectionBackground ( ) ) ; } else { super . setForeground ( table . getForeground ( ) ) ; if ( MTable . BICOLOR_LINE != null && row % 2 == 0 ) { super . setBackground ( MTable . BICOLOR_LINE ) ; } else { super . setBackground ( table . getBackground ( ) ) ; } } if ( hasFocus ) { setBorder ( BORDER ) ; } else { setBorder ( null ) ; } setEnabled ( table . isCellEditable ( row , column ) ) ; if ( value instanceof Boolean ) { final boolean selected = ( ( Boolean ) value ) . booleanValue ( ) ; this . setSelected ( selected ) ; // this . setToolTipText ( selected ? " vrai " : " false " ) ;
return this ; } final JLabel label = ( JLabel ) table . getDefaultRenderer ( String . class ) . getTableCellRendererComponent ( table , null , isSelected , hasFocus , row , column ) ; if ( value == null ) { label . setText ( null ) ; } else { label . setText ( "??" ) ; } return label ; |
public class XmlUtils { /** * Parses an XML string into a DOM .
* @ param xml the XML string
* @ return the parsed DOM
* @ throws SAXException if the string is not valid XML */
public static Document toDocument ( String xml ) throws SAXException { } } | try { return toDocument ( new StringReader ( xml ) ) ; } catch ( IOException e ) { // reading from string
throw new RuntimeException ( e ) ; } |
public class ExtendedPredicates { /** * Create a predicate to check if a throwable ' s error message contains a specific string .
* @ param expected The expected string
* @ param caseSensitive Is the comparison going to be case sensitive
* @ return True if the throwable ' s message contains the expected string . */
public static Predicate < Throwable > throwableContainsMessage ( final String expected , final boolean caseSensitive ) { } } | return new Predicate < Throwable > ( ) { public boolean apply ( Throwable input ) { String actual = input . getMessage ( ) ; String exp = expected ; if ( ! caseSensitive ) { actual = actual . toLowerCase ( ) ; exp = exp . toLowerCase ( ) ; } return actual . contains ( exp ) ; } } ; |
public class CompletableFuture { /** * Returns the encoding of a copied outcome ; if exceptional ,
* rewraps as a CompletionException , else returns argument . */
static Object encodeRelay ( Object r ) { } } | Throwable x ; return ( ( ( r instanceof AltResult ) && ( x = ( ( AltResult ) r ) . ex ) != null && ! ( x instanceof CompletionException ) ) ? new AltResult ( new CompletionException ( x ) ) : r ) ; |
public class ImplementingClassResolver { /** * ToDo this result could be cached . . . . */
private < I > Class < ? extends I > handleOneSubType ( final Class < I > interf , final Object o ) { } } | final Class < ? extends I > implClass = ( Class < ? extends I > ) o ; final Set < Class < ? > > producersForInterface = findProducersFor ( interf ) ; final Set < Class < ? > > producersForImpl = findProducersFor ( implClass ) ; // @ formatter : off
if ( ! producersForInterface . isEmpty ( ) && ! producersForImpl . isEmpty ( ) ) return interf ; if ( producersForInterface . isEmpty ( ) && producersForImpl . isEmpty ( ) ) return implClass ; if ( producersForImpl . isEmpty ( ) ) return interf ; if ( producersForInterface . isEmpty ( ) ) return implClass ; // @ formatter : on
return null ; |
public class BitVector { /** * Returns whether this BitVector contains all bits that are set to true in
* the specified BitSet .
* @ param bitset the bits to inspect in this BitVector
* @ return true if this BitVector contains all bits that are set to true in
* the specified BitSet , false otherwise */
public boolean contains ( long [ ] bitset ) { } } | for ( int i = 0 ; i < bitset . length ; i ++ ) { final long b = bitset [ i ] ; if ( i >= bits . length && b != 0L ) { return false ; } if ( ( b & bits [ i ] ) != b ) { return false ; } } return true ; |
public class ConfigurationFile { /** * Given { @ code name } , determine the intended main configuration file . Handles special cases , including
* " last " , " initial " , " boot " , " v1 " , and , if persistence to the original file is not supported , absolute paths .
* @ param rawName default name for the main configuration file . Cannot be { @ code null }
* @ param name user provided name of the main configuration , or { @ code null } if not was provided */
private File determineMainFile ( final String rawName , final String name ) { } } | assert rawName != null ; String mainName = null ; if ( name == null ) { // Just use the default
mainName = rawName ; } else if ( name . equals ( LAST ) || name . equals ( INITIAL ) || name . equals ( BOOT ) ) { // Search for a * single * file in the configuration dir with suffix = = name . xml
mainName = findMainFileFromBackupSuffix ( historyRoot , name ) ; } else if ( VERSION_PATTERN . matcher ( name ) . matches ( ) ) { // Search for a * single * file in the currentHistory dir with suffix = = name . xml
mainName = findMainFileFromBackupSuffix ( currentHistory , name ) ; } if ( mainName == null ) { // Search for a * single * file in the snapshots dir with prefix = = name . xml
mainName = findMainFileFromSnapshotPrefix ( name ) ; } if ( mainName == null ) { // Try the basic case , where name is the name
final File directoryFile = new File ( configurationDir , name ) ; if ( directoryFile . exists ( ) ) { mainName = stripPrefixSuffix ( name ) ; // TODO what if the stripped name doesn ' t exist ? And why would there be a file like configuration / standalone . last . xml ?
} else if ( interactionPolicy . isReadOnly ( ) ) { // We allow absolute paths in this case
final File absoluteFile = new File ( name ) ; if ( absoluteFile . exists ( ) ) { return absoluteFile ; } } } if ( mainName == null && ! interactionPolicy . isRequireExisting ( ) ) { mainName = stripPrefixSuffix ( name ) ; } if ( mainName != null ) { return new File ( configurationDir , new File ( mainName ) . getName ( ) ) ; } throw ControllerLogger . ROOT_LOGGER . mainFileNotFound ( name != null ? name : rawName , configurationDir ) ; |
public class HttpHeader { /** * Add the header stored in internal hashtable
* @ param name
* @ param value */
private void addInternalHeaderFields ( String name , String value ) { } } | String key = normalisedHeaderName ( name ) ; Vector < String > v = getHeaders ( key ) ; if ( v == null ) { v = new Vector < > ( ) ; mHeaderFields . put ( key , v ) ; } if ( value != null ) { v . add ( value ) ; } else { mHeaderFields . remove ( key ) ; } |
public class DataSiftODP { /** * Send data to DataSift ODP ingestion endpoint using batch upload method .
* @ param sourceId the ODP source ID to use for data ingestion
* @ param interactions String containing new - line delimited data items
* @ return a result containing details on accepted interactions , or errors if batch failed */
public FutureData < ODPBatchResponse > batch ( String sourceId , String interactions ) { } } | FutureData < ODPBatchResponse > future = new FutureData < > ( ) ; URI uri = newParams ( ) . forURL ( config . newIngestionAPIEndpointURI ( sourceId ) ) ; JSONRequest request = config . http ( ) . postJSON ( uri , new PageReader ( newRequestCallback ( future , new ODPBatchResponse ( ) , config ) ) ) . setData ( interactions ) ; performRequest ( future , request ) ; return future ; |
public class PropertyAccessor { /** * Retrieves the value of the
* < a href = " http : / / docs . oracle . com / javase / tutorial / javabeans / index . html " target = " _ blank " > JavaBeans < / a > property .
* Examples :
* < pre >
* / / import static { @ link org . fest . reflect . core . Reflection # property ( String ) org . fest . reflect . core . Reflection . property } ;
* / / Equivalent to " String name = person . getName ( ) "
* String name = { @ link org . fest . reflect . core . Reflection # property ( String ) property } ( " name " ) . { @ link org . fest . reflect . beanproperty . PropertyName # ofType ( Class ) ofType } ( String . class ) . { @ link org . fest . reflect . beanproperty . PropertyType # in ( Object ) in } ( person ) . { @ link org . fest . reflect . beanproperty . PropertyAccessor # get ( ) get } ( ) ;
* / / Equivalent to " person . setName ( " Yoda " ) "
* { @ link org . fest . reflect . core . Reflection # property ( String ) property } ( " name " ) . { @ link org . fest . reflect . beanproperty . PropertyName # ofType ( Class ) ofType } ( String . class ) . { @ link org . fest . reflect . beanproperty . PropertyType # in ( Object ) in } ( person ) . { @ link org . fest . reflect . beanproperty . PropertyAccessor # set ( Object ) set } ( " Yoda " ) ;
* / / Equivalent to " List & lt ; String & gt ; powers = jedi . getPowers ( ) "
* List & lt ; String & gt ; powers = { @ link org . fest . reflect . core . Reflection # property ( String ) property } ( " powers " ) . { @ link org . fest . reflect . beanproperty . PropertyName # ofType ( org . fest . reflect . reference . TypeRef ) ofType } ( new { @ link org . fest . reflect . reference . TypeRef TypeRef } & lt ; List & lt ; String & gt ; & gt ; ( ) { } ) . { @ link org . fest . reflect . beanproperty . PropertyTypeRef # in ( Object ) in } ( jedi ) . { @ link org . fest . reflect . beanproperty . PropertyAccessor # get ( ) get } ( ) ;
* / / Equivalent to " jedi . setPowers ( powers ) "
* List & lt ; String & gt ; powers = new ArrayList & lt ; String & gt ; ( ) ;
* powers . add ( " heal " ) ;
* { @ link org . fest . reflect . core . Reflection # property ( String ) property } ( " powers " ) . { @ link org . fest . reflect . beanproperty . PropertyName # ofType ( org . fest . reflect . reference . TypeRef ) ofType } ( new { @ link org . fest . reflect . reference . TypeRef TypeRef } & lt ; List & lt ; String & gt ; & gt ; ( ) { } ) . { @ link org . fest . reflect . beanproperty . PropertyTypeRef # in ( Object ) in } ( jedi ) . { @ link org . fest . reflect . beanproperty . PropertyAccessor # set ( Object ) set } ( powers ) ;
* < / pre >
* @ return the value of the JavaBeans property in this fluent interface .
* @ throws ReflectionError if the value of the property cannot be retrieved . */
public @ Nullable T get ( ) { } } | try { Object value = descriptor . getReadMethod ( ) . invoke ( target ) ; return castSafely ( value , propertyType ) ; } catch ( Throwable t ) { String msg = String . format ( "Failed to get the value of property '%s'" , descriptor . getName ( ) ) ; throw new ReflectionError ( msg , t ) ; } |
public class BuildTasksInner { /** * Creates a build task for a container registry with the specified parameters .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param buildTaskName The name of the container registry build task .
* @ param buildTaskCreateParameters The parameters for creating a build task .
* @ 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 BuildTaskInner object if successful . */
public BuildTaskInner beginCreate ( String resourceGroupName , String registryName , String buildTaskName , BuildTaskInner buildTaskCreateParameters ) { } } | return beginCreateWithServiceResponseAsync ( resourceGroupName , registryName , buildTaskName , buildTaskCreateParameters ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class ThreadLocalRandom { /** * Returns a pseudorandom { @ code double } value between 0.0
* ( inclusive ) and the specified bound ( exclusive ) .
* @ param bound the upper bound ( exclusive ) . Must be positive .
* @ return a pseudorandom { @ code double } value between zero
* ( inclusive ) and the bound ( exclusive )
* @ throws IllegalArgumentException if { @ code bound } is not positive */
public double nextDouble ( double bound ) { } } | if ( ! ( bound > 0.0 ) ) throw new IllegalArgumentException ( BAD_BOUND ) ; double result = ( mix64 ( nextSeed ( ) ) >>> 11 ) * DOUBLE_UNIT * bound ; return ( result < bound ) ? result : // correct for rounding
Double . longBitsToDouble ( Double . doubleToLongBits ( bound ) - 1 ) ; |
public class KAFDocument { /** * Hau kendu behar da */
public List < Term > getTermsFromWFs ( List < String > wfIds ) { } } | List < Term > terms = new ArrayList < Term > ( ) ; for ( String wfId : wfIds ) { terms . addAll ( this . wfId2Terms . get ( wfId ) ) ; } return terms ; |
public class JsonUtil { /** * Creates or updates one property at a JCR node .
* @ param node the node which holds the property
* @ param property the property object transformed from JSON
* @ return < code > true < / code > if the property is set and available
* @ throws RepositoryException if storing was not possible ( some reasons ) */
public static boolean setJsonProperty ( Node node , JsonProperty property , MappingRules mapping ) throws RepositoryException { } } | if ( property != null ) { int type = StringUtils . isNotBlank ( property . type ) ? PropertyType . valueFromName ( property . type ) : PropertyType . STRING ; String name = property . name ; String oldname = property . oldname ; if ( ! StringUtils . isBlank ( oldname ) && ! name . equals ( oldname ) && node . hasProperty ( name ) ) { throw new RepositoryException ( "property '" + name + "' already exists" ) ; } if ( property . multi || property . value instanceof Object [ ] ) { // make or store a multi value property
Object [ ] jsonValues = property . value instanceof Object [ ] ? ( Object [ ] ) property . value : null ; if ( jsonValues == null ) { if ( property . value instanceof List ) { // if the value is already a multi value use this directly
List < Object > list = ( List < Object > ) property . value ; jsonValues = list . toArray ( new Object [ list . size ( ) ] ) ; } else { // make a multi value by splitting the string using a comma as delimiter
jsonValues = property . value != null ? property . value . toString ( ) . split ( "\\s*,\\s*" ) : new String [ 0 ] ; } } // make a JCR value for each string value
Value [ ] values = new Value [ jsonValues . length ] ; try { for ( int i = 0 ; i < jsonValues . length ; i ++ ) { values [ i ] = makeJcrValue ( node , type , jsonValues [ i ] , mapping ) ; } } catch ( PropertyValueFormatException pfex ) { return false ; } Property jcrProperty = null ; try { jcrProperty = PropertyUtil . setProperty ( node , name , values , type ) ; } catch ( ValueFormatException vfex ) { // if this exception occurs the property must be transformed to multi value
node . setProperty ( name , ( Value ) null ) ; PropertyUtil . setProperty ( node , name , values , type ) ; } if ( ! StringUtils . isBlank ( oldname ) && ! name . equals ( oldname ) ) { node . setProperty ( oldname , ( Value ) null ) ; } return jcrProperty != null ; } else { // make or store a single value property
String stringValue ; if ( property . value instanceof List ) { // if the value was a multi value before join this to one string
stringValue = StringUtils . join ( ( List < String > ) property . value , ',' ) ; } else { stringValue = property . value != null ? property . value . toString ( ) : null ; } Value value = null ; try { value = makeJcrValue ( node , type , stringValue , mapping ) ; } catch ( PropertyValueFormatException pfex ) { return false ; } Property jcrProperty = null ; try { jcrProperty = PropertyUtil . setProperty ( node , name , value , type ) ; } catch ( ValueFormatException vfex ) { // if this exception occurs the property must be transformed to single value
node . setProperty ( name , ( Value [ ] ) null ) ; PropertyUtil . setProperty ( node , name , value , type ) ; } if ( ! StringUtils . isBlank ( oldname ) && ! name . equals ( oldname ) ) { node . setProperty ( oldname , ( Value ) null ) ; } return jcrProperty != null ; } } return false ; |
public class Config { /** * Returns the cache config with the given name or { @ code null } if there is none .
* The name is matched by pattern to the configuration and by stripping the
* partition ID qualifier from the given { @ code name } .
* @ param name name of the cache config
* @ return the cache configuration or { @ code null } if none was found
* @ throws ConfigurationException if ambiguous configurations are found
* @ see StringPartitioningStrategy # getBaseName ( java . lang . String )
* @ see # setConfigPatternMatcher ( ConfigPatternMatcher )
* @ see # getConfigPatternMatcher ( ) */
public CacheSimpleConfig findCacheConfigOrNull ( String name ) { } } | name = getBaseName ( name ) ; return lookupByPattern ( configPatternMatcher , cacheConfigs , name ) ; |
public class Dispatching { /** * Adapts a predicate to a binary predicate by ignoring second parameter .
* @ param < T1 > the adapted predicate first parameter type
* @ param < T2 > the adapted predicate second parameter type
* @ param predicate the predicate to be adapted
* @ param ignored the adapted predicate ignored parameter type class
* @ return the adapted binary predicate */
public static < T1 , T2 > BiPredicate < T1 , T2 > ignore2nd ( Predicate < T1 > predicate , Class < T2 > ignored ) { } } | dbc . precondition ( predicate != null , "cannot ignore parameter of a null predicate" ) ; return ( first , second ) -> predicate . test ( first ) ; |
public class OptimizeArgumentsArray { /** * Iterate through all the references to arguments array in the
* function to determine the real highestIndex . Returns - 1 when we should not
* be replacing any arguments for this scope - we should exit tryReplaceArguments
* @ param highestIndex highest index that has been accessed from the arguments array */
private int getHighestIndex ( int highestIndex ) { } } | for ( Node ref : currentArgumentsAccesses ) { Node getElem = ref . getParent ( ) ; // Bail on anything but argument [ c ] access where c is a constant .
// TODO ( user ) : We might not need to bail out all the time , there might
// be more cases that we can cover .
if ( ! getElem . isGetElem ( ) || ref != getElem . getFirstChild ( ) ) { return - 1 ; } Node index = ref . getNext ( ) ; // We have something like arguments [ x ] where x is not a constant . That
// means at least one of the access is not known .
if ( ! index . isNumber ( ) || index . getDouble ( ) < 0 ) { // TODO ( user ) : Its possible not to give up just yet . The type
// inference did a ' semi value propagation ' . If we know that string
// is never a subclass of the type of the index . We ' d know that
// it is never ' callee ' .
return - 1 ; // Give up .
} // We want to bail out if someone tries to access arguments [ 0.5 ] for example
if ( index . getDouble ( ) != Math . floor ( index . getDouble ( ) ) ) { return - 1 ; } Node getElemParent = getElem . getParent ( ) ; // When we have argument [ 0 ] ( ) , replacing it with a ( ) is semantically
// different if argument [ 0 ] is a function call that refers to ' this '
if ( getElemParent . isCall ( ) && getElemParent . getFirstChild ( ) == getElem ) { // TODO ( user ) : We can consider using . call ( ) if aliasing that
// argument allows shorter alias for other arguments .
return - 1 ; } // Replace the highest index if we see an access that has a higher index
// than all the one we saw before .
int value = ( int ) index . getDouble ( ) ; if ( value > highestIndex ) { highestIndex = value ; } } return highestIndex ; |
public class Async { /** * The action will be asynchronously executed in UI thread .
* @ param action
* @ param delay
* @ return */
static ContinuableFuture < Void > executeOnUiThread ( final Try . Runnable < ? extends Exception > action , final long delay ) { } } | return execute ( new FutureTask < Void > ( FN . toCallable ( action ) ) , _UI_EXECUTOR , delay ) ; |
public class MiniSat { /** * Returns a new MiniSat solver with a given configuration .
* @ param f the formula factory
* @ param config the configuration
* @ return the solver */
public static MiniSat miniSat ( final FormulaFactory f , final MiniSatConfig config ) { } } | return new MiniSat ( f , SolverStyle . MINISAT , config , null ) ; |
public class GoogleMapShapeConverter { /** * Convert a { @ link MultiPolylineOptions } to a { @ link CompoundCurve }
* @ param multiPolylineOptions multi polyline options
* @ param hasZ has z flag
* @ param hasM has m flag
* @ return compound curve */
public CompoundCurve toCompoundCurveFromOptions ( MultiPolylineOptions multiPolylineOptions , boolean hasZ , boolean hasM ) { } } | CompoundCurve compoundCurve = new CompoundCurve ( hasZ , hasM ) ; for ( PolylineOptions polyline : multiPolylineOptions . getPolylineOptions ( ) ) { LineString lineString = toLineString ( polyline ) ; compoundCurve . addLineString ( lineString ) ; } return compoundCurve ; |
public class ComparableItemListImpl { /** * define a comparator which will be used to sort the list " everytime " it is altered
* NOTE this will only sort if you " set " a new list or " add " new items ( not if you provide a position for the add function )
* @ param comparator used to sort the list
* @ param sortNow specifies if we use the provided comparator to sort now
* @ return this */
public ComparableItemListImpl < Item > withComparator ( @ Nullable Comparator < Item > comparator , boolean sortNow ) { } } | this . mComparator = comparator ; // we directly sort the list with the defined comparator
if ( mItems != null && mComparator != null && sortNow ) { Collections . sort ( mItems , mComparator ) ; getFastAdapter ( ) . notifyAdapterDataSetChanged ( ) ; } return this ; |
public class ConfigCompleteSift { /** * Creates a configuration similar to how it was originally described in the paper */
public static ConfigCompleteSift createPaper ( ) { } } | ConfigCompleteSift config = new ConfigCompleteSift ( ) ; config . scaleSpace = ConfigSiftScaleSpace . createPaper ( ) ; config . detector = ConfigSiftDetector . createPaper ( ) ; config . orientation = ConfigSiftOrientation . createPaper ( ) ; return config ; |
public class IdentityByStateClustering { /** * / _ 0 _ _ 1 _ _ 2 _ _ 3 _ _ 4_
* i 0 | - 0 1 3 6 |
* 1 | - 2 4 7 |
* 2 | - 5 8 |
* 3 | - 9 |
* ` ( j * ( j - 1 ) ) / 2 ` is the amount of numbers in the triangular matrix before the column ` j ` .
* for example , with i = 2 , j = 4:
* ( j * ( j - 1 ) ) / 2 = = 6;
* 6 + i = = 8 */
public int getCompoundIndex ( int first , int second ) { } } | if ( first >= second ) { throw new IllegalArgumentException ( "first (" + first + ") and second (" + second + ") sample indexes, must comply with: 0 <= first < second" ) ; } return ( second * second - second ) / 2 + first ; |
public class Lz4Compressor { /** * Resets compressor so that a new set of input data can be processed . */
@ Override public synchronized void reset ( ) { } } | finish = false ; finished = false ; uncompressedDirectBuf . clear ( ) ; uncompressedDirectBufLen = 0 ; compressedDirectBuf . clear ( ) ; compressedDirectBuf . limit ( 0 ) ; userBufOff = userBufLen = 0 ; bytesRead = bytesWritten = 0L ; |
public class RegionAutoscalerClient { /** * Returns the specified autoscaler .
* < p > Sample code :
* < pre > < code >
* try ( RegionAutoscalerClient regionAutoscalerClient = RegionAutoscalerClient . create ( ) ) {
* ProjectRegionAutoscalerName autoscaler = ProjectRegionAutoscalerName . of ( " [ PROJECT ] " , " [ REGION ] " , " [ AUTOSCALER ] " ) ;
* Autoscaler response = regionAutoscalerClient . getRegionAutoscaler ( autoscaler ) ;
* < / code > < / pre >
* @ param autoscaler Name of the autoscaler to return .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final Autoscaler getRegionAutoscaler ( ProjectRegionAutoscalerName autoscaler ) { } } | GetRegionAutoscalerHttpRequest request = GetRegionAutoscalerHttpRequest . newBuilder ( ) . setAutoscaler ( autoscaler == null ? null : autoscaler . toString ( ) ) . build ( ) ; return getRegionAutoscaler ( request ) ; |
public class InboundHeadersBenchmark { /** * Headers taken from the gRPC spec . */
private static void setupRequestHeaders ( ) { } } | requestHeaders = new AsciiString [ 18 ] ; int i = 0 ; requestHeaders [ i ++ ] = AsciiString . of ( ":method" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "POST" ) ; requestHeaders [ i ++ ] = AsciiString . of ( ":scheme" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "http" ) ; requestHeaders [ i ++ ] = AsciiString . of ( ":path" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "/google.pubsub.v2.PublisherService/CreateTopic" ) ; requestHeaders [ i ++ ] = AsciiString . of ( ":authority" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "pubsub.googleapis.com" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "te" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "trailers" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "grpc-timeout" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "1S" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "content-type" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "application/grpc+proto" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "grpc-encoding" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "gzip" ) ; requestHeaders [ i ++ ] = AsciiString . of ( "authorization" ) ; requestHeaders [ i ] = AsciiString . of ( "Bearer y235.wef315yfh138vh31hv93hv8h3v" ) ; |
public class HyperParameterAlgorithmSpecificationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( HyperParameterAlgorithmSpecification hyperParameterAlgorithmSpecification , ProtocolMarshaller protocolMarshaller ) { } } | if ( hyperParameterAlgorithmSpecification == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( hyperParameterAlgorithmSpecification . getTrainingImage ( ) , TRAININGIMAGE_BINDING ) ; protocolMarshaller . marshall ( hyperParameterAlgorithmSpecification . getTrainingInputMode ( ) , TRAININGINPUTMODE_BINDING ) ; protocolMarshaller . marshall ( hyperParameterAlgorithmSpecification . getAlgorithmName ( ) , ALGORITHMNAME_BINDING ) ; protocolMarshaller . marshall ( hyperParameterAlgorithmSpecification . getMetricDefinitions ( ) , METRICDEFINITIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class UcumEssenceService { /** * / * ( non - Javadoc )
* @ see org . eclipse . ohf . ucum . UcumServiceEx # getCanonicalForm ( org . eclipse . ohf . ucum . UcumEssenceService . Pair ) */
@ Override public Pair getCanonicalForm ( Pair value ) throws UcumException { } } | assert value != null : paramError ( "getCanonicalForm" , "value" , "must not be null" ) ; assert checkStringParam ( value . getCode ( ) ) : paramError ( "getCanonicalForm" , "value.code" , "must not be null or empty" ) ; Term term = new ExpressionParser ( model ) . parse ( value . getCode ( ) ) ; Canonical c = new Converter ( model , handlers ) . convert ( term ) ; if ( value . getValue ( ) == null ) return new Pair ( null , new ExpressionComposer ( ) . compose ( c , false ) ) ; else return new Pair ( value . getValue ( ) . multiply ( c . getValue ( ) ) , new ExpressionComposer ( ) . compose ( c , false ) ) ; |
public class Type { /** * Getter method for instance variable { @ link # storeId } .
* @ return value of instance variable { @ link # storeId } */
public long getStoreId ( ) { } } | final long ret ; if ( this . storeId == 0 && getParentType ( ) != null ) { ret = getParentType ( ) . getStoreId ( ) ; } else { ret = this . storeId ; } return ret ; |
public class CommerceAddressRestrictionUtil { /** * Returns the last commerce address restriction in the ordered set where commerceCountryId = & # 63 ; .
* @ param commerceCountryId the commerce country ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching commerce address restriction , or < code > null < / code > if a matching commerce address restriction could not be found */
public static CommerceAddressRestriction fetchByCommerceCountryId_Last ( long commerceCountryId , OrderByComparator < CommerceAddressRestriction > orderByComparator ) { } } | return getPersistence ( ) . fetchByCommerceCountryId_Last ( commerceCountryId , orderByComparator ) ; |
public class WebServiceRefProcessor { /** * This method will allow us to create an InjectionBinding instance for @ Resource annotations found on a method or field
* that are being used to indicate web service reference types . */
@ Override public InjectionBinding < WebServiceRef > createOverrideInjectionBinding ( Class < ? > instanceClass , Member member , Resource resource , String jndiName ) throws InjectionException { } } | Class < ? > typeClass = resource . type ( ) ; if ( member != null ) { Class < ? > inferredType = InjectionHelper . getTypeFromMember ( member ) ; if ( typeClass . getName ( ) . equals ( Object . class . getName ( ) ) ) { // default
typeClass = inferredType ; } else { if ( ! inferredType . isAssignableFrom ( typeClass ) ) { Tr . error ( tc , "error.service.ref.member.level.annotation.type.not.compatible" , member . getName ( ) , member . getDeclaringClass ( ) . getName ( ) , typeClass . getName ( ) , inferredType . getName ( ) ) ; throw new InjectionException ( Tr . formatMessage ( tc , "error.service.ref.member.level.annotation.type.not.compatible" , member . getName ( ) , member . getDeclaringClass ( ) . getName ( ) , typeClass . getName ( ) , inferredType . getName ( ) ) ) ; } } } InjectionBinding < WebServiceRef > binding ; // only service type injections are possible with the @ Resource annotation
if ( Service . class . isAssignableFrom ( typeClass ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The @Resource annotation found has type=" + typeClass . getName ( ) + " and is refers to a JAX-WS service reference" ) ; } binding = WebServiceRefBindingBuilder . createWebServiceRefBindingFromResource ( resource , ivNameSpaceConfig , typeClass , jndiName ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The @Resource annotation found did not refer to a web service reference type." ) ; } binding = null ; } return binding ; |
public class LogRecorderManager { /** * RSS feed for log entries . */
public void doRss ( StaplerRequest req , StaplerResponse rsp ) throws IOException , ServletException { } } | doRss ( req , rsp , Jenkins . logRecords ) ; |
public class Types { /** * Returns an empty value of requested type . This method returns < code > 0 < / code > , < code > false < / code > , empty string ,
* current date / time , empty collection or empty array if requested type is respectively a number , boolean , string ,
* date , collection or array . If none of previous returns null .
* @ param t desired type for empty value .
* @ return empty value . */
public static Object getEmptyValue ( Type t ) { } } | if ( byte . class . equals ( t ) || Byte . class . equals ( t ) ) { return ( byte ) 0 ; } if ( short . class . equals ( t ) || Short . class . equals ( t ) ) { return ( short ) 0 ; } if ( int . class . equals ( t ) || Integer . class . equals ( t ) ) { return ( int ) 0 ; } if ( long . class . equals ( t ) || Long . class . equals ( t ) ) { return ( long ) 0 ; } if ( float . class . equals ( t ) || Float . class . equals ( t ) ) { return ( float ) 0 ; } if ( double . class . equals ( t ) || Double . class . equals ( t ) ) { return ( double ) 0 ; } if ( Types . isBoolean ( t ) ) { return Boolean . valueOf ( false ) ; } if ( Types . isCharacter ( t ) ) { return '\0' ; } if ( String . class . equals ( t ) ) { return "" ; } if ( Types . isDate ( t ) ) { return new Date ( ) ; } if ( Types . isCollection ( t ) ) { return Classes . newCollection ( t ) ; } if ( Types . isArray ( t ) ) { Array . newInstance ( ( ( Class < ? > ) t ) . getComponentType ( ) , 0 ) ; } return null ; |
public class SelectSubPlanAssembler { /** * Given a specific join order , compute all possible sub - plan - graphs for that
* join order and add them to the deque of plans . If this doesn ' t add plans ,
* it doesn ' t mean no more plans can be generated . It ' s possible that the
* particular join order it got had no reasonable plans .
* @ param joinTree An array of tables in the join order . */
private void generateMorePlansForJoinTree ( JoinNode joinTree ) { } } | assert ( joinTree != null ) ; // generate the access paths for all nodes
generateAccessPaths ( joinTree ) ; List < JoinNode > nodes = joinTree . generateAllNodesJoinOrder ( ) ; generateSubPlanForJoinNodeRecursively ( joinTree , 0 , nodes ) ; |
public class Table { /** * Low level row delete method . Removes the row from the indexes and
* from the Cache . */
private void deleteNoCheck ( Session session , Row row ) { } } | if ( row . isDeleted ( session ) ) { return ; } session . addDeleteAction ( this , row ) ; |
public class Logger { /** * Check whether this category is enabled for the TRACE Level .
* @ return boolean - { @ code true } if this category is enabled for level TRACE , { @ code false } otherwise .
* @ since 1.2.12 */
public boolean isTraceEnabled ( ) { } } | return MINIMUM_LEVEL_COVERS_TRACE && provider . isEnabled ( STACKTRACE_DEPTH , null , org . tinylog . Level . TRACE ) ; |
public class TransitionStateMarshaller { /** * Marshall the given parameter object . */
public void marshall ( TransitionState transitionState , ProtocolMarshaller protocolMarshaller ) { } } | if ( transitionState == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( transitionState . getEnabled ( ) , ENABLED_BINDING ) ; protocolMarshaller . marshall ( transitionState . getLastChangedBy ( ) , LASTCHANGEDBY_BINDING ) ; protocolMarshaller . marshall ( transitionState . getLastChangedAt ( ) , LASTCHANGEDAT_BINDING ) ; protocolMarshaller . marshall ( transitionState . getDisabledReason ( ) , DISABLEDREASON_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class DataEnqueuedInputStream { /** * Signals that no more data is available and an exception should be thrown . */
void endOffering ( IOException exception ) { } } | if ( closed ) { return ; } // closed should never be set by this method - - only the polling side should do it , as it means
// that the CLOSED marker has been encountered .
if ( this . exception == null ) { this . exception = exception ; } // Since this is an unbounded queue , offer ( ) always succeeds .
queue . offer ( CLOSED ) ; |
public class systemglobal_auditsyslogpolicy_binding { /** * Use this API to fetch a systemglobal _ auditsyslogpolicy _ binding resources . */
public static systemglobal_auditsyslogpolicy_binding [ ] get ( nitro_service service ) throws Exception { } } | systemglobal_auditsyslogpolicy_binding obj = new systemglobal_auditsyslogpolicy_binding ( ) ; systemglobal_auditsyslogpolicy_binding response [ ] = ( systemglobal_auditsyslogpolicy_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class Main { /** * Main function .
* @ param args
* the arguments to this function . */
public final static void main ( String [ ] args ) throws IOException { } } | Writer writer = new OutputStreamWriter ( System . out , "utf-8" ) ; XMLOutputter outputter = new XMLOutputter ( writer , "iso-8859-1" ) ; writeXML ( outputter ) ; System . out . println ( ) ; System . out . println ( ) ; outputter . reset ( writer , "utf-8" ) ; writeXML ( outputter ) ; |
public class RestoreManagerImpl { /** * / * ( non - Javadoc )
* @ see org . duracloud . snapshot . restoration . SnapshotRestorationManager # restoreCompleted ( java . lang . String ) */
@ Override public Restoration restoreCompleted ( String restorationId ) throws SnapshotNotFoundException , SnapshotInProcessException , NoRestorationInProcessException , SnapshotException { } } | Restoration restoration = getRestoration ( restorationId ) ; return restoreCompleted ( restoration ) ; |
public class WMessages { /** * Adds a success message .
* When setting < code > encodeText < / code > to < code > false < / code > , it then becomes the responsibility of the application
* to ensure that the text does not contain any characters which need to be escaped .
* < b > WARNING : < / b > If you are using WMessageBox to display " user entered " or untrusted data , use of this method with
* < code > encodeText < / code > set to < code > false < / code > may result in security issues .
* @ param code the message code
* @ param encodeText true to encode the message , false otherwise . */
public void success ( final String code , final boolean encodeText ) { } } | Message message = new Message ( Message . SUCCESS_MESSAGE , code ) ; addMessage ( successMessages , message , encodeText ) ; |
public class ResourceManager { /** * Get the bundle that is active for this thread . This is done by loading
* either the specified locale based resource bundle and , if that fails , by
* looping through the fallback locales to locate a usable bundle .
* @ return the resource bundle */
public ResourceBundle getResourceBundle ( String baseName ) { } } | // System . out . println ( this + " " + this . locale + " ( " + resourceBundles . size ( ) + " ) " ) ;
ResourceBundle bundle = ( ResourceBundle ) resourceBundles . get ( baseName ) ; if ( null == bundle ) { resourceBundles . put ( baseName , bundle = findBundle ( baseName ) ) ; } return bundle ; |
public class SelectConfig { /** * XXX : selectLength should be validated ; selectLength should be greater than resolution */
@ Option ( name = "-sl" , aliases = "--select-length" , metaVar = "<length>" , usage = "Length of select in seconds." ) void setSelectLength ( Duration selectLength ) { } } | m_selectLength = selectLength ; |
public class ConversionManager { /** * Apply convert across an array
* @ param rawString
* @ param arrayType
* @ return an array of converted T objects . */
public < T > T [ ] convertArray ( String rawString , Class < T > arrayType ) { } } | String [ ] elements = split ( rawString ) ; T [ ] array = convertArray ( elements , arrayType ) ; return array ; |
public class GeneratedMessage { /** * For use by generated code only . */
public static < ContainingType extends Message , Type > GeneratedExtension < ContainingType , Type > newMessageScopedGeneratedExtension ( final Message scope , final int descriptorIndex , final Class singularType , final Message defaultInstance ) { } } | // For extensions scoped within a Message , we use the Message to resolve
// the outer class ' s descriptor , from which the extension descriptor is
// obtained .
return new GeneratedExtension < ContainingType , Type > ( new ExtensionDescriptorRetriever ( ) { // @ Override ( Java 1.6 override semantics , but we must support 1.5)
public FieldDescriptor getDescriptor ( ) { return scope . getDescriptorForType ( ) . getExtensions ( ) . get ( descriptorIndex ) ; } } , singularType , defaultInstance ) ; |
public class Properties { /** * File location . . \ bin \ org . jdice . calc . properties
* File content :
* roundingMode = HALF _ UP
* stripTrailingZeros = true
* decimalSeparator . out = ' . '
* decimalSeparator . in = ' . '
* numconverter [ 0 ] = org . jdice . calc . test . NumTest $ CustomObject > org . jdice . calc . test . NumTest $ CustomObjectNumConverter
* operator [ 0 ] = org . jdice . calc . test . CustomOperatorFunctionTest $ QuestionOperator
* function [ 0 ] = org . jdice . calc . test . CustomOperatorFunctionTest $ SumFunction
* @ throws IOException */
public void saveGlobalProperties ( ) throws IOException { } } | File propFile = new File ( getGlobalPropertiesFile ( ) ) ; if ( propFile . createNewFile ( ) || propFile . isFile ( ) ) { java . util . Properties prop = new java . util . Properties ( ) ; if ( getRoundingMode ( ) != null ) prop . put ( "roundingMode" , getRoundingMode ( ) . name ( ) ) ; if ( getScale ( ) != null ) prop . put ( "scale" , getScale ( ) ) ; prop . put ( "stripTrailingZeros" , Boolean . toString ( hasStripTrailingZeros ( ) ) ) ; prop . put ( "decimalSeparator.in" , "'" + getInputDecimalSeparator ( ) + "'" ) ; prop . put ( "decimalSeparator.out" , "'" + getOutputDecimalSeparator ( ) + "'" ) ; if ( getGroupingSeparator ( ) != null ) prop . put ( "groupingSeparator" , getGroupingSeparator ( ) ) ; if ( getOutputFormat ( ) != null ) prop . put ( "outputFormat" , getOutputFormat ( ) ) ; // Global NumConverter
HashMap < Class , NumConverter > cncs = CacheExtension . getAllNumConverter ( ) ; int count = 0 ; for ( Entry < Class , NumConverter > cnc : cncs . entrySet ( ) ) { prop . put ( "numconverter[" + count ++ + "]" , cnc . getKey ( ) . getName ( ) + " > " + cnc . getValue ( ) . getClass ( ) . getName ( ) ) ; } // Global Operator
HashMap < Class < ? extends Operator > , Operator > cops = CacheExtension . getOperators ( ) ; count = 0 ; for ( Entry < Class < ? extends Operator > , Operator > cop : cops . entrySet ( ) ) { prop . put ( "operator[" + count ++ + "]" , cop . getKey ( ) . getName ( ) ) ; } // Global Function
HashMap < Class < ? extends Function > , Function > cfns = CacheExtension . getFunctions ( ) ; count = 0 ; for ( Entry < Class < ? extends Function > , Function > cfn : cfns . entrySet ( ) ) { prop . put ( "function[" + count ++ + "]" , cfn . getKey ( ) . getName ( ) ) ; } FileOutputStream fos = new FileOutputStream ( propFile ) ; prop . store ( fos , "Global properties for jCalc" ) ; fos . close ( ) ; fos . flush ( ) ; } |
public class FieldSet { /** * Useful for implementing
* { @ link Message # hasField ( Descriptors . FieldDescriptor ) } . */
public boolean hasField ( final FieldDescriptorType descriptor ) { } } | if ( descriptor . isRepeated ( ) ) { throw new IllegalArgumentException ( "hasField() can only be called on non-repeated fields." ) ; } return fields . get ( descriptor ) != null ; |
public class DescribeClustersRequest { /** * The names of the DAX clusters being described .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setClusterNames ( java . util . Collection ) } or { @ link # withClusterNames ( java . util . Collection ) } if you want to
* override the existing values .
* @ param clusterNames
* The names of the DAX clusters being described .
* @ return Returns a reference to this object so that method calls can be chained together . */
public DescribeClustersRequest withClusterNames ( String ... clusterNames ) { } } | if ( this . clusterNames == null ) { setClusterNames ( new java . util . ArrayList < String > ( clusterNames . length ) ) ; } for ( String ele : clusterNames ) { this . clusterNames . add ( ele ) ; } return this ; |
public class Checker { /** * Emit an error with specified locator .
* @ param message the error message
* @ throws SAXException if something goes wrong */
public void err ( String message , Locator overrideLocator ) throws SAXException { } } | if ( errorHandler != null ) { SAXParseException spe = new SAXParseException ( message , overrideLocator ) ; errorHandler . error ( spe ) ; } |
public class DefaultGroovyMethods { /** * Iterates through an aggregate type or data structure ,
* passing each item to the given closure . Custom types may utilize this
* method by simply providing an " iterator ( ) " method . The items returned
* from the resulting iterator will be passed to the closure .
* < pre class = " groovyTestCase " >
* String result = ' '
* [ ' a ' , ' b ' , ' c ' ] . each { result + = it }
* assert result = = ' abc '
* < / pre >
* @ param self the object over which we iterate
* @ param closure the closure applied on each element found
* @ return the self Object
* @ since 1.0 */
public static < T > T each ( T self , Closure closure ) { } } | each ( InvokerHelper . asIterator ( self ) , closure ) ; return self ; |
public class DescribeComplianceByConfigRuleRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeComplianceByConfigRuleRequest describeComplianceByConfigRuleRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeComplianceByConfigRuleRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeComplianceByConfigRuleRequest . getConfigRuleNames ( ) , CONFIGRULENAMES_BINDING ) ; protocolMarshaller . marshall ( describeComplianceByConfigRuleRequest . getComplianceTypes ( ) , COMPLIANCETYPES_BINDING ) ; protocolMarshaller . marshall ( describeComplianceByConfigRuleRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class PaymentChannelClientConnection { /** * Increments the total value which we pay the server .
* @ param size How many satoshis to increment the payment by ( note : not the new total ) .
* @ throws ValueOutOfRangeException If the size is negative or would pay more than this channel ' s total value
* ( { @ link PaymentChannelClientConnection # state ( ) } . getTotalValue ( ) )
* @ throws IllegalStateException If the channel has been closed or is not yet open
* ( see { @ link PaymentChannelClientConnection # getChannelOpenFuture ( ) } for the second ) */
public ListenableFuture < PaymentIncrementAck > incrementPayment ( Coin size ) throws ValueOutOfRangeException , IllegalStateException { } } | return channelClient . incrementPayment ( size , null , null ) ; |
public class LdapUtils { /** * New connection factory connection factory .
* @ param l the l
* @ return the connection factory */
public static DefaultConnectionFactory newLdaptiveConnectionFactory ( final AbstractLdapProperties l ) { } } | LOGGER . debug ( "Creating LDAP connection factory for [{}]" , l . getLdapUrl ( ) ) ; val cc = newLdaptiveConnectionConfig ( l ) ; val bindCf = new DefaultConnectionFactory ( cc ) ; if ( l . getProviderClass ( ) != null ) { try { val clazz = ClassUtils . getClass ( l . getProviderClass ( ) ) ; bindCf . setProvider ( Provider . class . cast ( clazz . getDeclaredConstructor ( ) . newInstance ( ) ) ) ; } catch ( final Exception e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } } return bindCf ; |
public class TexFileUtilsImpl { /** * ( non - Javadoc )
* @ see org . m2latex . mojo . TexFileUtils # copyLatexSrcToTempDir ( java . io . File , java . io . File ) */
public void copyLatexSrcToTempDir ( File texDirectory , File tempDirectory ) throws MojoExecutionException { } } | try { if ( tempDirectory . exists ( ) ) { log . info ( "Deleting existing directory " + tempDirectory . getPath ( ) ) ; FileUtils . deleteDirectory ( tempDirectory ) ; } log . debug ( "Copying TeX source directory (" + texDirectory . getPath ( ) + ") to temporary directory (" + tempDirectory + ")" ) ; FileUtils . copyDirectory ( texDirectory , tempDirectory ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "Failure copying the TeX directory (" + texDirectory . getPath ( ) + ") to a temporary directory (" + tempDirectory . getPath ( ) + ")." , e ) ; } |
public class OrientModelGraph { /** * Checks if a model is already visited in the path search algorithm . Needed for the loop detection . */
private boolean alreadyVisited ( ODocument neighbor , ODocument [ ] steps ) { } } | for ( ODocument step : steps ) { ODocument out = graph . getOutVertex ( step ) ; if ( out . equals ( neighbor ) ) { return true ; } } return false ; |
public class WisdomExecutor { /** * Launches the Wisdom server in background using the { @ literal chameleon . sh } scripts .
* This method works only on Linux and Mac OS X .
* @ param mojo the mojo
* @ throws MojoExecutionException if the Wisdom instance cannot be started . */
public void executeInBackground ( AbstractWisdomMojo mojo ) throws MojoExecutionException { } } | File script = new File ( mojo . getWisdomRootDirectory ( ) , "chameleon.sh" ) ; if ( ! script . isFile ( ) ) { throw new MojoExecutionException ( "The 'chameleon.sh' file does not exist in " + mojo . getWisdomRootDirectory ( ) . getAbsolutePath ( ) + " - cannot launch Wisdom" ) ; } // Remove the RUNNING _ PID file if exists .
File pid = new File ( mojo . getWisdomRootDirectory ( ) , "RUNNING_PID" ) ; if ( pid . isFile ( ) ) { mojo . getLog ( ) . info ( "The RUNNING_PID file is present, deleting it" ) ; FileUtils . deleteQuietly ( pid ) ; } // We create a command line , as we are using th toString method on it .
CommandLine cmdLine = new CommandLine ( script ) ; appendSystemPropertiesToCommandLine ( mojo , cmdLine ) ; try { mojo . getLog ( ) . info ( "Launching Wisdom Server using '" + cmdLine . toString ( ) + "'." ) ; // As we know which command line we are executing , we can safely execute the command .
Runtime . getRuntime ( ) . exec ( cmdLine . toStrings ( ) , null , mojo . getWisdomRootDirectory ( ) ) ; // NOSONAR see comment
} catch ( IOException e ) { throw new MojoExecutionException ( "Cannot execute Wisdom" , e ) ; } |
public class LoggerRepositoryExImpl { /** * Set the name of this repository .
* Note that once named , a repository cannot be rerenamed .
* @ param repoName name of hierarchy */
public void setName ( final String repoName ) { } } | if ( name == null ) { name = repoName ; } else if ( ! name . equals ( repoName ) ) { throw new IllegalStateException ( "Repository [" + name + "] cannot be renamed as [" + repoName + "]." ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.