signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DescribePendingAggregationRequestsResult { /** * Returns a PendingAggregationRequests object . * @ return Returns a PendingAggregationRequests object . */ public java . util . List < PendingAggregationRequest > getPendingAggregationRequests ( ) { } }
if ( pendingAggregationRequests == null ) { pendingAggregationRequests = new com . amazonaws . internal . SdkInternalList < PendingAggregationRequest > ( ) ; } return pendingAggregationRequests ;
public class JdonPicoContainer { /** * { @ inheritDoc } This method can be used to override the ComponentAdapter * created by the { @ link ComponentAdapterFactory } passed to the constructor * of this container . */ public ComponentAdapter registerComponent ( ComponentAdapter componentAdapter ) throws DuplicateComponentKeyRegistrationException { } }
Object componentKey = componentAdapter . getComponentKey ( ) ; if ( compKeyAdapters . containsKey ( componentKey ) ) { throw new DuplicateComponentKeyRegistrationException ( componentKey ) ; } compAdapters . add ( componentAdapter ) ; compKeyAdapters . put ( componentKey , componentAdapter ) ; return componentAdapter ;
public class StringToObjectConverter { /** * Convert an array */ private Object convertToArray ( String pType , String pValue ) { } }
// It ' s an array String t = pType . substring ( 1 , 2 ) ; Class valueType ; if ( t . equals ( "L" ) ) { // It ' s an object - type String oType = pType . substring ( 2 , pType . length ( ) - 1 ) . replace ( '/' , '.' ) ; valueType = ClassUtil . classForName ( oType ) ; if ( valueType == null ) { throw new IllegalArgumentException ( "No class of type " + oType + "found" ) ; } } else { valueType = TYPE_SIGNATURE_MAP . get ( t ) ; if ( valueType == null ) { throw new IllegalArgumentException ( "Cannot convert to unknown array type " + t ) ; } } String [ ] values = EscapeUtil . splitAsArray ( pValue , EscapeUtil . PATH_ESCAPE , "," ) ; Object ret = Array . newInstance ( valueType , values . length ) ; int i = 0 ; for ( String value : values ) { Array . set ( ret , i ++ , value . equals ( "[null]" ) ? null : convertFromString ( valueType . getCanonicalName ( ) , value ) ) ; } return ret ;
public class SQLSelect { /** * Appends a selected column < code > _ name < / code > for given * < code > _ tableIndex < / code > . * @ param _ tableIndex index of the table * @ param _ columnName name of the column * @ return this SQL select statement * @ see # columns */ public SQLSelect column ( final int _tableIndex , final String _columnName ) { } }
columns . add ( new Column ( tablePrefix , _tableIndex , _columnName ) ) ; return this ;
public class TrainingsImpl { /** * Delete images from the set of training images . * @ param projectId The project id * @ param imageIds Ids of the images to be deleted . Limted to 256 images per batch * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < Void > deleteImagesAsync ( UUID projectId , List < String > imageIds , final ServiceCallback < Void > serviceCallback ) { } }
return ServiceFuture . fromResponse ( deleteImagesWithServiceResponseAsync ( projectId , imageIds ) , serviceCallback ) ;
public class QueryAtomContainer { /** * Grows the lone pair array by a given size . * @ see # growArraySize */ private void growLonePairArray ( ) { } }
growArraySize = ( lonePairs . length < growArraySize ) ? growArraySize : lonePairs . length ; ILonePair [ ] newLonePairs = new ILonePair [ lonePairs . length + growArraySize ] ; System . arraycopy ( lonePairs , 0 , newLonePairs , 0 , lonePairs . length ) ; lonePairs = newLonePairs ;
public class AmazonAlexaForBusinessClient { /** * Associates a contact with a given address book . * @ param associateContactWithAddressBookRequest * @ return Result of the AssociateContactWithAddressBook operation returned by the service . * @ throws LimitExceededException * You are performing an action that would put you beyond your account ' s limits . * @ sample AmazonAlexaForBusiness . AssociateContactWithAddressBook * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / alexaforbusiness - 2017-11-09 / AssociateContactWithAddressBook " * target = " _ top " > AWS API Documentation < / a > */ @ Override public AssociateContactWithAddressBookResult associateContactWithAddressBook ( AssociateContactWithAddressBookRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeAssociateContactWithAddressBook ( request ) ;
public class FileUtils { /** * Get the relative path of an application * @ param root the root to relativize against * @ param path the path to relativize * @ return the relative path */ public static String getRelativePathName ( Path root , Path path ) { } }
Path relative = root . relativize ( path ) ; return Files . isDirectory ( path ) && ! relative . toString ( ) . endsWith ( "/" ) ? String . format ( "%s/" , relative . toString ( ) ) : relative . toString ( ) ;
public class HBasePanel { /** * Process all the submitted params . * @ param out The Html output stream . * @ exception DBException File exception . */ public void processInputData ( PrintWriter out ) throws DBException { } }
String strMoveValue = this . getProperty ( DBParams . COMMAND ) ; // Display record if ( strMoveValue == null ) strMoveValue = Constants . BLANK ; String strError = this . getTask ( ) . getLastError ( 0 ) ; if ( ( strError != null ) && ( strError . length ( ) > 0 ) ) strError = strError + " on " + strMoveValue ; if ( ( strError != null ) && ( strError . length ( ) > 0 ) ) { out . println ( "<span class=\"error\">Error: " + strError + "</span><br />" ) ; Record record = ( ( BasePanel ) this . getScreenField ( ) ) . getMainRecord ( ) ; if ( record != null ) record . setEditMode ( Constants . EDIT_NONE ) ; // Make sure this isn ' t updated on screen free } else { String strMessage = this . getTask ( ) . getStatusText ( DBConstants . INFORMATION_MESSAGE ) ; if ( strMessage != null ) if ( strMoveValue . length ( ) > 0 ) if ( ( strMessage . length ( ) > 0 ) && ( ! ( this . getScreenField ( ) instanceof BaseGridScreen ) ) ) // TODO localize out . println ( "<span class=\"information\">" + strMessage + "</span><br />" ) ; }
public class JcrNodeType { /** * Returns whether this node type is in conflict with the provided primary node type or mixin types . * A node type is in conflict with another set of node types if either of the following is true : * < ol > * < li > This node type has the same name as any of the other node types < / li > * < li > This node type defines a property ( or inherits the definition of a property ) with the same name as a property defined * in any of the other node types < i > unless < / i > this node type and the other node type both inherited the property definition * from the same ancestor node type < / li > * < li > This node type defines a child node ( or inherits the definition of a child node ) with the same name as a child node * defined in any of the other node types < i > unless < / i > this node type and the other node type both inherited the child node * definition from the same ancestor node type < / li > * < / ol > * @ param primaryNodeType the primary node type to check * @ param mixinNodeTypes the mixin node types to check * @ return true if this node type conflicts with the provided primary or mixin node types as defined below */ final boolean conflictsWith ( NodeType primaryNodeType , NodeType [ ] mixinNodeTypes ) { } }
Map < PropertyDefinitionId , JcrPropertyDefinition > props = new HashMap < PropertyDefinitionId , JcrPropertyDefinition > ( ) ; /* * Need to have the same parent name for all PropertyDefinitionIds and NodeDefinitionIds as we ' re checking for conflicts on the definition name */ final Name DEFAULT_NAME = this . name ; for ( JcrPropertyDefinition property : propertyDefinitions ( ) ) { /* * I ' m trying really hard to reuse existing code , but it ' s a stretch in this case . I don ' t care about the property * types or where they were declared . . . if more than one definition with the given name exists ( not counting definitions * inherited from the same root definition ) , then there is a conflict . */ PropertyDefinitionId pid = new PropertyDefinitionId ( DEFAULT_NAME , property . name , PropertyType . UNDEFINED , property . isMultiple ( ) ) ; props . put ( pid , property ) ; } /* * The specification does not mandate whether this should or should not be consider a conflict . However , the Apache * TCK canRemoveMixin test cases assume that this will generate a conflict . */ if ( primaryNodeType . getName ( ) . equals ( getName ( ) ) ) { // This node type has already been applied to the node return true ; } for ( JcrPropertyDefinition property : ( ( JcrNodeType ) primaryNodeType ) . propertyDefinitions ( ) ) { PropertyDefinitionId pid = new PropertyDefinitionId ( DEFAULT_NAME , property . name , PropertyType . UNDEFINED , property . isMultiple ( ) ) ; JcrPropertyDefinition oldProp = props . put ( pid , property ) ; if ( oldProp != null ) { String oldPropTypeName = oldProp . getDeclaringNodeType ( ) . getName ( ) ; String propTypeName = property . getDeclaringNodeType ( ) . getName ( ) ; if ( ! oldPropTypeName . equals ( propTypeName ) ) { // The two types conflict as both separately declare a property with the same name return true ; } } } for ( NodeType mixinNodeType : mixinNodeTypes ) { /* * The specification does not mandate whether this should or should not be consider a conflict . However , the Apache * TCK canRemoveMixin test cases assume that this will generate a conflict . */ if ( mixinNodeType . getName ( ) . equals ( getName ( ) ) ) { // This node type has already been applied to the node return true ; } for ( JcrPropertyDefinition property : ( ( JcrNodeType ) mixinNodeType ) . propertyDefinitions ( ) ) { PropertyDefinitionId pid = new PropertyDefinitionId ( DEFAULT_NAME , property . name , PropertyType . UNDEFINED , property . isMultiple ( ) ) ; JcrPropertyDefinition oldProp = props . put ( pid , property ) ; if ( oldProp != null ) { String oldPropTypeName = oldProp . getDeclaringNodeType ( ) . getName ( ) ; String propTypeName = property . getDeclaringNodeType ( ) . getName ( ) ; if ( ! oldPropTypeName . equals ( propTypeName ) ) { // The two types conflict as both separately declare a property with the same name return true ; } } } } Map < NodeDefinitionId , JcrNodeDefinition > childNodes = new HashMap < NodeDefinitionId , JcrNodeDefinition > ( ) ; for ( JcrNodeDefinition childNode : childNodeDefinitions ( ) ) { NodeDefinitionId nid = new NodeDefinitionId ( DEFAULT_NAME , childNode . name , new Name [ 0 ] ) ; childNodes . put ( nid , childNode ) ; } for ( JcrNodeDefinition childNode : ( ( JcrNodeType ) primaryNodeType ) . childNodeDefinitions ( ) ) { NodeDefinitionId nid = new NodeDefinitionId ( DEFAULT_NAME , childNode . name , new Name [ 0 ] ) ; JcrNodeDefinition oldNode = childNodes . put ( nid , childNode ) ; if ( oldNode != null ) { String oldNodeTypeName = oldNode . getDeclaringNodeType ( ) . getName ( ) ; String childNodeTypeName = childNode . getDeclaringNodeType ( ) . getName ( ) ; if ( ! oldNodeTypeName . equals ( childNodeTypeName ) ) { // The two types conflict as both separately declare a child node with the same name return true ; } } } for ( NodeType mixinNodeType : mixinNodeTypes ) { for ( JcrNodeDefinition childNode : ( ( JcrNodeType ) mixinNodeType ) . childNodeDefinitions ( ) ) { NodeDefinitionId nid = new NodeDefinitionId ( DEFAULT_NAME , childNode . name , new Name [ 0 ] ) ; JcrNodeDefinition oldNode = childNodes . put ( nid , childNode ) ; if ( oldNode != null ) { String oldNodeTypeName = oldNode . getDeclaringNodeType ( ) . getName ( ) ; String childNodeTypeName = childNode . getDeclaringNodeType ( ) . getName ( ) ; if ( ! oldNodeTypeName . equals ( childNodeTypeName ) ) { // The two types conflict as both separately declare a child node with the same name return true ; } } } } return false ;
public class MessageProcessorMatching { /** * Remove a target from the MatchSpace * @ param key the identity of the target to remove ( established at addTarget time ) * @ exception MatchingException if key undefined or on serious error */ public void removeTarget ( Object key ) throws MatchingException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeTarget" , new Object [ ] { key } ) ; // Remove from the HashMap , with synch , there may be other accessors synchronized ( _targets ) { Target targ = ( Target ) _targets . get ( key ) ; if ( targ == null ) throw new MatchingException ( ) ; for ( int i = 0 ; i < targ . targets . length ; i ++ ) _matchSpace . removeTarget ( targ . expr [ i ] , targ . targets [ i ] ) ; // Now remove the Target from the cache _targets . remove ( key ) ; // Remove from the Monitor state , with synch , there may be other accessors if ( targ . targets . length > 0 ) // Defect 417084 , check targets is non - empty { if ( targ . targets [ 0 ] instanceof MonitoredConsumer ) _consumerMonitoring . removeConsumer ( ( MonitoredConsumer ) targ . targets [ 0 ] ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeTarget" ) ;
public class RowSeq { /** * Merges data points for the same HBase row into the local object . * When executing multiple async queries simultaneously , they may call into * this method with data sets that are out of order . This may ONLY be called * after setRow ( ) has initiated the rowseq . It also allows for rows with * different salt bucket IDs to be merged into the same sequence . * @ param row The compacted HBase row to merge into this instance . * @ throws IllegalStateException if { @ link # setRow } wasn ' t called first . * @ throws IllegalArgumentException if the data points in the argument * do not belong to the same row as this RowSeq */ @ Override public void addRow ( final KeyValue row ) { } }
if ( this . key == null ) { throw new IllegalStateException ( "setRow was never called on " + this ) ; } final byte [ ] key = row . key ( ) ; if ( Bytes . memcmp ( this . key , key , Const . SALT_WIDTH ( ) , key . length - Const . SALT_WIDTH ( ) ) != 0 ) { throw new IllegalDataException ( "Attempt to add a different row=" + row + ", this=" + this ) ; } final byte [ ] remote_qual = row . qualifier ( ) ; final byte [ ] remote_val = row . value ( ) ; final byte [ ] merged_qualifiers = new byte [ qualifiers . length + remote_qual . length ] ; final byte [ ] merged_values = new byte [ values . length + remote_val . length ] ; int remote_q_index = 0 ; int local_q_index = 0 ; int merged_q_index = 0 ; int remote_v_index = 0 ; int local_v_index = 0 ; int merged_v_index = 0 ; short v_length ; short q_length ; while ( remote_q_index < remote_qual . length || local_q_index < qualifiers . length ) { // if the remote q has finished , we just need to handle left over locals if ( remote_q_index >= remote_qual . length ) { v_length = Internal . getValueLengthFromQualifier ( qualifiers , local_q_index ) ; System . arraycopy ( values , local_v_index , merged_values , merged_v_index , v_length ) ; local_v_index += v_length ; merged_v_index += v_length ; q_length = Internal . getQualifierLength ( qualifiers , local_q_index ) ; System . arraycopy ( qualifiers , local_q_index , merged_qualifiers , merged_q_index , q_length ) ; local_q_index += q_length ; merged_q_index += q_length ; continue ; } // if the local q has finished , we need to handle the left over remotes if ( local_q_index >= qualifiers . length ) { v_length = Internal . getValueLengthFromQualifier ( remote_qual , remote_q_index ) ; System . arraycopy ( remote_val , remote_v_index , merged_values , merged_v_index , v_length ) ; remote_v_index += v_length ; merged_v_index += v_length ; q_length = Internal . getQualifierLength ( remote_qual , remote_q_index ) ; System . arraycopy ( remote_qual , remote_q_index , merged_qualifiers , merged_q_index , q_length ) ; remote_q_index += q_length ; merged_q_index += q_length ; continue ; } // for dupes , we just need to skip and continue final int sort = Internal . compareQualifiers ( remote_qual , remote_q_index , qualifiers , local_q_index ) ; if ( sort == 0 ) { // LOG . debug ( " Discarding duplicate timestamp : " + // Internal . getOffsetFromQualifier ( remote _ qual , remote _ q _ index ) ) ; v_length = Internal . getValueLengthFromQualifier ( remote_qual , remote_q_index ) ; remote_v_index += v_length ; q_length = Internal . getQualifierLength ( remote_qual , remote_q_index ) ; remote_q_index += q_length ; continue ; } if ( sort < 0 ) { v_length = Internal . getValueLengthFromQualifier ( remote_qual , remote_q_index ) ; System . arraycopy ( remote_val , remote_v_index , merged_values , merged_v_index , v_length ) ; remote_v_index += v_length ; merged_v_index += v_length ; q_length = Internal . getQualifierLength ( remote_qual , remote_q_index ) ; System . arraycopy ( remote_qual , remote_q_index , merged_qualifiers , merged_q_index , q_length ) ; remote_q_index += q_length ; merged_q_index += q_length ; } else { v_length = Internal . getValueLengthFromQualifier ( qualifiers , local_q_index ) ; System . arraycopy ( values , local_v_index , merged_values , merged_v_index , v_length ) ; local_v_index += v_length ; merged_v_index += v_length ; q_length = Internal . getQualifierLength ( qualifiers , local_q_index ) ; System . arraycopy ( qualifiers , local_q_index , merged_qualifiers , merged_q_index , q_length ) ; local_q_index += q_length ; merged_q_index += q_length ; } } // we may have skipped some columns if we were given duplicates . Since we // had allocated enough bytes to hold the incoming row , we need to shrink // the final results if ( merged_q_index == merged_qualifiers . length ) { qualifiers = merged_qualifiers ; } else { qualifiers = Arrays . copyOfRange ( merged_qualifiers , 0 , merged_q_index ) ; } // set the meta bit based on the local and remote metas byte meta = 0 ; if ( ( values [ values . length - 1 ] & Const . MS_MIXED_COMPACT ) == Const . MS_MIXED_COMPACT || ( remote_val [ remote_val . length - 1 ] & Const . MS_MIXED_COMPACT ) == Const . MS_MIXED_COMPACT ) { meta = Const . MS_MIXED_COMPACT ; } values = Arrays . copyOfRange ( merged_values , 0 , merged_v_index + 1 ) ; values [ values . length - 1 ] = meta ;
public class ServletUtil { /** * Creates a wrapper that implements either { @ code ServletRequest } or * { @ code HttpServletRequest } , depending on the type of * { @ code pImplementation . getRequest ( ) } . * @ param pImplementation the servlet request to create a wrapper for * @ return a { @ code ServletResponse } or * { @ code HttpServletResponse } , depending on the type of * { @ code pImplementation . getResponse ( ) } */ public static ServletRequest createWrapper ( final ServletRequestWrapper pImplementation ) { } }
// TODO : Get all interfaces from implementation if ( pImplementation . getRequest ( ) instanceof HttpServletRequest ) { return ( HttpServletRequest ) Proxy . newProxyInstance ( pImplementation . getClass ( ) . getClassLoader ( ) , new Class [ ] { HttpServletRequest . class , ServletRequest . class } , new HttpServletRequestHandler ( pImplementation ) ) ; } return pImplementation ;
public class CommerceTaxFixedRatePersistenceImpl { /** * Returns the commerce tax fixed rate where CPTaxCategoryId = & # 63 ; and commerceTaxMethodId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param CPTaxCategoryId the cp tax category ID * @ param commerceTaxMethodId the commerce tax method ID * @ param retrieveFromCache whether to retrieve from the finder cache * @ return the matching commerce tax fixed rate , or < code > null < / code > if a matching commerce tax fixed rate could not be found */ @ Override public CommerceTaxFixedRate fetchByC_C ( long CPTaxCategoryId , long commerceTaxMethodId , boolean retrieveFromCache ) { } }
Object [ ] finderArgs = new Object [ ] { CPTaxCategoryId , commerceTaxMethodId } ; Object result = null ; if ( retrieveFromCache ) { result = finderCache . getResult ( FINDER_PATH_FETCH_BY_C_C , finderArgs , this ) ; } if ( result instanceof CommerceTaxFixedRate ) { CommerceTaxFixedRate commerceTaxFixedRate = ( CommerceTaxFixedRate ) result ; if ( ( CPTaxCategoryId != commerceTaxFixedRate . getCPTaxCategoryId ( ) ) || ( commerceTaxMethodId != commerceTaxFixedRate . getCommerceTaxMethodId ( ) ) ) { result = null ; } } if ( result == null ) { StringBundler query = new StringBundler ( 4 ) ; query . append ( _SQL_SELECT_COMMERCETAXFIXEDRATE_WHERE ) ; query . append ( _FINDER_COLUMN_C_C_CPTAXCATEGORYID_2 ) ; query . append ( _FINDER_COLUMN_C_C_COMMERCETAXMETHODID_2 ) ; String sql = query . toString ( ) ; Session session = null ; try { session = openSession ( ) ; Query q = session . createQuery ( sql ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( CPTaxCategoryId ) ; qPos . add ( commerceTaxMethodId ) ; List < CommerceTaxFixedRate > list = q . list ( ) ; if ( list . isEmpty ( ) ) { finderCache . putResult ( FINDER_PATH_FETCH_BY_C_C , finderArgs , list ) ; } else { CommerceTaxFixedRate commerceTaxFixedRate = list . get ( 0 ) ; result = commerceTaxFixedRate ; cacheResult ( commerceTaxFixedRate ) ; } } catch ( Exception e ) { finderCache . removeResult ( FINDER_PATH_FETCH_BY_C_C , finderArgs ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } if ( result instanceof List < ? > ) { return null ; } else { return ( CommerceTaxFixedRate ) result ; }
public class ClientWorldConnection { /** * Connects to the world model at the configured host and port . * @ param timeout * the maximum time to attempt the connection or 0 for the configured * timeout * @ return { @ code true } if the connection succeeds , else { @ code false } . */ public boolean connect ( long timeout ) { } }
if ( this . wmi . connect ( timeout ) ) { this . wmi . setStayConnected ( true ) ; // this . isReady = true ; return true ; } return false ;
public class OpenElementTag { /** * Meant to be called only from within the engine */ static OpenElementTag asEngineOpenElementTag ( final IOpenElementTag openElementTag ) { } }
if ( openElementTag instanceof OpenElementTag ) { return ( OpenElementTag ) openElementTag ; } final IAttribute [ ] originalAttributeArray = openElementTag . getAllAttributes ( ) ; final Attributes attributes ; if ( originalAttributeArray == null || originalAttributeArray . length == 0 ) { attributes = null ; } else { // We will perform a deep cloning of the attributes into objects of the Attribute class , so that // we make sure absolutely all Attributes in the new event are under the engine ' s control final Attribute [ ] newAttributeArray = new Attribute [ originalAttributeArray . length ] ; for ( int i = 0 ; i < originalAttributeArray . length ; i ++ ) { final IAttribute originalAttribute = originalAttributeArray [ i ] ; newAttributeArray [ i ] = new Attribute ( originalAttribute . getAttributeDefinition ( ) , originalAttribute . getAttributeCompleteName ( ) , originalAttribute . getOperator ( ) , originalAttribute . getValue ( ) , originalAttribute . getValueQuotes ( ) , originalAttribute . getTemplateName ( ) , originalAttribute . getLine ( ) , originalAttribute . getCol ( ) ) ; } final String [ ] newInnerWhiteSpaces ; if ( newAttributeArray . length == 1 ) { newInnerWhiteSpaces = Attributes . DEFAULT_WHITE_SPACE_ARRAY ; } else { newInnerWhiteSpaces = new String [ newAttributeArray . length ] ; Arrays . fill ( newInnerWhiteSpaces , Attributes . DEFAULT_WHITE_SPACE ) ; } attributes = new Attributes ( newAttributeArray , newInnerWhiteSpaces ) ; } return new OpenElementTag ( openElementTag . getTemplateMode ( ) , openElementTag . getElementDefinition ( ) , openElementTag . getElementCompleteName ( ) , attributes , openElementTag . isSynthetic ( ) , openElementTag . getTemplateName ( ) , openElementTag . getLine ( ) , openElementTag . getCol ( ) ) ;
public class XMLOutputUtil { /** * Write a list of Strings to document as elements with given tag name . * @ param xmlOutput * the XMLOutput object to write to * @ param tagName * the tag name * @ param listValues * Collection of String values to write */ public static void writeElementList ( XMLOutput xmlOutput , String tagName , Iterable < String > listValues ) throws IOException { } }
writeElementList ( xmlOutput , tagName , listValues . iterator ( ) ) ;
public class PasswordHashCreatorManager { /** * Create the password hash from the passed plain text password , using the * default password hash creator . * @ param sAlgorithmName * The password hash creator algorithm name to query . May neither be * < code > null < / code > nor empty . * @ param aSalt * Optional salt to be used . This parameter is only < code > null < / code > * for backwards compatibility reasons . * @ param sPlainTextPassword * Plain text password . May not be < code > null < / code > . * @ return The password hash . Never < code > null < / code > . * @ see # getDefaultPasswordHashCreator ( ) */ @ Nonnull public PasswordHash createUserPasswordHash ( @ Nonnull @ Nonempty final String sAlgorithmName , @ Nullable final IPasswordSalt aSalt , @ Nonnull final String sPlainTextPassword ) { } }
ValueEnforcer . notNull ( sPlainTextPassword , "PlainTextPassword" ) ; final IPasswordHashCreator aPHC = getPasswordHashCreatorOfAlgorithm ( sAlgorithmName ) ; if ( aPHC == null ) throw new IllegalArgumentException ( "No password hash creator for algorithm '" + sAlgorithmName + "' registered!" ) ; final String sPasswordHash = aPHC . createPasswordHash ( aSalt , sPlainTextPassword ) ; return new PasswordHash ( sAlgorithmName , aSalt , sPasswordHash ) ;
public class AbstractGpxParserRte { /** * Create a new specific parser . It has in memory the default parser , the * contentBuffer , the elementNames , the currentLine and the rteID . * @ param reader The XMLReader used in the default class * @ param parent The parser used in the default class */ public void initialise ( XMLReader reader , AbstractGpxParserDefault parent ) { } }
setReader ( reader ) ; setParent ( parent ) ; setContentBuffer ( parent . getContentBuffer ( ) ) ; setRtePreparedStmt ( parent . getRtePreparedStmt ( ) ) ; setRteptPreparedStmt ( parent . getRteptPreparedStmt ( ) ) ; setElementNames ( parent . getElementNames ( ) ) ; setCurrentLine ( parent . getCurrentLine ( ) ) ; setRteList ( new ArrayList < Coordinate > ( ) ) ;
import java . util . ArrayList ; import java . util . List ; public class DivideLists { /** * Function to divide two lists . * > > > divide _ lists ( [ 4 , 5 , 6 ] , [ 1 , 2 , 3 ] ) * [ 4.0 , 2.5 , 2.0] * > > > divide _ lists ( [ 3 , 2 ] , [ 1 , 4 ] ) * [ 3.0 , 0.5] * > > > divide _ lists ( [ 90 , 120 ] , [ 50 , 70 ] ) * [ 1.8 , 1.7142857142857142] */ public static List < Double > divideLists ( List < Integer > list1 , List < Integer > list2 ) { } }
List < Double > quotient = new ArrayList < > ( ) ; for ( int i = 0 ; i < list1 . size ( ) ; i ++ ) { quotient . add ( ( double ) list1 . get ( i ) / list2 . get ( i ) ) ; } return quotient ;
public class CmsImagePreviewHandler { /** * Sets the image format handler . < p > * @ param formatHandler the format handler */ public void setFormatHandler ( CmsImageFormatHandler formatHandler ) { } }
m_formatHandler = formatHandler ; m_croppingParam = m_formatHandler . getCroppingParam ( ) ; m_formatHandler . addValueChangeHandler ( this ) ; onCroppingChanged ( ) ;
public class BaasAsset { /** * Streams the file using the provided data stream handler . * @ param id the name of the asset to download * @ param flags * @ param handler the completion handler * @ param < R > the type to transform the bytes to . * @ return a request token to handle the request */ public static < R > RequestToken streamAsset ( String id , int flags , DataStreamHandler < R > contentHandler , BaasHandler < R > handler ) { } }
return BaasAsset . doStreamAsset ( id , null , - 1 , flags , contentHandler , handler ) ;
public class MergePath { /** * Adds the classpath for the loader as paths in the MergePath . * @ param loader class loader whose classpath should be used to search . */ public void addResourceClassPath ( ClassLoader loader ) { } }
String classpath = null ; if ( loader instanceof DynamicClassLoader ) classpath = ( ( DynamicClassLoader ) loader ) . getResourcePathSpecificFirst ( ) ; else classpath = CauchoUtil . getClassPath ( ) ; addClassPath ( classpath ) ;
public class CustomComposer { /** * { @ inheritDoc } */ @ Override public RESTEasyBindingData decompose ( Exchange exchange , RESTEasyBindingData target ) throws Exception { } }
Object content = exchange . getMessage ( ) . getContent ( ) ; String opName = exchange . getContract ( ) . getProviderOperation ( ) . getName ( ) ; if ( opName . equals ( "getItem" ) && ( content == null ) ) { exchange . getContext ( ) . setProperty ( RESTEasyContextMapper . HTTP_RESPONSE_STATUS , 404 ) . addLabels ( new String [ ] { EndpointLabel . HTTP . label ( ) } ) ; } target = super . decompose ( exchange , target ) ; if ( target . getOperationName ( ) . equals ( "addItem" ) && ( content != null ) && ( content instanceof Item ) ) { // Unwrap the parameters target . setParameters ( new Object [ ] { ( ( Item ) content ) . getItemId ( ) , ( ( Item ) content ) . getName ( ) , ( ( Item ) content ) . getPrice ( ) } ) ; } return target ;
public class Application { /** * Registers a template engine if no other engine has been registered . * @ param engineClass */ public void registerTemplateEngine ( Class < ? extends TemplateEngine > engineClass ) { } }
if ( templateEngine != null ) { log . debug ( "Template engine already registered, ignoring '{}'" , engineClass . getName ( ) ) ; return ; } try { TemplateEngine engine = engineClass . newInstance ( ) ; setTemplateEngine ( engine ) ; } catch ( Exception e ) { throw new PippoRuntimeException ( e , "Failed to instantiate '{}'" , engineClass . getName ( ) ) ; }
public class DataTransferServiceClient { /** * Deletes a data transfer configuration , including any associated transfer runs and logs . * < p > Sample code : * < pre > < code > * try ( DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient . create ( ) ) { * TransferConfigName name = ProjectTransferConfigName . of ( " [ PROJECT ] " , " [ TRANSFER _ CONFIG ] " ) ; * dataTransferServiceClient . deleteTransferConfig ( name . toString ( ) ) ; * < / code > < / pre > * @ param name The field will contain name of the resource requested , for example : * ` projects / { project _ id } / transferConfigs / { config _ id } ` * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final void deleteTransferConfig ( String name ) { } }
DeleteTransferConfigRequest request = DeleteTransferConfigRequest . newBuilder ( ) . setName ( name ) . build ( ) ; deleteTransferConfig ( request ) ;
public class DayOpeningHours { /** * Removes some hour ranges from this instance and returns a new one . The day of the argument is ignored . < br > * < br > * It is only allowed to call this method if the hour ranges represents only one day . This means a value like ' 18:00-03:00 ' will lead to * an error . To avoid this , call the { @ link # normalize ( ) } function before this one and pass the result per day as an argument to this * method . * @ param other * Ranges to remove . * @ return New instance with removed times or { @ literal null } if all times where removed . */ @ Nullable public final DayOpeningHours remove ( @ NotNull final DayOpeningHours other ) { } }
Contract . requireArgNotNull ( "other" , other ) ; return this . remove ( other . hourRanges ) ;
public class JSONParser { /** * use to return Primitive Type , or String , Or JsonObject or JsonArray * generated by a ContainerFactory */ public < T > T parse ( String in , JsonReaderI < T > mapper ) throws ParseException { } }
return getPString ( ) . parse ( in , mapper ) ;
public class MethodUtil { /** * Discover the public methods on public classes * and interfaces accessible to any caller by calling * Class . getMethods ( ) and walking towards Object until * we ' re done . */ public static Method [ ] getPublicMethods ( Class < ? > cls ) { } }
// compatibility for update release if ( System . getSecurityManager ( ) == null ) { return cls . getMethods ( ) ; } Map < Signature , Method > sigs = new HashMap < Signature , Method > ( ) ; while ( cls != null ) { boolean done = getInternalPublicMethods ( cls , sigs ) ; if ( done ) { break ; } getInterfaceMethods ( cls , sigs ) ; cls = cls . getSuperclass ( ) ; } return sigs . values ( ) . toArray ( new Method [ sigs . size ( ) ] ) ;
public class CommerceWarehouseItemPersistenceImpl { /** * Removes all the commerce warehouse items where CProductId = & # 63 ; and CPInstanceUuid = & # 63 ; from the database . * @ param CProductId the c product ID * @ param CPInstanceUuid the cp instance uuid */ @ Override public void removeByCPI_CPIU ( long CProductId , String CPInstanceUuid ) { } }
for ( CommerceWarehouseItem commerceWarehouseItem : findByCPI_CPIU ( CProductId , CPInstanceUuid , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceWarehouseItem ) ; }
public class Status { /** * Creates a derived instance of { @ code Status } with the given description . * @ param description the new description of the { @ code Status } . * @ return The newly created { @ code Status } with the given description . * @ since 0.5 */ public Status withDescription ( @ Nullable String description ) { } }
if ( Utils . equalsObjects ( this . description , description ) ) { return this ; } return new Status ( this . canonicalCode , description ) ;
public class EssentialCycles { /** * Determines whether the < i > cycle < / i > is essential . * @ param candidate a cycle which is a member of the MCB * @ param relevant relevant cycles of the same length as < i > cycle < / i > * @ return whether the candidate is essential */ private boolean isEssential ( final Cycle candidate , final Collection < Cycle > relevant ) { } }
// construct an alternative basis with all equal weight relevant cycles final List < Cycle > alternate = new ArrayList < Cycle > ( relevant . size ( ) + basis . size ( ) ) ; final int weight = candidate . length ( ) ; for ( final Cycle cycle : basis . members ( ) ) { if ( cycle . length ( ) < weight ) alternate . add ( cycle ) ; } for ( final Cycle cycle : relevant ) { if ( ! cycle . equals ( candidate ) ) alternate . add ( cycle ) ; } // if the alternate basis is smaller , the candidate is essential return BitMatrix . from ( alternate ) . eliminate ( ) < basis . size ( ) ;
public class DateUtils { /** * < p > Gets a date ceiling , leaving the field specified as the most * significant field . < / p > * < p > For example , if you had the date - time of 28 Mar 2002 * 13:45:01.231 , if you passed with HOUR , it would return 28 Mar * 2002 14:00:00.000 . If this was passed with MONTH , it would * return 1 Apr 2002 0:00:00.000 . < / p > * @ param date the date to work with , not null * @ param field the field from { @ code Calendar } or < code > SEMI _ MONTH < / code > * @ return the different ceil date , not null * @ throws IllegalArgumentException if the date is < code > null < / code > * @ throws ArithmeticException if the year is over 280 million * @ since 2.5 */ public static Calendar ceiling ( final Calendar date , final int field ) { } }
if ( date == null ) { throw new IllegalArgumentException ( "The date must not be null" ) ; } final Calendar ceiled = ( Calendar ) date . clone ( ) ; modify ( ceiled , field , ModifyType . CEILING ) ; return ceiled ;
public class SpotifyApi { /** * Retrieve a list of available genres seed parameter values for recommendations . * @ return A { @ link GetAvailableGenreSeedsRequest . Builder } . */ public GetAvailableGenreSeedsRequest . Builder getAvailableGenreSeeds ( ) { } }
return new GetAvailableGenreSeedsRequest . Builder ( accessToken ) . setDefaults ( httpManager , scheme , host , port ) ;
public class ExtendedBitStore { /** * view methods */ @ Override public BitStore range ( int from , int to ) { } }
if ( from <= finish && to <= finish ) return Bits . zeroBits ( size ) . range ( from , to ) ; if ( from >= start && to >= start ) return Bits . zeroBits ( size ) . range ( from , to ) ; if ( from >= finish && to <= start ) return store . range ( from - finish , to - finish ) ; return super . range ( from , to ) ;
public class FineUploader5DeleteFile { /** * The endpoint to which delete file requests are sent . * @ param aEndpoint * New value . May not be < code > null < / code > . * @ return this for chaining */ @ Nonnull public FineUploader5DeleteFile setEndpoint ( @ Nonnull final ISimpleURL aEndpoint ) { } }
ValueEnforcer . notNull ( aEndpoint , "Endpoint" ) ; m_aDeleteFileEndpoint = aEndpoint ; return this ;
public class ValueEnforcer { /** * Check if * < code > nValue & ge ; nLowerBoundInclusive & amp ; & amp ; nValue & le ; nUpperBoundInclusive < / code > * @ param dValue * Value * @ param aName * Name * @ param dLowerBoundInclusive * Lower bound * @ param dUpperBoundInclusive * Upper bound * @ return The value */ public static double isBetweenInclusive ( final double dValue , @ Nonnull final Supplier < ? extends String > aName , final double dLowerBoundInclusive , final double dUpperBoundInclusive ) { } }
if ( isEnabled ( ) ) if ( dValue < dLowerBoundInclusive || dValue > dUpperBoundInclusive ) throw new IllegalArgumentException ( "The value of '" + aName . get ( ) + "' must be >= " + dLowerBoundInclusive + " and <= " + dUpperBoundInclusive + "! The current value is: " + dValue ) ; return dValue ;
public class CountingMemoryCache { /** * Marks the given entries as orphans . */ private synchronized void makeOrphans ( @ Nullable ArrayList < Entry < K , V > > oldEntries ) { } }
if ( oldEntries != null ) { for ( Entry < K , V > oldEntry : oldEntries ) { makeOrphan ( oldEntry ) ; } }
public class GenericIHEAuditEventMessage { /** * Adds a Participant Object Identification block that representing a patient * involved in the event * @ param patientId Identifier of the patient involved */ public void addPatientParticipantObject ( String patientId ) { } }
addParticipantObjectIdentification ( new RFC3881ParticipantObjectCodes . RFC3881ParticipantObjectIDTypeCodes . PatientNumber ( ) , null , null , null , patientId , RFC3881ParticipantObjectTypeCodes . PERSON , RFC3881ParticipantObjectTypeRoleCodes . PATIENT , null , null ) ;
public class MapKeyLoader { /** * Returns { @ code true } if the keys are not loaded yet , promoting this key * loader and resetting the loading state if necessary in the process . * If this gets invoked on SENDER BACKUP it means the SENDER died and * SENDER BACKUP takes over . */ public boolean shouldDoInitialLoad ( ) { } }
if ( role . is ( Role . SENDER_BACKUP ) ) { // was backup . become primary sender role . next ( Role . SENDER ) ; if ( state . is ( State . LOADING ) ) { // previous loading was in progress . cancel and start from scratch state . next ( State . NOT_LOADED ) ; keyLoadFinished . setResult ( false ) ; } } return state . is ( State . NOT_LOADED ) ;
public class ArrayParameters { /** * Change the query to replace ? at each arrayParametersSortedAsc . parameterIndex * with ? , ? , ? . . multiple arrayParametersSortedAsc . parameterCount */ static String updateQueryWithArrayParameters ( String parsedQuery , List < ArrayParameter > arrayParametersSortedAsc ) { } }
if ( arrayParametersSortedAsc . isEmpty ( ) ) { return parsedQuery ; } StringBuilder sb = new StringBuilder ( ) ; Iterator < ArrayParameter > parameterToReplaceIt = arrayParametersSortedAsc . iterator ( ) ; ArrayParameter nextParameterToReplace = parameterToReplaceIt . next ( ) ; // PreparedStatement index starts at 1 int currentIndex = 1 ; for ( char c : parsedQuery . toCharArray ( ) ) { if ( nextParameterToReplace != null && c == '?' ) { if ( currentIndex == nextParameterToReplace . parameterIndex ) { sb . append ( "?" ) ; for ( int i = 1 ; i < nextParameterToReplace . parameterCount ; i ++ ) { sb . append ( ",?" ) ; } if ( parameterToReplaceIt . hasNext ( ) ) { nextParameterToReplace = parameterToReplaceIt . next ( ) ; } else { nextParameterToReplace = null ; } } else { sb . append ( c ) ; } currentIndex ++ ; } else { sb . append ( c ) ; } } return sb . toString ( ) ;
public class MtasSpanSequenceItem { /** * Rewrite . * @ param reader the reader * @ return the mtas span sequence item * @ throws IOException Signals that an I / O exception has occurred . */ public MtasSpanSequenceItem rewrite ( IndexReader reader ) throws IOException { } }
MtasSpanQuery newSpanQuery = spanQuery . rewrite ( reader ) ; if ( ! newSpanQuery . equals ( spanQuery ) ) { return new MtasSpanSequenceItem ( newSpanQuery , optional ) ; } else { return this ; }
public class BlobContainersInner { /** * Sets the ImmutabilityPolicy to Locked state . The only action allowed on a Locked policy is ExtendImmutabilityPolicy action . ETag in If - Match is required for this operation . * @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive . * @ param accountName The name of the storage account within the specified resource group . Storage account names must be between 3 and 24 characters in length and use numbers and lower - case letters only . * @ param containerName The name of the blob container within the specified storage account . Blob container names must be between 3 and 63 characters in length and use numbers , lower - case letters and dash ( - ) only . Every dash ( - ) character must be immediately preceded and followed by a letter or number . * @ param ifMatch The entity state ( ETag ) version of the immutability policy to update . A value of " * " can be used to apply the operation only if the immutability policy already exists . If omitted , this operation will always be applied . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ImmutabilityPolicyInner object */ public Observable < ImmutabilityPolicyInner > lockImmutabilityPolicyAsync ( String resourceGroupName , String accountName , String containerName , String ifMatch ) { } }
return lockImmutabilityPolicyWithServiceResponseAsync ( resourceGroupName , accountName , containerName , ifMatch ) . map ( new Func1 < ServiceResponseWithHeaders < ImmutabilityPolicyInner , BlobContainersLockImmutabilityPolicyHeaders > , ImmutabilityPolicyInner > ( ) { @ Override public ImmutabilityPolicyInner call ( ServiceResponseWithHeaders < ImmutabilityPolicyInner , BlobContainersLockImmutabilityPolicyHeaders > response ) { return response . body ( ) ; } } ) ;
public class ServletTypeImpl { /** * Returns the < code > load - on - startup < / code > element * @ return the node defined for the element < code > load - on - startup < / code > */ public Integer getLoadOnStartup ( ) { } }
if ( childNode . getTextValueForPatternName ( "load-on-startup" ) != null && ! childNode . getTextValueForPatternName ( "load-on-startup" ) . equals ( "null" ) ) { return Integer . valueOf ( childNode . getTextValueForPatternName ( "load-on-startup" ) ) ; } return null ;
public class Build { /** * An array of < code > ProjectSource < / code > objects . * @ param secondarySources * An array of < code > ProjectSource < / code > objects . */ public void setSecondarySources ( java . util . Collection < ProjectSource > secondarySources ) { } }
if ( secondarySources == null ) { this . secondarySources = null ; return ; } this . secondarySources = new java . util . ArrayList < ProjectSource > ( secondarySources ) ;
public class MongoDBNativeQuery { /** * This method insert a single document into a collection . Params w and wtimeout are read from QueryOptions . * @ param document The new document to be inserted * @ param options Some options like timeout */ public void insert ( Document document , QueryOptions options ) { } }
int writeConcern = 1 ; int ms = 0 ; if ( options != null && ( options . containsKey ( "w" ) || options . containsKey ( "wtimeout" ) ) ) { // Some info about params : http : / / api . mongodb . org / java / current / com / mongodb / WriteConcern . html // return dbCollection . insert ( dbObject , new WriteConcern ( options . getInt ( " w " , 1 ) , options . getInt ( " wtimeout " , 0 ) ) ) ; writeConcern = options . getInt ( "w" , 1 ) ; ms = options . getInt ( "wtimeout" , 0 ) ; } dbCollection . withWriteConcern ( new WriteConcern ( writeConcern , ms ) ) ; dbCollection . insertOne ( document ) ;
public class NumberCastImplicitlyImportedFeatures { /** * Fill the given list with the implicitly imported features . * @ param features the list to fill . */ @ SuppressWarnings ( "static-method" ) public void getImportedFeatures ( List < Class < ? > > features ) { } }
features . add ( AtomicLongCastExtensions . class ) ; features . add ( AtomicIntegerCastExtensions . class ) ; features . add ( AtomicDoubleCastExtensions . class ) ; features . add ( BigIntegerCastExtensions . class ) ; features . add ( BigDecimalCastExtensions . class ) ; features . add ( NumberCastExtensions . class ) ; features . add ( PrimitiveByteCastExtensions . class ) ; features . add ( PrimitiveDoubleCastExtensions . class ) ; features . add ( PrimitiveFloatCastExtensions . class ) ; features . add ( PrimitiveIntCastExtensions . class ) ; features . add ( PrimitiveLongCastExtensions . class ) ; features . add ( PrimitiveShortCastExtensions . class ) ;
public class AnnotationUtil { /** * Calculates the hash code of annotation values . * @ param values The map to calculate values ' hash code * @ return The hash code */ @ SuppressWarnings ( "MagicNumber" ) public static int calculateHashCode ( Map < ? extends CharSequence , Object > values ) { } }
int hashCode = 0 ; for ( Map . Entry < ? extends CharSequence , Object > member : values . entrySet ( ) ) { Object value = member . getValue ( ) ; int nameHashCode = member . getKey ( ) . hashCode ( ) ; int valueHashCode = ! value . getClass ( ) . isArray ( ) ? value . hashCode ( ) : value . getClass ( ) == boolean [ ] . class ? Arrays . hashCode ( ( boolean [ ] ) value ) : value . getClass ( ) == byte [ ] . class ? Arrays . hashCode ( ( byte [ ] ) value ) : value . getClass ( ) == char [ ] . class ? Arrays . hashCode ( ( char [ ] ) value ) : value . getClass ( ) == double [ ] . class ? Arrays . hashCode ( ( double [ ] ) value ) : value . getClass ( ) == float [ ] . class ? Arrays . hashCode ( ( float [ ] ) value ) : value . getClass ( ) == int [ ] . class ? Arrays . hashCode ( ( int [ ] ) value ) : value . getClass ( ) == long [ ] . class ? Arrays . hashCode ( ( long [ ] ) value ) : value . getClass ( ) == short [ ] . class ? Arrays . hashCode ( ( short [ ] ) value ) : Arrays . hashCode ( ( Object [ ] ) value ) ; hashCode += 127 * nameHashCode ^ valueHashCode ; } return hashCode ;
public class IconicsDrawable { /** * Sets the style * @ return The current IconicsDrawable for chaining . */ @ NonNull public IconicsDrawable style ( @ NonNull Paint . Style style ) { } }
mIconBrush . getPaint ( ) . setStyle ( style ) ; invalidateSelf ( ) ; return this ;
public class ImportStack { /** * Register a new import , return the registration ID . */ public int register ( Import importSource ) { } }
int id = registry . size ( ) + 1 ; registry . put ( id , importSource ) ; return id ;
public class SurveyorAppController { /** * Display home screen */ protected void display ( ) { } }
new FilterPresenter ( new FilterViewUI ( ) ) . go ( layout ) ; resultPresenter = new ResultPresenter ( getResultView ( ) ) ; loadStatusListener . registerObserver ( resultPresenter ) ; resultPresenter . go ( layout ) ;
public class RecordCacheHandler { /** * Called when a change is the record status is about to happen / has happened . * @ param field If this file change is due to a field , this is the field . * @ param iChangeType The type of change that occurred . * @ param bDisplayOption If true , display any changes . * @ return an error code . */ public int doRecordChange ( FieldInfo field , int iChangeType , boolean bDisplayOption ) { } }
// Return an error to stop the change if ( iChangeType == DBConstants . AFTER_REQUERY_TYPE ) { this . clearCache ( ) ; } if ( ( iChangeType == DBConstants . AFTER_UPDATE_TYPE ) || ( iChangeType == DBConstants . AFTER_ADD_TYPE ) ) { this . doFirstValidRecord ( bDisplayOption ) ; this . putCacheField ( ) ; } if ( iChangeType == DBConstants . AFTER_DELETE_TYPE ) { this . removeCacheField ( ) ; } if ( iChangeType == DBConstants . FIELD_CHANGED_TYPE ) { } return super . doRecordChange ( field , iChangeType , bDisplayOption ) ;
public class Requests { /** * Create a new { @ link PublishRequest } that contains the given { @ link PublishElement } * @ param el the { @ link PublishElement } that is added to the new { @ link PublishRequest } * @ return the new { @ link PublishRequest } */ public static PublishRequest createPublishReq ( PublishElement el ) { } }
if ( el == null ) { throw new NullPointerException ( "el is not allowed to be null" ) ; } PublishRequest ret = createPublishReq ( ) ; ret . addPublishElement ( el ) ; return ret ;
public class JAASClientService { /** * Look at the login module pids required by the context entry : * < ul > * < li > If there are no module pids , and the entry id is not one of the defaults , issue a warning . * < li > If there are module pids , and some can ' t be found , add the entry to the pending list . * < li > If all is well , add it to the map . * < / ul > * @ param ref JAASLoginContextEntry service reference */ protected void processContextEntry ( ServiceReference < JAASLoginContextEntry > ref ) { } }
String id = ( String ) ref . getProperty ( KEY_ID ) ; String [ ] modulePids = ( String [ ] ) ref . getProperty ( JAASLoginContextEntryImpl . CFG_KEY_LOGIN_MODULE_REF ) ; boolean changedEntryContext = false ; if ( modulePids == null || modulePids . length == 0 ) { Tr . error ( tc , "JAAS_LOGIN_CONTEXT_ENTRY_HAS_NO_LOGIN_MODULE" , id ) ; changedEntryContext |= jaasLoginContextEntries . removeReference ( id , ref ) ; } else { if ( haveAllModules ( modulePids ) ) { jaasLoginContextEntries . putReference ( id , ref ) ; changedEntryContext = true ; } else { // make sure it was not previously registered , as it now has a missing module changedEntryContext |= jaasLoginContextEntries . removeReference ( id , ref ) ; synchronized ( pendingContextEntryRefs ) { pendingContextEntryRefs . add ( ref ) ; } } } if ( changedEntryContext ) { modified ( properties ) ; }
public class HammerGwt { /** * Unregister hammer event . * @ param hammerTime { @ link HammerTime } hammer gwt instance . * @ param eventType { @ link org . geomajas . hammergwt . client . event . EventType } * @ param callback { @ link org . geomajas . hammergwt . client . handler . NativeHammmerHandler } of the event that needs * to be unregistered . */ public static void off ( HammerTime hammerTime , EventType eventType , NativeHammmerHandler callback ) { } }
off ( hammerTime , callback , eventType . getText ( ) ) ;
public class DatatypeConverter { /** * Print a time value . * @ param value time value * @ return time value */ public static final String printTime ( Date value ) { } }
return ( value == null ? null : TIME_FORMAT . get ( ) . format ( value ) ) ;
public class CSIv2ClientSubsystemFactory { /** * { @ inheritDoc } */ @ Override public Policy getClientPolicy ( ORB orb , Map < String , Object > properties ) throws Exception { } }
// TODO : Determine if system . RMI _ OUTBOUND should be created and used for outbound . CSSConfig cssConfig = new ClientContainerConfigHelper ( defaultAlias ) . getCSSConfig ( properties ) ; ClientPolicy clientPolicy = new ClientPolicy ( cssConfig ) ; return clientPolicy ;
public class ConnectionFactory { /** * Creates the database structure ( tables and indexes ) to store the CVE * data . * @ param conn the database connection * @ throws DatabaseException thrown if there is a Database Exception */ private void createTables ( Connection conn ) throws DatabaseException { } }
LOGGER . debug ( "Creating database structure" ) ; try ( InputStream is = FileUtils . getResourceAsStream ( DB_STRUCTURE_RESOURCE ) ) { final String dbStructure = IOUtils . toString ( is , StandardCharsets . UTF_8 ) ; Statement statement = null ; try { statement = conn . createStatement ( ) ; statement . execute ( dbStructure ) ; } catch ( SQLException ex ) { LOGGER . debug ( "" , ex ) ; throw new DatabaseException ( "Unable to create database statement" , ex ) ; } finally { DBUtils . closeStatement ( statement ) ; } } catch ( IOException ex ) { throw new DatabaseException ( "Unable to create database schema" , ex ) ; }
public class MessageSerializer { /** * Serialize a message */ public static byte [ ] serialize ( AbstractMessage message , int typicalSize ) { } }
RawDataBuffer rawMsg = message . getRawMessage ( ) ; if ( rawMsg != null ) return rawMsg . toByteArray ( ) ; RawDataBuffer buffer = new RawDataBuffer ( typicalSize ) ; buffer . writeByte ( message . getType ( ) ) ; message . serializeTo ( buffer ) ; return buffer . toByteArray ( ) ;
public class SebContextWait { /** * Until method using predicate functional interface . It solves ambiguity * when using basic until method without typed parameter . * Repeatedly applies this instance ' s input value to the given predicate * until the timeout expires or the predicate evaluates to true . * @ param isTrue * The predicate to wait on . * @ throws TimeoutException * If the timeout expires . */ public void untilTrue ( Predicate < SebContext > isTrue ) { } }
super . until ( new com . google . common . base . Predicate < SebContext > ( ) { @ Override public boolean apply ( SebContext input ) { return isTrue . test ( input ) ; } } ) ;
public class Functions { /** * Get the average of all input numbers . When the result is indivisible , the * scale will depends on the scale of all input numbers * Any numeric string recognized by { @ code BigDecimal } is supported . * @ param values one or more valid number strings * @ return < code > ( values [ 0 ] + values [ 1 ] + . . . ) / values . length < / code > * @ see BigDecimal */ public static String average ( String ... values ) { } }
if ( values != null ) { return divide ( sum ( values ) , values . length + "" ) ; } return null ;
public class ClassScreener { /** * Add the name of a prefix to be matched by the screener . All class files * that appear to be in the package specified by the prefix , or a more * deeply nested package , should be matched . * @ param prefix * name of the prefix to be matched */ public void addAllowedPrefix ( String prefix ) { } }
if ( prefix . endsWith ( "." ) ) { prefix = prefix . substring ( 0 , prefix . length ( ) - 1 ) ; } LOG . debug ( "Allowed prefix: {}" , prefix ) ; String packageRegex = START + dotsToRegex ( prefix ) + SEP ; LOG . debug ( "Prefix regex: {}" , packageRegex ) ; patternList . add ( Pattern . compile ( packageRegex ) . matcher ( "" ) ) ;
public class CoverageDataCore { /** * Get the min , max , and offset of the source X pixel * @ param source * source x pixel * @ return source x pixel information */ protected CoverageDataSourcePixel getXSourceMinAndMax ( float source ) { } }
int floor = ( int ) Math . floor ( source ) ; float valueLocation = getXEncodedLocation ( floor , griddedCoverage . getGridCellEncodingType ( ) ) ; CoverageDataSourcePixel pixel = getSourceMinAndMax ( source , floor , valueLocation ) ; return pixel ;
public class ConnectorImpl { /** * { @ inheritDoc } */ public Connector copy ( ) { } }
XsdString newResourceadapterVersion = CopyUtil . clone ( this . resourceadapterVersion ) ; XsdString newEisType = XsdString . isNull ( this . eisType ) ? null : ( XsdString ) this . eisType . copy ( ) ; List < XsdString > newRequiredWorkContexts = CopyUtil . cloneList ( this . requiredWorkContexts ) ; XsdString newModuleName = CopyUtil . clone ( this . moduleName ) ; List < Icon > newIcons = CopyUtil . cloneList ( this . icon ) ; boolean newMetadataComplete = this . metadataComplete ; LicenseType newLicense = CopyUtil . clone ( this . license ) ; List < LocalizedXsdString > newDescriptions = CopyUtil . cloneList ( this . description ) ; List < LocalizedXsdString > newDisplayNames = CopyUtil . cloneList ( this . displayName ) ; XsdString newVendorName = CopyUtil . clone ( this . vendorName ) ; ResourceAdapter newResourceadapter = CopyUtil . clone ( ( ResourceAdapter ) this . resourceadapter ) ; return new ConnectorImpl ( version , newModuleName , newVendorName , newEisType , newResourceadapterVersion , newLicense , newResourceadapter , newRequiredWorkContexts , newMetadataComplete , newDescriptions , newDisplayNames , newIcons , CopyUtil . cloneString ( id ) ) ;
public class SshUtil { /** * Checks to see if the passPhrase is valid for the private key file . * @ param keyFilePath the private key file . * @ param passPhrase the password for the file . * @ return true if it is valid . */ public static boolean checkPassPhrase ( File keyFilePath , String passPhrase ) { } }
KeyPair key = parsePrivateKeyFile ( keyFilePath ) ; boolean isValidPhrase = passPhrase != null && ! passPhrase . trim ( ) . isEmpty ( ) ; if ( key == null ) { return false ; } else if ( key . isEncrypted ( ) != isValidPhrase ) { return false ; } else if ( key . isEncrypted ( ) ) { return key . decrypt ( passPhrase ) ; } return true ;
public class StoreRamp { /** * public void findOne ( String sql , Result < Object > result , Object . . . args ) * _ root . findOneImpl ( _ path , sql , result , args ) ; * public void find ( ResultStream result , String sql , Object . . . args ) * System . out . println ( " RAND : " + result ) ; * _ root . findImpl ( _ path , sql , args , result ) ; * public void findLocal ( ResultStream result , String sql , Object . . . args ) * _ root . findLocalImpl ( _ path , sql , args , result ) ; */ public void put ( String key , Object value , Result < Void > result ) { } }
_root . put ( _path + key , value , result ) ;
public class TaskConfig { /** * Adds a property to the configuration of this task . * @ param propertyName Name of the property ( or key ) in the configuration . * @ return an instance of { @ link com . thoughtworks . go . plugin . api . task . TaskConfigProperty } */ public TaskConfigProperty addProperty ( String propertyName ) { } }
TaskConfigProperty property = new TaskConfigProperty ( propertyName ) ; add ( property ) ; return property ;
public class RedisConnectionException { /** * Create a new { @ link RedisConnectionException } given { @ link Throwable cause } . * @ param cause the exception . * @ return the { @ link RedisConnectionException } . * @ since 5.1 */ public static RedisConnectionException create ( Throwable cause ) { } }
if ( cause instanceof RedisConnectionException ) { return new RedisConnectionException ( cause . getMessage ( ) , cause . getCause ( ) ) ; } return new RedisConnectionException ( "Unable to connect" , cause ) ;
public class AmazonS3EncryptionClient { /** * Convenient method to notifies the observer to abort the multi - part * upload , and returns the original exception . */ private < T extends Throwable > T onAbort ( UploadObjectObserver observer , T t ) { } }
observer . onAbort ( ) ; return t ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CylinderType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link CylinderType } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "Cylinder" , substitutionHeadNamespace = "http://www.opengis.net/gml" , substitutionHeadName = "_GriddedSurface" ) public JAXBElement < CylinderType > createCylinder ( CylinderType value ) { } }
return new JAXBElement < CylinderType > ( _Cylinder_QNAME , CylinderType . class , null , value ) ;
public class AdaptiveTableLayout { /** * Create view holder by type * @ param itemType view holder type * @ return Created view holder */ @ Nullable private ViewHolder createViewHolder ( int itemType ) { } }
if ( itemType == ViewHolderType . ITEM ) { return mAdapter . onCreateItemViewHolder ( AdaptiveTableLayout . this ) ; } else if ( itemType == ViewHolderType . ROW_HEADER ) { return mAdapter . onCreateRowHeaderViewHolder ( AdaptiveTableLayout . this ) ; } else if ( itemType == ViewHolderType . COLUMN_HEADER ) { return mAdapter . onCreateColumnHeaderViewHolder ( AdaptiveTableLayout . this ) ; } return null ;
public class StreamMonitorRouter { /** * Notify all subscribing monitors of a updated event . * @ param resource the url of the updated resource * @ param expected the size in bytes of the download * @ param count the progress in bytes */ public void notifyUpdate ( URL resource , int expected , int count ) { } }
synchronized ( m_Monitors ) { for ( StreamMonitor monitor : m_Monitors ) { monitor . notifyUpdate ( resource , expected , count ) ; } }
public class Redis { /** * The output format for your data : * json _ interaction _ meta - This is specific to the Redis connector for now . Each interaction is sent separately * except it is framed with metadata . * json _ interaction - This is specific to the Redis connector for now . Each interaction is sent separately with * no metadata . * If you omit this parameter or set it to json _ interaction _ meta , each interaction will be delivered with * accompanying metadata . Both the interactions and the metadata are delivered as JSON objects . * Take a look at our Sample Output for File - Based Connectors page . * If you select json _ interaction , DataSift omits the metadata and sends each interaction as a single JSON object . * @ return this */ public Redis format ( RedisFormat format ) { } }
String strFormat ; switch ( format ) { case JSON_INTERACTION_META : strFormat = "json_interaction_meta" ; break ; default : case JSON_INTERACTION : strFormat = "json_interaction" ; break ; } return setParam ( "format" , strFormat ) ;
public class Util { /** * Returns { @ code true } if the resource at the specified path exists , { @ code false } otherwise . This * method supports scheme prefixes on the path as defined in { @ link # getInputStreamForPath ( String ) } . * @ param resourcePath the path of the resource to check . * @ return { @ code true } if the resource at the specified path exists , { @ code false } otherwise . * @ since 0.9 */ public static boolean resourceExists ( String resourcePath ) { } }
InputStream stream = null ; boolean exists = false ; try { stream = getInputStreamForPath ( resourcePath ) ; exists = true ; } catch ( IOException e ) { stream = null ; } finally { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException ignored ) { } } } return exists ;
public class TableAdminExample { /** * Demonstrates how to create a table with the specified configuration . */ public void createTable ( ) { } }
// [ START bigtable _ create _ table ] // Checks if table exists , creates table if does not exist . if ( ! adminClient . exists ( tableId ) ) { System . out . println ( "Table does not exist, creating table: " + tableId ) ; CreateTableRequest createTableRequest = CreateTableRequest . of ( tableId ) . addFamily ( "cf" ) ; Table table = adminClient . createTable ( createTableRequest ) ; System . out . printf ( "Table: %s created successfully%n" , table . getId ( ) ) ; } // [ END bigtable _ create _ table ]
public class AbstractMaterialDialog { /** * Creates and returns a listener , which allows to cancel the dialog , when touched outside the * window . * @ return The listener , which has been created , as an instance of the type { @ link * View . OnTouchListener } */ private View . OnTouchListener createCanceledOnTouchListener ( ) { } }
return new View . OnTouchListener ( ) { @ SuppressLint ( "ClickableViewAccessibility" ) @ Override public boolean onTouch ( final View v , final MotionEvent event ) { return isCanceledOnTouchOutside ( ) && ! isFullscreen ( ) && onCanceledOnTouchOutside ( ) ; } } ;
public class ForgePropertyStyle { /** * Returns whether the given method is a ' getter ' method . * @ param method a parameterless method that returns a non - void * @ return the property name */ protected String isGetter ( final Method < ? , ? > method ) { } }
String methodName = method . getName ( ) ; String propertyName ; if ( methodName . startsWith ( ClassUtils . JAVABEAN_GET_PREFIX ) ) { propertyName = methodName . substring ( ClassUtils . JAVABEAN_GET_PREFIX . length ( ) ) ; } else if ( methodName . startsWith ( ClassUtils . JAVABEAN_IS_PREFIX ) && method . getReturnType ( ) != null && boolean . class . equals ( method . getReturnType ( ) . getQualifiedName ( ) ) ) { // As per section 8.3.2 ( Boolean properties ) of The JavaBeans API specification , ' is ' // only applies to boolean ( little ' b ' ) propertyName = methodName . substring ( ClassUtils . JAVABEAN_IS_PREFIX . length ( ) ) ; } else { return null ; } return StringUtils . decapitalize ( propertyName ) ;
public class Bean { /** * < p > setProperties . < / p > * @ param properties a { @ link java . util . Map } object . */ public void setProperties ( Map < String , Object > properties ) { } }
Introspector introspector = new Introspector ( target . getClass ( ) , new PropertyComparator ( ) ) ; for ( Map . Entry < String , Object > property : properties . entrySet ( ) ) { Method setter = introspector . getSetter ( property . getKey ( ) ) ; if ( setter != null ) invoke ( setter , property . getValue ( ) ) ; }
public class CompletableFuture { /** * Post - processing after successful BiCompletion tryFire . */ final CompletableFuture < T > postFire ( CompletableFuture < ? > a , CompletableFuture < ? > b , int mode ) { } }
if ( b != null && b . stack != null ) { // clean second source Object r ; if ( ( r = b . result ) == null ) b . cleanStack ( ) ; if ( mode >= 0 && ( r != null || b . result != null ) ) b . postComplete ( ) ; } return postFire ( a , mode ) ;
public class LightweightTypeReference { /** * Prints a human readable name of this type reference . May be specialized * by means of a custom { @ link HumanReadableTypeNames implementation } . This is the variant * that should be used in the UI . */ public String getHumanReadableName ( ) { } }
StringBuilder result = new StringBuilder ( ) ; accept ( getServices ( ) . getHumanReadableTypeNames ( ) , result ) ; return result . toString ( ) ;
public class AtomicBitflags { /** * Atomically add and remove the given flags from the current set * @ param add the flags to add * @ param remove the flags to remove * @ return the previous value */ public int change ( final int add , final int remove ) { } }
for ( ; ; ) { int current = _flags . get ( ) ; int newValue = ( current | add ) & ~ remove ; if ( _flags . compareAndSet ( current , newValue ) ) { return current ; } }
public class Timex3 { /** * setter for timexFreq - sets * @ generated * @ param v value to set into the feature */ public void setTimexFreq ( String v ) { } }
if ( Timex3_Type . featOkTst && ( ( Timex3_Type ) jcasType ) . casFeat_timexFreq == null ) jcasType . jcas . throwFeatMissing ( "timexFreq" , "de.unihd.dbs.uima.types.heideltime.Timex3" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Timex3_Type ) jcasType ) . casFeatCode_timexFreq , v ) ;
public class ClusterPairSegmentAnalysis { /** * Perform clusterings evaluation */ @ Override public void processNewResult ( ResultHierarchy hier , Result result ) { } }
// Get all new clusterings // TODO : handle clusterings added later , too . Can we update the result ? List < Clustering < ? > > clusterings = Clustering . getClusteringResults ( result ) ; // Abort if not enough clusterings to compare if ( clusterings . size ( ) < 2 ) { return ; } // create segments Segments segments = new Segments ( clusterings ) ; hier . add ( result , segments ) ;
public class JSpinnerDateEditor { /** * Enables and disabled the compoment . It also fixes the background bug * 4991597 and sets the background explicitely to a * TextField . inactiveBackground . */ public void setEnabled ( boolean b ) { } }
super . setEnabled ( b ) ; if ( ! b ) { ( ( JSpinner . DateEditor ) getEditor ( ) ) . getTextField ( ) . setBackground ( UIManager . getColor ( "TextField.inactiveBackground" ) ) ; }
public class Geobox { /** * Calculates the great circle distance between two points ( law of cosines ) . * @ param p1lat indicating the first point latitude . * @ param p1lon indicating the first point longitude . * @ param p2lat indicating the second point latitude * @ param p2lon indicating the second point longitude * @ return The 2D great - circle distance between the two given points , in meters . */ public static double distance ( double p1lat , double p1lon , double p2lat , double p2lon ) { } }
return RADIUS * Math . acos ( makeDoubleInRange ( Math . sin ( p1lat ) * Math . sin ( p2lat ) + Math . cos ( p1lat ) * Math . cos ( p2lat ) * Math . cos ( p2lon - p1lon ) ) ) ;
public class AutoDispose { /** * Entry point for auto - disposing streams from a { @ link CompletableSource } . * < p > Example usage : * < pre > < code > * Observable . just ( 1) * . as ( autoDisposable ( scope ) ) / / Static import * . subscribe ( . . . ) * < / code > < / pre > * @ param scope the target scope * @ param < T > the stream type . * @ return an { @ link AutoDisposeConverter } to transform with operators like { @ link * Observable # as ( ObservableConverter ) } */ public static < T > AutoDisposeConverter < T > autoDisposable ( final CompletableSource scope ) { } }
checkNotNull ( scope , "scope == null" ) ; return new AutoDisposeConverter < T > ( ) { @ Override public ParallelFlowableSubscribeProxy < T > apply ( final ParallelFlowable < T > upstream ) { return subscribers -> new AutoDisposeParallelFlowable < > ( upstream , scope ) . subscribe ( subscribers ) ; } @ Override public CompletableSubscribeProxy apply ( final Completable upstream ) { return new CompletableSubscribeProxy ( ) { @ Override public Disposable subscribe ( ) { return new AutoDisposeCompletable ( upstream , scope ) . subscribe ( ) ; } @ Override public Disposable subscribe ( Action action ) { return new AutoDisposeCompletable ( upstream , scope ) . subscribe ( action ) ; } @ Override public Disposable subscribe ( Action action , Consumer < ? super Throwable > onError ) { return new AutoDisposeCompletable ( upstream , scope ) . subscribe ( action , onError ) ; } @ Override public void subscribe ( CompletableObserver observer ) { new AutoDisposeCompletable ( upstream , scope ) . subscribe ( observer ) ; } @ Override public < E extends CompletableObserver > E subscribeWith ( E observer ) { return new AutoDisposeCompletable ( upstream , scope ) . subscribeWith ( observer ) ; } @ Override public TestObserver < Void > test ( ) { TestObserver < Void > observer = new TestObserver < > ( ) ; subscribe ( observer ) ; return observer ; } @ Override public TestObserver < Void > test ( boolean cancel ) { TestObserver < Void > observer = new TestObserver < > ( ) ; if ( cancel ) { observer . cancel ( ) ; } subscribe ( observer ) ; return observer ; } } ; } @ Override public FlowableSubscribeProxy < T > apply ( final Flowable < T > upstream ) { return new FlowableSubscribeProxy < T > ( ) { @ Override public Disposable subscribe ( ) { return new AutoDisposeFlowable < > ( upstream , scope ) . subscribe ( ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onNext ) { return new AutoDisposeFlowable < > ( upstream , scope ) . subscribe ( onNext ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onNext , Consumer < ? super Throwable > onError ) { return new AutoDisposeFlowable < > ( upstream , scope ) . subscribe ( onNext , onError ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onNext , Consumer < ? super Throwable > onError , Action onComplete ) { return new AutoDisposeFlowable < > ( upstream , scope ) . subscribe ( onNext , onError , onComplete ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onNext , Consumer < ? super Throwable > onError , Action onComplete , Consumer < ? super Subscription > onSubscribe ) { return new AutoDisposeFlowable < > ( upstream , scope ) . subscribe ( onNext , onError , onComplete , onSubscribe ) ; } @ Override public void subscribe ( Subscriber < ? super T > observer ) { new AutoDisposeFlowable < > ( upstream , scope ) . subscribe ( observer ) ; } @ Override public < E extends Subscriber < ? super T > > E subscribeWith ( E observer ) { return new AutoDisposeFlowable < > ( upstream , scope ) . subscribeWith ( observer ) ; } @ Override public TestSubscriber < T > test ( ) { TestSubscriber < T > ts = new TestSubscriber < > ( ) ; subscribe ( ts ) ; return ts ; } @ Override public TestSubscriber < T > test ( long initialRequest ) { TestSubscriber < T > ts = new TestSubscriber < > ( initialRequest ) ; subscribe ( ts ) ; return ts ; } @ Override public TestSubscriber < T > test ( long initialRequest , boolean cancel ) { TestSubscriber < T > ts = new TestSubscriber < > ( initialRequest ) ; if ( cancel ) { ts . cancel ( ) ; } subscribe ( ts ) ; return ts ; } } ; } @ Override public MaybeSubscribeProxy < T > apply ( final Maybe < T > upstream ) { return new MaybeSubscribeProxy < T > ( ) { @ Override public Disposable subscribe ( ) { return new AutoDisposeMaybe < > ( upstream , scope ) . subscribe ( ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onSuccess ) { return new AutoDisposeMaybe < > ( upstream , scope ) . subscribe ( onSuccess ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onSuccess , Consumer < ? super Throwable > onError ) { return new AutoDisposeMaybe < > ( upstream , scope ) . subscribe ( onSuccess , onError ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onSuccess , Consumer < ? super Throwable > onError , Action onComplete ) { return new AutoDisposeMaybe < > ( upstream , scope ) . subscribe ( onSuccess , onError , onComplete ) ; } @ Override public void subscribe ( MaybeObserver < ? super T > observer ) { new AutoDisposeMaybe < > ( upstream , scope ) . subscribe ( observer ) ; } @ Override public < E extends MaybeObserver < ? super T > > E subscribeWith ( E observer ) { return new AutoDisposeMaybe < > ( upstream , scope ) . subscribeWith ( observer ) ; } @ Override public TestObserver < T > test ( ) { TestObserver < T > observer = new TestObserver < > ( ) ; subscribe ( observer ) ; return observer ; } @ Override public TestObserver < T > test ( boolean cancel ) { TestObserver < T > observer = new TestObserver < > ( ) ; if ( cancel ) { observer . cancel ( ) ; } subscribe ( observer ) ; return observer ; } } ; } @ Override public ObservableSubscribeProxy < T > apply ( final Observable < T > upstream ) { return new ObservableSubscribeProxy < T > ( ) { @ Override public Disposable subscribe ( ) { return new AutoDisposeObservable < > ( upstream , scope ) . subscribe ( ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onNext ) { return new AutoDisposeObservable < > ( upstream , scope ) . subscribe ( onNext ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onNext , Consumer < ? super Throwable > onError ) { return new AutoDisposeObservable < > ( upstream , scope ) . subscribe ( onNext , onError ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onNext , Consumer < ? super Throwable > onError , Action onComplete ) { return new AutoDisposeObservable < > ( upstream , scope ) . subscribe ( onNext , onError , onComplete ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onNext , Consumer < ? super Throwable > onError , Action onComplete , Consumer < ? super Disposable > onSubscribe ) { return new AutoDisposeObservable < > ( upstream , scope ) . subscribe ( onNext , onError , onComplete , onSubscribe ) ; } @ Override public void subscribe ( Observer < ? super T > observer ) { new AutoDisposeObservable < > ( upstream , scope ) . subscribe ( observer ) ; } @ Override public < E extends Observer < ? super T > > E subscribeWith ( E observer ) { return new AutoDisposeObservable < > ( upstream , scope ) . subscribeWith ( observer ) ; } @ Override public TestObserver < T > test ( ) { TestObserver < T > observer = new TestObserver < > ( ) ; subscribe ( observer ) ; return observer ; } @ Override public TestObserver < T > test ( boolean dispose ) { TestObserver < T > observer = new TestObserver < > ( ) ; if ( dispose ) { observer . dispose ( ) ; } subscribe ( observer ) ; return observer ; } } ; } @ Override public SingleSubscribeProxy < T > apply ( final Single < T > upstream ) { return new SingleSubscribeProxy < T > ( ) { @ Override public Disposable subscribe ( ) { return new AutoDisposeSingle < > ( upstream , scope ) . subscribe ( ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onSuccess ) { return new AutoDisposeSingle < > ( upstream , scope ) . subscribe ( onSuccess ) ; } @ Override public Disposable subscribe ( BiConsumer < ? super T , ? super Throwable > biConsumer ) { return new AutoDisposeSingle < > ( upstream , scope ) . subscribe ( biConsumer ) ; } @ Override public Disposable subscribe ( Consumer < ? super T > onSuccess , Consumer < ? super Throwable > onError ) { return new AutoDisposeSingle < > ( upstream , scope ) . subscribe ( onSuccess , onError ) ; } @ Override public void subscribe ( SingleObserver < ? super T > observer ) { new AutoDisposeSingle < > ( upstream , scope ) . subscribe ( observer ) ; } @ Override public < E extends SingleObserver < ? super T > > E subscribeWith ( E observer ) { return new AutoDisposeSingle < > ( upstream , scope ) . subscribeWith ( observer ) ; } @ Override public TestObserver < T > test ( ) { TestObserver < T > observer = new TestObserver < > ( ) ; subscribe ( observer ) ; return observer ; } @ Override public TestObserver < T > test ( boolean dispose ) { TestObserver < T > observer = new TestObserver < > ( ) ; if ( dispose ) { observer . dispose ( ) ; } subscribe ( observer ) ; return observer ; } } ; } } ;
public class Leadership { /** * Maps the leadership identifiers using the given mapper . * @ param mapper the mapper with which to convert identifiers * @ param < U > the converted identifier type * @ return the converted leadership */ public < U > Leadership < U > map ( Function < T , U > mapper ) { } }
return new Leadership < > ( leader != null ? leader . map ( mapper ) : null , candidates . stream ( ) . map ( mapper ) . collect ( Collectors . toList ( ) ) ) ;
public class VATINStructureManager { /** * Resolve the VATIN structure only from the country part of the given VATIN . * This should help indicate how the VATIN is valid . * @ param sVATIN * The VATIN with at least 2 characters for the country code . * @ return < code > null < / code > if the passed string is shorter than 2 characters * or if the passed VATIN country code is invalid / unknown . */ @ Nullable public static VATINStructure getFromVATINCountry ( @ Nullable final String sVATIN ) { } }
if ( StringHelper . getLength ( sVATIN ) >= 2 ) { final String sCountry = sVATIN . substring ( 0 , 2 ) ; for ( final VATINStructure aStructure : s_aList ) if ( aStructure . getExamples ( ) . get ( 0 ) . substring ( 0 , 2 ) . equalsIgnoreCase ( sCountry ) ) return aStructure ; } return null ;
public class NearestNeighbourDescription { /** * Initializes the Nearest Neighbour Distance ( NN - d ) classifier with the argument training points . * @ param trainingPoints the Collection of instances on which to initialize the NN - d classifier . */ @ Override public void initialize ( Collection < Instance > trainingPoints ) { } }
Iterator < Instance > trgPtsIterator = trainingPoints . iterator ( ) ; if ( trgPtsIterator . hasNext ( ) ) this . trainOnInstance ( trgPtsIterator . next ( ) ) ;
public class OStringSerializerAnyStreamable { /** * Re - Create any object if the class has a public constructor that accepts a String as unique parameter . */ public Object fromStream ( final String iStream ) { } }
if ( iStream == null || iStream . length ( ) == 0 ) // NULL VALUE return null ; OSerializableStream instance = null ; int propertyPos = iStream . indexOf ( ':' ) ; int pos = iStream . indexOf ( OStreamSerializerHelper . SEPARATOR ) ; if ( pos < 0 || propertyPos > - 1 && pos > propertyPos ) { instance = new ODocument ( ) ; pos = - 1 ; } else { final String className = iStream . substring ( 0 , pos ) ; try { final Class < ? > clazz = Class . forName ( className ) ; instance = ( OSerializableStream ) clazz . newInstance ( ) ; } catch ( Exception e ) { OLogManager . instance ( ) . error ( this , "Error on unmarshalling content. Class: " + className , e , OSerializationException . class ) ; } } instance . fromStream ( OBase64Utils . decode ( iStream . substring ( pos + 1 ) ) ) ; return instance ;
public class BusNetwork { /** * Replies the bus stop with the specified name . * @ param name is the desired name * @ param nameComparator is used to compare the names . * @ return BusStop or < code > null < / code > */ @ Pure public BusStop getBusStop ( String name , Comparator < String > nameComparator ) { } }
if ( name == null ) { return null ; } final Comparator < String > cmp = nameComparator == null ? BusNetworkUtilities . NAME_COMPARATOR : nameComparator ; for ( final BusStop busStop : this . validBusStops ) { if ( cmp . compare ( name , busStop . getName ( ) ) == 0 ) { return busStop ; } } for ( final BusStop busStop : this . invalidBusStops ) { if ( cmp . compare ( name , busStop . getName ( ) ) == 0 ) { return busStop ; } } return null ;
public class AttributesImpl { /** * Returns all < code > embedded < / code > elements * @ return list of < code > embedded < / code > */ public List < Embedded < Attributes < T > > > getAllEmbedded ( ) { } }
List < Embedded < Attributes < T > > > list = new ArrayList < Embedded < Attributes < T > > > ( ) ; List < Node > nodeList = childNode . get ( "embedded" ) ; for ( Node node : nodeList ) { Embedded < Attributes < T > > type = new EmbeddedImpl < Attributes < T > > ( this , "embedded" , childNode , node ) ; list . add ( type ) ; } return list ;
public class AckErrorCode { /** * Create a new { @ link AckErrorCode } from the String value . * @ param value String value of the error code . * @ return An { @ link AckErrorCode } or null if the value was null . */ public static AckErrorCode of ( String value ) { } }
return value == null ? null : new AckErrorCode ( Values . fromValue ( value ) , value ) ;
public class HttpClientNIOResourceAdaptor { /** * ( non - Javadoc ) * @ see * javax . slee . resource . ResourceAdaptor # queryLiveness ( javax . slee . resource * . ActivityHandle ) */ public void queryLiveness ( ActivityHandle arg0 ) { } }
// if the activity is not in the map end it , its a leak if ( ! activities . contains ( arg0 ) ) { resourceAdaptorContext . getSleeEndpoint ( ) . endActivity ( arg0 ) ; }
public class ReceiveMessageBuilder { /** * Expect this message payload as model object which is marshalled to a character sequence * using the default object to xml mapper before validation is performed . * @ param payload * @ param marshaller * @ return */ public T payload ( Object payload , Marshaller marshaller ) { } }
StringResult result = new StringResult ( ) ; try { marshaller . marshal ( payload , result ) ; } catch ( XmlMappingException e ) { throw new CitrusRuntimeException ( "Failed to marshal object graph for message payload" , e ) ; } catch ( IOException e ) { throw new CitrusRuntimeException ( "Failed to marshal object graph for message payload" , e ) ; } setPayload ( result . toString ( ) ) ; return self ;
public class DefaultBinding { /** * { @ inheritDoc } */ public void unbind ( ) { } }
checkBound ( ) ; source . removeObservableListener ( sourceListener ) ; target . removeObservableListener ( targetListener ) ; boundPhase = null ;
public class TEEJBInvocationInfo { /** * This is called by the EJB container server code to write a * EJB method call preinvoke ends record to the trace log , if enabled . */ public static void tracePreInvokeEnds ( EJSDeployedSupport s , EJSWrapperBase wrapper ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { StringBuffer sbuf = new StringBuffer ( ) ; sbuf . append ( MthdPreInvokeExit_Type_Str ) . append ( DataDelimiter ) . append ( MthdPreInvokeExit_Type ) . append ( DataDelimiter ) ; writeDeployedSupportInfo ( s , sbuf , wrapper , null ) ; Tr . debug ( tc , sbuf . toString ( ) ) ; }
public class MobileCommand { /** * This method forms a { @ link Map } of parameters for the checking of the keyboard state ( is it shown or not ) . * @ return a key - value pair . The key is the command name . The value is a { @ link Map } command arguments . */ public static Map . Entry < String , Map < String , ? > > isKeyboardShownCommand ( ) { } }
return new AbstractMap . SimpleEntry < > ( IS_KEYBOARD_SHOWN , ImmutableMap . of ( ) ) ;
public class Yank { /** * Return a List of Beans given a SQL Key using an SQL statement matching the sqlKey String in a * properties file loaded via Yank . addSQLStatements ( . . . ) using the default connection pool . * @ param sqlKey The SQL Key found in a properties file corresponding to the desired SQL statement * value * @ param beanType The Class of the desired return Objects matching the table * @ param params The replacement parameters * @ return The List of Objects * @ throws SQLStatementNotFoundException if an SQL statement could not be found for the given * sqlKey String */ public static < T > List < T > queryBeanListSQLKey ( String sqlKey , Class < T > beanType , Object [ ] params ) throws SQLStatementNotFoundException , YankSQLException { } }
return queryBeanListSQLKey ( YankPoolManager . DEFAULT_POOL_NAME , sqlKey , beanType , params ) ;
public class DObject { /** * Creates the accessors that will be used to read and write this object ' s attributes . The * default implementation assumes the object ' s attributes are all public fields and uses * reflection to get and set their values . */ protected Accessor [ ] createAccessors ( ) { } }
Field [ ] fields = getClass ( ) . getFields ( ) ; // assume we have one static field for every non - static field List < Accessor > accs = Lists . newArrayListWithExpectedSize ( fields . length / 2 ) ; for ( Field field : fields ) { if ( ! Modifier . isStatic ( field . getModifiers ( ) ) ) { // skip static fields accs . add ( new Accessor . ByField ( field ) ) ; } } return accs . toArray ( new Accessor [ accs . size ( ) ] ) ;