signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class FileSystem { /** * Returns the FileSystem for this URI ' s scheme and authority . The scheme * of the URI determines a configuration property name , * < tt > fs . < i > scheme < / i > . class < / tt > whose value names the FileSystem class . * The entire URI is passed to the FileSystem instance ' s initialize method . */ public static FileSystem get ( URI uri , Configuration conf ) throws IOException { } }
String scheme = uri . getScheme ( ) ; String authority = uri . getAuthority ( ) ; if ( scheme == null ) { // no scheme : use default FS return get ( conf ) ; } if ( authority == null ) { // no authority URI defaultUri = getDefaultUri ( conf ) ; if ( scheme . equals ( defaultUri . getScheme ( ) ) // if scheme matches default && defaultUri . getAuthority ( ) != null ) { // & default has authority return get ( defaultUri , conf ) ; // return default } } String disableCacheName = String . format ( "fs.%s.impl.disable.cache" , scheme ) ; if ( conf . getBoolean ( disableCacheName , false ) ) { return createFileSystem ( uri , conf , null ) ; } return CACHE . get ( uri , conf ) ;
public class ConnectionManager { /** * Query a player to determine the port on which its database server is running . * @ param announcement the device announcement with which we detected a new player on the network . */ private void requestPlayerDBServerPort ( DeviceAnnouncement announcement ) { } }
Socket socket = null ; try { InetSocketAddress address = new InetSocketAddress ( announcement . getAddress ( ) , DB_SERVER_QUERY_PORT ) ; socket = new Socket ( ) ; socket . connect ( address , socketTimeout . get ( ) ) ; InputStream is = socket . getInputStream ( ) ; OutputStream os = socket . getOutputStream ( ) ; socket . setSoTimeout ( socketTimeout . get ( ) ) ; os . write ( DB_SERVER_QUERY_PACKET ) ; byte [ ] response = readResponseWithExpectedSize ( is , 2 , "database server port query packet" ) ; if ( response . length == 2 ) { setPlayerDBServerPort ( announcement . getNumber ( ) , ( int ) Util . bytesToNumber ( response , 0 , 2 ) ) ; } } catch ( java . net . ConnectException ce ) { logger . info ( "Player " + announcement . getNumber ( ) + " doesn't answer rekordbox port queries, connection refused. Won't attempt to request metadata." ) ; } catch ( Exception e ) { logger . warn ( "Problem requesting database server port number" , e ) ; } finally { if ( socket != null ) { try { socket . close ( ) ; } catch ( IOException e ) { logger . warn ( "Problem closing database server port request socket" , e ) ; } } }
public class FDUtil { /** * creates a classbane from give source path * @ param str * @ return */ public static String toClassName ( String str ) { } }
StringBuffer javaName = new StringBuffer ( ) ; String [ ] arr = lucee . runtime . type . util . ListUtil . listToStringArray ( str , '/' ) ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( i == ( arr . length - 1 ) ) arr [ i ] = replaceLast ( arr [ i ] , '.' , '$' ) ; if ( i != 0 ) javaName . append ( '.' ) ; javaName . append ( toVariableName ( arr [ i ] ) ) ; } return javaName . toString ( ) . toLowerCase ( ) ;
public class ExtraLanguagePreferenceAccess { /** * Replies the preference value from the given store . * @ param store the preference storE . * @ param preferenceContainerID the identifier of the generator ' s preference container . * @ param preferenceName the name of the preference . * @ return the key . */ public static String getString ( IPreferenceStore store , String preferenceContainerID , String preferenceName ) { } }
return store . getString ( getPrefixedKey ( preferenceContainerID , preferenceName ) ) ;
public class FieldUtil { /** * Utility to remove the trailing 0 ' s . * @ param sb the input string builder ; may not be null */ protected static void removeTralingZeros ( StringBuilder sb ) { } }
int endIndex = sb . length ( ) ; if ( endIndex > 0 ) { -- endIndex ; int index = endIndex ; while ( sb . charAt ( index ) == '0' ) { -- index ; } if ( index < endIndex ) sb . delete ( index + 1 , endIndex + 1 ) ; }
public class Encoding { /** * Decodes HTML entities to produce a string containing only valid * Unicode scalar values . */ public static String decodeHtml ( String s ) { } }
int firstAmp = s . indexOf ( '&' ) ; int safeLimit = longestPrefixOfGoodCodeunits ( s ) ; if ( ( firstAmp & safeLimit ) < 0 ) { return s ; } StringBuilder sb ; { int n = s . length ( ) ; sb = new StringBuilder ( n ) ; int pos = 0 ; int amp = firstAmp ; while ( amp >= 0 ) { long endAndCodepoint = HtmlEntities . decodeEntityAt ( s , amp , n ) ; int end = ( int ) ( endAndCodepoint >>> 32 ) ; int codepoint = ( int ) endAndCodepoint ; sb . append ( s , pos , amp ) . appendCodePoint ( codepoint ) ; pos = end ; amp = s . indexOf ( '&' , end ) ; } sb . append ( s , pos , n ) ; } stripBannedCodeunits ( sb , firstAmp < 0 ? safeLimit : safeLimit < 0 ? firstAmp : Math . min ( firstAmp , safeLimit ) ) ; return sb . toString ( ) ;
public class cacheforwardproxy { /** * Use this API to add cacheforwardproxy . */ public static base_response add ( nitro_service client , cacheforwardproxy resource ) throws Exception { } }
cacheforwardproxy addresource = new cacheforwardproxy ( ) ; addresource . ipaddress = resource . ipaddress ; addresource . port = resource . port ; return addresource . add_resource ( client ) ;
public class PersistentState { /** * Set the state of parsing for a particular log file . * @ param state the ParseState to set */ public static void setState ( ParseState state ) { } }
if ( state == null ) { System . err . println ( "Null state found" ) ; Environment . logInfo ( "Null state found" ) ; } persData . setProperty ( state . filename , state . firstLine + SEPARATOR + state . offset ) ;
public class AbstractJaxWsWebEndpoint { /** * Configure common endpoint properties * @ param endpointInfo */ protected void configureEndpointInfoProperties ( EndpointInfo libertyEndpointInfo , org . apache . cxf . service . model . EndpointInfo cxfEndpointInfo ) { } }
// Disable jaxb validation event handler , as IBM FastPath does not support this , which will finally fallback to RI unmarshall cxfEndpointInfo . setProperty ( SET_JAXB_VALIDATION_EVENT_HANDLER , false ) ; // Set autoRewriteSoapAddressForAllServices with true by default , which will override all the services in the target WSDL file cxfEndpointInfo . setProperty ( WSDLGetUtils . AUTO_REWRITE_ADDRESS_ALL , true ) ; // Set WSDL _ DESCRIPTION property try { String wsdlLocation = libertyEndpointInfo . getWsdlLocation ( ) ; if ( wsdlLocation != null && ! ( wsdlLocation . isEmpty ( ) ) ) { URI wsdlDescription = new URI ( wsdlLocation ) ; cxfEndpointInfo . setProperty ( "URI" , wsdlDescription ) ; } } catch ( URISyntaxException e ) { // donothing } Map < String , String > endpointProperties = libertyEndpointInfo . getEndpointProperties ( ) ; if ( endpointProperties != null && ! endpointProperties . isEmpty ( ) ) { for ( Entry < String , String > entry : endpointProperties . entrySet ( ) ) { cxfEndpointInfo . setProperty ( entry . getKey ( ) , entry . getValue ( ) ) ; } }
public class CommerceDiscountUsageEntryLocalServiceUtil { /** * Adds the commerce discount usage entry to the database . Also notifies the appropriate model listeners . * @ param commerceDiscountUsageEntry the commerce discount usage entry * @ return the commerce discount usage entry that was added */ public static com . liferay . commerce . discount . model . CommerceDiscountUsageEntry addCommerceDiscountUsageEntry ( com . liferay . commerce . discount . model . CommerceDiscountUsageEntry commerceDiscountUsageEntry ) { } }
return getService ( ) . addCommerceDiscountUsageEntry ( commerceDiscountUsageEntry ) ;
public class Strings { /** * Collects object member values into an array of Strings , each prefixed by the field name . * @ param object - an object * @ param names - the names of data members of object * @ return an array of strings , each in the format of < i > & lt ; member - name & gt ; : & lt ; member - value & gt ; < / i > */ public static String [ ] collect ( Object object , String ... names ) { } }
return collect ( null , 0 , "" , object , ':' , names ) ;
public class HttpOutputStreamEE7 { /** * @ see java . io . OutputStream # flush ( ) */ @ Override public void flush ( ) throws IOException { } }
if ( _callback != null ) { if ( ! this . _isReady ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Cannot flush stream , output not ready: " + this ) ; } return ; } else { validate ( ) ; flushBuffers ( ) ; } } else { super . flush ( ) ; }
public class TransferManager { /** * Schedules a new transfer to copy data from one Amazon S3 location to * another Amazon S3 location . This method is non - blocking and returns * immediately ( i . e . before the copy has finished ) . * Note : You need to use this method if the { @ link TransferManager } is created with * a regional S3 client and the source & destination buckets are in different regions . * < code > TransferManager < / code > doesn ' t support copying of encrypted objects * whose encryption materials are stored in an instruction file . * Use the returned < code > Copy < / code > object to check if the copy is * complete . * If resources are available , the copy request will begin immediately . * Otherwise , the copy is scheduled and started as soon as resources become * available . * @ param copyObjectRequest The request containing all the parameters for the copy . * @ param srcS3 An AmazonS3 client constructed for the region in which the source * object ' s bucket is located . * @ param stateChangeListener The transfer state change listener to monitor the copy request * @ return A new < code > Copy < / code > object to use to check the state of the * copy request being processed . * @ throws AmazonClientException If any errors are encountered in the client while making the * request or handling the response . * @ throws AmazonServiceException If any errors occurred in Amazon S3 while processing the * request . */ public Copy copy ( final CopyObjectRequest copyObjectRequest , final AmazonS3 srcS3 , final TransferStateChangeListener stateChangeListener ) throws AmazonServiceException , AmazonClientException { } }
appendSingleObjectUserAgent ( copyObjectRequest ) ; assertParameterNotNull ( copyObjectRequest . getSourceBucketName ( ) , "The source bucket name must be specified when a copy request is initiated." ) ; assertParameterNotNull ( copyObjectRequest . getSourceKey ( ) , "The source object key must be specified when a copy request is initiated." ) ; assertParameterNotNull ( copyObjectRequest . getDestinationBucketName ( ) , "The destination bucket name must be specified when a copy request is initiated." ) ; assertParameterNotNull ( copyObjectRequest . getDestinationKey ( ) , "The destination object key must be specified when a copy request is initiated." ) ; assertParameterNotNull ( srcS3 , "The srcS3 parameter is mandatory" ) ; String description = "Copying object from " + copyObjectRequest . getSourceBucketName ( ) + "/" + copyObjectRequest . getSourceKey ( ) + " to " + copyObjectRequest . getDestinationBucketName ( ) + "/" + copyObjectRequest . getDestinationKey ( ) ; GetObjectMetadataRequest getObjectMetadataRequest = new GetObjectMetadataRequest ( copyObjectRequest . getSourceBucketName ( ) , copyObjectRequest . getSourceKey ( ) ) . withSSECustomerKey ( copyObjectRequest . getSourceSSECustomerKey ( ) ) . withRequesterPays ( copyObjectRequest . isRequesterPays ( ) ) . withVersionId ( copyObjectRequest . getSourceVersionId ( ) ) ; ObjectMetadata metadata = srcS3 . getObjectMetadata ( getObjectMetadataRequest ) ; TransferProgress transferProgress = new TransferProgress ( ) ; transferProgress . setTotalBytesToTransfer ( metadata . getContentLength ( ) ) ; ProgressListenerChain listenerChain = new ProgressListenerChain ( new TransferProgressUpdatingListener ( transferProgress ) ) ; CopyImpl copy = new CopyImpl ( description , transferProgress , listenerChain , stateChangeListener ) ; CopyCallable copyCallable = new CopyCallable ( this , executorService , copy , copyObjectRequest , metadata , listenerChain ) ; CopyMonitor watcher = CopyMonitor . create ( this , copy , executorService , copyCallable , copyObjectRequest , listenerChain ) ; copy . setMonitor ( watcher ) ; return copy ;
public class RsIterator { /** * Answer the counted size * @ return int */ protected int countedSize ( ) throws PersistenceBrokerException { } }
Query countQuery = getBroker ( ) . serviceBrokerHelper ( ) . getCountQuery ( getQueryObject ( ) . getQuery ( ) ) ; ResultSetAndStatement rsStmt ; ClassDescriptor cld = getQueryObject ( ) . getClassDescriptor ( ) ; int count = 0 ; // BRJ : do not use broker . getCount ( ) because it ' s extent - aware // the count we need here must not include extents ! if ( countQuery instanceof QueryBySQL ) { String countSql = ( ( QueryBySQL ) countQuery ) . getSql ( ) ; rsStmt = getBroker ( ) . serviceJdbcAccess ( ) . executeSQL ( countSql , cld , Query . NOT_SCROLLABLE ) ; } else { rsStmt = getBroker ( ) . serviceJdbcAccess ( ) . executeQuery ( countQuery , cld ) ; } try { if ( rsStmt . m_rs . next ( ) ) { count = rsStmt . m_rs . getInt ( 1 ) ; } } catch ( SQLException e ) { throw new PersistenceBrokerException ( e ) ; } finally { rsStmt . close ( ) ; } return count ;
public class SwiftAPIDirect { /** * Get object * @ param path path to object * @ param account Joss account wrapper object * @ param scm Swift connection manager * @ return SwiftGETResponse input stream and content length * @ throws IOException if network issues */ public static SwiftInputStreamWrapper getObject ( Path path , JossAccount account , SwiftConnectionManager scm ) throws IOException { } }
return getObject ( path , account , 0 , 0 , scm ) ;
public class AnnotatedBeanFactoryRegistry { /** * Returns a factory of the specified { @ link BeanFactoryId } . */ static Optional < AnnotatedBeanFactory < ? > > find ( @ Nullable BeanFactoryId beanFactoryId ) { } }
if ( beanFactoryId == null ) { return Optional . empty ( ) ; } final AnnotatedBeanFactory < ? > factory = factories . get ( beanFactoryId ) ; return factory != null && factory != unsupportedBeanFactory ? Optional . of ( factory ) : Optional . empty ( ) ;
public class CouchDBObjectMapper { /** * Sets the field value . * @ param entity * the entity * @ param column * the column * @ param value * the value */ private static void setFieldValue ( Object entity , Attribute column , JsonElement value ) { } }
if ( column . getJavaType ( ) . isAssignableFrom ( byte [ ] . class ) ) { PropertyAccessorHelper . set ( entity , ( Field ) column . getJavaMember ( ) , PropertyAccessorFactory . STRING . toBytes ( value . getAsString ( ) ) ) ; } else { PropertyAccessorHelper . set ( entity , ( Field ) column . getJavaMember ( ) , PropertyAccessorHelper . fromSourceToTargetClass ( column . getJavaType ( ) , String . class , value . getAsString ( ) ) ) ; }
public class XMLUtils { /** * You must pass the xml string and the tag name . This should be called for * situations where you want to get the value of a simple tag : * & lt ; age & gt ; 18 & lt ; / age & gt ; . * In this case , in order to get the 18 value we call the method like this : * getTagText ( xml , " age " ) ; and this will return 18 * The method will return the first tag it encounters . * @ param xmlString * the XML string * @ param tagName * the tag name to be searched for * @ return the value corresponding to the { @ code tagName } * @ throws ParserConfigurationException * if something goes wrong while parsing the XML * @ throws SAXException * if XML is malformed * @ throws IOException * if something goes woring when reading the file */ public String getTagText ( final String xmlString , final String tagName ) throws ParserConfigurationException , SAXException , IOException { } }
NodeList nodes = this . getNodeList ( xmlString , tagName ) ; LOG . info ( "Elements returned = " + nodes . getLength ( ) ) ; Element element = ( Element ) nodes . item ( 0 ) ; LOG . info ( "element text = " + element . getTextContent ( ) ) ; return element . getTextContent ( ) ;
public class LocalQueueConnection { /** * / * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . common . connection . AbstractConnection # createDurableConnectionConsumer ( javax . jms . Topic , java . lang . String , java . lang . String , javax . jms . ServerSessionPool , int ) */ @ Override public ConnectionConsumer createDurableConnectionConsumer ( Topic topic , String subscriptionName , String messageSelector , ServerSessionPool sessionPool , int maxMessages ) throws JMSException { } }
throw new IllegalStateException ( "Method not available on this domain." ) ;
public class GlParticlesView { /** * { @ inheritDoc } */ public void setDensity ( @ IntRange ( from = 0 ) final int newNum ) { } }
queueEvent ( new Runnable ( ) { @ Override public void run ( ) { scene . setDensity ( newNum ) ; } } ) ;
public class DescribeHapgResult { /** * @ param hsmsPendingRegistration */ public void setHsmsPendingRegistration ( java . util . Collection < String > hsmsPendingRegistration ) { } }
if ( hsmsPendingRegistration == null ) { this . hsmsPendingRegistration = null ; return ; } this . hsmsPendingRegistration = new com . amazonaws . internal . SdkInternalList < String > ( hsmsPendingRegistration ) ;
public class JDBC4DatabaseMetaData { /** * Retrieves a description of a table ' s columns that are automatically updated when any value in a row is updated . */ @ Override public ResultSet getVersionColumns ( String catalog , String schema , String table ) throws SQLException { } }
checkClosed ( ) ; throw SQLError . noSupport ( ) ;
public class JMatrixPanel { /** * For each element in matrix , draw it as a colored square or pixel . * The color of a matrix element with value x is specified as * - H : 1 - x / scalevalue * - S : saturation * - B : 1 - x / scalevalue * @ param g1 */ public void drawDistances ( Graphics g1 ) { } }
Graphics2D g = ( Graphics2D ) g1 ; int c = matrix . getRowDimension ( ) ; int d = matrix . getColumnDimension ( ) ; float scale = getScale ( ) ; int width = Math . round ( scale ) ; for ( int i = 0 ; i < c ; i ++ ) { int ipaint = Math . round ( i * scale ) ; for ( int j = 0 ; j < d ; j ++ ) { double val = matrix . get ( i , j ) ; int jpaint = Math . round ( j * scale ) ; Color color = cellColor . getColor ( val ) ; g . setColor ( color ) ; g . fillRect ( ipaint , jpaint , width , width ) ; } }
public class Reflection { /** * fieldNames must contain only interned Strings */ public static synchronized void registerFieldsToFilter ( Class < ? > containingClass , String ... fieldNames ) { } }
fieldFilterMap = registerFilter ( fieldFilterMap , containingClass , fieldNames ) ;
public class AnnotationUtil { /** * Attempts to get the the Riak links from a domain object by looking for a * { @ literal @ RiakLinks } annotated member . * @ param < T > the domain object type * @ param container the RiakLinks container * @ param domainObject the domain object * @ return a Collection of RiakLink objects . */ public static < T > RiakLinks getLinks ( RiakLinks container , T domainObject ) { } }
return AnnotationHelper . getInstance ( ) . getLinks ( container , domainObject ) ;
public class IntentIntegrator { /** * Initiates a scan , using the specified camera , only for a certain set of barcode types , given as strings corresponding * to their names in ZXing ' s { @ code BarcodeFormat } class like " UPC _ A " . You can supply constants * like { @ link # PRODUCT _ CODE _ TYPES } for example . * @ param desiredBarcodeFormats names of { @ code BarcodeFormat } s to scan for * @ param cameraId camera ID of the camera to use . A negative value means " no preference " . * @ return the { @ link AlertDialog } that was shown to the user prompting them to download the app * if a prompt was needed , or null otherwise */ public final AlertDialog initiateScan ( Collection < String > desiredBarcodeFormats , int cameraId ) { } }
Intent intentScan = new Intent ( BS_PACKAGE + ".SCAN" ) ; intentScan . addCategory ( Intent . CATEGORY_DEFAULT ) ; // check which types of codes to scan for if ( desiredBarcodeFormats != null ) { // set the desired barcode types StringBuilder joinedByComma = new StringBuilder ( ) ; for ( String format : desiredBarcodeFormats ) { if ( joinedByComma . length ( ) > 0 ) { joinedByComma . append ( ',' ) ; } joinedByComma . append ( format ) ; } intentScan . putExtra ( "SCAN_FORMATS" , joinedByComma . toString ( ) ) ; } // check requested camera ID if ( cameraId >= 0 ) { intentScan . putExtra ( "SCAN_CAMERA_ID" , cameraId ) ; } String targetAppPackage = findTargetAppPackage ( intentScan ) ; if ( targetAppPackage == null ) { return showDownloadDialog ( ) ; } intentScan . setPackage ( targetAppPackage ) ; intentScan . addFlags ( Intent . FLAG_ACTIVITY_CLEAR_TOP ) ; intentScan . addFlags ( FLAG_NEW_DOC ) ; attachMoreExtras ( intentScan ) ; startActivityForResult ( intentScan , REQUEST_CODE ) ; return null ;
public class GlobalFileProperties { /** * Define el fichero del cual se van a leer las propiedades . * @ param filePath */ public static void setInitFilePath ( String filePath ) { } }
filePath = getPropertiesFilePath ( filePath ) ; if ( staticFileProperties == null ) { staticFileProperties = new FileProperties ( filePath ) ; } else { staticFileProperties . setInitFilePath ( filePath ) ; }
public class Mappings { /** * ( mapping ) return default value , if input value is null or empty * NOTE : all options operations will be delegate to ' base ' mapping * @ param base base mapping * @ param defaultVal default value to be used when the related input is empty * @ param constraints constraints * @ param < T > base type * @ return new created mapping */ public static < T > Mapping < T > defaultv ( Mapping < T > base , T defaultVal , Constraint ... constraints ) { } }
return optional ( base , constraints ) . map ( o -> o . orElse ( defaultVal ) ) ;
public class KeyVaultClientBaseImpl { /** * Creates a new certificate . * If this is the first version , the certificate resource is created . This operation requires the certificates / create permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param certificateName The name of the certificate . * @ param certificatePolicy The management policy for the certificate . * @ param certificateAttributes The attributes of the certificate ( optional ) . * @ param tags Application specific metadata in the form of key - value pairs . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the CertificateOperation object */ public Observable < ServiceResponse < CertificateOperation > > createCertificateWithServiceResponseAsync ( String vaultBaseUrl , String certificateName , CertificatePolicy certificatePolicy , CertificateAttributes certificateAttributes , Map < String , String > tags ) { } }
if ( vaultBaseUrl == null ) { throw new IllegalArgumentException ( "Parameter vaultBaseUrl is required and cannot be null." ) ; } if ( certificateName == null ) { throw new IllegalArgumentException ( "Parameter certificateName is required and cannot be null." ) ; } if ( this . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.apiVersion() is required and cannot be null." ) ; } Validator . validate ( certificatePolicy ) ; Validator . validate ( certificateAttributes ) ; Validator . validate ( tags ) ; CertificateCreateParameters parameters = new CertificateCreateParameters ( ) ; parameters . withCertificatePolicy ( certificatePolicy ) ; parameters . withCertificateAttributes ( certificateAttributes ) ; parameters . withTags ( tags ) ; String parameterizedHost = Joiner . on ( ", " ) . join ( "{vaultBaseUrl}" , vaultBaseUrl ) ; return service . createCertificate ( certificateName , this . apiVersion ( ) , this . acceptLanguage ( ) , parameters , parameterizedHost , this . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < CertificateOperation > > > ( ) { @ Override public Observable < ServiceResponse < CertificateOperation > > call ( Response < ResponseBody > response ) { try { ServiceResponse < CertificateOperation > clientResponse = createCertificateDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class Weld { /** * A package of the specified class will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive . * @ param scanRecursively * @ param packageClass * @ return self */ public Weld addPackage ( boolean scanRecursively , Class < ? > packageClass ) { } }
packages . add ( new PackInfo ( packageClass , scanRecursively ) ) ; return this ;
public class MediaLocationSettings { /** * Gets the securityPolicy value for this MediaLocationSettings . * @ return securityPolicy * The security policy and authentication credentials needed to * access the content in this media * location . This value is required for a valid media * location . */ public com . google . api . ads . admanager . axis . v201805 . SecurityPolicySettings getSecurityPolicy ( ) { } }
return securityPolicy ;
public class SocketChannelStream { /** * Closes the underlying sockets and socket streams . */ @ Override public void close ( ) throws IOException { } }
SocketChannel s = _s ; _s = null ; if ( s != null ) { s . close ( ) ; } /* OutputStream os = _ os ; _ os = null ; InputStream is = _ is ; _ is = null ; try { if ( os ! = null ) os . close ( ) ; if ( is ! = null ) is . close ( ) ; } finally { if ( s ! = null ) s . close ( ) ; */
public class Cache { /** * F61004.6 */ @ Override public CacheElement insertUnpinned ( Object key , Object object ) { } }
boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "insertUnpinned" , new Object [ ] { key , object } ) ; try { Bucket bucket = getOrCreateBucketForKey ( key ) ; // d739870 Element element ; synchronized ( bucket ) { element = bucket . insertByKey ( key , object ) ; // Since we ' re not pinning the element , we must update its LRU data // to prevent it from timing out immediately . element . accessedSweep = numSweeps ; } synchronized ( this ) { // ACK ! This is going to be a choke point numObjects ++ ; } return element ; } finally { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "insertUnpinned" ) ; }
public class GoogleAuthenticatorAccountCouchDbRepository { /** * Find first account for user . * @ param username username for lookup * @ return first one time token account for user */ @ View ( name = "by_username" , map = "function(doc) { if(doc.secretKey) { emit(doc.username, doc) } }" ) public CouchDbGoogleAuthenticatorAccount findOneByUsername ( final String username ) { } }
val view = createQuery ( "by_username" ) . key ( username ) . limit ( 1 ) ; try { return db . queryView ( view , CouchDbGoogleAuthenticatorAccount . class ) . stream ( ) . findFirst ( ) . orElse ( null ) ; } catch ( final DocumentNotFoundException ignored ) { return null ; }
public class InterfaceEndpointsInner { /** * Creates or updates an interface endpoint in the specified resource group . * @ param resourceGroupName The name of the resource group . * @ param interfaceEndpointName The name of the interface endpoint . * @ param parameters Parameters supplied to the create or update interface endpoint operation * @ 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 < InterfaceEndpointInner > createOrUpdateAsync ( String resourceGroupName , String interfaceEndpointName , InterfaceEndpointInner parameters , final ServiceCallback < InterfaceEndpointInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , interfaceEndpointName , parameters ) , serviceCallback ) ;
public class StatementExecutor { /** * Initialize executor . * @ param routeResult route result * @ throws SQLException SQL exception */ public void init ( final SQLRouteResult routeResult ) throws SQLException { } }
setSqlStatement ( routeResult . getSqlStatement ( ) ) ; getExecuteGroups ( ) . addAll ( obtainExecuteGroups ( routeResult . getRouteUnits ( ) ) ) ; cacheStatements ( ) ;
public class OrientedBox3f { /** * Set the second axis of the box . * The third axis is updated to be perpendicular to the two other axis . * @ param x - the new values for the second axis . * @ param y - the new values for the second axis . * @ param z - the new values for the second axis . */ @ Override public void setSecondAxis ( double x , double y , double z ) { } }
setSecondAxis ( x , y , z , getSecondAxisExtent ( ) ) ;
public class TimeEstimate { /** * Gets the estimated time to crack formatted as a string . * @ param result a { @ code Result } object to estimate time to crack for . * @ param guess _ type a { @ code String } representing the estimate type to get time to crack for ( defined in { @ code Configuration } . * @ return time estimated to crack as a { @ code String } ( instant , seconds , minutes , hours , days , months , years , centuries , infinite ) . */ public static String getTimeToCrackFormatted ( final Result result , final String guess_type ) { } }
ResourceBundle mainResource = result . getConfiguration ( ) . getMainResource ( ) ; BigDecimal seconds = getTimeToCrack ( result , guess_type ) ; BigDecimal minutes = new BigDecimal ( 60 ) ; BigDecimal hours = minutes . multiply ( new BigDecimal ( 60 ) ) ; BigDecimal days = hours . multiply ( new BigDecimal ( 24 ) ) ; BigDecimal months = days . multiply ( new BigDecimal ( 30 ) ) ; BigDecimal years = months . multiply ( new BigDecimal ( 12 ) ) ; BigDecimal centuries = years . multiply ( new BigDecimal ( 100 ) ) ; BigDecimal infinite = centuries . multiply ( new BigDecimal ( 100000 ) ) ; if ( seconds . divide ( infinite , 0 , BigDecimal . ROUND_FLOOR ) . compareTo ( BigDecimal . ONE ) >= 0 ) { return mainResource . getString ( "main.estimate.greaterCenturies" ) ; } else if ( seconds . divide ( centuries , 0 , BigDecimal . ROUND_FLOOR ) . compareTo ( BigDecimal . ONE ) >= 0 ) { return seconds . divide ( centuries , 0 , BigDecimal . ROUND_FLOOR ) + " " + mainResource . getString ( "main.estimate.centuries" ) ; } else if ( seconds . divide ( years , 0 , BigDecimal . ROUND_FLOOR ) . compareTo ( BigDecimal . ONE ) >= 0 ) { return seconds . divide ( years , 0 , BigDecimal . ROUND_FLOOR ) + " " + mainResource . getString ( "main.estimate.years" ) ; } else if ( seconds . divide ( months , 0 , BigDecimal . ROUND_FLOOR ) . compareTo ( BigDecimal . ONE ) >= 0 ) { return seconds . divide ( months , 0 , BigDecimal . ROUND_FLOOR ) + " " + mainResource . getString ( "main.estimate.months" ) ; } else if ( seconds . divide ( days , 0 , BigDecimal . ROUND_FLOOR ) . compareTo ( BigDecimal . ONE ) >= 0 ) { return seconds . divide ( days , 0 , BigDecimal . ROUND_FLOOR ) + " " + mainResource . getString ( "main.estimate.days" ) ; } else if ( seconds . divide ( hours , 0 , BigDecimal . ROUND_FLOOR ) . compareTo ( BigDecimal . ONE ) >= 0 ) { return seconds . divide ( hours , 0 , BigDecimal . ROUND_FLOOR ) + " " + mainResource . getString ( "main.estimate.hours" ) ; } else if ( seconds . divide ( minutes , 0 , BigDecimal . ROUND_FLOOR ) . compareTo ( BigDecimal . ONE ) >= 0 ) { return seconds . divide ( minutes , 0 , BigDecimal . ROUND_FLOOR ) + " " + mainResource . getString ( "main.estimate.minutes" ) ; } else if ( seconds . compareTo ( BigDecimal . ONE ) >= 0 ) { return seconds + " " + mainResource . getString ( "main.estimate.seconds" ) ; } else { return mainResource . getString ( "main.estimate.instant" ) ; }
public class DisasterRecoveryConfigurationsInner { /** * Fails over from the current primary server to this server . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param disasterRecoveryConfigurationName The name of the disaster recovery configuration to failover . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void failover ( String resourceGroupName , String serverName , String disasterRecoveryConfigurationName ) { } }
failoverWithServiceResponseAsync ( resourceGroupName , serverName , disasterRecoveryConfigurationName ) . toBlocking ( ) . last ( ) . body ( ) ;
public class JspUtil { /** * Utility method used by data grid related classes to create URLs . If both an action name and href are provided , * the action name will be used to construct the URL string . * @ param href the href * @ param action the action * @ param location the intra page location * @ param scope the scope into which to create the URL * @ param params a map of parameters to attach to the URL * @ param jspContext the jsp context * @ return a URL represented as a string . This URL will be correctly encoded by calling { @ link HttpServletResponse # encodeURL ( String ) } * @ throws URISyntaxException */ public static String createURL ( String href , String action , String location , String scope , Map params , JspContext jspContext ) throws URISyntaxException { } }
PageContext pageContext = getPageContext ( jspContext ) ; /* add the jpfScopeID parameter , if the scope attribute is present . */ if ( scope != null ) { if ( params == null ) params = new HashMap ( ) ; params . put ( ScopedServletUtils . SCOPE_ID_PARAM , scope ) ; } String uri = null ; if ( action != null ) uri = PageFlowTagUtils . rewriteActionURL ( pageContext , action , params , location ) ; else if ( href != null ) uri = PageFlowTagUtils . rewriteHrefURL ( pageContext , href , params , location ) ; else return ( ( HttpServletRequest ) pageContext . getRequest ( ) ) . getPathTranslated ( ) ; assert uri != null ; HttpServletResponse response = ( HttpServletResponse ) pageContext . getResponse ( ) ; return response . encodeURL ( uri ) ;
public class EntityUtilities { /** * Gets the CSNode Topic entity that is represented by the node . * @ param node The node that represents a topic entry . * @ param topicProvider The topic provider to lookup the topic entity from . * @ return The topic entity represented by the node , or null if there isn ' t one that matches . */ public static TopicWrapper getCSNodeTopicEntity ( final CSNodeWrapper node , final TopicProvider topicProvider ) { } }
if ( ! isNodeATopic ( node ) ) return null ; return topicProvider . getTopic ( node . getEntityId ( ) , node . getEntityRevision ( ) ) ;
public class WorkManagerUtil { /** * Get explicit work manager override * @ param work The work instance * @ return The override , if none return null */ public static String getWorkManager ( DistributableWork work ) { } }
if ( work != null && work instanceof WorkContextProvider ) { List < WorkContext > contexts = ( ( WorkContextProvider ) work ) . getWorkContexts ( ) ; if ( contexts != null ) { for ( WorkContext wc : contexts ) { if ( wc instanceof DistributableContext ) { DistributableContext dc = ( DistributableContext ) wc ; return dc . getWorkManager ( ) ; } else if ( wc instanceof HintsContext ) { HintsContext hc = ( HintsContext ) wc ; if ( hc . getHints ( ) . keySet ( ) . contains ( DistributableContext . WORKMANAGER ) ) { Serializable value = hc . getHints ( ) . get ( DistributableContext . WORKMANAGER ) ; if ( value != null && value instanceof String ) { return ( String ) value ; } } } } } } return null ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link IndirectEntryType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link IndirectEntryType } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/gml" , name = "indirectEntry" ) public JAXBElement < IndirectEntryType > createIndirectEntry ( IndirectEntryType value ) { } }
return new JAXBElement < IndirectEntryType > ( _IndirectEntry_QNAME , IndirectEntryType . class , null , value ) ;
public class KriptonRequestBodyCollectionConverter { /** * / * ( non - Javadoc ) * @ see retrofit2 . Converter # convert ( java . lang . Object ) */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) @ Override public RequestBody convert ( T value ) throws IOException { Buffer buffer = new Buffer ( ) ; try { binderContext . serializeCollection ( ( Collection ) value , ( Class ) clazz , buffer . outputStream ( ) ) ; return RequestBody . create ( MEDIA_TYPE , buffer . readByteString ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; return null ; } finally { buffer . close ( ) ; }
public class OneStepIterator { /** * Initialize the context values for this expression * after it is cloned . * @ param context The XPath runtime context for this * transformation . */ public void setRoot ( int context , Object environment ) { } }
super . setRoot ( context , environment ) ; if ( m_axis > - 1 ) m_iterator = m_cdtm . getAxisIterator ( m_axis ) ; m_iterator . setStartNode ( m_context ) ;
public class AbstractScheduler { /** * Collects the instances required to run the job from the given { @ link ExecutionStage } and requests them at the * loaded instance manager . * @ param executionStage * the execution stage to collect the required instances from * @ throws InstanceException * thrown if the given execution graph is already processing its final stage */ protected void requestInstances ( final ExecutionStage executionStage ) throws InstanceException { } }
final ExecutionGraph executionGraph = executionStage . getExecutionGraph ( ) ; final InstanceRequestMap instanceRequestMap = new InstanceRequestMap ( ) ; synchronized ( executionStage ) { executionStage . collectRequiredInstanceTypes ( instanceRequestMap , ExecutionState . CREATED ) ; final Iterator < Map . Entry < InstanceType , Integer > > it = instanceRequestMap . getMinimumIterator ( ) ; LOG . info ( "Requesting the following instances for job " + executionGraph . getJobID ( ) ) ; while ( it . hasNext ( ) ) { final Map . Entry < InstanceType , Integer > entry = it . next ( ) ; LOG . info ( " " + entry . getKey ( ) + " [" + entry . getValue ( ) . intValue ( ) + ", " + instanceRequestMap . getMaximumNumberOfInstances ( entry . getKey ( ) ) + "]" ) ; } if ( instanceRequestMap . isEmpty ( ) ) { return ; } this . instanceManager . requestInstance ( executionGraph . getJobID ( ) , executionGraph . getJobConfiguration ( ) , instanceRequestMap , null ) ; // Switch vertex state to assigning final ExecutionGraphIterator it2 = new ExecutionGraphIterator ( executionGraph , executionGraph . getIndexOfCurrentExecutionStage ( ) , true , true ) ; while ( it2 . hasNext ( ) ) { it2 . next ( ) . compareAndUpdateExecutionState ( ExecutionState . CREATED , ExecutionState . SCHEDULED ) ; } }
public class Geometry { /** * Sets the size of a UIObject */ public static final void setSize ( UIObject o , Rect size ) { } }
o . setPixelSize ( size . w , size . h ) ;
public class CharacterDataImpl { /** * { @ inheritDoc } */ public String substringData ( int offset , int count ) throws DOMException { } }
if ( ( offset < 0 ) || ( count < 0 ) ) { throw new DOMException ( DOMException . INDEX_SIZE_ERR , null ) ; } String data = getData ( ) ; if ( offset > data . length ( ) ) { throw new DOMException ( DOMException . INDEX_SIZE_ERR , null ) ; } if ( offset + count > data . length ( ) ) { return data . substring ( offset ) ; } else { return data . substring ( offset , offset + count ) ; }
public class CachedRender { /** * Render the cached operations . Note that this doesn ' t call the operations , but * rather calls the cached version */ public void render ( ) { } }
if ( list == - 1 ) { throw new RuntimeException ( "Attempt to render cached operations that have been destroyed" ) ; } SlickCallable . enterSafeBlock ( ) ; GL . glCallList ( list ) ; SlickCallable . leaveSafeBlock ( ) ;
public class LazyLinkingResource { /** * Return < code > true < / code > if the given feature may hold a proxy that has to be resolved . * This is supposed to be an internal hook which allows to resolve proxies even in cases * where EMF prohibits proxies , e . g . in case of opposite references . * @ since 2.4 */ protected boolean isPotentialLazyCrossReference ( EStructuralFeature feature ) { } }
return ! feature . isDerived ( ) && ! feature . isTransient ( ) && feature instanceof EReference && ( ( EReference ) feature ) . isResolveProxies ( ) ;
public class TimestampUtils { /** * Returns the SQL Date object matching the given bytes with { @ link Oid # DATE } . * @ param tz The timezone used . * @ param bytes The binary encoded date value . * @ return The parsed date object . * @ throws PSQLException If binary format could not be parsed . */ public Date toDateBin ( TimeZone tz , byte [ ] bytes ) throws PSQLException { } }
if ( bytes . length != 4 ) { throw new PSQLException ( GT . tr ( "Unsupported binary encoding of {0}." , "date" ) , PSQLState . BAD_DATETIME_FORMAT ) ; } int days = ByteConverter . int4 ( bytes , 0 ) ; if ( tz == null ) { tz = getDefaultTz ( ) ; } long secs = toJavaSecs ( days * 86400L ) ; long millis = secs * 1000L ; if ( millis <= PGStatement . DATE_NEGATIVE_SMALLER_INFINITY ) { millis = PGStatement . DATE_NEGATIVE_INFINITY ; } else if ( millis >= PGStatement . DATE_POSITIVE_SMALLER_INFINITY ) { millis = PGStatement . DATE_POSITIVE_INFINITY ; } else { // Here be dragons : backend did not provide us the timezone , so we guess the actual point in // time millis = guessTimestamp ( millis , tz ) ; } return new Date ( millis ) ;
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 6660:1 : entryRuleXImportSection returns [ EObject current = null ] : iv _ ruleXImportSection = ruleXImportSection EOF ; */ public final EObject entryRuleXImportSection ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleXImportSection = null ; try { // InternalPureXbase . g : 6660:55 : ( iv _ ruleXImportSection = ruleXImportSection EOF ) // InternalPureXbase . g : 6661:2 : iv _ ruleXImportSection = ruleXImportSection EOF { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXImportSectionRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; iv_ruleXImportSection = ruleXImportSection ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = iv_ruleXImportSection ; } match ( input , EOF , FOLLOW_2 ) ; if ( state . failed ) return current ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class Suggest { /** * clean up by deleting the documents and query options used in the example query */ public static void tearDownExample ( String host , int port , String user , String password , Authentication authType ) throws ResourceNotFoundException , ForbiddenUserException , FailedRequestException { } }
DatabaseClient client = DatabaseClientFactory . newClient ( host , port , user , password , authType ) ; XMLDocumentManager docMgr = client . newXMLDocumentManager ( ) ; for ( String filename : filenames ) { docMgr . delete ( "/example/" + filename ) ; } QueryOptionsManager optionsMgr = client . newServerConfigManager ( ) . newQueryOptionsManager ( ) ; optionsMgr . deleteOptions ( OPTIONS_NAME ) ; client . release ( ) ;
public class SearchManager { /** * Extract the username to be used in multiple queries * @ return current logged in user */ @ Produces @ LoggedIn public String extractUsername ( ) { } }
final KeycloakPrincipal principal = ( KeycloakPrincipal ) httpServletRequest . getUserPrincipal ( ) ; if ( principal != null ) { logger . debug ( "Running with Keycloak context" ) ; KeycloakSecurityContext kcSecurityContext = principal . getKeycloakSecurityContext ( ) ; return kcSecurityContext . getToken ( ) . getPreferredUsername ( ) ; } logger . debug ( "Running outside of Keycloak context" ) ; final String basicUsername = HttpBasicHelper . extractUsernameAndPasswordFromBasicHeader ( httpServletRequest ) [ 0 ] ; if ( ! basicUsername . isEmpty ( ) ) { logger . debug ( "running HttpBasic auth" ) ; return basicUsername ; } logger . debug ( "Running without any Auth context" ) ; return "admin" ; // by default , we are admin !
public class UnsupportedAvailabilityZoneException { /** * The supported Availability Zones for your account . Choose subnets in these Availability Zones for your cluster . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setValidZones ( java . util . Collection ) } or { @ link # withValidZones ( java . util . Collection ) } if you want to * override the existing values . * @ param validZones * The supported Availability Zones for your account . Choose subnets in these Availability Zones for your * cluster . * @ return Returns a reference to this object so that method calls can be chained together . */ public UnsupportedAvailabilityZoneException withValidZones ( String ... validZones ) { } }
if ( this . validZones == null ) { setValidZones ( new java . util . ArrayList < String > ( validZones . length ) ) ; } for ( String ele : validZones ) { this . validZones . add ( ele ) ; } return this ;
public class JsDocInfoParser { /** * Parse a description as a { @ code @ type } . */ public JSDocInfo parseInlineTypeDoc ( ) { } }
skipEOLs ( ) ; JsDocToken token = next ( ) ; int lineno = stream . getLineno ( ) ; int startCharno = stream . getCharno ( ) ; Node typeAst = parseParamTypeExpression ( token ) ; recordTypeNode ( lineno , startCharno , typeAst , token == JsDocToken . LEFT_CURLY ) ; JSTypeExpression expr = createJSTypeExpression ( typeAst ) ; if ( expr != null ) { jsdocBuilder . recordType ( expr ) ; jsdocBuilder . recordInlineType ( ) ; return retrieveAndResetParsedJSDocInfo ( ) ; } return null ;
public class StorageAccountsInner { /** * List SAS credentials of a storage account . * @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive . * @ param accountName The name of the storage account within the specified resource group . Storage account names must be between 3 and 24 characters in length and use numbers and lower - case letters only . * @ param parameters The parameters to provide to list SAS credentials for the storage account . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ListAccountSasResponseInner object */ public Observable < ServiceResponse < ListAccountSasResponseInner > > listAccountSASWithServiceResponseAsync ( String resourceGroupName , String accountName , AccountSasParameters parameters ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } Validator . validate ( parameters ) ; return service . listAccountSAS ( resourceGroupName , accountName , this . client . subscriptionId ( ) , parameters , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < ListAccountSasResponseInner > > > ( ) { @ Override public Observable < ServiceResponse < ListAccountSasResponseInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < ListAccountSasResponseInner > clientResponse = listAccountSASDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class JapaneseCharReplacer { /** * 半角を全角に変換する 。 * @ param text 変換対象の文字列 。 * @ return 変換後の値 。 変換対象の値がnullまたは空文字の場合は 、 そのまま返します 。 */ public String replaceToFullChar ( final String text ) { } }
if ( Utils . isEmpty ( text ) ) { return text ; } return fullCharReplacer . replace ( text ) ;
public class DCEventSource { /** * This adds a new listener to the Invalidation listener . * @ param listener The listener to be added . */ public void addListener ( InvalidationListener listener ) { } }
synchronized ( hsInvalidationListeners ) { hsInvalidationListeners . add ( listener ) ; invalidationListenerCount = hsInvalidationListeners . size ( ) ; bUpdateInvalidationListener = true ; }
public class StructureInterface { /** * Return a String representing the 2 molecules of this interface in PDB format . * If the molecule ids ( i . e . chain ids ) are the same for both molecules , then the second * one will be replaced by the next letter in alphabet ( or A for Z ) * @ return */ public String toPDB ( ) { } }
String molecId1 = getMoleculeIds ( ) . getFirst ( ) ; String molecId2 = getMoleculeIds ( ) . getSecond ( ) ; if ( molecId2 . equals ( molecId1 ) ) { // if both chains are named equally we want to still named them differently in the output pdb file // so that molecular viewers can handle properly the 2 chains as separate entities char letter = molecId1 . charAt ( 0 ) ; if ( letter != 'Z' && letter != 'z' ) { molecId2 = Character . toString ( ( char ) ( letter + 1 ) ) ; // i . e . next letter in alphabet } else { molecId2 = Character . toString ( ( char ) ( letter - 25 ) ) ; // i . e . ' A ' or ' a ' } } StringBuilder sb = new StringBuilder ( ) ; for ( Atom atom : this . molecules . getFirst ( ) ) { sb . append ( FileConvert . toPDB ( atom , molecId1 ) ) ; } sb . append ( "TER" ) ; sb . append ( System . getProperty ( "line.separator" ) ) ; for ( Atom atom : this . molecules . getSecond ( ) ) { sb . append ( FileConvert . toPDB ( atom , molecId2 ) ) ; } sb . append ( "TER" ) ; sb . append ( System . getProperty ( "line.separator" ) ) ; sb . append ( "END" ) ; sb . append ( System . getProperty ( "line.separator" ) ) ; return sb . toString ( ) ;
public class S { /** * Generate random string . * The generated string is safe to be used as filename * @ param len * @ return a random string with specified length */ public static String random ( int len ) { } }
final char [ ] chars = { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , '$' , '#' , '^' , '&' , '_' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' , 'x' , 'y' , 'z' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , 'K' , 'L' , 'M' , 'N' , 'O' , 'P' , 'Q' , 'R' , 'S' , 'T' , 'U' , 'V' , 'W' , 'X' , 'Y' , 'Z' , '~' , '!' , '@' } ; final int max = chars . length ; Random r = new Random ( ) ; StringBuilder sb = new StringBuilder ( len ) ; while ( len -- > 0 ) { int i = r . nextInt ( max ) ; sb . append ( chars [ i ] ) ; } return sb . toString ( ) ;
public class DirectUpdateDoublesSketch { /** * Puts */ @ Override void putMinValue ( final double minValue ) { } }
assert ( mem_ . getCapacity ( ) >= COMBINED_BUFFER ) ; mem_ . putDouble ( MIN_DOUBLE , minValue ) ;
public class MD5Util { /** * Converts given string to MD5 hash * @ param str str to be hashed with MD5 */ @ SuppressWarnings ( "checkstyle:magicnumber" ) public static String toMD5String ( String str ) { } }
try { MessageDigest md = MessageDigest . getInstance ( "MD5" ) ; if ( md == null || str == null ) { return null ; } byte [ ] byteData = md . digest ( str . getBytes ( Charset . forName ( "UTF-8" ) ) ) ; StringBuilder sb = new StringBuilder ( ) ; for ( byte aByteData : byteData ) { sb . append ( Integer . toString ( ( aByteData & 0xff ) + 0x100 , 16 ) . substring ( 1 ) ) ; } return sb . toString ( ) ; } catch ( NoSuchAlgorithmException ignored ) { return null ; }
public class PackageIndexWriter { /** * Adds list of packages in the index table . Generate link to each package . * @ param packages Packages to which link is to be generated * @ param tbody the documentation tree to which the list will be added */ protected void addPackagesList ( PackageDoc [ ] packages , Content tbody ) { } }
for ( int i = 0 ; i < packages . length ; i ++ ) { if ( packages [ i ] != null && packages [ i ] . name ( ) . length ( ) > 0 ) { if ( configuration . nodeprecated && Util . isDeprecated ( packages [ i ] ) ) continue ; Content packageLinkContent = getPackageLink ( packages [ i ] , getPackageName ( packages [ i ] ) ) ; Content tdPackage = HtmlTree . TD ( HtmlStyle . colFirst , packageLinkContent ) ; HtmlTree tdSummary = new HtmlTree ( HtmlTag . TD ) ; tdSummary . addStyle ( HtmlStyle . colLast ) ; addSummaryComment ( packages [ i ] , tdSummary ) ; HtmlTree tr = HtmlTree . TR ( tdPackage ) ; tr . addContent ( tdSummary ) ; if ( i % 2 == 0 ) tr . addStyle ( HtmlStyle . altColor ) ; else tr . addStyle ( HtmlStyle . rowColor ) ; tbody . addContent ( tr ) ; } }
public class DelayInformationManager { /** * Get Delayed Delivery information . This method first looks for a PacketExtension with the * XEP - 203 namespace and falls back to the XEP - 91 namespace . * @ param packet * @ return the Delayed Delivery information or < code > null < / code > */ public static DelayInformation getDelayInformation ( Stanza packet ) { } }
DelayInformation delayInformation = getXep203DelayInformation ( packet ) ; if ( delayInformation != null ) { return delayInformation ; } return getLegacyDelayInformation ( packet ) ;
public class ClassInfo { /** * Convert an ASM access mask to a reflection Modifier mask . * @ param asmAccessMask the ASM access mask * @ return the Modifier mask */ private int convertAccessMaskToModifierMask ( int asmAccessMask ) { } }
int modifier = 0 ; // Convert the ASM access info into Reflection API modifiers . if ( ( asmAccessMask & Opcodes . ACC_FINAL ) != 0 ) modifier |= Modifier . FINAL ; if ( ( asmAccessMask & Opcodes . ACC_NATIVE ) != 0 ) modifier |= Modifier . NATIVE ; if ( ( asmAccessMask & Opcodes . ACC_INTERFACE ) != 0 ) modifier |= Modifier . INTERFACE ; if ( ( asmAccessMask & Opcodes . ACC_ABSTRACT ) != 0 ) modifier |= Modifier . ABSTRACT ; if ( ( asmAccessMask & Opcodes . ACC_PRIVATE ) != 0 ) modifier |= Modifier . PRIVATE ; if ( ( asmAccessMask & Opcodes . ACC_PROTECTED ) != 0 ) modifier |= Modifier . PROTECTED ; if ( ( asmAccessMask & Opcodes . ACC_PUBLIC ) != 0 ) modifier |= Modifier . PUBLIC ; if ( ( asmAccessMask & Opcodes . ACC_STATIC ) != 0 ) modifier |= Modifier . STATIC ; if ( ( asmAccessMask & Opcodes . ACC_STRICT ) != 0 ) modifier |= Modifier . STRICT ; if ( ( asmAccessMask & Opcodes . ACC_SYNCHRONIZED ) != 0 ) modifier |= Modifier . SYNCHRONIZED ; if ( ( asmAccessMask & Opcodes . ACC_TRANSIENT ) != 0 ) modifier |= Modifier . TRANSIENT ; if ( ( asmAccessMask & Opcodes . ACC_VOLATILE ) != 0 ) modifier |= Modifier . VOLATILE ; return modifier ;
public class OrderingContextProxy { /** * owning connection which is cheap or ( ii ) from the messaging engine which is expensive . */ private void setOrderingContextProxyId ( ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setOrderingContextProxyId" ) ; final ConnectionProxy cp = getConnectionProxy ( ) ; final Short orderContext = cp . getOrderContext ( ) ; if ( orderContext != null ) { setProxyID ( orderContext . shortValue ( ) ) ; } else { create ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setOrderingContextProxyId" ) ;
public class SerDeState { /** * Common operations : */ public < T > T readObject ( Class < T > cls ) { } }
return kryo . readObject ( input , cls ) ;
public class TypeUtils { /** * Format a { @ link ParameterizedType } as a { @ link String } . * @ param p { @ code ParameterizedType } to format * @ return String * @ since 3.2 */ private static String parameterizedTypeToString ( final ParameterizedType p ) { } }
final StringBuilder buf = new StringBuilder ( ) ; final Type useOwner = p . getOwnerType ( ) ; final Class < ? > raw = ( Class < ? > ) p . getRawType ( ) ; if ( useOwner == null ) { buf . append ( raw . getName ( ) ) ; } else { if ( useOwner instanceof Class < ? > ) { buf . append ( ( ( Class < ? > ) useOwner ) . getName ( ) ) ; } else { buf . append ( useOwner . toString ( ) ) ; } buf . append ( '.' ) . append ( raw . getSimpleName ( ) ) ; } final int [ ] recursiveTypeIndexes = findRecursiveTypes ( p ) ; if ( recursiveTypeIndexes . length > 0 ) { appendRecursiveTypes ( buf , recursiveTypeIndexes , p . getActualTypeArguments ( ) ) ; } else { appendAllTo ( buf . append ( '<' ) , ", " , p . getActualTypeArguments ( ) ) . append ( '>' ) ; } return buf . toString ( ) ;
public class OlsonTimeZone { /** * Construct a GMT + 0 zone with no transitions . This is done when a * constructor fails so the resultant object is well - behaved . */ private void constructEmpty ( ) { } }
transitionCount = 0 ; transitionTimes64 = null ; typeMapData = null ; typeCount = 1 ; typeOffsets = new int [ ] { 0 , 0 } ; finalZone = null ; finalStartYear = Integer . MAX_VALUE ; finalStartMillis = Double . MAX_VALUE ; transitionRulesInitialized = false ;
public class CmsVfsDriver { /** * Appends the appropriate selection criteria related with the projectId . < p > * @ param projectId the id of the project of the resources * @ param mode the selection mode * @ param conditions buffer to append the selection criteria * @ param params list to append the selection parameters */ protected void prepareProjectCondition ( CmsUUID projectId , int mode , StringBuffer conditions , List < Object > params ) { } }
if ( ( mode & CmsDriverManager . READMODE_INCLUDE_PROJECT ) > 0 ) { // C _ READMODE _ INCLUDE _ PROJECT : add condition to match the PROJECT _ ID conditions . append ( BEGIN_INCLUDE_CONDITION ) ; conditions . append ( m_sqlManager . readQuery ( projectId , "C_RESOURCES_SELECT_BY_PROJECT_LASTMODIFIED" ) ) ; conditions . append ( END_CONDITION ) ; params . add ( projectId . toString ( ) ) ; }
public class AmazonAlexaForBusinessClient { /** * Deletes room skill parameter details by room , skill , and parameter key ID . * @ param deleteRoomSkillParameterRequest * @ return Result of the DeleteRoomSkillParameter operation returned by the service . * @ throws ConcurrentModificationException * There is a concurrent modification of resources . * @ sample AmazonAlexaForBusiness . DeleteRoomSkillParameter * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / alexaforbusiness - 2017-11-09 / DeleteRoomSkillParameter " * target = " _ top " > AWS API Documentation < / a > */ @ Override public DeleteRoomSkillParameterResult deleteRoomSkillParameter ( DeleteRoomSkillParameterRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDeleteRoomSkillParameter ( request ) ;
public class BidiGlobalDir { /** * Creates a bidi global direction that can only be determined at template runtime , by evaluating * a given source code snippet that yields a boolean value where true indicates rtl . * @ param isRtlCodeSnippet A code snippet that will evaluate at template runtime to a boolean * value indicating whether the bidi global direction is rtl . * @ param backend The current backend target . */ public static BidiGlobalDir forIsRtlCodeSnippet ( String isRtlCodeSnippet , @ Nullable String namespace , SoyBackendKind backend ) { } }
Preconditions . checkArgument ( isRtlCodeSnippet != null && isRtlCodeSnippet . length ( ) > 0 , "Bidi global direction source code snippet must be non-empty." ) ; Preconditions . checkArgument ( backend == SoyBackendKind . JS_SRC || backend == SoyBackendKind . PYTHON_SRC , "Bidi code snippets are only used in JS and Python." ) ; if ( backend == SoyBackendKind . JS_SRC ) { return new BidiGlobalDir ( isRtlCodeSnippet + "?-1:1" , namespace ) ; } else { return new BidiGlobalDir ( "-1 if " + isRtlCodeSnippet + " else 1" , namespace ) ; }
public class MessageReceiverFilterList { /** * Lookup this message listener . * This message looks through my list to see if the listener ' s filter is there . * @ param listener The listener to find . * @ return The filter for this listener ( or null if not found ) . */ public BaseMessageFilter findMessageFilter ( JMessageListener listener ) { } }
Iterator < BaseMessageFilter > iterator = m_mapFilters . values ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { BaseMessageFilter filter = iterator . next ( ) ; for ( int i = 0 ; ( filter . getMessageListener ( i ) != null ) ; i ++ ) { if ( filter . getMessageListener ( i ) == listener ) return filter ; } } return null ; // Error , not found .
public class PumpStreamHandler { /** * Creates a stream pumper to copy the given input stream to the given * output stream . * @ param is the input stream to copy from * @ param os the output stream to copy into * @ return the stream pumper thread */ protected Thread createPump ( InputStream is , OutputStream os ) { } }
return createPump ( is , os , false , false ) ;
public class ThriftKeyspaceImpl { /** * Convert a Map of options to an internal thrift keyspace definition * @ param options */ private ThriftKeyspaceDefinitionImpl toThriftKeyspaceDefinition ( final Map < String , Object > options ) { } }
ThriftKeyspaceDefinitionImpl def = new ThriftKeyspaceDefinitionImpl ( ) ; Map < String , Object > internalOptions = Maps . newHashMap ( ) ; if ( options != null ) internalOptions . putAll ( options ) ; if ( internalOptions . containsKey ( "name" ) && ! internalOptions . get ( "name" ) . equals ( getKeyspaceName ( ) ) ) { throw new RuntimeException ( String . format ( "'name' attribute must match keyspace name. Expected '%s' but got '%s'" , getKeyspaceName ( ) , internalOptions . get ( "name" ) ) ) ; } else { internalOptions . put ( "name" , getKeyspaceName ( ) ) ; } def . setFields ( internalOptions ) ; return def ;
public class ProgressBar { /** * Wraps a { @ link Spliterator } so that when iterated , a progress bar is shown to track the traversal progress . * For this function the progress bar can be fully customized by using a { @ link ProgressBarBuilder } . * @ param sp Underlying spliterator * @ param pbb An instance of a { @ link ProgressBarBuilder } */ public static < T > Spliterator < T > wrap ( Spliterator < T > sp , ProgressBarBuilder pbb ) { } }
long size = sp . getExactSizeIfKnown ( ) ; if ( size != - 1 ) pbb . setInitialMax ( size ) ; return new ProgressBarWrappedSpliterator < > ( sp , pbb . build ( ) ) ;
public class CmsColor { /** * Sets the Red , Green , and Blue color variables . < p > * @ param red valid range is 0-255 * @ param green valid range is 0-255 * @ param blue valid range is 0-255 * @ throws java . lang . Exception if something goes wrong */ public void setRGB ( int red , int green , int blue ) throws Exception { } }
if ( ( red < 0 ) || ( red > 255 ) ) { throw new Exception ( ) ; } if ( ( green < 0 ) || ( green > 255 ) ) { throw new Exception ( ) ; } if ( ( blue < 0 ) || ( blue > 255 ) ) { throw new Exception ( ) ; } m_red = ( float ) red / 255 ; m_green = ( float ) green / 255 ; m_blue = ( float ) blue / 255 ; RGBtoHSV ( m_red , m_green , m_blue ) ; setHex ( ) ;
public class Alerts { /** * 获取 { @ link Alert } 对象 , modality默认为 { @ link Modality # APPLICATION _ MODAL } , window默认为null , style默认为 { @ link * StageStyle # DECORATED } * @ param title 标题 * @ param header 信息头 * @ param content 内容 * @ param alertType { @ link AlertType } * @ return { @ link Alert } */ public static Alert getAlert ( String title , String header , String content , AlertType alertType ) { } }
return getAlert ( title , header , content , alertType , Modality . APPLICATION_MODAL , null , StageStyle . DECORATED ) ;
public class PopupMenuMouseListener { /** * Called to display the popup menu . */ protected void showPopupMenu ( MouseEvent e ) { } }
if ( onAboutToShow ( e ) ) { JPopupMenu popupToShow = getPopupMenu ( e ) ; if ( popupToShow == null ) { return ; } popupToShow . show ( e . getComponent ( ) , e . getX ( ) , e . getY ( ) ) ; popupToShow . setVisible ( true ) ; }
public class D6JavaModelGen4MySQL { /** * [ EN ] generate model class text < br > * @ param dbDefinition * @ return */ public String generateModelClass ( DBDefinition dbDefinition ) { } }
StringGrabber sgOutputModelCalssText = new StringGrabber ( ) ; sgOutputModelCalssText . append ( "@DBTable(tableName=" + DQ + dbDefinition . dbTableName + DQ + ")" ) ; sgOutputModelCalssText . newLine ( ) ; sgOutputModelCalssText . append ( "public class " + dbDefinition . javaClassName + " implements D6Model" ) ; sgOutputModelCalssText . newLine ( ) ; sgOutputModelCalssText . append ( "{" ) ; sgOutputModelCalssText . newLine ( ) ; final int columnCount = dbDefinition . columnList . size ( ) ; for ( int i = 0 ; i < columnCount ; i ++ ) { DBColumnDef column = dbDefinition . columnList . get ( i ) ; StringGrabber sg = new StringGrabber ( ) ; sg . append ( "columnName=" + DQ + column . dbColumnName + DQ ) ; sg . append ( ", " ) ; sg . append ( "columnType=" + DQ + column . dbColumnType + DQ ) ; sg . append ( ", " ) ; if ( column . isNullable ) { if ( IS_DISPLAY_THOSE_OPTIONAL_ON_DB_COLUMN ) { // NOT NEED TO SHOW sg . append ( "isNullable=" ) ; sg . append ( "true" ) ; sg . append ( ", " ) ; } } else { sg . append ( "isNullable=" ) ; sg . append ( "false" ) ; sg . append ( ", " ) ; } if ( column . isPrimaryKey ) { sg . append ( "isPrimaryKey=" ) ; sg . append ( "true" ) ; sg . append ( ", " ) ; } else { if ( IS_DISPLAY_THOSE_OPTIONAL_ON_DB_COLUMN ) { // NOT NEED TO SHOW sg . append ( "isPrimaryKey=" ) ; sg . append ( "true" ) ; sg . append ( ", " ) ; } } if ( column . isUnique ) { sg . append ( "isUnique=" ) ; sg . append ( "true" ) ; sg . append ( ", " ) ; } else { if ( IS_DISPLAY_THOSE_OPTIONAL_ON_DB_COLUMN ) { // NOT NEED TO SHOW sg . append ( "isUnique=" ) ; sg . append ( "true" ) ; sg . append ( ", " ) ; } } if ( column . isAutoIncrement ) { sg . append ( "isAutoIncrement=" ) ; sg . append ( "true" ) ; sg . append ( ", " ) ; } else { if ( IS_DISPLAY_THOSE_OPTIONAL_ON_DB_COLUMN ) { sg . append ( "isAutoIncrement=" ) ; sg . append ( "false" ) ; sg . append ( ", " ) ; } } sg . removeTail ( 2 ) ; String codeLine0 = "@DBColumn(" + sg . toString ( ) + ")" ; String codeLine1 = "public " + column . javaType + " " + column . javaField + ";" ; sgOutputModelCalssText . append ( codeLine0 ) ; sgOutputModelCalssText . newLine ( ) ; sgOutputModelCalssText . append ( codeLine1 ) ; sgOutputModelCalssText . newLine ( ) ; sgOutputModelCalssText . newLine ( ) ; } sgOutputModelCalssText . newLine ( ) ; sgOutputModelCalssText . append ( "}" ) ; return sgOutputModelCalssText . toString ( ) ;
public class PermissionEvaluator { /** * boolean overloaded form of checkAuthenticatedAccount ( permission ) */ public boolean isSecuredByPermission ( final String permission , UserIdentityContext userIdentityContext ) { } }
try { checkPermission ( permission , userIdentityContext ) ; return true ; } catch ( AuthorizationException e ) { return false ; }
public class WSJdbcObject { /** * Initialize the parent wrapper field and copy some fields from the parent wrapper . * @ param parent the parent wrapper , or NULL if initializing a connection wrapper . */ final void init ( WSJdbcObject parent ) { } }
if ( parent != null ) { parentWrapper = parent ; dsConfig = parent . dsConfig ; freeResourcesOnClose = parent . freeResourcesOnClose ; } if ( freeResourcesOnClose ) // then initialize data structures to track them { arrays = new LinkedList < Array > ( ) ; blobs = new LinkedList < Blob > ( ) ; clobs = new LinkedList < Clob > ( ) ; resources = new LinkedList < Closeable > ( ) ; xmls = new LinkedList < SQLXML > ( ) ; }
public class AbstractSpringBeanDefinitionParser { /** * < p > addPropertyReferenceFromElement . < / p > * @ param id a { @ link java . lang . String } object . * @ param element a { @ link org . w3c . dom . Element } object . * @ param bean a { @ link org . springframework . beans . factory . support . BeanDefinitionBuilder } object . */ protected void addPropertyReferenceFromElement ( String id , Element element , BeanDefinitionBuilder bean ) { } }
String beanElement = element . getAttribute ( id ) ; bean . addPropertyReference ( id , beanElement ) ;
public class CLARANS { /** * Cluster a new instance . * @ param x a new instance . * @ return the cluster label , which is the index of nearest medoid . */ @ Override public int predict ( T x ) { } }
double minDist = Double . MAX_VALUE ; int bestCluster = 0 ; for ( int i = 0 ; i < k ; i ++ ) { double dist = distance . d ( x , medoids [ i ] ) ; if ( dist < minDist ) { minDist = dist ; bestCluster = i ; } } return bestCluster ;
public class CPAttachmentFileEntryPersistenceImpl { /** * Returns all the cp attachment file entries where classNameId = & # 63 ; and classPK = & # 63 ; and type = & # 63 ; and status = & # 63 ; . * @ param classNameId the class name ID * @ param classPK the class pk * @ param type the type * @ param status the status * @ return the matching cp attachment file entries */ @ Override public List < CPAttachmentFileEntry > findByC_C_T_ST ( long classNameId , long classPK , int type , int status ) { } }
return findByC_C_T_ST ( classNameId , classPK , type , status , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class ContentSpecParser { /** * Checks to see if a line is represents a Content Specifications Level Front Matter . * @ param line The line to be checked . * @ return True if the line is a front matter declaration , otherwise false . */ protected boolean isLevelInitialContentLine ( String line ) { } }
final Matcher matcher = LEVEL_INITIAL_CONTENT_PATTERN . matcher ( line . trim ( ) . toUpperCase ( Locale . ENGLISH ) ) ; return matcher . find ( ) ;
public class CPDefinitionOptionRelLocalServiceBaseImpl { /** * Returns a range of all the cp definition option rels . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link com . liferay . portal . kernel . dao . orm . QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link com . liferay . portal . kernel . dao . orm . QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link com . liferay . commerce . product . model . impl . CPDefinitionOptionRelModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order . * @ param start the lower bound of the range of cp definition option rels * @ param end the upper bound of the range of cp definition option rels ( not inclusive ) * @ return the range of cp definition option rels */ @ Override public List < CPDefinitionOptionRel > getCPDefinitionOptionRels ( int start , int end ) { } }
return cpDefinitionOptionRelPersistence . findAll ( start , end ) ;
public class DisposeModule { /** * { @ inheritDoc } */ @ Override protected void configure ( ) { } }
final Disposer disposer = new Disposer ( ) ; bind ( Disposer . class ) . toInstance ( disposer ) ; bindListener ( getTypeMatcher ( ) , new AbstractMethodTypeListener ( getAnnotationType ( ) ) { @ Override protected < I > void hear ( final Method disposeMethod , TypeEncounter < I > encounter ) { encounter . register ( new InjectionListener < I > ( ) { public void afterInjection ( I injectee ) { disposer . register ( disposeMethod , injectee ) ; } } ) ; } } ) ;
public class Similarity { /** * Computes the Average Common Feature Rank between the two feature arrays . * Uses the top 20 features for comparison . Converts types and calls * averageCommonFeatureRank ( Vector , Vector ) * @ throws IllegalArgumentException when the length of the two vectors are * not the same . */ public static double averageCommonFeatureRank ( int [ ] a , int [ ] b ) { } }
return averageCommonFeatureRank ( Vectors . asVector ( a ) , Vectors . asVector ( b ) ) ;
public class SerialCom { /** * / * ( non - Javadoc ) * @ see javax . microedition . io . InputConnection # openDataInputStream ( ) */ DataInputStream openDataInputStream ( ) { } }
final InputStream is = getInputStream ( ) ; if ( is instanceof DataInputStream ) { return ( DataInputStream ) is ; } return new DataInputStream ( is ) ;
public class CoreBuildFilterJdbcRepository { /** * The fat join query ( dreaming of Neo4J ) defines the following columns : * < pre > * B ( BUILDS ) * PR ( PROMOTION _ RUNS ) * PL ( PROMOTION _ LEVELS ) * S ( last validation run status ) * VALIDATIONSTAMPID * VALIDATIONRUNSTATUSID * PP ( PROPERTIES ) * BDFROM ( builds linked from ) * BRFROM ( branches linked from ) * PJFROM ( projects linked from ) * PLFROM ( promotions linked from ) * BDTO ( builds linked to ) * BRTO ( branches linked to ) * PJTO ( projects linked to ) * PLTO ( promotions linked to ) * < / pre > */ @ Override public List < Build > standardFilter ( Branch branch , StandardBuildFilterData data , Function < String , PropertyType < ? > > propertyTypeAccessor ) { } }
// Query root StringBuilder tables = new StringBuilder ( "SELECT DISTINCT(B.ID) FROM BUILDS B " ) ; // Criterias StringBuilder criteria = new StringBuilder ( " WHERE B.BRANCHID = :branch" ) ; // Parameters MapSqlParameterSource params = new MapSqlParameterSource ( "branch" , branch . id ( ) ) ; Integer sinceBuildId = null ; // sincePromotionLevel String sincePromotionLevel = data . getSincePromotionLevel ( ) ; if ( StringUtils . isNotBlank ( sincePromotionLevel ) ) { // Gets the promotion level ID int promotionLevelId = structureRepository . getPromotionLevelByName ( branch , sincePromotionLevel ) . map ( Entity :: id ) . orElse ( - 1 ) ; // Gets the last build having this promotion level Integer id = findLastBuildWithPromotionLevel ( promotionLevelId ) ; if ( id != null ) { sinceBuildId = id ; } } // withPromotionLevel String withPromotionLevel = data . getWithPromotionLevel ( ) ; if ( StringUtils . isNotBlank ( withPromotionLevel ) ) { tables . append ( " LEFT JOIN PROMOTION_RUNS PR ON PR.BUILDID = B.ID" + " LEFT JOIN PROMOTION_LEVELS PL ON PL.ID = PR.PROMOTIONLEVELID" ) ; criteria . append ( " AND PL.NAME = :withPromotionLevel" ) ; params . addValue ( "withPromotionLevel" , withPromotionLevel ) ; } // afterDate LocalDate afterDate = data . getAfterDate ( ) ; if ( afterDate != null ) { criteria . append ( " AND B.CREATION >= :afterDate" ) ; params . addValue ( "afterDate" , dateTimeForDB ( afterDate . atTime ( 0 , 0 ) ) ) ; } // beforeDate LocalDate beforeDate = data . getBeforeDate ( ) ; if ( beforeDate != null ) { criteria . append ( " AND B.CREATION <= :beforeDate" ) ; params . addValue ( "beforeDate" , dateTimeForDB ( beforeDate . atTime ( 23 , 59 , 59 ) ) ) ; } // sinceValidationStamp String sinceValidationStamp = data . getSinceValidationStamp ( ) ; if ( StringUtils . isNotBlank ( sinceValidationStamp ) ) { // Gets the validation stamp ID int validationStampId = getValidationStampId ( branch , sinceValidationStamp ) ; // Gets the last build having this validation stamp and the validation status Integer id = findLastBuildWithValidationStamp ( validationStampId , data . getSinceValidationStampStatus ( ) ) ; if ( id != null ) { if ( sinceBuildId == null ) { sinceBuildId = id ; } else { sinceBuildId = Math . max ( sinceBuildId , id ) ; } } } // withValidationStamp String withValidationStamp = data . getWithValidationStamp ( ) ; if ( StringUtils . isNotBlank ( withValidationStamp ) ) { tables . append ( " LEFT JOIN (" + " SELECT R.BUILDID, R.VALIDATIONSTAMPID, VRS.VALIDATIONRUNSTATUSID " + " FROM VALIDATION_RUNS R" + " INNER JOIN VALIDATION_RUN_STATUSES VRS ON VRS.ID = (SELECT ID FROM VALIDATION_RUN_STATUSES WHERE VALIDATIONRUNID = R.ID ORDER BY ID DESC LIMIT 1)" + " AND R.ID = (SELECT MAX(ID) FROM VALIDATION_RUNS WHERE BUILDID = R.BUILDID AND VALIDATIONSTAMPID = R.VALIDATIONSTAMPID)" + " ) S ON S.BUILDID = B.ID" ) ; // Gets the validation stamp ID int validationStampId = getValidationStampId ( branch , withValidationStamp ) ; criteria . append ( " AND (S.VALIDATIONSTAMPID = :validationStampId" ) ; params . addValue ( "validationStampId" , validationStampId ) ; // withValidationStampStatus String withValidationStampStatus = data . getWithValidationStampStatus ( ) ; if ( StringUtils . isNotBlank ( withValidationStampStatus ) ) { criteria . append ( " AND S.VALIDATIONRUNSTATUSID = :withValidationStampStatus" ) ; params . addValue ( "withValidationStampStatus" , withValidationStampStatus ) ; } criteria . append ( ")" ) ; } // withProperty String withProperty = data . getWithProperty ( ) ; if ( StringUtils . isNotBlank ( withProperty ) ) { tables . append ( " LEFT JOIN PROPERTIES PP ON PP.BUILD = B.ID" ) ; criteria . append ( " AND PP.TYPE = :withProperty" ) ; params . addValue ( "withProperty" , withProperty ) ; // withPropertyValue String withPropertyValue = data . getWithPropertyValue ( ) ; if ( StringUtils . isNotBlank ( withPropertyValue ) ) { // Gets the property type PropertyType < ? > propertyType = propertyTypeAccessor . apply ( withProperty ) ; // Gets the search arguments PropertySearchArguments searchArguments = propertyType . getSearchArguments ( withPropertyValue ) ; // If defined use them if ( searchArguments != null && searchArguments . isDefined ( ) ) { PropertyJdbcRepository . prepareQueryForPropertyValue ( searchArguments , tables , criteria , params ) ; } else { // No match return Collections . emptyList ( ) ; } } } // sinceProperty String sinceProperty = data . getSinceProperty ( ) ; if ( StringUtils . isNotBlank ( sinceProperty ) ) { String sincePropertyValue = data . getSincePropertyValue ( ) ; Integer id = findLastBuildWithPropertyValue ( branch , sinceProperty , sincePropertyValue , propertyTypeAccessor ) ; if ( id != null ) { if ( sinceBuildId == null ) { sinceBuildId = id ; } else { sinceBuildId = Math . max ( sinceBuildId , id ) ; } } } // linkedFrom String linkedFrom = data . getLinkedFrom ( ) ; if ( isNotBlank ( linkedFrom ) ) { tables . append ( " LEFT JOIN BUILD_LINKS BLFROM ON BLFROM.TARGETBUILDID = B.ID" + " LEFT JOIN BUILDS BDFROM ON BDFROM.ID = BLFROM.BUILDID" + " LEFT JOIN BRANCHES BRFROM ON BRFROM.ID = BDFROM.BRANCHID" + " LEFT JOIN PROJECTS PJFROM ON PJFROM.ID = BRFROM.PROJECTID" ) ; String project = StringUtils . substringBefore ( linkedFrom , ":" ) ; criteria . append ( " AND PJFROM.NAME = :fromProject" ) ; params . addValue ( "fromProject" , project ) ; String buildPattern = StringUtils . substringAfter ( linkedFrom , ":" ) ; if ( StringUtils . isNotBlank ( buildPattern ) ) { if ( StringUtils . contains ( buildPattern , "*" ) ) { criteria . append ( " AND BDFROM.NAME LIKE :buildFrom" ) ; params . addValue ( "buildFrom" , StringUtils . replace ( buildPattern , "*" , "%" ) ) ; } else { criteria . append ( " AND BDFROM.NAME = :buildFrom" ) ; params . addValue ( "buildFrom" , buildPattern ) ; } } // linkedFromPromotion String linkedFromPromotion = data . getLinkedFromPromotion ( ) ; if ( StringUtils . isNotBlank ( linkedFromPromotion ) ) { tables . append ( " LEFT JOIN PROMOTION_RUNS PRFROM ON PRFROM.BUILDID = BDFROM.ID" + " LEFT JOIN PROMOTION_LEVELS PLFROM ON PLFROM.ID = PRFROM.PROMOTIONLEVELID" ) ; criteria . append ( " AND PLFROM.NAME = :linkedFromPromotion" ) ; params . addValue ( "linkedFromPromotion" , linkedFromPromotion ) ; } } // linkedTo String linkedTo = data . getLinkedTo ( ) ; if ( isNotBlank ( linkedTo ) ) { tables . append ( " LEFT JOIN BUILD_LINKS BLTO ON BLTO.BUILDID = B.ID" + " LEFT JOIN BUILDS BDTO ON BDTO.ID = BLTO.TARGETBUILDID" + " LEFT JOIN BRANCHES BRTO ON BRTO.ID = BDTO.BRANCHID" + " LEFT JOIN PROJECTS PJTO ON PJTO.ID = BRTO.PROJECTID" ) ; String project = StringUtils . substringBefore ( linkedTo , ":" ) ; criteria . append ( " AND PJTO.NAME = :toProject" ) ; params . addValue ( "toProject" , project ) ; String buildPattern = StringUtils . substringAfter ( linkedTo , ":" ) ; if ( StringUtils . isNotBlank ( buildPattern ) ) { if ( StringUtils . contains ( buildPattern , "*" ) ) { criteria . append ( " AND BDTO.NAME LIKE :buildTo" ) ; params . addValue ( "buildTo" , StringUtils . replace ( buildPattern , "*" , "%" ) ) ; } else { criteria . append ( " AND BDTO.NAME = :buildTo" ) ; params . addValue ( "buildTo" , buildPattern ) ; } } // linkedToPromotion String linkedToPromotion = data . getLinkedToPromotion ( ) ; if ( StringUtils . isNotBlank ( linkedToPromotion ) ) { tables . append ( " LEFT JOIN PROMOTION_RUNS PRTO ON PRTO.BUILDID = BDTO.ID" + " LEFT JOIN PROMOTION_LEVELS PLTO ON PLTO.ID = PRTO.PROMOTIONLEVELID" ) ; criteria . append ( " AND PLTO.NAME = :linkedToPromotion" ) ; params . addValue ( "linkedToPromotion" , linkedToPromotion ) ; } } // Since build ? if ( sinceBuildId != null ) { criteria . append ( " AND B.ID >= :sinceBuildId" ) ; params . addValue ( "sinceBuildId" , sinceBuildId ) ; } // Final SQL String sql = format ( "%s %s ORDER BY B.ID DESC LIMIT :count" , tables , criteria ) ; params . addValue ( "count" , data . getCount ( ) ) ; // Running the query return loadBuilds ( sql , params ) ;
public class DatasourceTemplate { /** * Execute a query that returns a single int field . */ public int queryForInt ( String sql ) throws SQLException { } }
Number number = queryForObject ( sql , Integer . class ) ; return ( number != null ? number . intValue ( ) : 0 ) ;
public class HttpRequest { /** * 设置请求方法 * @ param method HTTP方法 * @ return HttpRequest */ public HttpRequest method ( Method method ) { } }
if ( Method . PATCH == method ) { this . method = Method . POST ; this . header ( "X-HTTP-Method-Override" , "PATCH" ) ; } else { this . method = method ; } return this ;
public class BandedLinearAligner { /** * Alignment which identifies what is the highly similar part of the both sequences . * < p > Alignment is done in the way that beginning of second sequences is aligned to beginning of first * sequence . < / p > * < p > Alignment terminates when score in banded alignment matrix reaches { @ code stopPenalty } value . < / p > * < p > In other words , only left part of second sequence is to be aligned < / p > * @ param scoring scoring system * @ param seq1 first sequence * @ param seq2 second sequence * @ param offset1 offset in first sequence * @ param length1 length of first sequence ' s part to be aligned * @ param offset2 offset in second sequence * @ param length2 length of second sequence ' s part to be aligned @ param width * @ param stopPenalty alignment score value in banded alignment matrix at which alignment terminates * @ return object which contains positions at which alignment terminated and array of mutations */ public static Alignment < NucleotideSequence > alignSemiLocalLeft ( LinearGapAlignmentScoring scoring , NucleotideSequence seq1 , NucleotideSequence seq2 , int offset1 , int length1 , int offset2 , int length2 , int width , int stopPenalty ) { } }
try { int minLength = Math . min ( length1 , length2 ) + width + 1 ; length1 = Math . min ( length1 , minLength ) ; length2 = Math . min ( length2 , minLength ) ; MutationsBuilder < NucleotideSequence > mutations = new MutationsBuilder < > ( NucleotideSequence . ALPHABET ) ; BandedSemiLocalResult result = alignSemiLocalLeft0 ( scoring , seq1 , seq2 , offset1 , length1 , offset2 , length2 , width , stopPenalty , mutations , AlignmentCache . get ( ) ) ; return new Alignment < > ( seq1 , mutations . createAndDestroy ( ) , new Range ( offset1 , result . sequence1Stop + 1 ) , new Range ( offset2 , result . sequence2Stop + 1 ) , result . score ) ; } finally { AlignmentCache . release ( ) ; }
public class PdfDocument { /** * Writes the outline tree to the body of the PDF document . */ void writeOutlines ( ) throws IOException { } }
if ( rootOutline . getKids ( ) . size ( ) == 0 ) return ; outlineTree ( rootOutline ) ; writer . addToBody ( rootOutline , rootOutline . indirectReference ( ) ) ;
public class AbatisService { /** * Convert value object to sanitized SQL string * @ param value - the value object * @ return a string for use in an SQL statement * @ author Toby Kurien */ public String toSqlString ( Object value ) { } }
if ( value == null ) { return "null" ; } String val = String . valueOf ( value ) ; if ( value instanceof Integer || value instanceof Float || value instanceof Double || value instanceof Long ) { return val ; } else if ( value instanceof Boolean ) { return "'" + ( ( Boolean ) value ? "true" : "false" ) + "'" ; } else if ( value instanceof Date ) { return String . valueOf ( ( ( Date ) value ) . getTime ( ) ) ; } else { return "'" + val + "'" ; // TODO escape special characters in val here }
public class Matrix3d { /** * Set the three columns of this matrix to the supplied vectors , respectively . * @ param col0 * the first column * @ param col1 * the second column * @ param col2 * the third column * @ return this */ public Matrix3d set ( Vector3dc col0 , Vector3dc col1 , Vector3dc col2 ) { } }
this . m00 = col0 . x ( ) ; this . m01 = col0 . y ( ) ; this . m02 = col0 . z ( ) ; this . m10 = col1 . x ( ) ; this . m11 = col1 . y ( ) ; this . m12 = col1 . z ( ) ; this . m20 = col2 . x ( ) ; this . m21 = col2 . y ( ) ; this . m22 = col2 . z ( ) ; return this ;
public class Index { /** * Get several objects from this index * @ param objectIDs the array of unique identifier of objects to retrieve * @ param attributesToRetrieve contains the list of attributes to retrieve . */ public JSONObject getObjects ( List < String > objectIDs , List < String > attributesToRetrieve ) throws AlgoliaException { } }
return this . getObjects ( objectIDs , attributesToRetrieve , RequestOptions . empty ) ;
public class DescribeProvisioningParametersRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeProvisioningParametersRequest describeProvisioningParametersRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeProvisioningParametersRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeProvisioningParametersRequest . getAcceptLanguage ( ) , ACCEPTLANGUAGE_BINDING ) ; protocolMarshaller . marshall ( describeProvisioningParametersRequest . getProductId ( ) , PRODUCTID_BINDING ) ; protocolMarshaller . marshall ( describeProvisioningParametersRequest . getProvisioningArtifactId ( ) , PROVISIONINGARTIFACTID_BINDING ) ; protocolMarshaller . marshall ( describeProvisioningParametersRequest . getPathId ( ) , PATHID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }