signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Env { /** * Set the current declaration and its doc comment . */
void setCurrent ( TreePath path , DocCommentTree comment ) { } } | currPath = path ; currDocComment = comment ; currElement = trees . getElement ( currPath ) ; currOverriddenMethods = ( ( JavacTypes ) types ) . getOverriddenMethods ( currElement ) ; AccessKind ak = AccessKind . PUBLIC ; for ( TreePath p = path ; p != null ; p = p . getParentPath ( ) ) { Element e = trees . getElement ( p ) ; if ( e != null && e . getKind ( ) != ElementKind . PACKAGE ) { ak = min ( ak , AccessKind . of ( e . getModifiers ( ) ) ) ; } } currAccess = ak ; |
public class XlsWorksheet { /** * Returns the sheets from the given Excel XLS file .
* @ param stream The input stream with the XLS file
* @ return The sheet names from the XLS file
* @ throws IOException if the file cannot be opened
* @ throws jxl . read . biff . BiffException if there is a format error with the file */
public static String [ ] getXlsWorksheets ( InputStream stream ) throws IOException , jxl . read . biff . BiffException { } } | XlsWorkbook workbook = XlsWorkbook . getWorkbook ( stream ) ; String [ ] sheets = workbook . getSheetNames ( ) ; workbook . close ( ) ; return sheets ; |
public class CircularImageView { /** * Set the placeholder text and colors .
* @ param text
* @ param backgroundColor
* @ param textColor */
public final void setPlaceholder ( String text , @ ColorInt int backgroundColor , @ ColorInt int textColor ) { } } | boolean invalidate = false ; // Set the placeholder background color
if ( backgroundColor != mBackgroundColor ) { mBackgroundColor = backgroundColor ; if ( null != mBackgroundPaint ) { mBackgroundPaint . setColor ( backgroundColor ) ; invalidate = true ; } } // Set the placeholder text color
if ( ! text . equalsIgnoreCase ( mText ) || ( backgroundColor != mBackgroundColor ) || ( textColor != mTextColor ) ) { setPlaceholderTextInternal ( text , textColor , mTextSize , false ) ; invalidate = true ; } if ( invalidate ) { invalidate ( ) ; } |
public class AFPChainXMLConverter { /** * Convert an afpChain to a simple XML representation
* @ param afpChain
* @ return XML representation of the AFPCHain */
public synchronized static String toXML ( AFPChain afpChain , Atom [ ] ca1 , Atom [ ] ca2 ) throws IOException { } } | StringWriter result = new StringWriter ( ) ; toXML ( afpChain , result , ca1 , ca2 ) ; return result . toString ( ) ; |
public class BeanUtils { /** * Populates the specified bean with data from the specified map .
* @ param bean The object to populate .
* @ param params The map to populate the bean with . */
public static void populateBean ( final Object bean , final Map < String , String > params ) { } } | final Method [ ] methods = bean . getClass ( ) . getMethods ( ) ; for ( final Method method : methods ) { final Class < ? > [ ] types = method . getParameterTypes ( ) ; final int length = types . length ; if ( length != 1 ) { continue ; } final String name = method . getName ( ) ; if ( ! name . startsWith ( "set" ) ) { continue ; } final String fieldName = name . substring ( 3 ) . toLowerCase ( ) ; final String str = params . get ( fieldName ) ; if ( str == null ) { continue ; } final String val = str . trim ( ) ; final Class < ? > type = types [ 0 ] ; final Object toAssign ; if ( type . isAssignableFrom ( String . class ) ) { toAssign = val ; } else if ( type . isAssignableFrom ( int . class ) ) { toAssign = Integer . parseInt ( val ) ; } else if ( type . isAssignableFrom ( boolean . class ) ) { toAssign = toBoolean ( val ) ; } else if ( type . isAssignableFrom ( Boolean . class ) ) { toAssign = toBoolean ( val ) ; } else if ( type . isAssignableFrom ( File . class ) ) { toAssign = new File ( val ) ; } else if ( type . isAssignableFrom ( URI . class ) ) { try { toAssign = new URI ( val ) ; } catch ( final URISyntaxException e ) { LOG . error ( "Error building bean" , e ) ; throw new IllegalArgumentException ( "Error building bean" , e ) ; } } else if ( type . isAssignableFrom ( Integer . class ) ) { toAssign = Integer . parseInt ( val ) ; } else if ( type . isAssignableFrom ( int . class ) ) { toAssign = Integer . parseInt ( val ) ; } else if ( type . isAssignableFrom ( Float . class ) ) { toAssign = Float . parseFloat ( val ) ; } else if ( type . isAssignableFrom ( float . class ) ) { toAssign = Float . parseFloat ( val ) ; } else if ( type . isAssignableFrom ( Double . class ) ) { toAssign = Double . parseDouble ( val ) ; } else if ( type . isAssignableFrom ( double . class ) ) { toAssign = Double . parseDouble ( val ) ; } else if ( type . isAssignableFrom ( Long . class ) ) { toAssign = Long . parseLong ( val ) ; } else if ( type . isAssignableFrom ( long . class ) ) { toAssign = Long . parseLong ( val ) ; } else { final String msg = "Could not handle type: {}" + type . getName ( ) + " key: " + fieldName ; LOG . error ( msg ) ; throw new IllegalArgumentException ( msg ) ; } try { method . invoke ( bean , toAssign ) ; } catch ( final IllegalArgumentException e ) { LOG . error ( "Could not invoke method" , e ) ; } catch ( final IllegalAccessException e ) { LOG . error ( "Could not invoke method" , e ) ; } catch ( final InvocationTargetException e ) { LOG . error ( "Could not invoke method" , e ) ; } } |
public class BigDecimalExtensions { /** * The < code > power < / code > operator .
* @ param a
* a BigDecimal . May not be < code > null < / code > .
* @ param exponent
* the exponent .
* @ return < code > a . pow ( b ) < / code >
* @ throws NullPointerException
* if { @ code a } is < code > null < / code > . */
@ Pure @ Inline ( value = "$1.pow($2)" ) public static BigDecimal operator_power ( BigDecimal a , int exponent ) { } } | return a . pow ( exponent ) ; |
public class SarlCapacityImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } } | switch ( featureID ) { case SarlPackage . SARL_CAPACITY__EXTENDS : return ( ( InternalEList < ? > ) getExtends ( ) ) . basicRemove ( otherEnd , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ; |
public class CPOptionCategoryPersistenceImpl { /** * Removes all the cp option categories where companyId = & # 63 ; from the database .
* @ param companyId the company ID */
@ Override public void removeByCompanyId ( long companyId ) { } } | for ( CPOptionCategory cpOptionCategory : findByCompanyId ( companyId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( cpOptionCategory ) ; } |
public class ArrayHelper { /** * Wrapper that allows vararg arguments and returns the array . < br >
* Note : this implementation is not available for basic types , because the
* Eclipse compiler seems to have difficulties resolving vararg types
* correctly .
* @ param < ELEMENTTYPE >
* Type of element
* @ param aArray
* The vararg array
* @ return The wrapped array */
@ Nonnull @ ReturnsMutableObject ( "use getCopy otherwise" ) @ SafeVarargs public static < ELEMENTTYPE > ELEMENTTYPE [ ] newArray ( @ Nonnull final ELEMENTTYPE ... aArray ) { } } | ValueEnforcer . notNull ( aArray , "Array" ) ; return aArray ; |
public class URIToServletWrapperCache { /** * / * ( non - Javadoc )
* @ see java . util . Map # put ( java . lang . Object , java . lang . Object ) */
public Object put ( Object key , Object value ) { } } | synchronized ( this ) { // 253010 , Do not check size since we do so in WebContainer
Object obj = super . put ( key , value ) ; if ( obj == null ) // Object was added or value previously added was null
size = super . size ( ) ; return obj ; } |
public class BinaryImageOps { /** * Several blob rending functions take in an array of colors so that the random blobs can be drawn
* with the same color each time . This function selects a random color for each blob and returns it
* in an array .
* @ param numBlobs Number of blobs found .
* @ param rand Random number generator
* @ return array of RGB colors for each blob + the background blob */
public static int [ ] selectRandomColors ( int numBlobs , Random rand ) { } } | int colors [ ] = new int [ numBlobs + 1 ] ; colors [ 0 ] = 0 ; // black
int B = 100 ; for ( int i = 1 ; i < colors . length ; i ++ ) { int c ; while ( true ) { c = rand . nextInt ( 0xFFFFFF ) ; // make sure its not too dark and can ' t be distriquished from the background
if ( ( c & 0xFF ) > B || ( ( c >> 8 ) & 0xFF ) > B || ( ( c >> 8 ) & 0xFF ) > B ) { break ; } } colors [ i ] = c ; } return colors ; |
public class User { /** * Returns a user object for a given identifier .
* @ param u a user having a valid identifier set .
* @ return a user or null if no user is found for this identifier */
public static final User readUserForIdentifier ( final User u ) { } } | if ( u == null || StringUtils . isBlank ( u . getIdentifier ( ) ) ) { return null ; } User user = null ; String password = null ; String identifier = u . getIdentifier ( ) ; // Try to read the identifier object first , then read the user object linked to it .
Sysprop s = CoreUtils . getInstance ( ) . getDao ( ) . read ( u . getAppid ( ) , identifier ) ; if ( s != null && s . getCreatorid ( ) != null ) { user = CoreUtils . getInstance ( ) . getDao ( ) . read ( u . getAppid ( ) , s . getCreatorid ( ) ) ; password = ( String ) s . getProperty ( Config . _PASSWORD ) ; } // Try to find the user by email if already created , but with a different identifier .
// This prevents users with identical emails to have separate accounts by signing in through
// different identity providers .
if ( user == null && ! StringUtils . isBlank ( u . getEmail ( ) ) ) { HashMap < String , Object > terms = new HashMap < > ( 2 ) ; terms . put ( Config . _EMAIL , u . getEmail ( ) ) ; terms . put ( Config . _APPID , u . getAppid ( ) ) ; List < User > users = CoreUtils . getInstance ( ) . getSearch ( ) . findTerms ( u . getAppid ( ) , u . getType ( ) , terms , true , new Pager ( 1 ) ) ; if ( ! users . isEmpty ( ) ) { user = users . get ( 0 ) ; password = Utils . generateSecurityToken ( ) ; user . createIdentifier ( u . getIdentifier ( ) , password ) ; } } if ( user != null ) { if ( password != null ) { user . setPassword ( password ) ; } if ( ! identifier . equals ( user . getIdentifier ( ) ) ) { logger . info ( "Identifier changed for user '{}', from {} to {}." , user . getId ( ) , user . getIdentifier ( ) , identifier ) ; // the main identifier was changed - update
user . setIdentifier ( identifier ) ; CoreUtils . getInstance ( ) . getDao ( ) . update ( user . getAppid ( ) , user ) ; } return user ; } logger . debug ( "User not found for identifier {}/{}, {}." , u . getAppid ( ) , identifier , u . getId ( ) ) ; return null ; |
public class Vacuum { /** * Get the vacuums serial number .
* @ return The vacuums serial number .
* @ throws CommandExecutionException When there has been a error during the communication or the response was invalid . */
public String getSerialnumber ( ) throws CommandExecutionException { } } | JSONArray ret = sendToArray ( "get_serial_number" ) ; if ( ret == null ) return null ; return ret . optJSONObject ( 0 ) . optString ( "serial_number" ) ; |
public class Job { /** * Get file info objects that pass the filter
* @ param filter filter file info object must pass
* @ return collection of file info objects that pass the filter , may be empty */
public Collection < FileInfo > getFileInfo ( final Predicate < FileInfo > filter ) { } } | return files . values ( ) . stream ( ) . filter ( filter ) . collect ( Collectors . toList ( ) ) ; |
public class EntityComparator { /** * Sort the entities .
* @ param entities The set of { @ link Entity entities } .
* @ param sortingBy The sorting method .
* @ return A set of sorted { @ link Entity entities } . */
public static Set < Entity > sort ( Set < Entity > entities , Order sortingBy ) { } } | EntityComparator comparator = new EntityComparator ( sortingBy ) ; List < Entity > list = new ArrayList < Entity > ( entities ) ; Collections . sort ( list , comparator ) ; Set < Entity > sortedEntities = new LinkedHashSet < > ( list ) ; return sortedEntities ; |
public class StereoTool { /** * Checks these four atoms for square planarity .
* @ param atomA an atom in the plane
* @ param atomB an atom in the plane
* @ param atomC an atom in the plane
* @ param atomD an atom in the plane
* @ return true if all the atoms are in the same plane */
public static boolean isSquarePlanar ( IAtom atomA , IAtom atomB , IAtom atomC , IAtom atomD ) { } } | Point3d pointA = atomA . getPoint3d ( ) ; Point3d pointB = atomB . getPoint3d ( ) ; Point3d pointC = atomC . getPoint3d ( ) ; Point3d pointD = atomD . getPoint3d ( ) ; return isSquarePlanar ( pointA , pointB , pointC , pointD ) ; |
public class AndroidExportFilter { /** * { @ inheritDoc } */
@ Override public void filter ( IKeyValuePair keyValuePair ) { } } | keyValuePair . setKey ( escapeKeyName ( keyValuePair . getKey ( ) ) ) ; if ( keyValuePair . getValue ( ) != null ) { keyValuePair . setValue ( escapeXmlSpecialCharacters ( keyValuePair . getValue ( ) ) ) ; } |
public class CassandraDataTranslator { /** * Marshal collection .
* @ param cassandraTypeClazz
* the cassandra type clazz
* @ param result
* the result
* @ param clazz
* the clazz
* @ return the collection */
public static Collection marshalCollection ( Class cassandraTypeClazz , Collection result , Class clazz , Class resultTypeClass ) { } } | Collection mappedCollection = result ; if ( cassandraTypeClazz . isAssignableFrom ( BytesType . class ) ) { mappedCollection = ( Collection ) PropertyAccessorHelper . getObject ( resultTypeClass ) ; for ( Object value : result ) { byte [ ] valueAsBytes = new byte [ ( ( ByteBuffer ) value ) . remaining ( ) ] ; ( ( ByteBuffer ) value ) . get ( valueAsBytes ) ; mappedCollection . add ( PropertyAccessorHelper . getObject ( clazz , valueAsBytes ) ) ; } } return mappedCollection ; |
public class ChunkedIntArray { /** * Overwrite the integer found at a specific record and column .
* Used to back - patch existing records , most often changing their
* " next sibling " reference from 0 ( unknown ) to something meaningful
* @ param position int Record number
* @ param offset int Column number
* @ param value int New contents */
void writeEntry ( int position , int offset , int value ) throws ArrayIndexOutOfBoundsException { } } | /* try
fastArray [ ( position * slotsize ) + offset ] = value ;
catch ( ArrayIndexOutOfBoundsException aioobe ) */
{ if ( offset >= slotsize ) throw new ArrayIndexOutOfBoundsException ( XMLMessages . createXMLMessage ( XMLErrorResources . ER_OFFSET_BIGGER_THAN_SLOT , null ) ) ; // " Offset bigger than slot " ) ;
position *= slotsize ; int chunkpos = position >> lowbits ; int slotpos = position & lowmask ; int [ ] chunk = chunks . elementAt ( chunkpos ) ; chunk [ slotpos + offset ] = value ; // ATOMIC !
} |
public class Timeline { /** * Obtains q ( t ) for the given t . */
private int at ( long t ) { } } | SortedMap < Long , int [ ] > head = data . subMap ( t , Long . MAX_VALUE ) ; if ( head . isEmpty ( ) ) return 0 ; return data . get ( head . firstKey ( ) ) [ 0 ] ; |
public class MetaClassRegistryImpl { /** * Returns an iterator to iterate over all constant meta classes .
* This iterator can be seen as making a snapshot of the current state
* of the registry . The snapshot will include all meta classes that has
* been used unless they are already collected . Collected meta classes
* will be skipped automatically , so you can expect that each element
* of the iteration is not null . Calling this method is thread safe , the
* usage of the iterator is not .
* @ return the iterator . */
public Iterator iterator ( ) { } } | final MetaClass [ ] refs = metaClassInfo . toArray ( EMPTY_METACLASS_ARRAY ) ; return new Iterator ( ) { // index in the ref array
private int index = 0 ; // the current meta class
private MetaClass currentMeta ; // used to ensure that hasNext has been called
private boolean hasNextCalled = false ; // the cached hasNext call value
private boolean hasNext = false ; public boolean hasNext ( ) { if ( hasNextCalled ) return hasNext ; hasNextCalled = true ; if ( index < refs . length ) { hasNext = true ; currentMeta = refs [ index ] ; index ++ ; } else { hasNext = false ; } return hasNext ; } private void ensureNext ( ) { // we ensure that hasNext has been called before
// next is called
hasNext ( ) ; hasNextCalled = false ; } public Object next ( ) { ensureNext ( ) ; return currentMeta ; } public void remove ( ) { ensureNext ( ) ; setMetaClass ( currentMeta . getTheClass ( ) , currentMeta , null ) ; currentMeta = null ; } } ; |
public class DoubleTuples { /** * Creates a new tuple that is a < i > view < / i >
* on the specified portion of the given parent . Changes in the
* parent will be visible in the returned tuple .
* @ param parent The parent tuple
* @ param fromIndex The start index in the parent , inclusive
* @ param toIndex The end index in the parent , exclusive
* @ throws NullPointerException If the given parent is < code > null < / code >
* @ throws IllegalArgumentException If the given indices are invalid .
* This is the case when < code > fromIndex & lt ; 0 < / code > ,
* < code > fromIndex & gt ; toIndex < / code > , or
* < code > toIndex & gt ; { @ link Tuple # getSize ( ) parent . getSize ( ) } < / code > ,
* @ return The new tuple */
static DoubleTuple createSubTuple ( DoubleTuple parent , int fromIndex , int toIndex ) { } } | return new SubDoubleTuple ( parent , fromIndex , toIndex ) ; |
public class StartQueryRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( StartQueryRequest startQueryRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( startQueryRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( startQueryRequest . getLogGroupName ( ) , LOGGROUPNAME_BINDING ) ; protocolMarshaller . marshall ( startQueryRequest . getStartTime ( ) , STARTTIME_BINDING ) ; protocolMarshaller . marshall ( startQueryRequest . getEndTime ( ) , ENDTIME_BINDING ) ; protocolMarshaller . marshall ( startQueryRequest . getQueryString ( ) , QUERYSTRING_BINDING ) ; protocolMarshaller . marshall ( startQueryRequest . getLimit ( ) , LIMIT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class OverrideService { /** * Get the ordinal value for the last of a particular override on a path
* @ param overrideId Id of the override to check
* @ param pathId Path the override is on
* @ param clientUUID UUID of the client
* @ param filters If supplied , only endpoints ending with values in filters are returned
* @ return The integer ordinal
* @ throws Exception */
public int getCurrentMethodOrdinal ( int overrideId , int pathId , String clientUUID , String [ ] filters ) throws Exception { } } | int currentOrdinal = 0 ; List < EnabledEndpoint > enabledEndpoints = getEnabledEndpoints ( pathId , clientUUID , filters ) ; for ( EnabledEndpoint enabledEndpoint : enabledEndpoints ) { if ( enabledEndpoint . getOverrideId ( ) == overrideId ) { currentOrdinal ++ ; } } return currentOrdinal ; |
public class CmsPathTree { /** * Tries to traverse the descendants of this node along the given path ,
* and returns the last existing node along that path . < p >
* The given path is modified so that only the part of the path for which no nodes can be found
* remains . < p >
* @ param pathToConsume the path to find ( will be modified by this method )
* @ return the last node found along the descendant chain for the path */
private CmsPathTree < P , V > findNodeInternal ( List < P > pathToConsume ) { } } | Iterator < P > iter = pathToConsume . iterator ( ) ; CmsPathTree < P , V > currentNode = this ; while ( iter . hasNext ( ) ) { CmsPathTree < P , V > child = currentNode . getChild ( iter . next ( ) ) ; if ( child != null ) { iter . remove ( ) ; currentNode = child ; } else { return currentNode ; } } return currentNode ; |
public class Tile { /** * Adds the given TimeSection to the list of sections .
* Sections in the Medusa library usually are less eye - catching
* than Areas .
* @ param SECTION */
public void addTimeSection ( final TimeSection SECTION ) { } } | if ( null == SECTION ) return ; getTimeSections ( ) . add ( SECTION ) ; getTimeSections ( ) . sort ( new TimeSectionComparator ( ) ) ; fireTileEvent ( SECTION_EVENT ) ; |
public class PicoContainerWrapper { /** * This method will usually create a new instance each time it is called
* @ param name
* component name
* @ return object new instance */
public Object getComponentNewInstance ( String name ) { } } | Debug . logVerbose ( "[JdonFramework]getComponentNewInstance: name=" + name , module ) ; ComponentAdapter componentAdapter = container . getComponentAdapter ( name ) ; if ( componentAdapter == null ) { Debug . logWarning ( "[JdonFramework]Not find the component in container :" + name , module ) ; return null ; } return componentAdapter . getComponentInstance ( container ) ; |
public class AvailabilityForecastOptions { /** * Sets the breakdown value for this AvailabilityForecastOptions .
* @ param breakdown */
public void setBreakdown ( com . google . api . ads . admanager . axis . v201902 . ForecastBreakdownOptions breakdown ) { } } | this . breakdown = breakdown ; |
public class JmsSysEventListener { /** * For asynch we do the onMessage listener style . Otherwise we wait
* synchronously for incoming messages .
* @ param asynch true if we just want to set the listener
* @ throws NotificationException */
public void process ( final boolean asynch ) throws NotificationException { } } | if ( asynch ) { try { consumer . setMessageListener ( this ) ; return ; } catch ( final JMSException je ) { throw new NotificationException ( je ) ; } } while ( running ) { final Message m = conn . receive ( ) ; if ( m == null ) { running = false ; return ; } onMessage ( m ) ; } |
public class Logger { /** * Logs recoverable application error .
* @ param correlationId ( optional ) transaction id to trace execution through
* call chain .
* @ param message a human - readable message to log .
* @ param args arguments to parameterize the message . */
public void error ( String correlationId , String message , Object ... args ) { } } | formatAndWrite ( LogLevel . Error , correlationId , null , message , args ) ; |
public class SSEDescriptionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SSEDescription sSEDescription , ProtocolMarshaller protocolMarshaller ) { } } | if ( sSEDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sSEDescription . getStatus ( ) , STATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class EnvironmentLogger { /** * Sets the logger ' s parent . This should only be called by the LogManager
* code . */
@ Override public void setParent ( Logger parent ) { } } | if ( parent . equals ( _parent ) ) return ; super . setParent ( parent ) ; if ( parent instanceof EnvironmentLogger ) { _parent = ( EnvironmentLogger ) parent ; _parent . addChild ( this ) ; } updateEffectiveLevel ( _systemClassLoader ) ; |
public class DeleteQueryAction { /** * Create filters based on
* the Where clause .
* @ param where the ' WHERE ' part of the SQL query .
* @ throws SqlParseException */
private void setWhere ( Where where ) throws SqlParseException { } } | if ( where != null ) { QueryBuilder whereQuery = QueryMaker . explan ( where ) ; request . filter ( whereQuery ) ; } else { request . filter ( QueryBuilders . matchAllQuery ( ) ) ; } |
public class Client { /** * Perform a query request and return a query object . The Query object
* provides a simple way of dealing with result sets that need to be
* iterated or paged through .
* @ param method
* @ param params
* @ param data
* @ param segments
* @ return */
public Query queryEntitiesRequest ( HttpMethod method , Map < String , Object > params , Object data , String ... segments ) { } } | ApiResponse response = apiRequest ( method , params , data , segments ) ; return new EntityQuery ( response , method , params , data , segments ) ; |
public class MessageHistory { /** * Returns a List of Messages , sorted starting from newest to oldest , of all message that have already been retrieved
* from Discord with this MessageHistory object using the { @ link # retrievePast ( int ) } , { @ link # retrieveFuture ( int ) } , and
* { @ link net . dv8tion . jda . core . entities . MessageChannel # getHistoryAround ( String , int ) } methods .
* @ return A List of Messages , sorted newest to oldest . */
public List < Message > getRetrievedHistory ( ) { } } | int size = size ( ) ; if ( size == 0 ) return Collections . emptyList ( ) ; else if ( size == 1 ) return Collections . singletonList ( history . getValue ( 0 ) ) ; return Collections . unmodifiableList ( new ArrayList < > ( history . values ( ) ) ) ; |
public class PaxLoggingServiceImpl { /** * This method is used by the FrameworkHandler to log framework events .
* @ param bundle The bundle that caused the event .
* @ param level The level to be logged as .
* @ param message The message .
* @ param exception The exception , if any otherwise null . */
void log ( @ Nullable Bundle bundle , int level , String message , @ Nullable Throwable exception ) { } } | logImpl ( bundle , level , message , exception , m_fqcn ) ; |
public class EventDispatcher { /** * Broadcasts the event to all of the interested listener ' s dispatch queues . */
private void publish ( Cache < K , V > cache , EventType eventType , K key , @ Nullable V oldValue , @ Nullable V newValue , boolean quiet ) { } } | if ( dispatchQueues . isEmpty ( ) ) { return ; } JCacheEntryEvent < K , V > event = null ; for ( Registration < K , V > registration : dispatchQueues . keySet ( ) ) { if ( ! registration . getCacheEntryListener ( ) . isCompatible ( eventType ) ) { continue ; } if ( event == null ) { event = new JCacheEntryEvent < > ( cache , eventType , key , oldValue , newValue ) ; } if ( ! registration . getCacheEntryFilter ( ) . evaluate ( event ) ) { continue ; } JCacheEntryEvent < K , V > e = event ; CompletableFuture < Void > future = dispatchQueues . computeIfPresent ( registration , ( k , queue ) -> { Runnable action = ( ) -> registration . getCacheEntryListener ( ) . dispatch ( e ) ; return queue . thenRunAsync ( action , executor ) ; } ) ; if ( ( future != null ) && registration . isSynchronous ( ) && ! quiet ) { pending . get ( ) . add ( future ) ; } } |
public class PaneDiagramSwing { /** * Set current diagram maker
* e . g . ClassDiagramMaker or ActivityDiagramMaker
* @ param controllerDiagramUml
* @ param palletteDiagram */
public void setDiagramControllerAndPalettes ( IControllerDiagramUml < ? , ? > controllerDiagramUml , Component palletteDiagram , Component palletteZoom ) { } } | this . activeControllerDiagramUml = controllerDiagramUml ; if ( currentPaletteDiagram != null ) { this . actionPropertiesPane . remove ( currentPaletteDiagram ) ; } this . actionPropertiesPane . add ( palletteDiagram , BorderLayout . CENTER ) ; currentPaletteDiagram = palletteDiagram ; if ( ! isZoomPalletteAdded ) { this . actionPropertiesPane . add ( palletteZoom , BorderLayout . SOUTH ) ; isZoomPalletteAdded = true ; } |
public class SchedulingSupport { /** * Determines the exact time the next interval starts based on a time within the current interval .
* @ param time time in millis
* @ param intervalInMinutes
* @ param offsetInMinutes
* @ return the exact time in milliseconds the interval begins local time */
public static long getNextIntervalStart ( long time , int intervalInMinutes , int offsetInMinutes ) { } } | long interval = MINUTE_IN_MS * intervalInMinutes ; return getPreviousIntervalStart ( time , intervalInMinutes , offsetInMinutes ) + interval ; |
public class ProcessDefinitionResourceImpl { /** * Determines an IANA media type based on the file suffix .
* Hint : as of Java 7 the method Files . probeContentType ( ) provides an implementation based on file type detection .
* @ param fileName
* @ return content type , defaults to octet - stream */
public static String getMediaTypeForFileSuffix ( String fileName ) { } } | String mediaType = "application/octet-stream" ; // default
if ( fileName != null ) { fileName = fileName . toLowerCase ( ) ; if ( fileName . endsWith ( ".png" ) ) { mediaType = "image/png" ; } else if ( fileName . endsWith ( ".svg" ) ) { mediaType = "image/svg+xml" ; } else if ( fileName . endsWith ( ".jpg" ) || fileName . endsWith ( ".jpeg" ) ) { mediaType = "image/jpeg" ; } else if ( fileName . endsWith ( ".gif" ) ) { mediaType = "image/gif" ; } else if ( fileName . endsWith ( ".bmp" ) ) { mediaType = "image/bmp" ; } } return mediaType ; |
public class PyExpressionGenerator { /** * Generate the given object .
* @ param castOperator the cast operator .
* @ param it the target for the generated content .
* @ param context the context .
* @ return the expression . */
protected XExpression _generate ( XCastedExpression castOperator , IAppendable it , IExtraLanguageGeneratorContext context ) { } } | return generate ( castOperator . getTarget ( ) , context . getExpectedExpressionType ( ) , it , context ) ; |
public class ApiOvhIpLoadbalancing { /** * Add a new rule to your route
* REST : POST / ipLoadbalancing / { serviceName } / tcp / route / { routeId } / rule
* @ param field [ required ] Name of the field to match like " protocol " or " host " . See " / ipLoadbalancing / { serviceName } / availableRouteRules " for a list of available rules
* @ param subField [ required ] Name of sub - field , if applicable . This may be a Cookie or Header name for instance
* @ param pattern [ required ] Value to match against this match . Interpretation if this field depends on the match and field
* @ param displayName [ required ] Human readable name for your rule
* @ param match [ required ] Matching operator . Not all operators are available for all fields . See " / ipLoadbalancing / { serviceName } / availableRouteRules "
* @ param negate [ required ] Invert the matching operator effect
* @ param serviceName [ required ] The internal name of your IP load balancing
* @ param routeId [ required ] Id of your route */
public OvhRouteRule serviceName_tcp_route_routeId_rule_POST ( String serviceName , Long routeId , String displayName , String field , OvhRouteRuleMatchesEnum match , Boolean negate , String pattern , String subField ) throws IOException { } } | String qPath = "/ipLoadbalancing/{serviceName}/tcp/route/{routeId}/rule" ; StringBuilder sb = path ( qPath , serviceName , routeId ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "displayName" , displayName ) ; addBody ( o , "field" , field ) ; addBody ( o , "match" , match ) ; addBody ( o , "negate" , negate ) ; addBody ( o , "pattern" , pattern ) ; addBody ( o , "subField" , subField ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhRouteRule . class ) ; |
public class CmsInheritanceReferenceParser { /** * Gets the parsed reference for a locale . < p >
* Gets the reference object for the locale , and uses the reference for the English language as a fallback . < p >
* @ param locale the locale to get the reference for
* @ return the reference for the locale */
public CmsInheritanceReference getReference ( Locale locale ) { } } | CmsInheritanceReference ref = m_references . get ( locale ) ; if ( ref == null ) { ref = m_references . get ( Locale . ENGLISH ) ; } return ref ; |
public class NodeTypes { /** * Determine if either the primary type or any of the mixin types allows SNS .
* @ param primaryType the primary type name ; may not be null
* @ param mixinTypes the mixin type names ; may be null or empty
* @ return { @ code true } if either the primary type or any of the mixin types allows SNS . If neither allow SNS ,
* this will return { @ code false } */
public boolean allowsNameSiblings ( Name primaryType , Set < Name > mixinTypes ) { } } | if ( isUnorderedCollection ( primaryType , mixinTypes ) ) { // regardless of the actual types , if at least one of them is an unordered collection , SNS are not allowed
return false ; } if ( nodeTypeNamesThatAllowSameNameSiblings . contains ( primaryType ) ) return true ; if ( mixinTypes != null && ! mixinTypes . isEmpty ( ) ) { for ( Name mixinType : mixinTypes ) { if ( nodeTypeNamesThatAllowSameNameSiblings . contains ( mixinType ) ) return true ; } } return false ; |
public class ConfigValueImpl { /** * X @ Override */
public < N > ConfigValueImpl < N > as ( Class < N > clazz ) { } } | configEntryType = clazz ; return ( ConfigValueImpl < N > ) this ; |
public class CSTNode { /** * Returns true if the node and it ' s first and second child match the
* specified types . Missing nodes are Token . NULL . */
boolean matches ( int type , int child1 , int child2 ) { } } | return matches ( type , child1 ) && get ( 2 , true ) . isA ( child2 ) ; |
public class ReviewsImpl { /** * The reviews created would show up for Reviewers on your team . As Reviewers complete reviewing , results of the Review would be POSTED ( i . e . HTTP POST ) on the specified CallBackEndpoint .
* & lt ; h3 & gt ; CallBack Schemas & lt ; / h3 & gt ;
* & lt ; h4 & gt ; Review Completion CallBack Sample & lt ; / h4 & gt ;
* & lt ; p & gt ;
* { & lt ; br / & gt ;
* " ReviewId " : " & lt ; Review Id & gt ; " , & lt ; br / & gt ;
* " ModifiedOn " : " 2016-10-11T22:36:32.9934851Z " , & lt ; br / & gt ;
* " ModifiedBy " : " & lt ; Name of the Reviewer & gt ; " , & lt ; br / & gt ;
* " CallBackType " : " Review " , & lt ; br / & gt ;
* " ContentId " : " & lt ; The ContentId that was specified input & gt ; " , & lt ; br / & gt ;
* " Metadata " : { & lt ; br / & gt ;
* " adultscore " : " 0 . xxx " , & lt ; br / & gt ;
* " a " : " False " , & lt ; br / & gt ;
* " racyscore " : " 0 . xxx " , & lt ; br / & gt ;
* " r " : " True " & lt ; br / & gt ;
* } , & lt ; br / & gt ;
* " ReviewerResultTags " : { & lt ; br / & gt ;
* " a " : " False " , & lt ; br / & gt ;
* " r " : " True " & lt ; br / & gt ;
* } & lt ; br / & gt ;
* } & lt ; br / & gt ;
* & lt ; / p & gt ; .
* @ param teamName Your team name .
* @ param contentType The content type .
* @ param createVideoReviewsBody Body for create reviews API
* @ param createVideoReviewsOptionalParameter the object representing the optional parameters to be set before calling this API
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < List < String > > createVideoReviewsAsync ( String teamName , String contentType , List < CreateVideoReviewsBodyItem > createVideoReviewsBody , CreateVideoReviewsOptionalParameter createVideoReviewsOptionalParameter , final ServiceCallback < List < String > > serviceCallback ) { } } | return ServiceFuture . fromResponse ( createVideoReviewsWithServiceResponseAsync ( teamName , contentType , createVideoReviewsBody , createVideoReviewsOptionalParameter ) , serviceCallback ) ; |
public class SearchContactsResult { /** * The contacts that meet the specified set of filter criteria , in sort order .
* @ param contacts
* The contacts that meet the specified set of filter criteria , in sort order . */
public void setContacts ( java . util . Collection < ContactData > contacts ) { } } | if ( contacts == null ) { this . contacts = null ; return ; } this . contacts = new java . util . ArrayList < ContactData > ( contacts ) ; |
public class appqoeparameter { /** * Use this API to fetch all the appqoeparameter resources that are configured on netscaler . */
public static appqoeparameter get ( nitro_service service ) throws Exception { } } | appqoeparameter obj = new appqoeparameter ( ) ; appqoeparameter [ ] response = ( appqoeparameter [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; |
public class EffectiveAssignmentInsnFinder { /** * Static factory method .
* @ param targetVariable
* the variable to find the effective { @ code putfield } or
* { @ code putstatic } instruction for .
* @ param controlFlowBlocks
* all control flow blocks of an initialising constructor or
* method .
* @ return a new instance of this class . */
public static EffectiveAssignmentInsnFinder newInstance ( final FieldNode targetVariable , final Collection < ControlFlowBlock > controlFlowBlocks ) { } } | return new EffectiveAssignmentInsnFinder ( checkNotNull ( targetVariable ) , checkNotNull ( controlFlowBlocks ) ) ; |
public class StorageAccountsInner { /** * Updates the Data Lake Analytics account to replace Azure Storage blob account details , such as the access key and / or suffix .
* @ param resourceGroupName The name of the Azure resource group .
* @ param accountName The name of the Data Lake Analytics account .
* @ param storageAccountName The Azure Storage account to modify
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceResponse } object if successful . */
public Observable < Void > updateAsync ( String resourceGroupName , String accountName , String storageAccountName ) { } } | return updateWithServiceResponseAsync ( resourceGroupName , accountName , storageAccountName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class OgmEntityPersister { /** * Re - reads the given entity , refreshing any properties updated on the server - side during insert or update . */
private void processGeneratedProperties ( Serializable id , Object entity , Object [ ] state , SharedSessionContractImplementor session , GenerationTiming matchTiming ) { } } | Tuple tuple = getFreshTuple ( EntityKeyBuilder . fromPersister ( this , id , session ) , session ) ; saveSharedTuple ( entity , tuple , session ) ; if ( tuple == null || tuple . getSnapshot ( ) . isEmpty ( ) ) { throw log . couldNotRetrieveEntityForRetrievalOfGeneratedProperties ( getEntityName ( ) , id ) ; } int propertyIndex = - 1 ; for ( NonIdentifierAttribute attribute : getEntityMetamodel ( ) . getProperties ( ) ) { propertyIndex ++ ; final ValueGeneration valueGeneration = attribute . getValueGenerationStrategy ( ) ; if ( isReadRequired ( valueGeneration , matchTiming ) ) { Object hydratedState = gridPropertyTypes [ propertyIndex ] . hydrate ( tuple , getPropertyAliases ( "" , propertyIndex ) , session , entity ) ; state [ propertyIndex ] = gridPropertyTypes [ propertyIndex ] . resolve ( hydratedState , session , entity ) ; setPropertyValue ( entity , propertyIndex , state [ propertyIndex ] ) ; } } |
public class FileMetadata { /** * Compute a MD5 hash of each line of the file after removing of all blank chars */
public static void computeLineHashesForIssueTracking ( InputFile f , LineHashConsumer consumer ) { } } | try { readFile ( f . inputStream ( ) , f . charset ( ) , f . absolutePath ( ) , new CharHandler [ ] { new LineHashComputer ( consumer , f . file ( ) ) } ) ; } catch ( IOException e ) { throw new IllegalStateException ( "Failed to compute line hashes for " + f . absolutePath ( ) , e ) ; } |
public class GetCaCapsResponseHandler { /** * { @ inheritDoc }
* @ throws InvalidContentTypeException if the response is invalid */
@ Override public Capabilities getResponse ( final byte [ ] content , final String mimeType ) throws ContentException { } } | if ( mimeType == null || ! mimeType . startsWith ( TEXT_PLAIN ) ) { LOGGER . warn ( "Content-Type mismatch: was '{}', expected 'text/plain'" , mimeType ) ; } final EnumSet < Capability > caps = EnumSet . noneOf ( Capability . class ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "CA capabilities:" ) ; } BufferedReader reader = new BufferedReader ( new InputStreamReader ( new ByteArrayInputStream ( content ) , Charset . forName ( Charsets . US_ASCII . name ( ) ) ) ) ; Set < String > caCaps = new HashSet < String > ( ) ; String capability ; try { while ( ( capability = reader . readLine ( ) ) != null ) { caCaps . add ( capability ) ; } } catch ( IOException e ) { throw new InvalidContentTypeException ( e ) ; } finally { try { reader . close ( ) ; } catch ( IOException e ) { LOGGER . error ( "Error closing reader" , e ) ; } } for ( Capability enumValue : Capability . values ( ) ) { if ( caCaps . contains ( enumValue . toString ( ) ) ) { LOGGER . debug ( "[\u2713] {}" , enumValue . getDescription ( ) ) ; caps . add ( enumValue ) ; } else { LOGGER . debug ( "[\u2717] {}" , enumValue . getDescription ( ) ) ; } } return new Capabilities ( caps . toArray ( new Capability [ caps . size ( ) ] ) ) ; |
public class NamedEntityGraphImpl { /** * If not already created , a new < code > subclass - subgraph < / code > element will be created and returned .
* Otherwise , the first existing < code > subclass - subgraph < / code > element will be returned .
* @ return the instance defined for the element < code > subclass - subgraph < / code > */
public NamedSubgraph < NamedEntityGraph < T > > getOrCreateSubclassSubgraph ( ) { } } | List < Node > nodeList = childNode . get ( "subclass-subgraph" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new NamedSubgraphImpl < NamedEntityGraph < T > > ( this , "subclass-subgraph" , childNode , nodeList . get ( 0 ) ) ; } return createSubclassSubgraph ( ) ; |
public class OGraphDatabase { /** * Returns all the edges between the vertexes iVertex1 and iVertex2 with label between the array of labels passed as iLabels and
* with class between the array of class names passed as iClassNames .
* @ param iVertex1
* First Vertex
* @ param iVertex2
* Second Vertex
* @ param iLabels
* Array of strings with the labels to get as filter
* @ param iClassNames
* Array of strings with the name of the classes to get as filter
* @ return The Set with the common Edges between the two vertexes . If edges aren ' t found the set is empty */
public Set < ODocument > getEdgesBetweenVertexes ( final ODocument iVertex1 , final ODocument iVertex2 , final String [ ] iLabels , final String [ ] iClassNames ) { } } | final Set < ODocument > result = new HashSet < ODocument > ( ) ; if ( iVertex1 != null && iVertex2 != null ) { // CHECK OUT EDGES
for ( OIdentifiable e : getOutEdges ( iVertex1 ) ) { final ODocument edge = ( ODocument ) e ; if ( checkEdge ( edge , iLabels , iClassNames ) ) { if ( edge . < ODocument > field ( "in" ) . equals ( iVertex2 ) ) result . add ( edge ) ; } } // CHECK IN EDGES
for ( OIdentifiable e : getInEdges ( iVertex1 ) ) { final ODocument edge = ( ODocument ) e ; if ( checkEdge ( edge , iLabels , iClassNames ) ) { if ( edge . < ODocument > field ( "out" ) . equals ( iVertex2 ) ) result . add ( edge ) ; } } } return result ; |
public class GalleryImagesInner { /** * Get gallery image .
* @ param resourceGroupName The name of the resource group .
* @ param labAccountName The name of the lab Account .
* @ param galleryImageName The name of the gallery Image .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the GalleryImageInner object if successful . */
public GalleryImageInner get ( String resourceGroupName , String labAccountName , String galleryImageName ) { } } | return getWithServiceResponseAsync ( resourceGroupName , labAccountName , galleryImageName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class MultiUserChat { /** * Changes the occupant ' s availability status within the room . The presence type
* will remain available but with a new status that describes the presence update and
* a new presence mode ( e . g . Extended away ) .
* @ param status a text message describing the presence update .
* @ param mode the mode type for the presence update .
* @ throws NotConnectedException
* @ throws InterruptedException
* @ throws MucNotJoinedException */
public void changeAvailabilityStatus ( String status , Presence . Mode mode ) throws NotConnectedException , InterruptedException , MucNotJoinedException { } } | final EntityFullJid myRoomJid = this . myRoomJid ; if ( myRoomJid == null ) { throw new MucNotJoinedException ( this ) ; } // Check that we already have joined the room before attempting to change the
// availability status .
if ( ! joined ) { throw new MucNotJoinedException ( this ) ; } // We change the availability status by sending a presence packet to the room with the
// new presence status and mode
Presence joinPresence = new Presence ( Presence . Type . available ) ; joinPresence . setStatus ( status ) ; joinPresence . setMode ( mode ) ; joinPresence . setTo ( myRoomJid ) ; // Send join packet .
connection . sendStanza ( joinPresence ) ; |
public class ExpressionSpecBuilder { /** * Returns an < code > IfNotExists < / code > object which represents an < a href =
* " http : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Expressions . Modifying . html "
* > if _ not _ exists ( path , operand ) < / a > function call ; used for building
* expression .
* < pre >
* " if _ not _ exists ( path , operand ) – If the item does not contain an attribute
* at the specified path , then if _ not _ exists evaluates to operand ; otherwise ,
* it evaluates to path . You can use this function to avoid overwriting an
* attribute already present in the item . "
* < / pre >
* @ param path
* document path to an attribute
* @ param defaultValue
* default value if the attribute doesn ' t exist
* @ return an < code > IfNotExists < / code > object for number set ( NS ) attribute . */
public static IfNotExistsFunction < NS > if_not_exists ( String path , Number ... defaultValue ) { } } | return if_not_exists ( new PathOperand ( path ) , new LiteralOperand ( defaultValue ) ) ; |
public class EnumFormat { /** * Add annotations { @ link EnumString } to each of your < code > enum < / code > constants .
* If this annotation is not present , make sure you added corresponding < code > string < / code >
* to < code > res < / code > folder with the same name ( lower case ) as your < code > enum < / code > constant .
* @ param e not null
* @ param < E > any enum type
* @ return localized string if it was correctly configured
* @ see EnumString */
public < E extends Enum < E > > String format ( E e ) { } } | return format ( ( Object ) e ) ; |
public class ProjectCalendar { /** * Method indicating whether a day is a working or non - working day .
* @ param day required day
* @ return true if this is a working day */
public boolean isWorkingDay ( Day day ) { } } | DayType value = getWorkingDay ( day ) ; boolean result ; if ( value == DayType . DEFAULT ) { ProjectCalendar cal = getParent ( ) ; if ( cal != null ) { result = cal . isWorkingDay ( day ) ; } else { result = ( day != Day . SATURDAY && day != Day . SUNDAY ) ; } } else { result = ( value == DayType . WORKING ) ; } return ( result ) ; |
public class Strings { /** * mergeSeq .
* @ param first
* a { @ link java . lang . String } object .
* @ param second
* a { @ link java . lang . String } object .
* @ return a { @ link java . lang . String } object . */
public static String mergeSeq ( final String first , final String second ) { } } | return mergeSeq ( first , second , DELIMITER ) ; |
public class InmemQueue { /** * { @ inheritDoc }
* @ throws QueueException . QueueIsFull
* if queue buffer is full */
@ Override public boolean requeueSilent ( IQueueMessage < ID , DATA > _msg ) throws QueueException . QueueIsFull { } } | IQueueMessage < ID , DATA > msg = _msg . clone ( ) ; putToQueue ( msg ) ; if ( ! isEphemeralDisabled ( ) ) { ephemeralStorage . remove ( msg . getId ( ) ) ; } return true ; |
public class InverseGaussianDistribution { /** * Probability density function of the Wald distribution .
* @ param x The value .
* @ param mu The mean .
* @ param shape Shape parameter
* @ return log PDF of the given Wald distribution at x . */
public static double logpdf ( double x , double mu , double shape ) { } } | if ( ! ( x > 0 ) || x == Double . POSITIVE_INFINITY ) { return x == x ? Double . NEGATIVE_INFINITY : Double . NaN ; } final double v = ( x - mu ) / mu ; return v < Double . MAX_VALUE ? 0.5 * FastMath . log ( shape / ( MathUtil . TWOPI * x * x * x ) ) - shape * v * v / ( 2. * x ) : Double . NEGATIVE_INFINITY ; |
public class Locale { /** * Decode the bytes from the specified input stream
* according to a charset selection . This function tries
* to decode a string from the given byte array
* with the following charsets ( in preferred order ) :
* < ul >
* < li > the current charset returned by { @ link Charset # defaultCharset ( ) } , < / li >
* < li > OEM United States : IBM437 , < / li >
* < li > West European : ISO - 8859-1 , < / li >
* < li > one of the charst returned by { @ link Charset # availableCharsets ( ) } . < / li >
* < / ul >
* < p > The IBM437 charset was added to support several specific files ( Dbase files )
* generated from a GIS .
* < p > This function read the input stream line by line .
* @ param stream is the stream to decode .
* @ param lineArray is the array of lines to fill
* @ return < code > true < / code > is the decoding was successful ,
* otherwhise < code > false < / code >
* @ throws IOException when the stream cannot be read . */
public static boolean decodeString ( InputStream stream , List < String > lineArray ) throws IOException { } } | // Read the complete file
byte [ ] completeBuffer = new byte [ 0 ] ; final byte [ ] buffer = new byte [ BUFFER_SIZE ] ; int read ; while ( ( read = stream . read ( buffer ) ) > 0 ) { final byte [ ] tmp = new byte [ completeBuffer . length + read ] ; System . arraycopy ( completeBuffer , 0 , tmp , 0 , completeBuffer . length ) ; System . arraycopy ( buffer , 0 , tmp , completeBuffer . length , read ) ; completeBuffer = tmp ; } // Get the two default charsets
// Charset oem _ us = Charset . forName ( " IBM437 " ) ;
final Charset westEuropean = Charset . forName ( "ISO-8859-1" ) ; // $ NON - NLS - 1 $
final Charset defaultCharset = Charset . defaultCharset ( ) ; // Decode with the current charset
boolean ok = decodeString ( new ByteArrayInputStream ( completeBuffer ) , lineArray , defaultCharset ) ; // Decode with the default oem US charset
/* if ( ( ! ok ) & & ( ! default _ charset . equals ( oem _ us ) ) ) {
ok = decodeString ( new ByteArrayInputStream ( complete _ buffer ) , lineArray , oem _ us ) ; */
// Decode with the default west european charset
if ( ( ! ok ) && ( ! defaultCharset . equals ( westEuropean ) ) ) { ok = decodeString ( new ByteArrayInputStream ( completeBuffer ) , lineArray , westEuropean ) ; } // Decode until one of the available charset replied a value
if ( ! ok ) { for ( final Entry < String , Charset > charset : Charset . availableCharsets ( ) . entrySet ( ) ) { if ( decodeString ( new ByteArrayInputStream ( completeBuffer ) , lineArray , charset . getValue ( ) ) ) { return true ; } } } return ok ; |
public class WeiXinQYService { /** * 删除解密后明文的补位字符
* @ param decrypted 解密后的明文
* @ return 删除补位字符后的明文 */
private static byte [ ] decodePKCS7 ( byte [ ] decrypted ) { } } | int pad = ( int ) decrypted [ decrypted . length - 1 ] ; if ( pad < 1 || pad > 32 ) pad = 0 ; return Arrays . copyOfRange ( decrypted , 0 , decrypted . length - pad ) ; |
public class JSDocInfo { /** * This is used to get all nodes + the description , excluding the param nodes . Used to help in an
* ES5 to ES6 class converter only . */
public JSDocInfo cloneClassDoc ( ) { } } | JSDocInfo other = new JSDocInfo ( ) ; other . info = this . info == null ? null : this . info . cloneClassDoc ( ) ; other . documentation = this . documentation ; other . visibility = this . visibility ; other . bitset = this . bitset ; other . type = cloneType ( this . type , false ) ; other . thisType = cloneType ( this . thisType , false ) ; other . includeDocumentation = this . includeDocumentation ; other . originalCommentPosition = this . originalCommentPosition ; other . setConstructor ( false ) ; other . setStruct ( false ) ; if ( ! isInterface ( ) && other . info != null ) { other . info . baseType = null ; } return other ; |
public class ThrottlingService { /** * Invoked when { @ code req } is not throttled . By default , this method delegates the specified { @ code req } to
* the { @ link # delegate ( ) } of this service . */
protected O onSuccess ( ServiceRequestContext ctx , I req ) throws Exception { } } | return delegate ( ) . serve ( ctx , req ) ; |
public class WritableUtils { /** * Get the encoded length if an integer is stored in a variable - length format
* @ return the encoded length */
public static int getVIntSize ( long i ) { } } | if ( i >= - 112 && i <= 127 ) { return 1 ; } if ( i < 0 ) { i ^= - 1L ; // take one ' s complement '
} // find the number of bytes with non - leading zeros
int dataBits = Long . SIZE - Long . numberOfLeadingZeros ( i ) ; // find the number of data bytes + length byte
return ( dataBits + 7 ) / 8 + 1 ; |
public class BaseCollectionStatsStorage { /** * - - - - - Listeners - - - - - */
@ Override public void registerStatsStorageListener ( StatsStorageListener listener ) { } } | if ( ! this . listeners . contains ( listener ) ) { this . listeners . add ( listener ) ; } |
public class MetaWeblogBlog { /** * { @ inheritDoc } */
@ Override public Blog . Collection getCollection ( final String token ) throws BlogClientException { } } | return collections . get ( token ) ; |
public class ExecutionGroupEdge { /** * Changes the channel type for this edge .
* @ param newChannelType
* the channel type for this edge
* @ throws GraphConversionException
* thrown if the new channel type violates a user setting */
void changeChannelType ( final ChannelType newChannelType ) throws GraphConversionException { } } | if ( ! this . channelType . equals ( newChannelType ) && this . userDefinedChannelType ) { throw new GraphConversionException ( "Cannot overwrite user defined channel type" ) ; } this . channelType = newChannelType ; |
public class JvmFloatAnnotationValueImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case TypesPackage . JVM_FLOAT_ANNOTATION_VALUE__VALUES : return values != null && ! values . isEmpty ( ) ; } return super . eIsSet ( featureID ) ; |
public class PackageSummaryBuilder { /** * Build the summary for the errors in this package .
* @ param node the XML element that specifies which components to document
* @ param summaryContentTree the summary tree to which the error summary will
* be added */
public void buildErrorSummary ( XMLNode node , Content summaryContentTree ) { } } | String errorTableSummary = configuration . getText ( "doclet.Member_Table_Summary" , configuration . getText ( "doclet.Error_Summary" ) , configuration . getText ( "doclet.errors" ) ) ; List < String > errorTableHeader = Arrays . asList ( configuration . getText ( "doclet.Error" ) , configuration . getText ( "doclet.Description" ) ) ; Set < TypeElement > ierrors = utils . isSpecified ( packageElement ) ? utils . getTypeElementsAsSortedSet ( utils . getErrors ( packageElement ) ) : configuration . typeElementCatalog . errors ( packageElement ) ; SortedSet < TypeElement > errors = utils . filterOutPrivateClasses ( ierrors , configuration . javafx ) ; if ( ! errors . isEmpty ( ) ) { packageWriter . addClassesSummary ( errors , configuration . getText ( "doclet.Error_Summary" ) , errorTableSummary , errorTableHeader , summaryContentTree ) ; } |
public class ZipkinEmitter { /** * Emits a pre - populated storage of annotations to Zipkin .
* @ param zipkinAnnotationsStore Zipkin annotations storage representing the entire list of annotations to emit */
public void emitAnnotations ( @ Nonnull ZipkinAnnotationsStore zipkinAnnotationsStore ) { } } | Objects . requireNonNull ( zipkinAnnotationsStore ) ; zipkinSpanCollector . collect ( zipkinAnnotationsStore . generate ( ) ) ; |
public class FileDownloader { /** * still has issues . . .
* @ param inputUrl
* @ param outputFile
* @ return */
@ Deprecated public File downloadFileNew ( File inputUrl , File outputFile ) { } } | OutputStream out = null ; InputStream fis = null ; HttpParams httpParameters = new BasicHttpParams ( ) ; int timeoutConnection = 2500 ; HttpConnectionParams . setConnectionTimeout ( httpParameters , timeoutConnection ) ; int timeoutSocket = 2500 ; HttpConnectionParams . setSoTimeout ( httpParameters , timeoutSocket ) ; File dir = outputFile . getParentFile ( ) ; dir . mkdirs ( ) ; try { HttpGet httpRequest = new HttpGet ( stringFromFile ( inputUrl ) ) ; DefaultHttpClient httpClient = new DefaultHttpClient ( httpParameters ) ; HttpResponse response = httpClient . execute ( httpRequest ) ; int statusCode = response . getStatusLine ( ) . getStatusCode ( ) ; if ( statusCode == HttpStatus . SC_OK ) { HttpEntity entity = response . getEntity ( ) ; out = new BufferedOutputStream ( new FileOutputStream ( outputFile ) ) ; long total = entity . getContentLength ( ) ; fis = entity . getContent ( ) ; if ( total > 1 || true ) startTalker ( total ) ; else { throw new IOException ( "Content null" ) ; } long progress = 0 ; byte [ ] buffer = new byte [ 1024 ] ; int length = 0 ; while ( ( length = fis . read ( buffer ) ) != - 1 ) { out . write ( buffer , 0 , length ) ; progressTalker ( length ) ; progress += length ; } /* for ( int b ; ( b = fis . read ( ) ) ! = - 1 ; ) {
out . write ( b ) ;
progress + = b ;
progressTalker ( b ) ; */
finishTalker ( progress ) ; } } catch ( Exception e ) { cancelTalker ( e ) ; e . printStackTrace ( ) ; return null ; } finally { try { if ( out != null ) { out . flush ( ) ; out . close ( ) ; } if ( fis != null ) fis . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return outputFile ; |
public class BaseDestinationHandler { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . impl . interfaces . DestinationHandler # getSourceProtocolItemStream ( ) */
@ Override public SourceProtocolItemStream getSourceProtocolItemStream ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getSourceProtocolItemStream" ) ; SourceProtocolItemStream sourceProtocolItemStream = _protoRealization . getRemoteSupport ( ) . getSourceProtocolItemStream ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getSourceProtocolItemStream" , sourceProtocolItemStream ) ; return sourceProtocolItemStream ; |
public class SignatureGenerator { /** * Create a class signature string for a specified type .
* @ return the signature if class is generic , else null . */
public String createClassSignature ( TypeElement type ) { } } | if ( ! hasGenericSignature ( type ) ) { return null ; } StringBuilder sb = new StringBuilder ( ) ; genClassSignature ( type , sb ) ; return sb . toString ( ) ; |
public class Timestamp { /** * Performs a comparison of the two points in time represented by two
* Timestamps .
* If the point in time represented by this Timestamp precedes that of
* { @ code t } , then { @ code - 1 } is returned .
* If { @ code t } precedes this Timestamp then { @ code 1 } is returned .
* If the Timestamps represent the same point in time , then
* { @ code 0 } is returned .
* Note that a { @ code 0 } result does not imply that the two Timestamps are
* { @ link # equals } , as the local offset or precision of the two Timestamps
* may be different .
* This method is provided in preference to individual methods for each of
* the six boolean comparison operators ( & lt ; , = = , & gt ; , & gt ; = , ! = , & lt ; = ) .
* The suggested idiom for performing these comparisons is :
* { @ code ( x . compareTo ( y ) } < em > & lt ; op & gt ; < / em > { @ code 0 ) } ,
* where < em > & lt ; op & gt ; < / em > is one of the six comparison operators .
* For example , the pairs below will return a { @ code 0 } result :
* < ul >
* < li > { @ code 2009T } < / li >
* < li > { @ code 2009-01T } < / li >
* < li > { @ code 2009-01-01T } < / li >
* < li > { @ code 2009-01-01T00:00Z } < / li >
* < li > { @ code 2009-01-01T00:00:00Z } < / li >
* < li > { @ code 2009-01-01T00:00:00.0Z } < / li >
* < li > { @ code 2009-01-01T00:00:00.00Z } < / li >
* < li > { @ code 2008-12-31T16:00-08:00 } < / li >
* < li > { @ code 2008-12-31T12:00-12:00 } < / li >
* < li > { @ code 2009-01-01T12:00 + 12:00 } < / li >
* < / ul >
* Use the { @ link # equals ( Timestamp ) } method to compare the point
* in time , < em > including < / em > precision and local offset .
* @ param t
* the other { @ code Timestamp } to compare this { @ code Timestamp } to
* @ return
* - 1 , 0 , or 1 if this { @ code Timestamp }
* is less than , equal to , or greater than { @ code t } respectively
* @ throws NullPointerException if { @ code t } is null .
* @ see # equals ( Timestamp ) */
public int compareTo ( Timestamp t ) { } } | // Test at millisecond precision first .
long this_millis = this . getMillis ( ) ; long arg_millis = t . getMillis ( ) ; if ( this_millis != arg_millis ) { return ( this_millis < arg_millis ) ? - 1 : 1 ; } // Values are equivalent at millisecond precision , so compare fraction
BigDecimal this_fraction = ( ( this . _fraction == null ) ? BigDecimal . ZERO : this . _fraction ) ; BigDecimal arg_fraction = ( ( t . _fraction == null ) ? BigDecimal . ZERO : t . _fraction ) ; return this_fraction . compareTo ( arg_fraction ) ; |
public class PyGenerator { /** * Generate the given object .
* @ param constructor the constructor .
* @ param it the target for the generated content .
* @ param context the context . */
protected void _generate ( SarlConstructor constructor , PyAppendable it , IExtraLanguageGeneratorContext context ) { } } | if ( constructor . isStatic ( ) ) { generateExecutable ( "___static_init___" , constructor , false , false , null , // $ NON - NLS - 1 $
getTypeBuilder ( ) . getDocumentation ( constructor ) , it , context ) ; it . newLine ( ) . append ( "___static_init___()" ) ; // $ NON - NLS - 1 $
} else { generateExecutable ( "__init__" , constructor , true , false , null , // $ NON - NLS - 1 $
getTypeBuilder ( ) . getDocumentation ( constructor ) , it , context ) ; } |
public class UniqueKeyHandler { /** * Called when a error happens on a file operation , return the errorcode , or fix the problem .
* @ param iErrorCode The error code from the previous listener .
* @ return The new error code . */
public int doErrorReturn ( int iChangeType , int iErrorCode ) // init this field override for other value
{ } } | if ( iChangeType == DBConstants . AFTER_ADD_TYPE ) if ( iErrorCode == DBConstants . DUPLICATE_KEY ) { // First , find the first unique key that is not a counter
Record record = this . getOwner ( ) ; for ( int iKeySeq = 0 ; iKeySeq < record . getKeyAreaCount ( ) ; iKeySeq ++ ) { KeyArea keyArea = record . getKeyArea ( iKeySeq ) ; if ( keyArea . getUniqueKeyCode ( ) != DBConstants . UNIQUE ) continue ; // Could not have been this key
BaseField field = m_fieldToBump ; if ( field == null ) field = keyArea . getField ( keyArea . getKeyFields ( ) - 1 ) ; if ( field instanceof CounterField ) continue ; // This could not have had a dup key
if ( field instanceof NumberField ) { // This is the one
if ( field instanceof DateTimeField ) m_iBumpAmount = KMS_IN_A_MINUTE ; long lCurrentValue = ( long ) field . getValue ( ) ; for ( long lValue = lCurrentValue + 1 ; lValue < lCurrentValue + REPEAT_COUNT * m_iBumpAmount ; lValue = lValue + m_iBumpAmount ) { field . setValue ( lValue ) ; try { record . add ( ) ; } catch ( DBException ex ) { if ( ex . getErrorCode ( ) != DBConstants . DUPLICATE_KEY ) break ; // Other error
continue ; // Ignore duplicate key error
} return DBConstants . NORMAL_RETURN ; // Everything is okay now
} } } } return super . doErrorReturn ( iChangeType , iErrorCode ) ; |
public class CompiledFEELSemanticMappings { /** * FEEL spec Table 41 : Specific semantics of equality
* Delegates to { @ link EvalHelper } except evaluationcontext */
public static Boolean eq ( Object left , Object right ) { } } | return EvalHelper . isEqual ( left , right , null ) ; |
public class Quaterniond { /** * / * ( non - Javadoc )
* @ see org . joml . Quaterniondc # rotateTo ( org . joml . Vector3dc , org . joml . Vector3dc , org . joml . Quaterniond ) */
public Quaterniond rotateTo ( Vector3dc fromDir , Vector3dc toDir , Quaterniond dest ) { } } | return rotateTo ( fromDir . x ( ) , fromDir . y ( ) , fromDir . z ( ) , toDir . x ( ) , toDir . y ( ) , toDir . z ( ) , dest ) ; |
public class Sort { /** * Check if the short array is reverse sorted . It loops through the entire short
* array once , checking that the elements are reverse sorted .
* < br >
* < br >
* < i > Runtime : < / i > O ( n )
* @ param shortArray the short array to check
* @ return < i > true < / i > if the short array is reverse sorted , else < i > false < / i > . */
public static boolean isReverseSorted ( short [ ] shortArray ) { } } | for ( int i = 0 ; i < shortArray . length - 1 ; i ++ ) { if ( shortArray [ i ] < shortArray [ i + 1 ] ) { return false ; } } return true ; |
public class JCudaDriver { /** * Finds a cloned version of a node . < br >
* < br >
* This function returns the node in \ p hClonedGraph corresponding to \ p hOriginalNode
* in the original graph . < br >
* < br >
* \ p hClonedGraph must have been cloned from \ p hOriginalGraph via : : cuGraphClone .
* \ p hOriginalNode must have been in \ p hOriginalGraph at the time of the call to
* : : cuGraphClone , and the corresponding cloned node in \ p hClonedGraph must not have
* been removed . The cloned node is then returned via \ p phClonedNode .
* @ param phNode - Returns handle to the cloned node
* @ param hOriginalNode - Handle to the original node
* @ param hClonedGraph - Cloned graph to query
* @ return
* CUDA _ SUCCESS ,
* CUDA _ ERROR _ INVALID _ VALUE ,
* @ see
* JCudaDriver # cuGraphClone */
public static int cuGraphNodeFindInClone ( CUgraphNode phNode , CUgraphNode hOriginalNode , CUgraph hClonedGraph ) { } } | return checkResult ( cuGraphNodeFindInCloneNative ( phNode , hOriginalNode , hClonedGraph ) ) ; |
public class Xdr { /** * Get a long from the buffer
* @ return long */
public long getLong ( ) { } } | return ( ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 56 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 48 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 40 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 32 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 24 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 16 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) << 8 | ( long ) ( _buffer [ _offset ++ ] & 0xff ) ) ; |
public class RedisCacheSource { /** * - - - - - get - - - - - */
@ Override public CompletableFuture < V > getAsync ( String key ) { } } | return ( CompletableFuture ) send ( "GET" , CacheEntryType . OBJECT , ( Type ) null , key , key . getBytes ( UTF8 ) ) ; |
public class IntStreamEx { /** * Returns the maximum element of this stream according to the provided key
* extractor function .
* This is a terminal operation .
* @ param keyExtractor a non - interfering , stateless function
* @ return an { @ code OptionalInt } describing the first element of this
* stream for which the highest value was returned by key extractor ,
* or an empty { @ code OptionalInt } if the stream is empty
* @ since 0.1.2 */
public OptionalInt maxByDouble ( IntToDoubleFunction keyExtractor ) { } } | return collect ( PrimitiveBox :: new , ( box , i ) -> { double key = keyExtractor . applyAsDouble ( i ) ; if ( ! box . b || Double . compare ( box . d , key ) < 0 ) { box . b = true ; box . d = key ; box . i = i ; } } , PrimitiveBox . MAX_DOUBLE ) . asInt ( ) ; |
public class HostStatusTracker { /** * Helper method to check that there is no overlap b / w hosts up and down .
* @ param A
* @ param B */
private void verifyMutuallyExclusive ( Collection < Host > A , Collection < Host > B ) { } } | Set < Host > left = new HashSet < Host > ( A ) ; Set < Host > right = new HashSet < Host > ( B ) ; boolean modified = left . removeAll ( right ) ; if ( modified ) { throw new RuntimeException ( "Host up and down sets are not mutually exclusive!" ) ; } |
public class ns_doc_image { /** * < pre >
* Use this operation to get NetScaler Documentation file .
* < / pre > */
public static ns_doc_image [ ] get ( nitro_service client ) throws Exception { } } | ns_doc_image resource = new ns_doc_image ( ) ; resource . validate ( "get" ) ; return ( ns_doc_image [ ] ) resource . get_resources ( client ) ; |
public class SemEvalReporter { /** * { @ inheritDoc } */
public void assignContextToKey ( String primaryKey , String secondaryKey , int contextId ) { } } | // Get the mapping from primarykeys to context descriptors .
List < Assignment > primaryAssignments = assignmentMap . get ( primaryKey ) ; if ( primaryAssignments == null ) { synchronized ( this ) { primaryAssignments = assignmentMap . get ( primaryKey ) ; if ( primaryAssignments == null ) { primaryAssignments = Collections . synchronizedList ( new ArrayList < Assignment > ( ) ) ; assignmentMap . put ( primaryKey , primaryAssignments ) ; } } } primaryAssignments . add ( new Assignment ( secondaryKey , contextId ) ) ; |
public class TextUtil { /** * Remove the mnemonic char from the specified string .
* @ param text is the text to scan .
* @ return the given text without the mnemonic character . */
@ Pure public static String removeMnemonicChar ( String text ) { } } | if ( text == null ) { return text ; } return text . replaceFirst ( "&" , "" ) ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ |
public class Interpreter { /** * Get the value of the name .
* name may be any value . e . g . a variable or field */
public Object get ( String name ) throws EvalError { } } | try { Object ret = globalNameSpace . get ( name , this ) ; return Primitive . unwrap ( ret ) ; } catch ( UtilEvalError e ) { throw e . toEvalError ( SimpleNode . JAVACODE , new CallStack ( ) ) ; } |
public class ImageLoaderCurrent { /** * / * ( non - Javadoc )
* @ see ImageLoader # processImage ( java . io . DataInputStream , ImageVisitor , boolean ) */
@ Override public void loadImage ( DataInputStream in , ImageVisitor v , boolean skipBlocks ) throws IOException { } } | try { InjectionHandler . processEvent ( InjectionEvent . IMAGE_LOADER_CURRENT_START ) ; v . start ( ) ; v . visitEnclosingElement ( ImageElement . FS_IMAGE ) ; imageVersion = in . readInt ( ) ; if ( ! canLoadVersion ( imageVersion ) ) throw new IOException ( "Cannot process fslayout version " + imageVersion ) ; v . visit ( ImageElement . IMAGE_VERSION , imageVersion ) ; v . visit ( ImageElement . NAMESPACE_ID , in . readInt ( ) ) ; long numInodes = in . readLong ( ) ; v . setNumberOfFiles ( numInodes ) ; v . visit ( ImageElement . GENERATION_STAMP , in . readLong ( ) ) ; if ( imageVersion <= FSConstants . STORED_TXIDS ) { v . visit ( ImageElement . LAST_TXID , in . readLong ( ) ) ; } if ( LayoutVersion . supports ( Feature . ADD_INODE_ID , imageVersion ) ) { v . visit ( ImageElement . LAST_INODE_ID , in . readLong ( ) ) ; } if ( LayoutVersion . supports ( Feature . FSIMAGE_COMPRESSION , imageVersion ) ) { boolean isCompressed = in . readBoolean ( ) ; v . visit ( ImageElement . IS_COMPRESSED , imageVersion ) ; if ( isCompressed ) { String codecClassName = Text . readString ( in ) ; v . visit ( ImageElement . COMPRESS_CODEC , codecClassName ) ; CompressionCodecFactory codecFac = new CompressionCodecFactory ( new Configuration ( ) ) ; CompressionCodec codec = codecFac . getCodecByClassName ( codecClassName ) ; if ( codec == null ) { throw new IOException ( "Image compression codec not supported: " + codecClassName ) ; } in = new DataInputStream ( codec . createInputStream ( in ) ) ; } } in = BufferedByteInputStream . wrapInputStream ( in , 8 * BASE_BUFFER_SIZE , BASE_BUFFER_SIZE ) ; processINodes ( in , v , numInodes , skipBlocks ) ; processINodesUC ( in , v , skipBlocks ) ; v . leaveEnclosingElement ( ) ; // FSImage
v . finish ( ) ; } catch ( IOException e ) { // Tell the visitor to clean up , then re - throw the exception
v . finishAbnormally ( ) ; throw e ; } |
public class SeekBarStateDrawable { /** * Set the Scrubber ColorStateList
* @ param stateList ColorStateList */
public void setScrubberColor ( ColorStateList stateList ) { } } | mScrubberStateList = stateList ; mScrubberColor = mScrubberStateList . getDefaultColor ( ) ; if ( mAlpha < 255 ) { mCurScrubberColor = Ui . modulateColorAlpha ( mScrubberColor , mAlpha ) ; } else { mCurScrubberColor = mScrubberColor ; } |
public class ArgumentsBuilder { /** * Returns a collection of default Pax Runner arguments .
* @ return collection of default arguments */
private Collection < String > defaultArguments ( ) { } } | final List < String > arguments = new ArrayList < String > ( ) ; arguments . add ( "--noConsole" ) ; arguments . add ( "--noDownloadFeedback" ) ; if ( ! argsSetManually ) { arguments . add ( "--noArgs" ) ; } String folder = System . getProperty ( "java.io.tmpdir" ) + "/paxexam_runner_" + System . getProperty ( "user.name" ) ; arguments . add ( "--workingDirectory=" + createWorkingDirectory ( folder ) . getAbsolutePath ( ) ) ; return arguments ; |
public class Bbox { /** * Does this bounding box contain the given point ( coordinate ) ?
* @ param coord
* Coordinate of point to test .
* @ return true if the point lies in the bounding box . */
public boolean contains ( Coordinate coord ) { } } | if ( coord . getX ( ) < this . getX ( ) ) { return false ; } if ( coord . getY ( ) < this . getY ( ) ) { return false ; } if ( coord . getX ( ) > this . getEndPoint ( ) . getX ( ) ) { return false ; } if ( coord . getY ( ) > this . getEndPoint ( ) . getY ( ) ) { return false ; } return true ; |
public class AnyValueMap { /** * Converts map element into an integer or returns null if conversion is not
* possible .
* @ param key a key of element to get .
* @ return integer value of the element or null if conversion is not supported .
* @ see IntegerConverter # toNullableInteger ( Object ) */
public Integer getAsNullableInteger ( String key ) { } } | Object value = getAsObject ( key ) ; return IntegerConverter . toNullableInteger ( value ) ; |
public class EventSubscriptionsInner { /** * Create or update an event subscription .
* Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope .
* @ param scope The identifier of the resource to which the event subscription needs to be created or updated . The scope can be a subscription , or a resource group , or a top level resource belonging to a resource provider namespace , or an EventGrid topic . For example , use ' / subscriptions / { subscriptionId } / ' for a subscription , ' / subscriptions / { subscriptionId } / resourceGroups / { resourceGroupName } ' for a resource group , and ' / subscriptions / { subscriptionId } / resourceGroups / { resourceGroupName } / providers / { resourceProviderNamespace } / { resourceType } / { resourceName } ' for a resource , and ' / subscriptions / { subscriptionId } / resourceGroups / { resourceGroupName } / providers / Microsoft . EventGrid / topics / { topicName } ' for an EventGrid topic .
* @ param eventSubscriptionName Name of the event subscription . Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only .
* @ param eventSubscriptionInfo Event subscription properties containing the destination and filter information
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable for the request */
public Observable < ServiceResponse < EventSubscriptionInner > > createOrUpdateWithServiceResponseAsync ( String scope , String eventSubscriptionName , EventSubscriptionInner eventSubscriptionInfo ) { } } | if ( scope == null ) { throw new IllegalArgumentException ( "Parameter scope is required and cannot be null." ) ; } if ( eventSubscriptionName == null ) { throw new IllegalArgumentException ( "Parameter eventSubscriptionName is required and cannot be null." ) ; } if ( eventSubscriptionInfo == null ) { throw new IllegalArgumentException ( "Parameter eventSubscriptionInfo is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } Validator . validate ( eventSubscriptionInfo ) ; Observable < Response < ResponseBody > > observable = service . createOrUpdate ( scope , eventSubscriptionName , eventSubscriptionInfo , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) ; return client . getAzureClient ( ) . getPutOrPatchResultAsync ( observable , new TypeToken < EventSubscriptionInner > ( ) { } . getType ( ) ) ; |
public class DescribeFleetEventsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeFleetEventsRequest describeFleetEventsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeFleetEventsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeFleetEventsRequest . getFleetId ( ) , FLEETID_BINDING ) ; protocolMarshaller . marshall ( describeFleetEventsRequest . getStartTime ( ) , STARTTIME_BINDING ) ; protocolMarshaller . marshall ( describeFleetEventsRequest . getEndTime ( ) , ENDTIME_BINDING ) ; protocolMarshaller . marshall ( describeFleetEventsRequest . getLimit ( ) , LIMIT_BINDING ) ; protocolMarshaller . marshall ( describeFleetEventsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.