signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class GVRComponent { /** * Enable or disable this component . * @ param flag true to enable , false to disable . * @ see # enable ( ) * @ see # disable ( ) * @ see # isEnabled ( ) */ public void setEnable ( boolean flag ) { } }
if ( flag == mIsEnabled ) return ; mIsEnabled = flag ; if ( getNative ( ) != 0 ) { NativeComponent . setEnable ( getNative ( ) , flag ) ; } if ( flag ) { onEnable ( ) ; } else { onDisable ( ) ; }
public class WebAppSecurityCollaboratorImpl { /** * Authenticate the request if the following conditions are met : * 1 . Persist cred is enabled ( a . k . a . use authentication data for unprotected resource ) * 2 . We have authentication data * 3 . The resource is unprotected ( if its protected , will authentica...
if ( webAppSecConfig . isUseAuthenticationDataForUnprotectedResourceEnabled ( ) && ( unprotectedResource ( webRequest ) == PERMIT_REPLY ) && needToAuthenticateSubject ( webRequest ) ) { webRequest . disableFormLoginRedirect ( ) ; setAuthenticatedSubjectIfNeeded ( webRequest ) ; }
public class CmsContentInfoBean { /** * Sets the size of a page as a string . < p > * The specified string gets parsed into an int . < p > * @ param pageSize the size of a page as a string */ void setPageSizeAsString ( String pageSize ) { } }
if ( CmsStringUtil . isEmpty ( pageSize ) ) { return ; } try { m_pageSize = Integer . parseInt ( pageSize ) ; } catch ( NumberFormatException e ) { // intentionally left blank }
public class CertUtils { /** * All credits to belong to them . */ private static byte [ ] decodePem ( InputStream keyInputStream ) throws IOException { } }
BufferedReader reader = new BufferedReader ( new InputStreamReader ( keyInputStream ) ) ; try { String line ; while ( ( line = reader . readLine ( ) ) != null ) { if ( line . contains ( "-----BEGIN " ) ) { return readBytes ( reader , line . trim ( ) . replace ( "BEGIN" , "END" ) ) ; } } throw new IOException ( "PEM is ...
public class JmsSessionImpl { /** * This method is used by the JmsMsgConsumerImpl . Consumer constructor to * obtain a reference to the exception listener target . * Note that this method should _ not _ be used to pass properties through from * Connection to Producer or Consumer objects - instead use the * getP...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getConnection" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getConnection" , connection ) ; return connection ;
public class PolicyEventsInner { /** * Queries policy events for the resources under the resource group . * @ param subscriptionId Microsoft Azure subscription ID . * @ param resourceGroupName Resource group name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the obser...
return listQueryResultsForResourceGroupWithServiceResponseAsync ( subscriptionId , resourceGroupName ) . map ( new Func1 < ServiceResponse < PolicyEventsQueryResultsInner > , PolicyEventsQueryResultsInner > ( ) { @ Override public PolicyEventsQueryResultsInner call ( ServiceResponse < PolicyEventsQueryResultsInner > re...
public class IOState { /** * A websocket connection has finished its upgrade handshake , and is now open . */ public void onOpened ( ) { } }
if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "onOpened()" ) ; ConnectionState event = null ; synchronized ( this ) { if ( this . state == ConnectionState . OPEN ) { // already opened return ; } if ( this . state != ConnectionState . CONNECTED ) { LOG . debug ( "Unable to open, not in CONNECTED state: {}" , this . stat...
public class MLLibUtil { /** * Convert an rdd of data set in to labeled point . * @ param data the dataset to convert * @ param preCache boolean pre - cache rdd before operation * @ return an rdd of labeled point */ public static JavaRDD < LabeledPoint > fromDataSet ( JavaRDD < DataSet > data , boolean preCache )...
if ( preCache && ! data . getStorageLevel ( ) . useMemory ( ) ) { data . cache ( ) ; } return data . map ( new Function < DataSet , LabeledPoint > ( ) { @ Override public LabeledPoint call ( DataSet dataSet ) { return toLabeledPoint ( dataSet ) ; } } ) ;
public class CommonUtils { /** * - - - UNIT PARSER - - - */ public static final long resolveUnit ( String string ) throws NumberFormatException { } }
if ( string == null || "null" . equals ( string ) ) { return 0l ; } StringBuffer buffer = new StringBuffer ( string . toLowerCase ( ) ) ; // eg . 1KByte - > 1024byte long unit = resolveUnit ( buffer ) ; String number = buffer . toString ( ) . trim ( ) ; number = number . replace ( ',' , '.' ) ; int i = number . indexOf...
public class DABuilder { /** * Return chunk index of the first chunk on this node . Used to identify the trees built here . */ private long getChunkId ( final Frame fr ) { } }
Key [ ] keys = new Key [ fr . anyVec ( ) . nChunks ( ) ] ; for ( int i = 0 ; i < fr . anyVec ( ) . nChunks ( ) ; ++ i ) { keys [ i ] = fr . anyVec ( ) . chunkKey ( i ) ; } for ( int i = 0 ; i < keys . length ; ++ i ) { if ( keys [ i ] . home ( ) ) return i ; } return - 99999 ; // throw new Error ( " No key on this node...
public class WSConfigurationHelperImpl { /** * ( non - Javadoc ) * @ see com . ibm . websphere . config . WSConfigurationHelper # getMetaTypeAttributeName ( java . lang . String , java . lang . String ) */ @ Override public String getMetaTypeAttributeName ( String pid , String attributeID ) { } }
return metatypeRegistry . getAttributeName ( pid , attributeID ) ;
public class WiresShape { /** * If the shape ' s path parts / points have been updated programmatically ( not via human events interactions ) , * you can call this method to update the children layouts , controls and magnets . * The WiresResizeEvent event is not fired as this method is supposed to be called by the ...
final WiresShapeControlHandleList list = _loadControls ( IControlHandle . ControlHandleStandardType . RESIZE ) ; if ( null != list ) { list . refresh ( ) ; }
public class ExposeLinearLayoutManagerEx { /** * Recycles children between given indices . * @ param startIndex inclusive * @ param endIndex exclusive */ protected void recycleChildren ( RecyclerView . Recycler recycler , int startIndex , int endIndex ) { } }
if ( startIndex == endIndex ) { return ; } if ( DEBUG ) { Log . d ( TAG , "Recycling " + Math . abs ( startIndex - endIndex ) + " items" ) ; } if ( endIndex > startIndex ) { for ( int i = endIndex - 1 ; i >= startIndex ; i -- ) { removeAndRecycleViewAt ( i , recycler ) ; } } else { for ( int i = startIndex ; i > endInd...
public class TagLinkToken { /** * score return the a strng distance value between 0 and 1 of a pair * of tokens . Where 1 is the maximum similarity . * @ param S StringWrapper * @ param T StringWrapper * @ return double */ public double score ( StringWrapper s , StringWrapper t ) { } }
String S = s . unwrap ( ) , T = t . unwrap ( ) ; totalScore = 0.0 ; if ( S . equals ( T ) ) { matched = S . length ( ) ; return 1.0 ; } else { sSize = S . length ( ) ; tSize = T . length ( ) ; // let S be the largest token if ( sSize < tSize ) { String tmp1 = S ; S = T ; T = tmp1 ; double tmp2 = sSize ; sSize = tSize ;...
public class ProtobufIDLProxy { /** * Find relate proto files . * @ param file the file * @ param dependencyNames the dependency names * @ return the list * @ throws IOException Signals that an I / O exception has occurred . */ private static List < ProtoFile > findRelateProtoFiles ( File file , Set < String > ...
LinkedList < ProtoFile > protoFiles = new LinkedList < ProtoFile > ( ) ; ProtoFile protoFile = ProtoParser . parseUtf8 ( file ) ; protoFiles . addFirst ( protoFile ) ; String parent = file . getParent ( ) ; // parse dependency , to find all PROTO file if using import command List < String > dependencies = protoFile . d...
public class Headers { /** * Returns the header associated with an ID * @ param id The ID * @ return */ public static < T extends Header > T getHeader ( final Header [ ] hdrs , short id ) { } }
if ( hdrs == null ) return null ; for ( Header hdr : hdrs ) { if ( hdr == null ) return null ; if ( hdr . getProtId ( ) == id ) return ( T ) hdr ; } return null ;
public class ProfileWriterImpl { /** * { @ inheritDoc } */ public Content getPackageSummaryTree ( Content packageSummaryContentTree ) { } }
HtmlTree ul = HtmlTree . UL ( HtmlStyle . blockList , packageSummaryContentTree ) ; return ul ;
public class RedmineManager { /** * Delete Issue Relation with the given ID . */ public void deleteRelation ( Integer id ) throws RedmineException { } }
transport . deleteObject ( IssueRelation . class , Integer . toString ( id ) ) ;
public class MapDotApi { /** * Get object value by path . * @ param map subject * @ param pathString nodes to walk in map * @ return value */ public static Optional < Object > dotGet ( final Map map , final String pathString ) { } }
return dotGet ( map , Object . class , pathString ) ;
public class DomainCommandBuilder { /** * Creates a command builder for a domain instance of WildFly . * @ param wildflyHome the path to the WildFly home directory * @ param javaHome the path to the default Java home directory * @ return a new builder */ public static DomainCommandBuilder of ( final String wildfl...
return new DomainCommandBuilder ( Environment . validateWildFlyDir ( wildflyHome ) , Jvm . of ( javaHome ) ) ;
public class HFactory { /** * Creates a column with a user - specified clock . You probably want to pass in * { @ link me . prettyprint . hector . api . Keyspace # createClock ( ) } for the value . */ public static < N , V > HColumn < N , V > createColumn ( N name , V value , long clock , Serializer < N > nameSeriali...
return new HColumnImpl < N , V > ( name , value , clock , nameSerializer , valueSerializer ) ;
public class Jar { /** * / / / / / Utils / / / / / */ private static JarInputStream newJarInputStream ( InputStream in ) throws IOException { } }
return new co . paralleluniverse . common . JarInputStream ( in ) ;
public class MobicentsSipServletsEmbeddedImpl { /** * / * ( non - Javadoc ) * @ see org . jboss . arquillian . container . mobicents . servlet . sip . embedded _ 1 . MobicentsSipServletsEmbedded # createEngine ( ) */ @ Override public Engine createEngine ( ) { } }
if ( log . isDebugEnabled ( ) ) log . debug ( "Creating engine" ) ; StandardEngine engine = new StandardEngine ( ) ; // Default host will be set to the first host added engine . setRealm ( realm ) ; // Inherited by all children return ( engine ) ;
public class RequestHttpBase { /** * Matches case insensitively , with the second normalized to lower case . */ private boolean match ( char [ ] a , int aOff , int aLength , char [ ] b ) { } }
int bLength = b . length ; if ( aLength != bLength ) return false ; for ( int i = aLength - 1 ; i >= 0 ; i -- ) { char chA = a [ aOff + i ] ; char chB = b [ i ] ; if ( chA != chB && chA + 'a' - 'A' != chB ) { return false ; } } return true ;
public class BroadleafPayPalCheckoutController { @ RequestMapping ( value = "/hosted/create-payment" , method = RequestMethod . POST ) public String createPaymentHostedJson ( HttpServletRequest request , @ RequestParam ( "performCheckout" ) Boolean performCheckout ) throws PaymentException { } }
Payment createdPayment = paymentService . createPayPalPaymentForCurrentOrder ( performCheckout ) ; String redirect = getApprovalLink ( createdPayment ) ; if ( isAjaxRequest ( request ) ) { return "ajaxredirect:" + redirect ; } return "redirect:" + redirect ;
public class AbstractSearchStructure { /** * Updates the index with the given vector . This is a synchronized method , i . e . when a thread calls this * method , all other threads wait for the first thread to complete before executing the method . This * ensures that the persistent BDB store will remain consistent...
long startIndexing = System . currentTimeMillis ( ) ; // check if we can index more vectors if ( loadCounter >= maxNumVectors ) { System . out . println ( "Maximum index capacity reached, no more vectors can be indexed!" ) ; return false ; } // check if name is already indexed if ( isIndexed ( id ) ) { System . out . p...
public class MigrationTool { /** * Method for profiles migration . * @ throws Exception */ private void migrateProfiles ( ) throws Exception { } }
Session session = service . getStorageSession ( ) ; try { if ( session . itemExists ( usersStorageOld ) ) { NodeIterator iterator = ( ( ExtendedNode ) session . getItem ( usersStorageOld ) ) . getNodesLazily ( ) ; UserProfileHandlerImpl uph = ( ( UserProfileHandlerImpl ) service . getUserProfileHandler ( ) ) ; while ( ...
public class S3DestinationUpdateMarshaller { /** * Marshall the given parameter object . */ public void marshall ( S3DestinationUpdate s3DestinationUpdate , ProtocolMarshaller protocolMarshaller ) { } }
if ( s3DestinationUpdate == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( s3DestinationUpdate . getRoleARN ( ) , ROLEARN_BINDING ) ; protocolMarshaller . marshall ( s3DestinationUpdate . getBucketARN ( ) , BUCKETARN_BINDING ) ; protocolMar...
public class ExamplesImpl { /** * Adds a labeled example to the application . * @ param appId The application ID . * @ param versionId The version ID . * @ param exampleLabelObject An example label with the expected intent and entities . * @ param serviceCallback the async ServiceCallback to handle successful a...
return ServiceFuture . fromResponse ( addWithServiceResponseAsync ( appId , versionId , exampleLabelObject ) , serviceCallback ) ;
public class HtmlBuilder { /** * Build a HTML Table with given CSS class for a string . * Given content does < b > not < / b > consists of HTML snippets and * as such is being prepared with { @ link HtmlBuilder # htmlEncode ( String ) } . * @ param clazz class for table element * @ param content content string ...
return tagClass ( Html . Tag . TABLE , clazz , content ) ;
public class ModelAdapter { /** * Translates received message statuses through message query to chat SDK model . * @ param conversationId Conversation unique id . * @ param messageId Message unique id . * @ param statuses Foundation statuses . * @ return */ public List < ChatMessageStatus > adaptStatuses ( Stri...
List < ChatMessageStatus > adapted = new ArrayList < > ( ) ; for ( String key : statuses . keySet ( ) ) { MessageReceived . Status status = statuses . get ( key ) ; adapted . add ( ChatMessageStatus . builder ( ) . populate ( conversationId , messageId , key , status . getStatus ( ) . compareTo ( MessageStatus . delive...
public class DescribeUserHierarchyGroupRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeUserHierarchyGroupRequest describeUserHierarchyGroupRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeUserHierarchyGroupRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeUserHierarchyGroupRequest . getHierarchyGroupId ( ) , HIERARCHYGROUPID_BINDING ) ; protocolMarshaller . marshall ( describeUserHierarchyGroupRe...
public class Streams { /** * Concat an Object and a Stream * If the Object is a Stream , Streamable or Iterable will be converted ( or left ) in Stream form and concatonated * Otherwise a new Stream . of ( o ) is created * @ param o Object to concat * @ param stream Stream to concat * @ return Concatonated St...
Stream < U > first = null ; if ( o instanceof Stream ) { first = ( Stream ) o ; } else if ( o instanceof Iterable ) { first = stream ( ( Iterable ) o ) ; } else if ( o instanceof Streamable ) { first = ( ( Streamable ) o ) . stream ( ) ; } else { first = Stream . of ( ( U ) o ) ; } return Stream . concat ( first , stre...
public class ServicesApi { /** * Updates the ExternalWikiService service settings for a project . * < pre > < code > GitLab Endpoint : PUT / projects / : id / services / external - wiki < / code > < / pre > * The following properties on the JiraService instance are utilized in the update of the settings : * exter...
GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "external_wiki_url" , externalWiki . getExternalWikiUrl ( ) ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "external-wiki" ) ; return ( response . readEntity ( E...
public class NonplanarBonds { /** * Checks if the atom can be involved in a double - bond . * @ param idx atom idx * @ return the atom at index ( idx ) is valid for a double bond * @ see < a href = " http : / / www . inchi - trust . org / download / 104 / InChI _ TechMan . pdf " > Double bond stereochemistry , In...
IAtom atom = container . getAtom ( idx ) ; // error : uninit atom if ( atom . getAtomicNumber ( ) == null || atom . getFormalCharge ( ) == null || atom . getImplicitHydrogenCount ( ) == null ) return false ; final int chg = atom . getFormalCharge ( ) ; final int btypes = getBondTypes ( idx ) ; switch ( atom . getAtomic...
public class GuardRail { /** * Release acquired permits with known result . Since there is a known result the result * count object and latency will be updated . * @ param number of permits to release * @ param result of the execution * @ param startNanos of the execution * @ param nanoTime currentInterval na...
resultCounts . write ( result , number , nanoTime ) ; resultLatency . write ( result , number , nanoTime - startNanos , nanoTime ) ; for ( BackPressure < Rejected > backPressure : backPressureList ) { backPressure . releasePermit ( number , result , nanoTime ) ; }
public class ResourceFactory { /** * 创建ResourceFactory子节点 * @ return ResourceFactory */ public ResourceFactory createChild ( ) { } }
ResourceFactory child = new ResourceFactory ( this ) ; this . chidren . add ( new WeakReference < > ( child ) ) ; return child ;
public class ClientConfig { /** * Sets the value of a named property . * @ param name property name * @ param value value of the property * @ return configured { @ link com . hazelcast . client . config . ClientConfig } for chaining */ public ClientConfig setProperty ( String name , String value ) { } }
properties . put ( name , value ) ; return this ;
public class date { /** * Converts a month by number to full text * @ param month number of the month 1 . . 12 * @ param useShort boolean that gives " Jun " instead of " June " if true * @ return returns " January " if " 1 " is given */ public static String convertMonth ( int month , boolean useShort ) { } }
String monthStr ; switch ( month ) { default : monthStr = "January" ; break ; case Calendar . FEBRUARY : monthStr = "February" ; break ; case Calendar . MARCH : monthStr = "March" ; break ; case Calendar . APRIL : monthStr = "April" ; break ; case Calendar . MAY : monthStr = "May" ; break ; case Calendar . JUNE : month...
public class SingleMapperCondition { /** * { @ inheritDoc } */ @ Override @ SuppressWarnings ( "unchecked" ) public final Query doQuery ( Schema schema ) { } }
Mapper mapper = schema . mapper ( field ) ; if ( mapper == null ) { throw new IndexException ( "No mapper found for field '{}'" , field ) ; } else if ( ! type . isAssignableFrom ( mapper . getClass ( ) ) ) { throw new IndexException ( "Field '{}' requires a mapper of type '{}' but found '{}'" , field , type , mapper ) ...
public class ListAsArray { /** * / * - - - @ Override * public void add ( int index , Object element ) { * list . add ( index , element ) ; * @ Override * public boolean addAll ( java . util . Collection c ) { * return list . addAll ( c ) ; */ @ Override public boolean addAll ( int index , java . util . Colle...
return list . addAll ( index , c ) ;
public class FileMonitor { /** * Notify observers that the file has changed * @ param file * the file that changes */ protected synchronized void notifyChange ( File file ) { } }
System . out . println ( "Notify change file=" + file . getAbsolutePath ( ) ) ; this . notify ( FileEvent . createChangedEvent ( file ) ) ;
public class CmsPathTree { /** * Gets the child values for the given path . < p > * @ param path the path * @ return the child values */ public List < V > getChildValues ( List < P > path ) { } }
CmsPathTree < P , V > descendant = findNode ( path ) ; if ( descendant != null ) { return descendant . getChildValues ( ) ; } else { return Collections . emptyList ( ) ; }
public class JavascriptEngine { /** * Evaluates the JS passed in parameter * @ param scriptName * the script name * @ param source * the JS script * @ param bindings * the bindings to use * @ return the result */ public Object evaluateString ( String scriptName , String source , Bindings bindings ) { } }
try { scriptEngine . put ( ScriptEngine . FILENAME , scriptName ) ; return scriptEngine . eval ( source , bindings ) ; } catch ( ScriptException e ) { throw new BundlingProcessException ( "Error while evaluating script : " + scriptName , e ) ; }
public class JdbcTable { /** * Read the record that matches this record ' s current key . * @ param strSeekSign The seek sign ( defaults to ' = ' ) . * @ return true if successful . * @ exception DBException File exception . */ public boolean doSeek ( String strSeekSign ) throws DBException { } }
Vector < BaseField > vParamList = new Vector < BaseField > ( ) ; try { if ( this . lockOnDBTrxType ( null , DBConstants . SELECT_TYPE , false ) ) // SELECT = seek for now ; Should I do the unlock in my code ? this . unlockIfLocked ( this . getRecord ( ) , null ) ; // Release any locks // Submit a query , creating a Res...
public class Ipv6 { /** * Parses a < tt > String < / tt > into an { @ link Ipv6 } address . * @ param ipv6Address a text representation of an IPv6 address as defined in rfc4291 * @ return a new { @ link Ipv6} * @ throws NullPointerException if the string argument is < tt > null < / tt > * @ throws IllegalArgume...
try { String ipv6String = Validate . notNull ( ipv6Address ) . trim ( ) ; Validate . isTrue ( ! ipv6String . isEmpty ( ) ) ; final boolean isIpv6AddressWithEmbeddedIpv4 = ipv6String . contains ( "." ) ; if ( isIpv6AddressWithEmbeddedIpv4 ) { ipv6String = getIpv6AddressWithIpv4SectionInIpv6Notation ( ipv6String ) ; } fi...
public class ProfilerTimerFilter { /** * Create the profilers for a list of { @ link IoEventType } . * @ param eventTypes the list of { @ link IoEventType } to profile */ private void setProfilers ( IoEventType ... eventTypes ) { } }
for ( IoEventType type : eventTypes ) { switch ( type ) { case MESSAGE_RECEIVED : messageReceivedTimerWorker = new TimerWorker ( ) ; profileMessageReceived = true ; break ; case MESSAGE_SENT : messageSentTimerWorker = new TimerWorker ( ) ; profileMessageSent = true ; break ; case SESSION_CREATED : sessionCreatedTimerWo...
public class CPDefinitionOptionRelUtil { /** * Returns all the cp definition option rels where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ return the matching cp definition option rels */ public static List < CPDefinitionOptionRel > findByUuid_C ( Stri...
return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ;
public class RingPartitioner { /** * Perform a walk in the given RingSet , starting at a given Ring and * recursively searching for other Rings connected to this ring . By doing * this it finds all rings in the RingSet connected to the start ring , * putting them in newRs , and removing them from rs . * @ param...
IRing tempRing ; IRingSet tempRings = rs . getConnectedRings ( ring ) ; // logger . debug ( " walkRingSystem - > tempRings . size ( ) : " + tempRings . size ( ) ) ; rs . removeAtomContainer ( ring ) ; for ( IAtomContainer container : tempRings . atomContainers ( ) ) { tempRing = ( IRing ) container ; if ( ! newRs . con...
public class VirtualBankAccount { public static CreateUsingPermanentTokenRequest createUsingPermanentToken ( ) throws IOException { } }
String uri = uri ( "virtual_bank_accounts" , "create_using_permanent_token" ) ; return new CreateUsingPermanentTokenRequest ( Method . POST , uri ) ;
public class CommerceVirtualOrderItemUtil { /** * Returns the commerce virtual order item where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param uuid the uuid * @ param groupId the group ID * @ param retrieveFromCac...
return getPersistence ( ) . fetchByUUID_G ( uuid , groupId , retrieveFromCache ) ;
public class RxReactiveStreams { /** * Converts a Publisher into a Single which emits onSuccess if the * Publisher signals an onNext + onComplete ; or onError if the publisher signals an * onError , the source Publisher is empty ( NoSuchElementException ) or the * source Publisher signals more than one onNext ( I...
if ( publisher == null ) { throw new NullPointerException ( "publisher" ) ; } return Single . create ( new PublisherAsSingle < T > ( publisher ) ) ;
public class VfsStringReader { /** * Creates a new ReadStream reading bytes from the given string . * @ param string the source string . * @ return a ReadStream reading from the string . */ public static ReadStreamOld open ( String string ) { } }
VfsStringReader ss = new VfsStringReader ( string ) ; ReadStreamOld rs = new ReadStreamOld ( ss ) ; try { rs . setEncoding ( "UTF-8" ) ; } catch ( Exception e ) { } // rs . setPath ( new NullPath ( " string " ) ) ; return rs ;
public class MusixMatch { /** * Get Snippet for the specified trackID . * @ param trackID * @ return * @ throws MusixMatchException */ public Snippet getSnippet ( int trackID ) throws MusixMatchException { } }
Snippet snippet = null ; SnippetGetMessage message = null ; Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( Constants . API_KEY , apiKey ) ; params . put ( Constants . TRACK_ID , new String ( "" + trackID ) ) ; String response = null ; response = MusixMatchRequest . sendRequest ( H...
public class MappedDeleteCollection { /** * This is private because the execute is the only method that should be called here . */ private static < T , ID > MappedDeleteCollection < T , ID > build ( Dao < T , ID > dao , TableInfo < T , ID > tableInfo , int dataSize ) throws SQLException { } }
FieldType idField = tableInfo . getIdField ( ) ; if ( idField == null ) { throw new SQLException ( "Cannot delete " + tableInfo . getDataClass ( ) + " because it doesn't have an id field defined" ) ; } StringBuilder sb = new StringBuilder ( 128 ) ; DatabaseType databaseType = dao . getConnectionSource ( ) . getDatabase...
public class ErrorMessageFormater { /** * build a html list out of given message set . * @ param messages set of message strings * @ return safe html with massages as list */ public static SafeHtml messagesToList ( final Set < String > messages ) { } }
final SafeHtmlBuilder sbList = new SafeHtmlBuilder ( ) ; sbList . appendHtmlConstant ( "<ul>" ) ; for ( final String message : messages ) { sbList . appendHtmlConstant ( "<li>" ) ; sbList . appendEscaped ( message ) ; sbList . appendHtmlConstant ( "</li>" ) ; } sbList . appendHtmlConstant ( "</ul>" ) ; return sbList . ...
public class AdminGroupAction { private HtmlResponse asListHtml ( ) { } }
return asHtml ( path_AdminGroup_AdminGroupJsp ) . renderWith ( data -> { RenderDataUtil . register ( data , "groupItems" , groupService . getGroupList ( groupPager ) ) ; // page navi } ) . useForm ( SearchForm . class , setup -> { setup . setup ( form -> { copyBeanToBean ( groupPager , form , op -> op . include ( "id" ...
public class AutoCloseableIterator { /** * Returns an { @ link AutoCloseableIterator } that iterates over all the provided input iterators . * If an { @ link Exception } is thrown while closing an iterator , the other iterators are closed and the first * { @ link Exception } ( only ) is rethrown . * @ see com . g...
return concat ( ImmutableList . copyOf ( inputs ) ) ;
public class StreamSourceInputStream { /** * Close the stream . */ @ Override public void close ( ) { } }
InputStream is = _is ; _is = null ; IoUtil . close ( is ) ;
public class PersonGroupPersonsImpl { /** * Create a new person in a specified person group . * @ param personGroupId Id referencing a particular person group . * @ param createOptionalParameter the object representing the optional parameters to be set before calling this API * @ throws IllegalArgumentException t...
if ( this . client . azureRegion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.azureRegion() is required and cannot be null." ) ; } if ( personGroupId == null ) { throw new IllegalArgumentException ( "Parameter personGroupId is required and cannot be null." ) ; } final String name = create...
public class CitationType { /** * Gets the value of the id property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < / CODE > method f...
if ( id == null ) { id = new ArrayList < CitationType . ID > ( ) ; } return this . id ;
public class App { /** * Checks if a subject is allowed to call method X on resource Y . * @ param subjectid subject id * @ param resourcePath resource path or object type * @ param httpMethod HTTP method name * @ return true if allowed */ public boolean isAllowedTo ( String subjectid , String resourcePath , St...
boolean allow = false ; if ( subjectid != null && ! StringUtils . isBlank ( resourcePath ) && ! StringUtils . isBlank ( httpMethod ) ) { // urlDecode resource path resourcePath = Utils . urlDecode ( resourcePath ) ; if ( getResourcePermissions ( ) . isEmpty ( ) ) { // Default policy is " deny all " . Returning true her...
public class PrimaveraReader { /** * Process hours in a working day . * @ param calendar project calendar * @ param dayRecord working day data */ private void processCalendarHours ( ProjectCalendar calendar , Record dayRecord ) { } }
// . . . for each day of the week Day day = Day . getInstance ( Integer . parseInt ( dayRecord . getField ( ) ) ) ; // Get hours List < Record > recHours = dayRecord . getChildren ( ) ; if ( recHours . size ( ) == 0 ) { // No data - > not working calendar . setWorkingDay ( day , false ) ; } else { calendar . setWorking...
public class JMXContext { /** * Initialize this context instance . The following configuration parameters * are supported : * < dl > * < dt > EdenSpace < / dt > * < dd > The name of the eden space memory pool < / dd > * < dt > SurvivorSpace < / dt > * < dd > The name of the survivor space memory pool < / dd...
this . config = config ; PropertyMap properties = config . getProperties ( ) ; String edenSpace = properties . getString ( "EdenSpace" ) ; if ( edenSpace != null ) { this . setEdenMemoryPool ( edenSpace ) ; } String survivorSpace = properties . getString ( "SurvivorSpace" ) ; if ( survivorSpace != null ) { this . setSu...
public class StreamResource { /** * Intercepts and returns the entire contents the stream represented by * this StreamResource . * @ return * A response through which the entire contents of the intercepted * stream will be sent . */ @ GET public Response getStreamContents ( ) { } }
// Intercept all output StreamingOutput stream = new StreamingOutput ( ) { @ Override public void write ( OutputStream output ) throws IOException { try { tunnel . interceptStream ( streamIndex , output ) ; } catch ( GuacamoleException e ) { throw new IOException ( e ) ; } } } ; // Begin successful response ResponseBui...
public class SoftDictionary { /** * Lookup a prepared string in the dictionary . * < p > If id is non - null , then consider only strings with different ids ( or null ids ) . */ public Object lookup ( String id , StringWrapper toFind ) { } }
doLookup ( id , toFind ) ; return closestMatch ;
public class ExemptionMechanism { /** * Returns an < code > ExemptionMechanism < / code > object that implements the * specified exemption mechanism algorithm . * < p > A new ExemptionMechanism object encapsulating the * ExemptionMechanismSpi implementation from the specified provider * is returned . The specif...
Instance instance = JceSecurity . getInstance ( "ExemptionMechanism" , ExemptionMechanismSpi . class , algorithm , provider ) ; return new ExemptionMechanism ( ( ExemptionMechanismSpi ) instance . impl , instance . provider , algorithm ) ;
public class InternalXtextParser { /** * InternalXtext . g : 801:1 : ruleRuleNameAndParams [ EObject in _ current ] returns [ EObject current = in _ current ] : ( ( ( lv _ name _ 0_0 = ruleValidID ) ) ( otherlv _ 1 = ' < ' ( ( ( lv _ parameters _ 2_0 = ruleParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ parameters _ 4_0 =...
EObject current = in_current ; Token otherlv_1 = null ; Token otherlv_3 = null ; Token otherlv_5 = null ; AntlrDatatypeRuleToken lv_name_0_0 = null ; EObject lv_parameters_2_0 = null ; EObject lv_parameters_4_0 = null ; enterRule ( ) ; try { // InternalXtext . g : 807:2 : ( ( ( ( lv _ name _ 0_0 = ruleValidID ) ) ( oth...
public class BytesImpl { /** * adds bytes from the buffer */ @ Override public BytesImpl set ( int pos , byte [ ] buffer , int offset , int length ) { } }
System . arraycopy ( buffer , offset , _data , pos , length ) ; return this ;
public class HtmlDocletWriter { /** * Get link for generated class index . * @ return a content tree for the link */ protected Content getNavLinkIndex ( ) { } }
Content linkContent = getHyperLink ( pathToRoot . resolve ( ( configuration . splitindex ? DocPaths . INDEX_FILES . resolve ( DocPaths . indexN ( 1 ) ) : DocPaths . INDEX_ALL ) ) , indexLabel , "" , "" ) ; Content li = HtmlTree . LI ( linkContent ) ; return li ;
public class DefaultGroovyMethods { /** * Method for overloading the behavior of the ' case ' method in switch statements . * The default implementation handles arrays types but otherwise simply delegates * to Object # equals , but this may be overridden for other types . In this example : * < pre > switch ( a ) ...
if ( caseValue . getClass ( ) . isArray ( ) ) { return isCase ( DefaultTypeTransformation . asCollection ( caseValue ) , switchValue ) ; } return caseValue . equals ( switchValue ) ;
public class CmsRequestContext { /** * Removes the current site root prefix from the absolute path in the resource name , * that is adjusts the resource name for the current site root . < p > * If the resource name does not start with the current site root , * it is left untouched . < p > * @ param resourcename...
String siteRoot = getAdjustedSiteRoot ( m_siteRoot , resourcename ) ; if ( ( siteRoot == m_siteRoot ) && resourcename . startsWith ( siteRoot ) && ( ( resourcename . length ( ) == siteRoot . length ( ) ) || ( resourcename . charAt ( siteRoot . length ( ) ) == '/' ) ) ) { resourcename = resourcename . substring ( siteRo...
public class DistributedLock { /** * 释放锁对象 */ public void unlock ( ) throws KeeperException { } }
if ( id != null ) { zookeeper . delete ( root + "/" + id ) ; id = null ; idName = null ; } else { // do nothing }
public class UIViewRoot { /** * < div class = " changed _ added _ 2_0 " > * < p > Perform partial processing by calling * { @ link javax . faces . context . PartialViewContext # processPartial } with * { @ link PhaseId # APPLY _ REQUEST _ VALUES } if : * < ul > * < li > { @ link javax . faces . context . Part...
initState ( ) ; notifyBefore ( context , PhaseId . APPLY_REQUEST_VALUES ) ; try { if ( ! skipPhase ) { if ( context . getPartialViewContext ( ) . isPartialRequest ( ) && ! context . getPartialViewContext ( ) . isExecuteAll ( ) ) { context . getPartialViewContext ( ) . processPartial ( PhaseId . APPLY_REQUEST_VALUES ) ;...
public class GraphQL { /** * Executes the graphql query using calling the builder function and giving it a new builder . * This allows a lambda style like : * < pre > * { @ code * ExecutionResult result = graphql . execute ( input - > input . query ( " { hello } " ) . root ( startingObj ) . context ( contextObj...
return execute ( builderFunction . apply ( ExecutionInput . newExecutionInput ( ) ) . build ( ) ) ;
public class Trie { /** * Internal trie getter from a code point . * Could be faster ( ? ) but longer with * if ( ( c32 ) < = 0xd7ff ) { ( result ) = _ TRIE _ GET _ RAW ( trie , data , 0 , c32 ) ; } * Gets the offset to data which the codepoint points to * @ param ch codepoint * @ return offset to data */ pro...
// if ( ( ch > > 16 ) = = 0 ) slower if ( ch < 0 ) { return - 1 ; } else if ( ch < UTF16 . LEAD_SURROGATE_MIN_VALUE ) { // fastpath for the part of the BMP below surrogates ( D800 ) where getRawOffset ( ) works return getRawOffset ( 0 , ( char ) ch ) ; } else if ( ch < UTF16 . SUPPLEMENTARY_MIN_VALUE ) { // BMP codepoi...
public class AbstractPostProcessorChainFactory { /** * Returns the custom processor wrapper * @ param customProcessor * the custom processor * @ param key * the id of the custom processor * @ param isVariantPostProcessor * the flag indicating if it ' s a variant postprocessor * @ return the custom process...
return new CustomPostProcessorChainWrapper ( key , customProcessor , isVariantPostProcessor ) ;
public class DevAppServerRunner { /** * Uses the process runner to execute the classic Java SDK devappsever command . * @ param jvmArgs the arguments to pass to the Java Virtual machine that launches the devappserver * @ param args the arguments to pass to devappserver * @ param environment the environment to set...
sdk . validateAppEngineJavaComponents ( ) ; sdk . validateJdk ( ) ; List < String > command = new ArrayList < > ( ) ; command . add ( sdk . getJavaExecutablePath ( ) . toAbsolutePath ( ) . toString ( ) ) ; command . addAll ( jvmArgs ) ; command . add ( "-Dappengine.sdk.root=" + sdk . getAppEngineSdkForJavaPath ( ) . ge...
public class LookupEventsRequest { /** * Contains a list of lookup attributes . Currently the list can contain only one item . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setLookupAttributes ( java . util . Collection ) } or { @ link # withLookupAttribute...
if ( this . lookupAttributes == null ) { setLookupAttributes ( new com . amazonaws . internal . SdkInternalList < LookupAttribute > ( lookupAttributes . length ) ) ; } for ( LookupAttribute ele : lookupAttributes ) { this . lookupAttributes . add ( ele ) ; } return this ;
public class LightBeanBuilder { @ Override public BeanBuilder < B > set ( String propertyName , Object value ) { } }
return set ( metaBean . metaProperty ( propertyName ) , value ) ;
public class Stylesheet { /** * Replace an " xsl : template " property . * This is a hook for CompilingStylesheetHandler , to allow * us to access a template , compile it , instantiate it , * and replace the original with the compiled instance . * ADDED 9/5/2000 to support compilation experiment * @ param v C...
if ( null == m_templates ) throw new ArrayIndexOutOfBoundsException ( ) ; replaceChild ( v , ( ElemTemplateElement ) m_templates . elementAt ( i ) ) ; m_templates . setElementAt ( v , i ) ; v . setStylesheet ( this ) ;
public class VisOdomPixelDepthPnP { /** * Estimates the motion given the left camera image . The latest information required by ImagePixelTo3D * should be passed to the class before invoking this function . * @ param image Camera image . * @ return true if successful or false if it failed */ public boolean proces...
tracker . process ( image ) ; tick ++ ; inlierTracks . clear ( ) ; if ( first ) { addNewTracks ( ) ; first = false ; } else { if ( ! estimateMotion ( ) ) { return false ; } dropUnusedTracks ( ) ; int N = motionEstimator . getMatchSet ( ) . size ( ) ; if ( thresholdAdd <= 0 || N < thresholdAdd ) { changePoseToReference ...
public class JDBCPersistenceManagerImpl { /** * Creates the default schema JBATCH or the schema defined in batch - config . * @ throws SQLException */ private void createSchema ( ) throws SQLException { } }
logger . entering ( CLASSNAME , "createSchema" ) ; Connection conn = getConnectionToDefaultSchema ( ) ; logger . log ( Level . INFO , schema + " schema does not exists. Trying to create it." ) ; PreparedStatement ps = null ; ps = conn . prepareStatement ( "CREATE SCHEMA " + schema ) ; ps . execute ( ) ; cleanupConnecti...
public class EmojiUtility { /** * 对spanableString进行正则判断 , 如果符合要求 , 则以表情图片代替 * @ param context context * @ param spannableString htmlstring * @ param patten patten * @ param start start index * @ param adjustEmoji 是否缩放表情图 * @ throws SecurityException * @ throws NoSuchFieldException * @ throws NumberForma...
Matcher matcher = patten . matcher ( spannableString ) ; while ( matcher . find ( ) ) { String key = matcher . group ( ) ; if ( matcher . start ( ) < start ) { continue ; } // 通过上面匹配得到的字符串来生成图片资源id EmojiItem item = getEmojiItem ( key ) ; if ( null != item ) { // 计算该图片名字的长度 , 也就是要替换的字符串的长度 int end = matcher . start ( ) ...
public class DefaultMessageHeaderValidator { /** * Get header name from control message but also check if header expression is a variable or function . In addition to that find case insensitive header name in * received message when feature is activated . * @ param name * @ param receivedHeaders * @ param conte...
String headerName = context . resolveDynamicValue ( name ) ; if ( ! receivedHeaders . containsKey ( headerName ) && validationContext . isHeaderNameIgnoreCase ( ) ) { String key = headerName ; log . debug ( String . format ( "Finding case insensitive header for key '%s'" , key ) ) ; headerName = receivedHeaders . entry...
public class PDBFileParser { /** * Handler for REMARK lines */ private void pdb_REMARK_Handler ( String line ) { } }
if ( line == null || line . length ( ) < 11 ) return ; if ( line . startsWith ( "REMARK 800" ) ) { pdb_REMARK_800_Handler ( line ) ; } else if ( line . startsWith ( "REMARK 350" ) ) { if ( params . isParseBioAssembly ( ) ) { if ( bioAssemblyParser == null ) { bioAssemblyParser = new PDBBioAssemblyParser ( ) ; } bioAsse...
public class CmsDriverManager { /** * Returns all child groups of a group . < p > * @ param dbc the current database context * @ param group the group to get the child for * @ param includeSubChildren if set also returns all sub - child groups of the given group * @ return a list of all child < code > { @ link ...
if ( ! includeSubChildren ) { return getUserDriver ( dbc ) . readChildGroups ( dbc , group . getName ( ) ) ; } Set < CmsGroup > allChildren = new TreeSet < CmsGroup > ( ) ; // iterate all child groups Iterator < CmsGroup > it = getUserDriver ( dbc ) . readChildGroups ( dbc , group . getName ( ) ) . iterator ( ) ; while...
public class Base64 { /** * Return the 6 - bit value corresponding to a base64 encoded char . If the character is the base64 padding character , * ' = ' , - 1 is returned . * @ param c * The character to decode * @ return The decoded 6 - bit value , or - 1 for padding . */ private static int b64decode ( char c ...
int i = c ; if ( i >= 'A' && i <= 'Z' ) { return i - 'A' ; } if ( i >= 'a' && i <= 'z' ) { return i - 'a' + 26 ; } if ( i >= '0' && i <= '9' ) { return i - '0' + 52 ; } if ( i == '+' ) { return 62 ; } if ( i == '/' ) { return 63 ; } return - 1 ; // padding ' = '
public class Main { /** * Internal version of compile , allowing context to be provided . * Note that the context needs to have a file manager set up . * @ param argv the command line parameters * @ param context the context * @ return the result of the compilation */ public Result compile ( String [ ] argv , C...
if ( stdOut != null ) { context . put ( Log . outKey , stdOut ) ; } if ( stdErr != null ) { context . put ( Log . errKey , stdErr ) ; } log = Log . instance ( context ) ; if ( argv . length == 0 ) { OptionHelper h = new OptionHelper . GrumpyHelper ( log ) { @ Override public String getOwnName ( ) { return ownName ; } @...
public class AWSCognitoIdentityProviderClient { /** * Lists the clients that have been created for the specified user pool . * @ param listUserPoolClientsRequest * Represents the request to list the user pool clients . * @ return Result of the ListUserPoolClients operation returned by the service . * @ throws I...
request = beforeClientExecution ( request ) ; return executeListUserPoolClients ( request ) ;
public class SearchView { /** * Update the visibility of the voice button . There are actually two voice search modes , * either of which will activate the button . * @ param empty whether the search query text field is empty . If it is , then the other * criteria apply to make the voice button visible . */ priva...
int visibility = GONE ; if ( mVoiceButtonEnabled && ! isIconified ( ) && empty ) { visibility = VISIBLE ; mSubmitButton . setVisibility ( GONE ) ; } mVoiceButton . setVisibility ( visibility ) ;
public class FileUtil { /** * convert an array of FileStatus to an array of Path . * If stats if null , return path * @ param stats * an array of FileStatus objects * @ param path * default path to return in stats is null * @ return an array of paths corresponding to the input */ public static Path [ ] stat...
if ( stats == null ) return new Path [ ] { path } ; else return stat2Paths ( stats ) ;
public class Directory { /** * Returns the entry for the given name in this table or null if no such entry exists . */ @ Nullable public DirectoryEntry get ( Name name ) { } }
int index = bucketIndex ( name , table . length ) ; DirectoryEntry entry = table [ index ] ; while ( entry != null ) { if ( name . equals ( entry . name ( ) ) ) { return entry ; } entry = entry . next ; } return null ;
public class ReflectUtils { /** * Wywołuje określoną metodę obiektu przekazując do niej dostarczone parametry . * @ param target Obiekt , którego metoda ma zostać wywołana . * @ param method Nazwa metody do wywołania . * @ param args Tablica argumentów metody . * @ return Obiekt zwracany przez metodę . ...
Class < ? > [ ] types = new Class [ args . length ] ; for ( int index = args . length - 1 ; index >= 0 ; index -- ) { types [ index ] = args [ index ] . getClass ( ) ; } try { return target . getClass ( ) . getMethod ( method , types ) . invoke ( target , args ) ; } catch ( Throwable t ) { throw new MethodInvocationExc...
public class SchemaManager { /** * SCHEMA management */ void createPublicSchema ( ) { } }
HsqlName name = database . nameManager . newHsqlName ( null , SqlInvariants . PUBLIC_SCHEMA , SchemaObject . SCHEMA ) ; Schema schema = new Schema ( name , database . getGranteeManager ( ) . getDBARole ( ) ) ; defaultSchemaHsqlName = schema . name ; schemaMap . put ( schema . name . name , schema ) ;
public class LocationInventoryUrl { /** * Get Resource Url for GetLocationInventory * @ param locationCode The unique , user - defined code that identifies a location . * @ param productCode The unique , user - defined product code of a product , used throughout to reference and associate to a product . * @ param...
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/locationinventory/{locationCode}/{productCode}?responseFields={responseFields}" ) ; formatter . formatUrl ( "locationCode" , locationCode ) ; formatter . formatUrl ( "productCode" , productCode ) ; formatter . formatUrl ( "responseFields" , respon...
public class StreamSegmentReadIndex { /** * Reads a contiguous sequence of bytes of the given length starting at the given offset . Every byte in the range * must meet the following conditions : * < ul > * < li > It must exist in this segment . This excludes bytes from merged transactions and future reads . * <...
Exceptions . checkNotClosed ( this . closed , this ) ; Preconditions . checkState ( ! this . recoveryMode , "StreamSegmentReadIndex is in Recovery Mode." ) ; Preconditions . checkArgument ( length >= 0 , "length must be a non-negative number" ) ; Preconditions . checkArgument ( startOffset >= this . metadata . getStora...
public class JClassLoaderWrapper { /** * Loads the class . */ protected JClass loadClass ( String name ) { } }
try { Class cl ; if ( _loader != null ) cl = Class . forName ( name , false , _loader ) ; else cl = Class . forName ( name ) ; return new JClassWrapper ( cl , this ) ; } catch ( ClassNotFoundException e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; return null ; }
public class ScriptEngineResolver { /** * Allows checking whether the script engine can be cached . * @ param scriptEngine the script engine to check . * @ return true if the script engine may be cached . */ protected boolean isCachable ( ScriptEngine scriptEngine ) { } }
// Check if script - engine supports multithreading . If true it can be cached . Object threadingParameter = scriptEngine . getFactory ( ) . getParameter ( "THREADING" ) ; return threadingParameter != null ;
public class AWSSimpleSystemsManagementClient { /** * Lists the associations for the specified Systems Manager document or instance . * @ param listAssociationsRequest * @ return Result of the ListAssociations operation returned by the service . * @ throws InternalServerErrorException * An error occurred on the...
request = beforeClientExecution ( request ) ; return executeListAssociations ( request ) ;