signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class EJBSerializerImpl { /** * ( non - Javadoc )
* @ see com . ibm . ws . ejbcontainer . util . EJBSerializer # deserialize ( byte [ ] ) */
@ Override public Object deserialize ( byte [ ] idBytes ) throws Exception { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "deserialize" ) ; } EJSContainer container = EJSContainer . getDefaultContainer ( ) ; Object retObj = null ; WrapperManager wm = container . getWrapperManager ( ) ; // The first bytes of serialized data is a header and
// the... |
public class DefaultPermissionChecker { /** * This method checks requested permission on a given inode , represented by its fileInfo .
* @ param user who requests access permission
* @ param groups in which user belongs to
* @ param inode whose attributes used for permission check logic
* @ param bits requested... | if ( inode == null ) { return ; } for ( AclAction action : bits . toAclActionSet ( ) ) { if ( ! inode . checkPermission ( user , groups , action ) ) { throw new AccessControlException ( ExceptionMessage . PERMISSION_DENIED . getMessage ( toExceptionMessage ( user , bits , path , inode ) ) ) ; } } |
public class QueryObjectsResult { /** * The identifiers that match the query selectors .
* @ param ids
* The identifiers that match the query selectors . */
public void setIds ( java . util . Collection < String > ids ) { } } | if ( ids == null ) { this . ids = null ; return ; } this . ids = new com . amazonaws . internal . SdkInternalList < String > ( ids ) ; |
public class Channel { /** * Approve chaincode to be run on this peer ' s organization .
* @ param lifecycleApproveChaincodeDefinitionForMyOrgRequest the request see { @ link LifecycleApproveChaincodeDefinitionForMyOrgRequest }
* @ param peers to send the request to .
* @ return A { @ link LifecycleApproveChainco... | if ( null == lifecycleApproveChaincodeDefinitionForMyOrgRequest ) { throw new InvalidArgumentException ( "The lifecycleApproveChaincodeDefinitionForMyOrgRequest parameter can not be null." ) ; } checkChannelState ( ) ; checkPeers ( peers ) ; try { TransactionContext transactionContext = getTransactionContext ( lifecycl... |
public class AbstractParamContainerPanel { /** * Ensures the node of the panel is visible in the view port .
* The node is assumed to be already { @ link JTree # isVisible ( TreePath ) visible in the tree } .
* @ param nodePath the path to the node of the panel . */
private void ensureNodeVisible ( TreePath nodePat... | Rectangle bounds = getTreeParam ( ) . getPathBounds ( nodePath ) ; if ( ! getTreeParam ( ) . getVisibleRect ( ) . contains ( bounds ) ) { // Just do vertical scrolling .
bounds . x = 0 ; getTreeParam ( ) . scrollRectToVisible ( bounds ) ; } |
public class DatastoreActivityMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DatastoreActivity datastoreActivity , ProtocolMarshaller protocolMarshaller ) { } } | if ( datastoreActivity == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( datastoreActivity . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( datastoreActivity . getDatastoreName ( ) , DATASTORENAME_BINDING ) ; } catch ( Excep... |
public class IntIntMap { /** * Removes the value mapped for the specified key .
* @ return the value to which the key was mapped or the supplied default value if there was no
* mapping for that key . */
public int removeOrElse ( int key , int defval ) { } } | _modCount ++ ; int removed = removeImpl ( key , defval ) ; checkShrink ( ) ; return removed ; |
public class StringUtils { /** * Returns the file extension of the value without the dot or an empty string .
* @ param value
* @ return the extension without dot or an empry string */
public static String getFileExtension ( String value ) { } } | int index = value . lastIndexOf ( '.' ) ; if ( index > - 1 ) { return value . substring ( index + 1 ) ; } return "" ; |
public class RawMessageEvent { /** * performance doesn ' t matter , it ' s only being called during tracing */
public UUID getMessageId ( ) { } } | final ByteBuffer wrap = ByteBuffer . wrap ( messageIdBytes ) ; return new UUID ( wrap . asLongBuffer ( ) . get ( 0 ) , wrap . asLongBuffer ( ) . get ( 1 ) ) ; |
public class CmsSitemapChange { /** * Adds a property change for a changed title . < p >
* @ param title the changed title */
public void addChangeTitle ( String title ) { } } | CmsPropertyModification propChange = new CmsPropertyModification ( m_entryId , CmsClientProperty . PROPERTY_NAVTEXT , title , true ) ; m_propertyModifications . add ( propChange ) ; m_ownInternalProperties . put ( "NavText" , new CmsClientProperty ( "NavText" , title , null ) ) ; |
public class AbstractAlpineQueryManager { /** * Retrieves an object by its ID .
* @ param < T > A type parameter . This type will be returned
* @ param clazz the persistence class to retrive the ID for
* @ param id the object id to retrieve
* @ return an object of the specified type
* @ since 1.0.0 */
public ... | return pm . getObjectById ( clazz , id ) ; |
public class AmazonCodeDeployClient { /** * Deletes a deployment group .
* @ param deleteDeploymentGroupRequest
* Represents the input of a DeleteDeploymentGroup operation .
* @ return Result of the DeleteDeploymentGroup operation returned by the service .
* @ throws ApplicationNameRequiredException
* The min... | request = beforeClientExecution ( request ) ; return executeDeleteDeploymentGroup ( request ) ; |
public class SessionDAO { /** * Updates session details obtained frm the services .
* @ return True if session was updated . If false the update is for a different user or session is not started . */
public boolean updateSessionDetails ( final SessionData session ) { } } | synchronized ( sharedLock ) { if ( session != null ) { SharedPreferences . Editor editor = getSharedPreferences ( ) . edit ( ) ; editor . putString ( KEY_PROFILE_ID , session . getProfileId ( ) ) ; editor . putString ( KEY_SESSION_ID , session . getSessionId ( ) ) ; editor . putString ( KEY_ACCESS_TOKEN , session . get... |
public class ColorXyz { /** * Conversion from 8 - bit RGB into XYZ . 8 - bit = range of 0 to 255. */
public static void rgbToXyz ( int r , int g , int b , double xyz [ ] ) { } } | srgbToXyz ( r / 255.0 , g / 255.0 , b / 255.0 , xyz ) ; |
public class ssl_cert { /** * < pre >
* Converts API response of bulk operation into object and returns the object array in case of get request .
* < / pre > */
protected base_resource [ ] get_nitro_bulk_response ( nitro_service service , String response ) throws Exception { } } | ssl_cert_responses result = ( ssl_cert_responses ) service . get_payload_formatter ( ) . string_to_resource ( ssl_cert_responses . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == SESSION_NOT_EXISTS ) service . clear_session ( ) ; throw new nitro_exception ( result . message , result . e... |
public class JCloudsStorageModule { /** * { @ inheritDoc }
* @ throws Exception */
@ Override public synchronized void write ( byte [ ] bytes , long storageIndex ) throws IOException { } } | final int bucketIndex = ( int ) ( storageIndex / SIZE_PER_BUCKET ) ; final int bucketOffset = ( int ) ( storageIndex % SIZE_PER_BUCKET ) ; try { // / / DEBUG CODE
// writer . write ( bucketIndex + " , " + storageIndex + " , " +
// bucketOffset + " , " + bytes . length +
// writer . flush ( ) ;
byte [ ] data = mByteCach... |
public class MatrixFeatures_ZDRM { /** * Checks to see if a matrix is upper triangular or Hessenberg . A Hessenberg matrix of degree N
* has the following property : < br >
* < br >
* a < sub > ij < / sub > & le ; 0 for all i & lt ; j + N < br >
* < br >
* A triangular matrix is a Hessenberg matrix of degree ... | tol *= tol ; for ( int i = hessenberg + 1 ; i < A . numRows ; i ++ ) { int maxCol = Math . min ( i - hessenberg , A . numCols ) ; for ( int j = 0 ; j < maxCol ; j ++ ) { int index = ( i * A . numCols + j ) * 2 ; double real = A . data [ index ] ; double imag = A . data [ index + 1 ] ; double mag = real * real + imag * ... |
public class Util { /** * Deletes the contents of the given directory ( but not the directory itself )
* recursively .
* It does not take no for an answer - if necessary , it will have multiple
* attempts at deleting things .
* @ throws IOException
* if the operation fails . */
public static void deleteConten... | deleteContentsRecursive ( fileToPath ( file ) , PathRemover . PathChecker . ALLOW_ALL ) ; |
public class CheckMissingAndExtraRequires { /** * or null if no part refers to a class . */
private static ImmutableList < String > getClassNames ( String qualifiedName ) { } } | ImmutableList . Builder < String > classNames = ImmutableList . builder ( ) ; List < String > parts = DOT_SPLITTER . splitToList ( qualifiedName ) ; for ( int i = 0 ; i < parts . size ( ) ; i ++ ) { String part = parts . get ( i ) ; if ( isClassOrConstantName ( part ) ) { classNames . add ( DOT_JOINER . join ( parts . ... |
public class XMLConfigurationProvider { /** * This method will return the content of this particular
* < code > element < / code > . For example ,
* < pre >
* < result > something < / result >
* < / pre >
* When the { @ link org . w3c . dom . Element } < code > & lt ; result & gt ; < / code > is
* passed in... | StringBuilder paramValue = new StringBuilder ( ) ; NodeList childNodes = element . getChildNodes ( ) ; for ( int j = 0 ; j < childNodes . getLength ( ) ; j ++ ) { Node currentNode = childNodes . item ( j ) ; if ( currentNode != null && currentNode . getNodeType ( ) == Node . TEXT_NODE ) { String val = currentNode . get... |
public class SystemUtil { /** * Gets the named resource as a stream from the given Class ' Classoader .
* If the pGuessSuffix parameter is true , the method will try to append
* typical properties file suffixes , such as " . properties " or " . xml " .
* @ param pClassLoader the class loader to use
* @ param pN... | InputStream is ; if ( ! pGuessSuffix ) { is = pClassLoader . getResourceAsStream ( pName ) ; // If XML , wrap stream
if ( is != null && pName . endsWith ( XML_PROPERTIES ) ) { is = new XMLPropertiesInputStream ( is ) ; } } else { // Try normal properties
is = pClassLoader . getResourceAsStream ( pName + STD_PROPERTIES ... |
public class SocketExtensions { /** * Reads an object from the given socket InetAddress .
* @ param serverName
* The Name from the address to read .
* @ param port
* The port to read .
* @ return the object
* @ throws IOException
* Signals that an I / O exception has occurred .
* @ throws ClassNotFoundE... | final InetAddress inetAddress = InetAddress . getByName ( serverName ) ; return readObject ( new Socket ( inetAddress , port ) ) ; |
public class ParameterValue { /** * Converts a string value ( s ) to the target collection type . You may optionally specify
* a string pattern to assist in the type conversion .
* @ param collectionClass
* @ param classOfT
* @ param pattern optional pattern for interpreting the underlying request
* string va... | if ( collectionClass == null || classOfT == null ) { return null ; } try { // reflectively instantiate the target collection type using the default constructor
Constructor < ? > constructor = collectionClass . getConstructor ( ) ; X collection = ( X ) constructor . newInstance ( ) ; // cheat by not instantiating a Para... |
public class StandardJdbcProcessor { public Object [ ] executeMultiplePreparedStatements ( String [ ] statements , Collection inParams ) throws SQLException { } } | Object [ ] result ; if ( statements . length == inParams . size ( ) ) { result = new Object [ inParams . size ( ) ] ; Connection conn = null ; conn = dataSource . getConnection ( ) ; conn . setAutoCommit ( false ) ; try { Iterator inParamsIt = inParams . iterator ( ) ; int count = 0 ; while ( inParamsIt . hasNext ( ) )... |
public class CrossmapActivity { /** * Invokes the builder object for creating new output variable value . */
protected void runScript ( String mapperScript , Slurper slurper , Builder builder ) throws ActivityException , TransformerException { } } | CompilerConfiguration compilerConfig = new CompilerConfiguration ( ) ; compilerConfig . setScriptBaseClass ( CrossmapScript . class . getName ( ) ) ; Binding binding = new Binding ( ) ; binding . setVariable ( "runtimeContext" , getRuntimeContext ( ) ) ; binding . setVariable ( slurper . getName ( ) , slurper . getInpu... |
public class ArduinoLibraryInstaller { /** * Copies the library from the packaged version into the installation directory .
* @ param libraryName the library to copy
* @ throws IOException if the copy could not complete . */
public void copyLibraryFromPackage ( String libraryName ) throws IOException { } } | Path ardDir = getArduinoDirectory ( ) . orElseThrow ( IOException :: new ) ; Path source = Paths . get ( embeddedDirectory ) . resolve ( libraryName ) ; Path dest = ardDir . resolve ( "libraries/" + libraryName ) ; if ( ! Files . exists ( dest ) ) { Files . createDirectory ( dest ) ; } Path gitRepoDir = dest . resolve ... |
public class LogFaxClientSpiInterceptor { /** * This function logs the event .
* @ param eventType
* The event type
* @ param method
* The method invoked
* @ param arguments
* The method arguments
* @ param output
* The method output
* @ param throwable
* The throwable while invoking the method */
p... | // init log data
int amount = 3 ; int argumentsAmount = 0 ; if ( arguments != null ) { argumentsAmount = arguments . length ; } if ( eventType == FaxClientSpiProxyEventType . POST_EVENT_TYPE ) { amount = amount + 2 ; } Object [ ] logData = new Object [ amount + argumentsAmount ] ; // set log data values
switch ( eventT... |
public class AdapterUtil { /** * Create an XAException with a translated error message and an XA error code .
* The XAException constructors provided by the XAException API allow only for either an
* error message or an XA error code to be specified . This method constructs an
* XAException with both . The error ... | XAException xaX = new XAException ( args == null ? getNLSMessage ( key ) : getNLSMessage ( key , args ) ) ; xaX . errorCode = xaErrorCode ; return xaX ; |
public class SimpleDialog { /** * Sets the text color , size , style of the message view from the specified TextAppearance resource .
* @ param resId The resourceId value .
* @ return The SimpleDialog for chaining methods . */
public SimpleDialog messageTextAppearance ( int resId ) { } } | if ( mMessageTextAppearanceId != resId ) { mMessageTextAppearanceId = resId ; if ( mMessage != null ) mMessage . setTextAppearance ( getContext ( ) , mMessageTextAppearanceId ) ; } return this ; |
public class ProtoUtils { /** * Returns the expected javascript package for protos based on the . proto file . */
private static String getJsPackage ( FileDescriptor file ) { } } | String protoPackage = file . getPackage ( ) ; if ( ! protoPackage . isEmpty ( ) ) { return "proto." + protoPackage ; } return "proto" ; |
public class AbstractResultSetWrapper { /** * { @ inheritDoc }
* @ see java . sql . ResultSet # updateBlob ( int , java . sql . Blob ) */
@ Override public void updateBlob ( final int columnIndex , final Blob x ) throws SQLException { } } | wrapped . updateBlob ( columnIndex , x ) ; |
public class ZWaveWakeUpCommandClass { /** * Event handler for incoming Z - Wave events . We monitor Z - Wave events for completed
* transactions . Once a transaction is completed for the WAKE _ UP _ NO _ MORE _ INFORMATION
* event , we set the node state to asleep .
* { @ inheritDoc } */
@ Override public void Z... | if ( event . getEventType ( ) != ZWaveEvent . ZWaveEventType . TRANSACTION_COMPLETED_EVENT ) return ; SerialMessage serialMessage = ( SerialMessage ) event . getEventValue ( ) ; if ( serialMessage . getMessageClass ( ) != SerialMessage . SerialMessageClass . SendData && serialMessage . getMessageType ( ) != SerialMessa... |
public class JDBDT { /** * Create a new database handle for given database
* URL , user and password .
* < p > Calling this method is shorthand for : < br >
* & nbsp ; & nbsp ; & nbsp ; & nbsp ;
* < code > database ( DriverManager . getConnection ( url , user , password ) ) < / code > .
* @ param url Database... | return database ( DriverManager . getConnection ( url , user , password ) ) ; |
public class LogImpl { /** * Add a Log Sink .
* @ param logSinkClass The logsink classname or null for the default . */
public synchronized void add ( String logSinkClass ) { } } | try { if ( logSinkClass == null || logSinkClass . length ( ) == 0 ) logSinkClass = "org.browsermob.proxy.jetty.log.OutputStreamLogSink" ; Class sinkClass = Loader . loadClass ( this . getClass ( ) , logSinkClass ) ; LogSink sink = ( LogSink ) sinkClass . newInstance ( ) ; add ( sink ) ; } catch ( Exception e ) { messag... |
public class SoapServerFaultResponseActionBuilder { /** * Sets the response status .
* @ param status
* @ return */
public SoapServerFaultResponseActionBuilder status ( HttpStatus status ) { } } | soapMessage . header ( SoapMessageHeaders . HTTP_STATUS_CODE , status . value ( ) ) ; return this ; |
public class X509CRLImpl { /** * return the AuthorityKeyIdentifier , if any .
* @ returns AuthorityKeyIdentifier or null
* ( if no AuthorityKeyIdentifierExtension )
* @ throws IOException on error */
public KeyIdentifier getAuthKeyId ( ) throws IOException { } } | AuthorityKeyIdentifierExtension aki = getAuthKeyIdExtension ( ) ; if ( aki != null ) { KeyIdentifier keyId = ( KeyIdentifier ) aki . get ( AuthorityKeyIdentifierExtension . KEY_ID ) ; return keyId ; } else { return null ; } |
public class JSError { /** * Creates a JSError with no source information
* @ param type The DiagnosticType
* @ param arguments Arguments to be incorporated into the message */
public static JSError make ( DiagnosticType type , String ... arguments ) { } } | return new JSError ( null , null , - 1 , - 1 , type , null , arguments ) ; |
public class FilterBasedTriggeringPolicy { /** * Add a filter to end of the filter list .
* @ param newFilter filter to add to end of list . */
public void addFilter ( final Filter newFilter ) { } } | if ( headFilter == null ) { headFilter = newFilter ; tailFilter = newFilter ; } else { tailFilter . next = newFilter ; tailFilter = newFilter ; } |
public class PeerGroup { /** * Convenience for connecting only to peers that can serve specific services . It will configure suitable peer
* discoveries .
* @ param requiredServices Required services as a bitmask , e . g . { @ link VersionMessage # NODE _ NETWORK } . */
public void setRequiredServices ( long requir... | lock . lock ( ) ; try { this . requiredServices = requiredServices ; peerDiscoverers . clear ( ) ; addPeerDiscovery ( MultiplexingDiscovery . forServices ( params , requiredServices ) ) ; } finally { lock . unlock ( ) ; } |
public class Messages { /** * Looks for a property / message in < code > activejdbc _ messages < / code > bundle .
* @ param key key of the property .
* @ param params list of substitution parameters for a message .
* @ return message merged with parameters ( if provided ) , or key if message not found . */
publi... | return message ( key , null , params ) ; |
public class DataUtil { /** * little - endian or intel format . */
public static byte [ ] getBytesLittleEndian ( long value ) { } } | byte [ ] b = new byte [ 8 ] ; b [ 0 ] = ( byte ) ( value & 0xFF ) ; b [ 1 ] = ( byte ) ( ( value >> 8 ) & 0xFF ) ; b [ 2 ] = ( byte ) ( ( value >> 16 ) & 0xFF ) ; b [ 3 ] = ( byte ) ( ( value >> 24 ) & 0xFF ) ; b [ 4 ] = ( byte ) ( ( value >> 32 ) & 0xFF ) ; b [ 5 ] = ( byte ) ( ( value >> 40 ) & 0xFF ) ; b [ 6 ] = ( b... |
public class JCusolverSp { /** * < pre >
* - - - - - CPU least square solver by QR factorization
* solve min | b - A * x |
* [ lsq ] stands for least square
* [ v ] stands for vector
* [ qr ] stands for QR factorization
* < / pre > */
public static int cusolverSpScsrlsqvqrHost ( cusolverSpHandle handle , in... | return checkResult ( cusolverSpScsrlsqvqrHostNative ( handle , m , n , nnz , descrA , csrValA , csrRowPtrA , csrColIndA , b , tol , rankA , x , p , min_norm ) ) ; |
public class InstanceResource { /** * Handles cancellation of leases for this particular instance .
* @ param isReplication
* a header parameter containing information whether this is
* replicated from other nodes .
* @ return response indicating whether the operation was a success or
* failure . */
@ DELETE ... | try { boolean isSuccess = registry . cancel ( app . getName ( ) , id , "true" . equals ( isReplication ) ) ; if ( isSuccess ) { logger . debug ( "Found (Cancel): {} - {}" , app . getName ( ) , id ) ; return Response . ok ( ) . build ( ) ; } else { logger . info ( "Not Found (Cancel): {} - {}" , app . getName ( ) , id )... |
public class AnimaQuery { /** * Querying a List < Map >
* @ param sql sql statement
* @ param params params
* @ return List < Map > */
public List < Map < String , Object > > queryListMap ( String sql , Object [ ] params ) { } } | Connection conn = getConn ( ) ; try { return conn . createQuery ( sql ) . withParams ( params ) . setAutoDeriveColumnNames ( true ) . throwOnMappingFailure ( false ) . executeAndFetchTable ( ) . asList ( ) ; } finally { this . closeConn ( conn ) ; this . clean ( null ) ; } |
public class CPDefinitionUtil { /** * Returns the first cp definition in the ordered set where groupId = & # 63 ; .
* @ param groupId the group ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching cp definition , or < code > null <... | return getPersistence ( ) . fetchByGroupId_First ( groupId , orderByComparator ) ; |
public class OperatorFactory { /** * Get operator instance for requested opcode .
* @ param opcode requested operator opcode .
* @ return operator instance .
* @ throws TemplateException if operator is not implemented . */
@ SuppressWarnings ( "unchecked" ) public < T extends Operator > T geInstance ( Opcode opco... | Operator operator = this . operators . get ( opcode ) ; if ( operator == null ) { throw new TemplateException ( "Operator |%s| is not implemented." , opcode ) ; } return ( T ) operator ; |
public class DbxWebAuth { /** * Call this after the user has visited the authorizaton URL and Dropbox has redirected them
* back to you at the redirect URI .
* @ param redirectUri The original redirect URI used by { @ link # authorize } , never { @ code null } .
* @ param sessionStore Session store used by { @ li... | if ( redirectUri == null ) throw new NullPointerException ( "redirectUri" ) ; if ( sessionStore == null ) throw new NullPointerException ( "sessionStore" ) ; if ( params == null ) throw new NullPointerException ( "params" ) ; String state = getParam ( params , "state" ) ; if ( state == null ) { throw new BadRequestExce... |
public class PreparedStatement { /** * { @ inheritDoc } */
public void setBinaryStream ( final int parameterIndex , final InputStream x , final long length ) throws SQLException { } } | setBytes ( parameterIndex , createBytes ( x , length ) ) ; |
public class ColorConverter { /** * Creates a new instance of the class . Required by Log4J2.
* @ param config the configuration
* @ param options the options
* @ return a new instance , or { @ code null } if the options are invalid */
public static ColorConverter newInstance ( Configuration config , String [ ] o... | if ( options . length < 1 ) { LOGGER . error ( "Incorrect number of options on style. " + "Expected at least 1, received {}" , options . length ) ; return null ; } if ( options [ 0 ] == null ) { LOGGER . error ( "No pattern supplied on style" ) ; return null ; } PatternParser parser = PatternLayout . createPatternParse... |
public class JTATxManager { /** * Return the TransactionManager of the external app */
private TransactionManager getTransactionManager ( ) { } } | TransactionManager retval = null ; try { if ( log . isDebugEnabled ( ) ) log . debug ( "getTransactionManager called" ) ; retval = TransactionManagerFactoryFactory . instance ( ) . getTransactionManager ( ) ; } catch ( TransactionManagerFactoryException e ) { log . warn ( "Exception trying to obtain TransactionManager ... |
public class AbstractSnapshotTaskRunner { /** * A helper method that takes a json string and extracts the value of the specified
* property .
* @ param json the json string
* @ param propName the name of the property to extract
* @ param < T > The type for the value expected to be returned .
* @ return the va... | return ( T ) jsonStringToMap ( json ) . get ( propName ) ; |
public class AbstractDraweeController { /** * Removes controller listener . */
public void removeControllerListener ( ControllerListener < ? super INFO > controllerListener ) { } } | Preconditions . checkNotNull ( controllerListener ) ; if ( mControllerListener instanceof InternalForwardingListener ) { ( ( InternalForwardingListener < INFO > ) mControllerListener ) . removeListener ( controllerListener ) ; return ; } if ( mControllerListener == controllerListener ) { mControllerListener = null ; } |
public class TrialMinutesMarshaller { /** * Marshall the given parameter object . */
public void marshall ( TrialMinutes trialMinutes , ProtocolMarshaller protocolMarshaller ) { } } | if ( trialMinutes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( trialMinutes . getTotal ( ) , TOTAL_BINDING ) ; protocolMarshaller . marshall ( trialMinutes . getRemaining ( ) , REMAINING_BINDING ) ; } catch ( Exception e ) { throw new ... |
public class AmazonAppStreamWaiters { /** * Builds a FleetStopped waiter by using custom parameters waiterParameters and other parameters defined in the
* waiters specification , and then polls until it determines whether the resource entered the desired state or not ,
* where polling criteria is bound by either de... | return new WaiterBuilder < DescribeFleetsRequest , DescribeFleetsResult > ( ) . withSdkFunction ( new DescribeFleetsFunction ( client ) ) . withAcceptors ( new FleetStopped . IsINACTIVEMatcher ( ) , new FleetStopped . IsPENDING_ACTIVATEMatcher ( ) , new FleetStopped . IsACTIVEMatcher ( ) ) . withDefaultPollingStrategy ... |
public class BlockMetadataManager { /** * Modifies the size of a temp block .
* @ param tempBlockMeta the temp block to modify
* @ param newSize new size in bytes
* @ throws InvalidWorkerStateException when newSize is smaller than current size */
public void resizeTempBlockMeta ( TempBlockMeta tempBlockMeta , lon... | StorageDir dir = tempBlockMeta . getParentDir ( ) ; dir . resizeTempBlockMeta ( tempBlockMeta , newSize ) ; |
public class CSP2SourceList { /** * Add a host
* @ param aHost
* Host to add . Must be a valid URL .
* @ return this */
@ Nonnull public CSP2SourceList addHost ( @ Nonnull final ISimpleURL aHost ) { } } | ValueEnforcer . notNull ( aHost , "Host" ) ; return addHost ( aHost . getAsStringWithEncodedParameters ( ) ) ; |
public class CassandraClientBase { /** * On column .
* @ param m
* the m
* @ param isRelation
* the is relation
* @ param relations
* the relations
* @ param entities
* the entities
* @ param columns
* the columns
* @ param subManagedType
* the sub managed type
* @ param key
* the key */
pro... | if ( ! columns . isEmpty ( ) ) { Object id = PropertyAccessorHelper . getObject ( m . getIdAttribute ( ) . getJavaType ( ) , key . array ( ) ) ; ThriftRow tr = new ThriftRow ( id , m . getTableName ( ) , columns , new ArrayList < SuperColumn > ( 0 ) , new ArrayList < CounterColumn > ( 0 ) , new ArrayList < CounterSuper... |
public class NonRecycleableTaglibs { /** * collect all possible attributes given the name of methods available .
* @ param cls
* the class to look for setter methods to infer properties
* @ return the map of possible attributes / types */
private static Map < QMethod , String > getAttributes ( JavaClass cls ) { }... | Map < QMethod , String > atts = new HashMap < > ( ) ; Method [ ] methods = cls . getMethods ( ) ; for ( Method m : methods ) { String name = m . getName ( ) ; if ( name . startsWith ( "set" ) && m . isPublic ( ) && ! m . isStatic ( ) ) { String sig = m . getSignature ( ) ; List < String > args = SignatureUtils . getPar... |
public class CPDefinitionLinkPersistenceImpl { /** * Returns the cp definition link where CPDefinitionId = & # 63 ; and CProductId = & # 63 ; and type = & # 63 ; or throws a { @ link NoSuchCPDefinitionLinkException } if it could not be found .
* @ param CPDefinitionId the cp definition ID
* @ param CProductId the c... | CPDefinitionLink cpDefinitionLink = fetchByC_C_T ( CPDefinitionId , CProductId , type ) ; if ( cpDefinitionLink == null ) { StringBundler msg = new StringBundler ( 8 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "CPDefinitionId=" ) ; msg . append ( CPDefinitionId ) ; msg . append ( ", CProductId=" ) ; ... |
public class OverviewPlot { /** * Do a refresh ( when visibilities have changed ) . */
synchronized void refresh ( ) { } } | if ( reinitOnRefresh ) { LOG . debug ( "Reinitialize in thread " + Thread . currentThread ( ) . getName ( ) ) ; reinitialize ( ) ; reinitOnRefresh = false ; return ; } synchronized ( plot ) { boolean refreshcss = false ; if ( plotmap == null ) { throw new IllegalStateException ( "Plotmap is null" ) ; } final int thumbs... |
public class Threads { /** * Returns a ListeningExecutorService based off of the global ThreadFactory */
public static ListeningExecutorService executor ( ) { } } | final ExecutorService svc = Executors . newCachedThreadPool ( MoreExecutors . platformThreadFactory ( ) ) ; return MoreExecutors . listeningDecorator ( svc ) ; |
public class Position { /** * Returns a great circle bearing in degrees in the range 0 to 360.
* @ param position
* @ return */
public final double getBearingDegrees ( Position position ) { } } | double lat1 = toRadians ( lat ) ; double lat2 = toRadians ( position . lat ) ; double lon1 = toRadians ( lon ) ; double lon2 = toRadians ( position . lon ) ; double dLon = lon2 - lon1 ; double sinDLon = sin ( dLon ) ; double cosLat2 = cos ( lat2 ) ; double y = sinDLon * cosLat2 ; double x = cos ( lat1 ) * sin ( lat2 ) ... |
public class TextUtilities { /** * Converts the specified string to title case , by capitalizing the
* first letter .
* @ param str The string
* @ since jEdit 4.0pre1 */
public static String toTitleCase ( String str ) { } } | if ( str . length ( ) == 0 ) { return str ; } else { return Character . toUpperCase ( str . charAt ( 0 ) ) + str . substring ( 1 ) . toLowerCase ( ) ; } |
public class MethodBuilder { /** * Add proxy method to get unique id */
private void addGetId ( TypeSpec . Builder classBuilder ) { } } | MethodSpec . Builder methodBuilder = MethodSpec . methodBuilder ( "__getStubID" ) . addModifiers ( Modifier . PRIVATE ) . returns ( int . class ) . addStatement ( "android.os.Parcel data = android.os.Parcel.obtain()" ) . addStatement ( "android.os.Parcel reply = android.os.Parcel.obtain()" ) . addStatement ( "int resul... |
public class CodedConstant { /** * get mapped type defined java expression .
* @ param order field order
* @ param type field type
* @ param express java expression
* @ param isList is field type is a { @ link List }
* @ param isMap is field type is a { @ link Map }
* @ return full java expression */
public... | StringBuilder code = new StringBuilder ( ) ; String fieldName = getFieldName ( order ) ; if ( ( type == FieldType . STRING || type == FieldType . BYTES ) && ! isList ) { // add null check
code . append ( "com.google.protobuf.ByteString " ) . append ( fieldName ) . append ( " = null" ) . append ( CodeGenerator . JAVA_LI... |
public class ImageTransformProcess { /** * Deserialize a JSON String ( created by { @ link # toJson ( ) } ) to a ImageTransformProcess
* @ return ImageTransformProcess , from JSON */
public static ImageTransformProcess fromYaml ( String yaml ) { } } | try { return JsonMappers . getMapperYaml ( ) . readValue ( yaml , ImageTransformProcess . class ) ; } catch ( IOException e ) { // TODO better exceptions
throw new RuntimeException ( e ) ; } |
public class SARLQuickfixProvider { /** * Remove the element related to the issue , and the whitespaces before the element until one of the given
* keywords is encountered .
* @ param issue the issue .
* @ param document the document .
* @ param keyword1 the first keyword to consider .
* @ param otherKeywords... | // Skip spaces before the element
int index = issue . getOffset ( ) - 1 ; char c = document . getChar ( index ) ; while ( Character . isWhitespace ( c ) ) { index -- ; c = document . getChar ( index ) ; } // Skip non - spaces before the identifier
final StringBuffer kw = new StringBuffer ( ) ; while ( ! Character . isW... |
public class BusItinerary { /** * Replies the distance between two bus halt .
* @ param firsthaltIndex is the index of the first bus halt .
* @ param lasthaltIndex is the index of the last bus halt .
* @ return the distance in meters between the given bus halts . */
@ Pure public double getDistanceBetweenBusHalts... | if ( firsthaltIndex < 0 || firsthaltIndex >= this . validHalts . size ( ) - 1 ) { throw new ArrayIndexOutOfBoundsException ( firsthaltIndex ) ; } if ( lasthaltIndex <= firsthaltIndex || lasthaltIndex >= this . validHalts . size ( ) ) { throw new ArrayIndexOutOfBoundsException ( lasthaltIndex ) ; } double length = 0 ; f... |
public class PositionDecoder { /** * Shortcut for live decoding ; no reasonableness check on distance to receiver
* @ param reference used for reasonableness test and to decide which of the four resulting positions of the CPR algorithm is the right one
* @ param msg airborne position message
* @ return WGS84 coor... | return decodePosition ( System . currentTimeMillis ( ) / 1000.0 , msg , reference ) ; |
public class RegexHashMap { /** * checks whether a specific value is container within either container or cache */
public boolean containsValue ( Object value ) { } } | // the value is a direct hit from our cache
if ( cache . containsValue ( value ) ) return true ; // the value is a direct hit from our hashmap
if ( container . containsValue ( value ) ) return true ; // otherwise , the value isn ' t within this object
return false ; |
public class CaptureStreamHandler { /** * Runs an executable and captures the output in a String array
* @ param cmdline
* command line arguments
* @ return output of process
* @ see CaptureStreamHandler # getOutput ( ) */
public static String [ ] run ( final String [ ] cmdline ) { } } | final CaptureStreamHandler handler = execute ( cmdline ) ; return handler . getOutput ( ) != null ? handler . getOutput ( ) : new String [ 0 ] ; |
public class SeaGlassViewportUI { /** * Invokes the specified getter method if it exists .
* @ param obj
* The object on which to invoke the method .
* @ param methodName
* The name of the method .
* @ param defaultValue
* This value is returned , if the method does not exist .
* @ return The value return... | try { Method method = obj . getClass ( ) . getMethod ( methodName , new Class [ 0 ] ) ; Object result = method . invoke ( obj , new Object [ 0 ] ) ; return result ; } catch ( NoSuchMethodException e ) { return defaultValue ; } catch ( IllegalAccessException e ) { return defaultValue ; } catch ( InvocationTargetExceptio... |
public class AccessControlFinder { /** * - - - - - window management */
public void openWindow ( final String title , final int width , final int height , final IsWidget content ) { } } | closeWindow ( ) ; window = new DefaultWindow ( title ) ; window . setWidth ( 480 ) ; window . setHeight ( 360 ) ; window . trapWidget ( content . asWidget ( ) ) ; window . setGlassEnabled ( true ) ; window . center ( ) ; |
public class Vector4d { /** * Read this vector from the supplied { @ link ByteBuffer } starting at the specified
* absolute buffer position / index .
* This method will not increment the position of the given ByteBuffer .
* @ param index
* the absolute position into the ByteBuffer
* @ param buffer
* values ... | MemUtil . INSTANCE . get ( this , index , buffer ) ; return this ; |
public class Task { /** * { @ inheritDoc } */
@ Override public Object getCurrentValue ( FieldType field ) { } } | Object result = null ; if ( field != null ) { switch ( ( TaskField ) field ) { case PARENT_TASK_UNIQUE_ID : { result = m_parent == null ? Integer . valueOf ( - 1 ) : m_parent . getUniqueID ( ) ; break ; } case START_VARIANCE : { result = getStartVariance ( ) ; break ; } case FINISH_VARIANCE : { result = getFinishVarian... |
public class Criteria { /** * Checks whether the property specified is supported by this { @ code Criteria } object .
* @ param property
* the property
* @ return true , if the property is supported */
public final boolean appliesTo ( final URI property ) { } } | if ( this . properties . isEmpty ( ) || this . properties . contains ( property ) ) { return true ; } Preconditions . checkNotNull ( property ) ; return false ; |
public class JsHdrsImpl { /** * Clear the fingerprint list from the message .
* Javadoc description supplied by JsMessage interface . */
public void clearFingerprints ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "clearFingerprints" ) ; getHdr2 ( ) . setChoiceField ( JsHdr2Access . FINGERPRINTS , JsHdr2Access . IS_FINGERPRINTS_EMPTY ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( t... |
public class ResourceConverter { /** * Sets an id attribute value to a target object .
* @ param target target POJO
* @ param idValue id node
* @ throws IllegalAccessException thrown in case target field is not accessible */
private void setIdValue ( Object target , JsonNode idValue ) throws IllegalAccessExceptio... | Field idField = configuration . getIdField ( target . getClass ( ) ) ; ResourceIdHandler idHandler = configuration . getIdHandler ( target . getClass ( ) ) ; if ( idValue != null ) { idField . set ( target , idHandler . fromString ( idValue . asText ( ) ) ) ; } |
public class ViewHolder { /** * Obtain instance based on passed < code > view < / code > .
* Newly created instance of < code > ViewHolder < / code > will be saved as a tag for passed < code > view < / code > .
* Make sure the method { @ link View # setTag ( Object ) } won ' t be invoked from other scopes .
* @ p... | if ( view . getTag ( ) instanceof ViewHolder ) { return ( ViewHolder ) view . getTag ( ) ; } return new ViewHolder ( view ) ; |
public class MediaServicesInner { /** * Lists the keys for a Media Service .
* @ param resourceGroupName Name of the resource group within the Azure subscription .
* @ param mediaServiceName Name of the Media Service .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .... | return ServiceFuture . fromResponse ( listKeysWithServiceResponseAsync ( resourceGroupName , mediaServiceName ) , serviceCallback ) ; |
public class HeapDisk { /** * Allocates the given number of blocks and adds them to the given file . */
public synchronized void allocate ( RegularFile file , int count ) throws IOException { } } | int newAllocatedBlockCount = allocatedBlockCount + count ; if ( newAllocatedBlockCount > maxBlockCount ) { throw new IOException ( "out of disk space" ) ; } int newBlocksNeeded = Math . max ( count - blockCache . blockCount ( ) , 0 ) ; for ( int i = 0 ; i < newBlocksNeeded ; i ++ ) { file . addBlock ( new byte [ blockS... |
public class DropboxClient { /** * Copy file from specified source to specified target .
* @ param from source
* @ param to target
* @ return metadata of target file
* @ see Entry */
public Entry copy ( String from , String to ) { } } | OAuthRequest request = new OAuthRequest ( Verb . GET , FILE_OPS_COPY_URL ) ; request . addQuerystringParameter ( "root" , "dropbox" ) ; request . addQuerystringParameter ( "from_path" , encode ( from ) ) ; request . addQuerystringParameter ( "to_path" , encode ( to ) ) ; service . signRequest ( accessToken , request ) ... |
public class MockEC2QueryHandler { /** * Handles " authorizeSecurityGroupIngress " request to SecurityGroup and returns response with a SecurityGroup .
* @ param groupId group Id for SecurityGroup .
* @ param ipProtocol Ip protocol Name .
* @ param fromPort from port ranges .
* @ param toPort to port ranges .
... | AuthorizeSecurityGroupIngressResponseType ret = new AuthorizeSecurityGroupIngressResponseType ( ) ; ret . setRequestId ( UUID . randomUUID ( ) . toString ( ) ) ; mockSecurityGroupController . authorizeSecurityGroupIngress ( groupId , ipProtocol , fromPort , toPort , cidrIp ) ; return ret ; |
public class RequestHelper { /** * Get the session ID of the passed string ( like in
* " test . html ; JSESSIONID = 1234 " ) . < br >
* Attention : this methods does not consider eventually present request
* parameters . If parameters are present , they must be stripped away
* explicitly !
* @ param aURL
* ... | ValueEnforcer . notNull ( aURL , "URL" ) ; // Ignore everything except the path
return getSessionID ( aURL . getPath ( ) ) ; |
public class CpeMemoryIndex { /** * Searches the index using the given search string .
* @ param searchString the query text
* @ param maxQueryResults the maximum number of documents to return
* @ return the TopDocs found by the search
* @ throws ParseException thrown when the searchString is invalid
* @ thro... | final Query query = parseQuery ( searchString ) ; return search ( query , maxQueryResults ) ; |
public class AbstractRunMojo { /** * Log a warning indicating that fork mode has been explicitly disabled while some
* conditions are present that require to enable it .
* @ see # enableForkByDefault ( ) */
protected void logDisabledFork ( ) { } } | if ( getLog ( ) . isWarnEnabled ( ) ) { if ( hasAgent ( ) ) { getLog ( ) . warn ( "Fork mode disabled, ignoring agent" ) ; } if ( hasJvmArgs ( ) ) { RunArguments runArguments = resolveJvmArguments ( ) ; getLog ( ) . warn ( "Fork mode disabled, ignoring JVM argument(s) [" + Arrays . stream ( runArguments . asArray ( ) )... |
public class ExampleConverterPlugin { /** * Returns a { @ link HasInputStream } as a lazy way to wrap an input stream with a base64 encode / decode stream
* @ param hasResourceStream source
* @ param doEncode true to encode
* @ return lazy stream */
private static HasInputStream wrap ( final HasInputStream hasRes... | return new HasInputStream ( ) { @ Override public InputStream getInputStream ( ) throws IOException { return new Base64InputStream ( hasResourceStream . getInputStream ( ) , doEncode ) ; } @ Override public long writeContent ( OutputStream outputStream ) throws IOException { Base64OutputStream codec = new Base64OutputS... |
public class CommandReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return Command ResourceSet */
@ Override public ResourceSet < Command > read ( final TwilioRestClient client ) { } } | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class Widgets { /** * Makes the supplied widget " actionable " which means adding the " actionLabel " style to it and
* binding the supplied click handler .
* @ param enabled an optional value that governs the enabled state of the target . When the
* value becomes false , the target ' s click handler and "... | if ( onClick != null ) { if ( enabled != null ) { enabled . addListenerAndTrigger ( new Value . Listener < Boolean > ( ) { public void valueChanged ( Boolean enabled ) { if ( ! enabled && _regi != null ) { _regi . removeHandler ( ) ; _regi = null ; target . removeStyleName ( "actionLabel" ) ; } else if ( enabled && _re... |
public class LogBridge { /** * Utility method to reduce unchecked area . */
@ SuppressWarnings ( "unchecked" ) private static Enumeration < LogEntry > getLogEntries ( LogReaderService lrs ) { } } | return ( Enumeration < LogEntry > ) lrs . getLog ( ) ; |
public class LeaseManager { /** * Remove the specified lease and src . */
synchronized LeaseOpenTime removeLease ( Lease lease , String src ) { } } | LeaseOpenTime leaseOpenTime = sortedLeasesByPath . remove ( src ) ; if ( ! lease . removePath ( src ) ) { LOG . error ( src + " not found in lease.paths (=" + lease . paths + ")" ) ; } if ( ! lease . hasPath ( ) ) { leases . remove ( lease . holder ) ; if ( ! sortedLeases . remove ( lease ) ) { LOG . error ( lease + " ... |
public class RequestHandler { /** * Helper method to dispatch the incoming { @ link CouchbaseRequest } to one or more nodes .
* @ param request the request to dispatch . */
private void dispatchRequest ( final CouchbaseRequest request ) { } } | RingBufferMonitor . instance ( ) . removeRequest ( request ) ; ClusterConfig config = configuration ; // prevent non - bootstrap requests to go through if bucket not part of config
if ( ! ( request instanceof BootstrapMessage ) ) { BucketConfig bucketConfig = config == null ? null : config . bucketConfig ( request . bu... |
public class RoseWebAppContext { /** * 如果配置文件没有自定义的messageSource定义 , 则由Rose根据最佳实践进行预设 */
public static void registerMessageSourceIfNecessary ( BeanDefinitionRegistry registry , String [ ] messageBaseNames ) { } } | if ( ! registry . containsBeanDefinition ( MESSAGE_SOURCE_BEAN_NAME ) ) { GenericBeanDefinition messageSource = new GenericBeanDefinition ( ) ; messageSource . setBeanClass ( ReloadableResourceBundleMessageSource . class ) ; MutablePropertyValues propertyValues = new MutablePropertyValues ( ) ; propertyValues . addProp... |
public class Config { /** * Retrieves a configuration value with the given key constant ( e . g . Key . APPLICATION _ NAME )
* @ param key The key of the configuration value ( e . g . application . name )
* @ param defaultValue The default value to return of no key is found
* @ return The configured value as Stri... | return getString ( key . toString ( ) , defaultValue ) ; |
public class RequestContext { /** * Returns the identifier of the logged in user . If the user hasn ' t logged in , returns
* < code > null < / code > .
* @ return The identifier of the logged in user , or < code > null < / code > if the user hasn ' t logged in */
public Long getLoggedUserId ( ) { } } | HttpSession session = getRequest ( ) . getSession ( false ) ; return session == null ? null : ( Long ) session . getAttribute ( "loggedUserId" ) ; |
public class QueryParamsMap { /** * loads keys
* @ param key the key
* @ param value the values */
protected final void loadKeys ( String key , String [ ] value ) { } } | String [ ] parsed = parseKey ( key ) ; if ( parsed == null ) { return ; } if ( ! queryMap . containsKey ( parsed [ 0 ] ) ) { queryMap . put ( parsed [ 0 ] , new QueryParamsMap ( ) ) ; } if ( ! parsed [ 1 ] . isEmpty ( ) ) { queryMap . get ( parsed [ 0 ] ) . loadKeys ( parsed [ 1 ] , value ) ; } else { queryMap . get ( ... |
public class BaseGraph { /** * Initializes the node area with the empty edge value and default additional value . */
void initNodeRefs ( long oldCapacity , long newCapacity ) { } } | for ( long pointer = oldCapacity + N_EDGE_REF ; pointer < newCapacity ; pointer += nodeEntryBytes ) { nodes . setInt ( pointer , EdgeIterator . NO_EDGE ) ; } if ( extStorage . isRequireNodeField ( ) ) { for ( long pointer = oldCapacity + N_ADDITIONAL ; pointer < newCapacity ; pointer += nodeEntryBytes ) { nodes . setIn... |
public class NamespacesInner { /** * The Get Operation Status operation returns the status of the specified operation . After calling an asynchronous operation , you can call Get Operation Status to determine whether the operation has succeeded , failed , or is still in progress .
* @ param operationStatusLink Locati... | if ( operationStatusLink == null ) { throw new IllegalArgumentException ( "Parameter operationStatusLink is required and cannot be null." ) ; } return service . getLongRunningOperationStatus ( operationStatusLink , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < R... |
public class Murmur3Hash32 { /** * Special - purpose version for hashing a single int value . Value is treated as little - endian */
public static int hash ( int input ) { } } | int k1 = mixK1 ( input ) ; int h1 = mixH1 ( DEFAULT_SEED , k1 ) ; return fmix ( h1 , SizeOf . SIZE_OF_INT ) ; |
public class ZFSInstaller { /** * Called from the management screen . */
@ RequirePOST public HttpResponse doAct ( StaplerRequest req ) throws ServletException , IOException { } } | Jenkins . getInstance ( ) . checkPermission ( Jenkins . ADMINISTER ) ; if ( req . hasParameter ( "n" ) ) { // we ' ll shut up
disable ( true ) ; return HttpResponses . redirectViaContextPath ( "/manage" ) ; } return new HttpRedirect ( "confirm" ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.