signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ComponentDescriptorFactory { /** * Create a component descriptor for the passed component implementation class , hint and component role class . * @ param componentClass the component implementation class * @ param hint the hint * @ param componentRoleType the component role type * @ return the com...
DefaultComponentDescriptor descriptor = new DefaultComponentDescriptor ( ) ; descriptor . setRoleType ( componentRoleType ) ; descriptor . setImplementation ( componentClass ) ; descriptor . setRoleHint ( hint ) ; descriptor . setInstantiationStrategy ( createComponentInstantiationStrategy ( componentClass ) ) ; // Set...
public class Text { /** * Performs variable replacement on the given string value . Each < code > $ { . . . } < / code > sequence * within the given value is replaced with the value of the named parser variable . If a variable * is not found in the properties an IllegalArgumentException is thrown unless * < code ...
StringBuilder result = new StringBuilder ( ) ; // Value : // | | p | - - > | q | - - > | int p = 0 , q = value . indexOf ( "${" ) ; // Find first $ { while ( q != - 1 ) { result . append ( value . substring ( p , q ) ) ; // Text before $ { p = q ; q = value . indexOf ( "}" , q + 2 ) ; // Find } if ( q != - 1 ) { String...
public class CheckArg { /** * Check that the argument is non - positive ( < = 0 ) . * @ param argument The argument * @ param name The name of the argument * @ throws IllegalArgumentException If argument is positive ( > 0) */ public static void isNonPositive ( int argument , String name ) { } }
if ( argument > 0 ) { throw new IllegalArgumentException ( CommonI18n . argumentMayNotBePositive . text ( name , argument ) ) ; }
public class JFapDiscriminator { /** * begin F188491 */ public void cleanUpState ( VirtualConnection vc ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "cleanUpState" , vc ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "cleanUpState" ) ;
public class TransactionLogger { /** * Start component timer for current instance * @ param type - of component */ public static void startTimer ( final String type ) { } }
TransactionLogger instance = getInstance ( ) ; if ( instance == null ) { return ; } instance . components . putIfAbsent ( type , new Component ( type ) ) ; instance . components . get ( type ) . startTimer ( ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CodeType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link CodeType } { @ code > } */ @ XmlElement...
return new JAXBElement < CodeType > ( _CoordinateOperationName_QNAME , CodeType . class , null , value ) ;
import java . util . * ; class LuckyNumbers { /** * This function generates the first ' limit ' number of lucky numbers . Lucky numbers are numbers in a list * where numbers with indices being multiples of the index of the previous lucky number are eliminated . */ public static ArrayList < Integer > generateLuckyNumb...
ArrayList < Integer > sequence = new ArrayList < > ( ) ; for ( int i = - 1 ; i <= limit * limit + 9 ; i += 2 ) { sequence . add ( i ) ; } int index = 2 ; while ( index < sequence . size ( ) ) { int num = sequence . get ( index ) ; sequence . removeIf ( n -> sequence . indexOf ( n ) != sequence . lastIndexOf ( n ) && se...
public class Scoreds { /** * Comparator which compares Scoreds first by score , then by item , where the item ordering to use * is explicitly specified . */ public static final < T extends Comparable < T > > Ordering < Scored < T > > ByScoreThenByItem ( Ordering < T > itemOrdering ) { } }
final Ordering < Scored < T > > byItem = itemOrdering . onResultOf ( Scoreds . < T > itemsOnly ( ) ) ; final Ordering < Scored < T > > byScore = Scoreds . < T > ByScoreOnly ( ) ; return Ordering . compound ( ImmutableList . of ( byScore , byItem ) ) ;
public class JsonStringToJsonIntermediateConverter { /** * Parses primitive types * @ param schema * @ param value * @ return * @ throws DataConversionException */ private JsonElement parsePrimitiveType ( JsonSchema schema , JsonElement value ) throws DataConversionException { } }
if ( ( schema . isType ( NULL ) || schema . isNullable ( ) ) && value . isJsonNull ( ) ) { return JsonNull . INSTANCE ; } if ( ( schema . isType ( NULL ) && ! value . isJsonNull ( ) ) || ( ! schema . isType ( NULL ) && value . isJsonNull ( ) ) ) { throw new DataConversionException ( "Type mismatch for " + value . toStr...
public class NodeEntryFactory { /** * Create NodeEntryImpl from map data . It will convert " tags " of type String as a comma separated list of tags , or * " tags " a collection of strings into a set . It will remove properties excluded from allowed import . * @ param map input map data * @ return new entry * @...
final NodeEntryImpl nodeEntry = new NodeEntryImpl ( ) ; final HashMap < String , Object > newmap = new HashMap < String , Object > ( map ) ; for ( final String excludeProp : excludeProps ) { newmap . remove ( excludeProp ) ; } if ( null != newmap . get ( "tags" ) && newmap . get ( "tags" ) instanceof String ) { String ...
public class SendableTextMessage { /** * This builder will be created with the text you provide already added with HTML formatting enabled . * @ param text The text you would like the builder to be created with * @ return A SendableTextMessageBuilder object with the text provided already added to it in HTML format ...
return builder ( ) . message ( text ) . parseMode ( ParseMode . HTML ) ;
public class CircularBufferDouble { /** * Adds a new value . * @ param value new value */ public void addDouble ( double value ) { } }
data [ endOffset ] = value ; endOffset ++ ; // Grow the buffer if needed if ( endOffset == data . length && ! reachedMax ) resize ( ) ; // Loop over and advance the start point if needed if ( endOffset == data . length ) { endOffset = 0 ; } if ( endOffset == startOffset ) startOffset ++ ; if ( startOffset == data . len...
public class SimpleSocketPoolImpl { /** * 创建连接池 * @ param parameters * Socket连接池参数对象 */ public synchronized void buildThriftSocketPool ( ClientSocketPoolParameters parameters ) { } }
if ( ! ServerUtil . checkHostAndPort ( parameters . getHost ( ) , parameters . getPort ( ) ) ) throw new IllegalArgumentException ( "Server host or port is null !" ) ; SimpleSocketPoolImpl self = selfMap . get ( parameters . getKey ( ) ) ; if ( self == null ) self = init ( parameters ) ; try { for ( byte i = 0 ; i < si...
public class TitanFactory { /** * Load a properties file containing a Titan graph configuration . * < ol > * < li > Load the file contents into a { @ link org . apache . commons . configuration . PropertiesConfiguration } < / li > * < li > For each key that points to a configuration object that is either a direct...
Preconditions . checkArgument ( file != null && file . exists ( ) && file . isFile ( ) && file . canRead ( ) , "Need to specify a readable configuration file, but was given: %s" , file . toString ( ) ) ; try { PropertiesConfiguration configuration = new PropertiesConfiguration ( file ) ; final File tmpParent = file . g...
public class AbstractGpxParserTrk { /** * Fires whenever an XML end markup is encountered . It catches attributes of * trackPoints , trackSegments or routes and saves them in corresponding * values [ ] . * @ param uri URI of the local element * @ param localName Name of the local element ( without prefix ) * ...
// currentElement represents the last string encountered in the document setCurrentElement ( getElementNames ( ) . pop ( ) ) ; if ( getCurrentElement ( ) . equalsIgnoreCase ( GPXTags . TRK ) ) { // parent . setTrksegID ( getTrksegID ( ) ) ; // parent . setTrkptID ( getTrkptID ( ) ) ; // Set the track geometry . MultiLi...
public class IoUtils { /** * Copy input stream to output stream and close them both * @ param is input stream * @ param os output stream * @ throws IOException for any error */ public static void copyStreamAndClose ( InputStream is , OutputStream os ) throws IOException { } }
try { copyStream ( is , os , DEFAULT_BUFFER_SIZE ) ; // throw an exception if the close fails since some data might be lost is . close ( ) ; os . close ( ) ; } finally { // . . . but still guarantee that they ' re both closed safeClose ( is ) ; safeClose ( os ) ; }
public class AdjunctManager { /** * Controls whether the given resource can be served to browsers . * This method can be overridden by the sub classes to change the access control behavior . * { @ link AdjunctManager } is capable of serving all the resources visible * in the classloader by default . If the resour...
// does it have an adjunct directory marker ? int idx = absolutePath . lastIndexOf ( '/' ) ; if ( idx > 0 && classLoader . getResource ( absolutePath . substring ( 0 , idx ) + "/.adjunct" ) != null ) return true ; // backward compatible behaviour return absolutePath . endsWith ( ".gif" ) || absolutePath . endsWith ( "....
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcProductSelect ( ) { } }
if ( ifcProductSelectEClass == null ) { ifcProductSelectEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1151 ) ; } return ifcProductSelectEClass ;
public class ModelBatch { /** * Convenience function to write the current state of the modelBatch out to a file , including all factors . * WARNING : These files can get quite large , if you ' re using large embeddings as features . * @ param filename the file to write the batch to * @ throws IOException */ publi...
FileOutputStream fos = new FileOutputStream ( filename ) ; writeToStream ( fos ) ; fos . close ( ) ;
public class PointLocationFormatter { /** * Formats a longitude as an ISO 6709 string . * @ param longitude * Longitude to format * @ param formatType * Format type * @ return Formatted string * @ throws FormatterException * On an exception */ public static String formatLongitude ( final Longitude longitu...
if ( longitude == null ) { throw new FormatterException ( "No point location provided" ) ; } if ( formatType == null ) { throw new FormatterException ( "No format type provided" ) ; } final String formatted ; switch ( formatType ) { case HUMAN_LONG : formatted = longitude . toString ( ) ; break ; case HUMAN_MEDIUM : fo...
public class WorkingDirectories { /** * Get the directory where the compiled jasper reports should be put . * @ param configuration the configuration for the current app . */ public final File getJasperCompilation ( final Configuration configuration ) { } }
File jasperCompilation = new File ( getWorking ( configuration ) , "jasper-bin" ) ; createIfMissing ( jasperCompilation , "Jasper Compilation" ) ; return jasperCompilation ;
public class JacksonUtils { /** * Extract value from a { @ link JsonNode } . * @ param node * @ param clazz * @ return */ public static < T > T asValue ( JsonNode node , Class < T > clazz ) { } }
return node != null ? ValueUtils . convertValue ( node , clazz ) : null ;
public class Ginv { /** * Swap components in the two columns . * @ param matrix * the matrix to modify * @ param col1 * the first row * @ param col2 * the second row */ public static void swapCols ( double [ ] [ ] matrix , int col1 , int col2 ) { } }
double temp = 0 ; int rows = matrix . length ; double [ ] r = null ; for ( int row = 0 ; row < rows ; row ++ ) { r = matrix [ row ] ; temp = r [ col1 ] ; r [ col1 ] = r [ col2 ] ; r [ col2 ] = temp ; }
public class MailProvider { /** * Creates and saves a new mail */ public Observable < Mail > addMailWithDelay ( final Mail mail ) { } }
return Observable . defer ( new Func0 < Observable < Mail > > ( ) { @ Override public Observable < Mail > call ( ) { delay ( ) ; Observable o = checkExceptions ( ) ; if ( o != null ) { return o ; } return Observable . just ( mail ) ; } } ) . flatMap ( new Func1 < Mail , Observable < Mail > > ( ) { @ Override public Obs...
public class FuncExtFunction { /** * Execute the function . The function must return * a valid object . * @ param xctxt The current execution context . * @ return A valid XObject . * @ throws javax . xml . transform . TransformerException */ public XObject execute ( XPathContext xctxt ) throws javax . xml . tra...
if ( xctxt . isSecureProcessing ( ) ) throw new javax . xml . transform . TransformerException ( XPATHMessages . createXPATHMessage ( XPATHErrorResources . ER_EXTENSION_FUNCTION_CANNOT_BE_INVOKED , new Object [ ] { toString ( ) } ) ) ; XObject result ; Vector argVec = new Vector ( ) ; int nArgs = m_argVec . size ( ) ; ...
public class Configuration { /** * Get the value of the < code > name < / code > property as a < code > long < / code > . * If no such property is specified , or if the specified value is not a valid * < code > long < / code > , then < code > defaultValue < / code > is returned . * @ param name property name . ...
String valueString = get ( name ) ; if ( valueString == null ) return defaultValue ; try { String hexString = getHexDigits ( valueString ) ; if ( hexString != null ) { return Long . parseLong ( hexString , 16 ) ; } return Long . parseLong ( valueString ) ; } catch ( NumberFormatException e ) { return defaultValue ; }
public class HibernateClient { /** * ( non - Javadoc ) * @ see com . impetus . kundera . client . Client # getColumnsById ( java . lang . String , * java . lang . String , java . lang . String , java . lang . String , java . lang . Object , * java . lang . Class ) */ @ Override public < E > List < E > getColumnsB...
StringBuffer sqlQuery = new StringBuffer ( ) ; sqlQuery . append ( "SELECT " ) . append ( inverseJoinColumnName ) . append ( " FROM " ) . append ( getFromClause ( schemaName , joinTableName ) ) . append ( " WHERE " ) . append ( joinColumnName ) . append ( "='" ) . append ( parentId ) . append ( "'" ) ; Session s = getS...
public class BasicAnnotationProcessor { /** * Returns the previously deferred elements . */ private ImmutableMap < String , Optional < ? extends Element > > deferredElements ( ) { } }
ImmutableMap . Builder < String , Optional < ? extends Element > > deferredElements = ImmutableMap . builder ( ) ; for ( ElementName elementName : deferredElementNames ) { deferredElements . put ( elementName . name ( ) , elementName . getElement ( elements ) ) ; } return deferredElements . build ( ) ;
public class ApplicationModule { /** * Override for customizing XmlMapper and ObjectMapper */ public void bindMappers ( ) { } }
JacksonXmlModule xmlModule = new JacksonXmlModule ( ) ; xmlModule . setDefaultUseWrapper ( false ) ; XmlMapper xmlMapper = new XmlMapper ( xmlModule ) ; xmlMapper . enable ( ToXmlGenerator . Feature . WRITE_XML_DECLARATION ) ; this . bind ( XmlMapper . class ) . toInstance ( xmlMapper ) ; ObjectMapper objectMapper = ne...
public class Element { /** * Waits for specific element at locator to be not visible within period of * specified time * @ param time * Milliseconds * @ throws WidgetException */ public void waitForNotVisible ( final long time ) throws WidgetException { } }
try { waitForCommand ( new ITimerCallback ( ) { @ Override public boolean execute ( ) throws WidgetException { return ! isVisible ( ) ; } @ Override public String toString ( ) { return "Waiting for element with locator: " + locator + " to not be visible" ; } } , time ) ; } catch ( Exception e ) { throw new WidgetExcept...
public class OptionsDoclet { /** * Tests the validity of command - line arguments passed to this doclet . Returns true if the option * usage is valid , and false otherwise . This method is automatically invoked by Javadoc . * < p > Also sets fields from the command - line arguments . * @ param options the command...
boolean hasDocFile = false ; boolean hasOutFile = false ; boolean hasDestDir = false ; boolean hasFormat = false ; boolean inPlace = false ; String docFile = null ; String outFile = null ; for ( int oi = 0 ; oi < options . length ; oi ++ ) { String [ ] os = options [ oi ] ; String opt = os [ 0 ] . toLowerCase ( ) ; if ...
public class HeaderHandlingDispatcherPortlet { /** * Processes the actual dispatching to the handler for render requests . * < p > The handler will be obtained by applying the portlet ' s HandlerMappings in order . The * HandlerAdapter will be obtained by querying the portlet ' s installed HandlerAdapters to find ...
super . doRenderService ( request , response ) ;
public class PasswordImpl { /** * reads the password defined in the Lucee configuration , this can also in older formats ( only * hashed or encrypted ) * @ param el * @ param salt * @ param isDefault * @ return */ public static Password readFromXML ( Element el , String salt , boolean isDefault ) { } }
String prefix = isDefault ? "default-" : "" ; // first we look for the hashed and salted password String pw = el . getAttribute ( prefix + "hspw" ) ; if ( ! StringUtil . isEmpty ( pw , true ) ) { // password is only of use when there is a salt as well if ( salt == null ) return null ; return new PasswordImpl ( ORIGIN_H...
public class RemoteRecordOwner { /** * Get the database owner for this recordowner . * Typically , the Environment is returned . * If you are using transactions , then the recordowner is returned , as the recordowner * needs private database connections to track transactions . * Just remember , if you are manag...
DatabaseOwner databaseOwner = null ; if ( DBConstants . FALSE . equalsIgnoreCase ( this . getProperty ( SQLParams . AUTO_COMMIT_PARAM ) ) ) databaseOwner = this ; // If auto - commit is off , I am the db owner . else if ( ! Utility . getSystemSuffix ( this . getProperty ( DBConstants . SYSTEM_NAME ) , null ) . equalsIg...
public class Sha256Hash { /** * Calculates the hash of hash on the given chunks of bytes . This is equivalent to concatenating the two * chunks and then passing the result to { @ link # hashTwice ( byte [ ] ) } . */ public static byte [ ] hashTwice ( byte [ ] input1 , byte [ ] input2 ) { } }
MessageDigest digest = newDigest ( ) ; digest . update ( input1 ) ; digest . update ( input2 ) ; return digest . digest ( digest . digest ( ) ) ;
public class POIProxy { /** * This method is used to get the pois from a service and return a GeoJSON * document with the data retrieved given a Z / X / Y tile . * @ param id * The id of the service * @ param z * The zoom level * @ param x * The x tile * @ param y * The y tile * @ return The GeoJSON...
DescribeService describeService = getDescribeServiceByID ( id ) ; Extent e1 = TileConversor . tileOSMMercatorBounds ( x , y , z ) ; double [ ] minXY = ConversionCoords . reproject ( e1 . getMinX ( ) , e1 . getMinY ( ) , CRSFactory . getCRS ( MERCATOR_SRS ) , CRSFactory . getCRS ( GEODETIC_SRS ) ) ; double [ ] maxXY = C...
public class JobsImpl { /** * Adds a job to the specified account . * The Batch service supports two ways to control the work done as part of a job . In the first approach , the user specifies a Job Manager task . The Batch service launches this task when it is ready to start the job . The Job Manager task controls a...
addWithServiceResponseAsync ( job , jobAddOptions ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Matcher { /** * Returns the input subsequence captured by the given group during the * previous match operation . * < p > For a matcher < i > m < / i > , input sequence < i > s < / i > , and group index * < i > g < / i > , the expressions < i > m . < / i > < tt > group ( < / tt > < i > g < / i > < tt...
MemReg mr = bounds ( group ) ; if ( mr == null ) return null ; return getString ( mr . in , mr . out ) ;
public class nat64 { /** * Use this API to update nat64. */ public static base_response update ( nitro_service client , nat64 resource ) throws Exception { } }
nat64 updateresource = new nat64 ( ) ; updateresource . name = resource . name ; updateresource . acl6name = resource . acl6name ; updateresource . netprofile = resource . netprofile ; return updateresource . update_resource ( client ) ;
public class QueryParameterWrap { /** * 添加命名的参数 : propertyName - > 命名的参数 * @ param name * @ param values * @ return */ public QueryParameterWrap addParameters ( String name , Collection < ? > values ) { } }
this . namedParameter . put ( name , values ) ; return this ;
public class BlurImageOps { /** * Applies a mean box filter . * @ param input Input image . Not modified . * @ param output ( Optional ) Storage for output image , Can be null . Modified . * @ param radius Radius of the box blur function . * @ param storage ( Optional ) Storage for intermediate results . Same s...
if ( radius <= 0 ) throw new IllegalArgumentException ( "Radius must be > 0" ) ; output = InputSanityCheck . checkDeclare ( input , output ) ; storage = InputSanityCheck . checkDeclare ( input , storage ) ; boolean processed = BOverrideBlurImageOps . invokeNativeMean ( input , output , radius , storage ) ; if ( ! proce...
public class Murmur64 { /** * Calculates hash from a buffer */ public static long generate ( long hash , final byte [ ] buffer , final int offset , final int length ) { } }
final long m = 0xc6a4a7935bd1e995L ; final int r = 47 ; hash ^= length * m ; int len8 = length / 8 ; for ( int i = 0 ; i < len8 ; i ++ ) { final int index = i * 8 + offset ; long k = ( ( buffer [ index + 0 ] & 0xffL ) | ( ( buffer [ index + 1 ] & 0xffL ) << 8 ) | ( ( buffer [ index + 2 ] & 0xffL ) << 16 ) | ( ( buffer ...
public class LinkedOptionalMap { /** * Creates an { @ code LinkedOptionalMap } from the provided map . * < p > This method is the equivalent of { @ link Optional # of ( Object ) } but for maps . To support more than one { @ code NULL } * key , an optional map requires a unique string name to be associated with each...
LinkedHashMap < String , KeyValue < K , V > > underlyingMap = new LinkedHashMap < > ( sourceMap . size ( ) ) ; sourceMap . forEach ( ( k , v ) -> { String keyName = keyNameGetter . apply ( k ) ; underlyingMap . put ( keyName , new KeyValue < > ( k , v ) ) ; } ) ; return new LinkedOptionalMap < > ( underlyingMap ) ;
public class CubicInterpolation { /** * Used by HllEstimators */ static double usingXArrAndYStride ( final double [ ] xArr , final double yStride , final double x ) { } }
final int xArrLen = xArr . length ; final int xArrLenM1 = xArrLen - 1 ; final int offset ; assert ( ( xArrLen >= 4 ) && ( x >= xArr [ 0 ] ) && ( x <= xArr [ xArrLenM1 ] ) ) ; if ( x == xArr [ xArrLenM1 ] ) { /* corner case */ return ( yStride * ( xArrLenM1 ) ) ; } offset = findStraddle ( xArr , x ) ; // uses recursion ...
public class CPDefinitionSpecificationOptionValueLocalServiceUtil { /** * Returns the cp definition specification option value matching the UUID and group . * @ param uuid the cp definition specification option value ' s UUID * @ param groupId the primary key of the group * @ return the matching cp definition spe...
return getService ( ) . fetchCPDefinitionSpecificationOptionValueByUuidAndGroupId ( uuid , groupId ) ;
public class SasFileParser { /** * The function to process element of row . * @ param source an array of bytes containing required data . * @ param offset the offset in source of required data . * @ param currentColumnIndex index of the current element . * @ return object storing the data of the element . */ pr...
byte [ ] temp ; int length = columnsDataLength . get ( currentColumnIndex ) ; if ( columns . get ( currentColumnIndex ) . getType ( ) == Number . class ) { temp = Arrays . copyOfRange ( source , offset + ( int ) ( long ) columnsDataOffset . get ( currentColumnIndex ) , offset + ( int ) ( long ) columnsDataOffset . get ...
public class AbstractSaml20ObjectBuilder { /** * Inflate authn request string . * @ param decodedBytes the decoded bytes * @ return the string */ protected String inflateAuthnRequest ( final byte [ ] decodedBytes ) { } }
val inflated = CompressionUtils . inflate ( decodedBytes ) ; if ( ! StringUtils . isEmpty ( inflated ) ) { return inflated ; } return CompressionUtils . decodeByteArrayToString ( decodedBytes ) ;
public class Report { /** * create */ public static Report create ( Map < String , Object > params ) throws EasyPostException { } }
return create ( params , null ) ;
public class J4pReadRequest { /** * { @ inheritDoc } */ @ Override List < String > getRequestParts ( ) { } }
if ( hasSingleAttribute ( ) ) { List < String > ret = super . getRequestParts ( ) ; ret . add ( getAttribute ( ) ) ; addPath ( ret , path ) ; return ret ; } else if ( hasAllAttributes ( ) && path == null ) { return super . getRequestParts ( ) ; } // A GET request cant be used for multiple attribute fetching or for fetc...
public class ComponentNameSpaceConfiguration { /** * Returns a list of EJB ( Remote ) References ( & lt ; ejb - ref > ) configured * for the component . */ public List < ? extends EJBRef > getEJBRefs ( ) { } }
if ( ivJNDIEnvironmentRefs != null && ivJNDIEnvironmentRefs . containsKey ( EJBRef . class ) ) { throw new IllegalStateException ( ) ; } return ivEJBRefs ;
public class StoreTxLogEngine { /** * 追加一条事务日志 */ public StoreTxLogPosition append ( Operation op , K key , V value ) throws DBException { } }
try { try { return this . append ( storeTxLog , op , key , value ) ; } catch ( CapacityNotEnoughException notEnough ) { // 要新建一个文件 return this . append ( nextNewStoreTxLog ( ) , op , key , value ) ; } } catch ( Exception e ) { throw new DBException ( "append dbLog error:" + e . getMessage ( ) , e ) ; }
public class SessionContext { /** * For remote InvalidateAll processing . . . calls remoteInvalidate method on the * store */ public void remoteInvalidate ( String sessionId , boolean backendUpdate ) { } }
IStore iStore = _coreHttpSessionManager . getIStore ( ) ; ( ( MemoryStore ) iStore ) . remoteInvalidate ( sessionId , backendUpdate ) ;
public class X500Principal { /** * Returns a string representation of the X . 500 distinguished name * using the specified format . Valid values for the format are * " RFC1779 " and " RFC2253 " ( case insensitive ) . " CANONICAL " is not * permitted and an { @ code IllegalArgumentException } will be thrown . * ...
if ( oidMap == null ) { throw new NullPointerException ( sun . security . util . ResourcesMgr . getString ( "provided.null.OID.map" ) ) ; } if ( format != null ) { if ( format . equalsIgnoreCase ( RFC1779 ) ) { return thisX500Name . getRFC1779Name ( oidMap ) ; } else if ( format . equalsIgnoreCase ( RFC2253 ) ) { retur...
public class OpenSSLFactory { /** * Creates the server socket . */ public ServerSocketBar create ( InetAddress addr , int port ) throws ConfigException , IOException { } }
synchronized ( _sslInitLock ) { if ( _stdServerSocket != null ) throw new IOException ( L . l ( "Can't create duplicate ssl factory." ) ) ; initConfig ( ) ; _stdServerSocket = ServerSocketJni . createJNI ( addr , port ) ; initSSL ( ) ; return this ; }
public class PdfStamperImp { /** * Sets the display duration for the page ( for presentations ) * @ param seconds the number of seconds to display the page . A negative value removes the entry * @ param page the page where the duration will be applied . The first page is 1 */ void setDuration ( int seconds , int pa...
PdfDictionary pg = reader . getPageN ( page ) ; if ( seconds < 0 ) pg . remove ( PdfName . DUR ) ; else pg . put ( PdfName . DUR , new PdfNumber ( seconds ) ) ; markUsed ( pg ) ;
public class ServiceLoaderHelper { /** * Uses the { @ link ServiceLoader } to load all SPI implementations of the * passed class and return only the first instance . * @ param < T > * The implementation type to be loaded * @ param aSPIClass * The SPI interface class . May not be < code > null < / code > . *...
return getFirstSPIImplementation ( aSPIClass , ClassLoaderHelper . getDefaultClassLoader ( ) , aLogger ) ;
public class JDBC4Statement { /** * Executes the given SQL statement , which may return multiple results . */ @ Override public boolean execute ( String sql ) throws SQLException { } }
checkClosed ( ) ; VoltSQL query = VoltSQL . parseSQL ( sql ) ; return this . execute ( query ) ;
public class PreprocessorContext { /** * Find value among local and global variables for a name . It finds in the order : special processors , local variables , global variables * @ param name the name for the needed variable , it will be normalized to the supported format * @ param enforceUnknownVarAsNull if true ...
if ( name == null ) { return null ; } final String normalized = assertNotNull ( PreprocessorUtils . normalizeVariableName ( name ) ) ; if ( normalized . isEmpty ( ) ) { return null ; } final SpecialVariableProcessor processor = mapVariableNameToSpecialVarProcessor . get ( normalized ) ; if ( processor != null ) { retur...
public class BaseGraph { /** * Determine next free edgeId and ensure byte capacity to store edge * @ return next free edgeId */ protected int nextEdgeId ( ) { } }
int nextEdge = edgeCount ; edgeCount ++ ; if ( edgeCount < 0 ) throw new IllegalStateException ( "too many edges. new edge id would be negative. " + toString ( ) ) ; edges . ensureCapacity ( ( ( long ) edgeCount + 1 ) * edgeEntryBytes ) ; return nextEdge ;
public class JerseyBinding { /** * Binds jersey specific component ( component implements jersey interface or extends class ) . * Specific binding is required for types directly supported by jersey ( e . g . ExceptionMapper ) . * Such types must be bound to target interface directly , otherwise jersey would not be ...
// resolve generics of specific type final GenericsContext context = GenericsResolver . resolve ( type ) . type ( specificType ) ; final List < Type > genericTypes = context . genericTypes ( ) ; final Type [ ] generics = genericTypes . toArray ( new Type [ 0 ] ) ; final Type bindingType = generics . length > 0 ? new Pa...
public class NamespacesInner { /** * Patches the existing namespace . * @ param resourceGroupName The name of the resource group . * @ param namespaceName The namespace name . * @ param parameters Parameters supplied to patch a Namespace Resource . * @ throws IllegalArgumentException thrown if parameters fail t...
return patchWithServiceResponseAsync ( resourceGroupName , namespaceName , parameters ) . map ( new Func1 < ServiceResponse < NamespaceResourceInner > , NamespaceResourceInner > ( ) { @ Override public NamespaceResourceInner call ( ServiceResponse < NamespaceResourceInner > response ) { return response . body ( ) ; } }...
public class GapPenalties { /** * Create and return a new gap penalties with the specified penalties . * @ param match match penalty * @ param replace replace penalty * @ param insert insert penalty * @ param delete delete penalty * @ param extend extend penalty * @ return a new gap penalties with the speci...
return new GapPenalties ( ( short ) match , ( short ) replace , ( short ) insert , ( short ) delete , ( short ) extend ) ;
public class SoapHeaderScanner { /** * Returns true if the index points to an XML preamble of the following example form : * < pre > * & lt ; ? xml version = " 1.0 " ? > * < / pre > * @ param index */ private boolean isPreamble ( int index ) { } }
if ( index <= buffer . length ( ) - 6 ) { if ( buffer . get ( index ) == '<' && buffer . get ( index + 1 ) == '?' && buffer . get ( index + 2 ) == 'x' && buffer . get ( index + 3 ) == 'm' && buffer . get ( index + 4 ) == 'l' && buffer . get ( index + 5 ) == ' ' ) { return true ; } } return false ;
public class Cashflow { /** * This method returns the value random variable of the product within the specified model , evaluated at a given evalutationTime . * Note : For a lattice this is often the value conditional to evalutationTime , for a Monte - Carlo simulation this is the ( sum of ) value discounted to evalu...
// Note : We use > here . To distinguish an end of day valuation use hour of day for cash flows and evaluation date . if ( evaluationTime > flowDate ) { return model . getRandomVariableForConstant ( 0.0 ) ; } RandomVariable values = model . getRandomVariableForConstant ( flowAmount ) ; if ( isPayer ) { values = values ...
public class CookieUtils { /** * 默认按照应用上下文进行设置 * @ param request * @ param response * @ param name * @ param value * @ param age * @ throws Exception */ public static void addCookie ( HttpServletRequest request , HttpServletResponse response , String name , String value , int age ) { } }
String contextPath = request . getContextPath ( ) ; if ( ! contextPath . endsWith ( "/" ) ) { contextPath += "/" ; } addCookie ( request , response , name , value , contextPath , age ) ;
public class ByteBuffer { /** * Writes the given long to the current position and increases the position by 8. * The long is converted to bytes using the current byte order . * @ param value the long to write . * @ return this buffer . * @ exception BufferOverflowException if position is greater than { @ code l...
int newPosition = position + 8 ; // if ( newPosition > limit ) { // throw new BufferOverflowException ( ) ; putLong ( position , value ) ; position = newPosition ; return this ;
public class Maybe { /** * Converts this Maybe into a Single instance composing disposal * through and turning an empty Maybe into a Single that emits the given * value through onSuccess . * < dl > * < dt > < b > Scheduler : < / b > < / dt > * < dd > { @ code toSingle } does not operate by default on a partic...
ObjectHelper . requireNonNull ( defaultValue , "defaultValue is null" ) ; return RxJavaPlugins . onAssembly ( new MaybeToSingle < T > ( this , defaultValue ) ) ;
public class DelegatingLinkRelationProvider { /** * ( non - Javadoc ) * @ see org . springframework . hateoas . server . LinkRelationProvider # getCollectionResourceRelFor ( java . lang . Class ) */ @ Override public LinkRelation getCollectionResourceRelFor ( java . lang . Class < ? > type ) { } }
LookupContext context = LookupContext . forCollectionResourceRelLookup ( type ) ; return providers . getRequiredPluginFor ( context ) . getCollectionResourceRelFor ( type ) ;
public class JSDefinedClass { /** * Adds a field to the list of field members of this defined class . * @ param sName * Name of this field * @ return Newly generated field */ @ Nonnull public JSFieldVar field ( @ Nonnull @ Nonempty final String sName ) { } }
return field ( sName , null ) ;
public class UTemplater { /** * Returns a template based on a method . One - line methods starting with a { @ code return } statement * are guessed to be expression templates , and all other methods are guessed to be block * templates . */ public static Template < ? > createTemplate ( Context context , MethodTree d...
MethodSymbol declSym = ASTHelpers . getSymbol ( decl ) ; ImmutableClassToInstanceMap < Annotation > annotations = UTemplater . annotationMap ( declSym ) ; ImmutableMap < String , VarSymbol > freeExpressionVars = freeExpressionVariables ( decl ) ; Context subContext = new SubContext ( context ) ; final UTemplater templa...
public class PluginAssets { /** * Sort JS files in the intended load order , so templates don ' t need to care about it . */ List < String > sortedJsFiles ( ) { } }
return jsFiles ( ) . stream ( ) . sorted ( ( file1 , file2 ) -> { // Vendor JS scripts go first if ( vendorJsFiles . contains ( file1 ) ) { return - 1 ; } if ( vendorJsFiles . contains ( file2 ) ) { return 1 ; } // Polyfill JS script goes second if ( file1 . equals ( polyfillJsFile ) ) { return - 1 ; } if ( file2 . equ...
public class WordShapeClassifier { /** * That is , of size 6 , which become 8 , since HashMaps are powers of 2 . Still , it ' s half the size */ private static String wordShapeChris2Long ( String s , boolean omitIfInBoundary , int len , Collection < String > knownLCWords ) { } }
final char [ ] beginChars = new char [ BOUNDARY_SIZE ] ; final char [ ] endChars = new char [ BOUNDARY_SIZE ] ; int beginUpto = 0 ; int endUpto = 0 ; final Set < Character > seenSet = new TreeSet < Character > ( ) ; // TreeSet guarantees stable ordering ; has no size parameter boolean nonLetters = false ; for ( int i =...
public class SVNCommands { /** * Performs a " svn status " and returns any conflicting change that is found in the svn tree at the given directory * in the format that the svn command provides them ( including the leading ' C ' ) . * @ param directory The local working directory * @ return A stream which returns ...
try ( InputStream stream = getPendingCheckins ( directory ) ) { StringBuilder result = new StringBuilder ( ) ; List < String > lines = IOUtils . readLines ( stream , "UTF-8" ) ; for ( String line : lines ) { // first char " C " is a normal conflict , C at second position is a property - conflict if ( line . length ( ) ...
public class RawCodec { /** * / * ( non - Javadoc ) * @ see StreamingEncoder # encodeToStream ( Encoder , java . lang . CharSequence , int , int , EncodedAppender , EncodingState ) */ public void encodeToStream ( Encoder thisInstance , CharSequence source , int offset , int len , EncodedAppender appender , EncodingSt...
appender . appendEncoded ( thisInstance , encodingState , source , offset , len ) ;
public class GrammarFactory { /** * No user defined schema information is generated for processing the EXI * body ; however , the built - in XML schema types are available for use in the * EXI body . * @ return built - in XSD EXI grammars * @ throws EXIException * EXI exception */ public Grammars createXSDTyp...
grammarBuilder . loadXSDTypesOnlyGrammars ( ) ; SchemaInformedGrammars g = grammarBuilder . toGrammars ( ) ; g . setBuiltInXMLSchemaTypesOnly ( true ) ; // builtInXMLSchemaTypesOnly return g ;
public class Channel { /** * Serialize channel to a file using Java serialization . * Deserialized channel will NOT be in an initialized state . * @ param file file * @ throws IOException * @ throws InvalidArgumentException */ public void serializeChannel ( File file ) throws IOException , InvalidArgumentExcept...
if ( null == file ) { throw new InvalidArgumentException ( "File parameter may not be null" ) ; } Files . write ( Paths . get ( file . getAbsolutePath ( ) ) , serializeChannel ( ) , StandardOpenOption . CREATE , StandardOpenOption . TRUNCATE_EXISTING , StandardOpenOption . WRITE ) ;
public class ResourcesInner { /** * Deletes a resource . * @ param resourceGroupName The name of the resource group that contains the resource to delete . The name is case insensitive . * @ param resourceProviderNamespace The namespace of the resource provider . * @ param parentResourcePath The parent resource id...
return ServiceFuture . fromResponse ( beginDeleteWithServiceResponseAsync ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , apiVersion ) , serviceCallback ) ;
public class JaxbExtensions { /** * Marshall an object to a xml { @ code String } . * @ param self a Marshaller which can marshall the type of the given object * @ param jaxbElement object to marshall to a { @ code String } * @ return { @ code String } representing the object as xml */ public static < T > String ...
StringWriter sw = new StringWriter ( ) ; self . marshal ( jaxbElement , sw ) ; return sw . toString ( ) ;
public class ConfiguratorFactory { /** * Returns a protocol stack configurator based on the XML configuration provided by the specified XML element . * @ param element a XML element containing a JGroups XML configuration . * @ return a { @ code ProtocolStackConfigurator } containing the stack configuration . * @ ...
checkForNullConfiguration ( element ) ; return XmlConfigurator . getInstance ( element ) ;
public class Java { /** * Write a comment indent only . * @ param fp * @ param text * @ param indent * @ return */ private static String emitCommentIndentNOnly ( PrintWriter fp , String text , int indent ) { } }
synchronized ( lock ) { return ( emitCommentIndentNOnly ( fp , text , indent , true ) ) ; }
public class ServerImpl { /** * Sets the self - muted state of the user with the given id . * @ param userId The id of the user . * @ param muted Whether the user with the given id is self - muted or not . */ public void setSelfMuted ( long userId , boolean muted ) { } }
if ( muted ) { selfMuted . add ( userId ) ; } else { selfMuted . remove ( userId ) ; }
public class MessageFieldDesc { /** * Get the property names and classes that are part of the standard message payload . * @ param mapPropertyNames * @ return */ public Map < String , Class < ? > > getPayloadPropertyNames ( Map < String , Class < ? > > mapPropertyNames ) { } }
mapPropertyNames = super . getPayloadPropertyNames ( mapPropertyNames ) ; if ( ( this . getKeyInformation ( ) & STANDARD_PARAM ) != 0 ) { // Add this name and class to the map of property names if ( mapPropertyNames == null ) mapPropertyNames = new HashMap < String , Class < ? > > ( ) ; mapPropertyNames . put ( this . ...
public class GeoDistanceConditionBuilder { /** * Returns the { @ link GeoDistanceCondition } represented by this builder . * @ return a new geo distance condition */ @ Override public GeoDistanceCondition build ( ) { } }
GeoDistance min = minDistance == null ? null : GeoDistance . parse ( minDistance ) ; GeoDistance max = maxDistance == null ? null : GeoDistance . parse ( maxDistance ) ; return new GeoDistanceCondition ( boost , field , latitude , longitude , min , max ) ;
public class InternalMailUtil { /** * 将一个地址字符串解析为多个地址 < br > * 地址间使用 " " 、 " , " 、 " ; " 分隔 * @ param address 地址字符串 * @ param charset 编码 * @ return 地址列表 */ public static InternetAddress [ ] parseAddress ( String address , Charset charset ) { } }
InternetAddress [ ] addresses ; try { addresses = InternetAddress . parse ( address ) ; } catch ( AddressException e ) { throw new MailException ( e ) ; } // 编码用户名 if ( ArrayUtil . isNotEmpty ( addresses ) ) { for ( InternetAddress internetAddress : addresses ) { try { internetAddress . setPersonal ( internetAddress . ...
public class Matrix4d { /** * Set this matrix to be an orthographic projection transformation for a right - handed coordinate system . * This method is equivalent to calling { @ link # setOrtho ( double , double , double , double , double , double ) setOrtho ( ) } with * < code > zNear = - 1 < / code > and < code >...
if ( ( properties & PROPERTY_IDENTITY ) == 0 ) _identity ( ) ; m00 = 2.0 / ( right - left ) ; m11 = 2.0 / ( top - bottom ) ; m22 = - 1.0 ; m30 = ( right + left ) / ( left - right ) ; m31 = ( top + bottom ) / ( bottom - top ) ; properties = PROPERTY_AFFINE ; return this ;
public class Serialiser { /** * Deserialises the given { @ link InputStream } to a JSON String . * @ param input The stream to deserialise . * @ param requestMessageType The message type to deserialise into . * @ param < O > The type to deserialise to . * @ return A new instance of the given type . * @ throws...
Gson gson = getBuilder ( ) . create ( ) ; try ( InputStreamReader streamReader = new InputStreamReader ( input , StandardCharsets . UTF_8 ) ) { return gson . fromJson ( streamReader , requestMessageType ) ; }
public class SampleOfLongs { /** * 0 < rank < 1 */ public double rankLatency ( float rank ) { } }
if ( sample . length == 0 ) return 0 ; int index = ( int ) ( rank * sample . length ) ; if ( index >= sample . length ) index = sample . length - 1 ; return sample [ index ] * 0.000001d ;
public class TwoDScrollView { /** * Finds the next focusable component that fits in the specified bounds . * @ param topFocus look for a candidate is the one at the top of the bounds * if topFocus is true , or at the bottom of the bounds if topFocus is * false * @ param top the top offset of the bounds in which...
List < View > focusables = getFocusables ( View . FOCUS_FORWARD ) ; View focusCandidate = null ; /* * A fully contained focusable is one where its top is below the bound ' s * top , and its bottom is above the bound ' s bottom . A partially * contained focusable is one where some part of it is within the * bounds...
public class BoardPanel { /** * Removes all the drawn elements */ public void clear ( ) { } }
assertEDT ( ) ; log . debug ( "[clear] Cleaning board" ) ; for ( int row = 0 ; row < SIZE ; row ++ ) { for ( int col = 0 ; col < SIZE ; col ++ ) { removeItem ( new Point ( col , row ) ) ; } }
public class XtextPackageImpl { /** * Creates the meta - model objects for the package . This method is * guarded to have no affect on any invocation but its first . * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void createPackageContents ( ) { } }
if ( isCreated ) return ; isCreated = true ; // Create classes and their features grammarEClass = createEClass ( GRAMMAR ) ; createEAttribute ( grammarEClass , GRAMMAR__NAME ) ; createEReference ( grammarEClass , GRAMMAR__USED_GRAMMARS ) ; createEAttribute ( grammarEClass , GRAMMAR__DEFINES_HIDDEN_TOKENS ) ; createERef...
public class EnsemblRestClientFactory { /** * Create and return a new lookup service with the specified endpoint URL . * @ since 2.0 * @ param endpointUrl endpoint URL , must not be null * @ return a new overlap service with the specified endpoint URL */ public OverlapService createOverlapService ( final String e...
return new RestAdapter . Builder ( ) . setEndpoint ( endpointUrl ) . setErrorHandler ( errorHandler ) . setConverter ( new JacksonOverlapConverter ( jsonFactory ) ) . build ( ) . create ( OverlapService . class ) ;
public class IExplorerConfigReader { /** * If you ' re using Selenium Grid , make sure the selenium server is in the same folder with the IEDriverServer * or include the path to the ChromeDriver in command line when registering the node : * - Dwebdriver . chrome . driver = % { path to chrome driver } * @ return I...
InternetExplorerOptions options = new InternetExplorerOptions ( ) ; setOptions ( options ) ; String driverPath = getProperty ( "browser.driver.path" ) ; if ( ! "" . equals ( driverPath ) ) { System . setProperty ( "webdriver.ie.driver" , driverPath ) ; } return options ;
public class DiagnosticsInner { /** * List Site Detector Responses . * List Site Detector Responses . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param siteName Site Name * @ param slot Slot Name * @ throws IllegalArgumentException thrown if parameters fail the v...
return listSiteDetectorResponsesSlotWithServiceResponseAsync ( resourceGroupName , siteName , slot ) . map ( new Func1 < ServiceResponse < Page < DetectorResponseInner > > , Page < DetectorResponseInner > > ( ) { @ Override public Page < DetectorResponseInner > call ( ServiceResponse < Page < DetectorResponseInner > > ...
public class MessageEventProvider { /** * Parses a MessageEvent stanza ( extension sub - packet ) . * @ param parser the XML parser , positioned at the starting element of the extension . * @ return a PacketExtension . * @ throws IOException * @ throws XmlPullParserException */ @ Override public MessageEvent pa...
MessageEvent messageEvent = new MessageEvent ( ) ; boolean done = false ; while ( ! done ) { int eventType = parser . next ( ) ; if ( eventType == XmlPullParser . START_TAG ) { if ( parser . getName ( ) . equals ( "id" ) ) messageEvent . setStanzaId ( parser . nextText ( ) ) ; if ( parser . getName ( ) . equals ( Messa...
public class DailyCalendar { /** * Sets the time range for the < CODE > DailyCalendar < / CODE > to the times * represented in the specified values . * @ param rangeStartingHourOfDay * the hour of the start of the time range * @ param rangeStartingMinute * the minute of the start of the time range * @ param...
_validate ( rangeStartingHourOfDay , rangeStartingMinute , rangeStartingSecond , rangeStartingMillis ) ; _validate ( rangeEndingHourOfDay , rangeEndingMinute , rangeEndingSecond , rangeEndingMillis ) ; final Calendar startCal = createJavaCalendar ( ) ; startCal . set ( Calendar . HOUR_OF_DAY , rangeStartingHourOfDay ) ...
public class NodeSupport { /** * Gets the { @ link INodeDesc } value describing the framework node * @ return the singleton { @ link INodeDesc } object for this framework instance */ @ Override public INodeDesc getNodeDesc ( ) { } }
if ( null == nodedesc ) { nodedesc = NodeEntryImpl . create ( getFrameworkNodeHostname ( ) , getFrameworkNodeName ( ) ) ; } return nodedesc ;
public class DebugUtil { /** * Invokes a given method of every object in a { @ code java . util . Map } to { @ code System . out } . * The method called must have no formal parameters . * If an exception is throwed during the method invocation , the element ' s { @ code toString ( ) } method is called . < br > * ...
printDebug ( pMap , pMethodName , System . out ) ;
public class MSExcelParser { /** * Adds a linked workbook that is referred from this workbook . If the filename is already in the list then it is not processed twice . Note that the inputStream is closed after parsing * @ param name fileName ( without path ) of the workbook * @ param inputStream content of the link...
// check if already added if ( this . addedFormulaEvaluators . containsKey ( name ) ) { return false ; } LOG . debug ( "Start adding \"" + name + "\" to current workbook" ) ; // create new parser , select all sheets , no linkedworkbookpasswords , no metadatafilter HadoopOfficeReadConfiguration linkedWBHOCR = new Hadoo...
public class LambdaFunctionTimedOutEventDetailsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LambdaFunctionTimedOutEventDetails lambdaFunctionTimedOutEventDetails , ProtocolMarshaller protocolMarshaller ) { } }
if ( lambdaFunctionTimedOutEventDetails == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( lambdaFunctionTimedOutEventDetails . getError ( ) , ERROR_BINDING ) ; protocolMarshaller . marshall ( lambdaFunctionTimedOutEventDetails . getCause ( ...
public class ActorRef { /** * Sending message before all other messages * @ param message message * @ param sender sender */ public void sendFirst ( Object message , ActorRef sender ) { } }
endpoint . getMailbox ( ) . scheduleFirst ( new Envelope ( message , endpoint . getScope ( ) , endpoint . getMailbox ( ) , sender ) ) ;