signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class GetRelationalDatabaseEventsResult { /** * An object describing the result of your get relational database events request . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setRelationalDatabaseEvents ( java . util . Collection ) } or * { @ link ...
if ( this . relationalDatabaseEvents == null ) { setRelationalDatabaseEvents ( new java . util . ArrayList < RelationalDatabaseEvent > ( relationalDatabaseEvents . length ) ) ; } for ( RelationalDatabaseEvent ele : relationalDatabaseEvents ) { this . relationalDatabaseEvents . add ( ele ) ; } return this ;
public class JCudaDriver { /** * A wrapper function for * { @ link JCudaDriver # cuModuleLoadDataEx ( CUmodule , Pointer , int , int [ ] , Pointer ) } * which allows passing in the image data as a string . * @ param module Returned module * @ param image Module data to load * @ param numOptions Number of opti...
byte bytes [ ] = string . getBytes ( ) ; byte image [ ] = Arrays . copyOf ( bytes , bytes . length + 1 ) ; return cuModuleLoadDataEx ( phMod , Pointer . to ( image ) , numOptions , options , optionValues ) ;
public class XmlEscape { /** * Perform an XML < strong > unescape < / strong > operation on a < tt > char [ ] < / tt > input . * No additional configuration arguments are required . Unescape operations * will always perform < em > complete < / em > XML 1.0/1.1 unescape of CERs , decimal * and hexadecimal referenc...
if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } final int textLen = ( text == null ? 0 : text . length ) ; if ( offset < 0 || offset > textLen ) { throw new IllegalArgumentException ( "Invalid (offset, len). offset=" + offset + ", len=" + len + ", text.length=" + te...
public class PrefixedCollapsibleMap { /** * Flatten a Map of String , Object into a Map of String , String where keys are ' . ' separated * and prepends a key . * @ param map map to transform * @ param prefix key to prepend * @ return flattened map */ public static Map < String , String > serialize ( Map < Stri...
if ( map == null || map . isEmpty ( ) ) { return Collections . emptyMap ( ) ; } Map < String , String > flattened = flatten ( map , new HashMap < String , String > ( ) , new ArrayList < String > ( ) ) ; Map < String , String > result = new HashMap < > ( ) ; for ( Map . Entry < String , String > entry : flattened . entr...
public class TypeAutoCast { /** * 从ResultSet中读出数据并转成成对应的类型 , 如果指定类型rs无法转换 , 则不转换 。 * 2018年4月24日 11:48:32 新增支持标记为isJSON的列的处理 。 * @ param rs * @ param columnName * @ return */ public static Object getFromRS ( ResultSet rs , String columnName , Field field ) throws SQLException { } }
if ( rs . getObject ( columnName ) == null ) { // 保证null会返回null值 return null ; } Column column = field . getAnnotation ( Column . class ) ; if ( column != null && column . isJSON ( ) ) { // 优先处理标记为json的列 String valStr = rs . getString ( columnName ) ; if ( valStr == null || valStr . trim ( ) . isEmpty ( ) ) { return nu...
public class PathMap { /** * Return the portion of a path that is after a path spec . * @ return The path info string */ public static String pathInfo ( String pathSpec , String path ) { } }
char c = pathSpec . charAt ( 0 ) ; if ( c == '/' ) { if ( pathSpec . length ( ) == 1 ) return null ; if ( pathSpec . equals ( path ) ) return null ; if ( pathSpec . endsWith ( "/*" ) && pathSpec . regionMatches ( 0 , path , 0 , pathSpec . length ( ) - 2 ) ) { if ( path . length ( ) == pathSpec . length ( ) - 2 ) return...
public class PublicKeyWriter { /** * Write the given { @ link PublicKey } into the given { @ link File } . * @ param publicKey * the public key * @ param file * the file to write in * @ throws IOException * Signals that an I / O exception has occurred . */ public static void write ( final PublicKey publicKe...
write ( publicKey , new FileOutputStream ( file ) ) ;
public class FinderColumn { /** * Central point for security context changes * This will be called when : * a ) the widget is attached ( default ) * b ) the security context changes ( i . e . scoped roles ) */ private void applySecurity ( final SecurityContext securityContext , boolean update ) { } }
// System . out . println ( " < < Process SecurityContext on column " + title + " : " + securityContext + " > > " ) ; // calculate accessible menu items filterNonPrivilegeOperations ( securityContext , accessibleTopMenuItems , topMenuItems ) ; filterNonPrivilegeOperations ( securityContext , accessibleMenuItems , menuI...
public class BreakpointStoreOnCache { /** * info maybe turn to equal to another one after get filename from response . */ @ Override public BreakpointInfo findAnotherInfoFromCompare ( @ NonNull DownloadTask task , @ NonNull BreakpointInfo ignored ) { } }
final SparseArray < BreakpointInfo > clonedMap ; synchronized ( this ) { clonedMap = storedInfos . clone ( ) ; } final int size = clonedMap . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { final BreakpointInfo info = clonedMap . valueAt ( i ) ; if ( info == ignored ) continue ; if ( info . isSameFrom ( task ) ) { ret...
public class BoxRequestItemUpdate { /** * Sets the new shared link for the item . * @ param sharedLink new shared link for the item . * @ return request with the updated shared link . */ public R setSharedLink ( BoxSharedLink sharedLink ) { } }
mBodyMap . put ( BoxItem . FIELD_SHARED_LINK , sharedLink ) ; return ( R ) this ;
public class DecisionTree { /** * Returns the impurity of a node . * @ param count the sample count in each class . * @ param n the number of samples in the node . * @ return the impurity of a node */ private double impurity ( int [ ] count , int n ) { } }
double impurity = 0.0 ; switch ( rule ) { case GINI : impurity = 1.0 ; for ( int i = 0 ; i < count . length ; i ++ ) { if ( count [ i ] > 0 ) { double p = ( double ) count [ i ] / n ; impurity -= p * p ; } } break ; case ENTROPY : for ( int i = 0 ; i < count . length ; i ++ ) { if ( count [ i ] > 0 ) { double p = ( dou...
public class ContextUri { /** * Returns a map of all query arguments . * @ return A map of all query arguments . */ public Map < String , String > getQuery ( ) { } }
String query = uri . getQuery ( ) ; String [ ] pairs = query . split ( "&" ) ; Map < String , String > args = new HashMap < > ( ) ; for ( String pair : pairs ) { int idx = pair . indexOf ( "=" ) ; try { args . put ( URLDecoder . decode ( pair . substring ( 0 , idx ) , "UTF-8" ) , URLDecoder . decode ( pair . substring ...
public class Input { /** * Fills the buffer with more bytes . The default implementation reads from the { @ link # getInputStream ( ) InputStream } , if set . * Can be overridden to fill the bytes from another source . * @ return - 1 if there are no more bytes . */ protected int fill ( byte [ ] buffer , int offset ...
if ( inputStream == null ) return - 1 ; try { return inputStream . read ( buffer , offset , count ) ; } catch ( IOException ex ) { throw new KryoException ( ex ) ; }
public class BatchingContextImpl { /** * In the OM implementation this method is used to flag the batching * context so that upon the next call to executeBatch the OM transaction * being used is committed . * @ param xid */ public void updateXIDToCommitted ( PersistentTranId xid ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "updateXIDToCommitted" , "XID=" + xid ) ; if ( _deferredException == null ) { // We are committing a transaction . The transaction can // be either one - phase or two - phase so we need to check // our state and then update ...
public class FPGrowth { /** * Count the support of each 1 - item . * @ param relation Data * @ param dim Maximum dimensionality * @ return Item counts */ private int [ ] countItemSupport ( final Relation < BitVector > relation , final int dim ) { } }
final int [ ] counts = new int [ dim ] ; FiniteProgress prog = LOG . isVerbose ( ) ? new FiniteProgress ( "Finding frequent 1-items" , relation . size ( ) , LOG ) : null ; for ( DBIDIter iditer = relation . iterDBIDs ( ) ; iditer . valid ( ) ; iditer . advance ( ) ) { SparseFeatureVector < ? > bv = relation . get ( idi...
public class ControllerPlugin { /** * Returns function that takes { @ link Result } and { @ link ActionContext } as parameter * and returns a { @ link Result } . This function is called after ActFramework ' s processing * has finished . * The afterHandler allows plugin to inject logic to further process the retur...
return DUMB_AFTER_HANDLER ;
public class OkRequest { /** * Write the name / value pair as form data to the request body * The pair specified will be URL - encoded in UTF - 8 and sent with the * ' application / x - www - form - urlencoded ' content - type * @ param name * @ param value * @ return this request */ public OkRequest < T > fo...
return form ( name , value , CHARSET_UTF8 ) ;
public class ModeShapeRepositoryFactoryBean { /** * Generate a JCR repository from the given configuration */ @ PostConstruct public void buildRepository ( ) { } }
try { LOGGER . info ( "Using repo config (classpath): {}" , repositoryConfiguration . getURL ( ) ) ; getPropertiesLoader ( ) . loadSystemProperties ( ) ; final RepositoryConfiguration config = RepositoryConfiguration . read ( repositoryConfiguration . getURL ( ) ) ; repository = modeShapeEngine . deploy ( config ) ; //...
public class TracksAdapter { @ Override public void dismiss ( int i ) { } }
if ( mAdapterListener != null ) { if ( mHeaderView != null ) { i -- ; } mTracks . remove ( i ) ; mAdapterListener . onTrackDismissed ( i ) ; }
public class SimpleQuery { /** * Execute the provided query and returns the result as a List of java objects * @ return the list of resulting java entities */ public < T > List < T > asList ( ) { } }
String cacheKey = null ; // is the result of the query cached ? if ( isCacheable ( ) && transaction == null ) { cacheKey = getCacheKey ( ) ; List < Key > keys = getCacheManager ( ) . get ( cacheNamespace , cacheKey ) ; if ( keys != null ) { if ( isKeysOnly ( ) ) { return ( List ) keys ; } else { final Map < Key , T > v...
public class ListDomainsResult { /** * A list of domain names that match the expression . * @ return A list of domain names that match the expression . */ public java . util . List < String > getDomainNames ( ) { } }
if ( domainNames == null ) { domainNames = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return domainNames ;
public class Command { /** * copy arguments to treat as commands */ private void copyArgumentsToCommands ( ) { } }
Iterator < Command > i = arguments . iterator ( ) ; while ( i . hasNext ( ) ) { Command cmd = i . next ( ) ; cmd . status = Command . CHILDREN_FILTERED ; operations . add ( cmd ) ; } arguments . clear ( ) ;
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 561:1 : qualifiedNameList : qualifiedName ( ' , ' qualifiedName ) * ; */ public final void qualifiedNameList ( ) throws RecognitionException { } }
int qualifiedNameList_StartIndex = input . index ( ) ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 55 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 562:5 : ( qualifiedName ( ' , ' qualifiedName ) * ) // src / main / resources / org /...
public class Matchers { /** * Inverts the given matcher . */ public static < T > Matcher < T > not ( final Matcher < ? super T > p ) { } }
return new Not < T > ( p ) ;
public class SoundManager { /** * Invoked when an activator - event occurs . * @ param event an instance of Event */ @ Override public void eventFired ( EventModel event ) { } }
if ( event . containsDescriptor ( SoundIDs . StartRequest . descriptor ) ) { Identification identification = event . getListResourceContainer ( ) . provideResource ( "izou.common.resource.selector" ) . stream ( ) . map ( ResourceModel :: getResource ) . filter ( resource -> resource instanceof Identification ) . map ( ...
public class Market { /** * Delete an order from an order book . * < p > An update event is triggered . * < p > If the order identifier is unknown , do nothing . * @ param orderId the order identifier */ public void delete ( long orderId ) { } }
Order order = orders . get ( orderId ) ; if ( order == null ) { return ; } OrderBook book = order . getOrderBook ( ) ; boolean bbo = book . update ( order . getSide ( ) , order . getPrice ( ) , - order . getRemainingQuantity ( ) ) ; orders . remove ( orderId ) ; listener . update ( book , bbo ) ;
public class Type { /** * Accessed by the TypeChecker , to override the default . */ public Type setArrayElementType ( Type elementType ) throws IntrospectionException { } }
Type type = new Type ( mGenericType , mNaturalClass ) ; type . checkForArrayLookup ( ) ; type . mArrayElementType = elementType ; return type ;
public class Schema { /** * remove in favour of PropertyColumn */ Map < String , Map < String , PropertyType > > getAllTables ( ) { } }
Map < String , Map < String , PropertyType > > result = new HashMap < > ( ) ; for ( Map . Entry < String , VertexLabel > vertexLabelEntry : this . vertexLabels . entrySet ( ) ) { String vertexQualifiedName = this . name + "." + VERTEX_PREFIX + vertexLabelEntry . getValue ( ) . getLabel ( ) ; result . put ( vertexQualif...
public class ListResourceComplianceSummariesResult { /** * A summary count for specified or targeted managed instances . Summary count includes information about compliant * and non - compliant State Manager associations , patch status , or custom items according to the filter criteria that * you specify . * < b ...
if ( this . resourceComplianceSummaryItems == null ) { setResourceComplianceSummaryItems ( new com . amazonaws . internal . SdkInternalList < ResourceComplianceSummaryItem > ( resourceComplianceSummaryItems . length ) ) ; } for ( ResourceComplianceSummaryItem ele : resourceComplianceSummaryItems ) { this . resourceComp...
public class Utils { /** * Appends the given string encoding special HTML characters . * @ param out * The StringBuilder to write to . * @ param in * Input String . * @ param start * Input String starting position . * @ param end * Input String end position . */ public final static void appendCode ( fin...
for ( int i = start ; i < end ; i ++ ) { final char c ; switch ( c = in . charAt ( i ) ) { case '&' : out . append ( "&amp;" ) ; break ; case '<' : out . append ( "&lt;" ) ; break ; case '>' : out . append ( "&gt;" ) ; break ; default : out . append ( c ) ; break ; } }
public class TieredBlockStore { /** * Creates a temp block meta only if allocator finds available space . This method will not trigger * any eviction . * @ param sessionId session id * @ param blockId block id * @ param location location to create the block * @ param initialBlockSize initial block size in byt...
// NOTE : a temp block is supposed to be visible for its own writer , unnecessary to acquire // block lock here since no sharing try ( LockResource r = new LockResource ( mMetadataWriteLock ) ) { if ( newBlock ) { checkTempBlockIdAvailable ( blockId ) ; } StorageDirView dirView = mAllocator . allocateBlockWithView ( se...
public class Files { /** * Là ¶ scht alle Dateien und Verzeichnisse in dem Ã1 ⁄ 4bergebenen Verzeichnis * @ param directory * Zu sà ¤ uberndes Verzeichnis */ public static boolean clearDirectory ( File directory ) { } }
Assert . isTrue ( directory . isDirectory ( ) , "Parameter ist kein Verzeichnis" ) ; File [ ] files = directory . listFiles ( ) ; boolean allDeleted = true ; for ( File file : files ) { if ( file . isDirectory ( ) ) { clearDirectory ( file ) ; } allDeleted &= file . delete ( ) ; } return allDeleted ;
public class IPConfig { /** * Entry point for running IPConfig . * An IP host or port identifier has to be supplied to specify the endpoint for the * KNX network access . < br > * To show the usage message of this tool on the console , supply the command line * option - help ( or - h ) . < br > * Command line...
try { new IPConfig ( args ) ; } catch ( final Throwable t ) { if ( t . getMessage ( ) != null ) System . out . println ( t . getMessage ( ) ) ; }
public class DPathUtils { private static Object createIntermediate ( Object target , StringBuffer pathSofar , String index , String nextIndex ) { } }
if ( target instanceof JsonNode ) { return createIntermediate ( ( JsonNode ) target , pathSofar , index , nextIndex ) ; } Object value = PATTERN_INDEX . matcher ( nextIndex ) . matches ( ) ? new ArrayList < Object > ( ) : new HashMap < String , Object > ( ) ; return createIntermediate ( target , pathSofar , index , val...
public class ByteArrayUtil { /** * Put the source < i > double < / i > into the destination byte array starting at the given offset * in big endian order . * There is no bounds checking . * @ param array destination byte array * @ param offset destination offset * @ param value source < i > double < / i > */ ...
putLongBE ( array , offset , Double . doubleToRawLongBits ( value ) ) ;
public class HBCIUtils { /** * Gibt zu einer gegebenen Bankleitzahl zurück , welche HBCI - Version für HBCI - PIN / TAN * bzw . RDH zu verwenden ist . Siehe auch { @ link # getHBCIVersionForBLZ ( String ) } * @ param blz * @ return HBCI - Version * @ deprecated Bitte { @ link HBCIUtils # getBankInfo ( String ...
BankInfo info = getBankInfo ( blz ) ; if ( info == null ) return "" ; return info . getPinTanVersion ( ) != null ? info . getPinTanVersion ( ) . getId ( ) : "" ;
public class TimeSeriesCountBytesSizeAccumulator { /** * Gets number . * @ param timestamp the timestamp * @ param valueFunction the value function * @ return the number */ public double getNumber ( long timestamp , Function < CountBytesSizeAccumulator , Long > valueFunction ) { } }
return JMOptional . getOptional ( this , timestamp ) . map ( valueFunction ) . map ( ( Long :: doubleValue ) ) . orElse ( 0d ) ;
public class SimpleBitSet { public static void main ( String [ ] args ) throws Exception { } }
File f = new File ( "/tmp/test.2" ) ; SimpleBitSet bs = new SimpleBitSet ( ) ; bs . set ( 1198 ) ; bs . set ( 23 ) ; serializeToFile ( f , bs ) ; bs . set ( 666 ) ; System . out . println ( bs . toString ( ) ) ; bs = deserializeFromFile ( f ) ; System . out . println ( bs . toString ( ) ) ; f . delete ( ) ;
public class ServletUtil { /** * Checks if a resource with the possibly - relative path exists . * @ deprecated Use regular methods directly * @ see ServletContext # getResource ( java . lang . String ) * @ see ServletContextCache # getResource ( java . lang . String ) * @ see ServletContextCache # getResource ...
return getResource ( servletContext , path ) != null ;
public class Utility { /** * end parseFixedLengthFloatString */ public float parseSingleFloatString ( String numberString , boolean constrained0to1 , boolean zeroOrGreater ) { } }
float [ ] value = parseFixedLengthFloatString ( numberString , 1 , constrained0to1 , zeroOrGreater ) ; return value [ 0 ] ;
public class AWSSecurityHubClient { /** * Updates the AWS Security Hub insight specified by the insight ARN . * @ param updateInsightRequest * @ return Result of the UpdateInsight operation returned by the service . * @ throws InternalException * Internal server error . * @ throws InvalidInputException * Th...
request = beforeClientExecution ( request ) ; return executeUpdateInsight ( request ) ;
public class JsonDeserializer { /** * fromJSON . * @ param response * a { @ link java . lang . String } object . * @ param target * a { @ link com . cloudcontrolled . api . response . Response } object . * @ param < T > * a T object . * @ return a { @ link com . cloudcontrolled . api . response . Response...
try { response = StandardizationUtil . getJSONStandardizer ( target ) . normalize ( response ) ; } catch ( Exception e ) { throw new SerializationException ( e ) ; } try { Response < T > fromJson = gson . fromJson ( response , target . getClass ( ) ) ; if ( fromJson == null ) { fromJson = target ; } return fromJson ; }...
public class SQLRebuilder { /** * Validate the provided options and perform any necessary startup tasks . */ @ Override public void start ( Map < String , String > options ) throws Exception { } }
// This must be done before starting " RebuildServer " // rather than after , so any application caches // ( in particular the hash map held by PIDGenerator ) // don ' t get out of sync with the database . blankExistingTables ( ) ; try { m_server = Rebuild . getServer ( ) ; // now get the connectionpool ConnectionPoolM...
public class Function { /** * Override this for GQuery methods which take a callback , but do not expect a * return value , apply to a single widget . * NOTE : If your query has non - widget elements you might need to override * ' public void f ( ) ' or ' public void f ( Element e ) ' to handle these elements and...
setElement ( w . getElement ( ) ) ; if ( loop ) { loop = false ; f ( ) ; } else { f ( w . getElement ( ) . < com . google . gwt . dom . client . Element > cast ( ) ) ; }
public class MainFrame { /** * GEN - LAST : event _ menuGoToFileActionPerformed */ private void menuUndoActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ menuUndoActionPerformed final TabTitle title = this . getFocusedTab ( ) ; if ( title != null ) { this . menuUndo . setEnabled ( title . getProvider ( ) . undo ( ) ) ; this . menuRedo . setEnabled ( title . getProvider ( ) . isRedo ( ) ) ; }
public class HttpOutboundServiceContextImpl { /** * Retrieve all remaining buffers of the response message ' s body . This will * give the buffers without any modifications , avoiding decompression or * chunked encoding removal . * A null buffer array will be returned if there is no more data to get . * The cal...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getRawResponseBodyBuffers(sync)" ) ; } setRawBody ( true ) ; WsByteBuffer [ ] list = getResponseBodyBuffers ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getRawResponseB...
public class PredefinedMetricTransformer { /** * Returns a non - null list of metric datum for the metrics collected for the * given request / response . * @ param metricType the request metric type */ public List < MetricDatum > toMetricData ( MetricType metricType , Request < ? > request , Response < ? > response...
if ( metricType instanceof Field ) { // Predefined metrics across all AWS http clients Field predefined = ( Field ) metricType ; switch ( predefined ) { case HttpClientRetryCount : case HttpClientPoolAvailableCount : case HttpClientPoolLeasedCount : case HttpClientPoolPendingCount : return metricOfCount ( predefined , ...
public class VersionString { /** * Returns the string as a map using the key " major " for the major part , the key " minor " for the minor part and the key " patch " for the patch part . * @ return map representation of the string */ public Map < String , Integer > toMap ( ) { } }
Map < String , Integer > ret = new HashMap < > ( ) ; ret . put ( "major" , this . major ) ; ret . put ( "minor" , this . minor ) ; ret . put ( "patch" , this . patch ) ; return ret ;
public class GenericFudge { /** * Fudge the return from getClass to include the generic . */ static public < T > Class < ? extends T > getClass ( T obj ) { } }
return ( Class < ? extends T > ) obj . getClass ( ) ;
public class UUID { /** * < p > Returns the node identifier found in this UUID . The specification was written such that this value holds the IEEE 802 MAC * address . The specification permits this value to be calculated from other sources other than the MAC . < / p > * @ return the node identifier found in this UU...
// if variant is not mealling leach salz throw unsupported operation exception if ( variant ( ) != VARIANT_IETF_DRAFT || version ( ) != VERSION_ONE ) { throw new UnsupportedOperationException ( WRONG_VAR_VER_MSG ) ; } if ( node == null ) { byte [ ] b = new byte [ 8 ] ; System . arraycopy ( rawBytes , 10 , b , 2 , 6 ) ;...
public class PackageIndexWriter { /** * Adds the overview summary comment for this documentation . Add one line * summary at the top of the page and generate a link to the description , * which is added at the end of this page . * @ param body the documentation tree to which the overview header will be added */ @...
addConfigurationTitle ( body ) ; if ( ! utils . getFullBody ( configuration . overviewElement ) . isEmpty ( ) ) { HtmlTree div = new HtmlTree ( HtmlTag . DIV ) ; div . addStyle ( HtmlStyle . contentContainer ) ; addOverviewComment ( div ) ; if ( configuration . allowTag ( HtmlTag . MAIN ) ) { htmlTree . addContent ( di...
public class ClassInfo { /** * Get the table name . */ public String getTableNames ( boolean bAddQuotes ) { } }
return ( m_tableName == null ) ? Record . formatTableNames ( CLASS_INFO_FILE , bAddQuotes ) : super . getTableNames ( bAddQuotes ) ;
public class LogServlet { /** * Get the log files from the directory * @ param index * @ return A { @ link File } that represent the file to read from current directory . */ private File retrieveFileFromLogsFolder ( String index ) { } }
File [ ] logFiles = getLogsDirectory ( ) . listFiles ( new LogFilesFilter ( ) ) ; File fileToReturn = null ; for ( File eachLogFile : logFiles ) { String fileName = eachLogFile . getName ( ) . split ( "\\Q.\\E" ) [ 0 ] ; if ( fileName . endsWith ( index ) ) { fileToReturn = eachLogFile ; break ; } } return fileToReturn...
public class MappingImpl { /** * clones a mapping and make it readOnly * @ param config * @ return cloned mapping * @ throws IOException */ public MappingImpl cloneReadOnly ( ConfigImpl config ) { } }
return new MappingImpl ( config , virtual , strPhysical , strArchive , inspect , physicalFirst , hidden , true , topLevel , appMapping , ignoreVirtual , appListener , listenerMode , listenerType ) ;
public class JNvgraph { /** * nvGRAPH PageRank * Find PageRank for each vertex of a graph with a given transition probabilities , a bookmark vector of dangling vertices , and the damping factor . */ public static int nvgraphPagerank ( nvgraphHandle handle , nvgraphGraphDescr descrG , long weight_index , Pointer alpha...
return checkResult ( nvgraphPagerankNative ( handle , descrG , weight_index , alpha , bookmark_index , has_guess , pagerank_index , tolerance , max_iter ) ) ;
public class InternalSimpleExpressionsParser { /** * InternalSimpleExpressions . g : 554:1 : entryRuleParenthesizedExpression returns [ EObject current = null ] : iv _ ruleParenthesizedExpression = ruleParenthesizedExpression EOF ; */ public final EObject entryRuleParenthesizedExpression ( ) throws RecognitionException...
EObject current = null ; EObject iv_ruleParenthesizedExpression = null ; try { // InternalSimpleExpressions . g : 555:2 : ( iv _ ruleParenthesizedExpression = ruleParenthesizedExpression EOF ) // InternalSimpleExpressions . g : 556:2 : iv _ ruleParenthesizedExpression = ruleParenthesizedExpression EOF { newCompositeNod...
public class MethodUtils { /** * Invoke a static method that has no parameters . * @ param objectClass invoke static method on this class * @ param methodName get method with this name * @ return the value returned by the invoked method * @ throws NoSuchMethodException if there is no such accessible method * ...
return invokeExactStaticMethod ( objectClass , methodName , EMPTY_OBJECT_ARRAY , EMPTY_CLASS_PARAMETERS ) ;
public class KeyVaultClientBaseImpl { /** * Creates a new key , stores it , then returns key parameters and attributes to the client . * The create key operation can be used to create any key type in Azure Key Vault . If the named key already exists , Azure Key Vault creates a new version of the key . It requires the...
return createKeyWithServiceResponseAsync ( vaultBaseUrl , keyName , kty ) . map ( new Func1 < ServiceResponse < KeyBundle > , KeyBundle > ( ) { @ Override public KeyBundle call ( ServiceResponse < KeyBundle > response ) { return response . body ( ) ; } } ) ;
public class TypeConvertingCompiler { /** * On Java - level the any - type is represented as java . lang . Object as there is no subtype of everything ( i . e . type for null ) . * So , when the values are used we need to manually cast them to whatever is expected . * This method tells us whether such a cast is nee...
if ( actualType instanceof AnyTypeReference ) { if ( getReferenceName ( obj , appendable ) != null ) return true ; else if ( obj instanceof XBlockExpression ) { XBlockExpression blockExpression = ( XBlockExpression ) obj ; EList < XExpression > expressions = blockExpression . getExpressions ( ) ; if ( expressions . isE...
public class XEventClasses { /** * Creates a new set of event classes , factory method . * @ param classifier * The classifier to be used for event comparison . * @ param log * The log , on which event classes should be imposed . * @ return A set of event classes , as an instance of this class . */ public sta...
XEventClasses nClasses = new XEventClasses ( classifier ) ; nClasses . register ( log ) ; nClasses . harmonizeIndices ( ) ; return nClasses ;
public class JdbcParameterFactory { /** * { @ link java . sql . Connection # createArrayOf ( String , Object [ ] ) } のラッパー * @ param conn コネクション * @ param typeName 配列の要素がマッピングされる型のSQL名 。 typeNameはデータベース固有の名前で 、 組込み型 、 ユーザー定義型 、 またはこのデータベースでサポートされる標準SQL型の名前のこと 。 これは 、 Array . getBaseTypeNameで返される値 * @...
try { return conn . createArrayOf ( typeName , elements ) ; } catch ( SQLException e ) { throw new UroborosqlRuntimeException ( e ) ; }
public class AlertIncidentsDeserializer { /** * Gson invokes this call - back method during deserialization when it encounters a field of the specified type . * @ param element The Json data being deserialized * @ param type The type of the Object to deserialize to * @ param context The JSON deserialization conte...
JsonObject obj = element . getAsJsonObject ( ) ; JsonArray incidents = obj . getAsJsonArray ( "incidents" ) ; List < AlertIncident > values = new ArrayList < AlertIncident > ( ) ; if ( incidents != null && incidents . isJsonArray ( ) ) { for ( JsonElement incident : incidents ) values . add ( gson . fromJson ( incident...
public class SessionAffinityManagerImpl { /** * analyzeSSLRequest - taken from WsSessionAffinityManager in WAS7 */ public SessionAffinityContext analyzeSSLRequest ( ServletRequest request , String sslSessionId ) { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . entering ( methodClassName , methodNames [ ANALYZE_SSL_REQUEST ] ) ; LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , methodClassName ...
public class CodeGenerator { /** * Create language alias mapping . */ private static void createLanguageAliases ( TypeSpec . Builder type , Map < String , String > languageAliases ) { } }
MethodSpec . Builder method = MethodSpec . methodBuilder ( "registerLanguageAliases" ) . addModifiers ( PRIVATE , STATIC ) ; for ( Map . Entry < String , String > entry : languageAliases . entrySet ( ) ) { method . addStatement ( "addLanguageAlias($S, $S)" , entry . getKey ( ) , entry . getValue ( ) ) ; } type . addMet...
public class GeometryCollection { /** * { @ inheritDoc } */ @ Override public JSONObject toJSON ( ) throws JSONException { } }
JSONObject json = super . toJSON ( ) ; JSONArray geometries = new JSONArray ( ) ; for ( Geometry geometry : this . mGeometries ) { geometries . put ( geometry . toJSON ( ) ) ; } json . put ( JSON_GEOMETRIES , geometries ) ; return json ;
public class BsonReader { /** * Read the binary BSON representation from supplied input stream and construct the { @ link Document } representation . * @ param input the input stream ; may not be null * @ return the in - memory { @ link Document } representation * @ throws IOException if there was a problem readi...
// Create an object so that this reader is thread safe . . . DocumentValueFactory valueFactory = VALUE_FACTORY ; Reader reader = new Reader ( new BsonDataInput ( input ) , valueFactory ) ; reader . startArray ( ) ; return ( Array ) reader . endDocument ( ) ;
public class FileSystemView { /** * Unlocks source and copy files after copying content . Also closes the source file so its content * can be deleted if it was deleted . */ private void unlockSourceAndCopy ( File sourceFile , File copyFile ) { } }
ReadWriteLock sourceLock = sourceFile . contentLock ( ) ; if ( sourceLock != null ) { sourceLock . readLock ( ) . unlock ( ) ; } ReadWriteLock copyLock = copyFile . contentLock ( ) ; if ( copyLock != null ) { copyLock . writeLock ( ) . unlock ( ) ; } sourceFile . closed ( ) ;
public class UtilAerospike { /** * Converts from AerospikeRecord to cell class with deep ' s anotations . * @ param aerospikeRecord * @ param key * @ param aerospikeConfig * @ return * @ throws IllegalAccessException * @ throws InstantiationException * @ throws InvocationTargetException */ public static C...
String namespace = aerospikeConfig . getNamespace ( ) + "." + aerospikeConfig . getSet ( ) ; String setName = aerospikeConfig . getSet ( ) ; String [ ] inputColumns = aerospikeConfig . getInputColumns ( ) ; Tuple2 < String , Object > equalsFilter = aerospikeConfig . getEqualsFilter ( ) ; String equalsFilterBin = equals...
public class Conditions { /** * Returns a { @ link ICondition condition } that is satisfied by a { @ link org . cornutum . tcases . PropertySet } that contains * between a specified minimum ( exclusive ) and maximum ( exclusive ) number of instances of a property . */ public static Between betweenExclusive ( String p...
return new Between ( moreThan ( property , minimum ) , lessThan ( property , maximum ) ) ;
public class ReportSlaveIDResponse { /** * setData - - initialize the slave ' s device dependent data when * initializing a response . * @ param data byte array */ public void setData ( byte [ ] data ) { } }
// There are always two bytes of payload in the message - - the // slave ID and the run status indicator . if ( data == null ) { m_length = 2 ; m_data = new byte [ 0 ] ; return ; } if ( data . length > 249 ) { throw new IllegalArgumentException ( "data length limit exceeded" ) ; } m_length = data . length + 2 ; m_data ...
public class ProjectApi { /** * Get a Pager of projects that were forked from the specified project . * < pre > < code > GET / projects / : id / forks < / code > < / pre > * @ param projectIdOrPath projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance , required * @ ...
return new Pager < Project > ( this , Project . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "forks" ) ;
public class TransactionTopologyBuilder { /** * Build bolt to provide the compatibility with Storm ' s ack mechanism * @ param id bolt Id * @ param bolt * @ return */ public BoltDeclarer setBoltWithAck ( String id , IRichBolt bolt , Number parallelismHint ) { } }
return setBolt ( id , new AckTransactionBolt ( bolt ) , parallelismHint ) ;
public class ResourceUtil { /** * A simple utility method to locate the outermost contextual File reference for the specified resource . * @ param r resource instance . * @ return outermost relevant file context . */ public static File getContextFile ( Resource < ? > r ) { } }
do { Object o = r . getUnderlyingResourceObject ( ) ; if ( o instanceof File ) { return ( File ) r . getUnderlyingResourceObject ( ) ; } } while ( ( r = r . getParent ( ) ) != null ) ; return null ;
public class TabPageIndicator { /** * Set the ViewPager associate with this indicator view . * @ param view The ViewPager view . */ public void setViewPager ( @ Nullable ViewPager view ) { } }
if ( mViewPager == view ) return ; if ( mViewPager != null ) { mViewPager . removeOnPageChangeListener ( this ) ; PagerAdapter adapter = mViewPager . getAdapter ( ) ; if ( adapter != null ) adapter . unregisterDataSetObserver ( mObserver ) ; } mViewPager = view ; if ( mViewPager != null ) { PagerAdapter adapter = mView...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcStructuralLoadStatic ( ) { } }
if ( ifcStructuralLoadStaticEClass == null ) { ifcStructuralLoadStaticEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 651 ) ; } return ifcStructuralLoadStaticEClass ;
public class EthereumBlockReader { /** * Reads a raw Ethereum block into a ByteBuffer . This method is recommended if you are only interested in a small part of the block and do not need the deserialization of the full block , ie in case you generally skip a lot of blocks * @ return */ public ByteBuffer readRawBlock ...
// basically an Ethereum Block is simply a RLP encoded list ByteBuffer result = null ; // get size of list this . in . mark ( 10 ) ; byte [ ] listHeader = new byte [ 10 ] ; int totalRead = 0 ; int bRead = this . in . read ( listHeader ) ; if ( bRead == - 1 ) { // no further block to read return result ; } else { totalR...
public class UNIXSocket { /** * Creates a new , unbound , " strict " { @ link UNIXSocket } . * This call uses an implementation that tries to be closer to the specification than * { @ link # newInstance ( ) } , at least for some cases . * @ return A new , unbound socket . */ public static UNIXSocket newStrictInst...
final UNIXSocketImpl impl = new UNIXSocketImpl ( ) ; UNIXSocket instance = new UNIXSocket ( impl ) ; instance . impl = impl ; return instance ;
public class AWSOrganizationsClient { /** * This action is available if all of the following are true : * < ul > * < li > * You are authorized to create accounts in the AWS GovCloud ( US ) Region . For more information on the AWS GovCloud * ( US ) Region , see the < a href = " http : / / docs . aws . amazon . c...
request = beforeClientExecution ( request ) ; return executeCreateGovCloudAccount ( request ) ;
public class Diagram { /** * Add an additional SSExtension * @ param ssExt the ssextension to set */ public boolean addSsextension ( String ssExt ) { } }
if ( this . ssextensions == null ) { this . ssextensions = new ArrayList < String > ( ) ; } return this . ssextensions . add ( ssExt ) ;
public class HtmlUtils { /** * Fake Class # getSimpleName logic . */ static String getClassSimpleName ( String className ) { } }
int lastPeriod = className . lastIndexOf ( "." ) ; if ( lastPeriod != - 1 ) { return className . substring ( lastPeriod + 1 ) ; } return className ;
public class GetRecordsResult { /** * The stream records from the shard , which were retrieved using the shard iterator . * @ param records * The stream records from the shard , which were retrieved using the shard iterator . */ public void setRecords ( java . util . Collection < Record > records ) { } }
if ( records == null ) { this . records = null ; return ; } this . records = new java . util . ArrayList < Record > ( records ) ;
public class EmailValidator { /** * { @ inheritDoc } check if given string is a valid mail . * @ see javax . validation . ConstraintValidator # isValid ( java . lang . Object , * javax . validation . ConstraintValidatorContext ) */ @ Override public final boolean isValid ( final String pvalue , final ConstraintVali...
if ( StringUtils . isEmpty ( pvalue ) ) { return true ; } if ( pvalue . length ( ) > LENGTH_MAIL ) { // Email is to long , but that ' s handled by size annotation return true ; } if ( ! StringUtils . equals ( pvalue , StringUtils . trim ( pvalue ) ) ) { // mail contains leading or trailing space ( s ) , that ' s not co...
public class Table { /** * Given a key , return an approximate byte offset in the file where * the data for that key begins ( or would begin if the key were * present in the file ) . The returned value is in terms of file * bytes , and so includes effects like compression of the underlying data . * For example ...
BlockIterator iterator = indexBlock . iterator ( ) ; iterator . seek ( key ) ; if ( iterator . hasNext ( ) ) { BlockHandle blockHandle = BlockHandle . readBlockHandle ( iterator . next ( ) . getValue ( ) . input ( ) ) ; return blockHandle . getOffset ( ) ; } // key is past the last key in the file . Approximate the off...
public class PoolStopResizeOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has not been modified since the specified time . * @ param ifUnmodifiedSince the ifUnmodifiedSince value to set * @ r...
if ( ifUnmodifiedSince == null ) { this . ifUnmodifiedSince = null ; } else { this . ifUnmodifiedSince = new DateTimeRfc1123 ( ifUnmodifiedSince ) ; } return this ;
public class StorageAccountsInner { /** * Checks that the storage account name is valid and is not already in use . * @ param name The storage account name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the CheckNameAvailabilityResultInner object */ pub...
return checkNameAvailabilityWithServiceResponseAsync ( name ) . map ( new Func1 < ServiceResponse < CheckNameAvailabilityResultInner > , CheckNameAvailabilityResultInner > ( ) { @ Override public CheckNameAvailabilityResultInner call ( ServiceResponse < CheckNameAvailabilityResultInner > response ) { return response . ...
public class DynamicOutputBuffer { /** * Gets the buffer that holds the byte at the given absolute position . * Automatically adds new internal buffers if the position lies outside * the current range of all internal buffers . * @ param position the position * @ return the buffer at the requested position */ pr...
int n = position / _bufferSize ; while ( n >= _buffers . size ( ) ) { addNewBuffer ( ) ; } return _buffers . get ( n ) ;
public class RtfDestinationFontTable { /** * Create a font via the < code > FontFactory < / code > * @ param fontName The font name to create * @ return The created < code > Font < / code > object * @ since 2.0.8 */ private Font createfont ( String fontName ) { } }
Font f1 = null ; int pos = - 1 ; do { f1 = FontFactory . getFont ( fontName ) ; if ( f1 . getBaseFont ( ) != null ) break ; // found a font , exit the do / while pos = fontName . lastIndexOf ( ' ' ) ; // find the last space if ( pos > 0 ) { fontName = fontName . substring ( 0 , pos ) ; // truncate it to the last space ...
public class HttpUtils { /** * Convert D2 URL template into a string used for throttling limiter * Valid : * d2 : / / host / $ { resource - id } * Invalid : * d2 : / / host $ { resource - id } , because we cannot differentiate the host */ public static String createR2ClientLimiterKey ( Config config ) { } }
String urlTemplate = config . getString ( HttpConstants . URL_TEMPLATE ) ; try { String escaped = URIUtil . encodeQuery ( urlTemplate ) ; URI uri = new URI ( escaped ) ; if ( uri . getHost ( ) == null ) throw new RuntimeException ( "Cannot get host part from uri" + urlTemplate ) ; String key = uri . getScheme ( ) + "/"...
public class BlockDataHandler { /** * Removes the custom data stored at the { @ link BlockPos } for the specified identifier and eventually sends it to clients watching the * chunk . * @ param < T > the generic type * @ param identifier the identifier * @ param world the world * @ param pos the pos * @ para...
setData ( identifier , world , pos , null , sendToClients ) ;
public class ParseUtils { /** * Get an exception reporting an unexpected XML element . * @ param reader the stream reader * @ return the exception */ public static XMLStreamException unexpectedElement ( final XMLExtendedStreamReader reader , Set < String > possible ) { } }
final XMLStreamException ex = ControllerLogger . ROOT_LOGGER . unexpectedElement ( reader . getName ( ) , asStringList ( possible ) , reader . getLocation ( ) ) ; return new XMLStreamValidationException ( ex . getMessage ( ) , ValidationError . from ( ex , ErrorType . UNEXPECTED_ELEMENT ) . element ( reader . getName (...
public class Selenium2Script { /** * Selenium IDEのテストスクリプト ( html ) をSIT - WTのテストスクリプト ( csv ) に変換します 。 * @ return 0 : 正常終了 */ public int execute ( ) { } }
int ret = 0 ; for ( String seleniumScriptDir : seleniumScriptDirs . split ( "," ) ) { File scriptDir = new File ( seleniumScriptDir ) ; if ( ! scriptDir . exists ( ) ) { continue ; } boolean recursive = ! "." . equals ( seleniumScriptDir ) ; for ( File seleniumScript : FileUtils . listFiles ( scriptDir , new String [ ]...
public class Config { /** * Read config object stored in YAML format from < code > String < / code > * @ param content of config * @ return config * @ throws IOException error */ public static Config fromYAML ( String content ) throws IOException { } }
ConfigSupport support = new ConfigSupport ( ) ; return support . fromYAML ( content , Config . class ) ;
public class CPDAvailabilityEstimateUtil { /** * Returns the cpd availability estimate where CProductId = & # 63 ; or throws a { @ link NoSuchCPDAvailabilityEstimateException } if it could not be found . * @ param CProductId the c product ID * @ return the matching cpd availability estimate * @ throws NoSuchCPDAv...
return getPersistence ( ) . findByCProductId ( CProductId ) ;
public class JoinListener { /** * Automatically create a join from a node and a join class . * This will automatically get the left and right hand refs * and will construct a new join specified by the type using reflection . * It will also add an parsed location to the join . * @ node * @ type00 */ private vo...
QueryNode left = relationChain . get ( relationIdx ) ; QueryNode right = relationChain . get ( relationIdx + 1 ) ; try { Constructor < ? extends Join > c = type . getConstructor ( QueryNode . class ) ; Join newJoin = c . newInstance ( right ) ; left . addOutgoingJoin ( addParsedLocation ( ctx , newJoin ) ) ; } catch ( ...
public class InodeLockManager { /** * Attempts to acquire an inode lock . * @ param inodeId the inode id to try locking * @ param mode the mode to lock in * @ return either an empty optional , or a lock resource which must be closed to release the lock */ public Optional < LockResource > tryLockInode ( Long inode...
return mInodeLocks . tryGet ( inodeId , mode ) ;
public class JSONTokener { /** * Get the hex value of a character ( base16 ) . < p > * @ param c a character between ' 0 ' and ' 9 ' or between ' A ' and ' F ' or * between ' a ' and ' f ' * @ return an int between 0 and 15 , or - 1 if c was not a hex digit */ public static int dehexchar ( char c ) { } }
if ( ( c >= '0' ) && ( c <= '9' ) ) { return c - '0' ; } if ( ( c >= 'A' ) && ( c <= 'F' ) ) { return c - ( 'A' - 10 ) ; } if ( ( c >= 'a' ) && ( c <= 'f' ) ) { return c - ( 'a' - 10 ) ; } return - 1 ;
public class CPDefinitionOptionValueRelLocalServiceWrapper { /** * Deletes the cp definition option value rel from the database . Also notifies the appropriate model listeners . * @ param cpDefinitionOptionValueRel the cp definition option value rel * @ return the cp definition option value rel that was removed *...
return _cpDefinitionOptionValueRelLocalService . deleteCPDefinitionOptionValueRel ( cpDefinitionOptionValueRel ) ;
public class BookmarksApi { /** * List bookmarks A list of your character & # 39 ; s personal bookmarks - - - This * route is cached for up to 3600 seconds SSO Scope : * esi - bookmarks . read _ character _ bookmarks . v1 * @ param characterId * An EVE character ID ( required ) * @ param datasource * The se...
com . squareup . okhttp . Call call = getCharactersCharacterIdBookmarksValidateBeforeCall ( characterId , datasource , ifNoneMatch , page , token , null ) ; Type localVarReturnType = new TypeToken < List < CharacterBookmarksResponse > > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class ConcurrentMultiCache { /** * Places the specified item in the cache . It will not replace an existing * item in the cache . Instead , if an item already exists in the cache , it * will make sure that item is cached across all identifiers and then return * the cached item . * @ param item the item t...
HashMap < String , Object > keys ; if ( item == null ) { throw new NullPointerException ( "Multi caches may not have null values." ) ; } keys = getKeys ( item ) ; synchronized ( this ) { item = getCurrent ( item ) ; for ( String key : caches . keySet ( ) ) { ConcurrentCache < Object , T > cache = caches . get ( key ) ;...
public class InternalSARLParser { /** * InternalSARL . g : 13146:1 : entryRuleXPostfixOperation returns [ EObject current = null ] : iv _ ruleXPostfixOperation = ruleXPostfixOperation EOF ; */ public final EObject entryRuleXPostfixOperation ( ) throws RecognitionException { } }
EObject current = null ; EObject iv_ruleXPostfixOperation = null ; try { // InternalSARL . g : 13146:58 : ( iv _ ruleXPostfixOperation = ruleXPostfixOperation EOF ) // InternalSARL . g : 13147:2 : iv _ ruleXPostfixOperation = ruleXPostfixOperation EOF { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAcces...