signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AsyncStorageInt { /** * Display list */ public void loadForward ( String query , Long afterSortKey , int limit , ListEngineDisplayLoadCallback < T > callback ) { } }
storageActor . send ( new AsyncStorageActor . LoadForward < T > ( query , afterSortKey , limit , callback ) ) ;
public class IntentUtils { /** * Send SMS message using built - in app * @ param context Application context * @ param to Receiver phone number * @ param message Text to send */ public static Intent sendSms ( Context context , String to , String message ) { } }
if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . KITKAT ) { String defaultSmsPackageName = Telephony . Sms . getDefaultSmsPackage ( context ) ; Intent intent = new Intent ( Intent . ACTION_SENDTO , Uri . parse ( "smsto:" + to ) ) ; intent . putExtra ( "sms_body" , message ) ; if ( defaultSmsPackageName != null...
public class IncludeRelationshipLoader { /** * Loads all related resources for the given resources and relationship * field . It updates the relationship data of the source resources * accordingly and returns the loaded resources for potential inclusion in * the result resource . */ @ SuppressWarnings ( "unchecke...
if ( sourceResources . isEmpty ( ) ) { return resultFactory . just ( Collections . emptySet ( ) ) ; } // directly load where relationship data is available Collection < Resource > sourceResourcesWithData = new ArrayList < > ( ) ; Collection < Resource > sourceResourcesWithoutData = new ArrayList < > ( ) ; for ( Resourc...
public class CountedCompleter { /** * H2O Hack to get distributed FJ behavior closer to the behavior on local node . * It allows us to continue in " completion propagation " interrupted by remote task . * Should * not * be called by anyone outside of RPC mechanism . * In standard FJ , tryComplete is always called...
CountedCompleter a = this , s = caller ; for ( int c ; ; ) { if ( ( c = a . pending ) == 0 ) { a . onCompletion ( s ) ; if ( ( a = ( s = a ) . completer ) == null ) { s . quietlyComplete ( ) ; return ; } } else if ( U . compareAndSwapInt ( a , PENDING , c , c - 1 ) ) return ; }
public class TcpListener { /** * Close the listening socket . */ private void close ( ) { } }
assert ( fd != null ) ; try { fd . close ( ) ; socket . eventClosed ( endpoint , fd ) ; } catch ( IOException e ) { socket . eventCloseFailed ( endpoint , ZError . exccode ( e ) ) ; } fd = null ;
public class Partitions { /** * Update the partition cache . Updates are necessary after the partition details have changed . */ public void updateCache ( ) { } }
synchronized ( partitions ) { if ( partitions . isEmpty ( ) ) { this . slotCache = EMPTY ; this . nodeReadView = Collections . emptyList ( ) ; return ; } RedisClusterNode [ ] slotCache = new RedisClusterNode [ SlotHash . SLOT_COUNT ] ; List < RedisClusterNode > readView = new ArrayList < > ( partitions . size ( ) ) ; f...
public class TorqueDBHandling { /** * Writes the torque schemata to files in the given directory and returns * a comma - separated list of the filenames . * @ param dir The directory to write the files to * @ return The list of filenames * @ throws IOException If an error occurred */ private String writeSchemat...
writeCompressedTexts ( dir , _torqueSchemata ) ; StringBuffer includes = new StringBuffer ( ) ; for ( Iterator it = _torqueSchemata . keySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { includes . append ( ( String ) it . next ( ) ) ; if ( it . hasNext ( ) ) { includes . append ( "," ) ; } } return includes . toString (...
public class FlattenUnionExecutorImpl { /** * Replace the child subtrees of the focus node */ @ Override public NodeCentricOptimizationResults < UnionNode > apply ( FlattenUnionProposal proposal , IntermediateQuery query , QueryTreeComponent treeComponent ) throws InvalidQueryOptimizationProposalException , EmptyQueryE...
UnionNode focusNode = proposal . getFocusNode ( ) ; IntermediateQuery snapShot = query . createSnapshot ( ) ; query . getChildren ( focusNode ) . stream ( ) . forEach ( n -> treeComponent . removeSubTree ( n ) ) ; ImmutableSet < QueryNode > subqueryRoots = proposal . getSubqueryRoots ( ) ; subqueryRoots . forEach ( n -...
public class RadialPickerLayout { /** * Set either seconds , minutes or hours as showing . * @ param animate True to animate the transition , false to show with no animation . */ public void setCurrentItemShowing ( int index , boolean animate ) { } }
if ( index != HOUR_INDEX && index != MINUTE_INDEX && index != SECOND_INDEX ) { Log . e ( TAG , "TimePicker does not support view at index " + index ) ; return ; } int lastIndex = getCurrentItemShowing ( ) ; mCurrentItemShowing = index ; reselectSelector ( getTime ( ) , true , index ) ; if ( animate && ( index != lastIn...
public class RetryInfo { /** * < pre > * Clients should wait at least this long between retrying the same request . * < / pre > * < code > . google . protobuf . Duration retry _ delay = 1 ; < / code > */ public com . google . protobuf . Duration getRetryDelay ( ) { } }
return retryDelay_ == null ? com . google . protobuf . Duration . getDefaultInstance ( ) : retryDelay_ ;
public class IOUtil { /** * 读取一行数据 , 比如System . in的用户输入 */ public static String readLine ( final InputStream input ) throws IOException { } }
return new BufferedReader ( new InputStreamReader ( input , Charsets . UTF_8 ) ) . readLine ( ) ;
public class Divider { /** * Creates and returns a listener , which allows to observe the progress of an animation , which * is used to show or hide the divider . * @ param show * True , if the divider is shown by the animation , false otherwise * @ return The listener , which has been created , as an instance ...
return new AnimatorListenerAdapter ( ) { @ Override public void onAnimationStart ( final Animator animation ) { super . onAnimationStart ( animation ) ; if ( show ) { Divider . super . setVisibility ( View . VISIBLE ) ; } } @ Override public void onAnimationEnd ( final Animator animation ) { super . onAnimationEnd ( an...
public class INodeFileUnderConstruction { /** * Remove this INodeFileUnderConstruction from the list of datanodes . */ private void removeINodeFromDatanodeDescriptors ( DatanodeDescriptor [ ] targets ) { } }
if ( targets != null ) { for ( DatanodeDescriptor node : targets ) { node . removeINode ( this ) ; } }
public class ArrayDeque { /** * Inserts the specified element at the end of this deque . * < p > This method is equivalent to { @ link # add } . * @ param e the element to add * @ throws NullPointerException if the specified element is null */ public void addLast ( E e ) { } }
if ( e == null ) throw new NullPointerException ( ) ; elements [ tail ] = e ; if ( ( tail = ( tail + 1 ) & ( elements . length - 1 ) ) == head ) doubleCapacity ( ) ;
public class V1InstanceGetter { /** * Get assets filtered by the criteria specified in the passed in filter . * @ param filter Limit the items returned . If null , then all items returned . * @ return Collection of items as specified in the filter . */ public Collection < BaseAsset > baseAssets ( BaseAssetFilter fi...
return get ( BaseAsset . class , ( filter != null ) ? filter : new BaseAssetFilter ( ) ) ;
public class CorruptReplicasMap { /** * Remove the block at the given datanode from CorruptBlockMap * @ param blk block to be removed * @ param datanode datanode where the block is located * @ return true if the removal is successful ; * false if the replica is not in the map */ boolean removeFromCorruptReplica...
Collection < DatanodeDescriptor > datanodes = corruptReplicasMap . get ( blk ) ; if ( datanodes == null ) return false ; if ( datanodes . remove ( datanode ) ) { // remove the replicas if ( datanodes . isEmpty ( ) ) { // remove the block if there is no more corrupted replicas corruptReplicasMap . remove ( blk ) ; } ret...
public class PortalApplicationContextLocator { /** * If the ApplicationContext returned by { @ link # getApplicationContext ( ) } is ' portal managed ' * the shutdown hook for the context is called , closing and cleaning up all spring managed * resources . * < p > If the ApplicationContext returned by { @ link # ...
if ( applicationContextCreator . isCreated ( ) ) { final ConfigurableApplicationContext applicationContext = applicationContextCreator . get ( ) ; applicationContext . close ( ) ; } else { final IllegalStateException createException = new IllegalStateException ( "No portal managed ApplicationContext has been created, t...
public class XElementBase { /** * Converts all sensitive characters to its HTML entity equivalent . * @ param s the string to convert , can be null * @ return the converted string , or an empty string */ public static String sanitize ( String s ) { } }
if ( s != null ) { StringBuilder b = new StringBuilder ( s . length ( ) ) ; for ( int i = 0 , count = s . length ( ) ; i < count ; i ++ ) { char c = s . charAt ( i ) ; switch ( c ) { case '<' : b . append ( "&lt;" ) ; break ; case '>' : b . append ( "&gt;" ) ; break ; case '\'' : b . append ( "&#39;" ) ; break ; case '...
public class FreemarkerCall { /** * Render the template as the entity for a ResponseBuilder , returning the built Response * @ return the result of calling responseBuilder . */ @ Override public Response process ( Response . ResponseBuilder responseBuilder ) { } }
final String entity = process ( ) ; responseBuilder . entity ( entity ) ; return responseBuilder . build ( ) ;
public class Datatype_Builder { /** * Sets the value to be returned by { @ link Datatype # getBuilderFactory ( ) } . * @ return this { @ code Builder } object */ public Datatype . Builder setNullableBuilderFactory ( BuilderFactory builderFactory ) { } }
if ( builderFactory != null ) { return setBuilderFactory ( builderFactory ) ; } else { return clearBuilderFactory ( ) ; }
public class Document { /** * Gets annotations of the given type that overlap with the given span and meet the given filter . * @ param type the type of annotation * @ param span the span to search for overlapping annotations * @ param filter the filter to use on the annotations * @ return All annotations of th...
return annotationSet . select ( span , a -> filter . test ( a ) && a . isInstance ( type ) && a . overlaps ( span ) ) ;
public class ApiApp { /** * Internal method used to retrieve the necessary POST fields to submit the * API app to HelloSign . * @ return Map * @ throws HelloSignException thrown if there is a problem serializing the * POST fields . */ public Map < String , Serializable > getPostFields ( ) throws HelloSignExcept...
Map < String , Serializable > fields = new HashMap < String , Serializable > ( ) ; try { if ( hasName ( ) ) { fields . put ( APIAPP_NAME , getName ( ) ) ; } if ( hasDomain ( ) ) { fields . put ( APIAPP_DOMAIN , getDomain ( ) ) ; } if ( hasCallbackUrl ( ) ) { fields . put ( APIAPP_CALLBACK_URL , getCallbackUrl ( ) ) ; }...
public class InterceptedCommand { /** * Executes the next command in the execution chain using the given Parameters * parameters ( arguments ) . * @ param correlationId unique transaction id to trace calls across components . * @ param args the parameters ( arguments ) to pass to the command for * execution . ...
return _interceptor . execute ( correlationId , _next , args ) ;
public class L1Regularizer { /** * Updates the weights by applying the L1 regularization . * @ param l1 * @ param learningRate * @ param weights * @ param newWeights * @ param < K > */ public static < K > void updateWeights ( double l1 , double learningRate , Map < K , Double > weights , Map < K , Double > ne...
if ( l1 > 0.0 ) { /* / / SGD - L1 ( Naive ) for ( Map . Entry < K , Double > e : weights . entrySet ( ) ) { K column = e . getKey ( ) ; newWeights . put ( column , newWeights . get ( column ) + l1 * Math . signum ( e . getValue ( ) ) * ( - learningRate ) ) ; */ // SGDL1 ( Clipping ) for ( Map . Entry < K , Double...
public class WebDriverTool { /** * Delegates to { @ link # findElement ( By ) } and then moves the mouse to the returned element * using the { @ link Actions } class . * @ param by * the { @ link By } used to locate the element */ public void hover ( final By by ) { } }
checkTopmostElement ( by ) ; WebElement element = findElement ( by ) ; new Actions ( webDriver ) . moveToElement ( element ) . perform ( ) ;
public class BELScriptParser { /** * BELScript . g : 143:1 : argument : ( param | term ) ; */ public final BELScriptParser . argument_return argument ( ) throws RecognitionException { } }
BELScriptParser . argument_return retval = new BELScriptParser . argument_return ( ) ; retval . start = input . LT ( 1 ) ; Object root_0 = null ; BELScriptParser . param_return param62 = null ; BELScriptParser . term_return term63 = null ; try { // BELScript . g : 143:9 : ( param | term ) int alt13 = 2 ; int LA13_0 = i...
public class EbInterfaceWriter { /** * Create a writer builder for Ebi40InvoiceType . * @ return The builder and never < code > null < / code > */ @ Nonnull public static EbInterfaceWriter < Ebi40InvoiceType > ebInterface40 ( ) { } }
final EbInterfaceWriter < Ebi40InvoiceType > ret = EbInterfaceWriter . create ( Ebi40InvoiceType . class ) ; ret . setNamespaceContext ( EbInterface40NamespaceContext . getInstance ( ) ) ; return ret ;
public class NetworkWatchersInner { /** * Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server . * @ param resourceGroupName The name of the network watcher resource group . * @ param networkWatcherName The nam...
return ServiceFuture . fromResponse ( checkConnectivityWithServiceResponseAsync ( resourceGroupName , networkWatcherName , parameters ) , serviceCallback ) ;
public class Optimizer { /** * Remove duplicate branches in an OR clause . For example : { @ code " a | b | a " = > " a | b " } . */ static Matcher dedupOr ( Matcher matcher ) { } }
if ( matcher instanceof OrMatcher ) { List < Matcher > ms = new ArrayList < > ( new LinkedHashSet < > ( matcher . < OrMatcher > as ( ) . matchers ( ) ) ) ; return OrMatcher . create ( ms ) ; } return matcher ;
public class DataFrameJoiner { /** * Full outer join the joiner to the table2 , using the given column for the second table and returns the resulting table * @ param table2 The table to join with * @ param col2Name The column to join on . If col2Name refers to a double column , the join is performed after * round...
return fullOuter ( table , table2 , false , col2Name ) ;
public class SingleWordCorrection { /** * alteration ( change one letter to another ) or an insertion ( add a letter ) . */ private Map < String , Double > distance1Generation ( String word ) { } }
if ( word == null || word . length ( ) < 1 ) throw new RuntimeException ( "Input words Error: " + word ) ; Map < String , Double > result = new HashMap < String , Double > ( ) ; String prev ; String last ; for ( int i = 0 ; i < word . length ( ) ; i ++ ) { // Deletion prev = word . substring ( 0 , i ) ; last = word . s...
public class HelpToolbar { /** * Controls for a maint screen . */ public void setupMiddleSFields ( ) { } }
new SCannedBox ( this . getNextLocation ( ScreenConstants . RIGHT_OF_LAST_BUTTON_WITH_GAP , ScreenConstants . SET_ANCHOR ) , this , null , ScreenConstants . DEFAULT_DISPLAY , "Tech" ) ; new SCannedBox ( this . getNextLocation ( ScreenConstants . RIGHT_OF_LAST_BUTTON_WITH_GAP , ScreenConstants . SET_ANCHOR ) , this , nu...
public class ViewQuery { /** * Specify the group level to be used . * Important : { @ link # group ( ) } and this setter should not be used * together in the same { @ link ViewQuery } . It is sufficient to only use this * setter and use { @ link # group ( ) } in cases where you always want * the highest group l...
params [ PARAM_GROUPLEVEL_OFFSET ] = "group_level" ; params [ PARAM_GROUPLEVEL_OFFSET + 1 ] = Integer . toString ( grouplevel ) ; return this ;
public class LogUtil { /** * public static void log ( Log log , int level , String logName , Throwable t ) { * log ( log , level , logName , " " , t ) ; } * public static void log ( Log log , int level , String logName , String msg , Throwable t ) { if ( log * instanceof LogAdapter ) { log . log ( level , logName...
if ( strLevel == null ) return defaultValue ; strLevel = strLevel . toLowerCase ( ) . trim ( ) ; if ( strLevel . startsWith ( "info" ) ) return Log . LEVEL_INFO ; if ( strLevel . startsWith ( "debug" ) ) return Log . LEVEL_DEBUG ; if ( strLevel . startsWith ( "warn" ) ) return Log . LEVEL_WARN ; if ( strLevel . startsW...
public class IpPermission { /** * [ VPC only ] The prefix list IDs for an AWS service . With outbound rules , this is the AWS service to access through * a VPC endpoint from instances associated with the security group . * @ return [ VPC only ] The prefix list IDs for an AWS service . With outbound rules , this is ...
if ( prefixListIds == null ) { prefixListIds = new com . amazonaws . internal . SdkInternalList < PrefixListId > ( ) ; } return prefixListIds ;
public class TextAnalyticsImpl { /** * The API returns a list of recognized entities in a given document . * To get even more information on each recognized entity we recommend using the Bing Entity Search API by querying for the recognized entities names . See the & lt ; a href = " https : / / docs . microsoft . com...
if ( this . client . azureRegion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.azureRegion() is required and cannot be null." ) ; } final List < MultiLanguageInput > documents = entitiesOptionalParameter != null ? entitiesOptionalParameter . documents ( ) : null ; return entitiesWithServic...
public class JaxRsClientFactory { /** * Register a list of features to all clients marked with the given group . */ public synchronized JaxRsClientFactory addFeatureToGroup ( JaxRsFeatureGroup group , Feature ... features ) { } }
Preconditions . checkState ( ! started , "Already started building clients" ) ; featureMap . putAll ( group , Arrays . asList ( features ) ) ; LOG . trace ( "Group {} registers features {}" , group , features ) ; return this ;
public class FuncStringLength { /** * { @ inheritDoc } */ @ Override public void resolve ( final ValueStack values ) throws Exception { } }
if ( values . size ( ) < getParameterCount ( ) ) throw new Exception ( "missing operands for " + toString ( ) ) ; try { final Object target = values . popStringOrByteArray ( ) ; if ( target instanceof String ) values . push ( new Double ( ( ( String ) target ) . length ( ) ) ) ; else values . push ( new Double ( ( ( by...
public class ScriptClassProvider { /** * 查找可实例化的脚本 * @ param scriptClazzs * @ return * @ throws InstantiationException * @ throws IllegalAccessException */ private Map < Integer , Class < ? extends T > > findInstanceAbleScript ( Set < Class < ? extends T > > scriptClazzs ) throws InstantiationException , Illega...
Map < Integer , Class < ? extends T > > codeMap = new ConcurrentHashMap < Integer , Class < ? extends T > > ( ) ; for ( Class < ? extends T > scriptClazz : scriptClazzs ) { T script = getInstacne ( scriptClazz ) ; if ( script == null ) { continue ; } if ( skipRegistScript ( script ) ) { _log . warn ( "skil regist scrip...
public class aaaparameter { /** * Use this API to update aaaparameter . */ public static base_response update ( nitro_service client , aaaparameter resource ) throws Exception { } }
aaaparameter updateresource = new aaaparameter ( ) ; updateresource . enablestaticpagecaching = resource . enablestaticpagecaching ; updateresource . enableenhancedauthfeedback = resource . enableenhancedauthfeedback ; updateresource . defaultauthtype = resource . defaultauthtype ; updateresource . maxaaausers = resour...
public class AbstractChannel { /** * Build the soap : Envelope and soap : Body things and return the { @ link Element } * for the soap : Body . */ private Element addSoapEnvelopeBody ( Document doc ) { } }
Element env = doc . createElementNS ( IfmapStrings . SOAP_ENV_NS_URI , IfmapStrings . SOAP_PREFIXED_ENV_EL_NAME ) ; Element body = doc . createElementNS ( IfmapStrings . SOAP_ENV_NS_URI , IfmapStrings . SOAP_PREFIXED_BODY_EL_NAME ) ; doc . appendChild ( env ) ; env . appendChild ( body ) ; return body ;
public class UIComponentTag { /** * < p > Locate and return the nearest enclosing { @ link UIComponentTag } * if any ; otherwise , return < code > null < / code > . < / p > * @ param context < code > PageContext < / code > for the current page */ public static UIComponentTag getParentUIComponentTag ( PageContext co...
UIComponentClassicTagBase result = getParentUIComponentClassicTagBase ( context ) ; if ( ! ( result instanceof UIComponentTag ) ) { return new UIComponentTagAdapter ( result ) ; } return ( ( UIComponentTag ) result ) ;
public class CommerceTaxFixedRatePersistenceImpl { /** * Returns the first commerce tax fixed rate in the ordered set where commerceTaxMethodId = & # 63 ; . * @ param commerceTaxMethodId the commerce tax method ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )...
CommerceTaxFixedRate commerceTaxFixedRate = fetchByCommerceTaxMethodId_First ( commerceTaxMethodId , orderByComparator ) ; if ( commerceTaxFixedRate != null ) { return commerceTaxFixedRate ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "commerceTaxMethodId="...
public class EJSHome { /** * f111627 */ @ Override public EJBObject getBeanWrapper ( Object primaryKey ) throws FinderException , RemoteException { } }
BeanId id = new BeanId ( this , ( Serializable ) primaryKey , false ) ; return getWrapper ( id ) . getRemoteWrapper ( ) ; // f111627
public class SSSRFinder { /** * Finds the " interchangeability " equivalence classes . * The interchangeability relation is described in [ GLS00 ] . * @ return a List of RingSets containing the rings in an equivalence class */ public List findEquivalenceClasses ( ) { } }
if ( atomContainer == null ) { return null ; } List < IRingSet > equivalenceClasses = new ArrayList < IRingSet > ( ) ; for ( Object o : cycleBasis ( ) . equivalenceClasses ( ) ) { equivalenceClasses . add ( toRingSet ( atomContainer , ( Collection ) o ) ) ; } return equivalenceClasses ;
public class DagManager { /** * Method to submit a { @ link Dag } to the { @ link DagManager } . The { @ link DagManager } first persists the * submitted dag to the { @ link DagStateStore } and then adds the dag to a { @ link BlockingQueue } to be picked up * by one of the { @ link DagManagerThread } s . */ synchro...
// Persist the dag this . dagStateStore . writeCheckpoint ( dag ) ; // Add it to the queue of dags if ( ! this . queue . offer ( dag ) ) { throw new IOException ( "Could not add dag" + DagManagerUtils . generateDagId ( dag ) + "to queue" ) ; }
public class Punctuation { /** * 判断文本中是否包含标点符号 * @ param text * @ return */ public static boolean has ( String text ) { } }
for ( char c : text . toCharArray ( ) ) { if ( is ( c ) ) { return true ; } } return false ;
public class Token { /** * setter for topicIds - sets topic model ids , separated by spaces * @ generated * @ param v value to set into the feature */ public void setTopicIds ( String v ) { } }
if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_topicIds == null ) jcasType . jcas . throwFeatMissing ( "topicIds" , "de.julielab.jules.types.Token" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_topicIds , v ) ;
public class DirectoryScanner { /** * Return the names of the directories which matched at least one of the * include patterns and at least one of the exclude patterns . * The names are relative to the base directory . This involves * performing a slow scan if one has not already been completed . * @ return the...
slowScan ( ) ; String [ ] directories = new String [ dirsExcluded . size ( ) ] ; dirsExcluded . copyInto ( directories ) ; return directories ;
public class XmlResponsesSaxParser { /** * Disables certain dangerous features that attempt to automatically fetch DTDs * See < a href = " https : / / www . owasp . org / index . php / XML _ External _ Entity _ ( XXE ) _ Prevention _ Cheat _ Sheet # XMLReader " > OWASP XXE Cheat Sheet < / a > * @ param reader the r...
reader . setFeature ( "http://xml.org/sax/features/external-general-entities" , false ) ; reader . setFeature ( "http://xml.org/sax/features/external-parameter-entities" , false ) ; reader . setFeature ( "http://apache.org/xml/features/nonvalidating/load-external-dtd" , false ) ;
public class ChunkInputStream { /** * ( non - Javadoc ) * @ see java . io . InputStream # read ( ) */ public int read ( ) throws IOException { } }
if ( chunk == null || pos + 1 == chunk . length ) { if ( ! fetchChunk ( ) ) { return - 1 ; } } return chunk [ pos ++ ] & 0xff ;
public class ClassUtil { /** * 取得primitive类型的默认值 。 如果不是primitive , 则返回 < code > null < / code > 。 * 如果 < code > clazz < / code > 为 < code > null < / code > , 则返还 < code > null < / code > * 例如 : * < pre > * ClassUtil . getPrimitiveDefaultValue ( int . class ) = 0; * ClassUtil . getPrimitiveDefaultValue ( boole...
if ( type == null ) { return null ; } @ SuppressWarnings ( "unchecked" ) PrimitiveInfo < T > info = ( PrimitiveInfo < T > ) PRIMITIVES . get ( type . getName ( ) ) ; if ( info != null ) { return info . defaultValue ; } return null ;
public class EPFImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . EPF__PF_NAME : setPFName ( PF_NAME_EDEFAULT ) ; return ; case AfplibPackage . EPF__TRIPLETS : getTriplets ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ;
public class AddParameterEvent { /** * Add parameter to testCase * @ param context which can be changed */ @ Override public void process ( TestCaseResult context ) { } }
context . getParameters ( ) . add ( new Parameter ( ) . withName ( getName ( ) ) . withValue ( getValue ( ) ) . withKind ( ParameterKind . valueOf ( getKind ( ) ) ) ) ;
public class IconDrawerItem { /** * Called to create this view * @ param inflater the layout inflater to inflate a layout from system * @ param container the container the layout is going to be placed in * @ return */ @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , int highli...
Context ctx = inflater . getContext ( ) ; View view = inflater . inflate ( R . layout . navdrawer_item , container , false ) ; ImageView iconView = ButterKnife . findById ( view , R . id . icon ) ; TextView titleView = ButterKnife . findById ( view , R . id . title ) ; TextView badgeView = ButterKnife . findById ( view...
public class FacesConfigFlowDefinitionFacesMethodCallTypeImpl { /** * Returns all < code > parameter < / code > elements * @ return list of < code > parameter < / code > */ public List < FacesConfigFlowDefinitionFlowCallParameterType < FacesConfigFlowDefinitionFacesMethodCallType < T > > > getAllParameter ( ) { } }
List < FacesConfigFlowDefinitionFlowCallParameterType < FacesConfigFlowDefinitionFacesMethodCallType < T > > > list = new ArrayList < FacesConfigFlowDefinitionFlowCallParameterType < FacesConfigFlowDefinitionFacesMethodCallType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "parameter" ) ; for ( Node node :...
public class ClusterState { /** * Identifies this server to the leader . */ CompletableFuture < Void > identify ( ) { } }
Member leader = context . getLeader ( ) ; if ( joinFuture != null && leader != null ) { if ( context . getLeader ( ) . equals ( member ( ) ) ) { if ( context . getState ( ) == CopycatServer . State . LEADER && ! ( ( LeaderState ) context . getServerState ( ) ) . configuring ( ) ) { if ( joinFuture != null ) joinFuture ...
public class CNFactory { /** * 读入分词模型 * @ param path 模型所在目录 , 结尾不带 " / " 。 * @ throws LoadModelException */ public static void loadSeg ( String path ) throws LoadModelException { } }
if ( seg == null ) { String file = path + segModel ; seg = new CWSTagger ( file ) ; seg . setEnFilter ( isEnFilter ) ; }
public class LottieValueAnimator { /** * Returns the current value of the animation from 0 to 1 regardless * of the animation speed , direction , or min and max frames . */ @ FloatRange ( from = 0f , to = 1f ) public float getAnimatedValueAbsolute ( ) { } }
if ( composition == null ) { return 0 ; } return ( frame - composition . getStartFrame ( ) ) / ( composition . getEndFrame ( ) - composition . getStartFrame ( ) ) ;
public class AbstractRasMethodAdapter { /** * Visit the method annotations looking at the supported RAS annotations . * The visitors are only used when a { @ code MethodInfo } model object was * not provided during construction . * @ param desc * the annotation descriptor * @ param visible * true if the ann...
AnnotationVisitor av = super . visitAnnotation ( desc , visible ) ; observedAnnotations . add ( Type . getType ( desc ) ) ; if ( desc . equals ( INJECTED_TRACE_TYPE . getDescriptor ( ) ) ) { injectedTraceAnnotationVisitor = new InjectedTraceAnnotationVisitor ( av , getClass ( ) ) ; av = injectedTraceAnnotationVisitor ;...
public class TerminologyDataMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TerminologyData terminologyData , ProtocolMarshaller protocolMarshaller ) { } }
if ( terminologyData == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( terminologyData . getFile ( ) , FILE_BINDING ) ; protocolMarshaller . marshall ( terminologyData . getFormat ( ) , FORMAT_BINDING ) ; } catch ( Exception e ) { throw new...
public class GifDecoder { /** * Reads GIF image from stream . * @ param is containing GIF file . * @ return read status code ( 0 = no errors ) . */ int read ( InputStream is , int contentLength ) { } }
if ( is != null ) { try { int capacity = ( contentLength > 0 ) ? ( contentLength + 4096 ) : 16384 ; ByteArrayOutputStream buffer = new ByteArrayOutputStream ( capacity ) ; int nRead ; byte [ ] data = new byte [ 16384 ] ; while ( ( nRead = is . read ( data , 0 , data . length ) ) != - 1 ) { buffer . write ( data , 0 , n...
public class HttpHeaders { /** * @ deprecated Use { @ link # getTimeMillis ( CharSequence , long ) } instead . * Returns the date header value with the specified header name . If * there are more than one header value for the specified header name , the * first value is returned . * @ return the header value or...
final String value = getHeader ( message , name ) ; Date date = DateFormatter . parseHttpDate ( value ) ; return date != null ? date : defaultValue ;
public class ShutdownHandler { /** * / * ( non - Javadoc ) * @ see org . jboss . as . cli . handlers . CommandHandlerWithHelp # doHandle ( org . jboss . as . cli . CommandContext ) */ @ Override protected void doHandle ( CommandContext ctx ) throws CommandLineException { } }
final ModelControllerClient client = ctx . getModelControllerClient ( ) ; if ( client == null ) { throw new CommandLineException ( "Connection is not available." ) ; } if ( embeddedServerRef != null && embeddedServerRef . get ( ) != null ) { embeddedServerRef . get ( ) . stop ( ) ; return ; } if ( ! ( client instanceof...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link BezierType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link BezierType } { @ code > } */ @ XmlEle...
return new JAXBElement < BezierType > ( _Bezier_QNAME , BezierType . class , null , value ) ;
public class ByteInput { /** * Inserts text at cursor position * @ param text * @ throws java . io . IOException */ @ Override public void insert ( CharSequence text ) throws IOException { } }
int ln = text . length ( ) ; if ( ln == 0 ) { return ; } if ( ln >= size - ( end - cursor ) ) { throw new IOException ( text + " doesn't fit in the buffer" ) ; } if ( cursor != end ) { makeRoom ( ln ) ; } for ( int ii = 0 ; ii < ln ; ii ++ ) { set ( ( cursor + ii ) , text . charAt ( ii ) ) ; } end += ln ;
public class PubSubOutputHandler { /** * @ return flag indicating whether this handler is owned by a Link */ public boolean isLink ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isLink" ) ; SibTr . exit ( tc , "isLink" , new Boolean ( _isLink ) ) ; } return _isLink ;
public class GenericsUtils { /** * May produce array class instead of generic array type . This is possible due to wildcard or parameterized type * shrinking . * @ param type type to repackage * @ param generics known generics * @ param countPreservedVariables true to replace { @ link ExplicitTypeVariable } too...
final Type componentType = resolveTypeVariables ( type . getGenericComponentType ( ) , generics , countPreservedVariables ) ; return ArrayTypeUtils . toArrayType ( componentType ) ;
public class CopierImplementation { /** * Creates iterations copies of the equivalent java code * < pre > * unsafe . putLong ( dest , destOffset , unsafe . getLong ( src ) ) ; * destOffset + = COPY _ STRIDE ; src + = COPY _ STRIDE * < / pre > * @ param iterations * @ throws NoSuchFieldException * @ throws...
final Method getLongMethod = Unsafe . class . getMethod ( "getLong" , long . class ) ; final Method putLongMethod = Unsafe . class . getMethod ( "putLong" , Object . class , long . class , long . class ) ; buildCopyStack ( stack , iterations , getLongMethod , putLongMethod , COPY_STRIDE ) ;
public class TileSheetsConfig { /** * Export the defined sheets . * @ param nodeSheets Sheets node ( must not be < code > null < / code > ) . * @ param sheets Sheets defined ( must not be < code > null < / code > ) . */ private static void exportSheets ( Xml nodeSheets , Collection < String > sheets ) { } }
for ( final String sheet : sheets ) { final Xml nodeSheet = nodeSheets . createChild ( NODE_TILE_SHEET ) ; nodeSheet . setText ( sheet ) ; }
public class SerializedCheckpointData { /** * Converts a list of checkpoints with elements into an array of SerializedCheckpointData . * @ param checkpoints The checkpoints to be converted into IdsCheckpointData . * @ param serializer The serializer to serialize the IDs . * @ param < T > The type of the ID . * ...
return fromDeque ( checkpoints , serializer , new DataOutputSerializer ( 128 ) ) ;
public class AbstractIterativeSolver { /** * Checks sizes of input data for { @ link # solve ( Matrix , Vector , Vector ) } . * Throws an exception if the sizes does not match . */ protected void checkSizes ( Matrix A , Vector b , Vector x ) { } }
if ( ! A . isSquare ( ) ) throw new IllegalArgumentException ( "!A.isSquare()" ) ; if ( b . size ( ) != A . numRows ( ) ) throw new IllegalArgumentException ( "b.size() != A.numRows()" ) ; if ( b . size ( ) != x . size ( ) ) throw new IllegalArgumentException ( "b.size() != x.size()" ) ;
public class JavaBackend { /** * Convenience method for frameworks that wish to load glue from methods explicitly ( possibly * found with a different mechanism than Cucumber ' s built - in classpath scanning ) . * @ param glue where stepdefs and hooks will be added . * @ param method a candidate method . * @ pa...
this . glue = glue ; methodScanner . scan ( this , method , glueCodeClass ) ;
public class ThreadUtil { /** * 创建新线程 , 非守护线程 , 正常优先级 , 线程组与当前线程的线程组一致 * @ param runnable { @ link Runnable } * @ param name 线程名 * @ return { @ link Thread } * @ since 3.1.2 */ public static Thread newThread ( Runnable runnable , String name ) { } }
final Thread t = newThread ( runnable , name , false ) ; if ( t . getPriority ( ) != Thread . NORM_PRIORITY ) { t . setPriority ( Thread . NORM_PRIORITY ) ; } return t ;
public class AxesRenderer { /** * Draw axes labels and names in the foreground . * @ param canvas */ public void drawInForeground ( Canvas canvas ) { } }
Axis axis = chart . getChartData ( ) . getAxisYLeft ( ) ; if ( null != axis ) { drawAxisLabelsAndName ( canvas , axis , LEFT ) ; } axis = chart . getChartData ( ) . getAxisYRight ( ) ; if ( null != axis ) { drawAxisLabelsAndName ( canvas , axis , RIGHT ) ; } axis = chart . getChartData ( ) . getAxisXBottom ( ) ; if ( n...
public class LazySocket { /** * Option 0. */ public void setTcpNoDelay ( boolean on ) throws SocketException { } }
if ( mSocket != null ) { mSocket . setTcpNoDelay ( on ) ; } else { setOption ( 0 , on ? Boolean . TRUE : Boolean . FALSE ) ; }
public class MultiVertexGeometryImpl { /** * \ internal Updates x , y intervals . */ public void _updateXYImpl ( boolean bExact ) { } }
m_envelope . setEmpty ( ) ; AttributeStreamOfDbl stream = ( AttributeStreamOfDbl ) m_vertexAttributes [ 0 ] ; Point2D pt = new Point2D ( ) ; for ( int i = 0 ; i < m_pointCount ; i ++ ) { stream . read ( 2 * i , pt ) ; m_envelope . merge ( pt ) ; }
public class MaterialPathAnimator { /** * Helper method to apply the path animator . * @ param source Source widget to apply the Path Animator * @ param target Target widget to apply the Path Animator */ public static void animate ( Widget source , final Widget target ) { } }
animate ( source . getElement ( ) , target . getElement ( ) ) ;
public class AbstractTracker { /** * Creates a new tracker that tracks services by generic filter * @ param filter generic filter to use for tracker * @ return a configured osgi service tracker */ protected final ServiceTracker < T , W > create ( String filter ) { } }
try { return new ServiceTracker < > ( bundleContext , bundleContext . createFilter ( filter ) , this ) ; } catch ( InvalidSyntaxException e ) { throw new IllegalArgumentException ( "Unexpected InvalidSyntaxException: " + e . getMessage ( ) ) ; }
public class ByteArray { /** * Add data at the current position . * @ param source * Source data . * @ param index * The index in the source data . Data from the index is copied . * @ param length * The length of data to copy . */ public void put ( byte [ ] source , int index , int length ) { } }
// If the buffer is small . if ( mBuffer . capacity ( ) < ( mLength + length ) ) { expandBuffer ( mLength + length + ADDITIONAL_BUFFER_SIZE ) ; } mBuffer . put ( source , index , length ) ; mLength += length ;
public class SARLRuntime { /** * Notifies registered listeners that the default SRE has changed . * @ param previous the previous SRE * @ param current the new current default SRE */ private static void fireDefaultSREChanged ( ISREInstall previous , ISREInstall current ) { } }
for ( final Object listener : SRE_LISTENERS . getListeners ( ) ) { ( ( ISREInstallChangedListener ) listener ) . defaultSREInstallChanged ( previous , current ) ; }
public class LazyIterate { /** * Creates a deferred negative filtering iterable for the specified iterable */ public static < T > LazyIterable < T > reject ( Iterable < T > iterable , Predicate < ? super T > predicate ) { } }
return new RejectIterable < T > ( iterable , predicate ) ;
public class VMCommandLine { /** * Analyse the command line to extract the options . * < p > The options will be recognized thanks to the { @ code optionDefinitions } . * Each entry of { @ code optionDefinitions } describes an option . They must * have one of the following formats : * < ul > * < li > { @ code...
"checkstyle:cyclomaticcomplexity" , "npathcomplexity" } ) public static void splitOptionsAndParameters ( String ... optionDefinitions ) { if ( analyzed ) { return ; } final List < String > params = new ArrayList < > ( ) ; final SortedMap < String , List < Object > > options = new TreeMap < > ( ) ; String opt ; // Analy...
public class GreedyAllocator { /** * Allocates a block from the given block store location . The location can be a specific location , * or { @ link BlockStoreLocation # anyTier ( ) } or { @ link BlockStoreLocation # anyDirInTier ( String ) } . * @ param sessionId the id of session to apply for the block allocation...
Preconditions . checkNotNull ( location , "location" ) ; if ( location . equals ( BlockStoreLocation . anyTier ( ) ) ) { // When any tier is ok , loop over all tier views and dir views , // and return a temp block meta from the first available dirview . for ( StorageTierView tierView : mManagerView . getTierViews ( ) )...
public class AuthorizationProcessManager { /** * Generate the params that will be used during the token request phase * @ param grantCode from the authorization phase * @ return Map with all the headers */ private HashMap < String , String > createTokenRequestParams ( String grantCode ) { } }
HashMap < String , String > params = new HashMap < > ( ) ; params . put ( "code" , grantCode ) ; params . put ( "client_id" , preferences . clientId . get ( ) ) ; params . put ( "grant_type" , "authorization_code" ) ; params . put ( "redirect_uri" , HTTP_LOCALHOST ) ; return params ;
public class UpdateIndex { /** * The main ( ) method * @ param argv */ public static void main ( String [ ] argv ) { } }
if ( argv . length == 0 ) { printUsage ( "" ) ; System . exit ( - 1 ) ; } String inputPathsString = null ; Path outputPath = null ; String shardsString = null ; String indexPath = null ; int numShards = - 1 ; int numMapTasks = - 1 ; Configuration conf = new Configuration ( ) ; String confPath = null ; // parse the comm...
import java . util . * ; class Main { /** * The function returns the list of strings from the provided list that contain a specific substring * Args : * input _ strings : A list of strings * sub : The target substring * Returns : * A list of strings from the input _ strings that contain the target substring ...
List < String > result = new ArrayList < > ( ) ; for ( String s : input_strings ) { if ( s . contains ( sub ) ) { result . add ( s ) ; } } return result ;
public class GetUsersSavedTracksRequest { /** * Get the songs from the current users " Your Music " library . * @ return A { @ link SavedTrack } paging . * @ throws IOException In case of networking issues . * @ throws SpotifyWebApiException The Web API returned an error further specified in this exception ' s ro...
return new SavedTrack . JsonUtil ( ) . createModelObjectPaging ( getJson ( ) ) ;
public class CollectionFileWriter { /** * Constructor . * @ param fileName the name of the file to write to * @ param entries the strings to write to the file ( one string per line ) * @ throws IllegalArgumentException if enabled but no file name defined */ public static void write ( String fileName , Collection ...
if ( fileName == null ) { throw new IllegalArgumentException ( "Must specify a file name to write to" ) ; } PrintWriter writer = null ; File file = new File ( fileName ) ; try { file . mkdirs ( ) ; if ( file . exists ( ) ) { file . delete ( ) ; } writer = new PrintWriter ( new FileWriter ( file ) , true ) ; for ( Objec...
public class A_CmsUI { /** * Returns the workplace settings . < p > * @ return the workplace settings */ public CmsWorkplaceSettings getWorkplaceSettings ( ) { } }
CmsWorkplaceSettings settings = ( CmsWorkplaceSettings ) getSession ( ) . getSession ( ) . getAttribute ( CmsWorkplaceManager . SESSION_WORKPLACE_SETTINGS ) ; if ( settings == null ) { settings = CmsLoginHelper . initSiteAndProject ( getCmsObject ( ) ) ; VaadinService . getCurrentRequest ( ) . getWrappedSession ( ) . s...
public class N1qlQuery { /** * Create a new query with named parameters . Note that the { @ link JsonObject } * should not be mutated until { @ link # n1ql ( ) } is called since it backs the * creation of the query string . * Named parameters have the form of ` $ name ` , where the ` name ` represents the unique ...
return new ParameterizedN1qlQuery ( statement , namedParams , null ) ;
public class JavacParser { /** * TypeArgumentsOpt = [ TypeArguments ] */ JCExpression typeArgumentsOpt ( JCExpression t ) { } }
if ( token . kind == LT && ( mode & TYPE ) != 0 && ( mode & NOPARAMS ) == 0 ) { mode = TYPE ; checkGenerics ( ) ; return typeArguments ( t , false ) ; } else { return t ; }
public class CommerceTierPriceEntryLocalServiceBaseImpl { /** * Returns all the commerce tier price entries matching the UUID and company . * @ param uuid the UUID of the commerce tier price entries * @ param companyId the primary key of the company * @ return the matching commerce tier price entries , or an empt...
return commerceTierPriceEntryPersistence . findByUuid_C ( uuid , companyId ) ;
public class PhraseCondition { /** * { @ inheritDoc } */ @ Override public Query query ( Schema schema ) { } }
if ( field == null || field . trim ( ) . isEmpty ( ) ) { throw new IllegalArgumentException ( "Field name required" ) ; } if ( values == null ) { throw new IllegalArgumentException ( "Field values required" ) ; } if ( slop == null ) { throw new IllegalArgumentException ( "Slop required" ) ; } if ( slop < 0 ) { throw ne...
public class RecordingGroup { /** * A comma - separated list that specifies the types of AWS resources for which AWS Config records configuration * changes ( for example , < code > AWS : : EC2 : : Instance < / code > or < code > AWS : : CloudTrail : : Trail < / code > ) . * Before you can set this option to < code ...
com . amazonaws . internal . SdkInternalList < String > resourceTypesCopy = new com . amazonaws . internal . SdkInternalList < String > ( resourceTypes . length ) ; for ( ResourceType value : resourceTypes ) { resourceTypesCopy . add ( value . toString ( ) ) ; } if ( getResourceTypes ( ) == null ) { setResourceTypes ( ...
public class OsiamConnector { /** * Provides a new and refreshed access token by getting the refresh token from the given access token . * @ param accessToken the access token to be refreshed * @ param scopes an optional parameter if the scope of the token should be changed . Otherwise the scopes of the * old tok...
return getAuthService ( ) . refreshAccessToken ( accessToken , scopes ) ;
public class AmazonApiGatewayV2Client { /** * Deletes a Deployment . * @ param deleteDeploymentRequest * @ return Result of the DeleteDeployment operation returned by the service . * @ throws NotFoundException * The resource specified in the request was not found . * @ throws TooManyRequestsException * The ...
request = beforeClientExecution ( request ) ; return executeDeleteDeployment ( request ) ;
public class ExprParser { /** * and : expr ' & & ' expr */ Expr and ( ) { } }
Expr expr = equalNotEqual ( ) ; for ( Tok tok = peek ( ) ; tok . sym == Sym . AND ; tok = peek ( ) ) { move ( ) ; expr = new Logic ( Sym . AND , expr , equalNotEqual ( ) , location ) ; } return expr ;
public class ConfigurationsInner { /** * The configuration object for the specified cluster . This API is not recommended and might be removed in the future . Please consider using List configurations API instead . * @ param resourceGroupName The name of the resource group . * @ param clusterName The name of the cl...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , clusterName , configurationName ) , serviceCallback ) ;
public class JSLocalConsumerPoint { /** * Explicity go and look in the CD ' s itemStream for messages and deliver them via the * asynch callback . The asynch lock MUST be held on entry to this method * Each call to this method will process at most _ maxBatchSize messages , then return * @ param isolatedRun if tru...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processQueuedMsgs" , new Object [ ] { this , Boolean . valueOf ( isolatedRun ) } ) ; JSLocalConsumerPoint actualConsumer = this ; boolean started = true ; _drainQueue = true ; long timeout = INFINITE_WAIT ; if ( isolatedRun...