signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class LoggingAppender { /** * Gets the { @ link LoggingOptions } to use for this { @ link LoggingAppender } . */ LoggingOptions getLoggingOptions ( ) { } }
if ( loggingOptions == null ) { if ( Strings . isNullOrEmpty ( credentialsFile ) ) { loggingOptions = LoggingOptions . getDefaultInstance ( ) ; } else { try { loggingOptions = LoggingOptions . newBuilder ( ) . setCredentials ( GoogleCredentials . fromStream ( new FileInputStream ( credentialsFile ) ) ) . build ( ) ; } ...
public class ManagedDatabasesInner { /** * Gets a managed database . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param managedInstanceName The name of the managed instance . * @ param data...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , managedInstanceName , databaseName ) , serviceCallback ) ;
public class FNDImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setNomPtSize ( Integer newNomPtSize ) { } }
Integer oldNomPtSize = nomPtSize ; nomPtSize = newNomPtSize ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . FND__NOM_PT_SIZE , oldNomPtSize , nomPtSize ) ) ;
public class MockEc2Controller { /** * Get mock ec2 instances by instance IDs . * @ param instanceIDs * IDs of the mock ec2 instances to get * @ return the mock ec2 instances object */ private Collection < AbstractMockEc2Instance > getInstances ( final Set < String > instanceIDs ) { } }
Collection < AbstractMockEc2Instance > ret = new ArrayList < AbstractMockEc2Instance > ( ) ; for ( String instanceID : instanceIDs ) { ret . add ( getMockEc2Instance ( instanceID ) ) ; } return ret ;
public class DateTimeFormatterBuilder { /** * Appends the reduced value of a date - time field to the formatter . * Since fields such as year vary by chronology , it is recommended to use the * { @ link # appendValueReduced ( TemporalField , int , int , ChronoLocalDate ) } date } * variant of this method in most ...
Jdk8Methods . requireNonNull ( field , "field" ) ; ReducedPrinterParser pp = new ReducedPrinterParser ( field , width , maxWidth , baseValue , null ) ; appendValue ( pp ) ; return this ;
public class Parser { /** * that the TableCell will include only the text of the cell . */ public Rule TableCell ( ) { } }
return Sequence ( NodeSequence ( push ( new TableCellNode ( ) ) , TestNot ( Sp ( ) , Optional ( ':' ) , Sp ( ) , OneOrMore ( '-' ) , Sp ( ) , Optional ( ':' ) , Sp ( ) , FirstOf ( '|' , Newline ( ) ) ) , Optional ( Sp ( ) , TestNot ( '|' ) , NotNewline ( ) ) , OneOrMore ( TestNot ( '|' ) , TestNot ( Sp ( ) , Newline ( ...
public class AppSummaryService { /** * interprets the number of runs based on number of columns in raw col family * @ param { @ link Result } * @ return number of runs */ long getNumberRunsScratch ( Map < byte [ ] , byte [ ] > rawFamily ) { } }
long numberRuns = 0L ; if ( rawFamily != null ) { numberRuns = rawFamily . size ( ) ; } if ( numberRuns == 0L ) { LOG . error ( "Number of runs in scratch column family can't be 0," + " if processing within TTL" ) ; throw new ProcessingException ( "Number of runs is 0" ) ; } return numberRuns ;
public class IndexTaskClient { /** * To use this method , { @ link # objectMapper } should be a jsonMapper . */ protected FullResponseHolder submitJsonRequest ( String taskId , HttpMethod method , String encodedPathSuffix , @ Nullable String encodedQueryString , byte [ ] content , boolean retry ) throws IOException , C...
return submitRequest ( taskId , MediaType . APPLICATION_JSON , method , encodedPathSuffix , encodedQueryString , content , retry ) ;
public class AnnotationsUtil { /** * Register all relevant annotation post processors in the given registry . * @ param registry the registry to operate on * @ param source the configuration source element ( already extracted ) * that this registration was triggered from . May be < code > null < / code > . * @ ...
Set < BeanDefinitionHolder > beanDefs = new LinkedHashSet < BeanDefinitionHolder > ( 1 ) ; if ( ! registry . containsBeanDefinition ( KIE_ANNOTATION_PROCESSOR_CLASS_NAME ) ) { RootBeanDefinition def = new RootBeanDefinition ( AnnotationsPostProcessor . class ) ; def . setSource ( source ) ; def . getPropertyValues ( ) ...
public class FaultRootCauseServiceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( FaultRootCauseService faultRootCauseService , ProtocolMarshaller protocolMarshaller ) { } }
if ( faultRootCauseService == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( faultRootCauseService . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( faultRootCauseService . getNames ( ) , NAMES_BINDING ) ; protocolMarshaller ...
public class DefaultEntityHandler { /** * SELECT SQL生成 * @ param metadata エンティティメタ情報 * @ param type エイティティタイプ * @ param sqlConfig SQLコンフィグ * @ param addCondition 条件を追加するかどうか 。 追加する場合 < code > true < / code > * @ return SELECT SQL */ protected String buildSelectSQL ( final TableMetadata metadata , final Cla...
final List < ? extends TableMetadata . Column > columns = metadata . getColumns ( ) ; final StringBuilder sql = new StringBuilder ( buildSelectClause ( metadata , type , sqlConfig . getSqlAgentFactory ( ) . getSqlIdKeyName ( ) ) ) ; if ( addCondition ) { sql . append ( "/*BEGIN*/" ) . append ( System . lineSeparator ( ...
public class WeightedIndex { /** * Produces an evaluation object that reflects the weighted sum of evaluations of all underlying objectives . * @ param solution solution to evaluate * @ param data data to be used for evaluation * @ return weighted index evaluation */ @ Override public WeightedIndexEvaluation eval...
// initialize evaluation object WeightedIndexEvaluation eval = new WeightedIndexEvaluation ( ) ; // add evaluations produced by contained objectives weights . keySet ( ) . forEach ( obj -> { // evaluate solution using objective Evaluation objEval = obj . evaluate ( solution , data ) ; // flip weight sign if minimizing ...
public class ChronicleMapBuilder { /** * Returns a new { @ code ChronicleMapBuilder } instance which is able to { @ linkplain # create ( ) * create } maps with the specified key and value classes . * @ param keyClass class object used to infer key type and discover it ' s properties via * reflection * @ param v...
return new ChronicleMapBuilder < > ( keyClass , valueClass ) ;
public class Interval { /** * A convenience method to retrieve a zoned date time based on the start * date , start time , and time zone id . * @ return the zoned start time */ public ZonedDateTime getStartZonedDateTime ( ) { } }
if ( zonedStartDateTime == null ) { zonedStartDateTime = ZonedDateTime . of ( startDate , startTime , zoneId ) ; } return zonedStartDateTime ;
public class MultiMEProxyHandler { /** * When a topic space is deleted , there may be proxy subscriptions * that need removing from the match space and putting into " limbo " * until the delete proxy subscriptions request is made * @ param destination The destination topic space that has been deleted * @ except...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "topicSpaceDeletedEvent" , destination ) ; try { _lockManager . lockExclusive ( ) ; _neighbours . topicSpaceDeleted ( destination ) ; } finally { _lockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabl...
public class AbstractTrigger { /** * Set the name of this < code > Trigger < / code > . * @ param group * if < code > null < / code > , Scheduler . DEFAULT _ GROUP will be used . * @ exception IllegalArgumentException * if group is an empty string . */ public void setGroup ( final String group ) { } }
if ( group != null && group . trim ( ) . length ( ) == 0 ) throw new IllegalArgumentException ( "Group name cannot be an empty string." ) ; if ( group == null ) m_sGroup = IScheduler . DEFAULT_GROUP ; else m_sGroup = group ; m_aKey = null ;
public class HttpResponseImpl { /** * Initialize with a new wrapped message . * @ param context */ public void init ( HttpInboundServiceContext context ) { } }
this . isc = context ; this . message = context . getResponse ( ) ; this . body = null ;
public class GFARCImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . GFARC__XPOS : return XPOS_EDEFAULT == null ? xpos != null : ! XPOS_EDEFAULT . equals ( xpos ) ; case AfplibPackage . GFARC__YPOS : return YPOS_EDEFAULT == null ? ypos != null : ! YPOS_EDEFAULT . equals ( ypos ) ; case AfplibPackage . GFARC__MH : return MH_EDEFAULT == null ? m...
public class CommonOps_DDF4 { /** * < p > Performs the vector dot product : < br > * < br > * c = a * b < br > * < br > * c & ge ; & sum ; < sub > k = 1 : n < / sub > { b < sub > k < / sub > * a < sub > k < / sub > } * @ param a The left vector in the multiplication operation . Not modified . * @ param b Th...
return a . a1 * b . a1 + a . a2 * b . a2 + a . a3 * b . a3 + a . a4 * b . a4 ;
public class ModelsImpl { /** * Get All Entity Roles for a given entity . * @ param appId The application ID . * @ param versionId The version ID . * @ param hEntityId The hierarchical entity extractor ID . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable ...
return getHierarchicalEntityRolesWithServiceResponseAsync ( appId , versionId , hEntityId ) . map ( new Func1 < ServiceResponse < List < EntityRole > > , List < EntityRole > > ( ) { @ Override public List < EntityRole > call ( ServiceResponse < List < EntityRole > > response ) { return response . body ( ) ; } } ) ;
public class MapElementConstants { /** * Set the default color for map elements . * @ param color is the default color for map elements . */ public static void setPreferredColor ( int color ) { } }
final Preferences prefs = Preferences . userNodeForPackage ( MapElementConstants . class ) ; if ( prefs != null ) { prefs . putInt ( "COLOR" , color ) ; // $ NON - NLS - 1 $ try { prefs . flush ( ) ; } catch ( BackingStoreException exception ) { } }
public class DocEnv { /** * Look up PackageDoc by qualified name . */ public PackageDocImpl lookupPackage ( String name ) { } }
// # # # Jing alleges that class check is needed // # # # to avoid a compiler bug . Most likely // # # # instead a dummy created for error recovery . // # # # Should investigate this . Name nameImpl = names . fromString ( name ) ; ModuleSymbol mod = syms . inferModule ( nameImpl ) ; PackageSymbol p = mod != null ? syms...
public class ModelsImpl { /** * Updates the closed list model . * @ param appId The application ID . * @ param versionId The version ID . * @ param clEntityId The closed list model ID . * @ param closedListModelUpdateObject The new entity name and words list . * @ throws IllegalArgumentException thrown if par...
return updateClosedListWithServiceResponseAsync ( appId , versionId , clEntityId , closedListModelUpdateObject ) . toBlocking ( ) . single ( ) . body ( ) ;
public class PersistenceType { /** * Returns the corresponding PersistenceType for a given Byte . * This method should NOT be called by any code outside the MFP component . * It is only public so that it can be accessed by sub - packages . * @ param aValue The Byte for which an PersistenceType is required . * @...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Value = " + aValue ) ; return set [ aValue . intValue ( ) ] ;
public class Fetcher { /** * Iterates over child objects of the given biopax element , * using BioPAX object - type properties , until the element * with specified URI and class ( including its sub - classes ) . * is found . * @ param root biopax element to process * @ param uri URI to match * @ param type ...
final AtomicBoolean found = new AtomicBoolean ( false ) ; Traverser traverser = new AbstractTraverser ( editorMap , filters ) { @ Override protected void visit ( Object range , BioPAXElement domain , Model model , PropertyEditor editor ) { if ( range instanceof BioPAXElement && ! found . get ( ) ) { if ( ( ( BioPAXElem...
public class Neighbours { /** * Removes all the proxies associated with this Neighbour . * @ param neighbour * @ param transaction */ private void removeRegisteredProxies ( Neighbour neighbour , Transaction transaction , boolean wasRecovered ) throws SIResourceException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeRegisteredProxies" , new Object [ ] { neighbour , transaction , new Boolean ( wasRecovered ) } ) ; // Get all the proxies that this Neighbour has registered final Hashtable registeredProxies = neighbour . getRegistere...
public class RDSMetadataMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RDSMetadata rDSMetadata , ProtocolMarshaller protocolMarshaller ) { } }
if ( rDSMetadata == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( rDSMetadata . getDatabase ( ) , DATABASE_BINDING ) ; protocolMarshaller . marshall ( rDSMetadata . getDatabaseUserName ( ) , DATABASEUSERNAME_BINDING ) ; protocolMarshaller ...
public class ObjectNameBuilder { /** * Adds the key / value as a { @ link ObjectName } property . * @ param key the key to add * @ param value the value to add * @ return This builder */ public ObjectNameBuilder addProperty ( String key , String value ) { } }
nameStrBuilder . append ( sanitizeValue ( key ) ) . append ( '=' ) . append ( sanitizeValue ( value ) ) . append ( "," ) ; return this ;
public class JingleUtil { public IQ createErrorUnknownSession ( Jingle request ) { } }
StanzaError . Builder error = StanzaError . getBuilder ( ) ; error . setCondition ( StanzaError . Condition . item_not_found ) . addExtension ( JingleError . UNKNOWN_SESSION ) ; return IQ . createErrorResponse ( request , error ) ;
public class ExchangeRate { /** * Convert a coin amount to a fiat amount using this exchange rate . * @ throws ArithmeticException if the converted fiat amount is too high or too low . */ public Fiat coinToFiat ( Coin convertCoin ) { } }
// Use BigInteger because it ' s much easier to maintain full precision without overflowing . final BigInteger converted = BigInteger . valueOf ( convertCoin . value ) . multiply ( BigInteger . valueOf ( fiat . value ) ) . divide ( BigInteger . valueOf ( coin . value ) ) ; if ( converted . compareTo ( BigInteger . valu...
public class appfwfieldtype { /** * Use this API to fetch appfwfieldtype resource of given name . */ public static appfwfieldtype get ( nitro_service service , String name ) throws Exception { } }
appfwfieldtype obj = new appfwfieldtype ( ) ; obj . set_name ( name ) ; appfwfieldtype response = ( appfwfieldtype ) obj . get_resource ( service ) ; return response ;
public class FixedDurationTemporalRandomIndexingMain { /** * Prints the semantic space to file , inserting the tag into the . sspace * file name */ private void printSpace ( SemanticSpace sspace , String tag ) { } }
try { String EXT = ".sspace" ; File output = ( overwrite ) ? new File ( outputDir , sspace . getSpaceName ( ) + tag + EXT ) : File . createTempFile ( sspace . getSpaceName ( ) + tag , EXT , outputDir ) ; long startTime = System . currentTimeMillis ( ) ; SemanticSpaceIO . save ( sspace , output , format ) ; long endTime...
public class ApiOvhDbaaslogs { /** * Returns specified elasticsearch index * REST : GET / dbaas / logs / { serviceName } / output / elasticsearch / index / { indexId } * @ param serviceName [ required ] Service name * @ param indexId [ required ] Index ID */ public OvhIndex serviceName_output_elasticsearch_index_...
String qPath = "/dbaas/logs/{serviceName}/output/elasticsearch/index/{indexId}" ; StringBuilder sb = path ( qPath , serviceName , indexId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhIndex . class ) ;
public class AdditionalAnswers { /** * Creates an answer from a functional interface - allows for a strongly typed answer to be created * idiomatically in Java 8 * @ param answer interface to the answer - a void method * @ param < A > input parameter type 1 * @ param < B > input parameter type 2 * @ param < C...
return toAnswer ( answer ) ;
public class RoutesInner { /** * Creates or updates a route in the specified route table . * @ param resourceGroupName The name of the resource group . * @ param routeTableName The name of the route table . * @ param routeName The name of the route . * @ param routeParameters Parameters supplied to the create o...
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( routeTableName == null ) { throw new IllegalArgumentException ( "Parameter routeTableName is required and cannot be null." ) ; } if ( routeName == null ) { throw new IllegalAr...
public class SimpleDataArrayCompactor { /** * Note that this method is called only by SimpleDataArray . */ final void clear ( ) { } }
reset ( ) ; _freeQueue . clear ( ) ; _targetQueue . clear ( ) ; _compactedQueue . clear ( ) ; while ( ! _updateManager . isServiceQueueEmpty ( ) ) { CompactionUpdateBatch batch = _updateManager . pollBatch ( ) ; _updateManager . recycleBatch ( batch ) ; }
public class StatsConfigHelper { /** * in which case we dont cache */ private static NLS getNLS ( Locale l , String resourceBundle , String statsType ) { } }
// init Locale boolean bDefaultLocale = false ; if ( l == null || l == Locale . getDefault ( ) ) { bDefaultLocale = true ; l = Locale . getDefault ( ) ; } NLS aNLS = null ; if ( resourceBundle == null ) { // resourceBundle is NULL // trial 1 : try prepending the 5.0 default resourcebundle location prefix ( to support c...
public class KamImpl { /** * { @ inheritDoc } */ @ Override public KamNode findNode ( String label , NodeFilter filter ) { } }
for ( KamNode kamNode : idNodeMap . values ( ) ) { String nodeLabel = kamNode . getLabel ( ) ; if ( nodeLabel . equalsIgnoreCase ( label ) ) { if ( filter != null ) { if ( ! filter . accept ( kamNode ) ) { return null ; } } return kamNode ; } } return null ;
public class GraphUtil { /** * Returns the reverse of a given navigator . In the resulting * reverse navigator , the < code > next < / code > method returns the * same result as < code > nav . prev < / code > , and the < code > prev < / code > * method returns the same result as < code > nav . next < / code > . *...
return new ReverseBiDiNavigator < Vertex > ( nav ) ;
public class JdiInitiator { /** * The JShell specific Connector args for the LaunchingConnector . * @ param portthe socket port for ( non - JDI ) commands * @ param remoteVMOptions any user requested VM options * @ return the argument map */ private Map < String , String > launchArgs ( int port , String remoteVMO...
Map < String , String > argumentName2Value = new HashMap < > ( ) ; argumentName2Value . put ( "main" , remoteAgent + " " + port ) ; argumentName2Value . put ( "options" , remoteVMOptions ) ; return argumentName2Value ;
public class PathOverrideService { /** * given the groupId , and 2 string arrays , adds the name - responses pair to the table _ override * @ param groupId ID of group * @ param methodName name of method * @ param className name of class * @ throws Exception exception */ public void createOverride ( int groupId...
// first make sure this doesn ' t already exist for ( Method method : EditService . getInstance ( ) . getMethodsFromGroupId ( groupId , null ) ) { if ( method . getMethodName ( ) . equals ( methodName ) && method . getClassName ( ) . equals ( className ) ) { // don ' t add if it already exists in the group return ; } }...
public class TableIndexDao { /** * Get or create a Geometry Index DAO * @ return geometry index dao * @ throws SQLException */ private GeometryIndexDao getGeometryIndexDao ( ) throws SQLException { } }
if ( geometryIndexDao == null ) { geometryIndexDao = DaoManager . createDao ( connectionSource , GeometryIndex . class ) ; } return geometryIndexDao ;
public class FsPermission { /** * Get the user file creation mask ( umask ) */ public static FsPermission getUMask ( Configuration conf ) { } }
int umask = DEFAULT_UMASK ; // To ensure backward compatibility first use the deprecated key . // If the deprecated key is not present then check for the new key if ( conf != null ) { String confUmask = conf . get ( UMASK_LABEL ) ; if ( confUmask != null ) { umask = new UmaskParser ( confUmask ) . getUMask ( ) ; } int ...
public class ID3v2Frame { /** * Return the length of this frame in bytes , including the header . * @ return the length of this frame */ public int getFrameLength ( ) { } }
int length = frameData . length + FRAME_HEAD_SIZE ; if ( grouped ) { length ++ ; } if ( encrypted ) { length ++ ; } if ( lengthIndicator ) { length += 4 ; } return length ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcPositiveLengthMeasure ( ) { } }
if ( ifcPositiveLengthMeasureEClass == null ) { ifcPositiveLengthMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 901 ) ; } return ifcPositiveLengthMeasureEClass ;
public class Link { /** * Returns true if the information in this link should take * precedence over the information in the other link . */ public boolean overrides ( Link other ) { } }
if ( other . getStatus ( ) == LinkStatus . ASSERTED && status != LinkStatus . ASSERTED ) return false ; else if ( status == LinkStatus . ASSERTED && other . getStatus ( ) != LinkStatus . ASSERTED ) return true ; // the two links are from equivalent sources of information , so we // believe the most recent return timest...
public class IdlToDSMojo { /** * Package name comes from explicit plugin param ( if set ) , else the namespace definition , else * skream and die . * Having the plugin override allows backwards compatibility as well as being useful for * fiddling and tweaking . */ private String derivePackageName ( Service servic...
String packageName = service . getPackageName ( ) ; if ( packageName == null ) { packageName = readNamespaceAttr ( iddDoc ) ; if ( packageName == null ) { throw new PluginException ( "Cannot find a package name " + "(not specified in plugin and no namespace in IDD" ) ; } } return packageName ;
public class SnappingMode { /** * Set a new coordinate ready to be snapped . */ public void setCoordinate ( Coordinate coordinate ) { } }
if ( coordinate == null ) { throw new IllegalArgumentException ( "Can't snap to a null coordinate." ) ; } this . coordinate = coordinate ; bounds = new Bbox ( coordinate . getX ( ) - rule . getDistance ( ) , coordinate . getY ( ) - rule . getDistance ( ) , rule . getDistance ( ) * 2 , rule . getDistance ( ) * 2 ) ; dis...
public class AbstractCollection { /** * For the parameter < i > _ expr < / i > the index in the list of all field * expressions is returned . * @ param _ expr expression for which the index is searched * @ return index of the field expression * @ see # addFieldExpr * @ see # getAllFieldExpr * @ see # allFie...
int ret = - 1 ; if ( getAllFieldExpr ( ) . containsKey ( _expr ) ) { final Integer ident = getAllFieldExpr ( ) . get ( _expr ) ; ret = ident . intValue ( ) ; } return ret ;
public class DefaultServiceRegistry { /** * - - - STOP SERVICE REGISTRY - - - */ @ Override public void stopped ( ) { } }
// Stop timer ScheduledFuture < ? > task = callTimeoutTimer . get ( ) ; if ( task != null ) { task . cancel ( false ) ; } // Stop pending invocations Iterator < PendingPromise > pendingPromises = promises . values ( ) . iterator ( ) ; while ( pendingPromises . hasNext ( ) ) { PendingPromise pending = pendingPromises . ...
public class ByteBufUtil { /** * Returns { @ code true } if the specified { @ link ByteBuf } starting at { @ code index } with { @ code length } is valid * UTF8 text , otherwise return { @ code false } . * @ param buf The given { @ link ByteBuf } . * @ param index The start index of the specified buffer . * @ p...
final int endIndex = index + length ; while ( index < endIndex ) { byte b1 = buf . getByte ( index ++ ) ; byte b2 , b3 , b4 ; if ( ( b1 & 0x80 ) == 0 ) { // 1 byte continue ; } if ( ( b1 & 0xE0 ) == 0xC0 ) { // 2 bytes // Bit / Byte pattern // 110xxxxx 10xxxxx // C2 . . DF 80 . . BF if ( index >= endIndex ) { // no eno...
public class KeySet { /** * Creates a key set containing a single key . { @ code key } should contain exactly as many elements * as there are columns in the primary or index key with this this key set is used . */ public static KeySet singleKey ( Key key ) { } }
return new KeySet ( false , ImmutableList . of ( key ) , ImmutableList . < KeyRange > of ( ) ) ;
public class VirtualMachineScaleSetExtensionsInner { /** * The operation to create or update an extension . * @ param resourceGroupName The name of the resource group . * @ param vmScaleSetName The name of the VM scale set where the extension should be create or updated . * @ param vmssExtensionName The name of t...
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , vmssExtensionName , extensionParameters ) . map ( new Func1 < ServiceResponse < VirtualMachineScaleSetExtensionInner > , VirtualMachineScaleSetExtensionInner > ( ) { @ Override public VirtualMachineScaleSetExtensionInner call ( Se...
public class DeleteTagsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteTagsRequest deleteTagsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteTagsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteTagsRequest . getConfigurationIds ( ) , CONFIGURATIONIDS_BINDING ) ; protocolMarshaller . marshall ( deleteTagsRequest . getTags ( ) , TAGS_BINDING ) ; } catch (...
public class InstantiationUtils { /** * Try to instantiate the given class using the most optimal strategy first trying the { @ link io . micronaut . core . beans . BeanIntrospector } and * if no bean is present falling back to reflection . * @ param type The type * @ param < T > The generic type * @ return The...
ArgumentUtils . requireNonNull ( "type" , type ) ; final Supplier < T > reflectionFallback = ( ) -> { final Logger logger = ClassUtils . REFLECTION_LOGGER ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Cannot instantiate type [{}] without reflection. Attempting reflective instantiation" , type ) ; } try { T b...
public class OAuth20Utils { /** * Parse request scopes set . * @ param context the context * @ return the set */ public static Set < String > parseRequestScopes ( final HttpServletRequest context ) { } }
val parameterValues = context . getParameter ( OAuth20Constants . SCOPE ) ; if ( StringUtils . isBlank ( parameterValues ) ) { return new HashSet < > ( 0 ) ; } return CollectionUtils . wrapSet ( parameterValues . split ( " " ) ) ;
public class GroupApi { /** * Get all details of a group . * < pre > < code > GitLab Endpoint : GET / groups / : id < / code > < / pre > * @ param groupIdOrPath the group ID , path of the group , or a Group instance holding the group ID or path * @ return the Group instance for the specified group path * @ thro...
Response response = get ( Response . Status . OK , null , "groups" , getGroupIdOrPath ( groupIdOrPath ) ) ; return ( response . readEntity ( Group . class ) ) ;
public class CookieFlagsDetector { /** * This method is used to track calls made on a specific object . For instance , this could be used to track if " setHttpOnly ( true ) " * was executed on a specific cookie object . * This allows the detector to find interchanged calls like this * Cookie cookie1 = new Cookie ...
Location location = startLocation ; InstructionHandle handle = location . getHandle ( ) ; int loadedStackValue = 0 ; // Loop until we find the setSecure call for this cookie while ( handle . getNext ( ) != null ) { handle = handle . getNext ( ) ; Instruction nextInst = handle . getInstruction ( ) ; // We check if the i...
public class CmsOUEditDialog { /** * Saves the OU . < p > */ void saveOU ( ) { } }
try { List < String > resources = new ArrayList < String > ( ) ; for ( I_CmsEditableGroupRow row : m_ouResources . getRows ( ) ) { resources . add ( ( ( CmsPathSelectField ) row . getComponent ( ) ) . getValue ( ) ) ; } if ( m_ou == null ) { String parentOu = m_parentOu . getValue ( ) ; if ( ! parentOu . endsWith ( "/"...
public class MacroCycleLayout { /** * Get the shared indices of a macrocycle and atoms shared with another ring . * @ param macrocycle macrocycle ring * @ param shared shared atoms * @ return the integers */ private List < Integer > getAttachedInOrder ( IRing macrocycle , IAtomContainer shared ) { } }
List < Integer > ringAttach = new ArrayList < > ( ) ; Set < IAtom > visit = new HashSet < > ( ) ; IAtom atom = shared . getAtom ( 0 ) ; while ( atom != null ) { visit . add ( atom ) ; ringAttach . add ( macrocycle . indexOf ( atom ) ) ; List < IAtom > connected = shared . getConnectedAtomsList ( atom ) ; atom = null ; ...
public class Primes { /** * Returns the i - th prime number in the sequence of * all prime numbers below 19700 . The first in the sequence * ( n = 0 ) is the prime number 2. */ public static int getPrimeAt ( int index ) { } }
if ( index < 0 || index > PRIMES . length - 1 ) throw new ArrayIndexOutOfBoundsException ( "out of range " + index ) ; return PRIMES [ index ] ;
public class CmsObject { /** * Checks if the current user has required permissions to access a given resource . < p > * @ param resource the resource to check the permissions for * @ param requiredPermissions the set of permissions to check for * @ return < code > true < / code > if the required permissions are s...
return m_securityManager . hasPermissions ( m_context , resource , requiredPermissions , true , CmsResourceFilter . ALL ) . isAllowed ( ) ;
public class ViewInstruction { /** * 注册一个 { @ link ViewDispatcher } 定义到上下文中 , 以被这个类的所有实例使用 */ protected ViewDispatcher registerViewDispatcher ( WebApplicationContext applicationContext ) { } }
// 并发下 , 重复注册虽然不会错误 , 但没有必要重复注册 synchronized ( applicationContext ) { if ( SpringUtils . getBean ( applicationContext , viewDispatcherName ) == null ) { GenericBeanDefinition beanDefinition = new AnnotatedGenericBeanDefinition ( ViewDispatcherImpl . class ) ; ( ( BeanDefinitionRegistry ) applicationContext . getAutowir...
public class MultiNormalizerHybrid { /** * Apply min - max scaling to a specific output , overriding the global output strategy if any * @ param output the index of the input * @ param rangeFrom lower bound of the target range * @ param rangeTo upper bound of the target range * @ return the normalizer */ public...
perOutputStrategies . put ( output , new MinMaxStrategy ( rangeFrom , rangeTo ) ) ; return this ;
public class Matrix3f { /** * Apply rotation of < code > angles . y < / code > radians about the Y axis , followed by a rotation of < code > angles . x < / code > radians about the X axis and * followed by a rotation of < code > angles . z < / code > radians about the Z axis . * When used with a right - handed coor...
return rotateYXZ ( angles . y , angles . x , angles . z ) ;
public class BGZFSplitFileInputFormat { /** * file repeatedly and checking addIndexedSplits for an index repeatedly . */ private int addProbabilisticSplits ( List < InputSplit > splits , int i , List < InputSplit > newSplits , Configuration cfg ) throws IOException { } }
final Path path = ( ( FileSplit ) splits . get ( i ) ) . getPath ( ) ; final FSDataInputStream in = path . getFileSystem ( cfg ) . open ( path ) ; final BGZFSplitGuesser guesser = new BGZFSplitGuesser ( in ) ; FileSplit fspl ; do { fspl = ( FileSplit ) splits . get ( i ) ; final long beg = fspl . getStart ( ) ; final l...
public class PolyUtils { /** * Find edge closest to the given coordinate */ public static int findEdge ( Poly node , MeshData tile , float value , int comp ) { } }
float error = Float . MAX_VALUE ; int edge = 0 ; for ( int i = 0 ; i < node . vertCount ; i ++ ) { int j = ( i + 1 ) % node . vertCount ; float v1 = tile . verts [ 3 * node . verts [ i ] + comp ] - value ; float v2 = tile . verts [ 3 * node . verts [ j ] + comp ] - value ; float d = v1 * v1 + v2 * v2 ; if ( d < error )...
public class Node { /** * Replaces the current node with nodes defined using builder - style notation via a Closure . * @ param c A Closure defining the new nodes using builder - style notation . * @ return the original now replaced node */ public Node replaceNode ( Closure c ) { } }
if ( parent ( ) == null ) { throw new UnsupportedOperationException ( "Replacing the root node is not supported" ) ; } appendNodes ( c ) ; getParentList ( parent ( ) ) . remove ( this ) ; this . setParent ( null ) ; return this ;
public class ArrayContext { /** * Join the contents of the given array separated by the given separator . * For example , the array [ a , b , c ] with separator ' ' would result in : * < code > a b c < / code > . * @ param array The array to join * @ param separator The separator between values * @ return The...
int size = array . length ; StringBuilder buffer = new StringBuilder ( 512 ) ; for ( int i = 0 ; i < size ; i ++ ) { int item = array [ i ] ; if ( i > 0 ) { buffer . append ( separator ) ; } buffer . append ( item ) ; } return buffer . toString ( ) ;
public class WASReactiveStreamsEngineImpl { /** * Declarative Services method for setting the context service reference * @ param ref reference to the service */ @ Reference ( name = "contextService" , service = WSContextService . class ) protected void setContextService ( ServiceReference < WSContextService > ref ) ...
contextServiceRef . setReference ( ref ) ;
public class QueryStringBuilder { /** * Build query string . * @ return Query string or null if query string contains no parameters at all . */ public @ Nullable String build ( ) { } }
StringBuilder queryString = new StringBuilder ( ) ; for ( NameValuePair param : params ) { if ( queryString . length ( ) > 0 ) { queryString . append ( PARAM_SEPARATOR ) ; } queryString . append ( Escape . urlEncode ( param . getName ( ) ) ) ; queryString . append ( VALUE_SEPARATOR ) ; queryString . append ( Escape . u...
public class XWikiExtensionRepositoryFactory { /** * ExtensionRepositoryFactory */ @ Override public ExtensionRepository createRepository ( ExtensionRepositoryDescriptor repositoryDescriptor ) throws ExtensionRepositoryException { } }
try { return new XWikiExtensionRepository ( repositoryDescriptor , this , this . licenseManager , this . httpClientFactory , this . factory ) ; } catch ( Exception e ) { throw new ExtensionRepositoryException ( "Failed to create repository [" + repositoryDescriptor + "]" , e ) ; }
public class LogBuffer { /** * Sets this buffer ' s position . If the mark is defined and larger than the * new position then it is discarded . < / p > * @ param newPosition The new position value ; must be non - negative and no * larger than the current limit * @ return This buffer * @ throws IllegalArgument...
if ( newPosition > limit || newPosition < 0 ) throw new IllegalArgumentException ( "limit excceed: " + newPosition ) ; this . position = origin + newPosition ; return this ;
public class HttpClient { /** * Setup a callback called when { @ link HttpClientRequest } is about to be sent . * @ param doOnRequest a consumer observing connected events * @ return a new { @ link HttpClient } */ public final HttpClient doOnRequest ( BiConsumer < ? super HttpClientRequest , ? super Connection > do...
Objects . requireNonNull ( doOnRequest , "doOnRequest" ) ; return new HttpClientDoOn ( this , doOnRequest , null , null , null ) ;
public class BM25 { /** * 计算一个句子与一个文档的BM25相似度 * @ param sentence 句子 ( 查询语句 ) * @ param index 文档 ( 用语料库中的下标表示 ) * @ return BM25 score */ public double sim ( List < String > sentence , int index ) { } }
double score = 0 ; for ( String word : sentence ) { if ( ! f [ index ] . containsKey ( word ) ) continue ; int d = docs . get ( index ) . size ( ) ; Integer tf = f [ index ] . get ( word ) ; score += ( idf . get ( word ) * tf * ( k1 + 1 ) / ( tf + k1 * ( 1 - b + b * d / avgdl ) ) ) ; } return score ;
public class CounterMap { /** * This method purges counter for a given first element * @ param element */ public void clear ( F element ) { } }
Counter < S > s = maps . get ( element ) ; if ( s != null ) s . clear ( ) ;
public class ErrorCollector { /** * Adds a failure with the given { @ code reason } * to the table if { @ code matcher } does not match { @ code value } . * Execution continues , but the test will fail at the end if the match fails . */ public < T > void checkThat ( final String reason , final T value , final Match...
checkSucceeds ( new Callable < Object > ( ) { public Object call ( ) throws Exception { assertThat ( reason , value , matcher ) ; return value ; } } ) ;
public class DescribeInstancePatchesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeInstancePatchesRequest describeInstancePatchesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeInstancePatchesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeInstancePatchesRequest . getInstanceId ( ) , INSTANCEID_BINDING ) ; protocolMarshaller . marshall ( describeInstancePatchesRequest . getFilters ( ...
public class JMLambda { /** * Run and return r . * @ param < R > the type parameter * @ param runnable the runnable * @ param returnSupplier the return supplier * @ return the r */ public static < R > R runAndReturn ( Runnable runnable , Supplier < R > returnSupplier ) { } }
runnable . run ( ) ; return returnSupplier . get ( ) ;
public class SBTAddManagedSourcesMojo { /** * Adds default SBT managed sources location to Maven project . * < code > $ { project . build . directory } / src _ managed < / code > is added to project ' s compile source roots */ @ Override public void execute ( ) { } }
if ( "pom" . equals ( project . getPackaging ( ) ) ) { return ; } File managedPath = new File ( project . getBuild ( ) . getDirectory ( ) , "src_managed" ) ; String managedPathStr = managedPath . getAbsolutePath ( ) ; if ( ! project . getCompileSourceRoots ( ) . contains ( managedPathStr ) ) { project . addCompileSourc...
public class HealthCheckMarshaller { /** * Marshall the given parameter object . */ public void marshall ( HealthCheck healthCheck , ProtocolMarshaller protocolMarshaller ) { } }
if ( healthCheck == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( healthCheck . getCommand ( ) , COMMAND_BINDING ) ; protocolMarshaller . marshall ( healthCheck . getInterval ( ) , INTERVAL_BINDING ) ; protocolMarshaller . marshall ( healt...
public class JSpinnerEditorValueProvider { /** * Retrieves the formatter currently in the text component of the spinner , if any . * Note that if editor of the spinner has been customized , this method may need to be adapted in a sub - class . * @ return Spinner formatter or null if not found . */ protected JFormat...
JFormattedTextField . AbstractFormatter formatter = null ; // Try to find a text component in the spinner JFormattedTextField textEditorComponent ; if ( spinner . getEditor ( ) instanceof JFormattedTextField ) { textEditorComponent = ( JFormattedTextField ) spinner . getEditor ( ) ; } else if ( spinner . getEditor ( ) ...
public class BigComplexMath { /** * Calculates the arc sine ( inverted sine ) of { @ link BigComplex } x in the complex domain . * < p > See : < a href = " https : / / en . wikipedia . org / wiki / Inverse _ trigonometric _ functions # Extension _ to _ complex _ plane " > Wikipedia : Inverse trigonometric functions (...
MathContext mc = new MathContext ( mathContext . getPrecision ( ) + 4 , mathContext . getRoundingMode ( ) ) ; return I . negate ( ) . multiply ( log ( I . multiply ( x , mc ) . add ( sqrt ( BigComplex . ONE . subtract ( x . multiply ( x , mc ) , mc ) , mc ) , mc ) , mc ) , mc ) . round ( mathContext ) ;
public class PubSubRealization { /** * Attaches to a created DurableSubscription which is homed on * the local ME . * @ param consumerPoint The consumer point to attach . * @ param subState The ConsumerDispatcherState describing the subscription . */ public ConsumableKey attachToLocalDurableSubscription ( LocalCo...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "attachToLocalDurableSubscription" , new Object [ ] { consumerPoint , subState } ) ; ConsumerDispatcher consumerDispatcher = null ; ConsumableKey data = null ; /* * Lock the list of durable subscriptions to prevent others cr...
public class SharedPreferenceUtils { /** * put the int value to shared preference * @ param key * the name of the preference to save * @ param value * the name of the preference to modify . * @ see android . content . SharedPreferences # edit ( ) # putInt ( String , int ) */ public void putInt ( String key , ...
sharedPreferences . edit ( ) . putInt ( key , value ) . commit ( ) ;
public class MapDotApi { /** * Get map value by path . * @ param < A > map key type * @ param < B > map value type * @ param map subject * @ param pathString nodes to walk in map * @ return value */ public static < A , B > Map < A , B > dotGetNullableMap ( final Map map , final String pathString ) { } }
return dotGetNullable ( map , Map . class , pathString ) ;
public class JKCollectionUtil { /** * To properties . * @ param propString the prop string * @ return the properties */ public static Properties toProperties ( String propString ) { } }
Properties prop = new Properties ( ) ; try { prop . load ( new StringReader ( propString ) ) ; return prop ; } catch ( IOException e ) { JK . throww ( e ) ; return null ; }
public class LhsBuilder { /** * Work out the type of " field " that is being specified , * as in : * age * age < * age = = $ param * age = = $ 1 | | age = = $ 2 * forall { age < $ } { , } * etc . as we treat them all differently . */ public FieldType calcFieldType ( String content ) { } }
final SnippetBuilder . SnippetType snippetType = SnippetBuilder . getType ( content ) ; if ( snippetType . equals ( SnippetBuilder . SnippetType . FORALL ) ) { return FieldType . FORALL_FIELD ; } else if ( ! snippetType . equals ( SnippetBuilder . SnippetType . SINGLE ) ) { return FieldType . NORMAL_FIELD ; } for ( Str...
public class BatchOptions { /** * Jitters the batch flush interval by a random amount . This is primarily to avoid * large write spikes for users running a large number of client instances . * ie , a jitter of 5s and flush duration 10s means flushes will happen every 10-15s . * @ param jitterDuration ( millisecon...
BatchOptions clone = getClone ( ) ; clone . jitterDuration = jitterDuration ; return clone ;
public class AbstractApi { /** * Constructs bad request response * @ param message message * @ return response */ protected Response createBadRequest ( String message ) { } }
ErrorResponse entity = new ErrorResponse ( ) ; entity . setMessage ( message ) ; return Response . status ( Response . Status . BAD_REQUEST ) . entity ( entity ) . build ( ) ;
public class RaidNode { /** * Determine a PolicyInfo from the codec , to re - generate the parity files * of modified source files . * @ param codec * @ return */ public PolicyInfo determinePolicy ( Codec codec ) { } }
for ( PolicyInfo info : configMgr . getAllPolicies ( ) ) { if ( ! info . getShouldRaid ( ) ) { continue ; } if ( info . getCodecId ( ) . equals ( codec . id ) ) { return info ; } } return null ;
public class CPRuleUserSegmentRelPersistenceImpl { /** * Caches the cp rule user segment rel in the entity cache if it is enabled . * @ param cpRuleUserSegmentRel the cp rule user segment rel */ @ Override public void cacheResult ( CPRuleUserSegmentRel cpRuleUserSegmentRel ) { } }
entityCache . putResult ( CPRuleUserSegmentRelModelImpl . ENTITY_CACHE_ENABLED , CPRuleUserSegmentRelImpl . class , cpRuleUserSegmentRel . getPrimaryKey ( ) , cpRuleUserSegmentRel ) ; cpRuleUserSegmentRel . resetOriginalValues ( ) ;
public class GeoJsonReaderDriver { /** * Parses a GeometryCollection * the geometry objects are described above : * { " type " : " GeometryCollection " , " geometries " : [ { " type " : " Point " , * " coordinates " : [ 100.0 , 0.0 ] } , { " type " : " LineString " , " coordinates " : [ * [ 101.0 , 0.0 ] , [ 10...
jp . nextToken ( ) ; // FIELD _ NAME geometries String coordinatesField = jp . getText ( ) ; if ( coordinatesField . equalsIgnoreCase ( GeoJsonField . GEOMETRIES ) ) { jp . nextToken ( ) ; // START array jp . nextToken ( ) ; // START object while ( jp . getCurrentToken ( ) != JsonToken . END_ARRAY ) { jp . nextToken ( ...
public class Task { /** * Terminates the running children of this task starting from the specified index up to the end . * @ param startIndex the start index */ protected void cancelRunningChildren ( int startIndex ) { } }
for ( int i = startIndex , n = getChildCount ( ) ; i < n ; i ++ ) { Task < E > child = getChild ( i ) ; if ( child . status == Status . RUNNING ) child . cancel ( ) ; }
public class File { /** * The label is always the filename . */ @ Override public String getLabel ( ) { } }
ResourceStore rs ; ResourceRef rr ; synchronized ( lock ) { rs = this . resourceStore ; rr = this . resourceRef ; } if ( rr != null ) { String path = rr . getPath ( ) . toString ( ) ; boolean isDirectory = path . endsWith ( Path . SEPARATOR_STRING ) ; int slashBefore ; if ( isDirectory ) { slashBefore = path . lastInde...
public class JainSipUtils { /** * https : / / github . com / Mobicents / sip - servlets / issues / 62 */ public static String findRouteOrRequestUriTransport ( Request request ) { } }
RouteHeader route = ( RouteHeader ) request . getHeader ( RouteHeader . NAME ) ; if ( route != null ) { URI uri = route . getAddress ( ) . getURI ( ) ; return findURITransport ( uri , request . getContentLength ( ) . getContentLength ( ) ) ; } URI ruri = request . getRequestURI ( ) ; return findURITransport ( ruri , re...
public class ScanCollectionDefault { /** * Scan List with closest RT less or equal to the provided one are returned . */ @ Override public List < IScan > getScansByRtLower ( double rt ) { } }
Map . Entry < Double , List < IScan > > lowerEntry = getRt2scan ( ) . lowerEntry ( rt ) ; if ( lowerEntry == null ) { return null ; } List < IScan > scans = lowerEntry . getValue ( ) ; if ( scans != null ) { return scans ; } return null ;
public class ExponentialBuckets { /** * { @ inheritDoc } * Override the base method making it faster thanks to exponential regression . */ protected Bucket getBucketForValue ( long value ) { } }
Bucket bucket ; if ( value >= max ) { bucket = buckets [ bucketNb + 1 ] ; } else { if ( value < min ) { bucket = buckets [ 0 ] ; } else { int idx = ( int ) Math . floor ( ( Math . log ( value ) - logMin ) / power ) + 1 ; bucket = buckets [ idx ] ; if ( value >= bucket . getMax ( ) ) { bucket = buckets [ idx + 1 ] ; } }...
public class BsAccessTokenCB { public AccessTokenCB acceptPK ( String id ) { } }
assertObjectNotNull ( "id" , id ) ; BsAccessTokenCB cb = this ; cb . query ( ) . docMeta ( ) . setId_Equal ( id ) ; return ( AccessTokenCB ) this ;
public class VehicleManager { /** * Remove a previously registered sink from the data pipeline . */ public void removeSink ( VehicleDataSink sink ) { } }
if ( sink != null ) { mRemoteOriginPipeline . removeSink ( sink ) ; sink . stop ( ) ; }