signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BlockId { /** * Return a string of the form " siteId _ _ _ blockId " . This is used * for file names and not for displaying in , say , error messages . * It would be weird to have a file names with minus signs , * so format the IDs as unsigned . * @ return A string of the form " SID _ _ _ BLOCKID ....
BigInteger bigSiteId = BigInteger . valueOf ( getSiteId ( ) ) ; BigInteger bigBlockCounter = BigInteger . valueOf ( getBlockId ( ) ) ; final BigInteger BIT_64 = BigInteger . ONE . shiftLeft ( 64 ) ; if ( bigSiteId . signum ( ) < 0 ) { bigSiteId = bigSiteId . add ( BIT_64 ) ; } if ( bigBlockCounter . signum ( ) < 0 ) { ...
public class FastSet { /** * Convert a given collection to a { @ link FastSet } instance */ private FastSet convert ( IntSet c ) { } }
if ( c instanceof FastSet ) { return ( FastSet ) c ; } if ( c == null ) { return new FastSet ( ) ; } FastSet res = new FastSet ( ) ; IntIterator itr = c . iterator ( ) ; while ( itr . hasNext ( ) ) { res . add ( itr . next ( ) ) ; } return res ;
public class AbcGrammar { /** * In header defines in which order parts should be played * field - parts : : = % x50.3A * WSP parts - play - order header - eol < p > * < tt > P : < / tt > */ Rule FieldParts ( ) { } }
return Sequence ( String ( "P:" ) , ZeroOrMore ( WSP ( ) ) . suppressNode ( ) , PartsPlayOrder ( ) , HeaderEol ( ) ) . label ( FieldParts ) ;
public class SubscriberIdentityImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . map . api . primitives . MAPAsnPrimitive # encodeData * ( org . mobicents . protocols . asn . AsnOutputStream ) */ public void encodeData ( AsnOutputStream asnOs ) throws MAPException { } }
if ( this . imsi == null && this . msisdn == null ) throw new MAPException ( "Error while encoding " + _PrimitiveName + ": all choices must not be null" ) ; if ( this . imsi != null && this . msisdn != null ) throw new MAPException ( "Error while encoding " + _PrimitiveName + ": all choices must not be not null" ) ; if...
public class PredefinedMetricTransformer { /** * Returns a request type specific metrics for * { @ link Field # ClientExecuteTime } which is special in the sense that it * makes a more accurate measurement by taking the { @ link TimingInfo } at the * root into account . */ protected List < MetricDatum > latencyOf...
AWSRequestMetrics m = req . getAWSRequestMetrics ( ) ; TimingInfo root = m . getTimingInfo ( ) ; final String metricName = Field . ClientExecuteTime . name ( ) ; if ( root . isEndTimeKnown ( ) ) { // being defensive List < Dimension > dims = new ArrayList < Dimension > ( ) ; dims . add ( new Dimension ( ) . withName ( ...
public class TrueTypeFontUnicode { /** * Gets the glyph index and metrics for a character . * @ param c the character * @ return an < CODE > int < / CODE > array with { glyph index , width } */ public int [ ] getMetricsTT ( int c ) { } }
if ( cmapExt != null ) return ( int [ ] ) cmapExt . get ( Integer . valueOf ( c ) ) ; HashMap map = null ; if ( fontSpecific ) map = cmap10 ; else map = cmap31 ; if ( map == null ) return null ; if ( fontSpecific ) { if ( ( c & 0xffffff00 ) == 0 || ( c & 0xffffff00 ) == 0xf000 ) return ( int [ ] ) map . get ( Integer ....
public class AppDriver { /** * / * ( non - Javadoc ) * @ see org . duracloud . mill . util . DriverSupport # executeImpl ( org . apache . commons . cli . CommandLine ) */ @ Override protected void executeImpl ( CommandLine cmd ) { } }
String taskQueueNames = cmd . getOptionValue ( TASK_QUEUES_OPTION ) ; if ( taskQueueNames != null ) { setSystemProperty ( ConfigConstants . QUEUE_TASK_ORDERED , taskQueueNames ) ; } List < PropertyDefinition > defintions = new PropertyDefinitionListBuilder ( ) . addAws ( ) . addMillDb ( ) . addMcDb ( ) . addDeadLetterQ...
public class RendererModel { /** * Notifies registered listeners of certain changes that have occurred in * this model . */ public void fireChange ( ) { } }
if ( getNotification ( ) && listeners != null ) { EventObject event = new EventObject ( this ) ; for ( int i = 0 ; i < listeners . size ( ) ; i ++ ) { listeners . get ( i ) . stateChanged ( event ) ; } }
public class BaseFilterQueryBuilder { /** * Add a Field Search Condition that will search a field for values that aren ' t like a specified value using the following * SQL logic : { @ code field NOT LIKE ' % value % ' } * @ param propertyName The name of the field as defined in the Entity mapping class . * @ para...
final Expression < String > propertyNameField = getRootPath ( ) . get ( propertyName ) . as ( String . class ) ; fieldConditions . add ( getCriteriaBuilder ( ) . notLike ( propertyNameField , "%" + cleanLikeCondition ( value ) + "%" ) ) ;
public class FieldMetaData { /** * 获取Field大小 * @ param field * @ return */ private int getFieldSize ( Field field ) { } }
if ( String . class == field . getType ( ) ) { return this . max ; } else if ( long . class == field . getType ( ) ) { return OtherConstants . FDFS_PROTO_PKG_LEN_SIZE ; } else if ( int . class == field . getType ( ) ) { return OtherConstants . FDFS_PROTO_PKG_LEN_SIZE ; } else if ( java . util . Date . class == field . ...
public class ClassLoaderResourceUtils { /** * Builds a class instance using reflection , by using its classname . The * class must have a zero - arg constructor . * @ param classname * the class to build an instance of . * @ param params * the parameters * @ return the class instance */ public static Object...
Object rets = null ; Class < ? > [ ] paramTypes = new Class [ params . length ] ; for ( int x = 0 ; x < params . length ; x ++ ) { paramTypes [ x ] = params [ x ] . getClass ( ) ; } try { Class < ? > clazz = getClass ( classname ) ; rets = clazz . getConstructor ( paramTypes ) . newInstance ( params ) ; } catch ( Excep...
public class FilterTrackerCustomizer { /** * { @ inheritDoc } */ public final FilterFactoryReference addingService ( ServiceReference < FilterFactory > reference ) { } }
FilterFactory filterFactory = bundleContext . getService ( reference ) ; if ( filterFactory != null ) { FilterFactoryReference factoryReference = new FilterFactoryReference ( filterFactory ) ; LOGGER . debug ( "added FilterFactory {} for application {}" , filterFactory . getClass ( ) . getName ( ) , applicationName ) ;...
public class ClassInfo { /** * Handle { @ link Repeatable } annotations . * @ param allRepeatableAnnotationNames * the names of all repeatable annotations */ void handleRepeatableAnnotations ( final Set < String > allRepeatableAnnotationNames ) { } }
if ( annotationInfo != null ) { annotationInfo . handleRepeatableAnnotations ( allRepeatableAnnotationNames , this , RelType . CLASS_ANNOTATIONS , RelType . CLASSES_WITH_ANNOTATION ) ; } if ( fieldInfo != null ) { for ( final FieldInfo fi : fieldInfo ) { fi . handleRepeatableAnnotations ( allRepeatableAnnotationNames )...
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createPRI ( int cic ) */ public PreReleaseInformationMessage createPRI ( int cic ) { } }
PreReleaseInformationMessage msg = createPRI ( ) ; CircuitIdentificationCode code = this . parameterFactory . createCircuitIdentificationCode ( ) ; code . setCIC ( cic ) ; msg . setCircuitIdentificationCode ( code ) ; return msg ;
public class CompositeConditionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public NotificationChain basicSetRight ( Condition newRight , NotificationChain msgs ) { } }
Condition oldRight = right ; right = newRight ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , XtextPackage . COMPOSITE_CONDITION__RIGHT , oldRight , newRight ) ; if ( msgs == null ) msgs = notification ; else msgs . add ( notification ) ; } retur...
public class SnackBar { /** * Set the padding between this SnackBar and it ' s text and button . * @ param horizontalPadding The horizontal padding . * @ param verticalPadding The vertical padding . * @ return This SnackBar for chaining methods . */ public SnackBar padding ( int horizontalPadding , int verticalPa...
mText . setPadding ( horizontalPadding , verticalPadding , horizontalPadding , verticalPadding ) ; mAction . setPadding ( horizontalPadding , verticalPadding , horizontalPadding , verticalPadding ) ; return this ;
public class CPDefinitionLocalServiceBaseImpl { /** * Adds the cp definition to the database . Also notifies the appropriate model listeners . * @ param cpDefinition the cp definition * @ return the cp definition that was added */ @ Indexable ( type = IndexableType . REINDEX ) @ Override public CPDefinition addCPDe...
cpDefinition . setNew ( true ) ; return cpDefinitionPersistence . update ( cpDefinition ) ;
public class MultipartContent { /** * Configures a field part with the given field name and value ( of the specified content type ) . * @ param fieldName the field name * @ param contentType the value content type * @ param value the value * @ return a reference to this { @ link MultipartContent } instance */ p...
return part ( fieldName , contentType , value ) ;
public class SecurityCenterClient { /** * Gets a source . * < p > Sample code : * < pre > < code > * try ( SecurityCenterClient securityCenterClient = SecurityCenterClient . create ( ) ) { * SourceName name = SourceName . of ( " [ ORGANIZATION ] " , " [ SOURCE ] " ) ; * Source response = securityCenterClient ...
GetSourceRequest request = GetSourceRequest . newBuilder ( ) . setName ( name ) . build ( ) ; return getSource ( request ) ;
public class JsonUtil { /** * Writes the given value with the given writer . * @ param writer * @ param values * @ throws IOException * @ author vvakame */ public static void putFloatList ( Writer writer , List < Float > values ) throws IOException { } }
if ( values == null ) { writer . write ( "null" ) ; } else { startArray ( writer ) ; for ( int i = 0 ; i < values . size ( ) ; i ++ ) { put ( writer , values . get ( i ) ) ; if ( i != values . size ( ) - 1 ) { addSeparator ( writer ) ; } } endArray ( writer ) ; }
public class SqlBuilder { /** * Creates a case expression . * @ param condition The name of the view . * @ param trueAction The name of the view . * @ return The case when representation . */ public static Case caseWhen ( final Expression condition , final Expression trueAction ) { } }
return Case . caseWhen ( condition , trueAction ) ;
public class BaseMoskitoUIAction { /** * Rebuilds query string from source . * @ param source original source . * @ param params parameters that should be included in the query string . * @ return */ protected String rebuildQueryStringWithoutParameter ( String source , String ... params ) { } }
if ( source == null || source . length ( ) == 0 ) return "" ; if ( params == null || params . length == 0 ) return source ; HashSet < String > paramsSet = new HashSet < String > ( params . length ) ; paramsSet . addAll ( Arrays . asList ( params ) ) ; String [ ] tokens = StringUtils . tokenize ( source , '&' ) ; String...
public class JellyClassLoaderTearOff { /** * Creates { @ link JellyContext } for compiling view scripts * for classes in this classloader . */ public JellyContext createContext ( ) { } }
JellyContext context = new CustomJellyContext ( ROOT_CONTEXT ) ; context . setClassLoader ( owner . loader ) ; context . setExportLibraries ( false ) ; return context ;
public class PhotosGeoApi { /** * Set the permission for who may view the geo data associated with a photo . * < br > * This method requires authentication with ' write ' permission . * @ param photoId ( Required ) The id of the photo to set permissions for . * @ param isPublic viewing permissions for the photo...
JinxUtils . validateParams ( photoId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photos.geo.setPerms" ) ; params . put ( "photo_id" , photoId ) ; params . put ( "is_public" , isPublic ? "1" : "0" ) ; params . put ( "is_contact" , isContact ? "1" : "0" ) ; params . put ( ...
public class LogFileHeader { /** * Test to determine if the target log file header belongs to a valid RLS * file . * @ return boolean true if the log file header is valid , otherwise false . */ public boolean valid ( ) { } }
boolean valid = true ; if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "valid" , this ) ; if ( _status == STATUS_INVALID ) valid = false ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "valid" , new Boolean ( valid ) ) ; return valid ;
public class CloudSpannerXAConnection { /** * Preconditions : 1 . xid is known to the RM or it ' s in prepared state * Implementation deficiency preconditions : 1 . xid must be associated with this connection if it ' s * not in prepared state . * Postconditions : 1 . Transaction is rolled back and disassociated f...
if ( logger . logDebug ( ) ) { debug ( "rolling back xid = " + xid ) ; } // We don ' t explicitly check precondition 1. try { if ( currentXid != null && xid . equals ( currentXid ) ) { state = STATE_IDLE ; currentXid = null ; conn . rollback ( ) ; conn . setAutoCommit ( localAutoCommitMode ) ; } else { String s = Recov...
public class QuartzJobSpecScheduler { /** * { @ inheritDoc } */ @ Override protected JobSpecSchedule doScheduleJob ( JobSpec jobSpec , Runnable jobRunnable ) { } }
// Build a data map that gets passed to the job JobDataMap jobDataMap = new JobDataMap ( ) ; jobDataMap . put ( JOB_SPEC_KEY , jobSpec ) ; jobDataMap . put ( JOB_RUNNABLE_KEY , jobRunnable ) ; // Build a Quartz job JobDetail job = JobBuilder . newJob ( QuartzJob . class ) . withIdentity ( jobSpec . getUri ( ) . toStrin...
public class RequestWrapperFactory { /** * create a HttpServletRequestWrapper with session supports . this method * will create HttpSession . * @ param request * @ return */ public static RequestWrapper create ( HttpServletRequest request ) { } }
HttpSession session = request . getSession ( ) ; AppContextWrapper acw = new ServletContextWrapper ( session . getServletContext ( ) ) ; SessionWrapper sw = new HttpSessionWrapper ( session ) ; ContextHolder contextHolder = new ContextHolder ( acw , sw ) ; return new HttpServletRequestWrapper ( request , contextHolder ...
public class Atom { /** * Determines whether the subsumption relation between this ( A ) and provided atom ( B ) holds , * i . e . determines if : * A > = B , * is true meaning that B is more general than A and the respective answer sets meet : * answers ( B ) subsetOf answers ( A ) * i . e . the set of answe...
if ( ! atomic . isAtom ( ) ) return false ; Atom parent = ( Atom ) atomic ; MultiUnifier multiUnifier = this . getMultiUnifier ( parent , UnifierType . SUBSUMPTIVE ) ; if ( multiUnifier . isEmpty ( ) ) return false ; MultiUnifier inverse = multiUnifier . inverse ( ) ; return // check whether propagated answers would be...
public class TemplatesApi { /** * Returns document page image ( s ) based on input . * @ param accountId The external account number ( int ) or account ID Guid . ( required ) * @ param templateId The ID of the template being accessed . ( required ) * @ param documentId The ID of the document being accessed . ( re...
return getPages ( accountId , templateId , documentId , null ) ;
public class TimeWindowFunction { /** * Calculates the start time of the window for which the specified time belongs , in unix epoch ( millisecond ) format < br > * For example , if the window size is 1 hour with offset 0 , then a time 10:17 would return 10:00 , as the 1 hour window * is for 10:00:00.000 to 10:59:5...
// Calculate aggregate offset : aggregate offset is due to both timezone and manual offset long aggregateOffset = ( timeZone . getOffset ( time ) + this . offsetAmountMilliseconds ) % this . windowSizeMilliseconds ; return ( time + aggregateOffset ) - ( time + aggregateOffset ) % this . windowSizeMilliseconds ;
public class AssemblyAnalyzer { /** * Builds the beginnings of a List for ProcessBuilder * @ return the list of arguments to begin populating the ProcessBuilder */ protected List < String > buildArgumentList ( ) { } }
// Use file . separator as a wild guess as to whether this is Windows final List < String > args = new ArrayList < > ( ) ; if ( ! StringUtils . isEmpty ( getSettings ( ) . getString ( Settings . KEYS . ANALYZER_ASSEMBLY_DOTNET_PATH ) ) ) { args . add ( getSettings ( ) . getString ( Settings . KEYS . ANALYZER_ASSEMBLY_D...
public class GrpcUtils { /** * Converts a proto type to a wire type . * @ param blockPInfo the proto type to convert * @ return the converted wire type */ public static BlockInfo fromProto ( alluxio . grpc . BlockInfo blockPInfo ) { } }
BlockInfo blockInfo = new BlockInfo ( ) ; blockInfo . setBlockId ( blockPInfo . getBlockId ( ) ) ; blockInfo . setLength ( blockPInfo . getLength ( ) ) ; blockInfo . setLocations ( map ( GrpcUtils :: fromProto , blockPInfo . getLocationsList ( ) ) ) ; return blockInfo ;
public class UserGroupService { /** * Returns the LDAP entries representing all user groups that the given * user is a member of . Only user groups which are readable by the current * user will be retrieved . * @ param ldapConnection * The current connection to the LDAP server , associated with the * current ...
// Do not return any user groups if base DN is not specified String groupBaseDN = confService . getGroupBaseDN ( ) ; if ( groupBaseDN == null ) return Collections . emptyList ( ) ; // Get all groups the user is a member of starting at the groupBaseDN , // excluding guacConfigGroups return queryService . search ( ldapCo...
public class WatchedDoubleStepQREigen_DDRM { /** * Performs an implicit double step using the values contained in the lower right hand side * of the submatrix for the estimated eigenvector values . * @ param x1 * @ param x2 */ public void implicitDoubleStep ( int x1 , int x2 ) { } }
if ( printHumps ) System . out . println ( "Performing implicit double step" ) ; // compute the wilkinson shift double z11 = A . get ( x2 - 1 , x2 - 1 ) ; double z12 = A . get ( x2 - 1 , x2 ) ; double z21 = A . get ( x2 , x2 - 1 ) ; double z22 = A . get ( x2 , x2 ) ; double a11 = A . get ( x1 , x1 ) ; double a21 = A . ...
public class LogTemplates { /** * Produces a log template which logs something at most every N secoonds . * @ param delegateLogger Concrete log template * @ param period N value in seconds , maximum period * @ return Logger */ public static < C > LogTemplate < C > everyNSeconds ( LogTemplate < C > delegateLogger ...
return everyNMilliseconds ( delegateLogger , period * SimonClock . MILLIS_IN_SECOND ) ;
public class DocBookBuildUtilities { /** * Generates the Revision component of a revnumber to be used in a Revision _ History . xml * file using the Book Version , Edition and Pubsnumber values from a content * specification . * @ param contentSpec the content specification to generate the revision number for . ...
final StringBuilder rev = new StringBuilder ( ) ; // Build the BookVersion / Edition part of the revision number . final String bookVersion ; if ( contentSpec . getBookVersion ( ) == null ) { bookVersion = contentSpec . getEdition ( ) ; } else { bookVersion = contentSpec . getBookVersion ( ) ; } if ( bookVersion == nul...
public class ComStmtExecute { /** * Send a prepare statement binary stream . * @ param pos database socket * @ param statementId prepareResult object received after preparation . * @ param parameters parameters * @ param parameterCount parameters number * @ param parameterTypeHeader parameters header * @ pa...
pos . startPacket ( 0 ) ; writeCmd ( statementId , parameters , parameterCount , parameterTypeHeader , pos , cursorFlag ) ; pos . flush ( ) ;
public class EurekaClinicalProperties { /** * Reads in a property value as a whitespace - delimited list of items . * @ param inPropertyName The name of the property to read . * @ return A list containing the items in the value , or < code > null < / code > if * the property is not found . */ protected final List...
List < String > result = null ; String value = this . properties . getProperty ( inPropertyName ) ; if ( value != null ) { String [ ] temp = value . split ( "\\s+" ) ; result = new ArrayList < > ( temp . length ) ; for ( String s : temp ) { String trimmed = s . trim ( ) ; if ( trimmed . length ( ) > 0 ) { result . add ...
public class AbstractLauncher { /** * Adds a no - value argument to the Spark invocation . If the argument is known , this method * validates whether the argument is indeed a no - value argument , and throws an exception * otherwise . * Use this method with caution . It is possible to create an invalid Spark comm...
SparkSubmitOptionParser validator = new ArgumentValidator ( false ) ; validator . parse ( Arrays . asList ( arg ) ) ; builder . userArgs . add ( arg ) ; return self ( ) ;
public class CmsDbExportView { /** * Sets up the combo box for the site choice . < p > */ private void setupComboBoxSite ( ) { } }
IndexedContainer container = CmsVaadinUtils . getAvailableSitesContainer ( A_CmsUI . getCmsObject ( ) , "title" ) ; m_site . setContainerDataSource ( container ) ; m_site . setItemCaptionMode ( ItemCaptionMode . PROPERTY ) ; m_site . setItemCaptionPropertyId ( "title" ) ; m_site . setNullSelectionAllowed ( false ) ; m_...
public class SAXRule { /** * Add - on to the original code by manfred and seninp . This one similar to the original getRules ( ) * but populates and returns the array list of SAXRuleRecords . */ protected void getSAXRules ( ) { } }
arrRuleRecords . clear ( ) ; Vector < SAXRule > rules = new Vector < SAXRule > ( numRules . intValue ( ) ) ; rules . addElement ( this ) ; SAXRule currentRule ; int processedRules = 0 ; StringBuilder sbCurrentRule = new StringBuilder ( ) ; while ( processedRules < rules . size ( ) ) { currentRule = rules . elementAt ( ...
public class NFRule { /** * Formats the number , and inserts the resulting text into * toInsertInto . * @ param number The number being formatted * @ param toInsertInto The string where the resultant text should * be inserted * @ param pos The position in toInsertInto where the resultant text * should be in...
// first , insert the rule ' s rule text into toInsertInto at the // specified position , then insert the results of the substitutions // into the right places in toInsertInto // [ again , we have two copies of this routine that do the same thing // so that we don ' t sacrifice precision in a long by casting it // to a...
public class CommonUtils { /** * Verify if the string sorting matches with asc or desc * Returns FALSE when sorting query value matches desc , otherwise it returns TRUE . * @ param sorting the sorting value from the http header * @ return false for desc or true for as */ public static Boolean isAscendingOrder ( S...
return "desc" . equalsIgnoreCase ( sorting ) ? Boolean . FALSE : Boolean . TRUE ;
public class HttpMessage { /** * Sets the value of a date field . * Header or Trailer fields are set depending on message state . * @ param name the field name * @ param date the field date value */ public void setDateField ( String name , long date ) { } }
if ( _state != __MSG_EDITABLE ) return ; _header . putDateField ( name , date ) ;
public class SummernoteBase { /** * Set customized font names . * @ param fontNames customized font names * @ see SummernoteFontName */ public void setFontNames ( final SummernoteFontName ... fontNames ) { } }
JsArrayString array = JavaScriptObject . createArray ( ) . cast ( ) ; for ( SummernoteFontName fontName : fontNames ) { array . push ( fontName . getName ( ) ) ; } options . setFontNames ( array ) ;
public class CommerceNotificationTemplateWrapper { /** * Returns the localized from name of this commerce notification template in the language , optionally using the default language if no localization exists for the requested language . * @ param languageId the ID of the language * @ param useDefault whether to u...
return _commerceNotificationTemplate . getFromName ( languageId , useDefault ) ;
public class BackgroundGmmCommon { /** * Checks to see if the the pivel value refers to the background or foreground * @ return true for background or false for foreground */ public int checkBackground ( float [ ] pixelValue , float [ ] dataRow , int modelIndex ) { } }
// see which gaussian is the best fit based on Mahalanobis distance int index = modelIndex ; float bestDistance = maxDistance * numBands ; float bestWeight = 0 ; int ng ; // number of gaussians in use for ( ng = 0 ; ng < maxGaussians ; ng ++ , index += gaussianStride ) { float variance = dataRow [ index + 1 ] ; if ( va...
public class BitUtil { /** * Generate a byte array that is a hex representation of a given byte array . * @ param buffer to convert to a hex representation . * @ param offset the offset into the buffer . * @ param length the number of bytes to convert . * @ return new byte array that is hex representation ( in ...
final byte [ ] outputBuffer = new byte [ length << 1 ] ; for ( int i = 0 ; i < ( length << 1 ) ; i += 2 ) { final byte b = buffer [ offset + ( i >> 1 ) ] ; outputBuffer [ i ] = HEX_DIGIT_TABLE [ ( b >> 4 ) & 0x0F ] ; outputBuffer [ i + 1 ] = HEX_DIGIT_TABLE [ b & 0x0F ] ; } return outputBuffer ;
public class GrpcServerBuilder { /** * Create an new instance of { @ link GrpcServerBuilder } with authentication support . * @ param hostName the host name * @ param address the address * @ param authenticationServer the authentication server to use * @ param conf the Alluxio configuration * @ return a new i...
return new GrpcServerBuilder ( hostName , address , authenticationServer , conf ) ;
public class CborDecoder { /** * Decodes exactly one DataItem from the input stream . * @ return a { @ link DataItem } or null if end of stream has reached . * @ throws CborException * if decoding failed */ public DataItem decodeNext ( ) throws CborException { } }
int symbol ; try { symbol = inputStream . read ( ) ; } catch ( IOException ioException ) { throw new CborException ( ioException ) ; } if ( symbol == - 1 ) { return null ; } switch ( MajorType . ofByte ( symbol ) ) { case ARRAY : return arrayDecoder . decode ( symbol ) ; case BYTE_STRING : return byteStringDecoder . de...
public class MapUtil { /** * 转换对象为map * @ param object object * @ param ignore ignore * @ return map */ public static Map < String , String > objectToMap ( Object object , String ... ignore ) { } }
Map < String , String > tempMap = new LinkedHashMap < String , String > ( ) ; for ( Field f : getAllFields ( object . getClass ( ) ) ) { if ( ! f . isAccessible ( ) ) { f . setAccessible ( true ) ; } boolean ig = false ; if ( ignore != null && ignore . length > 0 ) { for ( String i : ignore ) { if ( i . equals ( f . ge...
public class Searcher { /** * Checks if a facet refinement is enabled . * @ param attribute the attribute to refine on . * @ param value the facet ' s value to check . * @ return { @ code true } if { @ code attribute } is being refined with { @ code value } . */ @ SuppressWarnings ( { } }
"WeakerAccess" , "unused" , "SameParameterValue" } ) // For library users public boolean hasFacetRefinement ( @ NonNull String attribute , @ NonNull String value ) { List < String > attributeRefinements = refinementMap . get ( attribute ) ; return attributeRefinements != null && attributeRefinements . contains ( value ...
public class WriteExecutor { /** * Return a ConceptBuilder for given Variable . This can be used to provide information for how to create * the concept that the variable represents . * This method is expected to be called from implementations of * VarProperty # insert ( Variable ) , provided they include the give...
var = equivalentVars . componentOf ( var ) ; if ( concepts . containsKey ( var ) ) { return Optional . empty ( ) ; } ConceptBuilder builder = conceptBuilders . get ( var ) ; if ( builder != null ) { return Optional . of ( builder ) ; } builder = ConceptBuilder . of ( this , var ) ; conceptBuilders . put ( var , builder...
public class JavaDialectConfiguration { /** * Set the compiler to be used when building the rules semantic code blocks . * This overrides the default , and even what was set as a system property . */ public void setCompiler ( final CompilerType compiler ) { } }
// check that the jar for the specified compiler are present if ( compiler == CompilerType . ECLIPSE ) { try { Class . forName ( "org.eclipse.jdt.internal.compiler.Compiler" , true , this . conf . getClassLoader ( ) ) ; } catch ( ClassNotFoundException e ) { throw new RuntimeException ( "The Eclipse JDT Core jar is not...
public class AbstractTableFilter { /** * { @ inheritDoc } */ public boolean canFilter ( Example example ) { } }
for ( String keyword : keywords ) { if ( keyword . equalsIgnoreCase ( contentOf ( example . at ( 0 , 0 , 0 ) ) ) ) return true ; } return false ;
public class TlvUtil { /** * Method used to parser Tag and length * @ param data * data to parse * @ return tag and length */ public static List < TagAndLength > parseTagAndLength ( final byte [ ] data ) { } }
List < TagAndLength > tagAndLengthList = new ArrayList < TagAndLength > ( ) ; if ( data != null ) { TLVInputStream stream = new TLVInputStream ( new ByteArrayInputStream ( data ) ) ; try { while ( stream . available ( ) > 0 ) { if ( stream . available ( ) < 2 ) { throw new TlvException ( "Data length < 2 : " + stream ....
public class BetaDetector { /** * Returns true if the given annotations contain { @ link Beta } . */ private static boolean isBeta ( AnnotationEntry [ ] annotationEntries ) { } }
for ( AnnotationEntry annotation : annotationEntries ) { if ( BETA_ANNOTATION . equals ( annotation . getAnnotationType ( ) ) ) { return true ; } } return false ;
public class AbstractKSIResponse { /** * Checks the MAC code . * @ param key * key to be used to calculate MAC code . * @ param hmacAlgorithm * algorithm for verifying the HMAC of incoming messages . * @ throws KSIException * when MAC code doesn ' t validate */ private void validateMac ( byte [ ] key , Hash...
try { HashAlgorithm receivedHmacAlgorithm = mac . getAlgorithm ( ) ; if ( receivedHmacAlgorithm != hmacAlgorithm ) { throw new KSIException ( "HMAC algorithm mismatch. Expected " + hmacAlgorithm . getName ( ) + ", received " + receivedHmacAlgorithm . getName ( ) ) ; } // calculate and set the MAC value DataHash macValu...
public class CmsResourceUtil { /** * Returns the name of the user who created the given resource . < p > * @ return the name of the user who created the given resource */ public String getUserCreated ( ) { } }
String user = m_resource . getUserCreated ( ) . toString ( ) ; try { user = getCurrentOuRelativeName ( CmsPrincipal . readPrincipalIncludingHistory ( getCms ( ) , m_resource . getUserCreated ( ) ) . getName ( ) ) ; } catch ( Throwable e ) { LOG . info ( e . getLocalizedMessage ( ) ) ; } return user ;
public class ServletHttpResponse { void setOutputState ( int s ) throws IOException { } }
if ( s < 0 ) { _outputState = DISABLED ; if ( _writer != null ) _writer . disable ( ) ; _writer = null ; if ( _out != null ) _out . disable ( ) ; _out = null ; } else _outputState = s ;
public class CompileStack { /** * Defines a new Variable using an AST variable . * @ param initFromStack if true the last element of the * stack will be used to initialize * the new variable . If false null * will be used . */ public BytecodeVariable defineVariable ( Variable v , boolean initFromStack ) { } }
return defineVariable ( v , v . getOriginType ( ) , initFromStack ) ;
public class ImmutableLightMetaProperty { @ Override @ SuppressWarnings ( "unchecked" ) public P get ( Bean bean ) { } }
return ( P ) getter . get ( bean ) ;
public class AbstractLocaleResolver { /** * Resolve the default time zone for the given translet , * Called if can not find specified TimeZone . * @ param translet the translet to resolve the time zone for * @ return the default time zone ( or { @ code null } if none defined ) * @ see # setDefaultTimeZone */ pr...
TimeZone defaultTimeZone = getDefaultTimeZone ( ) ; if ( defaultTimeZone != null ) { translet . getRequestAdapter ( ) . setTimeZone ( defaultTimeZone ) ; return defaultTimeZone ; } else { return translet . getRequestAdapter ( ) . getTimeZone ( ) ; }
public class SSLConfigManager { /** * Called after all the SSL configuration is processed , set the default SSLContext for the runtime . * @ throws SSLException */ public synchronized void resetDefaultSSLContextIfNeeded ( String modifiedFile ) throws Exception { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "resetDefaultSSLContextIfNeeded" , modifiedFile ) ; SSLConfig defaultSSLConfig = getDefaultSSLConfig ( ) ; if ( defaultSSLConfig != null && keyStoreModified ( defaultSSLConfig , modifiedFile ) ) { if ( TraceComponent . isAnyTra...
public class JsonMapper { /** * Serialize an object to a JSON String . * @ param object The object to serialize . */ public String serialize ( T object ) throws IOException { } }
StringWriter sw = new StringWriter ( ) ; JsonGenerator jsonGenerator = LoganSquare . JSON_FACTORY . createGenerator ( sw ) ; serialize ( object , jsonGenerator , true ) ; jsonGenerator . close ( ) ; return sw . toString ( ) ;
public class AbstractTypeCheckVisitor { /** * Type check method for let be such that * @ param node * @ param nodeLocation * @ param bind * @ param suchThat * @ param body * @ param question * @ return a pair of the type and definition * @ throws AnalysisException */ protected Map . Entry < PType , AMul...
final PDefinition def = AstFactory . newAMultiBindListDefinition ( nodeLocation , question . assistantFactory . createPMultipleBindAssistant ( ) . getMultipleBindList ( ( PMultipleBind ) bind ) ) ; def . apply ( THIS , question . newConstraint ( null ) ) ; List < PDefinition > qualified = new Vector < PDefinition > ( )...
public class ActionSupport { /** * Add error to next action . * @ param msgKey * @ param args */ protected final void addFlashError ( String msgKey , Object ... args ) { } }
getFlash ( ) . addError ( getTextInternal ( msgKey , args ) ) ;
public class CronTrigger { /** * Updates the < code > CronTrigger < / code > ' s state based on the * MISFIRE _ INSTRUCTION _ XXX that was selected when the < code > CronTrigger < / code > * was created . * If the misfire instruction is set to MISFIRE _ INSTRUCTION _ SMART _ POLICY , then * the following scheme...
int instr = getMisfireInstruction ( ) ; if ( instr == ITrigger . MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY ) return ; if ( instr == MISFIRE_INSTRUCTION_SMART_POLICY ) { instr = MISFIRE_INSTRUCTION_FIRE_ONCE_NOW ; } if ( instr == MISFIRE_INSTRUCTION_DO_NOTHING ) { Date newFireTime = getFireTimeAfter ( new Date ( ) ) ; w...
public class CommerceOrderPersistenceImpl { /** * Removes all the commerce orders where uuid = & # 63 ; and companyId = & # 63 ; from the database . * @ param uuid the uuid * @ param companyId the company ID */ @ Override public void removeByUuid_C ( String uuid , long companyId ) { } }
for ( CommerceOrder commerceOrder : findByUuid_C ( uuid , companyId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceOrder ) ; }
public class Parser { /** * A { @ link Parser } that reports reports an error about { @ code name } expected , if { @ code this } fails with no partial * match . */ public Parser < T > label ( final String name ) { } }
return new Parser < T > ( ) { @ Override public Parser < T > label ( String overrideName ) { return Parser . this . label ( overrideName ) ; } @ Override boolean apply ( ParseContext ctxt ) { return ctxt . applyNewNode ( Parser . this , name ) ; } @ Override public String toString ( ) { return name ; } } ;
public class ResolverUtil { /** * Finds matching classes within a jar files that contains a folder structure matching the package structure . If the * File is not a JarFile or does not exist a warning will be logged , but no error will be raised . * @ param test * a Test used to filter the classes that are discov...
try { JarEntry entry ; while ( ( entry = stream . getNextJarEntry ( ) ) != null ) { final String name = entry . getName ( ) ; if ( ! entry . isDirectory ( ) && name . startsWith ( parent ) && isTestApplicable ( test , name ) ) { addIfMatching ( test , name ) ; } } } catch ( final IOException ioe ) { LOGGER . error ( "C...
public class Matrix4d { /** * Set this matrix to a rotation transformation about the X axis . * When used with a right - handed coordinate system , the produced rotation will rotate a vector * counter - clockwise around the rotation axis , when viewing along the negative axis direction towards the origin . * When...
double sin , cos ; sin = Math . sin ( ang ) ; cos = Math . cosFromSin ( sin , ang ) ; if ( ( properties & PROPERTY_IDENTITY ) == 0 ) this . _identity ( ) ; m11 = cos ; m12 = sin ; m21 = - sin ; m22 = cos ; properties = PROPERTY_AFFINE | PROPERTY_ORTHONORMAL ; return this ;
public class LocaleDisplayNames { /** * Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale , * using the provided dialectHandling . * @ param locale the display locale * @ param dialectHandling how to select names for locales * @ return a LocaleDisplayNames instance *...
LocaleDisplayNames result = null ; if ( FACTORY_DIALECTHANDLING != null ) { try { result = ( LocaleDisplayNames ) FACTORY_DIALECTHANDLING . invoke ( null , locale , dialectHandling ) ; } catch ( InvocationTargetException e ) { // fall through } catch ( IllegalAccessException e ) { // fall through } } if ( result == nul...
public class techsupport { /** * < pre > * Performs generic data validation for the operation to be performed * < / pre > */ protected void validate ( String operationType ) throws Exception { } }
super . validate ( operationType ) ; MPSString mode_validator = new MPSString ( ) ; mode_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; mode_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; mode_validator . setConstraintIsReq ( MPSConstants . ADD_CONSTRAIN...
public class JDBCCallableStatement { /** * # ifdef JAVA4 */ public synchronized void setDate ( String parameterName , Date x ) throws SQLException { } }
setDate ( findParameterIndex ( parameterName ) , x ) ;
public class UserAPI { /** * 创建分组 * @ param name 分组名称 * @ return 返回对象 , 包含分组的ID和名称信息 */ public CreateGroupResponse createGroup ( String name ) { } }
CreateGroupResponse response ; BeanUtil . requireNonNull ( name , "name is null" ) ; LOG . debug ( "创建分组....." ) ; String url = BASE_API_URL + "cgi-bin/groups/create?access_token=#" ; Map < String , Object > param = new HashMap < String , Object > ( ) ; Map < String , Object > group = new HashMap < String , Object > ( ...
public class RunWindupCommand { /** * Removes the . * suffix from the include and exclude packages input . */ private void normalizePackagePrefixes ( WindupConfiguration windupConfiguration ) { } }
List < String > includePackages = windupConfiguration . getOptionValue ( ScanPackagesOption . NAME ) ; includePackages = normalizePackagePrefixes ( includePackages ) ; windupConfiguration . setOptionValue ( ScanPackagesOption . NAME , includePackages ) ; List < String > excludePackages = windupConfiguration . getOption...
public class ScanSpec { /** * Applicable only when an expression has been specified . * Used to specify the actual values for the attribute - name placeholders , * where the value in the map can either be string for simple attribute * name , or a JSON path expression . * @ see ScanRequest # withExpressionAttrib...
if ( nameMap == null ) this . nameMap = null ; else this . nameMap = Collections . unmodifiableMap ( new LinkedHashMap < String , String > ( nameMap ) ) ; return this ;
public class ContactType { /** * Get the contact type for this record . * ( The code is the record table name ) . * @ param The record . * @ return The Contact Type record ( or null if not found ) . */ public ContactType getContactType ( Record record ) { } }
String strType = record . getTableNames ( false ) ; this . setKeyArea ( ContactType . CODE_KEY ) ; this . getField ( ContactType . CODE ) . setString ( strType ) ; try { if ( this . seek ( null ) ) { // Success return this ; } } catch ( DBException ex ) { ex . printStackTrace ( ) ; } return null ; // Not found
public class DirectoryValidator { /** * Does the actual validation * @ param directory the directory to validate * @ param option validation options */ protected void validate ( File directory , ValidationOptions option ) { } }
if ( ! directory . exists ( ) ) { this . errors . addError ( "directory <{}> does not exist in file system" , directory . getAbsolutePath ( ) ) ; } else if ( ! directory . isDirectory ( ) ) { this . errors . addError ( "directory <{}> is not a directory" , directory . getAbsolutePath ( ) ) ; } else if ( directory . isH...
public class TextUtility { /** * 是否全部不是中文 * @ param sString * @ return */ public static boolean isAllNonChinese ( byte [ ] sString ) { } }
int nLen = sString . length ; int i = 0 ; while ( i < nLen ) { if ( getUnsigned ( sString [ i ] ) < 248 && getUnsigned ( sString [ i ] ) > 175 ) return false ; if ( sString [ i ] < 0 ) i += 2 ; else i += 1 ; } return true ;
public class Row { /** * Creates a new instance of the { @ link Row } . */ @ InternalApi public static Row create ( ByteString key , List < RowCell > cells ) { } }
return new AutoValue_Row ( key , cells ) ;
public class Checkin { /** * The check in is done without calling triggers and check of access * rights . Executes the check in : * < ul > * < li > the file is checked in < / li > * < li > the file name and file length is stored in with * { @ link org . efaps . db . Update } ( complete filename without path )...
final Context context = Context . getThreadContext ( ) ; Resource storeRsrc = null ; boolean ok = false ; try { getInstance ( ) . getType ( ) ; storeRsrc = context . getStoreResource ( getInstance ( ) , Resource . StoreEvent . WRITE ) ; storeRsrc . write ( _in , _size , _fileName ) ; storeRsrc = null ; ok = true ; } ca...
public class AptControlInterface { /** * Enforces the VersionRequired annotation for control extensions . */ private void enforceVersionRequired ( ) { } }
if ( _versionRequired != null ) { if ( ! isExtension ( ) ) { _ap . printError ( _intfDecl , "versionrequired.illegal.usage" ) ; return ; } int majorRequired = _versionRequired . major ( ) ; int minorRequired = _versionRequired . minor ( ) ; if ( majorRequired < 0 ) // no real version requirement return ; AptControlInte...
public class CmsImageCacheHelper { /** * Returns the variations for the given image . < p > * @ param imgName the image name * @ return the variations for the given image */ public List getVariations ( String imgName ) { } }
List ret = ( List ) m_variations . get ( imgName ) ; if ( ret == null ) { return new ArrayList ( ) ; } Collections . sort ( ret ) ; return ret ;
public class DBInstance { /** * The status of a Read Replica . If the instance is not a Read Replica , this is blank . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setStatusInfos ( java . util . Collection ) } or { @ link # withStatusInfos ( java . util . ...
if ( this . statusInfos == null ) { setStatusInfos ( new com . amazonaws . internal . SdkInternalList < DBInstanceStatusInfo > ( statusInfos . length ) ) ; } for ( DBInstanceStatusInfo ele : statusInfos ) { this . statusInfos . add ( ele ) ; } return this ;
public class KafkaConsumer { /** * Stop message listener container . */ public void stop ( ) { } }
try { if ( CollectionUtils . isEmpty ( consumer . subscription ( ) ) ) { consumer . unsubscribe ( ) ; } } finally { consumer . close ( Duration . ofMillis ( 10 * 1000L ) ) ; }
public class AmazonDynamoDBAsyncClient { /** * Edits an existing item ' s attributes . * You can perform a conditional update ( insert a new attribute * name - value pair if it doesn ' t exist , or replace an existing name - value * pair if it has certain expected attribute values ) . * @ param updateItemReques...
return executorService . submit ( new Callable < UpdateItemResult > ( ) { public UpdateItemResult call ( ) throws Exception { return updateItem ( updateItemRequest ) ; } } ) ;
public class LdaptiveAuthenticatorBuilder { /** * New connection config connection config . * @ param l the ldap properties * @ return the connection config */ public static ConnectionConfig newConnectionConfig ( final AbstractLdapProperties l ) { } }
final ConnectionConfig cc = new ConnectionConfig ( ) ; final String urls = Arrays . stream ( l . getLdapUrl ( ) . split ( "," ) ) . collect ( Collectors . joining ( " " ) ) ; LOGGER . debug ( "Transformed LDAP urls from [{}] to [{}]" , l . getLdapUrl ( ) , urls ) ; cc . setLdapUrl ( urls ) ; cc . setUseSSL ( l . isUseS...
public class FileSystemView { /** * Returns a file attribute view for the given path in this view . */ @ Nullable public < V extends FileAttributeView > V getFileAttributeView ( final JimfsPath path , Class < V > type , final Set < ? super LinkOption > options ) { } }
return store . getFileAttributeView ( new FileLookup ( ) { @ Override public File lookup ( ) throws IOException { return lookUpWithLock ( path , options ) . requireExists ( path ) . file ( ) ; } } , type ) ;
public class Value { /** * Arbitrarily nested arrays * @ param arrayValues * Arbitrarily nested arrays */ public void setArrayValues ( java . util . Collection < Value > arrayValues ) { } }
if ( arrayValues == null ) { this . arrayValues = null ; return ; } this . arrayValues = new java . util . ArrayList < Value > ( arrayValues ) ;
public class ExpressionParser { /** * Parses the SemVer Expressions . * @ param input a string representing the SemVer Expression * @ return the AST for the SemVer Expressions * @ throws LexerException when encounters an illegal character * @ throws UnexpectedTokenException when consumes a token of an unexpecte...
tokens = lexer . tokenize ( input ) ; Expression expr = parseSemVerExpression ( ) ; consumeNextToken ( EOI ) ; return expr ;
public class AmazonIdentityManagementClient { /** * Lists all the managed policies that are available in your AWS account , including your own customer - defined * managed policies and all AWS managed policies . * You can filter the list of policies that is returned using the optional < code > OnlyAttached < / code...
request = beforeClientExecution ( request ) ; return executeListPolicies ( request ) ;
public class AbstractInjectionEngine { /** * Populates the empty cookie map with cookies to be injections . * @ param injectionTargetMap An empty map to be populated with the injection targets from * the merged xml and annotations . * @ param compNSConfig The component configuration information provided by the co...
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "processInjectionMetaData (targets)" ) ; InjectionProcessorContextImpl context = createInjectionProcessorContext ( ) ; // F743-31682 - Always bind in the client container code flow . contex...
public class DateUtils { /** * 计算日期为星期几 * @ param date 日期 * @ return 从星期天开始 , 星期天是1 , 依次类推 */ public static int getWeek ( Date date ) { } }
CALENDAR . setTime ( date ) ; return CALENDAR . get ( Calendar . DAY_OF_WEEK ) ;
public class FragmentStack { /** * Pushes a fragment to the top of the stack . */ public void push ( Fragment fragment ) { } }
Fragment top = peek ( ) ; if ( top != null ) { manager . beginTransaction ( ) . setCustomAnimations ( R . anim . enter_from_right , R . anim . exit_to_left , R . anim . enter_from_left , R . anim . exit_to_right ) . remove ( top ) . add ( containerId , fragment , indexToTag ( manager . getBackStackEntryCount ( ) + 1 ) ...
public class MaterialScrollfire { /** * Executes callback method depending on how far into the page you ' ve scrolled */ public static void apply ( String selector , Functions . Func callback ) { } }
apply ( $ ( selector ) . asElement ( ) , 100 , callback ) ;
public class SchemasInner { /** * Creates or updates an integration account schema . * @ param resourceGroupName The resource group name . * @ param integrationAccountName The integration account name . * @ param schemaName The integration account schema name . * @ param schema The integration account schema . ...
return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , integrationAccountName , schemaName , schema ) , serviceCallback ) ;
public class ModuleAssets { /** * Update an Asset . * @ param asset Asset * @ return { @ link CMAAsset } result instance * @ throws IllegalArgumentException if asset is null . * @ throws IllegalArgumentException if asset ' s id is null . * @ throws IllegalArgumentException if asset ' s space id is null . * ...
assertNotNull ( asset , "asset" ) ; final String assetId = getResourceIdOrThrow ( asset , "asset" ) ; final String spaceId = getSpaceIdOrThrow ( asset , "asset" ) ; final String environmentId = asset . getEnvironmentId ( ) ; final Integer version = getVersionOrThrow ( asset , "update" ) ; final CMASystem sys = asset . ...