signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ContainerCreate { /** * Construct set of port bindings from comma delimited list of ports . * @ param portSpecs * @ param exposedPorts * @ param context * @ return */ private Ports getPortBindings ( String portSpecs , ExposedPort [ ] exposedPorts , TestContext context ) { } }
String [ ] ports = StringUtils . commaDelimitedListToStringArray ( portSpecs ) ; Ports portsBindings = new Ports ( ) ; for ( String portSpec : ports ) { String [ ] binding = context . replaceDynamicContentInString ( portSpec ) . split ( ":" ) ; if ( binding . length == 2 ) { Integer hostPort = Integer . valueOf ( bindi...
public class IdentityStoreHandlerServiceImpl { /** * Returns the partial subject for hashtable login * @ param username * @ return the partial subject which can be used for hashtable login if username and password are valid . * @ throws com . ibm . ws . security . authentication . AuthenticationException */ @ Ove...
CallerOnlyCredential credential = new CallerOnlyCredential ( username ) ; return createHashtableInSubject ( credential ) ;
public class BatchCreateNotesRequest { /** * Use { @ link # getNotesMap ( ) } instead . */ @ java . lang . Deprecated public java . util . Map < java . lang . String , io . grafeas . v1beta1 . Note > getNotes ( ) { } }
return getNotesMap ( ) ;
public class AWSStepFunctionsClient { /** * Lists the existing state machines . * If < code > nextToken < / code > is returned , there are more results available . The value of < code > nextToken < / code > is a * unique pagination token for each page . Make the call again using the returned token to retrieve the n...
request = beforeClientExecution ( request ) ; return executeListStateMachines ( request ) ;
public class WIMUserRegistry { /** * { @ inheritDoc } */ @ Override @ FFDCIgnore ( Exception . class ) public SearchResult getGroups ( final String inputPattern , final int inputLimit ) throws RegistryException { } }
try { SearchResult returnValue = searchBridge . getGroups ( inputPattern , inputLimit ) ; return returnValue ; } catch ( Exception excp ) { if ( excp instanceof RegistryException ) throw ( RegistryException ) excp ; else throw new RegistryException ( excp . getMessage ( ) , excp ) ; }
public class AbstractRegistry { /** * { @ inheritDoc } * @ return { @ inheritDoc } */ @ Override public int size ( ) { } }
registryLock . readLock ( ) . lock ( ) ; try { return entryMap . size ( ) ; } finally { registryLock . readLock ( ) . unlock ( ) ; }
public class ConfigWebUtil { /** * default encryption for configuration ( not very secure ) * @ param str * @ return */ public static String decrypt ( String str ) { } }
if ( StringUtil . isEmpty ( str ) || ! StringUtil . startsWithIgnoreCase ( str , "encrypted:" ) ) return str ; str = str . substring ( 10 ) ; return new BlowfishEasy ( "sdfsdfs" ) . decryptString ( str ) ;
public class XMLStreamEventsSync { /** * Shortcut to move forward to the next START _ ELEMENT , return false if no START _ ELEMENT event was found . */ public boolean nextStartElement ( ) throws XMLException , IOException { } }
try { do { next ( ) ; } while ( ! Type . START_ELEMENT . equals ( event . type ) ) ; return true ; } catch ( EOFException e ) { return false ; }
public class ServiceUtils { /** * Find the only expected instance of { @ code clazz } among the { @ code instances } . * @ param clazz searched class * @ param instances instances looked at * @ param < T > type of the searched instance * @ return the optionally found compatible instance * @ throws IllegalArgu...
return findStreamAmongst ( clazz , instances ) . reduce ( ( i1 , i2 ) -> { throw new IllegalArgumentException ( "More than one " + clazz . getName ( ) + " found" ) ; } ) ;
public class DigestUtils { /** * Create a new { @ link MessageDigest } with the given algorithm . Necessary because { @ code MessageDigest } is not * thread - safe . */ private static MessageDigest getDigest ( String algorithm ) { } }
try { return MessageDigest . getInstance ( algorithm ) ; } catch ( NoSuchAlgorithmException ex ) { throw new IllegalStateException ( "Could not find MessageDigest with algorithm \"" + algorithm + "\"" , ex ) ; }
public class SimpleFormatter { /** * / * [ deutsch ] * < p > Konstruiert einen Formatierer f & uuml ; r globale Zeitstempelobjekte ( Momente ) . < / p > * @ param dateStyle format style for the date component * @ param timeStyle format style for the time component * @ param locale format locale * @ param tzid...
DateFormat df = DateFormat . getDateTimeInstance ( dateStyle . getStyleValue ( ) , timeStyle . getStyleValue ( ) , locale ) ; String pattern = getFormatPattern ( df ) ; return SimpleFormatter . ofMomentPattern ( pattern , locale , tzid ) ;
public class TransformTimestampToCalendar { /** * Transforms the * < code > java . sql . Timestamp < / code > returned from JDBC into a * < code > java . util . Calendar < / code > to be used by the class . * @ param ts The Timestamp from JDBC . * @ return A Calendar Object * @ throws CpoException */ @ Overri...
Calendar cal = null ; if ( ts != null ) { cal = Calendar . getInstance ( ) ; cal . setTimeInMillis ( ts . getTime ( ) ) ; } return cal ;
public class DfsTraversalNode { /** * Get a Node object for each possible state of the system after triggering * the given event . * @ param e the selected event * @ param exSvc The executor service that will run the threads * @ return State of the BProgram after event { @ code e } was selected while * the pr...
try { return new DfsTraversalNode ( bp , BProgramSyncSnapshotCloner . clone ( systemState ) . triggerEvent ( e , exSvc , Collections . emptySet ( ) ) , e ) ; } catch ( InterruptedException ie ) { throw new BPjsRuntimeException ( "Thread interrupted during event invocaiton" , ie ) ; }
public class InjectionPointFactory { /** * Creation of callable InjectionPoints */ public < T > ConstructorInjectionPoint < T > createConstructorInjectionPoint ( Bean < T > declaringBean , EnhancedAnnotatedType < T > type , BeanManagerImpl manager ) { } }
EnhancedAnnotatedConstructor < T > constructor = Beans . getBeanConstructorStrict ( type ) ; return createConstructorInjectionPoint ( declaringBean , type . getJavaClass ( ) , constructor , manager ) ;
public class Metadata { /** * Serialize all the metadata entries . * < p > It produces serialized names and values interleaved . result [ i * 2 ] are names , while * result [ i * 2 + 1 ] are values . * < p > Names are ASCII string bytes that contains only the characters listed in the class comment * of { @ link...
if ( len ( ) == cap ( ) ) { return namesAndValues ; } byte [ ] [ ] serialized = new byte [ len ( ) ] [ ] ; System . arraycopy ( namesAndValues , 0 , serialized , 0 , len ( ) ) ; return serialized ;
public class BDDDotFileWriter { /** * Writes a given BDD as a dot file . * @ param fileName the file name of the dot file to write * @ param bdd the BDD * @ throws IOException if there was a problem writing the file */ public static void write ( final String fileName , final BDD bdd ) throws IOException { } }
write ( new File ( fileName . endsWith ( ".dot" ) ? fileName : fileName + ".dot" ) , bdd ) ;
public class MessageDigestUtils { /** * Calculate the message digest value with SHA 256 algorithm . * @ param data to calculate . * @ return message digest value . */ public static byte [ ] computeSha256 ( final byte [ ] data ) { } }
try { return MessageDigest . getInstance ( ALGORITHM_SHA_256 ) . digest ( data ) ; } catch ( NoSuchAlgorithmException e ) { throw new IllegalStateException ( "unsupported algorithm for message digest: " , e ) ; }
public class ModeledUser { /** * Stores all restricted ( privileged ) attributes within the given Map , * pulling the values of those attributes from the underlying user model . * If no value is yet defined for an attribute , that attribute will be set * to null . * @ param attributes * The Map to store all r...
// Set disabled attribute attributes . put ( DISABLED_ATTRIBUTE_NAME , getModel ( ) . isDisabled ( ) ? "true" : null ) ; // Set password expired attribute attributes . put ( EXPIRED_ATTRIBUTE_NAME , getModel ( ) . isExpired ( ) ? "true" : null ) ; // Set access window start time attributes . put ( ACCESS_WINDOW_START_A...
public class XMLUnit { /** * Get the < code > DocumentBuilder < / code > instance used to parse the control * XML in an XMLTestCase . * @ return parser for control values * @ throws ConfigurationException */ public static DocumentBuilder newControlParser ( ) throws ConfigurationException { } }
try { controlBuilderFactory = getControlDocumentBuilderFactory ( ) ; DocumentBuilder builder = controlBuilderFactory . newDocumentBuilder ( ) ; if ( controlEntityResolver != null ) { builder . setEntityResolver ( controlEntityResolver ) ; } return builder ; } catch ( ParserConfigurationException ex ) { throw new Config...
public class ContextVector { /** * Gives the list of terms in this context vector sorted by frequency * ( most frequent first ) * @ return */ public List < Entry > getEntries ( ) { } }
if ( _sortedEntries == null ) { this . _sortedEntries = Lists . newArrayListWithCapacity ( entries . size ( ) ) ; for ( Map . Entry < Term , Entry > e : entries . entrySet ( ) ) this . _sortedEntries . add ( e . getValue ( ) ) ; Collections . sort ( this . _sortedEntries ) ; } return _sortedEntries ;
public class PackagesScreen { /** * Set up all the screen fields . */ public void setupSFields ( ) { } }
this . getRecord ( Packages . PACKAGES_FILE ) . getField ( Packages . CODE ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ) ; this . getRecord ( Packages . PACKAGES_FILE ) . getField ( Packages . NAME ) . set...
public class Dim { /** * Attaches the debugger to the given ContextFactory . */ public void attachTo ( ContextFactory factory ) { } }
detach ( ) ; this . contextFactory = factory ; this . listener = new DimIProxy ( this , IPROXY_LISTEN ) ; factory . addListener ( this . listener ) ;
public class dnsaddrec { /** * Use this API to fetch all the dnsaddrec resources that are configured on netscaler . * This uses dnsaddrec _ args which is a way to provide additional arguments while fetching the resources . */ public static dnsaddrec [ ] get ( nitro_service service , dnsaddrec_args args ) throws Excep...
dnsaddrec obj = new dnsaddrec ( ) ; options option = new options ( ) ; option . set_args ( nitro_util . object_to_string_withoutquotes ( args ) ) ; dnsaddrec [ ] response = ( dnsaddrec [ ] ) obj . get_resources ( service , option ) ; return response ;
public class NodeTypes { /** * Obtain a new version of this cache with the specified node types added to the new cache . * @ param addedNodeTypes the node types that are to be added to the resulting cache ; may not be null but may be empty * @ return the resulting cache that contains all of the node types within th...
if ( addedNodeTypes . isEmpty ( ) ) return this ; Collection < JcrNodeType > nodeTypes = new HashSet < JcrNodeType > ( this . nodeTypes . values ( ) ) ; // if there are updated node types , remove them first ( hashcode is based on name alone ) , // else addAll ( ) will ignore the changes . nodeTypes . removeAll ( added...
public class UpdateDevEndpointRequest { /** * The map of arguments to add the map of arguments used to configure the DevEndpoint . * @ param addArguments * The map of arguments to add the map of arguments used to configure the DevEndpoint . * @ return Returns a reference to this object so that method calls can be...
setAddArguments ( addArguments ) ; return this ;
public class ClustersInner { /** * Gets the gateway settings for the specified cluster . * @ param resourceGroupName The name of the resource group . * @ param clusterName The name of the cluster . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the Gate...
return getGatewaySettingsWithServiceResponseAsync ( resourceGroupName , clusterName ) . map ( new Func1 < ServiceResponse < GatewaySettingsInner > , GatewaySettingsInner > ( ) { @ Override public GatewaySettingsInner call ( ServiceResponse < GatewaySettingsInner > response ) { return response . body ( ) ; } } ) ;
public class CommonsQueryEngine { /** * This method execute a query . * @ param workflow the workflow to be executed . * @ return the query result . * @ throws ConnectorException if a error happens . */ @ Override public final QueryResult execute ( String queryId , LogicalWorkflow workflow ) throws ConnectorExcep...
QueryResult result = null ; Long time = null ; try { for ( LogicalStep project : workflow . getInitialSteps ( ) ) { ClusterName clusterName = ( ( Project ) project ) . getClusterName ( ) ; connectionHandler . startJob ( clusterName . getName ( ) ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Executing [" ...
public class WicketUrlExtensions { /** * Gets the canonical page url . Try to reduce url by eliminating ' . . ' and ' . ' from the path * where appropriate ( this is somehow similar to { @ link java . io . File # getCanonicalPath ( ) } ) . * @ param pageClass * the page class * @ param parameters * the parame...
return getPageUrl ( pageClass , parameters ) . canonical ( ) ;
public class TransactWriteItemsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TransactWriteItemsRequest transactWriteItemsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( transactWriteItemsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( transactWriteItemsRequest . getTransactItems ( ) , TRANSACTITEMS_BINDING ) ; protocolMarshaller . marshall ( transactWriteItemsRequest . getReturnConsumedCapac...
public class CryptoHelper { /** * Create signature for JWT header and payload . * @ param algorithm algorithm name . * @ param secretBytes algorithm secret . * @ param headerBytes JWT header . * @ param payloadBytes JWT payload . * @ return the signature bytes . * @ throws NoSuchAlgorithmException if the al...
final Mac mac = Mac . getInstance ( algorithm ) ; mac . init ( new SecretKeySpec ( secretBytes , algorithm ) ) ; mac . update ( headerBytes ) ; mac . update ( JWT_PART_SEPARATOR ) ; return mac . doFinal ( payloadBytes ) ;
public class Timespan { /** * Validates the timespan * @ throws IllegalArgumentException if one or more parameters were invalid */ public void validate ( ) { } }
if ( start == null || start . isEmpty ( ) ) { throw new IllegalArgumentException ( "missing or empty start" ) ; } DateTime . parseDateTimeString ( start , timezone ) ; if ( end != null && ! end . isEmpty ( ) ) { DateTime . parseDateTimeString ( end , timezone ) ; } if ( downsampler != null ) { downsampler . validate ( ...
public class CardAPI { /** * 创建团购券 * @ param accessToken accessToken * @ param grouponCard grouponCard * @ return result */ public static CreateResult create ( String accessToken , GrouponCard grouponCard ) { } }
Create < GrouponCard > card = new Create < GrouponCard > ( ) ; card . setCard ( grouponCard ) ; return create ( accessToken , card ) ;
public class ActivitysInner { /** * Retrieve a list of activities in the module identified by module name . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedL...
return listByModuleNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < ActivityInner > > , Page < ActivityInner > > ( ) { @ Override public Page < ActivityInner > call ( ServiceResponse < Page < ActivityInner > > response ) { return response . body ( ) ; } } ) ;
public class ActorRef { /** * Send message once * @ param message message * @ param delay delay * @ param sender sender */ public void sendOnce ( Object message , long delay , ActorRef sender ) { } }
dispatcher . sendMessageOnce ( endpoint , message , ActorTime . currentTime ( ) + delay , sender ) ;
public class Model { /** * Gets the person with the specified name . * @ param name the name of the person * @ return the Person instance with the specified name ( or null if it doesn ' t exist ) * @ throws IllegalArgumentException if the name is null or empty */ @ Nullable public Person getPersonWithName ( @ Non...
if ( name == null || name . trim ( ) . length ( ) == 0 ) { throw new IllegalArgumentException ( "A person name must be specified." ) ; } for ( Person person : getPeople ( ) ) { if ( person . getName ( ) . equals ( name ) ) { return person ; } } return null ;
public class EntityReferenceResolverDecorator { /** * Resolve entity references based on given fetch */ @ Override public Stream < Entity > findAll ( Query < Entity > q ) { } }
Stream < Entity > entities = delegate ( ) . findAll ( q ) ; return resolveEntityReferences ( entities , q . getFetch ( ) ) ;
public class Distance { /** * Gets the Minkowski distance between two points . * @ param u A point in space . * @ param v A point in space . * @ param p Order between two points . * @ return The Minkowski distance between x and y . */ public static double Minkowski ( double [ ] u , double [ ] v , double p ) { }...
double distance = 0 ; for ( int i = 0 ; i < u . length ; i ++ ) { distance += Math . pow ( Math . abs ( u [ i ] - v [ i ] ) , p ) ; } return Math . pow ( distance , 1 / p ) ;
public class JmolSymmetryScriptGeneratorCn { /** * Returns the name of a specific orientation * @ param index orientation index * @ return name of orientation */ @ Override public String getOrientationName ( int index ) { } }
if ( getAxisTransformation ( ) . getRotationGroup ( ) . getPointGroup ( ) . equals ( "C2" ) ) { if ( index == 0 ) { return "Front C2 axis" ; } else if ( index == 2 ) { return "Back C2 axis" ; } } return getPolyhedron ( ) . getViewName ( index ) ;
public class DescribeProtectionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeProtectionRequest describeProtectionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeProtectionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeProtectionRequest . getProtectionId ( ) , PROTECTIONID_BINDING ) ; protocolMarshaller . marshall ( describeProtectionRequest . getResourceArn ( ) , RES...
public class CreateNetworkInterfacePermissionRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < CreateNetworkInterfacePermissionRequest > getDryRunRequest ( ) { } }
Request < CreateNetworkInterfacePermissionRequest > request = new CreateNetworkInterfacePermissionRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class CategoryChart { /** * Update a series by updating the X - Axis , Y - Axis and error bar data * @ param seriesName * @ param newXData - set null to be automatically generated as a list of increasing Integers * starting from 1 and ending at the size of the new Y - Axis data list . * @ param newYData ...
return updateCategorySeries ( seriesName , Utils . getNumberListFromDoubleArray ( newXData ) , Utils . getNumberListFromDoubleArray ( newYData ) , Utils . getNumberListFromDoubleArray ( newErrorBarData ) ) ;
public class StringGroovyMethods { /** * Finds all occurrences of a regular expression string within a CharSequence . Any matches are passed to the specified closure . The closure * is expected to have the full match in the first parameter . If there are any capture groups , they will be placed in subsequent paramete...
return findAll ( self , Pattern . compile ( regex . toString ( ) ) , closure ) ;
public class LinearEquationSystem { /** * Method for trivial pivot search , searches for non - zero entry . * @ param k search starts at entry ( k , k ) * @ return the position of the found pivot element */ private IntIntPair nonZeroPivotSearch ( int k ) { } }
int i , j ; double absValue ; for ( i = k ; i < coeff . length ; i ++ ) { for ( j = k ; j < coeff [ 0 ] . length ; j ++ ) { // compute absolute value of // current entry in absValue absValue = Math . abs ( coeff [ row [ i ] ] [ col [ j ] ] ) ; // check if absValue is non - zero if ( absValue > 0 ) { // found a pivot el...
public class HtmlForm { /** * < p > Return the value of the < code > acceptcharset < / code > property . < / p > * < p > Contents : List of character encodings for input data * that are accepted by the server processing * this form . */ public java . lang . String getAcceptcharset ( ) { } }
return ( java . lang . String ) getStateHelper ( ) . eval ( PropertyKeys . acceptcharset ) ;
public class OtpMbox { /** * used to break all known links to this mbox */ void breakLinks ( final OtpErlangObject reason ) { } }
final Link [ ] l = links . clearLinks ( ) ; if ( l != null ) { final int len = l . length ; for ( int i = 0 ; i < len ; i ++ ) { exit ( 1 , l [ i ] . remote ( ) , reason ) ; } }
public class TinyBus { /** * Use this method to get a bus instance bound to the given context . * If instance does not yet exist in the context , a new instance * will be created . Otherwise existing instance gets returned . * < p > Bus instance can be bound to a context . * < p > If you need a singleton instan...
final TinyBusDepot depot = TinyBusDepot . get ( context ) ; TinyBus bus = depot . getBusInContext ( context ) ; if ( bus == null ) { bus = depot . createBusInContext ( context ) ; } return bus ;
public class TypeUtil { /** * Returns a string representation of the byte array as an unsigned array of bytes * ( e . g . " [ 1 , 2 , 3 ] " - Not a conversion of the byte array to a string ) . * @ param bytes the byte array * @ return the byte array as a string */ public static String byteArray2String ( byte [ ] ...
StringBuffer sb = new StringBuffer ( "[" ) ; // $ NON - NLS - 1 $ int i = 0 ; for ( byte b : bytes ) { sb . append ( i ++ == 0 ? "" : ", " ) . append ( ( ( int ) b ) & 0xFF ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ } return sb . append ( "]" ) . toString ( ) ; // $ NON - NLS - 1 $
public class CmsJspStandardContextBean { /** * Returns a lazy map which creates a wrapper object for a dynamic function format when given an XML content * as a key . < p > * @ return a lazy map for accessing function formats for a content */ public Map < CmsJspContentAccessBean , CmsDynamicFunctionFormatWrapper > g...
Transformer transformer = new Transformer ( ) { @ Override public Object transform ( Object contentAccess ) { CmsXmlContent content = ( CmsXmlContent ) ( ( ( CmsJspContentAccessBean ) contentAccess ) . getRawContent ( ) ) ; CmsDynamicFunctionParser parser = new CmsDynamicFunctionParser ( ) ; CmsDynamicFunctionBean func...
public class RendererRequestUtils { /** * Clears the request when dispatch * @ param request * the request * @ param requestDispatchAttribute * the request attribute name to determine the dispatch type * @ param bundleRendererCtxAttributeName * the bundle renderer context attribute to clean * @ param jawr...
if ( request . getAttribute ( requestDispatchAttribute ) != null && request . getAttribute ( jawrDispathAttributeName ) == null ) { request . removeAttribute ( bundleRendererCtxAttributeName ) ; request . setAttribute ( jawrDispathAttributeName , Boolean . TRUE ) ; }
public class KeyVaultClientBaseImpl { /** * List all versions of the specified secret . * The full secret identifier and attributes are provided in the response . No values are returned for the secrets . This operations requires the secrets / list permission . * @ param nextPageLink The NextLink from the previous s...
return AzureServiceFuture . fromPageResponse ( getSecretVersionsNextSinglePageAsync ( nextPageLink ) , new Func1 < String , Observable < ServiceResponse < Page < SecretItem > > > > ( ) { @ Override public Observable < ServiceResponse < Page < SecretItem > > > call ( String nextPageLink ) { return getSecretVersionsNextS...
public class CmsFrameset { /** * Returns the startup URI for display in the main body frame , this can * either be the user default view , or ( if set ) a specific startup resource . < p > * @ return the startup URI for display in the main body frame */ public String getStartupUri ( ) { } }
String result = getSettings ( ) . getViewStartup ( ) ; if ( result == null ) { // no specific startup URI is set , use view from user settings result = getSettings ( ) . getViewUri ( ) ; } else { // reset the startup URI , so that it is not displayed again on reload of the frameset getSettings ( ) . setViewStartup ( nu...
public class BaasDocument { /** * Asynchronously fetches the document identified by < code > id < / code > in < code > collection < / code > * @ param collection the collection to retrieve the document from . Not < code > null < / code > * @ param id the id of the document to retrieve . Not < code > null < / code >...
return doFetch ( collection , id , withAcl , RequestOptions . DEFAULT , handler ) ;
public class CmsXmlContentDefinition { /** * Validates if a given element has exactly the required attributes set . < p > * @ param element the element to validate * @ param requiredAttributes the list of required attributes * @ param optionalAttributes the list of optional attributes * @ throws CmsXmlException...
if ( element . attributeCount ( ) < requiredAttributes . length ) { throw new CmsXmlException ( Messages . get ( ) . container ( Messages . ERR_EL_ATTRIBUTE_TOOFEW_3 , element . getUniquePath ( ) , new Integer ( requiredAttributes . length ) , new Integer ( element . attributeCount ( ) ) ) ) ; } if ( element . attribut...
public class ScannerImpl { /** * Push the given descriptor with all it ' s types to the context . * @ param descriptor * The descriptor . * @ param < D > * The descriptor type . */ private < D extends Descriptor > void pushDesriptor ( Class < D > type , D descriptor ) { } }
if ( descriptor != null ) { scannerContext . push ( type , descriptor ) ; scannerContext . setCurrentDescriptor ( descriptor ) ; }
public class AbstractMOEAD { /** * Initialize weight vectors */ protected void initializeUniformWeight ( ) { } }
if ( ( problem . getNumberOfObjectives ( ) == 2 ) && ( populationSize <= 300 ) ) { for ( int n = 0 ; n < populationSize ; n ++ ) { double a = 1.0 * n / ( populationSize - 1 ) ; lambda [ n ] [ 0 ] = a ; lambda [ n ] [ 1 ] = 1 - a ; } } else { String dataFileName ; dataFileName = "W" + problem . getNumberOfObjectives ( )...
public class SampleChannelDataRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( SampleChannelDataRequest sampleChannelDataRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( sampleChannelDataRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sampleChannelDataRequest . getChannelName ( ) , CHANNELNAME_BINDING ) ; protocolMarshaller . marshall ( sampleChannelDataRequest . getMaxMessages ( ) , MAXMESSA...
public class RouteFiltersInner { /** * Gets all route filters in a subscription . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; RouteFilterInner & gt ; object */ public Observable < Page < RouteFilterInner > > listAsync ( ) { } }
return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < Page < RouteFilterInner > > , Page < RouteFilterInner > > ( ) { @ Override public Page < RouteFilterInner > call ( ServiceResponse < Page < RouteFilterInner > > response ) { return response . body ( ) ; } } ) ;
public class BlobOutputStream { /** * Completes the stream . */ @ Override public void close ( ) throws IOException { } }
if ( _isClosed ) { return ; } _isClosed = true ; flushBlock ( true ) ; _cursor . setBlob ( _column . index ( ) , this ) ;
public class TransactGetItemsResult { /** * An ordered array of up to 10 < code > ItemResponse < / code > objects , each of which corresponds to the * < code > TransactGetItem < / code > object in the same position in the < i > TransactItems < / i > array . Each * < code > ItemResponse < / code > object contains a ...
if ( responses == null ) { this . responses = null ; return ; } this . responses = new java . util . ArrayList < ItemResponse > ( responses ) ;
public class VirtualNetworkGatewaysInner { /** * This operation retrieves a list of routes the virtual network gateway has learned , including routes learned from BGP peers . * @ param resourceGroupName The name of the resource group . * @ param virtualNetworkGatewayName The name of the virtual network gateway . ...
return beginGetLearnedRoutesWithServiceResponseAsync ( resourceGroupName , virtualNetworkGatewayName ) . map ( new Func1 < ServiceResponse < GatewayRouteListResultInner > , GatewayRouteListResultInner > ( ) { @ Override public GatewayRouteListResultInner call ( ServiceResponse < GatewayRouteListResultInner > response )...
public class AbstractCasMultifactorWebflowConfigurer { /** * Augment mfa provider flow registry . * @ param mfaProviderFlowRegistry the mfa provider flow registry */ protected void augmentMultifactorProviderFlowRegistry ( final FlowDefinitionRegistry mfaProviderFlowRegistry ) { } }
val flowIds = mfaProviderFlowRegistry . getFlowDefinitionIds ( ) ; Arrays . stream ( flowIds ) . forEach ( id -> { val flow = ( Flow ) mfaProviderFlowRegistry . getFlowDefinition ( id ) ; if ( flow != null && containsFlowState ( flow , CasWebflowConstants . STATE_ID_REAL_SUBMIT ) ) { val states = getCandidateStatesForM...
public class HtmlTableRendererBase { /** * actually render the end of the table */ protected void endTable ( FacesContext facesContext , UIComponent uiComponent ) throws IOException { } }
ResponseWriter writer = facesContext . getResponseWriter ( ) ; writer . endElement ( HTML . TABLE_ELEM ) ;
public class StringUtils { /** * Joins a collection of string with a given delimiter . * @ param strings The collection of strings to join . * @ param delimiter The delimiter to use to join them . * @ return The string built by joining the string with the delimiter . */ public static String join ( Collection stri...
StringBuilder builder = new StringBuilder ( ) ; Iterator < String > iter = strings . iterator ( ) ; while ( iter . hasNext ( ) ) { builder . append ( iter . next ( ) ) ; if ( ! iter . hasNext ( ) ) { break ; } builder . append ( delimiter ) ; } return builder . toString ( ) ;
public class StringUtils { /** * < p > Checks if CharSequence contains a search CharSequence irrespective of case , * handling { @ code null } . Case - insensitivity is defined as by * { @ link String # equalsIgnoreCase ( String ) } . * < p > A { @ code null } CharSequence will return { @ code false } . < / p > ...
if ( str == null || searchStr == null ) { return false ; } final int len = searchStr . length ( ) ; final int max = str . length ( ) - len ; for ( int i = 0 ; i <= max ; i ++ ) { if ( CharSequenceUtils . regionMatches ( str , true , i , searchStr , 0 , len ) ) { return true ; } } return false ;
public class ComputeNodeOperations { /** * Reboots the specified compute node . * < p > You can reboot a compute node only when it is in the { @ link com . microsoft . azure . batch . protocol . models . ComputeNodeState # IDLE Idle } or { @ link com . microsoft . azure . batch . protocol . models . ComputeNodeState ...
rebootComputeNode ( poolId , nodeId , null , null ) ;
public class JFinalViewResolver { /** * spring 回调 , 利用 ServletContext 做必要的初始化工作 */ @ Override protected void initServletContext ( ServletContext servletContext ) { } }
super . initServletContext ( servletContext ) ; super . setExposeRequestAttributes ( true ) ; initBaseTemplatePath ( servletContext ) ; initSharedFunction ( ) ;
public class SSLUtils { /** * Search for any buffer in the array that has a position that isn ' t zero . * If found , return true , otherwise false . * @ param buffers * @ return boolean */ public static boolean anyPositionsNonZero ( WsByteBuffer buffers [ ] ) { } }
if ( buffers != null ) { // Loop through all buffers in the array . for ( int i = 0 ; i < buffers . length ; i ++ ) { // Verify buffer is non null and check for nonzero position if ( ( buffers [ i ] != null ) && ( buffers [ i ] . position ( ) != 0 ) ) { // Found a nonzero position . return true ; } } } // If we get thi...
public class ListServerCertificatesResult { /** * A list of server certificates . * @ param serverCertificateMetadataList * A list of server certificates . */ public void setServerCertificateMetadataList ( java . util . Collection < ServerCertificateMetadata > serverCertificateMetadataList ) { } }
if ( serverCertificateMetadataList == null ) { this . serverCertificateMetadataList = null ; return ; } this . serverCertificateMetadataList = new com . amazonaws . internal . SdkInternalList < ServerCertificateMetadata > ( serverCertificateMetadataList ) ;
public class RegionForwardingRuleId { /** * Returns a region forwarding rule identity given the region identity and the rule name . The * forwarding rule name must be 1-63 characters long and comply with RFC1035 . Specifically , the * name must match the regular expression { @ code [ a - z ] ( [ - a - z0-9 ] * [ a ...
return new RegionForwardingRuleId ( regionId . getProject ( ) , regionId . getRegion ( ) , rule ) ;
public class Widget { /** * Get a recursive set of { @ link ChildInfo } instances describing the * { @ link Widget } children of this { @ code Widget } . * @ param includeHidden * Pass { @ code false } to only count children whose * { @ link # setVisibility ( Visibility ) visibility } is * { @ link Visibility...
List < ChildInfo > children = new ArrayList < > ( ) ; for ( Widget child : getChildren ( ) ) { if ( includeHidden || child . mVisibility == Visibility . VISIBLE ) { children . add ( new ChildInfo ( child . getName ( ) , child . getChildInfo ( includeHidden ) ) ) ; } } return children ;
public class Duration { /** * Returns a copy of this duration divided by the specified value . * This instance is immutable and unaffected by this method call . * @ param divisor the value to divide the duration by , positive or negative , not zero * @ return a { @ code Duration } based on this duration divided b...
if ( divisor == 0 ) { throw new ArithmeticException ( "Cannot divide by zero" ) ; } if ( divisor == 1 ) { return this ; } return create ( toSeconds ( ) . divide ( BigDecimal . valueOf ( divisor ) , RoundingMode . DOWN ) ) ;
public class MappeableBitmapContainer { /** * Create a copy of the content of this container as a long array . This creates a copy . * @ return copy of the content as a long array */ public long [ ] toLongArray ( ) { } }
long [ ] answer = new long [ bitmap . limit ( ) ] ; bitmap . rewind ( ) ; bitmap . get ( answer ) ; return answer ;
public class Func { /** * Lift a Java Func0 to a Scala Function0 * @ param f the function to lift * @ returns the Scala function */ public static < Z > Function0 < Z > lift ( Func0 < Z > f ) { } }
return bridge . lift ( f ) ;
public class CurrencyLocalizationUrl { /** * Get Resource Url for GetCurrencyExchangeRate * @ param currencyCode The three character ISOÂ currency code , such as USDÂ for US Dollars . * @ param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSO...
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/currency/{currencyCode}/exchangerates/{toCurrencyCode}?responseFields={responseFields}" ) ; formatter . formatUrl ( "currencyCode" , currencyCode ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "toCurrency...
public class WSJdbcPreparedStatement { /** * Invokes a method on the specified object . * @ param implObject the instance on which the operation is invoked . * @ param method the method that is invoked . * @ param args the parameters to the method . * @ throws IllegalAccessException if the method is inaccessibl...
if ( args == null || args . length == 0 ) { String methodName = method . getName ( ) ; if ( methodName . equals ( "getReturnResultSet" ) ) return getReturnResultSet ( implObject , method ) ; else if ( methodName . equals ( "getSingletonResultSet" ) ) return getSingletonResultSet ( implObject , method ) ; } else if ( ar...
public class KeyManagementServiceClient { /** * Returns the public key for the given [ CryptoKeyVersion ] [ google . cloud . kms . v1 . CryptoKeyVersion ] . * The [ CryptoKey . purpose ] [ google . cloud . kms . v1 . CryptoKey . purpose ] must be * [ ASYMMETRIC _ SIGN ] [ google . cloud . kms . v1 . CryptoKey . Cry...
GetPublicKeyRequest request = GetPublicKeyRequest . newBuilder ( ) . setName ( name ) . build ( ) ; return getPublicKey ( request ) ;
public class AbstractProxyFactory { /** * Determines whether the object is a materialized object , i . e . no proxy or a * proxy that has already been loaded from the database . * @ param object The object to test * @ return < code > true < / code > if the object is materialized */ public boolean isMaterialized (...
IndirectionHandler handler = getIndirectionHandler ( object ) ; return handler == null || handler . alreadyMaterialized ( ) ;
public class MathObservable { /** * Returns an Observable that emits the average of the Longs emitted by the source Observable . * < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / average . png " alt = " " > * @ param source * source Observable t...
return source . lift ( new OperatorAverageLong < Long > ( MathObservable . < Long > identity ( ) ) ) ;
public class ThreadMonitor { /** * Return the count of threads that are in any of the statuses */ public int getThreadCount ( ThreadGroup group , Status ... s ) { } }
Thread [ ] threads = getThreads ( group ) ; int count = 0 ; for ( Thread t : threads ) { if ( t instanceof MonitoredThread ) { Status status = getStatus ( ( MonitoredThread ) t ) ; if ( status != null ) { for ( Status x : s ) { if ( x == status ) { count ++ ; } } } } } return count ;
public class MobileApplicationService { /** * Returns the set of Mobile applications with the given query parameters . * @ param queryParams The query parameters * @ return The set of applications */ public Collection < MobileApplication > list ( List < String > queryParams ) { } }
return HTTP . GET ( "/v2/mobile_applications.json" , null , queryParams , MOBILE_APPLICATIONS ) . get ( ) ;
public class RepositoryCreationServiceImpl { /** * { @ inheritDoc } */ public void createRepository ( String backupId , RepositoryEntry rEntry , StorageCreationProperties creationProps ) throws RepositoryConfigurationException , RepositoryCreationException { } }
String rToken = reserveRepositoryName ( rEntry . getName ( ) ) ; if ( creationProps instanceof DBCreationProperties ) { createRepositoryInternally ( backupId , rEntry , rToken , ( DBCreationProperties ) creationProps ) ; } else { throw new RepositoryCreationException ( "creationProps should be the instance of DBCreatio...
public class UpdateGlobalTableSettingsRequest { /** * Represents the settings of a global secondary index for a global table that will be modified . * @ param globalTableGlobalSecondaryIndexSettingsUpdate * Represents the settings of a global secondary index for a global table that will be modified . */ public void...
if ( globalTableGlobalSecondaryIndexSettingsUpdate == null ) { this . globalTableGlobalSecondaryIndexSettingsUpdate = null ; return ; } this . globalTableGlobalSecondaryIndexSettingsUpdate = new java . util . ArrayList < GlobalTableGlobalSecondaryIndexSettingsUpdate > ( globalTableGlobalSecondaryIndexSettingsUpdate ) ;
public class DeltaFIFO { /** * Replace the item forcibly . * @ param list the list * @ param resourceVersion the resource version */ @ Override public void replace ( List list , String resourceVersion ) { } }
lock . writeLock ( ) . lock ( ) ; try { Set < String > keys = new HashSet < > ( ) ; for ( Object obj : list ) { String key = this . keyOf ( obj ) ; keys . add ( key ) ; this . queueActionLocked ( DeltaType . Sync , obj ) ; } if ( this . knownObjects == null ) { for ( Map . Entry < String , Deque < MutablePair < DeltaTy...
public class BaseOperation { /** * Returns the name and falls back to the item name . * @ param item The item . * @ param name The name to check . * @ param < T > * @ return */ private static < T > String name ( T item , String name ) { } }
if ( name != null && ! name . isEmpty ( ) ) { return name ; } else if ( item instanceof HasMetadata ) { HasMetadata h = ( HasMetadata ) item ; return h . getMetadata ( ) != null ? h . getMetadata ( ) . getName ( ) : null ; } return null ;
public class StandardMultipartResolver { /** * Determine an appropriate FileUpload instance for the given encoding . * < p > Default implementation returns the shared FileUpload instance if the encoding matches , else creates a new * FileUpload instance with the same configuration other than the desired encoding . ...
FileUpload actualFileUpload = mFileUpload ; if ( ! encoding . equalsIgnoreCase ( mFileUpload . getHeaderEncoding ( ) ) ) { actualFileUpload = new FileUpload ( mFileItemFactory ) ; actualFileUpload . setSizeMax ( mFileUpload . getSizeMax ( ) ) ; actualFileUpload . setFileSizeMax ( mFileUpload . getFileSizeMax ( ) ) ; ac...
public class Field { /** * Returns the internationalized field title */ public String getTitle ( ) { } }
final String key = String . format ( "pm.field.%s.%s" , getEntity ( ) . getId ( ) , getId ( ) ) ; final String message = getPm ( ) . message ( key ) ; if ( key . equals ( message ) ) { final Entity extendzEntity = getEntity ( ) . getExtendzEntity ( ) ; if ( extendzEntity != null && extendzEntity . getFieldById ( getId ...
public class Clock { /** * Removes the given TimeSection from the list of sections . * Sections in the Medusa library usually are less eye - catching * than Areas . * @ param SECTION */ public void removeSection ( final TimeSection SECTION ) { } }
if ( null == SECTION ) return ; sections . remove ( SECTION ) ; Collections . sort ( sections , new TimeSectionComparator ( ) ) ; fireUpdateEvent ( SECTION_EVENT ) ;
public class FileInfo { /** * < code > optional string persistenceState = 19 ; < / code > */ public java . lang . String getPersistenceState ( ) { } }
java . lang . Object ref = persistenceState_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; if ( bs . isValidUtf8 ( ) ) { persistenceSt...
public class CharacterApi { /** * Get character portraits Get portrait urls for a character - - - This route * expires daily at 11:05 * @ param characterId * An EVE character ID ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param i...
com . squareup . okhttp . Call call = getCharactersCharacterIdPortraitValidateBeforeCall ( characterId , datasource , ifNoneMatch , null ) ; Type localVarReturnType = new TypeToken < CharacterPortraitResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class BrowserInformationCache { /** * Returns the total instances of a particular browser , available through all nodes . This methods takes an instance * of { @ link GridRegistry } to clean the cache before returning the results . * @ param browserName * Browser name as { @ link String } * @ param regis...
logger . entering ( new Object [ ] { browserName , registry } ) ; cleanCacheUsingRegistry ( registry ) ; int totalBrowserCounts = 0 ; for ( Map . Entry < URL , TestSlotInformation > entry : nodeMap . entrySet ( ) ) { BrowserInformation browserInfo = entry . getValue ( ) . getBrowserInfo ( browserName ) ; totalBrowserCo...
public class JLanguageTool { /** * The grammar checker needs resources from following * directories : * < ul > * < li > { @ code / resource } < / li > * < li > { @ code / rules } < / li > * < / ul > * @ return The currently set data broker which allows to obtain * resources from the mentioned directories ...
if ( JLanguageTool . dataBroker == null ) { JLanguageTool . dataBroker = new DefaultResourceDataBroker ( ) ; } return JLanguageTool . dataBroker ;
public class LessLookAheadReader { /** * If the next data which are already in the cache are a mixin parameter or part of a selector name . * This is call after a left parenthesis . * Samples for selectors : < ul > * < li > ( min - resolution : 192dpi ) * < li > ( . clearfix all ) * < li > ( audio : not ( [ c...
boolean isFirst = true ; for ( int i = cachePos ; i < cache . length ( ) ; i ++ ) { char ch = cache . charAt ( i ) ; switch ( ch ) { case ')' : return true ; case '@' : return cache . charAt ( i + 1 ) != '{' ; case '~' : return true ; case '"' : return ! isBlock ; case '.' : if ( ! isFirst ) { continue ; } else { if ( ...
public class ChunkedOutputStream { /** * flush buffer and bytes in append */ private void flushBuffer ( byte [ ] append , int ofs , int len ) throws IOException { } }
int count ; count = pos + len ; if ( count > 0 ) { dest . writeAsciiLn ( Integer . toHexString ( count ) ) ; dest . write ( buffer , 0 , pos ) ; dest . write ( append , ofs , len ) ; dest . writeAsciiLn ( ) ; pos = 0 ; }
public class DrizzleConnection { /** * Sets the value of the connection ' s client info properties . The < code > Properties < / code > object contains the names * and values of the client info properties to be set . The set of client info properties contained in the * properties list replaces the current set of cl...
// TODO : actually use these ! for ( final String key : properties . stringPropertyNames ( ) ) { this . clientInfoProperties . setProperty ( key , properties . getProperty ( key ) ) ; }
public class FctBnAccEntitiesProcessors { /** * < p > Get PrcPaymentFromCopy ( create and put into map ) . < / p > * @ param pAddParam additional param * @ return requested PrcPaymentFromCopy * @ throws Exception - an exception */ protected final PrcPaymentFromCopy < RS > createPutPrcPaymentFromCopy ( final Map <...
PrcPaymentFromCopy < RS > proc = new PrcPaymentFromCopy < RS > ( ) ; @ SuppressWarnings ( "unchecked" ) IEntityProcessor < PaymentFrom , Long > procDlg = ( IEntityProcessor < PaymentFrom , Long > ) lazyGetPrcAccEntityPbWithSubaccCopy ( pAddParam ) ; proc . setPrcAccEntityPbWithSubaccCopy ( procDlg ) ; // assigning full...
public class ArrowConverter { /** * Create an ndarray from a matrix . * The included batch must be all the same number of rows in order * to work . The reason for this is { @ link INDArray } must be all the same dimensions . * Note that the input columns must also be numerical . If they aren ' t numerical already...
List < FieldVector > columnVectors = arrowWritableRecordBatch . getList ( ) ; Schema schema = arrowWritableRecordBatch . getSchema ( ) ; for ( int i = 0 ; i < schema . numColumns ( ) ; i ++ ) { switch ( schema . getType ( i ) ) { case Integer : break ; case Float : break ; case Double : break ; case Long : break ; case...
public class JSONBuilder { /** * Quotes properly a string and appends it to the JSON stream . * @ param value - a liternal string to quote and then append * @ return the JSONBuilder itself */ public JSONBuilder quote ( String value ) { } }
_sb . append ( '"' ) ; for ( int i = 0 ; i < value . length ( ) ; ++ i ) { char c = value . charAt ( i ) ; switch ( c ) { case '"' : _sb . append ( "\\\"" ) ; break ; case '\\' : _sb . append ( "\\\\" ) ; break ; default : if ( c < 0x20 ) { _sb . append ( CTRLCHARS [ c ] ) ; } else { _sb . append ( c ) ; } break ; } } ...
public class XExtension { /** * Runs the given visitor for the given log on this extension . */ public void accept ( XVisitor visitor , XLog log ) { } }
/* * First call . */ visitor . visitExtensionPre ( this , log ) ; /* * Last call . */ visitor . visitExtensionPost ( this , log ) ;
public class RsFork { /** * Pick the right one . * @ param req Request * @ param forks List of forks * @ return Response * @ throws IOException If fails */ private static Response pick ( final Request req , final Iterable < Fork > forks ) throws IOException { } }
for ( final Fork fork : forks ) { final Opt < Response > rsps = fork . route ( req ) ; if ( rsps . has ( ) ) { return rsps . get ( ) ; } } throw new HttpException ( HttpURLConnection . HTTP_NOT_FOUND ) ;
public class BooleanUtils { /** * < p > Performs an and on a set of booleans . < / p > * < pre > * BooleanUtils . and ( true , true ) = true * BooleanUtils . and ( false , false ) = false * BooleanUtils . and ( true , false ) = false * BooleanUtils . and ( true , true , false ) = false * BooleanUtils . and ...
// Validates input if ( array == null ) { throw new IllegalArgumentException ( "The Array must not be null" ) ; } if ( array . length == 0 ) { throw new IllegalArgumentException ( "Array is empty" ) ; } for ( final boolean element : array ) { if ( ! element ) { return false ; } } return true ;