signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Validate { /** * Checks that the specified String is not null or empty and represents a readable file , throws exception if it is empty or
* null and does not represent a path to a file .
* @ param path The path to check
* @ param message The exception message
* @ throws IllegalArgumentException Th... | notNullOrEmpty ( path , message ) ; readable ( new File ( path ) , message ) ; |
public class RedisCacheService { /** * ~ Methods * * * * * */
@ SuppressWarnings ( "unchecked" ) @ Override public < V > V get ( String key ) { } } | V returnValue = null ; try { returnValue = ( V ) _jedisClusterClient . get ( key ) ; } catch ( Exception ex ) { _logger . error ( "Exception in cache service: {} " , ex . getMessage ( ) ) ; } return returnValue ; |
public class JWSHeader { /** * Sets the X . 509 certificate chain header parameter contains the X . 509 public key certificate
* or certificate chain corresponding to the key used to digitally sign the JWS or { @ code null } for none .
* Overriding is only supported for the purpose of calling the super implementati... | this . x509Certificate = x509Certificate ; this . put ( HeaderConstants . X509_CERT , x509Certificate ) ; return this ; |
public class EVCacheLatchImpl { /** * ( non - Javadoc )
* @ see com . netflix . evcache . operation . EVCacheLatchI # getSuccessCount ( ) */
@ Override public int getSuccessCount ( ) { } } | int success = 0 ; for ( Future < Boolean > future : futures ) { try { if ( future . isDone ( ) && future . get ( ) . equals ( Boolean . TRUE ) ) { success ++ ; } } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } } return success ; |
public class MethodDesc { /** * Returns this in Java method signature syntax .
* @ param name method name
* @ param varargs request that the last argument , if it is an array , to
* be formatted in varargs syntax . */
public String toMethodSignature ( String name , boolean varargs ) { } } | StringBuffer buf = new StringBuffer ( ) ; buf . append ( mRetType . getFullName ( ) ) ; buf . append ( ' ' ) ; buf . append ( name ) ; buf . append ( '(' ) ; TypeDesc [ ] params = mParams ; for ( int i = 0 ; i < params . length ; i ++ ) { if ( i > 0 ) { buf . append ( ", " ) ; } TypeDesc param = params [ i ] ; if ( var... |
public class ParseUtil { /** * Appends the URL escape sequence for the specified char to the
* specified StringBuffer . */
private static int escape ( char [ ] cc , char c , int index ) { } } | cc [ index ++ ] = '%' ; cc [ index ++ ] = Character . forDigit ( ( c >> 4 ) & 0xF , 16 ) ; cc [ index ++ ] = Character . forDigit ( c & 0xF , 16 ) ; return index ; |
public class DroppedLabels { /** * Use { @ link # getLabelMap ( ) } instead . */
@ java . lang . Deprecated public java . util . Map < java . lang . String , java . lang . String > getLabel ( ) { } } | return getLabelMap ( ) ; |
public class IncomingDataPoints { /** * Validates the given metric and tags .
* @ throws IllegalArgumentException
* if any of the arguments aren ' t valid . */
static void checkMetricAndTags ( final String metric , final Map < String , String > tags ) { } } | if ( tags . size ( ) <= 0 ) { throw new IllegalArgumentException ( "Need at least one tag (metric=" + metric + ", tags=" + tags + ')' ) ; } else if ( tags . size ( ) > Const . MAX_NUM_TAGS ( ) ) { throw new IllegalArgumentException ( "Too many tags: " + tags . size ( ) + " maximum allowed: " + Const . MAX_NUM_TAGS ( ) ... |
public class CPDImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . CPD__CP_DESC : setCPDesc ( ( String ) newValue ) ; return ; case AfplibPackage . CPD__GCGID_LEN : setGCGIDLen ( ( Integer ) newValue ) ; return ; case AfplibPackage . CPD__NUM_CD_PTS : setNumCdPts ( ( Integer ) newValue ) ; return ; case AfplibPackage . CPD__GCSGID : setGCSGI... |
public class AbstractCache { /** * Helper method to send event when a new cache entry is inserted .
* @ param event the event to send . */
protected void sendEntryAddedEvent ( CacheEntryEvent < T > event ) { } } | for ( org . xwiki . cache . event . CacheEntryListener < T > listener : this . cacheEntryListeners . getListeners ( org . xwiki . cache . event . CacheEntryListener . class ) ) { listener . cacheEntryAdded ( event ) ; } |
public class ThriftUtils { /** * Deserializes a thrift object from byte array .
* @ param data
* @ param clazz
* @ return
* @ throws TException */
public static < T extends TBase < ? , ? > > T fromBytes ( byte [ ] data , Class < T > clazz ) throws TException { } } | if ( data == null ) { return null ; } ByteArrayInputStream bais = new ByteArrayInputStream ( data ) ; try { TTransport transport = new TIOStreamTransport ( bais , null ) ; TProtocol iProtocol = protocolFactory . getProtocol ( transport ) ; T record = clazz . newInstance ( ) ; record . read ( iProtocol ) ; // bais . clo... |
public class SMailConventionReceptionist { protected void officeManagedLogging ( Postcard postcard , String bodyFile , OptionalThing < Locale > receiverLocale ) { } } | final String systemTitle = PostOffice . LOGGING_TITLE_SYSINFO ; postcard . officeManagedLogging ( systemTitle , "dfmail" , bodyFile ) ; postcard . officeManagedLogging ( systemTitle , "locale" , receiverLocale . map ( lo -> lo . toString ( ) ) . orElse ( "none" ) ) ; |
public class AbstractKatharsisServlet { /** * { @ inheritDoc } */
@ Override protected void service ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { } } | request . setCharacterEncoding ( "UTF-8" ) ; KatharsisInvokerContext invokerContext = createKatharsisInvokerContext ( request , response ) ; try { getKatharsisInvoker ( ) . invoke ( invokerContext ) ; } catch ( KatharsisInvokerException e ) { log . warn ( "Katharsis Invoker exception." , e ) ; response . setStatus ( e ... |
public class MemcachedBackupSession { /** * { @ inheritDoc } */
@ Override public void setAuthType ( final String authType ) { } } | if ( ! equals ( authType , this . authType ) ) { _authenticationChanged = true ; } super . setAuthType ( authType ) ; |
public class BucketImpl { /** * Adds an element to the end of the bucket .
* @ param element the element to add */
private void add ( Element element ) { } } | if ( ivElements == null ) { ivElements = new Element [ DEFAULT_CAPACITY ] ; } else if ( ivTailIndex == ivElements . length ) { // No more room at the tail of the array . If we ' re completely out of
// space ( ivBaseIndex = = 0 ) , then we need a bigger array . Otherwise ,
// determine if we can reset ivBaseIndex to 0 ... |
public class MUSGeneration { /** * Computes a MUS for the given propositions with the default algorithm and the default configuration .
* @ param propositions the propositions
* @ param f the formula factory
* @ param < T > the type of the MUSes propositions
* @ return the MUS */
public < T extends Proposition ... | return this . computeMUS ( propositions , f , new MUSConfig . Builder ( ) . build ( ) ) ; |
public class Actors { /** * When called BEFORE resizing the stage , moves the actor to match the same aspect ratio as before . Useful for
* windows and dialogs in screen viewports .
* @ param actor will be repositioned .
* @ param stage has to be before resizing .
* @ param newScreenSizeInStageCoords screen coo... | if ( actor != null && stage != null ) { actor . setPosition ( ( int ) ( ( actor . getX ( ) + actor . getWidth ( ) / 2f ) / stage . getWidth ( ) * newScreenSizeInStageCoords . x - actor . getWidth ( ) / 2f ) , ( int ) ( ( actor . getY ( ) + actor . getHeight ( ) / 2f ) / stage . getHeight ( ) * newScreenSizeInStageCoord... |
public class TimerTrace { /** * Change mintime
* @ param mintime */
public static void setMinTime ( int mintime ) { } } | System . setProperty ( MIN_TIME , String . valueOf ( mintime ) ) ; TimerTrace . mintime = mintime ; |
public class SObject { /** * Construct a sobject with key , input stream and attributes specified in a
* sequence like key1 , val1 , key2 , val2 , . . .
* < p > Node the sobject constrcuted from input stream has limits
* please see the comment to { @ link # of ( String , InputStream ) }
* @ see # of ( String , ... | SObject sobj = of ( key , is ) ; Map < String , String > map = C . Map ( attrs ) ; sobj . setAttributes ( map ) ; return sobj ; |
public class PermutationSwapMutation { /** * / * Execute ( ) method */
@ Override public PermutationSolution < T > execute ( PermutationSolution < T > solution ) { } } | if ( null == solution ) { throw new JMetalException ( "Null parameter" ) ; } doMutation ( solution ) ; return solution ; |
public class TargetsApi { /** * Get a target
* Get a specific target by type and ID . Targets can be agents , agent groups , queues , route points , skills , and custom contacts .
* @ param id The ID of the target . ( required )
* @ param type The type of target to retrieve . ( required )
* @ return TargetsResp... | ApiResponse < TargetsResponse > resp = getTargetWithHttpInfo ( id , type ) ; return resp . getData ( ) ; |
public class StorageDir { /** * Adds the metadata of a new block into this storage dir .
* @ param blockMeta the metadata of the block
* @ throws BlockAlreadyExistsException if blockId already exists
* @ throws WorkerOutOfSpaceException when not enough space to hold block */
public void addBlockMeta ( BlockMeta b... | Preconditions . checkNotNull ( blockMeta , "blockMeta" ) ; long blockId = blockMeta . getBlockId ( ) ; long blockSize = blockMeta . getBlockSize ( ) ; if ( getAvailableBytes ( ) < blockSize ) { throw new WorkerOutOfSpaceException ( ExceptionMessage . NO_SPACE_FOR_BLOCK_META , blockId , blockSize , getAvailableBytes ( )... |
public class WorkflowExecutor { /** * Performs the actual workflow execution in the correct order . < br >
* If an exceptional case is reached , all already executed steps will be rolled back prior to throwing the exception .
* @ throws MojoExecutionException if any of the processing steps of the workflow throw suc... | this . log . info ( "Executing the standard workflow of the goal" ) ; this . executedSteps = new Stack < Pair < CDIMojoProcessingStep , ExecutionContext > > ( ) ; try { for ( WorkflowStep workflowStep : this . workflow . getProcessingSteps ( ) ) { executeSequentialWorkflowStep ( workflowStep ) ; executeParallelWorkflow... |
public class CreateWSDL11 { /** * CreateMarshallableObject Method . */
public Object createMarshallableObject ( ) { } } | wsdlFactory = new org . xmlsoap . schemas . wsdl . ObjectFactory ( ) ; // create a wsdl object
TDefinitions TDefinitions = wsdlFactory . createTDefinitions ( ) ; JAXBElement < TDefinitions > root = wsdlFactory . createDefinitions ( TDefinitions ) ; String targetNamespace = this . getNamespace ( ) ; // Location of this ... |
public class SortedTextFile { /** * end exclusive */
public String [ ] getNthSplit ( String start , String end , int split , int numSplits ) throws IOException { } } | SeekableLineReader slr = null ; String startLine = null ; String endLine = null ; try { slr = factory . get ( ) ; long [ ] offsets = getStartEndOffsets ( slr , start , end ) ; long startOffset = offsets [ 0 ] ; long diff = offsets [ 1 ] - offsets [ 0 ] ; long seekDiff = ( diff * split ) / numSplits ; slr . seek ( start... |
public class Try { /** * { @ inheritDoc } */
@ Override public < B > Try < T , B > biMapR ( Function < ? super A , ? extends B > fn ) { } } | return ( Try < T , B > ) BoundedBifunctor . super . < B > biMapR ( fn ) ; |
public class GSCAImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . GSCA__XPOS : return XPOS_EDEFAULT == null ? xpos != null : ! XPOS_EDEFAULT . equals ( xpos ) ; case AfplibPackage . GSCA__YPOS : return YPOS_EDEFAULT == null ? ypos != null : ! YPOS_EDEFAULT . equals ( ypos ) ; } return super . eIsSet ( featureID ) ; |
public class PrefHelper { /** * Package Private */
static void shutDown ( ) { } } | if ( prefHelper_ != null ) { prefHelper_ . prefsEditor_ = null ; } // Reset all of the statics .
enableLogging_ = false ; Branch_Key = null ; savedAnalyticsData_ = null ; prefHelper_ = null ; |
public class SqlStageExecution { /** * this is used for query info building which should be independent of scheduling work */
public List < RemoteTask > getAllTasks ( ) { } } | return tasks . values ( ) . stream ( ) . flatMap ( Set :: stream ) . collect ( toImmutableList ( ) ) ; |
public class ThumborUrlBuilder { /** * Assemble the configuration section of the URL . */
StringBuilder assembleConfig ( boolean meta ) { } } | StringBuilder builder = new StringBuilder ( ) ; if ( meta ) { builder . append ( PREFIX_META ) ; } if ( isTrim ) { builder . append ( PART_TRIM ) ; if ( trimPixelColor != null ) { builder . append ( ":" ) . append ( trimPixelColor . value ) ; if ( trimColorTolerance > 0 ) { builder . append ( ":" ) . append ( trimColor... |
public class GroovyClassLoader { /** * Parses the given file into a Java class capable of being run
* @ param file the file name to parse
* @ return the main class defined in the given script */
public Class parseClass ( File file ) throws CompilationFailedException , IOException { } } | return parseClass ( new GroovyCodeSource ( file , config . getSourceEncoding ( ) ) ) ; |
public class UIViewRoot { /** * language - country - variant . */
private static Locale getLocaleFromString ( String localeStr ) throws IllegalArgumentException { } } | // length must be at least 2.
if ( null == localeStr || localeStr . length ( ) < 2 ) { throw new IllegalArgumentException ( "Illegal locale String: " + localeStr ) ; } Locale result = null ; String lang = null ; String country = null ; String variant = null ; char [ ] seps = { '-' , '_' } ; int inputLength = localeStr ... |
public class JavaBeanGeneratorCreator { /** * Setup property to generate a random value
* @ param property the property randomize
* @ return the creator instance */
public JavaBeanGeneratorCreator < T > randomizeProperty ( String property ) { } } | if ( property == null || property . length ( ) == 0 ) return this ; this . randomizeProperties . add ( property ) ; return this ; |
public class PythonStreamer { /** * Sends all broadcast - variables encoded in the configuration to the external process .
* @ param config configuration object containing broadcast - variable count and names
* @ throws IOException */
public final void sendBroadCastVariables ( Configuration config ) throws IOExcept... | try { int broadcastCount = config . getInteger ( PLANBINDER_CONFIG_BCVAR_COUNT , 0 ) ; String [ ] names = new String [ broadcastCount ] ; for ( int x = 0 ; x < names . length ; x ++ ) { names [ x ] = config . getString ( PLANBINDER_CONFIG_BCVAR_NAME_PREFIX + x , null ) ; } out . write ( new IntSerializer ( ) . serializ... |
public class DependencyRelation { /** * setter for head - sets Head ( Token ) of the analyzed dependency relation , C
* @ generated
* @ param v value to set into the feature */
public void setHead ( Token v ) { } } | if ( DependencyRelation_Type . featOkTst && ( ( DependencyRelation_Type ) jcasType ) . casFeat_head == null ) jcasType . jcas . throwFeatMissing ( "head" , "de.julielab.jules.types.DependencyRelation" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( DependencyRelation_Type ) jcasType ) . casFeatCode_head , jcasType ... |
public class LSrtFunctionBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static < R > LSrtFunction < R > srtFunctionFrom ( Consumer < LSrtFunctionBuilder < R > > buildingFunction ) { } } | LSrtFunctionBuilder builder = new LSrtFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class LogStreamWriter { /** * / * ( non - Javadoc )
* @ see tuwien . auto . calimero . log . LogWriter # write
* ( java . lang . String , tuwien . auto . calimero . log . LogLevel , java . lang . String ,
* java . lang . Throwable ) */
public void write ( String logService , LogLevel level , String msg , T... | doWrite ( logService , level , msg , t ) ; |
public class TemplateSignatureRequest { /** * Overwrites the current map of custom fields to the provided map . This is
* a map of String field names to String field values .
* @ param fields Map */
public void setCustomFields ( Map < String , String > fields ) { } } | clearCustomFields ( ) ; for ( String key : fields . keySet ( ) ) { CustomField f = new CustomField ( ) ; f . setName ( key ) ; f . setValue ( fields . get ( key ) ) ; customFields . add ( f ) ; } |
public class ClassUtils { /** * Please do not use - internal
* org / my / Class . xxx - > org / my / Class */
public static String stripExtension ( final String pResourceName ) { } } | final int i = pResourceName . lastIndexOf ( '.' ) ; return pResourceName . substring ( 0 , i ) ; |
public class BomParser { /** * / * - - - Public methods - - - */
public BomFile parseBomFile ( String bomPath ) { } } | BomFile bomFile = null ; String json = null ; try ( InputStream is = new FileInputStream ( bomPath ) ) { json = IOUtils . toString ( is ) ; } catch ( FileNotFoundException e ) { logger . error ( "file Not Found: {}" , bomPath ) ; } catch ( IOException e ) { logger . error ( "error getting file : {}" , e . getMessage ( ... |
public class UReport { /** * Simple helper method that prints the specified title , underlined with ' = '
* characters .
* @ param writer
* the writer to write the title to .
* @ param title
* the title to print ( null or empty titles will be ignored ) .
* @ throws IOException
* if the writer fails . */
p... | if ( title == null || title . isEmpty ( ) ) { return ; } String out = String . format ( "%s\n%s\n\n" , title , Stream . generate ( ( ) -> "=" ) . limit ( title . length ( ) ) . collect ( Collectors . joining ( ) ) ) ; writer . write ( out ) ; |
public class Snappy { /** * Uncompress the content in the input buffer . The result is dumped to the
* specified output buffer .
* Note that if you pass the wrong data or the range [ pos ( ) , limit ( ) ) that
* cannot be uncompressed , your JVM might crash due to the access violation
* exception issued in the ... | if ( ! compressed . isDirect ( ) ) { throw new SnappyError ( SnappyErrorCode . NOT_A_DIRECT_BUFFER , "input is not a direct buffer" ) ; } if ( ! uncompressed . isDirect ( ) ) { throw new SnappyError ( SnappyErrorCode . NOT_A_DIRECT_BUFFER , "destination is not a direct buffer" ) ; } int cPos = compressed . position ( )... |
public class ElUtils { /** * Analyze string for variables .
* @ param str string to analyze
* @ return found variable names */
public static List < String > findVars ( final String str ) { } } | final List < String > vars = new ArrayList < String > ( ) ; final char [ ] strArray = str . toCharArray ( ) ; int i = 0 ; while ( i < strArray . length - 1 ) { if ( strArray [ i ] == VAR_START && strArray [ i + 1 ] == VAR_LEFT_BOUND ) { i = i + 2 ; final int begin = i ; while ( strArray [ i ] != VAR_RIGHT_BOUND ) { ++ ... |
public class DisplayUtils { /** * dp转px
* @ param context
* @ return */
public static int dp2px ( Context context , float dpVal ) { } } | return ( int ) TypedValue . applyDimension ( TypedValue . COMPLEX_UNIT_DIP , dpVal , context . getResources ( ) . getDisplayMetrics ( ) ) ; |
public class NetworkInterfacesInner { /** * Gets all network security groups applied to a network interface .
* @ param resourceGroupName The name of the resource group .
* @ param networkInterfaceName The name of the network interface .
* @ throws IllegalArgumentException thrown if parameters fail the validation... | return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync ( resourceGroupName , networkInterfaceName ) . map ( new Func1 < ServiceResponse < EffectiveNetworkSecurityGroupListResultInner > , EffectiveNetworkSecurityGroupListResultInner > ( ) { @ Override public EffectiveNetworkSecurityGroupListResultInner c... |
public class AbstractGatewayWebSocket { /** * When a binary message is received from a WebSocket client , this method will lookup the { @ link WsCommand } for the
* given request class and execute it .
* @ param binaryDataStream contains the JSON request and additional binary data
* @ param session the client ses... | String requestClassName = "?" ; try { // parse the JSON and get its message POJO , including any additional binary data being streamed
BasicMessageWithExtraData < BasicMessage > reqWithData = new ApiDeserializer ( ) . deserialize ( binaryDataStream ) ; BasicMessage request = reqWithData . getBasicMessage ( ) ; requestC... |
public class Collator { /** * < strong > [ icu ] < / strong > Returns the name of the collator for the objectLocale , localized for the
* displayLocale .
* @ param objectLocale the locale of the collator
* @ param displayLocale the locale for the collator ' s display name
* @ return the display name */
static p... | return getShim ( ) . getDisplayName ( ULocale . forLocale ( objectLocale ) , ULocale . forLocale ( displayLocale ) ) ; |
public class JobExecutionsInner { /** * Lists all executions in a job 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 .
* @ param jobAgentName T... | ServiceResponse < Page < JobExecutionInner > > response = listByAgentSinglePageAsync ( resourceGroupName , serverName , jobAgentName , createTimeMin , createTimeMax , endTimeMin , endTimeMax , isActive , skip , top ) . toBlocking ( ) . single ( ) ; return new PagedList < JobExecutionInner > ( response . body ( ) ) { @ ... |
public class MetadataUIUtils { /** * Locate mdui for entity id simple metadata ui info .
* @ param entityDescriptor the entity descriptor
* @ param entityId the entity id
* @ param registeredService the registered service
* @ param requestContext the request context
* @ return the simple metadata ui info */
p... | val mdui = new SamlMetadataUIInfo ( registeredService , requestContext . getLocale ( ) . getLanguage ( ) ) ; if ( entityDescriptor == null ) { LOGGER . trace ( "Entity descriptor not found for [{}]" , entityId ) ; return mdui ; } val spssoDescriptor = getSPSsoDescriptor ( entityDescriptor ) ; if ( spssoDescriptor == nu... |
public class BatchPoints { /** * Merge two BatchPoints objects .
* @ param that batch point to merge in
* @ return true if the batch points have been merged into this BatchPoints instance . Return false otherwise . */
public boolean mergeIn ( final BatchPoints that ) { } } | boolean mergeAble = isMergeAbleWith ( that ) ; if ( mergeAble ) { this . points . addAll ( that . points ) ; } return mergeAble ; |
public class CommonUtils { /** * Convert script file into path to Java class file .
* @ param targetDir the target dir for generated sources , it can be null
* @ param classPackage class package to override extracted one from script name , it can be null
* @ param scriptFile the script file , must not be null
*... | final String rawFileName = FilenameUtils . getBaseName ( scriptFile . getName ( ) ) ; final String className = CommonUtils . extractClassName ( rawFileName ) ; final String packageName = classPackage == null ? CommonUtils . extractPackageName ( rawFileName ) : classPackage ; String fullClassName = packageName . isEmpty... |
public class ServletContextFacade { /** * Adds a filter against a specified mapping into this context
* @ param mapping
* @ param config */
public void addMappingFilter ( String mapping , com . ibm . websphere . servlet . filter . IFilterConfig config ) { } } | context . addMappingFilter ( mapping , config ) ; |
public class CompactionSource { /** * Copy dependent jars to a temporary job directory on HDFS */
private void copyJarDependencies ( State state ) throws IOException { } } | if ( this . tmpJobDir == null ) { throw new RuntimeException ( "Job directory is not created" ) ; } if ( ! state . contains ( ConfigurationKeys . JOB_JAR_FILES_KEY ) ) { return ; } // create sub - dir to save jar files
LocalFileSystem lfs = FileSystem . getLocal ( HadoopUtils . getConfFromState ( state ) ) ; Path tmpJa... |
public class BootstrapConfig { /** * Allocate a file in the server output directory , e . g .
* server - data / serverName / relativeServerPath
* @ param relativeServerPath
* relative path of file to create in the server directory
* @ return File object for relative path , or for the server directory itself
*... | if ( relativeServerPath == null ) return outputDir ; else return new File ( outputDir , relativeServerPath ) ; |
public class FastMath { /** * Returns the first argument with the sign of the second argument .
* A NaN { @ code sign } argument is treated as positive .
* @ param magnitude the value to return
* @ param sign the sign for the returned value
* @ return the magnitude with the same sign as the { @ code sign } argu... | int m = Float . floatToIntBits ( magnitude ) ; int s = Float . floatToIntBits ( sign ) ; if ( ( m >= 0 && s >= 0 ) || ( m < 0 && s < 0 ) ) { // Sign is currently OK
return magnitude ; } return - magnitude ; // flip sign |
public class AbstractSimpleObjectModel { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) @ Override protected void prepareView ( ) { } } | try { // Build the node by reflection without any parameter or excluded class
this . rootNode = ( N ) ClassUtility . buildGenericType ( this . getClass ( ) , Node . class ) ; // Find the RootNodeId annotation
final RootNodeId rni = ClassUtility . getLastClassAnnotation ( this . getClass ( ) , RootNodeId . class ) ; if ... |
public class AbstractDoclet { /** * The method that starts the execution of the doclet .
* @ param doclet
* the doclet to start the execution for .
* @ param root
* the { @ link com . sun . javadoc . RootDoc } that points to the source
* to document .
* @ return true if the doclet executed without error . F... | configuration = configuration ( ) ; configuration . root = root ; try { doclet . startGeneration ( root ) ; } catch ( Exception exc ) { exc . printStackTrace ( ) ; return false ; } return true ; |
public class Strman { /** * Returns a copy of the string in which all the case - based characters have had their case swapped .
* @ param input Input string
* @ return String with all the case swapped */
public static String swapCase ( String input ) { } } | if ( input == null || input . length ( ) == 0 ) { return "" ; } StringBuilder resultBuilder = new StringBuilder ( ) ; for ( char ch : input . toCharArray ( ) ) { if ( Character . isUpperCase ( ch ) ) { resultBuilder . append ( Character . toLowerCase ( ch ) ) ; } else { resultBuilder . append ( Character . toUpperCase ... |
public class MongoDBTupleSnapshot { /** * The internal structure of a { @ link Document } is like a tree . Each embedded object is a new { @ code Document }
* itself . We traverse the tree until we ' ve arrived at a leaf and retrieve the value from it . */
private Object getValue ( Document dbObject , String column )... | Object valueOrNull = MongoHelpers . getValueOrNull ( dbObject , column ) ; return valueOrNull ; |
public class HelpFormatter { /** * Print the specified text to the specified PrintWriter .
* @ param nextLineTabStop the position on the next line for the first tab
* @ param text the text to be written to the PrintWriter */
private void printWrapped ( int nextLineTabStop , String text ) { } } | StringBuilder sb = new StringBuilder ( text . length ( ) ) ; renderWrappedTextBlock ( sb , nextLineTabStop , text ) ; console . writeLine ( sb . toString ( ) ) ; |
public class BrowserSessionImpl { /** * Close this BrowserSession . . .
* Dereference from the parent connection and set the closed flag to true .
* @ see com . ibm . ws . sib . processor . BrowserSession # close ( ) */
public void close ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIBrowserSession . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIBrowserSession . tc , "close" , this ) ; synchronized ( this ) { if ( ! _closed ) // if we ' re closed already , don ' t bother doing anything .
{ // dereference from the parent connection
_conn . r... |
public class ProductSearchClient { /** * Permanently deletes a ProductSet . Products and ReferenceImages in the ProductSet are not
* deleted .
* < p > The actual image files are not deleted from Google Cloud Storage .
* < p > Possible errors :
* < p > & # 42 ; Returns NOT _ FOUND if the ProductSet does not exis... | DeleteProductSetRequest request = DeleteProductSetRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; deleteProductSet ( request ) ; |
public class ApiOvhSms { /** * Create the sms sender given
* REST : POST / sms / { serviceName } / senders
* @ param description [ required ] Sender description
* @ param sender [ required ] The sender ( alpha or phone number )
* @ param reason [ required ] Message seen by the moderator
* @ param serviceName ... | String qPath = "/sms/{serviceName}/senders" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "description" , description ) ; addBody ( o , "reason" , reason ) ; addBody ( o , "sender" , sender ) ; String resp = exec ( qPath , "POST" ... |
public class AbstractServerBase { /** * Creates a thread pool for the query execution .
* @ return Thread pool for query execution */
private ExecutorService createQueryExecutor ( ) { } } | ThreadFactory threadFactory = new ThreadFactoryBuilder ( ) . setDaemon ( true ) . setNameFormat ( "Flink " + getServerName ( ) + " Thread %d" ) . build ( ) ; return Executors . newFixedThreadPool ( numQueryThreads , threadFactory ) ; |
public class SourceInfoUtil { /** * This method gets the source information associated with the supplied
* traces .
* @ param tenantId The tenant id
* @ param items The trace instances
* @ return The source info
* @ throws RetryAttemptException Failed to initialise source information */
public static List < S... | List < SourceInfo > sourceInfoList = new ArrayList < SourceInfo > ( ) ; int curpos = 0 ; // This method initialises the deriver with a list of trace fragments
// that will need to be referenced when correlating a consumer with a producer
for ( int i = 0 ; i < items . size ( ) ; i ++ ) { // Need to check for Producer no... |
public class Database { /** * Finds the nearest relative of this node .
* The nearest relative is either the next sibling , previous sibling , or parent in the case
* where it is an only child . If it is not found to be a member of this tree , null is returned .
* If you pass in the root node , null is returned .... | // If it ' s root , there are no siblings
if ( account . isRoot ( ) ) return null ; // If it has no parent , it ' s not in this tree
Account parent = findParent ( account ) ; if ( parent == null ) return null ; // It ' s an only child , return the parent
if ( parent . getChildren ( ) . size ( ) == 1 ) return parent ; /... |
public class AmazonRedshiftClient { /** * Returns a list of all the available maintenance tracks .
* @ param describeClusterTracksRequest
* @ return Result of the DescribeClusterTracks operation returned by the service .
* @ throws InvalidClusterTrackException
* The provided cluster track name is not valid .
... | request = beforeClientExecution ( request ) ; return executeDescribeClusterTracks ( request ) ; |
public class ManagedServerBootCmdFactory { /** * { @ inheritDoc } */
@ Override public boolean compareServerLaunchCommand ( ManagedServerBootConfiguration other ) { } } | boolean comparable = other instanceof ManagedServerBootCmdFactory ; if ( comparable ) { ManagedServerBootCmdFactory otherImpl = ( ManagedServerBootCmdFactory ) other ; comparable = getJvmType ( false ) . equals ( otherImpl . getJvmType ( false ) ) && getServerLaunchCommand ( false , false ) . equals ( otherImpl . getSe... |
public class ServerShutdownHandler { /** * { @ inheritDoc } */
@ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { } } | renameTimeoutToSuspendTimeout ( operation ) ; final boolean restart = RESTART . resolveModelAttribute ( context , operation ) . asBoolean ( ) ; final int timeout = SUSPEND_TIMEOUT . resolveModelAttribute ( context , operation ) . asInt ( ) ; // in seconds , need to convert to ms
// Acquire the controller lock to preven... |
public class SimplePolygonParser { /** * Parse a single line .
* @ return { @ code true } if the line was read successful . */
private boolean parseLine ( ) { } } | cureid = null ; curpoly = null ; curlbl = null ; polys . clear ( ) ; coords . clear ( ) ; labels . clear ( ) ; Matcher m = COORD . matcher ( reader . getBuffer ( ) ) ; for ( /* initialized by nextLineExceptComments */
; tokenizer . valid ( ) ; tokenizer . advance ( ) ) { m . region ( tokenizer . getStart ( ) , tokenize... |
public class Types { /** * Checks if the given class should be instrumented . Returns true if the
* class should not be instrumented , false otherwise . */
@ Research public static boolean isRetransformIgnorable ( Class < ? > clz ) { } } | String className = clz . getName ( ) ; return ( isIgnorableBinName ( className ) || className . startsWith ( Names . ORG_APACHE_MAVEN_BIN , 0 ) || className . startsWith ( Names . ORG_JUNIT_PACKAGE_BIN , 0 ) || className . startsWith ( Names . JUNIT_FRAMEWORK_PACKAGE_BIN , 0 ) ) ; |
public class MapType { /** * Whether the type is permissible as a key in a Soy { @ code map } ( { @ link MapType } ) . */
public static boolean isAllowedKeyType ( SoyType type ) { } } | switch ( type . getKind ( ) ) { case BOOL : case INT : case FLOAT : case STRING : case PROTO_ENUM : return true ; default : return type == SoyTypes . NUMBER_TYPE ; } |
public class XmlUtils { /** * Replaces the text value of a node in a document with the specified value
* using XPath .
* @ param doc The document to modify .
* @ param xPath The XPath string to locate the node to modify . This
* should point to the { @ link Node } containing a { @ link Text } node as its
* fi... | final Text textNode = doc . createTextNode ( newValue ) ; try { final Node node = ( Node ) s_path . evaluate ( xPath , doc , XPathConstants . NODE ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Found node: " + node . getNodeName ( ) ) ; } if ( node == null ) { LOG . warn ( "Could not find xPath: " + xPath ) ; ret... |
public class CacheKeyBuilder { /** * Add a collection of strings to the cache key .
* Strings in the collection are sorted by their byte representation and
* concatenated with a separator of ' 0xFF ' .
* @ param input a collection of strings to be included in the cache key
* @ return this instance */
public Cac... | appendItem ( STRING_LIST_KEY , stringCollectionToByteArray ( input , false ) ) ; return this ; |
public class MpTransactionTaskQueue { /** * faking an unsuccessful FragmentResponseMessage . */
synchronized void repair ( SiteTasker task , List < Long > masters , Map < Integer , Long > partitionMasters , boolean balanceSPI ) { } } | // We know that every Site assigned to the MPI ( either the main writer or
// any of the MP read pool ) will only have one active transaction at a time ,
// and that we either have active reads or active writes , but never both .
// Figure out which we ' re doing , and then poison all of the appropriate sites .
Map < L... |
public class AppsImpl { /** * Updates the name or description of the application .
* @ param appId The application ID .
* @ param applicationUpdateObject A model containing Name and Description of the application .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the obser... | if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( applicationUpdateObject == null ) { throw n... |
public class servicegroup { /** * Use this API to rename a servicegroup resource . */
public static base_response rename ( nitro_service client , servicegroup resource , String new_servicegroupname ) throws Exception { } } | servicegroup renameresource = new servicegroup ( ) ; renameresource . servicegroupname = resource . servicegroupname ; return renameresource . rename_resource ( client , new_servicegroupname ) ; |
public class FluentIterable { /** * Returns a fluent iterable whose iterators traverse first the elements of this fluent iterable ,
* followed by { @ code elements } .
* < p > < b > { @ code Stream } equivalent : < / b > { @ code Stream . concat ( thisStream , Stream . of ( elements ) ) } .
* @ since 18.0 */
@ Be... | return from ( FluentIterable . concat ( getDelegate ( ) , Arrays . asList ( elements ) ) ) ; |
public class AdHocCompilerCache { /** * Get the global cache for a given hash of the catalog . Note that there can be only
* one cache per catalogHash at a time . */
public synchronized static AdHocCompilerCache getCacheForCatalogHash ( byte [ ] catalogHash ) { } } | String hashString = Encoder . hexEncode ( catalogHash ) ; AdHocCompilerCache cache = m_catalogHashMatch . getIfPresent ( hashString ) ; if ( cache == null ) { cache = new AdHocCompilerCache ( ) ; m_catalogHashMatch . put ( hashString , cache ) ; } return cache ; |
public class MultiFileOutputStream { /** * All accesses are already synchronized . */
private void makeNewFile ( ) throws IOException { } } | String filename = prefix + ( files . size ( ) + 1 ) + suffix ; File file = new File ( parent , filename ) ; out = new FileOutputStream ( file ) ; bytesOut = 0 ; files . add ( file ) ; |
public class MergedStereotypes { /** * Perform the merge
* @ param stereotypeAnnotations The stereotype annotations */
protected void merge ( Set < Annotation > stereotypeAnnotations ) { } } | final MetaAnnotationStore store = manager . getServices ( ) . get ( MetaAnnotationStore . class ) ; for ( Annotation stereotypeAnnotation : stereotypeAnnotations ) { // Retrieve and merge all metadata from stereotypes
StereotypeModel < ? > stereotype = store . getStereotype ( stereotypeAnnotation . annotationType ( ) )... |
public class DefaultIndexRedirect { /** * Extending this class and implementing { @ link Home } will make use of this
* method . */
@ Override public Object get ( HttpServletRequest req , HttpServletResponse res ) throws IOException { } } | res . sendRedirect ( path ) ; return null ; |
public class ASrvOrm { /** * < p > Refresh entity from DB by its ID . < / p >
* @ param < T > entity type
* @ param pAddParam additional param
* @ param pEntityClass entity class
* @ param pItsId entity ID
* @ return entity or null
* @ throws Exception - an exception */
@ Override public final < T > T retri... | String query = evalSqlSelect ( pAddParam , pEntityClass ) ; @ SuppressWarnings ( "unchecked" ) IFactorySimple < T > facEn = ( IFactorySimple < T > ) this . entitiesFactoriesFatory . lazyGet ( pAddParam , pEntityClass ) ; T entity = facEn . create ( pAddParam ) ; @ SuppressWarnings ( "unchecked" ) IFillerObjectFields < ... |
public class CLIQUEUnit { /** * Returns true if this unit is the right neighbor of the given unit .
* @ param unit Reference unit
* @ param d Current dimension
* @ return true if this unit is the right neighbor of the given unit */
protected boolean containsRightNeighbor ( CLIQUEUnit unit , int d ) { } } | final int e = dims . length - 1 ; return checkDimensions ( unit , e ) && bounds [ e << 1 ] == unit . bounds [ ( e << 1 ) + 1 ] ; |
public class DescribeFleetUtilizationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeFleetUtilizationRequest describeFleetUtilizationRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeFleetUtilizationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeFleetUtilizationRequest . getFleetIds ( ) , FLEETIDS_BINDING ) ; protocolMarshaller . marshall ( describeFleetUtilizationRequest . getLimit ( ) ,... |
public class AccountsInner { /** * Creates the specified Data Lake Analytics account . This supplies the user with computation services for Data Lake Analytics workloads .
* @ param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account . the account will be associated wi... | return createWithServiceResponseAsync ( resourceGroupName , name , parameters ) . map ( new Func1 < ServiceResponse < DataLakeAnalyticsAccountInner > , DataLakeAnalyticsAccountInner > ( ) { @ Override public DataLakeAnalyticsAccountInner call ( ServiceResponse < DataLakeAnalyticsAccountInner > response ) { return respo... |
public class SARLJvmModelInferrer { /** * Open the context for the generation of a SARL - specific element .
* @ param sarlObject the SARL object that is the cause of the generation .
* @ param type the generated type .
* @ param supportedMemberTypes the types of the supported members .
* @ return the created c... | assert type != null ; assert supportedMemberTypes != null ; this . sarlSignatureProvider . clear ( type ) ; final GenerationContext context = new GenerationContext ( sarlObject , type ) { @ Override public boolean isSupportedMember ( XtendMember member ) { for ( final Class < ? extends XtendMember > supportedMemberType... |
public class ProofObligation { /** * string as it exists in the current version */
@ Override public String getFullPredString ( ) { } } | if ( valuetree . getPredicate ( ) == null ) { return "" ; } String result = valuetree . getPredicate ( ) . toString ( ) ; return result ; |
public class RemoteTransactionControllerService { /** * ( non - Javadoc )
* @ see com . ibm . tx . remote . RemoteTransactionController # replayCompletion ( java . lang . String ) */
@ Override public boolean replayCompletion ( String globalId ) { } } | final DistributableTransaction tx = getTransactionForID ( globalId ) ; if ( tx != null ) { tx . replayCompletion ( ) ; return true ; } return false ; |
public class TypePoolGroupNameMap { /** * Put the value with the appropriate keys
* @ param type Resource type
* @ param poolGroup Name of pool group
* @ param value Value to put
* @ return Previous value , can be null if wasn ' t set */
public V put ( ResourceType type , String poolGroupName , V value ) { } } | Map < String , V > poolGroupNameMap = typePoolGroupNameMap . get ( type ) ; if ( poolGroupNameMap == null ) { poolGroupNameMap = new HashMap < String , V > ( ) ; typePoolGroupNameMap . put ( type , poolGroupNameMap ) ; } return poolGroupNameMap . put ( poolGroupName , value ) ; |
public class EventMention { /** * setter for level - sets
* @ generated
* @ param v value to set into the feature */
public void setLevel ( String v ) { } } | if ( EventMention_Type . featOkTst && ( ( EventMention_Type ) jcasType ) . casFeat_level == null ) jcasType . jcas . throwFeatMissing ( "level" , "de.julielab.jules.types.ace.EventMention" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( EventMention_Type ) jcasType ) . casFeatCode_level , v ) ; |
public class HashFunctions { /** * Hashing long to int . < p / > < h3 > Links < / h3 > < a href = " http : / / www . concentric . net / ~ ttwang / tech / inthash . htm " > http : / / www . concentric . net / ~ ttwang / tech / inthash . htm < / a > < br / >
* @ param key key to be hashed
* @ return hashed value */
p... | key = ( ~ key ) + ( key << 18 ) ; // key = ( key < < 18 ) - key - 1;
key = key ^ ( key >>> 31 ) ; key = key * 21 ; // key = ( key + ( key < < 2 ) ) + ( key < < 4 ) ;
key = key ^ ( key >>> 11 ) ; key = key + ( key << 6 ) ; key = key ^ ( key >>> 22 ) ; return ( int ) key ; |
public class ValidateVisitor { /** * PK29373 */
protected void validateTagLib ( Document jspDocument , String uri , String prefix , TagLibraryInfoImpl tli ) throws JspCoreException { } } | TagLibraryValidator tlv = tli . getTagLibraryValidator ( ) ; if ( tlv != null ) { ClassLoader originalClassLoader = ThreadContextHelper . getContextClassLoader ( ) ; ThreadContextHelper . setClassLoader ( context . getJspClassloaderContext ( ) . getClassLoader ( ) ) ; try { ValidationMessage [ ] validationMessages = tl... |
public class BNFHeadersImpl { /** * Completely clear out all the information on this object when it
* is no longer used . */
protected void destroy ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Destroying these headers: " + this ) ; } // if we have headers present , or reference parse buffers ( i . e .
// the first header parsed threw an error perhaps ) , then clear
// the message now
if ( null != this . hdrSequenc... |
public class NodeUtil { /** * A pre - order traversal , calling Visitor . visit for each child matching the predicate . */
public static void visitPreOrder ( Node node , Visitor visitor , Predicate < Node > traverseChildrenPred ) { } } | visitor . visit ( node ) ; if ( traverseChildrenPred . apply ( node ) ) { for ( Node c = node . getFirstChild ( ) ; c != null ; c = c . getNext ( ) ) { visitPreOrder ( c , visitor , traverseChildrenPred ) ; } } |
public class Common { /** * Register all the commands */
private void registerCommands ( ) { } } | commandManager . setWrongLevelMsg ( languageManager . getString ( "command_disabled_setup_mode" ) ) ; SubCommand money = new SubCommand ( "money" , commandManager , null , 1 ) ; money . addCommand ( "" , new MainCommand ( ) ) ; money . addCommand ( "all" , new AllCommand ( ) ) ; money . addCommand ( "pay" , new PayComm... |
public class SignalRsInner { /** * Checks that the SignalR name is valid and is not already in use .
* @ param location the region
* @ param parameters Parameters supplied to the operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the NameAvailab... | return checkNameAvailabilityWithServiceResponseAsync ( location , parameters ) . map ( new Func1 < ServiceResponse < NameAvailabilityInner > , NameAvailabilityInner > ( ) { @ Override public NameAvailabilityInner call ( ServiceResponse < NameAvailabilityInner > response ) { return response . body ( ) ; } } ) ; |
import java . util . * ; class ExtractLastElements { /** * This function extracts the last element from a list of tuples .
* > > > extract _ last _ elements ( [ ( 1 , ' Rash ' , 21 ) , ( 2 , ' Varsha ' , 20 ) , ( 3 , ' Kil ' , 19 ) ] )
* [ 21 , 20 , 19]
* > > > extract _ last _ elements ( [ ( 1 , ' Sai ' , 36 ) ,... | List < Integer > result = new ArrayList < > ( ) ; for ( List < Object > tup : tuplesList ) { result . add ( ( Integer ) tup . get ( tup . size ( ) - 1 ) ) ; } return result ; |
public class StorableGenerator { /** * Generates code to call a trigger after the persistence operation has
* failed .
* @ param opType type of operation , Insert , Update , or Delete
* @ param triggerVar required variable of type Trigger for retrieving trigger
* @ param txnVar required variable of type Transac... | TypeDesc transactionType = TypeDesc . forClass ( Transaction . class ) ; // if ( trigger ! = null ) {
b . loadLocal ( triggerVar ) ; Label isNull = b . createLabel ( ) ; b . ifNullBranch ( isNull , true ) ; // try {
// trigger . failedXxx ( this , state ) ;
// } catch ( Throwable e ) {
// uncaught ( e ) ;
Label tryStar... |
public class LongTupleFunctions { /** * Applies the given unary operator to element from the given tuple ,
* and stores the result in the given result tuple .
* If the given result tuple is < code > null < / code > , then a new tuple
* will be created and returned .
* @ param t0 The tuple
* @ param op The ope... | result = LongTuples . validate ( t0 , result ) ; int n = t0 . getSize ( ) ; for ( int i = 0 ; i < n ; i ++ ) { long operand0 = t0 . get ( i ) ; long r = op . applyAsLong ( operand0 ) ; result . set ( i , r ) ; } return result ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.