signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ChineseCalendar { /** * / * [ deutsch ]
* < p > Erzeugt ein neues chinesisches Kalenderdatum am traditionellen Neujahrstag . < / p >
* @ param gregorianYear gregorian calendar year
* @ return new instance of { @ code ChineseCalendar }
* @ throws IllegalArgumentException in case of any inconsistenci... | return ChineseCalendar . of ( EastAsianYear . forGregorian ( gregorianYear ) , EastAsianMonth . valueOf ( 1 ) , 1 ) ; |
public class ModifyReplicationInstanceRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ModifyReplicationInstanceRequest modifyReplicationInstanceRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( modifyReplicationInstanceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( modifyReplicationInstanceRequest . getReplicationInstanceArn ( ) , REPLICATIONINSTANCEARN_BINDING ) ; protocolMarshaller . marshall ( modifyReplicationI... |
public class TypeConversionUtil { /** * Convert an array of primitives or Objects like double [ ] [ ] or Double [ ] into the requested type . 2D array will be
* converted to a 1D array
* @ param < T >
* @ param type
* the componant type
* @ param val
* @ return
* @ throws DevFailed */
public static < T > ... | Object result = null ; final Object array1D = val ; if ( val == null || type . isAssignableFrom ( val . getClass ( ) ) ) { result = val ; } else { LOGGER . debug ( "converting {} to {}" , val . getClass ( ) . getCanonicalName ( ) , type . getCanonicalName ( ) ) ; final Class < ? > typeConv = Array . newInstance ( type ... |
public class RedmineJSONParser { /** * Fetches an optional date from an object .
* @ param obj
* object to get a field from .
* @ param field
* field to get a value from .
* @ throws RedmineFormatException
* if value is not valid */
private static Date getShortDateOrNull ( JSONObject obj , String field ) th... | final String dateStr = JsonInput . getStringOrNull ( obj , field ) ; if ( dateStr == null ) { return null ; } final SimpleDateFormat dateFormat ; if ( dateStr . length ( ) >= 5 && dateStr . charAt ( 4 ) == '/' ) dateFormat = RedmineDateUtils . SHORT_DATE_FORMAT . get ( ) ; else dateFormat = RedmineDateUtils . SHORT_DAT... |
public class KnowledgeRuntimeManagerFactory { /** * Creates a new KnowledgeRuntimeManager .
* @ param type the KnowledgeRuntimeManagerType
* @ return the new KnowledgeRuntimeManager */
public KnowledgeRuntimeManager newRuntimeManager ( KnowledgeRuntimeManagerType type ) { } } | RuntimeManager runtimeManager ; final String identifier = _identifierRoot + IDENTIFIER_COUNT . incrementAndGet ( ) ; final ClassLoader origTCCL = Classes . setTCCL ( _classLoader ) ; try { runtimeManager = _runtimeManagerBuilder . build ( type , identifier ) ; } finally { Classes . setTCCL ( origTCCL ) ; } return new K... |
public class MathExpressions { /** * Create a { @ code coth ( num ) } expression
* < p > Returns the hyperbolic cotangent of num . < / p >
* @ param num numeric expression
* @ return coth ( num ) */
public static < A extends Number & Comparable < ? > > NumberExpression < Double > coth ( Expression < A > num ) { }... | return Expressions . numberOperation ( Double . class , Ops . MathOps . COTH , num ) ; |
public class LinearSystem { /** * Iteratively improve the solution x to machine accuracy .
* @ param b the right - hand side column vector
* @ param x the improved solution column vector
* @ throws matrix . MatrixException if failed to converge */
private void improve ( ColumnVector b , ColumnVector x ) throws Ma... | // Find the largest x element .
double largestX = 0 ; for ( int r = 0 ; r < nRows ; ++ r ) { double absX = Math . abs ( x . values [ r ] [ 0 ] ) ; if ( largestX < absX ) largestX = absX ; } // Is x already as good as possible ?
if ( largestX == 0 ) return ; ColumnVector residuals = new ColumnVector ( nRows ) ; // Itera... |
public class SpatialReferenceSystemDao { /** * { @ inheritDoc } */
@ Override public int create ( SpatialReferenceSystem srs ) throws SQLException { } } | int result = super . create ( srs ) ; updateDefinition_12_063 ( srs ) ; return result ; |
public class GeneralValidator { /** * Processes the specified rule input .
* @ param ruleInput Rule input to be validated . */
private void processRules ( RI ruleInput ) { } } | switch ( ruleToResultHandlerMapping ) { case SPLIT : processEachRuleWithEachResultHandler ( ruleInput ) ; break ; case JOIN : processAllRulesWithEachResultHandler ( ruleInput ) ; break ; default : LOGGER . error ( "Unsupported " + MappingStrategy . class . getSimpleName ( ) + ": " + ruleToResultHandlerMapping ) ; } |
public class ZookeeperNodeInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ZookeeperNodeInfo zookeeperNodeInfo , ProtocolMarshaller protocolMarshaller ) { } } | if ( zookeeperNodeInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( zookeeperNodeInfo . getAttachedENIId ( ) , ATTACHEDENIID_BINDING ) ; protocolMarshaller . marshall ( zookeeperNodeInfo . getClientVpcIpAddress ( ) , CLIENTVPCIPADDRESS... |
public class BugTreeModel { /** * Recursively traverses the tree , opens all nodes matching any bug in the
* list , then creates the full paths to the bugs that are selected This
* keeps whatever bugs were selected selected when sorting DEPRECATED - - Too
* Slow , use openPreviouslySelected */
public void crawlTo... | for ( int i = 0 ; i < getChildCount ( path . getLastPathComponent ( ) ) ; i ++ ) { if ( ! isLeaf ( getChild ( path . getLastPathComponent ( ) , i ) ) ) { for ( BugLeafNode p : bugLeafNodes ) { if ( p . matches ( ( BugAspects ) getChild ( path . getLastPathComponent ( ) , i ) ) ) { tree . expandPath ( path ) ; crawlToOp... |
public class ProgressDialogFragment { /** * Creates and shows an indeterminate progress dialog . Once the progress dialog is shown , it
* will be shown for at least the minDisplayTime ( in milliseconds ) , so that the progress dialog
* does not flash in and out to quickly . */
public static ProgressDialogFragment c... | ProgressDialogFragment dialogFragment = new ProgressDialogFragment ( ) ; dialogFragment . mTitle = title ; dialogFragment . mMessage = message ; dialogFragment . setCancelable ( cancelable ) ; return dialogFragment ; |
public class CmsRepositoryFilter { /** * Checks if a path is filtered out of the filter or not . < p >
* @ param path the path of a resource to check
* @ return true if the name matches one of the given filter patterns */
public boolean isFiltered ( String path ) { } } | for ( int j = 0 ; j < m_filterRules . size ( ) ; j ++ ) { Pattern pattern = m_filterRules . get ( j ) ; if ( isPartialMatch ( pattern , path ) ) { return m_type . equals ( TYPE_EXCLUDE ) ; } } return m_type . equals ( TYPE_INCLUDE ) ; |
public class RdsHttpEndpointConfigMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RdsHttpEndpointConfig rdsHttpEndpointConfig , ProtocolMarshaller protocolMarshaller ) { } } | if ( rdsHttpEndpointConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( rdsHttpEndpointConfig . getAwsRegion ( ) , AWSREGION_BINDING ) ; protocolMarshaller . marshall ( rdsHttpEndpointConfig . getDbClusterIdentifier ( ) , DBCLUSTERIDEN... |
public class Statement { /** * Searches for best matching method for given name and argument types . */
static Method findMethod ( Class < ? > clazz , String methodName , Object [ ] args , boolean isStatic ) throws NoSuchMethodException { } } | Class < ? > [ ] argTypes = getTypes ( args ) ; Method [ ] methods = null ; if ( classMethodsCache . containsKey ( clazz ) ) { methods = classMethodsCache . get ( clazz ) ; } else { methods = clazz . getMethods ( ) ; classMethodsCache . put ( clazz , methods ) ; } ArrayList < Method > fitMethods = new ArrayList < Method... |
public class ExternalTaskEntity { /** * process failed state , make sure that binary entity is created for the errorMessage , shortError
* message does not exceed limit , handle properly retry counts and incidents
* @ param errorMessage - short error message text
* @ param errorDetails - full error details
* @ ... | ensureActive ( ) ; this . setErrorMessage ( errorMessage ) ; if ( errorDetails != null ) { setErrorDetails ( errorDetails ) ; } this . lockExpirationTime = new Date ( ClockUtil . getCurrentTime ( ) . getTime ( ) + retryDuration ) ; setRetriesAndManageIncidents ( retries ) ; produceHistoricExternalTaskFailedEvent ( ) ; |
public class vpnclientlessaccessprofile { /** * Use this API to delete vpnclientlessaccessprofile resources of given names . */
public static base_responses delete ( nitro_service client , String profilename [ ] ) throws Exception { } } | base_responses result = null ; if ( profilename != null && profilename . length > 0 ) { vpnclientlessaccessprofile deleteresources [ ] = new vpnclientlessaccessprofile [ profilename . length ] ; for ( int i = 0 ; i < profilename . length ; i ++ ) { deleteresources [ i ] = new vpnclientlessaccessprofile ( ) ; deletereso... |
public class CmsReplaceDialog { /** * Creates the widget to display the selected file information . < p >
* @ param file the file info
* @ return the widget */
private CmsListItemWidget createFileWidget ( CmsFileInfo file ) { } } | String subTitle ; String resourceType = getResourceType ( file ) ; if ( file . getFileSize ( ) > 0 ) { subTitle = CmsUploadButton . formatBytes ( file . getFileSize ( ) ) + " (" + getResourceType ( file ) + ")" ; } else { subTitle = resourceType ; } CmsListInfoBean infoBean = new CmsListInfoBean ( file . getFileName ( ... |
public class ApiOvhRouter { /** * Alter this object properties
* REST : PUT / router / { serviceName } / privateLink / { peerServiceName }
* @ param body [ required ] New object properties
* @ param serviceName [ required ] The internal name of your Router offer
* @ param peerServiceName [ required ] Service na... | String qPath = "/router/{serviceName}/privateLink/{peerServiceName}" ; StringBuilder sb = path ( qPath , serviceName , peerServiceName ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ; |
public class KeyArea { /** * Move the physical binary data to this SQL parameter row .
* This is overidden to move the physical data type .
* @ param statement The SQL prepared statement .
* @ param iParamColumn Starting param column
* @ param iAreaDesc The key field area to get the values from .
* @ param bA... | boolean bForceUniqueKey = false ; int iKeyFieldCount = this . getKeyFields ( bForceUniqueKey , bIncludeTempFields ) ; for ( int iKeyFieldSeq = DBConstants . MAIN_KEY_FIELD ; iKeyFieldSeq < iKeyFieldCount ; iKeyFieldSeq ++ ) { KeyField keyField = this . getKeyField ( iKeyFieldSeq , bForceUniqueKey ) ; BaseField fieldPar... |
public class CommerceWishListLocalServiceWrapper { /** * Creates a new commerce wish list with the primary key . Does not add the commerce wish list to the database .
* @ param commerceWishListId the primary key for the new commerce wish list
* @ return the new commerce wish list */
@ Override public com . liferay ... | return _commerceWishListLocalService . createCommerceWishList ( commerceWishListId ) ; |
public class BootNode { /** * Put the node online on the model .
* @ param c the model to alter
* @ return { @ code true } iff the node was offline and is now online */
@ Override public boolean applyAction ( Model c ) { } } | if ( c . getMapping ( ) . isOffline ( node ) ) { c . getMapping ( ) . addOnlineNode ( node ) ; return true ; } return false ; |
public class WMenuItem { /** * { @ inheritDoc } */
@ Override public boolean isSelected ( ) { } } | WMenu menu = WebUtilities . getAncestorOfClass ( WMenu . class , this ) ; if ( menu != null ) { return menu . getSelectedMenuItems ( ) . contains ( this ) ; } return false ; |
public class FastAdapter { /** * adds a new event hook for an item
* NOTE : this has to be called before adding the first items , as this won ' t be called anymore after the ViewHolders were created
* @ param eventHook the event hook to be added for an item
* @ return this */
public FastAdapter < Item > withEvent... | if ( eventHooks == null ) { eventHooks = new LinkedList < > ( ) ; } eventHooks . add ( eventHook ) ; return this ; |
public class ApiOvhDedicatedserver { /** * Get disk smart informations
* REST : GET / dedicated / server / { serviceName } / statistics / disk / { disk } / smart
* @ param serviceName [ required ] The internal name of your dedicated server
* @ param disk [ required ] Disk */
public OvhRtmDiskSmart serviceName_sta... | String qPath = "/dedicated/server/{serviceName}/statistics/disk/{disk}/smart" ; StringBuilder sb = path ( qPath , serviceName , disk ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhRtmDiskSmart . class ) ; |
public class ExecPty { /** * There is only a 4 line output from ttytype - s :
* TERM = ' vt200 ' ; export TERM ;
* LINES = 47 ; export LINES ;
* COLUMNS = 112 ; export COLUMNS ;
* ERASE = ' ^ ? ' ; export ERASE ;
* @ param cfg input
* @ return size */
static Size doGetHPUXSize ( String cfg ) { } } | String [ ] tokens = cfg . split ( ";" ) ; return new Size ( Integer . parseInt ( tokens [ 4 ] . substring ( 9 ) ) , Integer . parseInt ( tokens [ 2 ] . substring ( 7 ) ) ) ; |
public class CssReader { /** * Read forward n characters , or until the next character is EOF .
* @ throws IOException */
CssReader forward ( int n ) throws IOException { } } | for ( int i = 0 ; i < n ; i ++ ) { // TODO escape awareness
Mark mark = mark ( ) ; next ( ) ; if ( curChar == - 1 ) { unread ( curChar , mark ) ; break ; } } return this ; |
public class AsynchronousRequest { /** * For more info on professions API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / professions " > here < / a > < br / >
* Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwable ) }... | isParamValid ( new ParamChecker ( ids ) ) ; gw2API . getProfessionInfo ( processIds ( ids ) , GuildWars2 . lang . getValue ( ) ) . enqueue ( callback ) ; |
public class RouterChain { /** * 筛选Provider
* @ param request 本次调用 ( 可以得到类名 , 方法名 , 方法参数 , 参数值等 )
* @ param providerInfos providers ( < b > 当前可用 < / b > 的服务Provider列表 )
* @ return 路由匹配的服务Provider列表 */
public List < ProviderInfo > route ( SofaRequest request , List < ProviderInfo > providerInfos ) { } } | for ( Router router : routers ) { providerInfos = router . route ( request , providerInfos ) ; } return providerInfos ; |
public class WrappedConsumerSetChangeCallback { /** * Method consumerSetChange
* If the transition variable is negative at the point of invoking the callback ,
* then the callback is being called in order to signal that there are no longer
* any consumers for the expression on which the callback was registered . ... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "consumerSetChange" ) ; if ( transition < 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Negative transition, isEmpty is true" ) ; callback . consumerSetChange ( true )... |
public class TarEntry { /** * Initialization code common to all constructors . */
private void initialize ( ) { } } | this . file = null ; this . header = new TarHeader ( ) ; this . gnuFormat = false ; this . ustarFormat = true ; // REVIEW What we prefer to use . . .
this . unixFormat = false ; |
public class XBasePanel { /** * Code to display the side Menu .
* @ param out The http output stream .
* @ param reg Local resource bundle .
* @ exception DBException File exception . */
public void printXmlTrailer ( PrintWriter out , ResourceBundle reg ) throws DBException { } } | String strTrailer = reg . getString ( "xmlTrailer" ) ; if ( ( strTrailer == null ) || ( strTrailer . length ( ) == 0 ) ) strTrailer = " <trailer>" + " </trailer>" ; out . println ( strTrailer ) ; |
public class JenkinsServer { /** * Update the xml description of an existing job
* @ param folder the folder .
* @ param jobName the name of the job .
* @ param jobXml the job xml configuration .
* @ param crumbFlag true / false .
* @ throws IOException in case of an error . */
public JenkinsServer updateJob ... | client . post_xml ( UrlUtils . toJobBaseUrl ( folder , jobName ) + "/config.xml" , jobXml , crumbFlag ) ; return this ; |
public class WarsApi { /** * List wars Return a list of wars - - - This route is cached for up to 3600
* seconds
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param ifNoneMatch
* ETag from a previous request . A 304 will be returned if this
* m... | ApiResponse < List < Integer > > resp = getWarsWithHttpInfo ( datasource , ifNoneMatch , maxWarId ) ; return resp . getData ( ) ; |
public class HistoryDAO { /** * Gets the history for a user in the specified year and month
* year - the year in yyyy format
* month - the month in a year . . . values 1 - 12 */
public Result < List < Data > > readByUser ( AuthzTrans trans , String user , int ... yyyymm ) { } } | if ( yyyymm . length == 0 ) { return Result . err ( Status . ERR_BadData , "No or invalid yyyymm specified" ) ; } Result < ResultSet > rs = readByUser . exec ( trans , "user" , user ) ; if ( rs . notOK ( ) ) { return Result . err ( rs ) ; } return extract ( defLoader , rs . value , null , yyyymm . length > 0 ? new YYYY... |
public class KafkaMessageId { /** * Compares this { @ link KafkaMessageId } to { @ code id } . Comparison is made numerically , where the partition is
* considered more significant than the offset within the partition . The resulting ordering of
* { @ link KafkaMessageId } is identical to the ordering in a kafka pa... | // instance is always > null
if ( id == null ) { return 1 ; } // use signum to perform the comparison , mark _ partition more significant than _ offset
return 2 * Integer . signum ( _partition - id . getPartition ( ) ) + Long . signum ( _offset - id . getOffset ( ) ) ; |
public class BeforeExpressionResolver { /** * Collects everything preceding the current JSF node within the same branch of the tree .
* It ' s like " @ previous previous : @ previous previous : @ previous : @ previous . . . " . */
public List < UIComponent > resolve ( UIComponent component , List < UIComponent > pare... | List < UIComponent > result = new ArrayList < UIComponent > ( ) ; for ( UIComponent parent : parentComponents ) { UIComponent grandparent = component . getParent ( ) ; for ( int i = 0 ; i < grandparent . getChildCount ( ) ; i ++ ) { if ( grandparent . getChildren ( ) . get ( i ) == parent ) { if ( i == 0 ) // if this i... |
public class WorkflowsInner { /** * Gets a list of workflows by subscription .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; WorkflowInner & gt ; object */
public Observable < Page < WorkflowInner > > listAsync ( ) { } } | return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < Page < WorkflowInner > > , Page < WorkflowInner > > ( ) { @ Override public Page < WorkflowInner > call ( ServiceResponse < Page < WorkflowInner > > response ) { return response . body ( ) ; } } ) ; |
public class Period { /** * Validates that the temporal has the correct chronology . */
private void validateChrono ( TemporalAccessor temporal ) { } } | Objects . requireNonNull ( temporal , "temporal" ) ; Chronology temporalChrono = temporal . query ( TemporalQueries . chronology ( ) ) ; if ( temporalChrono != null && IsoChronology . INSTANCE . equals ( temporalChrono ) == false ) { throw new DateTimeException ( "Chronology mismatch, expected: ISO, actual: " + tempora... |
public class QueryBuilder { /** * The quotient of two terms , as in { @ code WHERE k = left / right } . */
@ NonNull public static Term divide ( @ NonNull Term left , @ NonNull Term right ) { } } | return new BinaryArithmeticTerm ( ArithmeticOperator . QUOTIENT , left , right ) ; |
public class LineManager { /** * Set the LineCap property
* The display of line endings .
* @ param value property wrapper value around String */
public void setLineCap ( @ Property . LINE_CAP String value ) { } } | PropertyValue propertyValue = lineCap ( value ) ; constantPropertyUsageMap . put ( PROPERTY_LINE_CAP , propertyValue ) ; layer . setProperties ( propertyValue ) ; |
public class CrowdPeerManager { /** * from interface ChatProvider . ChatForwarder */
public boolean forwardTell ( UserMessage message , Name target , ChatService . TellListener listener ) { } } | // look up their auth username from their visible name
Name username = authFromViz ( target ) ; if ( username == null ) { return false ; // sorry kid , don ' t know ya
} // look through our peers to see if the target user is online on one of them
for ( PeerNode peer : _peers . values ( ) ) { CrowdNodeObject cnobj = ( C... |
public class GroupFilterMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GroupFilter groupFilter , ProtocolMarshaller protocolMarshaller ) { } } | if ( groupFilter == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( groupFilter . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( groupFilter . getValues ( ) , VALUES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientEx... |
public class Task { /** * Set a date value .
* @ param index date index ( 1-10)
* @ param value date value */
public void setDate ( int index , Date value ) { } } | set ( selectField ( TaskFieldLists . CUSTOM_DATE , index ) , value ) ; |
public class OAuth2AuthenticationFilter { /** * Checks to see if an error was returned by the OAuth Provider and throws an { @ link AuthenticationException } if
* it was .
* @ param parameters Parameters received from the OAuth Provider .
* @ throws AuthenticationException If an error was returned by the OAuth Pr... | final String errorValues [ ] = parameters . get ( "error" ) ; final String errorReasonValues [ ] = parameters . get ( "error_reason" ) ; final String errorDescriptionValues [ ] = parameters . get ( "error_description" ) ; if ( errorValues != null && errorValues . length > 0 ) { final String error = errorValues [ 0 ] ; ... |
public class DACC { /** * Initializes the method variables */
protected void initVariables ( ) { } } | int ensembleSize = ( int ) this . memberCountOption . getValue ( ) ; this . ensemble = new Classifier [ ensembleSize ] ; this . ensembleAges = new double [ ensembleSize ] ; this . ensembleWindows = new int [ ensembleSize ] [ ( int ) this . evaluationSizeOption . getValue ( ) ] ; |
public class ServerSetup { /** * Creates a copy with verbose mode enabled .
* @ param serverSetups the server setups .
* @ return copies of server setups with verbose mode enabled . */
public static ServerSetup [ ] verbose ( ServerSetup [ ] serverSetups ) { } } | ServerSetup [ ] copies = new ServerSetup [ serverSetups . length ] ; for ( int i = 0 ; i < serverSetups . length ; i ++ ) { copies [ i ] = serverSetups [ i ] . createCopy ( ) . setVerbose ( true ) ; } return copies ; |
public class Corc { /** * Gets the raw { @ link Writable } value for { @ code fieldName }
* @ throws IOException */
public Object getWritable ( String fieldName ) { } } | Object value = getValueMarshaller ( fieldName ) . getWritableObject ( struct ) ; LOG . debug ( "Fetched writable {}={}" , fieldName , value ) ; return value ; |
public class ResourceHandler { public void sendData ( HttpRequest request , HttpResponse response , String pathInContext , Resource resource , boolean writeHeaders ) throws IOException { } } | long resLength = resource . length ( ) ; // see if there are any range headers
Enumeration reqRanges = request . getDotVersion ( ) > 0 ? request . getFieldValues ( HttpFields . __Range ) : null ; if ( ! writeHeaders || reqRanges == null || ! reqRanges . hasMoreElements ( ) ) { // look for a gziped content .
Resource da... |
public class Gauge { /** * Adds the given Section to the list of tickmark sections .
* @ param SECTION */
public void addTickMarkSection ( final Section SECTION ) { } } | if ( null == SECTION ) return ; tickMarkSections . add ( SECTION ) ; Collections . sort ( tickMarkSections , new SectionComparator ( ) ) ; fireUpdateEvent ( REDRAW_EVENT ) ; |
public class Configuration { /** * Gets all siblings with a defined prefix . Child properties will be not returned .
* < strong > Example : < / strong >
* { @ code getSiblings ( " writer " ) } will return properties with the keys { @ code writer } as well as { @ code writerTest }
* but not with the key { @ code w... | Map < String , String > map = new HashMap < String , String > ( ) ; for ( Enumeration < Object > enumeration = properties . keys ( ) ; enumeration . hasMoreElements ( ) ; ) { String key = ( String ) enumeration . nextElement ( ) ; if ( key . startsWith ( prefix ) && ( prefix . endsWith ( "@" ) || key . indexOf ( '.' , ... |
public class Log { /** * Log long string using verbose tag
* @ param TAG The tag .
* @ param longString The long string . */
public static void logLong ( String TAG , String longString ) { } } | InputStream is = new ByteArrayInputStream ( longString . getBytes ( ) ) ; @ SuppressWarnings ( "resource" ) Scanner scan = new Scanner ( is ) ; while ( scan . hasNextLine ( ) ) { Log . v ( TAG , scan . nextLine ( ) ) ; } |
public class UdpContainerSettingsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UdpContainerSettings udpContainerSettings , ProtocolMarshaller protocolMarshaller ) { } } | if ( udpContainerSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( udpContainerSettings . getM2tsSettings ( ) , M2TSSETTINGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: ... |
public class GanttProjectReader { /** * This method extracts project properties from a GanttProject file .
* @ param ganttProject GanttProject file */
private void readProjectProperties ( Project ganttProject ) { } } | ProjectProperties mpxjProperties = m_projectFile . getProjectProperties ( ) ; mpxjProperties . setName ( ganttProject . getName ( ) ) ; mpxjProperties . setCompany ( ganttProject . getCompany ( ) ) ; mpxjProperties . setDefaultDurationUnits ( TimeUnit . DAYS ) ; String locale = ganttProject . getLocale ( ) ; if ( local... |
public class ModelsImpl { /** * Adds a hierarchical entity extractor to the application version .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param hierarchicalModelCreateObject A model containing the name and children of the new entity extractor .
* @ param serviceCallback the... | return ServiceFuture . fromResponse ( addHierarchicalEntityWithServiceResponseAsync ( appId , versionId , hierarchicalModelCreateObject ) , serviceCallback ) ; |
public class Wills { /** * Creates failed { @ link Will } using provided { @ link java . lang . Throwable }
* @ param throwable Will exception
* @ param < A > Type of Will
* @ return Created Will */
public static < A > Will < A > failedWill ( @ Nonnull Throwable throwable ) { } } | return new Of < A > ( Futures . < A > immediateFailedFuture ( throwable ) ) ; |
public class DescribeFileSystemsResult { /** * An array of file system descriptions .
* @ return An array of file system descriptions . */
public java . util . List < FileSystemDescription > getFileSystems ( ) { } } | if ( fileSystems == null ) { fileSystems = new com . amazonaws . internal . SdkInternalList < FileSystemDescription > ( ) ; } return fileSystems ; |
public class PersistentTimerHandle { /** * Write this object to the ObjectOutputStream .
* Note , this is overriding the default Serialize interface
* implementation .
* @ see java . io . Serializable */
private void writeObject ( java . io . ObjectOutputStream out ) throws IOException { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "writeObject: " + this ) ; out . defaultWriteObject ( ) ; // Write out header information first .
out . write ( EYECATCHER ) ; out . writeShort ( PLATFORM ) ; out . writeShort ( VERSION_ID ... |
public class CommerceRegionPersistenceImpl { /** * Returns the commerce region where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found . Uses the finder cache .
* @ param uuid the uuid
* @ param groupId the group ID
* @ return the matching commerce region , or < c... | return fetchByUUID_G ( uuid , groupId , true ) ; |
public class BaseKdDao { /** * { @ inheritDoc } */
@ Override public void put ( String spaceId , String key , Map < String , Object > document , IPutCallback < Map < String , Object > > callback ) throws IOException { } } | kdStorage . put ( spaceId , key , document , new IPutCallback < Map < String , Object > > ( ) { @ Override public void onSuccess ( String spaceId , String key , Map < String , Object > entry ) { // invalidate cache upon successful deletion
invalidateCacheEntry ( spaceId , key , entry ) ; // invoke callback
callback . o... |
public class LazyInitProxyFactory { /** * Check if the object is of the special type { @ link org . ops4j . pax . wicket . spi . ReleasableProxyTarget } and return the target of this interface
* @ param target a { @ link java . lang . Object } object .
* @ return the parameter target or the target of the { @ link o... | if ( target instanceof ProxyTarget ) { return ( ( ProxyTarget ) target ) . getTarget ( ) ; } return target ; |
public class PathNormalizer { /** * Normalizes a path and adds a separator at its start and its end .
* @ param path
* the path
* @ return the normalized path */
public static String asDirPath ( String path ) { } } | String dirPath = path ; if ( ! path . equals ( JawrConstant . URL_SEPARATOR ) ) { dirPath = JawrConstant . URL_SEPARATOR + normalizePath ( path ) + JawrConstant . URL_SEPARATOR ; } return dirPath ; |
public class DataUtil { /** * little - endian or intel format . */
public static void writeUnsignedIntegerLittleEndian ( IO . WritableByteStream io , long value ) throws IOException { } } | io . write ( ( byte ) ( value & 0xFF ) ) ; io . write ( ( byte ) ( ( value >> 8 ) & 0xFF ) ) ; io . write ( ( byte ) ( ( value >> 16 ) & 0xFF ) ) ; io . write ( ( byte ) ( ( value >> 24 ) & 0xFF ) ) ; |
public class RegxCriteria { /** * { @ inheritDoc } */
@ Override public void asSetter ( final StringBuilder sb ) { } } | sb . append ( ".setRegxCriteria(\"" ) ; sb . append ( patternParm ) ; sb . append ( "\")" ) ; |
public class AbstractTokenService { /** * If the passed token is null or expired , this method will throw an
* { @ link Exception } .
* @ param token
* @ throws Exception if the token is not valid ( e . g . because it is expired ) */
@ Transactional ( readOnly = true ) public void validateToken ( E token ) throws... | if ( token == null ) { throw new Exception ( "The provided token is null." ) ; } DateTime expirationDate = ( DateTime ) token . getExpirationDate ( ) ; String tokenValue = token . getToken ( ) ; // check if the token expire date is valid
if ( expirationDate . isBeforeNow ( ) ) { throw new Exception ( "The token '" + to... |
public class IterableExtensions { /** * Returns a view on this iterable that provides at most the first < code > count < / code > entries .
* @ param iterable
* the iterable . May not be < code > null < / code > .
* @ param count
* the number of elements that should be returned at most .
* @ return an iterabl... | if ( iterable == null ) throw new NullPointerException ( "iterable" ) ; if ( count < 0 ) throw new IllegalArgumentException ( "Cannot take a negative number of elements. Argument 'count' was: " + count ) ; if ( count == 0 ) return Collections . emptyList ( ) ; return new Iterable < T > ( ) { @ Override public Iterator ... |
public class SslProvider { /** * Remove Ssl support in the given client bootstrap
* @ param b a bootstrap to search and remove
* @ return passed { @ link Bootstrap } */
public static Bootstrap removeSslSupport ( Bootstrap b ) { } } | BootstrapHandlers . removeConfiguration ( b , NettyPipeline . SslHandler ) ; return b ; |
public class TraitComposer { /** * An utility method which tries to find a method with default implementation ( in the Java 8 semantics ) .
* @ param cNode a class node
* @ param name the name of the method
* @ param params the parameters of the method
* @ return a method node corresponding to a default method ... | if ( cNode == null ) { return null ; } if ( cNode . isInterface ( ) ) { MethodNode method = cNode . getMethod ( name , params ) ; if ( method != null && ! method . isAbstract ( ) ) { // this is a Java 8 only behavior !
return method ; } } ClassNode [ ] interfaces = cNode . getInterfaces ( ) ; for ( ClassNode anInterfac... |
public class AtlasClientV2 { /** * Bulk delete API for all types
* @ param typesDef A composite object that captures all types to be deleted */
public void deleteAtlasTypeDefs ( final AtlasTypesDef typesDef ) throws AtlasServiceException { } } | callAPI ( DELETE_ALL_TYPE_DEFS , AtlasTypesDef . class , AtlasType . toJson ( typesDef ) ) ; |
public class Dictionary { /** * Gets a property ' s value as an int .
* Floating point values will be rounded . The value ` true ` is returned as 1 , ` false ` as 0.
* Returns 0 if the value doesn ' t exist or does not have a numeric value .
* @ param key the key
* @ return the int value . */
@ Override public ... | if ( key == null ) { throw new IllegalArgumentException ( "key cannot be null." ) ; } synchronized ( lock ) { return CBLConverter . asInteger ( getMValue ( internalDict , key ) , internalDict ) ; } |
public class Span { /** * Package private iterator method to access it as a Span . Iterator . */
Span . Iterator spanIterator ( ) { } } | if ( ! sorted ) { Collections . sort ( rows , new RowSeq . RowSeqComparator ( ) ) ; sorted = true ; } return new Span . Iterator ( ) ; |
public class ScheduledMetrics2Reporter { /** * Starts the reporter polling at the given period .
* @ param period the amount of time between polls
* @ param unit the unit for { @ code period } */
public void start ( long period , TimeUnit unit ) { } } | synchronized ( this ) { if ( started ) { throw new IllegalStateException ( "This reporter has already been started" ) ; } final long periodInMS = unit . toMillis ( period ) ; executor . scheduleAtFixedRate ( new Runnable ( ) { @ Override public void run ( ) { try { report ( ) ; } catch ( RuntimeException ex ) { logger ... |
public class Numerizer { /** * string . gsub ! ( / + | ( [ ^ \ d ] ) - ( [ ^ \ \ d ] ) / , ' \ 1 \ 2 ' ) # will mutilate hyphenated - words but shouldn ' t matter for date extraction */
public static String numerize ( String str ) { } } | String numerizedStr = str ; // preprocess
numerizedStr = Numerizer . DEHYPHENATOR . matcher ( numerizedStr ) . replaceAll ( "$1 $2" ) ; // will mutilate hyphenated - words but shouldn ' t matter for date extraction
numerizedStr = Numerizer . DEHALFER . matcher ( numerizedStr ) . replaceAll ( "haAlf" ) ; // take the ' a... |
public class ServerOperations { /** * Parses the result and returns the failure description . If the result was successful , an empty string is
* returned .
* @ param result the result of executing an operation
* @ return the failure message or an empty string */
public static String getFailureDescriptionAsString... | if ( isSuccessfulOutcome ( result ) ) { return "" ; } final String msg ; if ( result . hasDefined ( ClientConstants . FAILURE_DESCRIPTION ) ) { if ( result . hasDefined ( ClientConstants . OP ) ) { msg = String . format ( "Operation '%s' at address '%s' failed: %s" , result . get ( ClientConstants . OP ) , result . get... |
public class LightWeightHashSet { /** * Add given element to the hash table
* @ return true if the element was not present in the table , false otherwise */
protected boolean addElem ( final T element ) { } } | // validate element
if ( element == null ) { throw new IllegalArgumentException ( "Null element is not supported." ) ; } // find hashCode & index
final int hashCode = element . hashCode ( ) ; final int index = getIndex ( hashCode ) ; // return false if already present
if ( containsElem ( index , element , hashCode ) ) ... |
public class SipStack { /** * FOR INTERNAL USE ONLY . Not to be used by a test program . */
public void processResponse ( ResponseEvent arg0 ) { } } | synchronized ( listeners ) { if ( ( ( ResponseEventExt ) arg0 ) . isRetransmission ( ) ) retransmissions ++ ; Iterator iter = listeners . iterator ( ) ; while ( iter . hasNext ( ) == true ) { SipListener listener = ( SipListener ) iter . next ( ) ; listener . processResponse ( arg0 ) ; } } |
public class sslservicegroup { /** * Use this API to update sslservicegroup . */
public static base_response update ( nitro_service client , sslservicegroup resource ) throws Exception { } } | sslservicegroup updateresource = new sslservicegroup ( ) ; updateresource . servicegroupname = resource . servicegroupname ; updateresource . sessreuse = resource . sessreuse ; updateresource . sesstimeout = resource . sesstimeout ; updateresource . nonfipsciphers = resource . nonfipsciphers ; updateresource . ssl3 = r... |
public class ListObjectAttributesRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListObjectAttributesRequest listObjectAttributesRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listObjectAttributesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listObjectAttributesRequest . getDirectoryArn ( ) , DIRECTORYARN_BINDING ) ; protocolMarshaller . marshall ( listObjectAttributesRequest . getObjectReference... |
public class MapLayer { /** * Replies if this layer was mark as temporary lyer .
* < p > A temporary layer means that any things inside this layer is
* assumed to be lost when the layer will be destroyed .
* @ return < code > true < / code > if this layer is temporary , otherwise < code > false < / code > */
@ Pu... | MapLayer layer = this ; GISLayerContainer < ? > container ; while ( layer != null ) { if ( layer . isTemp ) { return true ; } container = layer . getContainer ( ) ; layer = container instanceof MapLayer ? ( MapLayer ) container : null ; } return false ; |
public class HttpServerReefEventHandler { /** * Write Evaluator info on the Response so that to display on web page directly .
* This is for direct browser queries . */
private void writeEvaluatorInfoWebOutput ( final HttpServletResponse response , final List < String > ids ) throws IOException { } } | for ( final String id : ids ) { final EvaluatorDescriptor evaluatorDescriptor = this . reefStateManager . getEvaluators ( ) . get ( id ) ; final PrintWriter writer = response . getWriter ( ) ; if ( evaluatorDescriptor != null ) { final String nodeId = evaluatorDescriptor . getNodeDescriptor ( ) . getId ( ) ; final Stri... |
public class GetStageResult { /** * Route settings for the stage .
* @ param routeSettings
* Route settings for the stage .
* @ return Returns a reference to this object so that method calls can be chained together . */
public GetStageResult withRouteSettings ( java . util . Map < String , RouteSettings > routeSe... | setRouteSettings ( routeSettings ) ; return this ; |
public class JqmEngine { /** * Starts the engine
* @ param nodeName
* the name of the node to start , as in the NODE table of the database .
* @ throws JqmInitError */
void start ( String nodeName , JqmEngineHandler h ) { } } | if ( nodeName == null || nodeName . isEmpty ( ) ) { throw new IllegalArgumentException ( "nodeName cannot be null or empty" ) ; } this . handler = h ; // Set thread name - used in audits
Thread . currentThread ( ) . setName ( "JQM engine;;" + nodeName ) ; // First event
if ( this . handler != null ) { this . handler . ... |
public class CmsHighlightingBorder { /** * Recalculates the position and dimension when a positioning parent is given . < p > */
public void resetPosition ( ) { } } | // fail if no positioning parent given
assert m_positioningParent != null ; if ( m_positioningParent != null ) { setPosition ( m_positioningParent . getOffsetHeight ( ) , m_positioningParent . getOffsetWidth ( ) , 0 , 0 ) ; } |
public class CmsHistoryRow { /** * Gets the file version . < p >
* @ return the file version */
@ Column ( header = org . opencms . workplace . commons . Messages . GUI_LABEL_VERSION_0 , order = 30 ) public String getVersion ( ) { } } | return formatVersion ( m_bean ) ; |
public class TargetVpnGatewayClient { /** * Returns the specified target VPN gateway . Gets a list of available target VPN gateways by
* making a list ( ) request .
* < p > Sample code :
* < pre > < code >
* try ( TargetVpnGatewayClient targetVpnGatewayClient = TargetVpnGatewayClient . create ( ) ) {
* Projec... | GetTargetVpnGatewayHttpRequest request = GetTargetVpnGatewayHttpRequest . newBuilder ( ) . setTargetVpnGateway ( targetVpnGateway == null ? null : targetVpnGateway . toString ( ) ) . build ( ) ; return getTargetVpnGateway ( request ) ; |
public class ResourceDataSource { /** * Get output stream .
* @ returns Output stream
* @ throws IOException IO exception occurred */
@ Override public OutputStream getOutputStream ( ) throws IOException { } } | if ( ! _file . isWriteable ( ) ) { throw new IOException ( "Cannot write" ) ; } return IOUtil . toBufferedOutputStream ( _file . getOutputStream ( ) ) ; |
public class FormModelFactory { /** * Create a child form model nested by this form model identified by the
* provided name . The form object associated with the created child model is
* the value model at the specified parent property path .
* @ param parentModel the model to create the FormModelFactory in
* @... | final ValueModel childValueModel = parentModel . getValueModel ( childFormObjectPropertyPath ) ; return createChildPageFormModel ( parentModel , childPageName , childValueModel ) ; |
public class Util { /** * In Liberty a single GSSToken is created . */
@ Sensitive public static byte [ ] encodeLTPAToken ( Codec codec , @ Sensitive byte [ ] ltpaTokenBytes ) { } } | byte [ ] result = null ; try { // create and encode the initial context token
Any a = ORB . init ( ) . create_any ( ) ; OpaqueHelper . insert ( a , ltpaTokenBytes ) ; byte [ ] init_ctx_token = codec . encode_value ( a ) ; result = createGSSToken ( codec , LTPAMech . LTPA_OID , init_ctx_token ) ; } catch ( Exception ex ... |
public class HTTPClientResponseFetcher { /** * Get the body .
* @ param entity the http entity from the response
* @ param enc the encoding
* @ return the body as a String
* @ throws IOException if the body couldn ' t be fetched */
protected String getBody ( HttpEntity entity , String enc ) throws IOException {... | final StringBuilder body = new StringBuilder ( ) ; String buffer = "" ; if ( entity != null ) { final BufferedReader reader = new BufferedReader ( new InputStreamReader ( entity . getContent ( ) , enc ) ) ; while ( ( buffer = reader . readLine ( ) ) != null ) { body . append ( buffer ) ; } reader . close ( ) ; } return... |
public class SQLiteConnection { /** * Collects statistics about database connection memory usage .
* @ param dbStatsList The list to populate . */
void collectDbStats ( ArrayList < DbStats > dbStatsList ) { } } | // Get information about the main database .
int lookaside = nativeGetDbLookaside ( mConnectionPtr ) ; long pageCount = 0 ; long pageSize = 0 ; try { pageCount = executeForLong ( "PRAGMA page_count;" , null , null ) ; pageSize = executeForLong ( "PRAGMA page_size;" , null , null ) ; } catch ( SQLiteException ex ) { // ... |
public class TDefinitions { /** * Implementing support for internal model */
@ Override public List < DecisionService > getDecisionService ( ) { } } | return drgElement . stream ( ) . filter ( DecisionService . class :: isInstance ) . map ( DecisionService . class :: cast ) . collect ( Collectors . toList ( ) ) ; |
public class SpyRandomAccessStream { /** * Reads a block from a given location . */
public int read ( byte [ ] buffer , int offset , int length ) throws IOException { } } | log . finest ( "random-read(0x" + Long . toHexString ( getFilePointer ( ) ) + "," + length + ")" ) ; return _file . read ( buffer , offset , length ) ; |
public class BufferUtil { /** * Sane ByteBuffer slice
* @ param buf the buffer to slice something out of
* @ param off The offset into the buffer
* @ param len the length of the part to slice out */
public static ByteBuffer slice ( ByteBuffer buf , int off , int len ) { } } | ByteBuffer localBuf = buf . duplicate ( ) ; // so we don ' t mess up the position , etc
logger . debug ( "off={} len={}" , off , len ) ; localBuf . position ( off ) ; localBuf . limit ( off + len ) ; logger . debug ( "pre-slice: localBuf.position()={} localBuf.limit()={}" , localBuf . position ( ) , localBuf . limit ( ... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link RailwayType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link RailwayType } { @ code > } */
@ XmlE... | return new JAXBElement < RailwayType > ( _Railway_QNAME , RailwayType . class , null , value ) ; |
public class ExportModuleNameCompilerPass { /** * Recursively called to process AST nodes looking for anonymous define calls . If an
* anonymous define call is found , then change it be a named define call , specifying
* the module name for the file being processed .
* @ param node
* The node being processed */... | for ( Node cursor = node . getFirstChild ( ) ; cursor != null ; cursor = cursor . getNext ( ) ) { if ( cursor . getType ( ) == Token . CALL ) { // The node is a function or method call
Node name = cursor . getFirstChild ( ) ; if ( name != null && name . getType ( ) == Token . NAME && // named function call
name . getSt... |
public class BindingsHelper { /** * A method for obtaining a Binding Name Helper for use with the remote jndi namespace .
* @ param homeRecord The HomeRecord associated with the bean whose interfaces or home are to
* have jndi binding name ( s ) constructed .
* @ return an instance of a BindingsHelper for generat... | if ( homeRecord . ivRemoteBindingsHelper == null ) { homeRecord . ivRemoteBindingsHelper = new BindingsHelper ( homeRecord , cvAllRemoteBindings , "ejb/" ) ; } return homeRecord . ivRemoteBindingsHelper ; |
public class AbstractPeriod { /** * Gets an array of the field types that this period supports .
* The fields are returned largest to smallest , for example Hours , Minutes , Seconds .
* @ return the fields supported in an array that may be altered , largest to smallest */
public DurationFieldType [ ] getFieldTypes... | DurationFieldType [ ] result = new DurationFieldType [ size ( ) ] ; for ( int i = 0 ; i < result . length ; i ++ ) { result [ i ] = getFieldType ( i ) ; } return result ; |
public class FJIterate { /** * Same effect as { @ link Iterate # count ( Iterable , Predicate ) } , but executed in parallel batches .
* @ return The number of elements which satisfy the Predicate . */
public static < T > int count ( Iterable < T > iterable , Predicate < ? super T > predicate ) { } } | return count ( iterable , predicate , FJIterate . DEFAULT_MIN_FORK_SIZE , FJIterate . FORK_JOIN_POOL ) ; |
public class LogBuffer { /** * Return next 24 - bit unsigned int from buffer . ( little - endian )
* @ see mysql - 5.1.60 / include / my _ global . h - uint3korr */
public final int getUint24 ( ) { } } | if ( position + 2 >= origin + limit ) throw new IllegalArgumentException ( "limit excceed: " + ( position - origin + 2 ) ) ; byte [ ] buf = buffer ; return ( 0xff & buf [ position ++ ] ) | ( ( 0xff & buf [ position ++ ] ) << 8 ) | ( ( 0xff & buf [ position ++ ] ) << 16 ) ; |
public class Interface { /** * Use this API to enable Interface of given name . */
public static base_response enable ( nitro_service client , String id ) throws Exception { } } | Interface enableresource = new Interface ( ) ; enableresource . id = id ; return enableresource . perform_operation ( client , "enable" ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.