signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class EsRequest { /** * Adds single property value . * @ param name property name . * @ param value property value . */ public void put ( String name , Object value ) { } }
if ( value instanceof EsRequest ) { document . setDocument ( name , ( ( EsRequest ) value ) . document ) ; } else { document . set ( name , value ) ; }
public class AbstractMBeanIntrospector { /** * Attempt for format an MBean attribute . Composite and Tabular data types will * be recursively formatted , arrays will be formatted with each entry on one line , * while all others will rely on the value returned by { @ code toString } . * @ param mbeanServer the mbe...
try { Object attribute = mbeanServer . getAttribute ( mbean , attr . getName ( ) ) ; if ( attribute == null ) { return "null" ; } else if ( CompositeData . class . isAssignableFrom ( attribute . getClass ( ) ) ) { return getFormattedCompositeData ( CompositeData . class . cast ( attribute ) , indent ) ; } else if ( Tab...
public class SqlAgentFactoryImpl { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . SqlAgentFactory # setDefaultInsertsType ( InsertsType ) */ @ Override public SqlAgentFactory setDefaultInsertsType ( InsertsType defaultInsertsType ) { } }
getDefaultProps ( ) . put ( PROPS_KEY_DEFAULT_INSERTS_TYPE , defaultInsertsType . toString ( ) ) ; return this ;
public class GalleryImagesInner { /** * List gallery images in a given lab account . * @ param resourceGroupName The name of the resource group . * @ param labAccountName The name of the lab Account . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the P...
return listWithServiceResponseAsync ( resourceGroupName , labAccountName ) . map ( new Func1 < ServiceResponse < Page < GalleryImageInner > > , Page < GalleryImageInner > > ( ) { @ Override public Page < GalleryImageInner > call ( ServiceResponse < Page < GalleryImageInner > > response ) { return response . body ( ) ; ...
public class Solo { /** * Returns a WebElement matching the specified By object and index . * @ param by the By object . Examples are : { @ code By . id ( " id " ) } and { @ code By . name ( " name " ) } * @ param index the index of the { @ link WebElement } . { @ code 0 } if only one is available * @ return a { ...
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "getWebElement(" + by + ", " + index + ")" ) ; } int match = index + 1 ; WebElement webElement = waiter . waitForWebElement ( by , match , Timeout . getSmallTimeout ( ) , true ) ; if ( webElement == null ) { if ( match > 1 ) { Assert . fail ( match...
public class FlowTypeCheck { /** * Type check a < code > whiley < / code > statement . * @ param stmt * Statement to type check * @ param environment * Determines the type of all variables immediately going into this * block * @ return * @ throws ResolveError * If a named type within this statement cann...
// Type loop invariant ( s ) . checkConditions ( stmt . getInvariant ( ) , true , environment ) ; // Type condition assuming its true to represent inside a loop // iteration . // Important if condition contains a type test , as we ' ll know it holds . Environment trueEnvironment = checkCondition ( stmt . getCondition (...
public class Operations { /** * Creates an operation to read a resource . * @ param address the address to create the read for * @ param recursive whether to search recursively or not * @ return the operation */ public static ModelNode createReadResourceOperation ( final ModelNode address , final boolean recursiv...
final ModelNode op = createOperation ( READ_RESOURCE_OPERATION , address ) ; op . get ( RECURSIVE ) . set ( recursive ) ; return op ;
public class AmazonAutoScalingClient { /** * Describes the notification types that are supported by Amazon EC2 Auto Scaling . * @ param describeAutoScalingNotificationTypesRequest * @ return Result of the DescribeAutoScalingNotificationTypes operation returned by the service . * @ throws ResourceContentionExcepti...
request = beforeClientExecution ( request ) ; return executeDescribeAutoScalingNotificationTypes ( request ) ;
public class DefaultAttachmentProvider { /** * { @ inheritDoc } */ @ NonNull @ Override public List < Uri > getAttachments ( @ NonNull Context context , @ NonNull CoreConfiguration configuration ) { } }
final ArrayList < Uri > result = new ArrayList < > ( ) ; for ( String s : configuration . attachmentUris ( ) ) { try { result . add ( Uri . parse ( s ) ) ; } catch ( Exception e ) { ACRA . log . e ( LOG_TAG , "Failed to parse Uri " + s , e ) ; } } return result ;
public class CmsPrincipal { /** * Utility function to read a prefixed principal from the OpenCms database using the * provided OpenCms user context . < p > * The principal must be either prefixed with < code > { @ link I _ CmsPrincipal # PRINCIPAL _ GROUP } . < / code > or * < code > { @ link I _ CmsPrincipal # P...
if ( CmsGroup . hasPrefix ( name ) ) { // this principal is a group return cms . readGroup ( CmsGroup . removePrefix ( name ) ) ; } else if ( CmsUser . hasPrefix ( name ) ) { // this principal is a user return cms . readUser ( CmsUser . removePrefix ( name ) ) ; } // invalid principal name was given throw new CmsDbEntr...
public class GetConnectivityInfoRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetConnectivityInfoRequest getConnectivityInfoRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getConnectivityInfoRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getConnectivityInfoRequest . getThingName ( ) , THINGNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to ...
public class URLNormalizer { /** * < p > Removes any trailing slash ( / ) from a URL , before fragment * ( # ) or query string ( ? ) . < / p > * < p > < b > Please Note : < / b > Removing trailing slashes form URLs * could potentially break their semantic equivalence . < / p > * < code > http : / / www . exampl...
String urlRoot = HttpURL . getRoot ( url ) ; String path = toURL ( ) . getPath ( ) ; String urlRootAndPath = urlRoot + path ; if ( path . endsWith ( "/" ) ) { String newPath = StringUtils . removeEnd ( path , "/" ) ; String newUrlRootAndPath = urlRoot + newPath ; url = StringUtils . replaceOnce ( url , urlRootAndPath ,...
public class RPC { /** * Expert : Make multiple , parallel calls to a set of servers . */ public static Object [ ] call ( Method method , Object [ ] [ ] params , InetSocketAddress [ ] addrs , UserGroupInformation ticket , Configuration conf ) throws IOException { } }
Invocation [ ] invocations = new Invocation [ params . length ] ; for ( int i = 0 ; i < params . length ; i ++ ) invocations [ i ] = new Invocation ( method , null , params [ i ] ) ; Client client = CLIENTS . getClient ( conf ) ; try { Writable [ ] wrappedValues = client . call ( invocations , addrs , method . getDecla...
public class Strings { /** * subtractSeq . * @ param first * a { @ link java . lang . String } object . * @ param second * a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . */ public static String subtractSeq ( final String first , final String second ) { } }
return subtractSeq ( first , second , DELIMITER ) ;
public class FindBugs2 { /** * Report an exception that occurred while analyzing a class with a * detector . * @ param classDescriptor * class being analyzed * @ param detector * detector doing the analysis * @ param e * the exception */ private void logRecoverableException ( ClassDescriptor classDescript...
bugReporter . logError ( "Exception analyzing " + classDescriptor . toDottedClassName ( ) + " using detector " + detector . getDetectorClassName ( ) , e ) ;
public class JKConversionUtil { /** * To boolean . * @ param value the value * @ param defaultValue the default value * @ return true , if successful */ public static boolean toBoolean ( Object value , boolean defaultValue ) { } }
boolean result ; // = defaultValue ; if ( value != null ) { if ( value instanceof Boolean ) { return ( ( Boolean ) value ) . booleanValue ( ) ; } if ( value . toString ( ) . trim ( ) . equals ( "1" ) || value . toString ( ) . trim ( ) . toLowerCase ( ) . equals ( "true" ) ) { result = true ; } else { result = false ; }...
public class WorldViewTransformer { /** * Transform a bounding box by a given < code > Matrix < / code > . * @ param bbox * The bounding box to transform . * @ param matrix * The transformation matrix . * @ return Returns a transformed bounding box , or null if one of the given parameters was null . */ public...
if ( bbox != null ) { Coordinate c1 = transform ( bbox . getOrigin ( ) , matrix ) ; Coordinate c2 = transform ( bbox . getEndPoint ( ) , matrix ) ; double x = ( c1 . getX ( ) < c2 . getX ( ) ) ? c1 . getX ( ) : c2 . getX ( ) ; double y = ( c1 . getY ( ) < c2 . getY ( ) ) ? c1 . getY ( ) : c2 . getY ( ) ; return new Bbo...
public class Context2 { /** * Declare a Namespace prefix for this context . * @ param prefix The prefix to declare . * @ param uri The associated Namespace URI . * @ see org . xml . sax . helpers . NamespaceSupport2 # declarePrefix */ void declarePrefix ( String prefix , String uri ) { } }
// Lazy processing . . . if ( ! tablesDirty ) { copyTables ( ) ; } if ( declarations == null ) { declarations = new Vector ( ) ; } prefix = prefix . intern ( ) ; uri = uri . intern ( ) ; if ( "" . equals ( prefix ) ) { if ( "" . equals ( uri ) ) { defaultNS = null ; } else { defaultNS = uri ; } } else { prefixTable . p...
public class JmsDurableSubscriberImpl { /** * This method overrides the createCoreConsumer method in JmsMsgConsumerImpl * to connect to a durable subscription rather than a regular consumer session . * Note : Care should be taken when altering this method signature to ensure * that it matches the method in JmsMsg...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createCoreConsumer" , new Object [ ] { _coreConn , _props } ) ; if ( DEVT_DEBUG ) System . out . println ( "Overidden create!" ) ; ConsumerSession dcs = null ; // Determine the correct subscription name to use ( conc...
public class DefaultEndpointFactory { /** * Loads property file from classpath holding default endpoint annotation parser definitions in Citrus . */ private void loadEndpointParserProperties ( ) { } }
try { endpointParserProperties = PropertiesLoaderUtils . loadProperties ( new ClassPathResource ( "com/consol/citrus/endpoint/endpoint.parser" ) ) ; } catch ( IOException e ) { log . warn ( "Unable to laod default endpoint annotation parsers from resource '%s'" , e ) ; }
public class BeansDescriptorImpl { /** * Adds a new namespace * @ return the current instance of < code > BeansDescriptor < / code > */ public BeansDescriptor addNamespace ( String name , String value ) { } }
model . attribute ( name , value ) ; return this ;
public class CsvDataProvider { /** * { @ inheritDoc } */ @ Override protected void writeValue ( String column , int line , String value ) { } }
logger . debug ( "Writing: [{}] at line [{}] in column [{}]" , value , line , column ) ; final int colIndex = columns . indexOf ( column ) ; CSVReader reader ; try { reader = openOutputData ( ) ; final List < String [ ] > csvBody = reader . readAll ( ) ; csvBody . get ( line ) [ colIndex ] = value ; reader . close ( ) ...
public class BaseType { /** * Create a class - based type , where any parameters are filled with the * variables , not Object . */ public static BaseType createGenericClass ( Class < ? > type ) { } }
TypeVariable < ? > [ ] typeParam = type . getTypeParameters ( ) ; if ( typeParam == null || typeParam . length == 0 ) return ClassType . create ( type ) ; BaseType [ ] args = new BaseType [ typeParam . length ] ; HashMap < String , BaseType > newParamMap = new HashMap < String , BaseType > ( ) ; String paramDeclName = ...
public class BundledTileSetRepository { /** * documentation inherited from interface */ public TileSet getTileSet ( String setName ) throws NoSuchTileSetException , PersistenceException { } }
waitForBundles ( ) ; Integer tsid = _namemap . get ( setName ) ; if ( tsid != null ) { return getTileSet ( tsid . intValue ( ) ) ; } throw new NoSuchTileSetException ( setName ) ;
public class SessionListener { /** * Log the session counters for applications that maintain them . * @ param sess HttpSession for the session id * @ param start true for session start */ protected void logSessionCounts ( final HttpSession sess , final boolean start ) { } }
StringBuffer sb ; String appname = getAppName ( sess ) ; Counts ct = getCounts ( appname ) ; if ( start ) { sb = new StringBuffer ( "SESSION-START:" ) ; } else { sb = new StringBuffer ( "SESSION-END:" ) ; } sb . append ( getSessionId ( sess ) ) ; sb . append ( ":" ) ; sb . append ( appname ) ; sb . append ( ":" ) ; sb ...
public class Client { /** * Get a batch of roles assigned to privilege . * @ param id Id of the privilege * @ param batchSize Size of the Batch * @ param afterCursor Reference to continue collecting items of next page * @ return OneLoginResponse of User ( Batch ) * @ throws OAuthSystemException - if there is ...
ExtractionContext context = extractResourceBatch ( ( Object ) id , batchSize , afterCursor , Constants . GET_ROLES_ASSIGNED_TO_PRIVILEGE_URL ) ; List < Long > roleIds = new ArrayList < Long > ( batchSize ) ; afterCursor = getRolesAssignedToPrivilegesBatch ( roleIds , context . url , context . bearerRequest , context . ...
public class SipDigestAuthenticationMechanism { /** * Parse the specified authorization credentials , and return the associated Principal that these credentials authenticate * ( if any ) from the specified Realm . If there is no such Principal , return < code > null < / code > . * @ param request HTTP servlet reque...
// System . out . println ( " Authorization token : " + authorization ) ; // Validate the authorization credentials format if ( authorization == null ) { return ( null ) ; } if ( ! authorization . startsWith ( "Digest " ) ) { return ( null ) ; } String tmpAuthorization = authorization . substring ( 7 ) . trim ( ) ; // ...
public class Row { /** * Creates a new Row and assigns the given values to the Row ' s fields . * This is more convenient than using the constructor . * < p > For example : * < pre > * Row . of ( " hello " , true , 1L ) ; } * < / pre > * instead of * < pre > * Row row = new Row ( 3 ) ; * row . setFiel...
Row row = new Row ( values . length ) ; for ( int i = 0 ; i < values . length ; i ++ ) { row . setField ( i , values [ i ] ) ; } return row ;
public class OcAgentTraceServiceConfigRpcHandler { /** * Sends current config to Agent if the stream is still connected , otherwise do nothing . */ private synchronized void sendCurrentConfig ( CurrentLibraryConfig currentLibraryConfig ) { } }
if ( isCompleted ( ) || currentConfigObserver == null ) { return ; } try { currentConfigObserver . onNext ( currentLibraryConfig ) ; } catch ( Exception e ) { // Catch client side exceptions . onComplete ( e ) ; }
public class Text { /** * Set to contain the contents of a string . */ public void set ( String string ) { } }
try { ByteBuffer bb = encode ( string , true ) ; bytes = bb . array ( ) ; length = bb . limit ( ) ; } catch ( CharacterCodingException e ) { throw new RuntimeException ( "Should not have happened " + e . toString ( ) ) ; }
public class TransformationPerformer { /** * Gets the value of the field with the field name either from the source object or the target object , depending on * the parameters . Is also aware of temporary fields . */ private Object getObjectValue ( String fieldname , boolean fromSource ) throws Exception { } }
Object sourceObject = fromSource ? source : target ; Object result = null ; for ( String part : StringUtils . split ( fieldname , "." ) ) { if ( isTemporaryField ( part ) ) { result = loadObjectFromTemporary ( part , fieldname ) ; } else { result = loadObjectFromField ( part , result , sourceObject ) ; } } return resul...
public class InlineSimpleMethods { /** * Returns true if the provided node is a getprop for * which the left child is this or a valid property tree * and for which the right side is a string . */ private static boolean isPropertyTree ( Node expectedGetprop ) { } }
if ( ! expectedGetprop . isGetProp ( ) ) { return false ; } Node leftChild = expectedGetprop . getFirstChild ( ) ; if ( ! leftChild . isThis ( ) && ! isPropertyTree ( leftChild ) ) { return false ; } Node retVal = leftChild . getNext ( ) ; return NodeUtil . getStringValue ( retVal ) != null ;
public class YarnShuffleService { /** * Close the shuffle server to clean up any associated state . */ @ Override protected void serviceStop ( ) { } }
try { if ( shuffleServer != null ) { shuffleServer . close ( ) ; } if ( transportContext != null ) { transportContext . close ( ) ; } if ( blockHandler != null ) { blockHandler . close ( ) ; } if ( db != null ) { db . close ( ) ; } } catch ( Exception e ) { logger . error ( "Exception when stopping service" , e ) ; }
public class OpenPgpManager { /** * Determine , if we can sync secret keys using private PEP nodes as described in the XEP . * Requirements on the server side are support for PEP and support for the whitelist access model of PubSub . * @ see < a href = " https : / / xmpp . org / extensions / xep - 0373 . html # syn...
return ServiceDiscoveryManager . getInstanceFor ( connection ) . serverSupportsFeature ( PubSubFeature . access_whitelist . toString ( ) ) ;
public class ReplyUtil { /** * dummy reply . please according to your own situation to build ReplyDetailWarpper , and remove those code in production . */ public static ReplyDetailWarpper getDummyTextReplyDetailWarpper ( ) { } }
ReplyDetail replyDetail = new ReplyDetail ( ) ; replyDetail . setDescription ( "欢迎订阅javatech,这是微信公众平台开发模式的一个尝试,更多详情请见 https://github.com/usc/wechat-mp-sdk \n" + "Welcome subscribe javatech, this is an attempt to development model of wechat management platform, please via https://github.com/usc/wechat-mp-sdk to see more...
public class ApplicationSecurityGroupsInner { /** * Gets all the application security groups in a resource group . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown...
ServiceResponse < Page < ApplicationSecurityGroupInner > > response = listByResourceGroupNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < ApplicationSecurityGroupInner > ( response . body ( ) ) { @ Override public Page < ApplicationSecurityGroupInner > nextPage ( String nextPa...
public class Metadata { /** * Returns a { @ code Metadata } object given the the metadata as a map . The total size of all keys * and values must be less than 512 KB . Keys must conform to the following regexp : { @ code * [ a - zA - Z0-9 - _ ] + } , and be less than 128 bytes in length . This is reflected as part ...
return newBuilder ( ) . setValues ( values ) . build ( ) ;
public class TRNImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setTRNDATA ( byte [ ] newTRNDATA ) { } }
byte [ ] oldTRNDATA = trndata ; trndata = newTRNDATA ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . TRN__TRNDATA , oldTRNDATA , trndata ) ) ;
public class AbstractParser { /** * evaluates a XPath expression and loops over the nodeset result * @ param element * @ param xpath * @ return * @ throws XPathExpressionException */ protected static Iterable < Node > evaluate ( Node element , XPathExpression expression , boolean detatch ) throws XPathExpressio...
final NodeList nodeList = ( NodeList ) expression . evaluate ( element , XPathConstants . NODESET ) ; return new Iterable < Node > ( ) { @ Override public Iterator < Node > iterator ( ) { return new Iterator < Node > ( ) { int index = 0 ; @ Override public boolean hasNext ( ) { return index < nodeList . getLength ( ) ;...
public class DescribeFleetAttributesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeFleetAttributesRequest describeFleetAttributesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeFleetAttributesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeFleetAttributesRequest . getFleetIds ( ) , FLEETIDS_BINDING ) ; protocolMarshaller . marshall ( describeFleetAttributesRequest . getLimit ( ) , LI...
public class PolicyChecker { /** * Finds the policy nodes of depth ( certIndex - 1 ) where curPolicy * is in the expected policy set and creates a new child node * appropriately . If matchAny is true , then a value of ANY _ POLICY * in the expected policy set will match any curPolicy . If matchAny * is false , ...
boolean foundMatch = false ; if ( debug != null ) debug . println ( "PolicyChecker.processParents(): matchAny = " + matchAny ) ; // find matching parents Set < PolicyNodeImpl > parentNodes = rootNode . getPolicyNodesExpected ( certIndex - 1 , curPolicy , matchAny ) ; // for each matching parent , extend policy tree for...
public class UtilMath { /** * Get the rounded value with ceil . * @ param value The value . * @ param round The round factor ( must not be equal to 0 ) . * @ return The rounded value . * @ throws LionEngineException If invalid argument . */ public static int getRoundedC ( double value , int round ) { } }
Check . different ( round , 0 ) ; return ( int ) Math . ceil ( value / round ) * round ;
public class PluginResourceAction { /** * Registers / unregisters an action resource . * @ param shell The running shell . * @ param owner Owner of the resource . * @ param register If true , register the resource . If false , unregister it . */ @ Override public void register ( CareWebShell shell , ElementBase o...
if ( register ) { ActionRegistry . register ( false , getId ( ) , getLabel ( ) , getScript ( ) ) ; }
public class cachecontentgroup { /** * Use this API to save cachecontentgroup resources . */ public static base_responses save ( nitro_service client , cachecontentgroup resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { cachecontentgroup saveresources [ ] = new cachecontentgroup [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { saveresources [ i ] = new cachecontentgroup ( ) ; saveresources [ i ] . name = resources [ i ] . na...
public class UtcTimeSqlUtil { /** * Tries to retrieve UTC time from the given { @ link java . sql . ResultSet } . * Returns defaultTime if no the associated column has null value . * @ param rs Result set , must be in a state , where a value can be retrieved * @ param columnName Column name , associated with time...
final Timestamp timestamp = rs . getTimestamp ( columnName , UtcTime . newUtcCalendar ( ) ) ; if ( timestamp == null ) { return defaultTime ; } return UtcTime . valueOf ( timestamp . getTime ( ) ) ;
public class CompareComply { /** * Get information about a specific batch - processing job . * Gets information about a batch - processing job with a specified ID . * @ param getBatchOptions the { @ link GetBatchOptions } containing the options for the call * @ return a { @ link ServiceCall } with a response type...
Validator . notNull ( getBatchOptions , "getBatchOptions cannot be null" ) ; String [ ] pathSegments = { "v1/batches" } ; String [ ] pathParameters = { getBatchOptions . batchId ( ) } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments , pathParameters ) ...
public class CommerceShipmentItemPersistenceImpl { /** * Returns a range of all the commerce shipment items where groupId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they a...
return findByGroupId ( groupId , start , end , null ) ;
public class Characters { /** * Creates a new Characters instance containing only the given chars . * @ param chars the chars * @ return a new Characters object */ public static Characters of ( char ... chars ) { } }
return chars . length == 0 ? Characters . NONE : new Characters ( false , chars . clone ( ) ) ;
public class EnumRandomizer { /** * Get a subset of enumeration . * @ return the enumeration values minus those excluded . */ private List < E > getFilteredList ( Class < E > enumeration , E ... excludedValues ) { } }
List < E > filteredValues = new ArrayList < > ( ) ; Collections . addAll ( filteredValues , enumeration . getEnumConstants ( ) ) ; if ( excludedValues != null ) { for ( E element : excludedValues ) { filteredValues . remove ( element ) ; } } return filteredValues ;
public class DefaultAnnotationService { /** * ~ Methods * * * * * */ @ Override public List < Annotation > getAnnotations ( String expression ) { } }
requireNotDisposed ( ) ; requireArgument ( AnnotationReader . isValid ( expression ) , "Invalid annotation expression: " + expression ) ; AnnotationReader < Annotation > reader = new AnnotationReader < Annotation > ( _tsdbService ) ; List < Annotation > annotations = new LinkedList < > ( ) ; try { _logger . debug ( "Re...
public class TrmFirstContactMessageImpl { /** * Get the value of the TrmFirstContactMessageType from the message . * Javadoc description supplied by TrmFirstContactMessage interface . */ public final TrmFirstContactMessageType getMessageType ( ) { } }
/* Get the int value and get the corresponding TrmFirstContactMessageType to return */ int mType = jmo . getIntField ( TrmFirstContactAccess . MESSAGETYPE ) ; return TrmFirstContactMessageType . getTrmFirstContactMessageType ( mType ) ;
public class AWSCognitoIdentityProviderClient { /** * Updates the device status as an administrator . * Requires developer credentials . * @ param adminUpdateDeviceStatusRequest * The request to update the device status , as an administrator . * @ return Result of the AdminUpdateDeviceStatus operation returned ...
request = beforeClientExecution ( request ) ; return executeAdminUpdateDeviceStatus ( request ) ;
public class PermissionFragmentHelper { /** * used only for { @ link Manifest . permission # SYSTEM _ ALERT _ WINDOW } */ @ Override public void onActivityForResult ( int requestCode ) { } }
if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . M ) { if ( requestCode == OVERLAY_PERMISSION_REQ_CODE ) { if ( isSystemAlertGranted ( ) ) { permissionCallback . onPermissionGranted ( new String [ ] { Manifest . permission . SYSTEM_ALERT_WINDOW } ) ; } else { permissionCallback . onPermissionDeclined ( new Str...
public class LeaderAppender { /** * Registers a commit handler for the given commit index . * @ param index The index for which to register the handler . * @ return A completable future to be completed once the given log index has been committed . */ public CompletableFuture < Long > appendEntries ( long index ) { ...
if ( index == 0 ) return appendEntries ( ) ; if ( index <= context . getCommitIndex ( ) ) return CompletableFuture . completedFuture ( index ) ; // If there are no other stateful servers in the cluster , immediately commit the index . if ( context . getClusterState ( ) . getActiveMemberStates ( ) . isEmpty ( ) && conte...
public class IntArray { /** * Sets the length of the array , filling with zero if necessary . */ public void setLength ( int size ) { } }
expand ( size ) ; for ( int i = _size ; i < size ; i ++ ) _data [ i ] = 0 ; _size = size ;
public class PdfIndirectObject { /** * Writes efficiently to a stream * @ param os the stream to write to * @ throws IOException on write error */ void writeTo ( OutputStream os ) throws IOException { } }
os . write ( DocWriter . getISOBytes ( String . valueOf ( number ) ) ) ; os . write ( ' ' ) ; os . write ( DocWriter . getISOBytes ( String . valueOf ( generation ) ) ) ; os . write ( STARTOBJ ) ; object . toPdf ( writer , os ) ; os . write ( ENDOBJ ) ;
public class Utils { /** * Return the Java Unicode escape sequence for the given character . For example , the * null character ( 0x00 ) is converted to the string " \ u0000 " . This method is useful * for creating display - friendly strings that contain hidden non - printable characters . * @ param ch Character ...
String hexValue = Integer . toHexString ( ch ) ; if ( hexValue . length ( ) == 1 ) { return "\\u000" + hexValue ; } if ( hexValue . length ( ) == 2 ) { return "\\u00" + hexValue ; } if ( hexValue . length ( ) == 3 ) { return "\\u0" + hexValue ; } return "\\u" + hexValue ;
public class MuxServer { /** * Starts a client call . */ public boolean startCall ( int channel , MuxInputStream in , MuxOutputStream out ) throws IOException { } }
// XXX : Eventually need to check to see if the channel is used . // It ' s not clear whether this should cause a wait or an exception . in . init ( this , channel ) ; out . init ( this , channel ) ; return true ;
public class Classes { /** * Get class field with unchecked runtime exception . JRE throws checked { @ link NoSuchFieldException } if field is * missing , behavior that is not desirable for this library . This method uses runtime , unchecked * { @ link NoSuchBeingException } instead . Returned field has accessibili...
try { Field field = clazz . getDeclaredField ( fieldName ) ; field . setAccessible ( true ) ; return field ; } catch ( NoSuchFieldException e ) { throw new NoSuchBeingException ( e ) ; } catch ( SecurityException e ) { throw new BugError ( e ) ; }
public class AtomCache { /** * Returns the representation of a { @ link ScopDomain } as a BioJava { @ link Structure } object . * @ param scopId * a SCOP Id * @ param scopDatabase * A { @ link ScopDatabase } to use * @ return a Structure object * @ throws IOException * @ throws StructureException */ publi...
ScopDomain domain = scopDatabase . getDomainByScopID ( scopId ) ; return getStructureForDomain ( domain , scopDatabase ) ;
public class LCAGraphManager { /** * perform a dfs in graph to label nodes */ private void proceedFirstDFS ( ) { } }
for ( int i = 0 ; i < nbNodes ; i ++ ) { iterator [ i ] = successors [ i ] . iterator ( ) ; } int i = root ; int k = 0 ; father [ k ] = k ; dfsNumberOfNode [ root ] = k ; nodeOfDfsNumber [ k ] = root ; int j ; k ++ ; while ( true ) { if ( iterator [ i ] . hasNext ( ) ) { j = iterator [ i ] . next ( ) ; if ( dfsNumberOf...
public class Logger { /** * Issue a formatted log message with a level of ERROR . * @ param t the throwable * @ param format the format string , as per { @ link String # format ( String , Object . . . ) } * @ param param1 the sole parameter */ public void errorf ( Throwable t , String format , Object param1 ) { }...
if ( isEnabled ( Level . ERROR ) ) { doLogf ( Level . ERROR , FQCN , format , new Object [ ] { param1 } , t ) ; }
public class FogOfWar { /** * In case of active fog of war , check if tile has been discovered . * @ param tx The horizontal tile . * @ param ty The vertical tile . * @ return < code > true < / code > if already discovered , < code > false < / code > else . */ public boolean isVisited ( int tx , int ty ) { } }
return mapHidden . getTile ( tx , ty ) . getNumber ( ) == MapTileFog . NO_FOG ;
public class GeographyValue { /** * Return the list of rings of a polygon . The list has the same * values as the list of rings used to construct the polygon , or * the sequence of WKT rings used to construct the polygon . * @ return A list of rings . */ public List < List < GeographyPointValue > > getRings ( ) {...
/* * Gets the loops that make up the polygon , with the outer loop first . * Note that we need to convert from XYZPoint to GeographyPointValue . * Include the loop back to the first vertex . Also , since WKT wants * holes oriented Clockwise and S2 wants everything oriented CounterClockWise , * reverse the order...
public class WebSphereSecurityPermission { /** * public WebSphereSecurityPermission ( String target , String actions ) { / / @ vj1 : Is Serialization affected by the removal of this constructor ? It was present for WAS5X . * super ( target , null ) ; * init ( getMax ( target ) ) ; */ @ Override public boolean impli...
if ( ! ( p instanceof WebSphereSecurityPermission ) ) return false ; WebSphereSecurityPermission that = ( WebSphereSecurityPermission ) p ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Permission " + this . max + "impliles " + that . max + " = " + ( this . max > that . max ) ) ; } return ( this . max >= that . m...
public class Deferrers { /** * Defer closing of an closeable object . * @ param < T > type of closeable object * @ param closeable an object implements java . io . Closeable * @ return the same closeable object from arguments * @ since 1.0 */ @ Weight ( Weight . Unit . NORMAL ) public static < T extends Closeab...
if ( closeable != null ) { defer ( new Deferred ( ) { private static final long serialVersionUID = 2265124256013043847L ; @ Override public void executeDeferred ( ) throws Exception { IOUtils . closeQuetly ( closeable ) ; } } ) ; } return closeable ;
import java . util . List ; import java . util . Arrays ; public class ComputeKthIndexProduct { /** * Function to calculate the product of elements present at kth index in each tuple from the provided list . * Args : * input _ list : List of arrays * k : Index whose product needs to be computed * Returns : * ...
int kth_index_product = input_list . stream ( ) . map ( x -> x [ k ] ) . reduce ( 1 , Math :: multiplyExact ) ; return kth_index_product ;
public class InternalTransaction { /** * < p > Reset the state of a transaction . Used During recovery processing of * TransactionOptimisticReplaceLogRecord to indicate that a transaction must commit or must backout . * Also use by TransactionCheckpointLogRecord to reinstate the transaction state . * @ param reco...
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "resetState" , "recoveredState=" + recoveredState + "(int) " + stateNames [ recoveredState ] + "(String)" ) ; switch ( recoveredState ) { case ( stateActivePersistent ) : setState ( nextStateForInvolvePersistentObject...
public class N { /** * { @ link Arrays # binarySearch ( Object [ ] , Object , Comparator ) } * @ param a * @ param key * @ param cmp * @ return */ public static < T > int binarySearch ( final T [ ] a , final T key , final Comparator < ? super T > cmp ) { } }
return Array . binarySearch ( a , key , cmp ) ;
public class IndexHeapMemoryCostUtil { /** * Estimates the on - heap memory cost of the given value . * @ param value the value to estimate the cost of . * @ return the estimated value cost . */ @ SuppressWarnings ( { } }
"checkstyle:npathcomplexity" , "checkstyle:returncount" } ) public static long estimateValueCost ( Object value ) { if ( value == null ) { return 0 ; } Class < ? > clazz = value . getClass ( ) ; Integer cost = KNOWN_FINAL_CLASSES_COSTS . get ( clazz ) ; if ( cost != null ) { return cost ; } if ( value instanceof String...
public class BaseClient { /** * Retrieves source system queries based on the query name ( without the file * type ) and a specified change date parameter . * @ param changeDatePara * The change date specified from which to pull data with a given * query template . * @ param queryName * The source system que...
ST st = ( new STGroupDir ( featureSettings . getQueryFolder ( ) , '$' , '$' ) ) . getInstanceOf ( queryName ) ; st . add ( "changeDate" , changeDatePara ) ; return st . render ( ) ;
public class JournalHelper { /** * Format a date for the journal or the logger . */ public static String formatDate ( Date date ) { } }
SimpleDateFormat formatter = new SimpleDateFormat ( TIMESTAMP_FORMAT ) ; return formatter . format ( date ) ;
public class NodeWriteTrx { /** * { @ inheritDoc } */ @ Override public void setQName ( final QName paramName ) throws TTException { } }
checkState ( ! mDelegate . isClosed ( ) , "Transaction is already closed." ) ; checkState ( mDelegate . getCurrentNode ( ) instanceof ITreeNameData , "setQName is not allowed if current node is not an ITreeNameData implementation, but was %s" , mDelegate . getCurrentNode ( ) ) ; final long oldHash = mDelegate . getCurr...
public class WigUtils { /** * Index the entire Wig file content in a SQLite database managed by the ChunkFrequencyManager . * @ param wigPath Wig file * @ return Path to the database * @ throws Exception */ public static Path index ( Path wigPath ) throws Exception { } }
Path dbPath = wigPath . getParent ( ) . resolve ( WIG_DB ) ; ChunkFrequencyManager chunkFrequencyManager = new ChunkFrequencyManager ( dbPath ) ; // get the chunk size int chunkSize = chunkFrequencyManager . getChunkSize ( ) ; String chromosome = null ; int step , span = 1 , start = 1 , end ; int startChunk , endChunk ...
public class ScanJob { /** * Returns true of scanning actually was started , false if it did not need to be */ private boolean startScanning ( ) { } }
BeaconManager beaconManager = BeaconManager . getInstanceForApplication ( getApplicationContext ( ) ) ; beaconManager . setScannerInSameProcess ( true ) ; if ( beaconManager . isMainProcess ( ) ) { LogManager . i ( TAG , "scanJob version %s is starting up on the main process" , BuildConfig . VERSION_NAME ) ; } else { L...
public class DisableBehOnFieldHandler { /** * Constructor . * @ param field The basefield owner of this listener ( usually null and set on setOwner ( ) ) . */ public void init ( BaseField field , BaseListener listenerToDisable , String strDisableOnMatch , boolean bDisableIfMatch ) { } }
super . init ( field ) ; m_listenerToDisable = listenerToDisable ; m_strDisableOnMatch = strDisableOnMatch ; m_bDisableIfMatch = bDisableIfMatch ;
public class LinkedHashMap { /** * link at the end of list */ private void linkNodeLast ( LinkedHashMapEntry < K , V > p ) { } }
LinkedHashMapEntry < K , V > last = tail ; tail = p ; if ( last == null ) head = p ; else { p . before = last ; last . after = p ; }
public class DesignContextMenu { /** * Sets the disabled state of the specified component . * @ param comp The component . * @ param disabled The disabled state . */ private void disable ( IDisable comp , boolean disabled ) { } }
if ( comp != null ) { comp . setDisabled ( disabled ) ; if ( comp instanceof BaseUIComponent ) { ( ( BaseUIComponent ) comp ) . addStyle ( "opacity" , disabled ? ".2" : "1" ) ; } }
public class WriteExecutor { /** * Return a Concept for a given Variable . * This method is expected to be called from implementations of * VarProperty # insert ( Variable ) , provided they include the given Variable in * their PropertyExecutor # requiredVars ( ) . */ public Concept getConcept ( Variable var ) { ...
var = equivalentVars . componentOf ( var ) ; assert var != null ; @ Nullable Concept concept = concepts . get ( var ) ; if ( concept == null ) { @ Nullable ConceptBuilder builder = conceptBuilders . remove ( var ) ; if ( builder != null ) { concept = buildConcept ( var , builder ) ; } } if ( concept != null ) { return ...
public class SmartOpenIdController { /** * Gets the association response . Determines the mode first . * If mode is set to associate , will set the response . Then * builds the response parameters next and returns . * @ param request the request * @ return the association response */ public Map < String , Strin...
val parameters = new ParameterList ( request . getParameterMap ( ) ) ; val mode = parameters . hasParameter ( OpenIdProtocolConstants . OPENID_MODE ) ? parameters . getParameterValue ( OpenIdProtocolConstants . OPENID_MODE ) : null ; val response = FunctionUtils . doIf ( StringUtils . equals ( mode , OpenIdProtocolCons...
public class StructrRelationshipTypeDefinition { /** * - - - - - private methods - - - - - */ private String getSourceMultiplicity ( final Cardinality cardinality ) { } }
switch ( cardinality ) { case OneToOne : case OneToMany : return "1" ; case ManyToOne : case ManyToMany : return "*" ; } return null ;
public class RespokeClient { /** * Connect to the Respoke infrastructure and authenticate in development mode using the specified endpoint ID and app ID . * Attempt to obtain an authentication token automatically from the Respoke infrastructure . * @ param endpointID The endpoint ID to use when connecting * @ par...
if ( ( endpointID != null ) && ( appID != null ) && ( endpointID . length ( ) > 0 ) && ( appID . length ( ) > 0 ) ) { connectionInProgress = true ; reconnect = shouldReconnect ; applicationID = appID ; appContext = context ; APIGetToken request = new APIGetToken ( context , baseURL ) { @ Override public void transactio...
public class ReflectionUtil { /** * 循环向上转型 , 获取类对象的DeclaredField . */ public static Field getDeclaredField ( Class < ? > clz , final String fieldName ) { } }
for ( Class < ? > s = clz ; s != Object . class ; s = s . getSuperclass ( ) ) { try { return s . getDeclaredField ( fieldName ) ; } catch ( NoSuchFieldException ignored ) { } } return null ;
public class GenericIndexed { private static < T > GenericIndexed < T > createGenericIndexedVersionOne ( ByteBuffer byteBuffer , ObjectStrategy < T > strategy ) { } }
boolean allowReverseLookup = byteBuffer . get ( ) == REVERSE_LOOKUP_ALLOWED ; int size = byteBuffer . getInt ( ) ; ByteBuffer bufferToUse = byteBuffer . asReadOnlyBuffer ( ) ; bufferToUse . limit ( bufferToUse . position ( ) + size ) ; byteBuffer . position ( bufferToUse . limit ( ) ) ; return new GenericIndexed < > ( ...
public class GetResponseUnmarshaller { /** * { @ inheritDoc } */ @ Override public Object unMarshall ( Response < GetResponse > response , Class < ? > entity ) { } }
this . entity = ClassUtil . newInstance ( entity ) ; try { consume ( response . getResult ( ) ) ; if ( found ) { return this . entity ; } else { return null ; } } catch ( Exception e ) { throw new MappingException ( e ) ; }
public class Mapper { /** * Return the results of mapping all objects with the mapper . * @ param mapper an Mapper * @ param en an Enumeration * @ param allowNull allow null values * @ return a Collection of the results . */ public static Collection map ( Mapper mapper , Enumeration en , boolean allowNull ) { }...
ArrayList l = new ArrayList ( ) ; while ( en . hasMoreElements ( ) ) { Object o = mapper . map ( en . nextElement ( ) ) ; if ( allowNull || o != null ) { l . add ( o ) ; } } return l ;
public class HBCIUtils { /** * Wandelt ein gegebenes Datums - Objekt in einen String um , der sowohl Datum * als auch Uhrzeit enthält . Das Format des erzeugten Strings ist abhängig von der gesetzten * < em > HBCI4Java < / em > - Locale ( siehe Kernel - Parameter < code > kernel . locale . * < / code > ) . * @ ...
String ret ; try { ret = DateFormat . getDateTimeInstance ( DateFormat . SHORT , DateFormat . SHORT , Locale . getDefault ( ) ) . format ( date ) ; } catch ( Exception e ) { throw new InvalidArgumentException ( date . toString ( ) ) ; } return ret ;
public class DeleteFacesRequest { /** * An array of face IDs to delete . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setFaceIds ( java . util . Collection ) } or { @ link # withFaceIds ( java . util . Collection ) } if you want to override * the existin...
if ( this . faceIds == null ) { setFaceIds ( new java . util . ArrayList < String > ( faceIds . length ) ) ; } for ( String ele : faceIds ) { this . faceIds . add ( ele ) ; } return this ;
public class Pitch { /** * norm _ corr - Find the normalized correlation between the target vector and * the filtered past excitation . */ public static void norm_corr ( float exc [ ] , int excs , /* input : excitation buffer */ float xn [ ] , int xns , /* input : target vector */ float h [ ] , int hs , /* input : im...
int i , j , k ; float excf [ ] = new float [ LD8KConstants . L_SUBFR ] ; /* filtered past excitation */ float alp , s , norm ; k = - t_min ; /* compute the filtered excitation for the first delay t _ min */ Filter . convolve ( exc , excs + k , h , 0 , excf , 0 , l_subfr ) ; /* loop for every possible period */ for ( i ...
public class AnnotationUtility { /** * Iterate over annotations of currentElement . Accept only annotation in * accepted set . * @ param currentElement the current element * @ param filter the filter * @ param listener the listener */ public static void forEachAnnotations ( Element currentElement , AnnotationFi...
final Elements elementUtils = BaseProcessor . elementUtils ; List < ? extends AnnotationMirror > annotationList = elementUtils . getAllAnnotationMirrors ( currentElement ) ; String annotationClassName ; // boolean valid = true ; for ( AnnotationMirror annotation : annotationList ) { Map < String , String > values = new...
public class MutableURI { /** * Returns the values of the given parameter . * @ param name name of the parameter * @ return an unmodifable { @ link java . util . List } of values for the given parameter name */ public List /* < String > */ getParameters ( String name ) { } }
if ( _parameters == null || ! _parameters . hasParameters ( ) ) return Collections . EMPTY_LIST ; else { List parameters = _parameters . getParameterValues ( name ) ; if ( parameters == null ) return Collections . EMPTY_LIST ; else return Collections . unmodifiableList ( parameters ) ; }
public class JwtConsumerConfigImpl { /** * End OSGi - related fields and methods */ private void process ( Map < String , Object > props ) { } }
if ( props == null || props . isEmpty ( ) ) { return ; } id = JwtUtils . trimIt ( ( String ) props . get ( JwtUtils . CFG_KEY_ID ) ) ; issuer = JwtUtils . trimIt ( ( String ) props . get ( JwtUtils . CFG_KEY_ISSUER ) ) ; sharedKey = JwtConfigUtil . processProtectedString ( props , JwtUtils . CFG_KEY_SHARED_KEY ) ; audi...
public class ManagedClustersInner { /** * Gets a list of managed clusters in the specified subscription . * Gets a list of managed clusters in the specified subscription . The operation returns properties of each managed cluster . * @ param nextPageLink The NextLink from the previous successful call to List operati...
return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < ManagedClusterInner > > , Page < ManagedClusterInner > > ( ) { @ Override public Page < ManagedClusterInner > call ( ServiceResponse < Page < ManagedClusterInner > > response ) { return response . body ( ) ; } } ) ;
public class JcElement { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > access a named property < / i > < / div > * < br / > */ public JcProperty prope...
JcProperty ret = new JcProperty ( name , this , OPERATOR . PropertyContainer . PROPERTY_ACCESS ) ; QueryRecorder . recordInvocationConditional ( this , "property" , ret , QueryRecorder . literal ( name ) ) ; return ret ;
public class XMLAssert { /** * Assert that two XML documents are NOT similar * @ param control XML to be compared against * @ param test XML to be tested * @ throws SAXException * @ throws IOException */ public static void assertXMLNotEqual ( Reader control , Reader test ) throws SAXException , IOException { } ...
assertXMLNotEqual ( null , control , test ) ;
public class RootDocImpl { /** * Return the path of the overview file and null if it does not exist . * @ return the path of the overview file and null if it does not exist . */ private JavaFileObject getOverviewPath ( ) { } }
for ( String [ ] opt : options ) { if ( opt [ 0 ] . equals ( "-overview" ) ) { if ( env . fileManager instanceof StandardJavaFileManager ) { StandardJavaFileManager fm = ( StandardJavaFileManager ) env . fileManager ; return fm . getJavaFileObjects ( opt [ 1 ] ) . iterator ( ) . next ( ) ; } } } return null ;
public class AbstractQueue { /** * Serialize a queue message to bytes . * @ param queueMsg * @ return * @ since 0.7.0 */ protected byte [ ] serialize ( IQueueMessage < ID , DATA > queueMsg ) { } }
return queueMsg != null ? SerializationUtils . toByteArray ( queueMsg ) : null ;
public class Cache { /** * Caches the specified object identified by the specified key . * @ param key a unique key for this object * @ param val the object to be cached */ public void cache ( Object key , T val ) { } }
cache . put ( key , new SoftReference < T > ( val ) ) ;
public class XBinaryOperationImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public NotificationChain basicSetLeftOperand ( XExpression newLeftOperand , NotificationChain msgs ) { } }
XExpression oldLeftOperand = leftOperand ; leftOperand = newLeftOperand ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , XbasePackage . XBINARY_OPERATION__LEFT_OPERAND , oldLeftOperand , newLeftOperand ) ; if ( msgs == null ) msgs = notification ;...
public class ContentTargeting { /** * Sets the excludedContentMetadata value for this ContentTargeting . * @ param excludedContentMetadata * A list of content metadata within hierarchies that are being * excluded by the { @ code LineItem } . */ public void setExcludedContentMetadata ( com . google . api . ads . adm...
this . excludedContentMetadata = excludedContentMetadata ;