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 authenticate after this ) * @ param webRequest */ public void optionallyAuthenticateUnprotectedResource ( WebRequest webRequest ) { } }
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 invalid: no begin marker" ) ; } finally { reader . close ( ) ; }
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 * getPassThruProps method . */ Connection getConnection ( ) { } }
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 observable to the PolicyEventsQueryResultsInner object */ public Observable < PolicyEventsQueryResultsInner > listQueryResultsForResourceGroupAsync ( String subscriptionId , String resourceGroupName ) { } }
return listQueryResultsForResourceGroupWithServiceResponseAsync ( subscriptionId , resourceGroupName ) . map ( new Func1 < ServiceResponse < PolicyEventsQueryResultsInner > , PolicyEventsQueryResultsInner > ( ) { @ Override public PolicyEventsQueryResultsInner call ( ServiceResponse < PolicyEventsQueryResultsInner > response ) { return response . body ( ) ; } } ) ;
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 . state ) ; return ; } this . state = ConnectionState . OPEN ; this . inputAvailable = true ; this . outputAvailable = true ; event = this . state ; } notifyStateListeners ( event ) ;
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 ( '.' ) ; if ( i > - 1 ) { number = number . substring ( 0 , i ) ; } if ( number . length ( ) == 0 ) { return 0 ; } long value = Long . parseLong ( number ) ; if ( unit != 1 ) { value *= unit ; } return value ;
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 developer . */ public void refresh ( ) { } }
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 > endIndex ; i -- ) { removeAndRecycleViewAt ( i , recycler ) ; } }
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 ; tSize = tmp2 ; tokenT = T ; } tokenT = S ; ArrayList candidateList = algorithm1 ( S , T ) ; sortList ( candidateList ) ; totalScore = getScore ( candidateList ) ; totalScore = ( totalScore / ( ( double ) sSize ) + totalScore / ( ( double ) tSize ) ) / 2.0 ; return winkler ( totalScore , S , T ) ; }
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 > dependencyNames ) throws IOException { } }
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 . dependencies ( ) ; if ( dependencies != null && ! dependencies . isEmpty ( ) ) { for ( String fn : dependencies ) { if ( dependencyNames . contains ( fn ) ) { continue ; } File dependencyFile = new File ( parent , fn ) ; protoFiles . addAll ( findRelateProtoFiles ( dependencyFile , dependencyNames ) ) ; } } List < String > publicDependencies = protoFile . publicDependencies ( ) ; if ( publicDependencies != null && ! publicDependencies . isEmpty ( ) ) { for ( String fn : publicDependencies ) { if ( dependencyNames . contains ( fn ) ) { continue ; } File dependencyFile = new File ( parent , fn ) ; protoFiles . addAll ( findRelateProtoFiles ( dependencyFile , dependencyNames ) ) ; } } return protoFiles ;
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 wildflyHome , final String javaHome ) { } }
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 > nameSerializer , Serializer < V > valueSerializer ) { } }
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 when multiple threads call the indexVector * method . * @ param id * The id of the vector * @ param vector * The vector * @ return True if the vector is successfully indexed , false otherwise . * @ throws Exception */ public synchronized boolean indexVector ( String id , double [ ] vector ) throws Exception { } }
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 . println ( "Vector '" + id + "' already indexed!" ) ; return false ; } // do the indexing // persist id to name and the reverse mapping long startMapping = System . currentTimeMillis ( ) ; createMapping ( id ) ; totalIdMappingTime += System . currentTimeMillis ( ) - startMapping ; // method specific indexing long startInternalIndexing = System . currentTimeMillis ( ) ; indexVectorInternal ( vector ) ; totalInternalVectorIndexingTime += System . currentTimeMillis ( ) - startInternalIndexing ; loadCounter ++ ; // increase the loadCounter if ( loadCounter % 100 == 0 ) { // debug message System . out . println ( new Date ( ) + " # indexed vectors: " + loadCounter ) ; } totalVectorIndexingTime += System . currentTimeMillis ( ) - startIndexing ; return true ;
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 ( iterator . hasNext ( ) ) { Node oldUserNode = iterator . nextNode ( ) ; uph . migrateProfile ( oldUserNode ) ; } } } finally { session . logout ( ) ; }
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 ) ; protocolMarshaller . marshall ( s3DestinationUpdate . getPrefix ( ) , PREFIX_BINDING ) ; protocolMarshaller . marshall ( s3DestinationUpdate . getErrorOutputPrefix ( ) , ERROROUTPUTPREFIX_BINDING ) ; protocolMarshaller . marshall ( s3DestinationUpdate . getBufferingHints ( ) , BUFFERINGHINTS_BINDING ) ; protocolMarshaller . marshall ( s3DestinationUpdate . getCompressionFormat ( ) , COMPRESSIONFORMAT_BINDING ) ; protocolMarshaller . marshall ( s3DestinationUpdate . getEncryptionConfiguration ( ) , ENCRYPTIONCONFIGURATION_BINDING ) ; protocolMarshaller . marshall ( s3DestinationUpdate . getCloudWatchLoggingOptions ( ) , CLOUDWATCHLOGGINGOPTIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < LabelExampleResponse > addAsync ( UUID appId , String versionId , ExampleLabelObject exampleLabelObject , final ServiceCallback < LabelExampleResponse > serviceCallback ) { } }
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 HTML table element as string */ public static String tableClass ( String clazz , String ... content ) { } }
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 ( String conversationId , String messageId , Map < String , MessageReceived . Status > statuses ) { } }
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 . delivered ) == 0 ? LocalMessageStatus . delivered : LocalMessageStatus . read , DateHelper . getUTCMilliseconds ( status . getTimestamp ( ) ) , null ) . build ( ) ) ; } return adapted ;
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 ( describeUserHierarchyGroupRequest . getInstanceId ( ) , INSTANCEID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
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 Stream */ @ Deprecated public static < U > Stream < U > concat ( final Object o , final Stream < U > stream ) { } }
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 , stream ) ;
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 : * external _ wiki _ url ( required ) - The URL to the External Wiki project which is being linked to this GitLab project , e . g . , http : / / www . wikidot . com / * @ param projectIdOrPath id , path of the project , or a Project instance holding the project ID or path * @ param externalWiki the ExternalWikiService instance holding the settings * @ return a ExternalWikiService instance holding the newly updated settings * @ throws GitLabApiException if any exception occurs */ public ExternalWikiService updateExternalWikiService ( Object projectIdOrPath , ExternalWikiService externalWiki ) throws GitLabApiException { } }
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 ( ExternalWikiService . class ) ) ;
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 , InChI Technical Manual < / a > */ private boolean isCisTransEndPoint ( int idx ) { } }
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 . getAtomicNumber ( ) ) { case 6 : case 14 : // Si case 32 : // Ge // double , single , single return chg == 0 && btypes == 0x0102 ; case 7 : if ( chg == 0 ) // double , single return btypes == 0x0101 ; if ( chg == + 1 ) // double , single , single return btypes == 0x0102 ; default : return false ; }
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 nano time */ public void releasePermits ( long number , Result result , long startNanos , long nanoTime ) { } }
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 : monthStr = "June" ; break ; case Calendar . JULY : monthStr = "July" ; break ; case Calendar . AUGUST : monthStr = "August" ; break ; case Calendar . SEPTEMBER : monthStr = "September" ; break ; case Calendar . OCTOBER : monthStr = "October" ; break ; case Calendar . NOVEMBER : monthStr = "November" ; break ; case Calendar . DECEMBER : monthStr = "December" ; break ; } if ( useShort ) monthStr = monthStr . substring ( 0 , 3 ) ; return monthStr ;
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 ) ; } return doQuery ( ( T ) mapper , schema . analyzer ) ;
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 . Collection c ) { } }
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 ResultSet object this . setResultSet ( null , DBConstants . SQL_SEEK_TYPE ) ; String strRecordset = this . getRecord ( ) . getSQLSeek ( strSeekSign , SQLParams . USE_SELECT_LITERALS , vParamList ) ; ResultSet resultSet = this . executeQuery ( strRecordset , DBConstants . SQL_SEEK_TYPE , vParamList ) ; this . setResultSet ( resultSet , DBConstants . SQL_SEEK_TYPE ) ; boolean more = resultSet . next ( ) ; if ( SHARE_STATEMENTS ) m_iLastOrder = - 1 ; // This will force a requery next time if there is an active query return more ; // Success if at least one record } catch ( SQLException ex ) { throw this . getDatabase ( ) . convertError ( ex ) ; } finally { vParamList . removeAllElements ( ) ; }
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 IllegalArgumentException if the string cannot be parsed * @ see < a href = " http : / / tools . ietf . org / html / rfc4291 " > rfc4291 - IP Version 6 Addressing Architecture < / a > */ public static Ipv6 parse ( final String ipv6Address ) { } }
try { String ipv6String = Validate . notNull ( ipv6Address ) . trim ( ) ; Validate . isTrue ( ! ipv6String . isEmpty ( ) ) ; final boolean isIpv6AddressWithEmbeddedIpv4 = ipv6String . contains ( "." ) ; if ( isIpv6AddressWithEmbeddedIpv4 ) { ipv6String = getIpv6AddressWithIpv4SectionInIpv6Notation ( ipv6String ) ; } final int indexOfDoubleColons = ipv6String . indexOf ( "::" ) ; final boolean isShortened = indexOfDoubleColons != - 1 ; if ( isShortened ) { Validate . isTrue ( indexOfDoubleColons == ipv6String . lastIndexOf ( "::" ) ) ; ipv6String = expandMissingColons ( ipv6String , indexOfDoubleColons ) ; } final String [ ] split = ipv6String . split ( COLON , TOTAL_OCTETS ) ; Validate . isTrue ( split . length == TOTAL_OCTETS ) ; BigInteger ipv6value = BigInteger . ZERO ; for ( String part : split ) { Validate . isTrue ( part . length ( ) <= MAX_PART_LENGTH ) ; Validate . checkRange ( Integer . parseInt ( part , BITS_PER_PART ) , MIN_PART_VALUE , MAX_PART_VALUE ) ; ipv6value = ipv6value . shiftLeft ( BITS_PER_PART ) . add ( new BigInteger ( part , BITS_PER_PART ) ) ; } return new Ipv6 ( ipv6value ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( String . format ( DEFAULT_PARSING_ERROR_MESSAGE , ipv6Address ) , e ) ; }
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 : sessionCreatedTimerWorker = new TimerWorker ( ) ; profileSessionCreated = true ; break ; case SESSION_OPENED : sessionOpenedTimerWorker = new TimerWorker ( ) ; profileSessionOpened = true ; break ; case SESSION_IDLE : sessionIdleTimerWorker = new TimerWorker ( ) ; profileSessionIdle = true ; break ; case SESSION_CLOSED : sessionClosedTimerWorker = new TimerWorker ( ) ; profileSessionClosed = true ; break ; } }
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 ( String uuid , long companyId ) { } }
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 rs The RingSet to be searched * @ param ring The ring to start with * @ param newRs The RingSet containing all Rings connected to ring * @ return newRs The RingSet containing all Rings connected to ring */ private static IRingSet walkRingSystem ( IRingSet rs , IRing ring , IRingSet newRs ) { } }
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 . contains ( tempRing ) ) { newRs . addAtomContainer ( tempRing ) ; newRs . add ( walkRingSystem ( rs , tempRing , newRs ) ) ; } } return newRs ;
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 retrieveFromCache whether to retrieve from the finder cache * @ return the matching commerce virtual order item , or < code > null < / code > if a matching commerce virtual order item could not be found */ public static CommerceVirtualOrderItem fetchByUUID_G ( String uuid , long groupId , boolean retrieveFromCache ) { } }
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 ( IndexOutOfBoundsException ) . * @ param < T > the value type * @ param publisher the Publisher instance to convert * @ return the Single instance * @ since 1.1 * @ throws NullPointerException if publisher is null */ public static < T > Single < T > toSingle ( Publisher < T > publisher ) { } }
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 ( Helper . getURLString ( Methods . TRACK_SNIPPET_GET , params ) ) ; Gson gson = new Gson ( ) ; try { message = gson . fromJson ( response , SnippetGetMessage . class ) ; } catch ( JsonParseException jpe ) { handleErrorResponse ( response ) ; } snippet = message . getContainer ( ) . getBody ( ) . getSnippet ( ) ; return snippet ;
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 ( ) . getDatabaseType ( ) ; appendTableName ( databaseType , sb , "DELETE FROM " , tableInfo . getTableName ( ) ) ; FieldType [ ] argFieldTypes = new FieldType [ dataSize ] ; appendWhereIds ( databaseType , idField , sb , dataSize , argFieldTypes ) ; return new MappedDeleteCollection < T , ID > ( dao , tableInfo , sb . toString ( ) , argFieldTypes ) ;
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 . toSafeHtml ( ) ;
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 . google . common . collect . Iterators # concat ( java . util . Iterator [ ] ) * @ param inputs the iterators to concatenate * @ param < T > the type of items in the iterators * @ return the concatenated iterators */ @ SafeVarargs public static < T > AutoCloseableIterator < T > concat ( final AutoCloseableIterator < T > ... inputs ) { } }
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 thrown if parameters fail the validation * @ return the observable to the Person object */ public Observable < ServiceResponse < Person > > createWithServiceResponseAsync ( String personGroupId , CreatePersonGroupPersonsOptionalParameter createOptionalParameter ) { } }
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 = createOptionalParameter != null ? createOptionalParameter . name ( ) : null ; final String userData = createOptionalParameter != null ? createOptionalParameter . userData ( ) : null ; return createWithServiceResponseAsync ( personGroupId , name , userData ) ;
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 for the id property . * For example , to add a new item , do as follows : * < pre > * getID ( ) . add ( newItem ) ; * < / pre > * Objects of the following type ( s ) are allowed in the list * { @ link CitationType . ID } */ public List < CitationType . ID > getID ( ) { } }
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 , String httpMethod ) { } }
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 here would make it " allow all " . return false ; } if ( isDeniedExplicitly ( subjectid , resourcePath , httpMethod ) ) { return false ; } if ( getResourcePermissions ( ) . containsKey ( subjectid ) && getResourcePermissions ( ) . get ( subjectid ) . containsKey ( resourcePath ) ) { // subject - specific permissions have precedence over wildcard permissions // i . e . only the permissions for that subjectid are checked , other permissions are ignored allow = isAllowed ( subjectid , resourcePath , httpMethod ) ; } else { allow = isAllowed ( subjectid , resourcePath , httpMethod ) || isAllowed ( subjectid , ALLOW_ALL , httpMethod ) || isAllowed ( ALLOW_ALL , resourcePath , httpMethod ) || isAllowed ( ALLOW_ALL , ALLOW_ALL , httpMethod ) ; } } if ( allow ) { if ( isRootApp ( ) && ! Config . getConfigBoolean ( "clients_can_access_root_app" , false ) ) { return false ; } if ( StringUtils . isBlank ( subjectid ) ) { // guest access check return isAllowed ( ALLOW_ALL , resourcePath , GUEST . toString ( ) ) ; } return true ; } return isAllowedImplicitly ( subjectid , resourcePath , httpMethod ) ;
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 . setWorkingDay ( day , true ) ; // Read hours ProjectCalendarHours hours = calendar . addCalendarHours ( day ) ; for ( Record recWorkingHours : recHours ) { addHours ( hours , recWorkingHours ) ; } }
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 > * < dt > PermGen < / dt > * < dd > The name of the perm gen memory pool < / dd > * < dt > TenuredGen < / dt > * < dd > The name of the tenured / old gen memory pool < / dd > * < dt > YoungCollector < / dt > * < dd > The name of the young garbage collector < / dd > * < dt > TenuredCollector < / dt > * < dd > The name of the tenured garbage collector < / dd > * < / dl > * @ see # EDEN _ SPACE _ DEFAULTS * @ see # SURVIVOR _ SPACE _ DEFAULTS * @ see # PERM _ GEN _ DEFAULTS * @ see # TENURED _ GEN _ DEFAULTS */ public void init ( ContextConfig config ) { } }
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 . setSurvivorMemoryPool ( survivorSpace ) ; } String tenuredGen = properties . getString ( "TenuredGen" ) ; if ( tenuredGen != null ) { this . setTenuredMemoryPool ( tenuredGen ) ; } String permGen = properties . getString ( "PermGen" ) ; if ( permGen != null ) { this . setPermGenMemoryPool ( permGen ) ; } String youngCollector = properties . getString ( "YoungCollector" ) ; if ( youngCollector != null ) { this . setYoungCollector ( youngCollector ) ; } String tenuredCollector = properties . getString ( "TenuredCollector" ) ; if ( tenuredCollector != null ) { this . setTenuredCollector ( tenuredCollector ) ; } // enable contention getThreadMXBean ( ) . setThreadCpuTimeEnabled ( true ) ; getThreadMXBean ( ) . setThreadContentionMonitoringEnabled ( true ) ; // load the settings if possible loadJMXSettings ( ) ;
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 ResponseBuilder responseBuilder = Response . ok ( stream , mediaType ) ; // Set Content - Disposition header for " application / octet - stream " if ( mediaType . equals ( MediaType . APPLICATION_OCTET_STREAM ) ) responseBuilder . header ( "Content-Disposition" , "attachment" ) ; return responseBuilder . build ( ) ;
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 specified provider must be registered * in the security provider list . * < p > Note that the list of registered providers may be retrieved via * the { @ link Security # getProviders ( ) Security . getProviders ( ) } method . * @ param algorithm the standard name of the requested exemption mechanism . * See the ExemptionMechanism section in the * < a href = * " { @ docRoot } openjdk - redirect . html ? v = 8 & path = / technotes / guides / security / StandardNames . html # Exemption " > * Java Cryptography Architecture Standard Algorithm Name Documentation < / a > * for information about standard exemption mechanism names . * @ param provider the name of the provider . * @ return the new < code > ExemptionMechanism < / code > object . * @ exception NullPointerException if < code > algorithm < / code > * is null . * @ exception NoSuchAlgorithmException if an ExemptionMechanismSpi * implementation for the specified algorithm is not * available from the specified provider . * @ exception NoSuchProviderException if the specified provider is not * registered in the security provider list . * @ exception IllegalArgumentException if the < code > provider < / code > * is null or empty . * @ see java . security . Provider */ public static final ExemptionMechanism getInstance ( String algorithm , String provider ) throws NoSuchAlgorithmException , NoSuchProviderException { } }
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 = ruleParameter ) ) ) * ) ? otherlv _ 5 = ' > ' ) ? ) ; */ public final EObject ruleRuleNameAndParams ( EObject in_current ) throws RecognitionException { } }
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 ) ) ( otherlv _ 1 = ' < ' ( ( ( lv _ parameters _ 2_0 = ruleParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ parameters _ 4_0 = ruleParameter ) ) ) * ) ? otherlv _ 5 = ' > ' ) ? ) ) // InternalXtext . g : 808:2 : ( ( ( lv _ name _ 0_0 = ruleValidID ) ) ( otherlv _ 1 = ' < ' ( ( ( lv _ parameters _ 2_0 = ruleParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ parameters _ 4_0 = ruleParameter ) ) ) * ) ? otherlv _ 5 = ' > ' ) ? ) { // InternalXtext . g : 808:2 : ( ( ( lv _ name _ 0_0 = ruleValidID ) ) ( otherlv _ 1 = ' < ' ( ( ( lv _ parameters _ 2_0 = ruleParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ parameters _ 4_0 = ruleParameter ) ) ) * ) ? otherlv _ 5 = ' > ' ) ? ) // InternalXtext . g : 809:3 : ( ( lv _ name _ 0_0 = ruleValidID ) ) ( otherlv _ 1 = ' < ' ( ( ( lv _ parameters _ 2_0 = ruleParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ parameters _ 4_0 = ruleParameter ) ) ) * ) ? otherlv _ 5 = ' > ' ) ? { // InternalXtext . g : 809:3 : ( ( lv _ name _ 0_0 = ruleValidID ) ) // InternalXtext . g : 810:4 : ( lv _ name _ 0_0 = ruleValidID ) { // InternalXtext . g : 810:4 : ( lv _ name _ 0_0 = ruleValidID ) // InternalXtext . g : 811:5 : lv _ name _ 0_0 = ruleValidID { newCompositeNode ( grammarAccess . getRuleNameAndParamsAccess ( ) . getNameValidIDParserRuleCall_0_0 ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_21 ) ; lv_name_0_0 = ruleValidID ( ) ; state . _fsp -- ; if ( current == null ) { current = createModelElementForParent ( grammarAccess . getRuleNameAndParamsRule ( ) ) ; } set ( current , "name" , lv_name_0_0 , "org.eclipse.xtext.Xtext.ValidID" ) ; afterParserOrEnumRuleCall ( ) ; } } // InternalXtext . g : 828:3 : ( otherlv _ 1 = ' < ' ( ( ( lv _ parameters _ 2_0 = ruleParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ parameters _ 4_0 = ruleParameter ) ) ) * ) ? otherlv _ 5 = ' > ' ) ? int alt23 = 2 ; int LA23_0 = input . LA ( 1 ) ; if ( ( LA23_0 == 27 ) ) { alt23 = 1 ; } switch ( alt23 ) { case 1 : // InternalXtext . g : 829:4 : otherlv _ 1 = ' < ' ( ( ( lv _ parameters _ 2_0 = ruleParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ parameters _ 4_0 = ruleParameter ) ) ) * ) ? otherlv _ 5 = ' > ' { otherlv_1 = ( Token ) match ( input , 27 , FollowSets000 . FOLLOW_22 ) ; newLeafNode ( otherlv_1 , grammarAccess . getRuleNameAndParamsAccess ( ) . getLessThanSignKeyword_1_0 ( ) ) ; // InternalXtext . g : 833:4 : ( ( ( lv _ parameters _ 2_0 = ruleParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ parameters _ 4_0 = ruleParameter ) ) ) * ) ? int alt22 = 2 ; int LA22_0 = input . LA ( 1 ) ; if ( ( LA22_0 == RULE_ID ) ) { alt22 = 1 ; } switch ( alt22 ) { case 1 : // InternalXtext . g : 834:5 : ( ( lv _ parameters _ 2_0 = ruleParameter ) ) ( otherlv _ 3 = ' , ' ( ( lv _ parameters _ 4_0 = ruleParameter ) ) ) * { // InternalXtext . g : 834:5 : ( ( lv _ parameters _ 2_0 = ruleParameter ) ) // InternalXtext . g : 835:6 : ( lv _ parameters _ 2_0 = ruleParameter ) { // InternalXtext . g : 835:6 : ( lv _ parameters _ 2_0 = ruleParameter ) // InternalXtext . g : 836:7 : lv _ parameters _ 2_0 = ruleParameter { newCompositeNode ( grammarAccess . getRuleNameAndParamsAccess ( ) . getParametersParameterParserRuleCall_1_1_0_0 ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_23 ) ; lv_parameters_2_0 = ruleParameter ( ) ; state . _fsp -- ; if ( current == null ) { current = createModelElementForParent ( grammarAccess . getRuleNameAndParamsRule ( ) ) ; } add ( current , "parameters" , lv_parameters_2_0 , "org.eclipse.xtext.Xtext.Parameter" ) ; afterParserOrEnumRuleCall ( ) ; } } // InternalXtext . g : 853:5 : ( otherlv _ 3 = ' , ' ( ( lv _ parameters _ 4_0 = ruleParameter ) ) ) * loop21 : do { int alt21 = 2 ; int LA21_0 = input . LA ( 1 ) ; if ( ( LA21_0 == 13 ) ) { alt21 = 1 ; } switch ( alt21 ) { case 1 : // InternalXtext . g : 854:6 : otherlv _ 3 = ' , ' ( ( lv _ parameters _ 4_0 = ruleParameter ) ) { otherlv_3 = ( Token ) match ( input , 13 , FollowSets000 . FOLLOW_13 ) ; newLeafNode ( otherlv_3 , grammarAccess . getRuleNameAndParamsAccess ( ) . getCommaKeyword_1_1_1_0 ( ) ) ; // InternalXtext . g : 858:6 : ( ( lv _ parameters _ 4_0 = ruleParameter ) ) // InternalXtext . g : 859:7 : ( lv _ parameters _ 4_0 = ruleParameter ) { // InternalXtext . g : 859:7 : ( lv _ parameters _ 4_0 = ruleParameter ) // InternalXtext . g : 860:8 : lv _ parameters _ 4_0 = ruleParameter { newCompositeNode ( grammarAccess . getRuleNameAndParamsAccess ( ) . getParametersParameterParserRuleCall_1_1_1_1_0 ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_23 ) ; lv_parameters_4_0 = ruleParameter ( ) ; state . _fsp -- ; if ( current == null ) { current = createModelElementForParent ( grammarAccess . getRuleNameAndParamsRule ( ) ) ; } add ( current , "parameters" , lv_parameters_4_0 , "org.eclipse.xtext.Xtext.Parameter" ) ; afterParserOrEnumRuleCall ( ) ; } } } break ; default : break loop21 ; } } while ( true ) ; } break ; } otherlv_5 = ( Token ) match ( input , 28 , FollowSets000 . FOLLOW_2 ) ; newLeafNode ( otherlv_5 , grammarAccess . getRuleNameAndParamsAccess ( ) . getGreaterThanSignKeyword_1_2 ( ) ) ; } break ; } } } leaveRule ( ) ; } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
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 ) { * case b : / / some code * } < / pre > * " some code " is called when < code > b . isCase ( a ) < / code > returns * < code > true < / code > . * @ param caseValue the case value * @ param switchValue the switch value * @ return true if the switchValue is deemed to be equal to the caseValue * @ since 1.0 */ public static boolean isCase ( Object caseValue , Object switchValue ) { } }
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 the resource name * @ return the resource name adjusted for the current site root * @ see # getSitePath ( CmsResource ) */ public String removeSiteRoot ( String 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 ( siteRoot . length ( ) ) ; } if ( resourcename . length ( ) == 0 ) { // input was a site root folder without trailing slash resourcename = "/" ; } return resourcename ;
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 . PartialViewContext # isPartialRequest } * returns < code > true < / code > and we don ' t have a request to process all * components in the view * ( { @ link javax . faces . context . PartialViewContext # isExecuteAll } returns * < code > false < / code > ) < / li > * < / ul > * Perform full processing by calling * { @ link UIComponentBase # processDecodes } if one of the following * conditions are met : * < ul > * < li > { @ link javax . faces . context . PartialViewContext # isPartialRequest } * returns < code > true < / code > and we have a request to process all * components in the view * ( { @ link javax . faces . context . PartialViewContext # isExecuteAll } returns * < code > true < / code > ) < / li > * < li > { @ link javax . faces . context . PartialViewContext # isPartialRequest } * returns < code > false < / code > < / li > * < / ul > * < / div > * < p class = " changed _ modified _ 2_0 " > Override the default * { @ link UIComponentBase # processDecodes } behavior to broadcast any queued * events after the default processing or partial processing has been * completed and to clear out any events for later phases if the event * processing for this phase caused { @ link FacesContext # renderResponse } * or { @ link FacesContext # responseComplete } to be called . < / p > * @ param context { @ link FacesContext } for the request we are processing * @ throws NullPointerException if < code > context < / code > * is < code > null < / code > */ @ Override public void processDecodes ( FacesContext context ) { } }
initState ( ) ; notifyBefore ( context , PhaseId . APPLY_REQUEST_VALUES ) ; try { if ( ! skipPhase ) { if ( context . getPartialViewContext ( ) . isPartialRequest ( ) && ! context . getPartialViewContext ( ) . isExecuteAll ( ) ) { context . getPartialViewContext ( ) . processPartial ( PhaseId . APPLY_REQUEST_VALUES ) ; } else { super . processDecodes ( context ) ; } broadcastEvents ( context , PhaseId . APPLY_REQUEST_VALUES ) ; } } finally { clearFacesEvents ( context ) ; notifyAfter ( context , 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 ) ) ; * < / pre > * @ param builderFunction a function that is given a { @ link ExecutionInput . Builder } * @ return an { @ link ExecutionResult } which can include errors */ public ExecutionResult execute ( UnaryOperator < ExecutionInput . Builder > builderFunction ) { } }
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 */ protected final int getCodePointOffset ( int ch ) { } }
// 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 codepoint return getBMPOffset ( ( char ) ch ) ; } else if ( ch <= UCharacter . MAX_VALUE ) { // look at the construction of supplementary characters // trail forms the ends of it . return getSurrogateOffset ( UTF16 . getLeadSurrogate ( ch ) , ( char ) ( ch & SURROGATE_MASK_ ) ) ; } else { // return - 1 if there is an error , in this case we return return - 1 ; }
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 processor wrapper */ protected ChainedResourceBundlePostProcessor getCustomProcessorWrapper ( ResourceBundlePostProcessor customProcessor , String key , boolean isVariantPostProcessor ) { } }
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 on the devappserver process * @ param workingDirectory if null then the working directory of current Java process . * @ throws ProcessHandlerException when process runner encounters an error * @ throws AppEngineJavaComponentsNotInstalledException Cloud SDK is installed but App Engine Java * components are not * @ throws InvalidJavaSdkException when the specified JDK does not exist */ public void run ( List < String > jvmArgs , List < String > args , Map < String , String > environment , @ Nullable Path workingDirectory ) throws ProcessHandlerException , AppEngineJavaComponentsNotInstalledException , InvalidJavaSdkException , IOException { } }
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 ( ) . getParent ( ) . toAbsolutePath ( ) . toString ( ) ) ; command . add ( "-cp" ) ; command . add ( sdk . getAppEngineToolsJar ( ) . toAbsolutePath ( ) . toString ( ) ) ; command . add ( "com.google.appengine.tools.development.DevAppServerMain" ) ; command . addAll ( args ) ; logger . info ( "submitting command: " + Joiner . on ( " " ) . join ( command ) ) ; Map < String , String > devServerEnvironment = Maps . newHashMap ( environment ) ; devServerEnvironment . put ( "JAVA_HOME" , sdk . getJavaHomePath ( ) . toAbsolutePath ( ) . toString ( ) ) ; ProcessBuilder processBuilder = processBuilderFactory . newProcessBuilder ( ) ; processBuilder . command ( command ) ; if ( workingDirectory != null ) { processBuilder . directory ( workingDirectory . toFile ( ) ) ; } processBuilder . environment ( ) . putAll ( devServerEnvironment ) ; Process process = processBuilder . start ( ) ; processHandler . handleProcess ( process ) ;
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 # withLookupAttributes ( java . util . Collection ) } if you * want to override the existing values . * @ param lookupAttributes * Contains a list of lookup attributes . Currently the list can contain only one item . * @ return Returns a reference to this object so that method calls can be chained together . */ public LookupEventsRequest withLookupAttributes ( LookupAttribute ... lookupAttributes ) { } }
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 Compiled template to replace with * @ param i Index of template to be replaced * @ throws TransformerException */ public void replaceTemplate ( ElemTemplate v , int i ) throws TransformerException { } }
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 process ( T image ) { } }
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 ( ) ; addNewTracks ( ) ; } // System . out . println ( " num inliers = " + N + " num dropped " + numDropped + " total active " + tracker . getActivePairs ( ) . size ( ) ) ; } return true ;
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 ( ) ; cleanupConnection ( conn , null , ps ) ; logger . exiting ( CLASSNAME , "createSchema" ) ;
public class EmojiUtility { /** * 对spanableString进行正则判断 , 如果符合要求 , 则以表情图片代替 * @ param context context * @ param spannableString htmlstring * @ param patten patten * @ param start start index * @ param adjustEmoji 是否缩放表情图 * @ throws SecurityException * @ throws NoSuchFieldException * @ throws NumberFormatException * @ throws IllegalArgumentException * @ throws IllegalAccessException */ private static void dealExpression ( Context context , SpannableString spannableString , Pattern patten , int start , boolean adjustEmoji ) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException { } }
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 ( ) + key . length ( ) ; // 通过图片资源id来得到图像 , 用一个ImageSpan来包装 // 设置图片的大小为系统默认文字大小 , 以便文字图片对齐 Drawable drawable = context . getResources ( ) . getDrawable ( item . getResId ( ) ) ; if ( adjustEmoji && emojiSize > 0 ) { drawable . setBounds ( 0 , 0 , emojiSize , emojiSize ) ; } else { // 不缩放时用默认的宽高 drawable . setBounds ( 0 , 0 , drawable . getIntrinsicWidth ( ) , drawable . getIntrinsicHeight ( ) ) ; } CenteredImageSpan imageSpan = new CenteredImageSpan ( drawable , ImageSpan . ALIGN_BOTTOM ) ; // 将该图片替换字符串中规定的位置中 spannableString . setSpan ( imageSpan , matcher . start ( ) , end , Spannable . SPAN_INCLUSIVE_EXCLUSIVE ) ; if ( end < spannableString . length ( ) ) { // 如果整个字符串还未验证完 , 则继续递归查询替换 。 。 dealExpression ( context , spannableString , patten , end , adjustEmoji ) ; } break ; } }
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 context * @ param validationContext * @ return */ private String getHeaderName ( String name , Map < String , Object > receivedHeaders , TestContext context , HeaderValidationContext validationContext ) { } }
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 . entrySet ( ) . parallelStream ( ) . filter ( item -> item . getKey ( ) . equalsIgnoreCase ( key ) ) . map ( Map . Entry :: getKey ) . findFirst ( ) . orElseThrow ( ( ) -> new ValidationException ( "Validation failed: No matching header for key '" + key + "'" ) ) ; log . info ( String . format ( "Found matching case insensitive header name: %s" , headerName ) ) ; } return headerName ;
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 ( ) ; } bioAssemblyParser . pdb_REMARK_350_Handler ( line ) ; } // REMARK 3 ( for R free ) // note : if more than 1 value present ( occurring in hybrid experimental technique entries , e . g . 3ins , 4n9m ) // then last one encountered will be taken } else if ( line . startsWith ( "REMARK 3 FREE R VALUE" ) ) { // Rfree annotation is not very consistent in PDB format , it varies depending on the software // Here we follow this strategy : // a ) take the ' ( NO CUTOFF ) ' value if the only one available ( shelx software , e . g . 1x7q ) // b ) don ' t take it if also a line without ' ( NO CUTOFF ) ' is present ( CNX software , e . g . 3lak ) Pattern pR = Pattern . compile ( "^REMARK 3 FREE R VALUE\\s+(?:\\(NO CUTOFF\\))?\\s+:\\s+(\\d?\\.\\d+).*" ) ; Matcher mR = pR . matcher ( line ) ; if ( mR . matches ( ) ) { try { rfreeNoCutoffLine = Float . parseFloat ( mR . group ( 1 ) ) ; } catch ( NumberFormatException e ) { logger . info ( "Rfree value " + mR . group ( 1 ) + " does not look like a number, will ignore it" ) ; } } pR = Pattern . compile ( "^REMARK 3 FREE R VALUE\\s+:\\s+(\\d?\\.\\d+).*" ) ; mR = pR . matcher ( line ) ; if ( mR . matches ( ) ) { try { rfreeStandardLine = Float . parseFloat ( mR . group ( 1 ) ) ; } catch ( NumberFormatException e ) { logger . info ( "Rfree value '{}' does not look like a number, will ignore it" , mR . group ( 1 ) ) ; } } // REMARK 3 RESOLUTION ( contains more info than REMARK 2 , for instance multiple resolutions in hybrid experimental technique entries ) // note : if more than 1 value present ( occurring in hybrid experimental technique entries , e . g . 3ins , 4n9m ) // then last one encountered will be taken } else if ( line . startsWith ( "REMARK 3 RESOLUTION RANGE HIGH" ) ) { Pattern pR = Pattern . compile ( "^REMARK 3 RESOLUTION RANGE HIGH \\(ANGSTROMS\\) :\\s+(\\d+\\.\\d+).*" ) ; Matcher mR = pR . matcher ( line ) ; if ( mR . matches ( ) ) { try { float res = Float . parseFloat ( mR . group ( 1 ) ) ; if ( pdbHeader . getResolution ( ) != PDBHeader . DEFAULT_RESOLUTION ) { logger . warn ( "More than 1 resolution value present, will use last one {} and discard previous {} " , mR . group ( 1 ) , String . format ( "%4.2f" , pdbHeader . getResolution ( ) ) ) ; } pdbHeader . setResolution ( res ) ; } catch ( NumberFormatException e ) { logger . info ( "Could not parse resolution '{}', ignoring it" , mR . group ( 1 ) ) ; } } }
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 CmsGroup } < / code > objects * @ throws CmsException if operation was not successful */ public List < CmsGroup > getChildren ( CmsDbContext dbc , CmsGroup group , boolean includeSubChildren ) throws CmsException { } }
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 ( it . hasNext ( ) ) { CmsGroup child = it . next ( ) ; // add the group itself allChildren . add ( child ) ; // now get all sub - children for each group allChildren . addAll ( getChildren ( dbc , child , true ) ) ; } return new ArrayList < CmsGroup > ( allChildren ) ;
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 , Context context ) { } }
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 ; } @ Override public void put ( String name , String value ) { } } ; try { Option . HELP . process ( h , "-help" ) ; } catch ( Option . InvalidValueException ignore ) { } return Result . CMDERR ; } // prefix argv with contents of environment variable and expand @ - files try { argv = CommandLine . parse ( ENV_OPT_NAME , argv ) ; } catch ( UnmatchedQuote ex ) { error ( "err.unmatched.quote" , ex . variableName ) ; return Result . CMDERR ; } catch ( FileNotFoundException | NoSuchFileException e ) { warning ( "err.file.not.found" , e . getMessage ( ) ) ; return Result . SYSERR ; } catch ( IOException ex ) { log . printLines ( PrefixKind . JAVAC , "msg.io" ) ; ex . printStackTrace ( log . getWriter ( WriterKind . NOTICE ) ) ; return Result . SYSERR ; } Arguments args = Arguments . instance ( context ) ; args . init ( ownName , argv ) ; if ( log . nerrors > 0 ) return Result . CMDERR ; Options options = Options . instance ( context ) ; // init Log boolean forceStdOut = options . isSet ( "stdout" ) ; if ( forceStdOut ) { log . flush ( ) ; log . setWriters ( new PrintWriter ( System . out , true ) ) ; } // init CacheFSInfo // allow System property in following line as a Mustang legacy boolean batchMode = ( options . isUnset ( "nonBatchMode" ) && System . getProperty ( "nonBatchMode" ) == null ) ; if ( batchMode ) CacheFSInfo . preRegister ( context ) ; boolean ok = true ; // init file manager fileManager = context . get ( JavaFileManager . class ) ; if ( fileManager instanceof BaseFileManager ) { ( ( BaseFileManager ) fileManager ) . setContext ( context ) ; // reinit with options ok &= ( ( BaseFileManager ) fileManager ) . handleOptions ( args . getDeferredFileManagerOptions ( ) ) ; } // handle this here so it works even if no other options given String showClass = options . get ( "showClass" ) ; if ( showClass != null ) { if ( showClass . equals ( "showClass" ) ) // no value given for option showClass = "com.sun.tools.javac.Main" ; showClass ( showClass ) ; } ok &= args . validate ( ) ; if ( ! ok || log . nerrors > 0 ) return Result . CMDERR ; if ( args . isEmpty ( ) ) return Result . OK ; // init Dependencies if ( options . isSet ( "debug.completionDeps" ) ) { Dependencies . GraphDependencies . preRegister ( context ) ; } // init plugins Set < List < String > > pluginOpts = args . getPluginOpts ( ) ; if ( ! pluginOpts . isEmpty ( ) || context . get ( PlatformDescription . class ) != null ) { BasicJavacTask t = ( BasicJavacTask ) BasicJavacTask . instance ( context ) ; t . initPlugins ( pluginOpts ) ; } // init multi - release jar handling if ( fileManager . isSupportedOption ( Option . MULTIRELEASE . primaryName ) == 1 ) { Target target = Target . instance ( context ) ; List < String > list = List . of ( target . multiReleaseValue ( ) ) ; fileManager . handleOption ( Option . MULTIRELEASE . primaryName , list . iterator ( ) ) ; } // init JavaCompiler JavaCompiler comp = JavaCompiler . instance ( context ) ; // init doclint List < String > docLintOpts = args . getDocLintOpts ( ) ; if ( ! docLintOpts . isEmpty ( ) ) { BasicJavacTask t = ( BasicJavacTask ) BasicJavacTask . instance ( context ) ; t . initDocLint ( docLintOpts ) ; } if ( options . get ( Option . XSTDOUT ) != null ) { // Stdout reassigned - ask compiler to close it when it is done comp . closeables = comp . closeables . prepend ( log . getWriter ( WriterKind . NOTICE ) ) ; } try { comp . compile ( args . getFileObjects ( ) , args . getClassNames ( ) , null , List . nil ( ) ) ; if ( log . expectDiagKeys != null ) { if ( log . expectDiagKeys . isEmpty ( ) ) { log . printRawLines ( "all expected diagnostics found" ) ; return Result . OK ; } else { log . printRawLines ( "expected diagnostic keys not found: " + log . expectDiagKeys ) ; return Result . ERROR ; } } return ( comp . errorCount ( ) == 0 ) ? Result . OK : Result . ERROR ; } catch ( OutOfMemoryError | StackOverflowError ex ) { resourceMessage ( ex ) ; return Result . SYSERR ; } catch ( FatalError ex ) { feMessage ( ex , options ) ; return Result . SYSERR ; } catch ( AnnotationProcessingError ex ) { apMessage ( ex ) ; return Result . SYSERR ; } catch ( PropagatedException ex ) { // TODO : what about errors from plugins ? should not simply rethrow the error here throw ex . getCause ( ) ; } catch ( Throwable ex ) { // Nasty . If we ' ve already reported an error , compensate // for buggy compiler error recovery by swallowing thrown // exceptions . if ( comp == null || comp . errorCount ( ) == 0 || options . isSet ( "dev" ) ) bugMessage ( ex ) ; return Result . ABNORMAL ; } finally { if ( comp != null ) { try { comp . close ( ) ; } catch ( ClientCodeException ex ) { throw new RuntimeException ( ex . getCause ( ) ) ; } } }
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 InvalidParameterException * This exception is thrown when the Amazon Cognito service encounters an invalid parameter . * @ throws ResourceNotFoundException * This exception is thrown when the Amazon Cognito service cannot find the requested resource . * @ throws TooManyRequestsException * This exception is thrown when the user has made too many requests for a given operation . * @ throws NotAuthorizedException * This exception is thrown when a user is not authorized . * @ throws InternalErrorException * This exception is thrown when Amazon Cognito encounters an internal error . * @ sample AWSCognitoIdentityProvider . ListUserPoolClients * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cognito - idp - 2016-04-18 / ListUserPoolClients " * target = " _ top " > AWS API Documentation < / a > */ @ Override public ListUserPoolClientsResult listUserPoolClients ( ListUserPoolClientsRequest request ) { } }
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 . */ private void updateVoiceButton ( boolean empty ) { } }
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 [ ] stat2Paths ( FileStatus [ ] stats , Path path ) { } }
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ę . */ public static Object invokeMethod ( Object target , String method , Object ... args ) { } }
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 MethodInvocationException ( t ) ; }
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 responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object . This parameter should only be used to retrieve data . Attempting to update data using this parameter may cause data loss . * @ return String Resource Url */ public static MozuUrl getLocationInventoryUrl ( String locationCode , String productCode , String responseFields ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/locationinventory/{locationCode}/{productCode}?responseFields={responseFields}" ) ; formatter . formatUrl ( "locationCode" , locationCode ) ; formatter . formatUrl ( "productCode" , productCode ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
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 . * < li > It must be part of data that is not yet committed to Storage ( tail part ) - as such , it must be fully in the cache . * < / ul > * Note : This method will not cause cache statistics to be updated . As such , Cache entry generations will not be * updated for those entries that are touched . * @ param startOffset The offset in the StreamSegment where to start reading . * @ param length The number of bytes to read . * @ return An InputStream containing the requested data , or null if all of the conditions of this read cannot be met . * @ throws IllegalStateException If the read index is in recovery mode . * @ throws IllegalArgumentException If the parameters are invalid ( offset , length or offset + length are not in the Segment ' s range ) . */ InputStream readDirect ( long startOffset , int length ) { } }
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 . getStorageLength ( ) , "startOffset must refer to an offset beyond the Segment's StorageLength offset." ) ; Preconditions . checkArgument ( startOffset + length <= this . metadata . getLength ( ) , "startOffset+length must be less than the length of the Segment." ) ; Preconditions . checkArgument ( startOffset >= Math . min ( this . metadata . getStartOffset ( ) , this . metadata . getStorageLength ( ) ) , "startOffset is before the Segment's StartOffset." ) ; // Get the first entry . This one is trickier because the requested start offset may not fall on an entry boundary . CompletableReadResultEntry nextEntry ; synchronized ( this . lock ) { ReadIndexEntry indexEntry = this . indexEntries . getFloor ( startOffset ) ; if ( indexEntry == null || startOffset > indexEntry . getLastStreamSegmentOffset ( ) || ! indexEntry . isDataEntry ( ) ) { // Data not available or data exist in a partially merged transaction . return null ; } else { // Fetch data from the cache for the first entry , but do not update the cache hit stats . nextEntry = createMemoryRead ( indexEntry , startOffset , length , false ) ; } } // Collect the contents of congruent Index Entries into a list , as long as we still encounter data in the cache . // Since we know all entries should be in the cache and are contiguous , there is no need assert Futures . isSuccessful ( nextEntry . getContent ( ) ) : "Found CacheReadResultEntry that is not completed yet: " + nextEntry ; val entryContents = nextEntry . getContent ( ) . join ( ) ; ArrayList < InputStream > contents = new ArrayList < > ( ) ; contents . add ( entryContents . getData ( ) ) ; int readLength = entryContents . getLength ( ) ; while ( readLength < length ) { // No need to search the index ; from now on , we know each offset we are looking for is at the beginning of a cache entry . // Also , no need to acquire the lock there . The cache itself is thread safe , and if the entry we are about to fetch // has just been evicted , we ' ll just get null back and stop reading ( which is acceptable ) . byte [ ] entryData = this . cache . get ( new CacheKey ( this . metadata . getId ( ) , startOffset + readLength ) ) ; if ( entryData == null ) { // Could not find the ' next ' cache entry : this means the requested range is not fully cached . return null ; } int entryReadLength = Math . min ( entryData . length , length - readLength ) ; assert entryReadLength > 0 : "about to have fetched zero bytes from a cache entry" ; contents . add ( new ByteArrayInputStream ( entryData , 0 , entryReadLength ) ) ; readLength += entryReadLength ; } // Coalesce the results into a single InputStream and return the result . return new SequenceInputStream ( Iterators . asEnumeration ( contents . iterator ( ) ) ) ;
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 server side . * @ throws InvalidNextTokenException * The specified token is not valid . * @ sample AWSSimpleSystemsManagement . ListAssociations * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ssm - 2014-11-06 / ListAssociations " target = " _ top " > AWS API * Documentation < / a > */ @ Override public ListAssociationsResult listAssociations ( ListAssociationsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListAssociations ( request ) ;