signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AnnotationUtil { /** * 递归Class所有的Annotation , 一个最彻底的实现 .
* 包括所有基类 , 所有接口的Annotation , 同时支持Spring风格的Annotation继承的父Annotation , */
public static Set < Annotation > getAllAnnotations ( final Class < ? > cls ) { } } | List < Class < ? > > allTypes = ClassUtil . getAllSuperclasses ( cls ) ; allTypes . addAll ( ClassUtil . getAllInterfaces ( cls ) ) ; allTypes . add ( cls ) ; Set < Annotation > anns = new HashSet < Annotation > ( ) ; for ( Class < ? > type : allTypes ) { anns . addAll ( Arrays . asList ( type . getDeclaredAnnotations ... |
public class vpnformssoaction { /** * Use this API to add vpnformssoaction . */
public static base_response add ( nitro_service client , vpnformssoaction resource ) throws Exception { } } | vpnformssoaction addresource = new vpnformssoaction ( ) ; addresource . name = resource . name ; addresource . actionurl = resource . actionurl ; addresource . userfield = resource . userfield ; addresource . passwdfield = resource . passwdfield ; addresource . ssosuccessrule = resource . ssosuccessrule ; addresource .... |
public class DescribeResourceServerRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeResourceServerRequest describeResourceServerRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeResourceServerRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeResourceServerRequest . getUserPoolId ( ) , USERPOOLID_BINDING ) ; protocolMarshaller . marshall ( describeResourceServerRequest . getIdentifier ( ... |
public class MockSupplier { /** * This method is responsible for invoking the provided
* factory / supplier / function with the provided parameters .
* @ param aProvidedParams
* The parameter array . May be < code > null < / code > or empty .
* @ return The mocked value . May be < code > null < / code > but tha... | IGetterDirectTrait [ ] aEffectiveParams = null ; if ( m_aParams != null && m_aParams . length > 0 ) { // Parameters are present - convert all to IConvertibleTrait
final int nRequiredParams = m_aParams . length ; final int nProvidedParams = ArrayHelper . getSize ( aProvidedParams ) ; aEffectiveParams = new IGetterDirect... |
public class GDLLoader { /** * Initializes a new edge from the given edge body context .
* @ param edgeBodyContext edge body context
* @ param isIncoming true , if it ' s an incoming edge , false for outgoing edge
* @ return new edge */
private Edge initNewEdge ( GDLParser . EdgeBodyContext edgeBodyContext , bool... | boolean hasBody = edgeBodyContext != null ; Edge e = new Edge ( ) ; e . setId ( getNewEdgeId ( ) ) ; e . setSourceVertexId ( getSourceVertexId ( isIncoming ) ) ; e . setTargetVertexId ( getTargetVertexId ( isIncoming ) ) ; if ( hasBody ) { List < String > labels = getLabels ( edgeBodyContext . header ( ) ) ; e . setLab... |
public class CommerceAccountLocalServiceBaseImpl { /** * Performs a dynamic query on the database and returns the matching rows .
* @ param dynamicQuery the dynamic query
* @ return the matching rows */
@ Override public < T > List < T > dynamicQuery ( DynamicQuery dynamicQuery ) { } } | return commerceAccountPersistence . findWithDynamicQuery ( dynamicQuery ) ; |
public class FunctorFactory { /** * Create a functor with parameter , wrapping a call to another method .
* @ param instanceClass
* class containing the method .
* @ param methodName
* Name of the method , it must exist .
* @ return a Functor with parameter that call the specified method on the specified inst... | if ( null == instanceClass ) { throw new NullPointerException ( "instanceClass is null" ) ; } Method _method = instanceClass . getMethod ( methodName , ( Class < ? > [ ] ) null ) ; return instanciateFunctorWithParameterAsAMethodWrapper ( null , _method ) ; |
public class UtilFile { /** * Get the files list from directory .
* @ param directory The directory reference ( must not be < code > null < / code > ) .
* @ return The directory content .
* @ throws LionEngineException If invalid argument or not a directory . */
public static List < File > getFiles ( File directo... | Check . notNull ( directory ) ; if ( directory . isDirectory ( ) ) { final File [ ] files = directory . listFiles ( ) ; if ( files != null ) { return Arrays . asList ( files ) ; } } throw new LionEngineException ( ERROR_DIRECTORY + directory . getPath ( ) ) ; |
public class BaseMessageTransport { /** * Here is an incoming message .
* Figure out what it is and process it .
* Note : the caller should have logged this message since I have no way to serialize the raw data .
* @ param messageReplyIn - The incoming message
* @ param messageOut - The ( optional ) outgoing me... | if ( messageReplyIn . getExternalMessage ( ) == null ) if ( messageReplyIn . getMessage ( ) != null ) return messageReplyIn ; // Probably an error reply message
String strMessageProcessType = this . getMessageProcessType ( messageReplyIn ) ; String strMessageInfoType = this . getMessageInfoType ( messageReplyIn ) ; if ... |
public class SyncAgentsInner { /** * Creates or updates a sync agent .
* @ 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 on which the sync agent is hosted .... | return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , syncAgentName , syncDatabaseId ) , serviceCallback ) ; |
public class Altimeter { /** * < editor - fold defaultstate = " collapsed " desc = " Image related " > */
private BufferedImage create_TICKMARKS_Image ( final int WIDTH , final double FREE_AREA_ANGLE , final double OFFSET , final double MIN_VALUE , final double MAX_VALUE , final double ANGLE_STEP , final int TICK_LABEL... | if ( WIDTH <= 0 ) { return null ; } if ( image == null ) { image = UTIL . createImage ( WIDTH , WIDTH , Transparency . TRANSLUCENT ) ; } final Graphics2D G2 = image . createGraphics ( ) ; G2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; // G2 . setRenderingHint ( Rende... |
public class Panel { /** * Fields contained in this panel . */
public List < Field > getFields ( Entity entity , String operationId , PMSecurityUser user ) { } } | final String [ ] fs = getFields ( ) . split ( "[ ]" ) ; final List < Field > result = new ArrayList < Field > ( ) ; for ( String string : fs ) { final Field field = entity . getFieldById ( string ) ; if ( field != null ) { if ( operationId == null || field . shouldDisplay ( operationId , user ) ) { result . add ( field... |
public class Db { /** * Main database initialization . To be called only when _ ds is a valid DataSource . */
private void init ( boolean upgrade ) { } } | initAdapter ( ) ; initQueries ( ) ; if ( upgrade ) { dbUpgrade ( ) ; } // First contact with the DB is version checking ( if no connection opened by pool ) .
// If DB is in wrong version or not available , just wait for it to be ready .
boolean versionValid = false ; while ( ! versionValid ) { try { checkSchemaVersion ... |
public class MongoService { /** * Declarative Services method for unsetting the SSL Support service reference
* @ param ref reference to the service */
protected void unsetSsl ( ServiceReference < Object > reference ) { } } | sslConfigurationRef . unsetReference ( reference ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "sslRef unset" ) ; } |
public class JmsJcaActivationSpecImpl { /** * Set the MaxSequentialMessageFailure property
* @ param maxSequentialMessageFailure The maximum number of failed messages */
@ Override public void setMaxSequentialMessageFailure ( final String maxSequentialMessageFailure ) { } } | _maxSequentialMessageFailure = ( maxSequentialMessageFailure == null ? null : Integer . valueOf ( maxSequentialMessageFailure ) ) ; |
public class Metrics { /** * Measures the distribution of samples .
* @ param name The base metric name
* @ param tags MUST be an even number of arguments representing key / value pairs of tags .
* @ return A new or existing distribution summary . */
public static DistributionSummary summary ( String name , Strin... | return globalRegistry . summary ( name , tags ) ; |
public class ZipChemCompProvider { /** * Add an array of files to a zip archive .
* Synchronized to prevent simultaneous reading / writing .
* @ param zipFile is a destination zip archive
* @ param files is an array of files to be added
* @ param pathWithinArchive is the path within the archive to add files to ... | boolean ret = false ; /* URIs in Java 7 cannot have spaces , must use Path instead
* and so , cannot use the properties map to describe need to create
* a new zip archive . ZipChemCompProvider . initilizeZip to creates the
* missing zip file */
/* / / convert the filename to a URI
String uriString = " jar : fil... |
public class LogManager { /** * Returns a formatter Logger using the fully qualified name of the value ' s Class as the Logger name .
* This logger let you use a { @ link java . util . Formatter } string in the message to format parameters .
* Short - hand for { @ code getLogger ( value , StringFormatterMessageFact... | return getLogger ( value != null ? value . getClass ( ) : StackLocatorUtil . getCallerClass ( 2 ) , StringFormatterMessageFactory . INSTANCE ) ; |
public class PhotosApi { /** * Remove a tag from a photo .
* < br >
* This method requires authentication with ' write ' permission .
* < br >
* The tagId parameter must be the full tag id . Methods such as photos . getInfo will return the full tag id as the
* " tagId " parameter ; other methods , such as add... | JinxUtils . validateParams ( tagId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photos.removeTag" ) ; params . put ( "tag_id" , tagId ) ; return jinx . flickrPost ( params , Response . class ) ; |
public class TimeUtils { /** * parseToSeconds duration string like ' nYnMnDnHnMnS ' to seconds
* @ param timeStr duration string like ' nYnMnDnHnMnS '
* @ return duration in seconds */
public static int parseDurationString ( String timeStr ) { } } | int seconds = 0 ; Matcher matcher = timeStringPattern . matcher ( timeStr ) ; while ( matcher . find ( ) ) { String s = matcher . group ( ) ; String [ ] parts = s . split ( "(?<=[yMwdhms])(?=\\d)|(?<=\\d)(?=[yMwdhms])" ) ; int numb = Integer . parseInt ( parts [ 0 ] ) ; String type = parts [ 1 ] ; switch ( type ) { cas... |
public class NoResponseListener { /** * Returns the NoResponseListener instance registered with the Batcher .
* @ param batcher the Batcher instance for which the registered
* NoResponseListener is returned
* @ return the NoResponseListener instance with the batcher or null if there
* is no NoResponseListener r... | if ( batcher instanceof WriteBatcher ) { WriteFailureListener [ ] writeFailureListeners = ( ( WriteBatcher ) batcher ) . getBatchFailureListeners ( ) ; for ( WriteFailureListener writeFailureListener : writeFailureListeners ) { if ( writeFailureListener instanceof NoResponseListener ) { return ( NoResponseListener ) wr... |
public class ScrollBarButtonPainter { /** * DOCUMENT ME !
* @ param g DOCUMENT ME !
* @ param width DOCUMENT ME !
* @ param height DOCUMENT ME ! */
private void paintBackgroundCap ( Graphics2D g , int width , int height ) { } } | Shape s = shapeGenerator . createScrollCap ( 0 , 0 , width , height ) ; dropShadow . fill ( g , s ) ; fillScrollBarButtonInteriorColors ( g , s , isIncrease , buttonsTogether ) ; |
public class JsonWebKey { /** * Verifies if the key is an RSA key . */
private void checkRSACompatible ( ) { } } | if ( ! JsonWebKeyType . RSA . equals ( kty ) && ! JsonWebKeyType . RSA_HSM . equals ( kty ) ) { throw new UnsupportedOperationException ( "Not an RSA key" ) ; } |
public class DeleteConnectionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteConnectionRequest deleteConnectionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteConnectionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteConnectionRequest . getConnectionId ( ) , CONNECTIONID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to ... |
public class LanguageServiceClient { /** * Finds named entities ( currently proper names and common nouns ) in the text along with entity
* types , salience , mentions for each entity , and other properties .
* < p > Sample code :
* < pre > < code >
* try ( LanguageServiceClient languageServiceClient = Language... | AnalyzeEntitiesRequest request = AnalyzeEntitiesRequest . newBuilder ( ) . setDocument ( document ) . setEncodingType ( encodingType ) . build ( ) ; return analyzeEntities ( request ) ; |
public class CompilingLoader { /** * Compile the Java source . Compile errors are encapsulated in a
* ClassNotFound wrapper .
* @ param javaSource path to the Java source */
void compileClass ( Source javaSource , Source javaClass , String sourcePath , boolean isMake ) throws ClassNotFoundException { } } | try { JavaCompilerUtil compiler = JavaCompilerUtil . create ( getClassLoader ( ) ) ; compiler . setClassDir ( _classDir ) ; compiler . setSourceDir ( _sourceDir ) ; if ( _encoding != null ) compiler . setEncoding ( _encoding ) ; compiler . setArgs ( _args ) ; compiler . setCompileParent ( ! isMake ) ; compiler . setSou... |
public class AuditLogEntry { /** * Constructs a filtered , immutable list of options corresponding to
* the provided { @ link net . dv8tion . jda . core . audit . AuditLogOption AuditLogOptions } .
* < br > This will exclude options with { @ code null } values !
* @ param options
* The not - null { @ link net .... | Checks . notNull ( options , "Options" ) ; List < Object > items = new ArrayList < > ( options . length ) ; for ( AuditLogOption option : options ) { Object obj = getOption ( option ) ; if ( obj != null ) items . add ( obj ) ; } return Collections . unmodifiableList ( items ) ; |
public class TxExecutionContextHandler { /** * Overridden in WAS */
protected JCATranWrapper createWrapper ( int timeout , Xid xid , JCARecoveryData jcard ) throws WorkCompletedException /* @512190C */
{ } } | return new JCATranWrapperImpl ( timeout , xid , jcard ) ; // @ D240298C |
public class XmlTarget { /** * { @ inheritDoc } */
@ SuppressWarnings ( { } } | "unchecked" } ) public void importItem ( Object item ) { try { XMLStreamWriter writer = m_xmlWriter ; Map < String , String > nsMap = m_namespaceMap ; boolean hasDecendants = ! m_elements . isEmpty ( ) ; if ( hasDecendants ) { writer . writeStartElement ( m_itemElementName ) ; } else { writer . writeEmptyElement ( m_it... |
public class AnnotationUtils { /** * Returns true if any annotation in parameterAnnotations matches annotationClass .
* @ param parameterAnnotations Annotations to inspect .
* @ param annotationClass Annotation to find .
* @ return true if any annotation in parameterAnnotations matches annotationClass , else fals... | for ( Annotation annotation : parameterAnnotations ) { if ( annotation . annotationType ( ) . equals ( annotationClass ) ) { return true ; } } return false ; |
public class ActionNonTxAware { /** * Executes the action
* @ param arg the argument to use to execute the action
* @ return the result of the action
* @ throws E if an error occurs while executing the action */
protected R execute ( A ... arg ) throws E { } } | if ( arg == null || arg . length == 0 ) { return execute ( ( A ) null ) ; } return execute ( arg [ 0 ] ) ; |
public class VisitRegistry { /** * Get the list of unvisited positions .
* @ return list of unvisited positions . */
public ArrayList < Integer > getUnvisited ( ) { } } | if ( 0 == this . unvisitedCount ) { return new ArrayList < Integer > ( ) ; } ArrayList < Integer > res = new ArrayList < Integer > ( this . unvisitedCount ) ; for ( int i = 0 ; i < this . registry . length ; i ++ ) { if ( ZERO == this . registry [ i ] ) { res . add ( i ) ; } } return res ; |
public class ListVolumeRecoveryPointsResult { /** * An array of < a > VolumeRecoveryPointInfo < / a > objects .
* @ param volumeRecoveryPointInfos
* An array of < a > VolumeRecoveryPointInfo < / a > objects . */
public void setVolumeRecoveryPointInfos ( java . util . Collection < VolumeRecoveryPointInfo > volumeRec... | if ( volumeRecoveryPointInfos == null ) { this . volumeRecoveryPointInfos = null ; return ; } this . volumeRecoveryPointInfos = new com . amazonaws . internal . SdkInternalList < VolumeRecoveryPointInfo > ( volumeRecoveryPointInfos ) ; |
public class EventDataDeserializer { /** * Deserializes the JSON payload contained in an event ' s { @ code data } attribute into an
* { @ link EventData } instance . */
@ Override public EventData deserialize ( JsonElement json , Type typeOfT , JsonDeserializationContext context ) throws JsonParseException { } } | EventData eventData = new EventData ( ) ; JsonObject jsonObject = json . getAsJsonObject ( ) ; for ( Map . Entry < String , JsonElement > entry : jsonObject . entrySet ( ) ) { String key = entry . getKey ( ) ; JsonElement element = entry . getValue ( ) ; if ( "previous_attributes" . equals ( key ) ) { if ( element . is... |
public class Widget { /** * Sets the { @ linkplain GVRMaterial # setMainTexture ( GVRTexture ) main texture }
* of the { @ link Widget } .
* @ param bitmapId
* Resource ID of the bitmap to create the texture from . */
public void setTexture ( final int bitmapId ) { } } | if ( bitmapId < 0 ) return ; final GVRAndroidResource resource = new GVRAndroidResource ( mContext . getContext ( ) , bitmapId ) ; setTexture ( mContext . getAssetLoader ( ) . loadTexture ( resource ) ) ; |
public class ResourceReader { /** * Reset to the start by reconstructing the stream and readers .
* We could also use mark ( ) and reset ( ) on the stream or reader ,
* but that would cause them to keep the stream data around in
* memory . We don ' t want that because some of the resource files
* are large , e ... | try { close ( ) ; } catch ( IOException e ) { } if ( lineNo == 0 ) { return ; } InputStream is = ICUData . getStream ( root , resourceName ) ; if ( is == null ) { throw new IllegalArgumentException ( "Can't open " + resourceName ) ; } InputStreamReader isr = ( encoding == null ) ? new InputStreamReader ( is ) : new Inp... |
public class SoyTemplateViewResolver { /** * Remove beginning and ending slashes , then replace all occurrences of / with .
* @ param viewName
* The Spring viewName
* @ return The name of the view , dot separated . */
private String normalize ( final String viewName ) { } } | String normalized = viewName ; if ( normalized . startsWith ( "/" ) ) { normalized = normalized . substring ( 0 ) ; } if ( normalized . endsWith ( "/" ) ) { normalized = normalized . substring ( 0 , normalized . length ( ) - 1 ) ; } return normalized . replaceAll ( "/" , "." ) ; |
public class QueryExprListener { /** * { @ inheritDoc } */
@ Override public void exitSourceElements ( QueryParser . SourceElementsContext ctx ) { } } | infoMap = null ; queryExprMeta = null ; queryExprMetaList = Collections . unmodifiableList ( queryExprMetaList ) ; |
public class SpeechRecognitionResult { /** * Returns how many results have been recoginized . Usually there is only one result but if multiple rules in
* the grammar match multiple results may be returned .
* @ return the number of results recognized . */
public int getNumberOfResults ( ) { } } | final String numberOfResults = agiReply . getAttribute ( "results" ) ; return numberOfResults == null ? 0 : Integer . parseInt ( numberOfResults ) ; |
public class RoboSputnik { /** * public PackageResourceLoader createResourceLoader ( ResourcePath resourcePath ) { */
protected ShadowMap createShadowMap ( ) { } } | synchronized ( RoboSputnik . class ) { if ( mainShadowMap != null ) return mainShadowMap ; mainShadowMap = new ShadowMap . Builder ( ) . build ( ) ; return mainShadowMap ; } |
public class SpaceCharacters { /** * Write a number of whitespaces to a writer
* @ param num
* @ param out */
public static void indent ( int num , PrintWriter out ) { } } | if ( num <= SIXTY_FOUR ) { out . write ( SIXTY_FOUR_SPACES , 0 , num ) ; return ; } else if ( num <= 128 ) { out . write ( SIXTY_FOUR_SPACES , 0 , SIXTY_FOUR ) ; out . write ( SIXTY_FOUR_SPACES , 0 , num - SIXTY_FOUR ) ; } else { int times = num / SIXTY_FOUR ; int rem = num % SIXTY_FOUR ; for ( int i = 0 ; i < times ; ... |
public class MessageCenterFragment { /** * / * Guarded */
public void savePendingComposingMessage ( ) { } } | Editable content = getPendingComposingContent ( ) ; SharedPreferences prefs = ApptentiveInternal . getInstance ( ) . getGlobalSharedPrefs ( ) ; SharedPreferences . Editor editor = prefs . edit ( ) ; ConversationProxy conversation = getConversation ( ) ; assertNotNull ( conversation ) ; if ( conversation == null ) { ret... |
public class CaffeineCacheMetrics { /** * Record metrics on a Caffeine cache . You must call { @ link Caffeine # recordStats ( ) } prior to building the cache
* for metrics to be recorded .
* @ param registry The registry to bind metrics to .
* @ param cache The cache to instrument .
* @ param cacheName Will be... | return monitor ( registry , cache , cacheName , Tags . of ( tags ) ) ; |
public class Configure { /** * 获取标签策略
* @ param tagName
* 模板名称
* @ param sign
* 语法 */
public RenderPolicy getPolicy ( String tagName , Character sign ) { } } | RenderPolicy policy = getCustomPolicy ( tagName ) ; return null == policy ? getDefaultPolicy ( sign ) : policy ; |
public class DownloadProperties { /** * Builds a new DownloadProperties for downloading Galaxy from github using wget .
* @ param branch The branch to download ( e . g . master , dev , release _ 15.03 ) .
* @ param destination The destination directory to store Galaxy , null if a directory
* should be chosen by d... | return new DownloadProperties ( new WgetGithubDownloader ( branch ) , destination ) ; |
public class ScopeImpl { /** * Install the provider of the class { @ code clazz } and name { @ code bindingName }
* in the current scope .
* @ param clazz the class for which to install the scoped provider .
* @ param bindingName the name , possibly { @ code null } , for which to install the scoped provider .
*... | return installInternalProvider ( clazz , bindingName , internalProvider , true , isTestProvider ) ; |
public class MSDelegatingXAResource { /** * Used at transaction recovery time to retrieve the list on indoubt XIDs known
* to the MessageStore instance associated with this MSDelegatingXAResource .
* @ param recoveryId The recovery id of the RM to return indoubt XIDs from
* @ return The list of indoubt XIDs curre... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "recover" , "Recovery ID=" + recoveryId ) ; Xid [ ] list = _manager . recover ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "recover" , "return=" + Arrays ... |
public class StandardBullhornData { /** * { @ inheritDoc } */
@ Override public < T extends SearchEntity , L extends ListWrapper < T > > L search ( Class < T > type , String query , Set < String > fieldSet , SearchParams params ) { } } | return this . handleSearchForEntities ( type , query , fieldSet , params ) ; |
public class Tree { /** * Change the priority of the desired stream / node .
* Reset all the sibling weighted priorities and re - sort the siblings , since once on priority changes , all priority ratios need to be updated and changed .
* @ param streamID
* @ param newPriority
* @ return the Node that was change... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "changeNodePriority entry: streamID to change: " + streamID + " new Priority: " + newPriority ) ; } Node nodeToChange = root . findNode ( streamID ) ; Node parentNode = nodeToChange . getParent ( ) ; if ( ( nodeToChange == nu... |
public class DatabaseMetaData { /** * { @ inheritDoc } */
public ResultSet getFunctions ( final String catalog , final String schemaPattern , final String functionNamePattern ) throws SQLException { } } | return RowLists . rowList6 ( String . class , String . class , String . class , String . class , Short . class , String . class ) . withLabel ( 1 , "FUNCTION_CAT" ) . withLabel ( 2 , "FUNCTION_SCHEM" ) . withLabel ( 3 , "FUNCTION_NAME" ) . withLabel ( 4 , "REMARKS" ) . withLabel ( 5 , "FUNCTION_TYPE" ) . withLabel ( 6 ... |
public class FormatUtil { /** * Formats the boolean array b with ' , ' as separator .
* @ param b the boolean array to be formatted
* @ param sep separator between the single values of the array , e . g . ' , '
* @ return a String representing the boolean array b */
public static String format ( boolean [ ] b , f... | return ( b == null ) ? "null" : ( b . length == 0 ) ? "" : formatTo ( new StringBuilder ( ) , b , ", " ) . toString ( ) ; |
import java . util . * ; public class DecimalToBinaryRepr { /** * Converts the given number in decimal to binary number in string format .
* The converted binary number string has ' db ' characters for formatting , at
* the start and end of the string .
* Args :
* decimalNum : An integer in decimal form .
* R... | String binaryString = "db" + Integer . toBinaryString ( decimalNum ) + "db" ; return binaryString ; |
public class GivensRotation { /** * Applies the Givens rotation to two elements of a vector
* @ param x
* Vector to apply to
* @ param i1
* Index of first element
* @ param i2
* Index of second element */
public void apply ( Vector x , int i1 , int i2 ) { } } | double temp = c * x . get ( i1 ) + s * x . get ( i2 ) ; x . set ( i2 , - s * x . get ( i1 ) + c * x . get ( i2 ) ) ; x . set ( i1 , temp ) ; |
public class CopyHelper { /** * Copy this object if needed .
* @ param thing : this object that needs to be copied
* @ return : a possibly copied instance
* @ throws CopyNotSupportedException if thing needs to be copied but cannot be */
public static Object copy ( Object thing ) throws CopyNotSupportedException {... | if ( ! isCopyable ( thing ) ) { throw new CopyNotSupportedException ( thing . getClass ( ) . getName ( ) + " cannot be copied. See Copyable" ) ; } if ( thing instanceof Copyable ) { return ( ( Copyable ) thing ) . copy ( ) ; } // Support for a few primitive types out of the box
if ( thing instanceof byte [ ] ) { byte [... |
public class JMThread { /** * Build runnable with logging runnable .
* @ param runnableName the runnable name
* @ param runnable the runnable
* @ param params the params
* @ return the runnable */
public static Runnable buildRunnableWithLogging ( String runnableName , Runnable runnable , Object ... params ) { }... | return ( ) -> { JMLog . debug ( log , runnableName , System . currentTimeMillis ( ) , params ) ; runnable . run ( ) ; } ; |
public class AbstractProject { /** * Helper method for getDownstreamRelationship .
* For each given build , find the build number range of the given project and put that into the map . */
private void checkAndRecord ( AbstractProject that , TreeMap < Integer , RangeSet > r , Collection < R > builds ) { } } | for ( R build : builds ) { RangeSet rs = build . getDownstreamRelationship ( that ) ; if ( rs == null || rs . isEmpty ( ) ) continue ; int n = build . getNumber ( ) ; RangeSet value = r . get ( n ) ; if ( value == null ) r . put ( n , rs ) ; else value . add ( rs ) ; } |
public class LcdsChampionTradeService { /** * Attempt to trade with the target player
* @ param summonerInternalName The summoner ' s internal name , as sent by { @ link # getPotentialTraders ( ) }
* @ param championId Unknown - id of sent champion ? id of trade ?
* @ return unknown */
public Object attemptTrade ... | return client . sendRpcAndWait ( SERVICE , "attemptTrade" , summonerInternalName , championId , false ) ; |
public class Level { /** * < editor - fold defaultstate = " collapsed " desc = " Initialization " > */
@ Override public AbstractGauge init ( final int WIDTH , final int HEIGHT ) { } } | final int GAUGE_WIDTH = isFrameVisible ( ) ? WIDTH : getGaugeBounds ( ) . width ; final int GAUGE_HEIGHT = isFrameVisible ( ) ? HEIGHT : getGaugeBounds ( ) . height ; if ( isFrameVisible ( ) ) { setFramelessOffset ( 0 , 0 ) ; } else { setFramelessOffset ( getGaugeBounds ( ) . width * 0.0841121495 , getGaugeBounds ( ) .... |
public class BaseSecurityService { /** * Override to disconnect broker . */
@ Override public boolean logout ( boolean force , String target , String message ) { } } | boolean result = super . logout ( force , target , message ) ; if ( result ) { brokerSession . disconnect ( ) ; } return result ; |
public class Messages { /** * Retrieves the configured message by property key
* @ param key The key in the file
* @ return The associated value in case the key is found in the message bundle file . If
* no such key is defined , the returned value would be the key itself . */
public static String get ( MessageKey... | return data . getProperty ( key . toString ( ) , key . toString ( ) ) ; |
public class Cookies { /** * Removes a cookie by adding it with maxAge of zero . */
public static void removeCookie ( HttpServletRequest request , HttpServletResponse response , String cookieName , boolean secure , boolean contextOnlyPath ) { } } | addCookie ( request , response , cookieName , "Removed" , null , 0 , secure , contextOnlyPath ) ; |
public class ListApiKeysResult { /** * The < code > ApiKey < / code > objects .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setApiKeys ( java . util . Collection ) } or { @ link # withApiKeys ( java . util . Collection ) } if you want to override
* the ... | if ( this . apiKeys == null ) { setApiKeys ( new java . util . ArrayList < ApiKey > ( apiKeys . length ) ) ; } for ( ApiKey ele : apiKeys ) { this . apiKeys . add ( ele ) ; } return this ; |
public class StartRserve { /** * just a demo main method which starts Rserve and shuts it down again
* @ param args . . . */
public static void main ( String [ ] args ) { } } | File dir = null ; System . out . println ( "checkLocalRserve: " + checkLocalRserve ( ) ) ; try { RConnection c = new RConnection ( ) ; // c . eval ( " cat ( ' 123 ' ) " ) ;
dir = new File ( c . eval ( "getwd()" ) . asString ( ) ) ; System . err . println ( "wd: " + dir ) ; // c . eval ( " flush . console < - function (... |
public class CacheOnDisk { /** * Call this method to get the template ids based on the index and the length from the disk .
* @ param index
* If index = 0 , it starts the beginning . If index = 1 , it means " next " . If Index = - 1 , it means
* " previous " .
* @ param length
* The max number of templates to... | Result result = htod . readTemplatesByRange ( index , length ) ; if ( result . returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( result . diskException ) ; this . htod . returnToResultPool ( result ) ; return HTODDynacache . EMPTY_VS ; } ValueSet valueSet = ( ValueSet ) result . data ; if ( valueSet == nul... |
public class JSRInlinerAdapter { /** * Performs a depth first search walking the normal byte code path starting
* at < code > index < / code > , and adding each instruction encountered into the
* subroutine < code > sub < / code > . After this walk is complete , iterates over
* the exception handlers to ensure th... | if ( LOGGING ) { log ( "markSubroutineWalk: sub=" + sub + " index=" + index ) ; } // First find those instructions reachable via normal execution
markSubroutineWalkDFS ( sub , index , anyvisited ) ; // Now , make sure we also include any applicable exception handlers
boolean loop = true ; while ( loop ) { loop = false ... |
public class UnsignedNumeric { /** * Reads a long stored in variable - length format . Reads between one and nine bytes . Smaller values take fewer
* bytes . Negative numbers are not supported . */
public static long readUnsignedLong ( ObjectInput in ) throws IOException { } } | byte b = in . readByte ( ) ; long i = b & 0x7F ; for ( int shift = 7 ; ( b & 0x80 ) != 0 ; shift += 7 ) { b = in . readByte ( ) ; i |= ( b & 0x7FL ) << shift ; } return i ; |
public class ReliabilityMatrixPrinter { /** * Print the reliability matrix for the given coding study . */
public void print ( final PrintStream out , final ICodingAnnotationStudy study ) { } } | // TODO : measure length of cats . maybe cut them .
Map < Object , Integer > categories = new LinkedHashMap < Object , Integer > ( ) ; for ( Object cat : study . getCategories ( ) ) categories . put ( cat , categories . size ( ) ) ; final String DIVIDER = "\t" ; for ( int i = 0 ; i < study . getItemCount ( ) ; i ++ ) o... |
public class AuditLog { /** * < pre >
* The name of the API service performing the operation . For example ,
* ` " datastore . googleapis . com " ` .
* < / pre >
* < code > string service _ name = 7 ; < / code > */
public java . lang . String getServiceName ( ) { } } | java . lang . Object ref = serviceName_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; serviceName_ = s ; return s ; } |
public class SamplesParser { /** * { @ inheritDoc } */
@ Override public SampleResourceWritable parseFileToResource ( File assetFile , File metadataFile , String contentUrl ) throws RepositoryException { } } | ArtifactMetadata artifactMetadata = explodeArtifact ( assetFile , metadataFile ) ; // Throw an exception if there is no metadata and properties , we get the name and readme from it
if ( artifactMetadata == null ) { throw new RepositoryArchiveException ( "Unable to find sibling metadata zip for " + assetFile . getName (... |
public class SelectBenchmark { /** * Don ' t run this benchmark with a query that doesn ' t use { @ link Granularities # ALL } ,
* this pagination function probably doesn ' t work correctly in that case . */
private SelectQuery incrementQueryPagination ( SelectQuery query , SelectResultValue prevResult ) { } } | Map < String , Integer > pagingIdentifiers = prevResult . getPagingIdentifiers ( ) ; Map < String , Integer > newPagingIdentifers = new HashMap < > ( ) ; for ( String segmentId : pagingIdentifiers . keySet ( ) ) { int newOffset = pagingIdentifiers . get ( segmentId ) + 1 ; newPagingIdentifers . put ( segmentId , newOff... |
public class SegmentedLruPolicy { /** * Returns all variations of this policy based on the configuration parameters . */
public static Set < Policy > policies ( Config config ) { } } | BasicSettings settings = new BasicSettings ( config ) ; return settings . admission ( ) . stream ( ) . map ( admission -> new SegmentedLruPolicy ( admission , config ) ) . collect ( toSet ( ) ) ; |
public class OrientationHistogramSift { /** * Finds local peaks in histogram and selects orientations . Location of peaks is interpolated . */
void findHistogramPeaks ( ) { } } | // reset data structures
peaks . reset ( ) ; angles . reset ( ) ; peakAngle = 0 ; // identify peaks and find the highest peak
double largest = 0 ; int largestIndex = - 1 ; double before = histogramMag [ histogramMag . length - 2 ] ; double current = histogramMag [ histogramMag . length - 1 ] ; for ( int i = 0 ; i < his... |
public class UpdateMethodResponseRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateMethodResponseRequest updateMethodResponseRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateMethodResponseRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateMethodResponseRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( updateMethodResponseRequest . getResourceId ( ) , RESO... |
public class Vector3d { /** * / * ( non - Javadoc )
* @ see org . joml . Vector3dc # sub ( org . joml . Vector3fc , org . joml . Vector3d ) */
public Vector3d sub ( Vector3fc v , Vector3d dest ) { } } | dest . x = x - v . x ( ) ; dest . y = y - v . y ( ) ; dest . z = z - v . z ( ) ; return dest ; |
public class JellyBuilder { /** * Generates HTML fragment from string .
* The string representation of the object is assumed to produce proper HTML .
* No further escaping is performed .
* @ see # text ( Object ) */
public void raw ( Object o ) throws SAXException { } } | if ( o != null ) output . write ( o . toString ( ) ) ; |
public class SerialFieldTagImpl { /** * The serialField tag is composed of three entities .
* serialField serializableFieldName serisliableFieldType
* description of field .
* The fieldName and fieldType must be legal Java Identifiers . */
private void parseSerialFieldString ( ) { } } | int len = text . length ( ) ; if ( len == 0 ) { return ; } // if no white space found
/* Skip white space . */
int inx = 0 ; int cp ; for ( ; inx < len ; inx += Character . charCount ( cp ) ) { cp = text . codePointAt ( inx ) ; if ( ! Character . isWhitespace ( cp ) ) { break ; } } /* find first word . */
int first = i... |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcMaterialList ( ) { } } | if ( ifcMaterialListEClass == null ) { ifcMaterialListEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 312 ) ; } return ifcMaterialListEClass ; |
public class PortFile { /** * Delete the port file . */
public void delete ( ) throws IOException , InterruptedException { } } | // Access to file must be closed before deleting .
rwfile . close ( ) ; file . delete ( ) ; // Wait until file has been deleted ( deletes are asynchronous on Windows ! ) otherwise we
// might shutdown the server and prevent another one from starting .
for ( int i = 0 ; i < 10 && file . exists ( ) ; i ++ ) { Thread . sl... |
public class DefaultLoaderService { /** * Removes a resource managed .
* @ param resourceId the resource id . */
public void unload ( String resourceId ) { } } | LoadableResource res = this . resources . get ( resourceId ) ; if ( res != null ) { res . unload ( ) ; } |
public class Pof { /** * Does AES encryption of a YubiKey OTP byte sequence .
* @ param key AES key .
* @ param decoded YubiKey OTP byte sequence ,
* { @ link Modhex # decode ( String ) } is the typical producer of
* this .
* @ return Decrypted .
* @ throws GeneralSecurityException If decryption fails . */
... | SecretKeySpec skeySpec = new SecretKeySpec ( key , "AES" ) ; Cipher cipher = Cipher . getInstance ( "AES/ECB/Nopadding" ) ; cipher . init ( Cipher . DECRYPT_MODE , skeySpec ) ; return cipher . doFinal ( decoded ) ; |
public class NTLMUtilities { /** * Extracts the target name from the type 2 message .
* @ param msg the type 2 message byte array
* @ param msgFlags the flags if null then flags are extracted from the
* type 2 message
* @ return the target name
* @ throws UnsupportedEncodingException if unable to use the
* ... | // Read the security buffer to determine where the target name
// is stored and what it ' s length is
byte [ ] targetName = readSecurityBufferTarget ( msg , 12 ) ; // now we convert it to a string
int flags = msgFlags == null ? extractFlagsFromType2Message ( msg ) : msgFlags ; if ( ByteUtilities . isFlagSet ( flags , F... |
public class Address { /** * Convert a string containing an IP address to an array of 4 or 16 bytes .
* @ param s The address , in text format .
* @ param family The address family .
* @ return The address */
public static byte [ ] toByteArray ( String s , int family ) { } } | if ( family == IPv4 ) return parseV4 ( s ) ; else if ( family == IPv6 ) return parseV6 ( s ) ; else throw new IllegalArgumentException ( "unknown address family" ) ; |
public class GraphDatabase { /** * Return a driver for a Neo4j instance with the default configuration settings
* @ param uri the URL to a Neo4j instance
* @ param authToken authentication to use , see { @ link AuthTokens }
* @ return a new driver to the database instance specified by the URL */
public static Dri... | return driver ( uri , authToken , Config . defaultConfig ( ) ) ; |
public class AvatarNode { /** * Used only for testing . */
public void quiesceStandby ( long txId ) throws IOException { } } | if ( currentAvatar != Avatar . STANDBY ) { throw new IOException ( "This is not the standby avatar" ) ; } standby . quiesce ( txId ) ; |
public class SideEffectsAnalysis { /** * Returns true if a node has a CALL or a NEW descendant . */
private static boolean nodeHasCall ( Node node ) { } } | return NodeUtil . has ( node , new Predicate < Node > ( ) { @ Override public boolean apply ( Node input ) { return input . isCall ( ) || input . isNew ( ) || input . isTaggedTemplateLit ( ) ; } } , NOT_FUNCTION_PREDICATE ) ; |
public class TemplateGenerator { /** * For internal use only ! ! */
@ SuppressWarnings ( "UnusedDeclaration" ) public static void printContent ( String strContent , boolean escape ) { } } | try { RuntimeData pair = getRuntimeData ( ) ; Writer writer = pair . _writer ; if ( escape && pair . _esc != null ) { strContent = pair . _esc . escape ( strContent ) ; } else if ( pair . _esc instanceof IEscapesAllContent ) { strContent = ( ( IEscapesAllContent ) pair . _esc ) . escapeBody ( strContent ) ; } writer . ... |
public class ParserDQL { /** * | < nonparenthesized value expression primary > */
Expression XreadValueExpressionPrimary ( ) { } } | Expression e ; e = XreadSimpleValueExpressionPrimary ( ) ; if ( e != null ) { return e ; } if ( token . tokenType == Tokens . OPENBRACKET ) { read ( ) ; e = XreadValueExpression ( ) ; readThis ( Tokens . CLOSEBRACKET ) ; } else { return null ; } return e ; |
public class NotificationHubsInner { /** * Patch a NotificationHub in a namespace .
* @ param resourceGroupName The name of the resource group .
* @ param namespaceName The namespace name .
* @ param notificationHubName The notification hub name .
* @ throws IllegalArgumentException thrown if parameters fail th... | return patchWithServiceResponseAsync ( resourceGroupName , namespaceName , notificationHubName ) . map ( new Func1 < ServiceResponse < NotificationHubResourceInner > , NotificationHubResourceInner > ( ) { @ Override public NotificationHubResourceInner call ( ServiceResponse < NotificationHubResourceInner > response ) {... |
public class SuspendableIoFilterAdapter { /** * on I / O thread . */
protected void resumeIncoming ( IoSession session ) throws Exception { } } | Runnable resumeTask = new ResumeRunnable ( session ) ; assert ( session instanceof IoSessionEx ) ; ( ( IoSessionEx ) session ) . getIoExecutor ( ) . execute ( resumeTask ) ; |
public class IDEStructureImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . IDE_STRUCTURE__FLAGS : return getFLAGS ( ) ; case AfplibPackage . IDE_STRUCTURE__FORMAT : return getFORMAT ( ) ; case AfplibPackage . IDE_STRUCTURE__SIZE1 : return getSIZE1 ( ) ; case AfplibPackage . IDE_STRUCTURE__SIZE2 : return getSIZE2 ( ) ; case AfplibPackage . IDE_STRUCT... |
public class GVRTransform { /** * Set absolute position .
* Use { @ link # translate ( float , float , float ) } to < em > move < / em > the object .
* @ param x
* ' X ' component of the absolute position .
* @ param y
* ' Y ' component of the absolute position .
* @ param z
* ' Z ' component of the absol... | NativeTransform . setPosition ( getNative ( ) , x , y , z ) ; return this ; |
public class CurveFactory { /** * Creates a monthly index curve with seasonality and past fixings .
* This methods creates an index curve ( e . g . for a CPI index ) using provided < code > annualizedZeroRates < / code >
* for the forwards ( expected future CPI values ) and < code > indexFixings < / code > for the ... | /* * Create a curve containing past fixings ( using picewise constant interpolation ) */
double [ ] fixingTimes = new double [ indexFixings . size ( ) ] ; double [ ] fixingValue = new double [ indexFixings . size ( ) ] ; int i = 0 ; List < LocalDate > fixingDates = new ArrayList < LocalDate > ( indexFixings . keySet ( ... |
public class CmsElementWithAttrsParamConfigHelper { /** * Generates the XML configuration from the given configuration object . < p >
* @ param parent the parent element
* @ param config the configuration */
public void generateXml ( Element parent , I_CmsConfigurationParameterHandler config ) { } } | if ( config != null ) { Element elem = parent . addElement ( m_name ) ; for ( String attrName : m_attrs ) { String value = config . getConfiguration ( ) . get ( attrName ) ; if ( value != null ) { elem . addAttribute ( attrName , value ) ; } } } |
public class AccountingDate { /** * Obtains the current { @ code AccountingDate } from the specified clock ,
* translated with the given AccountingChronology .
* This will query the specified clock to obtain the current date - today .
* Using this method allows the use of an alternate clock for testing .
* The ... | LocalDate now = LocalDate . now ( clock ) ; return ofEpochDay ( chronology , now . toEpochDay ( ) ) ; |
public class EntityUtils { /** * Gets the entity rotation based on where it ' s currently facing .
* @ param entity the entity
* @ param sixWays the six ways
* @ return the entity rotation */
public static int getEntityRotation ( Entity entity , boolean sixWays ) { } } | if ( entity == null ) return 6 ; float pitch = entity . rotationPitch ; if ( sixWays && pitch < - 45 ) return 4 ; if ( sixWays && pitch > 45 ) return 5 ; return ( MathHelper . floor ( entity . rotationYaw * 4.0F / 360.0F + 0.5D ) + 2 ) & 3 ; |
public class FileUtilities { /** * Utility method used to delete the profile directory when run as a stand - alone
* application .
* @ param file
* The file to recursively delete .
* @ throws IOException
* is thrown in case of IO issues . */
public static void deleteFileOrDir ( File file ) throws IOException ... | if ( file . isDirectory ( ) ) { File [ ] children = file . listFiles ( ) ; if ( children != null ) { for ( File child : children ) { deleteFileOrDir ( child ) ; } } } if ( ! file . delete ( ) ) { throw new IOException ( "Could not remove '" + file + "'!" ) ; } |
public class TaskResult { /** * Inserts a String array value into the mapping of this Bundle , replacing any existing value for
* the given key . Either key or value may be null .
* @ param key a String , or null
* @ param value a String array object , or null */
public TaskResult add ( String key , String [ ] va... | mBundle . putStringArray ( key , value ) ; return this ; |
public class CommunicationChannelPurposeService { /** * Return the list of objects to act as a " purpose " for the { @ link CommunicationChannel } s , as per
* { @ link CommunicationChannelPurposeRepository } , or a default name otherwise .
* May return null if there are none ( in which case a default name will be ... | final Set < String > fallback = Collections . singleton ( DEFAULT_PURPOSE ) ; if ( communicationChannelPurposeRepository == null ) { return fallback ; } final Collection < String > purposes = communicationChannelPurposeRepository . purposesFor ( communicationChannelType , communicationChannelOwner ) ; return purposes !... |
public class DescribeTagsResult { /** * Information about the tags .
* @ param tagDescriptions
* Information about the tags . */
public void setTagDescriptions ( java . util . Collection < TagDescription > tagDescriptions ) { } } | if ( tagDescriptions == null ) { this . tagDescriptions = null ; return ; } this . tagDescriptions = new java . util . ArrayList < TagDescription > ( tagDescriptions ) ; |
public class CmsCloneModuleThread { /** * Adjusts the module configuration file and the formatter configurations . < p >
* @ param targetModule the target module
* @ param resTypeMap the resource type mapping
* @ throws CmsException if something goes wrong
* @ throws UnsupportedEncodingException if the file con... | String modPath = CmsWorkplace . VFS_PATH_MODULES + targetModule . getName ( ) + "/" ; CmsObject cms = getCms ( ) ; if ( ( ( m_cloneInfo . getSourceNamePrefix ( ) != null ) && ( m_cloneInfo . getTargetNamePrefix ( ) != null ) ) || ! m_cloneInfo . getSourceNamePrefix ( ) . equals ( m_cloneInfo . getTargetNamePrefix ( ) )... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.