signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CollectionUtils { /** * Samples with replacement from a collection
* @ param c
* The collection to be sampled from
* @ param n
* The number of samples to take
* @ return a new collection with the sample */
public static < E > Collection < E > sampleWithReplacement ( Collection < E > c , int n ) { } } | return sampleWithReplacement ( c , n , new Random ( ) ) ; |
public class VirtualNetworkRulesInner { /** * Creates or updates an existing virtual network rule .
* @ 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 virtualNetworkRuleName The name of the virtual network rule .
* @ param parameters The requested virtual Network Rule Resource state .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the VirtualNetworkRuleInner object if successful . */
public VirtualNetworkRuleInner beginCreateOrUpdate ( String resourceGroupName , String serverName , String virtualNetworkRuleName , VirtualNetworkRuleInner parameters ) { } } | return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , virtualNetworkRuleName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class Diff { /** * Override the < code > MatchTracker < / code > used to track
* successfully matched nodes .
* @ param delegate the MatchTracker instance to delegate handling to . */
public void overrideMatchTracker ( MatchTracker delegate ) { } } | this . matchTrackerDelegate = delegate ; if ( differenceEngine != null ) { differenceEngine . setMatchTracker ( delegate ) ; } |
public class DownloadManager { /** * region Messages */
@ Override public void onReceive ( Object message ) { } } | if ( message instanceof BindDownload ) { BindDownload requestDownload = ( BindDownload ) message ; bindDownload ( requestDownload . getFileReference ( ) , requestDownload . isAutostart ( ) , requestDownload . getCallback ( ) ) ; } else if ( message instanceof CancelDownload ) { CancelDownload cancelDownload = ( CancelDownload ) message ; cancelDownload ( cancelDownload . getFileId ( ) ) ; } else if ( message instanceof UnbindDownload ) { UnbindDownload unbindDownload = ( UnbindDownload ) message ; unbindDownload ( unbindDownload . getFileId ( ) , unbindDownload . isAutocancel ( ) , unbindDownload . getCallback ( ) ) ; } else if ( message instanceof StartDownload ) { StartDownload startDownload = ( StartDownload ) message ; startDownload ( startDownload . getFileReference ( ) ) ; } else if ( message instanceof OnDownloadProgress ) { OnDownloadProgress downloadProgress = ( OnDownloadProgress ) message ; onDownloadProgress ( downloadProgress . getFileId ( ) , downloadProgress . getProgress ( ) ) ; } else if ( message instanceof OnDownloaded ) { OnDownloaded onDownloaded = ( OnDownloaded ) message ; onDownloaded ( onDownloaded . getFileId ( ) , onDownloaded . getReference ( ) ) ; } else if ( message instanceof OnDownloadedError ) { OnDownloadedError error = ( OnDownloadedError ) message ; onDownloadError ( error . getFileId ( ) ) ; } else if ( message instanceof RequestState ) { RequestState requestState = ( RequestState ) message ; requestState ( requestState . getFileId ( ) , requestState . getCallback ( ) ) ; } else if ( message instanceof SubscribeToDownloads ) { subscribe ( ( ( SubscribeToDownloads ) message ) . getCallback ( ) ) ; } else if ( message instanceof UnsubscribeToDownloads ) { unsubscribe ( ( ( UnsubscribeToDownloads ) message ) . getCallback ( ) ) ; } else { super . onReceive ( message ) ; } |
public class Java8CompositeHandler { /** * Returns handler that delegates update execution to | h | function .
* Given function will be used only if executed statement is not detected
* as a query by withQueryDetection .
* @ param h the new update handler
* < pre >
* { @ code
* import acolyte . jdbc . UpdateResult ;
* import acolyte . jdbc . StatementHandler . Parameter ;
* import static acolyte . jdbc . AcolyteDSL . handleStatement ;
* handleStatement . withUpdateHandler1 ( ( String sql , List < Parameter > ps ) - > {
* if ( sql = = " INSERT INTO Country ( code , name ) VALUES ( ? , ? ) " ) {
* return 1 ; / / update count
* } else return 0;
* < / pre > */
public Java8CompositeHandler withUpdateHandler1 ( CountUpdateHandler h ) { } } | final UpdateHandler uh = new UpdateHandler ( ) { public UpdateResult apply ( String sql , List < Parameter > ps ) { return new UpdateResult ( h . apply ( sql , ps ) ) ; } } ; return withUpdateHandler ( uh ) ; |
public class ValidatorBuilderBigDecimal { /** * @ see # range ( Range )
* @ param min the minimum { @ link Collection # size ( ) size } allowed .
* @ param max the maximum { @ link Collection # size ( ) size } allowed .
* @ return this build instance for fluent API calls . */
public ValidatorBuilderBigDecimal < PARENT > range ( BigDecimal min , BigDecimal max ) { } } | return range ( new Range < > ( min , max ) ) ; |
public class ChainedSMTPClientFutureListener { /** * Set the DeliveryStatus and notify the { @ link SMTPClientFuture } if needed
* @ param session
* @ throws SMTPException */
@ SuppressWarnings ( "unchecked" ) protected void setDeliveryStatus ( SMTPClientSession session ) throws SMTPException { } } | SMTPClientFutureImpl < Collection < FutureResult < Iterator < DeliveryRecipientStatus > > > > future = ( SMTPClientFutureImpl < Collection < FutureResult < Iterator < DeliveryRecipientStatus > > > > ) session . getAttribute ( FUTURE_KEY ) ; List < DeliveryRecipientStatus > statusList = ( List < DeliveryRecipientStatus > ) session . getAttribute ( DELIVERY_STATUS_KEY ) ; List < FutureResult < Iterator < DeliveryRecipientStatus > > > resultList = ( ( List < FutureResult < Iterator < DeliveryRecipientStatus > > > ) session . getAttribute ( DELIVERY_RESULT_LIST_KEY ) ) ; Iterator < SMTPDeliveryEnvelope > transactions = ( ( Iterator < SMTPDeliveryEnvelope > ) session . getAttribute ( SMTP_TRANSACTIONS_KEY ) ) ; resultList . add ( new DeliveryResultImpl ( statusList ) ) ; if ( ! transactions . hasNext ( ) ) { future . setResult ( resultList ) ; next ( session , SMTPRequestImpl . quit ( ) ) ; } else { initSession ( session ) ; if ( session . getSupportedExtensions ( ) . contains ( PIPELINING_EXTENSION ) && ( ( SMTPDeliveryAgentConfig ) session . getConfig ( ) ) . getPipeliningMode ( ) != PipeliningMode . NO ) { pipelining ( session ) ; } else { String sender = ( ( SMTPDeliveryEnvelope ) session . getAttribute ( CURRENT_SMTP_TRANSACTION_KEY ) ) . getSender ( ) ; next ( session , SMTPRequestImpl . mail ( sender ) ) ; } } |
public class MessageMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Message message , ProtocolMarshaller protocolMarshaller ) { } } | if ( message == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( message . getMessageId ( ) , MESSAGEID_BINDING ) ; protocolMarshaller . marshall ( message . getPayload ( ) , PAYLOAD_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class DefaultDOManager { /** * Adds a minimal DC datastream if one isn ' t already present .
* If there is already a DC datastream , ensure one of the dc : identifier
* values is the PID of the object . */
private static void populateDC ( Context ctx , DigitalObject obj , DOWriter w , Date nowUTC ) throws IOException , ServerException { } } | logger . debug ( "Adding/Checking default DC datastream" ) ; Datastream dc = w . GetDatastream ( "DC" , null ) ; DCFields dcf ; XMLDatastreamProcessor dcxml = null ; if ( dc == null ) { dcxml = new XMLDatastreamProcessor ( "DC" ) ; dc = dcxml . getDatastream ( ) ; // dc . DSMDClass = DatastreamXMLMetadata . DESCRIPTIVE ;
dc . DatastreamID = "DC" ; dc . DSVersionID = "DC1.0" ; // dc . DSControlGrp = " X " ; set by XMLDatastreamProcessor instead
dc . DSCreateDT = nowUTC ; dc . DSLabel = "Dublin Core Record for this object" ; dc . DSMIME = "text/xml" ; dc . DSFormatURI = OAI_DC2_0 . uri ; dc . DSSize = 0 ; dc . DSState = "A" ; dc . DSVersionable = true ; dcf = new DCFields ( ) ; if ( obj . getLabel ( ) != null && ! obj . getLabel ( ) . isEmpty ( ) ) { dcf . titles ( ) . add ( new DCField ( obj . getLabel ( ) ) ) ; } w . addDatastream ( dc , dc . DSVersionable ) ; } else { dcxml = new XMLDatastreamProcessor ( dc ) ; // note : context may be required to get through authz as content
// could be filesystem file ( or URL )
dcf = new DCFields ( dc . getContentStream ( ctx ) ) ; } // set the value of the dc datastream according to what ' s in the
// DCFields object
// ensure one of the dc : identifiers is the pid
ByteArrayOutputStream bytes = new ByteArrayOutputStream ( 512 ) ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( bytes , Charset . forName ( "UTF-8" ) ) ) ; dcf . getAsXML ( obj . getPid ( ) , out ) ; out . close ( ) ; dcxml . setXMLContent ( bytes . toByteArray ( ) ) ; |
public class Supplier { /** * The predefined Supplier selects all values and does not perform any kind of data
* transformation . Input value types need to match the aggregations expected value
* type to make this Supplier work .
* @ param < KeyIn > the input key type
* @ param < ValueIn > the input value type
* @ param < ValueOut > the supplied value type
* @ return all values from the underlying data structure as stored */
public static < KeyIn , ValueIn , ValueOut > Supplier < KeyIn , ValueIn , ValueOut > all ( ) { } } | return new AcceptAllSupplier ( null ) ; |
public class FileLogOutput { /** * Reserve space in the log file .
* We don ' t have to account for sector bytes because those were reserved at startup .
* @ param reservedDelta the change to the number of reserved bytes if this write is successful .
* @ throws ObjectManagerException */
protected void reserve ( long reservedDelta ) throws ObjectManagerException { } } | if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "reserve" , new Object [ ] { new Long ( reservedDelta ) } ) ; long unavailable = reserveLogFileSpace ( reservedDelta ) ; if ( unavailable != 0 ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "reserve" , new Object [ ] { "via LogFileFullException" , new Long ( unavailable ) , new Long ( reservedDelta ) } ) ; throw new LogFileFullException ( this , reservedDelta , reservedDelta , reservedDelta - unavailable ) ; } // if ( unavailable ! = 0 ) .
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "reserve" ) ; |
public class Sneaky { /** * Wrap a { @ link CheckedToIntFunction } in a { @ link ToIntFunction } .
* Example :
* < code > < pre >
* map . computeIfAbsent ( " key " , Unchecked . toIntFunction ( k - > {
* if ( k . length ( ) > 10)
* throw new Exception ( " Only short strings allowed " ) ;
* return 42;
* < / pre > < / code > */
public static < T > ToIntFunction < T > toIntFunction ( CheckedToIntFunction < T > function ) { } } | return Unchecked . toIntFunction ( function , Unchecked . RETHROW_ALL ) ; |
public class EndpointBuilder { /** * { @ inheritDoc } */
@ Override public Endpoint buildObject ( ) { } } | return new EndpointImpl ( Endpoint . DEFAULT_ELEMENT_NAME . getNamespaceURI ( ) , Endpoint . DEFAULT_ELEMENT_LOCAL_NAME , Endpoint . DEFAULT_ELEMENT_NAME . getPrefix ( ) ) ; |
public class DefaultPlaceholderConnector { /** * 是否包含占位符
* @ param format 格式化
* @ return 是否包含 */
private boolean isContainsPlaceholder ( final String format ) { } } | if ( StringUtil . isEmpty ( format ) ) { return false ; } return format . contains ( PlaceholderConstant . PLACEHOLDER ) ; |
public class HolderRapiFields { /** * < p > Get thing for given class and thing name . < / p >
* @ param pClass a Class
* @ param pFieldName Thing Name
* @ return a thing */
@ Override public final Field getFor ( final Class < ? > pClass , final String pFieldName ) { } } | Map < String , Field > fldMap = this . rapiFieldsMap . get ( pClass ) ; if ( fldMap == null ) { // There is no way to get from Map partially initialized bean
// in this double - checked locking implementation
// cause putting to the Map fully initialized bean
synchronized ( this . rapiFieldsMap ) { fldMap = this . rapiFieldsMap . get ( pClass ) ; if ( fldMap == null ) { fldMap = new HashMap < String , Field > ( ) ; Field [ ] fields = getUtlReflection ( ) . retrieveFields ( pClass ) ; for ( Field field : fields ) { fldMap . put ( field . getName ( ) , field ) ; } this . rapiFieldsMap . put ( pClass , fldMap ) ; } } } return fldMap . get ( pFieldName ) ; |
public class ModbusClient { /** * 子设备 */
public DeviceResponse createDevice ( CreateDevice request ) { } } | InternalRequest internalRequest = createRequest ( request , HttpMethodName . POST , DEVICE ) ; return this . invokeHttpClient ( internalRequest , DeviceResponse . class ) ; |
public class EvaluationErrorPrinter { /** * Auxiliary method to print tag errors
* @ param filteredDoc
* the document tokens which were tagged wrong
* @ param filteredRefs
* the reference tags
* @ param filteredPreds
* the predicted tags */
private void printErrors ( final List < String > filteredDoc , final List < String > filteredRefs , final List < String > filteredPreds ) { } } | this . printStream . println ( "Errors: {" ) ; this . printStream . println ( "Tok: Ref | Pred" ) ; this . printStream . println ( "---------------" ) ; for ( int i = 0 ; i < filteredDoc . size ( ) ; i ++ ) { this . printStream . println ( filteredDoc . get ( i ) + ": " + filteredRefs . get ( i ) + " | " + filteredPreds . get ( i ) ) ; } this . printStream . println ( "}\n" ) ; |
public class ReflectUtil { /** * 按照方法名查找指定方法名的方法 , 只返回匹配到的第一个方法 , 如果找不到对应的方法则返回 < code > null < / code >
* 此方法只检查方法名是否一致 , 并不检查参数的一致性 。
* @ param clazz 类 , 如果为 { @ code null } 返回 { @ code null }
* @ param ignoreCase 是否忽略大小写
* @ param methodName 方法名 , 如果为空字符串返回 { @ code null }
* @ return 方法
* @ throws SecurityException 无权访问抛出异常
* @ since 4.3.2 */
public static Method getMethodByName ( Class < ? > clazz , boolean ignoreCase , String methodName ) throws SecurityException { } } | if ( null == clazz || StrUtil . isBlank ( methodName ) ) { return null ; } final Method [ ] methods = getMethods ( clazz ) ; if ( ArrayUtil . isNotEmpty ( methods ) ) { for ( Method method : methods ) { if ( StrUtil . equals ( methodName , method . getName ( ) , ignoreCase ) ) { return method ; } } } return null ; |
public class SSLReadServiceContext { /** * Handle common activity of read and readAsynch involving the decryption of the
* current buffers . The caller will have the responsibility of informing the app
* side channels once complete .
* @ param async if called from an async read ( true ) or sync read ( false )
* @ return null if the decryption was successful , the resulting exception otherwise */
protected Exception decryptMessage ( boolean async ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "decryptMessage" ) ; } Exception exception = null ; // Storage for the result of calling the SSL engine
SSLEngineResult result = null ; // Status of the SSL engine .
Status status = null ; // Access output buffer to give to SSL engine . Attempt to use buffers from app channel .
getDecryptedNetworkBuffers ( ) ; final int packetSize = getConnLink ( ) . getPacketBufferSize ( ) ; final int appBufferSize = getConnLink ( ) . getAppBufferSize ( ) ; try { while ( true ) { // JSSE ( as of JDK 6 11/2010 ) requires at least the packet - size
// of available space in the output buffers or it blindly returns
// the BUFFER _ OVERFLOW result
if ( appBufferSize > availableDecryptionSpace ( ) ) { expandDecryptedNetBuffer ( ) ; } // Protect JSSE from potential SSL packet sizes that are too big .
int savedLimit = SSLUtils . adjustBufferForJSSE ( netBuffer , packetSize ) ; // These limits will be reset only if the result of the unwrap is
// " OK " . Otherwise , they will not be changed . Try to reuse this array .
if ( ( decryptedNetLimitInfo == null ) || ( decryptedNetLimitInfo . length != decryptedNetBuffers . length ) ) { decryptedNetLimitInfo = new int [ decryptedNetBuffers . length ] ; } SSLUtils . getBufferLimits ( decryptedNetBuffers , decryptedNetLimitInfo ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "before unwrap:\r\n\tnetBuf: " + SSLUtils . getBufferTraceInfo ( netBuffer ) + "\r\n\tdecNetBuffers: " + SSLUtils . getBufferTraceInfo ( decryptedNetBuffers ) ) ; } // Call the SSL engine to decrypt the request .
result = getConnLink ( ) . getSSLEngine ( ) . unwrap ( this . netBuffer . getWrappedByteBuffer ( ) , SSLUtils . getWrappedByteBuffers ( decryptedNetBuffers ) ) ; if ( 0 < result . bytesProduced ( ) ) { SSLUtils . flipBuffers ( decryptedNetBuffers , result . bytesProduced ( ) ) ; } status = result . getStatus ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "after unwrap:\r\n\tnetBuf: " + SSLUtils . getBufferTraceInfo ( netBuffer ) + "\r\n\tdecNetBuffers: " + SSLUtils . getBufferTraceInfo ( decryptedNetBuffers ) + "\r\n\tstatus=" + status + " HSstatus=" + result . getHandshakeStatus ( ) + " consumed=" + result . bytesConsumed ( ) + " produced=" + result . bytesProduced ( ) ) ; } // If a limit modification was saved , restore it .
if ( - 1 != savedLimit ) { this . netBuffer . limit ( savedLimit ) ; } // Record the number of bytes produced .
bytesProduced += result . bytesProduced ( ) ; // check CLOSED status first , recent JDKs are showing the status = CLOSED
// and hsstatus = NEED _ WRAP when receiving the connection closed message
// from the other end . Our call to flushCloseDown ( ) later will handle
// the write of our own 23 bytes of connection closure
if ( status == Status . CLOSED ) { exception = sessionClosedException ; break ; } // Handle the SSL engine result
// Note : check handshake status first as renegotations could be requested
// at any point and the Status is secondary to the handshake status
if ( ( result . getHandshakeStatus ( ) == HandshakeStatus . NEED_TASK ) || ( result . getHandshakeStatus ( ) == HandshakeStatus . NEED_WRAP ) || ( result . getHandshakeStatus ( ) == HandshakeStatus . NEED_UNWRAP ) ) { try { result = doHandshake ( async ) ; } catch ( IOException e ) { // no FFDC required
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caught exception during SSL handshake, " + e ) ; } exception = e ; break ; } // Check to see if handshake was done synchronously .
if ( result != null ) { // Handshake was done synchronously . Verify results .
status = result . getStatus ( ) ; if ( result . getHandshakeStatus ( ) == HandshakeStatus . FINISHED ) { // Handshake finished . Need to read more per original request .
exception = readNeededInternalException ; // No error here . Just inform caller .
break ; } else if ( status == Status . OK ) { // Handshake complete and initial request already read and decrypted .
prepareDataForNextChannel ( ) ; break ; } else { // Unknown result from handshake . All other results should have thrown exceptions .
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unhandled result from SSL engine: " + status ) ; } exception = new SSLException ( "Unhandled result from SSL engine: " + status ) ; break ; } } // Handshake is being handled asynchronously .
break ; } else if ( status == Status . OK ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "OK result from the SSL engine," + " callerReqAlloc=" + getJITAllocateAction ( ) + " decNetBuffRelReq=" + decryptedNetBufferReleaseRequired ) ; } if ( bytesRequested > bytesProduced ) { // More data needs to be decrypted .
// 431992 - only change pos / lim if something was produced
if ( 0 < result . bytesProduced ( ) ) { // Prepare the output buffer , preventing overwrites and
// opening up space closed by JSSE .
SSLUtils . positionToLimit ( decryptedNetBuffers ) ; // Reset the limits saved for the decryptedNetBuffers .
SSLUtils . setBufferLimits ( decryptedNetBuffers , decryptedNetLimitInfo ) ; } // Check if all the data has been read from the netBuffers .
if ( this . netBuffer . remaining ( ) == 0 ) { // No more data available . More must be read . Reused
// exception instance ( save new object ) .
exception = readNeededInternalException ; break ; } // More data is available . Loop around and decrypt again .
continue ; } // Data has been decrypted .
break ; } else if ( status == Status . BUFFER_OVERFLOW ) { // The output buffers provided to the SSL engine were not big
// enough . A bigger buffer must be supplied . If we can build
// a bigger buffer and call again , build it . Prepare the output
// buffer , preventing overwrites and opening up space closed by JSSE .
expandDecryptedNetBuffer ( ) ; // Try again with the bigger buffer array .
continue ; } else if ( status == Status . BUFFER_UNDERFLOW ) { // The engine was not able to unwrap the incoming data because there were not
// source bytes available to make a complete packet .
// More data needs to be read into the input buffer . Alert
// calling method to keep reading .
exception = readNeededInternalException ; // No error here . Just inform caller .
break ; } else { exception = new SSLException ( "Unknown result from ssl engine not handled yet: " + status ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unknown result from ssl engine not handled yet: " + status ) ; } break ; } } // end while
} catch ( SSLException ssle ) { // no FFDC required
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caught exception during decryption, " + ssle ) ; } exception = ssle ; cleanupDecBuffers ( ) ; } catch ( Exception up ) { synchronized ( closeSync ) { // if close has been called then assume this exception was due to a race condition
// with the close logic and consume the exception without FFDC . Otherwise rethrow
// as the logic did before this change .
if ( ! closeCalled ) { throw up ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "decryptMessage: " + exception ) ; } return exception ; |
public class Event { /** * indexed setter for themes _ event - sets an indexed value -
* @ generated
* @ param i index in the array to set
* @ param v value to set into the array */
public void setThemes_event ( int i , Event v ) { } } | if ( Event_Type . featOkTst && ( ( Event_Type ) jcasType ) . casFeat_themes_event == null ) jcasType . jcas . throwFeatMissing ( "themes_event" , "ch.epfl.bbp.uima.genia.Event" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_event ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Event_Type ) jcasType ) . casFeatCode_themes_event ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ; |
public class Node { /** * Get the subscriptions currently associated with this node .
* { @ code additionalExtensions } can be used e . g . to add a " Result Set Management " extension .
* { @ code returnedExtensions } will be filled with the stanza extensions found in the answer .
* @ param additionalExtensions
* @ param returnedExtensions a collection that will be filled with the returned packet
* extensions
* @ return List of { @ link Subscription }
* @ throws NoResponseException
* @ throws XMPPErrorException
* @ throws NotConnectedException
* @ throws InterruptedException */
public List < Subscription > getSubscriptions ( List < ExtensionElement > additionalExtensions , Collection < ExtensionElement > returnedExtensions ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } } | return getSubscriptions ( SubscriptionsNamespace . basic , additionalExtensions , returnedExtensions ) ; |
public class Directory { /** * Sets a < code > java . util . Date < / code > value for the specified tag .
* @ param tagType the tag ' s value as an int
* @ param value the value for the specified tag as a java . util . Date */
public void setDate ( int tagType , @ NotNull java . util . Date value ) { } } | setObject ( tagType , value ) ; |
public class JobStreamsInner { /** * Retrieve the job stream identified by job stream id .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param jobId The job id .
* @ param jobStreamId The job stream id .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws ErrorResponseException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the JobStreamInner object if successful . */
public JobStreamInner get ( String resourceGroupName , String automationAccountName , String jobId , String jobStreamId ) { } } | return getWithServiceResponseAsync ( resourceGroupName , automationAccountName , jobId , jobStreamId ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class SocialAuthenticationFilter { /** * The URL to redirect to if authentication fails or if authorization is denied by the user .
* @ param postFailureUrl The failure URL . Defaults to " / signin " ( relative to the servlet context ) . */
public void setPostFailureUrl ( String postFailureUrl ) { } } | AuthenticationFailureHandler failureHandler = getFailureHandler ( ) ; if ( failureHandler instanceof SocialAuthenticationFailureHandler ) { failureHandler = ( ( SocialAuthenticationFailureHandler ) failureHandler ) . getDelegate ( ) ; } if ( failureHandler instanceof SimpleUrlAuthenticationFailureHandler ) { SimpleUrlAuthenticationFailureHandler h = ( SimpleUrlAuthenticationFailureHandler ) failureHandler ; h . setDefaultFailureUrl ( postFailureUrl ) ; } else { throw new IllegalStateException ( "can't set postFailureUrl on unknown failureHandler, type is " + failureHandler . getClass ( ) . getName ( ) ) ; } |
public class AbstractSingleGateway { /** * 调用命令
* @ param request
* @ param response
* @ return */
@ RequestMapping ( value = "/invoke" , method = { } } | RequestMethod . POST } ) @ ResponseBody public ResponseMessage invoke ( HttpServletRequest request , HttpServletResponse response ) { ResponseMessage res = new ResponseMessage ( ) ; try { JSONObject json = tgtools . web . util . RequestHelper . parseRequest ( request ) ; ValidMessage rm = ( ValidMessage ) tgtools . util . JsonParseHelper . parseToObject ( json , ValidMessage . class ) ; mUserService . tokenLogin ( request . getRemoteAddr ( ) , rm . getUser ( ) , rm . getToken ( ) ) ; Object obj = restCommand . process ( rm . getOperation ( ) , rm . getData ( ) ) ; res . setStatus ( true ) ; res . setData ( obj ) ; } catch ( Exception e ) { res . setStatus ( false ) ; res . setData ( e . getMessage ( ) ) ; } try { System . out . println ( "client结果:" + tgtools . util . JsonParseHelper . parseToJsonObject ( res ) . toString ( ) ) ; } catch ( Exception d ) { } return res ; |
public class PrimaveraReader { /** * Process resources .
* @ param rows resource data */
public void processResources ( List < Row > rows ) { } } | for ( Row row : rows ) { Resource resource = m_project . addResource ( ) ; processFields ( m_resourceFields , row , resource ) ; resource . setResourceCalendar ( getResourceCalendar ( row . getInteger ( "clndr_id" ) ) ) ; // Even though we ' re not filling in a rate , filling in a time unit can still be useful
// so that we know what rate time unit was originally used in Primavera .
TimeUnit timeUnit = TIME_UNIT_MAP . get ( row . getString ( "cost_qty_type" ) ) ; resource . setStandardRateUnits ( timeUnit ) ; resource . setOvertimeRateUnits ( timeUnit ) ; // Add User Defined Fields
populateUserDefinedFieldValues ( "RSRC" , FieldTypeClass . RESOURCE , resource , resource . getUniqueID ( ) ) ; m_eventManager . fireResourceReadEvent ( resource ) ; } |
public class SecurityAccessControl { /** * / * ( non - Javadoc )
* @ see nyla . solutions . core . security . data . AccessControl # addPermissions ( java . util . Collection ) */
@ Override public void addPermissions ( Collection < Permission > aPermssions ) { } } | if ( aPermssions == null ) throw new IllegalArgumentException ( "aPermssions required in SecurityAccessControl" ) ; // SecurityPermission element = null ;
for ( Iterator < Permission > i = aPermssions . iterator ( ) ; i . hasNext ( ) ; ) { addPermission ( ( SecurityPermission ) i . next ( ) ) ; } |
public class Transaction { /** * Returns the witness transaction id ( aka witness id ) as per BIP144 . For transactions without witness , this is the
* same as { @ link # getTxId ( ) } . */
public Sha256Hash getWTxId ( ) { } } | if ( cachedWTxId == null ) { if ( ! hasWitnesses ( ) && cachedTxId != null ) { cachedWTxId = cachedTxId ; } else { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { bitcoinSerializeToStream ( baos , hasWitnesses ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; // cannot happen
} cachedWTxId = Sha256Hash . wrapReversed ( Sha256Hash . hashTwice ( baos . toByteArray ( ) ) ) ; } } return cachedWTxId ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link WaterClosureSurfaceType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link WaterClosureSurfaceType } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/waterbody/1.0" , name = "WaterClosureSurface" , substitutionHeadNamespace = "http://www.opengis.net/citygml/waterbody/1.0" , substitutionHeadName = "_WaterBoundarySurface" ) public JAXBElement < WaterClosureSurfaceType > createWaterClosureSurface ( WaterClosureSurfaceType value ) { } } | return new JAXBElement < WaterClosureSurfaceType > ( _WaterClosureSurface_QNAME , WaterClosureSurfaceType . class , null , value ) ; |
public class DefaultNodeExtension { /** * otherwise , if not overridden , use current node ' s codebase version */
private Version getClusterOrNodeVersion ( ) { } } | if ( node . getClusterService ( ) != null && ! node . getClusterService ( ) . getClusterVersion ( ) . isUnknown ( ) ) { return node . getClusterService ( ) . getClusterVersion ( ) ; } else { String overriddenClusterVersion = node . getProperties ( ) . getString ( GroupProperty . INIT_CLUSTER_VERSION ) ; return ( overriddenClusterVersion != null ) ? MemberVersion . of ( overriddenClusterVersion ) . asVersion ( ) : node . getVersion ( ) . asVersion ( ) ; } |
public class LogPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getPasswordReset ( ) { } } | if ( passwordResetEClass == null ) { passwordResetEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( LogPackage . eNS_URI ) . getEClassifiers ( ) . get ( 19 ) ; } return passwordResetEClass ; |
public class AbucoinsTradeServiceRaw { /** * Corresponds to < code > POST orders < / delete >
* @ return
* @ throws IOException */
public AbucoinsCreateOrderResponse createAbucoinsOrder ( AbucoinsBaseCreateOrderRequest req ) throws IOException { } } | AbucoinsCreateOrderResponse resp = abucoinsAuthenticated . createOrder ( exchange . getExchangeSpecification ( ) . getApiKey ( ) , signatureCreator , exchange . getExchangeSpecification ( ) . getPassword ( ) , timestamp ( ) , req ) ; if ( resp . getMessage ( ) != null ) throw new ExchangeException ( resp . getMessage ( ) ) ; return resp ; |
public class DatabaseProperties { /** * Saves the key value pair to the properties store .
* @ param key the property key
* @ param value the property value
* @ throws UpdateException is thrown if there is an update exception */
public synchronized void save ( String key , String value ) throws UpdateException { } } | properties . put ( key , value ) ; cveDB . saveProperty ( key , value ) ; |
public class SingleValueAssignExtension { /** * Assigns one variable to one value
* @ param action an Assign Action
* @ param possibleStateList a current list of possible states produced so far from expanding a model state
* @ return the same list , with every possible state augmented with an assigned variable , defined by action */
public List < Map < String , String > > pipelinePossibleStates ( Assign action , List < Map < String , String > > possibleStateList ) { } } | for ( Map < String , String > possibleState : possibleStateList ) { possibleState . put ( action . getName ( ) , action . getExpr ( ) ) ; } return possibleStateList ; |
public class TypeCache { /** * Inserts a new type into the cache . If a type with the same class loader and key was inserted previously , the cache is not updated .
* @ param classLoader The class loader for which this type is stored .
* @ param key The key for the type in question .
* @ param type The type to insert of no previous type was stored in the cache .
* @ return The supplied type or a previously submitted type for the same class loader and key combination . */
@ SuppressFBWarnings ( value = "GC_UNRELATED_TYPES" , justification = "Cross-comparison is intended" ) public Class < ? > insert ( ClassLoader classLoader , T key , Class < ? > type ) { } } | ConcurrentMap < T , Reference < Class < ? > > > storage = cache . get ( new LookupKey ( classLoader ) ) ; if ( storage == null ) { storage = new ConcurrentHashMap < T , Reference < Class < ? > > > ( ) ; ConcurrentMap < T , Reference < Class < ? > > > previous = cache . putIfAbsent ( new StorageKey ( classLoader , this ) , storage ) ; if ( previous != null ) { storage = previous ; } } Reference < Class < ? > > reference = sort . wrap ( type ) , previous = storage . putIfAbsent ( key , reference ) ; while ( previous != null ) { Class < ? > previousType = previous . get ( ) ; if ( previousType != null ) { return previousType ; } else if ( storage . remove ( key , previous ) ) { previous = storage . putIfAbsent ( key , reference ) ; } else { previous = storage . get ( key ) ; if ( previous == null ) { previous = storage . putIfAbsent ( key , reference ) ; } } } return type ; |
public class Round { /** * < p > Static factory method that creates a round from the
* given < tt > identifier < / tt > . < / p >
* @ param identifier Round id to use .
* @ param cookie Cookie value to use for retrieving contest .
* @ return Created round .
* @ throws IOException If any error occurs while retrieving round information .
* @ throws GeneralSecurityException If any error occurs while creating { @ link HttpRequestExecutor } instance . */
public static Round fromIdentifier ( final String identifier , final String cookie ) throws GeneralSecurityException , IOException { } } | final StringBuilder builder = new StringBuilder ( ) ; builder . append ( CODEJAM_PATH ) . append ( identifier ) . append ( ROUND_PREFIX ) ; return fromURL ( builder . toString ( ) , cookie ) ; |
public class CrossAppClient { /** * Delete blacklist whose users belong to another app from a given user .
* @ param username The owner of the blacklist
* @ param blacklists CrossBlacklist array
* @ return No content
* @ throws APIConnectionException connect exception
* @ throws APIRequestException request exception */
public ResponseWrapper deleteCrossBlacklist ( String username , CrossBlacklist [ ] blacklists ) throws APIConnectionException , APIRequestException { } } | StringUtils . checkUsername ( username ) ; CrossBlacklistPayload payload = new CrossBlacklistPayload . Builder ( ) . setCrossBlacklists ( blacklists ) . build ( ) ; return _httpClient . sendDelete ( _baseUrl + crossUserPath + "/" + username + "/blacklist" , payload . toString ( ) ) ; |
public class TelnetConnection { /** * Handle option parameters call back . The implementation will try to find a matching option
* via the { @ code Option # values ( ) } and invoke it ' s { @ link Option # handleParameters ( TelnetConnection , byte [ ] ) } method .
* This method can be subclassed to handle an option .
* @ param optionCode the option code */
protected void onOptionParameters ( byte optionCode , byte [ ] parameters ) { } } | for ( Option option : Option . values ( ) ) { if ( option . code == optionCode ) { option . handleParameters ( this , parameters ) ; return ; } } |
public class CommerceWishListUtil { /** * Returns the commerce wish list with the primary key or throws a { @ link NoSuchWishListException } if it could not be found .
* @ param commerceWishListId the primary key of the commerce wish list
* @ return the commerce wish list
* @ throws NoSuchWishListException if a commerce wish list with the primary key could not be found */
public static CommerceWishList findByPrimaryKey ( long commerceWishListId ) throws com . liferay . commerce . wish . list . exception . NoSuchWishListException { } } | return getPersistence ( ) . findByPrimaryKey ( commerceWishListId ) ; |
public class HtmlSource { /** * Initialize class fields . */
public void init ( Reader reader , Record record , SaxHtmlHandler handler ) { } } | m_handler = null ; m_handler = handler ; super . init ( reader , record ) ; |
public class QRColPivDecompositionHouseholderColumn_DDRM { /** * Performs an efficient update of each columns ' norm */
protected void updateNorms ( int j ) { } } | boolean foundNegative = false ; for ( int col = j ; col < numCols ; col ++ ) { double e = dataQR [ col ] [ j - 1 ] ; double v = normsCol [ col ] -= e * e ; if ( v < 0 ) { foundNegative = true ; break ; } } // if a negative sum has been found then clearly too much precision has been lost
// and it should recompute the column norms from scratch
if ( foundNegative ) { for ( int col = j ; col < numCols ; col ++ ) { double u [ ] = dataQR [ col ] ; double actual = 0 ; for ( int i = j ; i < numRows ; i ++ ) { double v = u [ i ] ; actual += v * v ; } normsCol [ col ] = actual ; } } |
public class MailSessionService { /** * The createResource uses the sessionProperties to create a javax . mail . Session
* object and return it to the caller . The caller uses JNDI look up with the
* JNDI name defined in the server . xml . */
@ Override public Object createResource ( ResourceInfo info ) throws Exception { } } | Properties propertyNames = createPropertyNames ( ) ; Properties props = createProperties ( propertyNames ) ; // The listOfPropMap is how the nested properties ( name , value pairs ) are
// pulled from the Nester class . This iterates the map and stores them in the
// props object
if ( listOfPropMap != null ) { for ( Map < String , Object > nestedProperties : listOfPropMap ) { props . put ( nestedProperties . get ( NAME ) , nestedProperties . get ( VALUE ) ) ; } } Session session = createSession ( props ) ; return session ; |
public class WsFrameEncodingSupport { /** * Encode a WebSocket opcode onto a byte that might have some high bits set .
* @ param b
* @ param message
* @ return */
private static byte doEncodeOpcode ( byte b , WsMessage message ) { } } | Kind kind = message . getKind ( ) ; switch ( kind ) { case CONTINUATION : b |= Opcode . CONTINUATION . getCode ( ) ; break ; case TEXT : { b |= Opcode . TEXT . getCode ( ) ; break ; } case BINARY : { b |= Opcode . BINARY . getCode ( ) ; break ; } case PING : { b |= Opcode . PING . getCode ( ) ; break ; } case PONG : { b |= Opcode . PONG . getCode ( ) ; break ; } case CLOSE : { b |= Opcode . CLOSE . getCode ( ) ; break ; } default : throw new IllegalStateException ( "Unrecognized frame type: " + message . getKind ( ) ) ; } return b ; |
public class MultisetUtils { /** * An ordering of { @ link Multiset } elements by descending order of count , with ties broken
* according to the supplied { @ code itemComparator } . */
public static < E > Ordering < Multiset . Entry < E > > byCountDescendingThenItemAscendingOrdering ( Comparator < ? super E > itemComparator ) { } } | final Ordering < Multiset . Entry < E > > byCount = byCountOrdering ( ) ; final Ordering < Multiset . Entry < E > > byCountReversed = byCount . reverse ( ) ; final Ordering < Multiset . Entry < E > > byElement = byElementOrdering ( itemComparator ) ; return byCountReversed . compound ( byElement ) ; |
public class CommerceNotificationAttachmentLocalServiceUtil { /** * Returns the commerce notification attachment matching the UUID and group .
* @ param uuid the commerce notification attachment ' s UUID
* @ param groupId the primary key of the group
* @ return the matching commerce notification attachment , or < code > null < / code > if a matching commerce notification attachment could not be found */
public static com . liferay . commerce . notification . model . CommerceNotificationAttachment fetchCommerceNotificationAttachmentByUuidAndGroupId ( String uuid , long groupId ) { } } | return getService ( ) . fetchCommerceNotificationAttachmentByUuidAndGroupId ( uuid , groupId ) ; |
public class ElementMatchers { /** * Exactly matches a given field as a { @ link FieldDescription } in its defined shape .
* @ param field The field to match by its description
* @ param < T > The type of the matched object .
* @ return An element matcher that exactly matches the given field in its defined shape . */
public static < T extends FieldDescription > ElementMatcher . Junction < T > is ( Field field ) { } } | return is ( new FieldDescription . ForLoadedField ( field ) ) ; |
public class CommandLine { /** * Sets whether the value of boolean flag options should be " toggled " when the option is matched . The default is { @ code true } .
* < p > The specified setting will be registered with this { @ code CommandLine } and the full hierarchy of its
* subcommands and nested sub - subcommands < em > at the moment this method is called < / em > . Subcommands added
* later will have the default setting . To ensure a setting is applied to all
* subcommands , call the setter last , after adding subcommands . < / p >
* @ param newValue the new setting
* @ return this { @ code CommandLine } object , to allow method chaining
* @ since 3.0 */
public CommandLine setToggleBooleanFlags ( boolean newValue ) { } } | getCommandSpec ( ) . parser ( ) . toggleBooleanFlags ( newValue ) ; for ( CommandLine command : getCommandSpec ( ) . subcommands ( ) . values ( ) ) { command . setToggleBooleanFlags ( newValue ) ; } return this ; |
public class DynamicByteArray { /** * Read the entire stream into this array .
* @ param in the stream to read from
* @ throws IOException */
public void readAll ( InputStream in ) throws IOException { } } | int read = 0 ; do { grow ( length ) ; read = data . setBytes ( length , in , data . length ( ) - length ) ; if ( read > 0 ) { length += read ; } } while ( in . available ( ) > 0 ) ; |
public class PdfCell { /** * Calculates what the height of the first line should be so that the content will be
* flush with the top . For text , this is the height of the ascender . For an image ,
* it is the actual height of the image .
* @ return the real height of the first line */
private float firstLineRealHeight ( ) { } } | float firstLineRealHeight = 0f ; if ( firstLine != null ) { PdfChunk chunk = firstLine . getChunk ( 0 ) ; if ( chunk != null ) { Image image = chunk . getImage ( ) ; if ( image != null ) { firstLineRealHeight = firstLine . getChunk ( 0 ) . getImage ( ) . getScaledHeight ( ) ; } else { firstLineRealHeight = useAscender ? firstLine . getAscender ( ) : leading ; } } } return firstLineRealHeight ; |
public class FacebookRestClient { /** * Publishes a Mini - Feed story describing an action taken by the logged - in user , and
* publishes aggregating News Feed stories to their friends .
* Stories are identified as being combinable if they have matching templates and substituted values .
* @ param titleTemplate markup ( up to 60 chars , tags excluded ) for the feed story ' s title
* section . Must include the token < code > { actor } < / code > .
* @ return whether the action story was successfully published ; false in case
* of a permission error
* @ see < a href = " http : / / wiki . developers . facebook . com / index . php / Feed . publishTemplatizedAction " >
* Developers Wiki : Feed . publishTemplatizedAction < / a >
* @ see < a href = " http : / / developers . facebook . com / tools . php ? feed " >
* Developers Resources : Feed Preview Console < / a > */
public boolean feed_publishTemplatizedAction ( CharSequence titleTemplate ) throws FacebookException , IOException { } } | return feed_publishTemplatizedAction ( titleTemplate , null , null , null , null , null , null , /* pageActorId */
null ) ; |
public class CacheEntry { /** * Compare the time .
* @ param other other entry to compare to
* @ return results */
private int compareToLRU ( CacheEntry other ) { } } | int cmp = compareTime ( other ) ; if ( cmp != 0 ) { return cmp ; } cmp = compareOrder ( other ) ; if ( cmp != 0 ) { return cmp ; } return compareReadCount ( other ) ; |
public class ChangesHolder { /** * { @ inheritDoc } */
public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } } | int length = in . readInt ( ) ; this . remove = new ArrayList < String > ( length ) ; for ( int i = 0 ; i < length ; i ++ ) { remove . add ( in . readUTF ( ) ) ; } this . add = new LinkedList < Document > ( ) ; while ( in . readBoolean ( ) ) { Document doc = new Document ( ) ; doc . setBoost ( in . readFloat ( ) ) ; int l = in . readInt ( ) ; for ( int i = 0 ; i < l ; i ++ ) { doc . add ( readField ( in , doc ) ) ; } add . add ( doc ) ; } |
public class MaterialSuggestionOracle { /** * Autocomplete with Image item selection . */
public void add ( String text , Image image ) { } } | this . imageElem = image . getElement ( ) . toString ( ) ; add ( text + image ) ; |
public class JsJmsMapMessageImpl { /** * Helper method used by the JMO to rewrite any transient data back into the
* underlying JMF message .
* @ param why The reason for the update
* @ see com . ibm . ws . sib . mfp . MfpConstants */
void updateDataFields ( int why ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "updateDataFields" ) ; super . updateDataFields ( why ) ; if ( bodyMap != null && bodyMap . isChanged ( ) ) { getPayload ( ) . setField ( JmsMapBodyAccess . BODY_DATA_ENTRY_NAME , bodyMap . getKeyList ( ) ) ; getPayload ( ) . setField ( JmsMapBodyAccess . BODY_DATA_ENTRY_VALUE , bodyMap . getValueList ( ) ) ; bodyMap . setUnChanged ( ) ; // d317373.1
} if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "updateDataFields" ) ; |
public class ApiOvhOrder { /** * Get allowed durations for ' account ' option
* REST : GET / order / email / exchange / { organizationName } / service / { exchangeService } / account
* @ param storageQuota [ required ] The storage quota for the account ( s ) in GB ( default = 50)
* @ param number [ required ] Number of Accounts to order
* @ param licence [ required ] Licence type for the account
* @ param organizationName [ required ] The internal name of your exchange organization
* @ param exchangeService [ required ] The internal name of your exchange service */
public ArrayList < String > email_exchange_organizationName_service_exchangeService_account_GET ( String organizationName , String exchangeService , OvhOvhLicenceEnum licence , Long number , OvhAccountQuotaEnum storageQuota ) throws IOException { } } | String qPath = "/order/email/exchange/{organizationName}/service/{exchangeService}/account" ; StringBuilder sb = path ( qPath , organizationName , exchangeService ) ; query ( sb , "licence" , licence ) ; query ( sb , "number" , number ) ; query ( sb , "storageQuota" , storageQuota ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t1 ) ; |
public class VideoSampleActivity { /** * Initialize the Activity with some injected data . */
@ Override protected void onCreate ( Bundle savedInstanceState ) { } } | super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . activity_video_sample ) ; ButterKnife . inject ( this ) ; initializeVideoView ( ) ; initializePoster ( ) ; hookDraggableViewListener ( ) ; |
public class AppServiceEnvironmentsInner { /** * Get properties of a worker pool .
* Get properties of a worker pool .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service Environment .
* @ param workerPoolName Name of the worker pool .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the WorkerPoolResourceInner object */
public Observable < ServiceResponse < WorkerPoolResourceInner > > getWorkerPoolWithServiceResponseAsync ( String resourceGroupName , String name , String workerPoolName ) { } } | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( name == null ) { throw new IllegalArgumentException ( "Parameter name is required and cannot be null." ) ; } if ( workerPoolName == null ) { throw new IllegalArgumentException ( "Parameter workerPoolName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } return service . getWorkerPool ( resourceGroupName , name , workerPoolName , this . client . subscriptionId ( ) , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < WorkerPoolResourceInner > > > ( ) { @ Override public Observable < ServiceResponse < WorkerPoolResourceInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < WorkerPoolResourceInner > clientResponse = getWorkerPoolDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
public class Assembler { /** * Branch always
* @ param target
* @ throws IOException */
public void goto_n ( String target ) throws IOException { } } | if ( wideIndex ) { goto_w ( target ) ; } else { boolean ok = optimizeGoto ( target ) ; if ( ! ok ) { Branch branch = createBranch ( target ) ; int addr = branch . getLabel ( ) . getAddress ( ) ; if ( addr != - 1 ) { int offset = addr - ( position ( ) ) ; if ( offset < Short . MIN_VALUE || offset > Short . MAX_VALUE ) { out . writeOpCode ( GOTO_W ) ; out . writeInt ( branch ) ; return ; } } out . writeOpCode ( GOTO ) ; out . writeShort ( branch ) ; } } |
public class JournalConsumer { /** * Reject API calls from outside while we are in recovery mode . */
public Date modifyDatastreamByReference ( Context context , String pid , String datastreamID , String [ ] altIDs , String dsLabel , String mimeType , String formatURI , String dsLocation , String checksumType , String checksum , String logMessage , Date lastModifiedDate ) throws ServerException { } } | throw rejectCallsFromOutsideWhileInRecoveryMode ( ) ; |
public class DatalogNormalizer { /** * Adds a trivial equality to a LeftJoin in case the left join doesn ' t have
* at least one boolean condition . This is necessary to have syntactically
* correct LeftJoins in SQL . */
public void addMinimalEqualityToLeftOrNestedInnerJoin ( CQIE query ) { } } | for ( Function f : query . getBody ( ) ) { if ( f . isAlgebraFunction ( ) ) { addMinimalEqualityToLeftOrNestedInnerJoin ( f ) ; } } |
public class RePairFactory { /** * Builds a grammar given a string of terminals delimeted by space .
* @ param inputString the input string .
* @ return the RePair grammar . */
public static RePairGrammar buildGrammar ( String inputString ) { } } | RePairGrammar grammar = NewRepair . parse ( inputString ) ; return grammar ; |
public class EditableResourceBundleSet { /** * The constructor of EditableResourceBundle adds itself here . */
void addBundle ( EditableResourceBundle bundle ) { } } | Locale locale = bundle . getBundleLocale ( ) ; if ( ! locales . contains ( locale ) ) throw new AssertionError ( "locale not in locales: " + locale ) ; bundles . put ( locale , bundle ) ; |
public class CommsByteBuffer { /** * This method returns a < String , String > Map object built from the recived transmission buffer */
public Map < String , String > getMap ( ) { } } | // SIB0163 . comms . 1
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getMap" ) ; final short len = getShort ( ) ; final Map < String , String > rc = new HashMap < String , String > ( ) ; for ( int i = 0 ; i < len ; i ++ ) { rc . put ( getString ( ) , getString ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getMap" , "rc=" + rc ) ; return rc ; |
public class Smushing { /** * Add a char to another char using { @ link FigletFont # smushingRulesToApply } where applicable .
* @ param figletFont Font details
* @ param char1 Message so far
* @ param char2 Char to add
* @ return Array ( lines ) of char arrays */
private static char [ ] [ ] addChar ( FigletFont figletFont , char [ ] [ ] char1 , char [ ] [ ] char2 ) { } } | char [ ] [ ] result = new char [ figletFont . height ] [ ] ; int overlay = calculateOverlay ( figletFont , char1 , char2 ) ; for ( int l = 0 ; l < figletFont . height ; l ++ ) { if ( char1 [ l ] == null ) { char1 [ l ] = new char [ 0 ] ; } char [ ] cs1 = char1 [ l ] ; char [ ] cs2 = char2 [ l ] ; int char1Length = cs1 . length ; int char2Length = cs2 . length ; int k ; for ( k = 0 ; k < overlay && char1Length > 0 ; k ++ ) { int col = char1Length - overlay + k ; char c2 = cs2 [ k ] ; char c1 = cs1 [ col ] ; char smushed = figletFont . smushingRulesToApply . smushHorizontal ( c1 , c2 , figletFont . hardblank ) ; cs1 [ col ] = smushed ; } char lineResult [ ] = new char [ char1Length + char2Length - k ] ; System . arraycopy ( char1 [ l ] , 0 , lineResult , 0 , char1Length ) ; System . arraycopy ( char2 [ l ] , k , lineResult , char1Length , char2Length - k ) ; result [ l ] = lineResult ; } return result ; |
public class CodeGenerator { /** * generate < code > readFrom < / code > method source code
* @ return */
private String getReadFromMethodCode ( ) { } } | StringBuilder code = new StringBuilder ( ) ; code . append ( "public " ) . append ( ClassHelper . getInternalName ( cls . getCanonicalName ( ) ) ) . append ( " readFrom(CodedInputStream input) throws IOException {" ) . append ( LINE_BREAK ) ; getParseBytesMethodCode ( code ) ; return code . toString ( ) ; |
public class CssImageUrlRewriter { /** * Sets the context path
* @ param contextPath
* the contextPath to set */
public void setContextPath ( String contextPath ) { } } | if ( StringUtils . isNotEmpty ( contextPath ) ) { if ( contextPath . charAt ( 0 ) != '/' ) { contextPath = '/' + contextPath ; } if ( contextPath . charAt ( contextPath . length ( ) - 1 ) != '/' ) { contextPath = contextPath + '/' ; } this . contextPath = contextPath ; } else { this . contextPath = null ; } |
public class RecordDetail { /** * The errors that occurred .
* @ param recordErrors
* The errors that occurred . */
public void setRecordErrors ( java . util . Collection < RecordError > recordErrors ) { } } | if ( recordErrors == null ) { this . recordErrors = null ; return ; } this . recordErrors = new java . util . ArrayList < RecordError > ( recordErrors ) ; |
public class OperaWebElement { /** * Click the middle mouse button at the top left corner of the element .
* Will not verify whether element is available for interaction first .
* @ deprecated */
@ Deprecated @ SuppressWarnings ( "unused" ) public void middleClick ( ) { } } | // TODO ( andreastt ) : Add this to Actions
Point point = coordinates . inViewPort ( ) ; exec . mouseAction ( point . x , point . y , OperaMouseKeys . MIDDLE ) ; |
public class BasicImpl { /** * If not already created , a new < code > column < / code > element with the given value will be created .
* Otherwise , the existing < code > column < / code > element will be returned .
* @ return a new or existing instance of < code > Column < Basic < T > > < / code > */
public Column < Basic < T > > getOrCreateColumn ( ) { } } | Node node = childNode . getOrCreate ( "column" ) ; Column < Basic < T > > column = new ColumnImpl < Basic < T > > ( this , "column" , childNode , node ) ; return column ; |
public class BasicKiller { /** * { @ inheritDoc }
* This implementation uses { @ link Set # removeAll ( Collection ) } to remove the selected
* organisms from the population . The new population will be returned
* @ param arguments { @ inheritDoc }
* @ param population { @ inheritDoc }
* @ param selected { @ inheritDoc } */
@ Override public Population < O > kill ( Arguments arguments , Population < O > population , Collection < O > selected ) { } } | Set < O > organisms = new HashSet < > ( population . getAll ( ) ) ; organisms . removeAll ( selected ) ; return new Population . Default < > ( organisms ) ; |
public class TileManager { /** * Returns the tileset with the specified name .
* @ throws NoSuchTileSetException if no tileset with the specified name is available via our
* configured tile set repository . */
public TileSet getTileSet ( String name ) throws NoSuchTileSetException { } } | // make sure we have a repository configured
if ( _setrep == null ) { throw new NoSuchTileSetException ( name ) ; } try { return _setrep . getTileSet ( name ) ; } catch ( PersistenceException pe ) { log . warning ( "Failure loading tileset" , "name" , name , "error" , pe ) ; throw new NoSuchTileSetException ( name ) ; } |
public class MonitoringAspect { /** * Common class profiling entry - point .
* @ param pjp
* { @ link ProceedingJoinPoint }
* @ param monitor
* { @ link Monitor }
* @ return call result
* @ throws Throwable
* in case of error during { @ link ProceedingJoinPoint # proceed ( ) } */
@ Around ( value = "execution(* *.*(..)) && @within(monitor) && !@annotation(net.anotheria.moskito.aop.annotation.DontMonitor)" ) public Object doProfilingClass ( ProceedingJoinPoint pjp , Monitor monitor ) throws Throwable { } } | return doProfiling ( pjp , monitor . producerId ( ) , monitor . subsystem ( ) , monitor . category ( ) ) ; |
public class ListBulkDeploymentDetailedReportsResult { /** * A list of the individual group deployments in the bulk deployment operation .
* @ param deployments
* A list of the individual group deployments in the bulk deployment operation . */
public void setDeployments ( java . util . Collection < BulkDeploymentResult > deployments ) { } } | if ( deployments == null ) { this . deployments = null ; return ; } this . deployments = new java . util . ArrayList < BulkDeploymentResult > ( deployments ) ; |
public class ClientUtils { /** * Used for debugging
* @ param instream
* @ return */
protected String writeInputStreamAsString ( InputStream instream ) { } } | String value = null ; try { value = IOUtils . toString ( instream , "UTF-8" ) ; System . out . println ( value ) ; } catch ( IOException ioe ) { // Do nothing
} return value ; |
public class JobsInner { /** * Terminates a job .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param workspaceName The name of the workspace . Workspace names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name must be from 1 through 64 characters long .
* @ param experimentName The name of the experiment . Experiment names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name must be from 1 through 64 characters long .
* @ param jobName The name of the job within the specified resource group . Job names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ) . The name must be from 1 through 64 characters long .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable for the request */
public Observable < Void > terminateAsync ( String resourceGroupName , String workspaceName , String experimentName , String jobName ) { } } | return terminateWithServiceResponseAsync ( resourceGroupName , workspaceName , experimentName , jobName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class XBELValidatingConverter { /** * { @ inheritDoc } */
@ Override public XBELDocument unmarshal ( File f ) throws JAXBException , IOException { } } | try { validator . validate ( f ) ; } catch ( SAXException e ) { throw new JAXBException ( e ) ; } return super . unmarshal ( f ) ; |
public class CPOptionValuePersistenceImpl { /** * Returns the cp option value where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found . Uses the finder cache .
* @ param uuid the uuid
* @ param groupId the group ID
* @ return the matching cp option value , or < code > null < / code > if a matching cp option value could not be found */
@ Override public CPOptionValue fetchByUUID_G ( String uuid , long groupId ) { } } | return fetchByUUID_G ( uuid , groupId , true ) ; |
public class LittleEndianDataInputStream { /** * Reads a four byte signed { @ code int } from the underlying
* input stream in little endian order , low byte first .
* @ return the { @ code int } read .
* @ throws EOFException if the end of the underlying input stream
* has been reached
* @ throws IOException if the underlying stream throws an IOException . */
public int readInt ( ) throws IOException { } } | int byte1 = in . read ( ) ; int byte2 = in . read ( ) ; int byte3 = in . read ( ) ; int byte4 = in . read ( ) ; if ( byte4 < 0 ) { throw new EOFException ( ) ; } return ( byte4 << 24 ) | ( ( byte3 << 24 ) >>> 8 ) | ( ( byte2 << 24 ) >>> 16 ) | ( ( byte1 << 24 ) >>> 24 ) ; |
public class MtasSolrSearchComponent { /** * ( non - Javadoc )
* @ see
* org . apache . solr . handler . component . SearchComponent # distributedProcess ( org .
* apache . solr . handler . component . ResponseBuilder ) */
@ Override public int distributedProcess ( ResponseBuilder rb ) throws IOException { } } | // System . out . println ( System . nanoTime ( ) + " - "
// + Thread . currentThread ( ) . getId ( ) + " - "
// + rb . req . getParams ( ) . getBool ( ShardParams . IS _ SHARD , false )
// + " DISTIRBUTEDPROCESS " + rb . stage + " " + rb . req . getParamString ( ) ) ;
MtasSolrStatus solrStatus = Objects . requireNonNull ( ( MtasSolrStatus ) rb . req . getContext ( ) . get ( MtasSolrStatus . class ) , "couldn't find status" ) ; solrStatus . setStage ( rb . stage ) ; try { if ( rb . req . getParams ( ) . getBool ( PARAM_MTAS , false ) ) { if ( rb . stage == STAGE_TERMVECTOR_MISSING_TOP || rb . stage == STAGE_TERMVECTOR_MISSING_KEY || rb . stage == STAGE_TERMVECTOR_FINISH ) { ComponentFields mtasFields = getMtasFields ( rb ) ; searchTermvector . distributedProcess ( rb , mtasFields ) ; } else if ( rb . stage == STAGE_LIST ) { ComponentFields mtasFields = getMtasFields ( rb ) ; searchList . distributedProcess ( rb , mtasFields ) ; } else if ( rb . stage == STAGE_PREFIX ) { ComponentFields mtasFields = getMtasFields ( rb ) ; searchPrefix . distributedProcess ( rb , mtasFields ) ; } else if ( rb . stage == STAGE_STATS ) { ComponentFields mtasFields = getMtasFields ( rb ) ; searchStats . distributedProcess ( rb , mtasFields ) ; } else if ( rb . stage == STAGE_FACET ) { ComponentFields mtasFields = getMtasFields ( rb ) ; searchFacet . distributedProcess ( rb , mtasFields ) ; } else if ( rb . stage == STAGE_COLLECTION_INIT || rb . stage == STAGE_COLLECTION_FINISH ) { ComponentFields mtasFields = getMtasFields ( rb ) ; searchCollection . distributedProcess ( rb , mtasFields ) ; } else if ( rb . stage == STAGE_GROUP ) { ComponentFields mtasFields = getMtasFields ( rb ) ; searchGroup . distributedProcess ( rb , mtasFields ) ; } else if ( rb . stage == STAGE_DOCUMENT ) { ComponentFields mtasFields = getMtasFields ( rb ) ; searchDocument . distributedProcess ( rb , mtasFields ) ; } // compute new stage and return if not finished
if ( rb . stage >= ResponseBuilder . STAGE_EXECUTE_QUERY && rb . stage < ResponseBuilder . STAGE_GET_FIELDS ) { if ( rb . stage < STAGE_TERMVECTOR_MISSING_TOP && rb . req . getParams ( ) . getBool ( MtasSolrComponentTermvector . PARAM_MTAS_TERMVECTOR , false ) ) { return STAGE_TERMVECTOR_MISSING_TOP ; } else if ( rb . stage < STAGE_TERMVECTOR_MISSING_KEY && rb . req . getParams ( ) . getBool ( MtasSolrComponentTermvector . PARAM_MTAS_TERMVECTOR , false ) ) { return STAGE_TERMVECTOR_MISSING_KEY ; } else if ( rb . stage < STAGE_TERMVECTOR_FINISH && rb . req . getParams ( ) . getBool ( MtasSolrComponentTermvector . PARAM_MTAS_TERMVECTOR , false ) ) { return STAGE_TERMVECTOR_FINISH ; } else if ( rb . stage < STAGE_LIST && rb . req . getParams ( ) . getBool ( MtasSolrComponentList . PARAM_MTAS_LIST , false ) ) { return STAGE_LIST ; } else if ( rb . stage < STAGE_PREFIX && rb . req . getParams ( ) . getBool ( MtasSolrComponentPrefix . PARAM_MTAS_PREFIX , false ) ) { return STAGE_PREFIX ; } else if ( rb . stage < STAGE_STATS && rb . req . getParams ( ) . getBool ( MtasSolrComponentStats . PARAM_MTAS_STATS , false ) ) { return STAGE_STATS ; } else if ( rb . stage < STAGE_FACET && rb . req . getParams ( ) . getBool ( MtasSolrComponentFacet . PARAM_MTAS_FACET , false ) ) { return STAGE_FACET ; } else if ( rb . stage < STAGE_GROUP && rb . req . getParams ( ) . getBool ( MtasSolrComponentGroup . PARAM_MTAS_GROUP , false ) ) { return STAGE_GROUP ; } else if ( rb . stage < STAGE_COLLECTION_INIT && rb . req . getParams ( ) . getBool ( MtasSolrComponentCollection . PARAM_MTAS_COLLECTION , false ) ) { return STAGE_COLLECTION_INIT ; } else if ( rb . stage < STAGE_COLLECTION_FINISH && rb . req . getParams ( ) . getBool ( MtasSolrComponentCollection . PARAM_MTAS_COLLECTION , false ) ) { return STAGE_COLLECTION_FINISH ; } } else if ( rb . stage >= ResponseBuilder . STAGE_GET_FIELDS && rb . stage < ResponseBuilder . STAGE_DONE ) { if ( rb . stage < STAGE_DOCUMENT && rb . req . getParams ( ) . getBool ( MtasSolrComponentDocument . PARAM_MTAS_DOCUMENT , false ) ) { return STAGE_DOCUMENT ; } } } } catch ( ExitableDirectoryReader . ExitingReaderException e ) { solrStatus . setError ( e . getMessage ( ) ) ; finishStatus ( solrStatus ) ; } finally { checkStatus ( solrStatus ) ; } return ResponseBuilder . STAGE_DONE ; |
public class JDBCWorkspaceDataContainer { /** * { @ inheritDoc } */
public boolean isSame ( WorkspaceDataContainer another ) { } } | if ( another == this ) { return true ; } if ( another instanceof JDBCWorkspaceDataContainer ) { JDBCWorkspaceDataContainer anotherJdbc = ( JDBCWorkspaceDataContainer ) another ; return getDbSourceName ( ) . equals ( anotherJdbc . getDbSourceName ( ) ) ; } return false ; |
public class DiagnosticsInner { /** * List Hosting Environment Detector Responses .
* List Hosting Environment Detector Responses .
* @ 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 ; DetectorResponseInner & gt ; object */
public Observable < ServiceResponse < Page < DetectorResponseInner > > > listHostingEnvironmentDetectorResponsesNextWithServiceResponseAsync ( final String nextPageLink ) { } } | return listHostingEnvironmentDetectorResponsesNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < DetectorResponseInner > > , Observable < ServiceResponse < Page < DetectorResponseInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < DetectorResponseInner > > > call ( ServiceResponse < Page < DetectorResponseInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listHostingEnvironmentDetectorResponsesNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ; |
public class ListByteMatchSetsResult { /** * An array of < a > ByteMatchSetSummary < / a > objects .
* @ param byteMatchSets
* An array of < a > ByteMatchSetSummary < / a > objects . */
public void setByteMatchSets ( java . util . Collection < ByteMatchSetSummary > byteMatchSets ) { } } | if ( byteMatchSets == null ) { this . byteMatchSets = null ; return ; } this . byteMatchSets = new java . util . ArrayList < ByteMatchSetSummary > ( byteMatchSets ) ; |
public class HtmlOutcomeTargetLink { /** * < p > Set the value of the < code > charset < / code > property . < / p > */
public void setCharset ( java . lang . String charset ) { } } | getStateHelper ( ) . put ( PropertyKeys . charset , charset ) ; handleAttribute ( "charset" , charset ) ; |
public class OverviewMap { /** * Determine whether or not a rectangle that shows the target map ' s maximum extent should be shown .
* @ param drawTargetMaxExtent
* should the max extent be marked on the map ?
* @ since 1.8.0 */
@ Api public void setDrawTargetMaxExtent ( boolean drawTargetMaxExtent ) { } } | this . drawTargetMaxExtent = drawTargetMaxExtent ; // Immediately draw or remove the max extent rectangle :
if ( drawTargetMaxExtent ) { targetMaxExtentRectangle = new GfxGeometry ( "targetMaxExtentRectangle" ) ; targetMaxExtentRectangle . setStyle ( targetMaxExtentRectangleStyle ) ; Bbox targetMaxExtent = getOverviewMaxBounds ( ) ; Bbox box = getMapModel ( ) . getMapView ( ) . getWorldViewTransformer ( ) . worldToView ( targetMaxExtent ) ; LinearRing shell = getMapModel ( ) . getGeometryFactory ( ) . createLinearRing ( new Coordinate [ ] { new Coordinate ( - 2 , - 2 ) , new Coordinate ( getWidth ( ) + 2 , - 2 ) , new Coordinate ( getWidth ( ) + 2 , getHeight ( ) + 2 ) , new Coordinate ( - 2 , getHeight ( ) + 2 ) } ) ; LinearRing hole = getMapModel ( ) . getGeometryFactory ( ) . createLinearRing ( new Coordinate [ ] { new Coordinate ( box . getX ( ) , box . getY ( ) ) , new Coordinate ( box . getMaxX ( ) , box . getY ( ) ) , new Coordinate ( box . getMaxX ( ) , box . getMaxY ( ) ) , new Coordinate ( box . getX ( ) , box . getMaxY ( ) ) } ) ; Polygon polygon = getMapModel ( ) . getGeometryFactory ( ) . createPolygon ( shell , new LinearRing [ ] { hole } ) ; targetMaxExtentRectangle . setGeometry ( polygon ) ; render ( targetMaxExtentRectangle , RenderGroup . SCREEN , RenderStatus . ALL ) ; } else { render ( targetMaxExtentRectangle , RenderGroup . SCREEN , RenderStatus . DELETE ) ; targetMaxExtentRectangle = null ; } |
public class Builder { /** * Ends this builder and returns a Body . Checks about the closing
* tags throwing and { @ link IllegalStateException } if there are any pending .
* The HTML version gets the < em > body < / em > and < em > html < / em > closing tags
* and both receive a final new line .
* @ return the mail content object
* @ throws IllegalStateException if there are pending tags to close */
public Body build ( ) { } } | if ( ! ends . isEmpty ( ) ) throw new IllegalStateException ( "Pending some closing. Some end() missing. ends=" + ends ) ; html . a ( POST_HTML ) ; return new Body ( html , text ) ; |
public class AggregationResource { /** * / * ( non - Javadoc )
* @ see com . ibm . jaggr . core . resource . IResource # lastModified ( ) */
@ Override public long lastModified ( ) { } } | // return the latest of each of the resources in this aggregated
// resource
long result = - 1 ; for ( IResource resource : resources ) { result = Math . max ( result , resource . lastModified ( ) ) ; } return result ; |
public class SchedulerUtils { /** * Curl a package , extract it to working directory
* @ param workingDirectory the working directory to setup
* @ param packageURI the URL of core release package
* @ param packageDestination the destination of the core release package fetched
* @ param isDeletePackage delete the package curled or not
* @ param isVerbose display verbose output or not
* @ return true if successful */
public static boolean curlAndExtractPackage ( String workingDirectory , String packageURI , String packageDestination , boolean isDeletePackage , boolean isVerbose ) { } } | // curl the package to the working directory and extract it
LOG . log ( Level . FINE , "Fetching package {0}" , packageURI ) ; LOG . fine ( "Fetched package can overwrite old one." ) ; if ( ! ShellUtils . curlPackage ( packageURI , packageDestination , isVerbose , false ) ) { LOG . severe ( "Failed to fetch package." ) ; return false ; } // untar the heron core release package in the working directory
LOG . log ( Level . FINE , "Extracting the package {0}" , packageURI ) ; if ( ! ShellUtils . extractPackage ( packageDestination , workingDirectory , isVerbose , false ) ) { LOG . severe ( "Failed to extract package." ) ; return false ; } // remove the core release package
if ( isDeletePackage && ! FileUtils . deleteFile ( packageDestination ) ) { LOG . warning ( "Failed to delete the package: " + packageDestination ) ; } return true ; |
public class HistoryTable { /** * Updates the selection in the table whenever the current { @ link Change }
* in the { @ link History } changes .
* @ param currentChange the property which contains the current { @ link Change }
* in the { @ link History } */
void addSelectionBinding ( ReadOnlyObjectProperty < Change > currentChange ) { } } | currentChange . addListener ( ( observable , oldValue , newValue ) -> getSelectionModel ( ) . select ( newValue ) ) ; |
public class Event { /** * Sets the repository .
* @ param repository
* the new repository */
public void setRepository ( String repository ) { } } | if ( meta == null ) { meta = new EventMeta ( ) ; } meta . setRepository ( repository ) ; |
public class MapReader { /** * Define the output data object . The output data object is the kind of result that the reader
* will give . This can be for example :
* < ul >
* < li > when you need to elaborate the data , a double matrix , so the odo would be < b > new
* double [ ] [ ] < / b > < / li >
* < li > when you need to visualize the data , a floatbuffer , so the odo would be < b > new
* { @ link FloatBuffer } < / b > < / li >
* < / ul >
* @ param outputDataObject the output data object */
public void setOutputDataObject ( Object outputDataObject ) { } } | dataObject = outputDataObject ; if ( outputDataObject instanceof Vector ) { if ( ( ( Vector ) outputDataObject ) . capacity ( ) == 0 ) dataObject = new Vector ( ) ; } |
public class LongTuples { /** * Compute the < i > element - wise < / i > minimum of the the given input
* tuples , and store the result in the given
* result tuple .
* @ param t0 The first input tuple
* @ param t1 The second input tuple
* @ param result The tuple that will store the result
* @ return The result tuple
* @ throws IllegalArgumentException If the given tuples do not
* have the same { @ link Tuple # getSize ( ) size } */
public static MutableLongTuple min ( LongTuple t0 , LongTuple t1 , MutableLongTuple result ) { } } | return LongTupleFunctions . apply ( t0 , t1 , Math :: min , result ) ; |
public class Determinize { /** * residual primitive weight early in the path ) */
private void expandDeferredFinalStates ( Deque < DetElement > finalQueue ) { } } | HashBiMap < Integer , GallicWeight > outputStateIdToFinalSuffix = HashBiMap . create ( ) ; while ( ! finalQueue . isEmpty ( ) ) { DetElement element = finalQueue . removeFirst ( ) ; for ( GallicWeight gallicWeight : element . residual . getWeights ( ) ) { // factorization is like a simple version of the divisor / divide calculation earlier
Pair < GallicWeight , GallicWeight > factorized = gallicSemiring . factorize ( gallicWeight ) ; GallicWeight prefix = factorized . getLeft ( ) ; GallicWeight suffix = factorized . getRight ( ) ; if ( ! outputStateIdToFinalSuffix . inverse ( ) . containsKey ( suffix ) ) { // we don ' t have a synthetic state for this suffix yet
MutableState newOutputState = outputFst . newState ( ) ; outputStateIdToFinalSuffix . put ( newOutputState . getId ( ) , suffix ) ; if ( suffix . getLabels ( ) . isEmpty ( ) ) { // this suffix is a real final state , and there ' s no more work to do
newOutputState . setFinalWeight ( suffix . getWeight ( ) ) ; } else { // this suffix still has more labels to emit , so leave final weight as zero and enqueue for expansion
finalQueue . addLast ( new DetElement ( newOutputState . getId ( ) , suffix ) ) ; } } Integer outputStateId = outputStateIdToFinalSuffix . inverse ( ) . get ( suffix ) ; MutableState nextState = checkNotNull ( outputFst . getState ( outputStateId ) , "state should exist" , outputStateId ) ; MutableState thisState = checkNotNull ( outputFst . getState ( element . inputStateId ) ) ; Preconditions . checkArgument ( prefix . getLabels ( ) . size ( ) == 1 , "prefix size should be 1" , prefix ) ; int oLabel = prefix . getLabels ( ) . get ( 0 ) ; // note that openfst has an ' increment subsequent epsilons ' feature so that these paths can still be
// guarenteed to be deterministic ( with just multiple definitions of < EPS > ; this feature would go here
// if we decide to implement it in the future
outputFst . addArc ( thisState , this . outputEps , oLabel , nextState , prefix . getWeight ( ) ) ; } } |
public class UserServiceImpl { /** * { @ inheritDoc }
* 安全考虑 , password 属性为 null 。 < / p > */
public User get ( int id ) { } } | Connection conn = null ; User user = null ; try { conn = ConnectionUtils . getConnection ( ) ; user = userDAO . get ( conn , id ) ; } catch ( SQLException e ) { logger . error ( e . getMessage ( ) ) ; } finally { DbUtils . closeQuietly ( conn ) ; } return user ; |
public class MessageBuilder { /** * Removes all mentions and replaces them with the closest looking textual representation .
* < p > Use this over { @ link # stripMentions ( Guild ) } if { @ link net . dv8tion . jda . core . entities . User User } mentions
* should be replaced with their { @ link net . dv8tion . jda . core . entities . User # getName ( ) } instead of their Nicknames .
* @ param jda
* The JDA instance used to resolve the mentions .
* @ return The MessageBuilder instance . Useful for chaining . */
public MessageBuilder stripMentions ( JDA jda ) { } } | // Note : Users can rename to " everyone " or " here " , so those
// should be stripped after the USER mention is stripped .
return this . stripMentions ( jda , null , Message . MentionType . values ( ) ) ; |
public class AbstractDataIndexer { /** * Sorts and uniques the array of comparable events . This method
* will alter the eventsToCompare array - - it does an in place
* sort , followed by an in place edit to remove duplicates .
* @ param eventsToCompare a < code > ComparableEvent [ ] < / code > value
* @ since maxent 1.2.6 */
protected void sortAndMerge ( List eventsToCompare ) { } } | Collections . sort ( eventsToCompare ) ; int numEvents = eventsToCompare . size ( ) ; int numUniqueEvents = 1 ; // assertion : eventsToCompare . length > = 1
if ( numEvents <= 1 ) { return ; // nothing to do ; edge case ( see assertion )
} ComparableEvent ce = ( ComparableEvent ) eventsToCompare . get ( 0 ) ; for ( int i = 1 ; i < numEvents ; i ++ ) { ComparableEvent ce2 = ( ComparableEvent ) eventsToCompare . get ( i ) ; if ( ce . compareTo ( ce2 ) == 0 ) { ce . seen ++ ; // increment the seen count
eventsToCompare . set ( i , null ) ; // kill the duplicate
} else { ce = ce2 ; // a new champion emerges . . .
numUniqueEvents ++ ; // increment the # of unique events
} } System . out . println ( "done. Reduced " + numEvents + " events to " + numUniqueEvents + "." ) ; contexts = new int [ numUniqueEvents ] [ ] ; outcomeList = new int [ numUniqueEvents ] ; numTimesEventsSeen = new int [ numUniqueEvents ] ; for ( int i = 0 , j = 0 ; i < numEvents ; i ++ ) { ComparableEvent evt = ( ComparableEvent ) eventsToCompare . get ( i ) ; if ( null == evt ) { continue ; // this was a dupe , skip over it .
} numTimesEventsSeen [ j ] = evt . seen ; outcomeList [ j ] = evt . outcome ; contexts [ j ] = evt . predIndexes ; ++ j ; } |
public class OneShotSQLGeneratorEngine { /** * Returns a string with boolean conditions formed with the boolean atoms
* found in the atoms list . */
private Set < String > getBooleanConditions ( List < Function > atoms , AliasIndex index ) { } } | Set < String > conditions = new LinkedHashSet < > ( ) ; for ( Function atom : atoms ) { if ( atom . isOperation ( ) ) { // Boolean expression
if ( atom . getFunctionSymbol ( ) == ExpressionOperation . AND ) { // flatten ANDs
for ( Term t : atom . getTerms ( ) ) { Set < String > arg = getBooleanConditions ( ImmutableList . of ( ( Function ) t ) , index ) ; conditions . addAll ( arg ) ; } } else { String condition = getSQLCondition ( atom , index ) ; conditions . add ( condition ) ; } } else if ( atom . isDataTypeFunction ( ) ) { String condition = getSQLString ( atom , index , false ) ; conditions . add ( condition ) ; } } return conditions ; |
public class StringExpressions { /** * Create a { @ code ltrim ( str ) } expression
* < p > Returns a character expression after it removes leading blanks . < / p >
* @ param str string
* @ return ltrim ( str ) */
public static StringExpression ltrim ( Expression < String > str ) { } } | return Expressions . stringOperation ( Ops . StringOps . LTRIM , str ) ; |
public class URLProtectedEditor { /** * 把字符串转成Pattern和UrlType
* @ param perl5RegExp
* @ return */
private URLPatternHolder convertStringToPattern ( String line ) { } } | URLPatternHolder holder = new URLPatternHolder ( ) ; Pattern compiledPattern ; Perl5Compiler compiler = new Perl5Compiler ( ) ; String perl5RegExp = line ; try { compiledPattern = compiler . compile ( perl5RegExp , Perl5Compiler . READ_ONLY_MASK ) ; holder . setCompiledPattern ( compiledPattern ) ; } catch ( MalformedPatternException mpe ) { throw new IllegalArgumentException ( "Malformed regular expression: " + perl5RegExp ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Added regular expression: " + compiledPattern . getPattern ( ) . toString ( ) ) ; } return holder ; |
public class JavacState { /** * Load a javac _ state file . */
public static JavacState load ( Options options ) { } } | JavacState db = new JavacState ( options , false ) ; Module lastModule = null ; Package lastPackage = null ; Source lastSource = null ; boolean noFileFound = false ; boolean foundCorrectVerNr = false ; boolean newCommandLine = false ; boolean syntaxError = false ; Log . debug ( "Loading javac state file: " + db . javacState ) ; try ( BufferedReader in = new BufferedReader ( new FileReader ( db . javacState ) ) ) { for ( ; ; ) { String l = in . readLine ( ) ; if ( l == null ) break ; if ( l . length ( ) >= 3 && l . charAt ( 1 ) == ' ' ) { char c = l . charAt ( 0 ) ; if ( c == 'M' ) { lastModule = db . prev . loadModule ( l ) ; } else if ( c == 'P' ) { if ( lastModule == null ) { syntaxError = true ; break ; } lastPackage = db . prev . loadPackage ( lastModule , l ) ; } else if ( c == 'D' ) { if ( lastModule == null || lastPackage == null ) { syntaxError = true ; break ; } char depType = l . charAt ( 2 ) ; if ( depType != 'S' && depType != 'C' ) throw new RuntimeException ( "Bad dependency string: " + l ) ; lastPackage . parseAndAddDependency ( l . substring ( 4 ) , depType == 'C' ) ; } else if ( c == 'I' ) { if ( lastModule == null || lastPackage == null ) { syntaxError = true ; break ; } lastPackage . getPubApi ( ) . appendItem ( l . substring ( 2 ) ) ; // Strip " I "
} else if ( c == 'A' ) { if ( lastModule == null || lastPackage == null ) { syntaxError = true ; break ; } lastPackage . loadArtifact ( l ) ; } else if ( c == 'S' ) { if ( lastModule == null || lastPackage == null ) { syntaxError = true ; break ; } lastSource = db . prev . loadSource ( lastPackage , l , false ) ; } else if ( c == 'G' ) { if ( lastModule == null || lastPackage == null ) { syntaxError = true ; break ; } lastSource = db . prev . loadSource ( lastPackage , l , true ) ; } else if ( c == 'R' ) { String ncmdl = "R " + db . theArgs ; if ( ! l . equals ( ncmdl ) ) { newCommandLine = true ; } } else if ( c == '#' ) { if ( l . startsWith ( "# javac_state ver " ) ) { int sp = l . indexOf ( " " , 18 ) ; if ( sp != - 1 ) { String ver = l . substring ( 18 , sp ) ; if ( ! ver . equals ( "0.4" ) ) { break ; } foundCorrectVerNr = true ; } } } } } } catch ( FileNotFoundException | NoSuchFileException e ) { // Silently create a new javac _ state file .
noFileFound = true ; } catch ( IOException e ) { Log . warn ( "Dropping old javac_state because of errors when reading it." ) ; db = new JavacState ( options , true ) ; foundCorrectVerNr = true ; newCommandLine = false ; syntaxError = false ; } if ( foundCorrectVerNr == false && ! noFileFound ) { Log . debug ( "Dropping old javac_state since it is of an old version." ) ; db = new JavacState ( options , true ) ; } else if ( newCommandLine == true && ! noFileFound ) { Log . debug ( "Dropping old javac_state since a new command line is used!" ) ; db = new JavacState ( options , true ) ; } else if ( syntaxError == true ) { Log . warn ( "Dropping old javac_state since it contains syntax errors." ) ; db = new JavacState ( options , true ) ; } db . prev . calculateDependents ( ) ; return db ; |
public class ObjectReader { /** * Reads the object with the given id from the database , using the given
* mapping .
* This is the most general form of readObject ( ) .
* @ param id An object uniquely identifying the object to read
* @ param objClass The class of the object to read
* @ param mapping The hashtable containing the object mapping
* @ param where An hashtable containing extra criteria for the read
* @ return An array of Objects , or an zero - length array if none was found */
public Object readObject ( Object pId , Class pObjClass , Hashtable pMapping , Hashtable pWhere ) throws SQLException { } } | ObjectMapper om = new ObjectMapper ( pObjClass , pMapping ) ; return readObject0 ( pId , pObjClass , om , pWhere ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.