signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RpcLookout { /** * Collect the thread pool information * @ param serverConfig ServerConfig * @ param threadPoolExecutor ThreadPoolExecutor */ public void collectThreadPool ( ServerConfig serverConfig , final ThreadPoolExecutor threadPoolExecutor ) { } }
try { int coreSize = serverConfig . getCoreThreads ( ) ; int maxSize = serverConfig . getMaxThreads ( ) ; int queueSize = serverConfig . getQueues ( ) ; final ThreadPoolConfig threadPoolConfig = new ThreadPoolConfig ( coreSize , maxSize , queueSize ) ; Lookout . registry ( ) . info ( rpcLookoutId . fetchServerThreadConfigId ( serverConfig ) , new Info < ThreadPoolConfig > ( ) { @ Override public ThreadPoolConfig value ( ) { return threadPoolConfig ; } } ) ; Lookout . registry ( ) . gauge ( rpcLookoutId . fetchServerThreadPoolActiveCountId ( serverConfig ) , new Gauge < Integer > ( ) { @ Override public Integer value ( ) { return threadPoolExecutor . getActiveCount ( ) ; } } ) ; Lookout . registry ( ) . gauge ( rpcLookoutId . fetchServerThreadPoolIdleCountId ( serverConfig ) , new Gauge < Integer > ( ) { @ Override public Integer value ( ) { return threadPoolExecutor . getPoolSize ( ) - threadPoolExecutor . getActiveCount ( ) ; } } ) ; Lookout . registry ( ) . gauge ( rpcLookoutId . fetchServerThreadPoolQueueSizeId ( serverConfig ) , new Gauge < Integer > ( ) { @ Override public Integer value ( ) { return threadPoolExecutor . getQueue ( ) . size ( ) ; } } ) ; } catch ( Throwable t ) { LOGGER . error ( LogCodes . getLog ( LogCodes . ERROR_METRIC_REPORT_ERROR ) , t ) ; }
public class TrainModule { /** * Display , for given session : session ID , start time , number of workers , last update * @ param sessionId session ID * @ return info for session as JSON */ private Result sessionInfoForSession ( String sessionId ) { } }
Map < String , Object > dataEachSession = new HashMap < > ( ) ; StatsStorage ss = knownSessionIDs . get ( sessionId ) ; if ( ss != null ) { Map < String , Object > dataThisSession = sessionData ( sessionId , ss ) ; dataEachSession . put ( sessionId , dataThisSession ) ; } return Results . ok ( asJson ( dataEachSession ) ) . as ( "application/json" ) ;
public class CompromisedCredentialsRiskConfigurationTypeMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CompromisedCredentialsRiskConfigurationType compromisedCredentialsRiskConfigurationType , ProtocolMarshaller protocolMarshaller ) { } }
if ( compromisedCredentialsRiskConfigurationType == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( compromisedCredentialsRiskConfigurationType . getEventFilter ( ) , EVENTFILTER_BINDING ) ; protocolMarshaller . marshall ( compromisedCredentialsRiskConfigurationType . getActions ( ) , ACTIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class BBCImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . BBC__BCDO_NAME : setBCdoName ( ( String ) newValue ) ; return ; case AfplibPackage . BBC__TRIPLETS : getTriplets ( ) . clear ( ) ; getTriplets ( ) . addAll ( ( Collection < ? extends Triplet > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class PropositionUtil { /** * Binary search for a primitive parameter by timestamp , optimized for when * the parameters are stored in a list that implements * < code > java . util . RandomAccess < / code > . * @ param list * a < code > List < / code > of < code > PrimitiveParameter < / code > * objects all with the same paramId , cannot be < code > null < / code > . * @ param tstamp * the timestamp we ' re interested in finding . * @ return a < code > PrimitiveParameter < / code > , or < code > null < / code > if * not found . */ private static int maxFinishIndexedBinarySearch ( List < ? extends TemporalProposition > list , long tstamp ) { } }
int low = 0 ; int high = list . size ( ) - 1 ; while ( low <= high ) { /* * We use > > > instead of > > or / 2 to avoid overflow . Sun ' s * implementation of binary search actually doesn ' t do this ( bug * # 5045582 ) . */ int mid = ( low + high ) >>> 1 ; TemporalProposition midVal = list . get ( mid ) ; Long maxFinish = midVal . getInterval ( ) . getMaximumFinish ( ) ; int cmp = maxFinish != null ? maxFinish . compareTo ( tstamp ) : 1 ; if ( cmp < 0 ) { low = mid + 1 ; } else if ( cmp > 0 ) { high = mid - 1 ; } else { return mid + 1 ; } } return high + 1 ;
public class BooleanList { /** * Operates exactly as { @ link # remove ( int ) } * @ param index the index to remove * @ return the value removed */ public boolean removeB ( int index ) { } }
boundsCheck ( index ) ; boolean ret = array [ index ] ; for ( int i = index ; i < end - 1 ; i ++ ) array [ i ] = array [ i + 1 ] ; decreaseSize ( 1 ) ; return ret ;
public class SubscriptionService { /** * Changes the amount of a subscription . < br > * < br > * The new amount is valid until the end of the subscription . If you want to set a temporary one - time amount use * { @ link SubscriptionService # changeAmountTemporary ( String , Integer ) } * @ param subscription the subscription . * @ param amount the new amount . * @ param currency optionally , a new currency or < code > null < / code > . * @ param interval optionally , a new interval or < code > null < / code > . * @ return the updated subscription . */ public Subscription changeAmount ( Subscription subscription , Integer amount , String currency , Interval . PeriodWithChargeDay interval ) { } }
return changeAmount ( subscription , amount , 1 , currency , interval ) ;
public class FileLogOutput { /** * When enabled , writes to the log will throw LogFileFullException . * Unless objectManagerState . logFullTriggerCheckpointThreshold is set to 1.0 * calling simulateLogOutputFull ( true ) ; will cause the ObjectManager to continually * take checkpoints in order to free up space in the log . * @ param isFull true subsequent writes to the log throw LogFileFullException . * if false subsequent writes may succeed . * @ throws ObjectManagerException */ protected void simulateLogOutputFull ( boolean isFull ) throws ObjectManagerException { } }
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "simulateLogOutputFull" , new Object [ ] { new Boolean ( isFull ) } ) ; synchronized ( logFullReservedLock ) { if ( isFull ) { // Clear as much space as we can . objectManagerState . waitForCheckpoint ( true ) ; // Reserve all of the free space in the log . int numberOfZeros = 3 ; for ( int zeroCount = numberOfZeros ; zeroCount > 0 ; ) { long available = 0 ; synchronized ( logBufferLock ) { available = getLogFileSpaceLeft ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , "simulateLogOutputFull" , new Object [ ] { new Long ( available ) } ) ; if ( reserveLogFileSpace ( available ) == 0 ) { logFullReserved = logFullReserved + available ; } // if ( writingFlushSet . . . } // synchronized ( logBufferLock ) . if ( available > 0 ) { flush ( ) ; zeroCount = numberOfZeros ; } else { // Make sure there are also no unchecked bytes . objectManagerState . waitForCheckpoint ( true ) ; // keep going until we have cycled through all of the flush sets . zeroCount -- ; } // if ( available > 0 ) . } // for ( int zeroCount . } else { reserveLogFileSpace ( - logFullReserved ) ; logFullReserved = 0 ; flush ( ) ; } // if ( isFull ) . } // synchronized ( logFullReservedLock ) . if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "simulateLogOutputFull" , new Object [ ] { new Long ( logFullReserved ) } ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getIfcConnectionTypeEnum ( ) { } }
if ( ifcConnectionTypeEnumEEnum == null ) { ifcConnectionTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 798 ) ; } return ifcConnectionTypeEnumEEnum ;
public class diff_match_patch { /** * Increase the context until it is unique , but don ' t let the pattern expand * beyond Match _ MaxBits . * @ param patch * The patch to grow . * @ param text * Source text . */ protected void patch_addContext ( Patch patch , String text ) { } }
if ( text . length ( ) == 0 ) { return ; } String pattern = text . substring ( patch . start2 , patch . start2 + patch . length1 ) ; int padding = 0 ; // Look for the first and last matches of pattern in text . If two // different // matches are found , increase the pattern length . while ( text . indexOf ( pattern ) != text . lastIndexOf ( pattern ) && pattern . length ( ) < Match_MaxBits - Patch_Margin - Patch_Margin ) { padding += Patch_Margin ; pattern = text . substring ( Math . max ( 0 , patch . start2 - padding ) , Math . min ( text . length ( ) , patch . start2 + patch . length1 + padding ) ) ; } // Add one chunk for good luck . padding += Patch_Margin ; // Add the prefix . String prefix = text . substring ( Math . max ( 0 , patch . start2 - padding ) , patch . start2 ) ; if ( prefix . length ( ) != 0 ) { patch . diffs . addFirst ( new Diff ( Operation . EQUAL , prefix ) ) ; } // Add the suffix . String suffix = text . substring ( patch . start2 + patch . length1 , Math . min ( text . length ( ) , patch . start2 + patch . length1 + padding ) ) ; if ( suffix . length ( ) != 0 ) { patch . diffs . addLast ( new Diff ( Operation . EQUAL , suffix ) ) ; } // Roll back the start points . patch . start1 -= prefix . length ( ) ; patch . start2 -= prefix . length ( ) ; // Extend the lengths . patch . length1 += prefix . length ( ) + suffix . length ( ) ; patch . length2 += prefix . length ( ) + suffix . length ( ) ;
public class SqlParserImpl { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . parser . SqlParser # parse ( ) */ @ Override public ContextTransformer parse ( ) { } }
push ( new ContainerNode ( 0 , 0 ) ) ; while ( TokenType . EOF != tokenizer . next ( ) ) { parseToken ( ) ; } return new ContextTransformer ( pop ( ) ) ;
public class HostInfo { private static String toStaticString ( ) { } }
String str = "" ; try { if ( name == null ) new HostInfo ( ) ; str += "name: " + name + "\n" ; str += "address: " + address + "\n" ; } catch ( DevFailed e ) { str = e . errors [ 0 ] . desc ; } return str ;
public class UserRepository { /** * Looks up a user by a session identifier . * @ return the user associated with the specified session or null of no session exists with the * supplied identifier . */ public User loadUserBySession ( String sessionKey ) throws PersistenceException { } }
User user = load ( _utable , "sessions" , "where authcode = '" + sessionKey + "' " + "AND sessions.userId = users.userId" ) ; if ( user != null ) { user . setDirtyMask ( _utable . getFieldMask ( ) ) ; } return user ;
public class SqlValidatorImpl { /** * Registers a query in a parent scope . * @ param parentScope Parent scope which this scope turns to in order to * resolve objects * @ param usingScope Scope whose child list this scope should add itself to * @ param node Query node * @ param alias Name of this query within its parent . Must be specified * if usingScope ! = null */ private void registerQuery ( SqlValidatorScope parentScope , SqlValidatorScope usingScope , SqlNode node , SqlNode enclosingNode , String alias , boolean forceNullable ) { } }
Preconditions . checkArgument ( usingScope == null || alias != null ) ; registerQuery ( parentScope , usingScope , node , enclosingNode , alias , forceNullable , true ) ;
public class LogConfigMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LogConfig logConfig , ProtocolMarshaller protocolMarshaller ) { } }
if ( logConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( logConfig . getFieldLogLevel ( ) , FIELDLOGLEVEL_BINDING ) ; protocolMarshaller . marshall ( logConfig . getCloudWatchLogsRoleArn ( ) , CLOUDWATCHLOGSROLEARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SniffyRequestProcessor { /** * Generates following HTML snippet * < pre > * { @ code * < data id = " sniffy " data - sql - queries = " 5 " / > * < / pre > * @ param executedQueries number of executed queries * @ return StringBuilder with generated HTML */ protected StringBuilder generateFooterHtml ( int executedQueries , long serverTime ) { } }
return new StringBuilder ( ) . append ( "<data id=\"sniffy\" data-sql-queries=\"" ) . append ( executedQueries ) . append ( "\" data-server-time=\"" ) . append ( serverTime ) . append ( "\"/>" ) ;
public class MessageFactory { /** * < p > Creates and returns a FacesMessage for the specified Locale . < / p > * @ param locale - the target < code > Locale < / code > * @ param messageId - the key of the message in the resource bundle * @ param params - substittion parameters * @ return a localized < code > FacesMessage < / code > with the severity * of FacesMessage . SEVERITY _ ERROR */ static FacesMessage getMessage ( Locale locale , String messageId , Object ... params ) { } }
String summary = null ; String detail = null ; ResourceBundle bundle ; String bundleName ; // see if we have a user - provided bundle Application app = getApplication ( ) ; Class appClass = app . getClass ( ) ; if ( null != ( bundleName = app . getMessageBundle ( ) ) ) { if ( null != ( bundle = ResourceBundle . getBundle ( bundleName , locale , getCurrentLoader ( appClass ) ) ) ) { // see if we have a hit try { summary = bundle . getString ( messageId ) ; detail = bundle . getString ( messageId + "_detail" ) ; } catch ( MissingResourceException e ) { // ignore } } } // we couldn ' t find a summary in the user - provided bundle if ( null == summary ) { // see if we have a summary in the app provided bundle bundle = ResourceBundle . getBundle ( FacesMessage . FACES_MESSAGES , locale , getCurrentLoader ( appClass ) ) ; if ( null == bundle ) { throw new NullPointerException ( ) ; } // see if we have a hit try { summary = bundle . getString ( messageId ) ; detail = bundle . getString ( messageId + "_detail" ) ; } catch ( MissingResourceException e ) { // ignore } } // no hit found in the standard javax . faces . Messages bundle . // check the Mojarra resources if ( summary == null ) { // see if we have a summary in the app provided bundle bundle = ResourceBundle . getBundle ( MOJARRA_RESOURCE_BASENAME , locale , getCurrentLoader ( appClass ) ) ; if ( null == bundle ) { throw new NullPointerException ( ) ; } // see if we have a hit try { summary = bundle . getString ( messageId ) ; } catch ( MissingResourceException e ) { return null ; } } // At this point , we have a summary and a bundle . FacesMessage ret = new BindingFacesMessage ( locale , summary , detail , params ) ; ret . setSeverity ( FacesMessage . SEVERITY_ERROR ) ; return ( ret ) ;
public class CmsResultsBackwardsScrollHandler { /** * Loads a page with a given index . < p > * @ param pageNum the index of the page to load */ protected void loadPage ( int pageNum ) { } }
int start = ( pageNum - 1 ) * m_pageSize ; List < CmsResultItemBean > results = m_resultBeans ; int end = start + m_pageSize ; if ( end > results . size ( ) ) { end = results . size ( ) ; } List < CmsResultItemBean > page = results . subList ( start , end ) ; boolean showPath = SortParams . path_asc . name ( ) . equals ( m_searchBean . getSortOrder ( ) ) || SortParams . path_desc . name ( ) . equals ( m_searchBean . getSortOrder ( ) ) ; m_resultsTab . addContentItems ( page , true , showPath ) ;
public class UploadWorkerThread { /** * This function is called when a media file was added on a different * node , such as a mobile device . In that case , the media is marked * as ' submitted _ inline ' since the media is already attached to the document * but as not yet gone through the process that the robot implements . * @ param docId * @ param attachmentName * @ throws Exception */ private void performSubmittedInlineWork ( Work work ) throws Exception { } }
String attachmentName = work . getAttachmentName ( ) ; FileConversionContext conversionContext = new FileConversionContextImpl ( work , documentDbDesign , mediaDir ) ; DocumentDescriptor docDescriptor = conversionContext . getDocument ( ) ; AttachmentDescriptor attDescription = null ; if ( docDescriptor . isAttachmentDescriptionAvailable ( attachmentName ) ) { attDescription = docDescriptor . getAttachmentDescription ( attachmentName ) ; } if ( null == attDescription ) { logger . info ( "Submission can not be found" ) ; } else if ( false == UploadConstants . UPLOAD_STATUS_SUBMITTED_INLINE . equals ( attDescription . getStatus ( ) ) ) { logger . info ( "File not in submit inline state" ) ; } else { // Verify that a file is attached to the document if ( false == attDescription . isFilePresent ( ) ) { // Invalid state throw new Exception ( "Invalid state. A file must be present for submitted_inline" ) ; } // Download file File outputFile = File . createTempFile ( "inline" , "" , mediaDir ) ; conversionContext . downloadFile ( attachmentName , outputFile ) ; // Create an original structure to point to the file in the // media dir . This way , when we go to " submitted " state , we will // be ready . OriginalFileDescriptor originalDescription = attDescription . getOriginalFileDescription ( ) ; originalDescription . setMediaFileName ( outputFile . getName ( ) ) ; // Delete current attachment attDescription . removeFile ( ) ; // Update status attDescription . setStatus ( UploadConstants . UPLOAD_STATUS_SUBMITTED ) ; conversionContext . saveDocument ( ) ; }
public class MMAXAnnotation { /** * setter for pointerList - sets The list of MMAX pointers of the MMAX annotation . * @ generated * @ param v value to set into the feature */ public void setPointerList ( FSArray v ) { } }
if ( MMAXAnnotation_Type . featOkTst && ( ( MMAXAnnotation_Type ) jcasType ) . casFeat_pointerList == null ) jcasType . jcas . throwFeatMissing ( "pointerList" , "de.julielab.jules.types.mmax.MMAXAnnotation" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( MMAXAnnotation_Type ) jcasType ) . casFeatCode_pointerList , jcasType . ll_cas . ll_getFSRef ( v ) ) ;
public class CanonicalIterator { /** * See if the decomposition of cp2 is at segment starting at segmentPos * ( with canonical rearrangment ! ) * If so , take the remainder , and return the equivalents */ private Set < String > extract ( int comp , String segment , int segmentPos , StringBuffer buf ) { } }
if ( PROGRESS ) System . out . println ( " extract: " + Utility . hex ( UTF16 . valueOf ( comp ) ) + ", " + Utility . hex ( segment . substring ( segmentPos ) ) ) ; String decomp = nfcImpl . getDecomposition ( comp ) ; if ( decomp == null ) { decomp = UTF16 . valueOf ( comp ) ; } // See if it matches the start of segment ( at segmentPos ) boolean ok = false ; int cp ; int decompPos = 0 ; int decompCp = UTF16 . charAt ( decomp , 0 ) ; decompPos += UTF16 . getCharCount ( decompCp ) ; // adjust position to skip first char // int decompClass = getClass ( decompCp ) ; buf . setLength ( 0 ) ; // initialize working buffer , shared among callees for ( int i = segmentPos ; i < segment . length ( ) ; i += UTF16 . getCharCount ( cp ) ) { cp = UTF16 . charAt ( segment , i ) ; if ( cp == decompCp ) { // if equal , eat another cp from decomp if ( PROGRESS ) System . out . println ( " matches: " + Utility . hex ( UTF16 . valueOf ( cp ) ) ) ; if ( decompPos == decomp . length ( ) ) { // done , have all decomp characters ! buf . append ( segment . substring ( i + UTF16 . getCharCount ( cp ) ) ) ; // add remaining segment chars ok = true ; break ; } decompCp = UTF16 . charAt ( decomp , decompPos ) ; decompPos += UTF16 . getCharCount ( decompCp ) ; // decompClass = getClass ( decompCp ) ; } else { if ( PROGRESS ) System . out . println ( " buffer: " + Utility . hex ( UTF16 . valueOf ( cp ) ) ) ; // brute force approach UTF16 . append ( buf , cp ) ; /* TODO : optimize / / since we know that the classes are monotonically increasing , after zero / / e . g . 0 5 7 9 0 3 / / we can do an optimization / / there are only a few cases that work : zero , less , same , greater / / if both classes are the same , we fail / / if the decomp class < the segment class , we fail segClass = getClass ( cp ) ; if ( decompClass < = segClass ) return null ; */ } } if ( ! ok ) return null ; // we failed , characters left over if ( PROGRESS ) System . out . println ( "Matches" ) ; if ( buf . length ( ) == 0 ) return SET_WITH_NULL_STRING ; // succeed , but no remainder String remainder = buf . toString ( ) ; // brute force approach // to check to make sure result is canonically equivalent /* String trial = Normalizer . normalize ( UTF16 . valueOf ( comp ) + remainder , Normalizer . DECOMP , 0 ) ; if ( ! segment . regionMatches ( segmentPos , trial , 0 , segment . length ( ) - segmentPos ) ) return null ; */ if ( 0 != Normalizer . compare ( UTF16 . valueOf ( comp ) + remainder , segment . substring ( segmentPos ) , 0 ) ) return null ; // get the remaining combinations return getEquivalents2 ( remainder ) ;
public class BccClient { /** * Starting the instance owned by the user . * You can start the instance only when the instance is Stopped , * otherwise , it ' s will get < code > 409 < / code > errorCode . * This is an asynchronous interface , * you can get the latest status by invoke { @ link # getInstance ( GetInstanceRequest ) } * @ param request The request containing all options for starting the instance . */ public void startInstance ( StartInstanceRequest request ) { } }
checkNotNull ( request , "request should not be null." ) ; checkStringNotEmpty ( request . getInstanceId ( ) , "request instanceId should not be empty." ) ; InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . PUT , INSTANCE_PREFIX , request . getInstanceId ( ) ) ; internalRequest . addParameter ( InstanceAction . start . name ( ) , null ) ; fillPayload ( internalRequest , request ) ; this . invokeHttpClient ( internalRequest , AbstractBceResponse . class ) ;
public class ArrayBlockingQueue { /** * Inserts the specified element at the tail of this queue , waiting * up to the specified wait time for space to become available if * the queue is full . * @ throws InterruptedException { @ inheritDoc } * @ throws NullPointerException { @ inheritDoc } */ public boolean offer ( E e , long timeout , TimeUnit unit ) throws InterruptedException { } }
Objects . requireNonNull ( e ) ; long nanos = unit . toNanos ( timeout ) ; final ReentrantLock lock = this . lock ; lock . lockInterruptibly ( ) ; try { while ( count == items . length ) { if ( nanos <= 0L ) return false ; nanos = notFull . awaitNanos ( nanos ) ; } enqueue ( e ) ; return true ; } finally { lock . unlock ( ) ; }
public class FileObjectReaderImpl { /** * { @ inheritDoc } */ public long readLong ( ) throws IOException { } }
ByteBuffer dst = ByteBuffer . allocate ( 8 ) ; readFully ( dst ) ; return dst . asLongBuffer ( ) . get ( ) ;
public class DefaultEmailModel { /** * converts an email address and a name to an { @ link InternetAddress } * @ param address a valid email address * @ param personal the real world name of the sender ( can be null ) * @ return the converted InternetAddress * @ throws AddressException in case of an invalid email address */ private InternetAddress toInternetAddress ( String address , String personal ) throws AddressException { } }
if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Creating InternetAddress from address [{}] and personal [{}]" , address , personal ) ; } InternetAddress internetAddress ; try { internetAddress = new InternetAddress ( address , true ) ; } catch ( AddressException e ) { logger . error ( String . format ( "Cannot parse email address [%s]" , address ) , e ) ; throw e ; } try { internetAddress . setPersonal ( personal , getEncoding ( ) ) ; } catch ( UnsupportedEncodingException e ) { logger . warn ( String . format ( "Cannot set sender name [%s] with Charset %s. Just setting the email address" , personal , DEFAULT_ENCODING ) , e ) ; } return internetAddress ;
public class FilesOutputStream { /** * Add manifest entry to this files output stream . This method reset { @ link # manifest } to null signaling manifest was * processed . * @ throws IOException if manifest entry write fails . */ private void addManifestEntry ( ) throws IOException { } }
ZipEntry entry = new ZipEntry ( JarFile . MANIFEST_NAME ) ; filesArchive . putNextEntry ( entry ) ; try { manifest . write ( this ) ; } finally { filesArchive . closeEntry ( ) ; manifest = null ; }
public class CommerceCurrencyUtil { /** * Returns all the commerce currencies where groupId = & # 63 ; and primary = & # 63 ; and active = & # 63 ; . * @ param groupId the group ID * @ param primary the primary * @ param active the active * @ return the matching commerce currencies */ public static List < CommerceCurrency > findByG_P_A ( long groupId , boolean primary , boolean active ) { } }
return getPersistence ( ) . findByG_P_A ( groupId , primary , active ) ;
public class JSONUtils { /** * Constructs ES bulk header for the document . * @ param event * data event * @ param index * index name * @ param type * document type * @ return ES bulk header */ public static String getElasticSearchBulkHeader ( SimpleDataEvent event , String index , String type ) { } }
StringBuilder builder = new StringBuilder ( ) ; builder . append ( "{\"index\":{\"_index\":\"" ) ; builder . append ( index ) ; builder . append ( "\",\"_type\":\"" ) ; builder . append ( type ) ; builder . append ( "\",\"_id\":\"" ) ; builder . append ( event . getId ( ) ) ; builder . append ( "\"}}" ) ; return builder . toString ( ) ;
public class FastAggregation { /** * Compute overall XOR between bitmaps two - by - two . * This function runs in linear time with respect to the number of bitmaps . * @ param bitmaps input bitmaps * @ return aggregated bitmap */ public static RoaringBitmap naive_xor ( RoaringBitmap ... bitmaps ) { } }
RoaringBitmap answer = new RoaringBitmap ( ) ; for ( int k = 0 ; k < bitmaps . length ; ++ k ) { answer . xor ( bitmaps [ k ] ) ; } return answer ;
public class UsersApi { /** * Search for users . * Search for users with the specified filters . * @ param searchTerm The text to search . ( optional ) * @ param groupId The ID of the group where the user belongs . ( optional ) * @ param sort The sort order , either & # x60 ; asc & # x60 ; ( ascending ) or & # x60 ; desc & # x60 ; ( descending ) . The default is & # x60 ; asc & # x60 ; . ( optional ) * @ param sortBy The sort order by criteria , either comma - separated list of criteria . Possible ccriteria & # 39 ; firstName & # 39 ; , & # 39 ; lastName & # 39 ; , & # 39 ; userName & # 39 ; . The default is & # x60 ; firstName , lastName & # x60 ; . ( optional ) * @ param limit Number of results to return . The default value is 100 . ( optional ) * @ param offset The offset to start from in the results . The default value is 0 . ( optional ) * @ param channels List of restricted channel , either comma - separated list of channels . If channels is not defined all available channels are returned . ( optional ) * @ return ApiResponse & lt ; ApiSuccessResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiResponse < ApiSuccessResponse > getUsersWithHttpInfo ( String searchTerm , BigDecimal groupId , String sort , String sortBy , BigDecimal limit , BigDecimal offset , String channels ) throws ApiException { } }
com . squareup . okhttp . Call call = getUsersValidateBeforeCall ( searchTerm , groupId , sort , sortBy , limit , offset , channels , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class DOMHelper { /** * Returns the local name of the given node . If the node ' s name begins * with a namespace prefix , this is the part after the colon ; otherwise * it ' s the full node name . * @ param n the node to be examined . * @ return String containing the Local Name */ public String getLocalNameOfNode ( Node n ) { } }
String qname = n . getNodeName ( ) ; int index = qname . indexOf ( ':' ) ; return ( index < 0 ) ? qname : qname . substring ( index + 1 ) ;
public class FuzzyActivityDomain { /** * Sets all { @ link Variable } s underlying a { @ link MetaVariable } to the UNJUSTIFIED state . * @ param metaVariable */ public void setUnjustified ( ConstraintNetwork metaVariable ) { } }
for ( Variable v : metaVariable . getVariables ( ) ) v . setMarking ( markings . UNJUSTIFIED ) ;
public class Data { /** * Read tst data . * @ param dataFile the data file */ public void readTstData ( String dataFile ) { } }
if ( tstData != null ) { tstData . clear ( ) ; } else { tstData = new ArrayList ( ) ; } // open data file BufferedReader fin = null ; try { fin = new BufferedReader ( new InputStreamReader ( new FileInputStream ( dataFile ) , "UTF-8" ) ) ; System . out . println ( "Reading testing data ..." ) ; String line ; while ( ( line = fin . readLine ( ) ) != null ) { StringTokenizer strTok = new StringTokenizer ( line , " \t\r\n" ) ; int len = strTok . countTokens ( ) ; if ( len <= 1 ) { // skip this invalid line continue ; } List strCps = new ArrayList ( ) ; for ( int i = 0 ; i < len - 1 ; i ++ ) { strCps . add ( strTok . nextToken ( ) ) ; } String labelStr = strTok . nextToken ( ) ; List intCps = new ArrayList ( ) ; for ( int i = 0 ; i < strCps . size ( ) ; i ++ ) { String cpStr = ( String ) strCps . get ( i ) ; Integer cpInt = ( Integer ) cpStr2Int . get ( cpStr ) ; if ( cpInt != null ) { intCps . add ( cpInt ) ; } else { // do nothing } } Integer labelInt = ( Integer ) lbStr2Int . get ( labelStr ) ; if ( labelInt == null ) { System . out . println ( "Reading testing observation, label not found or invalid" ) ; return ; } int [ ] cps = new int [ intCps . size ( ) ] ; for ( int i = 0 ; i < cps . length ; i ++ ) { cps [ i ] = ( ( Integer ) intCps . get ( i ) ) . intValue ( ) ; } Observation obsr = new Observation ( labelInt . intValue ( ) , cps ) ; // add this observation to the data tstData . add ( obsr ) ; } System . out . println ( "Reading " + Integer . toString ( tstData . size ( ) ) + " testing data examples completed!" ) ; } catch ( IOException e ) { System . out . println ( e . toString ( ) ) ; return ; } option . numTestExps = tstData . size ( ) ;
public class JsonArrayFormat { /** * Defines array format for serialized entities with ObjectMapper , without actually * including the schema */ @ Override public JsonFormat . Value findFormat ( Annotated ann ) { } }
// If the entity contains JsonFormat annotation , give it higher priority . JsonFormat . Value precedenceFormat = super . findFormat ( ann ) ; if ( precedenceFormat != null ) { return precedenceFormat ; } return ARRAY_FORMAT ;
public class QueueListener { /** * 取得按表达式的方式订阅的消息后的处理 */ @ Override public void onPMessage ( String pattern , String channel , String message ) { } }
System . out . println ( pattern + "=" + channel + "=" + message ) ;
public class GeneratePySanitizeEscapingDirectiveCode { /** * A non Ant interface for this class . */ public static void main ( String [ ] args ) throws IOException { } }
GeneratePySanitizeEscapingDirectiveCode generator = new GeneratePySanitizeEscapingDirectiveCode ( ) ; generator . configure ( args ) ; generator . execute ( ) ;
public class ServerAttribute { /** * Do the applyChange without creating commands that are sent to the client */ public void silently ( final Runnable applyChange ) { } }
boolean temp = notifyClient ; notifyClient = false ; try { applyChange . run ( ) ; } finally { notifyClient = temp ; }
public class PreconditionUtil { /** * Asserts that a condition is true . If it isn ' t it throws an * { @ link AssertionError } with the given message . * @ param message the identifying message for the { @ link AssertionError } ( * < code > null < / code > okay ) * @ param condition condition to be checked */ public static void assertTrue ( boolean condition , String message , Object ... args ) { } }
verify ( condition , message , args ) ;
public class Node { /** * remove element */ protected void moveElementsLeft ( final Object [ ] elements , final int srcPos ) { } }
if ( log . isDebugEnabled ( ) ) { log . debug ( "moveElementsLeft(" + srcPos + ") allocated=" + allocated + ":" + keys . length + ":" + ( allocated - srcPos - 1 ) + ":" + ( keys . length - srcPos - 1 ) ) ; } System . arraycopy ( elements , srcPos + 1 , elements , srcPos , allocated - srcPos - 1 ) ;
public class Constraint { /** * VoltDB added method to get a non - catalog - dependent * representation of this HSQLDB object . * @ param session The current Session object may be needed to resolve * some names . * @ return XML , correctly indented , representing this object . */ VoltXMLElement voltGetConstraintXML ( ) { } }
// Skip " MAIN " constraints , as they are a side effect of foreign key constraints and add no new info . if ( this . constType == MAIN ) { return null ; } VoltXMLElement constraint = new VoltXMLElement ( "constraint" ) ; // WARNING : the name attribute setting is tentative , subject to reset in the // calling function , Table . voltGetTableXML . constraint . attributes . put ( "name" , getName ( ) . name ) ; constraint . attributes . put ( "nameisauto" , getIsAutogeneratedName ( ) ? "true" : "false" ) ; constraint . attributes . put ( "constrainttype" , getTypeName ( ) ) ; constraint . attributes . put ( "assumeunique" , assumeUnique ? "true" : "false" ) ; constraint . attributes . put ( "migrating" , migrating ? "true" : "false" ) ; constraint . attributes . put ( "rowslimit" , String . valueOf ( rowsLimit ) ) ; if ( rowsLimitDeleteStmt != null ) { constraint . attributes . put ( "rowslimitdeletestmt" , rowsLimitDeleteStmt ) ; } // VoltDB implements constraints by defining an index , by annotating metadata ( such as for NOT NULL columns ) , // or by issuing a " not supported " warning ( such as for foreign keys ) . // Any constraint implemented as an index must have an index name attribute . // No other constraint details are currently used by VoltDB . if ( this . constType != FOREIGN_KEY && core . mainIndex != null ) { // WARNING : the index attribute setting is tentative , subject to reset in // the calling function , Table . voltGetTableXML . constraint . attributes . put ( "index" , core . mainIndex . getName ( ) . name ) ; } return constraint ;
public class ExpandedExample { /** * Print out the Log for specific Pods * @ param namespace * @ param podName * @ throws ApiException */ public static void printLog ( String namespace , String podName ) throws ApiException { } }
// https : / / github . com / kubernetes - client / java / blob / master / kubernetes / docs / CoreV1Api . md # readNamespacedPodLog String readNamespacedPodLog = COREV1_API . readNamespacedPodLog ( podName , namespace , null , Boolean . FALSE , Integer . MAX_VALUE , null , Boolean . FALSE , Integer . MAX_VALUE , 40 , Boolean . FALSE ) ; System . out . println ( readNamespacedPodLog ) ;
public class FunctionConfigurationEnvironment { /** * A list of the resources , with their permissions , to which the Lambda function will be granted access . A Lambda * function can have at most 10 resources . ResourceAccessPolicies apply only when you run the Lambda function in a * Greengrass container . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setResourceAccessPolicies ( java . util . Collection ) } or * { @ link # withResourceAccessPolicies ( java . util . Collection ) } if you want to override the existing values . * @ param resourceAccessPolicies * A list of the resources , with their permissions , to which the Lambda function will be granted access . A * Lambda function can have at most 10 resources . ResourceAccessPolicies apply only when you run the Lambda * function in a Greengrass container . * @ return Returns a reference to this object so that method calls can be chained together . */ public FunctionConfigurationEnvironment withResourceAccessPolicies ( ResourceAccessPolicy ... resourceAccessPolicies ) { } }
if ( this . resourceAccessPolicies == null ) { setResourceAccessPolicies ( new java . util . ArrayList < ResourceAccessPolicy > ( resourceAccessPolicies . length ) ) ; } for ( ResourceAccessPolicy ele : resourceAccessPolicies ) { this . resourceAccessPolicies . add ( ele ) ; } return this ;
public class UserTransactionImpl { /** * unregister users who want notification on UserTransaction Begin and End * @ param callback */ public void unregisterCallback ( UOWScopeCallback callback ) { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "unregisterCallback" , new Object [ ] { callback , this } ) ; _callbackManager . removeCallback ( callback ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "unregisterCallback" ) ;
public class ExpressionTree { /** * Helper to create the original expression ( or at least a nested expression * without the parameters included ) * @ return A string representing the full expression . */ public String writeStringField ( ) { } }
final List < String > strs = Lists . newArrayList ( ) ; if ( sub_expressions != null ) { for ( ExpressionTree sub : sub_expressions ) { strs . add ( sub . toString ( ) ) ; } } if ( sub_metric_queries != null ) { final String sub_metrics = clean ( sub_metric_queries . values ( ) ) ; if ( sub_metrics != null && sub_metrics . length ( ) > 0 ) { strs . add ( sub_metrics ) ; } } final String inner_expression = DOUBLE_COMMA_JOINER . join ( strs ) ; return expression . writeStringField ( func_params , inner_expression ) ;
public class AbstractGitFlowMojo { /** * Executes git branch - D . * @ param branchName * Branch name to delete . * @ throws MojoFailureException * @ throws CommandLineException */ protected void gitBranchDeleteForce ( final String branchName ) throws MojoFailureException , CommandLineException { } }
getLog ( ) . info ( "Deleting (-D) '" + branchName + "' branch." ) ; executeGitCommand ( "branch" , "-D" , branchName ) ;
public class CmsUIServlet { /** * Checks whether the given request was referred from the login page . < p > * @ param request the request * @ return < code > true < / code > in case of login ui requests */ static boolean isLoginUIRequest ( VaadinRequest request ) { } }
String referrer = request . getHeader ( "referer" ) ; return ( referrer != null ) && referrer . contains ( CmsWorkplaceLoginHandler . LOGIN_HANDLER ) ;
public class Depiction { /** * Write the depiction to the provided output stream . * @ param fmt format * @ param out output stream * @ throws IOException depiction could not be written , low level IO problem * @ see # listFormats ( ) */ public final void writeTo ( String fmt , OutputStream out ) throws IOException { } }
if ( fmt . equalsIgnoreCase ( SVG_FMT ) ) { out . write ( toSvgStr ( ) . getBytes ( Charsets . UTF_8 ) ) ; } else if ( fmt . equalsIgnoreCase ( PS_FMT ) ) { out . write ( toEpsStr ( ) . getBytes ( Charsets . UTF_8 ) ) ; } else if ( fmt . equalsIgnoreCase ( PDF_FMT ) ) { out . write ( toPdfStr ( ) . getBytes ( Charsets . UTF_8 ) ) ; } else { ImageIO . write ( toImg ( ) , fmt , out ) ; }
public class MuzeiArtSource { /** * Convenience method for accessing preferences specific to the source ( with the given name * within this package . The source name must be the one provided in the * { @ link # MuzeiArtSource ( String ) } constructor . This static method is useful for exposing source * preferences to other application components such as the source settings activity . * @ param context the context ; can be an application context . * @ param sourceName the source name , provided in the { @ link # MuzeiArtSource ( String ) } * constructor . * @ return the { @ link SharedPreferences } where the MuzeiArtSource associated with the * sourceName stores its state . */ protected static SharedPreferences getSharedPreferences ( Context context , @ NonNull String sourceName ) { } }
return context . getSharedPreferences ( "muzeiartsource_" + sourceName , 0 ) ;
public class FastqBuilder { /** * Build and return a new FASTQ formatted sequence configured from the properties of this builder . * @ return a new FASTQ formatted sequence configured from the properties of this builder * @ throws IllegalStateException if the configuration of this builder results in an illegal state */ public Fastq build ( ) { } }
if ( description == null ) { throw new IllegalStateException ( "description must not be null" ) ; } if ( sequence == null ) { throw new IllegalStateException ( "sequence must not be null" ) ; } if ( quality == null ) { throw new IllegalStateException ( "quality must not be null" ) ; } if ( ! sequenceAndQualityLengthsMatch ( ) ) { throw new IllegalStateException ( "sequence and quality scores must be the same length" ) ; } Fastq fastq = new Fastq ( description , sequence . toString ( ) , quality . toString ( ) , variant ) ; return fastq ;
public class TransactionIntegrationImpl { /** * { @ inheritDoc } */ public XAResourceWrapper createConnectableXAResourceWrapper ( XAResource xares , boolean pad , Boolean override , String productName , String productVersion , String jndiName , ManagedConnection mc , XAResourceStatistics xastat ) { } }
if ( mc instanceof org . ironjacamar . core . spi . transaction . FirstResource || mc instanceof org . jboss . tm . FirstResource ) { if ( xastat != null && xastat . isEnabled ( ) ) { return new FirstResourceConnectableXAResourceWrapperStatImpl ( xares , pad , override , productName , productVersion , jndiName , ( org . jboss . tm . ConnectableResource ) mc , xastat ) ; } else { return new FirstResourceConnectableXAResourceWrapperImpl ( xares , pad , override , productName , productVersion , jndiName , ( org . jboss . tm . ConnectableResource ) mc ) ; } } else { if ( xastat != null && xastat . isEnabled ( ) ) { return new ConnectableXAResourceWrapperStatImpl ( xares , pad , override , productName , productVersion , jndiName , ( org . jboss . tm . ConnectableResource ) mc , xastat ) ; } else { return new ConnectableXAResourceWrapperImpl ( xares , pad , override , productName , productVersion , jndiName , ( org . jboss . tm . ConnectableResource ) mc ) ; } }
public class JavaTokenizer { /** * Read next character in character or string literal and copy into sbuf . */ private void scanLitChar ( int pos ) { } }
if ( reader . ch == '\\' ) { if ( reader . peekChar ( ) == '\\' && ! reader . isUnicode ( ) ) { reader . skipChar ( ) ; reader . putChar ( '\\' , true ) ; } else { reader . scanChar ( ) ; switch ( reader . ch ) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : char leadch = reader . ch ; int oct = reader . digit ( pos , 8 ) ; reader . scanChar ( ) ; if ( '0' <= reader . ch && reader . ch <= '7' ) { oct = oct * 8 + reader . digit ( pos , 8 ) ; reader . scanChar ( ) ; if ( leadch <= '3' && '0' <= reader . ch && reader . ch <= '7' ) { oct = oct * 8 + reader . digit ( pos , 8 ) ; reader . scanChar ( ) ; } } reader . putChar ( ( char ) oct ) ; break ; case 'b' : reader . putChar ( '\b' , true ) ; break ; case 't' : reader . putChar ( '\t' , true ) ; break ; case 'n' : reader . putChar ( '\n' , true ) ; break ; case 'f' : reader . putChar ( '\f' , true ) ; break ; case 'r' : reader . putChar ( '\r' , true ) ; break ; case '\'' : reader . putChar ( '\'' , true ) ; break ; case '\"' : reader . putChar ( '\"' , true ) ; break ; case '\\' : reader . putChar ( '\\' , true ) ; break ; default : lexError ( reader . bp , "illegal.esc.char" ) ; } } } else if ( reader . bp != reader . buflen ) { reader . putChar ( true ) ; }
public class Drawer { /** * Format a nav drawer item based on current selected states * @ param item * @ param selected */ private void formatNavDrawerItem ( DrawerItem item , boolean selected ) { } }
if ( item instanceof SeperatorDrawerItem || item instanceof SwitchDrawerItem ) { // not applicable return ; } // Get the associated view View view = mNavDrawerItemViews . get ( item . getId ( ) ) ; ImageView iconView = ( ImageView ) view . findViewById ( R . id . icon ) ; TextView titleView = ( TextView ) view . findViewById ( R . id . title ) ; // configure its appearance according to whether or not it ' s selected titleView . setTextColor ( selected ? mConfig . getItemHighlightColor ( mActivity ) : UIUtils . getColorAttr ( mActivity , android . R . attr . textColorPrimary ) ) ; iconView . setColorFilter ( selected ? mConfig . getItemHighlightColor ( mActivity ) : getResources ( ) . getColor ( R . color . navdrawer_icon_tint ) , PorterDuff . Mode . SRC_ATOP ) ;
public class ApiOvhOrder { /** * Get prices and contracts information * REST : GET / order / router / new / { duration } * @ param vrack [ required ] The name of your vrack * @ param duration [ required ] Duration */ public OvhOrder router_new_duration_GET ( String duration , String vrack ) throws IOException { } }
String qPath = "/order/router/new/{duration}" ; StringBuilder sb = path ( qPath , duration ) ; query ( sb , "vrack" , vrack ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhOrder . class ) ;
public class VersionRange { /** * ( non - Javadoc ) * @ see net . ossindex . version . impl . IVersionRange # toMavenString ( ) */ @ Override public String toMavenString ( ) { } }
String mavenString = "" ; switch ( operator ) { case "<=" : mavenString = "(,%s]" ; break ; case "<" : mavenString = "(,%s)" ; break ; case "==" : mavenString = "[%s]" ; break ; case ">=" : mavenString = "[%s,)" ; break ; case ">" : mavenString = "(%s,)" ; break ; default : toString ( ) ; } return String . format ( mavenString , version ) ;
public class JsonUtils { /** * 指定泛型 , JSON串转对象 * @ param text JSON串 * @ param clazz 对象类型 * @ param < T > 对象泛型 * @ return 转换得到的对象 */ public static < T > T toBean ( String text , Class < T > clazz ) { } }
return JSON . parseObject ( text , clazz ) ;
public class CmsGlobalConfigurationCacheEventHandler { /** * Removes a resource from the online caches . < p > * @ param resource the resource to remove */ protected void onlineCacheRemove ( CmsPublishedResource resource ) { } }
for ( CachePair cachePair : m_caches ) { try { cachePair . getOnlineCache ( ) . remove ( resource ) ; } catch ( Throwable e ) { LOG . error ( e . getLocalizedMessage ( ) ) ; } }
public class StorableGenerator { /** * Defines a toString method , which assumes that the ClassFile is targeting * version 1.5 of Java . * @ param keyOnly when true , generate a toStringKeyOnly method instead */ private void addToStringMethod ( boolean keyOnly ) { } }
TypeDesc stringBuilder = TypeDesc . forClass ( StringBuilder . class ) ; Modifiers modifiers = Modifiers . PUBLIC . toSynchronized ( true ) ; MethodInfo mi = addMethodIfNotFinal ( modifiers , keyOnly ? TO_STRING_KEY_ONLY_METHOD_NAME : TO_STRING_METHOD_NAME , TypeDesc . STRING , null ) ; if ( mi == null ) { return ; } CodeBuilder b = new CodeBuilder ( mi ) ; b . newObject ( stringBuilder ) ; b . dup ( ) ; b . invokeConstructor ( stringBuilder , null ) ; b . loadConstant ( mStorableType . getName ( ) ) ; invokeAppend ( b , TypeDesc . STRING ) ; String detail ; if ( keyOnly ) { detail = " (key only) {" ; } else { detail = " {" ; } b . loadConstant ( detail ) ; invokeAppend ( b , TypeDesc . STRING ) ; // First pass , just print primary keys . LocalVariable commaCountVar = b . createLocalVariable ( null , TypeDesc . INT ) ; b . loadConstant ( - 1 ) ; b . storeLocal ( commaCountVar ) ; for ( StorableProperty property : mInfo . getPrimaryKeyProperties ( ) . values ( ) ) { addPropertyAppendCall ( b , property , commaCountVar ) ; } // Second pass , print non - primary keys . if ( ! keyOnly ) { for ( StorableProperty property : mAllProperties . values ( ) ) { // Don ' t print any derived or join properties since they may throw an exception . if ( ! property . isPrimaryKeyMember ( ) && ( ! property . isDerived ( ) ) && ( ! property . isJoin ( ) ) ) { addPropertyAppendCall ( b , property , commaCountVar ) ; } } } b . loadConstant ( '}' ) ; invokeAppend ( b , TypeDesc . CHAR ) ; // For key string , also show all the alternate keys . This makes the // FetchNoneException message more helpful . if ( keyOnly ) { int altKeyCount = mInfo . getAlternateKeyCount ( ) ; for ( int i = 0 ; i < altKeyCount ; i ++ ) { b . loadConstant ( - 1 ) ; b . storeLocal ( commaCountVar ) ; b . loadConstant ( ", {" ) ; invokeAppend ( b , TypeDesc . STRING ) ; StorableKey < S > key = mInfo . getAlternateKey ( i ) ; for ( OrderedProperty < S > op : key . getProperties ( ) ) { StorableProperty < S > property = op . getChainedProperty ( ) . getPrimeProperty ( ) ; addPropertyAppendCall ( b , property , commaCountVar ) ; } b . loadConstant ( '}' ) ; invokeAppend ( b , TypeDesc . CHAR ) ; } } b . invokeVirtual ( stringBuilder , TO_STRING_METHOD_NAME , TypeDesc . STRING , null ) ; b . returnValue ( TypeDesc . STRING ) ;
public class BDDImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case AfplibPackage . BDD__UBASE : return getUBASE ( ) ; case AfplibPackage . BDD__RESERVED : return getReserved ( ) ; case AfplibPackage . BDD__XUPUB : return getXUPUB ( ) ; case AfplibPackage . BDD__YUPUB : return getYUPUB ( ) ; case AfplibPackage . BDD__XEXTENT : return getXEXTENT ( ) ; case AfplibPackage . BDD__YEXTENT : return getYEXTENT ( ) ; case AfplibPackage . BDD__RESERVED2 : return getReserved2 ( ) ; case AfplibPackage . BDD__TYPE : return getTYPE ( ) ; case AfplibPackage . BDD__MOD : return getMOD ( ) ; case AfplibPackage . BDD__LID : return getLID ( ) ; case AfplibPackage . BDD__COLOR : return getCOLOR ( ) ; case AfplibPackage . BDD__MODULEWIDTH : return getMODULEWIDTH ( ) ; case AfplibPackage . BDD__ELEMENTHEIGHT : return getELEMENTHEIGHT ( ) ; case AfplibPackage . BDD__MULT : return getMULT ( ) ; case AfplibPackage . BDD__WENE : return getWENE ( ) ; case AfplibPackage . BDD__TRIPLETS : return getTriplets ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class SessionManager { /** * This method rebuilds members related to the SessionManager instance , * which were not directly persisted themselves . */ public void restoreAfterSafeModeRestart ( ) { } }
if ( ! clusterManager . safeMode ) { return ; } for ( Session session : sessions . values ( ) ) { for ( ResourceRequestInfo resourceRequestInfo : session . idToRequest . values ( ) ) { // The helper method to restore the ResourceRequestInfo instances // is placed in NodeManager because it makes use of other members // of NodeManager clusterManager . nodeManager . restoreResourceRequestInfo ( resourceRequestInfo ) ; } session . restoreAfterSafeModeRestart ( ) ; clusterManager . getScheduler ( ) . addSession ( session . getSessionId ( ) , session ) ; } clusterManager . getMetrics ( ) . setNumRunningSessions ( sessions . size ( ) ) ;
public class Matrix4 { /** * Sets this to a reflection across the specified plane . * @ return a reference to this matrix , for chaining . */ public Matrix4 setToReflection ( float x , float y , float z , float w ) { } }
float x2 = - 2f * x , y2 = - 2f * y , z2 = - 2f * z ; float xy2 = x2 * y , xz2 = x2 * z , yz2 = y2 * z ; float x2y2z2 = x * x + y * y + z * z ; return set ( 1f + x2 * x , xy2 , xz2 , x2 * w * x2y2z2 , xy2 , 1f + y2 * y , yz2 , y2 * w * x2y2z2 , xz2 , yz2 , 1f + z2 * z , z2 * w * x2y2z2 , 0f , 0f , 0f , 1f ) ;
public class Selectable { /** * Selector that matches any child element that satisfies the specified constraints . If no * constraints are provided , accepts all child elements . * @ param constraints element constraints * @ return element selector */ public final ChildSelector < T > child ( ElementConstraint ... constraints ) { } }
return new ChildSelector < T > ( getContext ( ) , getCurrentSelector ( ) , Arrays . asList ( constraints ) ) ;
public class MarkdownParser { /** * Outer parsing method : Processing code blocks first * @ param cursor text cursor * @ param paragraphs current paragraphs * @ return is code block found */ private boolean handleCodeBlock ( TextCursor cursor , ArrayList < MDSection > paragraphs ) { } }
if ( mode != MODE_ONLY_LINKS ) { int blockStart = findCodeBlockStart ( cursor ) ; if ( blockStart >= 0 ) { int blockEnd = findCodeBlockEnd ( cursor , blockStart ) ; if ( blockEnd >= 0 ) { // Adding Text Block if there are some elements before code block if ( cursor . currentOffset < blockStart ) { handleTextBlock ( cursor , blockStart , paragraphs ) ; } String codeContent = cursor . text . substring ( cursor . currentOffset + 3 , blockEnd - 3 ) . trim ( ) ; // TODO : Better removing of empty leading and tailing lines // Required to remove only ONE line if ( codeContent . startsWith ( "\n" ) ) { codeContent = codeContent . substring ( 1 ) ; } if ( codeContent . endsWith ( "\n" ) ) { codeContent = codeContent . substring ( 0 , codeContent . length ( ) - 1 ) ; } cursor . currentOffset = blockEnd ; paragraphs . add ( new MDSection ( new MDCode ( codeContent ) ) ) ; return true ; } } } // Adding remaining text blocks if ( cursor . currentOffset < cursor . text . length ( ) ) { handleTextBlock ( cursor , cursor . text . length ( ) , paragraphs ) ; } return false ;
public class Subscription { /** * Retrieves the subscription with the given ID . */ public static Subscription retrieve ( String subscriptionExposedId ) throws StripeException { } }
return retrieve ( subscriptionExposedId , ( Map < String , Object > ) null , ( RequestOptions ) null ) ;
public class CmsResourceTypeStatsView { /** * Sets the click listener for the ok button . < p > */ private void setClickListener ( ) { } }
m_ok . addClickListener ( new Button . ClickListener ( ) { private static final long serialVersionUID = 6621475980210242125L ; public void buttonClick ( com . vaadin . ui . Button . ClickEvent event ) { try { CmsResourceFilter filter = getType ( ) == null ? CmsResourceFilter . ALL : CmsResourceFilter . requireType ( getType ( ) ) ; results . addResult ( new CmsResourceTypeStatResult ( getType ( ) , ( String ) m_siteSelect . getValue ( ) , getCmsObject ( ) . readResources ( "/" , filter , true ) . size ( ) ) ) ; m_results . setVisible ( true ) ; results . setVerticalLayout ( m_resLayout , false ) ; } catch ( CmsException e ) { LOG . error ( "Unable to read resource tree" , e ) ; } } } ) ;
public class Operand { /** * Sets the sharedSet value for this Operand . * @ param sharedSet */ public void setSharedSet ( com . google . api . ads . adwords . axis . v201809 . cm . SharedSet sharedSet ) { } }
this . sharedSet = sharedSet ;
public class AbstractPlayMojo { /** * used by " war " and " war - support " mojos */ protected File filterWebXml ( File webXml , File outputDirectory , String applicationName , String playWarId ) throws IOException { } }
if ( ! outputDirectory . exists ( ) ) { if ( ! outputDirectory . mkdirs ( ) ) { throw new IOException ( String . format ( "Cannot create \"%s\" directory" , outputDirectory . getCanonicalPath ( ) ) ) ; } } File result = new File ( outputDirectory , "filtered-web.xml" ) ; BufferedReader reader = createBufferedFileReader ( webXml , "UTF-8" ) ; try { BufferedWriter writer = createBufferedFileWriter ( result , "UTF-8" ) ; try { getLog ( ) . debug ( "web.xml file:" ) ; String line = reader . readLine ( ) ; while ( line != null ) { getLog ( ) . debug ( " " + line ) ; if ( line . indexOf ( "%APPLICATION_NAME%" ) >= 0 ) { line = line . replace ( "%APPLICATION_NAME%" , applicationName /* configParser . getApplicationName ( ) */ ) ; } if ( line . indexOf ( "%PLAY_ID%" ) >= 0 ) { line = line . replace ( "%PLAY_ID%" , playWarId ) ; } writer . write ( line ) ; writer . newLine ( ) ; line = reader . readLine ( ) ; } } finally { writer . close ( ) ; } } finally { reader . close ( ) ; } return result ;
public class KDTree { /** * Finds the closest point in the hyper rectangle to a given point . Change the * given point to this closest point by clipping of at all the dimensions to * be clipped of . If the point is inside the rectangle it stays unchanged . The * return value is true if the point was not changed , so the the return value * is true if the point was inside the rectangle . * @ param node The current KDTreeNode in whose hyperrectangle the closest * point is to be found . * @ param xa point * @ return true if the input point stayed unchanged . */ protected boolean clipToInsideHrect ( KDTreeNode node , Instance x ) { } }
boolean inside = true ; for ( int i = 0 ; i < m_Instances . numAttributes ( ) ; i ++ ) { // TODO treat nominals differently ! ? ? if ( x . value ( i ) < node . m_NodeRanges [ i ] [ MIN ] ) { x . setValue ( i , node . m_NodeRanges [ i ] [ MIN ] ) ; inside = false ; } else if ( x . value ( i ) > node . m_NodeRanges [ i ] [ MAX ] ) { x . setValue ( i , node . m_NodeRanges [ i ] [ MAX ] ) ; inside = false ; } } return inside ;
public class OrderBy { /** * Gets the sortOrder value for this OrderBy . * @ return sortOrder * The order to sort the results on . The default sort order is * { @ link SortOrder # ASCENDING } . */ public com . google . api . ads . adwords . axis . v201809 . cm . SortOrder getSortOrder ( ) { } }
return sortOrder ;
public class TermOfUsePanel { /** * Factory method for creating the new { @ link Component } for the modifications clause . This * method is invoked in the constructor from the derived classes and can be overridden so users * can provide their own version of a new { @ link Component } for the modifications clause . * @ param id * the id * @ param model * the model * @ return the new { @ link Component } for the modifications clause */ protected Component newModificationsClausePanel ( final String id , final IModel < HeaderContentListModelBean > model ) { } }
return new ModificationsClausePanel ( id , Model . of ( model . getObject ( ) ) ) ;
public class InnerNodeImpl { /** * Removes { @ code oldChild } and adds { @ code newChild } in its place . This * is not atomic . */ public Node replaceChild ( Node newChild , Node oldChild ) throws DOMException { } }
int index = ( ( LeafNodeImpl ) oldChild ) . index ; removeChild ( oldChild ) ; insertChildAt ( newChild , index ) ; return oldChild ;
public class ReportMessageConverterImpl { /** * Given a Report Message property , this method performs a conversion between * the MQC and MFP constants and then returns the object result . * @ param propName Name of property to convert * @ param coreMsg The message on which to perform the conversion * @ return Object */ public Object getReportOption ( String propName , SIBusMessage coreMsg ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getReportOption" , new Object [ ] { propName , coreMsg } ) ; Object result = null ; if ( propName . equals ( ApiJmsConstants . REPORT_EXCEPTION_PROPERTY ) ) { Byte value = coreMsg . getReportException ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Byte returned from core message getReportException():" + value ) ; if ( value != null ) { byte propValue = value . byteValue ( ) ; if ( propValue == byte_REPORT_NO_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_EXCEPTION ) ; } else if ( propValue == byte_REPORT_WITH_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_EXCEPTION_WITH_DATA ) ; } else if ( propValue == byte_REPORT_WITH_FULL_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_EXCEPTION_WITH_FULL_DATA ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . debug ( this , tc , "Unexpected property value received: " + value ) ; result = null ; } } } else if ( propName . equals ( ApiJmsConstants . REPORT_EXPIRATION_PROPERTY ) ) { Byte value = coreMsg . getReportExpiry ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Byte returned from core message getReportExpiry():" + value ) ; if ( value != null ) { byte propValue = value . byteValue ( ) ; if ( propValue == byte_REPORT_NO_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_EXPIRATION ) ; } else if ( propValue == byte_REPORT_WITH_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_EXPIRATION_WITH_DATA ) ; } else if ( propValue == byte_REPORT_WITH_FULL_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_EXPIRATION_WITH_FULL_DATA ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Unexpected property value received: " + value ) ; result = null ; } } } else if ( propName . equals ( ApiJmsConstants . REPORT_COA_PROPERTY ) ) { Byte value = coreMsg . getReportCOA ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Byte returned from core message getReportCOA():" + value ) ; if ( value != null ) { byte propValue = value . byteValue ( ) ; if ( propValue == byte_REPORT_NO_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_COA ) ; } else if ( propValue == byte_REPORT_WITH_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_COA_WITH_DATA ) ; } else if ( propValue == byte_REPORT_WITH_FULL_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_COA_WITH_FULL_DATA ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Unexpected property value received: " + value ) ; result = null ; } } } else if ( propName . equals ( ApiJmsConstants . REPORT_COD_PROPERTY ) ) { Byte value = coreMsg . getReportCOD ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Byte returned from core message getReportCOD():" + value ) ; if ( value != null ) { byte propValue = value . byteValue ( ) ; if ( propValue == byte_REPORT_NO_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_COD ) ; } else if ( propValue == byte_REPORT_WITH_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_COD_WITH_DATA ) ; } else if ( propValue == byte_REPORT_WITH_FULL_DATA ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_COD_WITH_FULL_DATA ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Unexpected property value received: " + value ) ; result = null ; } } } else if ( propName . equals ( ApiJmsConstants . REPORT_PAN_PROPERTY ) ) { Boolean value = coreMsg . getReportPAN ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Boolean returned from core message getReportPAN():" + value ) ; if ( value != null ) { boolean propValue = value . booleanValue ( ) ; if ( propValue ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_PAN ) ; } else { result = Integer . valueOf ( ApiJmsConstants . MQRO_NONE ) ; } } } else if ( propName . equals ( ApiJmsConstants . REPORT_NAN_PROPERTY ) ) { Boolean value = coreMsg . getReportNAN ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Boolean returned from core message getReportNAN():" + value ) ; if ( value != null ) { boolean propValue = value . booleanValue ( ) ; if ( propValue ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_NAN ) ; } else { result = Integer . valueOf ( ApiJmsConstants . MQRO_NONE ) ; } } } else if ( propName . equals ( ApiJmsConstants . REPORT_MSGID_PROPERTY ) ) { Boolean value = coreMsg . getReportPassMsgId ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Boolean returned from core message getReportPassMsgId():" + value ) ; if ( value != null ) { boolean propValue = value . booleanValue ( ) ; if ( propValue ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_PASS_MSG_ID ) ; } else { result = Integer . valueOf ( ApiJmsConstants . MQRO_NEW_MSG_ID ) ; } } } else if ( propName . equals ( ApiJmsConstants . REPORT_CORRELID_PROPERTY ) ) { Boolean value = coreMsg . getReportPassCorrelId ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Boolean returned from core message getReportPassCorrelId():" + value ) ; if ( value != null ) { boolean propValue = value . booleanValue ( ) ; if ( propValue ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_PASS_CORREL_ID ) ; } else { result = Integer . valueOf ( ApiJmsConstants . MQRO_COPY_MSG_ID_TO_CORREL_ID ) ; } } } else if ( propName . equals ( ApiJmsConstants . REPORT_DISCARD_PROPERTY ) ) { Boolean value = coreMsg . getReportDiscardMsg ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Boolean returned from core message getReportDiscardMsg():" + value ) ; if ( value != null ) { boolean propValue = value . booleanValue ( ) ; if ( propValue ) { result = Integer . valueOf ( ApiJmsConstants . MQRO_DISCARD_MSG ) ; } else { result = Integer . valueOf ( ApiJmsConstants . MQRO_NONE ) ; } } } else if ( propName . equals ( ApiJmsConstants . FEEDBACK_PROPERTY ) ) { Integer value = coreMsg . getReportFeedback ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Byte returned from core message getReportFeedback():" + value ) ; if ( value != null ) { // Need to initialise the sharedUtils ? if ( utils == null ) { try { utils = JmsInternalsFactory . getSharedUtils ( ) ; } catch ( JMSException e ) { // No FFDC code needed FFDCFilter . processException ( e , "com.ibm.ws.sib.api.jms.impl.ReportMessageConverter" , "getReportOption#1" , new Object [ ] { propName , coreMsg } ) ; return null ; // Since we are unable to convert the value ( consistent // with original failure mode , // but I think I would prefer to throw an exception ) . } } result = utils . convertJSFeedbackToMQ ( value . intValue ( ) ) ; } } else if ( propName . equals ( ApiJmsConstants . MSG_TYPE_PROPERTY ) ) { // TODO Support JMS _ IBM _ MsgType properly - d256740 Integer value = coreMsg . getReportFeedback ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Value returned from core message getReportFeedback():" + value ) ; if ( value != null ) { int propValue = value . intValue ( ) ; if ( propValue != ApiJmsConstants . MQFB_NONE ) { result = Integer . valueOf ( ApiJmsConstants . MQMT_REPORT ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . debug ( this , tc , "byte returned from getReportFeedback() is not one of the expected values" ) ; result = null ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getReportOption" , result ) ; return result ;
public class TimeRangeChecker { /** * Checks if a specified time is on a day that is specified the a given { @ link List } of acceptable days , and that the * hours + minutes of the specified time fall into a range defined by startTimeStr and endTimeStr . * @ param days is a { @ link List } of days , if the specified { @ link DateTime } does not have a day that falls is in this * { @ link List } then this method will return false . * @ param startTimeStr defines the start range that the currentTime can fall into . This { @ link String } should be of * the pattern defined by { @ link # HOUR _ MINUTE _ FORMAT } . * @ param endTimeStr defines the start range that the currentTime can fall into . This { @ link String } should be of * the pattern defined by { @ link # HOUR _ MINUTE _ FORMAT } . * @ param currentTime is a { @ link DateTime } for which this method will check if it is in the given { @ link List } of * days and falls into the time range defined by startTimeStr and endTimeStr . * @ return true if the given time is in the defined range , false otherwise . */ public static boolean isTimeInRange ( List < String > days , String startTimeStr , String endTimeStr , DateTime currentTime ) { } }
if ( ! Iterables . any ( days , new AreDaysEqual ( DAYS_OF_WEEK . get ( currentTime . getDayOfWeek ( ) ) ) ) ) { return false ; } DateTime startTime = null ; DateTime endTime = null ; try { startTime = HOUR_MINUTE_FORMATTER . withZone ( DATE_TIME_ZONE ) . parseDateTime ( startTimeStr ) ; } catch ( IllegalArgumentException e ) { throw new IllegalArgumentException ( "startTimeStr format is invalid, must be of format " + HOUR_MINUTE_FORMAT , e ) ; } try { endTime = HOUR_MINUTE_FORMATTER . withZone ( DATE_TIME_ZONE ) . parseDateTime ( endTimeStr ) ; } catch ( IllegalArgumentException e ) { throw new IllegalArgumentException ( "endTimeStr format is invalid, must be of format " + HOUR_MINUTE_FORMAT , e ) ; } startTime = startTime . withDate ( currentTime . getYear ( ) , currentTime . getMonthOfYear ( ) , currentTime . getDayOfMonth ( ) ) ; endTime = endTime . withDate ( currentTime . getYear ( ) , currentTime . getMonthOfYear ( ) , currentTime . getDayOfMonth ( ) ) ; Interval interval = new Interval ( startTime . getMillis ( ) , endTime . getMillis ( ) , DATE_TIME_ZONE ) ; return interval . contains ( currentTime . getMillis ( ) ) ;
public class IntegratedBitPacking { /** * Pack 32 integers as deltas with an initial value * @ param initoffset initial value ( used to compute first delta ) * @ param in input array * @ param inpos initial position in input array * @ param out output array * @ param outpos initial position in output array * @ param bit number of bits to use per integer */ public static void integratedpack ( final int initoffset , final int [ ] in , final int inpos , final int [ ] out , final int outpos , final int bit ) { } }
switch ( bit ) { case 0 : integratedpack0 ( initoffset , in , inpos , out , outpos ) ; break ; case 1 : integratedpack1 ( initoffset , in , inpos , out , outpos ) ; break ; case 2 : integratedpack2 ( initoffset , in , inpos , out , outpos ) ; break ; case 3 : integratedpack3 ( initoffset , in , inpos , out , outpos ) ; break ; case 4 : integratedpack4 ( initoffset , in , inpos , out , outpos ) ; break ; case 5 : integratedpack5 ( initoffset , in , inpos , out , outpos ) ; break ; case 6 : integratedpack6 ( initoffset , in , inpos , out , outpos ) ; break ; case 7 : integratedpack7 ( initoffset , in , inpos , out , outpos ) ; break ; case 8 : integratedpack8 ( initoffset , in , inpos , out , outpos ) ; break ; case 9 : integratedpack9 ( initoffset , in , inpos , out , outpos ) ; break ; case 10 : integratedpack10 ( initoffset , in , inpos , out , outpos ) ; break ; case 11 : integratedpack11 ( initoffset , in , inpos , out , outpos ) ; break ; case 12 : integratedpack12 ( initoffset , in , inpos , out , outpos ) ; break ; case 13 : integratedpack13 ( initoffset , in , inpos , out , outpos ) ; break ; case 14 : integratedpack14 ( initoffset , in , inpos , out , outpos ) ; break ; case 15 : integratedpack15 ( initoffset , in , inpos , out , outpos ) ; break ; case 16 : integratedpack16 ( initoffset , in , inpos , out , outpos ) ; break ; case 17 : integratedpack17 ( initoffset , in , inpos , out , outpos ) ; break ; case 18 : integratedpack18 ( initoffset , in , inpos , out , outpos ) ; break ; case 19 : integratedpack19 ( initoffset , in , inpos , out , outpos ) ; break ; case 20 : integratedpack20 ( initoffset , in , inpos , out , outpos ) ; break ; case 21 : integratedpack21 ( initoffset , in , inpos , out , outpos ) ; break ; case 22 : integratedpack22 ( initoffset , in , inpos , out , outpos ) ; break ; case 23 : integratedpack23 ( initoffset , in , inpos , out , outpos ) ; break ; case 24 : integratedpack24 ( initoffset , in , inpos , out , outpos ) ; break ; case 25 : integratedpack25 ( initoffset , in , inpos , out , outpos ) ; break ; case 26 : integratedpack26 ( initoffset , in , inpos , out , outpos ) ; break ; case 27 : integratedpack27 ( initoffset , in , inpos , out , outpos ) ; break ; case 28 : integratedpack28 ( initoffset , in , inpos , out , outpos ) ; break ; case 29 : integratedpack29 ( initoffset , in , inpos , out , outpos ) ; break ; case 30 : integratedpack30 ( initoffset , in , inpos , out , outpos ) ; break ; case 31 : integratedpack31 ( initoffset , in , inpos , out , outpos ) ; break ; case 32 : integratedpack32 ( initoffset , in , inpos , out , outpos ) ; break ; default : throw new IllegalArgumentException ( "Unsupported bit width." ) ; }
public class HawkularMetrics { /** * Process the next item in the queue . */ protected void processQueue ( ) { } }
try { QueueItem item = queue . take ( ) ; client . addMultipleCounterDataPoints ( item . tenantId , item . data ) ; } catch ( InterruptedException e ) { // TODO better logging of this unlikely error e . printStackTrace ( ) ; return ; }
public class AbstractCommonShapeFileWriter { /** * Force this writer to write the memory buffer inside the temporary file . * @ throws IOException in case of error . */ protected void flush ( ) throws IOException { } }
if ( this . tempStream != null && this . buffer . position ( ) > 0 ) { final int pos = this . buffer . position ( ) ; this . buffer . rewind ( ) ; this . buffer . limit ( pos ) ; this . tempStream . write ( this . buffer ) ; this . buffer . rewind ( ) ; this . buffer . limit ( this . buffer . capacity ( ) ) ; this . bufferPosition += pos ; }
public class DeleteVpcRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DeleteVpcRequest > getDryRunRequest ( ) { } }
Request < DeleteVpcRequest > request = new DeleteVpcRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class VerboseFormatter { /** * Append function location . * @ param message The message builder . * @ param event The log record . */ private static void appendFunction ( StringBuilder message , LogRecord event ) { } }
final String clazz = event . getSourceClassName ( ) ; if ( clazz != null ) { message . append ( IN ) . append ( clazz ) ; } final String function = event . getSourceMethodName ( ) ; if ( function != null ) { message . append ( AT ) . append ( function ) . append ( Constant . DOUBLE_DOT ) ; }
public class GitLabApiClient { /** * Sets up Jersey client to ignore certificate errors . * @ return true if successful at setting up to ignore certificate errors , otherwise returns false . */ private boolean setupIgnoreCertificateErrors ( ) { } }
// Create a TrustManager that trusts all certificates TrustManager [ ] trustAllCerts = new TrustManager [ ] { new X509ExtendedTrustManager ( ) { @ Override public X509Certificate [ ] getAcceptedIssuers ( ) { return null ; } @ Override public void checkServerTrusted ( X509Certificate [ ] chain , String authType ) throws CertificateException { } @ Override public void checkClientTrusted ( X509Certificate [ ] chain , String authType ) throws CertificateException { } @ Override public void checkClientTrusted ( X509Certificate [ ] chain , String authType , Socket socket ) throws CertificateException { } @ Override public void checkClientTrusted ( X509Certificate [ ] chain , String authType , SSLEngine engine ) throws CertificateException { } @ Override public void checkServerTrusted ( X509Certificate [ ] chain , String authType , Socket socket ) throws CertificateException { } @ Override public void checkServerTrusted ( X509Certificate [ ] chain , String authType , SSLEngine engine ) throws CertificateException { } } } ; // Ignore differences between given hostname and certificate hostname HostnameVerifier hostnameVerifier = new HostnameVerifier ( ) { public boolean verify ( String hostname , SSLSession session ) { return true ; } } ; try { SSLContext sslContext = SSLContext . getInstance ( "TLS" ) ; sslContext . init ( null , trustAllCerts , new SecureRandom ( ) ) ; openSslContext = sslContext ; openHostnameVerifier = hostnameVerifier ; } catch ( GeneralSecurityException ex ) { openSslContext = null ; openHostnameVerifier = null ; return ( false ) ; } return ( true ) ;
public class BeanUtils { private static void checkBeanFactory ( long waitTime , String bean ) { } }
if ( beanFactory != null ) { return ; } // Jeśli czas oczekiwania jest określony , to wstrzymujemy bieżący wątek // do momentu ustawienia fabryki bean ' ów . Dla ujemnej wartości czasu // oczekiwania - do skutku . Jeśli wartość jest dodatnia - aż upłynie // zdana ilość sekund : if ( waitTime != 0 ) { long endTime = currentTimeMillis ( ) + ( waitTime * 1000 ) ; while ( beanFactory == null && ( waitTime < 0 || currentTimeMillis ( ) < endTime ) ) { try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException e ) { } } } if ( beanFactory == null ) { throw new BeanRetrievalException ( bean , "Bean utils not initialized (bean factory not set)" ) ; }
public class LingoSimilarity { /** * Evaluate the LINGO similarity between two key , value sty ; e fingerprints . * The value will range from 0.0 to 1.0. * @ param features1 * @ param features2 * @ return similarity */ public static float calculate ( Map < String , Integer > features1 , Map < String , Integer > features2 ) { } }
TreeSet < String > keys = new TreeSet < String > ( features1 . keySet ( ) ) ; keys . addAll ( features2 . keySet ( ) ) ; float sum = 0.0f ; for ( String key : keys ) { Integer c1 = features1 . get ( key ) ; Integer c2 = features2 . get ( key ) ; c1 = c1 == null ? 0 : c1 ; c2 = c2 == null ? 0 : c2 ; sum += 1.0 - Math . abs ( c1 - c2 ) / ( c1 + c2 ) ; } return sum / keys . size ( ) ;
public class Expressions { /** * Create a new Path expression * @ param type type of expression * @ param parent parent path * @ param property property name * @ return property path */ public static < T > SimplePath < T > simplePath ( Class < ? extends T > type , Path < ? > parent , String property ) { } }
return new SimplePath < T > ( type , PathMetadataFactory . forProperty ( parent , property ) ) ;
public class WButtonExample { /** * Examples showing how to set a WButton as the default submit button for an input control . */ private void addDefaultSubmitButtonExample ( ) { } }
add ( new WHeading ( HeadingLevel . H3 , "Default submit button" ) ) ; add ( new ExplanatoryText ( "This example shows how to use an image as the only content of a WButton. " + "In addition this text field submits the entire screen using the image button to the right of the field." ) ) ; // We use WFieldLayout to lay out a label : input pair . In this case the input is a // compound control of a WTextField and a WButton . WFieldLayout imageButtonFieldLayout = new WFieldLayout ( ) ; imageButtonFieldLayout . setLabelWidth ( 25 ) ; add ( imageButtonFieldLayout ) ; // the text field and the button both need to be defined explicitly to be able to add them into a wrapper WTextField textFld = new WTextField ( ) ; // and finally we get to the actual button WButton button = new WButton ( "Flag this record for follow-up" ) ; button . setImage ( "/image/flag.png" ) ; button . getImageHolder ( ) . setCacheKey ( "eg-button-flag" ) ; button . setActionObject ( button ) ; button . setAction ( new ExampleButtonAction ( ) ) ; // we can set the image button to be the default submit button for the text field . textFld . setDefaultSubmitButton ( button ) ; // There are many way of putting multiple controls in to a WField ' s input . // We are using a WContainer is the one which is lowest impact in the UI . WContainer imageButtonFieldContainer = new WContainer ( ) ; imageButtonFieldContainer . add ( textFld ) ; // Use a WText to push the button off of the text field by an appropriate ( user - agent determined ) amount . imageButtonFieldContainer . add ( new WText ( "\u2002" ) ) ; // an en space is half an em . a none - breaking space \ u00a0 could also be used but will have no effect on inter - node wrapping imageButtonFieldContainer . add ( button ) ; // Finally add the input wrapper to the WFieldLayout imageButtonFieldLayout . addField ( "Enter record ID" , imageButtonFieldContainer ) ;
public class ASN1Dump { /** * dump a DER object as a formatted string with indentation * @ param obj the DERObject to be dumped out . */ static String _dumpAsString ( String indent , DERObject obj ) { } }
if ( obj instanceof ASN1Sequence ) { StringBuilder buf = new StringBuilder ( ) ; Enumeration e = ( ( ASN1Sequence ) obj ) . getObjects ( ) ; String tab = indent + TAB ; buf . append ( indent ) ; if ( obj instanceof BERConstructedSequence ) { buf . append ( "BER ConstructedSequence" ) ; } else if ( obj instanceof DERConstructedSequence ) { buf . append ( "DER ConstructedSequence" ) ; } else if ( obj instanceof BERSequence ) { buf . append ( "BER Sequence" ) ; } else if ( obj instanceof DERSequence ) { buf . append ( "DER Sequence" ) ; } else { buf . append ( "Sequence" ) ; } buf . append ( System . getProperty ( "line.separator" ) ) ; while ( e . hasMoreElements ( ) ) { Object o = e . nextElement ( ) ; if ( o == null || o . equals ( new DERNull ( ) ) ) { buf . append ( tab ) ; buf . append ( "NULL" ) ; buf . append ( System . getProperty ( "line.separator" ) ) ; } else if ( o instanceof DERObject ) { buf . append ( _dumpAsString ( tab , ( DERObject ) o ) ) ; } else { buf . append ( _dumpAsString ( tab , ( ( DEREncodable ) o ) . getDERObject ( ) ) ) ; } } return buf . toString ( ) ; } else if ( obj instanceof DERTaggedObject ) { StringBuilder buf = new StringBuilder ( ) ; String tab = indent + TAB ; buf . append ( indent ) ; if ( obj instanceof BERTaggedObject ) { buf . append ( "BER Tagged [" ) ; } else { buf . append ( "Tagged [" ) ; } DERTaggedObject o = ( DERTaggedObject ) obj ; buf . append ( Integer . toString ( o . getTagNo ( ) ) ) ; buf . append ( "]" ) ; if ( ! o . isExplicit ( ) ) { buf . append ( " IMPLICIT " ) ; } buf . append ( System . getProperty ( "line.separator" ) ) ; if ( o . isEmpty ( ) ) { buf . append ( tab ) ; buf . append ( "EMPTY" ) ; buf . append ( System . getProperty ( "line.separator" ) ) ; } else { buf . append ( _dumpAsString ( tab , o . getObject ( ) ) ) ; } return buf . toString ( ) ; } else if ( obj instanceof DERConstructedSet ) { StringBuilder buf = new StringBuilder ( ) ; Enumeration e = ( ( ASN1Set ) obj ) . getObjects ( ) ; String tab = indent + TAB ; buf . append ( indent ) ; buf . append ( "ConstructedSet" ) ; buf . append ( System . getProperty ( "line.separator" ) ) ; while ( e . hasMoreElements ( ) ) { Object o = e . nextElement ( ) ; if ( o == null ) { buf . append ( tab ) ; buf . append ( "NULL" ) ; buf . append ( System . getProperty ( "line.separator" ) ) ; } else if ( o instanceof DERObject ) { buf . append ( _dumpAsString ( tab , ( DERObject ) o ) ) ; } else { buf . append ( _dumpAsString ( tab , ( ( DEREncodable ) o ) . getDERObject ( ) ) ) ; } } return buf . toString ( ) ; } else if ( obj instanceof BERSet ) { StringBuilder buf = new StringBuilder ( ) ; Enumeration e = ( ( ASN1Set ) obj ) . getObjects ( ) ; String tab = indent + TAB ; buf . append ( indent ) ; buf . append ( "BER Set" ) ; buf . append ( System . getProperty ( "line.separator" ) ) ; while ( e . hasMoreElements ( ) ) { Object o = e . nextElement ( ) ; if ( o == null ) { buf . append ( tab ) ; buf . append ( "NULL" ) ; buf . append ( System . getProperty ( "line.separator" ) ) ; } else if ( o instanceof DERObject ) { buf . append ( _dumpAsString ( tab , ( DERObject ) o ) ) ; } else { buf . append ( _dumpAsString ( tab , ( ( DEREncodable ) o ) . getDERObject ( ) ) ) ; } } return buf . toString ( ) ; } else if ( obj instanceof DERSet ) { StringBuilder buf = new StringBuilder ( ) ; Enumeration e = ( ( ASN1Set ) obj ) . getObjects ( ) ; String tab = indent + TAB ; buf . append ( indent ) ; buf . append ( "DER Set" ) ; buf . append ( System . getProperty ( "line.separator" ) ) ; while ( e . hasMoreElements ( ) ) { Object o = e . nextElement ( ) ; if ( o == null ) { buf . append ( tab ) ; buf . append ( "NULL" ) ; buf . append ( System . getProperty ( "line.separator" ) ) ; } else if ( o instanceof DERObject ) { buf . append ( _dumpAsString ( tab , ( DERObject ) o ) ) ; } else { buf . append ( _dumpAsString ( tab , ( ( DEREncodable ) o ) . getDERObject ( ) ) ) ; } } return buf . toString ( ) ; } else if ( obj instanceof DERObjectIdentifier ) { return indent + "ObjectIdentifier(" + ( ( DERObjectIdentifier ) obj ) . getId ( ) + ")" + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERBoolean ) { return indent + "Boolean(" + ( ( DERBoolean ) obj ) . isTrue ( ) + ")" + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERInteger ) { return indent + "Integer(" + ( ( DERInteger ) obj ) . getValue ( ) + ")" + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof BERConstructedOctetString ) { return indent + "BER Constructed Octet String" + "[" + ( ( ASN1OctetString ) obj ) . getOctets ( ) . length + "] " + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DEROctetString ) { return indent + "DER Octet String" + "[" + ( ( ASN1OctetString ) obj ) . getOctets ( ) . length + "] " + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERBitString ) { return indent + "DER Bit String" + "[" + ( ( DERBitString ) obj ) . getBytes ( ) . length + ", " + ( ( DERBitString ) obj ) . getPadBits ( ) + "] " + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERIA5String ) { return indent + "IA5String(" + ( ( DERIA5String ) obj ) . getString ( ) + ") " + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERUTF8String ) { return indent + "UTF8String(" + ( ( DERUTF8String ) obj ) . getString ( ) + ") " + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERPrintableString ) { return indent + "PrintableString(" + ( ( DERPrintableString ) obj ) . getString ( ) + ") " + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERVisibleString ) { return indent + "VisibleString(" + ( ( DERVisibleString ) obj ) . getString ( ) + ") " + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERBMPString ) { return indent + "BMPString(" + ( ( DERBMPString ) obj ) . getString ( ) + ") " + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERT61String ) { return indent + "T61String(" + ( ( DERT61String ) obj ) . getString ( ) + ") " + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERUTCTime ) { return indent + "UTCTime(" + ( ( DERUTCTime ) obj ) . getTime ( ) + ") " + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERGeneralizedTime ) { return indent + "GeneralizedTime(" + ( ( DERGeneralizedTime ) obj ) . getTime ( ) + ") " + System . getProperty ( "line.separator" ) ; } else if ( obj instanceof DERUnknownTag ) { // TODO liberty if we keep this find Hex // return indent + " Unknown " + Integer . toString ( ( ( DERUnknownTag ) obj ) . getTag ( ) , 16 ) + " " + new String ( Hex . encode ( ( ( DERUnknownTag ) obj ) . getData ( ) ) ) + System . getProperty ( " line . separator " ) ; return indent + "Unknown " + Integer . toString ( ( ( DERUnknownTag ) obj ) . getTag ( ) , 16 ) + " " + new String ( ( ( DERUnknownTag ) obj ) . getData ( ) ) + System . getProperty ( "line.separator" ) ; } else { return indent + obj . toString ( ) + System . getProperty ( "line.separator" ) ; }
public class Component { /** * Evaluates the OGNL stack to find an Object value . * Function just like < code > findValue ( String ) < / code > except that if the given expression is * < tt > null < / tt / > a error is logged and a < code > RuntimeException < / code > is thrown constructed with * a messaged based on the given field and errorMsg paramter . * @ param expr * OGNL expression . * @ param field * field name used when throwing < code > RuntimeException < / code > . * @ param errorMsg * error message used when throwing < code > RuntimeException < / code > . * @ return the Object found , is never < tt > null < / tt > . * @ throws StrutsException * is thrown in case of not found in the OGNL stack , or * expression is < tt > null < / tt > . */ protected Object findValue ( String expr , String field , String errorMsg ) { } }
if ( expr == null ) { throw fieldError ( field , errorMsg , null ) ; } else { Object value = null ; Exception problem = null ; try { value = findValue ( expr ) ; } catch ( Exception e ) { problem = e ; } if ( value == null ) { throw fieldError ( field , errorMsg , problem ) ; } return value ; }
public class SessionApi { /** * Activate channels * Activate the specified channels using the provided resources . If the channels are successfully activated , Workspace sends additional information about the state of active resources ( DNs , channels ) via events . The resources you provide are associated with the agent for the duration of the session . You should send this request after making an [ / initialize - workspace ] ( / reference / workspace / Session / index . html # initializeWorkspace ) request and getting the WorkspaceInitializationComplete message through CometD . * @ param channelsData ( required ) * @ return ApiSuccessResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public ApiSuccessResponse activateChannels ( ChannelsData channelsData ) throws ApiException { } }
ApiResponse < ApiSuccessResponse > resp = activateChannelsWithHttpInfo ( channelsData ) ; return resp . getData ( ) ;
public class FollowerRunnable { /** * sets up blobstore state for all current keys */ private void setupBlobstore ( ) throws Exception { } }
BlobStore blobStore = data . getBlobStore ( ) ; StormClusterState clusterState = data . getStormClusterState ( ) ; Set < String > localSetOfKeys = Sets . newHashSet ( blobStore . listKeys ( ) ) ; Set < String > allKeys = Sets . newHashSet ( clusterState . active_keys ( ) ) ; Set < String > localAvailableActiveKeys = Sets . intersection ( localSetOfKeys , allKeys ) ; // keys on local but not on zk , we will delete it Set < String > keysToDelete = Sets . difference ( localSetOfKeys , allKeys ) ; LOG . debug ( "deleting keys not on zookeeper {}" , keysToDelete ) ; for ( String key : keysToDelete ) { blobStore . deleteBlob ( key ) ; } LOG . debug ( "Creating list of key entries for blobstore inside zookeeper {} local {}" , allKeys , localAvailableActiveKeys ) ; for ( String key : localAvailableActiveKeys ) { int versionForKey = BlobStoreUtils . getVersionForKey ( key , data . getNimbusHostPortInfo ( ) , data . getConf ( ) ) ; clusterState . setup_blobstore ( key , data . getNimbusHostPortInfo ( ) , versionForKey ) ; }
public class ResourceGroovyMethods { /** * Converts this File to a { @ link groovy . lang . Writable } or delegates to default * { @ link DefaultGroovyMethods # asType ( java . lang . Object , java . lang . Class ) } . * @ param f a File * @ param c the desired class * @ return the converted object * @ since 1.0 */ @ SuppressWarnings ( "unchecked" ) public static < T > T asType ( File f , Class < T > c ) { } }
if ( c == Writable . class ) { return ( T ) asWritable ( f ) ; } return DefaultGroovyMethods . asType ( ( Object ) f , c ) ;
public class DescriptionBuilder { /** * Returns a new { @ link PropertyBuilder } preconfigured with an existing property or a new one to add a new property . * Be sure to call { @ link # property ( com . dtolabs . rundeck . core . plugins . configuration . Property ) } to add the result of * the final call to { @ link com . dtolabs . rundeck . plugins . util . PropertyBuilder # build ( ) } . * @ param name name * @ return this builder */ public PropertyBuilder property ( final String name ) { } }
final Property found = findProperty ( name ) ; if ( null != found ) { return PropertyBuilder . builder ( found ) ; } else { return PropertyBuilder . builder ( ) . name ( name ) ; }
public class CPAttachmentFileEntryLocalServiceBaseImpl { /** * Returns the cp attachment file entry with the matching external reference code and company . * @ param companyId the primary key of the company * @ param externalReferenceCode the cp attachment file entry ' s external reference code * @ return the matching cp attachment file entry , or < code > null < / code > if a matching cp attachment file entry could not be found */ @ Override public CPAttachmentFileEntry fetchCPAttachmentFileEntryByReferenceCode ( long companyId , String externalReferenceCode ) { } }
return cpAttachmentFileEntryPersistence . fetchByC_ERC ( companyId , null ) ;
public class AccountManager { /** * Returns true if the server supports creating new accounts . Many servers require * that you not be currently authenticated when creating new accounts , so the safest * behavior is to only create new accounts before having logged in to a server . * @ return true if the server support creating new accounts . * @ throws XMPPErrorException * @ throws NoResponseException * @ throws NotConnectedException * @ throws InterruptedException */ public boolean supportsAccountCreation ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } }
// TODO : Replace this body with isSupported ( ) and possible deprecate this method . // Check if we already know that the server supports creating new accounts if ( accountCreationSupported ) { return true ; } // No information is known yet ( e . g . no stream feature was received from the server // indicating that it supports creating new accounts ) so send an IQ packet as a way // to discover if this feature is supported if ( info == null ) { getRegistrationInfo ( ) ; accountCreationSupported = info . getType ( ) != IQ . Type . error ; } return accountCreationSupported ;
public class CsvOpenCSV { /** * - - - IMPLEMENTED PARSER METHOD - - - */ @ SuppressWarnings ( "resource" ) @ Override public Object parse ( String source ) throws Exception { } }
return new CSVReader ( new StringReader ( source ) , defaultSeparatorChar , defaultQuoteChar , defaultEscapeChar , defaultSkipLines , defaultStrictQuotes , defaultIgnoreLeadingWhiteSpace ) . readAll ( ) ;
public class RecoveryPointsInner { /** * Lists the backup copies for the backed up item . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; RecoveryPointResourceInner & gt ; object */ public Observable < Page < RecoveryPointResourceInner > > listNextAsync ( final String nextPageLink ) { } }
return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < RecoveryPointResourceInner > > , Page < RecoveryPointResourceInner > > ( ) { @ Override public Page < RecoveryPointResourceInner > call ( ServiceResponse < Page < RecoveryPointResourceInner > > response ) { return response . body ( ) ; } } ) ;
public class HtmlUnitRegExpProxy { /** * { @ inheritDoc } */ @ Override public int find_split ( final Context cx , final Scriptable scope , final String target , final String separator , final Scriptable re , final int [ ] ip , final int [ ] matchlen , final boolean [ ] matched , final String [ ] [ ] parensp ) { } }
return wrapped_ . find_split ( cx , scope , target , separator , re , ip , matchlen , matched , parensp ) ;
public class RefList { /** * Gets the value of the addressOrAlternativesOrArray property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < / CODE > method for the addressOrAlternativesOrArray property . * For example , to add a new item , do as follows : * < pre > * getAddressOrAlternativesOrArray ( ) . add ( newItem ) ; * < / pre > * Objects of the following type ( s ) are allowed in the list * { @ link Address } * { @ link Alternatives } * { @ link Array } * { @ link BoxedText } * { @ link ChemStructWrap } * { @ link Fig } * { @ link FigGroup } * { @ link Graphic } * { @ link Media } * { @ link Preformat } * { @ link SupplementaryMaterial } * { @ link TableWrap } * { @ link TableWrapGroup } * { @ link DispFormula } * { @ link DispFormulaGroup } * { @ link P } * { @ link DefList } * { @ link ch . epfl . bbp . uima . xml . archivearticle3 . List } * { @ link TexMath } * { @ link MathType } * { @ link RelatedArticle } * { @ link RelatedObject } * { @ link Ack } * { @ link DispQuote } * { @ link Speech } * { @ link Statement } * { @ link VerseGroup } * { @ link X } * { @ link Ref } */ public java . util . List < Object > getAddressOrAlternativesOrArray ( ) { } }
if ( addressOrAlternativesOrArray == null ) { addressOrAlternativesOrArray = new ArrayList < Object > ( ) ; } return this . addressOrAlternativesOrArray ;
public class SettingsModule { /** * Common */ public boolean getBooleanValue ( String key , boolean defaultVal ) { } }
String sValue = readValue ( key ) ; boolean res = defaultVal ; if ( sValue != null ) { if ( "true" . equals ( sValue ) ) { res = true ; } else if ( "false" . equals ( sValue ) ) { res = false ; } } return res ;
public class ShardingRule { /** * Find binding table rule via logic table name . * @ param logicTableName logic table name * @ return binding table rule */ public Optional < BindingTableRule > findBindingTableRule ( final String logicTableName ) { } }
for ( BindingTableRule each : bindingTableRules ) { if ( each . hasLogicTable ( logicTableName ) ) { return Optional . of ( each ) ; } } return Optional . absent ( ) ;
public class CoronaJobTracker { /** * Executes actions that can be executed after asking commit permission * authority * @ param actions list of actions to execute * @ throws IOException */ private void dispatchCommitActions ( List < CommitTaskAction > commitActions ) throws IOException { } }
if ( ! commitActions . isEmpty ( ) ) { TaskAttemptID [ ] wasCommitting ; try { wasCommitting = commitPermissionClient . getAndSetCommitting ( commitActions ) ; } catch ( IOException e ) { LOG . error ( "Commit permission client is faulty - killing this JT" ) ; try { close ( false ) ; } catch ( InterruptedException e1 ) { throw new IOException ( e1 ) ; } throw e ; } int i = 0 ; for ( CommitTaskAction action : commitActions ) { TaskAttemptID oldCommitting = wasCommitting [ i ] ; if ( oldCommitting != null ) { // Fail old committing task attempt failTask ( oldCommitting , "Unknown committing attempt" , false ) ; } // Commit new task TaskAttemptID newToCommit = action . getTaskID ( ) ; if ( ! newToCommit . equals ( oldCommitting ) ) { String trackerName = taskLookupTable . getAssignedTracker ( newToCommit ) ; taskLauncher . commitTask ( trackerName , resourceTracker . getTrackerAddr ( trackerName ) , action ) ; } else { LOG . warn ( "Repeated try to commit same attempt id. Ignoring" ) ; } // iterator next ++ i ; } }
public class ClearExpiredRecordsTask { /** * see { @ link # partitionLost } */ private boolean lostPartitionDetected ( ) { } }
int currentLostPartitionCount = lostPartitionCounter . get ( ) ; if ( currentLostPartitionCount == lastKnownLostPartitionCount ) { return false ; } lastKnownLostPartitionCount = currentLostPartitionCount ; return true ;
public class JobsClientImpl { /** * { @ inheritDoc } */ public List < Job > getJobsForHistory ( String historyId ) { } }
return get ( getWebResource ( ) . queryParam ( "history_id" , historyId ) , new TypeReference < List < Job > > ( ) { } ) ;
public class MessageFactory { /** * Creates a new < code > MessageFactory < / code > object that is an instance * of the default implementation ( SOAP 1.1 ) , * This method uses the following ordered lookup procedure to determine the MessageFactory implementation class to load : * < UL > * < LI > Use the javax . xml . soap . MessageFactory system property . * < LI > Use the properties file " lib / jaxm . properties " in the JRE directory . This configuration file is in standard * java . util . Properties format and contains the fully qualified name of the implementation class with the key being the * system property defined above . * < LI > Use the Services API ( as detailed in the JAR specification ) , if available , to determine the classname . The Services API * will look for a classname in the file META - INF / services / javax . xml . soap . MessageFactory in jars available to the runtime . * < LI > Use the SAAJMetaFactory instance to locate the MessageFactory implementation class . * < / UL > * @ return a new instance of a < code > MessageFactory < / code > * @ exception SOAPException if there was an error in creating the * default implementation of the * < code > MessageFactory < / code > . * @ see SAAJMetaFactory */ public static MessageFactory newInstance ( ) throws SOAPException { } }
try { MessageFactory factory = ( MessageFactory ) FactoryFinder . find ( MESSAGE_FACTORY_PROPERTY ) ; if ( factory != null ) return factory ; return newInstance ( SOAPConstants . SOAP_1_1_PROTOCOL ) ; } catch ( Exception ex ) { throw new SOAPException ( "Unable to create message factory for SOAP: " + ex . getMessage ( ) ) ; }