signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AxisAngle4f { /** * Increase the rotation angle by the given amount .
* This method also takes care of wrapping around .
* @ param ang
* the angle increase
* @ return this */
public AxisAngle4f rotate ( float ang ) { } } | angle += ang ; angle = ( float ) ( ( angle < 0.0 ? Math . PI + Math . PI + angle % ( Math . PI + Math . PI ) : angle ) % ( Math . PI + Math . PI ) ) ; return this ; |
public class ConverterRegistry { /** * Register user defined converter associated to value type . Converter class should be instantiable , i . e . not
* abstract , interface or void , must have no arguments constructor , even if private and its constructor should of
* course execute without exception . Otherwise unchecked exception may arise as described on throws section . There are
* no other constrains on value type class .
* Note : it is caller responsibility to enforce proper bound , i . e . given converter class to properly handle requested
* value type . Otherwise exception may throw when this particular converter is enacted .
* @ param valueType value type class ,
* @ param converterClass specialized converter class .
* @ throws BugError if converter class is not instantiable .
* @ throws NoSuchBeingException if converter class has no default constructor .
* @ throws InvocationException with target exception if converter class construction fails on its execution . */
public void registerConverter ( Class < ? > valueType , Class < ? extends Converter > converterClass ) { } } | Converter converter = Classes . newInstance ( converterClass ) ; if ( Types . isConcrete ( valueType ) ) { registerConverterInstance ( valueType , converter ) ; } else { if ( abstractConverters . put ( valueType , converter ) == null ) { log . debug ( "Register abstract converter |%s| for value type |%s|." , converterClass , valueType ) ; } else { log . warn ( "Override abstract converter |%s| for value type |%s|." , converterClass , valueType ) ; } } |
public class SematextClient { /** * Send datapoints list .
* @ param datapoints datapoints
* @ throws IllegalArgumentException if one of datapoints is invalid */
public void send ( List < StDatapoint > datapoints ) { } } | for ( StDatapoint metric : datapoints ) { StDatapointValidator . validate ( metric ) ; } sender . send ( datapoints ) ; |
public class AdaptedAction { /** * ( non - Javadoc )
* @ see com . sporniket . libre . ui . action . UserInterfaceAction # setIconForButton ( java . lang . Object ) */
@ Override public void setIconForButton ( IconLocationType iconForButton ) { } } | if ( null != iconForButton ) { myUserInterfaceAction . setIconForButton ( iconForButton ) ; ImageIcon _icon = retrieveIcon ( getIconForButton ( ) ) ; putValue ( Action . LARGE_ICON_KEY , _icon ) ; } |
public class DescribeClientVpnConnectionsRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < DescribeClientVpnConnectionsRequest > getDryRunRequest ( ) { } } | Request < DescribeClientVpnConnectionsRequest > request = new DescribeClientVpnConnectionsRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class VertexUpdateFunction { /** * Gets the broadcast data set registered under the given name . Broadcast data sets
* are available on all parallel instances of a function . They can be registered via
* { @ link VertexCentricIteration # addBroadcastSetForUpdateFunction ( String , eu . stratosphere . api . java . DataSet ) } .
* @ param name The name under which the broadcast set is registered .
* @ return The broadcast data set . */
public < T > Collection < T > getBroadcastSet ( String name ) { } } | return this . runtimeContext . < T > getBroadcastVariable ( name ) ; |
public class StructuredQueryBuilder { /** * Matches the container specified by the constraint
* whose value that has the correct datatyped comparison with
* one of the criteria values .
* @ param constraintName the constraint definition
* @ param operator the comparison with the criteria values
* @ param values the possible datatyped values for the comparison
* @ return the StructuredQueryDefinition for the range constraint query */
public StructuredQueryDefinition rangeConstraint ( String constraintName , Operator operator , String ... values ) { } } | return new RangeConstraintQuery ( constraintName , operator , values ) ; |
public class RTMPMinaIoHandler { /** * { @ inheritDoc } */
@ Override public void sessionOpened ( IoSession session ) throws Exception { } } | log . debug ( "Session opened" ) ; super . sessionOpened ( session ) ; // get the handshake from the session
RTMPHandshake handshake = ( RTMPHandshake ) session . getAttribute ( RTMPConnection . RTMP_HANDSHAKE ) ; // create and send C0 + C1
IoBuffer clientRequest1 = ( ( OutboundHandshake ) handshake ) . generateClientRequest1 ( ) ; session . write ( clientRequest1 ) ; |
public class Gmap3WicketToDoItems { /** * region > allToDos ( action ) */
@ Action ( semantics = SemanticsOf . SAFE ) @ MemberOrder ( sequence = "50" ) public List < Gmap3ToDoItem > allToDos ( ) { } } | final String currentUser = currentUserName ( ) ; final List < Gmap3ToDoItem > items = repositoryService . allMatches ( Gmap3ToDoItem . class , Gmap3ToDoItem . Predicates . thoseOwnedBy ( currentUser ) ) ; Collections . sort ( items ) ; if ( items . isEmpty ( ) ) { messageService . warnUser ( "No to-do items found." ) ; } return items ; |
public class FirestoreAdminClient { /** * Creates a composite index . This returns a
* [ google . longrunning . Operation ] [ google . longrunning . Operation ] which may be used to track the
* status of the creation . The metadata for the operation will be the type
* [ IndexOperationMetadata ] [ google . firestore . admin . v1 . IndexOperationMetadata ] .
* < p > Sample code :
* < pre > < code >
* try ( FirestoreAdminClient firestoreAdminClient = FirestoreAdminClient . create ( ) ) {
* ParentName parent = ParentName . of ( " [ PROJECT ] " , " [ DATABASE ] " , " [ COLLECTION _ ID ] " ) ;
* Index index = Index . newBuilder ( ) . build ( ) ;
* Operation response = firestoreAdminClient . createIndex ( parent , index ) ;
* < / code > < / pre >
* @ param parent A parent name of the form
* ` projects / { project _ id } / databases / { database _ id } / collectionGroups / { collection _ id } `
* @ param index The composite index to create .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
public final Operation createIndex ( ParentName parent , Index index ) { } } | CreateIndexRequest request = CreateIndexRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . setIndex ( index ) . build ( ) ; return createIndex ( request ) ; |
public class DataGridTagModel { /** * Format a message given a resource string name < code > key < / code > and a set of
* formatting arguments < code > args < / code > .
* @ param key the message key
* @ param args the arguments used when formatting the message
* @ return the formatted message */
public String formatMessage ( String key , Object [ ] args ) { } } | assert _resourceProvider != null : "Received a null resource provider" ; return _resourceProvider . formatMessage ( key , args ) ; |
public class Token { /** * Creates a token with the specified meaning . */
public static Token newPlaceholder ( int type ) { } } | Token token = new Token ( Types . UNKNOWN , "" , - 1 , - 1 ) ; token . setMeaning ( type ) ; return token ; |
public class ReverseBinaryEncoder { /** * Write import declarations ( which refer to shared symbol tables ) if any
* exists .
* @ param symTab the local symbol table , not shared , not system */
private void writeImportsField ( SymbolTable symTab ) { } } | // SymbolTable [ ] holds accurate information , i . e . it contains the
// actual import declaration information , through the means of
// substitute tables if an exact match was not found by the catalog .
SymbolTable [ ] sharedSymTabs = symTab . getImportedTables ( ) ; if ( sharedSymTabs . length == 0 ) { return ; } final int importsOffset = myBuffer . length - myOffset ; for ( int i = sharedSymTabs . length ; -- i >= 0 ; ) { writeImport ( sharedSymTabs [ i ] ) ; } writePrefix ( TYPE_LIST , myBuffer . length - myOffset - importsOffset ) ; writeByte ( ( byte ) ( 0x80 | IMPORTS_SID ) ) ; |
public class ClipAndReduce { /** * Clip the input image to ensure a constant aspect ratio */
T clipInput ( T input , T output ) { } } | double ratioInput = input . width / ( double ) input . height ; double ratioOutput = output . width / ( double ) output . height ; T a = input ; if ( ratioInput > ratioOutput ) { // clip the width
int width = input . height * output . width / output . height ; int x0 = ( input . width - width ) / 2 ; int x1 = x0 + width ; clipped = input . subimage ( x0 , 0 , x1 , input . height , clipped ) ; a = clipped ; } else if ( ratioInput < ratioOutput ) { // clip the height
int height = input . width * output . height / output . width ; int y0 = ( input . height - height ) / 2 ; int y1 = y0 + height ; clipped = input . subimage ( 0 , y0 , input . width , y1 , clipped ) ; a = clipped ; } return a ; |
public class NettyClientTransport { /** * Convert ChannelFuture . cause ( ) to a Status , taking into account that all handlers are removed
* from the pipeline when the channel is closed . Since handlers are removed , you may get an
* unhelpful exception like ClosedChannelException .
* < p > This method must only be called on the event loop . */
private Status statusFromFailedFuture ( ChannelFuture f ) { } } | Throwable t = f . cause ( ) ; if ( t instanceof ClosedChannelException // Exception thrown by the StreamBufferingEncoder if the channel is closed while there
// are still streams buffered . This exception is not helpful . Replace it by the real
// cause of the shutdown ( if available ) .
|| t instanceof Http2ChannelClosedException ) { Status shutdownStatus = lifecycleManager . getShutdownStatus ( ) ; if ( shutdownStatus == null ) { return Status . UNKNOWN . withDescription ( "Channel closed but for unknown reason" ) . withCause ( new ClosedChannelException ( ) . initCause ( t ) ) ; } return shutdownStatus ; } return Utils . statusFromThrowable ( t ) ; |
public class StackBenchmark { /** * Bench for pushing the data to the { @ link Stack } . */
@ Bench ( runs = RUNS ) public void benchNormalIntPush ( ) { } } | normalInt = new Stack < Integer > ( ) ; for ( final int i : intData ) { normalInt . push ( i ) ; } |
public class SignatureChecker { /** * Validates the signature on a Simple Notification Service message . No
* Amazon - specific dependencies , just plain Java crypto
* @ param parsedMessage
* A map of Simple Notification Service message .
* @ param publicKey
* The Simple Notification Service public key , exactly as you ' d
* see it when retrieved from the cert .
* @ return True if the message was correctly validated , otherwise false . */
public boolean verifySignature ( Map < String , String > parsedMessage , PublicKey publicKey ) { } } | boolean valid = false ; String version = parsedMessage . get ( SIGNATURE_VERSION ) ; if ( version . equals ( "1" ) ) { // construct the canonical signed string
String type = parsedMessage . get ( TYPE ) ; String signature = parsedMessage . get ( SIGNATURE ) ; String signed ; if ( type . equals ( NOTIFICATION_TYPE ) ) { signed = stringToSign ( publishMessageValues ( parsedMessage ) ) ; } else if ( type . equals ( SUBSCRIBE_TYPE ) ) { signed = stringToSign ( subscribeMessageValues ( parsedMessage ) ) ; } else if ( type . equals ( UNSUBSCRIBE_TYPE ) ) { signed = stringToSign ( subscribeMessageValues ( parsedMessage ) ) ; // no difference , for now
} else { throw new RuntimeException ( "Cannot process message of type " + type ) ; } valid = verifySignature ( signed , signature , publicKey ) ; } return valid ; |
public class ImportSet { /** * Inserts imports for the non - primitive classes contained in all array imports . */
public void translateClassArrays ( ) { } } | ImportSet arrayTypes = new ImportSet ( ) ; Iterator < String > i = _imports . iterator ( ) ; while ( i . hasNext ( ) ) { String name = i . next ( ) ; int bracket = name . lastIndexOf ( '[' ) ; if ( bracket != - 1 && name . charAt ( bracket + 1 ) == 'L' ) { arrayTypes . add ( name . substring ( bracket + 2 , name . length ( ) - 1 ) ) ; } } addAll ( arrayTypes ) ; |
public class FeatureListGrid { /** * Apply a new layer onto the grid . This means that the table header will immediately take on the attributes of this
* new layer .
* @ param layer
* The layer from whom to display the features . If this is null , the table will be cleared . */
public void setLayer ( VectorLayer layer ) { } } | this . layer = layer ; if ( layer == null ) { clear ( ) ; } else { empty ( ) ; updateFields ( ) ; } |
public class DistributedWorkManagerImpl { /** * { @ inheritDoc } */
@ Override protected void deltaScheduleWorkAccepted ( ) { } } | if ( trace ) log . trace ( "deltaScheduleWorkAccepted" ) ; super . deltaScheduleWorkAccepted ( ) ; if ( distributedStatisticsEnabled && distributedStatistics != null && transport != null ) { try { checkTransport ( ) ; distributedStatistics . sendDeltaScheduleWorkAccepted ( ) ; } catch ( WorkException we ) { log . debugf ( "deltaScheduleWorkAccepted: %s" , we . getMessage ( ) , we ) ; } } |
public class Linear { /** * Backpropagation for regression
* @ param target floating - point target value */
protected void bprop ( float target ) { } } | assert ( target != missing_real_value ) ; if ( params . loss != Loss . MeanSquare ) throw new UnsupportedOperationException ( "Regression is only implemented for MeanSquare error." ) ; final int row = 0 ; // Computing partial derivative : dE / dnet = dE / dy * dy / dnet = dE / dy * 1
final float g = target - _a . get ( row ) ; // for MSE - dMSE / dy = target - y
float m = momentum ( ) ; float r = _minfo . adaDelta ( ) ? 0 : rate ( _minfo . get_processed_total ( ) ) * ( 1f - m ) ; bprop ( row , g , r , m ) ; |
public class ETagUtils { /** * Handles the if - match header . returns true if the request should proceed , false otherwise
* @ param exchange the exchange
* @ param etags The etags
* @ return */
public static boolean handleIfMatch ( final HttpServerExchange exchange , final List < ETag > etags , boolean allowWeak ) { } } | return handleIfMatch ( exchange . getRequestHeaders ( ) . getFirst ( Headers . IF_MATCH ) , etags , allowWeak ) ; |
public class ProxiedStatusCodeMappingFunction { /** * { @ inheritDoc } */
@ Override public List < String > apply ( @ SuppressWarnings ( "rawtypes" ) final ProfileRequestContext input ) { } } | List < String > codes = null ; if ( input != null ) { ProxiedStatusContext context = input . getSubcontext ( ProxiedStatusContext . class , false ) ; if ( context != null && context . getStatus ( ) != null ) { codes = new ArrayList < > ( ) ; StatusCode statusCode = context . getStatus ( ) . getStatusCode ( ) ; while ( statusCode != null ) { codes . add ( statusCode . getValue ( ) ) ; statusCode = statusCode . getStatusCode ( ) ; } } } return codes != null ? codes : super . apply ( input ) ; |
public class Transaction { /** * < p > Calculates a signature hash , that is , a hash of a simplified form of the transaction . How exactly the transaction
* is simplified is specified by the type and anyoneCanPay parameters . < / p >
* < p > This is a low level API and when using the regular { @ link Wallet } class you don ' t have to call this yourself .
* When working with more complex transaction types and contracts , it can be necessary . When signing a Witness output
* the scriptCode should be the script encoded into the scriptSig field , for normal transactions , it ' s the
* scriptPubKey of the output you ' re signing for . ( See BIP143 : https : / / github . com / bitcoin / bips / blob / master / bip - 0143 . mediawiki ) < / p >
* @ param inputIndex input the signature is being calculated for . Tx signatures are always relative to an input .
* @ param scriptCode the script that should be in the given input during signing .
* @ param prevValue the value of the coin being spent
* @ param type Should be SigHash . ALL
* @ param anyoneCanPay should be false . */
public synchronized Sha256Hash hashForWitnessSignature ( int inputIndex , Script scriptCode , Coin prevValue , SigHash type , boolean anyoneCanPay ) { } } | return hashForWitnessSignature ( inputIndex , scriptCode . getProgram ( ) , prevValue , type , anyoneCanPay ) ; |
public class CmsAdminMenuGroup { /** * Adds a menu item at the given position . < p >
* @ param item the item
* @ param position the position
* @ see org . opencms . workplace . tools . CmsIdentifiableObjectContainer # addIdentifiableObject ( String , Object , float ) */
public void addMenuItem ( CmsAdminMenuItem item , float position ) { } } | m_container . addIdentifiableObject ( item . getId ( ) , item , position ) ; |
public class ElasticsearchRestClientFactoryBean { /** * Init templates if needed .
* Note that you can force to recreate template using
* { @ link # setForceTemplate ( boolean ) } */
private void initTemplates ( ) throws Exception { } } | if ( templates != null && templates . length > 0 ) { for ( String template : templates ) { Assert . hasText ( template , "Can not read template in [" + template + "]. Check that templates is not empty." ) ; createTemplate ( client . getLowLevelClient ( ) , classpathRoot , template , forceTemplate ) ; } } |
public class ProcessUtils { /** * Runs the given { @ link Process } . This method should only be called from { @ code main ( ) } methods .
* @ param process the { @ link Process } to run */
public static void run ( Process process ) { } } | try { LOG . info ( "Starting {}." , process ) ; process . start ( ) ; LOG . info ( "Stopping {}." , process ) ; System . exit ( 0 ) ; } catch ( Throwable t ) { LOG . error ( "Uncaught exception while running {}, stopping it and exiting." , process , t ) ; try { process . stop ( ) ; } catch ( Throwable t2 ) { // continue to exit
LOG . error ( "Uncaught exception while stopping {}, simply exiting." , process , t2 ) ; } System . exit ( - 1 ) ; } |
public class SearchView { /** * Updates the browser address bar with the current query parameters and the
* query itself .
* This is for convenient reloading the vaadin app and easy copying citation
* links .
* @ param q The query where the parameters are extracted from . */
public void updateFragment ( DisplayedResultQuery q ) { } } | List < String > args = Helper . citationFragment ( q . getQuery ( ) , q . getCorpora ( ) , q . getLeftContext ( ) , q . getRightContext ( ) , q . getSegmentation ( ) , q . getBaseText ( ) , q . getOffset ( ) , q . getLimit ( ) , q . getOrder ( ) , q . getSelectedMatches ( ) ) ; // set our fragment
lastEvaluatedFragment = StringUtils . join ( args , "&" ) ; UI . getCurrent ( ) . getPage ( ) . setUriFragment ( lastEvaluatedFragment , false ) ; // reset title
Page . getCurrent ( ) . setTitle ( ui . getInstanceConfig ( ) . getInstanceDisplayName ( ) + " (ANNIS Corpus Search)" ) ; |
public class TableAssignment { /** * Gets the tuples which are in this assignment .
* @ return */
public List < List < Object > > getTuples ( ) { } } | Iterator < KeyValue > keyValueIter = indicators . keyValueIterator ( ) ; List < List < Object > > tuples = Lists . newArrayList ( ) ; while ( keyValueIter . hasNext ( ) ) { KeyValue keyValue = keyValueIter . next ( ) ; if ( keyValue . getValue ( ) != 0.0 ) { tuples . add ( vars . intArrayToAssignment ( keyValue . getKey ( ) ) . getValues ( ) ) ; } } return tuples ; |
public class TaskQueue { /** * Clears all the inactive tasks in the specified queue . */
public static void emptyAndRemoveQueue ( String strQueueName ) { } } | TaskQueue taskQueue = QUEUE_MAP . get ( strQueueName ) ; if ( taskQueue != null ) { taskQueue . emptyQueue ( ) ; synchronized ( taskQueue . _queue ) { taskQueue . _shutdown = true ; taskQueue . _queue . notifyAll ( ) ; } QUEUE_MAP . remove ( strQueueName ) ; } |
public class BaseTransactionHandler { /** * { @ inheritDoc } */
public void closeConnection ( ) { } } | if ( this . manualMode == false && this . dataSource != null ) { MjdbcUtils . closeQuietly ( this . conn ) ; this . conn = null ; } |
public class Criteria { /** * make a copy of the criteria
* @ param includeGroupBy if true
* @ param includeOrderBy if ture
* @ param includePrefetchedRelationships if true
* @ return a copy of the criteria */
public Criteria copy ( boolean includeGroupBy , boolean includeOrderBy , boolean includePrefetchedRelationships ) { } } | Criteria copy = new Criteria ( ) ; copy . m_criteria = new Vector ( this . m_criteria ) ; copy . m_negative = this . m_negative ; if ( includeGroupBy ) { copy . groupby = this . groupby ; } if ( includeOrderBy ) { copy . orderby = this . orderby ; } if ( includePrefetchedRelationships ) { copy . prefetchedRelationships = this . prefetchedRelationships ; } return copy ; |
public class OneElectronJob { /** * Calculates the matrix for the potential matrix
* V _ i , j = < chi _ i | 1 / r | chi _ j > */
private Matrix calculateV ( IBasis basis ) { } } | int size = basis . getSize ( ) ; Matrix V = new Matrix ( size , size ) ; int i , j ; for ( i = 0 ; i < size ; i ++ ) for ( j = 0 ; j < size ; j ++ ) V . matrix [ i ] [ j ] = basis . calcV ( i , j ) ; return V ; |
public class Expression { /** * Creates a code chunk representing a JavaScript identifier .
* @ throws IllegalArgumentException if { @ code id } is not a valid JavaScript identifier . */
static Expression id ( String id , Iterable < GoogRequire > requires ) { } } | CodeChunkUtils . checkId ( id ) ; return Leaf . create ( id , /* isCheap = */
true , requires ) ; |
public class cmppolicylabel_binding { /** * Use this API to fetch cmppolicylabel _ binding resource of given name . */
public static cmppolicylabel_binding get ( nitro_service service , String labelname ) throws Exception { } } | cmppolicylabel_binding obj = new cmppolicylabel_binding ( ) ; obj . set_labelname ( labelname ) ; cmppolicylabel_binding response = ( cmppolicylabel_binding ) obj . get_resource ( service ) ; return response ; |
public class JNRPE { /** * Shuts down the server . */
public void shutdown ( ) { } } | workerGroup . shutdownGracefully ( ) . syncUninterruptibly ( ) ; bossGroup . shutdownGracefully ( ) . syncUninterruptibly ( ) ; getExecutionContext ( ) . getEventBus ( ) . post ( new JNRPEStatusEvent ( STATUS . STOPPED , this , "JNRPE Server stopped" ) ) ; |
public class ImageArchiveUtil { /** * Search the manifest for an entry that has a repository and tag matching the provided pattern .
* @ param repoTagPattern the repository and tag to search ( e . g . busybox : latest ) .
* @ param manifest the manifest to be searched
* @ return a pair containing the matched tag and the entry found , or null if no match . */
public static Map < String , ImageArchiveManifestEntry > findEntriesByRepoTagPattern ( Pattern repoTagPattern , ImageArchiveManifest manifest ) throws PatternSyntaxException { } } | Map < String , ImageArchiveManifestEntry > entries = new LinkedHashMap < > ( ) ; if ( repoTagPattern == null || manifest == null ) { return entries ; } Matcher matcher = repoTagPattern . matcher ( "" ) ; for ( ImageArchiveManifestEntry entry : manifest . getEntries ( ) ) { for ( String entryRepoTag : entry . getRepoTags ( ) ) { if ( matcher . reset ( entryRepoTag ) . find ( ) ) { entries . putIfAbsent ( entryRepoTag , entry ) ; } } } return entries ; |
public class CorporationApi { /** * Get npc corporations Get a list of npc corporations - - - This route
* expires daily at 11:05
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param ifNoneMatch
* ETag from a previous request . A 304 will be returned if this
* matches the current ETag ( optional )
* @ return List & lt ; Integer & gt ;
* @ throws ApiException
* If fail to call the API , e . g . server error or cannot
* deserialize the response body */
public List < Integer > getCorporationsNpccorps ( String datasource , String ifNoneMatch ) throws ApiException { } } | ApiResponse < List < Integer > > resp = getCorporationsNpccorpsWithHttpInfo ( datasource , ifNoneMatch ) ; return resp . getData ( ) ; |
public class TrueTypeFont { /** * Gets the width from the font according to the unicode char < CODE > c < / CODE > .
* If the < CODE > name < / CODE > is null it ' s a symbolic font .
* @ param c the unicode char
* @ param name the glyph name
* @ return the width of the char */
int getRawWidth ( int c , String name ) { } } | int [ ] metric = getMetricsTT ( c ) ; if ( metric == null ) return 0 ; return metric [ 1 ] ; |
public class SymmetricQREigenHelper_DDRM { /** * Perform a shift in a random direction that is of the same magnitude as the elements in the matrix . */
public void exceptionalShift ( ) { } } | // rotating by a random angle handles at least one case using a random lambda
// does not handle well :
// - two identical eigenvalues are next to each other and a very small diagonal element
numExceptional ++ ; double mag = 0.05 * numExceptional ; if ( mag > 1.0 ) mag = 1.0 ; double theta = 2.0 * ( rand . nextDouble ( ) - 0.5 ) * mag ; performImplicitSingleStep ( theta , true ) ; lastExceptional = steps ; |
public class AuthorizationManager { /** * execution / process instance query / / / / / */
public void configureExecutionQuery ( AbstractQuery query ) { } } | configureQuery ( query ) ; CompositePermissionCheck permissionCheck = new PermissionCheckBuilder ( ) . disjunctive ( ) . atomicCheck ( PROCESS_INSTANCE , "RES.PROC_INST_ID_" , READ ) . atomicCheck ( PROCESS_DEFINITION , "P.KEY_" , READ_INSTANCE ) . build ( ) ; addPermissionCheck ( query . getAuthCheck ( ) , permissionCheck ) ; |
public class WSRdbManagedConnectionImpl { /** * Returns the statement into the cache . The statement is closed if an error occurs
* attempting to cache it . This method will only called if statement caching was enabled
* at some point , although it might not be enabled anymore .
* @ param statement the statement to return to the cache .
* @ param key the statement cache key . */
public final void cacheStatement ( Statement statement , StatementCacheKey key ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( this , tc , "cacheStatement" , AdapterUtil . toString ( statement ) , key ) ; // Add the statement to the cache . If there is no room in the cache , a statement from
// the least recently used bucket will be cast out of the cache . Any statement cast
// out of the cache must be closed .
CacheMap cache = getStatementCache ( ) ; Object discardedStatement = cache == null ? statement : statementCache . add ( key , statement ) ; if ( discardedStatement != null ) destroyStatement ( discardedStatement ) ; |
public class CXFEndpointProvider { /** * Adds service locator properties to an endpoint reference .
* @ param epr
* @ param props */
private static void addProperties ( EndpointReferenceType epr , SLProperties props ) { } } | MetadataType metadata = WSAEndpointReferenceUtils . getSetMetadata ( epr ) ; ServiceLocatorPropertiesType jaxbProps = SLPropertiesConverter . toServiceLocatorPropertiesType ( props ) ; JAXBElement < ServiceLocatorPropertiesType > slp = SL_OBJECT_FACTORY . createServiceLocatorProperties ( jaxbProps ) ; metadata . getAny ( ) . add ( slp ) ; |
public class AppBndAuthorizationTableService { /** * Get the access id for a user or group in the bindings config by looking up
* the user registry .
* @ param subject the Subject object in the bindings config , can be User or Group
* @ return the access id of the Subject specified in the bindings config ,
* otherwise null when a registry error occurs or the entry is not found */
@ FFDCIgnore ( EntryNotFoundException . class ) private String getMissingAccessId ( com . ibm . ws . javaee . dd . appbnd . Subject subjectFromArchive ) { } } | String subjectType = null ; try { SecurityService securityService = securityServiceRef . getService ( ) ; UserRegistryService userRegistryService = securityService . getUserRegistryService ( ) ; if ( ! userRegistryService . isUserRegistryConfigured ( ) ) return null ; UserRegistry userRegistry = userRegistryService . getUserRegistry ( ) ; String realm = userRegistry . getRealm ( ) ; if ( subjectFromArchive instanceof Group ) { subjectType = "group" ; String groupUniqueId = userRegistry . getUniqueGroupId ( subjectFromArchive . getName ( ) ) ; return AccessIdUtil . createAccessId ( AccessIdUtil . TYPE_GROUP , realm , groupUniqueId ) ; } else if ( subjectFromArchive instanceof User ) { subjectType = "user" ; String uniqueId = userRegistry . getUniqueUserId ( subjectFromArchive . getName ( ) ) ; return AccessIdUtil . createAccessId ( AccessIdUtil . TYPE_USER , realm , uniqueId ) ; } } catch ( EntryNotFoundException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) ) { if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "No entry found for " + subjectType + " " + subjectFromArchive . getName ( ) + " found in user registry. Unable to create access ID." ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "EntryNotFoundException details:" , e ) ; } } } catch ( RegistryException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unexpected exception getting the accessId for " + subjectFromArchive . getName ( ) + ": " + e ) ; } } return null ; |
public class ProcessInitiator { /** * Starts HFTA processes .
* @ throws IOException */
public void startHFTA ( ) throws IOException { } } | int hftaCount = MetaInformationParser . getHFTACount ( new File ( this . hubDataStore . getBinaryLocation ( ) . toURI ( ) ) ) ; for ( int i = 0 ; i < hftaCount ; i ++ ) { List < String > com = Lists . newArrayList ( ) ; com . add ( getHostPort ( hubDataStore . getHubAddress ( ) ) ) ; com . add ( hubDataStore . getInstanceName ( ) ) ; ExternalProgramExecutor executorService = new ExternalProgramExecutor ( "HFTA-" + i , new File ( binLocation , "hfta_" + i ) , com . toArray ( new String [ com . size ( ) ] ) ) ; hftaExecutor . add ( executorService ) ; LOG . info ( "Starting HFTA : {}" , executorService ) ; executorService . startAndWait ( ) ; } |
public class RmiServiceInvocation { /** * Gets the argument types from list of args .
* @ return */
public Class [ ] getArgTypes ( ) { } } | List < Class > types = new ArrayList < > ( ) ; if ( args != null ) { for ( MethodArg arg : args . getArgs ( ) ) { try { types . add ( Class . forName ( arg . getType ( ) ) ) ; } catch ( ClassNotFoundException e ) { throw new CitrusRuntimeException ( "Failed to access method argument type" , e ) ; } } } return types . toArray ( new Class [ types . size ( ) ] ) ; |
public class SourceSchema { /** * A list of < code > RecordColumn < / code > objects .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setRecordColumns ( java . util . Collection ) } or { @ link # withRecordColumns ( java . util . Collection ) } if you want
* to override the existing values .
* @ param recordColumns
* A list of < code > RecordColumn < / code > objects .
* @ return Returns a reference to this object so that method calls can be chained together . */
public SourceSchema withRecordColumns ( RecordColumn ... recordColumns ) { } } | if ( this . recordColumns == null ) { setRecordColumns ( new java . util . ArrayList < RecordColumn > ( recordColumns . length ) ) ; } for ( RecordColumn ele : recordColumns ) { this . recordColumns . add ( ele ) ; } return this ; |
public class FormulaFactory { /** * Adds a given formula to a list of operands . If the formula is the neutral element for the respective n - ary
* operation it will be skipped . If a complementary formula is already present in the list of operands or the
* formula is the dual element , { @ code false } is stored as first element of the result array ,
* otherwise { @ code true } is the first element of the result array . If the added formula was a clause , the second
* element in the result array is { @ code true } , { @ code false } otherwise .
* @ param ops the list of operands
* @ param f the formula */
private void addFormulaAnd ( final LinkedHashSet < Formula > ops , final Formula f ) { } } | if ( f . type ( ) == TRUE ) { this . formulaAdditionResult [ 0 ] = true ; this . formulaAdditionResult [ 1 ] = true ; } else if ( f . type == FALSE || containsComplement ( ops , f ) ) { this . formulaAdditionResult [ 0 ] = false ; this . formulaAdditionResult [ 1 ] = false ; } else { ops . add ( f ) ; this . formulaAdditionResult [ 0 ] = true ; this . formulaAdditionResult [ 1 ] = f . type == LITERAL || f . type == OR && ( ( Or ) f ) . isCNFClause ( ) ; } |
public class ListKeysResult { /** * A list of customer master keys ( CMKs ) .
* @ return A list of customer master keys ( CMKs ) . */
public java . util . List < KeyListEntry > getKeys ( ) { } } | if ( keys == null ) { keys = new com . amazonaws . internal . SdkInternalList < KeyListEntry > ( ) ; } return keys ; |
public class Maybe { /** * Terminate early if this is a { @ link Nothing } ; otherwise , continue the { @ link Applicative # zip zip } .
* @ param < B > the result type
* @ param lazyAppFn the lazy other applicative instance
* @ return the zipped { @ link Maybe } */
@ Override public < B > Lazy < Maybe < B > > lazyZip ( Lazy < ? extends Applicative < Function < ? super A , ? extends B > , Maybe < ? > > > lazyAppFn ) { } } | return match ( constantly ( lazy ( nothing ( ) ) ) , a -> lazyAppFn . fmap ( maybeF -> maybeF . < B > fmap ( f -> f . apply ( a ) ) . coerce ( ) ) ) ; |
public class TextClockSkin { /** * * * * * * Canvas * * * * * */
private void drawTime ( final ZonedDateTime TIME ) { } } | // draw the time
if ( clock . isTextVisible ( ) ) { if ( Locale . US == clock . getLocale ( ) ) { timeText . setText ( clock . isSecondsVisible ( ) ? AMPM_HHMMSS_FORMATTER . format ( TIME ) : AMPM_HHMM_FORMATTER . format ( TIME ) ) ; } else { timeText . setText ( clock . isSecondsVisible ( ) ? HHMMSS_FORMATTER . format ( TIME ) : HHMM_FORMATTER . format ( TIME ) ) ; } timeText . setX ( ( width - timeText . getLayoutBounds ( ) . getWidth ( ) ) * 0.5 ) ; } // draw the date
if ( clock . isDateVisible ( ) ) { dateText . setText ( dateFormat . format ( TIME ) ) ; dateText . setX ( ( width - dateText . getLayoutBounds ( ) . getWidth ( ) ) * 0.5 ) ; } |
public class CoverageDataCore { /** * Check the pixel value to see if it is the null equivalent
* @ param value
* pixel value
* @ return true if equivalent to data null */
public boolean isDataNull ( double value ) { } } | Double dataNull = getDataNull ( ) ; boolean isDataNull = dataNull != null && dataNull == value ; return isDataNull ; |
public class JobCredentialsInner { /** * Gets a jobs credential .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server .
* @ param jobAgentName The name of the job agent .
* @ param credentialName The name of the credential .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < JobCredentialInner > getAsync ( String resourceGroupName , String serverName , String jobAgentName , String credentialName , final ServiceCallback < JobCredentialInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , serverName , jobAgentName , credentialName ) , serviceCallback ) ; |
public class SQLDateAccessor { /** * ( non - Javadoc )
* @ see
* com . impetus . kundera . property . PropertyAccessor # fromString ( java . lang . String */
@ Override public Date fromString ( Class targetClass , String s ) { } } | if ( s == null ) { return null ; } if ( StringUtils . isNumeric ( s ) ) { return new Date ( Long . parseLong ( s ) ) ; } Date d = Date . valueOf ( s ) ; return d ; |
public class ProcessStarter { /** * < p > Executes the given command as if it had been executed from the command line of the host OS
* ( cmd . exe on windows , / bin / sh on * nix ) and returns all content sent to standard out as a string . If the command
* finishes with a non zero return value , a { @ link CommandFailedException } is thrown . < / p >
* < p > Content sent to standard error by the command will be forwarded to standard error for this JVM . < / p >
* < p > This method blocks on the execution of the command . < / p >
* < b > Example Usages : < / b >
* < pre >
* var currentDir = Shell . exec ( " dir " ) / / windows
* var currentDir = Shell . exec ( " ls " ) / / * nix
* Shell . exec ( " rm - rf " + directoryToNuke )
* < / pre >
* @ return the content of standard out
* @ throws CommandFailedException if the process finishes with a non - zero return value */
public String exec ( ) { } } | Writer stdOut = _stdOut != null ? _stdOut : new StringWriter ( ) ; Writer stdErr = _stdErr != null ? _stdErr : new StdErrWriter ( _inludeStdErrInOutput ? stdOut : new StringWriter ( ) ) ; handleCommand ( stdOut , stdErr ) ; flush ( stdOut ) ; flush ( stdErr ) ; return stdOut . toString ( ) ; |
public class TextUtil { /** * Escapes string using escape symbol .
* @ param string string
* @ param escape escape symbol
* @ param isPath if the string is path
* @ return escaped string */
public static String escape ( String string , char escape , boolean isPath ) { } } | try { BitSet validChars = isPath ? URISaveEx : URISave ; byte [ ] bytes = string . getBytes ( "utf-8" ) ; StringBuffer out = new StringBuffer ( bytes . length ) ; for ( int i = 0 ; i < bytes . length ; i ++ ) { int c = bytes [ i ] & 0xff ; if ( validChars . get ( c ) && c != escape ) { out . append ( ( char ) c ) ; } else { out . append ( escape ) ; out . append ( hexTable [ ( c >> 4 ) & 0x0f ] ) ; out . append ( hexTable [ ( c ) & 0x0f ] ) ; } } return out . toString ( ) ; } catch ( Exception exc ) { throw new InternalError ( exc . toString ( ) ) ; } |
public class ASrvOrm { /** * < p > Evaluate Android compatible values map of given entity .
* For " itsVersion " evaluate new one and set it in the entity ,
* old version stored in column " itsVersionOld " .
* Used in INSERT / UPDATE statement . < / p >
* @ param < T > entity type
* @ param pAddParam additional params , expected " isOnlyId " - true for
* converting only ID field .
* @ param pEntity entity
* @ return ColumnsValues type - safe map fieldName - fieldValue
* @ throws Exception an exception */
public final < T > ColumnsValues evalColumnsValues ( final Map < String , Object > pAddParam , final T pEntity ) throws Exception { } } | TableSql tableSql = getTablesMap ( ) . get ( pEntity . getClass ( ) . getSimpleName ( ) ) ; if ( tableSql . getFieldsMap ( ) . containsKey ( ISrvOrm . VERSION_NAME ) ) { pAddParam . put ( "versionAlgorithm" , tableSql . getVersionAlgorithm ( ) ) ; } @ SuppressWarnings ( "unchecked" ) IConverter < T , ColumnsValues > convToColVal = ( IConverter < T , ColumnsValues > ) this . factoryCnvEntityToColumnsValues . lazyGet ( pAddParam , pEntity . getClass ( ) ) ; ColumnsValues result = convToColVal . convert ( pAddParam , pEntity ) ; if ( tableSql . getFieldsMap ( ) . containsKey ( ISrvOrm . VERSION_NAME ) ) { pAddParam . remove ( "versionAlgorithm" ) ; } return result ; |
public class BoofConcurrency { /** * Computes the maximum value
* @ param start First index , inclusive
* @ param endExclusive Last index , exclusive
* @ param type Primtive data type , e . g . int . class , float . class , double . class
* @ param producer Given an integer input produce a Number output
* @ return The sum */
public static Number max ( int start , int endExclusive , Class type , IntProducerNumber producer ) { } } | try { return pool . submit ( new IntOperatorTask . Max ( start , endExclusive , type , producer ) ) . get ( ) ; } catch ( InterruptedException | ExecutionException e ) { throw new RuntimeException ( e ) ; } |
public class AnnotatedBeanFactoryRegistry { /** * Returns a { @ link BeanFactoryId } of the specified { @ link Class } and { @ code pathParams } for finding its
* factory from the factory cache later . */
static synchronized BeanFactoryId register ( Class < ? > clazz , Set < String > pathParams , List < RequestObjectResolver > objectResolvers ) { } } | final BeanFactoryId beanFactoryId = new BeanFactoryId ( clazz , pathParams ) ; if ( ! factories . containsKey ( beanFactoryId ) ) { final AnnotatedBeanFactory < Object > factory = createFactory ( beanFactoryId , objectResolvers ) ; if ( factory != null ) { factories . put ( beanFactoryId , factory ) ; logger . debug ( "Registered a bean factory: {}" , beanFactoryId ) ; } else { factories . put ( beanFactoryId , unsupportedBeanFactory ) ; } } return beanFactoryId ; |
public class DenyAssignmentsInner { /** * Gets deny assignments for a resource .
* @ 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 ; DenyAssignmentInner & gt ; object */
public Observable < Page < DenyAssignmentInner > > listForResourceNextAsync ( final String nextPageLink ) { } } | return listForResourceNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < DenyAssignmentInner > > , Page < DenyAssignmentInner > > ( ) { @ Override public Page < DenyAssignmentInner > call ( ServiceResponse < Page < DenyAssignmentInner > > response ) { return response . body ( ) ; } } ) ; |
public class ElemCopyOf { /** * The xsl : copy - of element can be used to insert a result tree
* fragment into the result tree , without first converting it to
* a string as xsl : value - of does ( see [ 7.6.1 Generating Text with
* xsl : value - of ] ) .
* @ param transformer non - null reference to the the current transform - time state .
* @ throws TransformerException */
public void execute ( TransformerImpl transformer ) throws TransformerException { } } | try { XPathContext xctxt = transformer . getXPathContext ( ) ; int sourceNode = xctxt . getCurrentNode ( ) ; XObject value = m_selectExpression . execute ( xctxt , sourceNode , this ) ; SerializationHandler handler = transformer . getSerializationHandler ( ) ; if ( null != value ) { int type = value . getType ( ) ; String s ; switch ( type ) { case XObject . CLASS_BOOLEAN : case XObject . CLASS_NUMBER : case XObject . CLASS_STRING : s = value . str ( ) ; handler . characters ( s . toCharArray ( ) , 0 , s . length ( ) ) ; break ; case XObject . CLASS_NODESET : // System . out . println ( value ) ;
DTMIterator nl = value . iter ( ) ; // Copy the tree .
DTMTreeWalker tw = new TreeWalker2Result ( transformer , handler ) ; int pos ; while ( DTM . NULL != ( pos = nl . nextNode ( ) ) ) { DTM dtm = xctxt . getDTMManager ( ) . getDTM ( pos ) ; short t = dtm . getNodeType ( pos ) ; // If we just copy the whole document , a startDoc and endDoc get
// generated , so we need to only walk the child nodes .
if ( t == DTM . DOCUMENT_NODE ) { for ( int child = dtm . getFirstChild ( pos ) ; child != DTM . NULL ; child = dtm . getNextSibling ( child ) ) { tw . traverse ( child ) ; } } else if ( t == DTM . ATTRIBUTE_NODE ) { SerializerUtils . addAttribute ( handler , pos ) ; } else { tw . traverse ( pos ) ; } } // nl . detach ( ) ;
break ; case XObject . CLASS_RTREEFRAG : SerializerUtils . outputResultTreeFragment ( handler , value , transformer . getXPathContext ( ) ) ; break ; default : s = value . str ( ) ; handler . characters ( s . toCharArray ( ) , 0 , s . length ( ) ) ; break ; } } // I don ' t think we want this . - sb
// if ( transformer . getDebug ( ) )
// transformer . getTraceManager ( ) . fireSelectedEvent ( sourceNode , this ,
// " endSelect " , m _ selectExpression , value ) ;
} catch ( org . xml . sax . SAXException se ) { throw new TransformerException ( se ) ; } |
public class Types { /** * Get a capture variable ' s lower bound , returning other types unchanged .
* @ param t a type */
public Type cvarLowerBound ( Type t ) { } } | if ( t . hasTag ( TYPEVAR ) && ( ( TypeVar ) t ) . isCaptured ( ) ) { return cvarLowerBound ( t . getLowerBound ( ) ) ; } else return t ; |
public class QueryBuilders { /** * A terms enum terms query for the provided field name . */
public static TermsEnumTermsQueryBuilder termsEnumTermsQuery ( String name , byte [ ] values , int cacheKey ) { } } | return new TermsEnumTermsQueryBuilder ( name , values , cacheKey ) ; |
public class CommandInterceptor { /** * Retrieves the next interceptor in the chain .
* Since 9.0 , it returns { @ code null } if the next interceptor does not extend { @ code CommandInterceptor } .
* @ return the next interceptor in the chain . */
public final CommandInterceptor getNext ( ) { } } | List < AsyncInterceptor > interceptors = interceptorChain . wired ( ) . getInterceptors ( ) ; int myIndex = interceptors . indexOf ( this ) ; if ( myIndex < interceptors . size ( ) - 1 ) { AsyncInterceptor asyncInterceptor = interceptors . get ( myIndex + 1 ) ; if ( asyncInterceptor instanceof CommandInterceptor ) return ( CommandInterceptor ) asyncInterceptor ; } return null ; |
public class PayloadSender { /** * Creates and sends payload Http - request asynchronously ( returns immediately )
* @ param payload */
private synchronized void sendPayloadRequest ( final PayloadData payload ) { } } | ApptentiveLog . v ( PAYLOADS , "Sending payload: %s" , payload ) ; // create request object
final HttpRequest payloadRequest = requestSender . createPayloadSendRequest ( payload , new HttpRequest . Listener < HttpRequest > ( ) { @ Override public void onFinish ( HttpRequest request ) { try { String json = StringUtils . isNullOrEmpty ( request . getResponseData ( ) ) ? "{}" : request . getResponseData ( ) ; final JSONObject responseData = new JSONObject ( json ) ; handleFinishSendingPayload ( payload , false , null , request . getResponseCode ( ) , responseData ) ; } catch ( Exception e ) { // TODO : Stop assuming the response is JSON . In fact , just send bytes back , and whatever part of the SDK needs it can try to convert it to the desired format .
ApptentiveLog . e ( PAYLOADS , e , "Exception while handling payload send response" ) ; logException ( e ) ; handleFinishSendingPayload ( payload , false , null , - 1 , null ) ; } } @ Override public void onCancel ( HttpRequest request ) { handleFinishSendingPayload ( payload , true , null , request . getResponseCode ( ) , null ) ; } @ Override public void onFail ( HttpRequest request , String reason ) { if ( request . isAuthenticationFailure ( ) ) { ApptentiveNotificationCenter . defaultCenter ( ) . postNotification ( NOTIFICATION_AUTHENTICATION_FAILED , NOTIFICATION_KEY_CONVERSATION_ID , payload . getConversationId ( ) , NOTIFICATION_KEY_AUTHENTICATION_FAILED_REASON , request . getAuthenticationFailedReason ( ) ) ; } handleFinishSendingPayload ( payload , false , reason , request . getResponseCode ( ) , null ) ; } } ) ; // set ' retry ' policy
payloadRequest . setRetryPolicy ( requestRetryPolicy ) ; payloadRequest . setCallbackQueue ( conversationQueue ( ) ) ; payloadRequest . start ( ) ; |
public class WSJobRepositoryImpl { /** * { @ inheritDoc } */
@ Override public List < WSStepThreadExecutionAggregate > getStepExecutionAggregatesFromJobExecution ( long jobExecutionId ) throws NoSuchJobExecutionException , JobSecurityException { } } | if ( authService != null ) { authService . authorizedExecutionRead ( jobExecutionId ) ; } return persistenceManagerService . getStepExecutionAggregatesFromJobExecutionId ( jobExecutionId ) ; |
public class NodeDiscovery { /** * Find any unknown nodes in the cassandra ring */
public Set < CassandraHost > discoverNodes ( ) { } } | Cluster cluster = HFactory . getCluster ( connectionManager . getClusterName ( ) ) ; if ( cluster == null ) { return null ; } Set < CassandraHost > existingHosts = connectionManager . getHosts ( ) ; Set < CassandraHost > foundHosts = new HashSet < CassandraHost > ( ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "using existing hosts {}" , existingHosts ) ; } try { for ( KeyspaceDefinition keyspaceDefinition : cluster . describeKeyspaces ( ) ) { if ( ! keyspaceDefinition . getName ( ) . equals ( Keyspace . KEYSPACE_SYSTEM ) ) { List < TokenRange > tokenRanges = cluster . describeRing ( keyspaceDefinition . getName ( ) ) ; for ( TokenRange tokenRange : tokenRanges ) { for ( EndpointDetails endPointDetail : tokenRange . getEndpoint_details ( ) ) { // Check if we are allowed to include this Data
// Center .
if ( dataCenterValidator == null || dataCenterValidator . validate ( endPointDetail . getDatacenter ( ) ) ) { // Maybe add this host if it ' s a new host .
CassandraHost foundHost = new CassandraHost ( endPointDetail . getHost ( ) , cassandraHostConfigurator . getPort ( ) ) ; if ( ! existingHosts . contains ( foundHost ) ) { log . info ( "Found a node we don't know about {} for TokenRange {}" , foundHost , tokenRange ) ; foundHosts . add ( foundHost ) ; } } } } break ; } } } catch ( Exception e ) { log . error ( "Discovery Service failed attempt to connect CassandraHost" , e ) ; } return foundHosts ; |
public class AbstractCompressor { /** * Inplace compression of INDArray
* @ param array */
@ Override public void compressi ( INDArray array ) { } } | // TODO : lift this restriction
if ( array . isView ( ) ) throw new UnsupportedOperationException ( "Impossible to apply inplace compression on View" ) ; array . setData ( compress ( array . data ( ) ) ) ; array . markAsCompressed ( true ) ; |
public class StringUtils { /** * Will find the longest suffix of the first sequence which is a prefix of the second .
* @ param first - first
* @ param second - second
* @ return - the longest overlap */
public static String findLongestOverlap ( String first , String second ) { } } | if ( org . apache . commons . lang3 . StringUtils . isEmpty ( first ) || org . apache . commons . lang3 . StringUtils . isEmpty ( second ) ) return "" ; int length = Math . min ( first . length ( ) , second . length ( ) ) ; for ( int i = 0 ; i < length ; i ++ ) { String zw = first . substring ( first . length ( ) - length + i ) ; if ( second . startsWith ( zw ) ) return zw ; } return "" ; |
public class MetaEndpoint { /** * currently failing as the decryption key is probably different */
@ Produces ( MediaType . TEXT_PLAIN ) @ GET public Response apiInfo ( @ Context Session session ) { } } | return Response . ok ( ) . entity ( VERSION ) . build ( ) ; |
public class ShrinkWrapFileSystem { /** * Merges the path context with a varargs String sub - contexts , returning the result
* @ param first
* @ param more
* @ return */
private String merge ( final String first , final String [ ] more ) { } } | assert first != null : "first must be specified" ; assert more != null : "more must be specified" ; final StringBuilder merged = new StringBuilder ( ) ; merged . append ( first ) ; for ( int i = 0 ; i < more . length ; i ++ ) { merged . append ( ArchivePath . SEPARATOR ) ; merged . append ( more [ i ] ) ; } return merged . toString ( ) ; |
public class CmsContentCheckResult { /** * Adds the testing results of a CmsContentCheckResource to the result lists . < p >
* @ param testResource the CmsContentCheckResource to add the results from */
public void addResult ( CmsContentCheckResource testResource ) { } } | List warnings = testResource . getWarnings ( ) ; List errors = testResource . getErrors ( ) ; // add the warnings if there were any
if ( ( warnings != null ) && ( warnings . size ( ) > 0 ) ) { m_warnings . put ( testResource . getResourceName ( ) , warnings ) ; m_warningResources . add ( testResource . getResource ( ) ) ; m_warningCheckResources . add ( testResource ) ; } // add the errors if there were any
if ( ( errors != null ) && ( errors . size ( ) > 0 ) ) { m_errors . put ( testResource . getResourceName ( ) , errors ) ; m_errorResources . add ( testResource . getResource ( ) ) ; m_errorCheckResources . add ( testResource ) ; } m_allResources . add ( testResource . getResource ( ) ) ; m_allCheckResources . add ( testResource ) ; |
public class SerializedFormWriterImpl { /** * Get the serialized form summaries header .
* @ return the serialized form summary header tree */
public Content getSerializedSummariesHeader ( ) { } } | HtmlTree ul = new HtmlTree ( HtmlTag . UL ) ; ul . addStyle ( HtmlStyle . blockList ) ; return ul ; |
public class StandardFieldsDialog { /** * Add a custom { @ code Component } to a tabbed { @ code StandardFieldsDialog } with the given label .
* @ param tabIndex tabIndex the index of the tab to which the { @ code Component } need to be added
* @ param componentLabel the { @ code I18N } key for the component label , should not be null
* @ param component the { @ code Component } to be added
* @ since TODO add version
* @ see # addCustomComponent ( Component )
* @ see # addCustomComponent ( int , Component )
* @ see # addCustomComponent ( String , Component ) */
public void addCustomComponent ( int tabIndex , String componentLabel , Component component ) { } } | validateTabbed ( tabIndex ) ; this . addField ( this . tabPanels . get ( tabIndex ) , this . tabOffsets . get ( tabIndex ) , componentLabel , component , component , 0.0D ) ; this . incTabOffset ( tabIndex ) ; |
public class DefaultNexusIQClient { /** * Get all the applications from the nexus IQ server
* @ param instanceUrl instance of nexus iq
* @ return List of applications */
@ Override public List < NexusIQApplication > getApplications ( String instanceUrl ) { } } | List < NexusIQApplication > nexusIQApplications = new ArrayList < > ( ) ; String url = instanceUrl + API_V2_APPLICATIONS ; try { JSONObject jsonObject = parseAsObject ( url ) ; JSONArray jsonArray = ( JSONArray ) jsonObject . get ( "applications" ) ; for ( Object obj : jsonArray ) { JSONObject applicationData = ( JSONObject ) obj ; NexusIQApplication application = new NexusIQApplication ( ) ; application . setInstanceUrl ( instanceUrl ) ; application . setApplicationId ( str ( applicationData , ID ) ) ; application . setApplicationName ( str ( applicationData , NAME ) ) ; application . setDescription ( application . getApplicationName ( ) ) ; application . setPublicId ( str ( applicationData , PUBLIC_ID ) ) ; nexusIQApplications . add ( application ) ; } } catch ( ParseException e ) { LOG . error ( "Could not parse response from: " + url , e ) ; } catch ( RestClientException rce ) { LOG . error ( rce ) ; } return nexusIQApplications ; |
public class Tr { /** * Register the provided class with the trace service and assign it to the
* provided group name .
* @ param aClass
* @ param group
* @ return TraceComponent */
public static TraceComponent register ( Class < ? > aClass , String group ) { } } | return register ( aClass , group , null ) ; |
public class CustomGlobalProcessorChainedWrapper { /** * ( non - Javadoc )
* @ see net . jawr . web . resource . bundle . global . preprocessor . GlobalPreprocessor #
* processBundles ( net . jawr . web . resource . bundle . global . preprocessor .
* GlobalPreprocessingContext , java . util . List ) */
@ Override public void processBundles ( T ctx , List < JoinableResourceBundle > bundles ) { } } | globalPreprocessor . processBundles ( ctx , bundles ) ; |
public class AT_CellContext { /** * Sets the character translator .
* It will also remove any other translator set .
* Nothing will happen if the argument is null .
* @ param charTranslator translator */
public void setCharTranslator ( CharacterTranslator charTranslator ) { } } | if ( charTranslator != null ) { this . charTranslator = charTranslator ; this . htmlElementTranslator = null ; this . targetTranslator = null ; } |
public class Serial { /** * < p > Reads a length bytes from the serial port / device into a provided OutputStream . < / p >
* @ param fd
* The file descriptor of the serial port / device .
* @ param length
* The number of bytes to get from the serial port / device .
* This number must not be higher than the number of available bytes .
* @ param stream
* The OutputStream object to write to . */
public synchronized static void read ( int fd , int length , OutputStream stream ) throws IOException { } } | stream . write ( read ( fd , length ) ) ; |
public class NoRethrowSecurityManager { /** * The following method is used to print out the code base or code source
* location . This would be the path / URL that a class is loaded from . This
* information is useful when trying to debug AccessControlExceptions
* because the AccessControlException stack trace does not include where the
* class was loaded from . Where a class is loaded from is very important
* because that is one of the essential items contributing to a policy in a
* policy file . */
public String [ ] getCodeBaseLoc ( Permission perm ) { } } | final Permission inPerm = perm ; return AccessController . doPrivileged ( new java . security . PrivilegedAction < String [ ] > ( ) { @ Override public String [ ] run ( ) { Class < ? > [ ] classes = getClassContext ( ) ; StringBuffer sb = new StringBuffer ( classes . length * 100 ) ; sb . append ( lineSep ) ; // one for offending class and the other for code base
// location
String [ ] retMsg = new String [ 2 ] ; for ( int i = 0 ; i < classes . length ; i ++ ) { Class < ? > clazz = classes [ i ] ; ProtectionDomain pd = clazz . getProtectionDomain ( ) ; // check for occurrence of checkPermission from stack
if ( classes [ i ] . getName ( ) . indexOf ( "com.ibm.ws.kernel.launch.internal.NoRethrowSecurityManager" ) != - 1 ) { // found SecurityManager , start to go through
// the stack starting next class
for ( int j = i + 1 ; j < classes . length ; j ++ ) { if ( classes [ j ] . getName ( ) . indexOf ( "java.lang.ClassLoader" ) != - 1 ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Not printing AccessError since ClassLoader.getResource returns null per JavaDoc when privileges not there." ) ; String [ ] codebaseloc = new String [ 2 ] ; codebaseloc [ 0 ] = "_nolog" ; codebaseloc [ 1 ] = "" ; return codebaseloc ; } ProtectionDomain pd2 = classes [ j ] . getProtectionDomain ( ) ; if ( isOffendingClass ( classes , j , pd2 , inPerm ) ) { retMsg [ 0 ] = lineSep + lineSep + " " + classes [ j ] . getName ( ) + " in " + "{" + getCodeSource ( pd2 ) + "}" + lineSep + lineSep ; break ; } } } java . security . CodeSource cs = pd . getCodeSource ( ) ; String csStr = getCodeSource ( pd ) ; // class name : location
sb . append ( classes [ i ] . getName ( ) ) . append ( " : " ) . append ( csStr + lineSep ) ; sb . append ( " " ) . append ( permissionToString ( cs , clazz . getClassLoader ( ) , pd . getPermissions ( ) ) ) . append ( lineSep ) ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Permission Error Code is " + retMsg [ 0 ] ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Code Base Location: is " + sb . toString ( ) ) ; retMsg [ 1 ] = "" ; return retMsg ; } } ) ; |
public class CPOptionPersistenceImpl { /** * Removes the cp option with the primary key from the database . Also notifies the appropriate model listeners .
* @ param primaryKey the primary key of the cp option
* @ return the cp option that was removed
* @ throws NoSuchCPOptionException if a cp option with the primary key could not be found */
@ Override public CPOption remove ( Serializable primaryKey ) throws NoSuchCPOptionException { } } | Session session = null ; try { session = openSession ( ) ; CPOption cpOption = ( CPOption ) session . get ( CPOptionImpl . class , primaryKey ) ; if ( cpOption == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuchCPOptionException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } return remove ( cpOption ) ; } catch ( NoSuchCPOptionException nsee ) { throw nsee ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; } |
public class JwtFatActions { /** * Accesses the protected resource and logs in successfully , ensuring that the expected cookie is included in the result . */
private Cookie logInAndObtainCookie ( String testName , WebClient webClient , String protectedUrl , String username , String password , String cookieName , Expectations expectations ) throws Exception { } } | Page response = invokeProtectedUrlAndValidateResponse ( testName , webClient , protectedUrl , expectations ) ; doFormLoginAndValidateResponse ( response , username , password , expectations ) ; Cookie cookie = webClient . getCookieManager ( ) . getCookie ( cookieName ) ; assertNotNull ( "Cookie [" + cookieName + "] was null but should not have been." , cookie ) ; return cookie ; |
public class JTable64 { /** * must be override , otherwise it will iterate over all columns */
public Rectangle getCellRect ( int row , int column , boolean includeSpacing ) { } } | Rectangle r = new Rectangle ( ) ; boolean valid = true ; if ( row < 0 ) { // y = height = 0;
valid = false ; } else if ( row >= getRowCount ( ) ) { r . y = getHeight ( ) ; valid = false ; } else { r . height = getRowHeight ( row ) ; // r . y = ( getRowModel ( ) = = null ) ? row * r . height :
// getRowModel ( ) . getPosition ( row ) ;
r . y = row * r . height ; } if ( column < 0 ) { if ( ! getComponentOrientation ( ) . isLeftToRight ( ) ) { r . x = getWidth ( ) ; } // otherwise , x = width = 0;
valid = false ; } else if ( column >= getColumnCount ( ) ) { if ( getComponentOrientation ( ) . isLeftToRight ( ) ) { r . x = getWidth ( ) ; } // otherwise , x = width = 0;
valid = false ; } else { TableColumnModel64 cm = getColumnModel64 ( ) ; if ( getComponentOrientation ( ) . isLeftToRight ( ) ) { for ( int i = 0 ; i < column ; i ++ ) { r . x += cm . getColumnWidth ( i ) ; } } else { for ( int i = cm . getColumnCount ( ) - 1 ; i > column ; i -- ) { r . x += cm . getColumnWidth ( i ) ; } } r . width = cm . getColumnWidth ( column ) ; } if ( valid && ! includeSpacing ) { // Bound the margins by their associated dimensions to prevent
// returning bounds with negative dimensions .
int rm = Math . min ( getRowMargin ( ) , r . height ) ; int cm = Math . min ( getColumnModel ( ) . getColumnMargin ( ) , r . width ) ; // This is not the same as grow ( ) , it rounds differently .
r . setBounds ( r . x + cm / 2 , r . y + rm / 2 , r . width - cm , r . height - rm ) ; } return r ; |
public class UniqueOnlyQueue { /** * Special method that removes head element .
* @ return */
public T removeFirst ( ) { } } | try { modifyLock . lock ( ) ; Iterator < T > it = iterator ( ) ; if ( it . hasNext ( ) ) { T item = it . next ( ) ; it . remove ( ) ; return item ; } } finally { modifyLock . unlock ( ) ; } return null ; |
public class DateTimeExtensions { /** * Converts the Calendar to a corresponding { @ link java . time . Month } . If the Calendar has a different
* time zone than the system default , the Month will be adjusted into the default time zone .
* @ param self a Calendar
* @ return a Month
* @ since 2.5.0 */
public static Month toMonth ( final Calendar self ) { } } | return Month . of ( self . get ( Calendar . MONTH ) + 1 ) ; |
public class BS { /** * Returns an < code > AddAction < / code > for build expression that would append
* the specified values to this binary set ; or if the attribute does not
* already exist , add the new attribute and the value ( s ) to the item .
* In general , DynamoDB recommends using SET rather than ADD . */
public AddAction append ( ByteBuffer ... values ) { } } | return new AddAction ( this , new LiteralOperand ( new LinkedHashSet < ByteBuffer > ( Arrays . asList ( values ) ) ) ) ; |
public class WorkQueueManager { /** * Dispatches requests to workrer threds , or notifies waiting thread .
* @ param req
* @ param ioe
* @ return boolean , true if request was dispatched */
protected boolean dispatch ( TCPBaseRequestContext req , IOException ioe ) { } } | if ( req . blockedThread ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "dispatcher notifying waiting synch request " ) ; } if ( ioe != null ) { req . blockingIOError = ioe ; } req . blockWait . simpleNotify ( ) ; return true ; } // dispatch the async work
return dispatchWorker ( new Worker ( req , ioe ) ) ; |
public class ConnectionUtils { /** * Returns the list of { @ link ConnectionData } associated to the provider ID of
* the specified profile
* @ param profile the profile that contains the connection data in its attributes
* @ param providerId the provider ID of the connection
* @ param encryptor the encryptor used to decrypt the accessToken , secret and refreshToken
* @ return the list of connection data for the provider , or empty if no connection data was found */
public static List < ConnectionData > getConnectionData ( Profile profile , String providerId , TextEncryptor encryptor ) throws CryptoException { } } | Map < String , List < Map < String , Object > > > allConnections = profile . getAttribute ( CONNECTIONS_ATTRIBUTE_NAME ) ; if ( MapUtils . isNotEmpty ( allConnections ) ) { List < Map < String , Object > > connectionsForProvider = allConnections . get ( providerId ) ; if ( CollectionUtils . isNotEmpty ( connectionsForProvider ) ) { List < ConnectionData > connectionDataList = new ArrayList < > ( connectionsForProvider . size ( ) ) ; for ( Map < String , Object > connectionDataMap : connectionsForProvider ) { connectionDataList . add ( mapToConnectionData ( providerId , connectionDataMap , encryptor ) ) ; } return connectionDataList ; } } return Collections . emptyList ( ) ; |
public class AbstractEXIBodyDecoder { /** * Handles and xsi : type attributes */
protected final void decodeAttributeXsiTypeStructure ( ) throws EXIException , IOException { } } | attributeQNameContext = getXsiTypeContext ( ) ; // handle AT prefix
handleAttributePrefix ( attributeQNameContext ) ; QNameContext qncType = null ; // read xsi : type content
if ( this . preserveLexicalValues ) { // assert ( preservePrefix ) ; / / Note : requirement
attributeValue = typeDecoder . readValue ( BuiltIn . getDefaultDatatype ( ) , getXsiTypeContext ( ) , channel , stringDecoder ) ; String sType = attributeValue . toString ( ) ; // extract prefix
String qncTypePrefix = QNameUtilities . getPrefixPart ( sType ) ; // URI
String qnameURI = getURI ( qncTypePrefix ) ; RuntimeUriContext uc = getUri ( qnameURI ) ; if ( uc != null ) { // local - name
String qnameLocalName = QNameUtilities . getLocalPart ( sType ) ; qncType = uc . getQNameContext ( qnameLocalName ) ; } } else { // typed
qncType = decodeQName ( channel ) ; String qncTypePrefix ; if ( preservePrefix ) { qncTypePrefix = decodeQNamePrefix ( getUri ( qncType . getNamespaceUriID ( ) ) , channel ) ; } else { checkDefaultPrefixNamespaceDeclaration ( qncType ) ; qncTypePrefix = qncType . getDefaultPrefix ( ) ; } attributeValue = new QNameValue ( qncType . getNamespaceUri ( ) , qncType . getLocalName ( ) , qncTypePrefix ) ; } // update grammar according to given xsi : type
if ( qncType != null && qncType . getTypeGrammar ( ) != null ) { // update current rule
updateCurrentRule ( qncType . getTypeGrammar ( ) ) ; } |
public class HttpServer { synchronized boolean removeMappings ( HttpContext context ) { } } | boolean existing = false ; if ( _virtualHostMap != null ) { Iterator i1 = _virtualHostMap . keySet ( ) . iterator ( ) ; while ( i1 . hasNext ( ) ) { String virtualHost = ( String ) i1 . next ( ) ; if ( removeMapping ( virtualHost , context ) ) existing = true ; } } return existing ; |
public class VCProjectHolder { /** * Find or create a container for parsed Visual C + + projects . If a container has already been created for the given
* { @ code inputFile } that container is returned ; otherwise a new container is created .
* @ param inputFile the file to parse , it can be a Visual Studio solution ( containing Visual C + + projects ) or a
* standalone Visual C + + project
* @ param isSolution { @ code true } if { @ code inputFile } is a solution , { @ code false } if it is a standalone project
* @ return the container for parsed Visual C + + projects */
public static VCProjectHolder getVCProjectHolder ( File inputFile , boolean isSolution ) { } } | VCProjectHolder vcProjectHolder = VCPROJECT_HOLDERS . get ( inputFile ) ; if ( vcProjectHolder == null ) { vcProjectHolder = new VCProjectHolder ( inputFile , isSolution , new HashMap < String , String > ( ) ) ; VCPROJECT_HOLDERS . put ( inputFile , vcProjectHolder ) ; } return vcProjectHolder ; |
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 333:1 : enumBodyDeclarations : ' ; ' ( classBodyDeclaration ) * ; */
public final void enumBodyDeclarations ( ) throws RecognitionException { } } | int enumBodyDeclarations_StartIndex = input . index ( ) ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 15 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 334:5 : ( ' ; ' ( classBodyDeclaration ) * )
// src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 334:7 : ' ; ' ( classBodyDeclaration ) *
{ match ( input , 52 , FOLLOW_52_in_enumBodyDeclarations521 ) ; if ( state . failed ) return ; // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 334:11 : ( classBodyDeclaration ) *
loop26 : while ( true ) { int alt26 = 2 ; int LA26_0 = input . LA ( 1 ) ; if ( ( LA26_0 == ENUM || LA26_0 == Identifier || ( LA26_0 >= 52 && LA26_0 <= 53 ) || LA26_0 == 58 || LA26_0 == 63 || LA26_0 == 65 || LA26_0 == 67 || ( LA26_0 >= 71 && LA26_0 <= 72 ) || LA26_0 == 77 || LA26_0 == 83 || LA26_0 == 85 || ( LA26_0 >= 92 && LA26_0 <= 94 ) || LA26_0 == 96 || ( LA26_0 >= 100 && LA26_0 <= 102 ) || ( LA26_0 >= 105 && LA26_0 <= 107 ) || LA26_0 == 110 || LA26_0 == 114 || ( LA26_0 >= 118 && LA26_0 <= 119 ) || LA26_0 == 121 ) ) { alt26 = 1 ; } switch ( alt26 ) { case 1 : // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 334:12 : classBodyDeclaration
{ pushFollow ( FOLLOW_classBodyDeclaration_in_enumBodyDeclarations524 ) ; classBodyDeclaration ( ) ; state . _fsp -- ; if ( state . failed ) return ; } break ; default : break loop26 ; } } } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { // do for sure before leaving
if ( state . backtracking > 0 ) { memoize ( input , 15 , enumBodyDeclarations_StartIndex ) ; } } |
public class OkRequest { /** * Write the map entry to url params
* @ param entry map entry
* @ return this request */
public OkRequest < T > param ( final Map . Entry < String , String > entry ) { } } | return param ( entry . getKey ( ) , entry . getValue ( ) ) ; |
public class nsrpcnode { /** * Use this API to update nsrpcnode . */
public static base_response update ( nitro_service client , nsrpcnode resource ) throws Exception { } } | nsrpcnode updateresource = new nsrpcnode ( ) ; updateresource . ipaddress = resource . ipaddress ; updateresource . password = resource . password ; updateresource . srcip = resource . srcip ; updateresource . secure = resource . secure ; return updateresource . update_resource ( client ) ; |
public class IterableExtensions { /** * Returns the concatenated string representation of the elements in the given iterable . The { @ code separator } is
* used to between each pair of entries in the input . The string < code > null < / code > is used for < code > null < / code >
* entries in the input .
* @ param iterable
* the iterable . May not be < code > null < / code > .
* @ param separator
* the separator . May not be < code > null < / code > .
* @ return the string representation of the iterable ' s elements . Never < code > null < / code > .
* @ see # join ( Iterable , CharSequence , org . eclipse . xtext . xbase . lib . Functions . Function1) */
public static String join ( Iterable < ? > iterable , CharSequence separator ) { } } | return IteratorExtensions . join ( iterable . iterator ( ) , separator ) ; |
public class JaxWsSoapContextHandler { /** * Adds a header to the list of SOAP request headers .
* @ param namespace the namespace the header belongs to
* @ param headerName the name of the header element
* @ param headerValue the value of the header element */
public void addHeader ( String namespace , String headerName , SOAPElement headerValue ) { } } | this . soapHeaders . add ( headerValue ) ; |
public class MutableTreeMap { /** * TODO : values ( ) , keySet ( ) with spliterator ( ) */
@ Override public V put ( final K key , final V value ) { } } | map . merge ( key , value , defaultMerger ) ; return previousValue ; |
public class MtasSpanPositionQuery { /** * ( non - Javadoc )
* @ see
* org . apache . lucene . search . spans . SpanQuery # createWeight ( org . apache . lucene .
* search . IndexSearcher , boolean ) */
@ Override public MtasSpanWeight createWeight ( IndexSearcher searcher , boolean needsScores , float boost ) throws IOException { } } | return new SpanAllWeight ( searcher , null , boost ) ; |
public class DefaultRetrofitBuilderFactory { /** * Creates a new builder instance with the provided base url . Initialized with a Jackson JSON converter using the
* provided object mapper .
* @ param baseUrl the base url
* @ param objectMapper the object mapper
* @ return a builder instance initialized for use with service classes */
public Retrofit . Builder create ( String baseUrl , ObjectMapper objectMapper ) { } } | return new Retrofit . Builder ( ) . baseUrl ( baseUrl ) . client ( _okHttpClient ) . addConverterFactory ( JacksonConverterFactory . create ( objectMapper ) ) ; |
public class AutofitHelper { /** * Set the minimum text size to a given unit and value . See TypedValue for the possible
* dimension units .
* @ param unit The desired dimension unit .
* @ param size The desired size in the given units .
* @ attr ref me . grantland . R . styleable # AutofitTextView _ minTextSize */
public AutofitHelper setMinTextSize ( int unit , float size ) { } } | Context context = mTextView . getContext ( ) ; Resources r = Resources . getSystem ( ) ; if ( context != null ) { r = context . getResources ( ) ; } setRawMinTextSize ( TypedValue . applyDimension ( unit , size , r . getDisplayMetrics ( ) ) ) ; return this ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.