signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ns_conf { /** * < pre >
* Performs generic data validation for the operation to be performed
* < / pre > */
protected void validate ( String operationType ) throws Exception { } } | super . validate ( operationType ) ; MPSString id_validator = new MPSString ( ) ; id_validator . setConstraintIsReq ( MPSConstants . DELETE_CONSTRAINT , true ) ; id_validator . setConstraintIsReq ( MPSConstants . MODIFY_CONSTRAINT , true ) ; id_validator . validate ( operationType , id , "\"id\"" ) ; MPSInt last_update... |
public class CmsProperty { /** * Transforms a list of { @ link CmsProperty } objects into a Map which uses the property name as
* Map key ( String ) , and the property value as Map value ( String ) . < p >
* @ param list a list of { @ link CmsProperty } objects
* @ return a Map which uses the property names as
... | if ( ( list == null ) || ( list . size ( ) == 0 ) ) { return Collections . emptyMap ( ) ; } String name = null ; String value = null ; CmsProperty property = null ; Map < String , String > result = new HashMap < String , String > ( list . size ( ) ) ; // choose the fastest method to traverse the list
if ( list instance... |
public class TableInfo { /** * Adds the collection column metadata .
* @ param collectionColumnMetadata
* the collection column metadata */
public void addCollectionColumnMetadata ( CollectionColumnInfo collectionColumnMetadata ) { } } | if ( this . collectionColumnMetadatas == null ) { this . collectionColumnMetadatas = new ArrayList < CollectionColumnInfo > ( ) ; } if ( ! collectionColumnMetadatas . contains ( collectionColumnMetadata ) ) { collectionColumnMetadatas . add ( collectionColumnMetadata ) ; } |
public class RequestResponseChannel { /** * close should be called exactly once - we use FaultTolerantObject for that */
public void close ( final OperationResult < Void , Exception > onGraceFullClose ) { } } | this . onGraceFullClose = onGraceFullClose ; this . sendLink . close ( ) ; this . receiveLink . close ( ) ; |
public class OrderedItemProcessor { /** * region AutoCloseable Implementation */
@ Override @ SneakyThrows ( Exception . class ) public void close ( ) { } } | ReusableLatch waitSignal = null ; synchronized ( this . stateLock ) { if ( this . closed ) { return ; } this . closed = true ; if ( this . activeCount != 0 || ! this . pendingItems . isEmpty ( ) ) { // Setup a latch that will be released when the last item completes .
this . emptyNotifier = new ReusableLatch ( false ) ... |
public class MultiLanguageTextProcessor { /** * Add a multiLanguageText to a multiLanguageTextBuilder by languageCode . If the multiLanguageText is already contained for the
* language code nothing will be done . If the languageCode already exists and the multiLanguageText is not contained
* it will be added to the... | for ( int i = 0 ; i < multiLanguageTextBuilder . getEntryCount ( ) ; i ++ ) { // found multiLanguageTexts for the entry key
if ( multiLanguageTextBuilder . getEntry ( i ) . getKey ( ) . equals ( languageCode ) ) { // check if the new value is not already contained
if ( multiLanguageTextBuilder . getEntryBuilder ( i ) .... |
public class ModelsImpl { /** * Adds an intent classifier to the application .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param addIntentOptionalParameter the object representing the optional parameters to be set before calling this API
* @ param serviceCallback the async Serv... | return ServiceFuture . fromResponse ( addIntentWithServiceResponseAsync ( appId , versionId , addIntentOptionalParameter ) , serviceCallback ) ; |
public class ClientConfiguration { /** * Checks if a newly created action wants to write output to stdout , and
* logs a warning if other actions are doing the same .
* @ param newAction
* the new action to be checked */
private void checkDuplicateStdOutOutput ( DumpProcessingAction newAction ) { } } | if ( newAction . useStdOut ( ) ) { if ( this . quiet ) { logger . warn ( "Multiple actions are using stdout as output destination." ) ; } this . quiet = true ; } |
public class ShareableSupportedWorkspaceDataManager { /** * { @ inheritDoc } */
public List < NodeData > getChildNodesData ( NodeData parent , List < QPathEntryFilter > patternFilters ) throws RepositoryException { } } | return persistentManager . getChildNodesData ( parent , patternFilters ) ; |
public class ProxyFileDataServlet { /** * { @ inheritDoc } */
@ Override protected URI createUri ( FileStatus i , UnixUserGroupInformation ugi , ClientProtocol nnproxy , HttpServletRequest request ) throws IOException , URISyntaxException { } } | return new URI ( request . getScheme ( ) , null , request . getServerName ( ) , request . getServerPort ( ) , "/streamFile" , "filename=" + i . getPath ( ) + "&ugi=" + ugi , null ) ; |
public class MtasSolrResultUtil { /** * Rewrite merge list .
* @ param key the key
* @ param subKey the sub key
* @ param snl the snl
* @ param tnl the tnl */
@ SuppressWarnings ( { } } | "unchecked" , "unused" } ) private static void rewriteMergeList ( String key , String subKey , NamedList < Object > snl , NamedList < Object > tnl ) { for ( int i = 0 ; i < tnl . size ( ) ; i ++ ) { Object item = snl . get ( tnl . getName ( i ) ) ; if ( item != null && tnl . getVal ( i ) instanceof NamedList ) { NamedL... |
public class ClientFactory { /** * Accept a { @ link IMessageSession } in default { @ link ReceiveMode # PEEKLOCK } mode from service bus connection string with specified session id . Session Id can be null , if null , service will return the first available session .
* @ param amqpConnectionString connection string ... | return acceptSessionFromConnectionString ( amqpConnectionString , sessionId , DEFAULTRECEIVEMODE ) ; |
public class BaseCongestionMonitor { /** * ( non - Javadoc )
* @ see org . restcomm . ss7 . congestion . CongestionMonitor # addCongestionListener (
* org . restcomm . ss7 . congestion . CongestionListener ) */
@ Override public void addCongestionListener ( CongestionListener listener ) { } } | this . listeners . add ( listener ) ; CongestionTicket [ ] ticketsList = getCongestionTicketsList ( ) ; if ( ticketsList != null ) { for ( CongestionTicket ticket : ticketsList ) { listener . onCongestionStart ( ticket ) ; } } |
public class Array { /** * Sort the store .
* @ param from the start index where to start sorting ( inclusively )
* @ param until the end index where to stop sorting ( exclusively )
* @ param comparator the { @ code Comparator } used to compare sequence
* elements . A { @ code null } value indicates that the el... | _store . sort ( from + _start , until + _start , comparator ) ; |
public class KuduDBQuery { /** * Adds the column range predicate to builder .
* @ param field
* the entity type
* @ param scannerBuilder
* the scanner builder
* @ param columnName
* the column name
* @ param value
* the value
* @ param identifier
* the identifier */
private void addColumnRangePredic... | Type type = KuduDBValidationClassMapper . getValidTypeForClass ( field . getType ( ) ) ; ColumnSchema column = new ColumnSchema . ColumnSchemaBuilder ( columnName , type ) . build ( ) ; KuduPredicate predicate ; Object valueObject = KuduDBDataHandler . parse ( type , value ) ; switch ( identifier ) { case ">=" : predic... |
public class RepeatedFieldBuilder { /** * Sets a message at the specified index replacing the existing item at
* that index .
* @ param index the index to set .
* @ param message the message to set
* @ return the builder */
public RepeatedFieldBuilder < MType , BType , IType > setMessage ( int index , MType mes... | if ( message == null ) { throw new NullPointerException ( ) ; } ensureMutableMessageList ( ) ; messages . set ( index , message ) ; if ( builders != null ) { SingleFieldBuilder < MType , BType , IType > entry = builders . set ( index , null ) ; if ( entry != null ) { entry . dispose ( ) ; } } onChanged ( ) ; incrementM... |
public class NetworkParameters { /** * The flags indicating which block validation tests should be applied to
* the given block . Enables support for alternative blockchains which enable
* tests based on different criteria .
* @ param block block to determine flags for .
* @ param height height of the block , i... | final EnumSet < Block . VerifyFlag > flags = EnumSet . noneOf ( Block . VerifyFlag . class ) ; if ( block . isBIP34 ( ) ) { final Integer count = tally . getCountAtOrAbove ( Block . BLOCK_VERSION_BIP34 ) ; if ( null != count && count >= getMajorityEnforceBlockUpgrade ( ) ) { flags . add ( Block . VerifyFlag . HEIGHT_IN... |
public class HTTPLoggingServiceImpl { /** * Parse the access log related information from the config .
* @ param config */
private void parseAccessLog ( Map < String , Object > config ) { } } | String filename = ( String ) config . get ( "access.filePath" ) ; if ( null == filename || 0 == filename . trim ( ) . length ( ) ) { return ; } try { this . ncsaLog = new AccessLogger ( filename . trim ( ) ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , getClass ( ) . getName ( ) + ".parseAccessLog" ,... |
public class PathOperationComponent { /** * Builds the body parameter section
* @ param operation the Swagger Operation
* @ return a list of inlined types . */
private List < ObjectType > buildBodyParameterSection ( MarkupDocBuilder markupDocBuilder , PathOperation operation ) { } } | List < ObjectType > inlineDefinitions = new ArrayList < > ( ) ; bodyParameterComponent . apply ( markupDocBuilder , BodyParameterComponent . parameters ( operation , inlineDefinitions ) ) ; return inlineDefinitions ; |
public class BELUtilities { /** * Returns { @ code true } if any { @ link String } in < tt > strings < / tt > is null or
* empty , { @ code false } otherwise .
* @ param strings { @ link String [ ] } , may be null
* @ return boolean */
public static boolean noLength ( final String ... strings ) { } } | if ( strings == null ) { return true ; } for ( final String string : strings ) { if ( ! hasLength ( string ) ) { return true ; } } return false ; |
public class BundleMaker { /** * Does a Bundle for the Key exist .
* @ param _ key key to search for
* @ return true if found , else false */
public static boolean containsKey ( final String _key ) { } } | final Cache < String , BundleInterface > cache = InfinispanCache . get ( ) . < String , BundleInterface > getIgnReCache ( BundleMaker . CACHE4BUNDLE ) ; return cache . containsKey ( _key ) ; |
public class QuickStartSecurity { /** * This method will only be called for UserRegistryConfigurations that are not
* the one we have defined here .
* @ param ref */
@ Reference ( policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . MULTIPLE , target = "(!(com.ibm.ws.security.registry.type=Quic... | urs . add ( ref ) ; unregisterQuickStartSecurityRegistryConfiguration ( ) ; unregisterQuickStartSecurityAdministratorRole ( ) ; |
public class Toaster { /** * Show the next SuperToast in the current queue . If a SuperToast is currently showing ,
* do nothing . The currently showing SuperToast will call this method when it dismisses . */
private void showNextSuperToast ( ) { } } | // Do nothing if the queue is empty
if ( superToastPriorityQueue . isEmpty ( ) ) return ; // Get next SuperToast in the queue
final SuperToast superToast = superToastPriorityQueue . peek ( ) ; if ( ! superToast . isShowing ( ) ) { final Message message = obtainMessage ( Messages . DISPLAY_SUPERTOAST ) ; message . obj =... |
public class NodeUtil { /** * A check inside a block to see if there are const , let , class , or function declarations
* to be safe and not hoist them into the upper block .
* @ return Whether the block can be removed */
public static boolean canMergeBlock ( Node block ) { } } | for ( Node c = block . getFirstChild ( ) ; c != null ; c = c . getNext ( ) ) { switch ( c . getToken ( ) ) { case LABEL : if ( canMergeBlock ( c ) ) { continue ; } else { return false ; } case CONST : case LET : case CLASS : case FUNCTION : return false ; default : continue ; } } return true ; |
public class PageInBrowserStats { /** * Returns total page loads time for given interval and { @ link TimeUnit } .
* @ param intervalName name of the interval
* @ param unit { @ link TimeUnit }
* @ return total page loads time */
public long getTotalWindowLoadTime ( final String intervalName , final TimeUnit unit... | return unit . transformMillis ( totalWindowLoadTime . getValueAsLong ( intervalName ) ) ; |
public class BaseService { /** * Initializes the service .
* Stores the < code > Service . Context < / code > in instance variables and calls the { @ link # init ( ) } method .
* @ param context Service context .
* @ return The list of configuration issues found during initialization , an empty list if none . */
... | this . context = context ; return init ( ) ; |
public class ExpandableRecyclerAdapter { /** * Notify any registered observers that the parent reflected at { @ code parentPosition }
* has been newly inserted . The parent previously at { @ code parentPosition } is now at
* position { @ code parentPosition + 1 } .
* This is a structural change event . Representa... | P parent = mParentList . get ( parentPosition ) ; int flatParentPosition ; if ( parentPosition < mParentList . size ( ) - 1 ) { flatParentPosition = getFlatParentPosition ( parentPosition ) ; } else { flatParentPosition = mFlatItemList . size ( ) ; } int sizeChanged = addParentWrapper ( flatParentPosition , parent ) ; ... |
public class Vertigo { /** * Deploys a bare network to a specific cluster . < p >
* The network will be deployed with no components and no connections . You
* can add components and connections to the network with an { @ link ActiveNetwork }
* instance .
* @ param cluster The cluster to which to deploy the netw... | getCluster ( cluster , new Handler < AsyncResult < Cluster > > ( ) { @ Override public void handle ( AsyncResult < Cluster > result ) { if ( result . failed ( ) ) { new DefaultFutureResult < ActiveNetwork > ( result . cause ( ) ) . setHandler ( doneHandler ) ; } else { result . result ( ) . deployNetwork ( name , doneH... |
public class BundleUtils { /** * Returns a optional boolean array value . In other words , returns the value mapped by key if it exists and is a boolean array .
* The bundle argument is allowed to be { @ code null } . If the bundle is null , this method returns null .
* @ param bundle a bundle . If the bundle is nu... | return optBooleanArray ( bundle , key , new boolean [ 0 ] ) ; |
public class SimpleMapSerializer { /** * 简单 map 的序列化过程 , 用来序列化 bolt 的 header
* @ param map bolt header
* @ return 序列化后的 byte 数组
* @ throws SerializationException SerializationException */
public byte [ ] encode ( Map < String , String > map ) throws SerializationException { } } | if ( map == null || map . isEmpty ( ) ) { return null ; } UnsafeByteArrayOutputStream out = new UnsafeByteArrayOutputStream ( 64 ) ; try { for ( Map . Entry < String , String > entry : map . entrySet ( ) ) { writeString ( out , entry . getKey ( ) ) ; writeString ( out , entry . getValue ( ) ) ; } return out . toByteArr... |
public class InvocationManager { /** * Clears out a dispatcher registration . This should be called to free up resources when an
* invocation service is no longer going to be used . */
public void clearDispatcher ( InvocationMarshaller < ? > marsh ) { } } | _omgr . requireEventThread ( ) ; // sanity check
if ( marsh == null ) { log . warning ( "Refusing to unregister null marshaller." , new Exception ( ) ) ; return ; } if ( _dispatchers . remove ( marsh . getInvocationCode ( ) ) == null ) { log . warning ( "Requested to remove unregistered marshaller?" , "marsh" , marsh ,... |
public class PermittedRepository { /** * Find all permitted entities .
* @ param entityClass the entity class to get
* @ param privilegeKey the privilege key for permission lookup
* @ param < T > the type of entity
* @ return list of permitted entities */
public < T > List < T > findAll ( Class < T > entityClas... | return findAll ( null , entityClass , privilegeKey ) . getContent ( ) ; |
public class PathOverrideService { /** * Returns an array of all endpoints
* @ param profileId ID of profile
* @ param clientUUID UUID of client
* @ param filters filters to apply to endpoints
* @ return Collection of endpoints
* @ throws Exception exception */
public List < EndpointOverride > getPaths ( int ... | ArrayList < EndpointOverride > properties = new ArrayList < EndpointOverride > ( ) ; PreparedStatement statement = null ; ResultSet results = null ; try ( Connection sqlConnection = sqlService . getConnection ( ) ) { String queryString = this . getPathSelectString ( ) ; queryString += " AND " + Constants . DB_TABLE_PAT... |
public class EhcacheManager { /** * Instantiates a { @ code Store } used for the cache data .
* @ param alias the alias assigned to the cache
* @ param config the configuration used for the cache
* @ param keyType the cache key type
* @ param valueType the cache value type
* @ param serviceConfigs the { @ cod... | final Set < ResourceType < ? > > resourceTypes = config . getResourcePools ( ) . getResourceTypeSet ( ) ; for ( ResourceType < ? > resourceType : resourceTypes ) { if ( resourceType . isPersistable ( ) ) { final PersistableResourceService persistableResourceService = getPersistableResourceService ( resourceType ) ; try... |
public class TransactionManagerImpl { /** * { @ inheritDoc } */
public void resume ( Transaction tobj ) throws InvalidTransactionException , IllegalStateException , SystemException { } } | if ( ! ( tobj instanceof TransactionImpl ) ) throw new SystemException ( ) ; registry . assignTransaction ( ( TransactionImpl ) tobj ) ; |
public class Stream { /** * Distinct and filter by occurrences .
* @ param occurrencesFilter
* @ return */
@ ParallelSupported public Stream < T > distinct ( final Predicate < ? super Long > occurrencesFilter ) { } } | final Supplier < ? extends Map < T , Long > > supplier = isParallel ( ) ? Suppliers . < T , Long > ofConcurrentHashMap ( ) : Suppliers . < T , Long > ofLinkedHashMap ( ) ; return groupBy ( Fn . < T > identity ( ) , Collectors . counting ( ) , supplier ) . filter ( Fn . < T , Long > testByValue ( occurrencesFilter ) ) .... |
public class DrawerBuilder { /** * helper method to handle when the drawer should be shown on launch */
private void handleShowOnLaunch ( ) { } } | // check if it should be shown on launch ( and we have a drawerLayout )
if ( mActivity != null && mDrawerLayout != null ) { if ( mShowDrawerOnFirstLaunch || mShowDrawerUntilDraggedOpened ) { final SharedPreferences preferences = mSharedPreferences != null ? mSharedPreferences : PreferenceManager . getDefaultSharedPrefe... |
public class RdKNNNode { /** * Tests , if the parameters of the entry representing this node , are correctly
* set . Subclasses may need to overwrite this method .
* @ param parent the parent holding the entry representing this node
* @ param index the index of the entry in the parents child array */
@ Override p... | super . integrityCheckParameters ( parent , index ) ; // test if knn distance is correctly set
RdKNNEntry entry = parent . getEntry ( index ) ; double knnDistance = kNNDistance ( ) ; if ( entry . getKnnDistance ( ) != knnDistance ) { double soll = knnDistance ; double ist = entry . getKnnDistance ( ) ; throw new Runtim... |
public class StringDiscardConverter { /** * { @ inheritDoc } */
@ Override public void encodeNullToNull ( Writer writer , String obj ) throws IOException { } } | JsonUtil . put ( writer , obj ) ; |
public class AmazonAlexaForBusinessClient { /** * Initiates the discovery of any smart home appliances associated with the room .
* @ param startSmartHomeApplianceDiscoveryRequest
* @ return Result of the StartSmartHomeApplianceDiscovery operation returned by the service .
* @ throws NotFoundException
* The res... | request = beforeClientExecution ( request ) ; return executeStartSmartHomeApplianceDiscovery ( request ) ; |
public class MBeanServerHandler { /** * Register a MBean under a certain name to the platform MBeanServer
* @ param pMBean MBean to register
* @ param pOptionalName optional name under which the bean should be registered . If not provided ,
* it depends on whether the MBean to register implements { @ link javax .... | synchronized ( mBeanHandles ) { MBeanServer server = ManagementFactory . getPlatformMBeanServer ( ) ; try { String name = pOptionalName != null && pOptionalName . length > 0 ? pOptionalName [ 0 ] : null ; ObjectName registeredName = serverHandle . registerMBeanAtServer ( server , pMBean , name ) ; mBeanHandles . add ( ... |
public class AppearancePreferenceFragment { /** * Creates and returns a listener , which allows to adapt the app ' s theme , when the value of the
* corresponding preference has been changed .
* @ return The listener , which has been created , as an instance of the type { @ link
* OnPreferenceChangeListener } */
... | return new OnPreferenceChangeListener ( ) { @ Override public boolean onPreferenceChange ( final Preference preference , final Object newValue ) { Intent intent = getActivity ( ) . getIntent ( ) ; getActivity ( ) . finish ( ) ; startActivity ( intent ) ; return true ; } } ; |
public class DistributionAddUpdateWindowLayout { /** * Get the LazyQueryContainer instance for DistributionSetTypes .
* @ return */
private static LazyQueryContainer getDistSetTypeLazyQueryContainer ( ) { } } | final BeanQueryFactory < DistributionSetTypeBeanQuery > dtQF = new BeanQueryFactory < > ( DistributionSetTypeBeanQuery . class ) ; dtQF . setQueryConfiguration ( Collections . emptyMap ( ) ) ; final LazyQueryContainer disttypeContainer = new LazyQueryContainer ( new LazyQueryDefinition ( true , SPUIDefinitions . DIST_T... |
public class LongStreamEx { /** * Folds the elements of this stream using the provided accumulation
* function , going left to right . This is equivalent to :
* < pre >
* { @ code
* boolean foundAny = false ;
* long result = 0;
* for ( long element : this stream ) {
* if ( ! foundAny ) {
* foundAny = tr... | PrimitiveBox b = new PrimitiveBox ( ) ; forEachOrdered ( t -> { if ( b . b ) b . l = accumulator . applyAsLong ( b . l , t ) ; else { b . l = t ; b . b = true ; } } ) ; return b . asLong ( ) ; |
public class LogHelper { /** * Log CSV data with some additional information .
* @ param csvData A string expected to contain CSV data . Actually no checks are done if this is really CSV .
* @ param log A { @ link Logger } which will be used for output . */
public static void logCSV ( String csvData , final Logger ... | log . info ( "" ) ; log . info ( "**** Here we go with CSV:" ) ; log . info ( "" ) ; log . info ( csvData ) ; log . info ( "" ) ; log . info ( "**** End of CSV data. Have a nice day!" ) ; log . info ( "" ) ; LogHelper . moo ( log ) ; |
public class CmsContainerpageEditor { /** * Enables the toolbar buttons . < p >
* @ param hasChanges if the page has changes
* @ param noEditReason the no edit reason */
public void enableToolbarButtons ( boolean hasChanges , String noEditReason ) { } } | for ( Widget button : m_toolbar . getAll ( ) ) { // enable all buttons that are not equal save or reset or the page has changes
if ( button instanceof I_CmsToolbarButton ) { ( ( I_CmsToolbarButton ) button ) . setEnabled ( true ) ; } } if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( noEditReason ) ) { m_add . disable... |
public class QueryEngineImpl { /** * Determines if the specified binding is actually entailed by the ontology
* @ param atom The atom to check .
* @ return true if the binding is entailed by the ontology , otherwise false */
private boolean checkBound ( @ Nonnull QueryAtom atom ) { } } | List < QueryArgument > args = atom . getArguments ( ) ; QueryArgument arg0 , arg1 , arg2 ; switch ( atom . getType ( ) ) { case TYPE : { arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; OWLNamedIndividual ind = asIndividual ( arg0 ) ; OWLClass cls = asClass ( arg1 ) ; OWLClassAssertionAxiom ax = factory . getOWLClas... |
public class CmsAliasPathColumn { /** * Gets the comparator used for this column . < p >
* @ return the comparator to use for this row */
public static Comparator < CmsAliasTableRow > getComparator ( ) { } } | return new Comparator < CmsAliasTableRow > ( ) { public int compare ( CmsAliasTableRow o1 , CmsAliasTableRow o2 ) { return o1 . getAliasPath ( ) . toString ( ) . compareTo ( o2 . getAliasPath ( ) . toString ( ) ) ; } } ; |
public class ListBackupPlansResult { /** * An array of backup plan list items containing metadata about your saved backup plans .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setBackupPlansList ( java . util . Collection ) } or { @ link # withBackupPlansLi... | if ( this . backupPlansList == null ) { setBackupPlansList ( new java . util . ArrayList < BackupPlansListMember > ( backupPlansList . length ) ) ; } for ( BackupPlansListMember ele : backupPlansList ) { this . backupPlansList . add ( ele ) ; } return this ; |
public class ProductTypeOptionUrl { /** * Get Resource Url for DeleteOption
* @ param attributeFQN Fully qualified name for an attribute .
* @ param productTypeId Identifier of the product type .
* @ return String Resource Url */
public static MozuUrl deleteOptionUrl ( String attributeFQN , Integer productTypeId ... | UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options/{attributeFQN}" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; formatter . formatUrl ( "productTypeId" , productTypeId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) ... |
public class PermissionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Permission permission , ProtocolMarshaller protocolMarshaller ) { } } | if ( permission == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( permission . getStackId ( ) , STACKID_BINDING ) ; protocolMarshaller . marshall ( permission . getIamUserArn ( ) , IAMUSERARN_BINDING ) ; protocolMarshaller . marshall ( perm... |
public class StringArraySerializer { /** * # # # # # Serialization # # # # # */
@ Override public String [ ] read ( ScanBuffer buffer ) { } } | int length = getLength ( buffer ) ; if ( length < 0 ) return null ; String [ ] result = new String [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { result [ i ] = stringSerializer . read ( buffer ) ; } return result ; |
public class CDKRGraph { /** * Checks if a potential solution is a real one
* ( not included in a previous solution )
* and add this solution to the solution list
* in case of success .
* @ param traversed new potential solution */
private void solution ( BitSet traversed ) throws CDKException { } } | boolean included = false ; BitSet projG1 = projectG1 ( traversed ) ; BitSet projG2 = projectG2 ( traversed ) ; // the solution must follows the search constrains
// ( must contain the mandatory elements in G1 an G2)
if ( isContainedIn ( getSourceBitSet ( ) , projG1 ) && isContainedIn ( getTargetBitSet ( ) , projG2 ) ) ... |
public class CmsDriverManager { /** * Changes the " last modified " timestamp of a resource . < p >
* @ param dbc the current database context
* @ param resource the resource to touch
* @ param dateLastModified the new last modified date of the resource
* @ throws CmsDataAccessException if something goes wrong ... | // modify the last modification date
resource . setDateLastModified ( dateLastModified ) ; if ( resource . getState ( ) . isUnchanged ( ) ) { resource . setState ( CmsResource . STATE_CHANGED ) ; } else if ( resource . getState ( ) . isNew ( ) && ( resource . getSiblingCount ( ) > 1 ) ) { // in case of new resources wi... |
public class AbstractChangeObserver { /** * collects the changed nodes and calls the observers strategy ( doOnChange ) for each node found */
@ Override public void onEvent ( EventIterator events ) { } } | try { // this resolver should be the only one ( for this handling thread )
ResourceResolver resolver = getResolver ( ) ; if ( resolver != null ) { try { Session session = resolver . adaptTo ( Session . class ) ; String serviceUserId = getServiceUserId ( ) ; // collect changed nodes
ChangeCollection changedNodes = new C... |
public class SpringLocaleResolver { /** * / * ( non - Javadoc )
* @ see net . jawr . web . resource . bundle . locale . LocaleResolver # resolveLocaleCode ( javax . servlet . http . HttpServletRequest ) */
public String resolveLocaleCode ( HttpServletRequest request ) { } } | org . springframework . web . servlet . LocaleResolver resolver = RequestContextUtils . getLocaleResolver ( request ) ; Locale resolved = resolver . resolveLocale ( request ) ; if ( resolved != Locale . getDefault ( ) ) return resolved . toString ( ) ; else return null ; |
public class RequestedModuleNames { /** * Returns the list of modules specified by the < code > expEx < / code > and / or the
* < code > exIds < / code > request parameter . Require expansion excludes are
* specified in Aggregator generated requests initiated by application generated
* require ( ) calls . The spe... | final String sourceMethod = "getRequireExpansionExcludes" ; // $ NON - NLS - 1 $
if ( isTraceLogging ) { log . entering ( RequestedModuleNames . class . getName ( ) , sourceMethod ) ; } if ( excludesEncoded == null ) { excludesEncoded = decodeModules ( excludeEncQueryArg , base64decodedExcludeIdList , false ) ; } if ( ... |
public class MarkerManager { /** * Retrieves a Marker or create a Marker that has no parent .
* @ param name The name of the Marker .
* @ return The Marker with the specified name .
* @ throws IllegalArgumentException if the argument is { @ code null } */
public static Marker getMarker ( final String name ) { } } | Marker result = MARKERS . get ( name ) ; if ( result == null ) { MARKERS . putIfAbsent ( name , new Log4jMarker ( name ) ) ; result = MARKERS . get ( name ) ; } return result ; |
public class OutputGroupDetailMarshaller { /** * Marshall the given parameter object . */
public void marshall ( OutputGroupDetail outputGroupDetail , ProtocolMarshaller protocolMarshaller ) { } } | if ( outputGroupDetail == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( outputGroupDetail . getOutputDetails ( ) , OUTPUTDETAILS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + ... |
public class CmsCategoryTree { /** * Fills the category tree . < p >
* @ param categories the categories */
public void setCategories ( List < CmsCategory > categories ) { } } | for ( int i = 0 ; i < categories . size ( ) ; i ++ ) { CmsCategory cat = categories . get ( i ) ; m_container . addItem ( cat ) ; m_checkboxes . put ( cat , new CheckBox ( ) ) ; String parentPath = CmsResource . getParentFolder ( cat . getPath ( ) ) ; if ( parentPath . length ( ) > 1 ) { for ( int j = i - 1 ; j >= 0 ; ... |
public class URLHelper { /** * URL - decode the passed value automatically handling charset issues . The
* implementation is ripped from URLDecoder but does not throw an
* UnsupportedEncodingException for nothing .
* @ param sValue
* The value to be decoded . May not be < code > null < / code > .
* @ param aC... | ValueEnforcer . notNull ( sValue , "Value" ) ; ValueEnforcer . notNull ( aCharset , "Charset" ) ; boolean bNeedToChange = false ; final int nLen = sValue . length ( ) ; final StringBuilder aSB = new StringBuilder ( nLen ) ; int nIndex = 0 ; byte [ ] aBytes = null ; while ( nIndex < nLen ) { char c = sValue . charAt ( n... |
public class Sphere3d { /** * Change the center .
* @ param x
* @ param y
* @ param z */
@ Override public void setCenter ( double x , double y , double z ) { } } | this . cxProperty . set ( x ) ; this . cyProperty . set ( y ) ; this . czProperty . set ( z ) ; |
public class JacksonAutoDiscoverable { /** * { @ inheritDoc } */
@ Override public void configure ( FeatureContext context ) { } } | if ( ! context . getConfiguration ( ) . isRegistered ( JacksonFeature . class ) ) { context . register ( JacksonFeature . class ) ; } |
public class AbstractAnalyticsService { /** * This method builds a tree .
* @ param parent The current parent node
* @ param parts The parts of the URI being processed
* @ param index The current index into the parts array
* @ param endpointType The endpoint type */
protected static void buildTree ( EndpointPar... | // Check if operation qualifier is part of last element
String name = parts [ index ] ; String qualifier = null ; if ( index == parts . length - 1 ) { qualifier = EndpointUtil . decodeEndpointOperation ( parts [ index ] , false ) ; name = EndpointUtil . decodeEndpointURI ( parts [ index ] ) ; } // Check if part is defi... |
public class JobSchedulesImpl { /** * Disables a job schedule .
* No new jobs will be created until the job schedule is enabled again .
* @ param jobScheduleId The ID of the job schedule to disable .
* @ param jobScheduleDisableOptions Additional parameters for the operation
* @ throws IllegalArgumentException ... | return disableWithServiceResponseAsync ( jobScheduleId , jobScheduleDisableOptions ) . map ( new Func1 < ServiceResponseWithHeaders < Void , JobScheduleDisableHeaders > , Void > ( ) { @ Override public Void call ( ServiceResponseWithHeaders < Void , JobScheduleDisableHeaders > response ) { return response . body ( ) ; ... |
public class BootstrapTools { /** * Starts an ActorSystem with the given configuration listening at the address / ports .
* @ param configuration The Flink configuration
* @ param actorSystemName Name of the started { @ link ActorSystem }
* @ param listeningAddress The address to listen at .
* @ param portRange... | // parse port range definition and create port iterator
Iterator < Integer > portsIterator ; try { portsIterator = NetUtils . getPortRangeFromString ( portRangeDefinition ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( "Invalid port range definition: " + portRangeDefinition ) ; } while ( portsIterato... |
public class SchemaService { /** * Parse the application schema from the given application row . */
private ApplicationDefinition loadAppRow ( Tenant tenant , Map < String , String > colMap ) { } } | ApplicationDefinition appDef = new ApplicationDefinition ( ) ; String appSchema = colMap . get ( COLNAME_APP_SCHEMA ) ; if ( appSchema == null ) { return null ; // Not a real application definition row
} String format = colMap . get ( COLNAME_APP_SCHEMA_FORMAT ) ; ContentType contentType = Utils . isEmpty ( format ) ? ... |
public class BaseBpmnXMLConverter { /** * To BpmnModel converter convenience methods */
protected void parseChildElements ( String elementName , BaseElement parentElement , BpmnModel model , XMLStreamReader xtr ) throws Exception { } } | parseChildElements ( elementName , parentElement , null , model , xtr ) ; |
public class AttributeSet { /** * used to create merged global attributes for a new formatter */
static AttributeSet merge ( AttributeSet outer , AttributeSet inner ) { } } | Map < String , Object > internalsNew = new HashMap < > ( ) ; internalsNew . putAll ( inner . internals ) ; internalsNew . putAll ( outer . internals ) ; Attributes attributesNew = new Attributes . Builder ( ) . setAll ( inner . attributes ) . setAll ( outer . attributes ) . build ( ) ; AttributeSet as = new AttributeSe... |
public class DeploymentOperations { /** * Creates an { @ linkplain ModelNode address } that can be used as the address for an operation . The address is
* simply a { @ link ModelNode } of type { @ link ModelType # LIST } .
* The string is split into key / value pairs . If the final key does not have a value an { @ ... | final ModelNode address = new ModelNode ( ) ; final Iterator < String > iterator = pairs . iterator ( ) ; while ( iterator . hasNext ( ) ) { final String key = iterator . next ( ) ; final String value = ( iterator . hasNext ( ) ? iterator . next ( ) : "*" ) ; address . add ( key , value ) ; } return address ; |
public class BellaDatiClient { /** * Builds the HTTP client to connect to the server .
* @ param trustSelfSigned < tt > true < / tt > if the client should accept
* self - signed certificates
* @ return a new client instance */
private CloseableHttpClient buildClient ( boolean trustSelfSigned ) { } } | try { // if required , define custom SSL context allowing self - signed certs
SSLContext sslContext = ! trustSelfSigned ? SSLContexts . createSystemDefault ( ) : SSLContexts . custom ( ) . loadTrustMaterial ( null , new TrustSelfSignedStrategy ( ) ) . build ( ) ; // set timeouts for the HTTP client
int globalTimeout = ... |
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcConstructionProductResourceTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class JPAPersistenceManagerImpl { /** * Remove any null values . */
private Set < String > cleanUpResult ( Set < String > s ) { } } | s . remove ( null ) ; return s ; |
public class BigComplex { /** * Calculates the addition of the given real { @ link BigDecimal } value to this complex number using the specified { @ link MathContext } .
* < p > This methods < strong > does not < / strong > modify this instance . < / p >
* @ param value the real { @ link BigDecimal } value to add
... | return valueOf ( re . add ( value , mathContext ) , im ) ; |
public class Metric { /** * < code > map & lt ; string , string & gt ; tags = 6 ; < / code > */
public boolean containsTags ( java . lang . String key ) { } } | if ( key == null ) { throw new java . lang . NullPointerException ( ) ; } return internalGetTags ( ) . getMap ( ) . containsKey ( key ) ; |
public class LocalJobUtilization { @ Override public void write ( DataOutput out ) throws IOException { } } | Text . writeString ( out , getJobId ( ) ) ; out . writeDouble ( getCpuUsageGHz ( ) ) ; out . writeDouble ( getMemUsageGB ( ) ) ; |
public class OptionHelper { /** * Verify if a deprecated option has been used and emit a warning .
* @ param deprecatedOption
* The name of the deprecated option .
* @ param value
* The provided value .
* @ param option
* The option to use .
* @ param < T >
* The value type . */
public static < T > void... | if ( value != null ) { LOGGER . warn ( "The option '" + deprecatedOption + "' is deprecated, use '" + option + "' instead." ) ; } |
public class Schedulable { /** * Get the share of the schedulable given a weightToShareRatio .
* This takes into account the min and the max allocation and is used
* to compute the weightToShareRatio globally
* @ param schedulable the schedulable to compute the share for
* @ param weightToShareRatio the multipl... | double share = schedulable . getWeight ( ) * weightToShareRatio ; int min = schedulable . getMinimum ( ) ; int max = schedulable . getMaximum ( ) ; int requested = schedulable . getRequested ( ) ; share = Math . max ( min , share ) ; share = Math . min ( max , share ) ; share = Math . min ( requested , share ) ; return... |
public class StorageSnippets { /** * [ VARIABLE " my _ unique _ bucket " ] */
public Bucket createBucket ( String bucketName ) { } } | // [ START createBucket ]
Bucket bucket = storage . create ( BucketInfo . of ( bucketName ) ) ; // [ END createBucket ]
return bucket ; |
public class ServiceUtils { /** * Converts the specified request object into a URL , containing all the
* specified parameters , the specified request endpoint , etc .
* @ param request
* The request to convert into a URL .
* @ param removeLeadingSlashInResourcePath
* Whether the leading slash in resource - p... | return convertRequestToUrl ( request , removeLeadingSlashInResourcePath , true ) ; |
public class RESTRegistry { /** * Search the given command owner for a matching command . */
private RegisteredCommand searchCommands ( String cmdOwner , HttpMethod method , String uri , String query , Map < String , String > variableMap ) { } } | Map < HttpMethod , SortedSet < RegisteredCommand > > evalMap = getCmdEvalMap ( cmdOwner ) ; if ( evalMap == null ) { return null ; } // Find the sorted command set for the given HTTP method .
SortedSet < RegisteredCommand > cmdSet = evalMap . get ( method ) ; if ( cmdSet == null ) { return null ; } // Split uri into a ... |
public class Humanize { /** * Same as { @ link # capitalize ( String ) } for the specified locale .
* @ param text
* String to be capitalized
* @ param locale
* Target locale
* @ return capitalized string */
@ Expose public static String capitalize ( final String text , final Locale locale ) { } } | return withinLocale ( new Callable < String > ( ) { public String call ( ) throws Exception { return capitalize ( text ) ; } } , locale ) ; |
public class nssimpleacl6 { /** * Use this API to clear nssimpleacl6. */
public static base_response clear ( nitro_service client ) throws Exception { } } | nssimpleacl6 clearresource = new nssimpleacl6 ( ) ; return clearresource . perform_operation ( client , "clear" ) ; |
public class DiscountCurveInterpolation { /** * Create a discount curve from given times and given zero rates using default interpolation and extrapolation methods .
* The discount factor is determined by
* < code >
* givenDiscountFactors [ timeIndex ] = Math . exp ( - givenZeroRates [ timeIndex ] * times [ timeI... | double [ ] givenDiscountFactors = new double [ givenZeroRates . length ] ; for ( int timeIndex = 0 ; timeIndex < times . length ; timeIndex ++ ) { givenDiscountFactors [ timeIndex ] = Math . exp ( - givenZeroRates [ timeIndex ] * times [ timeIndex ] ) ; } return createDiscountCurveFromDiscountFactors ( name , times , g... |
public class S3StorageProvider { /** * { @ inheritDoc } */
public void deleteContent ( String spaceId , String contentId ) { } } | log . debug ( "deleteContent(" + spaceId + ", " + contentId + ")" ) ; // Will throw if bucket does not exist
String bucketName = getBucketName ( spaceId ) ; // Note that the s3Client does not throw an exception or indicate if
// the object to be deleted does not exist . This check is being run
// up front to fulfill th... |
public class BigMoney { /** * Returns a copy of this monetary value with the amount in minor units subtracted .
* This subtracts the specified amount in minor units from this monetary amount ,
* returning a new object .
* No precision is lost in the result .
* The scale of the result will be the maximum of the ... | if ( amountToSubtract == 0 ) { return this ; } BigDecimal newAmount = amount . subtract ( BigDecimal . valueOf ( amountToSubtract , currency . getDecimalPlaces ( ) ) ) ; return BigMoney . of ( currency , newAmount ) ; |
public class IndexUpdateReducer { /** * / * ( non - Javadoc )
* @ see org . apache . hadoop . mapred . MapReduceBase # configure ( org . apache . hadoop . mapred . JobConf ) */
public void configure ( JobConf job ) { } } | iconf = new IndexUpdateConfiguration ( job ) ; mapredTempDir = iconf . getMapredTempDir ( ) ; mapredTempDir = Shard . normalizePath ( mapredTempDir ) ; |
public class AbstractRuleImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case XtextPackage . ABSTRACT_RULE__NAME : setName ( ( String ) newValue ) ; return ; case XtextPackage . ABSTRACT_RULE__TYPE : setType ( ( TypeRef ) newValue ) ; return ; case XtextPackage . ABSTRACT_RULE__ALTERNATIVES : setAlternatives ( ( AbstractElement ) newValue ) ; return ; case XtextPackag... |
public class ToXMLStream { /** * This method is used to add an attribute to the currently open element .
* The caller has guaranted that this attribute is unique , which means that it
* not been seen before and will not be seen again .
* @ param name the qualified name of the attribute
* @ param value the value... | if ( m_elemContext . m_startTagOpen ) { try { final String patchedName = patchName ( name ) ; final java . io . Writer writer = m_writer ; if ( ( flags & NO_BAD_CHARS ) > 0 && m_xmlcharInfo . onlyQuotAmpLtGt ) { // " flags " has indicated that the characters
// ' > ' ' < ' ' & ' and ' " ' are not in the value and
// m ... |
public class TagLibTag { /** * Setzt ein einzelnes Attribut ( TagLibTagAttr ) eines Tag . Diese Methode wird durch die Klasse
* TagLibFactory verwendet .
* @ param attribute Attribute eines Tag . */
public void setAttribute ( TagLibTagAttr attribute ) { } } | attributes . put ( attribute . getName ( ) , attribute ) ; if ( attrFirst == null ) attrFirst = attribute ; attrLast = attribute ; |
public class JmxRequestFactory { /** * Get the request creator for a specific type */
private static RequestCreator getCreator ( RequestType pType ) { } } | RequestCreator creator = CREATOR_MAP . get ( pType ) ; if ( creator == null ) { throw new UnsupportedOperationException ( "Type " + pType + " is not supported (yet)" ) ; } return creator ; |
public class CollectionUtils { /** * Sort a collection if it is not empty ( to prevent { @ link ConcurrentModificationException } if an immutable
* empty list that has been returned more than once is being sorted in one thread and iterated through in
* another thread - - # 334 ) .
* @ param < T >
* the element ... | if ( ! list . isEmpty ( ) ) { Collections . sort ( list ) ; } |
public class VersionHistoryRemover { /** * Remove history .
* @ exception RepositoryException if an repository error occurs . */
public void remove ( ) throws RepositoryException { } } | NodeData vhnode = ( NodeData ) dataManager . getItemData ( vhID ) ; if ( vhnode == null ) { ItemState vhState = null ; List < ItemState > allStates = transientChangesLog . getAllStates ( ) ; for ( int i = allStates . size ( ) - 1 ; i >= 0 ; i -- ) { ItemState state = allStates . get ( i ) ; if ( state . getData ( ) . g... |
public class TFIDF { /** * { @ inheritDoc } */
@ Override protected void _fit ( Dataframe trainingData ) { } } | ModelParameters modelParameters = knowledgeBase . getModelParameters ( ) ; TrainingParameters trainingParameters = knowledgeBase . getTrainingParameters ( ) ; boolean binarized = trainingParameters . isBinarized ( ) ; int n = trainingData . size ( ) ; StorageEngine storageEngine = knowledgeBase . getStorageEngine ( ) ;... |
import java . util . * ; class IsMagicSquare { /** * Function to check whether a given matrix is a magic square or not .
* A magic square is a square matrix , created by an arrangement of numbers , usually positive integers ,
* such that the sum of numbers in any row , any column , and both main diagonals are the s... | int size = matrix [ 0 ] . length ; // List to hold the sum of each row , column and diagonals
ArrayList < Integer > sum_list = new ArrayList < Integer > ( ) ; // Sum of each row
for ( int i = 0 ; i < size ; i ++ ) { int rowSum = 0 ; for ( int j = 0 ; j < size ; j ++ ) { rowSum += matrix [ i ] [ j ] ; } sum_list . add (... |
public class BatchDetectSyntaxItemResult { /** * The syntax tokens for the words in the document , one token for each word .
* @ param syntaxTokens
* The syntax tokens for the words in the document , one token for each word . */
public void setSyntaxTokens ( java . util . Collection < SyntaxToken > syntaxTokens ) {... | if ( syntaxTokens == null ) { this . syntaxTokens = null ; return ; } this . syntaxTokens = new java . util . ArrayList < SyntaxToken > ( syntaxTokens ) ; |
public class ConsumerPoolThread { /** * add a new object into the consumer list to be consumed !
* Warning this wait the current thread to wait for an thread to handle this object */
public void addObject ( E object ) { } } | if ( stopped == true ) { log . warn ( "Adding a new object ignored, the pool is stopped" ) ; return ; } // add to the end
objectList . add ( object ) ; // if ( log . isDebugEnabled ( ) ) {
// log . debug ( " ADD , size : ' " + objectListSize ( ) + " ' " + object . hashCode ( ) + " stopped : " + stopedThreadNumber + " "... |
public class QueryExecutor { /** * TODO this should go into MatchClause */
private void validateClause ( MatchClause matchClause ) { } } | Disjunction < Conjunction < Pattern > > negationDNF = matchClause . getPatterns ( ) . getNegationDNF ( ) ; // assert none of the statements have no properties ( eg . ` match $ x ; get ; ` )
List < Statement > statementsWithoutProperties = negationDNF . getPatterns ( ) . stream ( ) . flatMap ( p -> p . statements ( ) . ... |
public class ServerCommandListener { /** * Finish any outstanding asynchronous responses , and close the server
* socket to prevent new command requests . */
public void close ( ) { } } | Thread responseThread = null ; synchronized ( this ) { if ( ! closed ) { closed = true ; notifyAll ( ) ; if ( listenForCommands ) { listenForCommands = false ; if ( listeningThread != null ) { listeningThread . interrupt ( ) ; } } Utils . tryToClose ( serverSocketChannel ) ; commandFile . delete ( ) ; responseThread = ... |
public class PropertyUtil { /** * Loads properties with given path - will load as file is able or classpath resource */
public static Properties loadProperties ( final String path ) { } } | if ( path != null ) { // try as file
try { File file = new File ( path ) ; if ( file . exists ( ) ) { try { Properties p = new Properties ( ) ; p . load ( new FileInputStream ( file ) ) ; return p ; } catch ( Exception e ) { log . error ( "Error loading properties from file: " + path ) ; } } } catch ( Throwable e ) { l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.