signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class WebArchiveResourceListSource { /** * Returns a list of entries in the given directory . This method is * separated so that unit tests can override it to return test - friendly * file names . * @ param dir the dir containing the files to return * @ return the files and directories in the given direc...
String [ ] entries = new String [ 0 ] ; File libdir = new File ( dir ) ; if ( libdir . exists ( ) && libdir . isDirectory ( ) ) { entries = libdir . list ( ) ; } return entries ;
public class MultipleMappedEnumsPropertyWidget { /** * Creates a combobox for a particular input column . * @ param inputColumn * @ param mappedEnum * @ return */ protected DCComboBox < EnumerationValue > createComboBox ( final InputColumn < ? > inputColumn , EnumerationValue mappedEnum ) { } }
if ( mappedEnum == null && inputColumn != null ) { mappedEnum = getSuggestedValue ( inputColumn ) ; } final EnumerationValue [ ] enumConstants = getEnumConstants ( inputColumn , _mappedEnumsProperty ) ; final DCComboBox < EnumerationValue > comboBox = new DCComboBox < > ( enumConstants ) ; comboBox . setRenderer ( getC...
public class PutRecordRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PutRecordRequest putRecordRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( putRecordRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putRecordRequest . getStreamName ( ) , STREAMNAME_BINDING ) ; protocolMarshaller . marshall ( putRecordRequest . getData ( ) , DATA_BINDING ) ; protocolMarshaller . mar...
public class RequestUtil { /** * Parse the character encoding from the specified content type header . If * the content type is null , or there is no explicit character encoding , * < code > null < / code > is returned . * @ param contentType * a content type header */ public static String parseCharacterEncodin...
if ( contentType == null ) { return ( null ) ; } final int start = contentType . indexOf ( "charset=" ) ; if ( start < 0 ) { return ( null ) ; } String encoding = contentType . substring ( start + 8 ) ; final int end = encoding . indexOf ( ';' ) ; if ( end >= 0 ) { encoding = encoding . substring ( 0 , end ) ; } encodi...
public class LocalNetworkGatewaysInner { /** * Creates or updates a local network gateway in the specified resource group . * @ param resourceGroupName The name of the resource group . * @ param localNetworkGatewayName The name of the local network gateway . * @ param parameters Parameters supplied to the create ...
return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , localNetworkGatewayName , parameters ) , serviceCallback ) ;
public class ArgumentListBuilder { /** * Wrap command in a { @ code CMD . EXE } call so we can return the exit code ( { @ code ERRORLEVEL } ) . * This method takes care of escaping special characters in the command , which * is needed since the command is now passed as a string to the { @ code CMD . EXE } shell . ...
ArgumentListBuilder windowsCommand = new ArgumentListBuilder ( ) . add ( "cmd.exe" , "/C" ) ; boolean quoted , percent ; for ( int i = 0 ; i < args . size ( ) ; i ++ ) { StringBuilder quotedArgs = new StringBuilder ( ) ; String arg = args . get ( i ) ; quoted = percent = false ; for ( int j = 0 ; j < arg . length ( ) ;...
public class BoxApiUser { /** * Gets a request that deletes an enterprise user * The session provided must be associated with an enterprise admin user * @ param userId id of the user * @ return request to delete an enterprise user */ public BoxRequestsUser . DeleteEnterpriseUser getDeleteEnterpriseUserRequest ( S...
BoxRequestsUser . DeleteEnterpriseUser request = new BoxRequestsUser . DeleteEnterpriseUser ( getUserInformationUrl ( userId ) , mSession , userId ) ; return request ;
public class DetectCircleGrid { /** * Reverse the order of elements inside the grid */ void reverse ( Grid g ) { } }
work . clear ( ) ; int N = g . rows * g . columns ; for ( int i = 0 ; i < N ; i ++ ) { work . add ( g . ellipses . get ( N - i - 1 ) ) ; } g . ellipses . clear ( ) ; g . ellipses . addAll ( work ) ;
public class HessianOutput { /** * Removes a reference . */ public boolean removeRef ( Object obj ) throws IOException { } }
if ( _refs != null ) { _refs . remove ( obj ) ; return true ; } else return false ;
public class BooleanConverter { /** * Converts value into boolean or returns null when conversion is not possible . * @ param value the value to convert . * @ return boolean value or null when conversion is not supported . */ public static Boolean toNullableBoolean ( Object value ) { } }
if ( value == null ) return null ; if ( value instanceof Boolean ) return ( boolean ) value ; if ( value instanceof Duration ) return ( ( Duration ) value ) . toMillis ( ) > 0 ; String strValue = value . toString ( ) . toLowerCase ( ) ; if ( strValue . equals ( "1" ) || strValue . equals ( "true" ) || strValue . equals...
public class EntitiesDetectionJobFilterMarshaller { /** * Marshall the given parameter object . */ public void marshall ( EntitiesDetectionJobFilter entitiesDetectionJobFilter , ProtocolMarshaller protocolMarshaller ) { } }
if ( entitiesDetectionJobFilter == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( entitiesDetectionJobFilter . getJobName ( ) , JOBNAME_BINDING ) ; protocolMarshaller . marshall ( entitiesDetectionJobFilter . getJobStatus ( ) , JOBSTATUS_BI...
public class FactoryBldServices { /** * < p > Get HndlEntityFileReportReq in lazy mode . < / p > * @ return HndlEntityFileReportReq - HndlEntityFileReportReq * @ throws Exception - an exception */ @ Override public final HndlEntityFileReportReq < RS > lazyGetHndlEntityFileReportReq ( ) throws Exception { } }
String beanName = this . factoryAppBeans . getHndlEntityFileReportReqName ( ) ; @ SuppressWarnings ( "unchecked" ) HndlEntityFileReportReq < RS > hndlEfrr = ( HndlEntityFileReportReq < RS > ) this . factoryAppBeans . getBeansMap ( ) . get ( beanName ) ; if ( hndlEfrr == null ) { hndlEfrr = new HndlEntityFileReportReq <...
public class PatternBox { /** * Finds cases where protein A changes state of B , and B is then degraded . * NOTE : THIS PATTERN DOES NOT WORK . KEEPING ONLY FOR HISTORICAL REASONS . * @ return the pattern */ public static Pattern controlsDegradationIndirectly ( ) { } }
Pattern p = controlsStateChange ( ) ; p . add ( new Size ( new ParticipatesInConv ( RelType . INPUT ) , 1 , Size . Type . EQUAL ) , "output PE" ) ; p . add ( new Empty ( peToControl ( ) ) , "output PE" ) ; p . add ( new ParticipatesInConv ( RelType . INPUT ) , "output PE" , "degrading Conv" ) ; p . add ( new NOT ( type...
public class ObjectUtils { /** * This method returns the provided value unchanged . * This can prevent javac from inlining a constant * field , e . g . , * < pre > * public final static short MAGIC _ SHORT = ObjectUtils . CONST _ SHORT ( 127 ) ; * < / pre > * This way any jars that refer to this field do no...
if ( v < Short . MIN_VALUE || v > Short . MAX_VALUE ) { throw new IllegalArgumentException ( "Supplied value must be a valid byte literal between -32768 and 32767: [" + v + "]" ) ; } return ( short ) v ;
public class EKBCommit { /** * Adds a model to the list of models which shall be updated in the EDB . If the given object is not a model , an * IllegalArgumentException is thrown . */ public EKBCommit addUpdate ( Object update ) { } }
if ( update != null ) { checkIfModel ( update ) ; updates . add ( ( OpenEngSBModel ) update ) ; } return this ;
public class ControlBeanContextServicesSupport { /** * Deserialization support . * @ param ois * @ throws IOException * @ throws ClassNotFoundException */ private synchronized void readObject ( ObjectInputStream ois ) throws IOException , ClassNotFoundException { } }
ois . defaultReadObject ( ) ; int svcsSize = ois . readInt ( ) ; for ( int i = 0 ; i < svcsSize ; i ++ ) { _serviceProviders . put ( ( Class ) ois . readObject ( ) , ( ServiceProvider ) ois . readObject ( ) ) ; } int listenersSize = ois . readInt ( ) ; for ( int i = 0 ; i < listenersSize ; i ++ ) { _bcsListeners . add ...
public class TagStreamRequest { /** * A list of tags to associate with the specified stream . Each tag is a key - value pair ( the value is optional ) . * @ param tags * A list of tags to associate with the specified stream . Each tag is a key - value pair ( the value is * optional ) . * @ return Returns a refe...
setTags ( tags ) ; return this ;
public class Options { /** * Puts an short value for the given option name . * @ param key * the option name . * @ param value * the short value . */ public Options putShort ( String key , IModel < Short > value ) { } }
putOption ( key , new ShortOption ( value ) ) ; return this ;
public class PPORGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setProcFlgs ( Integer newProcFlgs ) { } }
Integer oldProcFlgs = procFlgs ; procFlgs = newProcFlgs ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . PPORG__PROC_FLGS , oldProcFlgs , procFlgs ) ) ;
public class CreateFiducialDocumentPDF { /** * Draws the grid in light grey on the document */ private void printGrid ( PDPageContentStream pcs , float offsetX , float offsetY , int numRows , int numCols , float sizeBox ) throws IOException { } }
float pageWidth = ( float ) paper . convertWidth ( units ) * UNIT_TO_POINTS ; float pageHeight = ( float ) paper . convertHeight ( units ) * UNIT_TO_POINTS ; // pcs . setLineCapStyle ( 1 ) ; pcs . setStrokingColor ( 0.75 ) ; for ( int i = 0 ; i <= numCols ; i ++ ) { float x = offsetX + i * sizeBox ; pcs . moveTo ( x , ...
public class AncientJulianLeapYears { /** * / * [ deutsch ] * < p > Erzeugt eine neue historische Sequenz von julianischen Schaltjahren vor dem Jahre AD 8 . < / p > * < p > Beispiel : Um den Vorschlag von Matzat ( 1883 ) zu modellieren , k & ouml ; nnen Anwender den Ausdruck * { @ code of ( 44 , 41 , 38 , 35 , 32...
if ( Arrays . equals ( bcYears , SEQUENCE_SCALIGER ) ) { return SCALIGER ; } return new AncientJulianLeapYears ( bcYears ) ;
public class ProcessorGlobalVariableDecl { /** * Append the current template element to the current * template element , and then push it onto the current template * element stack . * @ param handler non - null reference to current StylesheetHandler that is constructing the Templates . * @ param elem The non - ...
// Just push , but don ' t append . handler . pushElemTemplateElement ( elem ) ;
public class PropertiesManager { /** * Retrieve the value of the given property as an Enum constant of the given * type . If the current value of the specified property cannot be converted * to the appropriate Enum , the default value will be retrieved . < br > * < br > * Note that this method requires the Enum...
try { return Enum . valueOf ( type , getProperty ( property ) . toUpperCase ( ) ) ; } catch ( IllegalArgumentException e ) { return Enum . valueOf ( type , getDefaultProperty ( property ) . toUpperCase ( ) ) ; }
public class AbstractBigtableAdmin { /** * { @ inheritDoc } */ @ Override public Pair < Integer , Integer > getAlterStatus ( byte [ ] tableName ) throws IOException { } }
return getAlterStatus ( TableName . valueOf ( tableName ) ) ;
public class ComponentFactory { /** * Get a new instance of a supported component . * @ param name * The name of the component ; for example " 3des - cbc " * @ return the newly instantiated object * @ throws ClassNotFoundException */ public Object getInstance ( String name ) throws SshException { } }
if ( supported . containsKey ( name ) ) { try { return createInstance ( name , ( Class < ? > ) supported . get ( name ) ) ; } catch ( Throwable t ) { throw new SshException ( t . getMessage ( ) , SshException . INTERNAL_ERROR ) ; } } throw new SshException ( name + " is not supported" , SshException . UNSUPPORTED_ALGOR...
public class Controller { /** * Remove Cookie . */ public Controller removeCookie ( String name ) { } }
return doSetCookie ( name , null , 0 , null , null , null ) ;
public class ApplicationProtocolNegotiationHandler { /** * Invoked on failed initial SSL / TLS handshake . */ protected void handshakeFailure ( ChannelHandlerContext ctx , Throwable cause ) throws Exception { } }
logger . warn ( "{} TLS handshake failed:" , ctx . channel ( ) , cause ) ; ctx . close ( ) ;
public class SystemOutLoggingTool { /** * { @ inheritDoc } */ @ Override public void warn ( Object object , Object ... objects ) { } }
if ( level <= WARN ) { StringBuilder result = new StringBuilder ( ) ; result . append ( object ) ; for ( Object obj : objects ) { result . append ( obj ) ; } warnString ( result . toString ( ) ) ; }
public class MultiplexFile { /** * Returns 0 if referring block is 0. */ final long getBlockId ( long refBlockId , int index ) throws IOException { } }
if ( refBlockId == 0 ) { return 0 ; } return getBlockId ( mBackingFile , refBlockId * mBlockSize + index ) ;
public class CommerceWishListLocalServiceWrapper { /** * Returns the commerce wish list with the primary key . * @ param commerceWishListId the primary key of the commerce wish list * @ return the commerce wish list * @ throws PortalException if a commerce wish list with the primary key could not be found */ @ Ov...
return _commerceWishListLocalService . getCommerceWishList ( commerceWishListId ) ;
public class HttpHeaders { /** * @ deprecated Use { @ link # set ( CharSequence , Object ) } instead . * @ see # setDateHeader ( HttpMessage , CharSequence , Date ) */ @ Deprecated public static void setDateHeader ( HttpMessage message , String name , Date value ) { } }
setDateHeader ( message , ( CharSequence ) name , value ) ;
public class CommerceDiscountUsageEntryPersistenceImpl { /** * Removes all the commerce discount usage entries where groupId = & # 63 ; from the database . * @ param groupId the group ID */ @ Override public void removeByGroupId ( long groupId ) { } }
for ( CommerceDiscountUsageEntry commerceDiscountUsageEntry : findByGroupId ( groupId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceDiscountUsageEntry ) ; }
public class InternalSARLLexer { /** * $ ANTLR start " T _ _ 142" */ public final void mT__142 ( ) throws RecognitionException { } }
try { int _type = T__142 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalSARL . g : 128:8 : ( ' catch ' ) // InternalSARL . g : 128:10 : ' catch ' { match ( "catch" ) ; } state . type = _type ; state . channel = _channel ; } finally { }
public class TableDefinition { /** * Indicate if the given string is a valid table name . Table names must begin with a * letter and consist of all letters , digits , and underscores . * @ param tableName Candidate table name . * @ return True if the name is not null , not empty , starts with a letter , and * c...
return tableName != null && tableName . length ( ) > 0 && Utils . isLetter ( tableName . charAt ( 0 ) ) && Utils . allAlphaNumUnderscore ( tableName ) ;
public class OrderComparator { /** * Determine the order value for the given object . * < p > The default implementation checks against the given { @ link OrderSourceProvider } * using { @ link # findOrder } and falls back to a regular { @ link # getOrder ( Object ) } call . * @ param obj the object to check * ...
Integer order = null ; if ( sourceProvider != null ) { order = findOrder ( sourceProvider . getOrderSource ( obj ) ) ; } return ( order != null ? order : getOrder ( obj ) ) ;
public class OperaLauncherProtocol { /** * Send a request and receive a result . * @ param type the request type to be sent * @ param body the serialized request payload * @ return the response * @ throws IOException if socket read error or protocol parse error */ public ResponseEncapsulation sendRequest ( Mess...
sendRequestHeader ( type , ( body != null ) ? body . length : 0 ) ; if ( body != null ) { os . write ( body ) ; } return recvMessage ( ) ;
public class ScalingInstructionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ScalingInstruction scalingInstruction , ProtocolMarshaller protocolMarshaller ) { } }
if ( scalingInstruction == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( scalingInstruction . getServiceNamespace ( ) , SERVICENAMESPACE_BINDING ) ; protocolMarshaller . marshall ( scalingInstruction . getResourceId ( ) , RESOURCEID_BINDIN...
public class WaybackRequest { /** * create WaybackRequet for Replay request . * @ param url target URL * @ param replay requested date * @ param start start timestamp ( 14 - digit ) * @ param end end timestamp ( 14 - digit ) * @ return WaybackRequet */ public static WaybackRequest createReplayRequest ( String...
WaybackRequest r = new WaybackRequest ( ) ; r . setReplayRequest ( ) ; r . setRequestUrl ( url ) ; r . setReplayTimestamp ( replay ) ; r . setStartTimestamp ( start ) ; r . setEndTimestamp ( end ) ; return r ;
public class Document { /** * Returns the set of all namespaces contained within the document . * @ return Set of namespaces , which may be empty */ public Set < Namespace > getAllNamespaces ( ) { } }
if ( namespaceGroup == null ) { return emptySet ( ) ; } return new HashSet < Namespace > ( namespaceGroup . getAllNamespaces ( ) ) ;
public class spilloverpolicy_binding { /** * Use this API to fetch spilloverpolicy _ binding resource of given name . */ public static spilloverpolicy_binding get ( nitro_service service , String name ) throws Exception { } }
spilloverpolicy_binding obj = new spilloverpolicy_binding ( ) ; obj . set_name ( name ) ; spilloverpolicy_binding response = ( spilloverpolicy_binding ) obj . get_resource ( service ) ; return response ;
public class AbstractAlpineQueryManager { /** * Refreshes and detaches an objects . * @ param pcs the instances to detach * @ param < T > the type to return * @ return the detached instances * @ since 1.3.0 */ public < T > Set < T > detach ( Set < T > pcs ) { } }
pm . getFetchPlan ( ) . setDetachmentOptions ( FetchPlan . DETACH_LOAD_FIELDS ) ; return new LinkedHashSet < > ( pm . detachCopyAll ( pcs ) ) ;
public class ValueMap { /** * Sets the value of the specified key in the current ValueMap to the * given value . */ public ValueMap withBinarySet ( String key , byte [ ] ... val ) { } }
super . put ( key , new LinkedHashSet < byte [ ] > ( Arrays . asList ( val ) ) ) ; return this ;
public class ReconnectionHandler { /** * Initiate reconnect and return a { @ link ChannelFuture } for synchronization . The resulting future either succeeds or fails . * It can be { @ link ChannelFuture # cancel ( boolean ) canceled } to interrupt reconnection and channel initialization . A failed * { @ link Channe...
CompletableFuture < Channel > future = new CompletableFuture < > ( ) ; CompletableFuture < SocketAddress > address = new CompletableFuture < > ( ) ; socketAddressSupplier . subscribe ( remoteAddress -> { address . complete ( remoteAddress ) ; if ( future . isCancelled ( ) ) { return ; } reconnect0 ( future , remoteAddr...
public class Generics { /** * Returns the class for the specified type variable , or null if it is not known . * @ return May be null . */ public Class resolveTypeVariable ( TypeVariable typeVariable ) { } }
for ( int i = argumentsSize - 2 ; i >= 0 ; i -= 2 ) if ( arguments [ i ] == typeVariable ) return ( Class ) arguments [ i + 1 ] ; return null ;
public class ClassInfo { /** * Checks whether this class declares a field with the named annotation . * @ param fieldAnnotationName * The name of a field annotation . * @ return true if this class declares a field with the named annotation . */ public boolean hasDeclaredFieldAnnotation ( final String fieldAnnotat...
for ( final FieldInfo fi : getDeclaredFieldInfo ( ) ) { if ( fi . hasAnnotation ( fieldAnnotationName ) ) { return true ; } } return false ;
public class CircularView { /** * TODO always draw the animating markers on top . */ @ Override protected void onDraw ( Canvas canvas ) { } }
super . onDraw ( canvas ) ; int contentWidth = mWidth - paddingLeft - paddingRight ; int contentHeight = mHeight - paddingTop - paddingBottom ; mCirclePaint . setStyle ( Paint . Style . FILL ) ; mCirclePaint . setColor ( Color . RED ) ; // Draw CircularViewObject mCircle . draw ( canvas ) ; // Draw non - highlighted Ma...
public class SingleProviderResolver { /** * Return a provider for this interface . * @ param c the provider interface that is implemented * @ param defaultImpl if no provider is found , instantiate the default implementation * @ param < T > type of provider interface * @ return instance of the provider or { @ c...
if ( providers . containsKey ( c ) ) { return ( T ) providers . get ( c ) ; } try { String _className = readFile ( "org/cache2k/services/" + c . getName ( ) ) ; T obj = null ; if ( _className == null ) { ServiceLoader < T > sl = ServiceLoader . load ( c ) ; Iterator < T > it = sl . iterator ( ) ; if ( it . hasNext ( ) ...
public class DatasetUtils { /** * Find { @ link HivePartitionDataset } given complete partition name from a list of datasets * @ param partitionName Complete partition name ie dbName @ tableName @ partitionName */ public static Optional < HivePartitionDataset > findDataset ( String partitionName , List < HivePartitio...
for ( HivePartitionDataset dataset : datasets ) { if ( dataset . datasetURN ( ) . equalsIgnoreCase ( partitionName ) ) { return Optional . fromNullable ( dataset ) ; } } log . warn ( "Unable to find dataset corresponding to " + partitionName ) ; return Optional . < HivePartitionDataset > absent ( ) ;
public class JmsJcaActivationSpecImpl { /** * Set the target type property . * @ param targetType */ @ Override public void setTargetType ( String targetType ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setTargetType" , targetType ) ; } _targetType = targetType ;
public class AbstractView { /** * Process view annotation . * This will define if callback action will the view itself or its dedicated controller */ private void processViewAnnotation ( ) { } }
// Find the AutoHandler annotation if any because it ' s optional final AutoHandler ah = ClassUtility . getLastClassAnnotation ( this . getClass ( ) , AutoHandler . class ) ; // Use the annotation value to define the callbackObject : View or Controller // When controller is null always use the view as callbackObject if...
public class MediaApi { /** * Switch to monitor * Switch to the monitor mode for the specified chat . The supervisor can & # 39 ; t send messages in this mode and only another supervisor can see that the monitoring supervisor joined the chat . * @ param mediatype The media channel . ( required ) * @ param id The ...
com . squareup . okhttp . Call call = mediaSwicthToMonitorValidateBeforeCall ( mediatype , id , mediaSwicthToCoachData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class Transition { /** * This method is called automatically by the Transition and * TransitionSet classes when a transition finishes , either because * a transition did nothing ( returned a null Animator from * { @ link Transition # createAnimator ( ViewGroup , TransitionValues , * TransitionValues ) } ...
-- mNumInstances ; if ( mNumInstances == 0 ) { if ( mListeners != null && mListeners . size ( ) > 0 ) { ArrayList < TransitionListener > tmpListeners = ( ArrayList < TransitionListener > ) mListeners . clone ( ) ; int numListeners = tmpListeners . size ( ) ; for ( int i = 0 ; i < numListeners ; ++ i ) { tmpListeners . ...
public class SyncListItemReader { /** * Make the request to the Twilio API to perform the read . * @ param client TwilioRestClient with which to make the request * @ return SyncListItem ResourceSet */ @ Override public ResourceSet < SyncListItem > read ( final TwilioRestClient client ) { } }
return new ResourceSet < > ( this , client , firstPage ( client ) ) ;
public class LineNumberReader { /** * Read a line of text . Whenever a < a href = " # lt " > line terminator < / a > is * read the current line number is incremented . * @ return A String containing the contents of the line , not including * any < a href = " # lt " > line termination characters < / a > , or * <...
synchronized ( lock ) { String l = super . readLine ( skipLF ) ; skipLF = false ; if ( l != null ) lineNumber ++ ; return l ; }
public class SelectStatement { /** * Get qualified star select items . * @ return qualified star select items */ public Collection < StarSelectItem > getQualifiedStarSelectItems ( ) { } }
Collection < StarSelectItem > result = new LinkedList < > ( ) ; for ( SelectItem each : items ) { if ( each instanceof StarSelectItem && ( ( StarSelectItem ) each ) . getOwner ( ) . isPresent ( ) ) { result . add ( ( StarSelectItem ) each ) ; } } return result ;
public class CuratorFactory { /** * Create a new instance { @ link LeaderLatch } * @ param serverId the ID used to register this instance with curator . * This ID should typically be obtained using * { @ link org . apache . atlas . ha . AtlasServerIdSelector # selectServerId ( Configuration ) } * @ param zkRoot...
return new LeaderLatch ( curatorFramework , zkRoot + APACHE_ATLAS_LEADER_ELECTOR_PATH , serverId ) ;
public class ForkJoinPool { /** * Removes all available unexecuted submitted and forked tasks * from scheduling queues and adds them to the given collection , * without altering their execution status . These may include * artificially generated or wrapped tasks . This method is * designed to be invoked only wh...
int count = 0 ; WorkQueue [ ] ws ; WorkQueue w ; ForkJoinTask < ? > t ; if ( ( ws = workQueues ) != null ) { for ( int i = 0 ; i < ws . length ; ++ i ) { if ( ( w = ws [ i ] ) != null ) { while ( ( t = w . poll ( ) ) != null ) { c . add ( t ) ; ++ count ; } } } } return count ;
public class DirectoryConnection { /** * On the DirectoryConnection receive Response from DirectorySocket . * @ param header * the Response Header . * @ param response * the Response . */ public void onReceivedPesponse ( ResponseHeader header , Response response ) { } }
Packet packet = null ; updateRecv ( ) ; if ( header . getXid ( ) == - 4 ) { // -4 is the xid for AuthPacket if ( ErrorCode . AUTHENT_FAILED . equals ( header . getErr ( ) ) ) { if ( getStatus ( ) . isAlive ( ) ) { setStatus ( ConnectionStatus . AUTH_FAILED ) ; } } LOGGER . info ( "Got auth sessionid:0x" + session . id ...
public class ConsumerSessionImpl { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . sib . core . ConsumerSession # close ( ) */ @ Override public void close ( ) throws SIResourceException , SIConnectionLostException , SIErrorException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConsumerSession . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIConsumerSession . tc , "close" , this ) ; // perform the actual closing operations _close ( ) ; // remove ourselves from the connection _connection . removeConsumerSession ( this ) ; if ( _bifurcat...
public class GeoJsonReaderDriver { /** * Parses Json Array . * Syntax : * Json Array : * { " member1 " : value1 } , value2 , value3 , { " member4 " : value4 } ] * @ param jp the json parser * @ return the array but written like a String */ private void parseArrayMetadata ( JsonParser jp ) throws IOException {...
JsonToken value = jp . nextToken ( ) ; while ( value != JsonToken . END_ARRAY ) { if ( value == JsonToken . START_OBJECT ) { parseObjectMetadata ( jp ) ; } else if ( value == JsonToken . START_ARRAY ) { parseArrayMetadata ( jp ) ; } value = jp . nextToken ( ) ; }
public class Notification { /** * Adds a field ( kind of property ) to the notification * @ param field the name of the field ( = the key ) * @ param value the value of the field * @ return the notification itself */ public Notification setFieldValue ( String field , @ Nullable String value ) { } }
fields . put ( field , value ) ; return this ;
public class CompareMatcher { /** * @ see DiffBuilder # withNamespaceContext ( Map ) * @ since XMLUnit 2.1.0 */ @ Override public CompareMatcher withNamespaceContext ( Map < String , String > prefix2Uri ) { } }
diffBuilder . withNamespaceContext ( prefix2Uri ) ; return this ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link TargetPropertyType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link TargetPropertyType } { @ code...
return new JAXBElement < TargetPropertyType > ( _Subject_QNAME , TargetPropertyType . class , null , value ) ;
public class StreamBootstrapper { /** * Factory method used when the underlying data provider is a pre - allocated * block source , and no stream is used . * Additionally the buffer passed is not owned by the bootstrapper * or Reader that is created , so it is not to be recycled . */ public static StreamBootstrap...
return new StreamBootstrapper ( pubId , sysId , data , start , end ) ;
public class Http2ConnectionManager { /** * Get or creat the per route pool . * @ param eventLoopPool the pool that is bound to the eventloop * @ param key the route key * @ return PerRouteConnectionPool */ private EventLoopPool . PerRouteConnectionPool getOrCreatePerRoutePool ( EventLoopPool eventLoopPool , Stri...
final EventLoopPool . PerRouteConnectionPool perRouteConnectionPool = eventLoopPool . fetchPerRoutePool ( key ) ; if ( perRouteConnectionPool != null ) { return perRouteConnectionPool ; } return eventLoopPool . getPerRouteConnectionPools ( ) . computeIfAbsent ( key , p -> new EventLoopPool . PerRouteConnectionPool ( po...
public class ASTHelpers { /** * Returns the method tree that matches the given symbol within the compilation unit , or null if * none was found . */ @ Nullable public static MethodTree findMethod ( MethodSymbol symbol , VisitorState state ) { } }
return JavacTrees . instance ( state . context ) . getTree ( symbol ) ;
public class GoogleMapShape { /** * Expand the bounding box by the markers * @ param boundingBox bounding box * @ param markers list of markers */ private void expandBoundingBoxMarkers ( BoundingBox boundingBox , List < Marker > markers ) { } }
for ( Marker marker : markers ) { expandBoundingBox ( boundingBox , marker . getPosition ( ) ) ; }
public class BaseFolder { /** * Add this field in the Record ' s field sequence . */ public BaseField setupField ( int iFieldSeq ) { } }
BaseField field = null ; // if ( iFieldSeq = = 0) // field = new CounterField ( this , ID , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ; // field . setHidden ( true ) ; // if ( iFieldSeq = = 1) // field = new RecordChangedField ( this , LAST _ CHANGED , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ; /...
public class Storage { /** * Factory method to create a new storage backed by a concurrent hash map . * @ param < K > * @ param < V > * @ return */ public static < K , V > Storage < K , V > createConcurrentHashMapStorage ( ) { } }
return new Storage < K , V > ( new MapStorageWrapper < K , V > ( new ConcurrentHashMap < K , V > ( ) ) ) ;
public class XStreamTransformer { /** * xml - > pojo * @ param clazz * @ param xml * @ return */ @ SuppressWarnings ( "unchecked" ) public static < T > T fromXml ( Class < T > clazz , String xml ) { } }
T object = ( T ) CLASS_2_XSTREAM_INSTANCE . get ( clazz ) . fromXML ( xml ) ; return object ;
public class UserRegistration { /** * Get the table name . */ public String getTableNames ( boolean bAddQuotes ) { } }
return ( m_tableName == null ) ? Record . formatTableNames ( USER_REGISTRATION_FILE , bAddQuotes ) : super . getTableNames ( bAddQuotes ) ;
public class GerritSendCommandQueue { /** * Checks queue size . */ private void checkQueueSize ( ) { } }
int queueSize = getQueueSize ( ) ; if ( SEND_QUEUE_SIZE_WARNING_THRESHOLD > 0 && queueSize >= SEND_QUEUE_SIZE_WARNING_THRESHOLD ) { logger . warn ( "The Gerrit send commands queue contains {} items!" + " Something might be stuck, or your system can't process the commands fast enough." + " Try to increase the number of ...
public class OrExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public NotificationChain basicSetRight ( Expression newRight , NotificationChain msgs ) { } }
Expression oldRight = right ; right = newRight ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , SimpleExpressionsPackage . OR_EXPRESSION__RIGHT , oldRight , newRight ) ; if ( msgs == null ) msgs = notification ; else msgs . add ( notification ) ; ...
public class AbsSetting { /** * 获取数字型型属性值 * @ param key 属性名 * @ param group 分组名 * @ param defaultValue 默认值 * @ return 属性值 */ public Integer getInt ( String key , String group , Integer defaultValue ) { } }
return Convert . toInt ( getByGroup ( key , group ) , defaultValue ) ;
public class DefaultReconfigurationPlan { /** * Iterate over the actions . * The action are automatically sorted increasingly by their starting moment . * @ return an iterator . */ @ Override public Iterator < Action > iterator ( ) { } }
Set < Action > sorted = new TreeSet < > ( startFirstComparator ) ; sorted . addAll ( actions ) ; return sorted . iterator ( ) ;
public class MPP9Reader { /** * This method is called to try to catch any invalid tasks that may have sneaked past all our other checks . * This is done by validating the tasks by task ID . */ private void postProcessTasks ( ) { } }
List < Task > allTasks = m_file . getTasks ( ) ; if ( allTasks . size ( ) > 1 ) { Collections . sort ( allTasks ) ; int taskID = - 1 ; int lastTaskID = - 1 ; for ( int i = 0 ; i < allTasks . size ( ) ; i ++ ) { Task task = allTasks . get ( i ) ; taskID = NumberHelper . getInt ( task . getID ( ) ) ; // In Project the ta...
public class FileSupport { /** * Retrieves contents from a directory and its subdirectories matching a given mask . * @ param directory directory * @ param includeMask file name to match * @ param returnFiles return files * @ param returnDirs return directories * @ return a list containing the found contents ...
return getContentsInDirectoryTree ( directory , new FileFilterRuleSet ( directory . getPath ( ) ) . setIncludeFilesWithNameMask ( includeMask ) , returnFiles , returnDirs ) ;
public class SharedStateRegistry { /** * Releases one reference to the given shared state in the registry . This decreases the * reference count by one . Once the count reaches zero , the shared state is deleted . * @ param registrationKey the shared state for which we release a reference . * @ return the result ...
Preconditions . checkNotNull ( registrationKey ) ; final Result result ; final StreamStateHandle scheduledStateDeletion ; SharedStateRegistry . SharedStateEntry entry ; synchronized ( registeredStates ) { entry = registeredStates . get ( registrationKey ) ; Preconditions . checkState ( entry != null , "Cannot unregiste...
public class CmsGwtService { /** * Converts a list of properties to a map . < p > * @ param properties the list of properties * @ return a map from property names to properties */ protected Map < String , CmsProperty > getPropertiesByName ( List < CmsProperty > properties ) { } }
Map < String , CmsProperty > result = new HashMap < String , CmsProperty > ( ) ; for ( CmsProperty property : properties ) { String key = property . getName ( ) ; result . put ( key , property . clone ( ) ) ; } return result ;
public class RiakAttackStore { /** * { @ inheritDoc } */ @ Override public void addAttack ( Attack attack ) { } }
logger . warn ( "Security attack " + attack . getDetectionPoint ( ) . getLabel ( ) + " triggered by user: " + attack . getUser ( ) . getUsername ( ) ) ; String json = gson . toJson ( attack ) ; try { client . execute ( new UpdateSet . Builder ( attacks , new SetUpdate ( ) . add ( json ) ) . build ( ) ) ; } catch ( Exec...
public class PeerReplicationResource { /** * / * Visible for testing */ InstanceResource createInstanceResource ( ReplicationInstance instanceInfo , ApplicationResource applicationResource ) { } }
return new InstanceResource ( applicationResource , instanceInfo . getId ( ) , serverConfig , registry ) ;
public class JsDocInfoParser { /** * Parse a TypeName : * < pre > { @ code * TypeName : = NameExpression | NameExpression TypeApplication * TypeApplication : = ' . ' ? ' < ' TypeExpressionList ' > ' * } < / pre > */ private Node parseTypeName ( JsDocToken token ) { } }
Node typeNameNode = parseNameExpression ( token ) ; if ( match ( JsDocToken . LEFT_ANGLE ) ) { next ( ) ; skipEOLs ( ) ; Node memberType = parseTypeExpressionList ( typeNameNode . getString ( ) , next ( ) ) ; if ( memberType != null ) { typeNameNode . addChildToFront ( memberType ) ; skipEOLs ( ) ; if ( ! match ( JsDoc...
public class CmsUgcSession { /** * Finishes the session and publishes the changed resources if necessary . < p > * @ throws CmsException if something goes wrong */ public void finish ( ) throws CmsException { } }
m_finished = true ; m_requiresCleanup = false ; CmsProject project = getProject ( ) ; CmsObject projectCms = OpenCms . initCmsObject ( m_adminCms ) ; projectCms . getRequestContext ( ) . setCurrentProject ( project ) ; if ( m_configuration . isAutoPublish ( ) ) { // we don ' t necessarily publish with the user who has ...
public class ForkJoinPool { /** * If there is a security manager , makes sure caller has * permission to modify threads . */ private static void checkPermission ( ) { } }
SecurityManager security = System . getSecurityManager ( ) ; if ( security != null ) security . checkPermission ( modifyThreadPermission ) ;
public class HTCashbillServiceImp { /** * ( non - Javadoc ) * @ see com . popbill . api . HTCashbillService # getCertificateExpireDate ( java . lang . String ) */ @ Override public Date getCertificateExpireDate ( String CorpNum ) throws PopbillException { } }
CertResponse response = httpget ( "/HomeTax/Cashbill/CertInfo" , CorpNum , null , CertResponse . class ) ; try { return new SimpleDateFormat ( "yyyyMMddHHmmss" ) . parse ( response . certificateExpiration ) ; } catch ( ParseException e ) { throw new PopbillException ( - 99999999 , "날자형식 포맷변환 실패[" + response . certifica...
public class CommitsApi { /** * Add a comment to a commit . In order to post a comment in a particular line of a particular file , * you must specify the full commit SHA , the path , the line and lineType should be NEW . * < pre > < code > GitLab Endpoint : POST / projects / : id / repository / commits / : sha / co...
GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "note" , note , true ) . withParam ( "path" , path ) . withParam ( "line" , line ) . withParam ( "line_type" , lineType ) ; Response response = post ( Response . Status . CREATED , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" ...
public class GridIndex { /** * Finds a triangle near the given point * @ param point a query point * @ return a triangle at the same cell of the point */ public Triangle findCellTriangleOf ( Point3D point ) { } }
int x_index = ( int ) ( ( point . x - indexRegion . minX ( ) ) / x_size ) ; int y_index = ( int ) ( ( point . y - indexRegion . minY ( ) ) / y_size ) ; return grid [ x_index ] [ y_index ] ;
public class FileLogProperties { /** * Returns the physical log size of a recovery log constructed from the target * object . * @ return int The phyisical log size ( in kilobytes ) */ public int logFileSize ( ) { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logFileSize" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logFileSize" , new Integer ( _logFileSize ) ) ; return _logFileSize ;
public class TaskInProgress { /** * Finalize the < b > completed < / b > task ; note that this might not be the first * task - attempt of the { @ link TaskInProgress } and hence might be declared * { @ link TaskStatus . State . SUCCEEDED } or { @ link TaskStatus . State . KILLED } * @ param taskId id of the compl...
TaskStatus status = taskStatuses . get ( taskId ) ; status . setRunState ( finalTaskState ) ; activeTasks . remove ( taskId ) ;
public class OldNameCollector { /** * This is not an expression */ @ Override public LexNameList caseARecordModifier ( ARecordModifier rm ) throws AnalysisException { } }
return af . createPExpAssistant ( ) . getOldNames ( rm . getValue ( ) ) ;
public class DataSourceResourceFactoryBuilder { /** * Scan the shared libraries for the application to determine which library provides the data source class . * Update the jdbcDriver and dataSource configuration accordingly . For example , * < jdbcDriver libraryRef = " { service . pid for libraryRef } " library = ...
final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "updateWithLibraries" , applicationName , className ) ; ConfigurationAdmin configAdmin = configAdminRef . getServiceWithException ( ) ; // Find the application Configuration [ ] classloaderConfigs ...
public class GuardedByChecker { /** * Validates that { @ code @ GuardedBy } strings can be resolved . */ Description validate ( Tree tree , VisitorState state ) { } }
GuardedByValidationResult result = GuardedByUtils . isGuardedByValid ( tree , state ) ; if ( result . isValid ( ) ) { return Description . NO_MATCH ; } return buildDescription ( tree ) . setMessage ( String . format ( "Invalid @GuardedBy expression: %s" , result . message ( ) ) ) . build ( ) ;
public class AccumulatorHelper { /** * Transform the Map with accumulators into a Map containing only the * results . */ public static Map < String , OptionalFailure < Object > > toResultMap ( Map < String , Accumulator < ? , ? > > accumulators ) { } }
Map < String , OptionalFailure < Object > > resultMap = new HashMap < > ( ) ; for ( Map . Entry < String , Accumulator < ? , ? > > entry : accumulators . entrySet ( ) ) { resultMap . put ( entry . getKey ( ) , wrapUnchecked ( entry . getKey ( ) , ( ) -> entry . getValue ( ) . getLocalValue ( ) ) ) ; } return resultMap ...
public class Branch { /** * Attempts to compile the branch ID for this branch . In order to successfully * compile , the { @ code tree _ id } , { @ code path } and { @ code display _ name } must * be set . The path may be empty , which indicates this is a root branch , but * it must be a valid Map object . * @ ...
if ( tree_id < 1 || tree_id > 65535 ) { throw new IllegalArgumentException ( "Missing or invalid tree ID" ) ; } // root branch path may be empty if ( path == null ) { throw new IllegalArgumentException ( "Missing branch path" ) ; } if ( display_name == null || display_name . isEmpty ( ) ) { throw new IllegalArgumentExc...
public class GeoBBoxConditionBuilder { /** * Returns the { @ link GeoBBoxCondition } represented by this builder . * @ return a new geo bounding box condition */ @ Override public GeoBBoxCondition build ( ) { } }
return new GeoBBoxCondition ( boost , field , minLatitude , maxLatitude , minLongitude , maxLongitude ) ;
public class JSONAssert { /** * Asserts that the JSONObject provided does not match the expected string . If it is it throws an * { @ link AssertionError } . * @ see # assertEquals ( String , JSONObject , JSONCompareMode ) * @ param expectedStr Expected JSON string * @ param actual JSONObject to compare * @ p...
assertNotEquals ( "" , expectedStr , actual , compareMode ) ;
public class LRActivity { /** * Add a related object to this activity * @ param objectType The type of the object ( required ) * @ param id Id of the ojbect * @ param content String describing the content of the object * @ return True if added , false if not ( due to missing required fields ) */ public boolean ...
Map < String , Object > container = new HashMap < String , Object > ( ) ; if ( objectType != null ) { container . put ( "objectType" , objectType ) ; } else { return false ; } if ( id != null ) { container . put ( "id" , id ) ; } if ( content != null ) { container . put ( "content" , content ) ; } related . add ( conta...
public class JavaNetHttpTransport { /** * Parses response , whether or not the request was successful , if possible . * Reads entire input stream and closes it so the socket knows it is * finished and may be put back into a pool for reuse . */ private String response ( HttpURLConnection connection ) throws Lightblu...
try ( InputStream responseStream = connection . getInputStream ( ) ) { return readResponseStream ( responseStream , connection ) ; } catch ( IOException e ) { return readErrorStream ( connection , e ) ; }
public class NodeReportsInner { /** * Retrieve the Dsc node report data by node id and report id . * @ param resourceGroupName Name of an Azure Resource group . * @ param automationAccountName The name of the automation account . * @ param nodeId The Dsc node id . * @ param reportId The report id . * @ throws...
return getWithServiceResponseAsync ( resourceGroupName , automationAccountName , nodeId , reportId ) . toBlocking ( ) . single ( ) . body ( ) ;
public class LazyList { /** * Get the real List from a LazyList . * @ param list A LazyList returned from LazyList . add ( Object ) or null * @ param nullForEmpty If true , null is returned instead of an * empty list . * @ return The List of added items , which may be null , an EMPTY _ LIST * or a SingletonLi...
if ( list == null ) return nullForEmpty ? null : Collections . EMPTY_LIST ; if ( list instanceof List ) return ( List ) list ; List l = new ArrayList ( 1 ) ; l . add ( list ) ; return l ;