signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ApplicationClassloadingServiceFactory { /** * This filter will cause the new application classloading service to block until these libraries are active
* Each library is added twice as it may be an automatic librari in which case
* its pid will not yet be known so we use the id . */
private String buil... | StringBuilder filter = new StringBuilder ( ) ; filter . append ( "(&" ) ; for ( String lib : privateLibraries ) filter . append ( String . format ( "(|(%s=%s)(%s=%s))" , LibraryStatusService . LIBRARY_IDS , lib , LibraryStatusService . LIBRARY_PIDS , lib ) ) ; filter . append ( ")" ) ; return filter . toString ( ) ; } ... |
public class SipServletMessageImpl { /** * ( non - Javadoc )
* @ see javax . servlet . sip . SipServletMessage # getHeader ( java . lang . String ) */
public String getHeader ( String name ) { } } | String nameToSearch = getCorrectHeaderName ( name ) ; String value = null ; if ( this . message . getHeader ( nameToSearch ) != null ) { value = ( ( SIPHeader ) this . message . getHeader ( nameToSearch ) ) . getValue ( ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "getHeader " + name + ", value=" + value... |
public class EJBMDOrchestrator { /** * F743-506 */
private static TimerMethodData . AutomaticTimer processScheduleAnnotation ( TimerMethodData timerMethod , Method method , List < TimerMethodData > timerMethods , Schedule annotation ) { } } | boolean persistent = annotation . persistent ( ) ; ScheduleExpression schedule = new ScheduleExpression ( ) . year ( annotation . year ( ) ) . month ( annotation . month ( ) ) . dayOfMonth ( annotation . dayOfMonth ( ) ) . dayOfWeek ( annotation . dayOfWeek ( ) ) . hour ( annotation . hour ( ) ) . minute ( annotation .... |
public class WorkspacesApi { /** * Get Workspace File
* Retrieves a workspace file ( the binary ) .
* @ param accountId The external account number ( int ) or account ID Guid . ( required )
* @ param workspaceId Specifies the workspace ID GUID . ( required )
* @ param folderId The ID of the folder being accesse... | Object localVarPostBody = "{}" ; // verify the required parameter ' accountId ' is set
if ( accountId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'accountId' when calling getWorkspaceFile" ) ; } // verify the required parameter ' workspaceId ' is set
if ( workspaceId == null ) { throw new... |
public class JBBPTextWriter { /** * Print float value .
* @ param value float value to be printed
* @ return the context
* @ throws IOException it will be thrown for transport errors
* @ since 1.4.0 */
public JBBPTextWriter Float ( final float value ) throws IOException { } } | ensureValueMode ( ) ; String convertedByExtras = null ; for ( final Extra e : this . extras ) { convertedByExtras = e . doConvertFloatToStr ( this , value ) ; if ( convertedByExtras != null ) { break ; } } if ( convertedByExtras == null ) { final float valueToWrite ; if ( this . byteOrder == JBBPByteOrder . LITTLE_ENDI... |
public class GraqlTraversal { /** * Because ' union ' accepts an array , we can ' t use generics */
@ SuppressWarnings ( "unchecked" ) public GraphTraversal < Vertex , Map < String , Element > > getGraphTraversal ( TransactionOLTP tx , Set < Variable > vars ) { } } | if ( fragments ( ) . size ( ) == 1 ) { // If there are no disjunctions , we don ' t need to union them and get a performance boost
ImmutableList < Fragment > list = Iterables . getOnlyElement ( fragments ( ) ) ; return getConjunctionTraversal ( tx , tx . getTinkerTraversal ( ) . V ( ) , vars , list ) ; } else { Travers... |
public class Event { /** * setter for eventId - sets
* @ generated
* @ param v value to set into the feature */
public void setEventId ( String v ) { } } | if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_eventId == null ) jcasType . jcas . throwFeatMissing ( "eventId" , "de.unihd.dbs.uima.types.heideltime.Event" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_eventId , v ) ; |
public class ImportSet { /** * Converts the set of imports to groups of class names , according to conventional package
* ordering and spacing . Within each group , sorting is alphabetical . */
public List < List < String > > toGroups ( ) { } } | List < String > list = Lists . newArrayList ( _imports ) ; Collections . sort ( list , new Comparator < String > ( ) { public int compare ( String class1 , String class2 ) { return ComparisonChain . start ( ) . compare ( findImportGroup ( class1 ) , findImportGroup ( class2 ) ) . compare ( class1 , class2 ) . result ( ... |
public class BodyCodegen { /** * Inline a FINALLY node into the method bytecode .
* This method takes a label that points to the real start of the finally
* block as implemented in the bytecode . This is because in some cases ,
* the finally block really starts before any of the code in the Node . For
* example... | Node fBlock = getFinallyAtTarget ( finallyTarget ) ; fBlock . resetTargets ( ) ; Node child = fBlock . getFirstChild ( ) ; exceptionManager . markInlineFinallyStart ( fBlock , finallyStart ) ; while ( child != null ) { generateStatement ( child ) ; child = child . getNext ( ) ; } exceptionManager . markInlineFinallyEnd... |
public class GetPipelineRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetPipelineRequest getPipelineRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getPipelineRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getPipelineRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( getPipelineRequest . getVersion ( ) , VERSION_BINDING ) ; } catch ( Exception e ) ... |
public class WDialog { /** * Set the WComponent which will handle the content for this dialog .
* @ param content the dialog content . */
public void setContent ( final WComponent content ) { } } | getOrCreateComponentModel ( ) . content = content ; // There should only be one content .
holder . removeAll ( ) ; holder . add ( content ) ; |
public class QueueStatisticsRegistry { /** * Update the statistics in the registry given one set of polled statistics . These statistics are assigned a
* timestamp equal to " now " .
* @ param updatedStats statistics with which to update the registry . */
public void onUpdatedStats ( ActiveMQQueueJmxStats updatedSt... | QueueStatisticsCollection queueStatisticsCollection ; synchronized ( this . queueStats ) { queueStatisticsCollection = this . queueStats . get ( updatedStats . getQueueName ( ) ) ; if ( queueStatisticsCollection == null ) { queueStatisticsCollection = new QueueStatisticsCollection ( updatedStats . getQueueName ( ) ) ; ... |
public class MembershipManager { /** * Returns whether member with given identity ( either { @ code UUID } or { @ code Address }
* depending on Hot Restart is enabled or not ) is a known missing member or not .
* @ param address Address of the missing member
* @ param uuid Uuid of the missing member
* @ return ... | Map < Object , MemberImpl > m = missingMembersRef . get ( ) ; return isHotRestartEnabled ( ) ? m . containsKey ( uuid ) : m . containsKey ( address ) ; |
public class JavolutionTranscoder { /** * { @ inheritDoc } */
@ Override public byte [ ] serializeAttributes ( final MemcachedBackupSession session , final ConcurrentMap < String , Object > attributes ) { } } | return doSerialize ( attributes , "attributes" ) ; |
public class GrailsClassUtils { /** * Return all interfaces that the given instance implements as array ,
* including ones implemented by superclasses .
* @ param instance the instance to analyze for interfaces
* @ return all interfaces that the given instance implements as array */
public static Class [ ] getAll... | Assert . notNull ( instance , "Instance must not be null" ) ; return getAllInterfacesForClass ( instance . getClass ( ) ) ; |
public class AccessControlSchemaProviderImpl { /** * Initializes this class . */
@ PostConstruct public void initialize ( ) { } } | if ( this . initialized ) { return ; } LOG . debug ( "Initializing." ) ; if ( this . accessControlSchemaMapper == null ) { this . accessControlSchemaMapper = new AccessControlSchemaXmlMapper ( ) ; } if ( this . accessControlSchema == null ) { this . accessControlSchema = new ClassPathResource ( "config/app/security/acc... |
public class Utils { /** * Appends a string into a file .
* @ param s the string to write ( not null )
* @ param outputFile the file to write into
* @ throws IOException if something went wrong */
public static void appendStringInto ( String s , File outputFile ) throws IOException { } } | OutputStreamWriter fw = null ; try { fw = new OutputStreamWriter ( new FileOutputStream ( outputFile , true ) , StandardCharsets . UTF_8 ) ; fw . append ( s ) ; } finally { Utils . closeQuietly ( fw ) ; } |
public class QueryLexer { /** * $ ANTLR start " NOT _ EQUAL " */
public final void mNOT_EQUAL ( ) throws RecognitionException { } } | try { int _type = NOT_EQUAL ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / riemann / Query . g : 10:11 : ( ' ! = ' )
// src / riemann / Query . g : 10:13 : ' ! = '
{ match ( "!=" ) ; } state . type = _type ; state . channel = _channel ; } finally { } |
public class ComputationGraph { /** * Return an array of network outputs ( predictions ) , given the specified network inputs
* Network outputs are for output layers only .
* @ param train If true : forward pass for training mode . False : test mode
* @ param input Input arrays to the netwonk
* @ param inputMas... | return output ( train , input , inputMasks , null ) ; |
public class DateFieldPivotValidator { /** * { @ inheritDoc } */
@ Override protected List < Serializable > getMessageArguments ( ) { } } | List < Serializable > args = super . getMessageArguments ( ) ; if ( variablePivot != null ) { args . add ( variablePivot . getDate ( ) ) ; } else if ( fixedPivot != null ) { args . add ( fixedPivot ) ; } return args ; |
public class QueryUpdateOnSubscribe { /** * Notify observer that sequence is complete .
* @ param subscriber
* @ param state */
private void complete ( Subscriber < ? super T > subscriber ) { } } | if ( ! subscriber . isUnsubscribed ( ) ) { debug ( "onCompleted" ) ; subscriber . onCompleted ( ) ; } else debug ( "unsubscribed" ) ; |
public class CacheManager { /** * Handle the load resource option .
* @ param option { @ link Option } the option to fetch the cli argument from */
protected void handleLoadResource ( Option option ) { } } | String resourceLocation = option . getValue ( ) ; reportable . output ( "Loading resource into the cache:" ) ; reportable . output ( " " + resourceLocation ) ; ResourceType type = ResourceType . fromLocation ( resourceLocation ) ; if ( type == null ) { reportable . error ( "Resource type cannot be determined, consult ... |
public class SQLiteDaoDefinition { /** * Build and register prepared statement name .
* @ param methodName
* the method name
* @ return the string */
String buildPreparedStatementName ( String methodName ) { } } | String name = methodName + "PreparedStatement" + preparedStatementNames . size ( ) ; preparedStatementNames . add ( name ) ; return name ; |
public class StreamEx { /** * Returns a stream consisting of elements of this stream where every series
* of elements matched the predicate is replaced with first element from the
* series .
* This is a < a href = " package - summary . html # StreamOps " > quasi - intermediate < / a >
* partial reduction operat... | return collapse ( collapsible , selectFirst ( ) ) ; |
public class ClientConnectionTimingsBuilder { /** * Sets the time when the client ended to wait for an existing connection attempt in order to use
* one connection for HTTP / 2.
* @ throws IllegalStateException if { @ link # pendingAcquisitionStart ( ) } is not invoked before calling this . */
public ClientConnecti... | checkState ( pendingAcquisitionStartTimeMicros >= 0 , "pendingAcquisitionStart() is not called yet." ) ; checkState ( ! pendingAcquisitionEndSet , "pendingAcquisitionEnd() is already called." ) ; pendingAcquisitionEndNanos = System . nanoTime ( ) ; pendingAcquisitionEndSet = true ; return this ; |
public class Matrix4x3f { /** * / * ( non - Javadoc )
* @ see org . joml . Matrix4x3fc # getColumn ( int , org . joml . Vector3f ) */
public Vector3f getColumn ( int column , Vector3f dest ) throws IndexOutOfBoundsException { } } | switch ( column ) { case 0 : dest . x = m00 ; dest . y = m01 ; dest . z = m02 ; break ; case 1 : dest . x = m10 ; dest . y = m11 ; dest . z = m12 ; break ; case 2 : dest . x = m20 ; dest . y = m21 ; dest . z = m22 ; break ; case 3 : dest . x = m30 ; dest . y = m31 ; dest . z = m32 ; break ; default : throw new IndexOut... |
public class WebSocketConnection { /** * Receive data from a client .
* @ param message */
public void receive ( WSMessage message ) { } } | log . trace ( "receive message" ) ; if ( isConnected ( ) ) { WebSocketPlugin plugin = ( WebSocketPlugin ) PluginRegistry . getPlugin ( "WebSocketPlugin" ) ; Optional < WebSocketScopeManager > optional = Optional . ofNullable ( ( WebSocketScopeManager ) session . getAttribute ( Constants . MANAGER ) ) ; WebSocketScopeMa... |
public class ManyQuery { /** * Execute the query synchronously
* @ return the result of the query . Remember to close me ! */
public CursorList < T > get ( ) { } } | final SQLiteDatabase db = Sprinkles . getDatabase ( ) ; final Cursor c = db . rawQuery ( rawQuery , null ) ; return new CursorList < T > ( c , resultClass ) ; |
public class ListUtility { /** * Concatenates a number of Collections into a single List
* @ param < T >
* @ param lists
* @ return */
public static < T > List < T > concat ( final Collection < ? extends T > ... lists ) { } } | ArrayList < T > al = new ArrayList < T > ( ) ; for ( Collection < ? extends T > list : lists ) if ( list != null ) al . addAll ( list ) ; return al ; |
public class DateUtil { /** * Gets a UTC < code > Date < / code > from a UTC ISO - 8601 < code > String < / code > .
* The string should be in one of the { @ link # ALLOWED _ DATE _ FORMATS } ,
* ideally { @ link # PREFERRED _ DATE _ FORMAT } ( e . g .
* < code > 2011-01-16T08:27:01.002Z < / code > ) .
* @ para... | if ( dateString == null ) return null ; SimpleDateFormat dateFormat = new SimpleDateFormat ( ) ; dateFormat . setTimeZone ( TimeZone . getTimeZone ( "UTC" ) ) ; for ( String format : ALLOWED_DATE_FORMATS ) { dateFormat . applyPattern ( format ) ; try { return dateFormat . parse ( dateString ) ; } catch ( ParseException... |
public class Path3f { /** * Remove the last action . */
public void removeLast ( ) { } } | if ( this . numTypes > 0 ) { switch ( this . types [ this . numTypes - 1 ] ) { case CLOSE : // no coord to remove
break ; case MOVE_TO : case LINE_TO : this . numCoords -= 3 ; break ; case CURVE_TO : this . numCoords -= 9 ; this . isPolyline = null ; break ; case QUAD_TO : this . numCoords -= 6 ; this . isPolyline = nu... |
public class RuntimeManagerRunner { /** * Handler to activate a topology */
private void activateTopologyHandler ( String topologyName ) throws TMasterException { } } | assert ! potentialStaleExecutionData ; NetworkUtils . TunnelConfig tunnelConfig = NetworkUtils . TunnelConfig . build ( config , NetworkUtils . HeronSystem . SCHEDULER ) ; TMasterUtils . transitionTopologyState ( topologyName , TMasterUtils . TMasterCommand . ACTIVATE , Runtime . schedulerStateManagerAdaptor ( runtime ... |
public class AbstractAppender { /** * Sends a commit message . */
protected void sendAppendRequest ( Connection connection , MemberState member , AppendRequest request ) { } } | long timestamp = System . nanoTime ( ) ; logger . trace ( "{} - Sending {} to {}" , context . getCluster ( ) . member ( ) . address ( ) , request , member . getMember ( ) . address ( ) ) ; connection . < AppendRequest , AppendResponse > sendAndReceive ( request ) . whenComplete ( ( response , error ) -> { context . che... |
public class AbstractScanPlanNode { /** * Related tickets : ENG - 9389 , ENG - 9533. */
private void initPreAggOutputSchema ( ) { } } | ProjectionPlanNode proj = ( ProjectionPlanNode ) getInlinePlanNode ( PlanNodeType . PROJECTION ) ; if ( proj != null ) { // Does this operation needs to change complex expressions
// into tuple value expressions with an column alias ?
// Is this always true for clone ? Or do we need a new method ?
m_outputSchema = proj... |
public class Call { /** * Executes a method on the target object which returns Set & lt ; R & gt ; , being < tt > R < / tt > the
* specified type parameter . Parameters must match those of the method .
* @ param resultType the type of the method ' s result
* @ param methodName the name of the method
* @ param o... | return new Call < Object , Set < R > > ( Types . setOf ( resultType ) , methodName , VarArgsUtil . asOptionalObjectArray ( Object . class , optionalParameters ) ) ; |
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 6099:1 : ruleJvmParameterizedTypeReference returns [ EObject current = null ] : ( ( ( ruleQualifiedName ) ) ( ( ( ' < ' ) = > otherlv _ 1 = ' < ' ) ( ( lv _ arguments _ 2_0 = ruleJvmArgumentTypeReference ) ) ( otherlv _ 3 = ' , ' ( ( lv _ arguments _ ... | EObject current = null ; Token otherlv_1 = null ; Token otherlv_3 = null ; Token otherlv_5 = null ; Token otherlv_7 = null ; Token otherlv_9 = null ; Token otherlv_11 = null ; Token otherlv_13 = null ; EObject lv_arguments_2_0 = null ; EObject lv_arguments_4_0 = null ; EObject lv_arguments_10_0 = null ; EObject lv_argu... |
public class AutomationAccountsInner { /** * Get information about an Automation Account .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return th... | return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , automationAccountName ) . map ( new Func1 < ServiceResponse < AutomationAccountInner > , AutomationAccountInner > ( ) { @ Override public AutomationAccountInner call ( ServiceResponse < AutomationAccountInner > response ) { return response . body (... |
public class LoggingDecorators { /** * Logs a stringified request of { @ link RequestLog } . */
public static void logRequest ( Logger logger , RequestLog log , LogLevel requestLogLevel , Function < ? super HttpHeaders , ? extends HttpHeaders > requestHeadersSanitizer , Function < Object , ? > requestContentSanitizer ,... | if ( requestLogLevel . isEnabled ( logger ) ) { requestLogLevel . log ( logger , REQUEST_FORMAT , log . toStringRequestOnly ( requestHeadersSanitizer , requestContentSanitizer , requestTrailersSanitizer ) ) ; } |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */
@ XmlElementDecl... | return new JAXBElement < Object > ( __GenericApplicationPropertyOfPlantCover_QNAME , Object . class , null , value ) ; |
public class PatternDSL { /** * - - Conditional Named Consequnce - - */
public static < A > ConditionalConsequenceBuilder when ( Variable < A > var , Predicate1 < A > predicate ) { } } | return when ( FlowDSL . expr ( var , predicate ) ) ; |
public class servicegroup_servicegroupentitymonbindings_binding { /** * Use this API to fetch filtered set of servicegroup _ servicegroupentitymonbindings _ binding resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static servicegroup_servicegroupentitymonbindi... | servicegroup_servicegroupentitymonbindings_binding obj = new servicegroup_servicegroupentitymonbindings_binding ( ) ; obj . set_servicegroupname ( servicegroupname ) ; options option = new options ( ) ; option . set_filter ( filter ) ; servicegroup_servicegroupentitymonbindings_binding [ ] response = ( servicegroup_ser... |
public class DBObjectBatch { /** * Serialize this DBObjectBatch object into a UNode tree and return the root node .
* @ return Root node of a UNode tree representing this batch update . */
public UNode toDoc ( ) { } } | // Root object is a MAP called " batch " .
UNode batchNode = UNode . createMapNode ( "batch" ) ; // Add a " docs " node as an array .
UNode docsNode = batchNode . addArrayNode ( "docs" ) ; for ( DBObject dbObj : m_dbObjList ) { docsNode . addChildNode ( dbObj . toDoc ( ) ) ; } return batchNode ; |
public class StoreSalesTransaction { /** * Gets the userIdentifiers value for this StoreSalesTransaction .
* @ return userIdentifiers * List of UserIdentifiers .
* < span class = " constraint Required " > This field is required
* and should not be { @ code null } . < / span > */
public com . google . api . ads . ... | return userIdentifiers ; |
public class ObjectByteOffsetImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . OBJECT_BYTE_OFFSET__DIR_BY_OFF : setDirByOff ( ( Integer ) newValue ) ; return ; case AfplibPackage . OBJECT_BYTE_OFFSET__DIR_BY_HI : setDirByHi ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class OpenSslSessionStats { /** * Returns the number of sessions that were removed because the maximum session cache size was exceeded . */
public long cacheFull ( ) { } } | Lock readerLock = context . ctxLock . readLock ( ) ; readerLock . lock ( ) ; try { return SSLContext . sessionCacheFull ( context . ctx ) ; } finally { readerLock . unlock ( ) ; } |
public class SVGIcon { /** * Method starts the rotate animation of the background icon color .
* If no animation was previously started than an default infinite animation is applied . */
public void startBackgroundIconRotateAnimation ( ) { } } | // init infinite animation of no animation was previously configured .
if ( backgroundRotateAnimation == null ) { startForegroundIconRotateAnimation ( 0d , 360d , Animation . INDEFINITE , JFXConstants . ANIMATION_DURATION_ROTATION_DEFAULT , Interpolator . LINEAR , false ) ; return ; } backgroundRotateAnimation . play (... |
public class MetricContext { /** * Inject the tags of this { @ link MetricContext } to the given { @ link GobblinTrackingEvent } */
private void injectTagsToEvent ( GobblinTrackingEvent event ) { } } | Map < String , String > originalMetadata = event . getMetadata ( ) ; Map < String , Object > tags = getTagMap ( ) ; Map < String , String > newMetadata = Maps . newHashMap ( ) ; for ( Map . Entry < String , Object > entry : tags . entrySet ( ) ) { newMetadata . put ( entry . getKey ( ) , entry . getValue ( ) . toString... |
public class ConfigureForm { /** * Sets the publishing model for the node , which determines who may publish to it .
* @ param publish The enum representing the possible options for the publishing model */
public void setPublishModel ( PublishModel publish ) { } } | addField ( ConfigureNodeFields . publish_model , FormField . Type . list_single ) ; setAnswer ( ConfigureNodeFields . publish_model . getFieldName ( ) , getListSingle ( publish . toString ( ) ) ) ; |
public class PacketSerializer { /** * Unserialize a packet from the given input stream */
public static AbstractPacket unserializeFrom ( RawDataBuffer in ) { } } | byte type = in . readByte ( ) ; AbstractPacket packet = PacketType . createInstance ( type ) ; packet . unserializeFrom ( in ) ; return packet ; |
public class L2 { /** * Gets the negated sum of squares times 1/2 \ lambda . */
@ Override public double getValue ( IntDoubleVector params ) { } } | double sum = params . dot ( params ) ; sum *= 1. / 2. * lambda ; return - sum ; |
public class ManifestVerifier { /** * This method checks the provided manifest files for :
* same number of manifest entries
* equal checksums per entry
* @ param filters List of names that if found in the manifests will be ignored .
* @ throws ManifestVerifyException if files differ in size or checksums */
pub... | if ( filters != null ) { this . filters = Arrays . asList ( filters ) ; logFilters ( ) ; } verify ( ) ; |
public class JSONArray { /** * Get the BigInteger value associated with an index .
* @ param index
* The index must be between 0 and length ( ) - 1.
* @ return The value .
* @ throws JSONException
* If the key is not found or if the value cannot be converted
* to a BigInteger . */
public BigInteger getBigIn... | Object object = this . get ( index ) ; BigInteger val = JSONObject . objectToBigInteger ( object , null ) ; if ( val == null ) { throw new JSONException ( "JSONArray[" + index + "] could not convert to BigDecimal (" + object + ")." ) ; } return val ; |
public class DateTimeParseContext { /** * Stores the parsed chronology .
* This stores the chronology that has been parsed .
* No validation is performed other than ensuring it is not null .
* The list of listeners is copied and cleared so that each
* listener is called only once . A listener can add itself aga... | Objects . requireNonNull ( chrono , "chrono" ) ; currentParsed ( ) . chrono = chrono ; if ( chronoListeners != null && ! chronoListeners . isEmpty ( ) ) { @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) Consumer < Chronology > [ ] tmp = new Consumer [ 1 ] ; Consumer < Chronology > [ ] listeners = chronoListeners . ... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link SphereType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link SphereType } { @ code > } */
@ XmlEle... | return new JAXBElement < SphereType > ( _Sphere_QNAME , SphereType . class , null , value ) ; |
public class HttpClientBuilder { /** * Builds the configured HttpClient .
* @ return HttpClient instance */
public HttpClient build ( ) { } } | HttpClient httpClient = new HttpClient ( ) ; if ( proxyHost != null ) { ProxyHost h ; if ( proxyPort == - 1 ) { h = new ProxyHost ( proxyHost ) ; } else { h = new ProxyHost ( proxyHost , proxyPort ) ; } httpClient . getHostConfiguration ( ) . setProxyHost ( h ) ; } if ( basicAuthUsername != null ) { httpClient . getPar... |
public class POSTrainer { /** * Load dataset dataset .
* @ return the dataset
* @ throws Exception the exception */
protected Dataset < Sequence > loadDataset ( ) throws Exception { } } | return Dataset . sequence ( ) . type ( DatasetType . InMemory ) . source ( Corpus . builder ( ) . source ( corpus ) . format ( corpusFormat ) . build ( ) . stream ( ) . filter ( d -> d . getAnnotationSet ( ) . isCompleted ( Types . PART_OF_SPEECH ) ) . flatMap ( d -> d . sentences ( ) . stream ( ) ) . map ( sentence ->... |
public class SQLiteDatabase { /** * Executes one of the methods in the " transactions " enum . This just allows the
* timeout code to be combined in one method .
* @ throws SQLException thrown if the timeout expires before the method successfully executes . */
public void execNoArgVoidMethod ( Transaction transacti... | long timeNow = System . currentTimeMillis ( ) ; long delta = 0 ; do { try { switch ( transaction ) { case setTransactionSuccessful : sqliteDatabase . setTransactionSuccessful ( ) ; return ; case beginTransaction : sqliteDatabase . beginTransaction ( ) ; return ; case endTransaction : sqliteDatabase . endTransaction ( )... |
public class ClientStatsContext { /** * Get the client affinity stats . Will only be populated if client affinity is enabled .
* @ return A map from an internal partition id to a { @ link ClientAffinityStats } instance . */
public Map < Integer , ClientAffinityStats > getAffinityStats ( ) { } } | Map < Integer , ClientAffinityStats > retval = new TreeMap < Integer , ClientAffinityStats > ( ) ; for ( Entry < Integer , ClientAffinityStats > e : m_currentAffinity . entrySet ( ) ) { if ( m_baselineAffinity . containsKey ( e . getKey ( ) ) ) { retval . put ( e . getKey ( ) , ClientAffinityStats . diff ( e . getValue... |
public class JSONValue { /** * check RFC4627 Json Syntax from input String
* @ return if the input is valid */
public static boolean isValidJsonStrict ( String s ) { } } | try { new JSONParser ( MODE_RFC4627 ) . parse ( s , FakeMapper . DEFAULT ) ; return true ; } catch ( ParseException e ) { return false ; } |
public class VictimsSqlDB { /** * Fetch record id ' s from the local database that is composed entirely of
* hashes in the set of hashes provided .
* @ param hashes
* @ return A set record ids
* @ throws SQLException */
protected HashSet < Integer > getEmbeddedRecords ( Set < String > hashes ) throws SQLExcepti... | HashSet < Integer > results = new HashSet < Integer > ( ) ; Connection connection = getConnection ( ) ; PreparedStatement ps = setObjects ( connection , Query . FILEHASH_EMBEDDED_MATCH , ( Object ) hashes . toArray ( ) ) ; try { ResultSet resultSet = ps . executeQuery ( ) ; while ( resultSet . next ( ) ) { results . ad... |
public class ApptentiveTaskManager { /** * region Payload Sending */
private void sendNextPayload ( ) { } } | singleThreadExecutor . execute ( new Runnable ( ) { @ Override public void run ( ) { try { sendNextPayloadSync ( ) ; } catch ( Exception e ) { ApptentiveLog . e ( e , "Exception while trying to send next payload" ) ; logException ( e ) ; } } } ) ; |
public class ZipFileSlice { /** * Recursively append the path in top down ancestral order .
* @ param buf
* the buf to append the path to */
private void appendPath ( final StringBuilder buf ) { } } | if ( parentZipFileSlice != null ) { parentZipFileSlice . appendPath ( buf ) ; if ( buf . length ( ) > 0 ) { buf . append ( "!/" ) ; } } buf . append ( pathWithinParentZipFileSlice ) ; |
public class ClassUtil { /** * Add all the fields of the specifed class ( and its ancestors ) to the list . Note , if we are
* running in a sandbox , this will only enumerate public members . */
public static void getFields ( Class < ? > clazz , List < Field > addTo ) { } } | // first get the fields of the superclass
Class < ? > pclazz = clazz . getSuperclass ( ) ; if ( pclazz != null && ! pclazz . equals ( Object . class ) ) { getFields ( pclazz , addTo ) ; } // then reflect on this class ' s declared fields
Field [ ] fields ; try { fields = clazz . getDeclaredFields ( ) ; } catch ( Securi... |
public class RandomUtil { /** * 随机获得列表中的一定量元素
* @ param < T > 元素类型
* @ param list 列表
* @ param count 随机取出的个数
* @ return 随机元素 */
public static < T > List < T > randomEles ( List < T > list , int count ) { } } | final List < T > result = new ArrayList < T > ( count ) ; int limit = list . size ( ) ; while ( result . size ( ) < count ) { result . add ( randomEle ( list , limit ) ) ; } return result ; |
public class String2PinyinConverter { /** * 将单个音节转为拼音
* @ param single
* @ return */
public static Pinyin convertSingle ( String single ) { } } | Pinyin pinyin = map . get ( single ) ; if ( pinyin == null ) return Pinyin . none5 ; return pinyin ; |
public class AsciiSet { /** * Returns a new set that will match characters iff they are included this set and not in the
* set that is provided . */
public AsciiSet diff ( AsciiSet set ) { } } | final boolean [ ] diffMembers = new boolean [ 128 ] ; for ( int i = 0 ; i < diffMembers . length ; ++ i ) { diffMembers [ i ] = members [ i ] && ! set . members [ i ] ; } return new AsciiSet ( diffMembers ) ; |
public class CriticalService { /** * Starts a critical call and automatically manages uncertain outcomes .
* @ param request - the request packet
* @ param process - a functor that processes an invocation / retransmission response . This functor ' s invoke method must
* < ol >
* < li > return null if the call i... | try { String message = process . invoke ( RemoteService . call ( location , endpoint , true , request ) ) ; if ( message != null ) { // clean failure
throw new RuntimeException ( message ) ; } } catch ( RuntimeException x ) { if ( confirm == null ) { executor . execute ( new VitalTask < Reporting , Void > ( reporting )... |
public class ProfileService { /** * Obtain the profile name associated with a profile ID
* @ param id ID of profile
* @ return Name of corresponding profile */
public String getNamefromId ( int id ) { } } | return ( String ) sqlService . getFromTable ( Constants . PROFILE_PROFILE_NAME , Constants . GENERIC_ID , id , Constants . DB_TABLE_PROFILE ) ; |
public class ImgUtil { /** * { @ link Image } 转 { @ link RenderedImage } < br >
* 首先尝试强转 , 否则新建一个 { @ link BufferedImage } 后重新绘制
* @ param img { @ link Image }
* @ return { @ link BufferedImage }
* @ since 4.3.2 */
public static RenderedImage toRenderedImage ( Image img ) { } } | if ( img instanceof RenderedImage ) { return ( RenderedImage ) img ; } return copyImage ( img , BufferedImage . TYPE_INT_RGB ) ; |
public class AbstractExpressionGenerator { /** * Compute the list of object that serve as the receiver for the given call .
* @ param call the feature call to analyze .
* @ param output the objects that constitute the call ' s receiver .
* @ param thisKeyword the " this " keyword .
* @ param referenceNameDefini... | if ( call . isStatic ( ) ) { if ( call instanceof XMemberFeatureCall ) { final XMemberFeatureCall memberFeatureCall = ( XMemberFeatureCall ) call ; if ( memberFeatureCall . isStaticWithDeclaringType ( ) ) { final XAbstractFeatureCall target = ( XAbstractFeatureCall ) memberFeatureCall . getMemberCallTarget ( ) ; final ... |
public class Sequence { /** * Allocate a block of sequence numbers , starting from the last allocated
* sequence value .
* @ param blockSize the number of sequences to allocate
* @ return allocated block of sequential numbers */
public SequenceGenerator . SequenceBlock allocateBlock ( int blockSize ) { } } | final long l = this . last ; SequenceGenerator . SequenceBlock block = new SequenceGenerator . SequenceBlock ( l + 1 , l + blockSize ) ; this . last = l + blockSize ; return block ; |
public class FixedIntHashMap { /** * Maps the specified key to the specified value .
* @ param key the key .
* @ param value the value .
* @ return the value of any previous mapping with the specified key or { @ code - 1 } if there was no such
* mapping . */
public T put ( final int key , final T value ) { } } | int index = ( ( key & 0x7FFFFFFF ) % elementKeys . length ) ; T oldvalue = null ; long entry = elementKeys [ index ] ; if ( entry == Integer . MIN_VALUE ) { ++ elementCount ; } else { oldvalue = elementValues [ index ] ; collisions ++ ; } elementKeys [ index ] = key ; elementValues [ index ] = value ; return oldvalue ; |
public class VectorClockUtils { /** * Given a set of versions , constructs a resolved list of versions based on
* the compare function above
* @ param values
* @ return list of values after resolution */
public static List < Versioned < byte [ ] > > resolveVersions ( List < Versioned < byte [ ] > > values ) { } } | List < Versioned < byte [ ] > > resolvedVersions = new ArrayList < Versioned < byte [ ] > > ( values . size ( ) ) ; // Go over all the values and determine whether the version is
// acceptable
for ( Versioned < byte [ ] > value : values ) { Iterator < Versioned < byte [ ] > > iter = resolvedVersions . iterator ( ) ; bo... |
public class UtilsUml { /** * < p > Evaluate 3 points of 2 lines < / p >
* @ param gp
* @ param relClrel
* @ return [ pointShared , pointEndLine1 , pointEndLine2] */
public static < CL extends ClassUml > Point2D [ ] evalTwoLinesForAngle ( SettingsGraphicUml gp , ClassRelationFull < CL > relClrel ) { } } | Point2D pointEnd2 = null ; if ( relClrel . getRelationship ( ) . getSharedJoint ( ) == null ) { // from this to across relClrel
RectangleRelationship < ClassFull < CL > , CL > nextRelationClass = relClrel . getRelationship ( ) . getShapeRelationshipStart ( ) == relClrel . getClassRelationship ( ) ? relClrel . getRelati... |
public class IoUtils { /** * Read the lines of a file into a list of strings , with each line represented
* as its own string .
* @ param filename
* @ return */
public static List < String > readLines ( String filename ) { } } | List < String > lines = Lists . newArrayList ( ) ; try { BufferedReader in = new BufferedReader ( new FileReader ( filename ) ) ; String line ; while ( ( line = in . readLine ( ) ) != null ) { // Ignore blank lines .
if ( line . trim ( ) . length ( ) > 0 ) { lines . add ( line ) ; } } in . close ( ) ; } catch ( IOExcep... |
public class UserClient { /** * Get a user ' s all black list
* @ param username The owner of the black list
* @ return UserList
* @ throws APIConnectionException connect exception
* @ throws APIRequestException request exception */
public UserInfoResult [ ] getBlackList ( String username ) throws APIConnection... | StringUtils . checkUsername ( username ) ; ResponseWrapper response = _httpClient . sendGet ( _baseUrl + userPath + "/" + username + "/blacklist" ) ; return _gson . fromJson ( response . responseContent , UserInfoResult [ ] . class ) ; |
public class Voice { /** * Additional codes for languages available for the specified voice in addition to its default language .
* For example , the default language for Aditi is Indian English ( en - IN ) because it was first used for that
* language . Since Aditi is bilingual and fluent in both Indian English an... | java . util . ArrayList < String > additionalLanguageCodesCopy = new java . util . ArrayList < String > ( additionalLanguageCodes . length ) ; for ( LanguageCode value : additionalLanguageCodes ) { additionalLanguageCodesCopy . add ( value . toString ( ) ) ; } if ( getAdditionalLanguageCodes ( ) == null ) { setAddition... |
public class TreeComparison { /** * Maps both sides of the comparison to the same type , for easier comparison and assertions . */
public < T > SameType < T > mapToSame ( Function < ? super E , ? extends T > mapExpected , Function < ? super A , ? extends T > mapActual ) { } } | return new SameTypeImp < > ( this , mapExpected , mapActual ) ; |
public class CloudWatchDimensionConfigurationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CloudWatchDimensionConfiguration cloudWatchDimensionConfiguration , ProtocolMarshaller protocolMarshaller ) { } } | if ( cloudWatchDimensionConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( cloudWatchDimensionConfiguration . getDimensionName ( ) , DIMENSIONNAME_BINDING ) ; protocolMarshaller . marshall ( cloudWatchDimensionConfiguration . g... |
public class V1InstanceGetter { /** * Get schedules filtered by the criteria specified in the passed in filter .
* @ param filter Limit the items returned . If null , then all items returned .
* @ return ICollection of items as specified in the filter . */
public Collection < Schedule > schedules ( ScheduleFilter f... | return get ( Schedule . class , ( filter != null ) ? filter : new ScheduleFilter ( ) ) ; |
public class WebUserDataPermission { /** * Build the request permission actions from the HTTP method component using HttpServletRequest . getMethod ( ) + the
* TransportType component of the action from HttpServletRequest . isSecure ( ) .
* @ param request
* - the servlet request
* @ return the permission actio... | String actions = request . getMethod ( ) + ( request . isSecure ( ) ? ":CONFIDENTIAL" : "" ) ; return actions ; |
public class OuterCeilingSurfaceType { /** * Gets the value of the genericApplicationPropertyOfOuterCeilingSurface 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 .
* Thi... | if ( _GenericApplicationPropertyOfOuterCeilingSurface == null ) { _GenericApplicationPropertyOfOuterCeilingSurface = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfOuterCeilingSurface ; |
public class ULocale { /** * < strong > [ icu ] < / strong > Given a keyword and a value , return a new locale with an updated
* keyword and value . If the keyword is null , this removes all keywords from the locale id .
* Otherwise , if the value is null , this removes the value for this keyword from the
* local... | return new ULocale ( setKeywordValue ( localeID , keyword , value ) , ( Locale ) null ) ; |
public class Resource { /** * Retrieve a flag value .
* @ param index flag index ( 1-20)
* @ return flag value */
public boolean getFlag ( int index ) { } } | return BooleanHelper . getBoolean ( ( Boolean ) getCachedValue ( selectField ( ResourceFieldLists . CUSTOM_FLAG , index ) ) ) ; |
public class SearchProductsAsAdminRequest { /** * The search filters . If no search filters are specified , the output includes all products to which the
* administrator has access .
* @ param filters
* The search filters . If no search filters are specified , the output includes all products to which the
* adm... | setFilters ( filters ) ; return this ; |
public class Reporter { /** * Records the performed step as a check to the output file . A screenshot will be taken for traceability and debugging purposes .
* This includes the action taken if any , the expected result , and the actual result .
* If a ' real ' browser is not being used ( not NONE or HTMLUNIT ) , t... | checks ++ ; recordStep ( action , expectedResult , actualResult , true , Success . CHECK ) ; |
public class SupplementaryMaterial { /** * Gets the value of the dispFormulaOrDispFormulaGroupOrChemStructWrap 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... | if ( dispFormulaOrDispFormulaGroupOrChemStructWrap == null ) { dispFormulaOrDispFormulaGroupOrChemStructWrap = new ArrayList < Object > ( ) ; } return this . dispFormulaOrDispFormulaGroupOrChemStructWrap ; |
public class Matrix4f { /** * Apply an orthographic projection transformation for a left - handed coordinate system to this matrix and store the result in < code > dest < / code > .
* This method is equivalent to calling { @ link # orthoLH ( float , float , float , float , float , float , Matrix4f ) orthoLH ( ) } wit... | if ( ( properties & PROPERTY_IDENTITY ) != 0 ) return dest . setOrtho2DLH ( left , right , bottom , top ) ; return ortho2DLHGeneric ( left , right , bottom , top , dest ) ; |
public class TreeAdapter { /** * Restores the state of the adapter from a previous state parcelable . Only effective when root adapter { @ link
* PowerAdapter # hasStableIds ( ) } */
public void restoreInstanceState ( @ Nullable Parcelable parcelable ) { } } | mState = parcelable instanceof TreeState ? ( TreeState ) parcelable : new TreeState ( ) ; rebuildAllEntriesAndRangeTable ( ) ; updateEntryAdapters ( ) ; |
public class JCudaDriver { /** * Creates a memcpy node and adds it to a graph . < br >
* < br >
* Creates a new memcpy node and adds it to \ p hGraph with \ p numDependencies
* dependencies specified via \ p dependencies .
* It is possible for \ p numDependencies to be 0 , in which case the node will be placed ... | return checkResult ( cuGraphAddMemcpyNodeNative ( phGraphNode , hGraph , dependencies , numDependencies , copyParams , ctx ) ) ; |
public class CSVDataEncoder { /** * Extrapolate the CSV columns from the row keys .
* @ param row A row .
* @ return A constructed CSV schema . */
public CsvSchema buildCsvSchema ( final Map < String , Object > row ) { } } | CsvSchema . Builder builder = CsvSchema . builder ( ) ; Set < String > fields = row . keySet ( ) ; for ( String field : fields ) { builder . addColumn ( field ) ; } return builder . build ( ) ; |
public class TSSyntax { /** * Creates a valid typescript import string given a type name ( e . g . " Fortune " ) and the module name ,
* which is usually the pegasus object ' s namespace .
* @ param typeName Name of the type to import ( e . g . " Fortune " )
* @ param moduleName That same type ' s namespace ( e .... | return new StringBuilder ( ) . append ( "import { " ) . append ( typeName ) . append ( " } from \"./" ) . append ( moduleName ) . append ( "." ) . append ( typeName ) . append ( "\";" ) . toString ( ) ; |
public class JettyBootstrap { /** * Starts the Jetty Server and join the calling thread .
* @ param join
* < code > true < / code > to block the calling thread until the server stops . < code > false < / code > otherwise
* @ return this instance
* @ throws JettyBootstrapException
* if an exception occurs duri... | LOG . info ( "Starting Server..." ) ; IJettyConfiguration iJettyConfiguration = getInitializedConfiguration ( ) ; initServer ( iJettyConfiguration ) ; try { server . start ( ) ; } catch ( Exception e ) { throw new JettyBootstrapException ( e ) ; } // display server addresses
if ( iJettyConfiguration . getJettyConnector... |
public class DefaultJerseyHandler { /** * { @ inheritDoc } */
@ Override public void handle ( final HttpServerRequest vertxRequest ) { } } | // Wait for the body for jersey to handle form / json / xml params
if ( shouldReadData ( vertxRequest ) ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "DefaultJerseyHandler - handle request and read body: " + vertxRequest . method ( ) + " " + vertxRequest . uri ( ) ) ; } final Buffer body = Buffer . buffer (... |
public class PDTXMLConverter { /** * Get the passed object as { @ link XMLGregorianCalendar } date ( without a
* time ) .
* @ param aBase
* The source object . May be < code > null < / code > .
* @ return < code > null < / code > if the parameter is < code > null < / code > . */
@ Nullable public static XMLGreg... | if ( aBase == null ) return null ; return s_aDTFactory . newXMLGregorianCalendarDate ( aBase . getYear ( ) , aBase . getMonth ( ) . getValue ( ) , aBase . getDayOfMonth ( ) , DatatypeConstants . FIELD_UNDEFINED ) ; |
public class SingularOps_DDRM { /** * Extracts the nullity of a matrix using a preexisting decomposition .
* @ see # singularThreshold ( SingularValueDecomposition _ F64)
* @ param svd A precomputed decomposition . Not modified .
* @ param threshold Tolerance used to determine of a singular value is singular .
... | int ret = 0 ; double w [ ] = svd . getSingularValues ( ) ; int N = svd . numberOfSingularValues ( ) ; int numCol = svd . numCols ( ) ; for ( int j = 0 ; j < N ; j ++ ) { if ( w [ j ] <= threshold ) ret ++ ; } return ret + numCol - N ; |
public class JpaProcessPersistenceContext { /** * With regards to locking , the method is not always called during a transaction , which means
* that including logic to lock the query will cause exceptions and is not feasible .
* However , this is not an issue : see the { @ link # getProcessInstancesWaitingForEvent... | Query processInstancesForEvent = getEntityManager ( ) . createNamedQuery ( "GetProcessInstanceIdByCorrelation" ) ; processInstancesForEvent . setParameter ( "ckey" , correlationKey . toExternalForm ( ) ) ; try { return ( Long ) processInstancesForEvent . getSingleResult ( ) ; } catch ( NonUniqueResultException e ) { re... |
public class WriterBasedGenerator { /** * This method called when the string content is already in
* a char buffer , and need not be copied for processing . */
private final void _writeString ( char [ ] text , int offset , int len ) throws IOException , JsonGenerationException { } } | if ( _maximumNonEscapedChar != 0 ) { _writeStringASCII ( text , offset , len , _maximumNonEscapedChar ) ; return ; } /* Let ' s just find longest spans of non - escapable
* content , and for each see if it makes sense
* to copy them , or write through */
len += offset ; // - > len marks the end from now on
final in... |
public class Mapper { /** * Creates a MappedClass and validates it .
* @ param c the Class to map
* @ return the MappedClass for the given Class */
public MappedClass addMappedClass ( final Class c ) { } } | MappedClass mappedClass = mappedClasses . get ( c . getName ( ) ) ; if ( mappedClass == null ) { mappedClass = new MappedClass ( c , this ) ; return addMappedClass ( mappedClass , true ) ; } return mappedClass ; |
public class ZooController { /** * 获取ZK prefix
* @ return */
@ NoAuth @ RequestMapping ( value = "/prefix" , method = RequestMethod . GET ) @ ResponseBody public ValueVo getPrefixUrl ( ) { } } | ValueVo confItemVo = new ValueVo ( ) ; confItemVo . setStatus ( Constants . OK ) ; confItemVo . setValue ( zooConfig . getZookeeperUrlPrefix ( ) ) ; return confItemVo ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.