signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Util { /** * Returns a Little - Endian byte array extracted from the given int . * @ param v the given int * @ param arr a given array of 4 bytes that will be returned with the data * @ return a Little - Endian byte array extracted from the given int . */ public static byte [ ] intToBytes ( int v , f...
for ( int i = 0 ; i < 4 ; i ++ ) { arr [ i ] = ( byte ) ( v & 0XFF ) ; v >>>= 8 ; } return arr ;
public class Node { /** * Get the { @ link Cluster } that corresponds to the given clusterId . */ public Cluster getCluster ( final ClusterId clusterId ) { } }
for ( final Cluster cur : clusters ) if ( cur . getClusterId ( ) . equals ( clusterId ) ) return cur ; return null ;
public class cachepolicy { /** * Use this API to fetch filtered set of cachepolicy resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static cachepolicy [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
cachepolicy obj = new cachepolicy ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; cachepolicy [ ] response = ( cachepolicy [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class FrameListeners { /** * Called for each frame error detected . * @ param msg The error message * @ see de . quippy . jflac . FrameListener # processError ( java . lang . String ) */ public void processError ( String msg ) { } }
synchronized ( frameListeners ) { Iterator < FrameListener > it = frameListeners . iterator ( ) ; while ( it . hasNext ( ) ) { FrameListener listener = it . next ( ) ; listener . processError ( msg ) ; } }
public class FacesBackingBeanFactory { /** * Get a FacesBackingBeanFactory . * @ param servletContext the current ServletContext . * @ return a FacesBackingBeanFactory for the given ServletContext . It may or may not be a cached instance . */ public static FacesBackingBeanFactory get ( ServletContext servletContext...
FacesBackingBeanFactory factory = ( FacesBackingBeanFactory ) servletContext . getAttribute ( CONTEXT_ATTR ) ; assert factory != null : FacesBackingBeanFactory . class . getName ( ) + " was not found in ServletContext attribute " + CONTEXT_ATTR ; factory . reinit ( servletContext ) ; return factory ;
public class MultipartReader { /** * Read a single byte , except it will try to use the leftover bytes from the * previous read first . * @ return The single byte read * @ throws IOException If an error occurs */ public int read ( ) throws IOException { } }
if ( leftover != null && leftover . remaining ( ) > 0 ) { int b = leftover . get ( ) ; if ( leftover . remaining ( ) == 0 ) { leftover = null ; } return b ; } return input . read ( ) ;
public class PrcItemInCart { /** * < p > Find cart item by ID . < / p > * @ param pShoppingCart cart * @ param pCartItemItsId cart item ID * @ return cart item * @ throws Exception - an exception */ public final CartLn findCartItemById ( final Cart pShoppingCart , final Long pCartItemItsId ) throws Exception { ...
CartLn cartLn = null ; for ( CartLn ci : pShoppingCart . getItems ( ) ) { if ( ci . getItsId ( ) . equals ( pCartItemItsId ) ) { if ( ci . getDisab ( ) ) { throw new ExceptionWithCode ( ExceptionWithCode . SOMETHING_WRONG , "requested_item_disabled" ) ; } cartLn = ci ; break ; } } if ( cartLn == null ) { throw new Exce...
public class CommerceCountryUtil { /** * Returns the last commerce country in the ordered set where groupId = & # 63 ; and billingAllowed = & # 63 ; and active = & # 63 ; . * @ param groupId the group ID * @ param billingAllowed the billing allowed * @ param active the active * @ param orderByComparator the com...
return getPersistence ( ) . fetchByG_B_A_Last ( groupId , billingAllowed , active , orderByComparator ) ;
public class bridgetable { /** * Use this API to unset the properties of bridgetable resources . * Properties that need to be unset are specified in args array . */ public static base_responses unset ( nitro_service client , bridgetable resources [ ] , String [ ] args ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { bridgetable unsetresources [ ] = new bridgetable [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { unsetresources [ i ] = new bridgetable ( ) ; } result = unset_bulk_request ( client , unsetresources , args ) ...
import java . util . Arrays ; public class LongestBitonicSequence { /** * This function calculates the longest bitonic subsequence in a array . * A bitonic sequence is a sequence of numbers which is first strictly increasing then after a point strictly decreasing . * Examples : * > > > longest _ bitonic _ sequenc...
int n = array . length ; int [ ] incSubSeq = new int [ n ] ; int [ ] decSubSeq = new int [ n ] ; Arrays . fill ( incSubSeq , 1 ) ; Arrays . fill ( decSubSeq , 1 ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < i ; j ++ ) { if ( array [ i ] > array [ j ] && incSubSeq [ i ] < incSubSeq [ j ] + 1 ) { incSubSeq...
public class BufferedMagicNumberStream { /** * Replies the count of characters available for reading . */ private int ensureBuffer ( int offset , int length ) throws IOException { } }
final int lastPos = offset + length - 1 ; final int desiredSize = ( ( lastPos / BUFFER_SIZE ) + 1 ) * BUFFER_SIZE ; final int currentSize = this . buffer . length ; if ( desiredSize > currentSize ) { final byte [ ] readBuffer = new byte [ desiredSize - currentSize ] ; final int count = this . in . read ( readBuffer ) ;...
public class Criteria { /** * Crates new { @ link Predicate } with leading wildcard < br / > * < strong > NOTE : < / strong > mind your schema and execution times as leading wildcards may not be supported . * < strong > NOTE : < / strong > Strings will not be automatically split on whitespace . * @ param s * @ ...
assertNoBlankInWildcardedQuery ( s , true , false ) ; predicates . add ( new Predicate ( OperationKey . ENDS_WITH , s ) ) ; return this ;
public class DBIDUtil { /** * Ensure that the given DBIDs are array - indexable . * @ param ids IDs * @ return Array DBIDs . */ public static ArrayDBIDs ensureArray ( DBIDs ids ) { } }
return ids instanceof ArrayDBIDs ? ( ArrayDBIDs ) ids : newArray ( ids ) ;
public class MusicService { /** * Sets the current music state according to the value stored in preferences . Mostly for internal use . * @ param preferences path to the preferences . Will be set as global music preferences path . * @ param preferenceName name of the state preference . * @ param defaultValue used...
musicPreferences = preferences ; musicEnabledPreferenceName = preferenceName ; setMusicEnabled ( readFromPreferences ( preferences , preferenceName , defaultValue ) ) ;
public class SameDiff { /** * Get the output variable ( s ) for the specified differential function * @ param function the function reference to get the output variable ( s ) for * @ return the output variables for the given function */ public SDVariable [ ] getOutputVariablesForFunction ( DifferentialFunction func...
val inputs = getOutputsForFunction ( function ) ; if ( inputs == null ) { throw new ND4JIllegalStateException ( "No inputs found for function " + function ) ; } val vars = new SDVariable [ inputs . length ] ; for ( int i = 0 ; i < inputs . length ; i ++ ) { vars [ i ] = getVariable ( inputs [ i ] ) ; } return vars ;
public class AsyncDispatcher { /** * If listeners are registered for this event type , run the listeners or * queue the event , if already something is happening for this key . */ void deliverAsyncEvent ( final EntryEvent < K , V > _event ) { } }
if ( asyncListenerByType . get ( _event . getEventType ( ) ) . isEmpty ( ) ) { return ; } List < Listener < K , V > > _listeners = new ArrayList < Listener < K , V > > ( asyncListenerByType . get ( _event . getEventType ( ) ) ) ; if ( _listeners . isEmpty ( ) ) { return ; } K key = _event . getKey ( ) ; synchronized ( ...
public class JmsQueueConnectionImpl { /** * This method overrides a superclass method , so that the superclass ' s * createSession ( ) method can be inherited , but still return an object of * this class ' s type . */ JmsSessionImpl instantiateSession ( boolean transacted , int acknowledgeMode , SICoreConnection co...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "instantiateSession" , new Object [ ] { transacted , acknowledgeMode , coreConnection , jcaSession } ) ; JmsQueueSessionImpl jmsQueueSession = new JmsQueueSessionImpl ( transacted , acknowledgeMode , coreConnection , ...
public class DrawerFragment { /** * Users of this fragment must call this method to set up the navigation drawer interactions . * @ param fragmentId The android : id of this fragment in its activity ' s layout . * @ param drawerLayout The DrawerLayout containing this fragment ' s UI . */ public void setUp ( int fra...
mFragmentContainerView = getActivity ( ) . findViewById ( fragmentId ) ; mDrawerLayout = drawerLayout ; // set a custom shadow that overlays the main content when the drawer opens mDrawerLayout . setDrawerShadow ( R . drawable . drawer_shadow , GravityCompat . START ) ; // set up the drawer ' s list view with items and...
public class SchemaUsageAnalyzer { /** * Count the terms ( labels , descriptions , aliases ) of an item or property * document . * @ param termedDocument * document to count the terms of * @ param entityStatistics * record where statistics are counted */ protected void countTerms ( TermedDocument termedDocume...
entityStatistics . countLabels += termedDocument . getLabels ( ) . size ( ) ; // for ( MonolingualTextValue mtv : termedDocument . getLabels ( ) . values ( ) ) // countKey ( usageStatistics . labelCounts , mtv . getLanguageCode ( ) , 1 ) ; entityStatistics . countDescriptions += termedDocument . getDescriptions ( ) . s...
public class MessageSourceSupport { /** * Create a MessageFormat for the given message and Locale . * @ param msg the message to create a MessageFormat for * @ param locale the Locale to create a MessageFormat for * @ return the MessageFormat instance */ protected MessageFormat createMessageFormat ( String msg , ...
return new MessageFormat ( ( msg != null ? msg : "" ) , locale ) ;
public class EbeanQueryCreator { /** * Creates a { @ link ExpressionList } from the given { @ link Part } . * @ param part * @ param root * @ return */ private Expression toExpression ( Part part , ExpressionList < ? > root ) { } }
return new ExpressionBuilder ( part , root ) . build ( ) ;
public class AbstractLRParser { /** * This method is called for shift actions . * @ param newState * is the new state id after shift . * @ param token * is the current token in token stream . * @ throws ParserException */ private final void shift ( ParserAction action ) { } }
stateStack . push ( action . getParameter ( ) ) ; actionStack . add ( action ) ; streamPosition ++ ; shiftIgnoredTokens ( ) ;
public class UrlUtilities { /** * Get content from the passed in URL . This code will open a connection to * the passed in server , fetch the requested content , and return it as a * byte [ ] . * @ param url URL to hit * @ param inCookies Map of session cookies ( or null if not needed ) * @ param outCookies M...
URLConnection c = null ; try { c = getConnection ( url , inCookies , true , false , false , allowAllCerts ) ; ByteArrayOutputStream out = new ByteArrayOutputStream ( 16384 ) ; InputStream stream = IOUtilities . getInputStream ( c ) ; IOUtilities . transfer ( stream , out ) ; stream . close ( ) ; if ( outCookies != null...
public class ApiClient { /** * Formats the specified query parameter to a list containing a single { @ code Pair } object . * Note that { @ code value } must not be a collection . * @ param name The name of the parameter . * @ param value The value of the parameter . * @ return A list containing a single { @ co...
List < Pair > params = new ArrayList < Pair > ( ) ; // preconditions if ( name == null || name . isEmpty ( ) || value == null || value instanceof Collection ) return params ; params . add ( new Pair ( name , parameterToString ( value ) ) ) ; return params ;
public class Vertigo { /** * Undeploys a network from the given cluster . < p > * This method supports both partial and complete undeployment of networks . When * undeploying networks by specifying a { @ link NetworkConfig } , the network configuration * should contain all components and connections that are bein...
return undeployNetwork ( cluster , network , null ) ;
public class AgBuffer { /** * Clones this buffer but replaces all transport attributes with new attributes * of the specified type . * @ param type for new attributes * @ return cloned seed */ public Attribute cloneAttributes ( AgBuffer orig , Type type , Attribute seed ) { } }
Map < Attribute , Attribute > map ; // old attributes to new attributes Attribute attr ; State newState ; map = new HashMap < Attribute , Attribute > ( ) ; for ( State state : orig . states ) { attr = state . getAttribute ( ) ; map . put ( attr , new Attribute ( attr . symbol , null , type ) ) ; } for ( State state : o...
public class DefaultEngine { /** * On all inited . */ public void inited ( ) { } }
if ( preload ) { try { int count = 0 ; if ( templateSuffix == null ) { templateSuffix = new String [ ] { ".httl" } ; } for ( String suffix : templateSuffix ) { List < String > list = loader . list ( suffix ) ; if ( list == null ) { continue ; } count += list . size ( ) ; for ( String name : list ) { try { if ( logger !...
public class DocumentElement { /** * setter for width - sets * @ generated * @ param v value to set into the feature */ public void setWidth ( float v ) { } }
if ( DocumentElement_Type . featOkTst && ( ( DocumentElement_Type ) jcasType ) . casFeat_width == null ) jcasType . jcas . throwFeatMissing ( "width" , "ch.epfl.bbp.uima.types.DocumentElement" ) ; jcasType . ll_cas . ll_setFloatValue ( addr , ( ( DocumentElement_Type ) jcasType ) . casFeatCode_width , v ) ;
public class TextAnalyticsImpl { /** * The API returns a numeric score between 0 and 1. * Scores close to 1 indicate positive sentiment , while scores close to 0 indicate negative sentiment . A score of 0.5 indicates the lack of sentiment ( e . g . a factoid statement ) . See the & lt ; a href = " https : / / docs . ...
return ServiceFuture . fromResponse ( sentimentWithServiceResponseAsync ( sentimentOptionalParameter ) , serviceCallback ) ;
public class QueryRunner { /** * Execute an SQL SELECT query with a single replacement parameter . The * caller is responsible for closing the connection . * @ param conn The connection to execute the query in . * @ param sql The query to execute . * @ param param The replacement parameter . * @ param rsh The...
return this . query ( conn , sql , new Object [ ] { param } , rsh ) ;
public class UtilLoggingLevel { /** * Gets list of supported levels . * @ return list of supported levels . */ public static List getAllPossibleLevels ( ) { } }
ArrayList list = new ArrayList ( ) ; list . add ( FINE ) ; list . add ( FINER ) ; list . add ( FINEST ) ; list . add ( INFO ) ; list . add ( CONFIG ) ; list . add ( WARNING ) ; list . add ( SEVERE ) ; return list ;
public class RestClient { /** * Checks the repository availability * @ return This will return void if all is ok but will throw an exception if * there are any problems * @ throws RequestFailureException If the response code is not OK or the headers returned are missing * the count field ( which can happen if w...
HttpURLConnection connection = createHeadConnection ( "/assets" ) ; testResponseCode ( connection ) ; Map < String , List < String > > results = connection . getHeaderFields ( ) ; if ( results == null ) { throw new RequestFailureException ( connection . getResponseCode ( ) , "No header returned, this does not look like...
public class DatatypeFactory { /** * < p > Create a Java representation of XML Schema builtin datatype < code > date < / code > or < code > g * < / code > . < / p > * < p > For example , an instance of < code > gYear < / code > can be created invoking this factory * with < code > month < / code > and < code > day <...
return newXMLGregorianCalendar ( year , month , day , DatatypeConstants . FIELD_UNDEFINED , // hour DatatypeConstants . FIELD_UNDEFINED , // minute DatatypeConstants . FIELD_UNDEFINED , // second DatatypeConstants . FIELD_UNDEFINED , // millisecond timezone ) ;
public class DevirtualizePrototypeMethods { /** * Determines if a method definition site is eligible for rewrite as a global . * < p > In order to be eligible for rewrite , the definition site must : * < ul > * < li > Not be exported * < li > Be for a prototype method * < / ul > */ private boolean isEligibleD...
switch ( definitionSite . getToken ( ) ) { case GETPROP : case MEMBER_FUNCTION_DEF : case STRING_KEY : break ; default : // No other node types are supported . throw new IllegalArgumentException ( definitionSite . toString ( ) ) ; } // Exporting a method prevents rewrite . CodingConvention codingConvention = compiler ....
public class PublisherCreateOperation { /** * Read and reset the accumulator of query cache inside the given partition . */ private Future < Object > readAndResetAccumulator ( String mapName , String cacheId , Integer partitionId ) { } }
Operation operation = new ReadAndResetAccumulatorOperation ( mapName , cacheId ) ; OperationService operationService = getNodeEngine ( ) . getOperationService ( ) ; return operationService . invokeOnPartition ( MapService . SERVICE_NAME , operation , partitionId ) ;
public class CombineAndSimplifyBounds { /** * Simplify BoundDimFilters that are children of an OR or an AND . * @ param children the filters * @ param disjunction true for disjunction , false for conjunction * @ return simplified filters */ private static DimFilter doSimplify ( final List < DimFilter > children ,...
// Copy children list final List < DimFilter > newChildren = Lists . newArrayList ( children ) ; // Group Bound filters by dimension , extractionFn , and comparator and compute a RangeSet for each one . final Map < BoundRefKey , List < BoundDimFilter > > bounds = new HashMap < > ( ) ; final Iterator < DimFilter > itera...
public class FormData { /** * Returns the FormEntry for the given key . If no FormEntry exists yet for the given key , then a * new one will be generated if generate = = true * @ return the FormEntry for the key */ public FormEntry getFormEntry ( final String entryKey ) { } }
FormEntry entry = entries . get ( entryKey ) ; if ( entry == null ) { entry = addFormEntry ( entryKey , null ) ; } return entry ;
public class ShutdownHookManager { /** * Remove the shutdown hook from the VM ( FeatureManager . deactivate ) * @ see { @ link Runtime # addShutdownHook ( Thread ) } * @ see { @ link Runtime # removeShutdownHook ( Thread ) } */ @ FFDCIgnore ( IllegalStateException . class ) public synchronized void removeShutdownHo...
if ( shutdownInvoked ) return ; try { if ( hookSet . compareAndSet ( true , false ) ) { Runtime . getRuntime ( ) . removeShutdownHook ( this ) ; } } catch ( IllegalStateException e ) { // ok . based on timing , if we start shutting down , we may // not be able to remove the hook . }
public class ByteArray { /** * 获取指定位置的数据 * @ param index * 位置 * @ return 指定位置的数据 * @ throws IndexOutOfBoundsException * 当index大于长度时抛出 */ public byte get ( int index ) throws IndexOutOfBoundsException { } }
if ( index >= this . size ) { throw new IndexOutOfBoundsException ( "数组大小为:" + this . size + ";下标为:" + index ) ; } return datas [ index ] ;
public class ProductUrl { /** * Get Resource Url for GetProducts * @ param cursorMark In your first deep paged request , set this parameter to . Then , in all subsequent requests , set this parameter to the subsequent values of that ' s returned in each response to continue paging through the results . Continue this ...
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/storefront/products/?filter={filter}&startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&responseOptions={responseOptions}&cursorMark={cursorMark}&defaultSort={defaultSort}&responseFields={responseFields}" ) ; formatter . formatUrl ( "cursorMark...
public class PDF417Writer { /** * This takes an array holding the values of the PDF 417 * @ param input a byte array of information with 0 is black , and 1 is white * @ param margin border around the barcode * @ return BitMatrix of the input */ private static BitMatrix bitMatrixFromBitArray ( byte [ ] [ ] input ,...
// Creates the bit matrix with extra space for whitespace BitMatrix output = new BitMatrix ( input [ 0 ] . length + 2 * margin , input . length + 2 * margin ) ; output . clear ( ) ; for ( int y = 0 , yOutput = output . getHeight ( ) - margin - 1 ; y < input . length ; y ++ , yOutput -- ) { byte [ ] inputY = input [ y ]...
public class CmsPatternPanelYearlyView { /** * Handler for week of month changes . * @ param event the change event . */ @ UiHandler ( "m_atNumber" ) void onWeekOfMonthChange ( ValueChangeEvent < String > event ) { } }
if ( handleChange ( ) ) { m_controller . setWeekOfMonth ( event . getValue ( ) ) ; }
public class RestController { /** * Get ' s an XREF entity or a list of MREF entities * < p > Example : * < p > / api / v1 / person / 99 / address */ @ PostMapping ( value = "/{entityTypeId}/{id}/{refAttributeName}" , params = "_method=GET" , produces = APPLICATION_JSON_VALUE ) public Object retrieveEntityAttribute...
Set < String > attributesSet = toAttributeSet ( request . getAttributes ( ) ) ; Map < String , Set < String > > attributeExpandSet = toExpandMap ( request . getExpand ( ) ) ; return retrieveEntityAttributeInternal ( entityTypeId , untypedId , refAttributeName , request , attributesSet , attributeExpandSet ) ;
public class PoolBase { /** * Setup a connection initial state . * @ param connection a Connection * @ throws ConnectionSetupException thrown if any exception is encountered */ private void setupConnection ( final Connection connection ) throws ConnectionSetupException { } }
try { if ( networkTimeout == UNINITIALIZED ) { networkTimeout = getAndSetNetworkTimeout ( connection , validationTimeout ) ; } else { setNetworkTimeout ( connection , validationTimeout ) ; } if ( connection . isReadOnly ( ) != isReadOnly ) { connection . setReadOnly ( isReadOnly ) ; } if ( connection . getAutoCommit ( ...
public class CollUtil { /** * 查找第一个匹配元素对象 * @ param < T > 集合元素类型 * @ param collection 集合 * @ param filter 过滤器 , 满足过滤条件的第一个元素将被返回 * @ return 满足过滤条件的第一个元素 * @ since 3.1.0 */ public static < T > T findOne ( Iterable < T > collection , Filter < T > filter ) { } }
if ( null != collection ) { for ( T t : collection ) { if ( filter . accept ( t ) ) { return t ; } } } return null ;
public class DatabaseOperationsInner { /** * Cancels the asynchronous operation on the database . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ ...
return ServiceFuture . fromResponse ( cancelWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , operationId ) , serviceCallback ) ;
public class BinaryRecordInput { /** * Get a thread - local record input for the supplied DataInput . * @ param inp data input stream * @ return binary record input corresponding to the supplied DataInput . */ public static BinaryRecordInput get ( DataInput inp ) { } }
BinaryRecordInput bin = ( BinaryRecordInput ) bIn . get ( ) ; bin . setDataInput ( inp ) ; return bin ;
public class ConnectionImpl { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . sib . core . SICoreConnection # getMeUuid ( ) */ @ Override public String getMeUuid ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIConnection . tc , "getMeUuid" , this ) ; // get the meuuid from the messaging engine instead of messageprocessor // When ME is stopping connection events are sent to MDB and MDB tries to connect // to M...
public class CmsNewResourceTypeDialog { /** * Creates a name pattern for the resource type . < p > * @ return String name - pattern */ private String getNamePattern ( ) { } }
String niceName = m_typeShortName . getValue ( ) ; if ( m_typeShortName . getValue ( ) . contains ( "-" ) ) { int maxLength = 0 ; String [ ] nameParts = niceName . split ( "-" ) ; for ( int i = 0 ; i < nameParts . length ; i ++ ) { if ( nameParts [ i ] . length ( ) > maxLength ) { maxLength = nameParts [ i ] . length (...
public class IfcPropertyImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcPropertyDependencyRelationship > getPropertyDependsOn ( ) { } }
return ( EList < IfcPropertyDependencyRelationship > ) eGet ( Ifc4Package . Literals . IFC_PROPERTY__PROPERTY_DEPENDS_ON , true ) ;
public class GlobalSuffixFinders { /** * Transforms a { @ link LocalSuffixFinder } into a global one . This is a convenience method , behaving like * { @ link # fromLocalFinder ( LocalSuffixFinder , boolean ) } . * @ see # fromLocalFinder ( LocalSuffixFinder , boolean ) */ public static < I , D > GlobalSuffixFinder...
return fromLocalFinder ( localFinder , false ) ;
public class StringUtils { /** * Makes the initial letter upper - case . * @ param s the string * @ return first letter is now in upper - case */ public static String toInitialCase ( String s ) { } }
if ( isBlank ( s ) ) return s ; if ( s . length ( ) == 1 ) return s . toUpperCase ( ) ; return s . substring ( 0 , 1 ) . toUpperCase ( ) + s . substring ( 1 ) ;
public class CertificateLoginModule { /** * Gets the required Callback objects needed by this login module . * @ param callbackHandler * @ return * @ throws IOException * @ throws UnsupportedCallbackException */ @ Override public Callback [ ] getRequiredCallbacks ( CallbackHandler callbackHandler ) throws IOExc...
Callback [ ] callbacks = new Callback [ 1 ] ; callbacks [ 0 ] = new WSX509CertificateChainCallback ( null ) ; callbackHandler . handle ( callbacks ) ; return callbacks ;
public class Frame { /** * Make this Frame exactly the same as the one given as a parameter . * @ param other * the Frame to make this object the same as */ public void copyFrom ( Frame < ValueType > other ) { } }
lastUpdateTimestamp = other . lastUpdateTimestamp ; slotList = new ArrayList < > ( other . slotList ) ; isTop = other . isTop ; isBottom = other . isBottom ;
public class XmlUtils { /** * Gets the value of the child element by tag name under the given parent * element . If there is more than one child element , return the value of the * first one . * @ param parent the parent element * @ param tagName the tag name of the child element * @ return value of the first...
Element element = getChildElement ( parent , tagName ) ; if ( element != null ) { NodeList nodes = element . getChildNodes ( ) ; if ( nodes != null && nodes . getLength ( ) > 0 ) { for ( int i = 0 ; i < nodes . getLength ( ) ; i ++ ) { Node node = nodes . item ( i ) ; if ( node instanceof Text ) { return ( ( Text ) nod...
public class DefaultExtensionProcessor { /** * ( non - Javadoc ) * @ see * com . ibm . ws . webcontainer . extension . DefaultExtensionProcessor # getZipFileWrapper * ( com . ibm . wsspi . webcontainer . servlet . IServletContext , * com . ibm . ws . webcontainer . extension . DefaultExtensionProcessor , * ja...
// TODO Auto - generated method stub return new ZipFileServletWrapper ( _webapp , processor , zipFileResources ) ;
public class DateIntervalFormat { /** * Get the TimeZone * @ return A copy of the TimeZone associated with this date interval formatter . */ public TimeZone getTimeZone ( ) { } }
if ( fDateFormat != null ) { // Here we clone , like other getters here , but unlike // DateFormat . getTimeZone ( ) and Calendar . getTimeZone ( ) // which return the TimeZone from the Calendar ' s zone variable return ( TimeZone ) ( fDateFormat . getTimeZone ( ) . clone ( ) ) ; } // If fDateFormat is null ( unexpecte...
public class EventSourceImpl { /** * Register a listener for EventSource events * @ param listener */ public void addEventSourceListener ( EventSourceListener listener ) { } }
LOG . entering ( CLASS_NAME , "addEventSourceListener" , listener ) ; if ( listener == null ) { throw new NullPointerException ( "listener" ) ; } listeners . add ( listener ) ;
public class BulkMutationBatcher { /** * Prevents further mutations and waits for all outstanding mutations to complete . * @ throws BulkMutationFailure If any mutations failed . * @ throws InterruptedException If interrupted . * @ throws TimeoutException If the outstanding requests don ' t finish in time . */ pu...
closed = true ; long deadlineMs = System . currentTimeMillis ( ) + duration . toMillis ( ) ; synchronized ( lock ) { while ( numOutstanding . get ( ) > 0 ) { long waitMs = deadlineMs - System . currentTimeMillis ( ) ; if ( waitMs <= 0 ) { throw new TimeoutException ( "Timed out waiting outstanding mutations to finish" ...
public class AbstractWMultiSelectList { /** * { @ inheritDoc } */ @ Override protected void preparePaintComponent ( final Request request ) { } }
super . preparePaintComponent ( request ) ; // Validate the selected options ( allow handle invalid options ) findValidOptions ( getOptions ( ) , convertDataToList ( getData ( ) ) , true ) ;
public class SysViewWorkspaceInitializer { /** * Parse of SysView export content and fill changes log within it . * @ throws XMLStreamException * if stream data corrupted * @ throws FactoryConfigurationError * if XML factory configured bad * @ throws IOException * fi IO error * @ throws RepositoryExceptio...
InputStream input = PrivilegedFileHelper . fileInputStream ( restorePath ) ; try { XMLStreamReader reader = XMLInputFactory . newInstance ( ) . createXMLStreamReader ( input ) ; // SV prefix URIs String svURI = null ; String exoURI = null ; PlainChangesLog changes = new PlainChangesLogImpl ( ) ; // SVNodeData currentNo...
public class HttpDownUtil { /** * 取当前请求的ContentLength */ public static long getDownContentSize ( HttpHeaders resHeaders ) { } }
String contentRange = resHeaders . get ( HttpHeaderNames . CONTENT_RANGE ) ; if ( contentRange != null ) { Pattern pattern = Pattern . compile ( "^[^\\d]*(\\d+)-(\\d+)/.*$" ) ; Matcher matcher = pattern . matcher ( contentRange ) ; if ( matcher . find ( ) ) { long startSize = Long . parseLong ( matcher . group ( 1 ) ) ...
public class ResourceNotFoundException { /** * Value is a list of resource IDs that were not found . * @ return Value is a list of resource IDs that were not found . */ @ com . fasterxml . jackson . annotation . JsonProperty ( "ResourceIds" ) public java . util . List < String > getResourceIds ( ) { } }
return resourceIds ;
public class CmsVfsTab { /** * Selects a specific site . < p > * @ param siteRoot the site root */ private void selectSite ( String siteRoot ) { } }
if ( m_sortSelectBox == null ) { return ; } Map < String , String > options = m_sortSelectBox . getItems ( ) ; String option = null ; for ( Map . Entry < String , String > entry : options . entrySet ( ) ) { if ( CmsStringUtil . comparePaths ( entry . getKey ( ) , siteRoot ) ) { option = entry . getKey ( ) ; break ; } }...
public class StorageUtil { /** * reads a XML Element Attribute ans cast it to a boolean value * @ param el XML Element to read Attribute from it * @ param attributeName Name of the Attribute to read * @ param defaultValue if attribute doesn ' t exist return default value * @ return Attribute Value */ public boo...
String value = el . getAttribute ( attributeName ) ; if ( value == null ) return defaultValue ; return Caster . toBooleanValue ( value , false ) ;
public class FieldFinder { /** * find fields on target to validate and prepare for their validation */ @ SuppressWarnings ( "TryWithIdenticalCatches" ) private static Map < View , FormValidator . FieldInfo > findFieldsToValidate ( Object target ) { } }
final Field [ ] fields = target . getClass ( ) . getDeclaredFields ( ) ; if ( fields == null || fields . length == 0 ) { return Collections . emptyMap ( ) ; } final WeakHashMap < View , FormValidator . FieldInfo > infoMap = new WeakHashMap < > ( fields . length ) ; for ( Field field : fields ) { final List < FormValida...
public class ProxiedFileSystemWrapper { /** * Getter for proxiedFs , using the passed parameters to create an instance of a proxiedFs . * @ param properties * @ param authType is either TOKEN or KEYTAB . * @ param authPath is the KEYTAB location if the authType is KEYTAB ; otherwise , it is the token file . * @...
Preconditions . checkArgument ( StringUtils . isNotBlank ( properties . getProp ( ConfigurationKeys . FS_PROXY_AS_USER_NAME ) ) , "State does not contain a proper proxy user name" ) ; String proxyUserName = properties . getProp ( ConfigurationKeys . FS_PROXY_AS_USER_NAME ) ; UserGroupInformation proxyUser ; switch ( au...
public class DataGrid { /** * Implementation of the { @ link IBehaviorConsumer } interface that extends the functionality of this * tag beyond that exposed via the JSP tag attributes . This method accepts the following facets : * < table > * < tr > < td > Facet Name < / td > < td > Operation < / td > < / tr > *...
if ( facet != null && facet . equals ( FACET_RESOURCE ) ) { _dataGridTagModel . addResourceOverride ( name , ( value != null ? value . toString ( ) : null ) ) ; } else { String s = Bundle . getString ( "Tags_BehaviorFacetNotSupported" , new Object [ ] { facet } ) ; throw new JspException ( s ) ; }
public class ConfigurationIdMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ConfigurationId configurationId , ProtocolMarshaller protocolMarshaller ) { } }
if ( configurationId == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( configurationId . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( configurationId . getRevision ( ) , REVISION_BINDING ) ; } catch ( Exception e ) { throw new...
public class ImagePathTag { /** * Returns the image URL generated by Jawr from a source image path * @ param context * the faces context * @ param src * the image source * @ param base64 * the flag indicating if the image should be encoded in base64 * @ return the image URL generated by Jawr from a source...
BinaryResourcesHandler imgRsHandler = getBinaryResourcesHandler ( context ) ; HttpServletResponse response = ( ( HttpServletResponse ) context . getExternalContext ( ) . getResponse ( ) ) ; HttpServletRequest request = ( HttpServletRequest ) context . getExternalContext ( ) . getRequest ( ) ; return ImageTagUtils . get...
public class MultipleEvaluationMetricRunner { /** * Gets all prediction files . * @ param predictionFiles The prediction files . * @ param path The path where the splits are . * @ param predictionPrefix The prefix of the prediction files . */ public static void getAllPredictionFiles ( final Set < String > predict...
if ( path == null ) { return ; } File [ ] files = path . listFiles ( ) ; if ( files == null ) { return ; } for ( File file : files ) { if ( file . isDirectory ( ) ) { getAllPredictionFiles ( predictionFiles , file , predictionPrefix ) ; } else if ( file . getName ( ) . startsWith ( predictionPrefix ) ) { predictionFile...
public class LinkedList { /** * ( non - Javadoc ) * @ see com . ibm . ws . objectManager . Collection # size ( ) */ public long size ( ) throws ObjectManagerException { } }
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "size" ) ; // TODO Need to include toBeDeleted . long listLength = size ; // For return ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "size" , "returns listLen...
public class MpxjQuery { /** * This method displays the resource assignments for each resource . This time * rather than just iterating through the list of all assignments in * the file , we extract the assignments on a resource - by - resource basis . * @ param file MPX file */ private static void listAssignment...
for ( Resource resource : file . getResources ( ) ) { System . out . println ( "Assignments for resource " + resource . getName ( ) + ":" ) ; for ( ResourceAssignment assignment : resource . getTaskAssignments ( ) ) { Task task = assignment . getTask ( ) ; System . out . println ( " " + task . getName ( ) ) ; } } Sys...
public class Model { /** * 增加特征到特征数中 * @ param cs * @ param tempW */ protected static void printFeatureTree ( String cs , float [ ] tempW ) { } }
String name = "*" ; if ( tempW . length == 4 ) { name = "U" ; } name += "*" + ( cs . charAt ( cs . length ( ) - 1 ) - Config . FEATURE_BEGIN + 1 ) + ":" + cs . substring ( 0 , cs . length ( ) - 1 ) ; for ( int i = 0 ; i < tempW . length ; i ++ ) { if ( tempW [ i ] != 0 ) { System . out . println ( name + "\t" + Config ...
public class SessionManagerMBeanImpl { /** * Reduce the map to the set of expected keys */ private Map < String , Object > filterUnexpectedKeys ( Map < String , Object > inputProps ) { } }
Map < String , Object > outputProps = new HashMap < String , Object > ( ) ; Set < Entry < String , Object > > entries = inputProps . entrySet ( ) ; for ( Map . Entry < String , Object > entry : entries ) { String key = entry . getKey ( ) ; if ( EXPECTED_KEYS . contains ( key ) ) { outputProps . put ( key , entry . getV...
public class JMPathOperation { /** * Create file optional . * @ param path the path * @ param attrs the attrs * @ return the optional */ public static Optional < Path > createFile ( Path path , FileAttribute < ? > ... attrs ) { } }
debug ( log , "createFile" , path , attrs ) ; try { return Optional . of ( Files . createFile ( path , attrs ) ) ; } catch ( Exception e ) { return JMExceptionManager . handleExceptionAndReturnEmptyOptional ( log , e , "createFile" , path ) ; }
public class Dict { /** * 填充Value Object对象 , 忽略大小写 * @ param < T > Bean类型 * @ param clazz Value Object ( 或者POJO ) 的类 * @ return vo */ public < T > T toBeanIgnoreCase ( Class < T > clazz ) { } }
return BeanUtil . mapToBeanIgnoreCase ( this , clazz , false ) ;
public class TimeColumn { /** * Conditionally update this column , replacing current values with newValue for all rows where the current value * matches the selection criteria * Example : * myColumn . set ( myColumn . valueIsMissing ( ) , LocalTime . now ( ) ) ; / / no more missing values */ public TimeColumn set...
for ( int row : rowSelection ) { set ( row , newValue ) ; } return this ;
public class JKStringUtil { /** * replace under score with space replace \ n char with platform indepent * line . separator * @ param value the value * @ return the string */ public static String fixValue ( String value ) { } }
if ( value != null && ! value . equals ( "" ) ) { final String [ ] words = value . toLowerCase ( ) . split ( "_" ) ; value = "" ; for ( final String word : words ) { if ( word . length ( ) > 1 ) { value += word . substring ( 0 , 1 ) . toUpperCase ( ) + word . substring ( 1 ) + " " ; } else { value = word ; } } } if ( v...
public class ObjectSerializer { /** * Transform the given bytes into an object . * @ param bytes The bytes to construct the object from * @ return The object constructed */ @ SuppressWarnings ( "unchecked" ) public T toObject ( byte [ ] bytes ) { } }
try { return ( T ) new ObjectInputStream ( new ByteArrayInputStream ( bytes ) ) . readObject ( ) ; } catch ( IOException e ) { throw new SerializationException ( e ) ; } catch ( ClassNotFoundException c ) { throw new SerializationException ( c ) ; }
public class OgnlPropertyExtractor { /** * extract . * @ param target a { @ link java . lang . Object } object . * @ param property a { @ link java . lang . String } object . * @ return a { @ link java . lang . Object } object . * @ throws java . lang . Exception if any . */ protected Object extract ( Object ta...
if ( errorProperties . contains ( property ) ) return null ; Object value = null ; try { value = expressionEvaluator . eval ( property , target ) ; } catch ( EvaluationException e ) { return null ; } if ( value instanceof Boolean ) { if ( null == textResource ) { return value ; } else { if ( Boolean . TRUE . equals ( v...
public class XmlSchemaParser { /** * Wraps the { @ link InputStream } into an { @ link InputSource } and delegates to * { @ link # parse ( InputSource , ParserOptions ) } . * < b > Note : < / b > this method does not set the { @ link InputSource # setSystemId ( java . lang . String ) } property . * However , it i...
return parse ( new InputSource ( in ) , options ) ;
public class PersistenceUnitMetadataImpl { /** * If not already created , a new < code > persistence - unit - defaults < / code > element with the given value will be created . * Otherwise , the existing < code > persistence - unit - defaults < / code > element will be returned . * @ return a new or existing instan...
Node node = childNode . getOrCreate ( "persistence-unit-defaults" ) ; PersistenceUnitDefaults < PersistenceUnitMetadata < T > > persistenceUnitDefaults = new PersistenceUnitDefaultsImpl < PersistenceUnitMetadata < T > > ( this , "persistence-unit-defaults" , childNode , node ) ; return persistenceUnitDefaults ;
public class Utils { /** * Search for intermediate shape model by its c2j name . * @ return ShapeModel * @ throws IllegalArgumentException * if the specified c2j name is not found in the intermediate model . */ public static ShapeModel findShapeModelByC2jName ( IntermediateModel intermediateModel , String shapeC2...
ShapeModel shapeModel = findShapeModelByC2jNameIfExists ( intermediateModel , shapeC2jName ) ; if ( shapeModel != null ) { return shapeModel ; } else { throw new IllegalArgumentException ( shapeC2jName + " shape (c2j name) does not exist in the intermediate model." ) ; }
public class AmazonGameLiftClient { /** * Resumes activity on a fleet that was suspended with < a > StopFleetActions < / a > . Currently , this operation is used to * restart a fleet ' s auto - scaling activity . * To start fleet actions , specify the fleet ID and the type of actions to restart . When auto - scalin...
request = beforeClientExecution ( request ) ; return executeStartFleetActions ( request ) ;
public class QueryStatisticsInner { /** * Lists a query ' s statistics . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param databaseName The na...
return listByQueryWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , queryId ) . map ( new Func1 < ServiceResponse < List < QueryStatisticInner > > , List < QueryStatisticInner > > ( ) { @ Override public List < QueryStatisticInner > call ( ServiceResponse < List < QueryStatisticInner > > respon...
public class AWSShieldClient { /** * Lists all < a > Protection < / a > objects for the account . * @ param listProtectionsRequest * @ return Result of the ListProtections operation returned by the service . * @ throws InternalErrorException * Exception that indicates that a problem occurred with the service in...
request = beforeClientExecution ( request ) ; return executeListProtections ( request ) ;
public class BinomialDistributionTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setTrials ( long newTrials ) { } }
long oldTrials = trials ; trials = newTrials ; boolean oldTrialsESet = trialsESet ; trialsESet = true ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , BpsimPackage . BINOMIAL_DISTRIBUTION_TYPE__TRIALS , oldTrials , trials , ! oldTrialsESet ) ) ;
public class ScreenField { /** * This field changed , if this is the main record , lock it ! * @ param field The field that changed . */ public void fieldChanged ( Field field ) { } }
BasePanel screenParent = this . getParentScreen ( ) ; if ( field == null ) if ( m_converterField != null ) field = m_converterField . getField ( ) ; // This field changed if ( screenParent != null ) screenParent . fieldChanged ( field ) ;
public class ClientSocketFactory { /** * Clears the recycled connections , e . g . on detection of backend * server going down . */ public void clearRecycle ( ) { } }
ArrayList < ClientSocket > recycleList = null ; synchronized ( this ) { _idleHead = _idleTail = 0 ; for ( int i = 0 ; i < _idle . length ; i ++ ) { ClientSocket stream ; stream = _idle [ i ] ; _idle [ i ] = null ; if ( stream != null ) { if ( recycleList == null ) recycleList = new ArrayList < ClientSocket > ( ) ; recy...
public class Solo { /** * Returns a Button displaying the specified text . * @ param text the text that is displayed , specified as a regular expression * @ param onlyVisible { @ code true } if only visible buttons on the screen should be returned * @ return the { @ link Button } displaying the specified text */ ...
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getButton(\"" + text + "\", " + onlyVisible + ")" ) ; } return getter . getView ( Button . class , text , onlyVisible ) ;
public class AddressBinding { /** * Turns this address into a ModelNode with an address property . < br / > * This method allows to specify a base address prefix ( i . e server vs . domain addressing ) . * @ param baseAddress * @ param args parameters for address wildcards * @ return a ModelNode with an address...
assert getNumWildCards ( ) == args . length : "Address arguments don't match number of wildcards: " + getNumWildCards ( ) + " -> " + Arrays . toString ( args ) ; ModelNode model = new ModelNode ( ) ; model . get ( ADDRESS ) . set ( baseAddress ) ; int argsCounter = 0 ; for ( String [ ] tuple : address ) { String parent...
public class CSL { /** * Sets the processor ' s output format * @ param format the format ( one of < code > " html " < / code > , * < code > " text " < / code > , < code > " asciidoc " < / code > , < code > " fo " < / code > , * or < code > " rtf " < / code > ) */ public void setOutputFormat ( String format ) { }...
try { runner . callMethod ( engine , "setOutputFormat" , format ) ; outputFormat = format ; } catch ( ScriptRunnerException e ) { throw new IllegalArgumentException ( "Could not set output format" , e ) ; }
public class PinView { /** * Set titles ( see { @ link TextView } ) values to add to { @ link PinView } , with all attributes . * @ param titles string array with the titles values */ @ Override public void setTitles ( String [ ] titles ) { } }
if ( titles != null ) { mLinearLayoutPinTexts . removeAllViews ( ) ; mPinTitles = titles ; pinTitlesIds = new int [ titles . length ] ; for ( int i = 0 ; i < titles . length ; i ++ ) { mLinearLayoutPinTexts . addView ( generatePinText ( i , titles ) , i ) ; } }
public class HppRequest { /** * Creates the security hash from a number of fields and the shared secret . * @ param secret * @ return HppRequest */ public HppRequest hash ( String secret ) { } }
// Override payerRef with hppSelectStoredCard if present . if ( this . hppSelectStoredCard != null && ! "" . equalsIgnoreCase ( this . hppSelectStoredCard ) ) { this . payerReference = this . hppSelectStoredCard ; } // check for any null values and set them to empty string for hashing String timeStamp = null == this . ...
public class ZipCompletionScanner { /** * Boyer Moore scan that proceeds backwards from the end of the file looking for ENDSIG * @ throws NonScannableZipException */ private static boolean scanForEndSig ( File file , FileChannel channel ) throws IOException , NonScannableZipException { } }
// TODO Consider just reading in MAX _ REVERSE _ SCAN bytes - - increased peak memory cost but less complex ByteBuffer bb = getByteBuffer ( CHUNK_SIZE ) ; long start = channel . size ( ) ; long end = Math . max ( 0 , start - MAX_REVERSE_SCAN ) ; long channelPos = Math . max ( 0 , start - CHUNK_SIZE ) ; long lastChannel...
public class InterconnectClient { /** * Returns the specified interconnect . Get a list of available interconnects by making a list ( ) * request . * < p > Sample code : * < pre > < code > * try ( InterconnectClient interconnectClient = InterconnectClient . create ( ) ) { * ProjectGlobalInterconnectName inter...
GetInterconnectHttpRequest request = GetInterconnectHttpRequest . newBuilder ( ) . setInterconnect ( interconnect ) . build ( ) ; return getInterconnect ( request ) ;
public class CurrentGpsInfo { /** * Method to add a new { @ link RMCSentence } . * @ param rmc the sentence to add . */ public void addRMC ( RMCSentence rmc ) { } }
try { if ( rmc . isValid ( ) ) { date = rmc . getDate ( ) ; time = rmc . getTime ( ) ; // correctedCourse = rmc . getCorrectedCourse ( ) ; faaMode = rmc . getMode ( ) ; position = rmc . getPosition ( ) ; dataStatus = rmc . getStatus ( ) ; kmHSpeed = rmc . getSpeed ( ) ; fieldCount = rmc . getFieldCount ( ) ; } } catch ...
public class LogOutputStream { /** * Write a block of characters to the output stream * @ param b the array containing the data * @ param off the offset into the array where data starts * @ param len the length of block * @ throws java . io . IOException if the data cannot be written into the stream . * @ see...
// find the line breaks and pass other chars through in blocks int offset = off ; int blockStartOffset = offset ; int remaining = len ; while ( remaining > 0 ) { while ( remaining > 0 && b [ offset ] != LF && b [ offset ] != CR ) { offset ++ ; remaining -- ; } // either end of buffer or a line separator char int blockL...
public class ManagedBuffer { /** * Convenience method for creating a { @ link ManagedBuffer } with * a { @ link BufferCollector # NOOP _ COLLECTOR } from a NIO buffer . * Effectively , this creates an * unmanaged * buffer that * looks like a managed buffer from an existing NIO buffer that * does not belong to a...
return new ManagedBuffer < B > ( buffer , BufferCollector . noopCollector ( ) ) ;