signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CandlestickHandler { /** * { @ inheritDoc } */ @ Override public void handleChannelData ( final String action , final JSONArray payload ) throws BitfinexClientException { } }
if ( payload . isEmpty ( ) ) { return ; } // channel symbol trade : 1m : tLTCUSD final Set < BitfinexCandle > candlestickList = new TreeSet < > ( Comparator . comparing ( BitfinexCandle :: getTimestamp ) ) ; // Snapshots contain multiple Bars , Updates only one if ( payload . get ( 0 ) instanceof JSONArray ) { for ( int pos = 0 ; pos < payload . length ( ) ; pos ++ ) { final JSONArray parts = payload . getJSONArray ( pos ) ; BitfinexCandle candlestick = jsonToCandlestick ( parts ) ; candlestickList . add ( candlestick ) ; } } else { BitfinexCandle candlestick = jsonToCandlestick ( payload ) ; candlestickList . add ( candlestick ) ; } candlesConsumer . accept ( symbol , candlestickList ) ;
public class HttpConnection { /** * In return array , zeroth element is user and first is password . */ public static String [ ] extractBasicAuthCredentials ( String authHeader ) { } }
return new String ( Base64 . decodeBase64 ( authHeader . substring ( "Basic " . length ( ) ) . getBytes ( ) ) ) . split ( ":" ) ;
public class StringUtils { /** * < p > Find the Levenshtein distance between two Strings if it ' s less than or equal to a given * threshold . < / p > * < p > This is the number of changes needed to change one String into * another , where each change is a single character modification ( deletion , * insertion or substitution ) . < / p > * < p > This implementation follows from Algorithms on Strings , Trees and Sequences by Dan Gusfield * and Chas Emerick ' s implementation of the Levenshtein distance algorithm from * < a href = " http : / / www . merriampark . com / ld . htm " > http : / / www . merriampark . com / ld . htm < / a > < / p > * < pre > * StringUtils . getLevenshteinDistance ( null , * , * ) = IllegalArgumentException * StringUtils . getLevenshteinDistance ( * , null , * ) = IllegalArgumentException * StringUtils . getLevenshteinDistance ( * , * , - 1 ) = IllegalArgumentException * StringUtils . getLevenshteinDistance ( " " , " " , 0 ) = 0 * StringUtils . getLevenshteinDistance ( " aaapppp " , " " , 8 ) = 7 * StringUtils . getLevenshteinDistance ( " aaapppp " , " " , 7 ) = 7 * StringUtils . getLevenshteinDistance ( " aaapppp " , " " , 6 ) ) = - 1 * StringUtils . getLevenshteinDistance ( " elephant " , " hippo " , 7 ) = 7 * StringUtils . getLevenshteinDistance ( " elephant " , " hippo " , 6 ) = - 1 * StringUtils . getLevenshteinDistance ( " hippo " , " elephant " , 7 ) = 7 * StringUtils . getLevenshteinDistance ( " hippo " , " elephant " , 6 ) = - 1 * < / pre > * @ param s the first String , must not be null * @ param t the second String , must not be null * @ param threshold the target threshold , must not be negative * @ return result distance , or { @ code - 1 } if the distance would be greater than the threshold * @ throws IllegalArgumentException if either String input { @ code null } or negative threshold * @ deprecated as of 3.6 , use commons - text * < a href = " https : / / commons . apache . org / proper / commons - text / javadocs / api - release / org / apache / commons / text / similarity / LevenshteinDistance . html " > * LevenshteinDistance < / a > instead */ @ Deprecated public static int getLevenshteinDistance ( CharSequence s , CharSequence t , final int threshold ) { } }
if ( s == null || t == null ) { throw new IllegalArgumentException ( "Strings must not be null" ) ; } if ( threshold < 0 ) { throw new IllegalArgumentException ( "Threshold must not be negative" ) ; } /* This implementation only computes the distance if it ' s less than or equal to the threshold value , returning - 1 if it ' s greater . The advantage is performance : unbounded distance is O ( nm ) , but a bound of k allows us to reduce it to O ( km ) time by only computing a diagonal stripe of width 2k + 1 of the cost table . It is also possible to use this to compute the unbounded Levenshtein distance by starting the threshold at 1 and doubling each time until the distance is found ; this is O ( dm ) , where d is the distance . One subtlety comes from needing to ignore entries on the border of our stripe eg . We must ignore the entry to the left of the leftmost member We must ignore the entry above the rightmost member Another subtlety comes from our stripe running off the matrix if the strings aren ' t of the same size . Since string s is always swapped to be the shorter of the two , the stripe will always run off to the upper right instead of the lower left of the matrix . As a concrete example , suppose s is of length 5 , t is of length 7 , and our threshold is 1. In this case we ' re going to walk a stripe of length 3 . The matrix would look like so : 1 2 3 4 5 Note how the stripe leads off the table as there is no possible way to turn a string of length 5 into one of length 7 in edit distance of 1. Additionally , this implementation decreases memory usage by using two single - dimensional arrays and swapping them back and forth instead of allocating an entire n by m matrix . This requires a few minor changes , such as immediately returning when it ' s detected that the stripe has run off the matrix and initially filling the arrays with large values so that entries we don ' t compute are ignored . See Algorithms on Strings , Trees and Sequences by Dan Gusfield for some discussion . */ int n = s . length ( ) ; // length of s int m = t . length ( ) ; // length of t // if one string is empty , the edit distance is necessarily the length of the other if ( n == 0 ) { return m <= threshold ? m : - 1 ; } else if ( m == 0 ) { return n <= threshold ? n : - 1 ; } else if ( Math . abs ( n - m ) > threshold ) { // no need to calculate the distance if the length difference is greater than the threshold return - 1 ; } if ( n > m ) { // swap the two strings to consume less memory final CharSequence tmp = s ; s = t ; t = tmp ; n = m ; m = t . length ( ) ; } int p [ ] = new int [ n + 1 ] ; // ' previous ' cost array , horizontally int d [ ] = new int [ n + 1 ] ; // cost array , horizontally int _d [ ] ; // placeholder to assist in swapping p and d // fill in starting table values final int boundary = Math . min ( n , threshold ) + 1 ; for ( int i = 0 ; i < boundary ; i ++ ) { p [ i ] = i ; } // these fills ensure that the value above the rightmost entry of our // stripe will be ignored in following loop iterations Arrays . fill ( p , boundary , p . length , Integer . MAX_VALUE ) ; Arrays . fill ( d , Integer . MAX_VALUE ) ; // iterates through t for ( int j = 1 ; j <= m ; j ++ ) { final char t_j = t . charAt ( j - 1 ) ; // jth character of t d [ 0 ] = j ; // compute stripe indices , constrain to array size final int min = Math . max ( 1 , j - threshold ) ; final int max = j > Integer . MAX_VALUE - threshold ? n : Math . min ( n , j + threshold ) ; // the stripe may lead off of the table if s and t are of different sizes if ( min > max ) { return - 1 ; } // ignore entry left of leftmost if ( min > 1 ) { d [ min - 1 ] = Integer . MAX_VALUE ; } // iterates through [ min , max ] in s for ( int i = min ; i <= max ; i ++ ) { if ( s . charAt ( i - 1 ) == t_j ) { // diagonally left and up d [ i ] = p [ i - 1 ] ; } else { // 1 + minimum of cell to the left , to the top , diagonally left and up d [ i ] = 1 + Math . min ( Math . min ( d [ i - 1 ] , p [ i ] ) , p [ i - 1 ] ) ; } } // copy current distance counts to ' previous row ' distance counts _d = p ; p = d ; d = _d ; } // if p [ n ] is greater than the threshold , there ' s no guarantee on it being the correct // distance if ( p [ n ] <= threshold ) { return p [ n ] ; } return - 1 ;
public class BeanMappingConfigHelper { /** * 根据class查找对应的 { @ linkplain BeanMappingObject } */ public BeanMappingObject getBeanMappingObject ( Class src , Class target ) { } }
return getFromRepository ( src , target , this . repository ) ;
public class PayUtil { /** * ( MCH ) 生成支付APP请求数据 * @ param prepay _ id * 预支付订单号 * @ param appId * appId * @ param partnerid * 商户平台号 * @ param key * 商户支付密钥 * @ return app data */ public static MchPayApp generateMchAppData ( String prepay_id , String appId , String partnerid , String key ) { } }
Map < String , String > wx_map = new LinkedHashMap < String , String > ( ) ; wx_map . put ( "appid" , appId ) ; wx_map . put ( "partnerid" , partnerid ) ; wx_map . put ( "prepayid" , prepay_id ) ; wx_map . put ( "package" , "Sign=WXPay" ) ; wx_map . put ( "noncestr" , UUID . randomUUID ( ) . toString ( ) . replace ( "-" , "" ) ) ; wx_map . put ( "timestamp" , System . currentTimeMillis ( ) / 1000 + "" ) ; String sign = SignatureUtil . generateSign ( wx_map , key ) ; MchPayApp mchPayApp = new MchPayApp ( ) ; mchPayApp . setAppid ( appId ) ; mchPayApp . setPartnerid ( partnerid ) ; mchPayApp . setPrepayid ( prepay_id ) ; mchPayApp . setPackage_ ( wx_map . get ( "package" ) ) ; mchPayApp . setNoncestr ( wx_map . get ( "noncestr" ) ) ; mchPayApp . setTimestamp ( wx_map . get ( "timestamp" ) ) ; mchPayApp . setSign ( sign ) ; return mchPayApp ;
public class SybaseCleaningScipts { /** * { @ inheritDoc } */ protected Collection < String > getOldTablesRenamingScripts ( ) throws DBCleanException { } }
Collection < String > scripts = new ArrayList < String > ( ) ; scripts . add ( "sp_rename " + valueTableName + "_OLD, " + valueTableName ) ; scripts . add ( "sp_rename " + itemTableName + "_OLD, " + itemTableName ) ; scripts . add ( "sp_rename " + refTableName + "_OLD, " + refTableName ) ; scripts . add ( "sp_rename JCR_FK_" + valueTableSuffix + "_PROPERTY_OLD, JCR_FK_" + valueTableSuffix + "_PROPERTY" ) ; scripts . add ( "sp_rename JCR_FK_" + itemTableSuffix + "_PARENT_OLD, JCR_FK_" + itemTableSuffix + "_PARENT" ) ; return scripts ;
public class Types { /** * Returns a type where { @ code rawType } is parameterized by * { @ code arguments } and is owned by { @ code ownerType } . */ static ParameterizedType newParameterizedTypeWithOwner ( @ Nullable Type ownerType , Class < ? > rawType , Type ... arguments ) { } }
if ( ownerType == null ) { return newParameterizedType ( rawType , arguments ) ; } // ParameterizedTypeImpl constructor already checks , but we want to throw NPE before IAE if ( arguments == null ) { throw new NullPointerException ( ) ; } if ( rawType . getEnclosingClass ( ) == null ) { throw new IllegalArgumentException ( String . format ( "Owner type for unenclosed %s" , rawType ) ) ; } return new ParameterizedTypeImpl ( ownerType , rawType , arguments ) ;
public class BudgetPerformanceHistory { /** * A list of amounts of cost or usage that you created budgets for , compared to your actual costs or usage . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setBudgetedAndActualAmountsList ( java . util . Collection ) } or * { @ link # withBudgetedAndActualAmountsList ( java . util . Collection ) } if you want to override the existing values . * @ param budgetedAndActualAmountsList * A list of amounts of cost or usage that you created budgets for , compared to your actual costs or usage . * @ return Returns a reference to this object so that method calls can be chained together . */ public BudgetPerformanceHistory withBudgetedAndActualAmountsList ( BudgetedAndActualAmounts ... budgetedAndActualAmountsList ) { } }
if ( this . budgetedAndActualAmountsList == null ) { setBudgetedAndActualAmountsList ( new java . util . ArrayList < BudgetedAndActualAmounts > ( budgetedAndActualAmountsList . length ) ) ; } for ( BudgetedAndActualAmounts ele : budgetedAndActualAmountsList ) { this . budgetedAndActualAmountsList . add ( ele ) ; } return this ;
public class CompositeELResolver { /** * Returns information about the set of variables or properties that * can be resolved for the given < code > base < / code > object . One use for * this method is to assist tools in auto - completion . The results are * collected from all component resolvers . * < p > The < code > propertyResolved < / code > property of the * < code > ELContext < / code > is not relevant to this method . * The results of all < code > ELResolver < / code > s are concatenated . < / p > * < p > The < code > Iterator < / code > returned is an iterator over the * collection of < code > FeatureDescriptor < / code > objects returned by * the iterators returned by each component resolver ' s * < code > getFeatureDescriptors < / code > method . If < code > null < / code > is * returned by a resolver , it is skipped . < / p > * @ param context The context of this evaluation . * @ param base The base object whose set of valid properties is to * be enumerated , or < code > null < / code > to enumerate the set of * top - level variables that this resolver can evaluate . * @ return An < code > Iterator < / code > containing zero or more ( possibly * infinitely more ) < code > FeatureDescriptor < / code > objects , or * < code > null < / code > if this resolver does not handle the given * < code > base < / code > object or that the results are too complex to * represent with this method */ public Iterator < FeatureDescriptor > getFeatureDescriptors ( ELContext context , Object base ) { } }
return new CompositeIterator ( elResolvers , size , context , base ) ;
public class SystemUtil { /** * Formats a file size given in byte to something human readable . * @ param _ bytes size in bytes * @ param _ use1000BytesPerMb use 1000 bytes per MByte instead of 1024 * @ return String */ public static String formatBytesHumanReadable ( long _bytes , boolean _use1000BytesPerMb ) { } }
int unit = _use1000BytesPerMb ? 1000 : 1024 ; if ( _bytes < unit ) { return _bytes + " B" ; } int exp = ( int ) ( Math . log ( _bytes ) / Math . log ( unit ) ) ; String pre = ( _use1000BytesPerMb ? "kMGTPE" : "KMGTPE" ) . charAt ( exp - 1 ) + ( _use1000BytesPerMb ? "" : "i" ) ; return String . format ( "%.1f %sB" , _bytes / Math . pow ( unit , exp ) , pre ) ;
public class SpringQueryParamBuilder { /** * Available properties that can be overridden : name , description , required , * allowedvalues , format , defaultvalue . Name is overridden only if it ' s empty * in the apiParamDoc argument . Description , format and allowedvalues are * copied in any case Default value and required are not overridden : in any * case they are coming from the default values of @ RequestParam * @ param apiQueryParam * @ param apiParamDoc */ private static void mergeApiQueryParamDoc ( ApiQueryParam apiQueryParam , ApiParamDoc apiParamDoc ) { } }
if ( apiQueryParam != null ) { if ( apiParamDoc . getName ( ) . trim ( ) . isEmpty ( ) ) { apiParamDoc . setName ( apiQueryParam . name ( ) ) ; } apiParamDoc . setDescription ( apiQueryParam . description ( ) ) ; apiParamDoc . setAllowedvalues ( apiQueryParam . allowedvalues ( ) ) ; apiParamDoc . setFormat ( apiQueryParam . format ( ) ) ; }
public class StackTrace { /** * Get { @ link StackTraceElement } for native method . */ public static StackTraceElement nativeElement ( String declaringClass , String methodName ) { } }
return new StackTraceElement ( declaringClass , methodName , null , - 2 ) ;
public class Query { /** * Converts the provided filter tree to a list of paths ( array of filters ) . Each of the paths in the result * represent 1 branch from the tree from root to some leaf . * @ param query the tree of filters * @ return the list of paths */ public static Filter [ ] [ ] filters ( Query query ) { } }
List < List < Filter > > paths = new ArrayList < > ( ) ; List < Filter [ ] > workingPath = new ArrayList < > ( ) ; addPathsToLeaves ( query , workingPath , paths ) ; Filter [ ] [ ] ret = new Filter [ paths . size ( ) ] [ ] ; Arrays . setAll ( ret , ( i ) -> paths . get ( i ) . toArray ( new Filter [ paths . get ( i ) . size ( ) ] ) ) ; return ret ;
public class KeySlice { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case KEY : return isSetKey ( ) ; case COLUMNS : return isSetColumns ( ) ; } throw new IllegalStateException ( ) ;
public class LevelHelper { /** * Compare on { @ link java . util . logging . Level # intValue ( ) } */ public static Comparator < Level > comparator ( ) { } }
return new Comparator < Level > ( ) { @ Override public int compare ( Level l1 , Level l2 ) { return Integer . compare ( l1 . intValue ( ) , l2 . intValue ( ) ) ; } } ;
public class SDLoss { /** * L2 loss : 1/2 * sum ( x ^ 2) * @ param name Name of the output variable * @ param var Variable to calculate L2 loss of * @ return L2 loss */ public SDVariable l2Loss ( String name , @ NonNull SDVariable var ) { } }
validateNumerical ( "l2 loss" , var ) ; SDVariable result = f ( ) . lossL2 ( var ) ; result = updateVariableNameAndReference ( result , name ) ; result . markAsLoss ( ) ; return result ;
public class MongoDeepJobConfig { /** * { @ inheritDoc } */ @ Override public MongoDeepJobConfig < T > initialize ( ) { } }
validate ( ) ; super . initialize ( ) ; configHadoop = new JobConf ( ) ; configHadoop = new Configuration ( ) ; StringBuilder connection = new StringBuilder ( ) ; connection . append ( "mongodb" ) . append ( ":" ) . append ( "//" ) ; if ( username != null && password != null ) { connection . append ( username ) . append ( ":" ) . append ( password ) . append ( "@" ) ; } boolean firstHost = true ; for ( String hostName : host ) { if ( ! firstHost ) { connection . append ( "," ) ; } connection . append ( hostName ) ; firstHost = false ; } connection . append ( "/" ) . append ( catalog ) . append ( "." ) . append ( table ) ; StringBuilder options = new StringBuilder ( ) ; boolean asignado = false ; if ( readPreference != null ) { asignado = true ; options . append ( "?readPreference=" ) . append ( readPreference ) ; } if ( replicaSet != null ) { if ( asignado ) { options . append ( "&" ) ; } else { options . append ( "?" ) ; } options . append ( "replicaSet=" ) . append ( replicaSet ) ; } connection . append ( options ) ; configHadoop . set ( MongoConfigUtil . INPUT_URI , connection . toString ( ) ) ; configHadoop . set ( MongoConfigUtil . OUTPUT_URI , connection . toString ( ) ) ; configHadoop . set ( MongoConfigUtil . INPUT_SPLIT_SIZE , String . valueOf ( splitSize ) ) ; if ( inputKey != null ) { configHadoop . set ( MongoConfigUtil . INPUT_KEY , inputKey ) ; } configHadoop . set ( MongoConfigUtil . SPLITS_USE_SHARDS , String . valueOf ( useShards ) ) ; configHadoop . set ( MongoConfigUtil . CREATE_INPUT_SPLITS , String . valueOf ( createInputSplit ) ) ; configHadoop . set ( MongoConfigUtil . SPLITS_USE_CHUNKS , String . valueOf ( splitsUseChunks ) ) ; if ( query != null ) { configHadoop . set ( MongoConfigUtil . INPUT_QUERY , query . toString ( ) ) ; } if ( fields != null ) { configHadoop . set ( MongoConfigUtil . INPUT_FIELDS , fields . toString ( ) ) ; } if ( sort != null ) { configHadoop . set ( MongoConfigUtil . INPUT_SORT , sort ) ; } if ( username != null && password != null ) { configHadoop . set ( MongoConfigUtil . AUTH_URI , connection . toString ( ) ) ; } if ( customConfiguration != null ) { Set < Map . Entry < String , Serializable > > set = customConfiguration . entrySet ( ) ; Iterator < Map . Entry < String , Serializable > > iterator = set . iterator ( ) ; while ( iterator . hasNext ( ) ) { Map . Entry < String , Serializable > entry = iterator . next ( ) ; configHadoop . set ( entry . getKey ( ) , entry . getValue ( ) . toString ( ) ) ; } } return this ;
public class SubmissionDocumentRepositoryMongoImpl { /** * { @ inheritDoc } */ @ Override public final SubmissionDocument findByRootAndString ( final RootDocument rootDocument , final String string ) { } }
final SubmissionDocument submissionDocument = findByFileAndString ( rootDocument . getFilename ( ) , string ) ; if ( submissionDocument == null ) { return null ; } final Submission submission = submissionDocument . getGedObject ( ) ; submission . setParent ( rootDocument . getGedObject ( ) ) ; return submissionDocument ;
public class WebUtils { /** * Gets credential from the context . * @ param context the context * @ return the credential , or null if it cant be found in the context or if it has no id . */ public static Credential getCredential ( final RequestContext context ) { } }
val cFromRequest = ( Credential ) context . getRequestScope ( ) . get ( PARAMETER_CREDENTIAL ) ; val cFromFlow = ( Credential ) context . getFlowScope ( ) . get ( PARAMETER_CREDENTIAL ) ; val cFromConversation = ( Credential ) context . getConversationScope ( ) . get ( PARAMETER_CREDENTIAL ) ; var credential = cFromRequest ; if ( credential == null || StringUtils . isBlank ( credential . getId ( ) ) ) { credential = cFromFlow ; } if ( credential == null || StringUtils . isBlank ( credential . getId ( ) ) ) { credential = cFromConversation ; if ( credential != null && ! StringUtils . isBlank ( credential . getId ( ) ) ) { context . getFlowScope ( ) . put ( PARAMETER_CREDENTIAL , credential ) ; } } if ( credential == null ) { val session = context . getFlowExecutionContext ( ) . getActiveSession ( ) ; credential = session . getScope ( ) . get ( PARAMETER_CREDENTIAL , Credential . class ) ; } if ( credential != null && StringUtils . isBlank ( credential . getId ( ) ) ) { return null ; } return credential ;
public class RecurlyJs { /** * Get Recurly . js Signature with extra parameter strings in the format " [ param ] = [ value ] " * See spec here : https : / / docs . recurly . com / deprecated - api - docs / recurlyjs / signatures * Returns a signature key for use with recurly . js BuildSubscriptionForm . * @ param privateJsKey recurly . js private key * @ param unixTime Unix timestamp , i . e . elapsed seconds since Midnight , Jan 1st 1970 , UTC * @ param nonce A randomly generated string ( number used only once ) * @ param extraParams extra parameters to include in the signature * @ return signature string on success , null otherwise */ public static String getRecurlySignature ( String privateJsKey , Long unixTime , String nonce , List < String > extraParams ) { } }
// Mandatory parameters shared by all signatures ( as per spec ) extraParams = ( extraParams == null ) ? new ArrayList < String > ( ) : extraParams ; extraParams . add ( String . format ( PARAMETER_FORMAT , TIMESTAMP_PARAMETER , unixTime ) ) ; extraParams . add ( String . format ( PARAMETER_FORMAT , NONCE_PARAMETER , nonce ) ) ; String protectedParams = Joiner . on ( PARAMETER_SEPARATOR ) . join ( extraParams ) ; return generateRecurlyHMAC ( privateJsKey , protectedParams ) + "|" + protectedParams ;
public class LabelServiceLocator { /** * For the given interface , get the stub implementation . * If this service has no port for the given interface , * then ServiceException is thrown . */ public java . rmi . Remote getPort ( Class serviceEndpointInterface ) throws javax . xml . rpc . ServiceException { } }
try { if ( com . google . api . ads . admanager . axis . v201805 . LabelServiceInterface . class . isAssignableFrom ( serviceEndpointInterface ) ) { com . google . api . ads . admanager . axis . v201805 . LabelServiceSoapBindingStub _stub = new com . google . api . ads . admanager . axis . v201805 . LabelServiceSoapBindingStub ( new java . net . URL ( LabelServiceInterfacePort_address ) , this ) ; _stub . setPortName ( getLabelServiceInterfacePortWSDDServiceName ( ) ) ; return _stub ; } } catch ( java . lang . Throwable t ) { throw new javax . xml . rpc . ServiceException ( t ) ; } throw new javax . xml . rpc . ServiceException ( "There is no stub implementation for the interface: " + ( serviceEndpointInterface == null ? "null" : serviceEndpointInterface . getName ( ) ) ) ;
public class Handler { /** * On the first step of the request , match the request against the configured * paths . If the match is successful , store the chain id within the exchange . * Otherwise return false . * @ param httpServerExchange * The current requests server exchange . * @ return true if a handler has been defined for the given path . */ public static boolean start ( HttpServerExchange httpServerExchange ) { } }
// Get the matcher corresponding to the current request type . PathTemplateMatcher < String > pathTemplateMatcher = methodToMatcherMap . get ( httpServerExchange . getRequestMethod ( ) ) ; if ( pathTemplateMatcher != null ) { // Match the current request path to the configured paths . PathTemplateMatcher . PathMatchResult < String > result = pathTemplateMatcher . match ( httpServerExchange . getRequestPath ( ) ) ; if ( result != null ) { // Found a match , configure and return true ; // Add path variables to query params . httpServerExchange . putAttachment ( ATTACHMENT_KEY , new io . undertow . util . PathTemplateMatch ( result . getMatchedTemplate ( ) , result . getParameters ( ) ) ) ; for ( Map . Entry < String , String > entry : result . getParameters ( ) . entrySet ( ) ) { // the values shouldn ' t be added to query param . but this is left as it was to keep backward compatability httpServerExchange . addQueryParam ( entry . getKey ( ) , entry . getValue ( ) ) ; // put values in path param map httpServerExchange . addPathParam ( entry . getKey ( ) , entry . getValue ( ) ) ; } String id = result . getValue ( ) ; httpServerExchange . putAttachment ( CHAIN_ID , id ) ; httpServerExchange . putAttachment ( CHAIN_SEQ , 0 ) ; return true ; } } return false ;
public class ReadOnlyStyledDocumentBuilder { /** * Adds multiple paragraphs to the list , using the { @ link # defaultParagraphStyle } for each paragraph . For * more configuration on each paragraph ' s paragraph style , use { @ link # addParagraphs0 ( List , StyleSpans ) } * @ param listOfSegLists each item is the list of segments for a single paragraph * @ param entireDocumentStyleSpans style spans for the entire document . It ' s length should be equal to the length * of all the segments ' length combined */ public ReadOnlyStyledDocumentBuilder < PS , SEG , S > addParagraphs ( List < List < SEG > > listOfSegLists , StyleSpans < S > entireDocumentStyleSpans ) { } }
return addParagraphList ( listOfSegLists , entireDocumentStyleSpans , ignore -> null , Function . identity ( ) ) ;
public class SocketSystem { /** * Returns the InetAddresses for the local machine . */ public ArrayList < InetAddress > getLocalAddresses ( ) { } }
synchronized ( _addressCache ) { ArrayList < InetAddress > localAddresses = _addressCache . get ( "addresses" ) ; if ( localAddresses == null ) { localAddresses = new ArrayList < InetAddress > ( ) ; try { for ( NetworkInterfaceBase iface : getNetworkInterfaces ( ) ) { for ( InetAddress addr : iface . getInetAddresses ( ) ) { localAddresses . add ( addr ) ; } } Collections . sort ( localAddresses , new LocalIpCompare ( ) ) ; _addressCache . put ( "addresses" , localAddresses ) ; } catch ( Exception e ) { log . log ( Level . WARNING , e . toString ( ) , e ) ; } finally { _addressCache . put ( "addresses" , localAddresses ) ; } } return new ArrayList < > ( localAddresses ) ; }
public class AmazonCognitoSyncClient { /** * Gets usage details ( for example , data storage ) about a particular identity pool . * This API can only be called with developer credentials . You cannot call this API with the temporary user * credentials provided by Cognito Identity . * @ param describeIdentityPoolUsageRequest * A request for usage information about the identity pool . * @ return Result of the DescribeIdentityPoolUsage operation returned by the service . * @ throws NotAuthorizedException * Thrown when a user is not authorized to access the requested resource . * @ throws InvalidParameterException * Thrown when a request parameter does not comply with the associated constraints . * @ throws ResourceNotFoundException * Thrown if the resource doesn ' t exist . * @ throws InternalErrorException * Indicates an internal service error . * @ throws TooManyRequestsException * Thrown if the request is throttled . * @ sample AmazonCognitoSync . DescribeIdentityPoolUsage * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cognito - sync - 2014-06-30 / DescribeIdentityPoolUsage " * target = " _ top " > AWS API Documentation < / a > */ @ Override public DescribeIdentityPoolUsageResult describeIdentityPoolUsage ( DescribeIdentityPoolUsageRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeIdentityPoolUsage ( request ) ;
public class JmxMeasurementConfig { /** * Fill in { @ code ms } with measurements extracted from { @ code data } . */ void measure ( Registry registry , JmxData data , List < Measurement > ms ) { } }
Map < String , String > tags = tagMappings . entrySet ( ) . stream ( ) . collect ( Collectors . toMap ( Map . Entry :: getKey , e -> MappingExpr . substitute ( e . getValue ( ) , data . getStringAttrs ( ) ) ) ) ; Id id = registry . createId ( MappingExpr . substitute ( nameMapping , data . getStringAttrs ( ) ) ) . withTags ( tags ) ; Map < String , Number > numberAttrs = new HashMap < > ( data . getNumberAttrs ( ) ) ; JmxData previous = previousData . put ( data . getName ( ) , data ) ; if ( previous != null ) { previous . getNumberAttrs ( ) . forEach ( ( key , value ) -> numberAttrs . put ( "previous:" + key , value ) ) ; } Double v = MappingExpr . eval ( valueMapping , numberAttrs ) ; if ( v != null && ! v . isNaN ( ) ) { if ( counter ) { updateCounter ( registry , id , v . longValue ( ) ) ; } else { ms . add ( new Measurement ( id , registry . clock ( ) . wallTime ( ) , v ) ) ; } }
public class MathUtil { /** * 排列选择 ( 从列表中选择n个排列 ) * @ param datas 待选列表 * @ param m 选择个数 * @ return 所有排列列表 */ public static List < String [ ] > arrangementSelect ( String [ ] datas , int m ) { } }
return new Arrangement ( datas ) . select ( m ) ;
public class VdmContentOutlinePage { /** * @ see ISelectionProvider # removeSelectionChangedListener ( ISelectionChangedListener ) */ public void removeSelectionChangedListener ( ISelectionChangedListener listener ) { } }
if ( fOutlineViewer != null ) { fOutlineViewer . removeSelectionChangedListener ( listener ) ; } else { fSelectionChangedListeners . remove ( listener ) ; }
public class PointDrawController { /** * Private methods : */ private void createTempPoint ( ) { } }
tempPoint = new GfxGeometry ( "PointDrawController.updatePoint" ) ; tempPoint . setStyle ( drawStyle ) ; tempPoint . setSymbolInfo ( symbolStyle ) ; Coordinate coords = getTransformer ( ) . worldToPan ( geometry . getCoordinate ( ) ) ; Point point = ( Point ) geometry . getGeometryFactory ( ) . createPoint ( coords ) ; tempPoint . setGeometry ( point ) ; mapWidget . render ( tempPoint , RenderGroup . VECTOR , RenderStatus . ALL ) ;
public class CPOptionUtil { /** * Returns the first cp option in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching cp option , or < code > null < / code > if a matching cp option could not be found */ public static CPOption fetchByUuid_First ( String uuid , OrderByComparator < CPOption > orderByComparator ) { } }
return getPersistence ( ) . fetchByUuid_First ( uuid , orderByComparator ) ;
public class CmsXmlContent { /** * Returns the XML root element node for the given locale . < p > * @ param locale the locale to get the root element for * @ return the XML root element node for the given locale * @ throws CmsRuntimeException if no language element is found in the document */ public Element getLocaleNode ( Locale locale ) throws CmsRuntimeException { } }
String localeStr = locale . toString ( ) ; Iterator < Element > i = CmsXmlGenericWrapper . elementIterator ( m_document . getRootElement ( ) ) ; while ( i . hasNext ( ) ) { Element element = i . next ( ) ; if ( localeStr . equals ( element . attributeValue ( CmsXmlContentDefinition . XSD_ATTRIBUTE_VALUE_LANGUAGE ) ) ) { // language element found , return it return element ; } } // language element was not found throw new CmsRuntimeException ( Messages . get ( ) . container ( Messages . ERR_XMLCONTENT_MISSING_LOCALE_1 , locale ) ) ;
public class BaseFont { /** * Converts a < CODE > char < / CODE > to a < / CODE > byte < / CODE > array according * to the font ' s encoding . * @ param char1 the < CODE > char < / CODE > to be converted * @ return an array of < CODE > byte < / CODE > representing the conversion according to the font ' s encoding */ byte [ ] convertToBytes ( int char1 ) { } }
if ( directTextToByte ) return PdfEncodings . convertToBytes ( ( char ) char1 , null ) ; if ( specialMap != null ) { if ( specialMap . containsKey ( char1 ) ) return new byte [ ] { ( byte ) specialMap . get ( char1 ) } ; else return new byte [ 0 ] ; } return PdfEncodings . convertToBytes ( ( char ) char1 , encoding ) ;
public class EscapedFunctions2 { /** * dayofmonth translation * @ param buf The buffer to append into * @ param parsedArgs arguments * @ throws SQLException if something wrong happens */ public static void sqldayofmonth ( StringBuilder buf , List < ? extends CharSequence > parsedArgs ) throws SQLException { } }
singleArgumentFunctionCall ( buf , "extract(day from " , "dayofmonth" , parsedArgs ) ;
public class JschNodeExecutor { /** * create password source * @ param nodeAuthentication auth * @ param prefix prefix * @ return source * @ throws IOException if password loading from storage fails */ private PasswordSource passwordSourceWithPrefix ( final NodeSSHConnectionInfo nodeAuthentication , final String prefix ) throws IOException { } }
if ( null != nodeAuthentication . getSudoPasswordStoragePath ( prefix ) ) { return new BasicSource ( nodeAuthentication . getSudoPasswordStorageData ( prefix ) ) ; } else { return new BasicSource ( nodeAuthentication . getSudoPassword ( prefix ) ) ; }
public class GatewayReplyBase { /** * / * ( non - Javadoc ) * @ see com . caucho . ramp . remote . GatewayReply # queryError ( com . caucho . ramp . spi . RampHeaders , long , java . lang . Throwable ) */ @ Override public void queryFail ( HeadersAmp headers , long qid , Throwable exn ) { } }
try ( OutboxAmp outbox = OutboxAmp . currentOrCreate ( _serviceRef . services ( ) ) ) { _serviceRef . offer ( new QueryErrorMessage ( outbox , _serviceRef , headers , _serviceRef . stub ( ) , qid , exn ) ) ; }
public class OrtcClient { /** * Set heartbeat fails . Defines how many times can the client fail the heartbeat . * @ param newHeartbeatTime */ public void setHeartbeatTime ( int newHeartbeatTime ) { } }
if ( newHeartbeatTime > 0 ) { if ( newHeartbeatTime > heartbeatMaxTime || newHeartbeatTime < heartbeatMinTime ) { raiseOrtcEvent ( EventEnum . OnException , this , new Exception ( "Heartbeat time is out of limits - Min: " + heartbeatMinTime + " | Max: " + heartbeatMaxTime ) ) ; } else { heartbeatTime = newHeartbeatTime ; } } else { raiseOrtcEvent ( EventEnum . OnException , this , new Exception ( "Invalid heartbeat time " + newHeartbeatTime ) ) ; }
public class VirtualMachineScaleSetsInner { /** * Deletes virtual machines in a VM scale set . * @ param resourceGroupName The name of the resource group . * @ param vmScaleSetName The name of the VM scale set . * @ param instanceIds The virtual machine scale set instance ids . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the OperationStatusResponseInner object if successful . */ public OperationStatusResponseInner beginDeleteInstances ( String resourceGroupName , String vmScaleSetName , List < String > instanceIds ) { } }
return beginDeleteInstancesWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , instanceIds ) . toBlocking ( ) . single ( ) . body ( ) ;
public class TitlePaneIconifyButtonPainter { /** * Paint the background mouse - over state . * @ param g the Graphics2D context to paint with . * @ param c the component . * @ param width the width of the component . * @ param height the height of the component . */ private void paintBackgroundHover ( Graphics2D g , JComponent c , int width , int height ) { } }
paintBackground ( g , c , width , height , hover ) ;
public class CircularList { /** * Add an element to the list , overwriting last added element when * list ' s capacity is reached * @ param newElement Element to add * @ return Always true */ @ Override public boolean add ( T newElement ) { } }
elements [ lastIndex ] = newElement ; lastIndex = incrementIndex ( lastIndex , 0 ) ; if ( isEmpty ( ) ) { // First element firstIndex = 0 ; size = 1 ; } else if ( isFull ( ) ) { // Reuse space firstIndex = lastIndex ; } else { size = incrementIndex ( size , elements . length ) ; } return true ;
public class AbstractJacksonBackedStringSerializer { /** * Read object from json . * @ param jsonString the json string * @ return the type */ protected T readObjectFromString ( final String jsonString ) { } }
try { LOGGER . trace ( "Attempting to consume [{}]" , jsonString ) ; return this . objectMapper . readValue ( jsonString , getTypeToSerialize ( ) ) ; } catch ( final Exception e ) { LOGGER . error ( "Cannot read/parse [{}] to deserialize into type [{}]. This may be caused " + "in the absence of a configuration/support module that knows how to interpret the fragment, " + "specially if the fragment describes a CAS registered service definition. " + "Internal parsing error is [{}]" , DigestUtils . abbreviate ( jsonString ) , getTypeToSerialize ( ) , e . getMessage ( ) ) ; LOGGER . debug ( e . getMessage ( ) , e ) ; } return null ;
public class Convert { /** * Creates a DOM Node from a TraX Source . * < p > If the source is a { @ link DOMSource } its Node will be * returned , otherwise this delegates to { @ link # toDocument } . < / p > */ public static Node toNode ( Source s , DocumentBuilderFactory factory ) { } }
Node n = tryExtractNodeFromDOMSource ( s ) ; return n != null ? n : toDocument ( s , factory ) ;
public class AbstractClientOptionsBuilder { /** * Adds the specified HTTP - level { @ code decorator } . * @ param decorator the { @ link DecoratingClientFunction } that intercepts an invocation * @ param < I > the { @ link Request } type of the { @ link Client } being decorated * @ param < O > the { @ link Response } type of the { @ link Client } being decorated */ public < I extends HttpRequest , O extends HttpResponse > B decorator ( DecoratingClientFunction < I , O > decorator ) { } }
decoration . add ( decorator ) ; return self ( ) ;
public class Client { public static void call ( ) { } }
// 客户端获取远程接口实现 ExampleService es = new DefaultIkasoaFactory ( ) . getIkasoaClient ( ExampleService . class , "localhost" , 9999 ) ; // 客户端输出结果 System . out . println ( es . findVO ( 1 ) . getString ( ) ) ;
public class Reflection { /** * Get super class ' s generic types . eg . A extends B ( T1 , T2 ) will return [ T1 , T2 ] < br > * If no generic type is defined for the super class , then null is returned . */ public static Type [ ] getSupperGenericType ( Class clazz ) { } }
ParameterizedType parameterizedType ; if ( clazz . getGenericInterfaces ( ) . length > 0 ) { // 父类是interface , the super type is an interface . if ( clazz . getGenericInterfaces ( ) [ 0 ] instanceof ParameterizedType ) { /* 注意 : 有多个父接口时 , 这里是取第一个父接口 Attention : if multiple parents are defined , we only get the first one . */ parameterizedType = ( ParameterizedType ) clazz . getGenericInterfaces ( ) [ 0 ] ; } else { return null ; } } else { // 父类是class , the super type is a class . if ( clazz . getGenericSuperclass ( ) instanceof ParameterizedType ) { parameterizedType = ( ParameterizedType ) clazz . getGenericSuperclass ( ) ; } else { return null ; } } return parameterizedType . getActualTypeArguments ( ) ;
public class NetworkServiceDescriptorAgent { /** * Return a List with all the VNFDependencies that are contained in a specific * NetworkServiceDescriptor . * @ param idNSD the ID of the NetworkServiceDescriptor * @ return the List of VNFDependencies * @ throws SDKException if the request fails */ @ Help ( help = "Get all the VirtualNetworkFunctionDescriptor Dependency of a NetworkServiceDescriptor with specific id" ) public List < VNFDependency > getVNFDependencies ( final String idNSD ) throws SDKException { } }
String url = idNSD + "/vnfdependencies" ; return Arrays . asList ( ( VNFDependency [ ] ) requestGetAll ( url , VNFDependency . class ) ) ;
public class ManagementClient { /** * Updates an existing queue . * @ param queueDescription - A { @ link QueueDescription } object describing the attributes with which the queue will be updated . * @ return { @ link QueueDescription } of the updated queue . * @ throws MessagingEntityNotFoundException - Described entity was not found . * @ throws IllegalArgumentException - descriptor is null . * @ throws TimeoutException - The operation times out . The timeout period is initiated through ClientSettings . operationTimeout * @ throws AuthorizationFailedException - No sufficient permission to perform this operation . Please check ClientSettings . tokenProvider has correct details . * @ throws ServerBusyException - The server is busy . You should wait before you retry the operation . * @ throws ServiceBusException - An internal error or an unexpected exception occurred . * @ throws QuotaExceededException - Either the specified size in the description is not supported or the maximum allowed quota has been reached . * @ throws InterruptedException if the current thread was interrupted */ public QueueDescription updateQueue ( QueueDescription queueDescription ) throws ServiceBusException , InterruptedException { } }
return Utils . completeFuture ( this . asyncClient . updateQueueAsync ( queueDescription ) ) ;
public class SarlAssertExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case SarlPackage . SARL_ASSERT_EXPRESSION__CONDITION : setCondition ( ( XExpression ) newValue ) ; return ; case SarlPackage . SARL_ASSERT_EXPRESSION__MESSAGE : setMessage ( ( String ) newValue ) ; return ; case SarlPackage . SARL_ASSERT_EXPRESSION__IS_STATIC : setIsStatic ( ( Boolean ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class ProxyOverrider { /** * Used by the Betamax proxy so that it can use pre - existing proxy settings when forwarding requests that do not * match anything on tape . * @ return a proxy selector that uses the overridden proxy settings if any . */ @ Deprecated public ProxySelector getOriginalProxySelector ( ) { } }
return new ProxySelector ( ) { @ Override public List < Proxy > select ( URI uri ) { InetSocketAddress address = originalProxies . get ( uri . getScheme ( ) ) ; if ( address != null && ! ( originalNonProxyHosts . contains ( uri . getHost ( ) ) ) ) { return Collections . singletonList ( new Proxy ( HTTP , address ) ) ; } else { return Collections . singletonList ( Proxy . NO_PROXY ) ; } } @ Override public void connectFailed ( URI uri , SocketAddress sa , IOException ioe ) { } } ;
public class ThrowsTaglet { /** * Inherit throws documentation for exceptions that were declared but not * documented . */ private Content inheritThrowsDocumentation ( Doc holder , Type [ ] declaredExceptionTypes , Set < String > alreadyDocumented , TagletWriter writer ) { } }
Content result = writer . getOutputInstance ( ) ; if ( holder instanceof MethodDoc ) { Set < Tag > declaredExceptionTags = new LinkedHashSet < > ( ) ; for ( Type declaredExceptionType : declaredExceptionTypes ) { DocFinder . Output inheritedDoc = DocFinder . search ( writer . configuration ( ) , new DocFinder . Input ( ( MethodDoc ) holder , this , declaredExceptionType . typeName ( ) ) ) ; if ( inheritedDoc . tagList . size ( ) == 0 ) { inheritedDoc = DocFinder . search ( writer . configuration ( ) , new DocFinder . Input ( ( MethodDoc ) holder , this , declaredExceptionType . qualifiedTypeName ( ) ) ) ; } declaredExceptionTags . addAll ( inheritedDoc . tagList ) ; } result . addContent ( throwsTagsOutput ( declaredExceptionTags . toArray ( new ThrowsTag [ ] { } ) , writer , alreadyDocumented , false ) ) ; } return result ;
public class RawDataBuffer { /** * ( non - Javadoc ) * @ see java . io . DataOutput # write ( byte [ ] ) */ @ Override public void write ( byte [ ] data ) { } }
int newCount = size + data . length ; ensureCapacity ( newCount ) ; System . arraycopy ( data , 0 , buf , size , data . length ) ; size = newCount ;
public class JCurand { /** * < pre > * Generate 32 - bit pseudo or quasirandom numbers . * Use generator to generate num 32 - bit results into the device memory at * outputPtr . The device memory must have been previously allocated and be * large enough to hold all the results . Launches are done with the stream * set using : : curandSetStream ( ) , or the null stream if no stream has been set . * Results are 32 - bit values with every bit random . * @ param generator - Generator to use * @ param outputPtr - Pointer to device memory to store CUDA - generated results , or * Pointer to host memory to store CPU - generated results * @ param num - Number of random 32 - bit values to generate * @ return * CURAND _ STATUS _ NOT _ INITIALIZED if the generator was never created * CURAND _ STATUS _ PREEXISTING _ FAILURE if there was an existing error from * a previous kernel launch * CURAND _ STATUS _ LENGTH _ NOT _ MULTIPLE if the number of output samples is * not a multiple of the quasirandom dimension * CURAND _ STATUS _ LAUNCH _ FAILURE if the kernel launch failed for any reason * CURAND _ STATUS _ SUCCESS if the results were generated successfully * < / pre > */ public static int curandGenerate ( curandGenerator generator , Pointer outputPtr , long num ) { } }
return checkResult ( curandGenerateNative ( generator , outputPtr , num ) ) ;
public class StreamMessageImpl { /** * / * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . common . message . AbstractMessage # copy ( ) */ @ Override public AbstractMessage copy ( ) { } }
StreamMessageImpl clone = new StreamMessageImpl ( ) ; copyCommonFields ( clone ) ; @ SuppressWarnings ( "unchecked" ) Vector < Object > bodyClone = ( Vector < Object > ) this . body . clone ( ) ; clone . body = bodyClone ; return clone ;
public class OAuth20ConsentApprovalViewResolver { /** * Redirect to approve view model and view . * @ param ctx the ctx * @ param svc the svc * @ return the model and view */ @ SneakyThrows protected ModelAndView redirectToApproveView ( final J2EContext ctx , final OAuthRegisteredService svc ) { } }
val callbackUrl = ctx . getFullRequestURL ( ) ; LOGGER . trace ( "callbackUrl: [{}]" , callbackUrl ) ; val url = new URIBuilder ( callbackUrl ) ; url . addParameter ( OAuth20Constants . BYPASS_APPROVAL_PROMPT , Boolean . TRUE . toString ( ) ) ; val model = new HashMap < String , Object > ( ) ; model . put ( "service" , svc ) ; model . put ( "callbackUrl" , url . toString ( ) ) ; model . put ( "serviceName" , svc . getName ( ) ) ; model . put ( "deniedApprovalUrl" , svc . getAccessStrategy ( ) . getUnauthorizedRedirectUrl ( ) ) ; prepareApprovalViewModel ( model , ctx , svc ) ; return getApprovalModelAndView ( model ) ;
public class BucketManager { /** * 修改文件的MimeType * @ param bucket 空间名称 * @ param key 文件名称 * @ param mime 文件的新MimeType * @ throws QiniuException * @ link http : / / developer . qiniu . com / kodo / api / chgm */ public Response changeMime ( String bucket , String key , String mime ) throws QiniuException { } }
String resource = encodedEntry ( bucket , key ) ; String encodedMime = UrlSafeBase64 . encodeToString ( mime ) ; String path = String . format ( "/chgm/%s/mime/%s" , resource , encodedMime ) ; return rsPost ( bucket , path , null ) ;
public class Lists { /** * Returns an implementation of { @ link List # listIterator ( int ) } . */ static < E > ListIterator < E > listIteratorImpl ( List < E > list , int index ) { } }
return new AbstractListWrapper < E > ( list ) . listIterator ( index ) ;
public class SMailHonestPostie { protected void hookPreparedMessage ( Postcard postcard , final SMailPostingMessage message ) { } }
if ( SMailCallbackContext . isExistPreparedMessageHookOnThread ( ) ) { final SMailCallbackContext context = SMailCallbackContext . getCallbackContextOnThread ( ) ; final SMailPreparedMessageHook hook = context . getPreparedMessageHook ( ) ; hook . hookPreparedMessage ( postcard , message ) ; }
public class DataCollector { /** * Gets the collector . * @ param collectorType the collector type * @ param dataType the data type * @ param statsType the stats type * @ param statsItems the stats items * @ param sortType the sort type * @ param sortDirection the sort direction * @ param start the start * @ param number the number * @ param segmentRegistration the segment registration * @ param boundary the boundary * @ return the collector * @ throws IOException Signals that an I / O exception has occurred . */ public static MtasDataCollector < ? , ? > getCollector ( String collectorType , String dataType , String statsType , SortedSet < String > statsItems , String sortType , String sortDirection , Integer start , Integer number , String segmentRegistration , String boundary ) throws IOException { } }
return getCollector ( collectorType , dataType , statsType , statsItems , sortType , sortDirection , start , number , null , null , null , null , null , null , null , null , segmentRegistration , boundary ) ;
public class CmsRequestContext { /** * Removes an attribute from the request context . < p > * @ param key the name of the attribute to remove * @ return the removed attribute , or < code > null < / code > if no attribute was set with this name */ public Object removeAttribute ( String key ) { } }
if ( m_attributeMap != null ) { return m_attributeMap . remove ( key ) ; } return null ;
public class NewManagedBean { /** * Creates an instance of a NewSimpleBean from an annotated class * @ param clazz The annotated class * @ param beanManager The Bean manager * @ return a new NewSimpleBean instance */ public static < T > NewManagedBean < T > of ( BeanAttributes < T > attributes , EnhancedAnnotatedType < T > clazz , BeanManagerImpl beanManager ) { } }
return new NewManagedBean < T > ( attributes , clazz , new StringBeanIdentifier ( BeanIdentifiers . forNewManagedBean ( clazz ) ) , beanManager ) ;
public class BufferUtils { /** * Creates a buffer for the given number of elements and * native byte ordering * @ param elements The number of elements in the buffer * @ return The buffer */ public static IntBuffer createIntBuffer ( int elements ) { } }
ByteBuffer byteBuffer = ByteBuffer . allocateDirect ( elements * 4 ) ; byteBuffer . order ( ByteOrder . nativeOrder ( ) ) ; return byteBuffer . asIntBuffer ( ) ;
public class Crossing { /** * Returns whether bounds intersect a rectangle or not . */ protected static int crossBound ( double [ ] bound , int bc , double py1 , double py2 ) { } }
// LEFT / RIGHT if ( bc == 0 ) { return 0 ; } // Check Y coordinate int up = 0 ; int down = 0 ; for ( int i = 2 ; i < bc ; i += 4 ) { if ( bound [ i ] < py1 ) { up ++ ; continue ; } if ( bound [ i ] > py2 ) { down ++ ; continue ; } return CROSSING ; } // UP if ( down == 0 ) { return 0 ; } if ( up != 0 ) { // bc > = 2 sortBound ( bound , bc ) ; boolean sign = bound [ 2 ] > py2 ; for ( int i = 6 ; i < bc ; i += 4 ) { boolean sign2 = bound [ i ] > py2 ; if ( sign != sign2 && bound [ i + 1 ] != bound [ i - 3 ] ) { return CROSSING ; } sign = sign2 ; } } return UNKNOWN ;
public class DefaultLocationInFileProvider { /** * Returns the smallest node that covers all assigned values of the given object . It handles the semantics of { @ link Action * actions } and { @ link RuleCall unassigned rule calls } . * @ return the minimal node that covers all assigned values of the given object . * @ since 2.3 */ protected ICompositeNode findNodeFor ( EObject semanticObject ) { } }
ICompositeNode result = NodeModelUtils . getNode ( semanticObject ) ; if ( result != null ) { ICompositeNode node = result ; while ( GrammarUtil . containingAssignment ( node . getGrammarElement ( ) ) == null && node . getParent ( ) != null && ! node . getParent ( ) . hasDirectSemanticElement ( ) ) { ICompositeNode parent = node . getParent ( ) ; if ( node . hasSiblings ( ) ) { for ( INode sibling : parent . getChildren ( ) ) { EObject grammarElement = sibling . getGrammarElement ( ) ; if ( grammarElement != null && GrammarUtil . containingAssignment ( grammarElement ) != null ) { result = parent ; } } } node = parent ; } } return result ;
public class Evaluators { /** * Moves evaluator from map of active evaluators to set of closed evaluators . */ public synchronized void removeClosedEvaluator ( final EvaluatorManager evaluatorManager ) { } }
final String evaluatorId = evaluatorManager . getId ( ) ; LOG . log ( Level . FINE , "Removing closed evaluator: {0}" , evaluatorId ) ; if ( ! evaluatorManager . isClosed ( ) ) { throw new IllegalArgumentException ( "Removing evaluator that has not been closed yet: " + evaluatorId ) ; } if ( ! this . evaluators . containsKey ( evaluatorId ) && ! this . closedEvaluatorIds . contains ( evaluatorId ) ) { throw new IllegalArgumentException ( "Removing unknown evaluator: " + evaluatorId ) ; } if ( ! this . evaluators . containsKey ( evaluatorId ) && this . closedEvaluatorIds . contains ( evaluatorId ) ) { LOG . log ( Level . FINE , "Removing closed evaluator which has already been removed: {0}" , evaluatorId ) ; return ; } evaluatorManager . shutdown ( ) ; this . evaluators . remove ( evaluatorId ) ; this . closedEvaluatorIds . add ( evaluatorId ) ; LOG . log ( Level . FINEST , "Closed evaluator removed: {0}" , evaluatorId ) ;
public class VertxCompletableFuture { /** * Returns a new CompletableFuture that is asynchronously completed by a task running in the worker thread pool of * Vert . x * This method is different from { @ link CompletableFuture # supplyAsync ( Supplier ) } as it does not use a fork join * executor , but the worker thread pool . * @ param vertx the Vert . x instance * @ param worker the WorkerExecution on which the supplier is to be executed * @ param supplier a function returning the value to be used to complete the returned CompletableFuture * @ param < T > the function ' s return type * @ return the new CompletableFuture */ public static < T > VertxCompletableFuture < T > supplyBlockingAsyncOn ( Vertx vertx , WorkerExecutor worker , Supplier < T > supplier ) { } }
return supplyBlockingAsyncOn ( Objects . requireNonNull ( vertx ) . getOrCreateContext ( ) , worker , supplier ) ;
public class StaticLog { /** * Error等级日志 < br > * @ param log 日志对象 * @ param e 需在日志中堆栈打印的异常 * @ param format 格式文本 , { } 代表变量 * @ param arguments 变量对应的参数 */ public static void error ( Log log , Throwable e , String format , Object ... arguments ) { } }
if ( false == log ( log , Level . ERROR , e , format , arguments ) ) { log . error ( e , format , arguments ) ; }
public class MessageProcessor { /** * Reconstitute the Message Processor from state stored in the MessageStore * ( warm restart ) . * This involves , * 1 . Reconstituting MessageProcessor ' s persisted state information . * 2 . Initializing non - persistent MessageProcessor fields and objects . * 3 . Travelling down the tree structure of ItemStreams , retrieving and * reconstituting objects as appropriate ( Destination Manager , Destination * Handlers , etc . ) * Feature 174199.2.4 * @ return true if reconstitution successful , false if nothing existed to * reconstitute or there was a fatal error while reconstituting . */ private boolean reconstitute ( int startMode ) throws MessageStoreException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reconstitute" , new Integer ( startMode ) ) ; boolean reconstituted = false ; /* * 174199.2 * If you want to force the Message Processor to ignore existing * database information on restart for debugging purposes , comment out * this line . * Commenting out this line will not delete previous database * information , but will rather store a second persistent data * structure . */ _persistentStore = ( MessageProcessorStore ) _msgStore . findFirstMatching ( new ClassEqualsFilter ( MessageProcessorStore . class ) ) ; if ( _persistentStore != null ) { /* * Retrieve and initialize an existing DestinationManager */ _destinationManager = ( DestinationManager ) _persistentStore . findFirstMatchingItemStream ( new ClassEqualsFilter ( DestinationManager . class ) ) ; // Sanity - A PersistentStore should not be in the MessageStore // without // a DestinationManager ! if ( null == _destinationManager ) { SIMPMessageProcessorCorruptException e = new SIMPMessageProcessorCorruptException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.impl.MessageProcessor" , "1:2308:1.445" } , null ) ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.MessageProcessor.reconstitute" , "1:2314:1.445" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.impl.MessageProcessor" , "1:2321:1.445" } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" , e ) ; throw e ; } // The administrator initialization in initializeNonPersistent needs // the DestinationManager to already have been recovered . // Defect 178509 initializeNonPersistent ( ) ; // D261769 - The destinationChangeListener needs to be created // before any AIH // is recreated , and as the destinationLocationManager is only // avaiable after // initializeNonPersistent we have to place this code here for // warmStarts . // Before loading localizations , start listening to changes to the // sets of messaging // engines localizing destinations _destinationChangeListener = new DestinationChangeListener ( this ) ; _linkChangeListener = new LinkChangeListener ( this ) ; // Venu mock mock // For now no _ destinationLocationManager /* * _ destinationLocationManager * . setChangeListener ( _ destinationChangeListener ) ; */ // Restore the manager ' s state data , but not its destinations _destinationManager . initializeNonPersistent ( this ) ; // The MP control adapter has to be created after the DM has been // initialized so that a reference to DestinationLookups can be // obtained createControlAdapter ( ) ; // Venu mock mock no ProxyHandler for this version of Liberty profile /* * / / Recreate the ProxyHandler * _ multiMEProxyHandler = ( MultiMEProxyHandler ) _ persistentStore * . findFirstMatchingItemStream ( new ClassEqualsFilter ( * MultiMEProxyHandler . class ) ) ; * / / Sanity - A PersistentStore should not be in the MessageStore * / / without * / / a multiMEProxyHandler ! * if ( null = = _ multiMEProxyHandler ) { * SIMPMessageProcessorCorruptException e = new SIMPMessageProcessorCorruptException ( * nls * . getFormattedMessage ( * " INTERNAL _ MESSAGING _ ERROR _ CWSIP0001 " , * new Object [ ] { * " com . ibm . ws . sib . processor . impl . MessageProcessor " , * " 1:2363:1.445 " } , null ) ) ; * FFDCFilter * . processException ( * " com . ibm . ws . sib . processor . impl . MessageProcessor . reconstitute " , * " 1:2369:1.445 " , this ) ; * SibTr . exception ( tc , e ) ; * SibTr * . error ( * tc , * " INTERNAL _ MESSAGING _ ERROR _ CWSIP0001 " , * new Object [ ] { * " com . ibm . ws . sib . processor . impl . MessageProcessor " , * " 1:2376:1.445 " } ) ; * if ( TraceComponent . isAnyTracingEnabled ( ) * & & tc . isEntryEnabled ( ) ) * SibTr . exit ( tc , " reconstitute " , SIMPUtils . getStackTrace ( e ) ) ; * throw e ; * _ multiMEProxyHandler . initialiseNonPersistent ( this , _ txManager ) ; */ // Venu mock mock . . . no SystemConnection no recoverNeighbours and no ConfigureNeighbours /* * / / Connection creation requires a DestinationManager * createSystemConnection ( ) ; * _ proxyHandlerDestAddr = SIMPUtils . createJsSystemDestinationAddress ( * SIMPConstants . PROXY _ SYSTEM _ DESTINATION _ PREFIX , * getMessagingEngineUuid ( ) ) ; * / / Recover the Neighbours for the ProxyHandler * try { * _ multiMEProxyHandler . recoverNeighbours ( ) ; * } catch ( SIResourceException e ) { * / / FFDC * FFDCFilter * . processException ( * " com . ibm . ws . sib . processor . impl . MessageProcessor . reconstitute " , * " 1:2402:1.445 " , this ) ; * if ( TraceComponent . isAnyTracingEnabled ( ) * & & tc . isEntryEnabled ( ) ) * SibTr . exit ( tc , " reconstitute " , " SIErrorException " ) ; * throw new SIErrorException ( e ) ; * / / Read the Neighbour configuration * configureNeighbours ( ) ; */ // Reconstitute destinations try { _destinationManager . reconstitute ( startMode ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.MessageProcessor.reconstitute" , "1:2422:1.445" , this ) ; SIErrorException finalE = new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.MessageProcessor" , "1:2431:1.445" , e } , null ) , e ) ; SibTr . exception ( tc , finalE ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" , finalE ) ; throw finalE ; } reconstituted = true ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" , new Boolean ( reconstituted ) ) ; return reconstituted ;
public class CachedUserRoleDAO { /** * Special Case . * User Roles by User are very likely to be called many times in a Transaction , to validate " May User do . . . " * Pull result , and make accessible by the Trans , which is always keyed by User . * @ param trans * @ param user * @ return */ public Result < List < Data > > readByUser ( AuthzTrans trans , final String user ) { } }
DAOGetter getter = new DAOGetter ( trans , dao ( ) ) { public Result < List < Data > > call ( ) { // If the call is for THIS user , and it exists , get from TRANS , add to TRANS if not . if ( user != null && user . equals ( trans . user ( ) ) ) { Result < List < Data > > transLD = trans . get ( transURSlot , null ) ; if ( transLD == null ) { transLD = dao . readByUser ( trans , user ) ; } return transLD ; } else { return dao . readByUser ( trans , user ) ; } } } ; Result < List < Data > > lurd = get ( trans , user , getter ) ; if ( lurd . isOK ( ) && lurd . isEmpty ( ) ) { return Result . err ( Status . ERR_UserRoleNotFound , "UserRole not found for [%s]" , user ) ; } return lurd ;
public class HString { /** * Gets the stemmed version of the HString . Stems of token are determined using the < code > Stemmer < / code > associated * with the language that the token is in . Tokens store their stem using the < code > STEM < / code > attribute , so that the * stem only needs to be calculated once . Stems of longer phrases are constructed from token stems . * @ return The stemmed version of the HString . */ public String getStem ( ) { } }
if ( isInstance ( Types . TOKEN ) ) { putIfAbsent ( Types . STEM , Stemmers . getStemmer ( getLanguage ( ) ) . stem ( this ) ) ; return get ( Types . STEM ) . asString ( ) ; } return tokens ( ) . stream ( ) . map ( HString :: getStem ) . collect ( Collectors . joining ( getLanguage ( ) . usesWhitespace ( ) ? " " : "" ) ) ;
public class QueueFile { /** * Reads count bytes into buffer from file . Wraps if necessary . * @ param position in file to read from * @ param buffer to read into * @ param count # of bytes to read */ @ Private void ringRead ( int position , byte [ ] buffer , int offset , int count ) throws IOException { } }
position = wrapPosition ( position ) ; if ( position + count <= fileLength ) { raf . seek ( position ) ; raf . readFully ( buffer , offset , count ) ; } else { // The read overlaps the EOF . // # of bytes to read before the EOF . int beforeEof = fileLength - position ; raf . seek ( position ) ; raf . readFully ( buffer , offset , beforeEof ) ; raf . seek ( HEADER_LENGTH ) ; raf . readFully ( buffer , offset + beforeEof , count - beforeEof ) ; }
public class TokenMapperMurmur { /** * { @ inheritDoc } */ @ Override public void addFields ( Document document , DecoratedKey partitionKey ) { } }
Long value = ( Long ) partitionKey . getToken ( ) . getTokenValue ( ) ; Field tokenField = new LongField ( FIELD_NAME , value , Store . NO ) ; document . add ( tokenField ) ;
public class KeyValueSelectBucketHandler { /** * Handles incoming Select bucket responses . * @ param ctx the handler context . * @ param msg the incoming message to investigate . * @ throws Exception if something goes wrong during communicating to the server . */ @ Override protected void channelRead0 ( ChannelHandlerContext ctx , FullBinaryMemcacheResponse msg ) throws Exception { } }
switch ( msg . getStatus ( ) ) { case SUCCESS : originalPromise . setSuccess ( ) ; ctx . pipeline ( ) . remove ( this ) ; ctx . fireChannelActive ( ) ; break ; case ACCESS_ERROR : originalPromise . setFailure ( new AuthenticationException ( "Authentication failure on Select Bucket command" ) ) ; break ; case NOTFOUND_ERROR : originalPromise . setFailure ( new AuthenticationException ( "Bucket not found on Select Bucket command" ) ) ; break ; default : originalPromise . setFailure ( new AuthenticationException ( "Unhandled select bucket status: " + msg . getStatus ( ) ) ) ; }
public class Pipes { /** * Create a ReactiveSeq from the Adapter identified by the provided Key * < pre > * { @ code * Queue < String > q = new Queue < > ( ) ; * pipes . register ( " data - queue " , q ) ; * pipes . push ( " data - queue " , " world " ) ; * on a separate thread * ReactiveSeq < String > stream = pipes . reactiveSeq ( " data - queue " ) ; * stream . forEach ( System . out : : println ) ; * " world " * < / pre > * @ param key : Adapter identifier * @ return { @ link ReactiveSeq } from selected Queue */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) public Option < ReactiveSeq < V > > reactiveSeq ( final K key ) { return get ( key ) . map ( a -> a . stream ( ) ) ;
public class CmsLoginManager { /** * Helper method to get all the storage keys that match a user ' s name . < p > * @ param user the user for which to get the storage keys * @ return the set of storage keys */ private Set < String > getKeysForUser ( CmsUser user ) { } }
Set < String > keysToRemove = new HashSet < String > ( ) ; for ( Map . Entry < String , CmsUserData > entry : m_storage . entrySet ( ) ) { String key = entry . getKey ( ) ; int separatorPos = key . lastIndexOf ( KEY_SEPARATOR ) ; String prefix = key . substring ( 0 , separatorPos ) ; if ( user . getName ( ) . equals ( prefix ) ) { keysToRemove . add ( key ) ; } } return keysToRemove ;
public class FixedWindowRollingPolicy { /** * { @ inheritDoc } */ public RolloverDescription initialize ( final String file , final boolean append ) { } }
String newActiveFile = file ; explicitActiveFile = false ; if ( activeFileName != null ) { explicitActiveFile = true ; newActiveFile = activeFileName ; } if ( file != null ) { explicitActiveFile = true ; newActiveFile = file ; } if ( ! explicitActiveFile ) { StringBuffer buf = new StringBuffer ( ) ; formatFileName ( new Integer ( minIndex ) , buf ) ; newActiveFile = buf . toString ( ) ; } return new RolloverDescriptionImpl ( newActiveFile , append , null , null ) ;
public class AbstractRequestContext { /** * Take ownership of a proxy instance and make it editable . */ public < T extends BaseProxy > T editProxy ( final T object ) { } }
AutoBean < T > bean = this . checkStreamsNotCrossed ( object ) ; this . checkLocked ( ) ; @ SuppressWarnings ( "unchecked" ) final AutoBean < T > previouslySeen = ( AutoBean < T > ) this . state . editedProxies . get ( BaseProxyCategory . stableId ( bean ) ) ; if ( previouslySeen != null && ! previouslySeen . isFrozen ( ) ) { /* * If we ' ve seen the object before , it might be because it was passed in as a method argument . * This does not guarantee its mutability , so check that here before returning the cached * object . */ return previouslySeen . as ( ) ; } // Create editable copies final AutoBean < T > parent = bean ; bean = this . cloneBeanAndCollections ( bean ) ; bean . setTag ( Constants . PARENT_OBJECT , parent ) ; return bean . as ( ) ;
public class Browser { /** * Copy values from itself to a < code > UserAgentInfo . Builder < / code > . */ public void copyTo ( @ Nonnull final UserAgent . Builder builder ) { } }
builder . setFamily ( family ) ; builder . setIcon ( icon ) ; builder . setName ( familyName ) ; builder . setProducer ( producer ) ; builder . setProducerUrl ( producerUrl ) ; builder . setTypeName ( type . getName ( ) ) ; builder . setUrl ( url ) ; if ( operatingSystem != null ) { operatingSystem . copyTo ( builder ) ; }
public class SystemService { /** * Performs the actions of the { @ link # doStart ( ) } method . After this method completes either by normal execution or by throwing an exception , the * interlock condition is satisfied and calls to { @ link # stop ( ) } may proceed . * @ throws SystemException If any exception is thrown by the underlying implementation . */ public final void start ( ) { } }
try { if ( ! _unlocked ) { _log . info ( "Starting {}" , getName ( ) ) ; doStart ( ) ; } _started = true ; } catch ( Exception ex ) { throw new SystemException ( ex ) ; } finally { _unlocked = true ; _interlock . countDown ( ) ; }
public class Responsive { /** * Convert the specified size to int value * @ param size * @ return */ private static int sizeToInt ( String size ) { } }
if ( size == null ) return - 1 ; if ( "full" . equals ( size ) ) return 12 ; if ( "full-size" . equals ( size ) ) return 12 ; if ( "fullSize" . equals ( size ) ) return 12 ; if ( "full-width" . equals ( size ) ) return 12 ; if ( "fullWidth" . equals ( size ) ) return 12 ; if ( "half" . equals ( size ) ) return 6 ; if ( "one-third" . equals ( size ) ) return 4 ; if ( "oneThird" . equals ( size ) ) return 4 ; if ( "two-thirds" . equals ( size ) ) return 8 ; if ( "twoThirds" . equals ( size ) ) return 8 ; if ( "one-fourth" . equals ( size ) ) return 3 ; if ( "oneFourth" . equals ( size ) ) return 3 ; if ( "three-fourths" . equals ( size ) ) return 9 ; if ( "threeFourths" . equals ( size ) ) return 9 ; if ( size . length ( ) > 2 ) { size = size . replace ( "columns" , "" ) ; size = size . replace ( "column" , "" ) ; size = size . trim ( ) ; } return new Integer ( size ) . intValue ( ) ;
public class HttpBuilder { /** * Executes an asynchronous PUT request on the configured URI ( asynchronous alias to ` put ( Consumer ) ` ) , with additional configuration provided by the * configuration function . * This method is generally used for Java - specific configuration . * [ source , java ] * HttpBuilder http = HttpBuilder . configure ( config - > { * config . getRequest ( ) . setUri ( " http : / / localhost : 10101 " ) ; * CompletableFuture < Object > future = http . putAsync ( config - > { * config . getRequest ( ) . getUri ( ) . setPath ( " / foo " ) ; * Object result = future . get ( ) ; * The ` configuration ` function allows additional configuration for this request based on the { @ link HttpConfig } interface . * @ param configuration the additional configuration closure ( delegated to { @ link HttpConfig } ) * @ return the resulting content wrapped in a { @ link CompletableFuture } */ public CompletableFuture < Object > putAsync ( final Consumer < HttpConfig > configuration ) { } }
return CompletableFuture . supplyAsync ( ( ) -> put ( configuration ) , getExecutor ( ) ) ;
public class Planar { /** * Returns a band in the multi - band image . * @ param band Which band should be returned . * @ return Image band */ public T getBand ( int band ) { } }
if ( band >= bands . length || band < 0 ) throw new IllegalArgumentException ( "The specified band is out of bounds: " + band ) ; return bands [ band ] ;
public class SynthesisFilter { /** * Converts a 1D array into a number of smaller arrays . This is used * to achieve offset + constant indexing into an array . Each sub - array * represents a block of values of the original array . * @ param array * The array to split up into blocks . * @ param blockSize * The size of the blocks to split the array * into . This must be an exact divisor of * the length of the array , or some data * will be lost from the main array . * @ return An array of arrays in which each element in the returned * array will be of length < code > blockSize < / code > . */ static private float [ ] [ ] splitArray ( final float [ ] array , final int blockSize ) { } }
int size = array . length / blockSize ; float [ ] [ ] split = new float [ size ] [ ] ; for ( int i = 0 ; i < size ; i ++ ) { split [ i ] = subArray ( array , i * blockSize , blockSize ) ; } return split ;
public class CommerceWarehouseItemPersistenceImpl { /** * Returns the first commerce warehouse item in the ordered set where commerceWarehouseId = & # 63 ; . * @ param commerceWarehouseId the commerce warehouse ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce warehouse item * @ throws NoSuchWarehouseItemException if a matching commerce warehouse item could not be found */ @ Override public CommerceWarehouseItem findByCommerceWarehouseId_First ( long commerceWarehouseId , OrderByComparator < CommerceWarehouseItem > orderByComparator ) throws NoSuchWarehouseItemException { } }
CommerceWarehouseItem commerceWarehouseItem = fetchByCommerceWarehouseId_First ( commerceWarehouseId , orderByComparator ) ; if ( commerceWarehouseItem != null ) { return commerceWarehouseItem ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "commerceWarehouseId=" ) ; msg . append ( commerceWarehouseId ) ; msg . append ( "}" ) ; throw new NoSuchWarehouseItemException ( msg . toString ( ) ) ;
public class JsonWebKey { /** * Get HSM Token value , used with Bring Your Own Key . * @ return HSM Token , used with Bring Your Own Key . */ @ JsonProperty ( "key_hsm" ) @ JsonSerialize ( using = Base64UrlJsonSerializer . class ) @ JsonDeserialize ( using = Base64UrlJsonDeserializer . class ) public byte [ ] t ( ) { } }
return ByteExtensions . clone ( this . t ) ;
public class JmsQueueImpl { /** * CAUTION This method is used both to implement JMS getQueueName * and also to provide a Java bean accessor for the property * ' queueName ' . Thiis is ok provided that both functions can be * met by mapping to JmsDestinationImpl . getDestName ( ) . * @ see javax . jms . Queue # getQueueName ( ) * @ see JmsQueueImpl # setQueueName */ @ Override public String getQueueName ( ) throws JMSException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getQueueName" ) ; String queueName = getDestName ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getQueueName" , queueName ) ; return queueName ;
public class UniverseApi { /** * Bulk names to IDs Resolve a set of names to IDs in the following * categories : agents , alliances , characters , constellations , corporations * factions , inventory _ types , regions , stations , and systems . Only exact * matches will be returned . All names searched for are cached for 12 hours * @ param requestBody * The names to resolve ( required ) * @ param acceptLanguage * Language to use in the response ( optional , default to en - us ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param language * Language to use in the response , takes precedence over * Accept - Language ( optional , default to en - us ) * @ return UniverseIdsResponse * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public UniverseIdsResponse postUniverseIds ( List < String > requestBody , String acceptLanguage , String datasource , String language ) throws ApiException { } }
ApiResponse < UniverseIdsResponse > resp = postUniverseIdsWithHttpInfo ( requestBody , acceptLanguage , datasource , language ) ; return resp . getData ( ) ;
public class KeyStoreUtil { /** * Create a key stored holding certificates and secret keys from the given Docker key cert * @ param certPath directory holding the keys ( key . pem ) and certs ( ca . pem , cert . pem ) * @ return a keystore where the private key is secured with " docker " * @ throws IOException is reading of the the PEMs failed * @ throws GeneralSecurityException when the files in a wrong format */ public static KeyStore createDockerKeyStore ( String certPath ) throws IOException , GeneralSecurityException { } }
PrivateKey privKey = loadPrivateKey ( certPath + "/key.pem" ) ; Certificate [ ] certs = loadCertificates ( certPath + "/cert.pem" ) ; KeyStore keyStore = KeyStore . getInstance ( KeyStore . getDefaultType ( ) ) ; keyStore . load ( null ) ; keyStore . setKeyEntry ( "docker" , privKey , "docker" . toCharArray ( ) , certs ) ; addCA ( keyStore , certPath + "/ca.pem" ) ; return keyStore ;
public class CommerceWarehousePersistenceImpl { /** * Returns the number of commerce warehouses where groupId = & # 63 ; and active = & # 63 ; and commerceCountryId = & # 63 ; . * @ param groupId the group ID * @ param active the active * @ param commerceCountryId the commerce country ID * @ return the number of matching commerce warehouses */ @ Override public int countByG_A_C ( long groupId , boolean active , long commerceCountryId ) { } }
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_A_C ; Object [ ] finderArgs = new Object [ ] { groupId , active , commerceCountryId } ; Long count = ( Long ) finderCache . getResult ( finderPath , finderArgs , this ) ; if ( count == null ) { StringBundler query = new StringBundler ( 4 ) ; query . append ( _SQL_COUNT_COMMERCEWAREHOUSE_WHERE ) ; query . append ( _FINDER_COLUMN_G_A_C_GROUPID_2 ) ; query . append ( _FINDER_COLUMN_G_A_C_ACTIVE_2 ) ; query . append ( _FINDER_COLUMN_G_A_C_COMMERCECOUNTRYID_2 ) ; String sql = query . toString ( ) ; Session session = null ; try { session = openSession ( ) ; Query q = session . createQuery ( sql ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( groupId ) ; qPos . add ( active ) ; qPos . add ( commerceCountryId ) ; count = ( Long ) q . uniqueResult ( ) ; finderCache . putResult ( finderPath , finderArgs , count ) ; } catch ( Exception e ) { finderCache . removeResult ( finderPath , finderArgs ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } return count . intValue ( ) ;
public class ToggleComment { /** * Creates a region describing the text block ( something that starts at * the beginning of a line ) completely containing the current selection . * @ param selection The selection to use * @ param document The document * @ return the region describing the text block comprising the given selection */ private IRegion getTextBlockFromSelection ( ITextSelection selection , IDocument document ) { } }
try { IRegion line = document . getLineInformationOfOffset ( selection . getOffset ( ) ) ; int length = selection . getLength ( ) == 0 ? line . getLength ( ) : selection . getLength ( ) + ( selection . getOffset ( ) - line . getOffset ( ) ) ; return new Region ( line . getOffset ( ) , length ) ; } catch ( BadLocationException x ) { // should not happen VdmUIPlugin . log ( x ) ; } return null ;
public class CPInstanceLocalServiceBaseImpl { /** * Deletes the cp instance from the database . Also notifies the appropriate model listeners . * @ param cpInstance the cp instance * @ return the cp instance that was removed * @ throws PortalException */ @ Indexable ( type = IndexableType . DELETE ) @ Override public CPInstance deleteCPInstance ( CPInstance cpInstance ) throws PortalException { } }
return cpInstancePersistence . remove ( cpInstance ) ;
public class BigtableSession { /** * < p > createBulkMutationWrapper . < / p > * @ param tableName a { @ link BigtableTableName } object . * @ return a { @ link IBigtableDataClient } object . */ public IBulkMutation createBulkMutationWrapper ( BigtableTableName tableName ) { } }
if ( options . useGCJClient ( ) ) { return getDataClientWrapper ( ) . createBulkMutationBatcher ( ) ; } else { return new BulkMutationWrapper ( createBulkMutation ( tableName ) , dataRequestContext ) ; }
public class EntryStream { /** * Returns a sequential { @ code EntryStream } containing { @ code Entry } objects * composed from corresponding key and value in given two lists . * The keys and values are accessed using { @ link List # get ( int ) } , so the * lists should provide fast random access . The lists are assumed to be * unmodifiable during the stream operations . * @ param < K > the type of stream element keys * @ param < V > the type of stream element values * @ param keys the list of keys , assumed to be unmodified during use * @ param values the list of values , assumed to be unmodified during use * @ return a new { @ code EntryStream } * @ throws IllegalArgumentException if length of the lists differs . * @ see StreamEx # zip ( List , List , BiFunction ) * @ since 0.2.1 */ public static < K , V > EntryStream < K , V > zip ( List < K > keys , List < V > values ) { } }
return of ( new RangeBasedSpliterator . ZipRef < > ( 0 , checkLength ( keys . size ( ) , values . size ( ) ) , SimpleImmutableEntry :: new , keys , values ) ) ;
public class AccountsInner { /** * Updates the Data Lake Analytics account object specified by the accountName with the contents of the account object . * @ param resourceGroupName The name of the Azure resource group . * @ param accountName The name of the Data Lake Analytics account . * @ param parameters Parameters supplied to the update Data Lake Analytics account operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the DataLakeAnalyticsAccountInner object if successful . */ public DataLakeAnalyticsAccountInner update ( String resourceGroupName , String accountName , UpdateDataLakeAnalyticsAccountParameters parameters ) { } }
return updateWithServiceResponseAsync ( resourceGroupName , accountName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class JsonHash { /** * Parses the given JSON data as a hash . * @ param parser { @ link JsonPullParser } with some JSON - formatted data * @ return { @ link JsonHash } * @ throws IOException * @ throws JsonFormatException * @ author vvakame */ public static JsonHash fromParser ( JsonPullParser parser ) throws IOException , JsonFormatException { } }
State state = parser . getEventType ( ) ; if ( state == State . VALUE_NULL ) { return null ; } else if ( state != State . START_HASH ) { throw new JsonFormatException ( "unexpected token. token=" + state , parser ) ; } JsonHash jsonHash = new JsonHash ( ) ; while ( ( state = parser . lookAhead ( ) ) != State . END_HASH ) { state = parser . getEventType ( ) ; if ( state != State . KEY ) { throw new JsonFormatException ( "unexpected token. token=" + state , parser ) ; } String key = parser . getValueString ( ) ; state = parser . lookAhead ( ) ; jsonHash . put ( key , getValue ( parser ) , state ) ; } parser . getEventType ( ) ; return jsonHash ;
public class CmsListMetadata { /** * Toggles the given item detail state from visible to hidden or * from hidden to visible . < p > * @ param itemDetailId the item detail id */ public void toogleDetailState ( String itemDetailId ) { } }
CmsListItemDetails lid = m_itemDetails . getObject ( itemDetailId ) ; lid . setVisible ( ! lid . isVisible ( ) ) ;
public class TreeMap { /** * Returns the key corresponding to the specified Entry . * @ throws NoSuchElementException if the Entry is null */ static < K > K key ( TreeMapEntry < K , ? > e ) { } }
if ( e == null ) throw new NoSuchElementException ( ) ; return e . key ;
public class FctBnPublicTradeProcessors { /** * < p > Lazy get PrLog . < / p > * @ param pAddParam additional param * @ return requested PrLog * @ throws Exception - an exception */ protected final PrLog < RS > lazyGetPrLog ( final Map < String , Object > pAddParam ) throws Exception { } }
String beanName = PrLog . class . getSimpleName ( ) ; @ SuppressWarnings ( "unchecked" ) PrLog < RS > proc = ( PrLog < RS > ) this . processorsMap . get ( beanName ) ; if ( proc == null ) { proc = new PrLog < RS > ( ) ; proc . setSrvOrm ( getSrvOrm ( ) ) ; proc . setSrvDb ( getSrvDatabase ( ) ) ; proc . setLog ( getSecLog ( ) ) ; proc . setSrvCart ( getSrvShoppingCart ( ) ) ; proc . setProcFac ( this ) ; proc . setBuySr ( getBuySr ( ) ) ; // assigning fully initialized object : this . processorsMap . put ( beanName , proc ) ; this . logger . info ( null , FctBnPublicTradeProcessors . class , beanName + " has been created." ) ; } return proc ;
public class AtomicBiInteger { /** * Sets the lo value into the given encoded value . * @ param encoded the encoded value * @ param lo the lo value * @ return the new encoded value */ public static long encodeLo ( long encoded , int lo ) { } }
long h = ( encoded >> 32 ) & 0xFFFF_FFFFL ; long l = ( ( long ) lo ) & 0xFFFF_FFFFL ; return ( h << 32 ) + l ;
public class AbstractFFmpegStreamBuilder { /** * Sets the video ' s frame rate * @ param frame _ rate Frames per second * @ return this * @ see net . bramp . ffmpeg . FFmpeg # FPS _ 30 * @ see net . bramp . ffmpeg . FFmpeg # FPS _ 29_97 * @ see net . bramp . ffmpeg . FFmpeg # FPS _ 24 * @ see net . bramp . ffmpeg . FFmpeg # FPS _ 23_976 */ public T setVideoFrameRate ( Fraction frame_rate ) { } }
this . video_enabled = true ; this . video_frame_rate = checkNotNull ( frame_rate ) ; return getThis ( ) ;
public class PrecedingAxis { /** * { @ inheritDoc } */ @ Override public final boolean hasNext ( ) { } }
// assure , that preceding is not evaluated on an attribute or a // namespace if ( mIsFirst ) { mIsFirst = false ; if ( getNode ( ) . getKind ( ) == IConstants . ATTRIBUTE // | | getTransaction ( ) . isNamespaceKind ( ) ) { resetToStartKey ( ) ; return false ; } } resetToLastKey ( ) ; if ( ! mStack . empty ( ) ) { // return all nodes of the current subtree in reverse document order moveTo ( mStack . pop ( ) ) ; return true ; } if ( ( ( ITreeStructData ) getNode ( ) ) . hasLeftSibling ( ) ) { moveTo ( ( ( ITreeStructData ) getNode ( ) ) . getLeftSiblingKey ( ) ) ; // because this axis return the precedings in reverse document // order , we // need to travel to the node in the subtree , that comes last in // document // order . getLastChild ( ) ; return true ; } while ( getNode ( ) . hasParent ( ) ) { // ancestors are not part of the preceding set moveTo ( getNode ( ) . getParentKey ( ) ) ; if ( ( ( ITreeStructData ) getNode ( ) ) . hasLeftSibling ( ) ) { moveTo ( ( ( ITreeStructData ) getNode ( ) ) . getLeftSiblingKey ( ) ) ; // move to last node in the subtree getLastChild ( ) ; return true ; } } resetToStartKey ( ) ; return false ;
public class FileUtil { /** * 将String写入文件 , 覆盖模式 , 字符集为UTF - 8 * @ param content 写入的内容 * @ param path 文件路径 * @ return 写入的文件 * @ throws IORuntimeException IO异常 */ public static File writeUtf8String ( String content , String path ) throws IORuntimeException { } }
return writeString ( content , path , CharsetUtil . CHARSET_UTF_8 ) ;