signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Pixel { /** * Packs 8bit ARGB color components into a single 32bit integer value .
* Components larger than 8bit get truncated to 8bit .
* @ param a alpha
* @ param r red
* @ param g green
* @ param b blue
* @ return packed ARGB value
* @ see # argb _ bounded ( int , int , int , int )
* @ see # argb _ fast ( int , int , int , int )
* @ see # rgb _ bounded ( int , int , int )
* @ see # rgb ( int , int , int )
* @ see # rgb _ fast ( int , int , int )
* @ see # a ( int )
* @ see # r ( int )
* @ see # g ( int )
* @ see # b ( int )
* @ since 1.0 */
public static final int argb ( final int a , final int r , final int g , final int b ) { } } | return argb_fast ( a & 0xff , r & 0xff , g & 0xff , b & 0xff ) ; |
public class DroolsPackageImpl { /** * Creates , registers , and initializes the < b > Package < / b > for this model , and for any others upon which it depends .
* < p > This method is used to initialize { @ link DroolsPackage # eINSTANCE } when that field is accessed .
* Clients should not invoke it directly . Instead , they should simply access that field to obtain the package .
* < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ see # eNS _ URI
* @ see # createPackageContents ( )
* @ see # initializePackageContents ( )
* @ generated */
public static DroolsPackage init ( ) { } } | if ( isInited ) return ( DroolsPackage ) EPackage . Registry . INSTANCE . getEPackage ( DroolsPackage . eNS_URI ) ; // Obtain or create and register package
DroolsPackageImpl theDroolsPackage = ( DroolsPackageImpl ) ( EPackage . Registry . INSTANCE . get ( eNS_URI ) instanceof DroolsPackageImpl ? EPackage . Registry . INSTANCE . get ( eNS_URI ) : new DroolsPackageImpl ( ) ) ; isInited = true ; // Initialize simple dependencies
XMLTypePackage . eINSTANCE . eClass ( ) ; // Create package meta - data objects
theDroolsPackage . createPackageContents ( ) ; // Initialize created meta - data
theDroolsPackage . initializePackageContents ( ) ; // Register package validator
EValidator . Registry . INSTANCE . put ( theDroolsPackage , new EValidator . Descriptor ( ) { public EValidator getEValidator ( ) { return DroolsValidator . INSTANCE ; } } ) ; // Mark meta - data to indicate it can ' t be changed
theDroolsPackage . freeze ( ) ; // Update the registry and return the package
EPackage . Registry . INSTANCE . put ( DroolsPackage . eNS_URI , theDroolsPackage ) ; return theDroolsPackage ; |
public class ListDocumentVersionsResult { /** * The document versions .
* @ param documentVersions
* The document versions . */
public void setDocumentVersions ( java . util . Collection < DocumentVersionInfo > documentVersions ) { } } | if ( documentVersions == null ) { this . documentVersions = null ; return ; } this . documentVersions = new com . amazonaws . internal . SdkInternalList < DocumentVersionInfo > ( documentVersions ) ; |
public class AbstractDataDistributionType { /** * Gives the relative path corresponding to the given id of the data to find / create
* @ param dataId the id of the data to find / create
* @ return the relative path of the data to find / create */
protected String getRelativePath ( String dataId ) { } } | StringBuilder buffer = new StringBuilder ( 256 ) ; List < String > ancestors = getAncestors ( dataId ) ; for ( int i = 0 , length = ancestors . size ( ) ; i < length ; i ++ ) { buffer . append ( ancestors . get ( i ) ) ; if ( i != length - 1 ) { buffer . append ( '/' ) ; } } return buffer . toString ( ) ; |
public class MathFunctions { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > return the base 10 logarithm of a number . < / i > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > The number argument is the one to which this function is appended , < / i > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > in accordance to a post - fix notation . < / i > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > e . g . < b > n . numberProperty ( " number " ) . math ( ) . log10 ( ) < / b > < / i > < / div >
* < br / > */
public JcNumber log10 ( ) { } } | JcNumber ret = new JcNumber ( null , this . argument , new FunctionInstance ( FUNCTION . Math . LOG10 , 1 ) ) ; QueryRecorder . recordInvocationConditional ( this , "log10" , ret ) ; return ret ; |
public class SecureClassLoader { /** * Converts a { @ link java . nio . ByteBuffer ByteBuffer }
* into an instance of class { @ code Class } , with an optional CodeSource .
* Before the class can be used it must be resolved .
* If a non - null CodeSource is supplied a ProtectionDomain is
* constructed and associated with the class being defined .
* @ param name the expected name of the class , or { @ code null }
* if not known , using ' . ' and not ' / ' as the separator
* and without a trailing " . class " suffix .
* @ param b the bytes that make up the class data . The bytes from positions
* { @ code b . position ( ) } through { @ code b . position ( ) + b . limit ( ) - 1}
* should have the format of a valid class file as defined by
* < cite > The Java & trade ; Virtual Machine Specification < / cite > .
* @ param cs the associated CodeSource , or { @ code null } if none
* @ return the { @ code Class } object created from the data ,
* and optional CodeSource .
* @ exception ClassFormatError if the data did not contain a valid class
* @ exception SecurityException if an attempt is made to add this class
* to a package that contains classes that were signed by
* a different set of certificates than this class , or if
* the class name begins with " java . " .
* @ since 1.5 */
protected final Class < ? > defineClass ( String name , java . nio . ByteBuffer b , CodeSource cs ) { } } | return defineClass ( name , b , getProtectionDomain ( cs ) ) ; |
public class AbstractJaxb { /** * < p > find tag by " name " property . ( the first one in this tag ) < / p >
* @ param name
* @ param tagType
* @ param < T >
* @ return null if not found . */
public < T extends AbstractJaxb > T getByName ( String name , Class < T > tagType ) { } } | return GetByNameUtil . getByName ( ( T ) this , name , tagType ) ; |
public class X509CertImpl { /** * Get subject name as X500Principal . Overrides implementation in
* X509Certificate with a slightly more efficient version that is
* also aware of X509CertImpl mutability . */
public X500Principal getSubjectX500Principal ( ) { } } | if ( info == null ) { return null ; } try { X500Principal subject = ( X500Principal ) info . get ( X509CertInfo . SUBJECT + DOT + "x500principal" ) ; return subject ; } catch ( Exception e ) { return null ; } |
public class HttpServer { /** * Creates a new server using the passed port .
* @ param socketAddress Socket address for the server .
* @ param serverGroup Eventloop group to be used for server sockets .
* @ param clientGroup Eventloop group to be used for client sockets .
* @ param channelClass The class to be used for server channel .
* @ return A new { @ link HttpServer } */
public static HttpServer < ByteBuf , ByteBuf > newServer ( SocketAddress socketAddress , EventLoopGroup serverGroup , EventLoopGroup clientGroup , Class < ? extends ServerChannel > channelClass ) { } } | return _newServer ( TcpServer . newServer ( socketAddress , serverGroup , clientGroup , channelClass ) ) ; |
public class SegmentIntegration { /** * Upload payloads to our servers and remove them from the queue file . */
void performFlush ( ) { } } | // Conditions could have changed between enqueuing the task and when it is run .
if ( ! shouldFlush ( ) ) { return ; } logger . verbose ( "Uploading payloads in queue to Segment." ) ; int payloadsUploaded = 0 ; Client . Connection connection = null ; try { // Open a connection .
connection = client . upload ( ) ; // Write the payloads into the OutputStream .
BatchPayloadWriter writer = new BatchPayloadWriter ( connection . os ) . beginObject ( ) . beginBatchArray ( ) ; PayloadWriter payloadWriter = new PayloadWriter ( writer , crypto ) ; payloadQueue . forEach ( payloadWriter ) ; writer . endBatchArray ( ) . endObject ( ) . close ( ) ; // Don ' t use the result of QueueFiles # forEach , since we may not upload the last element .
payloadsUploaded = payloadWriter . payloadCount ; // Upload the payloads .
connection . close ( ) ; } catch ( Client . HTTPException e ) { if ( e . is4xx ( ) && e . responseCode != 429 ) { // Simply log and proceed to remove the rejected payloads from the queue .
logger . error ( e , "Payloads were rejected by server. Marked for removal." ) ; try { payloadQueue . remove ( payloadsUploaded ) ; } catch ( IOException e1 ) { logger . error ( e , "Unable to remove " + payloadsUploaded + " payload(s) from queue." ) ; } return ; } else { logger . error ( e , "Error while uploading payloads" ) ; return ; } } catch ( IOException e ) { logger . error ( e , "Error while uploading payloads" ) ; return ; } finally { closeQuietly ( connection ) ; } try { payloadQueue . remove ( payloadsUploaded ) ; } catch ( IOException e ) { logger . error ( e , "Unable to remove " + payloadsUploaded + " payload(s) from queue." ) ; return ; } logger . verbose ( "Uploaded %s payloads. %s remain in the queue." , payloadsUploaded , payloadQueue . size ( ) ) ; stats . dispatchFlush ( payloadsUploaded ) ; if ( payloadQueue . size ( ) > 0 ) { performFlush ( ) ; // Flush any remaining items .
} |
public class vpnglobal_authenticationtacacspolicy_binding { /** * Use this API to fetch filtered set of vpnglobal _ authenticationtacacspolicy _ binding resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static vpnglobal_authenticationtacacspolicy_binding [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | vpnglobal_authenticationtacacspolicy_binding obj = new vpnglobal_authenticationtacacspolicy_binding ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; vpnglobal_authenticationtacacspolicy_binding [ ] response = ( vpnglobal_authenticationtacacspolicy_binding [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class WaveUtils { /** * Writes an number into an array using 4 bytes .
* @ param value the number to write
* @ param array the byte array
* @ param offset the offset */
private static void writeInt ( int value , byte [ ] array , int offset ) { } } | for ( int i = 0 ; i < 4 ; i ++ ) { array [ offset + i ] = ( byte ) ( value >>> ( 8 * i ) ) ; } |
public class JcrURL { /** * Parses given URL and extracts repository name , workspace and path .
* @ param uri URL started with prefix . */
public void parse ( String uri ) { } } | if ( uri . startsWith ( "/" ) ) { uri = uri . substring ( 1 ) ; } int pos = uri . indexOf ( "/" ) ; if ( pos == - 1 ) { context = uri ; repository = "" ; workspace = "" ; path = "/" ; return ; } if ( pos > 0 ) { context = uri . substring ( 0 , pos ) ; uri = uri . substring ( pos + 1 ) ; } // expecting tree here
uri = uri . substring ( 5 ) ; pos = uri . indexOf ( "/ws-" ) ; repository = uri . substring ( 0 , pos ) ; uri = uri . substring ( repository . length ( ) + 1 ) ; pos = uri . indexOf ( "/" ) ; workspace = uri . substring ( 3 , pos ) ; path = uri . substring ( workspace . length ( ) + 3 ) ; |
public class AbstractThymeleafView { /** * Add a new static variable .
* These static variables are added to the context before this view
* is processed , so that they can be referenced from
* the context like any other context variables , for example :
* { @ code $ { myStaticVar } } .
* @ param name the name of the static variable
* @ param value the value of the static variable */
public void addStaticVariable ( final String name , final Object value ) { } } | if ( this . staticVariables == null ) { this . staticVariables = new HashMap < String , Object > ( 3 , 1.0f ) ; } this . staticVariables . put ( name , value ) ; |
public class LineDocLocalAnalysis { /** * / * ( non - Javadoc )
* @ see org . apache . hadoop . mapred . Mapper # map ( java . lang . Object , java . lang . Object , org . apache . hadoop . mapred . OutputCollector , org . apache . hadoop . mapred . Reporter ) */
public void map ( DocumentID key , LineDocTextAndOp value , OutputCollector < DocumentID , DocumentAndOp > output , Reporter reporter ) throws IOException { } } | DocumentAndOp . Op op = value . getOp ( ) ; Document doc = null ; Term term = null ; if ( op == DocumentAndOp . Op . INSERT || op == DocumentAndOp . Op . UPDATE ) { doc = new Document ( ) ; doc . add ( new Field ( docidFieldName , key . getText ( ) . toString ( ) , Field . Store . YES , Field . Index . UN_TOKENIZED ) ) ; doc . add ( new Field ( contentFieldName , value . getText ( ) . toString ( ) , Field . Store . NO , Field . Index . TOKENIZED ) ) ; } if ( op == DocumentAndOp . Op . DELETE || op == DocumentAndOp . Op . UPDATE ) { term = new Term ( docidFieldName , key . getText ( ) . toString ( ) ) ; } output . collect ( key , new DocumentAndOp ( op , doc , term ) ) ; |
public class AbstractRegistry { /** * { @ inheritDoc }
* @ throws CouldNotPerformException { @ inheritDoc } */
@ Override public void clear ( ) throws CouldNotPerformException { } } | lock ( ) ; try { pluginPool . beforeClear ( ) ; sandbox . clear ( ) ; entryMap . clear ( ) ; consistent = true ; } finally { unlock ( ) ; } notifyObservers ( ) ; |
public class NettyTCPMessageSender { /** * This method will write an event to the channel and then add a close
* listener which will close it after the write has completed .
* @ param channel
* @ param event */
public void closeAfterFlushingPendingWrites ( Channel channel , Event event ) { } } | if ( channel . isConnected ( ) ) { channel . write ( event ) . addListener ( ChannelFutureListener . CLOSE ) ; } else { System . err . println ( "Unable to write the Event :" + event + " to socket as channel is ot connected" ) ; } |
public class ApplicationSecurityGroupsInner { /** * Gets information about the specified application security group .
* @ param resourceGroupName The name of the resource group .
* @ param applicationSecurityGroupName The name of the application security group .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the ApplicationSecurityGroupInner object */
public Observable < ApplicationSecurityGroupInner > getByResourceGroupAsync ( String resourceGroupName , String applicationSecurityGroupName ) { } } | return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , applicationSecurityGroupName ) . map ( new Func1 < ServiceResponse < ApplicationSecurityGroupInner > , ApplicationSecurityGroupInner > ( ) { @ Override public ApplicationSecurityGroupInner call ( ServiceResponse < ApplicationSecurityGroupInner > response ) { return response . body ( ) ; } } ) ; |
public class Differential { /** * { @ inheritDoc } */
@ Override public LogValue combineBucketsForModification ( int pRevisionsToRestore , long pNewBucketKey , DataBucket [ ] pBuckets , boolean pFullDump ) { } } | // check to have only the newer version and the related fulldump to read on
checkArgument ( pBuckets . length > 0 , "At least one Databucket must be provided" ) ; // create buckets for container . .
final DataBucket [ ] returnVal = { new DataBucket ( pBuckets [ 0 ] . getBucketKey ( ) , pBuckets [ 0 ] . getLastBucketPointer ( ) ) , new DataBucket ( pNewBucketKey , pBuckets [ 0 ] . getBucketKey ( ) ) } ; // . . . iterate through the datas and check if it is stored . .
for ( int j = 0 ; j < returnVal [ 0 ] . getDatas ( ) . length ; j ++ ) { // . . . check if the data was written within the last version , if so . . .
if ( pBuckets [ 0 ] . getData ( j ) != null ) { // . . . set it in the read and write - version to be rewritten again . . .
returnVal [ 0 ] . setData ( j , pBuckets [ 0 ] . getData ( j ) ) ; returnVal [ 1 ] . setData ( j , pBuckets [ 0 ] . getData ( j ) ) ; } else if ( pBuckets . length > 1 ) { // otherwise , just store then data from the fulldump to complete read - uucket except . . .
returnVal [ 0 ] . setData ( j , pBuckets [ 1 ] . getData ( j ) ) ; // . . a fulldump becomes necessary .
if ( pFullDump ) { returnVal [ 1 ] . setData ( j , pBuckets [ 1 ] . getData ( j ) ) ; } } } // return the container
return new LogValue ( returnVal [ 0 ] , returnVal [ 1 ] ) ; |
public class GeometryTools { /** * Translates a molecule from the origin to a new point denoted by a vector .
* See comment for center ( IAtomContainer atomCon , Dimension areaDim , HashMap renderingCoordinates ) for details on coordinate sets
* @ param atomCon molecule to be translated
* @ param vector dimension that represents the translation vector */
public static void translate2D ( IAtomContainer atomCon , Vector2d vector ) { } } | for ( IAtom atom : atomCon . atoms ( ) ) { if ( atom . getPoint2d ( ) != null ) { atom . getPoint2d ( ) . add ( vector ) ; } else { logger . warn ( "Could not translate atom in 2D space" ) ; } } |
public class Configuration { /** * Get the socket address for < code > hostProperty < / code > as a
* < code > InetSocketAddress < / code > . If < code > hostProperty < / code > is
* < code > null < / code > , < code > addressProperty < / code > will be used . This
* is useful for cases where we want to differentiate between host
* bind address and address clients should use to establish connection .
* @ param hostProperty bind host property name .
* @ param addressProperty address property name .
* @ param defaultAddressValue the default value
* @ param defaultPort the default port
* @ return InetSocketAddress */
public InetSocketAddress getSocketAddr ( String hostProperty , String addressProperty , String defaultAddressValue , int defaultPort ) { } } | InetSocketAddress bindAddr = getSocketAddr ( addressProperty , defaultAddressValue , defaultPort ) ; final String host = get ( hostProperty ) ; if ( host == null || host . isEmpty ( ) ) { return bindAddr ; } return NetUtils . createSocketAddr ( host , bindAddr . getPort ( ) , hostProperty ) ; |
public class Types { /** * where */
public List < Type > freshTypeVariables ( List < Type > types ) { } } | ListBuffer < Type > result = new ListBuffer < > ( ) ; for ( Type t : types ) { if ( t . hasTag ( WILDCARD ) ) { t = t . unannotatedType ( ) ; Type bound = ( ( WildcardType ) t ) . getExtendsBound ( ) ; if ( bound == null ) bound = syms . objectType ; result . append ( new CapturedType ( capturedName , syms . noSymbol , bound , syms . botType , ( WildcardType ) t ) ) ; } else { result . append ( t ) ; } } return result . toList ( ) ; |
public class ProductPackageServiceLocator { /** * For the given interface , get the stub implementation .
* If this service has no port for the given interface ,
* then ServiceException is thrown . */
public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException { } } | try { if ( com . google . api . ads . admanager . axis . v201805 . ProductPackageServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . admanager . axis . v201805 . ProductPackageServiceSoapBindingStub _stub = new com . google . api . ads . admanager . axis . v201805 . ProductPackageServiceSoapBindingStub ( new java . net . URL ( ProductPackageServiceInterfacePort_address ) , this ) ; _stub . setPortName ( getProductPackageServiceInterfacePortWSDDServiceName ( ) ) ; return _stub ; } } catch ( java . lang . Throwable t ) { throw new javax . xml . rpc . ServiceException ( t ) ; } throw new javax . xml . rpc . ServiceException ( "There is no stub implementation for the interface: " + ( serviceEndpointInterface == null ? "null" : serviceEndpointInterface . getName ( ) ) ) ; |
public class NativeAppCallAttachmentStore { /** * Adds a number of bitmap attachment files associated with a native app call . The attachments will be
* served via { @ link NativeAppCallContentProvider # openFile ( android . net . Uri , String ) openFile } .
* @ param context the Context the call is being made from
* @ param callId the unique ID of the call
* @ param imageAttachments a Map of attachment names to Files containing the bitmaps ; the attachment names will be
* part of the URI processed by openFile
* @ throws java . io . IOException */
public void addAttachmentFilesForCall ( Context context , UUID callId , Map < String , File > imageAttachmentFiles ) { } } | Validate . notNull ( context , "context" ) ; Validate . notNull ( callId , "callId" ) ; Validate . containsNoNulls ( imageAttachmentFiles . values ( ) , "imageAttachmentFiles" ) ; Validate . containsNoNullOrEmpty ( imageAttachmentFiles . keySet ( ) , "imageAttachmentFiles" ) ; addAttachments ( context , callId , imageAttachmentFiles , new ProcessAttachment < File > ( ) { @ Override public void processAttachment ( File attachment , File outputFile ) throws IOException { FileOutputStream outputStream = new FileOutputStream ( outputFile ) ; FileInputStream inputStream = null ; try { inputStream = new FileInputStream ( attachment ) ; byte [ ] buffer = new byte [ 1024 ] ; int len ; while ( ( len = inputStream . read ( buffer ) ) > 0 ) { outputStream . write ( buffer , 0 , len ) ; } } finally { Utility . closeQuietly ( outputStream ) ; Utility . closeQuietly ( inputStream ) ; } } } ) ; |
public class TraceSummary { /** * A collection of ResponseTimeRootCause structures corresponding to the trace segments .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setResponseTimeRootCauses ( java . util . Collection ) } or
* { @ link # withResponseTimeRootCauses ( java . util . Collection ) } if you want to override the existing values .
* @ param responseTimeRootCauses
* A collection of ResponseTimeRootCause structures corresponding to the trace segments .
* @ return Returns a reference to this object so that method calls can be chained together . */
public TraceSummary withResponseTimeRootCauses ( ResponseTimeRootCause ... responseTimeRootCauses ) { } } | if ( this . responseTimeRootCauses == null ) { setResponseTimeRootCauses ( new java . util . ArrayList < ResponseTimeRootCause > ( responseTimeRootCauses . length ) ) ; } for ( ResponseTimeRootCause ele : responseTimeRootCauses ) { this . responseTimeRootCauses . add ( ele ) ; } return this ; |
public class JbcSrcValueFactory { /** * Returns an expression stub ( that points to a non - existing method ) whose return type is the
* given class . Useful for scenarios where we ' re reporting an error and just need an Expression of
* the appropriate type to be able to continue . */
static Expression stubExpression ( Class < ? > clazz ) { } } | return MethodRef . createStaticMethod ( TypeInfo . create ( "if.you.see.this.please.report.a.bug.because.an.error.message.was.swallowed" ) , new org . objectweb . asm . commons . Method ( "oops" , Type . getType ( clazz ) , new Type [ 0 ] ) ) . invoke ( ) ; |
public class GSearchDOManager { /** * Performs superclass post - initialization , then completes initialization
* using GSearch - specific parameters . */
@ Override public void postInitModule ( ) throws ModuleInitializationException { } } | super . postInitModule ( ) ; // validate required param : GSEARCH _ REST _ URL
_gSearchRESTURL = getParameter ( GSEARCH_REST_URL ) ; if ( _gSearchRESTURL == null ) { throw new ModuleInitializationException ( "Required parameter, " + GSEARCH_REST_URL + " was not specified" , getRole ( ) ) ; } else { try { new URL ( _gSearchRESTURL ) ; logger . debug ( "Configured GSearch REST URL: " + _gSearchRESTURL ) ; } catch ( MalformedURLException e ) { throw new ModuleInitializationException ( "Malformed URL given " + "for " + GSEARCH_REST_URL + " parameter: " + _gSearchRESTURL , getRole ( ) ) ; } } // validate credentials : if GSEARCH _ USERNAME is given , GSEARCH _ PASSWORD
// should also be .
String user = getParameter ( GSEARCH_USERNAME ) ; if ( user != null ) { logger . debug ( "Will authenticate to GSearch service as user: " + user ) ; String pass = getParameter ( GSEARCH_PASSWORD ) ; if ( pass != null ) { _gSearchCredentials = new UsernamePasswordCredentials ( user , pass ) ; } else { throw new ModuleInitializationException ( GSEARCH_PASSWORD + " must be specified because " + GSEARCH_USERNAME + " was specified" , getRole ( ) ) ; } } else { logger . debug ( GSEARCH_USERNAME + " unspecified; will not attempt " + "to authenticate to GSearch service" ) ; } // finally , init the http client we ' ll use
_webClientConfig = getServer ( ) . getWebClientConfig ( ) ; _webClient = new WebClient ( _webClientConfig ) ; |
public class SearchRoute { /** * Adds a parameter to the search operation
* @ param filter the filter to be added
* @ param value value of the filter to be added . String . valueOf ( ) of this Object is used for the search . */
public void addFilter ( Filter filter , Object value ) { } } | if ( filter . getParameterClass ( ) . isInstance ( value ) ) { parameters . put ( filter . repr ( ) , value ) ; } else { String msg = "You need to supply the correct parameter for the " + filter + " filter. Expecting a(n) " + filter . getParameterClass ( ) . getSimpleName ( ) ; throw new FilterParameterException ( msg ) ; } |
public class BugAccumulator { /** * Accumulate a warning at given source location .
* @ param bug
* the warning
* @ param sourceLine
* the source location */
public void accumulateBug ( BugInstance bug , SourceLineAnnotation sourceLine ) { } } | if ( sourceLine == null ) { throw new NullPointerException ( "Missing source line" ) ; } int priority = bug . getPriority ( ) ; if ( ! performAccumulation ) { bug . addSourceLine ( sourceLine ) ; } else { bug . setPriority ( Priorities . NORMAL_PRIORITY ) ; } lastBug = bug ; lastSourceLine = sourceLine ; Data d = map . get ( bug ) ; if ( d == null ) { String hash = bug . getInstanceHash ( ) ; BugInstance conflictingBug = hashes . get ( hash ) ; if ( conflictingBug != null ) { if ( conflictingBug . getPriority ( ) <= priority ) { return ; } map . remove ( conflictingBug ) ; } d = new Data ( priority , sourceLine ) ; map . put ( bug , d ) ; hashes . put ( hash , bug ) ; } else if ( d . priority > priority ) { if ( d . priority >= Priorities . LOW_PRIORITY ) { reportBug ( bug , d ) ; d . allSource . clear ( ) ; } d . priority = priority ; d . primarySource = sourceLine ; } else if ( priority >= Priorities . LOW_PRIORITY && priority > d . priority ) { bug . setPriority ( priority ) ; reporter . reportBug ( bug ) ; return ; } d . allSource . add ( sourceLine ) ; |
public class JMessageClient { /** * Update sensitive word
* @ param newWord new word
* @ param oldWord old word
* @ return No content
* @ throws APIConnectionException connect exception
* @ throws APIRequestException request exception */
public ResponseWrapper updateSensitiveWord ( String newWord , String oldWord ) throws APIConnectionException , APIRequestException { } } | return _sensitiveWordClient . updateSensitiveWord ( newWord , oldWord ) ; |
public class BaseMessageItemStream { /** * Allows the mbean , or dynamic config to set the destination limits currently used
* by this localization .
* @ param newDestLowMsgs */
public void setDestLowMsgs ( long newDestLowMsgs ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setDestLowMsgs" , Long . valueOf ( newDestLowMsgs ) ) ; setDestLimits ( _destHighMsgs , newDestLowMsgs ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setDestLowMsgs" ) ; |
public class TQAssocBean { /** * Append the properties as a comma delimited string . */
protected String properties ( TQProperty < ? > ... props ) { } } | StringBuilder selectProps = new StringBuilder ( 50 ) ; for ( int i = 0 ; i < props . length ; i ++ ) { if ( i > 0 ) { selectProps . append ( "," ) ; } selectProps . append ( props [ i ] . propertyName ( ) ) ; } return selectProps . toString ( ) ; |
public class MapViewComposite { /** * Contain logic for getting records , building marker from results
* Called on start and when filters are changed
* @ param queryResult records from query */
public void setMarkers ( QueryResult queryResult ) { } } | mapWidget . clearMarkers ( ) ; RecordList recordList = queryResult . getRecordList ( ) ; List < RecordList . Record > records = recordList . getRecords ( ) ; List < GenericMarker > markers = new ArrayList < GenericMarker > ( ) ; final MarkerCoordinateSource markerCoordinateSource1 = getMarkerCoordinateSource ( ) ; final MarkerDisplayFilter markerFilter = getMarkerDisplayFilter ( ) ; markerFilter . init ( ) ; for ( final RecordList . Record record : records ) { MapMarkerBuilder markerBuilder = new MapMarkerBuilder ( ) ; final MarkerCoordinateSource . LatitudeLongitude latitudeLongitude = markerCoordinateSource1 . process ( record ) ; double lat = latitudeLongitude . getLatitude ( ) ; double lon = latitudeLongitude . getLongitude ( ) ; if ( markerFilter . filter ( record ) ) { GenericMarker < RecordList . Record > marker = markerBuilder . setMarkerLat ( lat ) . setMarkerLon ( lon ) . setMarkerIconPathBuilder ( getMarkerIconPathBuilder ( ) ) . createMarker ( record , mapWidget ) ; marker . setupMarkerHoverLabel ( getMarkerHoverLabelBuilder ( ) ) ; marker . setupMarkerClickInfoWindow ( getMarkerClickInfoWindow ( ) ) ; marker . addClickHandler ( new GenericMarker . MarkerCallBackEventHandler < GenericMarker > ( ) { @ Override public void run ( GenericMarker sourceElement ) { clientFactory . getEventBus ( ) . fireEvent ( new MarkerClickEvent ( record ) ) ; } } ) ; markers . add ( marker ) ; } } mapWidget . setMarkers ( markers ) ; |
public class FullScanFetchStreamRequestHandler { /** * Given the key , figures out which partition on the local node hosts the key .
* @ param key
* @ return */
private Integer getKeyPartitionId ( byte [ ] key ) { } } | Integer keyPartitionId = storeInstance . getNodesPartitionIdForKey ( nodeId , key ) ; Utils . notNull ( keyPartitionId ) ; return keyPartitionId ; |
public class JsiiObject { /** * Calls a static method .
* @ param nativeClass The java class .
* @ param method The method to call .
* @ param returnType The return type .
* @ param args The method arguments .
* @ param < T > Return type .
* @ return Return value . */
@ Nullable protected static < T > T jsiiStaticCall ( final Class < ? > nativeClass , final String method , final Class < T > returnType , @ Nullable final Object ... args ) { } } | String fqn = engine . loadModuleForClass ( nativeClass ) ; return JsiiObjectMapper . treeToValue ( engine . getClient ( ) . callStaticMethod ( fqn , method , JsiiObjectMapper . valueToTree ( args ) ) , returnType ) ; |
public class LDAPConnectionService { /** * Creates a new instance of LDAPConnection , configured as required to use
* whichever encryption method is requested within guacamole . properties .
* @ return
* A new LDAPConnection instance which has already been configured to
* use the encryption method requested within guacamole . properties .
* @ throws GuacamoleException
* If an error occurs while parsing guacamole . properties , or if the
* requested encryption method is actually not implemented ( a bug ) . */
private LDAPConnection createLDAPConnection ( ) throws GuacamoleException { } } | // Map encryption method to proper connection and socket factory
EncryptionMethod encryptionMethod = confService . getEncryptionMethod ( ) ; switch ( encryptionMethod ) { // Unencrypted LDAP connection
case NONE : logger . debug ( "Connection to LDAP server without encryption." ) ; return new LDAPConnection ( ) ; // LDAP over SSL ( LDAPS )
case SSL : logger . debug ( "Connecting to LDAP server using SSL/TLS." ) ; return new LDAPConnection ( new LDAPJSSESecureSocketFactory ( ) ) ; // LDAP + STARTTLS
case STARTTLS : logger . debug ( "Connecting to LDAP server using STARTTLS." ) ; return new LDAPConnection ( new LDAPJSSEStartTLSFactory ( ) ) ; // The encryption method , though known , is not actually
// implemented . If encountered , this would be a bug .
default : throw new GuacamoleUnsupportedException ( "Unimplemented encryption method: " + encryptionMethod ) ; } |
public class ContentSpecParser { /** * Checks if a metadata line is a spec topic .
* @ param key The metadata key .
* @ param value The metadata value .
* @ return True if the line is a spec topic metadata element , otherwise false . */
private boolean isSpecTopicMetaData ( final String key , final String value ) { } } | if ( ContentSpecUtilities . isSpecTopicMetaData ( key ) ) { // Abstracts can be plain text so check an opening bracket exists
if ( key . equalsIgnoreCase ( CommonConstants . CS_ABSTRACT_TITLE ) || key . equalsIgnoreCase ( CommonConstants . CS_ABSTRACT_ALTERNATE_TITLE ) ) { final String fixedValue = value . trim ( ) . replaceAll ( "(?i)^" + key + "\\s*" , "" ) ; return fixedValue . trim ( ) . startsWith ( "[" ) ; } else { return true ; } } else { return false ; } |
public class KeyAgreement { /** * Initializes this key agreement with the given key and source of
* randomness . The given key is required to contain all the algorithm
* parameters required for this key agreement .
* < p > If the key agreement algorithm requires random bytes , it gets them
* from the given source of randomness , < code > random < / code > .
* However , if the underlying
* algorithm implementation does not require any random bytes ,
* < code > random < / code > is ignored .
* @ param key the party ' s private information . For example , in the case
* of the Diffie - Hellman key agreement , this would be the party ' s own
* Diffie - Hellman private key .
* @ param random the source of randomness
* @ exception InvalidKeyException if the given key is
* inappropriate for this key agreement , e . g . , is of the wrong type or
* has an incompatible algorithm type . */
public final void init ( Key key , SecureRandom random ) throws InvalidKeyException { } } | if ( spi != null && ( key == null || lock == null ) ) { spi . engineInit ( key , random ) ; } else { try { chooseProvider ( I_NO_PARAMS , key , null , random ) ; } catch ( InvalidAlgorithmParameterException e ) { // should never occur
throw new InvalidKeyException ( e ) ; } } /* Android - removed : this debugging mechanism is not used in Android .
if ( ! skipDebug & & pdebug ! = null ) {
pdebug . println ( " KeyAgreement . " + algorithm + " algorithm from : " +
this . provider . getName ( ) ) ; */ |
public class GetResourceMetricsResult { /** * An array of metric results , , where each array element contains all of the data points for a particular dimension .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setMetricList ( java . util . Collection ) } or { @ link # withMetricList ( java . util . Collection ) } if you want to
* override the existing values .
* @ param metricList
* An array of metric results , , where each array element contains all of the data points for a particular
* dimension .
* @ return Returns a reference to this object so that method calls can be chained together . */
public GetResourceMetricsResult withMetricList ( MetricKeyDataPoints ... metricList ) { } } | if ( this . metricList == null ) { setMetricList ( new java . util . ArrayList < MetricKeyDataPoints > ( metricList . length ) ) ; } for ( MetricKeyDataPoints ele : metricList ) { this . metricList . add ( ele ) ; } return this ; |
public class RuleCallImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case SimpleAntlrPackage . RULE_CALL__RULE : setRule ( ( String ) newValue ) ; return ; case SimpleAntlrPackage . RULE_CALL__ARGUMENTS : getArguments ( ) . clear ( ) ; getArguments ( ) . addAll ( ( Collection < ? extends Expression > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class Util { /** * Get integer type property value from a property map .
* If { @ code properties } is null or property value is null , default value is returned
* @ param properties map of properties
* @ param key property name
* @ param defaultVal default value of the property
* @ return integer value of the property , */
public static int getIntProperty ( Map < String , Object > properties , String key , int defaultVal ) { } } | if ( properties == null ) { return defaultVal ; } Object propertyVal = properties . get ( key ) ; if ( propertyVal == null ) { return defaultVal ; } if ( ! ( propertyVal instanceof Integer ) ) { throw new IllegalArgumentException ( "Property : " + key + " must be an integer" ) ; } return ( Integer ) propertyVal ; |
public class TranslationServiceClient { /** * Detects the language of text within a request .
* < p > Sample code :
* < pre > < code >
* try ( TranslationServiceClient translationServiceClient = TranslationServiceClient . create ( ) ) {
* String formattedParent = TranslationServiceClient . formatLocationName ( " [ PROJECT ] " , " [ LOCATION ] " ) ;
* String model = " " ;
* String mimeType = " " ;
* DetectLanguageResponse response = translationServiceClient . detectLanguage ( formattedParent , model , mimeType ) ;
* < / code > < / pre >
* @ param parent Optional . Only used when making regionalized call . Format :
* projects / { project - id } / locations / { location - id } .
* < p > Only custom model within the same location - id can be used . Otherwise 400 is returned .
* @ param model Optional . The language detection model to be used .
* projects / { project - id } / locations / { location - id } / models / language - detection / { model - id } If not
* specified , default will be used .
* @ param mimeType Optional . The format of the source text , for example , " text / html " ,
* " text / plain " . If left blank , the MIME type is assumed to be " text / html " .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
public final DetectLanguageResponse detectLanguage ( String parent , String model , String mimeType ) { } } | if ( ! parent . isEmpty ( ) ) { LOCATION_PATH_TEMPLATE . validate ( parent , "detectLanguage" ) ; } DetectLanguageRequest request = DetectLanguageRequest . newBuilder ( ) . setParent ( parent ) . setModel ( model ) . setMimeType ( mimeType ) . build ( ) ; return detectLanguage ( request ) ; |
public class ApacheHTTPSender { /** * Package - private methods : */
@ SuppressWarnings ( "deprecation" ) private static synchronized HttpClient initHttpClient ( final BOSHClientConfig config ) { } } | // Create and initialize HTTP parameters
org . apache . http . params . HttpParams params = new org . apache . http . params . BasicHttpParams ( ) ; org . apache . http . conn . params . ConnManagerParams . setMaxTotalConnections ( params , 100 ) ; org . apache . http . params . HttpProtocolParams . setVersion ( params , HttpVersion . HTTP_1_1 ) ; org . apache . http . params . HttpProtocolParams . setUseExpectContinue ( params , false ) ; if ( config != null && config . getProxyHost ( ) != null && config . getProxyPort ( ) != 0 ) { HttpHost proxy = new HttpHost ( config . getProxyHost ( ) , config . getProxyPort ( ) ) ; params . setParameter ( org . apache . http . conn . params . ConnRoutePNames . DEFAULT_PROXY , proxy ) ; } // Create and initialize scheme registry
org . apache . http . conn . scheme . SchemeRegistry schemeRegistry = new org . apache . http . conn . scheme . SchemeRegistry ( ) ; schemeRegistry . register ( new org . apache . http . conn . scheme . Scheme ( "http" , org . apache . http . conn . scheme . PlainSocketFactory . getSocketFactory ( ) , 80 ) ) ; org . apache . http . conn . ssl . SSLSocketFactory sslFactory = org . apache . http . conn . ssl . SSLSocketFactory . getSocketFactory ( ) ; sslFactory . setHostnameVerifier ( org . apache . http . conn . ssl . SSLSocketFactory . ALLOW_ALL_HOSTNAME_VERIFIER ) ; schemeRegistry . register ( new org . apache . http . conn . scheme . Scheme ( "https" , sslFactory , 443 ) ) ; // Create an HttpClient with the ThreadSafeClientConnManager .
// This connection manager must be used if more than one thread will
// be using the HttpClient .
org . apache . http . conn . ClientConnectionManager cm = new org . apache . http . impl . conn . tsccm . ThreadSafeClientConnManager ( params , schemeRegistry ) ; return new org . apache . http . impl . client . DefaultHttpClient ( cm , params ) ; |
public class Header { /** * Return Bitrate .
* @ return bitrate in bps and average bitrate for VBR header */
public int bitrate ( ) { } } | if ( h_vbr == true ) { return ( ( int ) ( ( h_vbr_bytes * 8 ) / ( ms_per_frame ( ) * h_vbr_frames ) ) ) * 1000 ; } else { if ( h_layer <= 0 ) return 0 ; else return bitrates [ h_version ] [ h_layer - 1 ] [ h_bitrate_index ] ; } |
public class ErrorLoggerManager { /** * Adds the error log
* @ param name The logger name */
public void addLog ( final String name ) { } } | ErrorLogger log = new ErrorLogger ( name ) ; logs . put ( name , log ) ; log . setVerboseDebug ( debugLevel ) ; |
public class ExternalFrameWriterClient { /** * Create chunks on the h2o backend . This method creates chunk in en empty frame .
* @ param frameKey name of the frame
* @ param expectedTypes expected types
* @ param chunkId chunk index
* @ param totalNumRows total number of rows which is about to be sent */
public void createChunks ( String frameKey , byte [ ] expectedTypes , int chunkId , int totalNumRows , int [ ] maxVecSizes ) throws IOException { } } | ab . put1 ( ExternalFrameHandler . INIT_BYTE ) ; ab . put1 ( ExternalFrameHandler . CREATE_FRAME ) ; ab . putStr ( frameKey ) ; this . expectedTypes = expectedTypes ; ab . putA1 ( expectedTypes ) ; ab . putA4 ( maxVecSizes ) ; ab . putInt ( totalNumRows ) ; ab . putInt ( chunkId ) ; writeToChannel ( ab , channel ) ; |
public class ObjectEnvelopeTable { /** * remove an objects entry from the object registry */
public void remove ( Object pKey ) { } } | Identity id ; if ( pKey instanceof Identity ) { id = ( Identity ) pKey ; } else { id = transaction . getBroker ( ) . serviceIdentity ( ) . buildIdentity ( pKey ) ; } mhtObjectEnvelopes . remove ( id ) ; mvOrderOfIds . remove ( id ) ; |
public class StringUtil { /** * 16進数の文字列に変換します 。
* @ param bytes
* バイトの配列
* @ return 16進数の文字列 */
public static String toHex ( final byte [ ] bytes ) { } } | if ( bytes == null ) { return "" ; } StringBuffer sb = new StringBuffer ( bytes . length * 2 ) ; for ( byte b : bytes ) { appendHex ( sb , b ) ; } return sb . toString ( ) ; |
public class DateTimeUtils { /** * Returns a LocalDateTime depending on how the date passes as argument is formatted .
* @ param date date passed as argument
* @ return the DateTime if it could parse it */
public static DateTime getJodaOrJavaDate ( final DateTimeFormatter dateFormatter , final String date ) throws Exception { } } | if ( DateTimeUtils . isDateValid ( date , dateFormatter . getLocale ( ) ) ) { DateFormat dateFormat = DateFormat . getDateTimeInstance ( DateFormat . DEFAULT , DateFormat . DEFAULT , dateFormatter . getLocale ( ) ) ; Calendar dateCalendar = GregorianCalendar . getInstance ( ) ; dateCalendar . setTime ( dateFormat . parse ( date ) ) ; return new DateTime ( dateCalendar . getTime ( ) ) ; } return new DateTime ( date ) ; |
public class LoggerFactory { /** * Return a logger named according to the name parameter using the
* statically bound { @ link ILoggerFactory } instance .
* @ param name
* The name of the logger .
* @ return logger */
public static Logger getLogger ( String name ) { } } | ILoggerFactory iLoggerFactory = getILoggerFactory ( ) ; return iLoggerFactory . getLogger ( name ) ; |
public class Types { /** * Return list of bounds of the given type variable . */
public List < Type > getBounds ( TypeVar t ) { } } | if ( t . bound . hasTag ( NONE ) ) return List . nil ( ) ; else if ( t . bound . isErroneous ( ) || ! t . bound . isCompound ( ) ) return List . of ( t . bound ) ; else if ( ( erasure ( t ) . tsym . flags ( ) & INTERFACE ) == 0 ) return interfaces ( t ) . prepend ( supertype ( t ) ) ; else // No superclass was given in bounds .
// In this case , supertype is Object , erasure is first interface .
return interfaces ( t ) ; |
public class CommsByteBuffer { /** * Puts an Xid into the Byte Buffer .
* @ param xid */
public synchronized void putXid ( Xid xid ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "putXid" , xid ) ; putInt ( xid . getFormatId ( ) ) ; putInt ( xid . getGlobalTransactionId ( ) . length ) ; put ( xid . getGlobalTransactionId ( ) ) ; putInt ( xid . getBranchQualifier ( ) . length ) ; put ( xid . getBranchQualifier ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "putXid" ) ; |
public class GitFlowReleaseFinishMojo { /** * { @ inheritDoc } */
@ Override public void execute ( ) throws MojoExecutionException , MojoFailureException { } } | validateConfiguration ( preReleaseGoals , postReleaseGoals ) ; try { // check uncommitted changes
checkUncommittedChanges ( ) ; // git for - each - ref - - format = ' % ( refname : short ) ' refs / heads / release / *
final String releaseBranch = gitFindBranches ( gitFlowConfig . getReleaseBranchPrefix ( ) , false ) . trim ( ) ; if ( StringUtils . isBlank ( releaseBranch ) ) { throw new MojoFailureException ( "There is no release branch." ) ; } else if ( StringUtils . countMatches ( releaseBranch , gitFlowConfig . getReleaseBranchPrefix ( ) ) > 1 ) { throw new MojoFailureException ( "More than one release branch exists. Cannot finish release." ) ; } // check snapshots dependencies
if ( ! allowSnapshots ) { gitCheckout ( releaseBranch ) ; checkSnapshotDependencies ( ) ; } if ( fetchRemote ) { // fetch and check remote
gitFetchRemoteAndCompare ( releaseBranch ) ; // checkout from remote if doesn ' t exist
gitFetchRemoteAndCreate ( gitFlowConfig . getDevelopmentBranch ( ) ) ; // fetch and check remote
gitFetchRemoteAndCompare ( gitFlowConfig . getDevelopmentBranch ( ) ) ; if ( notSameProdDevName ( ) ) { // checkout from remote if doesn ' t exist
gitFetchRemoteAndCreate ( gitFlowConfig . getProductionBranch ( ) ) ; // fetch and check remote
gitFetchRemoteAndCompare ( gitFlowConfig . getProductionBranch ( ) ) ; } } // git checkout release / . . .
gitCheckout ( releaseBranch ) ; if ( ! skipTestProject ) { // mvn clean test
mvnCleanTest ( ) ; } // maven goals before merge
if ( StringUtils . isNotBlank ( preReleaseGoals ) ) { mvnRun ( preReleaseGoals ) ; } String currentReleaseVersion = getCurrentProjectVersion ( ) ; Map < String , String > messageProperties = new HashMap < String , String > ( ) ; messageProperties . put ( "version" , currentReleaseVersion ) ; if ( useSnapshotInRelease && ArtifactUtils . isSnapshot ( currentReleaseVersion ) ) { String commitVersion = currentReleaseVersion . replace ( "-" + Artifact . SNAPSHOT_VERSION , "" ) ; mvnSetVersions ( commitVersion ) ; messageProperties . put ( "version" , commitVersion ) ; gitCommit ( commitMessages . getReleaseFinishMessage ( ) , messageProperties ) ; } // git checkout master
gitCheckout ( gitFlowConfig . getProductionBranch ( ) ) ; gitMerge ( releaseBranch , releaseRebase , releaseMergeNoFF , releaseMergeFFOnly , commitMessages . getReleaseFinishMergeMessage ( ) , messageProperties ) ; // get current project version from pom
final String currentVersion = getCurrentProjectVersion ( ) ; if ( ! skipTag ) { String tagVersion = currentVersion ; if ( ( tychoBuild || useSnapshotInRelease ) && ArtifactUtils . isSnapshot ( currentVersion ) ) { tagVersion = currentVersion . replace ( "-" + Artifact . SNAPSHOT_VERSION , "" ) ; } messageProperties . put ( "version" , tagVersion ) ; // git tag - a . . .
gitTag ( gitFlowConfig . getVersionTagPrefix ( ) + tagVersion , commitMessages . getTagReleaseMessage ( ) , gpgSignTag , messageProperties ) ; } // maven goals after merge
if ( StringUtils . isNotBlank ( postReleaseGoals ) ) { mvnRun ( postReleaseGoals ) ; } if ( notSameProdDevName ( ) ) { // git checkout develop
gitCheckout ( gitFlowConfig . getDevelopmentBranch ( ) ) ; // get develop version
final String developReleaseVersion = getCurrentProjectVersion ( ) ; if ( commitDevelopmentVersionAtStart && useSnapshotInRelease ) { // updating develop poms to master version to avoid merge conflicts
mvnSetVersions ( currentVersion ) ; // commit the changes
gitCommit ( commitMessages . getUpdateDevToAvoidConflictsMessage ( ) ) ; } // merge branch master into develop
gitMerge ( releaseBranch , releaseRebase , releaseMergeNoFF , false , null , null ) ; if ( commitDevelopmentVersionAtStart && useSnapshotInRelease ) { // updating develop poms version back to pre merge state
mvnSetVersions ( developReleaseVersion ) ; // commit the changes
gitCommit ( commitMessages . getUpdateDevBackPreMergeStateMessage ( ) ) ; } } if ( commitDevelopmentVersionAtStart && ! notSameProdDevName ( ) ) { getLog ( ) . warn ( "The commitDevelopmentVersionAtStart will not have effect. It can be enabled only when there are separate branches for development and production." ) ; commitDevelopmentVersionAtStart = false ; } if ( ! commitDevelopmentVersionAtStart ) { // get next snapshot version
final String nextSnapshotVersion ; if ( ! settings . isInteractiveMode ( ) && StringUtils . isNotBlank ( developmentVersion ) ) { nextSnapshotVersion = developmentVersion ; } else { GitFlowVersionInfo versionInfo = new GitFlowVersionInfo ( currentVersion ) ; if ( digitsOnlyDevVersion ) { versionInfo = versionInfo . digitsVersionInfo ( ) ; } nextSnapshotVersion = versionInfo . nextSnapshotVersion ( versionDigitToIncrement ) ; } if ( StringUtils . isBlank ( nextSnapshotVersion ) ) { throw new MojoFailureException ( "Next snapshot version is blank." ) ; } // mvn versions : set - DnewVersion = . . . - DgenerateBackupPoms = false
mvnSetVersions ( nextSnapshotVersion ) ; messageProperties . put ( "version" , nextSnapshotVersion ) ; // git commit - a - m updating for next development version
gitCommit ( commitMessages . getReleaseFinishMessage ( ) , messageProperties ) ; } if ( installProject ) { // mvn clean install
mvnCleanInstall ( ) ; } if ( pushRemote ) { gitPush ( gitFlowConfig . getProductionBranch ( ) , ! skipTag ) ; if ( notSameProdDevName ( ) ) { gitPush ( gitFlowConfig . getDevelopmentBranch ( ) , ! skipTag ) ; } if ( ! keepBranch ) { gitPushDelete ( releaseBranch ) ; } } if ( ! keepBranch ) { // git branch - d release / . . .
gitBranchDelete ( releaseBranch ) ; } } catch ( Exception e ) { throw new MojoFailureException ( "release-finish" , e ) ; } |
public class Parse { /** * Parses the specified tree - bank style parse string and return a Parse structure for that string .
* @ param parse A tree - bank style parse string .
* @ return a Parse structure for the specified tree - bank style parse string . */
public static Parse parseParse ( String parse ) { } } | StringBuffer text = new StringBuffer ( ) ; int offset = 0 ; Stack stack = new Stack ( ) ; List cons = new LinkedList ( ) ; for ( int ci = 0 , cl = parse . length ( ) ; ci < cl ; ci ++ ) { char c = parse . charAt ( ci ) ; if ( c == '(' ) { String rest = parse . substring ( ci + 1 ) ; String type = getType ( rest ) ; if ( type == null ) { System . err . println ( "null type for: " + rest ) ; } String token = getToken ( rest ) ; stack . push ( new Object [ ] { type , new Integer ( offset ) } ) ; if ( token != null && ! type . equals ( "-NONE-" ) ) { cons . add ( new Object [ ] { ParserME . TOK_NODE , new Span ( offset , offset + token . length ( ) ) } ) ; text . append ( token ) . append ( " " ) ; offset += token . length ( ) + 1 ; } } else if ( c == ')' ) { Object [ ] parts = ( Object [ ] ) stack . pop ( ) ; String type = ( String ) parts [ 0 ] ; if ( ! type . equals ( "-NONE-" ) ) { int start = ( ( Integer ) parts [ 1 ] ) . intValue ( ) ; cons . add ( new Object [ ] { parts [ 0 ] , new Span ( start , offset - 1 ) } ) ; } } } String txt = text . toString ( ) ; Parse p = new Parse ( txt , new Span ( 0 , txt . length ( ) ) , ParserME . TOP_NODE , 1 ) ; /* for ( int ti = 0 ; ti < tokens . size ( ) ; ti + + ) {
Object [ ] parts = ( Object [ ] ) cons . get ( ti ) ;
String type = ( String ) parts [ 0 ] ;
if ( ! type . equals ( ParserME . TOP _ NODE ) ) {
Parse con = new Parse ( txt , ( Span ) parts [ 1 ] , type , 1 ) ;
System . err . println ( " insert " + type + " " + con . toString ( ) ) ;
p . insert ( con ) ; */
for ( int ci = 0 ; ci < cons . size ( ) ; ci ++ ) { Object [ ] parts = ( Object [ ] ) cons . get ( ci ) ; String type = ( String ) parts [ 0 ] ; if ( ! type . equals ( ParserME . TOP_NODE ) ) { Parse con = new Parse ( txt , ( Span ) parts [ 1 ] , type , 1 ) ; // System . err . println ( " insert [ " + ci + " ] " + type + " " + con . toString ( ) + " " + con . hashCode ( ) ) ;
p . insert ( con ) ; // codeTree ( p ) ;
} } return p ; |
public class JsonExporter { /** * hide ticks if we do not show labels */
private void setTicks ( XAxis xAxis , YAxis yAxis , boolean showXLabel , boolean showYLabel ) { } } | boolean isHorizontal = chart . getType ( ) . isHorizontal ( ) ; if ( ( ! showXLabel && ! isHorizontal ) || ( ! showYLabel && isHorizontal ) ) { xAxis . setTickHeight ( 0 ) ; } if ( ( ! showYLabel && ! isHorizontal ) || ( ! showXLabel && isHorizontal ) ) { yAxis . setTickLength ( 0 ) ; } |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link SubjectMatchType } { @ code > } } */
@ XmlElementDecl ( namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os" , name = "SubjectMatch" ) public JAXBElement < SubjectMatchType > createSubjectMatch ( SubjectMatchType value ) { } } | return new JAXBElement < SubjectMatchType > ( _SubjectMatch_QNAME , SubjectMatchType . class , null , value ) ; |
public class GVRRigidBody { /** * Apply a force vector [ X , Y , Z ] to this { @ linkplain GVRRigidBody rigid body }
* on relative position
* @ param forceX force on the x - axis .
* @ param forceY force on the y - axis .
* @ param forceZ force on the z - axis .
* @ param relX relative position on x - axis to apply the force .
* @ param relY relative position on y - axis to apply the force .
* @ param relZ relative position on z - axis to apply the force . */
public void applyForce ( final float forceX , final float forceY , final float forceZ , final float relX , final float relY , final float relZ ) { } } | mPhysicsContext . runOnPhysicsThread ( new Runnable ( ) { @ Override public void run ( ) { Native3DRigidBody . applyForce ( getNative ( ) , forceX , forceY , forceZ , relX , relY , relZ ) ; } } ) ; |
public class Director { /** * Perform the installation of the determined install assets .
* @ param existsAction What action should be taken if the asset exists as an ExistsAction object
* @ param rollbackAll if features should be rolled back
* @ param downloadDependencies if dependencies for features should be downloaded
* @ throws InstallException */
public void install ( ExistsAction existsAction , boolean rollbackAll , boolean downloadDependencies ) throws InstallException { } } | if ( installAssets . isEmpty ( ) ) return ; int progress = 50 ; int interval1 = installAssets . size ( ) == 0 ? 40 : 40 / installAssets . size ( ) ; List < File > filesInstalled = new ArrayList < File > ( ) ; ChecksumsManager checksumsManager = new ChecksumsManager ( ) ; for ( List < InstallAsset > iaList : installAssets ) { int interval2 = iaList . size ( ) == 0 ? interval1 : interval1 / ( iaList . size ( ) * 2 ) ; if ( ! rollbackAll ) filesInstalled = new ArrayList < File > ( ) ; Set < String > executableFiles = new HashSet < String > ( ) ; Map < String , Set < String > > extattrFilesMap = new HashMap < String , Set < String > > ( ) ; for ( InstallAsset installAsset : iaList ) { progress += interval2 ; try { download ( progress , installAsset ) ; } catch ( InstallException e ) { InstallUtils . delete ( filesInstalled ) ; installAsset . cleanup ( ) ; throw e ; } try { fireInstallProgressEvent ( progress , installAsset ) ; } catch ( CancelException e ) { InstallUtils . delete ( filesInstalled ) ; installAsset . cleanup ( ) ; throw e ; } progress += interval2 ; try { engine . install ( installAsset , filesInstalled , getFeaturesToBeInstalled ( ) , existsAction , executableFiles , extattrFilesMap , downloadDependencies , getResolveDirector ( ) . getProxy ( ) , checksumsManager ) ; if ( installAsset . isFeature ( ) || installAsset . isAddon ( ) ) { ESAAsset esaa = ( ( ESAAsset ) installAsset ) ; if ( esaa . isPublic ( ) ) { log ( Level . FINE , installAsset . installedLogMsg ( ) ) ; } } else { log ( Level . FINE , installAsset . installedLogMsg ( ) ) ; } } catch ( InstallException e ) { log ( Level . SEVERE , e . getMessage ( ) , e ) ; throw e ; } catch ( IOException e ) { throw ExceptionUtils . create ( e ) ; } finally { installAsset . cleanup ( ) ; } } try { InstallPlatformUtils . setExecutePermissionAccordingToUmask ( executableFiles . toArray ( new String [ executableFiles . size ( ) ] ) ) ; } catch ( Exception e ) { log ( Level . WARNING , e . getMessage ( ) ) ; if ( null != e . getCause ( ) ) { log ( Level . SEVERE , null , e ) ; } log ( Level . WARNING , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_UNABLE_TO_SET_EXECUTE_PERMISSIONS" , executableFiles . toString ( ) ) ) ; } try { InstallPlatformUtils . setExtendedAttributes ( extattrFilesMap ) ; } catch ( Exception e ) { log ( Level . WARNING , e . getMessage ( ) ) ; if ( null != e . getCause ( ) ) { log ( Level . SEVERE , null , e ) ; } for ( Map . Entry < String , Set < String > > entry : extattrFilesMap . entrySet ( ) ) { String attr = entry . getKey ( ) ; log ( Level . WARNING , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_UNABLE_TO_SET_EXT_ATTR" , attr , entry . getValue ( ) . toString ( ) ) ) ; } } checkSetScriptsPermission ( filesInstalled ) ; } checksumsManager . updateChecksums ( ) ; |
public class MergedRepository { /** * Returns header information for the server this record was created on .
* @ param record instance previously return by an iterator over this merged list .
* @ return header corresponding to the < code > record < / code > . */
public Properties getHeader ( RepositoryLogRecord record ) { } } | if ( ! headerMap . containsKey ( record ) ) { throw new IllegalArgumentException ( "Record was not return by an iterator over this instance" ) ; } return headerMap . get ( record ) ; |
public class IIDImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setXCSizeD ( Integer newXCSizeD ) { } } | Integer oldXCSizeD = xcSizeD ; xcSizeD = newXCSizeD ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . IID__XC_SIZE_D , oldXCSizeD , xcSizeD ) ) ; |
public class DBCluster { /** * Contains one or more identifiers of the Read Replicas associated with this DB cluster .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setReadReplicaIdentifiers ( java . util . Collection ) } or
* { @ link # withReadReplicaIdentifiers ( java . util . Collection ) } if you want to override the existing values .
* @ param readReplicaIdentifiers
* Contains one or more identifiers of the Read Replicas associated with this DB cluster .
* @ return Returns a reference to this object so that method calls can be chained together . */
public DBCluster withReadReplicaIdentifiers ( String ... readReplicaIdentifiers ) { } } | if ( this . readReplicaIdentifiers == null ) { setReadReplicaIdentifiers ( new java . util . ArrayList < String > ( readReplicaIdentifiers . length ) ) ; } for ( String ele : readReplicaIdentifiers ) { this . readReplicaIdentifiers . add ( ele ) ; } return this ; |
public class AttrString { public static String substring ( final String str , final String beginIndex ) { } } | return str . substring ( Integer . valueOf ( beginIndex ) . intValue ( ) ) ; |
public class Interpreter { /** * Execute an Invoke bytecode instruction at a given point in the function
* or method body . This generates a recursive call to execute the given
* function . If the function does not exist , or is provided with the wrong
* number of arguments , then a runtime fault will occur .
* @ param expr
* - - - The expression to execute
* @ param frame
* - - - The current stack frame
* @ return
* @ throws ResolutionError */
private RValue [ ] executeInvoke ( Expr . Invoke expr , CallStack frame ) { } } | // Resolve function or method being invoked to a concrete declaration
Decl . Callable decl = expr . getLink ( ) . getTarget ( ) ; // Evaluate argument expressions
RValue [ ] arguments = executeExpressions ( expr . getOperands ( ) , frame ) ; // Invoke the function or method in question
RValue [ ] rs = execute ( decl . getQualifiedName ( ) , decl . getType ( ) , frame , arguments ) ; return rs ; |
public class BootstrapBorderBuilder { /** * Set the border type . Default is no border .
* @ param eType
* Border type . May not be < code > null < / code > .
* @ return this for chaining */
@ Nonnull public BootstrapBorderBuilder type ( @ Nonnull final EBootstrapBorderType eType ) { } } | ValueEnforcer . notNull ( eType , "Type" ) ; m_eType = eType ; return this ; |
public class ValidationBundle { /** * Gets the message .
* @ param class1 the class 1
* @ param string the string
* @ param compName the comp name
* @ return the message */
public static String getMessage ( final Class class1 , final String string , final String compName ) { } } | return JKMessage . get ( string , compName ) ; |
public class SynchroReader { /** * Populate time ranges .
* @ param ranges time ranges from a Synchro table
* @ param container time range container */
private void processRanges ( List < DateRange > ranges , ProjectCalendarDateRanges container ) { } } | if ( ranges != null ) { for ( DateRange range : ranges ) { container . addRange ( range ) ; } } |
public class GeometryIndexService { /** * Checks to see if a given index is the child of another index .
* @ param parentIndex The so - called parent index .
* @ param childIndex The so - called child index .
* @ return Is the second index really a child of the first index ? */
public boolean isChildOf ( GeometryIndex parentIndex , GeometryIndex childIndex ) { } } | return delegate . isChildOf ( toDelegate ( parentIndex ) , toDelegate ( childIndex ) ) ; |
public class ClientGrantsFilter { /** * Filter by page
* @ param pageNumber the page number to retrieve .
* @ param amountPerPage the amount of items per page to retrieve .
* @ return this filter instance */
public ClientGrantsFilter withPage ( int pageNumber , int amountPerPage ) { } } | parameters . put ( "page" , pageNumber ) ; parameters . put ( "per_page" , amountPerPage ) ; return this ; |
public class RoboSputnik { /** * protected HelperTestRunner getHelperTestRunner ( Class bootstrappedTestClass ) { */
protected AndroidManifest getAppManifest ( Config config ) { } } | if ( config . manifest ( ) . equals ( Config . NONE ) ) { return null ; } String manifestProperty = System . getProperty ( "android.manifest" ) ; String resourcesProperty = System . getProperty ( "android.resources" ) ; String assetsProperty = System . getProperty ( "android.assets" ) ; String packageName = System . getProperty ( "android.package" ) ; FsFile baseDir ; FsFile manifestFile ; FsFile resDir ; FsFile assetDir ; boolean defaultManifest = config . manifest ( ) . equals ( Config . DEFAULT ) ; if ( defaultManifest && manifestProperty != null ) { manifestFile = Fs . fileFromPath ( manifestProperty ) ; baseDir = manifestFile . getParent ( ) ; } else { manifestFile = getBaseDir ( ) . join ( defaultManifest ? AndroidManifest . DEFAULT_MANIFEST_NAME : config . manifest ( ) ) ; baseDir = manifestFile . getParent ( ) ; } boolean defaultRes = Config . DEFAULT_RES_FOLDER . equals ( config . resourceDir ( ) ) ; if ( defaultRes && resourcesProperty != null ) { resDir = Fs . fileFromPath ( resourcesProperty ) ; } else { resDir = baseDir . join ( config . resourceDir ( ) ) ; } boolean defaultAssets = Config . DEFAULT_ASSET_FOLDER . equals ( config . assetDir ( ) ) ; if ( defaultAssets && assetsProperty != null ) { assetDir = Fs . fileFromPath ( assetsProperty ) ; } else { assetDir = baseDir . join ( config . assetDir ( ) ) ; } String configPackageName = config . packageName ( ) ; if ( configPackageName != null && ! configPackageName . isEmpty ( ) ) { packageName = configPackageName ; } List < FsFile > libraryDirs = null ; if ( config . libraries ( ) . length > 0 ) { libraryDirs = new ArrayList < > ( ) ; for ( String libraryDirName : config . libraries ( ) ) { libraryDirs . add ( baseDir . join ( libraryDirName ) ) ; } } ManifestIdentifier identifier = new ManifestIdentifier ( manifestFile , resDir , assetDir , packageName , libraryDirs ) ; synchronized ( appManifestsByFile ) { AndroidManifest appManifest ; appManifest = appManifestsByFile . get ( identifier ) ; if ( appManifest == null ) { appManifest = createAppManifest ( manifestFile , resDir , assetDir , packageName ) ; if ( libraryDirs != null ) { appManifest . setLibraryDirectories ( libraryDirs ) ; } appManifestsByFile . put ( identifier , appManifest ) ; } return appManifest ; } |
public class JexlNamingStrategy { /** * Populate the context with values from the result .
* @ param context - the expression context used when evaluating JEXL expressions .
* @ param result - the result of a JMX query . */
protected void populateContext ( JexlContext context , Result result ) { } } | context . set ( VAR_CLASSNAME , result . getClassName ( ) ) ; context . set ( VAR_ATTRIBUTE_NAME , result . getAttributeName ( ) ) ; context . set ( VAR_CLASSNAME_ALIAS , result . getKeyAlias ( ) ) ; Map < String , String > typeNameMap = TypeNameValue . extractMap ( result . getTypeName ( ) ) ; context . set ( VAR_TYPENAME , typeNameMap ) ; String effectiveClassname = result . getKeyAlias ( ) ; if ( effectiveClassname == null ) { effectiveClassname = result . getClassName ( ) ; } context . set ( VAR_EFFECTIVE_CLASSNAME , effectiveClassname ) ; context . set ( VAR_RESULT , result ) ; |
public class ListFilter { /** * Checks if a given node is allowed or not as a child of a & lt ; ul & gt ; or & lt ; ol & gt ; element .
* @ param node the node to be checked
* @ return { @ code true } if the given node is allowed inside an ordered or unordered list , { @ code false } otherwise */
private boolean isAllowedInsideList ( Node node ) { } } | return ( node . getNodeType ( ) != Node . ELEMENT_NODE || node . getNodeName ( ) . equalsIgnoreCase ( TAG_LI ) ) && ( node . getNodeType ( ) != Node . TEXT_NODE || node . getNodeValue ( ) . trim ( ) . length ( ) == 0 ) ; |
public class ByteIteratorEx { /** * Lazy evaluation .
* @ param iteratorSupplier
* @ return */
public static ByteIteratorEx of ( final Supplier < ? extends ByteIterator > iteratorSupplier ) { } } | N . checkArgNotNull ( iteratorSupplier , "iteratorSupplier" ) ; return new ByteIteratorEx ( ) { private ByteIterator iter = null ; private ByteIteratorEx iterEx = null ; private boolean isInitialized = false ; @ Override public boolean hasNext ( ) { if ( isInitialized == false ) { init ( ) ; } return iter . hasNext ( ) ; } @ Override public byte nextByte ( ) { if ( isInitialized == false ) { init ( ) ; } return iter . nextByte ( ) ; } @ Override public void skip ( long n ) { N . checkArgNotNegative ( n , "n" ) ; if ( isInitialized == false ) { init ( ) ; } if ( iterEx != null ) { iterEx . skip ( n ) ; } else { super . skip ( n ) ; } } @ Override public long count ( ) { if ( isInitialized == false ) { init ( ) ; } if ( iterEx != null ) { return iterEx . count ( ) ; } else { return super . count ( ) ; } } @ Override public void close ( ) { if ( isInitialized == false ) { init ( ) ; } if ( iterEx != null ) { iterEx . close ( ) ; } } private void init ( ) { if ( isInitialized == false ) { isInitialized = true ; iter = iteratorSupplier . get ( ) ; iterEx = iter instanceof ByteIteratorEx ? ( ByteIteratorEx ) iter : null ; } } } ; |
public class CircularBar { /** * Calculates the coordinates of { @ link android . graphics . RectF } that
* are perfectly within the available window
* @ param offset Half the width of the pain stroke
* @ return The rectF */
private RectF getArcRect ( float offset ) { } } | RectF workingSurface = new RectF ( ) ; workingSurface . left = getPaddingLeft ( ) + offset ; workingSurface . top = getPaddingTop ( ) + offset ; workingSurface . right = getWidth ( ) - getPaddingRight ( ) - offset ; workingSurface . bottom = getHeight ( ) - getPaddingBottom ( ) - offset ; float width = workingSurface . right - workingSurface . left ; float height = workingSurface . bottom - workingSurface . top ; this . mDiameter = Math . min ( width , height ) ; float radius = mDiameter / 2 ; float centerX = width / 2 ; float centerY = height / 2 ; // float left , float top , float right , float bottom
return new RectF ( centerX - radius + offset , centerY - radius + offset , centerX + radius + offset , centerY + radius + offset ) ; |
public class BingImagesImpl { /** * The Image Trending Search API lets you search on Bing and get back a list of images that are trending based on search requests made by others . The images are broken out into different categories . For example , Popular People Searches . For a list of markets that support trending images , see [ Trending Images ] ( https : / / docs . microsoft . com / en - us / azure / cognitive - services / bing - image - search / trending - images ) .
* @ param trendingOptionalParameter the object representing the optional parameters to be set before calling this API
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < TrendingImages > trendingAsync ( TrendingOptionalParameter trendingOptionalParameter , final ServiceCallback < TrendingImages > serviceCallback ) { } } | return ServiceFuture . fromResponse ( trendingWithServiceResponseAsync ( trendingOptionalParameter ) , serviceCallback ) ; |
public class CommercePriceListAccountRelUtil { /** * Returns the last commerce price list account rel in the ordered set where uuid = & # 63 ; .
* @ param uuid the uuid
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last matching commerce price list account rel , or < code > null < / code > if a matching commerce price list account rel could not be found */
public static CommercePriceListAccountRel fetchByUuid_Last ( String uuid , OrderByComparator < CommercePriceListAccountRel > orderByComparator ) { } } | return getPersistence ( ) . fetchByUuid_Last ( uuid , orderByComparator ) ; |
public class KMLGeometry { /** * Defines a connected set of line segments .
* Syntax :
* < LineString id = " ID " >
* < ! - - specific to LineString - - >
* < gx : altitudeOffset > 0 < / gx : altitudeOffset > < ! - - double - - >
* < extrude > 0 < / extrude > < ! - - boolean - - >
* < tessellate > 0 < / tessellate > < ! - - boolean - - >
* < altitudeMode > clampToGround < / altitudeMode >
* < ! - - kml : altitudeModeEnum : clampToGround , relativeToGround , or absolute
* < ! - - or , substitute gx : altitudeMode : clampToSeaFloor , relativeToSeaFloor
* < gx : drawOrder > 0 < / gx : drawOrder > < ! - - integer - - >
* < coordinates > . . . < / coordinates > < ! - - lon , lat [ , alt ] - - >
* < / LineString >
* Supported syntax :
* < LineString >
* < extrude > 0 < / extrude >
* < altitudeMode > clampToGround < / altitudeMode >
* < coordinates > . . . < / coordinates > < ! - - lon , lat [ , alt ] - - >
* < / LineString >
* @ param lineString */
public static void toKMLLineString ( LineString lineString , ExtrudeMode extrude , int altitudeModeEnum , StringBuilder sb ) { } } | sb . append ( "<LineString>" ) ; appendExtrude ( extrude , sb ) ; appendAltitudeMode ( altitudeModeEnum , sb ) ; appendKMLCoordinates ( lineString . getCoordinates ( ) , sb ) ; sb . append ( "</LineString>" ) ; |
public class SerializerIntrinsics { /** * Add 16 bit or 32 bit integer to st ( 0 ) ( FPU ) . */
public final void fiadd ( Mem src ) { } } | assert ( src . size ( ) == 2 || src . size ( ) == 4 ) ; emitX86 ( INST_FIADD , src ) ; |
public class BOGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . BOG__OEG_NAME : return getOEGName ( ) ; case AfplibPackage . BOG__TRIPLETS : return getTriplets ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class AutoMlClient { /** * Gets a dataset .
* < p > Sample code :
* < pre > < code >
* try ( AutoMlClient autoMlClient = AutoMlClient . create ( ) ) {
* DatasetName name = DatasetName . of ( " [ PROJECT ] " , " [ LOCATION ] " , " [ DATASET ] " ) ;
* Dataset response = autoMlClient . getDataset ( name . toString ( ) ) ;
* < / code > < / pre >
* @ param name The resource name of the dataset to retrieve .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
public final Dataset getDataset ( String name ) { } } | GetDatasetRequest request = GetDatasetRequest . newBuilder ( ) . setName ( name ) . build ( ) ; return getDataset ( request ) ; |
public class EightyProvider { /** * - - - - - private - - - - - */
private EightyFS checkProviderAndGet80 ( @ Nullable Path path ) { } } | if ( path == null ) { throw new IllegalArgumentException ( "argument was null" ) ; } if ( path . getFileSystem ( ) . provider ( ) != this ) { throw new ProviderMismatchException ( "expected path for " + getScheme ( ) + " got " + path . getFileSystem ( ) . provider ( ) . getScheme ( ) ) ; } if ( ! path . getFileSystem ( ) . isOpen ( ) ) { throw new ClosedFileSystemException ( ) ; } return ( ( EightyFileSystem ) path . getFileSystem ( ) ) . get80 ( ) ; |
public class InternalPureXbaseLexer { /** * $ ANTLR start " T _ _ 55" */
public final void mT__55 ( ) throws RecognitionException { } } | try { int _type = T__55 ; int _channel = DEFAULT_TOKEN_CHANNEL ; // InternalPureXbase . g : 53:7 : ( ' : : ' )
// InternalPureXbase . g : 53:9 : ' : : '
{ match ( "::" ) ; } state . type = _type ; state . channel = _channel ; } finally { } |
public class ResourcesInner { /** * Gets a resource .
* @ param resourceGroupName The name of the resource group containing the resource to get . The name is case insensitive .
* @ param resourceProviderNamespace The namespace of the resource provider .
* @ param parentResourcePath The parent resource identity .
* @ param resourceType The resource type of the resource .
* @ param resourceName The name of the resource to get .
* @ param apiVersion The API version to use for the 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 < GenericResourceInner > getAsync ( String resourceGroupName , String resourceProviderNamespace , String parentResourcePath , String resourceType , String resourceName , String apiVersion , final ServiceCallback < GenericResourceInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , apiVersion ) , serviceCallback ) ; |
public class EmailExtensions { /** * Adds a ' to ' recipient to the email message .
* @ param recipientEmail
* the recipient email
* @ param recipientPersonal
* the recipient personal
* @ param recipientCharset
* the recipient charset
* @ param emailMessage
* the email message
* @ return the email message
* @ throws UnsupportedEncodingException
* is thrown if the encoding not supported
* @ throws MessagingException
* is thrown if the underlying implementation does not support modification of
* existing values */
public static EmailMessage addToRecipientToEmailMessage ( final String recipientEmail , final String recipientPersonal , final String recipientCharset , final EmailMessage emailMessage ) throws UnsupportedEncodingException , MessagingException { } } | // Try to create the recipient Address
Address recipientAddress = EmailExtensions . newAddress ( recipientEmail , recipientPersonal , recipientCharset ) ; // Set recipient
if ( null != recipientAddress ) { emailMessage . addTo ( recipientAddress ) ; } else { emailMessage . setRecipients ( Message . RecipientType . TO , recipientEmail ) ; } return emailMessage ; |
public class FloatMatrix { /** * Repeat elements < code > rowRepeats < / code > times in row direction and < code > colRepeats < / code > times in column direction .
* @ param rowRepeats
* @ param colRepeats
* @ return a new matrix
* @ see IntMatrix # repelem ( int , int ) */
@ Override public FloatMatrix repelem ( final int rowRepeats , final int colRepeats ) { } } | N . checkArgument ( rowRepeats > 0 && colRepeats > 0 , "rowRepeats=%s and colRepeats=%s must be bigger than 0" , rowRepeats , colRepeats ) ; final float [ ] [ ] c = new float [ rows * rowRepeats ] [ cols * colRepeats ] ; for ( int i = 0 ; i < rows ; i ++ ) { final float [ ] fr = c [ i * rowRepeats ] ; for ( int j = 0 ; j < cols ; j ++ ) { N . copy ( Array . repeat ( a [ i ] [ j ] , colRepeats ) , 0 , fr , j * colRepeats , colRepeats ) ; } for ( int k = 1 ; k < rowRepeats ; k ++ ) { N . copy ( fr , 0 , c [ i * rowRepeats + k ] , 0 , fr . length ) ; } } return new FloatMatrix ( c ) ; |
public class JKDateTimeUtil { public static boolean isTimeConflict ( Time timeFrom , Time timeTo , Time otherTimeFrom , Time otherTimeTo ) { } } | if ( JKDateTimeUtil . isTimesEqaualed ( timeFrom , otherTimeFrom ) || JKDateTimeUtil . isTimesEqaualed ( timeTo , otherTimeTo ) ) { return true ; } // other time start time is between start and end time for this time
if ( timeFrom . after ( otherTimeFrom ) && timeFrom . before ( otherTimeTo ) ) { return true ; } // other time e is between start and end time for this time
if ( timeTo . after ( otherTimeFrom ) && timeTo . before ( otherTimeTo ) ) { return true ; } // if time starting before this time and ends after this time
if ( timeFrom . before ( otherTimeFrom ) && timeTo . after ( otherTimeTo ) ) { return true ; } return false ; |
public class ClientFactory { /** * 发送信息
* @ param pUserName
* @ param pMessage
* @ throws APPErrorException */
public void sendMessage ( String pUserName , TextMessage pMessage ) throws APPErrorException { } } | validOnline ( pUserName ) ; try { mClients . get ( pUserName ) . sendMessage ( pMessage ) ; } catch ( IOException e ) { throw new APPErrorException ( "发送消息失败;原因:" + e . getMessage ( ) , e ) ; } |
public class GoodsPriceListRetriever { /** * < p > Retrieves CSV data .
* pReqVars must has :
* < pre >
* priceCategoryId - Long
* < / pre >
* pReqVars might has :
* < pre >
* optimisticQuantity - BigDecimal
* unavailablePrice - BigDecimal
* < / pre >
* @ param pReqVars request parameters ,
* @ return data table
* @ throws Exception an Exception */
@ Override public final List < List < Object > > retrieveData ( final Map < String , Object > pReqVars ) throws Exception { } } | AccSettings as = this . srvAccSettings . lazyGetAccSettings ( pReqVars ) ; List < List < Object > > result = new ArrayList < List < Object > > ( ) ; Long priceCategoryId = ( Long ) pReqVars . get ( "priceCategoryId" ) ; BigDecimal unavailablePrice = null ; if ( pReqVars . get ( "unavailablePrice" ) != null ) { unavailablePrice = ( BigDecimal ) pReqVars . get ( "unavailablePrice" ) ; } BigDecimal optimisticQuantity = null ; if ( pReqVars . get ( "optimisticQuantity" ) != null ) { optimisticQuantity = ( BigDecimal ) pReqVars . get ( "optimisticQuantity" ) ; } Set < String > ndFlPg = new HashSet < String > ( ) ; ndFlPg . add ( "item" ) ; ndFlPg . add ( "itsPrice" ) ; Set < String > ndFlIdNm = new HashSet < String > ( ) ; ndFlIdNm . add ( "itsId" ) ; ndFlIdNm . add ( "itsName" ) ; pReqVars . put ( "PriceGoodsitemdeepLevel" , 3 ) ; pReqVars . put ( "PriceGoodsneededFields" , ndFlPg ) ; pReqVars . put ( "InvItemCategoryneededFields" , ndFlIdNm ) ; pReqVars . put ( "UnitOfMeasureneededFields" , ndFlIdNm ) ; List < PriceGoods > gpl = getSrvOrm ( ) . retrieveListWithConditions ( pReqVars , PriceGoods . class , "where PRICECATEGORY=" + priceCategoryId ) ; pReqVars . remove ( "PriceGoodsitemdeepLevel" ) ; pReqVars . remove ( "PriceGoodsneededFields" ) ; pReqVars . remove ( "InvItemCategoryneededFields" ) ; pReqVars . remove ( "UnitOfMeasureneededFields" ) ; pReqVars . put ( "WarehouseSiteneededFields" , ndFlIdNm ) ; pReqVars . put ( "WarehouseneededFields" , ndFlIdNm ) ; List < WarehouseSite > allPlaces = getSrvOrm ( ) . retrieveList ( pReqVars , WarehouseSite . class ) ; pReqVars . remove ( "WarehouseSiteneededFields" ) ; pReqVars . remove ( "WarehouseneededFields" ) ; ndFlIdNm . add ( "itsPercentage" ) ; pReqVars . put ( "TaxneededFields" , ndFlIdNm ) ; List < InvItemTaxCategoryLine > allTaxCatsLns = getSrvOrm ( ) . retrieveList ( pReqVars , InvItemTaxCategoryLine . class ) ; pReqVars . remove ( "TaxneededFields" ) ; List < Tax > usedTaxes = new ArrayList < Tax > ( ) ; List < InvItemTaxCategory > usedTaxCats = new ArrayList < InvItemTaxCategory > ( ) ; for ( InvItemTaxCategoryLine tcl : allTaxCatsLns ) { boolean txListed = false ; for ( Tax tx : usedTaxes ) { if ( tx . getItsId ( ) . equals ( tcl . getTax ( ) . getItsId ( ) ) ) { txListed = true ; break ; } } if ( ! txListed ) { usedTaxes . add ( tcl . getTax ( ) ) ; tcl . getTax ( ) . setItsPercentage ( tcl . getItsPercentage ( ) ) ; } int tci = - 1 ; for ( InvItemTaxCategory tc : usedTaxCats ) { if ( tc . getItsId ( ) . equals ( tcl . getItsOwner ( ) . getItsId ( ) ) ) { tci = usedTaxCats . indexOf ( tc ) ; break ; } } if ( tci == - 1 ) { usedTaxCats . add ( tcl . getItsOwner ( ) ) ; tcl . getItsOwner ( ) . setTaxes ( new ArrayList < InvItemTaxCategoryLine > ( ) ) ; tcl . getItsOwner ( ) . getTaxes ( ) . add ( tcl ) ; } else { usedTaxCats . get ( tci ) . getTaxes ( ) . add ( tcl ) ; } } Collections . sort ( usedTaxes , new CmprHasIdLong < Tax > ( ) ) ; Collections . sort ( usedTaxCats , new CmprHasIdLong < InvItemTaxCategory > ( ) ) ; boolean isOnlyTax = true ; for ( InvItemTaxCategory txc : usedTaxCats ) { if ( txc . getTaxes ( ) . size ( ) > 1 ) { isOnlyTax = false ; break ; } } String queryRests = "select INVITEM, sum(THEREST) as THEREST," + " min(WAREHOUSESITE) as WAREHOUSESITE from WAREHOUSEREST group by INVITEM;" ; List < WarehouseRestLineSm > whRests = new ArrayList < WarehouseRestLineSm > ( ) ; IRecordSet < RS > recordSet = null ; try { recordSet = getSrvDatabase ( ) . retrieveRecords ( queryRests ) ; if ( recordSet . moveToFirst ( ) ) { do { WarehouseRestLineSm wrl = new WarehouseRestLineSm ( ) ; whRests . add ( wrl ) ; wrl . setInvItemId ( recordSet . getLong ( "INVITEM" ) ) ; wrl . setSiteId ( recordSet . getLong ( "WAREHOUSESITE" ) ) ; Double theRset = recordSet . getDouble ( "THEREST" ) ; wrl . setTheRest ( BigDecimal . valueOf ( theRset ) ) ; } while ( recordSet . moveToNext ( ) ) ; } } finally { if ( recordSet != null ) { recordSet . close ( ) ; } } BigDecimal bd1d2 = new BigDecimal ( "1.2" ) ; BigDecimal bd100 = new BigDecimal ( "100" ) ; for ( PriceGoods pg : gpl ) { List < Object > row = new ArrayList < Object > ( ) ; result . add ( row ) ; row . add ( pg . getItem ( ) ) ; row . add ( pg . getItsPrice ( ) ) ; row . add ( pg . getItsPrice ( ) . divide ( bd1d2 , 2 , RoundingMode . HALF_UP ) ) ; BigDecimal quantity ; Boolean isAvailable ; WarehouseSite ws = null ; if ( unavailablePrice != null && pg . getItsPrice ( ) . compareTo ( unavailablePrice ) == 0 ) { quantity = BigDecimal . ZERO ; isAvailable = Boolean . FALSE ; } else { WarehouseRestLineSm wr = findRest ( pg . getItem ( ) . getItsId ( ) , whRests ) ; if ( wr != null ) { quantity = wr . getTheRest ( ) ; isAvailable = Boolean . TRUE ; ws = findSite ( wr . getSiteId ( ) , allPlaces ) ; } else { if ( optimisticQuantity == null ) { quantity = BigDecimal . ZERO ; isAvailable = Boolean . FALSE ; } else { quantity = optimisticQuantity ; isAvailable = Boolean . TRUE ; } } } row . add ( quantity ) ; row . add ( isAvailable ) ; row . add ( ws ) ; if ( pg . getItem ( ) . getTaxCategory ( ) != null ) { for ( InvItemTaxCategory txc : usedTaxCats ) { if ( txc . getItsId ( ) . equals ( pg . getItem ( ) . getTaxCategory ( ) . getItsId ( ) ) ) { // tax category with tax lines :
pg . getItem ( ) . setTaxCategory ( txc ) ; break ; } } } if ( isOnlyTax ) { TaxWr onlyTax = new TaxWr ( ) ; if ( pg . getItem ( ) . getTaxCategory ( ) != null ) { onlyTax . setTax ( pg . getItem ( ) . getTaxCategory ( ) . getTaxes ( ) . get ( 0 ) . getTax ( ) ) ; onlyTax . setIsUsed ( true ) ; onlyTax . setRate ( onlyTax . getTax ( ) . getItsPercentage ( ) . divide ( bd100 , as . getTaxPrecision ( ) + 2 , RoundingMode . HALF_UP ) ) ; } row . add ( onlyTax ) ; } else { // multiply taxes case :
TaxCategoryWr taxCat = new TaxCategoryWr ( ) ; if ( pg . getItem ( ) . getTaxCategory ( ) != null ) { taxCat . setTaxCategory ( pg . getItem ( ) . getTaxCategory ( ) ) ; taxCat . setIsUsed ( true ) ; for ( InvItemTaxCategoryLine tl : taxCat . getTaxCategory ( ) . getTaxes ( ) ) { taxCat . setAggrPercent ( taxCat . getAggrPercent ( ) . add ( tl . getItsPercentage ( ) ) ) ; } taxCat . setAggrRate ( taxCat . getAggrPercent ( ) . divide ( bd100 , as . getTaxPrecision ( ) + 2 , RoundingMode . HALF_UP ) ) ; } row . add ( taxCat ) ; for ( Tax tx : usedTaxes ) { TaxWr txWr = new TaxWr ( ) ; if ( pg . getItem ( ) . getTaxCategory ( ) != null ) { for ( InvItemTaxCategoryLine tl : pg . getItem ( ) . getTaxCategory ( ) . getTaxes ( ) ) { if ( tl . getTax ( ) . getItsId ( ) . equals ( tx . getItsId ( ) ) ) { txWr . setTax ( tl . getTax ( ) ) ; txWr . setIsUsed ( true ) ; txWr . setRate ( txWr . getTax ( ) . getItsPercentage ( ) . divide ( bd100 , as . getTaxPrecision ( ) + 2 , RoundingMode . HALF_UP ) ) ; break ; } } } row . add ( txWr ) ; } for ( InvItemTaxCategory txc : usedTaxCats ) { TaxCategoryWr txCtWr = new TaxCategoryWr ( ) ; if ( pg . getItem ( ) . getTaxCategory ( ) != null && txc . getItsId ( ) . equals ( pg . getItem ( ) . getTaxCategory ( ) . getItsId ( ) ) ) { txCtWr . setTaxCategory ( txc ) ; txCtWr . setIsUsed ( true ) ; for ( InvItemTaxCategoryLine tl : txCtWr . getTaxCategory ( ) . getTaxes ( ) ) { txCtWr . setAggrPercent ( txCtWr . getAggrPercent ( ) . add ( tl . getItsPercentage ( ) ) ) ; } txCtWr . setAggrRate ( txCtWr . getAggrPercent ( ) . divide ( bd100 , as . getTaxPrecision ( ) + 2 , RoundingMode . HALF_UP ) ) ; } row . add ( txCtWr ) ; } } } return result ; |
public class DockerHandler { /** * ( non - Javadoc )
* @ see net . roboconf . target . api . TargetHandler
* # terminateMachine ( net . roboconf . target . api . TargetHandlerParameters , java . lang . String ) */
@ Override public void terminateMachine ( TargetHandlerParameters parameters , String machineId ) throws TargetException { } } | this . logger . fine ( "Terminating machine " + machineId ) ; try { cancelMachineConfigurator ( machineId ) ; DockerClient dockerClient = DockerUtils . createDockerClient ( parameters . getTargetProperties ( ) ) ; Container container = DockerUtils . findContainerByIdOrByName ( machineId , dockerClient ) ; // The case " container = = null " is possible .
// Indeed , it may have been killed manually . This method will then
// just mark the Roboconf instance as " not deployed " without throwing an exception .
if ( container != null ) { // Stop the container
ContainerState state = DockerUtils . getContainerState ( machineId , dockerClient ) ; if ( state != null && ( extractBoolean ( state . getRunning ( ) ) || extractBoolean ( state . getPaused ( ) ) ) ) dockerClient . killContainerCmd ( container . getId ( ) ) . exec ( ) ; dockerClient . removeContainerCmd ( container . getId ( ) ) . withForce ( true ) . exec ( ) ; // Delete the volume we used to share user data
// ( container names are prefixed by their parent , here " / " ) .
// See https : / / github . com / moby / moby / issues / 6705
String containerName = container . getNames ( ) [ 0 ] . substring ( 1 ) ; File userDataDir = this . containerIdToVolume . remove ( containerName ) ; Utils . deleteFilesRecursivelyAndQuietly ( userDataDir ) ; } } catch ( Exception e ) { throw new TargetException ( e ) ; } |
public class CommercePaymentMethodGroupRelLocalServiceBaseImpl { /** * Creates a new commerce payment method group rel with the primary key . Does not add the commerce payment method group rel to the database .
* @ param commercePaymentMethodGroupRelId the primary key for the new commerce payment method group rel
* @ return the new commerce payment method group rel */
@ Override @ Transactional ( enabled = false ) public CommercePaymentMethodGroupRel createCommercePaymentMethodGroupRel ( long commercePaymentMethodGroupRelId ) { } } | return commercePaymentMethodGroupRelPersistence . create ( commercePaymentMethodGroupRelId ) ; |
public class OperaUIElement { /** * Checks if widget text contains the text specified by the given string id
* @ param stringId String id of string
* @ return true if text specified by stringId is contained in widget text */
public boolean verifyContainsText ( String stringId ) { } } | String text = desktopUtils . getString ( stringId , true ) ; return getText ( ) . indexOf ( text ) >= 0 ; |
public class AbstractProbeListener { /** * Try to retrieve the { @ link ProbeTest } annotation of the test method
* @ param description The representation of the test
* @ return The annotation found , or null if not found
* @ throws NoSuchMethodException No method found */
protected ProbeTest getMethodAnnotation ( Description description ) throws NoSuchMethodException { } } | String methodName = description . getMethodName ( ) ; if ( methodName . contains ( "[" ) ) { methodName = methodName . replaceAll ( "\\[.*\\]" , "" ) ; } return description . getTestClass ( ) . getMethod ( methodName ) . getAnnotation ( ProbeTest . class ) ; |
public class BufferedWriterFactory { /** * { @ inheritDoc } */
public Writer create ( ) { } } | return bufSize > 0 ? new BufferedWriter ( writerFactory . create ( ) , bufSize ) : new BufferedWriter ( writerFactory . create ( ) ) ; |
public class UserAgentParser { /** * 解析User - Agent
* @ param userAgentString User - Agent字符串
* @ return { @ link UserAgent } */
public static UserAgent parse ( String userAgentString ) { } } | final UserAgent userAgent = new UserAgent ( ) ; final Browser browser = parseBrowser ( userAgentString ) ; userAgent . setBrowser ( parseBrowser ( userAgentString ) ) ; userAgent . setVersion ( browser . getVersion ( userAgentString ) ) ; final Engine engine = parseEngine ( userAgentString ) ; userAgent . setEngine ( engine ) ; if ( false == engine . isUnknown ( ) ) { userAgent . setEngineVersion ( parseEngineVersion ( engine , userAgentString ) ) ; } userAgent . setOs ( parseOS ( userAgentString ) ) ; final Platform platform = parsePlatform ( userAgentString ) ; userAgent . setPlatform ( platform ) ; userAgent . setMobile ( platform . isMobile ( ) || browser . isMobile ( ) ) ; return userAgent ; |
public class InnerMetricContext { /** * See { @ link com . codahale . metrics . MetricRegistry # getCounters ( com . codahale . metrics . MetricFilter ) } .
* This method will return fully - qualified metric names if the { @ link MetricContext } is configured
* to report fully - qualified metric names . */
@ Override public SortedMap < String , Counter > getCounters ( MetricFilter filter ) { } } | return getSimplyNamedMetrics ( Counter . class , Optional . of ( filter ) ) ; |
public class Range { /** * Create a new range from { @ code lower } and { @ code upper } boundary values . Both values are included ( greater than or equals
* and less than or equals ) .
* @ param lower lower boundary , must not be { @ literal null } .
* @ param upper upper boundary , must not be { @ literal null } .
* @ param < T > value type
* @ return new { @ link Range } */
public static < T > Range < T > create ( T lower , T upper ) { } } | LettuceAssert . isTrue ( ! ( lower instanceof Boundary ) , "Lower must not be a Boundary. Use #from(Boundary, Boundary) instead" ) ; LettuceAssert . isTrue ( ! ( upper instanceof Boundary ) , "Upper must not be a Boundary. Use #from(Boundary, Boundary) instead" ) ; return new Range < T > ( Boundary . including ( lower ) , Boundary . including ( upper ) ) ; |
public class ServletUtil { /** * / * getServletParameter ( ServletConfig . . . ) */
public static String getServletParameter ( ServletConfig conf , String name , Set < GetOpts > opts , String defaultValue ) { } } | String ret ; if ( conf == null ) throw new NullPointerException ( "ServletConfig cannot be null" ) ; if ( name == null ) throw new NullPointerException ( "name cannot be null" ) ; if ( opts == null ) opts = EMPTY_OPTS ; if ( ( ret = conf . getInitParameter ( name ) ) != null ) return ret ; if ( opts . contains ( GetOpts . THROW_ON_MISSING ) ) throw new IllegalStateException ( "The servlet init paramter " + name + " is required but wasn't set." ) ; if ( opts . contains ( GetOpts . LOG_ON_MISSING ) ) logger . warn ( "The servlet init paramter {} is expected but wasn't set." , name ) ; return defaultValue ; |
public class CmsSetupBean { /** * Checks if the necessary files for the configuration are existent or not . < p >
* @ param requiredFiles the required files
* @ param childResource the folder to check
* @ return true if the files are existent */
private boolean checkFilesExists ( String [ ] requiredFiles , File childResource ) { } } | File setupFile = null ; boolean hasMissingSetupFiles = false ; for ( int j = 0 ; j < requiredFiles . length ; j ++ ) { setupFile = new File ( childResource . getPath ( ) + File . separatorChar + requiredFiles [ j ] ) ; if ( ! setupFile . exists ( ) || ! setupFile . isFile ( ) || ! setupFile . canRead ( ) ) { hasMissingSetupFiles = true ; System . err . println ( "[" + getClass ( ) . getName ( ) + "] missing or unreadable database setup file: " + setupFile . getPath ( ) ) ; break ; } if ( ! hasMissingSetupFiles ) { return true ; } } return false ; |
public class VariantUtils { /** * Returns the bundle name from the variants given in parameter
* @ param bundleName
* the original bundle name
* @ param variants
* the map of variant
* @ param isGeneratedResource
* the flag indicating if it ' s a generated resource or not
* @ return the variant bundle name */
public static String getVariantBundleName ( String bundleName , Map < String , String > variants , boolean isGeneratedResource ) { } } | String variantKey = getVariantKey ( variants ) ; return getVariantBundleName ( bundleName , variantKey , isGeneratedResource ) ; |
public class FlexiantComputeClient { /** * Returns all networks .
* @ param locationUUID optional location of the network , if null it will be ignored .
* @ return a set of all networks .
* @ throws FlexiantException */
public Set < de . uniulm . omi . cloudiator . flexiant . client . domain . Network > getNetworks ( @ Nullable final String locationUUID ) throws FlexiantException { } } | return this . getResources ( ResourceType . NETWORK , Network . class , locationUUID ) . stream ( ) . map ( de . uniulm . omi . cloudiator . flexiant . client . domain . Network :: new ) . collect ( Collectors . toSet ( ) ) ; |
public class JSONUtil { /** * POJO对象转换为JSON
* @ param pojo
* @ return */
public String formatPOJO2JSON ( Object pojo ) { } } | StringWriter stringWriter = new StringWriter ( ) ; String json = "" ; try { JsonGenerator gen = new JsonFactory ( ) . createJsonGenerator ( stringWriter ) ; MAPPER . writeValue ( gen , pojo ) ; gen . close ( ) ; json = stringWriter . toString ( ) ; } catch ( Exception e ) { LOGGER . error ( pojo . getClass ( ) . getName ( ) + "转json出错" , e ) ; } return json ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.