signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class Cells { /** * Returns the Cell ( associated to the default table ) whose name is < i > cellName < / i > , or null if this Cells object * contains no cell whose name is cellName . * @ param cellName the name of the Cell we want to retrieve from this Cells object . * @ return the Cell whose name is cel...
Set < String > keys = cells . keySet ( ) ; for ( String key : keys ) { List < Cell > cellList = cells . get ( key ) ; for ( Cell c : cellList ) { if ( c . getCellName ( ) . equals ( cellName ) ) { return c ; } } } return null ;
public class BytesHashMap { /** * Append an value into the hash map ' s record area . * @ return An BinaryRow mapping to the memory segments in the map ' s record area belonging to * the newly appended value . * @ throws EOFException if the map can ' t allocate much more memory . */ public BinaryRow append ( Look...
try { if ( numElements >= growthThreshold ) { growAndRehash ( ) ; // update info ' s bucketSegmentIndex and bucketOffset lookup ( info . key ) ; } BinaryRow toAppend = hashSetMode ? reusedValue : value ; long pointerToAppended = recordArea . appendRecord ( info . key , toAppend ) ; bucketSegments . get ( info . bucketS...
public class SocksProxyConstants { /** * Return the string associated with the specified reply code . * @ param code the reply code * @ return the reply string */ public static String getReplyCodeAsString ( byte code ) { } }
switch ( code ) { // v4 & v4a codes case V4_REPLY_REQUEST_GRANTED : return "Request granted" ; case V4_REPLY_REQUEST_REJECTED_OR_FAILED : return "Request rejected or failed" ; case V4_REPLY_REQUEST_FAILED_NO_IDENTD : return "Request failed because client is not running identd (or not reachable from the server)" ; case ...
public class NatureRecognition { /** * 获取一个词语的参数 * @ param word * @ return */ public String [ ] getParams ( String word ) { } }
for ( Forest forest : forests ) { if ( forest == null ) { continue ; } SmartForest < String [ ] > sf = forest ; for ( int i = 0 ; i < word . length ( ) ; i ++ ) { sf = sf . get ( word . charAt ( i ) ) ; if ( sf == null ) { return null ; } } if ( sf . getStatus ( ) > 1 ) { return sf . getParam ( ) ; } else { return null...
public class EqualityComparisonBaseTreeNode { /** * but I can ' t get ANTLR to generated nested tree with added node . */ protected Predicate < Object > getEqualFilter ( ) { } }
String xpath = getXPath ( getChild ( 0 ) ) ; Tree valueNode = getChild ( 1 ) ; switch ( valueNode . getType ( ) ) { case NUMBER : Number value = ( Number ) ( ( ValueTreeNode ) valueNode ) . getValue ( ) ; return new PathValueEventFilter ( xpath , new NumericValuePredicate ( value , "=" ) ) ; case STRING : String sValue...
public class AmazonEC2Client { /** * Modifies the specified VPC attachment . * @ param modifyTransitGatewayVpcAttachmentRequest * @ return Result of the ModifyTransitGatewayVpcAttachment operation returned by the service . * @ sample AmazonEC2 . ModifyTransitGatewayVpcAttachment * @ see < a href = " http : / / ...
request = beforeClientExecution ( request ) ; return executeModifyTransitGatewayVpcAttachment ( request ) ;
public class IDESizeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setIDESZ ( Integer newIDESZ ) { } }
Integer oldIDESZ = idesz ; idesz = newIDESZ ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . IDE_SIZE__IDESZ , oldIDESZ , idesz ) ) ;
public class Compiler { /** * Compile a literal string value . * @ param opPos The current position in the m _ opMap array . * @ return reference to { @ link org . apache . xpath . objects . XString } instance . * @ throws TransformerException if a error occurs creating the Expression . */ protected Expression li...
opPos = getFirstChildPos ( opPos ) ; return ( XString ) getTokenQueue ( ) . elementAt ( getOp ( opPos ) ) ;
public class JdkCompiler { /** * httl . properties : java . specification . version = 1.7 */ public void setCompileVersion ( String version ) { } }
if ( StringUtils . isNotEmpty ( version ) && ! version . equals ( ClassUtils . getJavaVersion ( ) ) ) { options . add ( "-target" ) ; options . add ( version ) ; lintOptions . add ( "-target" ) ; lintOptions . add ( version ) ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.drugbank.ca" , name = "allele" , scope = SnpAdverseDrugReactionType . class ) public JAXBElement < String > createSnpAdverseDrugReactionTypeAllele (...
return new JAXBElement < String > ( _SnpAdverseDrugReactionTypeAllele_QNAME , String . class , SnpAdverseDrugReactionType . class , value ) ;
public class Event { /** * Causes the invoking thread to wait until the processing of the * event has been completed ( see { @ link # isDone ( ) } ) or given timeout * has expired and returns the list of results ( which may be empty * if the event ' s result type is { @ link Void } ) . * @ return the results ...
synchronized ( this ) { if ( completed ) { return results == null ? Collections . emptyList ( ) : Collections . unmodifiableList ( results ) ; } wait ( unit . toMillis ( timeout ) ) ; } if ( completed ) { return results == null ? Collections . emptyList ( ) : Collections . unmodifiableList ( results ) ; } throw new Tim...
public class MessageToEventMapper { /** * Handle content length . * @ param event * the event */ private void handleContentLength ( Event event ) { } }
if ( event . getContent ( ) == null ) { return ; } if ( maxContentLength == - 1 || event . getContent ( ) . length ( ) <= maxContentLength ) { return ; } if ( maxContentLength < CUT_START_TAG . length ( ) + CUT_END_TAG . length ( ) ) { event . setContent ( "" ) ; event . setContentCut ( true ) ; return ; } int contentL...
public class Connection { /** * Returns the value of the given parameter as < code > String < / code > . * @ param textKey The name of the parameter . * @ return The value of this parameter . * @ throws OperationalTextKeyException If the given parameter cannot be found . */ public final String getSetting ( final ...
return configuration . getSetting ( referenceSession . getTargetName ( ) , connectionID , textKey ) ;
public class RqFormBase { /** * Create map of request parameters . * @ return Parameters map or empty map in case of error . * @ throws IOException If something fails reading or parsing body */ private Map < String , List < String > > map ( ) throws IOException { } }
if ( this . saved . isEmpty ( ) ) { this . saved . add ( this . freshMap ( ) ) ; } return this . saved . get ( 0 ) ;
public class Tokenizer { /** * Returns a string that contains a copy of a specified string * without leading whitespaces . * @ param string the string to trim leading whitespaces * @ return a string with leading whitespaces trimmed */ private static String trimLeadingWhitespace ( String string ) { } }
if ( string . isEmpty ( ) ) { return string ; } int start = 0 ; char c ; for ( int i = 0 ; i < string . length ( ) ; i ++ ) { c = string . charAt ( i ) ; if ( ! Character . isWhitespace ( c ) ) { start = i ; break ; } } if ( start == 0 ) { return string ; } return string . substring ( start ) ;
public class DiscordWebSocketAdapter { /** * Sends the resume packet . * @ param websocket The websocket the resume packet should be sent to . */ private void sendResume ( WebSocket websocket ) { } }
ObjectNode resumePacket = JsonNodeFactory . instance . objectNode ( ) . put ( "op" , GatewayOpcode . RESUME . getCode ( ) ) ; resumePacket . putObject ( "d" ) . put ( "token" , api . getPrefixedToken ( ) ) . put ( "session_id" , sessionId ) . put ( "seq" , lastSeq ) ; logger . debug ( "Sending resume packet" ) ; websoc...
public class AccountsInner { /** * Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account . The response includes a link to the next page , if any . * @ param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account . * @ param...
ServiceResponse < Page < DataLakeStoreAccountInfoInner > > response = listDataLakeStoreAccountsSinglePageAsync ( resourceGroupName , accountName ) . toBlocking ( ) . single ( ) ; return new PagedList < DataLakeStoreAccountInfoInner > ( response . body ( ) ) { @ Override public Page < DataLakeStoreAccountInfoInner > nex...
public class Group { /** * Issue a < code > get / / PROJECT / NET _ ID / GROUP _ ID Level < / code > to the C - Gate server . * @ see < a href = " http : / / www . clipsal . com / cis / downloads / Toolkit / CGateServerGuide _ 1_0 . pdf " > * < i > C - Gate Server Guide 4.3.44 < / i > < / a > * @ throws CGateExce...
ArrayList < String > resp_array = getCGateSession ( ) . sendCommand ( "get " + getProjectAddress ( ) + "/" + getResponseAddress ( true ) + " Level" ) . toArray ( ) ; String level_str = responseToMap ( resp_array . get ( 0 ) ) . get ( "Level" ) ; return level_str == null ? 0 : Integer . valueOf ( level_str ) ;
public class ShowEvent { /** * Fires a show event on all registered handlers in the handler manager . If * no such handlers exist , this method will do nothing . * @ param source the source of the handlers */ public static void fire ( final HasShowHandlers source ) { } }
if ( TYPE != null ) { ShowEvent event = new ShowEvent ( ) ; source . fireEvent ( event ) ; }
public class RunningJobsImpl { /** * A guarded remove ( ) that throws an exception if no RunningJob is known for this id . * @ param jobIdentifier */ private synchronized void remove ( final String jobIdentifier ) { } }
final RunningJobImpl result = this . jobs . remove ( jobIdentifier ) ; if ( null == result ) { throw new RuntimeException ( "Trying to remove a RunningJob that is unknown: " + jobIdentifier ) ; }
public class Utils { /** * Copies the content from inputFile into an output stream . * @ param inputFile an input file ( must be a file and exist ) * @ param os the output stream * @ throws IOException if something went wrong */ public static void copyStream ( File inputFile , OutputStream os ) throws IOException...
InputStream is = new FileInputStream ( inputFile ) ; try { copyStreamUnsafelyUseWithCaution ( is , os ) ; } finally { is . close ( ) ; }
public class VerboseFormatter { /** * Append log level . * @ param message The message builder . * @ param event The log record . */ private static void appendLevel ( StringBuilder message , LogRecord event ) { } }
final String logLevel = event . getLevel ( ) . getName ( ) ; for ( int i = logLevel . length ( ) ; i < LOG_LEVEL_LENGTH ; i ++ ) { message . append ( Constant . SPACE ) ; } message . append ( logLevel ) . append ( Constant . DOUBLE_DOT ) ;
public class JDBCDatabaseMetaData { /** * Retrieves whether this database is in read - only mode . * < ! - - start release - specific documentation - - > * < div class = " ReleaseSpecificDocumentation " > * < h3 > HSQLDB - Specific Information : < / h3 > < p > * Starting with 1.7.2 , this makes * an SQL call ...
ResultSet rs = execute ( "CALL isReadOnlyDatabase()" ) ; rs . next ( ) ; boolean result = rs . getBoolean ( 1 ) ; rs . close ( ) ; return result ;
public class DefaultBackendSecurity { /** * Parses the beSecurity configuration file . * @ throws BackendSecurityParserException * If an error occurs in attempting to parse the beSecurity * configuration file . */ public BackendSecuritySpec parseBeSecurity ( ) throws BackendSecurityParserException { } }
try { BackendSecurityDeserializer bsd = new BackendSecurityDeserializer ( m_encoding , m_validate ) ; return bsd . deserialize ( m_beSecurityPath ) ; } catch ( Throwable th ) { throw new BackendSecurityParserException ( "[DefaultBackendSecurity] " + "An error has occured in parsing the backend security " + "configurati...
public class TimeUtils { /** * Compute the number of seconds from the Proleptic Gregorian epoch * to the given time . */ public static long secsSinceEpoch ( DateValue date ) { } }
long result = fixedFromGregorian ( date ) * SECS_PER_DAY ; if ( date instanceof TimeValue ) { TimeValue time = ( TimeValue ) date ; result += time . second ( ) + 60 * ( time . minute ( ) + 60 * time . hour ( ) ) ; } return result ;
public class HttpServer { /** * Set the request log . * @ param log RequestLog to use . */ public synchronized void setRequestLog ( RequestLog log ) { } }
if ( _requestLog != null ) removeComponent ( _requestLog ) ; _requestLog = log ; if ( _requestLog != null ) addComponent ( _requestLog ) ;
public class GridLayoutRenderer { /** * Paints the given WPanel ' s children . * @ param component the container to paint . * @ param renderContext the RenderContext to paint to . */ @ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } }
WPanel panel = ( WPanel ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; GridLayout layout = ( GridLayout ) panel . getLayout ( ) ; Size hgap = layout . getHorizontalGap ( ) ; String hgapString = hgap == null ? null : hgap . toString ( ) ; Size vgap = layout . getVerticalGap ( ) ; String vgapString ...
public class ListConnectorDefinitionsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListConnectorDefinitionsRequest listConnectorDefinitionsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listConnectorDefinitionsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listConnectorDefinitionsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( listConnectorDefinitionsRequest . getNextTok...
public class FeatureDependencyChecker { /** * Verfiy whether the feature is uninstallable and there is no other installed * features still require this feature . * @ param uninstallAsset feature to be uninstalled * @ param installedFeatures installed features * @ return the name / symbolic name of the feature w...
Collection < ProvisioningFeatureDefinition > requiredByTheseFeatures = requiresThisFeature ( uninstallAsset . getProvisioningFeatureDefinition ( ) . getSymbolicName ( ) , installedFeatureDefinitions , uninstallInstallFeatures , isChecking ) ; Collection < ProvisioningFeatureDefinition > temp = new ArrayList < Provision...
public class QueueListenerFactory { /** * Get jobs from the specified queues . * When there are jobs in more than one of the queues , the command guarantees to return jobs in the order the queues are * specified . If COUNT allows more jobs to be returned , queues are scanned again and again in the same order poppin...
return new GetJobsBuilder ( ) . getjobs ( timeout , timeUnit , count ) ;
public class SystemIntents { /** * Intent that should open either the Google Play app or if not available , the web browser on the Google Play website * @ param context The context associated to the application * @ param packageName The package name of the application to find on the market * @ return the intent f...
Intent intent = new Intent ( Intent . ACTION_VIEW , Uri . parse ( "market://details?id=" + packageName ) ) ; if ( ! IntentUtils . isIntentAvailable ( context , intent ) ) { intent = MediaIntents . newOpenWebBrowserIntent ( "https://play.google.com/store/apps/details?id=" + packageName ) ; } if ( intent != null ) { inte...
public class Kryo { /** * Reads an object using the registered serializer . */ public < T > T readObject ( Input input , Class < T > type ) { } }
if ( input == null ) throw new IllegalArgumentException ( "input cannot be null." ) ; if ( type == null ) throw new IllegalArgumentException ( "type cannot be null." ) ; beginObject ( ) ; try { T object ; if ( references ) { int stackSize = readReferenceOrNull ( input , type , false ) ; if ( stackSize == REF ) return (...
public class JMMap { /** * Gets entry stream with filter . * @ param < K > the type parameter * @ param < V > the type parameter * @ param map the map * @ param predicate the predicate * @ return the entry stream with filter */ public static < K , V > Stream < Entry < K , V > > getEntryStreamWithFilter ( Map ...
return buildEntryStream ( map ) . filter ( predicate ) ;
public class TypeUtil { /** * @ return The least restrictive data type of two numeric data types . * @ see DataType # INTEGER * @ see DataType # FLOAT * @ see DataType # DOUBLE */ static public DataType getCommonDataType ( DataType left , DataType right ) { } }
if ( ( left ) . equals ( right ) ) { switch ( left ) { case DOUBLE : case FLOAT : case INTEGER : return left ; } } else if ( ( DataType . DOUBLE ) . equals ( left ) ) { if ( ( DataType . FLOAT ) . equals ( right ) || ( DataType . INTEGER ) . equals ( right ) ) { return left ; } } else if ( ( DataType . FLOAT ) . equals...
public class CommerceOrderUtil { /** * Returns all the commerce orders where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ return the matching commerce orders */ public static List < CommerceOrder > findByUuid_C ( String uuid , long companyId ) { } }
return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ;
public class GeographyValue { /** * A helper function to validate the loop structure * If loop is invalid , it generates IllegalArgumentException exception */ private static < T > void diagnoseLoop ( List < T > loop , String excpMsgPrf ) throws IllegalArgumentException { } }
if ( loop == null ) { throw new IllegalArgumentException ( excpMsgPrf + "a polygon must contain at least one ring " + "(with each ring at least 4 points, including repeated closing vertex)" ) ; } // 4 vertices = 3 unique vertices for polygon + 1 end point which is same as start point if ( loop . size ( ) < 4 ) { throw ...
public class ThreadPoolManager { /** * 新建一个受管理的单线程池 , 你不需要注定关闭线程池 , 管理器会帮你关闭的 * 注意 : 请复用 , 而不要频繁构造线程池 */ public static ExecutorService newSingleThreadPoolExecutor ( ) { } }
ExecutorService singleThreadPoolExecutor = Executors . newSingleThreadExecutor ( ) ; EXECUTORS . add ( singleThreadPoolExecutor ) ; return singleThreadPoolExecutor ;
public class MaterialComboBox { /** * Will automatically check for allowClear option to display / hide the * arrow caret . */ protected void displayArrowForAllowClearOption ( boolean displayArrow ) { } }
if ( isAllowClear ( ) ) { if ( displayArrow && getArrowIconElement ( ) != null ) { getArrowIconElement ( ) . css ( "display" , "block" ) ; } else { getArrowIconElement ( ) . css ( "display" , "none" ) ; } }
public class CPFriendlyURLEntryPersistenceImpl { /** * Returns the cp friendly url entry where groupId = & # 63 ; and classNameId = & # 63 ; and classPK = & # 63 ; and languageId = & # 63 ; and urlTitle = & # 63 ; or throws a { @ link NoSuchCPFriendlyURLEntryException } if it could not be found . * @ param groupId th...
CPFriendlyURLEntry cpFriendlyURLEntry = fetchByG_C_C_L_U ( groupId , classNameId , classPK , languageId , urlTitle ) ; if ( cpFriendlyURLEntry == null ) { StringBundler msg = new StringBundler ( 12 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; msg . append ( ",...
public class HomeResolver { /** * Method that changes any string starting with ~ to user . home property . * @ param path * to change . * @ return String with ~ changed . */ public static String resolveHomeDirectory ( String path ) { } }
if ( path . startsWith ( "~" ) ) { return path . replace ( "~" , System . getProperty ( "user.home" ) ) ; } return path ;
public class AsyncGroup { /** * Handle exceptions that callback function thrown . < br > * if there ' s already an exception thrown when this method invoked , the * handling process would be taken in current thread . < br > * Otherwise , the process would be taken at callback thread when * exception occurred . ...
while ( ! inProcess ) { // block Style . sleep ( 1 ) ; } synchronized ( lock ) { this . handler = handler ; if ( err != null ) { handler . apply ( err ) ; } }
public class Cache { /** * F86406 */ public void introspect ( IntrospectionWriter writer ) { } }
writer . begin ( "Cache : " + this ) ; writer . println ( "Name of Cache: " + this . ivName ) ; writer . println ( "Number of buckets: " + this . numBuckets ) ; synchronized ( this ) { writer . println ( "Number of objects currently in cache: " + numObjects ) ; writer . println ( "Number of evictions attempted (since l...
public class OkHttp { /** * Get a response to a GET request for the URL and headers . */ public Response response ( String url , String ... headers ) throws IOException { } }
return call ( url , headers ) . execute ( ) ;
public class ValueClientExample { /** * Starts the client . */ public static void main ( String [ ] args ) throws Exception { } }
if ( args . length < 1 ) throw new IllegalArgumentException ( "must supply a set of host:port tuples" ) ; // Build a list of all member addresses to which to connect . List < Address > members = new ArrayList < > ( ) ; for ( String arg : args ) { String [ ] parts = arg . split ( ":" ) ; members . add ( new Address ( pa...
public class MessageAction { /** * Clears all previously added files * @ param finalizer * BiConsumer useful to < b > close < / b > remaining resources , * the consumer will receive the name as a string parameter and the resource as { @ code InputStream } . * @ return Updated MessageAction for chaining convenie...
Checks . notNull ( finalizer , "Finalizer" ) ; for ( Iterator < Map . Entry < String , InputStream > > it = files . entrySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { Map . Entry < String , InputStream > entry = it . next ( ) ; finalizer . accept ( entry . getKey ( ) , entry . getValue ( ) ) ; it . remove ( ) ; } cle...
public class MkAppTree { /** * Determines the maximum and minimum number of entries in a node . */ @ Override protected void initializeCapacities ( MkAppEntry exampleLeaf ) { } }
int distanceSize = ByteArrayUtil . SIZE_DOUBLE ; // exampleLeaf . getParentDistance ( ) . externalizableSize ( ) ; // overhead = index ( 4 ) , numEntries ( 4 ) , id ( 4 ) , isLeaf ( 0.125) double overhead = 12.125 ; if ( getPageSize ( ) - overhead < 0 ) { throw new RuntimeException ( "Node size of " + getPageSize ( ) +...
public class InteractionWrapper { /** * Binds to participants and controllers . */ @ Override public void initDownstream ( ) { } }
for ( Entity entity : interaction . getParticipant ( ) ) { addToDownstream ( entity , getGraph ( ) ) ; } for ( Control control : interaction . getControlledOf ( ) ) { addToDownstream ( control , getGraph ( ) ) ; }
public class MemoryManager { /** * Called on any OOM allocation */ static void set_goals ( String msg , boolean oom , long bytes ) { } }
// Our best guess of free memory , as of the last GC cycle final long heapUsedGC = Cleaner . HEAP_USED_AT_LAST_GC ; final long timeGC = Cleaner . TIME_AT_LAST_GC ; final long freeHeap = MEM_MAX - heapUsedGC ; assert freeHeap >= 0 : "I am really confused about the heap usage; MEM_MAX=" + MEM_MAX + " heapUsedGC=" + heapU...
public class DescribeScheduledActionsResult { /** * Information about the scheduled actions . * @ param scheduledActions * Information about the scheduled actions . */ public void setScheduledActions ( java . util . Collection < ScheduledAction > scheduledActions ) { } }
if ( scheduledActions == null ) { this . scheduledActions = null ; return ; } this . scheduledActions = new java . util . ArrayList < ScheduledAction > ( scheduledActions ) ;
public class IoUtil { /** * 拷贝文件流 , 使用NIO * @ param in 输入 * @ param out 输出 * @ return 拷贝的字节数 * @ throws IORuntimeException IO异常 */ public static long copy ( FileInputStream in , FileOutputStream out ) throws IORuntimeException { } }
Assert . notNull ( in , "FileInputStream is null!" ) ; Assert . notNull ( out , "FileOutputStream is null!" ) ; final FileChannel inChannel = in . getChannel ( ) ; final FileChannel outChannel = out . getChannel ( ) ; try { return inChannel . transferTo ( 0 , inChannel . size ( ) , outChannel ) ; } catch ( IOException ...
public class EventFilterLexer { /** * $ ANTLR start " GT " */ public final void mGT ( ) throws RecognitionException { } }
try { int _type = GT ; int _channel = DEFAULT_TOKEN_CHANNEL ; // EventFilter . g : 39:4 : ( ' > ' ) // EventFilter . g : 39:6 : ' > ' { match ( '>' ) ; } state . type = _type ; state . channel = _channel ; } finally { // do for sure before leaving }
public class SecurityContext { /** * Use securityForOperation instead * @ since 2.8.1 * @ param path path to secure * @ return list of applicable security references * @ deprecated { @ link SecurityContext # securityForOperation } */ @ Deprecated public List < SecurityReference > securityForPath ( String path )...
if ( selector . test ( path ) ) { return securityReferences ; } return new ArrayList < SecurityReference > ( ) ;
public class FileSystem { /** * Replace the special characters by HTML entities . * @ param string the string to decode . * @ return decoded string or { @ code s } . */ private static String encodeHTMLEntities ( String string ) { } }
if ( string == null ) { return null ; } try { return URLEncoder . encode ( string , Charset . defaultCharset ( ) . displayName ( ) ) ; } catch ( UnsupportedEncodingException exception ) { return string ; }
public class URLEncodedUtils { /** * Encode a String using the { @ link # FRAGMENT } set of characters . * Used by URIBuilder to encode the userinfo segment . * @ param content the string to encode , does not convert space to ' + ' * @ param charset the charset to use * @ return the encoded string */ static Str...
return urlencode ( content , charset , FRAGMENT , false ) ;
public class MicroMetaDao { /** * 锟斤拷荼锟斤拷锟斤拷询锟斤拷录锟斤拷 */ public int queryObjCountByCondition ( String tableName , String condition , Object [ ] paramArray ) { } }
/* JdbcTemplate jdbcTemplate = ( JdbcTemplate ) MicroDbHolder . getDbSource ( dbName ) ; */ // String tableName = changeTableNameCase ( otableName ) ; JdbcTemplate jdbcTemplate = getMicroJdbcTemplate ( ) ; String sql = "" ; sql = "select count(1) from " + tableName + " where " + condition ; logger . debug ( sql ) ; l...
public class ODataJsonParser { /** * Gets the entity type name . * @ return the entity type * @ throws ODataUnmarshallingException */ private String getEntityName ( ) throws ODataUnmarshallingException { } }
String odataType = odataValues . get ( JsonConstants . TYPE ) ; if ( isNullOrEmpty ( odataType ) ) { TargetType targetType = getTargetType ( ) ; if ( targetType == null ) { throw new ODataUnmarshallingException ( "Could not find entity name" ) ; } return targetType . typeName ( ) ; } else { if ( odataType . startsWith ...
public class AWSResourceGroupsClient { /** * Returns a list of ARNs of resources that are members of a specified resource group . * @ param listGroupResourcesRequest * @ return Result of the ListGroupResources operation returned by the service . * @ throws UnauthorizedException * The request has not been applie...
request = beforeClientExecution ( request ) ; return executeListGroupResources ( request ) ;
public class Solo { /** * Long clicks the specified coordinates . * @ param x the x coordinate * @ param y the y coordinate */ public void clickLongOnScreen ( float x , float y ) { } }
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickLongOnScreen(" + x + ", " + y + ")" ) ; } clicker . clickLongOnScreen ( x , y , 0 , null ) ;
public class MergePath { /** * Adds a new path to the end of the merge path . * @ param path the new path to search */ public void addMergePath ( PathImpl path ) { } }
if ( ! ( path instanceof MergePath ) ) { // Need to normalize so directory paths ends with a " . / " // XXX : // if ( path . isDirectory ( ) ) // path = path . lookup ( " . / " ) ; ArrayList < PathImpl > pathList = ( ( MergePath ) _root ) . _pathList ; if ( ! pathList . contains ( path ) ) pathList . add ( path ) ; } e...
public class GroupMatcher { /** * Create a GroupMatcher that matches groups ending with the given string . */ public static < T extends Key < T > > GroupMatcher < T > groupEndsWith ( final String compareTo ) { } }
return new GroupMatcher < > ( compareTo , StringOperatorName . ENDS_WITH ) ;
public class vlan { /** * Use this API to update vlan . */ public static base_response update ( nitro_service client , vlan resource ) throws Exception { } }
vlan updateresource = new vlan ( ) ; updateresource . id = resource . id ; updateresource . aliasname = resource . aliasname ; updateresource . ipv6dynamicrouting = resource . ipv6dynamicrouting ; return updateresource . update_resource ( client ) ;
public class TargetMethodFinder { /** * public void post ( TaskCacheFragmentInterface cacheFragment , Object result , Task < ? > task ) { * Pair < Method , Object > target = getMethod ( cacheFragment , getResultType ( result , task ) , task ) ; * if ( target ! = null ) { * invoke ( target , result , task ) ; */ p...
Pair < Method , Object > pair = findMethodInActivity ( activity , activity . getClass ( ) , resultType , annotation , task ) ; if ( pair != null ) { return pair ; } return findMethodInFragmentManager ( FragmentHack . getFragmentManager ( activity ) , resultType , annotation , task , compareFragmentIndex ) ;
public class AnalyticFormulas { /** * Calculates the Black - Scholes option value of a call , i . e . , the payoff max ( S ( T ) - K , 0 ) P , where S follows a log - normal process with constant log - volatility . * The model specific quantities are considered to be random variable , i . e . , * the function may c...
if ( optionMaturity < 0 ) { return forward . mult ( 0.0 ) ; } else { RandomVariable dPlus = forward . div ( optionStrike ) . log ( ) . add ( volatility . squared ( ) . mult ( 0.5 * optionMaturity ) ) . div ( volatility ) . div ( Math . sqrt ( optionMaturity ) ) ; RandomVariable dMinus = dPlus . sub ( volatility . mult ...
public class FunctionSQL { /** * Evaluates and returns this Function in the context of the session . < p > */ @ Override public Object getValue ( Session session ) { } }
Object [ ] data = new Object [ nodes . length ] ; for ( int i = 0 ; i < nodes . length ; i ++ ) { Expression e = nodes [ i ] ; if ( e != null ) { data [ i ] = e . getValue ( session , e . dataType ) ; } } return getValue ( session , data ) ;
public class JPEGDecoder { /** * Starts the decode process . This will advance the JPEG stream to the start * of the image data . It also checks if that JPEG file can be decoded by this * library . * @ return true if the JPEG can be decoded . * @ throws IOException if an IO error occurred */ public boolean star...
if ( insideSOS ) { throw new IllegalStateException ( "decode already started" ) ; } if ( foundEOI ) { return false ; } decodeHeader ( ) ; int m = getMarker ( ) ; while ( m != 0xD9 ) { // EOI if ( m == 0xDA ) { // SOS processScanHeader ( ) ; insideSOS = true ; currentMCURow = 0 ; reset ( ) ; return true ; } else { proce...
public class FastLimitedQueue { /** * Add an element at the tail of the queue , replacing the least recently added item if the queue is full . * The item is only added to the queue if it is not already contained . Runs in constant time , assuming the * hash function disperses the elements properly among the buckets...
// not yet contained ? if ( set . contains ( e ) ) { return false ; } // add new element queue . add ( e ) ; set . add ( e ) ; // maintain size limit while ( queue . size ( ) > sizeLimit ) { remove ( ) ; } return true ;
public class NaturalLanguageClassifier { /** * Create classifier . * Sends data to create and train a classifier and returns information about the new classifier . * @ param createClassifierOptions the { @ link CreateClassifierOptions } containing the options for the call * @ return a { @ link ServiceCall } with ...
Validator . notNull ( createClassifierOptions , "createClassifierOptions cannot be null" ) ; String [ ] pathSegments = { "v1/classifiers" } ; RequestBuilder builder = RequestBuilder . post ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments ) ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkH...
public class CRCTables { /** * Method for CRC calculation for the just one value ( type long ) Algorithm : Load the register with zero bits . * Reverse message Augment the message by appending W zero bits to the end of it . While ( more message bits ) Begin * Shift the register left by one bit , reading the next bi...
long l = value ; int register = 0 ; // We are going to throw the first bit away . Then making int from long . final int gxInt = ( int ) ( generatorPolynom & BIN_MASK_33BIT ) ; // the first bit before bit shifting in the input polynom int bit = 0 ; for ( int i = 0 ; i < Long . SIZE ; i ++ ) { // is the highest bit set ?...
public class CommonOps_DDRM { /** * Finds the element with the minimum value along column in the input matrix and returns the results in a vector : < br > * < br > * b < sub > j < / sub > = min ( i = 1 : m ; a < sub > ij < / sub > ) * @ param input Input matrix * @ param output Optional storage for output . Res...
if ( output == null ) { output = new DMatrixRMaj ( 1 , input . numCols ) ; } else { output . reshape ( 1 , input . numCols ) ; } for ( int cols = 0 ; cols < input . numCols ; cols ++ ) { double maximum = - Double . MAX_VALUE ; int index = cols ; int end = index + input . numCols * input . numRows ; for ( ; index < end ...
public class HerokuAPI { /** * Rollback an app to a specific release . * @ param appName App name . See { @ link # listApps } for a list of apps that can be used . * @ param releaseUuid Release UUID . See { @ link # listReleases } for a list of the app ' s releases . * @ return the release object */ public Releas...
return connection . execute ( new Rollback ( appName , releaseUuid ) , apiKey ) ;
public class SREsPreferencePage { /** * Removes the given SREs from the table . * @ param sres the SREs to remove . */ @ SuppressWarnings ( "checkstyle:npathcomplexity" ) public void removeSREs ( ISREInstall ... sres ) { } }
final ISREInstall defaultSRE = getDefaultSRE ( ) ; final String defaultId = defaultSRE == null ? null : defaultSRE . getId ( ) ; int defaultIndex = - 1 ; if ( defaultId != null ) { for ( int i = 0 ; defaultIndex == - 1 && i < this . sreTable . getItemCount ( ) ; ++ i ) { if ( defaultId . equals ( ( ( ISREInstall ) this...
public class Settings { /** * Returns the temporary directory . * @ return the temporary directory * @ throws java . io . IOException if any . */ public synchronized File getTempDirectory ( ) throws IOException { } }
if ( tempDirectory == null ) { final File baseTemp = new File ( getString ( Settings . KEYS . TEMP_DIRECTORY , System . getProperty ( "java.io.tmpdir" ) ) ) ; tempDirectory = FileUtils . createTempDirectory ( baseTemp ) ; } return tempDirectory ;
public class VerticalViewPager { /** * This method will be invoked when the current page is scrolled , either as part * of a programmatically initiated smooth scroll or a user initiated touch scroll . * If you override this method you must call through to the superclass implementation * ( e . g . super . onPageSc...
// Offset any decor views if needed - keep them on - screen at all times . if ( mDecorChildCount > 0 ) { final int scrollY = getScrollY ( ) ; int paddingTop = getPaddingTop ( ) ; int paddingBottom = getPaddingBottom ( ) ; final int height = getHeight ( ) ; final int childCount = getChildCount ( ) ; for ( int i = 0 ; i ...
public class IdentityPatchContext { /** * Record a content loader for a given patch id . * @ param patchID the patch id * @ param contentLoader the content loader */ protected void recordContentLoader ( final String patchID , final PatchContentLoader contentLoader ) { } }
if ( contentLoaders . containsKey ( patchID ) ) { throw new IllegalStateException ( "Content loader already registered for patch " + patchID ) ; // internal wrong usage , no i18n } contentLoaders . put ( patchID , contentLoader ) ;
public class LoggingHandler { /** * Formats an event and returns the formatted message . This method is currently only used for formatting * { @ link ChannelOutboundHandler # connect ( ChannelHandlerContext , SocketAddress , SocketAddress , ChannelPromise ) } . * @ param eventName the name of the event * @ param ...
if ( secondArg == null ) { return formatSimple ( ctx , eventName , firstArg ) ; } String chStr = ctx . channel ( ) . toString ( ) ; String arg1Str = String . valueOf ( firstArg ) ; String arg2Str = secondArg . toString ( ) ; StringBuilder buf = new StringBuilder ( chStr . length ( ) + 1 + eventName . length ( ) + 2 + a...
public class API_Api { /** * Normal Init level APIs * @ param gwAPI * @ param facade * @ throws Exception */ public static void init ( final GwAPI gwAPI , GwFacade facade ) throws Exception { } }
// Overall APIs gwAPI . route ( HttpMethods . GET , "/api" , API . VOID , new GwCode ( facade , "Document API" , true ) { @ Override public void handle ( AuthzTrans trans , HttpServletRequest req , HttpServletResponse resp ) throws Exception { Result < Void > r = context . getAPI ( trans , resp , gwAPI ) ; switch ( r ....
public class Converter { /** * Convert . * @ param _ value the value * @ return the string * @ throws EFapsException */ public static String convert ( final Object _value ) throws EFapsException { } }
String ret = null ; if ( _value instanceof String ) { ret = ( String ) _value ; } else if ( _value instanceof Instance ) { ret = ( ( Instance ) _value ) . getOid ( ) ; } else if ( _value instanceof Number ) { ret = ( ( Number ) _value ) . toString ( ) ; } else if ( _value instanceof LocalDate ) { ret = ( ( LocalDate ) ...
public class JDALogger { /** * Will get the { @ link org . slf4j . Logger } for the given Class * or create and cache a fallback logger if there is no SLF4J implementation present . * The fallback logger will be an instance of a slightly modified version of SLF4Js SimpleLogger . * @ param clazz * The class used...
synchronized ( LOGS ) { if ( SLF4J_ENABLED ) return LoggerFactory . getLogger ( clazz ) ; return LOGS . computeIfAbsent ( clazz . getName ( ) , ( n ) -> new SimpleLogger ( clazz . getSimpleName ( ) ) ) ; }
public class JSON { /** * Mutant factory for constructing an instance with specified { @ link PrettyPrinter } , * and returning new instance ( or , if there would be no change , this instance ) . */ public JSON with ( PrettyPrinter pp ) { } }
if ( _prettyPrinter == pp ) { return this ; } return _with ( _features , _streamFactory , _treeCodec , _reader , _writer , pp ) ;
public class JBBPDslBuilder { /** * Add anonymous fixed length bit array . * @ param bits length of the field , must not be null * @ param size number of elements in array , if negative then till the end of stream * @ return the builder instance , must not be null */ public JBBPDslBuilder BitArray ( final JBBPBit...
return this . BitArray ( null , bits , arraySizeToString ( size ) ) ;
public class AppenderatorImpl { /** * Unannounce the segments and wait for outstanding persists to finish . * Do not unlock base persist dir as we are not waiting for push executor to shut down * relying on current JVM to shutdown to not cause any locking problem if the task is restored . * In case when task is r...
if ( ! closed . compareAndSet ( false , true ) ) { log . info ( "Appenderator already closed" ) ; return ; } log . info ( "Shutting down immediately..." ) ; for ( Map . Entry < SegmentIdWithShardSpec , Sink > entry : sinks . entrySet ( ) ) { try { segmentAnnouncer . unannounceSegment ( entry . getValue ( ) . getSegment...
public class ProcessStore { /** * set an already defined variable , first from the highest block hierarchy * down to the global variables . * @ param key * name of the variable * @ param value * value of the variable * @ return true if successfully assignd to an existing variable else false */ public boolea...
boolean success = false ; Object object = null ; for ( int i = working . size ( ) - 1 ; i >= 0 ; -- i ) { Map < Object , Object > map = working . get ( i ) ; object = map . get ( key ) ; if ( object != null ) { map . put ( key , value ) ; success = true ; break ; } } if ( ! success ) { object = global . get ( key ) ; i...
public class CmsJlanThreadManager { /** * Tries to stop the JLAN server and return after it is stopped , but will also return if the thread hasn ' t stopped after MAX _ SHUTDOWN _ WAIT _ MILLIS . */ public synchronized void stop ( ) { } }
if ( m_thread != null ) { long timeBeforeShutdownWasCalled = System . currentTimeMillis ( ) ; JLANServer . shutdownServer ( new String [ ] { } ) ; while ( m_thread . isAlive ( ) && ( ( System . currentTimeMillis ( ) - timeBeforeShutdownWasCalled ) < MAX_SHUTDOWN_WAIT_MILLIS ) ) { try { Thread . sleep ( 500 ) ; } catch ...
public class XMLHolidayHelper { /** * Gets the type . * @ param eType * the type of holiday in the config * @ return the type of holiday */ @ Nonnull public static IHolidayType getType ( @ Nonnull final HolidayType eType ) { } }
switch ( eType ) { case OFFICIAL_HOLIDAY : return EHolidayType . OFFICIAL_HOLIDAY ; case UNOFFICIAL_HOLIDAY : return EHolidayType . UNOFFICIAL_HOLIDAY ; default : throw new IllegalArgumentException ( "Unknown type " + eType ) ; }
public class MetadataContext { /** * Invokes { @ link DatabaseMetaData # getColumnPrivileges ( java . lang . String , java . lang . String , java . lang . String , * java . lang . String ) } with given arguments and returns bound information . * @ param catalog the value for { @ code catalog } parameter * @ param...
final List < ColumnPrivilege > list = new ArrayList < > ( ) ; try ( ResultSet results = databaseMetadata . getColumnPrivileges ( catalog , schema , table , columnNamePattern ) ) { if ( results != null ) { bind ( results , ColumnPrivilege . class , list ) ; } } return list ;
public class AbstractDecorator { /** * Checks if a error belongs to this widget . * @ param perror editor error to check * @ return true if the error belongs to this widget */ protected boolean editorErrorMatches ( final EditorError perror ) { } }
return perror != null && perror . getEditor ( ) != null && ( equals ( perror . getEditor ( ) ) || perror . getEditor ( ) . equals ( editor ) ) ;
public class JobExecutionsInner { /** * Starts an elastic job execution . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param jobAgentName The n...
return beginCreateWithServiceResponseAsync ( resourceGroupName , serverName , jobAgentName , jobName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Scheduler { /** * Shuts the scheduler down . After shut down no more tasks can be added to the scheduler . */ public void shutdown ( ) { } }
synchronized ( globalLock ) { for ( Instance i : allInstances ) { i . removeSlotListener ( ) ; i . cancelAndReleaseAllSlots ( ) ; } allInstances . clear ( ) ; allInstancesByHost . clear ( ) ; instancesWithAvailableResources . clear ( ) ; taskQueue . clear ( ) ; }
public class TangoDeviceAppender { /** * Release any resources allocated within the appender . */ public void close ( ) { } }
if ( lc_dev_proxy != null ) { try { DeviceData dd = new DeviceData ( ) ; dd . insert ( dev_name ) ; lc_dev_proxy . command_inout_asynch ( "UnRegister" , dd , true ) ; } catch ( DevFailed dv ) { // Ignore : some old LogViewer may not support the Unregister cmd } } lc_dev_proxy = null ; dev_name = null ;
public class LocalTranCoordImpl { /** * Complete the deferred LTC start by retrieving the remaining LTC config from component metadata */ protected void getComponentMetadataForLTC ( ) { } }
if ( _deferredConfig ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getComponentMetadataForLTC" ) ; _deferredConfig = false ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getComponentMetadataForLTC" ) ; }
public class SarlLinkFactory { /** * Create the label for a procedure lambda . * @ param linkInfo the type . * @ return the label . */ protected Content createProcedureLambdaLabel ( LinkInfoImpl linkInfo ) { } }
final ParameterizedType type = linkInfo . type . asParameterizedType ( ) ; if ( type != null ) { final Type [ ] arguments = type . typeArguments ( ) ; if ( arguments != null && arguments . length > 0 ) { return createLambdaLabel ( linkInfo , arguments , arguments . length ) ; } } return linkInfo . label ;
public class DBPIDGenerator { /** * Read the highest value from the old pidGen directory if it exists , and * ensure it is never used . */ private void upgradeIfNeeded ( File oldPidGenDir ) throws IOException { } }
if ( oldPidGenDir != null && oldPidGenDir . isDirectory ( ) ) { String [ ] names = oldPidGenDir . list ( ) ; Arrays . sort ( names ) ; if ( names . length > 0 ) { BufferedReader in = new BufferedReader ( new InputStreamReader ( new FileInputStream ( new File ( oldPidGenDir , names [ names . length - 1 ] ) ) ) ) ; Strin...
public class ApplicationGatewaysInner { /** * Starts the specified application gateway . * @ param resourceGroupName The name of the resource group . * @ param applicationGatewayName The name of the application gateway . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws Clo...
startWithServiceResponseAsync ( resourceGroupName , applicationGatewayName ) . toBlocking ( ) . last ( ) . body ( ) ;
public class MeshGenerator { /** * Converts a standard triangle model to a wireframe model , with the option to perform de - triangulation ( convert faces of triangles back to a polygon ) . This assumes that the positions have 3 * components , in the x , y , z order . No excess data is kept . The final model will hav...
int indicesSize = indices . size ( ) ; int positionsSize = positions . size ( ) ; // Remove duplicate vertices for ( int i = 0 ; i < positionsSize ; i += 3 ) { final float x = positions . get ( i ) ; final float y = positions . get ( i + 1 ) ; final float z = positions . get ( i + 2 ) ; // Search for a duplicate for ( ...
public class XmlHelper { /** * 获取某个节点 * @ param expression * 路径 * @ return { Node } */ public Node getNode ( String expression ) { } }
return ( Node ) evalXPath ( expression , null , XPathConstants . NODE ) ;
public class SansOrm { /** * Use this one if you have custom / provided { @ link TransactionManager } , e . g . to run within web app container . * @ param dataSource the { @ link DataSource } to use by the default * @ param txManager the { @ link TransactionManager } to use for tx management * @ param userTx the...
TransactionElf . setTransactionManager ( txManager ) ; TransactionElf . setUserTransaction ( userTx ) ; return initializeTxNone ( dataSource ) ;
public class NotificationViewCallback { /** * Called only once after this callback is set . * @ param view */ public void onViewSetup ( NotificationView view ) { } }
if ( DBG ) Log . v ( TAG , "onViewSetup" ) ; view . setCornerRadius ( 8.0f ) ; view . setContentMargin ( 50 , 50 , 50 , 50 ) ; view . setShadowEnabled ( true ) ;
public class IntuitResponseDeserializer { /** * Method to add custom deserializer for CustomFieldDefinition * @ param objectMapper the Jackson object mapper */ private void registerModulesForCustomFieldDef ( ObjectMapper objectMapper ) { } }
SimpleModule simpleModule = new SimpleModule ( "CustomFieldDefinition" , new Version ( 1 , 0 , 0 , null ) ) ; simpleModule . addDeserializer ( CustomFieldDefinition . class , new CustomFieldDefinitionDeserializer ( ) ) ; objectMapper . registerModule ( simpleModule ) ; objectMapper . configure ( DeserializationFeature ...
public class StatsDReporter { private void reportCounter ( final String name , final Counter counter ) { } }
send ( name , String . valueOf ( counter . getCount ( ) ) ) ;
public class SEQUENCER2 { /** * / * - - - - - Private Methods - - - - - */ protected void handleViewChange ( View v ) { } }
List < Address > mbrs = v . getMembers ( ) ; if ( mbrs . isEmpty ( ) ) return ; if ( view == null || view . compareTo ( v ) < 0 ) view = v ; else return ; Address existing_coord = coord , new_coord = mbrs . get ( 0 ) ; boolean coord_changed = ! Objects . equals ( existing_coord , new_coord ) ; if ( coord_changed && new...