signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class NlsBundleHelper { /** * This method determines if the given { @ link Method } is a regular { @ link NlsBundle } - method . * @ param method the { @ link Method } to check . * @ param ignoreIllegalMethods - { @ code true } if illegal methods ( non NlsBundleMethods other than those defined by * { @ lin...
Class < ? > declaringClass = method . getDeclaringClass ( ) ; assert ( declaringClass . isInterface ( ) ) ; if ( NlsMessage . class . equals ( method . getReturnType ( ) ) ) { assert ( NlsBundle . class . isAssignableFrom ( declaringClass ) ) ; return true ; } else if ( ! declaringClass . isAssignableFrom ( NlsBundle ....
public class CmsLoginMessage { /** * Sets the time when to start displaying this message . < p > * @ param timeStart the time to set */ public void setTimeStart ( long timeStart ) { } }
checkFrozen ( ) ; if ( timeStart < 0 ) { throw new CmsIllegalArgumentException ( Messages . get ( ) . container ( Messages . ERR_LOGIN_MESSAGE_BAD_TIME_1 , new Long ( timeStart ) ) ) ; } if ( timeStart == 0 ) { timeStart = DEFAULT_TIME_START ; } m_timeStart = timeStart ;
public class SchematronValidatingParser { /** * Runs the schematron file against the input source . */ public boolean executeSchematronDriver ( InputSource inputDoc , File schemaFile , String phase ) { } }
boolean isValid = false ; ValidationDriver driver = createSchematronDriver ( phase ) ; assert null != driver : "Unable to create Schematron ValidationDriver" ; InputSource is = null ; // Fortify Mod : move fis out so it can be closed on exit FileInputStream fis = null ; try { // FileInputStream fis = new FileInputStrea...
public class Utils { /** * Closes a connection to a database . * @ param conn * @ param logger */ public static void closeConnection ( Connection conn , Logger logger ) { } }
try { if ( conn != null ) conn . close ( ) ; } catch ( SQLException e ) { // Not important . Utils . logException ( logger , e ) ; }
public class ResourceName { /** * Attempts to resolve a resource name into a resource , by calling the associated API . * The resource name must have an endpoint . An optional version can be specified to * determine in which version of the API to call . */ public < T > T resolve ( Class < T > resourceType , @ Nulla...
Preconditions . checkArgument ( hasEndpoint ( ) , "Resource name must have an endpoint." ) ; return resourceNameResolver . resolve ( resourceType , this , version ) ;
public class AnnotationExpander { /** * アノテーションを展開する 。 * @ param targetAnno 展開対象のアノテーション * @ return 展開されたアノテーション * @ throws NullPointerException { @ literal targetAnno = = null . } */ public List < ExpandedAnnotation > expand ( final Annotation targetAnno ) { } }
Objects . requireNonNull ( targetAnno ) ; final List < ExpandedAnnotation > expandedList = new ArrayList < > ( ) ; if ( isRepeated ( targetAnno ) ) { // 繰り返しのアノテーションの場合 、 要素を抽出する 。 try { final Method method = targetAnno . getClass ( ) . getMethod ( "value" ) ; final Annotation [ ] annos = ( Annotation [ ] ) method . in...
public class MessageRouterImpl { /** * Route the message to the LogHandler identified by the given logHandlerId . * @ param msg The fully formatted message . * @ param logRecord The associated LogRecord , in case the LogHandler needs it . * @ param logHandlerId The LogHandler ID in which to route . */ protected v...
LogHandler logHandler = logHandlerServices . get ( logHandlerId ) ; if ( logHandler != null ) { logHandler . publish ( msg , logRecord ) ; }
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 ApiResponse...
com . squareup . okhttp . Call call = getTargetValidateBeforeCall ( id , type , null , null ) ; Type localVarReturnType = new TypeToken < TargetsResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class FileUtils { /** * Write to a file atomically , by first writing to a temporary file in the same directory and then moving it to * the target location . This function attempts to clean up its temporary files when possible , but they may stick * around ( for example , if the JVM crashes partway through e...
return writeAtomically ( file , file . getParentFile ( ) , f ) ;
public class JsCodeBuilder { /** * Adds a { @ code goog . require } * @ param require The namespace being required */ public void addGoogRequire ( GoogRequire require ) { } }
GoogRequire oldRequire = googRequires . put ( require . symbol ( ) , require ) ; if ( oldRequire != null ) { googRequires . put ( require . symbol ( ) , require . merge ( oldRequire ) ) ; }
public class TorrentHandle { /** * For SSL torrents , use this to specify a path to a . pem file to use as * this client ' s certificate . The certificate must be signed by the * certificate in the . torrent file to be valid . * Note that when a torrent first starts up , and it needs a certificate , * it will s...
th . set_ssl_certificate ( certificate , privateKey , dhParams ) ;
public class PowerMockito { /** * Verify a private method invocation for a class with a given verification * mode . * @ see Mockito # verify ( Object ) */ public static PrivateMethodVerification verifyPrivate ( Class < ? > clazz , VerificationMode verificationMode ) { } }
return verifyPrivate ( ( Object ) clazz , verificationMode ) ;
public class GetResponseStubbing { /** * Defines the content body of the response * @ param someContent * the content as string that should be responded * @ return * this stubbing */ public GetResponseStubbing respond ( final String someContent ) { } }
server . addResource ( this . path , someContent . getBytes ( Charset . defaultCharset ( ) ) ) ; return this ;
public class UnsafeOperations { /** * Performs a shallow copy of the given object - a new instance is allocated with the same contents . Any object * references inside the copy will be the same as the original object . * @ param obj Object to copy * @ param < T > The type being copied * @ return A new instance ...
long size = shallowSizeOf ( obj ) ; long address = THE_UNSAFE . allocateMemory ( size ) ; long start = toAddress ( obj ) ; THE_UNSAFE . copyMemory ( start , address , size ) ; @ SuppressWarnings ( "unchecked" ) final T result = ( T ) fromAddress ( address ) ; return result ;
public class ListIncomingTypedLinksRequest { /** * Provides range filters for multiple attributes . When providing ranges to typed link selection , any inexact ranges * must be specified at the end . Any attributes that do not have a range specified are presumed to match the entire * range . * @ param filterAttri...
if ( filterAttributeRanges == null ) { this . filterAttributeRanges = null ; return ; } this . filterAttributeRanges = new java . util . ArrayList < TypedLinkAttributeRange > ( filterAttributeRanges ) ;
public class AnnotationTypeElementDocImpl { /** * Returns the default value of this element . * Returns null if this element has no default . */ public AnnotationValue defaultValue ( ) { } }
return ( sym . defaultValue == null ) ? null : new AnnotationValueImpl ( env , sym . defaultValue ) ;
public class Client { /** * set custom response for the default profile ' s default client * @ param pathName friendly name of path * @ param customData custom response / request data * @ return true if success , false otherwise */ public static boolean setCustomResponseForDefaultProfile ( String pathName , Strin...
try { return setCustomForDefaultProfile ( pathName , true , customData ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return false ;
public class MiniProfilerServlet { /** * Serve one of the static resources for the profiler UI . */ private void doResource ( HttpServletRequest req , HttpServletResponse resp ) throws IOException { } }
boolean success = true ; String resource = ( String ) req . getParameter ( "id" ) ; if ( ! isEmpty ( resource ) ) { if ( resource . endsWith ( ".js" ) ) { resp . setContentType ( "text/javascript" ) ; } else if ( resource . endsWith ( ".css" ) ) { resp . setContentType ( "text/css" ) ; } else if ( resource . endsWith (...
public class AuditFileHandler { /** * Get the default directory for logs * @ return full path String of logs directory */ private String getLogDir ( ) { } }
StringBuffer output = new StringBuffer ( ) ; WsLocationAdmin locationAdmin = locationAdminRef . getService ( ) ; output . append ( locationAdmin . resolveString ( "${server.output.dir}" ) . replace ( '\\' , '/' ) ) . append ( "/logs" ) ; return output . toString ( ) ;
public class RedisClusterStorage { /** * Get the current state of the identified < code > { @ link Trigger } < / code > . * @ param triggerKey the key of the desired trigger * @ param jedis a thread - safe Redis connection * @ return the state of the trigger */ @ Override public Trigger . TriggerState getTriggerS...
final String triggerHashKey = redisSchema . triggerHashKey ( triggerKey ) ; Map < RedisTriggerState , Double > scores = new HashMap < > ( RedisTriggerState . values ( ) . length ) ; for ( RedisTriggerState redisTriggerState : RedisTriggerState . values ( ) ) { scores . put ( redisTriggerState , jedis . zscore ( redisSc...
public class SourcePrinter { /** * String characters only used by lexer , never visited / created directly */ public void visitStringConstructor ( GroovySourceAST t , int visit ) { } }
if ( visit == OPENING_VISIT ) { stringConstructorCounter = 0 ; print ( t , visit , "\"" ) ; } if ( visit == SUBSEQUENT_VISIT ) { // every other subsequent visit use an escaping $ if ( stringConstructorCounter % 2 == 0 ) { print ( t , visit , "$" ) ; } stringConstructorCounter ++ ; } if ( visit == CLOSING_VISIT ) { prin...
public class EditShape { /** * Adds a path */ int addPathFromMultiPath ( MultiPath multi_path , int ipath , boolean as_polygon ) { } }
int newgeom = createGeometry ( as_polygon ? Geometry . Type . Polygon : Geometry . Type . Polyline , multi_path . getDescription ( ) ) ; MultiPathImpl mp_impl = ( MultiPathImpl ) multi_path . _getImpl ( ) ; if ( multi_path . getPathSize ( ipath ) < 2 ) return newgeom ; // return empty geometry // m _ vertices - > reser...
public class AbstractPlainDatagramSocketImpl { /** * set a value - since we only support ( setting ) binary options * here , o must be a Boolean */ public void setOption ( int optID , Object o ) throws SocketException { } }
if ( isClosed ( ) ) { throw new SocketException ( "Socket Closed" ) ; } switch ( optID ) { /* check type safety b4 going native . These should never * fail , since only java . Socket * has access to * PlainSocketImpl . setOption ( ) . */ case SO_TIMEOUT : if ( o == null || ! ( o instanceof Integer ) ) { throw new S...
public class DeploymentPlanResultImpl { /** * Builds the data structures that show the effects of the plan by server group */ private static Map < String , ServerGroupDeploymentPlanResult > buildServerGroupResults ( Map < UUID , DeploymentActionResult > deploymentActionResults ) { } }
Map < String , ServerGroupDeploymentPlanResult > serverGroupResults = new HashMap < String , ServerGroupDeploymentPlanResult > ( ) ; for ( Map . Entry < UUID , DeploymentActionResult > entry : deploymentActionResults . entrySet ( ) ) { UUID actionId = entry . getKey ( ) ; DeploymentActionResult actionResult = entry . g...
public class Operation { /** * The name of the target entity that is associated with the operation : * < ul > * < li > * < b > NAMESPACE < / b > : The namespace ID is returned in the < code > ResourceId < / code > property . * < / li > * < li > * < b > SERVICE < / b > : The service ID is returned in the < c...
setTargets ( targets ) ; return this ;
public class TaskSlotTable { /** * Marks the slot under the given allocation id as inactive . If the slot could not be found , * then a { @ link SlotNotFoundException } is thrown . * @ param allocationId to identify the task slot to mark as inactive * @ param slotTimeout until the slot times out * @ throws Slot...
checkInit ( ) ; TaskSlot taskSlot = getTaskSlot ( allocationId ) ; if ( taskSlot != null ) { if ( taskSlot . markInactive ( ) ) { // register a timeout to free the slot timerService . registerTimeout ( allocationId , slotTimeout . getSize ( ) , slotTimeout . getUnit ( ) ) ; return true ; } else { return false ; } } els...
public class AbstractHCElementWithInternalChildren { /** * Helper method that returns the elements in the correct order for emitting . * This can e . g . be used for sorting or ordering . * @ param aChildren * The children to be emitted . Is a direct reference to the container * where the children are stored . ...
return aChildren ;
public class ArrayUtil { /** * 新建一个空数组 * @ param < T > 数组元素类型 * @ param componentType 元素类型 * @ param newSize 大小 * @ return 空数组 */ @ SuppressWarnings ( "unchecked" ) public static < T > T [ ] newArray ( Class < ? > componentType , int newSize ) { } }
return ( T [ ] ) Array . newInstance ( componentType , newSize ) ;
public class MessageMD5ChecksumHandler { /** * Update the digest using a sequence of bytes that consists of the length ( in 4 bytes ) of the * input ByteBuffer and all the bytes it contains . */ private static void updateLengthAndBytes ( MessageDigest digest , ByteBuffer binaryValue ) { } }
ByteBuffer readOnlyBuffer = binaryValue . asReadOnlyBuffer ( ) ; int size = readOnlyBuffer . remaining ( ) ; ByteBuffer lengthBytes = ByteBuffer . allocate ( INTEGER_SIZE_IN_BYTES ) . putInt ( size ) ; digest . update ( lengthBytes . array ( ) ) ; digest . update ( readOnlyBuffer ) ;
public class CorrelationAnalysisSolution { /** * Returns the linear equation system for printing purposes . If normalization * is null the linear equation system is returned , otherwise the linear * equation system will be transformed according to the normalization . * @ param normalization the normalization , ca...
if ( normalization != null ) { LinearEquationSystem lq = normalization . transform ( linearEquationSystem ) ; lq . solveByTotalPivotSearch ( ) ; return lq ; } else { return linearEquationSystem ; }
public class CmsContainerpageController { /** * Reloads the page . < p > */ public void reloadPage ( ) { } }
Timer timer = new Timer ( ) { @ Override @ SuppressWarnings ( "synthetic-access" ) public void run ( ) { Window . Location . assign ( m_originalUrl ) ; } } ; timer . schedule ( 150 ) ;
public class VaultsInner { /** * Updates the vault . * @ param resourceGroupName The name of the resource group where the recovery services vault is present . * @ param vaultName The name of the recovery services vault . * @ param vault Recovery Services Vault to be created . * @ throws IllegalArgumentException...
return updateWithServiceResponseAsync ( resourceGroupName , vaultName , vault ) . toBlocking ( ) . single ( ) . body ( ) ;
public class KafkaPusher { /** * Push all mbyte array messages to the Kafka topic . * @ param messages List of byte array messages to push to Kakfa . */ public void pushMessages ( List < byte [ ] > messages ) { } }
List < KeyedMessage < String , byte [ ] > > keyedMessages = Lists . transform ( messages , new Function < byte [ ] , KeyedMessage < String , byte [ ] > > ( ) { @ Nullable @ Override public KeyedMessage < String , byte [ ] > apply ( byte [ ] bytes ) { return new KeyedMessage < String , byte [ ] > ( topic , bytes ) ; } }...
public class StreamExecutionEnvironment { /** * Reads the given file line - by - line and creates a data stream that contains a string with the * contents of each such line . The { @ link java . nio . charset . Charset } with the given name will be * used to read the files . * < p > < b > NOTES ON CHECKPOINTING :...
Preconditions . checkArgument ( ! StringUtils . isNullOrWhitespaceOnly ( filePath ) , "The file path must not be null or blank." ) ; TextInputFormat format = new TextInputFormat ( new Path ( filePath ) ) ; format . setFilesFilter ( FilePathFilter . createDefaultFilter ( ) ) ; TypeInformation < String > typeInfo = Basic...
public class NfsResponseBase { /** * Create the object if it is there , or skip the existence check if * < code > force < / code > is < code > true < / code > . Convenience method for use in * subclasses . * @ param xdr * @ param force * do not check whether it is there * @ return the created object */ prot...
NfsGetAttributes attributes = null ; if ( force || xdr . getBoolean ( ) ) { attributes = new NfsGetAttributes ( ) ; attributes . unmarshalling ( xdr ) ; } return attributes ;
public class DefaultAsyncSearchQueryResult { /** * A utility method to return a result when the index is not found . * @ return an { @ link AsyncSearchQueryResult } that will emit a { @ link IndexDoesNotExistException } when calling * its { @ link AsyncSearchQueryResult # hits ( ) hits ( ) } method . * @ deprecat...
// dummy default values SearchStatus status = new DefaultSearchStatus ( 1L , 1L , 0L ) ; SearchMetrics metrics = new DefaultSearchMetrics ( 0L , 0L , 0d ) ; return new DefaultAsyncSearchQueryResult ( status , Observable . < SearchQueryRow > error ( new IndexDoesNotExistException ( "Search Index \"" + indexName + "\" No...
public class Peek { /** * Finish the builder by selecting the base view that you want to show the PeekView from . * @ param activity the PeekViewActivity that you are on . * @ param base the view that you want to touch to apply the peek to . */ public void applyTo ( final PeekViewActivity activity , final View base...
final GestureDetectorCompat detector = new GestureDetectorCompat ( activity , new GestureListener ( activity , base , this ) ) ; base . setOnTouchListener ( new View . OnTouchListener ( ) { @ Override public boolean onTouch ( View view , final MotionEvent motionEvent ) { // we use the detector for the long and short cl...
public class Table { /** * Select records from database table according to search condition * including the specified ( comma separated ) extra tables into the SELECT * clause to facilitate a join in determining the key . * @ param tables the ( comma separated ) names of extra tables to include in * the SELECT ...
String query = "select " + qualifiedListOfFields + " from " + name + "," + tables + " " + condition ; return new Cursor < T > ( this , conn , query ) ;
public class Rabbitify { /** * @ param scriptFile * script file , separated with { @ link Rabbitify # BEGIN _ RABBITIFY } * and { @ link Rabbitify # END _ RABBITIFY } * @ param replacementVars * see { @ link PipelineScriptParser # parse ( ) } * @ param mode * either sender ( the first part of the pipeline )...
LOG . info ( "Rabbitifying pipeline script at '{}'" , scriptFile . getAbsolutePath ( ) + " \n with CLI parameters: " + join ( replacementVars , ", " ) ) ; // SPLITTING PIPELINE final String pipelineLines = asText ( scriptFile ) ; checkArgument ( pipelineLines . length ( ) > 2 ) ; // in 3 parts final List < String > mas...
public class ValueBindingValueExpressionAdapter { /** * / * ( non - Javadoc ) * @ see javax . faces . el . ValueBinding # getValue ( javax . faces . context . FacesContext ) */ public Object getValue ( FacesContext context ) throws EvaluationException , PropertyNotFoundException { } }
if ( context == null ) { throw new NullPointerException ( "FacesContext -> null" ) ; } Object result = null ; try { result = valueExpression . getValue ( context . getELContext ( ) ) ; } catch ( javax . el . PropertyNotFoundException pnfe ) { throw new PropertyNotFoundException ( pnfe ) ; } catch ( ELException elex ) {...
public class JMRandom { /** * Foreach random int . * @ param streamSize the stream size * @ param inclusiveLowerBound the inclusive lower bound * @ param exclusiveUpperBound the exclusive upper bound * @ param eachRandomIntConsumer the each random int consumer */ public static void foreachRandomInt ( int stream...
foreachRandomInt ( streamSize , new Random ( ) , inclusiveLowerBound , exclusiveUpperBound , eachRandomIntConsumer ) ;
public class AcroFields { /** * Gets the field type . The type can be one of : < CODE > FIELD _ TYPE _ PUSHBUTTON < / CODE > , * < CODE > FIELD _ TYPE _ CHECKBOX < / CODE > , < CODE > FIELD _ TYPE _ RADIOBUTTON < / CODE > , * < CODE > FIELD _ TYPE _ TEXT < / CODE > , < CODE > FIELD _ TYPE _ LIST < / CODE > , * < ...
Item fd = getFieldItem ( fieldName ) ; if ( fd == null ) return FIELD_TYPE_NONE ; PdfDictionary merged = fd . getMerged ( 0 ) ; PdfName type = merged . getAsName ( PdfName . FT ) ; if ( type == null ) return FIELD_TYPE_NONE ; int ff = 0 ; PdfNumber ffo = merged . getAsNumber ( PdfName . FF ) ; if ( ffo != null ) { ff =...
public class BaseTable { /** * Dig down and get the physical table for this record . * @ param table * @ param record * @ return */ private BaseTable getPhysicalTable ( PassThruTable table , Record record ) { } }
BaseTable altTable = table . getNextTable ( ) ; if ( altTable instanceof PassThruTable ) { BaseTable physicalTable = getPhysicalTable ( ( PassThruTable ) altTable , record ) ; if ( physicalTable != null ) if ( physicalTable != altTable ) return physicalTable ; } else if ( altTable . getDatabase ( ) . getDatabaseName ( ...
public class DeleteBaiduChannelRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteBaiduChannelRequest deleteBaiduChannelRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteBaiduChannelRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteBaiduChannelRequest . getApplicationId ( ) , APPLICATIONID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall reque...
public class CmsSetupWorkplaceImportThread { /** * Kills this Thread as well as the included logging Thread . < p > */ public void kill ( ) { } }
if ( m_shell != null ) { m_shell . exit ( ) ; } if ( m_loggingThread != null ) { m_loggingThread . stopThread ( ) ; } m_shell = null ; m_setupBean = null ;
public class MetadataUtil { /** * Returns the next parent node which has the specific attribute name defined . * @ param parent * the w3c node from which the search will start . * @ param attrName * the attribute name which is searched for . * @ return a parent node , if the attribute is found , otherwise nul...
Node parentNode = parent ; Element parendElement = ( Element ) parentNode ; Node valueNode = parendElement . getAttributes ( ) . getNamedItem ( attrName ) ; while ( valueNode == null ) { parentNode = parentNode . getParentNode ( ) ; if ( parentNode != null ) { if ( parentNode . getNodeType ( ) == Node . ELEMENT_NODE ) ...
public class StatisticalMoments { /** * Add data with a given weight . * @ param val data * @ param weight weight */ @ Override public void put ( double val , double weight ) { } }
if ( weight <= 0 ) { return ; } if ( this . n == 0 ) { n = weight ; min = max = val ; sum = val * weight ; m2 = m3 = m4 = 0 ; return ; } final double nn = weight + this . n ; final double deltan = val * this . n - this . sum ; final double inc = deltan * weight ; // Some factors used below : final double delta_nn = del...
public class MPdfWriter { /** * Effectue le rendu des headers . * @ param table * MBasicTable * @ param datatable * Table * @ throws BadElementException */ protected void renderHeaders ( final MBasicTable table , final Table datatable ) throws BadElementException { } }
final int columnCount = table . getColumnCount ( ) ; final TableColumnModel columnModel = table . getColumnModel ( ) ; // size of columns float totalWidth = 0 ; for ( int i = 0 ; i < columnCount ; i ++ ) { totalWidth += columnModel . getColumn ( i ) . getWidth ( ) ; } final float [ ] headerwidths = new float [ columnCo...
public class AbstractSARLLaunchConfigurationDelegate { /** * Replies a string that is the concatenation of the given values . * @ param values the values to merge . * @ return the concatenation result . */ protected static String join ( String ... values ) { } }
final StringBuilder buffer = new StringBuilder ( ) ; for ( final String value : values ) { if ( ! Strings . isNullOrEmpty ( value ) ) { if ( buffer . length ( ) > 0 ) { buffer . append ( " " ) ; // $ NON - NLS - 1 $ } buffer . append ( value ) ; } } return buffer . toString ( ) ;
public class CPDefinitionOptionValueRelUtil { /** * Returns the last cp definition option value rel in the ordered set where companyId = & # 63 ; . * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching...
return getPersistence ( ) . fetchByCompanyId_Last ( companyId , orderByComparator ) ;
public class ZipSerializableViewImpl { /** * Serializes the invocation with a custom form * @ serialData After all non - transient fields are written , we send the { @ link Archive } contents encoded as ZIP . */ private void writeObject ( final ObjectOutputStream out ) throws IOException { } }
// Default write of non - transient fields out . defaultWriteObject ( ) ; // Write as ZIP final InputStream in = archive . as ( ZipExporter . class ) . exportAsInputStream ( ) ; try { IOUtil . copy ( in , out ) ; // Don ' t close the outstream // Write the ID explicitly out . writeObject ( id ) ; } finally { // In case...
public class XCostExtension { /** * Assigns ( to the given trace ) multiple amounts given their key lists . The * i - th element in the key list should correspond to an i - level attribute * with the prescribed key . Note that as a side effect this method creates * attributes when it does not find an attribute wi...
XCostAmount . instance ( ) . assignNestedValues ( trace , amounts ) ;
public class RGBE { /** * scalbn ( double x , int n ) < BR > * scalbn ( x , n ) returns x * 2 * * n computed by exponent * manipulation rather than by actually performing an * exponentiation or a multiplication . */ private static double scalbn ( double x , int n ) { } }
int hx = hi ( x ) ; int lx = lo ( x ) ; int k = ( hx & 0x7ff00000 ) >> 20 ; // extract exponent if ( k == 0 ) { // 0 or subnormal x if ( ( lx | ( hx & 0x7fffffff ) ) == 0 ) { return x ; } x *= two54 ; hx = hi ( x ) ; k = ( ( hx & 0x7ff00000 ) >> 20 ) - 54 ; if ( n < - 50000 ) { return tiny * x ; // underflow } } if ( k...
public class ReactiveWifi { /** * Observes WiFi signal level with predefined max num levels . * Returns WiFi signal level as enum with information about current level * @ param context Context of the activity or an application * @ return WifiSignalLevel as an enum */ @ RequiresPermission ( ACCESS_WIFI_STATE ) pub...
return observeWifiSignalLevel ( context , WifiSignalLevel . getMaxLevel ( ) ) . map ( new Function < Integer , WifiSignalLevel > ( ) { @ Override public WifiSignalLevel apply ( Integer level ) throws Exception { return WifiSignalLevel . fromLevel ( level ) ; } } ) ;
public class CmsSitemapExtensionConnector { /** * Opens the page copy dialog . < p > * @ param id the structure id of the resource for which to open the dialog * @ param callback the native callback to call with the result when the dialog has finished */ public void openPageCopyDialog ( String id , JavaScriptObject...
openPageCopyDialog ( id , CmsJsUtil . wrapCallback ( callback ) ) ;
public class BlockInlineChecksumReader { /** * Calculate CRC Checksum of the whole block . Implemented by concatenating * checksums of all the chunks . * @ param datanode * @ param ri * @ param namespaceId * @ param block * @ return * @ throws IOException */ static public int getBlockCrc ( DataNode datano...
InputStream rawStreamIn = null ; DataInputStream streamIn = null ; int blockCrc = 0 ; try { int bytesPerCRC ; int checksumSize ; bytesPerCRC = ri . getBytesPerChecksum ( ) ; int checksumType = ri . getChecksumType ( ) ; if ( checksumType != DataChecksum . CHECKSUM_CRC32 ) { throw new IOException ( "File Checksum now is...
public class WarBuilder { /** * the assumption is that the Runner is invoked in the WAR module ' s directory */ private boolean isWar ( String path ) { } }
String currentDir = Paths . get ( "." ) . toAbsolutePath ( ) . normalize ( ) . toString ( ) ; String classesDirPath = Paths . get ( path ) . toAbsolutePath ( ) . normalize ( ) . toString ( ) ; return classesDirPath . startsWith ( currentDir ) ;
public class PutObjectProgressBar { /** * MinioClient . putObjectProgressBar ( ) example . */ public static void main ( String [ ] args ) throws InvalidKeyException , NoSuchAlgorithmException , InvalidEndpointException , InvalidPortException , InvalidBucketNameException , InsufficientDataException , NoResponseException...
/* play . min . io for test and development . */ MinioClient minioClient = new MinioClient ( "https://play.min.io:9000" , "Q3AM3UQ867SPQQA43P2F" , "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" ) ; /* Amazon S3: */ // MinioClient minioClient = new MinioClient ( " https : / / s3 . amazonaws . com " , // " YOUR - ACCESSKEYID...
public class ListMailboxPermissionsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListMailboxPermissionsRequest listMailboxPermissionsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listMailboxPermissionsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listMailboxPermissionsRequest . getOrganizationId ( ) , ORGANIZATIONID_BINDING ) ; protocolMarshaller . marshall ( listMailboxPermissionsRequest . getEntit...
public class GetIndividualProfilesRequest { /** * Request the IndividualProfile for the given login and password . * This option is mutually exclusive with { @ link # withIndividualId ( int ) } * and { @ link # withMICR ( String , String ) } . * @ param login The individual ' s login . * @ param password The in...
this . login = login ; this . password = password ; this . id = 0 ; this . accountNumber = this . routingNumber = null ; return this ;
public class AbstractLockTableHandler { /** * { @ inheritDoc } */ public void removeLockedNode ( String nodeId ) throws SQLException { } }
ResultSet resultSet = null ; PreparedStatement preparedStatement = null ; Connection jdbcConnection = openConnection ( ) ; try { InspectionQuery query = getDeleteQuery ( nodeId ) ; preparedStatement = jdbcConnection . prepareStatement ( query . getStatement ( ) ) ; preparedStatement . executeUpdate ( ) ; } finally { JD...
public class ProcessorConfigurationUtils { /** * Wraps an implementation of { @ link ICDATASectionProcessor } into an object that adds some information * required internally ( like e . g . the dialect this processor was registered for ) . * This method is meant for < strong > internal < / strong > use only . * @ ...
Validate . notNull ( dialect , "Dialect cannot be null" ) ; if ( processor == null ) { return null ; } return new CDATASectionProcessorWrapper ( processor , dialect ) ;
public class CmsAliasManager { /** * Saves the aliases for a given structure id , < b > completely replacing < / b > any existing aliases for the same structure id . < p > * @ param cms the current CMS context * @ param structureId the structure id of a resource * @ param aliases the list of aliases which should ...
m_securityManager . saveAliases ( cms . getRequestContext ( ) , cms . readResource ( structureId ) , aliases ) ; touch ( cms , cms . readResource ( structureId ) ) ;
public class PluginDefaultGroovyMethods { /** * If the optional contains a value , returns an optional containing the transformed value obtained using the < code > transform < / code > closure * or otherwise an empty optional . * < pre class = " groovyTestCase " > * assert Optional . of ( " foobar " ) . collect {...
Objects . requireNonNull ( self ) ; Objects . requireNonNull ( transform ) ; if ( ! self . isPresent ( ) ) { return self . empty ( ) ; } return Optional . ofNullable ( transform . call ( self . get ( ) ) ) ;
public class FilterMenuLayout { /** * calculate distance of two points * @ param a * @ param b * @ return */ private static double pointsDistance ( Point a , Point b ) { } }
int dx = b . x - a . x ; int dy = b . y - a . y ; return Math . sqrt ( dx * dx + dy * dy ) ;
public class InputMapTemplate { /** * When the given event type occurs and { @ code condition } is false , * consumes the event and does not attempt to match additional * { @ code InputMap } s ( if they exist ) . If { @ code condition } is true , continues to try to pattern match * the event type with the next { ...
return consumeUnless ( EventPattern . eventType ( eventType ) , condition , action ) ;
public class FacebookEndpoint { /** * Finishes a { @ link com . groundupworks . wings . facebook . FacebookEndpoint # startSettingsRequest ( android . app . Activity , android . support . v4 . app . Fragment ) } . * @ param requestCode the integer request code originally supplied to startActivityForResult ( ) , allow...
FacebookSettings settings = null ; if ( requestCode == SETTINGS_REQUEST_CODE && resultCode == Activity . RESULT_OK && data != null ) { // Construct settings from the extras bundle . settings = FacebookSettings . newInstance ( data . getExtras ( ) ) ; } return settings ;
public class Readability { /** * Get the number of times a string s appears in the node e . * @ param e * @ param s * @ return */ private static int getCharCount ( Element e , String s ) { } }
if ( s == null || s . length ( ) == 0 ) { s = "," ; } return getInnerText ( e , true ) . split ( s ) . length ;
public class CauseOfBlockage { /** * Obtains a simple implementation backed by { @ link Localizable } . */ public static CauseOfBlockage fromMessage ( @ Nonnull final Localizable l ) { } }
l . getKey ( ) ; // null check return new CauseOfBlockage ( ) { @ Override public String getShortDescription ( ) { return l . toString ( ) ; } } ;
public class InfoPanelService { /** * Search children of the specified parent for an occurrence of an active info panel . This is a * recursive , breadth - first search of the component tree . * @ param parent Parent whose children are to be searched . * @ param exclude An optional child to be excluded from the s...
IInfoPanel infoPanel = null ; if ( parent != null ) { for ( ElementBase child : parent . getChildren ( ) ) { if ( ( child != exclude ) && ( ( infoPanel = getInfoPanel ( child , activeOnly ) ) != null ) ) { break ; } } if ( infoPanel == null ) { for ( ElementBase child : parent . getChildren ( ) ) { if ( ( child != excl...
public class LinkDeserializer { /** * Non whitespace ; could possibly be narrowed */ @ Override public Link deserialize ( JsonParser jp , DeserializationContext ctxt ) throws IOException { } }
String tmp = jp . getText ( ) ; validate ( jp , tmp , "{" ) ; jp . nextToken ( ) ; // skip over { to the rel String rel = jp . getText ( ) ; validateText ( jp , rel ) ; jp . nextToken ( ) ; // skip over { tmp = jp . getText ( ) ; validate ( jp , tmp , "{" ) ; jp . nextToken ( ) ; // skip over " href " tmp = jp . getTex...
public class EntityTypesClient { /** * Deletes the specified entity type . * < p > Sample code : * < pre > < code > * try ( EntityTypesClient entityTypesClient = EntityTypesClient . create ( ) ) { * EntityTypeName name = EntityTypeName . of ( " [ PROJECT ] " , " [ ENTITY _ TYPE ] " ) ; * entityTypesClient . d...
DeleteEntityTypeRequest request = DeleteEntityTypeRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; deleteEntityType ( request ) ;
public class PopulateHelper { /** * 将request中的参数设置到clazz对应的bean 。 * @ param clazz * @ param name */ @ SuppressWarnings ( "unchecked" ) public static < T > T populate ( Class < T > clazz , String name ) { } }
EntityType type = null ; if ( clazz . isInterface ( ) ) { type = Model . getType ( clazz . getName ( ) ) ; } else { type = Model . getType ( clazz ) ; } return ( T ) populate ( type . newInstance ( ) , type . getEntityName ( ) , name ) ;
public class StgFileSource { /** * Initialize the file source with any parameters presented by the constructors . * @ param file a file with all information * @ param directory a directory to locate a file in * @ param fileName a file name with or without path information * @ param option an option on how to lo...
super . init ( file , directory , fileName , option ) ; if ( ! this . errors . hasErrors ( ) ) { if ( ! "stg" . equals ( this . getFileExtension ( ) ) ) { this . errors . addError ( "file name must have '.stg' extension" ) ; this . reset ( ) ; } else { } }
public class voice { /** * Get all results from the Google Speech Recognition activity ( DO NOT FORGET call this function on * onActivityResult ( ) ) * @ param requestCode * - onActivityResult request code * @ param resultCode * - onActivityResult result code * @ param data * - onActivityResult Intent dat...
ArrayList < String > matches = null ; if ( requestCode == 0 && resultCode == - 1 ) { matches = data . getStringArrayListExtra ( RecognizerIntent . EXTRA_RESULTS ) ; StringBuilder sb = new StringBuilder ( ) ; for ( String match : matches ) { sb . append ( match + ", " ) ; } } return matches ;
public class JSONObjectException { /** * Method called to prepend a reference information in front of * current path */ public void prependPath ( Object referrer , int index ) { } }
Reference ref = new Reference ( referrer , index ) ; prependPath ( ref ) ;
public class LoadStatistics { /** * Computes a self - consistent snapshot of the load statistics . * Note : The original method of computing load statistics would compute the total and idle counts independently * which could lead to counting errors while jobs started in between the different state counting operatio...
if ( modern ) { return computeSnapshot ( Jenkins . getInstance ( ) . getQueue ( ) . getBuildableItems ( ) ) ; } else { int t = computeTotalExecutors ( ) ; int i = computeIdleExecutors ( ) ; return new LoadStatisticsSnapshot ( t , t , Math . max ( i - t , 0 ) , Math . max ( t - i , 0 ) , i , i , computeQueueLength ( ) )...
public class JSMin { /** * get - - return the next character from stdin . Watch out for lookahead . If * the character is a control character , translate it to a space or * linefeed . */ private int get ( boolean inStringLiteral ) throws IOException { } }
int c = theLookahead ; theLookahead = EOF ; if ( c == EOF ) { c = in . read ( ) ; if ( c != EOF ) { currentByteIndex ++ ; } } if ( c == '\n' ) { line ++ ; column = 0 ; } else { column ++ ; } if ( c >= ' ' || c == '\n' || c == EOF || ( inStringLiteral && c == '\t' ) ) { // Handle // the // case // of // tab // character...
public class RaidNode { /** * Stop all RaidNode threads and wait for all to finish . */ public void stop ( ) { } }
if ( stopRequested ) { return ; } stopRequested = true ; running = false ; if ( server != null ) server . stop ( ) ; if ( triggerThread != null ) { triggerThread . interrupt ( ) ; triggerMonitor = null ; } if ( urfThread != null ) { urfThread . interrupt ( ) ; urfProcessor = null ; } if ( blockIntegrityMonitor != null ...
public class EventImpl { /** * { @ inheritDoc } */ public List < String > getPropertyNames ( ) { } }
final int size = this . properties . size ( ) ; if ( 0 == size ) { return Collections . emptyList ( ) ; } List < String > names = new ArrayList < String > ( size ) ; names . addAll ( this . properties . keySet ( ) ) ; return names ;
public class LargeList { /** * Select values from list . * @ param value value to select * @ return list of entries selected */ @ SuppressWarnings ( "serial" ) public List < ? > find ( Value value ) throws AerospikeException { } }
Key subKey = makeSubKey ( value ) ; Record record = client . get ( this . policy , subKey , ListElementBinName ) ; if ( record != null ) { final Object result = record . getValue ( ListElementBinName ) ; return new ArrayList < Object > ( ) { { add ( result ) ; } } ; } else { return null ; }
public class Parser { /** * < p > Filter the SQL string of Java SQL Escape clauses . < / p > * < p > Currently implemented Escape clauses are those mentioned in 11.3 in the specification . * Basically we look through the sql string for { d xxx } , { t xxx } , { ts xxx } , { oj xxx } or { fn xxx } * in non - strin...
if ( replaceProcessingEnabled ) { // Since escape codes can only appear in SQL CODE , we keep track // of if we enter a string or not . int len = sql . length ( ) ; char [ ] chars = sql . toCharArray ( ) ; StringBuilder newsql = new StringBuilder ( len ) ; int i = 0 ; while ( i < len ) { i = parseSql ( chars , i , news...
public class ELImageInputTag { /** * Resets attribute values for tag reuse . */ @ Override public void release ( ) { } }
super . release ( ) ; setBase64Expr ( null ) ; setAlignExpr ( null ) ; setAltExpr ( null ) ; setBorderExpr ( null ) ; setDirExpr ( null ) ; setDisabledExpr ( null ) ; setLangExpr ( null ) ; setOnblurExpr ( null ) ; setOnchangeExpr ( null ) ; setOnclickExpr ( null ) ; setOndblclickExpr ( null ) ; setOnfocusExpr ( null )...
public class SerializerFactory { /** * Returns a deserializer based on a string type . */ public Deserializer getDeserializer ( String type ) throws HessianProtocolException { } }
if ( type == null || type . equals ( "" ) ) return null ; Deserializer deserializer ; deserializer = ( Deserializer ) _cachedTypeDeserializerMap . get ( type ) ; if ( deserializer != null ) return deserializer ; deserializer = ( Deserializer ) _staticTypeMap . get ( type ) ; if ( deserializer != null ) return deseriali...
public class FTPConnector { /** * Connects and authenticates with the ftp server specified by the * { @ code ftpUrl } . * @ param ftpUrl { @ link URL } , the ftp server url * @ throws ResourceDownloadError - Thrown if there was an ftp error * connecting or authenticating with the ftp server . */ public void con...
if ( ! ftpUrl . getProtocol ( ) . equals ( "ftp" ) ) { throw new InvalidArgument ( "The ftp connection does not support protocol '" + ftpUrl . getProtocol ( ) + "', only 'ftp'." ) ; } // connect to ftp server String host = ftpUrl . getHost ( ) ; int port = ftpUrl . getPort ( ) == - 1 ? DEFAULT_FTP_PORT : ftpUrl . getPo...
public class SipPacketImpl { /** * ( non - Javadoc ) * @ see io . pkts . packet . sip . SipPacket # getHeader ( java . lang . String ) */ @ Override public Optional < SipHeader > getHeader ( final String headerName ) throws SipPacketParseException { } }
return this . msg . getHeader ( headerName ) ;
public class ChainedProperty { /** * Returns a new ChainedProperty which contains everything that follows * this ChainedProperty ' s prime property . * @ throws IllegalStateException if chain count is zero */ public ChainedProperty < ? > tail ( ) { } }
if ( getChainCount ( ) == 0 ) { throw new IllegalStateException ( ) ; } if ( getChainCount ( ) == 1 ) { if ( ! isOuterJoin ( 1 ) ) { return get ( mChain [ 0 ] ) ; } else { return get ( mChain [ 0 ] , null , new boolean [ ] { true } ) ; } } StorableProperty < ? > [ ] newChain = new StorableProperty [ getChainCount ( ) -...
public class KeyVaultClientCustomImpl { /** * Get a specified secret from a given key vault . * @ param secretIdentifier * The URL for the secret . * @ param serviceCallback * the async ServiceCallback to handle successful and failed * responses . * @ return the { @ link ServiceFuture } object */ public Ser...
SecretIdentifier id = new SecretIdentifier ( secretIdentifier ) ; return getSecretAsync ( id . vault ( ) , id . name ( ) , id . version ( ) == null ? "" : id . version ( ) , serviceCallback ) ;
public class BOGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . BOG__OEG_NAME : setOEGName ( ( String ) newValue ) ; return ; case AfplibPackage . BOG__TRIPLETS : getTriplets ( ) . clear ( ) ; getTriplets ( ) . addAll ( ( Collection < ? extends Triplet > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class PlatformDescription { /** * Describes the platform . Outputs Java version and vendor . * @ return Description of the current platform */ public static String describePlatform ( ) { } }
String desc = "Java " + SPECIFICATION_VERSION + " (" + "VM vendor name=\"" + VENDOR + "\", " + "VM vendor version=" + VENDOR_VERSION + ", " + "JVM name=\"" + JVM_NAME + "\", " + "JVM version=" + VM_VERSION + ", " + "JVM info=" + VM_INFO ; // Add the API level if it ' s an Android platform if ( ANDROID_VERSION != 0 ) { ...
public class Publishers { /** * Is the given object a Publisher or convertible to a publisher . * @ param object The object * @ return True if it is */ public static boolean isConvertibleToPublisher ( Object object ) { } }
if ( object == null ) { return false ; } if ( object instanceof Publisher ) { return true ; } else { return isConvertibleToPublisher ( object . getClass ( ) ) ; }
public class MsgPackOutput { /** * Writes a MessagePack long . * @ param value the value * @ throws IOException if an error occurs */ void writeLong ( long value ) throws IOException { } }
if ( value < MIN_FIX_INT ) { // large negative if ( value >= Byte . MIN_VALUE ) { output . writeByte ( SINT_8 ) ; output . writeByte ( ( byte ) value ) ; } else if ( value >= Short . MIN_VALUE ) { output . writeByte ( SINT_16 ) ; output . writeShort ( ( short ) value ) ; } else if ( value >= Integer . MIN_VALUE ) { out...
public class CPDefinitionOptionValueRelUtil { /** * Returns the cp definition option value rel where uuid = & # 63 ; and groupId = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param uuid the uuid * @ param groupId the group ID * @ param retrieveFr...
return getPersistence ( ) . fetchByUUID_G ( uuid , groupId , retrieveFromCache ) ;
public class CPDefinitionGroupedEntryPersistenceImpl { /** * Caches the cp definition grouped entry in the entity cache if it is enabled . * @ param cpDefinitionGroupedEntry the cp definition grouped entry */ @ Override public void cacheResult ( CPDefinitionGroupedEntry cpDefinitionGroupedEntry ) { } }
entityCache . putResult ( CPDefinitionGroupedEntryModelImpl . ENTITY_CACHE_ENABLED , CPDefinitionGroupedEntryImpl . class , cpDefinitionGroupedEntry . getPrimaryKey ( ) , cpDefinitionGroupedEntry ) ; finderCache . putResult ( FINDER_PATH_FETCH_BY_UUID_G , new Object [ ] { cpDefinitionGroupedEntry . getUuid ( ) , cpDefi...
public class XmlUtils { /** * Parses an XML document from a file . * @ param file the file * @ return the parsed DOM * @ throws SAXException if the XML is not valid * @ throws IOException if there is a problem reading from the file */ public static Document toDocument ( File file ) throws SAXException , IOExcep...
InputStream in = new BufferedInputStream ( new FileInputStream ( file ) ) ; try { return XmlUtils . toDocument ( in ) ; } finally { in . close ( ) ; }
public class SVGParser { /** * Parse a font family list */ private static List < String > parseFontFamily ( String val ) { } }
List < String > fonts = null ; TextScanner scan = new TextScanner ( val ) ; while ( true ) { String item = scan . nextQuotedString ( ) ; if ( item == null ) item = scan . nextTokenWithWhitespace ( ',' ) ; if ( item == null ) break ; if ( fonts == null ) fonts = new ArrayList < > ( ) ; fonts . add ( item ) ; scan . skip...
public class SimpleMeasureManager { /** * Provides the keys of all the { @ link Measure } s which are supported by this * { @ link SimpleMeasureManager } . If a key is provided , then at least one * version is available through { @ link # getPullMeasure ( Object ) } or * { @ link # getPushMeasure ( Object ) } . *...
HashSet < Object > keys = new HashSet < > ( ) ; keys . addAll ( pullers . keySet ( ) ) ; keys . addAll ( pushers . keySet ( ) ) ; return keys ;
public class RecurlyClient { /** * Redeem a Gift Card * @ param redemptionCode The redemption code the { @ link GiftCard } * @ param accountCode The account code for the { @ link Account } * @ return The updated { @ link GiftCard } object as identified by the passed in id */ public GiftCard redeemGiftCard ( final...
final GiftCard . Redemption redemptionData = GiftCard . createRedemption ( accountCode ) ; final String url = GiftCards . GIFT_CARDS_RESOURCE + "/" + redemptionCode + "/redeem" ; return doPOST ( url , redemptionData , GiftCard . class ) ;
public class InnerRankUpdate_DDRB { /** * Rank N update function for a symmetric inner submatrix and only operates on the lower * triangular portion of the submatrix . < br > * < br > * A = A - B * B < sup > T < / sup > < br > */ public static void symmRankNMinus_L ( int blockLength , DSubmatrixD1 A , DSubmatrixD...
int widthB = B . col1 - B . col0 ; if ( widthB > blockLength ) throw new IllegalArgumentException ( "Width of B cannot be greater than the block length" ) ; int N = B . row1 - B . row0 ; if ( A . col1 - A . col0 != N ) throw new IllegalArgumentException ( "A does not have the expected number of columns based on B's hei...
public class CreateSubscriptionDefinitionRequest { /** * Tag ( s ) to add to the new resource * @ param tags * Tag ( s ) to add to the new resource * @ return Returns a reference to this object so that method calls can be chained together . */ public CreateSubscriptionDefinitionRequest withTags ( java . util . Ma...
setTags ( tags ) ; return this ;