signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SpringIntegration { /** * Binds all Spring beans from the given factory by name . For a Spring bean named " foo " , this * method creates a binding to the bean ' s type and { @ code @ Named ( " foo " ) } . * @ see com . google . inject . name . Named * @ see com . google . inject . name . Names # nam...
binder = binder . skipSources ( SpringIntegration . class ) ; for ( String name : beanFactory . getBeanDefinitionNames ( ) ) { Class < ? > type = beanFactory . getType ( name ) ; bindBean ( binder , beanFactory , name , type ) ; }
public class CloudWatchDestinationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CloudWatchDestination cloudWatchDestination , ProtocolMarshaller protocolMarshaller ) { } }
if ( cloudWatchDestination == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( cloudWatchDestination . getDimensionConfigurations ( ) , DIMENSIONCONFIGURATIONS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to ma...
public class ExtendedFile { /** * Zips all included objects into the specified file . * @ param zipFile * the zip file to be created */ public void zip ( final File zipFile ) throws IOException { } }
File [ ] files = listFiles ( ) ; if ( files . length == 0 ) { return ; } LOG . info ( "Creating zip file " + zipFile + " from directory " + this ) ; ZipOutputStream zipOut = null ; try { zipOut = new ZipOutputStream ( new FileOutputStream ( zipFile ) ) ; for ( File file : files ) { zip ( "" , file , zipOut ) ; } } fina...
public class UniverseApi { /** * Bulk names to IDs ( asynchronously ) Resolve a set of names to IDs in the * following categories : agents , alliances , characters , constellations , * corporations factions , inventory _ types , regions , stations , and systems . * Only exact matches will be returned . All names ...
com . squareup . okhttp . Call call = postUniverseIdsValidateBeforeCall ( requestBody , acceptLanguage , datasource , language , callback ) ; Type localVarReturnType = new TypeToken < UniverseIdsResponse > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType , callback ) ; return call ;
public class ObservableReader { /** * Adds a reader listener to this reader that will be notified when * new strings are read . * @ param readerListener a reader listener . */ public void addReaderListener ( ReaderListener readerListener ) { } }
if ( readerListener == null ) { return ; } synchronized ( listeners ) { if ( ! listeners . contains ( readerListener ) ) { listeners . add ( readerListener ) ; } }
public class ConditionalClause { /** * The test in this conditional clause are implicitly ANDed together , so return false if any of them is false , and continue the loop for each test that is true ; * @ return */ @ Override public boolean evaluate ( FieldManager fieldManager , IndentPrinter printer ) { } }
Comparable fieldValue = fieldManager . getValue ( fieldName ) ; for ( ConditionalTest test : conditionalTests ) { boolean result = test . operator . apply ( fieldValue , test . parameter ) ; printer . print ( "- %s => %b" , test . operator . description ( fieldManager . getDescription ( fieldName ) , fieldValue , test ...
public class IfcElementImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcRelConnectsStructuralElement > getHasStructuralMember ( ) { } }
return ( EList < IfcRelConnectsStructuralElement > ) eGet ( Ifc2x3tc1Package . Literals . IFC_ELEMENT__HAS_STRUCTURAL_MEMBER , true ) ;
public class Captions { /** * The array of file formats for the output captions . If you leave this value blank , Elastic Transcoder returns an * error . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setCaptionFormats ( java . util . Collection ) } or { @...
if ( this . captionFormats == null ) { setCaptionFormats ( new com . amazonaws . internal . SdkInternalList < CaptionFormat > ( captionFormats . length ) ) ; } for ( CaptionFormat ele : captionFormats ) { this . captionFormats . add ( ele ) ; } return this ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getGSCRPREC ( ) { } }
if ( gscrprecEEnum == null ) { gscrprecEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 143 ) ; } return gscrprecEEnum ;
public class AS2ClientBuilder { /** * Certain values can by convention be derived from other values . This happens * inside this method . There is no need to call this method manually , it is * called automatically before { @ link # verifyContent ( ) } is called . */ @ OverridingMethodsMustInvokeSuper protected voi...
if ( m_sReceiverAS2KeyAlias == null ) { // No key alias is specified , so use the same as the receiver ID ( which // may be null ) m_sReceiverAS2KeyAlias = m_sReceiverAS2ID ; if ( LOGGER . isDebugEnabled ( ) ) LOGGER . debug ( "The receiver AS2 key alias was defaulted to the AS2 receiver ID ('" + m_sReceiverAS2ID + "')...
public class Connection { /** * { @ inheritDoc } */ public void setTypeMap ( final Map < String , Class < ? > > typemap ) throws SQLException { } }
checkClosed ( ) ; if ( typemap == null ) { throw new SQLException ( "Invalid type-map" ) ; } // end of if this . typemap = typemap ;
public class AtlasClient { /** * Get the latest numResults entity audit events in decreasing order of timestamp for the given entity id * @ param entityId entity id * @ param numResults number of results to be returned * @ return list of audit events for the entity id * @ throws AtlasServiceException */ public ...
return getEntityAuditEvents ( entityId , null , numResults ) ;
public class Distance { /** * Gets the Chessboard distance between two points . * @ param x1 X1 axis coordinate . * @ param y1 Y1 axis coordinate . * @ param x2 X2 axis coordinate . * @ param y2 Y2 axis coordinate . * @ return The Chessboard distance between x and y . */ public static double Chessboard ( doub...
double dx = Math . abs ( x1 - x2 ) ; double dy = Math . abs ( y1 - y2 ) ; return Math . max ( dx , dy ) ;
public class SimHashPlusHammingDistanceTextSimilarity { /** * 计算相似度分值 * @ param words1 词列表1 * @ param words2 词列表2 * @ return 相似度分值 */ @ Override protected double scoreImpl ( List < Word > words1 , List < Word > words2 ) { } }
// 用词频来标注词的权重 taggingWeightWithWordFrequency ( words1 , words2 ) ; // 计算SimHash String simHash1 = simHash ( words1 ) ; String simHash2 = simHash ( words2 ) ; // 计算SimHash值之间的汉明距离 int hammingDistance = hammingDistance ( simHash1 , simHash2 ) ; if ( hammingDistance == - 1 ) { LOGGER . error ( "文本1:" + words1 . toString (...
public class LifeCycleManager { /** * Add a shutdown hook that calls { @ link destroy } method */ public void destroyOnShutdownHook ( ) { } }
Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ) { @ Override public void run ( ) { try { LifeCycleManager . this . destroy ( ) ; } catch ( Exception e ) { System . err . print ( "Exception in life cycle shutdown handler " ) ; e . printStackTrace ( System . err ) ; } } } ) ;
public class MultiUserChatLightManager { /** * Unblock a room . * @ param mucLightService * @ param roomJid * @ throws NoResponseException * @ throws XMPPErrorException * @ throws NotConnectedException * @ throws InterruptedException */ public void unblockRoom ( DomainBareJid mucLightService , Jid roomJid )...
HashMap < Jid , Boolean > rooms = new HashMap < > ( ) ; rooms . put ( roomJid , true ) ; sendUnblockRooms ( mucLightService , rooms ) ;
public class ImageIOUtil { /** * Writes a buffered image to a file using the given image format . * See { @ link # writeImage ( BufferedImage image , String formatName , * OutputStream output , int dpi , float quality ) } for more details . * @ param image the image to be written * @ param filename used to cons...
File file = new File ( filename ) ; FileOutputStream output = new FileOutputStream ( file ) ; try { String formatName = filename . substring ( filename . lastIndexOf ( '.' ) + 1 ) ; return writeImage ( image , formatName , output , dpi , quality ) ; } finally { output . close ( ) ; }
public class ComponentPropertyResolver { /** * Get property . * @ param name Property name * @ param defaultValue Default value * @ param < T > Parameter type * @ return Property value or default value if not set */ public @ NotNull < T > T get ( @ NotNull String name , @ NotNull T defaultValue ) { } }
@ Nullable @ SuppressWarnings ( "unchecked" ) T value = get ( name , ( Class < T > ) defaultValue . getClass ( ) ) ; if ( value != null ) { return value ; } else { return defaultValue ; }
public class JSONClient { /** * Invoke the Login stored procedure to add a login record to the database . * If the login is called multiple times for the same username , the last accessed * time for the login is updated . Thus this sample client can be run repeatedly without * having to cycle the database . */ pr...
// Synchronously call the " Login " procedure passing in a json string containing // login - specific structure / data . try { ClientResponse response = client . callProcedure ( "Login" , login . username , login . password , login . json ) ; long resultCode = response . getResults ( ) [ 0 ] . asScalarLong ( ) ; if ( r...
public class FileSystem { /** * The src file is on the local disk . Add it to FS at * the given dst name , removing the source afterwards . */ public void moveFromLocalFile ( Path src , Path dst ) throws IOException { } }
copyFromLocalFile ( true , true , false , src , dst ) ;
public class AmazonConfigClient { /** * Accepts a structured query language ( SQL ) < code > SELECT < / code > command , performs the corresponding search , and * returns resource configurations matching the properties . * For more information about query components , see the < a * href = " https : / / docs . aws...
request = beforeClientExecution ( request ) ; return executeSelectResourceConfig ( request ) ;
public class AmazonEC2Client { /** * Associates a subnet with a route table . The subnet and route table must be in the same VPC . This association * causes traffic originating from the subnet to be routed according to the routes in the route table . The action * returns an association ID , which you need in order ...
request = beforeClientExecution ( request ) ; return executeAssociateRouteTable ( request ) ;
public class FileSelectPart { /** * { @ inheritDoc } */ @ Override public int join ( final OneSelect _oneSelect , final SQLSelect _select , final int _relIndex ) { } }
final int relIndex = super . join ( _oneSelect , _select , _relIndex ) ; Integer ret ; ret = _oneSelect . getTableIndex ( AbstractStoreResource . TABLENAME_STORE , "ID" , relIndex , null ) ; if ( ret == null ) { ret = _oneSelect . getNewTableIndex ( AbstractStoreResource . TABLENAME_STORE , "ID" , relIndex , null ) ; _...
public class PathFinder { /** * Gets the file or directory from the given parent File object and the relative path given over * the list as String objects . * @ param parent * The parent directory . * @ param folders * The list with the directories and optional a filename . * @ return the resulted file or d...
for ( final String string : folders ) { final File nextFolder = new File ( parent , string ) ; parent = nextFolder ; } return parent ;
public class StringValue { /** * ( non - Javadoc ) * @ see java . lang . Appendable # append ( java . lang . CharSequence , int , int ) */ @ Override public Appendable append ( CharSequence csq , int start , int end ) { } }
final int otherLen = end - start ; grow ( this . len + otherLen ) ; for ( int pos = start ; pos < end ; pos ++ ) { this . value [ this . len + pos ] = csq . charAt ( pos ) ; } this . len += otherLen ; return this ;
public class Application { /** * Add new target application to your robot . * Sample if you add google : - f 1 - a google - u http : / / www . google . com - - verbose * @ param applicationName * name of application added . * @ param url * @ param robotContext * Context class from robot . * @ param verbos...
logger . info ( "Add a new application named [{}] with this url: [{}]" , applicationName , url ) ; addApplicationPages ( applicationName , robotContext . getSimpleName ( ) . replaceAll ( "Context" , "" ) , robotContext , verbose ) ; addApplicationSteps ( applicationName , robotContext . getSimpleName ( ) . replaceAll (...
public class PersistHdfs { @ Override public ArrayList < String > calcTypeaheadMatches ( String filter , int limit ) { } }
// Get HDFS configuration Configuration conf = PersistHdfs . CONF ; // Hack around s3 : / / // filter = convertS3toS3N ( filter ) ; // Handle S3N bare buckets - s3n : / / bucketname should be suffixed by ' / ' // or underlying Jets3n will throw NPE . filter name should be s3n : / / bucketname / if ( isBareS3NBucketWith...
public class UIData { /** * < p > Set the zero - relative row number of the first row to be * displayed . < / p > * @ param first New first row number * @ throws IllegalArgumentException if < code > first < / code > is negative */ public void setFirst ( int first ) { } }
if ( first < 0 ) { throw new IllegalArgumentException ( String . valueOf ( first ) ) ; } getStateHelper ( ) . put ( PropertyKeys . first , first ) ;
public class GeneratedMessageLite { /** * For use by generated code only . */ public static < ContainingType extends MessageLite , Type > GeneratedExtension < ContainingType , Type > newSingularGeneratedExtension ( final ContainingType containingTypeDefaultInstance , final Type defaultValue , final MessageLite messageD...
return new GeneratedExtension < ContainingType , Type > ( containingTypeDefaultInstance , defaultValue , messageDefaultInstance , new ExtensionDescriptor ( enumTypeMap , number , type , false /* isRepeated */ , false /* isPacked */ ) ) ;
public class ColumnExtractor { /** * Fills a { @ link ColumnModel } with information from a { @ link Column } . * @ param column The column * @ return The filled model */ public ColumnModel extractColumnModel ( Column column ) { } }
LOG . debug ( "Extracting model for column {}" , column . getName ( ) ) ; ColumnModel model = new ColumnModel ( ) ; model . setName ( this . nameProvider . getMethodNameForColumn ( column ) ) ; model . setDbName ( column . getName ( ) ) ; model . setDbTableName ( column . getParent ( ) . getName ( ) ) ; model . setDbFu...
public class FieldAccessorGenerator { /** * Generates a setter that set the value by directly accessing the class field . * @ param field The reflection field object . */ private void directSetter ( Field field ) { } }
GeneratorAdapter mg = new GeneratorAdapter ( Opcodes . ACC_PUBLIC , getMethod ( void . class , "set" , Object . class , Object . class ) , setterSignature ( ) , new Type [ 0 ] , classWriter ) ; // Simply access by field // ( ( classType ) object ) . fieldName = ( valueType ) value ; mg . loadArg ( 0 ) ; mg . checkCast ...
public class TypeDeclarationsIR { /** * Represents a structural type . * Closure calls this a Record Type and accepts the syntax * { @ code { myNum : number , myObject } } * < p > Example : * < pre > * RECORD _ TYPE * STRING _ KEY myNum * NUMBER _ TYPE * STRING _ KEY myObject * < / pre > * @ param p...
TypeDeclarationNode node = new TypeDeclarationNode ( Token . RECORD_TYPE ) ; for ( Map . Entry < String , TypeDeclarationNode > prop : properties . entrySet ( ) ) { Node stringKey = IR . stringKey ( prop . getKey ( ) ) ; node . addChildToBack ( stringKey ) ; if ( prop . getValue ( ) != null ) { stringKey . addChildToFr...
public class Utils { /** * Splits a string and formats the result . * @ param toSplit the string to split ( can be null ) * @ param separator the separator ( cannot be null or the empty string ) * @ return a list of items ( never null ) , with every item being trimmed */ public static List < String > splitNicely ...
if ( separator == null || separator . isEmpty ( ) ) throw new IllegalArgumentException ( "The separator cannot be null or the empty string." ) ; return splitNicelyWithPattern ( toSplit , Pattern . quote ( separator ) ) ;
public class MaterialTree { /** * Deselect selected tree item */ public void deselectSelectedItem ( ) { } }
// Check whether tree has selected item if ( selectedItem != null ) { clearSelectedStyles ( selectedItem ) ; setSelectedItem ( null ) ; SelectionEvent . fire ( this , null ) ; }
public class S { /** * check the given char to be a digit or alphabetic * @ param c * @ return true if this is a digit an upper case char or a lowercase char */ public static boolean isDigitsOrAlphabetic ( char c ) { } }
int i = ( int ) c ; return digits . include ( i ) || uppers . include ( i ) || lowers . include ( i ) ;
public class CreateCdnConfigurations { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ throws ApiException if the API request failed with one or more service errors . * @ throws RemoteException if the API request failed due to other errors . */ pub...
// Get the CdnConfigurationService . CdnConfigurationServiceInterface cdnConfigurationService = adManagerServices . get ( session , CdnConfigurationServiceInterface . class ) ; // Make CDN configuration objects . // Only LIVE _ STREAM _ SOURCE _ CONTENT is currently supported by the API . // Basic example with no secur...
public class ServletSetDateHeaderTask { /** * { @ inheritDoc } */ public Formula getFormula ( ) { } }
Reagent [ ] reagents = new Reagent [ ] { HEADER_NAME , HEADER_VALUE , SOURCE } ; final Formula rslt = new SimpleFormula ( ServletSetDateHeaderTask . class , reagents ) ; return rslt ;
public class Interval { /** * Find the coalesced result of two overlapping intervals . * @ param that interval * @ return coalesced interval or # NULL if none exists * @ see Range # span ( com . google . common . collect . Range ) */ public Interval < C > coalesce ( final Interval < C > that ) { } }
if ( this . overlaps ( that ) ) { return new Interval ( this . dimension , this . range . span ( that . range ) ) ; } return NULL ;
public class NumberUtil { /** * 判断字符串是否是浮点数 * @ param s String * @ return 是否为 { @ link Double } 类型 */ public static boolean isDouble ( String s ) { } }
try { Double . parseDouble ( s ) ; if ( s . contains ( "." ) ) { return true ; } return false ; } catch ( NumberFormatException e ) { return false ; }
public class Environment { /** * Gets the shell used by the Windows user . * @ return the shell : cmd . exe or command . com . */ private static String getWindowsUserShell ( ) { } }
if ( null != m_SHELL ) { return m_SHELL ; } if ( - 1 != OSNAME . indexOf ( "98" ) || - 1 != OSNAME . indexOf ( "95" ) || - 1 != OSNAME . indexOf ( "Me" ) ) { m_SHELL = "command.com" ; return m_SHELL ; } m_SHELL = "cmd.exe" ; return m_SHELL ;
public class CmsPropertyAdvanced { /** * Performs the editing of the resources properties . < p > * @ param request the HttpServletRequest * @ return true , if the properties were successfully changed , otherwise false * @ throws CmsException if editing is not successful */ private boolean performDialogOperation ...
List < CmsPropertyDefinition > propertyDef = getCms ( ) . readAllPropertyDefinitions ( ) ; boolean useTempfileProject = Boolean . valueOf ( getParamUsetempfileproject ( ) ) . booleanValue ( ) ; try { if ( useTempfileProject ) { switchToTempProject ( ) ; } Map < String , CmsProperty > activeProperties = getActivePropert...
public class MavenJDOMWriter { /** * Method findAndReplaceSimpleLists . * @ param counter * @ param childName * @ param parentName * @ param list * @ param parent */ protected Element findAndReplaceSimpleLists ( Counter counter , Element parent , java . util . Collection list , String parentName , String chil...
boolean shouldExist = ( list != null ) && ( list . size ( ) > 0 ) ; Element element = updateElement ( counter , parent , parentName , shouldExist ) ; if ( shouldExist ) { Iterator it = list . iterator ( ) ; Iterator elIt = element . getChildren ( childName , element . getNamespace ( ) ) . iterator ( ) ; if ( ! elIt . h...
public class CommandLineLinker { /** * This method is exposed so test classes can overload * and test the arguments without actually spawning the * compiler */ protected int runCommand ( final CCTask task , final File workingDir , final String [ ] cmdline ) throws BuildException { } }
return CUtil . runCommand ( task , workingDir , cmdline , this . newEnvironment , this . env ) ;
public class PersonDocumentRepositoryMongoImpl { /** * { @ inheritDoc } */ @ Override public String newId ( final RootDocument rootDocument ) { } }
return newId ( mongoTemplate , PersonDocumentMongo . class , rootDocument . getFilename ( ) , "I" ) ;
public class SessionBuilder { /** * This < b > must < / b > return an instance of { @ code InternalDriverContext } ( it ' s not expressed * directly in the signature to avoid leaking that type through the protected API ) . */ protected DriverContext buildContext ( DriverConfigLoader configLoader , List < TypeCodec < ...
return new DefaultDriverContext ( configLoader , typeCodecs , nodeStateListener , schemaChangeListener , requestTracker , localDatacenters , nodeFilters , classLoader ) ;
public class BPGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . BPG__PAGE_NAME : return PAGE_NAME_EDEFAULT == null ? pageName != null : ! PAGE_NAME_EDEFAULT . equals ( pageName ) ; case AfplibPackage . BPG__TRIPLETS : return triplets != null && ! triplets . isEmpty ( ) ; } return super . eIsSet ( featureID ) ;
public class GBSTree { /** * Pessimistic find in a GBS Tree */ private void pessimisticFind ( SearchComparator comp , Object searchKey , SearchNode point ) { } }
point . reset ( ) ; synchronized ( this ) { internalFind ( comp , searchKey , point ) ; _pessimisticFinds ++ ; }
public class PIXConsumerAuditor { /** * Audits an ITI - 10 PIX Update Notification event for * Patient Identifier Cross - reference ( PIX ) Consumer actors . * @ param eventOutcome The event outcome indicator * @ param pixMgrIpAddress The IP Address of the PIX Manager that sent the event * @ param receivingFaci...
if ( ! isAuditorEnabled ( ) ) { return ; } auditPatientRecordEvent ( false , new IHETransactionEventTypeCodes . PIXUpdateNotification ( ) , eventOutcome , RFC3881EventCodes . RFC3881EventActionCodes . UPDATE , sendingFacility , sendingApp , null , pixMgrIpAddress , receivingFacility , receivingApp , getSystemAltUserId ...
public class Profiler { /** * Gets the time elapsed , from calling { @ link Profiler # startSection ( String ) startSection ( section ) } * to calling { @ link Profiler # endSection ( String ) endSection ( section ) } in milliseconds . < br > * If the elapsed section time was not profiled , returns - 1. * @ param...
section = section . toLowerCase ( ) ; if ( ! this . elapsedTime . containsKey ( section ) ) return - 1 ; return this . elapsedTime . get ( section ) ;
public class SampleMachineTransformer { /** * Replace known tags in the current data values with actual values as appropriate * @ param cr a reference to DataPipe from which to read the current map */ public void transform ( DataPipe cr ) { } }
Map < String , String > map = cr . getDataMap ( ) ; for ( String key : map . keySet ( ) ) { String value = map . get ( key ) ; if ( value . equals ( "#{customplaceholder}" ) ) { // Generate a random number int ran = rand . nextInt ( ) ; map . put ( key , String . valueOf ( ran ) ) ; } else if ( value . equals ( "#{divi...
public class DefaultErrorHandler { /** * Default implementation . May be overridden in subclasses < br > * Throws * { @ link com . github . avarabyeu . restendpoint . http . exception . RestEndpointException } * if Response status code starts from 4xx or 5xx * Throwed exceptions may be overridden in handle * me...
if ( ! hasError ( rs ) ) { return ; } handleError ( rs . getUri ( ) , rs . getHttpMethod ( ) , rs . getStatus ( ) , rs . getReason ( ) , rs . getBody ( ) ) ;
public class RequestBuilders { /** * Builds the HTML for the given response . * This is the root of the HTML . Should display all what is needed , including * the status , timing , etc . Then call the recursive builders for the * response ' s JSON . */ protected String build ( Response response ) { } }
StringBuilder sb = new StringBuilder ( ) ; sb . append ( "<div class='container'>" ) ; sb . append ( "<div class='row-fluid'>" ) ; sb . append ( "<div class='span12'>" ) ; sb . append ( buildJSONResponseBox ( response ) ) ; if ( response . _status == Response . Status . done ) response . toJava ( sb ) ; sb . append ( b...
public class TaskNotifier { /** * Default implementation : If outcome is " Assigned " , send only to assignee ' s email . * Otherwise , if Notice Groups attribute is present , the groups so specified * are unioned with any recipients resulting from evaluation of the Recipients Expression attribute . * If no Notic...
if ( "Assigned" . equals ( outcome ) ) { // send e - mail only to assignee return Arrays . asList ( new String [ ] { context . getAssignee ( ) . getEmail ( ) } ) ; } else { try { ContextEmailRecipients contextRecipients = new ContextEmailRecipients ( context ) ; String groups = context . getAttribute ( TaskAttributeCon...
public class DocumentUtils { /** * Returns a String representation for the XML Document . * @ param xmlDocument the XML Document * @ return String representation for the XML Document * @ throws IOException */ public static String documentToString ( Document xmlDocument ) throws IOException { } }
String encoding = ( xmlDocument . getXmlEncoding ( ) == null ) ? "UTF-8" : xmlDocument . getXmlEncoding ( ) ; OutputFormat format = new OutputFormat ( xmlDocument ) ; format . setLineWidth ( 65 ) ; format . setIndenting ( true ) ; format . setIndent ( 2 ) ; format . setEncoding ( encoding ) ; try ( Writer out = new Str...
public class OrderItem { /** * Get qualified name . * @ return qualified name */ public Optional < String > getQualifiedName ( ) { } }
if ( null == name ) { return Optional . absent ( ) ; } return null == owner ? Optional . of ( name ) : Optional . of ( owner + "." + name ) ;
public class Requests { /** * Create a new { @ link PublishNotify } instance that is used to publish * a list of metadata on a link between two { @ link Identifier } instances . * The { @ link MetadataLifetime } of the new metadata is set to * { @ link MetadataLifetime # session } . * @ param i1 the first { @ l...
if ( mdlist == null ) { throw new NullPointerException ( "mdlist is null" ) ; } PublishNotify pn = createPublishNotify ( ) ; fillMetadataHolder ( pn , i1 , i2 , mdlist ) ; return pn ;
public class NodeImpl { /** * { @ inheritDoc } */ public NodeDefinition getDefinition ( ) throws RepositoryException { } }
checkValid ( ) ; if ( nodeDefinition == null ) { NodeTypeDataManager nodeTypesHolder = session . getWorkspace ( ) . getNodeTypesHolder ( ) ; ExtendedNodeTypeManager nodeTypeManager = ( ExtendedNodeTypeManager ) session . getWorkspace ( ) . getNodeTypeManager ( ) ; if ( this . isRoot ( ) ) { // root - no parent if ( nod...
public class CmsVaadinUtils { /** * Gets the window which contains a given component . < p > * @ param component the component * @ return the window containing the component , or null if no component is found */ public static Window getWindow ( Component component ) { } }
if ( component == null ) { return null ; } else if ( component instanceof Window ) { return ( Window ) component ; } else { return getWindow ( component . getParent ( ) ) ; }
public class TagChecker { /** * Add general sibling elements . * @ see < a href = " http : / / www . w3 . org / TR / css3 - selectors / # general - sibling - combinators " > General sibling combinator < / a > */ private void addGeneralSiblingElements ( ) { } }
for ( Node node : nodes ) { Node n = helper . getNextSibling ( node ) ; while ( n != null ) { String tag = selector . getTagName ( ) ; if ( helper . nameMatches ( n , tag ) ) result . add ( n ) ; n = helper . getNextSibling ( n ) ; } }
public class LDPathResult { /** * Add a single result * @ param field * @ param result * @ return */ public boolean add ( String field , RDFNode result ) { } }
if ( ! this . result . containsKey ( field ) ) { this . result . put ( field , new ArrayList < RDFNode > ( ) ) ; } this . result . get ( field ) . add ( result ) ; return true ;
public class Zhang99CalibrationMatrixFromHomographies { /** * This computes the v _ ij vector found in the paper . */ private void computeV ( DMatrixRMaj h1 , DMatrixRMaj h2 , DMatrixRMaj v ) { } }
double h1x = h1 . get ( 0 , 0 ) ; double h1y = h1 . get ( 1 , 0 ) ; double h1z = h1 . get ( 2 , 0 ) ; double h2x = h2 . get ( 0 , 0 ) ; double h2y = h2 . get ( 1 , 0 ) ; double h2z = h2 . get ( 2 , 0 ) ; v . set ( 0 , 0 , h1x * h2x ) ; v . set ( 0 , 1 , h1x * h2y + h1y * h2x ) ; v . set ( 0 , 2 , h1y * h2y ) ; v . set ...
public class KeyVaultClientBaseImpl { /** * Retrieves a list of individual key versions with the same key name . * The full key identifier , attributes , and tags are provided in the response . This operation requires the keys / list permission . * @ param nextPageLink The NextLink from the previous successful call...
return AzureServiceFuture . fromPageResponse ( getKeyVersionsNextSinglePageAsync ( nextPageLink ) , new Func1 < String , Observable < ServiceResponse < Page < KeyItem > > > > ( ) { @ Override public Observable < ServiceResponse < Page < KeyItem > > > call ( String nextPageLink ) { return getKeyVersionsNextSinglePageAsy...
public class GrailsDomainBinder { /** * Calculates the mapping table for a many - to - many . One side of * the relationship has to " own " the relationship so that there is not a situation * where you have two mapping tables for left _ right and right _ left */ protected String calculateTableForMany ( ToMany prope...
NamingStrategy namingStrategy = getNamingStrategy ( sessionFactoryBeanName ) ; String propertyColumnName = namingStrategy . propertyToColumnName ( property . getName ( ) ) ; // fix for GRAILS - 5895 PropertyConfig config = getPropertyConfig ( property ) ; JoinTable jt = config != null ? config . getJoinTable ( ) : null...
public class CreateVatIdMapConstantsClass { /** * Instantiates a class via deferred binding . * @ return the new instance , which must be cast to the requested class */ public static VatIdMapSharedConstants create ( ) { } }
if ( vatIdMapConstants == null ) { // NOPMD it ' s thread save ! synchronized ( VatIdMapConstants . class ) { if ( vatIdMapConstants == null ) { vatIdMapConstants = GWT . create ( VatIdMapConstants . class ) ; } } } return vatIdMapConstants ;
public class Messages { /** * Converts a JSON object to a protobuf message * @ param builder the proto message type builder * @ param input the JSON object to convert */ public static Message fromJson ( Message . Builder builder , JsonObject input ) throws Exception { } }
Descriptors . Descriptor descriptor = builder . getDescriptorForType ( ) ; for ( Map . Entry < String , JsonElement > entry : input . entrySet ( ) ) { String protoName = CaseFormat . LOWER_CAMEL . to ( CaseFormat . LOWER_UNDERSCORE , entry . getKey ( ) ) ; Descriptors . FieldDescriptor field = descriptor . findFieldByN...
public class CmsUserDriver { /** * Creates a folder with the given path an properties , offline AND online . < p > * @ param dbc the current database context * @ param path the path to create the folder * @ param flags the resource flags * @ return the new created offline folder * @ throws CmsException if som...
// create the offline folder CmsResource resource = new CmsFolder ( new CmsUUID ( ) , new CmsUUID ( ) , path , CmsResourceTypeFolder . RESOURCE_TYPE_ID , ( CmsResource . FLAG_INTERNAL | flags ) , dbc . currentProject ( ) . getUuid ( ) , CmsResource . STATE_NEW , 0 , dbc . currentUser ( ) . getId ( ) , 0 , dbc . current...
public class CloudSpannerXAConnection { /** * Preconditions : 1 . flags must be one of TMNOFLAGS , TMRESUME or TMJOIN 2 . xid ! = null 3. * connection must not be associated with a transaction 4 . the TM hasn ' t seen the xid before * Implementation deficiency preconditions : 1 . TMRESUME not supported . 2 . if fla...
if ( logger . logDebug ( ) ) { debug ( "starting transaction xid = " + xid ) ; } // Check preconditions if ( flags != XAResource . TMNOFLAGS && flags != XAResource . TMRESUME && flags != XAResource . TMJOIN ) { throw new CloudSpannerXAException ( CloudSpannerXAException . INVALID_FLAGS , Code . INVALID_ARGUMENT , XAExc...
public class ValidationData { /** * Update field . * @ param field the field */ public void updateField ( Field field ) { } }
this . name = field . getName ( ) ; this . obj = TypeCheckUtil . isObjClass ( field ) ; this . list = TypeCheckUtil . isListClass ( field ) ; this . number = TypeCheckUtil . isNumberClass ( field ) ; this . enumType = field . getType ( ) . isEnum ( ) ; this . typeClass = field . getType ( ) ; this . type = field . getT...
public class DateUtil { /** * 创建相应的ChronoUnit * @ param dateUnit 单位 * @ return ChronoUnit */ private static ChronoUnit create ( DateUnit dateUnit ) { } }
switch ( dateUnit ) { case YEAR : return ChronoUnit . YEARS ; case MONTH : return ChronoUnit . MONTHS ; case DAY : return ChronoUnit . DAYS ; case HOUR : return ChronoUnit . HOURS ; case MINUTE : return ChronoUnit . MINUTES ; case SECOND : return ChronoUnit . SECONDS ; default : throw new DateUtilException ( "没有单位:" + ...
public class Config { /** * 配置属性 * @ param properties */ public void setProperties ( Properties properties ) { } }
if ( properties == null ) { // 默认驼峰 this . style = Style . camelhump ; return ; } String IDENTITY = properties . getProperty ( "IDENTITY" ) ; if ( StringUtil . isNotEmpty ( IDENTITY ) ) { setIDENTITY ( IDENTITY ) ; } String seqFormat = properties . getProperty ( "seqFormat" ) ; if ( StringUtil . isNotEmpty ( seqFormat ...
public class BeanPath { /** * Create a new DateTime path * @ param < A > * @ param property property name * @ param type property type * @ return property path */ @ SuppressWarnings ( "unchecked" ) protected < A extends Comparable > DateTimePath < A > createDateTime ( String property , Class < ? super A > type ...
return add ( new DateTimePath < A > ( ( Class ) type , forProperty ( property ) ) ) ;
public class ObjectAccessor { /** * Creates a copy of the wrapped object , where the copy type is an * anonymous subclass of the wrapped object ' s class . * Note : it does a " shallow " copy . Reference fields are not copied * recursively . * @ return A shallow copy . */ public T copyIntoAnonymousSubclass ( ) ...
T copy = Instantiator . of ( type ) . instantiateAnonymousSubclass ( ) ; return copyInto ( copy ) ;
public class ToStringUtils { /** * Transforms a list into a string of the from : * " V1 , V2 , V3" * Where the string versions of the key and value are derived from their toString ( ) function . * @ param < V > The type of the values of the list . * @ param list The list to be serialized to a string * @ retur...
List < String > asStrings = list . stream ( ) . map ( Object :: toString ) . collect ( Collectors . toList ( ) ) ; asStrings . forEach ( v -> { Preconditions . checkArgument ( v == null || ! v . contains ( "," ) , "Invalid value: %s" , v ) ; } ) ; return Joiner . on ( "," ) . join ( asStrings ) ;
public class ManifestIterator { /** * Adds the manifest referenced by the specified resource to the list . * @ param resource Resource that references a manifest file . * @ return The manifest that was added , or null if not found or an error occurred . */ private Manifest addToList ( Resource resource ) { } }
try { if ( resource != null && resource . exists ( ) ) { Manifest manifest = new ManifestEx ( resource ) ; manifests . add ( manifest ) ; return manifest ; } } catch ( Exception e ) { log . debug ( "Exception occurred reading manifest: " + resource ) ; } return null ;
public class HandlerManager { /** * Gets the handler at the given index . * @ param < H > the event handler type * @ param index the index * @ param type the handler ' s event type * @ return the given handler */ public < H extends EventHandler > H getHandler ( GwtEvent . Type < H > type , int index ) { } }
return this . eventBus . superGetHandler ( type , index ) ;
public class RepositoryQueryManager { /** * Clean all indexes and reindex all content . * @ param async true if the reindexing should be done in the background , or false if it should be done using this thread */ protected void cleanAndReindex ( boolean async ) { } }
final IndexWriter writer = getIndexWriter ( ) ; scan ( async , getIndexWriter ( ) , new Callable < Void > ( ) { @ SuppressWarnings ( "synthetic-access" ) @ Override public Void call ( ) throws Exception { writer . clearAllIndexes ( ) ; reindexContent ( true , writer ) ; return null ; } } ) ;
public class KafkaMsgConsumer { /** * Seeks to a specified offset . * @ param tpo * @ return { @ code true } if the consumer has subscribed to the specified * topic / partition , { @ code false } otherwise . * @ since 1.3.2 */ public boolean seek ( KafkaTopicPartitionOffset tpo ) { } }
KafkaConsumer < String , byte [ ] > consumer = _getConsumer ( tpo . topic ) ; return KafkaHelper . seek ( consumer , tpo ) ;
public class ZookeeperServiceRegistry { /** * private void configureServiceDiscovery ( ) { * this . zookeeperServiceDiscovery . configureServiceDiscovery ( this . * zookeeperServiceDiscovery . getServiceDiscoveryRef ( ) , this . curator , this . properties , * this . instanceSerializer , this . zookeeperServiceDi...
try { getServiceDiscovery ( ) . registerService ( registration . getServiceInstance ( ) ) ; } catch ( Exception e ) { rethrowRuntimeException ( e ) ; }
public class P3DatabaseReader { /** * Retrieve a list of the available P3 project names from a directory . * @ param directory directory containing P3 files * @ return list of project names */ public static final List < String > listProjectNames ( File directory ) { } }
List < String > result = new ArrayList < String > ( ) ; File [ ] files = directory . listFiles ( new FilenameFilter ( ) { @ Override public boolean accept ( File dir , String name ) { return name . toUpperCase ( ) . endsWith ( "STR.P3" ) ; } } ) ; if ( files != null ) { for ( File file : files ) { String fileName = fil...
public class ComputationGraph { /** * Get a given layer by name . */ public Layer getLayer ( String name ) { } }
Preconditions . checkState ( verticesMap . containsKey ( name ) , "Layer with name %s does not exist in the network" , name ) ; return verticesMap . get ( name ) . getLayer ( ) ;
public class MkCoPTreeNode { /** * Determines and returns the progressive approximation for the knn distances * of this node as the maximum of the progressive approximations of all * entries . * @ param k _ max the maximum k parameter * @ return the conservative approximation for the knn distances */ protected ...
if ( ! isLeaf ( ) ) { throw new UnsupportedOperationException ( "Progressive KNN-distance approximation " + "is only vailable in leaf nodes!" ) ; } // determine k _ 0 , y _ 1 , y _ kmax int k_0 = 0 ; double y_1 = Double . POSITIVE_INFINITY ; double y_kmax = Double . POSITIVE_INFINITY ; for ( int i = 0 ; i < getNumEntri...
public class Layers { /** * Adds multiple new layers on top . * @ param layers The new layers to add * @ param redraw Whether the map should be redrawn after adding the layers * @ see List # addAll ( Collection ) */ public synchronized void addAll ( Collection < Layer > layers , boolean redraw ) { } }
checkIsNull ( layers ) ; for ( Layer layer : layers ) { layer . setDisplayModel ( this . displayModel ) ; } this . layersList . addAll ( layers ) ; for ( Layer layer : layers ) { layer . assign ( this . redrawer ) ; } if ( redraw ) { this . redrawer . redrawLayers ( ) ; }
public class TimedMap { /** * This method removes any expired data from the map . */ private void purge ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && _tc . isEntryEnabled ( ) ) SibTr . entry ( this , _tc , "purge" ) ; Iterator < Map . Entry < K , TimedValue < V > > > it = _realMap . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry < K , TimedValue < V > > entry = it . next ( ) ; TimedValue < V > ...
public class FrameOutputWriter { /** * Get the frame sizes and their contents . * @ return a content tree for the frame details */ protected Content getFrameDetails ( ) { } }
HtmlTree frameset = HtmlTree . FRAMESET ( "20%,80%" , null , "Documentation frame" , "top.loadFrames()" ) ; if ( noOfPackages <= 1 ) { addAllClassesFrameTag ( frameset ) ; } else if ( noOfPackages > 1 ) { HtmlTree leftFrameset = HtmlTree . FRAMESET ( null , "30%,70%" , "Left frames" , "top.loadFrames()" ) ; addAllPacka...
public class DataSink { protected GenericDataSinkBase < T > translateToDataFlow ( Operator < T > input ) { } }
// select the name ( or create a default one ) String name = this . name != null ? this . name : this . format . toString ( ) ; GenericDataSinkBase < T > sink = new GenericDataSinkBase < > ( this . format , new UnaryOperatorInformation < > ( this . type , new NothingTypeInfo ( ) ) , name ) ; // set input sink . setInpu...
public class OpenInventoryMessage { /** * Handles the received { @ link Packet } on the client . < br > * Opens the GUI for the { @ link MalisisInventory } * @ param message the message * @ param ctx the ctx */ @ Override public void process ( Packet message , MessageContext ctx ) { } }
EntityPlayerSP player = ( EntityPlayerSP ) Utils . getClientPlayer ( ) ; if ( message . type == ContainerType . TYPE_TILEENTITY ) { IDirectInventoryProvider inventoryProvider = TileEntityUtils . getTileEntity ( IDirectInventoryProvider . class , Utils . getClientWorld ( ) , message . pos ) ; if ( inventoryProvider != n...
public class Matrices { /** * Defines a viewing transformation . This method is analogous to the now * deprecated { @ code gluLookAt } method . * @ param eye position of the eye point * @ param center position of the reference point * @ param up direction of the up vector * @ return */ public static final Mat...
final Vec3 f = center . subtract ( eye ) . getUnitVector ( ) ; Vec3 u = up . getUnitVector ( ) ; final Vec3 s = f . cross ( u ) . getUnitVector ( ) ; u = s . cross ( f ) ; return new Mat4 ( s . x , u . x , - f . x , 0f , s . y , u . y , - f . y , 0f , s . z , u . z , - f . z , 0f , - s . dot ( eye ) , - u . dot ( eye )...
public class PowerMockRunner { /** * Clean up some state to avoid OOM issues */ @ Override public void run ( RunNotifier notifier ) { } }
Description description = getDescription ( ) ; try { super . run ( notifier ) ; } finally { try { Whitebox . setInternalState ( description , "fAnnotations" , new Annotation [ ] { } ) ; } catch ( RuntimeException err ) { if ( err . getCause ( ) instanceof java . lang . NoSuchFieldException && err . getCause ( ) . getMe...
public class ChatApi { /** * Send a system command * Send a system command to the specified chat . * @ param id The ID of the chat interaction . ( required ) * @ param systemCommandData Request parameters . ( optional ) * @ return ApiResponse & lt ; ApiSuccessResponse & gt ; * @ throws ApiException If fail to...
com . squareup . okhttp . Call call = sendSystemCommandValidateBeforeCall ( id , systemCommandData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class PipelineBuilder { /** * Adds an operator expression to the pipeline . * @ param mTransaction * Transaction to operate with . * @ param mOperator * Operator type . */ public void addOperatorExpression ( final INodeReadTrx mTransaction , final String mOperator ) { } }
assert getPipeStack ( ) . size ( ) >= 1 ; final INodeReadTrx rtx = mTransaction ; final AbsAxis mOperand2 = getPipeStack ( ) . pop ( ) . getExpr ( ) ; // the unary operation only has one operator final AbsAxis mOperand1 = getPipeStack ( ) . pop ( ) . getExpr ( ) ; if ( getPipeStack ( ) . empty ( ) || getExpression ( ) ...
public class DetailedStatistics { /** * Return the standard deviation . The standard deviation is a measure of the variation in a series of values . Values with a * lower standard deviation has less variance in the values than a series of values with a higher standard deviation . * @ return the standard deviation ,...
Lock lock = this . getLock ( ) . readLock ( ) ; lock . lock ( ) ; try { return this . sigma ; } finally { lock . unlock ( ) ; }
public class JsonErrorResponseWriter { /** * Gets the json error output according to ODataException . * @ param exception ODataException * @ return errorJsonResponse * @ throws ODataRenderException If unable to render the json error message */ public String getJsonError ( ODataException exception ) throws ODataRe...
checkNotNull ( exception ) ; LOG . debug ( "Start building Json error document" ) ; ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( ) ; try { JsonGenerator jsonGenerator = JSON_FACTORY . createGenerator ( outputStream , JsonEncoding . UTF8 ) ; jsonGenerator . writeStartObject ( ) ; jsonGenerator . writ...
public class ConfigurationReader { /** * Parses the output parameter section . * @ param node * Reference to the current used xml node * @ param config * Reference to the ConfigSettings */ private void parseOutputConfig ( final Node node , final ConfigSettings config ) { } }
String name ; Long lValue ; Boolean bValue ; Node nnode ; NodeList list = node . getChildNodes ( ) ; int length = list . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nnode = list . item ( i ) ; name = nnode . getNodeName ( ) . toUpperCase ( ) ; if ( name . equals ( KEY_OUTPUT_MODE ) ) { OutputType oValue = O...
public class BaseKvDao { /** * { @ inheritDoc } */ @ Override public boolean keyExists ( String spaceId , String key ) throws IOException { } }
/* * Call get ( spaceId , key ) ! = null or delegate to kvStorage . keyExists ( spaceId , key ) ? * Since DELETE and PUT operations can be async , delegating to kvStorage . keyExists ( spaceId , * key ) would be preferred to avoid out - of - date data . */ return kvStorage . keyExists ( spaceId , key ) ;
public class AmazonS3Client { /** * Used for performance testing purposes only . */ private void putLocalObject ( final UploadObjectRequest reqIn , OutputStream os ) throws IOException { } }
UploadObjectRequest req = reqIn . clone ( ) ; final File fileOrig = req . getFile ( ) ; final InputStream isOrig = req . getInputStream ( ) ; if ( isOrig == null ) { if ( fileOrig == null ) throw new IllegalArgumentException ( "Either a file lor input stream must be specified" ) ; req . setInputStream ( new FileInputSt...
public class AmazonS3Client { /** * Returns a " complete " S3 specific signer , taking into the S3 bucket , key , * and the current S3 client configuration into account . */ protected Signer createSigner ( final Request < ? > request , final String bucketName , final String key ) { } }
return createSigner ( request , bucketName , key , false ) ;
public class FilterMatcher { /** * Compare two vectors as sets , e . g . " WHERE a in ( 1 , 2 , 3 ) " vs . " WHERE a in ( 2 , 1 , 3 ) " , to check whether two VVEs match . * \ pre all contents of VVE are either CVE or PVE . * @ param e1 first expression * @ param e2 second expression * @ return whether they are...
final Set < ConstantValueExpression > c1 = new HashSet < > ( ) , c2 = new HashSet < > ( ) ; final Set < Integer > tveIndices1 = new HashSet < > ( ) , tveIndices2 = new HashSet < > ( ) ; e1 . getArgs ( ) . forEach ( e -> { if ( e instanceof ConstantValueExpression || e instanceof ParameterValueExpression ) { c1 . add ( ...
public class MessageRetriever { /** * Print warning message , increment warning count . * @ param pos the position of the source * @ param msg message to print */ private void printWarning ( SourcePosition pos , String msg ) { } }
configuration . root . printWarning ( pos , msg ) ;
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1255:1 : innerCreator : Identifier classCreatorRest ; */ public final void innerCreator ( ) throws RecognitionException { } }
int innerCreator_StartIndex = input . index ( ) ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 132 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 1256:5 : ( Identifier classCreatorRest ) // src / main / resources / org / drools / compi...
public class CmsErrorDialog { /** * Shows the error dialog . < p > * @ param message the error message * @ param t the error to be displayed * @ param onClose executed on close */ public static void showErrorDialog ( String message , Throwable t , Runnable onClose ) { } }
Window window = prepareWindow ( DialogWidth . wide ) ; window . setCaption ( Messages . get ( ) . getBundle ( A_CmsUI . get ( ) . getLocale ( ) ) . key ( Messages . GUI_ERROR_0 ) ) ; window . setContent ( new CmsErrorDialog ( message , t , onClose , window ) ) ; A_CmsUI . get ( ) . addWindow ( window ) ;